[
  {
    "path": ".gitignore",
    "content": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndevelop-eggs/\ndist/\neggs/\n.eggs/\n.vscode/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n.DS_Store\n\n.env/\n.trash/\nckpts/\nlogs/\ndata/\noutputs/\nfigures*/\nexamples/\nrebuttal/\napps/\n*.sh\nrun.py"
  },
  {
    "path": "LICENSE.txt",
    "content": "Tencent is pleased to support the open source community by making FreeSplatter available. \n\nCopyright (C) 2024 THL A29 Limited, a Tencent company.  All rights reserved. \n\nFreeSplatter IS NOT INTENDED FOR USE WITHIN THE EUROPEAN UNION.\n\nFor avoidance of doubts, FreeSplatter means the inference-enabling code, parameters, and weights of this model made publicly available by Tencent in accordance with the following License Terms.\n\n\nLicense Terms of the FreeSplatter:\n--------------------------------------------------------------------\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n1. Definitions.\n\n\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\nYou must give any other recipients of the Work or Derivative Works a copy of this License; and \n\nYou must cause any modified files to carry prominent notices stating that You changed the files; and \n\nYou must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and \n\nIf the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. \n\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. \n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND OF TERMS AND CONDITIONS\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n  \n# FreeSplatter: Pose-free Gaussian Splatting for Sparse-view 3D Reconstruction\n\n<a href='https://bluestyle97.github.io/projects/freesplatter/'><img src='https://img.shields.io/badge/Project_Page-Website-red?logo=googlechrome&logoColor=white' alt='Project Page'></a>\n<a href=\"https://arxiv.org/abs/2412.09573\"><img src='https://img.shields.io/badge/arXiv-Paper-green?logo=arxiv&logoColor=white' alt='arXiv'></a>\n<a href=\"https://huggingface.co/TencentARC/FreeSplatter\"><img src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Model_Card-Huggingface-orange\"></a> \n<a href=\"https://huggingface.co/spaces/TencentARC/FreeSplatter\"><img src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Gradio%20Demo-Huggingface-orange\"></a> <br>\n\n**ICCV 2025**\n\n</div>\n\n---\n\nThis repo is the official implementation of FreeSplatter, a feed-forward framework capable of generating high-quality 3D Gaussians from uncalibrated sparse-view images and recovering their camera parameters in mere seconds.\n\n\nhttps://github.com/user-attachments/assets/0c73b693-9428-46bd-843c-132434b9686f\n\n# ⚙️ Installation\n\nWe recommend using `Python>=3.10`, `PyTorch>=2.1.0`, and `CUDA>=12.1`.\n```bash\nconda create --name freesplatter python=3.10\nconda activate freesplatter\npip install -U pip\n\n# Install PyTorch and xformers\n# You may need to install another xformers version if you use a different PyTorch version\npip install torch==2.4.0 torchvision==0.19.0 --index-url https://download.pytorch.org/whl/cu121\npip install xformers==0.0.27.post2\n\n# Install other requirements\npip install -r requirements.txt\n```\n\n# 🤖 Pretrained Models\n\nWe provide the following pretrained models:\n\n| Model | Description | #Params | Download |\n| --- | --- | --- | --- |\n| FreeSplatter-O | Object-level reconstruction model | 306M | [Download](https://huggingface.co/TencentARC/FreeSplatter/blob/main/freesplatter-object.safetensors) |\n| FreeSplatter-O-2dgs | Object-level reconstruction model using [2DGS](https://surfsplatting.github.io/) (finetuned from FreeSplatter-O) | 306M | [Download](https://huggingface.co/TencentARC/FreeSplatter/blob/main/freesplatter-object-2dgs.safetensors) |\n| FreeSplatter-S | Scene-level reconstruction model | 306M | [Download](https://huggingface.co/TencentARC/FreeSplatter/blob/main/freesplatter-scene.safetensors) |\n\n# 💫 Inference\n\nWe recommand to start a gradio demo in your local machine, simply run:\n```bash\npython app.py\n```\n\n# ⚖️ License\n\nFreeSplatter's code and models are licensed under the [Apache 2.0 License](LICENSE.txt) with additional restrictions to comply with Tencent's open-source policies. Besides, the libraries [Hunyuan3D-1](https://github.com/Tencent/Hunyuan3D-1) and [BRIAAI RMBG-2.0](https://huggingface.co/briaai/RMBG-2.0) have their own non-commercial licenses.\n\n# :books: Citation\n\nIf you find our work useful for your research or applications, please cite using this BibTeX:\n\n```BibTeX\n@article{xu2024freesplatter,\n  title={FreeSplatter: Pose-free Gaussian Splatting for Sparse-view 3D Reconstruction},\n  author={Xu, Jiale and Gao, Shenghua and Shan, Ying},\n  journal={arXiv preprint arXiv:2412.09573},\n  year={2024}\n}\n```\n"
  },
  {
    "path": "app.py",
    "content": "import os\nif 'OMP_NUM_THREADS' not in os.environ:\n    os.environ['OMP_NUM_THREADS'] = '16'\nimport torch\nimport gradio as gr\nfrom functools import partial\nfrom huggingface_hub import snapshot_download\n\nfrom freesplatter.webui.runner import FreeSplatterRunner\nfrom freesplatter.webui.tab_img_to_3d import create_interface_img_to_3d\nfrom freesplatter.webui.tab_views_to_3d import create_interface_views_to_3d\nfrom freesplatter.webui.tab_views_to_scene import create_interface_views_to_scene\n\n\nos.makedirs('./ckpts/Hunyuan3D-1', exist_ok=True)\nsnapshot_download('tencent/Hunyuan3D-1', repo_type='model', local_dir='./ckpts/Hunyuan3D-1')\n\ntorch.set_grad_enabled(False)\ndevice = torch.device('cuda')\nrunner = FreeSplatterRunner(device)\n\n\n_HEADER_ = '''\n# FreeSplatter 🤗 Gradio Demo\n\\n\\nOfficial demo of the paper [FreeSplatter: Pose-free Gaussian Splatting for Sparse-view 3D Reconstruction](https://arxiv.org/abs/2412.09573). [[Github]](https://github.com/TencentARC/FreeSplatter)  \n**FreeSplatter** is a feed-forward framework capable of generating high-quality 3D Gaussians from **uncalibrated** sparse-view images and recovering their camera parameters in mere seconds.  \n'''\n\n_IMG_TO_3D_HELP_ = '''\n💡💡💡**Usage Tips:**\n- This demo supports various multi-view diffusion models, including [Hunyuan3D](https://github.com/Tencent/Hunyuan3D-1) Std and [Zero123++](https://github.com/SUDO-AI-3D/zero123plus) v1.1/v1.2. You can try different models to get the best result.\n- Try clicking the \\U0001f3b2\\ufe0f button to use a different `Random seed` (default: 42) for diverse outputs.\n- In most cases, using `2DGS` leads to better mesh geometry than `3DGS`. Please refer to [2DGS paper](https://arxiv.org/abs/2403.17888).\n- You can adjust the views used for reconstruction to alleviate the blurry texture problem caused by multi-view inconsistency.\n'''\n\n_VIEWS_TO_3D_HELP_ = '''\n💡💡💡**Usage Tips:**\n- Our model assumes white-background input images with centered objects. Please enable the `Remove background` option if the images are not white-background.\n- Our model assumes an equal focal length for all input images, otherwise the results may be degraded.\n'''\n\n_VIEWS_TO_SCENE_HELP_ = '''\n💡💡💡**Usage Tips:**\n- While our model architecture makes no assumption on the number of input images, the current model was only trained on a two-view setting.\n- The input images will be center-cropped and resized to 512x512.\n- The visualized camera poses are normalized to make the baseline equal to 1.0.\n'''\n\n_CITE_ = r\"\"\"\nIf FreeSplatter is helpful, please help to ⭐ the <a href='https://github.com/TencentARC/FreeSplatter' target='_blank'>Github Repo</a>. Thanks! [![GitHub Stars](https://img.shields.io/github/stars/TencentARC/FreeSplatter?style=social)](https://github.com/TencentARC/FreeSplatter)\n---\n📝 **Citation**\nIf you find our work useful for your research or applications, please cite using this bibtex:\n```bibtex\n@article{xu2024freesplatter,\n  title={FreeSplatter: Pose-free Gaussian Splatting for Sparse-view 3D Reconstruction},\n  author={Xu, Jiale and Gao, Shenghua and Shan, Ying},\n  journal={arXiv preprint},\n  year={2024}\n}\n```\n📋 **License**\nApache-2.0 LICENSE. Please refer to the [LICENSE file](https://huggingface.co/spaces/TencentARC/FreeSplatter/blob/main/LICENSE) for details.\n📧 **Contact**\nIf you have any questions, feel free to open a discussion or contact us at <b>bluestyle928@gmail.com</b>.\n\"\"\"\n\n\nwith gr.Blocks(analytics_enabled=False, title='FreeSplatter Demo', theme=gr.themes.Ocean()) as demo:\n    gr.Markdown(_HEADER_)\n\n    with gr.Tabs() as main_tabs:\n        with gr.TabItem('Image-to-3D', id='tab_img_to_3d'):\n            gr.Markdown(_IMG_TO_3D_HELP_)\n\n            with gr.Tabs() as sub_tabs_img_to_3d:\n                with gr.TabItem('Hunyuan3D Std', id='tab_hunyuan3d_std'):\n                    _, var_img_to_3d_hunyuan3d_std = create_interface_img_to_3d(\n                        runner.run_segmentation,\n                        runner.run_img_to_3d, \n                        model='Hunyuan3D Std')\n                with gr.TabItem('Zero123++ v1.1', id='tab_zero123plus_v11'):\n                    _, var_img_to_3d_zero123plus_v11 = create_interface_img_to_3d(\n                        runner.run_segmentation,\n                        runner.run_img_to_3d, \n                        model='Zero123++ v1.1')\n                with gr.TabItem('Zero123++ v1.2', id='tab_zero123plus_v12'):\n                    _, var_img_to_3d_zero123plus_v12 = create_interface_img_to_3d(\n                        runner.run_segmentation,\n                        runner.run_img_to_3d, \n                        model='Zero123++ v1.2')\n\n        with gr.TabItem('Sparse-view Reconstruction (Object)', id='tab_views_to_3d'):\n            gr.Markdown(_VIEWS_TO_3D_HELP_)\n\n            _, var_views_to_3d = create_interface_views_to_3d(\n                runner.run_views_to_3d)\n        \n        with gr.TabItem('Sparse-view Reconstruction (Scene)', id='tab_views_to_scene'):\n            gr.Markdown(_VIEWS_TO_SCENE_HELP_)\n\n            _, var_views_to_scene = create_interface_views_to_scene(\n                runner.run_views_to_scene)\n\n\n    gr.Markdown(_CITE_)\n\ndemo.queue().launch(\n    share=False, \n    server_name=\"0.0.0.0\", \n    server_port=41137, \n    ssl_verify=False,\n)\n"
  },
  {
    "path": "configs/freesplatter-object-2dgs.yaml",
    "content": "model:\n  target: freesplatter.models.model.FreeSplatterModel\n  params:\n    transformer_config:\n      target: freesplatter.models.transformer.Transformer\n      params:\n        patch_size: 8\n        input_dim: 3\n        inner_dim: 1024\n        output_dim: 22\n        depth: 24\n        n_heads: 16\n    renderer_config:\n      sh_degree: 1\n      img_height: 512\n      img_width: 512\n      scaling_activation_type: sigmoid\n      scale_min_act: 0.0001\n      scale_max_act: 0.02\n      scale_multi_act: 0.1\n    sh_residual: false\n    use_2dgs: true"
  },
  {
    "path": "configs/freesplatter-object.yaml",
    "content": "model:\n  target: freesplatter.models.model.FreeSplatterModel\n  params:\n    transformer_config:\n      target: freesplatter.models.transformer.Transformer\n      params:\n        patch_size: 8\n        input_dim: 3\n        inner_dim: 1024\n        output_dim: 23\n        depth: 24\n        n_heads: 16\n    renderer_config:\n      sh_degree: 1\n      img_height: 512\n      img_width: 512\n      scaling_activation_type: sigmoid\n      scale_min_act: 0.0001\n      scale_max_act: 0.02\n      scale_multi_act: 0.1\n    sh_residual: false\n"
  },
  {
    "path": "configs/freesplatter-scene.yaml",
    "content": "model:\n  target: freesplatter.models.model.FreeSplatterModel\n  params:\n    transformer_config:\n      target: freesplatter.models.transformer.Transformer\n      params:\n        patch_size: 8\n        input_dim: 3\n        inner_dim: 1024\n        output_dim: 23\n        depth: 24\n        n_heads: 16\n    renderer_config:\n      sh_degree: 1\n      img_height: 512\n      img_width: 512\n      scaling_activation_type: sigmoid\n      scale_min_act: 0.0001\n      scale_max_act: 0.02\n      scale_multi_act: 0.1\n      bg_color: [0., 0., 0.]\n    sh_residual: true\n"
  },
  {
    "path": "freesplatter/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/hunyuan/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/hunyuan/hunyuan3d_mvd_std_pipeline.py",
    "content": "# Open Source Model Licensed under the Apache License Version 2.0 and Other Licenses of the Third-Party Components therein:\n# The below Model in this distribution may have been modified by THL A29 Limited (\"Tencent Modifications\"). All Tencent Modifications are Copyright (C) 2024 THL A29 Limited.\n\n# Copyright (C) 2024 THL A29 Limited, a Tencent company.  All rights reserved. \n# The below software and/or models in this distribution may have been \n# modified by THL A29 Limited (\"Tencent Modifications\"). \n# All Tencent Modifications are Copyright (C) THL A29 Limited.\n\n# Hunyuan 3D is licensed under the TENCENT HUNYUAN NON-COMMERCIAL LICENSE AGREEMENT \n# except for the third-party components listed below. \n# Hunyuan 3D does not impose any additional limitations beyond what is outlined \n# in the repsective licenses of these third-party components. \n# Users must comply with all terms and conditions of original licenses of these third-party \n# components and must ensure that the usage of the third party components adheres to \n# all relevant laws and regulations. \n\n# For avoidance of doubts, Hunyuan 3D means the large language models and \n# their software and algorithms, including trained model weights, parameters (including \n# optimizer states), machine-learning model code, inference-enabling code, training-enabling code, \n# fine-tuning enabling code and other elements of the foregoing made publicly available \n# by Tencent in accordance with TENCENT HUNYUAN COMMUNITY LICENSE AGREEMENT.\n\nimport inspect\nfrom typing import Any, Dict, Optional\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport os\nimport torch\nimport numpy as np\nfrom PIL import Image\n\nimport diffusers\nfrom diffusers.image_processor import VaeImageProcessor\nfrom diffusers.utils.import_utils import is_xformers_available\nfrom diffusers.schedulers import KarrasDiffusionSchedulers\nfrom diffusers.utils.torch_utils import randn_tensor\nfrom diffusers.utils.import_utils import is_xformers_available\nfrom diffusers.models.attention_processor import (\n    Attention, \n    AttnProcessor, \n    XFormersAttnProcessor, \n    AttnProcessor2_0\n)\nfrom diffusers import (\n    AutoencoderKL, \n    DDPMScheduler,\n    DiffusionPipeline, \n    EulerAncestralDiscreteScheduler, \n    UNet2DConditionModel, \n    ImagePipelineOutput\n)\nimport transformers\nfrom transformers import (\n    CLIPImageProcessor, \n    CLIPTextModel, \n    CLIPTokenizer, \n    CLIPVisionModelWithProjection, \n    CLIPTextModelWithProjection\n)\n\nfrom .utils import to_rgb_image, white_out_background, recenter_img\n\nEXAMPLE_DOC_STRING = \"\"\"\n    Examples:\n        ```py\n        >>> import torch\n        >>> from diffusers import Hunyuan3d_MVD_XL_Pipeline\n\n        >>> pipe = Hunyuan3d_MVD_XL_Pipeline.from_pretrained(\n        ...     \"Tencent-Hunyuan-3D/MVD-XL\", torch_dtype=torch.float16\n        ... )\n        >>> pipe.to(\"cuda\")\n\n        >>> img = Image.open(\"demo.png\")\n        >>> res_img = pipe(img).images[0]\n        ```\n\"\"\"\n\n\n\ndef scale_latents(latents):   return (latents - 0.22) * 0.75\ndef unscale_latents(latents): return (latents / 0.75) + 0.22\ndef scale_image(image):       return (image - 0.5) / 0.5\ndef scale_image_2(image):     return (image * 0.5) / 0.8\ndef unscale_image(image):     return (image * 0.5) + 0.5\ndef unscale_image_2(image):   return (image * 0.8) / 0.5\n\n\n\n\nclass ReferenceOnlyAttnProc(torch.nn.Module):\n    def __init__(self, chained_proc, enabled=False, name=None):\n        super().__init__()\n        self.enabled = enabled\n        self.chained_proc = chained_proc\n        self.name = name\n\n    def __call__(self, attn, hidden_states, encoder_hidden_states=None, attention_mask=None, mode=\"w\", ref_dict=None):\n        encoder_hidden_states = hidden_states if encoder_hidden_states is None else encoder_hidden_states\n        if self.enabled:\n            if   mode == 'w': ref_dict[self.name]   = encoder_hidden_states\n            elif mode == 'r': encoder_hidden_states = torch.cat([encoder_hidden_states, ref_dict.pop(self.name)], dim=1)\n            else:             raise Exception(f\"mode should not be {mode}\")\n        return self.chained_proc(attn, hidden_states, encoder_hidden_states, attention_mask)\n\n\nclass RefOnlyNoisedUNet(torch.nn.Module):\n    def __init__(self, unet, scheduler) -> None:\n        super().__init__()\n        self.unet = unet\n        self.scheduler = scheduler\n\n        unet_attn_procs = dict()\n        for name, _ in unet.attn_processors.items():\n            if torch.__version__ >= '2.0': default_attn_proc = AttnProcessor2_0()\n            elif is_xformers_available():  default_attn_proc = XFormersAttnProcessor()\n            else:                          default_attn_proc = AttnProcessor()\n            unet_attn_procs[name] = ReferenceOnlyAttnProc(\n                default_attn_proc, enabled=name.endswith(\"attn1.processor\"), name=name\n            )\n        unet.set_attn_processor(unet_attn_procs)\n\n    def __getattr__(self, name: str):\n        try:\n            return super().__getattr__(name)\n        except AttributeError:\n            return getattr(self.unet, name)\n\n    def forward(\n        self,\n        sample: torch.FloatTensor,\n        timestep: Union[torch.Tensor, float, int],\n        encoder_hidden_states: torch.Tensor,\n        cross_attention_kwargs: Optional[Dict[str, Any]] = None,\n        class_labels: Optional[torch.Tensor] = None,\n        down_block_res_samples: Optional[Tuple[torch.Tensor]] = None,\n        mid_block_res_sample: Optional[Tuple[torch.Tensor]] = None,\n        added_cond_kwargs: Optional[Dict[str, torch.Tensor]] = None,\n        return_dict: bool = True,\n        **kwargs\n    ):\n\n        dtype = self.unet.dtype\n\n        # cond_lat add same level noise\n        cond_lat = cross_attention_kwargs['cond_lat']\n        noise = torch.randn_like(cond_lat)\n\n        noisy_cond_lat = self.scheduler.add_noise(cond_lat, noise, timestep.reshape(-1))\n        noisy_cond_lat = self.scheduler.scale_model_input(noisy_cond_lat, timestep.reshape(-1))\n\n        ref_dict = {}\n        \n        _ = self.unet(\n            noisy_cond_lat, \n            timestep, \n            encoder_hidden_states = encoder_hidden_states, \n            class_labels = class_labels,\n            cross_attention_kwargs = dict(mode=\"w\", ref_dict=ref_dict),\n            added_cond_kwargs = added_cond_kwargs,\n            return_dict = return_dict,\n            **kwargs\n        )\n\n        res = self.unet(\n            sample, \n            timestep, \n            encoder_hidden_states, \n            class_labels=class_labels,\n            cross_attention_kwargs = dict(mode=\"r\", ref_dict=ref_dict),\n            down_block_additional_residuals = [\n                sample.to(dtype=dtype) for sample in down_block_res_samples\n            ] if down_block_res_samples is not None else None,\n            mid_block_additional_residual = (\n                mid_block_res_sample.to(dtype=dtype) \n                if mid_block_res_sample is not None else None),\n            added_cond_kwargs = added_cond_kwargs,\n            return_dict = return_dict,\n            **kwargs\n        )\n        return res\n        \n\n\nclass HunYuan3D_MVD_Std_Pipeline(diffusers.DiffusionPipeline):\n    def __init__(\n        self,\n        vae: AutoencoderKL,\n        unet: UNet2DConditionModel,\n        scheduler: KarrasDiffusionSchedulers,\n        feature_extractor_vae: CLIPImageProcessor,\n        vision_processor: CLIPImageProcessor,\n        vision_encoder: CLIPVisionModelWithProjection,\n        vision_encoder_2: CLIPVisionModelWithProjection,\n        ramping_coefficients: Optional[list] = None,\n        add_watermarker: Optional[bool] = None,\n        safety_checker = None,\n    ):\n        DiffusionPipeline.__init__(self)\n\n        self.register_modules(\n            vae=vae, unet=unet, scheduler=scheduler, safety_checker=None, feature_extractor_vae=feature_extractor_vae,\n            vision_processor=vision_processor, vision_encoder=vision_encoder, vision_encoder_2=vision_encoder_2, \n        )\n        self.register_to_config( ramping_coefficients = ramping_coefficients)\n        self.vae_scale_factor = 2 ** (len(self.vae.config.block_out_channels) - 1)\n        self.image_processor = VaeImageProcessor(vae_scale_factor=self.vae_scale_factor)\n        self.default_sample_size = self.unet.config.sample_size \n        self.watermark = None \n        self.prepare_init = False\n\n    def prepare(self):\n        assert isinstance(self.unet, UNet2DConditionModel), \"unet should be UNet2DConditionModel\"\n        self.unet = RefOnlyNoisedUNet(self.unet, self.scheduler).eval()\n        self.prepare_init = True\n\n    def encode_image(self, image: torch.Tensor, scale_factor: bool = False):\n        latent = self.vae.encode(image).latent_dist.sample()\n        return (latent * self.vae.config.scaling_factor) if scale_factor else latent\n\n    # Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.prepare_latents\n    def prepare_latents(self, batch_size, num_channels_latents, height, width, dtype, device, generator, latents=None):\n        shape = (\n            batch_size,\n            num_channels_latents,\n            int(height) // self.vae_scale_factor,\n            int(width) // self.vae_scale_factor,\n        )\n        if isinstance(generator, list) and len(generator) != batch_size:\n            raise ValueError(\n                f\"You have passed a list of generators of length {len(generator)}, but requested an effective batch\"\n                f\" size of {batch_size}. Make sure the batch size matches the length of the generators.\"\n            )\n\n        if latents is None:\n            latents = randn_tensor(shape, generator=generator, device=device, dtype=dtype) \n        else:\n            latents = latents.to(device)\n\n        # scale the initial noise by the standard deviation required by the scheduler\n        latents = latents * self.scheduler.init_noise_sigma\n        return latents\n\n    def _get_add_time_ids(\n        self, original_size, crops_coords_top_left, target_size, dtype, text_encoder_projection_dim=None\n    ):\n        add_time_ids = list(original_size + crops_coords_top_left + target_size)\n\n        passed_add_embed_dim = (\n            self.unet.config.addition_time_embed_dim * len(add_time_ids) + text_encoder_projection_dim\n        )\n        expected_add_embed_dim = self.unet.add_embedding.linear_1.in_features\n\n        if expected_add_embed_dim != passed_add_embed_dim:\n            raise ValueError(\n                f\"Model expects an added time embedding vector of length {expected_add_embed_dim}, \" \\\n                f\"but a vector of {passed_add_embed_dim} was created. The model has an incorrect config.\" \\\n                f\" Please check `unet.config.time_embedding_type` and `text_encoder_2.config.projection_dim`.\"\n            )\n\n        add_time_ids = torch.tensor([add_time_ids], dtype=dtype)\n        return add_time_ids\n\n    def prepare_extra_step_kwargs(self, generator, eta):\n        # prepare extra kwargs for the scheduler step, since not all schedulers have the same signature\n        # eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.\n        # eta corresponds to η in DDIM paper: https://arxiv.org/abs/2010.02502\n        # and should be between [0, 1]\n\n        accepts_eta = \"eta\" in set(inspect.signature(self.scheduler.step).parameters.keys())\n        extra_step_kwargs = {}\n        if accepts_eta:  extra_step_kwargs[\"eta\"] = eta\n\n        # check if the scheduler accepts generator\n        accepts_generator = \"generator\" in set(inspect.signature(self.scheduler.step).parameters.keys())\n        if accepts_generator: extra_step_kwargs[\"generator\"] = generator\n        return extra_step_kwargs\n\n    @property\n    def guidance_scale(self):\n        return self._guidance_scale\n\n    @property\n    def interrupt(self):\n        return self._interrupt\n\n    @property\n    def do_classifier_free_guidance(self):\n        return self._guidance_scale > 1 and self.unet.config.time_cond_proj_dim is None\n        \n    @torch.no_grad()\n    def __call__(\n        self,\n        image: Image.Image = None,\n        guidance_scale = 2.0,\n        output_type: Optional[str] = \"pil\",\n        num_inference_steps: int = 50,\n        return_dict: bool = True,\n        eta: float = 0.0,\n        generator: Optional[Union[torch.Generator, List[torch.Generator]]] = None,\n        crops_coords_top_left: Tuple[int, int] = (0, 0),\n        cross_attention_kwargs: Optional[Dict[str, Any]] = None,\n        latent: torch.Tensor = None,\n        guidance_curve = None,\n        **kwargs\n    ):\n        if not self.prepare_init:\n            self.prepare()\n\n        here = dict(device=self.vae.device, dtype=self.vae.dtype)\n            \n        batch_size = 1\n        num_images_per_prompt = 1\n        width, height = 512 * 2,  512 * 3\n        target_size = original_size = (height, width)\n\n        self._guidance_scale = guidance_scale\n        self._cross_attention_kwargs = cross_attention_kwargs\n        self._interrupt = False\n\n        device = self._execution_device\n\n        # Prepare timesteps\n        self.scheduler.set_timesteps(num_inference_steps, device=device)\n        timesteps = self.scheduler.timesteps\n        \n        # Prepare latent variables\n        num_channels_latents = self.unet.config.in_channels\n        latents = self.prepare_latents(\n            batch_size * num_images_per_prompt,\n            num_channels_latents,\n            height,\n            width,\n            self.vae.dtype,\n            device,\n            generator,\n            latents=latent,\n        )\n        \n        # Prepare extra step kwargs. TODO: Logic should ideally just be moved out of the pipeline\n        extra_step_kwargs = self.prepare_extra_step_kwargs(generator, eta)\n\n\n        # Prepare added time ids & embeddings\n        text_encoder_projection_dim = 1280     \n        add_time_ids = self._get_add_time_ids(\n            original_size,\n            crops_coords_top_left,\n            target_size,\n            dtype=self.vae.dtype,\n            text_encoder_projection_dim=text_encoder_projection_dim,\n        )\n        negative_add_time_ids = add_time_ids\n\n        # hw: preprocess\n        cond_image = recenter_img(image)\n        cond_image = to_rgb_image(image)\n        image_vae = self.feature_extractor_vae(images=cond_image, return_tensors=\"pt\").pixel_values.to(**here)\n        image_clip = self.vision_processor(images=cond_image, return_tensors=\"pt\").pixel_values.to(**here)\n\n        # hw: get cond_lat from cond_img using vae\n        cond_lat = self.encode_image(image_vae, scale_factor=False)\n        negative_lat = self.encode_image(torch.zeros_like(image_vae), scale_factor=False) \n        cond_lat = torch.cat([negative_lat, cond_lat])\n\n        # hw: get visual global embedding using clip\n        global_embeds_1 = self.vision_encoder(image_clip, output_hidden_states=False).image_embeds.unsqueeze(-2)\n        global_embeds_2 = self.vision_encoder_2(image_clip, output_hidden_states=False).image_embeds.unsqueeze(-2)\n        global_embeds = torch.concat([global_embeds_1, global_embeds_2], dim=-1)\n        \n        ramp = global_embeds.new_tensor(self.config.ramping_coefficients).unsqueeze(-1)\n        prompt_embeds = self.uc_text_emb.to(**here)\n        pooled_prompt_embeds =  self.uc_text_emb_2.to(**here)\n        \n        prompt_embeds = prompt_embeds + global_embeds * ramp\n        add_text_embeds = pooled_prompt_embeds\n        \n        if self.do_classifier_free_guidance:\n            negative_prompt_embeds = torch.zeros_like(prompt_embeds)\n            negative_pooled_prompt_embeds = torch.zeros_like(pooled_prompt_embeds)\n            prompt_embeds = torch.cat([negative_prompt_embeds, prompt_embeds], dim=0)\n            add_text_embeds = torch.cat([negative_pooled_prompt_embeds, add_text_embeds], dim=0)\n            add_time_ids = torch.cat([negative_add_time_ids, add_time_ids], dim=0)\n\n        prompt_embeds = prompt_embeds.to(device)\n        add_text_embeds = add_text_embeds.to(device)\n        add_time_ids = add_time_ids.to(device).repeat(batch_size * num_images_per_prompt, 1)\n\n        # Denoising loop\n        num_warmup_steps = max(len(timesteps) - num_inference_steps * self.scheduler.order, 0)\n        timestep_cond = None\n        self._num_timesteps = len(timesteps)\n\n        if guidance_curve is None:\n            guidance_curve = lambda t: guidance_scale\n        \n        with self.progress_bar(total=num_inference_steps) as progress_bar:\n            for i, t in enumerate(timesteps):\n                if self.interrupt:\n                    continue\n                    \n                 # expand the latents if we are doing classifier free guidance\n                latent_model_input = torch.cat([latents] * 2) if self.do_classifier_free_guidance else latents\n\n                latent_model_input = self.scheduler.scale_model_input(latent_model_input, t)\n\n                # predict the noise residual\n                added_cond_kwargs = {\"text_embeds\": add_text_embeds, \"time_ids\": add_time_ids}\n                    \n                noise_pred = self.unet(\n                    latent_model_input,\n                    t,\n                    encoder_hidden_states=prompt_embeds,\n                    timestep_cond=timestep_cond,\n                    cross_attention_kwargs=dict(cond_lat=cond_lat),\n                    added_cond_kwargs=added_cond_kwargs,\n                    return_dict=False,\n                )[0]\n\n                # perform guidance\n                \n                # cur_guidance_scale = self.guidance_scale\n                cur_guidance_scale = guidance_curve(t)  # 1.5 + 2.5 * ((t/1000)**2)\n                \n                if self.do_classifier_free_guidance:\n                    noise_pred_uncond, noise_pred_text = noise_pred.chunk(2)\n                    noise_pred = noise_pred_uncond + cur_guidance_scale * (noise_pred_text - noise_pred_uncond)\n\n                    # cur_guidance_scale_topleft = (cur_guidance_scale - 1.0) * 4 + 1.0\n                    # noise_pred_top_left = noise_pred_uncond + \n                    #    cur_guidance_scale_topleft * (noise_pred_text - noise_pred_uncond)\n                    # _, _, h, w = noise_pred.shape\n                    # noise_pred[:, :, :h//3, :w//2] = noise_pred_top_left[:, :, :h//3, :w//2]\n\n                # compute the previous noisy sample x_t -> x_t-1\n                latents_dtype = latents.dtype\n                latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs, return_dict=False)[0]\n\n                # call the callback, if provided\n                if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):\n                    progress_bar.update()\n        \n        latents = unscale_latents(latents)\n\n        if output_type==\"latent\":\n            image = latents\n        else:\n            image = self.vae.decode(latents / self.vae.config.scaling_factor, return_dict=False)[0]\n            image = unscale_image(unscale_image_2(image)).clamp(0, 1)\n            image = [\n                Image.fromarray((image[0]*255+0.5).clamp_(0, 255).permute(1, 2, 0).cpu().numpy().astype(\"uint8\")),\n                # self.image_processor.postprocess(image, output_type=output_type)[0],\n                cond_image.resize((512, 512))\n            ]\n\n        if not return_dict: return (image,)\n        return ImagePipelineOutput(images=image)\n\n    def save_pretrained(self, save_directory):\n        # uc_text_emb.pt and uc_text_emb_2.pt are inferenced and saved in advance\n        super().save_pretrained(save_directory)\n        torch.save(self.uc_text_emb, os.path.join(save_directory, \"uc_text_emb.pt\"))\n        torch.save(self.uc_text_emb_2, os.path.join(save_directory, \"uc_text_emb_2.pt\"))\n\n    @classmethod\n    def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):\n        # uc_text_emb.pt and uc_text_emb_2.pt are inferenced and saved in advance\n        pipeline = super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)\n        pipeline.uc_text_emb = torch.load(os.path.join(pretrained_model_name_or_path, \"uc_text_emb.pt\"))\n        pipeline.uc_text_emb_2 = torch.load(os.path.join(pretrained_model_name_or_path, \"uc_text_emb_2.pt\"))\n        return pipeline"
  },
  {
    "path": "freesplatter/hunyuan/utils.py",
    "content": "# Open Source Model Licensed under the Apache License Version 2.0 and Other Licenses of the Third-Party Components therein:\n# The below Model in this distribution may have been modified by THL A29 Limited (\"Tencent Modifications\"). All Tencent Modifications are Copyright (C) 2024 THL A29 Limited.\n\n# Copyright (C) 2024 THL A29 Limited, a Tencent company.  All rights reserved. \n# The below software and/or models in this distribution may have been \n# modified by THL A29 Limited (\"Tencent Modifications\"). \n# All Tencent Modifications are Copyright (C) THL A29 Limited.\n\n# Hunyuan 3D is licensed under the TENCENT HUNYUAN NON-COMMERCIAL LICENSE AGREEMENT \n# except for the third-party components listed below. \n# Hunyuan 3D does not impose any additional limitations beyond what is outlined \n# in the repsective licenses of these third-party components. \n# Users must comply with all terms and conditions of original licenses of these third-party \n# components and must ensure that the usage of the third party components adheres to \n# all relevant laws and regulations. \n\n# For avoidance of doubts, Hunyuan 3D means the large language models and \n# their software and algorithms, including trained model weights, parameters (including \n# optimizer states), machine-learning model code, inference-enabling code, training-enabling code, \n# fine-tuning enabling code and other elements of the foregoing made publicly available \n# by Tencent in accordance with TENCENT HUNYUAN COMMUNITY LICENSE AGREEMENT.\n\nimport numpy as np\nfrom PIL import Image\n\ndef to_rgb_image(maybe_rgba: Image.Image):\n    '''\n        convert a PIL.Image to rgb mode with white background\n        maybe_rgba: PIL.Image\n        return: PIL.Image\n    '''\n    if maybe_rgba.mode == 'RGB':\n        return maybe_rgba\n    elif maybe_rgba.mode == 'RGBA':\n        rgba = maybe_rgba\n        img = np.random.randint(255, 256, size=[rgba.size[1], rgba.size[0], 3], dtype=np.uint8)\n        img = Image.fromarray(img, 'RGB')\n        img.paste(rgba, mask=rgba.getchannel('A'))\n        return img\n    else:\n        raise ValueError(\"Unsupported image type.\", maybe_rgba.mode)\n        \ndef white_out_background(pil_img, is_gray_fg=True):\n    data = pil_img.getdata()\n    new_data = []\n    #  convert fore-ground white to gray\n    for r, g, b, a in data:\n        if a < 16: \n            new_data.append((255, 255, 255, 0))  # back-ground to be black\n        else:\n            is_white = is_gray_fg and (r>235) and (g>235) and (b>235)\n            new_r = 235 if is_white else r\n            new_g = 235 if is_white else g\n            new_b = 235 if is_white else b\n            new_data.append((new_r, new_g, new_b, a))\n    pil_img.putdata(new_data)\n    return pil_img\n    \ndef recenter_img(img, size=512, color=(255,255,255)):\n    img = white_out_background(img)\n    mask = np.array(img)[..., 3]\n    image = np.array(img)[..., :3]\n    \n    H, W, C = image.shape\n    coords = np.nonzero(mask)\n    x_min, x_max = coords[0].min(), coords[0].max()\n    y_min, y_max = coords[1].min(), coords[1].max()\n    h = x_max - x_min\n    w = y_max - y_min\n    if h == 0 or w == 0: raise ValueError\n    roi = image[x_min:x_max, y_min:y_max]\n\n    border_ratio = 0.15 # 0.2\n    pad_h = int(h * border_ratio)\n    pad_w = int(w * border_ratio)\n\n    result_tmp = np.full((h + pad_h, w + pad_w, C), color, dtype=np.uint8)\n    result_tmp[pad_h // 2: pad_h // 2 + h, pad_w // 2: pad_w // 2 + w] = roi\n\n    cur_h, cur_w = result_tmp.shape[:2]\n    side = max(cur_h, cur_w)\n    result = np.full((side, side, C), color, dtype=np.uint8)\n    result[(side-cur_h)//2:(side-cur_h)//2+cur_h, (side-cur_w)//2:(side - cur_w)//2+cur_w,:] = result_tmp\n    result = Image.fromarray(result)\n    return result.resize((size, size), Image.LANCZOS) if size else result"
  },
  {
    "path": "freesplatter/models/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/models/model.py",
    "content": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.transforms import v2\nfrom einops import rearrange\n\nfrom freesplatter.models.transformer import Transformer\nfrom freesplatter.utils.infer_util import instantiate_from_config\nfrom freesplatter.utils.recon_util import estimate_focal, fast_pnp\n\n\nC0 = 0.28209479177387814\ndef RGB2SH(rgb):\n    return (rgb - 0.5) / C0\n\n\nclass FreeSplatterModel(nn.Module):\n    def __init__(\n        self, \n        transformer_config=None,\n        renderer_config=None,\n        use_2dgs=False,\n        sh_residual=False,\n    ):\n        super().__init__()\n\n        self.sh_dim = (renderer_config.sh_degree + 1) ** 2 * 3\n        self.sh_residual = sh_residual\n        self.use_2dgs = use_2dgs\n        \n        self.transformer = instantiate_from_config(transformer_config)\n\n        if not use_2dgs:\n            from .renderer.gaussian_renderer import GaussianRenderer\n        else:\n            from .renderer_2dgs.gaussian_renderer import GaussianRenderer\n        self.gs_renderer = GaussianRenderer(renderer_config=renderer_config)\n\n        self.register_buffer('pp', torch.tensor([256, 256], dtype=torch.float32), persistent=False)\n\n    def forward_gaussians(self, images, **kwargs):\n        \"\"\"\n        images: B x N x 3 x H x W\n        \"\"\"\n        gaussians = self.transformer(images)    # B x N x H x W x C\n        if self.sh_residual:\n            residual = torch.zeros_like(gaussians)\n            sh = RGB2SH(rearrange(images, 'b n c h w -> b n h w c'))\n            residual[..., 3:6] = sh\n            gaussians = gaussians + residual\n\n        gaussians = rearrange(gaussians, 'b n h w c -> b (n h w) c')\n\n        return gaussians\n    \n    def forward_renderer(self, gaussians, c2ws, fxfycxcy, **kwargs):\n        \"\"\"\n        gaussians: B x K x 14\n        c2ws: B x N x 4 x 4\n        fxfycxcy: B x N x 4\n        \"\"\"\n        render_results = self.gs_renderer.render(gaussians, fxfycxcy, c2ws, **kwargs)\n\n        return render_results\n    \n    @torch.inference_mode()\n    def estimate_focals(\n        self, \n        images, \n        masks=None,\n        use_first_focal=False,\n    ):\n        \"\"\"\n        Estimate the focal lengths of N input images.\n\n        images: N x 3 x H x W\n        masks: N x 1 x H x W\n        \"\"\"\n        assert images.ndim == 4\n        N, _, H, W = images.shape\n        assert H == W, \"Non-square images are not supported.\"\n\n        pp = self.pp.to(images)\n        # pp = torch.tensor([W/2, H/2]).to(images)\n\n        focals = []\n        for i in range(N):\n            if use_first_focal and i > 0:\n                break\n            images_input = torch.cat([images[i:], images[:i]], dim=0)\n            gaussians = self.forward_gaussians(images_input.unsqueeze(0))     # 1 x (N x H x W) x 14\n            points = rearrange(gaussians[0, :H*W, :3], '(h w) c -> h w c', h=H, w=W)\n            mask = masks[i] if masks is not None else None\n            focal = estimate_focal(points, pp=pp, mask=mask)\n            focals.append(focal)\n        \n        focals = torch.stack(focals).to(images)\n        focals = focals.mean().reshape(1).repeat(N)\n        return focals\n    \n    @torch.inference_mode()\n    def estimate_poses(\n        self, \n        images, \n        gaussians=None, \n        masks=None,\n        focals=None,\n        use_first_focal=True,\n        opacity_threshold=5e-2, \n        pnp_iter=20,\n    ):\n        \"\"\"\n        Estimate the camera poses of N input images.\n\n        images: N x 3 x h x W\n        gaussians: K x 14 or 1 x K x 14\n        masks: N x 1 x H x W\n        focals: N\n        \"\"\"\n        assert images.ndim == 4\n        N, _, H, W = images.shape\n        assert H == W, \"Non-square images are not supported.\"\n\n        # predict gaussians from images\n        if gaussians is None:\n            gaussians = self.forward_gaussians(images.unsqueeze(0))     # 1 x (N x H x W) x 14\n        else:\n            if gaussians.ndim == 2:\n                gaussians = gaussians.unsqueeze(0)\n            assert gaussians.shape[1] == N * H * W\n\n        points = gaussians[..., :3].reshape(1, N, H, W, 3).squeeze(0)   # N x H x W x 3\n        opacities = gaussians[..., 3+self.sh_dim].reshape(1, N, H, W).squeeze(0)\n        opacities = torch.sigmoid(opacities)    # N x H x W\n\n        # estimate focals if not provided\n        if focals is None:\n            focals = self.estimate_focals(images, masks=masks, use_first_focal=use_first_focal)\n\n        # run PnP\n        c2ws = []\n        for i in range(N):\n            pts3d = points[i].float().detach().cpu().numpy()\n            # If masks are not provided, we use Gaussian opacities\n            if masks is None:\n                mask = (opacities[i] > opacity_threshold).detach().cpu().numpy()\n            else:\n                mask = masks[i].reshape(H, W).bool().detach().cpu().numpy()\n\n            focal = focals[i].item()\n            _, c2w = fast_pnp(pts3d, mask, focal=focal, niter_PnP=pnp_iter)\n\n            c2ws.append(torch.from_numpy(c2w))\n        \n        c2ws = torch.stack(c2ws, dim=0).to(images)\n        return c2ws, focals"
  },
  {
    "path": "freesplatter/models/renderer/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/models/renderer/gaussian_renderer.py",
    "content": "import torch\n\nfrom .gaussian_utils import render, GaussianModel\n\n\nclass GaussianRenderer:\n    def __init__(self, renderer_config=None):\n        if 'scaling_activation_type' not in renderer_config:\n            renderer_config['scaling_activation_type'] = 'exp'\n        if 'scale_min_act' not in renderer_config:\n            renderer_config['scale_min_act'] = 1 \n            renderer_config['scale_max_act'] = 1 \n            renderer_config['scale_multi_act'] = 0.1 \n\n        self.gaussian_model = GaussianModel(sh_degree=renderer_config.sh_degree, \n                                            scaling_activation_type=renderer_config.scaling_activation_type, \n                                            scale_min_act=renderer_config.scale_min_act, \n                                            scale_max_act=renderer_config.scale_max_act, \n                                            scale_multi_act=renderer_config.scale_multi_act)\n        self.img_height = renderer_config.img_height\n        self.img_width = renderer_config.img_width\n        self.bg_color = renderer_config.bg_color if 'bg_color' in renderer_config else (1.0, 1.0, 1.0)\n\n    def render(self, latent, output_fxfycxcy, output_c2ws, rescale=None, render_size=None):\n        if render_size is None:\n            img_height, img_width = self.img_height, self.img_width\n        else:\n            img_height, img_width = render_size\n        if rescale is None:\n            rescale = torch.ones(latent.shape[0]).to(latent)\n        \n        shs_dim = (self.gaussian_model.sh_degree + 1) ** 2 * 3\n        xyz, features, opacity, scaling, rotation = latent.split([3, shs_dim, 1, 3, 4], dim=-1)\n\n        features = features.reshape(features.shape[0], -1, shs_dim//3, 3)\n \n        bs, vs = output_fxfycxcy.shape[:2] \n        images = torch.zeros(bs, vs, 3, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        alphas = torch.zeros(bs, vs, 1, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        depths = torch.zeros(bs, vs, 1, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n\n        for idx in range(bs):\n            pc = self.gaussian_model.set_data(xyz[idx], features[idx], scaling[idx], rotation[idx], opacity[idx], rescale[idx])\n            for vidx in range(vs):\n                render_results = render(pc, img_height, img_width, output_c2ws[idx, vidx], output_fxfycxcy[idx, vidx], self.bg_color)\n                image = render_results['render']\n                alpha = render_results['alpha']\n                depth = render_results['depth']\n                images[idx, vidx] =  image\n                alphas[idx, vidx] =  alpha\n                depths[idx, vidx] =  depth\n        results = {'image': images, 'alpha': alphas, 'depth': depths}\n        return results\n"
  },
  {
    "path": "freesplatter/models/renderer/gaussian_utils.py",
    "content": "\"\"\"\nGaussian Splatting.\nPartially borrowed from https://github.com/graphdeco-inria/gaussian-splatting.\n\"\"\"\n\n\nimport os\nimport torch\nfrom torch import nn\nimport numpy as np\nfrom diff_gaussian_rasterization import (\n    GaussianRasterizationSettings,\n    GaussianRasterizer,\n)\nfrom plyfile import PlyData, PlyElement\nfrom scipy.spatial.transform import Rotation as R\n\n\ndef strip_lowerdiag(L):\n    uncertainty = torch.zeros((L.shape[0], 6), dtype=torch.float, device=L.device)\n\n    uncertainty[:, 0] = L[:, 0, 0]\n    uncertainty[:, 1] = L[:, 0, 1]\n    uncertainty[:, 2] = L[:, 0, 2]\n    uncertainty[:, 3] = L[:, 1, 1]\n    uncertainty[:, 4] = L[:, 1, 2]\n    uncertainty[:, 5] = L[:, 2, 2]\n    return uncertainty\n\n\ndef strip_symmetric(sym):\n    return strip_lowerdiag(sym)\n\n\ndef build_rotation(r):\n    norm = torch.sqrt(\n        r[:, 0] * r[:, 0] + r[:, 1] * r[:, 1] + r[:, 2] * r[:, 2] + r[:, 3] * r[:, 3]\n    )\n\n    q = r / norm[:, None]\n\n    R = torch.zeros((q.size(0), 3, 3), device=r.device)\n\n    r = q[:, 0]\n    x = q[:, 1]\n    y = q[:, 2]\n    z = q[:, 3]\n\n    R[:, 0, 0] = 1 - 2 * (y * y + z * z)\n    R[:, 0, 1] = 2 * (x * y - r * z)\n    R[:, 0, 2] = 2 * (x * z + r * y)\n    R[:, 1, 0] = 2 * (x * y + r * z)\n    R[:, 1, 1] = 1 - 2 * (x * x + z * z)\n    R[:, 1, 2] = 2 * (y * z - r * x)\n    R[:, 2, 0] = 2 * (x * z - r * y)\n    R[:, 2, 1] = 2 * (y * z + r * x)\n    R[:, 2, 2] = 1 - 2 * (x * x + y * y)\n    return R\n\n\ndef build_scaling_rotation(s, r):\n    L = torch.zeros((s.shape[0], 3, 3), dtype=torch.float, device=s.device)\n    R = build_rotation(r)\n\n    L[:, 0, 0] = s[:, 0]\n    L[:, 1, 1] = s[:, 1]\n    L[:, 2, 2] = s[:, 2]\n\n    L = R @ L\n    return L\n\n\nclass Camera(nn.Module):\n    def __init__(self, C2W, fxfycxcy, h, w):\n        \"\"\"\n        C2W: 4x4 camera-to-world matrix; opencv convention\n        fxfycxcy: 4\n        \"\"\"\n        super().__init__()\n        self.C2W = C2W.float()\n        self.W2C = self.C2W.inverse()\n\n        self.znear = 0.01\n        self.zfar = 100.0\n        self.h = h\n        self.w = w\n\n        fx, fy, cx, cy = fxfycxcy[0], fxfycxcy[1], fxfycxcy[2], fxfycxcy[3]\n        self.tanfovX = 1 / (2 * fx)\n        self.tanfovY = 1 / (2 * fy)\n        self.fovX = 2 * torch.atan(self.tanfovX)\n        self.fovY = 2 * torch.atan(self.tanfovY)\n        self.shiftX = 2 * cx - 1\n        self.shiftY = 2 * cy - 1\n\n        def getProjectionMatrix(znear, zfar, fovX, fovY, shiftX, shiftY):\n            tanHalfFovY = torch.tan((fovY / 2))\n            tanHalfFovX = torch.tan((fovX / 2))\n\n            top = tanHalfFovY * znear\n            bottom = -top\n            right = tanHalfFovX * znear\n            left = -right\n\n            P = torch.zeros(4, 4, dtype=torch.float32, device=fovX.device)\n\n            z_sign = 1.0\n\n            P[0, 0] = 2.0 * znear / (right - left)\n            P[1, 1] = 2.0 * znear / (top - bottom)\n            P[0, 2] = (right + left) / (right - left) + shiftX\n            P[1, 2] = (top + bottom) / (top - bottom) + shiftY\n            P[3, 2] = z_sign\n            P[2, 2] = z_sign * zfar / (zfar - znear)\n            P[2, 3] = -(zfar * znear) / (zfar - znear)\n            return P\n\n        self.world_view_transform = self.W2C.transpose(0, 1)\n        self.projection_matrix = getProjectionMatrix(\n            znear=self.znear, zfar=self.zfar, fovX=self.fovX, fovY=self.fovY, shiftX=self.shiftX, shiftY=self.shiftY\n        ).transpose(0, 1)\n        self.full_proj_transform = (\n            self.world_view_transform.unsqueeze(0).bmm(\n                self.projection_matrix.unsqueeze(0)\n            )\n        ).squeeze(0)\n        self.camera_center = self.C2W[:3, 3]\n\n\nclass GaussianModel:\n    def setup_functions(self, scaling_activation_type='sigmoid', scale_min_act=0.001, scale_max_act=0.3, scale_multi_act=0.1):\n        def build_covariance_from_scaling_rotation(scaling, scaling_modifier, rotation):\n            L = build_scaling_rotation(scaling_modifier * scaling, rotation)\n            actual_covariance = L @ L.transpose(1, 2)\n            symm = strip_symmetric(actual_covariance)\n            return symm\n\n        if scaling_activation_type == 'exp':\n            self.scaling_activation = torch.exp\n        elif scaling_activation_type == 'softplus':\n            self.scaling_activation = torch.nn.functional.softplus\n            self.scale_multi_act = scale_multi_act\n        elif scaling_activation_type == 'sigmoid':\n            self.scale_min_act = scale_min_act\n            self.scale_max_act = scale_max_act\n            self.scaling_activation = torch.sigmoid\n        else:\n            raise NotImplementedError\n        self.scaling_activation_type = scaling_activation_type\n\n        self.rotation_activation = torch.nn.functional.normalize\n        self.opacity_activation = torch.sigmoid\n        self.feature_activation = torch.sigmoid\n        self.covariance_activation = build_covariance_from_scaling_rotation\n\n    def __init__(self, sh_degree: int, scaling_activation_type='exp', scale_min_act=0.001, scale_max_act=0.3, scale_multi_act=0.1):\n        self.sh_degree = sh_degree\n        self._xyz = torch.empty(0)\n        self._features_dc = torch.empty(0)\n        if self.sh_degree > 0:\n            self._features_rest = torch.empty(0)\n        else:\n            self._features_rest = None\n        self._scaling = torch.empty(0)\n        self._rotation = torch.empty(0)\n        self._opacity = torch.empty(0)\n        self.setup_functions(scaling_activation_type=scaling_activation_type, scale_min_act=scale_min_act, scale_max_act=scale_max_act, scale_multi_act=scale_multi_act)\n\n    def set_data(self, xyz, features, scaling, rotation, opacity, rescale=None):\n        self._xyz = xyz\n        self._features_dc = features[:, 0, :].contiguous() if self.sh_degree == 0 else features[:, 0:1, :].contiguous()\n        if self.sh_degree > 0:\n            self._features_rest = features[:, 1:, :].contiguous()\n        else:\n            self._features_rest = None\n        self._scaling = scaling\n        self._rotation = rotation\n        self._opacity = opacity\n        if rescale is None:\n            rescale = torch.ones(1).to(xyz)\n        self._rescale = rescale\n        return self\n\n    def to(self, device):\n        self._xyz = self._xyz.to(device)\n        self._features_dc = self._features_dc.to(device)\n        if self.sh_degree > 0:\n            self._features_rest = self._features_rest.to(device)\n        self._scaling = self._scaling.to(device)\n        self._rotation = self._rotation.to(device)\n        self._opacity = self._opacity.to(device)\n        return self\n\n    @property\n    def get_scaling(self):\n        if self.scaling_activation_type == 'exp':\n            scales = self.scaling_activation(self._scaling)\n        elif self.scaling_activation_type == 'softplus':\n            scales = self.scaling_activation(self._scaling) * self.scale_multi_act\n        elif self.scaling_activation_type == 'sigmoid':\n            scales = self.scale_min_act + (self.scale_max_act - self.scale_min_act) * self.scaling_activation(self._scaling)\n        scales = scales * self._rescale\n        return scales\n\n    @property\n    def get_rotation(self):\n        return self.rotation_activation(self._rotation)\n\n    @property\n    def get_xyz(self):\n        xyz = self._xyz * self._rescale\n        return xyz\n\n    @property\n    def get_features(self):\n        if self.sh_degree > 0:\n            features_dc = self._features_dc\n            features_rest = self._features_rest\n            return torch.cat((features_dc, features_rest), dim=1)\n        else:\n            return self.feature_activation(self._features_dc)\n\n    @property\n    def get_opacity(self):\n        return self.opacity_activation(self._opacity)\n\n    def get_covariance(self, scaling_modifier=1):\n        return self.covariance_activation(\n            self.get_scaling, scaling_modifier, self._rotation\n        )\n\n    def construct_list_of_attributes(self, num_rest=0):\n        l = ['x', 'y', 'z']\n        # All channels except the 3 DC\n        for i in range(3):\n            l.append('f_dc_{}'.format(i))\n        for i in range(num_rest):\n            l.append('f_rest_{}'.format(i))\n        l.append('opacity')\n        for i in range(self._scaling.shape[1]):\n            l.append('scale_{}'.format(i))\n        for i in range(self._rotation.shape[1]):\n            l.append('rot_{}'.format(i))\n        return l\n\n    def save_ply_vis(self, path):\n        os.makedirs(os.path.dirname(path), exist_ok=True)\n\n        xyzs = self._xyz.detach().cpu().numpy()\n        f_dc = self._features_dc.detach().flatten(start_dim=1).contiguous().cpu().numpy()\n        opacities = self._opacity.detach().cpu().numpy()\n\n        scales = torch.log(self.get_scaling)\n        scales = scales.detach().cpu().numpy()\n\n        rot_mat_vis = np.array([[1, 0, 0], [0, 0, -1], [0, 1, 0]])\n        xyzs = xyzs @ rot_mat_vis.T\n        rotations = self._rotation.detach().cpu().numpy()\n        rotations = R.from_quat(rotations[:, [1,2,3,0]]).as_matrix()\n        rotations = rot_mat_vis @ rotations\n        rotations = R.from_matrix(rotations).as_quat()[:, [3,0,1,2]]\n\n        dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes(0)]\n        elements = np.empty(xyzs.shape[0], dtype=dtype_full)\n        attributes = np.concatenate((xyzs, f_dc, opacities, scales, rotations), axis=1)\n        elements[:] = list(map(tuple, attributes))\n        el = PlyElement.describe(elements, 'vertex')\n        PlyData([el]).write(path)\n\n    def save_ply(self, path):\n        os.makedirs(os.path.dirname(path), exist_ok=True)\n\n        xyzs = self._xyz.detach().cpu().numpy()\n        f_dc = self._features_dc.detach().flatten(start_dim=1).contiguous().cpu().numpy()\n        if self.sh_degree > 0:\n            f_rest = self._features_rest.detach().flatten(start_dim=1).contiguous().cpu().numpy()\n        else:\n            f_rest = np.zeros((f_dc.shape[0], 0), dtype=f_dc.dtype)\n        opacities = self._opacity.detach().cpu().numpy()\n\n        scales = torch.log(self.get_scaling)\n        scales = scales.detach().cpu().numpy()\n\n        rotations = self._rotation.detach().cpu().numpy()\n\n        dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes(f_rest.shape[-1])]\n        elements = np.empty(xyzs.shape[0], dtype=dtype_full)\n        attributes = np.concatenate((xyzs, f_dc, f_rest, opacities, scales, rotations), axis=1)\n        elements[:] = list(map(tuple, attributes))\n        el = PlyElement.describe(elements, \"vertex\")\n        PlyData([el]).write(path)\n\n    # def load_ply(self, path):\n    #     plydata = PlyData.read(path)\n\n    #     xyz = np.stack((np.asarray(plydata.elements[0][\"x\"]),\n    #                     np.asarray(plydata.elements[0][\"y\"]),\n    #                     np.asarray(plydata.elements[0][\"z\"])),  axis=1)\n    #     opacities = np.asarray(plydata.elements[0][\"opacity\"])[..., np.newaxis]\n\n    #     features_dc = np.zeros((xyz.shape[0], 3, 1))\n    #     features_dc[:, 0, 0] = np.asarray(plydata.elements[0][\"f_dc_0\"])\n    #     features_dc[:, 1, 0] = np.asarray(plydata.elements[0][\"f_dc_1\"])\n    #     features_dc[:, 2, 0] = np.asarray(plydata.elements[0][\"f_dc_2\"])\n\n    #     scale_names = [p.name for p in plydata.elements[0].properties if p.name.startswith(\"scale_\")]\n    #     scale_names = sorted(scale_names, key = lambda x: int(x.split('_')[-1]))\n    #     scales = np.zeros((xyz.shape[0], len(scale_names)))\n    #     for idx, attr_name in enumerate(scale_names):\n    #         scales[:, idx] = np.asarray(plydata.elements[0][attr_name])\n\n    #     rot_names = [p.name for p in plydata.elements[0].properties if p.name.startswith(\"rot\")]\n    #     rot_names = sorted(rot_names, key=lambda x: int(x.split(\"_\")[-1]))\n    #     rots = np.zeros((xyz.shape[0], len(rot_names)))\n    #     for idx, attr_name in enumerate(rot_names):\n    #         rots[:, idx] = np.asarray(plydata.elements[0][attr_name])\n\n    #     self._xyz = torch.from_numpy(xyz.astype(np.float32))\n    #     self._features_dc = torch.from_numpy(features_dc.astype(np.float32)).transpose(1, 2).contiguous()\n    #     self._opacity = torch.from_numpy(opacities.astype(np.float32)).contiguous()\n    #     self._scaling = torch.from_numpy(scales.astype(np.float32)).contiguous()\n    #     self._rotation = torch.from_numpy(rots.astype(np.float32)).contiguous()\n\n\ndef render(\n    pc: GaussianModel,\n    height: int,\n    width: int,\n    C2W: torch.Tensor,\n    fxfycxcy: torch.Tensor,\n    bg_color=(1.0, 1.0, 1.0),\n    scaling_modifier=1.0,\n):\n    \"\"\"\n    Render the scene.\n    \"\"\"\n    screenspace_points = (\n        torch.zeros_like(\n            pc.get_xyz, dtype=pc.get_xyz.dtype, requires_grad=True, device=\"cuda\"\n        )\n        + 0\n    )\n    try:\n        screenspace_points.retain_grad()\n    except:\n        pass\n\n    viewpoint_camera = Camera(C2W=C2W, fxfycxcy=fxfycxcy, h=height, w=width)\n\n    bg_color = torch.tensor(list(bg_color), dtype=torch.float32, device=C2W.device)\n\n    raster_settings = GaussianRasterizationSettings(\n        image_height=int(viewpoint_camera.h),\n        image_width=int(viewpoint_camera.w),\n        tanfovx=viewpoint_camera.tanfovX,\n        tanfovy=viewpoint_camera.tanfovY,\n        bg=bg_color,\n        scale_modifier=scaling_modifier,\n        viewmatrix=viewpoint_camera.world_view_transform,\n        projmatrix=viewpoint_camera.full_proj_transform,\n        sh_degree=pc.sh_degree,\n        campos=viewpoint_camera.camera_center,\n        prefiltered=False,\n        debug=False,\n    )\n\n    rasterizer = GaussianRasterizer(raster_settings=raster_settings)\n\n    means3D = pc.get_xyz\n    means2D = screenspace_points\n    opacity = pc.get_opacity\n    scales = pc.get_scaling\n    rotations = pc.get_rotation\n    shs = pc.get_features\n\n    rendered_image, _, rendered_depth, rendered_alpha = rasterizer(\n        means3D=means3D,\n        means2D=means2D,\n        shs=None if pc.sh_degree == 0 else shs,\n        colors_precomp=shs if pc.sh_degree == 0 else None,\n        opacities=opacity,\n        scales=scales,\n        rotations=rotations,\n        cov3D_precomp=None,\n    )\n\n    return {\n        \"render\": rendered_image,\n        \"alpha\": rendered_alpha,\n        \"depth\": rendered_depth,\n    }\n"
  },
  {
    "path": "freesplatter/models/renderer_2dgs/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/models/renderer_2dgs/gaussian_renderer.py",
    "content": "import torch\n\nfrom .gaussian_utils import render, GaussianModel\n\n\nclass GaussianRenderer:\n    def __init__(self, renderer_config=None):\n        if 'scaling_activation_type' not in renderer_config:\n            renderer_config['scaling_activation_type'] = 'exp'\n        if 'scale_min_act' not in renderer_config:\n            renderer_config['scale_min_act'] = 1 \n            renderer_config['scale_max_act'] = 1 \n            renderer_config['scale_multi_act'] = 0.1 \n\n        self.gaussian_model = GaussianModel(sh_degree=renderer_config.sh_degree, \n                                            scaling_activation_type=renderer_config.scaling_activation_type, \n                                            scale_min_act=renderer_config.scale_min_act, \n                                            scale_max_act=renderer_config.scale_max_act, \n                                            scale_multi_act=renderer_config.scale_multi_act)\n        self.img_height = renderer_config.img_height\n        self.img_width = renderer_config.img_width\n        self.bg_color = renderer_config.bg_color if 'bg_color' in renderer_config else (1.0, 1.0, 1.0)\n\n    def render(self, latent, output_fxfycxcy, output_c2ws, render_size=None):\n        if render_size is None:\n            img_height, img_width = self.img_height, self.img_width\n        else:\n            img_height, img_width = render_size\n\n        shs_dim = (self.gaussian_model.sh_degree + 1) ** 2 * 3\n        xyz, features, opacity, scaling, rotation = latent.split([3, shs_dim, 1, 2, 4], dim=-1)\n\n        features = features.reshape(features.shape[0], -1, shs_dim//3, 3)\n\n        bs, vs = output_fxfycxcy.shape[:2] \n        images = torch.zeros(bs, vs, 3, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        alphas = torch.zeros(bs, vs, 1, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        depths = torch.zeros(bs, vs, 1, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        surf_normals = torch.zeros(bs, vs, 3, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        rend_normals = torch.zeros(bs, vs, 3, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n        dists = torch.zeros(bs, vs, 1, img_height, img_width, dtype=torch.float32, device=output_c2ws.device)\n\n        for idx in range(bs):\n            pc = self.gaussian_model.set_data(xyz[idx], features[idx], scaling[idx], rotation[idx], opacity[idx])\n            for vidx in range(vs):\n                render_results = render(pc, img_height, img_width, output_c2ws[idx, vidx], output_fxfycxcy[idx, vidx], self.bg_color)\n                image = render_results['render']\n                alpha = render_results['alpha']\n                depth = render_results['depth']\n                surf_normal = render_results['surf_normal']\n                rend_normal = render_results['rend_normal']\n                dist = render_results['dist']\n                images[idx, vidx] = image\n                alphas[idx, vidx] = alpha\n                depths[idx, vidx] = depth\n                surf_normals[idx, vidx] = surf_normal\n                rend_normals[idx, vidx] = rend_normal\n                dists[idx, vidx] = dist\n        results = {'image': images, 'alpha': alphas, 'depth': depths, 'surf_normals': surf_normals, 'rend_normals': rend_normals, 'dists': dists}\n        return results\n"
  },
  {
    "path": "freesplatter/models/renderer_2dgs/gaussian_utils.py",
    "content": "\"\"\"\nGaussian Splatting.\nPartially borrowed from https://github.com/graphdeco-inria/gaussian-splatting.\n\"\"\"\n\n\nimport os\nimport torch\nfrom torch import nn\nimport numpy as np\nfrom diff_surfel_rasterization import (\n    GaussianRasterizationSettings,\n    GaussianRasterizer,\n)\nfrom plyfile import PlyData, PlyElement\nfrom scipy.spatial.transform import Rotation as R\n\n\ndef strip_lowerdiag(L):\n    uncertainty = torch.zeros((L.shape[0], 6), dtype=torch.float, device=L.device)\n\n    uncertainty[:, 0] = L[:, 0, 0]\n    uncertainty[:, 1] = L[:, 0, 1]\n    uncertainty[:, 2] = L[:, 0, 2]\n    uncertainty[:, 3] = L[:, 1, 1]\n    uncertainty[:, 4] = L[:, 1, 2]\n    uncertainty[:, 5] = L[:, 2, 2]\n    return uncertainty\n\n\ndef strip_symmetric(sym):\n    return strip_lowerdiag(sym)\n\n\ndef build_rotation(r):\n    norm = torch.sqrt(\n        r[:, 0] * r[:, 0] + r[:, 1] * r[:, 1] + r[:, 2] * r[:, 2] + r[:, 3] * r[:, 3]\n    )\n\n    q = r / norm[:, None]\n\n    R = torch.zeros((q.size(0), 3, 3), device=r.device)\n\n    r = q[:, 0]\n    x = q[:, 1]\n    y = q[:, 2]\n    z = q[:, 3]\n\n    R[:, 0, 0] = 1 - 2 * (y * y + z * z)\n    R[:, 0, 1] = 2 * (x * y - r * z)\n    R[:, 0, 2] = 2 * (x * z + r * y)\n    R[:, 1, 0] = 2 * (x * y + r * z)\n    R[:, 1, 1] = 1 - 2 * (x * x + z * z)\n    R[:, 1, 2] = 2 * (y * z - r * x)\n    R[:, 2, 0] = 2 * (x * z - r * y)\n    R[:, 2, 1] = 2 * (y * z + r * x)\n    R[:, 2, 2] = 1 - 2 * (x * x + y * y)\n    return R\n\n\ndef build_scaling_rotation(s, r):\n    L = torch.zeros((s.shape[0], 3, 3), dtype=torch.float, device=s.device)\n    R = build_rotation(r)\n\n    L[:, 0, 0] = s[:, 0]\n    L[:, 1, 1] = s[:, 1]\n    L[:, 2, 2] = s[:, 2]\n\n    L = R @ L\n    return L\n\n\ndef build_covariance_from_scaling_rotation(scaling, scaling_modifier, rotation):\n    L = build_scaling_rotation(scaling_modifier * scaling, rotation)\n    actual_covariance = L @ L.transpose(1, 2)\n    symm = strip_symmetric(actual_covariance)\n    return symm\n\n\ndef depths_to_points(view, depthmap):\n    c2w = (view.world_view_transform.T).inverse()\n    W, H = view.w, view.h\n    ndc2pix = torch.tensor([\n        [W / 2, 0, 0, (W) / 2],\n        [0, H / 2, 0, (H) / 2],\n        [0, 0, 0, 1]]).float().cuda().T\n    projection_matrix = c2w.T @ view.full_proj_transform\n    intrins = (projection_matrix @ ndc2pix)[:3,:3].T\n    \n    grid_x, grid_y = torch.meshgrid(torch.arange(W, device='cuda').float(), torch.arange(H, device='cuda').float(), indexing='xy')\n    points = torch.stack([grid_x, grid_y, torch.ones_like(grid_x)], dim=-1).reshape(-1, 3)\n    rays_d = points @ intrins.inverse().T @ c2w[:3,:3].T\n    rays_o = c2w[:3,3]\n    points = depthmap.reshape(-1, 1) * rays_d + rays_o\n    return points\n\n\ndef depth_to_normal(view, depth):\n    \"\"\"\n        view: view camera\n        depth: depthmap \n    \"\"\"\n    points = depths_to_points(view, depth).reshape(*depth.shape[1:], 3)\n    output = torch.zeros_like(points)\n    dx = torch.cat([points[2:, 1:-1] - points[:-2, 1:-1]], dim=0)\n    dy = torch.cat([points[1:-1, 2:] - points[1:-1, :-2]], dim=1)\n    normal_map = torch.nn.functional.normalize(torch.cross(dx, dy, dim=-1), dim=-1)\n    output[1:-1, 1:-1, :] = normal_map\n    return output\n\n\nclass Camera(nn.Module):\n    def __init__(self, C2W, fxfycxcy, h, w):\n        \"\"\"\n        C2W: 4x4 camera-to-world matrix; opencv convention\n        fxfycxcy: 4\n        \"\"\"\n        super().__init__()\n        self.C2W = C2W.float()\n        self.W2C = self.C2W.inverse()\n\n        self.znear = 0.01\n        self.zfar = 100.0\n        self.h = h\n        self.w = w\n\n        fx, fy, cx, cy = fxfycxcy[0], fxfycxcy[1], fxfycxcy[2], fxfycxcy[3]\n        self.tanfovX = 1 / (2 * fx)\n        self.tanfovY = 1 / (2 * fy)\n        self.fovX = 2 * torch.atan(self.tanfovX)\n        self.fovY = 2 * torch.atan(self.tanfovY)\n        self.shiftX = 2 * cx - 1\n        self.shiftY = 2 * cy - 1\n\n        def getProjectionMatrix(znear, zfar, fovX, fovY, shiftX, shiftY):\n            tanHalfFovY = torch.tan((fovY / 2))\n            tanHalfFovX = torch.tan((fovX / 2))\n\n            top = tanHalfFovY * znear\n            bottom = -top\n            right = tanHalfFovX * znear\n            left = -right\n\n            P = torch.zeros(4, 4, dtype=torch.float32, device=fovX.device)\n\n            z_sign = 1.0\n\n            P[0, 0] = 2.0 * znear / (right - left)\n            P[1, 1] = 2.0 * znear / (top - bottom)\n            P[0, 2] = (right + left) / (right - left) + shiftX\n            P[1, 2] = (top + bottom) / (top - bottom) + shiftY\n            P[3, 2] = z_sign\n            P[2, 2] = z_sign * zfar / (zfar - znear)\n            P[2, 3] = -(zfar * znear) / (zfar - znear)\n            return P\n\n        self.world_view_transform = self.W2C.transpose(0, 1)\n        self.projection_matrix = getProjectionMatrix(\n            znear=self.znear, zfar=self.zfar, fovX=self.fovX, fovY=self.fovY, shiftX=self.shiftX, shiftY=self.shiftY\n        ).transpose(0, 1)\n        self.full_proj_transform = (\n            self.world_view_transform.unsqueeze(0).bmm(\n                self.projection_matrix.unsqueeze(0)\n            )\n        ).squeeze(0)\n        self.camera_center = self.C2W[:3, 3]\n\n\nclass GaussianModel:\n    def setup_functions(self, scaling_activation_type='sigmoid', scale_min_act=0.001, scale_max_act=0.3, scale_multi_act=0.1):\n\n        if scaling_activation_type == 'exp':\n            self.scaling_activation = torch.exp\n        elif scaling_activation_type == 'softplus':\n            self.scaling_activation = torch.nn.functional.softplus\n            self.scale_multi_act = scale_multi_act\n        elif scaling_activation_type == 'sigmoid':\n            self.scale_min_act = scale_min_act\n            self.scale_max_act = scale_max_act\n            self.scaling_activation = torch.sigmoid\n        else:\n            raise NotImplementedError\n        self.scaling_activation_type = scaling_activation_type\n\n        self.rotation_activation = torch.nn.functional.normalize\n        self.opacity_activation = torch.sigmoid\n        self.feature_activation = torch.sigmoid\n        self.covariance_activation = build_covariance_from_scaling_rotation\n\n    def __init__(self, sh_degree: int, scaling_activation_type='exp', scale_min_act=0.001, scale_max_act=0.3, scale_multi_act=0.1):\n        self.sh_degree = sh_degree\n        self._xyz = torch.empty(0)\n        self._features_dc = torch.empty(0)\n        if self.sh_degree > 0:\n            self._features_rest = torch.empty(0)\n        else:\n            self._features_rest = None\n        self._scaling = torch.empty(0)\n        self._rotation = torch.empty(0)\n        self._opacity = torch.empty(0)\n        self.setup_functions(scaling_activation_type=scaling_activation_type, scale_min_act=scale_min_act, scale_max_act=scale_max_act, scale_multi_act=scale_multi_act)\n\n    def set_data(self, xyz, features, scaling, rotation, opacity):\n        self._xyz = xyz\n        self._features_dc = features[:, 0, :].contiguous() if self.sh_degree == 0 else features[:, 0:1, :].contiguous()\n        if self.sh_degree > 0:\n            self._features_rest = features[:, 1:, :].contiguous()\n        else:\n            self._features_rest = None\n        self._scaling = scaling\n        self._rotation = rotation\n        self._opacity = opacity\n        return self\n\n    def to(self, device):\n        self._xyz = self._xyz.to(device)\n        self._features_dc = self._features_dc.to(device)\n        if self.sh_degree > 0:\n            self._features_rest = self._features_rest.to(device)\n        self._scaling = self._scaling.to(device)\n        self._rotation = self._rotation.to(device)\n        self._opacity = self._opacity.to(device)\n        return self\n\n    @property\n    def get_scaling(self):\n        if self.scaling_activation_type == 'exp':\n            scales = self.scaling_activation(self._scaling)\n        elif self.scaling_activation_type == 'softplus':\n            scales = self.scaling_activation(self._scaling) * self.scale_multi_act\n        elif self.scaling_activation_type == 'sigmoid':\n            scales = self.scale_min_act + (self.scale_max_act - self.scale_min_act) * self.scaling_activation(self._scaling)\n        return scales\n\n    @property\n    def get_rotation(self):\n        return self.rotation_activation(self._rotation)\n\n    @property\n    def get_xyz(self):\n        return self._xyz\n\n    @property\n    def get_features(self):\n        if self.sh_degree > 0:\n            features_dc = self._features_dc\n            features_rest = self._features_rest\n            return torch.cat((features_dc, features_rest), dim=1)\n        else:\n            return self.feature_activation(self._features_dc)\n\n    @property\n    def get_opacity(self):\n        return self.opacity_activation(self._opacity)\n\n    def get_covariance(self, scaling_modifier=1):\n        return self.covariance_activation(\n            self.get_scaling, scaling_modifier, self._rotation\n        )\n\n    def construct_list_of_attributes(self, num_rest=0):\n        l = ['x', 'y', 'z']\n        # All channels except the 3 DC\n        for i in range(3):\n            l.append('f_dc_{}'.format(i))\n        for i in range(num_rest):\n            l.append('f_rest_{}'.format(i))\n        l.append('opacity')\n        for i in range(self._scaling.shape[1]):\n            l.append('scale_{}'.format(i))\n        for i in range(self._rotation.shape[1]):\n            l.append('rot_{}'.format(i))\n        return l\n\n    def save_ply_vis(self, path):\n        os.makedirs(os.path.dirname(path), exist_ok=True)\n\n        xyzs = self._xyz.detach().cpu().numpy()\n        f_dc = self._features_dc.detach().flatten(start_dim=1).contiguous().cpu().numpy()\n        opacities = self._opacity.detach().cpu().numpy()\n\n        scales = torch.log(self.get_scaling)\n        scales = scales.detach().cpu().numpy()\n\n        rot_mat_vis = np.array([[1, 0, 0], [0, 0, -1], [0, 1, 0]])\n        xyzs = xyzs @ rot_mat_vis.T\n        rotations = self._rotation.detach().cpu().numpy()\n        rotations = R.from_quat(rotations[:, [1,2,3,0]]).as_matrix()\n        rotations = rot_mat_vis @ rotations\n        rotations = R.from_matrix(rotations).as_quat()[:, [3,0,1,2]]\n\n        dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes(0)]\n        elements = np.empty(xyzs.shape[0], dtype=dtype_full)\n        attributes = np.concatenate((xyzs, f_dc, opacities, scales, rotations), axis=1)\n        elements[:] = list(map(tuple, attributes))\n        el = PlyElement.describe(elements, 'vertex')\n        PlyData([el]).write(path)\n\n    def save_ply(self, path):\n        os.makedirs(os.path.dirname(path), exist_ok=True)\n\n        xyzs = self._xyz.detach().cpu().numpy()\n        f_dc = self._features_dc.detach().flatten(start_dim=1).contiguous().cpu().numpy()\n        if self.sh_degree > 0:\n            f_rest = self._features_rest.detach().flatten(start_dim=1).contiguous().cpu().numpy()\n        else:\n            f_rest = np.zeros((f_dc.shape[0], 0), dtype=f_dc.dtype)\n        opacities = self._opacity.detach().cpu().numpy()\n\n        scales = torch.log(self.get_scaling)\n        scales = scales.detach().cpu().numpy()\n\n        rotations = self._rotation.detach().cpu().numpy()\n\n        dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes(f_rest.shape[-1])]\n        elements = np.empty(xyzs.shape[0], dtype=dtype_full)\n        attributes = np.concatenate((xyzs, f_dc, f_rest, opacities, scales, rotations), axis=1)\n        elements[:] = list(map(tuple, attributes))\n        el = PlyElement.describe(elements, \"vertex\")\n        PlyData([el]).write(path)\n\n    # def load_ply(self, path):\n    #     plydata = PlyData.read(path)\n\n    #     xyz = np.stack((np.asarray(plydata.elements[0][\"x\"]),\n    #                     np.asarray(plydata.elements[0][\"y\"]),\n    #                     np.asarray(plydata.elements[0][\"z\"])),  axis=1)\n    #     opacities = np.asarray(plydata.elements[0][\"opacity\"])[..., np.newaxis]\n\n    #     features_dc = np.zeros((xyz.shape[0], 3, 1))\n    #     features_dc[:, 0, 0] = np.asarray(plydata.elements[0][\"f_dc_0\"])\n    #     features_dc[:, 1, 0] = np.asarray(plydata.elements[0][\"f_dc_1\"])\n    #     features_dc[:, 2, 0] = np.asarray(plydata.elements[0][\"f_dc_2\"])\n\n    #     scale_names = [p.name for p in plydata.elements[0].properties if p.name.startswith(\"scale_\")]\n    #     scale_names = sorted(scale_names, key = lambda x: int(x.split('_')[-1]))\n    #     scales = np.zeros((xyz.shape[0], len(scale_names)))\n    #     for idx, attr_name in enumerate(scale_names):\n    #         scales[:, idx] = np.asarray(plydata.elements[0][attr_name])\n\n    #     rot_names = [p.name for p in plydata.elements[0].properties if p.name.startswith(\"rot\")]\n    #     rot_names = sorted(rot_names, key=lambda x: int(x.split(\"_\")[-1]))\n    #     rots = np.zeros((xyz.shape[0], len(rot_names)))\n    #     for idx, attr_name in enumerate(rot_names):\n    #         rots[:, idx] = np.asarray(plydata.elements[0][attr_name])\n\n    #     self._xyz = torch.from_numpy(xyz.astype(np.float32))\n    #     self._features_dc = torch.from_numpy(features_dc.astype(np.float32)).transpose(1, 2).contiguous()\n    #     self._opacity = torch.from_numpy(opacities.astype(np.float32)).contiguous()\n    #     self._scaling = torch.from_numpy(scales.astype(np.float32)).contiguous()\n    #     self._rotation = torch.from_numpy(rots.astype(np.float32)).contiguous()\n\n\ndef render(\n    pc: GaussianModel,\n    height: int,\n    width: int,\n    C2W: torch.Tensor,\n    fxfycxcy: torch.Tensor,\n    bg_color=(1.0, 1.0, 1.0),\n    scaling_modifier=1.0,\n):\n    \"\"\"\n    Render the scene.\n    \"\"\"\n    screenspace_points = (\n        torch.zeros_like(\n            pc.get_xyz, dtype=pc.get_xyz.dtype, requires_grad=True, device=\"cuda\"\n        )\n        + 0\n    )\n    try:\n        screenspace_points.retain_grad()\n    except:\n        pass\n\n    viewpoint_camera = Camera(C2W=C2W, fxfycxcy=fxfycxcy, h=height, w=width)\n\n    bg_color = torch.tensor(list(bg_color), dtype=torch.float32, device=C2W.device)\n\n    raster_settings = GaussianRasterizationSettings(\n        image_height=int(viewpoint_camera.h),\n        image_width=int(viewpoint_camera.w),\n        tanfovx=viewpoint_camera.tanfovX,\n        tanfovy=viewpoint_camera.tanfovY,\n        bg=bg_color,\n        scale_modifier=scaling_modifier,\n        viewmatrix=viewpoint_camera.world_view_transform,\n        projmatrix=viewpoint_camera.full_proj_transform,\n        sh_degree=pc.sh_degree,\n        campos=viewpoint_camera.camera_center,\n        prefiltered=False,\n        debug=False,\n    )\n\n    rasterizer = GaussianRasterizer(raster_settings=raster_settings)\n\n    means3D = pc.get_xyz\n    means2D = screenspace_points\n    opacity = pc.get_opacity\n    scales = pc.get_scaling\n    rotations = pc.get_rotation\n    shs = pc.get_features\n\n    rendered_image, _, allmap = rasterizer(\n        means3D=means3D,\n        means2D=means2D,\n        shs=None if pc.sh_degree == 0 else shs,\n        colors_precomp=shs if pc.sh_degree == 0 else None,\n        opacities=opacity,\n        scales=scales,\n        rotations=rotations,\n        cov3D_precomp=None,\n    )\n\n    # additional regularizations\n    render_alpha = allmap[1:2]\n\n    # get normal map\n    # transform normal from view space to world space\n    render_normal = allmap[2:5]\n    render_normal = (render_normal.permute(1, 2, 0) @ (viewpoint_camera.world_view_transform[:3, :3].T)).permute(2, 0, 1)\n    \n    # get median depth map\n    render_depth_median = allmap[5:6]\n    render_depth_median = torch.nan_to_num(render_depth_median, 0, 0)\n\n    # get expected depth map\n    render_depth_expected = allmap[0:1]\n    render_depth_expected = (render_depth_expected / render_alpha)\n    render_depth_expected = torch.nan_to_num(render_depth_expected, 0, 0)\n    \n    # get depth distortion map\n    render_dist = allmap[6:7]\n\n    # psedo surface attributes\n    # surf depth is either median or expected by setting depth_ratio to 1 or 0\n    # for bounded scene, use median depth, i.e., depth_ratio = 1; \n    # for unbounded scene, use expected depth, i.e., depth_ration = 0, to reduce disk anliasing.\n    depth_ratio = 0.0\n    surf_depth = render_depth_expected * (1 - depth_ratio) + depth_ratio * render_depth_median\n    \n    # assume the depth points form the 'surface' and generate psudo surface normal for regularizations.\n    surf_normal = depth_to_normal(viewpoint_camera, surf_depth)\n    surf_normal = surf_normal.permute(2, 0, 1)\n    # remember to multiply with accum_alpha since render_normal is unnormalized.\n    surf_normal = surf_normal * (render_alpha).detach()\n\n    return {\n        \"render\": rendered_image,\n        \"depth\": surf_depth,\n        \"alpha\": render_alpha,\n        'surf_normal': surf_normal,\n        'rend_normal': render_normal,\n        'dist': render_dist,\n    }\n"
  },
  {
    "path": "freesplatter/models/transformer.py",
    "content": "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom inspect import isfunction\nfrom einops import rearrange, repeat\nimport xformers.ops as xops\n\n\ndef exists(val):\n    return val is not None\n\n\ndef default(val, d):\n    if exists(val):\n        return val\n    return d() if isfunction(d) else d\n\n\nclass CrossAttention(nn.Module):\n    def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, dropout=0.):\n        super().__init__()\n        inner_dim = dim_head * heads\n        context_dim = default(context_dim, query_dim)\n\n        self.heads = heads\n\n        self.to_q = nn.Linear(query_dim, inner_dim, bias=False)\n        self.to_k = nn.Linear(context_dim, inner_dim, bias=False)\n        self.to_v = nn.Linear(context_dim, inner_dim, bias=False)\n\n        self.to_out = nn.Sequential(\n            nn.Linear(inner_dim, query_dim, bias=False),\n            nn.Dropout(dropout)\n        )\n\n    def forward(self, x, context=None, mask=None):\n        h = self.heads\n\n        q = self.to_q(x)\n        context = default(context, x)\n        k = self.to_k(context)\n        v = self.to_v(context)\n\n        q, k, v = map(lambda t: rearrange(t, 'b n (h d) -> (b h) n d', h=h), (q, k, v))\n\n        out = xops.memory_efficient_attention(q, k, v)\n        out = rearrange(out, '(b h) n d -> b n (h d)', h=h)\n\n        return self.to_out(out)\n\n\nclass BasicTransformerBlock(nn.Module):\n    def __init__(self, dim, n_heads, d_head, dropout=0., context_dim=None, gated_ff=True):\n        super().__init__()\n\n        self.self_attn = CrossAttention(query_dim=dim, heads=n_heads, dim_head=d_head, dropout=dropout)\n\n        self.ff = nn.Sequential(\n            nn.Linear(dim, dim*4, bias=False),\n            nn.GELU(),\n            nn.Linear(dim*4, dim, bias=False),\n        )\n\n        self.norm1 = nn.LayerNorm(dim, bias=False)\n        self.norm2 = nn.LayerNorm(dim, bias=False)\n\n    def forward(self, x, context=None):\n        before_sa = self.norm1(x)\n        x = x + self.self_attn(before_sa)\n        x = self.ff(self.norm2(x)) + x\n        return x\n\n\nclass Transformer(nn.Module):\n    def __init__(\n        self, \n        image_size=512, \n        patch_size=8, \n        input_dim=3, \n        inner_dim=1024,\n        output_dim=14,\n        n_heads=16, \n        depth=24, \n        dropout=0.,\n    ):\n        super().__init__()\n\n        self.patch_size = patch_size\n        self.input_dim = input_dim\n        self.inner_dim = inner_dim\n        self.output_dim = output_dim\n\n        self.patchify = nn.Conv2d(input_dim, inner_dim, kernel_size=patch_size, stride=patch_size, padding=0, bias=False)\n        \n        num_patches = (image_size // patch_size) ** 2\n        self.pos_embed = nn.Parameter(torch.zeros(1, num_patches, inner_dim))\n        self.ref_embed = nn.Parameter(torch.zeros(1, 1, inner_dim))\n        self.src_embed = nn.Parameter(torch.zeros(1, 1, inner_dim))\n\n        self.blocks = nn.ModuleList(\n            [BasicTransformerBlock(inner_dim, n_heads, inner_dim//n_heads, dropout=dropout)\n                for _ in range(depth)]\n        )\n\n        self.norm = nn.LayerNorm(inner_dim, bias=False)\n        self.unpatchify = nn.Linear(inner_dim, patch_size ** 2 * output_dim, bias=True)\n\n        nn.init.trunc_normal_(self.pos_embed, std=.02)\n        nn.init.trunc_normal_(self.ref_embed, std=.02)\n        nn.init.trunc_normal_(self.src_embed, std=.02)\n        self.apply(self._init_weights)\n    \n    def _init_weights(self, m):\n        if isinstance(m, nn.Linear):\n            nn.init.trunc_normal_(m.weight, std=.02)\n            if m.bias is not None:\n                nn.init.constant_(m.bias, 0)\n        elif isinstance(m, nn.LayerNorm):\n            nn.init.constant_(m.weight, 1.0)\n            if m.bias is not None:\n                nn.init.constant_(m.bias, 0)\n    \n    def interpolate_pos_encoding(self, x, w, h):\n        npatch = x.shape[-2]\n        N = self.pos_embed.shape[-2]\n        if npatch == N and w == h:\n            return self.pos_embed\n        patch_pos_embed = self.pos_embed\n        dim = x.shape[-1]\n        w0 = w // self.patch_size\n        h0 = h // self.patch_size\n        # we add a small number to avoid floating point error in the interpolation\n        # see discussion at https://github.com/facebookresearch/dino/issues/8\n        w0, h0 = w0 + 0.1, h0 + 0.1\n        patch_pos_embed = F.interpolate(\n            patch_pos_embed.reshape(1, int(math.sqrt(N)), int(math.sqrt(N)), dim).permute(0, 3, 1, 2).contiguous(),\n            scale_factor=(w0 / math.sqrt(N), h0 / math.sqrt(N)),\n            mode='bicubic',\n        )\n        assert int(w0) == patch_pos_embed.shape[-2] and int(h0) == patch_pos_embed.shape[-1]\n        patch_pos_embed = patch_pos_embed.permute(0, 2, 3, 1).view(1, -1, dim).contiguous()\n        return patch_pos_embed\n\n    def forward(self, images):\n        \"\"\"\n        images: (B, N, C, H, W)\n        \"\"\"\n        B, N, _, H, W = images.shape\n\n        # patchify\n        images = rearrange(images, 'b n c h w -> (b n) c h w')\n        tokens = self.patchify(images)\n        tokens = rearrange(tokens, 'bn c h w -> bn (h w) c')\n\n        # add pos encodings\n        tokens = rearrange(tokens, '(b n) hw c -> b n hw c', b=B)\n        tokens = tokens + self.interpolate_pos_encoding(tokens, W, H).unsqueeze(1)\n        view_embeds = torch.cat([self.ref_embed, self.src_embed.repeat(1, N-1, 1)], dim=1)\n        tokens = tokens + view_embeds.unsqueeze(2)\n\n        # transformer\n        tokens = rearrange(tokens, 'b n hw c -> b (n hw) c')\n        x = tokens\n        for layer in self.blocks:\n            x = layer(x)\n        \n        # unpatchify\n        x = self.norm(x)\n        x = self.unpatchify(x)\n        x = rearrange(x, 'b (n h w) c -> b n h w c', n=N, h=H//self.patch_size, w=W//self.patch_size)\n        x = rearrange(x, 'b n h w (p q c) -> b n (h p) (w q) c', p=self.patch_size, q=self.patch_size)\n        out = x\n\n        return out\n"
  },
  {
    "path": "freesplatter/utils/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/utils/camera_util.py",
    "content": "import torch\nimport numpy as np\n\n\ndef normalize_vecs(vectors: torch.Tensor) -> torch.Tensor:\n    \"\"\"\n    Normalize vector lengths.\n    \"\"\"\n    return vectors / (torch.norm(vectors, dim=-1, keepdim=True))\n\n\ndef blender_to_opencv(camera_matrix: torch.Tensor):\n    \"\"\"\n    Convert Blender World-to-Camera matrix into OpenCV space by flipping y and z axes\n    Blender camera system: x-right, y-up, z-backward\n    OpenCV camera system: x-right, y-down, z-forward\n    \"\"\"\n    flip_yz = torch.tensor([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]])\n    if camera_matrix.ndim == 3:\n        flip_yz = flip_yz.unsqueeze(0)\n    camera_matrix_opencv = torch.matmul(flip_yz.to(camera_matrix), camera_matrix)\n    return camera_matrix_opencv\n\n\ndef pad_camera_extrinsics_4x4(extrinsics):\n    if extrinsics.shape[-2] == 4:\n        return extrinsics\n    padding = torch.tensor([[0, 0, 0, 1]]).to(extrinsics)\n    if extrinsics.ndim == 3:\n        padding = padding.unsqueeze(0).repeat(extrinsics.shape[0], 1, 1)\n    extrinsics = torch.cat([extrinsics, padding], dim=-2)\n    return extrinsics\n\n\ndef create_camera_to_world(camera_position: torch.Tensor, look_at: torch.Tensor = None, up_world: torch.Tensor = None, camera_system: str = 'opencv'):\n    \"\"\"\n    Create OpenCV or OpenGL camera extrinsics from camera locations and look-at position.\n\n    camera_position: (M, 3) or (3,)\n    look_at: (3)\n    up_world: (3)\n    return: (M, 3, 4) or (3, 4)\n    \"\"\"\n    # by default, looking at the origin and world up is z-axis\n    if look_at is None:\n        look_at = torch.tensor([0, 0, 0], dtype=torch.float32)\n    if up_world is None:\n        up_world = torch.tensor([0, 0, 1], dtype=torch.float32)\n    if camera_position.ndim == 2:\n        look_at = look_at.unsqueeze(0).repeat(camera_position.shape[0], 1)\n        up_world = up_world.unsqueeze(0).repeat(camera_position.shape[0], 1)\n\n    assert camera_system in ['opencv', 'opengl']\n    if camera_system == 'opencv':\n        # OpenCV camera: z-forward, x-right, y-down\n        z_axis = look_at - camera_position\n        z_axis = normalize_vecs(z_axis).float()\n        x_axis = torch.cross(z_axis, up_world)\n        x_axis = normalize_vecs(x_axis).float()\n        y_axis = torch.cross(z_axis, x_axis)\n        y_axis = normalize_vecs(y_axis).float()\n    else:\n        # OpenGL camera: z-backward, x-right, y-up\n        z_axis = camera_position - look_at\n        z_axis = normalize_vecs(z_axis).float()\n        x_axis = torch.cross(up_world, z_axis)\n        x_axis = normalize_vecs(x_axis).float()\n        y_axis = torch.cross(z_axis, x_axis)\n        y_axis = normalize_vecs(y_axis).float()\n\n    extrinsics = torch.stack([x_axis, y_axis, z_axis, camera_position], dim=-1)\n    extrinsics = pad_camera_extrinsics_4x4(extrinsics)\n    return extrinsics\n\n\ndef FOV_to_intrinsics(fov, device='cpu'):\n    \"\"\"\n    Creates a 3x3 camera intrinsics matrix from the camera field of view, specified in degrees.\n    Note the intrinsics are returned as normalized by image size, rather than in pixel units.\n    Assumes principal point is at image center.\n    \"\"\"\n    focal_length = 0.5 / np.tan(np.deg2rad(fov) * 0.5)\n    intrinsics = torch.tensor([[focal_length, 0, 0.5], [0, focal_length, 0.5], [0, 0, 1]], device=device)\n    return intrinsics\n\n\ndef normalize_cameras(extrinsics, camera_position: torch.Tensor = None, camera_system: str = 'opencv', canonical_index=0):\n    \"\"\"\n    Normalize the first camera to the canonical camera position, and transform other cameras accordingly.\n\n    extrinsics: (N, 4, 4)\n    \"\"\"\n    if camera_position is None:\n        camera_position = torch.tensor([[0, -2, 0]]).float()\n    assert camera_system in ['opencv', 'opengl']\n\n    canonical_distance = camera_position.norm()\n\n    # compute conditional camera distances\n    cond_extrinsic = extrinsics[canonical_index]\n    # cond_extrinsic = extrinsics[0]\n    cond_camera_distance = cond_extrinsic[:3, 3].norm(dim=-1, keepdim=False)\n\n    # scale camera distances\n    scale = canonical_distance / cond_camera_distance\n    extrinsics[:, :3, 3] = extrinsics[:, :3, 3] * scale\n    \n    # rotate all cameras\n    canonical_extrinsic = create_camera_to_world(camera_position, camera_system=camera_system).to(extrinsics)\n    # transform_matrix = torch.matmul(canonical_extrinsic, torch.linalg.inv(extrinsics[0:1]))\n    transform_matrix = torch.matmul(canonical_extrinsic, torch.linalg.inv(extrinsics[canonical_index:canonical_index+1]))\n    normalized_extrinsics = torch.matmul(transform_matrix, extrinsics)\n\n    return normalized_extrinsics, scale"
  },
  {
    "path": "freesplatter/utils/geometry_util.py",
    "content": "import torch\nimport torch.nn.functional as F\nfrom einops import rearrange\n\n\n# --- Intrinsics Transformations ---\n\ndef normalize_intrinsics(intrinsics, image_shape):\n    '''Normalize an intrinsics matrix given the image shape'''\n    intrinsics = intrinsics.clone()\n    intrinsics[..., 0, :] /= image_shape[1]\n    intrinsics[..., 1, :] /= image_shape[0]\n    return intrinsics\n\n\ndef unnormalize_intrinsics(intrinsics, image_shape):\n    '''Unnormalize an intrinsics matrix given the image shape'''\n    intrinsics = intrinsics.clone()\n    intrinsics[..., 0, :] *= image_shape[1]\n    intrinsics[..., 1, :] *= image_shape[0]\n    return intrinsics\n\n\n# --- Projections ---\n\ndef homogenize_points(points):\n    \"\"\"Append a '1' along the final dimension of the tensor (i.e. convert xyz->xyz1)\"\"\"\n    return torch.cat([points, torch.ones_like(points[..., :1])], dim=-1)\n\n\ndef normalize_homogenous_points(points):\n    \"\"\"Normalize the point vectors\"\"\"\n    return points / points[..., -1:]\n\n\ndef pixel_space_to_camera_space(pixel_space_points, depth, intrinsics):\n    \"\"\"\n    Convert pixel space points to camera space points.\n\n    Args:\n        pixel_space_points (torch.Tensor): Pixel space points with shape (h, w, 2)\n        depth (torch.Tensor): Depth map with shape (b, v, h, w, 1)\n        intrinsics (torch.Tensor): Camera intrinsics with shape (b, v, 3, 3)\n\n    Returns:\n        torch.Tensor: Camera space points with shape (b, v, h, w, 3).\n    \"\"\"\n    pixel_space_points = homogenize_points(pixel_space_points)\n    camera_space_points = torch.einsum('b v i j , h w j -> b v h w i', intrinsics.inverse(), pixel_space_points)\n    camera_space_points = camera_space_points * depth\n    return camera_space_points\n\n\ndef camera_space_to_world_space(camera_space_points, c2w):\n    \"\"\"\n    Convert camera space points to world space points.\n\n    Args:\n        camera_space_points (torch.Tensor): Camera space points with shape (b, v, h, w, 3)\n        c2w (torch.Tensor): Camera to world extrinsics matrix with shape (b, v, 4, 4)\n\n    Returns:\n        torch.Tensor: World space points with shape (b, v, h, w, 3).\n    \"\"\"\n    camera_space_points = homogenize_points(camera_space_points)\n    world_space_points = torch.einsum('b v i j , b v h w j -> b v h w i', c2w, camera_space_points)\n    return world_space_points[..., :3]\n\n\ndef camera_space_to_pixel_space(camera_space_points, intrinsics):\n    \"\"\"\n    Convert camera space points to pixel space points.\n\n    Args:\n        camera_space_points (torch.Tensor): Camera space points with shape (b, v1, v2, h, w, 3)\n        c2w (torch.Tensor): Camera to world extrinsics matrix with shape (b, v2, 3, 3)\n\n    Returns:\n        torch.Tensor: World space points with shape (b, v1, v2, h, w, 2).\n    \"\"\"\n    camera_space_points = normalize_homogenous_points(camera_space_points)\n    pixel_space_points = torch.einsum('b u i j , b v u h w j -> b v u h w i', intrinsics, camera_space_points)\n    return pixel_space_points[..., :2]\n\n\ndef world_space_to_camera_space(world_space_points, c2w):\n    \"\"\"\n    Convert world space points to pixel space points.\n\n    Args:\n        world_space_points (torch.Tensor): World space points with shape (b, v1, h, w, 3)\n        c2w (torch.Tensor): Camera to world extrinsics matrix with shape (b, v2, 4, 4)\n\n    Returns:\n        torch.Tensor: Camera space points with shape (b, v1, v2, h, w, 3).\n    \"\"\"\n    world_space_points = homogenize_points(world_space_points)\n    camera_space_points = torch.einsum('b u i j , b v h w j -> b v u h w i', c2w.inverse(), world_space_points)\n    return camera_space_points[..., :3]\n\n\ndef unproject_depth(depth, intrinsics, c2w):\n    \"\"\"\n    Turn the depth map into a 3D point cloud in world space\n\n    Args:\n        depth: (b, v, h, w, 1)\n        intrinsics: (b, v, 3, 3)\n        c2w: (b, v, 4, 4)\n\n    Returns:\n        torch.Tensor: World space points with shape (b, v, h, w, 3).\n    \"\"\"\n\n    # Compute indices of pixels\n    h, w = depth.shape[-3], depth.shape[-2]\n    x_grid, y_grid = torch.meshgrid(\n        torch.arange(w, device=depth.device, dtype=torch.float32),\n        torch.arange(h, device=depth.device, dtype=torch.float32),\n        indexing='xy'\n    )  # (h, w), (h, w)\n\n    # Compute coordinates of pixels in camera space\n    pixel_space_points = torch.stack((x_grid, y_grid), dim=-1)  # (..., h, w, 2)\n    camera_points = pixel_space_to_camera_space(pixel_space_points, depth, intrinsics)  # (..., h, w, 3)\n\n    # Convert points to world space\n    world_points = camera_space_to_world_space(camera_points, c2w)  # (..., h, w, 3)\n\n    return world_points\n\n\n@torch.no_grad()\ndef calculate_in_frustum_mask(depth_1, intrinsics_1, c2w_1, depth_2, intrinsics_2, c2w_2, depth_tolerance=1e-1):\n    \"\"\"\n    A function that takes in the depth, intrinsics and c2w matrices of two sets\n    of views, and then works out which of the pixels in the first set of views\n    has a direct corresponding pixel in any of views in the second set\n\n    Args:\n        depth_1: (b, v1, h, w)\n        intrinsics_1: (b, v1, 3, 3)\n        c2w_1: (b, v1, 4, 4)\n        depth_2: (b, v2, h, w)\n        intrinsics_2: (b, v2, 3, 3)\n        c2w_2: (b, v2, 4, 4)\n\n    Returns:\n        torch.Tensor: Mask with shape (b, v1, h, w).\n    \"\"\"\n\n    _, v1, h, w = depth_1.shape\n    _, v2, _, _ = depth_2.shape\n\n    # unnormalize intrinsics if needed\n    if intrinsics_1[0, 0, 0, 2] < 1:\n        intrinsics_1 = unnormalize_intrinsics(intrinsics_1, (h, w))\n    if intrinsics_2[0, 0, 0, 2] < 1:\n        intrinsics_2 = unnormalize_intrinsics(intrinsics_2, (h, w))\n\n    # Unproject the depth to get the 3D points in world space\n    points_3d = unproject_depth(depth_1[..., None], intrinsics_1, c2w_1)  # (b, v1, h, w, 3)\n\n    # Project the 3D points into the pixel space of all the second views simultaneously\n    camera_points = world_space_to_camera_space(points_3d, c2w_2)  # (b, v1, v2, h, w, 3)\n    points_2d = camera_space_to_pixel_space(camera_points, intrinsics_2)  # (b, v1, v2, h, w, 2)\n\n    # Calculate the depth of each point\n    rendered_depth = camera_points[..., 2]  # (b, v1, v2, h, w)\n\n    # We use three conditions to determine if a point should be masked\n\n    # Condition 1: Check if the points are in the frustum of any of the v2 views\n    in_frustum_mask = (\n        (points_2d[..., 0] > 0) &\n        (points_2d[..., 0] < w) &\n        (points_2d[..., 1] > 0) &\n        (points_2d[..., 1] < h)\n    )  # (b, v1, v2, h, w)\n    in_frustum_mask = in_frustum_mask.any(dim=-3)  # (b, v1, h, w)\n\n    # Condition 2: Check if the points have non-zero (i.e. valid) depth in the input view\n    non_zero_depth = depth_1 > 1e-6\n\n    # Condition 3: Check if the points have matching depth to any of the v2\n    # views F.grid_sample expects the input coordinates to\n    # be normalized to the range [-1, 1], so we normalize first\n    points_2d[..., 0] /= w\n    points_2d[..., 1] /= h\n    points_2d = points_2d * 2 - 1\n    matching_depth = torch.ones_like(rendered_depth, dtype=torch.bool)\n    for b in range(depth_1.shape[0]):\n        for i in range(v1):\n            for j in range(v2):\n                depth = rearrange(depth_2[b, j], 'h w -> 1 1 h w')\n                coords = rearrange(points_2d[b, i, j], 'h w c -> 1 h w c')\n                sampled_depths = F.grid_sample(depth, coords, align_corners=False)[0, 0]\n                matching_depth[b, i, j] = torch.isclose(rendered_depth[b, i, j], sampled_depths, atol=depth_tolerance)\n\n    matching_depth = matching_depth.any(dim=-3)  # (..., v1, h, w)\n\n    mask = in_frustum_mask & non_zero_depth & matching_depth\n    return mask"
  },
  {
    "path": "freesplatter/utils/infer_util.py",
    "content": "import os\nimport importlib\nimport imageio\nimport torch\nimport rembg\nimport numpy as np\nimport PIL.Image\nfrom PIL import Image\nfrom typing import Any\nfrom torchvision import transforms\n\n\ndef instantiate_from_config(config):\n    if not \"target\" in config:\n        if config == '__is_first_stage__':\n            return None\n        elif config == \"__is_unconditional__\":\n            return None\n        raise KeyError(\"Expected key `target` to instantiate.\")\n    return get_obj_from_str(config[\"target\"])(**config.get(\"params\", dict()))\n\n\ndef get_obj_from_str(string, reload=False):\n    module, cls = string.rsplit(\".\", 1)\n    if reload:\n        module_imp = importlib.import_module(module)\n        importlib.reload(module_imp)\n    return getattr(importlib.import_module(module, package=None), cls)\n\n\ndef resize_without_crop(pil_image, target_width, target_height):\n    resized_image = pil_image.resize((target_width, target_height), Image.LANCZOS)\n    return np.array(resized_image)[:, :, :3]\n\n\n@torch.inference_mode()\ndef numpy2pytorch(imgs):\n    h = torch.from_numpy(np.stack(imgs, axis=0)).float() / 255.0 * 2.0 - 1.0\n    h = h.movedim(-1, 1)\n    return h\n\n\n@torch.inference_mode()\ndef remove_background(\n    image: PIL.Image.Image,\n    rembg: Any = None,\n    force: bool = False,\n    **rembg_kwargs,\n) -> PIL.Image.Image:\n    do_remove = True\n    if image.mode == \"RGBA\" and image.getextrema()[3][0] < 255:\n        do_remove = False\n    do_remove = do_remove or force\n    if do_remove:\n        W, H = image.size\n        k = (256.0 / float(H * W)) ** 0.5\n        feed = resize_without_crop(image, int(64 * round(W * k)), int(64 * round(H * k)))\n        feed = numpy2pytorch([feed]).to(device=rembg.device, dtype=torch.float32)\n        alpha = rembg(feed)[0][0]\n        alpha = torch.nn.functional.interpolate(alpha, size=(H, W), mode=\"bilinear\")\n        alpha = alpha.squeeze().clamp(0, 1)\n        alpha = (alpha * 255).cpu().data.numpy().astype(np.uint8)\n        alpha = Image.fromarray(alpha)\n\n        no_bg_image = Image.new(\"RGBA\", alpha.size, (0, 0, 0, 0))\n        no_bg_image.paste(image, mask=alpha)\n        image = no_bg_image\n    return image\n\n\n@torch.inference_mode()\ndef remove_background(\n    image: PIL.Image.Image,\n    rembg: Any = None,\n    force: bool = False,\n    **rembg_kwargs,\n) -> PIL.Image.Image:\n    do_remove = True\n    if image.mode == \"RGBA\" and image.getextrema()[3][0] < 255:\n        do_remove = False\n    do_remove = do_remove or force\n    if do_remove:\n        transform_image = transforms.Compose([\n            transforms.Resize((1024, 1024)),\n            transforms.ToTensor(),\n            transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])\n        ])\n        image = image.convert('RGB')\n        input_images = transform_image(image).unsqueeze(0).to(rembg.device)\n        with torch.no_grad():\n            preds = rembg(input_images)[-1].sigmoid().cpu()\n        pred = preds[0].squeeze()\n        pred_pil = transforms.ToPILImage()(pred)\n        mask = pred_pil.resize(image.size)\n        image.putalpha(mask)\n    return image\n\n\n# def remove_background(\n#     image: PIL.Image.Image,\n#     rembg_session: Any = None,\n#     force: bool = False,\n#     **rembg_kwargs,\n# ) -> PIL.Image.Image:\n#     do_remove = True\n#     if image.mode == \"RGBA\" and image.getextrema()[3][0] < 255:\n#         do_remove = False\n#     do_remove = do_remove or force\n#     if do_remove:\n#         image = rembg.remove(image, session=rembg_session, **rembg_kwargs)\n#     return image\n\n\ndef resize_foreground(\n    image: PIL.Image.Image,\n    ratio: float,\n) -> PIL.Image.Image:\n    image = np.array(image)\n    assert image.shape[-1] == 4\n    alpha = np.where(image[..., 3] > 0)\n    y1, y2, x1, x2 = (\n        alpha[0].min(),\n        alpha[0].max(),\n        alpha[1].min(),\n        alpha[1].max(),\n    )\n    # crop the foreground\n    fg = image[y1:y2, x1:x2]\n    # pad to square\n    size = max(fg.shape[0], fg.shape[1])\n    ph0, pw0 = (size - fg.shape[0]) // 2, (size - fg.shape[1]) // 2\n    ph1, pw1 = size - fg.shape[0] - ph0, size - fg.shape[1] - pw0\n    new_image = np.pad(\n        fg,\n        ((ph0, ph1), (pw0, pw1), (0, 0)),\n        mode=\"constant\",\n        constant_values=((0, 0), (0, 0), (0, 0)),\n    )\n\n    # compute padding according to the ratio\n    new_size = int(new_image.shape[0] / ratio)\n    # pad to size, double side\n    ph0, pw0 = (new_size - size) // 2, (new_size - size) // 2\n    ph1, pw1 = new_size - size - ph0, new_size - size - pw0\n    new_image = np.pad(\n        new_image,\n        ((ph0, ph1), (pw0, pw1), (0, 0)),\n        mode=\"constant\",\n        constant_values=((0, 0), (0, 0), (0, 0)),\n    )\n    new_image = Image.fromarray(new_image)\n    return new_image\n\n\ndef rgba_to_white_background(image: PIL.Image.Image) -> torch.Tensor:\n    image = np.asarray(image, dtype=np.float32) / 255.0\n    image = torch.from_numpy(image).movedim(2, 0).float()\n    image, alpha = image.split([3, 1], dim=0)\n    image = image * alpha + torch.ones_like(image) * (1 - alpha)\n    return image, alpha\n\n\ndef save_video(\n    frames: torch.Tensor,\n    output_path: str,\n    fps: int = 30,\n) -> None:\n    # images: (N, C, H, W)\n    frames = [(frame.permute(1, 2, 0).cpu().numpy() * 255).astype(np.uint8) for frame in frames]\n    writer = imageio.get_writer(output_path, mode='I', fps=fps, codec='libx264')\n    for frame in frames:\n        writer.append_data(frame)\n    writer.close()"
  },
  {
    "path": "freesplatter/utils/mesh_optim.py",
    "content": "from typing import *\nimport numpy as np\nimport torch\nimport utils3d\nimport nvdiffrast.torch as dr\nfrom tqdm import tqdm\nimport trimesh\nimport trimesh.visual\nimport xatlas\nimport cv2\nfrom PIL import Image\nimport fast_simplification\n\n\ndef parametrize_mesh(vertices: np.array, faces: np.array):\n    \"\"\"\n    Parametrize a mesh to a texture space, using xatlas.\n    Args:\n        vertices (np.array): Vertices of the mesh. Shape (V, 3).\n        faces (np.array): Faces of the mesh. Shape (F, 3).\n    \"\"\"\n\n    vmapping, indices, uvs = xatlas.parametrize(vertices, faces)\n\n    vertices = vertices[vmapping]\n    faces = indices\n\n    return vertices, faces, uvs\n\n\ndef bake_texture(\n    vertices: np.array,\n    faces: np.array,\n    uvs: np.array,\n    observations: List[np.array],\n    masks: List[np.array],\n    extrinsics: List[np.array],\n    intrinsics: List[np.array],\n    texture_size: int = 2048,\n    near: float = 0.1,\n    far: float = 10.0,\n    mode: Literal['fast', 'opt'] = 'opt',\n    lambda_tv: float = 1e-2,\n    verbose: bool = False,\n):\n    \"\"\"\n    Bake texture to a mesh from multiple observations.\n    Args:\n        vertices (np.array): Vertices of the mesh. Shape (V, 3).\n        faces (np.array): Faces of the mesh. Shape (F, 3).\n        uvs (np.array): UV coordinates of the mesh. Shape (V, 2).\n        observations (List[np.array]): List of observations. Each observation is a 2D image. Shape (H, W, 3).\n        masks (List[np.array]): List of masks. Each mask is a 2D image. Shape (H, W).\n        extrinsics (List[np.array]): List of extrinsics. Shape (4, 4).\n        intrinsics (List[np.array]): List of intrinsics. Shape (3, 3).\n        texture_size (int): Size of the texture.\n        near (float): Near plane of the camera.\n        far (float): Far plane of the camera.\n        mode (Literal['fast', 'opt']): Mode of texture baking.\n        lambda_tv (float): Weight of total variation loss in optimization.\n        verbose (bool): Whether to print progress.\n    \"\"\"\n    vertices = torch.tensor(vertices).float().cuda()\n    faces = torch.tensor(faces.astype(np.int32)).cuda()\n    uvs = torch.tensor(uvs).float().cuda()\n    observations = [torch.tensor(obs).float().cuda() for obs in observations]\n    masks = [torch.tensor(m>1e-2).bool().cuda() for m in masks]\n    views = [utils3d.torch.extrinsics_to_view(torch.tensor(extr).float().cuda()) for extr in extrinsics]\n    projections = [utils3d.torch.intrinsics_to_perspective(torch.tensor(intr).float().cuda(), near, far) for intr in intrinsics]\n\n    if mode == 'fast':\n        texture = torch.zeros((texture_size * texture_size, 3), dtype=torch.float32).cuda()\n        texture_weights = torch.zeros((texture_size * texture_size), dtype=torch.float32).cuda()\n        rastctx = utils3d.torch.RastContext(backend='cuda')\n        for observation, view, projection in tqdm(zip(observations, views, projections), total=len(observations), disable=not verbose, desc='Texture baking (fast)'):\n            with torch.no_grad():\n                rast = utils3d.torch.rasterize_triangle_faces(\n                    rastctx, vertices[None], faces, observation.shape[1], observation.shape[0], uv=uvs[None], view=view, projection=projection\n                )\n                uv_map = rast['uv'][0].detach().flip(0)\n                mask = rast['mask'][0].detach().bool() & masks[0]\n            \n            # nearest neighbor interpolation\n            uv_map = (uv_map * texture_size).floor().long()\n            obs = observation[mask]\n            uv_map = uv_map[mask]\n            idx = uv_map[:, 0] + (texture_size - uv_map[:, 1] - 1) * texture_size\n            texture = texture.scatter_add(0, idx.view(-1, 1).expand(-1, 3), obs)\n            texture_weights = texture_weights.scatter_add(0, idx, torch.ones((obs.shape[0]), dtype=torch.float32, device=texture.device))\n\n        mask = texture_weights > 0\n        texture[mask] /= texture_weights[mask][:, None]\n        texture = np.clip(texture.reshape(texture_size, texture_size, 3).cpu().numpy() * 255, 0, 255).astype(np.uint8)\n\n        # inpaint\n        mask = (texture_weights == 0).cpu().numpy().astype(np.uint8).reshape(texture_size, texture_size)\n        texture = cv2.inpaint(texture, mask, 3, cv2.INPAINT_TELEA)\n\n    elif mode == 'opt':\n        rastctx = utils3d.torch.RastContext(backend='cuda')\n        observations = [observations.flip(0) for observations in observations]\n        masks = [m.flip(0) for m in masks]\n        _uv = []\n        _uv_dr = []\n        for observation, view, projection in tqdm(zip(observations, views, projections), total=len(views), disable=not verbose, desc='Texture baking (opt): UV'):\n            with torch.no_grad():\n                rast = utils3d.torch.rasterize_triangle_faces(\n                    rastctx, vertices[None], faces, observation.shape[1], observation.shape[0], uv=uvs[None], view=view, projection=projection\n                )\n                _uv.append(rast['uv'].detach())\n                _uv_dr.append(rast['uv_dr'].detach())\n\n        texture = torch.nn.Parameter(torch.zeros((1, texture_size, texture_size, 3), dtype=torch.float32).cuda())\n        optimizer = torch.optim.Adam([texture], betas=(0.5, 0.9), lr=1e-2)\n\n        def exp_anealing(optimizer, step, total_steps, start_lr, end_lr):\n            return start_lr * (end_lr / start_lr) ** (step / total_steps)\n\n        def cosine_anealing(optimizer, step, total_steps, start_lr, end_lr):\n            return end_lr + 0.5 * (start_lr - end_lr) * (1 + np.cos(np.pi * step / total_steps))\n        \n        def tv_loss(texture):\n            return torch.nn.functional.l1_loss(texture[:, :-1, :, :], texture[:, 1:, :, :]) + \\\n                   torch.nn.functional.l1_loss(texture[:, :, :-1, :], texture[:, :, 1:, :])\n    \n        total_steps = 2500\n        with tqdm(total=total_steps, disable=not verbose, desc='Texture baking (opt): optimizing') as pbar:\n            for step in range(total_steps):\n                optimizer.zero_grad()\n                selected = np.random.randint(0, len(views))\n                uv, uv_dr, observation, mask = _uv[selected], _uv_dr[selected], observations[selected], masks[selected]\n                render = dr.texture(texture, uv, uv_dr)[0]\n                loss = torch.nn.functional.l1_loss(render[mask], observation[mask])\n                if lambda_tv > 0:\n                    loss += lambda_tv * tv_loss(texture)\n                loss.backward()\n                optimizer.step()\n                # annealing\n                optimizer.param_groups[0]['lr'] = cosine_anealing(optimizer, step, total_steps, 1e-2, 1e-5)\n                pbar.set_postfix({'loss': loss.item()})\n                pbar.update()\n        texture = np.clip(texture[0].flip(0).detach().cpu().numpy() * 255, 0, 255).astype(np.uint8)\n        mask = 1 - utils3d.torch.rasterize_triangle_faces(\n            rastctx, (uvs * 2 - 1)[None], faces, texture_size, texture_size\n        )['mask'][0].detach().cpu().numpy().astype(np.uint8)\n        texture = cv2.inpaint(texture, mask, 3, cv2.INPAINT_TELEA)\n    else:\n        raise ValueError(f'Unknown mode: {mode}')\n\n    return texture\n\n\ndef optimize_mesh(\n    mesh,\n    images: torch.Tensor,\n    masks: torch.Tensor,\n    extrinsics: torch.Tensor,\n    intrinsics: torch.Tensor,\n    simplify: float = 0.95,\n    texture_size: int = 1024,\n    verbose: bool = False,\n) -> trimesh.Trimesh:\n    \"\"\"\n    Convert a generated asset to a glb file.\n    Args:\n        mesh: Extracted mesh.\n        simplify (float): Ratio of faces to remove in simplification.\n        texture_size (int): Size of the texture.\n        verbose (bool): Whether to print progress.\n    \"\"\"\n    vertices = np.array(mesh.vertices).astype(float)\n    faces = np.array(mesh.faces).astype(int)\n\n    # mesh simplification\n    max_faces = 50000\n    mesh_reduction = max(1 - max_faces / faces.shape[0], simplify)\n    vertices, faces = fast_simplification.simplify(\n        vertices, faces, target_reduction=mesh_reduction)\n    \n    # parametrize mesh\n    vertices, faces, uvs = parametrize_mesh(vertices, faces)\n\n    # bake texture\n    images = [images[i].cpu().numpy() for i in range(len(images))]\n    masks = [masks[i].cpu().numpy() for i in range(len(masks))]\n    extrinsics = [extrinsics[i].cpu().numpy() for i in range(len(extrinsics))]\n    intrinsics = [intrinsics[i].cpu().numpy() for i in range(len(intrinsics))]\n    texture = bake_texture(\n        vertices.astype(float), faces.astype(float), uvs,\n        images, masks, extrinsics, intrinsics,\n        texture_size=texture_size, \n        mode='opt',\n        lambda_tv=0.01,\n        verbose=verbose\n    )\n    texture = Image.fromarray(texture)\n\n    # rotate mesh\n    vertices = vertices.astype(float) @ np.array([[-1, 0, 0], [0, 0, 1], [0, 1, 0]]).astype(float)\n    mesh = trimesh.Trimesh(vertices, faces, visual=trimesh.visual.TextureVisuals(uv=uvs, image=texture))\n    return mesh\n"
  },
  {
    "path": "freesplatter/utils/recon_util.py",
    "content": "import cv2\nimport math\nimport scipy\nimport numpy as np\nimport torch\nimport open3d as o3d\nfrom tqdm import tqdm\n\nfrom .camera_util import create_camera_to_world\n\n\n###############################################################################\n# Camera Trajectory\n###############################################################################\n\ndef fibonacci_sampling_on_sphere(num_samples=1):\n    points = []\n    phi = np.pi * (3.0 - np.sqrt(5.0))  # golden angle in radians\n    for i in range(num_samples):\n        y = 1 - (i / float(num_samples - 1)) * 2  # y goes from 1 to -1\n        radius = np.sqrt(1 - y * y)  # radius at y\n\n        theta = phi * i  # golden angle increment\n\n        x = np.cos(theta) * radius\n        z = np.sin(theta) * radius\n\n        points.append([x, y, z])\n    points = np.array(points)\n    return points\n\n\ndef get_fibonacci_cameras(N=20, radius=2.0, device='cuda'):\n    def normalize_vecs(vectors): \n        return vectors / (torch.norm(vectors, dim=-1, keepdim=True))\n\n    t = torch.linspace(0, 1, N).reshape(-1, 1)\n\n    cam_pos = fibonacci_sampling_on_sphere(N)\n    cam_pos = torch.from_numpy(cam_pos).float().to(device)\n    cam_pos = cam_pos * radius\n\n    forward_vector = normalize_vecs(-cam_pos)\n    up_vector = torch.tensor([0, 0, 1], dtype=torch.float,\n                                        device=device).reshape(-1).expand_as(forward_vector)\n    right_vector = normalize_vecs(torch.cross(forward_vector, up_vector, dim=-1))\n\n    up_vector = normalize_vecs(torch.cross(right_vector, forward_vector, dim=-1))\n    rotate = torch.stack(\n                    (right_vector, -up_vector, forward_vector), dim=-1)\n\n    rotation_matrix = torch.eye(4, device=device).unsqueeze(0).repeat(forward_vector.shape[0], 1, 1)\n    rotation_matrix[:, :3, :3] = rotate\n\n    translation_matrix = torch.eye(4, device=device).unsqueeze(0).repeat(forward_vector.shape[0], 1, 1)\n    translation_matrix[:, :3, 3] = cam_pos\n    cam2world = translation_matrix @ rotation_matrix\n    return cam2world\n\n\ndef get_circular_cameras(N=120, elevation=0, radius=2.0, normalize=True, device='cuda'):\n    camera_positions = []\n    for i in range(N):\n        azimuth = 2 * np.pi * i / N - np.pi / 2\n        x = radius * np.cos(elevation) * np.cos(azimuth)\n        y = radius * np.cos(elevation) * np.sin(azimuth)\n        z = radius * np.sin(elevation)\n        camera_positions.append([x, y, z])\n    camera_positions = np.array(camera_positions)\n    camera_positions = torch.from_numpy(camera_positions).float()\n    c2ws = create_camera_to_world(camera_positions, camera_system='opencv')\n\n    if normalize:\n        c2ws_first = create_camera_to_world(torch.tensor([0, -2, 0]), camera_system='opencv').unsqueeze(0)\n        c2ws = torch.linalg.inv(c2ws_first) @ c2ws\n\n    return c2ws\n\n###############################################################################\n# TSDF Fusion\n###############################################################################\n\ndef rgbd_to_mesh(images, depths, c2ws, fov, mesh_path, cam_elev_thr=0):\n\n    voxel_length = 2 * 2.0 / 512.0\n    sdf_trunc = 2 * 0.02\n    color_type = o3d.pipelines.integration.TSDFVolumeColorType.RGB8\n\n    volume = o3d.pipelines.integration.ScalableTSDFVolume(\n        voxel_length=voxel_length,\n        sdf_trunc=sdf_trunc,\n        color_type=color_type,\n    )\n\n    for i in tqdm(range(c2ws.shape[0])):\n        camera_to_world = c2ws[i]\n        world_to_camera = np.linalg.inv(camera_to_world)\n        camera_position = camera_to_world[:3, 3]\n        # camera_elevation = np.rad2deg(np.arcsin(camera_position[2]))\n        camera_elevation = np.rad2deg(np.arcsin(camera_position[2] / np.linalg.norm(camera_position)))\n        if camera_elevation < cam_elev_thr:\n            continue\n        color_image = o3d.geometry.Image(np.ascontiguousarray(images[i]))\n        depth_image = o3d.geometry.Image(np.ascontiguousarray(depths[i]))\n        rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(\n            color_image, depth_image, depth_scale=1.0, depth_trunc=4.0, convert_rgb_to_intensity=False\n        )\n        camera_intrinsics = o3d.camera.PinholeCameraIntrinsic()\n\n        fx = fy =  images[i].shape[1] / 2. / np.tan(np.deg2rad(fov / 2.0))\n        cx = cy = images[i].shape[1] / 2.\n        h =  images[i].shape[0]\n        w =  images[i].shape[1]\n        camera_intrinsics.set_intrinsics(\n            w, h, fx, fy, cx, cy\n        )\n        volume.integrate(\n            rgbd_image,\n            camera_intrinsics,\n            world_to_camera,\n        )\n\n    fused_mesh = volume.extract_triangle_mesh()\n\n    triangle_clusters, cluster_n_triangles, cluster_area = (\n            fused_mesh.cluster_connected_triangles())\n    triangle_clusters = np.asarray(triangle_clusters)\n    cluster_n_triangles = np.asarray(cluster_n_triangles)\n    cluster_area = np.asarray(cluster_area)\n\n    triangles_to_remove = cluster_n_triangles[triangle_clusters] < 500\n    fused_mesh.remove_triangles_by_mask(triangles_to_remove)\n    fused_mesh.remove_unreferenced_vertices()\n\n    fused_mesh = fused_mesh.filter_smooth_simple(number_of_iterations=2)\n    fused_mesh = fused_mesh.compute_vertex_normals()\n    o3d.io.write_triangle_mesh(mesh_path, fused_mesh)\n\n###############################################################################\n# Visualization\n###############################################################################\n\ndef viewmatrix(lookdir, up, position):\n    \"\"\"Construct lookat view matrix.\"\"\"\n    vec2 = normalize(lookdir)\n    vec0 = normalize(np.cross(up, vec2))\n    vec1 = normalize(np.cross(vec2, vec0))\n    m = np.stack([vec0, vec1, vec2, position], axis=1)\n    return m\n\n\ndef normalize(x):\n    \"\"\"Normalization helper function.\"\"\"\n    return x / np.linalg.norm(x)\n\n\ndef generate_interpolated_path(poses, n_interp, spline_degree=5,\n                               smoothness=.03, rot_weight=.1):\n    \"\"\"Creates a smooth spline path between input keyframe camera poses.\n\n  Spline is calculated with poses in format (position, lookat-point, up-point).\n\n  Args:\n    poses: (n, 3, 4) array of input pose keyframes.\n    n_interp: returned path will have n_interp * (n - 1) total poses.\n    spline_degree: polynomial degree of B-spline.\n    smoothness: parameter for spline smoothing, 0 forces exact interpolation.\n    rot_weight: relative weighting of rotation/translation in spline solve.\n\n  Returns:\n    Array of new camera poses with shape (n_interp * (n - 1), 3, 4).\n  \"\"\"\n\n    def poses_to_points(poses, dist):\n        \"\"\"Converts from pose matrices to (position, lookat, up) format.\"\"\"\n        pos = poses[:, :3, -1]\n        lookat = poses[:, :3, -1] - dist * poses[:, :3, 2]\n        up = poses[:, :3, -1] + dist * poses[:, :3, 1]\n        return np.stack([pos, lookat, up], 1)\n\n    def points_to_poses(points):\n        \"\"\"Converts from (position, lookat, up) format to pose matrices.\"\"\"\n        return np.array([viewmatrix(p - l, u - p, p) for p, l, u in points])\n\n    def interp(points, n, k, s):\n        \"\"\"Runs multidimensional B-spline interpolation on the input points.\"\"\"\n        sh = points.shape\n        pts = np.reshape(points, (sh[0], -1))\n        k = min(k, sh[0] - 1)\n        tck, _ = scipy.interpolate.splprep(pts.T, k=k, s=s)\n        u = np.linspace(0, 1, n, endpoint=False)\n        new_points = np.array(scipy.interpolate.splev(u, tck))\n        new_points = np.reshape(new_points.T, (n, sh[1], sh[2]))\n        return new_points\n    \n    points = poses_to_points(poses, dist=rot_weight)\n    new_points = interp(points,\n                        n_interp * (points.shape[0] - 1),\n                        k=spline_degree,\n                        s=smoothness)\n    return points_to_poses(new_points)\n\n###############################################################################\n# Camera Estimation\n###############################################################################\n\ndef xy_grid(W, H, device=None, origin=(0, 0), unsqueeze=None, cat_dim=-1, homogeneous=False, **arange_kw):\n    \"\"\" Output a (H,W,2) array of int32 \n        with output[j,i,0] = i + origin[0]\n             output[j,i,1] = j + origin[1]\n    \"\"\"\n    if device is None:\n        # numpy\n        arange, meshgrid, stack, ones = np.arange, np.meshgrid, np.stack, np.ones\n    else:\n        # torch\n        arange = lambda *a, **kw: torch.arange(*a, device=device, **kw)\n        meshgrid, stack = torch.meshgrid, torch.stack\n        ones = lambda *a: torch.ones(*a, device=device)\n\n    tw, th = [arange(o, o + s, **arange_kw) for s, o in zip((W, H), origin)]\n    grid = meshgrid(tw, th, indexing='xy')\n    if homogeneous:\n        grid = grid + (ones((H, W)),)\n    if unsqueeze is not None:\n        grid = (grid[0].unsqueeze(unsqueeze), grid[1].unsqueeze(unsqueeze))\n    if cat_dim is not None:\n        grid = stack(grid, cat_dim)\n    return grid\n\n\ndef estimate_focal(pts3d, pp=None, mask=None, min_focal=0., max_focal=np.inf):\n    \"\"\" \n    Reprojection method, for when the absolute depth is known:\n    1) estimate the camera focal using a robust estimator\n    2) reproject points onto true rays, minimizing a certain error\n    \"\"\"\n    H, W, THREE = pts3d.shape\n    assert THREE == 3\n\n    if pp is None:\n        pp = torch.tensor([W/2, H/2]).to(pts3d)\n\n    # centered pixel grid\n    pixels = xy_grid(W, H, device=pts3d.device).view(-1, 2) - pp.view(1, 2)  # (HW, 2)\n    pts3d = pts3d.view(H*W, 3).contiguous()  # (HW, 3)\n\n    # mask points if provided\n    if mask is not None:\n        mask = mask.to(pts3d.device).ravel().bool()\n        assert len(mask) == pts3d.shape[0]\n        pts3d = pts3d[mask]\n        pixels = pixels[mask]\n    \n    # weiszfeld\n    # init focal with l2 closed form\n    # we try to find focal = argmin Sum | pixel - focal * (x,y)/z|\n    xy_over_z = (pts3d[..., :2] / pts3d[..., 2:3]).nan_to_num(posinf=0, neginf=0)  # homogeneous (x,y,1)\n\n    dot_xy_px = (xy_over_z * pixels).sum(dim=-1)\n    dot_xy_xy = xy_over_z.square().sum(dim=-1)\n\n    focal = dot_xy_px.mean(dim=0) / dot_xy_xy.mean(dim=0)\n\n    # iterative re-weighted least-squares\n    for iter in range(10):\n        # re-weighting by inverse of distance\n        dis = (pixels - focal.view(-1, 1) * xy_over_z).norm(dim=-1)\n        # print(dis.nanmean(-1))\n        w = dis.clip(min=1e-8).reciprocal()\n        # update the scaling with the new weights\n        focal = (w * dot_xy_px).mean(dim=0) / (w * dot_xy_xy).mean(dim=0)\n\n    focal_base = max(H, W) / (2 * np.tan(np.deg2rad(60) / 2))  # size / 1.1547005383792515\n    focal = focal.clip(min=min_focal*focal_base, max=max_focal*focal_base)\n    return focal.ravel()\n\n\ndef fast_pnp(pts3d, mask, focal=None, pp=None, niter_PnP=10):\n    \"\"\"\n    Estimate camera poses and focals with RANSAC-PnP.\n\n    Inputs:\n        pts3d:  H x W x 3\n        focal:  1\n        mask:   H x W\n        pp\n    \"\"\"\n    H, W, _ = pts3d.shape\n    pixels = np.mgrid[:W, :H].T.astype(float)\n\n    if focal is None:\n        S = max(W, H)\n        tentative_focals = np.geomspace(S/2, S*3, 21)\n    else:\n        tentative_focals = [focal]\n\n    if pp is None:\n        pp = (W/2, H/2)\n\n    best = 0,\n    for focal in tentative_focals:\n        K = np.float32([(focal, 0, pp[0]), (0, focal, pp[1]), (0, 0, 1)])\n\n        success, R, T, inliers = cv2.solvePnPRansac(pts3d[mask], pixels[mask], K, None,\n                                                    iterationsCount=niter_PnP, reprojectionError=5, flags=cv2.SOLVEPNP_SQPNP)\n        if not success:\n            continue\n\n        score = len(inliers)\n        if success and score > best[0]:\n            best = score, R, T, focal\n\n    if not best[0]:\n        return None\n\n    _, R, T, best_focal = best\n    R = cv2.Rodrigues(R)[0]  # world to cam\n    world2cam = np.eye(4).astype(float)\n    world2cam[:3, :3] = R\n    world2cam[:3, 3] = T.reshape(3)\n    cam2world = np.linalg.inv(world2cam)\n\n    return best_focal, cam2world\n"
  },
  {
    "path": "freesplatter/webui/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/webui/camera_viewer/__init__.py",
    "content": ""
  },
  {
    "path": "freesplatter/webui/camera_viewer/utils.py",
    "content": "import os\nimport numpy as np\nfrom PIL import Image\n\n\ndef load_image(fpath, sz=256):\n    img = Image.open(fpath)\n    img = img.resize((sz, sz))\n    return np.asarray(img)[:, :, :3]\n\n\ndef spherical_to_cartesian(sph):\n\n    theta, azimuth, radius = sph\n\n    return np.array([\n        radius * np.sin(theta) * np.cos(azimuth),\n        radius * np.sin(theta) * np.sin(azimuth),\n        radius * np.cos(theta),\n    ])\n\n\ndef cartesian_to_spherical(xyz):\n\n    xy = xyz[0]**2 + xyz[1]**2\n    radius = np.sqrt(xy + xyz[2]**2)\n    theta = np.arctan2(np.sqrt(xy), xyz[2])\n    azimuth = np.arctan2(xyz[1], xyz[0])\n\n    return np.array([theta, azimuth, radius])\n\n\ndef elu_to_c2w(eye, lookat, up):\n\n    if isinstance(eye, list):\n        eye = np.array(eye)\n    if isinstance(lookat, list):\n        lookat = np.array(lookat)\n    if isinstance(up, list):\n        up = np.array(up)\n\n    l = eye - lookat\n    if np.linalg.norm(l) < 1e-8:\n        l[-1] = 1\n    l = l / np.linalg.norm(l)\n\n    s = np.cross(l, up)\n    if np.linalg.norm(s) < 1e-8:\n        s[0] = 1\n    s = s / np.linalg.norm(s)\n    uu = np.cross(s, l)\n\n    rot = np.eye(3)\n    rot[0, :] = -s\n    rot[1, :] = uu\n    rot[2, :] = l\n    \n    c2w = np.eye(4)\n    c2w[:3, :3] = rot.T\n    c2w[:3, 3] = eye\n\n    return c2w\n\n\ndef c2w_to_elu(c2w):\n\n    w2c = np.linalg.inv(c2w)\n    eye = c2w[:3, 3]\n    lookat_dir = -w2c[2, :3]\n    lookat = eye + lookat_dir\n    up = w2c[1, :3]\n\n    return eye, lookat, up\n\n\ndef qvec_to_rotmat(qvec):\n\treturn np.array([\n\t\t[\n\t\t\t1 - 2 * qvec[2]**2 - 2 * qvec[3]**2,\n\t\t\t2 * qvec[1] * qvec[2] - 2 * qvec[0] * qvec[3],\n\t\t\t2 * qvec[3] * qvec[1] + 2 * qvec[0] * qvec[2]\n\t\t], [\n\t\t\t2 * qvec[1] * qvec[2] + 2 * qvec[0] * qvec[3],\n\t\t\t1 - 2 * qvec[1]**2 - 2 * qvec[3]**2,\n\t\t\t2 * qvec[2] * qvec[3] - 2 * qvec[0] * qvec[1]\n\t\t], [\n\t\t\t2 * qvec[3] * qvec[1] - 2 * qvec[0] * qvec[2],\n\t\t\t2 * qvec[2] * qvec[3] + 2 * qvec[0] * qvec[1],\n\t\t\t1 - 2 * qvec[1]**2 - 2 * qvec[2]**2\n\t\t]\n\t])\n\n\ndef rotmat(a, b):\n\ta, b = a / np.linalg.norm(a), b / np.linalg.norm(b)\n\tv = np.cross(a, b)\n\tc = np.dot(a, b)\n\t# handle exception for the opposite direction input\n\tif c < -1 + 1e-10:\n\t\treturn rotmat(a + np.random.uniform(-1e-2, 1e-2, 3), b)\n\ts = np.linalg.norm(v)\n\tkmat = np.array([[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]])\n\treturn np.eye(3) + kmat + kmat.dot(kmat) * ((1 - c) / (s ** 2 + 1e-10))\n\n\ndef recenter_cameras(c2ws):\n\n    is_list = False\n    if isinstance(c2ws, list):\n        is_list = True\n        c2ws = np.stack(c2ws)\n  \n    center = c2ws[..., :3, -1].mean(axis=0)\n    c2ws[..., :3, -1] = c2ws[..., :3, -1] - center\n\n    if is_list:\n         c2ws = [ c2w for c2w in c2ws ]\n\n    return c2ws\n\n\ndef rescale_cameras(c2ws, scale):\n\n    is_list = False\n    if isinstance(c2ws, list):\n        is_list = True\n        c2ws = np.stack(c2ws)\n  \n    c2ws[..., :3, -1] *= scale\n\n    if is_list:\n         c2ws = [ c2w for c2w in c2ws ]\n\n    return c2ws\n"
  },
  {
    "path": "freesplatter/webui/camera_viewer/visualizer.py",
    "content": "import os\n\nfrom PIL import Image\nimport plotly.graph_objects as go\nimport numpy as np\n\n\ndef calc_cam_cone_pts_3d(c2w, fov_deg, zoom = 1.0):\n\n    fov_rad = np.deg2rad(fov_deg)\n\n    cam_x = c2w[0, -1]\n    cam_y = c2w[1, -1]\n    cam_z = c2w[2, -1]\n\n    corn1 = [np.tan(fov_rad / 2.0), np.tan(fov_rad / 2.0), -1.0]\n    corn2 = [-np.tan(fov_rad / 2.0), np.tan(fov_rad / 2.0), -1.0]\n    corn3 = [-np.tan(fov_rad / 2.0), -np.tan(fov_rad / 2.0), -1.0]\n    corn4 = [np.tan(fov_rad / 2.0), -np.tan(fov_rad / 2.0), -1.0]\n\n    corn1 = np.dot(c2w[:3, :3], corn1)\n    corn2 = np.dot(c2w[:3, :3], corn2)\n    corn3 = np.dot(c2w[:3, :3], corn3)\n    corn4 = np.dot(c2w[:3, :3], corn4)\n\n    # Now attach as offset to actual 3D camera position:\n    corn1 = np.array(corn1) / np.linalg.norm(corn1, ord=2) * zoom\n    corn_x1 = cam_x + corn1[0]\n    corn_y1 = cam_y + corn1[1]\n    corn_z1 = cam_z + corn1[2]\n    corn2 = np.array(corn2) / np.linalg.norm(corn2, ord=2) * zoom\n    corn_x2 = cam_x + corn2[0]\n    corn_y2 = cam_y + corn2[1]\n    corn_z2 = cam_z + corn2[2]\n    corn3 = np.array(corn3) / np.linalg.norm(corn3, ord=2) * zoom\n    corn_x3 = cam_x + corn3[0]\n    corn_y3 = cam_y + corn3[1] \n    corn_z3 = cam_z + corn3[2]\n    corn4 = np.array(corn4) / np.linalg.norm(corn4, ord=2) * zoom\n    corn_x4 = cam_x + corn4[0]\n    corn_y4 = cam_y + corn4[1]\n    corn_z4 = cam_z + corn4[2]\n\n\n    xs = [cam_x, corn_x1, corn_x2, corn_x3, corn_x4]\n    ys = [cam_y, corn_y1, corn_y2, corn_y3, corn_y4]\n    zs = [cam_z, corn_z1, corn_z2, corn_z3, corn_z4]\n\n    return np.array([xs, ys, zs]).T\n\n\nclass CameraVisualizer:\n\n    def __init__(self, poses, legends, colors, images=None, mesh_path=None, pc_path=None, camera_x=1.0):\n        self._fig = None\n\n        self._camera_x = camera_x\n        \n        self._poses = poses\n        self._legends = legends\n        self._colors = colors\n\n        self._raw_images = None\n        self._bit_images = None\n        self._image_colorscale = None\n        \n        if images is not None:\n            self._raw_images = images\n            self._bit_images = []\n            self._image_colorscale = []\n            for img in images:\n                if img is None:\n                    self._bit_images.append(None)\n                    self._image_colorscale.append(None)\n                    continue\n\n                bit_img, colorscale = self.encode_image(img)\n                self._bit_images.append(bit_img)\n                self._image_colorscale.append(colorscale)\n\n        self._mesh = None\n        if mesh_path is not None and os.path.exists(mesh_path):\n            import trimesh\n            self._mesh = trimesh.load(mesh_path, force='mesh')\n        self._pc = None\n        if pc_path is not None and os.path.exists(pc_path):\n            self._pc = np.load(pc_path)\n\n\n    def encode_image(self, raw_image):\n        '''\n        :param raw_image (H, W, 3) array of uint8 in [0, 255].\n        '''\n        # https://stackoverflow.com/questions/60685749/python-plotly-how-to-add-an-image-to-a-3d-scatter-plot\n\n        dum_img = Image.fromarray(np.ones((3, 3, 3), dtype='uint8')).convert('P', palette='WEB')\n        idx_to_color = np.array(dum_img.getpalette()).reshape((-1, 3))\n\n        bit_image = Image.fromarray(raw_image).convert('P', palette='WEB', dither=None)\n        # bit_image = Image.fromarray(raw_image.clip(0, 254)).convert(\n        #     'P', palette='WEB', dither=None)\n        colorscale = [\n            [i / 255.0, 'rgb({}, {}, {})'.format(*rgb)] for i, rgb in enumerate(idx_to_color)]\n        \n        return bit_image, colorscale\n\n\n    def update_figure(\n        self, \n        scene_bounds, \n        height=720,\n        line_width=10,\n        base_radius=0.0, \n        zoom_scale=1.0, \n        fov_deg=50., \n        mesh_z_shift=0.0, \n        mesh_scale=1.0, \n        show_background=False, \n        show_grid=False, \n        show_ticklabels=False, \n        y_up=False,\n    ):\n\n        fig = go.Figure()\n\n        for i in range(len(self._poses)):\n            pose = self._poses[i]\n            clr = np.array([self._colors[i], self._colors[i]])\n            legend = self._legends[i]\n\n            edges = [(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (2, 3), (3, 4), (4, 1)]\n\n            if isinstance(fov_deg, float) or len(fov_deg) == 1:\n                fov = fov_deg\n            else:\n                fov = fov_deg[i]\n            cone = calc_cam_cone_pts_3d(pose, fov)\n            radius = np.linalg.norm(pose[:3, -1])\n\n            if self._bit_images and self._bit_images[i]:\n\n                raw_image = self._raw_images[i]\n                bit_image = self._bit_images[i]\n                colorscale = self._image_colorscale[i]\n\n                (H, W, C) = raw_image.shape\n\n                z = np.zeros((H, W)) + base_radius\n                scale = np.linalg.norm(cone[1] - cone[2]) / 2\n                (x, y) = np.meshgrid(np.linspace(-scale, scale, W), np.linspace(scale, -scale, H) * H / W)\n                \n                xyz = np.concatenate([x[..., None], y[..., None], z[..., None]], axis=-1)\n\n                rot_xyz = np.matmul(xyz, pose[:3, :3].T) + pose[:3, -1]\n\n                offset = cone[2] - rot_xyz[0, 0, :]\n                rot_xyz += offset.reshape((1, 1, 3))\n                \n                x, y, z = rot_xyz[:, :, 0], rot_xyz[:, :, 1], rot_xyz[:, :, 2]\n                \n                fig.add_trace(go.Surface(\n                    x=x, y=y, z=z,\n                    surfacecolor=bit_image,\n                    cmin=0,\n                    cmax=255,\n                    colorscale=colorscale,\n                    showscale=False,\n                    lighting_diffuse=1.0,\n                    lighting_ambient=1.0,\n                    lighting_fresnel=1.0,\n                    lighting_roughness=1.0,\n                    # lighting_specular=0.3))\n                    lighting_specular=0,\n                    showlegend=False))\n            \n            for (j, edge) in enumerate(edges):\n                (x1, x2) = (cone[edge[0], 0], cone[edge[1], 0])\n                (y1, y2) = (cone[edge[0], 1], cone[edge[1], 1])\n                (z1, z2) = (cone[edge[0], 2], cone[edge[1], 2])\n                fig.add_trace(go.Scatter3d(\n                    x=[x1, x2], \n                    y=[y1, y2], \n                    z=[z1, z2], \n                    mode='lines',\n                    line=dict(color=clr, width=line_width), \n                    showlegend=False))\n            \n            # Add label.\n            if cone[0, 2] < 0:\n                fig.add_trace(go.Scatter3d(\n                    x=[cone[0, 0]], y=[cone[0, 1]], z=[cone[0, 2] - 0.05], showlegend=False,\n                    mode='text', text=legend, textposition='bottom center'))\n            else:\n                fig.add_trace(go.Scatter3d(\n                    x=[cone[0, 0]], y=[cone[0, 1]], z=[cone[0, 2] + 0.05], showlegend=False,\n                    mode='text', text=legend, textposition='top center'))\n\n        # look at the center of scene\n        fig.update_layout(\n            height=height,\n            autosize=True,\n            hovermode=False,\n            margin=go.layout.Margin(l=0, r=0, b=0, t=0),\n            showlegend=True,\n            legend=dict(\n                yanchor='bottom',\n                y=0.01,\n                xanchor='right',\n                x=0.99,\n            ),\n            scene=dict(\n                aspectmode='manual',\n                aspectratio=dict(x=1, y=1, z=1),\n                camera=dict(\n                    eye=dict(x=1.5, y=1.5, z=1.0),\n                    center=dict(x=0.0, y=0.0, z=0.0),\n                    up=dict(x=0.0, y=0.0, z=1.0)),\n                xaxis_title='X',\n                yaxis_title='Z' if y_up else 'Y',\n                zaxis_title='Y' if y_up else 'Z',\n                xaxis=dict(\n                    range=[-scene_bounds, scene_bounds],\n                    showticklabels=show_ticklabels,\n                    showgrid=show_grid,\n                    zeroline=False,\n                    showbackground=show_background,\n                    showspikes=False,\n                    showline=False,\n                    ticks=''),\n                yaxis=dict(\n                    range=[-scene_bounds, scene_bounds],\n                    showticklabels=show_ticklabels,\n                    showgrid=show_grid,\n                    zeroline=False,\n                    showbackground=show_background,\n                    showspikes=False,\n                    showline=False,\n                    ticks=''),\n                zaxis=dict(\n                    range=[-scene_bounds, scene_bounds],\n                    showticklabels=show_ticklabels,\n                    showgrid=show_grid,\n                    zeroline=False,\n                    showbackground=show_background,\n                    showspikes=False,\n                    showline=False,\n                    ticks='')\n            )\n        )\n\n        self._fig = fig\n        return fig\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/__init__.py",
    "content": "from .customgs import CustomGS\n\n__all__ = ['CustomGS']\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/customgs.py",
    "content": "\"\"\"gr.Model3D() component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom pathlib import Path\nfrom typing import Callable\n\nfrom gradio_client.documentation import document\n\nfrom gradio.components.base import Component\nfrom gradio.data_classes import FileData\nfrom gradio.events import Events\n\n\nclass CustomGS(Component):\n    \"\"\"\n    Creates a component allows users to upload or view 3D Model files (.obj, .glb, .stl, .gltf, .splat, or .ply).\n\n    Demos: model3D\n    Guides: how-to-use-3D-model-component\n    \"\"\"\n\n    EVENTS = [Events.change, Events.upload, Events.edit, Events.clear]\n\n    data_model = FileData\n\n    def __init__(\n        self,\n        value: str | Callable | None = None,\n        *,\n        clear_color: tuple[float, float, float, float] | None = None,\n        camera_position: tuple[\n            int | float | None, int | float | None, int | float | None\n        ] = (\n            None,\n            None,\n            None,\n        ),\n        zoom_speed: float = 1,\n        pan_speed: float = 1,\n        height: int | str | None = None,\n        label: str | None = None,\n        show_label: bool | None = None,\n        every: float | None = None,\n        container: bool = True,\n        scale: int | None = None,\n        min_width: int = 160,\n        interactive: bool | None = None,\n        visible: bool = True,\n        elem_id: str | None = None,\n        elem_classes: list[str] | str | None = None,\n        render: bool = True,\n    ):\n        \"\"\"\n        Parameters:\n            value: path to (.obj, .glb, .stl, .gltf, .splat, or .ply) file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.\n            clear_color: background color of scene, should be a tuple of 4 floats between 0 and 1 representing RGBA values.\n            camera_position: initial camera position of scene, provided as a tuple of `(alpha, beta, radius)`. Each value is optional. If provided, `alpha` and `beta` should be in degrees reflecting the angular position along the longitudinal and latitudinal axes, respectively. Radius corresponds to the distance from the center of the object to the camera.\n            zoom_speed: the speed of zooming in and out of the scene when the cursor wheel is rotated or when screen is pinched on a mobile device. Should be a positive float, increase this value to make zooming faster, decrease to make it slower. Affects the wheelPrecision property of the camera.\n            pan_speed: the speed of panning the scene when the cursor is dragged or when the screen is dragged on a mobile device. Should be a positive float, increase this value to make panning faster, decrease to make it slower. Affects the panSensibility property of the camera.\n            height: The height of the model3D component, specified in pixels if a number is passed, or in CSS units if a string is passed.\n            interactive: if True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output.\n            label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.\n            show_label: if True, will display label.\n            every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n            container: If True, will place the component in a container - providing some extra padding around the border.\n            scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.\n            min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.\n            visible: If False, component will be hidden.\n            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n            elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.\n            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.\n        \"\"\"\n        self.clear_color = clear_color or [0, 0, 0, 0]\n        self.camera_position = camera_position\n        self.height = height\n        self.zoom_speed = zoom_speed\n        self.pan_speed = pan_speed\n        super().__init__(\n            label=label,\n            every=every,\n            show_label=show_label,\n            container=container,\n            scale=scale,\n            min_width=min_width,\n            interactive=interactive,\n            visible=visible,\n            elem_id=elem_id,\n            elem_classes=elem_classes,\n            render=render,\n            value=value,\n        )\n\n    def preprocess(self, payload: FileData | None) -> str | None:\n        \"\"\"\n        Parameters:\n            payload: the uploaded file as an instance of `FileData`.\n        Returns:\n            Passes the uploaded file as a {str} filepath to the function.\n        \"\"\"\n        if payload is None:\n            return payload\n        return payload.path\n\n    def postprocess(self, value: str | Path | None) -> FileData | None:\n        \"\"\"\n        Parameters:\n            value: Expects function to return a {str} or {pathlib.Path} filepath of type (.obj, .glb, .stl, or .gltf)\n        Returns:\n            The uploaded file as an instance of `FileData`.\n        \"\"\"\n        if value is None:\n            return value\n        return FileData(path=str(value), orig_name=Path(value).name)\n\n    def process_example(self, input_data: str | Path | None) -> str:\n        return Path(input_data).name if input_data else \"\"\n\n    def example_inputs(self):\n        # TODO: Use permanent link\n        return \"https://raw.githubusercontent.com/gradio-app/gradio/main/demo/model3D/files/Fox.gltf\"\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/customgs.pyi",
    "content": "\"\"\"gr.Model3D() component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom pathlib import Path\nfrom typing import Callable\n\nfrom gradio_client.documentation import document\n\nfrom gradio.components.base import Component\nfrom gradio.data_classes import FileData\nfrom gradio.events import Events\n\nfrom gradio.events import Dependency\n\nclass CustomGS(Component):\n    \"\"\"\n    Creates a component allows users to upload or view 3D Model files (.obj, .glb, .stl, .gltf, .splat, or .ply).\n\n    Demos: model3D\n    Guides: how-to-use-3D-model-component\n    \"\"\"\n\n    EVENTS = [Events.change, Events.upload, Events.edit, Events.clear]\n\n    data_model = FileData\n\n    def __init__(\n        self,\n        value: str | Callable | None = None,\n        *,\n        clear_color: tuple[float, float, float, float] | None = None,\n        camera_position: tuple[\n            int | float | None, int | float | None, int | float | None\n        ] = (\n            None,\n            None,\n            None,\n        ),\n        zoom_speed: float = 1,\n        pan_speed: float = 1,\n        height: int | str | None = None,\n        label: str | None = None,\n        show_label: bool | None = None,\n        every: float | None = None,\n        container: bool = True,\n        scale: int | None = None,\n        min_width: int = 160,\n        interactive: bool | None = None,\n        visible: bool = True,\n        elem_id: str | None = None,\n        elem_classes: list[str] | str | None = None,\n        render: bool = True,\n    ):\n        \"\"\"\n        Parameters:\n            value: path to (.obj, .glb, .stl, .gltf, .splat, or .ply) file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.\n            clear_color: background color of scene, should be a tuple of 4 floats between 0 and 1 representing RGBA values.\n            camera_position: initial camera position of scene, provided as a tuple of `(alpha, beta, radius)`. Each value is optional. If provided, `alpha` and `beta` should be in degrees reflecting the angular position along the longitudinal and latitudinal axes, respectively. Radius corresponds to the distance from the center of the object to the camera.\n            zoom_speed: the speed of zooming in and out of the scene when the cursor wheel is rotated or when screen is pinched on a mobile device. Should be a positive float, increase this value to make zooming faster, decrease to make it slower. Affects the wheelPrecision property of the camera.\n            pan_speed: the speed of panning the scene when the cursor is dragged or when the screen is dragged on a mobile device. Should be a positive float, increase this value to make panning faster, decrease to make it slower. Affects the panSensibility property of the camera.\n            height: The height of the model3D component, specified in pixels if a number is passed, or in CSS units if a string is passed.\n            interactive: if True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output.\n            label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.\n            show_label: if True, will display label.\n            every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n            container: If True, will place the component in a container - providing some extra padding around the border.\n            scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.\n            min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.\n            visible: If False, component will be hidden.\n            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n            elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.\n            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.\n        \"\"\"\n        self.clear_color = clear_color or [0, 0, 0, 0]\n        self.camera_position = camera_position\n        self.height = height\n        self.zoom_speed = zoom_speed\n        self.pan_speed = pan_speed\n        super().__init__(\n            label=label,\n            every=every,\n            show_label=show_label,\n            container=container,\n            scale=scale,\n            min_width=min_width,\n            interactive=interactive,\n            visible=visible,\n            elem_id=elem_id,\n            elem_classes=elem_classes,\n            render=render,\n            value=value,\n        )\n\n    def preprocess(self, payload: FileData | None) -> str | None:\n        \"\"\"\n        Parameters:\n            payload: the uploaded file as an instance of `FileData`.\n        Returns:\n            Passes the uploaded file as a {str} filepath to the function.\n        \"\"\"\n        if payload is None:\n            return payload\n        return payload.path\n\n    def postprocess(self, value: str | Path | None) -> FileData | None:\n        \"\"\"\n        Parameters:\n            value: Expects function to return a {str} or {pathlib.Path} filepath of type (.obj, .glb, .stl, or .gltf)\n        Returns:\n            The uploaded file as an instance of `FileData`.\n        \"\"\"\n        if value is None:\n            return value\n        return FileData(path=str(value), orig_name=Path(value).name)\n\n    def process_example(self, input_data: str | Path | None) -> str:\n        return Path(input_data).name if input_data else \"\"\n\n    def example_inputs(self):\n        # TODO: Use permanent link\n        return \"https://raw.githubusercontent.com/gradio-app/gradio/main/demo/model3D/files/Fox.gltf\"\n    from typing import Callable, Literal, Sequence, Any, TYPE_CHECKING\n    from gradio.blocks import Block\n    if TYPE_CHECKING:\n        from gradio.components import Timer\n\n    \n    def change(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ...\n    \n    def upload(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ...\n    \n    def edit(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ...\n    \n    def clear(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ..."
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/Canvas3D-60a8d213.js",
    "content": "import { c as Gr, g as av, r as sv } from \"./Index-f5583db3.js\";\nfunction cv(an, ln) {\n  for (var Be = 0; Be < ln.length; Be++) {\n    const A = ln[Be];\n    if (typeof A != \"string\" && !Array.isArray(A)) {\n      for (const f in A)\n        if (f !== \"default\" && !(f in an)) {\n          const V = Object.getOwnPropertyDescriptor(A, f);\n          V && Object.defineProperty(an, f, V.get ? V : {\n            enumerable: !0,\n            get: () => A[f]\n          });\n        }\n    }\n  }\n  return Object.freeze(Object.defineProperty(an, Symbol.toStringTag, { value: \"Module\" }));\n}\nvar Yc = { exports: {} }, of;\nfunction sf() {\n  return of || (of = 1, function(an, ln) {\n    (function(Be, A) {\n      an.exports = A();\n    })(typeof self < \"u\" ? self : typeof Gr < \"u\" ? Gr : Gr, function() {\n      return function(Be) {\n        var A = {};\n        function f(V) {\n          if (A[V])\n            return A[V].exports;\n          var _ = A[V] = { i: V, l: !1, exports: {} };\n          return Be[V].call(_.exports, _, _.exports, f), _.l = !0, _.exports;\n        }\n        return f.m = Be, f.c = A, f.d = function(V, _, C) {\n          f.o(V, _) || Object.defineProperty(V, _, { enumerable: !0, get: C });\n        }, f.r = function(V) {\n          typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(V, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(V, \"__esModule\", { value: !0 });\n        }, f.t = function(V, _) {\n          if (1 & _ && (V = f(V)), 8 & _ || 4 & _ && typeof V == \"object\" && V && V.__esModule)\n            return V;\n          var C = /* @__PURE__ */ Object.create(null);\n          if (f.r(C), Object.defineProperty(C, \"default\", { enumerable: !0, value: V }), 2 & _ && typeof V != \"string\")\n            for (var u in V)\n              f.d(C, u, (function(I) {\n                return V[I];\n              }).bind(null, u));\n          return C;\n        }, f.n = function(V) {\n          var _ = V && V.__esModule ? function() {\n            return V.default;\n          } : function() {\n            return V;\n          };\n          return f.d(_, \"a\", _), _;\n        }, f.o = function(V, _) {\n          return Object.prototype.hasOwnProperty.call(V, _);\n        }, f.p = \"\", f(f.s = 169);\n      }([function(Be, A, f) {\n        f.d(A, \"d\", function() {\n          return O;\n        }), f.d(A, \"e\", function() {\n          return x;\n        }), f.d(A, \"f\", function() {\n          return m;\n        }), f.d(A, \"b\", function() {\n          return c;\n        }), f.d(A, \"a\", function() {\n          return T;\n        }), f.d(A, \"c\", function() {\n          return E;\n        });\n        var V = f(14), _ = f(28), C = f(44), u = f(11), I = f(74), O = function() {\n          function g(l, h) {\n            l === void 0 && (l = 0), h === void 0 && (h = 0), this.x = l, this.y = h;\n          }\n          return g.prototype.toString = function() {\n            return \"{X: \" + this.x + \" Y: \" + this.y + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Vector2\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this.x;\n            return l = 397 * l ^ (0 | this.y);\n          }, g.prototype.toArray = function(l, h) {\n            return h === void 0 && (h = 0), l[h] = this.x, l[h + 1] = this.y, this;\n          }, g.prototype.fromArray = function(l, h) {\n            return h === void 0 && (h = 0), g.FromArrayToRef(l, h, this), this;\n          }, g.prototype.asArray = function() {\n            var l = new Array();\n            return this.toArray(l, 0), l;\n          }, g.prototype.copyFrom = function(l) {\n            return this.x = l.x, this.y = l.y, this;\n          }, g.prototype.copyFromFloats = function(l, h) {\n            return this.x = l, this.y = h, this;\n          }, g.prototype.set = function(l, h) {\n            return this.copyFromFloats(l, h);\n          }, g.prototype.add = function(l) {\n            return new g(this.x + l.x, this.y + l.y);\n          }, g.prototype.addToRef = function(l, h) {\n            return h.x = this.x + l.x, h.y = this.y + l.y, this;\n          }, g.prototype.addInPlace = function(l) {\n            return this.x += l.x, this.y += l.y, this;\n          }, g.prototype.addVector3 = function(l) {\n            return new g(this.x + l.x, this.y + l.y);\n          }, g.prototype.subtract = function(l) {\n            return new g(this.x - l.x, this.y - l.y);\n          }, g.prototype.subtractToRef = function(l, h) {\n            return h.x = this.x - l.x, h.y = this.y - l.y, this;\n          }, g.prototype.subtractInPlace = function(l) {\n            return this.x -= l.x, this.y -= l.y, this;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.x *= l.x, this.y *= l.y, this;\n          }, g.prototype.multiply = function(l) {\n            return new g(this.x * l.x, this.y * l.y);\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return h.x = this.x * l.x, h.y = this.y * l.y, this;\n          }, g.prototype.multiplyByFloats = function(l, h) {\n            return new g(this.x * l, this.y * h);\n          }, g.prototype.divide = function(l) {\n            return new g(this.x / l.x, this.y / l.y);\n          }, g.prototype.divideToRef = function(l, h) {\n            return h.x = this.x / l.x, h.y = this.y / l.y, this;\n          }, g.prototype.divideInPlace = function(l) {\n            return this.divideToRef(l, this);\n          }, g.prototype.negate = function() {\n            return new g(-this.x, -this.y);\n          }, g.prototype.negateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this;\n          }, g.prototype.negateToRef = function(l) {\n            return l.copyFromFloats(-1 * this.x, -1 * this.y);\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this;\n          }, g.prototype.scale = function(l) {\n            var h = new g(0, 0);\n            return this.scaleToRef(l, h), h;\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.x = this.x * l, h.y = this.y * l, this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.x += this.x * l, h.y += this.y * l, this;\n          }, g.prototype.equals = function(l) {\n            return l && this.x === l.x && this.y === l.y;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this.x, l.x, h) && V.a.WithinEpsilon(this.y, l.y, h);\n          }, g.prototype.floor = function() {\n            return new g(Math.floor(this.x), Math.floor(this.y));\n          }, g.prototype.fract = function() {\n            return new g(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\n          }, g.prototype.length = function() {\n            return Math.sqrt(this.x * this.x + this.y * this.y);\n          }, g.prototype.lengthSquared = function() {\n            return this.x * this.x + this.y * this.y;\n          }, g.prototype.normalize = function() {\n            var l = this.length();\n            return l === 0 || (this.x /= l, this.y /= l), this;\n          }, g.prototype.clone = function() {\n            return new g(this.x, this.y);\n          }, g.Zero = function() {\n            return new g(0, 0);\n          }, g.One = function() {\n            return new g(1, 1);\n          }, g.FromArray = function(l, h) {\n            return h === void 0 && (h = 0), new g(l[h], l[h + 1]);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1];\n          }, g.CatmullRom = function(l, h, v, b, D) {\n            var w = D * D, N = D * w;\n            return new g(0.5 * (2 * h.x + (-l.x + v.x) * D + (2 * l.x - 5 * h.x + 4 * v.x - b.x) * w + (-l.x + 3 * h.x - 3 * v.x + b.x) * N), 0.5 * (2 * h.y + (-l.y + v.y) * D + (2 * l.y - 5 * h.y + 4 * v.y - b.y) * w + (-l.y + 3 * h.y - 3 * v.y + b.y) * N));\n          }, g.Clamp = function(l, h, v) {\n            var b = l.x;\n            b = (b = b > v.x ? v.x : b) < h.x ? h.x : b;\n            var D = l.y;\n            return new g(b, D = (D = D > v.y ? v.y : D) < h.y ? h.y : D);\n          }, g.Hermite = function(l, h, v, b, D) {\n            var w = D * D, N = D * w, M = 2 * N - 3 * w + 1, U = -2 * N + 3 * w, X = N - 2 * w + D, j = N - w;\n            return new g(l.x * M + v.x * U + h.x * X + b.x * j, l.y * M + v.y * U + h.y * X + b.y * j);\n          }, g.Lerp = function(l, h, v) {\n            return new g(l.x + (h.x - l.x) * v, l.y + (h.y - l.y) * v);\n          }, g.Dot = function(l, h) {\n            return l.x * h.x + l.y * h.y;\n          }, g.Normalize = function(l) {\n            var h = l.clone();\n            return h.normalize(), h;\n          }, g.Minimize = function(l, h) {\n            return new g(l.x < h.x ? l.x : h.x, l.y < h.y ? l.y : h.y);\n          }, g.Maximize = function(l, h) {\n            return new g(l.x > h.x ? l.x : h.x, l.y > h.y ? l.y : h.y);\n          }, g.Transform = function(l, h) {\n            var v = g.Zero();\n            return g.TransformToRef(l, h, v), v;\n          }, g.TransformToRef = function(l, h, v) {\n            var b = h.m, D = l.x * b[0] + l.y * b[4] + b[12], w = l.x * b[1] + l.y * b[5] + b[13];\n            v.x = D, v.y = w;\n          }, g.PointInTriangle = function(l, h, v, b) {\n            var D = 0.5 * (-v.y * b.x + h.y * (-v.x + b.x) + h.x * (v.y - b.y) + v.x * b.y), w = D < 0 ? -1 : 1, N = (h.y * b.x - h.x * b.y + (b.y - h.y) * l.x + (h.x - b.x) * l.y) * w, M = (h.x * v.y - h.y * v.x + (h.y - v.y) * l.x + (v.x - h.x) * l.y) * w;\n            return N > 0 && M > 0 && N + M < 2 * D * w;\n          }, g.Distance = function(l, h) {\n            return Math.sqrt(g.DistanceSquared(l, h));\n          }, g.DistanceSquared = function(l, h) {\n            var v = l.x - h.x, b = l.y - h.y;\n            return v * v + b * b;\n          }, g.Center = function(l, h) {\n            var v = l.add(h);\n            return v.scaleInPlace(0.5), v;\n          }, g.DistanceOfPointFromSegment = function(l, h, v) {\n            var b = g.DistanceSquared(h, v);\n            if (b === 0)\n              return g.Distance(l, h);\n            var D = v.subtract(h), w = Math.max(0, Math.min(1, g.Dot(l.subtract(h), D) / b)), N = h.add(D.multiplyByFloats(w, w));\n            return g.Distance(l, N);\n          }, g;\n        }(), x = function() {\n          function g(l, h, v) {\n            l === void 0 && (l = 0), h === void 0 && (h = 0), v === void 0 && (v = 0), this._isDirty = !0, this._x = l, this._y = h, this._z = v;\n          }\n          return Object.defineProperty(g.prototype, \"x\", { get: function() {\n            return this._x;\n          }, set: function(l) {\n            this._x = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"y\", { get: function() {\n            return this._y;\n          }, set: function(l) {\n            this._y = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"z\", { get: function() {\n            return this._z;\n          }, set: function(l) {\n            this._z = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype.toString = function() {\n            return \"{X: \" + this._x + \" Y:\" + this._y + \" Z:\" + this._z + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Vector3\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this._x;\n            return l = 397 * (l = 397 * l ^ (0 | this._y)) ^ (0 | this._z);\n          }, g.prototype.asArray = function() {\n            var l = [];\n            return this.toArray(l, 0), l;\n          }, g.prototype.toArray = function(l, h) {\n            return h === void 0 && (h = 0), l[h] = this._x, l[h + 1] = this._y, l[h + 2] = this._z, this;\n          }, g.prototype.fromArray = function(l, h) {\n            return h === void 0 && (h = 0), g.FromArrayToRef(l, h, this), this;\n          }, g.prototype.toQuaternion = function() {\n            return c.RotationYawPitchRoll(this._y, this._x, this._z);\n          }, g.prototype.addInPlace = function(l) {\n            return this.addInPlaceFromFloats(l._x, l._y, l._z);\n          }, g.prototype.addInPlaceFromFloats = function(l, h, v) {\n            return this.x += l, this.y += h, this.z += v, this;\n          }, g.prototype.add = function(l) {\n            return new g(this._x + l._x, this._y + l._y, this._z + l._z);\n          }, g.prototype.addToRef = function(l, h) {\n            return h.copyFromFloats(this._x + l._x, this._y + l._y, this._z + l._z);\n          }, g.prototype.subtractInPlace = function(l) {\n            return this.x -= l._x, this.y -= l._y, this.z -= l._z, this;\n          }, g.prototype.subtract = function(l) {\n            return new g(this._x - l._x, this._y - l._y, this._z - l._z);\n          }, g.prototype.subtractToRef = function(l, h) {\n            return this.subtractFromFloatsToRef(l._x, l._y, l._z, h);\n          }, g.prototype.subtractFromFloats = function(l, h, v) {\n            return new g(this._x - l, this._y - h, this._z - v);\n          }, g.prototype.subtractFromFloatsToRef = function(l, h, v, b) {\n            return b.copyFromFloats(this._x - l, this._y - h, this._z - v);\n          }, g.prototype.negate = function() {\n            return new g(-this._x, -this._y, -this._z);\n          }, g.prototype.negateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this.z *= -1, this;\n          }, g.prototype.negateToRef = function(l) {\n            return l.copyFromFloats(-1 * this._x, -1 * this._y, -1 * this._z);\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this.z *= l, this;\n          }, g.prototype.scale = function(l) {\n            return new g(this._x * l, this._y * l, this._z * l);\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.copyFromFloats(this._x * l, this._y * l, this._z * l);\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.addInPlaceFromFloats(this._x * l, this._y * l, this._z * l);\n          }, g.prototype.projectOnPlane = function(l, h) {\n            var v = g.Zero();\n            return this.projectOnPlaneToRef(l, h, v), v;\n          }, g.prototype.projectOnPlaneToRef = function(l, h, v) {\n            var b = l.normal, D = l.d, w = S.Vector3[0];\n            this.subtractToRef(h, w), w.normalize();\n            var N = g.Dot(w, b), M = -(g.Dot(h, b) + D) / N, U = w.scaleInPlace(M);\n            h.addToRef(U, v);\n          }, g.prototype.equals = function(l) {\n            return l && this._x === l._x && this._y === l._y && this._z === l._z;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this._x, l._x, h) && V.a.WithinEpsilon(this._y, l._y, h) && V.a.WithinEpsilon(this._z, l._z, h);\n          }, g.prototype.equalsToFloats = function(l, h, v) {\n            return this._x === l && this._y === h && this._z === v;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.x *= l._x, this.y *= l._y, this.z *= l._z, this;\n          }, g.prototype.multiply = function(l) {\n            return this.multiplyByFloats(l._x, l._y, l._z);\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return h.copyFromFloats(this._x * l._x, this._y * l._y, this._z * l._z);\n          }, g.prototype.multiplyByFloats = function(l, h, v) {\n            return new g(this._x * l, this._y * h, this._z * v);\n          }, g.prototype.divide = function(l) {\n            return new g(this._x / l._x, this._y / l._y, this._z / l._z);\n          }, g.prototype.divideToRef = function(l, h) {\n            return h.copyFromFloats(this._x / l._x, this._y / l._y, this._z / l._z);\n          }, g.prototype.divideInPlace = function(l) {\n            return this.divideToRef(l, this);\n          }, g.prototype.minimizeInPlace = function(l) {\n            return this.minimizeInPlaceFromFloats(l._x, l._y, l._z);\n          }, g.prototype.maximizeInPlace = function(l) {\n            return this.maximizeInPlaceFromFloats(l._x, l._y, l._z);\n          }, g.prototype.minimizeInPlaceFromFloats = function(l, h, v) {\n            return l < this._x && (this.x = l), h < this._y && (this.y = h), v < this._z && (this.z = v), this;\n          }, g.prototype.maximizeInPlaceFromFloats = function(l, h, v) {\n            return l > this._x && (this.x = l), h > this._y && (this.y = h), v > this._z && (this.z = v), this;\n          }, g.prototype.isNonUniformWithinEpsilon = function(l) {\n            var h = Math.abs(this._x), v = Math.abs(this._y);\n            if (!V.a.WithinEpsilon(h, v, l))\n              return !0;\n            var b = Math.abs(this._z);\n            return !V.a.WithinEpsilon(h, b, l) || !V.a.WithinEpsilon(v, b, l);\n          }, Object.defineProperty(g.prototype, \"isNonUniform\", { get: function() {\n            var l = Math.abs(this._x);\n            return l !== Math.abs(this._y) || l !== Math.abs(this._z);\n          }, enumerable: !1, configurable: !0 }), g.prototype.floor = function() {\n            return new g(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\n          }, g.prototype.fract = function() {\n            return new g(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));\n          }, g.prototype.length = function() {\n            return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);\n          }, g.prototype.lengthSquared = function() {\n            return this._x * this._x + this._y * this._y + this._z * this._z;\n          }, g.prototype.normalize = function() {\n            return this.normalizeFromLength(this.length());\n          }, g.prototype.reorderInPlace = function(l) {\n            var h = this;\n            return (l = l.toLowerCase()) === \"xyz\" || (S.Vector3[0].copyFrom(this), [\"x\", \"y\", \"z\"].forEach(function(v, b) {\n              h[v] = S.Vector3[0][l[b]];\n            })), this;\n          }, g.prototype.rotateByQuaternionToRef = function(l, h) {\n            return l.toRotationMatrix(S.Matrix[0]), g.TransformCoordinatesToRef(this, S.Matrix[0], h), h;\n          }, g.prototype.rotateByQuaternionAroundPointToRef = function(l, h, v) {\n            return this.subtractToRef(h, S.Vector3[0]), S.Vector3[0].rotateByQuaternionToRef(l, S.Vector3[0]), h.addToRef(S.Vector3[0], v), v;\n          }, g.prototype.cross = function(l) {\n            return g.Cross(this, l);\n          }, g.prototype.normalizeFromLength = function(l) {\n            return l === 0 || l === 1 ? this : this.scaleInPlace(1 / l);\n          }, g.prototype.normalizeToNew = function() {\n            var l = new g(0, 0, 0);\n            return this.normalizeToRef(l), l;\n          }, g.prototype.normalizeToRef = function(l) {\n            var h = this.length();\n            return h === 0 || h === 1 ? l.copyFromFloats(this._x, this._y, this._z) : this.scaleToRef(1 / h, l);\n          }, g.prototype.clone = function() {\n            return new g(this._x, this._y, this._z);\n          }, g.prototype.copyFrom = function(l) {\n            return this.copyFromFloats(l._x, l._y, l._z);\n          }, g.prototype.copyFromFloats = function(l, h, v) {\n            return this.x = l, this.y = h, this.z = v, this;\n          }, g.prototype.set = function(l, h, v) {\n            return this.copyFromFloats(l, h, v);\n          }, g.prototype.setAll = function(l) {\n            return this.x = this.y = this.z = l, this;\n          }, g.GetClipFactor = function(l, h, v, b) {\n            var D = g.Dot(l, v) - b;\n            return D / (D - (g.Dot(h, v) - b));\n          }, g.GetAngleBetweenVectors = function(l, h, v) {\n            var b = l.normalizeToRef(S.Vector3[1]), D = h.normalizeToRef(S.Vector3[2]), w = g.Dot(b, D), N = S.Vector3[3];\n            return g.CrossToRef(b, D, N), g.Dot(N, v) > 0 ? Math.acos(w) : -Math.acos(w);\n          }, g.FromArray = function(l, h) {\n            return h === void 0 && (h = 0), new g(l[h], l[h + 1], l[h + 2]);\n          }, g.FromFloatArray = function(l, h) {\n            return g.FromArray(l, h);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1], v.z = l[h + 2];\n          }, g.FromFloatArrayToRef = function(l, h, v) {\n            return g.FromArrayToRef(l, h, v);\n          }, g.FromFloatsToRef = function(l, h, v, b) {\n            b.copyFromFloats(l, h, v);\n          }, g.Zero = function() {\n            return new g(0, 0, 0);\n          }, g.One = function() {\n            return new g(1, 1, 1);\n          }, g.Up = function() {\n            return new g(0, 1, 0);\n          }, Object.defineProperty(g, \"UpReadOnly\", { get: function() {\n            return g._UpReadOnly;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g, \"ZeroReadOnly\", { get: function() {\n            return g._ZeroReadOnly;\n          }, enumerable: !1, configurable: !0 }), g.Down = function() {\n            return new g(0, -1, 0);\n          }, g.Forward = function(l) {\n            return l === void 0 && (l = !1), new g(0, 0, l ? -1 : 1);\n          }, g.Backward = function(l) {\n            return l === void 0 && (l = !1), new g(0, 0, l ? 1 : -1);\n          }, g.Right = function() {\n            return new g(1, 0, 0);\n          }, g.Left = function() {\n            return new g(-1, 0, 0);\n          }, g.TransformCoordinates = function(l, h) {\n            var v = g.Zero();\n            return g.TransformCoordinatesToRef(l, h, v), v;\n          }, g.TransformCoordinatesToRef = function(l, h, v) {\n            g.TransformCoordinatesFromFloatsToRef(l._x, l._y, l._z, h, v);\n          }, g.TransformCoordinatesFromFloatsToRef = function(l, h, v, b, D) {\n            var w = b.m, N = l * w[0] + h * w[4] + v * w[8] + w[12], M = l * w[1] + h * w[5] + v * w[9] + w[13], U = l * w[2] + h * w[6] + v * w[10] + w[14], X = 1 / (l * w[3] + h * w[7] + v * w[11] + w[15]);\n            D.x = N * X, D.y = M * X, D.z = U * X;\n          }, g.TransformNormal = function(l, h) {\n            var v = g.Zero();\n            return g.TransformNormalToRef(l, h, v), v;\n          }, g.TransformNormalToRef = function(l, h, v) {\n            this.TransformNormalFromFloatsToRef(l._x, l._y, l._z, h, v);\n          }, g.TransformNormalFromFloatsToRef = function(l, h, v, b, D) {\n            var w = b.m;\n            D.x = l * w[0] + h * w[4] + v * w[8], D.y = l * w[1] + h * w[5] + v * w[9], D.z = l * w[2] + h * w[6] + v * w[10];\n          }, g.CatmullRom = function(l, h, v, b, D) {\n            var w = D * D, N = D * w;\n            return new g(0.5 * (2 * h._x + (-l._x + v._x) * D + (2 * l._x - 5 * h._x + 4 * v._x - b._x) * w + (-l._x + 3 * h._x - 3 * v._x + b._x) * N), 0.5 * (2 * h._y + (-l._y + v._y) * D + (2 * l._y - 5 * h._y + 4 * v._y - b._y) * w + (-l._y + 3 * h._y - 3 * v._y + b._y) * N), 0.5 * (2 * h._z + (-l._z + v._z) * D + (2 * l._z - 5 * h._z + 4 * v._z - b._z) * w + (-l._z + 3 * h._z - 3 * v._z + b._z) * N));\n          }, g.Clamp = function(l, h, v) {\n            var b = new g();\n            return g.ClampToRef(l, h, v, b), b;\n          }, g.ClampToRef = function(l, h, v, b) {\n            var D = l._x;\n            D = (D = D > v._x ? v._x : D) < h._x ? h._x : D;\n            var w = l._y;\n            w = (w = w > v._y ? v._y : w) < h._y ? h._y : w;\n            var N = l._z;\n            N = (N = N > v._z ? v._z : N) < h._z ? h._z : N, b.copyFromFloats(D, w, N);\n          }, g.CheckExtends = function(l, h, v) {\n            h.minimizeInPlace(l), v.maximizeInPlace(l);\n          }, g.Hermite = function(l, h, v, b, D) {\n            var w = D * D, N = D * w, M = 2 * N - 3 * w + 1, U = -2 * N + 3 * w, X = N - 2 * w + D, j = N - w;\n            return new g(l._x * M + v._x * U + h._x * X + b._x * j, l._y * M + v._y * U + h._y * X + b._y * j, l._z * M + v._z * U + h._z * X + b._z * j);\n          }, g.Lerp = function(l, h, v) {\n            var b = new g(0, 0, 0);\n            return g.LerpToRef(l, h, v, b), b;\n          }, g.LerpToRef = function(l, h, v, b) {\n            b.x = l._x + (h._x - l._x) * v, b.y = l._y + (h._y - l._y) * v, b.z = l._z + (h._z - l._z) * v;\n          }, g.Dot = function(l, h) {\n            return l._x * h._x + l._y * h._y + l._z * h._z;\n          }, g.Cross = function(l, h) {\n            var v = g.Zero();\n            return g.CrossToRef(l, h, v), v;\n          }, g.CrossToRef = function(l, h, v) {\n            var b = l._y * h._z - l._z * h._y, D = l._z * h._x - l._x * h._z, w = l._x * h._y - l._y * h._x;\n            v.copyFromFloats(b, D, w);\n          }, g.Normalize = function(l) {\n            var h = g.Zero();\n            return g.NormalizeToRef(l, h), h;\n          }, g.NormalizeToRef = function(l, h) {\n            l.normalizeToRef(h);\n          }, g.Project = function(l, h, v, b) {\n            var D = new g();\n            return g.ProjectToRef(l, h, v, b, D), D;\n          }, g.ProjectToRef = function(l, h, v, b, D) {\n            var w = b.width, N = b.height, M = b.x, U = b.y, X = S.Matrix[1];\n            T.FromValuesToRef(w / 2, 0, 0, 0, 0, -N / 2, 0, 0, 0, 0, 0.5, 0, M + w / 2, N / 2 + U, 0.5, 1, X);\n            var j = S.Matrix[0];\n            return h.multiplyToRef(v, j), j.multiplyToRef(X, j), g.TransformCoordinatesToRef(l, j, D), D;\n          }, g._UnprojectFromInvertedMatrixToRef = function(l, h, v) {\n            g.TransformCoordinatesToRef(l, h, v);\n            var b = h.m, D = l._x * b[3] + l._y * b[7] + l._z * b[11] + b[15];\n            V.a.WithinEpsilon(D, 1) && v.scaleInPlace(1 / D);\n          }, g.UnprojectFromTransform = function(l, h, v, b, D) {\n            var w = S.Matrix[0];\n            b.multiplyToRef(D, w), w.invert(), l.x = l._x / h * 2 - 1, l.y = -(l._y / v * 2 - 1);\n            var N = new g();\n            return g._UnprojectFromInvertedMatrixToRef(l, w, N), N;\n          }, g.Unproject = function(l, h, v, b, D, w) {\n            var N = g.Zero();\n            return g.UnprojectToRef(l, h, v, b, D, w, N), N;\n          }, g.UnprojectToRef = function(l, h, v, b, D, w, N) {\n            g.UnprojectFloatsToRef(l._x, l._y, l._z, h, v, b, D, w, N);\n          }, g.UnprojectFloatsToRef = function(l, h, v, b, D, w, N, M, U) {\n            var X = S.Matrix[0];\n            w.multiplyToRef(N, X), X.multiplyToRef(M, X), X.invert();\n            var j = S.Vector3[0];\n            j.x = l / b * 2 - 1, j.y = -(h / D * 2 - 1), j.z = 2 * v - 1, g._UnprojectFromInvertedMatrixToRef(j, X, U);\n          }, g.Minimize = function(l, h) {\n            var v = l.clone();\n            return v.minimizeInPlace(h), v;\n          }, g.Maximize = function(l, h) {\n            var v = l.clone();\n            return v.maximizeInPlace(h), v;\n          }, g.Distance = function(l, h) {\n            return Math.sqrt(g.DistanceSquared(l, h));\n          }, g.DistanceSquared = function(l, h) {\n            var v = l._x - h._x, b = l._y - h._y, D = l._z - h._z;\n            return v * v + b * b + D * D;\n          }, g.Center = function(l, h) {\n            var v = l.add(h);\n            return v.scaleInPlace(0.5), v;\n          }, g.RotationFromAxis = function(l, h, v) {\n            var b = g.Zero();\n            return g.RotationFromAxisToRef(l, h, v, b), b;\n          }, g.RotationFromAxisToRef = function(l, h, v, b) {\n            var D = S.Quaternion[0];\n            c.RotationQuaternionFromAxisToRef(l, h, v, D), D.toEulerAnglesToRef(b);\n          }, g._UpReadOnly = g.Up(), g._ZeroReadOnly = g.Zero(), g;\n        }(), m = function() {\n          function g(l, h, v, b) {\n            this.x = l, this.y = h, this.z = v, this.w = b;\n          }\n          return g.prototype.toString = function() {\n            return \"{X: \" + this.x + \" Y:\" + this.y + \" Z:\" + this.z + \" W:\" + this.w + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Vector4\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this.x;\n            return l = 397 * (l = 397 * (l = 397 * l ^ (0 | this.y)) ^ (0 | this.z)) ^ (0 | this.w);\n          }, g.prototype.asArray = function() {\n            var l = new Array();\n            return this.toArray(l, 0), l;\n          }, g.prototype.toArray = function(l, h) {\n            return h === void 0 && (h = 0), l[h] = this.x, l[h + 1] = this.y, l[h + 2] = this.z, l[h + 3] = this.w, this;\n          }, g.prototype.fromArray = function(l, h) {\n            return h === void 0 && (h = 0), g.FromArrayToRef(l, h, this), this;\n          }, g.prototype.addInPlace = function(l) {\n            return this.x += l.x, this.y += l.y, this.z += l.z, this.w += l.w, this;\n          }, g.prototype.add = function(l) {\n            return new g(this.x + l.x, this.y + l.y, this.z + l.z, this.w + l.w);\n          }, g.prototype.addToRef = function(l, h) {\n            return h.x = this.x + l.x, h.y = this.y + l.y, h.z = this.z + l.z, h.w = this.w + l.w, this;\n          }, g.prototype.subtractInPlace = function(l) {\n            return this.x -= l.x, this.y -= l.y, this.z -= l.z, this.w -= l.w, this;\n          }, g.prototype.subtract = function(l) {\n            return new g(this.x - l.x, this.y - l.y, this.z - l.z, this.w - l.w);\n          }, g.prototype.subtractToRef = function(l, h) {\n            return h.x = this.x - l.x, h.y = this.y - l.y, h.z = this.z - l.z, h.w = this.w - l.w, this;\n          }, g.prototype.subtractFromFloats = function(l, h, v, b) {\n            return new g(this.x - l, this.y - h, this.z - v, this.w - b);\n          }, g.prototype.subtractFromFloatsToRef = function(l, h, v, b, D) {\n            return D.x = this.x - l, D.y = this.y - h, D.z = this.z - v, D.w = this.w - b, this;\n          }, g.prototype.negate = function() {\n            return new g(-this.x, -this.y, -this.z, -this.w);\n          }, g.prototype.negateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this.z *= -1, this.w *= -1, this;\n          }, g.prototype.negateToRef = function(l) {\n            return l.copyFromFloats(-1 * this.x, -1 * this.y, -1 * this.z, -1 * this.w);\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this.z *= l, this.w *= l, this;\n          }, g.prototype.scale = function(l) {\n            return new g(this.x * l, this.y * l, this.z * l, this.w * l);\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.x = this.x * l, h.y = this.y * l, h.z = this.z * l, h.w = this.w * l, this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.x += this.x * l, h.y += this.y * l, h.z += this.z * l, h.w += this.w * l, this;\n          }, g.prototype.equals = function(l) {\n            return l && this.x === l.x && this.y === l.y && this.z === l.z && this.w === l.w;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this.x, l.x, h) && V.a.WithinEpsilon(this.y, l.y, h) && V.a.WithinEpsilon(this.z, l.z, h) && V.a.WithinEpsilon(this.w, l.w, h);\n          }, g.prototype.equalsToFloats = function(l, h, v, b) {\n            return this.x === l && this.y === h && this.z === v && this.w === b;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.x *= l.x, this.y *= l.y, this.z *= l.z, this.w *= l.w, this;\n          }, g.prototype.multiply = function(l) {\n            return new g(this.x * l.x, this.y * l.y, this.z * l.z, this.w * l.w);\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return h.x = this.x * l.x, h.y = this.y * l.y, h.z = this.z * l.z, h.w = this.w * l.w, this;\n          }, g.prototype.multiplyByFloats = function(l, h, v, b) {\n            return new g(this.x * l, this.y * h, this.z * v, this.w * b);\n          }, g.prototype.divide = function(l) {\n            return new g(this.x / l.x, this.y / l.y, this.z / l.z, this.w / l.w);\n          }, g.prototype.divideToRef = function(l, h) {\n            return h.x = this.x / l.x, h.y = this.y / l.y, h.z = this.z / l.z, h.w = this.w / l.w, this;\n          }, g.prototype.divideInPlace = function(l) {\n            return this.divideToRef(l, this);\n          }, g.prototype.minimizeInPlace = function(l) {\n            return l.x < this.x && (this.x = l.x), l.y < this.y && (this.y = l.y), l.z < this.z && (this.z = l.z), l.w < this.w && (this.w = l.w), this;\n          }, g.prototype.maximizeInPlace = function(l) {\n            return l.x > this.x && (this.x = l.x), l.y > this.y && (this.y = l.y), l.z > this.z && (this.z = l.z), l.w > this.w && (this.w = l.w), this;\n          }, g.prototype.floor = function() {\n            return new g(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));\n          }, g.prototype.fract = function() {\n            return new g(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));\n          }, g.prototype.length = function() {\n            return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n          }, g.prototype.lengthSquared = function() {\n            return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n          }, g.prototype.normalize = function() {\n            var l = this.length();\n            return l === 0 ? this : this.scaleInPlace(1 / l);\n          }, g.prototype.toVector3 = function() {\n            return new x(this.x, this.y, this.z);\n          }, g.prototype.clone = function() {\n            return new g(this.x, this.y, this.z, this.w);\n          }, g.prototype.copyFrom = function(l) {\n            return this.x = l.x, this.y = l.y, this.z = l.z, this.w = l.w, this;\n          }, g.prototype.copyFromFloats = function(l, h, v, b) {\n            return this.x = l, this.y = h, this.z = v, this.w = b, this;\n          }, g.prototype.set = function(l, h, v, b) {\n            return this.copyFromFloats(l, h, v, b);\n          }, g.prototype.setAll = function(l) {\n            return this.x = this.y = this.z = this.w = l, this;\n          }, g.FromArray = function(l, h) {\n            return h || (h = 0), new g(l[h], l[h + 1], l[h + 2], l[h + 3]);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1], v.z = l[h + 2], v.w = l[h + 3];\n          }, g.FromFloatArrayToRef = function(l, h, v) {\n            g.FromArrayToRef(l, h, v);\n          }, g.FromFloatsToRef = function(l, h, v, b, D) {\n            D.x = l, D.y = h, D.z = v, D.w = b;\n          }, g.Zero = function() {\n            return new g(0, 0, 0, 0);\n          }, g.One = function() {\n            return new g(1, 1, 1, 1);\n          }, g.Normalize = function(l) {\n            var h = g.Zero();\n            return g.NormalizeToRef(l, h), h;\n          }, g.NormalizeToRef = function(l, h) {\n            h.copyFrom(l), h.normalize();\n          }, g.Minimize = function(l, h) {\n            var v = l.clone();\n            return v.minimizeInPlace(h), v;\n          }, g.Maximize = function(l, h) {\n            var v = l.clone();\n            return v.maximizeInPlace(h), v;\n          }, g.Distance = function(l, h) {\n            return Math.sqrt(g.DistanceSquared(l, h));\n          }, g.DistanceSquared = function(l, h) {\n            var v = l.x - h.x, b = l.y - h.y, D = l.z - h.z, w = l.w - h.w;\n            return v * v + b * b + D * D + w * w;\n          }, g.Center = function(l, h) {\n            var v = l.add(h);\n            return v.scaleInPlace(0.5), v;\n          }, g.TransformNormal = function(l, h) {\n            var v = g.Zero();\n            return g.TransformNormalToRef(l, h, v), v;\n          }, g.TransformNormalToRef = function(l, h, v) {\n            var b = h.m, D = l.x * b[0] + l.y * b[4] + l.z * b[8], w = l.x * b[1] + l.y * b[5] + l.z * b[9], N = l.x * b[2] + l.y * b[6] + l.z * b[10];\n            v.x = D, v.y = w, v.z = N, v.w = l.w;\n          }, g.TransformNormalFromFloatsToRef = function(l, h, v, b, D, w) {\n            var N = D.m;\n            w.x = l * N[0] + h * N[4] + v * N[8], w.y = l * N[1] + h * N[5] + v * N[9], w.z = l * N[2] + h * N[6] + v * N[10], w.w = b;\n          }, g.FromVector3 = function(l, h) {\n            return h === void 0 && (h = 0), new g(l._x, l._y, l._z, h);\n          }, g;\n        }(), c = function() {\n          function g(l, h, v, b) {\n            l === void 0 && (l = 0), h === void 0 && (h = 0), v === void 0 && (v = 0), b === void 0 && (b = 1), this._isDirty = !0, this._x = l, this._y = h, this._z = v, this._w = b;\n          }\n          return Object.defineProperty(g.prototype, \"x\", { get: function() {\n            return this._x;\n          }, set: function(l) {\n            this._x = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"y\", { get: function() {\n            return this._y;\n          }, set: function(l) {\n            this._y = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"z\", { get: function() {\n            return this._z;\n          }, set: function(l) {\n            this._z = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"w\", { get: function() {\n            return this._w;\n          }, set: function(l) {\n            this._w = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype.toString = function() {\n            return \"{X: \" + this._x + \" Y:\" + this._y + \" Z:\" + this._z + \" W:\" + this._w + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Quaternion\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this._x;\n            return l = 397 * (l = 397 * (l = 397 * l ^ (0 | this._y)) ^ (0 | this._z)) ^ (0 | this._w);\n          }, g.prototype.asArray = function() {\n            return [this._x, this._y, this._z, this._w];\n          }, g.prototype.equals = function(l) {\n            return l && this._x === l._x && this._y === l._y && this._z === l._z && this._w === l._w;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this._x, l._x, h) && V.a.WithinEpsilon(this._y, l._y, h) && V.a.WithinEpsilon(this._z, l._z, h) && V.a.WithinEpsilon(this._w, l._w, h);\n          }, g.prototype.clone = function() {\n            return new g(this._x, this._y, this._z, this._w);\n          }, g.prototype.copyFrom = function(l) {\n            return this.x = l._x, this.y = l._y, this.z = l._z, this.w = l._w, this;\n          }, g.prototype.copyFromFloats = function(l, h, v, b) {\n            return this.x = l, this.y = h, this.z = v, this.w = b, this;\n          }, g.prototype.set = function(l, h, v, b) {\n            return this.copyFromFloats(l, h, v, b);\n          }, g.prototype.add = function(l) {\n            return new g(this._x + l._x, this._y + l._y, this._z + l._z, this._w + l._w);\n          }, g.prototype.addInPlace = function(l) {\n            return this._x += l._x, this._y += l._y, this._z += l._z, this._w += l._w, this;\n          }, g.prototype.subtract = function(l) {\n            return new g(this._x - l._x, this._y - l._y, this._z - l._z, this._w - l._w);\n          }, g.prototype.scale = function(l) {\n            return new g(this._x * l, this._y * l, this._z * l, this._w * l);\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.x = this._x * l, h.y = this._y * l, h.z = this._z * l, h.w = this._w * l, this;\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this.z *= l, this.w *= l, this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.x += this._x * l, h.y += this._y * l, h.z += this._z * l, h.w += this._w * l, this;\n          }, g.prototype.multiply = function(l) {\n            var h = new g(0, 0, 0, 1);\n            return this.multiplyToRef(l, h), h;\n          }, g.prototype.multiplyToRef = function(l, h) {\n            var v = this._x * l._w + this._y * l._z - this._z * l._y + this._w * l._x, b = -this._x * l._z + this._y * l._w + this._z * l._x + this._w * l._y, D = this._x * l._y - this._y * l._x + this._z * l._w + this._w * l._z, w = -this._x * l._x - this._y * l._y - this._z * l._z + this._w * l._w;\n            return h.copyFromFloats(v, b, D, w), this;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.multiplyToRef(l, this), this;\n          }, g.prototype.conjugateToRef = function(l) {\n            return l.copyFromFloats(-this._x, -this._y, -this._z, this._w), this;\n          }, g.prototype.conjugateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this.z *= -1, this;\n          }, g.prototype.conjugate = function() {\n            return new g(-this._x, -this._y, -this._z, this._w);\n          }, g.prototype.length = function() {\n            return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n          }, g.prototype.normalize = function() {\n            var l = this.length();\n            if (l === 0)\n              return this;\n            var h = 1 / l;\n            return this.x *= h, this.y *= h, this.z *= h, this.w *= h, this;\n          }, g.prototype.toEulerAngles = function(l) {\n            var h = x.Zero();\n            return this.toEulerAnglesToRef(h), h;\n          }, g.prototype.toEulerAnglesToRef = function(l) {\n            var h = this._z, v = this._x, b = this._y, D = this._w, w = D * D, N = h * h, M = v * v, U = b * b, X = b * h - v * D;\n            return X < -0.4999999 ? (l.y = 2 * Math.atan2(b, D), l.x = Math.PI / 2, l.z = 0) : X > 0.4999999 ? (l.y = 2 * Math.atan2(b, D), l.x = -Math.PI / 2, l.z = 0) : (l.z = Math.atan2(2 * (v * b + h * D), -N - M + U + w), l.x = Math.asin(-2 * (h * b - v * D)), l.y = Math.atan2(2 * (h * v + b * D), N - M - U + w)), this;\n          }, g.prototype.toRotationMatrix = function(l) {\n            return T.FromQuaternionToRef(this, l), this;\n          }, g.prototype.fromRotationMatrix = function(l) {\n            return g.FromRotationMatrixToRef(l, this), this;\n          }, g.FromRotationMatrix = function(l) {\n            var h = new g();\n            return g.FromRotationMatrixToRef(l, h), h;\n          }, g.FromRotationMatrixToRef = function(l, h) {\n            var v, b = l.m, D = b[0], w = b[4], N = b[8], M = b[1], U = b[5], X = b[9], j = b[2], ne = b[6], te = b[10], de = D + U + te;\n            de > 0 ? (v = 0.5 / Math.sqrt(de + 1), h.w = 0.25 / v, h.x = (ne - X) * v, h.y = (N - j) * v, h.z = (M - w) * v) : D > U && D > te ? (v = 2 * Math.sqrt(1 + D - U - te), h.w = (ne - X) / v, h.x = 0.25 * v, h.y = (w + M) / v, h.z = (N + j) / v) : U > te ? (v = 2 * Math.sqrt(1 + U - D - te), h.w = (N - j) / v, h.x = (w + M) / v, h.y = 0.25 * v, h.z = (X + ne) / v) : (v = 2 * Math.sqrt(1 + te - D - U), h.w = (M - w) / v, h.x = (N + j) / v, h.y = (X + ne) / v, h.z = 0.25 * v);\n          }, g.Dot = function(l, h) {\n            return l._x * h._x + l._y * h._y + l._z * h._z + l._w * h._w;\n          }, g.AreClose = function(l, h) {\n            return g.Dot(l, h) >= 0;\n          }, g.Zero = function() {\n            return new g(0, 0, 0, 0);\n          }, g.Inverse = function(l) {\n            return new g(-l._x, -l._y, -l._z, l._w);\n          }, g.InverseToRef = function(l, h) {\n            return h.set(-l._x, -l._y, -l._z, l._w), h;\n          }, g.Identity = function() {\n            return new g(0, 0, 0, 1);\n          }, g.IsIdentity = function(l) {\n            return l && l._x === 0 && l._y === 0 && l._z === 0 && l._w === 1;\n          }, g.RotationAxis = function(l, h) {\n            return g.RotationAxisToRef(l, h, new g());\n          }, g.RotationAxisToRef = function(l, h, v) {\n            var b = Math.sin(h / 2);\n            return l.normalize(), v.w = Math.cos(h / 2), v.x = l._x * b, v.y = l._y * b, v.z = l._z * b, v;\n          }, g.FromArray = function(l, h) {\n            return h || (h = 0), new g(l[h], l[h + 1], l[h + 2], l[h + 3]);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1], v.z = l[h + 2], v.w = l[h + 3];\n          }, g.FromEulerAngles = function(l, h, v) {\n            var b = new g();\n            return g.RotationYawPitchRollToRef(h, l, v, b), b;\n          }, g.FromEulerAnglesToRef = function(l, h, v, b) {\n            return g.RotationYawPitchRollToRef(h, l, v, b), b;\n          }, g.FromEulerVector = function(l) {\n            var h = new g();\n            return g.RotationYawPitchRollToRef(l._y, l._x, l._z, h), h;\n          }, g.FromEulerVectorToRef = function(l, h) {\n            return g.RotationYawPitchRollToRef(l._y, l._x, l._z, h), h;\n          }, g.RotationYawPitchRoll = function(l, h, v) {\n            var b = new g();\n            return g.RotationYawPitchRollToRef(l, h, v, b), b;\n          }, g.RotationYawPitchRollToRef = function(l, h, v, b) {\n            var D = 0.5 * v, w = 0.5 * h, N = 0.5 * l, M = Math.sin(D), U = Math.cos(D), X = Math.sin(w), j = Math.cos(w), ne = Math.sin(N), te = Math.cos(N);\n            b.x = te * X * U + ne * j * M, b.y = ne * j * U - te * X * M, b.z = te * j * M - ne * X * U, b.w = te * j * U + ne * X * M;\n          }, g.RotationAlphaBetaGamma = function(l, h, v) {\n            var b = new g();\n            return g.RotationAlphaBetaGammaToRef(l, h, v, b), b;\n          }, g.RotationAlphaBetaGammaToRef = function(l, h, v, b) {\n            var D = 0.5 * (v + l), w = 0.5 * (v - l), N = 0.5 * h;\n            b.x = Math.cos(w) * Math.sin(N), b.y = Math.sin(w) * Math.sin(N), b.z = Math.sin(D) * Math.cos(N), b.w = Math.cos(D) * Math.cos(N);\n          }, g.RotationQuaternionFromAxis = function(l, h, v) {\n            var b = new g(0, 0, 0, 0);\n            return g.RotationQuaternionFromAxisToRef(l, h, v, b), b;\n          }, g.RotationQuaternionFromAxisToRef = function(l, h, v, b) {\n            var D = S.Matrix[0];\n            T.FromXYZAxesToRef(l.normalize(), h.normalize(), v.normalize(), D), g.FromRotationMatrixToRef(D, b);\n          }, g.Slerp = function(l, h, v) {\n            var b = g.Identity();\n            return g.SlerpToRef(l, h, v, b), b;\n          }, g.SlerpToRef = function(l, h, v, b) {\n            var D, w, N = l._x * h._x + l._y * h._y + l._z * h._z + l._w * h._w, M = !1;\n            if (N < 0 && (M = !0, N = -N), N > 0.999999)\n              w = 1 - v, D = M ? -v : v;\n            else {\n              var U = Math.acos(N), X = 1 / Math.sin(U);\n              w = Math.sin((1 - v) * U) * X, D = M ? -Math.sin(v * U) * X : Math.sin(v * U) * X;\n            }\n            b.x = w * l._x + D * h._x, b.y = w * l._y + D * h._y, b.z = w * l._z + D * h._z, b.w = w * l._w + D * h._w;\n          }, g.Hermite = function(l, h, v, b, D) {\n            var w = D * D, N = D * w, M = 2 * N - 3 * w + 1, U = -2 * N + 3 * w, X = N - 2 * w + D, j = N - w;\n            return new g(l._x * M + v._x * U + h._x * X + b._x * j, l._y * M + v._y * U + h._y * X + b._y * j, l._z * M + v._z * U + h._z * X + b._z * j, l._w * M + v._w * U + h._w * X + b._w * j);\n          }, g;\n        }(), T = function() {\n          function g() {\n            this._isIdentity = !1, this._isIdentityDirty = !0, this._isIdentity3x2 = !0, this._isIdentity3x2Dirty = !0, this.updateFlag = -1, I.a.MatrixTrackPrecisionChange && I.a.MatrixTrackedMatrices.push(this), this._m = new I.a.MatrixCurrentType(16), this._updateIdentityStatus(!1);\n          }\n          return Object.defineProperty(g, \"Use64Bits\", { get: function() {\n            return I.a.MatrixUse64Bits;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"m\", { get: function() {\n            return this._m;\n          }, enumerable: !1, configurable: !0 }), g.prototype._markAsUpdated = function() {\n            this.updateFlag = g._updateFlagSeed++, this._isIdentity = !1, this._isIdentity3x2 = !1, this._isIdentityDirty = !0, this._isIdentity3x2Dirty = !0;\n          }, g.prototype._updateIdentityStatus = function(l, h, v, b) {\n            h === void 0 && (h = !1), v === void 0 && (v = !1), b === void 0 && (b = !0), this.updateFlag = g._updateFlagSeed++, this._isIdentity = l, this._isIdentity3x2 = l || v, this._isIdentityDirty = !this._isIdentity && h, this._isIdentity3x2Dirty = !this._isIdentity3x2 && b;\n          }, g.prototype.isIdentity = function() {\n            if (this._isIdentityDirty) {\n              this._isIdentityDirty = !1;\n              var l = this._m;\n              this._isIdentity = l[0] === 1 && l[1] === 0 && l[2] === 0 && l[3] === 0 && l[4] === 0 && l[5] === 1 && l[6] === 0 && l[7] === 0 && l[8] === 0 && l[9] === 0 && l[10] === 1 && l[11] === 0 && l[12] === 0 && l[13] === 0 && l[14] === 0 && l[15] === 1;\n            }\n            return this._isIdentity;\n          }, g.prototype.isIdentityAs3x2 = function() {\n            return this._isIdentity3x2Dirty && (this._isIdentity3x2Dirty = !1, this._m[0] !== 1 || this._m[5] !== 1 || this._m[15] !== 1 || this._m[1] !== 0 || this._m[2] !== 0 || this._m[3] !== 0 || this._m[4] !== 0 || this._m[6] !== 0 || this._m[7] !== 0 || this._m[8] !== 0 || this._m[9] !== 0 || this._m[10] !== 0 || this._m[11] !== 0 || this._m[12] !== 0 || this._m[13] !== 0 || this._m[14] !== 0 ? this._isIdentity3x2 = !1 : this._isIdentity3x2 = !0), this._isIdentity3x2;\n          }, g.prototype.determinant = function() {\n            if (this._isIdentity === !0)\n              return 1;\n            var l = this._m, h = l[0], v = l[1], b = l[2], D = l[3], w = l[4], N = l[5], M = l[6], U = l[7], X = l[8], j = l[9], ne = l[10], te = l[11], de = l[12], pe = l[13], ae = l[14], ee = l[15], K = ne * ee - ae * te, $ = j * ee - pe * te, L = j * ae - pe * ne, G = X * ee - de * te, Q = X * ae - ne * de, oe = X * pe - de * j;\n            return h * +(N * K - M * $ + U * L) + v * -(w * K - M * G + U * Q) + b * +(w * $ - N * G + U * oe) + D * -(w * L - N * Q + M * oe);\n          }, g.prototype.toArray = function() {\n            return this._m;\n          }, g.prototype.asArray = function() {\n            return this._m;\n          }, g.prototype.invert = function() {\n            return this.invertToRef(this), this;\n          }, g.prototype.reset = function() {\n            return g.FromValuesToRef(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, this), this._updateIdentityStatus(!1), this;\n          }, g.prototype.add = function(l) {\n            var h = new g();\n            return this.addToRef(l, h), h;\n          }, g.prototype.addToRef = function(l, h) {\n            for (var v = this._m, b = h._m, D = l.m, w = 0; w < 16; w++)\n              b[w] = v[w] + D[w];\n            return h._markAsUpdated(), this;\n          }, g.prototype.addToSelf = function(l) {\n            for (var h = this._m, v = l.m, b = 0; b < 16; b++)\n              h[b] += v[b];\n            return this._markAsUpdated(), this;\n          }, g.prototype.invertToRef = function(l) {\n            if (this._isIdentity === !0)\n              return g.IdentityToRef(l), this;\n            var h = this._m, v = h[0], b = h[1], D = h[2], w = h[3], N = h[4], M = h[5], U = h[6], X = h[7], j = h[8], ne = h[9], te = h[10], de = h[11], pe = h[12], ae = h[13], ee = h[14], K = h[15], $ = te * K - ee * de, L = ne * K - ae * de, G = ne * ee - ae * te, Q = j * K - pe * de, oe = j * ee - te * pe, re = j * ae - pe * ne, Y = +(M * $ - U * L + X * G), k = -(N * $ - U * Q + X * oe), H = +(N * L - M * Q + X * re), Z = -(N * G - M * oe + U * re), W = v * Y + b * k + D * H + w * Z;\n            if (W === 0)\n              return l.copyFrom(this), this;\n            var q = 1 / W, he = U * K - ee * X, ge = M * K - ae * X, me = M * ee - ae * U, _e = N * K - pe * X, ye = N * ee - pe * U, Pe = N * ae - pe * M, be = U * de - te * X, Fe = M * de - ne * X, ke = M * te - ne * U, We = N * de - j * X, je = N * te - j * U, He = N * ne - j * M, Qe = -(b * $ - D * L + w * G), Ge = +(v * $ - D * Q + w * oe), tt = -(v * L - b * Q + w * re), Je = +(v * G - b * oe + D * re), st = +(b * he - D * ge + w * me), at = -(v * he - D * _e + w * ye), pt = +(v * ge - b * _e + w * Pe), Tt = -(v * me - b * ye + D * Pe), Lt = -(b * be - D * Fe + w * ke), Ot = +(v * be - D * We + w * je), St = -(v * Fe - b * We + w * He), Ct = +(v * ke - b * je + D * He);\n            return g.FromValuesToRef(Y * q, Qe * q, st * q, Lt * q, k * q, Ge * q, at * q, Ot * q, H * q, tt * q, pt * q, St * q, Z * q, Je * q, Tt * q, Ct * q, l), this;\n          }, g.prototype.addAtIndex = function(l, h) {\n            return this._m[l] += h, this._markAsUpdated(), this;\n          }, g.prototype.multiplyAtIndex = function(l, h) {\n            return this._m[l] *= h, this._markAsUpdated(), this;\n          }, g.prototype.setTranslationFromFloats = function(l, h, v) {\n            return this._m[12] = l, this._m[13] = h, this._m[14] = v, this._markAsUpdated(), this;\n          }, g.prototype.addTranslationFromFloats = function(l, h, v) {\n            return this._m[12] += l, this._m[13] += h, this._m[14] += v, this._markAsUpdated(), this;\n          }, g.prototype.setTranslation = function(l) {\n            return this.setTranslationFromFloats(l._x, l._y, l._z);\n          }, g.prototype.getTranslation = function() {\n            return new x(this._m[12], this._m[13], this._m[14]);\n          }, g.prototype.getTranslationToRef = function(l) {\n            return l.x = this._m[12], l.y = this._m[13], l.z = this._m[14], this;\n          }, g.prototype.removeRotationAndScaling = function() {\n            var l = this.m;\n            return g.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, l[12], l[13], l[14], l[15], this), this._updateIdentityStatus(l[12] === 0 && l[13] === 0 && l[14] === 0 && l[15] === 1), this;\n          }, g.prototype.multiply = function(l) {\n            var h = new g();\n            return this.multiplyToRef(l, h), h;\n          }, g.prototype.copyFrom = function(l) {\n            l.copyToArray(this._m);\n            var h = l;\n            return this._updateIdentityStatus(h._isIdentity, h._isIdentityDirty, h._isIdentity3x2, h._isIdentity3x2Dirty), this;\n          }, g.prototype.copyToArray = function(l, h) {\n            h === void 0 && (h = 0);\n            var v = this._m;\n            return l[h] = v[0], l[h + 1] = v[1], l[h + 2] = v[2], l[h + 3] = v[3], l[h + 4] = v[4], l[h + 5] = v[5], l[h + 6] = v[6], l[h + 7] = v[7], l[h + 8] = v[8], l[h + 9] = v[9], l[h + 10] = v[10], l[h + 11] = v[11], l[h + 12] = v[12], l[h + 13] = v[13], l[h + 14] = v[14], l[h + 15] = v[15], this;\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return this._isIdentity ? (h.copyFrom(l), this) : l._isIdentity ? (h.copyFrom(this), this) : (this.multiplyToArray(l, h._m, 0), h._markAsUpdated(), this);\n          }, g.prototype.multiplyToArray = function(l, h, v) {\n            var b = this._m, D = l.m, w = b[0], N = b[1], M = b[2], U = b[3], X = b[4], j = b[5], ne = b[6], te = b[7], de = b[8], pe = b[9], ae = b[10], ee = b[11], K = b[12], $ = b[13], L = b[14], G = b[15], Q = D[0], oe = D[1], re = D[2], Y = D[3], k = D[4], H = D[5], Z = D[6], W = D[7], q = D[8], he = D[9], ge = D[10], me = D[11], _e = D[12], ye = D[13], Pe = D[14], be = D[15];\n            return h[v] = w * Q + N * k + M * q + U * _e, h[v + 1] = w * oe + N * H + M * he + U * ye, h[v + 2] = w * re + N * Z + M * ge + U * Pe, h[v + 3] = w * Y + N * W + M * me + U * be, h[v + 4] = X * Q + j * k + ne * q + te * _e, h[v + 5] = X * oe + j * H + ne * he + te * ye, h[v + 6] = X * re + j * Z + ne * ge + te * Pe, h[v + 7] = X * Y + j * W + ne * me + te * be, h[v + 8] = de * Q + pe * k + ae * q + ee * _e, h[v + 9] = de * oe + pe * H + ae * he + ee * ye, h[v + 10] = de * re + pe * Z + ae * ge + ee * Pe, h[v + 11] = de * Y + pe * W + ae * me + ee * be, h[v + 12] = K * Q + $ * k + L * q + G * _e, h[v + 13] = K * oe + $ * H + L * he + G * ye, h[v + 14] = K * re + $ * Z + L * ge + G * Pe, h[v + 15] = K * Y + $ * W + L * me + G * be, this;\n          }, g.prototype.equals = function(l) {\n            var h = l;\n            if (!h)\n              return !1;\n            if ((this._isIdentity || h._isIdentity) && !this._isIdentityDirty && !h._isIdentityDirty)\n              return this._isIdentity && h._isIdentity;\n            var v = this.m, b = h.m;\n            return v[0] === b[0] && v[1] === b[1] && v[2] === b[2] && v[3] === b[3] && v[4] === b[4] && v[5] === b[5] && v[6] === b[6] && v[7] === b[7] && v[8] === b[8] && v[9] === b[9] && v[10] === b[10] && v[11] === b[11] && v[12] === b[12] && v[13] === b[13] && v[14] === b[14] && v[15] === b[15];\n          }, g.prototype.clone = function() {\n            var l = new g();\n            return l.copyFrom(this), l;\n          }, g.prototype.getClassName = function() {\n            return \"Matrix\";\n          }, g.prototype.getHashCode = function() {\n            for (var l = 0 | this._m[0], h = 1; h < 16; h++)\n              l = 397 * l ^ (0 | this._m[h]);\n            return l;\n          }, g.prototype.decompose = function(l, h, v) {\n            if (this._isIdentity)\n              return v && v.setAll(0), l && l.setAll(1), h && h.copyFromFloats(0, 0, 0, 1), !0;\n            var b = this._m;\n            if (v && v.copyFromFloats(b[12], b[13], b[14]), (l = l || S.Vector3[0]).x = Math.sqrt(b[0] * b[0] + b[1] * b[1] + b[2] * b[2]), l.y = Math.sqrt(b[4] * b[4] + b[5] * b[5] + b[6] * b[6]), l.z = Math.sqrt(b[8] * b[8] + b[9] * b[9] + b[10] * b[10]), this.determinant() <= 0 && (l.y *= -1), l._x === 0 || l._y === 0 || l._z === 0)\n              return h && h.copyFromFloats(0, 0, 0, 1), !1;\n            if (h) {\n              var D = 1 / l._x, w = 1 / l._y, N = 1 / l._z;\n              g.FromValuesToRef(b[0] * D, b[1] * D, b[2] * D, 0, b[4] * w, b[5] * w, b[6] * w, 0, b[8] * N, b[9] * N, b[10] * N, 0, 0, 0, 0, 1, S.Matrix[0]), c.FromRotationMatrixToRef(S.Matrix[0], h);\n            }\n            return !0;\n          }, g.prototype.getRow = function(l) {\n            if (l < 0 || l > 3)\n              return null;\n            var h = 4 * l;\n            return new m(this._m[h + 0], this._m[h + 1], this._m[h + 2], this._m[h + 3]);\n          }, g.prototype.setRow = function(l, h) {\n            return this.setRowFromFloats(l, h.x, h.y, h.z, h.w);\n          }, g.prototype.transpose = function() {\n            return g.Transpose(this);\n          }, g.prototype.transposeToRef = function(l) {\n            return g.TransposeToRef(this, l), this;\n          }, g.prototype.setRowFromFloats = function(l, h, v, b, D) {\n            if (l < 0 || l > 3)\n              return this;\n            var w = 4 * l;\n            return this._m[w + 0] = h, this._m[w + 1] = v, this._m[w + 2] = b, this._m[w + 3] = D, this._markAsUpdated(), this;\n          }, g.prototype.scale = function(l) {\n            var h = new g();\n            return this.scaleToRef(l, h), h;\n          }, g.prototype.scaleToRef = function(l, h) {\n            for (var v = 0; v < 16; v++)\n              h._m[v] = this._m[v] * l;\n            return h._markAsUpdated(), this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            for (var v = 0; v < 16; v++)\n              h._m[v] += this._m[v] * l;\n            return h._markAsUpdated(), this;\n          }, g.prototype.toNormalMatrix = function(l) {\n            var h = S.Matrix[0];\n            this.invertToRef(h), h.transposeToRef(l);\n            var v = l._m;\n            g.FromValuesToRef(v[0], v[1], v[2], 0, v[4], v[5], v[6], 0, v[8], v[9], v[10], 0, 0, 0, 0, 1, l);\n          }, g.prototype.getRotationMatrix = function() {\n            var l = new g();\n            return this.getRotationMatrixToRef(l), l;\n          }, g.prototype.getRotationMatrixToRef = function(l) {\n            var h = S.Vector3[0];\n            if (!this.decompose(h))\n              return g.IdentityToRef(l), this;\n            var v = this._m, b = 1 / h._x, D = 1 / h._y, w = 1 / h._z;\n            return g.FromValuesToRef(v[0] * b, v[1] * b, v[2] * b, 0, v[4] * D, v[5] * D, v[6] * D, 0, v[8] * w, v[9] * w, v[10] * w, 0, 0, 0, 0, 1, l), this;\n          }, g.prototype.toggleModelMatrixHandInPlace = function() {\n            var l = this._m;\n            l[2] *= -1, l[6] *= -1, l[8] *= -1, l[9] *= -1, l[14] *= -1, this._markAsUpdated();\n          }, g.prototype.toggleProjectionMatrixHandInPlace = function() {\n            var l = this._m;\n            l[8] *= -1, l[9] *= -1, l[10] *= -1, l[11] *= -1, this._markAsUpdated();\n          }, g.FromArray = function(l, h) {\n            h === void 0 && (h = 0);\n            var v = new g();\n            return g.FromArrayToRef(l, h, v), v;\n          }, g.FromArrayToRef = function(l, h, v) {\n            for (var b = 0; b < 16; b++)\n              v._m[b] = l[b + h];\n            v._markAsUpdated();\n          }, g.FromFloat32ArrayToRefScaled = function(l, h, v, b) {\n            for (var D = 0; D < 16; D++)\n              b._m[D] = l[D + h] * v;\n            b._markAsUpdated();\n          }, Object.defineProperty(g, \"IdentityReadOnly\", { get: function() {\n            return g._identityReadOnly;\n          }, enumerable: !1, configurable: !0 }), g.FromValuesToRef = function(l, h, v, b, D, w, N, M, U, X, j, ne, te, de, pe, ae, ee) {\n            var K = ee._m;\n            K[0] = l, K[1] = h, K[2] = v, K[3] = b, K[4] = D, K[5] = w, K[6] = N, K[7] = M, K[8] = U, K[9] = X, K[10] = j, K[11] = ne, K[12] = te, K[13] = de, K[14] = pe, K[15] = ae, ee._markAsUpdated();\n          }, g.FromValues = function(l, h, v, b, D, w, N, M, U, X, j, ne, te, de, pe, ae) {\n            var ee = new g(), K = ee._m;\n            return K[0] = l, K[1] = h, K[2] = v, K[3] = b, K[4] = D, K[5] = w, K[6] = N, K[7] = M, K[8] = U, K[9] = X, K[10] = j, K[11] = ne, K[12] = te, K[13] = de, K[14] = pe, K[15] = ae, ee._markAsUpdated(), ee;\n          }, g.Compose = function(l, h, v) {\n            var b = new g();\n            return g.ComposeToRef(l, h, v, b), b;\n          }, g.ComposeToRef = function(l, h, v, b) {\n            var D = b._m, w = h._x, N = h._y, M = h._z, U = h._w, X = w + w, j = N + N, ne = M + M, te = w * X, de = w * j, pe = w * ne, ae = N * j, ee = N * ne, K = M * ne, $ = U * X, L = U * j, G = U * ne, Q = l._x, oe = l._y, re = l._z;\n            D[0] = (1 - (ae + K)) * Q, D[1] = (de + G) * Q, D[2] = (pe - L) * Q, D[3] = 0, D[4] = (de - G) * oe, D[5] = (1 - (te + K)) * oe, D[6] = (ee + $) * oe, D[7] = 0, D[8] = (pe + L) * re, D[9] = (ee - $) * re, D[10] = (1 - (te + ae)) * re, D[11] = 0, D[12] = v._x, D[13] = v._y, D[14] = v._z, D[15] = 1, b._markAsUpdated();\n          }, g.Identity = function() {\n            var l = g.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n            return l._updateIdentityStatus(!0), l;\n          }, g.IdentityToRef = function(l) {\n            g.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, l), l._updateIdentityStatus(!0);\n          }, g.Zero = function() {\n            var l = g.FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n            return l._updateIdentityStatus(!1), l;\n          }, g.RotationX = function(l) {\n            var h = new g();\n            return g.RotationXToRef(l, h), h;\n          }, g.Invert = function(l) {\n            var h = new g();\n            return l.invertToRef(h), h;\n          }, g.RotationXToRef = function(l, h) {\n            var v = Math.sin(l), b = Math.cos(l);\n            g.FromValuesToRef(1, 0, 0, 0, 0, b, v, 0, 0, -v, b, 0, 0, 0, 0, 1, h), h._updateIdentityStatus(b === 1 && v === 0);\n          }, g.RotationY = function(l) {\n            var h = new g();\n            return g.RotationYToRef(l, h), h;\n          }, g.RotationYToRef = function(l, h) {\n            var v = Math.sin(l), b = Math.cos(l);\n            g.FromValuesToRef(b, 0, -v, 0, 0, 1, 0, 0, v, 0, b, 0, 0, 0, 0, 1, h), h._updateIdentityStatus(b === 1 && v === 0);\n          }, g.RotationZ = function(l) {\n            var h = new g();\n            return g.RotationZToRef(l, h), h;\n          }, g.RotationZToRef = function(l, h) {\n            var v = Math.sin(l), b = Math.cos(l);\n            g.FromValuesToRef(b, v, 0, 0, -v, b, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, h), h._updateIdentityStatus(b === 1 && v === 0);\n          }, g.RotationAxis = function(l, h) {\n            var v = new g();\n            return g.RotationAxisToRef(l, h, v), v;\n          }, g.RotationAxisToRef = function(l, h, v) {\n            var b = Math.sin(-h), D = Math.cos(-h), w = 1 - D;\n            l.normalize();\n            var N = v._m;\n            N[0] = l._x * l._x * w + D, N[1] = l._x * l._y * w - l._z * b, N[2] = l._x * l._z * w + l._y * b, N[3] = 0, N[4] = l._y * l._x * w + l._z * b, N[5] = l._y * l._y * w + D, N[6] = l._y * l._z * w - l._x * b, N[7] = 0, N[8] = l._z * l._x * w - l._y * b, N[9] = l._z * l._y * w + l._x * b, N[10] = l._z * l._z * w + D, N[11] = 0, N[12] = 0, N[13] = 0, N[14] = 0, N[15] = 1, v._markAsUpdated();\n          }, g.RotationAlignToRef = function(l, h, v) {\n            var b = x.Cross(h, l), D = x.Dot(h, l), w = 1 / (1 + D), N = v._m;\n            N[0] = b._x * b._x * w + D, N[1] = b._y * b._x * w - b._z, N[2] = b._z * b._x * w + b._y, N[3] = 0, N[4] = b._x * b._y * w + b._z, N[5] = b._y * b._y * w + D, N[6] = b._z * b._y * w - b._x, N[7] = 0, N[8] = b._x * b._z * w - b._y, N[9] = b._y * b._z * w + b._x, N[10] = b._z * b._z * w + D, N[11] = 0, N[12] = 0, N[13] = 0, N[14] = 0, N[15] = 1, v._markAsUpdated();\n          }, g.RotationYawPitchRoll = function(l, h, v) {\n            var b = new g();\n            return g.RotationYawPitchRollToRef(l, h, v, b), b;\n          }, g.RotationYawPitchRollToRef = function(l, h, v, b) {\n            c.RotationYawPitchRollToRef(l, h, v, S.Quaternion[0]), S.Quaternion[0].toRotationMatrix(b);\n          }, g.Scaling = function(l, h, v) {\n            var b = new g();\n            return g.ScalingToRef(l, h, v, b), b;\n          }, g.ScalingToRef = function(l, h, v, b) {\n            g.FromValuesToRef(l, 0, 0, 0, 0, h, 0, 0, 0, 0, v, 0, 0, 0, 0, 1, b), b._updateIdentityStatus(l === 1 && h === 1 && v === 1);\n          }, g.Translation = function(l, h, v) {\n            var b = new g();\n            return g.TranslationToRef(l, h, v, b), b;\n          }, g.TranslationToRef = function(l, h, v, b) {\n            g.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, l, h, v, 1, b), b._updateIdentityStatus(l === 0 && h === 0 && v === 0);\n          }, g.Lerp = function(l, h, v) {\n            var b = new g();\n            return g.LerpToRef(l, h, v, b), b;\n          }, g.LerpToRef = function(l, h, v, b) {\n            for (var D = b._m, w = l.m, N = h.m, M = 0; M < 16; M++)\n              D[M] = w[M] * (1 - v) + N[M] * v;\n            b._markAsUpdated();\n          }, g.DecomposeLerp = function(l, h, v) {\n            var b = new g();\n            return g.DecomposeLerpToRef(l, h, v, b), b;\n          }, g.DecomposeLerpToRef = function(l, h, v, b) {\n            var D = S.Vector3[0], w = S.Quaternion[0], N = S.Vector3[1];\n            l.decompose(D, w, N);\n            var M = S.Vector3[2], U = S.Quaternion[1], X = S.Vector3[3];\n            h.decompose(M, U, X);\n            var j = S.Vector3[4];\n            x.LerpToRef(D, M, v, j);\n            var ne = S.Quaternion[2];\n            c.SlerpToRef(w, U, v, ne);\n            var te = S.Vector3[5];\n            x.LerpToRef(N, X, v, te), g.ComposeToRef(j, ne, te, b);\n          }, g.LookAtLH = function(l, h, v) {\n            var b = new g();\n            return g.LookAtLHToRef(l, h, v, b), b;\n          }, g.LookAtLHToRef = function(l, h, v, b) {\n            var D = S.Vector3[0], w = S.Vector3[1], N = S.Vector3[2];\n            h.subtractToRef(l, N), N.normalize(), x.CrossToRef(v, N, D);\n            var M = D.lengthSquared();\n            M === 0 ? D.x = 1 : D.normalizeFromLength(Math.sqrt(M)), x.CrossToRef(N, D, w), w.normalize();\n            var U = -x.Dot(D, l), X = -x.Dot(w, l), j = -x.Dot(N, l);\n            g.FromValuesToRef(D._x, w._x, N._x, 0, D._y, w._y, N._y, 0, D._z, w._z, N._z, 0, U, X, j, 1, b);\n          }, g.LookAtRH = function(l, h, v) {\n            var b = new g();\n            return g.LookAtRHToRef(l, h, v, b), b;\n          }, g.LookAtRHToRef = function(l, h, v, b) {\n            var D = S.Vector3[0], w = S.Vector3[1], N = S.Vector3[2];\n            l.subtractToRef(h, N), N.normalize(), x.CrossToRef(v, N, D);\n            var M = D.lengthSquared();\n            M === 0 ? D.x = 1 : D.normalizeFromLength(Math.sqrt(M)), x.CrossToRef(N, D, w), w.normalize();\n            var U = -x.Dot(D, l), X = -x.Dot(w, l), j = -x.Dot(N, l);\n            g.FromValuesToRef(D._x, w._x, N._x, 0, D._y, w._y, N._y, 0, D._z, w._z, N._z, 0, U, X, j, 1, b);\n          }, g.OrthoLH = function(l, h, v, b) {\n            var D = new g();\n            return g.OrthoLHToRef(l, h, v, b, D), D;\n          }, g.OrthoLHToRef = function(l, h, v, b, D) {\n            var w = 2 / l, N = 2 / h, M = 2 / (b - v), U = -(b + v) / (b - v);\n            g.FromValuesToRef(w, 0, 0, 0, 0, N, 0, 0, 0, 0, M, 0, 0, 0, U, 1, D), D._updateIdentityStatus(w === 1 && N === 1 && M === 1 && U === 0);\n          }, g.OrthoOffCenterLH = function(l, h, v, b, D, w) {\n            var N = new g();\n            return g.OrthoOffCenterLHToRef(l, h, v, b, D, w, N), N;\n          }, g.OrthoOffCenterLHToRef = function(l, h, v, b, D, w, N) {\n            var M = 2 / (h - l), U = 2 / (b - v), X = 2 / (w - D), j = -(w + D) / (w - D), ne = (l + h) / (l - h), te = (b + v) / (v - b);\n            g.FromValuesToRef(M, 0, 0, 0, 0, U, 0, 0, 0, 0, X, 0, ne, te, j, 1, N), N._markAsUpdated();\n          }, g.OrthoOffCenterRH = function(l, h, v, b, D, w) {\n            var N = new g();\n            return g.OrthoOffCenterRHToRef(l, h, v, b, D, w, N), N;\n          }, g.OrthoOffCenterRHToRef = function(l, h, v, b, D, w, N) {\n            g.OrthoOffCenterLHToRef(l, h, v, b, D, w, N), N._m[10] *= -1;\n          }, g.PerspectiveLH = function(l, h, v, b) {\n            var D = new g(), w = 2 * v / l, N = 2 * v / h, M = (b + v) / (b - v), U = -2 * b * v / (b - v);\n            return g.FromValuesToRef(w, 0, 0, 0, 0, N, 0, 0, 0, 0, M, 1, 0, 0, U, 0, D), D._updateIdentityStatus(!1), D;\n          }, g.PerspectiveFovLH = function(l, h, v, b) {\n            var D = new g();\n            return g.PerspectiveFovLHToRef(l, h, v, b, D), D;\n          }, g.PerspectiveFovLHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = v, M = b, U = 1 / Math.tan(0.5 * l), X = w ? U / h : U, j = w ? U : U * h, ne = (M + N) / (M - N), te = -2 * M * N / (M - N);\n            g.FromValuesToRef(X, 0, 0, 0, 0, j, 0, 0, 0, 0, ne, 1, 0, 0, te, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovReverseLHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = 1 / Math.tan(0.5 * l), M = w ? N / h : N, U = w ? N : N * h;\n            g.FromValuesToRef(M, 0, 0, 0, 0, U, 0, 0, 0, 0, -v, 1, 0, 0, 1, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovRH = function(l, h, v, b) {\n            var D = new g();\n            return g.PerspectiveFovRHToRef(l, h, v, b, D), D;\n          }, g.PerspectiveFovRHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = v, M = b, U = 1 / Math.tan(0.5 * l), X = w ? U / h : U, j = w ? U : U * h, ne = -(M + N) / (M - N), te = -2 * M * N / (M - N);\n            g.FromValuesToRef(X, 0, 0, 0, 0, j, 0, 0, 0, 0, ne, -1, 0, 0, te, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovReverseRHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = 1 / Math.tan(0.5 * l), M = w ? N / h : N, U = w ? N : N * h;\n            g.FromValuesToRef(M, 0, 0, 0, 0, U, 0, 0, 0, 0, -v, -1, 0, 0, -1, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovWebVRToRef = function(l, h, v, b, D) {\n            D === void 0 && (D = !1);\n            var w = D ? -1 : 1, N = Math.tan(l.upDegrees * Math.PI / 180), M = Math.tan(l.downDegrees * Math.PI / 180), U = Math.tan(l.leftDegrees * Math.PI / 180), X = Math.tan(l.rightDegrees * Math.PI / 180), j = 2 / (U + X), ne = 2 / (N + M), te = b._m;\n            te[0] = j, te[1] = te[2] = te[3] = te[4] = 0, te[5] = ne, te[6] = te[7] = 0, te[8] = (U - X) * j * 0.5, te[9] = -(N - M) * ne * 0.5, te[10] = -v / (h - v), te[11] = 1 * w, te[12] = te[13] = te[15] = 0, te[14] = -2 * v * h / (v - h), b._markAsUpdated();\n          }, g.GetFinalMatrix = function(l, h, v, b, D, w) {\n            var N = l.width, M = l.height, U = l.x, X = l.y, j = g.FromValues(N / 2, 0, 0, 0, 0, -M / 2, 0, 0, 0, 0, w - D, 0, U + N / 2, M / 2 + X, D, 1), ne = S.Matrix[0];\n            return h.multiplyToRef(v, ne), ne.multiplyToRef(b, ne), ne.multiply(j);\n          }, g.GetAsMatrix2x2 = function(l) {\n            var h = l.m, v = [h[0], h[1], h[4], h[5]];\n            return I.a.MatrixUse64Bits ? v : new Float32Array(v);\n          }, g.GetAsMatrix3x3 = function(l) {\n            var h = l.m, v = [h[0], h[1], h[2], h[4], h[5], h[6], h[8], h[9], h[10]];\n            return I.a.MatrixUse64Bits ? v : new Float32Array(v);\n          }, g.Transpose = function(l) {\n            var h = new g();\n            return g.TransposeToRef(l, h), h;\n          }, g.TransposeToRef = function(l, h) {\n            var v = h._m, b = l.m;\n            v[0] = b[0], v[1] = b[4], v[2] = b[8], v[3] = b[12], v[4] = b[1], v[5] = b[5], v[6] = b[9], v[7] = b[13], v[8] = b[2], v[9] = b[6], v[10] = b[10], v[11] = b[14], v[12] = b[3], v[13] = b[7], v[14] = b[11], v[15] = b[15], h._updateIdentityStatus(l._isIdentity, l._isIdentityDirty);\n          }, g.Reflection = function(l) {\n            var h = new g();\n            return g.ReflectionToRef(l, h), h;\n          }, g.ReflectionToRef = function(l, h) {\n            l.normalize();\n            var v = l.normal.x, b = l.normal.y, D = l.normal.z, w = -2 * v, N = -2 * b, M = -2 * D;\n            g.FromValuesToRef(w * v + 1, N * v, M * v, 0, w * b, N * b + 1, M * b, 0, w * D, N * D, M * D + 1, 0, w * l.d, N * l.d, M * l.d, 1, h);\n          }, g.FromXYZAxesToRef = function(l, h, v, b) {\n            g.FromValuesToRef(l._x, l._y, l._z, 0, h._x, h._y, h._z, 0, v._x, v._y, v._z, 0, 0, 0, 0, 1, b);\n          }, g.FromQuaternionToRef = function(l, h) {\n            var v = l._x * l._x, b = l._y * l._y, D = l._z * l._z, w = l._x * l._y, N = l._z * l._w, M = l._z * l._x, U = l._y * l._w, X = l._y * l._z, j = l._x * l._w;\n            h._m[0] = 1 - 2 * (b + D), h._m[1] = 2 * (w + N), h._m[2] = 2 * (M - U), h._m[3] = 0, h._m[4] = 2 * (w - N), h._m[5] = 1 - 2 * (D + v), h._m[6] = 2 * (X + j), h._m[7] = 0, h._m[8] = 2 * (M + U), h._m[9] = 2 * (X - j), h._m[10] = 1 - 2 * (b + v), h._m[11] = 0, h._m[12] = 0, h._m[13] = 0, h._m[14] = 0, h._m[15] = 1, h._markAsUpdated();\n          }, g._updateFlagSeed = 0, g._identityReadOnly = g.Identity(), g;\n        }(), S = function() {\n          function g() {\n          }\n          return g.Vector3 = C.a.BuildArray(6, x.Zero), g.Matrix = C.a.BuildArray(2, T.Identity), g.Quaternion = C.a.BuildArray(3, c.Zero), g;\n        }(), E = function() {\n          function g() {\n          }\n          return g.Vector2 = C.a.BuildArray(3, O.Zero), g.Vector3 = C.a.BuildArray(13, x.Zero), g.Vector4 = C.a.BuildArray(3, m.Zero), g.Quaternion = C.a.BuildArray(2, c.Zero), g.Matrix = C.a.BuildArray(8, T.Identity), g;\n        }();\n        u.a.RegisteredTypes[\"BABYLON.Vector2\"] = O, u.a.RegisteredTypes[\"BABYLON.Vector3\"] = x, u.a.RegisteredTypes[\"BABYLON.Vector4\"] = m, u.a.RegisteredTypes[\"BABYLON.Matrix\"] = T;\n      }, function(Be, A, f) {\n        f.d(A, \"d\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        }), f.d(A, \"b\", function() {\n          return I;\n        }), f.d(A, \"e\", function() {\n          return O;\n        }), f.d(A, \"f\", function() {\n          return x;\n        });\n        /*! *****************************************************************************\n        \t\tCopyright (c) Microsoft Corporation.\n        \n        \t\tPermission to use, copy, modify, and/or distribute this software for any\n        \t\tpurpose with or without fee is hereby granted.\n        \n        \t\tTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n        \t\tREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n        \t\tAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n        \t\tINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n        \t\tLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n        \t\tOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n        \t\tPERFORMANCE OF THIS SOFTWARE.\n        \t\t***************************************************************************** */\n        var V = function(m, c) {\n          return (V = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(T, S) {\n            T.__proto__ = S;\n          } || function(T, S) {\n            for (var E in S)\n              Object.prototype.hasOwnProperty.call(S, E) && (T[E] = S[E]);\n          })(m, c);\n        };\n        function _(m, c) {\n          if (typeof c != \"function\" && c !== null)\n            throw new TypeError(\"Class extends value \" + String(c) + \" is not a constructor or null\");\n          function T() {\n            this.constructor = m;\n          }\n          V(m, c), m.prototype = c === null ? Object.create(c) : (T.prototype = c.prototype, new T());\n        }\n        var C = function() {\n          return (C = Object.assign || function(m) {\n            for (var c, T = 1, S = arguments.length; T < S; T++)\n              for (var E in c = arguments[T])\n                Object.prototype.hasOwnProperty.call(c, E) && (m[E] = c[E]);\n            return m;\n          }).apply(this, arguments);\n        };\n        function u(m, c, T, S) {\n          var E, g = arguments.length, l = g < 3 ? c : S === null ? S = Object.getOwnPropertyDescriptor(c, T) : S;\n          if (typeof Reflect == \"object\" && typeof Reflect.decorate == \"function\")\n            l = Reflect.decorate(m, c, T, S);\n          else\n            for (var h = m.length - 1; h >= 0; h--)\n              (E = m[h]) && (l = (g < 3 ? E(l) : g > 3 ? E(c, T, l) : E(c, T)) || l);\n          return g > 3 && l && Object.defineProperty(c, T, l), l;\n        }\n        function I(m, c, T, S) {\n          return new (T || (T = Promise))(function(E, g) {\n            function l(b) {\n              try {\n                v(S.next(b));\n              } catch (D) {\n                g(D);\n              }\n            }\n            function h(b) {\n              try {\n                v(S.throw(b));\n              } catch (D) {\n                g(D);\n              }\n            }\n            function v(b) {\n              var D;\n              b.done ? E(b.value) : (D = b.value, D instanceof T ? D : new T(function(w) {\n                w(D);\n              })).then(l, h);\n            }\n            v((S = S.apply(m, c || [])).next());\n          });\n        }\n        function O(m, c) {\n          var T, S, E, g, l = { label: 0, sent: function() {\n            if (1 & E[0])\n              throw E[1];\n            return E[1];\n          }, trys: [], ops: [] };\n          return g = { next: h(0), throw: h(1), return: h(2) }, typeof Symbol == \"function\" && (g[Symbol.iterator] = function() {\n            return this;\n          }), g;\n          function h(v) {\n            return function(b) {\n              return function(D) {\n                if (T)\n                  throw new TypeError(\"Generator is already executing.\");\n                for (; l; )\n                  try {\n                    if (T = 1, S && (E = 2 & D[0] ? S.return : D[0] ? S.throw || ((E = S.return) && E.call(S), 0) : S.next) && !(E = E.call(S, D[1])).done)\n                      return E;\n                    switch (S = 0, E && (D = [2 & D[0], E.value]), D[0]) {\n                      case 0:\n                      case 1:\n                        E = D;\n                        break;\n                      case 4:\n                        return l.label++, { value: D[1], done: !1 };\n                      case 5:\n                        l.label++, S = D[1], D = [0];\n                        continue;\n                      case 7:\n                        D = l.ops.pop(), l.trys.pop();\n                        continue;\n                      default:\n                        if (E = l.trys, !((E = E.length > 0 && E[E.length - 1]) || D[0] !== 6 && D[0] !== 2)) {\n                          l = 0;\n                          continue;\n                        }\n                        if (D[0] === 3 && (!E || D[1] > E[0] && D[1] < E[3])) {\n                          l.label = D[1];\n                          break;\n                        }\n                        if (D[0] === 6 && l.label < E[1]) {\n                          l.label = E[1], E = D;\n                          break;\n                        }\n                        if (E && l.label < E[2]) {\n                          l.label = E[2], l.ops.push(D);\n                          break;\n                        }\n                        E[2] && l.ops.pop(), l.trys.pop();\n                        continue;\n                    }\n                    D = c.call(m, l);\n                  } catch (w) {\n                    D = [6, w], S = 0;\n                  } finally {\n                    T = E = 0;\n                  }\n                if (5 & D[0])\n                  throw D[1];\n                return { value: D[0] ? D[1] : void 0, done: !0 };\n              }([v, b]);\n            };\n          }\n        }\n        function x() {\n          for (var m = 0, c = 0, T = arguments.length; c < T; c++)\n            m += arguments[c].length;\n          var S = Array(m), E = 0;\n          for (c = 0; c < T; c++)\n            for (var g = arguments[c], l = 0, h = g.length; l < h; l++, E++)\n              S[E] = g[l];\n          return S;\n        }\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.ALPHA_DISABLE = 0, _.ALPHA_ADD = 1, _.ALPHA_COMBINE = 2, _.ALPHA_SUBTRACT = 3, _.ALPHA_MULTIPLY = 4, _.ALPHA_MAXIMIZED = 5, _.ALPHA_ONEONE = 6, _.ALPHA_PREMULTIPLIED = 7, _.ALPHA_PREMULTIPLIED_PORTERDUFF = 8, _.ALPHA_INTERPOLATE = 9, _.ALPHA_SCREENMODE = 10, _.ALPHA_ONEONE_ONEONE = 11, _.ALPHA_ALPHATOCOLOR = 12, _.ALPHA_REVERSEONEMINUS = 13, _.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14, _.ALPHA_ONEONE_ONEZERO = 15, _.ALPHA_EXCLUSION = 16, _.ALPHA_EQUATION_ADD = 0, _.ALPHA_EQUATION_SUBSTRACT = 1, _.ALPHA_EQUATION_REVERSE_SUBTRACT = 2, _.ALPHA_EQUATION_MAX = 3, _.ALPHA_EQUATION_MIN = 4, _.ALPHA_EQUATION_DARKEN = 5, _.DELAYLOADSTATE_NONE = 0, _.DELAYLOADSTATE_LOADED = 1, _.DELAYLOADSTATE_LOADING = 2, _.DELAYLOADSTATE_NOTLOADED = 4, _.NEVER = 512, _.ALWAYS = 519, _.LESS = 513, _.EQUAL = 514, _.LEQUAL = 515, _.GREATER = 516, _.GEQUAL = 518, _.NOTEQUAL = 517, _.KEEP = 7680, _.REPLACE = 7681, _.INCR = 7682, _.DECR = 7683, _.INVERT = 5386, _.INCR_WRAP = 34055, _.DECR_WRAP = 34056, _.TEXTURE_CLAMP_ADDRESSMODE = 0, _.TEXTURE_WRAP_ADDRESSMODE = 1, _.TEXTURE_MIRROR_ADDRESSMODE = 2, _.TEXTUREFORMAT_ALPHA = 0, _.TEXTUREFORMAT_LUMINANCE = 1, _.TEXTUREFORMAT_LUMINANCE_ALPHA = 2, _.TEXTUREFORMAT_RGB = 4, _.TEXTUREFORMAT_RGBA = 5, _.TEXTUREFORMAT_RED = 6, _.TEXTUREFORMAT_R = 6, _.TEXTUREFORMAT_RG = 7, _.TEXTUREFORMAT_RED_INTEGER = 8, _.TEXTUREFORMAT_R_INTEGER = 8, _.TEXTUREFORMAT_RG_INTEGER = 9, _.TEXTUREFORMAT_RGB_INTEGER = 10, _.TEXTUREFORMAT_RGBA_INTEGER = 11, _.TEXTURETYPE_UNSIGNED_BYTE = 0, _.TEXTURETYPE_UNSIGNED_INT = 0, _.TEXTURETYPE_FLOAT = 1, _.TEXTURETYPE_HALF_FLOAT = 2, _.TEXTURETYPE_BYTE = 3, _.TEXTURETYPE_SHORT = 4, _.TEXTURETYPE_UNSIGNED_SHORT = 5, _.TEXTURETYPE_INT = 6, _.TEXTURETYPE_UNSIGNED_INTEGER = 7, _.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8, _.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9, _.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10, _.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11, _.TEXTURETYPE_UNSIGNED_INT_24_8 = 12, _.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13, _.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14, _.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15, _.TEXTURE_NEAREST_SAMPLINGMODE = 1, _.TEXTURE_NEAREST_NEAREST = 1, _.TEXTURE_BILINEAR_SAMPLINGMODE = 2, _.TEXTURE_LINEAR_LINEAR = 2, _.TEXTURE_TRILINEAR_SAMPLINGMODE = 3, _.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3, _.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4, _.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5, _.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6, _.TEXTURE_NEAREST_LINEAR = 7, _.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8, _.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9, _.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10, _.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11, _.TEXTURE_LINEAR_NEAREST = 12, _.TEXTURE_EXPLICIT_MODE = 0, _.TEXTURE_SPHERICAL_MODE = 1, _.TEXTURE_PLANAR_MODE = 2, _.TEXTURE_CUBIC_MODE = 3, _.TEXTURE_PROJECTION_MODE = 4, _.TEXTURE_SKYBOX_MODE = 5, _.TEXTURE_INVCUBIC_MODE = 6, _.TEXTURE_EQUIRECTANGULAR_MODE = 7, _.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8, _.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9, _.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096, _.TEXTURE_FILTERING_QUALITY_HIGH = 64, _.TEXTURE_FILTERING_QUALITY_MEDIUM = 16, _.TEXTURE_FILTERING_QUALITY_LOW = 8, _.SCALEMODE_FLOOR = 1, _.SCALEMODE_NEAREST = 2, _.SCALEMODE_CEILING = 3, _.MATERIAL_TextureDirtyFlag = 1, _.MATERIAL_LightDirtyFlag = 2, _.MATERIAL_FresnelDirtyFlag = 4, _.MATERIAL_AttributesDirtyFlag = 8, _.MATERIAL_MiscDirtyFlag = 16, _.MATERIAL_PrePassDirtyFlag = 32, _.MATERIAL_AllDirtyFlag = 63, _.MATERIAL_TriangleFillMode = 0, _.MATERIAL_WireFrameFillMode = 1, _.MATERIAL_PointFillMode = 2, _.MATERIAL_PointListDrawMode = 3, _.MATERIAL_LineListDrawMode = 4, _.MATERIAL_LineLoopDrawMode = 5, _.MATERIAL_LineStripDrawMode = 6, _.MATERIAL_TriangleStripDrawMode = 7, _.MATERIAL_TriangleFanDrawMode = 8, _.MATERIAL_ClockWiseSideOrientation = 0, _.MATERIAL_CounterClockWiseSideOrientation = 1, _.ACTION_NothingTrigger = 0, _.ACTION_OnPickTrigger = 1, _.ACTION_OnLeftPickTrigger = 2, _.ACTION_OnRightPickTrigger = 3, _.ACTION_OnCenterPickTrigger = 4, _.ACTION_OnPickDownTrigger = 5, _.ACTION_OnDoublePickTrigger = 6, _.ACTION_OnPickUpTrigger = 7, _.ACTION_OnPickOutTrigger = 16, _.ACTION_OnLongPressTrigger = 8, _.ACTION_OnPointerOverTrigger = 9, _.ACTION_OnPointerOutTrigger = 10, _.ACTION_OnEveryFrameTrigger = 11, _.ACTION_OnIntersectionEnterTrigger = 12, _.ACTION_OnIntersectionExitTrigger = 13, _.ACTION_OnKeyDownTrigger = 14, _.ACTION_OnKeyUpTrigger = 15, _.PARTICLES_BILLBOARDMODE_Y = 2, _.PARTICLES_BILLBOARDMODE_ALL = 7, _.PARTICLES_BILLBOARDMODE_STRETCHED = 8, _.MESHES_CULLINGSTRATEGY_STANDARD = 0, _.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1, _.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2, _.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3, _.SCENELOADER_NO_LOGGING = 0, _.SCENELOADER_MINIMAL_LOGGING = 1, _.SCENELOADER_SUMMARY_LOGGING = 2, _.SCENELOADER_DETAILED_LOGGING = 3, _.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0, _.PREPASS_POSITION_TEXTURE_TYPE = 1, _.PREPASS_VELOCITY_TEXTURE_TYPE = 2, _.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3, _.PREPASS_COLOR_TEXTURE_TYPE = 4, _.PREPASS_DEPTHNORMAL_TEXTURE_TYPE = 5, _.PREPASS_ALBEDO_TEXTURE_TYPE = 6, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return T;\n        }), f.d(A, \"c\", function() {\n          return S;\n        }), f.d(A, \"m\", function() {\n          return E;\n        }), f.d(A, \"e\", function() {\n          return g;\n        }), f.d(A, \"h\", function() {\n          return l;\n        }), f.d(A, \"n\", function() {\n          return h;\n        }), f.d(A, \"o\", function() {\n          return v;\n        }), f.d(A, \"k\", function() {\n          return b;\n        }), f.d(A, \"g\", function() {\n          return D;\n        }), f.d(A, \"f\", function() {\n          return w;\n        }), f.d(A, \"i\", function() {\n          return N;\n        }), f.d(A, \"l\", function() {\n          return M;\n        }), f.d(A, \"j\", function() {\n          return U;\n        }), f.d(A, \"d\", function() {\n          return X;\n        }), f.d(A, \"a\", function() {\n          return j;\n        });\n        var V = f(37), _ = f(0), C = f(21), u = f(9), I = {}, O = {}, x = function(ne, te, de) {\n          var pe = ne();\n          V.a && V.a.AddTagsTo(pe, te.tags);\n          var ae = m(pe);\n          for (var ee in ae) {\n            var K = ae[ee], $ = te[ee], L = K.type;\n            if ($ != null && ee !== \"uniqueId\")\n              switch (L) {\n                case 0:\n                case 6:\n                case 11:\n                  pe[ee] = $;\n                  break;\n                case 1:\n                  pe[ee] = de || $.isRenderTarget ? $ : $.clone();\n                  break;\n                case 2:\n                case 3:\n                case 4:\n                case 5:\n                case 7:\n                case 10:\n                case 12:\n                  pe[ee] = de ? $ : $.clone();\n              }\n          }\n          return pe;\n        };\n        function m(ne) {\n          var te = ne.getClassName();\n          if (O[te])\n            return O[te];\n          O[te] = {};\n          for (var de = O[te], pe = ne, ae = te; ae; ) {\n            var ee = I[ae];\n            for (var K in ee)\n              de[K] = ee[K];\n            var $ = void 0, L = !1;\n            do {\n              if (!($ = Object.getPrototypeOf(pe)).getClassName) {\n                L = !0;\n                break;\n              }\n              if ($.getClassName() !== ae)\n                break;\n              pe = $;\n            } while ($);\n            if (L)\n              break;\n            ae = $.getClassName(), pe = $;\n          }\n          return de;\n        }\n        function c(ne, te) {\n          return function(de, pe) {\n            var ae = function(ee) {\n              var K = ee.getClassName();\n              return I[K] || (I[K] = {}), I[K];\n            }(de);\n            ae[pe] || (ae[pe] = { type: ne, sourceName: te });\n          };\n        }\n        function T(ne, te) {\n          return te === void 0 && (te = null), function(de, pe) {\n            return pe === void 0 && (pe = null), function(ae, ee) {\n              var K = pe || \"_\" + ee;\n              Object.defineProperty(ae, ee, { get: function() {\n                return this[K];\n              }, set: function($) {\n                this[K] !== $ && (this[K] = $, ae[de].apply(this));\n              }, enumerable: !0, configurable: !0 });\n            };\n          }(ne, te);\n        }\n        function S(ne) {\n          return c(0, ne);\n        }\n        function E(ne) {\n          return c(1, ne);\n        }\n        function g(ne) {\n          return c(2, ne);\n        }\n        function l(ne) {\n          return c(3, ne);\n        }\n        function h(ne) {\n          return c(4, ne);\n        }\n        function v(ne) {\n          return c(5, ne);\n        }\n        function b(ne) {\n          return c(6, ne);\n        }\n        function D(ne) {\n          return c(7, ne);\n        }\n        function w(ne) {\n          return c(8, ne);\n        }\n        function N(ne) {\n          return c(9, ne);\n        }\n        function M(ne) {\n          return c(10, ne);\n        }\n        function U(ne) {\n          return c(12, ne);\n        }\n        function X(ne) {\n          return c(11, ne);\n        }\n        var j = function() {\n          function ne() {\n          }\n          return ne.AppendSerializedAnimations = function(te, de) {\n            if (te.animations) {\n              de.animations = [];\n              for (var pe = 0; pe < te.animations.length; pe++) {\n                var ae = te.animations[pe];\n                de.animations.push(ae.serialize());\n              }\n            }\n          }, ne.Serialize = function(te, de) {\n            de || (de = {}), V.a && (de.tags = V.a.GetTags(te));\n            var pe = m(te);\n            for (var ae in pe) {\n              var ee = pe[ae], K = ee.sourceName || ae, $ = ee.type, L = te[ae];\n              if (L != null && ae !== \"uniqueId\")\n                switch ($) {\n                  case 0:\n                    de[K] = L;\n                    break;\n                  case 1:\n                    de[K] = L.serialize();\n                    break;\n                  case 2:\n                    de[K] = L.asArray();\n                    break;\n                  case 3:\n                    de[K] = L.serialize();\n                    break;\n                  case 4:\n                  case 5:\n                    de[K] = L.asArray();\n                    break;\n                  case 6:\n                    de[K] = L.id;\n                    break;\n                  case 7:\n                    de[K] = L.serialize();\n                    break;\n                  case 8:\n                    de[K] = L.asArray();\n                    break;\n                  case 9:\n                    de[K] = L.serialize();\n                    break;\n                  case 10:\n                    de[K] = L.asArray();\n                    break;\n                  case 11:\n                    de[K] = L.id;\n                  case 12:\n                    de[K] = L.asArray();\n                }\n            }\n            return de;\n          }, ne.Parse = function(te, de, pe, ae) {\n            ae === void 0 && (ae = null);\n            var ee = te();\n            ae || (ae = \"\"), V.a && V.a.AddTagsTo(ee, de.tags);\n            var K = m(ee);\n            for (var $ in K) {\n              var L = K[$], G = de[L.sourceName || $], Q = L.type;\n              if (G != null && $ !== \"uniqueId\") {\n                var oe = ee;\n                switch (Q) {\n                  case 0:\n                    oe[$] = G;\n                    break;\n                  case 1:\n                    pe && (oe[$] = ne._TextureParser(G, pe, ae));\n                    break;\n                  case 2:\n                    oe[$] = u.a.FromArray(G);\n                    break;\n                  case 3:\n                    oe[$] = ne._FresnelParametersParser(G);\n                    break;\n                  case 4:\n                    oe[$] = _.d.FromArray(G);\n                    break;\n                  case 5:\n                    oe[$] = _.e.FromArray(G);\n                    break;\n                  case 6:\n                    pe && (oe[$] = pe.getLastMeshByID(G));\n                    break;\n                  case 7:\n                    oe[$] = ne._ColorCurvesParser(G);\n                    break;\n                  case 8:\n                    oe[$] = u.b.FromArray(G);\n                    break;\n                  case 9:\n                    oe[$] = ne._ImageProcessingConfigurationParser(G);\n                    break;\n                  case 10:\n                    oe[$] = _.b.FromArray(G);\n                    break;\n                  case 11:\n                    pe && (oe[$] = pe.getCameraByID(G));\n                  case 12:\n                    oe[$] = _.a.FromArray(G);\n                }\n              }\n            }\n            return ee;\n          }, ne.Clone = function(te, de) {\n            return x(te, de, !1);\n          }, ne.Instanciate = function(te, de) {\n            return x(te, de, !0);\n          }, ne._ImageProcessingConfigurationParser = function(te) {\n            throw C.a.WarnImport(\"ImageProcessingConfiguration\");\n          }, ne._FresnelParametersParser = function(te) {\n            throw C.a.WarnImport(\"FresnelParameters\");\n          }, ne._ColorCurvesParser = function(te) {\n            throw C.a.WarnImport(\"ColorCurves\");\n          }, ne._TextureParser = function(te, de, pe) {\n            throw C.a.WarnImport(\"Texture\");\n          }, ne;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        }), f.d(A, \"b\", function() {\n          return _;\n        });\n        var V = function() {\n          function C(u, I, O, x, m, c, T, S) {\n            x === void 0 && (x = 0), m === void 0 && (m = !1), c === void 0 && (c = !1), T === void 0 && (T = !1), this._isAlreadyOwned = !1, u.getScene ? this._engine = u.getScene().getEngine() : this._engine = u, this._updatable = O, this._instanced = c, this._divisor = S || 1, this._data = I, this.byteStride = T ? x : x * Float32Array.BYTES_PER_ELEMENT, m || this.create();\n          }\n          return C.prototype.createVertexBuffer = function(u, I, O, x, m, c, T) {\n            c === void 0 && (c = !1);\n            var S = c ? I : I * Float32Array.BYTES_PER_ELEMENT, E = x ? c ? x : x * Float32Array.BYTES_PER_ELEMENT : this.byteStride;\n            return new _(this._engine, this, u, this._updatable, !0, E, m === void 0 ? this._instanced : m, S, O, void 0, void 0, !0, this._divisor || T);\n          }, C.prototype.isUpdatable = function() {\n            return this._updatable;\n          }, C.prototype.getData = function() {\n            return this._data;\n          }, C.prototype.getBuffer = function() {\n            return this._buffer;\n          }, C.prototype.getStrideSize = function() {\n            return this.byteStride / Float32Array.BYTES_PER_ELEMENT;\n          }, C.prototype.create = function(u) {\n            u === void 0 && (u = null), !u && this._buffer || (u = u || this._data) && (this._buffer ? this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, u), this._data = u) : this._updatable ? (this._buffer = this._engine.createDynamicVertexBuffer(u), this._data = u) : this._buffer = this._engine.createVertexBuffer(u));\n          }, C.prototype._rebuild = function() {\n            this._buffer = null, this.create(this._data);\n          }, C.prototype.update = function(u) {\n            this.create(u);\n          }, C.prototype.updateDirectly = function(u, I, O, x) {\n            x === void 0 && (x = !1), this._buffer && this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, u, x ? I : I * Float32Array.BYTES_PER_ELEMENT, O ? O * this.byteStride : void 0), this._data = null);\n          }, C.prototype._increaseReferences = function() {\n            this._buffer && (this._isAlreadyOwned ? this._buffer.references++ : this._isAlreadyOwned = !0);\n          }, C.prototype.dispose = function() {\n            this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null);\n          }, C;\n        }(), _ = function() {\n          function C(u, I, O, x, m, c, T, S, E, g, l, h, v, b) {\n            if (l === void 0 && (l = !1), h === void 0 && (h = !1), v === void 0 && (v = 1), b === void 0 && (b = !1), I instanceof V ? (this._buffer = I, this._ownsBuffer = b, b && this._buffer._increaseReferences()) : (this._buffer = new V(u, I, x, c, m, T, h), this._ownsBuffer = !0), this._kind = O, g == null) {\n              var D = this.getData();\n              this.type = C.FLOAT, D instanceof Int8Array ? this.type = C.BYTE : D instanceof Uint8Array ? this.type = C.UNSIGNED_BYTE : D instanceof Int16Array ? this.type = C.SHORT : D instanceof Uint16Array ? this.type = C.UNSIGNED_SHORT : D instanceof Int32Array ? this.type = C.INT : D instanceof Uint32Array && (this.type = C.UNSIGNED_INT);\n            } else\n              this.type = g;\n            var w = C.GetTypeByteLength(this.type);\n            h ? (this._size = E || (c ? c / w : C.DeduceStride(O)), this.byteStride = c || this._buffer.byteStride || this._size * w, this.byteOffset = S || 0) : (this._size = E || c || C.DeduceStride(O), this.byteStride = c ? c * w : this._buffer.byteStride || this._size * w, this.byteOffset = (S || 0) * w), this.normalized = l, this._instanced = T !== void 0 && T, this._instanceDivisor = T ? v : 0;\n          }\n          return Object.defineProperty(C.prototype, \"instanceDivisor\", { get: function() {\n            return this._instanceDivisor;\n          }, set: function(u) {\n            this._instanceDivisor = u, this._instanced = u != 0;\n          }, enumerable: !1, configurable: !0 }), C.prototype._rebuild = function() {\n            this._buffer && this._buffer._rebuild();\n          }, C.prototype.getKind = function() {\n            return this._kind;\n          }, C.prototype.isUpdatable = function() {\n            return this._buffer.isUpdatable();\n          }, C.prototype.getData = function() {\n            return this._buffer.getData();\n          }, C.prototype.getBuffer = function() {\n            return this._buffer.getBuffer();\n          }, C.prototype.getStrideSize = function() {\n            return this.byteStride / C.GetTypeByteLength(this.type);\n          }, C.prototype.getOffset = function() {\n            return this.byteOffset / C.GetTypeByteLength(this.type);\n          }, C.prototype.getSize = function() {\n            return this._size;\n          }, C.prototype.getIsInstanced = function() {\n            return this._instanced;\n          }, C.prototype.getInstanceDivisor = function() {\n            return this._instanceDivisor;\n          }, C.prototype.create = function(u) {\n            this._buffer.create(u);\n          }, C.prototype.update = function(u) {\n            this._buffer.update(u);\n          }, C.prototype.updateDirectly = function(u, I, O) {\n            O === void 0 && (O = !1), this._buffer.updateDirectly(u, I, void 0, O);\n          }, C.prototype.dispose = function() {\n            this._ownsBuffer && this._buffer.dispose();\n          }, C.prototype.forEach = function(u, I) {\n            C.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, u, this.normalized, I);\n          }, C.DeduceStride = function(u) {\n            switch (u) {\n              case C.UVKind:\n              case C.UV2Kind:\n              case C.UV3Kind:\n              case C.UV4Kind:\n              case C.UV5Kind:\n              case C.UV6Kind:\n                return 2;\n              case C.NormalKind:\n              case C.PositionKind:\n                return 3;\n              case C.ColorKind:\n              case C.MatricesIndicesKind:\n              case C.MatricesIndicesExtraKind:\n              case C.MatricesWeightsKind:\n              case C.MatricesWeightsExtraKind:\n              case C.TangentKind:\n                return 4;\n              default:\n                throw new Error(\"Invalid kind '\" + u + \"'\");\n            }\n          }, C.GetTypeByteLength = function(u) {\n            switch (u) {\n              case C.BYTE:\n              case C.UNSIGNED_BYTE:\n                return 1;\n              case C.SHORT:\n              case C.UNSIGNED_SHORT:\n                return 2;\n              case C.INT:\n              case C.UNSIGNED_INT:\n              case C.FLOAT:\n                return 4;\n              default:\n                throw new Error(\"Invalid type '\" + u + \"'\");\n            }\n          }, C.ForEach = function(u, I, O, x, m, c, T, S) {\n            if (u instanceof Array)\n              for (var E = I / 4, g = O / 4, l = 0; l < c; l += x) {\n                for (var h = 0; h < x; h++)\n                  S(u[E + h], l + h);\n                E += g;\n              }\n            else {\n              var v = u instanceof ArrayBuffer ? new DataView(u) : new DataView(u.buffer, u.byteOffset, u.byteLength), b = C.GetTypeByteLength(m);\n              for (l = 0; l < c; l += x) {\n                var D = I;\n                for (h = 0; h < x; h++)\n                  S(C._GetFloatValue(v, m, D, T), l + h), D += b;\n                I += O;\n              }\n            }\n          }, C._GetFloatValue = function(u, I, O, x) {\n            switch (I) {\n              case C.BYTE:\n                var m = u.getInt8(O);\n                return x && (m = Math.max(m / 127, -1)), m;\n              case C.UNSIGNED_BYTE:\n                return m = u.getUint8(O), x && (m /= 255), m;\n              case C.SHORT:\n                return m = u.getInt16(O, !0), x && (m = Math.max(m / 32767, -1)), m;\n              case C.UNSIGNED_SHORT:\n                return m = u.getUint16(O, !0), x && (m /= 65535), m;\n              case C.INT:\n                return u.getInt32(O, !0);\n              case C.UNSIGNED_INT:\n                return u.getUint32(O, !0);\n              case C.FLOAT:\n                return u.getFloat32(O, !0);\n              default:\n                throw new Error(\"Invalid component type \" + I);\n            }\n          }, C.BYTE = 5120, C.UNSIGNED_BYTE = 5121, C.SHORT = 5122, C.UNSIGNED_SHORT = 5123, C.INT = 5124, C.UNSIGNED_INT = 5125, C.FLOAT = 5126, C.PositionKind = \"position\", C.NormalKind = \"normal\", C.TangentKind = \"tangent\", C.UVKind = \"uv\", C.UV2Kind = \"uv2\", C.UV3Kind = \"uv3\", C.UV4Kind = \"uv4\", C.UV5Kind = \"uv5\", C.UV6Kind = \"uv6\", C.ColorKind = \"color\", C.MatricesIndicesKind = \"matricesIndices\", C.MatricesWeightsKind = \"matricesWeights\", C.MatricesIndicesExtraKind = \"matricesIndicesExtra\", C.MatricesWeightsExtraKind = \"matricesWeightsExtra\", C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(6), _ = f(2), C = f(38), u = f(8), I = f(128), O = function() {\n          function x(m, c, T, S, E, g, l, h, v, b) {\n            var D, w = this;\n            S === void 0 && (S = null), g === void 0 && (g = null), l === void 0 && (l = null), h === void 0 && (h = null), v === void 0 && (v = null), this.name = null, this.defines = \"\", this.onCompiled = null, this.onError = null, this.onBind = null, this.uniqueId = 0, this.onCompileObservable = new V.c(), this.onErrorObservable = new V.c(), this._onBindObservable = null, this._wasPreviouslyReady = !1, this._bonesComputationForcedToCPU = !1, this._multiTarget = !1, this._uniformBuffersNames = {}, this._samplers = {}, this._isReady = !1, this._compilationError = \"\", this._allFallbacksProcessed = !1, this._uniforms = {}, this._key = \"\", this._fallbacks = null, this._vertexSourceCode = \"\", this._fragmentSourceCode = \"\", this._vertexSourceCodeOverride = \"\", this._fragmentSourceCodeOverride = \"\", this._transformFeedbackVaryings = null, this._rawVertexSourceCode = \"\", this._rawFragmentSourceCode = \"\", this._pipelineContext = null, this._valueCache = {}, this.name = m;\n            var N, M, U = null;\n            if (c.attributes) {\n              var X = c;\n              if (this._engine = T, this._attributesNames = X.attributes, this._uniformsNames = X.uniformsNames.concat(X.samplers), this._samplerList = X.samplers.slice(), this.defines = X.defines, this.onError = X.onError, this.onCompiled = X.onCompiled, this._fallbacks = X.fallbacks, this._indexParameters = X.indexParameters, this._transformFeedbackVaryings = X.transformFeedbackVaryings || null, this._multiTarget = !!X.multiTarget, X.uniformBuffersNames) {\n                this._uniformBuffersNamesList = X.uniformBuffersNames.slice();\n                for (var j = 0; j < X.uniformBuffersNames.length; j++)\n                  this._uniformBuffersNames[X.uniformBuffersNames[j]] = j;\n              }\n              U = (D = X.processFinalCode) !== null && D !== void 0 ? D : null;\n            } else\n              this._engine = E, this.defines = g ?? \"\", this._uniformsNames = T.concat(S), this._samplerList = S ? S.slice() : [], this._attributesNames = c, this._uniformBuffersNamesList = [], this.onError = v, this.onCompiled = h, this._indexParameters = b, this._fallbacks = l;\n            this._attributeLocationByName = {}, this.uniqueId = x._uniqueIdSeed++;\n            var ne = C.a.IsWindowObjectExist() ? this._engine.getHostDocument() : null;\n            m.vertexSource ? N = \"source:\" + m.vertexSource : m.vertexElement ? (N = ne ? ne.getElementById(m.vertexElement) : null) || (N = m.vertexElement) : N = m.vertex || m, m.fragmentSource ? M = \"source:\" + m.fragmentSource : m.fragmentElement ? (M = ne ? ne.getElementById(m.fragmentElement) : null) || (M = m.fragmentElement) : M = m.fragment || m;\n            var te = { defines: this.defines.split(`\n`), indexParameters: this._indexParameters, isFragment: !1, shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader, processor: this._engine._shaderProcessor, supportsUniformBuffers: this._engine.supportsUniformBuffers, shadersRepository: x.ShadersRepository, includesShadersStore: x.IncludesShadersStore, version: (100 * this._engine.webGLVersion).toString(), platformName: this._engine.webGLVersion >= 2 ? \"WEBGL2\" : \"WEBGL1\" };\n            this._loadShader(N, \"Vertex\", \"\", function(de) {\n              w._rawVertexSourceCode = de, w._loadShader(M, \"Fragment\", \"Pixel\", function(pe) {\n                w._rawFragmentSourceCode = pe, I.a.Process(de, te, function(ae) {\n                  U && (ae = U(\"vertex\", ae)), te.isFragment = !0, I.a.Process(pe, te, function(ee) {\n                    U && (ee = U(\"fragment\", ee)), w._useFinalCode(ae, ee, m);\n                  }, w._engine);\n                }, w._engine);\n              });\n            });\n          }\n          return Object.defineProperty(x.prototype, \"onBindObservable\", { get: function() {\n            return this._onBindObservable || (this._onBindObservable = new V.c()), this._onBindObservable;\n          }, enumerable: !1, configurable: !0 }), x.prototype._useFinalCode = function(m, c, T) {\n            if (T) {\n              var S = T.vertexElement || T.vertex || T.spectorName || T, E = T.fragmentElement || T.fragment || T.spectorName || T;\n              this._vertexSourceCode = \"#define SHADER_NAME vertex:\" + S + `\n` + m, this._fragmentSourceCode = \"#define SHADER_NAME fragment:\" + E + `\n` + c;\n            } else\n              this._vertexSourceCode = m, this._fragmentSourceCode = c;\n            this._prepareEffect();\n          }, Object.defineProperty(x.prototype, \"key\", { get: function() {\n            return this._key;\n          }, enumerable: !1, configurable: !0 }), x.prototype.isReady = function() {\n            try {\n              return this._isReadyInternal();\n            } catch {\n              return !1;\n            }\n          }, x.prototype._isReadyInternal = function() {\n            return !!this._isReady || !!this._pipelineContext && this._pipelineContext.isReady;\n          }, x.prototype.getEngine = function() {\n            return this._engine;\n          }, x.prototype.getPipelineContext = function() {\n            return this._pipelineContext;\n          }, x.prototype.getAttributesNames = function() {\n            return this._attributesNames;\n          }, x.prototype.getAttributeLocation = function(m) {\n            return this._attributes[m];\n          }, x.prototype.getAttributeLocationByName = function(m) {\n            return this._attributeLocationByName[m];\n          }, x.prototype.getAttributesCount = function() {\n            return this._attributes.length;\n          }, x.prototype.getUniformIndex = function(m) {\n            return this._uniformsNames.indexOf(m);\n          }, x.prototype.getUniform = function(m) {\n            return this._uniforms[m];\n          }, x.prototype.getSamplers = function() {\n            return this._samplerList;\n          }, x.prototype.getUniformNames = function() {\n            return this._uniformsNames;\n          }, x.prototype.getUniformBuffersNames = function() {\n            return this._uniformBuffersNamesList;\n          }, x.prototype.getIndexParameters = function() {\n            return this._indexParameters;\n          }, x.prototype.getCompilationError = function() {\n            return this._compilationError;\n          }, x.prototype.allFallbacksProcessed = function() {\n            return this._allFallbacksProcessed;\n          }, x.prototype.executeWhenCompiled = function(m) {\n            var c = this;\n            this.isReady() ? m(this) : (this.onCompileObservable.add(function(T) {\n              m(T);\n            }), this._pipelineContext && !this._pipelineContext.isAsync || setTimeout(function() {\n              c._checkIsReady(null);\n            }, 16));\n          }, x.prototype._checkIsReady = function(m) {\n            var c = this;\n            try {\n              if (this._isReadyInternal())\n                return;\n            } catch (T) {\n              return void this._processCompilationErrors(T, m);\n            }\n            setTimeout(function() {\n              c._checkIsReady(m);\n            }, 16);\n          }, x.prototype._loadShader = function(m, c, T, S) {\n            var E;\n            if (typeof HTMLElement < \"u\" && m instanceof HTMLElement)\n              return void S(C.a.GetDOMTextContent(m));\n            m.substr(0, 7) !== \"source:\" ? m.substr(0, 7) !== \"base64:\" ? x.ShadersStore[m + c + \"Shader\"] ? S(x.ShadersStore[m + c + \"Shader\"]) : T && x.ShadersStore[m + T + \"Shader\"] ? S(x.ShadersStore[m + T + \"Shader\"]) : (E = m[0] === \".\" || m[0] === \"/\" || m.indexOf(\"http\") > -1 ? m : x.ShadersRepository + m, this._engine._loadFile(E + \".\" + c.toLowerCase() + \".fx\", S)) : S(window.atob(m.substr(7))) : S(m.substr(7));\n          }, Object.defineProperty(x.prototype, \"vertexSourceCode\", { get: function() {\n            return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._vertexSourceCodeOverride : this._vertexSourceCode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"fragmentSourceCode\", { get: function() {\n            return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._fragmentSourceCodeOverride : this._fragmentSourceCode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"rawVertexSourceCode\", { get: function() {\n            return this._rawVertexSourceCode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"rawFragmentSourceCode\", { get: function() {\n            return this._rawFragmentSourceCode;\n          }, enumerable: !1, configurable: !0 }), x.prototype._rebuildProgram = function(m, c, T, S) {\n            var E = this;\n            this._isReady = !1, this._vertexSourceCodeOverride = m, this._fragmentSourceCodeOverride = c, this.onError = function(g, l) {\n              S && S(l);\n            }, this.onCompiled = function() {\n              var g = E.getEngine().scenes;\n              if (g)\n                for (var l = 0; l < g.length; l++)\n                  g[l].markAllMaterialsAsDirty(_.a.MATERIAL_AllDirtyFlag);\n              E._pipelineContext._handlesSpectorRebuildCallback(T);\n            }, this._fallbacks = null, this._prepareEffect();\n          }, x.prototype._prepareEffect = function() {\n            var m = this, c = this._attributesNames, T = this.defines;\n            this._valueCache = {};\n            var S = this._pipelineContext;\n            try {\n              var E = this._engine;\n              this._pipelineContext = E.createPipelineContext();\n              var g = this._rebuildProgram.bind(this);\n              this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? E._preparePipelineContext(this._pipelineContext, this._vertexSourceCodeOverride, this._fragmentSourceCodeOverride, !0, g, null, this._transformFeedbackVaryings) : E._preparePipelineContext(this._pipelineContext, this._vertexSourceCode, this._fragmentSourceCode, !1, g, T, this._transformFeedbackVaryings), E._executeWhenRenderingStateIsCompiled(this._pipelineContext, function() {\n                if (E.supportsUniformBuffers)\n                  for (var l in m._uniformBuffersNames)\n                    m.bindUniformBlock(l, m._uniformBuffersNames[l]);\n                var h;\n                if (E.getUniforms(m._pipelineContext, m._uniformsNames).forEach(function(D, w) {\n                  m._uniforms[m._uniformsNames[w]] = D;\n                }), m._attributes = E.getAttributes(m._pipelineContext, c), c)\n                  for (var v = 0; v < c.length; v++) {\n                    var b = c[v];\n                    m._attributeLocationByName[b] = m._attributes[v];\n                  }\n                for (h = 0; h < m._samplerList.length; h++)\n                  m.getUniform(m._samplerList[h]) == null && (m._samplerList.splice(h, 1), h--);\n                m._samplerList.forEach(function(D, w) {\n                  m._samplers[D] = w;\n                }), E.bindSamplers(m), m._compilationError = \"\", m._isReady = !0, m.onCompiled && m.onCompiled(m), m.onCompileObservable.notifyObservers(m), m.onCompileObservable.clear(), m._fallbacks && m._fallbacks.unBindMesh(), S && m.getEngine()._deletePipelineContext(S);\n              }), this._pipelineContext.isAsync && this._checkIsReady(S);\n            } catch (l) {\n              this._processCompilationErrors(l, S);\n            }\n          }, x.prototype._getShaderCodeAndErrorLine = function(m, c, T) {\n            var S = T ? /FRAGMENT SHADER ERROR: 0:(\\d+?):/ : /VERTEX SHADER ERROR: 0:(\\d+?):/, E = null;\n            if (c && m) {\n              var g = c.match(S);\n              if (g && g.length === 2) {\n                var l = parseInt(g[1]), h = m.split(`\n`, -1);\n                h.length >= l && (E = \"Offending line [\" + l + \"] in \" + (T ? \"fragment\" : \"vertex\") + \" code: \" + h[l - 1]);\n              }\n            }\n            return [m, E];\n          }, x.prototype._processCompilationErrors = function(m, c) {\n            var T, S, E, g, l;\n            c === void 0 && (c = null), this._compilationError = m.message;\n            var h = this._attributesNames, v = this._fallbacks;\n            if (u.a.Error(\"Unable to compile effect:\"), u.a.Error(\"Uniforms: \" + this._uniformsNames.map(function(N) {\n              return \" \" + N;\n            })), u.a.Error(\"Attributes: \" + h.map(function(N) {\n              return \" \" + N;\n            })), u.a.Error(`Defines:\\r\n` + this.defines), x.LogShaderCodeOnCompilationError) {\n              var b = null, D = null, w = null;\n              !((E = this._pipelineContext) === null || E === void 0) && E._getVertexShaderCode() && (w = (T = this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(), this._compilationError, !1))[0], b = T[1], w && (u.a.Error(\"Vertex code:\"), u.a.Error(w))), !((g = this._pipelineContext) === null || g === void 0) && g._getFragmentShaderCode() && (w = (S = this._getShaderCodeAndErrorLine((l = this._pipelineContext) === null || l === void 0 ? void 0 : l._getFragmentShaderCode(), this._compilationError, !0))[0], D = S[1], w && (u.a.Error(\"Fragment code:\"), u.a.Error(w))), b && u.a.Error(b), D && u.a.Error(D);\n            }\n            u.a.Error(\"Error: \" + this._compilationError), c && (this._pipelineContext = c, this._isReady = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this)), v ? (this._pipelineContext = null, v.hasMoreFallbacks ? (this._allFallbacksProcessed = !1, u.a.Error(\"Trying next fallback.\"), this.defines = v.reduce(this.defines, this), this._prepareEffect()) : (this._allFallbacksProcessed = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this), this.onErrorObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh())) : this._allFallbacksProcessed = !0;\n          }, Object.defineProperty(x.prototype, \"isSupported\", { get: function() {\n            return this._compilationError === \"\";\n          }, enumerable: !1, configurable: !0 }), x.prototype._bindTexture = function(m, c) {\n            this._engine._bindTexture(this._samplers[m], c);\n          }, x.prototype.setTexture = function(m, c) {\n            this._engine.setTexture(this._samplers[m], this._uniforms[m], c);\n          }, x.prototype.setDepthStencilTexture = function(m, c) {\n            this._engine.setDepthStencilTexture(this._samplers[m], this._uniforms[m], c);\n          }, x.prototype.setTextureArray = function(m, c) {\n            var T = m + \"Ex\";\n            if (this._samplerList.indexOf(T + \"0\") === -1) {\n              for (var S = this._samplerList.indexOf(m), E = 1; E < c.length; E++) {\n                var g = T + (E - 1).toString();\n                this._samplerList.splice(S + E, 0, g);\n              }\n              for (var l = 0, h = 0, v = this._samplerList; h < v.length; h++) {\n                var b = v[h];\n                this._samplers[b] = l, l += 1;\n              }\n            }\n            this._engine.setTextureArray(this._samplers[m], this._uniforms[m], c);\n          }, x.prototype.setTextureFromPostProcess = function(m, c) {\n            this._engine.setTextureFromPostProcess(this._samplers[m], c);\n          }, x.prototype.setTextureFromPostProcessOutput = function(m, c) {\n            this._engine.setTextureFromPostProcessOutput(this._samplers[m], c);\n          }, x.prototype._cacheMatrix = function(m, c) {\n            var T = this._valueCache[m], S = c.updateFlag;\n            return (T === void 0 || T !== S) && (this._valueCache[m] = S, !0);\n          }, x.prototype._cacheFloat2 = function(m, c, T) {\n            var S = this._valueCache[m];\n            if (!S || S.length !== 2)\n              return S = [c, T], this._valueCache[m] = S, !0;\n            var E = !1;\n            return S[0] !== c && (S[0] = c, E = !0), S[1] !== T && (S[1] = T, E = !0), E;\n          }, x.prototype._cacheFloat3 = function(m, c, T, S) {\n            var E = this._valueCache[m];\n            if (!E || E.length !== 3)\n              return E = [c, T, S], this._valueCache[m] = E, !0;\n            var g = !1;\n            return E[0] !== c && (E[0] = c, g = !0), E[1] !== T && (E[1] = T, g = !0), E[2] !== S && (E[2] = S, g = !0), g;\n          }, x.prototype._cacheFloat4 = function(m, c, T, S, E) {\n            var g = this._valueCache[m];\n            if (!g || g.length !== 4)\n              return g = [c, T, S, E], this._valueCache[m] = g, !0;\n            var l = !1;\n            return g[0] !== c && (g[0] = c, l = !0), g[1] !== T && (g[1] = T, l = !0), g[2] !== S && (g[2] = S, l = !0), g[3] !== E && (g[3] = E, l = !0), l;\n          }, x.prototype.bindUniformBuffer = function(m, c) {\n            var T = this._uniformBuffersNames[c];\n            T !== void 0 && x._baseCache[T] !== m && (x._baseCache[T] = m, this._engine.bindUniformBufferBase(m, T));\n          }, x.prototype.bindUniformBlock = function(m, c) {\n            this._engine.bindUniformBlock(this._pipelineContext, m, c);\n          }, x.prototype.setInt = function(m, c) {\n            var T = this._valueCache[m];\n            return T !== void 0 && T === c || this._engine.setInt(this._uniforms[m], c) && (this._valueCache[m] = c), this;\n          }, x.prototype.setIntArray = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray(this._uniforms[m], c), this;\n          }, x.prototype.setIntArray2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray2(this._uniforms[m], c), this;\n          }, x.prototype.setIntArray3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray3(this._uniforms[m], c), this;\n          }, x.prototype.setIntArray4 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray4(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray2(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray3(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray4 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray4(this._uniforms[m], c), this;\n          }, x.prototype.setArray = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray(this._uniforms[m], c), this;\n          }, x.prototype.setArray2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray2(this._uniforms[m], c), this;\n          }, x.prototype.setArray3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray3(this._uniforms[m], c), this;\n          }, x.prototype.setArray4 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray4(this._uniforms[m], c), this;\n          }, x.prototype.setMatrices = function(m, c) {\n            return c ? (this._valueCache[m] = null, this._engine.setMatrices(this._uniforms[m], c), this) : this;\n          }, x.prototype.setMatrix = function(m, c) {\n            return this._cacheMatrix(m, c) && (this._engine.setMatrices(this._uniforms[m], c.toArray()) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setMatrix3x3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setMatrix3x3(this._uniforms[m], c), this;\n          }, x.prototype.setMatrix2x2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setMatrix2x2(this._uniforms[m], c), this;\n          }, x.prototype.setFloat = function(m, c) {\n            var T = this._valueCache[m];\n            return T !== void 0 && T === c || this._engine.setFloat(this._uniforms[m], c) && (this._valueCache[m] = c), this;\n          }, x.prototype.setBool = function(m, c) {\n            var T = this._valueCache[m];\n            return T !== void 0 && T === c || this._engine.setInt(this._uniforms[m], c ? 1 : 0) && (this._valueCache[m] = c), this;\n          }, x.prototype.setVector2 = function(m, c) {\n            return this._cacheFloat2(m, c.x, c.y) && (this._engine.setFloat2(this._uniforms[m], c.x, c.y) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setFloat2 = function(m, c, T) {\n            return this._cacheFloat2(m, c, T) && (this._engine.setFloat2(this._uniforms[m], c, T) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setVector3 = function(m, c) {\n            return this._cacheFloat3(m, c.x, c.y, c.z) && (this._engine.setFloat3(this._uniforms[m], c.x, c.y, c.z) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setFloat3 = function(m, c, T, S) {\n            return this._cacheFloat3(m, c, T, S) && (this._engine.setFloat3(this._uniforms[m], c, T, S) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setVector4 = function(m, c) {\n            return this._cacheFloat4(m, c.x, c.y, c.z, c.w) && (this._engine.setFloat4(this._uniforms[m], c.x, c.y, c.z, c.w) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setFloat4 = function(m, c, T, S, E) {\n            return this._cacheFloat4(m, c, T, S, E) && (this._engine.setFloat4(this._uniforms[m], c, T, S, E) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setColor3 = function(m, c) {\n            return this._cacheFloat3(m, c.r, c.g, c.b) && (this._engine.setFloat3(this._uniforms[m], c.r, c.g, c.b) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setColor4 = function(m, c, T) {\n            return this._cacheFloat4(m, c.r, c.g, c.b, T) && (this._engine.setFloat4(this._uniforms[m], c.r, c.g, c.b, T) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setDirectColor4 = function(m, c) {\n            return this._cacheFloat4(m, c.r, c.g, c.b, c.a) && (this._engine.setFloat4(this._uniforms[m], c.r, c.g, c.b, c.a) || (this._valueCache[m] = null)), this;\n          }, x.prototype.dispose = function() {\n            this._engine._releaseEffect(this);\n          }, x.RegisterShader = function(m, c, T) {\n            c && (x.ShadersStore[m + \"PixelShader\"] = c), T && (x.ShadersStore[m + \"VertexShader\"] = T);\n          }, x.ResetCache = function() {\n            x._baseCache = {};\n          }, x.ShadersRepository = \"src/Shaders/\", x.LogShaderCodeOnCompilationError = !0, x._uniqueIdSeed = 0, x._baseCache = {}, x.ShadersStore = {}, x.IncludesShadersStore = {}, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        }), f.d(A, \"d\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        });\n        var V = function() {\n          function I(O, x, m, c) {\n            x === void 0 && (x = !1), this.initalize(O, x, m, c);\n          }\n          return I.prototype.initalize = function(O, x, m, c) {\n            return x === void 0 && (x = !1), this.mask = O, this.skipNextObservers = x, this.target = m, this.currentTarget = c, this;\n          }, I;\n        }(), _ = function(I, O, x) {\n          x === void 0 && (x = null), this.callback = I, this.mask = O, this.scope = x, this._willBeUnregistered = !1, this.unregisterOnNextCall = !1;\n        }, C = function() {\n          function I() {\n          }\n          return I.prototype.dispose = function() {\n            if (this._observers && this._observables)\n              for (var O = 0; O < this._observers.length; O++)\n                this._observables[O].remove(this._observers[O]);\n            this._observers = null, this._observables = null;\n          }, I.Watch = function(O, x, m, c) {\n            m === void 0 && (m = -1), c === void 0 && (c = null);\n            var T = new I();\n            T._observers = new Array(), T._observables = O;\n            for (var S = 0, E = O; S < E.length; S++) {\n              var g = E[S].add(x, m, !1, c);\n              g && T._observers.push(g);\n            }\n            return T;\n          }, I;\n        }(), u = function() {\n          function I(O) {\n            this._observers = new Array(), this._eventState = new V(0), O && (this._onObserverAdded = O);\n          }\n          return Object.defineProperty(I.prototype, \"observers\", { get: function() {\n            return this._observers;\n          }, enumerable: !1, configurable: !0 }), I.prototype.add = function(O, x, m, c, T) {\n            if (x === void 0 && (x = -1), m === void 0 && (m = !1), c === void 0 && (c = null), T === void 0 && (T = !1), !O)\n              return null;\n            var S = new _(O, x, c);\n            return S.unregisterOnNextCall = T, m ? this._observers.unshift(S) : this._observers.push(S), this._onObserverAdded && this._onObserverAdded(S), S;\n          }, I.prototype.addOnce = function(O) {\n            return this.add(O, void 0, void 0, void 0, !0);\n          }, I.prototype.remove = function(O) {\n            return !!O && this._observers.indexOf(O) !== -1 && (this._deferUnregister(O), !0);\n          }, I.prototype.removeCallback = function(O, x) {\n            for (var m = 0; m < this._observers.length; m++) {\n              var c = this._observers[m];\n              if (!c._willBeUnregistered && c.callback === O && (!x || x === c.scope))\n                return this._deferUnregister(c), !0;\n            }\n            return !1;\n          }, I.prototype._deferUnregister = function(O) {\n            var x = this;\n            O.unregisterOnNextCall = !1, O._willBeUnregistered = !0, setTimeout(function() {\n              x._remove(O);\n            }, 0);\n          }, I.prototype._remove = function(O) {\n            if (!O)\n              return !1;\n            var x = this._observers.indexOf(O);\n            return x !== -1 && (this._observers.splice(x, 1), !0);\n          }, I.prototype.makeObserverTopPriority = function(O) {\n            this._remove(O), this._observers.unshift(O);\n          }, I.prototype.makeObserverBottomPriority = function(O) {\n            this._remove(O), this._observers.push(O);\n          }, I.prototype.notifyObservers = function(O, x, m, c, T) {\n            if (x === void 0 && (x = -1), !this._observers.length)\n              return !0;\n            var S = this._eventState;\n            S.mask = x, S.target = m, S.currentTarget = c, S.skipNextObservers = !1, S.lastReturnValue = O, S.userInfo = T;\n            for (var E = 0, g = this._observers; E < g.length; E++) {\n              var l = g[E];\n              if (!l._willBeUnregistered && (l.mask & x && (l.scope ? S.lastReturnValue = l.callback.apply(l.scope, [O, S]) : S.lastReturnValue = l.callback(O, S), l.unregisterOnNextCall && this._deferUnregister(l)), S.skipNextObservers))\n                return !1;\n            }\n            return !0;\n          }, I.prototype.notifyObserversWithPromise = function(O, x, m, c, T) {\n            var S = this;\n            x === void 0 && (x = -1);\n            var E = Promise.resolve(O);\n            if (!this._observers.length)\n              return E;\n            var g = this._eventState;\n            return g.mask = x, g.target = m, g.currentTarget = c, g.skipNextObservers = !1, g.userInfo = T, this._observers.forEach(function(l) {\n              g.skipNextObservers || l._willBeUnregistered || l.mask & x && (E = l.scope ? E.then(function(h) {\n                return g.lastReturnValue = h, l.callback.apply(l.scope, [O, g]);\n              }) : E.then(function(h) {\n                return g.lastReturnValue = h, l.callback(O, g);\n              }), l.unregisterOnNextCall && S._deferUnregister(l));\n            }), E.then(function() {\n              return O;\n            });\n          }, I.prototype.notifyObserver = function(O, x, m) {\n            m === void 0 && (m = -1);\n            var c = this._eventState;\n            c.mask = m, c.skipNextObservers = !1, O.callback(x, c);\n          }, I.prototype.hasObservers = function() {\n            return this._observers.length > 0;\n          }, I.prototype.clear = function() {\n            this._observers = new Array(), this._onObserverAdded = null;\n          }, I.prototype.clone = function() {\n            var O = new I();\n            return O._observers = this._observers.slice(0), O;\n          }, I.prototype.hasSpecificMask = function(O) {\n            O === void 0 && (O = -1);\n            for (var x = 0, m = this._observers; x < m.length; x++) {\n              var c = m[x];\n              if (c.mask & O || c.mask === O)\n                return !0;\n            }\n            return !1;\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return te;\n        }), f.d(A, \"c\", function() {\n          return pe;\n        }), f.d(A, \"a\", function() {\n          return K;\n        });\n        var V = f(1), _ = f(6), C = f(12), u = f(41), I = f(37), O = f(0), x = f(9), m = f(29), c = f(4), T = f(16), S = f(71), E = f(31), g = f(61), l = f(43), h = f(25), v = f(68), b = f(69), D = f(2), w = f(3), N = f(8), M = f(11), U = f(21), X = f(17), j = f(149), ne = f(70), te = function() {\n        }, de = function() {\n          this.visibleInstances = {}, this.batchCache = new pe(), this.instancesBufferSize = 2048;\n        }, pe = function() {\n          this.mustReturn = !1, this.visibleInstances = new Array(), this.renderSelf = new Array(), this.hardwareInstancedRendering = new Array();\n        }, ae = function() {\n          this.instancesCount = 0, this.matrixBuffer = null, this.matrixBufferSize = 512, this.boundingVectors = [], this.worldMatrices = null;\n        }, ee = function() {\n          this._areNormalsFrozen = !1, this._source = null, this.meshMap = null, this._preActivateId = -1, this._LODLevels = new Array(), this._morphTargetManager = null;\n        }, K = function($) {\n          function L(G, Q, oe, re, Y, k) {\n            Q === void 0 && (Q = null), oe === void 0 && (oe = null), re === void 0 && (re = null), k === void 0 && (k = !0);\n            var H = $.call(this, G, Q) || this;\n            if (H._internalMeshDataInfo = new ee(), H.delayLoadState = D.a.DELAYLOADSTATE_NONE, H.instances = new Array(), H._creationDataStorage = null, H._geometry = null, H._instanceDataStorage = new de(), H._thinInstanceDataStorage = new ae(), H._effectiveMaterial = null, H._shouldGenerateFlatShading = !1, H._originalBuilderSideOrientation = L.DEFAULTSIDE, H.overrideMaterialSideOrientation = null, Q = H.getScene(), re) {\n              if (re._geometry && re._geometry.applyToMesh(H), u.a.DeepCopy(re, H, [\"name\", \"material\", \"skeleton\", \"instances\", \"parent\", \"uniqueId\", \"source\", \"metadata\", \"morphTargetManager\", \"hasInstances\", \"source\", \"worldMatrixInstancedBuffer\", \"hasLODLevels\", \"geometry\", \"isBlocked\", \"areNormalsFrozen\", \"facetNb\", \"isFacetDataEnabled\", \"lightSources\", \"useBones\", \"isAnInstance\", \"collider\", \"edgesRenderer\", \"forward\", \"up\", \"right\", \"absolutePosition\", \"absoluteScaling\", \"absoluteRotationQuaternion\", \"isWorldMatrixFrozen\", \"nonUniformScaling\", \"behaviors\", \"worldMatrixFromCache\", \"hasThinInstances\", \"cloneMeshMap\"], [\"_poseMatrix\"]), H._internalMeshDataInfo._source = re, Q.useClonedMeshMap && (re._internalMeshDataInfo.meshMap || (re._internalMeshDataInfo.meshMap = {}), re._internalMeshDataInfo.meshMap[H.uniqueId] = H), H._originalBuilderSideOrientation = re._originalBuilderSideOrientation, H._creationDataStorage = re._creationDataStorage, re._ranges) {\n                var Z = re._ranges;\n                for (var G in Z)\n                  Z.hasOwnProperty(G) && Z[G] && H.createAnimationRange(G, Z[G].from, Z[G].to);\n              }\n              var W;\n              if (re.metadata && re.metadata.clone ? H.metadata = re.metadata.clone() : H.metadata = re.metadata, I.a && I.a.HasTags(re) && I.a.AddTagsTo(H, I.a.GetTags(re, !0)), H.setEnabled(re.isEnabled()), H.parent = re.parent, H.setPivotMatrix(re.getPivotMatrix()), H.id = G + \".\" + re.id, H.material = re.material, !Y)\n                for (var q = re.getDescendants(!0), he = 0; he < q.length; he++) {\n                  var ge = q[he];\n                  ge.clone && ge.clone(G + \".\" + ge.name, H);\n                }\n              if (re.morphTargetManager && (H.morphTargetManager = re.morphTargetManager), Q.getPhysicsEngine) {\n                var me = Q.getPhysicsEngine();\n                if (k && me) {\n                  var _e = me.getImpostorForPhysicsObject(re);\n                  _e && (H.physicsImpostor = _e.clone(H));\n                }\n              }\n              for (W = 0; W < Q.particleSystems.length; W++) {\n                var ye = Q.particleSystems[W];\n                ye.emitter === re && ye.clone(ye.name, H);\n              }\n              H.refreshBoundingInfo(), H.computeWorldMatrix(!0);\n            }\n            return oe !== null && (H.parent = oe), H._instanceDataStorage.hardwareInstancedRendering = H.getEngine().getCaps().instancedArrays, H;\n          }\n          return Object(V.d)(L, $), L._GetDefaultSideOrientation = function(G) {\n            return G || L.FRONTSIDE;\n          }, Object.defineProperty(L.prototype, \"computeBonesUsingShaders\", { get: function() {\n            return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;\n          }, set: function(G) {\n            this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== G && (G && this._internalMeshDataInfo._sourcePositions && (this.setVerticesData(c.b.PositionKind, this._internalMeshDataInfo._sourcePositions.slice(), !0), this._internalMeshDataInfo._sourceNormals && this.setVerticesData(c.b.NormalKind, this._internalMeshDataInfo._sourceNormals.slice(), !0)), this._internalAbstractMeshDataInfo._computeBonesUsingShaders = G, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeRenderObservable\", { get: function() {\n            return this._internalMeshDataInfo._onBeforeRenderObservable || (this._internalMeshDataInfo._onBeforeRenderObservable = new _.c()), this._internalMeshDataInfo._onBeforeRenderObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeBindObservable\", { get: function() {\n            return this._internalMeshDataInfo._onBeforeBindObservable || (this._internalMeshDataInfo._onBeforeBindObservable = new _.c()), this._internalMeshDataInfo._onBeforeBindObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onAfterRenderObservable\", { get: function() {\n            return this._internalMeshDataInfo._onAfterRenderObservable || (this._internalMeshDataInfo._onAfterRenderObservable = new _.c()), this._internalMeshDataInfo._onAfterRenderObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeDrawObservable\", { get: function() {\n            return this._internalMeshDataInfo._onBeforeDrawObservable || (this._internalMeshDataInfo._onBeforeDrawObservable = new _.c()), this._internalMeshDataInfo._onBeforeDrawObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeDraw\", { set: function(G) {\n            this._onBeforeDrawObserver && this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver), this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(G);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"hasInstances\", { get: function() {\n            return this.instances.length > 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"hasThinInstances\", { get: function() {\n            var G;\n            return ((G = this._thinInstanceDataStorage.instancesCount) !== null && G !== void 0 ? G : 0) > 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"morphTargetManager\", { get: function() {\n            return this._internalMeshDataInfo._morphTargetManager;\n          }, set: function(G) {\n            this._internalMeshDataInfo._morphTargetManager !== G && (this._internalMeshDataInfo._morphTargetManager = G, this._syncGeometryWithMorphTargetManager());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"source\", { get: function() {\n            return this._internalMeshDataInfo._source;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"cloneMeshMap\", { get: function() {\n            return this._internalMeshDataInfo.meshMap;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"isUnIndexed\", { get: function() {\n            return this._unIndexed;\n          }, set: function(G) {\n            this._unIndexed !== G && (this._unIndexed = G, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"worldMatrixInstancedBuffer\", { get: function() {\n            return this._instanceDataStorage.instancesData;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"manualUpdateOfWorldMatrixInstancedBuffer\", { get: function() {\n            return this._instanceDataStorage.manualUpdate;\n          }, set: function(G) {\n            this._instanceDataStorage.manualUpdate = G;\n          }, enumerable: !1, configurable: !0 }), L.prototype.instantiateHierarchy = function(G, Q, oe) {\n            G === void 0 && (G = null);\n            var re = !(this.getTotalVertices() > 0) || Q && Q.doNotInstantiate ? this.clone(\"Clone of \" + (this.name || this.id), G || this.parent, !0) : this.createInstance(\"instance of \" + (this.name || this.id));\n            re && (re.parent = G || this.parent, re.position = this.position.clone(), re.scaling = this.scaling.clone(), this.rotationQuaternion ? re.rotationQuaternion = this.rotationQuaternion.clone() : re.rotation = this.rotation.clone(), oe && oe(this, re));\n            for (var Y = 0, k = this.getChildTransformNodes(!0); Y < k.length; Y++)\n              k[Y].instantiateHierarchy(re, Q, oe);\n            return re;\n          }, L.prototype.getClassName = function() {\n            return \"Mesh\";\n          }, Object.defineProperty(L.prototype, \"_isMesh\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), L.prototype.toString = function(G) {\n            var Q = $.prototype.toString.call(this, G);\n            if (Q += \", n vertices: \" + this.getTotalVertices(), Q += \", parent: \" + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : \"NONE\"), this.animations)\n              for (var oe = 0; oe < this.animations.length; oe++)\n                Q += \", animation[0]: \" + this.animations[oe].toString(G);\n            if (G)\n              if (this._geometry) {\n                var re = this.getIndices(), Y = this.getVerticesData(c.b.PositionKind);\n                Y && re && (Q += \", flat shading: \" + (Y.length / 3 === re.length ? \"YES\" : \"NO\"));\n              } else\n                Q += \", flat shading: UNKNOWN\";\n            return Q;\n          }, L.prototype._unBindEffect = function() {\n            $.prototype._unBindEffect.call(this);\n            for (var G = 0, Q = this.instances; G < Q.length; G++)\n              Q[G]._unBindEffect();\n          }, Object.defineProperty(L.prototype, \"hasLODLevels\", { get: function() {\n            return this._internalMeshDataInfo._LODLevels.length > 0;\n          }, enumerable: !1, configurable: !0 }), L.prototype.getLODLevels = function() {\n            return this._internalMeshDataInfo._LODLevels;\n          }, L.prototype._sortLODLevels = function() {\n            this._internalMeshDataInfo._LODLevels.sort(function(G, Q) {\n              return G.distance < Q.distance ? 1 : G.distance > Q.distance ? -1 : 0;\n            });\n          }, L.prototype.addLODLevel = function(G, Q) {\n            if (Q && Q._masterMesh)\n              return N.a.Warn(\"You cannot use a mesh as LOD level twice\"), this;\n            var oe = new j.a(G, Q);\n            return this._internalMeshDataInfo._LODLevels.push(oe), Q && (Q._masterMesh = this), this._sortLODLevels(), this;\n          }, L.prototype.getLODLevelAtDistance = function(G) {\n            for (var Q = this._internalMeshDataInfo, oe = 0; oe < Q._LODLevels.length; oe++) {\n              var re = Q._LODLevels[oe];\n              if (re.distance === G)\n                return re.mesh;\n            }\n            return null;\n          }, L.prototype.removeLODLevel = function(G) {\n            for (var Q = this._internalMeshDataInfo, oe = 0; oe < Q._LODLevels.length; oe++)\n              Q._LODLevels[oe].mesh === G && (Q._LODLevels.splice(oe, 1), G && (G._masterMesh = null));\n            return this._sortLODLevels(), this;\n          }, L.prototype.getLOD = function(G, Q) {\n            var oe, re = this._internalMeshDataInfo;\n            if (!re._LODLevels || re._LODLevels.length === 0)\n              return this;\n            Q ? oe = Q : oe = this.getBoundingInfo().boundingSphere;\n            var Y = oe.centerWorld.subtract(G.globalPosition).length();\n            if (re._LODLevels[re._LODLevels.length - 1].distance > Y)\n              return this.onLODLevelSelection && this.onLODLevelSelection(Y, this, this), this;\n            for (var k = 0; k < re._LODLevels.length; k++) {\n              var H = re._LODLevels[k];\n              if (H.distance < Y) {\n                if (H.mesh) {\n                  if (H.mesh.delayLoadState === D.a.DELAYLOADSTATE_NOTLOADED)\n                    return H.mesh._checkDelayState(), this;\n                  if (H.mesh.delayLoadState === D.a.DELAYLOADSTATE_LOADING)\n                    return this;\n                  H.mesh._preActivate(), H.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);\n                }\n                return this.onLODLevelSelection && this.onLODLevelSelection(Y, this, H.mesh), H.mesh;\n              }\n            }\n            return this.onLODLevelSelection && this.onLODLevelSelection(Y, this, this), this;\n          }, Object.defineProperty(L.prototype, \"geometry\", { get: function() {\n            return this._geometry;\n          }, enumerable: !1, configurable: !0 }), L.prototype.getTotalVertices = function() {\n            return this._geometry === null || this._geometry === void 0 ? 0 : this._geometry.getTotalVertices();\n          }, L.prototype.getVerticesData = function(G, Q, oe) {\n            return this._geometry ? this._geometry.getVerticesData(G, Q, oe) : null;\n          }, L.prototype.getVertexBuffer = function(G) {\n            return this._geometry ? this._geometry.getVertexBuffer(G) : null;\n          }, L.prototype.isVerticesDataPresent = function(G) {\n            return this._geometry ? this._geometry.isVerticesDataPresent(G) : !!this._delayInfo && this._delayInfo.indexOf(G) !== -1;\n          }, L.prototype.isVertexBufferUpdatable = function(G) {\n            return this._geometry ? this._geometry.isVertexBufferUpdatable(G) : !!this._delayInfo && this._delayInfo.indexOf(G) !== -1;\n          }, L.prototype.getVerticesDataKinds = function() {\n            if (!this._geometry) {\n              var G = new Array();\n              return this._delayInfo && this._delayInfo.forEach(function(Q) {\n                G.push(Q);\n              }), G;\n            }\n            return this._geometry.getVerticesDataKinds();\n          }, L.prototype.getTotalIndices = function() {\n            return this._geometry ? this._geometry.getTotalIndices() : 0;\n          }, L.prototype.getIndices = function(G, Q) {\n            return this._geometry ? this._geometry.getIndices(G, Q) : [];\n          }, Object.defineProperty(L.prototype, \"isBlocked\", { get: function() {\n            return this._masterMesh !== null && this._masterMesh !== void 0;\n          }, enumerable: !1, configurable: !0 }), L.prototype.isReady = function(G, Q) {\n            var oe, re, Y, k, H, Z;\n            if (G === void 0 && (G = !1), Q === void 0 && (Q = !1), this.delayLoadState === D.a.DELAYLOADSTATE_LOADING || !$.prototype.isReady.call(this, G))\n              return !1;\n            if (!this.subMeshes || this.subMeshes.length === 0 || !G)\n              return !0;\n            var W = this.getEngine(), q = this.getScene(), he = Q || W.getCaps().instancedArrays && (this.instances.length > 0 || this.hasThinInstances);\n            this.computeWorldMatrix();\n            var ge = this.material || q.defaultMaterial;\n            if (ge) {\n              if (ge._storeEffectOnSubMeshes)\n                for (var me = 0, _e = this.subMeshes; me < _e.length; me++) {\n                  var ye = (je = _e[me]).getMaterial();\n                  if (ye) {\n                    if (ye._storeEffectOnSubMeshes) {\n                      if (!ye.isReadyForSubMesh(this, je, he))\n                        return !1;\n                    } else if (!ye.isReady(this, he))\n                      return !1;\n                  }\n                }\n              else if (!ge.isReady(this, he))\n                return !1;\n            }\n            for (var Pe = 0, be = this.lightSources; Pe < be.length; Pe++) {\n              var Fe = be[Pe].getShadowGenerator();\n              if (Fe && (!(!((oe = Fe.getShadowMap()) === null || oe === void 0) && oe.renderList) || !((re = Fe.getShadowMap()) === null || re === void 0) && re.renderList && ((k = (Y = Fe.getShadowMap()) === null || Y === void 0 ? void 0 : Y.renderList) === null || k === void 0 ? void 0 : k.indexOf(this)) !== -1))\n                for (var ke = 0, We = this.subMeshes; ke < We.length; ke++) {\n                  var je = We[ke];\n                  if (!Fe.isReady(je, he, (Z = (H = je.getMaterial()) === null || H === void 0 ? void 0 : H.needAlphaBlendingForMesh(this)) !== null && Z !== void 0 && Z))\n                    return !1;\n                }\n            }\n            for (var He = 0, Qe = this._internalMeshDataInfo._LODLevels; He < Qe.length; He++) {\n              var Ge = Qe[He];\n              if (Ge.mesh && !Ge.mesh.isReady(he))\n                return !1;\n            }\n            return !0;\n          }, Object.defineProperty(L.prototype, \"areNormalsFrozen\", { get: function() {\n            return this._internalMeshDataInfo._areNormalsFrozen;\n          }, enumerable: !1, configurable: !0 }), L.prototype.freezeNormals = function() {\n            return this._internalMeshDataInfo._areNormalsFrozen = !0, this;\n          }, L.prototype.unfreezeNormals = function() {\n            return this._internalMeshDataInfo._areNormalsFrozen = !1, this;\n          }, Object.defineProperty(L.prototype, \"overridenInstanceCount\", { set: function(G) {\n            this._instanceDataStorage.overridenInstanceCount = G;\n          }, enumerable: !1, configurable: !0 }), L.prototype._preActivate = function() {\n            var G = this._internalMeshDataInfo, Q = this.getScene().getRenderId();\n            return G._preActivateId === Q || (G._preActivateId = Q, this._instanceDataStorage.visibleInstances = null), this;\n          }, L.prototype._preActivateForIntermediateRendering = function(G) {\n            return this._instanceDataStorage.visibleInstances && (this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = G), this;\n          }, L.prototype._registerInstanceForRenderId = function(G, Q) {\n            return this._instanceDataStorage.visibleInstances || (this._instanceDataStorage.visibleInstances = { defaultRenderId: Q, selfDefaultRenderId: this._renderId }), this._instanceDataStorage.visibleInstances[Q] || (this._instanceDataStorage.previousRenderId !== void 0 && this._instanceDataStorage.isFrozen && (this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId] = null), this._instanceDataStorage.previousRenderId = Q, this._instanceDataStorage.visibleInstances[Q] = new Array()), this._instanceDataStorage.visibleInstances[Q].push(G), this;\n          }, L.prototype._afterComputeWorldMatrix = function() {\n            $.prototype._afterComputeWorldMatrix.call(this), this.hasThinInstances && (this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1));\n          }, L.prototype._postActivate = function() {\n            this.edgesShareWithInstances && this.edgesRenderer && this.edgesRenderer.isEnabled && this._renderingGroup && (this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer), this.edgesRenderer.customInstances.push(this.getWorldMatrix()));\n          }, L.prototype.refreshBoundingInfo = function(G) {\n            if (G === void 0 && (G = !1), this._boundingInfo && this._boundingInfo.isLocked)\n              return this;\n            var Q = this.geometry ? this.geometry.boundingBias : null;\n            return this._refreshBoundingInfo(this._getPositionData(G), Q), this;\n          }, L.prototype._createGlobalSubMesh = function(G) {\n            var Q = this.getTotalVertices();\n            if (!Q || !this.getIndices())\n              return null;\n            if (this.subMeshes && this.subMeshes.length > 0) {\n              var oe = this.getIndices();\n              if (!oe)\n                return null;\n              var re = oe.length, Y = !1;\n              if (G)\n                Y = !0;\n              else\n                for (var k = 0, H = this.subMeshes; k < H.length; k++) {\n                  var Z = H[k];\n                  if (Z.indexStart + Z.indexCount > re) {\n                    Y = !0;\n                    break;\n                  }\n                  if (Z.verticesStart + Z.verticesCount > Q) {\n                    Y = !0;\n                    break;\n                  }\n                }\n              if (!Y)\n                return this.subMeshes[0];\n            }\n            return this.releaseSubMeshes(), new g.a(0, 0, Q, 0, this.getTotalIndices(), this);\n          }, L.prototype.subdivide = function(G) {\n            if (!(G < 1)) {\n              for (var Q = this.getTotalIndices(), oe = Q / G | 0, re = 0; oe % 3 != 0; )\n                oe++;\n              this.releaseSubMeshes();\n              for (var Y = 0; Y < G && !(re >= Q); Y++)\n                g.a.CreateFromIndices(0, re, Y === G - 1 ? Q - re : oe, this), re += oe;\n              this.synchronizeInstances();\n            }\n          }, L.prototype.setVerticesData = function(G, Q, oe, re) {\n            if (oe === void 0 && (oe = !1), this._geometry)\n              this._geometry.setVerticesData(G, Q, oe, re);\n            else {\n              var Y = new T.a();\n              Y.set(Q, G);\n              var k = this.getScene();\n              new S.a(S.a.RandomId(), k, Y, oe, this);\n            }\n            return this;\n          }, L.prototype.removeVerticesData = function(G) {\n            this._geometry && this._geometry.removeVerticesData(G);\n          }, L.prototype.markVerticesDataAsUpdatable = function(G, Q) {\n            Q === void 0 && (Q = !0);\n            var oe = this.getVertexBuffer(G);\n            oe && oe.isUpdatable() !== Q && this.setVerticesData(G, this.getVerticesData(G), Q);\n          }, L.prototype.setVerticesBuffer = function(G) {\n            return this._geometry || (this._geometry = S.a.CreateGeometryForMesh(this)), this._geometry.setVerticesBuffer(G), this;\n          }, L.prototype.updateVerticesData = function(G, Q, oe, re) {\n            return this._geometry ? (re ? (this.makeGeometryUnique(), this.updateVerticesData(G, Q, oe, !1)) : this._geometry.updateVerticesData(G, Q, oe), this) : this;\n          }, L.prototype.updateMeshPositions = function(G, Q) {\n            Q === void 0 && (Q = !0);\n            var oe = this.getVerticesData(c.b.PositionKind);\n            if (!oe)\n              return this;\n            if (G(oe), this.updateVerticesData(c.b.PositionKind, oe, !1, !1), Q) {\n              var re = this.getIndices(), Y = this.getVerticesData(c.b.NormalKind);\n              if (!Y)\n                return this;\n              T.a.ComputeNormals(oe, re, Y), this.updateVerticesData(c.b.NormalKind, Y, !1, !1);\n            }\n            return this;\n          }, L.prototype.makeGeometryUnique = function() {\n            if (!this._geometry)\n              return this;\n            if (this._geometry.meshes.length === 1)\n              return this;\n            var G = this._geometry, Q = this._geometry.copy(S.a.RandomId());\n            return G.releaseForMesh(this, !0), Q.applyToMesh(this), this;\n          }, L.prototype.setIndices = function(G, Q, oe) {\n            if (Q === void 0 && (Q = null), oe === void 0 && (oe = !1), this._geometry)\n              this._geometry.setIndices(G, Q, oe);\n            else {\n              var re = new T.a();\n              re.indices = G;\n              var Y = this.getScene();\n              new S.a(S.a.RandomId(), Y, re, oe, this);\n            }\n            return this;\n          }, L.prototype.updateIndices = function(G, Q, oe) {\n            return oe === void 0 && (oe = !1), this._geometry ? (this._geometry.updateIndices(G, Q, oe), this) : this;\n          }, L.prototype.toLeftHanded = function() {\n            return this._geometry ? (this._geometry.toLeftHanded(), this) : this;\n          }, L.prototype._bind = function(G, Q, oe) {\n            if (!this._geometry)\n              return this;\n            var re, Y = this.getScene().getEngine();\n            if (this._unIndexed)\n              re = null;\n            else\n              switch (oe) {\n                case h.a.PointFillMode:\n                  re = null;\n                  break;\n                case h.a.WireFrameFillMode:\n                  re = G._getLinesIndexBuffer(this.getIndices(), Y);\n                  break;\n                default:\n                case h.a.TriangleFillMode:\n                  re = this._geometry.getIndexBuffer();\n              }\n            return this._geometry._bind(Q, re), this;\n          }, L.prototype._draw = function(G, Q, oe) {\n            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())\n              return this;\n            this._internalMeshDataInfo._onBeforeDrawObservable && this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);\n            var re = this.getScene().getEngine();\n            return this._unIndexed || Q == h.a.PointFillMode ? re.drawArraysType(Q, G.verticesStart, G.verticesCount, oe) : Q == h.a.WireFrameFillMode ? re.drawElementsType(Q, 0, G._linesIndexCount, oe) : re.drawElementsType(Q, G.indexStart, G.indexCount, oe), this;\n          }, L.prototype.registerBeforeRender = function(G) {\n            return this.onBeforeRenderObservable.add(G), this;\n          }, L.prototype.unregisterBeforeRender = function(G) {\n            return this.onBeforeRenderObservable.removeCallback(G), this;\n          }, L.prototype.registerAfterRender = function(G) {\n            return this.onAfterRenderObservable.add(G), this;\n          }, L.prototype.unregisterAfterRender = function(G) {\n            return this.onAfterRenderObservable.removeCallback(G), this;\n          }, L.prototype._getInstancesRenderList = function(G, Q) {\n            if (Q === void 0 && (Q = !1), this._instanceDataStorage.isFrozen && this._instanceDataStorage.previousBatch)\n              return this._instanceDataStorage.previousBatch;\n            var oe = this.getScene(), re = oe._isInIntermediateRendering(), Y = re ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances, k = this._instanceDataStorage.batchCache;\n            if (k.mustReturn = !1, k.renderSelf[G] = Q || !Y && this.isEnabled() && this.isVisible, k.visibleInstances[G] = null, this._instanceDataStorage.visibleInstances && !Q) {\n              var H = this._instanceDataStorage.visibleInstances, Z = oe.getRenderId(), W = re ? H.intermediateDefaultRenderId : H.defaultRenderId;\n              k.visibleInstances[G] = H[Z], !k.visibleInstances[G] && W && (k.visibleInstances[G] = H[W]);\n            }\n            return k.hardwareInstancedRendering[G] = !Q && this._instanceDataStorage.hardwareInstancedRendering && k.visibleInstances[G] !== null && k.visibleInstances[G] !== void 0, this._instanceDataStorage.previousBatch = k, k;\n          }, L.prototype._renderWithInstances = function(G, Q, oe, re, Y) {\n            var k = oe.visibleInstances[G._id];\n            if (!k)\n              return this;\n            for (var H = this._instanceDataStorage, Z = H.instancesBufferSize, W = H.instancesBuffer, q = 16 * (k.length + 1) * 4; H.instancesBufferSize < q; )\n              H.instancesBufferSize *= 2;\n            H.instancesData && Z == H.instancesBufferSize || (H.instancesData = new Float32Array(H.instancesBufferSize / 4));\n            var he = 0, ge = 0, me = oe.renderSelf[G._id], _e = !W || Z !== H.instancesBufferSize;\n            if (this._instanceDataStorage.manualUpdate || H.isFrozen && !_e)\n              ge = (me ? 1 : 0) + k.length;\n            else {\n              var ye = this._effectiveMesh.getWorldMatrix();\n              if (me && (ye.copyToArray(H.instancesData, he), he += 16, ge++), k)\n                for (var Pe = 0; Pe < k.length; Pe++)\n                  k[Pe].getWorldMatrix().copyToArray(H.instancesData, he), he += 16, ge++;\n            }\n            return _e ? (W && W.dispose(), W = new c.a(Y, H.instancesData, !0, 16, !1, !0), H.instancesBuffer = W, this.setVerticesBuffer(W.createVertexBuffer(\"world0\", 0, 4)), this.setVerticesBuffer(W.createVertexBuffer(\"world1\", 4, 4)), this.setVerticesBuffer(W.createVertexBuffer(\"world2\", 8, 4)), this.setVerticesBuffer(W.createVertexBuffer(\"world3\", 12, 4))) : this._instanceDataStorage.isFrozen || W.updateDirectly(H.instancesData, 0, ge), this._processInstancedBuffers(k, me), this.getScene()._activeIndices.addCount(G.indexCount * ge, !1), this._bind(G, re, Q), this._draw(G, Q, ge), Y.unbindInstanceAttributes(), this;\n          }, L.prototype._renderWithThinInstances = function(G, Q, oe, re) {\n            var Y, k, H = (k = (Y = this._thinInstanceDataStorage) === null || Y === void 0 ? void 0 : Y.instancesCount) !== null && k !== void 0 ? k : 0;\n            this.getScene()._activeIndices.addCount(G.indexCount * H, !1), this._bind(G, oe, Q), this._draw(G, Q, H), re.unbindInstanceAttributes();\n          }, L.prototype._processInstancedBuffers = function(G, Q) {\n          }, L.prototype._processRendering = function(G, Q, oe, re, Y, k, H, Z) {\n            var W = this.getScene(), q = W.getEngine();\n            if (k && Q.getRenderingMesh().hasThinInstances)\n              return this._renderWithThinInstances(Q, re, oe, q), this;\n            if (k)\n              this._renderWithInstances(Q, re, Y, oe, q);\n            else {\n              var he = 0;\n              Y.renderSelf[Q._id] && (H && H(!1, G._effectiveMesh.getWorldMatrix(), Z), he++, this._draw(Q, re, this._instanceDataStorage.overridenInstanceCount));\n              var ge = Y.visibleInstances[Q._id];\n              if (ge) {\n                var me = ge.length;\n                he += me;\n                for (var _e = 0; _e < me; _e++) {\n                  var ye = ge[_e].getWorldMatrix();\n                  H && H(!0, ye, Z), this._draw(Q, re);\n                }\n              }\n              W._activeIndices.addCount(Q.indexCount * he, !1);\n            }\n            return this;\n          }, L.prototype._rebuild = function() {\n            this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null), $.prototype._rebuild.call(this);\n          }, L.prototype._freeze = function() {\n            if (this.subMeshes) {\n              for (var G = 0; G < this.subMeshes.length; G++)\n                this._getInstancesRenderList(G);\n              this._effectiveMaterial = null, this._instanceDataStorage.isFrozen = !0;\n            }\n          }, L.prototype._unFreeze = function() {\n            this._instanceDataStorage.isFrozen = !1, this._instanceDataStorage.previousBatch = null;\n          }, L.prototype.render = function(G, Q, oe) {\n            var re = this.getScene();\n            if (this._internalAbstractMeshDataInfo._isActiveIntermediate ? this._internalAbstractMeshDataInfo._isActiveIntermediate = !1 : this._internalAbstractMeshDataInfo._isActive = !1, this._checkOcclusionQuery())\n              return this;\n            var Y = this._getInstancesRenderList(G._id, !!oe);\n            if (Y.mustReturn)\n              return this;\n            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())\n              return this;\n            this._internalMeshDataInfo._onBeforeRenderObservable && this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);\n            var k, H = re.getEngine(), Z = Y.hardwareInstancedRendering[G._id] || G.getRenderingMesh().hasThinInstances, W = this._instanceDataStorage, q = G.getMaterial();\n            if (!q)\n              return this;\n            if (!W.isFrozen || !this._effectiveMaterial || this._effectiveMaterial !== q) {\n              if (q._storeEffectOnSubMeshes) {\n                if (!q.isReadyForSubMesh(this, G, Z))\n                  return this;\n              } else if (!q.isReady(this, Z))\n                return this;\n              this._effectiveMaterial = q;\n            }\n            Q && H.setAlphaMode(this._effectiveMaterial.alphaMode), k = this._effectiveMaterial._storeEffectOnSubMeshes ? G.effect : this._effectiveMaterial.getEffect();\n            for (var he = 0, ge = re._beforeRenderingMeshStage; he < ge.length; he++)\n              ge[he].action(this, G, Y, k);\n            if (!k)\n              return this;\n            var me, _e = oe || this._effectiveMesh;\n            if (W.isFrozen || !this._effectiveMaterial.backFaceCulling && this.overrideMaterialSideOrientation === null)\n              me = W.sideOrientation;\n            else {\n              var ye = _e._getWorldMatrixDeterminant();\n              (me = this.overrideMaterialSideOrientation) == null && (me = this._effectiveMaterial.sideOrientation), ye < 0 && (me = me === h.a.ClockWiseSideOrientation ? h.a.CounterClockWiseSideOrientation : h.a.ClockWiseSideOrientation), W.sideOrientation = me;\n            }\n            var Pe = this._effectiveMaterial._preBind(k, me);\n            this._effectiveMaterial.forceDepthWrite && H.setDepthWrite(!0);\n            var be = re.forcePointsCloud ? h.a.PointFillMode : re.forceWireframe ? h.a.WireFrameFillMode : this._effectiveMaterial.fillMode;\n            this._internalMeshDataInfo._onBeforeBindObservable && this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this), Z || this._bind(G, k, be);\n            var Fe = _e.getWorldMatrix();\n            this._effectiveMaterial._storeEffectOnSubMeshes ? this._effectiveMaterial.bindForSubMesh(Fe, this, G) : this._effectiveMaterial.bind(Fe, this), !this._effectiveMaterial.backFaceCulling && this._effectiveMaterial.separateCullingPass && (H.setState(!0, this._effectiveMaterial.zOffset, !1, !Pe), this._processRendering(this, G, k, be, Y, Z, this._onBeforeDraw, this._effectiveMaterial), H.setState(!0, this._effectiveMaterial.zOffset, !1, Pe)), this._processRendering(this, G, k, be, Y, Z, this._onBeforeDraw, this._effectiveMaterial), this._effectiveMaterial.unbind();\n            for (var ke = 0, We = re._afterRenderingMeshStage; ke < We.length; ke++)\n              We[ke].action(this, G, Y, k);\n            return this._internalMeshDataInfo._onAfterRenderObservable && this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this), this;\n          }, L.prototype._onBeforeDraw = function(G, Q, oe) {\n            G && oe && oe.bindOnlyWorldMatrix(Q);\n          }, L.prototype.cleanMatrixWeights = function() {\n            this.isVerticesDataPresent(c.b.MatricesWeightsKind) && (this.isVerticesDataPresent(c.b.MatricesWeightsExtraKind) ? this.normalizeSkinWeightsAndExtra() : this.normalizeSkinFourWeights());\n          }, L.prototype.normalizeSkinFourWeights = function() {\n            for (var G = this.getVerticesData(c.b.MatricesWeightsKind), Q = G.length, oe = 0; oe < Q; oe += 4) {\n              var re = G[oe] + G[oe + 1] + G[oe + 2] + G[oe + 3];\n              if (re === 0)\n                G[oe] = 1;\n              else {\n                var Y = 1 / re;\n                G[oe] *= Y, G[oe + 1] *= Y, G[oe + 2] *= Y, G[oe + 3] *= Y;\n              }\n            }\n            this.setVerticesData(c.b.MatricesWeightsKind, G);\n          }, L.prototype.normalizeSkinWeightsAndExtra = function() {\n            for (var G = this.getVerticesData(c.b.MatricesWeightsExtraKind), Q = this.getVerticesData(c.b.MatricesWeightsKind), oe = Q.length, re = 0; re < oe; re += 4) {\n              var Y = Q[re] + Q[re + 1] + Q[re + 2] + Q[re + 3];\n              if ((Y += G[re] + G[re + 1] + G[re + 2] + G[re + 3]) === 0)\n                Q[re] = 1;\n              else {\n                var k = 1 / Y;\n                Q[re] *= k, Q[re + 1] *= k, Q[re + 2] *= k, Q[re + 3] *= k, G[re] *= k, G[re + 1] *= k, G[re + 2] *= k, G[re + 3] *= k;\n              }\n            }\n            this.setVerticesData(c.b.MatricesWeightsKind, Q), this.setVerticesData(c.b.MatricesWeightsKind, G);\n          }, L.prototype.validateSkinning = function() {\n            var G = this.getVerticesData(c.b.MatricesWeightsExtraKind), Q = this.getVerticesData(c.b.MatricesWeightsKind);\n            if (Q === null || this.skeleton == null)\n              return { skinned: !1, valid: !0, report: \"not skinned\" };\n            for (var oe = Q.length, re = 0, Y = 0, k = 0, H = 0, Z = G === null ? 4 : 8, W = new Array(), q = 0; q <= Z; q++)\n              W[q] = 0;\n            for (q = 0; q < oe; q += 4) {\n              for (var he = Q[q], ge = he, me = ge === 0 ? 0 : 1, _e = 1; _e < Z; _e++) {\n                var ye = _e < 4 ? Q[q + _e] : G[q + _e - 4];\n                ye > he && re++, ye !== 0 && me++, ge += ye, he = ye;\n              }\n              if (W[me]++, me > k && (k = me), ge === 0)\n                Y++;\n              else {\n                var Pe = 1 / ge, be = 0;\n                for (_e = 0; _e < Z; _e++)\n                  be += _e < 4 ? Math.abs(Q[q + _e] - Q[q + _e] * Pe) : Math.abs(G[q + _e - 4] - G[q + _e - 4] * Pe);\n                be > 1e-3 && H++;\n              }\n            }\n            var Fe = this.skeleton.bones.length, ke = this.getVerticesData(c.b.MatricesIndicesKind), We = this.getVerticesData(c.b.MatricesIndicesExtraKind), je = 0;\n            for (q = 0; q < oe; q += 4)\n              for (_e = 0; _e < Z; _e++) {\n                var He = _e < 4 ? ke[q + _e] : We[q + _e - 4];\n                (He >= Fe || He < 0) && je++;\n              }\n            return { skinned: !0, valid: Y === 0 && H === 0 && je === 0, report: \"Number of Weights = \" + oe / 4 + `\nMaximum influences = ` + k + `\nMissing Weights = ` + Y + `\nNot Sorted = ` + re + `\nNot Normalized = ` + H + `\nWeightCounts = [` + W + `]\nNumber of bones = ` + Fe + `\nBad Bone Indices = ` + je };\n          }, L.prototype._checkDelayState = function() {\n            var G = this.getScene();\n            return this._geometry ? this._geometry.load(G) : this.delayLoadState === D.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = D.a.DELAYLOADSTATE_LOADING, this._queueLoad(G)), this;\n          }, L.prototype._queueLoad = function(G) {\n            var Q = this;\n            G._addPendingData(this);\n            var oe = this.delayLoadingFile.indexOf(\".babylonbinarymeshdata\") !== -1;\n            return C.b.LoadFile(this.delayLoadingFile, function(re) {\n              re instanceof ArrayBuffer ? Q._delayLoadingFunction(re, Q) : Q._delayLoadingFunction(JSON.parse(re), Q), Q.instances.forEach(function(Y) {\n                Y.refreshBoundingInfo(), Y._syncSubMeshes();\n              }), Q.delayLoadState = D.a.DELAYLOADSTATE_LOADED, G._removePendingData(Q);\n            }, function() {\n            }, G.offlineProvider, oe), this;\n          }, L.prototype.isInFrustum = function(G) {\n            return this.delayLoadState !== D.a.DELAYLOADSTATE_LOADING && !!$.prototype.isInFrustum.call(this, G) && (this._checkDelayState(), !0);\n          }, L.prototype.setMaterialByID = function(G) {\n            var Q, oe = this.getScene().materials;\n            for (Q = oe.length - 1; Q > -1; Q--)\n              if (oe[Q].id === G)\n                return this.material = oe[Q], this;\n            var re = this.getScene().multiMaterials;\n            for (Q = re.length - 1; Q > -1; Q--)\n              if (re[Q].id === G)\n                return this.material = re[Q], this;\n            return this;\n          }, L.prototype.getAnimatables = function() {\n            var G = new Array();\n            return this.material && G.push(this.material), this.skeleton && G.push(this.skeleton), G;\n          }, L.prototype.bakeTransformIntoVertices = function(G) {\n            if (!this.isVerticesDataPresent(c.b.PositionKind))\n              return this;\n            var Q = this.subMeshes.splice(0);\n            this._resetPointsArrayCache();\n            var oe, re = this.getVerticesData(c.b.PositionKind), Y = new Array();\n            for (oe = 0; oe < re.length; oe += 3)\n              O.e.TransformCoordinates(O.e.FromArray(re, oe), G).toArray(Y, oe);\n            if (this.setVerticesData(c.b.PositionKind, Y, this.getVertexBuffer(c.b.PositionKind).isUpdatable()), this.isVerticesDataPresent(c.b.NormalKind)) {\n              for (re = this.getVerticesData(c.b.NormalKind), Y = [], oe = 0; oe < re.length; oe += 3)\n                O.e.TransformNormal(O.e.FromArray(re, oe), G).normalize().toArray(Y, oe);\n              this.setVerticesData(c.b.NormalKind, Y, this.getVertexBuffer(c.b.NormalKind).isUpdatable());\n            }\n            return G.m[0] * G.m[5] * G.m[10] < 0 && this.flipFaces(), this.releaseSubMeshes(), this.subMeshes = Q, this;\n          }, L.prototype.bakeCurrentTransformIntoVertices = function(G) {\n            return G === void 0 && (G = !0), this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)), this.resetLocalMatrix(G), this;\n          }, Object.defineProperty(L.prototype, \"_positions\", { get: function() {\n            return this._geometry ? this._geometry._positions : null;\n          }, enumerable: !1, configurable: !0 }), L.prototype._resetPointsArrayCache = function() {\n            return this._geometry && this._geometry._resetPointsArrayCache(), this;\n          }, L.prototype._generatePointsArray = function() {\n            return !!this._geometry && this._geometry._generatePointsArray();\n          }, L.prototype.clone = function(G, Q, oe, re) {\n            return G === void 0 && (G = \"\"), Q === void 0 && (Q = null), re === void 0 && (re = !0), new L(G, this.getScene(), Q, this, oe, re);\n          }, L.prototype.dispose = function(G, Q) {\n            Q === void 0 && (Q = !1), this.morphTargetManager = null, this._geometry && this._geometry.releaseForMesh(this, !0);\n            var oe = this._internalMeshDataInfo;\n            if (oe._onBeforeDrawObservable && oe._onBeforeDrawObservable.clear(), oe._onBeforeBindObservable && oe._onBeforeBindObservable.clear(), oe._onBeforeRenderObservable && oe._onBeforeRenderObservable.clear(), oe._onAfterRenderObservable && oe._onAfterRenderObservable.clear(), this._scene.useClonedMeshMap) {\n              if (oe.meshMap)\n                for (var re in oe.meshMap)\n                  (H = oe.meshMap[re]) && (H._internalMeshDataInfo._source = null, oe.meshMap[re] = void 0);\n              oe._source && oe._source._internalMeshDataInfo.meshMap && (oe._source._internalMeshDataInfo.meshMap[this.uniqueId] = void 0);\n            } else\n              for (var Y = 0, k = this.getScene().meshes; Y < k.length; Y++) {\n                var H;\n                (H = k[Y])._internalMeshDataInfo && H._internalMeshDataInfo._source && H._internalMeshDataInfo._source === this && (H._internalMeshDataInfo._source = null);\n              }\n            oe._source = null, this._disposeInstanceSpecificData(), this._disposeThinInstanceSpecificData(), $.prototype.dispose.call(this, G, Q);\n          }, L.prototype._disposeInstanceSpecificData = function() {\n          }, L.prototype._disposeThinInstanceSpecificData = function() {\n          }, L.prototype.applyDisplacementMap = function(G, Q, oe, re, Y, k, H) {\n            var Z = this;\n            H === void 0 && (H = !1);\n            var W = this.getScene();\n            return C.b.LoadImage(G, function(q) {\n              var he = q.width, ge = q.height, me = ne.a.CreateCanvas(he, ge).getContext(\"2d\");\n              me.drawImage(q, 0, 0);\n              var _e = me.getImageData(0, 0, he, ge).data;\n              Z.applyDisplacementMapFromBuffer(_e, he, ge, Q, oe, Y, k, H), re && re(Z);\n            }, function() {\n            }, W.offlineProvider), this;\n          }, L.prototype.applyDisplacementMapFromBuffer = function(G, Q, oe, re, Y, k, H, Z) {\n            if (Z === void 0 && (Z = !1), !this.isVerticesDataPresent(c.b.PositionKind) || !this.isVerticesDataPresent(c.b.NormalKind) || !this.isVerticesDataPresent(c.b.UVKind))\n              return N.a.Warn(\"Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing\"), this;\n            var W = this.getVerticesData(c.b.PositionKind, !0, !0), q = this.getVerticesData(c.b.NormalKind), he = this.getVerticesData(c.b.UVKind), ge = O.e.Zero(), me = O.e.Zero(), _e = O.d.Zero();\n            k = k || O.d.Zero(), H = H || new O.d(1, 1);\n            for (var ye = 0; ye < W.length; ye += 3) {\n              O.e.FromArrayToRef(W, ye, ge), O.e.FromArrayToRef(q, ye, me), O.d.FromArrayToRef(he, ye / 3 * 2, _e);\n              var Pe = 4 * ((Math.abs(_e.x * H.x + k.x % 1) * (Q - 1) % Q | 0) + (Math.abs(_e.y * H.y + k.y % 1) * (oe - 1) % oe | 0) * Q), be = 0.3 * (G[Pe] / 255) + 0.59 * (G[Pe + 1] / 255) + 0.11 * (G[Pe + 2] / 255);\n              me.normalize(), me.scaleInPlace(re + (Y - re) * be), (ge = ge.add(me)).toArray(W, ye);\n            }\n            return T.a.ComputeNormals(W, this.getIndices(), q), Z ? (this.setVerticesData(c.b.PositionKind, W), this.setVerticesData(c.b.NormalKind, q)) : (this.updateVerticesData(c.b.PositionKind, W), this.updateVerticesData(c.b.NormalKind, q)), this;\n          }, L.prototype.convertToFlatShadedMesh = function() {\n            var G, Q, oe = this.getVerticesDataKinds(), re = {}, Y = {}, k = {}, H = !1;\n            for (G = 0; G < oe.length; G++) {\n              Q = oe[G];\n              var Z = this.getVertexBuffer(Q);\n              Q !== c.b.NormalKind ? (re[Q] = Z, Y[Q] = re[Q].getData(), k[Q] = []) : (H = Z.isUpdatable(), oe.splice(G, 1), G--);\n            }\n            var W, q = this.subMeshes.slice(0), he = this.getIndices(), ge = this.getTotalIndices();\n            for (W = 0; W < ge; W++) {\n              var me = he[W];\n              for (G = 0; G < oe.length; G++)\n                for (var _e = re[Q = oe[G]].getStrideSize(), ye = 0; ye < _e; ye++)\n                  k[Q].push(Y[Q][me * _e + ye]);\n            }\n            var Pe = [], be = k[c.b.PositionKind];\n            for (W = 0; W < ge; W += 3) {\n              he[W] = W, he[W + 1] = W + 1, he[W + 2] = W + 2;\n              for (var Fe = O.e.FromArray(be, 3 * W), ke = O.e.FromArray(be, 3 * (W + 1)), We = O.e.FromArray(be, 3 * (W + 2)), je = Fe.subtract(ke), He = We.subtract(ke), Qe = O.e.Normalize(O.e.Cross(je, He)), Ge = 0; Ge < 3; Ge++)\n                Pe.push(Qe.x), Pe.push(Qe.y), Pe.push(Qe.z);\n            }\n            for (this.setIndices(he), this.setVerticesData(c.b.NormalKind, Pe, H), G = 0; G < oe.length; G++)\n              Q = oe[G], this.setVerticesData(Q, k[Q], re[Q].isUpdatable());\n            this.releaseSubMeshes();\n            for (var tt = 0; tt < q.length; tt++) {\n              var Je = q[tt];\n              g.a.AddToMesh(Je.materialIndex, Je.indexStart, Je.indexCount, Je.indexStart, Je.indexCount, this);\n            }\n            return this.synchronizeInstances(), this;\n          }, L.prototype.convertToUnIndexedMesh = function() {\n            var G, Q, oe = this.getVerticesDataKinds(), re = {}, Y = {}, k = {};\n            for (G = 0; G < oe.length; G++) {\n              Q = oe[G];\n              var H = this.getVertexBuffer(Q);\n              re[Q] = H, Y[Q] = re[Q].getData(), k[Q] = [];\n            }\n            var Z, W = this.subMeshes.slice(0), q = this.getIndices(), he = this.getTotalIndices();\n            for (Z = 0; Z < he; Z++) {\n              var ge = q[Z];\n              for (G = 0; G < oe.length; G++)\n                for (var me = re[Q = oe[G]].getStrideSize(), _e = 0; _e < me; _e++)\n                  k[Q].push(Y[Q][ge * me + _e]);\n            }\n            for (Z = 0; Z < he; Z += 3)\n              q[Z] = Z, q[Z + 1] = Z + 1, q[Z + 2] = Z + 2;\n            for (this.setIndices(q), G = 0; G < oe.length; G++)\n              Q = oe[G], this.setVerticesData(Q, k[Q], re[Q].isUpdatable());\n            this.releaseSubMeshes();\n            for (var ye = 0; ye < W.length; ye++) {\n              var Pe = W[ye];\n              g.a.AddToMesh(Pe.materialIndex, Pe.indexStart, Pe.indexCount, Pe.indexStart, Pe.indexCount, this);\n            }\n            return this._unIndexed = !0, this.synchronizeInstances(), this;\n          }, L.prototype.flipFaces = function(G) {\n            G === void 0 && (G = !1);\n            var Q, oe, re = T.a.ExtractFromMesh(this);\n            if (G && this.isVerticesDataPresent(c.b.NormalKind) && re.normals)\n              for (Q = 0; Q < re.normals.length; Q++)\n                re.normals[Q] *= -1;\n            if (re.indices)\n              for (Q = 0; Q < re.indices.length; Q += 3)\n                oe = re.indices[Q + 1], re.indices[Q + 1] = re.indices[Q + 2], re.indices[Q + 2] = oe;\n            return re.applyToMesh(this, this.isVertexBufferUpdatable(c.b.PositionKind)), this;\n          }, L.prototype.increaseVertices = function(G) {\n            var Q = T.a.ExtractFromMesh(this), oe = Q.uvs, re = Q.indices, Y = Q.positions, k = Q.normals;\n            if (re && Y && k && oe) {\n              for (var H, Z, W = G + 1, q = new Array(), he = 0; he < W + 1; he++)\n                q[he] = new Array();\n              var ge, me = new O.e(0, 0, 0), _e = new O.e(0, 0, 0), ye = new O.d(0, 0), Pe = new Array(), be = new Array(), Fe = new Array(), ke = Y.length, We = oe.length;\n              for (he = 0; he < re.length; he += 3) {\n                be[0] = re[he], be[1] = re[he + 1], be[2] = re[he + 2];\n                for (var je = 0; je < 3; je++)\n                  if (H = be[je], Z = be[(je + 1) % 3], Fe[H] === void 0 && Fe[Z] === void 0 ? (Fe[H] = new Array(), Fe[Z] = new Array()) : (Fe[H] === void 0 && (Fe[H] = new Array()), Fe[Z] === void 0 && (Fe[Z] = new Array())), Fe[H][Z] === void 0 && Fe[Z][H] === void 0) {\n                    Fe[H][Z] = [], me.x = (Y[3 * Z] - Y[3 * H]) / W, me.y = (Y[3 * Z + 1] - Y[3 * H + 1]) / W, me.z = (Y[3 * Z + 2] - Y[3 * H + 2]) / W, _e.x = (k[3 * Z] - k[3 * H]) / W, _e.y = (k[3 * Z + 1] - k[3 * H + 1]) / W, _e.z = (k[3 * Z + 2] - k[3 * H + 2]) / W, ye.x = (oe[2 * Z] - oe[2 * H]) / W, ye.y = (oe[2 * Z + 1] - oe[2 * H + 1]) / W, Fe[H][Z].push(H);\n                    for (var He = 1; He < W; He++)\n                      Fe[H][Z].push(Y.length / 3), Y[ke] = Y[3 * H] + He * me.x, k[ke++] = k[3 * H] + He * _e.x, Y[ke] = Y[3 * H + 1] + He * me.y, k[ke++] = k[3 * H + 1] + He * _e.y, Y[ke] = Y[3 * H + 2] + He * me.z, k[ke++] = k[3 * H + 2] + He * _e.z, oe[We++] = oe[2 * H] + He * ye.x, oe[We++] = oe[2 * H + 1] + He * ye.y;\n                    Fe[H][Z].push(Z), Fe[Z][H] = new Array(), ge = Fe[H][Z].length;\n                    for (var Qe = 0; Qe < ge; Qe++)\n                      Fe[Z][H][Qe] = Fe[H][Z][ge - 1 - Qe];\n                  }\n                for (q[0][0] = re[he], q[1][0] = Fe[re[he]][re[he + 1]][1], q[1][1] = Fe[re[he]][re[he + 2]][1], He = 2; He < W; He++)\n                  for (q[He][0] = Fe[re[he]][re[he + 1]][He], q[He][He] = Fe[re[he]][re[he + 2]][He], me.x = (Y[3 * q[He][He]] - Y[3 * q[He][0]]) / He, me.y = (Y[3 * q[He][He] + 1] - Y[3 * q[He][0] + 1]) / He, me.z = (Y[3 * q[He][He] + 2] - Y[3 * q[He][0] + 2]) / He, _e.x = (k[3 * q[He][He]] - k[3 * q[He][0]]) / He, _e.y = (k[3 * q[He][He] + 1] - k[3 * q[He][0] + 1]) / He, _e.z = (k[3 * q[He][He] + 2] - k[3 * q[He][0] + 2]) / He, ye.x = (oe[2 * q[He][He]] - oe[2 * q[He][0]]) / He, ye.y = (oe[2 * q[He][He] + 1] - oe[2 * q[He][0] + 1]) / He, je = 1; je < He; je++)\n                    q[He][je] = Y.length / 3, Y[ke] = Y[3 * q[He][0]] + je * me.x, k[ke++] = k[3 * q[He][0]] + je * _e.x, Y[ke] = Y[3 * q[He][0] + 1] + je * me.y, k[ke++] = k[3 * q[He][0] + 1] + je * _e.y, Y[ke] = Y[3 * q[He][0] + 2] + je * me.z, k[ke++] = k[3 * q[He][0] + 2] + je * _e.z, oe[We++] = oe[2 * q[He][0]] + je * ye.x, oe[We++] = oe[2 * q[He][0] + 1] + je * ye.y;\n                for (q[W] = Fe[re[he + 1]][re[he + 2]], Pe.push(q[0][0], q[1][0], q[1][1]), He = 1; He < W; He++) {\n                  for (je = 0; je < He; je++)\n                    Pe.push(q[He][je], q[He + 1][je], q[He + 1][je + 1]), Pe.push(q[He][je], q[He + 1][je + 1], q[He][je + 1]);\n                  Pe.push(q[He][je], q[He + 1][je], q[He + 1][je + 1]);\n                }\n              }\n              Q.indices = Pe, Q.applyToMesh(this, this.isVertexBufferUpdatable(c.b.PositionKind));\n            } else\n              N.a.Warn(\"VertexData contains null entries\");\n          }, L.prototype.forceSharedVertices = function() {\n            var G = T.a.ExtractFromMesh(this), Q = G.uvs, oe = G.indices, re = G.positions, Y = G.colors;\n            if (oe === void 0 || re === void 0 || oe === null || re === null)\n              N.a.Warn(\"VertexData contains empty entries\");\n            else {\n              for (var k, H, Z = new Array(), W = new Array(), q = new Array(), he = new Array(), ge = new Array(), me = 0, _e = {}, ye = 0; ye < oe.length; ye += 3) {\n                H = [oe[ye], oe[ye + 1], oe[ye + 2]], ge = new Array();\n                for (var Pe = 0; Pe < 3; Pe++) {\n                  ge[Pe] = \"\";\n                  for (var be = 0; be < 3; be++)\n                    Math.abs(re[3 * H[Pe] + be]) < 1e-8 && (re[3 * H[Pe] + be] = 0), ge[Pe] += re[3 * H[Pe] + be] + \"|\";\n                }\n                if (ge[0] != ge[1] && ge[0] != ge[2] && ge[1] != ge[2])\n                  for (Pe = 0; Pe < 3; Pe++) {\n                    if ((k = _e[ge[Pe]]) === void 0) {\n                      for (_e[ge[Pe]] = me, k = me++, be = 0; be < 3; be++)\n                        Z.push(re[3 * H[Pe] + be]);\n                      if (Y != null)\n                        for (be = 0; be < 4; be++)\n                          he.push(Y[4 * H[Pe] + be]);\n                      if (Q != null)\n                        for (be = 0; be < 2; be++)\n                          q.push(Q[2 * H[Pe] + be]);\n                    }\n                    W.push(k);\n                  }\n              }\n              var Fe = new Array();\n              T.a.ComputeNormals(Z, W, Fe), G.positions = Z, G.indices = W, G.normals = Fe, Q != null && (G.uvs = q), Y != null && (G.colors = he), G.applyToMesh(this, this.isVertexBufferUpdatable(c.b.PositionKind));\n            }\n          }, L._instancedMeshFactory = function(G, Q) {\n            throw U.a.WarnImport(\"InstancedMesh\");\n          }, L._PhysicsImpostorParser = function(G, Q, oe) {\n            throw U.a.WarnImport(\"PhysicsImpostor\");\n          }, L.prototype.createInstance = function(G) {\n            var Q = this.geometry;\n            if (Q && Q.meshes.length > 1)\n              for (var oe = 0, re = Q.meshes.slice(0); oe < re.length; oe++) {\n                var Y = re[oe];\n                Y !== this && Y.makeGeometryUnique();\n              }\n            return L._instancedMeshFactory(G, this);\n          }, L.prototype.synchronizeInstances = function() {\n            this._geometry && this._geometry.meshes.length !== 1 && this.instances.length && this.makeGeometryUnique();\n            for (var G = 0; G < this.instances.length; G++)\n              this.instances[G]._syncSubMeshes();\n            return this;\n          }, L.prototype.optimizeIndices = function(G) {\n            var Q = this, oe = this.getIndices(), re = this.getVerticesData(c.b.PositionKind);\n            if (!re || !oe)\n              return this;\n            for (var Y = new Array(), k = 0; k < re.length; k += 3)\n              Y.push(O.e.FromArray(re, k));\n            var H = new Array();\n            return C.a.SyncAsyncForLoop(Y.length, 40, function(Z) {\n              for (var W = Y.length - 1 - Z, q = Y[W], he = 0; he < W; ++he) {\n                var ge = Y[he];\n                if (q.equals(ge)) {\n                  H[W] = he;\n                  break;\n                }\n              }\n            }, function() {\n              for (var Z = 0; Z < oe.length; ++Z)\n                oe[Z] = H[oe[Z]] || oe[Z];\n              var W = Q.subMeshes.slice(0);\n              Q.setIndices(oe), Q.subMeshes = W, G && G(Q);\n            }), this;\n          }, L.prototype.serialize = function(G) {\n            G.name = this.name, G.id = this.id, G.uniqueId = this.uniqueId, G.type = this.getClassName(), I.a && I.a.HasTags(this) && (G.tags = I.a.GetTags(this)), G.position = this.position.asArray(), this.rotationQuaternion ? G.rotationQuaternion = this.rotationQuaternion.asArray() : this.rotation && (G.rotation = this.rotation.asArray()), G.scaling = this.scaling.asArray(), this._postMultiplyPivotMatrix ? G.pivotMatrix = this.getPivotMatrix().asArray() : G.localMatrix = this.getPivotMatrix().asArray(), G.isEnabled = this.isEnabled(!1), G.isVisible = this.isVisible, G.infiniteDistance = this.infiniteDistance, G.pickable = this.isPickable, G.receiveShadows = this.receiveShadows, G.billboardMode = this.billboardMode, G.visibility = this.visibility, G.checkCollisions = this.checkCollisions, G.isBlocker = this.isBlocker, G.overrideMaterialSideOrientation = this.overrideMaterialSideOrientation, this.parent && (G.parentId = this.parent.id), G.isUnIndexed = this.isUnIndexed;\n            var Q = this._geometry;\n            if (Q) {\n              var oe = Q.id;\n              G.geometryId = oe, G.subMeshes = [];\n              for (var re = 0; re < this.subMeshes.length; re++) {\n                var Y = this.subMeshes[re];\n                G.subMeshes.push({ materialIndex: Y.materialIndex, verticesStart: Y.verticesStart, verticesCount: Y.verticesCount, indexStart: Y.indexStart, indexCount: Y.indexCount });\n              }\n            }\n            this.material ? this.material.doNotSerialize || (G.materialId = this.material.id) : this.material = null, this.morphTargetManager && (G.morphTargetManagerId = this.morphTargetManager.uniqueId), this.skeleton && (G.skeletonId = this.skeleton.id, G.numBoneInfluencers = this.numBoneInfluencers), this.getScene()._getComponent(X.a.NAME_PHYSICSENGINE) && (Z = this.getPhysicsImpostor()) && (G.physicsMass = Z.getParam(\"mass\"), G.physicsFriction = Z.getParam(\"friction\"), G.physicsRestitution = Z.getParam(\"mass\"), G.physicsImpostor = Z.type), this.metadata && (G.metadata = this.metadata), G.instances = [];\n            for (var k = 0; k < this.instances.length; k++) {\n              var H = this.instances[k];\n              if (!H.doNotSerialize) {\n                var Z, W = { name: H.name, id: H.id, isEnabled: H.isEnabled(!1), isVisible: H.isVisible, isPickable: H.isPickable, checkCollisions: H.checkCollisions, position: H.position.asArray(), scaling: H.scaling.asArray() };\n                H.parent && (W.parentId = H.parent.id), H.rotationQuaternion ? W.rotationQuaternion = H.rotationQuaternion.asArray() : H.rotation && (W.rotation = H.rotation.asArray()), this.getScene()._getComponent(X.a.NAME_PHYSICSENGINE) && (Z = H.getPhysicsImpostor()) && (W.physicsMass = Z.getParam(\"mass\"), W.physicsFriction = Z.getParam(\"friction\"), W.physicsRestitution = Z.getParam(\"mass\"), W.physicsImpostor = Z.type), H.metadata && (W.metadata = H.metadata), G.instances.push(W), w.a.AppendSerializedAnimations(H, W), W.ranges = H.serializeAnimationRanges();\n              }\n            }\n            if (this._thinInstanceDataStorage.instancesCount && this._thinInstanceDataStorage.matrixData && (G.thinInstances = { instancesCount: this._thinInstanceDataStorage.instancesCount, matrixData: C.b.SliceToArray(this._thinInstanceDataStorage.matrixData), matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize }, this._userThinInstanceBuffersStorage)) {\n              var q = { data: {}, sizes: {}, strides: {} };\n              for (var he in this._userThinInstanceBuffersStorage.data)\n                q.data[he] = C.b.SliceToArray(this._userThinInstanceBuffersStorage.data[he]), q.sizes[he] = this._userThinInstanceBuffersStorage.sizes[he], q.strides[he] = this._userThinInstanceBuffersStorage.strides[he];\n              G.thinInstances.userThinInstance = q;\n            }\n            w.a.AppendSerializedAnimations(this, G), G.ranges = this.serializeAnimationRanges(), G.layerMask = this.layerMask, G.alphaIndex = this.alphaIndex, G.hasVertexAlpha = this.hasVertexAlpha, G.overlayAlpha = this.overlayAlpha, G.overlayColor = this.overlayColor.asArray(), G.renderOverlay = this.renderOverlay, G.applyFog = this.applyFog, this.actionManager && (G.actions = this.actionManager.serialize(this.name));\n          }, L.prototype._syncGeometryWithMorphTargetManager = function() {\n            if (this.geometry) {\n              this._markSubMeshesAsAttributesDirty();\n              var G = this._internalMeshDataInfo._morphTargetManager;\n              if (G && G.vertexCount) {\n                if (G.vertexCount !== this.getTotalVertices())\n                  return N.a.Error(\"Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count.\"), void (this.morphTargetManager = null);\n                for (var Q = 0; Q < G.numInfluencers; Q++) {\n                  var oe = G.getActiveTarget(Q), re = oe.getPositions();\n                  if (!re)\n                    return void N.a.Error(\"Invalid morph target. Target must have positions.\");\n                  this.geometry.setVerticesData(c.b.PositionKind + Q, re, !1, 3);\n                  var Y = oe.getNormals();\n                  Y && this.geometry.setVerticesData(c.b.NormalKind + Q, Y, !1, 3);\n                  var k = oe.getTangents();\n                  k && this.geometry.setVerticesData(c.b.TangentKind + Q, k, !1, 3);\n                  var H = oe.getUVs();\n                  H && this.geometry.setVerticesData(c.b.UVKind + \"_\" + Q, H, !1, 2);\n                }\n              } else\n                for (Q = 0; this.geometry.isVerticesDataPresent(c.b.PositionKind + Q); )\n                  this.geometry.removeVerticesData(c.b.PositionKind + Q), this.geometry.isVerticesDataPresent(c.b.NormalKind + Q) && this.geometry.removeVerticesData(c.b.NormalKind + Q), this.geometry.isVerticesDataPresent(c.b.TangentKind + Q) && this.geometry.removeVerticesData(c.b.TangentKind + Q), this.geometry.isVerticesDataPresent(c.b.UVKind + Q) && this.geometry.removeVerticesData(c.b.UVKind + \"_\" + Q), Q++;\n            }\n          }, L.Parse = function(G, Q, oe) {\n            var re;\n            if ((re = G.type && G.type === \"GroundMesh\" ? L._GroundMeshParser(G, Q) : new L(G.name, Q)).id = G.id, I.a && I.a.AddTagsTo(re, G.tags), re.position = O.e.FromArray(G.position), G.metadata !== void 0 && (re.metadata = G.metadata), G.rotationQuaternion ? re.rotationQuaternion = O.b.FromArray(G.rotationQuaternion) : G.rotation && (re.rotation = O.e.FromArray(G.rotation)), re.scaling = O.e.FromArray(G.scaling), G.localMatrix ? re.setPreTransformMatrix(O.a.FromArray(G.localMatrix)) : G.pivotMatrix && re.setPivotMatrix(O.a.FromArray(G.pivotMatrix)), re.setEnabled(G.isEnabled), re.isVisible = G.isVisible, re.infiniteDistance = G.infiniteDistance, re.showBoundingBox = G.showBoundingBox, re.showSubMeshesBoundingBox = G.showSubMeshesBoundingBox, G.applyFog !== void 0 && (re.applyFog = G.applyFog), G.pickable !== void 0 && (re.isPickable = G.pickable), G.alphaIndex !== void 0 && (re.alphaIndex = G.alphaIndex), re.receiveShadows = G.receiveShadows, re.billboardMode = G.billboardMode, G.visibility !== void 0 && (re.visibility = G.visibility), re.checkCollisions = G.checkCollisions, re.overrideMaterialSideOrientation = G.overrideMaterialSideOrientation, G.isBlocker !== void 0 && (re.isBlocker = G.isBlocker), re._shouldGenerateFlatShading = G.useFlatShading, G.freezeWorldMatrix && (re._waitingData.freezeWorldMatrix = G.freezeWorldMatrix), G.parentId && (re._waitingParentId = G.parentId), G.actions !== void 0 && (re._waitingData.actions = G.actions), G.overlayAlpha !== void 0 && (re.overlayAlpha = G.overlayAlpha), G.overlayColor !== void 0 && (re.overlayColor = x.a.FromArray(G.overlayColor)), G.renderOverlay !== void 0 && (re.renderOverlay = G.renderOverlay), re.isUnIndexed = !!G.isUnIndexed, re.hasVertexAlpha = G.hasVertexAlpha, G.delayLoadingFile ? (re.delayLoadState = D.a.DELAYLOADSTATE_NOTLOADED, re.delayLoadingFile = oe + G.delayLoadingFile, re._boundingInfo = new l.a(O.e.FromArray(G.boundingBoxMinimum), O.e.FromArray(G.boundingBoxMaximum)), G._binaryInfo && (re._binaryInfo = G._binaryInfo), re._delayInfo = [], G.hasUVs && re._delayInfo.push(c.b.UVKind), G.hasUVs2 && re._delayInfo.push(c.b.UV2Kind), G.hasUVs3 && re._delayInfo.push(c.b.UV3Kind), G.hasUVs4 && re._delayInfo.push(c.b.UV4Kind), G.hasUVs5 && re._delayInfo.push(c.b.UV5Kind), G.hasUVs6 && re._delayInfo.push(c.b.UV6Kind), G.hasColors && re._delayInfo.push(c.b.ColorKind), G.hasMatricesIndices && re._delayInfo.push(c.b.MatricesIndicesKind), G.hasMatricesWeights && re._delayInfo.push(c.b.MatricesWeightsKind), re._delayLoadingFunction = S.a._ImportGeometry, b.a.ForceFullSceneLoadingForIncremental && re._checkDelayState()) : S.a._ImportGeometry(G, re), G.materialId ? re.setMaterialByID(G.materialId) : re.material = null, G.morphTargetManagerId > -1 && (re.morphTargetManager = Q.getMorphTargetManagerById(G.morphTargetManagerId)), G.skeletonId !== void 0 && G.skeletonId !== null && (re.skeleton = Q.getLastSkeletonByID(G.skeletonId), G.numBoneInfluencers && (re.numBoneInfluencers = G.numBoneInfluencers)), G.animations) {\n              for (var Y = 0; Y < G.animations.length; Y++) {\n                var k = G.animations[Y];\n                (q = M.a.GetClass(\"BABYLON.Animation\")) && re.animations.push(q.Parse(k));\n              }\n              m.a.ParseAnimationRanges(re, G, Q);\n            }\n            if (G.autoAnimate && Q.beginAnimation(re, G.autoAnimateFrom, G.autoAnimateTo, G.autoAnimateLoop, G.autoAnimateSpeed || 1), G.layerMask && !isNaN(G.layerMask) ? re.layerMask = Math.abs(parseInt(G.layerMask)) : re.layerMask = 268435455, G.physicsImpostor && L._PhysicsImpostorParser(Q, re, G), G.lodMeshIds && (re._waitingData.lods = { ids: G.lodMeshIds, distances: G.lodDistances ? G.lodDistances : null, coverages: G.lodCoverages ? G.lodCoverages : null }), G.instances)\n              for (var H = 0; H < G.instances.length; H++) {\n                var Z = G.instances[H], W = re.createInstance(Z.name);\n                if (Z.id && (W.id = Z.id), I.a && (Z.tags ? I.a.AddTagsTo(W, Z.tags) : I.a.AddTagsTo(W, G.tags)), W.position = O.e.FromArray(Z.position), Z.metadata !== void 0 && (W.metadata = Z.metadata), Z.parentId && (W._waitingParentId = Z.parentId), Z.isEnabled !== void 0 && Z.isEnabled !== null && W.setEnabled(Z.isEnabled), Z.isVisible !== void 0 && Z.isVisible !== null && (W.isVisible = Z.isVisible), Z.isPickable !== void 0 && Z.isPickable !== null && (W.isPickable = Z.isPickable), Z.rotationQuaternion ? W.rotationQuaternion = O.b.FromArray(Z.rotationQuaternion) : Z.rotation && (W.rotation = O.e.FromArray(Z.rotation)), W.scaling = O.e.FromArray(Z.scaling), Z.checkCollisions != null && Z.checkCollisions != null && (W.checkCollisions = Z.checkCollisions), Z.pickable != null && Z.pickable != null && (W.isPickable = Z.pickable), Z.showBoundingBox != null && Z.showBoundingBox != null && (W.showBoundingBox = Z.showBoundingBox), Z.showSubMeshesBoundingBox != null && Z.showSubMeshesBoundingBox != null && (W.showSubMeshesBoundingBox = Z.showSubMeshesBoundingBox), Z.alphaIndex != null && Z.showSubMeshesBoundingBox != null && (W.alphaIndex = Z.alphaIndex), Z.physicsImpostor && L._PhysicsImpostorParser(Q, W, Z), Z.animations) {\n                  for (Y = 0; Y < Z.animations.length; Y++) {\n                    var q;\n                    k = Z.animations[Y], (q = M.a.GetClass(\"BABYLON.Animation\")) && W.animations.push(q.Parse(k));\n                  }\n                  m.a.ParseAnimationRanges(W, Z, Q), Z.autoAnimate && Q.beginAnimation(W, Z.autoAnimateFrom, Z.autoAnimateTo, Z.autoAnimateLoop, Z.autoAnimateSpeed || 1);\n                }\n              }\n            if (G.thinInstances) {\n              var he = G.thinInstances;\n              if (he.matrixData ? (re.thinInstanceSetBuffer(\"matrix\", new Float32Array(he.matrixData), 16, !1), re._thinInstanceDataStorage.matrixBufferSize = he.matrixBufferSize, re._thinInstanceDataStorage.instancesCount = he.instancesCount) : re._thinInstanceDataStorage.matrixBufferSize = he.matrixBufferSize, G.thinInstances.userThinInstance) {\n                var ge = G.thinInstances.userThinInstance;\n                for (var me in ge.data)\n                  re.thinInstanceSetBuffer(me, new Float32Array(ge.data[me]), ge.strides[me], !1), re._userThinInstanceBuffersStorage.sizes[me] = ge.sizes[me];\n              }\n            }\n            return re;\n          }, L.CreateRibbon = function(G, Q, oe, re, Y, k, H, Z, W) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateDisc = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateBox = function(G, Q, oe, re, Y) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateSphere = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateHemisphere = function(G, Q, oe, re) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateCylinder = function(G, Q, oe, re, Y, k, H, Z, W) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTorus = function(G, Q, oe, re, Y, k, H) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTorusKnot = function(G, Q, oe, re, Y, k, H, Z, W, q) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateLines = function(G, Q, oe, re, Y) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateDashedLines = function(G, Q, oe, re, Y, k, H, Z) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreatePolygon = function(G, Q, oe, re, Y, k, H) {\n            throw H === void 0 && (H = earcut), U.a.WarnImport(\"MeshBuilder\");\n          }, L.ExtrudePolygon = function(G, Q, oe, re, Y, k, H, Z) {\n            throw Z === void 0 && (Z = earcut), U.a.WarnImport(\"MeshBuilder\");\n          }, L.ExtrudeShape = function(G, Q, oe, re, Y, k, H, Z, W, q) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.ExtrudeShapeCustom = function(G, Q, oe, re, Y, k, H, Z, W, q, he, ge) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateLathe = function(G, Q, oe, re, Y, k, H) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreatePlane = function(G, Q, oe, re, Y) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateGround = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTiledGround = function(G, Q, oe, re, Y, k, H, Z, W) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateGroundFromHeightMap = function(G, Q, oe, re, Y, k, H, Z, W, q, he) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTube = function(G, Q, oe, re, Y, k, H, Z, W, q) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreatePolyhedron = function(G, Q, oe) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateIcoSphere = function(G, Q, oe) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateDecal = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateCapsule = function(G, Q, oe) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.prototype.setPositionsForCPUSkinning = function() {\n            var G = this._internalMeshDataInfo;\n            if (!G._sourcePositions) {\n              var Q = this.getVerticesData(c.b.PositionKind);\n              if (!Q)\n                return G._sourcePositions;\n              G._sourcePositions = new Float32Array(Q), this.isVertexBufferUpdatable(c.b.PositionKind) || this.setVerticesData(c.b.PositionKind, Q, !0);\n            }\n            return G._sourcePositions;\n          }, L.prototype.setNormalsForCPUSkinning = function() {\n            var G = this._internalMeshDataInfo;\n            if (!G._sourceNormals) {\n              var Q = this.getVerticesData(c.b.NormalKind);\n              if (!Q)\n                return G._sourceNormals;\n              G._sourceNormals = new Float32Array(Q), this.isVertexBufferUpdatable(c.b.NormalKind) || this.setVerticesData(c.b.NormalKind, Q, !0);\n            }\n            return G._sourceNormals;\n          }, L.prototype.applySkeleton = function(G) {\n            if (!this.geometry)\n              return this;\n            if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId())\n              return this;\n            if (this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(), !this.isVerticesDataPresent(c.b.PositionKind))\n              return this;\n            if (!this.isVerticesDataPresent(c.b.MatricesIndicesKind))\n              return this;\n            if (!this.isVerticesDataPresent(c.b.MatricesWeightsKind))\n              return this;\n            var Q = this.isVerticesDataPresent(c.b.NormalKind), oe = this._internalMeshDataInfo;\n            if (!oe._sourcePositions) {\n              var re = this.subMeshes.slice();\n              this.setPositionsForCPUSkinning(), this.subMeshes = re;\n            }\n            Q && !oe._sourceNormals && this.setNormalsForCPUSkinning();\n            var Y = this.getVerticesData(c.b.PositionKind);\n            if (!Y)\n              return this;\n            Y instanceof Float32Array || (Y = new Float32Array(Y));\n            var k = this.getVerticesData(c.b.NormalKind);\n            if (Q) {\n              if (!k)\n                return this;\n              k instanceof Float32Array || (k = new Float32Array(k));\n            }\n            var H = this.getVerticesData(c.b.MatricesIndicesKind), Z = this.getVerticesData(c.b.MatricesWeightsKind);\n            if (!Z || !H)\n              return this;\n            for (var W, q = this.numBoneInfluencers > 4, he = q ? this.getVerticesData(c.b.MatricesIndicesExtraKind) : null, ge = q ? this.getVerticesData(c.b.MatricesWeightsExtraKind) : null, me = G.getTransformMatrices(this), _e = O.e.Zero(), ye = new O.a(), Pe = new O.a(), be = 0, Fe = 0; Fe < Y.length; Fe += 3, be += 4) {\n              var ke;\n              for (W = 0; W < 4; W++)\n                (ke = Z[be + W]) > 0 && (O.a.FromFloat32ArrayToRefScaled(me, Math.floor(16 * H[be + W]), ke, Pe), ye.addToSelf(Pe));\n              if (q)\n                for (W = 0; W < 4; W++)\n                  (ke = ge[be + W]) > 0 && (O.a.FromFloat32ArrayToRefScaled(me, Math.floor(16 * he[be + W]), ke, Pe), ye.addToSelf(Pe));\n              O.e.TransformCoordinatesFromFloatsToRef(oe._sourcePositions[Fe], oe._sourcePositions[Fe + 1], oe._sourcePositions[Fe + 2], ye, _e), _e.toArray(Y, Fe), Q && (O.e.TransformNormalFromFloatsToRef(oe._sourceNormals[Fe], oe._sourceNormals[Fe + 1], oe._sourceNormals[Fe + 2], ye, _e), _e.toArray(k, Fe)), ye.reset();\n            }\n            return this.updateVerticesData(c.b.PositionKind, Y), Q && this.updateVerticesData(c.b.NormalKind, k), this;\n          }, L.MinMax = function(G) {\n            var Q = null, oe = null;\n            return G.forEach(function(re) {\n              var Y = re.getBoundingInfo().boundingBox;\n              Q && oe ? (Q.minimizeInPlace(Y.minimumWorld), oe.maximizeInPlace(Y.maximumWorld)) : (Q = Y.minimumWorld, oe = Y.maximumWorld);\n            }), Q && oe ? { min: Q, max: oe } : { min: O.e.Zero(), max: O.e.Zero() };\n          }, L.Center = function(G) {\n            var Q = G instanceof Array ? L.MinMax(G) : G;\n            return O.e.Center(Q.min, Q.max);\n          }, L.MergeMeshes = function(G, Q, oe, re, Y, k) {\n            var H;\n            if (Q === void 0 && (Q = !0), !oe) {\n              var Z = 0;\n              for (H = 0; H < G.length; H++)\n                if (G[H] && (Z += G[H].getTotalVertices()) >= 65536)\n                  return N.a.Warn(\"Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices\"), null;\n            }\n            if (k) {\n              var W, q, he = null;\n              Y = !1;\n            }\n            var ge, me = new Array(), _e = new Array(), ye = null, Pe = new Array(), be = null;\n            for (H = 0; H < G.length; H++)\n              if (G[H]) {\n                var Fe = G[H];\n                if (Fe.isAnInstance)\n                  return N.a.Warn(\"Cannot merge instance meshes.\"), null;\n                var ke = Fe.computeWorldMatrix(!0);\n                if ((ge = T.a.ExtractFromMesh(Fe, !0, !0)).transform(ke), ye ? ye.merge(ge, oe) : (ye = ge, be = Fe), Y && Pe.push(Fe.getTotalIndices()), k)\n                  if (Fe.material) {\n                    var We = Fe.material;\n                    if (We instanceof v.a) {\n                      for (q = 0; q < We.subMaterials.length; q++)\n                        me.indexOf(We.subMaterials[q]) < 0 && me.push(We.subMaterials[q]);\n                      for (W = 0; W < Fe.subMeshes.length; W++)\n                        _e.push(me.indexOf(We.subMaterials[Fe.subMeshes[W].materialIndex])), Pe.push(Fe.subMeshes[W].indexCount);\n                    } else\n                      for (me.indexOf(We) < 0 && me.push(We), W = 0; W < Fe.subMeshes.length; W++)\n                        _e.push(me.indexOf(We)), Pe.push(Fe.subMeshes[W].indexCount);\n                  } else\n                    for (W = 0; W < Fe.subMeshes.length; W++)\n                      _e.push(0), Pe.push(Fe.subMeshes[W].indexCount);\n              }\n            if (be = be, re || (re = new L(be.name + \"_merged\", be.getScene())), ye.applyToMesh(re), re.checkCollisions = be.checkCollisions, re.overrideMaterialSideOrientation = be.overrideMaterialSideOrientation, Q)\n              for (H = 0; H < G.length; H++)\n                G[H] && G[H].dispose();\n            if (Y || k) {\n              re.releaseSubMeshes(), H = 0;\n              for (var je = 0; H < Pe.length; )\n                g.a.CreateFromIndices(0, je, Pe[H], re), je += Pe[H], H++;\n            }\n            if (k) {\n              for ((he = new v.a(be.name + \"_merged\", be.getScene())).subMaterials = me, W = 0; W < re.subMeshes.length; W++)\n                re.subMeshes[W].materialIndex = _e[W];\n              re.material = he;\n            } else\n              re.material = be.material;\n            return re;\n          }, L.prototype.addInstance = function(G) {\n            G._indexInSourceMeshInstanceArray = this.instances.length, this.instances.push(G);\n          }, L.prototype.removeInstance = function(G) {\n            var Q = G._indexInSourceMeshInstanceArray;\n            if (Q != -1) {\n              if (Q !== this.instances.length - 1) {\n                var oe = this.instances[this.instances.length - 1];\n                this.instances[Q] = oe, oe._indexInSourceMeshInstanceArray = Q;\n              }\n              G._indexInSourceMeshInstanceArray = -1, this.instances.pop();\n            }\n          }, L.FRONTSIDE = T.a.FRONTSIDE, L.BACKSIDE = T.a.BACKSIDE, L.DOUBLESIDE = T.a.DOUBLESIDE, L.DEFAULTSIDE = T.a.DEFAULTSIDE, L.NO_CAP = 0, L.CAP_START = 1, L.CAP_END = 2, L.CAP_ALL = 3, L.NO_FLIP = 0, L.FLIP_TILE = 1, L.ROTATE_TILE = 2, L.FLIP_ROW = 3, L.ROTATE_ROW = 4, L.FLIP_N_ROTATE_TILE = 5, L.FLIP_N_ROTATE_ROW = 6, L.CENTER = 0, L.LEFT = 1, L.RIGHT = 2, L.TOP = 3, L.BOTTOM = 4, L._GroundMeshParser = function(G, Q) {\n            throw U.a.WarnImport(\"GroundMesh\");\n          }, L;\n        }(E.a);\n        M.a.RegisteredTypes[\"BABYLON.Mesh\"] = K;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _._AddLogEntry = function(C) {\n            _._LogCache = C + _._LogCache, _.OnNewCacheEntry && _.OnNewCacheEntry(C);\n          }, _._FormatMessage = function(C) {\n            var u = function(O) {\n              return O < 10 ? \"0\" + O : \"\" + O;\n            }, I = /* @__PURE__ */ new Date();\n            return \"[\" + u(I.getHours()) + \":\" + u(I.getMinutes()) + \":\" + u(I.getSeconds()) + \"]: \" + C;\n          }, _._LogDisabled = function(C) {\n          }, _._LogEnabled = function(C) {\n            var u = _._FormatMessage(C);\n            console.log(\"BJS - \" + u);\n            var I = \"<div style='color:white'>\" + u + \"</div><br>\";\n            _._AddLogEntry(I);\n          }, _._WarnDisabled = function(C) {\n          }, _._WarnEnabled = function(C) {\n            var u = _._FormatMessage(C);\n            console.warn(\"BJS - \" + u);\n            var I = \"<div style='color:orange'>\" + u + \"</div><br>\";\n            _._AddLogEntry(I);\n          }, _._ErrorDisabled = function(C) {\n          }, _._ErrorEnabled = function(C) {\n            _.errorsCount++;\n            var u = _._FormatMessage(C);\n            console.error(\"BJS - \" + u);\n            var I = \"<div style='color:red'>\" + u + \"</div><br>\";\n            _._AddLogEntry(I);\n          }, Object.defineProperty(_, \"LogCache\", { get: function() {\n            return _._LogCache;\n          }, enumerable: !1, configurable: !0 }), _.ClearLogCache = function() {\n            _._LogCache = \"\", _.errorsCount = 0;\n          }, Object.defineProperty(_, \"LogLevels\", { set: function(C) {\n            (C & _.MessageLogLevel) === _.MessageLogLevel ? _.Log = _._LogEnabled : _.Log = _._LogDisabled, (C & _.WarningLogLevel) === _.WarningLogLevel ? _.Warn = _._WarnEnabled : _.Warn = _._WarnDisabled, (C & _.ErrorLogLevel) === _.ErrorLogLevel ? _.Error = _._ErrorEnabled : _.Error = _._ErrorDisabled;\n          }, enumerable: !1, configurable: !0 }), _.NoneLogLevel = 0, _.MessageLogLevel = 1, _.WarningLogLevel = 2, _.ErrorLogLevel = 4, _.AllLogLevel = 7, _._LogCache = \"\", _.errorsCount = 0, _.Log = _._LogEnabled, _.Warn = _._WarnEnabled, _.Error = _._ErrorEnabled, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        }), f.d(A, \"b\", function() {\n          return O;\n        }), f.d(A, \"c\", function() {\n          return x;\n        });\n        var V = f(14), _ = f(28), C = f(44), u = f(11), I = function() {\n          function m(c, T, S) {\n            c === void 0 && (c = 0), T === void 0 && (T = 0), S === void 0 && (S = 0), this.r = c, this.g = T, this.b = S;\n          }\n          return m.prototype.toString = function() {\n            return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \"}\";\n          }, m.prototype.getClassName = function() {\n            return \"Color3\";\n          }, m.prototype.getHashCode = function() {\n            var c = 255 * this.r | 0;\n            return c = 397 * (c = 397 * c ^ (255 * this.g | 0)) ^ (255 * this.b | 0);\n          }, m.prototype.toArray = function(c, T) {\n            return T === void 0 && (T = 0), c[T] = this.r, c[T + 1] = this.g, c[T + 2] = this.b, this;\n          }, m.prototype.fromArray = function(c, T) {\n            return T === void 0 && (T = 0), m.FromArrayToRef(c, T, this), this;\n          }, m.prototype.toColor4 = function(c) {\n            return c === void 0 && (c = 1), new O(this.r, this.g, this.b, c);\n          }, m.prototype.asArray = function() {\n            var c = new Array();\n            return this.toArray(c, 0), c;\n          }, m.prototype.toLuminance = function() {\n            return 0.3 * this.r + 0.59 * this.g + 0.11 * this.b;\n          }, m.prototype.multiply = function(c) {\n            return new m(this.r * c.r, this.g * c.g, this.b * c.b);\n          }, m.prototype.multiplyToRef = function(c, T) {\n            return T.r = this.r * c.r, T.g = this.g * c.g, T.b = this.b * c.b, this;\n          }, m.prototype.equals = function(c) {\n            return c && this.r === c.r && this.g === c.g && this.b === c.b;\n          }, m.prototype.equalsFloats = function(c, T, S) {\n            return this.r === c && this.g === T && this.b === S;\n          }, m.prototype.scale = function(c) {\n            return new m(this.r * c, this.g * c, this.b * c);\n          }, m.prototype.scaleToRef = function(c, T) {\n            return T.r = this.r * c, T.g = this.g * c, T.b = this.b * c, this;\n          }, m.prototype.scaleAndAddToRef = function(c, T) {\n            return T.r += this.r * c, T.g += this.g * c, T.b += this.b * c, this;\n          }, m.prototype.clampToRef = function(c, T, S) {\n            return c === void 0 && (c = 0), T === void 0 && (T = 1), S.r = V.a.Clamp(this.r, c, T), S.g = V.a.Clamp(this.g, c, T), S.b = V.a.Clamp(this.b, c, T), this;\n          }, m.prototype.add = function(c) {\n            return new m(this.r + c.r, this.g + c.g, this.b + c.b);\n          }, m.prototype.addToRef = function(c, T) {\n            return T.r = this.r + c.r, T.g = this.g + c.g, T.b = this.b + c.b, this;\n          }, m.prototype.subtract = function(c) {\n            return new m(this.r - c.r, this.g - c.g, this.b - c.b);\n          }, m.prototype.subtractToRef = function(c, T) {\n            return T.r = this.r - c.r, T.g = this.g - c.g, T.b = this.b - c.b, this;\n          }, m.prototype.clone = function() {\n            return new m(this.r, this.g, this.b);\n          }, m.prototype.copyFrom = function(c) {\n            return this.r = c.r, this.g = c.g, this.b = c.b, this;\n          }, m.prototype.copyFromFloats = function(c, T, S) {\n            return this.r = c, this.g = T, this.b = S, this;\n          }, m.prototype.set = function(c, T, S) {\n            return this.copyFromFloats(c, T, S);\n          }, m.prototype.toHexString = function() {\n            var c = 255 * this.r | 0, T = 255 * this.g | 0, S = 255 * this.b | 0;\n            return \"#\" + V.a.ToHex(c) + V.a.ToHex(T) + V.a.ToHex(S);\n          }, m.prototype.toLinearSpace = function() {\n            var c = new m();\n            return this.toLinearSpaceToRef(c), c;\n          }, m.prototype.toHSV = function() {\n            var c = new m();\n            return this.toHSVToRef(c), c;\n          }, m.prototype.toHSVToRef = function(c) {\n            var T = this.r, S = this.g, E = this.b, g = Math.max(T, S, E), l = Math.min(T, S, E), h = 0, v = 0, b = g, D = g - l;\n            g !== 0 && (v = D / g), g != l && (g == T ? (h = (S - E) / D, S < E && (h += 6)) : g == S ? h = (E - T) / D + 2 : g == E && (h = (T - S) / D + 4), h *= 60), c.r = h, c.g = v, c.b = b;\n          }, m.prototype.toLinearSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.c), c.g = Math.pow(this.g, _.c), c.b = Math.pow(this.b, _.c), this;\n          }, m.prototype.toGammaSpace = function() {\n            var c = new m();\n            return this.toGammaSpaceToRef(c), c;\n          }, m.prototype.toGammaSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.b), c.g = Math.pow(this.g, _.b), c.b = Math.pow(this.b, _.b), this;\n          }, m.HSVtoRGBToRef = function(c, T, S, E) {\n            var g = S * T, l = c / 60, h = g * (1 - Math.abs(l % 2 - 1)), v = 0, b = 0, D = 0;\n            l >= 0 && l <= 1 ? (v = g, b = h) : l >= 1 && l <= 2 ? (v = h, b = g) : l >= 2 && l <= 3 ? (b = g, D = h) : l >= 3 && l <= 4 ? (b = h, D = g) : l >= 4 && l <= 5 ? (v = h, D = g) : l >= 5 && l <= 6 && (v = g, D = h);\n            var w = S - g;\n            E.set(v + w, b + w, D + w);\n          }, m.FromHexString = function(c) {\n            if (c.substring(0, 1) !== \"#\" || c.length !== 7)\n              return new m(0, 0, 0);\n            var T = parseInt(c.substring(1, 3), 16), S = parseInt(c.substring(3, 5), 16), E = parseInt(c.substring(5, 7), 16);\n            return m.FromInts(T, S, E);\n          }, m.FromArray = function(c, T) {\n            return T === void 0 && (T = 0), new m(c[T], c[T + 1], c[T + 2]);\n          }, m.FromArrayToRef = function(c, T, S) {\n            T === void 0 && (T = 0), S.r = c[T], S.g = c[T + 1], S.b = c[T + 2];\n          }, m.FromInts = function(c, T, S) {\n            return new m(c / 255, T / 255, S / 255);\n          }, m.Lerp = function(c, T, S) {\n            var E = new m(0, 0, 0);\n            return m.LerpToRef(c, T, S, E), E;\n          }, m.LerpToRef = function(c, T, S, E) {\n            E.r = c.r + (T.r - c.r) * S, E.g = c.g + (T.g - c.g) * S, E.b = c.b + (T.b - c.b) * S;\n          }, m.Red = function() {\n            return new m(1, 0, 0);\n          }, m.Green = function() {\n            return new m(0, 1, 0);\n          }, m.Blue = function() {\n            return new m(0, 0, 1);\n          }, m.Black = function() {\n            return new m(0, 0, 0);\n          }, Object.defineProperty(m, \"BlackReadOnly\", { get: function() {\n            return m._BlackReadOnly;\n          }, enumerable: !1, configurable: !0 }), m.White = function() {\n            return new m(1, 1, 1);\n          }, m.Purple = function() {\n            return new m(0.5, 0, 0.5);\n          }, m.Magenta = function() {\n            return new m(1, 0, 1);\n          }, m.Yellow = function() {\n            return new m(1, 1, 0);\n          }, m.Gray = function() {\n            return new m(0.5, 0.5, 0.5);\n          }, m.Teal = function() {\n            return new m(0, 1, 1);\n          }, m.Random = function() {\n            return new m(Math.random(), Math.random(), Math.random());\n          }, m._BlackReadOnly = m.Black(), m;\n        }(), O = function() {\n          function m(c, T, S, E) {\n            c === void 0 && (c = 0), T === void 0 && (T = 0), S === void 0 && (S = 0), E === void 0 && (E = 1), this.r = c, this.g = T, this.b = S, this.a = E;\n          }\n          return m.prototype.addInPlace = function(c) {\n            return this.r += c.r, this.g += c.g, this.b += c.b, this.a += c.a, this;\n          }, m.prototype.asArray = function() {\n            var c = new Array();\n            return this.toArray(c, 0), c;\n          }, m.prototype.toArray = function(c, T) {\n            return T === void 0 && (T = 0), c[T] = this.r, c[T + 1] = this.g, c[T + 2] = this.b, c[T + 3] = this.a, this;\n          }, m.prototype.fromArray = function(c, T) {\n            return T === void 0 && (T = 0), m.FromArrayToRef(c, T, this), this;\n          }, m.prototype.equals = function(c) {\n            return c && this.r === c.r && this.g === c.g && this.b === c.b && this.a === c.a;\n          }, m.prototype.add = function(c) {\n            return new m(this.r + c.r, this.g + c.g, this.b + c.b, this.a + c.a);\n          }, m.prototype.subtract = function(c) {\n            return new m(this.r - c.r, this.g - c.g, this.b - c.b, this.a - c.a);\n          }, m.prototype.subtractToRef = function(c, T) {\n            return T.r = this.r - c.r, T.g = this.g - c.g, T.b = this.b - c.b, T.a = this.a - c.a, this;\n          }, m.prototype.scale = function(c) {\n            return new m(this.r * c, this.g * c, this.b * c, this.a * c);\n          }, m.prototype.scaleToRef = function(c, T) {\n            return T.r = this.r * c, T.g = this.g * c, T.b = this.b * c, T.a = this.a * c, this;\n          }, m.prototype.scaleAndAddToRef = function(c, T) {\n            return T.r += this.r * c, T.g += this.g * c, T.b += this.b * c, T.a += this.a * c, this;\n          }, m.prototype.clampToRef = function(c, T, S) {\n            return c === void 0 && (c = 0), T === void 0 && (T = 1), S.r = V.a.Clamp(this.r, c, T), S.g = V.a.Clamp(this.g, c, T), S.b = V.a.Clamp(this.b, c, T), S.a = V.a.Clamp(this.a, c, T), this;\n          }, m.prototype.multiply = function(c) {\n            return new m(this.r * c.r, this.g * c.g, this.b * c.b, this.a * c.a);\n          }, m.prototype.multiplyToRef = function(c, T) {\n            return T.r = this.r * c.r, T.g = this.g * c.g, T.b = this.b * c.b, T.a = this.a * c.a, T;\n          }, m.prototype.toString = function() {\n            return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \" A:\" + this.a + \"}\";\n          }, m.prototype.getClassName = function() {\n            return \"Color4\";\n          }, m.prototype.getHashCode = function() {\n            var c = 255 * this.r | 0;\n            return c = 397 * (c = 397 * (c = 397 * c ^ (255 * this.g | 0)) ^ (255 * this.b | 0)) ^ (255 * this.a | 0);\n          }, m.prototype.clone = function() {\n            return new m(this.r, this.g, this.b, this.a);\n          }, m.prototype.copyFrom = function(c) {\n            return this.r = c.r, this.g = c.g, this.b = c.b, this.a = c.a, this;\n          }, m.prototype.copyFromFloats = function(c, T, S, E) {\n            return this.r = c, this.g = T, this.b = S, this.a = E, this;\n          }, m.prototype.set = function(c, T, S, E) {\n            return this.copyFromFloats(c, T, S, E);\n          }, m.prototype.toHexString = function(c) {\n            c === void 0 && (c = !1);\n            var T = 255 * this.r | 0, S = 255 * this.g | 0, E = 255 * this.b | 0;\n            if (c)\n              return \"#\" + V.a.ToHex(T) + V.a.ToHex(S) + V.a.ToHex(E);\n            var g = 255 * this.a | 0;\n            return \"#\" + V.a.ToHex(T) + V.a.ToHex(S) + V.a.ToHex(E) + V.a.ToHex(g);\n          }, m.prototype.toLinearSpace = function() {\n            var c = new m();\n            return this.toLinearSpaceToRef(c), c;\n          }, m.prototype.toLinearSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.c), c.g = Math.pow(this.g, _.c), c.b = Math.pow(this.b, _.c), c.a = this.a, this;\n          }, m.prototype.toGammaSpace = function() {\n            var c = new m();\n            return this.toGammaSpaceToRef(c), c;\n          }, m.prototype.toGammaSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.b), c.g = Math.pow(this.g, _.b), c.b = Math.pow(this.b, _.b), c.a = this.a, this;\n          }, m.FromHexString = function(c) {\n            if (c.substring(0, 1) !== \"#\" || c.length !== 9)\n              return new m(0, 0, 0, 0);\n            var T = parseInt(c.substring(1, 3), 16), S = parseInt(c.substring(3, 5), 16), E = parseInt(c.substring(5, 7), 16), g = parseInt(c.substring(7, 9), 16);\n            return m.FromInts(T, S, E, g);\n          }, m.Lerp = function(c, T, S) {\n            var E = new m(0, 0, 0, 0);\n            return m.LerpToRef(c, T, S, E), E;\n          }, m.LerpToRef = function(c, T, S, E) {\n            E.r = c.r + (T.r - c.r) * S, E.g = c.g + (T.g - c.g) * S, E.b = c.b + (T.b - c.b) * S, E.a = c.a + (T.a - c.a) * S;\n          }, m.FromColor3 = function(c, T) {\n            return T === void 0 && (T = 1), new m(c.r, c.g, c.b, T);\n          }, m.FromArray = function(c, T) {\n            return T === void 0 && (T = 0), new m(c[T], c[T + 1], c[T + 2], c[T + 3]);\n          }, m.FromArrayToRef = function(c, T, S) {\n            T === void 0 && (T = 0), S.r = c[T], S.g = c[T + 1], S.b = c[T + 2], S.a = c[T + 3];\n          }, m.FromInts = function(c, T, S, E) {\n            return new m(c / 255, T / 255, S / 255, E / 255);\n          }, m.CheckColors4 = function(c, T) {\n            if (c.length === 3 * T) {\n              for (var S = [], E = 0; E < c.length; E += 3) {\n                var g = E / 3 * 4;\n                S[g] = c[E], S[g + 1] = c[E + 1], S[g + 2] = c[E + 2], S[g + 3] = 1;\n              }\n              return S;\n            }\n            return c;\n          }, m;\n        }(), x = function() {\n          function m() {\n          }\n          return m.Color3 = C.a.BuildArray(3, I.Black), m.Color4 = C.a.BuildArray(3, function() {\n            return new O(0, 0, 0, 0);\n          }), m;\n        }();\n        u.a.RegisteredTypes[\"BABYLON.Color3\"] = I, u.a.RegisteredTypes[\"BABYLON.Color4\"] = O;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return l;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(0), I = f(52), O = f(2), x = f(11), m = f(21), c = f(104), T = f(122), S = f(64), E = f(34), g = f(150), l = function(h) {\n          function v(b, D, w, N, M, U, X, j, ne, te, de, pe) {\n            w === void 0 && (w = !1), N === void 0 && (N = !0), M === void 0 && (M = v.TRILINEAR_SAMPLINGMODE), U === void 0 && (U = null), X === void 0 && (X = null), j === void 0 && (j = null), ne === void 0 && (ne = !1);\n            var ae = h.call(this, D) || this;\n            ae.url = null, ae.uOffset = 0, ae.vOffset = 0, ae.uScale = 1, ae.vScale = 1, ae.uAng = 0, ae.vAng = 0, ae.wAng = 0, ae.uRotationCenter = 0.5, ae.vRotationCenter = 0.5, ae.wRotationCenter = 0.5, ae.homogeneousRotationInUVTransform = !1, ae.inspectableCustomProperties = null, ae._noMipmap = !1, ae._invertY = !1, ae._rowGenerationMatrix = null, ae._cachedTextureMatrix = null, ae._projectionModeMatrix = null, ae._t0 = null, ae._t1 = null, ae._t2 = null, ae._cachedUOffset = -1, ae._cachedVOffset = -1, ae._cachedUScale = 0, ae._cachedVScale = 0, ae._cachedUAng = -1, ae._cachedVAng = -1, ae._cachedWAng = -1, ae._cachedProjectionMatrixId = -1, ae._cachedURotationCenter = -1, ae._cachedVRotationCenter = -1, ae._cachedWRotationCenter = -1, ae._cachedHomogeneousRotationInUVTransform = !1, ae._cachedCoordinatesMode = -1, ae._initialSamplingMode = v.BILINEAR_SAMPLINGMODE, ae._buffer = null, ae._deleteBuffer = !1, ae._format = null, ae._delayedOnLoad = null, ae._delayedOnError = null, ae.onLoadObservable = new C.c(), ae._isBlocking = !0, ae.name = b || \"\", ae.url = b, ae._noMipmap = w, ae._invertY = N, ae._initialSamplingMode = M, ae._buffer = j, ae._deleteBuffer = ne, ae._mimeType = de, ae._loaderOptions = pe, te && (ae._format = te);\n            var ee = ae.getScene(), K = ae._getEngine();\n            if (!K)\n              return ae;\n            K.onBeforeTextureInitObservable.notifyObservers(ae);\n            var $ = function() {\n              ae._texture && (ae._texture._invertVScale && (ae.vScale *= -1, ae.vOffset += 1), ae._texture._cachedWrapU !== null && (ae.wrapU = ae._texture._cachedWrapU, ae._texture._cachedWrapU = null), ae._texture._cachedWrapV !== null && (ae.wrapV = ae._texture._cachedWrapV, ae._texture._cachedWrapV = null), ae._texture._cachedWrapR !== null && (ae.wrapR = ae._texture._cachedWrapR, ae._texture._cachedWrapR = null)), ae.onLoadObservable.hasObservers() && ae.onLoadObservable.notifyObservers(ae), U && U(), !ae.isBlocking && ee && ee.resetCachedMaterial();\n            };\n            return ae.url ? (ae._texture = ae._getFromCache(ae.url, w, M, N), ae._texture ? ae._texture.isReady ? c.a.SetImmediate(function() {\n              return $();\n            }) : ae._texture.onLoadedObservable.add($) : ee && ee.useDelayedTextureLoading ? (ae.delayLoadState = O.a.DELAYLOADSTATE_NOTLOADED, ae._delayedOnLoad = $, ae._delayedOnError = X) : (ae._texture = K.createTexture(ae.url, w, N, ee, M, $, X, ae._buffer, void 0, ae._format, null, de, pe), ne && (ae._buffer = null)), ae) : (ae._delayedOnLoad = $, ae._delayedOnError = X, ae);\n          }\n          return Object(V.d)(v, h), Object.defineProperty(v.prototype, \"noMipmap\", { get: function() {\n            return this._noMipmap;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"mimeType\", { get: function() {\n            return this._mimeType;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"isBlocking\", { get: function() {\n            return this._isBlocking;\n          }, set: function(b) {\n            this._isBlocking = b;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"samplingMode\", { get: function() {\n            return this._texture ? this._texture.samplingMode : this._initialSamplingMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"invertY\", { get: function() {\n            return this._invertY;\n          }, enumerable: !1, configurable: !0 }), v.prototype.updateURL = function(b, D, w) {\n            D === void 0 && (D = null), this.url && (this.releaseInternalTexture(), this.getScene().markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag)), this.name && !E.a.StartsWith(this.name, \"data:\") || (this.name = b), this.url = b, this._buffer = D, this.delayLoadState = O.a.DELAYLOADSTATE_NOTLOADED, w && (this._delayedOnLoad = w), this.delayLoad();\n          }, v.prototype.delayLoad = function() {\n            if (this.delayLoadState === O.a.DELAYLOADSTATE_NOTLOADED) {\n              var b = this.getScene();\n              b && (this.delayLoadState = O.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY), this._texture ? this._delayedOnLoad && (this._texture.isReady ? c.a.SetImmediate(this._delayedOnLoad) : this._texture.onLoadedObservable.add(this._delayedOnLoad)) : (this._texture = b.getEngine().createTexture(this.url, this._noMipmap, this._invertY, b, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, null, this._mimeType, this._loaderOptions), this._deleteBuffer && (this._buffer = null)), this._delayedOnLoad = null, this._delayedOnError = null);\n            }\n          }, v.prototype._prepareRowForTextureGeneration = function(b, D, w, N) {\n            b *= this._cachedUScale, D *= this._cachedVScale, b -= this.uRotationCenter * this._cachedUScale, D -= this.vRotationCenter * this._cachedVScale, w -= this.wRotationCenter, u.e.TransformCoordinatesFromFloatsToRef(b, D, w, this._rowGenerationMatrix, N), N.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset, N.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset, N.z += this.wRotationCenter;\n          }, v.prototype.checkTransformsAreIdentical = function(b) {\n            return b !== null && this.uOffset === b.uOffset && this.vOffset === b.vOffset && this.uScale === b.uScale && this.vScale === b.vScale && this.uAng === b.uAng && this.vAng === b.vAng && this.wAng === b.wAng;\n          }, v.prototype.getTextureMatrix = function(b) {\n            var D = this;\n            if (b === void 0 && (b = 1), this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale * b === this._cachedUScale && this.vScale === this._cachedVScale && this.uAng === this._cachedUAng && this.vAng === this._cachedVAng && this.wAng === this._cachedWAng && this.uRotationCenter === this._cachedURotationCenter && this.vRotationCenter === this._cachedVRotationCenter && this.wRotationCenter === this._cachedWRotationCenter && this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform)\n              return this._cachedTextureMatrix;\n            this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale * b, this._cachedVScale = this.vScale, this._cachedUAng = this.uAng, this._cachedVAng = this.vAng, this._cachedWAng = this.wAng, this._cachedURotationCenter = this.uRotationCenter, this._cachedVRotationCenter = this.vRotationCenter, this._cachedWRotationCenter = this.wRotationCenter, this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform, this._cachedTextureMatrix && this._rowGenerationMatrix || (this._cachedTextureMatrix = u.a.Zero(), this._rowGenerationMatrix = new u.a(), this._t0 = u.e.Zero(), this._t1 = u.e.Zero(), this._t2 = u.e.Zero()), u.a.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix), this.homogeneousRotationInUVTransform ? (u.a.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, u.c.Matrix[0]), u.a.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, u.c.Matrix[1]), u.a.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, u.c.Matrix[2]), u.a.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, u.c.Matrix[3]), u.c.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(u.c.Matrix[1], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(u.c.Matrix[2], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(u.c.Matrix[3], this._cachedTextureMatrix), this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1)) : (this._prepareRowForTextureGeneration(0, 0, 0, this._t0), this._prepareRowForTextureGeneration(1, 0, 0, this._t1), this._prepareRowForTextureGeneration(0, 1, 0, this._t2), this._t1.subtractInPlace(this._t0), this._t2.subtractInPlace(this._t0), u.a.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0, this._t2.x, this._t2.y, this._t2.z, 0, this._t0.x, this._t0.y, this._t0.z, 0, 0, 0, 0, 1, this._cachedTextureMatrix));\n            var w = this.getScene();\n            return w ? (w.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag, function(N) {\n              return N.hasTexture(D);\n            }), this._cachedTextureMatrix) : this._cachedTextureMatrix;\n          }, v.prototype.getReflectionTextureMatrix = function() {\n            var b = this, D = this.getScene();\n            if (!D)\n              return this._cachedTextureMatrix;\n            if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale === this._cachedUScale && this.vScale === this._cachedVScale && this.coordinatesMode === this._cachedCoordinatesMode) {\n              if (this.coordinatesMode !== v.PROJECTION_MODE)\n                return this._cachedTextureMatrix;\n              if (this._cachedProjectionMatrixId === D.getProjectionMatrix().updateFlag)\n                return this._cachedTextureMatrix;\n            }\n            switch (this._cachedTextureMatrix || (this._cachedTextureMatrix = u.a.Zero()), this._projectionModeMatrix || (this._projectionModeMatrix = u.a.Zero()), this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale, this._cachedVScale = this.vScale, this._cachedCoordinatesMode = this.coordinatesMode, this.coordinatesMode) {\n              case v.PLANAR_MODE:\n                u.a.IdentityToRef(this._cachedTextureMatrix), this._cachedTextureMatrix[0] = this.uScale, this._cachedTextureMatrix[5] = this.vScale, this._cachedTextureMatrix[12] = this.uOffset, this._cachedTextureMatrix[13] = this.vOffset;\n                break;\n              case v.PROJECTION_MODE:\n                u.a.FromValuesToRef(0.5, 0, 0, 0, 0, -0.5, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, this._projectionModeMatrix);\n                var w = D.getProjectionMatrix();\n                this._cachedProjectionMatrixId = w.updateFlag, w.multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);\n                break;\n              default:\n                u.a.IdentityToRef(this._cachedTextureMatrix);\n            }\n            return D.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag, function(N) {\n              return N.getActiveTextures().indexOf(b) !== -1;\n            }), this._cachedTextureMatrix;\n          }, v.prototype.clone = function() {\n            var b = this;\n            return _.a.Clone(function() {\n              return new v(b._texture ? b._texture.url : null, b.getScene(), b._noMipmap, b._invertY, b.samplingMode, void 0, void 0, b._texture ? b._texture._buffer : void 0);\n            }, this);\n          }, v.prototype.serialize = function() {\n            var b = this.name;\n            v.SerializeBuffers || E.a.StartsWith(this.name, \"data:\") && (this.name = \"\"), E.a.StartsWith(this.name, \"data:\") && this.url === this.name && (this.url = \"\");\n            var D = h.prototype.serialize.call(this);\n            return D ? ((v.SerializeBuffers || v.ForceSerializeBuffers) && (typeof this._buffer == \"string\" && this._buffer.substr(0, 5) === \"data:\" ? (D.base64String = this._buffer, D.name = D.name.replace(\"data:\", \"\")) : this.url && E.a.StartsWith(this.url, \"data:\") && this._buffer instanceof Uint8Array ? D.base64String = \"data:image/png;base64,\" + E.a.EncodeArrayBufferToBase64(this._buffer) : v.ForceSerializeBuffers && (D.base64String = g.a.GenerateBase64StringFromTexture(this))), D.invertY = this._invertY, D.samplingMode = this.samplingMode, this.name = b, D) : null;\n          }, v.prototype.getClassName = function() {\n            return \"Texture\";\n          }, v.prototype.dispose = function() {\n            h.prototype.dispose.call(this), this.onLoadObservable.clear(), this._delayedOnLoad = null, this._delayedOnError = null;\n          }, v.Parse = function(b, D, w) {\n            if (b.customType) {\n              var N = T.a.Instantiate(b.customType).Parse(b, D, w);\n              return b.samplingMode && N.updateSamplingMode && N._samplingMode && N._samplingMode !== b.samplingMode && N.updateSamplingMode(b.samplingMode), N;\n            }\n            if (b.isCube && !b.isRenderTarget)\n              return v._CubeTextureParser(b, D, w);\n            if (!b.name && !b.isRenderTarget)\n              return null;\n            var M = function() {\n              if (U && U._texture && (U._texture._cachedWrapU = null, U._texture._cachedWrapV = null, U._texture._cachedWrapR = null), b.samplingMode) {\n                var X = b.samplingMode;\n                U && U.samplingMode !== X && U.updateSamplingMode(X);\n              }\n              if (U && b.animations)\n                for (var j = 0; j < b.animations.length; j++) {\n                  var ne = b.animations[j], te = x.a.GetClass(\"BABYLON.Animation\");\n                  te && U.animations.push(te.Parse(ne));\n                }\n            }, U = _.a.Parse(function() {\n              var X, j = !0;\n              if (b.noMipmap && (j = !1), b.mirrorPlane) {\n                var ne = v._CreateMirror(b.name, b.renderTargetSize, D, j);\n                return ne._waitingRenderList = b.renderList, ne.mirrorPlane = S.a.FromArray(b.mirrorPlane), M(), ne;\n              }\n              if (b.isRenderTarget) {\n                var te = null;\n                if (b.isCube) {\n                  if (D.reflectionProbes)\n                    for (var de = 0; de < D.reflectionProbes.length; de++) {\n                      var pe = D.reflectionProbes[de];\n                      if (pe.name === b.name)\n                        return pe.cubeTexture;\n                    }\n                } else\n                  (te = v._CreateRenderTargetTexture(b.name, b.renderTargetSize, D, j))._waitingRenderList = b.renderList;\n                return M(), te;\n              }\n              if (b.base64String)\n                X = v.CreateFromBase64String(b.base64String, b.name, D, !j, b.invertY, void 0, M);\n              else {\n                var ae = void 0;\n                ae = b.name && b.name.indexOf(\"://\") > 0 ? b.name : w + b.name, (E.a.StartsWith(b.url, \"data:\") || v.UseSerializedUrlIfAny && b.url) && (ae = b.url), X = new v(ae, D, !j, b.invertY, void 0, M);\n              }\n              return X;\n            }, b, D);\n            return U;\n          }, v.CreateFromBase64String = function(b, D, w, N, M, U, X, j, ne) {\n            return U === void 0 && (U = v.TRILINEAR_SAMPLINGMODE), X === void 0 && (X = null), j === void 0 && (j = null), ne === void 0 && (ne = O.a.TEXTUREFORMAT_RGBA), new v(\"data:\" + D, w, N, M, U, X, j, b, !1, ne);\n          }, v.LoadFromDataString = function(b, D, w, N, M, U, X, j, ne, te) {\n            return N === void 0 && (N = !1), M === void 0 && (M = !1), U === void 0 && (U = !0), X === void 0 && (X = v.TRILINEAR_SAMPLINGMODE), j === void 0 && (j = null), ne === void 0 && (ne = null), te === void 0 && (te = O.a.TEXTUREFORMAT_RGBA), b.substr(0, 5) !== \"data:\" && (b = \"data:\" + b), new v(b, w, M, U, X, j, ne, D, N, te);\n          }, v.SerializeBuffers = !0, v.ForceSerializeBuffers = !1, v._CubeTextureParser = function(b, D, w) {\n            throw m.a.WarnImport(\"CubeTexture\");\n          }, v._CreateMirror = function(b, D, w, N) {\n            throw m.a.WarnImport(\"MirrorTexture\");\n          }, v._CreateRenderTargetTexture = function(b, D, w, N) {\n            throw m.a.WarnImport(\"RenderTargetTexture\");\n          }, v.NEAREST_SAMPLINGMODE = O.a.TEXTURE_NEAREST_SAMPLINGMODE, v.NEAREST_NEAREST_MIPLINEAR = O.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR, v.BILINEAR_SAMPLINGMODE = O.a.TEXTURE_BILINEAR_SAMPLINGMODE, v.LINEAR_LINEAR_MIPNEAREST = O.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST, v.TRILINEAR_SAMPLINGMODE = O.a.TEXTURE_TRILINEAR_SAMPLINGMODE, v.LINEAR_LINEAR_MIPLINEAR = O.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR, v.NEAREST_NEAREST_MIPNEAREST = O.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST, v.NEAREST_LINEAR_MIPNEAREST = O.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST, v.NEAREST_LINEAR_MIPLINEAR = O.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR, v.NEAREST_LINEAR = O.a.TEXTURE_NEAREST_LINEAR, v.NEAREST_NEAREST = O.a.TEXTURE_NEAREST_NEAREST, v.LINEAR_NEAREST_MIPNEAREST = O.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST, v.LINEAR_NEAREST_MIPLINEAR = O.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR, v.LINEAR_LINEAR = O.a.TEXTURE_LINEAR_LINEAR, v.LINEAR_NEAREST = O.a.TEXTURE_LINEAR_NEAREST, v.EXPLICIT_MODE = O.a.TEXTURE_EXPLICIT_MODE, v.SPHERICAL_MODE = O.a.TEXTURE_SPHERICAL_MODE, v.PLANAR_MODE = O.a.TEXTURE_PLANAR_MODE, v.CUBIC_MODE = O.a.TEXTURE_CUBIC_MODE, v.PROJECTION_MODE = O.a.TEXTURE_PROJECTION_MODE, v.SKYBOX_MODE = O.a.TEXTURE_SKYBOX_MODE, v.INVCUBIC_MODE = O.a.TEXTURE_INVCUBIC_MODE, v.EQUIRECTANGULAR_MODE = O.a.TEXTURE_EQUIRECTANGULAR_MODE, v.FIXED_EQUIRECTANGULAR_MODE = O.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, v.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = O.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, v.CLAMP_ADDRESSMODE = O.a.TEXTURE_CLAMP_ADDRESSMODE, v.WRAP_ADDRESSMODE = O.a.TEXTURE_WRAP_ADDRESSMODE, v.MIRROR_ADDRESSMODE = O.a.TEXTURE_MIRROR_ADDRESSMODE, v.UseSerializedUrlIfAny = !1, Object(V.c)([Object(_.c)()], v.prototype, \"url\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uOffset\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vOffset\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uScale\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vScale\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uAng\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vAng\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"wAng\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uRotationCenter\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vRotationCenter\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"wRotationCenter\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"homogeneousRotationInUVTransform\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"isBlocking\", null), v;\n        }(I.a);\n        x.a.RegisteredTypes[\"BABYLON.Texture\"] = l, _.a._TextureParser = l.Parse;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.GetClass = function(C) {\n            return this.RegisteredTypes && this.RegisteredTypes[C] ? this.RegisteredTypes[C] : null;\n          }, _.RegisteredTypes = {}, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return l;\n        }), f.d(A, \"c\", function() {\n          return h;\n        }), f.d(A, \"a\", function() {\n          return v;\n        });\n        var V = f(6), _ = f(38), C = f(8), u = f(41), I = f(57), O = f(21), x = f(49), m = f(22), c = f(56), T = f(145), S = f(104), E = f(122), g = f(120), l = function() {\n          function b() {\n          }\n          return Object.defineProperty(b, \"BaseUrl\", { get: function() {\n            return c.a.BaseUrl;\n          }, set: function(D) {\n            c.a.BaseUrl = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"DefaultRetryStrategy\", { get: function() {\n            return c.a.DefaultRetryStrategy;\n          }, set: function(D) {\n            c.a.DefaultRetryStrategy = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"CorsBehavior\", { get: function() {\n            return c.a.CorsBehavior;\n          }, set: function(D) {\n            c.a.CorsBehavior = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"UseFallbackTexture\", { get: function() {\n            return m.a.UseFallbackTexture;\n          }, set: function(D) {\n            m.a.UseFallbackTexture = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"RegisteredExternalClasses\", { get: function() {\n            return E.a.RegisteredExternalClasses;\n          }, set: function(D) {\n            E.a.RegisteredExternalClasses = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"fallbackTexture\", { get: function() {\n            return m.a.FallbackTexture;\n          }, set: function(D) {\n            m.a.FallbackTexture = D;\n          }, enumerable: !1, configurable: !0 }), b.FetchToRef = function(D, w, N, M, U, X) {\n            var j = 4 * ((Math.abs(D) * N % N | 0) + (Math.abs(w) * M % M | 0) * N);\n            X.r = U[j] / 255, X.g = U[j + 1] / 255, X.b = U[j + 2] / 255, X.a = U[j + 3] / 255;\n          }, b.Mix = function(D, w, N) {\n            return D * (1 - N) + w * N;\n          }, b.Instantiate = function(D) {\n            return E.a.Instantiate(D);\n          }, b.Slice = function(D, w, N) {\n            return D.slice ? D.slice(w, N) : Array.prototype.slice.call(D, w, N);\n          }, b.SliceToArray = function(D, w, N) {\n            return Array.isArray(D) ? D.slice(w, N) : Array.prototype.slice.call(D, w, N);\n          }, b.SetImmediate = function(D) {\n            S.a.SetImmediate(D);\n          }, b.IsExponentOfTwo = function(D) {\n            var w = 1;\n            do\n              w *= 2;\n            while (w < D);\n            return w === D;\n          }, b.FloatRound = function(D) {\n            return Math.fround ? Math.fround(D) : b._tmpFloatArray[0] = D;\n          }, b.GetFilename = function(D) {\n            var w = D.lastIndexOf(\"/\");\n            return w < 0 ? D : D.substring(w + 1);\n          }, b.GetFolderPath = function(D, w) {\n            w === void 0 && (w = !1);\n            var N = D.lastIndexOf(\"/\");\n            return N < 0 ? w ? D : \"\" : D.substring(0, N + 1);\n          }, b.ToDegrees = function(D) {\n            return 180 * D / Math.PI;\n          }, b.ToRadians = function(D) {\n            return D * Math.PI / 180;\n          }, b.MakeArray = function(D, w) {\n            return w === !0 || D !== void 0 && D != null ? Array.isArray(D) ? D : [D] : null;\n          }, b.GetPointerPrefix = function(D) {\n            var w = \"pointer\";\n            return _.a.IsWindowObjectExist() && !window.PointerEvent && _.a.IsNavigatorAvailable() && !navigator.pointerEnabled && (w = \"mouse\"), !D._badDesktopOS || D._badOS || document && \"ontouchend\" in document || (w = \"mouse\"), w;\n          }, b.SetCorsBehavior = function(D, w) {\n            c.a.SetCorsBehavior(D, w);\n          }, b.CleanUrl = function(D) {\n            return D = D.replace(/#/gm, \"%23\");\n          }, Object.defineProperty(b, \"PreprocessUrl\", { get: function() {\n            return c.a.PreprocessUrl;\n          }, set: function(D) {\n            c.a.PreprocessUrl = D;\n          }, enumerable: !1, configurable: !0 }), b.LoadImage = function(D, w, N, M, U) {\n            return c.a.LoadImage(D, w, N, M, U);\n          }, b.LoadFile = function(D, w, N, M, U, X) {\n            return c.a.LoadFile(D, w, N, M, U, X);\n          }, b.LoadFileAsync = function(D, w) {\n            return w === void 0 && (w = !0), new Promise(function(N, M) {\n              c.a.LoadFile(D, function(U) {\n                N(U);\n              }, void 0, void 0, w, function(U, X) {\n                M(X);\n              });\n            });\n          }, b.LoadScript = function(D, w, N, M) {\n            if (_.a.IsWindowObjectExist()) {\n              var U = document.getElementsByTagName(\"head\")[0], X = document.createElement(\"script\");\n              X.setAttribute(\"type\", \"text/javascript\"), X.setAttribute(\"src\", D), M && (X.id = M), X.onload = function() {\n                w && w();\n              }, X.onerror = function(j) {\n                N && N(\"Unable to load script '\" + D + \"'\", j);\n              }, U.appendChild(X);\n            }\n          }, b.LoadScriptAsync = function(D, w) {\n            var N = this;\n            return new Promise(function(M, U) {\n              N.LoadScript(D, function() {\n                M();\n              }, function(X, j) {\n                U(j);\n              });\n            });\n          }, b.ReadFileAsDataURL = function(D, w, N) {\n            var M = new FileReader(), U = { onCompleteObservable: new V.c(), abort: function() {\n              return M.abort();\n            } };\n            return M.onloadend = function(X) {\n              U.onCompleteObservable.notifyObservers(U);\n            }, M.onload = function(X) {\n              w(X.target.result);\n            }, M.onprogress = N, M.readAsDataURL(D), U;\n          }, b.ReadFile = function(D, w, N, M, U) {\n            return c.a.ReadFile(D, w, N, M, U);\n          }, b.FileAsURL = function(D) {\n            var w = new Blob([D]);\n            return (window.URL || window.webkitURL).createObjectURL(w);\n          }, b.Format = function(D, w) {\n            return w === void 0 && (w = 2), D.toFixed(w);\n          }, b.DeepCopy = function(D, w, N, M) {\n            u.a.DeepCopy(D, w, N, M);\n          }, b.IsEmpty = function(D) {\n            for (var w in D)\n              if (D.hasOwnProperty(w))\n                return !1;\n            return !0;\n          }, b.RegisterTopRootEvents = function(D, w) {\n            for (var N = 0; N < w.length; N++) {\n              var M = w[N];\n              D.addEventListener(M.name, M.handler, !1);\n              try {\n                window.parent && window.parent.addEventListener(M.name, M.handler, !1);\n              } catch {\n              }\n            }\n          }, b.UnregisterTopRootEvents = function(D, w) {\n            for (var N = 0; N < w.length; N++) {\n              var M = w[N];\n              D.removeEventListener(M.name, M.handler);\n              try {\n                D.parent && D.parent.removeEventListener(M.name, M.handler);\n              } catch {\n              }\n            }\n          }, b.DumpFramebuffer = function(D, w, N, M, U, X) {\n            U === void 0 && (U = \"image/png\");\n            for (var j = 4 * D, ne = w / 2, te = N.readPixels(0, 0, D, w), de = 0; de < ne; de++)\n              for (var pe = 0; pe < j; pe++) {\n                var ae = pe + de * j, ee = pe + (w - de - 1) * j, K = te[ae];\n                te[ae] = te[ee], te[ee] = K;\n              }\n            b._ScreenshotCanvas || (b._ScreenshotCanvas = document.createElement(\"canvas\")), b._ScreenshotCanvas.width = D, b._ScreenshotCanvas.height = w;\n            var $ = b._ScreenshotCanvas.getContext(\"2d\");\n            if ($) {\n              var L = $.createImageData(D, w);\n              L.data.set(te), $.putImageData(L, 0, 0), b.EncodeScreenshotCanvasData(M, U, X);\n            }\n          }, b.ToBlob = function(D, w, N) {\n            N === void 0 && (N = \"image/png\"), D.toBlob || (D.toBlob = function(M, U, X) {\n              var j = this;\n              setTimeout(function() {\n                for (var ne = atob(j.toDataURL(U, X).split(\",\")[1]), te = ne.length, de = new Uint8Array(te), pe = 0; pe < te; pe++)\n                  de[pe] = ne.charCodeAt(pe);\n                M(new Blob([de]));\n              });\n            }), D.toBlob(function(M) {\n              w(M);\n            }, N);\n          }, b.EncodeScreenshotCanvasData = function(D, w, N) {\n            w === void 0 && (w = \"image/png\"), D ? D(b._ScreenshotCanvas.toDataURL(w)) : this.ToBlob(b._ScreenshotCanvas, function(M) {\n              if (\"download\" in document.createElement(\"a\")) {\n                if (!N) {\n                  var U = /* @__PURE__ */ new Date(), X = (U.getFullYear() + \"-\" + (U.getMonth() + 1)).slice(2) + \"-\" + U.getDate() + \"_\" + U.getHours() + \"-\" + (\"0\" + U.getMinutes()).slice(-2);\n                  N = \"screenshot_\" + X + \".png\";\n                }\n                b.Download(M, N);\n              } else {\n                var j = URL.createObjectURL(M), ne = window.open(\"\");\n                if (!ne)\n                  return;\n                var te = ne.document.createElement(\"img\");\n                te.onload = function() {\n                  URL.revokeObjectURL(j);\n                }, te.src = j, ne.document.body.appendChild(te);\n              }\n            }, w);\n          }, b.Download = function(D, w) {\n            if (navigator && navigator.msSaveBlob)\n              navigator.msSaveBlob(D, w);\n            else {\n              var N = window.URL.createObjectURL(D), M = document.createElement(\"a\");\n              document.body.appendChild(M), M.style.display = \"none\", M.href = N, M.download = w, M.addEventListener(\"click\", function() {\n                M.parentElement && M.parentElement.removeChild(M);\n              }), M.click(), window.URL.revokeObjectURL(N);\n            }\n          }, b.BackCompatCameraNoPreventDefault = function(D) {\n            return typeof D[0] == \"boolean\" ? D[0] : typeof D[1] == \"boolean\" && D[1];\n          }, b.CreateScreenshot = function(D, w, N, M, U) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.CreateScreenshotAsync = function(D, w, N, M) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.CreateScreenshotUsingRenderTarget = function(D, w, N, M, U, X, j, ne) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.CreateScreenshotUsingRenderTargetAsync = function(D, w, N, M, U, X, j) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.RandomId = function() {\n            return g.a.RandomId();\n          }, b.IsBase64 = function(D) {\n            return !(D.length < 5) && D.substr(0, 5) === \"data:\";\n          }, b.DecodeBase64 = function(D) {\n            for (var w = atob(D.split(\",\")[1]), N = w.length, M = new Uint8Array(new ArrayBuffer(N)), U = 0; U < N; U++)\n              M[U] = w.charCodeAt(U);\n            return M.buffer;\n          }, b.GetAbsoluteUrl = function(D) {\n            var w = document.createElement(\"a\");\n            return w.href = D, w.href;\n          }, Object.defineProperty(b, \"errorsCount\", { get: function() {\n            return C.a.errorsCount;\n          }, enumerable: !1, configurable: !0 }), b.Log = function(D) {\n            C.a.Log(D);\n          }, b.Warn = function(D) {\n            C.a.Warn(D);\n          }, b.Error = function(D) {\n            C.a.Error(D);\n          }, Object.defineProperty(b, \"LogCache\", { get: function() {\n            return C.a.LogCache;\n          }, enumerable: !1, configurable: !0 }), b.ClearLogCache = function() {\n            C.a.ClearLogCache();\n          }, Object.defineProperty(b, \"LogLevels\", { set: function(D) {\n            C.a.LogLevels = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"PerformanceLogLevel\", { set: function(D) {\n            return (D & b.PerformanceUserMarkLogLevel) === b.PerformanceUserMarkLogLevel ? (b.StartPerformanceCounter = b._StartUserMark, void (b.EndPerformanceCounter = b._EndUserMark)) : (D & b.PerformanceConsoleLogLevel) === b.PerformanceConsoleLogLevel ? (b.StartPerformanceCounter = b._StartPerformanceConsole, void (b.EndPerformanceCounter = b._EndPerformanceConsole)) : (b.StartPerformanceCounter = b._StartPerformanceCounterDisabled, void (b.EndPerformanceCounter = b._EndPerformanceCounterDisabled));\n          }, enumerable: !1, configurable: !0 }), b._StartPerformanceCounterDisabled = function(D, w) {\n          }, b._EndPerformanceCounterDisabled = function(D, w) {\n          }, b._StartUserMark = function(D, w) {\n            if (w === void 0 && (w = !0), !b._performance) {\n              if (!_.a.IsWindowObjectExist())\n                return;\n              b._performance = window.performance;\n            }\n            w && b._performance.mark && b._performance.mark(D + \"-Begin\");\n          }, b._EndUserMark = function(D, w) {\n            w === void 0 && (w = !0), w && b._performance.mark && (b._performance.mark(D + \"-End\"), b._performance.measure(D, D + \"-Begin\", D + \"-End\"));\n          }, b._StartPerformanceConsole = function(D, w) {\n            w === void 0 && (w = !0), w && (b._StartUserMark(D, w), console.time && console.time(D));\n          }, b._EndPerformanceConsole = function(D, w) {\n            w === void 0 && (w = !0), w && (b._EndUserMark(D, w), console.timeEnd(D));\n          }, Object.defineProperty(b, \"Now\", { get: function() {\n            return I.a.Now;\n          }, enumerable: !1, configurable: !0 }), b.GetClassName = function(D, w) {\n            w === void 0 && (w = !1);\n            var N = null;\n            return !w && D.getClassName ? N = D.getClassName() : (D instanceof Object && (N = (w ? D : Object.getPrototypeOf(D)).constructor.__bjsclassName__), N || (N = typeof D)), N;\n          }, b.First = function(D, w) {\n            for (var N = 0, M = D; N < M.length; N++) {\n              var U = M[N];\n              if (w(U))\n                return U;\n            }\n            return null;\n          }, b.getFullClassName = function(D, w) {\n            w === void 0 && (w = !1);\n            var N = null, M = null;\n            if (!w && D.getClassName)\n              N = D.getClassName();\n            else {\n              if (D instanceof Object) {\n                var U = w ? D : Object.getPrototypeOf(D);\n                N = U.constructor.__bjsclassName__, M = U.constructor.__bjsmoduleName__;\n              }\n              N || (N = typeof D);\n            }\n            return N ? (M != null ? M + \".\" : \"\") + N : null;\n          }, b.DelayAsync = function(D) {\n            return new Promise(function(w) {\n              setTimeout(function() {\n                w();\n              }, D);\n            });\n          }, b.IsSafari = function() {\n            return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n          }, b.UseCustomRequestHeaders = !1, b.CustomRequestHeaders = x.a.CustomRequestHeaders, b._tmpFloatArray = new Float32Array(1), b.GetDOMTextContent = _.a.GetDOMTextContent, b.NoneLogLevel = C.a.NoneLogLevel, b.MessageLogLevel = C.a.MessageLogLevel, b.WarningLogLevel = C.a.WarningLogLevel, b.ErrorLogLevel = C.a.ErrorLogLevel, b.AllLogLevel = C.a.AllLogLevel, b.IsWindowObjectExist = _.a.IsWindowObjectExist, b.PerformanceNoneLogLevel = 0, b.PerformanceUserMarkLogLevel = 1, b.PerformanceConsoleLogLevel = 2, b.StartPerformanceCounter = b._StartPerformanceCounterDisabled, b.EndPerformanceCounter = b._EndPerformanceCounterDisabled, b;\n        }();\n        function h(b, D) {\n          return function(w) {\n            w.__bjsclassName__ = b, w.__bjsmoduleName__ = D ?? null;\n          };\n        }\n        var v = function() {\n          function b(D, w, N, M) {\n            M === void 0 && (M = 0), this.iterations = D, this.index = M - 1, this._done = !1, this._fn = w, this._successCallback = N;\n          }\n          return b.prototype.executeNext = function() {\n            this._done || (this.index + 1 < this.iterations ? (++this.index, this._fn(this)) : this.breakLoop());\n          }, b.prototype.breakLoop = function() {\n            this._done = !0, this._successCallback();\n          }, b.Run = function(D, w, N, M) {\n            M === void 0 && (M = 0);\n            var U = new b(D, w, N, M);\n            return U.executeNext(), U;\n          }, b.SyncAsyncForLoop = function(D, w, N, M, U, X) {\n            return X === void 0 && (X = 0), b.Run(Math.ceil(D / w), function(j) {\n              U && U() ? j.breakLoop() : setTimeout(function() {\n                for (var ne = 0; ne < w; ++ne) {\n                  var te = j.index * w + ne;\n                  if (te >= D)\n                    break;\n                  if (N(te), U && U()) {\n                    j.breakLoop();\n                    break;\n                  }\n                }\n                j.executeNext();\n              }, X);\n            }, M);\n          }, b;\n        }();\n        m.a.FallbackTexture = \"data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z\", T.a.Apply();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return E;\n        });\n        var V = f(1), _ = f(6), C = f(38), u = f(22), I = f(21), O = f(26), x = f(2), m = f(146), c = f(55), T = f(88), S = f(8), E = (f(123), f(129), f(124), function(g) {\n          function l(h, v, b, D) {\n            D === void 0 && (D = !1);\n            var w = g.call(this, h, v, b, D) || this;\n            if (w.enableOfflineSupport = !1, w.disableManifestCheck = !1, w.scenes = new Array(), w.onNewSceneAddedObservable = new _.c(), w.postProcesses = new Array(), w.isPointerLock = !1, w.onResizeObservable = new _.c(), w.onCanvasBlurObservable = new _.c(), w.onCanvasFocusObservable = new _.c(), w.onCanvasPointerOutObservable = new _.c(), w.onBeginFrameObservable = new _.c(), w.customAnimationFrameRequester = null, w.onEndFrameObservable = new _.c(), w.onBeforeShaderCompilationObservable = new _.c(), w.onAfterShaderCompilationObservable = new _.c(), w._deterministicLockstep = !1, w._lockstepMaxSteps = 4, w._timeStep = 1 / 60, w._fps = 60, w._deltaTime = 0, w._drawCalls = new c.a(), w.canvasTabIndex = 1, w.disablePerformanceMonitorInBackground = !1, w._performanceMonitor = new m.a(), l.Instances.push(w), !h)\n              return w;\n            if (b = w._creationOptions, h.getContext) {\n              var N = h;\n              if (w._onCanvasFocus = function() {\n                w.onCanvasFocusObservable.notifyObservers(w);\n              }, w._onCanvasBlur = function() {\n                w.onCanvasBlurObservable.notifyObservers(w);\n              }, N.addEventListener(\"focus\", w._onCanvasFocus), N.addEventListener(\"blur\", w._onCanvasBlur), w._onBlur = function() {\n                w.disablePerformanceMonitorInBackground && w._performanceMonitor.disable(), w._windowIsBackground = !0;\n              }, w._onFocus = function() {\n                w.disablePerformanceMonitorInBackground && w._performanceMonitor.enable(), w._windowIsBackground = !1;\n              }, w._onCanvasPointerOut = function(X) {\n                w.onCanvasPointerOutObservable.notifyObservers(X);\n              }, N.addEventListener(\"pointerout\", w._onCanvasPointerOut), C.a.IsWindowObjectExist()) {\n                var M = w.getHostWindow();\n                M.addEventListener(\"blur\", w._onBlur), M.addEventListener(\"focus\", w._onFocus);\n                var U = document;\n                w._onFullscreenChange = function() {\n                  U.fullscreen !== void 0 ? w.isFullscreen = U.fullscreen : U.mozFullScreen !== void 0 ? w.isFullscreen = U.mozFullScreen : U.webkitIsFullScreen !== void 0 ? w.isFullscreen = U.webkitIsFullScreen : U.msIsFullScreen !== void 0 && (w.isFullscreen = U.msIsFullScreen), w.isFullscreen && w._pointerLockRequested && N && l._RequestPointerlock(N);\n                }, document.addEventListener(\"fullscreenchange\", w._onFullscreenChange, !1), document.addEventListener(\"mozfullscreenchange\", w._onFullscreenChange, !1), document.addEventListener(\"webkitfullscreenchange\", w._onFullscreenChange, !1), document.addEventListener(\"msfullscreenchange\", w._onFullscreenChange, !1), w._onPointerLockChange = function() {\n                  w.isPointerLock = U.mozPointerLockElement === N || U.webkitPointerLockElement === N || U.msPointerLockElement === N || U.pointerLockElement === N;\n                }, document.addEventListener(\"pointerlockchange\", w._onPointerLockChange, !1), document.addEventListener(\"mspointerlockchange\", w._onPointerLockChange, !1), document.addEventListener(\"mozpointerlockchange\", w._onPointerLockChange, !1), document.addEventListener(\"webkitpointerlockchange\", w._onPointerLockChange, !1), !l.audioEngine && b.audioEngine && l.AudioEngineFactory && (l.audioEngine = l.AudioEngineFactory(w.getRenderingCanvas()));\n              }\n              w._connectVREvents(), w.enableOfflineSupport = l.OfflineProviderFactory !== void 0, b.doNotHandleTouchAction || w._disableTouchAction(), w._deterministicLockstep = !!b.deterministicLockstep, w._lockstepMaxSteps = b.lockstepMaxSteps || 0, w._timeStep = b.timeStep || 1 / 60;\n            }\n            return w._prepareVRComponent(), b.autoEnableWebVR && w.initWebVR(), w;\n          }\n          return Object(V.d)(l, g), Object.defineProperty(l, \"NpmPackage\", { get: function() {\n            return O.a.NpmPackage;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"Version\", { get: function() {\n            return O.a.Version;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"Instances\", { get: function() {\n            return u.a.Instances;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"LastCreatedEngine\", { get: function() {\n            return u.a.LastCreatedEngine;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"LastCreatedScene\", { get: function() {\n            return u.a.LastCreatedScene;\n          }, enumerable: !1, configurable: !0 }), l.MarkAllMaterialsAsDirty = function(h, v) {\n            for (var b = 0; b < l.Instances.length; b++)\n              for (var D = l.Instances[b], w = 0; w < D.scenes.length; w++)\n                D.scenes[w].markAllMaterialsAsDirty(h, v);\n          }, l.DefaultLoadingScreenFactory = function(h) {\n            throw I.a.WarnImport(\"LoadingScreen\");\n          }, Object.defineProperty(l.prototype, \"_supportsHardwareTextureRescaling\", { get: function() {\n            return !!l._RescalePostProcessFactory;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l.prototype, \"performanceMonitor\", { get: function() {\n            return this._performanceMonitor;\n          }, enumerable: !1, configurable: !0 }), l.prototype.getInputElement = function() {\n            return this._renderingCanvas;\n          }, l.prototype.getAspectRatio = function(h, v) {\n            v === void 0 && (v = !1);\n            var b = h.viewport;\n            return this.getRenderWidth(v) * b.width / (this.getRenderHeight(v) * b.height);\n          }, l.prototype.getScreenAspectRatio = function() {\n            return this.getRenderWidth(!0) / this.getRenderHeight(!0);\n          }, l.prototype.getRenderingCanvasClientRect = function() {\n            return this._renderingCanvas ? this._renderingCanvas.getBoundingClientRect() : null;\n          }, l.prototype.getInputElementClientRect = function() {\n            return this._renderingCanvas ? this.getInputElement().getBoundingClientRect() : null;\n          }, l.prototype.isDeterministicLockStep = function() {\n            return this._deterministicLockstep;\n          }, l.prototype.getLockstepMaxSteps = function() {\n            return this._lockstepMaxSteps;\n          }, l.prototype.getTimeStep = function() {\n            return 1e3 * this._timeStep;\n          }, l.prototype.generateMipMapsForCubemap = function(h, v) {\n            if (v === void 0 && (v = !0), h.generateMipMaps) {\n              var b = this._gl;\n              this._bindTextureDirectly(b.TEXTURE_CUBE_MAP, h, !0), b.generateMipmap(b.TEXTURE_CUBE_MAP), v && this._bindTextureDirectly(b.TEXTURE_CUBE_MAP, null);\n            }\n          }, l.prototype.setState = function(h, v, b, D) {\n            v === void 0 && (v = 0), D === void 0 && (D = !1), (this._depthCullingState.cull !== h || b) && (this._depthCullingState.cull = h);\n            var w = this.cullBackFaces ? this._gl.BACK : this._gl.FRONT;\n            (this._depthCullingState.cullFace !== w || b) && (this._depthCullingState.cullFace = w), this.setZOffset(v);\n            var N = D ? this._gl.CW : this._gl.CCW;\n            (this._depthCullingState.frontFace !== N || b) && (this._depthCullingState.frontFace = N);\n          }, l.prototype.setZOffset = function(h) {\n            this._depthCullingState.zOffset = h;\n          }, l.prototype.getZOffset = function() {\n            return this._depthCullingState.zOffset;\n          }, l.prototype.setDepthBuffer = function(h) {\n            this._depthCullingState.depthTest = h;\n          }, l.prototype.getDepthWrite = function() {\n            return this._depthCullingState.depthMask;\n          }, l.prototype.setDepthWrite = function(h) {\n            this._depthCullingState.depthMask = h;\n          }, l.prototype.getStencilBuffer = function() {\n            return this._stencilState.stencilTest;\n          }, l.prototype.setStencilBuffer = function(h) {\n            this._stencilState.stencilTest = h;\n          }, l.prototype.getStencilMask = function() {\n            return this._stencilState.stencilMask;\n          }, l.prototype.setStencilMask = function(h) {\n            this._stencilState.stencilMask = h;\n          }, l.prototype.getStencilFunction = function() {\n            return this._stencilState.stencilFunc;\n          }, l.prototype.getStencilFunctionReference = function() {\n            return this._stencilState.stencilFuncRef;\n          }, l.prototype.getStencilFunctionMask = function() {\n            return this._stencilState.stencilFuncMask;\n          }, l.prototype.setStencilFunction = function(h) {\n            this._stencilState.stencilFunc = h;\n          }, l.prototype.setStencilFunctionReference = function(h) {\n            this._stencilState.stencilFuncRef = h;\n          }, l.prototype.setStencilFunctionMask = function(h) {\n            this._stencilState.stencilFuncMask = h;\n          }, l.prototype.getStencilOperationFail = function() {\n            return this._stencilState.stencilOpStencilFail;\n          }, l.prototype.getStencilOperationDepthFail = function() {\n            return this._stencilState.stencilOpDepthFail;\n          }, l.prototype.getStencilOperationPass = function() {\n            return this._stencilState.stencilOpStencilDepthPass;\n          }, l.prototype.setStencilOperationFail = function(h) {\n            this._stencilState.stencilOpStencilFail = h;\n          }, l.prototype.setStencilOperationDepthFail = function(h) {\n            this._stencilState.stencilOpDepthFail = h;\n          }, l.prototype.setStencilOperationPass = function(h) {\n            this._stencilState.stencilOpStencilDepthPass = h;\n          }, l.prototype.setDitheringState = function(h) {\n            h ? this._gl.enable(this._gl.DITHER) : this._gl.disable(this._gl.DITHER);\n          }, l.prototype.setRasterizerState = function(h) {\n            h ? this._gl.disable(this._gl.RASTERIZER_DISCARD) : this._gl.enable(this._gl.RASTERIZER_DISCARD);\n          }, l.prototype.getDepthFunction = function() {\n            return this._depthCullingState.depthFunc;\n          }, l.prototype.setDepthFunction = function(h) {\n            this._depthCullingState.depthFunc = h;\n          }, l.prototype.setDepthFunctionToGreater = function() {\n            this._depthCullingState.depthFunc = this._gl.GREATER;\n          }, l.prototype.setDepthFunctionToGreaterOrEqual = function() {\n            this._depthCullingState.depthFunc = this._gl.GEQUAL;\n          }, l.prototype.setDepthFunctionToLess = function() {\n            this._depthCullingState.depthFunc = this._gl.LESS;\n          }, l.prototype.setDepthFunctionToLessOrEqual = function() {\n            this._depthCullingState.depthFunc = this._gl.LEQUAL;\n          }, l.prototype.cacheStencilState = function() {\n            this._cachedStencilBuffer = this.getStencilBuffer(), this._cachedStencilFunction = this.getStencilFunction(), this._cachedStencilMask = this.getStencilMask(), this._cachedStencilOperationPass = this.getStencilOperationPass(), this._cachedStencilOperationFail = this.getStencilOperationFail(), this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail(), this._cachedStencilReference = this.getStencilFunctionReference();\n          }, l.prototype.restoreStencilState = function() {\n            this.setStencilFunction(this._cachedStencilFunction), this.setStencilMask(this._cachedStencilMask), this.setStencilBuffer(this._cachedStencilBuffer), this.setStencilOperationPass(this._cachedStencilOperationPass), this.setStencilOperationFail(this._cachedStencilOperationFail), this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail), this.setStencilFunctionReference(this._cachedStencilReference);\n          }, l.prototype.setDirectViewport = function(h, v, b, D) {\n            var w = this._cachedViewport;\n            return this._cachedViewport = null, this._viewport(h, v, b, D), w;\n          }, l.prototype.scissorClear = function(h, v, b, D, w) {\n            this.enableScissor(h, v, b, D), this.clear(w, !0, !0, !0), this.disableScissor();\n          }, l.prototype.enableScissor = function(h, v, b, D) {\n            var w = this._gl;\n            w.enable(w.SCISSOR_TEST), w.scissor(h, v, b, D);\n          }, l.prototype.disableScissor = function() {\n            var h = this._gl;\n            h.disable(h.SCISSOR_TEST);\n          }, l.prototype._reportDrawCall = function() {\n            this._drawCalls.addCount(1, !1);\n          }, l.prototype.initWebVR = function() {\n            throw I.a.WarnImport(\"WebVRCamera\");\n          }, l.prototype._prepareVRComponent = function() {\n          }, l.prototype._connectVREvents = function(h, v) {\n          }, l.prototype._submitVRFrame = function() {\n          }, l.prototype.disableVR = function() {\n          }, l.prototype.isVRPresenting = function() {\n            return !1;\n          }, l.prototype._requestVRFrame = function() {\n          }, l.prototype._loadFileAsync = function(h, v, b) {\n            var D = this;\n            return new Promise(function(w, N) {\n              D._loadFile(h, function(M) {\n                w(M);\n              }, void 0, v, b, function(M, U) {\n                N(U);\n              });\n            });\n          }, l.prototype.getVertexShaderSource = function(h) {\n            var v = this._gl.getAttachedShaders(h);\n            return v ? this._gl.getShaderSource(v[0]) : null;\n          }, l.prototype.getFragmentShaderSource = function(h) {\n            var v = this._gl.getAttachedShaders(h);\n            return v ? this._gl.getShaderSource(v[1]) : null;\n          }, l.prototype.setDepthStencilTexture = function(h, v, b) {\n            h !== void 0 && (v && (this._boundUniforms[h] = v), b && b.depthStencilTexture ? this._setTexture(h, b, !1, !0) : this._setTexture(h, null));\n          }, l.prototype.setTextureFromPostProcess = function(h, v) {\n            this._bindTexture(h, v ? v._textures.data[v._currentRenderTextureInd] : null);\n          }, l.prototype.setTextureFromPostProcessOutput = function(h, v) {\n            this._bindTexture(h, v ? v._outputTexture : null);\n          }, l.prototype._rebuildBuffers = function() {\n            for (var h = 0, v = this.scenes; h < v.length; h++) {\n              var b = v[h];\n              b.resetCachedMaterial(), b._rebuildGeometries(), b._rebuildTextures();\n            }\n            g.prototype._rebuildBuffers.call(this);\n          }, l.prototype._renderFrame = function() {\n            for (var h = 0; h < this._activeRenderLoops.length; h++)\n              (0, this._activeRenderLoops[h])();\n          }, l.prototype._renderLoop = function() {\n            if (!this._contextWasLost) {\n              var h = !0;\n              !this.renderEvenInBackground && this._windowIsBackground && (h = !1), h && (this.beginFrame(), this._renderViews() || this._renderFrame(), this.endFrame());\n            }\n            this._activeRenderLoops.length > 0 ? this.customAnimationFrameRequester ? (this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester), this._frameHandler = this.customAnimationFrameRequester.requestID) : this.isVRPresenting() ? this._requestVRFrame() : this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;\n          }, l.prototype._renderViews = function() {\n            return !1;\n          }, l.prototype.switchFullscreen = function(h) {\n            this.isFullscreen ? this.exitFullscreen() : this.enterFullscreen(h);\n          }, l.prototype.enterFullscreen = function(h) {\n            this.isFullscreen || (this._pointerLockRequested = h, this._renderingCanvas && l._RequestFullscreen(this._renderingCanvas));\n          }, l.prototype.exitFullscreen = function() {\n            this.isFullscreen && l._ExitFullscreen();\n          }, l.prototype.enterPointerlock = function() {\n            this._renderingCanvas && l._RequestPointerlock(this._renderingCanvas);\n          }, l.prototype.exitPointerlock = function() {\n            l._ExitPointerlock();\n          }, l.prototype.beginFrame = function() {\n            this._measureFps(), this.onBeginFrameObservable.notifyObservers(this), g.prototype.beginFrame.call(this);\n          }, l.prototype.endFrame = function() {\n            g.prototype.endFrame.call(this), this._submitVRFrame(), this.onEndFrameObservable.notifyObservers(this);\n          }, l.prototype.resize = function() {\n            this.isVRPresenting() || g.prototype.resize.call(this);\n          }, l.prototype.setSize = function(h, v) {\n            if (!this._renderingCanvas || !g.prototype.setSize.call(this, h, v))\n              return !1;\n            if (this.scenes) {\n              for (var b = 0; b < this.scenes.length; b++)\n                for (var D = this.scenes[b], w = 0; w < D.cameras.length; w++)\n                  D.cameras[w]._currentRenderId = 0;\n              this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this);\n            }\n            return !0;\n          }, l.prototype._deletePipelineContext = function(h) {\n            var v = h;\n            v && v.program && v.transformFeedback && (this.deleteTransformFeedback(v.transformFeedback), v.transformFeedback = null), g.prototype._deletePipelineContext.call(this, h);\n          }, l.prototype.createShaderProgram = function(h, v, b, D, w, N) {\n            N === void 0 && (N = null), w = w || this._gl, this.onBeforeShaderCompilationObservable.notifyObservers(this);\n            var M = g.prototype.createShaderProgram.call(this, h, v, b, D, w, N);\n            return this.onAfterShaderCompilationObservable.notifyObservers(this), M;\n          }, l.prototype._createShaderProgram = function(h, v, b, D, w) {\n            w === void 0 && (w = null);\n            var N = D.createProgram();\n            if (h.program = N, !N)\n              throw new Error(\"Unable to create program\");\n            if (D.attachShader(N, v), D.attachShader(N, b), this.webGLVersion > 1 && w) {\n              var M = this.createTransformFeedback();\n              this.bindTransformFeedback(M), this.setTranformFeedbackVaryings(N, w), h.transformFeedback = M;\n            }\n            return D.linkProgram(N), this.webGLVersion > 1 && w && this.bindTransformFeedback(null), h.context = D, h.vertexShader = v, h.fragmentShader = b, h.isParallelCompiled || this._finalizePipelineContext(h), N;\n          }, l.prototype._releaseTexture = function(h) {\n            g.prototype._releaseTexture.call(this, h), this.scenes.forEach(function(v) {\n              v.postProcesses.forEach(function(b) {\n                b._outputTexture == h && (b._outputTexture = null);\n              }), v.cameras.forEach(function(b) {\n                b._postProcesses.forEach(function(D) {\n                  D && D._outputTexture == h && (D._outputTexture = null);\n                });\n              });\n            });\n          }, l.prototype._rescaleTexture = function(h, v, b, D, w) {\n            var N = this;\n            this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);\n            var M = this.createRenderTargetTexture({ width: v.width, height: v.height }, { generateMipMaps: !1, type: x.a.TEXTURETYPE_UNSIGNED_INT, samplingMode: x.a.TEXTURE_BILINEAR_SAMPLINGMODE, generateDepthBuffer: !1, generateStencilBuffer: !1 });\n            !this._rescalePostProcess && l._RescalePostProcessFactory && (this._rescalePostProcess = l._RescalePostProcessFactory(this)), this._rescalePostProcess.getEffect().executeWhenCompiled(function() {\n              N._rescalePostProcess.onApply = function(X) {\n                X._bindTexture(\"textureSampler\", h);\n              };\n              var U = b;\n              U || (U = N.scenes[N.scenes.length - 1]), U.postProcessManager.directRender([N._rescalePostProcess], M, !0), N._bindTextureDirectly(N._gl.TEXTURE_2D, v, !0), N._gl.copyTexImage2D(N._gl.TEXTURE_2D, 0, D, 0, 0, v.width, v.height, 0), N.unBindFramebuffer(M), N._releaseTexture(M), w && w();\n            });\n          }, l.prototype.getFps = function() {\n            return this._fps;\n          }, l.prototype.getDeltaTime = function() {\n            return this._deltaTime;\n          }, l.prototype._measureFps = function() {\n            this._performanceMonitor.sampleFrame(), this._fps = this._performanceMonitor.averageFPS, this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\n          }, l.prototype._uploadImageToTexture = function(h, v, b, D) {\n            b === void 0 && (b = 0), D === void 0 && (D = 0);\n            var w = this._gl, N = this._getWebGLTextureType(h.type), M = this._getInternalFormat(h.format), U = this._getRGBABufferInternalSizedFormat(h.type, M), X = h.isCube ? w.TEXTURE_CUBE_MAP : w.TEXTURE_2D;\n            this._bindTextureDirectly(X, h, !0), this._unpackFlipY(h.invertY);\n            var j = w.TEXTURE_2D;\n            h.isCube && (j = w.TEXTURE_CUBE_MAP_POSITIVE_X + b), w.texImage2D(j, D, U, M, N, v), this._bindTextureDirectly(X, null, !0);\n          }, l.prototype.updateRenderTargetTextureSampleCount = function(h, v) {\n            if (this.webGLVersion < 2 || !h)\n              return 1;\n            if (h.samples === v)\n              return v;\n            var b = this._gl;\n            if (v = Math.min(v, this.getCaps().maxMSAASamples), h._depthStencilBuffer && (b.deleteRenderbuffer(h._depthStencilBuffer), h._depthStencilBuffer = null), h._MSAAFramebuffer && (b.deleteFramebuffer(h._MSAAFramebuffer), h._MSAAFramebuffer = null), h._MSAARenderBuffer && (b.deleteRenderbuffer(h._MSAARenderBuffer), h._MSAARenderBuffer = null), v > 1 && b.renderbufferStorageMultisample) {\n              var D = b.createFramebuffer();\n              if (!D)\n                throw new Error(\"Unable to create multi sampled framebuffer\");\n              h._MSAAFramebuffer = D, this._bindUnboundFramebuffer(h._MSAAFramebuffer);\n              var w = b.createRenderbuffer();\n              if (!w)\n                throw new Error(\"Unable to create multi sampled framebuffer\");\n              b.bindRenderbuffer(b.RENDERBUFFER, w), b.renderbufferStorageMultisample(b.RENDERBUFFER, v, this._getRGBAMultiSampleBufferFormat(h.type), h.width, h.height), b.framebufferRenderbuffer(b.FRAMEBUFFER, b.COLOR_ATTACHMENT0, b.RENDERBUFFER, w), h._MSAARenderBuffer = w;\n            } else\n              this._bindUnboundFramebuffer(h._framebuffer);\n            return h.samples = v, h._depthStencilBuffer = this._setupFramebufferDepthAttachments(h._generateStencilBuffer, h._generateDepthBuffer, h.width, h.height, v), this._bindUnboundFramebuffer(null), v;\n          }, l.prototype.updateTextureComparisonFunction = function(h, v) {\n            if (this.webGLVersion !== 1) {\n              var b = this._gl;\n              h.isCube ? (this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, h, !0), v === 0 ? (b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_FUNC, x.a.LEQUAL), b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_MODE, b.NONE)) : (b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_FUNC, v), b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_MODE, b.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null)) : (this._bindTextureDirectly(this._gl.TEXTURE_2D, h, !0), v === 0 ? (b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_FUNC, x.a.LEQUAL), b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_MODE, b.NONE)) : (b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_FUNC, v), b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_MODE, b.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_2D, null)), h._comparisonFunction = v;\n            } else\n              S.a.Error(\"WebGL 1 does not support texture comparison.\");\n          }, l.prototype.createInstancesBuffer = function(h) {\n            var v = this._gl.createBuffer();\n            if (!v)\n              throw new Error(\"Unable to create instance buffer\");\n            var b = new T.a(v);\n            return b.capacity = h, this.bindArrayBuffer(b), this._gl.bufferData(this._gl.ARRAY_BUFFER, h, this._gl.DYNAMIC_DRAW), b;\n          }, l.prototype.deleteInstancesBuffer = function(h) {\n            this._gl.deleteBuffer(h);\n          }, l.prototype._clientWaitAsync = function(h, v, b) {\n            v === void 0 && (v = 0), b === void 0 && (b = 10);\n            var D = this._gl;\n            return new Promise(function(w, N) {\n              var M = function() {\n                var U = D.clientWaitSync(h, v, 0);\n                U != D.WAIT_FAILED ? U != D.TIMEOUT_EXPIRED ? w() : setTimeout(M, b) : N();\n              };\n              M();\n            });\n          }, l.prototype._readPixelsAsync = function(h, v, b, D, w, N, M) {\n            if (this._webGLVersion < 2)\n              throw new Error(\"_readPixelsAsync only work on WebGL2+\");\n            var U = this._gl, X = U.createBuffer();\n            U.bindBuffer(U.PIXEL_PACK_BUFFER, X), U.bufferData(U.PIXEL_PACK_BUFFER, M.byteLength, U.STREAM_READ), U.readPixels(h, v, b, D, w, N, 0), U.bindBuffer(U.PIXEL_PACK_BUFFER, null);\n            var j = U.fenceSync(U.SYNC_GPU_COMMANDS_COMPLETE, 0);\n            return j ? (U.flush(), this._clientWaitAsync(j, 0, 10).then(function() {\n              return U.deleteSync(j), U.bindBuffer(U.PIXEL_PACK_BUFFER, X), U.getBufferSubData(U.PIXEL_PACK_BUFFER, 0, M), U.bindBuffer(U.PIXEL_PACK_BUFFER, null), U.deleteBuffer(X), M;\n            })) : null;\n          }, l.prototype.dispose = function() {\n            for (this.hideLoadingUI(), this.onNewSceneAddedObservable.clear(); this.postProcesses.length; )\n              this.postProcesses[0].dispose();\n            for (this._rescalePostProcess && this._rescalePostProcess.dispose(); this.scenes.length; )\n              this.scenes[0].dispose();\n            l.Instances.length === 1 && l.audioEngine && l.audioEngine.dispose(), this.disableVR(), C.a.IsWindowObjectExist() && (window.removeEventListener(\"blur\", this._onBlur), window.removeEventListener(\"focus\", this._onFocus), this._renderingCanvas && (this._renderingCanvas.removeEventListener(\"focus\", this._onCanvasFocus), this._renderingCanvas.removeEventListener(\"blur\", this._onCanvasBlur), this._renderingCanvas.removeEventListener(\"pointerout\", this._onCanvasPointerOut)), C.a.IsDocumentAvailable() && (document.removeEventListener(\"fullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"mozfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"webkitfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"msfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"pointerlockchange\", this._onPointerLockChange), document.removeEventListener(\"mspointerlockchange\", this._onPointerLockChange), document.removeEventListener(\"mozpointerlockchange\", this._onPointerLockChange), document.removeEventListener(\"webkitpointerlockchange\", this._onPointerLockChange))), g.prototype.dispose.call(this);\n            var h = l.Instances.indexOf(this);\n            h >= 0 && l.Instances.splice(h, 1), this.onResizeObservable.clear(), this.onCanvasBlurObservable.clear(), this.onCanvasFocusObservable.clear(), this.onCanvasPointerOutObservable.clear(), this.onBeginFrameObservable.clear(), this.onEndFrameObservable.clear();\n          }, l.prototype._disableTouchAction = function() {\n            this._renderingCanvas && this._renderingCanvas.setAttribute && (this._renderingCanvas.setAttribute(\"touch-action\", \"none\"), this._renderingCanvas.style.touchAction = \"none\", this._renderingCanvas.style.msTouchAction = \"none\");\n          }, l.prototype.displayLoadingUI = function() {\n            if (C.a.IsWindowObjectExist()) {\n              var h = this.loadingScreen;\n              h && h.displayLoadingUI();\n            }\n          }, l.prototype.hideLoadingUI = function() {\n            if (C.a.IsWindowObjectExist()) {\n              var h = this._loadingScreen;\n              h && h.hideLoadingUI();\n            }\n          }, Object.defineProperty(l.prototype, \"loadingScreen\", { get: function() {\n            return !this._loadingScreen && this._renderingCanvas && (this._loadingScreen = l.DefaultLoadingScreenFactory(this._renderingCanvas)), this._loadingScreen;\n          }, set: function(h) {\n            this._loadingScreen = h;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l.prototype, \"loadingUIText\", { set: function(h) {\n            this.loadingScreen.loadingUIText = h;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l.prototype, \"loadingUIBackgroundColor\", { set: function(h) {\n            this.loadingScreen.loadingUIBackgroundColor = h;\n          }, enumerable: !1, configurable: !0 }), l._RequestPointerlock = function(h) {\n            h.requestPointerLock = h.requestPointerLock || h.msRequestPointerLock || h.mozRequestPointerLock || h.webkitRequestPointerLock, h.requestPointerLock && h.requestPointerLock();\n          }, l._ExitPointerlock = function() {\n            var h = document;\n            document.exitPointerLock = document.exitPointerLock || h.msExitPointerLock || h.mozExitPointerLock || h.webkitExitPointerLock, document.exitPointerLock && document.exitPointerLock();\n          }, l._RequestFullscreen = function(h) {\n            var v = h.requestFullscreen || h.msRequestFullscreen || h.webkitRequestFullscreen || h.mozRequestFullScreen;\n            v && v.call(h);\n          }, l._ExitFullscreen = function() {\n            var h = document;\n            document.exitFullscreen ? document.exitFullscreen() : h.mozCancelFullScreen ? h.mozCancelFullScreen() : h.webkitCancelFullScreen ? h.webkitCancelFullScreen() : h.msCancelFullScreen && h.msCancelFullScreen();\n          }, l.ALPHA_DISABLE = x.a.ALPHA_DISABLE, l.ALPHA_ADD = x.a.ALPHA_ADD, l.ALPHA_COMBINE = x.a.ALPHA_COMBINE, l.ALPHA_SUBTRACT = x.a.ALPHA_SUBTRACT, l.ALPHA_MULTIPLY = x.a.ALPHA_MULTIPLY, l.ALPHA_MAXIMIZED = x.a.ALPHA_MAXIMIZED, l.ALPHA_ONEONE = x.a.ALPHA_ONEONE, l.ALPHA_PREMULTIPLIED = x.a.ALPHA_PREMULTIPLIED, l.ALPHA_PREMULTIPLIED_PORTERDUFF = x.a.ALPHA_PREMULTIPLIED_PORTERDUFF, l.ALPHA_INTERPOLATE = x.a.ALPHA_INTERPOLATE, l.ALPHA_SCREENMODE = x.a.ALPHA_SCREENMODE, l.DELAYLOADSTATE_NONE = x.a.DELAYLOADSTATE_NONE, l.DELAYLOADSTATE_LOADED = x.a.DELAYLOADSTATE_LOADED, l.DELAYLOADSTATE_LOADING = x.a.DELAYLOADSTATE_LOADING, l.DELAYLOADSTATE_NOTLOADED = x.a.DELAYLOADSTATE_NOTLOADED, l.NEVER = x.a.NEVER, l.ALWAYS = x.a.ALWAYS, l.LESS = x.a.LESS, l.EQUAL = x.a.EQUAL, l.LEQUAL = x.a.LEQUAL, l.GREATER = x.a.GREATER, l.GEQUAL = x.a.GEQUAL, l.NOTEQUAL = x.a.NOTEQUAL, l.KEEP = x.a.KEEP, l.REPLACE = x.a.REPLACE, l.INCR = x.a.INCR, l.DECR = x.a.DECR, l.INVERT = x.a.INVERT, l.INCR_WRAP = x.a.INCR_WRAP, l.DECR_WRAP = x.a.DECR_WRAP, l.TEXTURE_CLAMP_ADDRESSMODE = x.a.TEXTURE_CLAMP_ADDRESSMODE, l.TEXTURE_WRAP_ADDRESSMODE = x.a.TEXTURE_WRAP_ADDRESSMODE, l.TEXTURE_MIRROR_ADDRESSMODE = x.a.TEXTURE_MIRROR_ADDRESSMODE, l.TEXTUREFORMAT_ALPHA = x.a.TEXTUREFORMAT_ALPHA, l.TEXTUREFORMAT_LUMINANCE = x.a.TEXTUREFORMAT_LUMINANCE, l.TEXTUREFORMAT_LUMINANCE_ALPHA = x.a.TEXTUREFORMAT_LUMINANCE_ALPHA, l.TEXTUREFORMAT_RGB = x.a.TEXTUREFORMAT_RGB, l.TEXTUREFORMAT_RGBA = x.a.TEXTUREFORMAT_RGBA, l.TEXTUREFORMAT_RED = x.a.TEXTUREFORMAT_RED, l.TEXTUREFORMAT_R = x.a.TEXTUREFORMAT_R, l.TEXTUREFORMAT_RG = x.a.TEXTUREFORMAT_RG, l.TEXTUREFORMAT_RED_INTEGER = x.a.TEXTUREFORMAT_RED_INTEGER, l.TEXTUREFORMAT_R_INTEGER = x.a.TEXTUREFORMAT_R_INTEGER, l.TEXTUREFORMAT_RG_INTEGER = x.a.TEXTUREFORMAT_RG_INTEGER, l.TEXTUREFORMAT_RGB_INTEGER = x.a.TEXTUREFORMAT_RGB_INTEGER, l.TEXTUREFORMAT_RGBA_INTEGER = x.a.TEXTUREFORMAT_RGBA_INTEGER, l.TEXTURETYPE_UNSIGNED_BYTE = x.a.TEXTURETYPE_UNSIGNED_BYTE, l.TEXTURETYPE_UNSIGNED_INT = x.a.TEXTURETYPE_UNSIGNED_INT, l.TEXTURETYPE_FLOAT = x.a.TEXTURETYPE_FLOAT, l.TEXTURETYPE_HALF_FLOAT = x.a.TEXTURETYPE_HALF_FLOAT, l.TEXTURETYPE_BYTE = x.a.TEXTURETYPE_BYTE, l.TEXTURETYPE_SHORT = x.a.TEXTURETYPE_SHORT, l.TEXTURETYPE_UNSIGNED_SHORT = x.a.TEXTURETYPE_UNSIGNED_SHORT, l.TEXTURETYPE_INT = x.a.TEXTURETYPE_INT, l.TEXTURETYPE_UNSIGNED_INTEGER = x.a.TEXTURETYPE_UNSIGNED_INTEGER, l.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = x.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4, l.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = x.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1, l.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = x.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5, l.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = x.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV, l.TEXTURETYPE_UNSIGNED_INT_24_8 = x.a.TEXTURETYPE_UNSIGNED_INT_24_8, l.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = x.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV, l.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = x.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV, l.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = x.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV, l.TEXTURE_NEAREST_SAMPLINGMODE = x.a.TEXTURE_NEAREST_SAMPLINGMODE, l.TEXTURE_BILINEAR_SAMPLINGMODE = x.a.TEXTURE_BILINEAR_SAMPLINGMODE, l.TEXTURE_TRILINEAR_SAMPLINGMODE = x.a.TEXTURE_TRILINEAR_SAMPLINGMODE, l.TEXTURE_NEAREST_NEAREST_MIPLINEAR = x.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR, l.TEXTURE_LINEAR_LINEAR_MIPNEAREST = x.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST, l.TEXTURE_LINEAR_LINEAR_MIPLINEAR = x.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR, l.TEXTURE_NEAREST_NEAREST_MIPNEAREST = x.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST, l.TEXTURE_NEAREST_LINEAR_MIPNEAREST = x.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST, l.TEXTURE_NEAREST_LINEAR_MIPLINEAR = x.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR, l.TEXTURE_NEAREST_LINEAR = x.a.TEXTURE_NEAREST_LINEAR, l.TEXTURE_NEAREST_NEAREST = x.a.TEXTURE_NEAREST_NEAREST, l.TEXTURE_LINEAR_NEAREST_MIPNEAREST = x.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST, l.TEXTURE_LINEAR_NEAREST_MIPLINEAR = x.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR, l.TEXTURE_LINEAR_LINEAR = x.a.TEXTURE_LINEAR_LINEAR, l.TEXTURE_LINEAR_NEAREST = x.a.TEXTURE_LINEAR_NEAREST, l.TEXTURE_EXPLICIT_MODE = x.a.TEXTURE_EXPLICIT_MODE, l.TEXTURE_SPHERICAL_MODE = x.a.TEXTURE_SPHERICAL_MODE, l.TEXTURE_PLANAR_MODE = x.a.TEXTURE_PLANAR_MODE, l.TEXTURE_CUBIC_MODE = x.a.TEXTURE_CUBIC_MODE, l.TEXTURE_PROJECTION_MODE = x.a.TEXTURE_PROJECTION_MODE, l.TEXTURE_SKYBOX_MODE = x.a.TEXTURE_SKYBOX_MODE, l.TEXTURE_INVCUBIC_MODE = x.a.TEXTURE_INVCUBIC_MODE, l.TEXTURE_EQUIRECTANGULAR_MODE = x.a.TEXTURE_EQUIRECTANGULAR_MODE, l.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = x.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, l.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = x.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, l.SCALEMODE_FLOOR = x.a.SCALEMODE_FLOOR, l.SCALEMODE_NEAREST = x.a.SCALEMODE_NEAREST, l.SCALEMODE_CEILING = x.a.SCALEMODE_CEILING, l._RescalePostProcessFactory = null, l;\n        }(O.a));\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.WithinEpsilon = function(C, u, I) {\n            I === void 0 && (I = 1401298e-51);\n            var O = C - u;\n            return -I <= O && O <= I;\n          }, _.ToHex = function(C) {\n            var u = C.toString(16);\n            return C <= 15 ? (\"0\" + u).toUpperCase() : u.toUpperCase();\n          }, _.Sign = function(C) {\n            return (C = +C) == 0 || isNaN(C) ? C : C > 0 ? 1 : -1;\n          }, _.Clamp = function(C, u, I) {\n            return u === void 0 && (u = 0), I === void 0 && (I = 1), Math.min(I, Math.max(u, C));\n          }, _.Log2 = function(C) {\n            return Math.log(C) * Math.LOG2E;\n          }, _.Repeat = function(C, u) {\n            return C - Math.floor(C / u) * u;\n          }, _.Normalize = function(C, u, I) {\n            return (C - u) / (I - u);\n          }, _.Denormalize = function(C, u, I) {\n            return C * (I - u) + u;\n          }, _.DeltaAngle = function(C, u) {\n            var I = _.Repeat(u - C, 360);\n            return I > 180 && (I -= 360), I;\n          }, _.PingPong = function(C, u) {\n            var I = _.Repeat(C, 2 * u);\n            return u - Math.abs(I - u);\n          }, _.SmoothStep = function(C, u, I) {\n            var O = _.Clamp(I);\n            return u * (O = -2 * O * O * O + 3 * O * O) + C * (1 - O);\n          }, _.MoveTowards = function(C, u, I) {\n            return Math.abs(u - C) <= I ? u : C + _.Sign(u - C) * I;\n          }, _.MoveTowardsAngle = function(C, u, I) {\n            var O = _.DeltaAngle(C, u), x = 0;\n            return -I < O && O < I ? x = u : (u = C + O, x = _.MoveTowards(C, u, I)), x;\n          }, _.Lerp = function(C, u, I) {\n            return C + (u - C) * I;\n          }, _.LerpAngle = function(C, u, I) {\n            var O = _.Repeat(u - C, 360);\n            return O > 180 && (O -= 360), C + O * _.Clamp(I);\n          }, _.InverseLerp = function(C, u, I) {\n            return C != u ? _.Clamp((I - C) / (u - C)) : 0;\n          }, _.Hermite = function(C, u, I, O, x) {\n            var m = x * x, c = x * m;\n            return C * (2 * c - 3 * m + 1) + I * (-2 * c + 3 * m) + u * (c - 2 * m + x) + O * (c - m);\n          }, _.RandomRange = function(C, u) {\n            return C === u ? C : Math.random() * (u - C) + C;\n          }, _.RangeToPercent = function(C, u, I) {\n            return (C - u) / (I - u);\n          }, _.PercentToRange = function(C, u, I) {\n            return (I - u) * C + u;\n          }, _.NormalizeRadians = function(C) {\n            return C -= _.TwoPi * Math.floor((C + Math.PI) / _.TwoPi);\n          }, _.TwoPi = 2 * Math.PI, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return c;\n        });\n        var V = f(8), _ = f(20), C = f(22), u = f(4), I = f(48), O = f(2), x = f(9), m = f(119), c = function() {\n          function T() {\n          }\n          return T.BindEyePosition = function(S, E, g) {\n            if (g === void 0 && (g = \"vEyePosition\"), E._forcedViewPosition)\n              S.setVector3(g, E._forcedViewPosition);\n            else {\n              var l = E.activeCamera.globalPosition;\n              l || (l = E.activeCamera.devicePosition), S.setVector3(g, E._mirroredCameraPosition ? E._mirroredCameraPosition : l);\n            }\n          }, T.PrepareDefinesForMergedUV = function(S, E, g) {\n            E._needUVs = !0, E[g] = !0, S.getTextureMatrix().isIdentityAs3x2() ? (E[g + \"DIRECTUV\"] = S.coordinatesIndex + 1, S.coordinatesIndex === 0 ? E.MAINUV1 = !0 : E.MAINUV2 = !0) : E[g + \"DIRECTUV\"] = 0;\n          }, T.BindTextureMatrix = function(S, E, g) {\n            var l = S.getTextureMatrix();\n            E.updateMatrix(g + \"Matrix\", l);\n          }, T.GetFogState = function(S, E) {\n            return E.fogEnabled && S.applyFog && E.fogMode !== _.a.FOGMODE_NONE;\n          }, T.PrepareDefinesForMisc = function(S, E, g, l, h, v, b) {\n            b._areMiscDirty && (b.LOGARITHMICDEPTH = g, b.POINTSIZE = l, b.FOG = h && this.GetFogState(S, E), b.NONUNIFORMSCALING = S.nonUniformScaling, b.ALPHATEST = v);\n          }, T.PrepareDefinesForFrameBoundValues = function(S, E, g, l, h, v) {\n            h === void 0 && (h = null), v === void 0 && (v = !1);\n            var b, D, w, N, M, U, X = !1;\n            b = h ?? (S.clipPlane !== void 0 && S.clipPlane !== null), D = h ?? (S.clipPlane2 !== void 0 && S.clipPlane2 !== null), w = h ?? (S.clipPlane3 !== void 0 && S.clipPlane3 !== null), N = h ?? (S.clipPlane4 !== void 0 && S.clipPlane4 !== null), M = h ?? (S.clipPlane5 !== void 0 && S.clipPlane5 !== null), U = h ?? (S.clipPlane6 !== void 0 && S.clipPlane6 !== null), g.CLIPPLANE !== b && (g.CLIPPLANE = b, X = !0), g.CLIPPLANE2 !== D && (g.CLIPPLANE2 = D, X = !0), g.CLIPPLANE3 !== w && (g.CLIPPLANE3 = w, X = !0), g.CLIPPLANE4 !== N && (g.CLIPPLANE4 = N, X = !0), g.CLIPPLANE5 !== M && (g.CLIPPLANE5 = M, X = !0), g.CLIPPLANE6 !== U && (g.CLIPPLANE6 = U, X = !0), g.DEPTHPREPASS !== !E.getColorWrite() && (g.DEPTHPREPASS = !g.DEPTHPREPASS, X = !0), g.INSTANCES !== l && (g.INSTANCES = l, X = !0), g.THIN_INSTANCES !== v && (g.THIN_INSTANCES = v, X = !0), X && g.markAsUnprocessed();\n          }, T.PrepareDefinesForBones = function(S, E) {\n            if (S.useBones && S.computeBonesUsingShaders && S.skeleton) {\n              E.NUM_BONE_INFLUENCERS = S.numBoneInfluencers;\n              var g = E.BONETEXTURE !== void 0;\n              if (S.skeleton.isUsingTextureForMatrices && g)\n                E.BONETEXTURE = !0;\n              else {\n                E.BonesPerMesh = S.skeleton.bones.length + 1, E.BONETEXTURE = !g && void 0;\n                var l = S.getScene().prePassRenderer;\n                if (l && l.enabled) {\n                  var h = l.excludedSkinnedMesh.indexOf(S) === -1;\n                  E.BONES_VELOCITY_ENABLED = h;\n                }\n              }\n            } else\n              E.NUM_BONE_INFLUENCERS = 0, E.BonesPerMesh = 0;\n          }, T.PrepareDefinesForMorphTargets = function(S, E) {\n            var g = S.morphTargetManager;\n            g ? (E.MORPHTARGETS_UV = g.supportsUVs && E.UV1, E.MORPHTARGETS_TANGENT = g.supportsTangents && E.TANGENT, E.MORPHTARGETS_NORMAL = g.supportsNormals && E.NORMAL, E.MORPHTARGETS = g.numInfluencers > 0, E.NUM_MORPH_INFLUENCERS = g.numInfluencers) : (E.MORPHTARGETS_UV = !1, E.MORPHTARGETS_TANGENT = !1, E.MORPHTARGETS_NORMAL = !1, E.MORPHTARGETS = !1, E.NUM_MORPH_INFLUENCERS = 0);\n          }, T.PrepareDefinesForAttributes = function(S, E, g, l, h, v) {\n            if (h === void 0 && (h = !1), v === void 0 && (v = !0), !E._areAttributesDirty && E._needNormals === E._normals && E._needUVs === E._uvs)\n              return !1;\n            if (E._normals = E._needNormals, E._uvs = E._needUVs, E.NORMAL = E._needNormals && S.isVerticesDataPresent(u.b.NormalKind), E._needNormals && S.isVerticesDataPresent(u.b.TangentKind) && (E.TANGENT = !0), E._needUVs ? (E.UV1 = S.isVerticesDataPresent(u.b.UVKind), E.UV2 = S.isVerticesDataPresent(u.b.UV2Kind)) : (E.UV1 = !1, E.UV2 = !1), g) {\n              var b = S.useVertexColors && S.isVerticesDataPresent(u.b.ColorKind);\n              E.VERTEXCOLOR = b, E.VERTEXALPHA = S.hasVertexAlpha && b && v;\n            }\n            return l && this.PrepareDefinesForBones(S, E), h && this.PrepareDefinesForMorphTargets(S, E), !0;\n          }, T.PrepareDefinesForMultiview = function(S, E) {\n            if (S.activeCamera) {\n              var g = E.MULTIVIEW;\n              E.MULTIVIEW = S.activeCamera.outputRenderTarget !== null && S.activeCamera.outputRenderTarget.getViewCount() > 1, E.MULTIVIEW != g && E.markAsUnprocessed();\n            }\n          }, T.PrepareDefinesForPrePass = function(S, E, g) {\n            var l = E.PREPASS;\n            if (E._arePrePassDirty) {\n              var h = [{ type: O.a.PREPASS_POSITION_TEXTURE_TYPE, define: \"PREPASS_POSITION\", index: \"PREPASS_POSITION_INDEX\" }, { type: O.a.PREPASS_VELOCITY_TEXTURE_TYPE, define: \"PREPASS_VELOCITY\", index: \"PREPASS_VELOCITY_INDEX\" }, { type: O.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, define: \"PREPASS_REFLECTIVITY\", index: \"PREPASS_REFLECTIVITY_INDEX\" }, { type: O.a.PREPASS_IRRADIANCE_TEXTURE_TYPE, define: \"PREPASS_IRRADIANCE\", index: \"PREPASS_IRRADIANCE_INDEX\" }, { type: O.a.PREPASS_ALBEDO_TEXTURE_TYPE, define: \"PREPASS_ALBEDO\", index: \"PREPASS_ALBEDO_INDEX\" }, { type: O.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, define: \"PREPASS_DEPTHNORMAL\", index: \"PREPASS_DEPTHNORMAL_INDEX\" }];\n              if (S.prePassRenderer && S.prePassRenderer.enabled && g) {\n                E.PREPASS = !0, E.SCENE_MRT_COUNT = S.prePassRenderer.mrtCount;\n                for (var v = 0; v < h.length; v++) {\n                  var b = S.prePassRenderer.getIndex(h[v].type);\n                  b !== -1 ? (E[h[v].define] = !0, E[h[v].index] = b) : E[h[v].define] = !1;\n                }\n              } else\n                for (E.PREPASS = !1, v = 0; v < h.length; v++)\n                  E[h[v].define] = !1;\n              E.PREPASS != l && (E.markAsUnprocessed(), E.markAsImageProcessingDirty());\n            }\n          }, T.PrepareDefinesForLight = function(S, E, g, l, h, v, b) {\n            switch (b.needNormals = !0, h[\"LIGHT\" + l] === void 0 && (b.needRebuild = !0), h[\"LIGHT\" + l] = !0, h[\"SPOTLIGHT\" + l] = !1, h[\"HEMILIGHT\" + l] = !1, h[\"POINTLIGHT\" + l] = !1, h[\"DIRLIGHT\" + l] = !1, g.prepareLightSpecificDefines(h, l), h[\"LIGHT_FALLOFF_PHYSICAL\" + l] = !1, h[\"LIGHT_FALLOFF_GLTF\" + l] = !1, h[\"LIGHT_FALLOFF_STANDARD\" + l] = !1, g.falloffType) {\n              case I.a.FALLOFF_GLTF:\n                h[\"LIGHT_FALLOFF_GLTF\" + l] = !0;\n                break;\n              case I.a.FALLOFF_PHYSICAL:\n                h[\"LIGHT_FALLOFF_PHYSICAL\" + l] = !0;\n                break;\n              case I.a.FALLOFF_STANDARD:\n                h[\"LIGHT_FALLOFF_STANDARD\" + l] = !0;\n            }\n            if (v && !g.specular.equalsFloats(0, 0, 0) && (b.specularEnabled = !0), h[\"SHADOW\" + l] = !1, h[\"SHADOWCSM\" + l] = !1, h[\"SHADOWCSMDEBUG\" + l] = !1, h[\"SHADOWCSMNUM_CASCADES\" + l] = !1, h[\"SHADOWCSMUSESHADOWMAXZ\" + l] = !1, h[\"SHADOWCSMNOBLEND\" + l] = !1, h[\"SHADOWCSM_RIGHTHANDED\" + l] = !1, h[\"SHADOWPCF\" + l] = !1, h[\"SHADOWPCSS\" + l] = !1, h[\"SHADOWPOISSON\" + l] = !1, h[\"SHADOWESM\" + l] = !1, h[\"SHADOWCLOSEESM\" + l] = !1, h[\"SHADOWCUBE\" + l] = !1, h[\"SHADOWLOWQUALITY\" + l] = !1, h[\"SHADOWMEDIUMQUALITY\" + l] = !1, E && E.receiveShadows && S.shadowsEnabled && g.shadowEnabled) {\n              var D = g.getShadowGenerator();\n              if (D) {\n                var w = D.getShadowMap();\n                w && w.renderList && w.renderList.length > 0 && (b.shadowEnabled = !0, D.prepareDefines(h, l));\n              }\n            }\n            g.lightmapMode != I.a.LIGHTMAP_DEFAULT ? (b.lightmapMode = !0, h[\"LIGHTMAPEXCLUDED\" + l] = !0, h[\"LIGHTMAPNOSPECULAR\" + l] = g.lightmapMode == I.a.LIGHTMAP_SHADOWSONLY) : (h[\"LIGHTMAPEXCLUDED\" + l] = !1, h[\"LIGHTMAPNOSPECULAR\" + l] = !1);\n          }, T.PrepareDefinesForLights = function(S, E, g, l, h, v) {\n            if (h === void 0 && (h = 4), v === void 0 && (v = !1), !g._areLightsDirty)\n              return g._needNormals;\n            var b = 0, D = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };\n            if (S.lightsEnabled && !v)\n              for (var w = 0, N = E.lightSources; w < N.length; w++) {\n                var M = N[w];\n                if (this.PrepareDefinesForLight(S, E, M, b, g, l, D), ++b === h)\n                  break;\n              }\n            g.SPECULARTERM = D.specularEnabled, g.SHADOWS = D.shadowEnabled;\n            for (var U = b; U < h; U++)\n              g[\"LIGHT\" + U] !== void 0 && (g[\"LIGHT\" + U] = !1, g[\"HEMILIGHT\" + U] = !1, g[\"POINTLIGHT\" + U] = !1, g[\"DIRLIGHT\" + U] = !1, g[\"SPOTLIGHT\" + U] = !1, g[\"SHADOW\" + U] = !1, g[\"SHADOWCSM\" + U] = !1, g[\"SHADOWCSMDEBUG\" + U] = !1, g[\"SHADOWCSMNUM_CASCADES\" + U] = !1, g[\"SHADOWCSMUSESHADOWMAXZ\" + U] = !1, g[\"SHADOWCSMNOBLEND\" + U] = !1, g[\"SHADOWCSM_RIGHTHANDED\" + U] = !1, g[\"SHADOWPCF\" + U] = !1, g[\"SHADOWPCSS\" + U] = !1, g[\"SHADOWPOISSON\" + U] = !1, g[\"SHADOWESM\" + U] = !1, g[\"SHADOWCLOSEESM\" + U] = !1, g[\"SHADOWCUBE\" + U] = !1, g[\"SHADOWLOWQUALITY\" + U] = !1, g[\"SHADOWMEDIUMQUALITY\" + U] = !1);\n            var X = S.getEngine().getCaps();\n            return g.SHADOWFLOAT === void 0 && (D.needRebuild = !0), g.SHADOWFLOAT = D.shadowEnabled && (X.textureFloatRender && X.textureFloatLinearFiltering || X.textureHalfFloatRender && X.textureHalfFloatLinearFiltering), g.LIGHTMAPEXCLUDED = D.lightmapMode, D.needRebuild && g.rebuild(), D.needNormals;\n          }, T.PrepareUniformsAndSamplersForLight = function(S, E, g, l, h, v) {\n            h === void 0 && (h = null), v === void 0 && (v = !1), h && h.push(\"Light\" + S), v || (E.push(\"vLightData\" + S, \"vLightDiffuse\" + S, \"vLightSpecular\" + S, \"vLightDirection\" + S, \"vLightFalloff\" + S, \"vLightGround\" + S, \"lightMatrix\" + S, \"shadowsInfo\" + S, \"depthValues\" + S), g.push(\"shadowSampler\" + S), g.push(\"depthSampler\" + S), E.push(\"viewFrustumZ\" + S, \"cascadeBlendFactor\" + S, \"lightSizeUVCorrection\" + S, \"depthCorrection\" + S, \"penumbraDarkness\" + S, \"frustumLengths\" + S), l && (g.push(\"projectionLightSampler\" + S), E.push(\"textureProjectionMatrix\" + S)));\n          }, T.PrepareUniformsAndSamplersList = function(S, E, g, l) {\n            var h;\n            l === void 0 && (l = 4);\n            var v = null;\n            if (S.uniformsNames) {\n              var b = S;\n              h = b.uniformsNames, v = b.uniformBuffersNames, E = b.samplers, g = b.defines, l = b.maxSimultaneousLights || 0;\n            } else\n              h = S, E || (E = []);\n            for (var D = 0; D < l && g[\"LIGHT\" + D]; D++)\n              this.PrepareUniformsAndSamplersForLight(D, h, E, g[\"PROJECTEDLIGHTTEXTURE\" + D], v);\n            g.NUM_MORPH_INFLUENCERS && h.push(\"morphTargetInfluences\");\n          }, T.HandleFallbacksForShadows = function(S, E, g, l) {\n            g === void 0 && (g = 4), l === void 0 && (l = 0);\n            for (var h = 0, v = 0; v < g && S[\"LIGHT\" + v]; v++)\n              v > 0 && (h = l + v, E.addFallback(h, \"LIGHT\" + v)), S.SHADOWS || (S[\"SHADOW\" + v] && E.addFallback(l, \"SHADOW\" + v), S[\"SHADOWPCF\" + v] && E.addFallback(l, \"SHADOWPCF\" + v), S[\"SHADOWPCSS\" + v] && E.addFallback(l, \"SHADOWPCSS\" + v), S[\"SHADOWPOISSON\" + v] && E.addFallback(l, \"SHADOWPOISSON\" + v), S[\"SHADOWESM\" + v] && E.addFallback(l, \"SHADOWESM\" + v), S[\"SHADOWCLOSEESM\" + v] && E.addFallback(l, \"SHADOWCLOSEESM\" + v));\n            return h++;\n          }, T.PrepareAttributesForMorphTargetsInfluencers = function(S, E, g) {\n            this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS = g, this.PrepareAttributesForMorphTargets(S, E, this._TmpMorphInfluencers);\n          }, T.PrepareAttributesForMorphTargets = function(S, E, g) {\n            var l = g.NUM_MORPH_INFLUENCERS;\n            if (l > 0 && C.a.LastCreatedEngine)\n              for (var h = C.a.LastCreatedEngine.getCaps().maxVertexAttribs, v = E.morphTargetManager, b = v && v.supportsNormals && g.NORMAL, D = v && v.supportsTangents && g.TANGENT, w = v && v.supportsUVs && g.UV1, N = 0; N < l; N++)\n                S.push(u.b.PositionKind + N), b && S.push(u.b.NormalKind + N), D && S.push(u.b.TangentKind + N), w && S.push(u.b.UVKind + \"_\" + N), S.length > h && V.a.Error(\"Cannot add more vertex attributes for mesh \" + E.name);\n          }, T.PrepareAttributesForBones = function(S, E, g, l) {\n            g.NUM_BONE_INFLUENCERS > 0 && (l.addCPUSkinningFallback(0, E), S.push(u.b.MatricesIndicesKind), S.push(u.b.MatricesWeightsKind), g.NUM_BONE_INFLUENCERS > 4 && (S.push(u.b.MatricesIndicesExtraKind), S.push(u.b.MatricesWeightsExtraKind)));\n          }, T.PrepareAttributesForInstances = function(S, E) {\n            (E.INSTANCES || E.THIN_INSTANCES) && this.PushAttributesForInstances(S);\n          }, T.PushAttributesForInstances = function(S) {\n            S.push(\"world0\"), S.push(\"world1\"), S.push(\"world2\"), S.push(\"world3\");\n          }, T.BindLightProperties = function(S, E, g) {\n            S.transferToEffect(E, g + \"\");\n          }, T.BindLight = function(S, E, g, l, h, v) {\n            v === void 0 && (v = !1), S._bindLight(E, g, l, h, v);\n          }, T.BindLights = function(S, E, g, l, h, v) {\n            h === void 0 && (h = 4), v === void 0 && (v = !1);\n            for (var b = Math.min(E.lightSources.length, h), D = 0; D < b; D++) {\n              var w = E.lightSources[D];\n              this.BindLight(w, D, S, g, typeof l == \"boolean\" ? l : l.SPECULARTERM, v);\n            }\n          }, T.BindFogParameters = function(S, E, g, l) {\n            l === void 0 && (l = !1), S.fogEnabled && E.applyFog && S.fogMode !== _.a.FOGMODE_NONE && (g.setFloat4(\"vFogInfos\", S.fogMode, S.fogStart, S.fogEnd, S.fogDensity), l ? (S.fogColor.toLinearSpaceToRef(this._tempFogColor), g.setColor3(\"vFogColor\", this._tempFogColor)) : g.setColor3(\"vFogColor\", S.fogColor));\n          }, T.BindBonesParameters = function(S, E, g) {\n            if (E && S && (S.computeBonesUsingShaders && E._bonesComputationForcedToCPU && (S.computeBonesUsingShaders = !1), S.useBones && S.computeBonesUsingShaders && S.skeleton)) {\n              var l = S.skeleton;\n              if (l.isUsingTextureForMatrices && E.getUniformIndex(\"boneTextureWidth\") > -1) {\n                var h = l.getTransformMatrixTexture(S);\n                E.setTexture(\"boneSampler\", h), E.setFloat(\"boneTextureWidth\", 4 * (l.bones.length + 1));\n              } else {\n                var v = l.getTransformMatrices(S);\n                v && (E.setMatrices(\"mBones\", v), g && S.getScene().prePassRenderer && S.getScene().prePassRenderer.getIndex(O.a.PREPASS_VELOCITY_TEXTURE_TYPE) && (g.previousBones[S.uniqueId] && E.setMatrices(\"mPreviousBones\", g.previousBones[S.uniqueId]), T._CopyBonesTransformationMatrices(v, g.previousBones[S.uniqueId])));\n              }\n            }\n          }, T._CopyBonesTransformationMatrices = function(S, E) {\n            return E.set(S), E;\n          }, T.BindMorphTargetParameters = function(S, E) {\n            var g = S.morphTargetManager;\n            S && g && E.setFloatArray(\"morphTargetInfluences\", g.influences);\n          }, T.BindLogDepth = function(S, E, g) {\n            S.LOGARITHMICDEPTH && E.setFloat(\"logarithmicDepthConstant\", 2 / (Math.log(g.activeCamera.maxZ + 1) / Math.LN2));\n          }, T.BindClipPlane = function(S, E) {\n            m.a.BindClipPlane(S, E);\n          }, T._TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 }, T._tempFogColor = x.a.Black(), T;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(0), _ = f(4), C = f(21), u = f(9), I = f(8), O = function() {\n          function x() {\n          }\n          return x.prototype.set = function(m, c) {\n            switch (m.length || I.a.Warn(\"Setting vertex data kind '\" + c + \"' with an empty array\"), c) {\n              case _.b.PositionKind:\n                this.positions = m;\n                break;\n              case _.b.NormalKind:\n                this.normals = m;\n                break;\n              case _.b.TangentKind:\n                this.tangents = m;\n                break;\n              case _.b.UVKind:\n                this.uvs = m;\n                break;\n              case _.b.UV2Kind:\n                this.uvs2 = m;\n                break;\n              case _.b.UV3Kind:\n                this.uvs3 = m;\n                break;\n              case _.b.UV4Kind:\n                this.uvs4 = m;\n                break;\n              case _.b.UV5Kind:\n                this.uvs5 = m;\n                break;\n              case _.b.UV6Kind:\n                this.uvs6 = m;\n                break;\n              case _.b.ColorKind:\n                this.colors = m;\n                break;\n              case _.b.MatricesIndicesKind:\n                this.matricesIndices = m;\n                break;\n              case _.b.MatricesWeightsKind:\n                this.matricesWeights = m;\n                break;\n              case _.b.MatricesIndicesExtraKind:\n                this.matricesIndicesExtra = m;\n                break;\n              case _.b.MatricesWeightsExtraKind:\n                this.matricesWeightsExtra = m;\n            }\n          }, x.prototype.applyToMesh = function(m, c) {\n            return this._applyTo(m, c), this;\n          }, x.prototype.applyToGeometry = function(m, c) {\n            return this._applyTo(m, c), this;\n          }, x.prototype.updateMesh = function(m) {\n            return this._update(m), this;\n          }, x.prototype.updateGeometry = function(m) {\n            return this._update(m), this;\n          }, x.prototype._applyTo = function(m, c) {\n            return c === void 0 && (c = !1), this.positions && m.setVerticesData(_.b.PositionKind, this.positions, c), this.normals && m.setVerticesData(_.b.NormalKind, this.normals, c), this.tangents && m.setVerticesData(_.b.TangentKind, this.tangents, c), this.uvs && m.setVerticesData(_.b.UVKind, this.uvs, c), this.uvs2 && m.setVerticesData(_.b.UV2Kind, this.uvs2, c), this.uvs3 && m.setVerticesData(_.b.UV3Kind, this.uvs3, c), this.uvs4 && m.setVerticesData(_.b.UV4Kind, this.uvs4, c), this.uvs5 && m.setVerticesData(_.b.UV5Kind, this.uvs5, c), this.uvs6 && m.setVerticesData(_.b.UV6Kind, this.uvs6, c), this.colors && m.setVerticesData(_.b.ColorKind, this.colors, c), this.matricesIndices && m.setVerticesData(_.b.MatricesIndicesKind, this.matricesIndices, c), this.matricesWeights && m.setVerticesData(_.b.MatricesWeightsKind, this.matricesWeights, c), this.matricesIndicesExtra && m.setVerticesData(_.b.MatricesIndicesExtraKind, this.matricesIndicesExtra, c), this.matricesWeightsExtra && m.setVerticesData(_.b.MatricesWeightsExtraKind, this.matricesWeightsExtra, c), this.indices ? m.setIndices(this.indices, null, c) : m.setIndices([], null), this;\n          }, x.prototype._update = function(m, c, T) {\n            return this.positions && m.updateVerticesData(_.b.PositionKind, this.positions, c, T), this.normals && m.updateVerticesData(_.b.NormalKind, this.normals, c, T), this.tangents && m.updateVerticesData(_.b.TangentKind, this.tangents, c, T), this.uvs && m.updateVerticesData(_.b.UVKind, this.uvs, c, T), this.uvs2 && m.updateVerticesData(_.b.UV2Kind, this.uvs2, c, T), this.uvs3 && m.updateVerticesData(_.b.UV3Kind, this.uvs3, c, T), this.uvs4 && m.updateVerticesData(_.b.UV4Kind, this.uvs4, c, T), this.uvs5 && m.updateVerticesData(_.b.UV5Kind, this.uvs5, c, T), this.uvs6 && m.updateVerticesData(_.b.UV6Kind, this.uvs6, c, T), this.colors && m.updateVerticesData(_.b.ColorKind, this.colors, c, T), this.matricesIndices && m.updateVerticesData(_.b.MatricesIndicesKind, this.matricesIndices, c, T), this.matricesWeights && m.updateVerticesData(_.b.MatricesWeightsKind, this.matricesWeights, c, T), this.matricesIndicesExtra && m.updateVerticesData(_.b.MatricesIndicesExtraKind, this.matricesIndicesExtra, c, T), this.matricesWeightsExtra && m.updateVerticesData(_.b.MatricesWeightsExtraKind, this.matricesWeightsExtra, c, T), this.indices && m.setIndices(this.indices, null), this;\n          }, x.prototype.transform = function(m) {\n            var c, T = m.determinant() < 0, S = V.e.Zero();\n            if (this.positions) {\n              var E = V.e.Zero();\n              for (c = 0; c < this.positions.length; c += 3)\n                V.e.FromArrayToRef(this.positions, c, E), V.e.TransformCoordinatesToRef(E, m, S), this.positions[c] = S.x, this.positions[c + 1] = S.y, this.positions[c + 2] = S.z;\n            }\n            if (this.normals) {\n              var g = V.e.Zero();\n              for (c = 0; c < this.normals.length; c += 3)\n                V.e.FromArrayToRef(this.normals, c, g), V.e.TransformNormalToRef(g, m, S), this.normals[c] = S.x, this.normals[c + 1] = S.y, this.normals[c + 2] = S.z;\n            }\n            if (this.tangents) {\n              var l = V.f.Zero(), h = V.f.Zero();\n              for (c = 0; c < this.tangents.length; c += 4)\n                V.f.FromArrayToRef(this.tangents, c, l), V.f.TransformNormalToRef(l, m, h), this.tangents[c] = h.x, this.tangents[c + 1] = h.y, this.tangents[c + 2] = h.z, this.tangents[c + 3] = h.w;\n            }\n            if (T && this.indices)\n              for (c = 0; c < this.indices.length; c += 3) {\n                var v = this.indices[c + 1];\n                this.indices[c + 1] = this.indices[c + 2], this.indices[c + 2] = v;\n              }\n            return this;\n          }, x.prototype.merge = function(m, c) {\n            if (c === void 0 && (c = !1), this._validate(), m._validate(), !this.normals != !m.normals || !this.tangents != !m.tangents || !this.uvs != !m.uvs || !this.uvs2 != !m.uvs2 || !this.uvs3 != !m.uvs3 || !this.uvs4 != !m.uvs4 || !this.uvs5 != !m.uvs5 || !this.uvs6 != !m.uvs6 || !this.colors != !m.colors || !this.matricesIndices != !m.matricesIndices || !this.matricesWeights != !m.matricesWeights || !this.matricesIndicesExtra != !m.matricesIndicesExtra || !this.matricesWeightsExtra != !m.matricesWeightsExtra)\n              throw new Error(\"Cannot merge vertex data that do not have the same set of attributes\");\n            if (m.indices) {\n              this.indices || (this.indices = []);\n              var T = this.positions ? this.positions.length / 3 : 0;\n              if (this.indices.BYTES_PER_ELEMENT !== void 0) {\n                var S = this.indices.length + m.indices.length, E = c || this.indices instanceof Uint32Array ? new Uint32Array(S) : new Uint16Array(S);\n                E.set(this.indices);\n                for (var g = this.indices.length, l = 0; l < m.indices.length; l++)\n                  E[g + l] = m.indices[l] + T;\n                this.indices = E;\n              } else\n                for (l = 0; l < m.indices.length; l++)\n                  this.indices.push(m.indices[l] + T);\n            }\n            return this.positions = this._mergeElement(this.positions, m.positions), this.normals = this._mergeElement(this.normals, m.normals), this.tangents = this._mergeElement(this.tangents, m.tangents), this.uvs = this._mergeElement(this.uvs, m.uvs), this.uvs2 = this._mergeElement(this.uvs2, m.uvs2), this.uvs3 = this._mergeElement(this.uvs3, m.uvs3), this.uvs4 = this._mergeElement(this.uvs4, m.uvs4), this.uvs5 = this._mergeElement(this.uvs5, m.uvs5), this.uvs6 = this._mergeElement(this.uvs6, m.uvs6), this.colors = this._mergeElement(this.colors, m.colors), this.matricesIndices = this._mergeElement(this.matricesIndices, m.matricesIndices), this.matricesWeights = this._mergeElement(this.matricesWeights, m.matricesWeights), this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, m.matricesIndicesExtra), this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, m.matricesWeightsExtra), this;\n          }, x.prototype._mergeElement = function(m, c) {\n            if (!m)\n              return c;\n            if (!c)\n              return m;\n            var T = c.length + m.length, S = m instanceof Float32Array, E = c instanceof Float32Array;\n            if (S) {\n              var g = new Float32Array(T);\n              return g.set(m), g.set(c, m.length), g;\n            }\n            if (E) {\n              var l = m.slice(0), h = 0;\n              for (T = c.length; h < T; h++)\n                l.push(c[h]);\n              return l;\n            }\n            return m.concat(c);\n          }, x.prototype._validate = function() {\n            if (!this.positions)\n              throw new Error(\"Positions are required\");\n            var m = function(S, E) {\n              var g = _.b.DeduceStride(S);\n              if (E.length % g != 0)\n                throw new Error(\"The \" + S + \"s array count must be a multiple of \" + g);\n              return E.length / g;\n            }, c = m(_.b.PositionKind, this.positions), T = function(S, E) {\n              var g = m(S, E);\n              if (g !== c)\n                throw new Error(\"The \" + S + \"s element count (\" + g + \") does not match the positions count (\" + c + \")\");\n            };\n            this.normals && T(_.b.NormalKind, this.normals), this.tangents && T(_.b.TangentKind, this.tangents), this.uvs && T(_.b.UVKind, this.uvs), this.uvs2 && T(_.b.UV2Kind, this.uvs2), this.uvs3 && T(_.b.UV3Kind, this.uvs3), this.uvs4 && T(_.b.UV4Kind, this.uvs4), this.uvs5 && T(_.b.UV5Kind, this.uvs5), this.uvs6 && T(_.b.UV6Kind, this.uvs6), this.colors && T(_.b.ColorKind, this.colors), this.matricesIndices && T(_.b.MatricesIndicesKind, this.matricesIndices), this.matricesWeights && T(_.b.MatricesWeightsKind, this.matricesWeights), this.matricesIndicesExtra && T(_.b.MatricesIndicesExtraKind, this.matricesIndicesExtra), this.matricesWeightsExtra && T(_.b.MatricesWeightsExtraKind, this.matricesWeightsExtra);\n          }, x.prototype.serialize = function() {\n            var m = this.serialize();\n            return this.positions && (m.positions = this.positions), this.normals && (m.normals = this.normals), this.tangents && (m.tangents = this.tangents), this.uvs && (m.uvs = this.uvs), this.uvs2 && (m.uvs2 = this.uvs2), this.uvs3 && (m.uvs3 = this.uvs3), this.uvs4 && (m.uvs4 = this.uvs4), this.uvs5 && (m.uvs5 = this.uvs5), this.uvs6 && (m.uvs6 = this.uvs6), this.colors && (m.colors = this.colors), this.matricesIndices && (m.matricesIndices = this.matricesIndices, m.matricesIndices._isExpanded = !0), this.matricesWeights && (m.matricesWeights = this.matricesWeights), this.matricesIndicesExtra && (m.matricesIndicesExtra = this.matricesIndicesExtra, m.matricesIndicesExtra._isExpanded = !0), this.matricesWeightsExtra && (m.matricesWeightsExtra = this.matricesWeightsExtra), m.indices = this.indices, m;\n          }, x.ExtractFromMesh = function(m, c, T) {\n            return x._ExtractFrom(m, c, T);\n          }, x.ExtractFromGeometry = function(m, c, T) {\n            return x._ExtractFrom(m, c, T);\n          }, x._ExtractFrom = function(m, c, T) {\n            var S = new x();\n            return m.isVerticesDataPresent(_.b.PositionKind) && (S.positions = m.getVerticesData(_.b.PositionKind, c, T)), m.isVerticesDataPresent(_.b.NormalKind) && (S.normals = m.getVerticesData(_.b.NormalKind, c, T)), m.isVerticesDataPresent(_.b.TangentKind) && (S.tangents = m.getVerticesData(_.b.TangentKind, c, T)), m.isVerticesDataPresent(_.b.UVKind) && (S.uvs = m.getVerticesData(_.b.UVKind, c, T)), m.isVerticesDataPresent(_.b.UV2Kind) && (S.uvs2 = m.getVerticesData(_.b.UV2Kind, c, T)), m.isVerticesDataPresent(_.b.UV3Kind) && (S.uvs3 = m.getVerticesData(_.b.UV3Kind, c, T)), m.isVerticesDataPresent(_.b.UV4Kind) && (S.uvs4 = m.getVerticesData(_.b.UV4Kind, c, T)), m.isVerticesDataPresent(_.b.UV5Kind) && (S.uvs5 = m.getVerticesData(_.b.UV5Kind, c, T)), m.isVerticesDataPresent(_.b.UV6Kind) && (S.uvs6 = m.getVerticesData(_.b.UV6Kind, c, T)), m.isVerticesDataPresent(_.b.ColorKind) && (S.colors = m.getVerticesData(_.b.ColorKind, c, T)), m.isVerticesDataPresent(_.b.MatricesIndicesKind) && (S.matricesIndices = m.getVerticesData(_.b.MatricesIndicesKind, c, T)), m.isVerticesDataPresent(_.b.MatricesWeightsKind) && (S.matricesWeights = m.getVerticesData(_.b.MatricesWeightsKind, c, T)), m.isVerticesDataPresent(_.b.MatricesIndicesExtraKind) && (S.matricesIndicesExtra = m.getVerticesData(_.b.MatricesIndicesExtraKind, c, T)), m.isVerticesDataPresent(_.b.MatricesWeightsExtraKind) && (S.matricesWeightsExtra = m.getVerticesData(_.b.MatricesWeightsExtraKind, c, T)), S.indices = m.getIndices(c, T), S;\n          }, x.CreateRibbon = function(m) {\n            throw C.a.WarnImport(\"ribbonBuilder\");\n          }, x.CreateBox = function(m) {\n            throw C.a.WarnImport(\"boxBuilder\");\n          }, x.CreateTiledBox = function(m) {\n            throw C.a.WarnImport(\"tiledBoxBuilder\");\n          }, x.CreateTiledPlane = function(m) {\n            throw C.a.WarnImport(\"tiledPlaneBuilder\");\n          }, x.CreateSphere = function(m) {\n            throw C.a.WarnImport(\"sphereBuilder\");\n          }, x.CreateCylinder = function(m) {\n            throw C.a.WarnImport(\"cylinderBuilder\");\n          }, x.CreateTorus = function(m) {\n            throw C.a.WarnImport(\"torusBuilder\");\n          }, x.CreateLineSystem = function(m) {\n            throw C.a.WarnImport(\"linesBuilder\");\n          }, x.CreateDashedLines = function(m) {\n            throw C.a.WarnImport(\"linesBuilder\");\n          }, x.CreateGround = function(m) {\n            throw C.a.WarnImport(\"groundBuilder\");\n          }, x.CreateTiledGround = function(m) {\n            throw C.a.WarnImport(\"groundBuilder\");\n          }, x.CreateGroundFromHeightMap = function(m) {\n            throw C.a.WarnImport(\"groundBuilder\");\n          }, x.CreatePlane = function(m) {\n            throw C.a.WarnImport(\"planeBuilder\");\n          }, x.CreateDisc = function(m) {\n            throw C.a.WarnImport(\"discBuilder\");\n          }, x.CreatePolygon = function(m, c, T, S, E, g, l) {\n            throw C.a.WarnImport(\"polygonBuilder\");\n          }, x.CreateIcoSphere = function(m) {\n            throw C.a.WarnImport(\"icoSphereBuilder\");\n          }, x.CreatePolyhedron = function(m) {\n            throw C.a.WarnImport(\"polyhedronBuilder\");\n          }, x.CreateCapsule = function(m) {\n            throw m === void 0 && (m = { orientation: V.e.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 }), C.a.WarnImport(\"capsuleBuilder\");\n          }, x.CreateTorusKnot = function(m) {\n            throw C.a.WarnImport(\"torusKnotBuilder\");\n          }, x.ComputeNormals = function(m, c, T, S) {\n            var E = 0, g = 0, l = 0, h = 0, v = 0, b = 0, D = 0, w = 0, N = 0, M = 0, U = 0, X = 0, j = 0, ne = 0, te = 0, de = 0, pe = 0, ae = 0, ee = 0, K = 0, $ = !1, L = !1, G = !1, Q = !1, oe = 1, re = 0, Y = null;\n            if (S && ($ = !!S.facetNormals, L = !!S.facetPositions, G = !!S.facetPartitioning, oe = S.useRightHandedSystem === !0 ? -1 : 1, re = S.ratio || 0, Q = !!S.depthSort, Y = S.distanceTo, Q)) {\n              Y === void 0 && (Y = V.e.Zero());\n              var k = S.depthSortedFacets;\n            }\n            var H = 0, Z = 0, W = 0, q = 0;\n            if (G && S && S.bbSize) {\n              var he = 0, ge = 0, me = 0, _e = 0, ye = 0, Pe = 0, be = 0, Fe = 0, ke = 0, We = 0, je = 0, He = 0, Qe = 0, Ge = 0, tt = 0, Je = 0, st = S.bbSize.x > S.bbSize.y ? S.bbSize.x : S.bbSize.y;\n              st = st > S.bbSize.z ? st : S.bbSize.z, H = S.subDiv.X * re / S.bbSize.x, Z = S.subDiv.Y * re / S.bbSize.y, W = S.subDiv.Z * re / S.bbSize.z, q = S.subDiv.max * S.subDiv.max, S.facetPartitioning.length = 0;\n            }\n            for (E = 0; E < m.length; E++)\n              T[E] = 0;\n            var at = c.length / 3 | 0;\n            for (E = 0; E < at; E++) {\n              if (j = (X = 3 * c[3 * E]) + 1, ne = X + 2, de = (te = 3 * c[3 * E + 1]) + 1, pe = te + 2, ee = (ae = 3 * c[3 * E + 2]) + 1, K = ae + 2, g = m[X] - m[te], l = m[j] - m[de], h = m[ne] - m[pe], v = m[ae] - m[te], b = m[ee] - m[de], w = oe * (l * (D = m[K] - m[pe]) - h * b), N = oe * (h * v - g * D), M = oe * (g * b - l * v), w /= U = (U = Math.sqrt(w * w + N * N + M * M)) === 0 ? 1 : U, N /= U, M /= U, $ && S && (S.facetNormals[E].x = w, S.facetNormals[E].y = N, S.facetNormals[E].z = M), L && S && (S.facetPositions[E].x = (m[X] + m[te] + m[ae]) / 3, S.facetPositions[E].y = (m[j] + m[de] + m[ee]) / 3, S.facetPositions[E].z = (m[ne] + m[pe] + m[K]) / 3), G && S && (he = Math.floor((S.facetPositions[E].x - S.bInfo.minimum.x * re) * H), ge = Math.floor((S.facetPositions[E].y - S.bInfo.minimum.y * re) * Z), me = Math.floor((S.facetPositions[E].z - S.bInfo.minimum.z * re) * W), _e = Math.floor((m[X] - S.bInfo.minimum.x * re) * H), ye = Math.floor((m[j] - S.bInfo.minimum.y * re) * Z), Pe = Math.floor((m[ne] - S.bInfo.minimum.z * re) * W), be = Math.floor((m[te] - S.bInfo.minimum.x * re) * H), Fe = Math.floor((m[de] - S.bInfo.minimum.y * re) * Z), ke = Math.floor((m[pe] - S.bInfo.minimum.z * re) * W), We = Math.floor((m[ae] - S.bInfo.minimum.x * re) * H), je = Math.floor((m[ee] - S.bInfo.minimum.y * re) * Z), He = Math.floor((m[K] - S.bInfo.minimum.z * re) * W), Ge = _e + S.subDiv.max * ye + q * Pe, tt = be + S.subDiv.max * Fe + q * ke, Je = We + S.subDiv.max * je + q * He, Qe = he + S.subDiv.max * ge + q * me, S.facetPartitioning[Qe] = S.facetPartitioning[Qe] ? S.facetPartitioning[Qe] : new Array(), S.facetPartitioning[Ge] = S.facetPartitioning[Ge] ? S.facetPartitioning[Ge] : new Array(), S.facetPartitioning[tt] = S.facetPartitioning[tt] ? S.facetPartitioning[tt] : new Array(), S.facetPartitioning[Je] = S.facetPartitioning[Je] ? S.facetPartitioning[Je] : new Array(), S.facetPartitioning[Ge].push(E), tt != Ge && S.facetPartitioning[tt].push(E), Je != tt && Je != Ge && S.facetPartitioning[Je].push(E), Qe != Ge && Qe != tt && Qe != Je && S.facetPartitioning[Qe].push(E)), Q && S && S.facetPositions) {\n                var pt = k[E];\n                pt.ind = 3 * E, pt.sqDistance = V.e.DistanceSquared(S.facetPositions[E], Y);\n              }\n              T[X] += w, T[j] += N, T[ne] += M, T[te] += w, T[de] += N, T[pe] += M, T[ae] += w, T[ee] += N, T[K] += M;\n            }\n            for (E = 0; E < T.length / 3; E++)\n              w = T[3 * E], N = T[3 * E + 1], M = T[3 * E + 2], w /= U = (U = Math.sqrt(w * w + N * N + M * M)) === 0 ? 1 : U, N /= U, M /= U, T[3 * E] = w, T[3 * E + 1] = N, T[3 * E + 2] = M;\n          }, x._ComputeSides = function(m, c, T, S, E, g, l) {\n            var h, v, b = T.length, D = S.length;\n            switch (m = m || x.DEFAULTSIDE) {\n              case x.FRONTSIDE:\n                break;\n              case x.BACKSIDE:\n                var w;\n                for (h = 0; h < b; h += 3)\n                  w = T[h], T[h] = T[h + 2], T[h + 2] = w;\n                for (v = 0; v < D; v++)\n                  S[v] = -S[v];\n                break;\n              case x.DOUBLESIDE:\n                for (var N = c.length, M = N / 3, U = 0; U < N; U++)\n                  c[N + U] = c[U];\n                for (h = 0; h < b; h += 3)\n                  T[h + b] = T[h + 2] + M, T[h + 1 + b] = T[h + 1] + M, T[h + 2 + b] = T[h] + M;\n                for (v = 0; v < D; v++)\n                  S[D + v] = -S[v];\n                var X = E.length, j = 0;\n                for (j = 0; j < X; j++)\n                  E[j + X] = E[j];\n                for (g = g || new V.f(0, 0, 1, 1), l = l || new V.f(0, 0, 1, 1), j = 0, h = 0; h < X / 2; h++)\n                  E[j] = g.x + (g.z - g.x) * E[j], E[j + 1] = g.y + (g.w - g.y) * E[j + 1], E[j + X] = l.x + (l.z - l.x) * E[j + X], E[j + X + 1] = l.y + (l.w - l.y) * E[j + X + 1], j += 2;\n            }\n          }, x.ImportVertexData = function(m, c) {\n            var T = new x(), S = m.positions;\n            S && T.set(S, _.b.PositionKind);\n            var E = m.normals;\n            E && T.set(E, _.b.NormalKind);\n            var g = m.tangents;\n            g && T.set(g, _.b.TangentKind);\n            var l = m.uvs;\n            l && T.set(l, _.b.UVKind);\n            var h = m.uv2s;\n            h && T.set(h, _.b.UV2Kind);\n            var v = m.uv3s;\n            v && T.set(v, _.b.UV3Kind);\n            var b = m.uv4s;\n            b && T.set(b, _.b.UV4Kind);\n            var D = m.uv5s;\n            D && T.set(D, _.b.UV5Kind);\n            var w = m.uv6s;\n            w && T.set(w, _.b.UV6Kind);\n            var N = m.colors;\n            N && T.set(u.b.CheckColors4(N, S.length / 3), _.b.ColorKind);\n            var M = m.matricesIndices;\n            M && T.set(M, _.b.MatricesIndicesKind);\n            var U = m.matricesWeights;\n            U && T.set(U, _.b.MatricesWeightsKind);\n            var X = m.indices;\n            X && (T.indices = X), c.setAllVerticesData(T, m.updatable);\n          }, x.FRONTSIDE = 0, x.BACKSIDE = 1, x.DOUBLESIDE = 2, x.DEFAULTSIDE = 0, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(1), _ = function() {\n          function u() {\n          }\n          return u.NAME_EFFECTLAYER = \"EffectLayer\", u.NAME_LAYER = \"Layer\", u.NAME_LENSFLARESYSTEM = \"LensFlareSystem\", u.NAME_BOUNDINGBOXRENDERER = \"BoundingBoxRenderer\", u.NAME_PARTICLESYSTEM = \"ParticleSystem\", u.NAME_GAMEPAD = \"Gamepad\", u.NAME_SIMPLIFICATIONQUEUE = \"SimplificationQueue\", u.NAME_GEOMETRYBUFFERRENDERER = \"GeometryBufferRenderer\", u.NAME_PREPASSRENDERER = \"PrePassRenderer\", u.NAME_DEPTHRENDERER = \"DepthRenderer\", u.NAME_POSTPROCESSRENDERPIPELINEMANAGER = \"PostProcessRenderPipelineManager\", u.NAME_SPRITE = \"Sprite\", u.NAME_SUBSURFACE = \"SubSurface\", u.NAME_OUTLINERENDERER = \"Outline\", u.NAME_PROCEDURALTEXTURE = \"ProceduralTexture\", u.NAME_SHADOWGENERATOR = \"ShadowGenerator\", u.NAME_OCTREE = \"Octree\", u.NAME_PHYSICSENGINE = \"PhysicsEngine\", u.NAME_AUDIO = \"Audio\", u.STEP_ISREADYFORMESH_EFFECTLAYER = 0, u.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0, u.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0, u.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0, u.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1, u.STEP_BEFORECAMERADRAW_EFFECTLAYER = 0, u.STEP_BEFORECAMERADRAW_LAYER = 1, u.STEP_BEFORECAMERADRAW_PREPASS = 2, u.STEP_BEFORERENDERTARGETDRAW_LAYER = 0, u.STEP_BEFORERENDERINGMESH_PREPASS = 0, u.STEP_BEFORERENDERINGMESH_OUTLINE = 1, u.STEP_AFTERRENDERINGMESH_PREPASS = 0, u.STEP_AFTERRENDERINGMESH_OUTLINE = 1, u.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0, u.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1, u.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0, u.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1, u.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0, u.STEP_AFTERRENDERTARGETDRAW_LAYER = 0, u.STEP_AFTERCAMERADRAW_EFFECTLAYER = 0, u.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 1, u.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 2, u.STEP_AFTERCAMERADRAW_LAYER = 3, u.STEP_AFTERCAMERADRAW_PREPASS = 4, u.STEP_AFTERRENDER_AUDIO = 0, u.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0, u.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1, u.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2, u.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3, u.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0, u.STEP_BEFORECLEARSTAGE_PREPASS = 0, u.STEP_POINTERMOVE_SPRITE = 0, u.STEP_POINTERDOWN_SPRITE = 0, u.STEP_POINTERUP_SPRITE = 0, u;\n        }(), C = function(u) {\n          function I(O) {\n            return u.apply(this, O) || this;\n          }\n          return Object(V.d)(I, u), I.Create = function() {\n            return Object.create(I.prototype);\n          }, I.prototype.registerStep = function(O, x, m) {\n            var c = 0;\n            for (Number.MAX_VALUE; c < this.length && !(O < this[c].index); c++)\n              ;\n            this.splice(c, 0, { index: O, component: x, action: m.bind(x) });\n          }, I.prototype.clear = function() {\n            this.length = 0;\n          }, I;\n        }(Array);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        }), f.d(A, \"d\", function() {\n          return I;\n        }), f.d(A, \"b\", function() {\n          return O;\n        });\n        var V = f(1), _ = f(0), C = function() {\n          function x() {\n          }\n          return x.POINTERDOWN = 1, x.POINTERUP = 2, x.POINTERMOVE = 4, x.POINTERWHEEL = 8, x.POINTERPICK = 16, x.POINTERTAP = 32, x.POINTERDOUBLETAP = 64, x;\n        }(), u = function(x, m) {\n          this.type = x, this.event = m;\n        }, I = function(x) {\n          function m(c, T, S, E) {\n            var g = x.call(this, c, T) || this;\n            return g.ray = null, g.skipOnPointerObservable = !1, g.localPosition = new _.d(S, E), g;\n          }\n          return Object(V.d)(m, x), m;\n        }(u), O = function(x) {\n          function m(c, T, S) {\n            var E = x.call(this, c, T) || this;\n            return E.pickInfo = S, E;\n          }\n          return Object(V.d)(m, x), m;\n        }(u);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(13), _ = f(2), C = function() {\n          function u() {\n          }\n          return Object.defineProperty(u, \"DiffuseTextureEnabled\", { get: function() {\n            return this._DiffuseTextureEnabled;\n          }, set: function(I) {\n            this._DiffuseTextureEnabled !== I && (this._DiffuseTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"DetailTextureEnabled\", { get: function() {\n            return this._DetailTextureEnabled;\n          }, set: function(I) {\n            this._DetailTextureEnabled !== I && (this._DetailTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"AmbientTextureEnabled\", { get: function() {\n            return this._AmbientTextureEnabled;\n          }, set: function(I) {\n            this._AmbientTextureEnabled !== I && (this._AmbientTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"OpacityTextureEnabled\", { get: function() {\n            return this._OpacityTextureEnabled;\n          }, set: function(I) {\n            this._OpacityTextureEnabled !== I && (this._OpacityTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ReflectionTextureEnabled\", { get: function() {\n            return this._ReflectionTextureEnabled;\n          }, set: function(I) {\n            this._ReflectionTextureEnabled !== I && (this._ReflectionTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"EmissiveTextureEnabled\", { get: function() {\n            return this._EmissiveTextureEnabled;\n          }, set: function(I) {\n            this._EmissiveTextureEnabled !== I && (this._EmissiveTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"SpecularTextureEnabled\", { get: function() {\n            return this._SpecularTextureEnabled;\n          }, set: function(I) {\n            this._SpecularTextureEnabled !== I && (this._SpecularTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"BumpTextureEnabled\", { get: function() {\n            return this._BumpTextureEnabled;\n          }, set: function(I) {\n            this._BumpTextureEnabled !== I && (this._BumpTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"LightmapTextureEnabled\", { get: function() {\n            return this._LightmapTextureEnabled;\n          }, set: function(I) {\n            this._LightmapTextureEnabled !== I && (this._LightmapTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"RefractionTextureEnabled\", { get: function() {\n            return this._RefractionTextureEnabled;\n          }, set: function(I) {\n            this._RefractionTextureEnabled !== I && (this._RefractionTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ColorGradingTextureEnabled\", { get: function() {\n            return this._ColorGradingTextureEnabled;\n          }, set: function(I) {\n            this._ColorGradingTextureEnabled !== I && (this._ColorGradingTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"FresnelEnabled\", { get: function() {\n            return this._FresnelEnabled;\n          }, set: function(I) {\n            this._FresnelEnabled !== I && (this._FresnelEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_FresnelDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ClearCoatTextureEnabled\", { get: function() {\n            return this._ClearCoatTextureEnabled;\n          }, set: function(I) {\n            this._ClearCoatTextureEnabled !== I && (this._ClearCoatTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ClearCoatBumpTextureEnabled\", { get: function() {\n            return this._ClearCoatBumpTextureEnabled;\n          }, set: function(I) {\n            this._ClearCoatBumpTextureEnabled !== I && (this._ClearCoatBumpTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ClearCoatTintTextureEnabled\", { get: function() {\n            return this._ClearCoatTintTextureEnabled;\n          }, set: function(I) {\n            this._ClearCoatTintTextureEnabled !== I && (this._ClearCoatTintTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"SheenTextureEnabled\", { get: function() {\n            return this._SheenTextureEnabled;\n          }, set: function(I) {\n            this._SheenTextureEnabled !== I && (this._SheenTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"AnisotropicTextureEnabled\", { get: function() {\n            return this._AnisotropicTextureEnabled;\n          }, set: function(I) {\n            this._AnisotropicTextureEnabled !== I && (this._AnisotropicTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ThicknessTextureEnabled\", { get: function() {\n            return this._ThicknessTextureEnabled;\n          }, set: function(I) {\n            this._ThicknessTextureEnabled !== I && (this._ThicknessTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), u._DiffuseTextureEnabled = !0, u._DetailTextureEnabled = !0, u._AmbientTextureEnabled = !0, u._OpacityTextureEnabled = !0, u._ReflectionTextureEnabled = !0, u._EmissiveTextureEnabled = !0, u._SpecularTextureEnabled = !0, u._BumpTextureEnabled = !0, u._LightmapTextureEnabled = !0, u._RefractionTextureEnabled = !0, u._ColorGradingTextureEnabled = !0, u._FresnelEnabled = !0, u._ClearCoatTextureEnabled = !0, u._ClearCoatBumpTextureEnabled = !0, u._ClearCoatTintTextureEnabled = !0, u._SheenTextureEnabled = !0, u._AnisotropicTextureEnabled = !0, u._ThicknessTextureEnabled = !0, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return oe;\n        });\n        var V = f(1), _ = f(12), C = f(57), u = f(6), I = f(33), O = f(112), x = f(37), m = f(0), c = f(46), T = f(31), S = f(24), E = f(35), g = f(42), l = f(85), h = f(48), v = f(54), b = f(47), D = f(95), w = f(96), N = f(17), M = f(2), U = f(38), X = f(8), j = f(22), ne = f(21), te = f(18), de = f(91), pe = f(66), ae = function() {\n          function re() {\n            this._singleClick = !1, this._doubleClick = !1, this._hasSwiped = !1, this._ignore = !1;\n          }\n          return Object.defineProperty(re.prototype, \"singleClick\", { get: function() {\n            return this._singleClick;\n          }, set: function(Y) {\n            this._singleClick = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"doubleClick\", { get: function() {\n            return this._doubleClick;\n          }, set: function(Y) {\n            this._doubleClick = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"hasSwiped\", { get: function() {\n            return this._hasSwiped;\n          }, set: function(Y) {\n            this._hasSwiped = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"ignore\", { get: function() {\n            return this._ignore;\n          }, set: function(Y) {\n            this._ignore = Y;\n          }, enumerable: !1, configurable: !0 }), re;\n        }(), ee = function() {\n          function re(Y) {\n            this._alreadyAttached = !1, this._wheelEventName = \"\", this._meshPickProceed = !1, this._currentPickResult = null, this._previousPickResult = null, this._totalPointersPressed = 0, this._doubleClickOccured = !1, this._pointerX = 0, this._pointerY = 0, this._startingPointerPosition = new m.d(0, 0), this._previousStartingPointerPosition = new m.d(0, 0), this._startingPointerTime = 0, this._previousStartingPointerTime = 0, this._pointerCaptures = {}, this._meshUnderPointerId = [], this._keyboardIsAttached = !1, this._scene = Y;\n          }\n          return Object.defineProperty(re.prototype, \"meshUnderPointer\", { get: function() {\n            return this._pointerOverMesh;\n          }, enumerable: !1, configurable: !0 }), re.prototype.getMeshUnderPointerByPointerId = function(Y) {\n            return this._meshUnderPointerId[Y];\n          }, Object.defineProperty(re.prototype, \"unTranslatedPointer\", { get: function() {\n            return new m.d(this._unTranslatedPointerX, this._unTranslatedPointerY);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"pointerX\", { get: function() {\n            return this._pointerX;\n          }, set: function(Y) {\n            this._pointerX = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"pointerY\", { get: function() {\n            return this._pointerY;\n          }, set: function(Y) {\n            this._pointerY = Y;\n          }, enumerable: !1, configurable: !0 }), re.prototype._updatePointerPosition = function(Y) {\n            var k = this._scene.getEngine().getInputElementClientRect();\n            k && (this._pointerX = Y.clientX - k.left, this._pointerY = Y.clientY - k.top, this._unTranslatedPointerX = this._pointerX, this._unTranslatedPointerY = this._pointerY);\n          }, re.prototype._processPointerMove = function(Y, k) {\n            var H = this._scene, Z = H.getEngine(), W = Z.getInputElement();\n            if (W) {\n              W.tabIndex = Z.canvasTabIndex, H.doNotHandleCursors || (W.style.cursor = H.defaultCursor);\n              var q = !!(Y && Y.hit && Y.pickedMesh);\n              q ? (H.setPointerOverMesh(Y.pickedMesh, k.pointerId), this._pointerOverMesh && this._pointerOverMesh.actionManager && this._pointerOverMesh.actionManager.hasPointerTriggers && (H.doNotHandleCursors || (this._pointerOverMesh.actionManager.hoverCursor ? W.style.cursor = this._pointerOverMesh.actionManager.hoverCursor : W.style.cursor = H.hoverCursor))) : H.setPointerOverMesh(null, k.pointerId);\n              for (var he = 0, ge = H._pointerMoveStage; he < ge.length; he++)\n                Y = ge[he].action(this._unTranslatedPointerX, this._unTranslatedPointerY, Y, q, W);\n              if (Y) {\n                var me = k.type === this._wheelEventName ? te.a.POINTERWHEEL : te.a.POINTERMOVE;\n                if (H.onPointerMove && H.onPointerMove(k, Y, me), H.onPointerObservable.hasObservers()) {\n                  var _e = new te.b(me, k, Y);\n                  this._setRayOnPointerInfo(_e), H.onPointerObservable.notifyObservers(_e, me);\n                }\n              }\n            }\n          }, re.prototype._setRayOnPointerInfo = function(Y) {\n            var k = this._scene;\n            Y.pickInfo && !Y.pickInfo._pickingUnavailable && (Y.pickInfo.ray || (Y.pickInfo.ray = k.createPickingRay(Y.event.offsetX, Y.event.offsetY, m.a.Identity(), k.activeCamera)));\n          }, re.prototype._checkPrePointerObservable = function(Y, k, H) {\n            var Z = this._scene, W = new te.d(H, k, this._unTranslatedPointerX, this._unTranslatedPointerY);\n            return Y && (W.ray = Y.ray), Z.onPrePointerObservable.notifyObservers(W, H), !!W.skipOnPointerObservable;\n          }, re.prototype.simulatePointerMove = function(Y, k) {\n            var H = new PointerEvent(\"pointermove\", k);\n            this._checkPrePointerObservable(Y, H, te.a.POINTERMOVE) || this._processPointerMove(Y, H);\n          }, re.prototype.simulatePointerDown = function(Y, k) {\n            var H = new PointerEvent(\"pointerdown\", k);\n            this._checkPrePointerObservable(Y, H, te.a.POINTERDOWN) || this._processPointerDown(Y, H);\n          }, re.prototype._processPointerDown = function(Y, k) {\n            var H = this, Z = this._scene;\n            if (Y && Y.hit && Y.pickedMesh) {\n              this._pickedDownMesh = Y.pickedMesh;\n              var W = Y.pickedMesh._getActionManagerForTrigger();\n              if (W) {\n                if (W.hasPickTriggers)\n                  switch (W.processTrigger(M.a.ACTION_OnPickDownTrigger, b.a.CreateNew(Y.pickedMesh, k)), k.button) {\n                    case 0:\n                      W.processTrigger(M.a.ACTION_OnLeftPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                      break;\n                    case 1:\n                      W.processTrigger(M.a.ACTION_OnCenterPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                      break;\n                    case 2:\n                      W.processTrigger(M.a.ACTION_OnRightPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                  }\n                W.hasSpecificTrigger(M.a.ACTION_OnLongPressTrigger) && window.setTimeout(function() {\n                  var _e = Z.pick(H._unTranslatedPointerX, H._unTranslatedPointerY, function(ye) {\n                    return ye.isPickable && ye.isVisible && ye.isReady() && ye.actionManager && ye.actionManager.hasSpecificTrigger(M.a.ACTION_OnLongPressTrigger) && ye == H._pickedDownMesh;\n                  }, !1, Z.cameraToUseForPointers);\n                  _e && _e.hit && _e.pickedMesh && W && H._totalPointersPressed !== 0 && Date.now() - H._startingPointerTime > re.LongPressDelay && !H._isPointerSwiping() && (H._startingPointerTime = 0, W.processTrigger(M.a.ACTION_OnLongPressTrigger, b.a.CreateNew(_e.pickedMesh, k)));\n                }, re.LongPressDelay);\n              }\n            } else\n              for (var q = 0, he = Z._pointerDownStage; q < he.length; q++)\n                Y = he[q].action(this._unTranslatedPointerX, this._unTranslatedPointerY, Y, k);\n            if (Y) {\n              var ge = te.a.POINTERDOWN;\n              if (Z.onPointerDown && Z.onPointerDown(k, Y, ge), Z.onPointerObservable.hasObservers()) {\n                var me = new te.b(ge, k, Y);\n                this._setRayOnPointerInfo(me), Z.onPointerObservable.notifyObservers(me, ge);\n              }\n            }\n          }, re.prototype._isPointerSwiping = function() {\n            return Math.abs(this._startingPointerPosition.x - this._pointerX) > re.DragMovementThreshold || Math.abs(this._startingPointerPosition.y - this._pointerY) > re.DragMovementThreshold;\n          }, re.prototype.simulatePointerUp = function(Y, k, H) {\n            var Z = new PointerEvent(\"pointerup\", k), W = new ae();\n            H ? W.doubleClick = !0 : W.singleClick = !0, this._checkPrePointerObservable(Y, Z, te.a.POINTERUP) || this._processPointerUp(Y, Z, W);\n          }, re.prototype._processPointerUp = function(Y, k, H) {\n            var Z = this._scene;\n            if (Y && Y && Y.pickedMesh) {\n              if (this._pickedUpMesh = Y.pickedMesh, this._pickedDownMesh === this._pickedUpMesh && (Z.onPointerPick && Z.onPointerPick(k, Y), H.singleClick && !H.ignore && Z.onPointerObservable.hasObservers())) {\n                var W = te.a.POINTERPICK, q = new te.b(W, k, Y);\n                this._setRayOnPointerInfo(q), Z.onPointerObservable.notifyObservers(q, W);\n              }\n              var he = Y.pickedMesh._getActionManagerForTrigger();\n              if (he && !H.ignore) {\n                he.processTrigger(M.a.ACTION_OnPickUpTrigger, b.a.CreateNew(Y.pickedMesh, k)), !H.hasSwiped && H.singleClick && he.processTrigger(M.a.ACTION_OnPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                var ge = Y.pickedMesh._getActionManagerForTrigger(M.a.ACTION_OnDoublePickTrigger);\n                H.doubleClick && ge && ge.processTrigger(M.a.ACTION_OnDoublePickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n              }\n            } else if (!H.ignore)\n              for (var me = 0, _e = Z._pointerUpStage; me < _e.length; me++)\n                Y = _e[me].action(this._unTranslatedPointerX, this._unTranslatedPointerY, Y, k);\n            if (this._pickedDownMesh && this._pickedDownMesh !== this._pickedUpMesh) {\n              var ye = this._pickedDownMesh._getActionManagerForTrigger(M.a.ACTION_OnPickOutTrigger);\n              ye && ye.processTrigger(M.a.ACTION_OnPickOutTrigger, b.a.CreateNew(this._pickedDownMesh, k));\n            }\n            var Pe = 0;\n            Z.onPointerObservable.hasObservers() && (!H.ignore && !H.hasSwiped && (H.singleClick && Z.onPointerObservable.hasSpecificMask(te.a.POINTERTAP) ? Pe = te.a.POINTERTAP : H.doubleClick && Z.onPointerObservable.hasSpecificMask(te.a.POINTERDOUBLETAP) && (Pe = te.a.POINTERDOUBLETAP), Pe) && (q = new te.b(Pe, k, Y), this._setRayOnPointerInfo(q), Z.onPointerObservable.notifyObservers(q, Pe)), H.ignore || (Pe = te.a.POINTERUP, q = new te.b(Pe, k, Y), this._setRayOnPointerInfo(q), Z.onPointerObservable.notifyObservers(q, Pe))), Z.onPointerUp && !H.ignore && Z.onPointerUp(k, Y, Pe);\n          }, re.prototype.isPointerCaptured = function(Y) {\n            return Y === void 0 && (Y = 0), this._pointerCaptures[Y];\n          }, re.prototype.attachControl = function(Y, k, H, Z) {\n            var W = this;\n            Y === void 0 && (Y = !0), k === void 0 && (k = !0), H === void 0 && (H = !0), Z === void 0 && (Z = null);\n            var q = this._scene;\n            if (Z || (Z = q.getEngine().getInputElement()), Z) {\n              this._alreadyAttached && this.detachControl(), this._alreadyAttachedTo = Z;\n              var he = q.getEngine();\n              this._initActionManager = function(ye, Pe) {\n                if (!W._meshPickProceed) {\n                  var be = q.pick(W._unTranslatedPointerX, W._unTranslatedPointerY, q.pointerDownPredicate, !1, q.cameraToUseForPointers);\n                  W._currentPickResult = be, be && (ye = be.hit && be.pickedMesh ? be.pickedMesh._getActionManagerForTrigger() : null), W._meshPickProceed = !0;\n                }\n                return ye;\n              }, this._delayedSimpleClick = function(ye, Pe, be) {\n                (Date.now() - W._previousStartingPointerTime > re.DoubleClickDelay && !W._doubleClickOccured || ye !== W._previousButtonPressed) && (W._doubleClickOccured = !1, Pe.singleClick = !0, Pe.ignore = !1, be(Pe, W._currentPickResult));\n              }, this._initClickEvent = function(ye, Pe, be, Fe) {\n                var ke = new ae();\n                W._currentPickResult = null;\n                var We = null, je = ye.hasSpecificMask(te.a.POINTERPICK) || Pe.hasSpecificMask(te.a.POINTERPICK) || ye.hasSpecificMask(te.a.POINTERTAP) || Pe.hasSpecificMask(te.a.POINTERTAP) || ye.hasSpecificMask(te.a.POINTERDOUBLETAP) || Pe.hasSpecificMask(te.a.POINTERDOUBLETAP);\n                !je && de.a && (We = W._initActionManager(We, ke)) && (je = We.hasPickTriggers);\n                var He = !1;\n                if (je) {\n                  var Qe = be.button;\n                  if (ke.hasSwiped = W._isPointerSwiping(), !ke.hasSwiped) {\n                    var Ge = !re.ExclusiveDoubleClickMode;\n                    Ge || (Ge = !ye.hasSpecificMask(te.a.POINTERDOUBLETAP) && !Pe.hasSpecificMask(te.a.POINTERDOUBLETAP)) && !de.a.HasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger) && (We = W._initActionManager(We, ke)) && (Ge = !We.hasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger)), Ge ? (Date.now() - W._previousStartingPointerTime > re.DoubleClickDelay || Qe !== W._previousButtonPressed) && (ke.singleClick = !0, Fe(ke, W._currentPickResult), He = !0) : (W._previousDelayedSimpleClickTimeout = W._delayedSimpleClickTimeout, W._delayedSimpleClickTimeout = window.setTimeout(W._delayedSimpleClick.bind(W, Qe, ke, Fe), re.DoubleClickDelay));\n                    var tt = ye.hasSpecificMask(te.a.POINTERDOUBLETAP) || Pe.hasSpecificMask(te.a.POINTERDOUBLETAP);\n                    !tt && de.a.HasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger) && (We = W._initActionManager(We, ke)) && (tt = We.hasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger)), tt && (Qe === W._previousButtonPressed && Date.now() - W._previousStartingPointerTime < re.DoubleClickDelay && !W._doubleClickOccured ? (ke.hasSwiped || W._isPointerSwiping() ? (W._doubleClickOccured = !1, W._previousStartingPointerTime = W._startingPointerTime, W._previousStartingPointerPosition.x = W._startingPointerPosition.x, W._previousStartingPointerPosition.y = W._startingPointerPosition.y, W._previousButtonPressed = Qe, re.ExclusiveDoubleClickMode ? (W._previousDelayedSimpleClickTimeout && clearTimeout(W._previousDelayedSimpleClickTimeout), W._previousDelayedSimpleClickTimeout = W._delayedSimpleClickTimeout, Fe(ke, W._previousPickResult)) : Fe(ke, W._currentPickResult)) : (W._previousStartingPointerTime = 0, W._doubleClickOccured = !0, ke.doubleClick = !0, ke.ignore = !1, re.ExclusiveDoubleClickMode && W._previousDelayedSimpleClickTimeout && clearTimeout(W._previousDelayedSimpleClickTimeout), W._previousDelayedSimpleClickTimeout = W._delayedSimpleClickTimeout, Fe(ke, W._currentPickResult)), He = !0) : (W._doubleClickOccured = !1, W._previousStartingPointerTime = W._startingPointerTime, W._previousStartingPointerPosition.x = W._startingPointerPosition.x, W._previousStartingPointerPosition.y = W._startingPointerPosition.y, W._previousButtonPressed = Qe));\n                  }\n                }\n                He || Fe(ke, W._currentPickResult);\n              }, this._onPointerMove = function(ye) {\n                if (ye.pointerId === void 0 && (ye.pointerId = 0), W._updatePointerPosition(ye), !W._checkPrePointerObservable(null, ye, ye.type === W._wheelEventName ? te.a.POINTERWHEEL : te.a.POINTERMOVE) && (q.cameraToUseForPointers || q.activeCamera)) {\n                  q.pointerMovePredicate || (q.pointerMovePredicate = function(be) {\n                    return be.isPickable && be.isVisible && be.isReady() && be.isEnabled() && (be.enablePointerMoveEvents || q.constantlyUpdateMeshUnderPointer || be._getActionManagerForTrigger() != null) && (!q.cameraToUseForPointers || (q.cameraToUseForPointers.layerMask & be.layerMask) != 0);\n                  });\n                  var Pe = q.pick(W._unTranslatedPointerX, W._unTranslatedPointerY, q.pointerMovePredicate, !1, q.cameraToUseForPointers);\n                  W._processPointerMove(Pe, ye);\n                }\n              }, this._onPointerDown = function(ye) {\n                if (W._totalPointersPressed++, W._pickedDownMesh = null, W._meshPickProceed = !1, ye.pointerId === void 0 && (ye.pointerId = 0), W._updatePointerPosition(ye), q.preventDefaultOnPointerDown && Z && (ye.preventDefault(), Z.focus()), W._startingPointerPosition.x = W._pointerX, W._startingPointerPosition.y = W._pointerY, W._startingPointerTime = Date.now(), !W._checkPrePointerObservable(null, ye, te.a.POINTERDOWN) && (q.cameraToUseForPointers || q.activeCamera)) {\n                  W._pointerCaptures[ye.pointerId] = !0, q.pointerDownPredicate || (q.pointerDownPredicate = function(be) {\n                    return be.isPickable && be.isVisible && be.isReady() && be.isEnabled() && (!q.cameraToUseForPointers || (q.cameraToUseForPointers.layerMask & be.layerMask) != 0);\n                  }), W._pickedDownMesh = null;\n                  var Pe = q.pick(W._unTranslatedPointerX, W._unTranslatedPointerY, q.pointerDownPredicate, !1, q.cameraToUseForPointers);\n                  W._processPointerDown(Pe, ye);\n                }\n              }, this._onPointerUp = function(ye) {\n                W._totalPointersPressed !== 0 && (W._totalPointersPressed--, W._pickedUpMesh = null, W._meshPickProceed = !1, ye.pointerId === void 0 && (ye.pointerId = 0), W._updatePointerPosition(ye), q.preventDefaultOnPointerUp && Z && (ye.preventDefault(), Z.focus()), W._initClickEvent(q.onPrePointerObservable, q.onPointerObservable, ye, function(Pe, be) {\n                  q.onPrePointerObservable.hasObservers() && !Pe.ignore && (!Pe.hasSwiped && (Pe.singleClick && q.onPrePointerObservable.hasSpecificMask(te.a.POINTERTAP) && W._checkPrePointerObservable(null, ye, te.a.POINTERTAP) || Pe.doubleClick && q.onPrePointerObservable.hasSpecificMask(te.a.POINTERDOUBLETAP) && W._checkPrePointerObservable(null, ye, te.a.POINTERDOUBLETAP)) || W._checkPrePointerObservable(null, ye, te.a.POINTERUP)) || W._pointerCaptures[ye.pointerId] && (W._pointerCaptures[ye.pointerId] = !1, (q.cameraToUseForPointers || q.activeCamera) && (q.pointerUpPredicate || (q.pointerUpPredicate = function(Fe) {\n                    return Fe.isPickable && Fe.isVisible && Fe.isReady() && Fe.isEnabled() && (!q.cameraToUseForPointers || (q.cameraToUseForPointers.layerMask & Fe.layerMask) != 0);\n                  }), !W._meshPickProceed && (de.a && de.a.HasTriggers || q.onPointerObservable.hasObservers()) && W._initActionManager(null, Pe), be || (be = W._currentPickResult), W._processPointerUp(be, ye, Pe), W._previousPickResult = W._currentPickResult));\n                }));\n              }, this._onKeyDown = function(ye) {\n                var Pe = pe.a.KEYDOWN;\n                if (q.onPreKeyboardObservable.hasObservers()) {\n                  var be = new pe.c(Pe, ye);\n                  if (q.onPreKeyboardObservable.notifyObservers(be, Pe), be.skipOnPointerObservable)\n                    return;\n                }\n                q.onKeyboardObservable.hasObservers() && (be = new pe.b(Pe, ye), q.onKeyboardObservable.notifyObservers(be, Pe)), q.actionManager && q.actionManager.processTrigger(M.a.ACTION_OnKeyDownTrigger, b.a.CreateNewFromScene(q, ye));\n              }, this._onKeyUp = function(ye) {\n                var Pe = pe.a.KEYUP;\n                if (q.onPreKeyboardObservable.hasObservers()) {\n                  var be = new pe.c(Pe, ye);\n                  if (q.onPreKeyboardObservable.notifyObservers(be, Pe), be.skipOnPointerObservable)\n                    return;\n                }\n                q.onKeyboardObservable.hasObservers() && (be = new pe.b(Pe, ye), q.onKeyboardObservable.notifyObservers(be, Pe)), q.actionManager && q.actionManager.processTrigger(M.a.ACTION_OnKeyUpTrigger, b.a.CreateNewFromScene(q, ye));\n              };\n              var ge = function() {\n                Z && !W._keyboardIsAttached && (Z.addEventListener(\"keydown\", W._onKeyDown, !1), Z.addEventListener(\"keyup\", W._onKeyUp, !1), W._keyboardIsAttached = !0);\n              };\n              this._onCanvasFocusObserver = he.onCanvasFocusObservable.add((document.activeElement === Z && ge(), ge)), this._onCanvasBlurObserver = he.onCanvasBlurObservable.add(function() {\n                Z && (Z.removeEventListener(\"keydown\", W._onKeyDown), Z.removeEventListener(\"keyup\", W._onKeyUp), W._keyboardIsAttached = !1);\n              }), ge();\n              var me = _.b.GetPointerPrefix(he);\n              if (H && (Z.addEventListener(me + \"move\", this._onPointerMove, !1), this._wheelEventName = \"onwheel\" in document.createElement(\"div\") ? \"wheel\" : document.onmousewheel !== void 0 ? \"mousewheel\" : \"DOMMouseScroll\", Z.addEventListener(this._wheelEventName, this._onPointerMove, !1)), k && Z.addEventListener(me + \"down\", this._onPointerDown, !1), Y) {\n                var _e = q.getEngine().getHostWindow();\n                _e && _e.addEventListener(me + \"up\", this._onPointerUp, !1);\n              }\n              this._alreadyAttached = !0;\n            }\n          }, re.prototype.detachControl = function() {\n            var Y = this._scene.getEngine(), k = _.b.GetPointerPrefix(Y);\n            this._alreadyAttachedTo && this._alreadyAttached && (this._alreadyAttachedTo.removeEventListener(k + \"move\", this._onPointerMove), this._alreadyAttachedTo.removeEventListener(this._wheelEventName, this._onPointerMove), this._alreadyAttachedTo.removeEventListener(k + \"down\", this._onPointerDown), window.removeEventListener(k + \"up\", this._onPointerUp), this._onCanvasBlurObserver && Y.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onCanvasFocusObserver && Y.onCanvasFocusObservable.remove(this._onCanvasFocusObserver), this._alreadyAttachedTo.removeEventListener(\"keydown\", this._onKeyDown), this._alreadyAttachedTo.removeEventListener(\"keyup\", this._onKeyUp), this._scene.doNotHandleCursors || (this._alreadyAttachedTo.style.cursor = this._scene.defaultCursor), this._alreadyAttached = !1);\n          }, re.prototype.setPointerOverMesh = function(Y, k) {\n            if (k === void 0 && (k = 0), k < 0 && (k = 0), this._meshUnderPointerId[k] !== Y) {\n              var H, Z = this._meshUnderPointerId[k];\n              Z && (H = Z._getActionManagerForTrigger(M.a.ACTION_OnPointerOutTrigger)) && H.processTrigger(M.a.ACTION_OnPointerOutTrigger, b.a.CreateNew(Z, void 0, { pointerId: k })), this._meshUnderPointerId[k] = Y, this._pointerOverMesh = Y, (Z = this._meshUnderPointerId[k]) && (H = Z._getActionManagerForTrigger(M.a.ACTION_OnPointerOverTrigger)) && H.processTrigger(M.a.ACTION_OnPointerOverTrigger, b.a.CreateNew(Z, void 0, { pointerId: k }));\n            }\n          }, re.prototype.getPointerOverMesh = function() {\n            return this._pointerOverMesh;\n          }, re.DragMovementThreshold = 10, re.LongPressDelay = 500, re.DoubleClickDelay = 300, re.ExclusiveDoubleClickMode = !1, re;\n        }(), K = f(55), $ = f(9), L = f(90), G = f(152), Q = f(56), oe = function(re) {\n          function Y(k, H) {\n            var Z = re.call(this) || this;\n            Z._inputManager = new ee(Z), Z.cameraToUseForPointers = null, Z._isScene = !0, Z._blockEntityCollection = !1, Z.autoClear = !0, Z.autoClearDepthAndStencil = !0, Z.clearColor = new $.b(0.2, 0.2, 0.3, 1), Z.ambientColor = new $.a(0, 0, 0), Z._environmentIntensity = 1, Z._forceWireframe = !1, Z._skipFrustumClipping = !1, Z._forcePointsCloud = !1, Z.animationsEnabled = !0, Z._animationPropertiesOverride = null, Z.useConstantAnimationDeltaTime = !1, Z.constantlyUpdateMeshUnderPointer = !1, Z.hoverCursor = \"pointer\", Z.defaultCursor = \"\", Z.doNotHandleCursors = !1, Z.preventDefaultOnPointerDown = !0, Z.preventDefaultOnPointerUp = !0, Z.metadata = null, Z.reservedDataStore = null, Z.disableOfflineSupportExceptionRules = new Array(), Z.onDisposeObservable = new u.c(), Z._onDisposeObserver = null, Z.onBeforeRenderObservable = new u.c(), Z._onBeforeRenderObserver = null, Z.onAfterRenderObservable = new u.c(), Z.onAfterRenderCameraObservable = new u.c(), Z._onAfterRenderObserver = null, Z.onBeforeAnimationsObservable = new u.c(), Z.onAfterAnimationsObservable = new u.c(), Z.onBeforeDrawPhaseObservable = new u.c(), Z.onAfterDrawPhaseObservable = new u.c(), Z.onReadyObservable = new u.c(), Z.onBeforeCameraRenderObservable = new u.c(), Z._onBeforeCameraRenderObserver = null, Z.onAfterCameraRenderObservable = new u.c(), Z._onAfterCameraRenderObserver = null, Z.onBeforeActiveMeshesEvaluationObservable = new u.c(), Z.onAfterActiveMeshesEvaluationObservable = new u.c(), Z.onBeforeParticlesRenderingObservable = new u.c(), Z.onAfterParticlesRenderingObservable = new u.c(), Z.onDataLoadedObservable = new u.c(), Z.onNewCameraAddedObservable = new u.c(), Z.onCameraRemovedObservable = new u.c(), Z.onNewLightAddedObservable = new u.c(), Z.onLightRemovedObservable = new u.c(), Z.onNewGeometryAddedObservable = new u.c(), Z.onGeometryRemovedObservable = new u.c(), Z.onNewTransformNodeAddedObservable = new u.c(), Z.onTransformNodeRemovedObservable = new u.c(), Z.onNewMeshAddedObservable = new u.c(), Z.onMeshRemovedObservable = new u.c(), Z.onNewSkeletonAddedObservable = new u.c(), Z.onSkeletonRemovedObservable = new u.c(), Z.onNewMaterialAddedObservable = new u.c(), Z.onNewMultiMaterialAddedObservable = new u.c(), Z.onMaterialRemovedObservable = new u.c(), Z.onMultiMaterialRemovedObservable = new u.c(), Z.onNewTextureAddedObservable = new u.c(), Z.onTextureRemovedObservable = new u.c(), Z.onBeforeRenderTargetsRenderObservable = new u.c(), Z.onAfterRenderTargetsRenderObservable = new u.c(), Z.onBeforeStepObservable = new u.c(), Z.onAfterStepObservable = new u.c(), Z.onActiveCameraChanged = new u.c(), Z.onBeforeRenderingGroupObservable = new u.c(), Z.onAfterRenderingGroupObservable = new u.c(), Z.onMeshImportedObservable = new u.c(), Z.onAnimationFileImportedObservable = new u.c(), Z._registeredForLateAnimationBindings = new I.b(256), Z.onPrePointerObservable = new u.c(), Z.onPointerObservable = new u.c(), Z.onPreKeyboardObservable = new u.c(), Z.onKeyboardObservable = new u.c(), Z._useRightHandedSystem = !1, Z._timeAccumulator = 0, Z._currentStepId = 0, Z._currentInternalStep = 0, Z._fogEnabled = !0, Z._fogMode = Y.FOGMODE_NONE, Z.fogColor = new $.a(0.2, 0.2, 0.3), Z.fogDensity = 0.1, Z.fogStart = 0, Z.fogEnd = 1e3, Z.prePass = !1, Z._shadowsEnabled = !0, Z._lightsEnabled = !0, Z.activeCameras = new Array(), Z._texturesEnabled = !0, Z.physicsEnabled = !0, Z.particlesEnabled = !0, Z.spritesEnabled = !0, Z._skeletonsEnabled = !0, Z.lensFlaresEnabled = !0, Z.collisionsEnabled = !0, Z.gravity = new m.e(0, -9.807, 0), Z.postProcessesEnabled = !0, Z.renderTargetsEnabled = !0, Z.dumpNextRenderTargets = !1, Z.customRenderTargets = new Array(), Z.importedMeshesFiles = new Array(), Z.probesEnabled = !0, Z._meshesForIntersections = new I.b(256), Z.proceduralTexturesEnabled = !0, Z._totalVertices = new K.a(), Z._activeIndices = new K.a(), Z._activeParticles = new K.a(), Z._activeBones = new K.a(), Z._animationTime = 0, Z.animationTimeScale = 1, Z._renderId = 0, Z._frameId = 0, Z._executeWhenReadyTimeoutId = -1, Z._intermediateRendering = !1, Z._viewUpdateFlag = -1, Z._projectionUpdateFlag = -1, Z._toBeDisposed = new Array(256), Z._activeRequests = new Array(), Z._pendingData = new Array(), Z._isDisposed = !1, Z.dispatchAllSubMeshesOfActiveMeshes = !1, Z._activeMeshes = new I.a(256), Z._processedMaterials = new I.a(256), Z._renderTargets = new I.b(256), Z._activeParticleSystems = new I.a(256), Z._activeSkeletons = new I.b(32), Z._softwareSkinnedMeshes = new I.b(32), Z._activeAnimatables = new Array(), Z._transformMatrix = m.a.Zero(), Z.requireLightSorting = !1, Z._components = [], Z._serializableComponents = [], Z._transientComponents = [], Z._beforeCameraUpdateStage = N.b.Create(), Z._beforeClearStage = N.b.Create(), Z._gatherRenderTargetsStage = N.b.Create(), Z._gatherActiveCameraRenderTargetsStage = N.b.Create(), Z._isReadyForMeshStage = N.b.Create(), Z._beforeEvaluateActiveMeshStage = N.b.Create(), Z._evaluateSubMeshStage = N.b.Create(), Z._preActiveMeshStage = N.b.Create(), Z._cameraDrawRenderTargetStage = N.b.Create(), Z._beforeCameraDrawStage = N.b.Create(), Z._beforeRenderTargetDrawStage = N.b.Create(), Z._beforeRenderingGroupDrawStage = N.b.Create(), Z._beforeRenderingMeshStage = N.b.Create(), Z._afterRenderingMeshStage = N.b.Create(), Z._afterRenderingGroupDrawStage = N.b.Create(), Z._afterCameraDrawStage = N.b.Create(), Z._afterRenderTargetDrawStage = N.b.Create(), Z._afterRenderStage = N.b.Create(), Z._pointerMoveStage = N.b.Create(), Z._pointerDownStage = N.b.Create(), Z._pointerUpStage = N.b.Create(), Z.geometriesByUniqueId = null, Z._defaultMeshCandidates = { data: [], length: 0 }, Z._defaultSubMeshCandidates = { data: [], length: 0 }, Z._preventFreeActiveMeshesAndRenderingGroups = !1, Z._activeMeshesFrozen = !1, Z._skipEvaluateActiveMeshesCompletely = !1, Z._allowPostProcessClearColor = !0, Z.getDeterministicFrameTime = function() {\n              return Z._engine.getTimeStep();\n            }, Z._blockMaterialDirtyMechanism = !1;\n            var W = Object(V.a)({ useGeometryUniqueIdsMap: !0, useMaterialMeshMap: !0, useClonedMeshMap: !0, virtual: !1 }, H);\n            return Z._engine = k || j.a.LastCreatedEngine, W.virtual || (j.a._LastCreatedScene = Z, Z._engine.scenes.push(Z)), Z._uid = null, Z._renderingManager = new w.b(Z), D.a && (Z.postProcessManager = new D.a(Z)), U.a.IsWindowObjectExist() && Z.attachControl(), Z._createUbo(), g.a && (Z._imageProcessingConfiguration = new g.a()), Z.setDefaultCandidateProviders(), W.useGeometryUniqueIdsMap && (Z.geometriesByUniqueId = {}), Z.useMaterialMeshMap = W.useMaterialMeshMap, Z.useClonedMeshMap = W.useClonedMeshMap, H && H.virtual || Z._engine.onNewSceneAddedObservable.notifyObservers(Z), Z;\n          }\n          return Object(V.d)(Y, re), Y.DefaultMaterialFactory = function(k) {\n            throw ne.a.WarnImport(\"StandardMaterial\");\n          }, Y.CollisionCoordinatorFactory = function() {\n            throw ne.a.WarnImport(\"DefaultCollisionCoordinator\");\n          }, Object.defineProperty(Y.prototype, \"environmentTexture\", { get: function() {\n            return this._environmentTexture;\n          }, set: function(k) {\n            this._environmentTexture !== k && (this._environmentTexture = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"environmentIntensity\", { get: function() {\n            return this._environmentIntensity;\n          }, set: function(k) {\n            this._environmentIntensity !== k && (this._environmentIntensity = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"forceWireframe\", { get: function() {\n            return this._forceWireframe;\n          }, set: function(k) {\n            this._forceWireframe !== k && (this._forceWireframe = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"skipFrustumClipping\", { get: function() {\n            return this._skipFrustumClipping;\n          }, set: function(k) {\n            this._skipFrustumClipping !== k && (this._skipFrustumClipping = k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"forcePointsCloud\", { get: function() {\n            return this._forcePointsCloud;\n          }, set: function(k) {\n            this._forcePointsCloud !== k && (this._forcePointsCloud = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._animationPropertiesOverride;\n          }, set: function(k) {\n            this._animationPropertiesOverride = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"onDispose\", { set: function(k) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"beforeRender\", { set: function(k) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), k && (this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(k));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"afterRender\", { set: function(k) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), k && (this._onAfterRenderObserver = this.onAfterRenderObservable.add(k));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"beforeCameraRender\", { set: function(k) {\n            this._onBeforeCameraRenderObserver && this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"afterCameraRender\", { set: function(k) {\n            this._onAfterCameraRenderObserver && this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"unTranslatedPointer\", { get: function() {\n            return this._inputManager.unTranslatedPointer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"DragMovementThreshold\", { get: function() {\n            return ee.DragMovementThreshold;\n          }, set: function(k) {\n            ee.DragMovementThreshold = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"LongPressDelay\", { get: function() {\n            return ee.LongPressDelay;\n          }, set: function(k) {\n            ee.LongPressDelay = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"DoubleClickDelay\", { get: function() {\n            return ee.DoubleClickDelay;\n          }, set: function(k) {\n            ee.DoubleClickDelay = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"ExclusiveDoubleClickMode\", { get: function() {\n            return ee.ExclusiveDoubleClickMode;\n          }, set: function(k) {\n            ee.ExclusiveDoubleClickMode = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"useRightHandedSystem\", { get: function() {\n            return this._useRightHandedSystem;\n          }, set: function(k) {\n            this._useRightHandedSystem !== k && (this._useRightHandedSystem = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Y.prototype.setStepId = function(k) {\n            this._currentStepId = k;\n          }, Y.prototype.getStepId = function() {\n            return this._currentStepId;\n          }, Y.prototype.getInternalStep = function() {\n            return this._currentInternalStep;\n          }, Object.defineProperty(Y.prototype, \"fogEnabled\", { get: function() {\n            return this._fogEnabled;\n          }, set: function(k) {\n            this._fogEnabled !== k && (this._fogEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"fogMode\", { get: function() {\n            return this._fogMode;\n          }, set: function(k) {\n            this._fogMode !== k && (this._fogMode = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"shadowsEnabled\", { get: function() {\n            return this._shadowsEnabled;\n          }, set: function(k) {\n            this._shadowsEnabled !== k && (this._shadowsEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_LightDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"lightsEnabled\", { get: function() {\n            return this._lightsEnabled;\n          }, set: function(k) {\n            this._lightsEnabled !== k && (this._lightsEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_LightDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"activeCamera\", { get: function() {\n            return this._activeCamera;\n          }, set: function(k) {\n            k !== this._activeCamera && (this._activeCamera = k, this.onActiveCameraChanged.notifyObservers(this));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"defaultMaterial\", { get: function() {\n            return this._defaultMaterial || (this._defaultMaterial = Y.DefaultMaterialFactory(this)), this._defaultMaterial;\n          }, set: function(k) {\n            this._defaultMaterial = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"texturesEnabled\", { get: function() {\n            return this._texturesEnabled;\n          }, set: function(k) {\n            this._texturesEnabled !== k && (this._texturesEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"skeletonsEnabled\", { get: function() {\n            return this._skeletonsEnabled;\n          }, set: function(k) {\n            this._skeletonsEnabled !== k && (this._skeletonsEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_AttributesDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"collisionCoordinator\", { get: function() {\n            return this._collisionCoordinator || (this._collisionCoordinator = Y.CollisionCoordinatorFactory(), this._collisionCoordinator.init(this)), this._collisionCoordinator;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"frustumPlanes\", { get: function() {\n            return this._frustumPlanes;\n          }, enumerable: !1, configurable: !0 }), Y.prototype._registerTransientComponents = function() {\n            if (this._transientComponents.length > 0) {\n              for (var k = 0, H = this._transientComponents; k < H.length; k++)\n                H[k].register();\n              this._transientComponents = [];\n            }\n          }, Y.prototype._addComponent = function(k) {\n            this._components.push(k), this._transientComponents.push(k);\n            var H = k;\n            H.addFromContainer && H.serialize && this._serializableComponents.push(H);\n          }, Y.prototype._getComponent = function(k) {\n            for (var H = 0, Z = this._components; H < Z.length; H++) {\n              var W = Z[H];\n              if (W.name === k)\n                return W;\n            }\n            return null;\n          }, Y.prototype.getClassName = function() {\n            return \"Scene\";\n          }, Y.prototype._getDefaultMeshCandidates = function() {\n            return this._defaultMeshCandidates.data = this.meshes, this._defaultMeshCandidates.length = this.meshes.length, this._defaultMeshCandidates;\n          }, Y.prototype._getDefaultSubMeshCandidates = function(k) {\n            return this._defaultSubMeshCandidates.data = k.subMeshes, this._defaultSubMeshCandidates.length = k.subMeshes.length, this._defaultSubMeshCandidates;\n          }, Y.prototype.setDefaultCandidateProviders = function() {\n            this.getActiveMeshCandidates = this._getDefaultMeshCandidates.bind(this), this.getActiveSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getIntersectingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getCollidingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this);\n          }, Object.defineProperty(Y.prototype, \"meshUnderPointer\", { get: function() {\n            return this._inputManager.meshUnderPointer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"pointerX\", { get: function() {\n            return this._inputManager.pointerX;\n          }, set: function(k) {\n            this._inputManager.pointerX = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"pointerY\", { get: function() {\n            return this._inputManager.pointerY;\n          }, set: function(k) {\n            this._inputManager.pointerY = k;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getCachedMaterial = function() {\n            return this._cachedMaterial;\n          }, Y.prototype.getCachedEffect = function() {\n            return this._cachedEffect;\n          }, Y.prototype.getCachedVisibility = function() {\n            return this._cachedVisibility;\n          }, Y.prototype.isCachedMaterialInvalid = function(k, H, Z) {\n            return Z === void 0 && (Z = 1), this._cachedEffect !== H || this._cachedMaterial !== k || this._cachedVisibility !== Z;\n          }, Y.prototype.getEngine = function() {\n            return this._engine;\n          }, Y.prototype.getTotalVertices = function() {\n            return this._totalVertices.current;\n          }, Object.defineProperty(Y.prototype, \"totalVerticesPerfCounter\", { get: function() {\n            return this._totalVertices;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveIndices = function() {\n            return this._activeIndices.current;\n          }, Object.defineProperty(Y.prototype, \"totalActiveIndicesPerfCounter\", { get: function() {\n            return this._activeIndices;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveParticles = function() {\n            return this._activeParticles.current;\n          }, Object.defineProperty(Y.prototype, \"activeParticlesPerfCounter\", { get: function() {\n            return this._activeParticles;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveBones = function() {\n            return this._activeBones.current;\n          }, Object.defineProperty(Y.prototype, \"activeBonesPerfCounter\", { get: function() {\n            return this._activeBones;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveMeshes = function() {\n            return this._activeMeshes;\n          }, Y.prototype.getAnimationRatio = function() {\n            return this._animationRatio !== void 0 ? this._animationRatio : 1;\n          }, Y.prototype.getRenderId = function() {\n            return this._renderId;\n          }, Y.prototype.getFrameId = function() {\n            return this._frameId;\n          }, Y.prototype.incrementRenderId = function() {\n            this._renderId++;\n          }, Y.prototype._createUbo = function() {\n            this._sceneUbo = new l.a(this._engine, void 0, !0), this._sceneUbo.addUniform(\"viewProjection\", 16), this._sceneUbo.addUniform(\"view\", 16);\n          }, Y.prototype.simulatePointerMove = function(k, H) {\n            return this._inputManager.simulatePointerMove(k, H), this;\n          }, Y.prototype.simulatePointerDown = function(k, H) {\n            return this._inputManager.simulatePointerDown(k, H), this;\n          }, Y.prototype.simulatePointerUp = function(k, H, Z) {\n            return this._inputManager.simulatePointerUp(k, H, Z), this;\n          }, Y.prototype.isPointerCaptured = function(k) {\n            return k === void 0 && (k = 0), this._inputManager.isPointerCaptured(k);\n          }, Y.prototype.attachControl = function(k, H, Z) {\n            k === void 0 && (k = !0), H === void 0 && (H = !0), Z === void 0 && (Z = !0), this._inputManager.attachControl(k, H, Z);\n          }, Y.prototype.detachControl = function() {\n            this._inputManager.detachControl();\n          }, Y.prototype.isReady = function() {\n            if (this._isDisposed)\n              return !1;\n            var k, H = this.getEngine();\n            if (!H.areAllEffectsReady() || this._pendingData.length > 0)\n              return !1;\n            for (k = 0; k < this.meshes.length; k++) {\n              var Z = this.meshes[k];\n              if (Z.isEnabled() && Z.subMeshes && Z.subMeshes.length !== 0) {\n                if (!Z.isReady(!0))\n                  return !1;\n                for (var W = Z.hasThinInstances || Z.getClassName() === \"InstancedMesh\" || Z.getClassName() === \"InstancedLinesMesh\" || H.getCaps().instancedArrays && Z.instances.length > 0, q = 0, he = this._isReadyForMeshStage; q < he.length; q++)\n                  if (!he[q].action(Z, W))\n                    return !1;\n              }\n            }\n            for (k = 0; k < this.geometries.length; k++)\n              if (this.geometries[k].delayLoadState === M.a.DELAYLOADSTATE_LOADING)\n                return !1;\n            if (this.activeCameras && this.activeCameras.length > 0) {\n              for (var ge = 0, me = this.activeCameras; ge < me.length; ge++)\n                if (!me[ge].isReady(!0))\n                  return !1;\n            } else if (this.activeCamera && !this.activeCamera.isReady(!0))\n              return !1;\n            for (var _e = 0, ye = this.particleSystems; _e < ye.length; _e++)\n              if (!ye[_e].isReady())\n                return !1;\n            return !0;\n          }, Y.prototype.resetCachedMaterial = function() {\n            this._cachedMaterial = null, this._cachedEffect = null, this._cachedVisibility = null;\n          }, Y.prototype.registerBeforeRender = function(k) {\n            this.onBeforeRenderObservable.add(k);\n          }, Y.prototype.unregisterBeforeRender = function(k) {\n            this.onBeforeRenderObservable.removeCallback(k);\n          }, Y.prototype.registerAfterRender = function(k) {\n            this.onAfterRenderObservable.add(k);\n          }, Y.prototype.unregisterAfterRender = function(k) {\n            this.onAfterRenderObservable.removeCallback(k);\n          }, Y.prototype._executeOnceBeforeRender = function(k) {\n            var H = this, Z = function() {\n              k(), setTimeout(function() {\n                H.unregisterBeforeRender(Z);\n              });\n            };\n            this.registerBeforeRender(Z);\n          }, Y.prototype.executeOnceBeforeRender = function(k, H) {\n            var Z = this;\n            H !== void 0 ? setTimeout(function() {\n              Z._executeOnceBeforeRender(k);\n            }, H) : this._executeOnceBeforeRender(k);\n          }, Y.prototype._addPendingData = function(k) {\n            this._pendingData.push(k);\n          }, Y.prototype._removePendingData = function(k) {\n            var H = this.isLoading, Z = this._pendingData.indexOf(k);\n            Z !== -1 && this._pendingData.splice(Z, 1), H && !this.isLoading && this.onDataLoadedObservable.notifyObservers(this);\n          }, Y.prototype.getWaitingItemsCount = function() {\n            return this._pendingData.length;\n          }, Object.defineProperty(Y.prototype, \"isLoading\", { get: function() {\n            return this._pendingData.length > 0;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.executeWhenReady = function(k) {\n            var H = this;\n            this.onReadyObservable.add(k), this._executeWhenReadyTimeoutId === -1 && (this._executeWhenReadyTimeoutId = setTimeout(function() {\n              H._checkIsReady();\n            }, 150));\n          }, Y.prototype.whenReadyAsync = function() {\n            var k = this;\n            return new Promise(function(H) {\n              k.executeWhenReady(function() {\n                H();\n              });\n            });\n          }, Y.prototype._checkIsReady = function() {\n            var k = this;\n            return this._registerTransientComponents(), this.isReady() ? (this.onReadyObservable.notifyObservers(this), this.onReadyObservable.clear(), void (this._executeWhenReadyTimeoutId = -1)) : this._isDisposed ? (this.onReadyObservable.clear(), void (this._executeWhenReadyTimeoutId = -1)) : void (this._executeWhenReadyTimeoutId = setTimeout(function() {\n              k._checkIsReady();\n            }, 150));\n          }, Object.defineProperty(Y.prototype, \"animatables\", { get: function() {\n            return this._activeAnimatables;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.resetLastAnimationTimeFrame = function() {\n            this._animationTimeLast = C.a.Now;\n          }, Y.prototype.getViewMatrix = function() {\n            return this._viewMatrix;\n          }, Y.prototype.getProjectionMatrix = function() {\n            return this._projectionMatrix;\n          }, Y.prototype.getTransformMatrix = function() {\n            return this._transformMatrix;\n          }, Y.prototype.setTransformMatrix = function(k, H, Z, W) {\n            this._viewUpdateFlag === k.updateFlag && this._projectionUpdateFlag === H.updateFlag || (this._viewUpdateFlag = k.updateFlag, this._projectionUpdateFlag = H.updateFlag, this._viewMatrix = k, this._projectionMatrix = H, this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._frustumPlanes ? L.a.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = L.a.GetPlanes(this._transformMatrix), this._multiviewSceneUbo && this._multiviewSceneUbo.useUbo ? this._updateMultiviewUbo(Z, W) : this._sceneUbo.useUbo && (this._sceneUbo.updateMatrix(\"viewProjection\", this._transformMatrix), this._sceneUbo.updateMatrix(\"view\", this._viewMatrix), this._sceneUbo.update()));\n          }, Y.prototype.getSceneUniformBuffer = function() {\n            return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo;\n          }, Y.prototype.getUniqueId = function() {\n            return G.a.UniqueId;\n          }, Y.prototype.addMesh = function(k, H) {\n            var Z = this;\n            H === void 0 && (H = !1), this._blockEntityCollection || (this.meshes.push(k), k._resyncLightSources(), k.parent || k._addToSceneRootNodes(), this.onNewMeshAddedObservable.notifyObservers(k), H && k.getChildMeshes().forEach(function(W) {\n              Z.addMesh(W);\n            }));\n          }, Y.prototype.removeMesh = function(k, H) {\n            var Z = this;\n            H === void 0 && (H = !1);\n            var W = this.meshes.indexOf(k);\n            return W !== -1 && (this.meshes[W] = this.meshes[this.meshes.length - 1], this.meshes.pop(), k.parent || k._removeFromSceneRootNodes()), this.onMeshRemovedObservable.notifyObservers(k), H && k.getChildMeshes().forEach(function(q) {\n              Z.removeMesh(q);\n            }), W;\n          }, Y.prototype.addTransformNode = function(k) {\n            this._blockEntityCollection || (k._indexInSceneTransformNodesArray = this.transformNodes.length, this.transformNodes.push(k), k.parent || k._addToSceneRootNodes(), this.onNewTransformNodeAddedObservable.notifyObservers(k));\n          }, Y.prototype.removeTransformNode = function(k) {\n            var H = k._indexInSceneTransformNodesArray;\n            if (H !== -1) {\n              if (H !== this.transformNodes.length - 1) {\n                var Z = this.transformNodes[this.transformNodes.length - 1];\n                this.transformNodes[H] = Z, Z._indexInSceneTransformNodesArray = H;\n              }\n              k._indexInSceneTransformNodesArray = -1, this.transformNodes.pop(), k.parent || k._removeFromSceneRootNodes();\n            }\n            return this.onTransformNodeRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeSkeleton = function(k) {\n            var H = this.skeletons.indexOf(k);\n            return H !== -1 && (this.skeletons.splice(H, 1), this.onSkeletonRemovedObservable.notifyObservers(k)), H;\n          }, Y.prototype.removeMorphTargetManager = function(k) {\n            var H = this.morphTargetManagers.indexOf(k);\n            return H !== -1 && this.morphTargetManagers.splice(H, 1), H;\n          }, Y.prototype.removeLight = function(k) {\n            var H = this.lights.indexOf(k);\n            if (H !== -1) {\n              for (var Z = 0, W = this.meshes; Z < W.length; Z++)\n                W[Z]._removeLightSource(k, !1);\n              this.lights.splice(H, 1), this.sortLightsByPriority(), k.parent || k._removeFromSceneRootNodes();\n            }\n            return this.onLightRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeCamera = function(k) {\n            var H = this.cameras.indexOf(k);\n            if (H !== -1 && (this.cameras.splice(H, 1), k.parent || k._removeFromSceneRootNodes()), this.activeCameras) {\n              var Z = this.activeCameras.indexOf(k);\n              Z !== -1 && this.activeCameras.splice(Z, 1);\n            }\n            return this.activeCamera === k && (this.cameras.length > 0 ? this.activeCamera = this.cameras[0] : this.activeCamera = null), this.onCameraRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeParticleSystem = function(k) {\n            var H = this.particleSystems.indexOf(k);\n            return H !== -1 && this.particleSystems.splice(H, 1), H;\n          }, Y.prototype.removeAnimation = function(k) {\n            var H = this.animations.indexOf(k);\n            return H !== -1 && this.animations.splice(H, 1), H;\n          }, Y.prototype.stopAnimation = function(k, H, Z) {\n          }, Y.prototype.removeAnimationGroup = function(k) {\n            var H = this.animationGroups.indexOf(k);\n            return H !== -1 && this.animationGroups.splice(H, 1), H;\n          }, Y.prototype.removeMultiMaterial = function(k) {\n            var H = this.multiMaterials.indexOf(k);\n            return H !== -1 && this.multiMaterials.splice(H, 1), this.onMultiMaterialRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeMaterial = function(k) {\n            var H = k._indexInSceneMaterialArray;\n            if (H !== -1 && H < this.materials.length) {\n              if (H !== this.materials.length - 1) {\n                var Z = this.materials[this.materials.length - 1];\n                this.materials[H] = Z, Z._indexInSceneMaterialArray = H;\n              }\n              k._indexInSceneMaterialArray = -1, this.materials.pop();\n            }\n            return this.onMaterialRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeActionManager = function(k) {\n            var H = this.actionManagers.indexOf(k);\n            return H !== -1 && this.actionManagers.splice(H, 1), H;\n          }, Y.prototype.removeTexture = function(k) {\n            var H = this.textures.indexOf(k);\n            return H !== -1 && this.textures.splice(H, 1), this.onTextureRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.addLight = function(k) {\n            if (!this._blockEntityCollection) {\n              this.lights.push(k), this.sortLightsByPriority(), k.parent || k._addToSceneRootNodes();\n              for (var H = 0, Z = this.meshes; H < Z.length; H++) {\n                var W = Z[H];\n                W.lightSources.indexOf(k) === -1 && (W.lightSources.push(k), W._resyncLightSources());\n              }\n              this.onNewLightAddedObservable.notifyObservers(k);\n            }\n          }, Y.prototype.sortLightsByPriority = function() {\n            this.requireLightSorting && this.lights.sort(h.a.CompareLightsPriority);\n          }, Y.prototype.addCamera = function(k) {\n            this._blockEntityCollection || (this.cameras.push(k), this.onNewCameraAddedObservable.notifyObservers(k), k.parent || k._addToSceneRootNodes());\n          }, Y.prototype.addSkeleton = function(k) {\n            this._blockEntityCollection || (this.skeletons.push(k), this.onNewSkeletonAddedObservable.notifyObservers(k));\n          }, Y.prototype.addParticleSystem = function(k) {\n            this._blockEntityCollection || this.particleSystems.push(k);\n          }, Y.prototype.addAnimation = function(k) {\n            this._blockEntityCollection || this.animations.push(k);\n          }, Y.prototype.addAnimationGroup = function(k) {\n            this._blockEntityCollection || this.animationGroups.push(k);\n          }, Y.prototype.addMultiMaterial = function(k) {\n            this._blockEntityCollection || (this.multiMaterials.push(k), this.onNewMultiMaterialAddedObservable.notifyObservers(k));\n          }, Y.prototype.addMaterial = function(k) {\n            this._blockEntityCollection || (k._indexInSceneMaterialArray = this.materials.length, this.materials.push(k), this.onNewMaterialAddedObservable.notifyObservers(k));\n          }, Y.prototype.addMorphTargetManager = function(k) {\n            this._blockEntityCollection || this.morphTargetManagers.push(k);\n          }, Y.prototype.addGeometry = function(k) {\n            this._blockEntityCollection || (this.geometriesByUniqueId && (this.geometriesByUniqueId[k.uniqueId] = this.geometries.length), this.geometries.push(k));\n          }, Y.prototype.addActionManager = function(k) {\n            this.actionManagers.push(k);\n          }, Y.prototype.addTexture = function(k) {\n            this._blockEntityCollection || (this.textures.push(k), this.onNewTextureAddedObservable.notifyObservers(k));\n          }, Y.prototype.switchActiveCamera = function(k, H) {\n            H === void 0 && (H = !0), this._engine.getInputElement() && (this.activeCamera && this.activeCamera.detachControl(), this.activeCamera = k, H && k.attachControl());\n          }, Y.prototype.setActiveCameraByID = function(k) {\n            var H = this.getCameraByID(k);\n            return H ? (this.activeCamera = H, H) : null;\n          }, Y.prototype.setActiveCameraByName = function(k) {\n            var H = this.getCameraByName(k);\n            return H ? (this.activeCamera = H, H) : null;\n          }, Y.prototype.getAnimationGroupByName = function(k) {\n            for (var H = 0; H < this.animationGroups.length; H++)\n              if (this.animationGroups[H].name === k)\n                return this.animationGroups[H];\n            return null;\n          }, Y.prototype.getMaterialByUniqueID = function(k) {\n            for (var H = 0; H < this.materials.length; H++)\n              if (this.materials[H].uniqueId === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getMaterialByID = function(k) {\n            for (var H = 0; H < this.materials.length; H++)\n              if (this.materials[H].id === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getLastMaterialByID = function(k) {\n            for (var H = this.materials.length - 1; H >= 0; H--)\n              if (this.materials[H].id === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getMaterialByName = function(k) {\n            for (var H = 0; H < this.materials.length; H++)\n              if (this.materials[H].name === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getTextureByUniqueID = function(k) {\n            for (var H = 0; H < this.textures.length; H++)\n              if (this.textures[H].uniqueId === k)\n                return this.textures[H];\n            return null;\n          }, Y.prototype.getCameraByID = function(k) {\n            for (var H = 0; H < this.cameras.length; H++)\n              if (this.cameras[H].id === k)\n                return this.cameras[H];\n            return null;\n          }, Y.prototype.getCameraByUniqueID = function(k) {\n            for (var H = 0; H < this.cameras.length; H++)\n              if (this.cameras[H].uniqueId === k)\n                return this.cameras[H];\n            return null;\n          }, Y.prototype.getCameraByName = function(k) {\n            for (var H = 0; H < this.cameras.length; H++)\n              if (this.cameras[H].name === k)\n                return this.cameras[H];\n            return null;\n          }, Y.prototype.getBoneByID = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              for (var Z = this.skeletons[H], W = 0; W < Z.bones.length; W++)\n                if (Z.bones[W].id === k)\n                  return Z.bones[W];\n            return null;\n          }, Y.prototype.getBoneByName = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              for (var Z = this.skeletons[H], W = 0; W < Z.bones.length; W++)\n                if (Z.bones[W].name === k)\n                  return Z.bones[W];\n            return null;\n          }, Y.prototype.getLightByName = function(k) {\n            for (var H = 0; H < this.lights.length; H++)\n              if (this.lights[H].name === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getLightByID = function(k) {\n            for (var H = 0; H < this.lights.length; H++)\n              if (this.lights[H].id === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getLightByUniqueID = function(k) {\n            for (var H = 0; H < this.lights.length; H++)\n              if (this.lights[H].uniqueId === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getParticleSystemByID = function(k) {\n            for (var H = 0; H < this.particleSystems.length; H++)\n              if (this.particleSystems[H].id === k)\n                return this.particleSystems[H];\n            return null;\n          }, Y.prototype.getGeometryByID = function(k) {\n            for (var H = 0; H < this.geometries.length; H++)\n              if (this.geometries[H].id === k)\n                return this.geometries[H];\n            return null;\n          }, Y.prototype._getGeometryByUniqueID = function(k) {\n            if (this.geometriesByUniqueId) {\n              var H = this.geometriesByUniqueId[k];\n              if (H !== void 0)\n                return this.geometries[H];\n            } else\n              for (var Z = 0; Z < this.geometries.length; Z++)\n                if (this.geometries[Z].uniqueId === k)\n                  return this.geometries[Z];\n            return null;\n          }, Y.prototype.pushGeometry = function(k, H) {\n            return !(!H && this._getGeometryByUniqueID(k.uniqueId)) && (this.addGeometry(k), this.onNewGeometryAddedObservable.notifyObservers(k), !0);\n          }, Y.prototype.removeGeometry = function(k) {\n            var H;\n            if (this.geometriesByUniqueId) {\n              if ((H = this.geometriesByUniqueId[k.uniqueId]) === void 0)\n                return !1;\n            } else if ((H = this.geometries.indexOf(k)) < 0)\n              return !1;\n            if (H !== this.geometries.length - 1) {\n              var Z = this.geometries[this.geometries.length - 1];\n              Z && (this.geometries[H] = Z, this.geometriesByUniqueId && (this.geometriesByUniqueId[Z.uniqueId] = H, this.geometriesByUniqueId[k.uniqueId] = void 0));\n            }\n            return this.geometries.pop(), this.onGeometryRemovedObservable.notifyObservers(k), !0;\n          }, Y.prototype.getGeometries = function() {\n            return this.geometries;\n          }, Y.prototype.getMeshByID = function(k) {\n            for (var H = 0; H < this.meshes.length; H++)\n              if (this.meshes[H].id === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getMeshesByID = function(k) {\n            return this.meshes.filter(function(H) {\n              return H.id === k;\n            });\n          }, Y.prototype.getTransformNodeByID = function(k) {\n            for (var H = 0; H < this.transformNodes.length; H++)\n              if (this.transformNodes[H].id === k)\n                return this.transformNodes[H];\n            return null;\n          }, Y.prototype.getTransformNodeByUniqueID = function(k) {\n            for (var H = 0; H < this.transformNodes.length; H++)\n              if (this.transformNodes[H].uniqueId === k)\n                return this.transformNodes[H];\n            return null;\n          }, Y.prototype.getTransformNodesByID = function(k) {\n            return this.transformNodes.filter(function(H) {\n              return H.id === k;\n            });\n          }, Y.prototype.getMeshByUniqueID = function(k) {\n            for (var H = 0; H < this.meshes.length; H++)\n              if (this.meshes[H].uniqueId === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getLastMeshByID = function(k) {\n            for (var H = this.meshes.length - 1; H >= 0; H--)\n              if (this.meshes[H].id === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getLastEntryByID = function(k) {\n            var H;\n            for (H = this.meshes.length - 1; H >= 0; H--)\n              if (this.meshes[H].id === k)\n                return this.meshes[H];\n            for (H = this.transformNodes.length - 1; H >= 0; H--)\n              if (this.transformNodes[H].id === k)\n                return this.transformNodes[H];\n            for (H = this.cameras.length - 1; H >= 0; H--)\n              if (this.cameras[H].id === k)\n                return this.cameras[H];\n            for (H = this.lights.length - 1; H >= 0; H--)\n              if (this.lights[H].id === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getNodeByID = function(k) {\n            var H = this.getMeshByID(k);\n            if (H)\n              return H;\n            var Z = this.getTransformNodeByID(k);\n            if (Z)\n              return Z;\n            var W = this.getLightByID(k);\n            if (W)\n              return W;\n            var q = this.getCameraByID(k);\n            if (q)\n              return q;\n            var he = this.getBoneByID(k);\n            return he || null;\n          }, Y.prototype.getNodeByName = function(k) {\n            var H = this.getMeshByName(k);\n            if (H)\n              return H;\n            var Z = this.getTransformNodeByName(k);\n            if (Z)\n              return Z;\n            var W = this.getLightByName(k);\n            if (W)\n              return W;\n            var q = this.getCameraByName(k);\n            if (q)\n              return q;\n            var he = this.getBoneByName(k);\n            return he || null;\n          }, Y.prototype.getMeshByName = function(k) {\n            for (var H = 0; H < this.meshes.length; H++)\n              if (this.meshes[H].name === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getTransformNodeByName = function(k) {\n            for (var H = 0; H < this.transformNodes.length; H++)\n              if (this.transformNodes[H].name === k)\n                return this.transformNodes[H];\n            return null;\n          }, Y.prototype.getLastSkeletonByID = function(k) {\n            for (var H = this.skeletons.length - 1; H >= 0; H--)\n              if (this.skeletons[H].id === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getSkeletonByUniqueId = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              if (this.skeletons[H].uniqueId === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getSkeletonById = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              if (this.skeletons[H].id === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getSkeletonByName = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              if (this.skeletons[H].name === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getMorphTargetManagerById = function(k) {\n            for (var H = 0; H < this.morphTargetManagers.length; H++)\n              if (this.morphTargetManagers[H].uniqueId === k)\n                return this.morphTargetManagers[H];\n            return null;\n          }, Y.prototype.getMorphTargetById = function(k) {\n            for (var H = 0; H < this.morphTargetManagers.length; ++H)\n              for (var Z = this.morphTargetManagers[H], W = 0; W < Z.numTargets; ++W) {\n                var q = Z.getTarget(W);\n                if (q.id === k)\n                  return q;\n              }\n            return null;\n          }, Y.prototype.getMorphTargetByName = function(k) {\n            for (var H = 0; H < this.morphTargetManagers.length; ++H)\n              for (var Z = this.morphTargetManagers[H], W = 0; W < Z.numTargets; ++W) {\n                var q = Z.getTarget(W);\n                if (q.name === k)\n                  return q;\n              }\n            return null;\n          }, Y.prototype.getPostProcessByName = function(k) {\n            for (var H = 0; H < this.postProcesses.length; ++H) {\n              var Z = this.postProcesses[H];\n              if (Z.name === k)\n                return Z;\n            }\n            return null;\n          }, Y.prototype.isActiveMesh = function(k) {\n            return this._activeMeshes.indexOf(k) !== -1;\n          }, Object.defineProperty(Y.prototype, \"uid\", { get: function() {\n            return this._uid || (this._uid = _.b.RandomId()), this._uid;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.addExternalData = function(k, H) {\n            return this._externalData || (this._externalData = new O.a()), this._externalData.add(k, H);\n          }, Y.prototype.getExternalData = function(k) {\n            return this._externalData ? this._externalData.get(k) : null;\n          }, Y.prototype.getOrAddExternalDataWithFactory = function(k, H) {\n            return this._externalData || (this._externalData = new O.a()), this._externalData.getOrAddWithFactory(k, H);\n          }, Y.prototype.removeExternalData = function(k) {\n            return this._externalData.remove(k);\n          }, Y.prototype._evaluateSubMesh = function(k, H, Z) {\n            if (Z.hasInstances || Z.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || H.alwaysSelectAsActiveMesh || H.subMeshes.length === 1 || k.isInFrustum(this._frustumPlanes)) {\n              for (var W = 0, q = this._evaluateSubMeshStage; W < q.length; W++)\n                q[W].action(H, k);\n              var he = k.getMaterial();\n              he != null && (he.hasRenderTargetTextures && he.getRenderTargetTextures != null && this._processedMaterials.indexOf(he) === -1 && (this._processedMaterials.push(he), this._renderTargets.concatWithNoDuplicate(he.getRenderTargetTextures())), this._renderingManager.dispatch(k, H, he));\n            }\n          }, Y.prototype.freeProcessedMaterials = function() {\n            this._processedMaterials.dispose();\n          }, Object.defineProperty(Y.prototype, \"blockfreeActiveMeshesAndRenderingGroups\", { get: function() {\n            return this._preventFreeActiveMeshesAndRenderingGroups;\n          }, set: function(k) {\n            this._preventFreeActiveMeshesAndRenderingGroups !== k && (k && (this.freeActiveMeshes(), this.freeRenderingGroups()), this._preventFreeActiveMeshesAndRenderingGroups = k);\n          }, enumerable: !1, configurable: !0 }), Y.prototype.freeActiveMeshes = function() {\n            if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._activeMeshes.dispose(), this.activeCamera && this.activeCamera._activeMeshes && this.activeCamera._activeMeshes.dispose(), this.activeCameras))\n              for (var k = 0; k < this.activeCameras.length; k++) {\n                var H = this.activeCameras[k];\n                H && H._activeMeshes && H._activeMeshes.dispose();\n              }\n          }, Y.prototype.freeRenderingGroups = function() {\n            if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._renderingManager && this._renderingManager.freeRenderingGroups(), this.textures))\n              for (var k = 0; k < this.textures.length; k++) {\n                var H = this.textures[k];\n                H && H.renderList && H.freeRenderingGroups();\n              }\n          }, Y.prototype._isInIntermediateRendering = function() {\n            return this._intermediateRendering;\n          }, Y.prototype.freezeActiveMeshes = function(k, H, Z) {\n            var W = this;\n            return k === void 0 && (k = !1), this.executeWhenReady(function() {\n              if (W.activeCamera) {\n                W._frustumPlanes || W.setTransformMatrix(W.activeCamera.getViewMatrix(), W.activeCamera.getProjectionMatrix()), W._evaluateActiveMeshes(), W._activeMeshesFrozen = !0, W._skipEvaluateActiveMeshesCompletely = k;\n                for (var q = 0; q < W._activeMeshes.length; q++)\n                  W._activeMeshes.data[q]._freeze();\n                H && H();\n              } else\n                Z && Z(\"No active camera found\");\n            }), this;\n          }, Y.prototype.unfreezeActiveMeshes = function() {\n            for (var k = 0; k < this.meshes.length; k++) {\n              var H = this.meshes[k];\n              H._internalAbstractMeshDataInfo && (H._internalAbstractMeshDataInfo._isActive = !1);\n            }\n            for (k = 0; k < this._activeMeshes.length; k++)\n              this._activeMeshes.data[k]._unFreeze();\n            return this._activeMeshesFrozen = !1, this;\n          }, Y.prototype._evaluateActiveMeshes = function() {\n            if (this._activeMeshesFrozen && this._activeMeshes.length) {\n              if (!this._skipEvaluateActiveMeshesCompletely)\n                for (var k = this._activeMeshes.length, H = 0; H < k; H++)\n                  (me = this._activeMeshes.data[H]).computeWorldMatrix();\n              if (this._activeParticleSystems) {\n                var Z = this._activeParticleSystems.length;\n                for (H = 0; H < Z; H++)\n                  this._activeParticleSystems.data[H].animate();\n              }\n            } else if (this.activeCamera) {\n              this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this), this.activeCamera._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset();\n              for (var W = 0, q = this._beforeEvaluateActiveMeshStage; W < q.length; W++)\n                q[W].action();\n              var he = this.getActiveMeshCandidates(), ge = he.length;\n              for (H = 0; H < ge; H++) {\n                var me;\n                if ((me = he.data[H])._internalAbstractMeshDataInfo._currentLODIsUpToDate = !1, !me.isBlocked && (this._totalVertices.addCount(me.getTotalVertices(), !1), me.isReady() && me.isEnabled() && me.scaling.lengthSquared() !== 0)) {\n                  me.computeWorldMatrix(), me.actionManager && me.actionManager.hasSpecificTriggers2(M.a.ACTION_OnIntersectionEnterTrigger, M.a.ACTION_OnIntersectionExitTrigger) && this._meshesForIntersections.pushNoDuplicate(me);\n                  var _e = this.customLODSelector ? this.customLODSelector(me, this.activeCamera) : me.getLOD(this.activeCamera);\n                  if (me._internalAbstractMeshDataInfo._currentLOD = _e, me._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0, _e != null && (_e !== me && _e.billboardMode !== c.a.BILLBOARDMODE_NONE && _e.computeWorldMatrix(), me._preActivate(), me.isVisible && me.visibility > 0 && (me.layerMask & this.activeCamera.layerMask) != 0 && (this._skipFrustumClipping || me.alwaysSelectAsActiveMesh || me.isInFrustum(this._frustumPlanes)))) {\n                    this._activeMeshes.push(me), this.activeCamera._activeMeshes.push(me), _e !== me && _e._activate(this._renderId, !1);\n                    for (var ye = 0, Pe = this._preActiveMeshStage; ye < Pe.length; ye++)\n                      Pe[ye].action(me);\n                    me._activate(this._renderId, !1) && (me.isAnInstance ? me._internalAbstractMeshDataInfo._actAsRegularMesh && (_e = me) : _e._internalAbstractMeshDataInfo._onlyForInstances = !1, _e._internalAbstractMeshDataInfo._isActive = !0, this._activeMesh(me, _e)), me._postActivate();\n                  }\n                }\n              }\n              if (this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this), this.particlesEnabled) {\n                this.onBeforeParticlesRenderingObservable.notifyObservers(this);\n                for (var be = 0; be < this.particleSystems.length; be++) {\n                  var Fe = this.particleSystems[be];\n                  if (Fe.isStarted() && Fe.emitter) {\n                    var ke = Fe.emitter;\n                    ke.position && !ke.isEnabled() || (this._activeParticleSystems.push(Fe), Fe.animate(), this._renderingManager.dispatchParticles(Fe));\n                  }\n                }\n                this.onAfterParticlesRenderingObservable.notifyObservers(this);\n              }\n            }\n          }, Y.prototype._activeMesh = function(k, H) {\n            if (this._skeletonsEnabled && H.skeleton !== null && H.skeleton !== void 0 && (this._activeSkeletons.pushNoDuplicate(H.skeleton) && H.skeleton.prepare(), H.computeBonesUsingShaders || this._softwareSkinnedMeshes.pushNoDuplicate(H)), H != null && H.subMeshes !== void 0 && H.subMeshes !== null && H.subMeshes.length > 0)\n              for (var Z = this.getActiveSubMeshCandidates(H), W = Z.length, q = 0; q < W; q++) {\n                var he = Z.data[q];\n                this._evaluateSubMesh(he, H, k);\n              }\n          }, Y.prototype.updateTransformMatrix = function(k) {\n            this.activeCamera && this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(k));\n          }, Y.prototype._bindFrameBuffer = function() {\n            if (this.activeCamera && this.activeCamera._multiviewTexture)\n              this.activeCamera._multiviewTexture._bindFrameBuffer();\n            else if (this.activeCamera && this.activeCamera.outputRenderTarget)\n              if (this.getEngine().getCaps().multiview && this.activeCamera.outputRenderTarget && this.activeCamera.outputRenderTarget.getViewCount() > 1)\n                this.activeCamera.outputRenderTarget._bindFrameBuffer();\n              else {\n                var k = this.activeCamera.outputRenderTarget.getInternalTexture();\n                k ? this.getEngine().bindFramebuffer(k) : X.a.Error(\"Camera contains invalid customDefaultRenderTarget\");\n              }\n            else\n              this.getEngine().restoreDefaultFramebuffer();\n          }, Y.prototype._renderForCamera = function(k, H) {\n            if (!k || !k._skipRendering) {\n              var Z = this._engine;\n              if (this._activeCamera = k, !this.activeCamera)\n                throw new Error(\"Active camera not set\");\n              Z.setViewport(this.activeCamera.viewport), this.resetCachedMaterial(), this._renderId++, this.getEngine().getCaps().multiview && k.outputRenderTarget && k.outputRenderTarget.getViewCount() > 1 ? this.setTransformMatrix(k._rigCameras[0].getViewMatrix(), k._rigCameras[0].getProjectionMatrix(), k._rigCameras[1].getViewMatrix(), k._rigCameras[1].getProjectionMatrix()) : this.updateTransformMatrix(), this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera), this._evaluateActiveMeshes();\n              for (var W = 0; W < this._softwareSkinnedMeshes.length; W++) {\n                var q = this._softwareSkinnedMeshes.data[W];\n                q.applySkeleton(q.skeleton);\n              }\n              this.onBeforeRenderTargetsRenderObservable.notifyObservers(this), k.customRenderTargets && k.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(k.customRenderTargets), H && H.customRenderTargets && H.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(H.customRenderTargets);\n              for (var he = 0, ge = this._gatherActiveCameraRenderTargetsStage; he < ge.length; he++)\n                ge[he].action(this._renderTargets);\n              var me = !1;\n              if (this.renderTargetsEnabled) {\n                if (this._intermediateRendering = !0, this._renderTargets.length > 0) {\n                  _.b.StartPerformanceCounter(\"Render targets\", this._renderTargets.length > 0);\n                  for (var _e = 0; _e < this._renderTargets.length; _e++) {\n                    var ye = this._renderTargets.data[_e];\n                    if (ye._shouldRender()) {\n                      this._renderId++;\n                      var Pe = ye.activeCamera && ye.activeCamera !== this.activeCamera;\n                      ye.render(Pe, this.dumpNextRenderTargets), me = !0;\n                    }\n                  }\n                  _.b.EndPerformanceCounter(\"Render targets\", this._renderTargets.length > 0), this._renderId++;\n                }\n                for (var be = 0, Fe = this._cameraDrawRenderTargetStage; be < Fe.length; be++)\n                  me = Fe[be].action(this.activeCamera) || me;\n                this._intermediateRendering = !1, this.activeCamera && this.activeCamera.outputRenderTarget && (me = !0);\n              }\n              me && !this.prePass && this._bindFrameBuffer(), this.onAfterRenderTargetsRenderObservable.notifyObservers(this), !this.postProcessManager || k._multiviewTexture || this.prePass || this.postProcessManager._prepareFrame();\n              for (var ke = 0, We = this._beforeCameraDrawStage; ke < We.length; ke++)\n                We[ke].action(this.activeCamera);\n              this.onBeforeDrawPhaseObservable.notifyObservers(this), this._renderingManager.render(null, null, !0, !0), this.onAfterDrawPhaseObservable.notifyObservers(this);\n              for (var je = 0, He = this._afterCameraDrawStage; je < He.length; je++)\n                He[je].action(this.activeCamera);\n              if (this.postProcessManager && !k._multiviewTexture) {\n                var Qe = k.outputRenderTarget ? k.outputRenderTarget.getInternalTexture() : void 0;\n                this.postProcessManager._finalizeFrame(k.isIntermediate, Qe);\n              }\n              this._renderTargets.reset(), this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera);\n            }\n          }, Y.prototype._processSubCameras = function(k) {\n            if (k.cameraRigMode === S.a.RIG_MODE_NONE || k.outputRenderTarget && k.outputRenderTarget.getViewCount() > 1 && this.getEngine().getCaps().multiview)\n              return this._renderForCamera(k), void this.onAfterRenderCameraObservable.notifyObservers(k);\n            if (k._useMultiviewToSingleView)\n              this._renderMultiviewToSingleView(k);\n            else\n              for (var H = 0; H < k._rigCameras.length; H++)\n                this._renderForCamera(k._rigCameras[H], k);\n            this._activeCamera = k, this.setTransformMatrix(this._activeCamera.getViewMatrix(), this._activeCamera.getProjectionMatrix()), this.onAfterRenderCameraObservable.notifyObservers(k);\n          }, Y.prototype._checkIntersections = function() {\n            for (var k = 0; k < this._meshesForIntersections.length; k++) {\n              var H = this._meshesForIntersections.data[k];\n              if (H.actionManager)\n                for (var Z = 0; H.actionManager && Z < H.actionManager.actions.length; Z++) {\n                  var W = H.actionManager.actions[Z];\n                  if (W.trigger === M.a.ACTION_OnIntersectionEnterTrigger || W.trigger === M.a.ACTION_OnIntersectionExitTrigger) {\n                    var q = W.getTriggerParameter(), he = q instanceof T.a ? q : q.mesh, ge = he.intersectsMesh(H, q.usePreciseIntersection), me = H._intersectionsInProgress.indexOf(he);\n                    ge && me === -1 ? W.trigger === M.a.ACTION_OnIntersectionEnterTrigger ? (W._executeCurrent(b.a.CreateNew(H, void 0, he)), H._intersectionsInProgress.push(he)) : W.trigger === M.a.ACTION_OnIntersectionExitTrigger && H._intersectionsInProgress.push(he) : !ge && me > -1 && (W.trigger === M.a.ACTION_OnIntersectionExitTrigger && W._executeCurrent(b.a.CreateNew(H, void 0, he)), H.actionManager.hasSpecificTrigger(M.a.ACTION_OnIntersectionExitTrigger, function(_e) {\n                      var ye = _e instanceof T.a ? _e : _e.mesh;\n                      return he === ye;\n                    }) && W.trigger !== M.a.ACTION_OnIntersectionExitTrigger || H._intersectionsInProgress.splice(me, 1));\n                  }\n                }\n            }\n          }, Y.prototype._advancePhysicsEngineStep = function(k) {\n          }, Y.prototype._animate = function() {\n          }, Y.prototype.animate = function() {\n            if (this._engine.isDeterministicLockStep()) {\n              var k = Math.max(Y.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Y.MaxDeltaTime)) + this._timeAccumulator, H = this._engine.getTimeStep(), Z = 1e3 / H / 1e3, W = 0, q = this._engine.getLockstepMaxSteps(), he = Math.floor(k / H);\n              for (he = Math.min(he, q); k > 0 && W < he; )\n                this.onBeforeStepObservable.notifyObservers(this), this._animationRatio = H * Z, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(H), this.onAfterStepObservable.notifyObservers(this), this._currentStepId++, W++, k -= H;\n              this._timeAccumulator = k < 0 ? 0 : k;\n            } else\n              k = this.useConstantAnimationDeltaTime ? 16 : Math.max(Y.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Y.MaxDeltaTime)), this._animationRatio = 0.06 * k, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(k);\n          }, Y.prototype.render = function(k, H) {\n            if (k === void 0 && (k = !0), H === void 0 && (H = !1), !this.isDisposed) {\n              this.onReadyObservable.hasObservers() && this._executeWhenReadyTimeoutId === -1 && this._checkIsReady(), this._frameId++, this._registerTransientComponents(), this._activeParticles.fetchNewFrame(), this._totalVertices.fetchNewFrame(), this._activeIndices.fetchNewFrame(), this._activeBones.fetchNewFrame(), this._meshesForIntersections.reset(), this.resetCachedMaterial(), this.onBeforeAnimationsObservable.notifyObservers(this), this.actionManager && this.actionManager.processTrigger(M.a.ACTION_OnEveryFrameTrigger), H || this.animate();\n              for (var Z = 0, W = this._beforeCameraUpdateStage; Z < W.length; Z++)\n                W[Z].action();\n              if (k) {\n                if (this.activeCameras && this.activeCameras.length > 0)\n                  for (var q = 0; q < this.activeCameras.length; q++) {\n                    var he = this.activeCameras[q];\n                    if (he.update(), he.cameraRigMode !== S.a.RIG_MODE_NONE)\n                      for (var ge = 0; ge < he._rigCameras.length; ge++)\n                        he._rigCameras[ge].update();\n                  }\n                else if (this.activeCamera && (this.activeCamera.update(), this.activeCamera.cameraRigMode !== S.a.RIG_MODE_NONE))\n                  for (ge = 0; ge < this.activeCamera._rigCameras.length; ge++)\n                    this.activeCamera._rigCameras[ge].update();\n              }\n              this.onBeforeRenderObservable.notifyObservers(this), this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);\n              var me = this.getEngine(), _e = this.activeCamera;\n              if (this.renderTargetsEnabled) {\n                _.b.StartPerformanceCounter(\"Custom render targets\", this.customRenderTargets.length > 0), this._intermediateRendering = !0;\n                for (var ye = 0; ye < this.customRenderTargets.length; ye++) {\n                  var Pe = this.customRenderTargets[ye];\n                  if (Pe._shouldRender()) {\n                    if (this._renderId++, this.activeCamera = Pe.activeCamera || this.activeCamera, !this.activeCamera)\n                      throw new Error(\"Active camera not set\");\n                    me.setViewport(this.activeCamera.viewport), this.updateTransformMatrix(), Pe.render(_e !== this.activeCamera, this.dumpNextRenderTargets);\n                  }\n                }\n                _.b.EndPerformanceCounter(\"Custom render targets\", this.customRenderTargets.length > 0), this._intermediateRendering = !1, this._renderId++;\n              }\n              this.activeCamera = _e, this._activeCamera && this._activeCamera.cameraRigMode !== S.a.RIG_MODE_CUSTOM && !this.prePass && this._bindFrameBuffer(), this.onAfterRenderTargetsRenderObservable.notifyObservers(this);\n              for (var be = 0, Fe = this._beforeClearStage; be < Fe.length; be++)\n                Fe[be].action();\n              !this.autoClearDepthAndStencil && !this.autoClear || this.prePass || this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);\n              for (var ke = 0, We = this._gatherRenderTargetsStage; ke < We.length; ke++)\n                We[ke].action(this._renderTargets);\n              if (this.activeCameras && this.activeCameras.length > 0)\n                for (q = 0; q < this.activeCameras.length; q++)\n                  q > 0 && this._engine.clear(null, !1, !0, !0), this._processSubCameras(this.activeCameras[q]);\n              else {\n                if (!this.activeCamera)\n                  throw new Error(\"No camera defined\");\n                this._processSubCameras(this.activeCamera);\n              }\n              this._checkIntersections();\n              for (var je = 0, He = this._afterRenderStage; je < He.length; je++)\n                He[je].action();\n              if (this.afterRender && this.afterRender(), this.onAfterRenderObservable.notifyObservers(this), this._toBeDisposed.length) {\n                for (ge = 0; ge < this._toBeDisposed.length; ge++) {\n                  var Qe = this._toBeDisposed[ge];\n                  Qe && Qe.dispose();\n                }\n                this._toBeDisposed = [];\n              }\n              this.dumpNextRenderTargets && (this.dumpNextRenderTargets = !1), this._activeBones.addCount(0, !0), this._activeIndices.addCount(0, !0), this._activeParticles.addCount(0, !0);\n            }\n          }, Y.prototype.freezeMaterials = function() {\n            for (var k = 0; k < this.materials.length; k++)\n              this.materials[k].freeze();\n          }, Y.prototype.unfreezeMaterials = function() {\n            for (var k = 0; k < this.materials.length; k++)\n              this.materials[k].unfreeze();\n          }, Y.prototype.dispose = function() {\n            this.beforeRender = null, this.afterRender = null, j.a._LastCreatedScene === this && (j.a._LastCreatedScene = null), this.skeletons = [], this.morphTargetManagers = [], this._transientComponents = [], this._isReadyForMeshStage.clear(), this._beforeEvaluateActiveMeshStage.clear(), this._evaluateSubMeshStage.clear(), this._preActiveMeshStage.clear(), this._cameraDrawRenderTargetStage.clear(), this._beforeCameraDrawStage.clear(), this._beforeRenderTargetDrawStage.clear(), this._beforeRenderingGroupDrawStage.clear(), this._beforeRenderingMeshStage.clear(), this._afterRenderingMeshStage.clear(), this._afterRenderingGroupDrawStage.clear(), this._afterCameraDrawStage.clear(), this._afterRenderTargetDrawStage.clear(), this._afterRenderStage.clear(), this._beforeCameraUpdateStage.clear(), this._beforeClearStage.clear(), this._gatherRenderTargetsStage.clear(), this._gatherActiveCameraRenderTargetsStage.clear(), this._pointerMoveStage.clear(), this._pointerDownStage.clear(), this._pointerUpStage.clear();\n            for (var k = 0, H = this._components; k < H.length; k++)\n              H[k].dispose();\n            this.importedMeshesFiles = new Array(), this.stopAllAnimations && this.stopAllAnimations(), this.resetCachedMaterial(), this.activeCamera && (this.activeCamera._activeMeshes.dispose(), this.activeCamera = null), this._activeMeshes.dispose(), this._renderingManager.dispose(), this._processedMaterials.dispose(), this._activeParticleSystems.dispose(), this._activeSkeletons.dispose(), this._softwareSkinnedMeshes.dispose(), this._renderTargets.dispose(), this._registeredForLateAnimationBindings.dispose(), this._meshesForIntersections.dispose(), this._toBeDisposed = [];\n            for (var Z = 0, W = this._activeRequests; Z < W.length; Z++)\n              W[Z].abort();\n            var q;\n            if (this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderTargetsRenderObservable.clear(), this.onAfterRenderTargetsRenderObservable.clear(), this.onAfterStepObservable.clear(), this.onBeforeStepObservable.clear(), this.onBeforeActiveMeshesEvaluationObservable.clear(), this.onAfterActiveMeshesEvaluationObservable.clear(), this.onBeforeParticlesRenderingObservable.clear(), this.onAfterParticlesRenderingObservable.clear(), this.onBeforeDrawPhaseObservable.clear(), this.onAfterDrawPhaseObservable.clear(), this.onBeforeAnimationsObservable.clear(), this.onAfterAnimationsObservable.clear(), this.onDataLoadedObservable.clear(), this.onBeforeRenderingGroupObservable.clear(), this.onAfterRenderingGroupObservable.clear(), this.onMeshImportedObservable.clear(), this.onBeforeCameraRenderObservable.clear(), this.onAfterCameraRenderObservable.clear(), this.onReadyObservable.clear(), this.onNewCameraAddedObservable.clear(), this.onCameraRemovedObservable.clear(), this.onNewLightAddedObservable.clear(), this.onLightRemovedObservable.clear(), this.onNewGeometryAddedObservable.clear(), this.onGeometryRemovedObservable.clear(), this.onNewTransformNodeAddedObservable.clear(), this.onTransformNodeRemovedObservable.clear(), this.onNewMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onNewSkeletonAddedObservable.clear(), this.onSkeletonRemovedObservable.clear(), this.onNewMaterialAddedObservable.clear(), this.onNewMultiMaterialAddedObservable.clear(), this.onMaterialRemovedObservable.clear(), this.onMultiMaterialRemovedObservable.clear(), this.onNewTextureAddedObservable.clear(), this.onTextureRemovedObservable.clear(), this.onPrePointerObservable.clear(), this.onPointerObservable.clear(), this.onPreKeyboardObservable.clear(), this.onKeyboardObservable.clear(), this.onActiveCameraChanged.clear(), this.detachControl(), this._engine.getInputElement())\n              for (q = 0; q < this.cameras.length; q++)\n                this.cameras[q].detachControl();\n            for (; this.animationGroups.length; )\n              this.animationGroups[0].dispose();\n            for (; this.lights.length; )\n              this.lights[0].dispose();\n            for (; this.meshes.length; )\n              this.meshes[0].dispose(!0);\n            for (; this.transformNodes.length; )\n              this.transformNodes[0].dispose(!0);\n            for (; this.cameras.length; )\n              this.cameras[0].dispose();\n            for (this._defaultMaterial && this._defaultMaterial.dispose(); this.multiMaterials.length; )\n              this.multiMaterials[0].dispose();\n            for (; this.materials.length; )\n              this.materials[0].dispose();\n            for (; this.particleSystems.length; )\n              this.particleSystems[0].dispose();\n            for (; this.postProcesses.length; )\n              this.postProcesses[0].dispose();\n            for (; this.textures.length; )\n              this.textures[0].dispose();\n            this._sceneUbo.dispose(), this._multiviewSceneUbo && this._multiviewSceneUbo.dispose(), this.postProcessManager.dispose(), (q = this._engine.scenes.indexOf(this)) > -1 && this._engine.scenes.splice(q, 1), this._engine.wipeCaches(!0), this._isDisposed = !0;\n          }, Object.defineProperty(Y.prototype, \"isDisposed\", { get: function() {\n            return this._isDisposed;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.clearCachedVertexData = function() {\n            for (var k = 0; k < this.meshes.length; k++) {\n              var H = this.meshes[k].geometry;\n              if (H)\n                for (var Z in H._indices = [], H._vertexBuffers)\n                  H._vertexBuffers.hasOwnProperty(Z) && (H._vertexBuffers[Z]._buffer._data = null);\n            }\n          }, Y.prototype.cleanCachedTextureBuffer = function() {\n            for (var k = 0, H = this.textures; k < H.length; k++) {\n              var Z = H[k];\n              Z._buffer && (Z._buffer = null);\n            }\n          }, Y.prototype.getWorldExtends = function(k) {\n            var H = new m.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), Z = new m.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n            return k = k || function() {\n              return !0;\n            }, this.meshes.filter(k).forEach(function(W) {\n              if (W.computeWorldMatrix(!0), W.subMeshes && W.subMeshes.length !== 0 && !W.infiniteDistance) {\n                var q = W.getBoundingInfo(), he = q.boundingBox.minimumWorld, ge = q.boundingBox.maximumWorld;\n                m.e.CheckExtends(he, H, Z), m.e.CheckExtends(ge, H, Z);\n              }\n            }), { min: H, max: Z };\n          }, Y.prototype.createPickingRay = function(k, H, Z, W, q) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.createPickingRayToRef = function(k, H, Z, W, q, he) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.createPickingRayInCameraSpace = function(k, H, Z) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.createPickingRayInCameraSpaceToRef = function(k, H, Z, W) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.pick = function(k, H, Z, W, q, he) {\n            var ge = new v.a();\n            return ge._pickingUnavailable = !0, ge;\n          }, Y.prototype.pickWithBoundingInfo = function(k, H, Z, W, q) {\n            var he = new v.a();\n            return he._pickingUnavailable = !0, he;\n          }, Y.prototype.pickWithRay = function(k, H, Z, W) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.multiPick = function(k, H, Z, W, q) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.multiPickWithRay = function(k, H, Z) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.setPointerOverMesh = function(k, H) {\n            this._inputManager.setPointerOverMesh(k, H);\n          }, Y.prototype.getPointerOverMesh = function() {\n            return this._inputManager.getPointerOverMesh();\n          }, Y.prototype._rebuildGeometries = function() {\n            for (var k = 0, H = this.geometries; k < H.length; k++)\n              H[k]._rebuild();\n            for (var Z = 0, W = this.meshes; Z < W.length; Z++)\n              W[Z]._rebuild();\n            this.postProcessManager && this.postProcessManager._rebuild();\n            for (var q = 0, he = this._components; q < he.length; q++)\n              he[q].rebuild();\n            for (var ge = 0, me = this.particleSystems; ge < me.length; ge++)\n              me[ge].rebuild();\n          }, Y.prototype._rebuildTextures = function() {\n            for (var k = 0, H = this.textures; k < H.length; k++)\n              H[k]._rebuild();\n            this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag);\n          }, Y.prototype._getByTags = function(k, H, Z) {\n            if (H === void 0)\n              return k;\n            var W = [];\n            for (var q in Z = Z || function(ge) {\n            }, k) {\n              var he = k[q];\n              x.a && x.a.MatchesQuery(he, H) && (W.push(he), Z(he));\n            }\n            return W;\n          }, Y.prototype.getMeshesByTags = function(k, H) {\n            return this._getByTags(this.meshes, k, H);\n          }, Y.prototype.getCamerasByTags = function(k, H) {\n            return this._getByTags(this.cameras, k, H);\n          }, Y.prototype.getLightsByTags = function(k, H) {\n            return this._getByTags(this.lights, k, H);\n          }, Y.prototype.getMaterialByTags = function(k, H) {\n            return this._getByTags(this.materials, k, H).concat(this._getByTags(this.multiMaterials, k, H));\n          }, Y.prototype.getTransformNodesByTags = function(k, H) {\n            return this._getByTags(this.transformNodes, k, H);\n          }, Y.prototype.setRenderingOrder = function(k, H, Z, W) {\n            H === void 0 && (H = null), Z === void 0 && (Z = null), W === void 0 && (W = null), this._renderingManager.setRenderingOrder(k, H, Z, W);\n          }, Y.prototype.setRenderingAutoClearDepthStencil = function(k, H, Z, W) {\n            Z === void 0 && (Z = !0), W === void 0 && (W = !0), this._renderingManager.setRenderingAutoClearDepthStencil(k, H, Z, W);\n          }, Y.prototype.getAutoClearDepthStencilSetup = function(k) {\n            return this._renderingManager.getAutoClearDepthStencilSetup(k);\n          }, Object.defineProperty(Y.prototype, \"blockMaterialDirtyMechanism\", { get: function() {\n            return this._blockMaterialDirtyMechanism;\n          }, set: function(k) {\n            this._blockMaterialDirtyMechanism !== k && (this._blockMaterialDirtyMechanism = k, k || this.markAllMaterialsAsDirty(M.a.MATERIAL_AllDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Y.prototype.markAllMaterialsAsDirty = function(k, H) {\n            if (!this._blockMaterialDirtyMechanism)\n              for (var Z = 0, W = this.materials; Z < W.length; Z++) {\n                var q = W[Z];\n                H && !H(q) || q.markAsDirty(k);\n              }\n          }, Y.prototype._loadFile = function(k, H, Z, W, q, he) {\n            var ge = this, me = Q.a.LoadFile(k, H, Z, W ? this.offlineProvider : void 0, q, he);\n            return this._activeRequests.push(me), me.onCompleteObservable.add(function(_e) {\n              ge._activeRequests.splice(ge._activeRequests.indexOf(_e), 1);\n            }), me;\n          }, Y.prototype._loadFileAsync = function(k, H, Z, W) {\n            var q = this;\n            return new Promise(function(he, ge) {\n              q._loadFile(k, function(me) {\n                he(me);\n              }, H, Z, W, function(me, _e) {\n                ge(_e);\n              });\n            });\n          }, Y.prototype._requestFile = function(k, H, Z, W, q, he, ge) {\n            var me = this, _e = Q.a.RequestFile(k, H, Z, W ? this.offlineProvider : void 0, q, he, ge);\n            return this._activeRequests.push(_e), _e.onCompleteObservable.add(function(ye) {\n              me._activeRequests.splice(me._activeRequests.indexOf(ye), 1);\n            }), _e;\n          }, Y.prototype._requestFileAsync = function(k, H, Z, W, q) {\n            var he = this;\n            return new Promise(function(ge, me) {\n              he._requestFile(k, function(_e) {\n                ge(_e);\n              }, H, Z, W, function(_e) {\n                me(_e);\n              }, q);\n            });\n          }, Y.prototype._readFile = function(k, H, Z, W, q) {\n            var he = this, ge = Q.a.ReadFile(k, H, Z, W, q);\n            return this._activeRequests.push(ge), ge.onCompleteObservable.add(function(me) {\n              he._activeRequests.splice(he._activeRequests.indexOf(me), 1);\n            }), ge;\n          }, Y.prototype._readFileAsync = function(k, H, Z) {\n            var W = this;\n            return new Promise(function(q, he) {\n              W._readFile(k, function(ge) {\n                q(ge);\n              }, H, Z, function(ge) {\n                he(ge);\n              });\n            });\n          }, Y.FOGMODE_NONE = 0, Y.FOGMODE_EXP = 1, Y.FOGMODE_EXP2 = 2, Y.FOGMODE_LINEAR = 3, Y.MinDeltaTime = 1, Y.MaxDeltaTime = 1e3, Y;\n        }(E.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.WarnImport = function(C) {\n            return C + \" needs to be imported before as it contains a side-effect required by your code.\";\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return Object.defineProperty(_, \"LastCreatedEngine\", { get: function() {\n            return this.Instances.length === 0 ? null : this.Instances[this.Instances.length - 1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_, \"LastCreatedScene\", { get: function() {\n            return this._LastCreatedScene;\n          }, enumerable: !1, configurable: !0 }), _.Instances = new Array(), _._LastCreatedScene = null, _.UseFallbackTexture = !0, _.FallbackTexture = \"\", _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"c\", function() {\n          return V;\n        }), f.d(A, \"a\", function() {\n          return u;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V, _ = f(0);\n        (function(I) {\n          I[I.LOCAL = 0] = \"LOCAL\", I[I.WORLD = 1] = \"WORLD\", I[I.BONE = 2] = \"BONE\";\n        })(V || (V = {}));\n        var C, u = function() {\n          function I() {\n          }\n          return I.X = new _.e(1, 0, 0), I.Y = new _.e(0, 1, 0), I.Z = new _.e(0, 0, 1), I;\n        }();\n        (function(I) {\n          I[I.X = 0] = \"X\", I[I.Y = 1] = \"Y\", I[I.Z = 2] = \"Z\";\n        })(C || (C = {}));\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return g;\n        });\n        var V = f(1), _ = f(3), C = f(33), u = f(12), I = f(6), O = f(0), x = f(29), m = f(8), c = f(11), T = f(21), S = f(58), E = f(90), g = function(l) {\n          function h(v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = l.call(this, v, D) || this;\n            return N._position = O.e.Zero(), N._upVector = O.e.Up(), N.orthoLeft = null, N.orthoRight = null, N.orthoBottom = null, N.orthoTop = null, N.fov = 0.8, N.minZ = 1, N.maxZ = 1e4, N.inertia = 0.9, N.mode = h.PERSPECTIVE_CAMERA, N.isIntermediate = !1, N.viewport = new S.a(0, 0, 1, 1), N.layerMask = 268435455, N.fovMode = h.FOVMODE_VERTICAL_FIXED, N.cameraRigMode = h.RIG_MODE_NONE, N.customRenderTargets = new Array(), N.outputRenderTarget = null, N.onViewMatrixChangedObservable = new I.c(), N.onProjectionMatrixChangedObservable = new I.c(), N.onAfterCheckInputsObservable = new I.c(), N.onRestoreStateObservable = new I.c(), N.isRigCamera = !1, N._rigCameras = new Array(), N._webvrViewMatrix = O.a.Identity(), N._skipRendering = !1, N._projectionMatrix = new O.a(), N._postProcesses = new Array(), N._activeMeshes = new C.a(256), N._globalPosition = O.e.Zero(), N._computedViewMatrix = O.a.Identity(), N._doNotComputeProjectionMatrix = !1, N._transformMatrix = O.a.Zero(), N._refreshFrustumPlanes = !0, N._isCamera = !0, N._isLeftCamera = !1, N._isRightCamera = !1, N.getScene().addCamera(N), w && !N.getScene().activeCamera && (N.getScene().activeCamera = N), N.position = b, N;\n          }\n          return Object(V.d)(h, l), Object.defineProperty(h.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(v) {\n            this._position = v;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"upVector\", { get: function() {\n            return this._upVector;\n          }, set: function(v) {\n            this._upVector = v;\n          }, enumerable: !1, configurable: !0 }), h.prototype.storeState = function() {\n            return this._stateStored = !0, this._storedFov = this.fov, this;\n          }, h.prototype._restoreStateValues = function() {\n            return !!this._stateStored && (this.fov = this._storedFov, !0);\n          }, h.prototype.restoreState = function() {\n            return !!this._restoreStateValues() && (this.onRestoreStateObservable.notifyObservers(this), !0);\n          }, h.prototype.getClassName = function() {\n            return \"Camera\";\n          }, h.prototype.toString = function(v) {\n            var b = \"Name: \" + this.name;\n            if (b += \", type: \" + this.getClassName(), this.animations)\n              for (var D = 0; D < this.animations.length; D++)\n                b += \", animation[0]: \" + this.animations[D].toString(v);\n            return b;\n          }, Object.defineProperty(h.prototype, \"globalPosition\", { get: function() {\n            return this._globalPosition;\n          }, enumerable: !1, configurable: !0 }), h.prototype.getActiveMeshes = function() {\n            return this._activeMeshes;\n          }, h.prototype.isActiveMesh = function(v) {\n            return this._activeMeshes.indexOf(v) !== -1;\n          }, h.prototype.isReady = function(v) {\n            if (v === void 0 && (v = !1), v)\n              for (var b = 0, D = this._postProcesses; b < D.length; b++) {\n                var w = D[b];\n                if (w && !w.isReady())\n                  return !1;\n              }\n            return l.prototype.isReady.call(this, v);\n          }, h.prototype._initCache = function() {\n            l.prototype._initCache.call(this), this._cache.position = new O.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.upVector = new O.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.mode = void 0, this._cache.minZ = void 0, this._cache.maxZ = void 0, this._cache.fov = void 0, this._cache.fovMode = void 0, this._cache.aspectRatio = void 0, this._cache.orthoLeft = void 0, this._cache.orthoRight = void 0, this._cache.orthoBottom = void 0, this._cache.orthoTop = void 0, this._cache.renderWidth = void 0, this._cache.renderHeight = void 0;\n          }, h.prototype._updateCache = function(v) {\n            v || l.prototype._updateCache.call(this), this._cache.position.copyFrom(this.position), this._cache.upVector.copyFrom(this.upVector);\n          }, h.prototype._isSynchronized = function() {\n            return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();\n          }, h.prototype._isSynchronizedViewMatrix = function() {\n            return !!l.prototype._isSynchronized.call(this) && this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();\n          }, h.prototype._isSynchronizedProjectionMatrix = function() {\n            var v = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;\n            if (!v)\n              return !1;\n            var b = this.getEngine();\n            return v = this.mode === h.PERSPECTIVE_CAMERA ? this._cache.fov === this.fov && this._cache.fovMode === this.fovMode && this._cache.aspectRatio === b.getAspectRatio(this) : this._cache.orthoLeft === this.orthoLeft && this._cache.orthoRight === this.orthoRight && this._cache.orthoBottom === this.orthoBottom && this._cache.orthoTop === this.orthoTop && this._cache.renderWidth === b.getRenderWidth() && this._cache.renderHeight === b.getRenderHeight();\n          }, h.prototype.attachControl = function(v, b) {\n          }, h.prototype.detachControl = function(v) {\n          }, h.prototype.update = function() {\n            this._checkInputs(), this.cameraRigMode !== h.RIG_MODE_NONE && this._updateRigCameras();\n          }, h.prototype._checkInputs = function() {\n            this.onAfterCheckInputsObservable.notifyObservers(this);\n          }, Object.defineProperty(h.prototype, \"rigCameras\", { get: function() {\n            return this._rigCameras;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"rigPostProcess\", { get: function() {\n            return this._rigPostProcess;\n          }, enumerable: !1, configurable: !0 }), h.prototype._getFirstPostProcess = function() {\n            for (var v = 0; v < this._postProcesses.length; v++)\n              if (this._postProcesses[v] !== null)\n                return this._postProcesses[v];\n            return null;\n          }, h.prototype._cascadePostProcessesToRigCams = function() {\n            var v = this._getFirstPostProcess();\n            v && v.markTextureDirty();\n            for (var b = 0, D = this._rigCameras.length; b < D; b++) {\n              var w = this._rigCameras[b], N = w._rigPostProcess;\n              N ? (N.getEffectName() === \"pass\" && (w.isIntermediate = this._postProcesses.length === 0), w._postProcesses = this._postProcesses.slice(0).concat(N), N.markTextureDirty()) : w._postProcesses = this._postProcesses.slice(0);\n            }\n          }, h.prototype.attachPostProcess = function(v, b) {\n            return b === void 0 && (b = null), !v.isReusable() && this._postProcesses.indexOf(v) > -1 ? (m.a.Error(\"You're trying to reuse a post process not defined as reusable.\"), 0) : (b == null || b < 0 ? this._postProcesses.push(v) : this._postProcesses[b] === null ? this._postProcesses[b] = v : this._postProcesses.splice(b, 0, v), this._cascadePostProcessesToRigCams(), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._postProcesses.indexOf(v));\n          }, h.prototype.detachPostProcess = function(v) {\n            var b = this._postProcesses.indexOf(v);\n            b !== -1 && (this._postProcesses[b] = null), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._cascadePostProcessesToRigCams();\n          }, h.prototype.getWorldMatrix = function() {\n            return this._isSynchronizedViewMatrix() || this.getViewMatrix(), this._worldMatrix;\n          }, h.prototype._getViewMatrix = function() {\n            return O.a.Identity();\n          }, h.prototype.getViewMatrix = function(v) {\n            return !v && this._isSynchronizedViewMatrix() || (this.updateCache(), this._computedViewMatrix = this._getViewMatrix(), this._currentRenderId = this.getScene().getRenderId(), this._childUpdateId++, this._refreshFrustumPlanes = !0, this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix && this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix), this.parent && this.parent.onViewMatrixChangedObservable && this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent), this.onViewMatrixChangedObservable.notifyObservers(this), this._computedViewMatrix.invertToRef(this._worldMatrix)), this._computedViewMatrix;\n          }, h.prototype.freezeProjectionMatrix = function(v) {\n            this._doNotComputeProjectionMatrix = !0, v !== void 0 && (this._projectionMatrix = v);\n          }, h.prototype.unfreezeProjectionMatrix = function() {\n            this._doNotComputeProjectionMatrix = !1;\n          }, h.prototype.getProjectionMatrix = function(v) {\n            var b, D, w, N, M, U, X, j;\n            if (this._doNotComputeProjectionMatrix || !v && this._isSynchronizedProjectionMatrix())\n              return this._projectionMatrix;\n            this._cache.mode = this.mode, this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ, this._refreshFrustumPlanes = !0;\n            var ne = this.getEngine(), te = this.getScene();\n            if (this.mode === h.PERSPECTIVE_CAMERA) {\n              this._cache.fov = this.fov, this._cache.fovMode = this.fovMode, this._cache.aspectRatio = ne.getAspectRatio(this), this.minZ <= 0 && (this.minZ = 0.1);\n              var de = ne.useReverseDepthBuffer;\n              (te.useRightHandedSystem ? de ? O.a.PerspectiveFovReverseRHToRef : O.a.PerspectiveFovRHToRef : de ? O.a.PerspectiveFovReverseLHToRef : O.a.PerspectiveFovLHToRef)(this.fov, ne.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === h.FOVMODE_VERTICAL_FIXED);\n            } else {\n              var pe = ne.getRenderWidth() / 2, ae = ne.getRenderHeight() / 2;\n              te.useRightHandedSystem ? O.a.OrthoOffCenterRHToRef((b = this.orthoLeft) !== null && b !== void 0 ? b : -pe, (D = this.orthoRight) !== null && D !== void 0 ? D : pe, (w = this.orthoBottom) !== null && w !== void 0 ? w : -ae, (N = this.orthoTop) !== null && N !== void 0 ? N : ae, this.minZ, this.maxZ, this._projectionMatrix) : O.a.OrthoOffCenterLHToRef((M = this.orthoLeft) !== null && M !== void 0 ? M : -pe, (U = this.orthoRight) !== null && U !== void 0 ? U : pe, (X = this.orthoBottom) !== null && X !== void 0 ? X : -ae, (j = this.orthoTop) !== null && j !== void 0 ? j : ae, this.minZ, this.maxZ, this._projectionMatrix), this._cache.orthoLeft = this.orthoLeft, this._cache.orthoRight = this.orthoRight, this._cache.orthoBottom = this.orthoBottom, this._cache.orthoTop = this.orthoTop, this._cache.renderWidth = ne.getRenderWidth(), this._cache.renderHeight = ne.getRenderHeight();\n            }\n            return this.onProjectionMatrixChangedObservable.notifyObservers(this), this._projectionMatrix;\n          }, h.prototype.getTransformationMatrix = function() {\n            return this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._transformMatrix;\n          }, h.prototype._updateFrustumPlanes = function() {\n            this._refreshFrustumPlanes && (this.getTransformationMatrix(), this._frustumPlanes ? E.a.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = E.a.GetPlanes(this._transformMatrix), this._refreshFrustumPlanes = !1);\n          }, h.prototype.isInFrustum = function(v, b) {\n            if (b === void 0 && (b = !1), this._updateFrustumPlanes(), b && this.rigCameras.length > 0) {\n              var D = !1;\n              return this.rigCameras.forEach(function(w) {\n                w._updateFrustumPlanes(), D = D || v.isInFrustum(w._frustumPlanes);\n              }), D;\n            }\n            return v.isInFrustum(this._frustumPlanes);\n          }, h.prototype.isCompletelyInFrustum = function(v) {\n            return this._updateFrustumPlanes(), v.isCompletelyInFrustum(this._frustumPlanes);\n          }, h.prototype.getForwardRay = function(v, b, D) {\n            throw T.a.WarnImport(\"Ray\");\n          }, h.prototype.getForwardRayToRef = function(v, b, D, w) {\n            throw T.a.WarnImport(\"Ray\");\n          }, h.prototype.dispose = function(v, b) {\n            for (b === void 0 && (b = !1), this.onViewMatrixChangedObservable.clear(), this.onProjectionMatrixChangedObservable.clear(), this.onAfterCheckInputsObservable.clear(), this.onRestoreStateObservable.clear(), this.inputs && this.inputs.clear(), this.getScene().stopAnimation(this), this.getScene().removeCamera(this); this._rigCameras.length > 0; ) {\n              var D = this._rigCameras.pop();\n              D && D.dispose();\n            }\n            if (this._rigPostProcess)\n              this._rigPostProcess.dispose(this), this._rigPostProcess = null, this._postProcesses = [];\n            else if (this.cameraRigMode !== h.RIG_MODE_NONE)\n              this._rigPostProcess = null, this._postProcesses = [];\n            else\n              for (var w = this._postProcesses.length; --w >= 0; ) {\n                var N = this._postProcesses[w];\n                N && N.dispose(this);\n              }\n            for (w = this.customRenderTargets.length; --w >= 0; )\n              this.customRenderTargets[w].dispose();\n            this.customRenderTargets = [], this._activeMeshes.dispose(), l.prototype.dispose.call(this, v, b);\n          }, Object.defineProperty(h.prototype, \"isLeftCamera\", { get: function() {\n            return this._isLeftCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"isRightCamera\", { get: function() {\n            return this._isRightCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"leftCamera\", { get: function() {\n            return this._rigCameras.length < 1 ? null : this._rigCameras[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"rightCamera\", { get: function() {\n            return this._rigCameras.length < 2 ? null : this._rigCameras[1];\n          }, enumerable: !1, configurable: !0 }), h.prototype.getLeftTarget = function() {\n            return this._rigCameras.length < 1 ? null : this._rigCameras[0].getTarget();\n          }, h.prototype.getRightTarget = function() {\n            return this._rigCameras.length < 2 ? null : this._rigCameras[1].getTarget();\n          }, h.prototype.setCameraRigMode = function(v, b) {\n            if (this.cameraRigMode !== v) {\n              for (; this._rigCameras.length > 0; ) {\n                var D = this._rigCameras.pop();\n                D && D.dispose();\n              }\n              if (this.cameraRigMode = v, this._cameraRigParams = {}, this._cameraRigParams.interaxialDistance = b.interaxialDistance || 0.0637, this._cameraRigParams.stereoHalfAngle = u.b.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637), this.cameraRigMode !== h.RIG_MODE_NONE) {\n                var w = this.createRigCamera(this.name + \"_L\", 0);\n                w && (w._isLeftCamera = !0);\n                var N = this.createRigCamera(this.name + \"_R\", 1);\n                N && (N._isRightCamera = !0), w && N && (this._rigCameras.push(w), this._rigCameras.push(N));\n              }\n              switch (this.cameraRigMode) {\n                case h.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n                  h._setStereoscopicAnaglyphRigMode(this);\n                  break;\n                case h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n                case h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n                case h.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n                case h.RIG_MODE_STEREOSCOPIC_INTERLACED:\n                  h._setStereoscopicRigMode(this);\n                  break;\n                case h.RIG_MODE_VR:\n                  h._setVRRigMode(this, b);\n                  break;\n                case h.RIG_MODE_WEBVR:\n                  h._setWebVRRigMode(this, b);\n              }\n              this._cascadePostProcessesToRigCams(), this.update();\n            }\n          }, h._setStereoscopicRigMode = function(v) {\n            throw \"Import Cameras/RigModes/stereoscopicRigMode before using stereoscopic rig mode\";\n          }, h._setStereoscopicAnaglyphRigMode = function(v) {\n            throw \"Import Cameras/RigModes/stereoscopicAnaglyphRigMode before using stereoscopic anaglyph rig mode\";\n          }, h._setVRRigMode = function(v, b) {\n            throw \"Import Cameras/RigModes/vrRigMode before using VR rig mode\";\n          }, h._setWebVRRigMode = function(v, b) {\n            throw \"Import Cameras/RigModes/WebVRRigMode before using Web VR rig mode\";\n          }, h.prototype._getVRProjectionMatrix = function() {\n            return O.a.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix), this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix), this._projectionMatrix;\n          }, h.prototype._updateCameraRotationMatrix = function() {\n          }, h.prototype._updateWebVRCameraRotationMatrix = function() {\n          }, h.prototype._getWebVRProjectionMatrix = function() {\n            return O.a.Identity();\n          }, h.prototype._getWebVRViewMatrix = function() {\n            return O.a.Identity();\n          }, h.prototype.setCameraRigParameter = function(v, b) {\n            this._cameraRigParams || (this._cameraRigParams = {}), this._cameraRigParams[v] = b, v === \"interaxialDistance\" && (this._cameraRigParams.stereoHalfAngle = u.b.ToRadians(b / 0.0637));\n          }, h.prototype.createRigCamera = function(v, b) {\n            return null;\n          }, h.prototype._updateRigCameras = function() {\n            for (var v = 0; v < this._rigCameras.length; v++)\n              this._rigCameras[v].minZ = this.minZ, this._rigCameras[v].maxZ = this.maxZ, this._rigCameras[v].fov = this.fov, this._rigCameras[v].upVector.copyFrom(this.upVector);\n            this.cameraRigMode === h.RIG_MODE_STEREOSCOPIC_ANAGLYPH && (this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport);\n          }, h.prototype._setupInputs = function() {\n          }, h.prototype.serialize = function() {\n            var v = _.a.Serialize(this);\n            return v.type = this.getClassName(), this.parent && (v.parentId = this.parent.id), this.inputs && this.inputs.serialize(v), _.a.AppendSerializedAnimations(this, v), v.ranges = this.serializeAnimationRanges(), v;\n          }, h.prototype.clone = function(v) {\n            return _.a.Clone(h.GetConstructorFromName(this.getClassName(), v, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);\n          }, h.prototype.getDirection = function(v) {\n            var b = O.e.Zero();\n            return this.getDirectionToRef(v, b), b;\n          }, Object.defineProperty(h.prototype, \"absoluteRotation\", { get: function() {\n            var v = O.b.Zero();\n            return this.getWorldMatrix().decompose(void 0, v), v;\n          }, enumerable: !1, configurable: !0 }), h.prototype.getDirectionToRef = function(v, b) {\n            O.e.TransformNormalToRef(v, this.getWorldMatrix(), b);\n          }, h.GetConstructorFromName = function(v, b, D, w, N) {\n            w === void 0 && (w = 0), N === void 0 && (N = !0);\n            var M = x.a.Construct(v, b, D, { interaxial_distance: w, isStereoscopicSideBySide: N });\n            return M || function() {\n              return h._createDefaultParsedCamera(b, D);\n            };\n          }, h.prototype.computeWorldMatrix = function() {\n            return this.getWorldMatrix();\n          }, h.Parse = function(v, b) {\n            var D = v.type, w = h.GetConstructorFromName(D, v.name, b, v.interaxial_distance, v.isStereoscopicSideBySide), N = _.a.Parse(w, v, b);\n            if (v.parentId && (N._waitingParentId = v.parentId), N.inputs && (N.inputs.parse(v), N._setupInputs()), v.upVector && (N.upVector = O.e.FromArray(v.upVector)), N.setPosition && (N.position.copyFromFloats(0, 0, 0), N.setPosition(O.e.FromArray(v.position))), v.target && N.setTarget && N.setTarget(O.e.FromArray(v.target)), v.cameraRigMode) {\n              var M = v.interaxial_distance ? { interaxialDistance: v.interaxial_distance } : {};\n              N.setCameraRigMode(v.cameraRigMode, M);\n            }\n            if (v.animations) {\n              for (var U = 0; U < v.animations.length; U++) {\n                var X = v.animations[U], j = c.a.GetClass(\"BABYLON.Animation\");\n                j && N.animations.push(j.Parse(X));\n              }\n              x.a.ParseAnimationRanges(N, v, b);\n            }\n            return v.autoAnimate && b.beginAnimation(N, v.autoAnimateFrom, v.autoAnimateTo, v.autoAnimateLoop, v.autoAnimateSpeed || 1), N;\n          }, h._createDefaultParsedCamera = function(v, b) {\n            throw T.a.WarnImport(\"UniversalCamera\");\n          }, h.PERSPECTIVE_CAMERA = 0, h.ORTHOGRAPHIC_CAMERA = 1, h.FOVMODE_VERTICAL_FIXED = 0, h.FOVMODE_HORIZONTAL_FIXED = 1, h.RIG_MODE_NONE = 0, h.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10, h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11, h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12, h.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13, h.RIG_MODE_STEREOSCOPIC_INTERLACED = 14, h.RIG_MODE_VR = 20, h.RIG_MODE_WEBVR = 21, h.RIG_MODE_CUSTOM = 22, h.ForceAttachControlToAlwaysPreventDefault = !1, Object(V.c)([Object(_.o)(\"position\")], h.prototype, \"_position\", void 0), Object(V.c)([Object(_.o)(\"upVector\")], h.prototype, \"_upVector\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoLeft\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoRight\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoBottom\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoTop\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"fov\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"minZ\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"maxZ\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"inertia\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"mode\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"layerMask\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"fovMode\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"cameraRigMode\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"interaxialDistance\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"isStereoscopicSideBySide\", void 0), h;\n        }(x.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return S;\n        });\n        var V = f(1), _ = f(3), C = f(12), u = f(6), I = f(22), O = f(61), x = f(85), m = f(2), c = f(8), T = f(64), S = function() {\n          function E(g, l, h) {\n            this.shadowDepthWrapper = null, this.allowShaderHotSwapping = !0, this.metadata = null, this.reservedDataStore = null, this.checkReadyOnEveryCall = !1, this.checkReadyOnlyOnce = !1, this.state = \"\", this._alpha = 1, this._backFaceCulling = !0, this.onCompiled = null, this.onError = null, this.getRenderTargetTextures = null, this.doNotSerialize = !1, this._storeEffectOnSubMeshes = !1, this.animations = null, this.onDisposeObservable = new u.c(), this._onDisposeObserver = null, this._onUnBindObservable = null, this._onBindObserver = null, this._alphaMode = m.a.ALPHA_COMBINE, this._needDepthPrePass = !1, this.disableDepthWrite = !1, this.disableColorWrite = !1, this.forceDepthWrite = !1, this.depthFunction = 0, this.separateCullingPass = !1, this._fogEnabled = !0, this.pointSize = 1, this.zOffset = 0, this._effect = null, this._useUBO = !1, this._fillMode = E.TriangleFillMode, this._cachedDepthWriteState = !1, this._cachedColorWriteState = !1, this._cachedDepthFunctionState = 0, this._indexInSceneMaterialArray = -1, this.meshMap = null, this._forceAlphaTest = !1, this._transparencyMode = null, this.name = g;\n            var v = 1;\n            for (this._scene = l || I.a.LastCreatedScene, this.id = g || C.b.RandomId(); this._scene.getMaterialByID(this.id); )\n              this.id = g + \" \" + v++;\n            this.uniqueId = this._scene.getUniqueId(), this._scene.useRightHandedSystem ? this.sideOrientation = E.ClockWiseSideOrientation : this.sideOrientation = E.CounterClockWiseSideOrientation, this._uniformBuffer = new x.a(this._scene.getEngine()), this._useUBO = this.getScene().getEngine().supportsUniformBuffers, h || this._scene.addMaterial(this), this._scene.useMaterialMeshMap && (this.meshMap = {});\n          }\n          return Object.defineProperty(E.prototype, \"canRenderToMRT\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"alpha\", { get: function() {\n            return this._alpha;\n          }, set: function(g) {\n            this._alpha !== g && (this._alpha = g, this.markAsDirty(E.MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"backFaceCulling\", { get: function() {\n            return this._backFaceCulling;\n          }, set: function(g) {\n            this._backFaceCulling !== g && (this._backFaceCulling = g, this.markAsDirty(E.TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onDispose\", { set: function(g) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(g);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onBindObservable\", { get: function() {\n            return this._onBindObservable || (this._onBindObservable = new u.c()), this._onBindObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onBind\", { set: function(g) {\n            this._onBindObserver && this.onBindObservable.remove(this._onBindObserver), this._onBindObserver = this.onBindObservable.add(g);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onUnBindObservable\", { get: function() {\n            return this._onUnBindObservable || (this._onUnBindObservable = new u.c()), this._onUnBindObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onEffectCreatedObservable\", { get: function() {\n            return this._onEffectCreatedObservable || (this._onEffectCreatedObservable = new u.c()), this._onEffectCreatedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"alphaMode\", { get: function() {\n            return this._alphaMode;\n          }, set: function(g) {\n            this._alphaMode !== g && (this._alphaMode = g, this.markAsDirty(E.TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"needDepthPrePass\", { get: function() {\n            return this._needDepthPrePass;\n          }, set: function(g) {\n            this._needDepthPrePass !== g && (this._needDepthPrePass = g, this._needDepthPrePass && (this.checkReadyOnEveryCall = !0));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"fogEnabled\", { get: function() {\n            return this._fogEnabled;\n          }, set: function(g) {\n            this._fogEnabled !== g && (this._fogEnabled = g, this.markAsDirty(E.MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"wireframe\", { get: function() {\n            switch (this._fillMode) {\n              case E.WireFrameFillMode:\n              case E.LineListDrawMode:\n              case E.LineLoopDrawMode:\n              case E.LineStripDrawMode:\n                return !0;\n            }\n            return this._scene.forceWireframe;\n          }, set: function(g) {\n            this.fillMode = g ? E.WireFrameFillMode : E.TriangleFillMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"pointsCloud\", { get: function() {\n            switch (this._fillMode) {\n              case E.PointFillMode:\n              case E.PointListDrawMode:\n                return !0;\n            }\n            return this._scene.forcePointsCloud;\n          }, set: function(g) {\n            this.fillMode = g ? E.PointFillMode : E.TriangleFillMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"fillMode\", { get: function() {\n            return this._fillMode;\n          }, set: function(g) {\n            this._fillMode !== g && (this._fillMode = g, this.markAsDirty(E.MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), E.prototype.toString = function(g) {\n            return \"Name: \" + this.name;\n          }, E.prototype.getClassName = function() {\n            return \"Material\";\n          }, Object.defineProperty(E.prototype, \"isFrozen\", { get: function() {\n            return this.checkReadyOnlyOnce;\n          }, enumerable: !1, configurable: !0 }), E.prototype.freeze = function() {\n            this.markDirty(), this.checkReadyOnlyOnce = !0;\n          }, E.prototype.unfreeze = function() {\n            this.markDirty(), this.checkReadyOnlyOnce = !1;\n          }, E.prototype.isReady = function(g, l) {\n            return !0;\n          }, E.prototype.isReadyForSubMesh = function(g, l, h) {\n            return !1;\n          }, E.prototype.getEffect = function() {\n            return this._effect;\n          }, E.prototype.getScene = function() {\n            return this._scene;\n          }, Object.defineProperty(E.prototype, \"transparencyMode\", { get: function() {\n            return this._transparencyMode;\n          }, set: function(g) {\n            this._transparencyMode !== g && (this._transparencyMode = g, this._forceAlphaTest = g === E.MATERIAL_ALPHATESTANDBLEND, this._markAllSubMeshesAsTexturesAndMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"_disableAlphaBlending\", { get: function() {\n            return this._transparencyMode === E.MATERIAL_OPAQUE || this._transparencyMode === E.MATERIAL_ALPHATEST;\n          }, enumerable: !1, configurable: !0 }), E.prototype.needAlphaBlending = function() {\n            return !this._disableAlphaBlending && this.alpha < 1;\n          }, E.prototype.needAlphaBlendingForMesh = function(g) {\n            return !(this._disableAlphaBlending && g.visibility >= 1) && (this.needAlphaBlending() || g.visibility < 1 || g.hasVertexAlpha);\n          }, E.prototype.needAlphaTesting = function() {\n            return !!this._forceAlphaTest;\n          }, E.prototype._shouldTurnAlphaTestOn = function(g) {\n            return !this.needAlphaBlendingForMesh(g) && this.needAlphaTesting();\n          }, E.prototype.getAlphaTestTexture = function() {\n            return null;\n          }, E.prototype.markDirty = function() {\n            for (var g = 0, l = this.getScene().meshes; g < l.length; g++) {\n              var h = l[g];\n              if (h.subMeshes)\n                for (var v = 0, b = h.subMeshes; v < b.length; v++) {\n                  var D = b[v];\n                  D.getMaterial() === this && D.effect && (D.effect._wasPreviouslyReady = !1);\n                }\n            }\n          }, E.prototype._preBind = function(g, l) {\n            l === void 0 && (l = null);\n            var h = this._scene.getEngine(), v = (l ?? this.sideOrientation) === E.ClockWiseSideOrientation;\n            return h.enableEffect(g || this._effect), h.setState(this.backFaceCulling, this.zOffset, !1, v), v;\n          }, E.prototype.bind = function(g, l) {\n          }, E.prototype.bindForSubMesh = function(g, l, h) {\n          }, E.prototype.bindOnlyWorldMatrix = function(g) {\n          }, E.prototype.bindSceneUniformBuffer = function(g, l) {\n            l.bindToEffect(g, \"Scene\");\n          }, E.prototype.bindView = function(g) {\n            this._useUBO ? this.bindSceneUniformBuffer(g, this.getScene().getSceneUniformBuffer()) : g.setMatrix(\"view\", this.getScene().getViewMatrix());\n          }, E.prototype.bindViewProjection = function(g) {\n            this._useUBO ? this.bindSceneUniformBuffer(g, this.getScene().getSceneUniformBuffer()) : g.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix());\n          }, E.prototype._afterBind = function(g) {\n            if (this._scene._cachedMaterial = this, this._scene._cachedVisibility = g ? g.visibility : 1, this._onBindObservable && g && this._onBindObservable.notifyObservers(g), this.disableDepthWrite) {\n              var l = this._scene.getEngine();\n              this._cachedDepthWriteState = l.getDepthWrite(), l.setDepthWrite(!1);\n            }\n            this.disableColorWrite && (l = this._scene.getEngine(), this._cachedColorWriteState = l.getColorWrite(), l.setColorWrite(!1)), this.depthFunction !== 0 && (l = this._scene.getEngine(), this._cachedDepthFunctionState = l.getDepthFunction() || 0, l.setDepthFunction(this.depthFunction));\n          }, E.prototype.unbind = function() {\n            this._onUnBindObservable && this._onUnBindObservable.notifyObservers(this), this.depthFunction !== 0 && this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState), this.disableDepthWrite && this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState), this.disableColorWrite && this._scene.getEngine().setColorWrite(this._cachedColorWriteState);\n          }, E.prototype.getActiveTextures = function() {\n            return [];\n          }, E.prototype.hasTexture = function(g) {\n            return !1;\n          }, E.prototype.clone = function(g) {\n            return null;\n          }, E.prototype.getBindedMeshes = function() {\n            var g = this;\n            if (this.meshMap) {\n              var l = new Array();\n              for (var h in this.meshMap) {\n                var v = this.meshMap[h];\n                v && l.push(v);\n              }\n              return l;\n            }\n            return this._scene.meshes.filter(function(b) {\n              return b.material === g;\n            });\n          }, E.prototype.forceCompilation = function(g, l, h, v) {\n            var b = this, D = Object(V.a)({ clipPlane: !1, useInstances: !1 }, h), w = this.getScene(), N = this.allowShaderHotSwapping;\n            this.allowShaderHotSwapping = !1;\n            var M = function() {\n              if (b._scene && b._scene.getEngine()) {\n                var U = w.clipPlane;\n                if (D.clipPlane && (w.clipPlane = new T.a(0, 0, 0, 1)), b._storeEffectOnSubMeshes) {\n                  var X = !0, j = null;\n                  if (g.subMeshes) {\n                    var ne = new O.a(0, 0, 0, 0, 0, g, void 0, !1, !1);\n                    ne._materialDefines && (ne._materialDefines._renderId = -1), b.isReadyForSubMesh(g, ne, D.useInstances) || (ne.effect && ne.effect.getCompilationError() && ne.effect.allFallbacksProcessed() ? j = ne.effect.getCompilationError() : (X = !1, setTimeout(M, 16)));\n                  }\n                  X && (b.allowShaderHotSwapping = N, j && v && v(j), l && l(b));\n                } else\n                  b.isReady() ? (b.allowShaderHotSwapping = N, l && l(b)) : setTimeout(M, 16);\n                D.clipPlane && (w.clipPlane = U);\n              }\n            };\n            M();\n          }, E.prototype.forceCompilationAsync = function(g, l) {\n            var h = this;\n            return new Promise(function(v, b) {\n              h.forceCompilation(g, function() {\n                v();\n              }, l, function(D) {\n                b(D);\n              });\n            });\n          }, E.prototype.markAsDirty = function(g) {\n            this.getScene().blockMaterialDirtyMechanism || (E._DirtyCallbackArray.length = 0, g & E.TextureDirtyFlag && E._DirtyCallbackArray.push(E._TextureDirtyCallBack), g & E.LightDirtyFlag && E._DirtyCallbackArray.push(E._LightsDirtyCallBack), g & E.FresnelDirtyFlag && E._DirtyCallbackArray.push(E._FresnelDirtyCallBack), g & E.AttributesDirtyFlag && E._DirtyCallbackArray.push(E._AttributeDirtyCallBack), g & E.MiscDirtyFlag && E._DirtyCallbackArray.push(E._MiscDirtyCallBack), g & E.PrePassDirtyFlag && E._DirtyCallbackArray.push(E._PrePassDirtyCallBack), E._DirtyCallbackArray.length && this._markAllSubMeshesAsDirty(E._RunDirtyCallBacks), this.getScene().resetCachedMaterial());\n          }, E.prototype._markAllSubMeshesAsDirty = function(g) {\n            if (!this.getScene().blockMaterialDirtyMechanism)\n              for (var l = 0, h = this.getScene().meshes; l < h.length; l++) {\n                var v = h[l];\n                if (v.subMeshes)\n                  for (var b = 0, D = v.subMeshes; b < D.length; b++) {\n                    var w = D[b];\n                    w.getMaterial() === this && w._materialDefines && g(w._materialDefines);\n                  }\n              }\n          }, E.prototype._markScenePrePassDirty = function() {\n            if (!this.getScene().blockMaterialDirtyMechanism) {\n              var g = this.getScene().enablePrePassRenderer();\n              g && g.markAsDirty();\n            }\n          }, E.prototype._markAllSubMeshesAsAllDirty = function() {\n            this._markAllSubMeshesAsDirty(E._AllDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsImageProcessingDirty = function() {\n            this._markAllSubMeshesAsDirty(E._ImageProcessingDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._markAllSubMeshesAsDirty(E._TextureDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsFresnelDirty = function() {\n            this._markAllSubMeshesAsDirty(E._FresnelDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function() {\n            this._markAllSubMeshesAsDirty(E._FresnelAndMiscDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsLightsDirty = function() {\n            this._markAllSubMeshesAsDirty(E._LightsDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsAttributesDirty = function() {\n            this._markAllSubMeshesAsDirty(E._AttributeDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsMiscDirty = function() {\n            this._markAllSubMeshesAsDirty(E._MiscDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsPrePassDirty = function() {\n            this._markAllSubMeshesAsDirty(E._MiscDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function() {\n            this._markAllSubMeshesAsDirty(E._TextureAndMiscDirtyCallBack);\n          }, E.prototype.setPrePassRenderer = function(g) {\n            return !1;\n          }, E.prototype.dispose = function(g, l, h) {\n            var v = this.getScene();\n            if (v.stopAnimation(this), v.freeProcessedMaterials(), v.removeMaterial(this), h !== !0)\n              if (this.meshMap)\n                for (var b in this.meshMap)\n                  (N = this.meshMap[b]) && (N.material = null, this.releaseVertexArrayObject(N, g));\n              else\n                for (var D = 0, w = v.meshes; D < w.length; D++) {\n                  var N;\n                  (N = w[D]).material !== this || N.sourceMesh || (N.material = null, this.releaseVertexArrayObject(N, g));\n                }\n            this._uniformBuffer.dispose(), g && this._effect && (this._storeEffectOnSubMeshes || this._effect.dispose(), this._effect = null), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._onBindObservable && this._onBindObservable.clear(), this._onUnBindObservable && this._onUnBindObservable.clear(), this._onEffectCreatedObservable && this._onEffectCreatedObservable.clear();\n          }, E.prototype.releaseVertexArrayObject = function(g, l) {\n            if (g.geometry) {\n              var h = g.geometry;\n              if (this._storeEffectOnSubMeshes)\n                for (var v = 0, b = g.subMeshes; v < b.length; v++) {\n                  var D = b[v];\n                  h._releaseVertexArrayObject(D._materialEffect), l && D._materialEffect && D._materialEffect.dispose();\n                }\n              else\n                h._releaseVertexArrayObject(this._effect);\n            }\n          }, E.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, E.Parse = function(g, l, h) {\n            if (g.customType) {\n              if (g.customType === \"BABYLON.PBRMaterial\" && g.overloadedAlbedo && (g.customType = \"BABYLON.LegacyPBRMaterial\", !BABYLON.LegacyPBRMaterial))\n                return c.a.Error(\"Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library.\"), null;\n            } else\n              g.customType = \"BABYLON.StandardMaterial\";\n            return C.b.Instantiate(g.customType).Parse(g, l, h);\n          }, E.TriangleFillMode = m.a.MATERIAL_TriangleFillMode, E.WireFrameFillMode = m.a.MATERIAL_WireFrameFillMode, E.PointFillMode = m.a.MATERIAL_PointFillMode, E.PointListDrawMode = m.a.MATERIAL_PointListDrawMode, E.LineListDrawMode = m.a.MATERIAL_LineListDrawMode, E.LineLoopDrawMode = m.a.MATERIAL_LineLoopDrawMode, E.LineStripDrawMode = m.a.MATERIAL_LineStripDrawMode, E.TriangleStripDrawMode = m.a.MATERIAL_TriangleStripDrawMode, E.TriangleFanDrawMode = m.a.MATERIAL_TriangleFanDrawMode, E.ClockWiseSideOrientation = m.a.MATERIAL_ClockWiseSideOrientation, E.CounterClockWiseSideOrientation = m.a.MATERIAL_CounterClockWiseSideOrientation, E.TextureDirtyFlag = m.a.MATERIAL_TextureDirtyFlag, E.LightDirtyFlag = m.a.MATERIAL_LightDirtyFlag, E.FresnelDirtyFlag = m.a.MATERIAL_FresnelDirtyFlag, E.AttributesDirtyFlag = m.a.MATERIAL_AttributesDirtyFlag, E.MiscDirtyFlag = m.a.MATERIAL_MiscDirtyFlag, E.PrePassDirtyFlag = m.a.MATERIAL_PrePassDirtyFlag, E.AllDirtyFlag = m.a.MATERIAL_AllDirtyFlag, E.MATERIAL_OPAQUE = 0, E.MATERIAL_ALPHATEST = 1, E.MATERIAL_ALPHABLEND = 2, E.MATERIAL_ALPHATESTANDBLEND = 3, E.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0, E.MATERIAL_NORMALBLENDMETHOD_RNM = 1, E._AllDirtyCallBack = function(g) {\n            return g.markAllAsDirty();\n          }, E._ImageProcessingDirtyCallBack = function(g) {\n            return g.markAsImageProcessingDirty();\n          }, E._TextureDirtyCallBack = function(g) {\n            return g.markAsTexturesDirty();\n          }, E._FresnelDirtyCallBack = function(g) {\n            return g.markAsFresnelDirty();\n          }, E._MiscDirtyCallBack = function(g) {\n            return g.markAsMiscDirty();\n          }, E._PrePassDirtyCallBack = function(g) {\n            return g.markAsPrePassDirty();\n          }, E._LightsDirtyCallBack = function(g) {\n            return g.markAsLightDirty();\n          }, E._AttributeDirtyCallBack = function(g) {\n            return g.markAsAttributesDirty();\n          }, E._FresnelAndMiscDirtyCallBack = function(g) {\n            E._FresnelDirtyCallBack(g), E._MiscDirtyCallBack(g);\n          }, E._TextureAndMiscDirtyCallBack = function(g) {\n            E._TextureDirtyCallBack(g), E._MiscDirtyCallBack(g);\n          }, E._DirtyCallbackArray = [], E._RunDirtyCallBacks = function(g) {\n            for (var l = 0, h = E._DirtyCallbackArray; l < h.length; l++)\n              (0, h[l])(g);\n          }, Object(V.c)([Object(_.c)()], E.prototype, \"id\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"uniqueId\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"name\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"checkReadyOnEveryCall\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"checkReadyOnlyOnce\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"state\", void 0), Object(V.c)([Object(_.c)(\"alpha\")], E.prototype, \"_alpha\", void 0), Object(V.c)([Object(_.c)(\"backFaceCulling\")], E.prototype, \"_backFaceCulling\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"sideOrientation\", void 0), Object(V.c)([Object(_.c)(\"alphaMode\")], E.prototype, \"_alphaMode\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"_needDepthPrePass\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"disableDepthWrite\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"disableColorWrite\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"forceDepthWrite\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"depthFunction\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"separateCullingPass\", void 0), Object(V.c)([Object(_.c)(\"fogEnabled\")], E.prototype, \"_fogEnabled\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"pointSize\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"zOffset\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"pointsCloud\", null), Object(V.c)([Object(_.c)()], E.prototype, \"fillMode\", null), Object(V.c)([Object(_.c)()], E.prototype, \"transparencyMode\", null), E;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return w;\n        });\n        var V = f(22), _ = f(5), C = f(21), u = f(6), I = f(141), O = f(142), x = f(143), m = f(2), c = f(27), T = f(8), S = f(38), E = function() {\n          function N() {\n          }\n          return N.prototype.postProcessor = function(M, U, X, j) {\n            return j.getCaps().drawBuffersExtension || (M = M.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g, \"\")), M;\n          }, N;\n        }(), g = f(118), l = f(88), h = f(144), v = f(70), b = f(74), D = function() {\n        }, w = function() {\n          function N(M, U, X, j) {\n            var ne = this;\n            j === void 0 && (j = !1), this.forcePOTTextures = !1, this.isFullscreen = !1, this.cullBackFaces = !0, this.renderEvenInBackground = !0, this.preventCacheWipeBetweenFrames = !1, this.validateShaderPrograms = !1, this.useReverseDepthBuffer = !1, this.disableUniformBuffers = !1, this._uniformBuffers = new Array(), this._webGLVersion = 1, this._windowIsBackground = !1, this._highPrecisionShadersAllowed = !0, this._badOS = !1, this._badDesktopOS = !1, this._renderingQueueLaunched = !1, this._activeRenderLoops = new Array(), this.onContextLostObservable = new u.c(), this.onContextRestoredObservable = new u.c(), this._contextWasLost = !1, this._doNotHandleContextLost = !1, this.disableVertexArrayObjects = !1, this._colorWrite = !0, this._colorWriteChanged = !0, this._depthCullingState = new I.a(), this._stencilState = new O.a(), this._alphaState = new x.a(), this._alphaMode = m.a.ALPHA_ADD, this._alphaEquation = m.a.ALPHA_DISABLE, this._internalTexturesCache = new Array(), this._activeChannel = 0, this._currentTextureChannel = -1, this._boundTexturesCache = {}, this._compiledEffects = {}, this._vertexAttribArraysEnabled = [], this._uintIndicesCurrentlySet = !1, this._currentBoundBuffer = new Array(), this._currentFramebuffer = null, this._dummyFramebuffer = null, this._currentBufferPointers = new Array(), this._currentInstanceLocations = new Array(), this._currentInstanceBuffers = new Array(), this._vaoRecordInProgress = !1, this._mustWipeVertexAttributes = !1, this._nextFreeTextureSlots = new Array(), this._maxSimultaneousTextures = 0, this._activeRequests = new Array(), this._transformTextureUrl = null, this.hostInformation = { isMobile: !1 }, this.premultipliedAlpha = !0, this.onBeforeTextureInitObservable = new u.c(), this._viewportCached = { x: 0, y: 0, z: 0, w: 0 }, this._unpackFlipYCached = null, this.enableUnpackFlipYCached = !0, this._getDepthStencilBuffer = function(W, q, he, ge, me, _e) {\n              var ye = ne._gl, Pe = ye.createRenderbuffer();\n              return ye.bindRenderbuffer(ye.RENDERBUFFER, Pe), he > 1 && ye.renderbufferStorageMultisample ? ye.renderbufferStorageMultisample(ye.RENDERBUFFER, he, me, W, q) : ye.renderbufferStorage(ye.RENDERBUFFER, ge, W, q), ye.framebufferRenderbuffer(ye.FRAMEBUFFER, _e, ye.RENDERBUFFER, Pe), ye.bindRenderbuffer(ye.RENDERBUFFER, null), Pe;\n            }, this._boundUniforms = {};\n            var te = null;\n            if (M) {\n              if (X = X || {}, b.a.SetMatrixPrecision(!!X.useHighPrecisionMatrix), M.getContext) {\n                if (te = M, this._renderingCanvas = te, U != null && (X.antialias = U), X.deterministicLockstep === void 0 && (X.deterministicLockstep = !1), X.lockstepMaxSteps === void 0 && (X.lockstepMaxSteps = 4), X.timeStep === void 0 && (X.timeStep = 1 / 60), X.preserveDrawingBuffer === void 0 && (X.preserveDrawingBuffer = !1), X.audioEngine === void 0 && (X.audioEngine = !0), X.stencil === void 0 && (X.stencil = !0), X.premultipliedAlpha === !1 && (this.premultipliedAlpha = !1), X.xrCompatible === void 0 && (X.xrCompatible = !0), this._doNotHandleContextLost = !!X.doNotHandleContextLost, navigator && navigator.userAgent) {\n                  var de = navigator.userAgent;\n                  this.hostInformation.isMobile = de.indexOf(\"Mobile\") !== -1;\n                  for (var pe = 0, ae = N.ExceptionList; pe < ae.length; pe++) {\n                    var ee = ae[pe], K = ee.key, $ = ee.targets;\n                    if (new RegExp(K).test(de)) {\n                      if (ee.capture && ee.captureConstraint) {\n                        var L = ee.capture, G = ee.captureConstraint, Q = new RegExp(L).exec(de);\n                        if (Q && Q.length > 0 && parseInt(Q[Q.length - 1]) >= G)\n                          continue;\n                      }\n                      for (var oe = 0, re = $; oe < re.length; oe++)\n                        switch (re[oe]) {\n                          case \"uniformBuffer\":\n                            this.disableUniformBuffers = !0;\n                            break;\n                          case \"vao\":\n                            this.disableVertexArrayObjects = !0;\n                        }\n                    }\n                  }\n                }\n                if (this._doNotHandleContextLost || (this._onContextLost = function(W) {\n                  W.preventDefault(), ne._contextWasLost = !0, T.a.Warn(\"WebGL context lost.\"), ne.onContextLostObservable.notifyObservers(ne);\n                }, this._onContextRestored = function() {\n                  setTimeout(function() {\n                    ne._initGLContext(), ne._rebuildEffects(), ne._rebuildInternalTextures(), ne._rebuildBuffers(), ne.wipeCaches(!0), T.a.Warn(\"WebGL context successfully restored.\"), ne.onContextRestoredObservable.notifyObservers(ne), ne._contextWasLost = !1;\n                  }, 0);\n                }, te.addEventListener(\"webglcontextlost\", this._onContextLost, !1), te.addEventListener(\"webglcontextrestored\", this._onContextRestored, !1), X.powerPreference = \"high-performance\"), !X.disableWebGL2Support)\n                  try {\n                    this._gl = te.getContext(\"webgl2\", X) || te.getContext(\"experimental-webgl2\", X), this._gl && (this._webGLVersion = 2, this._gl.deleteQuery || (this._webGLVersion = 1));\n                  } catch {\n                  }\n                if (!this._gl) {\n                  if (!te)\n                    throw new Error(\"The provided canvas is null or undefined.\");\n                  try {\n                    this._gl = te.getContext(\"webgl\", X) || te.getContext(\"experimental-webgl\", X);\n                  } catch {\n                    throw new Error(\"WebGL not supported\");\n                  }\n                }\n                if (!this._gl)\n                  throw new Error(\"WebGL not supported\");\n              } else {\n                this._gl = M, this._renderingCanvas = this._gl.canvas, this._gl.renderbufferStorageMultisample && (this._webGLVersion = 2);\n                var Y = this._gl.getContextAttributes();\n                Y && (X.stencil = Y.stencil);\n              }\n              this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), X.useHighPrecisionFloats !== void 0 && (this._highPrecisionShadersAllowed = X.useHighPrecisionFloats);\n              var k = S.a.IsWindowObjectExist() && window.devicePixelRatio || 1, H = X.limitDeviceRatio || k;\n              this._hardwareScalingLevel = j ? 1 / Math.min(H, k) : 1, this.resize(), this._isStencilEnable = !!X.stencil, this._initGLContext();\n              for (var Z = 0; Z < this._caps.maxVertexAttribs; Z++)\n                this._currentBufferPointers[Z] = new D();\n              this.webGLVersion > 1 ? this._shaderProcessor = new g.a() : this._shaderProcessor = new E(), this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent), this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), this._creationOptions = X, console.log(\"Babylon.js v\" + N.Version + \" - \" + this.description);\n            }\n          }\n          return Object.defineProperty(N, \"NpmPackage\", { get: function() {\n            return \"babylonjs@4.2.2\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N, \"Version\", { get: function() {\n            return \"4.2.2\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"description\", { get: function() {\n            var M = \"WebGL\" + this.webGLVersion;\n            return this._caps.parallelShaderCompile && (M += \" - Parallel shader compilation\"), M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N, \"ShadersRepository\", { get: function() {\n            return _.a.ShadersRepository;\n          }, set: function(M) {\n            _.a.ShadersRepository = M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"supportsUniformBuffers\", { get: function() {\n            return this.webGLVersion > 1 && !this.disableUniformBuffers;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"_shouldUseHighPrecisionShader\", { get: function() {\n            return !(!this._caps.highPrecisionShaderSupported || !this._highPrecisionShadersAllowed);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"needPOTTextures\", { get: function() {\n            return this._webGLVersion < 2 || this.forcePOTTextures;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"doNotHandleContextLost\", { get: function() {\n            return this._doNotHandleContextLost;\n          }, set: function(M) {\n            this._doNotHandleContextLost = M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"_supportsHardwareTextureRescaling\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"framebufferDimensionsObject\", { set: function(M) {\n            this._framebufferDimensionsObject = M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"currentViewport\", { get: function() {\n            return this._cachedViewport;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyTexture\", { get: function() {\n            return this._emptyTexture || (this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, m.a.TEXTUREFORMAT_RGBA, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyTexture3D\", { get: function() {\n            return this._emptyTexture3D || (this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, m.a.TEXTUREFORMAT_RGBA, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture3D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyTexture2DArray\", { get: function() {\n            return this._emptyTexture2DArray || (this._emptyTexture2DArray = this.createRawTexture2DArray(new Uint8Array(4), 1, 1, 1, m.a.TEXTUREFORMAT_RGBA, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture2DArray;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyCubeTexture\", { get: function() {\n            if (!this._emptyCubeTexture) {\n              var M = new Uint8Array(4), U = [M, M, M, M, M, M];\n              this._emptyCubeTexture = this.createRawCubeTexture(U, 1, m.a.TEXTUREFORMAT_RGBA, m.a.TEXTURETYPE_UNSIGNED_INT, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n            return this._emptyCubeTexture;\n          }, enumerable: !1, configurable: !0 }), N.prototype._rebuildInternalTextures = function() {\n            for (var M = 0, U = this._internalTexturesCache.slice(); M < U.length; M++)\n              U[M]._rebuild();\n          }, N.prototype._rebuildEffects = function() {\n            for (var M in this._compiledEffects)\n              this._compiledEffects[M]._prepareEffect();\n            _.a.ResetCache();\n          }, N.prototype.areAllEffectsReady = function() {\n            for (var M in this._compiledEffects)\n              if (!this._compiledEffects[M].isReady())\n                return !1;\n            return !0;\n          }, N.prototype._rebuildBuffers = function() {\n            for (var M = 0, U = this._uniformBuffers; M < U.length; M++)\n              U[M]._rebuild();\n          }, N.prototype._initGLContext = function() {\n            this._caps = { maxTexturesImageUnits: this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS), maxCombinedTexturesImageUnits: this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS), maxVertexTextureImageUnits: this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), maxTextureSize: this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE), maxSamples: this._webGLVersion > 1 ? this._gl.getParameter(this._gl.MAX_SAMPLES) : 1, maxCubemapTextureSize: this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE), maxRenderTextureSize: this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE), maxVertexAttribs: this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS), maxVaryingVectors: this._gl.getParameter(this._gl.MAX_VARYING_VECTORS), maxFragmentUniformVectors: this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS), maxVertexUniformVectors: this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS), parallelShaderCompile: this._gl.getExtension(\"KHR_parallel_shader_compile\"), standardDerivatives: this._webGLVersion > 1 || this._gl.getExtension(\"OES_standard_derivatives\") !== null, maxAnisotropy: 1, astc: this._gl.getExtension(\"WEBGL_compressed_texture_astc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_astc\"), bptc: this._gl.getExtension(\"EXT_texture_compression_bptc\") || this._gl.getExtension(\"WEBKIT_EXT_texture_compression_bptc\"), s3tc: this._gl.getExtension(\"WEBGL_compressed_texture_s3tc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\"), pvrtc: this._gl.getExtension(\"WEBGL_compressed_texture_pvrtc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\"), etc1: this._gl.getExtension(\"WEBGL_compressed_texture_etc1\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_etc1\"), etc2: this._gl.getExtension(\"WEBGL_compressed_texture_etc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_etc\") || this._gl.getExtension(\"WEBGL_compressed_texture_es3_0\"), textureAnisotropicFilterExtension: this._gl.getExtension(\"EXT_texture_filter_anisotropic\") || this._gl.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\") || this._gl.getExtension(\"MOZ_EXT_texture_filter_anisotropic\"), uintIndices: this._webGLVersion > 1 || this._gl.getExtension(\"OES_element_index_uint\") !== null, fragmentDepthSupported: this._webGLVersion > 1 || this._gl.getExtension(\"EXT_frag_depth\") !== null, highPrecisionShaderSupported: !1, timerQuery: this._gl.getExtension(\"EXT_disjoint_timer_query_webgl2\") || this._gl.getExtension(\"EXT_disjoint_timer_query\"), canUseTimestampForTimerQuery: !1, drawBuffersExtension: !1, maxMSAASamples: 1, colorBufferFloat: this._webGLVersion > 1 && this._gl.getExtension(\"EXT_color_buffer_float\"), textureFloat: !!(this._webGLVersion > 1 || this._gl.getExtension(\"OES_texture_float\")), textureHalfFloat: !!(this._webGLVersion > 1 || this._gl.getExtension(\"OES_texture_half_float\")), textureHalfFloatRender: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloatLinearFiltering: !1, vertexArrayObject: !1, instancedArrays: !1, textureLOD: !!(this._webGLVersion > 1 || this._gl.getExtension(\"EXT_shader_texture_lod\")), blendMinMax: !1, multiview: this._gl.getExtension(\"OVR_multiview2\"), oculusMultiview: this._gl.getExtension(\"OCULUS_multiview\"), depthTextureExtension: !1 }, this._glVersion = this._gl.getParameter(this._gl.VERSION);\n            var M = this._gl.getExtension(\"WEBGL_debug_renderer_info\");\n            if (M != null && (this._glRenderer = this._gl.getParameter(M.UNMASKED_RENDERER_WEBGL), this._glVendor = this._gl.getParameter(M.UNMASKED_VENDOR_WEBGL)), this._glVendor || (this._glVendor = \"Unknown vendor\"), this._glRenderer || (this._glRenderer = \"Unknown renderer\"), this._gl.HALF_FLOAT_OES !== 36193 && (this._gl.HALF_FLOAT_OES = 36193), this._gl.RGBA16F !== 34842 && (this._gl.RGBA16F = 34842), this._gl.RGBA32F !== 34836 && (this._gl.RGBA32F = 34836), this._gl.DEPTH24_STENCIL8 !== 35056 && (this._gl.DEPTH24_STENCIL8 = 35056), this._caps.timerQuery && (this._webGLVersion === 1 && (this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)), this._caps.canUseTimestampForTimerQuery = this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT) > 0), this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0, this._caps.textureFloatLinearFiltering = !(!this._caps.textureFloat || !this._gl.getExtension(\"OES_texture_float_linear\")), this._caps.textureFloatRender = !(!this._caps.textureFloat || !this._canRenderToFloatFramebuffer()), this._caps.textureHalfFloatLinearFiltering = !!(this._webGLVersion > 1 || this._caps.textureHalfFloat && this._gl.getExtension(\"OES_texture_half_float_linear\")), this._webGLVersion > 1 && this._gl.HALF_FLOAT_OES !== 5131 && (this._gl.HALF_FLOAT_OES = 5131), this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer(), this._webGLVersion > 1)\n              this._caps.drawBuffersExtension = !0, this._caps.maxMSAASamples = this._gl.getParameter(this._gl.MAX_SAMPLES);\n            else {\n              var U = this._gl.getExtension(\"WEBGL_draw_buffers\");\n              if (U !== null) {\n                this._caps.drawBuffersExtension = !0, this._gl.drawBuffers = U.drawBuffersWEBGL.bind(U), this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;\n                for (var X = 0; X < 16; X++)\n                  this._gl[\"COLOR_ATTACHMENT\" + X + \"_WEBGL\"] = U[\"COLOR_ATTACHMENT\" + X + \"_WEBGL\"];\n              }\n            }\n            if (this._webGLVersion > 1)\n              this._caps.depthTextureExtension = !0;\n            else {\n              var j = this._gl.getExtension(\"WEBGL_depth_texture\");\n              j != null && (this._caps.depthTextureExtension = !0, this._gl.UNSIGNED_INT_24_8 = j.UNSIGNED_INT_24_8_WEBGL);\n            }\n            if (this.disableVertexArrayObjects)\n              this._caps.vertexArrayObject = !1;\n            else if (this._webGLVersion > 1)\n              this._caps.vertexArrayObject = !0;\n            else {\n              var ne = this._gl.getExtension(\"OES_vertex_array_object\");\n              ne != null && (this._caps.vertexArrayObject = !0, this._gl.createVertexArray = ne.createVertexArrayOES.bind(ne), this._gl.bindVertexArray = ne.bindVertexArrayOES.bind(ne), this._gl.deleteVertexArray = ne.deleteVertexArrayOES.bind(ne));\n            }\n            if (this._webGLVersion > 1)\n              this._caps.instancedArrays = !0;\n            else {\n              var te = this._gl.getExtension(\"ANGLE_instanced_arrays\");\n              te != null ? (this._caps.instancedArrays = !0, this._gl.drawArraysInstanced = te.drawArraysInstancedANGLE.bind(te), this._gl.drawElementsInstanced = te.drawElementsInstancedANGLE.bind(te), this._gl.vertexAttribDivisor = te.vertexAttribDivisorANGLE.bind(te)) : this._caps.instancedArrays = !1;\n            }\n            if (this._gl.getShaderPrecisionFormat) {\n              var de = this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER, this._gl.HIGH_FLOAT), pe = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);\n              de && pe && (this._caps.highPrecisionShaderSupported = de.precision !== 0 && pe.precision !== 0);\n            }\n            if (this._webGLVersion > 1)\n              this._caps.blendMinMax = !0;\n            else {\n              var ae = this._gl.getExtension(\"EXT_blend_minmax\");\n              ae != null && (this._caps.blendMinMax = !0, this._gl.MAX = ae.MAX_EXT, this._gl.MIN = ae.MIN_EXT);\n            }\n            this._depthCullingState.depthTest = !0, this._depthCullingState.depthFunc = this._gl.LEQUAL, this._depthCullingState.depthMask = !0, this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits;\n            for (var ee = 0; ee < this._maxSimultaneousTextures; ee++)\n              this._nextFreeTextureSlots.push(ee);\n          }, Object.defineProperty(N.prototype, \"webGLVersion\", { get: function() {\n            return this._webGLVersion;\n          }, enumerable: !1, configurable: !0 }), N.prototype.getClassName = function() {\n            return \"ThinEngine\";\n          }, Object.defineProperty(N.prototype, \"isStencilEnable\", { get: function() {\n            return this._isStencilEnable;\n          }, enumerable: !1, configurable: !0 }), N.prototype._prepareWorkingCanvas = function() {\n            if (!this._workingCanvas) {\n              this._workingCanvas = v.a.CreateCanvas(1, 1);\n              var M = this._workingCanvas.getContext(\"2d\");\n              M && (this._workingContext = M);\n            }\n          }, N.prototype.resetTextureCache = function() {\n            for (var M in this._boundTexturesCache)\n              this._boundTexturesCache.hasOwnProperty(M) && (this._boundTexturesCache[M] = null);\n            this._currentTextureChannel = -1;\n          }, N.prototype.getGlInfo = function() {\n            return { vendor: this._glVendor, renderer: this._glRenderer, version: this._glVersion };\n          }, N.prototype.setHardwareScalingLevel = function(M) {\n            this._hardwareScalingLevel = M, this.resize();\n          }, N.prototype.getHardwareScalingLevel = function() {\n            return this._hardwareScalingLevel;\n          }, N.prototype.getLoadedTexturesCache = function() {\n            return this._internalTexturesCache;\n          }, N.prototype.getCaps = function() {\n            return this._caps;\n          }, N.prototype.stopRenderLoop = function(M) {\n            if (M) {\n              var U = this._activeRenderLoops.indexOf(M);\n              U >= 0 && this._activeRenderLoops.splice(U, 1);\n            } else\n              this._activeRenderLoops = [];\n          }, N.prototype._renderLoop = function() {\n            if (!this._contextWasLost) {\n              var M = !0;\n              if (!this.renderEvenInBackground && this._windowIsBackground && (M = !1), M) {\n                this.beginFrame();\n                for (var U = 0; U < this._activeRenderLoops.length; U++)\n                  (0, this._activeRenderLoops[U])();\n                this.endFrame();\n              }\n            }\n            this._activeRenderLoops.length > 0 ? this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;\n          }, N.prototype.getRenderingCanvas = function() {\n            return this._renderingCanvas;\n          }, N.prototype.getHostWindow = function() {\n            return S.a.IsWindowObjectExist() ? this._renderingCanvas && this._renderingCanvas.ownerDocument && this._renderingCanvas.ownerDocument.defaultView ? this._renderingCanvas.ownerDocument.defaultView : window : null;\n          }, N.prototype.getRenderWidth = function(M) {\n            return M === void 0 && (M = !1), !M && this._currentRenderTarget ? this._currentRenderTarget.width : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferWidth : this._gl.drawingBufferWidth;\n          }, N.prototype.getRenderHeight = function(M) {\n            return M === void 0 && (M = !1), !M && this._currentRenderTarget ? this._currentRenderTarget.height : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferHeight : this._gl.drawingBufferHeight;\n          }, N.prototype._queueNewFrame = function(M, U) {\n            return N.QueueNewFrame(M, U);\n          }, N.prototype.runRenderLoop = function(M) {\n            this._activeRenderLoops.indexOf(M) === -1 && (this._activeRenderLoops.push(M), this._renderingQueueLaunched || (this._renderingQueueLaunched = !0, this._boundRenderFunction = this._renderLoop.bind(this), this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow())));\n          }, N.prototype.clear = function(M, U, X, j) {\n            j === void 0 && (j = !1), this.applyStates();\n            var ne = 0;\n            U && M && (this._gl.clearColor(M.r, M.g, M.b, M.a !== void 0 ? M.a : 1), ne |= this._gl.COLOR_BUFFER_BIT), X && (this.useReverseDepthBuffer ? (this._depthCullingState.depthFunc = this._gl.GREATER, this._gl.clearDepth(0)) : this._gl.clearDepth(1), ne |= this._gl.DEPTH_BUFFER_BIT), j && (this._gl.clearStencil(0), ne |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(ne);\n          }, N.prototype._viewport = function(M, U, X, j) {\n            M === this._viewportCached.x && U === this._viewportCached.y && X === this._viewportCached.z && j === this._viewportCached.w || (this._viewportCached.x = M, this._viewportCached.y = U, this._viewportCached.z = X, this._viewportCached.w = j, this._gl.viewport(M, U, X, j));\n          }, N.prototype.setViewport = function(M, U, X) {\n            var j = U || this.getRenderWidth(), ne = X || this.getRenderHeight(), te = M.x || 0, de = M.y || 0;\n            this._cachedViewport = M, this._viewport(te * j, de * ne, j * M.width, ne * M.height);\n          }, N.prototype.beginFrame = function() {\n          }, N.prototype.endFrame = function() {\n            this._badOS && this.flushFramebuffer();\n          }, N.prototype.resize = function() {\n            var M, U;\n            S.a.IsWindowObjectExist() ? (M = this._renderingCanvas ? this._renderingCanvas.clientWidth || this._renderingCanvas.width : window.innerWidth, U = this._renderingCanvas ? this._renderingCanvas.clientHeight || this._renderingCanvas.height : window.innerHeight) : (M = this._renderingCanvas ? this._renderingCanvas.width : 100, U = this._renderingCanvas ? this._renderingCanvas.height : 100), this.setSize(M / this._hardwareScalingLevel, U / this._hardwareScalingLevel);\n          }, N.prototype.setSize = function(M, U) {\n            return !!this._renderingCanvas && (M |= 0, U |= 0, (this._renderingCanvas.width !== M || this._renderingCanvas.height !== U) && (this._renderingCanvas.width = M, this._renderingCanvas.height = U, !0));\n          }, N.prototype.bindFramebuffer = function(M, U, X, j, ne, te, de) {\n            U === void 0 && (U = 0), te === void 0 && (te = 0), de === void 0 && (de = 0), this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = M, this._bindUnboundFramebuffer(M._MSAAFramebuffer ? M._MSAAFramebuffer : M._framebuffer);\n            var pe = this._gl;\n            M.is2DArray ? pe.framebufferTextureLayer(pe.FRAMEBUFFER, pe.COLOR_ATTACHMENT0, M._webGLTexture, te, de) : M.isCube && pe.framebufferTexture2D(pe.FRAMEBUFFER, pe.COLOR_ATTACHMENT0, pe.TEXTURE_CUBE_MAP_POSITIVE_X + U, M._webGLTexture, te);\n            var ae = M._depthStencilTexture;\n            if (ae) {\n              var ee = ae._generateStencilBuffer ? pe.DEPTH_STENCIL_ATTACHMENT : pe.DEPTH_ATTACHMENT;\n              M.is2DArray ? pe.framebufferTextureLayer(pe.FRAMEBUFFER, ee, ae._webGLTexture, te, de) : M.isCube ? pe.framebufferTexture2D(pe.FRAMEBUFFER, ee, pe.TEXTURE_CUBE_MAP_POSITIVE_X + U, ae._webGLTexture, te) : pe.framebufferTexture2D(pe.FRAMEBUFFER, ee, pe.TEXTURE_2D, ae._webGLTexture, te);\n            }\n            this._cachedViewport && !ne ? this.setViewport(this._cachedViewport, X, j) : (X || (X = M.width, te && (X /= Math.pow(2, te))), j || (j = M.height, te && (j /= Math.pow(2, te))), this._viewport(0, 0, X, j)), this.wipeCaches();\n          }, N.prototype._bindUnboundFramebuffer = function(M) {\n            this._currentFramebuffer !== M && (this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, M), this._currentFramebuffer = M);\n          }, N.prototype.unBindFramebuffer = function(M, U, X) {\n            U === void 0 && (U = !1), this._currentRenderTarget = null;\n            var j = this._gl;\n            if (M._MSAAFramebuffer) {\n              if (M._textureArray)\n                return void this.unBindMultiColorAttachmentFramebuffer(M._textureArray, U, X);\n              j.bindFramebuffer(j.READ_FRAMEBUFFER, M._MSAAFramebuffer), j.bindFramebuffer(j.DRAW_FRAMEBUFFER, M._framebuffer), j.blitFramebuffer(0, 0, M.width, M.height, 0, 0, M.width, M.height, j.COLOR_BUFFER_BIT, j.NEAREST);\n            }\n            !M.generateMipMaps || U || M.isCube || (this._bindTextureDirectly(j.TEXTURE_2D, M, !0), j.generateMipmap(j.TEXTURE_2D), this._bindTextureDirectly(j.TEXTURE_2D, null)), X && (M._MSAAFramebuffer && this._bindUnboundFramebuffer(M._framebuffer), X()), this._bindUnboundFramebuffer(null);\n          }, N.prototype.flushFramebuffer = function() {\n            this._gl.flush();\n          }, N.prototype.restoreDefaultFramebuffer = function() {\n            this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this._bindUnboundFramebuffer(null), this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches();\n          }, N.prototype._resetVertexBufferBinding = function() {\n            this.bindArrayBuffer(null), this._cachedVertexBuffers = null;\n          }, N.prototype.createVertexBuffer = function(M) {\n            return this._createVertexBuffer(M, this._gl.STATIC_DRAW);\n          }, N.prototype._createVertexBuffer = function(M, U) {\n            var X = this._gl.createBuffer();\n            if (!X)\n              throw new Error(\"Unable to create vertex buffer\");\n            var j = new l.a(X);\n            return this.bindArrayBuffer(j), M instanceof Array ? this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(M), this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.ARRAY_BUFFER, M, this._gl.STATIC_DRAW), this._resetVertexBufferBinding(), j.references = 1, j;\n          }, N.prototype.createDynamicVertexBuffer = function(M) {\n            return this._createVertexBuffer(M, this._gl.DYNAMIC_DRAW);\n          }, N.prototype._resetIndexBufferBinding = function() {\n            this.bindIndexBuffer(null), this._cachedIndexBuffer = null;\n          }, N.prototype.createIndexBuffer = function(M, U) {\n            var X = this._gl.createBuffer(), j = new l.a(X);\n            if (!X)\n              throw new Error(\"Unable to create index buffer\");\n            this.bindIndexBuffer(j);\n            var ne = this._normalizeIndexData(M);\n            return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, ne, U ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW), this._resetIndexBufferBinding(), j.references = 1, j.is32Bits = ne.BYTES_PER_ELEMENT === 4, j;\n          }, N.prototype._normalizeIndexData = function(M) {\n            if (M instanceof Uint16Array)\n              return M;\n            if (this._caps.uintIndices) {\n              if (M instanceof Uint32Array)\n                return M;\n              for (var U = 0; U < M.length; U++)\n                if (M[U] >= 65535)\n                  return new Uint32Array(M);\n              return new Uint16Array(M);\n            }\n            return new Uint16Array(M);\n          }, N.prototype.bindArrayBuffer = function(M) {\n            this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.bindBuffer(M, this._gl.ARRAY_BUFFER);\n          }, N.prototype.bindUniformBlock = function(M, U, X) {\n            var j = M.program, ne = this._gl.getUniformBlockIndex(j, U);\n            this._gl.uniformBlockBinding(j, ne, X);\n          }, N.prototype.bindIndexBuffer = function(M) {\n            this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.bindBuffer(M, this._gl.ELEMENT_ARRAY_BUFFER);\n          }, N.prototype.bindBuffer = function(M, U) {\n            (this._vaoRecordInProgress || this._currentBoundBuffer[U] !== M) && (this._gl.bindBuffer(U, M ? M.underlyingResource : null), this._currentBoundBuffer[U] = M);\n          }, N.prototype.updateArrayBuffer = function(M) {\n            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, M);\n          }, N.prototype._vertexAttribPointer = function(M, U, X, j, ne, te, de) {\n            var pe = this._currentBufferPointers[U];\n            if (pe) {\n              var ae = !1;\n              pe.active ? (pe.buffer !== M && (pe.buffer = M, ae = !0), pe.size !== X && (pe.size = X, ae = !0), pe.type !== j && (pe.type = j, ae = !0), pe.normalized !== ne && (pe.normalized = ne, ae = !0), pe.stride !== te && (pe.stride = te, ae = !0), pe.offset !== de && (pe.offset = de, ae = !0)) : (ae = !0, pe.active = !0, pe.index = U, pe.size = X, pe.type = j, pe.normalized = ne, pe.stride = te, pe.offset = de, pe.buffer = M), (ae || this._vaoRecordInProgress) && (this.bindArrayBuffer(M), this._gl.vertexAttribPointer(U, X, j, ne, te, de));\n            }\n          }, N.prototype._bindIndexBufferWithCache = function(M) {\n            M != null && this._cachedIndexBuffer !== M && (this._cachedIndexBuffer = M, this.bindIndexBuffer(M), this._uintIndicesCurrentlySet = M.is32Bits);\n          }, N.prototype._bindVertexBuffersAttributes = function(M, U) {\n            var X = U.getAttributesNames();\n            this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.unbindAllAttributes();\n            for (var j = 0; j < X.length; j++) {\n              var ne = U.getAttributeLocation(j);\n              if (ne >= 0) {\n                var te = M[X[j]];\n                if (!te)\n                  continue;\n                this._gl.enableVertexAttribArray(ne), this._vaoRecordInProgress || (this._vertexAttribArraysEnabled[ne] = !0);\n                var de = te.getBuffer();\n                de && (this._vertexAttribPointer(de, ne, te.getSize(), te.type, te.normalized, te.byteStride, te.byteOffset), te.getIsInstanced() && (this._gl.vertexAttribDivisor(ne, te.getInstanceDivisor()), this._vaoRecordInProgress || (this._currentInstanceLocations.push(ne), this._currentInstanceBuffers.push(de))));\n              }\n            }\n          }, N.prototype.recordVertexArrayObject = function(M, U, X) {\n            var j = this._gl.createVertexArray();\n            return this._vaoRecordInProgress = !0, this._gl.bindVertexArray(j), this._mustWipeVertexAttributes = !0, this._bindVertexBuffersAttributes(M, X), this.bindIndexBuffer(U), this._vaoRecordInProgress = !1, this._gl.bindVertexArray(null), j;\n          }, N.prototype.bindVertexArrayObject = function(M, U) {\n            this._cachedVertexArrayObject !== M && (this._cachedVertexArrayObject = M, this._gl.bindVertexArray(M), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._uintIndicesCurrentlySet = U != null && U.is32Bits, this._mustWipeVertexAttributes = !0);\n          }, N.prototype.bindBuffersDirectly = function(M, U, X, j, ne) {\n            if (this._cachedVertexBuffers !== M || this._cachedEffectForVertexBuffers !== ne) {\n              this._cachedVertexBuffers = M, this._cachedEffectForVertexBuffers = ne;\n              var te = ne.getAttributesCount();\n              this._unbindVertexArrayObject(), this.unbindAllAttributes();\n              for (var de = 0, pe = 0; pe < te; pe++)\n                if (pe < X.length) {\n                  var ae = ne.getAttributeLocation(pe);\n                  ae >= 0 && (this._gl.enableVertexAttribArray(ae), this._vertexAttribArraysEnabled[ae] = !0, this._vertexAttribPointer(M, ae, X[pe], this._gl.FLOAT, !1, j, de)), de += 4 * X[pe];\n                }\n            }\n            this._bindIndexBufferWithCache(U);\n          }, N.prototype._unbindVertexArrayObject = function() {\n            this._cachedVertexArrayObject && (this._cachedVertexArrayObject = null, this._gl.bindVertexArray(null));\n          }, N.prototype.bindBuffers = function(M, U, X) {\n            this._cachedVertexBuffers === M && this._cachedEffectForVertexBuffers === X || (this._cachedVertexBuffers = M, this._cachedEffectForVertexBuffers = X, this._bindVertexBuffersAttributes(M, X)), this._bindIndexBufferWithCache(U);\n          }, N.prototype.unbindInstanceAttributes = function() {\n            for (var M, U = 0, X = this._currentInstanceLocations.length; U < X; U++) {\n              var j = this._currentInstanceBuffers[U];\n              M != j && j.references && (M = j, this.bindArrayBuffer(j));\n              var ne = this._currentInstanceLocations[U];\n              this._gl.vertexAttribDivisor(ne, 0);\n            }\n            this._currentInstanceBuffers.length = 0, this._currentInstanceLocations.length = 0;\n          }, N.prototype.releaseVertexArrayObject = function(M) {\n            this._gl.deleteVertexArray(M);\n          }, N.prototype._releaseBuffer = function(M) {\n            return M.references--, M.references === 0 && (this._deleteBuffer(M), !0);\n          }, N.prototype._deleteBuffer = function(M) {\n            this._gl.deleteBuffer(M.underlyingResource);\n          }, N.prototype.updateAndBindInstancesBuffer = function(M, U, X) {\n            if (this.bindArrayBuffer(M), U && this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, U), X[0].index !== void 0)\n              this.bindInstancesBuffer(M, X, !0);\n            else\n              for (var j = 0; j < 4; j++) {\n                var ne = X[j];\n                this._vertexAttribArraysEnabled[ne] || (this._gl.enableVertexAttribArray(ne), this._vertexAttribArraysEnabled[ne] = !0), this._vertexAttribPointer(M, ne, 4, this._gl.FLOAT, !1, 64, 16 * j), this._gl.vertexAttribDivisor(ne, 1), this._currentInstanceLocations.push(ne), this._currentInstanceBuffers.push(M);\n              }\n          }, N.prototype.bindInstancesBuffer = function(M, U, X) {\n            X === void 0 && (X = !0), this.bindArrayBuffer(M);\n            var j = 0;\n            if (X)\n              for (var ne = 0; ne < U.length; ne++)\n                j += 4 * (te = U[ne]).attributeSize;\n            for (ne = 0; ne < U.length; ne++) {\n              var te;\n              (te = U[ne]).index === void 0 && (te.index = this._currentEffect.getAttributeLocationByName(te.attributeName)), te.index < 0 || (this._vertexAttribArraysEnabled[te.index] || (this._gl.enableVertexAttribArray(te.index), this._vertexAttribArraysEnabled[te.index] = !0), this._vertexAttribPointer(M, te.index, te.attributeSize, te.attributeType || this._gl.FLOAT, te.normalized || !1, j, te.offset), this._gl.vertexAttribDivisor(te.index, te.divisor === void 0 ? 1 : te.divisor), this._currentInstanceLocations.push(te.index), this._currentInstanceBuffers.push(M));\n            }\n          }, N.prototype.disableInstanceAttributeByName = function(M) {\n            if (this._currentEffect) {\n              var U = this._currentEffect.getAttributeLocationByName(M);\n              this.disableInstanceAttribute(U);\n            }\n          }, N.prototype.disableInstanceAttribute = function(M) {\n            for (var U, X = !1; (U = this._currentInstanceLocations.indexOf(M)) !== -1; )\n              this._currentInstanceLocations.splice(U, 1), this._currentInstanceBuffers.splice(U, 1), X = !0, U = this._currentInstanceLocations.indexOf(M);\n            X && (this._gl.vertexAttribDivisor(M, 0), this.disableAttributeByIndex(M));\n          }, N.prototype.disableAttributeByIndex = function(M) {\n            this._gl.disableVertexAttribArray(M), this._vertexAttribArraysEnabled[M] = !1, this._currentBufferPointers[M].active = !1;\n          }, N.prototype.draw = function(M, U, X, j) {\n            this.drawElementsType(M ? m.a.MATERIAL_TriangleFillMode : m.a.MATERIAL_WireFrameFillMode, U, X, j);\n          }, N.prototype.drawPointClouds = function(M, U, X) {\n            this.drawArraysType(m.a.MATERIAL_PointFillMode, M, U, X);\n          }, N.prototype.drawUnIndexed = function(M, U, X, j) {\n            this.drawArraysType(M ? m.a.MATERIAL_TriangleFillMode : m.a.MATERIAL_WireFrameFillMode, U, X, j);\n          }, N.prototype.drawElementsType = function(M, U, X, j) {\n            this.applyStates(), this._reportDrawCall();\n            var ne = this._drawMode(M), te = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT, de = this._uintIndicesCurrentlySet ? 4 : 2;\n            j ? this._gl.drawElementsInstanced(ne, X, te, U * de, j) : this._gl.drawElements(ne, X, te, U * de);\n          }, N.prototype.drawArraysType = function(M, U, X, j) {\n            this.applyStates(), this._reportDrawCall();\n            var ne = this._drawMode(M);\n            j ? this._gl.drawArraysInstanced(ne, U, X, j) : this._gl.drawArrays(ne, U, X);\n          }, N.prototype._drawMode = function(M) {\n            switch (M) {\n              case m.a.MATERIAL_TriangleFillMode:\n                return this._gl.TRIANGLES;\n              case m.a.MATERIAL_PointFillMode:\n                return this._gl.POINTS;\n              case m.a.MATERIAL_WireFrameFillMode:\n                return this._gl.LINES;\n              case m.a.MATERIAL_PointListDrawMode:\n                return this._gl.POINTS;\n              case m.a.MATERIAL_LineListDrawMode:\n                return this._gl.LINES;\n              case m.a.MATERIAL_LineLoopDrawMode:\n                return this._gl.LINE_LOOP;\n              case m.a.MATERIAL_LineStripDrawMode:\n                return this._gl.LINE_STRIP;\n              case m.a.MATERIAL_TriangleStripDrawMode:\n                return this._gl.TRIANGLE_STRIP;\n              case m.a.MATERIAL_TriangleFanDrawMode:\n                return this._gl.TRIANGLE_FAN;\n              default:\n                return this._gl.TRIANGLES;\n            }\n          }, N.prototype._reportDrawCall = function() {\n          }, N.prototype._releaseEffect = function(M) {\n            this._compiledEffects[M._key] && (delete this._compiledEffects[M._key], this._deletePipelineContext(M.getPipelineContext()));\n          }, N.prototype._deletePipelineContext = function(M) {\n            var U = M;\n            U && U.program && (U.program.__SPECTOR_rebuildProgram = null, this._gl.deleteProgram(U.program));\n          }, N.prototype.createEffect = function(M, U, X, j, ne, te, de, pe, ae) {\n            var ee = (M.vertexElement || M.vertex || M.vertexToken || M.vertexSource || M) + \"+\" + (M.fragmentElement || M.fragment || M.fragmentToken || M.fragmentSource || M) + \"@\" + (ne || U.defines);\n            if (this._compiledEffects[ee]) {\n              var K = this._compiledEffects[ee];\n              return de && K.isReady() && de(K), K;\n            }\n            var $ = new _.a(M, U, X, j, this, ne, te, de, pe, ae);\n            return $._key = ee, this._compiledEffects[ee] = $, $;\n          }, N._ConcatenateShader = function(M, U, X) {\n            return X === void 0 && (X = \"\"), X + (U ? U + `\n` : \"\") + M;\n          }, N.prototype._compileShader = function(M, U, X, j) {\n            return this._compileRawShader(N._ConcatenateShader(M, X, j), U);\n          }, N.prototype._compileRawShader = function(M, U) {\n            var X = this._gl, j = X.createShader(U === \"vertex\" ? X.VERTEX_SHADER : X.FRAGMENT_SHADER);\n            if (!j)\n              throw new Error(\"Something went wrong while compile the shader.\");\n            return X.shaderSource(j, M), X.compileShader(j), j;\n          }, N.prototype._getShaderSource = function(M) {\n            return this._gl.getShaderSource(M);\n          }, N.prototype.createRawShaderProgram = function(M, U, X, j, ne) {\n            ne === void 0 && (ne = null), j = j || this._gl;\n            var te = this._compileRawShader(U, \"vertex\"), de = this._compileRawShader(X, \"fragment\");\n            return this._createShaderProgram(M, te, de, j, ne);\n          }, N.prototype.createShaderProgram = function(M, U, X, j, ne, te) {\n            te === void 0 && (te = null), ne = ne || this._gl;\n            var de = this._webGLVersion > 1 ? `#version 300 es\n#define WEBGL2 \n` : \"\", pe = this._compileShader(U, \"vertex\", j, de), ae = this._compileShader(X, \"fragment\", j, de);\n            return this._createShaderProgram(M, pe, ae, ne, te);\n          }, N.prototype.createPipelineContext = function() {\n            var M = new h.a();\n            return M.engine = this, this._caps.parallelShaderCompile && (M.isParallelCompiled = !0), M;\n          }, N.prototype._createShaderProgram = function(M, U, X, j, ne) {\n            var te = j.createProgram();\n            if (M.program = te, !te)\n              throw new Error(\"Unable to create program\");\n            return j.attachShader(te, U), j.attachShader(te, X), j.linkProgram(te), M.context = j, M.vertexShader = U, M.fragmentShader = X, M.isParallelCompiled || this._finalizePipelineContext(M), te;\n          }, N.prototype._finalizePipelineContext = function(M) {\n            var U = M.context, X = M.vertexShader, j = M.fragmentShader, ne = M.program;\n            if (!U.getProgramParameter(ne, U.LINK_STATUS)) {\n              var te, de;\n              if (!this._gl.getShaderParameter(X, this._gl.COMPILE_STATUS) && (te = this._gl.getShaderInfoLog(X)))\n                throw M.vertexCompilationError = te, new Error(\"VERTEX SHADER \" + te);\n              if (!this._gl.getShaderParameter(j, this._gl.COMPILE_STATUS) && (te = this._gl.getShaderInfoLog(j)))\n                throw M.fragmentCompilationError = te, new Error(\"FRAGMENT SHADER \" + te);\n              if (de = U.getProgramInfoLog(ne))\n                throw M.programLinkError = de, new Error(de);\n            }\n            if (this.validateShaderPrograms && (U.validateProgram(ne), !U.getProgramParameter(ne, U.VALIDATE_STATUS) && (de = U.getProgramInfoLog(ne))))\n              throw M.programValidationError = de, new Error(de);\n            U.deleteShader(X), U.deleteShader(j), M.vertexShader = void 0, M.fragmentShader = void 0, M.onCompiled && (M.onCompiled(), M.onCompiled = void 0);\n          }, N.prototype._preparePipelineContext = function(M, U, X, j, ne, te, de) {\n            var pe = M;\n            pe.program = j ? this.createRawShaderProgram(pe, U, X, void 0, de) : this.createShaderProgram(pe, U, X, te, void 0, de), pe.program.__SPECTOR_rebuildProgram = ne;\n          }, N.prototype._isRenderingStateCompiled = function(M) {\n            var U = M;\n            return !!this._gl.getProgramParameter(U.program, this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR) && (this._finalizePipelineContext(U), !0);\n          }, N.prototype._executeWhenRenderingStateIsCompiled = function(M, U) {\n            var X = M;\n            if (X.isParallelCompiled) {\n              var j = X.onCompiled;\n              X.onCompiled = j ? function() {\n                j(), U();\n              } : U;\n            } else\n              U();\n          }, N.prototype.getUniforms = function(M, U) {\n            for (var X = new Array(), j = M, ne = 0; ne < U.length; ne++)\n              X.push(this._gl.getUniformLocation(j.program, U[ne]));\n            return X;\n          }, N.prototype.getAttributes = function(M, U) {\n            for (var X = [], j = M, ne = 0; ne < U.length; ne++)\n              try {\n                X.push(this._gl.getAttribLocation(j.program, U[ne]));\n              } catch {\n                X.push(-1);\n              }\n            return X;\n          }, N.prototype.enableEffect = function(M) {\n            M && M !== this._currentEffect && (this.bindSamplers(M), this._currentEffect = M, M.onBind && M.onBind(M), M._onBindObservable && M._onBindObservable.notifyObservers(M));\n          }, N.prototype.setInt = function(M, U) {\n            return !!M && (this._gl.uniform1i(M, U), !0);\n          }, N.prototype.setIntArray = function(M, U) {\n            return !!M && (this._gl.uniform1iv(M, U), !0);\n          }, N.prototype.setIntArray2 = function(M, U) {\n            return !(!M || U.length % 2 != 0) && (this._gl.uniform2iv(M, U), !0);\n          }, N.prototype.setIntArray3 = function(M, U) {\n            return !(!M || U.length % 3 != 0) && (this._gl.uniform3iv(M, U), !0);\n          }, N.prototype.setIntArray4 = function(M, U) {\n            return !(!M || U.length % 4 != 0) && (this._gl.uniform4iv(M, U), !0);\n          }, N.prototype.setArray = function(M, U) {\n            return !!M && (this._gl.uniform1fv(M, U), !0);\n          }, N.prototype.setArray2 = function(M, U) {\n            return !(!M || U.length % 2 != 0) && (this._gl.uniform2fv(M, U), !0);\n          }, N.prototype.setArray3 = function(M, U) {\n            return !(!M || U.length % 3 != 0) && (this._gl.uniform3fv(M, U), !0);\n          }, N.prototype.setArray4 = function(M, U) {\n            return !(!M || U.length % 4 != 0) && (this._gl.uniform4fv(M, U), !0);\n          }, N.prototype.setMatrices = function(M, U) {\n            return !!M && (this._gl.uniformMatrix4fv(M, !1, U), !0);\n          }, N.prototype.setMatrix3x3 = function(M, U) {\n            return !!M && (this._gl.uniformMatrix3fv(M, !1, U), !0);\n          }, N.prototype.setMatrix2x2 = function(M, U) {\n            return !!M && (this._gl.uniformMatrix2fv(M, !1, U), !0);\n          }, N.prototype.setFloat = function(M, U) {\n            return !!M && (this._gl.uniform1f(M, U), !0);\n          }, N.prototype.setFloat2 = function(M, U, X) {\n            return !!M && (this._gl.uniform2f(M, U, X), !0);\n          }, N.prototype.setFloat3 = function(M, U, X, j) {\n            return !!M && (this._gl.uniform3f(M, U, X, j), !0);\n          }, N.prototype.setFloat4 = function(M, U, X, j, ne) {\n            return !!M && (this._gl.uniform4f(M, U, X, j, ne), !0);\n          }, N.prototype.applyStates = function() {\n            if (this._depthCullingState.apply(this._gl), this._stencilState.apply(this._gl), this._alphaState.apply(this._gl), this._colorWriteChanged) {\n              this._colorWriteChanged = !1;\n              var M = this._colorWrite;\n              this._gl.colorMask(M, M, M, M);\n            }\n          }, N.prototype.setColorWrite = function(M) {\n            M !== this._colorWrite && (this._colorWriteChanged = !0, this._colorWrite = M);\n          }, N.prototype.getColorWrite = function() {\n            return this._colorWrite;\n          }, Object.defineProperty(N.prototype, \"depthCullingState\", { get: function() {\n            return this._depthCullingState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"alphaState\", { get: function() {\n            return this._alphaState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"stencilState\", { get: function() {\n            return this._stencilState;\n          }, enumerable: !1, configurable: !0 }), N.prototype.clearInternalTexturesCache = function() {\n            this._internalTexturesCache = [];\n          }, N.prototype.wipeCaches = function(M) {\n            this.preventCacheWipeBetweenFrames && !M || (this._currentEffect = null, this._viewportCached.x = 0, this._viewportCached.y = 0, this._viewportCached.z = 0, this._viewportCached.w = 0, this._unbindVertexArrayObject(), M && (this._currentProgram = null, this.resetTextureCache(), this._stencilState.reset(), this._depthCullingState.reset(), this._depthCullingState.depthFunc = this._gl.LEQUAL, this._alphaState.reset(), this._alphaMode = m.a.ALPHA_ADD, this._alphaEquation = m.a.ALPHA_DISABLE, this._colorWrite = !0, this._colorWriteChanged = !0, this._unpackFlipYCached = null, this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), this._mustWipeVertexAttributes = !0, this.unbindAllAttributes()), this._resetVertexBufferBinding(), this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null, this.bindIndexBuffer(null));\n          }, N.prototype._getSamplingParameters = function(M, U) {\n            var X = this._gl, j = X.NEAREST, ne = X.NEAREST;\n            switch (M) {\n              case m.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST:\n                j = X.LINEAR, ne = U ? X.LINEAR_MIPMAP_NEAREST : X.LINEAR;\n                break;\n              case m.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR:\n                j = X.LINEAR, ne = U ? X.LINEAR_MIPMAP_LINEAR : X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR:\n                j = X.NEAREST, ne = U ? X.NEAREST_MIPMAP_LINEAR : X.NEAREST;\n                break;\n              case m.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST:\n                j = X.NEAREST, ne = U ? X.NEAREST_MIPMAP_NEAREST : X.NEAREST;\n                break;\n              case m.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST:\n                j = X.NEAREST, ne = U ? X.LINEAR_MIPMAP_NEAREST : X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR:\n                j = X.NEAREST, ne = U ? X.LINEAR_MIPMAP_LINEAR : X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_LINEAR:\n                j = X.NEAREST, ne = X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_NEAREST:\n                j = X.NEAREST, ne = X.NEAREST;\n                break;\n              case m.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST:\n                j = X.LINEAR, ne = U ? X.NEAREST_MIPMAP_NEAREST : X.NEAREST;\n                break;\n              case m.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR:\n                j = X.LINEAR, ne = U ? X.NEAREST_MIPMAP_LINEAR : X.NEAREST;\n                break;\n              case m.a.TEXTURE_LINEAR_LINEAR:\n                j = X.LINEAR, ne = X.LINEAR;\n                break;\n              case m.a.TEXTURE_LINEAR_NEAREST:\n                j = X.LINEAR, ne = X.NEAREST;\n            }\n            return { min: ne, mag: j };\n          }, N.prototype._createTexture = function() {\n            var M = this._gl.createTexture();\n            if (!M)\n              throw new Error(\"Unable to create texture\");\n            return M;\n          }, N.prototype.createTexture = function(M, U, X, j, ne, te, de, pe, ae, ee, K, $, L) {\n            var G = this;\n            ne === void 0 && (ne = m.a.TEXTURE_TRILINEAR_SAMPLINGMODE), te === void 0 && (te = null), de === void 0 && (de = null), pe === void 0 && (pe = null), ae === void 0 && (ae = null), ee === void 0 && (ee = null), K === void 0 && (K = null);\n            var Q = (M = M || \"\").substr(0, 5) === \"data:\", oe = M.substr(0, 5) === \"blob:\", re = Q && M.indexOf(\";base64,\") !== -1, Y = ae || new c.a(this, c.b.Url), k = M;\n            !this._transformTextureUrl || re || ae || pe || (M = this._transformTextureUrl(M)), k !== M && (Y._originalUrl = k);\n            var H = M.lastIndexOf(\".\"), Z = K || (H > -1 ? M.substring(H).toLowerCase() : \"\"), W = null;\n            Z.indexOf(\"?\") > -1 && (Z = Z.split(\"?\")[0]);\n            for (var q = 0, he = N._TextureLoaders; q < he.length; q++) {\n              var ge = he[q];\n              if (ge.canLoad(Z, $)) {\n                W = ge;\n                break;\n              }\n            }\n            j && j._addPendingData(Y), Y.url = M, Y.generateMipMaps = !U, Y.samplingMode = ne, Y.invertY = X, this._doNotHandleContextLost || (Y._buffer = pe);\n            var me = null;\n            te && !ae && (me = Y.onLoadedObservable.add(te)), ae || this._internalTexturesCache.push(Y);\n            var _e = function(be, Fe) {\n              j && j._removePendingData(Y), M === k ? (me && Y.onLoadedObservable.remove(me), V.a.UseFallbackTexture && G.createTexture(V.a.FallbackTexture, U, Y.invertY, j, ne, null, de, pe, Y), de && de((be || \"Unknown error\") + (V.a.UseFallbackTexture ? \" - Fallback texture was used\" : \"\"), Fe)) : (T.a.Warn(\"Failed to load \" + M + \", falling back to \" + k), G.createTexture(k, U, Y.invertY, j, ne, te, de, pe, Y, ee, K, $, L));\n            };\n            if (W) {\n              var ye = function(be) {\n                W.loadData(be, Y, function(Fe, ke, We, je, He, Qe) {\n                  Qe ? _e(\"TextureLoader failed to load data\") : G._prepareWebGLTexture(Y, j, Fe, ke, Y.invertY, !We, je, function() {\n                    return He(), !1;\n                  }, ne);\n                }, L);\n              };\n              pe ? pe instanceof ArrayBuffer ? ye(new Uint8Array(pe)) : ArrayBuffer.isView(pe) ? ye(pe) : de && de(\"Unable to load: only ArrayBuffer or ArrayBufferView is supported\", null) : this._loadFile(M, function(be) {\n                return ye(new Uint8Array(be));\n              }, void 0, j ? j.offlineProvider : void 0, !0, function(be, Fe) {\n                _e(\"Unable to load \" + (be && be.responseURL, Fe));\n              });\n            } else {\n              var Pe = function(be) {\n                oe && !G._doNotHandleContextLost && (Y._buffer = be), G._prepareWebGLTexture(Y, j, be.width, be.height, Y.invertY, U, !1, function(Fe, ke, We) {\n                  var je = G._gl, He = be.width === Fe && be.height === ke, Qe = ee ? G._getInternalFormat(ee) : Z === \".jpg\" ? je.RGB : je.RGBA;\n                  if (He)\n                    return je.texImage2D(je.TEXTURE_2D, 0, Qe, Qe, je.UNSIGNED_BYTE, be), !1;\n                  var Ge = G._caps.maxTextureSize;\n                  if (be.width > Ge || be.height > Ge || !G._supportsHardwareTextureRescaling)\n                    return G._prepareWorkingCanvas(), !(!G._workingCanvas || !G._workingContext) && (G._workingCanvas.width = Fe, G._workingCanvas.height = ke, G._workingContext.drawImage(be, 0, 0, be.width, be.height, 0, 0, Fe, ke), je.texImage2D(je.TEXTURE_2D, 0, Qe, Qe, je.UNSIGNED_BYTE, G._workingCanvas), Y.width = Fe, Y.height = ke, !1);\n                  var tt = new c.a(G, c.b.Temp);\n                  return G._bindTextureDirectly(je.TEXTURE_2D, tt, !0), je.texImage2D(je.TEXTURE_2D, 0, Qe, Qe, je.UNSIGNED_BYTE, be), G._rescaleTexture(tt, Y, j, Qe, function() {\n                    G._releaseTexture(tt), G._bindTextureDirectly(je.TEXTURE_2D, Y, !0), We();\n                  }), !0;\n                }, ne);\n              };\n              !Q || re ? pe && (pe.decoding || pe.close) ? Pe(pe) : N._FileToolsLoadImage(M, Pe, _e, j ? j.offlineProvider : null, $) : typeof pe == \"string\" || pe instanceof ArrayBuffer || ArrayBuffer.isView(pe) || pe instanceof Blob ? N._FileToolsLoadImage(pe, Pe, _e, j ? j.offlineProvider : null, $) : pe && Pe(pe);\n            }\n            return Y;\n          }, N._FileToolsLoadImage = function(M, U, X, j, ne) {\n            throw C.a.WarnImport(\"FileTools\");\n          }, N.prototype._rescaleTexture = function(M, U, X, j, ne) {\n          }, N.prototype.createRawTexture = function(M, U, X, j, ne, te, de, pe, ae) {\n            throw ae === void 0 && (ae = m.a.TEXTURETYPE_UNSIGNED_INT), C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype.createRawCubeTexture = function(M, U, X, j, ne, te, de, pe) {\n            throw C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype.createRawTexture3D = function(M, U, X, j, ne, te, de, pe, ae, ee) {\n            throw ee === void 0 && (ee = m.a.TEXTURETYPE_UNSIGNED_INT), C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype.createRawTexture2DArray = function(M, U, X, j, ne, te, de, pe, ae, ee) {\n            throw ee === void 0 && (ee = m.a.TEXTURETYPE_UNSIGNED_INT), C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype._unpackFlipY = function(M) {\n            this._unpackFlipYCached !== M && (this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, M ? 1 : 0), this.enableUnpackFlipYCached && (this._unpackFlipYCached = M));\n          }, N.prototype._getUnpackAlignement = function() {\n            return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT);\n          }, N.prototype._getTextureTarget = function(M) {\n            return M.isCube ? this._gl.TEXTURE_CUBE_MAP : M.is3D ? this._gl.TEXTURE_3D : M.is2DArray || M.isMultiview ? this._gl.TEXTURE_2D_ARRAY : this._gl.TEXTURE_2D;\n          }, N.prototype.updateTextureSamplingMode = function(M, U, X) {\n            X === void 0 && (X = !1);\n            var j = this._getTextureTarget(U), ne = this._getSamplingParameters(M, U.generateMipMaps || X);\n            this._setTextureParameterInteger(j, this._gl.TEXTURE_MAG_FILTER, ne.mag, U), this._setTextureParameterInteger(j, this._gl.TEXTURE_MIN_FILTER, ne.min), X && (U.generateMipMaps = !0, this._gl.generateMipmap(j)), this._bindTextureDirectly(j, null), U.samplingMode = M;\n          }, N.prototype.updateTextureWrappingMode = function(M, U, X, j) {\n            X === void 0 && (X = null), j === void 0 && (j = null);\n            var ne = this._getTextureTarget(M);\n            U !== null && (this._setTextureParameterInteger(ne, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(U), M), M._cachedWrapU = U), X !== null && (this._setTextureParameterInteger(ne, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(X), M), M._cachedWrapV = X), (M.is2DArray || M.is3D) && j !== null && (this._setTextureParameterInteger(ne, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(j), M), M._cachedWrapR = j), this._bindTextureDirectly(ne, null);\n          }, N.prototype._setupDepthStencilTexture = function(M, U, X, j, ne) {\n            var te = U.width || U, de = U.height || U, pe = U.layers || 0;\n            M.baseWidth = te, M.baseHeight = de, M.width = te, M.height = de, M.is2DArray = pe > 0, M.depth = pe, M.isReady = !0, M.samples = 1, M.generateMipMaps = !1, M._generateDepthBuffer = !0, M._generateStencilBuffer = X, M.samplingMode = j ? m.a.TEXTURE_BILINEAR_SAMPLINGMODE : m.a.TEXTURE_NEAREST_SAMPLINGMODE, M.type = m.a.TEXTURETYPE_UNSIGNED_INT, M._comparisonFunction = ne;\n            var ae = this._gl, ee = this._getTextureTarget(M), K = this._getSamplingParameters(M.samplingMode, !1);\n            ae.texParameteri(ee, ae.TEXTURE_MAG_FILTER, K.mag), ae.texParameteri(ee, ae.TEXTURE_MIN_FILTER, K.min), ae.texParameteri(ee, ae.TEXTURE_WRAP_S, ae.CLAMP_TO_EDGE), ae.texParameteri(ee, ae.TEXTURE_WRAP_T, ae.CLAMP_TO_EDGE), ne === 0 ? (ae.texParameteri(ee, ae.TEXTURE_COMPARE_FUNC, m.a.LEQUAL), ae.texParameteri(ee, ae.TEXTURE_COMPARE_MODE, ae.NONE)) : (ae.texParameteri(ee, ae.TEXTURE_COMPARE_FUNC, ne), ae.texParameteri(ee, ae.TEXTURE_COMPARE_MODE, ae.COMPARE_REF_TO_TEXTURE));\n          }, N.prototype._uploadCompressedDataToTextureDirectly = function(M, U, X, j, ne, te, de) {\n            te === void 0 && (te = 0), de === void 0 && (de = 0);\n            var pe = this._gl, ae = pe.TEXTURE_2D;\n            M.isCube && (ae = pe.TEXTURE_CUBE_MAP_POSITIVE_X + te), this._gl.compressedTexImage2D(ae, de, U, X, j, 0, ne);\n          }, N.prototype._uploadDataToTextureDirectly = function(M, U, X, j, ne, te) {\n            X === void 0 && (X = 0), j === void 0 && (j = 0), te === void 0 && (te = !1);\n            var de = this._gl, pe = this._getWebGLTextureType(M.type), ae = this._getInternalFormat(M.format), ee = ne === void 0 ? this._getRGBABufferInternalSizedFormat(M.type, M.format) : this._getInternalFormat(ne);\n            this._unpackFlipY(M.invertY);\n            var K = de.TEXTURE_2D;\n            M.isCube && (K = de.TEXTURE_CUBE_MAP_POSITIVE_X + X);\n            var $ = Math.round(Math.log(M.width) * Math.LOG2E), L = Math.round(Math.log(M.height) * Math.LOG2E), G = te ? M.width : Math.pow(2, Math.max($ - j, 0)), Q = te ? M.height : Math.pow(2, Math.max(L - j, 0));\n            de.texImage2D(K, j, ee, G, Q, 0, ae, pe, U);\n          }, N.prototype.updateTextureData = function(M, U, X, j, ne, te, de, pe) {\n            de === void 0 && (de = 0), pe === void 0 && (pe = 0);\n            var ae = this._gl, ee = this._getWebGLTextureType(M.type), K = this._getInternalFormat(M.format);\n            this._unpackFlipY(M.invertY);\n            var $ = ae.TEXTURE_2D;\n            M.isCube && ($ = ae.TEXTURE_CUBE_MAP_POSITIVE_X + de), ae.texSubImage2D($, pe, X, j, ne, te, K, ee, U);\n          }, N.prototype._uploadArrayBufferViewToTexture = function(M, U, X, j) {\n            X === void 0 && (X = 0), j === void 0 && (j = 0);\n            var ne = this._gl, te = M.isCube ? ne.TEXTURE_CUBE_MAP : ne.TEXTURE_2D;\n            this._bindTextureDirectly(te, M, !0), this._uploadDataToTextureDirectly(M, U, X, j), this._bindTextureDirectly(te, null, !0);\n          }, N.prototype._prepareWebGLTextureContinuation = function(M, U, X, j, ne) {\n            var te = this._gl;\n            if (te) {\n              var de = this._getSamplingParameters(ne, !X);\n              te.texParameteri(te.TEXTURE_2D, te.TEXTURE_MAG_FILTER, de.mag), te.texParameteri(te.TEXTURE_2D, te.TEXTURE_MIN_FILTER, de.min), X || j || te.generateMipmap(te.TEXTURE_2D), this._bindTextureDirectly(te.TEXTURE_2D, null), U && U._removePendingData(M), M.onLoadedObservable.notifyObservers(M), M.onLoadedObservable.clear();\n            }\n          }, N.prototype._prepareWebGLTexture = function(M, U, X, j, ne, te, de, pe, ae) {\n            var ee = this;\n            ae === void 0 && (ae = m.a.TEXTURE_TRILINEAR_SAMPLINGMODE);\n            var K = this.getCaps().maxTextureSize, $ = Math.min(K, this.needPOTTextures ? N.GetExponentOfTwo(X, K) : X), L = Math.min(K, this.needPOTTextures ? N.GetExponentOfTwo(j, K) : j), G = this._gl;\n            G && (M._webGLTexture ? (this._bindTextureDirectly(G.TEXTURE_2D, M, !0), this._unpackFlipY(ne === void 0 || !!ne), M.baseWidth = X, M.baseHeight = j, M.width = $, M.height = L, M.isReady = !0, pe($, L, function() {\n              ee._prepareWebGLTextureContinuation(M, U, te, de, ae);\n            }) || this._prepareWebGLTextureContinuation(M, U, te, de, ae)) : U && U._removePendingData(M));\n          }, N.prototype._setupFramebufferDepthAttachments = function(M, U, X, j, ne) {\n            ne === void 0 && (ne = 1);\n            var te = this._gl;\n            if (M && U)\n              return this._getDepthStencilBuffer(X, j, ne, te.DEPTH_STENCIL, te.DEPTH24_STENCIL8, te.DEPTH_STENCIL_ATTACHMENT);\n            if (U) {\n              var de = te.DEPTH_COMPONENT16;\n              return this._webGLVersion > 1 && (de = te.DEPTH_COMPONENT32F), this._getDepthStencilBuffer(X, j, ne, de, de, te.DEPTH_ATTACHMENT);\n            }\n            return M ? this._getDepthStencilBuffer(X, j, ne, te.STENCIL_INDEX8, te.STENCIL_INDEX8, te.STENCIL_ATTACHMENT) : null;\n          }, N.prototype._releaseFramebufferObjects = function(M) {\n            var U = this._gl;\n            M._framebuffer && (U.deleteFramebuffer(M._framebuffer), M._framebuffer = null), M._depthStencilBuffer && (U.deleteRenderbuffer(M._depthStencilBuffer), M._depthStencilBuffer = null), M._MSAAFramebuffer && (U.deleteFramebuffer(M._MSAAFramebuffer), M._MSAAFramebuffer = null), M._MSAARenderBuffer && (U.deleteRenderbuffer(M._MSAARenderBuffer), M._MSAARenderBuffer = null);\n          }, N.prototype._releaseTexture = function(M) {\n            this._releaseFramebufferObjects(M), this._deleteTexture(M._webGLTexture), this.unbindAllTextures();\n            var U = this._internalTexturesCache.indexOf(M);\n            U !== -1 && this._internalTexturesCache.splice(U, 1), M._lodTextureHigh && M._lodTextureHigh.dispose(), M._lodTextureMid && M._lodTextureMid.dispose(), M._lodTextureLow && M._lodTextureLow.dispose(), M._irradianceTexture && M._irradianceTexture.dispose();\n          }, N.prototype._deleteTexture = function(M) {\n            this._gl.deleteTexture(M);\n          }, N.prototype._setProgram = function(M) {\n            this._currentProgram !== M && (this._gl.useProgram(M), this._currentProgram = M);\n          }, N.prototype.bindSamplers = function(M) {\n            var U = M.getPipelineContext();\n            this._setProgram(U.program);\n            for (var X = M.getSamplers(), j = 0; j < X.length; j++) {\n              var ne = M.getUniform(X[j]);\n              ne && (this._boundUniforms[j] = ne);\n            }\n            this._currentEffect = null;\n          }, N.prototype._activateCurrentTexture = function() {\n            this._currentTextureChannel !== this._activeChannel && (this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel), this._currentTextureChannel = this._activeChannel);\n          }, N.prototype._bindTextureDirectly = function(M, U, X, j) {\n            X === void 0 && (X = !1), j === void 0 && (j = !1);\n            var ne = !1, te = U && U._associatedChannel > -1;\n            return X && te && (this._activeChannel = U._associatedChannel), this._boundTexturesCache[this._activeChannel] !== U || j ? (this._activateCurrentTexture(), U && U.isMultiview ? this._gl.bindTexture(M, U ? U._colorTextureArray : null) : this._gl.bindTexture(M, U ? U._webGLTexture : null), this._boundTexturesCache[this._activeChannel] = U, U && (U._associatedChannel = this._activeChannel)) : X && (ne = !0, this._activateCurrentTexture()), te && !X && this._bindSamplerUniformToChannel(U._associatedChannel, this._activeChannel), ne;\n          }, N.prototype._bindTexture = function(M, U) {\n            if (M !== void 0) {\n              U && (U._associatedChannel = M), this._activeChannel = M;\n              var X = U ? this._getTextureTarget(U) : this._gl.TEXTURE_2D;\n              this._bindTextureDirectly(X, U);\n            }\n          }, N.prototype.unbindAllTextures = function() {\n            for (var M = 0; M < this._maxSimultaneousTextures; M++)\n              this._activeChannel = M, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), this.webGLVersion > 1 && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null));\n          }, N.prototype.setTexture = function(M, U, X) {\n            M !== void 0 && (U && (this._boundUniforms[M] = U), this._setTexture(M, X));\n          }, N.prototype._bindSamplerUniformToChannel = function(M, U) {\n            var X = this._boundUniforms[M];\n            X && X._currentState !== U && (this._gl.uniform1i(X, U), X._currentState = U);\n          }, N.prototype._getTextureWrapMode = function(M) {\n            switch (M) {\n              case m.a.TEXTURE_WRAP_ADDRESSMODE:\n                return this._gl.REPEAT;\n              case m.a.TEXTURE_CLAMP_ADDRESSMODE:\n                return this._gl.CLAMP_TO_EDGE;\n              case m.a.TEXTURE_MIRROR_ADDRESSMODE:\n                return this._gl.MIRRORED_REPEAT;\n            }\n            return this._gl.REPEAT;\n          }, N.prototype._setTexture = function(M, U, X, j) {\n            if (X === void 0 && (X = !1), j === void 0 && (j = !1), !U)\n              return this._boundTexturesCache[M] != null && (this._activeChannel = M, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), this.webGLVersion > 1 && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null))), !1;\n            if (U.video)\n              this._activeChannel = M, U.update();\n            else if (U.delayLoadState === m.a.DELAYLOADSTATE_NOTLOADED)\n              return U.delayLoad(), !1;\n            var ne;\n            ne = j ? U.depthStencilTexture : U.isReady() ? U.getInternalTexture() : U.isCube ? this.emptyCubeTexture : U.is3D ? this.emptyTexture3D : U.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, !X && ne && (ne._associatedChannel = M);\n            var te = !0;\n            this._boundTexturesCache[M] === ne && (X || this._bindSamplerUniformToChannel(ne._associatedChannel, M), te = !1), this._activeChannel = M;\n            var de = this._getTextureTarget(ne);\n            if (te && this._bindTextureDirectly(de, ne, X), ne && !ne.isMultiview) {\n              if (ne.isCube && ne._cachedCoordinatesMode !== U.coordinatesMode) {\n                ne._cachedCoordinatesMode = U.coordinatesMode;\n                var pe = U.coordinatesMode !== m.a.TEXTURE_CUBIC_MODE && U.coordinatesMode !== m.a.TEXTURE_SKYBOX_MODE ? m.a.TEXTURE_WRAP_ADDRESSMODE : m.a.TEXTURE_CLAMP_ADDRESSMODE;\n                U.wrapU = pe, U.wrapV = pe;\n              }\n              ne._cachedWrapU !== U.wrapU && (ne._cachedWrapU = U.wrapU, this._setTextureParameterInteger(de, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(U.wrapU), ne)), ne._cachedWrapV !== U.wrapV && (ne._cachedWrapV = U.wrapV, this._setTextureParameterInteger(de, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(U.wrapV), ne)), ne.is3D && ne._cachedWrapR !== U.wrapR && (ne._cachedWrapR = U.wrapR, this._setTextureParameterInteger(de, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(U.wrapR), ne)), this._setAnisotropicLevel(de, ne, U.anisotropicFilteringLevel);\n            }\n            return !0;\n          }, N.prototype.setTextureArray = function(M, U, X) {\n            if (M !== void 0 && U) {\n              this._textureUnits && this._textureUnits.length === X.length || (this._textureUnits = new Int32Array(X.length));\n              for (var j = 0; j < X.length; j++) {\n                var ne = X[j].getInternalTexture();\n                ne ? (this._textureUnits[j] = M + j, ne._associatedChannel = M + j) : this._textureUnits[j] = -1;\n              }\n              this._gl.uniform1iv(U, this._textureUnits);\n              for (var te = 0; te < X.length; te++)\n                this._setTexture(this._textureUnits[te], X[te], !0);\n            }\n          }, N.prototype._setAnisotropicLevel = function(M, U, X) {\n            var j = this._caps.textureAnisotropicFilterExtension;\n            U.samplingMode !== m.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST && U.samplingMode !== m.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR && U.samplingMode !== m.a.TEXTURE_LINEAR_LINEAR && (X = 1), j && U._cachedAnisotropicFilteringLevel !== X && (this._setTextureParameterFloat(M, j.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(X, this._caps.maxAnisotropy), U), U._cachedAnisotropicFilteringLevel = X);\n          }, N.prototype._setTextureParameterFloat = function(M, U, X, j) {\n            this._bindTextureDirectly(M, j, !0, !0), this._gl.texParameterf(M, U, X);\n          }, N.prototype._setTextureParameterInteger = function(M, U, X, j) {\n            j && this._bindTextureDirectly(M, j, !0, !0), this._gl.texParameteri(M, U, X);\n          }, N.prototype.unbindAllAttributes = function() {\n            if (this._mustWipeVertexAttributes) {\n              this._mustWipeVertexAttributes = !1;\n              for (var M = 0; M < this._caps.maxVertexAttribs; M++)\n                this.disableAttributeByIndex(M);\n            } else {\n              M = 0;\n              for (var U = this._vertexAttribArraysEnabled.length; M < U; M++)\n                M >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[M] || this.disableAttributeByIndex(M);\n            }\n          }, N.prototype.releaseEffects = function() {\n            for (var M in this._compiledEffects) {\n              var U = this._compiledEffects[M].getPipelineContext();\n              this._deletePipelineContext(U);\n            }\n            this._compiledEffects = {};\n          }, N.prototype.dispose = function() {\n            this.stopRenderLoop(), this.onBeforeTextureInitObservable && this.onBeforeTextureInitObservable.clear(), this._emptyTexture && (this._releaseTexture(this._emptyTexture), this._emptyTexture = null), this._emptyCubeTexture && (this._releaseTexture(this._emptyCubeTexture), this._emptyCubeTexture = null), this._dummyFramebuffer && this._gl.deleteFramebuffer(this._dummyFramebuffer), this.releaseEffects(), this.unbindAllAttributes(), this._boundUniforms = [], S.a.IsWindowObjectExist() && this._renderingCanvas && (this._doNotHandleContextLost || (this._renderingCanvas.removeEventListener(\"webglcontextlost\", this._onContextLost), this._renderingCanvas.removeEventListener(\"webglcontextrestored\", this._onContextRestored))), this._workingCanvas = null, this._workingContext = null, this._currentBufferPointers = [], this._renderingCanvas = null, this._currentProgram = null, this._boundRenderFunction = null, _.a.ResetCache();\n            for (var M = 0, U = this._activeRequests; M < U.length; M++)\n              U[M].abort();\n          }, N.prototype.attachContextLostEvent = function(M) {\n            this._renderingCanvas && this._renderingCanvas.addEventListener(\"webglcontextlost\", M, !1);\n          }, N.prototype.attachContextRestoredEvent = function(M) {\n            this._renderingCanvas && this._renderingCanvas.addEventListener(\"webglcontextrestored\", M, !1);\n          }, N.prototype.getError = function() {\n            return this._gl.getError();\n          }, N.prototype._canRenderToFloatFramebuffer = function() {\n            return this._webGLVersion > 1 ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(m.a.TEXTURETYPE_FLOAT);\n          }, N.prototype._canRenderToHalfFloatFramebuffer = function() {\n            return this._webGLVersion > 1 ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(m.a.TEXTURETYPE_HALF_FLOAT);\n          }, N.prototype._canRenderToFramebuffer = function(M) {\n            for (var U = this._gl; U.getError() !== U.NO_ERROR; )\n              ;\n            var X = !0, j = U.createTexture();\n            U.bindTexture(U.TEXTURE_2D, j), U.texImage2D(U.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(M), 1, 1, 0, U.RGBA, this._getWebGLTextureType(M), null), U.texParameteri(U.TEXTURE_2D, U.TEXTURE_MIN_FILTER, U.NEAREST), U.texParameteri(U.TEXTURE_2D, U.TEXTURE_MAG_FILTER, U.NEAREST);\n            var ne = U.createFramebuffer();\n            U.bindFramebuffer(U.FRAMEBUFFER, ne), U.framebufferTexture2D(U.FRAMEBUFFER, U.COLOR_ATTACHMENT0, U.TEXTURE_2D, j, 0);\n            var te = U.checkFramebufferStatus(U.FRAMEBUFFER);\n            if ((X = (X = X && te === U.FRAMEBUFFER_COMPLETE) && U.getError() === U.NO_ERROR) && (U.clear(U.COLOR_BUFFER_BIT), X = X && U.getError() === U.NO_ERROR), X) {\n              U.bindFramebuffer(U.FRAMEBUFFER, null);\n              var de = U.RGBA, pe = U.UNSIGNED_BYTE, ae = new Uint8Array(4);\n              U.readPixels(0, 0, 1, 1, de, pe, ae), X = X && U.getError() === U.NO_ERROR;\n            }\n            for (U.deleteTexture(j), U.deleteFramebuffer(ne), U.bindFramebuffer(U.FRAMEBUFFER, null); !X && U.getError() !== U.NO_ERROR; )\n              ;\n            return X;\n          }, N.prototype._getWebGLTextureType = function(M) {\n            if (this._webGLVersion === 1) {\n              switch (M) {\n                case m.a.TEXTURETYPE_FLOAT:\n                  return this._gl.FLOAT;\n                case m.a.TEXTURETYPE_HALF_FLOAT:\n                  return this._gl.HALF_FLOAT_OES;\n                case m.a.TEXTURETYPE_UNSIGNED_BYTE:\n                  return this._gl.UNSIGNED_BYTE;\n                case m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n                  return this._gl.UNSIGNED_SHORT_4_4_4_4;\n                case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n                  return this._gl.UNSIGNED_SHORT_5_5_5_1;\n                case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n                  return this._gl.UNSIGNED_SHORT_5_6_5;\n              }\n              return this._gl.UNSIGNED_BYTE;\n            }\n            switch (M) {\n              case m.a.TEXTURETYPE_BYTE:\n                return this._gl.BYTE;\n              case m.a.TEXTURETYPE_UNSIGNED_BYTE:\n                return this._gl.UNSIGNED_BYTE;\n              case m.a.TEXTURETYPE_SHORT:\n                return this._gl.SHORT;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT:\n                return this._gl.UNSIGNED_SHORT;\n              case m.a.TEXTURETYPE_INT:\n                return this._gl.INT;\n              case m.a.TEXTURETYPE_UNSIGNED_INTEGER:\n                return this._gl.UNSIGNED_INT;\n              case m.a.TEXTURETYPE_FLOAT:\n                return this._gl.FLOAT;\n              case m.a.TEXTURETYPE_HALF_FLOAT:\n                return this._gl.HALF_FLOAT;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n                return this._gl.UNSIGNED_SHORT_4_4_4_4;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n                return this._gl.UNSIGNED_SHORT_5_5_5_1;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n                return this._gl.UNSIGNED_SHORT_5_6_5;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\n                return this._gl.UNSIGNED_INT_2_10_10_10_REV;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_24_8:\n                return this._gl.UNSIGNED_INT_24_8;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\n                return this._gl.UNSIGNED_INT_10F_11F_11F_REV;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\n                return this._gl.UNSIGNED_INT_5_9_9_9_REV;\n              case m.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:\n                return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV;\n            }\n            return this._gl.UNSIGNED_BYTE;\n          }, N.prototype._getInternalFormat = function(M) {\n            var U = this._gl.RGBA;\n            switch (M) {\n              case m.a.TEXTUREFORMAT_ALPHA:\n                U = this._gl.ALPHA;\n                break;\n              case m.a.TEXTUREFORMAT_LUMINANCE:\n                U = this._gl.LUMINANCE;\n                break;\n              case m.a.TEXTUREFORMAT_LUMINANCE_ALPHA:\n                U = this._gl.LUMINANCE_ALPHA;\n                break;\n              case m.a.TEXTUREFORMAT_RED:\n                U = this._gl.RED;\n                break;\n              case m.a.TEXTUREFORMAT_RG:\n                U = this._gl.RG;\n                break;\n              case m.a.TEXTUREFORMAT_RGB:\n                U = this._gl.RGB;\n                break;\n              case m.a.TEXTUREFORMAT_RGBA:\n                U = this._gl.RGBA;\n            }\n            if (this._webGLVersion > 1)\n              switch (M) {\n                case m.a.TEXTUREFORMAT_RED_INTEGER:\n                  U = this._gl.RED_INTEGER;\n                  break;\n                case m.a.TEXTUREFORMAT_RG_INTEGER:\n                  U = this._gl.RG_INTEGER;\n                  break;\n                case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                  U = this._gl.RGB_INTEGER;\n                  break;\n                case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  U = this._gl.RGBA_INTEGER;\n              }\n            return U;\n          }, N.prototype._getRGBABufferInternalSizedFormat = function(M, U) {\n            if (this._webGLVersion === 1) {\n              if (U !== void 0)\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_ALPHA:\n                    return this._gl.ALPHA;\n                  case m.a.TEXTUREFORMAT_LUMINANCE:\n                    return this._gl.LUMINANCE;\n                  case m.a.TEXTUREFORMAT_LUMINANCE_ALPHA:\n                    return this._gl.LUMINANCE_ALPHA;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB;\n                }\n              return this._gl.RGBA;\n            }\n            switch (M) {\n              case m.a.TEXTURETYPE_BYTE:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R8_SNORM;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG8_SNORM;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB8_SNORM;\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R8I;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG8I;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB8I;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                    return this._gl.RGBA8I;\n                  default:\n                    return this._gl.RGBA8_SNORM;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_BYTE:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R8;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG8;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB8;\n                  case m.a.TEXTUREFORMAT_RGBA:\n                    return this._gl.RGBA8;\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R8UI;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG8UI;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB8UI;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                    return this._gl.RGBA8UI;\n                  case m.a.TEXTUREFORMAT_ALPHA:\n                    return this._gl.ALPHA;\n                  case m.a.TEXTUREFORMAT_LUMINANCE:\n                    return this._gl.LUMINANCE;\n                  case m.a.TEXTUREFORMAT_LUMINANCE_ALPHA:\n                    return this._gl.LUMINANCE_ALPHA;\n                  default:\n                    return this._gl.RGBA8;\n                }\n              case m.a.TEXTURETYPE_SHORT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R16I;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG16I;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB16I;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA16I;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R16UI;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG16UI;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB16UI;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA16UI;\n                }\n              case m.a.TEXTURETYPE_INT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R32I;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG32I;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB32I;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA32I;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_INTEGER:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R32UI;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG32UI;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB32UI;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA32UI;\n                }\n              case m.a.TEXTURETYPE_FLOAT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R32F;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG32F;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB32F;\n                  case m.a.TEXTUREFORMAT_RGBA:\n                  default:\n                    return this._gl.RGBA32F;\n                }\n              case m.a.TEXTURETYPE_HALF_FLOAT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R16F;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG16F;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB16F;\n                  case m.a.TEXTUREFORMAT_RGBA:\n                  default:\n                    return this._gl.RGBA16F;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n                return this._gl.RGB565;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\n                return this._gl.R11F_G11F_B10F;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\n                return this._gl.RGB9_E5;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n                return this._gl.RGBA4;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n                return this._gl.RGB5_A1;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RGBA:\n                    return this._gl.RGB10_A2;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                    return this._gl.RGB10_A2UI;\n                  default:\n                    return this._gl.RGB10_A2;\n                }\n            }\n            return this._gl.RGBA8;\n          }, N.prototype._getRGBAMultiSampleBufferFormat = function(M) {\n            return M === m.a.TEXTURETYPE_FLOAT ? this._gl.RGBA32F : M === m.a.TEXTURETYPE_HALF_FLOAT ? this._gl.RGBA16F : this._gl.RGBA8;\n          }, N.prototype._loadFile = function(M, U, X, j, ne, te) {\n            var de = this, pe = N._FileToolsLoadFile(M, U, X, j, ne, te);\n            return this._activeRequests.push(pe), pe.onCompleteObservable.add(function(ae) {\n              de._activeRequests.splice(de._activeRequests.indexOf(ae), 1);\n            }), pe;\n          }, N._FileToolsLoadFile = function(M, U, X, j, ne, te) {\n            throw C.a.WarnImport(\"FileTools\");\n          }, N.prototype.readPixels = function(M, U, X, j, ne) {\n            ne === void 0 && (ne = !0);\n            var te = ne ? 4 : 3, de = ne ? this._gl.RGBA : this._gl.RGB, pe = new Uint8Array(j * X * te);\n            return this._gl.readPixels(M, U, X, j, de, this._gl.UNSIGNED_BYTE, pe), pe;\n          }, Object.defineProperty(N, \"IsSupported\", { get: function() {\n            return this.isSupported();\n          }, enumerable: !1, configurable: !0 }), N.isSupported = function() {\n            if (this._HasMajorPerformanceCaveat !== null)\n              return !this._HasMajorPerformanceCaveat;\n            if (this._IsSupported === null)\n              try {\n                var M = v.a.CreateCanvas(1, 1), U = M.getContext(\"webgl\") || M.getContext(\"experimental-webgl\");\n                this._IsSupported = U != null && !!window.WebGLRenderingContext;\n              } catch {\n                this._IsSupported = !1;\n              }\n            return this._IsSupported;\n          }, Object.defineProperty(N, \"HasMajorPerformanceCaveat\", { get: function() {\n            if (this._HasMajorPerformanceCaveat === null)\n              try {\n                var M = v.a.CreateCanvas(1, 1), U = M.getContext(\"webgl\", { failIfMajorPerformanceCaveat: !0 }) || M.getContext(\"experimental-webgl\", { failIfMajorPerformanceCaveat: !0 });\n                this._HasMajorPerformanceCaveat = !U;\n              } catch {\n                this._HasMajorPerformanceCaveat = !1;\n              }\n            return this._HasMajorPerformanceCaveat;\n          }, enumerable: !1, configurable: !0 }), N.CeilingPOT = function(M) {\n            return M--, M |= M >> 1, M |= M >> 2, M |= M >> 4, M |= M >> 8, M |= M >> 16, ++M;\n          }, N.FloorPOT = function(M) {\n            return M |= M >> 1, M |= M >> 2, M |= M >> 4, M |= M >> 8, (M |= M >> 16) - (M >> 1);\n          }, N.NearestPOT = function(M) {\n            var U = N.CeilingPOT(M), X = N.FloorPOT(M);\n            return U - M > M - X ? X : U;\n          }, N.GetExponentOfTwo = function(M, U, X) {\n            var j;\n            switch (X === void 0 && (X = m.a.SCALEMODE_NEAREST), X) {\n              case m.a.SCALEMODE_FLOOR:\n                j = N.FloorPOT(M);\n                break;\n              case m.a.SCALEMODE_NEAREST:\n                j = N.NearestPOT(M);\n                break;\n              case m.a.SCALEMODE_CEILING:\n              default:\n                j = N.CeilingPOT(M);\n            }\n            return Math.min(j, U);\n          }, N.QueueNewFrame = function(M, U) {\n            return S.a.IsWindowObjectExist() ? (U || (U = window), U.requestPostAnimationFrame ? U.requestPostAnimationFrame(M) : U.requestAnimationFrame ? U.requestAnimationFrame(M) : U.msRequestAnimationFrame ? U.msRequestAnimationFrame(M) : U.webkitRequestAnimationFrame ? U.webkitRequestAnimationFrame(M) : U.mozRequestAnimationFrame ? U.mozRequestAnimationFrame(M) : U.oRequestAnimationFrame ? U.oRequestAnimationFrame(M) : window.setTimeout(M, 16)) : typeof requestAnimationFrame < \"u\" ? requestAnimationFrame(M) : setTimeout(M, 16);\n          }, N.prototype.getHostDocument = function() {\n            return this._renderingCanvas && this._renderingCanvas.ownerDocument ? this._renderingCanvas.ownerDocument : document;\n          }, N.ExceptionList = [{ key: \"Chrome/63.0\", capture: \"63\\\\.0\\\\.3239\\\\.(\\\\d+)\", captureConstraint: 108, targets: [\"uniformBuffer\"] }, { key: \"Firefox/58\", capture: null, captureConstraint: null, targets: [\"uniformBuffer\"] }, { key: \"Firefox/59\", capture: null, captureConstraint: null, targets: [\"uniformBuffer\"] }, { key: \"Chrome/72.+?Mobile\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Chrome/73.+?Mobile\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Chrome/74.+?Mobile\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Mac OS.+Chrome/71\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Mac OS.+Chrome/72\", capture: null, captureConstraint: null, targets: [\"vao\"] }], N._TextureLoaders = [], N.CollisionsEpsilon = 1e-3, N._IsSupported = null, N._HasMajorPerformanceCaveat = null, N;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return V;\n        }), f.d(A, \"a\", function() {\n          return O;\n        });\n        var V, _ = f(6), C = f(102), u = f(2), I = f(21);\n        (function(x) {\n          x[x.Unknown = 0] = \"Unknown\", x[x.Url = 1] = \"Url\", x[x.Temp = 2] = \"Temp\", x[x.Raw = 3] = \"Raw\", x[x.Dynamic = 4] = \"Dynamic\", x[x.RenderTarget = 5] = \"RenderTarget\", x[x.MultiRenderTarget = 6] = \"MultiRenderTarget\", x[x.Cube = 7] = \"Cube\", x[x.CubeRaw = 8] = \"CubeRaw\", x[x.CubePrefiltered = 9] = \"CubePrefiltered\", x[x.Raw3D = 10] = \"Raw3D\", x[x.Raw2DArray = 11] = \"Raw2DArray\", x[x.Depth = 12] = \"Depth\", x[x.CubeRawRGBD = 13] = \"CubeRawRGBD\";\n        })(V || (V = {}));\n        var O = function() {\n          function x(m, c, T) {\n            T === void 0 && (T = !1), this.isReady = !1, this.isCube = !1, this.is3D = !1, this.is2DArray = !1, this.isMultiview = !1, this.url = \"\", this.samplingMode = -1, this.generateMipMaps = !1, this.samples = 0, this.type = -1, this.format = -1, this.onLoadedObservable = new _.c(), this.width = 0, this.height = 0, this.depth = 0, this.baseWidth = 0, this.baseHeight = 0, this.baseDepth = 0, this.invertY = !1, this._invertVScale = !1, this._associatedChannel = -1, this._source = V.Unknown, this._buffer = null, this._bufferView = null, this._bufferViewArray = null, this._bufferViewArrayArray = null, this._size = 0, this._extension = \"\", this._files = null, this._workingCanvas = null, this._workingContext = null, this._framebuffer = null, this._depthStencilBuffer = null, this._MSAAFramebuffer = null, this._MSAARenderBuffer = null, this._attachments = null, this._textureArray = null, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedWrapR = null, this._cachedAnisotropicFilteringLevel = null, this._isDisabled = !1, this._compression = null, this._generateStencilBuffer = !1, this._generateDepthBuffer = !1, this._comparisonFunction = 0, this._sphericalPolynomial = null, this._lodGenerationScale = 0, this._lodGenerationOffset = 0, this._colorTextureArray = null, this._depthStencilTextureArray = null, this._lodTextureHigh = null, this._lodTextureMid = null, this._lodTextureLow = null, this._isRGBD = !1, this._linearSpecularLOD = !1, this._irradianceTexture = null, this._webGLTexture = null, this._references = 1, this._gammaSpace = null, this._engine = m, this._source = c, T || (this._webGLTexture = m._createTexture());\n          }\n          return x.prototype.getEngine = function() {\n            return this._engine;\n          }, Object.defineProperty(x.prototype, \"source\", { get: function() {\n            return this._source;\n          }, enumerable: !1, configurable: !0 }), x.prototype.incrementReferences = function() {\n            this._references++;\n          }, x.prototype.updateSize = function(m, c, T) {\n            T === void 0 && (T = 1), this.width = m, this.height = c, this.depth = T, this.baseWidth = m, this.baseHeight = c, this.baseDepth = T, this._size = m * c * T;\n          }, x.prototype._rebuild = function() {\n            var m, c, T = this;\n            switch (this.isReady = !1, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedAnisotropicFilteringLevel = null, this.source) {\n              case V.Temp:\n                return;\n              case V.Url:\n                return void (c = this._engine.createTexture((m = this._originalUrl) !== null && m !== void 0 ? m : this.url, !this.generateMipMaps, this.invertY, null, this.samplingMode, function() {\n                  c._swapAndDie(T), T.isReady = !0;\n                }, null, this._buffer, void 0, this.format));\n              case V.Raw:\n                return (c = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.Raw3D:\n                return (c = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.Raw2DArray:\n                return (c = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.Dynamic:\n                return (c = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode))._swapAndDie(this), void this._engine.updateDynamicTexture(this, this._engine.getRenderingCanvas(), this.invertY, void 0, void 0, !0);\n              case V.RenderTarget:\n                var S = new C.a();\n                if (S.generateDepthBuffer = this._generateDepthBuffer, S.generateMipMaps = this.generateMipMaps, S.generateStencilBuffer = this._generateStencilBuffer, S.samplingMode = this.samplingMode, S.type = this.type, this.isCube)\n                  c = this._engine.createRenderTargetCubeTexture(this.width, S);\n                else {\n                  var E = { width: this.width, height: this.height, layers: this.is2DArray ? this.depth : void 0 };\n                  c = this._engine.createRenderTargetTexture(E, S);\n                }\n                return c._swapAndDie(this), void (this.isReady = !0);\n              case V.Depth:\n                var g = { bilinearFiltering: this.samplingMode !== u.a.TEXTURE_BILINEAR_SAMPLINGMODE, comparisonFunction: this._comparisonFunction, generateStencil: this._generateStencilBuffer, isCube: this.isCube }, l = { width: this.width, height: this.height, layers: this.is2DArray ? this.depth : void 0 };\n                return (c = this._engine.createDepthStencilTexture(l, g))._swapAndDie(this), void (this.isReady = !0);\n              case V.Cube:\n                return void (c = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, function() {\n                  c._swapAndDie(T), T.isReady = !0;\n                }, null, this.format, this._extension));\n              case V.CubeRaw:\n                return (c = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.CubeRawRGBD:\n                return c = this._engine.createRawCubeTexture(null, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression), void x._UpdateRGBDAsync(c, this._bufferViewArrayArray, this._sphericalPolynomial, this._lodGenerationScale, this._lodGenerationOffset).then(function() {\n                  c._swapAndDie(T), T.isReady = !0;\n                });\n              case V.CubePrefiltered:\n                return void ((c = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, function(h) {\n                  h && h._swapAndDie(T), T.isReady = !0;\n                }, null, this.format, this._extension))._sphericalPolynomial = this._sphericalPolynomial);\n            }\n          }, x.prototype._swapAndDie = function(m) {\n            m._webGLTexture = this._webGLTexture, m._isRGBD = this._isRGBD, this._framebuffer && (m._framebuffer = this._framebuffer), this._depthStencilBuffer && (m._depthStencilBuffer = this._depthStencilBuffer), m._depthStencilTexture = this._depthStencilTexture, this._lodTextureHigh && (m._lodTextureHigh && m._lodTextureHigh.dispose(), m._lodTextureHigh = this._lodTextureHigh), this._lodTextureMid && (m._lodTextureMid && m._lodTextureMid.dispose(), m._lodTextureMid = this._lodTextureMid), this._lodTextureLow && (m._lodTextureLow && m._lodTextureLow.dispose(), m._lodTextureLow = this._lodTextureLow), this._irradianceTexture && (m._irradianceTexture && m._irradianceTexture.dispose(), m._irradianceTexture = this._irradianceTexture);\n            var c, T = this._engine.getLoadedTexturesCache();\n            (c = T.indexOf(this)) !== -1 && T.splice(c, 1), (c = T.indexOf(m)) === -1 && T.push(m);\n          }, x.prototype.dispose = function() {\n            this._webGLTexture && (this._references--, this._references === 0 && (this._engine._releaseTexture(this), this._webGLTexture = null));\n          }, x._UpdateRGBDAsync = function(m, c, T, S, E) {\n            throw I.a.WarnImport(\"environmentTextureTools\");\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return V;\n        }), f.d(A, \"c\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = 1 / 2.2, _ = 2.2, C = 1e-3;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(1), _ = f(0), C = f(3), u = f(6), I = f(22), O = f(21), x = function() {\n          function m(c, T) {\n            T === void 0 && (T = null), this.state = \"\", this.metadata = null, this.reservedDataStore = null, this._doNotSerialize = !1, this._isDisposed = !1, this.animations = new Array(), this._ranges = {}, this.onReady = null, this._isEnabled = !0, this._isParentEnabled = !0, this._isReady = !0, this._currentRenderId = -1, this._parentUpdateId = -1, this._childUpdateId = -1, this._waitingParentId = null, this._cache = {}, this._parentNode = null, this._children = null, this._worldMatrix = _.a.Identity(), this._worldMatrixDeterminant = 0, this._worldMatrixDeterminantIsDirty = !0, this._sceneRootNodesIndex = -1, this._animationPropertiesOverride = null, this._isNode = !0, this.onDisposeObservable = new u.c(), this._onDisposeObserver = null, this._behaviors = new Array(), this.name = c, this.id = c, this._scene = T || I.a.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._initCache();\n          }\n          return m.AddNodeConstructor = function(c, T) {\n            this._NodeConstructors[c] = T;\n          }, m.Construct = function(c, T, S, E) {\n            var g = this._NodeConstructors[c];\n            return g ? g(T, S, E) : null;\n          }, Object.defineProperty(m.prototype, \"doNotSerialize\", { get: function() {\n            return !!this._doNotSerialize || !!this._parentNode && this._parentNode.doNotSerialize;\n          }, set: function(c) {\n            this._doNotSerialize = c;\n          }, enumerable: !1, configurable: !0 }), m.prototype.isDisposed = function() {\n            return this._isDisposed;\n          }, Object.defineProperty(m.prototype, \"parent\", { get: function() {\n            return this._parentNode;\n          }, set: function(c) {\n            if (this._parentNode !== c) {\n              var T = this._parentNode;\n              if (this._parentNode && this._parentNode._children !== void 0 && this._parentNode._children !== null) {\n                var S = this._parentNode._children.indexOf(this);\n                S !== -1 && this._parentNode._children.splice(S, 1), c || this._isDisposed || this._addToSceneRootNodes();\n              }\n              this._parentNode = c, this._parentNode && (this._parentNode._children !== void 0 && this._parentNode._children !== null || (this._parentNode._children = new Array()), this._parentNode._children.push(this), T || this._removeFromSceneRootNodes()), this._syncParentEnabledState();\n            }\n          }, enumerable: !1, configurable: !0 }), m.prototype._addToSceneRootNodes = function() {\n            this._sceneRootNodesIndex === -1 && (this._sceneRootNodesIndex = this._scene.rootNodes.length, this._scene.rootNodes.push(this));\n          }, m.prototype._removeFromSceneRootNodes = function() {\n            if (this._sceneRootNodesIndex !== -1) {\n              var c = this._scene.rootNodes, T = c.length - 1;\n              c[this._sceneRootNodesIndex] = c[T], c[this._sceneRootNodesIndex]._sceneRootNodesIndex = this._sceneRootNodesIndex, this._scene.rootNodes.pop(), this._sceneRootNodesIndex = -1;\n            }\n          }, Object.defineProperty(m.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;\n          }, set: function(c) {\n            this._animationPropertiesOverride = c;\n          }, enumerable: !1, configurable: !0 }), m.prototype.getClassName = function() {\n            return \"Node\";\n          }, Object.defineProperty(m.prototype, \"onDispose\", { set: function(c) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(c);\n          }, enumerable: !1, configurable: !0 }), m.prototype.getScene = function() {\n            return this._scene;\n          }, m.prototype.getEngine = function() {\n            return this._scene.getEngine();\n          }, m.prototype.addBehavior = function(c, T) {\n            var S = this;\n            return T === void 0 && (T = !1), this._behaviors.indexOf(c) !== -1 || (c.init(), this._scene.isLoading && !T ? this._scene.onDataLoadedObservable.addOnce(function() {\n              c.attach(S);\n            }) : c.attach(this), this._behaviors.push(c)), this;\n          }, m.prototype.removeBehavior = function(c) {\n            var T = this._behaviors.indexOf(c);\n            return T === -1 || (this._behaviors[T].detach(), this._behaviors.splice(T, 1)), this;\n          }, Object.defineProperty(m.prototype, \"behaviors\", { get: function() {\n            return this._behaviors;\n          }, enumerable: !1, configurable: !0 }), m.prototype.getBehaviorByName = function(c) {\n            for (var T = 0, S = this._behaviors; T < S.length; T++) {\n              var E = S[T];\n              if (E.name === c)\n                return E;\n            }\n            return null;\n          }, m.prototype.getWorldMatrix = function() {\n            return this._currentRenderId !== this._scene.getRenderId() && this.computeWorldMatrix(), this._worldMatrix;\n          }, m.prototype._getWorldMatrixDeterminant = function() {\n            return this._worldMatrixDeterminantIsDirty && (this._worldMatrixDeterminantIsDirty = !1, this._worldMatrixDeterminant = this._worldMatrix.determinant()), this._worldMatrixDeterminant;\n          }, Object.defineProperty(m.prototype, \"worldMatrixFromCache\", { get: function() {\n            return this._worldMatrix;\n          }, enumerable: !1, configurable: !0 }), m.prototype._initCache = function() {\n            this._cache = {}, this._cache.parent = void 0;\n          }, m.prototype.updateCache = function(c) {\n            !c && this.isSynchronized() || (this._cache.parent = this.parent, this._updateCache());\n          }, m.prototype._getActionManagerForTrigger = function(c, T) {\n            return this.parent ? this.parent._getActionManagerForTrigger(c, !1) : null;\n          }, m.prototype._updateCache = function(c) {\n          }, m.prototype._isSynchronized = function() {\n            return !0;\n          }, m.prototype._markSyncedWithParent = function() {\n            this._parentNode && (this._parentUpdateId = this._parentNode._childUpdateId);\n          }, m.prototype.isSynchronizedWithParent = function() {\n            return !this._parentNode || this._parentUpdateId === this._parentNode._childUpdateId && this._parentNode.isSynchronized();\n          }, m.prototype.isSynchronized = function() {\n            return this._cache.parent != this._parentNode ? (this._cache.parent = this._parentNode, !1) : !(this._parentNode && !this.isSynchronizedWithParent()) && this._isSynchronized();\n          }, m.prototype.isReady = function(c) {\n            return this._isReady;\n          }, m.prototype.isEnabled = function(c) {\n            return c === void 0 && (c = !0), c === !1 ? this._isEnabled : !!this._isEnabled && this._isParentEnabled;\n          }, m.prototype._syncParentEnabledState = function() {\n            this._isParentEnabled = !this._parentNode || this._parentNode.isEnabled(), this._children && this._children.forEach(function(c) {\n              c._syncParentEnabledState();\n            });\n          }, m.prototype.setEnabled = function(c) {\n            this._isEnabled = c, this._syncParentEnabledState();\n          }, m.prototype.isDescendantOf = function(c) {\n            return !!this.parent && (this.parent === c || this.parent.isDescendantOf(c));\n          }, m.prototype._getDescendants = function(c, T, S) {\n            if (T === void 0 && (T = !1), this._children)\n              for (var E = 0; E < this._children.length; E++) {\n                var g = this._children[E];\n                S && !S(g) || c.push(g), T || g._getDescendants(c, !1, S);\n              }\n          }, m.prototype.getDescendants = function(c, T) {\n            var S = new Array();\n            return this._getDescendants(S, c, T), S;\n          }, m.prototype.getChildMeshes = function(c, T) {\n            var S = [];\n            return this._getDescendants(S, c, function(E) {\n              return (!T || T(E)) && E.cullingStrategy !== void 0;\n            }), S;\n          }, m.prototype.getChildren = function(c, T) {\n            return T === void 0 && (T = !0), this.getDescendants(T, c);\n          }, m.prototype._setReady = function(c) {\n            c !== this._isReady && (c ? (this.onReady && this.onReady(this), this._isReady = !0) : this._isReady = !1);\n          }, m.prototype.getAnimationByName = function(c) {\n            for (var T = 0; T < this.animations.length; T++) {\n              var S = this.animations[T];\n              if (S.name === c)\n                return S;\n            }\n            return null;\n          }, m.prototype.createAnimationRange = function(c, T, S) {\n            if (!this._ranges[c]) {\n              this._ranges[c] = m._AnimationRangeFactory(c, T, S);\n              for (var E = 0, g = this.animations.length; E < g; E++)\n                this.animations[E] && this.animations[E].createRange(c, T, S);\n            }\n          }, m.prototype.deleteAnimationRange = function(c, T) {\n            T === void 0 && (T = !0);\n            for (var S = 0, E = this.animations.length; S < E; S++)\n              this.animations[S] && this.animations[S].deleteRange(c, T);\n            this._ranges[c] = null;\n          }, m.prototype.getAnimationRange = function(c) {\n            return this._ranges[c] || null;\n          }, m.prototype.getAnimationRanges = function() {\n            var c, T = [];\n            for (c in this._ranges)\n              T.push(this._ranges[c]);\n            return T;\n          }, m.prototype.beginAnimation = function(c, T, S, E) {\n            var g = this.getAnimationRange(c);\n            return g ? this._scene.beginAnimation(this, g.from, g.to, T, S, E) : null;\n          }, m.prototype.serializeAnimationRanges = function() {\n            var c = [];\n            for (var T in this._ranges) {\n              var S = this._ranges[T];\n              if (S) {\n                var E = {};\n                E.name = T, E.from = S.from, E.to = S.to, c.push(E);\n              }\n            }\n            return c;\n          }, m.prototype.computeWorldMatrix = function(c) {\n            return this._worldMatrix || (this._worldMatrix = _.a.Identity()), this._worldMatrix;\n          }, m.prototype.dispose = function(c, T) {\n            if (T === void 0 && (T = !1), this._isDisposed = !0, !c)\n              for (var S = 0, E = this.getDescendants(!0); S < E.length; S++)\n                E[S].dispose(c, T);\n            this.parent ? this.parent = null : this._removeFromSceneRootNodes(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n            for (var g = 0, l = this._behaviors; g < l.length; g++)\n              l[g].detach();\n            this._behaviors = [];\n          }, m.ParseAnimationRanges = function(c, T, S) {\n            if (T.ranges)\n              for (var E = 0; E < T.ranges.length; E++) {\n                var g = T.ranges[E];\n                c.createAnimationRange(g.name, g.from, g.to);\n              }\n          }, m.prototype.getHierarchyBoundingVectors = function(c, T) {\n            var S, E;\n            if (c === void 0 && (c = !0), T === void 0 && (T = null), this.getScene().incrementRenderId(), this.computeWorldMatrix(!0), this.getBoundingInfo && this.subMeshes) {\n              var g = this.getBoundingInfo();\n              S = g.boundingBox.minimumWorld.clone(), E = g.boundingBox.maximumWorld.clone();\n            } else\n              S = new _.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), E = new _.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n            if (c)\n              for (var l = 0, h = this.getDescendants(!1); l < h.length; l++) {\n                var v = h[l];\n                if (v.computeWorldMatrix(!0), (!T || T(v)) && v.getBoundingInfo && v.getTotalVertices() !== 0) {\n                  var b = v.getBoundingInfo().boundingBox, D = b.minimumWorld, w = b.maximumWorld;\n                  _.e.CheckExtends(D, S, E), _.e.CheckExtends(w, S, E);\n                }\n              }\n            return { min: S, max: E };\n          }, m._AnimationRangeFactory = function(c, T, S) {\n            throw O.a.WarnImport(\"AnimationRange\");\n          }, m._NodeConstructors = {}, Object(V.c)([Object(C.c)()], m.prototype, \"name\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"id\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"uniqueId\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"state\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"metadata\", void 0), m;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return de;\n        }), f.d(A, \"a\", function() {\n          return pe;\n        });\n        var V = f(1), _ = f(3), C = f(33), u = f(20), I = f(0), O = f(9), x = f(4), m = f(105), c = f(42), T = f(25), S = f(76), E = f(87), g = f(15), l = f(10), h = f(11), v = f(19), b = f(5), D = `uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif`;\n        b.a.IncludesShadersStore.defaultFragmentDeclaration = D;\n        var w = `layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor;\nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix;\nvec2 vTangentSpaceParams;\nfloat pointSize;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nfloat visibility;\nvec4 vDiffuseColor;\nvec4 vDetailInfos;\nmat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};\n`;\n        b.a.IncludesShadersStore.defaultUboDeclaration = w, f(160), f(59), f(106), f(107), f(154), f(130), f(161), f(131), f(108), f(109), f(132), f(133), f(115), f(116), f(125), f(110), f(134), f(162), f(135), f(155), f(136);\n        var N = `#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\n#if SPECULARDIRECTUV == 1\n#define vSpecularUV vMainUV1\n#elif SPECULARDIRECTUV == 2\n#define vSpecularUV vMainUV2\n#else\nvarying vec2 vSpecularUV;\n#endif\nuniform sampler2D specularSampler;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n\n#include<fresnelFunction>\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec4 refractionColor=vec4(0.,0.,0.,1.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0) {\nrefractionColor=textureCube(refractionCubeSampler,refractionVector);\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\n#endif\nrefractionColor.rgb*=vRefractionInfos.x;\n#endif\n\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\ndiscard;\n#endif\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\n#else\ncolor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\n#endif\ncolor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\ngl_FragData[0]=color;\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef PREPASS_IRRADIANCE\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[PREPASS_DEPTHNORMAL_INDEX]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=specularMapColor;\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=color;\n#endif\n}\n`;\n        b.a.ShadersStore.defaultPixelShader = N;\n        var M = `\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef REFLECTION\nuniform mat4 reflectionMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n`;\n        b.a.IncludesShadersStore.defaultVertexDeclaration = M, f(78), f(79), f(163), f(164), f(117), f(137), f(93), f(94), f(100), f(80), f(81), f(165), f(156), f(111), f(157), f(138), b.a.IncludesShadersStore.pointCloudVertex = `#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif`, f(158);\n        var U = `#include<__decl__defaultVertex>\n\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nvarying vec2 vSpecularUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\nvPositionW=vec3(worldPos);\n#include<prePassVertex>\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n#include<pointCloudVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n        b.a.ShadersStore.defaultVertexShader = U;\n        var X = f(2), j = f(67), ne = f(92), te = { effect: null, subMesh: null }, de = function(ae) {\n          function ee() {\n            var K = ae.call(this) || this;\n            return K.MAINUV1 = !1, K.MAINUV2 = !1, K.DIFFUSE = !1, K.DIFFUSEDIRECTUV = 0, K.DETAIL = !1, K.DETAILDIRECTUV = 0, K.DETAIL_NORMALBLENDMETHOD = 0, K.AMBIENT = !1, K.AMBIENTDIRECTUV = 0, K.OPACITY = !1, K.OPACITYDIRECTUV = 0, K.OPACITYRGB = !1, K.REFLECTION = !1, K.EMISSIVE = !1, K.EMISSIVEDIRECTUV = 0, K.SPECULAR = !1, K.SPECULARDIRECTUV = 0, K.BUMP = !1, K.BUMPDIRECTUV = 0, K.PARALLAX = !1, K.PARALLAXOCCLUSION = !1, K.SPECULAROVERALPHA = !1, K.CLIPPLANE = !1, K.CLIPPLANE2 = !1, K.CLIPPLANE3 = !1, K.CLIPPLANE4 = !1, K.CLIPPLANE5 = !1, K.CLIPPLANE6 = !1, K.ALPHATEST = !1, K.DEPTHPREPASS = !1, K.ALPHAFROMDIFFUSE = !1, K.POINTSIZE = !1, K.FOG = !1, K.SPECULARTERM = !1, K.DIFFUSEFRESNEL = !1, K.OPACITYFRESNEL = !1, K.REFLECTIONFRESNEL = !1, K.REFRACTIONFRESNEL = !1, K.EMISSIVEFRESNEL = !1, K.FRESNEL = !1, K.NORMAL = !1, K.UV1 = !1, K.UV2 = !1, K.VERTEXCOLOR = !1, K.VERTEXALPHA = !1, K.NUM_BONE_INFLUENCERS = 0, K.BonesPerMesh = 0, K.BONETEXTURE = !1, K.BONES_VELOCITY_ENABLED = !1, K.INSTANCES = !1, K.THIN_INSTANCES = !1, K.GLOSSINESS = !1, K.ROUGHNESS = !1, K.EMISSIVEASILLUMINATION = !1, K.LINKEMISSIVEWITHDIFFUSE = !1, K.REFLECTIONFRESNELFROMSPECULAR = !1, K.LIGHTMAP = !1, K.LIGHTMAPDIRECTUV = 0, K.OBJECTSPACE_NORMALMAP = !1, K.USELIGHTMAPASSHADOWMAP = !1, K.REFLECTIONMAP_3D = !1, K.REFLECTIONMAP_SPHERICAL = !1, K.REFLECTIONMAP_PLANAR = !1, K.REFLECTIONMAP_CUBIC = !1, K.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, K.REFLECTIONMAP_PROJECTION = !1, K.REFLECTIONMAP_SKYBOX = !1, K.REFLECTIONMAP_EXPLICIT = !1, K.REFLECTIONMAP_EQUIRECTANGULAR = !1, K.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, K.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, K.INVERTCUBICMAP = !1, K.LOGARITHMICDEPTH = !1, K.REFRACTION = !1, K.REFRACTIONMAP_3D = !1, K.REFLECTIONOVERALPHA = !1, K.TWOSIDEDLIGHTING = !1, K.SHADOWFLOAT = !1, K.MORPHTARGETS = !1, K.MORPHTARGETS_NORMAL = !1, K.MORPHTARGETS_TANGENT = !1, K.MORPHTARGETS_UV = !1, K.NUM_MORPH_INFLUENCERS = 0, K.NONUNIFORMSCALING = !1, K.PREMULTIPLYALPHA = !1, K.ALPHATEST_AFTERALLALPHACOMPUTATIONS = !1, K.ALPHABLEND = !0, K.PREPASS = !1, K.PREPASS_IRRADIANCE = !1, K.PREPASS_IRRADIANCE_INDEX = -1, K.PREPASS_ALBEDO = !1, K.PREPASS_ALBEDO_INDEX = -1, K.PREPASS_DEPTHNORMAL = !1, K.PREPASS_DEPTHNORMAL_INDEX = -1, K.PREPASS_POSITION = !1, K.PREPASS_POSITION_INDEX = -1, K.PREPASS_VELOCITY = !1, K.PREPASS_VELOCITY_INDEX = -1, K.PREPASS_REFLECTIVITY = !1, K.PREPASS_REFLECTIVITY_INDEX = -1, K.SCENE_MRT_COUNT = 0, K.RGBDLIGHTMAP = !1, K.RGBDREFLECTION = !1, K.RGBDREFRACTION = !1, K.IMAGEPROCESSING = !1, K.VIGNETTE = !1, K.VIGNETTEBLENDMODEMULTIPLY = !1, K.VIGNETTEBLENDMODEOPAQUE = !1, K.TONEMAPPING = !1, K.TONEMAPPING_ACES = !1, K.CONTRAST = !1, K.COLORCURVES = !1, K.COLORGRADING = !1, K.COLORGRADING3D = !1, K.SAMPLER3DGREENDEPTH = !1, K.SAMPLER3DBGRMAP = !1, K.IMAGEPROCESSINGPOSTPROCESS = !1, K.MULTIVIEW = !1, K.IS_REFLECTION_LINEAR = !1, K.IS_REFRACTION_LINEAR = !1, K.EXPOSURE = !1, K.rebuild(), K;\n          }\n          return Object(V.d)(ee, ae), ee.prototype.setReflectionMode = function(K) {\n            for (var $ = 0, L = [\"REFLECTIONMAP_CUBIC\", \"REFLECTIONMAP_EXPLICIT\", \"REFLECTIONMAP_PLANAR\", \"REFLECTIONMAP_PROJECTION\", \"REFLECTIONMAP_PROJECTION\", \"REFLECTIONMAP_SKYBOX\", \"REFLECTIONMAP_SPHERICAL\", \"REFLECTIONMAP_EQUIRECTANGULAR\", \"REFLECTIONMAP_EQUIRECTANGULAR_FIXED\", \"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\"]; $ < L.length; $++) {\n              var G = L[$];\n              this[G] = G === K;\n            }\n          }, ee;\n        }(S.a), pe = function(ae) {\n          function ee(K, $) {\n            var L = ae.call(this, K, $) || this;\n            return L._diffuseTexture = null, L._ambientTexture = null, L._opacityTexture = null, L._reflectionTexture = null, L._emissiveTexture = null, L._specularTexture = null, L._bumpTexture = null, L._lightmapTexture = null, L._refractionTexture = null, L.ambientColor = new O.a(0, 0, 0), L.diffuseColor = new O.a(1, 1, 1), L.specularColor = new O.a(1, 1, 1), L.emissiveColor = new O.a(0, 0, 0), L.specularPower = 64, L._useAlphaFromDiffuseTexture = !1, L._useEmissiveAsIllumination = !1, L._linkEmissiveWithDiffuse = !1, L._useSpecularOverAlpha = !1, L._useReflectionOverAlpha = !1, L._disableLighting = !1, L._useObjectSpaceNormalMap = !1, L._useParallax = !1, L._useParallaxOcclusion = !1, L.parallaxScaleBias = 0.05, L._roughness = 0, L.indexOfRefraction = 0.98, L.invertRefractionY = !0, L.alphaCutOff = 0.4, L._useLightmapAsShadowmap = !1, L._useReflectionFresnelFromSpecular = !1, L._useGlossinessFromSpecularMapAlpha = !1, L._maxSimultaneousLights = 4, L._invertNormalMapX = !1, L._invertNormalMapY = !1, L._twoSidedLighting = !1, L.detailMap = new ne.a(L._markAllSubMeshesAsTexturesDirty.bind(L)), L._renderTargets = new C.a(16), L._worldViewProjectionMatrix = I.a.Zero(), L._globalAmbientColor = new O.a(0, 0, 0), L._rebuildInParallel = !1, L._attachImageProcessingConfiguration(null), L.prePassConfiguration = new m.a(), L.getRenderTargetTextures = function() {\n              return L._renderTargets.reset(), ee.ReflectionTextureEnabled && L._reflectionTexture && L._reflectionTexture.isRenderTarget && L._renderTargets.push(L._reflectionTexture), ee.RefractionTextureEnabled && L._refractionTexture && L._refractionTexture.isRenderTarget && L._renderTargets.push(L._refractionTexture), L._renderTargets;\n            }, L;\n          }\n          return Object(V.d)(ee, ae), Object.defineProperty(ee.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(K) {\n            this._attachImageProcessingConfiguration(K), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), ee.prototype._attachImageProcessingConfiguration = function(K) {\n            var $ = this;\n            K !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = K || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              $._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, Object.defineProperty(ee.prototype, \"cameraColorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(K) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraColorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(K) {\n            this.imageProcessingConfiguration.colorGradingEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraToneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.toneMappingEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraExposure\", { get: function() {\n            return this._imageProcessingConfiguration.exposure;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.exposure = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraContrast\", { get: function() {\n            return this._imageProcessingConfiguration.contrast;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.contrast = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraColorGradingTexture\", { get: function() {\n            return this._imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.colorGradingTexture = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraColorCurves\", { get: function() {\n            return this._imageProcessingConfiguration.colorCurves;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.colorCurves = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"canRenderToMRT\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !!(ee.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || !!(ee.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget);\n          }, enumerable: !1, configurable: !0 }), ee.prototype.getClassName = function() {\n            return \"StandardMaterial\";\n          }, Object.defineProperty(ee.prototype, \"useLogarithmicDepth\", { get: function() {\n            return this._useLogarithmicDepth;\n          }, set: function(K) {\n            this._useLogarithmicDepth = K && this.getScene().getEngine().getCaps().fragmentDepthSupported, this._markAllSubMeshesAsMiscDirty();\n          }, enumerable: !1, configurable: !0 }), ee.prototype.needAlphaBlending = function() {\n            return !this._disableAlphaBlending && (this.alpha < 1 || this._opacityTexture != null || this._shouldUseAlphaFromDiffuseTexture() || this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled);\n          }, ee.prototype.needAlphaTesting = function() {\n            return !!this._forceAlphaTest || this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === T.a.MATERIAL_ALPHATEST);\n          }, ee.prototype._shouldUseAlphaFromDiffuseTexture = function() {\n            return this._diffuseTexture != null && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture && this._transparencyMode !== T.a.MATERIAL_OPAQUE;\n          }, ee.prototype._hasAlphaChannel = function() {\n            return this._diffuseTexture != null && this._diffuseTexture.hasAlpha || this._opacityTexture != null;\n          }, ee.prototype.getAlphaTestTexture = function() {\n            return this._diffuseTexture;\n          }, ee.prototype.isReadyForSubMesh = function(K, $, L) {\n            if (L === void 0 && (L = !1), $.effect && this.isFrozen && $.effect._wasPreviouslyReady)\n              return !0;\n            $._materialDefines || ($._materialDefines = new de());\n            var G = this.getScene(), Q = $._materialDefines;\n            if (this._isReadyForSubMesh($))\n              return !0;\n            var oe = G.getEngine();\n            if (Q._needNormals = g.a.PrepareDefinesForLights(G, K, Q, !0, this._maxSimultaneousLights, this._disableLighting), g.a.PrepareDefinesForMultiview(G, Q), g.a.PrepareDefinesForPrePass(G, Q, this.canRenderToMRT), Q._areTexturesDirty) {\n              if (Q._needUVs = !1, Q.MAINUV1 = !1, Q.MAINUV2 = !1, G.texturesEnabled) {\n                if (this._diffuseTexture && ee.DiffuseTextureEnabled) {\n                  if (!this._diffuseTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._diffuseTexture, Q, \"DIFFUSE\");\n                } else\n                  Q.DIFFUSE = !1;\n                if (this._ambientTexture && ee.AmbientTextureEnabled) {\n                  if (!this._ambientTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._ambientTexture, Q, \"AMBIENT\");\n                } else\n                  Q.AMBIENT = !1;\n                if (this._opacityTexture && ee.OpacityTextureEnabled) {\n                  if (!this._opacityTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._opacityTexture, Q, \"OPACITY\"), Q.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;\n                } else\n                  Q.OPACITY = !1;\n                if (this._reflectionTexture && ee.ReflectionTextureEnabled) {\n                  if (!this._reflectionTexture.isReadyOrNotBlocking())\n                    return !1;\n                  switch (Q._needNormals = !0, Q.REFLECTION = !0, Q.ROUGHNESS = this._roughness > 0, Q.REFLECTIONOVERALPHA = this._useReflectionOverAlpha, Q.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === l.a.INVCUBIC_MODE, Q.REFLECTIONMAP_3D = this._reflectionTexture.isCube, Q.RGBDREFLECTION = this._reflectionTexture.isRGBD, this._reflectionTexture.coordinatesMode) {\n                    case l.a.EXPLICIT_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_EXPLICIT\");\n                      break;\n                    case l.a.PLANAR_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_PLANAR\");\n                      break;\n                    case l.a.PROJECTION_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_PROJECTION\");\n                      break;\n                    case l.a.SKYBOX_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_SKYBOX\");\n                      break;\n                    case l.a.SPHERICAL_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_SPHERICAL\");\n                      break;\n                    case l.a.EQUIRECTANGULAR_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_EQUIRECTANGULAR\");\n                      break;\n                    case l.a.FIXED_EQUIRECTANGULAR_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_EQUIRECTANGULAR_FIXED\");\n                      break;\n                    case l.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\");\n                      break;\n                    case l.a.CUBIC_MODE:\n                    case l.a.INVCUBIC_MODE:\n                    default:\n                      Q.setReflectionMode(\"REFLECTIONMAP_CUBIC\");\n                  }\n                  Q.USE_LOCAL_REFLECTIONMAP_CUBIC = !!this._reflectionTexture.boundingBoxSize;\n                } else\n                  Q.REFLECTION = !1;\n                if (this._emissiveTexture && ee.EmissiveTextureEnabled) {\n                  if (!this._emissiveTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._emissiveTexture, Q, \"EMISSIVE\");\n                } else\n                  Q.EMISSIVE = !1;\n                if (this._lightmapTexture && ee.LightmapTextureEnabled) {\n                  if (!this._lightmapTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._lightmapTexture, Q, \"LIGHTMAP\"), Q.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, Q.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;\n                } else\n                  Q.LIGHTMAP = !1;\n                if (this._specularTexture && ee.SpecularTextureEnabled) {\n                  if (!this._specularTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._specularTexture, Q, \"SPECULAR\"), Q.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha;\n                } else\n                  Q.SPECULAR = !1;\n                if (G.getEngine().getCaps().standardDerivatives && this._bumpTexture && ee.BumpTextureEnabled) {\n                  if (!this._bumpTexture.isReady())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._bumpTexture, Q, \"BUMP\"), Q.PARALLAX = this._useParallax, Q.PARALLAXOCCLUSION = this._useParallaxOcclusion, Q.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;\n                } else\n                  Q.BUMP = !1;\n                if (this._refractionTexture && ee.RefractionTextureEnabled) {\n                  if (!this._refractionTexture.isReadyOrNotBlocking())\n                    return !1;\n                  Q._needUVs = !0, Q.REFRACTION = !0, Q.REFRACTIONMAP_3D = this._refractionTexture.isCube, Q.RGBDREFRACTION = this._refractionTexture.isRGBD;\n                } else\n                  Q.REFRACTION = !1;\n                Q.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting;\n              } else\n                Q.DIFFUSE = !1, Q.AMBIENT = !1, Q.OPACITY = !1, Q.REFLECTION = !1, Q.EMISSIVE = !1, Q.LIGHTMAP = !1, Q.BUMP = !1, Q.REFRACTION = !1;\n              Q.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture(), Q.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination, Q.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse, Q.SPECULAROVERALPHA = this._useSpecularOverAlpha, Q.PREMULTIPLYALPHA = this.alphaMode === X.a.ALPHA_PREMULTIPLIED || this.alphaMode === X.a.ALPHA_PREMULTIPLIED_PORTERDUFF, Q.ALPHATEST_AFTERALLALPHACOMPUTATIONS = this.transparencyMode !== null, Q.ALPHABLEND = this.transparencyMode === null || this.needAlphaBlendingForMesh(K);\n            }\n            if (!this.detailMap.isReadyForSubMesh(Q, G))\n              return !1;\n            if (Q._areImageProcessingDirty && this._imageProcessingConfiguration) {\n              if (!this._imageProcessingConfiguration.isReady())\n                return !1;\n              this._imageProcessingConfiguration.prepareDefines(Q), Q.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace, Q.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;\n            }\n            if (Q._areFresnelDirty && (ee.FresnelEnabled ? (this._diffuseFresnelParameters || this._opacityFresnelParameters || this._emissiveFresnelParameters || this._refractionFresnelParameters || this._reflectionFresnelParameters) && (Q.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled, Q.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled, Q.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled, Q.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular, Q.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled, Q.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled, Q._needNormals = !0, Q.FRESNEL = !0) : Q.FRESNEL = !1), g.a.PrepareDefinesForMisc(K, G, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(K) || this._forceAlphaTest, Q), g.a.PrepareDefinesForAttributes(K, Q, !0, !0, !0), g.a.PrepareDefinesForFrameBoundValues(G, oe, Q, L, null, $.getRenderingMesh().hasThinInstances), this.detailMap.prepareDefines(Q, G), Q.isDirty) {\n              var re = Q._areLightsDisposed;\n              Q.markAsProcessed();\n              var Y = new j.a();\n              Q.REFLECTION && Y.addFallback(0, \"REFLECTION\"), Q.SPECULAR && Y.addFallback(0, \"SPECULAR\"), Q.BUMP && Y.addFallback(0, \"BUMP\"), Q.PARALLAX && Y.addFallback(1, \"PARALLAX\"), Q.PARALLAXOCCLUSION && Y.addFallback(0, \"PARALLAXOCCLUSION\"), Q.SPECULAROVERALPHA && Y.addFallback(0, \"SPECULAROVERALPHA\"), Q.FOG && Y.addFallback(1, \"FOG\"), Q.POINTSIZE && Y.addFallback(0, \"POINTSIZE\"), Q.LOGARITHMICDEPTH && Y.addFallback(0, \"LOGARITHMICDEPTH\"), g.a.HandleFallbacksForShadows(Q, Y, this._maxSimultaneousLights), Q.SPECULARTERM && Y.addFallback(0, \"SPECULARTERM\"), Q.DIFFUSEFRESNEL && Y.addFallback(1, \"DIFFUSEFRESNEL\"), Q.OPACITYFRESNEL && Y.addFallback(2, \"OPACITYFRESNEL\"), Q.REFLECTIONFRESNEL && Y.addFallback(3, \"REFLECTIONFRESNEL\"), Q.EMISSIVEFRESNEL && Y.addFallback(4, \"EMISSIVEFRESNEL\"), Q.FRESNEL && Y.addFallback(4, \"FRESNEL\"), Q.MULTIVIEW && Y.addFallback(0, \"MULTIVIEW\");\n              var k = [x.b.PositionKind];\n              Q.NORMAL && k.push(x.b.NormalKind), Q.UV1 && k.push(x.b.UVKind), Q.UV2 && k.push(x.b.UV2Kind), Q.VERTEXCOLOR && k.push(x.b.ColorKind), g.a.PrepareAttributesForBones(k, K, Q, Y), g.a.PrepareAttributesForInstances(k, Q), g.a.PrepareAttributesForMorphTargets(k, K, Q);\n              var H = \"default\", Z = [\"world\", \"view\", \"viewProjection\", \"vEyePosition\", \"vLightsType\", \"vAmbientColor\", \"vDiffuseColor\", \"vSpecularColor\", \"vEmissiveColor\", \"visibility\", \"vFogInfos\", \"vFogColor\", \"pointSize\", \"vDiffuseInfos\", \"vAmbientInfos\", \"vOpacityInfos\", \"vReflectionInfos\", \"vEmissiveInfos\", \"vSpecularInfos\", \"vBumpInfos\", \"vLightmapInfos\", \"vRefractionInfos\", \"mBones\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"diffuseMatrix\", \"ambientMatrix\", \"opacityMatrix\", \"reflectionMatrix\", \"emissiveMatrix\", \"specularMatrix\", \"bumpMatrix\", \"normalMatrix\", \"lightmapMatrix\", \"refractionMatrix\", \"diffuseLeftColor\", \"diffuseRightColor\", \"opacityParts\", \"reflectionLeftColor\", \"reflectionRightColor\", \"emissiveLeftColor\", \"emissiveRightColor\", \"refractionLeftColor\", \"refractionRightColor\", \"vReflectionPosition\", \"vReflectionSize\", \"logarithmicDepthConstant\", \"vTangentSpaceParams\", \"alphaCutOff\", \"boneTextureWidth\"], W = [\"diffuseSampler\", \"ambientSampler\", \"opacitySampler\", \"reflectionCubeSampler\", \"reflection2DSampler\", \"emissiveSampler\", \"specularSampler\", \"bumpSampler\", \"lightmapSampler\", \"refractionCubeSampler\", \"refraction2DSampler\", \"boneSampler\"], q = [\"Material\", \"Scene\"];\n              ne.a.AddUniforms(Z), ne.a.AddSamplers(W), m.a.AddUniforms(Z), m.a.AddSamplers(Z), c.a && (c.a.PrepareUniforms(Z, Q), c.a.PrepareSamplers(W, Q)), g.a.PrepareUniformsAndSamplersList({ uniformsNames: Z, uniformBuffersNames: q, samplers: W, defines: Q, maxSimultaneousLights: this._maxSimultaneousLights });\n              var he = {};\n              this.customShaderNameResolve && (H = this.customShaderNameResolve(H, Z, q, W, Q, k, he));\n              var ge = Q.toString(), me = $.effect, _e = G.getEngine().createEffect(H, { attributes: k, uniformsNames: Z, uniformBuffersNames: q, samplers: W, defines: ge, fallbacks: Y, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: Q.NUM_MORPH_INFLUENCERS }, processFinalCode: he.processFinalCode, multiTarget: Q.PREPASS }, oe);\n              if (_e)\n                if (this._onEffectCreatedObservable && (te.effect = _e, te.subMesh = $, this._onEffectCreatedObservable.notifyObservers(te)), this.allowShaderHotSwapping && me && !_e.isReady()) {\n                  if (_e = me, this._rebuildInParallel = !0, Q.markAsUnprocessed(), re)\n                    return Q._areLightsDisposed = !0, !1;\n                } else\n                  this._rebuildInParallel = !1, G.resetCachedMaterial(), $.setEffect(_e, Q), this.buildUniformLayout();\n            }\n            return !(!$.effect || !$.effect.isReady()) && (Q._renderId = G.getRenderId(), $.effect._wasPreviouslyReady = !0, !0);\n          }, ee.prototype.buildUniformLayout = function() {\n            var K = this._uniformBuffer;\n            K.addUniform(\"diffuseLeftColor\", 4), K.addUniform(\"diffuseRightColor\", 4), K.addUniform(\"opacityParts\", 4), K.addUniform(\"reflectionLeftColor\", 4), K.addUniform(\"reflectionRightColor\", 4), K.addUniform(\"refractionLeftColor\", 4), K.addUniform(\"refractionRightColor\", 4), K.addUniform(\"emissiveLeftColor\", 4), K.addUniform(\"emissiveRightColor\", 4), K.addUniform(\"vDiffuseInfos\", 2), K.addUniform(\"vAmbientInfos\", 2), K.addUniform(\"vOpacityInfos\", 2), K.addUniform(\"vReflectionInfos\", 2), K.addUniform(\"vReflectionPosition\", 3), K.addUniform(\"vReflectionSize\", 3), K.addUniform(\"vEmissiveInfos\", 2), K.addUniform(\"vLightmapInfos\", 2), K.addUniform(\"vSpecularInfos\", 2), K.addUniform(\"vBumpInfos\", 3), K.addUniform(\"diffuseMatrix\", 16), K.addUniform(\"ambientMatrix\", 16), K.addUniform(\"opacityMatrix\", 16), K.addUniform(\"reflectionMatrix\", 16), K.addUniform(\"emissiveMatrix\", 16), K.addUniform(\"lightmapMatrix\", 16), K.addUniform(\"specularMatrix\", 16), K.addUniform(\"bumpMatrix\", 16), K.addUniform(\"vTangentSpaceParams\", 2), K.addUniform(\"pointSize\", 1), K.addUniform(\"refractionMatrix\", 16), K.addUniform(\"vRefractionInfos\", 4), K.addUniform(\"vSpecularColor\", 4), K.addUniform(\"vEmissiveColor\", 3), K.addUniform(\"visibility\", 1), K.addUniform(\"vDiffuseColor\", 4), ne.a.PrepareUniformBuffer(K), K.create();\n          }, ee.prototype.unbind = function() {\n            if (this._activeEffect) {\n              var K = !1;\n              this._reflectionTexture && this._reflectionTexture.isRenderTarget && (this._activeEffect.setTexture(\"reflection2DSampler\", null), K = !0), this._refractionTexture && this._refractionTexture.isRenderTarget && (this._activeEffect.setTexture(\"refraction2DSampler\", null), K = !0), K && this._markAllSubMeshesAsTexturesDirty();\n            }\n            ae.prototype.unbind.call(this);\n          }, ee.prototype.bindForSubMesh = function(K, $, L) {\n            var G = this.getScene(), Q = L._materialDefines;\n            if (Q) {\n              var oe = L.effect;\n              if (oe) {\n                this._activeEffect = oe, Q.INSTANCES && !Q.THIN_INSTANCES || this.bindOnlyWorldMatrix(K), this.prePassConfiguration.bindForSubMesh(this._activeEffect, G, $, K, this.isFrozen), Q.OBJECTSPACE_NORMALMAP && (K.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));\n                var re = this._mustRebind(G, oe, $.visibility);\n                g.a.BindBonesParameters($, oe);\n                var Y = this._uniformBuffer;\n                if (re) {\n                  if (Y.bindToEffect(oe, \"Material\"), this.bindViewProjection(oe), !Y.useUbo || !this.isFrozen || !Y.isSync) {\n                    if (ee.FresnelEnabled && Q.FRESNEL && (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled && (Y.updateColor4(\"diffuseLeftColor\", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power), Y.updateColor4(\"diffuseRightColor\", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias)), this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled && Y.updateColor4(\"opacityParts\", new O.a(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power), this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled && (Y.updateColor4(\"reflectionLeftColor\", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power), Y.updateColor4(\"reflectionRightColor\", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias)), this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled && (Y.updateColor4(\"refractionLeftColor\", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power), Y.updateColor4(\"refractionRightColor\", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias)), this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled && (Y.updateColor4(\"emissiveLeftColor\", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power), Y.updateColor4(\"emissiveRightColor\", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias))), G.texturesEnabled) {\n                      if (this._diffuseTexture && ee.DiffuseTextureEnabled && (Y.updateFloat2(\"vDiffuseInfos\", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), g.a.BindTextureMatrix(this._diffuseTexture, Y, \"diffuse\")), this._ambientTexture && ee.AmbientTextureEnabled && (Y.updateFloat2(\"vAmbientInfos\", this._ambientTexture.coordinatesIndex, this._ambientTexture.level), g.a.BindTextureMatrix(this._ambientTexture, Y, \"ambient\")), this._opacityTexture && ee.OpacityTextureEnabled && (Y.updateFloat2(\"vOpacityInfos\", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), g.a.BindTextureMatrix(this._opacityTexture, Y, \"opacity\")), this._hasAlphaChannel() && oe.setFloat(\"alphaCutOff\", this.alphaCutOff), this._reflectionTexture && ee.ReflectionTextureEnabled && (Y.updateFloat2(\"vReflectionInfos\", this._reflectionTexture.level, this.roughness), Y.updateMatrix(\"reflectionMatrix\", this._reflectionTexture.getReflectionTextureMatrix()), this._reflectionTexture.boundingBoxSize)) {\n                        var k = this._reflectionTexture;\n                        Y.updateVector3(\"vReflectionPosition\", k.boundingBoxPosition), Y.updateVector3(\"vReflectionSize\", k.boundingBoxSize);\n                      }\n                      if (this._emissiveTexture && ee.EmissiveTextureEnabled && (Y.updateFloat2(\"vEmissiveInfos\", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), g.a.BindTextureMatrix(this._emissiveTexture, Y, \"emissive\")), this._lightmapTexture && ee.LightmapTextureEnabled && (Y.updateFloat2(\"vLightmapInfos\", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), g.a.BindTextureMatrix(this._lightmapTexture, Y, \"lightmap\")), this._specularTexture && ee.SpecularTextureEnabled && (Y.updateFloat2(\"vSpecularInfos\", this._specularTexture.coordinatesIndex, this._specularTexture.level), g.a.BindTextureMatrix(this._specularTexture, Y, \"specular\")), this._bumpTexture && G.getEngine().getCaps().standardDerivatives && ee.BumpTextureEnabled && (Y.updateFloat3(\"vBumpInfos\", this._bumpTexture.coordinatesIndex, 1 / this._bumpTexture.level, this.parallaxScaleBias), g.a.BindTextureMatrix(this._bumpTexture, Y, \"bump\"), G._mirroredCameraPosition ? Y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : Y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1)), this._refractionTexture && ee.RefractionTextureEnabled) {\n                        var H = 1;\n                        this._refractionTexture.isCube || (Y.updateMatrix(\"refractionMatrix\", this._refractionTexture.getReflectionTextureMatrix()), this._refractionTexture.depth && (H = this._refractionTexture.depth)), Y.updateFloat4(\"vRefractionInfos\", this._refractionTexture.level, this.indexOfRefraction, H, this.invertRefractionY ? -1 : 1);\n                      }\n                    }\n                    this.pointsCloud && Y.updateFloat(\"pointSize\", this.pointSize), Q.SPECULARTERM && Y.updateColor4(\"vSpecularColor\", this.specularColor, this.specularPower), Y.updateColor3(\"vEmissiveColor\", ee.EmissiveTextureEnabled ? this.emissiveColor : O.a.BlackReadOnly), Y.updateColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha);\n                  }\n                  Y.updateFloat(\"visibility\", $.visibility), G.texturesEnabled && (this._diffuseTexture && ee.DiffuseTextureEnabled && oe.setTexture(\"diffuseSampler\", this._diffuseTexture), this._ambientTexture && ee.AmbientTextureEnabled && oe.setTexture(\"ambientSampler\", this._ambientTexture), this._opacityTexture && ee.OpacityTextureEnabled && oe.setTexture(\"opacitySampler\", this._opacityTexture), this._reflectionTexture && ee.ReflectionTextureEnabled && (this._reflectionTexture.isCube ? oe.setTexture(\"reflectionCubeSampler\", this._reflectionTexture) : oe.setTexture(\"reflection2DSampler\", this._reflectionTexture)), this._emissiveTexture && ee.EmissiveTextureEnabled && oe.setTexture(\"emissiveSampler\", this._emissiveTexture), this._lightmapTexture && ee.LightmapTextureEnabled && oe.setTexture(\"lightmapSampler\", this._lightmapTexture), this._specularTexture && ee.SpecularTextureEnabled && oe.setTexture(\"specularSampler\", this._specularTexture), this._bumpTexture && G.getEngine().getCaps().standardDerivatives && ee.BumpTextureEnabled && oe.setTexture(\"bumpSampler\", this._bumpTexture), this._refractionTexture && ee.RefractionTextureEnabled) && (H = 1, this._refractionTexture.isCube ? oe.setTexture(\"refractionCubeSampler\", this._refractionTexture) : oe.setTexture(\"refraction2DSampler\", this._refractionTexture)), this.detailMap.bindForSubMesh(Y, G, this.isFrozen), g.a.BindClipPlane(oe, G), G.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor), g.a.BindEyePosition(oe, G), oe.setColor3(\"vAmbientColor\", this._globalAmbientColor);\n                }\n                !re && this.isFrozen || (G.lightsEnabled && !this._disableLighting && g.a.BindLights(G, $, oe, Q, this._maxSimultaneousLights, this._rebuildInParallel), (G.fogEnabled && $.applyFog && G.fogMode !== u.a.FOGMODE_NONE || this._reflectionTexture || this._refractionTexture) && this.bindView(oe), g.a.BindFogParameters(G, $, oe), Q.NUM_MORPH_INFLUENCERS && g.a.BindMorphTargetParameters($, oe), this.useLogarithmicDepth && g.a.BindLogDepth(Q, oe, G), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect)), Y.update(), this._afterBind($, this._activeEffect);\n              }\n            }\n          }, ee.prototype.getAnimatables = function() {\n            var K = [];\n            return this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0 && K.push(this._diffuseTexture), this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0 && K.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0 && K.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0 && K.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0 && K.push(this._emissiveTexture), this._specularTexture && this._specularTexture.animations && this._specularTexture.animations.length > 0 && K.push(this._specularTexture), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && K.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0 && K.push(this._lightmapTexture), this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0 && K.push(this._refractionTexture), this.detailMap.getAnimatables(K), K;\n          }, ee.prototype.getActiveTextures = function() {\n            var K = ae.prototype.getActiveTextures.call(this);\n            return this._diffuseTexture && K.push(this._diffuseTexture), this._ambientTexture && K.push(this._ambientTexture), this._opacityTexture && K.push(this._opacityTexture), this._reflectionTexture && K.push(this._reflectionTexture), this._emissiveTexture && K.push(this._emissiveTexture), this._specularTexture && K.push(this._specularTexture), this._bumpTexture && K.push(this._bumpTexture), this._lightmapTexture && K.push(this._lightmapTexture), this._refractionTexture && K.push(this._refractionTexture), this.detailMap.getActiveTextures(K), K;\n          }, ee.prototype.hasTexture = function(K) {\n            return !!ae.prototype.hasTexture.call(this, K) || this._diffuseTexture === K || this._ambientTexture === K || this._opacityTexture === K || this._reflectionTexture === K || this._emissiveTexture === K || this._specularTexture === K || this._bumpTexture === K || this._lightmapTexture === K || this._refractionTexture === K || this.detailMap.hasTexture(K);\n          }, ee.prototype.dispose = function(K, $) {\n            var L, G, Q, oe, re, Y, k, H, Z;\n            $ && ((L = this._diffuseTexture) === null || L === void 0 || L.dispose(), (G = this._ambientTexture) === null || G === void 0 || G.dispose(), (Q = this._opacityTexture) === null || Q === void 0 || Q.dispose(), (oe = this._reflectionTexture) === null || oe === void 0 || oe.dispose(), (re = this._emissiveTexture) === null || re === void 0 || re.dispose(), (Y = this._specularTexture) === null || Y === void 0 || Y.dispose(), (k = this._bumpTexture) === null || k === void 0 || k.dispose(), (H = this._lightmapTexture) === null || H === void 0 || H.dispose(), (Z = this._refractionTexture) === null || Z === void 0 || Z.dispose()), this.detailMap.dispose($), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), ae.prototype.dispose.call(this, K, $);\n          }, ee.prototype.clone = function(K) {\n            var $ = this, L = _.a.Clone(function() {\n              return new ee(K, $.getScene());\n            }, this);\n            return L.name = K, L.id = K, L;\n          }, ee.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, ee.Parse = function(K, $, L) {\n            return _.a.Parse(function() {\n              return new ee(K.name, $);\n            }, K, $, L);\n          }, Object.defineProperty(ee, \"DiffuseTextureEnabled\", { get: function() {\n            return v.a.DiffuseTextureEnabled;\n          }, set: function(K) {\n            v.a.DiffuseTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"DetailTextureEnabled\", { get: function() {\n            return v.a.DetailTextureEnabled;\n          }, set: function(K) {\n            v.a.DetailTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"AmbientTextureEnabled\", { get: function() {\n            return v.a.AmbientTextureEnabled;\n          }, set: function(K) {\n            v.a.AmbientTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"OpacityTextureEnabled\", { get: function() {\n            return v.a.OpacityTextureEnabled;\n          }, set: function(K) {\n            v.a.OpacityTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"ReflectionTextureEnabled\", { get: function() {\n            return v.a.ReflectionTextureEnabled;\n          }, set: function(K) {\n            v.a.ReflectionTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"EmissiveTextureEnabled\", { get: function() {\n            return v.a.EmissiveTextureEnabled;\n          }, set: function(K) {\n            v.a.EmissiveTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"SpecularTextureEnabled\", { get: function() {\n            return v.a.SpecularTextureEnabled;\n          }, set: function(K) {\n            v.a.SpecularTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"BumpTextureEnabled\", { get: function() {\n            return v.a.BumpTextureEnabled;\n          }, set: function(K) {\n            v.a.BumpTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"LightmapTextureEnabled\", { get: function() {\n            return v.a.LightmapTextureEnabled;\n          }, set: function(K) {\n            v.a.LightmapTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"RefractionTextureEnabled\", { get: function() {\n            return v.a.RefractionTextureEnabled;\n          }, set: function(K) {\n            v.a.RefractionTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"ColorGradingTextureEnabled\", { get: function() {\n            return v.a.ColorGradingTextureEnabled;\n          }, set: function(K) {\n            v.a.ColorGradingTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"FresnelEnabled\", { get: function() {\n            return v.a.FresnelEnabled;\n          }, set: function(K) {\n            v.a.FresnelEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object(V.c)([Object(_.m)(\"diffuseTexture\")], ee.prototype, \"_diffuseTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], ee.prototype, \"diffuseTexture\", void 0), Object(V.c)([Object(_.m)(\"ambientTexture\")], ee.prototype, \"_ambientTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"ambientTexture\", void 0), Object(V.c)([Object(_.m)(\"opacityTexture\")], ee.prototype, \"_opacityTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], ee.prototype, \"opacityTexture\", void 0), Object(V.c)([Object(_.m)(\"reflectionTexture\")], ee.prototype, \"_reflectionTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"reflectionTexture\", void 0), Object(V.c)([Object(_.m)(\"emissiveTexture\")], ee.prototype, \"_emissiveTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"emissiveTexture\", void 0), Object(V.c)([Object(_.m)(\"specularTexture\")], ee.prototype, \"_specularTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"specularTexture\", void 0), Object(V.c)([Object(_.m)(\"bumpTexture\")], ee.prototype, \"_bumpTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"bumpTexture\", void 0), Object(V.c)([Object(_.m)(\"lightmapTexture\")], ee.prototype, \"_lightmapTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"lightmapTexture\", void 0), Object(V.c)([Object(_.m)(\"refractionTexture\")], ee.prototype, \"_refractionTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"refractionTexture\", void 0), Object(V.c)([Object(_.e)(\"ambient\")], ee.prototype, \"ambientColor\", void 0), Object(V.c)([Object(_.e)(\"diffuse\")], ee.prototype, \"diffuseColor\", void 0), Object(V.c)([Object(_.e)(\"specular\")], ee.prototype, \"specularColor\", void 0), Object(V.c)([Object(_.e)(\"emissive\")], ee.prototype, \"emissiveColor\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"specularPower\", void 0), Object(V.c)([Object(_.c)(\"useAlphaFromDiffuseTexture\")], ee.prototype, \"_useAlphaFromDiffuseTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], ee.prototype, \"useAlphaFromDiffuseTexture\", void 0), Object(V.c)([Object(_.c)(\"useEmissiveAsIllumination\")], ee.prototype, \"_useEmissiveAsIllumination\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useEmissiveAsIllumination\", void 0), Object(V.c)([Object(_.c)(\"linkEmissiveWithDiffuse\")], ee.prototype, \"_linkEmissiveWithDiffuse\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"linkEmissiveWithDiffuse\", void 0), Object(V.c)([Object(_.c)(\"useSpecularOverAlpha\")], ee.prototype, \"_useSpecularOverAlpha\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useSpecularOverAlpha\", void 0), Object(V.c)([Object(_.c)(\"useReflectionOverAlpha\")], ee.prototype, \"_useReflectionOverAlpha\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useReflectionOverAlpha\", void 0), Object(V.c)([Object(_.c)(\"disableLighting\")], ee.prototype, \"_disableLighting\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsLightsDirty\")], ee.prototype, \"disableLighting\", void 0), Object(V.c)([Object(_.c)(\"useObjectSpaceNormalMap\")], ee.prototype, \"_useObjectSpaceNormalMap\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useObjectSpaceNormalMap\", void 0), Object(V.c)([Object(_.c)(\"useParallax\")], ee.prototype, \"_useParallax\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useParallax\", void 0), Object(V.c)([Object(_.c)(\"useParallaxOcclusion\")], ee.prototype, \"_useParallaxOcclusion\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useParallaxOcclusion\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"parallaxScaleBias\", void 0), Object(V.c)([Object(_.c)(\"roughness\")], ee.prototype, \"_roughness\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"roughness\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"indexOfRefraction\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"invertRefractionY\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"alphaCutOff\", void 0), Object(V.c)([Object(_.c)(\"useLightmapAsShadowmap\")], ee.prototype, \"_useLightmapAsShadowmap\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useLightmapAsShadowmap\", void 0), Object(V.c)([Object(_.h)(\"diffuseFresnelParameters\")], ee.prototype, \"_diffuseFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"diffuseFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"opacityFresnelParameters\")], ee.prototype, \"_opacityFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelAndMiscDirty\")], ee.prototype, \"opacityFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"reflectionFresnelParameters\")], ee.prototype, \"_reflectionFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"reflectionFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"refractionFresnelParameters\")], ee.prototype, \"_refractionFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"refractionFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"emissiveFresnelParameters\")], ee.prototype, \"_emissiveFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"emissiveFresnelParameters\", void 0), Object(V.c)([Object(_.c)(\"useReflectionFresnelFromSpecular\")], ee.prototype, \"_useReflectionFresnelFromSpecular\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"useReflectionFresnelFromSpecular\", void 0), Object(V.c)([Object(_.c)(\"useGlossinessFromSpecularMapAlpha\")], ee.prototype, \"_useGlossinessFromSpecularMapAlpha\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useGlossinessFromSpecularMapAlpha\", void 0), Object(V.c)([Object(_.c)(\"maxSimultaneousLights\")], ee.prototype, \"_maxSimultaneousLights\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsLightsDirty\")], ee.prototype, \"maxSimultaneousLights\", void 0), Object(V.c)([Object(_.c)(\"invertNormalMapX\")], ee.prototype, \"_invertNormalMapX\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"invertNormalMapX\", void 0), Object(V.c)([Object(_.c)(\"invertNormalMapY\")], ee.prototype, \"_invertNormalMapY\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"invertNormalMapY\", void 0), Object(V.c)([Object(_.c)(\"twoSidedLighting\")], ee.prototype, \"_twoSidedLighting\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"twoSidedLighting\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"useLogarithmicDepth\", null), ee;\n        }(E.a);\n        h.a.RegisteredTypes[\"BABYLON.StandardMaterial\"] = pe, u.a.DefaultMaterialFactory = function(ae) {\n          return new pe(\"default material\", ae);\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return M;\n        });\n        var V = f(1), _ = f(12), C = f(6), u = f(0), I = f(13), O = f(4), x = f(16), m = f(46), c = f(54), T = f(43), S = f(2), E = f(147), g = f(21), l = f(101), h = f(9), v = f(28), b = f(23), D = f(11), w = function() {\n          this.facetNb = 0, this.partitioningSubdivisions = 10, this.partitioningBBoxRatio = 1.01, this.facetDataEnabled = !1, this.facetParameters = {}, this.bbSize = u.e.Zero(), this.subDiv = { max: 1, X: 1, Y: 1, Z: 1 }, this.facetDepthSort = !1, this.facetDepthSortEnabled = !1;\n        }, N = function() {\n          this._hasVertexAlpha = !1, this._useVertexColors = !0, this._numBoneInfluencers = 4, this._applyFog = !0, this._receiveShadows = !1, this._facetData = new w(), this._visibility = 1, this._skeleton = null, this._layerMask = 268435455, this._computeBonesUsingShaders = !0, this._isActive = !1, this._onlyForInstances = !1, this._isActiveIntermediate = !1, this._onlyForInstancesIntermediate = !1, this._actAsRegularMesh = !1, this._currentLOD = null, this._currentLODIsUpToDate = !1;\n        }, M = function(U) {\n          function X(j, ne) {\n            ne === void 0 && (ne = null);\n            var te = U.call(this, j, ne, !1) || this;\n            return te._internalAbstractMeshDataInfo = new N(), te.cullingStrategy = X.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, te.onCollideObservable = new C.c(), te.onCollisionPositionChangeObservable = new C.c(), te.onMaterialChangedObservable = new C.c(), te.definedFacingForward = !0, te._occlusionQuery = null, te._renderingGroup = null, te.alphaIndex = Number.MAX_VALUE, te.isVisible = !0, te.isPickable = !0, te.showSubMeshesBoundingBox = !1, te.isBlocker = !1, te.enablePointerMoveEvents = !1, te._renderingGroupId = 0, te._material = null, te.outlineColor = h.a.Red(), te.outlineWidth = 0.02, te.overlayColor = h.a.Red(), te.overlayAlpha = 0.5, te.useOctreeForRenderingSelection = !0, te.useOctreeForPicking = !0, te.useOctreeForCollisions = !0, te.alwaysSelectAsActiveMesh = !1, te.doNotSyncBoundingInfo = !1, te.actionManager = null, te._meshCollisionData = new E.a(), te.ellipsoid = new u.e(0.5, 1, 0.5), te.ellipsoidOffset = new u.e(0, 0, 0), te.edgesWidth = 1, te.edgesColor = new h.b(1, 0, 0, 1), te._edgesRenderer = null, te._masterMesh = null, te._boundingInfo = null, te._renderId = 0, te._intersectionsInProgress = new Array(), te._unIndexed = !1, te._lightSources = new Array(), te._waitingData = { lods: null, actions: null, freezeWorldMatrix: null }, te._bonesTransformMatrices = null, te._transformMatrixTexture = null, te.onRebuildObservable = new C.c(), te._onCollisionPositionChange = function(de, pe, ae) {\n              ae === void 0 && (ae = null), pe.subtractToRef(te._meshCollisionData._oldPositionForCollisions, te._meshCollisionData._diffPositionForCollisions), te._meshCollisionData._diffPositionForCollisions.length() > I.a.CollisionsEpsilon && te.position.addInPlace(te._meshCollisionData._diffPositionForCollisions), ae && te.onCollideObservable.notifyObservers(ae), te.onCollisionPositionChangeObservable.notifyObservers(te.position);\n            }, te.getScene().addMesh(te), te._resyncLightSources(), te;\n          }\n          return Object(V.d)(X, U), Object.defineProperty(X, \"BILLBOARDMODE_NONE\", { get: function() {\n            return m.a.BILLBOARDMODE_NONE;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_X\", { get: function() {\n            return m.a.BILLBOARDMODE_X;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_Y\", { get: function() {\n            return m.a.BILLBOARDMODE_Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_Z\", { get: function() {\n            return m.a.BILLBOARDMODE_Z;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_ALL\", { get: function() {\n            return m.a.BILLBOARDMODE_ALL;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_USE_POSITION\", { get: function() {\n            return m.a.BILLBOARDMODE_USE_POSITION;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"facetNb\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetNb;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"partitioningSubdivisions\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"partitioningBBoxRatio\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"mustDepthSortFacets\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.facetDepthSort = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"facetDepthSortFrom\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"isFacetDataEnabled\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;\n          }, enumerable: !1, configurable: !0 }), X.prototype._updateNonUniformScalingState = function(j) {\n            return !!U.prototype._updateNonUniformScalingState.call(this, j) && (this._markSubMeshesAsMiscDirty(), !0);\n          }, Object.defineProperty(X.prototype, \"onCollide\", { set: function(j) {\n            this._meshCollisionData._onCollideObserver && this.onCollideObservable.remove(this._meshCollisionData._onCollideObserver), this._meshCollisionData._onCollideObserver = this.onCollideObservable.add(j);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"onCollisionPositionChange\", { set: function(j) {\n            this._meshCollisionData._onCollisionPositionChangeObserver && this.onCollisionPositionChangeObservable.remove(this._meshCollisionData._onCollisionPositionChangeObserver), this._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(j);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"visibility\", { get: function() {\n            return this._internalAbstractMeshDataInfo._visibility;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._visibility !== j && (this._internalAbstractMeshDataInfo._visibility = j, this._markSubMeshesAsMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"renderingGroupId\", { get: function() {\n            return this._renderingGroupId;\n          }, set: function(j) {\n            this._renderingGroupId = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"material\", { get: function() {\n            return this._material;\n          }, set: function(j) {\n            this._material !== j && (this._material && this._material.meshMap && (this._material.meshMap[this.uniqueId] = void 0), this._material = j, j && j.meshMap && (j.meshMap[this.uniqueId] = this), this.onMaterialChangedObservable.hasObservers() && this.onMaterialChangedObservable.notifyObservers(this), this.subMeshes && this._unBindEffect());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"receiveShadows\", { get: function() {\n            return this._internalAbstractMeshDataInfo._receiveShadows;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._receiveShadows !== j && (this._internalAbstractMeshDataInfo._receiveShadows = j, this._markSubMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"hasVertexAlpha\", { get: function() {\n            return this._internalAbstractMeshDataInfo._hasVertexAlpha;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._hasVertexAlpha !== j && (this._internalAbstractMeshDataInfo._hasVertexAlpha = j, this._markSubMeshesAsAttributesDirty(), this._markSubMeshesAsMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"useVertexColors\", { get: function() {\n            return this._internalAbstractMeshDataInfo._useVertexColors;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._useVertexColors !== j && (this._internalAbstractMeshDataInfo._useVertexColors = j, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"computeBonesUsingShaders\", { get: function() {\n            return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== j && (this._internalAbstractMeshDataInfo._computeBonesUsingShaders = j, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"numBoneInfluencers\", { get: function() {\n            return this._internalAbstractMeshDataInfo._numBoneInfluencers;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._numBoneInfluencers !== j && (this._internalAbstractMeshDataInfo._numBoneInfluencers = j, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"applyFog\", { get: function() {\n            return this._internalAbstractMeshDataInfo._applyFog;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._applyFog !== j && (this._internalAbstractMeshDataInfo._applyFog = j, this._markSubMeshesAsMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"layerMask\", { get: function() {\n            return this._internalAbstractMeshDataInfo._layerMask;\n          }, set: function(j) {\n            j !== this._internalAbstractMeshDataInfo._layerMask && (this._internalAbstractMeshDataInfo._layerMask = j, this._resyncLightSources());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collisionMask\", { get: function() {\n            return this._meshCollisionData._collisionMask;\n          }, set: function(j) {\n            this._meshCollisionData._collisionMask = isNaN(j) ? -1 : j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collisionResponse\", { get: function() {\n            return this._meshCollisionData._collisionResponse;\n          }, set: function(j) {\n            this._meshCollisionData._collisionResponse = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collisionGroup\", { get: function() {\n            return this._meshCollisionData._collisionGroup;\n          }, set: function(j) {\n            this._meshCollisionData._collisionGroup = isNaN(j) ? -1 : j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"surroundingMeshes\", { get: function() {\n            return this._meshCollisionData._surroundingMeshes;\n          }, set: function(j) {\n            this._meshCollisionData._surroundingMeshes = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"lightSources\", { get: function() {\n            return this._lightSources;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"_positions\", { get: function() {\n            return null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"skeleton\", { get: function() {\n            return this._internalAbstractMeshDataInfo._skeleton;\n          }, set: function(j) {\n            var ne = this._internalAbstractMeshDataInfo._skeleton;\n            ne && ne.needInitialSkinMatrix && ne._unregisterMeshWithPoseMatrix(this), j && j.needInitialSkinMatrix && j._registerMeshWithPoseMatrix(this), this._internalAbstractMeshDataInfo._skeleton = j, this._internalAbstractMeshDataInfo._skeleton || (this._bonesTransformMatrices = null), this._markSubMeshesAsAttributesDirty();\n          }, enumerable: !1, configurable: !0 }), X.prototype.getClassName = function() {\n            return \"AbstractMesh\";\n          }, X.prototype.toString = function(j) {\n            var ne = \"Name: \" + this.name + \", isInstance: \" + (this.getClassName() !== \"InstancedMesh\" ? \"YES\" : \"NO\");\n            ne += \", # of submeshes: \" + (this.subMeshes ? this.subMeshes.length : 0);\n            var te = this._internalAbstractMeshDataInfo._skeleton;\n            return te && (ne += \", skeleton: \" + te.name), j && (ne += \", billboard mode: \" + [\"NONE\", \"X\", \"Y\", null, \"Z\", null, null, \"ALL\"][this.billboardMode], ne += \", freeze wrld mat: \" + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? \"YES\" : \"NO\")), ne;\n          }, X.prototype._getEffectiveParent = function() {\n            return this._masterMesh && this.billboardMode !== m.a.BILLBOARDMODE_NONE ? this._masterMesh : U.prototype._getEffectiveParent.call(this);\n          }, X.prototype._getActionManagerForTrigger = function(j, ne) {\n            if (ne === void 0 && (ne = !0), this.actionManager && (ne || this.actionManager.isRecursive)) {\n              if (!j)\n                return this.actionManager;\n              if (this.actionManager.hasSpecificTrigger(j))\n                return this.actionManager;\n            }\n            return this.parent ? this.parent._getActionManagerForTrigger(j, !1) : null;\n          }, X.prototype._rebuild = function() {\n            if (this.onRebuildObservable.notifyObservers(this), this._occlusionQuery && (this._occlusionQuery = null), this.subMeshes)\n              for (var j = 0, ne = this.subMeshes; j < ne.length; j++)\n                ne[j]._rebuild();\n          }, X.prototype._resyncLightSources = function() {\n            this._lightSources.length = 0;\n            for (var j = 0, ne = this.getScene().lights; j < ne.length; j++) {\n              var te = ne[j];\n              te.isEnabled() && te.canAffectMesh(this) && this._lightSources.push(te);\n            }\n            this._markSubMeshesAsLightDirty();\n          }, X.prototype._resyncLightSource = function(j) {\n            var ne = j.isEnabled() && j.canAffectMesh(this), te = this._lightSources.indexOf(j), de = !1;\n            if (te === -1) {\n              if (!ne)\n                return;\n              this._lightSources.push(j);\n            } else {\n              if (ne)\n                return;\n              de = !0, this._lightSources.splice(te, 1);\n            }\n            this._markSubMeshesAsLightDirty(de);\n          }, X.prototype._unBindEffect = function() {\n            for (var j = 0, ne = this.subMeshes; j < ne.length; j++)\n              ne[j].setEffect(null);\n          }, X.prototype._removeLightSource = function(j, ne) {\n            var te = this._lightSources.indexOf(j);\n            te !== -1 && (this._lightSources.splice(te, 1), this._markSubMeshesAsLightDirty(ne));\n          }, X.prototype._markSubMeshesAsDirty = function(j) {\n            if (this.subMeshes)\n              for (var ne = 0, te = this.subMeshes; ne < te.length; ne++) {\n                var de = te[ne];\n                de._materialDefines && j(de._materialDefines);\n              }\n          }, X.prototype._markSubMeshesAsLightDirty = function(j) {\n            j === void 0 && (j = !1), this._markSubMeshesAsDirty(function(ne) {\n              return ne.markAsLightDirty(j);\n            });\n          }, X.prototype._markSubMeshesAsAttributesDirty = function() {\n            this._markSubMeshesAsDirty(function(j) {\n              return j.markAsAttributesDirty();\n            });\n          }, X.prototype._markSubMeshesAsMiscDirty = function() {\n            this._markSubMeshesAsDirty(function(j) {\n              return j.markAsMiscDirty();\n            });\n          }, Object.defineProperty(X.prototype, \"scaling\", { get: function() {\n            return this._scaling;\n          }, set: function(j) {\n            this._scaling = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"isBlocked\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), X.prototype.getLOD = function(j) {\n            return this;\n          }, X.prototype.getTotalVertices = function() {\n            return 0;\n          }, X.prototype.getTotalIndices = function() {\n            return 0;\n          }, X.prototype.getIndices = function() {\n            return null;\n          }, X.prototype.getVerticesData = function(j) {\n            return null;\n          }, X.prototype.setVerticesData = function(j, ne, te, de) {\n            return this;\n          }, X.prototype.updateVerticesData = function(j, ne, te, de) {\n            return this;\n          }, X.prototype.setIndices = function(j, ne) {\n            return this;\n          }, X.prototype.isVerticesDataPresent = function(j) {\n            return !1;\n          }, X.prototype.getBoundingInfo = function() {\n            return this._masterMesh ? this._masterMesh.getBoundingInfo() : (this._boundingInfo || this._updateBoundingInfo(), this._boundingInfo);\n          }, X.prototype.normalizeToUnitCube = function(j, ne, te) {\n            return j === void 0 && (j = !0), ne === void 0 && (ne = !1), U.prototype.normalizeToUnitCube.call(this, j, ne, te);\n          }, X.prototype.setBoundingInfo = function(j) {\n            return this._boundingInfo = j, this;\n          }, Object.defineProperty(X.prototype, \"useBones\", { get: function() {\n            return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(O.b.MatricesIndicesKind) && this.isVerticesDataPresent(O.b.MatricesWeightsKind);\n          }, enumerable: !1, configurable: !0 }), X.prototype._preActivate = function() {\n          }, X.prototype._preActivateForIntermediateRendering = function(j) {\n          }, X.prototype._activate = function(j, ne) {\n            return this._renderId = j, !0;\n          }, X.prototype._postActivate = function() {\n          }, X.prototype._freeze = function() {\n          }, X.prototype._unFreeze = function() {\n          }, X.prototype.getWorldMatrix = function() {\n            return this._masterMesh && this.billboardMode === m.a.BILLBOARDMODE_NONE ? this._masterMesh.getWorldMatrix() : U.prototype.getWorldMatrix.call(this);\n          }, X.prototype._getWorldMatrixDeterminant = function() {\n            return this._masterMesh ? this._masterMesh._getWorldMatrixDeterminant() : U.prototype._getWorldMatrixDeterminant.call(this);\n          }, Object.defineProperty(X.prototype, \"isAnInstance\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"hasInstances\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"hasThinInstances\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), X.prototype.movePOV = function(j, ne, te) {\n            return this.position.addInPlace(this.calcMovePOV(j, ne, te)), this;\n          }, X.prototype.calcMovePOV = function(j, ne, te) {\n            var de = new u.a();\n            (this.rotationQuaternion ? this.rotationQuaternion : u.b.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)).toRotationMatrix(de);\n            var pe = u.e.Zero(), ae = this.definedFacingForward ? -1 : 1;\n            return u.e.TransformCoordinatesFromFloatsToRef(j * ae, ne, te * ae, de, pe), pe;\n          }, X.prototype.rotatePOV = function(j, ne, te) {\n            return this.rotation.addInPlace(this.calcRotatePOV(j, ne, te)), this;\n          }, X.prototype.calcRotatePOV = function(j, ne, te) {\n            var de = this.definedFacingForward ? 1 : -1;\n            return new u.e(j * de, ne, te * de);\n          }, X.prototype.refreshBoundingInfo = function(j) {\n            return j === void 0 && (j = !1), this._boundingInfo && this._boundingInfo.isLocked || this._refreshBoundingInfo(this._getPositionData(j), null), this;\n          }, X.prototype._refreshBoundingInfo = function(j, ne) {\n            if (j) {\n              var te = Object(l.a)(j, 0, this.getTotalVertices(), ne);\n              this._boundingInfo ? this._boundingInfo.reConstruct(te.minimum, te.maximum) : this._boundingInfo = new T.a(te.minimum, te.maximum);\n            }\n            if (this.subMeshes)\n              for (var de = 0; de < this.subMeshes.length; de++)\n                this.subMeshes[de].refreshBoundingInfo(j);\n            this._updateBoundingInfo();\n          }, X.prototype._getPositionData = function(j) {\n            var ne = this.getVerticesData(O.b.PositionKind);\n            if (ne && j && this.skeleton) {\n              ne = _.b.Slice(ne), this._generatePointsArray();\n              var te = this.getVerticesData(O.b.MatricesIndicesKind), de = this.getVerticesData(O.b.MatricesWeightsKind);\n              if (de && te) {\n                var pe = this.numBoneInfluencers > 4, ae = pe ? this.getVerticesData(O.b.MatricesIndicesExtraKind) : null, ee = pe ? this.getVerticesData(O.b.MatricesWeightsExtraKind) : null;\n                this.skeleton.prepare();\n                for (var K = this.skeleton.getTransformMatrices(this), $ = u.c.Vector3[0], L = u.c.Matrix[0], G = u.c.Matrix[1], Q = 0, oe = 0; oe < ne.length; oe += 3, Q += 4) {\n                  var re, Y;\n                  for (L.reset(), re = 0; re < 4; re++)\n                    (Y = de[Q + re]) > 0 && (u.a.FromFloat32ArrayToRefScaled(K, Math.floor(16 * te[Q + re]), Y, G), L.addToSelf(G));\n                  if (pe)\n                    for (re = 0; re < 4; re++)\n                      (Y = ee[Q + re]) > 0 && (u.a.FromFloat32ArrayToRefScaled(K, Math.floor(16 * ae[Q + re]), Y, G), L.addToSelf(G));\n                  u.e.TransformCoordinatesFromFloatsToRef(ne[oe], ne[oe + 1], ne[oe + 2], L, $), $.toArray(ne, oe), this._positions && this._positions[oe / 3].copyFrom($);\n                }\n              }\n            }\n            return ne;\n          }, X.prototype._updateBoundingInfo = function() {\n            var j = this._effectiveMesh;\n            return this._boundingInfo ? this._boundingInfo.update(j.worldMatrixFromCache) : this._boundingInfo = new T.a(this.absolutePosition, this.absolutePosition, j.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(j.worldMatrixFromCache), this;\n          }, X.prototype._updateSubMeshesBoundingInfo = function(j) {\n            if (!this.subMeshes)\n              return this;\n            for (var ne = this.subMeshes.length, te = 0; te < ne; te++) {\n              var de = this.subMeshes[te];\n              (ne > 1 || !de.IsGlobal) && de.updateBoundingInfo(j);\n            }\n            return this;\n          }, X.prototype._afterComputeWorldMatrix = function() {\n            this.doNotSyncBoundingInfo || this._updateBoundingInfo();\n          }, Object.defineProperty(X.prototype, \"_effectiveMesh\", { get: function() {\n            return this.skeleton && this.skeleton.overrideMesh || this;\n          }, enumerable: !1, configurable: !0 }), X.prototype.isInFrustum = function(j) {\n            return this._boundingInfo !== null && this._boundingInfo.isInFrustum(j, this.cullingStrategy);\n          }, X.prototype.isCompletelyInFrustum = function(j) {\n            return this._boundingInfo !== null && this._boundingInfo.isCompletelyInFrustum(j);\n          }, X.prototype.intersectsMesh = function(j, ne, te) {\n            if (ne === void 0 && (ne = !1), !this._boundingInfo || !j._boundingInfo)\n              return !1;\n            if (this._boundingInfo.intersects(j._boundingInfo, ne))\n              return !0;\n            if (te) {\n              for (var de = 0, pe = this.getChildMeshes(); de < pe.length; de++)\n                if (pe[de].intersectsMesh(j, ne, !0))\n                  return !0;\n            }\n            return !1;\n          }, X.prototype.intersectsPoint = function(j) {\n            return !!this._boundingInfo && this._boundingInfo.intersectsPoint(j);\n          }, Object.defineProperty(X.prototype, \"checkCollisions\", { get: function() {\n            return this._meshCollisionData._checkCollisions;\n          }, set: function(j) {\n            this._meshCollisionData._checkCollisions = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collider\", { get: function() {\n            return this._meshCollisionData._collider;\n          }, enumerable: !1, configurable: !0 }), X.prototype.moveWithCollisions = function(j) {\n            this.getAbsolutePosition().addToRef(this.ellipsoidOffset, this._meshCollisionData._oldPositionForCollisions);\n            var ne = this.getScene().collisionCoordinator;\n            return this._meshCollisionData._collider || (this._meshCollisionData._collider = ne.createCollider()), this._meshCollisionData._collider._radius = this.ellipsoid, ne.getNewPosition(this._meshCollisionData._oldPositionForCollisions, j, this._meshCollisionData._collider, 3, this, this._onCollisionPositionChange, this.uniqueId), this;\n          }, X.prototype._collideForSubMesh = function(j, ne, te) {\n            if (this._generatePointsArray(), !this._positions)\n              return this;\n            if (!j._lastColliderWorldVertices || !j._lastColliderTransformMatrix.equals(ne)) {\n              j._lastColliderTransformMatrix = ne.clone(), j._lastColliderWorldVertices = [], j._trianglePlanes = [];\n              for (var de = j.verticesStart, pe = j.verticesStart + j.verticesCount, ae = de; ae < pe; ae++)\n                j._lastColliderWorldVertices.push(u.e.TransformCoordinates(this._positions[ae], ne));\n            }\n            return te._collide(j._trianglePlanes, j._lastColliderWorldVertices, this.getIndices(), j.indexStart, j.indexStart + j.indexCount, j.verticesStart, !!j.getMaterial(), this), this;\n          }, X.prototype._processCollisionsForSubMeshes = function(j, ne) {\n            for (var te = this._scene.getCollidingSubMeshCandidates(this, j), de = te.length, pe = 0; pe < de; pe++) {\n              var ae = te.data[pe];\n              de > 1 && !ae._checkCollision(j) || this._collideForSubMesh(ae, ne, j);\n            }\n            return this;\n          }, X.prototype._checkCollision = function(j) {\n            if (!this._boundingInfo || !this._boundingInfo._checkCollision(j))\n              return this;\n            var ne = u.c.Matrix[0], te = u.c.Matrix[1];\n            return u.a.ScalingToRef(1 / j._radius.x, 1 / j._radius.y, 1 / j._radius.z, ne), this.worldMatrixFromCache.multiplyToRef(ne, te), this._processCollisionsForSubMeshes(j, te), this;\n          }, X.prototype._generatePointsArray = function() {\n            return !1;\n          }, X.prototype.intersects = function(j, ne, te, de, pe, ae) {\n            var ee;\n            de === void 0 && (de = !1), ae === void 0 && (ae = !1);\n            var K = new c.a(), $ = this.getClassName() === \"InstancedLinesMesh\" || this.getClassName() === \"LinesMesh\" ? this.intersectionThreshold : 0, L = this._boundingInfo;\n            if (!this.subMeshes || !L || !(ae || j.intersectsSphere(L.boundingSphere, $) && j.intersectsBox(L.boundingBox, $)))\n              return K;\n            if (de)\n              return K.hit = !ae, K.pickedMesh = ae ? null : this, K.distance = ae ? 0 : u.e.Distance(j.origin, L.boundingSphere.center), K.subMeshId = 0, K;\n            if (!this._generatePointsArray())\n              return K;\n            for (var G = null, Q = this._scene.getIntersectingSubMeshCandidates(this, j), oe = Q.length, re = !1, Y = 0; Y < oe; Y++) {\n              var k = (H = Q.data[Y]).getMaterial();\n              if (k && (!((ee = this.getIndices()) === null || ee === void 0) && ee.length) && (k.fillMode == S.a.MATERIAL_TriangleStripDrawMode || k.fillMode == S.a.MATERIAL_TriangleFillMode || k.fillMode == S.a.MATERIAL_WireFrameFillMode || k.fillMode == S.a.MATERIAL_PointFillMode)) {\n                re = !0;\n                break;\n              }\n            }\n            if (!re)\n              return K.hit = !0, K.pickedMesh = this, K.distance = u.e.Distance(j.origin, L.boundingSphere.center), K.subMeshId = -1, K;\n            for (Y = 0; Y < oe; Y++) {\n              var H = Q.data[Y];\n              if (!(oe > 1) || H.canIntersects(j)) {\n                var Z = H.intersects(j, this._positions, this.getIndices(), ne, te);\n                if (Z && (ne || !G || Z.distance < G.distance) && ((G = Z).subMeshId = Y, ne))\n                  break;\n              }\n            }\n            if (G) {\n              var W = pe ?? (this.skeleton && this.skeleton.overrideMesh ? this.skeleton.overrideMesh.getWorldMatrix() : this.getWorldMatrix()), q = u.c.Vector3[0], he = u.c.Vector3[1];\n              u.e.TransformCoordinatesToRef(j.origin, W, q), j.direction.scaleToRef(G.distance, he);\n              var ge = u.e.TransformNormal(he, W).addInPlace(q);\n              return K.hit = !0, K.distance = u.e.Distance(q, ge), K.pickedPoint = ge, K.pickedMesh = this, K.bu = G.bu || 0, K.bv = G.bv || 0, K.subMeshFaceId = G.faceId, K.faceId = G.faceId + Q.data[G.subMeshId].indexStart / (this.getClassName().indexOf(\"LinesMesh\") !== -1 ? 2 : 3), K.subMeshId = G.subMeshId, K;\n            }\n            return K;\n          }, X.prototype.clone = function(j, ne, te) {\n            return null;\n          }, X.prototype.releaseSubMeshes = function() {\n            if (this.subMeshes)\n              for (; this.subMeshes.length; )\n                this.subMeshes[0].dispose();\n            else\n              this.subMeshes = new Array();\n            return this;\n          }, X.prototype.dispose = function(j, ne) {\n            var te, de = this;\n            for (ne === void 0 && (ne = !1), this._scene.useMaterialMeshMap && this._material && this._material.meshMap && (this._material.meshMap[this.uniqueId] = void 0), this.getScene().freeActiveMeshes(), this.getScene().freeRenderingGroups(), this.actionManager !== void 0 && this.actionManager !== null && (this.actionManager.dispose(), this.actionManager = null), this._internalAbstractMeshDataInfo._skeleton = null, this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null), te = 0; te < this._intersectionsInProgress.length; te++) {\n              var pe = this._intersectionsInProgress[te], ae = pe._intersectionsInProgress.indexOf(this);\n              pe._intersectionsInProgress.splice(ae, 1);\n            }\n            this._intersectionsInProgress = [], this.getScene().lights.forEach(function(K) {\n              var $ = K.includedOnlyMeshes.indexOf(de);\n              $ !== -1 && K.includedOnlyMeshes.splice($, 1), ($ = K.excludedMeshes.indexOf(de)) !== -1 && K.excludedMeshes.splice($, 1);\n              var L = K.getShadowGenerator();\n              if (L) {\n                var G = L.getShadowMap();\n                G && G.renderList && ($ = G.renderList.indexOf(de)) !== -1 && G.renderList.splice($, 1);\n              }\n            }), this.getClassName() === \"InstancedMesh\" && this.getClassName() === \"InstancedLinesMesh\" || this.releaseSubMeshes();\n            var ee = this.getScene().getEngine();\n            if (this._occlusionQuery && (this.isOcclusionQueryInProgress = !1, ee.deleteQuery(this._occlusionQuery), this._occlusionQuery = null), ee.wipeCaches(), this.getScene().removeMesh(this), ne && this.material && (this.material.getClassName() === \"MultiMaterial\" ? this.material.dispose(!1, !0, !0) : this.material.dispose(!1, !0)), !j)\n              for (te = 0; te < this.getScene().particleSystems.length; te++)\n                this.getScene().particleSystems[te].emitter === this && (this.getScene().particleSystems[te].dispose(), te--);\n            this._internalAbstractMeshDataInfo._facetData.facetDataEnabled && this.disableFacetData(), this.onAfterWorldMatrixUpdateObservable.clear(), this.onCollideObservable.clear(), this.onCollisionPositionChangeObservable.clear(), this.onRebuildObservable.clear(), U.prototype.dispose.call(this, j, ne);\n          }, X.prototype.addChild = function(j) {\n            return j.setParent(this), this;\n          }, X.prototype.removeChild = function(j) {\n            return j.setParent(null), this;\n          }, X.prototype._initFacetData = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            j.facetNormals || (j.facetNormals = new Array()), j.facetPositions || (j.facetPositions = new Array()), j.facetPartitioning || (j.facetPartitioning = new Array()), j.facetNb = this.getIndices().length / 3 | 0, j.partitioningSubdivisions = j.partitioningSubdivisions ? j.partitioningSubdivisions : 10, j.partitioningBBoxRatio = j.partitioningBBoxRatio ? j.partitioningBBoxRatio : 1.01;\n            for (var ne = 0; ne < j.facetNb; ne++)\n              j.facetNormals[ne] = u.e.Zero(), j.facetPositions[ne] = u.e.Zero();\n            return j.facetDataEnabled = !0, this;\n          }, X.prototype.updateFacetData = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            j.facetDataEnabled || this._initFacetData();\n            var ne = this.getVerticesData(O.b.PositionKind), te = this.getIndices(), de = this.getVerticesData(O.b.NormalKind), pe = this.getBoundingInfo();\n            if (j.facetDepthSort && !j.facetDepthSortEnabled) {\n              if (j.facetDepthSortEnabled = !0, te instanceof Uint16Array)\n                j.depthSortedIndices = new Uint16Array(te);\n              else if (te instanceof Uint32Array)\n                j.depthSortedIndices = new Uint32Array(te);\n              else {\n                for (var ae = !1, ee = 0; ee < te.length; ee++)\n                  if (te[ee] > 65535) {\n                    ae = !0;\n                    break;\n                  }\n                j.depthSortedIndices = ae ? new Uint32Array(te) : new Uint16Array(te);\n              }\n              if (j.facetDepthSortFunction = function(re, Y) {\n                return Y.sqDistance - re.sqDistance;\n              }, !j.facetDepthSortFrom) {\n                var K = this.getScene().activeCamera;\n                j.facetDepthSortFrom = K ? K.position : u.e.Zero();\n              }\n              j.depthSortedFacets = [];\n              for (var $ = 0; $ < j.facetNb; $++) {\n                var L = { ind: 3 * $, sqDistance: 0 };\n                j.depthSortedFacets.push(L);\n              }\n              j.invertedMatrix = u.a.Identity(), j.facetDepthSortOrigin = u.e.Zero();\n            }\n            j.bbSize.x = pe.maximum.x - pe.minimum.x > v.a ? pe.maximum.x - pe.minimum.x : v.a, j.bbSize.y = pe.maximum.y - pe.minimum.y > v.a ? pe.maximum.y - pe.minimum.y : v.a, j.bbSize.z = pe.maximum.z - pe.minimum.z > v.a ? pe.maximum.z - pe.minimum.z : v.a;\n            var G = j.bbSize.x > j.bbSize.y ? j.bbSize.x : j.bbSize.y;\n            if (G = G > j.bbSize.z ? G : j.bbSize.z, j.subDiv.max = j.partitioningSubdivisions, j.subDiv.X = Math.floor(j.subDiv.max * j.bbSize.x / G), j.subDiv.Y = Math.floor(j.subDiv.max * j.bbSize.y / G), j.subDiv.Z = Math.floor(j.subDiv.max * j.bbSize.z / G), j.subDiv.X = j.subDiv.X < 1 ? 1 : j.subDiv.X, j.subDiv.Y = j.subDiv.Y < 1 ? 1 : j.subDiv.Y, j.subDiv.Z = j.subDiv.Z < 1 ? 1 : j.subDiv.Z, j.facetParameters.facetNormals = this.getFacetLocalNormals(), j.facetParameters.facetPositions = this.getFacetLocalPositions(), j.facetParameters.facetPartitioning = this.getFacetLocalPartitioning(), j.facetParameters.bInfo = pe, j.facetParameters.bbSize = j.bbSize, j.facetParameters.subDiv = j.subDiv, j.facetParameters.ratio = this.partitioningBBoxRatio, j.facetParameters.depthSort = j.facetDepthSort, j.facetDepthSort && j.facetDepthSortEnabled && (this.computeWorldMatrix(!0), this._worldMatrix.invertToRef(j.invertedMatrix), u.e.TransformCoordinatesToRef(j.facetDepthSortFrom, j.invertedMatrix, j.facetDepthSortOrigin), j.facetParameters.distanceTo = j.facetDepthSortOrigin), j.facetParameters.depthSortedFacets = j.depthSortedFacets, x.a.ComputeNormals(ne, te, de, j.facetParameters), j.facetDepthSort && j.facetDepthSortEnabled) {\n              j.depthSortedFacets.sort(j.facetDepthSortFunction);\n              var Q = j.depthSortedIndices.length / 3 | 0;\n              for ($ = 0; $ < Q; $++) {\n                var oe = j.depthSortedFacets[$].ind;\n                j.depthSortedIndices[3 * $] = te[oe], j.depthSortedIndices[3 * $ + 1] = te[oe + 1], j.depthSortedIndices[3 * $ + 2] = te[oe + 2];\n              }\n              this.updateIndices(j.depthSortedIndices, void 0, !0);\n            }\n            return this;\n          }, X.prototype.getFacetLocalNormals = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetNormals || this.updateFacetData(), j.facetNormals;\n          }, X.prototype.getFacetLocalPositions = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetPositions || this.updateFacetData(), j.facetPositions;\n          }, X.prototype.getFacetLocalPartitioning = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetPartitioning || this.updateFacetData(), j.facetPartitioning;\n          }, X.prototype.getFacetPosition = function(j) {\n            var ne = u.e.Zero();\n            return this.getFacetPositionToRef(j, ne), ne;\n          }, X.prototype.getFacetPositionToRef = function(j, ne) {\n            var te = this.getFacetLocalPositions()[j], de = this.getWorldMatrix();\n            return u.e.TransformCoordinatesToRef(te, de, ne), this;\n          }, X.prototype.getFacetNormal = function(j) {\n            var ne = u.e.Zero();\n            return this.getFacetNormalToRef(j, ne), ne;\n          }, X.prototype.getFacetNormalToRef = function(j, ne) {\n            var te = this.getFacetLocalNormals()[j];\n            return u.e.TransformNormalToRef(te, this.getWorldMatrix(), ne), this;\n          }, X.prototype.getFacetsAtLocalCoordinates = function(j, ne, te) {\n            var de = this.getBoundingInfo(), pe = this._internalAbstractMeshDataInfo._facetData, ae = Math.floor((j - de.minimum.x * pe.partitioningBBoxRatio) * pe.subDiv.X * pe.partitioningBBoxRatio / pe.bbSize.x), ee = Math.floor((ne - de.minimum.y * pe.partitioningBBoxRatio) * pe.subDiv.Y * pe.partitioningBBoxRatio / pe.bbSize.y), K = Math.floor((te - de.minimum.z * pe.partitioningBBoxRatio) * pe.subDiv.Z * pe.partitioningBBoxRatio / pe.bbSize.z);\n            return ae < 0 || ae > pe.subDiv.max || ee < 0 || ee > pe.subDiv.max || K < 0 || K > pe.subDiv.max ? null : pe.facetPartitioning[ae + pe.subDiv.max * ee + pe.subDiv.max * pe.subDiv.max * K];\n          }, X.prototype.getClosestFacetAtCoordinates = function(j, ne, te, de, pe, ae) {\n            pe === void 0 && (pe = !1), ae === void 0 && (ae = !0);\n            var ee = this.getWorldMatrix(), K = u.c.Matrix[5];\n            ee.invertToRef(K);\n            var $ = u.c.Vector3[8];\n            u.e.TransformCoordinatesFromFloatsToRef(j, ne, te, K, $);\n            var L = this.getClosestFacetAtLocalCoordinates($.x, $.y, $.z, de, pe, ae);\n            return de && u.e.TransformCoordinatesFromFloatsToRef(de.x, de.y, de.z, ee, de), L;\n          }, X.prototype.getClosestFacetAtLocalCoordinates = function(j, ne, te, de, pe, ae) {\n            pe === void 0 && (pe = !1), ae === void 0 && (ae = !0);\n            var ee = null, K = 0, $ = 0, L = 0, G = 0, Q = 0, oe = 0, re = 0, Y = 0, k = this.getFacetLocalPositions(), H = this.getFacetLocalNormals(), Z = this.getFacetsAtLocalCoordinates(j, ne, te);\n            if (!Z)\n              return null;\n            for (var W, q, he, ge = Number.MAX_VALUE, me = ge, _e = 0; _e < Z.length; _e++)\n              q = H[W = Z[_e]], G = (j - (he = k[W]).x) * q.x + (ne - he.y) * q.y + (te - he.z) * q.z, (!pe || pe && ae && G >= 0 || pe && !ae && G <= 0) && (G = q.x * he.x + q.y * he.y + q.z * he.z, Q = -(q.x * j + q.y * ne + q.z * te - G) / (q.x * q.x + q.y * q.y + q.z * q.z), (me = (K = (oe = j + q.x * Q) - j) * K + ($ = (re = ne + q.y * Q) - ne) * $ + (L = (Y = te + q.z * Q) - te) * L) < ge && (ge = me, ee = W, de && (de.x = oe, de.y = re, de.z = Y)));\n            return ee;\n          }, X.prototype.getFacetDataParameters = function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetParameters;\n          }, X.prototype.disableFacetData = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetDataEnabled && (j.facetDataEnabled = !1, j.facetPositions = new Array(), j.facetNormals = new Array(), j.facetPartitioning = new Array(), j.facetParameters = null, j.depthSortedIndices = new Uint32Array(0)), this;\n          }, X.prototype.updateIndices = function(j, ne, te) {\n            return this;\n          }, X.prototype.createNormals = function(j) {\n            var ne, te = this.getVerticesData(O.b.PositionKind), de = this.getIndices();\n            return ne = this.isVerticesDataPresent(O.b.NormalKind) ? this.getVerticesData(O.b.NormalKind) : [], x.a.ComputeNormals(te, de, ne, { useRightHandedSystem: this.getScene().useRightHandedSystem }), this.setVerticesData(O.b.NormalKind, ne, j), this;\n          }, X.prototype.alignWithNormal = function(j, ne) {\n            ne || (ne = b.a.Y);\n            var te = u.c.Vector3[0], de = u.c.Vector3[1];\n            return u.e.CrossToRef(ne, j, de), u.e.CrossToRef(j, de, te), this.rotationQuaternion ? u.b.RotationQuaternionFromAxisToRef(te, j, de, this.rotationQuaternion) : u.e.RotationFromAxisToRef(te, j, de, this.rotation), this;\n          }, X.prototype._checkOcclusionQuery = function() {\n            return !1;\n          }, X.prototype.disableEdgesRendering = function() {\n            throw g.a.WarnImport(\"EdgesRenderer\");\n          }, X.prototype.enableEdgesRendering = function(j, ne, te) {\n            throw g.a.WarnImport(\"EdgesRenderer\");\n          }, X.prototype.getConnectedParticleSystems = function() {\n            var j = this;\n            return this._scene.particleSystems.filter(function(ne) {\n              return ne.emitter === j;\n            });\n          }, X.OCCLUSION_TYPE_NONE = 0, X.OCCLUSION_TYPE_OPTIMISTIC = 1, X.OCCLUSION_TYPE_STRICT = 2, X.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0, X.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1, X.CULLINGSTRATEGY_STANDARD = S.a.MESHES_CULLINGSTRATEGY_STANDARD, X.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = S.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, X.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = S.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION, X.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = S.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY, X;\n        }(m.a);\n        D.a.RegisteredTypes[\"BABYLON.AbstractMesh\"] = M;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(8), _ = f(44), C = f(0), u = f(31), I = f(7), O = f(50), x = f(23);\n        I.a._PhysicsImpostorParser = function(c, T, S) {\n          return new m(T, S.physicsImpostor, { mass: S.physicsMass, friction: S.physicsFriction, restitution: S.physicsRestitution }, c);\n        };\n        var m = function() {\n          function c(T, S, E, g) {\n            var l = this;\n            E === void 0 && (E = { mass: 0 }), this.object = T, this.type = S, this._options = E, this._scene = g, this._pluginData = {}, this._bodyUpdateRequired = !1, this._onBeforePhysicsStepCallbacks = new Array(), this._onAfterPhysicsStepCallbacks = new Array(), this._onPhysicsCollideCallbacks = [], this._deltaPosition = C.e.Zero(), this._isDisposed = !1, this.soft = !1, this.segments = 0, this._tmpQuat = new C.b(), this._tmpQuat2 = new C.b(), this.beforeStep = function() {\n              l._physicsEngine && (l.object.translate(l._deltaPosition, -1), l._deltaRotationConjugated && l.object.rotationQuaternion && l.object.rotationQuaternion.multiplyToRef(l._deltaRotationConjugated, l.object.rotationQuaternion), l.object.computeWorldMatrix(!1), l.object.parent && l.object.rotationQuaternion ? (l.getParentsRotation(), l._tmpQuat.multiplyToRef(l.object.rotationQuaternion, l._tmpQuat)) : l._tmpQuat.copyFrom(l.object.rotationQuaternion || new C.b()), l._options.disableBidirectionalTransformation || l.object.rotationQuaternion && l._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(l, l.object.getAbsolutePosition(), l._tmpQuat), l._onBeforePhysicsStepCallbacks.forEach(function(h) {\n                h(l);\n              }));\n            }, this.afterStep = function() {\n              l._physicsEngine && (l._onAfterPhysicsStepCallbacks.forEach(function(h) {\n                h(l);\n              }), l._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(l), l.object.parent && l.object.rotationQuaternion && (l.getParentsRotation(), l._tmpQuat.conjugateInPlace(), l._tmpQuat.multiplyToRef(l.object.rotationQuaternion, l.object.rotationQuaternion)), l.object.setAbsolutePosition(l.object.position), l._deltaRotation && l.object.rotationQuaternion && l.object.rotationQuaternion.multiplyToRef(l._deltaRotation, l.object.rotationQuaternion), l.object.translate(l._deltaPosition, 1));\n            }, this.onCollideEvent = null, this.onCollide = function(h) {\n              if ((l._onPhysicsCollideCallbacks.length || l.onCollideEvent) && l._physicsEngine) {\n                var v = l._physicsEngine.getImpostorWithPhysicsBody(h.body);\n                v && (l.onCollideEvent && l.onCollideEvent(l, v), l._onPhysicsCollideCallbacks.filter(function(b) {\n                  return b.otherImpostors.indexOf(v) !== -1;\n                }).forEach(function(b) {\n                  b.callback(l, v, h.point);\n                }));\n              }\n            }, this.object ? (this.object.parent && E.mass !== 0 && V.a.Warn(\"A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.\"), !this._scene && T.getScene && (this._scene = T.getScene()), this._scene && (this.type > 100 && (this.soft = !0), this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine ? (this.object.rotationQuaternion || (this.object.rotation ? this.object.rotationQuaternion = C.b.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z) : this.object.rotationQuaternion = new C.b()), this._options.mass = E.mass === void 0 ? 0 : E.mass, this._options.friction = E.friction === void 0 ? 0.2 : E.friction, this._options.restitution = E.restitution === void 0 ? 0.2 : E.restitution, this.soft && (this._options.mass = this._options.mass > 0 ? this._options.mass : 1, this._options.pressure = E.pressure === void 0 ? 200 : E.pressure, this._options.stiffness = E.stiffness === void 0 ? 1 : E.stiffness, this._options.velocityIterations = E.velocityIterations === void 0 ? 20 : E.velocityIterations, this._options.positionIterations = E.positionIterations === void 0 ? 20 : E.positionIterations, this._options.fixedPoints = E.fixedPoints === void 0 ? 0 : E.fixedPoints, this._options.margin = E.margin === void 0 ? 0 : E.margin, this._options.damping = E.damping === void 0 ? 0 : E.damping, this._options.path = E.path === void 0 ? null : E.path, this._options.shape = E.shape === void 0 ? null : E.shape), this._joints = [], !this.object.parent || this._options.ignoreParent ? this._init() : this.object.parent.physicsImpostor && V.a.Warn(\"You must affect impostors to children before affecting impostor to parent.\")) : V.a.Error(\"Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.\"))) : V.a.Error(\"No object was provided. A physics object is obligatory\");\n          }\n          return Object.defineProperty(c.prototype, \"isDisposed\", { get: function() {\n            return this._isDisposed;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"mass\", { get: function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;\n          }, set: function(T) {\n            this.setMass(T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"friction\", { get: function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;\n          }, set: function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"restitution\", { get: function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;\n          }, set: function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"pressure\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.setBodyPressure ? T.getBodyPressure(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyPressure && S.setBodyPressure(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"stiffness\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.getBodyStiffness ? T.getBodyStiffness(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyStiffness && S.setBodyStiffness(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"velocityIterations\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.getBodyVelocityIterations ? T.getBodyVelocityIterations(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyVelocityIterations && S.setBodyVelocityIterations(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"positionIterations\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.getBodyPositionIterations ? T.getBodyPositionIterations(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyPositionIterations && S.setBodyPositionIterations(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), c.prototype._init = function() {\n            this._physicsEngine && (this._physicsEngine.removeImpostor(this), this.physicsBody = null, this._parent = this._parent || this._getPhysicsParent(), this._isDisposed || this.parent && !this._options.ignoreParent || this._physicsEngine.addImpostor(this));\n          }, c.prototype._getPhysicsParent = function() {\n            return this.object.parent instanceof u.a ? this.object.parent.physicsImpostor : null;\n          }, c.prototype.isBodyInitRequired = function() {\n            return this._bodyUpdateRequired || !this._physicsBody && !this._parent;\n          }, c.prototype.setScalingUpdated = function() {\n            this.forceUpdate();\n          }, c.prototype.forceUpdate = function() {\n            this._init(), this.parent && !this._options.ignoreParent && this.parent.forceUpdate();\n          }, Object.defineProperty(c.prototype, \"physicsBody\", { get: function() {\n            return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;\n          }, set: function(T) {\n            this._physicsBody && this._physicsEngine && this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this), this._physicsBody = T, this.resetUpdateFlags();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"parent\", { get: function() {\n            return !this._options.ignoreParent && this._parent ? this._parent : null;\n          }, set: function(T) {\n            this._parent = T;\n          }, enumerable: !1, configurable: !0 }), c.prototype.resetUpdateFlags = function() {\n            this._bodyUpdateRequired = !1;\n          }, c.prototype.getObjectExtendSize = function() {\n            if (this.object.getBoundingInfo) {\n              var T = this.object.rotationQuaternion, S = this.object.scaling.clone();\n              this.object.rotationQuaternion = c.IDENTITY_QUATERNION;\n              var E = this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0);\n              E && E.decompose(S, void 0, void 0);\n              var g = this.object.getBoundingInfo().boundingBox.extendSize.scale(2).multiplyInPlace(S);\n              return this.object.rotationQuaternion = T, this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0), g;\n            }\n            return c.DEFAULT_OBJECT_SIZE;\n          }, c.prototype.getObjectCenter = function() {\n            return this.object.getBoundingInfo ? this.object.getBoundingInfo().boundingBox.centerWorld : this.object.position;\n          }, c.prototype.getParam = function(T) {\n            return this._options[T];\n          }, c.prototype.setParam = function(T, S) {\n            this._options[T] = S, this._bodyUpdateRequired = !0;\n          }, c.prototype.setMass = function(T) {\n            this.getParam(\"mass\") !== T && this.setParam(\"mass\", T), this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyMass(this, T);\n          }, c.prototype.getLinearVelocity = function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : C.e.Zero();\n          }, c.prototype.setLinearVelocity = function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, T);\n          }, c.prototype.getAngularVelocity = function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : C.e.Zero();\n          }, c.prototype.setAngularVelocity = function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, T);\n          }, c.prototype.executeNativeFunction = function(T) {\n            this._physicsEngine && T(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);\n          }, c.prototype.registerBeforePhysicsStep = function(T) {\n            this._onBeforePhysicsStepCallbacks.push(T);\n          }, c.prototype.unregisterBeforePhysicsStep = function(T) {\n            var S = this._onBeforePhysicsStepCallbacks.indexOf(T);\n            S > -1 ? this._onBeforePhysicsStepCallbacks.splice(S, 1) : V.a.Warn(\"Function to remove was not found\");\n          }, c.prototype.registerAfterPhysicsStep = function(T) {\n            this._onAfterPhysicsStepCallbacks.push(T);\n          }, c.prototype.unregisterAfterPhysicsStep = function(T) {\n            var S = this._onAfterPhysicsStepCallbacks.indexOf(T);\n            S > -1 ? this._onAfterPhysicsStepCallbacks.splice(S, 1) : V.a.Warn(\"Function to remove was not found\");\n          }, c.prototype.registerOnPhysicsCollide = function(T, S) {\n            var E = T instanceof Array ? T : [T];\n            this._onPhysicsCollideCallbacks.push({ callback: S, otherImpostors: E });\n          }, c.prototype.unregisterOnPhysicsCollide = function(T, S) {\n            var E = T instanceof Array ? T : [T], g = -1;\n            this._onPhysicsCollideCallbacks.some(function(l, h) {\n              if (l.callback === S && l.otherImpostors.length === E.length) {\n                var v = l.otherImpostors.every(function(b) {\n                  return E.indexOf(b) > -1;\n                });\n                return v && (g = h), v;\n              }\n              return !1;\n            }) ? this._onPhysicsCollideCallbacks.splice(g, 1) : V.a.Warn(\"Function to remove was not found\");\n          }, c.prototype.getParentsRotation = function() {\n            var T = this.object.parent;\n            for (this._tmpQuat.copyFromFloats(0, 0, 0, 1); T; )\n              T.rotationQuaternion ? this._tmpQuat2.copyFrom(T.rotationQuaternion) : C.b.RotationYawPitchRollToRef(T.rotation.y, T.rotation.x, T.rotation.z, this._tmpQuat2), this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat), T = T.parent;\n            return this._tmpQuat;\n          }, c.prototype.applyForce = function(T, S) {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyForce(this, T, S), this;\n          }, c.prototype.applyImpulse = function(T, S) {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyImpulse(this, T, S), this;\n          }, c.prototype.createJoint = function(T, S, E) {\n            var g = new O.e(S, E);\n            return this.addJoint(T, g), this;\n          }, c.prototype.addJoint = function(T, S) {\n            return this._joints.push({ otherImpostor: T, joint: S }), this._physicsEngine && this._physicsEngine.addJoint(this, T, S), this;\n          }, c.prototype.addAnchor = function(T, S, E, g, l) {\n            if (!this._physicsEngine)\n              return this;\n            var h = this._physicsEngine.getPhysicsPlugin();\n            return h.appendAnchor ? (this._physicsEngine && h.appendAnchor(this, T, S, E, g, l), this) : this;\n          }, c.prototype.addHook = function(T, S, E, g) {\n            if (!this._physicsEngine)\n              return this;\n            var l = this._physicsEngine.getPhysicsPlugin();\n            return l.appendAnchor ? (this._physicsEngine && l.appendHook(this, T, S, E, g), this) : this;\n          }, c.prototype.sleep = function() {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().sleepBody(this), this;\n          }, c.prototype.wakeUp = function() {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().wakeUpBody(this), this;\n          }, c.prototype.clone = function(T) {\n            return T ? new c(T, this.type, this._options, this._scene) : null;\n          }, c.prototype.dispose = function() {\n            var T = this;\n            this._physicsEngine && (this._joints.forEach(function(S) {\n              T._physicsEngine && T._physicsEngine.removeJoint(T, S.otherImpostor, S.joint);\n            }), this._physicsEngine.removeImpostor(this), this.parent && this.parent.forceUpdate(), this._isDisposed = !0);\n          }, c.prototype.setDeltaPosition = function(T) {\n            this._deltaPosition.copyFrom(T);\n          }, c.prototype.setDeltaRotation = function(T) {\n            this._deltaRotation || (this._deltaRotation = new C.b()), this._deltaRotation.copyFrom(T), this._deltaRotationConjugated = this._deltaRotation.conjugate();\n          }, c.prototype.getBoxSizeToRef = function(T) {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, T), this;\n          }, c.prototype.getRadius = function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;\n          }, c.prototype.syncBoneWithImpostor = function(T, S, E, g, l) {\n            var h = c._tmpVecs[0], v = this.object;\n            if (v.rotationQuaternion)\n              if (l) {\n                var b = c._tmpQuat;\n                v.rotationQuaternion.multiplyToRef(l, b), T.setRotationQuaternion(b, x.c.WORLD, S);\n              } else\n                T.setRotationQuaternion(v.rotationQuaternion, x.c.WORLD, S);\n            h.x = 0, h.y = 0, h.z = 0, E && (h.x = E.x, h.y = E.y, h.z = E.z, T.getDirectionToRef(h, S, h), g == null && (g = E.length()), h.x *= g, h.y *= g, h.z *= g), T.getParent() ? (h.addInPlace(v.getAbsolutePosition()), T.setAbsolutePosition(h, S)) : (S.setAbsolutePosition(v.getAbsolutePosition()), S.position.x -= h.x, S.position.y -= h.y, S.position.z -= h.z);\n          }, c.prototype.syncImpostorWithBone = function(T, S, E, g, l, h) {\n            var v = this.object;\n            if (v.rotationQuaternion)\n              if (l) {\n                var b = c._tmpQuat;\n                T.getRotationQuaternionToRef(x.c.WORLD, S, b), b.multiplyToRef(l, v.rotationQuaternion);\n              } else\n                T.getRotationQuaternionToRef(x.c.WORLD, S, v.rotationQuaternion);\n            var D = c._tmpVecs[0], w = c._tmpVecs[1];\n            h || ((h = c._tmpVecs[2]).x = 0, h.y = 1, h.z = 0), T.getDirectionToRef(h, S, w), T.getAbsolutePositionToRef(S, D), g == null && E && (g = E.length()), g != null && (D.x += w.x * g, D.y += w.y * g, D.z += w.z * g), v.setAbsolutePosition(D);\n          }, c.DEFAULT_OBJECT_SIZE = new C.e(1, 1, 1), c.IDENTITY_QUATERNION = C.b.Identity(), c._tmpVecs = _.a.BuildArray(3, C.e.Zero), c._tmpQuat = C.b.Identity(), c.NoImpostor = 0, c.SphereImpostor = 1, c.BoxImpostor = 2, c.PlaneImpostor = 3, c.MeshImpostor = 4, c.CapsuleImpostor = 6, c.CylinderImpostor = 7, c.ParticleImpostor = 8, c.HeightmapImpostor = 9, c.ConvexHullImpostor = 10, c.CustomImpostor = 100, c.RopeImpostor = 101, c.ClothImpostor = 102, c.SoftbodyImpostor = 103, c;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(1), _ = function() {\n          function u(I) {\n            this.length = 0, this.data = new Array(I), this._id = u._GlobalId++;\n          }\n          return u.prototype.push = function(I) {\n            this.data[this.length++] = I, this.length > this.data.length && (this.data.length *= 2);\n          }, u.prototype.forEach = function(I) {\n            for (var O = 0; O < this.length; O++)\n              I(this.data[O]);\n          }, u.prototype.sort = function(I) {\n            this.data.sort(I);\n          }, u.prototype.reset = function() {\n            this.length = 0;\n          }, u.prototype.dispose = function() {\n            this.reset(), this.data && (this.data.length = 0, this.data = []);\n          }, u.prototype.concat = function(I) {\n            if (I.length !== 0) {\n              this.length + I.length > this.data.length && (this.data.length = 2 * (this.length + I.length));\n              for (var O = 0; O < I.length; O++)\n                this.data[this.length++] = (I.data || I)[O];\n            }\n          }, u.prototype.indexOf = function(I) {\n            var O = this.data.indexOf(I);\n            return O >= this.length ? -1 : O;\n          }, u.prototype.contains = function(I) {\n            return this.indexOf(I) !== -1;\n          }, u._GlobalId = 0, u;\n        }(), C = function(u) {\n          function I() {\n            var O = u !== null && u.apply(this, arguments) || this;\n            return O._duplicateId = 0, O;\n          }\n          return Object(V.d)(I, u), I.prototype.push = function(O) {\n            u.prototype.push.call(this, O), O.__smartArrayFlags || (O.__smartArrayFlags = {}), O.__smartArrayFlags[this._id] = this._duplicateId;\n          }, I.prototype.pushNoDuplicate = function(O) {\n            return (!O.__smartArrayFlags || O.__smartArrayFlags[this._id] !== this._duplicateId) && (this.push(O), !0);\n          }, I.prototype.reset = function() {\n            u.prototype.reset.call(this), this._duplicateId++;\n          }, I.prototype.concatWithNoDuplicate = function(O) {\n            if (O.length !== 0) {\n              this.length + O.length > this.data.length && (this.data.length = 2 * (this.length + O.length));\n              for (var x = 0; x < O.length; x++) {\n                var m = (O.data || O)[x];\n                this.pushNoDuplicate(m);\n              }\n            }\n          }, I;\n        }(_);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.EndsWith = function(C, u) {\n            return C.indexOf(u, C.length - u.length) !== -1;\n          }, _.StartsWith = function(C, u) {\n            return !!C && C.indexOf(u) === 0;\n          }, _.Decode = function(C) {\n            if (typeof TextDecoder < \"u\")\n              return new TextDecoder().decode(C);\n            for (var u = \"\", I = 0; I < C.byteLength; I++)\n              u += String.fromCharCode(C[I]);\n            return u;\n          }, _.EncodeArrayBufferToBase64 = function(C) {\n            for (var u, I, O, x, m, c, T, S = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\", E = \"\", g = 0, l = ArrayBuffer.isView(C) ? new Uint8Array(C.buffer, C.byteOffset, C.byteLength) : new Uint8Array(C); g < l.length; )\n              x = (u = l[g++]) >> 2, m = (3 & u) << 4 | (I = g < l.length ? l[g++] : Number.NaN) >> 4, c = (15 & I) << 2 | (O = g < l.length ? l[g++] : Number.NaN) >> 6, T = 63 & O, isNaN(I) ? c = T = 64 : isNaN(O) && (T = 64), E += S.charAt(x) + S.charAt(m) + S.charAt(c) + S.charAt(T);\n            return E;\n          }, _.PadNumber = function(C, u) {\n            for (var I = String(C); I.length < u; )\n              I = \"0\" + I;\n            return I;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this.rootNodes = new Array(), this.cameras = new Array(), this.lights = new Array(), this.meshes = new Array(), this.skeletons = new Array(), this.particleSystems = new Array(), this.animations = [], this.animationGroups = new Array(), this.multiMaterials = new Array(), this.materials = new Array(), this.morphTargetManagers = new Array(), this.geometries = new Array(), this.transformNodes = new Array(), this.actionManagers = new Array(), this.textures = new Array(), this._environmentTexture = null, this.postProcesses = new Array();\n          }\n          return _.AddParser = function(C, u) {\n            this._BabylonFileParsers[C] = u;\n          }, _.GetParser = function(C) {\n            return this._BabylonFileParsers[C] ? this._BabylonFileParsers[C] : null;\n          }, _.AddIndividualParser = function(C, u) {\n            this._IndividualBabylonFileParsers[C] = u;\n          }, _.GetIndividualParser = function(C) {\n            return this._IndividualBabylonFileParsers[C] ? this._IndividualBabylonFileParsers[C] : null;\n          }, _.Parse = function(C, u, I, O) {\n            for (var x in this._BabylonFileParsers)\n              this._BabylonFileParsers.hasOwnProperty(x) && this._BabylonFileParsers[x](C, u, I, O);\n          }, Object.defineProperty(_.prototype, \"environmentTexture\", { get: function() {\n            return this._environmentTexture;\n          }, set: function(C) {\n            this._environmentTexture = C;\n          }, enumerable: !1, configurable: !0 }), _.prototype.getNodes = function() {\n            var C = new Array();\n            return C = (C = (C = (C = C.concat(this.meshes)).concat(this.lights)).concat(this.cameras)).concat(this.transformNodes), this.skeletons.forEach(function(u) {\n              return C = C.concat(u.bones);\n            }), C;\n          }, _._BabylonFileParsers = {}, _._IndividualBabylonFileParsers = {}, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(20), _ = f(6), C = f(18), u = f(22), I = f(86), O = f(0), x = f(9), m = function() {\n          function c(T, S) {\n            var E = this;\n            S === void 0 && (S = !0), this.originalScene = T, this._pointerCaptures = {}, this._lastPointerEvents = {}, this._sharedGizmoLight = null, this._renderCamera = null, this.pickUtilitySceneFirst = !0, this.shouldRender = !0, this.onlyCheckPointerDownEvents = !0, this.processAllEvents = !1, this.onPointerOutObservable = new _.c(), this.utilityLayerScene = new V.a(T.getEngine(), { virtual: !0 }), this.utilityLayerScene.useRightHandedSystem = T.useRightHandedSystem, this.utilityLayerScene._allowPostProcessClearColor = !1, this.utilityLayerScene.detachControl(), S && (this._originalPointerObserver = T.onPrePointerObservable.add(function(g, l) {\n              if (E.utilityLayerScene.activeCamera && (E.processAllEvents || g.type === C.a.POINTERMOVE || g.type === C.a.POINTERUP || g.type === C.a.POINTERDOWN || g.type === C.a.POINTERDOUBLETAP)) {\n                E.utilityLayerScene.pointerX = T.pointerX, E.utilityLayerScene.pointerY = T.pointerY;\n                var h = g.event;\n                if (T.isPointerCaptured(h.pointerId))\n                  E._pointerCaptures[h.pointerId] = !1;\n                else {\n                  var v = g.ray ? E.utilityLayerScene.pickWithRay(g.ray) : E.utilityLayerScene.pick(T.pointerX, T.pointerY);\n                  if (!g.ray && v && (g.ray = v.ray), E.utilityLayerScene.onPrePointerObservable.notifyObservers(g), E.onlyCheckPointerDownEvents && g.type != C.a.POINTERDOWN)\n                    return g.skipOnPointerObservable || E.utilityLayerScene.onPointerObservable.notifyObservers(new C.b(g.type, g.event, v), g.type), void (g.type === C.a.POINTERUP && E._pointerCaptures[h.pointerId] && (E._pointerCaptures[h.pointerId] = !1));\n                  if (E.utilityLayerScene.autoClearDepthAndStencil || E.pickUtilitySceneFirst)\n                    v && v.hit && (g.skipOnPointerObservable || E.utilityLayerScene.onPointerObservable.notifyObservers(new C.b(g.type, g.event, v), g.type), g.skipOnPointerObservable = !0);\n                  else {\n                    var b = g.ray ? T.pickWithRay(g.ray) : T.pick(T.pointerX, T.pointerY), D = g.event;\n                    b && v && (v.distance === 0 && b.pickedMesh ? E.mainSceneTrackerPredicate && E.mainSceneTrackerPredicate(b.pickedMesh) ? (E._notifyObservers(g, b, D), g.skipOnPointerObservable = !0) : g.type === C.a.POINTERDOWN ? E._pointerCaptures[D.pointerId] = !0 : E._lastPointerEvents[D.pointerId] && (E.onPointerOutObservable.notifyObservers(D.pointerId), delete E._lastPointerEvents[D.pointerId]) : !E._pointerCaptures[D.pointerId] && (v.distance < b.distance || b.distance === 0) ? (E._notifyObservers(g, v, D), g.skipOnPointerObservable || (g.skipOnPointerObservable = v.distance > 0)) : !E._pointerCaptures[D.pointerId] && v.distance > b.distance && (E.mainSceneTrackerPredicate && E.mainSceneTrackerPredicate(b.pickedMesh) ? (E._notifyObservers(g, b, D), g.skipOnPointerObservable = !0) : E._lastPointerEvents[D.pointerId] && (E.onPointerOutObservable.notifyObservers(D.pointerId), delete E._lastPointerEvents[D.pointerId])), g.type === C.a.POINTERUP && E._pointerCaptures[D.pointerId] && (E._pointerCaptures[D.pointerId] = !1));\n                  }\n                }\n              }\n            }), this._originalPointerObserver && T.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)), this.utilityLayerScene.autoClear = !1, this._afterRenderObserver = this.originalScene.onAfterCameraRenderObservable.add(function(g) {\n              E.shouldRender && g == E.getRenderCamera() && E.render();\n            }), this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(function() {\n              E.dispose();\n            }), this._updateCamera();\n          }\n          return c.prototype.getRenderCamera = function(T) {\n            if (this._renderCamera)\n              return this._renderCamera;\n            var S = void 0;\n            return S = this.originalScene.activeCameras && this.originalScene.activeCameras.length > 1 ? this.originalScene.activeCameras[this.originalScene.activeCameras.length - 1] : this.originalScene.activeCamera, T && S && S.isRigCamera ? S.rigParent : S;\n          }, c.prototype.setRenderCamera = function(T) {\n            this._renderCamera = T;\n          }, c.prototype._getSharedGizmoLight = function() {\n            return this._sharedGizmoLight || (this._sharedGizmoLight = new I.a(\"shared gizmo light\", new O.e(0, 1, 0), this.utilityLayerScene), this._sharedGizmoLight.intensity = 2, this._sharedGizmoLight.groundColor = x.a.Gray()), this._sharedGizmoLight;\n          }, Object.defineProperty(c, \"DefaultUtilityLayer\", { get: function() {\n            return c._DefaultUtilityLayer == null && (c._DefaultUtilityLayer = new c(u.a.LastCreatedScene), c._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(function() {\n              c._DefaultUtilityLayer = null;\n            })), c._DefaultUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c, \"DefaultKeepDepthUtilityLayer\", { get: function() {\n            return c._DefaultKeepDepthUtilityLayer == null && (c._DefaultKeepDepthUtilityLayer = new c(u.a.LastCreatedScene), c._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, c._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(function() {\n              c._DefaultKeepDepthUtilityLayer = null;\n            })), c._DefaultKeepDepthUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), c.prototype._notifyObservers = function(T, S, E) {\n            T.skipOnPointerObservable || (this.utilityLayerScene.onPointerObservable.notifyObservers(new C.b(T.type, T.event, S), T.type), this._lastPointerEvents[E.pointerId] = !0);\n          }, c.prototype.render = function() {\n            if (this._updateCamera(), this.utilityLayerScene.activeCamera) {\n              var T = this.utilityLayerScene.activeCamera.getScene(), S = this.utilityLayerScene.activeCamera;\n              S._scene = this.utilityLayerScene, S.leftCamera && (S.leftCamera._scene = this.utilityLayerScene), S.rightCamera && (S.rightCamera._scene = this.utilityLayerScene), this.utilityLayerScene.render(!1), S._scene = T, S.leftCamera && (S.leftCamera._scene = T), S.rightCamera && (S.rightCamera._scene = T);\n            }\n          }, c.prototype.dispose = function() {\n            this.onPointerOutObservable.clear(), this._afterRenderObserver && this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver), this._sceneDisposeObserver && this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver), this._originalPointerObserver && this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver), this.utilityLayerScene.dispose();\n          }, c.prototype._updateCamera = function() {\n            this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera(), this.utilityLayerScene.activeCamera = this.getRenderCamera();\n          }, c._DefaultUtilityLayer = null, c._DefaultKeepDepthUtilityLayer = null, c;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(139), _ = function() {\n          function C() {\n          }\n          return C.EnableFor = function(u) {\n            u._tags = u._tags || {}, u.hasTags = function() {\n              return C.HasTags(u);\n            }, u.addTags = function(I) {\n              return C.AddTagsTo(u, I);\n            }, u.removeTags = function(I) {\n              return C.RemoveTagsFrom(u, I);\n            }, u.matchesTagsQuery = function(I) {\n              return C.MatchesQuery(u, I);\n            };\n          }, C.DisableFor = function(u) {\n            delete u._tags, delete u.hasTags, delete u.addTags, delete u.removeTags, delete u.matchesTagsQuery;\n          }, C.HasTags = function(u) {\n            if (!u._tags)\n              return !1;\n            var I = u._tags;\n            for (var O in I)\n              if (I.hasOwnProperty(O))\n                return !0;\n            return !1;\n          }, C.GetTags = function(u, I) {\n            if (I === void 0 && (I = !0), !u._tags)\n              return null;\n            if (I) {\n              var O = [];\n              for (var x in u._tags)\n                u._tags.hasOwnProperty(x) && u._tags[x] === !0 && O.push(x);\n              return O.join(\" \");\n            }\n            return u._tags;\n          }, C.AddTagsTo = function(u, I) {\n            I && typeof I == \"string\" && I.split(\" \").forEach(function(O, x, m) {\n              C._AddTagTo(u, O);\n            });\n          }, C._AddTagTo = function(u, I) {\n            (I = I.trim()) !== \"\" && I !== \"true\" && I !== \"false\" && (I.match(/[\\s]/) || I.match(/^([!]|([|]|[&]){2})/) || (C.EnableFor(u), u._tags[I] = !0));\n          }, C.RemoveTagsFrom = function(u, I) {\n            if (C.HasTags(u)) {\n              var O = I.split(\" \");\n              for (var x in O)\n                C._RemoveTagFrom(u, O[x]);\n            }\n          }, C._RemoveTagFrom = function(u, I) {\n            delete u._tags[I];\n          }, C.MatchesQuery = function(u, I) {\n            return I === void 0 || (I === \"\" ? C.HasTags(u) : V.a.Eval(I, function(O) {\n              return C.HasTags(u) && u._tags[O];\n            }));\n          }, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.IsWindowObjectExist = function() {\n            return typeof window < \"u\";\n          }, _.IsNavigatorAvailable = function() {\n            return typeof navigator < \"u\";\n          }, _.IsDocumentAvailable = function() {\n            return typeof document < \"u\";\n          }, _.GetDOMTextContent = function(C) {\n            for (var u = \"\", I = C.firstChild; I; )\n              I.nodeType === 3 && (u += I.textContent), I = I.nextSibling;\n            return u;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(44), _ = f(0), C = f(54), u = f(114), I = f(20), O = f(24), x = function() {\n          function m(c, T, S) {\n            S === void 0 && (S = Number.MAX_VALUE), this.origin = c, this.direction = T, this.length = S;\n          }\n          return m.prototype.intersectsBoxMinMax = function(c, T, S) {\n            S === void 0 && (S = 0);\n            var E, g, l, h, v = m._TmpVector3[0].copyFromFloats(c.x - S, c.y - S, c.z - S), b = m._TmpVector3[1].copyFromFloats(T.x + S, T.y + S, T.z + S), D = 0, w = Number.MAX_VALUE;\n            if (Math.abs(this.direction.x) < 1e-7) {\n              if (this.origin.x < v.x || this.origin.x > b.x)\n                return !1;\n            } else if (E = 1 / this.direction.x, g = (v.x - this.origin.x) * E, (l = (b.x - this.origin.x) * E) === -1 / 0 && (l = 1 / 0), g > l && (h = g, g = l, l = h), (D = Math.max(g, D)) > (w = Math.min(l, w)))\n              return !1;\n            if (Math.abs(this.direction.y) < 1e-7) {\n              if (this.origin.y < v.y || this.origin.y > b.y)\n                return !1;\n            } else if (E = 1 / this.direction.y, g = (v.y - this.origin.y) * E, (l = (b.y - this.origin.y) * E) === -1 / 0 && (l = 1 / 0), g > l && (h = g, g = l, l = h), (D = Math.max(g, D)) > (w = Math.min(l, w)))\n              return !1;\n            if (Math.abs(this.direction.z) < 1e-7) {\n              if (this.origin.z < v.z || this.origin.z > b.z)\n                return !1;\n            } else if (E = 1 / this.direction.z, g = (v.z - this.origin.z) * E, (l = (b.z - this.origin.z) * E) === -1 / 0 && (l = 1 / 0), g > l && (h = g, g = l, l = h), (D = Math.max(g, D)) > (w = Math.min(l, w)))\n              return !1;\n            return !0;\n          }, m.prototype.intersectsBox = function(c, T) {\n            return T === void 0 && (T = 0), this.intersectsBoxMinMax(c.minimum, c.maximum, T);\n          }, m.prototype.intersectsSphere = function(c, T) {\n            T === void 0 && (T = 0);\n            var S = c.center.x - this.origin.x, E = c.center.y - this.origin.y, g = c.center.z - this.origin.z, l = S * S + E * E + g * g, h = c.radius + T, v = h * h;\n            if (l <= v)\n              return !0;\n            var b = S * this.direction.x + E * this.direction.y + g * this.direction.z;\n            return !(b < 0) && l - b * b <= v;\n          }, m.prototype.intersectsTriangle = function(c, T, S) {\n            var E = m._TmpVector3[0], g = m._TmpVector3[1], l = m._TmpVector3[2], h = m._TmpVector3[3], v = m._TmpVector3[4];\n            T.subtractToRef(c, E), S.subtractToRef(c, g), _.e.CrossToRef(this.direction, g, l);\n            var b = _.e.Dot(E, l);\n            if (b === 0)\n              return null;\n            var D = 1 / b;\n            this.origin.subtractToRef(c, h);\n            var w = _.e.Dot(h, l) * D;\n            if (w < 0 || w > 1)\n              return null;\n            _.e.CrossToRef(h, E, v);\n            var N = _.e.Dot(this.direction, v) * D;\n            if (N < 0 || w + N > 1)\n              return null;\n            var M = _.e.Dot(g, v) * D;\n            return M > this.length ? null : new u.a(1 - w - N, w, M);\n          }, m.prototype.intersectsPlane = function(c) {\n            var T, S = _.e.Dot(c.normal, this.direction);\n            if (Math.abs(S) < 999999997475243e-21)\n              return null;\n            var E = _.e.Dot(c.normal, this.origin);\n            return (T = (-c.d - E) / S) < 0 ? T < -999999997475243e-21 ? null : 0 : T;\n          }, m.prototype.intersectsAxis = function(c, T) {\n            switch (T === void 0 && (T = 0), c) {\n              case \"y\":\n                return (S = (this.origin.y - T) / this.direction.y) > 0 ? null : new _.e(this.origin.x + this.direction.x * -S, T, this.origin.z + this.direction.z * -S);\n              case \"x\":\n                return (S = (this.origin.x - T) / this.direction.x) > 0 ? null : new _.e(T, this.origin.y + this.direction.y * -S, this.origin.z + this.direction.z * -S);\n              case \"z\":\n                var S;\n                return (S = (this.origin.z - T) / this.direction.z) > 0 ? null : new _.e(this.origin.x + this.direction.x * -S, this.origin.y + this.direction.y * -S, T);\n              default:\n                return null;\n            }\n          }, m.prototype.intersectsMesh = function(c, T) {\n            var S = _.c.Matrix[0];\n            return c.getWorldMatrix().invertToRef(S), this._tmpRay ? m.TransformToRef(this, S, this._tmpRay) : this._tmpRay = m.Transform(this, S), c.intersects(this._tmpRay, T);\n          }, m.prototype.intersectsMeshes = function(c, T, S) {\n            S ? S.length = 0 : S = [];\n            for (var E = 0; E < c.length; E++) {\n              var g = this.intersectsMesh(c[E], T);\n              g.hit && S.push(g);\n            }\n            return S.sort(this._comparePickingInfo), S;\n          }, m.prototype._comparePickingInfo = function(c, T) {\n            return c.distance < T.distance ? -1 : c.distance > T.distance ? 1 : 0;\n          }, m.prototype.intersectionSegment = function(c, T, S) {\n            var E = this.origin, g = _.c.Vector3[0], l = _.c.Vector3[1], h = _.c.Vector3[2], v = _.c.Vector3[3];\n            T.subtractToRef(c, g), this.direction.scaleToRef(m.rayl, h), E.addToRef(h, l), c.subtractToRef(E, v);\n            var b, D, w, N, M = _.e.Dot(g, g), U = _.e.Dot(g, h), X = _.e.Dot(h, h), j = _.e.Dot(g, v), ne = _.e.Dot(h, v), te = M * X - U * U, de = te, pe = te;\n            te < m.smallnum ? (D = 0, de = 1, N = ne, pe = X) : (N = M * ne - U * j, (D = U * ne - X * j) < 0 ? (D = 0, N = ne, pe = X) : D > de && (D = de, N = ne + U, pe = X)), N < 0 ? (N = 0, -j < 0 ? D = 0 : -j > M ? D = de : (D = -j, de = M)) : N > pe && (N = pe, -j + U < 0 ? D = 0 : -j + U > M ? D = de : (D = -j + U, de = M)), b = Math.abs(D) < m.smallnum ? 0 : D / de, w = Math.abs(N) < m.smallnum ? 0 : N / pe;\n            var ae = _.c.Vector3[4];\n            h.scaleToRef(w, ae);\n            var ee = _.c.Vector3[5];\n            g.scaleToRef(b, ee), ee.addInPlace(v);\n            var K = _.c.Vector3[6];\n            return ee.subtractToRef(ae, K), w > 0 && w <= this.length && K.lengthSquared() < S * S ? ee.length() : -1;\n          }, m.prototype.update = function(c, T, S, E, g, l, h) {\n            return this.unprojectRayToRef(c, T, S, E, g, l, h), this;\n          }, m.Zero = function() {\n            return new m(_.e.Zero(), _.e.Zero());\n          }, m.CreateNew = function(c, T, S, E, g, l, h) {\n            return m.Zero().update(c, T, S, E, g, l, h);\n          }, m.CreateNewFromTo = function(c, T, S) {\n            S === void 0 && (S = _.a.IdentityReadOnly);\n            var E = T.subtract(c), g = Math.sqrt(E.x * E.x + E.y * E.y + E.z * E.z);\n            return E.normalize(), m.Transform(new m(c, E, g), S);\n          }, m.Transform = function(c, T) {\n            var S = new m(new _.e(0, 0, 0), new _.e(0, 0, 0));\n            return m.TransformToRef(c, T, S), S;\n          }, m.TransformToRef = function(c, T, S) {\n            _.e.TransformCoordinatesToRef(c.origin, T, S.origin), _.e.TransformNormalToRef(c.direction, T, S.direction), S.length = c.length;\n            var E = S.direction, g = E.length();\n            if (g !== 0 && g !== 1) {\n              var l = 1 / g;\n              E.x *= l, E.y *= l, E.z *= l, S.length *= g;\n            }\n          }, m.prototype.unprojectRayToRef = function(c, T, S, E, g, l, h) {\n            var v = _.c.Matrix[0];\n            g.multiplyToRef(l, v), v.multiplyToRef(h, v), v.invert();\n            var b = _.c.Vector3[0];\n            b.x = c / S * 2 - 1, b.y = -(T / E * 2 - 1), b.z = -1;\n            var D = _.c.Vector3[1].copyFromFloats(b.x, b.y, 1), w = _.c.Vector3[2], N = _.c.Vector3[3];\n            _.e._UnprojectFromInvertedMatrixToRef(b, v, w), _.e._UnprojectFromInvertedMatrixToRef(D, v, N), this.origin.copyFrom(w), N.subtractToRef(w, this.direction), this.direction.normalize();\n          }, m._TmpVector3 = V.a.BuildArray(6, _.e.Zero), m.smallnum = 1e-8, m.rayl = 1e9, m;\n        }();\n        I.a.prototype.createPickingRay = function(m, c, T, S, E) {\n          E === void 0 && (E = !1);\n          var g = x.Zero();\n          return this.createPickingRayToRef(m, c, T, g, S, E), g;\n        }, I.a.prototype.createPickingRayToRef = function(m, c, T, S, E, g) {\n          g === void 0 && (g = !1);\n          var l = this.getEngine();\n          if (!E) {\n            if (!this.activeCamera)\n              return this;\n            E = this.activeCamera;\n          }\n          var h = E.viewport.toGlobal(l.getRenderWidth(), l.getRenderHeight());\n          return m = m / l.getHardwareScalingLevel() - h.x, c = c / l.getHardwareScalingLevel() - (l.getRenderHeight() - h.y - h.height), S.update(m, c, h.width, h.height, T || _.a.IdentityReadOnly, g ? _.a.IdentityReadOnly : E.getViewMatrix(), E.getProjectionMatrix()), this;\n        }, I.a.prototype.createPickingRayInCameraSpace = function(m, c, T) {\n          var S = x.Zero();\n          return this.createPickingRayInCameraSpaceToRef(m, c, S, T), S;\n        }, I.a.prototype.createPickingRayInCameraSpaceToRef = function(m, c, T, S) {\n          if (!C.a)\n            return this;\n          var E = this.getEngine();\n          if (!S) {\n            if (!this.activeCamera)\n              throw new Error(\"Active camera not set\");\n            S = this.activeCamera;\n          }\n          var g = S.viewport.toGlobal(E.getRenderWidth(), E.getRenderHeight()), l = _.a.Identity();\n          return m = m / E.getHardwareScalingLevel() - g.x, c = c / E.getHardwareScalingLevel() - (E.getRenderHeight() - g.y - g.height), T.update(m, c, g.width, g.height, l, l, S.getProjectionMatrix()), this;\n        }, I.a.prototype._internalPickForMesh = function(m, c, T, S, E, g, l, h) {\n          var v = c(S), b = T.intersects(v, E, l, g, S, h);\n          return b && b.hit ? !E && m != null && b.distance >= m.distance ? null : b : null;\n        }, I.a.prototype._internalPick = function(m, c, T, S, E) {\n          if (!C.a)\n            return null;\n          for (var g = null, l = 0; l < this.meshes.length; l++) {\n            var h = this.meshes[l];\n            if (c) {\n              if (!c(h))\n                continue;\n            } else if (!h.isEnabled() || !h.isVisible || !h.isPickable)\n              continue;\n            var v, b = h.skeleton && h.skeleton.overrideMesh ? h.skeleton.overrideMesh.getWorldMatrix() : h.getWorldMatrix();\n            if (h.hasThinInstances && h.thinInstanceEnablePicking) {\n              if (v = this._internalPickForMesh(g, m, h, b, !0, !0, E)) {\n                if (S)\n                  return g;\n                for (var D = _.c.Matrix[1], w = h.thinInstanceGetWorldMatrices(), N = 0; N < w.length; N++) {\n                  w[N].multiplyToRef(b, D);\n                  var M = this._internalPickForMesh(g, m, h, D, T, S, E, !0);\n                  if (M && ((g = M).thinInstanceIndex = N, T))\n                    return g;\n                }\n              }\n            } else if ((v = this._internalPickForMesh(g, m, h, b, T, S, E)) && (g = v, T))\n              return g;\n          }\n          return g || new C.a();\n        }, I.a.prototype._internalMultiPick = function(m, c, T) {\n          if (!C.a)\n            return null;\n          for (var S = new Array(), E = 0; E < this.meshes.length; E++) {\n            var g = this.meshes[E];\n            if (c) {\n              if (!c(g))\n                continue;\n            } else if (!g.isEnabled() || !g.isVisible || !g.isPickable)\n              continue;\n            var l, h = g.skeleton && g.skeleton.overrideMesh ? g.skeleton.overrideMesh.getWorldMatrix() : g.getWorldMatrix();\n            if (g.hasThinInstances && g.thinInstanceEnablePicking) {\n              if (l = this._internalPickForMesh(null, m, g, h, !0, !0, T))\n                for (var v = _.c.Matrix[1], b = g.thinInstanceGetWorldMatrices(), D = 0; D < b.length; D++) {\n                  b[D].multiplyToRef(h, v);\n                  var w = this._internalPickForMesh(null, m, g, v, !1, !1, T, !0);\n                  w && (w.thinInstanceIndex = D, S.push(w));\n                }\n            } else\n              (l = this._internalPickForMesh(null, m, g, h, !1, !1, T)) && S.push(l);\n          }\n          return S;\n        }, I.a.prototype.pickWithBoundingInfo = function(m, c, T, S, E) {\n          var g = this;\n          if (!C.a)\n            return null;\n          var l = this._internalPick(function(h) {\n            return g._tempPickingRay || (g._tempPickingRay = x.Zero()), g.createPickingRayToRef(m, c, h, g._tempPickingRay, E || null), g._tempPickingRay;\n          }, T, S, !0);\n          return l && (l.ray = this.createPickingRay(m, c, _.a.Identity(), E || null)), l;\n        }, I.a.prototype.pick = function(m, c, T, S, E, g) {\n          var l = this;\n          if (!C.a)\n            return null;\n          var h = this._internalPick(function(v) {\n            return l._tempPickingRay || (l._tempPickingRay = x.Zero()), l.createPickingRayToRef(m, c, v, l._tempPickingRay, E || null), l._tempPickingRay;\n          }, T, S, !1, g);\n          return h && (h.ray = this.createPickingRay(m, c, _.a.Identity(), E || null)), h;\n        }, I.a.prototype.pickWithRay = function(m, c, T, S) {\n          var E = this, g = this._internalPick(function(l) {\n            return E._pickWithRayInverseMatrix || (E._pickWithRayInverseMatrix = _.a.Identity()), l.invertToRef(E._pickWithRayInverseMatrix), E._cachedRayForTransform || (E._cachedRayForTransform = x.Zero()), x.TransformToRef(m, E._pickWithRayInverseMatrix, E._cachedRayForTransform), E._cachedRayForTransform;\n          }, c, T, !1, S);\n          return g && (g.ray = m), g;\n        }, I.a.prototype.multiPick = function(m, c, T, S, E) {\n          var g = this;\n          return this._internalMultiPick(function(l) {\n            return g.createPickingRay(m, c, l, S || null);\n          }, T, E);\n        }, I.a.prototype.multiPickWithRay = function(m, c, T) {\n          var S = this;\n          return this._internalMultiPick(function(E) {\n            return S._pickWithRayInverseMatrix || (S._pickWithRayInverseMatrix = _.a.Identity()), E.invertToRef(S._pickWithRayInverseMatrix), S._cachedRayForTransform || (S._cachedRayForTransform = x.Zero()), x.TransformToRef(m, S._pickWithRayInverseMatrix, S._cachedRayForTransform), S._cachedRayForTransform;\n          }, c, T);\n        }, O.a.prototype.getForwardRay = function(m, c, T) {\n          return m === void 0 && (m = 100), this.getForwardRayToRef(new x(_.e.Zero(), _.e.Zero(), m), m, c, T);\n        }, O.a.prototype.getForwardRayToRef = function(m, c, T, S) {\n          return c === void 0 && (c = 100), T || (T = this.getWorldMatrix()), m.length = c, S ? m.origin.copyFrom(S) : m.origin.copyFrom(this.position), _.c.Vector3[2].set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), _.e.TransformNormalToRef(_.c.Vector3[2], T, _.c.Vector3[3]), _.e.NormalizeToRef(_.c.Vector3[3], m.direction), m;\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(0), _ = f(7), C = f(16), u = f(98), I = f(4);\n        C.a.CreateLineSystem = function(x) {\n          for (var m = [], c = [], T = x.lines, S = x.colors, E = [], g = 0, l = 0; l < T.length; l++)\n            for (var h = T[l], v = 0; v < h.length; v++) {\n              if (c.push(h[v].x, h[v].y, h[v].z), S) {\n                var b = S[l];\n                E.push(b[v].r, b[v].g, b[v].b, b[v].a);\n              }\n              v > 0 && (m.push(g - 1), m.push(g)), g++;\n            }\n          var D = new C.a();\n          return D.indices = m, D.positions = c, S && (D.colors = E), D;\n        }, C.a.CreateDashedLines = function(x) {\n          var m, c, T = x.dashSize || 3, S = x.gapSize || 1, E = x.dashNb || 200, g = x.points, l = new Array(), h = new Array(), v = V.e.Zero(), b = 0, D = 0, w = 0, N = 0, M = 0;\n          for (M = 0; M < g.length - 1; M++)\n            g[M + 1].subtractToRef(g[M], v), b += v.length();\n          for (c = T * (m = b / E) / (T + S), M = 0; M < g.length - 1; M++) {\n            g[M + 1].subtractToRef(g[M], v), D = Math.floor(v.length() / m), v.normalize();\n            for (var U = 0; U < D; U++)\n              w = m * U, l.push(g[M].x + w * v.x, g[M].y + w * v.y, g[M].z + w * v.z), l.push(g[M].x + (w + c) * v.x, g[M].y + (w + c) * v.y, g[M].z + (w + c) * v.z), h.push(N, N + 1), N += 2;\n          }\n          var X = new C.a();\n          return X.positions = l, X.indices = h, X;\n        }, _.a.CreateLines = function(x, m, c, T, S) {\n          c === void 0 && (c = null), T === void 0 && (T = !1), S === void 0 && (S = null);\n          var E = { points: m, updatable: T, instance: S };\n          return O.CreateLines(x, E, c);\n        }, _.a.CreateDashedLines = function(x, m, c, T, S, E, g, l) {\n          E === void 0 && (E = null);\n          var h = { points: m, dashSize: c, gapSize: T, dashNb: S, updatable: g, instance: l };\n          return O.CreateDashedLines(x, h, E);\n        };\n        var O = function() {\n          function x() {\n          }\n          return x.CreateLineSystem = function(m, c, T) {\n            var S = c.instance, E = c.lines, g = c.colors;\n            if (S) {\n              var l, h, v = S.getVerticesData(I.b.PositionKind);\n              g && (l = S.getVerticesData(I.b.ColorKind));\n              for (var b = 0, D = 0, w = 0; w < E.length; w++)\n                for (var N = E[w], M = 0; M < N.length; M++)\n                  v[b] = N[M].x, v[b + 1] = N[M].y, v[b + 2] = N[M].z, g && l && (h = g[w], l[D] = h[M].r, l[D + 1] = h[M].g, l[D + 2] = h[M].b, l[D + 3] = h[M].a, D += 4), b += 3;\n              return S.updateVerticesData(I.b.PositionKind, v, !1, !1), g && l && S.updateVerticesData(I.b.ColorKind, l, !1, !1), S;\n            }\n            var U = !!g, X = new u.b(m, T, null, void 0, void 0, U, c.useVertexAlpha);\n            return C.a.CreateLineSystem(c).applyToMesh(X, c.updatable), X;\n          }, x.CreateLines = function(m, c, T) {\n            T === void 0 && (T = null);\n            var S = c.colors ? [c.colors] : null;\n            return x.CreateLineSystem(m, { lines: [c.points], updatable: c.updatable, instance: c.instance, colors: S, useVertexAlpha: c.useVertexAlpha }, T);\n          }, x.CreateDashedLines = function(m, c, T) {\n            T === void 0 && (T = null);\n            var S = c.points, E = c.instance, g = c.gapSize || 1, l = c.dashSize || 3;\n            if (E)\n              return E.updateMeshPositions(function(v) {\n                var b, D, w = V.e.Zero(), N = v.length / 6, M = 0, U = 0, X = 0, j = 0, ne = 0, te = 0;\n                for (ne = 0; ne < S.length - 1; ne++)\n                  S[ne + 1].subtractToRef(S[ne], w), M += w.length();\n                b = M / N;\n                var de = E._creationDataStorage.dashSize;\n                for (D = de * b / (de + E._creationDataStorage.gapSize), ne = 0; ne < S.length - 1; ne++)\n                  for (S[ne + 1].subtractToRef(S[ne], w), U = Math.floor(w.length() / b), w.normalize(), te = 0; te < U && j < v.length; )\n                    X = b * te, v[j] = S[ne].x + X * w.x, v[j + 1] = S[ne].y + X * w.y, v[j + 2] = S[ne].z + X * w.z, v[j + 3] = S[ne].x + (X + D) * w.x, v[j + 4] = S[ne].y + (X + D) * w.y, v[j + 5] = S[ne].z + (X + D) * w.z, j += 6, te++;\n                for (; j < v.length; )\n                  v[j] = S[ne].x, v[j + 1] = S[ne].y, v[j + 2] = S[ne].z, j += 3;\n              }, !1), E;\n            var h = new u.b(m, T, null, void 0, void 0, void 0, c.useVertexAlpha);\n            return C.a.CreateDashedLines(c).applyToMesh(h, c.updatable), h._creationDataStorage = new _.b(), h._creationDataStorage.dashSize = l, h._creationDataStorage.gapSize = g, h;\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(34), _ = f(8), C = function(I, O) {\n          return I ? I.getClassName && I.getClassName() === \"Mesh\" ? null : I.getClassName && I.getClassName() === \"SubMesh\" ? I.clone(O) : I.clone ? I.clone() : null : null;\n        }, u = function() {\n          function I() {\n          }\n          return I.DeepCopy = function(O, x, m, c) {\n            for (var T = 0, S = function(b) {\n              var D = [];\n              do\n                Object.getOwnPropertyNames(b).forEach(function(w) {\n                  D.indexOf(w) === -1 && D.push(w);\n                });\n              while (b = Object.getPrototypeOf(b));\n              return D;\n            }(O); T < S.length; T++) {\n              var E = S[T];\n              if ((E[0] !== \"_\" || c && c.indexOf(E) !== -1) && !(V.a.EndsWith(E, \"Observable\") || m && m.indexOf(E) !== -1)) {\n                var g = O[E], l = typeof g;\n                if (l !== \"function\")\n                  try {\n                    if (l === \"object\")\n                      if (g instanceof Array) {\n                        if (x[E] = [], g.length > 0)\n                          if (typeof g[0] == \"object\")\n                            for (var h = 0; h < g.length; h++) {\n                              var v = C(g[h], x);\n                              x[E].indexOf(v) === -1 && x[E].push(v);\n                            }\n                          else\n                            x[E] = g.slice(0);\n                      } else\n                        x[E] = C(g, x);\n                    else\n                      x[E] = g;\n                  } catch (b) {\n                    _.a.Warn(b.message);\n                  }\n              }\n            }\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return m;\n        }), f.d(A, \"a\", function() {\n          return c;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(12), I = f(9), O = f(76), x = f(121), m = function(T) {\n          function S() {\n            var E = T.call(this) || this;\n            return E.IMAGEPROCESSING = !1, E.VIGNETTE = !1, E.VIGNETTEBLENDMODEMULTIPLY = !1, E.VIGNETTEBLENDMODEOPAQUE = !1, E.TONEMAPPING = !1, E.TONEMAPPING_ACES = !1, E.CONTRAST = !1, E.COLORCURVES = !1, E.COLORGRADING = !1, E.COLORGRADING3D = !1, E.SAMPLER3DGREENDEPTH = !1, E.SAMPLER3DBGRMAP = !1, E.IMAGEPROCESSINGPOSTPROCESS = !1, E.EXPOSURE = !1, E.rebuild(), E;\n          }\n          return Object(V.d)(S, T), S;\n        }(O.a), c = function() {\n          function T() {\n            this.colorCurves = new x.a(), this._colorCurvesEnabled = !1, this._colorGradingEnabled = !1, this._colorGradingWithGreenDepth = !0, this._colorGradingBGR = !0, this._exposure = 1, this._toneMappingEnabled = !1, this._toneMappingType = T.TONEMAPPING_STANDARD, this._contrast = 1, this.vignetteStretch = 0, this.vignetteCentreX = 0, this.vignetteCentreY = 0, this.vignetteWeight = 1.5, this.vignetteColor = new I.b(0, 0, 0, 0), this.vignetteCameraFov = 0.5, this._vignetteBlendMode = T.VIGNETTEMODE_MULTIPLY, this._vignetteEnabled = !1, this._applyByPostProcess = !1, this._isEnabled = !0, this.onUpdateParameters = new C.c();\n          }\n          return Object.defineProperty(T.prototype, \"colorCurvesEnabled\", { get: function() {\n            return this._colorCurvesEnabled;\n          }, set: function(S) {\n            this._colorCurvesEnabled !== S && (this._colorCurvesEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingTexture\", { get: function() {\n            return this._colorGradingTexture;\n          }, set: function(S) {\n            this._colorGradingTexture !== S && (this._colorGradingTexture = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingEnabled\", { get: function() {\n            return this._colorGradingEnabled;\n          }, set: function(S) {\n            this._colorGradingEnabled !== S && (this._colorGradingEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingWithGreenDepth\", { get: function() {\n            return this._colorGradingWithGreenDepth;\n          }, set: function(S) {\n            this._colorGradingWithGreenDepth !== S && (this._colorGradingWithGreenDepth = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingBGR\", { get: function() {\n            return this._colorGradingBGR;\n          }, set: function(S) {\n            this._colorGradingBGR !== S && (this._colorGradingBGR = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"exposure\", { get: function() {\n            return this._exposure;\n          }, set: function(S) {\n            this._exposure !== S && (this._exposure = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"toneMappingEnabled\", { get: function() {\n            return this._toneMappingEnabled;\n          }, set: function(S) {\n            this._toneMappingEnabled !== S && (this._toneMappingEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"toneMappingType\", { get: function() {\n            return this._toneMappingType;\n          }, set: function(S) {\n            this._toneMappingType !== S && (this._toneMappingType = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"contrast\", { get: function() {\n            return this._contrast;\n          }, set: function(S) {\n            this._contrast !== S && (this._contrast = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"vignetteBlendMode\", { get: function() {\n            return this._vignetteBlendMode;\n          }, set: function(S) {\n            this._vignetteBlendMode !== S && (this._vignetteBlendMode = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"vignetteEnabled\", { get: function() {\n            return this._vignetteEnabled;\n          }, set: function(S) {\n            this._vignetteEnabled !== S && (this._vignetteEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"applyByPostProcess\", { get: function() {\n            return this._applyByPostProcess;\n          }, set: function(S) {\n            this._applyByPostProcess !== S && (this._applyByPostProcess = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(S) {\n            this._isEnabled !== S && (this._isEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), T.prototype._updateParameters = function() {\n            this.onUpdateParameters.notifyObservers(this);\n          }, T.prototype.getClassName = function() {\n            return \"ImageProcessingConfiguration\";\n          }, T.PrepareUniforms = function(S, E) {\n            E.EXPOSURE && S.push(\"exposureLinear\"), E.CONTRAST && S.push(\"contrast\"), E.COLORGRADING && S.push(\"colorTransformSettings\"), E.VIGNETTE && (S.push(\"vInverseScreenSize\"), S.push(\"vignetteSettings1\"), S.push(\"vignetteSettings2\")), E.COLORCURVES && x.a.PrepareUniforms(S);\n          }, T.PrepareSamplers = function(S, E) {\n            E.COLORGRADING && S.push(\"txColorTransform\");\n          }, T.prototype.prepareDefines = function(S, E) {\n            if (E === void 0 && (E = !1), E !== this.applyByPostProcess || !this._isEnabled)\n              return S.VIGNETTE = !1, S.TONEMAPPING = !1, S.TONEMAPPING_ACES = !1, S.CONTRAST = !1, S.EXPOSURE = !1, S.COLORCURVES = !1, S.COLORGRADING = !1, S.COLORGRADING3D = !1, S.IMAGEPROCESSING = !1, void (S.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled);\n            switch (S.VIGNETTE = this.vignetteEnabled, S.VIGNETTEBLENDMODEMULTIPLY = this.vignetteBlendMode === T._VIGNETTEMODE_MULTIPLY, S.VIGNETTEBLENDMODEOPAQUE = !S.VIGNETTEBLENDMODEMULTIPLY, S.TONEMAPPING = this.toneMappingEnabled, this._toneMappingType) {\n              case T.TONEMAPPING_ACES:\n                S.TONEMAPPING_ACES = !0;\n                break;\n              default:\n                S.TONEMAPPING_ACES = !1;\n            }\n            S.CONTRAST = this.contrast !== 1, S.EXPOSURE = this.exposure !== 1, S.COLORCURVES = this.colorCurvesEnabled && !!this.colorCurves, S.COLORGRADING = this.colorGradingEnabled && !!this.colorGradingTexture, S.COLORGRADING ? S.COLORGRADING3D = this.colorGradingTexture.is3D : S.COLORGRADING3D = !1, S.SAMPLER3DGREENDEPTH = this.colorGradingWithGreenDepth, S.SAMPLER3DBGRMAP = this.colorGradingBGR, S.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess, S.IMAGEPROCESSING = S.VIGNETTE || S.TONEMAPPING || S.CONTRAST || S.EXPOSURE || S.COLORCURVES || S.COLORGRADING;\n          }, T.prototype.isReady = function() {\n            return !this.colorGradingEnabled || !this.colorGradingTexture || this.colorGradingTexture.isReady();\n          }, T.prototype.bind = function(S, E) {\n            if (this._colorCurvesEnabled && this.colorCurves && x.a.Bind(this.colorCurves, S), this._vignetteEnabled) {\n              var g = 1 / S.getEngine().getRenderWidth(), l = 1 / S.getEngine().getRenderHeight();\n              S.setFloat2(\"vInverseScreenSize\", g, l);\n              var h = E ?? l / g, v = Math.tan(0.5 * this.vignetteCameraFov), b = v * h, D = Math.sqrt(b * v);\n              b = u.b.Mix(b, D, this.vignetteStretch), v = u.b.Mix(v, D, this.vignetteStretch), S.setFloat4(\"vignetteSettings1\", b, v, -b * this.vignetteCentreX, -v * this.vignetteCentreY);\n              var w = -2 * this.vignetteWeight;\n              S.setFloat4(\"vignetteSettings2\", this.vignetteColor.r, this.vignetteColor.g, this.vignetteColor.b, w);\n            }\n            if (S.setFloat(\"exposureLinear\", this.exposure), S.setFloat(\"contrast\", this.contrast), this.colorGradingTexture) {\n              S.setTexture(\"txColorTransform\", this.colorGradingTexture);\n              var N = this.colorGradingTexture.getSize().height;\n              S.setFloat4(\"colorTransformSettings\", (N - 1) / N, 0.5 / N, N, this.colorGradingTexture.level);\n            }\n          }, T.prototype.clone = function() {\n            return _.a.Clone(function() {\n              return new T();\n            }, this);\n          }, T.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, T.Parse = function(S) {\n            return _.a.Parse(function() {\n              return new T();\n            }, S, null, null);\n          }, Object.defineProperty(T, \"VIGNETTEMODE_MULTIPLY\", { get: function() {\n            return this._VIGNETTEMODE_MULTIPLY;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T, \"VIGNETTEMODE_OPAQUE\", { get: function() {\n            return this._VIGNETTEMODE_OPAQUE;\n          }, enumerable: !1, configurable: !0 }), T.TONEMAPPING_STANDARD = 0, T.TONEMAPPING_ACES = 1, T._VIGNETTEMODE_MULTIPLY = 0, T._VIGNETTEMODE_OPAQUE = 1, Object(V.c)([Object(_.g)()], T.prototype, \"colorCurves\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorCurvesEnabled\", void 0), Object(V.c)([Object(_.m)(\"colorGradingTexture\")], T.prototype, \"_colorGradingTexture\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorGradingEnabled\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorGradingWithGreenDepth\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorGradingBGR\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_exposure\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_toneMappingEnabled\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_toneMappingType\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_contrast\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteStretch\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteCentreX\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteCentreY\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteWeight\", void 0), Object(V.c)([Object(_.f)()], T.prototype, \"vignetteColor\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteCameraFov\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_vignetteBlendMode\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_vignetteEnabled\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_applyByPostProcess\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_isEnabled\", void 0), T;\n        }();\n        _.a._ImageProcessingConfigurationParser = c.Parse;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return T;\n        });\n        var V = f(44), _ = f(0), C = f(2), u = f(103), I = f(113), O = { min: 0, max: 0 }, x = { min: 0, max: 0 }, m = function(S, E, g) {\n          var l = _.e.Dot(E.centerWorld, S), h = Math.abs(_.e.Dot(E.directions[0], S)) * E.extendSize.x + Math.abs(_.e.Dot(E.directions[1], S)) * E.extendSize.y + Math.abs(_.e.Dot(E.directions[2], S)) * E.extendSize.z;\n          g.min = l - h, g.max = l + h;\n        }, c = function(S, E, g) {\n          return m(S, E, O), m(S, g, x), !(O.min > x.max || x.min > O.max);\n        }, T = function() {\n          function S(E, g, l) {\n            this._isLocked = !1, this.boundingBox = new u.a(E, g, l), this.boundingSphere = new I.a(E, g, l);\n          }\n          return S.prototype.reConstruct = function(E, g, l) {\n            this.boundingBox.reConstruct(E, g, l), this.boundingSphere.reConstruct(E, g, l);\n          }, Object.defineProperty(S.prototype, \"minimum\", { get: function() {\n            return this.boundingBox.minimum;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"maximum\", { get: function() {\n            return this.boundingBox.maximum;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isLocked\", { get: function() {\n            return this._isLocked;\n          }, set: function(E) {\n            this._isLocked = E;\n          }, enumerable: !1, configurable: !0 }), S.prototype.update = function(E) {\n            this._isLocked || (this.boundingBox._update(E), this.boundingSphere._update(E));\n          }, S.prototype.centerOn = function(E, g) {\n            var l = S.TmpVector3[0].copyFrom(E).subtractInPlace(g), h = S.TmpVector3[1].copyFrom(E).addInPlace(g);\n            return this.boundingBox.reConstruct(l, h, this.boundingBox.getWorldMatrix()), this.boundingSphere.reConstruct(l, h, this.boundingBox.getWorldMatrix()), this;\n          }, S.prototype.scale = function(E) {\n            return this.boundingBox.scale(E), this.boundingSphere.scale(E), this;\n          }, S.prototype.isInFrustum = function(E, g) {\n            return g === void 0 && (g = C.a.MESHES_CULLINGSTRATEGY_STANDARD), !(g !== C.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION && g !== C.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY || !this.boundingSphere.isCenterInFrustum(E)) || !!this.boundingSphere.isInFrustum(E) && (!(g !== C.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY && g !== C.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY) || this.boundingBox.isInFrustum(E));\n          }, Object.defineProperty(S.prototype, \"diagonalLength\", { get: function() {\n            var E = this.boundingBox;\n            return E.maximumWorld.subtractToRef(E.minimumWorld, S.TmpVector3[0]).length();\n          }, enumerable: !1, configurable: !0 }), S.prototype.isCompletelyInFrustum = function(E) {\n            return this.boundingBox.isCompletelyInFrustum(E);\n          }, S.prototype._checkCollision = function(E) {\n            return E._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld);\n          }, S.prototype.intersectsPoint = function(E) {\n            return !!this.boundingSphere.centerWorld && !!this.boundingSphere.intersectsPoint(E) && !!this.boundingBox.intersectsPoint(E);\n          }, S.prototype.intersects = function(E, g) {\n            if (!I.a.Intersects(this.boundingSphere, E.boundingSphere) || !u.a.Intersects(this.boundingBox, E.boundingBox))\n              return !1;\n            if (!g)\n              return !0;\n            var l = this.boundingBox, h = E.boundingBox;\n            return !!c(l.directions[0], l, h) && !!c(l.directions[1], l, h) && !!c(l.directions[2], l, h) && !!c(h.directions[0], l, h) && !!c(h.directions[1], l, h) && !!c(h.directions[2], l, h) && !!c(_.e.Cross(l.directions[0], h.directions[0]), l, h) && !!c(_.e.Cross(l.directions[0], h.directions[1]), l, h) && !!c(_.e.Cross(l.directions[0], h.directions[2]), l, h) && !!c(_.e.Cross(l.directions[1], h.directions[0]), l, h) && !!c(_.e.Cross(l.directions[1], h.directions[1]), l, h) && !!c(_.e.Cross(l.directions[1], h.directions[2]), l, h) && !!c(_.e.Cross(l.directions[2], h.directions[0]), l, h) && !!c(_.e.Cross(l.directions[2], h.directions[1]), l, h) && !!c(_.e.Cross(l.directions[2], h.directions[2]), l, h);\n          }, S.TmpVector3 = V.a.BuildArray(2, _.e.Zero), S;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.BuildArray = function(C, u) {\n            for (var I = [], O = 0; O < C; ++O)\n              I.push(u());\n            return I;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(0), _ = f(7), C = f(16);\n        C.a.CreateSphere = function(I) {\n          for (var O = I.segments || 32, x = I.diameterX || I.diameter || 1, m = I.diameterY || I.diameter || 1, c = I.diameterZ || I.diameter || 1, T = I.arc && (I.arc <= 0 || I.arc > 1) ? 1 : I.arc || 1, S = I.slice && I.slice <= 0 ? 1 : I.slice || 1, E = I.sideOrientation === 0 ? 0 : I.sideOrientation || C.a.DEFAULTSIDE, g = !!I.dedupTopBottomIndices, l = new V.e(x / 2, m / 2, c / 2), h = 2 + O, v = 2 * h, b = [], D = [], w = [], N = [], M = 0; M <= h; M++) {\n            for (var U = M / h, X = U * Math.PI * S, j = 0; j <= v; j++) {\n              var ne = j / v, te = ne * Math.PI * 2 * T, de = V.a.RotationZ(-X), pe = V.a.RotationY(te), ae = V.e.TransformCoordinates(V.e.Up(), de), ee = V.e.TransformCoordinates(ae, pe), K = ee.multiply(l), $ = ee.divide(l).normalize();\n              D.push(K.x, K.y, K.z), w.push($.x, $.y, $.z), N.push(ne, U);\n            }\n            if (M > 0)\n              for (var L = D.length / 3, G = L - 2 * (v + 1); G + v + 2 < L; G++)\n                g ? (M > 1 && (b.push(G), b.push(G + 1), b.push(G + v + 1)), (M < h || S < 1) && (b.push(G + v + 1), b.push(G + 1), b.push(G + v + 2))) : (b.push(G), b.push(G + 1), b.push(G + v + 1), b.push(G + v + 1), b.push(G + 1), b.push(G + v + 2));\n          }\n          C.a._ComputeSides(E, D, b, w, N, I.frontUVs, I.backUVs);\n          var Q = new C.a();\n          return Q.indices = b, Q.positions = D, Q.normals = w, Q.uvs = N, Q;\n        }, _.a.CreateSphere = function(I, O, x, m, c, T) {\n          var S = { segments: O, diameterX: x, diameterY: x, diameterZ: x, sideOrientation: T, updatable: c };\n          return u.CreateSphere(I, S, m);\n        };\n        var u = function() {\n          function I() {\n          }\n          return I.CreateSphere = function(O, x, m) {\n            m === void 0 && (m = null);\n            var c = new _.a(O, m);\n            return x.sideOrientation = _.a._GetDefaultSideOrientation(x.sideOrientation), c._originalBuilderSideOrientation = x.sideOrientation, C.a.CreateSphere(x).applyToMesh(c, x.updatable), c;\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(0), I = f(29), O = f(23), x = function(m) {\n          function c(T, S, E) {\n            S === void 0 && (S = null), E === void 0 && (E = !0);\n            var g = m.call(this, T, S) || this;\n            return g._forward = new u.e(0, 0, 1), g._forwardInverted = new u.e(0, 0, -1), g._up = new u.e(0, 1, 0), g._right = new u.e(1, 0, 0), g._rightInverted = new u.e(-1, 0, 0), g._position = u.e.Zero(), g._rotation = u.e.Zero(), g._rotationQuaternion = null, g._scaling = u.e.One(), g._isDirty = !1, g._transformToBoneReferal = null, g._isAbsoluteSynced = !1, g._billboardMode = c.BILLBOARDMODE_NONE, g._preserveParentRotationForBillboard = !1, g.scalingDeterminant = 1, g._infiniteDistance = !1, g.ignoreNonUniformScaling = !1, g.reIntegrateRotationIntoRotationQuaternion = !1, g._poseMatrix = null, g._localMatrix = u.a.Zero(), g._usePivotMatrix = !1, g._absolutePosition = u.e.Zero(), g._absoluteScaling = u.e.Zero(), g._absoluteRotationQuaternion = u.b.Identity(), g._pivotMatrix = u.a.Identity(), g._postMultiplyPivotMatrix = !1, g._isWorldMatrixFrozen = !1, g._indexInSceneTransformNodesArray = -1, g.onAfterWorldMatrixUpdateObservable = new C.c(), g._nonUniformScaling = !1, E && g.getScene().addTransformNode(g), g;\n          }\n          return Object(V.d)(c, m), Object.defineProperty(c.prototype, \"billboardMode\", { get: function() {\n            return this._billboardMode;\n          }, set: function(T) {\n            this._billboardMode !== T && (this._billboardMode = T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"preserveParentRotationForBillboard\", { get: function() {\n            return this._preserveParentRotationForBillboard;\n          }, set: function(T) {\n            T !== this._preserveParentRotationForBillboard && (this._preserveParentRotationForBillboard = T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"infiniteDistance\", { get: function() {\n            return this._infiniteDistance;\n          }, set: function(T) {\n            this._infiniteDistance !== T && (this._infiniteDistance = T);\n          }, enumerable: !1, configurable: !0 }), c.prototype.getClassName = function() {\n            return \"TransformNode\";\n          }, Object.defineProperty(c.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(T) {\n            this._position = T, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"rotation\", { get: function() {\n            return this._rotation;\n          }, set: function(T) {\n            this._rotation = T, this._rotationQuaternion = null, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"scaling\", { get: function() {\n            return this._scaling;\n          }, set: function(T) {\n            this._scaling = T, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"rotationQuaternion\", { get: function() {\n            return this._rotationQuaternion;\n          }, set: function(T) {\n            this._rotationQuaternion = T, T && this._rotation.setAll(0), this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"forward\", { get: function() {\n            return u.e.Normalize(u.e.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"up\", { get: function() {\n            return u.e.Normalize(u.e.TransformNormal(this._up, this.getWorldMatrix()));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"right\", { get: function() {\n            return u.e.Normalize(u.e.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()));\n          }, enumerable: !1, configurable: !0 }), c.prototype.updatePoseMatrix = function(T) {\n            return this._poseMatrix ? (this._poseMatrix.copyFrom(T), this) : (this._poseMatrix = T.clone(), this);\n          }, c.prototype.getPoseMatrix = function() {\n            return this._poseMatrix || (this._poseMatrix = u.a.Identity()), this._poseMatrix;\n          }, c.prototype._isSynchronized = function() {\n            var T = this._cache;\n            return this.billboardMode === T.billboardMode && this.billboardMode === c.BILLBOARDMODE_NONE && !T.pivotMatrixUpdated && !this.infiniteDistance && !this.position._isDirty && !this.scaling._isDirty && !(this._rotationQuaternion && this._rotationQuaternion._isDirty || this.rotation._isDirty);\n          }, c.prototype._initCache = function() {\n            m.prototype._initCache.call(this);\n            var T = this._cache;\n            T.localMatrixUpdated = !1, T.billboardMode = -1, T.infiniteDistance = !1;\n          }, c.prototype.markAsDirty = function(T) {\n            return this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this;\n          }, Object.defineProperty(c.prototype, \"absolutePosition\", { get: function() {\n            return this._absolutePosition;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"absoluteScaling\", { get: function() {\n            return this._syncAbsoluteScalingAndRotation(), this._absoluteScaling;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"absoluteRotationQuaternion\", { get: function() {\n            return this._syncAbsoluteScalingAndRotation(), this._absoluteRotationQuaternion;\n          }, enumerable: !1, configurable: !0 }), c.prototype.setPreTransformMatrix = function(T) {\n            return this.setPivotMatrix(T, !1);\n          }, c.prototype.setPivotMatrix = function(T, S) {\n            return S === void 0 && (S = !0), this._pivotMatrix.copyFrom(T), this._usePivotMatrix = !this._pivotMatrix.isIdentity(), this._cache.pivotMatrixUpdated = !0, this._postMultiplyPivotMatrix = S, this._postMultiplyPivotMatrix && (this._pivotMatrixInverse ? this._pivotMatrix.invertToRef(this._pivotMatrixInverse) : this._pivotMatrixInverse = u.a.Invert(this._pivotMatrix)), this;\n          }, c.prototype.getPivotMatrix = function() {\n            return this._pivotMatrix;\n          }, c.prototype.instantiateHierarchy = function(T, S, E) {\n            T === void 0 && (T = null);\n            var g = this.clone(\"Clone of \" + (this.name || this.id), T || this.parent, !0);\n            g && E && E(this, g);\n            for (var l = 0, h = this.getChildTransformNodes(!0); l < h.length; l++)\n              h[l].instantiateHierarchy(g, S, E);\n            return g;\n          }, c.prototype.freezeWorldMatrix = function(T) {\n            return T === void 0 && (T = null), T ? this._worldMatrix = T : (this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0)), this._isDirty = !1, this._isWorldMatrixFrozen = !0, this;\n          }, c.prototype.unfreezeWorldMatrix = function() {\n            return this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0), this;\n          }, Object.defineProperty(c.prototype, \"isWorldMatrixFrozen\", { get: function() {\n            return this._isWorldMatrixFrozen;\n          }, enumerable: !1, configurable: !0 }), c.prototype.getAbsolutePosition = function() {\n            return this.computeWorldMatrix(), this._absolutePosition;\n          }, c.prototype.setAbsolutePosition = function(T) {\n            if (!T)\n              return this;\n            var S, E, g;\n            if (T.x === void 0) {\n              if (arguments.length < 3)\n                return this;\n              S = arguments[0], E = arguments[1], g = arguments[2];\n            } else\n              S = T.x, E = T.y, g = T.z;\n            if (this.parent) {\n              var l = u.c.Matrix[0];\n              this.parent.getWorldMatrix().invertToRef(l), u.e.TransformCoordinatesFromFloatsToRef(S, E, g, l, this.position);\n            } else\n              this.position.x = S, this.position.y = E, this.position.z = g;\n            return this._absolutePosition.copyFrom(T), this;\n          }, c.prototype.setPositionWithLocalVector = function(T) {\n            return this.computeWorldMatrix(), this.position = u.e.TransformNormal(T, this._localMatrix), this;\n          }, c.prototype.getPositionExpressedInLocalSpace = function() {\n            this.computeWorldMatrix();\n            var T = u.c.Matrix[0];\n            return this._localMatrix.invertToRef(T), u.e.TransformNormal(this.position, T);\n          }, c.prototype.locallyTranslate = function(T) {\n            return this.computeWorldMatrix(!0), this.position = u.e.TransformCoordinates(T, this._localMatrix), this;\n          }, c.prototype.lookAt = function(T, S, E, g, l) {\n            S === void 0 && (S = 0), E === void 0 && (E = 0), g === void 0 && (g = 0), l === void 0 && (l = O.c.LOCAL);\n            var h = c._lookAtVectorCache, v = l === O.c.LOCAL ? this.position : this.getAbsolutePosition();\n            if (T.subtractToRef(v, h), this.setDirection(h, S, E, g), l === O.c.WORLD && this.parent)\n              if (this.rotationQuaternion) {\n                var b = u.c.Matrix[0];\n                this.rotationQuaternion.toRotationMatrix(b);\n                var D = u.c.Matrix[1];\n                this.parent.getWorldMatrix().getRotationMatrixToRef(D), D.invert(), b.multiplyToRef(D, b), this.rotationQuaternion.fromRotationMatrix(b);\n              } else {\n                var w = u.c.Quaternion[0];\n                u.b.FromEulerVectorToRef(this.rotation, w), b = u.c.Matrix[0], w.toRotationMatrix(b), D = u.c.Matrix[1], this.parent.getWorldMatrix().getRotationMatrixToRef(D), D.invert(), b.multiplyToRef(D, b), w.fromRotationMatrix(b), w.toEulerAnglesToRef(this.rotation);\n              }\n            return this;\n          }, c.prototype.getDirection = function(T) {\n            var S = u.e.Zero();\n            return this.getDirectionToRef(T, S), S;\n          }, c.prototype.getDirectionToRef = function(T, S) {\n            return u.e.TransformNormalToRef(T, this.getWorldMatrix(), S), this;\n          }, c.prototype.setDirection = function(T, S, E, g) {\n            S === void 0 && (S = 0), E === void 0 && (E = 0), g === void 0 && (g = 0);\n            var l = -Math.atan2(T.z, T.x) + Math.PI / 2, h = Math.sqrt(T.x * T.x + T.z * T.z), v = -Math.atan2(T.y, h);\n            return this.rotationQuaternion ? u.b.RotationYawPitchRollToRef(l + S, v + E, g, this.rotationQuaternion) : (this.rotation.x = v + E, this.rotation.y = l + S, this.rotation.z = g), this;\n          }, c.prototype.setPivotPoint = function(T, S) {\n            S === void 0 && (S = O.c.LOCAL), this.getScene().getRenderId() == 0 && this.computeWorldMatrix(!0);\n            var E = this.getWorldMatrix();\n            if (S == O.c.WORLD) {\n              var g = u.c.Matrix[0];\n              E.invertToRef(g), T = u.e.TransformCoordinates(T, g);\n            }\n            return this.setPivotMatrix(u.a.Translation(-T.x, -T.y, -T.z), !0);\n          }, c.prototype.getPivotPoint = function() {\n            var T = u.e.Zero();\n            return this.getPivotPointToRef(T), T;\n          }, c.prototype.getPivotPointToRef = function(T) {\n            return T.x = -this._pivotMatrix.m[12], T.y = -this._pivotMatrix.m[13], T.z = -this._pivotMatrix.m[14], this;\n          }, c.prototype.getAbsolutePivotPoint = function() {\n            var T = u.e.Zero();\n            return this.getAbsolutePivotPointToRef(T), T;\n          }, c.prototype.getAbsolutePivotPointToRef = function(T) {\n            return this.getPivotPointToRef(T), u.e.TransformCoordinatesToRef(T, this.getWorldMatrix(), T), this;\n          }, c.prototype.setParent = function(T) {\n            if (!T && !this.parent)\n              return this;\n            var S = u.c.Quaternion[0], E = u.c.Vector3[0], g = u.c.Vector3[1];\n            if (T) {\n              var l = u.c.Matrix[0], h = u.c.Matrix[1];\n              this.computeWorldMatrix(!0), T.computeWorldMatrix(!0), T.getWorldMatrix().invertToRef(h), this.getWorldMatrix().multiplyToRef(h, l), l.decompose(g, S, E);\n            } else\n              this.computeWorldMatrix(!0), this.getWorldMatrix().decompose(g, S, E);\n            return this.rotationQuaternion ? this.rotationQuaternion.copyFrom(S) : S.toEulerAnglesToRef(this.rotation), this.scaling.copyFrom(g), this.position.copyFrom(E), this.parent = T, this;\n          }, Object.defineProperty(c.prototype, \"nonUniformScaling\", { get: function() {\n            return this._nonUniformScaling;\n          }, enumerable: !1, configurable: !0 }), c.prototype._updateNonUniformScalingState = function(T) {\n            return this._nonUniformScaling !== T && (this._nonUniformScaling = T, !0);\n          }, c.prototype.attachToBone = function(T, S) {\n            return this._transformToBoneReferal = S, this.parent = T, T.getSkeleton().prepare(), T.getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this;\n          }, c.prototype.detachFromBone = function() {\n            return this.parent ? (this.parent.getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this._transformToBoneReferal = null, this.parent = null, this) : this;\n          }, c.prototype.rotate = function(T, S, E) {\n            var g;\n            if (T.normalize(), this.rotationQuaternion || (this.rotationQuaternion = this.rotation.toQuaternion(), this.rotation.setAll(0)), E && E !== O.c.LOCAL) {\n              if (this.parent) {\n                var l = u.c.Matrix[0];\n                this.parent.getWorldMatrix().invertToRef(l), T = u.e.TransformNormal(T, l);\n              }\n              (g = u.b.RotationAxisToRef(T, S, c._rotationAxisCache)).multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);\n            } else\n              g = u.b.RotationAxisToRef(T, S, c._rotationAxisCache), this.rotationQuaternion.multiplyToRef(g, this.rotationQuaternion);\n            return this;\n          }, c.prototype.rotateAround = function(T, S, E) {\n            S.normalize(), this.rotationQuaternion || (this.rotationQuaternion = u.b.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z), this.rotation.setAll(0));\n            var g = u.c.Vector3[0], l = u.c.Vector3[1], h = u.c.Vector3[2], v = u.c.Quaternion[0], b = u.c.Matrix[0], D = u.c.Matrix[1], w = u.c.Matrix[2], N = u.c.Matrix[3];\n            return T.subtractToRef(this.position, g), u.a.TranslationToRef(g.x, g.y, g.z, b), u.a.TranslationToRef(-g.x, -g.y, -g.z, D), u.a.RotationAxisToRef(S, E, w), D.multiplyToRef(w, N), N.multiplyToRef(b, N), N.decompose(l, v, h), this.position.addInPlace(h), v.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion), this;\n          }, c.prototype.translate = function(T, S, E) {\n            var g = T.scale(S);\n            if (E && E !== O.c.LOCAL)\n              this.setAbsolutePosition(this.getAbsolutePosition().add(g));\n            else {\n              var l = this.getPositionExpressedInLocalSpace().add(g);\n              this.setPositionWithLocalVector(l);\n            }\n            return this;\n          }, c.prototype.addRotation = function(T, S, E) {\n            var g;\n            this.rotationQuaternion ? g = this.rotationQuaternion : (g = u.c.Quaternion[1], u.b.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, g));\n            var l = u.c.Quaternion[0];\n            return u.b.RotationYawPitchRollToRef(S, T, E, l), g.multiplyInPlace(l), this.rotationQuaternion || g.toEulerAnglesToRef(this.rotation), this;\n          }, c.prototype._getEffectiveParent = function() {\n            return this.parent;\n          }, c.prototype.computeWorldMatrix = function(T) {\n            if (this._isWorldMatrixFrozen && !this._isDirty)\n              return this._worldMatrix;\n            var S = this.getScene().getRenderId();\n            if (!this._isDirty && !T && this.isSynchronized())\n              return this._currentRenderId = S, this._worldMatrix;\n            var E = this.getScene().activeCamera, g = (this._billboardMode & c.BILLBOARDMODE_USE_POSITION) != 0, l = this._billboardMode !== c.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;\n            l && E && g && (this.lookAt(E.position), (this.billboardMode & c.BILLBOARDMODE_X) !== c.BILLBOARDMODE_X && (this.rotation.x = 0), (this.billboardMode & c.BILLBOARDMODE_Y) !== c.BILLBOARDMODE_Y && (this.rotation.y = 0), (this.billboardMode & c.BILLBOARDMODE_Z) !== c.BILLBOARDMODE_Z && (this.rotation.z = 0)), this._updateCache();\n            var h = this._cache;\n            h.pivotMatrixUpdated = !1, h.billboardMode = this.billboardMode, h.infiniteDistance = this.infiniteDistance, this._currentRenderId = S, this._childUpdateId++, this._isDirty = !1, this._position._isDirty = !1, this._rotation._isDirty = !1, this._scaling._isDirty = !1;\n            var v, b = this._getEffectiveParent(), D = c._TmpScaling, w = this._position;\n            if (this._infiniteDistance && !this.parent && E) {\n              var N = E.getWorldMatrix(), M = new u.e(N.m[12], N.m[13], N.m[14]);\n              (w = c._TmpTranslation).copyFromFloats(this._position.x + M.x, this._position.y + M.y, this._position.z + M.z);\n            }\n            if (D.copyFromFloats(this._scaling.x * this.scalingDeterminant, this._scaling.y * this.scalingDeterminant, this._scaling.z * this.scalingDeterminant), this._rotationQuaternion ? (this._rotationQuaternion._isDirty = !1, v = this._rotationQuaternion, this.reIntegrateRotationIntoRotationQuaternion && this.rotation.lengthSquared() && (this._rotationQuaternion.multiplyInPlace(u.b.RotationYawPitchRoll(this._rotation.y, this._rotation.x, this._rotation.z)), this._rotation.copyFromFloats(0, 0, 0))) : (v = c._TmpRotation, u.b.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, v)), this._usePivotMatrix) {\n              var U = u.c.Matrix[1];\n              u.a.ScalingToRef(D.x, D.y, D.z, U);\n              var X = u.c.Matrix[0];\n              v.toRotationMatrix(X), this._pivotMatrix.multiplyToRef(U, u.c.Matrix[4]), u.c.Matrix[4].multiplyToRef(X, this._localMatrix), this._postMultiplyPivotMatrix && this._localMatrix.multiplyToRef(this._pivotMatrixInverse, this._localMatrix), this._localMatrix.addTranslationFromFloats(w.x, w.y, w.z);\n            } else\n              u.a.ComposeToRef(D, v, w, this._localMatrix);\n            if (b && b.getWorldMatrix) {\n              if (T && b.computeWorldMatrix(), l) {\n                this._transformToBoneReferal ? b.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), u.c.Matrix[7]) : u.c.Matrix[7].copyFrom(b.getWorldMatrix());\n                var j = u.c.Vector3[5], ne = u.c.Vector3[6];\n                u.c.Matrix[7].decompose(ne, void 0, j), u.a.ScalingToRef(ne.x, ne.y, ne.z, u.c.Matrix[7]), u.c.Matrix[7].setTranslation(j), this._localMatrix.multiplyToRef(u.c.Matrix[7], this._worldMatrix);\n              } else\n                this._transformToBoneReferal ? (this._localMatrix.multiplyToRef(b.getWorldMatrix(), u.c.Matrix[6]), u.c.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix)) : this._localMatrix.multiplyToRef(b.getWorldMatrix(), this._worldMatrix);\n              this._markSyncedWithParent();\n            } else\n              this._worldMatrix.copyFrom(this._localMatrix);\n            if (l && E && this.billboardMode && !g) {\n              var te = u.c.Vector3[0];\n              if (this._worldMatrix.getTranslationToRef(te), u.c.Matrix[1].copyFrom(E.getViewMatrix()), u.c.Matrix[1].setTranslationFromFloats(0, 0, 0), u.c.Matrix[1].invertToRef(u.c.Matrix[0]), (this.billboardMode & c.BILLBOARDMODE_ALL) !== c.BILLBOARDMODE_ALL) {\n                u.c.Matrix[0].decompose(void 0, u.c.Quaternion[0], void 0);\n                var de = u.c.Vector3[1];\n                u.c.Quaternion[0].toEulerAnglesToRef(de), (this.billboardMode & c.BILLBOARDMODE_X) !== c.BILLBOARDMODE_X && (de.x = 0), (this.billboardMode & c.BILLBOARDMODE_Y) !== c.BILLBOARDMODE_Y && (de.y = 0), (this.billboardMode & c.BILLBOARDMODE_Z) !== c.BILLBOARDMODE_Z && (de.z = 0), u.a.RotationYawPitchRollToRef(de.y, de.x, de.z, u.c.Matrix[0]);\n              }\n              this._worldMatrix.setTranslationFromFloats(0, 0, 0), this._worldMatrix.multiplyToRef(u.c.Matrix[0], this._worldMatrix), this._worldMatrix.setTranslation(u.c.Vector3[0]);\n            }\n            return this.ignoreNonUniformScaling ? this._updateNonUniformScalingState(!1) : this._scaling.isNonUniformWithinEpsilon(1e-6) ? this._updateNonUniformScalingState(!0) : b && b._nonUniformScaling ? this._updateNonUniformScalingState(b._nonUniformScaling) : this._updateNonUniformScalingState(!1), this._afterComputeWorldMatrix(), this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this._isAbsoluteSynced = !1, this.onAfterWorldMatrixUpdateObservable.notifyObservers(this), this._poseMatrix || (this._poseMatrix = u.a.Invert(this._worldMatrix)), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix;\n          }, c.prototype.resetLocalMatrix = function(T) {\n            if (T === void 0 && (T = !0), this.computeWorldMatrix(), T)\n              for (var S = this.getChildren(), E = 0; E < S.length; ++E) {\n                var g = S[E];\n                if (g) {\n                  g.computeWorldMatrix();\n                  var l = u.c.Matrix[0];\n                  g._localMatrix.multiplyToRef(this._localMatrix, l);\n                  var h = u.c.Quaternion[0];\n                  l.decompose(g.scaling, h, g.position), g.rotationQuaternion ? g.rotationQuaternion = h : h.toEulerAnglesToRef(g.rotation);\n                }\n              }\n            this.scaling.copyFromFloats(1, 1, 1), this.position.copyFromFloats(0, 0, 0), this.rotation.copyFromFloats(0, 0, 0), this.rotationQuaternion && (this.rotationQuaternion = u.b.Identity()), this._worldMatrix = u.a.Identity();\n          }, c.prototype._afterComputeWorldMatrix = function() {\n          }, c.prototype.registerAfterWorldMatrixUpdate = function(T) {\n            return this.onAfterWorldMatrixUpdateObservable.add(T), this;\n          }, c.prototype.unregisterAfterWorldMatrixUpdate = function(T) {\n            return this.onAfterWorldMatrixUpdateObservable.removeCallback(T), this;\n          }, c.prototype.getPositionInCameraSpace = function(T) {\n            return T === void 0 && (T = null), T || (T = this.getScene().activeCamera), u.e.TransformCoordinates(this.getAbsolutePosition(), T.getViewMatrix());\n          }, c.prototype.getDistanceToCamera = function(T) {\n            return T === void 0 && (T = null), T || (T = this.getScene().activeCamera), this.getAbsolutePosition().subtract(T.globalPosition).length();\n          }, c.prototype.clone = function(T, S, E) {\n            var g = this, l = _.a.Clone(function() {\n              return new c(T, g.getScene());\n            }, this);\n            if (l.name = T, l.id = T, S && (l.parent = S), !E)\n              for (var h = this.getDescendants(!0), v = 0; v < h.length; v++) {\n                var b = h[v];\n                b.clone && b.clone(T + \".\" + b.name, l);\n              }\n            return l;\n          }, c.prototype.serialize = function(T) {\n            var S = _.a.Serialize(this, T);\n            return S.type = this.getClassName(), this.parent && (S.parentId = this.parent.id), S.localMatrix = this.getPivotMatrix().asArray(), S.isEnabled = this.isEnabled(), this.parent && (S.parentId = this.parent.id), S;\n          }, c.Parse = function(T, S, E) {\n            var g = _.a.Parse(function() {\n              return new c(T.name, S);\n            }, T, S, E);\n            return T.localMatrix ? g.setPreTransformMatrix(u.a.FromArray(T.localMatrix)) : T.pivotMatrix && g.setPivotMatrix(u.a.FromArray(T.pivotMatrix)), g.setEnabled(T.isEnabled), T.parentId && (g._waitingParentId = T.parentId), g;\n          }, c.prototype.getChildTransformNodes = function(T, S) {\n            var E = [];\n            return this._getDescendants(E, T, function(g) {\n              return (!S || S(g)) && g instanceof c;\n            }), E;\n          }, c.prototype.dispose = function(T, S) {\n            if (S === void 0 && (S = !1), this.getScene().stopAnimation(this), this.getScene().removeTransformNode(this), this.onAfterWorldMatrixUpdateObservable.clear(), T)\n              for (var E = 0, g = this.getChildTransformNodes(!0); E < g.length; E++) {\n                var l = g[E];\n                l.parent = null, l.computeWorldMatrix(!0);\n              }\n            m.prototype.dispose.call(this, T, S);\n          }, c.prototype.normalizeToUnitCube = function(T, S, E) {\n            T === void 0 && (T = !0), S === void 0 && (S = !1);\n            var g = null, l = null;\n            S && (this.rotationQuaternion ? (l = this.rotationQuaternion.clone(), this.rotationQuaternion.copyFromFloats(0, 0, 0, 1)) : this.rotation && (g = this.rotation.clone(), this.rotation.copyFromFloats(0, 0, 0)));\n            var h = this.getHierarchyBoundingVectors(T, E), v = h.max.subtract(h.min), b = Math.max(v.x, v.y, v.z);\n            if (b === 0)\n              return this;\n            var D = 1 / b;\n            return this.scaling.scaleInPlace(D), S && (this.rotationQuaternion && l ? this.rotationQuaternion.copyFrom(l) : this.rotation && g && this.rotation.copyFrom(g)), this;\n          }, c.prototype._syncAbsoluteScalingAndRotation = function() {\n            this._isAbsoluteSynced || (this._worldMatrix.decompose(this._absoluteScaling, this._absoluteRotationQuaternion), this._isAbsoluteSynced = !0);\n          }, c.BILLBOARDMODE_NONE = 0, c.BILLBOARDMODE_X = 1, c.BILLBOARDMODE_Y = 2, c.BILLBOARDMODE_Z = 4, c.BILLBOARDMODE_ALL = 7, c.BILLBOARDMODE_USE_POSITION = 128, c._TmpRotation = u.b.Zero(), c._TmpScaling = u.e.Zero(), c._TmpTranslation = u.e.Zero(), c._lookAtVectorCache = new u.e(0, 0, 0), c._rotationAxisCache = new u.b(), Object(V.c)([Object(_.o)(\"position\")], c.prototype, \"_position\", void 0), Object(V.c)([Object(_.o)(\"rotation\")], c.prototype, \"_rotation\", void 0), Object(V.c)([Object(_.l)(\"rotationQuaternion\")], c.prototype, \"_rotationQuaternion\", void 0), Object(V.c)([Object(_.o)(\"scaling\")], c.prototype, \"_scaling\", void 0), Object(V.c)([Object(_.c)(\"billboardMode\")], c.prototype, \"_billboardMode\", void 0), Object(V.c)([Object(_.c)()], c.prototype, \"scalingDeterminant\", void 0), Object(V.c)([Object(_.c)(\"infiniteDistance\")], c.prototype, \"_infiniteDistance\", void 0), Object(V.c)([Object(_.c)()], c.prototype, \"ignoreNonUniformScaling\", void 0), Object(V.c)([Object(_.c)()], c.prototype, \"reIntegrateRotationIntoRotationQuaternion\", void 0), c;\n        }(I.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _(C, u, I, O, x, m) {\n            this.source = C, this.pointerX = u, this.pointerY = I, this.meshUnderPointer = O, this.sourceEvent = x, this.additionalData = m;\n          }\n          return _.CreateNew = function(C, u, I) {\n            var O = C.getScene();\n            return new _(C, O.pointerX, O.pointerY, O.meshUnderPointer || C, u, I);\n          }, _.CreateNewFromSprite = function(C, u, I, O) {\n            return new _(C, u.pointerX, u.pointerY, u.meshUnderPointer, I, O);\n          }, _.CreateNewFromScene = function(C, u) {\n            return new _(null, C.pointerX, C.pointerY, C.meshUnderPointer, u);\n          }, _.CreateNewFromPrimitive = function(C, u, I, O) {\n            return new _(C, u.x, u.y, null, I, O);\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(1), _ = f(3), C = f(0), u = f(9), I = f(29), O = f(85), x = f(11), m = function(c) {\n          function T(S, E) {\n            var g = c.call(this, S, E) || this;\n            return g.diffuse = new u.a(1, 1, 1), g.specular = new u.a(1, 1, 1), g.falloffType = T.FALLOFF_DEFAULT, g.intensity = 1, g._range = Number.MAX_VALUE, g._inverseSquaredRange = 0, g._photometricScale = 1, g._intensityMode = T.INTENSITYMODE_AUTOMATIC, g._radius = 1e-5, g.renderPriority = 0, g._shadowEnabled = !0, g._excludeWithLayerMask = 0, g._includeOnlyWithLayerMask = 0, g._lightmapMode = 0, g._excludedMeshesIds = new Array(), g._includedOnlyMeshesIds = new Array(), g._isLight = !0, g.getScene().addLight(g), g._uniformBuffer = new O.a(g.getScene().getEngine()), g._buildUniformLayout(), g.includedOnlyMeshes = new Array(), g.excludedMeshes = new Array(), g._resyncMeshes(), g;\n          }\n          return Object(V.d)(T, c), Object.defineProperty(T.prototype, \"range\", { get: function() {\n            return this._range;\n          }, set: function(S) {\n            this._range = S, this._inverseSquaredRange = 1 / (this.range * this.range);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"intensityMode\", { get: function() {\n            return this._intensityMode;\n          }, set: function(S) {\n            this._intensityMode = S, this._computePhotometricScale();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"radius\", { get: function() {\n            return this._radius;\n          }, set: function(S) {\n            this._radius = S, this._computePhotometricScale();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"shadowEnabled\", { get: function() {\n            return this._shadowEnabled;\n          }, set: function(S) {\n            this._shadowEnabled !== S && (this._shadowEnabled = S, this._markMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"includedOnlyMeshes\", { get: function() {\n            return this._includedOnlyMeshes;\n          }, set: function(S) {\n            this._includedOnlyMeshes = S, this._hookArrayForIncludedOnly(S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"excludedMeshes\", { get: function() {\n            return this._excludedMeshes;\n          }, set: function(S) {\n            this._excludedMeshes = S, this._hookArrayForExcluded(S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"excludeWithLayerMask\", { get: function() {\n            return this._excludeWithLayerMask;\n          }, set: function(S) {\n            this._excludeWithLayerMask = S, this._resyncMeshes();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"includeOnlyWithLayerMask\", { get: function() {\n            return this._includeOnlyWithLayerMask;\n          }, set: function(S) {\n            this._includeOnlyWithLayerMask = S, this._resyncMeshes();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"lightmapMode\", { get: function() {\n            return this._lightmapMode;\n          }, set: function(S) {\n            this._lightmapMode !== S && (this._lightmapMode = S, this._markMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), T.prototype.transferTexturesToEffect = function(S, E) {\n            return this;\n          }, T.prototype._bindLight = function(S, E, g, l, h) {\n            h === void 0 && (h = !1);\n            var v = S.toString(), b = !1;\n            if (!h || !this._uniformBuffer._alreadyBound) {\n              if (this._uniformBuffer.bindToEffect(g, \"Light\" + v), this._renderId !== E.getRenderId() || !this._uniformBuffer.useUbo) {\n                this._renderId = E.getRenderId();\n                var D = this.getScaledIntensity();\n                this.transferToEffect(g, v), this.diffuse.scaleToRef(D, u.c.Color3[0]), this._uniformBuffer.updateColor4(\"vLightDiffuse\", u.c.Color3[0], this.range, v), l && (this.specular.scaleToRef(D, u.c.Color3[1]), this._uniformBuffer.updateColor4(\"vLightSpecular\", u.c.Color3[1], this.radius, v)), b = !0;\n              }\n              if (this.transferTexturesToEffect(g, v), E.shadowsEnabled && this.shadowEnabled) {\n                var w = this.getShadowGenerator();\n                w && (w.bindShadowLight(v, g), b = !0);\n              }\n              b && this._uniformBuffer.update();\n            }\n          }, T.prototype.getClassName = function() {\n            return \"Light\";\n          }, T.prototype.toString = function(S) {\n            var E = \"Name: \" + this.name;\n            if (E += \", type: \" + [\"Point\", \"Directional\", \"Spot\", \"Hemispheric\"][this.getTypeID()], this.animations)\n              for (var g = 0; g < this.animations.length; g++)\n                E += \", animation[0]: \" + this.animations[g].toString(S);\n            return E;\n          }, T.prototype._syncParentEnabledState = function() {\n            c.prototype._syncParentEnabledState.call(this), this.isDisposed() || this._resyncMeshes();\n          }, T.prototype.setEnabled = function(S) {\n            c.prototype.setEnabled.call(this, S), this._resyncMeshes();\n          }, T.prototype.getShadowGenerator = function() {\n            return this._shadowGenerator;\n          }, T.prototype.getAbsolutePosition = function() {\n            return C.e.Zero();\n          }, T.prototype.canAffectMesh = function(S) {\n            return !S || !(this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(S) === -1) && !(this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(S) !== -1) && (this.includeOnlyWithLayerMask === 0 || (this.includeOnlyWithLayerMask & S.layerMask) != 0) && !(this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask & S.layerMask);\n          }, T.CompareLightsPriority = function(S, E) {\n            return S.shadowEnabled !== E.shadowEnabled ? (E.shadowEnabled ? 1 : 0) - (S.shadowEnabled ? 1 : 0) : E.renderPriority - S.renderPriority;\n          }, T.prototype.dispose = function(S, E) {\n            E === void 0 && (E = !1), this._shadowGenerator && (this._shadowGenerator.dispose(), this._shadowGenerator = null), this.getScene().stopAnimation(this);\n            for (var g = 0, l = this.getScene().meshes; g < l.length; g++)\n              l[g]._removeLightSource(this, !0);\n            this._uniformBuffer.dispose(), this.getScene().removeLight(this), c.prototype.dispose.call(this, S, E);\n          }, T.prototype.getTypeID = function() {\n            return 0;\n          }, T.prototype.getScaledIntensity = function() {\n            return this._photometricScale * this.intensity;\n          }, T.prototype.clone = function(S, E) {\n            E === void 0 && (E = null);\n            var g = T.GetConstructorFromName(this.getTypeID(), S, this.getScene());\n            if (!g)\n              return null;\n            var l = _.a.Clone(g, this);\n            return E && (l.parent = E), l.setEnabled(this.isEnabled()), l;\n          }, T.prototype.serialize = function() {\n            var S = _.a.Serialize(this);\n            return S.type = this.getTypeID(), this.parent && (S.parentId = this.parent.id), this.excludedMeshes.length > 0 && (S.excludedMeshesIds = [], this.excludedMeshes.forEach(function(E) {\n              S.excludedMeshesIds.push(E.id);\n            })), this.includedOnlyMeshes.length > 0 && (S.includedOnlyMeshesIds = [], this.includedOnlyMeshes.forEach(function(E) {\n              S.includedOnlyMeshesIds.push(E.id);\n            })), _.a.AppendSerializedAnimations(this, S), S.ranges = this.serializeAnimationRanges(), S;\n          }, T.GetConstructorFromName = function(S, E, g) {\n            var l = I.a.Construct(\"Light_Type_\" + S, E, g);\n            return l || null;\n          }, T.Parse = function(S, E) {\n            var g = T.GetConstructorFromName(S.type, S.name, E);\n            if (!g)\n              return null;\n            var l = _.a.Parse(g, S, E);\n            if (S.excludedMeshesIds && (l._excludedMeshesIds = S.excludedMeshesIds), S.includedOnlyMeshesIds && (l._includedOnlyMeshesIds = S.includedOnlyMeshesIds), S.parentId && (l._waitingParentId = S.parentId), S.falloffType !== void 0 && (l.falloffType = S.falloffType), S.lightmapMode !== void 0 && (l.lightmapMode = S.lightmapMode), S.animations) {\n              for (var h = 0; h < S.animations.length; h++) {\n                var v = S.animations[h], b = x.a.GetClass(\"BABYLON.Animation\");\n                b && l.animations.push(b.Parse(v));\n              }\n              I.a.ParseAnimationRanges(l, S, E);\n            }\n            return S.autoAnimate && E.beginAnimation(l, S.autoAnimateFrom, S.autoAnimateTo, S.autoAnimateLoop, S.autoAnimateSpeed || 1), l;\n          }, T.prototype._hookArrayForExcluded = function(S) {\n            var E = this, g = S.push;\n            S.push = function() {\n              for (var b = [], D = 0; D < arguments.length; D++)\n                b[D] = arguments[D];\n              for (var w = g.apply(S, b), N = 0, M = b; N < M.length; N++) {\n                var U = M[N];\n                U._resyncLightSource(E);\n              }\n              return w;\n            };\n            var l = S.splice;\n            S.splice = function(b, D) {\n              for (var w = l.apply(S, [b, D]), N = 0, M = w; N < M.length; N++)\n                M[N]._resyncLightSource(E);\n              return w;\n            };\n            for (var h = 0, v = S; h < v.length; h++)\n              v[h]._resyncLightSource(this);\n          }, T.prototype._hookArrayForIncludedOnly = function(S) {\n            var E = this, g = S.push;\n            S.push = function() {\n              for (var h = [], v = 0; v < arguments.length; v++)\n                h[v] = arguments[v];\n              var b = g.apply(S, h);\n              return E._resyncMeshes(), b;\n            };\n            var l = S.splice;\n            S.splice = function(h, v) {\n              var b = l.apply(S, [h, v]);\n              return E._resyncMeshes(), b;\n            }, this._resyncMeshes();\n          }, T.prototype._resyncMeshes = function() {\n            for (var S = 0, E = this.getScene().meshes; S < E.length; S++)\n              E[S]._resyncLightSource(this);\n          }, T.prototype._markMeshesAsLightDirty = function() {\n            for (var S = 0, E = this.getScene().meshes; S < E.length; S++) {\n              var g = E[S];\n              g.lightSources.indexOf(this) !== -1 && g._markSubMeshesAsLightDirty();\n            }\n          }, T.prototype._computePhotometricScale = function() {\n            this._photometricScale = this._getPhotometricScale(), this.getScene().resetCachedMaterial();\n          }, T.prototype._getPhotometricScale = function() {\n            var S = 0, E = this.getTypeID(), g = this.intensityMode;\n            switch (g === T.INTENSITYMODE_AUTOMATIC && (g = E === T.LIGHTTYPEID_DIRECTIONALLIGHT ? T.INTENSITYMODE_ILLUMINANCE : T.INTENSITYMODE_LUMINOUSINTENSITY), E) {\n              case T.LIGHTTYPEID_POINTLIGHT:\n              case T.LIGHTTYPEID_SPOTLIGHT:\n                switch (g) {\n                  case T.INTENSITYMODE_LUMINOUSPOWER:\n                    S = 1 / (4 * Math.PI);\n                    break;\n                  case T.INTENSITYMODE_LUMINOUSINTENSITY:\n                    S = 1;\n                    break;\n                  case T.INTENSITYMODE_LUMINANCE:\n                    S = this.radius * this.radius;\n                }\n                break;\n              case T.LIGHTTYPEID_DIRECTIONALLIGHT:\n                switch (g) {\n                  case T.INTENSITYMODE_ILLUMINANCE:\n                    S = 1;\n                    break;\n                  case T.INTENSITYMODE_LUMINANCE:\n                    var l = this.radius;\n                    l = Math.max(l, 1e-3), S = 2 * Math.PI * (1 - Math.cos(l));\n                }\n                break;\n              case T.LIGHTTYPEID_HEMISPHERICLIGHT:\n                S = 1;\n            }\n            return S;\n          }, T.prototype._reorderLightsInScene = function() {\n            var S = this.getScene();\n            this._renderPriority != 0 && (S.requireLightSorting = !0), this.getScene().sortLightsByPriority();\n          }, T.FALLOFF_DEFAULT = 0, T.FALLOFF_PHYSICAL = 1, T.FALLOFF_GLTF = 2, T.FALLOFF_STANDARD = 3, T.LIGHTMAP_DEFAULT = 0, T.LIGHTMAP_SPECULAR = 1, T.LIGHTMAP_SHADOWSONLY = 2, T.INTENSITYMODE_AUTOMATIC = 0, T.INTENSITYMODE_LUMINOUSPOWER = 1, T.INTENSITYMODE_LUMINOUSINTENSITY = 2, T.INTENSITYMODE_ILLUMINANCE = 3, T.INTENSITYMODE_LUMINANCE = 4, T.LIGHTTYPEID_POINTLIGHT = 0, T.LIGHTTYPEID_DIRECTIONALLIGHT = 1, T.LIGHTTYPEID_SPOTLIGHT = 2, T.LIGHTTYPEID_HEMISPHERICLIGHT = 3, Object(V.c)([Object(_.e)()], T.prototype, \"diffuse\", void 0), Object(V.c)([Object(_.e)()], T.prototype, \"specular\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"falloffType\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"intensity\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"range\", null), Object(V.c)([Object(_.c)()], T.prototype, \"intensityMode\", null), Object(V.c)([Object(_.c)()], T.prototype, \"radius\", null), Object(V.c)([Object(_.c)()], T.prototype, \"_renderPriority\", void 0), Object(V.c)([Object(_.b)(\"_reorderLightsInScene\")], T.prototype, \"renderPriority\", void 0), Object(V.c)([Object(_.c)(\"shadowEnabled\")], T.prototype, \"_shadowEnabled\", void 0), Object(V.c)([Object(_.c)(\"excludeWithLayerMask\")], T.prototype, \"_excludeWithLayerMask\", void 0), Object(V.c)([Object(_.c)(\"includeOnlyWithLayerMask\")], T.prototype, \"_includeOnlyWithLayerMask\", void 0), Object(V.c)([Object(_.c)(\"lightmapMode\")], T.prototype, \"_lightmapMode\", void 0), T;\n        }(I.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._xhr = typeof _native < \"u\" && _native.XMLHttpRequest ? new _native.XMLHttpRequest() : new XMLHttpRequest();\n          }\n          return _.prototype._injectCustomRequestHeaders = function() {\n            for (var C in _.CustomRequestHeaders) {\n              var u = _.CustomRequestHeaders[C];\n              u && this._xhr.setRequestHeader(C, u);\n            }\n          }, Object.defineProperty(_.prototype, \"onprogress\", { get: function() {\n            return this._xhr.onprogress;\n          }, set: function(C) {\n            this._xhr.onprogress = C;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"readyState\", { get: function() {\n            return this._xhr.readyState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"status\", { get: function() {\n            return this._xhr.status;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"statusText\", { get: function() {\n            return this._xhr.statusText;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"response\", { get: function() {\n            return this._xhr.response;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"responseURL\", { get: function() {\n            return this._xhr.responseURL;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"responseText\", { get: function() {\n            return this._xhr.responseText;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"responseType\", { get: function() {\n            return this._xhr.responseType;\n          }, set: function(C) {\n            this._xhr.responseType = C;\n          }, enumerable: !1, configurable: !0 }), _.prototype.addEventListener = function(C, u, I) {\n            this._xhr.addEventListener(C, u, I);\n          }, _.prototype.removeEventListener = function(C, u, I) {\n            this._xhr.removeEventListener(C, u, I);\n          }, _.prototype.abort = function() {\n            this._xhr.abort();\n          }, _.prototype.send = function(C) {\n            _.CustomRequestHeaders && this._injectCustomRequestHeaders(), this._xhr.send(C);\n          }, _.prototype.open = function(C, u) {\n            for (var I = 0, O = _.CustomRequestModifiers; I < O.length; I++)\n              (0, O[I])(this._xhr, u);\n            return u = (u = u.replace(\"file:http:\", \"http:\")).replace(\"file:https:\", \"https:\"), this._xhr.open(C, u, !0);\n          }, _.prototype.setRequestHeader = function(C, u) {\n            this._xhr.setRequestHeader(C, u);\n          }, _.prototype.getResponseHeader = function(C) {\n            return this._xhr.getResponseHeader(C);\n          }, _.CustomRequestHeaders = {}, _.CustomRequestModifiers = new Array(), _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"e\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        }), f.d(A, \"d\", function() {\n          return u;\n        }), f.d(A, \"c\", function() {\n          return I;\n        }), f.d(A, \"b\", function() {\n          return O;\n        });\n        var V = f(1), _ = function() {\n          function x(m, c) {\n            this.type = m, this.jointData = c, c.nativeParams = c.nativeParams || {};\n          }\n          return Object.defineProperty(x.prototype, \"physicsJoint\", { get: function() {\n            return this._physicsJoint;\n          }, set: function(m) {\n            this._physicsJoint, this._physicsJoint = m;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"physicsPlugin\", { set: function(m) {\n            this._physicsPlugin = m;\n          }, enumerable: !1, configurable: !0 }), x.prototype.executeNativeFunction = function(m) {\n            m(this._physicsPlugin.world, this._physicsJoint);\n          }, x.DistanceJoint = 0, x.HingeJoint = 1, x.BallAndSocketJoint = 2, x.WheelJoint = 3, x.SliderJoint = 4, x.PrismaticJoint = 5, x.UniversalJoint = 6, x.Hinge2Joint = x.WheelJoint, x.PointToPointJoint = 8, x.SpringJoint = 9, x.LockJoint = 10, x;\n        }(), C = function(x) {\n          function m(c) {\n            return x.call(this, _.DistanceJoint, c) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.updateDistance = function(c, T) {\n            this._physicsPlugin.updateDistanceJoint(this, c, T);\n          }, m;\n        }(_), u = function(x) {\n          function m(c, T) {\n            return x.call(this, c, T) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.setMotor = function(c, T) {\n            this._physicsPlugin.setMotor(this, c || 0, T);\n          }, m.prototype.setLimit = function(c, T) {\n            this._physicsPlugin.setLimit(this, c, T);\n          }, m;\n        }(_), I = function(x) {\n          function m(c) {\n            return x.call(this, _.HingeJoint, c) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.setMotor = function(c, T) {\n            this._physicsPlugin.setMotor(this, c || 0, T);\n          }, m.prototype.setLimit = function(c, T) {\n            this._physicsPlugin.setLimit(this, c, T);\n          }, m;\n        }(u), O = function(x) {\n          function m(c) {\n            return x.call(this, _.Hinge2Joint, c) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.setMotor = function(c, T, S) {\n            S === void 0 && (S = 0), this._physicsPlugin.setMotor(this, c || 0, T, S);\n          }, m.prototype.setLimit = function(c, T, S) {\n            S === void 0 && (S = 0), this._physicsPlugin.setLimit(this, c, T, S);\n          }, m;\n        }(u);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(0), _ = f(7), C = f(36), u = f(18), I = function() {\n          function O(x) {\n            var m = this;\n            x === void 0 && (x = C.a.DefaultUtilityLayer), this.gizmoLayer = x, this._attachedMesh = null, this._attachedNode = null, this._scaleRatio = 1, this._isHovered = !1, this._customMeshSet = !1, this._updateGizmoRotationToMatchAttachedMesh = !0, this.updateGizmoPositionToMatchAttachedMesh = !0, this.updateScale = !0, this._interactionsEnabled = !0, this._tempQuaternion = new V.b(0, 0, 0, 1), this._tempVector = new V.e(), this._tempVector2 = new V.e(), this._tempMatrix1 = new V.a(), this._tempMatrix2 = new V.a(), this._rightHandtoLeftHandMatrix = V.a.RotationY(Math.PI), this._rootMesh = new _.a(\"gizmoRootNode\", x.utilityLayerScene), this._rootMesh.rotationQuaternion = V.b.Identity(), this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function() {\n              m._update();\n            });\n          }\n          return Object.defineProperty(O.prototype, \"scaleRatio\", { get: function() {\n            return this._scaleRatio;\n          }, set: function(x) {\n            this._scaleRatio = x;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"isHovered\", { get: function() {\n            return this._isHovered;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"attachedMesh\", { get: function() {\n            return this._attachedMesh;\n          }, set: function(x) {\n            this._attachedMesh = x, x && (this._attachedNode = x), this._rootMesh.setEnabled(!!x), this._attachedNodeChanged(x);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"attachedNode\", { get: function() {\n            return this._attachedNode;\n          }, set: function(x) {\n            this._attachedNode = x, this._attachedMesh = null, this._rootMesh.setEnabled(!!x), this._attachedNodeChanged(x);\n          }, enumerable: !1, configurable: !0 }), O.prototype.setCustomMesh = function(x) {\n            if (x.getScene() != this.gizmoLayer.utilityLayerScene)\n              throw \"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)\";\n            this._rootMesh.getChildMeshes().forEach(function(m) {\n              m.dispose();\n            }), x.parent = this._rootMesh, this._customMeshSet = !0;\n          }, Object.defineProperty(O.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this._updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(x) {\n            this._updateGizmoRotationToMatchAttachedMesh = x;\n          }, enumerable: !1, configurable: !0 }), O.prototype._attachedNodeChanged = function(x) {\n          }, O.prototype._update = function() {\n            if (this.attachedNode) {\n              var x = this.attachedNode;\n              if (this.attachedMesh && (x = this.attachedMesh._effectiveMesh || this.attachedNode), this.updateGizmoPositionToMatchAttachedMesh) {\n                var m = x.getWorldMatrix().getRow(3), c = m ? m.toVector3() : new V.e(0, 0, 0);\n                this._rootMesh.position.copyFrom(c);\n              }\n              if (this.updateGizmoRotationToMatchAttachedMesh ? x.getWorldMatrix().decompose(void 0, this._rootMesh.rotationQuaternion) : this._rootMesh.rotationQuaternion.set(0, 0, 0, 1), this.updateScale) {\n                var T = this.gizmoLayer.utilityLayerScene.activeCamera, S = T.globalPosition;\n                T.devicePosition && (S = T.devicePosition), this._rootMesh.position.subtractToRef(S, this._tempVector);\n                var E = this._tempVector.length() * this.scaleRatio;\n                this._rootMesh.scaling.set(E, E, E), x._getWorldMatrixDeterminant() < 0 && (this._rootMesh.scaling.y *= -1);\n              } else\n                this._rootMesh.scaling.setAll(this.scaleRatio);\n            }\n          }, O.prototype._matrixChanged = function() {\n            if (this._attachedNode) {\n              if (this._attachedNode._isCamera) {\n                var x, m, c = this._attachedNode;\n                if (c.parent) {\n                  var T = this._tempMatrix2;\n                  c.parent._worldMatrix.invertToRef(T), this._attachedNode._worldMatrix.multiplyToRef(T, this._tempMatrix1), x = this._tempMatrix1;\n                } else\n                  x = this._attachedNode._worldMatrix;\n                if (c.getScene().useRightHandedSystem ? (this._rightHandtoLeftHandMatrix.multiplyToRef(x, this._tempMatrix2), m = this._tempMatrix2) : m = x, m.decompose(this._tempVector2, this._tempQuaternion, this._tempVector), this._attachedNode.getClassName() === \"FreeCamera\" || this._attachedNode.getClassName() === \"FlyCamera\" || this._attachedNode.getClassName() === \"ArcFollowCamera\" || this._attachedNode.getClassName() === \"TargetCamera\" || this._attachedNode.getClassName() === \"TouchCamera\" || this._attachedNode.getClassName() === \"UniversalCamera\") {\n                  var S = this._attachedNode;\n                  S.rotation = this._tempQuaternion.toEulerAngles(), S.rotationQuaternion && S.rotationQuaternion.copyFrom(this._tempQuaternion);\n                }\n                c.position.copyFrom(this._tempVector);\n              } else if (this._attachedNode._isMesh || this._attachedNode.getClassName() === \"AbstractMesh\" || this._attachedNode.getClassName() === \"TransformNode\" || this._attachedNode.getClassName() === \"InstancedMesh\") {\n                var E = this._attachedNode;\n                if (E.parent) {\n                  T = this._tempMatrix1;\n                  var g = this._tempMatrix2;\n                  E.parent.getWorldMatrix().invertToRef(T), this._attachedNode.getWorldMatrix().multiplyToRef(T, g), g.decompose(E.scaling, this._tempQuaternion, E.position);\n                } else\n                  this._attachedNode._worldMatrix.decompose(E.scaling, this._tempQuaternion, E.position);\n                E.billboardMode || (E.rotationQuaternion ? E.rotationQuaternion.copyFrom(this._tempQuaternion) : E.rotation = this._tempQuaternion.toEulerAngles());\n              } else if (this._attachedNode.getClassName() === \"Bone\") {\n                var l = this._attachedNode, h = l.getParent();\n                if (h) {\n                  var v = this._tempMatrix1, b = this._tempMatrix2;\n                  h.getWorldMatrix().invertToRef(v), l.getWorldMatrix().multiplyToRef(v, b), l.getLocalMatrix().copyFrom(b);\n                } else\n                  l.getLocalMatrix().copyFrom(l.getWorldMatrix());\n                l.markAsDirty();\n              }\n            }\n          }, O.GizmoAxisPointerObserver = function(x, m) {\n            var c = !1;\n            return x.utilityLayerScene.onPointerObservable.add(function(T) {\n              var S, E;\n              if (T.pickInfo) {\n                if (T.type === u.a.POINTERMOVE) {\n                  if (c)\n                    return;\n                  m.forEach(function(g) {\n                    var l, h;\n                    if (g.colliderMeshes && g.gizmoMeshes) {\n                      var v = ((l = g.colliderMeshes) === null || l === void 0 ? void 0 : l.indexOf((h = T == null ? void 0 : T.pickInfo) === null || h === void 0 ? void 0 : h.pickedMesh)) != -1 || g.active ? g.hoverMaterial : g.material;\n                      g.gizmoMeshes.forEach(function(b) {\n                        b.material = v, b.color && (b.color = v.diffuseColor);\n                      });\n                    }\n                  });\n                }\n                T.type === u.a.POINTERDOWN && m.has((S = T.pickInfo.pickedMesh) === null || S === void 0 ? void 0 : S.parent) && (c = !0, m.get((E = T.pickInfo.pickedMesh) === null || E === void 0 ? void 0 : E.parent).active = !0, m.forEach(function(g) {\n                  var l, h, v = ((l = g.colliderMeshes) === null || l === void 0 ? void 0 : l.indexOf((h = T == null ? void 0 : T.pickInfo) === null || h === void 0 ? void 0 : h.pickedMesh)) != -1 || g.active ? g.hoverMaterial : g.disableMaterial;\n                  g.gizmoMeshes.forEach(function(b) {\n                    b.material = v, b.color && (b.color = v.diffuseColor);\n                  });\n                })), T.type === u.a.POINTERUP && m.forEach(function(g) {\n                  g.active = !1, c = !1, g.gizmoMeshes.forEach(function(l) {\n                    l.material = g.material, l.color && (l.color = g.material.diffuseColor);\n                  });\n                });\n              }\n            });\n          }, O.prototype.dispose = function() {\n            this._rootMesh.dispose(), this._beforeRenderObserver && this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver);\n          }, O;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return c;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(0), I = f(22), O = f(2), x = f(120), m = (f(56), f(77)), c = function(T) {\n          function S(E) {\n            var g = T.call(this, null) || this;\n            return g.metadata = null, g.reservedDataStore = null, g._hasAlpha = !1, g.getAlphaFromRGB = !1, g.level = 1, g.coordinatesIndex = 0, g._coordinatesMode = O.a.TEXTURE_EXPLICIT_MODE, g.wrapR = O.a.TEXTURE_WRAP_ADDRESSMODE, g.anisotropicFilteringLevel = S.DEFAULT_ANISOTROPIC_FILTERING_LEVEL, g._isCube = !1, g._gammaSpace = !0, g.invertZ = !1, g.lodLevelInAlpha = !1, g.isRenderTarget = !1, g._prefiltered = !1, g.animations = new Array(), g.onDisposeObservable = new C.c(), g._onDisposeObserver = null, g._scene = null, g._texture = null, g._uid = null, E ? S._isScene(E) ? g._scene = E : g._engine = E : g._scene = I.a.LastCreatedScene, g._scene && (g.uniqueId = g._scene.getUniqueId(), g._scene.addTexture(g), g._engine = g._scene.getEngine()), g._uid = null, g;\n          }\n          return Object(V.d)(S, T), Object.defineProperty(S.prototype, \"hasAlpha\", { get: function() {\n            return this._hasAlpha;\n          }, set: function(E) {\n            this._hasAlpha !== E && (this._hasAlpha = E, this._scene && this._scene.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag | O.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"coordinatesMode\", { get: function() {\n            return this._coordinatesMode;\n          }, set: function(E) {\n            this._coordinatesMode !== E && (this._coordinatesMode = E, this._scene && this._scene.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"wrapU\", { get: function() {\n            return this._wrapU;\n          }, set: function(E) {\n            this._wrapU = E;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"wrapV\", { get: function() {\n            return this._wrapV;\n          }, set: function(E) {\n            this._wrapV = E;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isCube\", { get: function() {\n            return this._texture ? this._texture.isCube : this._isCube;\n          }, set: function(E) {\n            this._texture ? this._texture.isCube = E : this._isCube = E;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"is3D\", { get: function() {\n            return !!this._texture && this._texture.is3D;\n          }, set: function(E) {\n            this._texture && (this._texture.is3D = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"is2DArray\", { get: function() {\n            return !!this._texture && this._texture.is2DArray;\n          }, set: function(E) {\n            this._texture && (this._texture.is2DArray = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"gammaSpace\", { get: function() {\n            return this._texture ? (this._texture._gammaSpace === null && (this._texture._gammaSpace = this._gammaSpace), this._texture._gammaSpace) : this._gammaSpace;\n          }, set: function(E) {\n            if (this._texture) {\n              if (this._texture._gammaSpace === E)\n                return;\n              this._texture._gammaSpace = E;\n            } else {\n              if (this._gammaSpace === E)\n                return;\n              this._gammaSpace = E;\n            }\n            this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isRGBD\", { get: function() {\n            return this._texture != null && this._texture._isRGBD;\n          }, set: function(E) {\n            this._texture && (this._texture._isRGBD = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"noMipmap\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"lodGenerationOffset\", { get: function() {\n            return this._texture ? this._texture._lodGenerationOffset : 0;\n          }, set: function(E) {\n            this._texture && (this._texture._lodGenerationOffset = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"lodGenerationScale\", { get: function() {\n            return this._texture ? this._texture._lodGenerationScale : 0;\n          }, set: function(E) {\n            this._texture && (this._texture._lodGenerationScale = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"linearSpecularLOD\", { get: function() {\n            return !!this._texture && this._texture._linearSpecularLOD;\n          }, set: function(E) {\n            this._texture && (this._texture._linearSpecularLOD = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"irradianceTexture\", { get: function() {\n            return this._texture ? this._texture._irradianceTexture : null;\n          }, set: function(E) {\n            this._texture && (this._texture._irradianceTexture = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"uid\", { get: function() {\n            return this._uid || (this._uid = x.a.RandomId()), this._uid;\n          }, enumerable: !1, configurable: !0 }), S.prototype.toString = function() {\n            return this.name;\n          }, S.prototype.getClassName = function() {\n            return \"BaseTexture\";\n          }, Object.defineProperty(S.prototype, \"onDispose\", { set: function(E) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isBlocking\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), S.prototype.getScene = function() {\n            return this._scene;\n          }, S.prototype._getEngine = function() {\n            return this._engine;\n          }, S.prototype.checkTransformsAreIdentical = function(E) {\n            return E !== null;\n          }, S.prototype.getTextureMatrix = function() {\n            return u.a.IdentityReadOnly;\n          }, S.prototype.getReflectionTextureMatrix = function() {\n            return u.a.IdentityReadOnly;\n          }, S.prototype.isReadyOrNotBlocking = function() {\n            return !this.isBlocking || this.isReady();\n          }, S.prototype.scale = function(E) {\n          }, Object.defineProperty(S.prototype, \"canRescale\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), S.prototype._getFromCache = function(E, g, l, h) {\n            var v = this._getEngine();\n            if (!v)\n              return null;\n            for (var b = v.getLoadedTexturesCache(), D = 0; D < b.length; D++) {\n              var w = b[D];\n              if (!(h !== void 0 && h !== w.invertY || w.url !== E || w.generateMipMaps !== !g || l && l !== w.samplingMode))\n                return w.incrementReferences(), w;\n            }\n            return null;\n          }, S.prototype._rebuild = function() {\n          }, S.prototype.clone = function() {\n            return null;\n          }, Object.defineProperty(S.prototype, \"textureType\", { get: function() {\n            return this._texture && this._texture.type !== void 0 ? this._texture.type : O.a.TEXTURETYPE_UNSIGNED_INT;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"textureFormat\", { get: function() {\n            return this._texture && this._texture.format !== void 0 ? this._texture.format : O.a.TEXTUREFORMAT_RGBA;\n          }, enumerable: !1, configurable: !0 }), S.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            var E = this.getScene();\n            E && E.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag);\n          }, S.prototype.readPixels = function(E, g, l) {\n            if (E === void 0 && (E = 0), g === void 0 && (g = 0), l === void 0 && (l = null), !this._texture)\n              return null;\n            var h = this.getSize(), v = h.width, b = h.height, D = this._getEngine();\n            if (!D)\n              return null;\n            g != 0 && (v /= Math.pow(2, g), b /= Math.pow(2, g), v = Math.round(v), b = Math.round(b));\n            try {\n              return this._texture.isCube ? D._readTexturePixels(this._texture, v, b, E, g, l) : D._readTexturePixels(this._texture, v, b, -1, g, l);\n            } catch {\n              return null;\n            }\n          }, Object.defineProperty(S.prototype, \"_lodTextureHigh\", { get: function() {\n            return this._texture ? this._texture._lodTextureHigh : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"_lodTextureMid\", { get: function() {\n            return this._texture ? this._texture._lodTextureMid : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"_lodTextureLow\", { get: function() {\n            return this._texture ? this._texture._lodTextureLow : null;\n          }, enumerable: !1, configurable: !0 }), S.prototype.dispose = function() {\n            if (this._scene) {\n              this._scene.stopAnimation && this._scene.stopAnimation(this), this._scene._removePendingData(this);\n              var E = this._scene.textures.indexOf(this);\n              E >= 0 && this._scene.textures.splice(E, 1), this._scene.onTextureRemovedObservable.notifyObservers(this), this._scene = null;\n            }\n            this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), T.prototype.dispose.call(this);\n          }, S.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var E = _.a.Serialize(this);\n            return _.a.AppendSerializedAnimations(this, E), E;\n          }, S.WhenAllReady = function(E, g) {\n            var l = E.length;\n            if (l !== 0)\n              for (var h = 0; h < E.length; h++) {\n                var v = E[h];\n                if (v.isReady())\n                  --l == 0 && g();\n                else {\n                  var b = v.onLoadObservable;\n                  b && b.addOnce(function() {\n                    --l == 0 && g();\n                  });\n                }\n              }\n            else\n              g();\n          }, S._isScene = function(E) {\n            return E.getClassName() === \"Scene\";\n          }, S.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4, Object(V.c)([Object(_.c)()], S.prototype, \"uniqueId\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"name\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"metadata\", void 0), Object(V.c)([Object(_.c)(\"hasAlpha\")], S.prototype, \"_hasAlpha\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"getAlphaFromRGB\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"level\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"coordinatesIndex\", void 0), Object(V.c)([Object(_.c)(\"coordinatesMode\")], S.prototype, \"_coordinatesMode\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"wrapU\", null), Object(V.c)([Object(_.c)()], S.prototype, \"wrapV\", null), Object(V.c)([Object(_.c)()], S.prototype, \"wrapR\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"anisotropicFilteringLevel\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"isCube\", null), Object(V.c)([Object(_.c)()], S.prototype, \"is3D\", null), Object(V.c)([Object(_.c)()], S.prototype, \"is2DArray\", null), Object(V.c)([Object(_.c)()], S.prototype, \"gammaSpace\", null), Object(V.c)([Object(_.c)()], S.prototype, \"invertZ\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"lodLevelInAlpha\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"lodGenerationOffset\", null), Object(V.c)([Object(_.c)()], S.prototype, \"lodGenerationScale\", null), Object(V.c)([Object(_.c)()], S.prototype, \"linearSpecularLOD\", null), Object(V.c)([Object(_.m)()], S.prototype, \"irradianceTexture\", null), Object(V.c)([Object(_.c)()], S.prototype, \"isRenderTarget\", void 0), S;\n        }(function() {\n          function T(S) {\n            this._wrapU = O.a.TEXTURE_WRAP_ADDRESSMODE, this._wrapV = O.a.TEXTURE_WRAP_ADDRESSMODE, this.wrapR = O.a.TEXTURE_WRAP_ADDRESSMODE, this.anisotropicFilteringLevel = 4, this.delayLoadState = O.a.DELAYLOADSTATE_NONE, this._texture = null, this._engine = null, this._cachedSize = m.a.Zero(), this._cachedBaseSize = m.a.Zero(), this._texture = S, this._texture && (this._engine = this._texture.getEngine());\n          }\n          return Object.defineProperty(T.prototype, \"wrapU\", { get: function() {\n            return this._wrapU;\n          }, set: function(S) {\n            this._wrapU = S;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"wrapV\", { get: function() {\n            return this._wrapV;\n          }, set: function(S) {\n            this._wrapV = S;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"coordinatesMode\", { get: function() {\n            return 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"isCube\", { get: function() {\n            return !!this._texture && this._texture.isCube;\n          }, set: function(S) {\n            this._texture && (this._texture.isCube = S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"is3D\", { get: function() {\n            return !!this._texture && this._texture.is3D;\n          }, set: function(S) {\n            this._texture && (this._texture.is3D = S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"is2DArray\", { get: function() {\n            return !!this._texture && this._texture.is2DArray;\n          }, set: function(S) {\n            this._texture && (this._texture.is2DArray = S);\n          }, enumerable: !1, configurable: !0 }), T.prototype.getClassName = function() {\n            return \"ThinTexture\";\n          }, T.prototype.isReady = function() {\n            return this.delayLoadState === O.a.DELAYLOADSTATE_NOTLOADED ? (this.delayLoad(), !1) : !!this._texture && this._texture.isReady;\n          }, T.prototype.delayLoad = function() {\n          }, T.prototype.getInternalTexture = function() {\n            return this._texture;\n          }, T.prototype.getSize = function() {\n            if (this._texture) {\n              if (this._texture.width)\n                return this._cachedSize.width = this._texture.width, this._cachedSize.height = this._texture.height, this._cachedSize;\n              if (this._texture._size)\n                return this._cachedSize.width = this._texture._size, this._cachedSize.height = this._texture._size, this._cachedSize;\n            }\n            return this._cachedSize;\n          }, T.prototype.getBaseSize = function() {\n            return this.isReady() && this._texture ? this._texture._size ? (this._cachedBaseSize.width = this._texture._size, this._cachedBaseSize.height = this._texture._size, this._cachedBaseSize) : (this._cachedBaseSize.width = this._texture.baseWidth, this._cachedBaseSize.height = this._texture.baseHeight, this._cachedBaseSize) : (this._cachedBaseSize.width = 0, this._cachedBaseSize.height = 0, this._cachedBaseSize);\n          }, T.prototype.updateSamplingMode = function(S) {\n            this._texture && this._engine && this._engine.updateTextureSamplingMode(S, this._texture);\n          }, T.prototype.releaseInternalTexture = function() {\n            this._texture && (this._texture.dispose(), this._texture = null);\n          }, T.prototype.dispose = function() {\n            this._texture && (this.releaseInternalTexture(), this._engine = null);\n          }, T;\n        }());\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(0), _ = f(9), C = f(7), u = f(16), I = f(20), O = f(23);\n        u.a.CreateCylinder = function(m) {\n          var c = m.height || 2, T = m.diameterTop === 0 ? 0 : m.diameterTop || m.diameter || 1, S = m.diameterBottom === 0 ? 0 : m.diameterBottom || m.diameter || 1;\n          T = T || 1e-5, S = S || 1e-5;\n          var E, g = m.tessellation || 24, l = m.subdivisions || 1, h = !!m.hasRings, v = !!m.enclose, b = m.cap === 0 ? 0 : m.cap || C.a.CAP_ALL, D = m.arc && (m.arc <= 0 || m.arc > 1) ? 1 : m.arc || 1, w = m.sideOrientation === 0 ? 0 : m.sideOrientation || u.a.DEFAULTSIDE, N = m.faceUV || new Array(3), M = m.faceColors, U = 2 + (1 + (D !== 1 && v ? 2 : 0)) * (h ? l : 1);\n          for (E = 0; E < U; E++)\n            M && M[E] === void 0 && (M[E] = new _.b(1, 1, 1, 1));\n          for (E = 0; E < U; E++)\n            N && N[E] === void 0 && (N[E] = new V.f(0, 0, 1, 1));\n          var X, j, ne, te, de, pe, ae = new Array(), ee = new Array(), K = new Array(), $ = new Array(), L = new Array(), G = 2 * Math.PI * D / g, Q = (S - T) / 2 / c, oe = V.e.Zero(), re = V.e.Zero(), Y = V.e.Zero(), k = V.e.Zero(), H = V.e.Zero(), Z = O.a.Y, W = 1, q = 1, he = 0, ge = 0;\n          for (te = 0; te <= l; te++)\n            for (ne = ((j = te / l) * (T - S) + S) / 2, W = h && te !== 0 && te !== l ? 2 : 1, pe = 0; pe < W; pe++) {\n              for (h && (q += pe), v && (q += 2 * pe), de = 0; de <= g; de++)\n                X = de * G, oe.x = Math.cos(-X) * ne, oe.y = -c / 2 + j * c, oe.z = Math.sin(-X) * ne, T === 0 && te === l ? (re.x = K[K.length - 3 * (g + 1)], re.y = K[K.length - 3 * (g + 1) + 1], re.z = K[K.length - 3 * (g + 1) + 2]) : (re.x = oe.x, re.z = oe.z, re.y = Math.sqrt(re.x * re.x + re.z * re.z) * Q, re.normalize()), de === 0 && (Y.copyFrom(oe), k.copyFrom(re)), ee.push(oe.x, oe.y, oe.z), K.push(re.x, re.y, re.z), ge = h ? he !== q ? N[q].y : N[q].w : N[q].y + (N[q].w - N[q].y) * j, $.push(N[q].x + (N[q].z - N[q].x) * de / g, ge), M && L.push(M[q].r, M[q].g, M[q].b, M[q].a);\n              D !== 1 && v && (ee.push(oe.x, oe.y, oe.z), ee.push(0, oe.y, 0), ee.push(0, oe.y, 0), ee.push(Y.x, Y.y, Y.z), V.e.CrossToRef(Z, re, H), H.normalize(), K.push(H.x, H.y, H.z, H.x, H.y, H.z), V.e.CrossToRef(k, Z, H), H.normalize(), K.push(H.x, H.y, H.z, H.x, H.y, H.z), ge = h ? he !== q ? N[q + 1].y : N[q + 1].w : N[q + 1].y + (N[q + 1].w - N[q + 1].y) * j, $.push(N[q + 1].x, ge), $.push(N[q + 1].z, ge), ge = h ? he !== q ? N[q + 2].y : N[q + 2].w : N[q + 2].y + (N[q + 2].w - N[q + 2].y) * j, $.push(N[q + 2].x, ge), $.push(N[q + 2].z, ge), M && (L.push(M[q + 1].r, M[q + 1].g, M[q + 1].b, M[q + 1].a), L.push(M[q + 1].r, M[q + 1].g, M[q + 1].b, M[q + 1].a), L.push(M[q + 2].r, M[q + 2].g, M[q + 2].b, M[q + 2].a), L.push(M[q + 2].r, M[q + 2].g, M[q + 2].b, M[q + 2].a))), he !== q && (he = q);\n            }\n          var me = D !== 1 && v ? g + 4 : g;\n          for (te = 0, q = 0; q < l; q++) {\n            var _e = 0, ye = 0, Pe = 0, be = 0;\n            for (de = 0; de < g; de++)\n              _e = te * (me + 1) + de, ye = (te + 1) * (me + 1) + de, Pe = te * (me + 1) + (de + 1), be = (te + 1) * (me + 1) + (de + 1), ae.push(_e, ye, Pe), ae.push(be, Pe, ye);\n            D !== 1 && v && (ae.push(_e + 2, ye + 2, Pe + 2), ae.push(be + 2, Pe + 2, ye + 2), ae.push(_e + 4, ye + 4, Pe + 4), ae.push(be + 4, Pe + 4, ye + 4)), te = h ? te + 2 : te + 1;\n          }\n          var Fe = function(We) {\n            var je = We ? T / 2 : S / 2;\n            if (je !== 0) {\n              var He, Qe, Ge, tt = We ? N[U - 1] : N[0], Je = null;\n              M && (Je = We ? M[U - 1] : M[0]);\n              var st = ee.length / 3, at = We ? c / 2 : -c / 2, pt = new V.e(0, at, 0);\n              ee.push(pt.x, pt.y, pt.z), K.push(0, We ? 1 : -1, 0), $.push(tt.x + 0.5 * (tt.z - tt.x), tt.y + 0.5 * (tt.w - tt.y)), Je && L.push(Je.r, Je.g, Je.b, Je.a);\n              var Tt = new V.d(0.5, 0.5);\n              for (Ge = 0; Ge <= g; Ge++) {\n                He = 2 * Math.PI * Ge * D / g;\n                var Lt = Math.cos(-He), Ot = Math.sin(-He);\n                Qe = new V.e(Lt * je, at, Ot * je);\n                var St = new V.d(Lt * Tt.x + 0.5, Ot * Tt.y + 0.5);\n                ee.push(Qe.x, Qe.y, Qe.z), K.push(0, We ? 1 : -1, 0), $.push(tt.x + (tt.z - tt.x) * St.x, tt.y + (tt.w - tt.y) * St.y), Je && L.push(Je.r, Je.g, Je.b, Je.a);\n              }\n              for (Ge = 0; Ge < g; Ge++)\n                We ? (ae.push(st), ae.push(st + (Ge + 2)), ae.push(st + (Ge + 1))) : (ae.push(st), ae.push(st + (Ge + 1)), ae.push(st + (Ge + 2)));\n            }\n          };\n          b !== C.a.CAP_START && b !== C.a.CAP_ALL || Fe(!1), b !== C.a.CAP_END && b !== C.a.CAP_ALL || Fe(!0), u.a._ComputeSides(w, ee, ae, K, $, m.frontUVs, m.backUVs);\n          var ke = new u.a();\n          return ke.indices = ae, ke.positions = ee, ke.normals = K, ke.uvs = $, M && (ke.colors = L), ke;\n        }, C.a.CreateCylinder = function(m, c, T, S, E, g, l, h, v) {\n          l !== void 0 && l instanceof I.a || (l !== void 0 && (v = h || C.a.DEFAULTSIDE, h = l), l = g, g = 1);\n          var b = { height: c, diameterTop: T, diameterBottom: S, tessellation: E, subdivisions: g, sideOrientation: v, updatable: h };\n          return x.CreateCylinder(m, b, l);\n        };\n        var x = function() {\n          function m() {\n          }\n          return m.CreateCylinder = function(c, T, S) {\n            var E = new C.a(c, S);\n            return T.sideOrientation = C.a._GetDefaultSideOrientation(T.sideOrientation), E._originalBuilderSideOrientation = T.sideOrientation, u.a.CreateCylinder(T).applyToMesh(E, T.updatable), E;\n          }, m;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(0), _ = f(4), C = function() {\n          function u() {\n            this._pickingUnavailable = !1, this.hit = !1, this.distance = 0, this.pickedPoint = null, this.pickedMesh = null, this.bu = 0, this.bv = 0, this.faceId = -1, this.subMeshFaceId = -1, this.subMeshId = 0, this.pickedSprite = null, this.thinInstanceIndex = -1, this.originMesh = null, this.ray = null;\n          }\n          return u.prototype.getNormal = function(I, O) {\n            if (I === void 0 && (I = !1), O === void 0 && (O = !0), !this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(_.b.NormalKind))\n              return null;\n            var x, m = this.pickedMesh.getIndices();\n            if (!m)\n              return null;\n            if (O) {\n              var c = this.pickedMesh.getVerticesData(_.b.NormalKind), T = V.e.FromArray(c, 3 * m[3 * this.faceId]), S = V.e.FromArray(c, 3 * m[3 * this.faceId + 1]), E = V.e.FromArray(c, 3 * m[3 * this.faceId + 2]);\n              T = T.scale(this.bu), S = S.scale(this.bv), E = E.scale(1 - this.bu - this.bv), x = new V.e(T.x + S.x + E.x, T.y + S.y + E.y, T.z + S.z + E.z);\n            } else {\n              var g = this.pickedMesh.getVerticesData(_.b.PositionKind), l = V.e.FromArray(g, 3 * m[3 * this.faceId]), h = V.e.FromArray(g, 3 * m[3 * this.faceId + 1]), v = V.e.FromArray(g, 3 * m[3 * this.faceId + 2]), b = l.subtract(h), D = v.subtract(h);\n              x = V.e.Cross(b, D);\n            }\n            if (I) {\n              var w = this.pickedMesh.getWorldMatrix();\n              this.pickedMesh.nonUniformScaling && (V.c.Matrix[0].copyFrom(w), (w = V.c.Matrix[0]).setTranslationFromFloats(0, 0, 0), w.invert(), w.transposeToRef(V.c.Matrix[1]), w = V.c.Matrix[1]), x = V.e.TransformNormal(x, w);\n            }\n            return x.normalize(), x;\n          }, u.prototype.getTextureCoordinates = function() {\n            if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(_.b.UVKind))\n              return null;\n            var I = this.pickedMesh.getIndices();\n            if (!I)\n              return null;\n            var O = this.pickedMesh.getVerticesData(_.b.UVKind);\n            if (!O)\n              return null;\n            var x = V.d.FromArray(O, 2 * I[3 * this.faceId]), m = V.d.FromArray(O, 2 * I[3 * this.faceId + 1]), c = V.d.FromArray(O, 2 * I[3 * this.faceId + 2]);\n            return x = x.scale(this.bu), m = m.scale(this.bv), c = c.scale(1 - this.bu - this.bv), new V.d(x.x + m.x + c.x, x.y + m.y + c.y);\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(57), _ = function() {\n          function C() {\n            this._startMonitoringTime = 0, this._min = 0, this._max = 0, this._average = 0, this._lastSecAverage = 0, this._current = 0, this._totalValueCount = 0, this._totalAccumulated = 0, this._lastSecAccumulated = 0, this._lastSecTime = 0, this._lastSecValueCount = 0;\n          }\n          return Object.defineProperty(C.prototype, \"min\", { get: function() {\n            return this._min;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"max\", { get: function() {\n            return this._max;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"average\", { get: function() {\n            return this._average;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"lastSecAverage\", { get: function() {\n            return this._lastSecAverage;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"current\", { get: function() {\n            return this._current;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"total\", { get: function() {\n            return this._totalAccumulated;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"count\", { get: function() {\n            return this._totalValueCount;\n          }, enumerable: !1, configurable: !0 }), C.prototype.fetchNewFrame = function() {\n            this._totalValueCount++, this._current = 0, this._lastSecValueCount++;\n          }, C.prototype.addCount = function(u, I) {\n            C.Enabled && (this._current += u, I && this._fetchResult());\n          }, C.prototype.beginMonitoring = function() {\n            C.Enabled && (this._startMonitoringTime = V.a.Now);\n          }, C.prototype.endMonitoring = function(u) {\n            if (u === void 0 && (u = !0), C.Enabled) {\n              u && this.fetchNewFrame();\n              var I = V.a.Now;\n              this._current = I - this._startMonitoringTime, u && this._fetchResult();\n            }\n          }, C.prototype._fetchResult = function() {\n            this._totalAccumulated += this._current, this._lastSecAccumulated += this._current, this._min = Math.min(this._min, this._current), this._max = Math.max(this._max, this._current), this._average = this._totalAccumulated / this._totalValueCount;\n            var u = V.a.Now;\n            u - this._lastSecTime > 1e3 && (this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount, this._lastSecTime = u, this._lastSecAccumulated = 0, this._lastSecValueCount = 0);\n          }, C.Enabled = !0, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return S;\n        }), f.d(A, \"d\", function() {\n          return E;\n        }), f.d(A, \"c\", function() {\n          return g;\n        }), f.d(A, \"a\", function() {\n          return l;\n        });\n        var V = f(1), _ = f(49), C = f(38), u = f(6), I = f(83), O = f(140), x = function(h) {\n          function v() {\n            return h !== null && h.apply(this, arguments) || this;\n          }\n          return Object(V.d)(v, h), v._setPrototypeOf = Object.setPrototypeOf || function(b, D) {\n            return b.__proto__ = D, b;\n          }, v;\n        }(Error), m = f(34), c = f(26), T = f(128), S = function(h) {\n          function v(b, D) {\n            var w = h.call(this, b) || this;\n            return w.name = \"LoadFileError\", x._setPrototypeOf(w, v.prototype), D instanceof _.a ? w.request = D : w.file = D, w;\n          }\n          return Object(V.d)(v, h), v;\n        }(x), E = function(h) {\n          function v(b, D) {\n            var w = h.call(this, b) || this;\n            return w.request = D, w.name = \"RequestFileError\", x._setPrototypeOf(w, v.prototype), w;\n          }\n          return Object(V.d)(v, h), v;\n        }(x), g = function(h) {\n          function v(b, D) {\n            var w = h.call(this, b) || this;\n            return w.file = D, w.name = \"ReadFileError\", x._setPrototypeOf(w, v.prototype), w;\n          }\n          return Object(V.d)(v, h), v;\n        }(x), l = function() {\n          function h() {\n          }\n          return h._CleanUrl = function(v) {\n            return v = v.replace(/#/gm, \"%23\");\n          }, h.SetCorsBehavior = function(v, b) {\n            if ((!v || v.indexOf(\"data:\") !== 0) && h.CorsBehavior)\n              if (typeof h.CorsBehavior == \"string\" || this.CorsBehavior instanceof String)\n                b.crossOrigin = h.CorsBehavior;\n              else {\n                var D = h.CorsBehavior(v);\n                D && (b.crossOrigin = D);\n              }\n          }, h.LoadImage = function(v, b, D, w, N) {\n            var M;\n            N === void 0 && (N = \"\");\n            var U = !1;\n            if (v instanceof ArrayBuffer || ArrayBuffer.isView(v) ? typeof Blob < \"u\" ? (M = URL.createObjectURL(new Blob([v], { type: N })), U = !0) : M = \"data:\" + N + \";base64,\" + m.a.EncodeArrayBufferToBase64(v) : v instanceof Blob ? (M = URL.createObjectURL(v), U = !0) : (M = h._CleanUrl(v), M = h.PreprocessUrl(v)), typeof Image > \"u\")\n              return h.LoadFile(M, function(ae) {\n                createImageBitmap(new Blob([ae], { type: N })).then(function(ee) {\n                  b(ee), U && URL.revokeObjectURL(M);\n                }).catch(function(ee) {\n                  D && D(\"Error while trying to load image: \" + v, ee);\n                });\n              }, void 0, w || void 0, !0, function(ae, ee) {\n                D && D(\"Error while trying to load image: \" + v, ee);\n              }), null;\n            var X = new Image();\n            h.SetCorsBehavior(M, X);\n            var j = function() {\n              X.removeEventListener(\"load\", j), X.removeEventListener(\"error\", ne), b(X), U && X.src && URL.revokeObjectURL(X.src);\n            }, ne = function(ae) {\n              if (X.removeEventListener(\"load\", j), X.removeEventListener(\"error\", ne), D) {\n                var ee = v.toString();\n                D(\"Error while trying to load image: \" + (ee.length < 32 ? ee : ee.slice(0, 32) + \"...\"), ae);\n              }\n              U && X.src && URL.revokeObjectURL(X.src);\n            };\n            X.addEventListener(\"load\", j), X.addEventListener(\"error\", ne);\n            var te = function() {\n              X.src = M;\n            };\n            if (M.substr(0, 5) !== \"data:\" && w && w.enableTexturesOffline)\n              w.open(function() {\n                w && w.loadImage(M, X);\n              }, te);\n            else {\n              if (M.indexOf(\"file:\") !== -1) {\n                var de = decodeURIComponent(M.substring(5).toLowerCase());\n                if (I.a.FilesToLoad[de]) {\n                  try {\n                    var pe;\n                    try {\n                      pe = URL.createObjectURL(I.a.FilesToLoad[de]);\n                    } catch {\n                      pe = URL.createObjectURL(I.a.FilesToLoad[de]);\n                    }\n                    X.src = pe, U = !0;\n                  } catch {\n                    X.src = \"\";\n                  }\n                  return X;\n                }\n              }\n              te();\n            }\n            return X;\n          }, h.ReadFile = function(v, b, D, w, N) {\n            var M = new FileReader(), U = { onCompleteObservable: new u.c(), abort: function() {\n              return M.abort();\n            } };\n            return M.onloadend = function(X) {\n              return U.onCompleteObservable.notifyObservers(U);\n            }, N && (M.onerror = function(X) {\n              N(new g(\"Unable to read \" + v.name, v));\n            }), M.onload = function(X) {\n              b(X.target.result);\n            }, D && (M.onprogress = D), w ? M.readAsArrayBuffer(v) : M.readAsText(v), U;\n          }, h.LoadFile = function(v, b, D, w, N, M) {\n            if (v.indexOf(\"file:\") !== -1) {\n              var U = decodeURIComponent(v.substring(5).toLowerCase());\n              U.indexOf(\"./\") === 0 && (U = U.substring(2));\n              var X = I.a.FilesToLoad[U];\n              if (X)\n                return h.ReadFile(X, b, D, N, M ? function(j) {\n                  return M(void 0, new S(j.message, j.file));\n                } : void 0);\n            }\n            return h.RequestFile(v, function(j, ne) {\n              b(j, ne ? ne.responseURL : void 0);\n            }, D, w, N, M ? function(j) {\n              M(j.request, new S(j.message, j.request));\n            } : void 0);\n          }, h.RequestFile = function(v, b, D, w, N, M, U) {\n            v = h._CleanUrl(v), v = h.PreprocessUrl(v);\n            var X = h.BaseUrl + v, j = !1, ne = { onCompleteObservable: new u.c(), abort: function() {\n              return j = !0;\n            } }, te = function() {\n              var pe = new _.a(), ae = null;\n              ne.abort = function() {\n                j = !0, pe.readyState !== (XMLHttpRequest.DONE || 4) && pe.abort(), ae !== null && (clearTimeout(ae), ae = null);\n              };\n              var ee = function(K) {\n                pe.open(\"GET\", X), U && U(pe), N && (pe.responseType = \"arraybuffer\"), D && pe.addEventListener(\"progress\", D);\n                var $ = function() {\n                  pe.removeEventListener(\"loadend\", $), ne.onCompleteObservable.notifyObservers(ne), ne.onCompleteObservable.clear();\n                };\n                pe.addEventListener(\"loadend\", $);\n                var L = function() {\n                  if (!j && pe.readyState === (XMLHttpRequest.DONE || 4)) {\n                    if (pe.removeEventListener(\"readystatechange\", L), pe.status >= 200 && pe.status < 300 || pe.status === 0 && (!C.a.IsWindowObjectExist() || h.IsFileURL()))\n                      return void b(N ? pe.response : pe.responseText, pe);\n                    var G = h.DefaultRetryStrategy;\n                    if (G) {\n                      var Q = G(X, pe, K);\n                      if (Q !== -1)\n                        return pe.removeEventListener(\"loadend\", $), pe = new _.a(), void (ae = setTimeout(function() {\n                          return ee(K + 1);\n                        }, Q));\n                    }\n                    var oe = new E(\"Error status: \" + pe.status + \" \" + pe.statusText + \" - Unable to load \" + X, pe);\n                    M && M(oe);\n                  }\n                };\n                pe.addEventListener(\"readystatechange\", L), pe.send();\n              };\n              ee(0);\n            };\n            if (w && w.enableSceneOffline) {\n              var de = function(pe) {\n                pe && pe.status > 400 ? M && M(pe) : te();\n              };\n              w.open(function() {\n                w && w.loadFile(h.BaseUrl + v, function(pe) {\n                  j || b(pe), ne.onCompleteObservable.notifyObservers(ne);\n                }, D ? function(pe) {\n                  j || D(pe);\n                } : void 0, de, N);\n              }, de);\n            } else\n              te();\n            return ne;\n          }, h.IsFileURL = function() {\n            return typeof location < \"u\" && location.protocol === \"file:\";\n          }, h.DefaultRetryStrategy = O.a.ExponentialBackoff(), h.BaseUrl = \"\", h.CorsBehavior = \"anonymous\", h.PreprocessUrl = function(v) {\n            return v;\n          }, h;\n        }();\n        c.a._FileToolsLoadImage = l.LoadImage.bind(l), c.a._FileToolsLoadFile = l.LoadFile.bind(l), T.a._FileToolsLoadFile = l.LoadFile.bind(l);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(38), _ = function() {\n          function C() {\n          }\n          return Object.defineProperty(C, \"Now\", { get: function() {\n            return V.a.IsWindowObjectExist() && window.performance && window.performance.now ? window.performance.now() : Date.now();\n          }, enumerable: !1, configurable: !0 }), C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _(C, u, I, O) {\n            this.x = C, this.y = u, this.width = I, this.height = O;\n          }\n          return _.prototype.toGlobal = function(C, u) {\n            return new _(this.x * C, this.y * u, this.width * C, this.height * u);\n          }, _.prototype.toGlobalToRef = function(C, u, I) {\n            return I.x = this.x * C, I.y = this.y * u, I.width = this.width * C, I.height = this.height * u, this;\n          }, _.prototype.clone = function() {\n            return new _(this.x, this.y, this.width, this.height);\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        var V = \"helperFunctions\", _ = `const float PI=3.1415926535897932384626433832795;\nconst float HALF_MIN=5.96046448e-08;\nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nconst float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat toLinearSpace(float color)\n{\nreturn pow(color,LinearEncodePowerApprox);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec4 toLinearSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nvec4 toGammaSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n}\nfloat toGammaSpace(float color)\n{\nreturn pow(color,GammaEncodePowerApprox);\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat pow5(float value) {\nfloat sq=value*value;\nreturn sq*sq*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat dither=mix(-varianceAmount/255.0,varianceAmount/255.0,rand);\nreturn dither;\n}\n\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=maxEps(max(color.r,max(color.g,color.b)));\nfloat D=max(rgbdMaxRange/maxRGB,1.);\nD=clamp(floor(D)/255.0,0.,1.);\n\nvec3 rgb=color.rgb*D;\n\nrgb=toGammaSpace(rgb);\nreturn vec4(rgb,D);\n}\nvec3 fromRGBD(vec4 rgbd) {\n\nrgbd.rgb=toLinearSpace(rgbd.rgb);\n\nreturn rgbd.rgb/rgbd.a;\n}\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(0), _ = function() {\n          function C() {\n          }\n          return C._RemoveAndStorePivotPoint = function(u) {\n            u && C._PivotCached === 0 && (u.getPivotPointToRef(C._OldPivotPoint), C._PivotPostMultiplyPivotMatrix = u._postMultiplyPivotMatrix, C._OldPivotPoint.equalsToFloats(0, 0, 0) || (u.setPivotMatrix(V.a.IdentityReadOnly), C._OldPivotPoint.subtractToRef(u.getPivotPoint(), C._PivotTranslation), C._PivotTmpVector.copyFromFloats(1, 1, 1), C._PivotTmpVector.subtractInPlace(u.scaling), C._PivotTmpVector.multiplyInPlace(C._PivotTranslation), u.position.addInPlace(C._PivotTmpVector))), C._PivotCached++;\n          }, C._RestorePivotPoint = function(u) {\n            u && !C._OldPivotPoint.equalsToFloats(0, 0, 0) && C._PivotCached === 1 && (u.setPivotPoint(C._OldPivotPoint), u._postMultiplyPivotMatrix = C._PivotPostMultiplyPivotMatrix, C._PivotTmpVector.copyFromFloats(1, 1, 1), C._PivotTmpVector.subtractInPlace(u.scaling), C._PivotTmpVector.multiplyInPlace(C._PivotTranslation), u.position.subtractInPlace(C._PivotTmpVector)), this._PivotCached--;\n          }, C._PivotCached = 0, C._OldPivotPoint = new V.e(), C._PivotTranslation = new V.e(), C._PivotTmpVector = new V.e(), C._PivotPostMultiplyPivotMatrix = !1, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(4), _ = f(114), C = f(43), u = f(2), I = f(101), O = function() {\n          function x(m, c, T, S, E, g, l, h, v) {\n            h === void 0 && (h = !0), v === void 0 && (v = !0), this.materialIndex = m, this.verticesStart = c, this.verticesCount = T, this.indexStart = S, this.indexCount = E, this._materialDefines = null, this._materialEffect = null, this._effectOverride = null, this._linesIndexCount = 0, this._linesIndexBuffer = null, this._lastColliderWorldVertices = null, this._lastColliderTransformMatrix = null, this._renderId = 0, this._alphaIndex = 0, this._distanceToCamera = 0, this._currentMaterial = null, this._mesh = g, this._renderingMesh = l || g, v && g.subMeshes.push(this), this._trianglePlanes = [], this._id = g.subMeshes.length - 1, h && (this.refreshBoundingInfo(), g.computeWorldMatrix(!0));\n          }\n          return Object.defineProperty(x.prototype, \"materialDefines\", { get: function() {\n            return this._materialDefines;\n          }, set: function(m) {\n            this._materialDefines = m;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"effect\", { get: function() {\n            var m;\n            return (m = this._effectOverride) !== null && m !== void 0 ? m : this._materialEffect;\n          }, enumerable: !1, configurable: !0 }), x.prototype.setEffect = function(m, c) {\n            c === void 0 && (c = null), this._materialEffect !== m ? (this._materialDefines = c, this._materialEffect = m) : m || (this._materialDefines = null);\n          }, x.AddToMesh = function(m, c, T, S, E, g, l, h) {\n            return h === void 0 && (h = !0), new x(m, c, T, S, E, g, l, h);\n          }, Object.defineProperty(x.prototype, \"IsGlobal\", { get: function() {\n            return this.verticesStart === 0 && this.verticesCount === this._mesh.getTotalVertices();\n          }, enumerable: !1, configurable: !0 }), x.prototype.getBoundingInfo = function() {\n            return this.IsGlobal ? this._mesh.getBoundingInfo() : this._boundingInfo;\n          }, x.prototype.setBoundingInfo = function(m) {\n            return this._boundingInfo = m, this;\n          }, x.prototype.getMesh = function() {\n            return this._mesh;\n          }, x.prototype.getRenderingMesh = function() {\n            return this._renderingMesh;\n          }, x.prototype.getReplacementMesh = function() {\n            return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;\n          }, x.prototype.getEffectiveMesh = function() {\n            var m = this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;\n            return m || this._renderingMesh;\n          }, x.prototype.getMaterial = function() {\n            var m = this._renderingMesh.material;\n            if (m == null)\n              return this._mesh.getScene().defaultMaterial;\n            if (this._IsMultiMaterial(m)) {\n              var c = m.getSubMaterial(this.materialIndex);\n              return this._currentMaterial !== c && (this._currentMaterial = c, this._materialDefines = null), c;\n            }\n            return m;\n          }, x.prototype._IsMultiMaterial = function(m) {\n            return m.getSubMaterial !== void 0;\n          }, x.prototype.refreshBoundingInfo = function(m) {\n            if (m === void 0 && (m = null), this._lastColliderWorldVertices = null, this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry)\n              return this;\n            if (m || (m = this._renderingMesh.getVerticesData(V.b.PositionKind)), !m)\n              return this._boundingInfo = this._mesh.getBoundingInfo(), this;\n            var c, T = this._renderingMesh.getIndices();\n            if (this.indexStart === 0 && this.indexCount === T.length) {\n              var S = this._renderingMesh.getBoundingInfo();\n              c = { minimum: S.minimum.clone(), maximum: S.maximum.clone() };\n            } else\n              c = Object(I.b)(m, T, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias);\n            return this._boundingInfo ? this._boundingInfo.reConstruct(c.minimum, c.maximum) : this._boundingInfo = new C.a(c.minimum, c.maximum), this;\n          }, x.prototype._checkCollision = function(m) {\n            return this.getBoundingInfo()._checkCollision(m);\n          }, x.prototype.updateBoundingInfo = function(m) {\n            var c = this.getBoundingInfo();\n            return c || (this.refreshBoundingInfo(), c = this.getBoundingInfo()), c && c.update(m), this;\n          }, x.prototype.isInFrustum = function(m) {\n            var c = this.getBoundingInfo();\n            return !!c && c.isInFrustum(m, this._mesh.cullingStrategy);\n          }, x.prototype.isCompletelyInFrustum = function(m) {\n            var c = this.getBoundingInfo();\n            return !!c && c.isCompletelyInFrustum(m);\n          }, x.prototype.render = function(m) {\n            return this._renderingMesh.render(this, m, this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : void 0), this;\n          }, x.prototype._getLinesIndexBuffer = function(m, c) {\n            if (!this._linesIndexBuffer) {\n              for (var T = [], S = this.indexStart; S < this.indexStart + this.indexCount; S += 3)\n                T.push(m[S], m[S + 1], m[S + 1], m[S + 2], m[S + 2], m[S]);\n              this._linesIndexBuffer = c.createIndexBuffer(T), this._linesIndexCount = T.length;\n            }\n            return this._linesIndexBuffer;\n          }, x.prototype.canIntersects = function(m) {\n            var c = this.getBoundingInfo();\n            return !!c && m.intersectsBox(c.boundingBox);\n          }, x.prototype.intersects = function(m, c, T, S, E) {\n            var g = this.getMaterial();\n            if (!g)\n              return null;\n            var l = 3, h = !1;\n            switch (g.fillMode) {\n              case u.a.MATERIAL_PointListDrawMode:\n              case u.a.MATERIAL_LineListDrawMode:\n              case u.a.MATERIAL_LineLoopDrawMode:\n              case u.a.MATERIAL_LineStripDrawMode:\n              case u.a.MATERIAL_TriangleFanDrawMode:\n                return null;\n              case u.a.MATERIAL_TriangleStripDrawMode:\n                l = 1, h = !0;\n            }\n            return this._mesh.getClassName() === \"InstancedLinesMesh\" || this._mesh.getClassName() === \"LinesMesh\" ? T.length ? this._intersectLines(m, c, T, this._mesh.intersectionThreshold, S) : this._intersectUnIndexedLines(m, c, T, this._mesh.intersectionThreshold, S) : !T.length && this._mesh._unIndexed ? this._intersectUnIndexedTriangles(m, c, T, S, E) : this._intersectTriangles(m, c, T, l, h, S, E);\n          }, x.prototype._intersectLines = function(m, c, T, S, E) {\n            for (var g = null, l = this.indexStart; l < this.indexStart + this.indexCount; l += 2) {\n              var h = c[T[l]], v = c[T[l + 1]], b = m.intersectionSegment(h, v, S);\n              if (!(b < 0) && (E || !g || b < g.distance) && ((g = new _.a(null, null, b)).faceId = l / 2, E))\n                break;\n            }\n            return g;\n          }, x.prototype._intersectUnIndexedLines = function(m, c, T, S, E) {\n            for (var g = null, l = this.verticesStart; l < this.verticesStart + this.verticesCount; l += 2) {\n              var h = c[l], v = c[l + 1], b = m.intersectionSegment(h, v, S);\n              if (!(b < 0) && (E || !g || b < g.distance) && ((g = new _.a(null, null, b)).faceId = l / 2, E))\n                break;\n            }\n            return g;\n          }, x.prototype._intersectTriangles = function(m, c, T, S, E, g, l) {\n            for (var h = null, v = -1, b = this.indexStart; b < this.indexStart + this.indexCount; b += S) {\n              v++;\n              var D = T[b], w = T[b + 1], N = T[b + 2];\n              if (E && N === 4294967295)\n                b += 2;\n              else {\n                var M = c[D], U = c[w], X = c[N];\n                if (!l || l(M, U, X, m)) {\n                  var j = m.intersectsTriangle(M, U, X);\n                  if (j) {\n                    if (j.distance < 0)\n                      continue;\n                    if ((g || !h || j.distance < h.distance) && ((h = j).faceId = v, g))\n                      break;\n                  }\n                }\n              }\n            }\n            return h;\n          }, x.prototype._intersectUnIndexedTriangles = function(m, c, T, S, E) {\n            for (var g = null, l = this.verticesStart; l < this.verticesStart + this.verticesCount; l += 3) {\n              var h = c[l], v = c[l + 1], b = c[l + 2];\n              if (!E || E(h, v, b, m)) {\n                var D = m.intersectsTriangle(h, v, b);\n                if (D) {\n                  if (D.distance < 0)\n                    continue;\n                  if ((S || !g || D.distance < g.distance) && ((g = D).faceId = l / 3, S))\n                    break;\n                }\n              }\n            }\n            return g;\n          }, x.prototype._rebuild = function() {\n            this._linesIndexBuffer && (this._linesIndexBuffer = null);\n          }, x.prototype.clone = function(m, c) {\n            var T = new x(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, m, c, !1);\n            if (!this.IsGlobal) {\n              var S = this.getBoundingInfo();\n              if (!S)\n                return T;\n              T._boundingInfo = new C.a(S.minimum, S.maximum);\n            }\n            return T;\n          }, x.prototype.dispose = function() {\n            this._linesIndexBuffer && (this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer), this._linesIndexBuffer = null);\n            var m = this._mesh.subMeshes.indexOf(this);\n            this._mesh.subMeshes.splice(m, 1);\n          }, x.prototype.getClassName = function() {\n            return \"SubMesh\";\n          }, x.CreateFromIndices = function(m, c, T, S, E) {\n            for (var g = Number.MAX_VALUE, l = -Number.MAX_VALUE, h = (E || S).getIndices(), v = c; v < c + T; v++) {\n              var b = h[v];\n              b < g && (g = b), b > l && (l = b);\n            }\n            return new x(m, g, l - g + 1, c, T, S, E);\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(1), _ = f(8), C = f(10), u = f(2), I = (f(126), f(70)), O = function(x) {\n          function m(c, T, S, E, g, l, h) {\n            S === void 0 && (S = null), g === void 0 && (g = u.a.TEXTURE_TRILINEAR_SAMPLINGMODE), l === void 0 && (l = u.a.TEXTUREFORMAT_RGBA);\n            var v = x.call(this, null, S, !E, h, g, void 0, void 0, void 0, void 0, l) || this;\n            v.name = c, v.wrapU = C.a.CLAMP_ADDRESSMODE, v.wrapV = C.a.CLAMP_ADDRESSMODE, v._generateMipMaps = E;\n            var b = v._getEngine();\n            if (!b)\n              return v;\n            T.getContext ? (v._canvas = T, v._texture = b.createDynamicTexture(T.width, T.height, E, g)) : (v._canvas = I.a.CreateCanvas(1, 1), T.width || T.width === 0 ? v._texture = b.createDynamicTexture(T.width, T.height, E, g) : v._texture = b.createDynamicTexture(T, T, E, g));\n            var D = v.getSize();\n            return v._canvas.width = D.width, v._canvas.height = D.height, v._context = v._canvas.getContext(\"2d\"), v;\n          }\n          return Object(V.d)(m, x), m.prototype.getClassName = function() {\n            return \"DynamicTexture\";\n          }, Object.defineProperty(m.prototype, \"canRescale\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), m.prototype._recreate = function(c) {\n            this._canvas.width = c.width, this._canvas.height = c.height, this.releaseInternalTexture(), this._texture = this._getEngine().createDynamicTexture(c.width, c.height, this._generateMipMaps, this.samplingMode);\n          }, m.prototype.scale = function(c) {\n            var T = this.getSize();\n            T.width *= c, T.height *= c, this._recreate(T);\n          }, m.prototype.scaleTo = function(c, T) {\n            var S = this.getSize();\n            S.width = c, S.height = T, this._recreate(S);\n          }, m.prototype.getContext = function() {\n            return this._context;\n          }, m.prototype.clear = function() {\n            var c = this.getSize();\n            this._context.fillRect(0, 0, c.width, c.height);\n          }, m.prototype.update = function(c, T) {\n            T === void 0 && (T = !1), this._getEngine().updateDynamicTexture(this._texture, this._canvas, c === void 0 || c, T, this._format || void 0);\n          }, m.prototype.drawText = function(c, T, S, E, g, l, h, v) {\n            v === void 0 && (v = !0);\n            var b = this.getSize();\n            if (l && (this._context.fillStyle = l, this._context.fillRect(0, 0, b.width, b.height)), this._context.font = E, T == null) {\n              var D = this._context.measureText(c);\n              T = (b.width - D.width) / 2;\n            }\n            if (S == null) {\n              var w = parseInt(E.replace(/\\D/g, \"\"));\n              S = b.height / 2 + w / 3.65;\n            }\n            this._context.fillStyle = g || \"\", this._context.fillText(c, T, S), v && this.update(h);\n          }, m.prototype.clone = function() {\n            var c = this.getScene();\n            if (!c)\n              return this;\n            var T = this.getSize(), S = new m(this.name, T, c, this._generateMipMaps);\n            return S.hasAlpha = this.hasAlpha, S.level = this.level, S.wrapU = this.wrapU, S.wrapV = this.wrapV, S;\n          }, m.prototype.serialize = function() {\n            var c = this.getScene();\n            c && !c.isReady() && _.a.Warn(\"The scene must be ready before serializing the dynamic texture\");\n            var T = x.prototype.serialize.call(this);\n            return this._IsCanvasElement(this._canvas) && (T.base64String = this._canvas.toDataURL()), T.invertY = this._invertY, T.samplingMode = this.samplingMode, T;\n          }, m.prototype._IsCanvasElement = function(c) {\n            return c.toDataURL !== void 0;\n          }, m.prototype._rebuild = function() {\n            this.update();\n          }, m;\n        }(C.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(0), _ = f(9), C = f(7), u = f(16);\n        u.a.CreateBox = function(O) {\n          var x, m = [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23], c = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0], T = [], S = O.width || O.size || 1, E = O.height || O.size || 1, g = O.depth || O.size || 1, l = O.wrap || !1, h = O.topBaseAt === void 0 ? 1 : O.topBaseAt, v = O.bottomBaseAt === void 0 ? 0 : O.bottomBaseAt, b = [2, 0, 3, 1][h = (h + 4) % 4], D = [2, 0, 1, 3][v = (v + 4) % 4], w = [1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1];\n          if (l) {\n            m = [2, 3, 0, 2, 0, 1, 4, 5, 6, 4, 6, 7, 9, 10, 11, 9, 11, 8, 12, 14, 15, 12, 13, 14], w = [-1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1];\n            for (var N = [[1, 1, 1], [-1, 1, 1], [-1, 1, -1], [1, 1, -1]], M = [[-1, -1, 1], [1, -1, 1], [1, -1, -1], [-1, -1, -1]], U = [17, 18, 19, 16], X = [22, 23, 20, 21]; b > 0; )\n              N.unshift(N.pop()), U.unshift(U.pop()), b--;\n            for (; D > 0; )\n              M.unshift(M.pop()), X.unshift(X.pop()), D--;\n            N = N.flat(), M = M.flat(), w = w.concat(N).concat(M), m.push(U[0], U[2], U[3], U[0], U[1], U[2]), m.push(X[0], X[2], X[3], X[0], X[1], X[2]);\n          }\n          var j = [S / 2, E / 2, g / 2];\n          x = w.reduce(function(G, Q, oe) {\n            return G.concat(Q * j[oe % 3]);\n          }, []);\n          for (var ne = O.sideOrientation === 0 ? 0 : O.sideOrientation || u.a.DEFAULTSIDE, te = O.faceUV || new Array(6), de = O.faceColors, pe = [], ae = 0; ae < 6; ae++)\n            te[ae] === void 0 && (te[ae] = new V.f(0, 0, 1, 1)), de && de[ae] === void 0 && (de[ae] = new _.b(1, 1, 1, 1));\n          for (var ee = 0; ee < 6; ee++)\n            if (T.push(te[ee].z, te[ee].w), T.push(te[ee].x, te[ee].w), T.push(te[ee].x, te[ee].y), T.push(te[ee].z, te[ee].y), de)\n              for (var K = 0; K < 4; K++)\n                pe.push(de[ee].r, de[ee].g, de[ee].b, de[ee].a);\n          u.a._ComputeSides(ne, x, m, c, T, O.frontUVs, O.backUVs);\n          var $ = new u.a();\n          if ($.indices = m, $.positions = x, $.normals = c, $.uvs = T, de) {\n            var L = ne === u.a.DOUBLESIDE ? pe.concat(pe) : pe;\n            $.colors = L;\n          }\n          return $;\n        }, C.a.CreateBox = function(O, x, m, c, T) {\n          m === void 0 && (m = null);\n          var S = { size: x, sideOrientation: T, updatable: c };\n          return I.CreateBox(O, S, m);\n        };\n        var I = function() {\n          function O() {\n          }\n          return O.CreateBox = function(x, m, c) {\n            c === void 0 && (c = null);\n            var T = new C.a(x, c);\n            return m.sideOrientation = C.a._GetDefaultSideOrientation(m.sideOrientation), T._originalBuilderSideOrientation = m.sideOrientation, u.a.CreateBox(m).applyToMesh(T, m.updatable), T;\n          }, O;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(0), _ = function() {\n          function C(u, I, O, x) {\n            this.normal = new V.e(u, I, O), this.d = x;\n          }\n          return C.prototype.asArray = function() {\n            return [this.normal.x, this.normal.y, this.normal.z, this.d];\n          }, C.prototype.clone = function() {\n            return new C(this.normal.x, this.normal.y, this.normal.z, this.d);\n          }, C.prototype.getClassName = function() {\n            return \"Plane\";\n          }, C.prototype.getHashCode = function() {\n            var u = this.normal.getHashCode();\n            return u = 397 * u ^ (0 | this.d);\n          }, C.prototype.normalize = function() {\n            var u = Math.sqrt(this.normal.x * this.normal.x + this.normal.y * this.normal.y + this.normal.z * this.normal.z), I = 0;\n            return u !== 0 && (I = 1 / u), this.normal.x *= I, this.normal.y *= I, this.normal.z *= I, this.d *= I, this;\n          }, C.prototype.transform = function(u) {\n            var I = C._TmpMatrix;\n            u.invertToRef(I);\n            var O = I.m, x = this.normal.x, m = this.normal.y, c = this.normal.z, T = this.d;\n            return new C(x * O[0] + m * O[1] + c * O[2] + T * O[3], x * O[4] + m * O[5] + c * O[6] + T * O[7], x * O[8] + m * O[9] + c * O[10] + T * O[11], x * O[12] + m * O[13] + c * O[14] + T * O[15]);\n          }, C.prototype.dotCoordinate = function(u) {\n            return this.normal.x * u.x + this.normal.y * u.y + this.normal.z * u.z + this.d;\n          }, C.prototype.copyFromPoints = function(u, I, O) {\n            var x, m = I.x - u.x, c = I.y - u.y, T = I.z - u.z, S = O.x - u.x, E = O.y - u.y, g = O.z - u.z, l = c * g - T * E, h = T * S - m * g, v = m * E - c * S, b = Math.sqrt(l * l + h * h + v * v);\n            return x = b !== 0 ? 1 / b : 0, this.normal.x = l * x, this.normal.y = h * x, this.normal.z = v * x, this.d = -(this.normal.x * u.x + this.normal.y * u.y + this.normal.z * u.z), this;\n          }, C.prototype.isFrontFacingTo = function(u, I) {\n            return V.e.Dot(this.normal, u) <= I;\n          }, C.prototype.signedDistanceTo = function(u) {\n            return V.e.Dot(u, this.normal) + this.d;\n          }, C.FromArray = function(u) {\n            return new C(u[0], u[1], u[2], u[3]);\n          }, C.FromPoints = function(u, I, O) {\n            var x = new C(0, 0, 0, 0);\n            return x.copyFromPoints(u, I, O), x;\n          }, C.FromPositionAndNormal = function(u, I) {\n            var O = new C(0, 0, 0, 0);\n            return I.normalize(), O.normal = I, O.d = -(I.x * u.x + I.y * u.y + I.z * u.z), O;\n          }, C.SignedDistanceToPlaneFromPositionAndNormal = function(u, I, O) {\n            var x = -(I.x * u.x + I.y * u.y + I.z * u.z);\n            return V.e.Dot(O, I) + x;\n          }, C._TmpMatrix = V.a.Identity(), C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(7), _ = f(20), C = f(6), u = f(0), I = f(18), O = f(39), x = f(60), m = (f(84), function() {\n          function c(T) {\n            this._useAlternatePickedPointAboveMaxDragAngleDragSpeed = -1.1, this.maxDragAngle = 0, this._useAlternatePickedPointAboveMaxDragAngle = !1, this.currentDraggingPointerID = -1, this.dragging = !1, this.dragDeltaRatio = 0.2, this.updateDragPlane = !0, this._debugMode = !1, this._moving = !1, this.onDragObservable = new C.c(), this.onDragStartObservable = new C.c(), this.onDragEndObservable = new C.c(), this.moveAttached = !0, this.enabled = !0, this.startAndReleaseDragOnPointerEvents = !0, this.detachCameraControls = !0, this.useObjectOrientationForDragging = !0, this.validateDrag = function(E) {\n              return !0;\n            }, this._tmpVector = new u.e(0, 0, 0), this._alternatePickedPoint = new u.e(0, 0, 0), this._worldDragAxis = new u.e(0, 0, 0), this._targetPosition = new u.e(0, 0, 0), this._attachedToElement = !1, this._startDragRay = new O.a(new u.e(), new u.e()), this._lastPointerRay = {}, this._dragDelta = new u.e(), this._pointA = new u.e(0, 0, 0), this._pointC = new u.e(0, 0, 0), this._localAxis = new u.e(0, 0, 0), this._lookAt = new u.e(0, 0, 0), this._options = T || {};\n            var S = 0;\n            if (this._options.dragAxis && S++, this._options.dragPlaneNormal && S++, S > 1)\n              throw \"Multiple drag modes specified in dragBehavior options. Only one expected\";\n          }\n          return Object.defineProperty(c.prototype, \"options\", { get: function() {\n            return this._options;\n          }, set: function(T) {\n            this._options = T;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"name\", { get: function() {\n            return \"PointerDrag\";\n          }, enumerable: !1, configurable: !0 }), c.prototype.init = function() {\n          }, c.prototype.attach = function(T, S) {\n            var E = this;\n            this._scene = T.getScene(), this.attachedNode = T, c._planeScene || (this._debugMode ? c._planeScene = this._scene : (c._planeScene = new _.a(this._scene.getEngine(), { virtual: !0 }), c._planeScene.detachControl(), this._scene.onDisposeObservable.addOnce(function() {\n              c._planeScene.dispose(), c._planeScene = null;\n            }))), this._dragPlane = V.a.CreatePlane(\"pointerDragPlane\", this._debugMode ? 1 : 1e4, c._planeScene, !1, V.a.DOUBLESIDE), this.lastDragPosition = new u.e(0, 0, 0);\n            var g = S || function(l) {\n              return E.attachedNode == l || l.isDescendantOf(E.attachedNode);\n            };\n            this._pointerObserver = this._scene.onPointerObservable.add(function(l, h) {\n              if (E.enabled) {\n                if (l.type == I.a.POINTERDOWN)\n                  E.startAndReleaseDragOnPointerEvents && !E.dragging && l.pickInfo && l.pickInfo.hit && l.pickInfo.pickedMesh && l.pickInfo.pickedPoint && l.pickInfo.ray && g(l.pickInfo.pickedMesh) && E._startDrag(l.event.pointerId, l.pickInfo.ray, l.pickInfo.pickedPoint);\n                else if (l.type == I.a.POINTERUP)\n                  E.startAndReleaseDragOnPointerEvents && E.currentDraggingPointerID == l.event.pointerId && E.releaseDrag();\n                else if (l.type == I.a.POINTERMOVE) {\n                  var v = l.event.pointerId;\n                  if (E.currentDraggingPointerID === c._AnyMouseID && v !== c._AnyMouseID) {\n                    var b = l.event;\n                    (b.pointerType === \"mouse\" || !E._scene.getEngine().hostInformation.isMobile && b instanceof MouseEvent) && (E._lastPointerRay[E.currentDraggingPointerID] && (E._lastPointerRay[v] = E._lastPointerRay[E.currentDraggingPointerID], delete E._lastPointerRay[E.currentDraggingPointerID]), E.currentDraggingPointerID = v);\n                  }\n                  E._lastPointerRay[v] || (E._lastPointerRay[v] = new O.a(new u.e(), new u.e())), l.pickInfo && l.pickInfo.ray && (E._lastPointerRay[v].origin.copyFrom(l.pickInfo.ray.origin), E._lastPointerRay[v].direction.copyFrom(l.pickInfo.ray.direction), E.currentDraggingPointerID == v && E.dragging && E._moveDrag(l.pickInfo.ray));\n                }\n              }\n            }), this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function() {\n              E._moving && E.moveAttached && (x.a._RemoveAndStorePivotPoint(E.attachedNode), E._targetPosition.subtractToRef(E.attachedNode.absolutePosition, E._tmpVector), E._tmpVector.scaleInPlace(E.dragDeltaRatio), E.attachedNode.getAbsolutePosition().addToRef(E._tmpVector, E._tmpVector), E.validateDrag(E._tmpVector) && E.attachedNode.setAbsolutePosition(E._tmpVector), x.a._RestorePivotPoint(E.attachedNode));\n            });\n          }, c.prototype.releaseDrag = function() {\n            if (this.dragging && (this.dragging = !1, this.onDragEndObservable.notifyObservers({ dragPlanePoint: this.lastDragPosition, pointerId: this.currentDraggingPointerID })), this.currentDraggingPointerID = -1, this._moving = !1, this.detachCameraControls && this._attachedToElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera) {\n              if (this._scene.activeCamera.getClassName() === \"ArcRotateCamera\") {\n                var T = this._scene.activeCamera;\n                T.attachControl(!T.inputs || T.inputs.noPreventDefault, T._useCtrlForPanning, T._panningMouseButton);\n              } else\n                this._scene.activeCamera.attachControl(!this._scene.activeCamera.inputs || this._scene.activeCamera.inputs.noPreventDefault);\n              this._attachedToElement = !1;\n            }\n          }, c.prototype.startDrag = function(T, S, E) {\n            T === void 0 && (T = c._AnyMouseID), this._startDrag(T, S, E);\n            var g = this._lastPointerRay[T];\n            T === c._AnyMouseID && (g = this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]), g && this._moveDrag(g);\n          }, c.prototype._startDrag = function(T, S, E) {\n            if (this._scene.activeCamera && !this.dragging && this.attachedNode) {\n              x.a._RemoveAndStorePivotPoint(this.attachedNode), S ? (this._startDragRay.direction.copyFrom(S.direction), this._startDragRay.origin.copyFrom(S.origin)) : (this._startDragRay.origin.copyFrom(this._scene.activeCamera.position), this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector), this._tmpVector.subtractToRef(this._scene.activeCamera.position, this._startDragRay.direction)), this._updateDragPlanePosition(this._startDragRay, E || this._tmpVector);\n              var g = this._pickWithRayOnDragPlane(this._startDragRay);\n              g && (this.dragging = !0, this.currentDraggingPointerID = T, this.lastDragPosition.copyFrom(g), this.onDragStartObservable.notifyObservers({ dragPlanePoint: g, pointerId: this.currentDraggingPointerID }), this._targetPosition.copyFrom(this.attachedNode.absolutePosition), this.detachCameraControls && this._scene.activeCamera && this._scene.activeCamera.inputs && !this._scene.activeCamera.leftCamera && (this._scene.activeCamera.inputs.attachedToElement ? (this._scene.activeCamera.detachControl(), this._attachedToElement = !0) : this._attachedToElement = !1)), x.a._RestorePivotPoint(this.attachedNode);\n            }\n          }, c.prototype._moveDrag = function(T) {\n            this._moving = !0;\n            var S = this._pickWithRayOnDragPlane(T);\n            if (S) {\n              this.updateDragPlane && this._updateDragPlanePosition(T, S);\n              var E = 0;\n              this._options.dragAxis ? (this.useObjectOrientationForDragging ? u.e.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis) : this._worldDragAxis.copyFrom(this._options.dragAxis), S.subtractToRef(this.lastDragPosition, this._tmpVector), E = u.e.Dot(this._tmpVector, this._worldDragAxis), this._worldDragAxis.scaleToRef(E, this._dragDelta)) : (E = this._dragDelta.length(), S.subtractToRef(this.lastDragPosition, this._dragDelta)), this._targetPosition.addInPlace(this._dragDelta), this.onDragObservable.notifyObservers({ dragDistance: E, delta: this._dragDelta, dragPlanePoint: S, dragPlaneNormal: this._dragPlane.forward, pointerId: this.currentDraggingPointerID }), this.lastDragPosition.copyFrom(S);\n            }\n          }, c.prototype._pickWithRayOnDragPlane = function(T) {\n            var S = this;\n            if (!T)\n              return null;\n            var E = Math.acos(u.e.Dot(this._dragPlane.forward, T.direction));\n            if (E > Math.PI / 2 && (E = Math.PI - E), this.maxDragAngle > 0 && E > this.maxDragAngle) {\n              if (this._useAlternatePickedPointAboveMaxDragAngle) {\n                this._tmpVector.copyFrom(T.direction), this.attachedNode.absolutePosition.subtractToRef(T.origin, this._alternatePickedPoint), this._alternatePickedPoint.normalize(), this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed * u.e.Dot(this._alternatePickedPoint, this._tmpVector)), this._tmpVector.addInPlace(this._alternatePickedPoint);\n                var g = u.e.Dot(this._dragPlane.forward, this._tmpVector);\n                return this._dragPlane.forward.scaleToRef(-g, this._alternatePickedPoint), this._alternatePickedPoint.addInPlace(this._tmpVector), this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition), this._alternatePickedPoint;\n              }\n              return null;\n            }\n            var l = c._planeScene.pickWithRay(T, function(h) {\n              return h == S._dragPlane;\n            });\n            return l && l.hit && l.pickedMesh && l.pickedPoint ? l.pickedPoint : null;\n          }, c.prototype._updateDragPlanePosition = function(T, S) {\n            this._pointA.copyFrom(S), this._options.dragAxis ? (this.useObjectOrientationForDragging ? u.e.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis), T.origin.subtractToRef(this._pointA, this._pointC), this._pointC.normalize(), Math.abs(u.e.Dot(this._localAxis, this._pointC)) > 0.999 ? Math.abs(u.e.Dot(u.e.UpReadOnly, this._pointC)) > 0.999 ? this._lookAt.copyFrom(u.e.Right()) : this._lookAt.copyFrom(u.e.UpReadOnly) : (u.e.CrossToRef(this._localAxis, this._pointC, this._lookAt), u.e.CrossToRef(this._localAxis, this._lookAt, this._lookAt), this._lookAt.normalize()), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._lookAt, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : this._options.dragPlaneNormal ? (this.useObjectOrientationForDragging ? u.e.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._localAxis, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : (this._dragPlane.position.copyFrom(this._pointA), this._dragPlane.lookAt(T.origin)), this._dragPlane.position.copyFrom(this.attachedNode.absolutePosition), this._dragPlane.computeWorldMatrix(!0);\n          }, c.prototype.detach = function() {\n            this._pointerObserver && this._scene.onPointerObservable.remove(this._pointerObserver), this._beforeRenderObserver && this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver), this.releaseDrag();\n          }, c._AnyMouseID = -2, c;\n        }());\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        });\n        var V = f(1), _ = function() {\n          function I() {\n          }\n          return I.KEYDOWN = 1, I.KEYUP = 2, I;\n        }(), C = function(I, O) {\n          this.type = I, this.event = O;\n        }, u = function(I) {\n          function O(x, m) {\n            var c = I.call(this, x, m) || this;\n            return c.type = x, c.event = m, c.skipOnPointerObservable = !1, c;\n          }\n          return Object(V.d)(O, I), O;\n        }(C);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._defines = {}, this._currentRank = 32, this._maxRank = -1, this._mesh = null;\n          }\n          return _.prototype.unBindMesh = function() {\n            this._mesh = null;\n          }, _.prototype.addFallback = function(C, u) {\n            this._defines[C] || (C < this._currentRank && (this._currentRank = C), C > this._maxRank && (this._maxRank = C), this._defines[C] = new Array()), this._defines[C].push(u);\n          }, _.prototype.addCPUSkinningFallback = function(C, u) {\n            this._mesh = u, C < this._currentRank && (this._currentRank = C), C > this._maxRank && (this._maxRank = C);\n          }, Object.defineProperty(_.prototype, \"hasMoreFallbacks\", { get: function() {\n            return this._currentRank <= this._maxRank;\n          }, enumerable: !1, configurable: !0 }), _.prototype.reduce = function(C, u) {\n            if (this._mesh && this._mesh.computeBonesUsingShaders && this._mesh.numBoneInfluencers > 0) {\n              this._mesh.computeBonesUsingShaders = !1, C = C.replace(\"#define NUM_BONE_INFLUENCERS \" + this._mesh.numBoneInfluencers, \"#define NUM_BONE_INFLUENCERS 0\"), u._bonesComputationForcedToCPU = !0;\n              for (var I = this._mesh.getScene(), O = 0; O < I.meshes.length; O++) {\n                var x = I.meshes[O];\n                if (x.material) {\n                  if (x.computeBonesUsingShaders && x.numBoneInfluencers !== 0) {\n                    if (x.material.getEffect() === u)\n                      x.computeBonesUsingShaders = !1;\n                    else if (x.subMeshes) {\n                      for (var m = 0, c = x.subMeshes; m < c.length; m++)\n                        if (c[m].effect === u) {\n                          x.computeBonesUsingShaders = !1;\n                          break;\n                        }\n                    }\n                  }\n                } else\n                  !this._mesh.material && x.computeBonesUsingShaders && x.numBoneInfluencers > 0 && (x.computeBonesUsingShaders = !1);\n              }\n            } else {\n              var T = this._defines[this._currentRank];\n              if (T)\n                for (O = 0; O < T.length; O++)\n                  C = C.replace(\"#define \" + T[O], \"\");\n              this._currentRank++;\n            }\n            return C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(1), _ = f(25), C = f(37), u = f(11), I = function(O) {\n          function x(m, c) {\n            var T = O.call(this, m, c, !0) || this;\n            return c.multiMaterials.push(T), T.subMaterials = new Array(), T._storeEffectOnSubMeshes = !0, T;\n          }\n          return Object(V.d)(x, O), Object.defineProperty(x.prototype, \"subMaterials\", { get: function() {\n            return this._subMaterials;\n          }, set: function(m) {\n            this._subMaterials = m, this._hookArray(m);\n          }, enumerable: !1, configurable: !0 }), x.prototype.getChildren = function() {\n            return this.subMaterials;\n          }, x.prototype._hookArray = function(m) {\n            var c = this, T = m.push;\n            m.push = function() {\n              for (var E = [], g = 0; g < arguments.length; g++)\n                E[g] = arguments[g];\n              var l = T.apply(m, E);\n              return c._markAllSubMeshesAsTexturesDirty(), l;\n            };\n            var S = m.splice;\n            m.splice = function(E, g) {\n              var l = S.apply(m, [E, g]);\n              return c._markAllSubMeshesAsTexturesDirty(), l;\n            };\n          }, x.prototype.getSubMaterial = function(m) {\n            return m < 0 || m >= this.subMaterials.length ? this.getScene().defaultMaterial : this.subMaterials[m];\n          }, x.prototype.getActiveTextures = function() {\n            var m;\n            return (m = O.prototype.getActiveTextures.call(this)).concat.apply(m, this.subMaterials.map(function(c) {\n              return c ? c.getActiveTextures() : [];\n            }));\n          }, x.prototype.hasTexture = function(m) {\n            var c;\n            if (O.prototype.hasTexture.call(this, m))\n              return !0;\n            for (var T = 0; T < this.subMaterials.length; T++)\n              if (!((c = this.subMaterials[T]) === null || c === void 0) && c.hasTexture(m))\n                return !0;\n            return !1;\n          }, x.prototype.getClassName = function() {\n            return \"MultiMaterial\";\n          }, x.prototype.isReadyForSubMesh = function(m, c, T) {\n            for (var S = 0; S < this.subMaterials.length; S++) {\n              var E = this.subMaterials[S];\n              if (E) {\n                if (E._storeEffectOnSubMeshes) {\n                  if (!E.isReadyForSubMesh(m, c, T))\n                    return !1;\n                  continue;\n                }\n                if (!E.isReady(m))\n                  return !1;\n              }\n            }\n            return !0;\n          }, x.prototype.clone = function(m, c) {\n            for (var T = new x(m, this.getScene()), S = 0; S < this.subMaterials.length; S++) {\n              var E = null, g = this.subMaterials[S];\n              E = c && g ? g.clone(m + \"-\" + g.name) : this.subMaterials[S], T.subMaterials.push(E);\n            }\n            return T;\n          }, x.prototype.serialize = function() {\n            var m = {};\n            m.name = this.name, m.id = this.id, C.a && (m.tags = C.a.GetTags(this)), m.materials = [];\n            for (var c = 0; c < this.subMaterials.length; c++) {\n              var T = this.subMaterials[c];\n              T ? m.materials.push(T.id) : m.materials.push(null);\n            }\n            return m;\n          }, x.prototype.dispose = function(m, c, T) {\n            var S = this.getScene();\n            if (S) {\n              if (T)\n                for (var E = 0; E < this.subMaterials.length; E++) {\n                  var g = this.subMaterials[E];\n                  g && g.dispose(m, c);\n                }\n              (E = S.multiMaterials.indexOf(this)) >= 0 && S.multiMaterials.splice(E, 1), O.prototype.dispose.call(this, m, c);\n            }\n          }, x.ParseMultiMaterial = function(m, c) {\n            var T = new x(m.name, c);\n            T.id = m.id, C.a && C.a.AddTagsTo(T, m.tags);\n            for (var S = 0; S < m.materials.length; S++) {\n              var E = m.materials[S];\n              E ? T.subMaterials.push(c.getLastMaterialByID(E)) : T.subMaterials.push(null);\n            }\n            return T;\n          }, x;\n        }(_.a);\n        u.a.RegisteredTypes[\"BABYLON.MultiMaterial\"] = I;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(2), _ = function() {\n          function C() {\n          }\n          return Object.defineProperty(C, \"ForceFullSceneLoadingForIncremental\", { get: function() {\n            return C._ForceFullSceneLoadingForIncremental;\n          }, set: function(u) {\n            C._ForceFullSceneLoadingForIncremental = u;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"ShowLoadingScreen\", { get: function() {\n            return C._ShowLoadingScreen;\n          }, set: function(u) {\n            C._ShowLoadingScreen = u;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"loggingLevel\", { get: function() {\n            return C._loggingLevel;\n          }, set: function(u) {\n            C._loggingLevel = u;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"CleanBoneMatrixWeights\", { get: function() {\n            return C._CleanBoneMatrixWeights;\n          }, set: function(u) {\n            C._CleanBoneMatrixWeights = u;\n          }, enumerable: !1, configurable: !0 }), C._ForceFullSceneLoadingForIncremental = !1, C._ShowLoadingScreen = !0, C._CleanBoneMatrixWeights = !1, C._loggingLevel = V.a.SCENELOADER_NO_LOGGING, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.CreateCanvas = function(C, u) {\n            if (typeof document > \"u\")\n              return new OffscreenCanvas(C, u);\n            var I = document.createElement(\"canvas\");\n            return I.width = C, I.height = u, I;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return E;\n        });\n        var V = f(0), _ = f(9), C = f(16), u = f(4), I = f(61), O = f(69), x = f(43), m = f(2), c = f(12), T = f(37), S = f(101), E = function() {\n          function g(l, h, v, b, D) {\n            b === void 0 && (b = !1), D === void 0 && (D = null), this.delayLoadState = m.a.DELAYLOADSTATE_NONE, this._totalVertices = 0, this._isDisposed = !1, this._indexBufferIsUpdatable = !1, this._positionsCache = [], this.useBoundingInfoFromGeometry = !1, this.id = l, this.uniqueId = h.getUniqueId(), this._engine = h.getEngine(), this._meshes = [], this._scene = h, this._vertexBuffers = {}, this._indices = [], this._updatable = b, v ? this.setAllVerticesData(v, b) : (this._totalVertices = 0, this._indices = []), this._engine.getCaps().vertexArrayObject && (this._vertexArrayObjects = {}), D && (this.applyToMesh(D), D.computeWorldMatrix(!0));\n          }\n          return Object.defineProperty(g.prototype, \"boundingBias\", { get: function() {\n            return this._boundingBias;\n          }, set: function(l) {\n            this._boundingBias ? this._boundingBias.copyFrom(l) : this._boundingBias = l.clone(), this._updateBoundingInfo(!0, null);\n          }, enumerable: !1, configurable: !0 }), g.CreateGeometryForMesh = function(l) {\n            var h = new g(g.RandomId(), l.getScene());\n            return h.applyToMesh(l), h;\n          }, Object.defineProperty(g.prototype, \"meshes\", { get: function() {\n            return this._meshes;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"extend\", { get: function() {\n            return this._extend;\n          }, enumerable: !1, configurable: !0 }), g.prototype.getScene = function() {\n            return this._scene;\n          }, g.prototype.getEngine = function() {\n            return this._engine;\n          }, g.prototype.isReady = function() {\n            return this.delayLoadState === m.a.DELAYLOADSTATE_LOADED || this.delayLoadState === m.a.DELAYLOADSTATE_NONE;\n          }, Object.defineProperty(g.prototype, \"doNotSerialize\", { get: function() {\n            for (var l = 0; l < this._meshes.length; l++)\n              if (!this._meshes[l].doNotSerialize)\n                return !1;\n            return !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype._rebuild = function() {\n            for (var l in this._vertexArrayObjects && (this._vertexArrayObjects = {}), this._meshes.length !== 0 && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices)), this._vertexBuffers)\n              this._vertexBuffers[l]._rebuild();\n          }, g.prototype.setAllVerticesData = function(l, h) {\n            l.applyToGeometry(this, h), this.notifyUpdate();\n          }, g.prototype.setVerticesData = function(l, h, v, b) {\n            v === void 0 && (v = !1), v && Array.isArray(h) && (h = new Float32Array(h));\n            var D = new u.b(this._engine, h, l, v, this._meshes.length === 0, b);\n            this.setVerticesBuffer(D);\n          }, g.prototype.removeVerticesData = function(l) {\n            this._vertexBuffers[l] && (this._vertexBuffers[l].dispose(), delete this._vertexBuffers[l]);\n          }, g.prototype.setVerticesBuffer = function(l, h) {\n            h === void 0 && (h = null);\n            var v = l.getKind();\n            if (this._vertexBuffers[v] && this._vertexBuffers[v].dispose(), this._vertexBuffers[v] = l, v === u.b.PositionKind) {\n              var b = l.getData();\n              h != null ? this._totalVertices = h : b != null && (this._totalVertices = b.length / (l.byteStride / 4)), this._updateExtend(b), this._resetPointsArrayCache();\n              for (var D = this._meshes, w = D.length, N = 0; N < w; N++) {\n                var M = D[N];\n                M._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum), M._createGlobalSubMesh(!1), M.computeWorldMatrix(!0);\n              }\n            }\n            this.notifyUpdate(v), this._vertexArrayObjects && (this._disposeVertexArrayObjects(), this._vertexArrayObjects = {});\n          }, g.prototype.updateVerticesDataDirectly = function(l, h, v, b) {\n            b === void 0 && (b = !1);\n            var D = this.getVertexBuffer(l);\n            D && (D.updateDirectly(h, v, b), this.notifyUpdate(l));\n          }, g.prototype.updateVerticesData = function(l, h, v) {\n            v === void 0 && (v = !1);\n            var b = this.getVertexBuffer(l);\n            b && (b.update(h), l === u.b.PositionKind && this._updateBoundingInfo(v, h), this.notifyUpdate(l));\n          }, g.prototype._updateBoundingInfo = function(l, h) {\n            if (l && this._updateExtend(h), this._resetPointsArrayCache(), l)\n              for (var v = 0, b = this._meshes; v < b.length; v++) {\n                var D = b[v];\n                D._boundingInfo ? D._boundingInfo.reConstruct(this._extend.minimum, this._extend.maximum) : D._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum);\n                for (var w = 0, N = D.subMeshes; w < N.length; w++)\n                  N[w].refreshBoundingInfo();\n              }\n          }, g.prototype._bind = function(l, h) {\n            if (l) {\n              h === void 0 && (h = this._indexBuffer);\n              var v = this.getVertexBuffers();\n              v && (h == this._indexBuffer && this._vertexArrayObjects ? (this._vertexArrayObjects[l.key] || (this._vertexArrayObjects[l.key] = this._engine.recordVertexArrayObject(v, h, l)), this._engine.bindVertexArrayObject(this._vertexArrayObjects[l.key], h)) : this._engine.bindBuffers(v, h, l));\n            }\n          }, g.prototype.getTotalVertices = function() {\n            return this.isReady() ? this._totalVertices : 0;\n          }, g.prototype.getVerticesData = function(l, h, v) {\n            var b = this.getVertexBuffer(l);\n            if (!b)\n              return null;\n            var D = b.getData();\n            if (!D)\n              return null;\n            var w = b.getSize() * u.b.GetTypeByteLength(b.type), N = this._totalVertices * b.getSize();\n            if (b.type !== u.b.FLOAT || b.byteStride !== w) {\n              var M = [];\n              return b.forEach(N, function(te) {\n                return M.push(te);\n              }), M;\n            }\n            if (!(D instanceof Array || D instanceof Float32Array) || b.byteOffset !== 0 || D.length !== N) {\n              if (D instanceof Array) {\n                var U = b.byteOffset / 4;\n                return c.b.Slice(D, U, U + N);\n              }\n              if (D instanceof ArrayBuffer)\n                return new Float32Array(D, b.byteOffset, N);\n              if (U = D.byteOffset + b.byteOffset, v || h && this._meshes.length !== 1) {\n                var X = new Float32Array(N), j = new Float32Array(D.buffer, U, N);\n                return X.set(j), X;\n              }\n              var ne = U % 4;\n              return ne && (U = Math.max(0, U - ne)), new Float32Array(D.buffer, U, N);\n            }\n            return v || h && this._meshes.length !== 1 ? c.b.Slice(D) : D;\n          }, g.prototype.isVertexBufferUpdatable = function(l) {\n            var h = this._vertexBuffers[l];\n            return !!h && h.isUpdatable();\n          }, g.prototype.getVertexBuffer = function(l) {\n            return this.isReady() ? this._vertexBuffers[l] : null;\n          }, g.prototype.getVertexBuffers = function() {\n            return this.isReady() ? this._vertexBuffers : null;\n          }, g.prototype.isVerticesDataPresent = function(l) {\n            return this._vertexBuffers ? this._vertexBuffers[l] !== void 0 : !!this._delayInfo && this._delayInfo.indexOf(l) !== -1;\n          }, g.prototype.getVerticesDataKinds = function() {\n            var l, h = [];\n            if (!this._vertexBuffers && this._delayInfo)\n              for (l in this._delayInfo)\n                h.push(l);\n            else\n              for (l in this._vertexBuffers)\n                h.push(l);\n            return h;\n          }, g.prototype.updateIndices = function(l, h, v) {\n            if (v === void 0 && (v = !1), this._indexBuffer)\n              if (this._indexBufferIsUpdatable) {\n                var b = l.length !== this._indices.length;\n                if (v || (this._indices = l.slice()), this._engine.updateDynamicIndexBuffer(this._indexBuffer, l, h), b)\n                  for (var D = 0, w = this._meshes; D < w.length; D++)\n                    w[D]._createGlobalSubMesh(!0);\n              } else\n                this.setIndices(l, null, !0);\n          }, g.prototype.setIndices = function(l, h, v) {\n            h === void 0 && (h = null), v === void 0 && (v = !1), this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._disposeVertexArrayObjects(), this._indices = l, this._indexBufferIsUpdatable = v, this._meshes.length !== 0 && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, v)), h != null && (this._totalVertices = h);\n            for (var b = 0, D = this._meshes; b < D.length; b++)\n              D[b]._createGlobalSubMesh(!0);\n            this.notifyUpdate();\n          }, g.prototype.getTotalIndices = function() {\n            return this.isReady() ? this._indices.length : 0;\n          }, g.prototype.getIndices = function(l, h) {\n            if (!this.isReady())\n              return null;\n            var v = this._indices;\n            if (h || l && this._meshes.length !== 1) {\n              for (var b = v.length, D = [], w = 0; w < b; w++)\n                D.push(v[w]);\n              return D;\n            }\n            return v;\n          }, g.prototype.getIndexBuffer = function() {\n            return this.isReady() ? this._indexBuffer : null;\n          }, g.prototype._releaseVertexArrayObject = function(l) {\n            l === void 0 && (l = null), l && this._vertexArrayObjects && this._vertexArrayObjects[l.key] && (this._engine.releaseVertexArrayObject(this._vertexArrayObjects[l.key]), delete this._vertexArrayObjects[l.key]);\n          }, g.prototype.releaseForMesh = function(l, h) {\n            var v = this._meshes, b = v.indexOf(l);\n            b !== -1 && (v.splice(b, 1), l._geometry = null, v.length === 0 && h && this.dispose());\n          }, g.prototype.applyToMesh = function(l) {\n            if (l._geometry !== this) {\n              var h = l._geometry;\n              h && h.releaseForMesh(l);\n              var v = this._meshes;\n              l._geometry = this, this._scene.pushGeometry(this), v.push(l), this.isReady() ? this._applyToMesh(l) : l._boundingInfo = this._boundingInfo;\n            }\n          }, g.prototype._updateExtend = function(l) {\n            l === void 0 && (l = null), this.useBoundingInfoFromGeometry && this._boundingInfo ? this._extend = { minimum: this._boundingInfo.minimum.clone(), maximum: this._boundingInfo.maximum.clone() } : (l || (l = this.getVerticesData(u.b.PositionKind)), this._extend = Object(S.a)(l, 0, this._totalVertices, this.boundingBias, 3));\n          }, g.prototype._applyToMesh = function(l) {\n            var h = this._meshes.length;\n            for (var v in this._vertexBuffers) {\n              h === 1 && this._vertexBuffers[v].create();\n              var b = this._vertexBuffers[v].getBuffer();\n              b && (b.references = h), v === u.b.PositionKind && (this._extend || this._updateExtend(), l._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum), l._createGlobalSubMesh(!1), l._updateBoundingInfo());\n            }\n            h === 1 && this._indices && this._indices.length > 0 && (this._indexBuffer = this._engine.createIndexBuffer(this._indices)), this._indexBuffer && (this._indexBuffer.references = h), l._syncGeometryWithMorphTargetManager(), l.synchronizeInstances();\n          }, g.prototype.notifyUpdate = function(l) {\n            this.onGeometryUpdated && this.onGeometryUpdated(this, l);\n            for (var h = 0, v = this._meshes; h < v.length; h++)\n              v[h]._markSubMeshesAsAttributesDirty();\n          }, g.prototype.load = function(l, h) {\n            this.delayLoadState !== m.a.DELAYLOADSTATE_LOADING && (this.isReady() ? h && h() : (this.delayLoadState = m.a.DELAYLOADSTATE_LOADING, this._queueLoad(l, h)));\n          }, g.prototype._queueLoad = function(l, h) {\n            var v = this;\n            this.delayLoadingFile && (l._addPendingData(this), l._loadFile(this.delayLoadingFile, function(b) {\n              if (v._delayLoadingFunction) {\n                v._delayLoadingFunction(JSON.parse(b), v), v.delayLoadState = m.a.DELAYLOADSTATE_LOADED, v._delayInfo = [], l._removePendingData(v);\n                for (var D = v._meshes, w = D.length, N = 0; N < w; N++)\n                  v._applyToMesh(D[N]);\n                h && h();\n              }\n            }, void 0, !0));\n          }, g.prototype.toLeftHanded = function() {\n            var l = this.getIndices(!1);\n            if (l != null && l.length > 0) {\n              for (var h = 0; h < l.length; h += 3) {\n                var v = l[h + 0];\n                l[h + 0] = l[h + 2], l[h + 2] = v;\n              }\n              this.setIndices(l);\n            }\n            var b = this.getVerticesData(u.b.PositionKind, !1);\n            if (b != null && b.length > 0) {\n              for (h = 0; h < b.length; h += 3)\n                b[h + 2] = -b[h + 2];\n              this.setVerticesData(u.b.PositionKind, b, !1);\n            }\n            var D = this.getVerticesData(u.b.NormalKind, !1);\n            if (D != null && D.length > 0) {\n              for (h = 0; h < D.length; h += 3)\n                D[h + 2] = -D[h + 2];\n              this.setVerticesData(u.b.NormalKind, D, !1);\n            }\n          }, g.prototype._resetPointsArrayCache = function() {\n            this._positions = null;\n          }, g.prototype._generatePointsArray = function() {\n            if (this._positions)\n              return !0;\n            var l = this.getVerticesData(u.b.PositionKind);\n            if (!l || l.length === 0)\n              return !1;\n            for (var h = 3 * this._positionsCache.length, v = this._positionsCache.length; h < l.length; h += 3, ++v)\n              this._positionsCache[v] = V.e.FromArray(l, h);\n            for (h = 0, v = 0; h < l.length; h += 3, ++v)\n              this._positionsCache[v].set(l[0 + h], l[1 + h], l[2 + h]);\n            return this._positionsCache.length = l.length / 3, this._positions = this._positionsCache, !0;\n          }, g.prototype.isDisposed = function() {\n            return this._isDisposed;\n          }, g.prototype._disposeVertexArrayObjects = function() {\n            if (this._vertexArrayObjects) {\n              for (var l in this._vertexArrayObjects)\n                this._engine.releaseVertexArrayObject(this._vertexArrayObjects[l]);\n              this._vertexArrayObjects = {};\n            }\n          }, g.prototype.dispose = function() {\n            var l, h = this._meshes, v = h.length;\n            for (l = 0; l < v; l++)\n              this.releaseForMesh(h[l]);\n            for (var b in this._meshes = [], this._disposeVertexArrayObjects(), this._vertexBuffers)\n              this._vertexBuffers[b].dispose();\n            this._vertexBuffers = {}, this._totalVertices = 0, this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null, this._indices = [], this.delayLoadState = m.a.DELAYLOADSTATE_NONE, this.delayLoadingFile = null, this._delayLoadingFunction = null, this._delayInfo = [], this._boundingInfo = null, this._scene.removeGeometry(this), this._isDisposed = !0;\n          }, g.prototype.copy = function(l) {\n            var h = new C.a();\n            h.indices = [];\n            var v = this.getIndices();\n            if (v)\n              for (var b = 0; b < v.length; b++)\n                h.indices.push(v[b]);\n            var D, w = !1, N = !1;\n            for (D in this._vertexBuffers) {\n              var M = this.getVerticesData(D);\n              if (M && (M instanceof Float32Array ? h.set(new Float32Array(M), D) : h.set(M.slice(0), D), !N)) {\n                var U = this.getVertexBuffer(D);\n                U && (N = !(w = U.isUpdatable()));\n              }\n            }\n            var X = new g(l, this._scene, h, w);\n            for (D in X.delayLoadState = this.delayLoadState, X.delayLoadingFile = this.delayLoadingFile, X._delayLoadingFunction = this._delayLoadingFunction, this._delayInfo)\n              X._delayInfo = X._delayInfo || [], X._delayInfo.push(D);\n            return X._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum), X;\n          }, g.prototype.serialize = function() {\n            var l = {};\n            return l.id = this.id, l.updatable = this._updatable, T.a && T.a.HasTags(this) && (l.tags = T.a.GetTags(this)), l;\n          }, g.prototype.toNumberArray = function(l) {\n            return Array.isArray(l) ? l : Array.prototype.slice.call(l);\n          }, g.prototype.serializeVerticeData = function() {\n            var l = this.serialize();\n            return this.isVerticesDataPresent(u.b.PositionKind) && (l.positions = this.toNumberArray(this.getVerticesData(u.b.PositionKind)), this.isVertexBufferUpdatable(u.b.PositionKind) && (l.positions._updatable = !0)), this.isVerticesDataPresent(u.b.NormalKind) && (l.normals = this.toNumberArray(this.getVerticesData(u.b.NormalKind)), this.isVertexBufferUpdatable(u.b.NormalKind) && (l.normals._updatable = !0)), this.isVerticesDataPresent(u.b.TangentKind) && (l.tangets = this.toNumberArray(this.getVerticesData(u.b.TangentKind)), this.isVertexBufferUpdatable(u.b.TangentKind) && (l.tangets._updatable = !0)), this.isVerticesDataPresent(u.b.UVKind) && (l.uvs = this.toNumberArray(this.getVerticesData(u.b.UVKind)), this.isVertexBufferUpdatable(u.b.UVKind) && (l.uvs._updatable = !0)), this.isVerticesDataPresent(u.b.UV2Kind) && (l.uv2s = this.toNumberArray(this.getVerticesData(u.b.UV2Kind)), this.isVertexBufferUpdatable(u.b.UV2Kind) && (l.uv2s._updatable = !0)), this.isVerticesDataPresent(u.b.UV3Kind) && (l.uv3s = this.toNumberArray(this.getVerticesData(u.b.UV3Kind)), this.isVertexBufferUpdatable(u.b.UV3Kind) && (l.uv3s._updatable = !0)), this.isVerticesDataPresent(u.b.UV4Kind) && (l.uv4s = this.toNumberArray(this.getVerticesData(u.b.UV4Kind)), this.isVertexBufferUpdatable(u.b.UV4Kind) && (l.uv4s._updatable = !0)), this.isVerticesDataPresent(u.b.UV5Kind) && (l.uv5s = this.toNumberArray(this.getVerticesData(u.b.UV5Kind)), this.isVertexBufferUpdatable(u.b.UV5Kind) && (l.uv5s._updatable = !0)), this.isVerticesDataPresent(u.b.UV6Kind) && (l.uv6s = this.toNumberArray(this.getVerticesData(u.b.UV6Kind)), this.isVertexBufferUpdatable(u.b.UV6Kind) && (l.uv6s._updatable = !0)), this.isVerticesDataPresent(u.b.ColorKind) && (l.colors = this.toNumberArray(this.getVerticesData(u.b.ColorKind)), this.isVertexBufferUpdatable(u.b.ColorKind) && (l.colors._updatable = !0)), this.isVerticesDataPresent(u.b.MatricesIndicesKind) && (l.matricesIndices = this.toNumberArray(this.getVerticesData(u.b.MatricesIndicesKind)), l.matricesIndices._isExpanded = !0, this.isVertexBufferUpdatable(u.b.MatricesIndicesKind) && (l.matricesIndices._updatable = !0)), this.isVerticesDataPresent(u.b.MatricesWeightsKind) && (l.matricesWeights = this.toNumberArray(this.getVerticesData(u.b.MatricesWeightsKind)), this.isVertexBufferUpdatable(u.b.MatricesWeightsKind) && (l.matricesWeights._updatable = !0)), l.indices = this.toNumberArray(this.getIndices()), l;\n          }, g.ExtractFromMesh = function(l, h) {\n            var v = l._geometry;\n            return v ? v.copy(h) : null;\n          }, g.RandomId = function() {\n            return c.b.RandomId();\n          }, g._ImportGeometry = function(l, h) {\n            var v = h.getScene(), b = l.geometryId;\n            if (b) {\n              var D = v.getGeometryByID(b);\n              D && D.applyToMesh(h);\n            } else if (l instanceof ArrayBuffer) {\n              var w = h._binaryInfo;\n              if (w.positionsAttrDesc && w.positionsAttrDesc.count > 0) {\n                var N = new Float32Array(l, w.positionsAttrDesc.offset, w.positionsAttrDesc.count);\n                h.setVerticesData(u.b.PositionKind, N, !1);\n              }\n              if (w.normalsAttrDesc && w.normalsAttrDesc.count > 0) {\n                var M = new Float32Array(l, w.normalsAttrDesc.offset, w.normalsAttrDesc.count);\n                h.setVerticesData(u.b.NormalKind, M, !1);\n              }\n              if (w.tangetsAttrDesc && w.tangetsAttrDesc.count > 0) {\n                var U = new Float32Array(l, w.tangetsAttrDesc.offset, w.tangetsAttrDesc.count);\n                h.setVerticesData(u.b.TangentKind, U, !1);\n              }\n              if (w.uvsAttrDesc && w.uvsAttrDesc.count > 0) {\n                var X = new Float32Array(l, w.uvsAttrDesc.offset, w.uvsAttrDesc.count);\n                h.setVerticesData(u.b.UVKind, X, !1);\n              }\n              if (w.uvs2AttrDesc && w.uvs2AttrDesc.count > 0) {\n                var j = new Float32Array(l, w.uvs2AttrDesc.offset, w.uvs2AttrDesc.count);\n                h.setVerticesData(u.b.UV2Kind, j, !1);\n              }\n              if (w.uvs3AttrDesc && w.uvs3AttrDesc.count > 0) {\n                var ne = new Float32Array(l, w.uvs3AttrDesc.offset, w.uvs3AttrDesc.count);\n                h.setVerticesData(u.b.UV3Kind, ne, !1);\n              }\n              if (w.uvs4AttrDesc && w.uvs4AttrDesc.count > 0) {\n                var te = new Float32Array(l, w.uvs4AttrDesc.offset, w.uvs4AttrDesc.count);\n                h.setVerticesData(u.b.UV4Kind, te, !1);\n              }\n              if (w.uvs5AttrDesc && w.uvs5AttrDesc.count > 0) {\n                var de = new Float32Array(l, w.uvs5AttrDesc.offset, w.uvs5AttrDesc.count);\n                h.setVerticesData(u.b.UV5Kind, de, !1);\n              }\n              if (w.uvs6AttrDesc && w.uvs6AttrDesc.count > 0) {\n                var pe = new Float32Array(l, w.uvs6AttrDesc.offset, w.uvs6AttrDesc.count);\n                h.setVerticesData(u.b.UV6Kind, pe, !1);\n              }\n              if (w.colorsAttrDesc && w.colorsAttrDesc.count > 0) {\n                var ae = new Float32Array(l, w.colorsAttrDesc.offset, w.colorsAttrDesc.count);\n                h.setVerticesData(u.b.ColorKind, ae, !1, w.colorsAttrDesc.stride);\n              }\n              if (w.matricesIndicesAttrDesc && w.matricesIndicesAttrDesc.count > 0) {\n                for (var ee = new Int32Array(l, w.matricesIndicesAttrDesc.offset, w.matricesIndicesAttrDesc.count), K = [], $ = 0; $ < ee.length; $++) {\n                  var L = ee[$];\n                  K.push(255 & L), K.push((65280 & L) >> 8), K.push((16711680 & L) >> 16), K.push(L >> 24 & 255);\n                }\n                h.setVerticesData(u.b.MatricesIndicesKind, K, !1);\n              }\n              if (w.matricesIndicesExtraAttrDesc && w.matricesIndicesExtraAttrDesc.count > 0) {\n                for (ee = new Int32Array(l, w.matricesIndicesExtraAttrDesc.offset, w.matricesIndicesExtraAttrDesc.count), K = [], $ = 0; $ < ee.length; $++)\n                  L = ee[$], K.push(255 & L), K.push((65280 & L) >> 8), K.push((16711680 & L) >> 16), K.push(L >> 24 & 255);\n                h.setVerticesData(u.b.MatricesIndicesExtraKind, K, !1);\n              }\n              if (w.matricesWeightsAttrDesc && w.matricesWeightsAttrDesc.count > 0) {\n                var G = new Float32Array(l, w.matricesWeightsAttrDesc.offset, w.matricesWeightsAttrDesc.count);\n                h.setVerticesData(u.b.MatricesWeightsKind, G, !1);\n              }\n              if (w.indicesAttrDesc && w.indicesAttrDesc.count > 0) {\n                var Q = new Int32Array(l, w.indicesAttrDesc.offset, w.indicesAttrDesc.count);\n                h.setIndices(Q, null);\n              }\n              if (w.subMeshesAttrDesc && w.subMeshesAttrDesc.count > 0) {\n                var oe = new Int32Array(l, w.subMeshesAttrDesc.offset, 5 * w.subMeshesAttrDesc.count);\n                for (h.subMeshes = [], $ = 0; $ < w.subMeshesAttrDesc.count; $++) {\n                  var re = oe[5 * $ + 0], Y = oe[5 * $ + 1], k = oe[5 * $ + 2], H = oe[5 * $ + 3], Z = oe[5 * $ + 4];\n                  I.a.AddToMesh(re, Y, k, H, Z, h);\n                }\n              }\n            } else if (l.positions && l.normals && l.indices) {\n              if (h.setVerticesData(u.b.PositionKind, l.positions, l.positions._updatable), h.setVerticesData(u.b.NormalKind, l.normals, l.normals._updatable), l.tangents && h.setVerticesData(u.b.TangentKind, l.tangents, l.tangents._updatable), l.uvs && h.setVerticesData(u.b.UVKind, l.uvs, l.uvs._updatable), l.uvs2 && h.setVerticesData(u.b.UV2Kind, l.uvs2, l.uvs2._updatable), l.uvs3 && h.setVerticesData(u.b.UV3Kind, l.uvs3, l.uvs3._updatable), l.uvs4 && h.setVerticesData(u.b.UV4Kind, l.uvs4, l.uvs4._updatable), l.uvs5 && h.setVerticesData(u.b.UV5Kind, l.uvs5, l.uvs5._updatable), l.uvs6 && h.setVerticesData(u.b.UV6Kind, l.uvs6, l.uvs6._updatable), l.colors && h.setVerticesData(u.b.ColorKind, _.b.CheckColors4(l.colors, l.positions.length / 3), l.colors._updatable), l.matricesIndices)\n                if (l.matricesIndices._isExpanded)\n                  delete l.matricesIndices._isExpanded, h.setVerticesData(u.b.MatricesIndicesKind, l.matricesIndices, l.matricesIndices._updatable);\n                else {\n                  for (K = [], $ = 0; $ < l.matricesIndices.length; $++) {\n                    var W = l.matricesIndices[$];\n                    K.push(255 & W), K.push((65280 & W) >> 8), K.push((16711680 & W) >> 16), K.push(W >> 24 & 255);\n                  }\n                  h.setVerticesData(u.b.MatricesIndicesKind, K, l.matricesIndices._updatable);\n                }\n              if (l.matricesIndicesExtra)\n                if (l.matricesIndicesExtra._isExpanded)\n                  delete l.matricesIndices._isExpanded, h.setVerticesData(u.b.MatricesIndicesExtraKind, l.matricesIndicesExtra, l.matricesIndicesExtra._updatable);\n                else {\n                  for (K = [], $ = 0; $ < l.matricesIndicesExtra.length; $++)\n                    W = l.matricesIndicesExtra[$], K.push(255 & W), K.push((65280 & W) >> 8), K.push((16711680 & W) >> 16), K.push(W >> 24 & 255);\n                  h.setVerticesData(u.b.MatricesIndicesExtraKind, K, l.matricesIndicesExtra._updatable);\n                }\n              l.matricesWeights && (g._CleanMatricesWeights(l, h), h.setVerticesData(u.b.MatricesWeightsKind, l.matricesWeights, l.matricesWeights._updatable)), l.matricesWeightsExtra && h.setVerticesData(u.b.MatricesWeightsExtraKind, l.matricesWeightsExtra, l.matricesWeights._updatable), h.setIndices(l.indices, null);\n            }\n            if (l.subMeshes) {\n              h.subMeshes = [];\n              for (var q = 0; q < l.subMeshes.length; q++) {\n                var he = l.subMeshes[q];\n                I.a.AddToMesh(he.materialIndex, he.verticesStart, he.verticesCount, he.indexStart, he.indexCount, h);\n              }\n            }\n            h._shouldGenerateFlatShading && (h.convertToFlatShadedMesh(), h._shouldGenerateFlatShading = !1), h.computeWorldMatrix(!0), v.onMeshImportedObservable.notifyObservers(h);\n          }, g._CleanMatricesWeights = function(l, h) {\n            if (O.a.CleanBoneMatrixWeights) {\n              var v = 0;\n              if (l.skeletonId > -1) {\n                var b = h.getScene().getLastSkeletonByID(l.skeletonId);\n                if (b) {\n                  v = b.bones.length;\n                  for (var D = h.getVerticesData(u.b.MatricesIndicesKind), w = h.getVerticesData(u.b.MatricesIndicesExtraKind), N = l.matricesWeights, M = l.matricesWeightsExtra, U = l.numBoneInfluencer, X = N.length, j = 0; j < X; j += 4) {\n                    for (var ne = 0, te = -1, de = 0; de < 4; de++)\n                      ne += pe = N[j + de], pe < 1e-3 && te < 0 && (te = de);\n                    if (M)\n                      for (de = 0; de < 4; de++) {\n                        var pe;\n                        ne += pe = M[j + de], pe < 1e-3 && te < 0 && (te = de + 4);\n                      }\n                    if ((te < 0 || te > U - 1) && (te = U - 1), ne > 1e-3) {\n                      var ae = 1 / ne;\n                      for (de = 0; de < 4; de++)\n                        N[j + de] *= ae;\n                      if (M)\n                        for (de = 0; de < 4; de++)\n                          M[j + de] *= ae;\n                    } else\n                      te >= 4 ? (M[j + te - 4] = 1 - ne, w[j + te - 4] = v) : (N[j + te] = 1 - ne, D[j + te] = v);\n                  }\n                  h.setVerticesData(u.b.MatricesIndicesKind, D), l.matricesWeightsExtra && h.setVerticesData(u.b.MatricesIndicesExtraKind, w);\n                }\n              }\n            }\n          }, g.Parse = function(l, h, v) {\n            if (h.getGeometryByID(l.id))\n              return null;\n            var b = new g(l.id, h, void 0, l.updatable);\n            return T.a && T.a.AddTagsTo(b, l.tags), l.delayLoadingFile ? (b.delayLoadState = m.a.DELAYLOADSTATE_NOTLOADED, b.delayLoadingFile = v + l.delayLoadingFile, b._boundingInfo = new x.a(V.e.FromArray(l.boundingBoxMinimum), V.e.FromArray(l.boundingBoxMaximum)), b._delayInfo = [], l.hasUVs && b._delayInfo.push(u.b.UVKind), l.hasUVs2 && b._delayInfo.push(u.b.UV2Kind), l.hasUVs3 && b._delayInfo.push(u.b.UV3Kind), l.hasUVs4 && b._delayInfo.push(u.b.UV4Kind), l.hasUVs5 && b._delayInfo.push(u.b.UV5Kind), l.hasUVs6 && b._delayInfo.push(u.b.UV6Kind), l.hasColors && b._delayInfo.push(u.b.ColorKind), l.hasMatricesIndices && b._delayInfo.push(u.b.MatricesIndicesKind), l.hasMatricesWeights && b._delayInfo.push(u.b.MatricesWeightsKind), b._delayLoadingFunction = C.a.ImportVertexData) : C.a.ImportVertexData(l, b), h.pushGeometry(b, !0), b;\n          }, g;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"e\", function() {\n          return V;\n        }), f.d(A, \"c\", function() {\n          return I;\n        }), f.d(A, \"a\", function() {\n          return O;\n        }), f.d(A, \"b\", function() {\n          return x;\n        }), f.d(A, \"f\", function() {\n          return m;\n        }), f.d(A, \"g\", function() {\n          return c;\n        }), f.d(A, \"d\", function() {\n          return T;\n        });\n        var V, _ = f(14), C = f(0), u = f(28);\n        (function(S) {\n          S[S.CW = 0] = \"CW\", S[S.CCW = 1] = \"CCW\";\n        })(V || (V = {}));\n        var I = function() {\n          function S() {\n          }\n          return S.Interpolate = function(E, g, l, h, v) {\n            for (var b = 1 - 3 * h + 3 * g, D = 3 * h - 6 * g, w = 3 * g, N = E, M = 0; M < 5; M++) {\n              var U = N * N;\n              N -= (b * (U * N) + D * U + w * N - E) * (1 / (3 * b * U + 2 * D * N + w)), N = Math.min(1, Math.max(0, N));\n            }\n            return 3 * Math.pow(1 - N, 2) * N * l + 3 * (1 - N) * Math.pow(N, 2) * v + Math.pow(N, 3);\n          }, S;\n        }(), O = function() {\n          function S(E) {\n            this._radians = E, this._radians < 0 && (this._radians += 2 * Math.PI);\n          }\n          return S.prototype.degrees = function() {\n            return 180 * this._radians / Math.PI;\n          }, S.prototype.radians = function() {\n            return this._radians;\n          }, S.BetweenTwoPoints = function(E, g) {\n            var l = g.subtract(E);\n            return new S(Math.atan2(l.y, l.x));\n          }, S.FromRadians = function(E) {\n            return new S(E);\n          }, S.FromDegrees = function(E) {\n            return new S(E * Math.PI / 180);\n          }, S;\n        }(), x = function(S, E, g) {\n          this.startPoint = S, this.midPoint = E, this.endPoint = g;\n          var l = Math.pow(E.x, 2) + Math.pow(E.y, 2), h = (Math.pow(S.x, 2) + Math.pow(S.y, 2) - l) / 2, v = (l - Math.pow(g.x, 2) - Math.pow(g.y, 2)) / 2, b = (S.x - E.x) * (E.y - g.y) - (E.x - g.x) * (S.y - E.y);\n          this.centerPoint = new C.d((h * (E.y - g.y) - v * (S.y - E.y)) / b, ((S.x - E.x) * v - (E.x - g.x) * h) / b), this.radius = this.centerPoint.subtract(this.startPoint).length(), this.startAngle = O.BetweenTwoPoints(this.centerPoint, this.startPoint);\n          var D = this.startAngle.degrees(), w = O.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(), N = O.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees();\n          w - D > 180 && (w -= 360), w - D < -180 && (w += 360), N - w > 180 && (N -= 360), N - w < -180 && (N += 360), this.orientation = w - D < 0 ? V.CW : V.CCW, this.angle = O.FromDegrees(this.orientation === V.CW ? D - N : N - D);\n        }, m = function() {\n          function S(E, g) {\n            this._points = new Array(), this._length = 0, this.closed = !1, this._points.push(new C.d(E, g));\n          }\n          return S.prototype.addLineTo = function(E, g) {\n            if (this.closed)\n              return this;\n            var l = new C.d(E, g), h = this._points[this._points.length - 1];\n            return this._points.push(l), this._length += l.subtract(h).length(), this;\n          }, S.prototype.addArcTo = function(E, g, l, h, v) {\n            if (v === void 0 && (v = 36), this.closed)\n              return this;\n            var b = this._points[this._points.length - 1], D = new C.d(E, g), w = new C.d(l, h), N = new x(b, D, w), M = N.angle.radians() / v;\n            N.orientation === V.CW && (M *= -1);\n            for (var U = N.startAngle.radians() + M, X = 0; X < v; X++) {\n              var j = Math.cos(U) * N.radius + N.centerPoint.x, ne = Math.sin(U) * N.radius + N.centerPoint.y;\n              this.addLineTo(j, ne), U += M;\n            }\n            return this;\n          }, S.prototype.close = function() {\n            return this.closed = !0, this;\n          }, S.prototype.length = function() {\n            var E = this._length;\n            if (this.closed) {\n              var g = this._points[this._points.length - 1];\n              E += this._points[0].subtract(g).length();\n            }\n            return E;\n          }, S.prototype.getPoints = function() {\n            return this._points;\n          }, S.prototype.getPointAtLengthPosition = function(E) {\n            if (E < 0 || E > 1)\n              return C.d.Zero();\n            for (var g = E * this.length(), l = 0, h = 0; h < this._points.length; h++) {\n              var v = (h + 1) % this._points.length, b = this._points[h], D = this._points[v].subtract(b), w = D.length() + l;\n              if (g >= l && g <= w) {\n                var N = D.normalize(), M = g - l;\n                return new C.d(b.x + N.x * M, b.y + N.y * M);\n              }\n              l = w;\n            }\n            return C.d.Zero();\n          }, S.StartingAt = function(E, g) {\n            return new S(E, g);\n          }, S;\n        }(), c = function() {\n          function S(E, g, l, h) {\n            g === void 0 && (g = null), h === void 0 && (h = !1), this.path = E, this._curve = new Array(), this._distances = new Array(), this._tangents = new Array(), this._normals = new Array(), this._binormals = new Array(), this._pointAtData = { id: 0, point: C.e.Zero(), previousPointArrayIndex: 0, position: 0, subPosition: 0, interpolateReady: !1, interpolationMatrix: C.a.Identity() };\n            for (var v = 0; v < E.length; v++)\n              this._curve[v] = E[v].clone();\n            this._raw = l || !1, this._alignTangentsWithPath = h, this._compute(g, h);\n          }\n          return S.prototype.getCurve = function() {\n            return this._curve;\n          }, S.prototype.getPoints = function() {\n            return this._curve;\n          }, S.prototype.length = function() {\n            return this._distances[this._distances.length - 1];\n          }, S.prototype.getTangents = function() {\n            return this._tangents;\n          }, S.prototype.getNormals = function() {\n            return this._normals;\n          }, S.prototype.getBinormals = function() {\n            return this._binormals;\n          }, S.prototype.getDistances = function() {\n            return this._distances;\n          }, S.prototype.getPointAt = function(E) {\n            return this._updatePointAtData(E).point;\n          }, S.prototype.getTangentAt = function(E, g) {\n            return g === void 0 && (g = !1), this._updatePointAtData(E, g), g ? C.e.TransformCoordinates(C.e.Forward(), this._pointAtData.interpolationMatrix) : this._tangents[this._pointAtData.previousPointArrayIndex];\n          }, S.prototype.getNormalAt = function(E, g) {\n            return g === void 0 && (g = !1), this._updatePointAtData(E, g), g ? C.e.TransformCoordinates(C.e.Right(), this._pointAtData.interpolationMatrix) : this._normals[this._pointAtData.previousPointArrayIndex];\n          }, S.prototype.getBinormalAt = function(E, g) {\n            return g === void 0 && (g = !1), this._updatePointAtData(E, g), g ? C.e.TransformCoordinates(C.e.UpReadOnly, this._pointAtData.interpolationMatrix) : this._binormals[this._pointAtData.previousPointArrayIndex];\n          }, S.prototype.getDistanceAt = function(E) {\n            return this.length() * E;\n          }, S.prototype.getPreviousPointIndexAt = function(E) {\n            return this._updatePointAtData(E), this._pointAtData.previousPointArrayIndex;\n          }, S.prototype.getSubPositionAt = function(E) {\n            return this._updatePointAtData(E), this._pointAtData.subPosition;\n          }, S.prototype.getClosestPositionTo = function(E) {\n            for (var g = Number.MAX_VALUE, l = 0, h = 0; h < this._curve.length - 1; h++) {\n              var v = this._curve[h + 0], b = this._curve[h + 1].subtract(v).normalize(), D = this._distances[h + 1] - this._distances[h + 0], w = Math.min(Math.max(C.e.Dot(b, E.subtract(v).normalize()), 0) * C.e.Distance(v, E) / D, 1), N = C.e.Distance(v.add(b.scale(w * D)), E);\n              N < g && (g = N, l = (this._distances[h + 0] + D * w) / this.length());\n            }\n            return l;\n          }, S.prototype.slice = function(E, g) {\n            if (E === void 0 && (E = 0), g === void 0 && (g = 1), E < 0 && (E = 1 - -1 * E % 1), g < 0 && (g = 1 - -1 * g % 1), E > g) {\n              var l = E;\n              E = g, g = l;\n            }\n            var h = this.getCurve(), v = this.getPointAt(E), b = this.getPreviousPointIndexAt(E), D = this.getPointAt(g), w = this.getPreviousPointIndexAt(g) + 1, N = [];\n            return E !== 0 && (b++, N.push(v)), N.push.apply(N, h.slice(b, w)), g === 1 && E !== 1 || N.push(D), new S(N, this.getNormalAt(E), this._raw, this._alignTangentsWithPath);\n          }, S.prototype.update = function(E, g, l) {\n            g === void 0 && (g = null), l === void 0 && (l = !1);\n            for (var h = 0; h < E.length; h++)\n              this._curve[h].x = E[h].x, this._curve[h].y = E[h].y, this._curve[h].z = E[h].z;\n            return this._compute(g, l), this;\n          }, S.prototype._compute = function(E, g) {\n            g === void 0 && (g = !1);\n            var l = this._curve.length;\n            if (!(l < 2)) {\n              this._tangents[0] = this._getFirstNonNullVector(0), this._raw || this._tangents[0].normalize(), this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]), this._raw || this._tangents[l - 1].normalize();\n              var h, v, b, D, w, N = this._tangents[0], M = this._normalVector(N, E);\n              this._normals[0] = M, this._raw || this._normals[0].normalize(), this._binormals[0] = C.e.Cross(N, this._normals[0]), this._raw || this._binormals[0].normalize(), this._distances[0] = 0;\n              for (var U = 1; U < l; U++)\n                h = this._getLastNonNullVector(U), U < l - 1 && (v = this._getFirstNonNullVector(U), this._tangents[U] = g ? v : h.add(v), this._tangents[U].normalize()), this._distances[U] = this._distances[U - 1] + this._curve[U].subtract(this._curve[U - 1]).length(), b = this._tangents[U], w = this._binormals[U - 1], this._normals[U] = C.e.Cross(w, b), this._raw || (this._normals[U].length() === 0 ? (D = this._normals[U - 1], this._normals[U] = D.clone()) : this._normals[U].normalize()), this._binormals[U] = C.e.Cross(b, this._normals[U]), this._raw || this._binormals[U].normalize();\n              this._pointAtData.id = NaN;\n            }\n          }, S.prototype._getFirstNonNullVector = function(E) {\n            for (var g = 1, l = this._curve[E + g].subtract(this._curve[E]); l.length() === 0 && E + g + 1 < this._curve.length; )\n              g++, l = this._curve[E + g].subtract(this._curve[E]);\n            return l;\n          }, S.prototype._getLastNonNullVector = function(E) {\n            for (var g = 1, l = this._curve[E].subtract(this._curve[E - g]); l.length() === 0 && E > g + 1; )\n              g++, l = this._curve[E].subtract(this._curve[E - g]);\n            return l;\n          }, S.prototype._normalVector = function(E, g) {\n            var l, h, v = E.length();\n            return v === 0 && (v = 1), g == null ? (h = _.a.WithinEpsilon(Math.abs(E.y) / v, 1, u.a) ? _.a.WithinEpsilon(Math.abs(E.x) / v, 1, u.a) ? _.a.WithinEpsilon(Math.abs(E.z) / v, 1, u.a) ? C.e.Zero() : new C.e(0, 0, 1) : new C.e(1, 0, 0) : new C.e(0, -1, 0), l = C.e.Cross(E, h)) : (l = C.e.Cross(E, g), C.e.CrossToRef(l, E, l)), l.normalize(), l;\n          }, S.prototype._updatePointAtData = function(E, g) {\n            if (g === void 0 && (g = !1), this._pointAtData.id === E)\n              return this._pointAtData.interpolateReady || this._updateInterpolationMatrix(), this._pointAtData;\n            this._pointAtData.id = E;\n            var l = this.getPoints();\n            if (E <= 0)\n              return this._setPointAtData(0, 0, l[0], 0, g);\n            if (E >= 1)\n              return this._setPointAtData(1, 1, l[l.length - 1], l.length - 1, g);\n            for (var h, v = l[0], b = 0, D = E * this.length(), w = 1; w < l.length; w++) {\n              h = l[w];\n              var N = C.e.Distance(v, h);\n              if ((b += N) === D)\n                return this._setPointAtData(E, 1, h, w, g);\n              if (b > D) {\n                var M = (b - D) / N, U = v.subtract(h), X = h.add(U.scaleInPlace(M));\n                return this._setPointAtData(E, 1 - M, X, w - 1, g);\n              }\n              v = h;\n            }\n            return this._pointAtData;\n          }, S.prototype._setPointAtData = function(E, g, l, h, v) {\n            return this._pointAtData.point = l, this._pointAtData.position = E, this._pointAtData.subPosition = g, this._pointAtData.previousPointArrayIndex = h, this._pointAtData.interpolateReady = v, v && this._updateInterpolationMatrix(), this._pointAtData;\n          }, S.prototype._updateInterpolationMatrix = function() {\n            this._pointAtData.interpolationMatrix = C.a.Identity();\n            var E = this._pointAtData.previousPointArrayIndex;\n            if (E !== this._tangents.length - 1) {\n              var g = E + 1, l = this._tangents[E].clone(), h = this._normals[E].clone(), v = this._binormals[E].clone(), b = this._tangents[g].clone(), D = this._normals[g].clone(), w = this._binormals[g].clone(), N = C.b.RotationQuaternionFromAxis(h, v, l), M = C.b.RotationQuaternionFromAxis(D, w, b);\n              C.b.Slerp(N, M, this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix);\n            }\n          }, S;\n        }(), T = function() {\n          function S(E) {\n            this._length = 0, this._points = E, this._length = this._computeLength(E);\n          }\n          return S.CreateQuadraticBezier = function(E, g, l, h) {\n            h = h > 2 ? h : 3;\n            for (var v = new Array(), b = function(w, N, M, U) {\n              return (1 - w) * (1 - w) * N + 2 * w * (1 - w) * M + w * w * U;\n            }, D = 0; D <= h; D++)\n              v.push(new C.e(b(D / h, E.x, g.x, l.x), b(D / h, E.y, g.y, l.y), b(D / h, E.z, g.z, l.z)));\n            return new S(v);\n          }, S.CreateCubicBezier = function(E, g, l, h, v) {\n            v = v > 3 ? v : 4;\n            for (var b = new Array(), D = function(N, M, U, X, j) {\n              return (1 - N) * (1 - N) * (1 - N) * M + 3 * N * (1 - N) * (1 - N) * U + 3 * N * N * (1 - N) * X + N * N * N * j;\n            }, w = 0; w <= v; w++)\n              b.push(new C.e(D(w / v, E.x, g.x, l.x, h.x), D(w / v, E.y, g.y, l.y, h.y), D(w / v, E.z, g.z, l.z, h.z)));\n            return new S(b);\n          }, S.CreateHermiteSpline = function(E, g, l, h, v) {\n            for (var b = new Array(), D = 1 / v, w = 0; w <= v; w++)\n              b.push(C.e.Hermite(E, g, l, h, w * D));\n            return new S(b);\n          }, S.CreateCatmullRomSpline = function(E, g, l) {\n            var h = new Array(), v = 1 / g, b = 0;\n            if (l) {\n              for (var D = E.length, w = 0; w < D; w++) {\n                b = 0;\n                for (var N = 0; N < g; N++)\n                  h.push(C.e.CatmullRom(E[w % D], E[(w + 1) % D], E[(w + 2) % D], E[(w + 3) % D], b)), b += v;\n              }\n              h.push(h[0]);\n            } else {\n              var M = new Array();\n              for (M.push(E[0].clone()), Array.prototype.push.apply(M, E), M.push(E[E.length - 1].clone()), w = 0; w < M.length - 3; w++)\n                for (b = 0, N = 0; N < g; N++)\n                  h.push(C.e.CatmullRom(M[w], M[w + 1], M[w + 2], M[w + 3], b)), b += v;\n              w--, h.push(C.e.CatmullRom(M[w], M[w + 1], M[w + 2], M[w + 3], b));\n            }\n            return new S(h);\n          }, S.prototype.getPoints = function() {\n            return this._points;\n          }, S.prototype.length = function() {\n            return this._length;\n          }, S.prototype.continue = function(E) {\n            for (var g = this._points[this._points.length - 1], l = this._points.slice(), h = E.getPoints(), v = 1; v < h.length; v++)\n              l.push(h[v].subtract(h[0]).add(g));\n            return new S(l);\n          }, S.prototype._computeLength = function(E) {\n            for (var g = 0, l = 1; l < E.length; l++)\n              g += E[l].subtract(E[l - 1]).length();\n            return g;\n          }, S;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return l;\n        });\n        var V = f(1), _ = f(3), C = f(0), u = f(4), I = f(10), O = f(15), x = f(25), m = f(11), c = f(9), T = f(67), S = f(49), E = f(13), g = { effect: null, subMesh: null }, l = function(h) {\n          function v(b, D, w, N) {\n            N === void 0 && (N = {});\n            var M = h.call(this, b, D) || this;\n            return M._textures = {}, M._textureArrays = {}, M._floats = {}, M._ints = {}, M._floatsArrays = {}, M._colors3 = {}, M._colors3Arrays = {}, M._colors4 = {}, M._colors4Arrays = {}, M._vectors2 = {}, M._vectors3 = {}, M._vectors4 = {}, M._matrices = {}, M._matrixArrays = {}, M._matrices3x3 = {}, M._matrices2x2 = {}, M._vectors2Arrays = {}, M._vectors3Arrays = {}, M._vectors4Arrays = {}, M._cachedWorldViewMatrix = new C.a(), M._cachedWorldViewProjectionMatrix = new C.a(), M._multiview = !1, M._shaderPath = w, M._options = Object(V.a)({ needAlphaBlending: !1, needAlphaTesting: !1, attributes: [\"position\", \"normal\", \"uv\"], uniforms: [\"worldViewProjection\"], uniformBuffers: [], samplers: [], defines: [] }, N), M;\n          }\n          return Object(V.d)(v, h), Object.defineProperty(v.prototype, \"shaderPath\", { get: function() {\n            return this._shaderPath;\n          }, set: function(b) {\n            this._shaderPath = b;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"options\", { get: function() {\n            return this._options;\n          }, enumerable: !1, configurable: !0 }), v.prototype.getClassName = function() {\n            return \"ShaderMaterial\";\n          }, v.prototype.needAlphaBlending = function() {\n            return this.alpha < 1 || this._options.needAlphaBlending;\n          }, v.prototype.needAlphaTesting = function() {\n            return this._options.needAlphaTesting;\n          }, v.prototype._checkUniform = function(b) {\n            this._options.uniforms.indexOf(b) === -1 && this._options.uniforms.push(b);\n          }, v.prototype.setTexture = function(b, D) {\n            return this._options.samplers.indexOf(b) === -1 && this._options.samplers.push(b), this._textures[b] = D, this;\n          }, v.prototype.setTextureArray = function(b, D) {\n            return this._options.samplers.indexOf(b) === -1 && this._options.samplers.push(b), this._checkUniform(b), this._textureArrays[b] = D, this;\n          }, v.prototype.setFloat = function(b, D) {\n            return this._checkUniform(b), this._floats[b] = D, this;\n          }, v.prototype.setInt = function(b, D) {\n            return this._checkUniform(b), this._ints[b] = D, this;\n          }, v.prototype.setFloats = function(b, D) {\n            return this._checkUniform(b), this._floatsArrays[b] = D, this;\n          }, v.prototype.setColor3 = function(b, D) {\n            return this._checkUniform(b), this._colors3[b] = D, this;\n          }, v.prototype.setColor3Array = function(b, D) {\n            return this._checkUniform(b), this._colors3Arrays[b] = D.reduce(function(w, N) {\n              return N.toArray(w, w.length), w;\n            }, []), this;\n          }, v.prototype.setColor4 = function(b, D) {\n            return this._checkUniform(b), this._colors4[b] = D, this;\n          }, v.prototype.setColor4Array = function(b, D) {\n            return this._checkUniform(b), this._colors4Arrays[b] = D.reduce(function(w, N) {\n              return N.toArray(w, w.length), w;\n            }, []), this;\n          }, v.prototype.setVector2 = function(b, D) {\n            return this._checkUniform(b), this._vectors2[b] = D, this;\n          }, v.prototype.setVector3 = function(b, D) {\n            return this._checkUniform(b), this._vectors3[b] = D, this;\n          }, v.prototype.setVector4 = function(b, D) {\n            return this._checkUniform(b), this._vectors4[b] = D, this;\n          }, v.prototype.setMatrix = function(b, D) {\n            return this._checkUniform(b), this._matrices[b] = D, this;\n          }, v.prototype.setMatrices = function(b, D) {\n            this._checkUniform(b);\n            for (var w = new Float32Array(16 * D.length), N = 0; N < D.length; N++)\n              D[N].copyToArray(w, 16 * N);\n            return this._matrixArrays[b] = w, this;\n          }, v.prototype.setMatrix3x3 = function(b, D) {\n            return this._checkUniform(b), this._matrices3x3[b] = D, this;\n          }, v.prototype.setMatrix2x2 = function(b, D) {\n            return this._checkUniform(b), this._matrices2x2[b] = D, this;\n          }, v.prototype.setArray2 = function(b, D) {\n            return this._checkUniform(b), this._vectors2Arrays[b] = D, this;\n          }, v.prototype.setArray3 = function(b, D) {\n            return this._checkUniform(b), this._vectors3Arrays[b] = D, this;\n          }, v.prototype.setArray4 = function(b, D) {\n            return this._checkUniform(b), this._vectors4Arrays[b] = D, this;\n          }, v.prototype._checkCache = function(b, D) {\n            return !b || !this._effect || this._effect.defines.indexOf(\"#define INSTANCES\") !== -1 === D;\n          }, v.prototype.isReadyForSubMesh = function(b, D, w) {\n            return this.isReady(b, w);\n          }, v.prototype.isReady = function(b, D) {\n            var w, N;\n            if (this._effect && this.isFrozen && this._effect._wasPreviouslyReady)\n              return !0;\n            var M = this.getScene(), U = M.getEngine();\n            if (!this.checkReadyOnEveryCall && this._renderId === M.getRenderId() && this._checkCache(b, D))\n              return !0;\n            var X = [], j = [], ne = new T.a();\n            U.getCaps().multiview && M.activeCamera && M.activeCamera.outputRenderTarget && M.activeCamera.outputRenderTarget.getViewCount() > 1 && (this._multiview = !0, X.push(\"#define MULTIVIEW\"), this._options.uniforms.indexOf(\"viewProjection\") !== -1 && this._options.uniforms.push(\"viewProjectionR\") === -1 && this._options.uniforms.push(\"viewProjectionR\"));\n            for (var te = 0; te < this._options.defines.length; te++)\n              X.push(this._options.defines[te]);\n            for (te = 0; te < this._options.attributes.length; te++)\n              j.push(this._options.attributes[te]);\n            b && b.isVerticesDataPresent(u.b.ColorKind) && (j.push(u.b.ColorKind), X.push(\"#define VERTEXCOLOR\")), D && (X.push(\"#define INSTANCES\"), O.a.PushAttributesForInstances(j), b != null && b.hasThinInstances && X.push(\"#define THIN_INSTANCES\"));\n            var de = 0;\n            if (b && b.useBones && b.computeBonesUsingShaders && b.skeleton) {\n              j.push(u.b.MatricesIndicesKind), j.push(u.b.MatricesWeightsKind), b.numBoneInfluencers > 4 && (j.push(u.b.MatricesIndicesExtraKind), j.push(u.b.MatricesWeightsExtraKind));\n              var pe = b.skeleton;\n              de = b.numBoneInfluencers, X.push(\"#define NUM_BONE_INFLUENCERS \" + de), ne.addCPUSkinningFallback(0, b), pe.isUsingTextureForMatrices ? (X.push(\"#define BONETEXTURE\"), this._options.uniforms.indexOf(\"boneTextureWidth\") === -1 && this._options.uniforms.push(\"boneTextureWidth\"), this._options.samplers.indexOf(\"boneSampler\") === -1 && this._options.samplers.push(\"boneSampler\")) : (X.push(\"#define BonesPerMesh \" + (pe.bones.length + 1)), this._options.uniforms.indexOf(\"mBones\") === -1 && this._options.uniforms.push(\"mBones\"));\n            } else\n              X.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            for (var ae in this._textures)\n              if (!this._textures[ae].isReady())\n                return !1;\n            b && this._shouldTurnAlphaTestOn(b) && X.push(\"#define ALPHATEST\");\n            var ee = this._shaderPath, K = this._options.uniforms, $ = this._options.uniformBuffers, L = this._options.samplers;\n            this.customShaderNameResolve && (K = K.slice(), $ = $.slice(), L = L.slice(), ee = this.customShaderNameResolve(ee, K, $, L, X, j));\n            var G = this._effect, Q = X.join(`\n`);\n            return this._cachedDefines !== Q && (this._cachedDefines = Q, this._effect = U.createEffect(ee, { attributes: j, uniformsNames: K, uniformBuffersNames: $, samplers: L, defines: Q, fallbacks: ne, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousMorphTargets: de } }, U), this._onEffectCreatedObservable && (g.effect = this._effect, this._onEffectCreatedObservable.notifyObservers(g))), (N = !(!((w = this._effect) === null || w === void 0) && w.isReady())) !== null && N !== void 0 && !N && (G !== this._effect && M.resetCachedMaterial(), this._renderId = M.getRenderId(), this._effect._wasPreviouslyReady = !0, !0);\n          }, v.prototype.bindOnlyWorldMatrix = function(b, D) {\n            var w = this.getScene(), N = D ?? this._effect;\n            N && (this._options.uniforms.indexOf(\"world\") !== -1 && N.setMatrix(\"world\", b), this._options.uniforms.indexOf(\"worldView\") !== -1 && (b.multiplyToRef(w.getViewMatrix(), this._cachedWorldViewMatrix), N.setMatrix(\"worldView\", this._cachedWorldViewMatrix)), this._options.uniforms.indexOf(\"worldViewProjection\") !== -1 && (b.multiplyToRef(w.getTransformMatrix(), this._cachedWorldViewProjectionMatrix), N.setMatrix(\"worldViewProjection\", this._cachedWorldViewProjectionMatrix)));\n          }, v.prototype.bindForSubMesh = function(b, D, w) {\n            this.bind(b, D, w._effectOverride);\n          }, v.prototype.bind = function(b, D, w) {\n            this.bindOnlyWorldMatrix(b, w);\n            var N = w ?? this._effect;\n            if (N && this.getScene().getCachedMaterial() !== this) {\n              var M;\n              for (M in this._options.uniforms.indexOf(\"view\") !== -1 && N.setMatrix(\"view\", this.getScene().getViewMatrix()), this._options.uniforms.indexOf(\"projection\") !== -1 && N.setMatrix(\"projection\", this.getScene().getProjectionMatrix()), this._options.uniforms.indexOf(\"viewProjection\") !== -1 && (N.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix()), this._multiview && N.setMatrix(\"viewProjectionR\", this.getScene()._transformMatrixR)), this.getScene().activeCamera && this._options.uniforms.indexOf(\"cameraPosition\") !== -1 && N.setVector3(\"cameraPosition\", this.getScene().activeCamera.globalPosition), O.a.BindBonesParameters(D, N), this._textures)\n                N.setTexture(M, this._textures[M]);\n              for (M in this._textureArrays)\n                N.setTextureArray(M, this._textureArrays[M]);\n              for (M in this._ints)\n                N.setInt(M, this._ints[M]);\n              for (M in this._floats)\n                N.setFloat(M, this._floats[M]);\n              for (M in this._floatsArrays)\n                N.setArray(M, this._floatsArrays[M]);\n              for (M in this._colors3)\n                N.setColor3(M, this._colors3[M]);\n              for (M in this._colors3Arrays)\n                N.setArray3(M, this._colors3Arrays[M]);\n              for (M in this._colors4) {\n                var U = this._colors4[M];\n                N.setFloat4(M, U.r, U.g, U.b, U.a);\n              }\n              for (M in this._colors4Arrays)\n                N.setArray4(M, this._colors4Arrays[M]);\n              for (M in this._vectors2)\n                N.setVector2(M, this._vectors2[M]);\n              for (M in this._vectors3)\n                N.setVector3(M, this._vectors3[M]);\n              for (M in this._vectors4)\n                N.setVector4(M, this._vectors4[M]);\n              for (M in this._matrices)\n                N.setMatrix(M, this._matrices[M]);\n              for (M in this._matrixArrays)\n                N.setMatrices(M, this._matrixArrays[M]);\n              for (M in this._matrices3x3)\n                N.setMatrix3x3(M, this._matrices3x3[M]);\n              for (M in this._matrices2x2)\n                N.setMatrix2x2(M, this._matrices2x2[M]);\n              for (M in this._vectors2Arrays)\n                N.setArray2(M, this._vectors2Arrays[M]);\n              for (M in this._vectors3Arrays)\n                N.setArray3(M, this._vectors3Arrays[M]);\n              for (M in this._vectors4Arrays)\n                N.setArray4(M, this._vectors4Arrays[M]);\n            }\n            var X = this._effect;\n            this._effect = N, this._afterBind(D), this._effect = X;\n          }, v.prototype._afterBind = function(b) {\n            h.prototype._afterBind.call(this, b), this.getScene()._cachedEffect = this._effect;\n          }, v.prototype.getActiveTextures = function() {\n            var b = h.prototype.getActiveTextures.call(this);\n            for (var D in this._textures)\n              b.push(this._textures[D]);\n            for (var D in this._textureArrays)\n              for (var w = this._textureArrays[D], N = 0; N < w.length; N++)\n                b.push(w[N]);\n            return b;\n          }, v.prototype.hasTexture = function(b) {\n            if (h.prototype.hasTexture.call(this, b))\n              return !0;\n            for (var D in this._textures)\n              if (this._textures[D] === b)\n                return !0;\n            for (var D in this._textureArrays)\n              for (var w = this._textureArrays[D], N = 0; N < w.length; N++)\n                if (w[N] === b)\n                  return !0;\n            return !1;\n          }, v.prototype.clone = function(b) {\n            var D = this, w = _.a.Clone(function() {\n              return new v(b, D.getScene(), D._shaderPath, D._options);\n            }, this);\n            for (var N in w.name = b, w.id = b, typeof w._shaderPath == \"object\" && (w._shaderPath = Object(V.a)({}, w._shaderPath)), this._options = Object(V.a)({}, this._options), Object.keys(this._options).forEach(function(M) {\n              var U = D._options[M];\n              Array.isArray(U) && (D._options[M] = U.slice(0));\n            }), this._textures)\n              w.setTexture(N, this._textures[N]);\n            for (var N in this._floats)\n              w.setFloat(N, this._floats[N]);\n            for (var N in this._floatsArrays)\n              w.setFloats(N, this._floatsArrays[N]);\n            for (var N in this._colors3)\n              w.setColor3(N, this._colors3[N]);\n            for (var N in this._colors4)\n              w.setColor4(N, this._colors4[N]);\n            for (var N in this._vectors2)\n              w.setVector2(N, this._vectors2[N]);\n            for (var N in this._vectors3)\n              w.setVector3(N, this._vectors3[N]);\n            for (var N in this._vectors4)\n              w.setVector4(N, this._vectors4[N]);\n            for (var N in this._matrices)\n              w.setMatrix(N, this._matrices[N]);\n            for (var N in this._matrices3x3)\n              w.setMatrix3x3(N, this._matrices3x3[N]);\n            for (var N in this._matrices2x2)\n              w.setMatrix2x2(N, this._matrices2x2[N]);\n            return w;\n          }, v.prototype.dispose = function(b, D, w) {\n            if (D) {\n              var N;\n              for (N in this._textures)\n                this._textures[N].dispose();\n              for (N in this._textureArrays)\n                for (var M = this._textureArrays[N], U = 0; U < M.length; U++)\n                  M[U].dispose();\n            }\n            this._textures = {}, h.prototype.dispose.call(this, b, D, w);\n          }, v.prototype.serialize = function() {\n            var b, D = _.a.Serialize(this);\n            for (b in D.customType = \"BABYLON.ShaderMaterial\", D.options = this._options, D.shaderPath = this._shaderPath, D.textures = {}, this._textures)\n              D.textures[b] = this._textures[b].serialize();\n            for (b in D.textureArrays = {}, this._textureArrays) {\n              D.textureArrays[b] = [];\n              for (var w = this._textureArrays[b], N = 0; N < w.length; N++)\n                D.textureArrays[b].push(w[N].serialize());\n            }\n            for (b in D.floats = {}, this._floats)\n              D.floats[b] = this._floats[b];\n            for (b in D.FloatArrays = {}, this._floatsArrays)\n              D.FloatArrays[b] = this._floatsArrays[b];\n            for (b in D.colors3 = {}, this._colors3)\n              D.colors3[b] = this._colors3[b].asArray();\n            for (b in D.colors3Arrays = {}, this._colors3Arrays)\n              D.colors3Arrays[b] = this._colors3Arrays[b];\n            for (b in D.colors4 = {}, this._colors4)\n              D.colors4[b] = this._colors4[b].asArray();\n            for (b in D.colors4Arrays = {}, this._colors4Arrays)\n              D.colors4Arrays[b] = this._colors4Arrays[b];\n            for (b in D.vectors2 = {}, this._vectors2)\n              D.vectors2[b] = this._vectors2[b].asArray();\n            for (b in D.vectors3 = {}, this._vectors3)\n              D.vectors3[b] = this._vectors3[b].asArray();\n            for (b in D.vectors4 = {}, this._vectors4)\n              D.vectors4[b] = this._vectors4[b].asArray();\n            for (b in D.matrices = {}, this._matrices)\n              D.matrices[b] = this._matrices[b].asArray();\n            for (b in D.matrixArray = {}, this._matrixArrays)\n              D.matrixArray[b] = this._matrixArrays[b];\n            for (b in D.matrices3x3 = {}, this._matrices3x3)\n              D.matrices3x3[b] = this._matrices3x3[b];\n            for (b in D.matrices2x2 = {}, this._matrices2x2)\n              D.matrices2x2[b] = this._matrices2x2[b];\n            for (b in D.vectors2Arrays = {}, this._vectors2Arrays)\n              D.vectors2Arrays[b] = this._vectors2Arrays[b];\n            for (b in D.vectors3Arrays = {}, this._vectors3Arrays)\n              D.vectors3Arrays[b] = this._vectors3Arrays[b];\n            for (b in D.vectors4Arrays = {}, this._vectors4Arrays)\n              D.vectors4Arrays[b] = this._vectors4Arrays[b];\n            return D;\n          }, v.Parse = function(b, D, w) {\n            var N, M = _.a.Parse(function() {\n              return new v(b.name, D, b.shaderPath, b.options);\n            }, b, D, w);\n            for (N in b.textures)\n              M.setTexture(N, I.a.Parse(b.textures[N], D, w));\n            for (N in b.textureArrays) {\n              for (var U = b.textureArrays[N], X = new Array(), j = 0; j < U.length; j++)\n                X.push(I.a.Parse(U[j], D, w));\n              M.setTextureArray(N, X);\n            }\n            for (N in b.floats)\n              M.setFloat(N, b.floats[N]);\n            for (N in b.floatsArrays)\n              M.setFloats(N, b.floatsArrays[N]);\n            for (N in b.colors3)\n              M.setColor3(N, c.a.FromArray(b.colors3[N]));\n            for (N in b.colors3Arrays) {\n              var ne = b.colors3Arrays[N].reduce(function(te, de, pe) {\n                return pe % 3 == 0 ? te.push([de]) : te[te.length - 1].push(de), te;\n              }, []).map(function(te) {\n                return c.a.FromArray(te);\n              });\n              M.setColor3Array(N, ne);\n            }\n            for (N in b.colors4)\n              M.setColor4(N, c.b.FromArray(b.colors4[N]));\n            for (N in b.colors4Arrays)\n              ne = b.colors4Arrays[N].reduce(function(te, de, pe) {\n                return pe % 4 == 0 ? te.push([de]) : te[te.length - 1].push(de), te;\n              }, []).map(function(te) {\n                return c.b.FromArray(te);\n              }), M.setColor4Array(N, ne);\n            for (N in b.vectors2)\n              M.setVector2(N, C.d.FromArray(b.vectors2[N]));\n            for (N in b.vectors3)\n              M.setVector3(N, C.e.FromArray(b.vectors3[N]));\n            for (N in b.vectors4)\n              M.setVector4(N, C.f.FromArray(b.vectors4[N]));\n            for (N in b.matrices)\n              M.setMatrix(N, C.a.FromArray(b.matrices[N]));\n            for (N in b.matrixArray)\n              M._matrixArrays[N] = new Float32Array(b.matrixArray[N]);\n            for (N in b.matrices3x3)\n              M.setMatrix3x3(N, b.matrices3x3[N]);\n            for (N in b.matrices2x2)\n              M.setMatrix2x2(N, b.matrices2x2[N]);\n            for (N in b.vectors2Arrays)\n              M.setArray2(N, b.vectors2Arrays[N]);\n            for (N in b.vectors3Arrays)\n              M.setArray3(N, b.vectors3Arrays[N]);\n            for (N in b.vectors4Arrays)\n              M.setArray4(N, b.vectors4Arrays[N]);\n            return M;\n          }, v.ParseFromFileAsync = function(b, D, w, N) {\n            var M = this;\n            return N === void 0 && (N = \"\"), new Promise(function(U, X) {\n              var j = new S.a();\n              j.addEventListener(\"readystatechange\", function() {\n                if (j.readyState == 4)\n                  if (j.status == 200) {\n                    var ne = JSON.parse(j.responseText), te = M.Parse(ne, w || E.a.LastCreatedScene, N);\n                    b && (te.name = b), U(te);\n                  } else\n                    X(\"Unable to load the ShaderMaterial\");\n              }), j.open(\"GET\", D), j.send();\n            });\n          }, v.CreateFromSnippetAsync = function(b, D, w) {\n            var N = this;\n            return w === void 0 && (w = \"\"), new Promise(function(M, U) {\n              var X = new S.a();\n              X.addEventListener(\"readystatechange\", function() {\n                if (X.readyState == 4)\n                  if (X.status == 200) {\n                    var j = JSON.parse(JSON.parse(X.responseText).jsonPayload), ne = JSON.parse(j.shaderMaterial), te = N.Parse(ne, D || E.a.LastCreatedScene, w);\n                    te.snippetId = b, M(te);\n                  } else\n                    U(\"Unable to load the snippet \" + b);\n              }), X.open(\"GET\", N.SnippetUrl + \"/\" + b.replace(/#/g, \"/\")), X.send();\n            });\n          }, v.SnippetUrl = \"https://snippet.babylonjs.com\", v;\n        }(x.a);\n        m.a.RegisteredTypes[\"BABYLON.ShaderMaterial\"] = l;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.SetMatrixPrecision = function(C) {\n            if (_.MatrixTrackPrecisionChange = !1, C && !_.MatrixUse64Bits && _.MatrixTrackedMatrices)\n              for (var u = 0; u < _.MatrixTrackedMatrices.length; ++u) {\n                var I = _.MatrixTrackedMatrices[u], O = I._m;\n                I._m = new Array(16);\n                for (var x = 0; x < 16; ++x)\n                  I._m[x] = O[x];\n              }\n            _.MatrixUse64Bits = C, _.MatrixCurrentType = _.MatrixUse64Bits ? Array : Float32Array, _.MatrixTrackedMatrices = null;\n          }, _.MatrixUse64Bits = !1, _.MatrixTrackPrecisionChange = !0, _.MatrixCurrentType = Float32Array, _.MatrixTrackedMatrices = [], _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return E;\n        });\n        var V = f(1), _ = f(6), C = f(0), u = f(46), I = f(7), O = f(53), x = f(65), m = f(51), c = f(36), T = f(30), S = f(9), E = function(g) {\n          function l(h, v, b, D, w) {\n            var N;\n            v === void 0 && (v = S.a.Gray()), b === void 0 && (b = c.a.DefaultUtilityLayer), D === void 0 && (D = null), w === void 0 && (w = 1);\n            var M = g.call(this, b) || this;\n            M._pointerObserver = null, M.snapDistance = 0, M.onSnapObservable = new _.c(), M._isEnabled = !0, M._parent = null, M._dragging = !1, M._parent = D, M._coloredMaterial = new T.a(\"\", b.utilityLayerScene), M._coloredMaterial.diffuseColor = v, M._coloredMaterial.specularColor = v.subtract(new S.a(0.1, 0.1, 0.1)), M._hoverMaterial = new T.a(\"\", b.utilityLayerScene), M._hoverMaterial.diffuseColor = S.a.Yellow(), M._disableMaterial = new T.a(\"\", b.utilityLayerScene), M._disableMaterial.diffuseColor = S.a.Gray(), M._disableMaterial.alpha = 0.4;\n            var U = l._CreateArrow(b.utilityLayerScene, M._coloredMaterial, w), X = l._CreateArrow(b.utilityLayerScene, M._coloredMaterial, w + 4, !0);\n            M._gizmoMesh = new I.a(\"\", b.utilityLayerScene), M._gizmoMesh.addChild(U), M._gizmoMesh.addChild(X), M._gizmoMesh.lookAt(M._rootMesh.position.add(h)), M._gizmoMesh.scaling.scaleInPlace(1 / 3), M._gizmoMesh.parent = M._rootMesh;\n            var j = 0, ne = new C.e(), te = { snapDistance: 0 };\n            M.dragBehavior = new x.a({ dragAxis: h }), M.dragBehavior.moveAttached = !1, M._rootMesh.addBehavior(M.dragBehavior), M.dragBehavior.onDragObservable.add(function(ae) {\n              if (M.attachedNode) {\n                if (M.snapDistance == 0)\n                  M.attachedNode.position && M.attachedNode.position.addInPlaceFromFloats(ae.delta.x, ae.delta.y, ae.delta.z), M.attachedNode.getWorldMatrix().addTranslationFromFloats(ae.delta.x, ae.delta.y, ae.delta.z), M.attachedNode.updateCache();\n                else if (j += ae.dragDistance, Math.abs(j) > M.snapDistance) {\n                  var ee = Math.floor(Math.abs(j) / M.snapDistance);\n                  j %= M.snapDistance, ae.delta.normalizeToRef(ne), ne.scaleInPlace(M.snapDistance * ee), M.attachedNode.getWorldMatrix().addTranslationFromFloats(ne.x, ne.y, ne.z), M.attachedNode.updateCache(), te.snapDistance = M.snapDistance * ee, M.onSnapObservable.notifyObservers(te);\n                }\n                M._matrixChanged();\n              }\n            }), M.dragBehavior.onDragStartObservable.add(function() {\n              M._dragging = !0;\n            }), M.dragBehavior.onDragEndObservable.add(function() {\n              M._dragging = !1;\n            });\n            var de = b._getSharedGizmoLight();\n            de.includedOnlyMeshes = de.includedOnlyMeshes.concat(M._rootMesh.getChildMeshes(!1));\n            var pe = { gizmoMeshes: U.getChildMeshes(), colliderMeshes: X.getChildMeshes(), material: M._coloredMaterial, hoverMaterial: M._hoverMaterial, disableMaterial: M._disableMaterial, active: !1 };\n            return (N = M._parent) === null || N === void 0 || N.addToAxisCache(X, pe), M._pointerObserver = b.utilityLayerScene.onPointerObservable.add(function(ae) {\n              var ee;\n              if (!M._customMeshSet && (M._isHovered = pe.colliderMeshes.indexOf((ee = ae == null ? void 0 : ae.pickInfo) === null || ee === void 0 ? void 0 : ee.pickedMesh) != -1, !M._parent)) {\n                var K = M._isHovered || M._dragging ? M._hoverMaterial : M._coloredMaterial;\n                pe.gizmoMeshes.forEach(function($) {\n                  $.material = K, $.color && ($.color = K.diffuseColor);\n                });\n              }\n            }), M;\n          }\n          return Object(V.d)(l, g), l._CreateArrow = function(h, v, b, D) {\n            b === void 0 && (b = 1), D === void 0 && (D = !1);\n            var w = new u.a(\"arrow\", h), N = O.a.CreateCylinder(\"cylinder\", { diameterTop: 0, height: 0.075, diameterBottom: 0.0375 * (1 + (b - 1) / 4), tessellation: 96 }, h), M = O.a.CreateCylinder(\"cylinder\", { diameterTop: 5e-3 * b, height: 0.275, diameterBottom: 5e-3 * b, tessellation: 96 }, h);\n            return N.parent = w, N.material = v, N.rotation.x = Math.PI / 2, N.position.z += 0.3, M.parent = w, M.material = v, M.position.z += 0.1375, M.rotation.x = Math.PI / 2, D && (M.visibility = 0, N.visibility = 0), w;\n          }, l._CreateArrowInstance = function(h, v) {\n            for (var b = new u.a(\"arrow\", h), D = 0, w = v.getChildMeshes(); D < w.length; D++) {\n              var N = w[D];\n              N.createInstance(N.name).parent = b;\n            }\n            return b;\n          }, l.prototype._attachedNodeChanged = function(h) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!h);\n          }, Object.defineProperty(l.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(h) {\n            this._isEnabled = h, h ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);\n          }, enumerable: !1, configurable: !0 }), l.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(h) {\n              h && h.dispose();\n            }), g.prototype.dispose.call(this);\n          }, l;\n        }(m.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            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;\n          }\n          return Object.defineProperty(_.prototype, \"isDirty\", { get: function() {\n            return this._isDirty;\n          }, enumerable: !1, configurable: !0 }), _.prototype.markAsProcessed = function() {\n            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;\n          }, _.prototype.markAsUnprocessed = function() {\n            this._isDirty = !0;\n          }, _.prototype.markAllAsDirty = function() {\n            this._areTexturesDirty = !0, this._areAttributesDirty = !0, this._areLightsDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._areImageProcessingDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsImageProcessingDirty = function() {\n            this._areImageProcessingDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsLightDirty = function(C) {\n            C === void 0 && (C = !1), this._areLightsDirty = !0, this._areLightsDisposed = this._areLightsDisposed || C, this._isDirty = !0;\n          }, _.prototype.markAsAttributesDirty = function() {\n            this._areAttributesDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsTexturesDirty = function() {\n            this._areTexturesDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsFresnelDirty = function() {\n            this._areFresnelDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsMiscDirty = function() {\n            this._areMiscDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsPrePassDirty = function() {\n            this._arePrePassDirty = !0, this._isDirty = !0;\n          }, _.prototype.rebuild = function() {\n            this._keys = [];\n            for (var C = 0, u = Object.keys(this); C < u.length; C++) {\n              var I = u[C];\n              I[0] !== \"_\" && this._keys.push(I);\n            }\n          }, _.prototype.isEqual = function(C) {\n            if (this._keys.length !== C._keys.length)\n              return !1;\n            for (var u = 0; u < this._keys.length; u++) {\n              var I = this._keys[u];\n              if (this[I] !== C[I])\n                return !1;\n            }\n            return !0;\n          }, _.prototype.cloneTo = function(C) {\n            this._keys.length !== C._keys.length && (C._keys = this._keys.slice(0));\n            for (var u = 0; u < this._keys.length; u++) {\n              var I = this._keys[u];\n              C[I] = this[I];\n            }\n          }, _.prototype.reset = function() {\n            for (var C = 0; C < this._keys.length; C++) {\n              var u = this._keys[C];\n              switch (typeof this[u]) {\n                case \"number\":\n                  this[u] = 0;\n                  break;\n                case \"string\":\n                  this[u] = \"\";\n                  break;\n                default:\n                  this[u] = !1;\n              }\n            }\n          }, _.prototype.toString = function() {\n            for (var C = \"\", u = 0; u < this._keys.length; u++) {\n              var I = this._keys[u], O = this[I];\n              switch (typeof O) {\n                case \"number\":\n                case \"string\":\n                  C += \"#define \" + I + \" \" + O + `\n`;\n                  break;\n                default:\n                  O && (C += \"#define \" + I + `\n`);\n              }\n            }\n            return C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _(C, u) {\n            this.width = C, this.height = u;\n          }\n          return _.prototype.toString = function() {\n            return \"{W: \" + this.width + \", H: \" + this.height + \"}\";\n          }, _.prototype.getClassName = function() {\n            return \"Size\";\n          }, _.prototype.getHashCode = function() {\n            var C = 0 | this.width;\n            return C = 397 * C ^ (0 | this.height);\n          }, _.prototype.copyFrom = function(C) {\n            this.width = C.width, this.height = C.height;\n          }, _.prototype.copyFromFloats = function(C, u) {\n            return this.width = C, this.height = u, this;\n          }, _.prototype.set = function(C, u) {\n            return this.copyFromFloats(C, u);\n          }, _.prototype.multiplyByFloats = function(C, u) {\n            return new _(this.width * C, this.height * u);\n          }, _.prototype.clone = function() {\n            return new _(this.width, this.height);\n          }, _.prototype.equals = function(C) {\n            return !!C && this.width === C.width && this.height === C.height;\n          }, Object.defineProperty(_.prototype, \"surface\", { get: function() {\n            return this.width * this.height;\n          }, enumerable: !1, configurable: !0 }), _.Zero = function() {\n            return new _(0, 0);\n          }, _.prototype.add = function(C) {\n            return new _(this.width + C.width, this.height + C.height);\n          }, _.prototype.subtract = function(C) {\n            return new _(this.width - C.width, this.height - C.height);\n          }, _.Lerp = function(C, u, I) {\n            return new _(C.width + (u.width - C.width) * I, C.height + (u.height - C.height) * I);\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        var V = \"bonesDeclaration\", _ = `#if NUM_BONE_INFLUENCERS>0\n#ifdef BONETEXTURE\nuniform sampler2D boneSampler;\nuniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{\nfloat offset=index*4.0;\nfloat dx=1.0/boneTextureWidth;\nvec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));\nvec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));\nvec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));\nvec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));\nreturn mat4(m0,m1,m2,m3);\n}\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"instancesDeclaration\", _ = `#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#ifdef THIN_INSTANCES\nuniform mat4 world;\n#endif\n#else\nuniform mat4 world;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"instancesVertex\", _ = `#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#ifdef THIN_INSTANCES\nfinalWorld=world*finalWorld;\n#endif\n#else\nmat4 finalWorld=world;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif`;\n        f(5).a.IncludesShadersStore.bonesVertex = V;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(0), _ = f(7), C = f(4), u = f(16), I = f(43);\n        u.a.CreateRibbon = function(x) {\n          var m = x.pathArray, c = x.closeArray || !1, T = x.closePath || !1, S = x.invertUV || !1, E = Math.floor(m[0].length / 2), g = x.offset || E;\n          g = g > E ? E : Math.floor(g);\n          var l, h, v, b, D = x.sideOrientation === 0 ? 0 : x.sideOrientation || u.a.DEFAULTSIDE, w = x.uvs, N = x.colors, M = [], U = [], X = [], j = [], ne = [], te = [], de = [], pe = [], ae = [], ee = [];\n          if (m.length < 2) {\n            var K = [], $ = [];\n            for (v = 0; v < m[0].length - g; v++)\n              K.push(m[0][v]), $.push(m[0][v + g]);\n            m = [K, $];\n          }\n          var L, G, Q, oe, re, Y = 0, k = T ? 1 : 0;\n          for (l = m[0].length, h = 0; h < m.length; h++) {\n            for (de[h] = 0, ne[h] = [0], l = l < (G = (L = m[h]).length) ? l : G, b = 0; b < G; )\n              M.push(L[b].x, L[b].y, L[b].z), b > 0 && (Q = L[b].subtract(L[b - 1]).length() + de[h], ne[h].push(Q), de[h] = Q), b++;\n            T && (b--, M.push(L[0].x, L[0].y, L[0].z), Q = L[b].subtract(L[0]).length() + de[h], ne[h].push(Q), de[h] = Q), ae[h] = G + k, ee[h] = Y, Y += G + k;\n          }\n          var H, Z, W = null, q = null;\n          for (v = 0; v < l + k; v++) {\n            for (pe[v] = 0, te[v] = [0], h = 0; h < m.length - 1; h++)\n              oe = m[h], re = m[h + 1], v === l ? (W = oe[0], q = re[0]) : (W = oe[v], q = re[v]), Q = q.subtract(W).length() + pe[v], te[v].push(Q), pe[v] = Q;\n            c && q && W && (oe = m[h], re = m[0], v === l && (q = re[0]), Q = q.subtract(W).length() + pe[v], pe[v] = Q);\n          }\n          if (w)\n            for (h = 0; h < w.length; h++)\n              j.push(w[h].x, w[h].y);\n          else\n            for (h = 0; h < m.length; h++)\n              for (v = 0; v < l + k; v++)\n                H = de[h] != 0 ? ne[h][v] / de[h] : 0, Z = pe[v] != 0 ? te[v][h] / pe[v] : 0, S ? j.push(Z, H) : j.push(H, Z);\n          for (var he = 0, ge = ae[h = 0] - 1, me = ae[h + 1] - 1, _e = ge < me ? ge : me, ye = ee[1] - ee[0], Pe = c ? ae.length : ae.length - 1; he <= _e && h < Pe; )\n            U.push(he, he + ye, he + 1), U.push(he + ye + 1, he + 1, he + ye), (he += 1) === _e && (++h === ae.length - 1 ? (ye = ee[0] - ee[h], ge = ae[h] - 1, me = ae[0] - 1) : (ye = ee[h + 1] - ee[h], ge = ae[h] - 1, me = ae[h + 1] - 1), he = ee[h], _e = ge < me ? ge + he : me + he);\n          if (u.a.ComputeNormals(M, U, X), T) {\n            var be = 0, Fe = 0;\n            for (h = 0; h < m.length; h++)\n              be = 3 * ee[h], Fe = h + 1 < m.length ? 3 * (ee[h + 1] - 1) : X.length - 3, X[be] = 0.5 * (X[be] + X[Fe]), X[be + 1] = 0.5 * (X[be + 1] + X[Fe + 1]), X[be + 2] = 0.5 * (X[be + 2] + X[Fe + 2]), X[Fe] = X[be], X[Fe + 1] = X[be + 1], X[Fe + 2] = X[be + 2];\n          }\n          u.a._ComputeSides(D, M, U, X, j, x.frontUVs, x.backUVs);\n          var ke = null;\n          if (N) {\n            ke = new Float32Array(4 * N.length);\n            for (var We = 0; We < N.length; We++)\n              ke[4 * We] = N[We].r, ke[4 * We + 1] = N[We].g, ke[4 * We + 2] = N[We].b, ke[4 * We + 3] = N[We].a;\n          }\n          var je = new u.a(), He = new Float32Array(M), Qe = new Float32Array(X), Ge = new Float32Array(j);\n          return je.indices = U, je.positions = He, je.normals = Qe, je.uvs = Ge, ke && je.set(ke, C.b.ColorKind), T && (je._idx = ee), je;\n        }, _.a.CreateRibbon = function(x, m, c, T, S, E, g, l, h) {\n          return c === void 0 && (c = !1), g === void 0 && (g = !1), O.CreateRibbon(x, { pathArray: m, closeArray: c, closePath: T, offset: S, updatable: g, sideOrientation: l, instance: h }, E);\n        };\n        var O = function() {\n          function x() {\n          }\n          return x.CreateRibbon = function(m, c, T) {\n            T === void 0 && (T = null);\n            var S = c.pathArray, E = c.closeArray, g = c.closePath, l = _.a._GetDefaultSideOrientation(c.sideOrientation), h = c.instance, v = c.updatable;\n            if (h) {\n              var b = V.c.Vector3[0].setAll(Number.MAX_VALUE), D = V.c.Vector3[1].setAll(-Number.MAX_VALUE), w = h.getVerticesData(C.b.PositionKind);\n              if (function(G) {\n                for (var Q = S[0].length, oe = h, re = 0, Y = oe._originalBuilderSideOrientation === _.a.DOUBLESIDE ? 2 : 1, k = 1; k <= Y; ++k)\n                  for (var H = 0; H < S.length; ++H) {\n                    var Z = S[H], W = Z.length;\n                    Q = Q < W ? Q : W;\n                    for (var q = 0; q < Q; ++q) {\n                      var he = Z[q];\n                      G[re] = he.x, G[re + 1] = he.y, G[re + 2] = he.z, b.minimizeInPlaceFromFloats(he.x, he.y, he.z), D.maximizeInPlaceFromFloats(he.x, he.y, he.z), re += 3;\n                    }\n                    oe._creationDataStorage && oe._creationDataStorage.closePath && (he = Z[0], G[re] = he.x, G[re + 1] = he.y, G[re + 2] = he.z, re += 3);\n                  }\n              }(w), h._boundingInfo ? h._boundingInfo.reConstruct(b, D, h._worldMatrix) : h._boundingInfo = new I.a(b, D, h._worldMatrix), h.updateVerticesData(C.b.PositionKind, w, !1, !1), c.colors) {\n                for (var N = h.getVerticesData(C.b.ColorKind), M = 0, U = 0; M < c.colors.length; M++, U += 4) {\n                  var X = c.colors[M];\n                  N[U] = X.r, N[U + 1] = X.g, N[U + 2] = X.b, N[U + 3] = X.a;\n                }\n                h.updateVerticesData(C.b.ColorKind, N, !1, !1);\n              }\n              if (c.uvs) {\n                for (var j = h.getVerticesData(C.b.UVKind), ne = 0; ne < c.uvs.length; ne++)\n                  j[2 * ne] = c.uvs[ne].x, j[2 * ne + 1] = c.uvs[ne].y;\n                h.updateVerticesData(C.b.UVKind, j, !1, !1);\n              }\n              if (!h.areNormalsFrozen || h.isFacetDataEnabled) {\n                var te = h.getIndices(), de = h.getVerticesData(C.b.NormalKind), pe = h.isFacetDataEnabled ? h.getFacetDataParameters() : null;\n                if (u.a.ComputeNormals(w, te, de, pe), h._creationDataStorage && h._creationDataStorage.closePath)\n                  for (var ae = 0, ee = 0, K = 0; K < S.length; K++)\n                    ae = 3 * h._creationDataStorage.idx[K], ee = K + 1 < S.length ? 3 * (h._creationDataStorage.idx[K + 1] - 1) : de.length - 3, de[ae] = 0.5 * (de[ae] + de[ee]), de[ae + 1] = 0.5 * (de[ae + 1] + de[ee + 1]), de[ae + 2] = 0.5 * (de[ae + 2] + de[ee + 2]), de[ee] = de[ae], de[ee + 1] = de[ae + 1], de[ee + 2] = de[ae + 2];\n                h.areNormalsFrozen || h.updateVerticesData(C.b.NormalKind, de, !1, !1);\n              }\n              return h;\n            }\n            var $ = new _.a(m, T);\n            $._originalBuilderSideOrientation = l, $._creationDataStorage = new _.b();\n            var L = u.a.CreateRibbon(c);\n            return g && ($._creationDataStorage.idx = L._idx), $._creationDataStorage.closePath = g, $._creationDataStorage.closeArray = E, L.applyToMesh($, v), $;\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.FilesToLoad = {}, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(7), _ = f(16);\n        _.a.CreatePlane = function(u) {\n          var I = [], O = [], x = [], m = [], c = u.width || u.size || 1, T = u.height || u.size || 1, S = u.sideOrientation === 0 ? 0 : u.sideOrientation || _.a.DEFAULTSIDE, E = c / 2, g = T / 2;\n          O.push(-E, -g, 0), x.push(0, 0, -1), m.push(0, 0), O.push(E, -g, 0), x.push(0, 0, -1), m.push(1, 0), O.push(E, g, 0), x.push(0, 0, -1), m.push(1, 1), O.push(-E, g, 0), x.push(0, 0, -1), m.push(0, 1), I.push(0), I.push(1), I.push(2), I.push(0), I.push(2), I.push(3), _.a._ComputeSides(S, O, I, x, m, u.frontUVs, u.backUVs);\n          var l = new _.a();\n          return l.indices = I, l.positions = O, l.normals = x, l.uvs = m, l;\n        }, V.a.CreatePlane = function(u, I, O, x, m) {\n          var c = { size: I, width: I, height: I, sideOrientation: m, updatable: x };\n          return C.CreatePlane(u, c, O);\n        };\n        var C = function() {\n          function u() {\n          }\n          return u.CreatePlane = function(I, O, x) {\n            x === void 0 && (x = null);\n            var m = new V.a(I, x);\n            return O.sideOrientation = V.a._GetDefaultSideOrientation(O.sideOrientation), m._originalBuilderSideOrientation = O.sideOrientation, _.a.CreatePlane(O).applyToMesh(m, O.updatable), O.sourcePlane && (m.translate(O.sourcePlane.normal, -O.sourcePlane.d), m.setDirection(O.sourcePlane.normal.scale(-1))), m;\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(8), _ = (f(153), function() {\n          function C(u, I, O) {\n            this._alreadyBound = !1, this._valueCache = {}, this._engine = u, this._noUBO = !u.supportsUniformBuffers, this._dynamic = O, this._data = I || [], this._uniformLocations = {}, this._uniformSizes = {}, this._uniformLocationPointer = 0, this._needSync = !1, this._noUBO ? (this.updateMatrix3x3 = this._updateMatrix3x3ForEffect, this.updateMatrix2x2 = this._updateMatrix2x2ForEffect, this.updateFloat = this._updateFloatForEffect, this.updateFloat2 = this._updateFloat2ForEffect, this.updateFloat3 = this._updateFloat3ForEffect, this.updateFloat4 = this._updateFloat4ForEffect, this.updateMatrix = this._updateMatrixForEffect, this.updateVector3 = this._updateVector3ForEffect, this.updateVector4 = this._updateVector4ForEffect, this.updateColor3 = this._updateColor3ForEffect, this.updateColor4 = this._updateColor4ForEffect) : (this._engine._uniformBuffers.push(this), this.updateMatrix3x3 = this._updateMatrix3x3ForUniform, this.updateMatrix2x2 = this._updateMatrix2x2ForUniform, this.updateFloat = this._updateFloatForUniform, this.updateFloat2 = this._updateFloat2ForUniform, this.updateFloat3 = this._updateFloat3ForUniform, this.updateFloat4 = this._updateFloat4ForUniform, this.updateMatrix = this._updateMatrixForUniform, this.updateVector3 = this._updateVector3ForUniform, this.updateVector4 = this._updateVector4ForUniform, this.updateColor3 = this._updateColor3ForUniform, this.updateColor4 = this._updateColor4ForUniform);\n          }\n          return Object.defineProperty(C.prototype, \"useUbo\", { get: function() {\n            return !this._noUBO;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"isSync\", { get: function() {\n            return !this._needSync;\n          }, enumerable: !1, configurable: !0 }), C.prototype.isDynamic = function() {\n            return this._dynamic !== void 0;\n          }, C.prototype.getData = function() {\n            return this._bufferData;\n          }, C.prototype.getBuffer = function() {\n            return this._buffer;\n          }, C.prototype._fillAlignment = function(u) {\n            var I;\n            if (I = u <= 2 ? u : 4, this._uniformLocationPointer % I != 0) {\n              var O = this._uniformLocationPointer;\n              this._uniformLocationPointer += I - this._uniformLocationPointer % I;\n              for (var x = this._uniformLocationPointer - O, m = 0; m < x; m++)\n                this._data.push(0);\n            }\n          }, C.prototype.addUniform = function(u, I) {\n            if (!this._noUBO && this._uniformLocations[u] === void 0) {\n              var O;\n              if (I instanceof Array)\n                I = (O = I).length;\n              else {\n                I = I, O = [];\n                for (var x = 0; x < I; x++)\n                  O.push(0);\n              }\n              for (this._fillAlignment(I), this._uniformSizes[u] = I, this._uniformLocations[u] = this._uniformLocationPointer, this._uniformLocationPointer += I, x = 0; x < I; x++)\n                this._data.push(O[x]);\n              this._needSync = !0;\n            }\n          }, C.prototype.addMatrix = function(u, I) {\n            this.addUniform(u, Array.prototype.slice.call(I.toArray()));\n          }, C.prototype.addFloat2 = function(u, I, O) {\n            var x = [I, O];\n            this.addUniform(u, x);\n          }, C.prototype.addFloat3 = function(u, I, O, x) {\n            var m = [I, O, x];\n            this.addUniform(u, m);\n          }, C.prototype.addColor3 = function(u, I) {\n            var O = new Array();\n            I.toArray(O), this.addUniform(u, O);\n          }, C.prototype.addColor4 = function(u, I, O) {\n            var x = new Array();\n            I.toArray(x), x.push(O), this.addUniform(u, x);\n          }, C.prototype.addVector3 = function(u, I) {\n            var O = new Array();\n            I.toArray(O), this.addUniform(u, O);\n          }, C.prototype.addMatrix3x3 = function(u) {\n            this.addUniform(u, 12);\n          }, C.prototype.addMatrix2x2 = function(u) {\n            this.addUniform(u, 8);\n          }, C.prototype.create = function() {\n            this._noUBO || this._buffer || (this._fillAlignment(4), this._bufferData = new Float32Array(this._data), this._rebuild(), this._needSync = !0);\n          }, C.prototype._rebuild = function() {\n            !this._noUBO && this._bufferData && (this._dynamic ? this._buffer = this._engine.createDynamicUniformBuffer(this._bufferData) : this._buffer = this._engine.createUniformBuffer(this._bufferData));\n          }, C.prototype.update = function() {\n            this._buffer ? (this._dynamic || this._needSync) && (this._engine.updateUniformBuffer(this._buffer, this._bufferData), this._needSync = !1) : this.create();\n          }, C.prototype.updateUniform = function(u, I, O) {\n            var x = this._uniformLocations[u];\n            if (x === void 0) {\n              if (this._buffer)\n                return void V.a.Error(\"Cannot add an uniform after UBO has been created.\");\n              this.addUniform(u, O), x = this._uniformLocations[u];\n            }\n            if (this._buffer || this.create(), this._dynamic)\n              for (c = 0; c < O; c++)\n                this._bufferData[x + c] = I[c];\n            else {\n              for (var m = !1, c = 0; c < O; c++)\n                O !== 16 && this._bufferData[x + c] === I[c] || (m = !0, this._bufferData[x + c] = I[c]);\n              this._needSync = this._needSync || m;\n            }\n          }, C.prototype._cacheMatrix = function(u, I) {\n            var O = this._valueCache[u], x = I.updateFlag;\n            return (O === void 0 || O !== x) && (this._valueCache[u] = x, !0);\n          }, C.prototype._updateMatrix3x3ForUniform = function(u, I) {\n            for (var O = 0; O < 3; O++)\n              C._tempBuffer[4 * O] = I[3 * O], C._tempBuffer[4 * O + 1] = I[3 * O + 1], C._tempBuffer[4 * O + 2] = I[3 * O + 2], C._tempBuffer[4 * O + 3] = 0;\n            this.updateUniform(u, C._tempBuffer, 12);\n          }, C.prototype._updateMatrix3x3ForEffect = function(u, I) {\n            this._currentEffect.setMatrix3x3(u, I);\n          }, C.prototype._updateMatrix2x2ForEffect = function(u, I) {\n            this._currentEffect.setMatrix2x2(u, I);\n          }, C.prototype._updateMatrix2x2ForUniform = function(u, I) {\n            for (var O = 0; O < 2; O++)\n              C._tempBuffer[4 * O] = I[2 * O], C._tempBuffer[4 * O + 1] = I[2 * O + 1], C._tempBuffer[4 * O + 2] = 0, C._tempBuffer[4 * O + 3] = 0;\n            this.updateUniform(u, C._tempBuffer, 8);\n          }, C.prototype._updateFloatForEffect = function(u, I) {\n            this._currentEffect.setFloat(u, I);\n          }, C.prototype._updateFloatForUniform = function(u, I) {\n            C._tempBuffer[0] = I, this.updateUniform(u, C._tempBuffer, 1);\n          }, C.prototype._updateFloat2ForEffect = function(u, I, O, x) {\n            x === void 0 && (x = \"\"), this._currentEffect.setFloat2(u + x, I, O);\n          }, C.prototype._updateFloat2ForUniform = function(u, I, O) {\n            C._tempBuffer[0] = I, C._tempBuffer[1] = O, this.updateUniform(u, C._tempBuffer, 2);\n          }, C.prototype._updateFloat3ForEffect = function(u, I, O, x, m) {\n            m === void 0 && (m = \"\"), this._currentEffect.setFloat3(u + m, I, O, x);\n          }, C.prototype._updateFloat3ForUniform = function(u, I, O, x) {\n            C._tempBuffer[0] = I, C._tempBuffer[1] = O, C._tempBuffer[2] = x, this.updateUniform(u, C._tempBuffer, 3);\n          }, C.prototype._updateFloat4ForEffect = function(u, I, O, x, m, c) {\n            c === void 0 && (c = \"\"), this._currentEffect.setFloat4(u + c, I, O, x, m);\n          }, C.prototype._updateFloat4ForUniform = function(u, I, O, x, m) {\n            C._tempBuffer[0] = I, C._tempBuffer[1] = O, C._tempBuffer[2] = x, C._tempBuffer[3] = m, this.updateUniform(u, C._tempBuffer, 4);\n          }, C.prototype._updateMatrixForEffect = function(u, I) {\n            this._currentEffect.setMatrix(u, I);\n          }, C.prototype._updateMatrixForUniform = function(u, I) {\n            this._cacheMatrix(u, I) && this.updateUniform(u, I.toArray(), 16);\n          }, C.prototype._updateVector3ForEffect = function(u, I) {\n            this._currentEffect.setVector3(u, I);\n          }, C.prototype._updateVector3ForUniform = function(u, I) {\n            I.toArray(C._tempBuffer), this.updateUniform(u, C._tempBuffer, 3);\n          }, C.prototype._updateVector4ForEffect = function(u, I) {\n            this._currentEffect.setVector4(u, I);\n          }, C.prototype._updateVector4ForUniform = function(u, I) {\n            I.toArray(C._tempBuffer), this.updateUniform(u, C._tempBuffer, 4);\n          }, C.prototype._updateColor3ForEffect = function(u, I, O) {\n            O === void 0 && (O = \"\"), this._currentEffect.setColor3(u + O, I);\n          }, C.prototype._updateColor3ForUniform = function(u, I) {\n            I.toArray(C._tempBuffer), this.updateUniform(u, C._tempBuffer, 3);\n          }, C.prototype._updateColor4ForEffect = function(u, I, O, x) {\n            x === void 0 && (x = \"\"), this._currentEffect.setColor4(u + x, I, O);\n          }, C.prototype._updateColor4ForUniform = function(u, I, O) {\n            I.toArray(C._tempBuffer), C._tempBuffer[3] = O, this.updateUniform(u, C._tempBuffer, 4);\n          }, C.prototype.setTexture = function(u, I) {\n            this._currentEffect.setTexture(u, I);\n          }, C.prototype.updateUniformDirectly = function(u, I) {\n            this.updateUniform(u, I, I.length), this.update();\n          }, C.prototype.bindToEffect = function(u, I) {\n            this._currentEffect = u, !this._noUBO && this._buffer && (this._alreadyBound = !0, u.bindUniformBuffer(this._buffer, I));\n          }, C.prototype.dispose = function() {\n            if (!this._noUBO) {\n              var u = this._engine._uniformBuffers, I = u.indexOf(this);\n              I !== -1 && (u[I] = u[u.length - 1], u.pop()), this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null);\n            }\n          }, C._MAX_UNIFORM_SIZE = 256, C._tempBuffer = new Float32Array(C._MAX_UNIFORM_SIZE), C;\n        }());\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(1), _ = f(3), C = f(0), u = f(9), I = f(29), O = f(48);\n        I.a.AddNodeConstructor(\"Light_Type_3\", function(m, c) {\n          return function() {\n            return new x(m, C.e.Zero(), c);\n          };\n        });\n        var x = function(m) {\n          function c(T, S, E) {\n            var g = m.call(this, T, E) || this;\n            return g.groundColor = new u.a(0, 0, 0), g.direction = S || C.e.Up(), g;\n          }\n          return Object(V.d)(c, m), c.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"vLightGround\", 3), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, c.prototype.getClassName = function() {\n            return \"HemisphericLight\";\n          }, c.prototype.setDirectionToTarget = function(T) {\n            return this.direction = C.e.Normalize(T.subtract(C.e.Zero())), this.direction;\n          }, c.prototype.getShadowGenerator = function() {\n            return null;\n          }, c.prototype.transferToEffect = function(T, S) {\n            var E = C.e.Normalize(this.direction);\n            return this._uniformBuffer.updateFloat4(\"vLightData\", E.x, E.y, E.z, 0, S), this._uniformBuffer.updateColor3(\"vLightGround\", this.groundColor.scale(this.intensity), S), this;\n          }, c.prototype.transferToNodeMaterialEffect = function(T, S) {\n            var E = C.e.Normalize(this.direction);\n            return T.setFloat3(S, E.x, E.y, E.z), this;\n          }, c.prototype.computeWorldMatrix = function() {\n            return this._worldMatrix || (this._worldMatrix = C.a.Identity()), this._worldMatrix;\n          }, c.prototype.getTypeID = function() {\n            return O.a.LIGHTTYPEID_HEMISPHERICLIGHT;\n          }, c.prototype.prepareLightSpecificDefines = function(T, S) {\n            T[\"HEMILIGHT\" + S] = !0;\n          }, Object(V.c)([Object(_.e)()], c.prototype, \"groundColor\", void 0), Object(V.c)([Object(_.o)()], c.prototype, \"direction\", void 0), c;\n        }(O.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(1), _ = f(0), C = function(u) {\n          function I(O, x) {\n            var m = u.call(this, O, x) || this;\n            return m._normalMatrix = new _.a(), m._storeEffectOnSubMeshes = !0, m;\n          }\n          return Object(V.d)(I, u), I.prototype.getEffect = function() {\n            return this._activeEffect;\n          }, I.prototype.isReady = function(O, x) {\n            return !!O && (!O.subMeshes || O.subMeshes.length === 0 || this.isReadyForSubMesh(O, O.subMeshes[0], x));\n          }, I.prototype._isReadyForSubMesh = function(O) {\n            var x = O._materialDefines;\n            return !(this.checkReadyOnEveryCall || !O.effect || !x || x._renderId !== this.getScene().getRenderId());\n          }, I.prototype.bindOnlyWorldMatrix = function(O) {\n            this._activeEffect.setMatrix(\"world\", O);\n          }, I.prototype.bindOnlyNormalMatrix = function(O) {\n            this._activeEffect.setMatrix(\"normalMatrix\", O);\n          }, I.prototype.bind = function(O, x) {\n            x && this.bindForSubMesh(O, x, x.subMeshes[0]);\n          }, I.prototype._afterBind = function(O, x) {\n            x === void 0 && (x = null), u.prototype._afterBind.call(this, O), this.getScene()._cachedEffect = x;\n          }, I.prototype._mustRebind = function(O, x, m) {\n            return m === void 0 && (m = 1), O.isCachedMaterialInvalid(this, x, m);\n          }, I;\n        }(f(25).a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(1), _ = function(C) {\n          function u(I) {\n            var O = C.call(this) || this;\n            return O._buffer = I, O;\n          }\n          return Object(V.d)(u, C), Object.defineProperty(u.prototype, \"underlyingResource\", { get: function() {\n            return this._buffer;\n          }, enumerable: !1, configurable: !0 }), u;\n        }(f(89).a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this.references = 0, this.capacity = 0, this.is32Bits = !1;\n          }\n          return Object.defineProperty(_.prototype, \"underlyingResource\", { get: function() {\n            return null;\n          }, enumerable: !1, configurable: !0 }), _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(64), _ = function() {\n          function C() {\n          }\n          return C.GetPlanes = function(u) {\n            for (var I = [], O = 0; O < 6; O++)\n              I.push(new V.a(0, 0, 0, 0));\n            return C.GetPlanesToRef(u, I), I;\n          }, C.GetNearPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] + O[2], I.normal.y = O[7] + O[6], I.normal.z = O[11] + O[10], I.d = O[15] + O[14], I.normalize();\n          }, C.GetFarPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] - O[2], I.normal.y = O[7] - O[6], I.normal.z = O[11] - O[10], I.d = O[15] - O[14], I.normalize();\n          }, C.GetLeftPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] + O[0], I.normal.y = O[7] + O[4], I.normal.z = O[11] + O[8], I.d = O[15] + O[12], I.normalize();\n          }, C.GetRightPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] - O[0], I.normal.y = O[7] - O[4], I.normal.z = O[11] - O[8], I.d = O[15] - O[12], I.normalize();\n          }, C.GetTopPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] - O[1], I.normal.y = O[7] - O[5], I.normal.z = O[11] - O[9], I.d = O[15] - O[13], I.normalize();\n          }, C.GetBottomPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] + O[1], I.normal.y = O[7] + O[5], I.normal.z = O[11] + O[9], I.d = O[15] + O[13], I.normalize();\n          }, C.GetPlanesToRef = function(u, I) {\n            C.GetNearPlaneToRef(u, I[0]), C.GetFarPlaneToRef(u, I[1]), C.GetLeftPlaneToRef(u, I[2]), C.GetRightPlaneToRef(u, I[3]), C.GetTopPlaneToRef(u, I[4]), C.GetBottomPlaneToRef(u, I[5]);\n          }, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(2), _ = function() {\n          function C() {\n            this.hoverCursor = \"\", this.actions = new Array(), this.isRecursive = !1;\n          }\n          return Object.defineProperty(C, \"HasTriggers\", { get: function() {\n            for (var u in C.Triggers)\n              if (C.Triggers.hasOwnProperty(u))\n                return !0;\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"HasPickTriggers\", { get: function() {\n            for (var u in C.Triggers)\n              if (C.Triggers.hasOwnProperty(u)) {\n                var I = parseInt(u);\n                if (I >= V.a.ACTION_OnPickTrigger && I <= V.a.ACTION_OnPickUpTrigger)\n                  return !0;\n              }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), C.HasSpecificTrigger = function(u) {\n            for (var I in C.Triggers)\n              if (C.Triggers.hasOwnProperty(I) && parseInt(I) === u)\n                return !0;\n            return !1;\n          }, C.Triggers = {}, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(1), _ = f(25), C = f(3), u = f(19), I = f(15), O = function() {\n          function x(m) {\n            this._texture = null, this.diffuseBlendLevel = 1, this.roughnessBlendLevel = 1, this.bumpLevel = 1, this._normalBlendMethod = _.a.MATERIAL_NORMALBLENDMETHOD_WHITEOUT, this._isEnabled = !1, this.isEnabled = !1, this._internalMarkAllSubMeshesAsTexturesDirty = m;\n          }\n          return x.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, x.prototype.isReadyForSubMesh = function(m, c) {\n            var T = c.getEngine();\n            return !(m._areTexturesDirty && c.texturesEnabled && T.getCaps().standardDerivatives && this._texture && u.a.DetailTextureEnabled && !this._texture.isReady());\n          }, x.prototype.prepareDefines = function(m, c) {\n            if (this._isEnabled) {\n              m.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod;\n              var T = c.getEngine();\n              m._areTexturesDirty && (T.getCaps().standardDerivatives && this._texture && u.a.DetailTextureEnabled && this._isEnabled ? (I.a.PrepareDefinesForMergedUV(this._texture, m, \"DETAIL\"), m.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod) : m.DETAIL = !1);\n            } else\n              m.DETAIL = !1;\n          }, x.prototype.bindForSubMesh = function(m, c, T) {\n            this._isEnabled && (m.useUbo && T && m.isSync || this._texture && u.a.DetailTextureEnabled && (m.updateFloat4(\"vDetailInfos\", this._texture.coordinatesIndex, this.diffuseBlendLevel, this.bumpLevel, this.roughnessBlendLevel), I.a.BindTextureMatrix(this._texture, m, \"detail\")), c.texturesEnabled && this._texture && u.a.DetailTextureEnabled && m.setTexture(\"detailSampler\", this._texture));\n          }, x.prototype.hasTexture = function(m) {\n            return this._texture === m;\n          }, x.prototype.getActiveTextures = function(m) {\n            this._texture && m.push(this._texture);\n          }, x.prototype.getAnimatables = function(m) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && m.push(this._texture);\n          }, x.prototype.dispose = function(m) {\n            var c;\n            m && ((c = this._texture) === null || c === void 0 || c.dispose());\n          }, x.prototype.getClassName = function() {\n            return \"DetailMap\";\n          }, x.AddUniforms = function(m) {\n            m.push(\"vDetailInfos\");\n          }, x.AddSamplers = function(m) {\n            m.push(\"detailSampler\");\n          }, x.PrepareUniformBuffer = function(m) {\n            m.addUniform(\"vDetailInfos\", 4), m.addUniform(\"detailMatrix\", 16);\n          }, x.prototype.copyTo = function(m) {\n            C.a.Clone(function() {\n              return m;\n            }, this);\n          }, x.prototype.serialize = function() {\n            return C.a.Serialize(this);\n          }, x.prototype.parse = function(m, c, T) {\n            var S = this;\n            C.a.Parse(function() {\n              return S;\n            }, m, c, T);\n          }, Object(V.c)([Object(C.m)(\"detailTexture\"), Object(C.b)(\"_markAllSubMeshesAsTexturesDirty\")], x.prototype, \"texture\", void 0), Object(V.c)([Object(C.c)()], x.prototype, \"diffuseBlendLevel\", void 0), Object(V.c)([Object(C.c)()], x.prototype, \"roughnessBlendLevel\", void 0), Object(V.c)([Object(C.c)()], x.prototype, \"bumpLevel\", void 0), Object(V.c)([Object(C.c)(), Object(C.b)(\"_markAllSubMeshesAsTexturesDirty\")], x.prototype, \"normalBlendMethod\", void 0), Object(V.c)([Object(C.c)(), Object(C.b)(\"_markAllSubMeshesAsTexturesDirty\")], x.prototype, \"isEnabled\", void 0), x;\n        }();\n      }, function(Be, A, f) {\n        var V = \"morphTargetsVertexGlobalDeclaration\", _ = `#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"morphTargetsVertexDeclaration\", _ = `#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(25), _ = f(4), C = f(2), u = function() {\n          function I(O) {\n            this._vertexBuffers = {}, this._scene = O;\n          }\n          return I.prototype._prepareBuffers = function() {\n            if (!this._vertexBuffers[_.b.PositionKind]) {\n              var O = [];\n              O.push(1, 1), O.push(-1, 1), O.push(-1, -1), O.push(1, -1), this._vertexBuffers[_.b.PositionKind] = new _.b(this._scene.getEngine(), O, _.b.PositionKind, !1, !1, 2), this._buildIndexBuffer();\n            }\n          }, I.prototype._buildIndexBuffer = function() {\n            var O = [];\n            O.push(0), O.push(1), O.push(2), O.push(0), O.push(2), O.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(O);\n          }, I.prototype._rebuild = function() {\n            var O = this._vertexBuffers[_.b.PositionKind];\n            O && (O._rebuild(), this._buildIndexBuffer());\n          }, I.prototype._prepareFrame = function(O, x) {\n            O === void 0 && (O = null), x === void 0 && (x = null);\n            var m = this._scene.activeCamera;\n            return !!m && !(!(x = x || m._postProcesses.filter(function(c) {\n              return c != null;\n            })) || x.length === 0 || !this._scene.postProcessesEnabled) && (x[0].activate(m, O, x != null), !0);\n          }, I.prototype.directRender = function(O, x, m, c, T, S) {\n            x === void 0 && (x = null), m === void 0 && (m = !1), c === void 0 && (c = 0), T === void 0 && (T = 0), S === void 0 && (S = !1);\n            for (var E = this._scene.getEngine(), g = 0; g < O.length; g++) {\n              g < O.length - 1 ? O[g + 1].activate(this._scene.activeCamera, x) : x ? E.bindFramebuffer(x, c, void 0, void 0, m, T) : S || E.restoreDefaultFramebuffer();\n              var l = O[g], h = l.apply();\n              h && (l.onBeforeRenderObservable.notifyObservers(h), this._prepareBuffers(), E.bindBuffers(this._vertexBuffers, this._indexBuffer, h), E.drawElementsType(V.a.TriangleFillMode, 0, 6), l.onAfterRenderObservable.notifyObservers(h));\n            }\n            E.setDepthBuffer(!0), E.setDepthWrite(!0);\n          }, I.prototype._finalizeFrame = function(O, x, m, c, T) {\n            T === void 0 && (T = !1);\n            var S = this._scene.activeCamera;\n            if (S && (c = c || S._postProcesses.filter(function(b) {\n              return b != null;\n            })).length !== 0 && this._scene.postProcessesEnabled) {\n              for (var E = this._scene.getEngine(), g = 0, l = c.length; g < l; g++) {\n                var h = c[g];\n                if (g < l - 1 ? h._outputTexture = c[g + 1].activate(S, x) : x ? (E.bindFramebuffer(x, m, void 0, void 0, T), h._outputTexture = x) : (E.restoreDefaultFramebuffer(), h._outputTexture = null), O)\n                  break;\n                var v = h.apply();\n                v && (h.onBeforeRenderObservable.notifyObservers(v), this._prepareBuffers(), E.bindBuffers(this._vertexBuffers, this._indexBuffer, v), E.drawElementsType(V.a.TriangleFillMode, 0, 6), h.onAfterRenderObservable.notifyObservers(v));\n              }\n              E.setDepthBuffer(!0), E.setDepthWrite(!0), E.setAlphaMode(C.a.ALPHA_DISABLE);\n            }\n          }, I.prototype.dispose = function() {\n            var O = this._vertexBuffers[_.b.PositionKind];\n            O && (O.dispose(), this._vertexBuffers[_.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null);\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(148), _ = function() {\n        }, C = function() {\n          function u(I) {\n            this._useSceneAutoClearSetup = !1, this._renderingGroups = new Array(), this._autoClearDepthStencil = {}, this._customOpaqueSortCompareFn = {}, this._customAlphaTestSortCompareFn = {}, this._customTransparentSortCompareFn = {}, this._renderingGroupInfo = new _(), this._scene = I;\n            for (var O = u.MIN_RENDERINGGROUPS; O < u.MAX_RENDERINGGROUPS; O++)\n              this._autoClearDepthStencil[O] = { autoClear: !0, depth: !0, stencil: !0 };\n          }\n          return u.prototype._clearDepthStencilBuffer = function(I, O) {\n            I === void 0 && (I = !0), O === void 0 && (O = !0), this._depthStencilBufferAlreadyCleaned || (this._scene.getEngine().clear(null, !1, I, O), this._depthStencilBufferAlreadyCleaned = !0);\n          }, u.prototype.render = function(I, O, x, m) {\n            var c = this._renderingGroupInfo;\n            if (c.scene = this._scene, c.camera = this._scene.activeCamera, this._scene.spriteManagers && m)\n              for (var T = 0; T < this._scene.spriteManagers.length; T++) {\n                var S = this._scene.spriteManagers[T];\n                this.dispatchSprites(S);\n              }\n            for (T = u.MIN_RENDERINGGROUPS; T < u.MAX_RENDERINGGROUPS; T++) {\n              this._depthStencilBufferAlreadyCleaned = T === u.MIN_RENDERINGGROUPS;\n              var E = this._renderingGroups[T];\n              if (E) {\n                var g = Math.pow(2, T);\n                if (c.renderingGroupId = T, this._scene.onBeforeRenderingGroupObservable.notifyObservers(c, g), u.AUTOCLEAR) {\n                  var l = this._useSceneAutoClearSetup ? this._scene.getAutoClearDepthStencilSetup(T) : this._autoClearDepthStencil[T];\n                  l && l.autoClear && this._clearDepthStencilBuffer(l.depth, l.stencil);\n                }\n                for (var h = 0, v = this._scene._beforeRenderingGroupDrawStage; h < v.length; h++)\n                  v[h].action(T);\n                E.render(I, m, x, O);\n                for (var b = 0, D = this._scene._afterRenderingGroupDrawStage; b < D.length; b++)\n                  D[b].action(T);\n                this._scene.onAfterRenderingGroupObservable.notifyObservers(c, g);\n              }\n            }\n          }, u.prototype.reset = function() {\n            for (var I = u.MIN_RENDERINGGROUPS; I < u.MAX_RENDERINGGROUPS; I++) {\n              var O = this._renderingGroups[I];\n              O && O.prepare();\n            }\n          }, u.prototype.dispose = function() {\n            this.freeRenderingGroups(), this._renderingGroups.length = 0, this._renderingGroupInfo = null;\n          }, u.prototype.freeRenderingGroups = function() {\n            for (var I = u.MIN_RENDERINGGROUPS; I < u.MAX_RENDERINGGROUPS; I++) {\n              var O = this._renderingGroups[I];\n              O && O.dispose();\n            }\n          }, u.prototype._prepareRenderingGroup = function(I) {\n            this._renderingGroups[I] === void 0 && (this._renderingGroups[I] = new V.a(I, this._scene, this._customOpaqueSortCompareFn[I], this._customAlphaTestSortCompareFn[I], this._customTransparentSortCompareFn[I]));\n          }, u.prototype.dispatchSprites = function(I) {\n            var O = I.renderingGroupId || 0;\n            this._prepareRenderingGroup(O), this._renderingGroups[O].dispatchSprites(I);\n          }, u.prototype.dispatchParticles = function(I) {\n            var O = I.renderingGroupId || 0;\n            this._prepareRenderingGroup(O), this._renderingGroups[O].dispatchParticles(I);\n          }, u.prototype.dispatch = function(I, O, x) {\n            O === void 0 && (O = I.getMesh());\n            var m = O.renderingGroupId || 0;\n            this._prepareRenderingGroup(m), this._renderingGroups[m].dispatch(I, O, x);\n          }, u.prototype.setRenderingOrder = function(I, O, x, m) {\n            if (O === void 0 && (O = null), x === void 0 && (x = null), m === void 0 && (m = null), this._customOpaqueSortCompareFn[I] = O, this._customAlphaTestSortCompareFn[I] = x, this._customTransparentSortCompareFn[I] = m, this._renderingGroups[I]) {\n              var c = this._renderingGroups[I];\n              c.opaqueSortCompareFn = this._customOpaqueSortCompareFn[I], c.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[I], c.transparentSortCompareFn = this._customTransparentSortCompareFn[I];\n            }\n          }, u.prototype.setRenderingAutoClearDepthStencil = function(I, O, x, m) {\n            x === void 0 && (x = !0), m === void 0 && (m = !0), this._autoClearDepthStencil[I] = { autoClear: O, depth: x, stencil: m };\n          }, u.prototype.getAutoClearDepthStencilSetup = function(I) {\n            return this._autoClearDepthStencil[I];\n          }, u.MAX_RENDERINGGROUPS = 4, u.MIN_RENDERINGGROUPS = 0, u.AUTOCLEAR = !0, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(0), _ = f(7), C = f(82), u = f(72);\n        _.a.ExtrudeShape = function(O, x, m, c, T, S, E, g, l, h) {\n          E === void 0 && (E = null);\n          var v = { shape: x, path: m, scale: c, rotation: T, cap: S === 0 ? 0 : S || _.a.NO_CAP, sideOrientation: l, instance: h, updatable: g };\n          return I.ExtrudeShape(O, v, E);\n        }, _.a.ExtrudeShapeCustom = function(O, x, m, c, T, S, E, g, l, h, v, b) {\n          var D = { shape: x, path: m, scaleFunction: c, rotationFunction: T, ribbonCloseArray: S, ribbonClosePath: E, cap: g === 0 ? 0 : g || _.a.NO_CAP, sideOrientation: v, instance: b, updatable: h };\n          return I.ExtrudeShapeCustom(O, D, l);\n        };\n        var I = function() {\n          function O() {\n          }\n          return O.ExtrudeShape = function(x, m, c) {\n            c === void 0 && (c = null);\n            var T = m.path, S = m.shape, E = m.scale || 1, g = m.rotation || 0, l = m.cap === 0 ? 0 : m.cap || _.a.NO_CAP, h = m.updatable, v = _.a._GetDefaultSideOrientation(m.sideOrientation), b = m.instance || null, D = m.invertUV || !1;\n            return O._ExtrudeShapeGeneric(x, S, T, E, g, null, null, !1, !1, l, !1, c, !!h, v, b, D, m.frontUVs || null, m.backUVs || null);\n          }, O.ExtrudeShapeCustom = function(x, m, c) {\n            c === void 0 && (c = null);\n            var T = m.path, S = m.shape, E = m.scaleFunction || function() {\n              return 1;\n            }, g = m.rotationFunction || function() {\n              return 0;\n            }, l = m.ribbonCloseArray || !1, h = m.ribbonClosePath || !1, v = m.cap === 0 ? 0 : m.cap || _.a.NO_CAP, b = m.updatable, D = _.a._GetDefaultSideOrientation(m.sideOrientation), w = m.instance, N = m.invertUV || !1;\n            return O._ExtrudeShapeGeneric(x, S, T, null, null, E, g, l, h, v, !0, c, !!b, D, w || null, N, m.frontUVs || null, m.backUVs || null);\n          }, O._ExtrudeShapeGeneric = function(x, m, c, T, S, E, g, l, h, v, b, D, w, N, M, U, X, j) {\n            var ne, te, de = function(ee, K, $, L, G, Q, oe, re, Y, k) {\n              for (var H = $.getTangents(), Z = $.getNormals(), W = $.getBinormals(), q = $.getDistances(), he = 0, ge = k && re ? re : function() {\n                return Q !== null ? Q : 0;\n              }, me = k && oe ? oe : function() {\n                return G !== null ? G : 1;\n              }, _e = Y === _.a.NO_CAP || Y === _.a.CAP_END ? 0 : 2, ye = V.c.Matrix[0], Pe = 0; Pe < K.length; Pe++) {\n                for (var be = new Array(), Fe = ge(Pe, q[Pe]), ke = me(Pe, q[Pe]), We = 0; We < ee.length; We++) {\n                  V.a.RotationAxisToRef(H[Pe], he, ye);\n                  var je = H[Pe].scale(ee[We].z).add(Z[Pe].scale(ee[We].x)).add(W[Pe].scale(ee[We].y)), He = be[We] ? be[We] : V.e.Zero();\n                  V.e.TransformCoordinatesToRef(je, ye, He), He.scaleInPlace(ke).addInPlace(K[Pe]), be[We] = He;\n                }\n                L[_e] = be, he += Fe, _e++;\n              }\n              var Qe = function(Ge) {\n                var tt, Je = Array(), st = V.e.Zero();\n                for (tt = 0; tt < Ge.length; tt++)\n                  st.addInPlace(Ge[tt]);\n                for (st.scaleInPlace(1 / Ge.length), tt = 0; tt < Ge.length; tt++)\n                  Je.push(st);\n                return Je;\n              };\n              switch (Y) {\n                case _.a.NO_CAP:\n                  break;\n                case _.a.CAP_START:\n                  L[0] = Qe(L[2]), L[1] = L[2];\n                  break;\n                case _.a.CAP_END:\n                  L[_e] = L[_e - 1], L[_e + 1] = Qe(L[_e - 1]);\n                  break;\n                case _.a.CAP_ALL:\n                  L[0] = Qe(L[2]), L[1] = L[2], L[_e] = L[_e - 1], L[_e + 1] = Qe(L[_e - 1]);\n              }\n              return L;\n            };\n            if (M) {\n              var pe = M._creationDataStorage;\n              return ne = pe.path3D.update(c), te = de(m, c, pe.path3D, pe.pathArray, T, S, E, g, pe.cap, b), M = _.a.CreateRibbon(\"\", te, !1, !1, 0, D || void 0, !1, 0, M);\n            }\n            te = de(m, c, ne = new u.g(c), new Array(), T, S, E, g, v = v < 0 || v > 3 ? 0 : v, b);\n            var ae = C.a.CreateRibbon(x, { pathArray: te, closeArray: l, closePath: h, updatable: w, sideOrientation: N, invertUV: U, frontUVs: X || void 0, backUVs: j || void 0 }, D);\n            return ae._creationDataStorage.pathArray = te, ae._creationDataStorage.path3D = ne, ae._creationDataStorage.cap = v, ae;\n          }, O;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return c;\n        }), f.d(A, \"a\", function() {\n          return T;\n        });\n        var V = f(1), _ = f(9), C = f(4), u = f(7), I = f(151), O = f(25), x = f(73), m = f(15), c = (f(166), f(167), function(S) {\n          function E(g, l, h, v, b, D, w) {\n            l === void 0 && (l = null), h === void 0 && (h = null), v === void 0 && (v = null);\n            var N = S.call(this, g, l, h, v, b) || this;\n            N.useVertexColor = D, N.useVertexAlpha = w, N.color = new _.a(1, 1, 1), N.alpha = 1, v && (N.color = v.color.clone(), N.alpha = v.alpha, N.useVertexColor = v.useVertexColor, N.useVertexAlpha = v.useVertexAlpha), N.intersectionThreshold = 0.1;\n            var M = { attributes: [C.b.PositionKind, \"world0\", \"world1\", \"world2\", \"world3\"], uniforms: [\"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"world\", \"viewProjection\"], needAlphaBlending: !0, defines: [] };\n            return w === !1 && (M.needAlphaBlending = !1), D ? (M.defines.push(\"#define VERTEXCOLOR\"), M.attributes.push(C.b.ColorKind)) : (M.uniforms.push(\"color\"), N.color4 = new _.b()), N._colorShader = new x.a(\"colorShader\", N.getScene(), \"color\", M), N;\n          }\n          return Object(V.d)(E, S), E.prototype._addClipPlaneDefine = function(g) {\n            var l = \"#define \" + g;\n            this._colorShader.options.defines.indexOf(l) === -1 && this._colorShader.options.defines.push(l);\n          }, E.prototype._removeClipPlaneDefine = function(g) {\n            var l = \"#define \" + g, h = this._colorShader.options.defines.indexOf(l);\n            h !== -1 && this._colorShader.options.defines.splice(h, 1);\n          }, E.prototype.isReady = function() {\n            var g = this.getScene();\n            return g.clipPlane ? this._addClipPlaneDefine(\"CLIPPLANE\") : this._removeClipPlaneDefine(\"CLIPPLANE\"), g.clipPlane2 ? this._addClipPlaneDefine(\"CLIPPLANE2\") : this._removeClipPlaneDefine(\"CLIPPLANE2\"), g.clipPlane3 ? this._addClipPlaneDefine(\"CLIPPLANE3\") : this._removeClipPlaneDefine(\"CLIPPLANE3\"), g.clipPlane4 ? this._addClipPlaneDefine(\"CLIPPLANE4\") : this._removeClipPlaneDefine(\"CLIPPLANE4\"), g.clipPlane5 ? this._addClipPlaneDefine(\"CLIPPLANE5\") : this._removeClipPlaneDefine(\"CLIPPLANE5\"), g.clipPlane6 ? this._addClipPlaneDefine(\"CLIPPLANE6\") : this._removeClipPlaneDefine(\"CLIPPLANE6\"), !!this._colorShader.isReady(this) && S.prototype.isReady.call(this);\n          }, E.prototype.getClassName = function() {\n            return \"LinesMesh\";\n          }, Object.defineProperty(E.prototype, \"material\", { get: function() {\n            return this._colorShader;\n          }, set: function(g) {\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"checkCollisions\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), E.prototype._bind = function(g, l, h) {\n            if (!this._geometry)\n              return this;\n            var v = this._colorShader.getEffect(), b = this.isUnIndexed ? null : this._geometry.getIndexBuffer();\n            if (this._geometry._bind(v, b), !this.useVertexColor) {\n              var D = this.color, w = D.r, N = D.g, M = D.b;\n              this.color4.set(w, N, M, this.alpha), this._colorShader.setColor4(\"color\", this.color4);\n            }\n            return m.a.BindClipPlane(v, this.getScene()), this;\n          }, E.prototype._draw = function(g, l, h) {\n            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())\n              return this;\n            var v = this.getScene().getEngine();\n            return this._unIndexed ? v.drawArraysType(O.a.LineListDrawMode, g.verticesStart, g.verticesCount, h) : v.drawElementsType(O.a.LineListDrawMode, g.indexStart, g.indexCount, h), this;\n          }, E.prototype.dispose = function(g) {\n            this._colorShader.dispose(!1, !1, !0), S.prototype.dispose.call(this, g);\n          }, E.prototype.clone = function(g, l, h) {\n            return l === void 0 && (l = null), new E(g, this.getScene(), l, this, h);\n          }, E.prototype.createInstance = function(g) {\n            return new T(g, this);\n          }, E;\n        }(u.a)), T = function(S) {\n          function E(g, l) {\n            var h = S.call(this, g, l) || this;\n            return h.intersectionThreshold = l.intersectionThreshold, h;\n          }\n          return Object(V.d)(E, S), E.prototype.getClassName = function() {\n            return \"InstancedLinesMesh\";\n          }, E;\n        }(I.a);\n      }, function(Be, A, f) {\n        f.r(A), f.d(A, \"AxesViewer\", function() {\n          return O;\n        }), f.d(A, \"BoneAxesViewer\", function() {\n          return c;\n        }), f.d(A, \"DebugLayerTab\", function() {\n          return V;\n        }), f.d(A, \"DebugLayer\", function() {\n          return l;\n        }), f.d(A, \"PhysicsViewer\", function() {\n          return U;\n        }), f.d(A, \"RayHelper\", function() {\n          return j;\n        }), f.d(A, \"SkeletonViewer\", function() {\n          return K;\n        });\n        var V, _ = f(0), C = f(30), u = f(75), I = f(9), O = function() {\n          function $(L, G, Q, oe, re, Y) {\n            if (G === void 0 && (G = 1), Q === void 0 && (Q = 2), this._scaleLinesFactor = 4, this._instanced = !1, this.scene = null, this.scaleLines = 1, this.scaleLines = G, !oe) {\n              var k = new C.a(\"\", L);\n              k.disableLighting = !0, k.emissiveColor = I.a.Red().scale(0.5), oe = u.a._CreateArrow(L, k);\n            }\n            if (!re) {\n              var H = new C.a(\"\", L);\n              H.disableLighting = !0, H.emissiveColor = I.a.Green().scale(0.5), re = u.a._CreateArrow(L, H);\n            }\n            if (!Y) {\n              var Z = new C.a(\"\", L);\n              Z.disableLighting = !0, Z.emissiveColor = I.a.Blue().scale(0.5), Y = u.a._CreateArrow(L, Z);\n            }\n            this._xAxis = oe, this._xAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._yAxis = re, this._yAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._zAxis = Y, this._zAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), Q != null && ($._SetRenderingGroupId(this._xAxis, Q), $._SetRenderingGroupId(this._yAxis, Q), $._SetRenderingGroupId(this._zAxis, Q)), this.scene = L, this.update(new _.e(), _.e.Right(), _.e.Up(), _.e.Forward());\n          }\n          return Object.defineProperty($.prototype, \"xAxis\", { get: function() {\n            return this._xAxis;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"yAxis\", { get: function() {\n            return this._yAxis;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"zAxis\", { get: function() {\n            return this._zAxis;\n          }, enumerable: !1, configurable: !0 }), $.prototype.update = function(L, G, Q, oe) {\n            this._xAxis.position.copyFrom(L), this._xAxis.setDirection(G), this._xAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._yAxis.position.copyFrom(L), this._yAxis.setDirection(Q), this._yAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._zAxis.position.copyFrom(L), this._zAxis.setDirection(oe), this._zAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor);\n          }, $.prototype.createInstance = function() {\n            var L = u.a._CreateArrowInstance(this.scene, this._xAxis), G = u.a._CreateArrowInstance(this.scene, this._yAxis), Q = u.a._CreateArrowInstance(this.scene, this._zAxis), oe = new $(this.scene, this.scaleLines, null, L, G, Q);\n            return oe._instanced = !0, oe;\n          }, $.prototype.dispose = function() {\n            this._xAxis && this._xAxis.dispose(!1, !this._instanced), this._yAxis && this._yAxis.dispose(!1, !this._instanced), this._zAxis && this._zAxis.dispose(!1, !this._instanced), this.scene = null;\n          }, $._SetRenderingGroupId = function(L, G) {\n            L.getChildMeshes().forEach(function(Q) {\n              Q.renderingGroupId = G;\n            });\n          }, $;\n        }(), x = f(1), m = f(23), c = function($) {\n          function L(G, Q, oe, re) {\n            re === void 0 && (re = 1);\n            var Y = $.call(this, G, re) || this;\n            return Y.pos = _.e.Zero(), Y.xaxis = _.e.Zero(), Y.yaxis = _.e.Zero(), Y.zaxis = _.e.Zero(), Y.mesh = oe, Y.bone = Q, Y;\n          }\n          return Object(x.d)(L, $), L.prototype.update = function() {\n            if (this.mesh && this.bone) {\n              var G = this.bone;\n              G._markAsDirtyAndCompose(), G.getAbsolutePositionToRef(this.mesh, this.pos), G.getDirectionToRef(m.a.X, this.mesh, this.xaxis), G.getDirectionToRef(m.a.Y, this.mesh, this.yaxis), G.getDirectionToRef(m.a.Z, this.mesh, this.zaxis), $.prototype.update.call(this, this.pos, this.xaxis, this.yaxis, this.zaxis);\n            }\n          }, L.prototype.dispose = function() {\n            this.mesh && (this.mesh = null, this.bone = null, $.prototype.dispose.call(this));\n          }, L;\n        }(O), T = f(12), S = f(6), E = f(20), g = f(13);\n        Object.defineProperty(E.a.prototype, \"debugLayer\", { get: function() {\n          return this._debugLayer || (this._debugLayer = new l(this)), this._debugLayer;\n        }, enumerable: !0, configurable: !0 }), function($) {\n          $[$.Properties = 0] = \"Properties\", $[$.Debug = 1] = \"Debug\", $[$.Statistics = 2] = \"Statistics\", $[$.Tools = 3] = \"Tools\", $[$.Settings = 4] = \"Settings\";\n        }(V || (V = {}));\n        var l = function() {\n          function $(L) {\n            var G = this;\n            this.BJSINSPECTOR = this._getGlobalInspector(), this._scene = L, this._scene.onDisposeObservable.add(function() {\n              G._scene._debugLayer && G._scene._debugLayer.hide();\n            });\n          }\n          return Object.defineProperty($.prototype, \"onPropertyChangedObservable\", { get: function() {\n            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector ? this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable : (this._onPropertyChangedObservable || (this._onPropertyChangedObservable = new S.c()), this._onPropertyChangedObservable);\n          }, enumerable: !1, configurable: !0 }), $.prototype._createInspector = function(L) {\n            if (!this.isVisible()) {\n              if (this._onPropertyChangedObservable) {\n                for (var G = 0, Q = this._onPropertyChangedObservable.observers; G < Q.length; G++) {\n                  var oe = Q[G];\n                  this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(oe);\n                }\n                this._onPropertyChangedObservable.clear(), this._onPropertyChangedObservable = void 0;\n              }\n              var re = Object(x.a)({ overlay: !1, showExplorer: !0, showInspector: !0, embedMode: !1, handleResize: !0, enablePopup: !0 }, L);\n              this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector(), this.BJSINSPECTOR.Inspector.Show(this._scene, re);\n            }\n          }, $.prototype.select = function(L, G) {\n            this.BJSINSPECTOR && (G && (Object.prototype.toString.call(G) == \"[object String]\" ? this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(G) : this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(G)), this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(L));\n          }, $.prototype._getGlobalInspector = function() {\n            return typeof INSPECTOR < \"u\" ? INSPECTOR : typeof BABYLON < \"u\" && BABYLON.Inspector !== void 0 ? BABYLON : void 0;\n          }, $.prototype.isVisible = function() {\n            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;\n          }, $.prototype.hide = function() {\n            this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.Hide();\n          }, $.prototype.setAsActiveScene = function() {\n            this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);\n          }, $.prototype.show = function(L) {\n            var G = this;\n            return new Promise(function(Q, oe) {\n              if (G.BJSINSPECTOR === void 0) {\n                var re = L && L.inspectorURL ? L.inspectorURL : $.InspectorURL;\n                T.b.LoadScript(re, function() {\n                  G._createInspector(L), Q(G);\n                });\n              } else\n                G._createInspector(L), Q(G);\n            });\n          }, $.InspectorURL = \"https://unpkg.com/babylonjs-inspector@\" + g.a.Version + \"/babylon.inspector.bundle.js\", $;\n        }(), h = f(7), v = f(63), b = f(45), D = f(22), w = f(32), N = f(36), M = f(53), U = function() {\n          function $(L) {\n            this._impostors = [], this._meshes = [], this._numMeshes = 0, this._debugMeshMeshes = new Array(), this._scene = L || D.a.LastCreatedScene;\n            var G = this._scene.getPhysicsEngine();\n            G && (this._physicsEnginePlugin = G.getPhysicsPlugin()), this._utilityLayer = new N.a(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;\n          }\n          return $.prototype._updateDebugMeshes = function() {\n            for (var L = this._physicsEnginePlugin, G = 0; G < this._numMeshes; G++) {\n              var Q = this._impostors[G];\n              if (Q)\n                if (Q.isDisposed)\n                  this.hideImpostor(this._impostors[G--]);\n                else {\n                  if (Q.type === w.a.MeshImpostor)\n                    continue;\n                  var oe = this._meshes[G];\n                  oe && L && L.syncMeshWithImpostor(oe, Q);\n                }\n            }\n          }, $.prototype.showImpostor = function(L, G) {\n            if (!this._scene)\n              return null;\n            for (var Q = 0; Q < this._numMeshes; Q++)\n              if (this._impostors[Q] == L)\n                return null;\n            var oe = this._getDebugMesh(L, G);\n            return oe && (this._impostors[this._numMeshes] = L, this._meshes[this._numMeshes] = oe, this._numMeshes === 0 && (this._renderFunction = this._updateDebugMeshes.bind(this), this._scene.registerBeforeRender(this._renderFunction)), this._numMeshes++), oe;\n          }, $.prototype.hideImpostor = function(L) {\n            if (L && this._scene && this._utilityLayer) {\n              for (var G = !1, Q = this._utilityLayer.utilityLayerScene, oe = 0; oe < this._numMeshes; oe++)\n                if (this._impostors[oe] == L) {\n                  var re = this._meshes[oe];\n                  if (!re)\n                    continue;\n                  Q.removeMesh(re), re.dispose();\n                  var Y = this._debugMeshMeshes.indexOf(re);\n                  Y > -1 && this._debugMeshMeshes.splice(Y, 1), this._numMeshes--, this._numMeshes > 0 ? (this._meshes[oe] = this._meshes[this._numMeshes], this._impostors[oe] = this._impostors[this._numMeshes], this._meshes[this._numMeshes] = null, this._impostors[this._numMeshes] = null) : (this._meshes[0] = null, this._impostors[0] = null), G = !0;\n                  break;\n                }\n              G && this._numMeshes === 0 && this._scene.unregisterBeforeRender(this._renderFunction);\n            }\n          }, $.prototype._getDebugMaterial = function(L) {\n            return this._debugMaterial || (this._debugMaterial = new C.a(\"\", L), this._debugMaterial.wireframe = !0, this._debugMaterial.emissiveColor = I.a.White(), this._debugMaterial.disableLighting = !0), this._debugMaterial;\n          }, $.prototype._getDebugBoxMesh = function(L) {\n            return this._debugBoxMesh || (this._debugBoxMesh = v.a.CreateBox(\"physicsBodyBoxViewMesh\", { size: 1 }, L), this._debugBoxMesh.rotationQuaternion = _.b.Identity(), this._debugBoxMesh.material = this._getDebugMaterial(L), this._debugBoxMesh.setEnabled(!1)), this._debugBoxMesh.createInstance(\"physicsBodyBoxViewInstance\");\n          }, $.prototype._getDebugSphereMesh = function(L) {\n            return this._debugSphereMesh || (this._debugSphereMesh = b.a.CreateSphere(\"physicsBodySphereViewMesh\", { diameter: 1 }, L), this._debugSphereMesh.rotationQuaternion = _.b.Identity(), this._debugSphereMesh.material = this._getDebugMaterial(L), this._debugSphereMesh.setEnabled(!1)), this._debugSphereMesh.createInstance(\"physicsBodyBoxViewInstance\");\n          }, $.prototype._getDebugCylinderMesh = function(L) {\n            return this._debugCylinderMesh || (this._debugCylinderMesh = M.a.CreateCylinder(\"physicsBodyCylinderViewMesh\", { diameterTop: 1, diameterBottom: 1, height: 1 }, L), this._debugCylinderMesh.rotationQuaternion = _.b.Identity(), this._debugCylinderMesh.material = this._getDebugMaterial(L), this._debugCylinderMesh.setEnabled(!1)), this._debugCylinderMesh.createInstance(\"physicsBodyBoxViewInstance\");\n          }, $.prototype._getDebugMeshMesh = function(L, G) {\n            var Q = new h.a(L.name, G, null, L);\n            return Q.position = _.e.Zero(), Q.setParent(L), Q.material = this._getDebugMaterial(G), this._debugMeshMeshes.push(Q), Q;\n          }, $.prototype._getDebugMesh = function(L, G) {\n            var Q = this;\n            if (!this._utilityLayer || G && G.parent && G.parent.physicsImpostor)\n              return null;\n            var oe = null, re = this._utilityLayer.utilityLayerScene;\n            switch (L.type) {\n              case w.a.BoxImpostor:\n                oe = this._getDebugBoxMesh(re), L.getBoxSizeToRef(oe.scaling);\n                break;\n              case w.a.SphereImpostor:\n                oe = this._getDebugSphereMesh(re);\n                var Y = L.getRadius();\n                oe.scaling.x = 2 * Y, oe.scaling.y = 2 * Y, oe.scaling.z = 2 * Y;\n                break;\n              case w.a.MeshImpostor:\n                G && (oe = this._getDebugMeshMesh(G, re));\n                break;\n              case w.a.NoImpostor:\n                G && G.getChildMeshes().filter(function(H) {\n                  return H.physicsImpostor ? 1 : 0;\n                }).forEach(function(H) {\n                  Q._getDebugBoxMesh(re).parent = H;\n                });\n                break;\n              case w.a.CylinderImpostor:\n                oe = this._getDebugCylinderMesh(re);\n                var k = L.object.getBoundingInfo();\n                oe.scaling.x = k.boundingBox.maximum.x - k.boundingBox.minimum.x, oe.scaling.y = k.boundingBox.maximum.y - k.boundingBox.minimum.y, oe.scaling.z = k.boundingBox.maximum.z - k.boundingBox.minimum.z;\n            }\n            return oe;\n          }, $.prototype.dispose = function() {\n            for (var L = this._numMeshes, G = 0; G < L; G++)\n              this.hideImpostor(this._impostors[0]);\n            this._debugBoxMesh && this._debugBoxMesh.dispose(), this._debugSphereMesh && this._debugSphereMesh.dispose(), this._debugCylinderMesh && this._debugCylinderMesh.dispose(), this._debugMaterial && this._debugMaterial.dispose(), this._impostors.length = 0, this._scene = null, this._physicsEnginePlugin = null, this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null);\n          }, $;\n        }(), X = f(40), j = function() {\n          function $(L) {\n            this.ray = L;\n          }\n          return $.CreateAndShow = function(L, G, Q) {\n            var oe = new $(L);\n            return oe.show(G, Q), oe;\n          }, $.prototype.show = function(L, G) {\n            if (!this._renderFunction && this.ray) {\n              var Q = this.ray;\n              this._renderFunction = this._render.bind(this), this._scene = L, this._renderPoints = [Q.origin, Q.origin.add(Q.direction.scale(Q.length))], this._renderLine = h.a.CreateLines(\"ray\", this._renderPoints, L, !0), this._renderLine.isPickable = !1, this._renderFunction && this._scene.registerBeforeRender(this._renderFunction);\n            }\n            G && this._renderLine && this._renderLine.color.copyFrom(G);\n          }, $.prototype.hide = function() {\n            this._renderFunction && this._scene && (this._scene.unregisterBeforeRender(this._renderFunction), this._scene = null, this._renderFunction = null, this._renderLine && (this._renderLine.dispose(), this._renderLine = null), this._renderPoints = []);\n          }, $.prototype._render = function() {\n            var L = this.ray;\n            if (L) {\n              var G = this._renderPoints[1], Q = Math.min(L.length, 1e6);\n              G.copyFrom(L.direction), G.scaleInPlace(Q), G.addInPlace(L.origin), this._renderPoints[0].copyFrom(L.origin), h.a.CreateLines(\"ray\", this._renderPoints, this._scene, !0, this._renderLine);\n            }\n          }, $.prototype.attachToMesh = function(L, G, Q, oe) {\n            var re = this;\n            this._attachedToMesh = L;\n            var Y = this.ray;\n            Y && (Y.direction || (Y.direction = _.e.Zero()), Y.origin || (Y.origin = _.e.Zero()), oe && (Y.length = oe), Q || (Q = _.e.Zero()), G || (G = new _.e(0, 0, -1)), this._scene || (this._scene = L.getScene()), this._meshSpaceDirection ? (this._meshSpaceDirection.copyFrom(G), this._meshSpaceOrigin.copyFrom(Q)) : (this._meshSpaceDirection = G.clone(), this._meshSpaceOrigin = Q.clone()), this._onAfterRenderObserver || (this._onAfterRenderObserver = this._scene.onBeforeRenderObservable.add(function() {\n              return re._updateToMesh();\n            }), this._onAfterStepObserver = this._scene.onAfterStepObservable.add(function() {\n              return re._updateToMesh();\n            })), this._attachedToMesh.computeWorldMatrix(!0), this._updateToMesh());\n          }, $.prototype.detachFromMesh = function() {\n            this._attachedToMesh && this._scene && (this._onAfterRenderObserver && (this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver), this._scene.onAfterStepObservable.remove(this._onAfterStepObserver)), this._attachedToMesh = null, this._onAfterRenderObserver = null, this._onAfterStepObserver = null, this._scene = null);\n          }, $.prototype._updateToMesh = function() {\n            var L = this.ray;\n            this._attachedToMesh && L && (this._attachedToMesh._isDisposed ? this.detachFromMesh() : (this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, L.direction), _.e.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), L.origin)));\n          }, $.prototype.dispose = function() {\n            this.hide(), this.detachFromMesh(), this.ray = null;\n          }, $;\n        }(), ne = f(25), te = f(73), de = f(62), pe = f(4), ae = f(5), ee = f(97), K = function() {\n          function $(L, G, Q, oe, re, Y) {\n            var k, H, Z, W, q, he, ge, me, _e, ye, Pe, be, Fe, ke;\n            oe === void 0 && (oe = !0), re === void 0 && (re = 3), Y === void 0 && (Y = {}), this.skeleton = L, this.mesh = G, this.autoUpdateBonesMatrices = oe, this.renderingGroupId = re, this.options = Y, this.color = I.a.White(), this._debugLines = new Array(), this._localAxes = null, this._isEnabled = !1, this._obs = null, this._scene = Q, this._ready = !1, Y.pauseAnimations = (k = Y.pauseAnimations) === null || k === void 0 || k, Y.returnToRest = (H = Y.returnToRest) !== null && H !== void 0 && H, Y.displayMode = (Z = Y.displayMode) !== null && Z !== void 0 ? Z : $.DISPLAY_LINES, Y.displayOptions = (W = Y.displayOptions) !== null && W !== void 0 ? W : {}, Y.displayOptions.midStep = (q = Y.displayOptions.midStep) !== null && q !== void 0 ? q : 0.235, Y.displayOptions.midStepFactor = (he = Y.displayOptions.midStepFactor) !== null && he !== void 0 ? he : 0.155, Y.displayOptions.sphereBaseSize = (ge = Y.displayOptions.sphereBaseSize) !== null && ge !== void 0 ? ge : 0.15, Y.displayOptions.sphereScaleUnit = (me = Y.displayOptions.sphereScaleUnit) !== null && me !== void 0 ? me : 2, Y.displayOptions.sphereFactor = (_e = Y.displayOptions.sphereFactor) !== null && _e !== void 0 ? _e : 0.865, Y.displayOptions.spurFollowsChild = (ye = Y.displayOptions.spurFollowsChild) !== null && ye !== void 0 && ye, Y.displayOptions.showLocalAxes = (Pe = Y.displayOptions.showLocalAxes) !== null && Pe !== void 0 && Pe, Y.displayOptions.localAxesSize = (be = Y.displayOptions.localAxesSize) !== null && be !== void 0 ? be : 0.075, Y.computeBonesUsingShaders = (Fe = Y.computeBonesUsingShaders) === null || Fe === void 0 || Fe, Y.useAllBones = (ke = Y.useAllBones) === null || ke === void 0 || ke;\n            var We = G.getVerticesData(pe.b.MatricesIndicesKind), je = G.getVerticesData(pe.b.MatricesWeightsKind);\n            if (this._boneIndices = /* @__PURE__ */ new Set(), !Y.useAllBones && We && je)\n              for (var He = 0; He < We.length; ++He) {\n                var Qe = We[He];\n                je[He] !== 0 && this._boneIndices.add(Qe);\n              }\n            this._utilityLayer = new N.a(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;\n            var Ge = this.options.displayMode || 0;\n            Ge > $.DISPLAY_SPHERE_AND_SPURS && (Ge = $.DISPLAY_LINES), this.displayMode = Ge, this.update(), this._bindObs();\n          }\n          return $.CreateBoneWeightShader = function(L, G) {\n            var Q, oe, re, Y, k, H, Z = L.skeleton, W = (Q = L.colorBase) !== null && Q !== void 0 ? Q : I.a.Black(), q = (oe = L.colorZero) !== null && oe !== void 0 ? oe : I.a.Blue(), he = (re = L.colorQuarter) !== null && re !== void 0 ? re : I.a.Green(), ge = (Y = L.colorHalf) !== null && Y !== void 0 ? Y : I.a.Yellow(), me = (k = L.colorFull) !== null && k !== void 0 ? k : I.a.Red(), _e = (H = L.targetBoneIndex) !== null && H !== void 0 ? H : 0;\n            ae.a.ShadersStore[\"boneWeights:\" + Z.name + \"VertexShader\"] = `precision highp float;\n\n        attribute vec3 position;\n        attribute vec2 uv;\n\n        uniform mat4 view;\n        uniform mat4 projection;\n        uniform mat4 worldViewProjection;\n\n        #include<bonesDeclaration>\n        #if NUM_BONE_INFLUENCERS == 0\n            attribute vec4 matricesIndices;\n            attribute vec4 matricesWeights;\n        #endif\n\n        #include<instancesDeclaration>\n\n        varying vec3 vColor;\n\n        uniform vec3 colorBase;\n        uniform vec3 colorZero;\n        uniform vec3 colorQuarter;\n        uniform vec3 colorHalf;\n        uniform vec3 colorFull;\n\n        uniform float targetBoneIndex;\n\n        void main() {\n            vec3 positionUpdated = position;\n\n            #include<instancesVertex>\n            #include<bonesVertex>\n\n            vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n            vec3 color = colorBase;\n            float totalWeight = 0.;\n            if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){\n                totalWeight += matricesWeights[0];\n            }\n            if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){\n                totalWeight += matricesWeights[1];\n            }\n            if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){\n                totalWeight += matricesWeights[2];\n            }\n            if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){\n                totalWeight += matricesWeights[3];\n            }\n\n            color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));\n            color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));\n            color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));\n            color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));\n            vColor = color;\n\n        gl_Position = projection * view * worldPos;\n        }`, ae.a.ShadersStore[\"boneWeights:\" + Z.name + \"FragmentShader\"] = `\n            precision highp float;\n            varying vec3 vPosition;\n\n            varying vec3 vColor;\n\n            void main() {\n                vec4 color = vec4(vColor, 1.0);\n                gl_FragColor = color;\n            }\n        `;\n            var ye = new te.a(\"boneWeight:\" + Z.name, G, { vertex: \"boneWeights:\" + Z.name, fragment: \"boneWeights:\" + Z.name }, { attributes: [\"position\", \"normal\", \"matricesIndices\", \"matricesWeights\"], uniforms: [\"world\", \"worldView\", \"worldViewProjection\", \"view\", \"projection\", \"viewProjection\", \"colorBase\", \"colorZero\", \"colorQuarter\", \"colorHalf\", \"colorFull\", \"targetBoneIndex\"] });\n            return ye.setColor3(\"colorBase\", W), ye.setColor3(\"colorZero\", q), ye.setColor3(\"colorQuarter\", he), ye.setColor3(\"colorHalf\", ge), ye.setColor3(\"colorFull\", me), ye.setFloat(\"targetBoneIndex\", _e), ye.getClassName = function() {\n              return \"BoneWeightShader\";\n            }, ye.transparencyMode = ne.a.MATERIAL_OPAQUE, ye;\n          }, $.CreateSkeletonMapShader = function(L, G) {\n            var Q, oe = L.skeleton, re = (Q = L.colorMap) !== null && Q !== void 0 ? Q : [{ color: new I.a(1, 0.38, 0.18), location: 0 }, { color: new I.a(0.59, 0.18, 1), location: 0.2 }, { color: new I.a(0.59, 1, 0.18), location: 0.4 }, { color: new I.a(1, 0.87, 0.17), location: 0.6 }, { color: new I.a(1, 0.17, 0.42), location: 0.8 }, { color: new I.a(0.17, 0.68, 1), location: 1 }], Y = oe.bones.length + 1, k = $._CreateBoneMapColorBuffer(Y, re, G), H = new te.a(\"boneWeights:\" + oe.name, G, { vertexSource: `precision highp float;\n\n            attribute vec3 position;\n            attribute vec2 uv;\n\n            uniform mat4 view;\n            uniform mat4 projection;\n            uniform mat4 worldViewProjection;\n            uniform float colorMap[` + 4 * oe.bones.length + `];\n\n            #include<bonesDeclaration>\n            #if NUM_BONE_INFLUENCERS == 0\n                attribute vec4 matricesIndices;\n                attribute vec4 matricesWeights;\n            #endif\n            #include<instancesDeclaration>\n\n            varying vec3 vColor;\n\n            void main() {\n                vec3 positionUpdated = position;\n\n                #include<instancesVertex>\n                #include<bonesVertex>\n\n                vec3 color = vec3(0.);\n                bool first = true;\n\n                for (int i = 0; i < 4; i++) {\n                    int boneIdx = int(matricesIndices[i]);\n                    float boneWgt = matricesWeights[i];\n\n                    vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);\n\n                    if (boneWgt > 0.) {\n                        if (first) {\n                            first = false;\n                            color = c;\n                        } else {\n                            color = mix(color, c, boneWgt);\n                        }\n                    }\n                }\n\n                vColor = color;\n\n                vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n                gl_Position = projection * view * worldPos;\n            }`, fragmentSource: `\n            precision highp float;\n            varying vec3 vColor;\n\n            void main() {\n                vec4 color = vec4( vColor, 1.0 );\n                gl_FragColor = color;\n            }\n            ` }, { attributes: [\"position\", \"normal\", \"matricesIndices\", \"matricesWeights\"], uniforms: [\"world\", \"worldView\", \"worldViewProjection\", \"view\", \"projection\", \"viewProjection\", \"colorMap\"] });\n            return H.setFloats(\"colorMap\", k), H.getClassName = function() {\n              return \"SkeletonMapShader\";\n            }, H.transparencyMode = ne.a.MATERIAL_OPAQUE, H;\n          }, $._CreateBoneMapColorBuffer = function(L, G, Q) {\n            var oe = new de.a(\"temp\", { width: L, height: 1 }, Q, !1), re = oe.getContext(), Y = re.createLinearGradient(0, 0, L, 0);\n            G.forEach(function(W) {\n              Y.addColorStop(W.location, W.color.toHexString());\n            }), re.fillStyle = Y, re.fillRect(0, 0, L, 1), oe.update();\n            for (var k = [], H = re.getImageData(0, 0, L, 1).data, Z = 0; Z < H.length; Z++)\n              k.push(H[Z] * (1 / 255));\n            return oe.dispose(), k;\n          }, Object.defineProperty($.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"utilityLayer\", { get: function() {\n            return this._utilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"isReady\", { get: function() {\n            return this._ready;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"ready\", { set: function(L) {\n            this._ready = L;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"debugMesh\", { get: function() {\n            return this._debugMesh;\n          }, set: function(L) {\n            this._debugMesh = L;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"displayMode\", { get: function() {\n            return this.options.displayMode || $.DISPLAY_LINES;\n          }, set: function(L) {\n            L > $.DISPLAY_SPHERE_AND_SPURS && (L = $.DISPLAY_LINES), this.options.displayMode = L;\n          }, enumerable: !1, configurable: !0 }), $.prototype._bindObs = function() {\n            var L = this;\n            switch (this.displayMode) {\n              case $.DISPLAY_LINES:\n                this._obs = this.scene.onBeforeRenderObservable.add(function() {\n                  L._displayLinesUpdate();\n                });\n            }\n          }, $.prototype.update = function() {\n            switch (this.displayMode) {\n              case $.DISPLAY_LINES:\n                this._displayLinesUpdate();\n                break;\n              case $.DISPLAY_SPHERES:\n                this._buildSpheresAndSpurs(!0);\n                break;\n              case $.DISPLAY_SPHERE_AND_SPURS:\n                this._buildSpheresAndSpurs(!1);\n            }\n            this._buildLocalAxes();\n          }, Object.defineProperty($.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(L) {\n            this.isEnabled !== L && (this._isEnabled = L, this.debugMesh && this.debugMesh.setEnabled(L), L && !this._obs ? this._bindObs() : !L && this._obs && (this.scene.onBeforeRenderObservable.remove(this._obs), this._obs = null));\n          }, enumerable: !1, configurable: !0 }), $.prototype._getBonePosition = function(L, G, Q, oe, re, Y) {\n            oe === void 0 && (oe = 0), re === void 0 && (re = 0), Y === void 0 && (Y = 0);\n            var k = _.c.Matrix[0], H = G.getParent();\n            if (k.copyFrom(G.getLocalMatrix()), oe !== 0 || re !== 0 || Y !== 0) {\n              var Z = _.c.Matrix[1];\n              _.a.IdentityToRef(Z), Z.setTranslationFromFloats(oe, re, Y), Z.multiplyToRef(k, k);\n            }\n            H && k.multiplyToRef(H.getAbsoluteTransform(), k), k.multiplyToRef(Q, k), L.x = k.m[12], L.y = k.m[13], L.z = k.m[14];\n          }, $.prototype._getLinesForBonesWithLength = function(L, G) {\n            for (var Q = L.length, oe = this.mesh._effectiveMesh.position, re = 0, Y = 0; Y < Q; Y++) {\n              var k = L[Y], H = this._debugLines[re];\n              k._index !== -1 && (this._boneIndices.has(k.getIndex()) || this.options.useAllBones) && (H || (H = [_.e.Zero(), _.e.Zero()], this._debugLines[re] = H), this._getBonePosition(H[0], k, G), this._getBonePosition(H[1], k, G, 0, k.length, 0), H[0].subtractInPlace(oe), H[1].subtractInPlace(oe), re++);\n            }\n          }, $.prototype._getLinesForBonesNoLength = function(L) {\n            for (var G = L.length, Q = 0, oe = this.mesh._effectiveMesh, re = oe.position, Y = G - 1; Y >= 0; Y--) {\n              var k = L[Y], H = k.getParent();\n              if (H && (this._boneIndices.has(k.getIndex()) || this.options.useAllBones)) {\n                var Z = this._debugLines[Q];\n                Z || (Z = [_.e.Zero(), _.e.Zero()], this._debugLines[Q] = Z), k.getAbsolutePositionToRef(oe, Z[0]), H.getAbsolutePositionToRef(oe, Z[1]), Z[0].subtractInPlace(re), Z[1].subtractInPlace(re), Q++;\n              }\n            }\n          }, $.prototype._revert = function(L) {\n            this.options.pauseAnimations && (this.scene.animationsEnabled = L, this.utilityLayer.utilityLayerScene.animationsEnabled = L);\n          }, $.prototype._getAbsoluteBindPoseToRef = function(L, G) {\n            L !== null && L._index !== -1 ? (this._getAbsoluteBindPoseToRef(L.getParent(), G), L.getBindPose().multiplyToRef(G, G)) : G.copyFrom(_.a.Identity());\n          }, $.prototype._buildSpheresAndSpurs = function(L) {\n            var G, Q;\n            L === void 0 && (L = !0), this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this._ready = !1;\n            var oe = (G = this.utilityLayer) === null || G === void 0 ? void 0 : G.utilityLayerScene, re = this.skeleton.bones, Y = [], k = [], H = this.scene.animationsEnabled;\n            try {\n              this.options.pauseAnimations && (this.scene.animationsEnabled = !1, oe.animationsEnabled = !1), this.options.returnToRest && this.skeleton.returnToRest(), this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms();\n              for (var Z = Number.NEGATIVE_INFINITY, W = this.options.displayOptions || {}, q = function(He) {\n                var Qe = re[He];\n                if (Qe._index === -1 || !he._boneIndices.has(Qe.getIndex()) && !he.options.useAllBones)\n                  return \"continue\";\n                var Ge = new _.a();\n                he._getAbsoluteBindPoseToRef(Qe, Ge);\n                var tt = new _.e();\n                Ge.decompose(void 0, void 0, tt), Qe.children.forEach(function(Ot, St) {\n                  var Ct = new _.a();\n                  Ot.getBindPose().multiplyToRef(Ge, Ct);\n                  var nn = new _.e();\n                  Ct.decompose(void 0, void 0, nn);\n                  var Qt = _.e.Distance(tt, nn);\n                  if (Qt > Z && (Z = Qt), !L) {\n                    for (var $t = nn.clone().subtract(tt.clone()), Ie = $t.length(), Sn = $t.normalize().scale(Ie), en = W.midStep || 0.165, An = W.midStepFactor || 0.215, Ue = Sn.scale(en), Pn = ee.a.ExtrudeShapeCustom(\"skeletonViewer\", { shape: [new _.e(1, -1, 0), new _.e(1, 1, 0), new _.e(-1, 1, 0), new _.e(-1, -1, 0), new _.e(1, -1, 0)], path: [_.e.Zero(), Ue, Sn], scaleFunction: function(So) {\n                      switch (So) {\n                        case 0:\n                        case 2:\n                          return 0;\n                        case 1:\n                          return Ie * An;\n                      }\n                      return 0;\n                    }, sideOrientation: h.a.DEFAULTSIDE, updatable: !1 }, oe), rr = Pn.getTotalVertices(), Xe = [], En = [], Qn = 0; Qn < rr; Qn++)\n                      Xe.push(1, 0, 0, 0), W.spurFollowsChild && Qn > 9 ? En.push(Ot.getIndex(), 0, 0, 0) : En.push(Qe.getIndex(), 0, 0, 0);\n                    Pn.position = tt.clone(), Pn.setVerticesData(pe.b.MatricesWeightsKind, Xe, !1), Pn.setVerticesData(pe.b.MatricesIndicesKind, En, !1), Pn.convertToFlatShadedMesh(), k.push(Pn);\n                  }\n                });\n                for (var Je = W.sphereBaseSize || 0.2, st = b.a.CreateSphere(\"skeletonViewer\", { segments: 6, diameter: Je, updatable: !0 }, oe), at = st.getTotalVertices(), pt = [], Tt = [], Lt = 0; Lt < at; Lt++)\n                  pt.push(1, 0, 0, 0), Tt.push(Qe.getIndex(), 0, 0, 0);\n                st.setVerticesData(pe.b.MatricesWeightsKind, pt, !1), st.setVerticesData(pe.b.MatricesIndicesKind, Tt, !1), st.position = tt.clone(), Y.push([st, Qe]);\n              }, he = this, ge = 0; ge < re.length; ge++)\n                q(ge);\n              var me = W.sphereScaleUnit || 2, _e = W.sphereFactor || 0.85, ye = [];\n              for (ge = 0; ge < Y.length; ge++) {\n                for (var Pe = Y[ge], be = Pe[0], Fe = Pe[1], ke = 1 / (me / Z), We = 0, je = Fe; je.getParent() && je.getParent().getIndex() !== -1; )\n                  We++, je = je.getParent();\n                be.scaling.scaleInPlace(ke * Math.pow(_e, We)), ye.push(be);\n              }\n              this.debugMesh = h.a.MergeMeshes(ye.concat(k), !0, !0), this.debugMesh && (this.debugMesh.renderingGroupId = this.renderingGroupId, this.debugMesh.skeleton = this.skeleton, this.debugMesh.parent = this.mesh, this.debugMesh.computeBonesUsingShaders = (Q = this.options.computeBonesUsingShaders) === null || Q === void 0 || Q, this.debugMesh.alwaysSelectAsActiveMesh = !0), this.utilityLayer._getSharedGizmoLight().intensity = 0.7, this._revert(H), this.ready = !0;\n            } catch (He) {\n              console.error(He), this._revert(H), this.dispose();\n            }\n          }, $.prototype._buildLocalAxes = function() {\n            var L;\n            this._localAxes && this._localAxes.dispose(), this._localAxes = null;\n            var G = this.options.displayOptions || {};\n            if (G.showLocalAxes) {\n              var Q = this._utilityLayer.utilityLayerScene, oe = G.localAxesSize || 0.075, re = [], Y = [], k = new I.b(1, 0, 0, 1), H = new I.b(0, 1, 0, 1), Z = new I.b(0, 0, 1, 1), W = [], q = [];\n              for (var he in this.skeleton.bones) {\n                var ge = this.skeleton.bones[he];\n                if (ge._index !== -1 && (this._boneIndices.has(ge.getIndex()) || this.options.useAllBones)) {\n                  var me = new _.a(), _e = new _.e();\n                  this._getAbsoluteBindPoseToRef(ge, me), me.decompose(void 0, void 0, _e);\n                  var ye = ge.getBindPose().getRotationMatrix(), Pe = _.e.TransformCoordinates(new _.e(0 + oe, 0, 0), ye), be = _.e.TransformCoordinates(new _.e(0, 0 + oe, 0), ye), Fe = _.e.TransformCoordinates(new _.e(0, 0, 0 + oe), ye), ke = [[_e, _e.add(Pe)], [_e, _e.add(be)], [_e, _e.add(Fe)]], We = [[k, k], [H, H], [Z, Z]];\n                  re.push.apply(re, ke), Y.push.apply(Y, We);\n                  for (var je = 0; je < 6; je++)\n                    W.push(1, 0, 0, 0), q.push(ge.getIndex(), 0, 0, 0);\n                }\n              }\n              this._localAxes = X.a.CreateLineSystem(\"localAxes\", { lines: re, colors: Y, updatable: !0 }, Q), this._localAxes.setVerticesData(pe.b.MatricesWeightsKind, W, !1), this._localAxes.setVerticesData(pe.b.MatricesIndicesKind, q, !1), this._localAxes.skeleton = this.skeleton, this._localAxes.renderingGroupId = this.renderingGroupId, this._localAxes.parent = this.mesh, this._localAxes.computeBonesUsingShaders = (L = this.options.computeBonesUsingShaders) === null || L === void 0 || L;\n            }\n          }, $.prototype._displayLinesUpdate = function() {\n            if (this._utilityLayer) {\n              this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms();\n              var L = this.mesh._effectiveMesh;\n              this.skeleton.bones[0].length === void 0 ? this._getLinesForBonesNoLength(this.skeleton.bones) : this._getLinesForBonesWithLength(this.skeleton.bones, L.getWorldMatrix());\n              var G = this._utilityLayer.utilityLayerScene;\n              G && (this._debugMesh ? X.a.CreateLineSystem(\"\", { lines: this._debugLines, updatable: !0, instance: this._debugMesh }, G) : (this._debugMesh = X.a.CreateLineSystem(\"\", { lines: this._debugLines, updatable: !0, instance: null }, G), this._debugMesh.renderingGroupId = this.renderingGroupId), this._debugMesh.position.copyFrom(this.mesh.position), this._debugMesh.color = this.color);\n            }\n          }, $.prototype.changeDisplayMode = function(L) {\n            var G = !!this.isEnabled;\n            this.displayMode !== L && (this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.displayMode = L, this.update(), this._bindObs(), this.isEnabled = G);\n          }, $.prototype.changeDisplayOptions = function(L, G) {\n            var Q = !!this.isEnabled;\n            this.options.displayOptions[L] = G, this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.update(), this._bindObs(), this.isEnabled = Q;\n          }, $.prototype.dispose = function() {\n            this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null), this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null), this.ready = !1;\n          }, $.DISPLAY_LINES = 0, $.DISPLAY_SPHERES = 1, $.DISPLAY_SPHERE_AND_SPURS = 2, $;\n        }();\n      }, function(Be, A, f) {\n        var V = \"morphTargetsVertex\", _ = `#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(0);\n        function _(u, I, O, x, m) {\n          m === void 0 && (m = null);\n          for (var c = new V.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), T = new V.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), S = O; S < O + x; S++) {\n            var E = 3 * I[S], g = u[E], l = u[E + 1], h = u[E + 2];\n            c.minimizeInPlaceFromFloats(g, l, h), T.maximizeInPlaceFromFloats(g, l, h);\n          }\n          return m && (c.x -= c.x * m.x + m.y, c.y -= c.y * m.x + m.y, c.z -= c.z * m.x + m.y, T.x += T.x * m.x + m.y, T.y += T.y * m.x + m.y, T.z += T.z * m.x + m.y), { minimum: c, maximum: T };\n        }\n        function C(u, I, O, x, m) {\n          x === void 0 && (x = null);\n          var c = new V.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), T = new V.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n          m || (m = 3);\n          for (var S = I, E = I * m; S < I + O; S++, E += m) {\n            var g = u[E], l = u[E + 1], h = u[E + 2];\n            c.minimizeInPlaceFromFloats(g, l, h), T.maximizeInPlaceFromFloats(g, l, h);\n          }\n          return x && (c.x -= c.x * x.x + x.y, c.y -= c.y * x.x + x.y, c.z -= c.z * x.x + x.y, T.x += T.x * x.x + x.y, T.y += T.y * x.x + x.y, T.z += T.z * x.x + x.y), { minimum: c, maximum: T };\n        }\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(44), _ = f(0), C = f(28), u = function() {\n          function I(O, x, m) {\n            this.vectors = V.a.BuildArray(8, _.e.Zero), this.center = _.e.Zero(), this.centerWorld = _.e.Zero(), this.extendSize = _.e.Zero(), this.extendSizeWorld = _.e.Zero(), this.directions = V.a.BuildArray(3, _.e.Zero), this.vectorsWorld = V.a.BuildArray(8, _.e.Zero), this.minimumWorld = _.e.Zero(), this.maximumWorld = _.e.Zero(), this.minimum = _.e.Zero(), this.maximum = _.e.Zero(), this.reConstruct(O, x, m);\n          }\n          return I.prototype.reConstruct = function(O, x, m) {\n            var c = O.x, T = O.y, S = O.z, E = x.x, g = x.y, l = x.z, h = this.vectors;\n            this.minimum.copyFromFloats(c, T, S), this.maximum.copyFromFloats(E, g, l), h[0].copyFromFloats(c, T, S), h[1].copyFromFloats(E, g, l), h[2].copyFromFloats(E, T, S), h[3].copyFromFloats(c, g, S), h[4].copyFromFloats(c, T, l), h[5].copyFromFloats(E, g, S), h[6].copyFromFloats(c, g, l), h[7].copyFromFloats(E, T, l), x.addToRef(O, this.center).scaleInPlace(0.5), x.subtractToRef(O, this.extendSize).scaleInPlace(0.5), this._worldMatrix = m || _.a.IdentityReadOnly, this._update(this._worldMatrix);\n          }, I.prototype.scale = function(O) {\n            var x = I.TmpVector3, m = this.maximum.subtractToRef(this.minimum, x[0]), c = m.length();\n            m.normalizeFromLength(c);\n            var T = c * O, S = m.scaleInPlace(0.5 * T), E = this.center.subtractToRef(S, x[1]), g = this.center.addToRef(S, x[2]);\n            return this.reConstruct(E, g, this._worldMatrix), this;\n          }, I.prototype.getWorldMatrix = function() {\n            return this._worldMatrix;\n          }, I.prototype._update = function(O) {\n            var x = this.minimumWorld, m = this.maximumWorld, c = this.directions, T = this.vectorsWorld, S = this.vectors;\n            if (O.isIdentity()) {\n              for (x.copyFrom(this.minimum), m.copyFrom(this.maximum), E = 0; E < 8; ++E)\n                T[E].copyFrom(S[E]);\n              this.extendSizeWorld.copyFrom(this.extendSize), this.centerWorld.copyFrom(this.center);\n            } else {\n              x.setAll(Number.MAX_VALUE), m.setAll(-Number.MAX_VALUE);\n              for (var E = 0; E < 8; ++E) {\n                var g = T[E];\n                _.e.TransformCoordinatesToRef(S[E], O, g), x.minimizeInPlace(g), m.maximizeInPlace(g);\n              }\n              m.subtractToRef(x, this.extendSizeWorld).scaleInPlace(0.5), m.addToRef(x, this.centerWorld).scaleInPlace(0.5);\n            }\n            _.e.FromArrayToRef(O.m, 0, c[0]), _.e.FromArrayToRef(O.m, 4, c[1]), _.e.FromArrayToRef(O.m, 8, c[2]), this._worldMatrix = O;\n          }, I.prototype.isInFrustum = function(O) {\n            return I.IsInFrustum(this.vectorsWorld, O);\n          }, I.prototype.isCompletelyInFrustum = function(O) {\n            return I.IsCompletelyInFrustum(this.vectorsWorld, O);\n          }, I.prototype.intersectsPoint = function(O) {\n            var x = this.minimumWorld, m = this.maximumWorld, c = x.x, T = x.y, S = x.z, E = m.x, g = m.y, l = m.z, h = O.x, v = O.y, b = O.z, D = -C.a;\n            return !(E - h < D || D > h - c) && !(g - v < D || D > v - T) && !(l - b < D || D > b - S);\n          }, I.prototype.intersectsSphere = function(O) {\n            return I.IntersectsSphere(this.minimumWorld, this.maximumWorld, O.centerWorld, O.radiusWorld);\n          }, I.prototype.intersectsMinMax = function(O, x) {\n            var m = this.minimumWorld, c = this.maximumWorld, T = m.x, S = m.y, E = m.z, g = c.x, l = c.y, h = c.z, v = O.x, b = O.y, D = O.z, w = x.x, N = x.y, M = x.z;\n            return !(g < v || T > w) && !(l < b || S > N) && !(h < D || E > M);\n          }, I.Intersects = function(O, x) {\n            return O.intersectsMinMax(x.minimumWorld, x.maximumWorld);\n          }, I.IntersectsSphere = function(O, x, m, c) {\n            var T = I.TmpVector3[0];\n            return _.e.ClampToRef(m, O, x, T), _.e.DistanceSquared(m, T) <= c * c;\n          }, I.IsCompletelyInFrustum = function(O, x) {\n            for (var m = 0; m < 6; ++m)\n              for (var c = x[m], T = 0; T < 8; ++T)\n                if (c.dotCoordinate(O[T]) < 0)\n                  return !1;\n            return !0;\n          }, I.IsInFrustum = function(O, x) {\n            for (var m = 0; m < 6; ++m) {\n              for (var c = !0, T = x[m], S = 0; S < 8; ++S)\n                if (T.dotCoordinate(O[S]) >= 0) {\n                  c = !1;\n                  break;\n                }\n              if (c)\n                return !1;\n            }\n            return !0;\n          }, I.TmpVector3 = V.a.BuildArray(3, _.e.Zero), I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(38), _ = function() {\n          function C() {\n          }\n          return C.SetImmediate = function(u) {\n            V.a.IsWindowObjectExist() && window.setImmediate ? window.setImmediate(u) : setTimeout(u, 1);\n          }, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(0), _ = f(2), C = function() {\n          function u() {\n            this.previousWorldMatrices = {}, this.previousBones = {};\n          }\n          return u.AddUniforms = function(I) {\n            I.push(\"previousWorld\", \"previousViewProjection\");\n          }, u.AddSamplers = function(I) {\n          }, u.prototype.bindForSubMesh = function(I, O, x, m, c) {\n            O.prePassRenderer && O.prePassRenderer.enabled && O.prePassRenderer.getIndex(_.a.PREPASS_VELOCITY_TEXTURE_TYPE) !== -1 && (this.previousWorldMatrices[x.uniqueId] || (this.previousWorldMatrices[x.uniqueId] = V.a.Identity()), this.previousViewProjection || (this.previousViewProjection = O.getTransformMatrix()), I.setMatrix(\"previousWorld\", this.previousWorldMatrices[x.uniqueId]), I.setMatrix(\"previousViewProjection\", this.previousViewProjection), this.previousWorldMatrices[x.uniqueId] = m.clone(), this.previousViewProjection = O.getTransformMatrix().clone());\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        var V = \"lightFragmentDeclaration\", _ = `#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"lightUboDeclaration\", _ = `#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"imageProcessingDeclaration\", _ = `#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"imageProcessingFunctions\", _ = `#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\n#define inline\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{\nfloat sliceSize=2.0*sampler3dSetting.x;\n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;\nsliceUV.x+=sliceInteger*sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice0Color=texture2D(colorTransform,sliceUV);\nsliceUV.x+=sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice1Color=texture2D(colorTransform,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;\n}\n#endif\n#ifdef TONEMAPPING_ACES\n\n\n\n\n\nconst mat3 ACESInputMat=mat3(\nvec3(0.59719,0.07600,0.02840),\nvec3(0.35458,0.90834,0.13383),\nvec3(0.04823,0.01566,0.83777)\n);\n\nconst mat3 ACESOutputMat=mat3(\nvec3( 1.60475,-0.10208,-0.00327),\nvec3(-0.53108,1.10813,-0.07276),\nvec3(-0.07367,-0.00605,1.07602)\n);\nvec3 RRTAndODTFit(vec3 v)\n{\nvec3 a=v*(v+0.0245786)-0.000090537;\nvec3 b=v*(0.983729*v+0.4329510)+0.238081;\nreturn a/b;\n}\nvec3 ACESFitted(vec3 color)\n{\ncolor=ACESInputMat*color;\n\ncolor=RRTAndODTFit(color);\ncolor=ACESOutputMat*color;\n\ncolor=saturate(color);\nreturn color;\n}\n#endif\nvec4 applyImageProcessing(vec4 result) {\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\n\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;\nviewportXY=viewportXY*2.0-1.0;\nvec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);\nfloat vignetteTerm=dot(vignetteXY1,vignetteXY1);\nfloat vignette=pow(vignetteTerm,vignetteSettings2.w);\n\nvec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);\nresult.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#ifdef TONEMAPPING\n#ifdef TONEMAPPING_ACES\nresult.rgb=ACESFitted(result.rgb);\n#else\nconst float tonemappingCalibration=1.590579;\nresult.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\n#endif\n\nresult.rgb=toGammaSpace(result.rgb);\nresult.rgb=saturate(result.rgb);\n#ifdef CONTRAST\n\nvec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);\nif (contrast<1.0) {\n\nresult.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);\n} else {\n\nresult.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);\n}\n#endif\n\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\n\nfloat luma=getLuminance(result.rgb);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\nreturn result;\n}`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"clipPlaneFragment\", _ = `#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE2\nif (fClipDistance2>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE3\nif (fClipDistance3>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE4\nif (fClipDistance4>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE5\nif (fClipDistance5>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE6\nif (fClipDistance6>0.0)\n{\ndiscard;\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"clipPlaneVertex\", _ = `#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._count = 0, this._data = {};\n          }\n          return _.prototype.copyFrom = function(C) {\n            var u = this;\n            this.clear(), C.forEach(function(I, O) {\n              return u.add(I, O);\n            });\n          }, _.prototype.get = function(C) {\n            var u = this._data[C];\n            if (u !== void 0)\n              return u;\n          }, _.prototype.getOrAddWithFactory = function(C, u) {\n            var I = this.get(C);\n            return I !== void 0 || (I = u(C)) && this.add(C, I), I;\n          }, _.prototype.getOrAdd = function(C, u) {\n            var I = this.get(C);\n            return I !== void 0 ? I : (this.add(C, u), u);\n          }, _.prototype.contains = function(C) {\n            return this._data[C] !== void 0;\n          }, _.prototype.add = function(C, u) {\n            return this._data[C] === void 0 && (this._data[C] = u, ++this._count, !0);\n          }, _.prototype.set = function(C, u) {\n            return this._data[C] !== void 0 && (this._data[C] = u, !0);\n          }, _.prototype.getAndRemove = function(C) {\n            var u = this.get(C);\n            return u !== void 0 ? (delete this._data[C], --this._count, u) : null;\n          }, _.prototype.remove = function(C) {\n            return !!this.contains(C) && (delete this._data[C], --this._count, !0);\n          }, _.prototype.clear = function() {\n            this._data = {}, this._count = 0;\n          }, Object.defineProperty(_.prototype, \"count\", { get: function() {\n            return this._count;\n          }, enumerable: !1, configurable: !0 }), _.prototype.forEach = function(C) {\n            for (var u in this._data)\n              C(u, this._data[u]);\n          }, _.prototype.first = function(C) {\n            for (var u in this._data) {\n              var I = C(u, this._data[u]);\n              if (I)\n                return I;\n            }\n            return null;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(44), _ = f(0), C = function() {\n          function u(I, O, x) {\n            this.center = _.e.Zero(), this.centerWorld = _.e.Zero(), this.minimum = _.e.Zero(), this.maximum = _.e.Zero(), this.reConstruct(I, O, x);\n          }\n          return u.prototype.reConstruct = function(I, O, x) {\n            this.minimum.copyFrom(I), this.maximum.copyFrom(O);\n            var m = _.e.Distance(I, O);\n            O.addToRef(I, this.center).scaleInPlace(0.5), this.radius = 0.5 * m, this._update(x || _.a.IdentityReadOnly);\n          }, u.prototype.scale = function(I) {\n            var O = this.radius * I, x = u.TmpVector3, m = x[0].setAll(O), c = this.center.subtractToRef(m, x[1]), T = this.center.addToRef(m, x[2]);\n            return this.reConstruct(c, T, this._worldMatrix), this;\n          }, u.prototype.getWorldMatrix = function() {\n            return this._worldMatrix;\n          }, u.prototype._update = function(I) {\n            if (I.isIdentity())\n              this.centerWorld.copyFrom(this.center), this.radiusWorld = this.radius;\n            else {\n              _.e.TransformCoordinatesToRef(this.center, I, this.centerWorld);\n              var O = u.TmpVector3[0];\n              _.e.TransformNormalFromFloatsToRef(1, 1, 1, I, O), this.radiusWorld = Math.max(Math.abs(O.x), Math.abs(O.y), Math.abs(O.z)) * this.radius;\n            }\n          }, u.prototype.isInFrustum = function(I) {\n            for (var O = this.centerWorld, x = this.radiusWorld, m = 0; m < 6; m++)\n              if (I[m].dotCoordinate(O) <= -x)\n                return !1;\n            return !0;\n          }, u.prototype.isCenterInFrustum = function(I) {\n            for (var O = this.centerWorld, x = 0; x < 6; x++)\n              if (I[x].dotCoordinate(O) < 0)\n                return !1;\n            return !0;\n          }, u.prototype.intersectsPoint = function(I) {\n            var O = _.e.DistanceSquared(this.centerWorld, I);\n            return !(this.radiusWorld * this.radiusWorld < O);\n          }, u.Intersects = function(I, O) {\n            var x = _.e.DistanceSquared(I.centerWorld, O.centerWorld), m = I.radiusWorld + O.radiusWorld;\n            return !(m * m < x);\n          }, u.TmpVector3 = V.a.BuildArray(3, _.e.Zero), u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function(_, C, u) {\n          this.bu = _, this.bv = C, this.distance = u, this.faceId = 0, this.subMeshId = 0;\n        };\n      }, function(Be, A, f) {\n        var V = \"clipPlaneFragmentDeclaration\", _ = `#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nvarying float fClipDistance6;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"logDepthDeclaration\", _ = `#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"clipPlaneVertexDeclaration\", _ = `#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nvarying float fClipDistance6;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.prototype.attributeProcessor = function(C) {\n            return C.replace(\"attribute\", \"in\");\n          }, _.prototype.varyingProcessor = function(C, u) {\n            return C.replace(\"varying\", u ? \"in\" : \"out\");\n          }, _.prototype.postProcessor = function(C, u, I) {\n            var O = C.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;\n            if (C = (C = C.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g, \"\")).replace(/texture2D\\s*\\(/g, \"texture(\"), I)\n              C = (C = (C = (C = (C = (C = (C = C.replace(/texture2DLodEXT\\s*\\(/g, \"textureLod(\")).replace(/textureCubeLodEXT\\s*\\(/g, \"textureLod(\")).replace(/textureCube\\s*\\(/g, \"texture(\")).replace(/gl_FragDepthEXT/g, \"gl_FragDepth\")).replace(/gl_FragColor/g, \"glFragColor\")).replace(/gl_FragData/g, \"glFragData\")).replace(/void\\s+?main\\s*\\(/g, (O ? \"\" : `out vec4 glFragColor;\n`) + \"void main(\");\n            else if (u.indexOf(\"#define MULTIVIEW\") !== -1)\n              return `#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n` + C;\n            return C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.BindClipPlane = function(C, u) {\n            if (u.clipPlane) {\n              var I = u.clipPlane;\n              C.setFloat4(\"vClipPlane\", I.normal.x, I.normal.y, I.normal.z, I.d);\n            }\n            u.clipPlane2 && (I = u.clipPlane2, C.setFloat4(\"vClipPlane2\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane3 && (I = u.clipPlane3, C.setFloat4(\"vClipPlane3\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane4 && (I = u.clipPlane4, C.setFloat4(\"vClipPlane4\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane5 && (I = u.clipPlane5, C.setFloat4(\"vClipPlane5\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane6 && (I = u.clipPlane6, C.setFloat4(\"vClipPlane6\", I.normal.x, I.normal.y, I.normal.z, I.d));\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.RandomId = function() {\n            return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(C) {\n              var u = 16 * Math.random() | 0;\n              return (C === \"x\" ? u : 3 & u | 8).toString(16);\n            });\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(1), _ = f(3), C = f(9), u = function() {\n          function I() {\n            this._dirty = !0, this._tempColor = new C.b(0, 0, 0, 0), this._globalCurve = new C.b(0, 0, 0, 0), this._highlightsCurve = new C.b(0, 0, 0, 0), this._midtonesCurve = new C.b(0, 0, 0, 0), this._shadowsCurve = new C.b(0, 0, 0, 0), this._positiveCurve = new C.b(0, 0, 0, 0), this._negativeCurve = new C.b(0, 0, 0, 0), this._globalHue = 30, this._globalDensity = 0, this._globalSaturation = 0, this._globalExposure = 0, this._highlightsHue = 30, this._highlightsDensity = 0, this._highlightsSaturation = 0, this._highlightsExposure = 0, this._midtonesHue = 30, this._midtonesDensity = 0, this._midtonesSaturation = 0, this._midtonesExposure = 0, this._shadowsHue = 30, this._shadowsDensity = 0, this._shadowsSaturation = 0, this._shadowsExposure = 0;\n          }\n          return Object.defineProperty(I.prototype, \"globalHue\", { get: function() {\n            return this._globalHue;\n          }, set: function(O) {\n            this._globalHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"globalDensity\", { get: function() {\n            return this._globalDensity;\n          }, set: function(O) {\n            this._globalDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"globalSaturation\", { get: function() {\n            return this._globalSaturation;\n          }, set: function(O) {\n            this._globalSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"globalExposure\", { get: function() {\n            return this._globalExposure;\n          }, set: function(O) {\n            this._globalExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsHue\", { get: function() {\n            return this._highlightsHue;\n          }, set: function(O) {\n            this._highlightsHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsDensity\", { get: function() {\n            return this._highlightsDensity;\n          }, set: function(O) {\n            this._highlightsDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsSaturation\", { get: function() {\n            return this._highlightsSaturation;\n          }, set: function(O) {\n            this._highlightsSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsExposure\", { get: function() {\n            return this._highlightsExposure;\n          }, set: function(O) {\n            this._highlightsExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesHue\", { get: function() {\n            return this._midtonesHue;\n          }, set: function(O) {\n            this._midtonesHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesDensity\", { get: function() {\n            return this._midtonesDensity;\n          }, set: function(O) {\n            this._midtonesDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesSaturation\", { get: function() {\n            return this._midtonesSaturation;\n          }, set: function(O) {\n            this._midtonesSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesExposure\", { get: function() {\n            return this._midtonesExposure;\n          }, set: function(O) {\n            this._midtonesExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsHue\", { get: function() {\n            return this._shadowsHue;\n          }, set: function(O) {\n            this._shadowsHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsDensity\", { get: function() {\n            return this._shadowsDensity;\n          }, set: function(O) {\n            this._shadowsDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsSaturation\", { get: function() {\n            return this._shadowsSaturation;\n          }, set: function(O) {\n            this._shadowsSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsExposure\", { get: function() {\n            return this._shadowsExposure;\n          }, set: function(O) {\n            this._shadowsExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), I.prototype.getClassName = function() {\n            return \"ColorCurves\";\n          }, I.Bind = function(O, x, m, c, T) {\n            m === void 0 && (m = \"vCameraColorCurvePositive\"), c === void 0 && (c = \"vCameraColorCurveNeutral\"), T === void 0 && (T = \"vCameraColorCurveNegative\"), O._dirty && (O._dirty = !1, O.getColorGradingDataToRef(O._globalHue, O._globalDensity, O._globalSaturation, O._globalExposure, O._globalCurve), O.getColorGradingDataToRef(O._highlightsHue, O._highlightsDensity, O._highlightsSaturation, O._highlightsExposure, O._tempColor), O._tempColor.multiplyToRef(O._globalCurve, O._highlightsCurve), O.getColorGradingDataToRef(O._midtonesHue, O._midtonesDensity, O._midtonesSaturation, O._midtonesExposure, O._tempColor), O._tempColor.multiplyToRef(O._globalCurve, O._midtonesCurve), O.getColorGradingDataToRef(O._shadowsHue, O._shadowsDensity, O._shadowsSaturation, O._shadowsExposure, O._tempColor), O._tempColor.multiplyToRef(O._globalCurve, O._shadowsCurve), O._highlightsCurve.subtractToRef(O._midtonesCurve, O._positiveCurve), O._midtonesCurve.subtractToRef(O._shadowsCurve, O._negativeCurve)), x && (x.setFloat4(m, O._positiveCurve.r, O._positiveCurve.g, O._positiveCurve.b, O._positiveCurve.a), x.setFloat4(c, O._midtonesCurve.r, O._midtonesCurve.g, O._midtonesCurve.b, O._midtonesCurve.a), x.setFloat4(T, O._negativeCurve.r, O._negativeCurve.g, O._negativeCurve.b, O._negativeCurve.a));\n          }, I.PrepareUniforms = function(O) {\n            O.push(\"vCameraColorCurveNeutral\", \"vCameraColorCurvePositive\", \"vCameraColorCurveNegative\");\n          }, I.prototype.getColorGradingDataToRef = function(O, x, m, c, T) {\n            O != null && (O = I.clamp(O, 0, 360), x = I.clamp(x, -100, 100), m = I.clamp(m, -100, 100), c = I.clamp(c, -100, 100), x = I.applyColorGradingSliderNonlinear(x), x *= 0.5, c = I.applyColorGradingSliderNonlinear(c), x < 0 && (x *= -1, O = (O + 180) % 360), I.fromHSBToRef(O, x, 50 + 0.25 * c, T), T.scaleToRef(2, T), T.a = 1 + 0.01 * m);\n          }, I.applyColorGradingSliderNonlinear = function(O) {\n            O /= 100;\n            var x = Math.abs(O);\n            return x = Math.pow(x, 2), O < 0 && (x *= -1), x *= 100;\n          }, I.fromHSBToRef = function(O, x, m, c) {\n            var T = I.clamp(O, 0, 360), S = I.clamp(x / 100, 0, 1), E = I.clamp(m / 100, 0, 1);\n            if (S === 0)\n              c.r = E, c.g = E, c.b = E;\n            else {\n              T /= 60;\n              var g = Math.floor(T), l = T - g, h = E * (1 - S), v = E * (1 - S * l), b = E * (1 - S * (1 - l));\n              switch (g) {\n                case 0:\n                  c.r = E, c.g = b, c.b = h;\n                  break;\n                case 1:\n                  c.r = v, c.g = E, c.b = h;\n                  break;\n                case 2:\n                  c.r = h, c.g = E, c.b = b;\n                  break;\n                case 3:\n                  c.r = h, c.g = v, c.b = E;\n                  break;\n                case 4:\n                  c.r = b, c.g = h, c.b = E;\n                  break;\n                default:\n                  c.r = E, c.g = h, c.b = v;\n              }\n            }\n            c.a = 1;\n          }, I.clamp = function(O, x, m) {\n            return Math.min(Math.max(O, x), m);\n          }, I.prototype.clone = function() {\n            return _.a.Clone(function() {\n              return new I();\n            }, this);\n          }, I.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, I.Parse = function(O) {\n            return _.a.Parse(function() {\n              return new I();\n            }, O, null, null);\n          }, Object(V.c)([Object(_.c)()], I.prototype, \"_globalHue\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_globalDensity\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_globalSaturation\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_globalExposure\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsHue\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsDensity\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsSaturation\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsExposure\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesHue\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesDensity\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesSaturation\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesExposure\", void 0), I;\n        }();\n        _.a._ColorCurvesParser = u.Parse;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(8), _ = f(11), C = function() {\n          function u() {\n          }\n          return u.Instantiate = function(I) {\n            if (this.RegisteredExternalClasses && this.RegisteredExternalClasses[I])\n              return this.RegisteredExternalClasses[I];\n            var O = _.a.GetClass(I);\n            if (O)\n              return O;\n            V.a.Warn(I + \" not found, you may have missed an import.\");\n            for (var x = I.split(\".\"), m = window || this, c = 0, T = x.length; c < T; c++)\n              m = m[x[c]];\n            return typeof m != \"function\" ? null : m;\n          }, u.RegisteredExternalClasses = {}, u;\n        }();\n      }, function(Be, A, f) {\n        var V = f(26), _ = f(2);\n        V.a.prototype.setAlphaConstants = function(C, u, I, O) {\n          this._alphaState.setAlphaBlendConstants(C, u, I, O);\n        }, V.a.prototype.setAlphaMode = function(C, u) {\n          if (u === void 0 && (u = !1), this._alphaMode !== C) {\n            switch (C) {\n              case _.a.ALPHA_DISABLE:\n                this._alphaState.alphaBlend = !1;\n                break;\n              case _.a.ALPHA_PREMULTIPLIED:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_PREMULTIPLIED_PORTERDUFF:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_COMBINE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ONEONE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ADD:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_SUBTRACT:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_MULTIPLY:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_MAXIMIZED:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_INTERPOLATE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_SCREENMODE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ONEONE_ONEONE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ALPHATOCOLOR:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_REVERSEONEMINUS:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_SRC_DSTONEMINUSSRCALPHA:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ONEONE_ONEZERO:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_EXCLUSION:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;\n            }\n            u || (this.depthCullingState.depthMask = C === _.a.ALPHA_DISABLE), this._alphaMode = C;\n          }\n        }, V.a.prototype.getAlphaMode = function() {\n          return this._alphaMode;\n        }, V.a.prototype.setAlphaEquation = function(C) {\n          if (this._alphaEquation !== C) {\n            switch (C) {\n              case _.a.ALPHA_EQUATION_ADD:\n                this._alphaState.setAlphaEquationParameters(this._gl.FUNC_ADD, this._gl.FUNC_ADD);\n                break;\n              case _.a.ALPHA_EQUATION_SUBSTRACT:\n                this._alphaState.setAlphaEquationParameters(this._gl.FUNC_SUBTRACT, this._gl.FUNC_SUBTRACT);\n                break;\n              case _.a.ALPHA_EQUATION_REVERSE_SUBTRACT:\n                this._alphaState.setAlphaEquationParameters(this._gl.FUNC_REVERSE_SUBTRACT, this._gl.FUNC_REVERSE_SUBTRACT);\n                break;\n              case _.a.ALPHA_EQUATION_MAX:\n                this._alphaState.setAlphaEquationParameters(this._gl.MAX, this._gl.MAX);\n                break;\n              case _.a.ALPHA_EQUATION_MIN:\n                this._alphaState.setAlphaEquationParameters(this._gl.MIN, this._gl.MIN);\n                break;\n              case _.a.ALPHA_EQUATION_DARKEN:\n                this._alphaState.setAlphaEquationParameters(this._gl.MIN, this._gl.FUNC_ADD);\n            }\n            this._alphaEquation = C;\n          }\n        }, V.a.prototype.getAlphaEquation = function() {\n          return this._alphaEquation;\n        };\n      }, function(Be, A, f) {\n        var V = f(26);\n        V.a.prototype.updateDynamicIndexBuffer = function(_, C, u) {\n          var I;\n          this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null, this.bindIndexBuffer(_), I = C instanceof Uint16Array || C instanceof Uint32Array ? C : _.is32Bits ? new Uint32Array(C) : new Uint16Array(C), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, I, this._gl.DYNAMIC_DRAW), this._resetIndexBufferBinding();\n        }, V.a.prototype.updateDynamicVertexBuffer = function(_, C, u, I) {\n          this.bindArrayBuffer(_), u === void 0 && (u = 0);\n          var O = C.length || C.byteLength;\n          I === void 0 || I >= O && u === 0 ? C instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, u, new Float32Array(C)) : this._gl.bufferSubData(this._gl.ARRAY_BUFFER, u, C) : C instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(C).subarray(u, u + I)) : (C = C instanceof ArrayBuffer ? new Uint8Array(C, u, I) : new Uint8Array(C.buffer, C.byteOffset + u, I), this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, C)), this._resetVertexBufferBinding();\n        };\n      }, function(Be, A, f) {\n        var V = \"fogFragmentDeclaration\", _ = `#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying vec3 vFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nfloat fogDistance=length(vFogDistance);\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = f(26), _ = f(27);\n        V.a.prototype.createDynamicTexture = function(C, u, I, O) {\n          var x = new _.a(this, _.b.Dynamic);\n          return x.baseWidth = C, x.baseHeight = u, I && (C = this.needPOTTextures ? V.a.GetExponentOfTwo(C, this._caps.maxTextureSize) : C, u = this.needPOTTextures ? V.a.GetExponentOfTwo(u, this._caps.maxTextureSize) : u), x.width = C, x.height = u, x.isReady = !1, x.generateMipMaps = I, x.samplingMode = O, this.updateTextureSamplingMode(O, x), this._internalTexturesCache.push(x), x;\n        }, V.a.prototype.updateDynamicTexture = function(C, u, I, O, x, m) {\n          if (O === void 0 && (O = !1), m === void 0 && (m = !1), C) {\n            var c = this._gl, T = c.TEXTURE_2D, S = this._bindTextureDirectly(T, C, !0, m);\n            this._unpackFlipY(I === void 0 ? C.invertY : I), O && c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);\n            var E = this._getWebGLTextureType(C.type), g = this._getInternalFormat(x || C.format), l = this._getRGBABufferInternalSizedFormat(C.type, g);\n            c.texImage2D(T, 0, l, g, E, u), C.generateMipMaps && c.generateMipmap(T), S || this._bindTextureDirectly(T, null), O && c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), C.isReady = !0;\n          }\n        };\n      }, function(Be, A, f) {\n        f.r(A), f.d(A, \"AbstractScene\", function() {\n          return V.a;\n        }), f.d(A, \"AbstractActionManager\", function() {\n          return _.a;\n        }), f.d(A, \"Action\", function() {\n          return x;\n        }), f.d(A, \"ActionEvent\", function() {\n          return m.a;\n        }), f.d(A, \"ActionManager\", function() {\n          return pe;\n        }), f.d(A, \"Condition\", function() {\n          return T;\n        }), f.d(A, \"ValueCondition\", function() {\n          return S;\n        }), f.d(A, \"PredicateCondition\", function() {\n          return E;\n        }), f.d(A, \"StateCondition\", function() {\n          return g;\n        }), f.d(A, \"SwitchBooleanAction\", function() {\n          return v;\n        }), f.d(A, \"SetStateAction\", function() {\n          return b;\n        }), f.d(A, \"SetValueAction\", function() {\n          return D;\n        }), f.d(A, \"IncrementValueAction\", function() {\n          return w;\n        }), f.d(A, \"PlayAnimationAction\", function() {\n          return N;\n        }), f.d(A, \"StopAnimationAction\", function() {\n          return M;\n        }), f.d(A, \"DoNothingAction\", function() {\n          return U;\n        }), f.d(A, \"CombineAction\", function() {\n          return X;\n        }), f.d(A, \"ExecuteCodeAction\", function() {\n          return j;\n        }), f.d(A, \"SetParentAction\", function() {\n          return ne;\n        }), f.d(A, \"PlaySoundAction\", function() {\n          return ae;\n        }), f.d(A, \"StopSoundAction\", function() {\n          return ee;\n        }), f.d(A, \"InterpolateValueAction\", function() {\n          return H;\n        }), f.d(A, \"Animatable\", function() {\n          return ke;\n        }), f.d(A, \"_IAnimationState\", function() {\n          return Y;\n        }), f.d(A, \"Animation\", function() {\n          return k;\n        }), f.d(A, \"TargetedAnimation\", function() {\n          return We;\n        }), f.d(A, \"AnimationGroup\", function() {\n          return je;\n        }), f.d(A, \"AnimationPropertiesOverride\", function() {\n          return He;\n        }), f.d(A, \"EasingFunction\", function() {\n          return Ge;\n        }), f.d(A, \"CircleEase\", function() {\n          return tt;\n        }), f.d(A, \"BackEase\", function() {\n          return Je;\n        }), f.d(A, \"BounceEase\", function() {\n          return st;\n        }), f.d(A, \"CubicEase\", function() {\n          return at;\n        }), f.d(A, \"ElasticEase\", function() {\n          return pt;\n        }), f.d(A, \"ExponentialEase\", function() {\n          return Tt;\n        }), f.d(A, \"PowerEase\", function() {\n          return Lt;\n        }), f.d(A, \"QuadraticEase\", function() {\n          return Ot;\n        }), f.d(A, \"QuarticEase\", function() {\n          return St;\n        }), f.d(A, \"QuinticEase\", function() {\n          return Ct;\n        }), f.d(A, \"SineEase\", function() {\n          return nn;\n        }), f.d(A, \"BezierCurveEase\", function() {\n          return Qt;\n        }), f.d(A, \"RuntimeAnimation\", function() {\n          return me;\n        }), f.d(A, \"AnimationEvent\", function() {\n          return $t;\n        }), f.d(A, \"AnimationKeyInterpolation\", function() {\n          return K;\n        }), f.d(A, \"AnimationRange\", function() {\n          return G;\n        }), f.d(A, \"KeepAssets\", function() {\n          return Sn;\n        }), f.d(A, \"InstantiatedEntries\", function() {\n          return en;\n        }), f.d(A, \"AssetContainer\", function() {\n          return An;\n        }), f.d(A, \"Analyser\", function() {\n          return Pn;\n        }), f.d(A, \"AudioEngine\", function() {\n          return rr;\n        }), f.d(A, \"AudioSceneComponent\", function() {\n          return qn;\n        }), f.d(A, \"Sound\", function() {\n          return Qn;\n        }), f.d(A, \"SoundTrack\", function() {\n          return So;\n        }), f.d(A, \"WeightedSound\", function() {\n          return lf;\n        }), f.d(A, \"AutoRotationBehavior\", function() {\n          return Qc;\n        }), f.d(A, \"BouncingBehavior\", function() {\n          return qc;\n        }), f.d(A, \"FramingBehavior\", function() {\n          return Zc;\n        }), f.d(A, \"AttachToBoxBehavior\", function() {\n          return uf;\n        }), f.d(A, \"FadeInOutBehavior\", function() {\n          return hf;\n        }), f.d(A, \"MultiPointerScaleBehavior\", function() {\n          return df;\n        }), f.d(A, \"PointerDragBehavior\", function() {\n          return fi.a;\n        }), f.d(A, \"SixDofDragBehavior\", function() {\n          return Jc;\n        }), f.d(A, \"Bone\", function() {\n          return Fe;\n        }), f.d(A, \"BoneIKController\", function() {\n          return ff;\n        }), f.d(A, \"BoneLookController\", function() {\n          return pf;\n        }), f.d(A, \"Skeleton\", function() {\n          return Ao;\n        }), f.d(A, \"ArcRotateCameraGamepadInput\", function() {\n          return Da;\n        }), f.d(A, \"ArcRotateCameraKeyboardMoveInput\", function() {\n          return La;\n        }), f.d(A, \"ArcRotateCameraMouseWheelInput\", function() {\n          return Na;\n        }), f.d(A, \"ArcRotateCameraPointersInput\", function() {\n          return wa;\n        }), f.d(A, \"ArcRotateCameraVRDeviceOrientationInput\", function() {\n          return Fa;\n        }), f.d(A, \"FlyCameraKeyboardInput\", function() {\n          return Ba;\n        }), f.d(A, \"FlyCameraMouseInput\", function() {\n          return Ua;\n        }), f.d(A, \"FollowCameraKeyboardMoveInput\", function() {\n          return Va;\n        }), f.d(A, \"FollowCameraMouseWheelInput\", function() {\n          return ka;\n        }), f.d(A, \"FollowCameraPointersInput\", function() {\n          return Ga;\n        }), f.d(A, \"FreeCameraDeviceOrientationInput\", function() {\n          return Xa;\n        }), f.d(A, \"FreeCameraGamepadInput\", function() {\n          return Ya;\n        }), f.d(A, \"FreeCameraKeyboardMoveInput\", function() {\n          return za;\n        }), f.d(A, \"FreeCameraMouseInput\", function() {\n          return ja;\n        }), f.d(A, \"FreeCameraMouseWheelInput\", function() {\n          return Ha;\n        }), f.d(A, \"FreeCameraTouchInput\", function() {\n          return Wa;\n        }), f.d(A, \"FreeCameraVirtualJoystickInput\", function() {\n          return Qa;\n        }), f.d(A, \"CameraInputTypes\", function() {\n          return un;\n        }), f.d(A, \"CameraInputsManager\", function() {\n          return zr;\n        }), f.d(A, \"Camera\", function() {\n          return _t.a;\n        }), f.d(A, \"TargetCamera\", function() {\n          return Pi;\n        }), f.d(A, \"FreeCamera\", function() {\n          return zn;\n        }), f.d(A, \"FreeCameraInputsManager\", function() {\n          return jr;\n        }), f.d(A, \"TouchCamera\", function() {\n          return qa;\n        }), f.d(A, \"ArcRotateCamera\", function() {\n          return ji;\n        }), f.d(A, \"ArcRotateCameraInputsManager\", function() {\n          return Po;\n        }), f.d(A, \"DeviceOrientationCamera\", function() {\n          return xo;\n        }), f.d(A, \"FlyCamera\", function() {\n          return gf;\n        }), f.d(A, \"FlyCameraInputsManager\", function() {\n          return ol;\n        }), f.d(A, \"FollowCamera\", function() {\n          return sl;\n        }), f.d(A, \"ArcFollowCamera\", function() {\n          return cl;\n        }), f.d(A, \"FollowCameraInputsManager\", function() {\n          return al;\n        }), f.d(A, \"GamepadCamera\", function() {\n          return Co;\n        }), f.d(A, \"AnaglyphArcRotateCamera\", function() {\n          return pl;\n        }), f.d(A, \"AnaglyphFreeCamera\", function() {\n          return _l;\n        }), f.d(A, \"AnaglyphGamepadCamera\", function() {\n          return ml;\n        }), f.d(A, \"AnaglyphUniversalCamera\", function() {\n          return gl;\n        }), f.d(A, \"StereoscopicArcRotateCamera\", function() {\n          return vl;\n        }), f.d(A, \"StereoscopicFreeCamera\", function() {\n          return yl;\n        }), f.d(A, \"StereoscopicGamepadCamera\", function() {\n          return bl;\n        }), f.d(A, \"StereoscopicUniversalCamera\", function() {\n          return Tl;\n        }), f.d(A, \"UniversalCamera\", function() {\n          return sr;\n        }), f.d(A, \"VirtualJoysticksCamera\", function() {\n          return El;\n        }), f.d(A, \"VRCameraMetrics\", function() {\n          return cr;\n        }), f.d(A, \"VRDeviceOrientationArcRotateCamera\", function() {\n          return xl;\n        }), f.d(A, \"VRDeviceOrientationFreeCamera\", function() {\n          return Ro;\n        }), f.d(A, \"VRDeviceOrientationGamepadCamera\", function() {\n          return Cl;\n        }), f.d(A, \"OnAfterEnteringVRObservableEvent\", function() {\n          return Cf;\n        }), f.d(A, \"VRExperienceHelper\", function() {\n          return Il;\n        }), f.d(A, \"WebVRFreeCamera\", function() {\n          return Mo;\n        }), f.d(A, \"Collider\", function() {\n          return Dl;\n        }), f.d(A, \"DefaultCollisionCoordinator\", function() {\n          return Ll;\n        }), f.d(A, \"PickingInfo\", function() {\n          return Yi.a;\n        }), f.d(A, \"IntersectionInfo\", function() {\n          return Rf.a;\n        }), f.d(A, \"_MeshCollisionData\", function() {\n          return Of.a;\n        }), f.d(A, \"BoundingBox\", function() {\n          return os.a;\n        }), f.d(A, \"BoundingInfo\", function() {\n          return Mi.a;\n        }), f.d(A, \"BoundingSphere\", function() {\n          return Nl.a;\n        }), f.d(A, \"Octree\", function() {\n          return Wr;\n        }), f.d(A, \"OctreeBlock\", function() {\n          return wl;\n        }), f.d(A, \"OctreeSceneComponent\", function() {\n          return us;\n        }), f.d(A, \"Ray\", function() {\n          return dn.a;\n        }), f.d(A, \"AxesViewer\", function() {\n          return Ki.AxesViewer;\n        }), f.d(A, \"BoneAxesViewer\", function() {\n          return Ki.BoneAxesViewer;\n        }), f.d(A, \"DebugLayerTab\", function() {\n          return Ki.DebugLayerTab;\n        }), f.d(A, \"DebugLayer\", function() {\n          return Ki.DebugLayer;\n        }), f.d(A, \"PhysicsViewer\", function() {\n          return Ki.PhysicsViewer;\n        }), f.d(A, \"RayHelper\", function() {\n          return Ki.RayHelper;\n        }), f.d(A, \"SkeletonViewer\", function() {\n          return Ki.SkeletonViewer;\n        }), f.d(A, \"DeviceInputSystem\", function() {\n          return Fl;\n        }), f.d(A, \"DeviceType\", function() {\n          return Xt;\n        }), f.d(A, \"PointerInput\", function() {\n          return as;\n        }), f.d(A, \"DualShockInput\", function() {\n          return ss;\n        }), f.d(A, \"XboxInput\", function() {\n          return cs;\n        }), f.d(A, \"SwitchInput\", function() {\n          return ls;\n        }), f.d(A, \"DeviceSource\", function() {\n          return Bl;\n        }), f.d(A, \"DeviceSourceManager\", function() {\n          return Mf;\n        }), f.d(A, \"Constants\", function() {\n          return h.a;\n        }), f.d(A, \"ThinEngine\", function() {\n          return wt.a;\n        }), f.d(A, \"Engine\", function() {\n          return Ue.a;\n        }), f.d(A, \"EngineStore\", function() {\n          return te.a;\n        }), f.d(A, \"NullEngineOptions\", function() {\n          return Ul.b;\n        }), f.d(A, \"NullEngine\", function() {\n          return Ul.a;\n        }), f.d(A, \"_OcclusionDataStorage\", function() {\n          return kl;\n        }), f.d(A, \"_forceTransformFeedbackToBundle\", function() {\n          return If;\n        }), f.d(A, \"EngineView\", function() {\n          return Df;\n        }), f.d(A, \"WebGLPipelineContext\", function() {\n          return Nf.a;\n        }), f.d(A, \"WebGL2ShaderProcessor\", function() {\n          return Gl.a;\n        }), f.d(A, \"NativeEngine\", function() {\n          return Vf;\n        }), f.d(A, \"ShaderCodeInliner\", function() {\n          return ds;\n        }), f.d(A, \"PerformanceConfigurator\", function() {\n          return kf.a;\n        }), f.d(A, \"KeyboardEventTypes\", function() {\n          return zi.a;\n        }), f.d(A, \"KeyboardInfo\", function() {\n          return zi.b;\n        }), f.d(A, \"KeyboardInfoPre\", function() {\n          return zi.c;\n        }), f.d(A, \"PointerEventTypes\", function() {\n          return yt.a;\n        }), f.d(A, \"PointerInfoBase\", function() {\n          return yt.c;\n        }), f.d(A, \"PointerInfoPre\", function() {\n          return yt.d;\n        }), f.d(A, \"PointerInfo\", function() {\n          return yt.b;\n        }), f.d(A, \"ClipboardEventTypes\", function() {\n          return No;\n        }), f.d(A, \"ClipboardInfo\", function() {\n          return Gf;\n        }), f.d(A, \"DaydreamController\", function() {\n          return ps;\n        }), f.d(A, \"GearVRController\", function() {\n          return _s;\n        }), f.d(A, \"GenericController\", function() {\n          return wo;\n        }), f.d(A, \"OculusTouchController\", function() {\n          return ms;\n        }), f.d(A, \"PoseEnabledControllerType\", function() {\n          return Jn;\n        }), f.d(A, \"PoseEnabledControllerHelper\", function() {\n          return xi;\n        }), f.d(A, \"PoseEnabledController\", function() {\n          return ar;\n        }), f.d(A, \"ViveController\", function() {\n          return Wl;\n        }), f.d(A, \"WebVRController\", function() {\n          return Ri;\n        }), f.d(A, \"WindowsMotionController\", function() {\n          return Fo;\n        }), f.d(A, \"XRWindowsMotionController\", function() {\n          return jf;\n        }), f.d(A, \"StickValues\", function() {\n          return _f;\n        }), f.d(A, \"Gamepad\", function() {\n          return hn;\n        }), f.d(A, \"GenericPad\", function() {\n          return nl;\n        }), f.d(A, \"GamepadManager\", function() {\n          return hl;\n        }), f.d(A, \"GamepadSystemSceneComponent\", function() {\n          return dl;\n        }), f.d(A, \"Xbox360Button\", function() {\n          return xn;\n        }), f.d(A, \"Xbox360Dpad\", function() {\n          return Hi;\n        }), f.d(A, \"Xbox360Pad\", function() {\n          return ll;\n        }), f.d(A, \"DualShockButton\", function() {\n          return Vn;\n        }), f.d(A, \"DualShockDpad\", function() {\n          return Wi;\n        }), f.d(A, \"DualShockPad\", function() {\n          return ul;\n        }), f.d(A, \"AxisDragGizmo\", function() {\n          return Bo.a;\n        }), f.d(A, \"AxisScaleGizmo\", function() {\n          return Kr;\n        }), f.d(A, \"BoundingBoxGizmo\", function() {\n          return Xl;\n        }), f.d(A, \"Gizmo\", function() {\n          return Ln.a;\n        }), f.d(A, \"GizmoManager\", function() {\n          return Hf;\n        }), f.d(A, \"PlaneRotationGizmo\", function() {\n          return Uo;\n        }), f.d(A, \"PositionGizmo\", function() {\n          return Kl;\n        }), f.d(A, \"RotationGizmo\", function() {\n          return Yl;\n        }), f.d(A, \"ScaleGizmo\", function() {\n          return Ql;\n        }), f.d(A, \"LightGizmo\", function() {\n          return Wf;\n        }), f.d(A, \"CameraGizmo\", function() {\n          return Yf;\n        }), f.d(A, \"PlaneDragGizmo\", function() {\n          return Vo;\n        }), f.d(A, \"EnvironmentHelper\", function() {\n          return Es;\n        }), f.d(A, \"PhotoDome\", function() {\n          return op;\n        }), f.d(A, \"_forceSceneHelpersToBundle\", function() {\n          return qp;\n        }), f.d(A, \"VideoDome\", function() {\n          return Zp;\n        }), f.d(A, \"EngineInstrumentation\", function() {\n          return Jp;\n        }), f.d(A, \"SceneInstrumentation\", function() {\n          return $p;\n        }), f.d(A, \"_TimeToken\", function() {\n          return Vl;\n        }), f.d(A, \"EffectLayer\", function() {\n          return no;\n        }), f.d(A, \"EffectLayerSceneComponent\", function() {\n          return du;\n        }), f.d(A, \"GlowLayer\", function() {\n          return Ko;\n        }), f.d(A, \"HighlightLayer\", function() {\n          return Ms;\n        }), f.d(A, \"Layer\", function() {\n          return s_;\n        }), f.d(A, \"LayerSceneComponent\", function() {\n          return pu;\n        }), f.d(A, \"LensFlare\", function() {\n          return _u;\n        }), f.d(A, \"LensFlareSystem\", function() {\n          return Is;\n        }), f.d(A, \"LensFlareSystemSceneComponent\", function() {\n          return mu;\n        }), f.d(A, \"Light\", function() {\n          return bi.a;\n        }), f.d(A, \"ShadowLight\", function() {\n          return ko;\n        }), f.d(A, \"ShadowGenerator\", function() {\n          return Fn;\n        }), f.d(A, \"CascadedShadowGenerator\", function() {\n          return Ds;\n        }), f.d(A, \"ShadowGeneratorSceneComponent\", function() {\n          return Su;\n        }), f.d(A, \"DirectionalLight\", function() {\n          return vs;\n        }), f.d(A, \"HemisphericLight\", function() {\n          return Oo.a;\n        }), f.d(A, \"PointLight\", function() {\n          return Ls;\n        }), f.d(A, \"SpotLight\", function() {\n          return ys;\n        }), f.d(A, \"DefaultLoadingScreen\", function() {\n          return Au;\n        }), f.d(A, \"_BabylonLoaderRegistered\", function() {\n          return x_;\n        }), f.d(A, \"BabylonFileLoaderConfiguration\", function() {\n          return $o;\n        }), f.d(A, \"SceneLoaderAnimationGroupLoadingMode\", function() {\n          return vi;\n        }), f.d(A, \"SceneLoader\", function() {\n          return Ft;\n        }), f.d(A, \"SceneLoaderFlags\", function() {\n          return yi.a;\n        }), f.d(A, \"BackgroundMaterial\", function() {\n          return qr;\n        }), f.d(A, \"ColorCurves\", function() {\n          return R_.a;\n        }), f.d(A, \"EffectFallbacks\", function() {\n          return _r.a;\n        }), f.d(A, \"Effect\", function() {\n          return ze.a;\n        }), f.d(A, \"FresnelParameters\", function() {\n          return Fu;\n        }), f.d(A, \"ImageProcessingConfigurationDefines\", function() {\n          return vn.b;\n        }), f.d(A, \"ImageProcessingConfiguration\", function() {\n          return vn.a;\n        }), f.d(A, \"Material\", function() {\n          return zt.a;\n        }), f.d(A, \"MaterialDefines\", function() {\n          return zo.a;\n        }), f.d(A, \"ThinMaterialHelper\", function() {\n          return Bu.a;\n        }), f.d(A, \"MaterialHelper\", function() {\n          return $e.a;\n        }), f.d(A, \"MultiMaterial\", function() {\n          return Qi.a;\n        }), f.d(A, \"PBRMaterialDefines\", function() {\n          return As;\n        }), f.d(A, \"PBRBaseMaterial\", function() {\n          return pn;\n        }), f.d(A, \"PBRBaseSimpleMaterial\", function() {\n          return Us;\n        }), f.d(A, \"PBRMaterial\", function() {\n          return $r;\n        }), f.d(A, \"PBRMetallicRoughnessMaterial\", function() {\n          return Uu;\n        }), f.d(A, \"PBRSpecularGlossinessMaterial\", function() {\n          return Vu;\n        }), f.d(A, \"PushMaterial\", function() {\n          return jo.a;\n        }), f.d(A, \"ShaderMaterial\", function() {\n          return ea.a;\n        }), f.d(A, \"StandardMaterialDefines\", function() {\n          return Nt.b;\n        }), f.d(A, \"StandardMaterial\", function() {\n          return Nt.a;\n        }), f.d(A, \"BaseTexture\", function() {\n          return kn.a;\n        }), f.d(A, \"ColorGradingTexture\", function() {\n          return ku;\n        }), f.d(A, \"CubeTexture\", function() {\n          return ei;\n        }), f.d(A, \"DynamicTexture\", function() {\n          return pi.a;\n        }), f.d(A, \"EquiRectangularCubeTexture\", function() {\n          return Gu;\n        }), f.d(A, \"HDRFiltering\", function() {\n          return Ru;\n        }), f.d(A, \"HDRCubeTexture\", function() {\n          return qo;\n        }), f.d(A, \"HtmlElementTexture\", function() {\n          return O_;\n        }), f.d(A, \"InternalTextureSource\", function() {\n          return Pt.b;\n        }), f.d(A, \"InternalTexture\", function() {\n          return Pt.a;\n        }), f.d(A, \"_DDSTextureLoader\", function() {\n          return eu;\n        }), f.d(A, \"_ENVTextureLoader\", function() {\n          return tu;\n        }), f.d(A, \"_KTXTextureLoader\", function() {\n          return nu;\n        }), f.d(A, \"_TGATextureLoader\", function() {\n          return zu;\n        }), f.d(A, \"_BasisTextureLoader\", function() {\n          return ju;\n        }), f.d(A, \"MirrorTexture\", function() {\n          return Ts;\n        }), f.d(A, \"MultiRenderTarget\", function() {\n          return Vs;\n        }), f.d(A, \"TexturePacker\", function() {\n          return D_;\n        }), f.d(A, \"TexturePackerFrame\", function() {\n          return ks;\n        }), f.d(A, \"CustomProceduralTexture\", function() {\n          return N_;\n        }), f.d(A, \"NoiseProceduralTexture\", function() {\n          return Wu;\n        }), f.d(A, \"ProceduralTexture\", function() {\n          return oo;\n        }), f.d(A, \"ProceduralTextureSceneComponent\", function() {\n          return Hu;\n        }), f.d(A, \"RawCubeTexture\", function() {\n          return F_;\n        }), f.d(A, \"RawTexture\", function() {\n          return Zn;\n        }), f.d(A, \"RawTexture2DArray\", function() {\n          return B_;\n        }), f.d(A, \"RawTexture3D\", function() {\n          return U_;\n        }), f.d(A, \"RefractionTexture\", function() {\n          return V_;\n        }), f.d(A, \"RenderTargetTexture\", function() {\n          return on;\n        }), f.d(A, \"Texture\", function() {\n          return Ne.a;\n        }), f.d(A, \"VideoTexture\", function() {\n          return hu;\n        }), f.d(A, \"UniformBuffer\", function() {\n          return Sl.a;\n        }), f.d(A, \"MaterialFlags\", function() {\n          return lt.a;\n        }), f.d(A, \"NodeMaterialBlockTargets\", function() {\n          return Ce;\n        }), f.d(A, \"NodeMaterialBlockConnectionPointTypes\", function() {\n          return le;\n        }), f.d(A, \"NodeMaterialBlockConnectionPointMode\", function() {\n          return gn;\n        }), f.d(A, \"NodeMaterialSystemValues\", function() {\n          return gt;\n        }), f.d(A, \"NodeMaterialModes\", function() {\n          return Rn;\n        }), f.d(A, \"NodeMaterialConnectionPointCompatibilityStates\", function() {\n          return ii;\n        }), f.d(A, \"NodeMaterialConnectionPointDirection\", function() {\n          return yn;\n        }), f.d(A, \"NodeMaterialConnectionPoint\", function() {\n          return na;\n        }), f.d(A, \"NodeMaterialBlock\", function() {\n          return dt;\n        }), f.d(A, \"NodeMaterialDefines\", function() {\n          return lo;\n        }), f.d(A, \"NodeMaterial\", function() {\n          return sa;\n        }), f.d(A, \"VertexOutputBlock\", function() {\n          return ao;\n        }), f.d(A, \"BonesBlock\", function() {\n          return qu;\n        }), f.d(A, \"InstancesBlock\", function() {\n          return Zu;\n        }), f.d(A, \"MorphTargetsBlock\", function() {\n          return Ju;\n        }), f.d(A, \"LightInformationBlock\", function() {\n          return $u;\n        }), f.d(A, \"FragmentOutputBlock\", function() {\n          return Pr;\n        }), f.d(A, \"ImageProcessingBlock\", function() {\n          return eh;\n        }), f.d(A, \"PerturbNormalBlock\", function() {\n          return th;\n        }), f.d(A, \"DiscardBlock\", function() {\n          return nh;\n        }), f.d(A, \"FrontFacingBlock\", function() {\n          return ih;\n        }), f.d(A, \"DerivativeBlock\", function() {\n          return rh;\n        }), f.d(A, \"FragCoordBlock\", function() {\n          return oh;\n        }), f.d(A, \"ScreenSizeBlock\", function() {\n          return ah;\n        }), f.d(A, \"FogBlock\", function() {\n          return sh;\n        }), f.d(A, \"LightBlock\", function() {\n          return ch;\n        }), f.d(A, \"TextureBlock\", function() {\n          return lh;\n        }), f.d(A, \"ReflectionTextureBlock\", function() {\n          return uh;\n        }), f.d(A, \"CurrentScreenBlock\", function() {\n          return zs;\n        }), f.d(A, \"InputBlock\", function() {\n          return Et;\n        }), f.d(A, \"AnimatedInputBlockTypes\", function() {\n          return Ni;\n        }), f.d(A, \"MultiplyBlock\", function() {\n          return ra;\n        }), f.d(A, \"AddBlock\", function() {\n          return hh;\n        }), f.d(A, \"ScaleBlock\", function() {\n          return dh;\n        }), f.d(A, \"ClampBlock\", function() {\n          return fh;\n        }), f.d(A, \"CrossBlock\", function() {\n          return ph;\n        }), f.d(A, \"DotBlock\", function() {\n          return _h;\n        }), f.d(A, \"TransformBlock\", function() {\n          return ia;\n        }), f.d(A, \"RemapBlock\", function() {\n          return Xs;\n        }), f.d(A, \"NormalizeBlock\", function() {\n          return mh;\n        }), f.d(A, \"TrigonometryBlockOperations\", function() {\n          return tn;\n        }), f.d(A, \"TrigonometryBlock\", function() {\n          return $s;\n        }), f.d(A, \"ColorMergerBlock\", function() {\n          return gh;\n        }), f.d(A, \"VectorMergerBlock\", function() {\n          return so;\n        }), f.d(A, \"ColorSplitterBlock\", function() {\n          return Js;\n        }), f.d(A, \"VectorSplitterBlock\", function() {\n          return vh;\n        }), f.d(A, \"LerpBlock\", function() {\n          return yh;\n        }), f.d(A, \"DivideBlock\", function() {\n          return bh;\n        }), f.d(A, \"SubtractBlock\", function() {\n          return Th;\n        }), f.d(A, \"StepBlock\", function() {\n          return Eh;\n        }), f.d(A, \"OneMinusBlock\", function() {\n          return nc;\n        }), f.d(A, \"ViewDirectionBlock\", function() {\n          return ic;\n        }), f.d(A, \"FresnelBlock\", function() {\n          return Sh;\n        }), f.d(A, \"MaxBlock\", function() {\n          return Ah;\n        }), f.d(A, \"MinBlock\", function() {\n          return Ph;\n        }), f.d(A, \"DistanceBlock\", function() {\n          return xh;\n        }), f.d(A, \"LengthBlock\", function() {\n          return Ch;\n        }), f.d(A, \"NegateBlock\", function() {\n          return Rh;\n        }), f.d(A, \"PowBlock\", function() {\n          return Oh;\n        }), f.d(A, \"RandomNumberBlock\", function() {\n          return Mh;\n        }), f.d(A, \"ArcTan2Block\", function() {\n          return Ih;\n        }), f.d(A, \"SmoothStepBlock\", function() {\n          return Dh;\n        }), f.d(A, \"ReciprocalBlock\", function() {\n          return Lh;\n        }), f.d(A, \"ReplaceColorBlock\", function() {\n          return Nh;\n        }), f.d(A, \"PosterizeBlock\", function() {\n          return wh;\n        }), f.d(A, \"WaveBlockKind\", function() {\n          return qi;\n        }), f.d(A, \"WaveBlock\", function() {\n          return Fh;\n        }), f.d(A, \"GradientBlockColorStep\", function() {\n          return ca;\n        }), f.d(A, \"GradientBlock\", function() {\n          return Bh;\n        }), f.d(A, \"NLerpBlock\", function() {\n          return Uh;\n        }), f.d(A, \"WorleyNoise3DBlock\", function() {\n          return Vh;\n        }), f.d(A, \"SimplexPerlin3DBlock\", function() {\n          return kh;\n        }), f.d(A, \"NormalBlendBlock\", function() {\n          return Gh;\n        }), f.d(A, \"Rotate2dBlock\", function() {\n          return zh;\n        }), f.d(A, \"ReflectBlock\", function() {\n          return jh;\n        }), f.d(A, \"RefractBlock\", function() {\n          return Hh;\n        }), f.d(A, \"DesaturateBlock\", function() {\n          return Wh;\n        }), f.d(A, \"PBRMetallicRoughnessBlock\", function() {\n          return Xh;\n        }), f.d(A, \"SheenBlock\", function() {\n          return rc;\n        }), f.d(A, \"AnisotropyBlock\", function() {\n          return oc;\n        }), f.d(A, \"ReflectionBlock\", function() {\n          return ac;\n        }), f.d(A, \"ClearCoatBlock\", function() {\n          return la;\n        }), f.d(A, \"RefractionBlock\", function() {\n          return sc;\n        }), f.d(A, \"SubSurfaceBlock\", function() {\n          return ua;\n        }), f.d(A, \"ParticleTextureBlock\", function() {\n          return js;\n        }), f.d(A, \"ParticleRampGradientBlock\", function() {\n          return Hs;\n        }), f.d(A, \"ParticleBlendMultiplyBlock\", function() {\n          return Ws;\n        }), f.d(A, \"ModBlock\", function() {\n          return Yh;\n        }), f.d(A, \"NodeMaterialOptimizer\", function() {\n          return H_;\n        }), f.d(A, \"PropertyTypeForEdition\", function() {\n          return It;\n        }), f.d(A, \"editableInPropertyPage\", function() {\n          return Bt;\n        }), f.d(A, \"EffectRenderer\", function() {\n          return xu;\n        }), f.d(A, \"EffectWrapper\", function() {\n          return Cu;\n        }), f.d(A, \"ShadowDepthWrapper\", function() {\n          return Y_;\n        }), f.d(A, \"Scalar\", function() {\n          return $.a;\n        }), f.d(A, \"extractMinAndMaxIndexed\", function() {\n          return Kh.b;\n        }), f.d(A, \"extractMinAndMax\", function() {\n          return Kh.a;\n        }), f.d(A, \"Space\", function() {\n          return be.c;\n        }), f.d(A, \"Axis\", function() {\n          return be.a;\n        }), f.d(A, \"Coordinate\", function() {\n          return be.b;\n        }), f.d(A, \"Color3\", function() {\n          return I.a;\n        }), f.d(A, \"Color4\", function() {\n          return I.b;\n        }), f.d(A, \"TmpColors\", function() {\n          return I.c;\n        }), f.d(A, \"ToGammaSpace\", function() {\n          return Vt.b;\n        }), f.d(A, \"ToLinearSpace\", function() {\n          return Vt.c;\n        }), f.d(A, \"Epsilon\", function() {\n          return Vt.a;\n        }), f.d(A, \"Frustum\", function() {\n          return Pl.a;\n        }), f.d(A, \"Orientation\", function() {\n          return Qe.e;\n        }), f.d(A, \"BezierCurve\", function() {\n          return Qe.c;\n        }), f.d(A, \"Angle\", function() {\n          return Qe.a;\n        }), f.d(A, \"Arc2\", function() {\n          return Qe.b;\n        }), f.d(A, \"Path2\", function() {\n          return Qe.f;\n        }), f.d(A, \"Path3D\", function() {\n          return Qe.g;\n        }), f.d(A, \"Curve3\", function() {\n          return Qe.d;\n        }), f.d(A, \"Plane\", function() {\n          return ur.a;\n        }), f.d(A, \"Size\", function() {\n          return oe.a;\n        }), f.d(A, \"Vector2\", function() {\n          return u.d;\n        }), f.d(A, \"Vector3\", function() {\n          return u.e;\n        }), f.d(A, \"Vector4\", function() {\n          return u.f;\n        }), f.d(A, \"Quaternion\", function() {\n          return u.b;\n        }), f.d(A, \"Matrix\", function() {\n          return u.a;\n        }), f.d(A, \"TmpVectors\", function() {\n          return u.c;\n        }), f.d(A, \"PositionNormalVertex\", function() {\n          return bs;\n        }), f.d(A, \"PositionNormalTextureVertex\", function() {\n          return Xf;\n        }), f.d(A, \"Viewport\", function() {\n          return jn.a;\n        }), f.d(A, \"SphericalHarmonics\", function() {\n          return hs;\n        }), f.d(A, \"SphericalPolynomial\", function() {\n          return Yr;\n        }), f.d(A, \"AbstractMesh\", function() {\n          return Mt.a;\n        }), f.d(A, \"Buffer\", function() {\n          return Oe.a;\n        }), f.d(A, \"VertexBuffer\", function() {\n          return Oe.b;\n        }), f.d(A, \"DracoCompression\", function() {\n          return Q_;\n        }), f.d(A, \"CSG\", function() {\n          return J_;\n        }), f.d(A, \"Geometry\", function() {\n          return Ns.a;\n        }), f.d(A, \"GroundMesh\", function() {\n          return Do;\n        }), f.d(A, \"TrailMesh\", function() {\n          return $_;\n        }), f.d(A, \"InstancedMesh\", function() {\n          return em.a;\n        }), f.d(A, \"LinesMesh\", function() {\n          return ho.b;\n        }), f.d(A, \"InstancedLinesMesh\", function() {\n          return ho.a;\n        }), f.d(A, \"_CreationDataStorage\", function() {\n          return Ie.b;\n        }), f.d(A, \"_InstancesBatch\", function() {\n          return Ie.c;\n        }), f.d(A, \"Mesh\", function() {\n          return Ie.a;\n        }), f.d(A, \"VertexData\", function() {\n          return ht.a;\n        }), f.d(A, \"MeshBuilder\", function() {\n          return im;\n        }), f.d(A, \"SimplificationSettings\", function() {\n          return rm;\n        }), f.d(A, \"SimplificationQueue\", function() {\n          return ed;\n        }), f.d(A, \"SimplificationType\", function() {\n          return _o;\n        }), f.d(A, \"QuadraticErrorSimplification\", function() {\n          return nd;\n        }), f.d(A, \"SimplicationQueueSceneComponent\", function() {\n          return id;\n        }), f.d(A, \"Polygon\", function() {\n          return nm;\n        }), f.d(A, \"PolygonMeshBuilder\", function() {\n          return Jh;\n        }), f.d(A, \"SubMesh\", function() {\n          return uo.a;\n        }), f.d(A, \"MeshLODLevel\", function() {\n          return cm.a;\n        }), f.d(A, \"TransformNode\", function() {\n          return pr.a;\n        }), f.d(A, \"BoxBuilder\", function() {\n          return fr.a;\n        }), f.d(A, \"TiledBoxBuilder\", function() {\n          return Zh;\n        }), f.d(A, \"DiscBuilder\", function() {\n          return ha;\n        }), f.d(A, \"RibbonBuilder\", function() {\n          return fo.a;\n        }), f.d(A, \"SphereBuilder\", function() {\n          return Nn.a;\n        }), f.d(A, \"HemisphereBuilder\", function() {\n          return Go;\n        }), f.d(A, \"CylinderBuilder\", function() {\n          return ci.a;\n        }), f.d(A, \"TorusBuilder\", function() {\n          return lr;\n        }), f.d(A, \"TorusKnotBuilder\", function() {\n          return uc;\n        }), f.d(A, \"LinesBuilder\", function() {\n          return sn.a;\n        }), f.d(A, \"PolygonBuilder\", function() {\n          return po;\n        }), f.d(A, \"ShapeBuilder\", function() {\n          return Jo.a;\n        }), f.d(A, \"LatheBuilder\", function() {\n          return dc;\n        }), f.d(A, \"PlaneBuilder\", function() {\n          return gs.a;\n        }), f.d(A, \"TiledPlaneBuilder\", function() {\n          return $h;\n        }), f.d(A, \"GroundBuilder\", function() {\n          return Oi;\n        }), f.d(A, \"TubeBuilder\", function() {\n          return fc;\n        }), f.d(A, \"PolyhedronBuilder\", function() {\n          return Qr;\n        }), f.d(A, \"IcoSphereBuilder\", function() {\n          return pc;\n        }), f.d(A, \"DecalBuilder\", function() {\n          return _c;\n        }), f.d(A, \"CapsuleBuilder\", function() {\n          return mc;\n        }), f.d(A, \"DataBuffer\", function() {\n          return zl.a;\n        }), f.d(A, \"WebGLDataBuffer\", function() {\n          return lm.a;\n        }), f.d(A, \"MorphTarget\", function() {\n          return Ou;\n        }), f.d(A, \"MorphTargetManager\", function() {\n          return Zo;\n        }), f.d(A, \"RecastJSPlugin\", function() {\n          return um;\n        }), f.d(A, \"RecastJSCrowd\", function() {\n          return rd;\n        }), f.d(A, \"Node\", function() {\n          return Q.a;\n        }), f.d(A, \"Database\", function() {\n          return od;\n        }), f.d(A, \"BaseParticleSystem\", function() {\n          return co;\n        }), f.d(A, \"BoxParticleEmitter\", function() {\n          return xr;\n        }), f.d(A, \"ConeParticleEmitter\", function() {\n          return Ys;\n        }), f.d(A, \"CylinderParticleEmitter\", function() {\n          return oa;\n        }), f.d(A, \"CylinderDirectedParticleEmitter\", function() {\n          return Ks;\n        }), f.d(A, \"HemisphericParticleEmitter\", function() {\n          return Qs;\n        }), f.d(A, \"PointParticleEmitter\", function() {\n          return qs;\n        }), f.d(A, \"SphereParticleEmitter\", function() {\n          return aa;\n        }), f.d(A, \"SphereDirectedParticleEmitter\", function() {\n          return Zs;\n        }), f.d(A, \"CustomParticleEmitter\", function() {\n          return Cr;\n        }), f.d(A, \"MeshParticleEmitter\", function() {\n          return Ku;\n        }), f.d(A, \"GPUParticleSystem\", function() {\n          return Zi;\n        }), f.d(A, \"Particle\", function() {\n          return sd;\n        }), f.d(A, \"ParticleHelper\", function() {\n          return vm;\n        }), f.d(A, \"ParticleSystem\", function() {\n          return cn;\n        }), f.d(A, \"ParticleSystemSet\", function() {\n          return da;\n        }), f.d(A, \"SolidParticle\", function() {\n          return yc;\n        }), f.d(A, \"ModelShape\", function() {\n          return bc;\n        }), f.d(A, \"DepthSortedParticle\", function() {\n          return cd;\n        }), f.d(A, \"SolidParticleVertex\", function() {\n          return ld;\n        }), f.d(A, \"SolidParticleSystem\", function() {\n          return ym;\n        }), f.d(A, \"CloudPoint\", function() {\n          return ud;\n        }), f.d(A, \"PointsGroup\", function() {\n          return fa;\n        }), f.d(A, \"PointColor\", function() {\n          return bn;\n        }), f.d(A, \"PointsCloudSystem\", function() {\n          return bm;\n        }), f.d(A, \"SubEmitterType\", function() {\n          return Rr;\n        }), f.d(A, \"SubEmitter\", function() {\n          return mo;\n        }), f.d(A, \"PhysicsEngine\", function() {\n          return Sr;\n        }), f.d(A, \"PhysicsEngineSceneComponent\", function() {\n          return hd;\n        }), f.d(A, \"PhysicsHelper\", function() {\n          return Tm;\n        }), f.d(A, \"PhysicsRadialExplosionEventOptions\", function() {\n          return Mr;\n        }), f.d(A, \"PhysicsUpdraftEventOptions\", function() {\n          return Tc;\n        }), f.d(A, \"PhysicsVortexEventOptions\", function() {\n          return Ec;\n        }), f.d(A, \"PhysicsRadialImpulseFalloff\", function() {\n          return go;\n        }), f.d(A, \"PhysicsUpdraftMode\", function() {\n          return Or;\n        }), f.d(A, \"PhysicsImpostor\", function() {\n          return At.a;\n        }), f.d(A, \"PhysicsJoint\", function() {\n          return Jt.e;\n        }), f.d(A, \"DistanceJoint\", function() {\n          return Jt.a;\n        }), f.d(A, \"MotorEnabledJoint\", function() {\n          return Jt.d;\n        }), f.d(A, \"HingeJoint\", function() {\n          return Jt.c;\n        }), f.d(A, \"Hinge2Joint\", function() {\n          return Jt.b;\n        }), f.d(A, \"CannonJSPlugin\", function() {\n          return Bs;\n        }), f.d(A, \"AmmoJSPlugin\", function() {\n          return Iu;\n        }), f.d(A, \"OimoJSPlugin\", function() {\n          return Mu;\n        }), f.d(A, \"AnaglyphPostProcess\", function() {\n          return Ja;\n        }), f.d(A, \"BlackAndWhitePostProcess\", function() {\n          return fd;\n        }), f.d(A, \"BloomEffect\", function() {\n          return Pc;\n        }), f.d(A, \"BloomMergePostProcess\", function() {\n          return Ac;\n        }), f.d(A, \"BlurPostProcess\", function() {\n          return _n;\n        }), f.d(A, \"ChromaticAberrationPostProcess\", function() {\n          return xc;\n        }), f.d(A, \"CircleOfConfusionPostProcess\", function() {\n          return Cc;\n        }), f.d(A, \"ColorCorrectionPostProcess\", function() {\n          return pd;\n        }), f.d(A, \"ConvolutionPostProcess\", function() {\n          return _d;\n        }), f.d(A, \"DepthOfFieldBlurPostProcess\", function() {\n          return pa;\n        }), f.d(A, \"DepthOfFieldEffectBlurLevel\", function() {\n          return Ji;\n        }), f.d(A, \"DepthOfFieldEffect\", function() {\n          return Rc;\n        }), f.d(A, \"DepthOfFieldMergePostProcessOptions\", function() {\n          return Lm;\n        }), f.d(A, \"DepthOfFieldMergePostProcess\", function() {\n          return md;\n        }), f.d(A, \"DisplayPassPostProcess\", function() {\n          return gd;\n        }), f.d(A, \"ExtractHighlightsPostProcess\", function() {\n          return Sc;\n        }), f.d(A, \"FilterPostProcess\", function() {\n          return vd;\n        }), f.d(A, \"FxaaPostProcess\", function() {\n          return vo;\n        }), f.d(A, \"GrainPostProcess\", function() {\n          return Oc;\n        }), f.d(A, \"HighlightsPostProcess\", function() {\n          return km;\n        }), f.d(A, \"ImageProcessingPostProcess\", function() {\n          return Io;\n        }), f.d(A, \"MotionBlurPostProcess\", function() {\n          return Mc;\n        }), f.d(A, \"PassPostProcess\", function() {\n          return Ci;\n        }), f.d(A, \"PassCubePostProcess\", function() {\n          return Tf;\n        }), f.d(A, \"PostProcess\", function() {\n          return ft;\n        }), f.d(A, \"PostProcessManager\", function() {\n          return es.a;\n        }), f.d(A, \"RefractionPostProcess\", function() {\n          return bd;\n        }), f.d(A, \"DefaultRenderingPipeline\", function() {\n          return Sd;\n        }), f.d(A, \"LensRenderingPipeline\", function() {\n          return Qm;\n        }), f.d(A, \"SSAO2RenderingPipeline\", function() {\n          return Ad;\n        }), f.d(A, \"SSAORenderingPipeline\", function() {\n          return eg;\n        }), f.d(A, \"StandardRenderingPipeline\", function() {\n          return Pd;\n        }), f.d(A, \"PostProcessRenderEffect\", function() {\n          return xt;\n        }), f.d(A, \"PostProcessRenderPipeline\", function() {\n          return Ir;\n        }), f.d(A, \"PostProcessRenderPipelineManager\", function() {\n          return Td;\n        }), f.d(A, \"PostProcessRenderPipelineManagerSceneComponent\", function() {\n          return Ed;\n        }), f.d(A, \"SharpenPostProcess\", function() {\n          return Ic;\n        }), f.d(A, \"StereoscopicInterlacePostProcessI\", function() {\n          return og;\n        }), f.d(A, \"StereoscopicInterlacePostProcess\", function() {\n          return ag;\n        }), f.d(A, \"TonemappingOperator\", function() {\n          return $i;\n        }), f.d(A, \"TonemapPostProcess\", function() {\n          return cg;\n        }), f.d(A, \"VolumetricLightScatteringPostProcess\", function() {\n          return xd;\n        }), f.d(A, \"VRDistortionCorrectionPostProcess\", function() {\n          return $a;\n        }), f.d(A, \"VRMultiviewToSingleviewPostProcess\", function() {\n          return ts;\n        }), f.d(A, \"ScreenSpaceReflectionPostProcess\", function() {\n          return Dc;\n        }), f.d(A, \"ScreenSpaceCurvaturePostProcess\", function() {\n          return Cd;\n        }), f.d(A, \"ReflectionProbe\", function() {\n          return Du;\n        }), f.d(A, \"BoundingBoxRenderer\", function() {\n          return Rd;\n        }), f.d(A, \"DepthRenderer\", function() {\n          return Qo;\n        }), f.d(A, \"DepthRendererSceneComponent\", function() {\n          return Od;\n        }), f.d(A, \"EdgesRenderer\", function() {\n          return Lc;\n        }), f.d(A, \"LineEdgesRenderer\", function() {\n          return Md;\n        }), f.d(A, \"GeometryBufferRenderer\", function() {\n          return ri;\n        }), f.d(A, \"GeometryBufferRendererSceneComponent\", function() {\n          return yd;\n        }), f.d(A, \"PrePassRenderer\", function() {\n          return Nc;\n        }), f.d(A, \"PrePassRendererSceneComponent\", function() {\n          return Id;\n        }), f.d(A, \"SubSurfaceSceneComponent\", function() {\n          return Ld;\n        }), f.d(A, \"OutlineRenderer\", function() {\n          return Nd;\n        }), f.d(A, \"RenderingGroup\", function() {\n          return Tg.a;\n        }), f.d(A, \"RenderingGroupInfo\", function() {\n          return Hr.a;\n        }), f.d(A, \"RenderingManager\", function() {\n          return Hr.b;\n        }), f.d(A, \"UtilityLayerRenderer\", function() {\n          return Cn.a;\n        }), f.d(A, \"Scene\", function() {\n          return _e.a;\n        }), f.d(A, \"SceneComponentConstants\", function() {\n          return ot.a;\n        }), f.d(A, \"Stage\", function() {\n          return ot.b;\n        }), f.d(A, \"Sprite\", function() {\n          return wd;\n        }), f.d(A, \"SpriteManager\", function() {\n          return Bd;\n        }), f.d(A, \"SpriteMap\", function() {\n          return Cg;\n        }), f.d(A, \"SpritePackedManager\", function() {\n          return Rg;\n        }), f.d(A, \"SpriteSceneComponent\", function() {\n          return Fd;\n        }), f.d(A, \"AlphaState\", function() {\n          return Og.a;\n        }), f.d(A, \"DepthCullingState\", function() {\n          return Mg.a;\n        }), f.d(A, \"StencilState\", function() {\n          return Ig.a;\n        }), f.d(A, \"AndOrNotEvaluator\", function() {\n          return Dg.a;\n        }), f.d(A, \"AssetTaskState\", function() {\n          return ui;\n        }), f.d(A, \"AbstractAssetTask\", function() {\n          return hi;\n        }), f.d(A, \"AssetsProgressEvent\", function() {\n          return Ud;\n        }), f.d(A, \"ContainerAssetTask\", function() {\n          return Vd;\n        }), f.d(A, \"MeshAssetTask\", function() {\n          return kd;\n        }), f.d(A, \"TextFileAssetTask\", function() {\n          return Gd;\n        }), f.d(A, \"BinaryFileAssetTask\", function() {\n          return zd;\n        }), f.d(A, \"ImageAssetTask\", function() {\n          return jd;\n        }), f.d(A, \"TextureAssetTask\", function() {\n          return Hd;\n        }), f.d(A, \"CubeTextureAssetTask\", function() {\n          return Wd;\n        }), f.d(A, \"HDRCubeTextureAssetTask\", function() {\n          return Xd;\n        }), f.d(A, \"EquiRectangularCubeTextureAssetTask\", function() {\n          return Yd;\n        }), f.d(A, \"AssetsManager\", function() {\n          return Lg;\n        }), f.d(A, \"BasisTranscodeConfiguration\", function() {\n          return M_;\n        }), f.d(A, \"BasisTools\", function() {\n          return ro;\n        }), f.d(A, \"DDSTools\", function() {\n          return Di;\n        }), f.d(A, \"expandToProperty\", function() {\n          return L.b;\n        }), f.d(A, \"serialize\", function() {\n          return L.c;\n        }), f.d(A, \"serializeAsTexture\", function() {\n          return L.m;\n        }), f.d(A, \"serializeAsColor3\", function() {\n          return L.e;\n        }), f.d(A, \"serializeAsFresnelParameters\", function() {\n          return L.h;\n        }), f.d(A, \"serializeAsVector2\", function() {\n          return L.n;\n        }), f.d(A, \"serializeAsVector3\", function() {\n          return L.o;\n        }), f.d(A, \"serializeAsMeshReference\", function() {\n          return L.k;\n        }), f.d(A, \"serializeAsColorCurves\", function() {\n          return L.g;\n        }), f.d(A, \"serializeAsColor4\", function() {\n          return L.f;\n        }), f.d(A, \"serializeAsImageProcessingConfiguration\", function() {\n          return L.i;\n        }), f.d(A, \"serializeAsQuaternion\", function() {\n          return L.l;\n        }), f.d(A, \"serializeAsMatrix\", function() {\n          return L.j;\n        }), f.d(A, \"serializeAsCameraReference\", function() {\n          return L.d;\n        }), f.d(A, \"SerializationHelper\", function() {\n          return L.a;\n        }), f.d(A, \"Deferred\", function() {\n          return Ng;\n        }), f.d(A, \"EnvironmentTextureTools\", function() {\n          return gi;\n        }), f.d(A, \"MeshExploder\", function() {\n          return wg;\n        }), f.d(A, \"FilesInput\", function() {\n          return Fg;\n        }), f.d(A, \"CubeMapToSphericalPolynomialTools\", function() {\n          return Lo;\n        }), f.d(A, \"HDRTools\", function() {\n          return Pu;\n        }), f.d(A, \"PanoramaToCubeMapTools\", function() {\n          return ws;\n        }), f.d(A, \"KhronosTextureContainer\", function() {\n          return Yo;\n        }), f.d(A, \"EventState\", function() {\n          return C.a;\n        }), f.d(A, \"Observer\", function() {\n          return C.d;\n        }), f.d(A, \"MultiObserver\", function() {\n          return C.b;\n        }), f.d(A, \"Observable\", function() {\n          return C.c;\n        }), f.d(A, \"PerformanceMonitor\", function() {\n          return Kd.a;\n        }), f.d(A, \"RollingAverage\", function() {\n          return Kd.b;\n        }), f.d(A, \"PromisePolyfill\", function() {\n          return Bg.a;\n        }), f.d(A, \"SceneOptimization\", function() {\n          return di;\n        }), f.d(A, \"TextureOptimization\", function() {\n          return _a;\n        }), f.d(A, \"HardwareScalingOptimization\", function() {\n          return Fc;\n        }), f.d(A, \"ShadowsOptimization\", function() {\n          return ma;\n        }), f.d(A, \"PostProcessesOptimization\", function() {\n          return ga;\n        }), f.d(A, \"LensFlaresOptimization\", function() {\n          return va;\n        }), f.d(A, \"CustomOptimization\", function() {\n          return Qd;\n        }), f.d(A, \"ParticlesOptimization\", function() {\n          return ya;\n        }), f.d(A, \"RenderTargetsOptimization\", function() {\n          return Bc;\n        }), f.d(A, \"MergeMeshesOptimization\", function() {\n          return ba;\n        }), f.d(A, \"SceneOptimizerOptions\", function() {\n          return Uc;\n        }), f.d(A, \"SceneOptimizer\", function() {\n          return Ug;\n        }), f.d(A, \"SceneSerializer\", function() {\n          return kc;\n        }), f.d(A, \"SmartArray\", function() {\n          return si.a;\n        }), f.d(A, \"SmartArrayNoDuplicate\", function() {\n          return si.b;\n        }), f.d(A, \"StringDictionary\", function() {\n          return rl.a;\n        }), f.d(A, \"Tags\", function() {\n          return Vg.a;\n        }), f.d(A, \"TextureTools\", function() {\n          return kg;\n        }), f.d(A, \"TGATools\", function() {\n          return ta;\n        }), f.d(A, \"Tools\", function() {\n          return Xe.b;\n        }), f.d(A, \"className\", function() {\n          return Xe.c;\n        }), f.d(A, \"AsyncLoop\", function() {\n          return Xe.a;\n        }), f.d(A, \"VideoRecorder\", function() {\n          return Gg;\n        }), f.d(A, \"JoystickAxis\", function() {\n          return rn;\n        }), f.d(A, \"VirtualJoystick\", function() {\n          return Ka;\n        }), f.d(A, \"WorkerPool\", function() {\n          return xs;\n        }), f.d(A, \"Logger\", function() {\n          return l.a;\n        }), f.d(A, \"_TypeStore\", function() {\n          return O.a;\n        }), f.d(A, \"FilesInputStore\", function() {\n          return fs.a;\n        }), f.d(A, \"DeepCopier\", function() {\n          return de.a;\n        }), f.d(A, \"PivotTools\", function() {\n          return Un.a;\n        }), f.d(A, \"PrecisionDate\", function() {\n          return ye.a;\n        }), f.d(A, \"ScreenshotTools\", function() {\n          return yo;\n        }), f.d(A, \"WebRequest\", function() {\n          return re.a;\n        }), f.d(A, \"InspectableType\", function() {\n          return wc;\n        }), f.d(A, \"BRDFTextureTools\", function() {\n          return Ho;\n        }), f.d(A, \"RGBDTextureTools\", function() {\n          return ql;\n        }), f.d(A, \"ColorGradient\", function() {\n          return gc;\n        }), f.d(A, \"Color3Gradient\", function() {\n          return ad;\n        }), f.d(A, \"FactorGradient\", function() {\n          return vc;\n        }), f.d(A, \"GradientHelper\", function() {\n          return On;\n        }), f.d(A, \"PerfCounter\", function() {\n          return Gn.a;\n        }), f.d(A, \"RetryStrategy\", function() {\n          return zg.a;\n        }), f.d(A, \"CanvasGenerator\", function() {\n          return ns.a;\n        }), f.d(A, \"LoadFileError\", function() {\n          return Xr.b;\n        }), f.d(A, \"RequestFileError\", function() {\n          return Xr.d;\n        }), f.d(A, \"ReadFileError\", function() {\n          return Xr.c;\n        }), f.d(A, \"FileTools\", function() {\n          return Xr.a;\n        }), f.d(A, \"StringTools\", function() {\n          return Hn.a;\n        }), f.d(A, \"DataReader\", function() {\n          return jg;\n        }), f.d(A, \"MinMaxReducer\", function() {\n          return yu;\n        }), f.d(A, \"DepthReducer\", function() {\n          return bu;\n        }), f.d(A, \"DataStorage\", function() {\n          return Hg;\n        }), f.d(A, \"SceneRecorder\", function() {\n          return Wg;\n        }), f.d(A, \"KhronosTextureContainer2\", function() {\n          return Cs;\n        }), f.d(A, \"Trajectory\", function() {\n          return Xg;\n        }), f.d(A, \"TrajectoryClassifier\", function() {\n          return Yg;\n        }), f.d(A, \"TimerState\", function() {\n          return Li;\n        }), f.d(A, \"setAndStartTimer\", function() {\n          return Os;\n        }), f.d(A, \"AdvancedTimer\", function() {\n          return Kp;\n        }), f.d(A, \"CopyTools\", function() {\n          return Kg.a;\n        }), f.d(A, \"WebXRCamera\", function() {\n          return iu;\n        }), f.d(A, \"WebXREnterExitUIButton\", function() {\n          return cu;\n        }), f.d(A, \"WebXREnterExitUIOptions\", function() {\n          return Yp;\n        }), f.d(A, \"WebXREnterExitUI\", function() {\n          return lu;\n        }), f.d(A, \"WebXRExperienceHelper\", function() {\n          return ru;\n        }), f.d(A, \"WebXRInput\", function() {\n          return su;\n        }), f.d(A, \"WebXRInputSource\", function() {\n          return au;\n        }), f.d(A, \"WebXRManagedOutputCanvasOptions\", function() {\n          return is;\n        }), f.d(A, \"WebXRManagedOutputCanvas\", function() {\n          return Rl;\n        }), f.d(A, \"WebXRState\", function() {\n          return fn;\n        }), f.d(A, \"WebXRTrackingState\", function() {\n          return Xi;\n        }), f.d(A, \"WebXRSessionManager\", function() {\n          return rs;\n        }), f.d(A, \"WebXRDefaultExperienceOptions\", function() {\n          return Qp;\n        }), f.d(A, \"WebXRDefaultExperience\", function() {\n          return uu;\n        }), f.d(A, \"WebXRFeatureName\", function() {\n          return ti;\n        }), f.d(A, \"WebXRFeaturesManager\", function() {\n          return Wn;\n        }), f.d(A, \"WebXRAbstractFeature\", function() {\n          return ni;\n        }), f.d(A, \"WebXRHitTestLegacy\", function() {\n          return Ea;\n        }), f.d(A, \"WebXRAnchorSystem\", function() {\n          return Sa;\n        }), f.d(A, \"WebXRPlaneDetector\", function() {\n          return Aa;\n        }), f.d(A, \"WebXRBackgroundRemover\", function() {\n          return Pa;\n        }), f.d(A, \"WebXRMotionControllerTeleportation\", function() {\n          return to;\n        }), f.d(A, \"WebXRControllerPointerSelection\", function() {\n          return eo;\n        }), f.d(A, \"IWebXRControllerPhysicsOptions\", function() {\n          return Zg;\n        }), f.d(A, \"WebXRControllerPhysics\", function() {\n          return xa;\n        }), f.d(A, \"WebXRHitTest\", function() {\n          return Ca;\n        }), f.d(A, \"WebXRFeaturePointSystem\", function() {\n          return Ra;\n        }), f.d(A, \"WebXRHand\", function() {\n          return $d;\n        }), f.d(A, \"WebXRHandTracking\", function() {\n          return Oa;\n        }), f.d(A, \"WebXRAbstractMotionController\", function() {\n          return br;\n        }), f.d(A, \"WebXRControllerComponent\", function() {\n          return yr;\n        }), f.d(A, \"WebXRGenericTriggerMotionController\", function() {\n          return Rs;\n        }), f.d(A, \"WebXRMicrosoftMixedRealityController\", function() {\n          return ef;\n        }), f.d(A, \"WebXRMotionControllerManager\", function() {\n          return wn;\n        }), f.d(A, \"WebXROculusTouchMotionController\", function() {\n          return zc;\n        }), f.d(A, \"WebXRHTCViveMotionController\", function() {\n          return tf;\n        }), f.d(A, \"WebXRProfiledMotionController\", function() {\n          return ou;\n        });\n        var V = f(35), _ = f(91), C = f(6), u = f(0), I = f(9), O = f(11), x = function() {\n          function r(t, e) {\n            this.triggerOptions = t, this.onBeforeExecuteObservable = new C.c(), t.parameter ? (this.trigger = t.trigger, this._triggerParameter = t.parameter) : t.trigger ? this.trigger = t.trigger : this.trigger = t, this._nextActiveAction = this, this._condition = e;\n          }\n          return r.prototype._prepare = function() {\n          }, r.prototype.getTriggerParameter = function() {\n            return this._triggerParameter;\n          }, r.prototype._executeCurrent = function(t) {\n            if (this._nextActiveAction._condition) {\n              var e = this._nextActiveAction._condition, n = this._actionManager.getScene().getRenderId();\n              if (e._evaluationId === n) {\n                if (!e._currentResult)\n                  return;\n              } else {\n                if (e._evaluationId = n, !e.isValid())\n                  return void (e._currentResult = !1);\n                e._currentResult = !0;\n              }\n            }\n            this.onBeforeExecuteObservable.notifyObservers(this), this._nextActiveAction.execute(t), this.skipToNextActiveAction();\n          }, r.prototype.execute = function(t) {\n          }, r.prototype.skipToNextActiveAction = function() {\n            this._nextActiveAction._child ? (this._nextActiveAction._child._actionManager || (this._nextActiveAction._child._actionManager = this._actionManager), this._nextActiveAction = this._nextActiveAction._child) : this._nextActiveAction = this;\n          }, r.prototype.then = function(t) {\n            return this._child = t, t._actionManager = this._actionManager, t._prepare(), t;\n          }, r.prototype._getProperty = function(t) {\n            return this._actionManager._getProperty(t);\n          }, r.prototype._getEffectiveTarget = function(t, e) {\n            return this._actionManager._getEffectiveTarget(t, e);\n          }, r.prototype.serialize = function(t) {\n          }, r.prototype._serialize = function(t, e) {\n            var n = { type: 1, children: [], name: t.name, properties: t.properties || [] };\n            if (this._child && this._child.serialize(n), this._condition) {\n              var i = this._condition.serialize();\n              return i.children.push(n), e && e.children.push(i), i;\n            }\n            return e && e.children.push(n), n;\n          }, r._SerializeValueAsString = function(t) {\n            return typeof t == \"number\" ? t.toString() : typeof t == \"boolean\" ? t ? \"true\" : \"false\" : t instanceof u.d ? t.x + \", \" + t.y : t instanceof u.e ? t.x + \", \" + t.y + \", \" + t.z : t instanceof I.a ? t.r + \", \" + t.g + \", \" + t.b : t instanceof I.b ? t.r + \", \" + t.g + \", \" + t.b + \", \" + t.a : t;\n          }, r._GetTargetProperty = function(t) {\n            return { name: \"target\", targetType: t._isMesh ? \"MeshProperties\" : t._isLight ? \"LightProperties\" : t._isCamera ? \"CameraProperties\" : \"SceneProperties\", value: t._isScene ? \"Scene\" : t.name };\n          }, r;\n        }();\n        O.a.RegisteredTypes[\"BABYLON.Action\"] = x;\n        var m = f(47), c = f(1), T = function() {\n          function r(t) {\n            this._actionManager = t;\n          }\n          return r.prototype.isValid = function() {\n            return !0;\n          }, r.prototype._getProperty = function(t) {\n            return this._actionManager._getProperty(t);\n          }, r.prototype._getEffectiveTarget = function(t, e) {\n            return this._actionManager._getEffectiveTarget(t, e);\n          }, r.prototype.serialize = function() {\n          }, r.prototype._serialize = function(t) {\n            return { type: 2, children: [], name: t.name, properties: t.properties };\n          }, r;\n        }(), S = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = t.IsEqual);\n            var s = r.call(this, e) || this;\n            return s.propertyPath = i, s.value = o, s.operator = a, s._target = n, s._effectiveTarget = s._getEffectiveTarget(n, s.propertyPath), s._property = s._getProperty(s.propertyPath), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t, \"IsEqual\", { get: function() {\n            return t._IsEqual;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsDifferent\", { get: function() {\n            return t._IsDifferent;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsGreater\", { get: function() {\n            return t._IsGreater;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsLesser\", { get: function() {\n            return t._IsLesser;\n          }, enumerable: !1, configurable: !0 }), t.prototype.isValid = function() {\n            switch (this.operator) {\n              case t.IsGreater:\n                return this._effectiveTarget[this._property] > this.value;\n              case t.IsLesser:\n                return this._effectiveTarget[this._property] < this.value;\n              case t.IsEqual:\n              case t.IsDifferent:\n                var e;\n                return e = this.value.equals ? this.value.equals(this._effectiveTarget[this._property]) : this.value === this._effectiveTarget[this._property], this.operator === t.IsEqual ? e : !e;\n            }\n            return !1;\n          }, t.prototype.serialize = function() {\n            return this._serialize({ name: \"ValueCondition\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }, { name: \"operator\", value: t.GetOperatorName(this.operator) }] });\n          }, t.GetOperatorName = function(e) {\n            switch (e) {\n              case t._IsEqual:\n                return \"IsEqual\";\n              case t._IsDifferent:\n                return \"IsDifferent\";\n              case t._IsGreater:\n                return \"IsGreater\";\n              case t._IsLesser:\n                return \"IsLesser\";\n              default:\n                return \"\";\n            }\n          }, t._IsEqual = 0, t._IsDifferent = 1, t._IsGreater = 2, t._IsLesser = 3, t;\n        }(T), E = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.predicate = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.isValid = function() {\n            return this.predicate();\n          }, t;\n        }(T), g = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e) || this;\n            return o.value = i, o._target = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype.isValid = function() {\n            return this._target.state === this.value;\n          }, t.prototype.serialize = function() {\n            return this._serialize({ name: \"StateCondition\", properties: [x._GetTargetProperty(this._target), { name: \"value\", value: this.value }] });\n          }, t;\n        }(T);\n        O.a.RegisteredTypes[\"BABYLON.ValueCondition\"] = S, O.a.RegisteredTypes[\"BABYLON.PredicateCondition\"] = E, O.a.RegisteredTypes[\"BABYLON.StateCondition\"] = g;\n        var l = f(8), h = f(2), v = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, o) || this;\n            return a.propertyPath = i, a._target = a._effectiveTarget = n, a;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);\n          }, t.prototype.execute = function() {\n            this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SwitchBooleanAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }] }, e);\n          }, t;\n        }(x), b = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, o) || this;\n            return a.value = i, a._target = n, a;\n          }\n          return Object(c.d)(t, r), t.prototype.execute = function() {\n            this._target.state = this.value;\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SetStateAction\", properties: [x._GetTargetProperty(this._target), { name: \"value\", value: this.value }] }, e);\n          }, t;\n        }(x), D = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, a) || this;\n            return s.propertyPath = i, s.value = o, s._target = s._effectiveTarget = n, s;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);\n          }, t.prototype.execute = function() {\n            this._effectiveTarget[this._property] = this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SetValueAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }] }, e);\n          }, t;\n        }(x), w = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, a) || this;\n            return s.propertyPath = i, s.value = o, s._target = s._effectiveTarget = n, s;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath), typeof this._effectiveTarget[this._property] != \"number\" && l.a.Warn(\"Warning: IncrementValueAction can only be used with number values\");\n          }, t.prototype.execute = function() {\n            this._effectiveTarget[this._property] += this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"IncrementValueAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }] }, e);\n          }, t;\n        }(x), N = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, s) || this;\n            return d.from = i, d.to = o, d.loop = a, d._target = n, d;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._actionManager.getScene().beginAnimation(this._target, this.from, this.to, this.loop);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"PlayAnimationAction\", properties: [x._GetTargetProperty(this._target), { name: \"from\", value: String(this.from) }, { name: \"to\", value: String(this.to) }, { name: \"loop\", value: x._SerializeValueAsString(this.loop) || !1 }] }, e);\n          }, t;\n        }(x), M = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._target = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._actionManager.getScene().stopAnimation(this._target);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"StopAnimationAction\", properties: [x._GetTargetProperty(this._target)] }, e);\n          }, t;\n        }(x), U = function(r) {\n          function t(e, n) {\n            return e === void 0 && (e = h.a.ACTION_NothingTrigger), r.call(this, e, n) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.execute = function() {\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"DoNothingAction\", properties: [] }, e);\n          }, t;\n        }(x), X = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o.children = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            for (var e = 0; e < this.children.length; e++)\n              this.children[e]._actionManager = this._actionManager, this.children[e]._prepare();\n          }, t.prototype.execute = function(e) {\n            for (var n = 0; n < this.children.length; n++)\n              this.children[n].execute(e);\n          }, t.prototype.serialize = function(e) {\n            for (var n = r.prototype._serialize.call(this, { name: \"CombineAction\", properties: [], combine: [] }, e), i = 0; i < this.children.length; i++)\n              n.combine.push(this.children[i].serialize(null));\n            return n;\n          }, t;\n        }(x), j = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o.func = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype.execute = function(e) {\n            this.func(e);\n          }, t;\n        }(x), ne = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, o) || this;\n            return a._target = n, a._parent = i, a;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            if (this._target.parent !== this._parent) {\n              var e = this._parent.getWorldMatrix().clone();\n              e.invert(), this._target.position = u.e.TransformCoordinates(this._target.position, e), this._target.parent = this._parent;\n            }\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SetParentAction\", properties: [x._GetTargetProperty(this._target), x._GetTargetProperty(this._parent)] }, e);\n          }, t;\n        }(x);\n        O.a.RegisteredTypes[\"BABYLON.SetParentAction\"] = ne, O.a.RegisteredTypes[\"BABYLON.ExecuteCodeAction\"] = j, O.a.RegisteredTypes[\"BABYLON.DoNothingAction\"] = U, O.a.RegisteredTypes[\"BABYLON.StopAnimationAction\"] = M, O.a.RegisteredTypes[\"BABYLON.PlayAnimationAction\"] = N, O.a.RegisteredTypes[\"BABYLON.IncrementValueAction\"] = w, O.a.RegisteredTypes[\"BABYLON.SetValueAction\"] = D, O.a.RegisteredTypes[\"BABYLON.SetStateAction\"] = b, O.a.RegisteredTypes[\"BABYLON.SetParentAction\"] = ne;\n        var te = f(22), de = f(41), pe = function(r) {\n          function t(e) {\n            var n = r.call(this) || this;\n            return n._scene = e || te.a.LastCreatedScene, e.actionManagers.push(n), n;\n          }\n          return Object(c.d)(t, r), t.prototype.dispose = function() {\n            for (var e = this._scene.actionManagers.indexOf(this), n = 0; n < this.actions.length; n++) {\n              var i = this.actions[n];\n              t.Triggers[i.trigger]--, t.Triggers[i.trigger] === 0 && delete t.Triggers[i.trigger];\n            }\n            e > -1 && this._scene.actionManagers.splice(e, 1);\n          }, t.prototype.getScene = function() {\n            return this._scene;\n          }, t.prototype.hasSpecificTriggers = function(e) {\n            for (var n = 0; n < this.actions.length; n++) {\n              var i = this.actions[n];\n              if (e.indexOf(i.trigger) > -1)\n                return !0;\n            }\n            return !1;\n          }, t.prototype.hasSpecificTriggers2 = function(e, n) {\n            for (var i = 0; i < this.actions.length; i++) {\n              var o = this.actions[i];\n              if (e == o.trigger || n == o.trigger)\n                return !0;\n            }\n            return !1;\n          }, t.prototype.hasSpecificTrigger = function(e, n) {\n            for (var i = 0; i < this.actions.length; i++) {\n              var o = this.actions[i];\n              if (o.trigger === e && (!n || n(o.getTriggerParameter())))\n                return !0;\n            }\n            return !1;\n          }, Object.defineProperty(t.prototype, \"hasPointerTriggers\", { get: function() {\n            for (var e = 0; e < this.actions.length; e++) {\n              var n = this.actions[e];\n              if (n.trigger >= t.OnPickTrigger && n.trigger <= t.OnPointerOutTrigger)\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasPickTriggers\", { get: function() {\n            for (var e = 0; e < this.actions.length; e++) {\n              var n = this.actions[e];\n              if (n.trigger >= t.OnPickTrigger && n.trigger <= t.OnPickUpTrigger)\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), t.prototype.registerAction = function(e) {\n            return e.trigger === t.OnEveryFrameTrigger && this.getScene().actionManager !== this ? (l.a.Warn(\"OnEveryFrameTrigger can only be used with scene.actionManager\"), null) : (this.actions.push(e), t.Triggers[e.trigger] ? t.Triggers[e.trigger]++ : t.Triggers[e.trigger] = 1, e._actionManager = this, e._prepare(), e);\n          }, t.prototype.unregisterAction = function(e) {\n            var n = this.actions.indexOf(e);\n            return n !== -1 && (this.actions.splice(n, 1), t.Triggers[e.trigger] -= 1, t.Triggers[e.trigger] === 0 && delete t.Triggers[e.trigger], e._actionManager = null, !0);\n          }, t.prototype.processTrigger = function(e, n) {\n            for (var i = 0; i < this.actions.length; i++) {\n              var o = this.actions[i];\n              if (o.trigger === e) {\n                if (n && (e === t.OnKeyUpTrigger || e === t.OnKeyDownTrigger)) {\n                  var a = o.getTriggerParameter();\n                  if (a && a !== n.sourceEvent.keyCode) {\n                    if (!a.toLowerCase)\n                      continue;\n                    var s = a.toLowerCase();\n                    if (s !== n.sourceEvent.key) {\n                      var d = n.sourceEvent.charCode ? n.sourceEvent.charCode : n.sourceEvent.keyCode;\n                      if (String.fromCharCode(d).toLowerCase() !== s)\n                        continue;\n                    }\n                  }\n                }\n                o._executeCurrent(n);\n              }\n            }\n          }, t.prototype._getEffectiveTarget = function(e, n) {\n            for (var i = n.split(\".\"), o = 0; o < i.length - 1; o++)\n              e = e[i[o]];\n            return e;\n          }, t.prototype._getProperty = function(e) {\n            var n = e.split(\".\");\n            return n[n.length - 1];\n          }, t.prototype.serialize = function(e) {\n            for (var n = { children: new Array(), name: e, type: 3, properties: new Array() }, i = 0; i < this.actions.length; i++) {\n              var o = { type: 0, children: new Array(), name: t.GetTriggerName(this.actions[i].trigger), properties: new Array() }, a = this.actions[i].triggerOptions;\n              if (a && typeof a != \"number\")\n                if (a.parameter instanceof Node)\n                  o.properties.push(x._GetTargetProperty(a.parameter));\n                else {\n                  var s = {};\n                  de.a.DeepCopy(a.parameter, s, [\"mesh\"]), a.parameter && a.parameter.mesh && (s._meshId = a.parameter.mesh.id), o.properties.push({ name: \"parameter\", targetType: null, value: s });\n                }\n              this.actions[i].serialize(o), n.children.push(o);\n            }\n            return n;\n          }, t.Parse = function(e, n, i) {\n            var o = new t(i);\n            n === null ? i.actionManager = o : n.actionManager = o;\n            for (var a = function(F, z, J, ie) {\n              if (ie === null) {\n                var se = parseFloat(z);\n                return z === \"true\" || z === \"false\" ? z === \"true\" : isNaN(se) ? z : se;\n              }\n              for (var ce = ie.split(\".\"), ue = z.split(\",\"), fe = 0; fe < ce.length; fe++)\n                J = J[ce[fe]];\n              if (typeof J == \"boolean\")\n                return ue[0] === \"true\";\n              if (typeof J == \"string\")\n                return ue[0];\n              var ve = new Array();\n              for (fe = 0; fe < ue.length; fe++)\n                ve.push(parseFloat(ue[fe]));\n              return J instanceof u.e ? u.e.FromArray(ve) : J instanceof u.f ? u.f.FromArray(ve) : J instanceof I.a ? I.a.FromArray(ve) : J instanceof I.b ? I.b.FromArray(ve) : parseFloat(ue[0]);\n            }, s = function(F, z, J, ie, se) {\n              if (se === void 0 && (se = null), !F.detached) {\n                var ce = new Array(), ue = null, fe = null, ve = F.combine && F.combine.length > 0;\n                if (F.type === 2 ? ce.push(o) : ce.push(z), ve) {\n                  for (var Te = new Array(), Re = 0; Re < F.combine.length; Re++)\n                    s(F.combine[Re], t.NothingTrigger, J, ie, Te);\n                  ce.push(Te);\n                } else\n                  for (var Ae = 0; Ae < F.properties.length; Ae++) {\n                    var Ee = F.properties[Ae].value, Se = F.properties[Ae].name, De = F.properties[Ae].targetType;\n                    Se === \"target\" ? Ee = ue = De !== null && De === \"SceneProperties\" ? i : i.getNodeByName(Ee) : Se === \"parent\" ? Ee = i.getNodeByName(Ee) : Se === \"sound\" ? i.getSoundByName && (Ee = i.getSoundByName(Ee)) : Se !== \"propertyPath\" ? Ee = F.type === 2 && Se === \"operator\" ? S[Ee] : a(0, Ee, ue, Se === \"value\" ? fe : null) : fe = Ee, ce.push(Ee);\n                  }\n                if (se === null ? ce.push(J) : ce.push(null), F.name === \"InterpolateValueAction\") {\n                  var xe = ce[ce.length - 2];\n                  ce[ce.length - 1] = xe, ce[ce.length - 2] = J;\n                }\n                var Le = function(we, Ye) {\n                  var et = O.a.GetClass(\"BABYLON.\" + we);\n                  if (et) {\n                    var nt = Object.create(et.prototype);\n                    return nt.constructor.apply(nt, Ye), nt;\n                  }\n                }(F.name, ce);\n                if (Le instanceof T && J !== null) {\n                  var Me = new U(z, J);\n                  ie ? ie.then(Me) : o.registerAction(Me), ie = Me;\n                }\n                for (se === null ? Le instanceof T ? (J = Le, Le = ie) : (J = null, ie ? ie.then(Le) : o.registerAction(Le)) : se.push(Le), Ae = 0; Ae < F.children.length; Ae++)\n                  s(F.children[Ae], z, J, Le, null);\n              }\n            }, d = 0; d < e.children.length; d++) {\n              var p, y = e.children[d];\n              if (y.properties.length > 0) {\n                var P = y.properties[0].value, R = y.properties[0].targetType === null ? P : i.getMeshByName(P);\n                R._meshId && (R.mesh = i.getMeshByID(R._meshId)), p = { trigger: t[y.name], parameter: R };\n              } else\n                p = t[y.name];\n              for (var B = 0; B < y.children.length; B++)\n                y.detached || s(y.children[B], p, null, null);\n            }\n          }, t.GetTriggerName = function(e) {\n            switch (e) {\n              case 0:\n                return \"NothingTrigger\";\n              case 1:\n                return \"OnPickTrigger\";\n              case 2:\n                return \"OnLeftPickTrigger\";\n              case 3:\n                return \"OnRightPickTrigger\";\n              case 4:\n                return \"OnCenterPickTrigger\";\n              case 5:\n                return \"OnPickDownTrigger\";\n              case 6:\n                return \"OnPickUpTrigger\";\n              case 7:\n                return \"OnLongPressTrigger\";\n              case 8:\n                return \"OnPointerOverTrigger\";\n              case 9:\n                return \"OnPointerOutTrigger\";\n              case 10:\n                return \"OnEveryFrameTrigger\";\n              case 11:\n                return \"OnIntersectionEnterTrigger\";\n              case 12:\n                return \"OnIntersectionExitTrigger\";\n              case 13:\n                return \"OnKeyDownTrigger\";\n              case 14:\n                return \"OnKeyUpTrigger\";\n              case 15:\n                return \"OnPickOutTrigger\";\n              default:\n                return \"\";\n            }\n          }, t.NothingTrigger = h.a.ACTION_NothingTrigger, t.OnPickTrigger = h.a.ACTION_OnPickTrigger, t.OnLeftPickTrigger = h.a.ACTION_OnLeftPickTrigger, t.OnRightPickTrigger = h.a.ACTION_OnRightPickTrigger, t.OnCenterPickTrigger = h.a.ACTION_OnCenterPickTrigger, t.OnPickDownTrigger = h.a.ACTION_OnPickDownTrigger, t.OnDoublePickTrigger = h.a.ACTION_OnDoublePickTrigger, t.OnPickUpTrigger = h.a.ACTION_OnPickUpTrigger, t.OnPickOutTrigger = h.a.ACTION_OnPickOutTrigger, t.OnLongPressTrigger = h.a.ACTION_OnLongPressTrigger, t.OnPointerOverTrigger = h.a.ACTION_OnPointerOverTrigger, t.OnPointerOutTrigger = h.a.ACTION_OnPointerOutTrigger, t.OnEveryFrameTrigger = h.a.ACTION_OnEveryFrameTrigger, t.OnIntersectionEnterTrigger = h.a.ACTION_OnIntersectionEnterTrigger, t.OnIntersectionExitTrigger = h.a.ACTION_OnIntersectionExitTrigger, t.OnKeyDownTrigger = h.a.ACTION_OnKeyDownTrigger, t.OnKeyUpTrigger = 15, t;\n        }(_.a), ae = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._sound = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._sound !== void 0 && this._sound.play();\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"PlaySoundAction\", properties: [{ name: \"sound\", value: this._sound.name }] }, e);\n          }, t;\n        }(x), ee = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._sound = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._sound !== void 0 && this._sound.stop();\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"StopSoundAction\", properties: [{ name: \"sound\", value: this._sound.name }] }, e);\n          }, t;\n        }(x);\n        O.a.RegisteredTypes[\"BABYLON.PlaySoundAction\"] = ee, O.a.RegisteredTypes[\"BABYLON.StopSoundAction\"] = ee;\n        var K, $ = f(14), L = f(3);\n        (function(r) {\n          r[r.STEP = 1] = \"STEP\";\n        })(K || (K = {}));\n        var G = function() {\n          function r(t, e, n) {\n            this.name = t, this.from = e, this.to = n;\n          }\n          return r.prototype.clone = function() {\n            return new r(this.name, this.from, this.to);\n          }, r;\n        }(), Q = f(29), oe = f(77), re = f(49), Y = function() {\n        }, k = function() {\n          function r(t, e, n, i, o, a) {\n            this.name = t, this.targetProperty = e, this.framePerSecond = n, this.dataType = i, this.loopMode = o, this.enableBlending = a, this._runtimeAnimations = new Array(), this._events = new Array(), this.blendingSpeed = 0.01, this._ranges = {}, this.targetPropertyPath = e.split(\".\"), this.dataType = i, this.loopMode = o === void 0 ? r.ANIMATIONLOOPMODE_CYCLE : o;\n          }\n          return r._PrepareAnimation = function(t, e, n, i, o, a, s, d) {\n            var p = void 0;\n            if (!isNaN(parseFloat(o)) && isFinite(o) ? p = r.ANIMATIONTYPE_FLOAT : o instanceof u.b ? p = r.ANIMATIONTYPE_QUATERNION : o instanceof u.e ? p = r.ANIMATIONTYPE_VECTOR3 : o instanceof u.d ? p = r.ANIMATIONTYPE_VECTOR2 : o instanceof I.a ? p = r.ANIMATIONTYPE_COLOR3 : o instanceof I.b ? p = r.ANIMATIONTYPE_COLOR4 : o instanceof oe.a && (p = r.ANIMATIONTYPE_SIZE), p == null)\n              return null;\n            var y = new r(t, e, n, p, s), P = [{ frame: 0, value: o }, { frame: i, value: a }];\n            return y.setKeys(P), d !== void 0 && y.setEasingFunction(d), y;\n          }, r.CreateAnimation = function(t, e, n, i) {\n            var o = new r(t + \"Animation\", t, n, e, r.ANIMATIONLOOPMODE_CONSTANT);\n            return o.setEasingFunction(i), o;\n          }, r.CreateAndStartAnimation = function(t, e, n, i, o, a, s, d, p, y) {\n            var P = r._PrepareAnimation(t, n, i, o, a, s, d, p);\n            return P ? e.getScene().beginDirectAnimation(e, [P], 0, o, P.loopMode === 1, 1, y) : null;\n          }, r.CreateAndStartHierarchyAnimation = function(t, e, n, i, o, a, s, d, p, y, P) {\n            var R = r._PrepareAnimation(t, i, o, a, s, d, p, y);\n            return R ? e.getScene().beginDirectHierarchyAnimation(e, n, [R], 0, a, R.loopMode === 1, 1, P) : null;\n          }, r.CreateMergeAndStartAnimation = function(t, e, n, i, o, a, s, d, p, y) {\n            var P = r._PrepareAnimation(t, n, i, o, a, s, d, p);\n            return P ? (e.animations.push(P), e.getScene().beginAnimation(e, 0, o, P.loopMode === 1, 1, y)) : null;\n          }, r.MakeAnimationAdditive = function(t, e, n, i, o) {\n            e === void 0 && (e = 0), i === void 0 && (i = !1);\n            var a = t;\n            if (i && ((a = t.clone()).name = o || a.name), !a._keys.length)\n              return a;\n            e = e >= 0 ? e : 0;\n            var s = 0, d = a._keys[0], p = a._keys.length - 1, y = a._keys[p], P = { referenceValue: d.value, referencePosition: u.c.Vector3[0], referenceQuaternion: u.c.Quaternion[0], referenceScaling: u.c.Vector3[1], keyPosition: u.c.Vector3[2], keyQuaternion: u.c.Quaternion[1], keyScaling: u.c.Vector3[3] }, R = !1, B = d.frame, F = y.frame;\n            if (n) {\n              var z = a.getRange(n);\n              z && (B = z.from, F = z.to);\n            }\n            var J = d.frame === B, ie = y.frame === F;\n            if (a._keys.length === 1) {\n              var se = a._getKeyValue(a._keys[0]);\n              P.referenceValue = se.clone ? se.clone() : se, R = !0;\n            } else\n              e <= d.frame ? (se = a._getKeyValue(d.value), P.referenceValue = se.clone ? se.clone() : se, R = !0) : e >= y.frame && (se = a._getKeyValue(y.value), P.referenceValue = se.clone ? se.clone() : se, R = !0);\n            for (var ce = 0; !R || !J || !ie && ce < a._keys.length - 1; ) {\n              var ue = a._keys[ce], fe = a._keys[ce + 1];\n              if (!R && e >= ue.frame && e <= fe.frame) {\n                if (se = void 0, e === ue.frame)\n                  se = a._getKeyValue(ue.value);\n                else if (e === fe.frame)\n                  se = a._getKeyValue(fe.value);\n                else {\n                  var ve = { key: ce, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT };\n                  se = a._interpolate(e, ve);\n                }\n                P.referenceValue = se.clone ? se.clone() : se, R = !0;\n              }\n              if (!J && B >= ue.frame && B <= fe.frame) {\n                if (B === ue.frame)\n                  s = ce;\n                else if (B === fe.frame)\n                  s = ce + 1;\n                else {\n                  ve = { key: ce, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT };\n                  var Te = { frame: B, value: (se = a._interpolate(B, ve)).clone ? se.clone() : se };\n                  a._keys.splice(ce + 1, 0, Te), s = ce + 1;\n                }\n                J = !0;\n              }\n              !ie && F >= ue.frame && F <= fe.frame && (F === ue.frame ? p = ce : F === fe.frame ? p = ce + 1 : (ve = { key: ce, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT }, Te = { frame: F, value: (se = a._interpolate(F, ve)).clone ? se.clone() : se }, a._keys.splice(ce + 1, 0, Te), p = ce + 1), ie = !0), ce++;\n            }\n            for (a.dataType === r.ANIMATIONTYPE_QUATERNION ? P.referenceValue.normalize().conjugateInPlace() : a.dataType === r.ANIMATIONTYPE_MATRIX && (P.referenceValue.decompose(P.referenceScaling, P.referenceQuaternion, P.referencePosition), P.referenceQuaternion.normalize().conjugateInPlace()), ce = s; ce <= p; ce++)\n              if (Te = a._keys[ce], !ce || a.dataType === r.ANIMATIONTYPE_FLOAT || Te.value !== d.value)\n                switch (a.dataType) {\n                  case r.ANIMATIONTYPE_MATRIX:\n                    Te.value.decompose(P.keyScaling, P.keyQuaternion, P.keyPosition), P.keyPosition.subtractInPlace(P.referencePosition), P.keyScaling.divideInPlace(P.referenceScaling), P.referenceQuaternion.multiplyToRef(P.keyQuaternion, P.keyQuaternion), u.a.ComposeToRef(P.keyScaling, P.keyQuaternion, P.keyPosition, Te.value);\n                    break;\n                  case r.ANIMATIONTYPE_QUATERNION:\n                    P.referenceValue.multiplyToRef(Te.value, Te.value);\n                    break;\n                  case r.ANIMATIONTYPE_VECTOR2:\n                  case r.ANIMATIONTYPE_VECTOR3:\n                  case r.ANIMATIONTYPE_COLOR3:\n                  case r.ANIMATIONTYPE_COLOR4:\n                    Te.value.subtractToRef(P.referenceValue, Te.value);\n                    break;\n                  case r.ANIMATIONTYPE_SIZE:\n                    Te.value.width -= P.referenceValue.width, Te.value.height -= P.referenceValue.height;\n                    break;\n                  default:\n                    Te.value -= P.referenceValue;\n                }\n            return a;\n          }, r.TransitionTo = function(t, e, n, i, o, a, s, d) {\n            if (d === void 0 && (d = null), s <= 0)\n              return n[t] = e, d && d(), null;\n            var p = o * (s / 1e3);\n            a.setKeys([{ frame: 0, value: n[t].clone ? n[t].clone() : n[t] }, { frame: p, value: e }]), n.animations || (n.animations = []), n.animations.push(a);\n            var y = i.beginAnimation(n, 0, p, !1);\n            return y.onAnimationEnd = d, y;\n          }, Object.defineProperty(r.prototype, \"runtimeAnimations\", { get: function() {\n            return this._runtimeAnimations;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasRunningRuntimeAnimations\", { get: function() {\n            for (var t = 0, e = this._runtimeAnimations; t < e.length; t++)\n              if (!e[t].isStopped)\n                return !0;\n            return !1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name + \", property: \" + this.targetProperty;\n            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) {\n              e += \", Ranges: {\";\n              var n = !0;\n              for (var i in this._ranges)\n                n && (e += \", \", n = !1), e += i;\n              e += \"}\";\n            }\n            return e;\n          }, r.prototype.addEvent = function(t) {\n            this._events.push(t), this._events.sort(function(e, n) {\n              return e.frame - n.frame;\n            });\n          }, r.prototype.removeEvents = function(t) {\n            for (var e = 0; e < this._events.length; e++)\n              this._events[e].frame === t && (this._events.splice(e, 1), e--);\n          }, r.prototype.getEvents = function() {\n            return this._events;\n          }, r.prototype.createRange = function(t, e, n) {\n            this._ranges[t] || (this._ranges[t] = new G(t, e, n));\n          }, r.prototype.deleteRange = function(t, e) {\n            e === void 0 && (e = !0);\n            var n = this._ranges[t];\n            if (n) {\n              if (e)\n                for (var i = n.from, o = n.to, a = this._keys.length - 1; a >= 0; a--)\n                  this._keys[a].frame >= i && this._keys[a].frame <= o && this._keys.splice(a, 1);\n              this._ranges[t] = null;\n            }\n          }, r.prototype.getRange = function(t) {\n            return this._ranges[t];\n          }, r.prototype.getKeys = function() {\n            return this._keys;\n          }, r.prototype.getHighestFrame = function() {\n            for (var t = 0, e = 0, n = this._keys.length; e < n; e++)\n              t < this._keys[e].frame && (t = this._keys[e].frame);\n            return t;\n          }, r.prototype.getEasingFunction = function() {\n            return this._easingFunction;\n          }, r.prototype.setEasingFunction = function(t) {\n            this._easingFunction = t;\n          }, r.prototype.floatInterpolateFunction = function(t, e, n) {\n            return $.a.Lerp(t, e, n);\n          }, r.prototype.floatInterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return $.a.Hermite(t, e, n, i, o);\n          }, r.prototype.quaternionInterpolateFunction = function(t, e, n) {\n            return u.b.Slerp(t, e, n);\n          }, r.prototype.quaternionInterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return u.b.Hermite(t, e, n, i, o).normalize();\n          }, r.prototype.vector3InterpolateFunction = function(t, e, n) {\n            return u.e.Lerp(t, e, n);\n          }, r.prototype.vector3InterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return u.e.Hermite(t, e, n, i, o);\n          }, r.prototype.vector2InterpolateFunction = function(t, e, n) {\n            return u.d.Lerp(t, e, n);\n          }, r.prototype.vector2InterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return u.d.Hermite(t, e, n, i, o);\n          }, r.prototype.sizeInterpolateFunction = function(t, e, n) {\n            return oe.a.Lerp(t, e, n);\n          }, r.prototype.color3InterpolateFunction = function(t, e, n) {\n            return I.a.Lerp(t, e, n);\n          }, r.prototype.color4InterpolateFunction = function(t, e, n) {\n            return I.b.Lerp(t, e, n);\n          }, r.prototype._getKeyValue = function(t) {\n            return typeof t == \"function\" ? t() : t;\n          }, r.prototype._interpolate = function(t, e) {\n            if (e.loopMode === r.ANIMATIONLOOPMODE_CONSTANT && e.repeatCount > 0)\n              return e.highLimitValue.clone ? e.highLimitValue.clone() : e.highLimitValue;\n            var n = this._keys;\n            if (n.length === 1)\n              return this._getKeyValue(n[0].value);\n            var i = e.key;\n            if (n[i].frame >= t)\n              for (; i - 1 >= 0 && n[i].frame >= t; )\n                i--;\n            for (var o = i; o < n.length; o++) {\n              var a = n[o + 1];\n              if (a.frame >= t) {\n                e.key = o;\n                var s = n[o], d = this._getKeyValue(s.value);\n                if (s.interpolation === K.STEP)\n                  return d;\n                var p = this._getKeyValue(a.value), y = s.outTangent !== void 0 && a.inTangent !== void 0, P = a.frame - s.frame, R = (t - s.frame) / P, B = this.getEasingFunction();\n                switch (B != null && (R = B.ease(R)), this.dataType) {\n                  case r.ANIMATIONTYPE_FLOAT:\n                    var F = y ? this.floatInterpolateFunctionWithTangents(d, s.outTangent * P, p, a.inTangent * P, R) : this.floatInterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return F;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return e.offsetValue * e.repeatCount + F;\n                    }\n                    break;\n                  case r.ANIMATIONTYPE_QUATERNION:\n                    var z = y ? this.quaternionInterpolateFunctionWithTangents(d, s.outTangent.scale(P), p, a.inTangent.scale(P), R) : this.quaternionInterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return z;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return z.addInPlace(e.offsetValue.scale(e.repeatCount));\n                    }\n                    return z;\n                  case r.ANIMATIONTYPE_VECTOR3:\n                    var J = y ? this.vector3InterpolateFunctionWithTangents(d, s.outTangent.scale(P), p, a.inTangent.scale(P), R) : this.vector3InterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return J;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return J.add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_VECTOR2:\n                    var ie = y ? this.vector2InterpolateFunctionWithTangents(d, s.outTangent.scale(P), p, a.inTangent.scale(P), R) : this.vector2InterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return ie;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return ie.add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_SIZE:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return this.sizeInterpolateFunction(d, p, R);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return this.sizeInterpolateFunction(d, p, R).add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_COLOR3:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return this.color3InterpolateFunction(d, p, R);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return this.color3InterpolateFunction(d, p, R).add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_COLOR4:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return this.color4InterpolateFunction(d, p, R);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return this.color4InterpolateFunction(d, p, R).add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_MATRIX:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        if (r.AllowMatricesInterpolation)\n                          return this.matrixInterpolateFunction(d, p, R, e.workValue);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return d;\n                    }\n                }\n                break;\n              }\n            }\n            return this._getKeyValue(n[n.length - 1].value);\n          }, r.prototype.matrixInterpolateFunction = function(t, e, n, i) {\n            return r.AllowMatrixDecomposeForInterpolation ? i ? (u.a.DecomposeLerpToRef(t, e, n, i), i) : u.a.DecomposeLerp(t, e, n) : i ? (u.a.LerpToRef(t, e, n, i), i) : u.a.Lerp(t, e, n);\n          }, r.prototype.clone = function() {\n            var t = new r(this.name, this.targetPropertyPath.join(\".\"), this.framePerSecond, this.dataType, this.loopMode);\n            if (t.enableBlending = this.enableBlending, t.blendingSpeed = this.blendingSpeed, this._keys && t.setKeys(this._keys), this._ranges)\n              for (var e in t._ranges = {}, this._ranges) {\n                var n = this._ranges[e];\n                n && (t._ranges[e] = n.clone());\n              }\n            return t;\n          }, r.prototype.setKeys = function(t) {\n            this._keys = t.slice(0);\n          }, r.prototype.serialize = function() {\n            var t = {};\n            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;\n            var e = this.dataType;\n            t.keys = [];\n            for (var n = this.getKeys(), i = 0; i < n.length; i++) {\n              var o = n[i], a = {};\n              switch (a.frame = o.frame, e) {\n                case r.ANIMATIONTYPE_FLOAT:\n                  a.values = [o.value], o.inTangent !== void 0 && a.values.push(o.inTangent), o.outTangent !== void 0 && (o.inTangent === void 0 && a.values.push(void 0), a.values.push(o.outTangent));\n                  break;\n                case r.ANIMATIONTYPE_QUATERNION:\n                case r.ANIMATIONTYPE_MATRIX:\n                case r.ANIMATIONTYPE_VECTOR3:\n                case r.ANIMATIONTYPE_COLOR3:\n                case r.ANIMATIONTYPE_COLOR4:\n                  a.values = o.value.asArray(), o.inTangent != null && a.values.push(o.inTangent.asArray()), o.outTangent != null && (o.inTangent === void 0 && a.values.push(void 0), a.values.push(o.outTangent.asArray()));\n              }\n              t.keys.push(a);\n            }\n            for (var s in t.ranges = [], this._ranges) {\n              var d = this._ranges[s];\n              if (d) {\n                var p = {};\n                p.name = s, p.from = d.from, p.to = d.to, t.ranges.push(p);\n              }\n            }\n            return t;\n          }, r._UniversalLerp = function(t, e, n) {\n            var i = t.constructor;\n            return i.Lerp ? i.Lerp(t, e, n) : i.Slerp ? i.Slerp(t, e, n) : t.toFixed ? t * (1 - n) + n * e : e;\n          }, r.Parse = function(t) {\n            var e, n, i = new r(t.name, t.property, t.framePerSecond, t.dataType, t.loopBehavior), o = t.dataType, a = [];\n            for (t.enableBlending && (i.enableBlending = t.enableBlending), t.blendingSpeed && (i.blendingSpeed = t.blendingSpeed), n = 0; n < t.keys.length; n++) {\n              var s, d, p = t.keys[n];\n              switch (o) {\n                case r.ANIMATIONTYPE_FLOAT:\n                  e = p.values[0], p.values.length >= 1 && (s = p.values[1]), p.values.length >= 2 && (d = p.values[2]);\n                  break;\n                case r.ANIMATIONTYPE_QUATERNION:\n                  if (e = u.b.FromArray(p.values), p.values.length >= 8) {\n                    var y = u.b.FromArray(p.values.slice(4, 8));\n                    y.equals(u.b.Zero()) || (s = y);\n                  }\n                  if (p.values.length >= 12) {\n                    var P = u.b.FromArray(p.values.slice(8, 12));\n                    P.equals(u.b.Zero()) || (d = P);\n                  }\n                  break;\n                case r.ANIMATIONTYPE_MATRIX:\n                  e = u.a.FromArray(p.values);\n                  break;\n                case r.ANIMATIONTYPE_COLOR3:\n                  e = I.a.FromArray(p.values);\n                  break;\n                case r.ANIMATIONTYPE_COLOR4:\n                  e = I.b.FromArray(p.values);\n                  break;\n                case r.ANIMATIONTYPE_VECTOR3:\n                default:\n                  e = u.e.FromArray(p.values);\n              }\n              var R = {};\n              R.frame = p.frame, R.value = e, s != null && (R.inTangent = s), d != null && (R.outTangent = d), a.push(R);\n            }\n            if (i.setKeys(a), t.ranges)\n              for (n = 0; n < t.ranges.length; n++)\n                e = t.ranges[n], i.createRange(e.name, e.from, e.to);\n            return i;\n          }, r.AppendSerializedAnimations = function(t, e) {\n            L.a.AppendSerializedAnimations(t, e);\n          }, r.ParseFromFileAsync = function(t, e) {\n            var n = this;\n            return new Promise(function(i, o) {\n              var a = new re.a();\n              a.addEventListener(\"readystatechange\", function() {\n                if (a.readyState == 4)\n                  if (a.status == 200) {\n                    var s = JSON.parse(a.responseText);\n                    if (s.length) {\n                      for (var d = new Array(), p = 0, y = s; p < y.length; p++) {\n                        var P = y[p];\n                        d.push(n.Parse(P));\n                      }\n                      i(d);\n                    } else\n                      d = n.Parse(s), t && (d.name = t), i(d);\n                  } else\n                    o(\"Unable to load the animation\");\n              }), a.open(\"GET\", e), a.send();\n            });\n          }, r.CreateFromSnippetAsync = function(t) {\n            var e = this;\n            return new Promise(function(n, i) {\n              var o = new re.a();\n              o.addEventListener(\"readystatechange\", function() {\n                if (o.readyState == 4)\n                  if (o.status == 200) {\n                    var a = JSON.parse(JSON.parse(o.responseText).jsonPayload);\n                    if (a.animations) {\n                      for (var s = JSON.parse(a.animations), d = new Array(), p = 0, y = s; p < y.length; p++) {\n                        var P = y[p];\n                        d.push(e.Parse(P));\n                      }\n                      n(d);\n                    } else\n                      s = JSON.parse(a.animation), (d = e.Parse(s)).snippetId = t, n(d);\n                  } else\n                    i(\"Unable to load the snippet \" + t);\n              }), o.open(\"GET\", e.SnippetUrl + \"/\" + t.replace(/#/g, \"/\")), o.send();\n            });\n          }, r.AllowMatricesInterpolation = !1, r.AllowMatrixDecomposeForInterpolation = !0, r.SnippetUrl = \"https://snippet.babylonjs.com\", r.ANIMATIONTYPE_FLOAT = 0, r.ANIMATIONTYPE_VECTOR3 = 1, r.ANIMATIONTYPE_QUATERNION = 2, r.ANIMATIONTYPE_MATRIX = 3, r.ANIMATIONTYPE_COLOR3 = 4, r.ANIMATIONTYPE_COLOR4 = 7, r.ANIMATIONTYPE_VECTOR2 = 5, r.ANIMATIONTYPE_SIZE = 6, r.ANIMATIONLOOPMODE_RELATIVE = 0, r.ANIMATIONLOOPMODE_CYCLE = 1, r.ANIMATIONLOOPMODE_CONSTANT = 2, r;\n        }();\n        O.a.RegisteredTypes[\"BABYLON.Animation\"] = k, Q.a._AnimationRangeFactory = function(r, t, e) {\n          return new G(r, t, e);\n        };\n        var H = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            a === void 0 && (a = 1e3);\n            var y = r.call(this, e, s) || this;\n            return y.duration = 1e3, y.onInterpolationDoneObservable = new C.c(), y.propertyPath = i, y.value = o, y.duration = a, y.stopOtherAnimations = d, y.onInterpolationDone = p, y._target = y._effectiveTarget = n, y;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);\n          }, t.prototype.execute = function() {\n            var e, n = this, i = this._actionManager.getScene(), o = [{ frame: 0, value: this._effectiveTarget[this._property] }, { frame: 100, value: this.value }];\n            if (typeof this.value == \"number\")\n              e = k.ANIMATIONTYPE_FLOAT;\n            else if (this.value instanceof I.a)\n              e = k.ANIMATIONTYPE_COLOR3;\n            else if (this.value instanceof u.e)\n              e = k.ANIMATIONTYPE_VECTOR3;\n            else if (this.value instanceof u.a)\n              e = k.ANIMATIONTYPE_MATRIX;\n            else {\n              if (!(this.value instanceof u.b))\n                return void l.a.Warn(\"InterpolateValueAction: Unsupported type (\" + typeof this.value + \")\");\n              e = k.ANIMATIONTYPE_QUATERNION;\n            }\n            var a = new k(\"InterpolateValueAction\", this._property, 1e3 / this.duration * 100, e, k.ANIMATIONLOOPMODE_CONSTANT);\n            a.setKeys(o), this.stopOtherAnimations && i.stopAnimation(this._effectiveTarget), i.beginDirectAnimation(this._effectiveTarget, [a], 0, 100, !1, 1, function() {\n              n.onInterpolationDoneObservable.notifyObservers(n), n.onInterpolationDone && n.onInterpolationDone();\n            });\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"InterpolateValueAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }, { name: \"duration\", value: x._SerializeValueAsString(this.duration) }, { name: \"stopOtherAnimations\", value: x._SerializeValueAsString(this.stopOtherAnimations) || !1 }] }, e);\n          }, t;\n        }(x);\n        O.a.RegisteredTypes[\"BABYLON.InterpolateValueAction\"] = H;\n        var Z = Object.freeze(new u.b(0, 0, 0, 0)), W = Object.freeze(u.e.Zero()), q = Object.freeze(u.d.Zero()), he = Object.freeze(oe.a.Zero()), ge = Object.freeze(I.a.Black()), me = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            if (this._events = new Array(), this._currentFrame = 0, this._originalValue = new Array(), this._originalBlendValue = null, this._offsetsCache = {}, this._highLimitsCache = {}, this._stopped = !1, this._blendingFactor = 0, this._currentValue = null, this._currentActiveTarget = null, this._directTarget = null, this._targetPath = \"\", this._weight = 1, this._ratioOffset = 0, this._previousDelay = 0, this._previousRatio = 0, this._targetIsArray = !1, this._animation = e, this._target = t, this._scene = n, this._host = i, this._activeTargets = [], e._runtimeAnimations.push(this), this._animationState = { key: 0, repeatCount: 0, loopMode: this._getCorrectLoopMode() }, this._animation.dataType === k.ANIMATIONTYPE_MATRIX && (this._animationState.workValue = u.a.Zero()), this._keys = this._animation.getKeys(), this._minFrame = this._keys[0].frame, this._maxFrame = this._keys[this._keys.length - 1].frame, this._minValue = this._keys[0].value, this._maxValue = this._keys[this._keys.length - 1].value, this._minFrame !== 0) {\n              var a = { frame: 0, value: this._minValue };\n              this._keys.splice(0, 0, a);\n            }\n            if (this._target instanceof Array) {\n              for (var s = 0, d = 0, p = this._target; d < p.length; d++) {\n                var y = p[d];\n                this._preparePath(y, s), this._getOriginalValues(s), s++;\n              }\n              this._targetIsArray = !0;\n            } else\n              this._preparePath(this._target), this._getOriginalValues(), this._targetIsArray = !1, this._directTarget = this._activeTargets[0];\n            var P = e.getEvents();\n            P && P.length > 0 && P.forEach(function(R) {\n              o._events.push(R._clone());\n            }), this._enableBlending = t && t.animationPropertiesOverride ? t.animationPropertiesOverride.enableBlending : this._animation.enableBlending;\n          }\n          return Object.defineProperty(r.prototype, \"currentFrame\", { get: function() {\n            return this._currentFrame;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"weight\", { get: function() {\n            return this._weight;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentValue\", { get: function() {\n            return this._currentValue;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"targetPath\", { get: function() {\n            return this._targetPath;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"target\", { get: function() {\n            return this._currentActiveTarget;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isAdditive\", { get: function() {\n            return this._host && this._host.isAdditive;\n          }, enumerable: !1, configurable: !0 }), r.prototype._preparePath = function(t, e) {\n            e === void 0 && (e = 0);\n            var n = this._animation.targetPropertyPath;\n            if (n.length > 1) {\n              for (var i = t[n[0]], o = 1; o < n.length - 1; o++)\n                i = i[n[o]];\n              this._targetPath = n[n.length - 1], this._activeTargets[e] = i;\n            } else\n              this._targetPath = n[0], this._activeTargets[e] = t;\n          }, Object.defineProperty(r.prototype, \"animation\", { get: function() {\n            return this._animation;\n          }, enumerable: !1, configurable: !0 }), r.prototype.reset = function(t) {\n            if (t === void 0 && (t = !1), t)\n              if (this._target instanceof Array)\n                for (var e = 0, n = 0, i = this._target; n < i.length; n++) {\n                  var o = i[n];\n                  this._originalValue[e] !== void 0 && this._setValue(o, this._activeTargets[e], this._originalValue[e], -1, e), e++;\n                }\n              else\n                this._originalValue[0] !== void 0 && this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);\n            for (this._offsetsCache = {}, this._highLimitsCache = {}, this._currentFrame = 0, this._blendingFactor = 0, e = 0; e < this._events.length; e++)\n              this._events[e].isDone = !1;\n          }, r.prototype.isStopped = function() {\n            return this._stopped;\n          }, r.prototype.dispose = function() {\n            var t = this._animation.runtimeAnimations.indexOf(this);\n            t > -1 && this._animation.runtimeAnimations.splice(t, 1);\n          }, r.prototype.setValue = function(t, e) {\n            if (this._targetIsArray)\n              for (var n = 0; n < this._target.length; n++) {\n                var i = this._target[n];\n                this._setValue(i, this._activeTargets[n], t, e, n);\n              }\n            else\n              this._setValue(this._target, this._directTarget, t, e, 0);\n          }, r.prototype._getOriginalValues = function(t) {\n            var e;\n            t === void 0 && (t = 0);\n            var n = this._activeTargets[t];\n            (e = n.getRestPose && this._targetPath === \"_matrix\" ? n.getRestPose() : n[this._targetPath]) && e.clone ? this._originalValue[t] = e.clone() : this._originalValue[t] = e;\n          }, r.prototype._setValue = function(t, e, n, i, o) {\n            if (this._currentActiveTarget = e, this._weight = i, this._enableBlending && this._blendingFactor <= 1) {\n              if (!this._originalBlendValue) {\n                var a = e[this._targetPath];\n                a.clone ? this._originalBlendValue = a.clone() : this._originalBlendValue = a;\n              }\n              this._originalBlendValue.m ? k.AllowMatrixDecomposeForInterpolation ? this._currentValue ? u.a.DecomposeLerpToRef(this._originalBlendValue, n, this._blendingFactor, this._currentValue) : this._currentValue = u.a.DecomposeLerp(this._originalBlendValue, n, this._blendingFactor) : this._currentValue ? u.a.LerpToRef(this._originalBlendValue, n, this._blendingFactor, this._currentValue) : this._currentValue = u.a.Lerp(this._originalBlendValue, n, this._blendingFactor) : this._currentValue = k._UniversalLerp(this._originalBlendValue, n, this._blendingFactor);\n              var s = t && t.animationPropertiesOverride ? t.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;\n              this._blendingFactor += s;\n            } else\n              this._currentValue = n;\n            i !== -1 ? this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[o]) : e[this._targetPath] = this._currentValue, t.markAsDirty && t.markAsDirty(this._animation.targetProperty);\n          }, r.prototype._getCorrectLoopMode = function() {\n            return this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.loopMode : this._animation.loopMode;\n          }, r.prototype.goToFrame = function(t) {\n            var e = this._animation.getKeys();\n            t < e[0].frame ? t = e[0].frame : t > e[e.length - 1].frame && (t = e[e.length - 1].frame);\n            var n = this._events;\n            if (n.length)\n              for (var i = 0; i < n.length; i++)\n                n[i].onlyOnce || (n[i].isDone = n[i].frame < t);\n            this._currentFrame = t;\n            var o = this._animation._interpolate(t, this._animationState);\n            this.setValue(o, -1);\n          }, r.prototype._prepareForSpeedRatioChange = function(t) {\n            var e = this._previousDelay * (this._animation.framePerSecond * t) / 1e3;\n            this._ratioOffset = this._previousRatio - e;\n          }, r.prototype.animate = function(t, e, n, i, o, a) {\n            a === void 0 && (a = -1);\n            var s = this._animation, d = s.targetPropertyPath;\n            if (!d || d.length < 1)\n              return this._stopped = !0, !1;\n            var p = !0;\n            (e < this._minFrame || e > this._maxFrame) && (e = this._minFrame), (n < this._minFrame || n > this._maxFrame) && (n = this._maxFrame);\n            var y, P, R = n - e, B = t * (s.framePerSecond * o) / 1e3 + this._ratioOffset, F = 0;\n            if (this._previousDelay = t, this._previousRatio = B, !i && n >= e && B >= R)\n              p = !1, F = s._getKeyValue(this._maxValue);\n            else if (!i && e >= n && B <= R)\n              p = !1, F = s._getKeyValue(this._minValue);\n            else if (this._animationState.loopMode !== k.ANIMATIONLOOPMODE_CYCLE) {\n              var z = n.toString() + e.toString();\n              if (!this._offsetsCache[z]) {\n                this._animationState.repeatCount = 0, this._animationState.loopMode = k.ANIMATIONLOOPMODE_CYCLE;\n                var J = s._interpolate(e, this._animationState), ie = s._interpolate(n, this._animationState);\n                switch (this._animationState.loopMode = this._getCorrectLoopMode(), s.dataType) {\n                  case k.ANIMATIONTYPE_FLOAT:\n                    this._offsetsCache[z] = ie - J;\n                    break;\n                  case k.ANIMATIONTYPE_QUATERNION:\n                    this._offsetsCache[z] = ie.subtract(J);\n                    break;\n                  case k.ANIMATIONTYPE_VECTOR3:\n                    this._offsetsCache[z] = ie.subtract(J);\n                  case k.ANIMATIONTYPE_VECTOR2:\n                    this._offsetsCache[z] = ie.subtract(J);\n                  case k.ANIMATIONTYPE_SIZE:\n                    this._offsetsCache[z] = ie.subtract(J);\n                  case k.ANIMATIONTYPE_COLOR3:\n                    this._offsetsCache[z] = ie.subtract(J);\n                }\n                this._highLimitsCache[z] = ie;\n              }\n              F = this._highLimitsCache[z], y = this._offsetsCache[z];\n            }\n            if (y === void 0)\n              switch (s.dataType) {\n                case k.ANIMATIONTYPE_FLOAT:\n                  y = 0;\n                  break;\n                case k.ANIMATIONTYPE_QUATERNION:\n                  y = Z;\n                  break;\n                case k.ANIMATIONTYPE_VECTOR3:\n                  y = W;\n                  break;\n                case k.ANIMATIONTYPE_VECTOR2:\n                  y = q;\n                  break;\n                case k.ANIMATIONTYPE_SIZE:\n                  y = he;\n                  break;\n                case k.ANIMATIONTYPE_COLOR3:\n                  y = ge;\n              }\n            if (this._host && this._host.syncRoot) {\n              var se = this._host.syncRoot;\n              P = e + (n - e) * ((se.masterFrame - se.fromFrame) / (se.toFrame - se.fromFrame));\n            } else\n              P = p && R !== 0 ? e + B % R : n;\n            var ce = this._events;\n            if ((R > 0 && this.currentFrame > P || R < 0 && this.currentFrame < P) && (this._onLoop(), ce.length))\n              for (var ue = 0; ue < ce.length; ue++)\n                ce[ue].onlyOnce || (ce[ue].isDone = !1);\n            this._currentFrame = P, this._animationState.repeatCount = R === 0 ? 0 : B / R >> 0, this._animationState.highLimitValue = F, this._animationState.offsetValue = y;\n            var fe = s._interpolate(P, this._animationState);\n            if (this.setValue(fe, a), ce.length) {\n              for (ue = 0; ue < ce.length; ue++)\n                if (R > 0 && P >= ce[ue].frame && ce[ue].frame >= e || R < 0 && P <= ce[ue].frame && ce[ue].frame <= e) {\n                  var ve = ce[ue];\n                  ve.isDone || (ve.onlyOnce && (ce.splice(ue, 1), ue--), ve.isDone = !0, ve.action(P));\n                }\n            }\n            return p || (this._stopped = !0), p;\n          }, r;\n        }(), _e = f(20), ye = f(57), Pe = f(44), be = f(23), Fe = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null);\n            var p = r.call(this, e, n.getScene()) || this;\n            return p.name = e, p.children = new Array(), p.animations = new Array(), p._index = null, p._absoluteTransform = new u.a(), p._invertedAbsoluteTransform = new u.a(), p._scalingDeterminant = 1, p._worldTransform = new u.a(), p._needToDecompose = !0, p._needToCompose = !1, p._linkedTransformNode = null, p._waitingTransformNodeId = null, p._skeleton = n, p._localMatrix = o ? o.clone() : u.a.Identity(), p._restPose = a || p._localMatrix.clone(), p._bindPose = p._localMatrix.clone(), p._baseMatrix = s || p._localMatrix.clone(), p._index = d, n.bones.push(p), p.setParent(i, !1), (s || o) && p._updateDifferenceMatrix(), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"_matrix\", { get: function() {\n            return this._compose(), this._localMatrix;\n          }, set: function(e) {\n            this._localMatrix.copyFrom(e), this._needToDecompose = !0;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"Bone\";\n          }, t.prototype.getSkeleton = function() {\n            return this._skeleton;\n          }, t.prototype.getParent = function() {\n            return this._parent;\n          }, t.prototype.getChildren = function() {\n            return this.children;\n          }, t.prototype.getIndex = function() {\n            return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;\n          }, t.prototype.setParent = function(e, n) {\n            if (n === void 0 && (n = !0), this._parent !== e) {\n              if (this._parent) {\n                var i = this._parent.children.indexOf(this);\n                i !== -1 && this._parent.children.splice(i, 1);\n              }\n              this._parent = e, this._parent && this._parent.children.push(this), n && this._updateDifferenceMatrix(), this.markAsDirty();\n            }\n          }, t.prototype.getLocalMatrix = function() {\n            return this._compose(), this._localMatrix;\n          }, t.prototype.getBaseMatrix = function() {\n            return this._baseMatrix;\n          }, t.prototype.getRestPose = function() {\n            return this._restPose;\n          }, t.prototype.setRestPose = function(e) {\n            this._restPose.copyFrom(e);\n          }, t.prototype.getBindPose = function() {\n            return this._bindPose;\n          }, t.prototype.setBindPose = function(e) {\n            this._bindPose.copyFrom(e);\n          }, t.prototype.getWorldMatrix = function() {\n            return this._worldTransform;\n          }, t.prototype.returnToRest = function() {\n            this._skeleton._numBonesWithLinkedTransformNode > 0 ? this.updateMatrix(this._restPose, !1, !1) : this.updateMatrix(this._restPose, !1, !0);\n          }, t.prototype.getInvertedAbsoluteTransform = function() {\n            return this._invertedAbsoluteTransform;\n          }, t.prototype.getAbsoluteTransform = function() {\n            return this._absoluteTransform;\n          }, t.prototype.linkTransformNode = function(e) {\n            this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode--, this._linkedTransformNode = e, this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode++;\n          }, t.prototype.getTransformNode = function() {\n            return this._linkedTransformNode;\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._decompose(), this._localPosition;\n          }, set: function(e) {\n            this._decompose(), this._localPosition.copyFrom(e), this._markAsDirtyAndCompose();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotation\", { get: function() {\n            return this.getRotation();\n          }, set: function(e) {\n            this.setRotation(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotationQuaternion\", { get: function() {\n            return this._decompose(), this._localRotation;\n          }, set: function(e) {\n            this.setRotationQuaternion(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaling\", { get: function() {\n            return this.getScale();\n          }, set: function(e) {\n            this.setScale(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._skeleton.animationPropertiesOverride;\n          }, enumerable: !1, configurable: !0 }), t.prototype._decompose = function() {\n            this._needToDecompose && (this._needToDecompose = !1, this._localScaling || (this._localScaling = u.e.Zero(), this._localRotation = u.b.Zero(), this._localPosition = u.e.Zero()), this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition));\n          }, t.prototype._compose = function() {\n            this._needToCompose && (this._localScaling ? (this._needToCompose = !1, u.a.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix)) : this._needToCompose = !1);\n          }, t.prototype.updateMatrix = function(e, n, i) {\n            n === void 0 && (n = !0), i === void 0 && (i = !0), this._baseMatrix.copyFrom(e), n && this._updateDifferenceMatrix(), i ? (this._needToCompose = !1, this._localMatrix.copyFrom(e), this._markAsDirtyAndDecompose()) : this.markAsDirty();\n          }, t.prototype._updateDifferenceMatrix = function(e, n) {\n            if (n === void 0 && (n = !0), e || (e = this._baseMatrix), this._parent ? e.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform) : this._absoluteTransform.copyFrom(e), this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform), n)\n              for (var i = 0; i < this.children.length; i++)\n                this.children[i]._updateDifferenceMatrix();\n            this._scalingDeterminant = this._absoluteTransform.determinant() < 0 ? -1 : 1;\n          }, t.prototype.markAsDirty = function() {\n            this._currentRenderId++, this._childUpdateId++, this._skeleton._markAsDirty();\n          }, t.prototype._markAsDirtyAndCompose = function() {\n            this.markAsDirty(), this._needToCompose = !0;\n          }, t.prototype._markAsDirtyAndDecompose = function() {\n            this.markAsDirty(), this._needToDecompose = !0;\n          }, t.prototype.translate = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL);\n            var o = this.getLocalMatrix();\n            if (n == be.c.LOCAL)\n              o.addAtIndex(12, e.x), o.addAtIndex(13, e.y), o.addAtIndex(14, e.z);\n            else {\n              var a = null;\n              i && (a = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n              var s = t._tmpMats[0], d = t._tmpVecs[0];\n              this._parent ? i && a ? (s.copyFrom(this._parent.getAbsoluteTransform()), s.multiplyToRef(a, s)) : s.copyFrom(this._parent.getAbsoluteTransform()) : u.a.IdentityToRef(s), s.setTranslationFromFloats(0, 0, 0), s.invert(), u.e.TransformCoordinatesToRef(e, s, d), o.addAtIndex(12, d.x), o.addAtIndex(13, d.y), o.addAtIndex(14, d.z);\n            }\n            this._markAsDirtyAndDecompose();\n          }, t.prototype.setPosition = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL);\n            var o = this.getLocalMatrix();\n            if (n == be.c.LOCAL)\n              o.setTranslationFromFloats(e.x, e.y, e.z);\n            else {\n              var a = null;\n              i && (a = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n              var s = t._tmpMats[0], d = t._tmpVecs[0];\n              this._parent ? (i && a ? (s.copyFrom(this._parent.getAbsoluteTransform()), s.multiplyToRef(a, s)) : s.copyFrom(this._parent.getAbsoluteTransform()), s.invert()) : u.a.IdentityToRef(s), u.e.TransformCoordinatesToRef(e, s, d), o.setTranslationFromFloats(d.x, d.y, d.z);\n            }\n            this._markAsDirtyAndDecompose();\n          }, t.prototype.setAbsolutePosition = function(e, n) {\n            this.setPosition(e, be.c.WORLD, n);\n          }, t.prototype.scale = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = this.getLocalMatrix(), s = t._tmpMats[0];\n            u.a.ScalingToRef(e, n, i, s), s.multiplyToRef(a, a), s.invert();\n            for (var d = 0, p = this.children; d < p.length; d++) {\n              var y = (B = p[d]).getLocalMatrix();\n              y.multiplyToRef(s, y), y.multiplyAtIndex(12, e), y.multiplyAtIndex(13, n), y.multiplyAtIndex(14, i), B._markAsDirtyAndDecompose();\n            }\n            if (this._markAsDirtyAndDecompose(), o)\n              for (var P = 0, R = this.children; P < R.length; P++) {\n                var B;\n                (B = R[P]).scale(e, n, i, o);\n              }\n          }, t.prototype.setScale = function(e) {\n            this._decompose(), this._localScaling.copyFrom(e), this._markAsDirtyAndCompose();\n          }, t.prototype.getScale = function() {\n            return this._decompose(), this._localScaling;\n          }, t.prototype.getScaleToRef = function(e) {\n            this._decompose(), e.copyFrom(this._localScaling);\n          }, t.prototype.setYawPitchRoll = function(e, n, i, o, a) {\n            if (o === void 0 && (o = be.c.LOCAL), o === be.c.LOCAL) {\n              var s = t._tmpQuat;\n              return u.b.RotationYawPitchRollToRef(e, n, i, s), void this.setRotationQuaternion(s, o, a);\n            }\n            var d = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(d, a)) {\n              var p = t._tmpMats[1];\n              u.a.RotationYawPitchRollToRef(e, n, i, p), d.multiplyToRef(p, p), this._rotateWithMatrix(p, o, a);\n            }\n          }, t.prototype.rotate = function(e, n, i, o) {\n            i === void 0 && (i = be.c.LOCAL);\n            var a = t._tmpMats[0];\n            a.setTranslationFromFloats(0, 0, 0), u.a.RotationAxisToRef(e, n, a), this._rotateWithMatrix(a, i, o);\n          }, t.prototype.setAxisAngle = function(e, n, i, o) {\n            if (i === void 0 && (i = be.c.LOCAL), i === be.c.LOCAL) {\n              var a = t._tmpQuat;\n              return u.b.RotationAxisToRef(e, n, a), void this.setRotationQuaternion(a, i, o);\n            }\n            var s = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(s, o)) {\n              var d = t._tmpMats[1];\n              u.a.RotationAxisToRef(e, n, d), s.multiplyToRef(d, d), this._rotateWithMatrix(d, i, o);\n            }\n          }, t.prototype.setRotation = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL), this.setYawPitchRoll(e.y, e.x, e.z, n, i);\n          }, t.prototype.setRotationQuaternion = function(e, n, i) {\n            if (n === void 0 && (n = be.c.LOCAL), n === be.c.LOCAL)\n              return this._decompose(), this._localRotation.copyFrom(e), void this._markAsDirtyAndCompose();\n            var o = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(o, i)) {\n              var a = t._tmpMats[1];\n              u.a.FromQuaternionToRef(e, a), o.multiplyToRef(a, a), this._rotateWithMatrix(a, n, i);\n            }\n          }, t.prototype.setRotationMatrix = function(e, n, i) {\n            if (n === void 0 && (n = be.c.LOCAL), n === be.c.LOCAL) {\n              var o = t._tmpQuat;\n              return u.b.FromRotationMatrixToRef(e, o), void this.setRotationQuaternion(o, n, i);\n            }\n            var a = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(a, i)) {\n              var s = t._tmpMats[1];\n              s.copyFrom(e), a.multiplyToRef(e, s), this._rotateWithMatrix(s, n, i);\n            }\n          }, t.prototype._rotateWithMatrix = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL);\n            var o = this.getLocalMatrix(), a = o.m[12], s = o.m[13], d = o.m[14], p = this.getParent(), y = t._tmpMats[3], P = t._tmpMats[4];\n            p && n == be.c.WORLD ? (i ? (y.copyFrom(i.getWorldMatrix()), p.getAbsoluteTransform().multiplyToRef(y, y)) : y.copyFrom(p.getAbsoluteTransform()), P.copyFrom(y), P.invert(), o.multiplyToRef(y, o), o.multiplyToRef(e, o), o.multiplyToRef(P, o)) : n == be.c.WORLD && i ? (y.copyFrom(i.getWorldMatrix()), P.copyFrom(y), P.invert(), o.multiplyToRef(y, o), o.multiplyToRef(e, o), o.multiplyToRef(P, o)) : o.multiplyToRef(e, o), o.setTranslationFromFloats(a, s, d), this.computeAbsoluteTransforms(), this._markAsDirtyAndDecompose();\n          }, t.prototype._getNegativeRotationToRef = function(e, n) {\n            var i = t._tmpMats[2];\n            return e.copyFrom(this.getAbsoluteTransform()), n && (e.multiplyToRef(n.getWorldMatrix(), e), u.a.ScalingToRef(n.scaling.x, n.scaling.y, n.scaling.z, i)), e.invert(), !isNaN(e.m[0]) && (i.multiplyAtIndex(0, this._scalingDeterminant), e.multiplyToRef(i, e), !0);\n          }, t.prototype.getPosition = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getPositionToRef(e, n, i), i;\n          }, t.prototype.getPositionToRef = function(e, n, i) {\n            if (e === void 0 && (e = be.c.LOCAL), e == be.c.LOCAL) {\n              var o = this.getLocalMatrix();\n              i.x = o.m[12], i.y = o.m[13], i.z = o.m[14];\n            } else {\n              var a = null;\n              n && (a = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n              var s = t._tmpMats[0];\n              n && a ? (s.copyFrom(this.getAbsoluteTransform()), s.multiplyToRef(a, s)) : s = this.getAbsoluteTransform(), i.x = s.m[12], i.y = s.m[13], i.z = s.m[14];\n            }\n          }, t.prototype.getAbsolutePosition = function(e) {\n            e === void 0 && (e = null);\n            var n = u.e.Zero();\n            return this.getPositionToRef(be.c.WORLD, e, n), n;\n          }, t.prototype.getAbsolutePositionToRef = function(e, n) {\n            this.getPositionToRef(be.c.WORLD, e, n);\n          }, t.prototype.computeAbsoluteTransforms = function() {\n            if (this._compose(), this._parent)\n              this._localMatrix.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform);\n            else {\n              this._absoluteTransform.copyFrom(this._localMatrix);\n              var e = this._skeleton.getPoseMatrix();\n              e && this._absoluteTransform.multiplyToRef(e, this._absoluteTransform);\n            }\n            for (var n = this.children, i = n.length, o = 0; o < i; o++)\n              n[o].computeAbsoluteTransforms();\n          }, t.prototype.getDirection = function(e, n) {\n            n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getDirectionToRef(e, n, i), i;\n          }, t.prototype.getDirectionToRef = function(e, n, i) {\n            n === void 0 && (n = null);\n            var o = null;\n            n && (o = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n            var a = t._tmpMats[0];\n            a.copyFrom(this.getAbsoluteTransform()), n && o && a.multiplyToRef(o, a), u.e.TransformNormalToRef(e, a, i), i.normalize();\n          }, t.prototype.getRotation = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getRotationToRef(e, n, i), i;\n          }, t.prototype.getRotationToRef = function(e, n, i) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var o = t._tmpQuat;\n            this.getRotationQuaternionToRef(e, n, o), o.toEulerAnglesToRef(i);\n          }, t.prototype.getRotationQuaternion = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var i = u.b.Identity();\n            return this.getRotationQuaternionToRef(e, n, i), i;\n          }, t.prototype.getRotationQuaternionToRef = function(e, n, i) {\n            if (e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null), e == be.c.LOCAL)\n              this._decompose(), i.copyFrom(this._localRotation);\n            else {\n              var o = t._tmpMats[0], a = this.getAbsoluteTransform();\n              n ? a.multiplyToRef(n.getWorldMatrix(), o) : o.copyFrom(a), o.multiplyAtIndex(0, this._scalingDeterminant), o.multiplyAtIndex(1, this._scalingDeterminant), o.multiplyAtIndex(2, this._scalingDeterminant), o.decompose(void 0, i, void 0);\n            }\n          }, t.prototype.getRotationMatrix = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL);\n            var i = u.a.Identity();\n            return this.getRotationMatrixToRef(e, n, i), i;\n          }, t.prototype.getRotationMatrixToRef = function(e, n, i) {\n            if (e === void 0 && (e = be.c.LOCAL), e == be.c.LOCAL)\n              this.getLocalMatrix().getRotationMatrixToRef(i);\n            else {\n              var o = t._tmpMats[0], a = this.getAbsoluteTransform();\n              n ? a.multiplyToRef(n.getWorldMatrix(), o) : o.copyFrom(a), o.multiplyAtIndex(0, this._scalingDeterminant), o.multiplyAtIndex(1, this._scalingDeterminant), o.multiplyAtIndex(2, this._scalingDeterminant), o.getRotationMatrixToRef(i);\n            }\n          }, t.prototype.getAbsolutePositionFromLocal = function(e, n) {\n            n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getAbsolutePositionFromLocalToRef(e, n, i), i;\n          }, t.prototype.getAbsolutePositionFromLocalToRef = function(e, n, i) {\n            n === void 0 && (n = null);\n            var o = null;\n            n && (o = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n            var a = t._tmpMats[0];\n            n && o ? (a.copyFrom(this.getAbsoluteTransform()), a.multiplyToRef(o, a)) : a = this.getAbsoluteTransform(), u.e.TransformCoordinatesToRef(e, a, i);\n          }, t.prototype.getLocalPositionFromAbsolute = function(e, n) {\n            n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getLocalPositionFromAbsoluteToRef(e, n, i), i;\n          }, t.prototype.getLocalPositionFromAbsoluteToRef = function(e, n, i) {\n            n === void 0 && (n = null);\n            var o = null;\n            n && (o = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n            var a = t._tmpMats[0];\n            a.copyFrom(this.getAbsoluteTransform()), n && o && a.multiplyToRef(o, a), a.invert(), u.e.TransformCoordinatesToRef(e, a, i);\n          }, t.prototype.setCurrentPoseAsRest = function() {\n            this.setRestPose(this.getLocalMatrix());\n          }, t._tmpVecs = Pe.a.BuildArray(2, u.e.Zero), t._tmpQuat = u.b.Identity(), t._tmpMats = Pe.a.BuildArray(5, u.a.Identity), t;\n        }(Q.a), ke = function() {\n          function r(t, e, n, i, o, a, s, d, p, y) {\n            n === void 0 && (n = 0), i === void 0 && (i = 100), o === void 0 && (o = !1), a === void 0 && (a = 1), y === void 0 && (y = !1), this.target = e, this.fromFrame = n, this.toFrame = i, this.loopAnimation = o, this.onAnimationEnd = s, this.onAnimationLoop = p, this.isAdditive = y, this._localDelayOffset = null, this._pausedDelay = null, this._runtimeAnimations = new Array(), this._paused = !1, this._speedRatio = 1, this._weight = -1, this._syncRoot = null, this.disposeOnEnd = !0, this.animationStarted = !1, this.onAnimationEndObservable = new C.c(), this.onAnimationLoopObservable = new C.c(), this._scene = t, d && this.appendAnimations(e, d), this._speedRatio = a, t._activeAnimatables.push(this);\n          }\n          return Object.defineProperty(r.prototype, \"syncRoot\", { get: function() {\n            return this._syncRoot;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"masterFrame\", { get: function() {\n            return this._runtimeAnimations.length === 0 ? 0 : this._runtimeAnimations[0].currentFrame;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"weight\", { get: function() {\n            return this._weight;\n          }, set: function(t) {\n            this._weight = t !== -1 ? Math.min(Math.max(t, 0), 1) : -1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"speedRatio\", { get: function() {\n            return this._speedRatio;\n          }, set: function(t) {\n            for (var e = 0; e < this._runtimeAnimations.length; e++)\n              this._runtimeAnimations[e]._prepareForSpeedRatioChange(t);\n            this._speedRatio = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.syncWith = function(t) {\n            if (this._syncRoot = t, t) {\n              var e = this._scene._activeAnimatables.indexOf(this);\n              e > -1 && (this._scene._activeAnimatables.splice(e, 1), this._scene._activeAnimatables.push(this));\n            }\n            return this;\n          }, r.prototype.getAnimations = function() {\n            return this._runtimeAnimations;\n          }, r.prototype.appendAnimations = function(t, e) {\n            for (var n = this, i = 0; i < e.length; i++) {\n              var o = e[i], a = new me(t, o, this._scene, this);\n              a._onLoop = function() {\n                n.onAnimationLoopObservable.notifyObservers(n), n.onAnimationLoop && n.onAnimationLoop();\n              }, this._runtimeAnimations.push(a);\n            }\n          }, r.prototype.getAnimationByTargetProperty = function(t) {\n            for (var e = this._runtimeAnimations, n = 0; n < e.length; n++)\n              if (e[n].animation.targetProperty === t)\n                return e[n].animation;\n            return null;\n          }, r.prototype.getRuntimeAnimationByTargetProperty = function(t) {\n            for (var e = this._runtimeAnimations, n = 0; n < e.length; n++)\n              if (e[n].animation.targetProperty === t)\n                return e[n];\n            return null;\n          }, r.prototype.reset = function() {\n            for (var t = this._runtimeAnimations, e = 0; e < t.length; e++)\n              t[e].reset(!0);\n            this._localDelayOffset = null, this._pausedDelay = null;\n          }, r.prototype.enableBlending = function(t) {\n            for (var e = this._runtimeAnimations, n = 0; n < e.length; n++)\n              e[n].animation.enableBlending = !0, e[n].animation.blendingSpeed = t;\n          }, r.prototype.disableBlending = function() {\n            for (var t = this._runtimeAnimations, e = 0; e < t.length; e++)\n              t[e].animation.enableBlending = !1;\n          }, r.prototype.goToFrame = function(t) {\n            var e = this._runtimeAnimations;\n            if (e[0]) {\n              var n = e[0].animation.framePerSecond, i = e[0].currentFrame, o = this.speedRatio === 0 ? 0 : (t - i) / n * 1e3 / this.speedRatio;\n              this._localDelayOffset === null && (this._localDelayOffset = 0), this._localDelayOffset -= o;\n            }\n            for (var a = 0; a < e.length; a++)\n              e[a].goToFrame(t);\n          }, r.prototype.pause = function() {\n            this._paused || (this._paused = !0);\n          }, r.prototype.restart = function() {\n            this._paused = !1;\n          }, r.prototype._raiseOnAnimationEnd = function() {\n            this.onAnimationEnd && this.onAnimationEnd(), this.onAnimationEndObservable.notifyObservers(this);\n          }, r.prototype.stop = function(t, e) {\n            if (t || e) {\n              var n = this._scene._activeAnimatables.indexOf(this);\n              if (n > -1) {\n                for (var i = (a = this._runtimeAnimations).length - 1; i >= 0; i--) {\n                  var o = a[i];\n                  t && o.animation.name != t || e && !e(o.target) || (o.dispose(), a.splice(i, 1));\n                }\n                a.length == 0 && (this._scene._activeAnimatables.splice(n, 1), this._raiseOnAnimationEnd());\n              }\n            } else if ((i = this._scene._activeAnimatables.indexOf(this)) > -1) {\n              this._scene._activeAnimatables.splice(i, 1);\n              var a = this._runtimeAnimations;\n              for (i = 0; i < a.length; i++)\n                a[i].dispose();\n              this._raiseOnAnimationEnd();\n            }\n          }, r.prototype.waitAsync = function() {\n            var t = this;\n            return new Promise(function(e, n) {\n              t.onAnimationEndObservable.add(function() {\n                e(t);\n              }, void 0, void 0, t, !0);\n            });\n          }, r.prototype._animate = function(t) {\n            if (this._paused)\n              return this.animationStarted = !1, this._pausedDelay === null && (this._pausedDelay = t), !0;\n            if (this._localDelayOffset === null ? (this._localDelayOffset = t, this._pausedDelay = null) : this._pausedDelay !== null && (this._localDelayOffset += t - this._pausedDelay, this._pausedDelay = null), this._weight === 0)\n              return !0;\n            var e, n = !1, i = this._runtimeAnimations;\n            for (e = 0; e < i.length; e++) {\n              var o = i[e].animate(t - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);\n              n = n || o;\n            }\n            if (this.animationStarted = n, !n) {\n              if (this.disposeOnEnd)\n                for (e = this._scene._activeAnimatables.indexOf(this), this._scene._activeAnimatables.splice(e, 1), e = 0; e < i.length; e++)\n                  i[e].dispose();\n              this._raiseOnAnimationEnd(), this.disposeOnEnd && (this.onAnimationEnd = null, this.onAnimationLoop = null, this.onAnimationLoopObservable.clear(), this.onAnimationEndObservable.clear());\n            }\n            return n;\n          }, r;\n        }();\n        _e.a.prototype._animate = function() {\n          if (this.animationsEnabled) {\n            var r = ye.a.Now;\n            if (!this._animationTimeLast) {\n              if (this._pendingData.length > 0)\n                return;\n              this._animationTimeLast = r;\n            }\n            this.deltaTime = this.useConstantAnimationDeltaTime ? 16 : (r - this._animationTimeLast) * this.animationTimeScale, this._animationTimeLast = r;\n            var t = this._activeAnimatables;\n            if (t.length !== 0) {\n              this._animationTime += this.deltaTime;\n              for (var e = this._animationTime, n = 0; n < t.length; n++) {\n                var i = t[n];\n                !i._animate(e) && i.disposeOnEnd && n--;\n              }\n              this._processLateAnimationBindings();\n            }\n          }\n        }, _e.a.prototype.beginWeightedAnimation = function(r, t, e, n, i, o, a, s, d, p, y) {\n          n === void 0 && (n = 1), o === void 0 && (o = 1), y === void 0 && (y = !1);\n          var P = this.beginAnimation(r, t, e, i, o, a, s, !1, d, p, y);\n          return P.weight = n, P;\n        }, _e.a.prototype.beginAnimation = function(r, t, e, n, i, o, a, s, d, p, y) {\n          i === void 0 && (i = 1), s === void 0 && (s = !0), y === void 0 && (y = !1), t > e && i > 0 && (i *= -1), s && this.stopAnimation(r, void 0, d), a || (a = new ke(this, r, t, e, n, i, o, void 0, p, y));\n          var P = !d || d(r);\n          if (r.animations && P && a.appendAnimations(r, r.animations), r.getAnimatables)\n            for (var R = r.getAnimatables(), B = 0; B < R.length; B++)\n              this.beginAnimation(R[B], t, e, n, i, o, a, s, d, p);\n          return a.reset(), a;\n        }, _e.a.prototype.beginHierarchyAnimation = function(r, t, e, n, i, o, a, s, d, p, y, P) {\n          o === void 0 && (o = 1), d === void 0 && (d = !0), P === void 0 && (P = !1);\n          var R = r.getDescendants(t), B = [];\n          B.push(this.beginAnimation(r, e, n, i, o, a, s, d, p, void 0, P));\n          for (var F = 0, z = R; F < z.length; F++) {\n            var J = z[F];\n            B.push(this.beginAnimation(J, e, n, i, o, a, s, d, p, void 0, P));\n          }\n          return B;\n        }, _e.a.prototype.beginDirectAnimation = function(r, t, e, n, i, o, a, s, d) {\n          return d === void 0 && (d = !1), o === void 0 && (o = 1), e > n && o > 0 && (o *= -1), new ke(this, r, e, n, i, o, a, t, s, d);\n        }, _e.a.prototype.beginDirectHierarchyAnimation = function(r, t, e, n, i, o, a, s, d, p) {\n          p === void 0 && (p = !1);\n          var y = r.getDescendants(t), P = [];\n          P.push(this.beginDirectAnimation(r, e, n, i, o, a, s, d, p));\n          for (var R = 0, B = y; R < B.length; R++) {\n            var F = B[R];\n            P.push(this.beginDirectAnimation(F, e, n, i, o, a, s, d, p));\n          }\n          return P;\n        }, _e.a.prototype.getAnimatableByTarget = function(r) {\n          for (var t = 0; t < this._activeAnimatables.length; t++)\n            if (this._activeAnimatables[t].target === r)\n              return this._activeAnimatables[t];\n          return null;\n        }, _e.a.prototype.getAllAnimatablesByTarget = function(r) {\n          for (var t = [], e = 0; e < this._activeAnimatables.length; e++)\n            this._activeAnimatables[e].target === r && t.push(this._activeAnimatables[e]);\n          return t;\n        }, _e.a.prototype.stopAnimation = function(r, t, e) {\n          for (var n = 0, i = this.getAllAnimatablesByTarget(r); n < i.length; n++)\n            i[n].stop(t, e);\n        }, _e.a.prototype.stopAllAnimations = function() {\n          if (this._activeAnimatables) {\n            for (var r = 0; r < this._activeAnimatables.length; r++)\n              this._activeAnimatables[r].stop();\n            this._activeAnimatables = [];\n          }\n          for (var t = 0, e = this.animationGroups; t < e.length; t++)\n            e[t].stop();\n        }, _e.a.prototype._registerTargetForLateAnimationBinding = function(r, t) {\n          var e = r.target;\n          this._registeredForLateAnimationBindings.pushNoDuplicate(e), e._lateAnimationHolders || (e._lateAnimationHolders = {}), e._lateAnimationHolders[r.targetPath] || (e._lateAnimationHolders[r.targetPath] = { totalWeight: 0, totalAdditiveWeight: 0, animations: [], additiveAnimations: [], originalValue: t }), r.isAdditive ? (e._lateAnimationHolders[r.targetPath].additiveAnimations.push(r), e._lateAnimationHolders[r.targetPath].totalAdditiveWeight += r.weight) : (e._lateAnimationHolders[r.targetPath].animations.push(r), e._lateAnimationHolders[r.targetPath].totalWeight += r.weight);\n        }, _e.a.prototype._processLateAnimationBindingsForMatrices = function(r) {\n          if (r.totalWeight === 0 && r.totalAdditiveWeight === 0)\n            return r.originalValue;\n          var t = 1, e = u.c.Vector3[0], n = u.c.Vector3[1], i = u.c.Quaternion[0], o = 0, a = r.animations[0], s = r.originalValue, d = 1, p = !1;\n          if (r.totalWeight < 1)\n            d = 1 - r.totalWeight, s.decompose(n, i, e);\n          else {\n            if (o = 1, t = r.totalWeight, (d = a.weight / t) == 1) {\n              if (!r.totalAdditiveWeight)\n                return a.currentValue;\n              p = !0;\n            }\n            a.currentValue.decompose(n, i, e);\n          }\n          if (!p) {\n            n.scaleInPlace(d), e.scaleInPlace(d), i.scaleInPlace(d);\n            for (var y = o; y < r.animations.length; y++)\n              if ((z = r.animations[y]).weight !== 0) {\n                d = z.weight / t;\n                var P = u.c.Vector3[2], R = u.c.Vector3[3], B = u.c.Quaternion[1];\n                z.currentValue.decompose(R, B, P), R.scaleAndAddToRef(d, n), B.scaleAndAddToRef(d, i), P.scaleAndAddToRef(d, e);\n              }\n          }\n          for (var F = 0; F < r.additiveAnimations.length; F++) {\n            var z;\n            (z = r.additiveAnimations[F]).weight !== 0 && (P = u.c.Vector3[2], R = u.c.Vector3[3], B = u.c.Quaternion[1], z.currentValue.decompose(R, B, P), R.multiplyToRef(n, R), u.e.LerpToRef(n, R, z.weight, n), i.multiplyToRef(B, B), u.b.SlerpToRef(i, B, z.weight, i), P.scaleAndAddToRef(z.weight, e));\n          }\n          var J = a ? a._animationState.workValue : u.c.Matrix[0].clone();\n          return u.a.ComposeToRef(n, i, e, J), J;\n        }, _e.a.prototype._processLateAnimationBindingsForQuaternions = function(r, t) {\n          if (r.totalWeight === 0 && r.totalAdditiveWeight === 0)\n            return t;\n          var e = r.animations[0], n = r.originalValue, i = t;\n          if (r.totalWeight === 0 && r.totalAdditiveWeight > 0)\n            i.copyFrom(n);\n          else if (r.animations.length === 1) {\n            if (u.b.SlerpToRef(n, e.currentValue, Math.min(1, r.totalWeight), i), r.totalAdditiveWeight === 0)\n              return i;\n          } else if (r.animations.length > 1) {\n            var o = 1, a = void 0, s = void 0;\n            if (r.totalWeight < 1) {\n              var d = 1 - r.totalWeight;\n              s = [], (a = []).push(n), s.push(d);\n            } else {\n              if (r.animations.length === 2 && (u.b.SlerpToRef(r.animations[0].currentValue, r.animations[1].currentValue, r.animations[1].weight / r.totalWeight, t), r.totalAdditiveWeight === 0))\n                return t;\n              a = [], s = [], o = r.totalWeight;\n            }\n            for (var p = 0; p < r.animations.length; p++) {\n              var y = r.animations[p];\n              a.push(y.currentValue), s.push(y.weight / o);\n            }\n            for (var P = 0, R = 0; R < a.length; )\n              R ? (P += s[R], u.b.SlerpToRef(i, a[R], s[R] / P, i), R++) : (u.b.SlerpToRef(a[R], a[R + 1], s[R + 1] / (s[R] + s[R + 1]), t), i = t, P = s[R] + s[R + 1], R += 2);\n          }\n          for (var B = 0; B < r.additiveAnimations.length; B++)\n            (y = r.additiveAnimations[B]).weight !== 0 && (i.multiplyToRef(y.currentValue, u.c.Quaternion[0]), u.b.SlerpToRef(i, u.c.Quaternion[0], y.weight, i));\n          return i;\n        }, _e.a.prototype._processLateAnimationBindings = function() {\n          if (this._registeredForLateAnimationBindings.length) {\n            for (var r = 0; r < this._registeredForLateAnimationBindings.length; r++) {\n              var t = this._registeredForLateAnimationBindings.data[r];\n              for (var e in t._lateAnimationHolders) {\n                var n = t._lateAnimationHolders[e], i = n.animations[0], o = n.originalValue, a = k.AllowMatrixDecomposeForInterpolation && o.m, s = t[e];\n                if (a)\n                  s = this._processLateAnimationBindingsForMatrices(n);\n                else if (o.w !== void 0)\n                  s = this._processLateAnimationBindingsForQuaternions(n, s || u.b.Identity());\n                else {\n                  var d = 0, p = 1;\n                  if (n.totalWeight < 1)\n                    s = i && o.scale ? o.scale(1 - n.totalWeight) : i ? o * (1 - n.totalWeight) : o.clone ? o.clone() : o;\n                  else if (i) {\n                    p = n.totalWeight;\n                    var y = i.weight / p;\n                    s = y !== 1 ? i.currentValue.scale ? i.currentValue.scale(y) : i.currentValue * y : i.currentValue, d = 1;\n                  }\n                  for (var P = d; P < n.animations.length; P++)\n                    (F = (B = n.animations[P]).weight / p) && (B.currentValue.scaleAndAddToRef ? B.currentValue.scaleAndAddToRef(F, s) : s += B.currentValue * F);\n                  for (var R = 0; R < n.additiveAnimations.length; R++) {\n                    var B, F;\n                    (F = (B = n.additiveAnimations[R]).weight) && (B.currentValue.scaleAndAddToRef ? B.currentValue.scaleAndAddToRef(F, s) : s += B.currentValue * F);\n                  }\n                }\n                t[e] = s;\n              }\n              t._lateAnimationHolders = {};\n            }\n            this._registeredForLateAnimationBindings.reset();\n          }\n        }, Fe.prototype.copyAnimationRange = function(r, t, e, n, i) {\n          n === void 0 && (n = !1), i === void 0 && (i = null), this.animations.length === 0 && (this.animations.push(new k(this.name, \"_matrix\", r.animations[0].framePerSecond, k.ANIMATIONTYPE_MATRIX, 0)), this.animations[0].setKeys([]));\n          var o = r.animations[0].getRange(t);\n          if (!o)\n            return !1;\n          for (var a, s, d, p = o.from, y = o.to, P = r.animations[0].getKeys(), R = r.length, B = r.getParent(), F = this.getParent(), z = n && B && R && this.length && R !== this.length, J = z && F && B ? F.length / B.length : 1, ie = n && !F && i && (i.x !== 1 || i.y !== 1 || i.z !== 1), se = this.animations[0].getKeys(), ce = 0, ue = P.length; ce < ue; ce++)\n            (a = P[ce]).frame >= p && a.frame <= y && (n ? (d = a.value.clone(), z ? (s = d.getTranslation(), d.setTranslation(s.scaleInPlace(J))) : ie && i ? (s = d.getTranslation(), d.setTranslation(s.multiplyInPlace(i))) : d = a.value) : d = a.value, se.push({ frame: a.frame + e, value: d }));\n          return this.animations[0].createRange(t, p + e, y + e), !0;\n        };\n        var We = function() {\n          function r() {\n          }\n          return r.prototype.getClassName = function() {\n            return \"TargetedAnimation\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.animation = this.animation.serialize(), t.targetId = this.target.id, t;\n          }, r;\n        }(), je = function() {\n          function r(t, e) {\n            e === void 0 && (e = null), this.name = t, this._targetedAnimations = new Array(), this._animatables = new Array(), this._from = Number.MAX_VALUE, this._to = -Number.MAX_VALUE, this._speedRatio = 1, this._loopAnimation = !1, this._isAdditive = !1, this.onAnimationEndObservable = new C.c(), this.onAnimationLoopObservable = new C.c(), this.onAnimationGroupLoopObservable = new C.c(), this.onAnimationGroupEndObservable = new C.c(), this.onAnimationGroupPauseObservable = new C.c(), this.onAnimationGroupPlayObservable = new C.c(), this._scene = e || te.a.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._scene.addAnimationGroup(this);\n          }\n          return Object.defineProperty(r.prototype, \"from\", { get: function() {\n            return this._from;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"to\", { get: function() {\n            return this._to;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isStarted\", { get: function() {\n            return this._isStarted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isPlaying\", { get: function() {\n            return this._isStarted && !this._isPaused;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"speedRatio\", { get: function() {\n            return this._speedRatio;\n          }, set: function(t) {\n            if (this._speedRatio !== t) {\n              this._speedRatio = t;\n              for (var e = 0; e < this._animatables.length; e++)\n                this._animatables[e].speedRatio = this._speedRatio;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"loopAnimation\", { get: function() {\n            return this._loopAnimation;\n          }, set: function(t) {\n            if (this._loopAnimation !== t) {\n              this._loopAnimation = t;\n              for (var e = 0; e < this._animatables.length; e++)\n                this._animatables[e].loopAnimation = this._loopAnimation;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isAdditive\", { get: function() {\n            return this._isAdditive;\n          }, set: function(t) {\n            if (this._isAdditive !== t) {\n              this._isAdditive = t;\n              for (var e = 0; e < this._animatables.length; e++)\n                this._animatables[e].isAdditive = this._isAdditive;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"targetedAnimations\", { get: function() {\n            return this._targetedAnimations;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animatables\", { get: function() {\n            return this._animatables;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"children\", { get: function() {\n            return this._targetedAnimations;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addTargetedAnimation = function(t, e) {\n            var n = new We();\n            n.animation = t, n.target = e;\n            var i = t.getKeys();\n            return this._from > i[0].frame && (this._from = i[0].frame), this._to < i[i.length - 1].frame && (this._to = i[i.length - 1].frame), this._targetedAnimations.push(n), n;\n          }, r.prototype.normalize = function(t, e) {\n            t === void 0 && (t = null), e === void 0 && (e = null), t == null && (t = this._from), e == null && (e = this._to);\n            for (var n = 0; n < this._targetedAnimations.length; n++) {\n              var i = this._targetedAnimations[n].animation.getKeys(), o = i[0], a = i[i.length - 1];\n              if (o.frame > t) {\n                var s = { frame: t, value: o.value, inTangent: o.inTangent, outTangent: o.outTangent, interpolation: o.interpolation };\n                i.splice(0, 0, s);\n              }\n              a.frame < e && (s = { frame: e, value: a.value, inTangent: a.inTangent, outTangent: a.outTangent, interpolation: a.interpolation }, i.push(s));\n            }\n            return this._from = t, this._to = e, this;\n          }, r.prototype._processLoop = function(t, e, n) {\n            var i = this;\n            t.onAnimationLoop = function() {\n              i.onAnimationLoopObservable.notifyObservers(e), i._animationLoopFlags[n] || (i._animationLoopFlags[n] = !0, i._animationLoopCount++, i._animationLoopCount === i._targetedAnimations.length && (i.onAnimationGroupLoopObservable.notifyObservers(i), i._animationLoopCount = 0, i._animationLoopFlags = []));\n            };\n          }, r.prototype.start = function(t, e, n, i, o) {\n            var a = this;\n            if (t === void 0 && (t = !1), e === void 0 && (e = 1), this._isStarted || this._targetedAnimations.length === 0)\n              return this;\n            this._loopAnimation = t, this._animationLoopCount = 0, this._animationLoopFlags = [];\n            for (var s = function() {\n              var P = d._targetedAnimations[p], R = d._scene.beginDirectAnimation(P.target, [P.animation], n !== void 0 ? n : d._from, i !== void 0 ? i : d._to, t, e, void 0, void 0, o !== void 0 ? o : d._isAdditive);\n              R.onAnimationEnd = function() {\n                a.onAnimationEndObservable.notifyObservers(P), a._checkAnimationGroupEnded(R);\n              }, d._processLoop(R, P, p), d._animatables.push(R);\n            }, d = this, p = 0; p < this._targetedAnimations.length; p++)\n              s();\n            if (this._speedRatio = e, n !== void 0 && i !== void 0)\n              if (n < i && this._speedRatio < 0) {\n                var y = i;\n                i = n, n = y;\n              } else\n                n > i && this._speedRatio > 0 && (this._speedRatio = -e);\n            return this._isStarted = !0, this._isPaused = !1, this.onAnimationGroupPlayObservable.notifyObservers(this), this;\n          }, r.prototype.pause = function() {\n            if (!this._isStarted)\n              return this;\n            this._isPaused = !0;\n            for (var t = 0; t < this._animatables.length; t++)\n              this._animatables[t].pause();\n            return this.onAnimationGroupPauseObservable.notifyObservers(this), this;\n          }, r.prototype.play = function(t) {\n            return this.isStarted && this._animatables.length === this._targetedAnimations.length ? (t !== void 0 && (this.loopAnimation = t), this.restart()) : (this.stop(), this.start(t, this._speedRatio)), this._isPaused = !1, this;\n          }, r.prototype.reset = function() {\n            if (!this._isStarted)\n              return this.play(), this.goToFrame(0), this.stop(), this;\n            for (var t = 0; t < this._animatables.length; t++)\n              this._animatables[t].reset();\n            return this;\n          }, r.prototype.restart = function() {\n            if (!this._isStarted)\n              return this;\n            for (var t = 0; t < this._animatables.length; t++)\n              this._animatables[t].restart();\n            return this.onAnimationGroupPlayObservable.notifyObservers(this), this;\n          }, r.prototype.stop = function() {\n            if (!this._isStarted)\n              return this;\n            for (var t = this._animatables.slice(), e = 0; e < t.length; e++)\n              t[e].stop();\n            return this._isStarted = !1, this;\n          }, r.prototype.setWeightForAllAnimatables = function(t) {\n            for (var e = 0; e < this._animatables.length; e++)\n              this._animatables[e].weight = t;\n            return this;\n          }, r.prototype.syncAllAnimationsWith = function(t) {\n            for (var e = 0; e < this._animatables.length; e++)\n              this._animatables[e].syncWith(t);\n            return this;\n          }, r.prototype.goToFrame = function(t) {\n            if (!this._isStarted)\n              return this;\n            for (var e = 0; e < this._animatables.length; e++)\n              this._animatables[e].goToFrame(t);\n            return this;\n          }, r.prototype.dispose = function() {\n            this._targetedAnimations = [], this._animatables = [];\n            var t = this._scene.animationGroups.indexOf(this);\n            t > -1 && this._scene.animationGroups.splice(t, 1), this.onAnimationEndObservable.clear(), this.onAnimationGroupEndObservable.clear(), this.onAnimationGroupPauseObservable.clear(), this.onAnimationGroupPlayObservable.clear(), this.onAnimationLoopObservable.clear(), this.onAnimationGroupLoopObservable.clear();\n          }, r.prototype._checkAnimationGroupEnded = function(t) {\n            var e = this._animatables.indexOf(t);\n            e > -1 && this._animatables.splice(e, 1), this._animatables.length === 0 && (this._isStarted = !1, this.onAnimationGroupEndObservable.notifyObservers(this));\n          }, r.prototype.clone = function(t, e) {\n            for (var n = new r(t || this.name, this._scene), i = 0, o = this._targetedAnimations; i < o.length; i++) {\n              var a = o[i];\n              n.addTargetedAnimation(a.animation.clone(), e ? e(a.target) : a.target);\n            }\n            return n;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.name = this.name, t.from = this.from, t.to = this.to, t.targetedAnimations = [];\n            for (var e = 0; e < this.targetedAnimations.length; e++) {\n              var n = this.targetedAnimations[e];\n              t.targetedAnimations[e] = n.serialize();\n            }\n            return t;\n          }, r.Parse = function(t, e) {\n            for (var n = new r(t.name, e), i = 0; i < t.targetedAnimations.length; i++) {\n              var o = t.targetedAnimations[i], a = k.Parse(o.animation), s = o.targetId;\n              if (o.animation.property === \"influence\") {\n                var d = e.getMorphTargetById(s);\n                d && n.addTargetedAnimation(a, d);\n              } else {\n                var p = e.getNodeByID(s);\n                p != null && n.addTargetedAnimation(a, p);\n              }\n            }\n            return t.from !== null && t.to !== null && n.normalize(t.from, t.to), n;\n          }, r.MakeAnimationAdditive = function(t, e, n, i, o) {\n            e === void 0 && (e = 0), i === void 0 && (i = !1);\n            var a = t;\n            i && (a = t.clone(o || a.name));\n            for (var s = a.targetedAnimations, d = 0; d < s.length; d++) {\n              var p = s[d];\n              k.MakeAnimationAdditive(p.animation, e, n);\n            }\n            return a.isAdditive = !0, a;\n          }, r.prototype.getClassName = function() {\n            return \"AnimationGroup\";\n          }, r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name;\n            return e += \", type: \" + this.getClassName(), t && (e += \", from: \" + this._from, e += \", to: \" + this._to, e += \", isStarted: \" + this._isStarted, e += \", speedRatio: \" + this._speedRatio, e += \", targetedAnimations length: \" + this._targetedAnimations.length, e += \", animatables length: \" + this._animatables), e;\n          }, r;\n        }(), He = function() {\n          this.enableBlending = !1, this.blendingSpeed = 0.01, this.loopMode = k.ANIMATIONLOOPMODE_CYCLE;\n        }, Qe = f(72), Ge = function() {\n          function r() {\n            this._easingMode = r.EASINGMODE_EASEIN;\n          }\n          return r.prototype.setEasingMode = function(t) {\n            var e = Math.min(Math.max(t, 0), 2);\n            this._easingMode = e;\n          }, r.prototype.getEasingMode = function() {\n            return this._easingMode;\n          }, r.prototype.easeInCore = function(t) {\n            throw new Error(\"You must implement this method\");\n          }, r.prototype.ease = function(t) {\n            switch (this._easingMode) {\n              case r.EASINGMODE_EASEIN:\n                return this.easeInCore(t);\n              case r.EASINGMODE_EASEOUT:\n                return 1 - this.easeInCore(1 - t);\n            }\n            return t >= 0.5 ? 0.5 * (1 - this.easeInCore(2 * (1 - t))) + 0.5 : 0.5 * this.easeInCore(2 * t);\n          }, r.EASINGMODE_EASEIN = 0, r.EASINGMODE_EASEOUT = 1, r.EASINGMODE_EASEINOUT = 2, r;\n        }(), tt = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e = Math.max(0, Math.min(1, e)), 1 - Math.sqrt(1 - e * e);\n          }, t;\n        }(Ge), Je = function(r) {\n          function t(e) {\n            e === void 0 && (e = 1);\n            var n = r.call(this) || this;\n            return n.amplitude = e, n;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.amplitude);\n            return Math.pow(e, 3) - e * n * Math.sin(3.141592653589793 * e);\n          }, t;\n        }(Ge), st = function(r) {\n          function t(e, n) {\n            e === void 0 && (e = 3), n === void 0 && (n = 2);\n            var i = r.call(this) || this;\n            return i.bounces = e, i.bounciness = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.bounces), i = this.bounciness;\n            i <= 1 && (i = 1.001);\n            var o = Math.pow(i, n), a = 1 - i, s = (1 - o) / a + 0.5 * o, d = e * s, p = Math.log(-d * (1 - i) + 1) / Math.log(i), y = Math.floor(p), P = y + 1, R = (1 - Math.pow(i, y)) / (a * s), B = 0.5 * (R + (1 - Math.pow(i, P)) / (a * s)), F = e - B, z = B - R;\n            return -Math.pow(1 / i, n - y) / (z * z) * (F - z) * (F + z);\n          }, t;\n        }(Ge), at = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e * e;\n          }, t;\n        }(Ge), pt = function(r) {\n          function t(e, n) {\n            e === void 0 && (e = 3), n === void 0 && (n = 3);\n            var i = r.call(this) || this;\n            return i.oscillations = e, i.springiness = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.oscillations), i = Math.max(0, this.springiness);\n            return (i == 0 ? e : (Math.exp(i * e) - 1) / (Math.exp(i) - 1)) * Math.sin((6.283185307179586 * n + 1.5707963267948966) * e);\n          }, t;\n        }(Ge), Tt = function(r) {\n          function t(e) {\n            e === void 0 && (e = 2);\n            var n = r.call(this) || this;\n            return n.exponent = e, n;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return this.exponent <= 0 ? e : (Math.exp(this.exponent * e) - 1) / (Math.exp(this.exponent) - 1);\n          }, t;\n        }(Ge), Lt = function(r) {\n          function t(e) {\n            e === void 0 && (e = 2);\n            var n = r.call(this) || this;\n            return n.power = e, n;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.power);\n            return Math.pow(e, n);\n          }, t;\n        }(Ge), Ot = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e;\n          }, t;\n        }(Ge), St = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e * e * e;\n          }, t;\n        }(Ge), Ct = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e * e * e * e;\n          }, t;\n        }(Ge), nn = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return 1 - Math.sin(1.5707963267948966 * (1 - e));\n          }, t;\n        }(Ge), Qt = function(r) {\n          function t(e, n, i, o) {\n            e === void 0 && (e = 0), n === void 0 && (n = 0), i === void 0 && (i = 1), o === void 0 && (o = 1);\n            var a = r.call(this) || this;\n            return a.x1 = e, a.y1 = n, a.x2 = i, a.y2 = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return Qe.c.Interpolate(e, this.x1, this.y1, this.x2, this.y2);\n          }, t;\n        }(Ge), $t = function() {\n          function r(t, e, n) {\n            this.frame = t, this.action = e, this.onlyOnce = n, this.isDone = !1;\n          }\n          return r.prototype._clone = function() {\n            return new r(this.frame, this.action, this.onlyOnce);\n          }, r;\n        }(), Ie = f(7), Sn = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t;\n        }(V.a), en = function() {\n          this.rootNodes = [], this.skeletons = [], this.animationGroups = [];\n        }, An = function(r) {\n          function t(e) {\n            var n = r.call(this) || this;\n            return n._wasAddedToScene = !1, n.scene = e, n.sounds = [], n.effectLayers = [], n.layers = [], n.lensFlareSystems = [], n.proceduralTextures = [], n.reflectionProbes = [], e.onDisposeObservable.add(function() {\n              n._wasAddedToScene || n.dispose();\n            }), n;\n          }\n          return Object(c.d)(t, r), t.prototype.instantiateModelsToScene = function(e, n) {\n            var i = this;\n            n === void 0 && (n = !1);\n            var o = {}, a = {}, s = new en(), d = [], p = [], y = { doNotInstantiate: !0 }, P = function(R, B) {\n              if (o[R.uniqueId] = B.uniqueId, a[B.uniqueId] = B, e && (B.name = e(R.name)), B instanceof Ie.a) {\n                var F = B;\n                if (F.morphTargetManager) {\n                  var z = R.morphTargetManager;\n                  F.morphTargetManager = z.clone();\n                  for (var J = 0; J < z.numTargets; J++) {\n                    var ie = z.getTarget(J), se = F.morphTargetManager.getTarget(J);\n                    o[ie.uniqueId] = se.uniqueId, a[se.uniqueId] = se;\n                  }\n                }\n              }\n            };\n            return this.transformNodes.forEach(function(R) {\n              if (!R.parent) {\n                var B = R.instantiateHierarchy(null, y, function(F, z) {\n                  P(F, z);\n                });\n                B && s.rootNodes.push(B);\n              }\n            }), this.meshes.forEach(function(R) {\n              if (!R.parent) {\n                var B = R.instantiateHierarchy(null, y, function(F, z) {\n                  if (P(F, z), z.material) {\n                    var J = z;\n                    if (J.material)\n                      if (n) {\n                        var ie = F.material;\n                        if (p.indexOf(ie) === -1) {\n                          var se = ie.clone(e ? e(ie.name) : \"Clone of \" + ie.name);\n                          if (p.push(ie), o[ie.uniqueId] = se.uniqueId, a[se.uniqueId] = se, ie.getClassName() === \"MultiMaterial\") {\n                            for (var ce = ie, ue = 0, fe = ce.subMaterials; ue < fe.length; ue++) {\n                              var ve = fe[ue];\n                              ve && (se = ve.clone(e ? e(ve.name) : \"Clone of \" + ve.name), p.push(ve), o[ve.uniqueId] = se.uniqueId, a[se.uniqueId] = se);\n                            }\n                            ce.subMaterials = ce.subMaterials.map(function(Te) {\n                              return Te && a[o[Te.uniqueId]];\n                            });\n                          }\n                        }\n                        J.material = a[o[ie.uniqueId]];\n                      } else\n                        J.material.getClassName() === \"MultiMaterial\" ? i.scene.multiMaterials.indexOf(J.material) === -1 && i.scene.addMultiMaterial(J.material) : i.scene.materials.indexOf(J.material) === -1 && i.scene.addMaterial(J.material);\n                  }\n                });\n                B && s.rootNodes.push(B);\n              }\n            }), this.skeletons.forEach(function(R) {\n              var B = R.clone(e ? e(R.name) : \"Clone of \" + R.name);\n              R.overrideMesh && (B.overrideMesh = a[o[R.overrideMesh.uniqueId]]);\n              for (var F = 0, z = i.meshes; F < z.length; F++) {\n                var J = z[F];\n                if (J.skeleton === R && !J.isAnInstance) {\n                  if (a[o[J.uniqueId]].skeleton = B, d.indexOf(B) !== -1)\n                    continue;\n                  d.push(B);\n                  for (var ie = 0, se = B.bones; ie < se.length; ie++) {\n                    var ce = se[ie];\n                    ce._linkedTransformNode && (ce._linkedTransformNode = a[o[ce._linkedTransformNode.uniqueId]]);\n                  }\n                }\n              }\n              s.skeletons.push(B);\n            }), this.animationGroups.forEach(function(R) {\n              var B = R.clone(R.name, function(F) {\n                return a[o[F.uniqueId]] || F;\n              });\n              s.animationGroups.push(B);\n            }), s;\n          }, t.prototype.addAllToScene = function() {\n            var e = this;\n            this._wasAddedToScene = !0, this.cameras.forEach(function(o) {\n              e.scene.addCamera(o);\n            }), this.lights.forEach(function(o) {\n              e.scene.addLight(o);\n            }), this.meshes.forEach(function(o) {\n              e.scene.addMesh(o);\n            }), this.skeletons.forEach(function(o) {\n              e.scene.addSkeleton(o);\n            }), this.animations.forEach(function(o) {\n              e.scene.addAnimation(o);\n            }), this.animationGroups.forEach(function(o) {\n              e.scene.addAnimationGroup(o);\n            }), this.multiMaterials.forEach(function(o) {\n              e.scene.addMultiMaterial(o);\n            }), this.materials.forEach(function(o) {\n              e.scene.addMaterial(o);\n            }), this.morphTargetManagers.forEach(function(o) {\n              e.scene.addMorphTargetManager(o);\n            }), this.geometries.forEach(function(o) {\n              e.scene.addGeometry(o);\n            }), this.transformNodes.forEach(function(o) {\n              e.scene.addTransformNode(o);\n            }), this.actionManagers.forEach(function(o) {\n              e.scene.addActionManager(o);\n            }), this.textures.forEach(function(o) {\n              e.scene.addTexture(o);\n            }), this.reflectionProbes.forEach(function(o) {\n              e.scene.addReflectionProbe(o);\n            }), this.environmentTexture && (this.scene.environmentTexture = this.environmentTexture);\n            for (var n = 0, i = this.scene._serializableComponents; n < i.length; n++)\n              i[n].addFromContainer(this);\n          }, t.prototype.removeAllFromScene = function() {\n            var e = this;\n            this._wasAddedToScene = !1, this.cameras.forEach(function(o) {\n              e.scene.removeCamera(o);\n            }), this.lights.forEach(function(o) {\n              e.scene.removeLight(o);\n            }), this.meshes.forEach(function(o) {\n              e.scene.removeMesh(o);\n            }), this.skeletons.forEach(function(o) {\n              e.scene.removeSkeleton(o);\n            }), this.animations.forEach(function(o) {\n              e.scene.removeAnimation(o);\n            }), this.animationGroups.forEach(function(o) {\n              e.scene.removeAnimationGroup(o);\n            }), this.multiMaterials.forEach(function(o) {\n              e.scene.removeMultiMaterial(o);\n            }), this.materials.forEach(function(o) {\n              e.scene.removeMaterial(o);\n            }), this.morphTargetManagers.forEach(function(o) {\n              e.scene.removeMorphTargetManager(o);\n            }), this.geometries.forEach(function(o) {\n              e.scene.removeGeometry(o);\n            }), this.transformNodes.forEach(function(o) {\n              e.scene.removeTransformNode(o);\n            }), this.actionManagers.forEach(function(o) {\n              e.scene.removeActionManager(o);\n            }), this.textures.forEach(function(o) {\n              e.scene.removeTexture(o);\n            }), this.reflectionProbes.forEach(function(o) {\n              e.scene.removeReflectionProbe(o);\n            }), this.environmentTexture === this.scene.environmentTexture && (this.scene.environmentTexture = null);\n            for (var n = 0, i = this.scene._serializableComponents; n < i.length; n++)\n              i[n].removeFromContainer(this);\n          }, t.prototype.dispose = function() {\n            this.cameras.forEach(function(i) {\n              i.dispose();\n            }), this.cameras = [], this.lights.forEach(function(i) {\n              i.dispose();\n            }), this.lights = [], this.meshes.forEach(function(i) {\n              i.dispose();\n            }), this.meshes = [], this.skeletons.forEach(function(i) {\n              i.dispose();\n            }), this.skeletons = [], this.animationGroups.forEach(function(i) {\n              i.dispose();\n            }), this.animationGroups = [], this.multiMaterials.forEach(function(i) {\n              i.dispose();\n            }), this.multiMaterials = [], this.materials.forEach(function(i) {\n              i.dispose();\n            }), this.materials = [], this.geometries.forEach(function(i) {\n              i.dispose();\n            }), this.geometries = [], this.transformNodes.forEach(function(i) {\n              i.dispose();\n            }), this.transformNodes = [], this.actionManagers.forEach(function(i) {\n              i.dispose();\n            }), this.actionManagers = [], this.textures.forEach(function(i) {\n              i.dispose();\n            }), this.textures = [], this.reflectionProbes.forEach(function(i) {\n              i.dispose();\n            }), this.reflectionProbes = [], this.environmentTexture && (this.environmentTexture.dispose(), this.environmentTexture = null);\n            for (var e = 0, n = this.scene._serializableComponents; e < n.length; e++)\n              n[e].removeFromContainer(this, !0);\n          }, t.prototype._moveAssets = function(e, n, i) {\n            if (e)\n              for (var o = 0, a = e; o < a.length; o++) {\n                var s = a[o], d = !0;\n                if (i) {\n                  for (var p = 0, y = i; p < y.length; p++)\n                    if (s === y[p]) {\n                      d = !1;\n                      break;\n                    }\n                }\n                d && n.push(s);\n              }\n          }, t.prototype.moveAllFromScene = function(e) {\n            for (var n in this._wasAddedToScene = !1, e === void 0 && (e = new Sn()), this)\n              this.hasOwnProperty(n) && (this[n] = this[n] || (n === \"environmentTexture\" ? null : []), this._moveAssets(this.scene[n], this[n], e[n]));\n            this.environmentTexture = this.scene.environmentTexture, this.removeAllFromScene();\n          }, t.prototype.createRootMesh = function() {\n            var e = new Ie.a(\"assetContainerRootMesh\", this.scene);\n            return this.meshes.forEach(function(n) {\n              n.parent || e.addChild(n);\n            }), this.meshes.unshift(e), e;\n          }, t.prototype.mergeAnimationsTo = function(e, n, i) {\n            if (e === void 0 && (e = te.a.LastCreatedScene), i === void 0 && (i = null), !e)\n              return l.a.Error(\"No scene available to merge animations to\"), [];\n            var o = i || function(s) {\n              var d = null, p = s.animations.length ? s.animations[0].targetProperty : \"\", y = s.name.split(\".\").join(\"\").split(\"_primitive\")[0];\n              switch (p) {\n                case \"position\":\n                case \"rotationQuaternion\":\n                  d = e.getTransformNodeByName(s.name) || e.getTransformNodeByName(y);\n                  break;\n                case \"influence\":\n                  d = e.getMorphTargetByName(s.name) || e.getMorphTargetByName(y);\n                  break;\n                default:\n                  d = e.getNodeByName(s.name) || e.getNodeByName(y);\n              }\n              return d;\n            };\n            this.getNodes().forEach(function(s) {\n              var d = o(s);\n              if (d !== null) {\n                for (var p = function(R) {\n                  for (var B = 0, F = d.animations.filter(function(ie) {\n                    return ie.targetProperty === R.targetProperty;\n                  }); B < F.length; B++) {\n                    var z = F[B], J = d.animations.indexOf(z, 0);\n                    J > -1 && d.animations.splice(J, 1);\n                  }\n                }, y = 0, P = s.animations; y < P.length; y++)\n                  p(P[y]);\n                d.animations = d.animations.concat(s.animations);\n              }\n            });\n            var a = new Array();\n            return this.animationGroups.slice().forEach(function(s) {\n              a.push(s.clone(s.name, o)), s.animatables.forEach(function(d) {\n                d.stop();\n              });\n            }), n.forEach(function(s) {\n              var d = o(s.target);\n              d && (e.beginAnimation(d, s.fromFrame, s.toFrame, s.loopAnimation, s.speedRatio, s.onAnimationEnd ? s.onAnimationEnd : void 0, void 0, !0, void 0, s.onAnimationLoop ? s.onAnimationLoop : void 0), e.stopAnimation(s.target));\n            }), a;\n          }, t;\n        }(V.a), Ue = f(13), Pn = function() {\n          function r(t) {\n            this.SMOOTHING = 0.75, this.FFT_SIZE = 512, this.BARGRAPHAMPLITUDE = 256, this.DEBUGCANVASPOS = { x: 20, y: 20 }, this.DEBUGCANVASSIZE = { width: 320, height: 200 }, this._scene = t, this._audioEngine = Ue.a.audioEngine, this._audioEngine.canUseWebAudio && this._audioEngine.audioContext && (this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(), this._webAudioAnalyser.minDecibels = -140, this._webAudioAnalyser.maxDecibels = 0, this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount));\n          }\n          return r.prototype.getFrequencyBinCount = function() {\n            return this._audioEngine.canUseWebAudio ? this._webAudioAnalyser.frequencyBinCount : 0;\n          }, r.prototype.getByteFrequencyData = function() {\n            return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)), this._byteFreqs;\n          }, r.prototype.getByteTimeDomainData = function() {\n            return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)), this._byteTime;\n          }, r.prototype.getFloatFrequencyData = function() {\n            return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)), this._floatFreqs;\n          }, r.prototype.drawDebugCanvas = function() {\n            var t = this;\n            if (this._audioEngine.canUseWebAudio && (this._debugCanvas || (this._debugCanvas = document.createElement(\"canvas\"), this._debugCanvas.width = this.DEBUGCANVASSIZE.width, this._debugCanvas.height = this.DEBUGCANVASSIZE.height, this._debugCanvas.style.position = \"absolute\", this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + \"px\", this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + \"px\", this._debugCanvasContext = this._debugCanvas.getContext(\"2d\"), document.body.appendChild(this._debugCanvas), this._registerFunc = function() {\n              t.drawDebugCanvas();\n            }, this._scene.registerBeforeRender(this._registerFunc)), this._registerFunc && this._debugCanvasContext)) {\n              var e = this.getByteFrequencyData();\n              this._debugCanvasContext.fillStyle = \"rgb(0, 0, 0)\", this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);\n              for (var n = 0; n < this.getFrequencyBinCount(); n++) {\n                var i = e[n] / this.BARGRAPHAMPLITUDE, o = this.DEBUGCANVASSIZE.height * i, a = this.DEBUGCANVASSIZE.height - o - 1, s = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(), d = n / this.getFrequencyBinCount() * 360;\n                this._debugCanvasContext.fillStyle = \"hsl(\" + d + \", 100%, 50%)\", this._debugCanvasContext.fillRect(n * s, a, s, o);\n              }\n            }\n          }, r.prototype.stopDebugCanvas = function() {\n            this._debugCanvas && (this._registerFunc && (this._scene.unregisterBeforeRender(this._registerFunc), this._registerFunc = null), document.body.removeChild(this._debugCanvas), this._debugCanvas = null, this._debugCanvasContext = null);\n          }, r.prototype.connectAudioNodes = function(t, e) {\n            this._audioEngine.canUseWebAudio && (t.connect(this._webAudioAnalyser), this._webAudioAnalyser.connect(e));\n          }, r.prototype.dispose = function() {\n            this._audioEngine.canUseWebAudio && this._webAudioAnalyser.disconnect();\n          }, r;\n        }();\n        Ue.a.AudioEngineFactory = function(r) {\n          return new rr(r);\n        };\n        var rr = function() {\n          function r(t) {\n            var e = this;\n            t === void 0 && (t = null), this._audioContext = null, this._audioContextInitialized = !1, this._muteButton = null, this.canUseWebAudio = !1, this.WarnedWebAudioUnsupported = !1, this.isMP3supported = !1, this.isOGGsupported = !1, this.unlocked = !0, this.useCustomUnlockedButton = !1, this.onAudioUnlockedObservable = new C.c(), this.onAudioLockedObservable = new C.c(), this._tryToRun = !1, this._onResize = function() {\n              e._moveButtonToTopLeft();\n            }, window.AudioContext === void 0 && window.webkitAudioContext === void 0 || (window.AudioContext = window.AudioContext || window.webkitAudioContext, this.canUseWebAudio = !0);\n            var n = document.createElement(\"audio\");\n            this._hostElement = t;\n            try {\n              n && n.canPlayType && (n.canPlayType('audio/mpeg; codecs=\"mp3\"').replace(/^no$/, \"\") || n.canPlayType(\"audio/mp3\").replace(/^no$/, \"\")) && (this.isMP3supported = !0);\n            } catch {\n            }\n            try {\n              n && n.canPlayType && n.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/^no$/, \"\") && (this.isOGGsupported = !0);\n            } catch {\n            }\n          }\n          return Object.defineProperty(r.prototype, \"audioContext\", { get: function() {\n            return this._audioContextInitialized ? this.unlocked || this._muteButton || this._displayMuteButton() : this._initializeAudioContext(), this._audioContext;\n          }, enumerable: !1, configurable: !0 }), r.prototype.lock = function() {\n            this._triggerSuspendedState();\n          }, r.prototype.unlock = function() {\n            this._triggerRunningState();\n          }, r.prototype._resumeAudioContext = function() {\n            var t;\n            return this._audioContext.resume !== void 0 && (t = this._audioContext.resume()), t || Promise.resolve();\n          }, r.prototype._initializeAudioContext = function() {\n            try {\n              this.canUseWebAudio && (this._audioContext = new AudioContext(), this.masterGain = this._audioContext.createGain(), this.masterGain.gain.value = 1, this.masterGain.connect(this._audioContext.destination), this._audioContextInitialized = !0, this._audioContext.state === \"running\" && this._triggerRunningState());\n            } catch (t) {\n              this.canUseWebAudio = !1, l.a.Error(\"Web Audio: \" + t.message);\n            }\n          }, r.prototype._triggerRunningState = function() {\n            var t = this;\n            this._tryToRun || (this._tryToRun = !0, this._resumeAudioContext().then(function() {\n              t._tryToRun = !1, t._muteButton && t._hideMuteButton(), t.unlocked = !0, t.onAudioUnlockedObservable.notifyObservers(t);\n            }).catch(function() {\n              t._tryToRun = !1, t.unlocked = !1;\n            }));\n          }, r.prototype._triggerSuspendedState = function() {\n            this.unlocked = !1, this.onAudioLockedObservable.notifyObservers(this), this._displayMuteButton();\n          }, r.prototype._displayMuteButton = function() {\n            var t = this;\n            if (!this.useCustomUnlockedButton && !this._muteButton) {\n              this._muteButton = document.createElement(\"BUTTON\"), this._muteButton.className = \"babylonUnmuteIcon\", this._muteButton.id = \"babylonUnmuteIconBtn\", this._muteButton.title = \"Unmute\";\n              var e = \".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(\" + (window.SVGSVGElement ? \"data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E\" : \"https://cdn.babylonjs.com/Assets/audio.png\") + \");  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }\", n = document.createElement(\"style\");\n              n.appendChild(document.createTextNode(e)), document.getElementsByTagName(\"head\")[0].appendChild(n), document.body.appendChild(this._muteButton), this._moveButtonToTopLeft(), this._muteButton.addEventListener(\"touchend\", function() {\n                t._triggerRunningState();\n              }, !0), this._muteButton.addEventListener(\"click\", function() {\n                t._triggerRunningState();\n              }, !0), window.addEventListener(\"resize\", this._onResize);\n            }\n          }, r.prototype._moveButtonToTopLeft = function() {\n            this._hostElement && this._muteButton && (this._muteButton.style.top = this._hostElement.offsetTop + 20 + \"px\", this._muteButton.style.left = this._hostElement.offsetLeft + 20 + \"px\");\n          }, r.prototype._hideMuteButton = function() {\n            this._muteButton && (document.body.removeChild(this._muteButton), this._muteButton = null);\n          }, r.prototype.dispose = function() {\n            this.canUseWebAudio && this._audioContextInitialized && (this._connectedAnalyser && this._audioContext && (this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser.dispose(), this.masterGain.disconnect(), this.masterGain.connect(this._audioContext.destination), this._connectedAnalyser = null), this.masterGain.gain.value = 1), this.WarnedWebAudioUnsupported = !1, this._hideMuteButton(), window.removeEventListener(\"resize\", this._onResize), this.onAudioUnlockedObservable.clear(), this.onAudioLockedObservable.clear();\n          }, r.prototype.getGlobalVolume = function() {\n            return this.canUseWebAudio && this._audioContextInitialized ? this.masterGain.gain.value : -1;\n          }, r.prototype.setGlobalVolume = function(t) {\n            this.canUseWebAudio && this._audioContextInitialized && (this.masterGain.gain.value = t);\n          }, r.prototype.connectToAnalyser = function(t) {\n            this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this.canUseWebAudio && this._audioContextInitialized && this._audioContext && (this._connectedAnalyser = t, this.masterGain.disconnect(), this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination));\n          }, r;\n        }(), Xe = f(12), En = f(21), Qn = function() {\n          function r(t, e, n, i, o) {\n            var a, s, d, p, y = this;\n            if (i === void 0 && (i = null), this.autoplay = !1, this.loop = !1, this.useCustomAttenuation = !1, this.isPlaying = !1, this.isPaused = !1, this.spatialSound = !1, this.refDistance = 1, this.rolloffFactor = 1, this.maxDistance = 100, this.distanceModel = \"linear\", this.metadata = null, this.onEndedObservable = new C.c(), this._panningModel = \"equalpower\", this._playbackRate = 1, this._streaming = !1, this._startTime = 0, this._startOffset = 0, this._position = u.e.Zero(), this._positionInEmitterSpace = !1, this._localDirection = new u.e(1, 0, 0), this._volume = 1, this._isReadyToPlay = !1, this._isDirectional = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._coneOuterGain = 0, this._isOutputConnected = !1, this._urlType = \"Unknown\", this.name = t, this._scene = n, r._SceneComponentInitialization(n), this._readyToPlayCallback = i, this._customAttenuationFunction = function(J, ie, se, ce, ue) {\n              return ie < se ? J * (1 - ie / se) : 0;\n            }, o && (this.autoplay = o.autoplay || !1, this.loop = o.loop || !1, o.volume !== void 0 && (this._volume = o.volume), this.spatialSound = (a = o.spatialSound) !== null && a !== void 0 && a, this.maxDistance = (s = o.maxDistance) !== null && s !== void 0 ? s : 100, this.useCustomAttenuation = (d = o.useCustomAttenuation) !== null && d !== void 0 && d, this.rolloffFactor = o.rolloffFactor || 1, this.refDistance = o.refDistance || 1, this.distanceModel = o.distanceModel || \"linear\", this._playbackRate = o.playbackRate || 1, this._streaming = (p = o.streaming) !== null && p !== void 0 && p, this._length = o.length, this._offset = o.offset), Ue.a.audioEngine.canUseWebAudio && Ue.a.audioEngine.audioContext) {\n              this._soundGain = Ue.a.audioEngine.audioContext.createGain(), this._soundGain.gain.value = this._volume, this._inputAudioNode = this._soundGain, this._outputAudioNode = this._soundGain, this.spatialSound && this._createSpatialParameters(), this._scene.mainSoundTrack.addSound(this);\n              var P = !0;\n              if (e)\n                try {\n                  typeof e == \"string\" ? this._urlType = \"String\" : e instanceof ArrayBuffer ? this._urlType = \"ArrayBuffer\" : e instanceof MediaStream ? this._urlType = \"MediaStream\" : Array.isArray(e) && (this._urlType = \"Array\");\n                  var R = [], B = !1;\n                  switch (this._urlType) {\n                    case \"MediaStream\":\n                      this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = Ue.a.audioEngine.audioContext.createMediaStreamSource(e), this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();\n                      break;\n                    case \"ArrayBuffer\":\n                      e.byteLength > 0 && (B = !0, this._soundLoaded(e));\n                      break;\n                    case \"String\":\n                      R.push(e);\n                    case \"Array\":\n                      R.length === 0 && (R = e);\n                      for (var F = 0; F < R.length; F++) {\n                        var z = R[F];\n                        if (B = o && o.skipCodecCheck || z.indexOf(\".mp3\", z.length - 4) !== -1 && Ue.a.audioEngine.isMP3supported || z.indexOf(\".ogg\", z.length - 4) !== -1 && Ue.a.audioEngine.isOGGsupported || z.indexOf(\".wav\", z.length - 4) !== -1 || z.indexOf(\".m4a\", z.length - 4) !== -1 || z.indexOf(\"blob:\") !== -1) {\n                          this._streaming ? (this._htmlAudioElement = new Audio(z), this._htmlAudioElement.controls = !1, this._htmlAudioElement.loop = this.loop, Xe.b.SetCorsBehavior(z, this._htmlAudioElement), this._htmlAudioElement.preload = \"auto\", this._htmlAudioElement.addEventListener(\"canplaythrough\", function() {\n                            y._isReadyToPlay = !0, y.autoplay && y.play(0, y._offset, y._length), y._readyToPlayCallback && y._readyToPlayCallback();\n                          }), document.body.appendChild(this._htmlAudioElement), this._htmlAudioElement.load()) : this._scene._loadFile(z, function(J) {\n                            y._soundLoaded(J);\n                          }, void 0, !0, !0, function(J) {\n                            J && l.a.Error(\"XHR \" + J.status + \" error on: \" + z + \".\"), l.a.Error(\"Sound creation aborted.\"), y._scene.mainSoundTrack.removeSound(y);\n                          });\n                          break;\n                        }\n                      }\n                      break;\n                    default:\n                      P = !1;\n                  }\n                  P ? B || (this._isReadyToPlay = !0, this._readyToPlayCallback && window.setTimeout(function() {\n                    y._readyToPlayCallback && y._readyToPlayCallback();\n                  }, 1e3)) : l.a.Error(\"Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.\");\n                } catch {\n                  l.a.Error(\"Unexpected error. Sound creation aborted.\"), this._scene.mainSoundTrack.removeSound(this);\n                }\n            } else\n              this._scene.mainSoundTrack.addSound(this), Ue.a.audioEngine.WarnedWebAudioUnsupported || (l.a.Error(\"Web Audio is not supported by your browser.\"), Ue.a.audioEngine.WarnedWebAudioUnsupported = !0), this._readyToPlayCallback && window.setTimeout(function() {\n                y._readyToPlayCallback && y._readyToPlayCallback();\n              }, 1e3);\n          }\n          return Object.defineProperty(r.prototype, \"currentTime\", { get: function() {\n            if (this._htmlAudioElement)\n              return this._htmlAudioElement.currentTime;\n            var t = this._startOffset;\n            return this.isPlaying && Ue.a.audioEngine.audioContext && (t += Ue.a.audioEngine.audioContext.currentTime - this._startTime), t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            Ue.a.audioEngine.canUseWebAudio && (this.isPlaying && this.stop(), this._isReadyToPlay = !1, this.soundTrackId === -1 ? this._scene.mainSoundTrack.removeSound(this) : this._scene.soundTracks && this._scene.soundTracks[this.soundTrackId].removeSound(this), this._soundGain && (this._soundGain.disconnect(), this._soundGain = null), this._soundPanner && (this._soundPanner.disconnect(), this._soundPanner = null), this._soundSource && (this._soundSource.disconnect(), this._soundSource = null), this._audioBuffer = null, this._htmlAudioElement && (this._htmlAudioElement.pause(), this._htmlAudioElement.src = \"\", document.body.removeChild(this._htmlAudioElement)), this._streamingSource && this._streamingSource.disconnect(), this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._connectedTransformNode = null));\n          }, r.prototype.isReady = function() {\n            return this._isReadyToPlay;\n          }, r.prototype._soundLoaded = function(t) {\n            var e = this;\n            Ue.a.audioEngine.audioContext && Ue.a.audioEngine.audioContext.decodeAudioData(t, function(n) {\n              e._audioBuffer = n, e._isReadyToPlay = !0, e.autoplay && e.play(0, e._offset, e._length), e._readyToPlayCallback && e._readyToPlayCallback();\n            }, function(n) {\n              l.a.Error(\"Error while decoding audio data for: \" + e.name + \" / Error: \" + n);\n            });\n          }, r.prototype.setAudioBuffer = function(t) {\n            Ue.a.audioEngine.canUseWebAudio && (this._audioBuffer = t, this._isReadyToPlay = !0);\n          }, r.prototype.updateOptions = function(t) {\n            var e, n, i, o, a, s, d, p, y;\n            t && (this.loop = (e = t.loop) !== null && e !== void 0 ? e : this.loop, this.maxDistance = (n = t.maxDistance) !== null && n !== void 0 ? n : this.maxDistance, this.useCustomAttenuation = (i = t.useCustomAttenuation) !== null && i !== void 0 ? i : this.useCustomAttenuation, this.rolloffFactor = (o = t.rolloffFactor) !== null && o !== void 0 ? o : this.rolloffFactor, this.refDistance = (a = t.refDistance) !== null && a !== void 0 ? a : this.refDistance, this.distanceModel = (s = t.distanceModel) !== null && s !== void 0 ? s : this.distanceModel, this._playbackRate = (d = t.playbackRate) !== null && d !== void 0 ? d : this._playbackRate, this._length = (p = t.length) !== null && p !== void 0 ? p : void 0, this._offset = (y = t.offset) !== null && y !== void 0 ? y : void 0, this._updateSpatialParameters(), this.isPlaying && (this._streaming && this._htmlAudioElement ? (this._htmlAudioElement.playbackRate = this._playbackRate, this._htmlAudioElement.loop !== this.loop && (this._htmlAudioElement.loop = this.loop)) : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.loop !== this.loop && (this._soundSource.loop = this.loop), this._offset !== void 0 && this._soundSource.loopStart !== this._offset && (this._soundSource.loopStart = this._offset), this._length !== void 0 && this._length !== this._soundSource.loopEnd && (this._soundSource.loopEnd = (0 | this._offset) + this._length))));\n          }, r.prototype._createSpatialParameters = function() {\n            Ue.a.audioEngine.canUseWebAudio && Ue.a.audioEngine.audioContext && (this._scene.headphone && (this._panningModel = \"HRTF\"), this._soundPanner = Ue.a.audioEngine.audioContext.createPanner(), this._soundPanner && this._outputAudioNode && (this._updateSpatialParameters(), this._soundPanner.connect(this._outputAudioNode), this._inputAudioNode = this._soundPanner));\n          }, r.prototype._updateSpatialParameters = function() {\n            this.spatialSound && this._soundPanner && (this.useCustomAttenuation ? (this._soundPanner.distanceModel = \"linear\", this._soundPanner.maxDistance = Number.MAX_VALUE, this._soundPanner.refDistance = 1, this._soundPanner.rolloffFactor = 1, this._soundPanner.panningModel = this._panningModel) : (this._soundPanner.distanceModel = this.distanceModel, this._soundPanner.maxDistance = this.maxDistance, this._soundPanner.refDistance = this.refDistance, this._soundPanner.rolloffFactor = this.rolloffFactor, this._soundPanner.panningModel = this._panningModel));\n          }, r.prototype.switchPanningModelToHRTF = function() {\n            this._panningModel = \"HRTF\", this._switchPanningModel();\n          }, r.prototype.switchPanningModelToEqualPower = function() {\n            this._panningModel = \"equalpower\", this._switchPanningModel();\n          }, r.prototype._switchPanningModel = function() {\n            Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.panningModel = this._panningModel);\n          }, r.prototype.connectToSoundTrackAudioNode = function(t) {\n            Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && (this._isOutputConnected && this._outputAudioNode.disconnect(), this._outputAudioNode.connect(t), this._isOutputConnected = !0);\n          }, r.prototype.setDirectionalCone = function(t, e, n) {\n            e < t ? l.a.Error(\"setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.\") : (this._coneInnerAngle = t, this._coneOuterAngle = e, this._coneOuterGain = n, this._isDirectional = !0, this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length)));\n          }, Object.defineProperty(r.prototype, \"directionalConeInnerAngle\", { get: function() {\n            return this._coneInnerAngle;\n          }, set: function(t) {\n            if (t != this._coneInnerAngle) {\n              if (this._coneOuterAngle < t)\n                return void l.a.Error(\"directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneInnerAngle = t, Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.coneInnerAngle = this._coneInnerAngle);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"directionalConeOuterAngle\", { get: function() {\n            return this._coneOuterAngle;\n          }, set: function(t) {\n            if (t != this._coneOuterAngle) {\n              if (t < this._coneInnerAngle)\n                return void l.a.Error(\"directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneOuterAngle = t, Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.coneOuterAngle = this._coneOuterAngle);\n            }\n          }, enumerable: !1, configurable: !0 }), r.prototype.setPosition = function(t) {\n            this._position = t, Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && !isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z);\n          }, r.prototype.setLocalDirectionToMesh = function(t) {\n            this._localDirection = t, Ue.a.audioEngine.canUseWebAudio && this._connectedTransformNode && this.isPlaying && this._updateDirection();\n          }, r.prototype._updateDirection = function() {\n            if (this._connectedTransformNode && this._soundPanner) {\n              var t = this._connectedTransformNode.getWorldMatrix(), e = u.e.TransformNormal(this._localDirection, t);\n              e.normalize(), this._soundPanner.setOrientation(e.x, e.y, e.z);\n            }\n          }, r.prototype.updateDistanceFromListener = function() {\n            if (Ue.a.audioEngine.canUseWebAudio && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {\n              var t = this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);\n              this._soundGain.gain.value = this._customAttenuationFunction(this._volume, t, this.maxDistance, this.refDistance, this.rolloffFactor);\n            }\n          }, r.prototype.setAttenuationFunction = function(t) {\n            this._customAttenuationFunction = t;\n          }, r.prototype.play = function(t, e, n) {\n            var i = this;\n            if (this._isReadyToPlay && this._scene.audioEnabled && Ue.a.audioEngine.audioContext)\n              try {\n                this._startOffset < 0 && (t = -this._startOffset, this._startOffset = 0);\n                var o = t ? Ue.a.audioEngine.audioContext.currentTime + t : Ue.a.audioEngine.audioContext.currentTime;\n                if (this._soundSource && this._streamingSource || this.spatialSound && this._soundPanner && (isNaN(this._position.x) || isNaN(this._position.y) || isNaN(this._position.z) || this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z), this._isDirectional && (this._soundPanner.coneInnerAngle = this._coneInnerAngle, this._soundPanner.coneOuterAngle = this._coneOuterAngle, this._soundPanner.coneOuterGain = this._coneOuterGain, this._connectedTransformNode ? this._updateDirection() : this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z))), this._streaming)\n                  this._streamingSource || (this._streamingSource = Ue.a.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement), this._htmlAudioElement.onended = function() {\n                    i._onended();\n                  }, this._htmlAudioElement.playbackRate = this._playbackRate), this._streamingSource.disconnect(), this._inputAudioNode && this._streamingSource.connect(this._inputAudioNode), this._htmlAudioElement && (a = function() {\n                    if (Ue.a.audioEngine.unlocked) {\n                      var s = i._htmlAudioElement.play();\n                      s !== void 0 && s.catch(function(d) {\n                        Ue.a.audioEngine.lock(), (i.loop || i.autoplay) && Ue.a.audioEngine.onAudioUnlockedObservable.addOnce(function() {\n                          a();\n                        });\n                      });\n                    } else\n                      (i.loop || i.autoplay) && Ue.a.audioEngine.onAudioUnlockedObservable.addOnce(function() {\n                        a();\n                      });\n                  })();\n                else {\n                  var a = function() {\n                    if (Ue.a.audioEngine.audioContext) {\n                      if (n = n || i._length, e = e || i._offset, i._soundSource) {\n                        var s = i._soundSource;\n                        s.onended = function() {\n                          s.disconnect();\n                        };\n                      }\n                      if (i._soundSource = Ue.a.audioEngine.audioContext.createBufferSource(), i._soundSource && i._inputAudioNode) {\n                        i._soundSource.buffer = i._audioBuffer, i._soundSource.connect(i._inputAudioNode), i._soundSource.loop = i.loop, e !== void 0 && (i._soundSource.loopStart = e), n !== void 0 && (i._soundSource.loopEnd = (0 | e) + n), i._soundSource.playbackRate.value = i._playbackRate, i._soundSource.onended = function() {\n                          i._onended();\n                        }, o = t ? Ue.a.audioEngine.audioContext.currentTime + t : Ue.a.audioEngine.audioContext.currentTime;\n                        var d = i.isPaused ? i._startOffset % i._soundSource.buffer.duration : e || 0;\n                        i._soundSource.start(o, d, i.loop ? void 0 : n);\n                      }\n                    }\n                  };\n                  Ue.a.audioEngine.audioContext.state === \"suspended\" ? setTimeout(function() {\n                    Ue.a.audioEngine.audioContext.state === \"suspended\" ? (Ue.a.audioEngine.lock(), (i.loop || i.autoplay) && Ue.a.audioEngine.onAudioUnlockedObservable.addOnce(function() {\n                      a();\n                    })) : a();\n                  }, 500) : a();\n                }\n                this._startTime = o, this.isPlaying = !0, this.isPaused = !1;\n              } catch (s) {\n                l.a.Error(\"Error while trying to play audio: \" + this.name + \", \" + s.message);\n              }\n          }, r.prototype._onended = function() {\n            this.isPlaying = !1, this._startOffset = 0, this.onended && this.onended(), this.onEndedObservable.notifyObservers(this);\n          }, r.prototype.stop = function(t) {\n            var e = this;\n            if (this.isPlaying) {\n              if (this._streaming)\n                this._htmlAudioElement ? (this._htmlAudioElement.pause(), this._htmlAudioElement.currentTime > 0 && (this._htmlAudioElement.currentTime = 0)) : this._streamingSource.disconnect(), this.isPlaying = !1;\n              else if (Ue.a.audioEngine.audioContext && this._soundSource) {\n                var n = t ? Ue.a.audioEngine.audioContext.currentTime + t : Ue.a.audioEngine.audioContext.currentTime;\n                this._soundSource.stop(n), this._soundSource.onended = function() {\n                  e.isPlaying = !1;\n                }, this.isPaused || (this._startOffset = 0);\n              }\n            }\n          }, r.prototype.pause = function() {\n            this.isPlaying && (this.isPaused = !0, this._streaming ? this._htmlAudioElement ? this._htmlAudioElement.pause() : this._streamingSource.disconnect() : Ue.a.audioEngine.audioContext && (this.stop(0), this._startOffset += Ue.a.audioEngine.audioContext.currentTime - this._startTime));\n          }, r.prototype.setVolume = function(t, e) {\n            Ue.a.audioEngine.canUseWebAudio && this._soundGain && (e && Ue.a.audioEngine.audioContext ? (this._soundGain.gain.cancelScheduledValues(Ue.a.audioEngine.audioContext.currentTime), this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, Ue.a.audioEngine.audioContext.currentTime), this._soundGain.gain.linearRampToValueAtTime(t, Ue.a.audioEngine.audioContext.currentTime + e)) : this._soundGain.gain.value = t), this._volume = t;\n          }, r.prototype.setPlaybackRate = function(t) {\n            this._playbackRate = t, this.isPlaying && (this._streaming && this._htmlAudioElement ? this._htmlAudioElement.playbackRate = this._playbackRate : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate));\n          }, r.prototype.getVolume = function() {\n            return this._volume;\n          }, r.prototype.attachToMesh = function(t) {\n            var e = this;\n            this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null), this._connectedTransformNode = t, this.spatialSound || (this.spatialSound = !0, this._createSpatialParameters(), this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length))), this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode), this._registerFunc = function(n) {\n              return e._onRegisterAfterWorldMatrixUpdate(n);\n            }, this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc);\n          }, r.prototype.detachFromMesh = function() {\n            this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null, this._connectedTransformNode = null);\n          }, r.prototype._onRegisterAfterWorldMatrixUpdate = function(t) {\n            if (this._positionInEmitterSpace)\n              t.worldMatrixFromCache.invertToRef(u.c.Matrix[0]), this.setPosition(u.c.Matrix[0].getTranslation());\n            else if (t.getBoundingInfo) {\n              var e = t.getBoundingInfo();\n              this.setPosition(e.boundingSphere.centerWorld);\n            } else\n              this.setPosition(t.absolutePosition);\n            Ue.a.audioEngine.canUseWebAudio && this._isDirectional && this.isPlaying && this._updateDirection();\n          }, r.prototype.clone = function() {\n            var t = this;\n            if (this._streaming)\n              return null;\n            var e = function() {\n              t._isReadyToPlay ? (i._audioBuffer = t.getAudioBuffer(), i._isReadyToPlay = !0, i.autoplay && i.play(0, t._offset, t._length)) : window.setTimeout(e, 300);\n            }, n = { autoplay: this.autoplay, loop: this.loop, volume: this._volume, spatialSound: this.spatialSound, maxDistance: this.maxDistance, useCustomAttenuation: this.useCustomAttenuation, rolloffFactor: this.rolloffFactor, refDistance: this.refDistance, distanceModel: this.distanceModel }, i = new r(this.name + \"_cloned\", new ArrayBuffer(0), this._scene, null, n);\n            return this.useCustomAttenuation && i.setAttenuationFunction(this._customAttenuationFunction), i.setPosition(this._position), i.setPlaybackRate(this._playbackRate), e(), i;\n          }, r.prototype.getAudioBuffer = function() {\n            return this._audioBuffer;\n          }, r.prototype.getSoundSource = function() {\n            return this._soundSource;\n          }, r.prototype.getSoundGain = function() {\n            return this._soundGain;\n          }, r.prototype.serialize = function() {\n            var t = { name: this.name, url: this.name, autoplay: this.autoplay, loop: this.loop, volume: this._volume, spatialSound: this.spatialSound, maxDistance: this.maxDistance, rolloffFactor: this.rolloffFactor, refDistance: this.refDistance, distanceModel: this.distanceModel, playbackRate: this._playbackRate, panningModel: this._panningModel, soundTrackId: this.soundTrackId, metadata: this.metadata };\n            return this.spatialSound && (this._connectedTransformNode && (t.connectedMeshId = this._connectedTransformNode.id), t.position = this._position.asArray(), t.refDistance = this.refDistance, t.distanceModel = this.distanceModel, t.isDirectional = this._isDirectional, t.localDirectionToMesh = this._localDirection.asArray(), t.coneInnerAngle = this._coneInnerAngle, t.coneOuterAngle = this._coneOuterAngle, t.coneOuterGain = this._coneOuterGain), t;\n          }, r.Parse = function(t, e, n, i) {\n            var o, a = t.name;\n            o = t.url ? n + t.url : n + a;\n            var s, d = { autoplay: t.autoplay, loop: t.loop, volume: t.volume, spatialSound: t.spatialSound, maxDistance: t.maxDistance, rolloffFactor: t.rolloffFactor, refDistance: t.refDistance, distanceModel: t.distanceModel, playbackRate: t.playbackRate };\n            if (i) {\n              var p = function() {\n                i._isReadyToPlay ? (s._audioBuffer = i.getAudioBuffer(), s._isReadyToPlay = !0, s.autoplay && s.play(0, s._offset, s._length)) : window.setTimeout(p, 300);\n              };\n              s = new r(a, new ArrayBuffer(0), e, null, d), p();\n            } else\n              s = new r(a, o, e, function() {\n                e._removePendingData(s);\n              }, d), e._addPendingData(s);\n            if (t.position) {\n              var y = u.e.FromArray(t.position);\n              s.setPosition(y);\n            }\n            if (t.isDirectional && (s.setDirectionalCone(t.coneInnerAngle || 360, t.coneOuterAngle || 360, t.coneOuterGain || 0), t.localDirectionToMesh)) {\n              var P = u.e.FromArray(t.localDirectionToMesh);\n              s.setLocalDirectionToMesh(P);\n            }\n            if (t.connectedMeshId) {\n              var R = e.getMeshByID(t.connectedMeshId);\n              R && s.attachToMesh(R);\n            }\n            return t.metadata && (s.metadata = t.metadata), s;\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"AudioSceneComponent\");\n          }, r;\n        }(), So = function() {\n          function r(t, e) {\n            e === void 0 && (e = {}), this.id = -1, this._isInitialized = !1, this._scene = t, this.soundCollection = new Array(), this._options = e, !this._options.mainTrack && this._scene.soundTracks && (this._scene.soundTracks.push(this), this.id = this._scene.soundTracks.length - 1);\n          }\n          return r.prototype._initializeSoundTrackAudioGraph = function() {\n            Ue.a.audioEngine.canUseWebAudio && Ue.a.audioEngine.audioContext && (this._outputAudioNode = Ue.a.audioEngine.audioContext.createGain(), this._outputAudioNode.connect(Ue.a.audioEngine.masterGain), this._options && this._options.volume && (this._outputAudioNode.gain.value = this._options.volume), this._isInitialized = !0);\n          }, r.prototype.dispose = function() {\n            if (Ue.a.audioEngine && Ue.a.audioEngine.canUseWebAudio) {\n              for (this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(); this.soundCollection.length; )\n                this.soundCollection[0].dispose();\n              this._outputAudioNode && this._outputAudioNode.disconnect(), this._outputAudioNode = null;\n            }\n          }, r.prototype.addSound = function(t) {\n            this._isInitialized || this._initializeSoundTrackAudioGraph(), Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && t.connectToSoundTrackAudioNode(this._outputAudioNode), t.soundTrackId && (t.soundTrackId === -1 ? this._scene.mainSoundTrack.removeSound(t) : this._scene.soundTracks && this._scene.soundTracks[t.soundTrackId].removeSound(t)), this.soundCollection.push(t), t.soundTrackId = this.id;\n          }, r.prototype.removeSound = function(t) {\n            var e = this.soundCollection.indexOf(t);\n            e !== -1 && this.soundCollection.splice(e, 1);\n          }, r.prototype.setVolume = function(t) {\n            Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.gain.value = t);\n          }, r.prototype.switchPanningModelToHRTF = function() {\n            if (Ue.a.audioEngine.canUseWebAudio)\n              for (var t = 0; t < this.soundCollection.length; t++)\n                this.soundCollection[t].switchPanningModelToHRTF();\n          }, r.prototype.switchPanningModelToEqualPower = function() {\n            if (Ue.a.audioEngine.canUseWebAudio)\n              for (var t = 0; t < this.soundCollection.length; t++)\n                this.soundCollection[t].switchPanningModelToEqualPower();\n          }, r.prototype.connectToAnalyser = function(t) {\n            this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser = t, Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.disconnect(), this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, Ue.a.audioEngine.masterGain));\n          }, r;\n        }(), ot = f(17);\n        V.a.AddParser(ot.a.NAME_AUDIO, function(r, t, e, n) {\n          var i, o = [];\n          if (e.sounds = e.sounds || [], r.sounds !== void 0 && r.sounds !== null)\n            for (var a = 0, s = r.sounds.length; a < s; a++) {\n              var d = r.sounds[a];\n              Ue.a.audioEngine.canUseWebAudio ? (d.url || (d.url = d.name), o[d.url] ? e.sounds.push(Qn.Parse(d, t, n, o[d.url])) : (i = Qn.Parse(d, t, n), o[d.url] = i, e.sounds.push(i))) : e.sounds.push(new Qn(d.name, null, t));\n            }\n          o = [];\n        }), Object.defineProperty(_e.a.prototype, \"mainSoundTrack\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), this._mainSoundTrack || (this._mainSoundTrack = new So(this, { mainTrack: !0 })), this._mainSoundTrack;\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.getSoundByName = function(r) {\n          var t;\n          for (t = 0; t < this.mainSoundTrack.soundCollection.length; t++)\n            if (this.mainSoundTrack.soundCollection[t].name === r)\n              return this.mainSoundTrack.soundCollection[t];\n          if (this.soundTracks) {\n            for (var e = 0; e < this.soundTracks.length; e++)\n              for (t = 0; t < this.soundTracks[e].soundCollection.length; t++)\n                if (this.soundTracks[e].soundCollection[t].name === r)\n                  return this.soundTracks[e].soundCollection[t];\n          }\n          return null;\n        }, Object.defineProperty(_e.a.prototype, \"audioEnabled\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.audioEnabled;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(this), this._addComponent(t)), r ? t.enableAudio() : t.disableAudio();\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(_e.a.prototype, \"headphone\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.headphone;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(this), this._addComponent(t)), r ? t.switchAudioModeForHeadphones() : t.switchAudioModeForNormalSpeakers();\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(_e.a.prototype, \"audioListenerPositionProvider\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.audioListenerPositionProvider;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          if (t || (t = new qn(this), this._addComponent(t)), typeof r != \"function\")\n            throw new Error(\"The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3\");\n          t.audioListenerPositionProvider = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(_e.a.prototype, \"audioPositioningRefreshRate\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.audioPositioningRefreshRate;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(this), this._addComponent(t)), t.audioPositioningRefreshRate = r;\n        }, enumerable: !0, configurable: !0 });\n        var qn = function() {\n          function r(t) {\n            this.name = ot.a.NAME_AUDIO, this._audioEnabled = !0, this._headphone = !1, this.audioPositioningRefreshRate = 500, this._audioListenerPositionProvider = null, this._cachedCameraDirection = new u.e(), this._cachedCameraPosition = new u.e(), this._lastCheck = 0, this.scene = t, t.soundTracks = new Array(), t.sounds = new Array();\n          }\n          return Object.defineProperty(r.prototype, \"audioEnabled\", { get: function() {\n            return this._audioEnabled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"headphone\", { get: function() {\n            return this._headphone;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"audioListenerPositionProvider\", { get: function() {\n            return this._audioListenerPositionProvider;\n          }, set: function(t) {\n            this._audioListenerPositionProvider = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.register = function() {\n            this.scene._afterRenderStage.registerStep(ot.a.STEP_AFTERRENDER_AUDIO, this, this._afterRender);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.serialize = function(t) {\n            if (t.sounds = [], this.scene.soundTracks)\n              for (var e = 0; e < this.scene.soundTracks.length; e++)\n                for (var n = this.scene.soundTracks[e], i = 0; i < n.soundCollection.length; i++)\n                  t.sounds.push(n.soundCollection[i].serialize());\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.sounds && t.sounds.forEach(function(n) {\n              n.play(), n.autoplay = !0, e.scene.mainSoundTrack.addSound(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            e === void 0 && (e = !1), t.sounds && t.sounds.forEach(function(i) {\n              i.stop(), i.autoplay = !1, n.scene.mainSoundTrack.removeSound(i), e && i.dispose();\n            });\n          }, r.prototype.dispose = function() {\n            var t = this.scene;\n            if (t._mainSoundTrack && t.mainSoundTrack.dispose(), t.soundTracks)\n              for (var e = 0; e < t.soundTracks.length; e++)\n                t.soundTracks[e].dispose();\n          }, r.prototype.disableAudio = function() {\n            var t, e = this.scene;\n            for (this._audioEnabled = !1, Ue.a.audioEngine && Ue.a.audioEngine.audioContext && Ue.a.audioEngine.audioContext.suspend(), t = 0; t < e.mainSoundTrack.soundCollection.length; t++)\n              e.mainSoundTrack.soundCollection[t].pause();\n            if (e.soundTracks)\n              for (t = 0; t < e.soundTracks.length; t++)\n                for (var n = 0; n < e.soundTracks[t].soundCollection.length; n++)\n                  e.soundTracks[t].soundCollection[n].pause();\n          }, r.prototype.enableAudio = function() {\n            var t, e = this.scene;\n            for (this._audioEnabled = !0, Ue.a.audioEngine && Ue.a.audioEngine.audioContext && Ue.a.audioEngine.audioContext.resume(), t = 0; t < e.mainSoundTrack.soundCollection.length; t++)\n              e.mainSoundTrack.soundCollection[t].isPaused && e.mainSoundTrack.soundCollection[t].play();\n            if (e.soundTracks)\n              for (t = 0; t < e.soundTracks.length; t++)\n                for (var n = 0; n < e.soundTracks[t].soundCollection.length; n++)\n                  e.soundTracks[t].soundCollection[n].isPaused && e.soundTracks[t].soundCollection[n].play();\n          }, r.prototype.switchAudioModeForHeadphones = function() {\n            var t = this.scene;\n            if (this._headphone = !0, t.mainSoundTrack.switchPanningModelToHRTF(), t.soundTracks)\n              for (var e = 0; e < t.soundTracks.length; e++)\n                t.soundTracks[e].switchPanningModelToHRTF();\n          }, r.prototype.switchAudioModeForNormalSpeakers = function() {\n            var t = this.scene;\n            if (this._headphone = !1, t.mainSoundTrack.switchPanningModelToEqualPower(), t.soundTracks)\n              for (var e = 0; e < t.soundTracks.length; e++)\n                t.soundTracks[e].switchPanningModelToEqualPower();\n          }, r.prototype._afterRender = function() {\n            var t = ye.a.Now;\n            if (!(this._lastCheck && t - this._lastCheck < this.audioPositioningRefreshRate)) {\n              this._lastCheck = t;\n              var e = this.scene;\n              if (this._audioEnabled && e._mainSoundTrack && e.soundTracks && (e._mainSoundTrack.soundCollection.length !== 0 || e.soundTracks.length !== 1)) {\n                var n = Ue.a.audioEngine;\n                if (n && n.audioContext) {\n                  if (this._audioListenerPositionProvider) {\n                    var i = this._audioListenerPositionProvider();\n                    i.x = i.x || 0, i.y = i.y || 0, i.z = i.z || 0, n.audioContext.listener.setPosition(i.x, i.y, i.z);\n                  } else {\n                    var o;\n                    if (o = e.activeCameras && e.activeCameras.length > 0 ? e.activeCameras[0] : e.activeCamera) {\n                      this._cachedCameraPosition.equals(o.globalPosition) || (this._cachedCameraPosition.copyFrom(o.globalPosition), n.audioContext.listener.setPosition(o.globalPosition.x, o.globalPosition.y, o.globalPosition.z)), o.rigCameras && o.rigCameras.length > 0 && (o = o.rigCameras[0]);\n                      var a = u.a.Invert(o.getViewMatrix()), s = u.e.TransformNormal(e.useRightHandedSystem ? r._CameraDirectionRH : r._CameraDirectionLH, a);\n                      s.normalize(), isNaN(s.x) || isNaN(s.y) || isNaN(s.z) || this._cachedCameraDirection.equals(s) || (this._cachedCameraDirection.copyFrom(s), n.audioContext.listener.setOrientation(s.x, s.y, s.z, 0, 1, 0));\n                    } else\n                      n.audioContext.listener.setPosition(0, 0, 0);\n                  }\n                  var d;\n                  for (d = 0; d < e.mainSoundTrack.soundCollection.length; d++) {\n                    var p = e.mainSoundTrack.soundCollection[d];\n                    p.useCustomAttenuation && p.updateDistanceFromListener();\n                  }\n                  if (e.soundTracks)\n                    for (d = 0; d < e.soundTracks.length; d++)\n                      for (var y = 0; y < e.soundTracks[d].soundCollection.length; y++)\n                        (p = e.soundTracks[d].soundCollection[y]).useCustomAttenuation && p.updateDistanceFromListener();\n                }\n              }\n            }\n          }, r._CameraDirectionLH = new u.e(0, 0, -1), r._CameraDirectionRH = new u.e(0, 0, 1), r;\n        }();\n        Qn._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(r), r._addComponent(t));\n        };\n        var lf = function() {\n          function r(t, e, n) {\n            var i = this;\n            if (this.loop = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._volume = 1, this.isPlaying = !1, this.isPaused = !1, this._sounds = [], this._weights = [], e.length !== n.length)\n              throw new Error(\"Sounds length does not equal weights length\");\n            this.loop = t, this._weights = n;\n            for (var o = 0, a = 0, s = n; a < s.length; a++)\n              o += s[a];\n            for (var d = o > 0 ? 1 / o : 0, p = 0; p < this._weights.length; p++)\n              this._weights[p] *= d;\n            this._sounds = e;\n            for (var y = 0, P = this._sounds; y < P.length; y++)\n              P[y].onEndedObservable.add(function() {\n                i._onended();\n              });\n          }\n          return Object.defineProperty(r.prototype, \"directionalConeInnerAngle\", { get: function() {\n            return this._coneInnerAngle;\n          }, set: function(t) {\n            if (t !== this._coneInnerAngle) {\n              if (this._coneOuterAngle < t)\n                return void l.a.Error(\"directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneInnerAngle = t;\n              for (var e = 0, n = this._sounds; e < n.length; e++)\n                n[e].directionalConeInnerAngle = t;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"directionalConeOuterAngle\", { get: function() {\n            return this._coneOuterAngle;\n          }, set: function(t) {\n            if (t !== this._coneOuterAngle) {\n              if (t < this._coneInnerAngle)\n                return void l.a.Error(\"directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneOuterAngle = t;\n              for (var e = 0, n = this._sounds; e < n.length; e++)\n                n[e].directionalConeOuterAngle = t;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"volume\", { get: function() {\n            return this._volume;\n          }, set: function(t) {\n            if (t !== this._volume)\n              for (var e = 0, n = this._sounds; e < n.length; e++)\n                n[e].setVolume(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._onended = function() {\n            this._currentIndex !== void 0 && (this._sounds[this._currentIndex].autoplay = !1), this.loop && this.isPlaying ? this.play() : this.isPlaying = !1;\n          }, r.prototype.pause = function() {\n            this.isPaused = !0, this._currentIndex !== void 0 && this._sounds[this._currentIndex].pause();\n          }, r.prototype.stop = function() {\n            this.isPlaying = !1, this._currentIndex !== void 0 && this._sounds[this._currentIndex].stop();\n          }, r.prototype.play = function(t) {\n            if (!this.isPaused) {\n              this.stop();\n              for (var e = Math.random(), n = 0, i = 0; i < this._weights.length; i++)\n                if (e <= (n += this._weights[i])) {\n                  this._currentIndex = i;\n                  break;\n                }\n            }\n            var o = this._sounds[this._currentIndex];\n            o.isReady() ? o.play(0, this.isPaused ? void 0 : t) : o.autoplay = !0, this.isPlaying = !0, this.isPaused = !1;\n          }, r;\n        }(), yt = f(18), Qc = function() {\n          function r() {\n            this._zoomStopsAnimation = !1, this._idleRotationSpeed = 0.05, this._idleRotationWaitTime = 2e3, this._idleRotationSpinupTime = 2e3, this._isPointerDown = !1, this._lastFrameTime = null, this._lastInteractionTime = -1 / 0, this._cameraRotationSpeed = 0, this._lastFrameRadius = 0;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"AutoRotation\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"zoomStopsAnimation\", { get: function() {\n            return this._zoomStopsAnimation;\n          }, set: function(t) {\n            this._zoomStopsAnimation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"idleRotationSpeed\", { get: function() {\n            return this._idleRotationSpeed;\n          }, set: function(t) {\n            this._idleRotationSpeed = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"idleRotationWaitTime\", { get: function() {\n            return this._idleRotationWaitTime;\n          }, set: function(t) {\n            this._idleRotationWaitTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"idleRotationSpinupTime\", { get: function() {\n            return this._idleRotationSpinupTime;\n          }, set: function(t) {\n            this._idleRotationSpinupTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rotationInProgress\", { get: function() {\n            return Math.abs(this._cameraRotationSpeed) > 0;\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._attachedCamera = t;\n            var n = this._attachedCamera.getScene();\n            this._onPrePointerObservableObserver = n.onPrePointerObservable.add(function(i) {\n              i.type !== yt.a.POINTERDOWN ? i.type === yt.a.POINTERUP && (e._isPointerDown = !1) : e._isPointerDown = !0;\n            }), this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {\n              var i = ye.a.Now, o = 0;\n              e._lastFrameTime != null && (o = i - e._lastFrameTime), e._lastFrameTime = i, e._applyUserInteraction();\n              var a = i - e._lastInteractionTime - e._idleRotationWaitTime, s = Math.max(Math.min(a / e._idleRotationSpinupTime, 1), 0);\n              e._cameraRotationSpeed = e._idleRotationSpeed * s, e._attachedCamera && (e._attachedCamera.alpha -= e._cameraRotationSpeed * (o / 1e3));\n            });\n          }, r.prototype.detach = function() {\n            if (this._attachedCamera) {\n              var t = this._attachedCamera.getScene();\n              this._onPrePointerObservableObserver && t.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._attachedCamera = null;\n            }\n          }, r.prototype._userIsZooming = function() {\n            return !!this._attachedCamera && this._attachedCamera.inertialRadiusOffset !== 0;\n          }, r.prototype._shouldAnimationStopForInteraction = function() {\n            if (!this._attachedCamera)\n              return !1;\n            var t = !1;\n            return this._lastFrameRadius === this._attachedCamera.radius && this._attachedCamera.inertialRadiusOffset !== 0 && (t = !0), this._lastFrameRadius = this._attachedCamera.radius, this._zoomStopsAnimation ? t : this._userIsZooming();\n          }, r.prototype._applyUserInteraction = function() {\n            this._userIsMoving() && !this._shouldAnimationStopForInteraction() && (this._lastInteractionTime = ye.a.Now);\n          }, r.prototype._userIsMoving = function() {\n            return !!this._attachedCamera && (this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown);\n          }, r;\n        }(), qc = function() {\n          function r() {\n            this.transitionDuration = 450, this.lowerRadiusTransitionRange = 2, this.upperRadiusTransitionRange = -2, this._autoTransitionRange = !1, this._radiusIsAnimating = !1, this._radiusBounceTransition = null, this._animatables = new Array();\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"Bouncing\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"autoTransitionRange\", { get: function() {\n            return this._autoTransitionRange;\n          }, set: function(t) {\n            var e = this;\n            if (this._autoTransitionRange !== t) {\n              this._autoTransitionRange = t;\n              var n = this._attachedCamera;\n              n && (t ? this._onMeshTargetChangedObserver = n.onMeshTargetChangedObservable.add(function(i) {\n                if (i) {\n                  i.computeWorldMatrix(!0);\n                  var o = i.getBoundingInfo().diagonalLength;\n                  e.lowerRadiusTransitionRange = 0.05 * o, e.upperRadiusTransitionRange = 0.05 * o;\n                }\n              }) : this._onMeshTargetChangedObserver && n.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver));\n            }\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._attachedCamera = t, this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {\n              e._attachedCamera && (e._isRadiusAtLimit(e._attachedCamera.lowerRadiusLimit) && e._applyBoundRadiusAnimation(e.lowerRadiusTransitionRange), e._isRadiusAtLimit(e._attachedCamera.upperRadiusLimit) && e._applyBoundRadiusAnimation(e.upperRadiusTransitionRange));\n            });\n          }, r.prototype.detach = function() {\n            this._attachedCamera && (this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null);\n          }, r.prototype._isRadiusAtLimit = function(t) {\n            return !!this._attachedCamera && this._attachedCamera.radius === t && !this._radiusIsAnimating;\n          }, r.prototype._applyBoundRadiusAnimation = function(t) {\n            var e = this;\n            if (this._attachedCamera) {\n              this._radiusBounceTransition || (r.EasingFunction.setEasingMode(r.EasingMode), this._radiusBounceTransition = k.CreateAnimation(\"radius\", k.ANIMATIONTYPE_FLOAT, 60, r.EasingFunction)), this._cachedWheelPrecision = this._attachedCamera.wheelPrecision, this._attachedCamera.wheelPrecision = 1 / 0, this._attachedCamera.inertialRadiusOffset = 0, this.stopAllAnimations(), this._radiusIsAnimating = !0;\n              var n = k.TransitionTo(\"radius\", this._attachedCamera.radius + t, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusBounceTransition, this.transitionDuration, function() {\n                return e._clearAnimationLocks();\n              });\n              n && this._animatables.push(n);\n            }\n          }, r.prototype._clearAnimationLocks = function() {\n            this._radiusIsAnimating = !1, this._attachedCamera && (this._attachedCamera.wheelPrecision = this._cachedWheelPrecision);\n          }, r.prototype.stopAllAnimations = function() {\n            for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length; )\n              this._animatables[0].onAnimationEnd = null, this._animatables[0].stop(), this._animatables.shift();\n          }, r.EasingFunction = new Je(0.3), r.EasingMode = Ge.EASINGMODE_EASEOUT, r;\n        }(), Zc = function() {\n          function r() {\n            this._mode = r.FitFrustumSidesMode, this._radiusScale = 1, this._positionScale = 0.5, this._defaultElevation = 0.3, this._elevationReturnTime = 1500, this._elevationReturnWaitTime = 1e3, this._zoomStopsAnimation = !1, this._framingTime = 1500, this.autoCorrectCameraLimitsAndSensibility = !0, this._isPointerDown = !1, this._lastInteractionTime = -1 / 0, this._animatables = new Array(), this._betaIsAnimating = !1;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"Framing\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"mode\", { get: function() {\n            return this._mode;\n          }, set: function(t) {\n            this._mode = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"radiusScale\", { get: function() {\n            return this._radiusScale;\n          }, set: function(t) {\n            this._radiusScale = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"positionScale\", { get: function() {\n            return this._positionScale;\n          }, set: function(t) {\n            this._positionScale = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"defaultElevation\", { get: function() {\n            return this._defaultElevation;\n          }, set: function(t) {\n            this._defaultElevation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"elevationReturnTime\", { get: function() {\n            return this._elevationReturnTime;\n          }, set: function(t) {\n            this._elevationReturnTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"elevationReturnWaitTime\", { get: function() {\n            return this._elevationReturnWaitTime;\n          }, set: function(t) {\n            this._elevationReturnWaitTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"zoomStopsAnimation\", { get: function() {\n            return this._zoomStopsAnimation;\n          }, set: function(t) {\n            this._zoomStopsAnimation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"framingTime\", { get: function() {\n            return this._framingTime;\n          }, set: function(t) {\n            this._framingTime = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._attachedCamera = t;\n            var n = this._attachedCamera.getScene();\n            r.EasingFunction.setEasingMode(r.EasingMode), this._onPrePointerObservableObserver = n.onPrePointerObservable.add(function(i) {\n              i.type !== yt.a.POINTERDOWN ? i.type === yt.a.POINTERUP && (e._isPointerDown = !1) : e._isPointerDown = !0;\n            }), this._onMeshTargetChangedObserver = t.onMeshTargetChangedObservable.add(function(i) {\n              i && e.zoomOnMesh(i);\n            }), this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {\n              e._applyUserInteraction(), e._maintainCameraAboveGround();\n            });\n          }, r.prototype.detach = function() {\n            if (this._attachedCamera) {\n              var t = this._attachedCamera.getScene();\n              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;\n            }\n          }, r.prototype.zoomOnMesh = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = null), t.computeWorldMatrix(!0);\n            var i = t.getBoundingInfo().boundingBox;\n            this.zoomOnBoundingInfo(i.minimumWorld, i.maximumWorld, e, n);\n          }, r.prototype.zoomOnMeshHierarchy = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = null), t.computeWorldMatrix(!0);\n            var i = t.getHierarchyBoundingVectors(!0);\n            this.zoomOnBoundingInfo(i.min, i.max, e, n);\n          }, r.prototype.zoomOnMeshesHierarchy = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = null);\n            for (var i = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), o = new u.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), a = 0; a < t.length; a++) {\n              var s = t[a].getHierarchyBoundingVectors(!0);\n              u.e.CheckExtends(s.min, i, o), u.e.CheckExtends(s.max, i, o);\n            }\n            this.zoomOnBoundingInfo(i, o, e, n);\n          }, r.prototype.zoomOnBoundingInfo = function(t, e, n, i) {\n            var o, a = this;\n            if (n === void 0 && (n = !1), i === void 0 && (i = null), this._attachedCamera) {\n              var s = t.y, d = s + (e.y - s) * this._positionScale, p = e.subtract(t).scale(0.5);\n              if (n)\n                o = new u.e(0, d, 0);\n              else {\n                var y = t.add(p);\n                o = new u.e(y.x, d, y.z);\n              }\n              this._vectorTransition || (this._vectorTransition = k.CreateAnimation(\"target\", k.ANIMATIONTYPE_VECTOR3, 60, r.EasingFunction)), this._betaIsAnimating = !0;\n              var P = k.TransitionTo(\"target\", o, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);\n              P && this._animatables.push(P);\n              var R = 0;\n              if (this._mode === r.FitFrustumSidesMode) {\n                var B = this._calculateLowerRadiusFromModelBoundingSphere(t, e);\n                this.autoCorrectCameraLimitsAndSensibility && (this._attachedCamera.lowerRadiusLimit = p.length() + this._attachedCamera.minZ), R = B;\n              } else\n                this._mode === r.IgnoreBoundsSizeMode && (R = this._calculateLowerRadiusFromModelBoundingSphere(t, e), this.autoCorrectCameraLimitsAndSensibility && this._attachedCamera.lowerRadiusLimit === null && (this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ));\n              if (this.autoCorrectCameraLimitsAndSensibility) {\n                var F = e.subtract(t).length();\n                this._attachedCamera.panningSensibility = 5e3 / F, this._attachedCamera.wheelPrecision = 100 / R;\n              }\n              this._radiusTransition || (this._radiusTransition = k.CreateAnimation(\"radius\", k.ANIMATIONTYPE_FLOAT, 60, r.EasingFunction)), (P = k.TransitionTo(\"radius\", R, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, function() {\n                a.stopAllAnimations(), i && i(), a._attachedCamera && a._attachedCamera.useInputToRestoreState && a._attachedCamera.storeState();\n              })) && this._animatables.push(P);\n            }\n          }, r.prototype._calculateLowerRadiusFromModelBoundingSphere = function(t, e) {\n            var n = e.subtract(t).length(), i = this._getFrustumSlope(), o = 0.5 * n * this._radiusScale, a = o * Math.sqrt(1 + 1 / (i.x * i.x)), s = o * Math.sqrt(1 + 1 / (i.y * i.y)), d = Math.max(a, s), p = this._attachedCamera;\n            return p ? (p.lowerRadiusLimit && this._mode === r.IgnoreBoundsSizeMode && (d = d < p.lowerRadiusLimit ? p.lowerRadiusLimit : d), p.upperRadiusLimit && (d = d > p.upperRadiusLimit ? p.upperRadiusLimit : d), d) : 0;\n          }, r.prototype._maintainCameraAboveGround = function() {\n            var t = this;\n            if (!(this._elevationReturnTime < 0)) {\n              var e = ye.a.Now - this._lastInteractionTime, n = 0.5 * Math.PI - this._defaultElevation, i = 0.5 * Math.PI;\n              if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > i && e >= this._elevationReturnWaitTime) {\n                this._betaIsAnimating = !0, this.stopAllAnimations(), this._betaTransition || (this._betaTransition = k.CreateAnimation(\"beta\", k.ANIMATIONTYPE_FLOAT, 60, r.EasingFunction));\n                var o = k.TransitionTo(\"beta\", n, this._attachedCamera, this._attachedCamera.getScene(), 60, this._betaTransition, this._elevationReturnTime, function() {\n                  t._clearAnimationLocks(), t.stopAllAnimations();\n                });\n                o && this._animatables.push(o);\n              }\n            }\n          }, r.prototype._getFrustumSlope = function() {\n            var t = this._attachedCamera;\n            if (!t)\n              return u.d.Zero();\n            var e = t.getScene().getEngine().getAspectRatio(t), n = Math.tan(t.fov / 2), i = n * e;\n            return new u.d(i, n);\n          }, r.prototype._clearAnimationLocks = function() {\n            this._betaIsAnimating = !1;\n          }, r.prototype._applyUserInteraction = function() {\n            this.isUserIsMoving && (this._lastInteractionTime = ye.a.Now, this.stopAllAnimations(), this._clearAnimationLocks());\n          }, r.prototype.stopAllAnimations = function() {\n            for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length; )\n              this._animatables[0] && (this._animatables[0].onAnimationEnd = null, this._animatables[0].stop()), this._animatables.shift();\n          }, Object.defineProperty(r.prototype, \"isUserIsMoving\", { get: function() {\n            return !!this._attachedCamera && (this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown);\n          }, enumerable: !1, configurable: !0 }), r.EasingFunction = new Tt(), r.EasingMode = Ge.EASINGMODE_EASEINOUT, r.IgnoreBoundsSizeMode = 0, r.FitFrustumSidesMode = 1, r;\n        }(), or = function(r, t, e, n) {\n          t === void 0 && (t = new u.e()), e === void 0 && (e = 0), n === void 0 && (n = !1), this.direction = r, this.rotatedDirection = t, this.diff = e, this.ignore = n;\n        }, uf = function() {\n          function r(t) {\n            this.ui = t, this.name = \"AttachToBoxBehavior\", this.distanceAwayFromFace = 0.15, this.distanceAwayFromBottomOfFace = 0.15, this._faceVectors = [new or(u.e.Up()), new or(u.e.Down()), new or(u.e.Left()), new or(u.e.Right()), new or(u.e.Forward()), new or(u.e.Forward().scaleInPlace(-1))], this._tmpMatrix = new u.a(), this._tmpVector = new u.e(), this._zeroVector = u.e.Zero(), this._lookAtTmpMatrix = new u.a();\n          }\n          return r.prototype.init = function() {\n          }, r.prototype._closestFace = function(t) {\n            var e = this;\n            return this._faceVectors.forEach(function(n) {\n              e._target.rotationQuaternion || (e._target.rotationQuaternion = u.b.RotationYawPitchRoll(e._target.rotation.y, e._target.rotation.x, e._target.rotation.z)), e._target.rotationQuaternion.toRotationMatrix(e._tmpMatrix), u.e.TransformCoordinatesToRef(n.direction, e._tmpMatrix, n.rotatedDirection), n.diff = u.e.GetAngleBetweenVectors(n.rotatedDirection, t, u.e.Cross(n.rotatedDirection, t));\n            }), this._faceVectors.reduce(function(n, i) {\n              return n.ignore ? i : i.ignore || n.diff < i.diff ? n : i;\n            }, this._faceVectors[0]);\n          }, r.prototype._lookAtToRef = function(t, e, n) {\n            e === void 0 && (e = new u.e(0, 1, 0)), u.a.LookAtLHToRef(this._zeroVector, t, e, this._lookAtTmpMatrix), this._lookAtTmpMatrix.invert(), u.b.FromRotationMatrixToRef(this._lookAtTmpMatrix, n);\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._target = t, this._scene = this._target.getScene(), this._onRenderObserver = this._scene.onBeforeRenderObservable.add(function() {\n              if (e._scene.activeCamera) {\n                var n = e._scene.activeCamera.position;\n                e._scene.activeCamera.devicePosition && (n = e._scene.activeCamera.devicePosition);\n                var i = e._closestFace(n.subtract(t.position));\n                e._scene.activeCamera.leftCamera ? e._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(e._tmpMatrix) : e._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(e._tmpMatrix), u.e.TransformCoordinatesToRef(u.e.Up(), e._tmpMatrix, e._tmpVector), e._faceVectors.forEach(function(a) {\n                  i.direction.x && a.direction.x && (a.ignore = !0), i.direction.y && a.direction.y && (a.ignore = !0), i.direction.z && a.direction.z && (a.ignore = !0);\n                });\n                var o = e._closestFace(e._tmpVector);\n                e._faceVectors.forEach(function(a) {\n                  a.ignore = !1;\n                }), e.ui.position.copyFrom(t.position), i.direction.x && (i.rotatedDirection.scaleToRef(t.scaling.x / 2 + e.distanceAwayFromFace, e._tmpVector), e.ui.position.addInPlace(e._tmpVector)), i.direction.y && (i.rotatedDirection.scaleToRef(t.scaling.y / 2 + e.distanceAwayFromFace, e._tmpVector), e.ui.position.addInPlace(e._tmpVector)), i.direction.z && (i.rotatedDirection.scaleToRef(t.scaling.z / 2 + e.distanceAwayFromFace, e._tmpVector), e.ui.position.addInPlace(e._tmpVector)), e.ui.rotationQuaternion || (e.ui.rotationQuaternion = u.b.RotationYawPitchRoll(e.ui.rotation.y, e.ui.rotation.x, e.ui.rotation.z)), i.rotatedDirection.scaleToRef(-1, e._tmpVector), e._lookAtToRef(e._tmpVector, o.rotatedDirection, e.ui.rotationQuaternion), o.direction.x && e.ui.up.scaleToRef(e.distanceAwayFromBottomOfFace - t.scaling.x / 2, e._tmpVector), o.direction.y && e.ui.up.scaleToRef(e.distanceAwayFromBottomOfFace - t.scaling.y / 2, e._tmpVector), o.direction.z && e.ui.up.scaleToRef(e.distanceAwayFromBottomOfFace - t.scaling.z / 2, e._tmpVector), e.ui.position.addInPlace(e._tmpVector);\n              }\n            });\n          }, r.prototype.detach = function() {\n            this._scene.onBeforeRenderObservable.remove(this._onRenderObserver);\n          }, r;\n        }(), hf = function() {\n          function r() {\n            var t = this;\n            this.delay = 0, this.fadeInTime = 300, this._millisecondsPerFrame = 1e3 / 60, this._hovered = !1, this._hoverValue = 0, this._ownerNode = null, this._update = function() {\n              if (t._ownerNode) {\n                if (t._hoverValue += t._hovered ? t._millisecondsPerFrame : -t._millisecondsPerFrame, t._setAllVisibility(t._ownerNode, (t._hoverValue - t.delay) / t.fadeInTime), t._ownerNode.visibility > 1)\n                  return t._setAllVisibility(t._ownerNode, 1), void (t._hoverValue = t.fadeInTime + t.delay);\n                if (t._ownerNode.visibility < 0 && (t._setAllVisibility(t._ownerNode, 0), t._hoverValue < 0))\n                  return void (t._hoverValue = 0);\n                setTimeout(t._update, t._millisecondsPerFrame);\n              }\n            };\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"FadeInOut\";\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            this._ownerNode = t, this._setAllVisibility(this._ownerNode, 0);\n          }, r.prototype.detach = function() {\n            this._ownerNode = null;\n          }, r.prototype.fadeIn = function(t) {\n            this._hovered = t, this._update();\n          }, r.prototype._setAllVisibility = function(t, e) {\n            var n = this;\n            t.visibility = e, t.getChildMeshes().forEach(function(i) {\n              n._setAllVisibility(i, e);\n            });\n          }, r;\n        }(), fi = f(65), df = function() {\n          function r() {\n            this._startDistance = 0, this._initialScale = new u.e(0, 0, 0), this._targetScale = new u.e(0, 0, 0), this._sceneRenderObserver = null, this._dragBehaviorA = new fi.a({}), this._dragBehaviorA.moveAttached = !1, this._dragBehaviorB = new fi.a({}), this._dragBehaviorB.moveAttached = !1;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"MultiPointerScale\";\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype._getCurrentDistance = function() {\n            return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length();\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._ownerNode = t, this._dragBehaviorA.onDragStartObservable.add(function(n) {\n              e._dragBehaviorA.dragging && e._dragBehaviorB.dragging && (e._dragBehaviorA.currentDraggingPointerID == e._dragBehaviorB.currentDraggingPointerID ? e._dragBehaviorA.releaseDrag() : (e._initialScale.copyFrom(t.scaling), e._startDistance = e._getCurrentDistance()));\n            }), this._dragBehaviorB.onDragStartObservable.add(function(n) {\n              e._dragBehaviorA.dragging && e._dragBehaviorB.dragging && (e._dragBehaviorA.currentDraggingPointerID == e._dragBehaviorB.currentDraggingPointerID ? e._dragBehaviorB.releaseDrag() : (e._initialScale.copyFrom(t.scaling), e._startDistance = e._getCurrentDistance()));\n            }), [this._dragBehaviorA, this._dragBehaviorB].forEach(function(n) {\n              n.onDragObservable.add(function() {\n                if (e._dragBehaviorA.dragging && e._dragBehaviorB.dragging) {\n                  var i = e._getCurrentDistance() / e._startDistance;\n                  e._initialScale.scaleToRef(i, e._targetScale);\n                }\n              });\n            }), t.addBehavior(this._dragBehaviorA), t.addBehavior(this._dragBehaviorB), this._sceneRenderObserver = t.getScene().onBeforeRenderObservable.add(function() {\n              if (e._dragBehaviorA.dragging && e._dragBehaviorB.dragging) {\n                var n = e._targetScale.subtract(t.scaling).scaleInPlace(0.1);\n                n.length() > 0.01 && t.scaling.addInPlace(n);\n              }\n            });\n          }, r.prototype.detach = function() {\n            var t = this;\n            this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), [this._dragBehaviorA, this._dragBehaviorB].forEach(function(e) {\n              e.onDragStartObservable.clear(), e.onDragObservable.clear(), t._ownerNode.removeBehavior(e);\n            });\n          }, r;\n        }(), Mt = f(31), _t = f(24), Un = f(60), Jc = function() {\n          function r() {\n            this._sceneRenderObserver = null, this._targetPosition = new u.e(0, 0, 0), this._moving = !1, this._startingOrientation = new u.b(), this._attachedToElement = !1, this.zDragFactor = 3, this.rotateDraggedObject = !0, this.dragging = !1, this.dragDeltaRatio = 0.2, this.currentDraggingPointerID = -1, this.detachCameraControls = !0, this.onDragStartObservable = new C.c(), this.onDragObservable = new C.c(), this.onDragEndObservable = new C.c();\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"SixDofDrag\";\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, Object.defineProperty(r.prototype, \"_pointerCamera\", { get: function() {\n            return this._scene.cameraToUseForPointers ? this._scene.cameraToUseForPointers : this._scene.activeCamera;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attach = function(t) {\n            var e = this;\n            this._ownerNode = t, this._scene = this._ownerNode.getScene(), r._virtualScene || (r._virtualScene = new _e.a(this._scene.getEngine(), { virtual: !0 }), r._virtualScene.detachControl(), this._scene.getEngine().scenes.pop());\n            var n = null, i = new u.e(0, 0, 0);\n            this._virtualOriginMesh = new Mt.a(\"\", r._virtualScene), this._virtualOriginMesh.rotationQuaternion = new u.b(), this._virtualDragMesh = new Mt.a(\"\", r._virtualScene), this._virtualDragMesh.rotationQuaternion = new u.b(), this._pointerObserver = this._scene.onPointerObservable.add(function(a, s) {\n              if (a.type == yt.a.POINTERDOWN) {\n                if (!e.dragging && a.pickInfo && a.pickInfo.hit && a.pickInfo.pickedMesh && a.pickInfo.ray && (R = a.pickInfo.pickedMesh, e._ownerNode == R || R.isDescendantOf(e._ownerNode))) {\n                  e._pointerCamera && e._pointerCamera.cameraRigMode == _t.a.RIG_MODE_NONE && a.pickInfo.ray.origin.copyFrom(e._pointerCamera.globalPosition), n = e._ownerNode, Un.a._RemoveAndStorePivotPoint(n), i.copyFrom(a.pickInfo.ray.origin), e._virtualOriginMesh.position.copyFrom(a.pickInfo.ray.origin), e._virtualOriginMesh.lookAt(a.pickInfo.ray.origin.add(a.pickInfo.ray.direction)), e._virtualOriginMesh.removeChild(e._virtualDragMesh), n.computeWorldMatrix(), e._virtualDragMesh.position.copyFrom(n.absolutePosition), n.rotationQuaternion || (n.rotationQuaternion = u.b.RotationYawPitchRoll(n.rotation.y, n.rotation.x, n.rotation.z));\n                  var d = n.parent;\n                  n.setParent(null), e._virtualDragMesh.rotationQuaternion.copyFrom(n.rotationQuaternion), n.setParent(d), e._virtualOriginMesh.addChild(e._virtualDragMesh), e._targetPosition.copyFrom(e._virtualDragMesh.absolutePosition), e.dragging = !0, e.currentDraggingPointerID = a.event.pointerId, e.detachCameraControls && e._pointerCamera && !e._pointerCamera.leftCamera && (e._pointerCamera.inputs.attachedToElement ? (e._pointerCamera.detachControl(), e._attachedToElement = !0) : e._attachedToElement = !1), Un.a._RestorePivotPoint(n), e.onDragStartObservable.notifyObservers({});\n                }\n              } else if (a.type == yt.a.POINTERUP || a.type == yt.a.POINTERDOUBLETAP)\n                e.currentDraggingPointerID == a.event.pointerId && (e.dragging = !1, e._moving = !1, e.currentDraggingPointerID = -1, n = null, e._virtualOriginMesh.removeChild(e._virtualDragMesh), e.detachCameraControls && e._attachedToElement && e._pointerCamera && !e._pointerCamera.leftCamera && (e._pointerCamera.attachControl(!0), e._attachedToElement = !1), e.onDragEndObservable.notifyObservers({}));\n              else if (a.type == yt.a.POINTERMOVE && e.currentDraggingPointerID == a.event.pointerId && e.dragging && a.pickInfo && a.pickInfo.ray && n) {\n                var p = e.zDragFactor;\n                e._pointerCamera && e._pointerCamera.cameraRigMode == _t.a.RIG_MODE_NONE && (a.pickInfo.ray.origin.copyFrom(e._pointerCamera.globalPosition), p = 0);\n                var y = a.pickInfo.ray.origin.subtract(i);\n                i.copyFrom(a.pickInfo.ray.origin);\n                var P = -u.e.Dot(y, a.pickInfo.ray.direction);\n                e._virtualOriginMesh.addChild(e._virtualDragMesh), e._virtualDragMesh.position.z -= e._virtualDragMesh.position.z < 1 ? P * e.zDragFactor : P * p * e._virtualDragMesh.position.z, e._virtualDragMesh.position.z < 0 && (e._virtualDragMesh.position.z = 0), e._virtualOriginMesh.position.copyFrom(a.pickInfo.ray.origin), e._virtualOriginMesh.lookAt(a.pickInfo.ray.origin.add(a.pickInfo.ray.direction)), e._virtualOriginMesh.removeChild(e._virtualDragMesh), e._targetPosition.copyFrom(e._virtualDragMesh.absolutePosition), n.parent && u.e.TransformCoordinatesToRef(e._targetPosition, u.a.Invert(n.parent.getWorldMatrix()), e._targetPosition), e._moving || e._startingOrientation.copyFrom(e._virtualDragMesh.rotationQuaternion), e._moving = !0;\n              }\n              var R;\n            });\n            var o = new u.b();\n            this._sceneRenderObserver = t.getScene().onBeforeRenderObservable.add(function() {\n              if (e.dragging && e._moving && n) {\n                if (Un.a._RemoveAndStorePivotPoint(n), n.position.addInPlace(e._targetPosition.subtract(n.position).scale(e.dragDeltaRatio)), e.rotateDraggedObject) {\n                  o.copyFrom(e._startingOrientation), o.x = -o.x, o.y = -o.y, o.z = -o.z, e._virtualDragMesh.rotationQuaternion.multiplyToRef(o, o), u.b.RotationYawPitchRollToRef(o.toEulerAngles(\"xyz\").y, 0, 0, o), o.multiplyToRef(e._startingOrientation, o);\n                  var a = n.parent;\n                  (!a || a.scaling && !a.scaling.isNonUniformWithinEpsilon(1e-3)) && (n.setParent(null), u.b.SlerpToRef(n.rotationQuaternion, o, e.dragDeltaRatio, n.rotationQuaternion), n.setParent(a));\n                }\n                Un.a._RestorePivotPoint(n), e.onDragObservable.notifyObservers();\n              }\n            });\n          }, r.prototype.detach = function() {\n            this._scene && (this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera && (this._pointerCamera.attachControl(!0), this._attachedToElement = !1), this._scene.onPointerObservable.remove(this._pointerObserver)), this._ownerNode && this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), this._virtualOriginMesh && this._virtualOriginMesh.dispose(), this._virtualDragMesh && this._virtualDragMesh.dispose(), this.onDragEndObservable.clear(), this.onDragObservable.clear(), this.onDragStartObservable.clear();\n          }, r;\n        }(), ff = function() {\n          function r(t, e, n) {\n            if (this.targetPosition = u.e.Zero(), this.poleTargetPosition = u.e.Zero(), this.poleTargetLocalOffset = u.e.Zero(), this.poleAngle = 0, this.slerpAmount = 1, this._bone1Quat = u.b.Identity(), this._bone1Mat = u.a.Identity(), this._bone2Ang = Math.PI, this._maxAngle = Math.PI, this._rightHandedSystem = !1, this._bendAxis = u.e.Right(), this._slerping = !1, this._adjustRoll = 0, this._bone2 = e, this._bone1 = e.getParent(), this._bone1) {\n              this.mesh = t;\n              var i = e.getPosition();\n              if (e.getAbsoluteTransform().determinant() > 0 && (this._rightHandedSystem = !0, this._bendAxis.x = 0, this._bendAxis.y = 0, this._bendAxis.z = -1, i.x > i.y && i.x > i.z && (this._adjustRoll = 0.5 * Math.PI, this._bendAxis.z = 1)), this._bone1.length) {\n                var o = this._bone1.getScale(), a = this._bone2.getScale();\n                this._bone1Length = this._bone1.length * o.y * this.mesh.scaling.y, this._bone2Length = this._bone2.length * a.y * this.mesh.scaling.y;\n              } else if (this._bone1.children[0]) {\n                t.computeWorldMatrix(!0);\n                var s = this._bone2.children[0].getAbsolutePosition(t), d = this._bone2.getAbsolutePosition(t), p = this._bone1.getAbsolutePosition(t);\n                this._bone1Length = u.e.Distance(s, d), this._bone2Length = u.e.Distance(d, p);\n              }\n              this._bone1.getRotationMatrixToRef(be.c.WORLD, t, this._bone1Mat), this.maxAngle = Math.PI, n && (n.targetMesh && (this.targetMesh = n.targetMesh, this.targetMesh.computeWorldMatrix(!0)), n.poleTargetMesh ? (this.poleTargetMesh = n.poleTargetMesh, this.poleTargetMesh.computeWorldMatrix(!0)) : n.poleTargetBone ? this.poleTargetBone = n.poleTargetBone : this._bone1.getParent() && (this.poleTargetBone = this._bone1.getParent()), n.poleTargetLocalOffset && this.poleTargetLocalOffset.copyFrom(n.poleTargetLocalOffset), n.poleAngle && (this.poleAngle = n.poleAngle), n.bendAxis && this._bendAxis.copyFrom(n.bendAxis), n.maxAngle && (this.maxAngle = n.maxAngle), n.slerpAmount && (this.slerpAmount = n.slerpAmount));\n            }\n          }\n          return Object.defineProperty(r.prototype, \"maxAngle\", { get: function() {\n            return this._maxAngle;\n          }, set: function(t) {\n            this._setMaxAngle(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._setMaxAngle = function(t) {\n            t < 0 && (t = 0), (t > Math.PI || t == null) && (t = Math.PI), this._maxAngle = t;\n            var e = this._bone1Length, n = this._bone2Length;\n            this._maxReach = Math.sqrt(e * e + n * n - 2 * e * n * Math.cos(t));\n          }, r.prototype.update = function() {\n            var t = this._bone1;\n            if (t) {\n              var e = this.targetPosition, n = this.poleTargetPosition, i = r._tmpMats[0], o = r._tmpMats[1];\n              this.targetMesh && e.copyFrom(this.targetMesh.getAbsolutePosition()), this.poleTargetBone ? this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, n) : this.poleTargetMesh && u.e.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), n);\n              var a = r._tmpVecs[0], s = r._tmpVecs[1], d = r._tmpVecs[2], p = r._tmpVecs[3], y = r._tmpVecs[4], P = r._tmpQuat;\n              t.getAbsolutePositionToRef(this.mesh, a), n.subtractToRef(a, y), y.x == 0 && y.y == 0 && y.z == 0 ? y.y = 1 : y.normalize(), e.subtractToRef(a, p), p.normalize(), u.e.CrossToRef(p, y, s), s.normalize(), u.e.CrossToRef(p, s, d), d.normalize(), u.a.FromXYZAxesToRef(d, p, s, i);\n              var R = this._bone1Length, B = this._bone2Length, F = u.e.Distance(a, e);\n              this._maxReach > 0 && (F = Math.min(this._maxReach, F));\n              var z = (B * B + F * F - R * R) / (2 * B * F), J = (F * F + R * R - B * B) / (2 * F * R);\n              z > 1 && (z = 1), J > 1 && (J = 1), z < -1 && (z = -1), J < -1 && (J = -1);\n              var ie = Math.acos(z), se = Math.acos(J), ce = -ie - se;\n              if (this._rightHandedSystem)\n                u.a.RotationYawPitchRollToRef(0, 0, this._adjustRoll, o), o.multiplyToRef(i, i), u.a.RotationAxisToRef(this._bendAxis, se, o), o.multiplyToRef(i, i);\n              else {\n                var ue = r._tmpVecs[5];\n                ue.copyFrom(this._bendAxis), ue.x *= -1, u.a.RotationAxisToRef(ue, -se, o), o.multiplyToRef(i, i);\n              }\n              this.poleAngle && (u.a.RotationAxisToRef(p, this.poleAngle, o), i.multiplyToRef(o, i)), this._bone1 && (this.slerpAmount < 1 ? (this._slerping || u.b.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat), u.b.FromRotationMatrixToRef(i, P), u.b.SlerpToRef(this._bone1Quat, P, this.slerpAmount, this._bone1Quat), ce = this._bone2Ang * (1 - this.slerpAmount) + ce * this.slerpAmount, this._bone1.setRotationQuaternion(this._bone1Quat, be.c.WORLD, this.mesh), this._slerping = !0) : (this._bone1.setRotationMatrix(i, be.c.WORLD, this.mesh), this._bone1Mat.copyFrom(i), this._slerping = !1)), this._bone2.setAxisAngle(this._bendAxis, ce, be.c.LOCAL), this._bone2Ang = ce;\n            }\n          }, r._tmpVecs = [u.e.Zero(), u.e.Zero(), u.e.Zero(), u.e.Zero(), u.e.Zero(), u.e.Zero()], r._tmpQuat = u.b.Identity(), r._tmpMats = [u.a.Identity(), u.a.Identity()], r;\n        }(), pf = function() {\n          function r(t, e, n, i) {\n            if (this.upAxis = u.e.Up(), this.upAxisSpace = be.c.LOCAL, this.adjustYaw = 0, this.adjustPitch = 0, this.adjustRoll = 0, this.slerpAmount = 1, this._boneQuat = u.b.Identity(), this._slerping = !1, this._firstFrameSkipped = !1, this._fowardAxis = u.e.Forward(), this.mesh = t, this.bone = e, this.target = n, i && (i.adjustYaw && (this.adjustYaw = i.adjustYaw), i.adjustPitch && (this.adjustPitch = i.adjustPitch), i.adjustRoll && (this.adjustRoll = i.adjustRoll), i.maxYaw != null ? this.maxYaw = i.maxYaw : this.maxYaw = Math.PI, i.minYaw != null ? this.minYaw = i.minYaw : this.minYaw = -Math.PI, i.maxPitch != null ? this.maxPitch = i.maxPitch : this.maxPitch = Math.PI, i.minPitch != null ? this.minPitch = i.minPitch : this.minPitch = -Math.PI, i.slerpAmount != null && (this.slerpAmount = i.slerpAmount), i.upAxis != null && (this.upAxis = i.upAxis), i.upAxisSpace != null && (this.upAxisSpace = i.upAxisSpace), i.yawAxis != null || i.pitchAxis != null)) {\n              var o = be.a.Y, a = be.a.X;\n              i.yawAxis != null && (o = i.yawAxis.clone()).normalize(), i.pitchAxis != null && (a = i.pitchAxis.clone()).normalize();\n              var s = u.e.Cross(a, o);\n              this._transformYawPitch = u.a.Identity(), u.a.FromXYZAxesToRef(a, o, s, this._transformYawPitch), this._transformYawPitchInv = this._transformYawPitch.clone(), this._transformYawPitch.invert();\n            }\n            e.getParent() || this.upAxisSpace != be.c.BONE || (this.upAxisSpace = be.c.LOCAL);\n          }\n          return Object.defineProperty(r.prototype, \"minYaw\", { get: function() {\n            return this._minYaw;\n          }, set: function(t) {\n            this._minYaw = t, this._minYawSin = Math.sin(t), this._minYawCos = Math.cos(t), this._maxYaw != null && (this._midYawConstraint = 0.5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxYaw\", { get: function() {\n            return this._maxYaw;\n          }, set: function(t) {\n            this._maxYaw = t, this._maxYawSin = Math.sin(t), this._maxYawCos = Math.cos(t), this._minYaw != null && (this._midYawConstraint = 0.5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"minPitch\", { get: function() {\n            return this._minPitch;\n          }, set: function(t) {\n            this._minPitch = t, this._minPitchTan = Math.tan(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxPitch\", { get: function() {\n            return this._maxPitch;\n          }, set: function(t) {\n            this._maxPitch = t, this._maxPitchTan = Math.tan(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.update = function() {\n            if (this.slerpAmount < 1 && !this._firstFrameSkipped)\n              this._firstFrameSkipped = !0;\n            else {\n              var t = this.bone, e = r._tmpVecs[0];\n              t.getAbsolutePositionToRef(this.mesh, e);\n              var n = this.target, i = r._tmpMats[0], o = r._tmpMats[1], a = this.mesh, s = t.getParent(), d = r._tmpVecs[1];\n              d.copyFrom(this.upAxis), this.upAxisSpace == be.c.BONE && s ? (this._transformYawPitch && u.e.TransformCoordinatesToRef(d, this._transformYawPitchInv, d), s.getDirectionToRef(d, this.mesh, d)) : this.upAxisSpace == be.c.LOCAL && (a.getDirectionToRef(d, d), a.scaling.x == 1 && a.scaling.y == 1 && a.scaling.z == 1 || d.normalize());\n              var p = !1, y = !1;\n              if (this._maxYaw == Math.PI && this._minYaw == -Math.PI || (p = !0), this._maxPitch == Math.PI && this._minPitch == -Math.PI || (y = !0), p || y) {\n                var P = r._tmpMats[2], R = r._tmpMats[3];\n                if (this.upAxisSpace == be.c.BONE && d.y == 1 && s)\n                  s.getRotationMatrixToRef(be.c.WORLD, this.mesh, P);\n                else if (this.upAxisSpace != be.c.LOCAL || d.y != 1 || s) {\n                  (F = r._tmpVecs[2]).copyFrom(this._fowardAxis), this._transformYawPitch && u.e.TransformCoordinatesToRef(F, this._transformYawPitchInv, F), s ? s.getDirectionToRef(F, this.mesh, F) : a.getDirectionToRef(F, F);\n                  var B = u.e.Cross(d, F);\n                  B.normalize();\n                  var F = u.e.Cross(B, d);\n                  u.a.FromXYZAxesToRef(B, d, F, P);\n                } else\n                  P.copyFrom(a.getWorldMatrix());\n                P.invertToRef(R);\n                var z = null;\n                if (y) {\n                  var J = r._tmpVecs[3];\n                  n.subtractToRef(e, J), u.e.TransformCoordinatesToRef(J, R, J), z = Math.sqrt(J.x * J.x + J.z * J.z);\n                  var ie = Math.atan2(J.y, z), se = ie;\n                  ie > this._maxPitch ? (J.y = this._maxPitchTan * z, se = this._maxPitch) : ie < this._minPitch && (J.y = this._minPitchTan * z, se = this._minPitch), ie != se && (u.e.TransformCoordinatesToRef(J, P, J), J.addInPlace(e), n = J);\n                }\n                if (p) {\n                  J = r._tmpVecs[4], n.subtractToRef(e, J), u.e.TransformCoordinatesToRef(J, R, J);\n                  var ce = Math.atan2(J.x, J.z), ue = ce;\n                  if ((ce > this._maxYaw || ce < this._minYaw) && (z == null && (z = Math.sqrt(J.x * J.x + J.z * J.z)), this._yawRange > Math.PI ? this._isAngleBetween(ce, this._maxYaw, this._midYawConstraint) ? (J.z = this._maxYawCos * z, J.x = this._maxYawSin * z, ue = this._maxYaw) : this._isAngleBetween(ce, this._midYawConstraint, this._minYaw) && (J.z = this._minYawCos * z, J.x = this._minYawSin * z, ue = this._minYaw) : ce > this._maxYaw ? (J.z = this._maxYawCos * z, J.x = this._maxYawSin * z, ue = this._maxYaw) : ce < this._minYaw && (J.z = this._minYawCos * z, J.x = this._minYawSin * z, ue = this._minYaw)), this._slerping && this._yawRange > Math.PI) {\n                    var fe = r._tmpVecs[8];\n                    fe.copyFrom(be.a.Z), this._transformYawPitch && u.e.TransformCoordinatesToRef(fe, this._transformYawPitchInv, fe);\n                    var ve = r._tmpMats[4];\n                    this._boneQuat.toRotationMatrix(ve), this.mesh.getWorldMatrix().multiplyToRef(ve, ve), u.e.TransformCoordinatesToRef(fe, ve, fe), u.e.TransformCoordinatesToRef(fe, R, fe);\n                    var Te = Math.atan2(fe.x, fe.z);\n                    if (this._getAngleBetween(Te, ce) > this._getAngleBetween(Te, this._midYawConstraint)) {\n                      z == null && (z = Math.sqrt(J.x * J.x + J.z * J.z));\n                      var Re = this._getAngleBetween(Te, this._maxYaw);\n                      this._getAngleBetween(Te, this._minYaw) < Re ? (ue = Te + 0.75 * Math.PI, J.z = Math.cos(ue) * z, J.x = Math.sin(ue) * z) : (ue = Te - 0.75 * Math.PI, J.z = Math.cos(ue) * z, J.x = Math.sin(ue) * z);\n                    }\n                  }\n                  ce != ue && (u.e.TransformCoordinatesToRef(J, P, J), J.addInPlace(e), n = J);\n                }\n              }\n              var Ae = r._tmpVecs[5], Ee = r._tmpVecs[6], Se = r._tmpVecs[7], De = r._tmpQuat;\n              n.subtractToRef(e, Ae), Ae.normalize(), u.e.CrossToRef(d, Ae, Ee), Ee.normalize(), u.e.CrossToRef(Ae, Ee, Se), Se.normalize(), u.a.FromXYZAxesToRef(Ee, Se, Ae, i), Ee.x === 0 && Ee.y === 0 && Ee.z === 0 || Se.x === 0 && Se.y === 0 && Se.z === 0 || Ae.x === 0 && Ae.y === 0 && Ae.z === 0 || ((this.adjustYaw || this.adjustPitch || this.adjustRoll) && (u.a.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, o), o.multiplyToRef(i, i)), this.slerpAmount < 1 ? (this._slerping || this.bone.getRotationQuaternionToRef(be.c.WORLD, this.mesh, this._boneQuat), this._transformYawPitch && this._transformYawPitch.multiplyToRef(i, i), u.b.FromRotationMatrixToRef(i, De), u.b.SlerpToRef(this._boneQuat, De, this.slerpAmount, this._boneQuat), this.bone.setRotationQuaternion(this._boneQuat, be.c.WORLD, this.mesh), this._slerping = !0) : (this._transformYawPitch && this._transformYawPitch.multiplyToRef(i, i), this.bone.setRotationMatrix(i, be.c.WORLD, this.mesh), this._slerping = !1));\n            }\n          }, r.prototype._getAngleDiff = function(t, e) {\n            var n = e - t;\n            return (n %= 2 * Math.PI) > Math.PI ? n -= 2 * Math.PI : n < -Math.PI && (n += 2 * Math.PI), n;\n          }, r.prototype._getAngleBetween = function(t, e) {\n            var n = 0;\n            return (n = (t = (t %= 2 * Math.PI) < 0 ? t + 2 * Math.PI : t) < (e = (e %= 2 * Math.PI) < 0 ? e + 2 * Math.PI : e) ? e - t : t - e) > Math.PI && (n = 2 * Math.PI - n), n;\n          }, r.prototype._isAngleBetween = function(t, e, n) {\n            if (t = (t %= 2 * Math.PI) < 0 ? t + 2 * Math.PI : t, (e = (e %= 2 * Math.PI) < 0 ? e + 2 * Math.PI : e) < (n = (n %= 2 * Math.PI) < 0 ? n + 2 * Math.PI : n)) {\n              if (t > e && t < n)\n                return !0;\n            } else if (t > n && t < e)\n              return !0;\n            return !1;\n          }, r._tmpVecs = Pe.a.BuildArray(10, u.e.Zero), r._tmpQuat = u.b.Identity(), r._tmpMats = Pe.a.BuildArray(5, u.a.Identity), r;\n        }(), Ne = f(10), Pt = f(27), wt = f(26);\n        function $c(r, t, e, n) {\n          var i;\n          i = n === h.a.TEXTURETYPE_FLOAT ? new Float32Array(t * e * 4) : new Uint32Array(t * e * 4);\n          for (var o = 0; o < t; o++)\n            for (var a = 0; a < e; a++) {\n              var s = 3 * (a * t + o), d = 4 * (a * t + o);\n              i[d + 0] = r[s + 0], i[d + 1] = r[s + 1], i[d + 2] = r[s + 2], i[d + 3] = 1;\n            }\n          return i;\n        }\n        function el(r) {\n          return function(t, e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = null), y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var P = r ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY, R = r ? Pt.b.Raw3D : Pt.b.Raw2DArray, B = new Pt.a(this, R);\n            B.baseWidth = e, B.baseHeight = n, B.baseDepth = i, B.width = e, B.height = n, B.depth = i, B.format = o, B.type = y, B.generateMipMaps = a, B.samplingMode = d, r ? B.is3D = !0 : B.is2DArray = !0, this._doNotHandleContextLost || (B._bufferView = t), r ? this.updateRawTexture3D(B, t, o, s, p, y) : this.updateRawTexture2DArray(B, t, o, s, p, y), this._bindTextureDirectly(P, B, !0);\n            var F = this._getSamplingParameters(d, a);\n            return this._gl.texParameteri(P, this._gl.TEXTURE_MAG_FILTER, F.mag), this._gl.texParameteri(P, this._gl.TEXTURE_MIN_FILTER, F.min), a && this._gl.generateMipmap(P), this._bindTextureDirectly(P, null), this._internalTexturesCache.push(B), B;\n          };\n        }\n        function tl(r) {\n          return function(t, e, n, i, o, a) {\n            o === void 0 && (o = null), a === void 0 && (a = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var s = r ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY, d = this._getWebGLTextureType(a), p = this._getInternalFormat(n), y = this._getRGBABufferInternalSizedFormat(a, n);\n            this._bindTextureDirectly(s, t, !0), this._unpackFlipY(i === void 0 || !!i), this._doNotHandleContextLost || (t._bufferView = e, t.format = n, t.invertY = i, t._compression = o), t.width % 4 != 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), o && e ? this._gl.compressedTexImage3D(s, 0, this.getCaps().s3tc[o], t.width, t.height, t.depth, 0, e) : this._gl.texImage3D(s, 0, y, t.width, t.height, t.depth, 0, p, d, e), t.generateMipMaps && this._gl.generateMipmap(s), this._bindTextureDirectly(s, null), t.isReady = !0;\n          };\n        }\n        wt.a.prototype.updateRawTexture = function(r, t, e, n, i, o) {\n          if (i === void 0 && (i = null), o === void 0 && (o = h.a.TEXTURETYPE_UNSIGNED_INT), r) {\n            var a = this._getRGBABufferInternalSizedFormat(o, e), s = this._getInternalFormat(e), d = this._getWebGLTextureType(o);\n            this._bindTextureDirectly(this._gl.TEXTURE_2D, r, !0), this._unpackFlipY(n === void 0 || !!n), this._doNotHandleContextLost || (r._bufferView = t, r.format = e, r.type = o, r.invertY = n, r._compression = i), r.width % 4 != 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), i && t ? this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[i], r.width, r.height, 0, t) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, a, r.width, r.height, 0, s, d, t), r.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), r.isReady = !0;\n          }\n        }, wt.a.prototype.createRawTexture = function(r, t, e, n, i, o, a, s, d) {\n          s === void 0 && (s = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n          var p = new Pt.a(this, Pt.b.Raw);\n          p.baseWidth = t, p.baseHeight = e, p.width = t, p.height = e, p.format = n, p.generateMipMaps = i, p.samplingMode = a, p.invertY = o, p._compression = s, p.type = d, this._doNotHandleContextLost || (p._bufferView = r), this.updateRawTexture(p, r, n, o, s, d), this._bindTextureDirectly(this._gl.TEXTURE_2D, p, !0);\n          var y = this._getSamplingParameters(a, i);\n          return this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, y.mag), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, y.min), i && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._internalTexturesCache.push(p), p;\n        }, wt.a.prototype.createRawCubeTexture = function(r, t, e, n, i, o, a, s) {\n          s === void 0 && (s = null);\n          var d = this._gl, p = new Pt.a(this, Pt.b.CubeRaw);\n          p.isCube = !0, p.format = e, p.type = n, this._doNotHandleContextLost || (p._bufferViewArray = r);\n          var y = this._getWebGLTextureType(n), P = this._getInternalFormat(e);\n          P === d.RGB && (P = d.RGBA), y !== d.FLOAT || this._caps.textureFloatLinearFiltering ? y !== this._gl.HALF_FLOAT_OES || this._caps.textureHalfFloatLinearFiltering ? y !== d.FLOAT || this._caps.textureFloatRender ? y !== d.HALF_FLOAT || this._caps.colorBufferFloat || (i = !1, l.a.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\")) : (i = !1, l.a.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\")) : (i = !1, a = h.a.TEXTURE_NEAREST_SAMPLINGMODE, l.a.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\")) : (i = !1, a = h.a.TEXTURE_NEAREST_SAMPLINGMODE, l.a.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\"));\n          var R = t, B = R;\n          p.width = R, p.height = B, !this.needPOTTextures || Xe.b.IsExponentOfTwo(p.width) && Xe.b.IsExponentOfTwo(p.height) || (i = !1), r && this.updateRawCubeTexture(p, r, e, n, o, s), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, p, !0), r && i && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);\n          var F = this._getSamplingParameters(a, i);\n          return d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_MAG_FILTER, F.mag), d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_MIN_FILTER, F.min), d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_WRAP_S, d.CLAMP_TO_EDGE), d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_WRAP_T, d.CLAMP_TO_EDGE), this._bindTextureDirectly(d.TEXTURE_CUBE_MAP, null), p.generateMipMaps = i, p;\n        }, wt.a.prototype.updateRawCubeTexture = function(r, t, e, n, i, o, a) {\n          o === void 0 && (o = null), a === void 0 && (a = 0), r._bufferViewArray = t, r.format = e, r.type = n, r.invertY = i, r._compression = o;\n          var s = this._gl, d = this._getWebGLTextureType(n), p = this._getInternalFormat(e), y = this._getRGBABufferInternalSizedFormat(n), P = !1;\n          p === s.RGB && (p = s.RGBA, P = !0), this._bindTextureDirectly(s.TEXTURE_CUBE_MAP, r, !0), this._unpackFlipY(i === void 0 || !!i), r.width % 4 != 0 && s.pixelStorei(s.UNPACK_ALIGNMENT, 1);\n          for (var R = 0; R < 6; R++) {\n            var B = t[R];\n            o ? s.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + R, a, this.getCaps().s3tc[o], r.width, r.height, 0, B) : (P && (B = $c(B, r.width, r.height, n)), s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + R, a, y, r.width, r.height, 0, p, d, B));\n          }\n          (!this.needPOTTextures || Xe.b.IsExponentOfTwo(r.width) && Xe.b.IsExponentOfTwo(r.height)) && r.generateMipMaps && a === 0 && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), r.isReady = !0;\n        }, wt.a.prototype.createRawCubeTextureFromUrl = function(r, t, e, n, i, o, a, s, d, p, y, P) {\n          var R = this;\n          d === void 0 && (d = null), p === void 0 && (p = null), y === void 0 && (y = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), P === void 0 && (P = !1);\n          var B = this._gl, F = this.createRawCubeTexture(null, e, n, i, !o, P, y, null);\n          return t == null || t._addPendingData(F), F.url = r, this._internalTexturesCache.push(F), this._loadFile(r, function(z) {\n            (function(J) {\n              var ie = F.width, se = a(J);\n              if (se) {\n                if (s) {\n                  var ce = R._getWebGLTextureType(i), ue = R._getInternalFormat(n), fe = R._getRGBABufferInternalSizedFormat(i), ve = !1;\n                  ue === B.RGB && (ue = B.RGBA, ve = !0), R._bindTextureDirectly(B.TEXTURE_CUBE_MAP, F, !0), R._unpackFlipY(!1);\n                  for (var Te = s(se), Re = 0; Re < Te.length; Re++)\n                    for (var Ae = ie >> Re, Ee = 0; Ee < 6; Ee++) {\n                      var Se = Te[Re][Ee];\n                      ve && (Se = $c(Se, Ae, Ae, i)), B.texImage2D(Ee, Re, fe, Ae, Ae, 0, ue, ce, Se);\n                    }\n                  R._bindTextureDirectly(B.TEXTURE_CUBE_MAP, null);\n                } else\n                  R.updateRawCubeTexture(F, se, n, i, P);\n                F.isReady = !0, t == null || t._removePendingData(F), d && d();\n              }\n            })(z);\n          }, void 0, t == null ? void 0 : t.offlineProvider, !0, function(z, J) {\n            t == null || t._removePendingData(F), p && z && p(z.status + \" \" + z.statusText, J);\n          }), F;\n        }, wt.a.prototype.createRawTexture2DArray = el(!1), wt.a.prototype.createRawTexture3D = el(!0), wt.a.prototype.updateRawTexture2DArray = tl(!1), wt.a.prototype.updateRawTexture3D = tl(!0);\n        var Zn = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            s === void 0 && (s = !0), d === void 0 && (d = !1), p === void 0 && (p = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var P = r.call(this, null, a, !s, d) || this;\n            return P.format = o, P._engine && (P._texture = P._engine.createRawTexture(e, n, i, o, s, d, p, null, y), P.wrapU = Ne.a.CLAMP_ADDRESSMODE, P.wrapV = Ne.a.CLAMP_ADDRESSMODE), P;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e) {\n            this._getEngine().updateRawTexture(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);\n          }, t.CreateLuminanceTexture = function(e, n, i, o, a, s, d) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), new t(e, n, i, h.a.TEXTUREFORMAT_LUMINANCE, o, a, s, d);\n          }, t.CreateLuminanceAlphaTexture = function(e, n, i, o, a, s, d) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), new t(e, n, i, h.a.TEXTUREFORMAT_LUMINANCE_ALPHA, o, a, s, d);\n          }, t.CreateAlphaTexture = function(e, n, i, o, a, s, d) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), new t(e, n, i, h.a.TEXTUREFORMAT_ALPHA, o, a, s, d);\n          }, t.CreateRGBTexture = function(e, n, i, o, a, s, d, p) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), new t(e, n, i, h.a.TEXTUREFORMAT_RGB, o, a, s, d, p);\n          }, t.CreateRGBATexture = function(e, n, i, o, a, s, d, p) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), new t(e, n, i, h.a.TEXTUREFORMAT_RGBA, o, a, s, d, p);\n          }, t.CreateRTexture = function(e, n, i, o, a, s, d, p) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = Ne.a.TRILINEAR_SAMPLINGMODE), p === void 0 && (p = h.a.TEXTURETYPE_FLOAT), new t(e, n, i, h.a.TEXTUREFORMAT_R, o, a, s, d, p);\n          }, t;\n        }(Ne.a), Ao = function() {\n          function r(t, e, n) {\n            this.name = t, this.id = e, this.bones = new Array(), this.needInitialSkinMatrix = !1, this.overrideMesh = null, this._isDirty = !0, this._meshesWithPoseMatrix = new Array(), this._identity = u.a.Identity(), this._ranges = {}, this._lastAbsoluteTransformsUpdateId = -1, this._canUseTextureForBones = !1, this._uniqueId = 0, this._numBonesWithLinkedTransformNode = 0, this._hasWaitingData = null, this._waitingOverrideMeshId = null, this.doNotSerialize = !1, this._useTextureToStoreBoneMatrices = !0, this._animationPropertiesOverride = null, this.onBeforeComputeObservable = new C.c(), this.bones = [], this._scene = n || te.a.LastCreatedScene, this._uniqueId = this._scene.getUniqueId(), this._scene.addSkeleton(this), this._isDirty = !0;\n            var i = this._scene.getEngine().getCaps();\n            this._canUseTextureForBones = i.textureFloat && i.maxVertexTextureImageUnits > 0;\n          }\n          return Object.defineProperty(r.prototype, \"useTextureToStoreBoneMatrices\", { get: function() {\n            return this._useTextureToStoreBoneMatrices;\n          }, set: function(t) {\n            this._useTextureToStoreBoneMatrices = t, this._markAsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;\n          }, set: function(t) {\n            this._animationPropertiesOverride = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isUsingTextureForMatrices\", { get: function() {\n            return this.useTextureToStoreBoneMatrices && this._canUseTextureForBones;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"Skeleton\";\n          }, r.prototype.getChildren = function() {\n            return this.bones.filter(function(t) {\n              return !t.getParent();\n            });\n          }, r.prototype.getTransformMatrices = function(t) {\n            return this.needInitialSkinMatrix && t._bonesTransformMatrices ? t._bonesTransformMatrices : (this._transformMatrices || this.prepare(), this._transformMatrices);\n          }, r.prototype.getTransformMatrixTexture = function(t) {\n            return this.needInitialSkinMatrix && t._transformMatrixTexture ? t._transformMatrixTexture : this._transformMatrixTexture;\n          }, r.prototype.getScene = function() {\n            return this._scene;\n          }, r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name + \", nBones: \" + this.bones.length;\n            if (e += \", nAnimationRanges: \" + (this._ranges ? Object.keys(this._ranges).length : \"none\"), t) {\n              e += \", Ranges: {\";\n              var n = !0;\n              for (var i in this._ranges)\n                n && (e += \", \", n = !1), e += i;\n              e += \"}\";\n            }\n            return e;\n          }, r.prototype.getBoneIndexByName = function(t) {\n            for (var e = 0, n = this.bones.length; e < n; e++)\n              if (this.bones[e].name === t)\n                return e;\n            return -1;\n          }, r.prototype.createAnimationRange = function(t, e, n) {\n            if (!this._ranges[t]) {\n              this._ranges[t] = new G(t, e, n);\n              for (var i = 0, o = this.bones.length; i < o; i++)\n                this.bones[i].animations[0] && this.bones[i].animations[0].createRange(t, e, n);\n            }\n          }, r.prototype.deleteAnimationRange = function(t, e) {\n            e === void 0 && (e = !0);\n            for (var n = 0, i = this.bones.length; n < i; n++)\n              this.bones[n].animations[0] && this.bones[n].animations[0].deleteRange(t, e);\n            this._ranges[t] = null;\n          }, r.prototype.getAnimationRange = function(t) {\n            return this._ranges[t] || null;\n          }, r.prototype.getAnimationRanges = function() {\n            var t, e = [];\n            for (t in this._ranges)\n              e.push(this._ranges[t]);\n            return e;\n          }, r.prototype.copyAnimationRange = function(t, e, n) {\n            if (n === void 0 && (n = !1), this._ranges[e] || !t.getAnimationRange(e))\n              return !1;\n            var i, o, a = !0, s = this._getHighestAnimationFrame() + 1, d = {}, p = t.bones;\n            for (o = 0, i = p.length; o < i; o++)\n              d[p[o].name] = p[o];\n            this.bones.length !== p.length && (l.a.Warn(\"copyAnimationRange: this rig has \" + this.bones.length + \" bones, while source as \" + p.length), a = !1);\n            var y = n && this.dimensionsAtRest && t.dimensionsAtRest ? this.dimensionsAtRest.divide(t.dimensionsAtRest) : null;\n            for (o = 0, i = this.bones.length; o < i; o++) {\n              var P = this.bones[o].name, R = d[P];\n              R ? a = a && this.bones[o].copyAnimationRange(R, e, s, n, y) : (l.a.Warn(\"copyAnimationRange: not same rig, missing source bone \" + P), a = !1);\n            }\n            var B = t.getAnimationRange(e);\n            return B && (this._ranges[e] = new G(e, B.from + s, B.to + s)), a;\n          }, r.prototype.returnToRest = function() {\n            for (var t = u.c.Vector3[0], e = u.c.Quaternion[0], n = u.c.Vector3[1], i = 0; i < this.bones.length; i++) {\n              var o = this.bones[i];\n              o._index !== -1 && (o.returnToRest(), o._linkedTransformNode && (o.getRestPose().decompose(t, e, n), o._linkedTransformNode.position = n.clone(), o._linkedTransformNode.rotationQuaternion = e.clone(), o._linkedTransformNode.scaling = t.clone()));\n            }\n          }, r.prototype._getHighestAnimationFrame = function() {\n            for (var t = 0, e = 0, n = this.bones.length; e < n; e++)\n              if (this.bones[e].animations[0]) {\n                var i = this.bones[e].animations[0].getHighestFrame();\n                t < i && (t = i);\n              }\n            return t;\n          }, r.prototype.beginAnimation = function(t, e, n, i) {\n            var o = this.getAnimationRange(t);\n            return o ? this._scene.beginAnimation(this, o.from, o.to, e, n, i) : null;\n          }, r.MakeAnimationAdditive = function(t, e, n) {\n            e === void 0 && (e = 0);\n            var i = t.getAnimationRange(n);\n            if (!i)\n              return null;\n            for (var o = t._scene.getAllAnimatablesByTarget(t), a = null, s = 0; s < o.length; s++) {\n              var d = o[s];\n              if (d.fromFrame === (i == null ? void 0 : i.from) && d.toFrame === (i == null ? void 0 : i.to)) {\n                a = d;\n                break;\n              }\n            }\n            var p = t.getAnimatables();\n            for (s = 0; s < p.length; s++) {\n              var y = p[s].animations;\n              if (y)\n                for (var P = 0; P < y.length; P++)\n                  k.MakeAnimationAdditive(y[P], e, n);\n            }\n            return a && (a.isAdditive = !0), t;\n          }, r.prototype._markAsDirty = function() {\n            this._isDirty = !0;\n          }, r.prototype._registerMeshWithPoseMatrix = function(t) {\n            this._meshesWithPoseMatrix.push(t);\n          }, r.prototype._unregisterMeshWithPoseMatrix = function(t) {\n            var e = this._meshesWithPoseMatrix.indexOf(t);\n            e > -1 && this._meshesWithPoseMatrix.splice(e, 1);\n          }, r.prototype._computeTransformMatrices = function(t, e) {\n            this.onBeforeComputeObservable.notifyObservers(this);\n            for (var n = 0; n < this.bones.length; n++) {\n              var i = this.bones[n];\n              i._childUpdateId++;\n              var o = i.getParent();\n              if (o ? i.getLocalMatrix().multiplyToRef(o.getWorldMatrix(), i.getWorldMatrix()) : e ? i.getLocalMatrix().multiplyToRef(e, i.getWorldMatrix()) : i.getWorldMatrix().copyFrom(i.getLocalMatrix()), i._index !== -1) {\n                var a = i._index === null ? n : i._index;\n                i.getInvertedAbsoluteTransform().multiplyToArray(i.getWorldMatrix(), t, 16 * a);\n              }\n            }\n            this._identity.copyToArray(t, 16 * this.bones.length);\n          }, r.prototype.prepare = function() {\n            if (this._numBonesWithLinkedTransformNode > 0)\n              for (var t = 0, e = this.bones; t < e.length; t++) {\n                var n = e[t];\n                n._linkedTransformNode && (n._linkedTransformNode.computeWorldMatrix(), n._matrix = n._linkedTransformNode._localMatrix, n.markAsDirty());\n              }\n            if (this._isDirty) {\n              if (this.needInitialSkinMatrix)\n                for (var i = 0; i < this._meshesWithPoseMatrix.length; i++) {\n                  var o = this._meshesWithPoseMatrix[i], a = o.getPoseMatrix();\n                  if (o._bonesTransformMatrices && o._bonesTransformMatrices.length === 16 * (this.bones.length + 1) || (o._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1))), this._synchronizedWithMesh !== o) {\n                    this._synchronizedWithMesh = o;\n                    for (var s = 0; s < this.bones.length; s++) {\n                      var d = this.bones[s];\n                      d.getParent() || (d.getBaseMatrix().multiplyToRef(a, u.c.Matrix[1]), d._updateDifferenceMatrix(u.c.Matrix[1]));\n                    }\n                    if (this.isUsingTextureForMatrices) {\n                      var p = 4 * (this.bones.length + 1);\n                      o._transformMatrixTexture && o._transformMatrixTexture.getSize().width === p || (o._transformMatrixTexture && o._transformMatrixTexture.dispose(), o._transformMatrixTexture = Zn.CreateRGBATexture(o._bonesTransformMatrices, 4 * (this.bones.length + 1), 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT));\n                    }\n                  }\n                  this._computeTransformMatrices(o._bonesTransformMatrices, a), this.isUsingTextureForMatrices && o._transformMatrixTexture && o._transformMatrixTexture.update(o._bonesTransformMatrices);\n                }\n              else\n                this._transformMatrices && this._transformMatrices.length === 16 * (this.bones.length + 1) || (this._transformMatrices = new Float32Array(16 * (this.bones.length + 1)), this.isUsingTextureForMatrices && (this._transformMatrixTexture && this._transformMatrixTexture.dispose(), this._transformMatrixTexture = Zn.CreateRGBATexture(this._transformMatrices, 4 * (this.bones.length + 1), 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT))), this._computeTransformMatrices(this._transformMatrices, null), this.isUsingTextureForMatrices && this._transformMatrixTexture && this._transformMatrixTexture.update(this._transformMatrices);\n              this._isDirty = !1, this._scene._activeBones.addCount(this.bones.length, !1);\n            }\n          }, r.prototype.getAnimatables = function() {\n            if (!this._animatables || this._animatables.length !== this.bones.length) {\n              this._animatables = [];\n              for (var t = 0; t < this.bones.length; t++)\n                this._animatables.push(this.bones[t]);\n            }\n            return this._animatables;\n          }, r.prototype.clone = function(t, e) {\n            var n = new r(t, e || t, this._scene);\n            n.needInitialSkinMatrix = this.needInitialSkinMatrix, n.overrideMesh = this.overrideMesh;\n            for (var i = 0; i < this.bones.length; i++) {\n              var o = this.bones[i], a = null, s = o.getParent();\n              if (s) {\n                var d = this.bones.indexOf(s);\n                a = n.bones[d];\n              }\n              var p = new Fe(o.name, n, a, o.getBaseMatrix().clone(), o.getRestPose().clone());\n              p._index = o._index, o._linkedTransformNode && p.linkTransformNode(o._linkedTransformNode), de.a.DeepCopy(o.animations, p.animations);\n            }\n            if (this._ranges)\n              for (var y in n._ranges = {}, this._ranges) {\n                var P = this._ranges[y];\n                P && (n._ranges[y] = P.clone());\n              }\n            return this._isDirty = !0, n;\n          }, r.prototype.enableBlending = function(t) {\n            t === void 0 && (t = 0.01), this.bones.forEach(function(e) {\n              e.animations.forEach(function(n) {\n                n.enableBlending = !0, n.blendingSpeed = t;\n              });\n            });\n          }, r.prototype.dispose = function() {\n            this._meshesWithPoseMatrix = [], this.getScene().stopAnimation(this), this.getScene().removeSkeleton(this), this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null);\n          }, r.prototype.serialize = function() {\n            var t, e, n = {};\n            n.name = this.name, n.id = this.id, this.dimensionsAtRest && (n.dimensionsAtRest = this.dimensionsAtRest.asArray()), n.bones = [], n.needInitialSkinMatrix = this.needInitialSkinMatrix, n.overrideMeshId = (t = this.overrideMesh) === null || t === void 0 ? void 0 : t.id;\n            for (var i = 0; i < this.bones.length; i++) {\n              var o = this.bones[i], a = o.getParent(), s = { parentBoneIndex: a ? this.bones.indexOf(a) : -1, index: o.getIndex(), name: o.name, matrix: o.getBaseMatrix().toArray(), rest: o.getRestPose().toArray(), linkedTransformNodeId: (e = o.getTransformNode()) === null || e === void 0 ? void 0 : e.id };\n              for (var d in n.bones.push(s), o.length && (s.length = o.length), o.metadata && (s.metadata = o.metadata), o.animations && o.animations.length > 0 && (s.animation = o.animations[0].serialize()), n.ranges = [], this._ranges) {\n                var p = this._ranges[d];\n                if (p) {\n                  var y = {};\n                  y.name = d, y.from = p.from, y.to = p.to, n.ranges.push(y);\n                }\n              }\n            }\n            return n;\n          }, r.Parse = function(t, e) {\n            var n, i = new r(t.name, t.id, e);\n            for (t.dimensionsAtRest && (i.dimensionsAtRest = u.e.FromArray(t.dimensionsAtRest)), i.needInitialSkinMatrix = t.needInitialSkinMatrix, t.overrideMeshId && (i._hasWaitingData = !0, i._waitingOverrideMeshId = t.overrideMeshId), n = 0; n < t.bones.length; n++) {\n              var o = t.bones[n], a = t.bones[n].index, s = null;\n              o.parentBoneIndex > -1 && (s = i.bones[o.parentBoneIndex]);\n              var d = o.rest ? u.a.FromArray(o.rest) : null, p = new Fe(o.name, i, s, u.a.FromArray(o.matrix), d, null, a);\n              o.id !== void 0 && o.id !== null && (p.id = o.id), o.length && (p.length = o.length), o.metadata && (p.metadata = o.metadata), o.animation && p.animations.push(k.Parse(o.animation)), o.linkedTransformNodeId !== void 0 && o.linkedTransformNodeId !== null && (i._hasWaitingData = !0, p._waitingTransformNodeId = o.linkedTransformNodeId);\n            }\n            if (t.ranges)\n              for (n = 0; n < t.ranges.length; n++) {\n                var y = t.ranges[n];\n                i.createAnimationRange(y.name, y.from, y.to);\n              }\n            return i;\n          }, r.prototype.computeAbsoluteTransforms = function(t) {\n            t === void 0 && (t = !1);\n            var e = this._scene.getRenderId();\n            (this._lastAbsoluteTransformsUpdateId != e || t) && (this.bones[0].computeAbsoluteTransforms(), this._lastAbsoluteTransformsUpdateId = e);\n          }, r.prototype.getPoseMatrix = function() {\n            var t = null;\n            return this._meshesWithPoseMatrix.length > 0 && (t = this._meshesWithPoseMatrix[0].getPoseMatrix()), t;\n          }, r.prototype.sortBones = function() {\n            for (var t = new Array(), e = new Array(this.bones.length), n = 0; n < this.bones.length; n++)\n              this._sortBones(n, t, e);\n            this.bones = t;\n          }, r.prototype._sortBones = function(t, e, n) {\n            if (!n[t]) {\n              n[t] = !0;\n              var i = this.bones[t];\n              i._index === void 0 && (i._index = t);\n              var o = i.getParent();\n              o && this._sortBones(this.bones.indexOf(o), e, n), e.push(i);\n            }\n          }, r.prototype.setCurrentPoseAsRest = function() {\n            this.bones.forEach(function(t) {\n              t.setCurrentPoseAsRest();\n            });\n          }, r;\n        }(), un = {}, zr = function() {\n          function r(t) {\n            this.attachedToElement = !1, this.attached = {}, this.camera = t, this.checkInputs = function() {\n            };\n          }\n          return r.prototype.add = function(t) {\n            var e = t.getSimpleName();\n            this.attached[e] ? l.a.Warn(\"camera input of type \" + e + \" already exists on camera\") : (this.attached[e] = t, t.camera = this.camera, t.checkInputs && (this.checkInputs = this._addCheckInputs(t.checkInputs.bind(t))), this.attachedToElement && t.attachControl());\n          }, r.prototype.remove = function(t) {\n            for (var e in this.attached) {\n              var n = this.attached[e];\n              n === t && (n.detachControl(), n.camera = null, delete this.attached[e], this.rebuildInputCheck());\n            }\n          }, r.prototype.removeByType = function(t) {\n            for (var e in this.attached) {\n              var n = this.attached[e];\n              n.getClassName() === t && (n.detachControl(), n.camera = null, delete this.attached[e], this.rebuildInputCheck());\n            }\n          }, r.prototype._addCheckInputs = function(t) {\n            var e = this.checkInputs;\n            return function() {\n              e(), t();\n            };\n          }, r.prototype.attachInput = function(t) {\n            this.attachedToElement && t.attachControl(this.noPreventDefault);\n          }, r.prototype.attachElement = function(t) {\n            if (t === void 0 && (t = !1), !this.attachedToElement)\n              for (var e in t = !_t.a.ForceAttachControlToAlwaysPreventDefault && t, this.attachedToElement = !0, this.noPreventDefault = t, this.attached)\n                this.attached[e].attachControl(t);\n          }, r.prototype.detachElement = function(t) {\n            for (var e in t === void 0 && (t = !1), this.attached)\n              this.attached[e].detachControl(), t && (this.attached[e].camera = null);\n            this.attachedToElement = !1;\n          }, r.prototype.rebuildInputCheck = function() {\n            for (var t in this.checkInputs = function() {\n            }, this.attached) {\n              var e = this.attached[t];\n              e.checkInputs && (this.checkInputs = this._addCheckInputs(e.checkInputs.bind(e)));\n            }\n          }, r.prototype.clear = function() {\n            this.attachedToElement && this.detachElement(!0), this.attached = {}, this.attachedToElement = !1, this.checkInputs = function() {\n            };\n          }, r.prototype.serialize = function(t) {\n            var e = {};\n            for (var n in this.attached) {\n              var i = this.attached[n], o = L.a.Serialize(i);\n              e[i.getClassName()] = o;\n            }\n            t.inputsmgr = e;\n          }, r.prototype.parse = function(t) {\n            var e = t.inputsmgr;\n            if (e) {\n              for (var n in this.clear(), e)\n                if (a = un[n]) {\n                  var i = e[n], o = L.a.Parse(function() {\n                    return new a();\n                  }, i, null);\n                  this.add(o);\n                }\n            } else\n              for (var n in this.attached) {\n                var a;\n                (a = un[this.attached[n].getClassName()]) && (o = L.a.Parse(function() {\n                  return new a();\n                }, t, null), this.remove(this.attached[n]), this.add(o));\n              }\n          }, r;\n        }(), _f = function(r, t) {\n          this.x = r, this.y = t;\n        }, hn = function() {\n          function r(t, e, n, i, o, a, s) {\n            i === void 0 && (i = 0), o === void 0 && (o = 1), a === void 0 && (a = 2), s === void 0 && (s = 3), this.id = t, this.index = e, this.browserGamepad = n, this._leftStick = { x: 0, y: 0 }, this._rightStick = { x: 0, y: 0 }, this._isConnected = !0, this._invertLeftStickY = !1, this.type = r.GAMEPAD, this._leftStickAxisX = i, this._leftStickAxisY = o, this._rightStickAxisX = a, this._rightStickAxisY = s, this.browserGamepad.axes.length >= 2 && (this._leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }), this.browserGamepad.axes.length >= 4 && (this._rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });\n          }\n          return Object.defineProperty(r.prototype, \"isConnected\", { get: function() {\n            return this._isConnected;\n          }, enumerable: !1, configurable: !0 }), r.prototype.onleftstickchanged = function(t) {\n            this._onleftstickchanged = t;\n          }, r.prototype.onrightstickchanged = function(t) {\n            this._onrightstickchanged = t;\n          }, Object.defineProperty(r.prototype, \"leftStick\", { get: function() {\n            return this._leftStick;\n          }, set: function(t) {\n            !this._onleftstickchanged || this._leftStick.x === t.x && this._leftStick.y === t.y || this._onleftstickchanged(t), this._leftStick = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightStick\", { get: function() {\n            return this._rightStick;\n          }, set: function(t) {\n            !this._onrightstickchanged || this._rightStick.x === t.x && this._rightStick.y === t.y || this._onrightstickchanged(t), this._rightStick = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.update = function() {\n            this._leftStick && (this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }, this._invertLeftStickY && (this.leftStick.y *= -1)), this._rightStick && (this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });\n          }, r.prototype.dispose = function() {\n          }, r.GAMEPAD = 0, r.GENERIC = 1, r.XBOX = 2, r.POSE_ENABLED = 3, r.DUALSHOCK = 4, r;\n        }(), nl = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.onButtonDownObservable = new C.c(), o.onButtonUpObservable = new C.c(), o.type = hn.GENERIC, o._buttons = new Array(i.buttons.length), o;\n          }\n          return Object(c.d)(t, r), t.prototype.onbuttondown = function(e) {\n            this._onbuttondown = e;\n          }, t.prototype.onbuttonup = function(e) {\n            this._onbuttonup = e;\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), e === 0 && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e;\n          }, t.prototype.update = function() {\n            r.prototype.update.call(this);\n            for (var e = 0; e < this._buttons.length; e++)\n              this._buttons[e] = this._setButtonValue(this.browserGamepad.buttons[e].value, this._buttons[e], e);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear();\n          }, t;\n        }(hn), Da = function() {\n          function r() {\n            this.gamepadRotationSensibility = 80, this.gamepadMoveSensibility = 40, this._yAxisScale = 1;\n          }\n          return Object.defineProperty(r.prototype, \"invertYAxis\", { get: function() {\n            return this._yAxisScale !== 1;\n          }, set: function(t) {\n            this._yAxisScale = t ? -1 : 1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachControl = function() {\n            var t = this, e = this.camera.getScene().gamepadManager;\n            this._onGamepadConnectedObserver = e.onGamepadConnectedObservable.add(function(n) {\n              n.type !== hn.POSE_ENABLED && (t.gamepad && n.type !== hn.XBOX || (t.gamepad = n));\n            }), this._onGamepadDisconnectedObserver = e.onGamepadDisconnectedObservable.add(function(n) {\n              t.gamepad === n && (t.gamepad = null);\n            }), this.gamepad = e.getGamepadByType(hn.XBOX);\n          }, r.prototype.detachControl = function(t) {\n            this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;\n          }, r.prototype.checkInputs = function() {\n            if (this.gamepad) {\n              var t = this.camera, e = this.gamepad.rightStick;\n              if (e) {\n                if (e.x != 0) {\n                  var n = e.x / this.gamepadRotationSensibility;\n                  n != 0 && Math.abs(n) > 5e-3 && (t.inertialAlphaOffset += n);\n                }\n                if (e.y != 0) {\n                  var i = e.y / this.gamepadRotationSensibility * this._yAxisScale;\n                  i != 0 && Math.abs(i) > 5e-3 && (t.inertialBetaOffset += i);\n                }\n              }\n              var o = this.gamepad.leftStick;\n              if (o && o.y != 0) {\n                var a = o.y / this.gamepadMoveSensibility;\n                a != 0 && Math.abs(a) > 5e-3 && (this.camera.inertialRadiusOffset -= a);\n              }\n            }\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraGamepadInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"gamepad\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"gamepadRotationSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"gamepadMoveSensibility\", void 0), r;\n        }();\n        un.ArcRotateCameraGamepadInput = Da;\n        var zi = f(66), La = function() {\n          function r() {\n            this.keysUp = [38], this.keysDown = [40], this.keysLeft = [37], this.keysRight = [39], this.keysReset = [220], this.panningSensibility = 50, this.zoomingSensibility = 25, this.useAltToZoom = !0, this.angularSpeed = 0.01, this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              o.metaKey || (n.type === zi.a.KEYDOWN ? (e._ctrlPressed = o.ctrlKey, e._altPressed = o.altKey, (e.keysUp.indexOf(o.keyCode) !== -1 || e.keysDown.indexOf(o.keyCode) !== -1 || e.keysLeft.indexOf(o.keyCode) !== -1 || e.keysRight.indexOf(o.keyCode) !== -1 || e.keysReset.indexOf(o.keyCode) !== -1) && ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), o.preventDefault && (t || o.preventDefault()))) : e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 && e.keysReset.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), o.preventDefault && (t || o.preventDefault())));\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.checkInputs = function() {\n            if (this._onKeyboardObserver)\n              for (var t = this.camera, e = 0; e < this._keys.length; e++) {\n                var n = this._keys[e];\n                this.keysLeft.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningX -= 1 / this.panningSensibility : t.inertialAlphaOffset -= this.angularSpeed : this.keysUp.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningY += 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? t.inertialRadiusOffset += 1 / this.zoomingSensibility : t.inertialBetaOffset -= this.angularSpeed : this.keysRight.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningX += 1 / this.panningSensibility : t.inertialAlphaOffset += this.angularSpeed : this.keysDown.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningY -= 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? t.inertialRadiusOffset -= 1 / this.zoomingSensibility : t.inertialBetaOffset += this.angularSpeed : this.keysReset.indexOf(n) !== -1 && t.useInputToRestoreState && t.restoreState();\n              }\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraKeyboardMoveInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysUp\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDown\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysLeft\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRight\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysReset\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"panningSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"zoomingSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"useAltToZoom\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"angularSpeed\", void 0), r;\n        }();\n        un.ArcRotateCameraKeyboardMoveInput = La;\n        var Na = function() {\n          function r() {\n            this.wheelPrecision = 3, this.wheelDeltaPercentage = 0;\n          }\n          return r.prototype.computeDeltaFromMouseWheelLegacyEvent = function(t, e) {\n            var n = 0.01 * t * this.wheelDeltaPercentage * e;\n            return t > 0 ? n / (1 + this.wheelDeltaPercentage) : n * (1 + this.wheelDeltaPercentage);\n          }, r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._wheel = function(n, i) {\n              if (n.type === yt.a.POINTERWHEEL) {\n                var o = n.event, a = 0, s = o, d = 0;\n                if (d = s.wheelDelta ? s.wheelDelta : 60 * -(o.deltaY || o.detail), e.wheelDeltaPercentage) {\n                  if ((a = e.computeDeltaFromMouseWheelLegacyEvent(d, e.camera.radius)) > 0) {\n                    for (var p = e.camera.radius, y = e.camera.inertialRadiusOffset + a, P = 0; P < 20 && Math.abs(y) > 1e-3; P++)\n                      p -= y, y *= e.camera.inertia;\n                    p = $.a.Clamp(p, 0, Number.MAX_VALUE), a = e.computeDeltaFromMouseWheelLegacyEvent(d, p);\n                  }\n                } else\n                  a = d / (40 * e.wheelPrecision);\n                a && (e.camera.inertialRadiusOffset += a), o.preventDefault && (t || o.preventDefault());\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, yt.a.POINTERWHEEL);\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null);\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraMouseWheelInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mousewheel\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecision\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelDeltaPercentage\", void 0), r;\n        }();\n        un.ArcRotateCameraMouseWheelInput = Na;\n        var il = function() {\n          function r() {\n            this.buttons = [0, 1, 2];\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments);\n            var n = this.camera.getEngine(), i = n.getInputElement(), o = 0, a = null;\n            this.pointA = null, this.pointB = null, this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0, this._pointerInput = function(d, p) {\n              var y = d.event, P = y.pointerType === \"touch\";\n              if (!n.isInVRExclusivePointerMode && (d.type === yt.a.POINTERMOVE || e.buttons.indexOf(y.button) !== -1)) {\n                var R = y.srcElement || y.target;\n                if (e._altKey = y.altKey, e._ctrlKey = y.ctrlKey, e._metaKey = y.metaKey, e._shiftKey = y.shiftKey, e._buttonsPressed = y.buttons, n.isPointerLock) {\n                  var B = y.movementX || y.mozMovementX || y.webkitMovementX || y.msMovementX || 0, F = y.movementY || y.mozMovementY || y.webkitMovementY || y.msMovementY || 0;\n                  e.onTouch(null, B, F), e.pointA = null, e.pointB = null;\n                } else if (d.type === yt.a.POINTERDOWN && R) {\n                  try {\n                    R.setPointerCapture(y.pointerId);\n                  } catch {\n                  }\n                  e.pointA === null ? e.pointA = { x: y.clientX, y: y.clientY, pointerId: y.pointerId, type: y.pointerType } : e.pointB === null && (e.pointB = { x: y.clientX, y: y.clientY, pointerId: y.pointerId, type: y.pointerType }), e.onButtonDown(y), t || (y.preventDefault(), i && i.focus());\n                } else if (d.type === yt.a.POINTERDOUBLETAP)\n                  e.onDoubleTap(y.pointerType);\n                else if (d.type === yt.a.POINTERUP && R) {\n                  try {\n                    R.releasePointerCapture(y.pointerId);\n                  } catch {\n                  }\n                  P || (e.pointB = null), n._badOS ? e.pointA = e.pointB = null : e.pointB && e.pointA && e.pointA.pointerId == y.pointerId ? (e.pointA = e.pointB, e.pointB = null) : e.pointA && e.pointB && e.pointB.pointerId == y.pointerId ? e.pointB = null : e.pointA = e.pointB = null, (o !== 0 || a) && (e.onMultiTouch(e.pointA, e.pointB, o, 0, a, null), o = 0, a = null), e.onButtonUp(y), t || y.preventDefault();\n                } else if (d.type === yt.a.POINTERMOVE) {\n                  if (t || y.preventDefault(), e.pointA && e.pointB === null)\n                    B = y.clientX - e.pointA.x, F = y.clientY - e.pointA.y, e.onTouch(e.pointA, B, F), e.pointA.x = y.clientX, e.pointA.y = y.clientY;\n                  else if (e.pointA && e.pointB) {\n                    var z = e.pointA.pointerId === y.pointerId ? e.pointA : e.pointB;\n                    z.x = y.clientX, z.y = y.clientY;\n                    var J = e.pointA.x - e.pointB.x, ie = e.pointA.y - e.pointB.y, se = J * J + ie * ie, ce = { x: (e.pointA.x + e.pointB.x) / 2, y: (e.pointA.y + e.pointB.y) / 2, pointerId: y.pointerId, type: d.type };\n                    e.onMultiTouch(e.pointA, e.pointB, o, se, a, ce), a = ce, o = se;\n                  }\n                }\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), this._onLostFocus = function() {\n              e.pointA = e.pointB = null, o = 0, a = null, e.onLostFocus();\n            }, i && i.addEventListener(\"contextmenu\", this.onContextMenu.bind(this), !1);\n            var s = this.camera.getScene().getEngine().getHostWindow();\n            s && Xe.b.RegisterTopRootEvents(s, [{ name: \"blur\", handler: this._onLostFocus }]);\n          }, r.prototype.detachControl = function(t) {\n            if (this._onLostFocus) {\n              var e = this.camera.getScene().getEngine().getHostWindow();\n              e && Xe.b.UnregisterTopRootEvents(e, [{ name: \"blur\", handler: this._onLostFocus }]);\n            }\n            if (this._observer) {\n              if (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this.onContextMenu) {\n                var n = this.camera.getScene().getEngine().getInputElement();\n                n && n.removeEventListener(\"contextmenu\", this.onContextMenu);\n              }\n              this._onLostFocus = null;\n            }\n            this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0;\n          }, r.prototype.getClassName = function() {\n            return \"BaseCameraPointersInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"pointers\";\n          }, r.prototype.onDoubleTap = function(t) {\n          }, r.prototype.onTouch = function(t, e, n) {\n          }, r.prototype.onMultiTouch = function(t, e, n, i, o, a) {\n          }, r.prototype.onContextMenu = function(t) {\n            t.preventDefault();\n          }, r.prototype.onButtonDown = function(t) {\n          }, r.prototype.onButtonUp = function(t) {\n          }, r.prototype.onLostFocus = function() {\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"buttons\", void 0), r;\n        }(), wa = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e.buttons = [0, 1, 2], e.angularSensibilityX = 1e3, e.angularSensibilityY = 1e3, e.pinchPrecision = 12, e.pinchDeltaPercentage = 0, e.useNaturalPinchZoom = !1, e.panningSensibility = 1e3, e.multiTouchPanning = !0, e.multiTouchPanAndZoom = !0, e.pinchInwards = !0, e._isPanClick = !1, e._twoFingerActivityCount = 0, e._isPinching = !1, e;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ArcRotateCameraPointersInput\";\n          }, t.prototype.onTouch = function(e, n, i) {\n            this.panningSensibility !== 0 && (this._ctrlKey && this.camera._useCtrlForPanning || this._isPanClick) ? (this.camera.inertialPanningX += -n / this.panningSensibility, this.camera.inertialPanningY += i / this.panningSensibility) : (this.camera.inertialAlphaOffset -= n / this.angularSensibilityX, this.camera.inertialBetaOffset -= i / this.angularSensibilityY);\n          }, t.prototype.onDoubleTap = function(e) {\n            this.camera.useInputToRestoreState && this.camera.restoreState();\n          }, t.prototype.onMultiTouch = function(e, n, i, o, a, s) {\n            if (!(i === 0 && a === null || o === 0 && s === null)) {\n              var d = this.pinchInwards ? 1 : -1;\n              if (this.multiTouchPanAndZoom) {\n                if (this.useNaturalPinchZoom ? this.camera.radius = this.camera.radius * Math.sqrt(i) / Math.sqrt(o) : this.pinchDeltaPercentage ? this.camera.inertialRadiusOffset += 1e-3 * (o - i) * this.camera.radius * this.pinchDeltaPercentage : this.camera.inertialRadiusOffset += (o - i) / (this.pinchPrecision * d * (this.angularSensibilityX + this.angularSensibilityY) / 2), this.panningSensibility !== 0 && a && s) {\n                  var p = s.x - a.x, y = s.y - a.y;\n                  this.camera.inertialPanningX += -p / this.panningSensibility, this.camera.inertialPanningY += y / this.panningSensibility;\n                }\n              } else {\n                this._twoFingerActivityCount++;\n                var P = Math.sqrt(i), R = Math.sqrt(o);\n                this._isPinching || this._twoFingerActivityCount < 20 && Math.abs(R - P) > this.camera.pinchToPanMaxDistance ? (this.pinchDeltaPercentage ? this.camera.inertialRadiusOffset += 1e-3 * (o - i) * this.camera.radius * this.pinchDeltaPercentage : this.camera.inertialRadiusOffset += (o - i) / (this.pinchPrecision * d * (this.angularSensibilityX + this.angularSensibilityY) / 2), this._isPinching = !0) : this.panningSensibility !== 0 && this.multiTouchPanning && s && a && (p = s.x - a.x, y = s.y - a.y, this.camera.inertialPanningX += -p / this.panningSensibility, this.camera.inertialPanningY += y / this.panningSensibility);\n              }\n            }\n          }, t.prototype.onButtonDown = function(e) {\n            this._isPanClick = e.button === this.camera._panningMouseButton;\n          }, t.prototype.onButtonUp = function(e) {\n            this._twoFingerActivityCount = 0, this._isPinching = !1;\n          }, t.prototype.onLostFocus = function() {\n            this._isPanClick = !1, this._twoFingerActivityCount = 0, this._isPinching = !1;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"buttons\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityX\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityY\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchPrecision\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchDeltaPercentage\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useNaturalPinchZoom\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"panningSensibility\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"multiTouchPanning\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"multiTouchPanAndZoom\", void 0), t;\n        }(il);\n        un.ArcRotateCameraPointersInput = wa;\n        var Po = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.addMouseWheel = function() {\n            return this.add(new Na()), this;\n          }, t.prototype.addPointers = function() {\n            return this.add(new wa()), this;\n          }, t.prototype.addKeyboard = function() {\n            return this.add(new La()), this;\n          }, t;\n        }(zr);\n        Po.prototype.addVRDeviceOrientation = function() {\n          return this.add(new Fa()), this;\n        };\n        var Fa = function() {\n          function r() {\n            this.alphaCorrection = 1, this.gammaCorrection = 1, this._alpha = 0, this._gamma = 0, this._dirty = !1, this._deviceOrientationHandler = this._onOrientationEvent.bind(this);\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.camera.attachControl(t);\n            var n = this.camera.getScene().getEngine().getHostWindow();\n            n && (typeof DeviceOrientationEvent < \"u\" && typeof DeviceOrientationEvent.requestPermission == \"function\" ? DeviceOrientationEvent.requestPermission().then(function(i) {\n              i === \"granted\" ? n.addEventListener(\"deviceorientation\", e._deviceOrientationHandler) : Xe.b.Warn(\"Permission not granted.\");\n            }).catch(function(i) {\n              Xe.b.Error(i);\n            }) : n.addEventListener(\"deviceorientation\", this._deviceOrientationHandler));\n          }, r.prototype._onOrientationEvent = function(t) {\n            t.alpha !== null && (this._alpha = (0 | +t.alpha) * this.alphaCorrection), t.gamma !== null && (this._gamma = (0 | +t.gamma) * this.gammaCorrection), this._dirty = !0;\n          }, r.prototype.checkInputs = function() {\n            this._dirty && (this._dirty = !1, this._gamma < 0 && (this._gamma = 180 + this._gamma), this.camera.alpha = -this._alpha / 180 * Math.PI % Math.PI * 2, this.camera.beta = this._gamma / 180 * Math.PI);\n          }, r.prototype.detachControl = function(t) {\n            window.removeEventListener(\"deviceorientation\", this._deviceOrientationHandler);\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraVRDeviceOrientationInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"VRDeviceOrientation\";\n          }, r;\n        }();\n        un.ArcRotateCameraVRDeviceOrientationInput = Fa;\n        var Ba = function() {\n          function r() {\n            this.keysForward = [87], this.keysBackward = [83], this.keysUp = [69], this.keysDown = [81], this.keysRight = [68], this.keysLeft = [65], this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              n.type === zi.a.KEYDOWN ? e.keysForward.indexOf(o.keyCode) === -1 && e.keysBackward.indexOf(o.keyCode) === -1 && e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), t || o.preventDefault()) : e.keysForward.indexOf(o.keyCode) === -1 && e.keysBackward.indexOf(o.keyCode) === -1 && e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), t || o.preventDefault());\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.getClassName = function() {\n            return \"FlyCameraKeyboardInput\";\n          }, r.prototype._onLostFocus = function(t) {\n            this._keys = [];\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, r.prototype.checkInputs = function() {\n            if (this._onKeyboardObserver)\n              for (var t = this.camera, e = 0; e < this._keys.length; e++) {\n                var n = this._keys[e], i = t._computeLocalCameraSpeed();\n                this.keysForward.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, i) : this.keysBackward.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, -i) : this.keysUp.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, i, 0) : this.keysDown.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, -i, 0) : this.keysRight.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(i, 0, 0) : this.keysLeft.indexOf(n) !== -1 && t._localDirection.copyFromFloats(-i, 0, 0), t.getScene().useRightHandedSystem && (t._localDirection.z *= -1), t.getViewMatrix().invertToRef(t._cameraTransformMatrix), u.e.TransformNormalToRef(t._localDirection, t._cameraTransformMatrix, t._transformedDirection), t.cameraDirection.addInPlace(t._transformedDirection);\n              }\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysForward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysBackward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysUp\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDown\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRight\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysLeft\", void 0), r;\n        }();\n        un.FlyCameraKeyboardInput = Ba;\n        var Ua = function() {\n          function r(t) {\n            this.buttons = [0, 1, 2], this.buttonsYaw = [-1, 0, 1], this.buttonsPitch = [-1, 0, 1], this.buttonsRoll = [2], this.activeButton = -1, this.angularSensibility = 1e3, this.previousPosition = null;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.noPreventDefault = t, this._observer = this.camera.getScene().onPointerObservable.add(function(n, i) {\n              e._pointerInput(n, i);\n            }, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), this._rollObserver = this.camera.getScene().onBeforeRenderObservable.add(function() {\n              e.camera.rollCorrect && e.camera.restoreRoll(e.camera.rollCorrect);\n            });\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver), this._observer = null, this._rollObserver = null, this.previousPosition = null, this.noPreventDefault = void 0);\n          }, r.prototype.getClassName = function() {\n            return \"FlyCameraMouseInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mouse\";\n          }, r.prototype._pointerInput = function(t, e) {\n            var n = t.event, i = this.camera.getEngine();\n            if (!i.isInVRExclusivePointerMode && (this.touchEnabled || n.pointerType !== \"touch\") && (t.type === yt.a.POINTERMOVE || this.buttons.indexOf(n.button) !== -1)) {\n              var o = n.srcElement || n.target;\n              if (t.type === yt.a.POINTERDOWN && o) {\n                try {\n                  o.setPointerCapture(n.pointerId);\n                } catch {\n                }\n                this.previousPosition = { x: n.clientX, y: n.clientY }, this.activeButton = n.button, this.noPreventDefault || (n.preventDefault(), this.element.focus()), i.isPointerLock && this._onMouseMove(t.event);\n              } else if (t.type === yt.a.POINTERUP && o) {\n                try {\n                  o.releasePointerCapture(n.pointerId);\n                } catch {\n                }\n                this.activeButton = -1, this.previousPosition = null, this.noPreventDefault || n.preventDefault();\n              } else if (t.type === yt.a.POINTERMOVE) {\n                if (!this.previousPosition)\n                  return void (i.isPointerLock && this._onMouseMove(t.event));\n                var a = n.clientX - this.previousPosition.x, s = n.clientY - this.previousPosition.y;\n                this.rotateCamera(a, s), this.previousPosition = { x: n.clientX, y: n.clientY }, this.noPreventDefault || n.preventDefault();\n              }\n            }\n          }, r.prototype._onMouseMove = function(t) {\n            var e = this.camera.getEngine();\n            if (e.isPointerLock && !e.isInVRExclusivePointerMode) {\n              var n = t.movementX || t.mozMovementX || t.webkitMovementX || t.msMovementX || 0, i = t.movementY || t.mozMovementY || t.webkitMovementY || t.msMovementY || 0;\n              this.rotateCamera(n, i), this.previousPosition = null, this.noPreventDefault || t.preventDefault();\n            }\n          }, r.prototype.rotateCamera = function(t, e) {\n            var n = this, i = this.camera;\n            this.camera.getScene().useRightHandedSystem && (t *= -1), i.parent && i.parent._getWorldMatrixDeterminant() < 0 && (t *= -1);\n            var o, a = t / this.angularSensibility, s = e / this.angularSensibility, d = u.b.RotationYawPitchRoll(i.rotation.y, i.rotation.x, i.rotation.z);\n            if (this.buttonsPitch.some(function(P) {\n              return P === n.activeButton;\n            }) && (o = u.b.RotationAxis(be.a.X, s), d.multiplyInPlace(o)), this.buttonsYaw.some(function(P) {\n              return P === n.activeButton;\n            })) {\n              o = u.b.RotationAxis(be.a.Y, a), d.multiplyInPlace(o);\n              var p = i.bankedTurnLimit + i._trackRoll;\n              if (i.bankedTurn && -p < i.rotation.z && i.rotation.z < p) {\n                var y = i.bankedTurnMultiplier * -a;\n                o = u.b.RotationAxis(be.a.Z, y), d.multiplyInPlace(o);\n              }\n            }\n            this.buttonsRoll.some(function(P) {\n              return P === n.activeButton;\n            }) && (o = u.b.RotationAxis(be.a.Z, -a), i._trackRoll -= a, d.multiplyInPlace(o)), d.toEulerAnglesToRef(i.rotation);\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"buttons\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"angularSensibility\", void 0), r;\n        }();\n        un.FlyCameraMouseInput = Ua;\n        var Va = function() {\n          function r() {\n            this.keysHeightOffsetIncr = [38], this.keysHeightOffsetDecr = [40], this.keysHeightOffsetModifierAlt = !1, this.keysHeightOffsetModifierCtrl = !1, this.keysHeightOffsetModifierShift = !1, this.keysRotationOffsetIncr = [37], this.keysRotationOffsetDecr = [39], this.keysRotationOffsetModifierAlt = !1, this.keysRotationOffsetModifierCtrl = !1, this.keysRotationOffsetModifierShift = !1, this.keysRadiusIncr = [40], this.keysRadiusDecr = [38], this.keysRadiusModifierAlt = !0, this.keysRadiusModifierCtrl = !1, this.keysRadiusModifierShift = !1, this.heightSensibility = 1, this.rotationSensibility = 1, this.radiusSensibility = 1, this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              o.metaKey || (n.type === zi.a.KEYDOWN ? (e._ctrlPressed = o.ctrlKey, e._altPressed = o.altKey, e._shiftPressed = o.shiftKey, (e.keysHeightOffsetIncr.indexOf(o.keyCode) !== -1 || e.keysHeightOffsetDecr.indexOf(o.keyCode) !== -1 || e.keysRotationOffsetIncr.indexOf(o.keyCode) !== -1 || e.keysRotationOffsetDecr.indexOf(o.keyCode) !== -1 || e.keysRadiusIncr.indexOf(o.keyCode) !== -1 || e.keysRadiusDecr.indexOf(o.keyCode) !== -1) && ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), o.preventDefault && (t || o.preventDefault()))) : e.keysHeightOffsetIncr.indexOf(o.keyCode) === -1 && e.keysHeightOffsetDecr.indexOf(o.keyCode) === -1 && e.keysRotationOffsetIncr.indexOf(o.keyCode) === -1 && e.keysRotationOffsetDecr.indexOf(o.keyCode) === -1 && e.keysRadiusIncr.indexOf(o.keyCode) === -1 && e.keysRadiusDecr.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), o.preventDefault && (t || o.preventDefault())));\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.checkInputs = function() {\n            var t = this;\n            this._onKeyboardObserver && this._keys.forEach(function(e) {\n              t.keysHeightOffsetIncr.indexOf(e) !== -1 && t._modifierHeightOffset() ? t.camera.heightOffset += t.heightSensibility : t.keysHeightOffsetDecr.indexOf(e) !== -1 && t._modifierHeightOffset() ? t.camera.heightOffset -= t.heightSensibility : t.keysRotationOffsetIncr.indexOf(e) !== -1 && t._modifierRotationOffset() ? (t.camera.rotationOffset += t.rotationSensibility, t.camera.rotationOffset %= 360) : t.keysRotationOffsetDecr.indexOf(e) !== -1 && t._modifierRotationOffset() ? (t.camera.rotationOffset -= t.rotationSensibility, t.camera.rotationOffset %= 360) : t.keysRadiusIncr.indexOf(e) !== -1 && t._modifierRadius() ? t.camera.radius += t.radiusSensibility : t.keysRadiusDecr.indexOf(e) !== -1 && t._modifierRadius() && (t.camera.radius -= t.radiusSensibility);\n            });\n          }, r.prototype.getClassName = function() {\n            return \"FollowCameraKeyboardMoveInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, r.prototype._modifierHeightOffset = function() {\n            return this.keysHeightOffsetModifierAlt === this._altPressed && this.keysHeightOffsetModifierCtrl === this._ctrlPressed && this.keysHeightOffsetModifierShift === this._shiftPressed;\n          }, r.prototype._modifierRotationOffset = function() {\n            return this.keysRotationOffsetModifierAlt === this._altPressed && this.keysRotationOffsetModifierCtrl === this._ctrlPressed && this.keysRotationOffsetModifierShift === this._shiftPressed;\n          }, r.prototype._modifierRadius = function() {\n            return this.keysRadiusModifierAlt === this._altPressed && this.keysRadiusModifierCtrl === this._ctrlPressed && this.keysRadiusModifierShift === this._shiftPressed;\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetIncr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetDecr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetModifierAlt\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetModifierCtrl\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetModifierShift\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetIncr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetDecr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetModifierAlt\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetModifierCtrl\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetModifierShift\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusIncr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusDecr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusModifierAlt\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusModifierCtrl\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusModifierShift\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"heightSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"rotationSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"radiusSensibility\", void 0), r;\n        }();\n        un.FollowCameraKeyboardMoveInput = Va;\n        var ka = function() {\n          function r() {\n            this.axisControlRadius = !0, this.axisControlHeight = !1, this.axisControlRotation = !1, this.wheelPrecision = 3, this.wheelDeltaPercentage = 0;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._wheel = function(n, i) {\n              if (n.type === yt.a.POINTERWHEEL) {\n                var o = n.event, a = 0, s = Math.max(-1, Math.min(1, o.deltaY || o.wheelDelta || -o.detail));\n                e.wheelDeltaPercentage ? (console.assert(e.axisControlRadius + e.axisControlHeight + e.axisControlRotation <= 1, \"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: \" + e.axisControlRadius + \", axisControlHeightOffset: \" + e.axisControlHeight + \", axisControlRotationOffset: \" + e.axisControlRotation), e.axisControlRadius ? a = 0.01 * s * e.wheelDeltaPercentage * e.camera.radius : e.axisControlHeight ? a = 0.01 * s * e.wheelDeltaPercentage * e.camera.heightOffset : e.axisControlRotation && (a = 0.01 * s * e.wheelDeltaPercentage * e.camera.rotationOffset)) : a = s * e.wheelPrecision, a && (e.axisControlRadius ? e.camera.radius += a : e.axisControlHeight ? e.camera.heightOffset -= a : e.axisControlRotation && (e.camera.rotationOffset -= a)), o.preventDefault && (t || o.preventDefault());\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, yt.a.POINTERWHEEL);\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null);\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraMouseWheelInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mousewheel\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"axisControlRadius\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"axisControlHeight\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"axisControlRotation\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecision\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelDeltaPercentage\", void 0), r;\n        }();\n        un.FollowCameraMouseWheelInput = ka;\n        var Ga = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e.angularSensibilityX = 1, e.angularSensibilityY = 1, e.pinchPrecision = 1e4, e.pinchDeltaPercentage = 0, e.axisXControlRadius = !1, e.axisXControlHeight = !1, e.axisXControlRotation = !0, e.axisYControlRadius = !1, e.axisYControlHeight = !0, e.axisYControlRotation = !1, e.axisPinchControlRadius = !0, e.axisPinchControlHeight = !1, e.axisPinchControlRotation = !1, e.warningEnable = !0, e._warningCounter = 0, e;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FollowCameraPointersInput\";\n          }, t.prototype.onTouch = function(e, n, i) {\n            this._warning(), this.axisXControlRotation ? this.camera.rotationOffset += n / this.angularSensibilityX : this.axisYControlRotation && (this.camera.rotationOffset += i / this.angularSensibilityX), this.axisXControlHeight ? this.camera.heightOffset += n / this.angularSensibilityY : this.axisYControlHeight && (this.camera.heightOffset += i / this.angularSensibilityY), this.axisXControlRadius ? this.camera.radius -= n / this.angularSensibilityY : this.axisYControlRadius && (this.camera.radius -= i / this.angularSensibilityY);\n          }, t.prototype.onMultiTouch = function(e, n, i, o, a, s) {\n            if (!(i === 0 && a === null || o === 0 && s === null)) {\n              var d = (o - i) / (this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY) / 2);\n              this.pinchDeltaPercentage ? (d *= 0.01 * this.pinchDeltaPercentage, this.axisPinchControlRotation && (this.camera.rotationOffset += d * this.camera.rotationOffset), this.axisPinchControlHeight && (this.camera.heightOffset += d * this.camera.heightOffset), this.axisPinchControlRadius && (this.camera.radius -= d * this.camera.radius)) : (this.axisPinchControlRotation && (this.camera.rotationOffset += d), this.axisPinchControlHeight && (this.camera.heightOffset += d), this.axisPinchControlRadius && (this.camera.radius -= d));\n            }\n          }, t.prototype._warning = function() {\n            if (this.warningEnable && this._warningCounter++ % 100 == 0) {\n              var e = \"It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: \";\n              console.assert(this.axisXControlRotation + this.axisXControlHeight + this.axisXControlRadius <= 1, e + \"axisXControlRotation: \" + this.axisXControlRotation + \", axisXControlHeight: \" + this.axisXControlHeight + \", axisXControlRadius: \" + this.axisXControlRadius), console.assert(this.axisYControlRotation + this.axisYControlHeight + this.axisYControlRadius <= 1, e + \"axisYControlRotation: \" + this.axisYControlRotation + \", axisYControlHeight: \" + this.axisYControlHeight + \", axisYControlRadius: \" + this.axisYControlRadius), console.assert(this.axisPinchControlRotation + this.axisPinchControlHeight + this.axisPinchControlRadius <= 1, e + \"axisPinchControlRotation: \" + this.axisPinchControlRotation + \", axisPinchControlHeight: \" + this.axisPinchControlHeight + \", axisPinchControlRadius: \" + this.axisPinchControlRadius);\n            }\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityX\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityY\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchPrecision\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchDeltaPercentage\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisXControlRadius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisXControlHeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisXControlRotation\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisYControlRadius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisYControlHeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisYControlRotation\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisPinchControlRadius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisPinchControlHeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisPinchControlRotation\", void 0), t;\n        }(il);\n        un.FollowCameraPointersInput = Ga;\n        var za = function() {\n          function r() {\n            this.keysUp = [38], this.keysUpward = [33], this.keysDown = [40], this.keysDownward = [34], this.keysLeft = [37], this.keysRight = [39], this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              o.metaKey || (n.type === zi.a.KEYDOWN ? e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 && e.keysUpward.indexOf(o.keyCode) === -1 && e.keysDownward.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), t || o.preventDefault()) : e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 && e.keysUpward.indexOf(o.keyCode) === -1 && e.keysDownward.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), t || o.preventDefault()));\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.checkInputs = function() {\n            if (this._onKeyboardObserver)\n              for (var t = this.camera, e = 0; e < this._keys.length; e++) {\n                var n = this._keys[e], i = t._computeLocalCameraSpeed();\n                this.keysLeft.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(-i, 0, 0) : this.keysUp.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, i) : this.keysRight.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(i, 0, 0) : this.keysDown.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, -i) : this.keysUpward.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, i, 0) : this.keysDownward.indexOf(n) !== -1 && t._localDirection.copyFromFloats(0, -i, 0), t.getScene().useRightHandedSystem && (t._localDirection.z *= -1), t.getViewMatrix().invertToRef(t._cameraTransformMatrix), u.e.TransformNormalToRef(t._localDirection, t._cameraTransformMatrix, t._transformedDirection), t.cameraDirection.addInPlace(t._transformedDirection);\n              }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraKeyboardMoveInput\";\n          }, r.prototype._onLostFocus = function() {\n            this._keys = [];\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysUp\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysUpward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDown\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDownward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysLeft\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRight\", void 0), r;\n        }();\n        un.FreeCameraKeyboardMoveInput = za;\n        var ja = function() {\n          function r(t) {\n            t === void 0 && (t = !0), this.touchEnabled = t, this.buttons = [0, 1, 2], this.angularSensibility = 2e3, this.previousPosition = null, this.onPointerMovedObservable = new C.c(), this._allowCameraRotation = !0;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments);\n            var n = this.camera.getEngine(), i = n.getInputElement();\n            this._pointerInput || (this._pointerInput = function(o) {\n              var a = o.event;\n              if (!n.isInVRExclusivePointerMode && (e.touchEnabled || a.pointerType !== \"touch\") && (o.type === yt.a.POINTERMOVE || e.buttons.indexOf(a.button) !== -1)) {\n                var s = a.srcElement || a.target;\n                if (o.type === yt.a.POINTERDOWN && s) {\n                  try {\n                    s.setPointerCapture(a.pointerId);\n                  } catch {\n                  }\n                  e.previousPosition = { x: a.clientX, y: a.clientY }, t || (a.preventDefault(), i && i.focus()), n.isPointerLock && e._onMouseMove && e._onMouseMove(o.event);\n                } else if (o.type === yt.a.POINTERUP && s) {\n                  try {\n                    s.releasePointerCapture(a.pointerId);\n                  } catch {\n                  }\n                  e.previousPosition = null, t || a.preventDefault();\n                } else if (o.type === yt.a.POINTERMOVE) {\n                  if (!e.previousPosition)\n                    return void (n.isPointerLock && e._onMouseMove && e._onMouseMove(o.event));\n                  var d = a.clientX - e.previousPosition.x, p = a.clientY - e.previousPosition.y;\n                  e.camera.getScene().useRightHandedSystem && (d *= -1), e.camera.parent && e.camera.parent._getWorldMatrixDeterminant() < 0 && (d *= -1), e._allowCameraRotation && (e.camera.cameraRotation.y += d / e.angularSensibility, e.camera.cameraRotation.x += p / e.angularSensibility), e.onPointerMovedObservable.notifyObservers({ offsetX: d, offsetY: p }), e.previousPosition = { x: a.clientX, y: a.clientY }, t || a.preventDefault();\n                }\n              }\n            }), this._onMouseMove = function(o) {\n              if (n.isPointerLock && !n.isInVRExclusivePointerMode) {\n                var a = o.movementX || o.mozMovementX || o.webkitMovementX || o.msMovementX || 0;\n                e.camera.getScene().useRightHandedSystem && (a *= -1), e.camera.parent && e.camera.parent._getWorldMatrixDeterminant() < 0 && (a *= -1), e.camera.cameraRotation.y += a / e.angularSensibility;\n                var s = o.movementY || o.mozMovementY || o.webkitMovementY || o.msMovementY || 0;\n                e.camera.cameraRotation.x += s / e.angularSensibility, e.previousPosition = null, t || o.preventDefault();\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), i && i.addEventListener(\"contextmenu\", this.onContextMenu.bind(this), !1);\n          }, r.prototype.onContextMenu = function(t) {\n            t.preventDefault();\n          }, r.prototype.detachControl = function(t) {\n            if (this._observer) {\n              if (this.camera.getScene().onPointerObservable.remove(this._observer), this.onContextMenu) {\n                var e = this.camera.getEngine().getInputElement();\n                e && e.removeEventListener(\"contextmenu\", this.onContextMenu);\n              }\n              this.onPointerMovedObservable && this.onPointerMovedObservable.clear(), this._observer = null, this._onMouseMove = null, this.previousPosition = null;\n            }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraMouseInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mouse\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"buttons\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"angularSensibility\", void 0), r;\n        }();\n        un.FreeCameraMouseInput = ja;\n        var Ut, mf = function() {\n          function r() {\n            this.wheelPrecisionX = 3, this.wheelPrecisionY = 3, this.wheelPrecisionZ = 3, this.onChangedObservable = new C.c(), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0, this._ffMultiplier = 12, this._normalize = 120;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._wheel = function(n) {\n              if (n.type === yt.a.POINTERWHEEL) {\n                var i = n.event, o = i.deltaMode === WheelEvent.DOM_DELTA_LINE ? e._ffMultiplier : 1;\n                i.deltaY !== void 0 ? (e._wheelDeltaX += e.wheelPrecisionX * o * i.deltaX / e._normalize, e._wheelDeltaY -= e.wheelPrecisionY * o * i.deltaY / e._normalize, e._wheelDeltaZ += e.wheelPrecisionZ * o * i.deltaZ / e._normalize) : i.wheelDeltaY !== void 0 ? (e._wheelDeltaX += e.wheelPrecisionX * o * i.wheelDeltaX / e._normalize, e._wheelDeltaY -= e.wheelPrecisionY * o * i.wheelDeltaY / e._normalize, e._wheelDeltaZ += e.wheelPrecisionZ * o * i.wheelDeltaZ / e._normalize) : i.wheelDelta && (e._wheelDeltaY -= e.wheelPrecisionY * i.wheelDelta / e._normalize), i.preventDefault && (t || i.preventDefault());\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, yt.a.POINTERWHEEL);\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null), this.onChangedObservable && this.onChangedObservable.clear();\n          }, r.prototype.checkInputs = function() {\n            this.onChangedObservable.notifyObservers({ wheelDeltaX: this._wheelDeltaX, wheelDeltaY: this._wheelDeltaY, wheelDeltaZ: this._wheelDeltaZ }), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0;\n          }, r.prototype.getClassName = function() {\n            return \"BaseCameraMouseWheelInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mousewheel\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecisionX\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecisionY\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecisionZ\", void 0), r;\n        }();\n        (function(r) {\n          r[r.MoveRelative = 0] = \"MoveRelative\", r[r.RotateRelative = 1] = \"RotateRelative\", r[r.MoveScene = 2] = \"MoveScene\";\n        })(Ut || (Ut = {}));\n        var Ha = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e._moveRelative = u.e.Zero(), e._rotateRelative = u.e.Zero(), e._moveScene = u.e.Zero(), e._wheelXAction = Ut.MoveRelative, e._wheelXActionCoordinate = be.b.X, e._wheelYAction = Ut.MoveRelative, e._wheelYActionCoordinate = be.b.Z, e._wheelZAction = null, e._wheelZActionCoordinate = null, e;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FreeCameraMouseWheelInput\";\n          }, Object.defineProperty(t.prototype, \"wheelXMoveRelative\", { get: function() {\n            return this._wheelXAction !== Ut.MoveRelative ? null : this._wheelXActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelXAction !== Ut.MoveRelative || (this._wheelXAction = Ut.MoveRelative, this._wheelXActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelYMoveRelative\", { get: function() {\n            return this._wheelYAction !== Ut.MoveRelative ? null : this._wheelYActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelYAction !== Ut.MoveRelative || (this._wheelYAction = Ut.MoveRelative, this._wheelYActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelZMoveRelative\", { get: function() {\n            return this._wheelZAction !== Ut.MoveRelative ? null : this._wheelZActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelZAction !== Ut.MoveRelative || (this._wheelZAction = Ut.MoveRelative, this._wheelZActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelXRotateRelative\", { get: function() {\n            return this._wheelXAction !== Ut.RotateRelative ? null : this._wheelXActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelXAction !== Ut.RotateRelative || (this._wheelXAction = Ut.RotateRelative, this._wheelXActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelYRotateRelative\", { get: function() {\n            return this._wheelYAction !== Ut.RotateRelative ? null : this._wheelYActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelYAction !== Ut.RotateRelative || (this._wheelYAction = Ut.RotateRelative, this._wheelYActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelZRotateRelative\", { get: function() {\n            return this._wheelZAction !== Ut.RotateRelative ? null : this._wheelZActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelZAction !== Ut.RotateRelative || (this._wheelZAction = Ut.RotateRelative, this._wheelZActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelXMoveScene\", { get: function() {\n            return this._wheelXAction !== Ut.MoveScene ? null : this._wheelXActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelXAction !== Ut.MoveScene || (this._wheelXAction = Ut.MoveScene, this._wheelXActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelYMoveScene\", { get: function() {\n            return this._wheelYAction !== Ut.MoveScene ? null : this._wheelYActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelYAction !== Ut.MoveScene || (this._wheelYAction = Ut.MoveScene, this._wheelYActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelZMoveScene\", { get: function() {\n            return this._wheelZAction !== Ut.MoveScene ? null : this._wheelZActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelZAction !== Ut.MoveScene || (this._wheelZAction = Ut.MoveScene, this._wheelZActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.checkInputs = function() {\n            if (this._wheelDeltaX !== 0 || this._wheelDeltaY !== 0 || this._wheelDeltaZ != 0) {\n              this._moveRelative.setAll(0), this._rotateRelative.setAll(0), this._moveScene.setAll(0), this._updateCamera(), this.camera.getScene().useRightHandedSystem && (this._moveRelative.z *= -1);\n              var e = u.a.Zero();\n              this.camera.getViewMatrix().invertToRef(e);\n              var n = u.e.Zero();\n              u.e.TransformNormalToRef(this._moveRelative, e, n), this.camera.cameraRotation.x += this._rotateRelative.x / 200, this.camera.cameraRotation.y += this._rotateRelative.y / 200, this.camera.cameraDirection.addInPlace(n), this.camera.cameraDirection.addInPlace(this._moveScene), r.prototype.checkInputs.call(this);\n            }\n          }, t.prototype._updateCamera = function() {\n            var e = this._moveRelative, n = this._rotateRelative, i = this._moveScene, o = function(a, s, d) {\n              if (a !== 0 && s !== null && d !== null) {\n                var p = null;\n                switch (s) {\n                  case Ut.MoveRelative:\n                    p = e;\n                    break;\n                  case Ut.RotateRelative:\n                    p = n;\n                    break;\n                  case Ut.MoveScene:\n                    p = i;\n                }\n                switch (d) {\n                  case be.b.X:\n                    p.set(a, 0, 0);\n                    break;\n                  case be.b.Y:\n                    p.set(0, a, 0);\n                    break;\n                  case be.b.Z:\n                    p.set(0, 0, a);\n                }\n              }\n            };\n            o(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate), o(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate), o(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"wheelXMoveRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelYMoveRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelZMoveRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelXRotateRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelYRotateRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelZRotateRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelXMoveScene\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelYMoveScene\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelZMoveScene\", null), t;\n        }(mf);\n        un.FreeCameraMouseWheelInput = Ha;\n        var Wa = function() {\n          function r(t) {\n            t === void 0 && (t = !1), this.allowMouse = t, this.touchAngularSensibility = 2e5, this.touchMoveSensibility = 250, this._offsetX = null, this._offsetY = null, this._pointerPressed = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments);\n            var n = null;\n            if (this._pointerInput === void 0 && (this._onLostFocus = function() {\n              e._offsetX = null, e._offsetY = null;\n            }, this._pointerInput = function(a) {\n              var s = a.event, d = !e.camera.getEngine().hostInformation.isMobile && s instanceof MouseEvent;\n              if (e.allowMouse || s.pointerType !== \"mouse\" && !d) {\n                if (a.type === yt.a.POINTERDOWN) {\n                  if (t || s.preventDefault(), e._pointerPressed.push(s.pointerId), e._pointerPressed.length !== 1)\n                    return;\n                  n = { x: s.clientX, y: s.clientY };\n                } else if (a.type === yt.a.POINTERUP) {\n                  if (t || s.preventDefault(), (p = e._pointerPressed.indexOf(s.pointerId)) === -1 || (e._pointerPressed.splice(p, 1), p != 0))\n                    return;\n                  n = null, e._offsetX = null, e._offsetY = null;\n                } else if (a.type === yt.a.POINTERMOVE) {\n                  if (t || s.preventDefault(), !n)\n                    return;\n                  var p;\n                  if ((p = e._pointerPressed.indexOf(s.pointerId)) != 0)\n                    return;\n                  e._offsetX = s.clientX - n.x, e._offsetY = -(s.clientY - n.y);\n                }\n              }\n            }), this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), this._onLostFocus) {\n              var i = this.camera.getEngine(), o = i.getInputElement();\n              o && o.addEventListener(\"blur\", this._onLostFocus);\n            }\n          }, r.prototype.detachControl = function(t) {\n            if (this._pointerInput) {\n              if (this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null), this._onLostFocus) {\n                var e = this.camera.getEngine().getInputElement();\n                e && e.removeEventListener(\"blur\", this._onLostFocus), this._onLostFocus = null;\n              }\n              this._pointerPressed = [], this._offsetX = null, this._offsetY = null;\n            }\n          }, r.prototype.checkInputs = function() {\n            if (this._offsetX !== null && this._offsetY !== null && (this._offsetX !== 0 || this._offsetY !== 0)) {\n              var t = this.camera;\n              if (t.cameraRotation.y = this._offsetX / this.touchAngularSensibility, this._pointerPressed.length > 1)\n                t.cameraRotation.x = -this._offsetY / this.touchAngularSensibility;\n              else {\n                var e = t._computeLocalCameraSpeed(), n = new u.e(0, 0, e * this._offsetY / this.touchMoveSensibility);\n                u.a.RotationYawPitchRollToRef(t.rotation.y, t.rotation.x, 0, t._cameraRotationMatrix), t.cameraDirection.addInPlace(u.e.TransformCoordinates(n, t._cameraRotationMatrix));\n              }\n            }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraTouchInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"touch\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"touchAngularSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"touchMoveSensibility\", void 0), r;\n        }();\n        un.FreeCameraTouchInput = Wa;\n        var jr = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._mouseInput = null, n._mouseWheelInput = null, n;\n          }\n          return Object(c.d)(t, r), t.prototype.addKeyboard = function() {\n            return this.add(new za()), this;\n          }, t.prototype.addMouse = function(e) {\n            return e === void 0 && (e = !0), this._mouseInput || (this._mouseInput = new ja(e), this.add(this._mouseInput)), this;\n          }, t.prototype.removeMouse = function() {\n            return this._mouseInput && this.remove(this._mouseInput), this;\n          }, t.prototype.addMouseWheel = function() {\n            return this._mouseWheelInput || (this._mouseWheelInput = new Ha(), this.add(this._mouseWheelInput)), this;\n          }, t.prototype.removeMouseWheel = function() {\n            return this._mouseWheelInput && this.remove(this._mouseWheelInput), this;\n          }, t.prototype.addTouch = function() {\n            return this.add(new Wa()), this;\n          }, t.prototype.clear = function() {\n            r.prototype.clear.call(this), this._mouseInput = null;\n          }, t;\n        }(zr);\n        jr.prototype.addDeviceOrientation = function() {\n          return this._deviceOrientationInput || (this._deviceOrientationInput = new Xa(), this.add(this._deviceOrientationInput)), this;\n        };\n        var Xa = function() {\n          function r() {\n            var t = this;\n            this._screenOrientationAngle = 0, this._screenQuaternion = new u.b(), this._alpha = 0, this._beta = 0, this._gamma = 0, this._onDeviceOrientationChangedObservable = new C.c(), this._orientationChanged = function() {\n              t._screenOrientationAngle = window.orientation !== void 0 ? +window.orientation : window.screen.orientation && window.screen.orientation.angle ? window.screen.orientation.angle : 0, t._screenOrientationAngle = -Xe.b.ToRadians(t._screenOrientationAngle / 2), t._screenQuaternion.copyFromFloats(0, Math.sin(t._screenOrientationAngle), 0, Math.cos(t._screenOrientationAngle));\n            }, this._deviceOrientation = function(e) {\n              t._alpha = e.alpha !== null ? e.alpha : 0, t._beta = e.beta !== null ? e.beta : 0, t._gamma = e.gamma !== null ? e.gamma : 0, e.alpha !== null && t._onDeviceOrientationChangedObservable.notifyObservers();\n            }, this._constantTranform = new u.b(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)), this._orientationChanged();\n          }\n          return r.WaitForOrientationChangeAsync = function(t) {\n            return new Promise(function(e, n) {\n              var i = !1, o = function() {\n                window.removeEventListener(\"deviceorientation\", o), i = !0, e();\n              };\n              t && setTimeout(function() {\n                i || (window.removeEventListener(\"deviceorientation\", o), n(\"WaitForOrientationChangeAsync timed out\"));\n              }, t), typeof DeviceOrientationEvent < \"u\" && typeof DeviceOrientationEvent.requestPermission == \"function\" ? DeviceOrientationEvent.requestPermission().then(function(a) {\n                a == \"granted\" ? window.addEventListener(\"deviceorientation\", o) : Xe.b.Warn(\"Permission not granted.\");\n              }).catch(function(a) {\n                Xe.b.Error(a);\n              }) : window.addEventListener(\"deviceorientation\", o);\n            });\n          }, Object.defineProperty(r.prototype, \"camera\", { get: function() {\n            return this._camera;\n          }, set: function(t) {\n            var e = this;\n            this._camera = t, this._camera == null || this._camera.rotationQuaternion || (this._camera.rotationQuaternion = new u.b()), this._camera && this._camera.onDisposeObservable.add(function() {\n              e._onDeviceOrientationChangedObservable.clear();\n            });\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachControl = function() {\n            var t = this, e = this.camera.getScene().getEngine().getHostWindow();\n            if (e) {\n              var n = function() {\n                e.addEventListener(\"orientationchange\", t._orientationChanged), e.addEventListener(\"deviceorientation\", t._deviceOrientation), t._orientationChanged();\n              };\n              typeof DeviceOrientationEvent < \"u\" && typeof DeviceOrientationEvent.requestPermission == \"function\" ? DeviceOrientationEvent.requestPermission().then(function(i) {\n                i === \"granted\" ? n() : Xe.b.Warn(\"Permission not granted.\");\n              }).catch(function(i) {\n                Xe.b.Error(i);\n              }) : n();\n            }\n          }, r.prototype.detachControl = function(t) {\n            window.removeEventListener(\"orientationchange\", this._orientationChanged), window.removeEventListener(\"deviceorientation\", this._deviceOrientation), this._alpha = 0;\n          }, r.prototype.checkInputs = function() {\n            this._alpha && (u.b.RotationYawPitchRollToRef(Xe.b.ToRadians(this._alpha), Xe.b.ToRadians(this._beta), -Xe.b.ToRadians(this._gamma), this.camera.rotationQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform), this._camera.rotationQuaternion.z *= -1, this._camera.rotationQuaternion.w *= -1);\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraDeviceOrientationInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"deviceOrientation\";\n          }, r;\n        }();\n        un.FreeCameraDeviceOrientationInput = Xa;\n        var Ya = function() {\n          function r() {\n            this.gamepadAngularSensibility = 200, this.gamepadMoveSensibility = 40, this._yAxisScale = 1, this._cameraTransform = u.a.Identity(), this._deltaTransform = u.e.Zero(), this._vector3 = u.e.Zero(), this._vector2 = u.d.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"invertYAxis\", { get: function() {\n            return this._yAxisScale !== 1;\n          }, set: function(t) {\n            this._yAxisScale = t ? -1 : 1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachControl = function() {\n            var t = this, e = this.camera.getScene().gamepadManager;\n            this._onGamepadConnectedObserver = e.onGamepadConnectedObservable.add(function(n) {\n              n.type !== hn.POSE_ENABLED && (t.gamepad && n.type !== hn.XBOX || (t.gamepad = n));\n            }), this._onGamepadDisconnectedObserver = e.onGamepadDisconnectedObservable.add(function(n) {\n              t.gamepad === n && (t.gamepad = null);\n            }), this.gamepad = e.getGamepadByType(hn.XBOX), !this.gamepad && e.gamepads.length && (this.gamepad = e.gamepads[0]);\n          }, r.prototype.detachControl = function(t) {\n            this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;\n          }, r.prototype.checkInputs = function() {\n            if (this.gamepad && this.gamepad.leftStick) {\n              var t = this.camera, e = this.gamepad.leftStick, n = e.x / this.gamepadMoveSensibility, i = e.y / this.gamepadMoveSensibility;\n              e.x = Math.abs(n) > 5e-3 ? 0 + n : 0, e.y = Math.abs(i) > 5e-3 ? 0 + i : 0;\n              var o = this.gamepad.rightStick;\n              if (o) {\n                var a = o.x / this.gamepadAngularSensibility, s = o.y / this.gamepadAngularSensibility * this._yAxisScale;\n                o.x = Math.abs(a) > 1e-3 ? 0 + a : 0, o.y = Math.abs(s) > 1e-3 ? 0 + s : 0;\n              } else\n                o = { x: 0, y: 0 };\n              t.rotationQuaternion ? t.rotationQuaternion.toRotationMatrix(this._cameraTransform) : u.a.RotationYawPitchRollToRef(t.rotation.y, t.rotation.x, 0, this._cameraTransform);\n              var d = 50 * t._computeLocalCameraSpeed();\n              this._vector3.copyFromFloats(e.x * d, 0, -e.y * d), u.e.TransformCoordinatesToRef(this._vector3, this._cameraTransform, this._deltaTransform), t.cameraDirection.addInPlace(this._deltaTransform), this._vector2.copyFromFloats(o.y, o.x), t.cameraRotation.addInPlace(this._vector2);\n            }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraGamepadInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"gamepad\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"gamepadAngularSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"gamepadMoveSensibility\", void 0), r;\n        }();\n        un.FreeCameraGamepadInput = Ya;\n        var rn, rl = f(112);\n        (function(r) {\n          r[r.X = 0] = \"X\", r[r.Y = 1] = \"Y\", r[r.Z = 2] = \"Z\";\n        })(rn || (rn = {}));\n        var Ka = function() {\n          function r(t, e) {\n            var n = this, i = Object(c.a)(Object(c.a)({}, r._GetDefaultOptions()), e);\n            if (this._leftJoystick = !!t, r._globalJoystickIndex++, this._axisTargetedByLeftAndRight = rn.X, this._axisTargetedByUpAndDown = rn.Y, this.reverseLeftRight = !1, this.reverseUpDown = !1, this._touches = new rl.a(), this.deltaPosition = u.e.Zero(), this._joystickSensibility = 25, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3), this._onResize = function(a) {\n              r.vjCanvasWidth = window.innerWidth, r.vjCanvasHeight = window.innerHeight, r.Canvas && (r.Canvas.width = r.vjCanvasWidth, r.Canvas.height = r.vjCanvasHeight), r.halfWidth = r.vjCanvasWidth / 2;\n            }, !r.Canvas) {\n              window.addEventListener(\"resize\", this._onResize, !1), r.Canvas = document.createElement(\"canvas\"), r.vjCanvasWidth = window.innerWidth, r.vjCanvasHeight = window.innerHeight, r.Canvas.width = window.innerWidth, r.Canvas.height = window.innerHeight, r.Canvas.style.width = \"100%\", r.Canvas.style.height = \"100%\", r.Canvas.style.position = \"absolute\", r.Canvas.style.backgroundColor = \"transparent\", r.Canvas.style.top = \"0px\", r.Canvas.style.left = \"0px\", r.Canvas.style.zIndex = \"5\", r.Canvas.style.msTouchAction = \"none\", r.Canvas.style.touchAction = \"none\", r.Canvas.setAttribute(\"touch-action\", \"none\");\n              var o = r.Canvas.getContext(\"2d\");\n              if (!o)\n                throw new Error(\"Unable to create canvas for virtual joystick\");\n              r.vjCanvasContext = o, r.vjCanvasContext.strokeStyle = \"#ffffff\", r.vjCanvasContext.lineWidth = 2, document.body.appendChild(r.Canvas);\n            }\n            r.halfWidth = r.Canvas.width / 2, this.pressed = !1, this.limitToContainer = i.limitToContainer, this._joystickColor = i.color, this.containerSize = i.containerSize, this.puckSize = i.puckSize, i.position && this.setPosition(i.position.x, i.position.y), i.puckImage && this.setPuckImage(i.puckImage), i.containerImage && this.setContainerImage(i.containerImage), i.alwaysVisible && r._alwaysVisibleSticks++, this.alwaysVisible = i.alwaysVisible, this._joystickPointerID = -1, this._joystickPointerPos = new u.d(0, 0), this._joystickPreviousPointerPos = new u.d(0, 0), this._joystickPointerStartPos = new u.d(0, 0), this._deltaJoystickVector = new u.d(0, 0), this._onPointerDownHandlerRef = function(a) {\n              n._onPointerDown(a);\n            }, this._onPointerMoveHandlerRef = function(a) {\n              n._onPointerMove(a);\n            }, this._onPointerUpHandlerRef = function(a) {\n              n._onPointerUp(a);\n            }, r.Canvas.addEventListener(\"pointerdown\", this._onPointerDownHandlerRef, !1), r.Canvas.addEventListener(\"pointermove\", this._onPointerMoveHandlerRef, !1), r.Canvas.addEventListener(\"pointerup\", this._onPointerUpHandlerRef, !1), r.Canvas.addEventListener(\"pointerout\", this._onPointerUpHandlerRef, !1), r.Canvas.addEventListener(\"contextmenu\", function(a) {\n              a.preventDefault();\n            }, !1), requestAnimationFrame(function() {\n              n._drawVirtualJoystick();\n            });\n          }\n          return r._GetDefaultOptions = function() {\n            return { puckSize: 40, containerSize: 60, color: \"cyan\", puckImage: void 0, containerImage: void 0, position: void 0, alwaysVisible: !1, limitToContainer: !1 };\n          }, r.prototype.setJoystickSensibility = function(t) {\n            this._joystickSensibility = t, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3);\n          }, r.prototype._onPointerDown = function(t) {\n            t.preventDefault(), (this._leftJoystick === !0 ? t.clientX < r.halfWidth : t.clientX > r.halfWidth) && this._joystickPointerID < 0 ? (this._joystickPointerID = t.pointerId, this._joystickPosition ? (this._joystickPointerStartPos = this._joystickPosition.clone(), this._joystickPointerPos = this._joystickPosition.clone(), this._joystickPreviousPointerPos = this._joystickPosition.clone(), this._onPointerMove(t)) : (this._joystickPointerStartPos.x = t.clientX, this._joystickPointerStartPos.y = t.clientY, this._joystickPointerPos = this._joystickPointerStartPos.clone(), this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone()), this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this.pressed = !0, this._touches.add(t.pointerId.toString(), t)) : r._globalJoystickIndex < 2 && this._action && (this._action(), this._touches.add(t.pointerId.toString(), { x: t.clientX, y: t.clientY, prevX: t.clientX, prevY: t.clientY }));\n          }, r.prototype._onPointerMove = function(t) {\n            if (this._joystickPointerID == t.pointerId) {\n              if (this.limitToContainer) {\n                var e = new u.d(t.clientX - this._joystickPointerStartPos.x, t.clientY - this._joystickPointerStartPos.y), n = e.length();\n                n > this.containerSize && e.scaleInPlace(this.containerSize / n), this._joystickPointerPos.x = this._joystickPointerStartPos.x + e.x, this._joystickPointerPos.y = this._joystickPointerStartPos.y + e.y;\n              } else\n                this._joystickPointerPos.x = t.clientX, this._joystickPointerPos.y = t.clientY;\n              this._deltaJoystickVector = this._joystickPointerPos.clone(), this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos), 0 < r._alwaysVisibleSticks && (this._leftJoystick ? this._joystickPointerPos.x = Math.min(r.halfWidth, this._joystickPointerPos.x) : this._joystickPointerPos.x = Math.max(r.halfWidth, this._joystickPointerPos.x));\n              var i = (this.reverseLeftRight ? -1 : 1) * this._deltaJoystickVector.x / this._inversedSensibility;\n              switch (this._axisTargetedByLeftAndRight) {\n                case rn.X:\n                  this.deltaPosition.x = Math.min(1, Math.max(-1, i));\n                  break;\n                case rn.Y:\n                  this.deltaPosition.y = Math.min(1, Math.max(-1, i));\n                  break;\n                case rn.Z:\n                  this.deltaPosition.z = Math.min(1, Math.max(-1, i));\n              }\n              var o = (this.reverseUpDown ? 1 : -1) * this._deltaJoystickVector.y / this._inversedSensibility;\n              switch (this._axisTargetedByUpAndDown) {\n                case rn.X:\n                  this.deltaPosition.x = Math.min(1, Math.max(-1, o));\n                  break;\n                case rn.Y:\n                  this.deltaPosition.y = Math.min(1, Math.max(-1, o));\n                  break;\n                case rn.Z:\n                  this.deltaPosition.z = Math.min(1, Math.max(-1, o));\n              }\n            } else {\n              var a = this._touches.get(t.pointerId.toString());\n              a && (a.x = t.clientX, a.y = t.clientY);\n            }\n          }, r.prototype._onPointerUp = function(t) {\n            if (this._joystickPointerID == t.pointerId)\n              this._clearPreviousDraw(), this._joystickPointerID = -1, this.pressed = !1;\n            else {\n              var e = this._touches.get(t.pointerId.toString());\n              e && r.vjCanvasContext.clearRect(e.prevX - 44, e.prevY - 44, 88, 88);\n            }\n            this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this._touches.remove(t.pointerId.toString());\n          }, r.prototype.setJoystickColor = function(t) {\n            this._joystickColor = t;\n          }, Object.defineProperty(r.prototype, \"containerSize\", { get: function() {\n            return this._joystickContainerSize;\n          }, set: function(t) {\n            this._joystickContainerSize = t, this._clearContainerSize = ~~(2.1 * this._joystickContainerSize), this._clearContainerSizeOffset = ~~(this._clearContainerSize / 2);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"puckSize\", { get: function() {\n            return this._joystickPuckSize;\n          }, set: function(t) {\n            this._joystickPuckSize = t, this._clearPuckSize = ~~(2.1 * this._joystickPuckSize), this._clearPuckSizeOffset = ~~(this._clearPuckSize / 2);\n          }, enumerable: !1, configurable: !0 }), r.prototype.clearPosition = function() {\n            this.alwaysVisible = !1, this._joystickPosition = null;\n          }, Object.defineProperty(r.prototype, \"alwaysVisible\", { get: function() {\n            return this._alwaysVisible;\n          }, set: function(t) {\n            this._alwaysVisible !== t && (t && this._joystickPosition ? (r._alwaysVisibleSticks++, this._alwaysVisible = !0) : (r._alwaysVisibleSticks--, this._alwaysVisible = !1));\n          }, enumerable: !1, configurable: !0 }), r.prototype.setPosition = function(t, e) {\n            this._joystickPointerStartPos && this._clearPreviousDraw(), this._joystickPosition = new u.d(t, e);\n          }, r.prototype.setActionOnTouch = function(t) {\n            this._action = t;\n          }, r.prototype.setAxisForLeftRight = function(t) {\n            switch (t) {\n              case rn.X:\n              case rn.Y:\n              case rn.Z:\n                this._axisTargetedByLeftAndRight = t;\n                break;\n              default:\n                this._axisTargetedByLeftAndRight = rn.X;\n            }\n          }, r.prototype.setAxisForUpDown = function(t) {\n            switch (t) {\n              case rn.X:\n              case rn.Y:\n              case rn.Z:\n                this._axisTargetedByUpAndDown = t;\n                break;\n              default:\n                this._axisTargetedByUpAndDown = rn.Y;\n            }\n          }, r.prototype._clearPreviousDraw = function() {\n            var t = this._joystickPosition || this._joystickPointerStartPos;\n            r.vjCanvasContext.clearRect(t.x - this._clearContainerSizeOffset, t.y - this._clearContainerSizeOffset, this._clearContainerSize, this._clearContainerSize), r.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x - this._clearPuckSizeOffset, this._joystickPreviousPointerPos.y - this._clearPuckSizeOffset, this._clearPuckSize, this._clearPuckSize);\n          }, r.prototype.setContainerImage = function(t) {\n            var e = this, n = new Image();\n            n.src = t, n.onload = function() {\n              return e._containerImage = n;\n            };\n          }, r.prototype.setPuckImage = function(t) {\n            var e = this, n = new Image();\n            n.src = t, n.onload = function() {\n              return e._puckImage = n;\n            };\n          }, r.prototype._drawContainer = function() {\n            var t = this._joystickPosition || this._joystickPointerStartPos;\n            this._clearPreviousDraw(), this._containerImage ? r.vjCanvasContext.drawImage(this._containerImage, t.x - this.containerSize, t.y - this.containerSize, 2 * this.containerSize, 2 * this.containerSize) : (r.vjCanvasContext.beginPath(), r.vjCanvasContext.strokeStyle = this._joystickColor, r.vjCanvasContext.lineWidth = 2, r.vjCanvasContext.arc(t.x, t.y, this.containerSize, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath(), r.vjCanvasContext.beginPath(), r.vjCanvasContext.lineWidth = 6, r.vjCanvasContext.strokeStyle = this._joystickColor, r.vjCanvasContext.arc(t.x, t.y, this.puckSize, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath());\n          }, r.prototype._drawPuck = function() {\n            this._puckImage ? r.vjCanvasContext.drawImage(this._puckImage, this._joystickPointerPos.x - this.puckSize, this._joystickPointerPos.y - this.puckSize, 2 * this.puckSize, 2 * this.puckSize) : (r.vjCanvasContext.beginPath(), r.vjCanvasContext.strokeStyle = this._joystickColor, r.vjCanvasContext.lineWidth = 2, r.vjCanvasContext.arc(this._joystickPointerPos.x, this._joystickPointerPos.y, this.puckSize, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath());\n          }, r.prototype._drawVirtualJoystick = function() {\n            var t = this;\n            this.alwaysVisible && this._drawContainer(), this.pressed && this._touches.forEach(function(e, n) {\n              n.pointerId === t._joystickPointerID ? (t.alwaysVisible || t._drawContainer(), t._drawPuck(), t._joystickPreviousPointerPos = t._joystickPointerPos.clone()) : (r.vjCanvasContext.clearRect(n.prevX - 44, n.prevY - 44, 88, 88), r.vjCanvasContext.beginPath(), r.vjCanvasContext.fillStyle = \"white\", r.vjCanvasContext.beginPath(), r.vjCanvasContext.strokeStyle = \"red\", r.vjCanvasContext.lineWidth = 6, r.vjCanvasContext.arc(n.x, n.y, 40, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath(), n.prevX = n.x, n.prevY = n.y);\n            }), requestAnimationFrame(function() {\n              t._drawVirtualJoystick();\n            });\n          }, r.prototype.releaseCanvas = function() {\n            r.Canvas && (r.Canvas.removeEventListener(\"pointerdown\", this._onPointerDownHandlerRef), r.Canvas.removeEventListener(\"pointermove\", this._onPointerMoveHandlerRef), r.Canvas.removeEventListener(\"pointerup\", this._onPointerUpHandlerRef), r.Canvas.removeEventListener(\"pointerout\", this._onPointerUpHandlerRef), window.removeEventListener(\"resize\", this._onResize), document.body.removeChild(r.Canvas), r.Canvas = null);\n          }, r._globalJoystickIndex = 0, r._alwaysVisibleSticks = 0, r;\n        }();\n        jr.prototype.addVirtualJoystick = function() {\n          return this.add(new Qa()), this;\n        };\n        var Qa = function() {\n          function r() {\n          }\n          return r.prototype.getLeftJoystick = function() {\n            return this._leftjoystick;\n          }, r.prototype.getRightJoystick = function() {\n            return this._rightjoystick;\n          }, r.prototype.checkInputs = function() {\n            if (this._leftjoystick) {\n              var t = this.camera, e = 50 * t._computeLocalCameraSpeed(), n = u.a.RotationYawPitchRoll(t.rotation.y, t.rotation.x, 0), i = u.e.TransformCoordinates(new u.e(this._leftjoystick.deltaPosition.x * e, this._leftjoystick.deltaPosition.y * e, this._leftjoystick.deltaPosition.z * e), n);\n              t.cameraDirection = t.cameraDirection.add(i), t.cameraRotation = t.cameraRotation.addVector3(this._rightjoystick.deltaPosition), this._leftjoystick.pressed || (this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(0.9)), this._rightjoystick.pressed || (this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(0.9));\n            }\n          }, r.prototype.attachControl = function() {\n            this._leftjoystick = new Ka(!0), this._leftjoystick.setAxisForUpDown(rn.Z), this._leftjoystick.setAxisForLeftRight(rn.X), this._leftjoystick.setJoystickSensibility(0.15), this._rightjoystick = new Ka(!1), this._rightjoystick.setAxisForUpDown(rn.X), this._rightjoystick.setAxisForLeftRight(rn.Y), this._rightjoystick.reverseUpDown = !0, this._rightjoystick.setJoystickSensibility(0.05), this._rightjoystick.setJoystickColor(\"yellow\");\n          }, r.prototype.detachControl = function(t) {\n            this._leftjoystick.releaseCanvas(), this._rightjoystick.releaseCanvas();\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraVirtualJoystickInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"virtualJoystick\";\n          }, r;\n        }();\n        un.FreeCameraVirtualJoystickInput = Qa;\n        var Vt = f(28), Pi = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !0);\n            var a = r.call(this, e, n, i, o) || this;\n            return a._tmpUpVector = u.e.Zero(), a._tmpTargetVector = u.e.Zero(), a.cameraDirection = new u.e(0, 0, 0), a.cameraRotation = new u.d(0, 0), a.ignoreParentScaling = !1, a.updateUpVectorFromRotation = !1, a._tmpQuaternion = new u.b(), a.rotation = new u.e(0, 0, 0), a.speed = 2, a.noRotationConstraint = !1, a.invertRotation = !1, a.inverseRotationSpeed = 0.2, a.lockedTarget = null, a._currentTarget = u.e.Zero(), a._initialFocalDistance = 1, a._viewMatrix = u.a.Zero(), a._camMatrix = u.a.Zero(), a._cameraTransformMatrix = u.a.Zero(), a._cameraRotationMatrix = u.a.Zero(), a._referencePoint = new u.e(0, 0, 1), a._transformedReferencePoint = u.e.Zero(), a._defaultUp = u.e.Up(), a._cachedRotationZ = 0, a._cachedQuaternionRotationZ = 0, a;\n          }\n          return Object(c.d)(t, r), t.prototype.getFrontPosition = function(e) {\n            this.getWorldMatrix();\n            var n = this.getTarget().subtract(this.position);\n            return n.normalize(), n.scaleInPlace(e), this.globalPosition.add(n);\n          }, t.prototype._getLockedTargetPosition = function() {\n            return this.lockedTarget ? (this.lockedTarget.absolutePosition && this.lockedTarget.computeWorldMatrix(), this.lockedTarget.absolutePosition || this.lockedTarget) : null;\n          }, t.prototype.storeState = function() {\n            return this._storedPosition = this.position.clone(), this._storedRotation = this.rotation.clone(), this.rotationQuaternion && (this._storedRotationQuaternion = this.rotationQuaternion.clone()), r.prototype.storeState.call(this);\n          }, t.prototype._restoreStateValues = function() {\n            return !!r.prototype._restoreStateValues.call(this) && (this.position = this._storedPosition.clone(), this.rotation = this._storedRotation.clone(), this.rotationQuaternion && (this.rotationQuaternion = this._storedRotationQuaternion.clone()), this.cameraDirection.copyFromFloats(0, 0, 0), this.cameraRotation.copyFromFloats(0, 0), !0);\n          }, t.prototype._initCache = function() {\n            r.prototype._initCache.call(this), this._cache.lockedTarget = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotation = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotationQuaternion = new u.b(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n          }, t.prototype._updateCache = function(e) {\n            e || r.prototype._updateCache.call(this);\n            var n = this._getLockedTargetPosition();\n            n ? this._cache.lockedTarget ? this._cache.lockedTarget.copyFrom(n) : this._cache.lockedTarget = n.clone() : this._cache.lockedTarget = null, this._cache.rotation.copyFrom(this.rotation), this.rotationQuaternion && this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);\n          }, t.prototype._isSynchronizedViewMatrix = function() {\n            if (!r.prototype._isSynchronizedViewMatrix.call(this))\n              return !1;\n            var e = this._getLockedTargetPosition();\n            return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(e) : !e) && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation));\n          }, t.prototype._computeLocalCameraSpeed = function() {\n            var e = this.getEngine();\n            return this.speed * Math.sqrt(e.getDeltaTime() / (100 * e.getFps()));\n          }, t.prototype.setTarget = function(e) {\n            this.upVector.normalize(), this._initialFocalDistance = e.subtract(this.position).length(), this.position.z === e.z && (this.position.z += Vt.a), this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance), u.a.LookAtLHToRef(this.position, e, this._defaultUp, this._camMatrix), this._camMatrix.invert(), this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);\n            var n = e.subtract(this.position);\n            n.x >= 0 ? this.rotation.y = -Math.atan(n.z / n.x) + Math.PI / 2 : this.rotation.y = -Math.atan(n.z / n.x) - Math.PI / 2, this.rotation.z = 0, isNaN(this.rotation.x) && (this.rotation.x = 0), isNaN(this.rotation.y) && (this.rotation.y = 0), isNaN(this.rotation.z) && (this.rotation.z = 0), this.rotationQuaternion && u.b.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);\n          }, Object.defineProperty(t.prototype, \"target\", { get: function() {\n            return this.getTarget();\n          }, set: function(e) {\n            this.setTarget(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getTarget = function() {\n            return this._currentTarget;\n          }, t.prototype._decideIfNeedsToMove = function() {\n            return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\n          }, t.prototype._updatePosition = function() {\n            if (this.parent)\n              return this.parent.getWorldMatrix().invertToRef(u.c.Matrix[0]), u.e.TransformNormalToRef(this.cameraDirection, u.c.Matrix[0], u.c.Vector3[0]), void this.position.addInPlace(u.c.Vector3[0]);\n            this.position.addInPlace(this.cameraDirection);\n          }, t.prototype._checkInputs = function() {\n            var e = this.invertRotation ? -this.inverseRotationSpeed : 1, n = this._decideIfNeedsToMove(), i = Math.abs(this.cameraRotation.x) > 0 || Math.abs(this.cameraRotation.y) > 0;\n            n && this._updatePosition(), i && (this.rotationQuaternion && this.rotationQuaternion.toEulerAnglesToRef(this.rotation), this.rotation.x += this.cameraRotation.x * e, this.rotation.y += this.cameraRotation.y * e, !this.noRotationConstraint && (this.rotation.x > 1.570796 && (this.rotation.x = 1.570796), this.rotation.x < -1.570796 && (this.rotation.x = -1.570796)), this.rotationQuaternion && this.rotation.lengthSquared() && u.b.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion)), n && (Math.abs(this.cameraDirection.x) < this.speed * Vt.a && (this.cameraDirection.x = 0), Math.abs(this.cameraDirection.y) < this.speed * Vt.a && (this.cameraDirection.y = 0), Math.abs(this.cameraDirection.z) < this.speed * Vt.a && (this.cameraDirection.z = 0), this.cameraDirection.scaleInPlace(this.inertia)), i && (Math.abs(this.cameraRotation.x) < this.speed * Vt.a && (this.cameraRotation.x = 0), Math.abs(this.cameraRotation.y) < this.speed * Vt.a && (this.cameraRotation.y = 0), this.cameraRotation.scaleInPlace(this.inertia)), r.prototype._checkInputs.call(this);\n          }, t.prototype._updateCameraRotationMatrix = function() {\n            this.rotationQuaternion ? this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix) : u.a.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);\n          }, t.prototype._rotateUpVectorWithCameraRotationMatrix = function() {\n            return u.e.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector), this;\n          }, t.prototype._getViewMatrix = function() {\n            return this.lockedTarget && this.setTarget(this._getLockedTargetPosition()), this._updateCameraRotationMatrix(), this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z ? (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedQuaternionRotationZ = this.rotationQuaternion.z) : this._cachedRotationZ != this.rotation.z && (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedRotationZ = this.rotation.z), u.e.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), this.updateUpVectorFromRotation && (this.rotationQuaternion ? be.a.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector) : (u.b.FromEulerVectorToRef(this.rotation, this._tmpQuaternion), be.a.Y.rotateByQuaternionToRef(this._tmpQuaternion, this.upVector))), this._computeViewMatrix(this.position, this._currentTarget, this.upVector), this._viewMatrix;\n          }, t.prototype._computeViewMatrix = function(e, n, i) {\n            if (this.ignoreParentScaling) {\n              if (this.parent) {\n                var o = this.parent.getWorldMatrix();\n                u.e.TransformCoordinatesToRef(e, o, this._globalPosition), u.e.TransformCoordinatesToRef(n, o, this._tmpTargetVector), u.e.TransformNormalToRef(i, o, this._tmpUpVector), this._markSyncedWithParent();\n              } else\n                this._globalPosition.copyFrom(e), this._tmpTargetVector.copyFrom(n), this._tmpUpVector.copyFrom(i);\n              this.getScene().useRightHandedSystem ? u.a.LookAtRHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix) : u.a.LookAtLHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);\n            } else\n              this.getScene().useRightHandedSystem ? u.a.LookAtRHToRef(e, n, i, this._viewMatrix) : u.a.LookAtLHToRef(e, n, i, this._viewMatrix), this.parent ? (o = this.parent.getWorldMatrix(), this._viewMatrix.invert(), this._viewMatrix.multiplyToRef(o, this._viewMatrix), this._viewMatrix.getTranslationToRef(this._globalPosition), this._viewMatrix.invert(), this._markSyncedWithParent()) : this._globalPosition.copyFrom(e);\n          }, t.prototype.createRigCamera = function(e, n) {\n            if (this.cameraRigMode !== _t.a.RIG_MODE_NONE) {\n              var i = new t(e, this.position.clone(), this.getScene());\n              return i.isRigCamera = !0, i.rigParent = this, this.cameraRigMode !== _t.a.RIG_MODE_VR && this.cameraRigMode !== _t.a.RIG_MODE_WEBVR || (this.rotationQuaternion || (this.rotationQuaternion = new u.b()), i._cameraRigParams = {}, i.rotationQuaternion = new u.b()), i;\n            }\n            return null;\n          }, t.prototype._updateRigCameras = function() {\n            var e = this._rigCameras[0], n = this._rigCameras[1];\n            switch (this.computeWorldMatrix(), this.cameraRigMode) {\n              case _t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n              case _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n              case _t.a.RIG_MODE_STEREOSCOPIC_INTERLACED:\n                var i = this.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1, o = this.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;\n                this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * i, e), this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * o, n);\n                break;\n              case _t.a.RIG_MODE_VR:\n                e.rotationQuaternion ? (e.rotationQuaternion.copyFrom(this.rotationQuaternion), n.rotationQuaternion.copyFrom(this.rotationQuaternion)) : (e.rotation.copyFrom(this.rotation), n.rotation.copyFrom(this.rotation)), e.position.copyFrom(this.position), n.position.copyFrom(this.position);\n            }\n            r.prototype._updateRigCameras.call(this);\n          }, t.prototype._getRigCamPositionAndTarget = function(e, n) {\n            this.getTarget().subtractToRef(this.position, t._TargetFocalPoint), t._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);\n            var i = t._TargetFocalPoint.addInPlace(this.position);\n            u.a.TranslationToRef(-i.x, -i.y, -i.z, t._TargetTransformMatrix), t._TargetTransformMatrix.multiplyToRef(u.a.RotationAxis(n.upVector, e), t._RigCamTransformMatrix), u.a.TranslationToRef(i.x, i.y, i.z, t._TargetTransformMatrix), t._RigCamTransformMatrix.multiplyToRef(t._TargetTransformMatrix, t._RigCamTransformMatrix), u.e.TransformCoordinatesToRef(this.position, t._RigCamTransformMatrix, n.position), n.setTarget(i);\n          }, t.prototype.getClassName = function() {\n            return \"TargetCamera\";\n          }, t._RigCamTransformMatrix = new u.a(), t._TargetTransformMatrix = new u.a(), t._TargetFocalPoint = new u.e(), Object(c.c)([Object(L.o)()], t.prototype, \"rotation\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"speed\", void 0), Object(c.c)([Object(L.k)(\"lockedTargetId\")], t.prototype, \"lockedTarget\", void 0), t;\n        }(_t.a), zn = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !0);\n            var a = r.call(this, e, n, i, o) || this;\n            return a.ellipsoid = new u.e(0.5, 1, 0.5), a.ellipsoidOffset = new u.e(0, 0, 0), a.checkCollisions = !1, a.applyGravity = !1, a._needMoveForGravity = !1, a._oldPosition = u.e.Zero(), a._diffPosition = u.e.Zero(), a._newPosition = u.e.Zero(), a._collisionMask = -1, a._onCollisionPositionChange = function(s, d, p) {\n              p === void 0 && (p = null);\n              var y;\n              y = d, a._newPosition.copyFrom(y), a._newPosition.subtractToRef(a._oldPosition, a._diffPosition), a._diffPosition.length() > Ue.a.CollisionsEpsilon && (a.position.addInPlace(a._diffPosition), a.onCollide && p && a.onCollide(p));\n            }, a.inputs = new jr(a), a.inputs.addKeyboard().addMouse(), a;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"angularSensibility\", { get: function() {\n            var e = this.inputs.attached.mouse;\n            return e ? e.angularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mouse;\n            n && (n.angularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUp\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUp : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUp = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUpward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUpward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUpward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDown\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDown : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDown = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDownward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDownward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDownward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysLeft\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysLeft : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysLeft = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysRight\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysRight : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysRight = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.attachControl = function(e, n) {\n            n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(n);\n          }, t.prototype.detachControl = function(e) {\n            this.inputs.detachElement(), this.cameraDirection = new u.e(0, 0, 0), this.cameraRotation = new u.d(0, 0);\n          }, Object.defineProperty(t.prototype, \"collisionMask\", { get: function() {\n            return this._collisionMask;\n          }, set: function(e) {\n            this._collisionMask = isNaN(e) ? -1 : e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._collideWithWorld = function(e) {\n            (this.parent ? u.e.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position).subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);\n            var n = this.getScene().collisionCoordinator;\n            this._collider || (this._collider = n.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;\n            var i = e;\n            this.applyGravity && (i = e.add(this.getScene().gravity)), n.getNewPosition(this._oldPosition, i, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);\n          }, t.prototype._checkInputs = function() {\n            this._localDirection || (this._localDirection = u.e.Zero(), this._transformedDirection = u.e.Zero()), this.inputs.checkInputs(), r.prototype._checkInputs.call(this);\n          }, t.prototype._decideIfNeedsToMove = function() {\n            return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\n          }, t.prototype._updatePosition = function() {\n            this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : r.prototype._updatePosition.call(this);\n          }, t.prototype.dispose = function() {\n            this.inputs.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"FreeCamera\";\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoid\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoidOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"checkCollisions\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"applyGravity\", void 0), t;\n        }(Pi);\n        Q.a.AddNodeConstructor(\"TouchCamera\", function(r, t) {\n          return function() {\n            return new qa(r, u.e.Zero(), t);\n          };\n        });\n        var qa = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.inputs.addTouch(), o._setupInputs(), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"touchAngularSensibility\", { get: function() {\n            var e = this.inputs.attached.touch;\n            return e ? e.touchAngularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.touch;\n            n && (n.touchAngularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"touchMoveSensibility\", { get: function() {\n            var e = this.inputs.attached.touch;\n            return e ? e.touchMoveSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.touch;\n            n && (n.touchMoveSensibility = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"TouchCamera\";\n          }, t.prototype._setupInputs = function() {\n            var e = this.inputs.attached.touch, n = this.inputs.attached.mouse;\n            n ? n.touchEnabled = !1 : e.allowMouse = !0;\n          }, t;\n        }(zn);\n        Q.a.AddNodeConstructor(\"ArcRotateCamera\", function(r, t) {\n          return function() {\n            return new ji(r, 0, 0, 1, u.e.Zero(), t);\n          };\n        });\n        var ji = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            d === void 0 && (d = !0);\n            var p = r.call(this, e, u.e.Zero(), s, d) || this;\n            return p.inertialAlphaOffset = 0, p.inertialBetaOffset = 0, p.inertialRadiusOffset = 0, p.lowerAlphaLimit = null, p.upperAlphaLimit = null, p.lowerBetaLimit = 0.01, p.upperBetaLimit = Math.PI - 0.01, p.lowerRadiusLimit = null, p.upperRadiusLimit = null, p.inertialPanningX = 0, p.inertialPanningY = 0, p.pinchToPanMaxDistance = 20, p.panningDistanceLimit = null, p.panningOriginTarget = u.e.Zero(), p.panningInertia = 0.9, p.zoomOnFactor = 1, p.targetScreenOffset = u.d.Zero(), p.allowUpsideDown = !0, p.useInputToRestoreState = !0, p._viewMatrix = new u.a(), p.panningAxis = new u.e(1, 1, 0), p.onMeshTargetChangedObservable = new C.c(), p.checkCollisions = !1, p.collisionRadius = new u.e(0.5, 0.5, 0.5), p._previousPosition = u.e.Zero(), p._collisionVelocity = u.e.Zero(), p._newPosition = u.e.Zero(), p._computationVector = u.e.Zero(), p._onCollisionPositionChange = function(y, P, R) {\n              R === void 0 && (R = null), R ? (p.setPosition(P), p.onCollide && p.onCollide(R)) : p._previousPosition.copyFrom(p._position);\n              var B = Math.cos(p.alpha), F = Math.sin(p.alpha), z = Math.cos(p.beta), J = Math.sin(p.beta);\n              J === 0 && (J = 1e-4);\n              var ie = p._getTargetPosition();\n              p._computationVector.copyFromFloats(p.radius * B * J, p.radius * z, p.radius * F * J), ie.addToRef(p._computationVector, p._newPosition), p._position.copyFrom(p._newPosition);\n              var se = p.upVector;\n              p.allowUpsideDown && p.beta < 0 && (se = (se = se.clone()).negate()), p._computeViewMatrix(p._position, ie, se), p._viewMatrix.addAtIndex(12, p.targetScreenOffset.x), p._viewMatrix.addAtIndex(13, p.targetScreenOffset.y), p._collisionTriggered = !1;\n            }, p._target = u.e.Zero(), a && p.setTarget(a), p.alpha = n, p.beta = i, p.radius = o, p.getViewMatrix(), p.inputs = new Po(p), p.inputs.addKeyboard().addMouseWheel().addPointers(), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"target\", { get: function() {\n            return this._target;\n          }, set: function(e) {\n            this.setTarget(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(e) {\n            this.setPosition(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"upVector\", { get: function() {\n            return this._upVector;\n          }, set: function(e) {\n            this._upToYMatrix || (this._YToUpMatrix = new u.a(), this._upToYMatrix = new u.a(), this._upVector = u.e.Zero()), e.normalize(), this._upVector.copyFrom(e), this.setMatUp();\n          }, enumerable: !1, configurable: !0 }), t.prototype.setMatUp = function() {\n            u.a.RotationAlignToRef(u.e.UpReadOnly, this._upVector, this._YToUpMatrix), u.a.RotationAlignToRef(this._upVector, u.e.UpReadOnly, this._upToYMatrix);\n          }, Object.defineProperty(t.prototype, \"angularSensibilityX\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.angularSensibilityX : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.angularSensibilityX = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"angularSensibilityY\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.angularSensibilityY : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.angularSensibilityY = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"pinchPrecision\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.pinchPrecision : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.pinchPrecision = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"pinchDeltaPercentage\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.pinchDeltaPercentage : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.pinchDeltaPercentage = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useNaturalPinchZoom\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return !!e && e.useNaturalPinchZoom;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.useNaturalPinchZoom = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"panningSensibility\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.panningSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.panningSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUp\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUp : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUp = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDown\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDown : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDown = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysLeft\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysLeft : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysLeft = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysRight\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysRight : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysRight = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelPrecision\", { get: function() {\n            var e = this.inputs.attached.mousewheel;\n            return e ? e.wheelPrecision : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mousewheel;\n            n && (n.wheelPrecision = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelDeltaPercentage\", { get: function() {\n            var e = this.inputs.attached.mousewheel;\n            return e ? e.wheelDeltaPercentage : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mousewheel;\n            n && (n.wheelDeltaPercentage = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bouncingBehavior\", { get: function() {\n            return this._bouncingBehavior;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useBouncingBehavior\", { get: function() {\n            return this._bouncingBehavior != null;\n          }, set: function(e) {\n            e !== this.useBouncingBehavior && (e ? (this._bouncingBehavior = new qc(), this.addBehavior(this._bouncingBehavior)) : this._bouncingBehavior && (this.removeBehavior(this._bouncingBehavior), this._bouncingBehavior = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"framingBehavior\", { get: function() {\n            return this._framingBehavior;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useFramingBehavior\", { get: function() {\n            return this._framingBehavior != null;\n          }, set: function(e) {\n            e !== this.useFramingBehavior && (e ? (this._framingBehavior = new Zc(), this.addBehavior(this._framingBehavior)) : this._framingBehavior && (this.removeBehavior(this._framingBehavior), this._framingBehavior = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"autoRotationBehavior\", { get: function() {\n            return this._autoRotationBehavior;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useAutoRotationBehavior\", { get: function() {\n            return this._autoRotationBehavior != null;\n          }, set: function(e) {\n            e !== this.useAutoRotationBehavior && (e ? (this._autoRotationBehavior = new Qc(), this.addBehavior(this._autoRotationBehavior)) : this._autoRotationBehavior && (this.removeBehavior(this._autoRotationBehavior), this._autoRotationBehavior = null));\n          }, enumerable: !1, configurable: !0 }), t.prototype._initCache = function() {\n            r.prototype._initCache.call(this), this._cache._target = new u.e(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 = u.d.Zero();\n          }, t.prototype._updateCache = function(e) {\n            e || r.prototype._updateCache.call(this), 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);\n          }, t.prototype._getTargetPosition = function() {\n            if (this._targetHost && this._targetHost.getAbsolutePosition) {\n              var e = this._targetHost.absolutePosition;\n              this._targetBoundingCenter ? e.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(e);\n            }\n            var n = this._getLockedTargetPosition();\n            return n || this._target;\n          }, t.prototype.storeState = function() {\n            return this._storedAlpha = this.alpha, this._storedBeta = this.beta, this._storedRadius = this.radius, this._storedTarget = this._getTargetPosition().clone(), this._storedTargetScreenOffset = this.targetScreenOffset.clone(), r.prototype.storeState.call(this);\n          }, t.prototype._restoreStateValues = function() {\n            return !!r.prototype._restoreStateValues.call(this) && (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);\n          }, t.prototype._isSynchronizedViewMatrix = function() {\n            return !!r.prototype._isSynchronizedViewMatrix.call(this) && 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);\n          }, t.prototype.attachControl = function(e, n, i, o) {\n            var a = this;\n            i === void 0 && (i = !0), o === void 0 && (o = 2), n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._useCtrlForPanning = i, this._panningMouseButton = o, typeof arguments[0] == \"boolean\" && (arguments.length > 1 && (this._useCtrlForPanning = arguments[1]), arguments.length > 2 && (this._panningMouseButton = arguments[2])), this.inputs.attachElement(n), this._reset = function() {\n              a.inertialAlphaOffset = 0, a.inertialBetaOffset = 0, a.inertialRadiusOffset = 0, a.inertialPanningX = 0, a.inertialPanningY = 0;\n            };\n          }, t.prototype.detachControl = function(e) {\n            this.inputs.detachElement(), this._reset && this._reset();\n          }, t.prototype._checkInputs = function() {\n            if (!this._collisionTriggered) {\n              if (this.inputs.checkInputs(), this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {\n                var e = this.inertialAlphaOffset;\n                this.beta <= 0 && (e *= -1), this.getScene().useRightHandedSystem && (e *= -1), this.parent && this.parent._getWorldMatrixDeterminant() < 0 && (e *= -1), this.alpha += e, this.beta += this.inertialBetaOffset, this.radius -= this.inertialRadiusOffset, this.inertialAlphaOffset *= this.inertia, this.inertialBetaOffset *= this.inertia, this.inertialRadiusOffset *= this.inertia, Math.abs(this.inertialAlphaOffset) < Vt.a && (this.inertialAlphaOffset = 0), Math.abs(this.inertialBetaOffset) < Vt.a && (this.inertialBetaOffset = 0), Math.abs(this.inertialRadiusOffset) < this.speed * Vt.a && (this.inertialRadiusOffset = 0);\n              }\n              (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) && (this._localDirection || (this._localDirection = u.e.Zero(), this._transformedDirection = u.e.Zero()), this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY), this._localDirection.multiplyInPlace(this.panningAxis), this._viewMatrix.invertToRef(this._cameraTransformMatrix), u.e.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection), this.panningAxis.y || (this._transformedDirection.y = 0), !this._targetHost && (this.panningDistanceLimit ? (this._transformedDirection.addInPlace(this._target), u.e.DistanceSquared(this._transformedDirection, this.panningOriginTarget) <= this.panningDistanceLimit * this.panningDistanceLimit && this._target.copyFrom(this._transformedDirection)) : this._target.addInPlace(this._transformedDirection)), this.inertialPanningX *= this.panningInertia, this.inertialPanningY *= this.panningInertia, Math.abs(this.inertialPanningX) < this.speed * Vt.a && (this.inertialPanningX = 0), Math.abs(this.inertialPanningY) < this.speed * Vt.a && (this.inertialPanningY = 0)), this._checkLimits(), r.prototype._checkInputs.call(this);\n            }\n          }, t.prototype._checkLimits = function() {\n            this.lowerBetaLimit === null || this.lowerBetaLimit === void 0 ? this.allowUpsideDown && this.beta > Math.PI && (this.beta = this.beta - 2 * Math.PI) : this.beta < this.lowerBetaLimit && (this.beta = this.lowerBetaLimit), this.upperBetaLimit === null || this.upperBetaLimit === void 0 ? this.allowUpsideDown && this.beta < -Math.PI && (this.beta = this.beta + 2 * Math.PI) : this.beta > this.upperBetaLimit && (this.beta = this.upperBetaLimit), this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit && (this.alpha = this.lowerAlphaLimit), this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit && (this.alpha = this.upperAlphaLimit), this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit, this.inertialRadiusOffset = 0), this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit, this.inertialRadiusOffset = 0);\n          }, t.prototype.rebuildAnglesAndRadius = function() {\n            this._position.subtractToRef(this._getTargetPosition(), this._computationVector), this._upVector.x === 0 && this._upVector.y === 1 && this._upVector.z === 0 || u.e.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector), this.radius = this._computationVector.length(), this.radius === 0 && (this.radius = 1e-4);\n            var e = this.alpha;\n            this._computationVector.x === 0 && this._computationVector.z === 0 ? this.alpha = Math.PI / 2 : this.alpha = Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2))), this._computationVector.z < 0 && (this.alpha = 2 * Math.PI - this.alpha);\n            var n = Math.round((e - this.alpha) / (2 * Math.PI));\n            this.alpha += 2 * n * Math.PI, this.beta = Math.acos(this._computationVector.y / this.radius), this._checkLimits();\n          }, t.prototype.setPosition = function(e) {\n            this._position.equals(e) || (this._position.copyFrom(e), this.rebuildAnglesAndRadius());\n          }, t.prototype.setTarget = function(e, n, i) {\n            if (n === void 0 && (n = !1), i === void 0 && (i = !1), e.getBoundingInfo)\n              this._targetBoundingCenter = n ? e.getBoundingInfo().boundingBox.centerWorld.clone() : null, e.computeWorldMatrix(), this._targetHost = e, this._target = this._getTargetPosition(), this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);\n            else {\n              var o = e, a = this._getTargetPosition();\n              if (a && !i && a.equals(o))\n                return;\n              this._targetHost = null, this._target = o, this._targetBoundingCenter = null, this.onMeshTargetChangedObservable.notifyObservers(null);\n            }\n            this.rebuildAnglesAndRadius();\n          }, t.prototype._getViewMatrix = function() {\n            var e = Math.cos(this.alpha), n = Math.sin(this.alpha), i = Math.cos(this.beta), o = Math.sin(this.beta);\n            o === 0 && (o = 1e-4), this.radius === 0 && (this.radius = 1e-4);\n            var a = this._getTargetPosition();\n            if (this._computationVector.copyFromFloats(this.radius * e * o, this.radius * i, this.radius * n * o), this._upVector.x === 0 && this._upVector.y === 1 && this._upVector.z === 0 || u.e.TransformCoordinatesToRef(this._computationVector, this._YToUpMatrix, this._computationVector), a.addToRef(this._computationVector, this._newPosition), this.getScene().collisionsEnabled && this.checkCollisions) {\n              var s = this.getScene().collisionCoordinator;\n              this._collider || (this._collider = s.createCollider()), this._collider._radius = this.collisionRadius, this._newPosition.subtractToRef(this._position, this._collisionVelocity), this._collisionTriggered = !0, s.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);\n            } else {\n              this._position.copyFrom(this._newPosition);\n              var d = this.upVector;\n              this.allowUpsideDown && o < 0 && (d = d.negate()), this._computeViewMatrix(this._position, a, d), this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x), this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);\n            }\n            return this._currentTarget = a, this._viewMatrix;\n          }, t.prototype.zoomOn = function(e, n) {\n            n === void 0 && (n = !1), e = e || this.getScene().meshes;\n            var i = Ie.a.MinMax(e), o = u.e.Distance(i.min, i.max);\n            this.radius = o * this.zoomOnFactor, this.focusOn({ min: i.min, max: i.max, distance: o }, n);\n          }, t.prototype.focusOn = function(e, n) {\n            var i, o;\n            if (n === void 0 && (n = !1), e.min === void 0) {\n              var a = e || this.getScene().meshes;\n              i = Ie.a.MinMax(a), o = u.e.Distance(i.min, i.max);\n            } else\n              i = e, o = e.distance;\n            this._target = Ie.a.Center(i), n || (this.maxZ = 2 * o);\n          }, t.prototype.createRigCamera = function(e, n) {\n            var i = 0;\n            switch (this.cameraRigMode) {\n              case _t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n              case _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n              case _t.a.RIG_MODE_STEREOSCOPIC_INTERLACED:\n              case _t.a.RIG_MODE_VR:\n                i = this._cameraRigParams.stereoHalfAngle * (n === 0 ? 1 : -1);\n                break;\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n                i = this._cameraRigParams.stereoHalfAngle * (n === 0 ? -1 : 1);\n            }\n            var o = new t(e, this.alpha + i, this.beta, this.radius, this._target, this.getScene());\n            return o._cameraRigParams = {}, o.isRigCamera = !0, o.rigParent = this, o.upVector = this.upVector, o;\n          }, t.prototype._updateRigCameras = function() {\n            var e = this._rigCameras[0], n = this._rigCameras[1];\n            switch (e.beta = n.beta = this.beta, this.cameraRigMode) {\n              case _t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n              case _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n              case _t.a.RIG_MODE_STEREOSCOPIC_INTERLACED:\n              case _t.a.RIG_MODE_VR:\n                e.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle, n.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;\n                break;\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n                e.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle, n.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;\n            }\n            r.prototype._updateRigCameras.call(this);\n          }, t.prototype.dispose = function() {\n            this.inputs.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"ArcRotateCamera\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"alpha\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"beta\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.o)(\"target\")], t.prototype, \"_target\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialAlphaOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialBetaOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialRadiusOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerAlphaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperAlphaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerBetaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperBetaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialPanningX\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialPanningY\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchToPanMaxDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"panningDistanceLimit\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"panningOriginTarget\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"panningInertia\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"zoomOnFactor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"targetScreenOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"allowUpsideDown\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useInputToRestoreState\", void 0), t;\n        }(Pi);\n        Q.a.AddNodeConstructor(\"DeviceOrientationCamera\", function(r, t) {\n          return function() {\n            return new xo(r, u.e.Zero(), t);\n          };\n        });\n        var xo = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o._tmpDragQuaternion = new u.b(), o._disablePointerInputWhenUsingDeviceOrientation = !0, o._dragFactor = 0, o._quaternionCache = new u.b(), o.inputs.addDeviceOrientation(), o.inputs._deviceOrientationInput && o.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(function() {\n              o._disablePointerInputWhenUsingDeviceOrientation && o.inputs._mouseInput && (o.inputs._mouseInput._allowCameraRotation = !1, o.inputs._mouseInput.onPointerMovedObservable.add(function(a) {\n                o._dragFactor != 0 && (o._initialQuaternion || (o._initialQuaternion = new u.b()), u.b.FromEulerAnglesToRef(0, a.offsetX * o._dragFactor, 0, o._tmpDragQuaternion), o._initialQuaternion.multiplyToRef(o._tmpDragQuaternion, o._initialQuaternion));\n              }));\n            }), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"disablePointerInputWhenUsingDeviceOrientation\", { get: function() {\n            return this._disablePointerInputWhenUsingDeviceOrientation;\n          }, set: function(e) {\n            this._disablePointerInputWhenUsingDeviceOrientation = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.enableHorizontalDragging = function(e) {\n            e === void 0 && (e = 1 / 300), this._dragFactor = e;\n          }, t.prototype.getClassName = function() {\n            return \"DeviceOrientationCamera\";\n          }, t.prototype._checkInputs = function() {\n            r.prototype._checkInputs.call(this), this._quaternionCache.copyFrom(this.rotationQuaternion), this._initialQuaternion && this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);\n          }, t.prototype.resetToCurrentRotation = function(e) {\n            var n = this;\n            e === void 0 && (e = be.a.Y), this.rotationQuaternion && (this._initialQuaternion || (this._initialQuaternion = new u.b()), this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion), [\"x\", \"y\", \"z\"].forEach(function(i) {\n              e[i] ? n._initialQuaternion[i] *= -1 : n._initialQuaternion[i] = 0;\n            }), this._initialQuaternion.normalize(), this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion));\n          }, t;\n        }(zn), ol = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.addKeyboard = function() {\n            return this.add(new Ba()), this;\n          }, t.prototype.addMouse = function(e) {\n            return e === void 0 && (e = !0), this.add(new Ua(e)), this;\n          }, t;\n        }(zr), gf = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !0);\n            var a = r.call(this, e, n, i, o) || this;\n            return a.ellipsoid = new u.e(1, 1, 1), a.ellipsoidOffset = new u.e(0, 0, 0), a.checkCollisions = !1, a.applyGravity = !1, a.cameraDirection = u.e.Zero(), a._trackRoll = 0, a.rollCorrect = 100, a.bankedTurn = !1, a.bankedTurnLimit = Math.PI / 2, a.bankedTurnMultiplier = 1, a._needMoveForGravity = !1, a._oldPosition = u.e.Zero(), a._diffPosition = u.e.Zero(), a._newPosition = u.e.Zero(), a._collisionMask = -1, a._onCollisionPositionChange = function(s, d, p) {\n              p === void 0 && (p = null);\n              var y;\n              y = d, a._newPosition.copyFrom(y), a._newPosition.subtractToRef(a._oldPosition, a._diffPosition), a._diffPosition.length() > Ue.a.CollisionsEpsilon && (a.position.addInPlace(a._diffPosition), a.onCollide && p && a.onCollide(p));\n            }, a.inputs = new ol(a), a.inputs.addKeyboard().addMouse(), a;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"angularSensibility\", { get: function() {\n            var e = this.inputs.attached.mouse;\n            return e ? e.angularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mouse;\n            n && (n.angularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysForward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysForward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysForward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysBackward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysBackward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysBackward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUp\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUp : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUp = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDown\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDown : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDown = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysLeft\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysLeft : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysLeft = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysRight\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysRight : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysRight = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.attachControl = function(e, n) {\n            n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(n);\n          }, t.prototype.detachControl = function() {\n            this.inputs.detachElement(), this.cameraDirection = new u.e(0, 0, 0);\n          }, Object.defineProperty(t.prototype, \"collisionMask\", { get: function() {\n            return this._collisionMask;\n          }, set: function(e) {\n            this._collisionMask = isNaN(e) ? -1 : e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._collideWithWorld = function(e) {\n            (this.parent ? u.e.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position).subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);\n            var n = this.getScene().collisionCoordinator;\n            this._collider || (this._collider = n.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;\n            var i = e;\n            this.applyGravity && (i = e.add(this.getScene().gravity)), n.getNewPosition(this._oldPosition, i, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);\n          }, t.prototype._checkInputs = function() {\n            this._localDirection || (this._localDirection = u.e.Zero(), this._transformedDirection = u.e.Zero()), this.inputs.checkInputs(), r.prototype._checkInputs.call(this);\n          }, t.prototype._decideIfNeedsToMove = function() {\n            return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\n          }, t.prototype._updatePosition = function() {\n            this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : r.prototype._updatePosition.call(this);\n          }, t.prototype.restoreRoll = function(e) {\n            var n = this._trackRoll, i = n - this.rotation.z;\n            Math.abs(i) >= 1e-3 && (this.rotation.z += i / e, Math.abs(n - this.rotation.z) <= 1e-3 && (this.rotation.z = n));\n          }, t.prototype.dispose = function() {\n            this.inputs.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"FlyCamera\";\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoid\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoidOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"checkCollisions\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"applyGravity\", void 0), t;\n        }(Pi), al = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.addKeyboard = function() {\n            return this.add(new Va()), this;\n          }, t.prototype.addMouseWheel = function() {\n            return this.add(new ka()), this;\n          }, t.prototype.addPointers = function() {\n            return this.add(new Ga()), this;\n          }, t.prototype.addVRDeviceOrientation = function() {\n            return console.warn(\"DeviceOrientation support not yet implemented for FollowCamera.\"), this;\n          }, t;\n        }(zr);\n        Q.a.AddNodeConstructor(\"FollowCamera\", function(r, t) {\n          return function() {\n            return new sl(r, u.e.Zero(), t);\n          };\n        }), Q.a.AddNodeConstructor(\"ArcFollowCamera\", function(r, t) {\n          return function() {\n            return new cl(r, 0, 0, 1, null, t);\n          };\n        });\n        var Jn, sl = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = null);\n            var a = r.call(this, e, n, i) || this;\n            return a.radius = 12, a.lowerRadiusLimit = null, a.upperRadiusLimit = null, a.rotationOffset = 0, a.lowerRotationOffsetLimit = null, a.upperRotationOffsetLimit = null, a.heightOffset = 4, a.lowerHeightOffsetLimit = null, a.upperHeightOffsetLimit = null, a.cameraAcceleration = 0.05, a.maxCameraSpeed = 20, a.lockedTarget = o, a.inputs = new al(a), a.inputs.addKeyboard().addMouseWheel().addPointers(), a;\n          }\n          return Object(c.d)(t, r), t.prototype._follow = function(e) {\n            if (e) {\n              var n;\n              if (e.rotationQuaternion) {\n                var i = new u.a();\n                e.rotationQuaternion.toRotationMatrix(i), n = Math.atan2(i.m[8], i.m[10]);\n              } else\n                n = e.rotation.y;\n              var o = Xe.b.ToRadians(this.rotationOffset) + n, a = e.getAbsolutePosition(), s = a.x + Math.sin(o) * this.radius, d = a.z + Math.cos(o) * this.radius, p = s - this.position.x, y = a.y + this.heightOffset - this.position.y, P = d - this.position.z, R = p * this.cameraAcceleration * 2, B = y * this.cameraAcceleration, F = P * this.cameraAcceleration * 2;\n              (R > this.maxCameraSpeed || R < -this.maxCameraSpeed) && (R = R < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (B > this.maxCameraSpeed || B < -this.maxCameraSpeed) && (B = B < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (F > this.maxCameraSpeed || F < -this.maxCameraSpeed) && (F = F < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), this.position = new u.e(this.position.x + R, this.position.y + B, this.position.z + F), this.setTarget(a);\n            }\n          }, t.prototype.attachControl = function(e, n) {\n            n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(n), this._reset = function() {\n            };\n          }, t.prototype.detachControl = function(e) {\n            this.inputs.detachElement(), this._reset && this._reset();\n          }, t.prototype._checkInputs = function() {\n            this.inputs.checkInputs(), this._checkLimits(), r.prototype._checkInputs.call(this), this.lockedTarget && this._follow(this.lockedTarget);\n          }, t.prototype._checkLimits = function() {\n            this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit), this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit), this.lowerHeightOffsetLimit !== null && this.heightOffset < this.lowerHeightOffsetLimit && (this.heightOffset = this.lowerHeightOffsetLimit), this.upperHeightOffsetLimit !== null && this.heightOffset > this.upperHeightOffsetLimit && (this.heightOffset = this.upperHeightOffsetLimit), this.lowerRotationOffsetLimit !== null && this.rotationOffset < this.lowerRotationOffsetLimit && (this.rotationOffset = this.lowerRotationOffsetLimit), this.upperRotationOffsetLimit !== null && this.rotationOffset > this.upperRotationOffsetLimit && (this.rotationOffset = this.upperRotationOffsetLimit);\n          }, t.prototype.getClassName = function() {\n            return \"FollowCamera\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"rotationOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerRotationOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperRotationOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"heightOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerHeightOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperHeightOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"cameraAcceleration\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"maxCameraSpeed\", void 0), Object(c.c)([Object(L.k)(\"lockedTargetId\")], t.prototype, \"lockedTarget\", void 0), t;\n        }(Pi), cl = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, u.e.Zero(), s) || this;\n            return d.alpha = n, d.beta = i, d.radius = o, d._cartesianCoordinates = u.e.Zero(), d._meshTarget = a, d._follow(), d;\n          }\n          return Object(c.d)(t, r), t.prototype._follow = function() {\n            if (this._meshTarget) {\n              this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta), this._cartesianCoordinates.y = this.radius * Math.sin(this.beta), this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta);\n              var e = this._meshTarget.getAbsolutePosition();\n              this.position = e.add(this._cartesianCoordinates), this.setTarget(e);\n            }\n          }, t.prototype._checkInputs = function() {\n            r.prototype._checkInputs.call(this), this._follow();\n          }, t.prototype.getClassName = function() {\n            return \"ArcFollowCamera\";\n          }, t;\n        }(Pi), Za = f(38), dn = f(39);\n        (function(r) {\n          r[r.VIVE = 0] = \"VIVE\", r[r.OCULUS = 1] = \"OCULUS\", r[r.WINDOWS = 2] = \"WINDOWS\", r[r.GEAR_VR = 3] = \"GEAR_VR\", r[r.DAYDREAM = 4] = \"DAYDREAM\", r[r.GENERIC = 5] = \"GENERIC\";\n        })(Jn || (Jn = {}));\n        var xn, Hi, xi = function() {\n          function r() {\n          }\n          return r.InitiateController = function(t) {\n            for (var e = 0, n = this._ControllerFactories; e < n.length; e++) {\n              var i = n[e];\n              if (i.canCreate(t))\n                return i.create(t);\n            }\n            if (this._DefaultControllerFactory)\n              return this._DefaultControllerFactory(t);\n            throw \"The type of gamepad you are trying to load needs to be imported first or is not supported.\";\n          }, r._ControllerFactories = [], r._DefaultControllerFactory = null, r;\n        }(), ar = function(r) {\n          function t(e) {\n            var n = r.call(this, e.id, e.index, e) || this;\n            return n.isXR = !1, n._deviceRoomPosition = u.e.Zero(), n._deviceRoomRotationQuaternion = new u.b(), n.devicePosition = u.e.Zero(), n.deviceRotationQuaternion = new u.b(), n.deviceScaleFactor = 1, n._trackPosition = !0, n._maxRotationDistFromHeadset = Math.PI / 5, n._draggedRoomRotation = 0, n._leftHandSystemQuaternion = new u.b(), n._deviceToWorld = u.a.Identity(), n._pointingPoseNode = null, n._workingMatrix = u.a.Identity(), n._meshAttachedObservable = new C.c(), n.type = hn.POSE_ENABLED, n.controllerType = Jn.GENERIC, n.position = u.e.Zero(), n.rotationQuaternion = new u.b(), n._calculatedPosition = u.e.Zero(), n._calculatedRotation = new u.b(), u.b.RotationYawPitchRollToRef(Math.PI, 0, 0, n._leftHandSystemQuaternion), n;\n          }\n          return Object(c.d)(t, r), t.prototype._disableTrackPosition = function(e) {\n            this._trackPosition && (this._calculatedPosition.copyFrom(e), this._trackPosition = !1);\n          }, t.prototype.update = function() {\n            r.prototype.update.call(this), this._updatePoseAndMesh();\n          }, t.prototype._updatePoseAndMesh = function() {\n            if (!this.isXR) {\n              var e = this.browserGamepad.pose;\n              if (this.updateFromDevice(e), !this._trackPosition && te.a.LastCreatedScene && te.a.LastCreatedScene.activeCamera && te.a.LastCreatedScene.activeCamera.devicePosition && ((n = te.a.LastCreatedScene.activeCamera)._computeDevicePosition(), this._deviceToWorld.setTranslation(n.devicePosition), n.deviceRotationQuaternion)) {\n                var n;\n                (n = n)._deviceRoomRotationQuaternion.toEulerAnglesToRef(u.c.Vector3[0]);\n                var i = Math.atan2(Math.sin(u.c.Vector3[0].y - this._draggedRoomRotation), Math.cos(u.c.Vector3[0].y - this._draggedRoomRotation));\n                if (Math.abs(i) > this._maxRotationDistFromHeadset) {\n                  var o = i - (i < 0 ? -this._maxRotationDistFromHeadset : this._maxRotationDistFromHeadset);\n                  this._draggedRoomRotation += o;\n                  var a = Math.sin(-o), s = Math.cos(-o);\n                  this._calculatedPosition.x = this._calculatedPosition.x * s - this._calculatedPosition.z * a, this._calculatedPosition.z = this._calculatedPosition.x * a + this._calculatedPosition.z * s;\n                }\n              }\n              u.e.TransformCoordinatesToRef(this._calculatedPosition, this._deviceToWorld, this.devicePosition), this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix), u.b.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation), this._mesh && (this._mesh.position.copyFrom(this.devicePosition), this._mesh.rotationQuaternion && this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion));\n            }\n          }, t.prototype.updateFromDevice = function(e) {\n            if (!this.isXR && e) {\n              this.rawPose = e, e.position && (this._deviceRoomPosition.copyFromFloats(e.position[0], e.position[1], -e.position[2]), this._mesh && this._mesh.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1), this._trackPosition && this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor, this._calculatedPosition), this._calculatedPosition.addInPlace(this.position));\n              var n = this.rawPose;\n              e.orientation && n.orientation && n.orientation.length === 4 && (this._deviceRoomRotationQuaternion.copyFromFloats(n.orientation[0], n.orientation[1], -n.orientation[2], -n.orientation[3]), this._mesh && (this._mesh.getScene().useRightHandedSystem ? (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1) : this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion, this._deviceRoomRotationQuaternion)), this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion, this._calculatedRotation));\n            }\n          }, t.prototype.attachToMesh = function(e) {\n            if (this._mesh && (this._mesh.parent = null), this._mesh = e, this._poseControlledCamera && (this._mesh.parent = this._poseControlledCamera), this._mesh.rotationQuaternion || (this._mesh.rotationQuaternion = new u.b()), !this.isXR && (this._updatePoseAndMesh(), this._pointingPoseNode)) {\n              for (var n = [], i = this._pointingPoseNode; i.parent; )\n                n.push(i.parent), i = i.parent;\n              n.reverse().forEach(function(o) {\n                o.computeWorldMatrix(!0);\n              });\n            }\n            this._meshAttachedObservable.notifyObservers(e);\n          }, t.prototype.attachToPoseControlledCamera = function(e) {\n            this._poseControlledCamera = e, this._mesh && (this._mesh.parent = this._poseControlledCamera);\n          }, t.prototype.dispose = function() {\n            this._mesh && this._mesh.dispose(), this._mesh = null, r.prototype.dispose.call(this);\n          }, Object.defineProperty(t.prototype, \"mesh\", { get: function() {\n            return this._mesh;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getForwardRay = function(e) {\n            if (e === void 0 && (e = 100), !this.mesh)\n              return new dn.a(u.e.Zero(), new u.e(0, 0, 1), e);\n            var n = this._pointingPoseNode ? this._pointingPoseNode.getWorldMatrix() : this.mesh.getWorldMatrix(), i = n.getTranslation(), o = new u.e(0, 0, -1), a = u.e.TransformNormal(o, n), s = u.e.Normalize(a);\n            return new dn.a(i, s, e);\n          }, t.POINTING_POSE = \"POINTING_POSE\", t;\n        }(hn);\n        (function(r) {\n          r[r.A = 0] = \"A\", r[r.B = 1] = \"B\", r[r.X = 2] = \"X\", r[r.Y = 3] = \"Y\", r[r.LB = 4] = \"LB\", r[r.RB = 5] = \"RB\", r[r.Back = 8] = \"Back\", r[r.Start = 9] = \"Start\", r[r.LeftStick = 10] = \"LeftStick\", r[r.RightStick = 11] = \"RightStick\";\n        })(xn || (xn = {})), function(r) {\n          r[r.Up = 12] = \"Up\", r[r.Down = 13] = \"Down\", r[r.Left = 14] = \"Left\", r[r.Right = 15] = \"Right\";\n        }(Hi || (Hi = {}));\n        var Vn, Wi, ll = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = r.call(this, e, n, i, 0, 1, 2, 3) || this;\n            return a._leftTrigger = 0, a._rightTrigger = 0, a.onButtonDownObservable = new C.c(), a.onButtonUpObservable = new C.c(), a.onPadDownObservable = new C.c(), a.onPadUpObservable = new C.c(), a._buttonA = 0, a._buttonB = 0, a._buttonX = 0, a._buttonY = 0, a._buttonBack = 0, a._buttonStart = 0, a._buttonLB = 0, a._buttonRB = 0, a._buttonLeftStick = 0, a._buttonRightStick = 0, a._dPadUp = 0, a._dPadDown = 0, a._dPadLeft = 0, a._dPadRight = 0, a._isXboxOnePad = !1, a.type = hn.XBOX, a._isXboxOnePad = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.onlefttriggerchanged = function(e) {\n            this._onlefttriggerchanged = e;\n          }, t.prototype.onrighttriggerchanged = function(e) {\n            this._onrighttriggerchanged = e;\n          }, Object.defineProperty(t.prototype, \"leftTrigger\", { get: function() {\n            return this._leftTrigger;\n          }, set: function(e) {\n            this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rightTrigger\", { get: function() {\n            return this._rightTrigger;\n          }, set: function(e) {\n            this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.onbuttondown = function(e) {\n            this._onbuttondown = e;\n          }, t.prototype.onbuttonup = function(e) {\n            this._onbuttonup = e;\n          }, t.prototype.ondpaddown = function(e) {\n            this._ondpaddown = e;\n          }, t.prototype.ondpadup = function(e) {\n            this._ondpadup = e;\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), e === 0 && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e;\n          }, t.prototype._setDPadValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._ondpaddown && this._ondpaddown(i), this.onPadDownObservable.notifyObservers(i)), e === 0 && (this._ondpadup && this._ondpadup(i), this.onPadUpObservable.notifyObservers(i))), e;\n          }, Object.defineProperty(t.prototype, \"buttonA\", { get: function() {\n            return this._buttonA;\n          }, set: function(e) {\n            this._buttonA = this._setButtonValue(e, this._buttonA, xn.A);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonB\", { get: function() {\n            return this._buttonB;\n          }, set: function(e) {\n            this._buttonB = this._setButtonValue(e, this._buttonB, xn.B);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonX\", { get: function() {\n            return this._buttonX;\n          }, set: function(e) {\n            this._buttonX = this._setButtonValue(e, this._buttonX, xn.X);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonY\", { get: function() {\n            return this._buttonY;\n          }, set: function(e) {\n            this._buttonY = this._setButtonValue(e, this._buttonY, xn.Y);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonStart\", { get: function() {\n            return this._buttonStart;\n          }, set: function(e) {\n            this._buttonStart = this._setButtonValue(e, this._buttonStart, xn.Start);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonBack\", { get: function() {\n            return this._buttonBack;\n          }, set: function(e) {\n            this._buttonBack = this._setButtonValue(e, this._buttonBack, xn.Back);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonLB\", { get: function() {\n            return this._buttonLB;\n          }, set: function(e) {\n            this._buttonLB = this._setButtonValue(e, this._buttonLB, xn.LB);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonRB\", { get: function() {\n            return this._buttonRB;\n          }, set: function(e) {\n            this._buttonRB = this._setButtonValue(e, this._buttonRB, xn.RB);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonLeftStick\", { get: function() {\n            return this._buttonLeftStick;\n          }, set: function(e) {\n            this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, xn.LeftStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonRightStick\", { get: function() {\n            return this._buttonRightStick;\n          }, set: function(e) {\n            this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, xn.RightStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadUp\", { get: function() {\n            return this._dPadUp;\n          }, set: function(e) {\n            this._dPadUp = this._setDPadValue(e, this._dPadUp, Hi.Up);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadDown\", { get: function() {\n            return this._dPadDown;\n          }, set: function(e) {\n            this._dPadDown = this._setDPadValue(e, this._dPadDown, Hi.Down);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadLeft\", { get: function() {\n            return this._dPadLeft;\n          }, set: function(e) {\n            this._dPadLeft = this._setDPadValue(e, this._dPadLeft, Hi.Left);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadRight\", { get: function() {\n            return this._dPadRight;\n          }, set: function(e) {\n            this._dPadRight = this._setDPadValue(e, this._dPadRight, Hi.Right);\n          }, enumerable: !1, configurable: !0 }), t.prototype.update = function() {\n            r.prototype.update.call(this), this._isXboxOnePad, this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();\n          }, t;\n        }(hn);\n        (function(r) {\n          r[r.Cross = 0] = \"Cross\", r[r.Circle = 1] = \"Circle\", r[r.Square = 2] = \"Square\", r[r.Triangle = 3] = \"Triangle\", r[r.L1 = 4] = \"L1\", r[r.R1 = 5] = \"R1\", r[r.Share = 8] = \"Share\", r[r.Options = 9] = \"Options\", r[r.LeftStick = 10] = \"LeftStick\", r[r.RightStick = 11] = \"RightStick\";\n        })(Vn || (Vn = {})), function(r) {\n          r[r.Up = 12] = \"Up\", r[r.Down = 13] = \"Down\", r[r.Left = 14] = \"Left\", r[r.Right = 15] = \"Right\";\n        }(Wi || (Wi = {}));\n        var ul = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e.replace(\"STANDARD GAMEPAD\", \"SONY PLAYSTATION DUALSHOCK\"), n, i, 0, 1, 2, 3) || this;\n            return o._leftTrigger = 0, o._rightTrigger = 0, o.onButtonDownObservable = new C.c(), o.onButtonUpObservable = new C.c(), o.onPadDownObservable = new C.c(), o.onPadUpObservable = new C.c(), o._buttonCross = 0, o._buttonCircle = 0, o._buttonSquare = 0, o._buttonTriangle = 0, o._buttonShare = 0, o._buttonOptions = 0, o._buttonL1 = 0, o._buttonR1 = 0, o._buttonLeftStick = 0, o._buttonRightStick = 0, o._dPadUp = 0, o._dPadDown = 0, o._dPadLeft = 0, o._dPadRight = 0, o.type = hn.DUALSHOCK, o;\n          }\n          return Object(c.d)(t, r), t.prototype.onlefttriggerchanged = function(e) {\n            this._onlefttriggerchanged = e;\n          }, t.prototype.onrighttriggerchanged = function(e) {\n            this._onrighttriggerchanged = e;\n          }, Object.defineProperty(t.prototype, \"leftTrigger\", { get: function() {\n            return this._leftTrigger;\n          }, set: function(e) {\n            this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rightTrigger\", { get: function() {\n            return this._rightTrigger;\n          }, set: function(e) {\n            this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.onbuttondown = function(e) {\n            this._onbuttondown = e;\n          }, t.prototype.onbuttonup = function(e) {\n            this._onbuttonup = e;\n          }, t.prototype.ondpaddown = function(e) {\n            this._ondpaddown = e;\n          }, t.prototype.ondpadup = function(e) {\n            this._ondpadup = e;\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), e === 0 && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e;\n          }, t.prototype._setDPadValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._ondpaddown && this._ondpaddown(i), this.onPadDownObservable.notifyObservers(i)), e === 0 && (this._ondpadup && this._ondpadup(i), this.onPadUpObservable.notifyObservers(i))), e;\n          }, Object.defineProperty(t.prototype, \"buttonCross\", { get: function() {\n            return this._buttonCross;\n          }, set: function(e) {\n            this._buttonCross = this._setButtonValue(e, this._buttonCross, Vn.Cross);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonCircle\", { get: function() {\n            return this._buttonCircle;\n          }, set: function(e) {\n            this._buttonCircle = this._setButtonValue(e, this._buttonCircle, Vn.Circle);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonSquare\", { get: function() {\n            return this._buttonSquare;\n          }, set: function(e) {\n            this._buttonSquare = this._setButtonValue(e, this._buttonSquare, Vn.Square);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonTriangle\", { get: function() {\n            return this._buttonTriangle;\n          }, set: function(e) {\n            this._buttonTriangle = this._setButtonValue(e, this._buttonTriangle, Vn.Triangle);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonOptions\", { get: function() {\n            return this._buttonOptions;\n          }, set: function(e) {\n            this._buttonOptions = this._setButtonValue(e, this._buttonOptions, Vn.Options);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonShare\", { get: function() {\n            return this._buttonShare;\n          }, set: function(e) {\n            this._buttonShare = this._setButtonValue(e, this._buttonShare, Vn.Share);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonL1\", { get: function() {\n            return this._buttonL1;\n          }, set: function(e) {\n            this._buttonL1 = this._setButtonValue(e, this._buttonL1, Vn.L1);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonR1\", { get: function() {\n            return this._buttonR1;\n          }, set: function(e) {\n            this._buttonR1 = this._setButtonValue(e, this._buttonR1, Vn.R1);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonLeftStick\", { get: function() {\n            return this._buttonLeftStick;\n          }, set: function(e) {\n            this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, Vn.LeftStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonRightStick\", { get: function() {\n            return this._buttonRightStick;\n          }, set: function(e) {\n            this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, Vn.RightStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadUp\", { get: function() {\n            return this._dPadUp;\n          }, set: function(e) {\n            this._dPadUp = this._setDPadValue(e, this._dPadUp, Wi.Up);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadDown\", { get: function() {\n            return this._dPadDown;\n          }, set: function(e) {\n            this._dPadDown = this._setDPadValue(e, this._dPadDown, Wi.Down);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadLeft\", { get: function() {\n            return this._dPadLeft;\n          }, set: function(e) {\n            this._dPadLeft = this._setDPadValue(e, this._dPadLeft, Wi.Left);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadRight\", { get: function() {\n            return this._dPadRight;\n          }, set: function(e) {\n            this._dPadRight = this._setDPadValue(e, this._dPadRight, Wi.Right);\n          }, enumerable: !1, configurable: !0 }), t.prototype.update = function() {\n            r.prototype.update.call(this), this.buttonCross = this.browserGamepad.buttons[0].value, this.buttonCircle = this.browserGamepad.buttons[1].value, this.buttonSquare = this.browserGamepad.buttons[2].value, this.buttonTriangle = this.browserGamepad.buttons[3].value, this.buttonL1 = this.browserGamepad.buttons[4].value, this.buttonR1 = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonShare = this.browserGamepad.buttons[8].value, this.buttonOptions = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();\n          }, t;\n        }(hn), hl = function() {\n          function r(t) {\n            var e = this;\n            if (this._scene = t, this._babylonGamepads = [], this._oneGamepadConnected = !1, this._isMonitoring = !1, this.onGamepadDisconnectedObservable = new C.c(), Za.a.IsWindowObjectExist() ? (this._gamepadEventSupported = \"GamepadEvent\" in window, this._gamepadSupport = navigator.getGamepads || navigator.webkitGetGamepads || navigator.msGetGamepads || navigator.webkitGamepads) : this._gamepadEventSupported = !1, this.onGamepadConnectedObservable = new C.c(function(i) {\n              for (var o in e._babylonGamepads) {\n                var a = e._babylonGamepads[o];\n                a && a._isConnected && e.onGamepadConnectedObservable.notifyObserver(i, a);\n              }\n            }), this._onGamepadConnectedEvent = function(i) {\n              var o, a = i.gamepad;\n              a.index in e._babylonGamepads && e._babylonGamepads[a.index].isConnected || (e._babylonGamepads[a.index] ? ((o = e._babylonGamepads[a.index]).browserGamepad = a, o._isConnected = !0) : o = e._addNewGamepad(a), e.onGamepadConnectedObservable.notifyObservers(o), e._startMonitoringGamepads());\n            }, this._onGamepadDisconnectedEvent = function(i) {\n              var o = i.gamepad;\n              for (var a in e._babylonGamepads)\n                if (e._babylonGamepads[a].index === o.index) {\n                  var s = e._babylonGamepads[a];\n                  s._isConnected = !1, e.onGamepadDisconnectedObservable.notifyObservers(s), s.dispose && s.dispose();\n                  break;\n                }\n            }, this._gamepadSupport)\n              if (this._updateGamepadObjects(), this._babylonGamepads.length && this._startMonitoringGamepads(), this._gamepadEventSupported) {\n                var n = this._scene ? this._scene.getEngine().getHostWindow() : window;\n                n && (n.addEventListener(\"gamepadconnected\", this._onGamepadConnectedEvent, !1), n.addEventListener(\"gamepaddisconnected\", this._onGamepadDisconnectedEvent, !1));\n              } else\n                this._startMonitoringGamepads();\n          }\n          return Object.defineProperty(r.prototype, \"gamepads\", { get: function() {\n            return this._babylonGamepads;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getGamepadByType = function(t) {\n            t === void 0 && (t = hn.XBOX);\n            for (var e = 0, n = this._babylonGamepads; e < n.length; e++) {\n              var i = n[e];\n              if (i && i.type === t)\n                return i;\n            }\n            return null;\n          }, r.prototype.dispose = function() {\n            this._gamepadEventSupported && (this._onGamepadConnectedEvent && window.removeEventListener(\"gamepadconnected\", this._onGamepadConnectedEvent), this._onGamepadDisconnectedEvent && window.removeEventListener(\"gamepaddisconnected\", this._onGamepadDisconnectedEvent), this._onGamepadConnectedEvent = null, this._onGamepadDisconnectedEvent = null), this._babylonGamepads.forEach(function(t) {\n              t.dispose();\n            }), this.onGamepadConnectedObservable.clear(), this.onGamepadDisconnectedObservable.clear(), this._oneGamepadConnected = !1, this._stopMonitoringGamepads(), this._babylonGamepads = [];\n          }, r.prototype._addNewGamepad = function(t) {\n            var e;\n            this._oneGamepadConnected || (this._oneGamepadConnected = !0);\n            var n = t.id.search(\"054c\") !== -1, i = t.id.search(\"Xbox One\") !== -1;\n            return e = i || t.id.search(\"Xbox 360\") !== -1 || t.id.search(\"xinput\") !== -1 ? new ll(t.id, t.index, t, i) : n ? new ul(t.id, t.index, t) : t.pose ? xi.InitiateController(t) : new nl(t.id, t.index, t), this._babylonGamepads[e.index] = e, e;\n          }, r.prototype._startMonitoringGamepads = function() {\n            this._isMonitoring || (this._isMonitoring = !0, this._scene || this._checkGamepadsStatus());\n          }, r.prototype._stopMonitoringGamepads = function() {\n            this._isMonitoring = !1;\n          }, r.prototype._checkGamepadsStatus = function() {\n            var t = this;\n            for (var e in this._updateGamepadObjects(), this._babylonGamepads) {\n              var n = this._babylonGamepads[e];\n              n && n.isConnected && n.update();\n            }\n            this._isMonitoring && !this._scene && Ue.a.QueueNewFrame(function() {\n              t._checkGamepadsStatus();\n            });\n          }, r.prototype._updateGamepadObjects = function() {\n            for (var t = navigator.getGamepads ? navigator.getGamepads() : navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : [], e = 0; e < t.length; e++) {\n              var n = t[e];\n              if (n)\n                if (this._babylonGamepads[n.index])\n                  this._babylonGamepads[e].browserGamepad = n, this._babylonGamepads[e].isConnected || (this._babylonGamepads[e]._isConnected = !0, this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[e]));\n                else {\n                  var i = this._addNewGamepad(n);\n                  this.onGamepadConnectedObservable.notifyObservers(i);\n                }\n            }\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"gamepadManager\", { get: function() {\n          if (!this._gamepadManager) {\n            this._gamepadManager = new hl(this);\n            var r = this._getComponent(ot.a.NAME_GAMEPAD);\n            r || (r = new dl(this), this._addComponent(r));\n          }\n          return this._gamepadManager;\n        }, enumerable: !0, configurable: !0 }), jr.prototype.addGamepad = function() {\n          return this.add(new Ya()), this;\n        }, Po.prototype.addGamepad = function() {\n          return this.add(new Da()), this;\n        };\n        var dl = function() {\n          function r(t) {\n            this.name = ot.a.NAME_GAMEPAD, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraUpdateStage.registerStep(ot.a.STEP_BEFORECAMERAUPDATE_GAMEPAD, this, this._beforeCameraUpdate);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            var t = this.scene._gamepadManager;\n            t && (t.dispose(), this.scene._gamepadManager = null);\n          }, r.prototype._beforeCameraUpdate = function() {\n            var t = this.scene._gamepadManager;\n            t && t._isMonitoring && t._checkGamepadsStatus();\n          }, r;\n        }();\n        Q.a.AddNodeConstructor(\"FreeCamera\", function(r, t) {\n          return function() {\n            return new sr(r, u.e.Zero(), t);\n          };\n        });\n        var sr = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.inputs.addGamepad(), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"gamepadAngularSensibility\", { get: function() {\n            var e = this.inputs.attached.gamepad;\n            return e ? e.gamepadAngularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.gamepad;\n            n && (n.gamepadAngularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"gamepadMoveSensibility\", { get: function() {\n            var e = this.inputs.attached.gamepad;\n            return e ? e.gamepadMoveSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.gamepad;\n            n && (n.gamepadMoveSensibility = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"UniversalCamera\";\n          }, t;\n        }(qa);\n        _t.a._createDefaultParsedCamera = function(r, t) {\n          return new sr(r, u.e.Zero(), t);\n        }, Q.a.AddNodeConstructor(\"GamepadCamera\", function(r, t) {\n          return function() {\n            return new Co(r, u.e.Zero(), t);\n          };\n        });\n        var Co = function(r) {\n          function t(e, n, i) {\n            return r.call(this, e, n, i) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"GamepadCamera\";\n          }, t;\n        }(sr), si = f(33), ze = f(5), vf = `\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.postprocessVertexShader = vf;\n        var fl = f(102);\n        wt.a.prototype.createRenderTargetTexture = function(r, t) {\n          var e = new fl.a();\n          t !== void 0 && typeof t == \"object\" ? (e.generateMipMaps = t.generateMipMaps, e.generateDepthBuffer = !!t.generateDepthBuffer, e.generateStencilBuffer = !!t.generateStencilBuffer, e.type = t.type === void 0 ? h.a.TEXTURETYPE_UNSIGNED_INT : t.type, e.samplingMode = t.samplingMode === void 0 ? h.a.TEXTURE_TRILINEAR_SAMPLINGMODE : t.samplingMode, e.format = t.format === void 0 ? h.a.TEXTUREFORMAT_RGBA : t.format) : (e.generateMipMaps = t, e.generateDepthBuffer = !0, e.generateStencilBuffer = !1, e.type = h.a.TEXTURETYPE_UNSIGNED_INT, e.samplingMode = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, e.format = h.a.TEXTUREFORMAT_RGBA), (e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (e.type !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (e.samplingMode = h.a.TEXTURE_NEAREST_SAMPLINGMODE), e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (e.type = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\"));\n          var n = this._gl, i = new Pt.a(this, Pt.b.RenderTarget), o = r.width || r, a = r.height || r, s = r.layers || 0, d = this._getSamplingParameters(e.samplingMode, !!e.generateMipMaps), p = s !== 0 ? n.TEXTURE_2D_ARRAY : n.TEXTURE_2D, y = this._getRGBABufferInternalSizedFormat(e.type, e.format), P = this._getInternalFormat(e.format), R = this._getWebGLTextureType(e.type);\n          this._bindTextureDirectly(p, i), s !== 0 ? (i.is2DArray = !0, n.texImage3D(p, 0, y, o, a, s, 0, P, R, null)) : n.texImage2D(p, 0, y, o, a, 0, P, R, null), n.texParameteri(p, n.TEXTURE_MAG_FILTER, d.mag), n.texParameteri(p, n.TEXTURE_MIN_FILTER, d.min), n.texParameteri(p, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(p, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), e.generateMipMaps && this._gl.generateMipmap(p), this._bindTextureDirectly(p, null);\n          var B = this._currentFramebuffer, F = n.createFramebuffer();\n          return this._bindUnboundFramebuffer(F), i._depthStencilBuffer = this._setupFramebufferDepthAttachments(!!e.generateStencilBuffer, e.generateDepthBuffer, o, a), i.is2DArray || n.framebufferTexture2D(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, i._webGLTexture, 0), this._bindUnboundFramebuffer(B), i._framebuffer = F, i.baseWidth = o, i.baseHeight = a, i.width = o, i.height = a, i.depth = s, i.isReady = !0, i.samples = 1, i.generateMipMaps = !!e.generateMipMaps, i.samplingMode = e.samplingMode, i.type = e.type, i.format = e.format, i._generateDepthBuffer = e.generateDepthBuffer, i._generateStencilBuffer = !!e.generateStencilBuffer, this._internalTexturesCache.push(i), i;\n        }, wt.a.prototype.createDepthStencilTexture = function(r, t) {\n          if (t.isCube) {\n            var e = r.width || r;\n            return this._createDepthStencilCubeTexture(e, t);\n          }\n          return this._createDepthStencilTexture(r, t);\n        }, wt.a.prototype._createDepthStencilTexture = function(r, t) {\n          var e = this._gl, n = r.layers || 0, i = n !== 0 ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D, o = new Pt.a(this, Pt.b.Depth);\n          if (!this._caps.depthTextureExtension)\n            return l.a.Error(\"Depth texture is not supported by your browser or hardware.\"), o;\n          var a = Object(c.a)({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1 }, t);\n          this._bindTextureDirectly(i, o, !0), this._setupDepthStencilTexture(o, r, a.generateStencil, a.bilinearFiltering, a.comparisonFunction);\n          var s = a.generateStencil ? e.UNSIGNED_INT_24_8 : e.UNSIGNED_INT, d = a.generateStencil ? e.DEPTH_STENCIL : e.DEPTH_COMPONENT, p = d;\n          return this.webGLVersion > 1 && (p = a.generateStencil ? e.DEPTH24_STENCIL8 : e.DEPTH_COMPONENT24), o.is2DArray ? e.texImage3D(i, 0, p, o.width, o.height, n, 0, d, s, null) : e.texImage2D(i, 0, p, o.width, o.height, 0, d, s, null), this._bindTextureDirectly(i, null), o;\n        };\n        var ft = function() {\n          function r(t, e, n, i, o, a, s, d, p, y, P, R, B, F, z) {\n            s === void 0 && (s = h.a.TEXTURE_NEAREST_SAMPLINGMODE), y === void 0 && (y = null), P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT), R === void 0 && (R = \"postprocess\"), F === void 0 && (F = !1), z === void 0 && (z = h.a.TEXTUREFORMAT_RGBA), this.width = -1, this.height = -1, this.nodeMaterialSource = null, this._outputTexture = null, this.autoClear = !0, this.alphaMode = h.a.ALPHA_DISABLE, this.animations = new Array(), this.enablePixelPerfectMode = !1, this.forceFullscreenViewport = !0, this.scaleMode = h.a.SCALEMODE_FLOOR, this.alwaysForcePOT = !1, this._samples = 1, this.adaptScaleToCurrentViewport = !1, this._reusable = !1, this._textures = new si.a(2), this._currentRenderTextureInd = 0, this._scaleRatio = new u.d(1, 1), this._texelSize = u.d.Zero(), this.onActivateObservable = new C.c(), this.onSizeChangedObservable = new C.c(), this.onApplyObservable = new C.c(), this.onBeforeRenderObservable = new C.c(), this.onAfterRenderObservable = new C.c(), this.name = t, a != null ? (this._camera = a, this._scene = a.getScene(), a.attachPostProcess(this), this._engine = this._scene.getEngine(), this._scene.postProcesses.push(this), this.uniqueId = this._scene.getUniqueId()) : d && (this._engine = d, this._engine.postProcesses.push(this)), this._options = o, this.renderTargetSamplingMode = s || h.a.TEXTURE_NEAREST_SAMPLINGMODE, this._reusable = p || !1, this._textureType = P, this._textureFormat = z, this._samplers = i || [], this._samplers.push(\"textureSampler\"), this._fragmentUrl = e, this._vertexUrl = R, this._parameters = n || [], this._parameters.push(\"scale\"), this._indexParameters = B, F || this.updateEffect(y);\n          }\n          return Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(t) {\n            var e = this;\n            this._samples = Math.min(t, this._engine.getCaps().maxMSAASamples), this._textures.forEach(function(n) {\n              n.samples !== e._samples && e._engine.updateRenderTargetTextureSampleCount(n, e._samples);\n            });\n          }, enumerable: !1, configurable: !0 }), r.prototype.getEffectName = function() {\n            return this._fragmentUrl;\n          }, Object.defineProperty(r.prototype, \"onActivate\", { set: function(t) {\n            this._onActivateObserver && this.onActivateObservable.remove(this._onActivateObserver), t && (this._onActivateObserver = this.onActivateObservable.add(t));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onSizeChanged\", { set: function(t) {\n            this._onSizeChangedObserver && this.onSizeChangedObservable.remove(this._onSizeChangedObserver), this._onSizeChangedObserver = this.onSizeChangedObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onApply\", { set: function(t) {\n            this._onApplyObserver && this.onApplyObservable.remove(this._onApplyObserver), this._onApplyObserver = this.onApplyObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onBeforeRender\", { set: function(t) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onAfterRender\", { set: function(t) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"inputTexture\", { get: function() {\n            return this._textures.data[this._currentRenderTextureInd];\n          }, set: function(t) {\n            this._forcedOutputTexture = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.restoreDefaultInputTexture = function() {\n            this._forcedOutputTexture = null;\n          }, r.prototype.getCamera = function() {\n            return this._camera;\n          }, Object.defineProperty(r.prototype, \"texelSize\", { get: function() {\n            return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.texelSize : (this._forcedOutputTexture && this._texelSize.copyFromFloats(1 / this._forcedOutputTexture.width, 1 / this._forcedOutputTexture.height), this._texelSize);\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"PostProcess\";\n          }, r.prototype.getEngine = function() {\n            return this._engine;\n          }, r.prototype.getEffect = function() {\n            return this._effect;\n          }, r.prototype.shareOutputWith = function(t) {\n            return this._disposeTextures(), this._shareOutputWithPostProcess = t, this;\n          }, r.prototype.useOwnOutput = function() {\n            this._textures.length == 0 && (this._textures = new si.a(2)), this._shareOutputWithPostProcess = null;\n          }, r.prototype.updateEffect = function(t, e, n, i, o, a, s, d) {\n            t === void 0 && (t = null), e === void 0 && (e = null), n === void 0 && (n = null), this._effect = this._engine.createEffect({ vertex: s ?? this._vertexUrl, fragment: d ?? this._fragmentUrl }, [\"position\"], e || this._parameters, n || this._samplers, t !== null ? t : \"\", void 0, o, a, i || this._indexParameters);\n          }, r.prototype.isReusable = function() {\n            return this._reusable;\n          }, r.prototype.markTextureDirty = function() {\n            this.width = -1;\n          }, r.prototype.activate = function(t, e, n) {\n            var i = this;\n            e === void 0 && (e = null);\n            var o = (t = t || this._camera).getScene(), a = o.getEngine(), s = a.getCaps().maxTextureSize, d = (e ? e.width : this._engine.getRenderWidth(!0)) * this._options | 0, p = (e ? e.height : this._engine.getRenderHeight(!0)) * this._options | 0, y = t.parent;\n            !y || y.leftCamera != t && y.rightCamera != t || (d /= 2);\n            var P, R = this._options.width || d, B = this._options.height || p, F = this.renderTargetSamplingMode !== h.a.TEXTURE_NEAREST_LINEAR && this.renderTargetSamplingMode !== h.a.TEXTURE_NEAREST_NEAREST && this.renderTargetSamplingMode !== h.a.TEXTURE_LINEAR_LINEAR;\n            if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\n              if (this.adaptScaleToCurrentViewport) {\n                var z = a.currentViewport;\n                z && (R *= z.width, B *= z.height);\n              }\n              if ((F || this.alwaysForcePOT) && (this._options.width || (R = a.needPOTTextures ? Ue.a.GetExponentOfTwo(R, s, this.scaleMode) : R), this._options.height || (B = a.needPOTTextures ? Ue.a.GetExponentOfTwo(B, s, this.scaleMode) : B)), this.width !== R || this.height !== B) {\n                if (this._textures.length > 0) {\n                  for (var J = 0; J < this._textures.length; J++)\n                    this._engine._releaseTexture(this._textures.data[J]);\n                  this._textures.reset();\n                }\n                this.width = R, this.height = B;\n                var ie = { width: this.width, height: this.height }, se = { generateMipMaps: F, generateDepthBuffer: n || t._postProcesses.indexOf(this) === 0, generateStencilBuffer: (n || t._postProcesses.indexOf(this) === 0) && this._engine.isStencilEnable, samplingMode: this.renderTargetSamplingMode, type: this._textureType, format: this._textureFormat };\n                this._textures.push(this._engine.createRenderTargetTexture(ie, se)), this._reusable && this._textures.push(this._engine.createRenderTargetTexture(ie, se)), this._texelSize.copyFromFloats(1 / this.width, 1 / this.height), this.onSizeChangedObservable.notifyObservers(this);\n              }\n              this._textures.forEach(function(ce) {\n                ce.samples !== i.samples && i._engine.updateRenderTargetTextureSampleCount(ce, i.samples);\n              });\n            }\n            return this._shareOutputWithPostProcess ? P = this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? (P = this._forcedOutputTexture, this.width = this._forcedOutputTexture.width, this.height = this._forcedOutputTexture.height) : P = this.inputTexture, this.enablePixelPerfectMode ? (this._scaleRatio.copyFromFloats(d / R, p / B), this._engine.bindFramebuffer(P, 0, d, p, this.forceFullscreenViewport)) : (this._scaleRatio.copyFromFloats(1, 1), this._engine.bindFramebuffer(P, 0, void 0, void 0, this.forceFullscreenViewport)), this.onActivateObservable.notifyObservers(t), this.autoClear && this.alphaMode === h.a.ALPHA_DISABLE && this._engine.clear(this.clearColor ? this.clearColor : o.clearColor, o._allowPostProcessClearColor, !0, !0), this._reusable && (this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2), P;\n          }, Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            return this._effect.isSupported;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"aspectRatio\", { get: function() {\n            return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.aspectRatio : this._forcedOutputTexture ? this._forcedOutputTexture.width / this._forcedOutputTexture.height : this.width / this.height;\n          }, enumerable: !1, configurable: !0 }), r.prototype.isReady = function() {\n            return this._effect && this._effect.isReady();\n          }, r.prototype.apply = function() {\n            return this._effect && this._effect.isReady() ? (this._engine.enableEffect(this._effect), this._engine.setState(!1), this._engine.setDepthBuffer(!1), this._engine.setDepthWrite(!1), this._engine.setAlphaMode(this.alphaMode), this.alphaConstants && this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a), t = this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? this._forcedOutputTexture : this.inputTexture, this._effect._bindTexture(\"textureSampler\", t), this._effect.setVector2(\"scale\", this._scaleRatio), this.onApplyObservable.notifyObservers(this._effect), this._effect) : null;\n            var t;\n          }, r.prototype._disposeTextures = function() {\n            if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\n              if (this._textures.length > 0)\n                for (var t = 0; t < this._textures.length; t++)\n                  this._engine._releaseTexture(this._textures.data[t]);\n              this._textures.dispose();\n            }\n          }, r.prototype.setPrePassRenderer = function(t) {\n            return !!this._prePassEffectConfiguration && (this._prePassEffectConfiguration = t.addEffectConfiguration(this._prePassEffectConfiguration), this._prePassEffectConfiguration.enabled = !0, !0);\n          }, r.prototype.dispose = function(t) {\n            var e;\n            if (t = t || this._camera, this._disposeTextures(), this._scene && (e = this._scene.postProcesses.indexOf(this)) !== -1 && this._scene.postProcesses.splice(e, 1), (e = this._engine.postProcesses.indexOf(this)) !== -1 && this._engine.postProcesses.splice(e, 1), t) {\n              if (t.detachPostProcess(this), (e = t._postProcesses.indexOf(this)) === 0 && t._postProcesses.length > 0) {\n                var n = this._camera._getFirstPostProcess();\n                n && n.markTextureDirty();\n              }\n              this.onActivateObservable.clear(), this.onAfterRenderObservable.clear(), this.onApplyObservable.clear(), this.onBeforeRenderObservable.clear(), this.onSizeChangedObservable.clear();\n            }\n          }, r.prototype.serialize = function() {\n            var t = L.a.Serialize(this);\n            return t.customType = \"BABYLON.\" + this.getClassName(), t.cameraId = this.getCamera().id, t.reusable = this._reusable, t.options = this._options, t.textureType = this._textureType, t;\n          }, r.Parse = function(t, e, n) {\n            var i = O.a.GetClass(t.customType);\n            if (!i || !i._Parse)\n              return null;\n            var o = e.getCameraByID(t.cameraId);\n            return o ? i._Parse(t, o, e, n) : null;\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"uniqueId\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"name\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"width\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"height\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"renderTargetSamplingMode\", void 0), Object(c.c)([Object(L.f)()], r.prototype, \"clearColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"autoClear\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"alphaMode\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"alphaConstants\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"enablePixelPerfectMode\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"forceFullscreenViewport\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"scaleMode\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"alwaysForcePOT\", void 0), Object(c.c)([Object(L.c)(\"samples\")], r.prototype, \"_samples\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"adaptScaleToCurrentViewport\", void 0), r;\n        }();\n        O.a.RegisteredTypes[\"BABYLON.PostProcess\"] = ft;\n        var yf = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}`;\n        ze.a.ShadersStore.passPixelShader = yf;\n        var bf = `\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nvoid main(void)\n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}`;\n        ze.a.ShadersStore.passCubePixelShader = bf;\n        var Ci = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            return i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1), r.call(this, e, \"pass\", null, null, n, i, o, a, s, void 0, d, void 0, null, p) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PassPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.PassPostProcess\"] = Ci;\n        var Tf = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"passCube\", null, null, n, i, o, a, s, \"#define POSITIVEX\", d, void 0, null, p) || this;\n            return y._face = 0, y;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"face\", { get: function() {\n            return this._face;\n          }, set: function(e) {\n            if (!(e < 0 || e > 5))\n              switch (this._face = e, this._face) {\n                case 0:\n                  this.updateEffect(\"#define POSITIVEX\");\n                  break;\n                case 1:\n                  this.updateEffect(\"#define NEGATIVEX\");\n                  break;\n                case 2:\n                  this.updateEffect(\"#define POSITIVEY\");\n                  break;\n                case 3:\n                  this.updateEffect(\"#define NEGATIVEY\");\n                  break;\n                case 4:\n                  this.updateEffect(\"#define POSITIVEZ\");\n                  break;\n                case 5:\n                  this.updateEffect(\"#define NEGATIVEZ\");\n              }\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PassCubePostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        Ue.a._RescalePostProcessFactory = function(r) {\n          return new Ci(\"rescale\", 1, null, h.a.TEXTURE_BILINEAR_SAMPLINGMODE, r, !1, h.a.TEXTURETYPE_UNSIGNED_INT);\n        };\n        var Ef = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}`;\n        ze.a.ShadersStore.anaglyphPixelShader = Ef;\n        var Ja = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, \"anaglyph\", null, [\"leftSampler\"], n, i[1], o, a, s) || this;\n            return d._passedProcess = i[0]._rigPostProcess, d.onApplyObservable.add(function(p) {\n              p.setTextureFromPostProcess(\"leftSampler\", d._passedProcess);\n            }), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphPostProcess\";\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.AnaglyphPostProcess\"] = Ja, _t.a._setStereoscopicAnaglyphRigMode = function(r) {\n          r._rigCameras[0]._rigPostProcess = new Ci(r.name + \"_passthru\", 1, r._rigCameras[0]), r._rigCameras[1]._rigPostProcess = new Ja(r.name + \"_anaglyph\", 1, r._rigCameras);\n        }, Q.a.AddNodeConstructor(\"AnaglyphArcRotateCamera\", function(r, t, e) {\n          return function() {\n            return new pl(r, 0, 0, 1, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var pl = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, n, i, o, a, d) || this;\n            return p.interaxialDistance = s, p.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: s }), p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphArcRotateCamera\";\n          }, t;\n        }(ji);\n        Q.a.AddNodeConstructor(\"AnaglyphFreeCamera\", function(r, t, e) {\n          return function() {\n            return new _l(r, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var _l = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, o) || this;\n            return a.interaxialDistance = i, a.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: i }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphFreeCamera\";\n          }, t;\n        }(zn);\n        Q.a.AddNodeConstructor(\"AnaglyphGamepadCamera\", function(r, t, e) {\n          return function() {\n            return new ml(r, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var ml = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, o) || this;\n            return a.interaxialDistance = i, a.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: i }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphGamepadCamera\";\n          }, t;\n        }(Co);\n        Q.a.AddNodeConstructor(\"AnaglyphUniversalCamera\", function(r, t, e) {\n          return function() {\n            return new gl(r, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var gl = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, o) || this;\n            return a.interaxialDistance = i, a.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: i }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphUniversalCamera\";\n          }, t;\n        }(sr), jn = f(58);\n        _t.a._setStereoscopicRigMode = function(r) {\n          var t = r.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || r.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED, e = r.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;\n          r._rigCameras[e ? 1 : 0].viewport = new jn.a(0, 0, t ? 0.5 : 1, t ? 1 : 0.5), r._rigCameras[e ? 0 : 1].viewport = new jn.a(t ? 0.5 : 0, t ? 0 : 0.5, t ? 0.5 : 1, t ? 1 : 0.5);\n        }, Q.a.AddNodeConstructor(\"StereoscopicArcRotateCamera\", function(r, t, e) {\n          return function() {\n            return new vl(r, 0, 0, 1, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var vl = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            var y = r.call(this, e, n, i, o, a, p) || this;\n            return y.interaxialDistance = s, y.isStereoscopicSideBySide = d, y.setCameraRigMode(d ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: s }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicArcRotateCamera\";\n          }, t;\n        }(ji);\n        Q.a.AddNodeConstructor(\"StereoscopicFreeCamera\", function(r, t, e) {\n          return function() {\n            return new yl(r, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var yl = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, n, a) || this;\n            return s.interaxialDistance = i, s.isStereoscopicSideBySide = o, s.setCameraRigMode(o ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: i }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicFreeCamera\";\n          }, t;\n        }(zn);\n        Q.a.AddNodeConstructor(\"StereoscopicGamepadCamera\", function(r, t, e) {\n          return function() {\n            return new bl(r, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var bl = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, n, a) || this;\n            return s.interaxialDistance = i, s.isStereoscopicSideBySide = o, s.setCameraRigMode(o ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: i }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicGamepadCamera\";\n          }, t;\n        }(Co);\n        Q.a.AddNodeConstructor(\"StereoscopicFreeCamera\", function(r, t, e) {\n          return function() {\n            return new Tl(r, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var Tl = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, n, a) || this;\n            return s.interaxialDistance = i, s.isStereoscopicSideBySide = o, s.setCameraRigMode(o ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: i }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicUniversalCamera\";\n          }, t;\n        }(sr);\n        Q.a.AddNodeConstructor(\"VirtualJoysticksCamera\", function(r, t) {\n          return function() {\n            return new El(r, u.e.Zero(), t);\n          };\n        });\n        var El = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.inputs.addVirtualJoystick(), o;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VirtualJoysticksCamera\";\n          }, t;\n        }(zn), cr = function() {\n          function r() {\n            this.compensateDistortion = !0, this.multiviewEnabled = !1;\n          }\n          return Object.defineProperty(r.prototype, \"aspectRatio\", { get: function() {\n            return this.hResolution / (2 * this.vResolution);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"aspectRatioFov\", { get: function() {\n            return 2 * Math.atan(this.postProcessScaleFactor * this.vScreenSize / (2 * this.eyeToScreenDistance));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"leftHMatrix\", { get: function() {\n            var t = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;\n            return u.a.Translation(t, 0, 0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightHMatrix\", { get: function() {\n            var t = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;\n            return u.a.Translation(-t, 0, 0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"leftPreViewMatrix\", { get: function() {\n            return u.a.Translation(0.5 * this.interpupillaryDistance, 0, 0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightPreViewMatrix\", { get: function() {\n            return u.a.Translation(-0.5 * this.interpupillaryDistance, 0, 0);\n          }, enumerable: !1, configurable: !0 }), r.GetDefault = function() {\n            var t = new r();\n            return t.hResolution = 1280, t.vResolution = 800, t.hScreenSize = 0.149759993, t.vScreenSize = 0.0935999975, t.vScreenCenter = 0.0467999987, t.eyeToScreenDistance = 0.0410000011, t.lensSeparationDistance = 0.063500002, t.interpupillaryDistance = 0.064000003, t.distortionK = [1, 0.219999999, 0.239999995, 0], t.chromaAbCorrection = [0.995999992, -0.00400000019, 1.01400006, 0], t.postProcessScaleFactor = 1.714605507808412, t.lensCenterOffset = 0.151976421, t;\n          }, r;\n        }(), Sf = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn;\nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}`;\n        ze.a.ShadersStore.vrDistortionCorrectionPixelShader = Sf;\n        var $a = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, \"vrDistortionCorrection\", [\"LensCenter\", \"Scale\", \"ScaleIn\", \"HmdWarpParam\"], null, o.postProcessScaleFactor, n, Ne.a.BILINEAR_SAMPLINGMODE) || this;\n            return a._isRightEye = i, a._distortionFactors = o.distortionK, a._postProcessScaleFactor = o.postProcessScaleFactor, a._lensCenterOffset = o.lensCenterOffset, a.adaptScaleToCurrentViewport = !0, a.onSizeChangedObservable.add(function() {\n              a._scaleIn = new u.d(2, 2 / a.aspectRatio), a._scaleFactor = new u.d(1 / a._postProcessScaleFactor * 0.5, 1 / a._postProcessScaleFactor * 0.5 * a.aspectRatio), a._lensCenter = new u.d(a._isRightEye ? 0.5 - 0.5 * a._lensCenterOffset : 0.5 + 0.5 * a._lensCenterOffset, 0.5);\n            }), a.onApplyObservable.add(function(s) {\n              s.setFloat2(\"LensCenter\", a._lensCenter.x, a._lensCenter.y), s.setFloat2(\"Scale\", a._scaleFactor.x, a._scaleFactor.y), s.setFloat2(\"ScaleIn\", a._scaleIn.x, a._scaleIn.y), s.setFloat4(\"HmdWarpParam\", a._distortionFactors[0], a._distortionFactors[1], a._distortionFactors[2], a._distortionFactors[3]);\n            }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDistortionCorrectionPostProcess\";\n          }, t;\n        }(ft), Af = `precision mediump sampler2DArray;\nvarying vec2 vUV;\nuniform sampler2DArray multiviewSampler;\nuniform int imageIndex;\nvoid main(void)\n{\ngl_FragColor=texture(multiviewSampler,vec3(vUV,imageIndex));\n}`;\n        ze.a.ShadersStore.vrMultiviewToSingleviewPixelShader = Af;\n        var Sl = f(85), es = f(95), Hr = f(96);\n        wt.a.prototype.createRenderTargetCubeTexture = function(r, t) {\n          var e = Object(c.a)({ generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: h.a.TEXTURETYPE_UNSIGNED_INT, samplingMode: h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, format: h.a.TEXTUREFORMAT_RGBA }, t);\n          e.generateStencilBuffer = e.generateDepthBuffer && e.generateStencilBuffer, (e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (e.type !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (e.samplingMode = h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n          var n = this._gl, i = new Pt.a(this, Pt.b.RenderTarget);\n          this._bindTextureDirectly(n.TEXTURE_CUBE_MAP, i, !0);\n          var o = this._getSamplingParameters(e.samplingMode, e.generateMipMaps);\n          e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (e.type = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type\")), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, o.mag), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, o.min), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE);\n          for (var a = 0; a < 6; a++)\n            n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, this._getRGBABufferInternalSizedFormat(e.type, e.format), r, r, 0, this._getInternalFormat(e.format), this._getWebGLTextureType(e.type), null);\n          var s = n.createFramebuffer();\n          return this._bindUnboundFramebuffer(s), i._depthStencilBuffer = this._setupFramebufferDepthAttachments(e.generateStencilBuffer, e.generateDepthBuffer, r, r), e.generateMipMaps && n.generateMipmap(n.TEXTURE_CUBE_MAP), this._bindTextureDirectly(n.TEXTURE_CUBE_MAP, null), this._bindUnboundFramebuffer(null), i._framebuffer = s, i.width = r, i.height = r, i.isReady = !0, i.isCube = !0, i.samples = 1, i.generateMipMaps = e.generateMipMaps, i.samplingMode = e.samplingMode, i.type = e.type, i.format = e.format, i._generateDepthBuffer = e.generateDepthBuffer, i._generateStencilBuffer = e.generateStencilBuffer, this._internalTexturesCache.push(i), i;\n        };\n        var on = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R, B, F) {\n            a === void 0 && (a = !0), s === void 0 && (s = h.a.TEXTURETYPE_UNSIGNED_INT), d === void 0 && (d = !1), p === void 0 && (p = Ne.a.TRILINEAR_SAMPLINGMODE), y === void 0 && (y = !0), P === void 0 && (P = !1), R === void 0 && (R = !1), B === void 0 && (B = h.a.TEXTUREFORMAT_RGBA), F === void 0 && (F = !1);\n            var z = r.call(this, null, i, !o) || this;\n            return z.renderParticles = !0, z.renderSprites = !1, z.ignoreCameraViewport = !1, z.onBeforeBindObservable = new C.c(), z.onAfterUnbindObservable = new C.c(), z.onBeforeRenderObservable = new C.c(), z.onAfterRenderObservable = new C.c(), z.onClearObservable = new C.c(), z.onResizeObservable = new C.c(), z._currentRefreshId = -1, z._refreshRate = 1, z._samples = 1, z.boundingBoxPosition = u.e.Zero(), (i = z.getScene()) && (z._coordinatesMode = Ne.a.PROJECTION_MODE, z.renderList = new Array(), z.name = e, z.isRenderTarget = !0, z._initialSizeParameter = n, z._processSizeParameter(n), z._resizeObserver = z.getScene().getEngine().onResizeObservable.add(function() {\n            }), z._generateMipMaps = !!o, z._doNotChangeAspectRatio = a, z._renderingManager = new Hr.b(i), z._renderingManager._useSceneAutoClearSetup = !0, R || (z._renderTargetOptions = { generateMipMaps: o, type: s, format: B, samplingMode: p, generateDepthBuffer: y, generateStencilBuffer: P }, p === Ne.a.NEAREST_SAMPLINGMODE && (z.wrapU = Ne.a.CLAMP_ADDRESSMODE, z.wrapV = Ne.a.CLAMP_ADDRESSMODE), F || (d ? (z._texture = i.getEngine().createRenderTargetCubeTexture(z.getRenderSize(), z._renderTargetOptions), z.coordinatesMode = Ne.a.INVCUBIC_MODE, z._textureMatrix = u.a.Identity()) : z._texture = i.getEngine().createRenderTargetTexture(z._size, z._renderTargetOptions)))), z;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"renderList\", { get: function() {\n            return this._renderList;\n          }, set: function(e) {\n            this._renderList = e, this._renderList && this._hookArray(this._renderList);\n          }, enumerable: !1, configurable: !0 }), t.prototype._hookArray = function(e) {\n            var n = this, i = e.push;\n            e.push = function() {\n              for (var a = [], s = 0; s < arguments.length; s++)\n                a[s] = arguments[s];\n              var d = e.length === 0, p = i.apply(e, a);\n              return d && n.getScene() && n.getScene().meshes.forEach(function(y) {\n                y._markSubMeshesAsLightDirty();\n              }), p;\n            };\n            var o = e.splice;\n            e.splice = function(a, s) {\n              var d = o.apply(e, [a, s]);\n              return e.length === 0 && n.getScene().meshes.forEach(function(p) {\n                p._markSubMeshesAsLightDirty();\n              }), d;\n            };\n          }, Object.defineProperty(t.prototype, \"onAfterUnbind\", { set: function(e) {\n            this._onAfterUnbindObserver && this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onBeforeRender\", { set: function(e) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onAfterRender\", { set: function(e) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onClear\", { set: function(e) {\n            this._onClearObserver && this.onClearObservable.remove(this._onClearObserver), this._onClearObserver = this.onClearObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"renderTargetOptions\", { get: function() {\n            return this._renderTargetOptions;\n          }, enumerable: !1, configurable: !0 }), t.prototype._onRatioRescale = function() {\n            this._sizeRatio && this.resize(this._initialSizeParameter);\n          }, Object.defineProperty(t.prototype, \"boundingBoxSize\", { get: function() {\n            return this._boundingBoxSize;\n          }, set: function(e) {\n            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {\n              this._boundingBoxSize = e;\n              var n = this.getScene();\n              n && n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthStencilTexture\", { get: function() {\n            var e;\n            return ((e = this.getInternalTexture()) === null || e === void 0 ? void 0 : e._depthStencilTexture) || null;\n          }, enumerable: !1, configurable: !0 }), t.prototype.createDepthStencilTexture = function(e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = !0), i === void 0 && (i = !1);\n            var o = this.getInternalTexture();\n            if (this.getScene() && o) {\n              var a = this.getScene().getEngine();\n              o._depthStencilTexture = a.createDepthStencilTexture(this._size, { bilinearFiltering: n, comparisonFunction: e, generateStencil: i, isCube: this.isCube });\n            }\n          }, t.prototype._processSizeParameter = function(e) {\n            if (e.ratio) {\n              this._sizeRatio = e.ratio;\n              var n = this._getEngine();\n              this._size = { width: this._bestReflectionRenderTargetDimension(n.getRenderWidth(), this._sizeRatio), height: this._bestReflectionRenderTargetDimension(n.getRenderHeight(), this._sizeRatio) };\n            } else\n              this._size = e;\n          }, Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            if (this._samples !== e) {\n              var n = this.getScene();\n              n && (this._samples = n.getEngine().updateRenderTargetTextureSampleCount(this._texture, e));\n            }\n          }, enumerable: !1, configurable: !0 }), t.prototype.resetRefreshCounter = function() {\n            this._currentRefreshId = -1;\n          }, Object.defineProperty(t.prototype, \"refreshRate\", { get: function() {\n            return this._refreshRate;\n          }, set: function(e) {\n            this._refreshRate = e, this.resetRefreshCounter();\n          }, enumerable: !1, configurable: !0 }), t.prototype.addPostProcess = function(e) {\n            if (!this._postProcessManager) {\n              var n = this.getScene();\n              if (!n)\n                return;\n              this._postProcessManager = new es.a(n), this._postProcesses = new Array();\n            }\n            this._postProcesses.push(e), this._postProcesses[0].autoClear = !1;\n          }, t.prototype.clearPostProcesses = function(e) {\n            if (e === void 0 && (e = !1), this._postProcesses) {\n              if (e)\n                for (var n = 0, i = this._postProcesses; n < i.length; n++)\n                  i[n].dispose();\n              this._postProcesses = [];\n            }\n          }, t.prototype.removePostProcess = function(e) {\n            if (this._postProcesses) {\n              var n = this._postProcesses.indexOf(e);\n              n !== -1 && (this._postProcesses.splice(n, 1), this._postProcesses.length > 0 && (this._postProcesses[0].autoClear = !1));\n            }\n          }, t.prototype._shouldRender = function() {\n            return this._currentRefreshId === -1 || this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : (this._currentRefreshId++, !1);\n          }, t.prototype.getRenderSize = function() {\n            return this.getRenderWidth();\n          }, t.prototype.getRenderWidth = function() {\n            return this._size.width ? this._size.width : this._size;\n          }, t.prototype.getRenderHeight = function() {\n            return this._size.width ? this._size.height : this._size;\n          }, t.prototype.getRenderLayers = function() {\n            var e = this._size.layers;\n            return e || 0;\n          }, Object.defineProperty(t.prototype, \"canRescale\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), t.prototype.scale = function(e) {\n            var n = Math.max(1, this.getRenderSize() * e);\n            this.resize(n);\n          }, t.prototype.getReflectionTextureMatrix = function() {\n            return this.isCube ? this._textureMatrix : r.prototype.getReflectionTextureMatrix.call(this);\n          }, t.prototype.resize = function(e) {\n            var n = this.isCube;\n            this.releaseInternalTexture();\n            var i = this.getScene();\n            i && (this._processSizeParameter(e), this._texture = n ? i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions) : i.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions), this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this));\n          }, t.prototype.render = function(e, n) {\n            if (e === void 0 && (e = !1), n === void 0 && (n = !1), p = this.getScene()) {\n              var i, o = p.getEngine();\n              if (this.useCameraPostProcesses !== void 0 && (e = this.useCameraPostProcesses), this._waitingRenderList) {\n                this.renderList = [];\n                for (var a = 0; a < this._waitingRenderList.length; a++) {\n                  var s = this._waitingRenderList[a], d = p.getMeshByID(s);\n                  d && this.renderList.push(d);\n                }\n                this._waitingRenderList = void 0;\n              }\n              if (this.renderListPredicate) {\n                var p;\n                if (this.renderList ? this.renderList.length = 0 : this.renderList = [], !(p = this.getScene()))\n                  return;\n                var y = p.meshes;\n                for (a = 0; a < y.length; a++) {\n                  var P = y[a];\n                  this.renderListPredicate(P) && this.renderList.push(P);\n                }\n              }\n              if (this.onBeforeBindObservable.notifyObservers(this), this.activeCamera ? (i = this.activeCamera, o.setViewport(this.activeCamera.viewport, this.getRenderWidth(), this.getRenderHeight()), this.activeCamera !== p.activeCamera && p.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(!0))) : (i = p.activeCamera) && o.setViewport(i.viewport, this.getRenderWidth(), this.getRenderHeight()), this._defaultRenderListPrepared = !1, this.is2DArray)\n                for (var R = 0; R < this.getRenderLayers(); R++)\n                  this.renderToTarget(0, e, n, R, i), p.incrementRenderId(), p.resetCachedMaterial();\n              else if (this.isCube)\n                for (var B = 0; B < 6; B++)\n                  this.renderToTarget(B, e, n, void 0, i), p.incrementRenderId(), p.resetCachedMaterial();\n              else\n                this.renderToTarget(0, e, n, void 0, i);\n              this.onAfterUnbindObservable.notifyObservers(this), p.activeCamera && ((p.getEngine().scenes.length > 1 || this.activeCamera && this.activeCamera !== p.activeCamera) && p.setTransformMatrix(p.activeCamera.getViewMatrix(), p.activeCamera.getProjectionMatrix(!0)), o.setViewport(p.activeCamera.viewport)), p.resetCachedMaterial();\n            }\n          }, t.prototype._bestReflectionRenderTargetDimension = function(e, n) {\n            var i = e * n, o = Ue.a.NearestPOT(i + 16384 / (128 + i));\n            return Math.min(Ue.a.FloorPOT(e), o);\n          }, t.prototype._prepareRenderingManager = function(e, n, i, o) {\n            var a = this.getScene();\n            if (a) {\n              this._renderingManager.reset();\n              for (var s = a.getRenderId(), d = 0; d < n; d++) {\n                var p = e[d];\n                if (p && !p.isBlocked) {\n                  if (this.customIsReadyFunction) {\n                    if (!this.customIsReadyFunction(p, this.refreshRate)) {\n                      this.resetRefreshCounter();\n                      continue;\n                    }\n                  } else if (!p.isReady(this.refreshRate === 0)) {\n                    this.resetRefreshCounter();\n                    continue;\n                  }\n                  if (!p._internalAbstractMeshDataInfo._currentLODIsUpToDate && a.activeCamera && (p._internalAbstractMeshDataInfo._currentLOD = a.customLODSelector ? a.customLODSelector(p, a.activeCamera) : p.getLOD(a.activeCamera), p._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0), !p._internalAbstractMeshDataInfo._currentLOD)\n                    continue;\n                  var y = p._internalAbstractMeshDataInfo._currentLOD;\n                  y._preActivateForIntermediateRendering(s);\n                  var P = void 0;\n                  if (P = !(!o || !i) && (p.layerMask & i.layerMask) == 0, p.isEnabled() && p.isVisible && p.subMeshes && !P && (y !== p && y._activate(s, !0), p._activate(s, !0) && p.subMeshes.length)) {\n                    p.isAnInstance ? p._internalAbstractMeshDataInfo._actAsRegularMesh && (y = p) : y._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !1, y._internalAbstractMeshDataInfo._isActiveIntermediate = !0;\n                    for (var R = 0; R < y.subMeshes.length; R++) {\n                      var B = y.subMeshes[R];\n                      this._renderingManager.dispatch(B, y);\n                    }\n                  }\n                }\n              }\n              for (var F = 0; F < a.particleSystems.length; F++) {\n                var z = a.particleSystems[F], J = z.emitter;\n                z.isStarted() && J && J.position && J.isEnabled() && e.indexOf(J) >= 0 && this._renderingManager.dispatchParticles(z);\n              }\n            }\n          }, t.prototype._bindFrameBuffer = function(e, n) {\n            e === void 0 && (e = 0), n === void 0 && (n = 0);\n            var i = this.getScene();\n            if (i) {\n              var o = i.getEngine();\n              this._texture && o.bindFramebuffer(this._texture, this.isCube ? e : void 0, void 0, void 0, this.ignoreCameraViewport, 0, n);\n            }\n          }, t.prototype.unbindFrameBuffer = function(e, n) {\n            var i = this;\n            this._texture && e.unBindFramebuffer(this._texture, this.isCube, function() {\n              i.onAfterRenderObservable.notifyObservers(n);\n            });\n          }, t.prototype.renderToTarget = function(e, n, i, o, a) {\n            o === void 0 && (o = 0), a === void 0 && (a = null);\n            var s = this.getScene();\n            if (s) {\n              var d = s.getEngine();\n              if (this._texture) {\n                this._postProcessManager ? this._postProcessManager._prepareFrame(this._texture, this._postProcesses) : n && s.postProcessManager._prepareFrame(this._texture) || this._bindFrameBuffer(e, o), this.is2DArray ? this.onBeforeRenderObservable.notifyObservers(o) : this.onBeforeRenderObservable.notifyObservers(e);\n                var p = null, y = this.renderList ? this.renderList : s.getActiveMeshes().data, P = this.renderList ? this.renderList.length : s.getActiveMeshes().length;\n                this.getCustomRenderList && (p = this.getCustomRenderList(this.is2DArray ? o : e, y, P)), p ? this._prepareRenderingManager(p, p.length, a, !1) : (this._defaultRenderListPrepared || (this._prepareRenderingManager(y, P, a, !this.renderList), this._defaultRenderListPrepared = !0), p = y), this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(d) : d.clear(this.clearColor || s.clearColor, !0, !0, !0), this._doNotChangeAspectRatio || s.updateTransformMatrix(!0);\n                for (var R = 0, B = s._beforeRenderTargetDrawStage; R < B.length; R++)\n                  B[R].action(this);\n                this._renderingManager.render(this.customRenderFunction, p, this.renderParticles, this.renderSprites);\n                for (var F = 0, z = s._afterRenderTargetDrawStage; F < z.length; F++)\n                  z[F].action(this);\n                this._postProcessManager ? this._postProcessManager._finalizeFrame(!1, this._texture, e, this._postProcesses, this.ignoreCameraViewport) : n && s.postProcessManager._finalizeFrame(!1, this._texture, e), this._doNotChangeAspectRatio || s.updateTransformMatrix(!0), i && Xe.b.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), d), this.isCube && e !== 5 ? this.onAfterRenderObservable.notifyObservers(e) : (this.isCube && e === 5 && d.generateMipMapsForCubemap(this._texture), this.unbindFrameBuffer(d, e));\n              }\n            }\n          }, t.prototype.setRenderingOrder = function(e, n, i, o) {\n            n === void 0 && (n = null), i === void 0 && (i = null), o === void 0 && (o = null), this._renderingManager.setRenderingOrder(e, n, i, o);\n          }, t.prototype.setRenderingAutoClearDepthStencil = function(e, n) {\n            this._renderingManager.setRenderingAutoClearDepthStencil(e, n), this._renderingManager._useSceneAutoClearSetup = !1;\n          }, t.prototype.clone = function() {\n            var e = this.getSize(), n = new t(this.name, e, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer);\n            return n.hasAlpha = this.hasAlpha, n.level = this.level, n.coordinatesMode = this.coordinatesMode, this.renderList && (n.renderList = this.renderList.slice(0)), n;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = r.prototype.serialize.call(this);\n            if (e.renderTargetSize = this.getRenderSize(), e.renderList = [], this.renderList)\n              for (var n = 0; n < this.renderList.length; n++)\n                e.renderList.push(this.renderList[n].id);\n            return e;\n          }, t.prototype.disposeFramebufferObjects = function() {\n            var e = this.getInternalTexture(), n = this.getScene();\n            e && n && n.getEngine()._releaseFramebufferObjects(e);\n          }, t.prototype.dispose = function() {\n            this.onResizeObservable.clear(), this.onClearObservable.clear(), this.onAfterRenderObservable.clear(), this.onAfterUnbindObservable.clear(), this.onBeforeBindObservable.clear(), this.onBeforeRenderObservable.clear(), this._postProcessManager && (this._postProcessManager.dispose(), this._postProcessManager = null), this.clearPostProcesses(!0), this._resizeObserver && (this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.renderList = null;\n            var e = this.getScene();\n            if (e) {\n              var n = e.customRenderTargets.indexOf(this);\n              n >= 0 && e.customRenderTargets.splice(n, 1);\n              for (var i = 0, o = e.cameras; i < o.length; i++) {\n                var a = o[i];\n                (n = a.customRenderTargets.indexOf(this)) >= 0 && a.customRenderTargets.splice(n, 1);\n              }\n              this.depthStencilTexture && this.getScene().getEngine()._releaseTexture(this.depthStencilTexture), r.prototype.dispose.call(this);\n            }\n          }, t.prototype._rebuild = function() {\n            this.refreshRate === t.REFRESHRATE_RENDER_ONCE && (this.refreshRate = t.REFRESHRATE_RENDER_ONCE), this._postProcessManager && this._postProcessManager._rebuild();\n          }, t.prototype.freeRenderingGroups = function() {\n            this._renderingManager && this._renderingManager.freeRenderingGroups();\n          }, t.prototype.getViewCount = function() {\n            return 1;\n          }, t.REFRESHRATE_RENDER_ONCE = 0, t.REFRESHRATE_RENDER_ONEVERYFRAME = 1, t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2, t;\n        }(Ne.a);\n        Ne.a._CreateRenderTargetTexture = function(r, t, e, n) {\n          return new on(r, t, e, n);\n        };\n        var Al = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = 512);\n            var i = r.call(this, \"multiview rtt\", n, e, !1, !0, Pt.b.Unknown, !1, void 0, !1, !1, !0, void 0, !0) || this, o = e.getEngine().createMultiviewRenderTargetTexture(i.getRenderWidth(), i.getRenderHeight());\n            return o.isMultiview = !0, o.format = h.a.TEXTUREFORMAT_RGBA, i._texture = o, i.samples = i._getEngine().getCaps().maxSamples || i.samples, i;\n          }\n          return Object(c.d)(t, r), t.prototype._bindFrameBuffer = function(e) {\n            this._texture && this.getScene().getEngine().bindMultiviewFramebuffer(this._texture);\n          }, t.prototype.getViewCount = function() {\n            return 2;\n          }, t;\n        }(on), Pl = f(90);\n        Ue.a.prototype.createMultiviewRenderTargetTexture = function(r, t) {\n          var e = this._gl;\n          if (!this.getCaps().multiview)\n            throw \"Multiview is not supported\";\n          var n = new Pt.a(this, Pt.b.Unknown, !0);\n          return n.width = r, n.height = t, n._framebuffer = e.createFramebuffer(), n._colorTextureArray = e.createTexture(), e.bindTexture(e.TEXTURE_2D_ARRAY, n._colorTextureArray), e.texStorage3D(e.TEXTURE_2D_ARRAY, 1, e.RGBA8, r, t, 2), n._depthStencilTextureArray = e.createTexture(), e.bindTexture(e.TEXTURE_2D_ARRAY, n._depthStencilTextureArray), e.texStorage3D(e.TEXTURE_2D_ARRAY, 1, e.DEPTH32F_STENCIL8, r, t, 2), n.isReady = !0, n;\n        }, Ue.a.prototype.bindMultiviewFramebuffer = function(r) {\n          var t = this._gl, e = this.getCaps().oculusMultiview || this.getCaps().multiview;\n          if (this.bindFramebuffer(r, void 0, void 0, void 0, !0), t.bindFramebuffer(t.DRAW_FRAMEBUFFER, r._framebuffer), !r._colorTextureArray || !r._depthStencilTextureArray)\n            throw \"Invalid multiview frame buffer\";\n          this.getCaps().oculusMultiview ? (e.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, r._colorTextureArray, 0, r.samples, 0, 2), e.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, r._depthStencilTextureArray, 0, r.samples, 0, 2)) : (e.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, r._colorTextureArray, 0, 0, 2), e.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, r._depthStencilTextureArray, 0, 0, 2));\n        }, _t.a.prototype._useMultiviewToSingleView = !1, _t.a.prototype._multiviewTexture = null, _t.a.prototype._resizeOrCreateMultiviewTexture = function(r, t) {\n          this._multiviewTexture ? this._multiviewTexture.getRenderWidth() == r && this._multiviewTexture.getRenderHeight() == t || (this._multiviewTexture.dispose(), this._multiviewTexture = new Al(this.getScene(), { width: r, height: t })) : this._multiviewTexture = new Al(this.getScene(), { width: r, height: t });\n        }, _e.a.prototype._transformMatrixR = u.a.Zero(), _e.a.prototype._multiviewSceneUbo = null, _e.a.prototype._createMultiviewUbo = function() {\n          this._multiviewSceneUbo = new Sl.a(this.getEngine(), void 0, !0), this._multiviewSceneUbo.addUniform(\"viewProjection\", 16), this._multiviewSceneUbo.addUniform(\"viewProjectionR\", 16), this._multiviewSceneUbo.addUniform(\"view\", 16);\n        }, _e.a.prototype._updateMultiviewUbo = function(r, t) {\n          r && t && r.multiplyToRef(t, this._transformMatrixR), r && t && (r.multiplyToRef(t, u.c.Matrix[0]), Pl.a.GetRightPlaneToRef(u.c.Matrix[0], this._frustumPlanes[3])), this._multiviewSceneUbo && (this._multiviewSceneUbo.updateMatrix(\"viewProjection\", this.getTransformMatrix()), this._multiviewSceneUbo.updateMatrix(\"viewProjectionR\", this._transformMatrixR), this._multiviewSceneUbo.updateMatrix(\"view\", this._viewMatrix), this._multiviewSceneUbo.update());\n        }, _e.a.prototype._renderMultiviewToSingleView = function(r) {\n          r._resizeOrCreateMultiviewTexture(r._rigPostProcess && r._rigPostProcess && r._rigPostProcess.width > 0 ? r._rigPostProcess.width : this.getEngine().getRenderWidth(!0), r._rigPostProcess && r._rigPostProcess && r._rigPostProcess.height > 0 ? r._rigPostProcess.height : this.getEngine().getRenderHeight(!0)), this._multiviewSceneUbo || this._createMultiviewUbo(), r.outputRenderTarget = r._multiviewTexture, this._renderForCamera(r), r.outputRenderTarget = null;\n          for (var t = 0; t < r._rigCameras.length; t++) {\n            var e = this.getEngine();\n            this._activeCamera = r._rigCameras[t], e.setViewport(this._activeCamera.viewport), this.postProcessManager && (this.postProcessManager._prepareFrame(), this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate));\n          }\n        };\n        var ts = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, \"vrMultiviewToSingleview\", [\"imageIndex\"], [\"multiviewSampler\"], i, n, Ne.a.BILINEAR_SAMPLINGMODE) || this;\n            return o.onSizeChangedObservable.add(function() {\n            }), o.onApplyObservable.add(function(a) {\n              n._scene.activeCamera && n._scene.activeCamera.isLeftCamera ? a.setInt(\"imageIndex\", 0) : a.setInt(\"imageIndex\", 1), a.setTexture(\"multiviewSampler\", n._multiviewTexture);\n            }), o;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRMultiviewToSingleviewPostProcess\";\n          }, t;\n        }(ft);\n        _t.a._setVRRigMode = function(r, t) {\n          var e = t.vrCameraMetrics || cr.GetDefault();\n          r._rigCameras[0]._cameraRigParams.vrMetrics = e, r._rigCameras[0].viewport = new jn.a(0, 0, 0.5, 1), r._rigCameras[0]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[0]._cameraRigParams.vrHMatrix = e.leftHMatrix, r._rigCameras[0]._cameraRigParams.vrPreViewMatrix = e.leftPreViewMatrix, r._rigCameras[0].getProjectionMatrix = r._rigCameras[0]._getVRProjectionMatrix, r._rigCameras[1]._cameraRigParams.vrMetrics = e, r._rigCameras[1].viewport = new jn.a(0.5, 0, 0.5, 1), r._rigCameras[1]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[1]._cameraRigParams.vrHMatrix = e.rightHMatrix, r._rigCameras[1]._cameraRigParams.vrPreViewMatrix = e.rightPreViewMatrix, r._rigCameras[1].getProjectionMatrix = r._rigCameras[1]._getVRProjectionMatrix, e.multiviewEnabled && (r.getScene().getEngine().getCaps().multiview ? (r._useMultiviewToSingleView = !0, r._rigPostProcess = new ts(\"VRMultiviewToSingleview\", r, e.postProcessScaleFactor)) : (l.a.Warn(\"Multiview is not supported, falling back to standard rendering\"), e.multiviewEnabled = !1)), e.compensateDistortion && (r._rigCameras[0]._rigPostProcess = new $a(\"VR_Distort_Compensation_Left\", r._rigCameras[0], !1, e), r._rigCameras[1]._rigPostProcess = new $a(\"VR_Distort_Compensation_Right\", r._rigCameras[1], !0, e));\n        }, Q.a.AddNodeConstructor(\"VRDeviceOrientationFreeCamera\", function(r, t) {\n          return function() {\n            return new xl(r, 0, 0, 1, u.e.Zero(), t);\n          };\n        });\n        var xl = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = !0), p === void 0 && (p = cr.GetDefault());\n            var y = r.call(this, e, n, i, o, a, s) || this;\n            return p.compensateDistortion = d, y.setCameraRigMode(_t.a.RIG_MODE_VR, { vrCameraMetrics: p }), y.inputs.addVRDeviceOrientation(), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDeviceOrientationArcRotateCamera\";\n          }, t;\n        }(ji);\n        Q.a.AddNodeConstructor(\"VRDeviceOrientationFreeCamera\", function(r, t) {\n          return function() {\n            return new Ro(r, u.e.Zero(), t);\n          };\n        });\n        var Ro = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !0), a === void 0 && (a = cr.GetDefault());\n            var s = r.call(this, e, n, i) || this;\n            return a.compensateDistortion = o, s.setCameraRigMode(_t.a.RIG_MODE_VR, { vrCameraMetrics: a }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDeviceOrientationFreeCamera\";\n          }, t;\n        }(xo);\n        Q.a.AddNodeConstructor(\"VRDeviceOrientationGamepadCamera\", function(r, t) {\n          return function() {\n            return new Cl(r, u.e.Zero(), t);\n          };\n        });\n        var Cl = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !0), a === void 0 && (a = cr.GetDefault());\n            var s = r.call(this, e, n, i, o, a) || this;\n            return s.inputs.addGamepad(), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDeviceOrientationGamepadCamera\";\n          }, t;\n        }(Ro), Oo = f(86);\n        _t.a._setWebVRRigMode = function(r, t) {\n          if (t.vrDisplay) {\n            var e = t.vrDisplay.getEyeParameters(\"left\"), n = t.vrDisplay.getEyeParameters(\"right\");\n            r._rigCameras[0].viewport = new jn.a(0, 0, 0.5, 1), r._rigCameras[0].setCameraRigParameter(\"left\", !0), r._rigCameras[0].setCameraRigParameter(\"specs\", t.specs), r._rigCameras[0].setCameraRigParameter(\"eyeParameters\", e), r._rigCameras[0].setCameraRigParameter(\"frameData\", t.frameData), r._rigCameras[0].setCameraRigParameter(\"parentCamera\", t.parentCamera), r._rigCameras[0]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[0].getProjectionMatrix = r._getWebVRProjectionMatrix, r._rigCameras[0].parent = r, r._rigCameras[0]._getViewMatrix = r._getWebVRViewMatrix, r._rigCameras[1].viewport = new jn.a(0.5, 0, 0.5, 1), r._rigCameras[1].setCameraRigParameter(\"eyeParameters\", n), r._rigCameras[1].setCameraRigParameter(\"specs\", t.specs), r._rigCameras[1].setCameraRigParameter(\"frameData\", t.frameData), r._rigCameras[1].setCameraRigParameter(\"parentCamera\", t.parentCamera), r._rigCameras[1]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[1].getProjectionMatrix = r._getWebVRProjectionMatrix, r._rigCameras[1].parent = r, r._rigCameras[1]._getViewMatrix = r._getWebVRViewMatrix;\n          }\n        }, Object.defineProperty(Ue.a.prototype, \"isInVRExclusivePointerMode\", { get: function() {\n          return this._vrExclusivePointerMode;\n        }, enumerable: !0, configurable: !0 }), Ue.a.prototype._prepareVRComponent = function() {\n          this._vrSupported = !1, this._vrExclusivePointerMode = !1, this.onVRDisplayChangedObservable = new C.c(), this.onVRRequestPresentComplete = new C.c(), this.onVRRequestPresentStart = new C.c();\n        }, Ue.a.prototype.isVRDevicePresent = function() {\n          return !!this._vrDisplay;\n        }, Ue.a.prototype.getVRDevice = function() {\n          return this._vrDisplay;\n        }, Ue.a.prototype.initWebVR = function() {\n          return this.initWebVRAsync(), this.onVRDisplayChangedObservable;\n        }, Ue.a.prototype.initWebVRAsync = function() {\n          var r = this, t = function() {\n            var n = { vrDisplay: r._vrDisplay, vrSupported: r._vrSupported };\n            r.onVRDisplayChangedObservable.notifyObservers(n), r._webVRInitPromise = new Promise(function(i) {\n              i(n);\n            });\n          };\n          if (!this._onVrDisplayConnect) {\n            this._onVrDisplayConnect = function(n) {\n              r._vrDisplay = n.display, t();\n            }, this._onVrDisplayDisconnect = function() {\n              r._vrDisplay.cancelAnimationFrame(r._frameHandler), r._vrDisplay = void 0, r._frameHandler = Ue.a.QueueNewFrame(r._boundRenderFunction), t();\n            }, this._onVrDisplayPresentChange = function() {\n              r._vrExclusivePointerMode = r._vrDisplay && r._vrDisplay.isPresenting;\n            };\n            var e = this.getHostWindow();\n            e && (e.addEventListener(\"vrdisplayconnect\", this._onVrDisplayConnect), e.addEventListener(\"vrdisplaydisconnect\", this._onVrDisplayDisconnect), e.addEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange));\n          }\n          return this._webVRInitPromise = this._webVRInitPromise || this._getVRDisplaysAsync(), this._webVRInitPromise.then(t), this._webVRInitPromise;\n        }, Ue.a.prototype._getVRDisplaysAsync = function() {\n          var r = this;\n          return new Promise(function(t) {\n            navigator.getVRDisplays ? navigator.getVRDisplays().then(function(e) {\n              r._vrSupported = !0, r._vrDisplay = e[0], t({ vrDisplay: r._vrDisplay, vrSupported: r._vrSupported });\n            }) : (r._vrDisplay = void 0, r._vrSupported = !1, t({ vrDisplay: r._vrDisplay, vrSupported: r._vrSupported }));\n          });\n        }, Ue.a.prototype.enableVR = function(r) {\n          var t = this;\n          if (this._vrDisplay && !this._vrDisplay.isPresenting) {\n            this.onVRRequestPresentStart.notifyObservers(this);\n            var e = { highRefreshRate: !!this.vrPresentationAttributes && this.vrPresentationAttributes.highRefreshRate, foveationLevel: this.vrPresentationAttributes ? this.vrPresentationAttributes.foveationLevel : 1, multiview: (this.getCaps().multiview || this.getCaps().oculusMultiview) && r.useMultiview };\n            this._vrDisplay.requestPresent([Object(c.a)({ source: this.getRenderingCanvas(), attributes: e }, e)]).then(function() {\n              t.onVRRequestPresentComplete.notifyObservers(!0), t._onVRFullScreenTriggered();\n            }).catch(function() {\n              t.onVRRequestPresentComplete.notifyObservers(!1);\n            });\n          }\n        }, Ue.a.prototype._onVRFullScreenTriggered = function() {\n          if (this._vrDisplay && this._vrDisplay.isPresenting) {\n            this._oldSize = new oe.a(this.getRenderWidth(), this.getRenderHeight()), this._oldHardwareScaleFactor = this.getHardwareScalingLevel();\n            var r = this._vrDisplay.getEyeParameters(\"left\");\n            this.setHardwareScalingLevel(1), this.setSize(2 * r.renderWidth, r.renderHeight);\n          } else\n            this.setHardwareScalingLevel(this._oldHardwareScaleFactor), this.setSize(this._oldSize.width, this._oldSize.height);\n        }, Ue.a.prototype.disableVR = function() {\n          var r = this;\n          this._vrDisplay && this._vrDisplay.isPresenting && this._vrDisplay.exitPresent().then(function() {\n            return r._onVRFullScreenTriggered();\n          }).catch(function() {\n            return r._onVRFullScreenTriggered();\n          }), Za.a.IsWindowObjectExist() && (window.removeEventListener(\"vrdisplaypointerrestricted\", this._onVRDisplayPointerRestricted), window.removeEventListener(\"vrdisplaypointerunrestricted\", this._onVRDisplayPointerUnrestricted), this._onVrDisplayConnect && (window.removeEventListener(\"vrdisplayconnect\", this._onVrDisplayConnect), this._onVrDisplayDisconnect && window.removeEventListener(\"vrdisplaydisconnect\", this._onVrDisplayDisconnect), this._onVrDisplayPresentChange && window.removeEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), this._onVrDisplayConnect = null, this._onVrDisplayDisconnect = null));\n        }, Ue.a.prototype._connectVREvents = function(r, t) {\n          var e = this;\n          if (this._onVRDisplayPointerRestricted = function() {\n            r && r.requestPointerLock();\n          }, this._onVRDisplayPointerUnrestricted = function() {\n            if (t)\n              t.exitPointerLock && t.exitPointerLock();\n            else {\n              var i = e.getHostWindow();\n              i.document && i.document.exitPointerLock && i.document.exitPointerLock();\n            }\n          }, Za.a.IsWindowObjectExist()) {\n            var n = this.getHostWindow();\n            n.addEventListener(\"vrdisplaypointerrestricted\", this._onVRDisplayPointerRestricted, !1), n.addEventListener(\"vrdisplaypointerunrestricted\", this._onVRDisplayPointerUnrestricted, !1);\n          }\n        }, Ue.a.prototype._submitVRFrame = function() {\n          if (this._vrDisplay && this._vrDisplay.isPresenting)\n            try {\n              this._vrDisplay.submitFrame();\n            } catch (r) {\n              Xe.b.Warn(\"webVR submitFrame has had an unexpected failure: \" + r);\n            }\n        }, Ue.a.prototype.isVRPresenting = function() {\n          return this._vrDisplay && this._vrDisplay.isPresenting;\n        }, Ue.a.prototype._requestVRFrame = function() {\n          this._frameHandler = Ue.a.QueueNewFrame(this._boundRenderFunction, this._vrDisplay);\n        }, Q.a.AddNodeConstructor(\"WebVRFreeCamera\", function(r, t) {\n          return function() {\n            return new Mo(r, u.e.Zero(), t);\n          };\n        }), Q.a.AddNodeConstructor(\"WebVRGamepadCamera\", function(r, t) {\n          return function() {\n            return new Mo(r, u.e.Zero(), t);\n          };\n        });\n        var Mo = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = {});\n            var a = r.call(this, e, n, i) || this;\n            a.webVROptions = o, a._vrDevice = null, a.rawPose = null, a._specsVersion = \"1.1\", a._attached = !1, a._descendants = [], a._deviceRoomPosition = u.e.Zero(), a._deviceRoomRotationQuaternion = u.b.Identity(), a._standingMatrix = null, a.devicePosition = u.e.Zero(), a.deviceRotationQuaternion = u.b.Identity(), a.deviceScaleFactor = 1, a._deviceToWorld = u.a.Identity(), a._worldToDevice = u.a.Identity(), a.controllers = [], a.onControllersAttachedObservable = new C.c(), a.onControllerMeshLoadedObservable = new C.c(), a.onPoseUpdatedFromDeviceObservable = new C.c(), a._poseSet = !1, a.rigParenting = !0, a._defaultHeight = void 0, a._detachIfAttached = function() {\n              var d = a.getEngine().getVRDevice();\n              d && !d.isPresenting && a.detachControl();\n            }, a._workingVector = u.e.Zero(), a._oneVector = u.e.One(), a._workingMatrix = u.a.Identity(), a._tmpMatrix = new u.a(), a._cache.position = u.e.Zero(), o.defaultHeight && (a._defaultHeight = o.defaultHeight, a.position.y = a._defaultHeight), a.minZ = 0.1, arguments.length === 5 && (a.webVROptions = arguments[4]), a.webVROptions.trackPosition == null && (a.webVROptions.trackPosition = !0), a.webVROptions.controllerMeshes == null && (a.webVROptions.controllerMeshes = !0), a.webVROptions.defaultLightingOnControllers == null && (a.webVROptions.defaultLightingOnControllers = !0), a.rotationQuaternion = new u.b(), a.webVROptions && a.webVROptions.positionScale && (a.deviceScaleFactor = a.webVROptions.positionScale);\n            var s = a.getEngine();\n            return a._onVREnabled = function(d) {\n              d && a.initControllers();\n            }, s.onVRRequestPresentComplete.add(a._onVREnabled), s.initWebVR().add(function(d) {\n              d.vrDisplay && a._vrDevice !== d.vrDisplay && (a._vrDevice = d.vrDisplay, a.setCameraRigMode(_t.a.RIG_MODE_WEBVR, { parentCamera: a, vrDisplay: a._vrDevice, frameData: a._frameData, specs: a._specsVersion }), a._attached && a.getEngine().enableVR(a.webVROptions));\n            }), typeof VRFrameData < \"u\" && (a._frameData = new VRFrameData()), o.useMultiview && (a.getScene().getEngine().getCaps().multiview ? (a._useMultiviewToSingleView = !0, a._rigPostProcess = new ts(\"VRMultiviewToSingleview\", a, 1)) : (l.a.Warn(\"Multiview is not supported, falling back to standard rendering\"), a._useMultiviewToSingleView = !1)), i.onBeforeCameraRenderObservable.add(function(d) {\n              d.parent === a && a.rigParenting && (a._descendants = a.getDescendants(!0, function(p) {\n                var y = a.controllers.some(function(R) {\n                  return R._mesh === p;\n                }), P = a._rigCameras.indexOf(p) !== -1;\n                return !y && !P;\n              }), a._descendants.forEach(function(p) {\n                p.parent = d;\n              }));\n            }), i.onAfterCameraRenderObservable.add(function(d) {\n              d.parent === a && a.rigParenting && a._descendants.forEach(function(p) {\n                p.parent = a;\n              });\n            }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.deviceDistanceToRoomGround = function() {\n            return this._standingMatrix ? (this._standingMatrix.getTranslationToRef(this._workingVector), this._deviceRoomPosition.y + this._workingVector.y) : this._defaultHeight || 0;\n          }, t.prototype.useStandingMatrix = function(e) {\n            var n = this;\n            e === void 0 && (e = function(i) {\n            }), this.getEngine().initWebVRAsync().then(function(i) {\n              i.vrDisplay && i.vrDisplay.stageParameters && i.vrDisplay.stageParameters.sittingToStandingTransform && n.webVROptions.trackPosition ? (n._standingMatrix = new u.a(), u.a.FromFloat32ArrayToRefScaled(i.vrDisplay.stageParameters.sittingToStandingTransform, 0, 1, n._standingMatrix), n.getScene().useRightHandedSystem || n._standingMatrix && n._standingMatrix.toggleModelMatrixHandInPlace(), e(!0)) : e(!1);\n            });\n          }, t.prototype.useStandingMatrixAsync = function() {\n            var e = this;\n            return new Promise(function(n) {\n              e.useStandingMatrix(function(i) {\n                n(i);\n              });\n            });\n          }, t.prototype.dispose = function() {\n            this._detachIfAttached(), this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled), this._updateCacheWhenTrackingDisabledObserver && this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver), r.prototype.dispose.call(this);\n          }, t.prototype.getControllerByName = function(e) {\n            for (var n = 0, i = this.controllers; n < i.length; n++) {\n              var o = i[n];\n              if (o.hand === e)\n                return o;\n            }\n            return null;\n          }, Object.defineProperty(t.prototype, \"leftController\", { get: function() {\n            return this._leftController || (this._leftController = this.getControllerByName(\"left\")), this._leftController;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rightController\", { get: function() {\n            return this._rightController || (this._rightController = this.getControllerByName(\"right\")), this._rightController;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getForwardRay = function(e) {\n            return e === void 0 && (e = 100), this.leftCamera ? r.prototype.getForwardRay.call(this, e, this.leftCamera.getWorldMatrix(), this.leftCamera.globalPosition) : r.prototype.getForwardRay.call(this, e);\n          }, t.prototype._checkInputs = function() {\n            this._vrDevice && this._vrDevice.isPresenting && (this._vrDevice.getFrameData(this._frameData), this.updateFromDevice(this._frameData.pose)), r.prototype._checkInputs.call(this);\n          }, t.prototype.updateFromDevice = function(e) {\n            e && e.orientation && e.orientation.length === 4 && (this.rawPose = e, this._deviceRoomRotationQuaternion.copyFromFloats(e.orientation[0], e.orientation[1], -e.orientation[2], -e.orientation[3]), this.getScene().useRightHandedSystem && (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1), this.webVROptions.trackPosition && this.rawPose.position && (this._deviceRoomPosition.copyFromFloats(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2]), this.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1)), this._poseSet = !0);\n          }, t.prototype.attachControl = function(e) {\n            e = Xe.b.BackCompatCameraNoPreventDefault(arguments), r.prototype.attachControl.call(this, e), this._attached = !0, e = !_t.a.ForceAttachControlToAlwaysPreventDefault && e, this._vrDevice && this.getEngine().enableVR(this.webVROptions);\n            var n = this._scene.getEngine().getHostWindow();\n            n && n.addEventListener(\"vrdisplaypresentchange\", this._detachIfAttached);\n          }, t.prototype.detachControl = function(e) {\n            this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), r.prototype.detachControl.call(this), this._attached = !1, this.getEngine().disableVR(), window.removeEventListener(\"vrdisplaypresentchange\", this._detachIfAttached);\n          }, t.prototype.getClassName = function() {\n            return \"WebVRFreeCamera\";\n          }, t.prototype.resetToCurrentRotation = function() {\n            this._vrDevice.resetPose();\n          }, t.prototype._updateRigCameras = function() {\n            var e = this._rigCameras[0], n = this._rigCameras[1];\n            e.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), n.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), e.position.copyFrom(this._deviceRoomPosition), n.position.copyFrom(this._deviceRoomPosition);\n          }, t.prototype._correctPositionIfNotTrackPosition = function(e, n) {\n            n === void 0 && (n = !1), this.rawPose && this.rawPose.position && !this.webVROptions.trackPosition && (u.a.TranslationToRef(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2], this._tmpMatrix), n || this._tmpMatrix.invert(), this._tmpMatrix.multiplyToRef(e, e));\n          }, t.prototype._updateCache = function(e) {\n            var n = this;\n            this.rotationQuaternion.equals(this._cache.rotationQuaternion) && this.position.equals(this._cache.position) || (this.updateCacheCalled || (this.updateCacheCalled = !0, this.update()), this.rotationQuaternion.toRotationMatrix(this._workingMatrix), u.e.TransformCoordinatesToRef(this._deviceRoomPosition, this._workingMatrix, this._workingVector), this.devicePosition.subtractToRef(this._workingVector, this._workingVector), u.a.ComposeToRef(this._oneVector, this.rotationQuaternion, this._workingVector, this._deviceToWorld), this._deviceToWorld.getTranslationToRef(this._workingVector), this._workingVector.addInPlace(this.position), this._workingVector.subtractInPlace(this._cache.position), this._deviceToWorld.setTranslation(this._workingVector), this._deviceToWorld.invertToRef(this._worldToDevice), this.controllers.forEach(function(i) {\n              i._deviceToWorld.copyFrom(n._deviceToWorld), n._correctPositionIfNotTrackPosition(i._deviceToWorld), i.update();\n            })), e || r.prototype._updateCache.call(this), this.updateCacheCalled = !1;\n          }, t.prototype._computeDevicePosition = function() {\n            u.e.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition);\n          }, t.prototype.update = function() {\n            this._computeDevicePosition(), u.a.FromQuaternionToRef(this._deviceRoomRotationQuaternion, this._workingMatrix), this._workingMatrix.multiplyToRef(this._deviceToWorld, this._workingMatrix), u.b.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this._poseSet && this.onPoseUpdatedFromDeviceObservable.notifyObservers(null), r.prototype.update.call(this);\n          }, t.prototype._getViewMatrix = function() {\n            return u.a.Identity();\n          }, t.prototype._getWebVRViewMatrix = function() {\n            var e = this._cameraRigParams.parentCamera;\n            e._updateCache();\n            var n = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftViewMatrix : this._cameraRigParams.frameData.rightViewMatrix;\n            return u.a.FromArrayToRef(n, 0, this._webvrViewMatrix), this.getScene().useRightHandedSystem || this._webvrViewMatrix.toggleModelMatrixHandInPlace(), this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix), u.e.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), e.deviceScaleFactor !== 1 && (this._webvrViewMatrix.invert(), e.deviceScaleFactor && (this._webvrViewMatrix.multiplyAtIndex(12, e.deviceScaleFactor), this._webvrViewMatrix.multiplyAtIndex(13, e.deviceScaleFactor), this._webvrViewMatrix.multiplyAtIndex(14, e.deviceScaleFactor)), this._webvrViewMatrix.invert()), e._correctPositionIfNotTrackPosition(this._webvrViewMatrix, !0), e._worldToDevice.multiplyToRef(this._webvrViewMatrix, this._webvrViewMatrix), this._workingMatrix = this._workingMatrix || u.a.Identity(), this._webvrViewMatrix.invertToRef(this._workingMatrix), this._workingMatrix.multiplyToRef(e.getWorldMatrix(), this._workingMatrix), this._workingMatrix.getTranslationToRef(this._globalPosition), this._markSyncedWithParent(), this._webvrViewMatrix;\n          }, t.prototype._getWebVRProjectionMatrix = function() {\n            var e = this.parent;\n            e._vrDevice.depthNear = e.minZ, e._vrDevice.depthFar = e.maxZ;\n            var n = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftProjectionMatrix : this._cameraRigParams.frameData.rightProjectionMatrix;\n            return u.a.FromArrayToRef(n, 0, this._projectionMatrix), this.getScene().useRightHandedSystem || this._projectionMatrix.toggleProjectionMatrixHandInPlace(), this._projectionMatrix;\n          }, t.prototype.initControllers = function() {\n            var e = this;\n            this.controllers = [];\n            var n = this.getScene().gamepadManager;\n            this._onGamepadDisconnectedObserver = n.onGamepadDisconnectedObservable.add(function(i) {\n              if (i.type === hn.POSE_ENABLED) {\n                var o = i;\n                o.defaultModel && o.defaultModel.setEnabled(!1), o.hand === \"right\" && (e._rightController = null), o.hand === \"left\" && (e._leftController = null);\n                var a = e.controllers.indexOf(o);\n                a !== -1 && e.controllers.splice(a, 1);\n              }\n            }), this._onGamepadConnectedObserver = n.onGamepadConnectedObservable.add(function(i) {\n              if (i.type === hn.POSE_ENABLED) {\n                var o = i;\n                if (e.webVROptions.trackPosition || (o._disableTrackPosition(new u.e(o.hand == \"left\" ? -0.15 : 0.15, -0.5, 0.25)), e._updateCacheWhenTrackingDisabledObserver || (e._updateCacheWhenTrackingDisabledObserver = e._scene.onBeforeRenderObservable.add(function() {\n                  e._updateCache();\n                }))), o.deviceScaleFactor = e.deviceScaleFactor, o._deviceToWorld.copyFrom(e._deviceToWorld), e._correctPositionIfNotTrackPosition(o._deviceToWorld), e.webVROptions.controllerMeshes && (o.defaultModel ? o.defaultModel.setEnabled(!0) : o.initControllerMesh(e.getScene(), function(d) {\n                  if (d.scaling.scaleInPlace(e.deviceScaleFactor), e.onControllerMeshLoadedObservable.notifyObservers(o), e.webVROptions.defaultLightingOnControllers) {\n                    e._lightOnControllers || (e._lightOnControllers = new Oo.a(\"vrControllersLight\", new u.e(0, 1, 0), e.getScene()));\n                    var p = function(y, P) {\n                      var R = y.getChildren();\n                      R && R.length !== 0 && R.forEach(function(B) {\n                        P.includedOnlyMeshes.push(B), p(B, P);\n                      });\n                    };\n                    e._lightOnControllers.includedOnlyMeshes.push(d), p(d, e._lightOnControllers);\n                  }\n                })), o.attachToPoseControlledCamera(e), e.controllers.indexOf(o) === -1) {\n                  e.controllers.push(o);\n                  for (var a = !1, s = 0; s < e.controllers.length; s++)\n                    e.controllers[s].controllerType === Jn.VIVE && (a ? e.controllers[s].hand = \"right\" : (a = !0, e.controllers[s].hand = \"left\"));\n                  e.controllers.length >= 2 && e.onControllersAttachedObservable.notifyObservers(e.controllers);\n                }\n              }\n            });\n          }, t;\n        }(zn), Ri = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.onTriggerStateChangedObservable = new C.c(), n.onMainButtonStateChangedObservable = new C.c(), n.onSecondaryButtonStateChangedObservable = new C.c(), n.onPadStateChangedObservable = new C.c(), n.onPadValuesChangedObservable = new C.c(), n.pad = { x: 0, y: 0 }, n._changes = { pressChanged: !1, touchChanged: !1, valueChanged: !1, changed: !1 }, n._buttons = new Array(e.buttons.length), n.hand = e.hand, n;\n          }\n          return Object(c.d)(t, r), t.prototype.onButtonStateChange = function(e) {\n            this._onButtonStateChange = e;\n          }, Object.defineProperty(t.prototype, \"defaultModel\", { get: function() {\n            return this._defaultModel;\n          }, enumerable: !1, configurable: !0 }), t.prototype.update = function() {\n            r.prototype.update.call(this);\n            for (var e = 0; e < this._buttons.length; e++)\n              this._setButtonValue(this.browserGamepad.buttons[e], this._buttons[e], e);\n            this.leftStick.x === this.pad.x && this.leftStick.y === this.pad.y || (this.pad.x = this.leftStick.x, this.pad.y = this.leftStick.y, this.onPadValuesChangedObservable.notifyObservers(this.pad));\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            e || (e = { pressed: !1, touched: !1, value: 0 }), n ? (this._checkChanges(e, n), this._changes.changed && (this._onButtonStateChange && this._onButtonStateChange(this.index, i, e), this._handleButtonChange(i, e, this._changes)), this._buttons[i].pressed = e.pressed, this._buttons[i].touched = e.touched, this._buttons[i].value = e.value < 1e-8 ? 0 : e.value) : this._buttons[i] = { pressed: e.pressed, touched: e.touched, value: e.value };\n          }, t.prototype._checkChanges = function(e, n) {\n            return this._changes.pressChanged = e.pressed !== n.pressed, this._changes.touchChanged = e.touched !== n.touched, this._changes.valueChanged = e.value !== n.value, this._changes.changed = this._changes.pressChanged || this._changes.touchChanged || this._changes.valueChanged, this._changes;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._defaultModel = null, this.onTriggerStateChangedObservable.clear(), this.onMainButtonStateChangedObservable.clear(), this.onSecondaryButtonStateChangedObservable.clear(), this.onPadStateChangedObservable.clear(), this.onPadValuesChangedObservable.clear();\n          }, t;\n        }(ar), vn = f(42), Nt = f(30), pi = f(62), Pf = (f(108), f(59), f(109), `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}`);\n        ze.a.ShadersStore.imageProcessingPixelShader = Pf;\n        var Io = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, e, \"imageProcessing\", [], [], n, i, o, a, s, null, d, \"postprocess\", null, !0) || this;\n            return y._fromLinearSpace = !0, y._defines = { IMAGEPROCESSING: !1, VIGNETTE: !1, VIGNETTEBLENDMODEMULTIPLY: !1, VIGNETTEBLENDMODEOPAQUE: !1, TONEMAPPING: !1, TONEMAPPING_ACES: !1, CONTRAST: !1, COLORCURVES: !1, COLORGRADING: !1, COLORGRADING3D: !1, FROMLINEARSPACE: !1, SAMPLER3DGREENDEPTH: !1, SAMPLER3DBGRMAP: !1, IMAGEPROCESSINGPOSTPROCESS: !1, EXPOSURE: !1 }, p ? (p.applyByPostProcess = !0, y._attachImageProcessingConfiguration(p, !0), y.fromLinearSpace = !1) : (y._attachImageProcessingConfiguration(null, !0), y.imageProcessingConfiguration.applyByPostProcess = !0), y.onApply = function(P) {\n              y.imageProcessingConfiguration.bind(P, y.aspectRatio);\n            }, y;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            e.applyByPostProcess = !0, this._attachImageProcessingConfiguration(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype._attachImageProcessingConfiguration = function(e, n) {\n            var i = this;\n            if (n === void 0 && (n = !1), e !== this._imageProcessingConfiguration) {\n              if (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e)\n                this._imageProcessingConfiguration = e;\n              else {\n                var o = null, a = this.getEngine(), s = this.getCamera();\n                if (s)\n                  o = s.getScene();\n                else if (a && a.scenes) {\n                  var d = a.scenes;\n                  o = d[d.length - 1];\n                } else\n                  o = te.a.LastCreatedScene;\n                this._imageProcessingConfiguration = o ? o.imageProcessingConfiguration : new vn.a();\n              }\n              this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n                i._updateParameters();\n              })), n || this._updateParameters();\n            }\n          }, Object.defineProperty(t.prototype, \"isSupported\", { get: function() {\n            var e = this.getEffect();\n            return !e || e.isSupported;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorCurves\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurves;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurves = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorGradingTexture\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"exposure\", { get: function() {\n            return this.imageProcessingConfiguration.exposure;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.exposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"toneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"toneMappingType\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingType;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingType = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"contrast\", { get: function() {\n            return this.imageProcessingConfiguration.contrast;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.contrast = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteStretch\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteStretch;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteStretch = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteCentreX\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteCentreX;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteCentreX = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteCentreY\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteCentreY;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteCentreY = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteWeight\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteWeight;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteWeight = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteColor\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteColor;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteColor = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteCameraFov\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteCameraFov;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteCameraFov = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteBlendMode\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteBlendMode;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteBlendMode = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fromLinearSpace\", { get: function() {\n            return this._fromLinearSpace;\n          }, set: function(e) {\n            this._fromLinearSpace !== e && (this._fromLinearSpace = e, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"ImageProcessingPostProcess\";\n          }, t.prototype._updateParameters = function() {\n            this._defines.FROMLINEARSPACE = this._fromLinearSpace, this.imageProcessingConfiguration.prepareDefines(this._defines, !0);\n            var e = \"\";\n            for (var n in this._defines)\n              this._defines[n] && (e += \"#define \" + n + `;\\r\n`);\n            var i = [\"textureSampler\"], o = [\"scale\"];\n            vn.a && (vn.a.PrepareSamplers(i, this._defines), vn.a.PrepareUniforms(o, this._defines)), this.updateEffect(e, o, i);\n          }, t.prototype.dispose = function(e) {\n            r.prototype.dispose.call(this, e), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration && (this.imageProcessingConfiguration.applyByPostProcess = !1);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"_fromLinearSpace\", void 0), t;\n        }(ft), ht = f(16), Oe = f(4);\n        Ie.a._GroundMeshParser = function(r, t) {\n          return Do.Parse(r, t);\n        };\n        var Do = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.generateOctree = !1, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"GroundMesh\";\n          }, Object.defineProperty(t.prototype, \"subdivisions\", { get: function() {\n            return Math.min(this._subdivisionsX, this._subdivisionsY);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subdivisionsX\", { get: function() {\n            return this._subdivisionsX;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subdivisionsY\", { get: function() {\n            return this._subdivisionsY;\n          }, enumerable: !1, configurable: !0 }), t.prototype.optimize = function(e, n) {\n            n === void 0 && (n = 32), this._subdivisionsX = e, this._subdivisionsY = e, this.subdivide(e), this.createOrUpdateSubmeshesOctree && this.createOrUpdateSubmeshesOctree(n);\n          }, t.prototype.getHeightAtCoordinates = function(e, n) {\n            var i = this.getWorldMatrix(), o = u.c.Matrix[5];\n            i.invertToRef(o);\n            var a = u.c.Vector3[8];\n            if (u.e.TransformCoordinatesFromFloatsToRef(e, 0, n, o, a), e = a.x, n = a.z, e < this._minX || e > this._maxX || n < this._minZ || n > this._maxZ)\n              return this.position.y;\n            this._heightQuads && this._heightQuads.length != 0 || (this._initHeightQuads(), this._computeHeightQuads());\n            var s = this._getFacetAt(e, n), d = -(s.x * e + s.z * n + s.w) / s.y;\n            return u.e.TransformCoordinatesFromFloatsToRef(0, d, 0, i, a), a.y;\n          }, t.prototype.getNormalAtCoordinates = function(e, n) {\n            var i = new u.e(0, 1, 0);\n            return this.getNormalAtCoordinatesToRef(e, n, i), i;\n          }, t.prototype.getNormalAtCoordinatesToRef = function(e, n, i) {\n            var o = this.getWorldMatrix(), a = u.c.Matrix[5];\n            o.invertToRef(a);\n            var s = u.c.Vector3[8];\n            if (u.e.TransformCoordinatesFromFloatsToRef(e, 0, n, a, s), e = s.x, n = s.z, e < this._minX || e > this._maxX || n < this._minZ || n > this._maxZ)\n              return this;\n            this._heightQuads && this._heightQuads.length != 0 || (this._initHeightQuads(), this._computeHeightQuads());\n            var d = this._getFacetAt(e, n);\n            return u.e.TransformNormalFromFloatsToRef(d.x, d.y, d.z, o, i), this;\n          }, t.prototype.updateCoordinateHeights = function() {\n            return this._heightQuads && this._heightQuads.length != 0 || this._initHeightQuads(), this._computeHeightQuads(), this;\n          }, t.prototype._getFacetAt = function(e, n) {\n            var i = Math.floor((e + this._maxX) * this._subdivisionsX / this._width), o = Math.floor(-(n + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY), a = this._heightQuads[o * this._subdivisionsX + i];\n            return n < a.slope.x * e + a.slope.y ? a.facet1 : a.facet2;\n          }, t.prototype._initHeightQuads = function() {\n            var e = this._subdivisionsX, n = this._subdivisionsY;\n            this._heightQuads = new Array();\n            for (var i = 0; i < n; i++)\n              for (var o = 0; o < e; o++) {\n                var a = { slope: u.d.Zero(), facet1: new u.f(0, 0, 0, 0), facet2: new u.f(0, 0, 0, 0) };\n                this._heightQuads[i * e + o] = a;\n              }\n            return this;\n          }, t.prototype._computeHeightQuads = function() {\n            var e = this.getVerticesData(Oe.b.PositionKind);\n            if (!e)\n              return this;\n            for (var n = u.c.Vector3[3], i = u.c.Vector3[2], o = u.c.Vector3[1], a = u.c.Vector3[0], s = u.c.Vector3[4], d = u.c.Vector3[5], p = u.c.Vector3[6], y = u.c.Vector3[7], P = u.c.Vector3[8], R = 0, B = 0, F = 0, z = 0, J = 0, ie = 0, se = 0, ce = this._subdivisionsX, ue = this._subdivisionsY, fe = 0; fe < ue; fe++)\n              for (var ve = 0; ve < ce; ve++) {\n                R = 3 * ve, B = fe * (ce + 1) * 3, F = (fe + 1) * (ce + 1) * 3, n.x = e[B + R], n.y = e[B + R + 1], n.z = e[B + R + 2], i.x = e[B + R + 3], i.y = e[B + R + 4], i.z = e[B + R + 5], o.x = e[F + R], o.y = e[F + R + 1], o.z = e[F + R + 2], a.x = e[F + R + 3], a.y = e[F + R + 4], a.z = e[F + R + 5], z = (a.z - n.z) / (a.x - n.x), J = n.z - z * n.x, i.subtractToRef(n, s), o.subtractToRef(n, d), a.subtractToRef(n, p), u.e.CrossToRef(p, d, y), u.e.CrossToRef(s, p, P), y.normalize(), P.normalize(), ie = -(y.x * n.x + y.y * n.y + y.z * n.z), se = -(P.x * i.x + P.y * i.y + P.z * i.z);\n                var Te = this._heightQuads[fe * ce + ve];\n                Te.slope.copyFromFloats(z, J), Te.facet1.copyFromFloats(y.x, y.y, y.z, ie), Te.facet2.copyFromFloats(P.x, P.y, P.z, se);\n              }\n            return this;\n          }, t.prototype.serialize = function(e) {\n            r.prototype.serialize.call(this, e), e.subdivisionsX = this._subdivisionsX, e.subdivisionsY = this._subdivisionsY, e.minX = this._minX, e.maxX = this._maxX, e.minZ = this._minZ, e.maxZ = this._maxZ, e.width = this._width, e.height = this._height;\n          }, t.Parse = function(e, n) {\n            var i = new t(e.name, n);\n            return i._subdivisionsX = e.subdivisionsX || 1, i._subdivisionsY = e.subdivisionsY || 1, i._minX = e.minX, i._maxX = e.maxX, i._minZ = e.minZ, i._maxZ = e.maxZ, i._width = e.width, i._height = e.height, i;\n          }, t;\n        }(Ie.a), ns = f(70);\n        ht.a.CreateGround = function(r) {\n          var t, e, n = [], i = [], o = [], a = [], s = r.width || 1, d = r.height || 1, p = r.subdivisionsX || r.subdivisions || 1, y = r.subdivisionsY || r.subdivisions || 1;\n          for (t = 0; t <= y; t++)\n            for (e = 0; e <= p; e++) {\n              var P = new u.e(e * s / p - s / 2, 0, (y - t) * d / y - d / 2), R = new u.e(0, 1, 0);\n              i.push(P.x, P.y, P.z), o.push(R.x, R.y, R.z), a.push(e / p, 1 - t / y);\n            }\n          for (t = 0; t < y; t++)\n            for (e = 0; e < p; e++)\n              n.push(e + 1 + (t + 1) * (p + 1)), n.push(e + 1 + t * (p + 1)), n.push(e + t * (p + 1)), n.push(e + (t + 1) * (p + 1)), n.push(e + 1 + (t + 1) * (p + 1)), n.push(e + t * (p + 1));\n          var B = new ht.a();\n          return B.indices = n, B.positions = i, B.normals = o, B.uvs = a, B;\n        }, ht.a.CreateTiledGround = function(r) {\n          var t, e, n, i, o = r.xmin !== void 0 && r.xmin !== null ? r.xmin : -1, a = r.zmin !== void 0 && r.zmin !== null ? r.zmin : -1, s = r.xmax !== void 0 && r.xmax !== null ? r.xmax : 1, d = r.zmax !== void 0 && r.zmax !== null ? r.zmax : 1, p = r.subdivisions || { w: 1, h: 1 }, y = r.precision || { w: 1, h: 1 }, P = new Array(), R = new Array(), B = new Array(), F = new Array();\n          p.h = p.h < 1 ? 1 : p.h, p.w = p.w < 1 ? 1 : p.w, y.w = y.w < 1 ? 1 : y.w, y.h = y.h < 1 ? 1 : y.h;\n          var z = (s - o) / p.w, J = (d - a) / p.h;\n          function ie(ce, ue, fe, ve) {\n            var Te = R.length / 3, Re = y.w + 1;\n            for (t = 0; t < y.h; t++)\n              for (e = 0; e < y.w; e++) {\n                var Ae = [Te + e + t * Re, Te + (e + 1) + t * Re, Te + (e + 1) + (t + 1) * Re, Te + e + (t + 1) * Re];\n                P.push(Ae[1]), P.push(Ae[2]), P.push(Ae[3]), P.push(Ae[0]), P.push(Ae[1]), P.push(Ae[3]);\n              }\n            var Ee = u.e.Zero(), Se = new u.e(0, 1, 0);\n            for (t = 0; t <= y.h; t++)\n              for (Ee.z = t * (ve - ue) / y.h + ue, e = 0; e <= y.w; e++)\n                Ee.x = e * (fe - ce) / y.w + ce, Ee.y = 0, R.push(Ee.x, Ee.y, Ee.z), B.push(Se.x, Se.y, Se.z), F.push(e / y.w, t / y.h);\n          }\n          for (n = 0; n < p.h; n++)\n            for (i = 0; i < p.w; i++)\n              ie(o + i * z, a + n * J, o + (i + 1) * z, a + (n + 1) * J);\n          var se = new ht.a();\n          return se.indices = P, se.positions = R, se.normals = B, se.uvs = F, se;\n        }, ht.a.CreateGroundFromHeightMap = function(r) {\n          var t, e, n = [], i = [], o = [], a = [], s = r.colorFilter || new I.a(0.3, 0.59, 0.11), d = r.alphaFilter || 0, p = !1;\n          if (r.minHeight > r.maxHeight) {\n            p = !0;\n            var y = r.maxHeight;\n            r.maxHeight = r.minHeight, r.minHeight = y;\n          }\n          for (t = 0; t <= r.subdivisions; t++)\n            for (e = 0; e <= r.subdivisions; e++) {\n              var P = new u.e(e * r.width / r.subdivisions - r.width / 2, 0, (r.subdivisions - t) * r.height / r.subdivisions - r.height / 2), R = 4 * (((P.x + r.width / 2) / r.width * (r.bufferWidth - 1) | 0) + ((1 - (P.z + r.height / 2) / r.height) * (r.bufferHeight - 1) | 0) * r.bufferWidth), B = r.buffer[R] / 255, F = r.buffer[R + 1] / 255, z = r.buffer[R + 2] / 255, J = r.buffer[R + 3] / 255;\n              p && (B = 1 - B, F = 1 - F, z = 1 - z);\n              var ie = B * s.r + F * s.g + z * s.b;\n              P.y = J >= d ? r.minHeight + (r.maxHeight - r.minHeight) * ie : r.minHeight - Vt.a, i.push(P.x, P.y, P.z), o.push(0, 0, 0), a.push(e / r.subdivisions, 1 - t / r.subdivisions);\n            }\n          for (t = 0; t < r.subdivisions; t++)\n            for (e = 0; e < r.subdivisions; e++) {\n              var se = e + 1 + (t + 1) * (r.subdivisions + 1), ce = e + 1 + t * (r.subdivisions + 1), ue = e + t * (r.subdivisions + 1), fe = e + (t + 1) * (r.subdivisions + 1), ve = i[3 * se + 1] >= r.minHeight, Te = i[3 * ce + 1] >= r.minHeight, Re = i[3 * ue + 1] >= r.minHeight;\n              ve && Te && Re && (n.push(se), n.push(ce), n.push(ue)), i[3 * fe + 1] >= r.minHeight && ve && Re && (n.push(fe), n.push(se), n.push(ue));\n            }\n          ht.a.ComputeNormals(i, n, o);\n          var Ae = new ht.a();\n          return Ae.indices = n, Ae.positions = i, Ae.normals = o, Ae.uvs = a, Ae;\n        }, Ie.a.CreateGround = function(r, t, e, n, i, o) {\n          var a = { width: t, height: e, subdivisions: n, updatable: o };\n          return Oi.CreateGround(r, a, i);\n        }, Ie.a.CreateTiledGround = function(r, t, e, n, i, o, a, s, d) {\n          var p = { xmin: t, zmin: e, xmax: n, zmax: i, subdivisions: o, precision: a, updatable: d };\n          return Oi.CreateTiledGround(r, p, s);\n        }, Ie.a.CreateGroundFromHeightMap = function(r, t, e, n, i, o, a, s, d, p, y) {\n          var P = { width: e, height: n, subdivisions: i, minHeight: o, maxHeight: a, updatable: d, onReady: p, alphaFilter: y };\n          return Oi.CreateGroundFromHeightMap(r, t, P, s);\n        };\n        var Oi = function() {\n          function r() {\n          }\n          return r.CreateGround = function(t, e, n) {\n            var i = new Do(t, n);\n            return i._setReady(!1), i._subdivisionsX = e.subdivisionsX || e.subdivisions || 1, i._subdivisionsY = e.subdivisionsY || e.subdivisions || 1, i._width = e.width || 1, i._height = e.height || 1, i._maxX = i._width / 2, i._maxZ = i._height / 2, i._minX = -i._maxX, i._minZ = -i._maxZ, ht.a.CreateGround(e).applyToMesh(i, e.updatable), i._setReady(!0), i;\n          }, r.CreateTiledGround = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return ht.a.CreateTiledGround(e).applyToMesh(i, e.updatable), i;\n          }, r.CreateGroundFromHeightMap = function(t, e, n, i) {\n            i === void 0 && (i = null);\n            var o = n.width || 10, a = n.height || 10, s = n.subdivisions || 1, d = n.minHeight || 0, p = n.maxHeight || 1, y = n.colorFilter || new I.a(0.3, 0.59, 0.11), P = n.alphaFilter || 0, R = n.updatable, B = n.onReady;\n            i = i || te.a.LastCreatedScene;\n            var F = new Do(t, i);\n            return F._subdivisionsX = s, F._subdivisionsY = s, F._width = o, F._height = a, F._maxX = F._width / 2, F._maxZ = F._height / 2, F._minX = -F._maxX, F._minZ = -F._maxZ, F._setReady(!1), Xe.b.LoadImage(e, function(z) {\n              var J = z.width, ie = z.height, se = ns.a.CreateCanvas(J, ie).getContext(\"2d\");\n              if (!se)\n                throw new Error(\"Unable to get 2d context for CreateGroundFromHeightMap\");\n              if (!i.isDisposed) {\n                se.drawImage(z, 0, 0);\n                var ce = se.getImageData(0, 0, J, ie).data;\n                ht.a.CreateGroundFromHeightMap({ width: o, height: a, subdivisions: s, minHeight: d, maxHeight: p, colorFilter: y, buffer: ce, bufferWidth: J, bufferHeight: ie, alphaFilter: P }).applyToMesh(F, R), B && B(F), F._setReady(!0);\n              }\n            }, function() {\n            }, i.offlineProvider), F;\n          }, r;\n        }();\n        ht.a.CreateTorus = function(r) {\n          for (var t = [], e = [], n = [], i = [], o = r.diameter || 1, a = r.thickness || 0.5, s = r.tessellation || 16, d = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, p = s + 1, y = 0; y <= s; y++)\n            for (var P = y / s, R = y * Math.PI * 2 / s - Math.PI / 2, B = u.a.Translation(o / 2, 0, 0).multiply(u.a.RotationY(R)), F = 0; F <= s; F++) {\n              var z = 1 - F / s, J = F * Math.PI * 2 / s + Math.PI, ie = Math.cos(J), se = Math.sin(J), ce = new u.e(ie, se, 0), ue = ce.scale(a / 2), fe = new u.d(P, z);\n              ue = u.e.TransformCoordinates(ue, B), ce = u.e.TransformNormal(ce, B), e.push(ue.x, ue.y, ue.z), n.push(ce.x, ce.y, ce.z), i.push(fe.x, fe.y);\n              var ve = (y + 1) % p, Te = (F + 1) % p;\n              t.push(y * p + F), t.push(y * p + Te), t.push(ve * p + F), t.push(y * p + Te), t.push(ve * p + Te), t.push(ve * p + F);\n            }\n          ht.a._ComputeSides(d, e, t, n, i, r.frontUVs, r.backUVs);\n          var Re = new ht.a();\n          return Re.indices = t, Re.positions = e, Re.normals = n, Re.uvs = i, Re;\n        }, Ie.a.CreateTorus = function(r, t, e, n, i, o, a) {\n          var s = { diameter: t, thickness: e, tessellation: n, sideOrientation: a, updatable: o };\n          return lr.CreateTorus(r, s, i);\n        };\n        var fn, Xi, lr = function() {\n          function r() {\n          }\n          return r.CreateTorus = function(t, e, n) {\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTorus(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }(), ci = f(53), is = function() {\n          function r() {\n          }\n          return r.GetDefaults = function(t) {\n            var e = new r();\n            return e.canvasOptions = { antialias: !0, depth: !0, stencil: !t || t.isStencilEnable, alpha: !0, multiview: !1, framebufferScaleFactor: 1 }, e.newCanvasCssStyle = \"position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;\", e;\n          }, r;\n        }(), Rl = function() {\n          function r(t, e) {\n            var n = this;\n            if (e === void 0 && (e = is.GetDefaults()), this._options = e, this._canvas = null, this.xrLayer = null, this.onXRLayerInitObservable = new C.c(), this._engine = t.scene.getEngine(), e.canvasElement)\n              this._setManagedOutputCanvas(e.canvasElement);\n            else {\n              var i = document.createElement(\"canvas\");\n              i.style.cssText = this._options.newCanvasCssStyle || \"position:absolute; bottom:0px;right:0px;\", this._setManagedOutputCanvas(i);\n            }\n            t.onXRSessionInit.add(function() {\n              n._addCanvas();\n            }), t.onXRSessionEnded.add(function() {\n              n._removeCanvas();\n            });\n          }\n          return r.prototype.dispose = function() {\n            this._removeCanvas(), this._setManagedOutputCanvas(null);\n          }, r.prototype.initializeXRLayerAsync = function(t) {\n            var e = this, n = function() {\n              var i = new XRWebGLLayer(t, e.canvasContext, e._options.canvasOptions);\n              return e.onXRLayerInitObservable.notifyObservers(i), i;\n            };\n            return this.canvasContext.makeXRCompatible ? this.canvasContext.makeXRCompatible().then(function() {\n              return e.xrLayer = n(), e.xrLayer;\n            }) : (this.xrLayer = n(), Promise.resolve(this.xrLayer));\n          }, r.prototype._addCanvas = function() {\n            var t = this;\n            this._canvas && this._canvas !== this._engine.getRenderingCanvas() && document.body.appendChild(this._canvas), this.xrLayer ? this._setCanvasSize(!0) : this.onXRLayerInitObservable.addOnce(function(e) {\n              t._setCanvasSize(!0, e);\n            });\n          }, r.prototype._removeCanvas = function() {\n            this._canvas && document.body.contains(this._canvas) && this._canvas !== this._engine.getRenderingCanvas() && document.body.removeChild(this._canvas), this._setCanvasSize(!1);\n          }, r.prototype._setCanvasSize = function(t, e) {\n            t === void 0 && (t = !0), e === void 0 && (e = this.xrLayer), this._canvas && (t ? e && (this._canvas !== this._engine.getRenderingCanvas() ? (this._canvas.style.width = e.framebufferWidth + \"px\", this._canvas.style.height = e.framebufferHeight + \"px\") : this._engine.setSize(e.framebufferWidth, e.framebufferHeight)) : this._originalCanvasSize && (this._canvas !== this._engine.getRenderingCanvas() ? (this._canvas.style.width = this._originalCanvasSize.width + \"px\", this._canvas.style.height = this._originalCanvasSize.height + \"px\") : this._engine.setSize(this._originalCanvasSize.width, this._originalCanvasSize.height)));\n          }, r.prototype._setManagedOutputCanvas = function(t) {\n            this._removeCanvas(), t ? (this._originalCanvasSize = { width: t.offsetWidth, height: t.offsetHeight }, this._canvas = t, this.canvasContext = this._canvas.getContext(\"webgl2\"), this.canvasContext || (this.canvasContext = this._canvas.getContext(\"webgl\"))) : (this._canvas = null, this.canvasContext = null);\n          }, r;\n        }(), rs = function() {\n          function r(t) {\n            this.scene = t, this._sessionEnded = !1, this.baseLayer = null, this.currentTimestamp = -1, this.defaultHeightCompensation = 1.7, this.onXRFrameObservable = new C.c(), this.onXRReferenceSpaceChanged = new C.c(), this.onXRSessionEnded = new C.c(), this.onXRSessionInit = new C.c();\n          }\n          return Object.defineProperty(r.prototype, \"referenceSpace\", { get: function() {\n            return this._referenceSpace;\n          }, set: function(t) {\n            this._referenceSpace = t, this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace);\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._sessionEnded || this.exitXRAsync(), this.onXRFrameObservable.clear(), this.onXRSessionEnded.clear(), this.onXRReferenceSpaceChanged.clear(), this.onXRSessionInit.clear();\n          }, r.prototype.exitXRAsync = function() {\n            return this.session && !this._sessionEnded ? (this._sessionEnded = !0, this.session.end().catch(function(t) {\n              l.a.Warn(\"Could not end XR session.\");\n            })) : Promise.resolve();\n          }, r.prototype.getRenderTargetTextureForEye = function(t) {\n            return this._rttProvider.getRenderTargetForEye(t);\n          }, r.prototype.getWebXRRenderTarget = function(t) {\n            var e = this.scene.getEngine();\n            return this._xrNavigator.xr.native ? this._xrNavigator.xr.getWebXRRenderTarget(e) : ((t = t || is.GetDefaults(e)).canvasElement = e.getRenderingCanvas() || void 0, new Rl(this, t));\n          }, r.prototype.initializeAsync = function() {\n            return this._xrNavigator = navigator, this._xrNavigator.xr ? Promise.resolve() : Promise.reject(\"WebXR not available\");\n          }, r.prototype.initializeSessionAsync = function(t, e) {\n            var n = this;\n            return t === void 0 && (t = \"immersive-vr\"), e === void 0 && (e = {}), this._xrNavigator.xr.requestSession(t, e).then(function(i) {\n              return n.session = i, n.onXRSessionInit.notifyObservers(i), n._sessionEnded = !1, n.session.addEventListener(\"end\", function() {\n                var o = n.scene.getEngine();\n                n._sessionEnded = !0, n._rttProvider = null, o.framebufferDimensionsObject = null, o.restoreDefaultFramebuffer(), o.customAnimationFrameRequester = null, n.onXRSessionEnded.notifyObservers(null), o._renderLoop();\n              }, { once: !0 }), n.session;\n            });\n          }, r.prototype.isSessionSupportedAsync = function(t) {\n            return r.IsSessionSupportedAsync(t);\n          }, r.prototype.resetReferenceSpace = function() {\n            this.referenceSpace = this.baseReferenceSpace;\n          }, r.prototype.runXRRenderLoop = function() {\n            var t = this, e = this.scene.getEngine();\n            if (e.customAnimationFrameRequester = { requestAnimationFrame: this.session.requestAnimationFrame.bind(this.session), renderFunction: function(i, o) {\n              t._sessionEnded || (t.currentFrame = o, t.currentTimestamp = i, o && (e.framebufferDimensionsObject = t.baseLayer, t.onXRFrameObservable.notifyObservers(o), e._renderLoop(), e.framebufferDimensionsObject = null));\n            } }, this._xrNavigator.xr.native)\n              this._rttProvider = this._xrNavigator.xr.getNativeRenderTargetProvider(this.session, this._createRenderTargetTexture.bind(this));\n            else {\n              var n = this._createRenderTargetTexture(this.baseLayer.framebufferWidth, this.baseLayer.framebufferHeight, this.baseLayer.framebuffer);\n              this._rttProvider = { getRenderTargetForEye: function() {\n                return n;\n              } }, e.framebufferDimensionsObject = this.baseLayer;\n            }\n            typeof window < \"u\" && window.cancelAnimationFrame && window.cancelAnimationFrame(e._frameHandler), e._renderLoop();\n          }, r.prototype.setReferenceSpaceTypeAsync = function(t) {\n            var e = this;\n            return t === void 0 && (t = \"local-floor\"), this.session.requestReferenceSpace(t).then(function(n) {\n              return n;\n            }, function(n) {\n              return l.a.Error(\"XR.requestReferenceSpace failed for the following reason: \"), l.a.Error(n), l.a.Log('Defaulting to universally-supported \"viewer\" reference space type.'), e.session.requestReferenceSpace(\"viewer\").then(function(i) {\n                var o = new XRRigidTransform({ x: 0, y: -e.defaultHeightCompensation, z: 0 });\n                return i.getOffsetReferenceSpace(o);\n              }, function(i) {\n                throw l.a.Error(i), 'XR initialization failed: required \"viewer\" reference space type not supported.';\n              });\n            }).then(function(n) {\n              return e.session.requestReferenceSpace(\"viewer\").then(function(i) {\n                return e.viewerReferenceSpace = i, n;\n              });\n            }).then(function(n) {\n              return e.referenceSpace = e.baseReferenceSpace = n, e.referenceSpace;\n            });\n          }, r.prototype.updateRenderStateAsync = function(t) {\n            return t.baseLayer && (this.baseLayer = t.baseLayer), this.session.updateRenderState(t);\n          }, r.IsSessionSupportedAsync = function(t) {\n            if (!navigator.xr)\n              return Promise.resolve(!1);\n            var e = navigator.xr.isSessionSupported || navigator.xr.supportsSession;\n            return e ? e.call(navigator.xr, t).then(function(n) {\n              var i = n === void 0 || n;\n              return Promise.resolve(i);\n            }).catch(function(n) {\n              return l.a.Warn(n), Promise.resolve(!1);\n            }) : Promise.resolve(!1);\n          }, r.prototype._createRenderTargetTexture = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Pt.a(this.scene.getEngine(), Pt.b.Unknown, !0);\n            i.width = t, i.height = e, i._framebuffer = n;\n            var o = new on(\"XR renderTargetTexture\", { width: t, height: e }, this.scene, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, !0);\n            return o._texture = i, o;\n          }, r;\n        }();\n        (function(r) {\n          r[r.ENTERING_XR = 0] = \"ENTERING_XR\", r[r.EXITING_XR = 1] = \"EXITING_XR\", r[r.IN_XR = 2] = \"IN_XR\", r[r.NOT_IN_XR = 3] = \"NOT_IN_XR\";\n        })(fn || (fn = {})), function(r) {\n          r[r.NOT_TRACKING = 0] = \"NOT_TRACKING\", r[r.TRACKING_LOST = 1] = \"TRACKING_LOST\", r[r.TRACKING = 2] = \"TRACKING\";\n        }(Xi || (Xi = {}));\n        var $n, Ol = function() {\n          function r(t, e) {\n            if (e === void 0 && (e = null), this.scene = t, this._pointerDownOnMeshAsked = !1, this._isActionableMesh = !1, this._teleportationRequestInitiated = !1, this._teleportationBackRequestInitiated = !1, this._rotationRightAsked = !1, this._rotationLeftAsked = !1, this._dpadPressed = !0, this._activePointer = !1, this._id = r._idCounter++, e)\n              this._gazeTracker = e.clone(\"gazeTracker\");\n            else {\n              this._gazeTracker = Ie.a.CreateTorus(\"gazeTracker\", 35e-4, 25e-4, 20, t, !1), this._gazeTracker.bakeCurrentTransformIntoVertices(), this._gazeTracker.isPickable = !1, this._gazeTracker.isVisible = !1;\n              var n = new Nt.a(\"targetMat\", t);\n              n.specularColor = I.a.Black(), n.emissiveColor = new I.a(0.7, 0.7, 0.7), n.backFaceCulling = !1, this._gazeTracker.material = n;\n            }\n          }\n          return r.prototype._getForwardRay = function(t) {\n            return new dn.a(u.e.Zero(), new u.e(0, 0, t));\n          }, r.prototype._selectionPointerDown = function() {\n            this._pointerDownOnMeshAsked = !0, this._currentHit && this.scene.simulatePointerDown(this._currentHit, { pointerId: this._id });\n          }, r.prototype._selectionPointerUp = function() {\n            this._currentHit && this.scene.simulatePointerUp(this._currentHit, { pointerId: this._id }), this._pointerDownOnMeshAsked = !1;\n          }, r.prototype._activatePointer = function() {\n            this._activePointer = !0;\n          }, r.prototype._deactivatePointer = function() {\n            this._activePointer = !1;\n          }, r.prototype._updatePointerDistance = function(t) {\n          }, r.prototype.dispose = function() {\n            this._interactionsEnabled = !1, this._teleportationEnabled = !1, this._gazeTracker && this._gazeTracker.dispose();\n          }, r._idCounter = 0, r;\n        }(), xf = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, n, i) || this;\n            o.webVRController = e, o._laserPointer = Ie.a.CreateCylinder(\"laserPointer\", 1, 4e-3, 2e-4, 20, 1, n, !1);\n            var a = new Nt.a(\"laserPointerMat\", n);\n            if (a.emissiveColor = new I.a(0.7, 0.7, 0.7), a.alpha = 0.6, o._laserPointer.material = a, o._laserPointer.rotation.x = Math.PI / 2, o._laserPointer.position.z = -0.5, o._laserPointer.isVisible = !1, o._laserPointer.isPickable = !1, !e.mesh) {\n              var s = new Ie.a(\"preloadControllerMesh\", n), d = new Ie.a(ar.POINTING_POSE, n);\n              d.rotation.x = -0.7, s.addChild(d), e.attachToMesh(s);\n            }\n            return o._setLaserPointerParent(e.mesh), o._meshAttachedObserver = e._meshAttachedObservable.add(function(p) {\n              o._setLaserPointerParent(p);\n            }), o;\n          }\n          return Object(c.d)(t, r), t.prototype._getForwardRay = function(e) {\n            return this.webVRController.getForwardRay(e);\n          }, t.prototype._activatePointer = function() {\n            r.prototype._activatePointer.call(this), this._laserPointer.isVisible = !0;\n          }, t.prototype._deactivatePointer = function() {\n            r.prototype._deactivatePointer.call(this), this._laserPointer.isVisible = !1;\n          }, t.prototype._setLaserPointerColor = function(e) {\n            this._laserPointer.material.emissiveColor = e;\n          }, t.prototype._setLaserPointerLightingDisabled = function(e) {\n            this._laserPointer.material.disableLighting = e;\n          }, t.prototype._setLaserPointerParent = function(e) {\n            var n = function(s) {\n              s.isPickable = !1, s.getChildMeshes().forEach(function(d) {\n                n(d);\n              });\n            };\n            n(e);\n            var i = e.getChildren(void 0, !1), o = e;\n            this.webVRController._pointingPoseNode = null;\n            for (var a = 0; a < i.length; a++)\n              if (i[a].name && i[a].name.indexOf(ar.POINTING_POSE) >= 0) {\n                o = i[a], this.webVRController._pointingPoseNode = o;\n                break;\n              }\n            this._laserPointer.parent = o;\n          }, t.prototype._updatePointerDistance = function(e) {\n            e === void 0 && (e = 100), this._laserPointer.scaling.y = e, this._laserPointer.position.z = -e / 2;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._laserPointer.dispose(), this._meshAttachedObserver && this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver);\n          }, t;\n        }(Ol), Ml = function(r) {\n          function t(e, n) {\n            var i = r.call(this, n) || this;\n            return i.getCamera = e, i;\n          }\n          return Object(c.d)(t, r), t.prototype._getForwardRay = function(e) {\n            var n = this.getCamera();\n            return n ? n.getForwardRay(e) : new dn.a(u.e.Zero(), u.e.Forward());\n          }, t;\n        }(Ol), Cf = function() {\n        }, Il = function() {\n          function r(t, e) {\n            var n = this;\n            if (e === void 0 && (e = {}), this.webVROptions = e, this._webVRsupported = !1, this._webVRready = !1, this._webVRrequesting = !1, this._webVRpresenting = !1, this._fullscreenVRpresenting = !1, this.enableGazeEvenWhenNoPointerLock = !1, this.exitVROnDoubleTap = !0, this.onEnteringVRObservable = new C.c(), this.onAfterEnteringVRObservable = new C.c(), this.onExitingVRObservable = new C.c(), this.onControllerMeshLoadedObservable = new C.c(), this._useCustomVRButton = !1, this._teleportationRequested = !1, this._teleportActive = !1, this._floorMeshesCollection = [], this._teleportationMode = r.TELEPORTATIONMODE_CONSTANTTIME, this._teleportationTime = 122, this._teleportationSpeed = 20, this._rotationAllowed = !0, this._teleportBackwardsVector = new u.e(0, -1, -1), this._isDefaultTeleportationTarget = !0, this._teleportationFillColor = \"#444444\", this._teleportationBorderColor = \"#FFFFFF\", this._rotationAngle = 0, this._haloCenter = new u.e(0, 0, 0), this._padSensibilityUp = 0.65, this._padSensibilityDown = 0.35, this._leftController = null, this._rightController = null, this._gazeColor = new I.a(0.7, 0.7, 0.7), this._laserColor = new I.a(0.7, 0.7, 0.7), this._pickedLaserColor = new I.a(0.2, 0.2, 1), this._pickedGazeColor = new I.a(0, 0, 1), this.onNewMeshSelected = new C.c(), this.onMeshSelectedWithController = new C.c(), this.onNewMeshPicked = new C.c(), this.onBeforeCameraTeleport = new C.c(), this.onAfterCameraTeleport = new C.c(), this.onSelectedMeshUnselected = new C.c(), this.teleportationEnabled = !0, this._teleportationInitialized = !1, this._interactionsEnabled = !1, this._interactionsRequested = !1, this._displayGaze = !0, this._displayLaserPointer = !0, this.updateGazeTrackerScale = !0, this.updateGazeTrackerColor = !0, this.updateControllerLaserColor = !0, this.requestPointerLockOnFullScreen = !0, this.xrTestDone = !1, this._onResize = function() {\n              n.moveButtonToBottomRight(), n._fullscreenVRpresenting && n._webVRready && n.exitVR();\n            }, this._onFullscreenChange = function() {\n              var o = document;\n              o.fullscreen !== void 0 ? n._fullscreenVRpresenting = document.fullscreen : o.mozFullScreen !== void 0 ? n._fullscreenVRpresenting = o.mozFullScreen : o.webkitIsFullScreen !== void 0 ? n._fullscreenVRpresenting = o.webkitIsFullScreen : o.msIsFullScreen !== void 0 ? n._fullscreenVRpresenting = o.msIsFullScreen : document.msFullscreenElement !== void 0 && (n._fullscreenVRpresenting = document.msFullscreenElement), !n._fullscreenVRpresenting && n._inputElement && (n.exitVR(), !n._useCustomVRButton && n._btnVR && (n._btnVR.style.top = n._inputElement.offsetTop + n._inputElement.offsetHeight - 70 + \"px\", n._btnVR.style.left = n._inputElement.offsetLeft + n._inputElement.offsetWidth - 100 + \"px\", n.updateButtonVisibility()));\n            }, this._cachedAngularSensibility = { angularSensibilityX: null, angularSensibilityY: null, angularSensibility: null }, this.beforeRender = function() {\n              n._leftController && n._leftController._activePointer && n._castRayAndSelectObject(n._leftController), n._rightController && n._rightController._activePointer && n._castRayAndSelectObject(n._rightController), n._noControllerIsActive && (n._scene.getEngine().isPointerLock || n.enableGazeEvenWhenNoPointerLock) ? n._castRayAndSelectObject(n._cameraGazer) : n._cameraGazer._gazeTracker.isVisible = !1;\n            }, this._onNewGamepadConnected = function(o) {\n              if (o.type !== hn.POSE_ENABLED)\n                o.leftStick && o.onleftstickchanged(function(d) {\n                  n._teleportationInitialized && n.teleportationEnabled && (!n._leftController && !n._rightController || n._leftController && !n._leftController._activePointer && n._rightController && !n._rightController._activePointer) && (n._checkTeleportWithRay(d, n._cameraGazer), n._checkTeleportBackwards(d, n._cameraGazer));\n                }), o.rightStick && o.onrightstickchanged(function(d) {\n                  n._teleportationInitialized && n._checkRotate(d, n._cameraGazer);\n                }), o.type === hn.XBOX && (o.onbuttondown(function(d) {\n                  n._interactionsEnabled && d === xn.A && n._cameraGazer._selectionPointerDown();\n                }), o.onbuttonup(function(d) {\n                  n._interactionsEnabled && d === xn.A && n._cameraGazer._selectionPointerUp();\n                }));\n              else {\n                var a = o, s = new xf(a, n._scene, n._cameraGazer._gazeTracker);\n                a.hand === \"right\" || n._leftController && n._leftController.webVRController != a ? n._rightController = s : n._leftController = s, n._tryEnableInteractionOnController(s);\n              }\n            }, this._tryEnableInteractionOnController = function(o) {\n              n._interactionsRequested && !o._interactionsEnabled && n._enableInteractionOnController(o), n._teleportationRequested && !o._teleportationEnabled && n._enableTeleportationOnController(o);\n            }, this._onNewGamepadDisconnected = function(o) {\n              o instanceof Ri && (o.hand === \"left\" && n._leftController != null && (n._leftController.dispose(), n._leftController = null), o.hand === \"right\" && n._rightController != null && (n._rightController.dispose(), n._rightController = null));\n            }, this._workingVector = u.e.Zero(), this._workingQuaternion = u.b.Identity(), this._workingMatrix = u.a.Identity(), this._scene = t, this._inputElement = t.getEngine().getInputElement(), \"getVRDisplays\" in navigator || (e.useXR = !0), e.createFallbackVRDeviceOrientationFreeCamera === void 0 && (e.createFallbackVRDeviceOrientationFreeCamera = !0), e.createDeviceOrientationCamera === void 0 && (e.createDeviceOrientationCamera = !0), e.laserToggle === void 0 && (e.laserToggle = !0), e.defaultHeight === void 0 && (e.defaultHeight = 1.7), e.useCustomVRButton && (this._useCustomVRButton = !0, e.customVRButton && (this._btnVR = e.customVRButton)), e.rayLength && (this._rayLength = e.rayLength), this._defaultHeight = e.defaultHeight, e.positionScale && (this._rayLength *= e.positionScale, this._defaultHeight *= e.positionScale), this._hasEnteredVR = !1, this._scene.activeCamera ? this._position = this._scene.activeCamera.position.clone() : this._position = new u.e(0, this._defaultHeight, 0), e.createDeviceOrientationCamera || !this._scene.activeCamera) {\n              if (this._deviceOrientationCamera = new xo(\"deviceOrientationVRHelper\", this._position.clone(), t), this._scene.activeCamera && (this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ, this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ, this._scene.activeCamera instanceof Pi && this._scene.activeCamera.rotation)) {\n                var i = this._scene.activeCamera;\n                i.rotationQuaternion ? this._deviceOrientationCamera.rotationQuaternion.copyFrom(i.rotationQuaternion) : this._deviceOrientationCamera.rotationQuaternion.copyFrom(u.b.RotationYawPitchRoll(i.rotation.y, i.rotation.x, i.rotation.z)), this._deviceOrientationCamera.rotation = i.rotation.clone();\n              }\n              this._scene.activeCamera = this._deviceOrientationCamera, this._inputElement && this._scene.activeCamera.attachControl();\n            } else\n              this._existingCamera = this._scene.activeCamera;\n            this.webVROptions.useXR && navigator.xr ? rs.IsSessionSupportedAsync(\"immersive-vr\").then(function(o) {\n              o ? (l.a.Log(\"Using WebXR. It is recommended to use the WebXRDefaultExperience directly\"), t.createDefaultXRExperienceAsync({ floorMeshes: e.floorMeshes || [] }).then(function(a) {\n                n.xr = a, n.xrTestDone = !0, n._cameraGazer = new Ml(function() {\n                  return n.xr.baseExperience.camera;\n                }, t), n.xr.baseExperience.onStateChangedObservable.add(function(s) {\n                  switch (s) {\n                    case fn.ENTERING_XR:\n                      n.onEnteringVRObservable.notifyObservers(n), n._interactionsEnabled || n.xr.pointerSelection.detach(), n.xr.pointerSelection.displayLaserPointer = n._displayLaserPointer;\n                      break;\n                    case fn.EXITING_XR:\n                      n.onExitingVRObservable.notifyObservers(n), n._scene.getEngine().resize();\n                      break;\n                    case fn.IN_XR:\n                      n._hasEnteredVR = !0;\n                      break;\n                    case fn.NOT_IN_XR:\n                      n._hasEnteredVR = !1;\n                  }\n                });\n              })) : n.completeVRInit(t, e);\n            }) : this.completeVRInit(t, e);\n          }\n          return Object.defineProperty(r.prototype, \"onEnteringVR\", { get: function() {\n            return this.onEnteringVRObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onExitingVR\", { get: function() {\n            return this.onExitingVRObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onControllerMeshLoaded\", { get: function() {\n            return this.onControllerMeshLoadedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"teleportationTarget\", { get: function() {\n            return this._teleportationTarget;\n          }, set: function(t) {\n            t && (t.name = \"teleportationTarget\", this._isDefaultTeleportationTarget = !1, this._teleportationTarget = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"gazeTrackerMesh\", { get: function() {\n            return this._cameraGazer._gazeTracker;\n          }, set: function(t) {\n            t && (this._cameraGazer._gazeTracker && this._cameraGazer._gazeTracker.dispose(), this._leftController && this._leftController._gazeTracker && this._leftController._gazeTracker.dispose(), this._rightController && this._rightController._gazeTracker && this._rightController._gazeTracker.dispose(), this._cameraGazer._gazeTracker = t, this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(), this._cameraGazer._gazeTracker.isPickable = !1, this._cameraGazer._gazeTracker.isVisible = !1, this._cameraGazer._gazeTracker.name = \"gazeTracker\", this._leftController && (this._leftController._gazeTracker = this._cameraGazer._gazeTracker.clone(\"gazeTracker\")), this._rightController && (this._rightController._gazeTracker = this._cameraGazer._gazeTracker.clone(\"gazeTracker\")));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"leftControllerGazeTrackerMesh\", { get: function() {\n            return this._leftController ? this._leftController._gazeTracker : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightControllerGazeTrackerMesh\", { get: function() {\n            return this._rightController ? this._rightController._gazeTracker : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"displayGaze\", { get: function() {\n            return this._displayGaze;\n          }, set: function(t) {\n            this._displayGaze = t, t || (this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"displayLaserPointer\", { get: function() {\n            return this._displayLaserPointer;\n          }, set: function(t) {\n            this._displayLaserPointer = t, t ? (this._rightController && this._rightController._activatePointer(), this._leftController && this._leftController._activatePointer()) : (this._rightController && (this._rightController._deactivatePointer(), this._rightController._gazeTracker.isVisible = !1), this._leftController && (this._leftController._deactivatePointer(), this._leftController._gazeTracker.isVisible = !1));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"deviceOrientationCamera\", { get: function() {\n            return this._deviceOrientationCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentVRCamera\", { get: function() {\n            return this._webVRready ? this._webVRCamera : this._scene.activeCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"webVRCamera\", { get: function() {\n            return this._webVRCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"vrDeviceOrientationCamera\", { get: function() {\n            return this._vrDeviceOrientationCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"vrButton\", { get: function() {\n            return this._btnVR;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"_teleportationRequestInitiated\", { get: function() {\n            return this._cameraGazer._teleportationRequestInitiated || this._leftController !== null && this._leftController._teleportationRequestInitiated || this._rightController !== null && this._rightController._teleportationRequestInitiated;\n          }, enumerable: !1, configurable: !0 }), r.prototype.completeVRInit = function(t, e) {\n            var n = this;\n            if (this.xrTestDone = !0, e.createFallbackVRDeviceOrientationFreeCamera && (e.useMultiview && (e.vrDeviceOrientationCameraMetrics || (e.vrDeviceOrientationCameraMetrics = cr.GetDefault()), e.vrDeviceOrientationCameraMetrics.multiviewEnabled = !0), this._vrDeviceOrientationCamera = new Ro(\"VRDeviceOrientationVRHelper\", this._position, this._scene, !0, e.vrDeviceOrientationCameraMetrics), this._vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._webVRCamera = new Mo(\"WebVRHelper\", this._position, this._scene, e), this._webVRCamera.useStandingMatrix(), this._cameraGazer = new Ml(function() {\n              return n.currentVRCamera;\n            }, t), !this._useCustomVRButton) {\n              this._btnVR = document.createElement(\"BUTTON\"), this._btnVR.className = \"babylonVRicon\", this._btnVR.id = \"babylonVRiconbtn\", this._btnVR.title = \"Click to switch to VR\";\n              var i = \".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(\" + (window.SVGSVGElement ? \"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A\" : \"https://cdn.babylonjs.com/Assets/vrButton.png\") + \"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }\";\n              i += \".babylonVRicon.vrdisplaypresenting { display: none; }\";\n              var o = document.createElement(\"style\");\n              o.appendChild(document.createTextNode(i)), document.getElementsByTagName(\"head\")[0].appendChild(o), this.moveButtonToBottomRight();\n            }\n            this._btnVR && this._btnVR.addEventListener(\"click\", function() {\n              n.isInVRMode ? n._scene.getEngine().disableVR() : n.enterVR();\n            });\n            var a = this._scene.getEngine().getHostWindow();\n            a && (a.addEventListener(\"resize\", this._onResize), document.addEventListener(\"fullscreenchange\", this._onFullscreenChange, !1), document.addEventListener(\"mozfullscreenchange\", this._onFullscreenChange, !1), document.addEventListener(\"webkitfullscreenchange\", this._onFullscreenChange, !1), document.addEventListener(\"msfullscreenchange\", this._onFullscreenChange, !1), document.onmsfullscreenchange = this._onFullscreenChange, e.createFallbackVRDeviceOrientationFreeCamera ? this.displayVRButton() : this._scene.getEngine().onVRDisplayChangedObservable.add(function(s) {\n              s.vrDisplay && n.displayVRButton();\n            }), this._onKeyDown = function(s) {\n              s.keyCode === 27 && n.isInVRMode && n.exitVR();\n            }, document.addEventListener(\"keydown\", this._onKeyDown), this._scene.onPrePointerObservable.add(function() {\n              n._hasEnteredVR && n.exitVROnDoubleTap && (n.exitVR(), n._fullscreenVRpresenting && n._scene.getEngine().exitFullscreen());\n            }, yt.a.POINTERDOUBLETAP, !1), this._onVRDisplayChanged = function(s) {\n              return n.onVRDisplayChanged(s);\n            }, this._onVrDisplayPresentChange = function() {\n              return n.onVrDisplayPresentChange();\n            }, this._onVRRequestPresentStart = function() {\n              n._webVRrequesting = !0, n.updateButtonVisibility();\n            }, this._onVRRequestPresentComplete = function() {\n              n._webVRrequesting = !1, n.updateButtonVisibility();\n            }, t.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged), t.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart), t.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete), a.addEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), t.onDisposeObservable.add(function() {\n              n.dispose();\n            }), this._webVRCamera.onControllerMeshLoadedObservable.add(function(s) {\n              return n._onDefaultMeshLoaded(s);\n            }), this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected), this.updateButtonVisibility(), this._circleEase = new tt(), this._circleEase.setEasingMode(Ge.EASINGMODE_EASEINOUT), this._teleportationEasing = this._circleEase, t.onPointerObservable.add(function(s) {\n              n._interactionsEnabled && t.activeCamera === n.vrDeviceOrientationCamera && s.event.pointerType === \"mouse\" && (s.type === yt.a.POINTERDOWN ? n._cameraGazer._selectionPointerDown() : s.type === yt.a.POINTERUP && n._cameraGazer._selectionPointerUp());\n            }), this.webVROptions.floorMeshes && this.enableTeleportation({ floorMeshes: this.webVROptions.floorMeshes }));\n          }, r.prototype._onDefaultMeshLoaded = function(t) {\n            this._leftController && this._leftController.webVRController == t && t.mesh && this._leftController._setLaserPointerParent(t.mesh), this._rightController && this._rightController.webVRController == t && t.mesh && this._rightController._setLaserPointerParent(t.mesh);\n            try {\n              this.onControllerMeshLoadedObservable.notifyObservers(t);\n            } catch (e) {\n              l.a.Warn(\"Error in your custom logic onControllerMeshLoaded: \" + e);\n            }\n          }, Object.defineProperty(r.prototype, \"isInVRMode\", { get: function() {\n            return this.xr && this.webVROptions.useXR && this.xr.baseExperience.state === fn.IN_XR || this._webVRpresenting || this._fullscreenVRpresenting;\n          }, enumerable: !1, configurable: !0 }), r.prototype.onVrDisplayPresentChange = function() {\n            var t = this._scene.getEngine().getVRDevice();\n            if (t) {\n              var e = this._webVRpresenting;\n              this._webVRpresenting = t.isPresenting, e && !this._webVRpresenting && this.exitVR();\n            } else\n              l.a.Warn(\"Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?\");\n            this.updateButtonVisibility();\n          }, r.prototype.onVRDisplayChanged = function(t) {\n            this._webVRsupported = t.vrSupported, this._webVRready = !!t.vrDisplay, this._webVRpresenting = t.vrDisplay && t.vrDisplay.isPresenting, this.updateButtonVisibility();\n          }, r.prototype.moveButtonToBottomRight = function() {\n            if (this._inputElement && !this._useCustomVRButton && this._btnVR) {\n              var t = this._inputElement.getBoundingClientRect();\n              this._btnVR.style.top = t.top + t.height - 70 + \"px\", this._btnVR.style.left = t.left + t.width - 100 + \"px\";\n            }\n          }, r.prototype.displayVRButton = function() {\n            this._useCustomVRButton || this._btnVRDisplayed || !this._btnVR || (document.body.appendChild(this._btnVR), this._btnVRDisplayed = !0);\n          }, r.prototype.updateButtonVisibility = function() {\n            this._btnVR && !this._useCustomVRButton && (this._btnVR.className = \"babylonVRicon\", this.isInVRMode ? this._btnVR.className += \" vrdisplaypresenting\" : (this._webVRready && (this._btnVR.className += \" vrdisplayready\"), this._webVRsupported && (this._btnVR.className += \" vrdisplaysupported\"), this._webVRrequesting && (this._btnVR.className += \" vrdisplayrequesting\")));\n          }, r.prototype.enterVR = function() {\n            var t = this;\n            if (this.xr)\n              this.xr.baseExperience.enterXRAsync(\"immersive-vr\", \"local-floor\", this.xr.renderTarget);\n            else {\n              if (this.onEnteringVRObservable)\n                try {\n                  this.onEnteringVRObservable.notifyObservers(this);\n                } catch (o) {\n                  l.a.Warn(\"Error in your custom logic onEnteringVR: \" + o);\n                }\n              if (this._scene.activeCamera) {\n                if (this._position = this._scene.activeCamera.position.clone(), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.rotation = u.b.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(), this.vrDeviceOrientationCamera.angularSensibility = 2e3), this.webVRCamera) {\n                  var e = this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y, n = u.b.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y - e, i = this.webVRCamera.rotationQuaternion.toEulerAngles().y;\n                  this.webVRCamera.rotationQuaternion = u.b.FromEulerAngles(0, i + n, 0);\n                }\n                this._existingCamera = this._scene.activeCamera, this._existingCamera.angularSensibilityX && (this._cachedAngularSensibility.angularSensibilityX = this._existingCamera.angularSensibilityX, this._existingCamera.angularSensibilityX = Number.MAX_VALUE), this._existingCamera.angularSensibilityY && (this._cachedAngularSensibility.angularSensibilityY = this._existingCamera.angularSensibilityY, this._existingCamera.angularSensibilityY = Number.MAX_VALUE), this._existingCamera.angularSensibility && (this._cachedAngularSensibility.angularSensibility = this._existingCamera.angularSensibility, this._existingCamera.angularSensibility = Number.MAX_VALUE);\n              }\n              this._webVRrequesting || (this._webVRready ? this._webVRpresenting || (this._scene.getEngine().onVRRequestPresentComplete.addOnce(function(o) {\n                t.onAfterEnteringVRObservable.notifyObservers({ success: o });\n              }), this._webVRCamera.position = this._position, this._scene.activeCamera = this._webVRCamera) : this._vrDeviceOrientationCamera && (this._vrDeviceOrientationCamera.position = this._position, this._scene.activeCamera && (this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ), this._scene.activeCamera = this._vrDeviceOrientationCamera, this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen), this.updateButtonVisibility(), this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(function() {\n                t.onAfterEnteringVRObservable.notifyObservers({ success: !0 });\n              })), this._scene.activeCamera && this._inputElement && this._scene.activeCamera.attachControl(), this._interactionsEnabled && this._scene.registerBeforeRender(this.beforeRender), this._displayLaserPointer && [this._leftController, this._rightController].forEach(function(o) {\n                o && o._activatePointer();\n              }), this._hasEnteredVR = !0);\n            }\n          }, r.prototype.exitVR = function() {\n            if (this.xr)\n              this.xr.baseExperience.exitXRAsync();\n            else if (this._hasEnteredVR) {\n              if (this.onExitingVRObservable)\n                try {\n                  this.onExitingVRObservable.notifyObservers(this);\n                } catch (e) {\n                  l.a.Warn(\"Error in your custom logic onExitingVR: \" + e);\n                }\n              this._webVRpresenting && this._scene.getEngine().disableVR(), this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone()), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._deviceOrientationCamera ? (this._deviceOrientationCamera.position = this._position, this._scene.activeCamera = this._deviceOrientationCamera, this._cachedAngularSensibility.angularSensibilityX && (this._deviceOrientationCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._deviceOrientationCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._deviceOrientationCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)) : this._existingCamera && (this._existingCamera.position = this._position, this._scene.activeCamera = this._existingCamera, this._inputElement && this._scene.activeCamera.attachControl(), this._cachedAngularSensibility.angularSensibilityX && (this._existingCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._existingCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._existingCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)), this.updateButtonVisibility(), this._interactionsEnabled && (this._scene.unregisterBeforeRender(this.beforeRender), this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1)), this._scene.getEngine().resize(), [this._leftController, this._rightController].forEach(function(e) {\n                e && e._deactivatePointer();\n              }), this._hasEnteredVR = !1;\n              var t = this._scene.getEngine();\n              t._onVrDisplayPresentChange && t._onVrDisplayPresentChange();\n            }\n          }, Object.defineProperty(r.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(t) {\n            this._position = t, this._scene.activeCamera && (this._scene.activeCamera.position = t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.enableInteractions = function() {\n            var t = this;\n            if (!this._interactionsEnabled) {\n              if (this._interactionsRequested = !0, this.xr)\n                return void (this.xr.baseExperience.state === fn.IN_XR && this.xr.pointerSelection.attach());\n              this._leftController && this._enableInteractionOnController(this._leftController), this._rightController && this._enableInteractionOnController(this._rightController), this.raySelectionPredicate = function(e) {\n                return e.isVisible && (e.isPickable || e.name === t._floorMeshName);\n              }, this.meshSelectionPredicate = function() {\n                return !0;\n              }, this._raySelectionPredicate = function(e) {\n                return !!(t._isTeleportationFloor(e) || e.name.indexOf(\"gazeTracker\") === -1 && e.name.indexOf(\"teleportationTarget\") === -1 && e.name.indexOf(\"torusTeleportation\") === -1) && t.raySelectionPredicate(e);\n              }, this._interactionsEnabled = !0;\n            }\n          }, Object.defineProperty(r.prototype, \"_noControllerIsActive\", { get: function() {\n            return !(this._leftController && this._leftController._activePointer || this._rightController && this._rightController._activePointer);\n          }, enumerable: !1, configurable: !0 }), r.prototype._isTeleportationFloor = function(t) {\n            for (var e = 0; e < this._floorMeshesCollection.length; e++)\n              if (this._floorMeshesCollection[e].id === t.id)\n                return !0;\n            return !(!this._floorMeshName || t.name !== this._floorMeshName);\n          }, r.prototype.addFloorMesh = function(t) {\n            this._floorMeshesCollection && (this._floorMeshesCollection.indexOf(t) > -1 || this._floorMeshesCollection.push(t));\n          }, r.prototype.removeFloorMesh = function(t) {\n            if (this._floorMeshesCollection) {\n              var e = this._floorMeshesCollection.indexOf(t);\n              e !== -1 && this._floorMeshesCollection.splice(e, 1);\n            }\n          }, r.prototype.enableTeleportation = function(t) {\n            var e = this;\n            if (t === void 0 && (t = {}), !this._teleportationInitialized) {\n              if (this._teleportationRequested = !0, this.enableInteractions(), this.webVROptions.useXR && (t.floorMeshes || t.floorMeshName)) {\n                var n = t.floorMeshes || [];\n                if (!n.length) {\n                  var i = this._scene.getMeshByName(t.floorMeshName);\n                  i && n.push(i);\n                }\n                if (this.xr)\n                  return n.forEach(function(s) {\n                    e.xr.teleportation.addFloorMesh(s);\n                  }), void (this.xr.teleportation.attached || this.xr.teleportation.attach());\n                if (!this.xrTestDone) {\n                  var o = function() {\n                    e.xrTestDone && (e._scene.unregisterBeforeRender(o), e.xr ? e.xr.teleportation.attached || e.xr.teleportation.attach() : e.enableTeleportation(t));\n                  };\n                  return void this._scene.registerBeforeRender(o);\n                }\n              }\n              t.floorMeshName && (this._floorMeshName = t.floorMeshName), t.floorMeshes && (this._floorMeshesCollection = t.floorMeshes), t.teleportationMode && (this._teleportationMode = t.teleportationMode), t.teleportationTime && t.teleportationTime > 0 && (this._teleportationTime = t.teleportationTime), t.teleportationSpeed && t.teleportationSpeed > 0 && (this._teleportationSpeed = t.teleportationSpeed), t.easingFunction !== void 0 && (this._teleportationEasing = t.easingFunction), this._leftController != null && this._enableTeleportationOnController(this._leftController), this._rightController != null && this._enableTeleportationOnController(this._rightController);\n              var a = new vn.a();\n              a.vignetteColor = new I.b(0, 0, 0, 0), a.vignetteEnabled = !0, this._postProcessMove = new Io(\"postProcessMove\", 1, this._webVRCamera, void 0, void 0, void 0, void 0, a), this._webVRCamera.detachPostProcess(this._postProcessMove), this._teleportationInitialized = !0, this._isDefaultTeleportationTarget && (this._createTeleportationCircles(), this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor));\n            }\n          }, r.prototype._enableInteractionOnController = function(t) {\n            var e = this;\n            t.webVRController.mesh && (t._interactionsEnabled = !0, this.isInVRMode && this._displayLaserPointer && t._activatePointer(), this.webVROptions.laserToggle && t.webVRController.onMainButtonStateChangedObservable.add(function(n) {\n              e._displayLaserPointer && n.value === 1 && (t._activePointer ? t._deactivatePointer() : t._activatePointer(), e.displayGaze && (t._gazeTracker.isVisible = t._activePointer));\n            }), t.webVRController.onTriggerStateChangedObservable.add(function(n) {\n              var i = t;\n              e._noControllerIsActive && (i = e._cameraGazer), i._pointerDownOnMeshAsked ? n.value < e._padSensibilityDown && i._selectionPointerUp() : n.value > e._padSensibilityUp && i._selectionPointerDown();\n            }));\n          }, r.prototype._checkTeleportWithRay = function(t, e) {\n            this._teleportationRequestInitiated && !e._teleportationRequestInitiated || (e._teleportationRequestInitiated ? Math.sqrt(t.y * t.y + t.x * t.x) < this._padSensibilityDown && (this._teleportActive && this.teleportCamera(this._haloCenter), e._teleportationRequestInitiated = !1) : t.y < -this._padSensibilityUp && e._dpadPressed && (e._activatePointer(), e._teleportationRequestInitiated = !0));\n          }, r.prototype._checkRotate = function(t, e) {\n            e._teleportationRequestInitiated || (e._rotationLeftAsked ? t.x > -this._padSensibilityDown && (e._rotationLeftAsked = !1) : t.x < -this._padSensibilityUp && e._dpadPressed && (e._rotationLeftAsked = !0, this._rotationAllowed && this._rotateCamera(!1)), e._rotationRightAsked ? t.x < this._padSensibilityDown && (e._rotationRightAsked = !1) : t.x > this._padSensibilityUp && e._dpadPressed && (e._rotationRightAsked = !0, this._rotationAllowed && this._rotateCamera(!0)));\n          }, r.prototype._checkTeleportBackwards = function(t, e) {\n            if (!e._teleportationRequestInitiated)\n              if (t.y > this._padSensibilityUp && e._dpadPressed) {\n                if (!e._teleportationBackRequestInitiated) {\n                  if (!this.currentVRCamera)\n                    return;\n                  var n = u.b.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()), i = this.currentVRCamera.position;\n                  this.currentVRCamera.devicePosition && this.currentVRCamera.deviceRotationQuaternion && (n = this.currentVRCamera.deviceRotationQuaternion, i = this.currentVRCamera.devicePosition), n.toEulerAnglesToRef(this._workingVector), this._workingVector.z = 0, this._workingVector.x = 0, u.b.RotationYawPitchRollToRef(this._workingVector.y, this._workingVector.x, this._workingVector.z, this._workingQuaternion), this._workingQuaternion.toRotationMatrix(this._workingMatrix), u.e.TransformCoordinatesToRef(this._teleportBackwardsVector, this._workingMatrix, this._workingVector);\n                  var o = new dn.a(i, this._workingVector), a = this._scene.pickWithRay(o, this._raySelectionPredicate);\n                  a && a.pickedPoint && a.pickedMesh && this._isTeleportationFloor(a.pickedMesh) && a.distance < 5 && this.teleportCamera(a.pickedPoint), e._teleportationBackRequestInitiated = !0;\n                }\n              } else\n                e._teleportationBackRequestInitiated = !1;\n          }, r.prototype._enableTeleportationOnController = function(t) {\n            var e = this;\n            t.webVRController.mesh && (t._interactionsEnabled || this._enableInteractionOnController(t), t._interactionsEnabled = !0, t._teleportationEnabled = !0, t.webVRController.controllerType === Jn.VIVE && (t._dpadPressed = !1, t.webVRController.onPadStateChangedObservable.add(function(n) {\n              t._dpadPressed = n.pressed, t._dpadPressed || (t._rotationLeftAsked = !1, t._rotationRightAsked = !1, t._teleportationBackRequestInitiated = !1);\n            })), t.webVRController.onPadValuesChangedObservable.add(function(n) {\n              e.teleportationEnabled && (e._checkTeleportBackwards(n, t), e._checkTeleportWithRay(n, t)), e._checkRotate(n, t);\n            }));\n          }, r.prototype._createTeleportationCircles = function() {\n            this._teleportationTarget = Ie.a.CreateGround(\"teleportationTarget\", 2, 2, 2, this._scene), this._teleportationTarget.isPickable = !1;\n            var t = new pi.a(\"DynamicTexture\", 512, this._scene, !0);\n            t.hasAlpha = !0;\n            var e = t.getContext();\n            e.beginPath(), e.arc(256, 256, 200, 0, 2 * Math.PI, !1), e.fillStyle = this._teleportationFillColor, e.fill(), e.lineWidth = 10, e.strokeStyle = this._teleportationBorderColor, e.stroke(), e.closePath(), t.update();\n            var n = new Nt.a(\"TextPlaneMaterial\", this._scene);\n            n.diffuseTexture = t, this._teleportationTarget.material = n;\n            var i = Ie.a.CreateTorus(\"torusTeleportation\", 0.75, 0.1, 25, this._scene, !1);\n            i.isPickable = !1, i.parent = this._teleportationTarget;\n            var o = new k(\"animationInnerCircle\", \"position.y\", 30, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CYCLE), a = [];\n            a.push({ frame: 0, value: 0 }), a.push({ frame: 30, value: 0.4 }), a.push({ frame: 60, value: 0 }), o.setKeys(a);\n            var s = new nn();\n            s.setEasingMode(Ge.EASINGMODE_EASEINOUT), o.setEasingFunction(s), i.animations = [], i.animations.push(o), this._scene.beginAnimation(i, 0, 60, !0), this._hideTeleportationTarget();\n          }, r.prototype._displayTeleportationTarget = function() {\n            this._teleportActive = !0, this._teleportationInitialized && (this._teleportationTarget.isVisible = !0, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !0));\n          }, r.prototype._hideTeleportationTarget = function() {\n            this._teleportActive = !1, this._teleportationInitialized && (this._teleportationTarget.isVisible = !1, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !1));\n          }, r.prototype._rotateCamera = function(t) {\n            var e = this;\n            if (this.currentVRCamera instanceof zn) {\n              t ? this._rotationAngle++ : this._rotationAngle--, this.currentVRCamera.animations = [];\n              var n = u.b.FromRotationMatrix(u.a.RotationY(Math.PI / 4 * this._rotationAngle)), i = new k(\"animationRotation\", \"rotationQuaternion\", 90, k.ANIMATIONTYPE_QUATERNION, k.ANIMATIONLOOPMODE_CONSTANT), o = [];\n              o.push({ frame: 0, value: this.currentVRCamera.rotationQuaternion }), o.push({ frame: 6, value: n }), i.setKeys(o), i.setEasingFunction(this._circleEase), this.currentVRCamera.animations.push(i), this._postProcessMove.animations = [];\n              var a = new k(\"animationPP\", \"vignetteWeight\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), s = [];\n              s.push({ frame: 0, value: 0 }), s.push({ frame: 3, value: 4 }), s.push({ frame: 6, value: 0 }), a.setKeys(s), a.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(a);\n              var d = new k(\"animationPP2\", \"vignetteStretch\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), p = [];\n              p.push({ frame: 0, value: 0 }), p.push({ frame: 3, value: 10 }), p.push({ frame: 6, value: 0 }), d.setKeys(p), d.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(d), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._postProcessMove.samples = 4, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, 6, !1, 1, function() {\n                e._webVRCamera.detachPostProcess(e._postProcessMove);\n              }), this._scene.beginAnimation(this.currentVRCamera, 0, 6, !1, 1);\n            }\n          }, r.prototype._moveTeleportationSelectorTo = function(t, e, n) {\n            if (t.pickedPoint) {\n              e._teleportationRequestInitiated && (this._displayTeleportationTarget(), this._haloCenter.copyFrom(t.pickedPoint), this._teleportationTarget.position.copyFrom(t.pickedPoint));\n              var i = this._convertNormalToDirectionOfRay(t.getNormal(!0, !1), n);\n              if (i) {\n                var o = u.e.Cross(be.a.Y, i), a = u.e.Cross(i, o);\n                u.e.RotationFromAxisToRef(a, i, o, this._teleportationTarget.rotation);\n              }\n              this._teleportationTarget.position.y += 0.1;\n            }\n          }, r.prototype.teleportCamera = function(t) {\n            var e = this;\n            if (this.currentVRCamera instanceof zn) {\n              this.webVRCamera.leftCamera ? (this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition), this._workingVector.subtractInPlace(this.webVRCamera.position), t.subtractToRef(this._workingVector, this._workingVector)) : this._workingVector.copyFrom(t), this.isInVRMode ? this._workingVector.y += this.webVRCamera.deviceDistanceToRoomGround() * this._webVRCamera.deviceScaleFactor : this._workingVector.y += this._defaultHeight, this.onBeforeCameraTeleport.notifyObservers(this._workingVector);\n              var n, i;\n              if (this._teleportationMode == r.TELEPORTATIONMODE_CONSTANTSPEED) {\n                i = 90;\n                var o = u.e.Distance(this.currentVRCamera.position, this._workingVector);\n                n = this._teleportationSpeed / o;\n              } else\n                i = Math.round(90 * this._teleportationTime / 1e3), n = 1;\n              this.currentVRCamera.animations = [];\n              var a = new k(\"animationCameraTeleportation\", \"position\", 90, k.ANIMATIONTYPE_VECTOR3, k.ANIMATIONLOOPMODE_CONSTANT), s = [{ frame: 0, value: this.currentVRCamera.position }, { frame: i, value: this._workingVector }];\n              a.setKeys(s), a.setEasingFunction(this._teleportationEasing), this.currentVRCamera.animations.push(a), this._postProcessMove.animations = [];\n              var d = Math.round(i / 2), p = new k(\"animationPP\", \"vignetteWeight\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), y = [];\n              y.push({ frame: 0, value: 0 }), y.push({ frame: d, value: 8 }), y.push({ frame: i, value: 0 }), p.setKeys(y), this._postProcessMove.animations.push(p);\n              var P = new k(\"animationPP2\", \"vignetteStretch\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), R = [];\n              R.push({ frame: 0, value: 0 }), R.push({ frame: d, value: 10 }), R.push({ frame: i, value: 0 }), P.setKeys(R), this._postProcessMove.animations.push(P), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, i, !1, n, function() {\n                e._webVRCamera.detachPostProcess(e._postProcessMove);\n              }), this._scene.beginAnimation(this.currentVRCamera, 0, i, !1, n, function() {\n                e.onAfterCameraTeleport.notifyObservers(e._workingVector);\n              }), this._hideTeleportationTarget();\n            }\n          }, r.prototype._convertNormalToDirectionOfRay = function(t, e) {\n            return t && Math.acos(u.e.Dot(t, e.direction)) < Math.PI / 2 && t.scaleInPlace(-1), t;\n          }, r.prototype._castRayAndSelectObject = function(t) {\n            if (this.currentVRCamera instanceof zn) {\n              var e = t._getForwardRay(this._rayLength), n = this._scene.pickWithRay(e, this._raySelectionPredicate);\n              if (n && (t._laserPointer && (n.originMesh = t._laserPointer.parent), this._scene.simulatePointerMove(n, { pointerId: t._id })), t._currentHit = n, n && n.pickedPoint) {\n                if (this._displayGaze) {\n                  var i = 1;\n                  t._gazeTracker.isVisible = !0, t._isActionableMesh && (i = 3), this.updateGazeTrackerScale && (t._gazeTracker.scaling.x = n.distance * i, t._gazeTracker.scaling.y = n.distance * i, t._gazeTracker.scaling.z = n.distance * i);\n                  var o = this._convertNormalToDirectionOfRay(n.getNormal(), e);\n                  if (o) {\n                    var a = u.e.Cross(be.a.Y, o), s = u.e.Cross(o, a);\n                    u.e.RotationFromAxisToRef(s, o, a, t._gazeTracker.rotation);\n                  }\n                  t._gazeTracker.position.copyFrom(n.pickedPoint), t._gazeTracker.position.x < 0 ? t._gazeTracker.position.x += 2e-3 : t._gazeTracker.position.x -= 2e-3, t._gazeTracker.position.y < 0 ? t._gazeTracker.position.y += 2e-3 : t._gazeTracker.position.y -= 2e-3, t._gazeTracker.position.z < 0 ? t._gazeTracker.position.z += 2e-3 : t._gazeTracker.position.z -= 2e-3;\n                }\n                t._updatePointerDistance(n.distance);\n              } else\n                t._updatePointerDistance(), t._gazeTracker.isVisible = !1;\n              if (n && n.pickedMesh) {\n                if (this._teleportationInitialized && this._isTeleportationFloor(n.pickedMesh) && n.pickedPoint)\n                  return t._currentMeshSelected && !this._isTeleportationFloor(t._currentMeshSelected) && this._notifySelectedMeshUnselected(t._currentMeshSelected), t._currentMeshSelected = null, void (t._teleportationRequestInitiated && this._moveTeleportationSelectorTo(n, t, e));\n                if (n.pickedMesh !== t._currentMeshSelected)\n                  if (this.meshSelectionPredicate(n.pickedMesh)) {\n                    this.onNewMeshPicked.notifyObservers(n), t._currentMeshSelected = n.pickedMesh, n.pickedMesh.isPickable && n.pickedMesh.actionManager ? (this.changeGazeColor(this._pickedGazeColor), this.changeLaserColor(this._pickedLaserColor), t._isActionableMesh = !0) : (this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor), t._isActionableMesh = !1);\n                    try {\n                      this.onNewMeshSelected.notifyObservers(n.pickedMesh);\n                      var d = t;\n                      d.webVRController && this.onMeshSelectedWithController.notifyObservers({ mesh: n.pickedMesh, controller: d.webVRController });\n                    } catch (p) {\n                      l.a.Warn(\"Error while raising onNewMeshSelected or onMeshSelectedWithController: \" + p);\n                    }\n                  } else\n                    this._notifySelectedMeshUnselected(t._currentMeshSelected), t._currentMeshSelected = null, this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor);\n              } else\n                this._notifySelectedMeshUnselected(t._currentMeshSelected), t._currentMeshSelected = null, this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor);\n            }\n          }, r.prototype._notifySelectedMeshUnselected = function(t) {\n            t && this.onSelectedMeshUnselected.notifyObservers(t);\n          }, r.prototype.setLaserColor = function(t, e) {\n            e === void 0 && (e = this._pickedLaserColor), this._laserColor = t, this._pickedLaserColor = e;\n          }, r.prototype.setLaserLightingState = function(t) {\n            t === void 0 && (t = !0), this._leftController && this._leftController._setLaserPointerLightingDisabled(!t), this._rightController && this._rightController._setLaserPointerLightingDisabled(!t);\n          }, r.prototype.setGazeColor = function(t, e) {\n            e === void 0 && (e = this._pickedGazeColor), this._gazeColor = t, this._pickedGazeColor = e;\n          }, r.prototype.changeLaserColor = function(t) {\n            this.updateControllerLaserColor && (this._leftController && this._leftController._setLaserPointerColor(t), this._rightController && this._rightController._setLaserPointerColor(t));\n          }, r.prototype.changeGazeColor = function(t) {\n            this.updateGazeTrackerColor && this._cameraGazer._gazeTracker.material && (this._cameraGazer._gazeTracker.material.emissiveColor = t, this._leftController && (this._leftController._gazeTracker.material.emissiveColor = t), this._rightController && (this._rightController._gazeTracker.material.emissiveColor = t));\n          }, r.prototype.dispose = function() {\n            this.isInVRMode && this.exitVR(), this._postProcessMove && this._postProcessMove.dispose(), this._webVRCamera && this._webVRCamera.dispose(), this._vrDeviceOrientationCamera && this._vrDeviceOrientationCamera.dispose(), !this._useCustomVRButton && this._btnVR && this._btnVR.parentNode && document.body.removeChild(this._btnVR), this._deviceOrientationCamera && this._scene.activeCamera != this._deviceOrientationCamera && this._deviceOrientationCamera.dispose(), this._cameraGazer && this._cameraGazer.dispose(), this._leftController && this._leftController.dispose(), this._rightController && this._rightController.dispose(), this._teleportationTarget && this._teleportationTarget.dispose(), this.xr && this.xr.dispose(), this._floorMeshesCollection = [], document.removeEventListener(\"keydown\", this._onKeyDown), window.removeEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), window.removeEventListener(\"resize\", this._onResize), document.removeEventListener(\"fullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"mozfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"webkitfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"msfullscreenchange\", this._onFullscreenChange), document.onmsfullscreenchange = null, this._scene.getEngine().onVRDisplayChangedObservable.removeCallback(this._onVRDisplayChanged), this._scene.getEngine().onVRRequestPresentStart.removeCallback(this._onVRRequestPresentStart), this._scene.getEngine().onVRRequestPresentComplete.removeCallback(this._onVRRequestPresentComplete), window.removeEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected), this._scene.unregisterBeforeRender(this.beforeRender);\n          }, r.prototype.getClassName = function() {\n            return \"VRExperienceHelper\";\n          }, r.TELEPORTATIONMODE_CONSTANTTIME = 0, r.TELEPORTATIONMODE_CONSTANTSPEED = 1, r;\n        }(), ur = f(64), hr = ($n = { root: 0, found: !1 }, function(r, t, e, n) {\n          $n.root = 0, $n.found = !1;\n          var i = t * t - 4 * r * e;\n          if (i < 0)\n            return $n;\n          var o = Math.sqrt(i), a = (-t - o) / (2 * r), s = (-t + o) / (2 * r);\n          if (a > s) {\n            var d = s;\n            s = a, a = d;\n          }\n          return a > 0 && a < n ? ($n.root = a, $n.found = !0, $n) : (s > 0 && s < n && ($n.root = s, $n.found = !0), $n);\n        }), Dl = function() {\n          function r() {\n            this._collisionPoint = u.e.Zero(), this._planeIntersectionPoint = u.e.Zero(), this._tempVector = u.e.Zero(), this._tempVector2 = u.e.Zero(), this._tempVector3 = u.e.Zero(), this._tempVector4 = u.e.Zero(), this._edge = u.e.Zero(), this._baseToVertex = u.e.Zero(), this._destinationPoint = u.e.Zero(), this._slidePlaneNormal = u.e.Zero(), this._displacementVector = u.e.Zero(), this._radius = u.e.One(), this._retry = 0, this._basePointWorld = u.e.Zero(), this._velocityWorld = u.e.Zero(), this._normalizedVelocity = u.e.Zero(), this._collisionMask = -1;\n          }\n          return Object.defineProperty(r.prototype, \"collisionMask\", { get: function() {\n            return this._collisionMask;\n          }, set: function(t) {\n            this._collisionMask = isNaN(t) ? -1 : t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"slidePlaneNormal\", { get: function() {\n            return this._slidePlaneNormal;\n          }, enumerable: !1, configurable: !0 }), r.prototype._initialize = function(t, e, n) {\n            this._velocity = e, u.e.NormalizeToRef(e, this._normalizedVelocity), this._basePoint = t, t.multiplyToRef(this._radius, this._basePointWorld), e.multiplyToRef(this._radius, this._velocityWorld), this._velocityWorldLength = this._velocityWorld.length(), this._epsilon = n, this.collisionFound = !1;\n          }, r.prototype._checkPointInTriangle = function(t, e, n, i, o) {\n            e.subtractToRef(t, this._tempVector), n.subtractToRef(t, this._tempVector2), u.e.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);\n            var a = u.e.Dot(this._tempVector4, o);\n            return !(a < 0) && (i.subtractToRef(t, this._tempVector3), u.e.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4), !((a = u.e.Dot(this._tempVector4, o)) < 0) && (u.e.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4), (a = u.e.Dot(this._tempVector4, o)) >= 0));\n          }, r.prototype._canDoCollision = function(t, e, n, i) {\n            var o = u.e.Distance(this._basePointWorld, t), a = Math.max(this._radius.x, this._radius.y, this._radius.z);\n            return !(o > this._velocityWorldLength + a + e) && !!function(s, d, p, y) {\n              return !(s.x > p.x + y) && !(p.x - y > d.x) && !(s.y > p.y + y) && !(p.y - y > d.y) && !(s.z > p.z + y) && !(p.z - y > d.z);\n            }(n, i, this._basePointWorld, this._velocityWorldLength + a);\n          }, r.prototype._testTriangle = function(t, e, n, i, o, a, s) {\n            var d, p = !1;\n            e || (e = []), e[t] || (e[t] = new ur.a(0, 0, 0, 0), e[t].copyFromPoints(n, i, o));\n            var y = e[t];\n            if (a || y.isFrontFacingTo(this._normalizedVelocity, 0)) {\n              var P = y.signedDistanceTo(this._basePoint), R = u.e.Dot(y.normal, this._velocity);\n              if (R == 0) {\n                if (Math.abs(P) >= 1)\n                  return;\n                p = !0, d = 0;\n              } else {\n                var B = (1 - P) / R;\n                if ((d = (-1 - P) / R) > B) {\n                  var F = B;\n                  B = d, d = F;\n                }\n                if (d > 1 || B < 0)\n                  return;\n                d < 0 && (d = 0), d > 1 && (d = 1);\n              }\n              this._collisionPoint.copyFromFloats(0, 0, 0);\n              var z = !1, J = 1;\n              if (p || (this._basePoint.subtractToRef(y.normal, this._planeIntersectionPoint), this._velocity.scaleToRef(d, this._tempVector), this._planeIntersectionPoint.addInPlace(this._tempVector), this._checkPointInTriangle(this._planeIntersectionPoint, n, i, o, y.normal) && (z = !0, J = d, this._collisionPoint.copyFrom(this._planeIntersectionPoint))), !z) {\n                var ie = this._velocity.lengthSquared(), se = ie;\n                this._basePoint.subtractToRef(n, this._tempVector);\n                var ce = 2 * u.e.Dot(this._velocity, this._tempVector), ue = this._tempVector.lengthSquared() - 1, fe = hr(se, ce, ue, J);\n                fe.found && (J = fe.root, z = !0, this._collisionPoint.copyFrom(n)), this._basePoint.subtractToRef(i, this._tempVector), ce = 2 * u.e.Dot(this._velocity, this._tempVector), ue = this._tempVector.lengthSquared() - 1, (fe = hr(se, ce, ue, J)).found && (J = fe.root, z = !0, this._collisionPoint.copyFrom(i)), this._basePoint.subtractToRef(o, this._tempVector), ce = 2 * u.e.Dot(this._velocity, this._tempVector), ue = this._tempVector.lengthSquared() - 1, (fe = hr(se, ce, ue, J)).found && (J = fe.root, z = !0, this._collisionPoint.copyFrom(o)), i.subtractToRef(n, this._edge), n.subtractToRef(this._basePoint, this._baseToVertex);\n                var ve = this._edge.lengthSquared(), Te = u.e.Dot(this._edge, this._velocity), Re = u.e.Dot(this._edge, this._baseToVertex);\n                if (se = ve * -ie + Te * Te, ce = ve * (2 * u.e.Dot(this._velocity, this._baseToVertex)) - 2 * Te * Re, ue = ve * (1 - this._baseToVertex.lengthSquared()) + Re * Re, (fe = hr(se, ce, ue, J)).found) {\n                  var Ae = (Te * fe.root - Re) / ve;\n                  Ae >= 0 && Ae <= 1 && (J = fe.root, z = !0, this._edge.scaleInPlace(Ae), n.addToRef(this._edge, this._collisionPoint));\n                }\n                o.subtractToRef(i, this._edge), i.subtractToRef(this._basePoint, this._baseToVertex), ve = this._edge.lengthSquared(), Te = u.e.Dot(this._edge, this._velocity), Re = u.e.Dot(this._edge, this._baseToVertex), se = ve * -ie + Te * Te, ce = ve * (2 * u.e.Dot(this._velocity, this._baseToVertex)) - 2 * Te * Re, ue = ve * (1 - this._baseToVertex.lengthSquared()) + Re * Re, (fe = hr(se, ce, ue, J)).found && (Ae = (Te * fe.root - Re) / ve) >= 0 && Ae <= 1 && (J = fe.root, z = !0, this._edge.scaleInPlace(Ae), i.addToRef(this._edge, this._collisionPoint)), n.subtractToRef(o, this._edge), o.subtractToRef(this._basePoint, this._baseToVertex), ve = this._edge.lengthSquared(), Te = u.e.Dot(this._edge, this._velocity), Re = u.e.Dot(this._edge, this._baseToVertex), se = ve * -ie + Te * Te, ce = ve * (2 * u.e.Dot(this._velocity, this._baseToVertex)) - 2 * Te * Re, ue = ve * (1 - this._baseToVertex.lengthSquared()) + Re * Re, (fe = hr(se, ce, ue, J)).found && (Ae = (Te * fe.root - Re) / ve) >= 0 && Ae <= 1 && (J = fe.root, z = !0, this._edge.scaleInPlace(Ae), o.addToRef(this._edge, this._collisionPoint));\n              }\n              if (z) {\n                var Ee = J * this._velocity.length();\n                (!this.collisionFound || Ee < this._nearestDistance) && (s.collisionResponse && (this.intersectionPoint ? this.intersectionPoint.copyFrom(this._collisionPoint) : this.intersectionPoint = this._collisionPoint.clone(), this._nearestDistance = Ee, this.collisionFound = !0), this.collidedMesh = s);\n              }\n            }\n          }, r.prototype._collide = function(t, e, n, i, o, a, s, d) {\n            if (n && n.length !== 0)\n              for (p = i; p < o; p += 3)\n                y = e[n[p] - a], P = e[n[p + 1] - a], R = e[n[p + 2] - a], this._testTriangle(p, t, R, P, y, s, d);\n            else\n              for (var p = 0; p < e.length; p += 3) {\n                var y = e[p], P = e[p + 1], R = e[p + 2];\n                this._testTriangle(p, t, R, P, y, s, d);\n              }\n          }, r.prototype._getResponse = function(t, e) {\n            t.addToRef(e, this._destinationPoint), e.scaleInPlace(this._nearestDistance / e.length()), this._basePoint.addToRef(e, t), t.subtractToRef(this.intersectionPoint, this._slidePlaneNormal), this._slidePlaneNormal.normalize(), this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector), t.addInPlace(this._displacementVector), this.intersectionPoint.addInPlace(this._displacementVector), this._slidePlaneNormal.scaleInPlace(ur.a.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)), this._destinationPoint.subtractInPlace(this._slidePlaneNormal), this._destinationPoint.subtractToRef(this.intersectionPoint, e);\n          }, r;\n        }(), Ll = function() {\n          function r() {\n            this._scaledPosition = u.e.Zero(), this._scaledVelocity = u.e.Zero(), this._finalPosition = u.e.Zero();\n          }\n          return r.prototype.getNewPosition = function(t, e, n, i, o, a, s) {\n            t.divideToRef(n._radius, this._scaledPosition), e.divideToRef(n._radius, this._scaledVelocity), n.collidedMesh = null, n._retry = 0, n._initialVelocity = this._scaledVelocity, n._initialPosition = this._scaledPosition, this._collideWithWorld(this._scaledPosition, this._scaledVelocity, n, i, this._finalPosition, o), this._finalPosition.multiplyInPlace(n._radius), a(s, this._finalPosition, n.collidedMesh);\n          }, r.prototype.createCollider = function() {\n            return new Dl();\n          }, r.prototype.init = function(t) {\n            this._scene = t;\n          }, r.prototype._collideWithWorld = function(t, e, n, i, o, a) {\n            a === void 0 && (a = null);\n            var s = 10 * Ue.a.CollisionsEpsilon;\n            if (n._retry >= i)\n              o.copyFrom(t);\n            else {\n              var d = a ? a.collisionMask : n.collisionMask;\n              n._initialize(t, e, s);\n              for (var p = a && a.surroundingMeshes || this._scene.meshes, y = 0; y < p.length; y++) {\n                var P = p[y];\n                P.isEnabled() && P.checkCollisions && P.subMeshes && P !== a && d & P.collisionGroup && P._checkCollision(n);\n              }\n              n.collisionFound ? (e.x === 0 && e.y === 0 && e.z === 0 || n._getResponse(t, e), e.length() <= s ? o.copyFrom(t) : (n._retry++, this._collideWithWorld(t, e, n, i, o, a))) : t.addToRef(e, o);\n            }\n          }, r;\n        }();\n        _e.a.CollisionCoordinatorFactory = function() {\n          return new Ll();\n        };\n        var Yi = f(54), Rf = f(114), Of = f(147), os = f(103), Mi = f(43), Nl = f(113), wl = function() {\n          function r(t, e, n, i, o, a) {\n            this.entries = new Array(), this._boundingVectors = new Array(), this._capacity = n, this._depth = i, this._maxDepth = o, this._creationFunc = a, this._minPoint = t, this._maxPoint = e, this._boundingVectors.push(t.clone()), this._boundingVectors.push(e.clone()), this._boundingVectors.push(t.clone()), this._boundingVectors[2].x = e.x, this._boundingVectors.push(t.clone()), this._boundingVectors[3].y = e.y, this._boundingVectors.push(t.clone()), this._boundingVectors[4].z = e.z, this._boundingVectors.push(e.clone()), this._boundingVectors[5].z = t.z, this._boundingVectors.push(e.clone()), this._boundingVectors[6].x = t.x, this._boundingVectors.push(e.clone()), this._boundingVectors[7].y = t.y;\n          }\n          return Object.defineProperty(r.prototype, \"capacity\", { get: function() {\n            return this._capacity;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"minPoint\", { get: function() {\n            return this._minPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxPoint\", { get: function() {\n            return this._maxPoint;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addEntry = function(t) {\n            if (this.blocks)\n              for (var e = 0; e < this.blocks.length; e++)\n                this.blocks[e].addEntry(t);\n            else\n              this._creationFunc(t, this), this.entries.length > this.capacity && this._depth < this._maxDepth && this.createInnerBlocks();\n          }, r.prototype.removeEntry = function(t) {\n            if (this.blocks)\n              for (var e = 0; e < this.blocks.length; e++)\n                this.blocks[e].removeEntry(t);\n            else {\n              var n = this.entries.indexOf(t);\n              n > -1 && this.entries.splice(n, 1);\n            }\n          }, r.prototype.addEntries = function(t) {\n            for (var e = 0; e < t.length; e++) {\n              var n = t[e];\n              this.addEntry(n);\n            }\n          }, r.prototype.select = function(t, e, n) {\n            if (os.a.IsInFrustum(this._boundingVectors, t)) {\n              if (this.blocks) {\n                for (var i = 0; i < this.blocks.length; i++)\n                  this.blocks[i].select(t, e, n);\n                return;\n              }\n              n ? e.concat(this.entries) : e.concatWithNoDuplicate(this.entries);\n            }\n          }, r.prototype.intersects = function(t, e, n, i) {\n            if (os.a.IntersectsSphere(this._minPoint, this._maxPoint, t, e)) {\n              if (this.blocks) {\n                for (var o = 0; o < this.blocks.length; o++)\n                  this.blocks[o].intersects(t, e, n, i);\n                return;\n              }\n              i ? n.concat(this.entries) : n.concatWithNoDuplicate(this.entries);\n            }\n          }, r.prototype.intersectsRay = function(t, e) {\n            if (t.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {\n              if (this.blocks) {\n                for (var n = 0; n < this.blocks.length; n++)\n                  this.blocks[n].intersectsRay(t, e);\n                return;\n              }\n              e.concatWithNoDuplicate(this.entries);\n            }\n          }, r.prototype.createInnerBlocks = function() {\n            r._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc);\n          }, r._CreateBlocks = function(t, e, n, i, o, a, s, d) {\n            s.blocks = new Array();\n            for (var p = new u.e((e.x - t.x) / 2, (e.y - t.y) / 2, (e.z - t.z) / 2), y = 0; y < 2; y++)\n              for (var P = 0; P < 2; P++)\n                for (var R = 0; R < 2; R++) {\n                  var B = new r(t.add(p.multiplyByFloats(y, P, R)), t.add(p.multiplyByFloats(y + 1, P + 1, R + 1)), i, o + 1, a, d);\n                  B.addEntries(n), s.blocks.push(B);\n                }\n          }, r;\n        }(), Wr = function() {\n          function r(t, e, n) {\n            n === void 0 && (n = 2), this.maxDepth = n, this.dynamicContent = new Array(), this._maxBlockCapacity = e || 64, this._selectionContent = new si.b(1024), this._creationFunc = t;\n          }\n          return r.prototype.update = function(t, e, n) {\n            wl._CreateBlocks(t, e, n, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc);\n          }, r.prototype.addMesh = function(t) {\n            for (var e = 0; e < this.blocks.length; e++)\n              this.blocks[e].addEntry(t);\n          }, r.prototype.removeMesh = function(t) {\n            for (var e = 0; e < this.blocks.length; e++)\n              this.blocks[e].removeEntry(t);\n          }, r.prototype.select = function(t, e) {\n            this._selectionContent.reset();\n            for (var n = 0; n < this.blocks.length; n++)\n              this.blocks[n].select(t, this._selectionContent, e);\n            return e ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;\n          }, r.prototype.intersects = function(t, e, n) {\n            this._selectionContent.reset();\n            for (var i = 0; i < this.blocks.length; i++)\n              this.blocks[i].intersects(t, e, this._selectionContent, n);\n            return n ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;\n          }, r.prototype.intersectsRay = function(t) {\n            this._selectionContent.reset();\n            for (var e = 0; e < this.blocks.length; e++)\n              this.blocks[e].intersectsRay(t, this._selectionContent);\n            return this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;\n          }, r.CreationFuncForMeshes = function(t, e) {\n            var n = t.getBoundingInfo();\n            !t.isBlocked && n.boundingBox.intersectsMinMax(e.minPoint, e.maxPoint) && e.entries.push(t);\n          }, r.CreationFuncForSubMeshes = function(t, e) {\n            t.getBoundingInfo().boundingBox.intersectsMinMax(e.minPoint, e.maxPoint) && e.entries.push(t);\n          }, r;\n        }();\n        _e.a.prototype.createOrUpdateSelectionOctree = function(r, t) {\n          r === void 0 && (r = 64), t === void 0 && (t = 2);\n          var e = this._getComponent(ot.a.NAME_OCTREE);\n          e || (e = new us(this), this._addComponent(e)), this._selectionOctree || (this._selectionOctree = new Wr(Wr.CreationFuncForMeshes, r, t));\n          var n = this.getWorldExtends();\n          return this._selectionOctree.update(n.min, n.max, this.meshes), this._selectionOctree;\n        }, Object.defineProperty(_e.a.prototype, \"selectionOctree\", { get: function() {\n          return this._selectionOctree;\n        }, enumerable: !0, configurable: !0 }), Mt.a.prototype.createOrUpdateSubmeshesOctree = function(r, t) {\n          r === void 0 && (r = 64), t === void 0 && (t = 2);\n          var e = this.getScene(), n = e._getComponent(ot.a.NAME_OCTREE);\n          n || (n = new us(e), e._addComponent(n)), this._submeshesOctree || (this._submeshesOctree = new Wr(Wr.CreationFuncForSubMeshes, r, t)), this.computeWorldMatrix(!0);\n          var i = this.getBoundingInfo().boundingBox;\n          return this._submeshesOctree.update(i.minimumWorld, i.maximumWorld, this.subMeshes), this._submeshesOctree;\n        };\n        var Xt, as, ss, cs, ls, us = function() {\n          function r(t) {\n            this.name = ot.a.NAME_OCTREE, this.checksIsEnabled = !0, this._tempRay = new dn.a(u.e.Zero(), new u.e(1, 1, 1)), this.scene = t, this.scene.getActiveMeshCandidates = this.getActiveMeshCandidates.bind(this), this.scene.getActiveSubMeshCandidates = this.getActiveSubMeshCandidates.bind(this), this.scene.getCollidingSubMeshCandidates = this.getCollidingSubMeshCandidates.bind(this), this.scene.getIntersectingSubMeshCandidates = this.getIntersectingSubMeshCandidates.bind(this);\n          }\n          return r.prototype.register = function() {\n            var t = this;\n            this.scene.onMeshRemovedObservable.add(function(e) {\n              var n = t.scene.selectionOctree;\n              if (n != null) {\n                var i = n.dynamicContent.indexOf(e);\n                i !== -1 && n.dynamicContent.splice(i, 1);\n              }\n            }), this.scene.onMeshImportedObservable.add(function(e) {\n              var n = t.scene.selectionOctree;\n              n != null && n.addMesh(e);\n            });\n          }, r.prototype.getActiveMeshCandidates = function() {\n            return this.scene._selectionOctree ? this.scene._selectionOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultMeshCandidates();\n          }, r.prototype.getActiveSubMeshCandidates = function(t) {\n            return t._submeshesOctree && t.useOctreeForRenderingSelection ? t._submeshesOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultSubMeshCandidates(t);\n          }, r.prototype.getIntersectingSubMeshCandidates = function(t, e) {\n            return t._submeshesOctree && t.useOctreeForPicking ? (dn.a.TransformToRef(e, t.getWorldMatrix(), this._tempRay), t._submeshesOctree.intersectsRay(this._tempRay)) : this.scene._getDefaultSubMeshCandidates(t);\n          }, r.prototype.getCollidingSubMeshCandidates = function(t, e) {\n            if (t._submeshesOctree && t.useOctreeForCollisions) {\n              var n = e._velocityWorldLength + Math.max(e._radius.x, e._radius.y, e._radius.z);\n              return t._submeshesOctree.intersects(e._basePointWorld, n);\n            }\n            return this.scene._getDefaultSubMeshCandidates(t);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r;\n        }(), Ki = f(99);\n        (function(r) {\n          r[r.Generic = 0] = \"Generic\", r[r.Keyboard = 1] = \"Keyboard\", r[r.Mouse = 2] = \"Mouse\", r[r.Touch = 3] = \"Touch\", r[r.DualShock = 4] = \"DualShock\", r[r.Xbox = 5] = \"Xbox\", r[r.Switch = 6] = \"Switch\";\n        })(Xt || (Xt = {})), function(r) {\n          r[r.Horizontal = 0] = \"Horizontal\", r[r.Vertical = 1] = \"Vertical\", r[r.LeftClick = 2] = \"LeftClick\", r[r.MiddleClick = 3] = \"MiddleClick\", r[r.RightClick = 4] = \"RightClick\", r[r.BrowserBack = 5] = \"BrowserBack\", r[r.BrowserForward = 6] = \"BrowserForward\";\n        }(as || (as = {})), function(r) {\n          r[r.Cross = 0] = \"Cross\", r[r.Circle = 1] = \"Circle\", r[r.Square = 2] = \"Square\", r[r.Triangle = 3] = \"Triangle\", r[r.L1 = 4] = \"L1\", r[r.R1 = 5] = \"R1\", r[r.L2 = 6] = \"L2\", r[r.R2 = 7] = \"R2\", r[r.Share = 8] = \"Share\", r[r.Options = 9] = \"Options\", r[r.L3 = 10] = \"L3\", r[r.R3 = 11] = \"R3\", r[r.DPadUp = 12] = \"DPadUp\", r[r.DPadDown = 13] = \"DPadDown\", r[r.DPadLeft = 14] = \"DPadLeft\", r[r.DPadRight = 15] = \"DPadRight\", r[r.Home = 16] = \"Home\", r[r.TouchPad = 17] = \"TouchPad\", r[r.LStickXAxis = 18] = \"LStickXAxis\", r[r.LStickYAxis = 19] = \"LStickYAxis\", r[r.RStickXAxis = 20] = \"RStickXAxis\", r[r.RStickYAxis = 21] = \"RStickYAxis\";\n        }(ss || (ss = {})), function(r) {\n          r[r.A = 0] = \"A\", r[r.B = 1] = \"B\", r[r.X = 2] = \"X\", r[r.Y = 3] = \"Y\", r[r.LB = 4] = \"LB\", r[r.RB = 5] = \"RB\", r[r.LT = 6] = \"LT\", r[r.RT = 7] = \"RT\", r[r.Back = 8] = \"Back\", r[r.Start = 9] = \"Start\", r[r.LS = 10] = \"LS\", r[r.RS = 11] = \"RS\", r[r.DPadUp = 12] = \"DPadUp\", r[r.DPadDown = 13] = \"DPadDown\", r[r.DPadLeft = 14] = \"DPadLeft\", r[r.DPadRight = 15] = \"DPadRight\", r[r.Home = 16] = \"Home\", r[r.LStickXAxis = 17] = \"LStickXAxis\", r[r.LStickYAxis = 18] = \"LStickYAxis\", r[r.RStickXAxis = 19] = \"RStickXAxis\", r[r.RStickYAxis = 20] = \"RStickYAxis\";\n        }(cs || (cs = {})), function(r) {\n          r[r.B = 0] = \"B\", r[r.A = 1] = \"A\", r[r.Y = 2] = \"Y\", r[r.X = 3] = \"X\", r[r.L = 4] = \"L\", r[r.R = 5] = \"R\", r[r.ZL = 6] = \"ZL\", r[r.ZR = 7] = \"ZR\", r[r.Minus = 8] = \"Minus\", r[r.Plus = 9] = \"Plus\", r[r.LS = 10] = \"LS\", r[r.RS = 11] = \"RS\", r[r.DPadUp = 12] = \"DPadUp\", r[r.DPadDown = 13] = \"DPadDown\", r[r.DPadLeft = 14] = \"DPadLeft\", r[r.DPadRight = 15] = \"DPadRight\", r[r.Home = 16] = \"Home\", r[r.Capture = 17] = \"Capture\", r[r.LStickXAxis = 18] = \"LStickXAxis\", r[r.LStickYAxis = 19] = \"LStickYAxis\", r[r.RStickXAxis = 20] = \"RStickXAxis\", r[r.RStickYAxis = 21] = \"RStickYAxis\";\n        }(ls || (ls = {}));\n        var Fl = function() {\n          function r(t) {\n            this.onDeviceDisconnected = function() {\n            }, this._inputs = [], this._keyboardActive = !1, this._pointerActive = !1, this._keyboardDownEvent = function(n) {\n            }, this._keyboardUpEvent = function(n) {\n            }, this._pointerMoveEvent = function(n) {\n            }, this._pointerDownEvent = function(n) {\n            }, this._pointerUpEvent = function(n) {\n            }, this._gamepadConnectedEvent = function(n) {\n            }, this._gamepadDisconnectedEvent = function(n) {\n            }, this._onDeviceConnected = function() {\n            };\n            var e = t.getInputElement();\n            e && (this._elementToAttachTo = e, this._handleKeyActions(), this._handlePointerActions(), this._handleGamepadActions(), this._checkForConnectedDevices());\n          }\n          return Object.defineProperty(r.prototype, \"onDeviceConnected\", { get: function() {\n            return this._onDeviceConnected;\n          }, set: function(t) {\n            this._onDeviceConnected = t;\n            for (var e = 0; e < this._inputs.length; e++)\n              if (this._inputs[e])\n                for (var n = 0; n < this._inputs[e].length; n++)\n                  this._inputs[e][n] && this._onDeviceConnected(e, n);\n          }, enumerable: !1, configurable: !0 }), r.Create = function(t) {\n            return typeof _native < \"u\" && _native.DeviceInputSystem ? new _native.DeviceInputSystem(t) : new r(t);\n          }, r.prototype.pollInput = function(t, e, n) {\n            var i = this._inputs[t][e];\n            if (!i)\n              throw \"Unable to find device \" + Xt[t];\n            if (this._updateDevice(t, e, n), i[n] === void 0)\n              throw \"Unable to find input \" + n + \" for device \" + Xt[t] + \" in slot \" + e;\n            return i[n];\n          }, r.prototype.dispose = function() {\n            this._keyboardActive && (window.removeEventListener(\"keydown\", this._keyboardDownEvent), window.removeEventListener(\"keyup\", this._keyboardUpEvent)), this._pointerActive && (this._elementToAttachTo.removeEventListener(\"pointermove\", this._pointerMoveEvent), this._elementToAttachTo.removeEventListener(\"pointerdown\", this._pointerDownEvent), this._elementToAttachTo.removeEventListener(\"pointerup\", this._pointerUpEvent)), window.removeEventListener(\"gamepadconnected\", this._gamepadConnectedEvent), window.removeEventListener(\"gamepaddisconnected\", this._gamepadDisconnectedEvent);\n          }, r.prototype._checkForConnectedDevices = function() {\n            for (var t = 0, e = navigator.getGamepads(); t < e.length; t++) {\n              var n = e[t];\n              n && this._addGamePad(n);\n            }\n            matchMedia(\"(pointer:fine)\").matches && this._addPointerDevice(Xt.Mouse, 0, 0, 0);\n          }, r.prototype._addGamePad = function(t) {\n            var e = this._getGamepadDeviceType(t.id), n = t.index;\n            this._registerDevice(e, n, t.buttons.length + t.axes.length), this._gamepads = this._gamepads || new Array(t.index + 1), this._gamepads[n] = e;\n          }, r.prototype._addPointerDevice = function(t, e, n, i) {\n            this._pointerActive = !0, this._registerDevice(t, e, r._MAX_POINTER_INPUTS);\n            var o = this._inputs[t][e];\n            o[0] = n, o[1] = i;\n          }, r.prototype._registerDevice = function(t, e, n) {\n            if (this._inputs[t] || (this._inputs[t] = []), !this._inputs[t][e]) {\n              for (var i = new Array(n), o = 0; o < n; o++)\n                i[o] = 0;\n              this._inputs[t][e] = i, this.onDeviceConnected(t, e);\n            }\n          }, r.prototype._unregisterDevice = function(t, e) {\n            this._inputs[t][e] && (delete this._inputs[t][e], this.onDeviceDisconnected(t, e));\n          }, r.prototype._handleKeyActions = function() {\n            var t = this;\n            this._keyboardDownEvent = function(e) {\n              t._keyboardActive || (t._keyboardActive = !0, t._registerDevice(Xt.Keyboard, 0, r._MAX_KEYCODES));\n              var n = t._inputs[Xt.Keyboard][0];\n              n && (t.onInputChanged && t.onInputChanged(Xt.Keyboard, 0, e.keyCode, n[e.keyCode], 1), n[e.keyCode] = 1);\n            }, this._keyboardUpEvent = function(e) {\n              var n = t._inputs[Xt.Keyboard][0];\n              n && (t.onInputChanged && t.onInputChanged(Xt.Keyboard, 0, e.keyCode, n[e.keyCode], 0), n[e.keyCode] = 0);\n            }, window.addEventListener(\"keydown\", this._keyboardDownEvent), window.addEventListener(\"keyup\", this._keyboardUpEvent);\n          }, r.prototype._handlePointerActions = function() {\n            var t = this;\n            this._pointerMoveEvent = function(e) {\n              var n = e.pointerType == \"mouse\" ? Xt.Mouse : Xt.Touch, i = e.pointerType == \"mouse\" ? 0 : e.pointerId;\n              t._inputs[n] || (t._inputs[n] = []), t._inputs[n][i] || t._addPointerDevice(n, i, e.clientX, e.clientY);\n              var o = t._inputs[n][i];\n              o && (t.onInputChanged && (t.onInputChanged(n, i, 0, o[0], e.clientX), t.onInputChanged(n, i, 1, o[1], e.clientY)), o[0] = e.clientX, o[1] = e.clientY);\n            }, this._pointerDownEvent = function(e) {\n              var n = e.pointerType == \"mouse\" ? Xt.Mouse : Xt.Touch, i = e.pointerType == \"mouse\" ? 0 : e.pointerId;\n              t._inputs[n] || (t._inputs[n] = []), t._inputs[n][i] || t._addPointerDevice(n, i, e.clientX, e.clientY);\n              var o = t._inputs[n][i];\n              o && (t.onInputChanged && (t.onInputChanged(n, i, 0, o[0], e.clientX), t.onInputChanged(n, i, 1, o[1], e.clientY), t.onInputChanged(n, i, e.button + 2, o[e.button + 2], 1)), o[0] = e.clientX, o[1] = e.clientY, o[e.button + 2] = 1);\n            }, this._pointerUpEvent = function(e) {\n              var n = e.pointerType == \"mouse\" ? Xt.Mouse : Xt.Touch, i = e.pointerType == \"mouse\" ? 0 : e.pointerId, o = t._inputs[n][i];\n              o && (t.onInputChanged && t.onInputChanged(n, i, e.button + 2, o[e.button + 2], 0), o[0] = e.clientX, o[1] = e.clientY, o[e.button + 2] = 0), e.pointerType != \"mouse\" && t._unregisterDevice(n, i);\n            }, this._elementToAttachTo.addEventListener(\"pointermove\", this._pointerMoveEvent), this._elementToAttachTo.addEventListener(\"pointerdown\", this._pointerDownEvent), this._elementToAttachTo.addEventListener(\"pointerup\", this._pointerUpEvent);\n          }, r.prototype._handleGamepadActions = function() {\n            var t = this;\n            this._gamepadConnectedEvent = function(e) {\n              t._addGamePad(e.gamepad);\n            }, this._gamepadDisconnectedEvent = function(e) {\n              if (t._gamepads) {\n                var n = t._getGamepadDeviceType(e.gamepad.id), i = e.gamepad.index;\n                t._unregisterDevice(n, i), delete t._gamepads[i];\n              }\n            }, window.addEventListener(\"gamepadconnected\", this._gamepadConnectedEvent), window.addEventListener(\"gamepaddisconnected\", this._gamepadDisconnectedEvent);\n          }, r.prototype._updateDevice = function(t, e, n) {\n            var i = navigator.getGamepads()[e];\n            if (i && t == this._gamepads[e]) {\n              var o = this._inputs[t][e];\n              n >= i.buttons.length ? o[n] = i.axes[n - i.buttons.length].valueOf() : o[n] = i.buttons[n].value;\n            }\n          }, r.prototype._getGamepadDeviceType = function(t) {\n            return t.indexOf(\"054c\") !== -1 ? Xt.DualShock : t.indexOf(\"Xbox One\") !== -1 || t.search(\"Xbox 360\") !== -1 || t.search(\"xinput\") !== -1 ? Xt.Xbox : t.indexOf(\"057e\") !== -1 ? Xt.Switch : Xt.Generic;\n          }, r._MAX_KEYCODES = 255, r._MAX_POINTER_INPUTS = 7, r;\n        }(), Bl = function() {\n          function r(t, e, n) {\n            n === void 0 && (n = 0), this.deviceType = e, this.deviceSlot = n, this.onInputChangedObservable = new C.c(), this._deviceInputSystem = t;\n          }\n          return r.prototype.getInput = function(t) {\n            return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, t);\n          }, r;\n        }(), Mf = function() {\n          function r(t) {\n            var e = this;\n            this.onDeviceConnectedObservable = new C.c(function(i) {\n              e.getDevices().forEach(function(o) {\n                e.onDeviceConnectedObservable.notifyObserver(i, o);\n              });\n            }), this.onDeviceDisconnectedObservable = new C.c();\n            var n = Object.keys(Xt).length / 2;\n            this._devices = new Array(n), this._firstDevice = new Array(n), this._deviceInputSystem = Fl.Create(t), this._deviceInputSystem.onDeviceConnected = function(i, o) {\n              e._addDevice(i, o), e.onDeviceConnectedObservable.notifyObservers(e.getDeviceSource(i, o));\n            }, this._deviceInputSystem.onDeviceDisconnected = function(i, o) {\n              var a = e.getDeviceSource(i, o);\n              e._removeDevice(i, o), e.onDeviceDisconnectedObservable.notifyObservers(a);\n            }, this._deviceInputSystem.onInputChanged || (this._deviceInputSystem.onInputChanged = function(i, o, a, s, d) {\n              var p;\n              (p = e.getDeviceSource(i, o)) === null || p === void 0 || p.onInputChangedObservable.notifyObservers({ inputIndex: a, previousState: s, currentState: d });\n            });\n          }\n          return r.prototype.getDeviceSource = function(t, e) {\n            if (e === void 0) {\n              if (this._firstDevice[t] === void 0)\n                return null;\n              e = this._firstDevice[t];\n            }\n            return this._devices[t] && this._devices[t][e] !== void 0 ? this._devices[t][e] : null;\n          }, r.prototype.getDeviceSources = function(t) {\n            return this._devices[t].filter(function(e) {\n              return !!e;\n            });\n          }, r.prototype.getDevices = function() {\n            var t = new Array();\n            return this._devices.forEach(function(e) {\n              t.push.apply(t, e);\n            }), t;\n          }, r.prototype.dispose = function() {\n            this.onDeviceConnectedObservable.clear(), this.onDeviceDisconnectedObservable.clear(), this._deviceInputSystem.dispose();\n          }, r.prototype._addDevice = function(t, e) {\n            this._devices[t] || (this._devices[t] = new Array()), this._devices[t][e] || (this._devices[t][e] = new Bl(this._deviceInputSystem, t, e), this._updateFirstDevices(t));\n          }, r.prototype._removeDevice = function(t, e) {\n            delete this._devices[t][e], this._updateFirstDevices(t);\n          }, r.prototype._updateFirstDevices = function(t) {\n            switch (t) {\n              case Xt.Keyboard:\n              case Xt.Mouse:\n                this._firstDevice[t] = 0;\n                break;\n              case Xt.Touch:\n              case Xt.DualShock:\n              case Xt.Xbox:\n              case Xt.Switch:\n              case Xt.Generic:\n                var e = this._devices[t];\n                delete this._firstDevice[t];\n                for (var n = 0; n < e.length; n++)\n                  if (e[n]) {\n                    this._firstDevice[t] = n;\n                    break;\n                  }\n            }\n          }, r;\n        }(), Ul = f(168), Vl = (f(123), function() {\n          this._timeElapsedQueryEnded = !1;\n        }), kl = function() {\n          this.occlusionInternalRetryCounter = 0, this.isOcclusionQueryInProgress = !1, this.isOccluded = !1, this.occlusionRetryCount = -1, this.occlusionType = Mt.a.OCCLUSION_TYPE_NONE, this.occlusionQueryAlgorithmType = Mt.a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;\n        };\n        Ue.a.prototype.createQuery = function() {\n          return this._gl.createQuery();\n        }, Ue.a.prototype.deleteQuery = function(r) {\n          return this._gl.deleteQuery(r), this;\n        }, Ue.a.prototype.isQueryResultAvailable = function(r) {\n          return this._gl.getQueryParameter(r, this._gl.QUERY_RESULT_AVAILABLE);\n        }, Ue.a.prototype.getQueryResult = function(r) {\n          return this._gl.getQueryParameter(r, this._gl.QUERY_RESULT);\n        }, Ue.a.prototype.beginOcclusionQuery = function(r, t) {\n          var e = this._getGlAlgorithmType(r);\n          return this._gl.beginQuery(e, t), this;\n        }, Ue.a.prototype.endOcclusionQuery = function(r) {\n          var t = this._getGlAlgorithmType(r);\n          return this._gl.endQuery(t), this;\n        }, Ue.a.prototype._createTimeQuery = function() {\n          var r = this.getCaps().timerQuery;\n          return r.createQueryEXT ? r.createQueryEXT() : this.createQuery();\n        }, Ue.a.prototype._deleteTimeQuery = function(r) {\n          var t = this.getCaps().timerQuery;\n          t.deleteQueryEXT ? t.deleteQueryEXT(r) : this.deleteQuery(r);\n        }, Ue.a.prototype._getTimeQueryResult = function(r) {\n          var t = this.getCaps().timerQuery;\n          return t.getQueryObjectEXT ? t.getQueryObjectEXT(r, t.QUERY_RESULT_EXT) : this.getQueryResult(r);\n        }, Ue.a.prototype._getTimeQueryAvailability = function(r) {\n          var t = this.getCaps().timerQuery;\n          return t.getQueryObjectEXT ? t.getQueryObjectEXT(r, t.QUERY_RESULT_AVAILABLE_EXT) : this.isQueryResultAvailable(r);\n        }, Ue.a.prototype.startTimeQuery = function() {\n          var r = this.getCaps(), t = r.timerQuery;\n          if (!t)\n            return null;\n          var e = new Vl();\n          if (this._gl.getParameter(t.GPU_DISJOINT_EXT), r.canUseTimestampForTimerQuery)\n            e._startTimeQuery = this._createTimeQuery(), t.queryCounterEXT(e._startTimeQuery, t.TIMESTAMP_EXT);\n          else {\n            if (this._currentNonTimestampToken)\n              return this._currentNonTimestampToken;\n            e._timeElapsedQuery = this._createTimeQuery(), t.beginQueryEXT ? t.beginQueryEXT(t.TIME_ELAPSED_EXT, e._timeElapsedQuery) : this._gl.beginQuery(t.TIME_ELAPSED_EXT, e._timeElapsedQuery), this._currentNonTimestampToken = e;\n          }\n          return e;\n        }, Ue.a.prototype.endTimeQuery = function(r) {\n          var t = this.getCaps(), e = t.timerQuery;\n          if (!e || !r)\n            return -1;\n          if (t.canUseTimestampForTimerQuery) {\n            if (!r._startTimeQuery)\n              return -1;\n            r._endTimeQuery || (r._endTimeQuery = this._createTimeQuery(), e.queryCounterEXT(r._endTimeQuery, e.TIMESTAMP_EXT));\n          } else if (!r._timeElapsedQueryEnded) {\n            if (!r._timeElapsedQuery)\n              return -1;\n            e.endQueryEXT ? e.endQueryEXT(e.TIME_ELAPSED_EXT) : this._gl.endQuery(e.TIME_ELAPSED_EXT), r._timeElapsedQueryEnded = !0;\n          }\n          var n = this._gl.getParameter(e.GPU_DISJOINT_EXT), i = !1;\n          if (r._endTimeQuery ? i = this._getTimeQueryAvailability(r._endTimeQuery) : r._timeElapsedQuery && (i = this._getTimeQueryAvailability(r._timeElapsedQuery)), i && !n) {\n            var o = 0;\n            if (t.canUseTimestampForTimerQuery) {\n              if (!r._startTimeQuery || !r._endTimeQuery)\n                return -1;\n              var a = this._getTimeQueryResult(r._startTimeQuery);\n              o = this._getTimeQueryResult(r._endTimeQuery) - a, this._deleteTimeQuery(r._startTimeQuery), this._deleteTimeQuery(r._endTimeQuery), r._startTimeQuery = null, r._endTimeQuery = null;\n            } else {\n              if (!r._timeElapsedQuery)\n                return -1;\n              o = this._getTimeQueryResult(r._timeElapsedQuery), this._deleteTimeQuery(r._timeElapsedQuery), r._timeElapsedQuery = null, r._timeElapsedQueryEnded = !1, this._currentNonTimestampToken = null;\n            }\n            return o;\n          }\n          return -1;\n        }, Ue.a.prototype._getGlAlgorithmType = function(r) {\n          return r === Mt.a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;\n        }, Object.defineProperty(Mt.a.prototype, \"isOcclusionQueryInProgress\", { get: function() {\n          return this._occlusionDataStorage.isOcclusionQueryInProgress;\n        }, set: function(r) {\n          this._occlusionDataStorage.isOcclusionQueryInProgress = r;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"_occlusionDataStorage\", { get: function() {\n          return this.__occlusionDataStorage || (this.__occlusionDataStorage = new kl()), this.__occlusionDataStorage;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"isOccluded\", { get: function() {\n          return this._occlusionDataStorage.isOccluded;\n        }, set: function(r) {\n          this._occlusionDataStorage.isOccluded = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"occlusionQueryAlgorithmType\", { get: function() {\n          return this._occlusionDataStorage.occlusionQueryAlgorithmType;\n        }, set: function(r) {\n          this._occlusionDataStorage.occlusionQueryAlgorithmType = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"occlusionType\", { get: function() {\n          return this._occlusionDataStorage.occlusionType;\n        }, set: function(r) {\n          this._occlusionDataStorage.occlusionType = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"occlusionRetryCount\", { get: function() {\n          return this._occlusionDataStorage.occlusionRetryCount;\n        }, set: function(r) {\n          this._occlusionDataStorage.occlusionRetryCount = r;\n        }, enumerable: !0, configurable: !0 }), Mt.a.prototype._checkOcclusionQuery = function() {\n          var r = this._occlusionDataStorage;\n          if (r.occlusionType === Mt.a.OCCLUSION_TYPE_NONE)\n            return r.isOccluded = !1, !1;\n          var t = this.getEngine();\n          if (t.webGLVersion < 2 || !t.isQueryResultAvailable)\n            return r.isOccluded = !1, !1;\n          if (this.isOcclusionQueryInProgress && this._occlusionQuery)\n            if (t.isQueryResultAvailable(this._occlusionQuery)) {\n              var e = t.getQueryResult(this._occlusionQuery);\n              r.isOcclusionQueryInProgress = !1, r.occlusionInternalRetryCounter = 0, r.isOccluded = e !== 1;\n            } else {\n              if (r.occlusionInternalRetryCounter++, !(r.occlusionRetryCount !== -1 && r.occlusionInternalRetryCounter > r.occlusionRetryCount))\n                return !1;\n              r.isOcclusionQueryInProgress = !1, r.occlusionInternalRetryCounter = 0, r.isOccluded = r.occlusionType !== Mt.a.OCCLUSION_TYPE_OPTIMISTIC && r.isOccluded;\n            }\n          var n = this.getScene();\n          if (n.getBoundingBoxRenderer) {\n            var i = n.getBoundingBoxRenderer();\n            this._occlusionQuery || (this._occlusionQuery = t.createQuery()), t.beginOcclusionQuery(r.occlusionQueryAlgorithmType, this._occlusionQuery), i.renderOcclusionBoundingBox(this), t.endOcclusionQuery(r.occlusionQueryAlgorithmType), this._occlusionDataStorage.isOcclusionQueryInProgress = !0;\n          }\n          return r.isOccluded;\n        };\n        var If = !0;\n        Ue.a.prototype.createTransformFeedback = function() {\n          return this._gl.createTransformFeedback();\n        }, Ue.a.prototype.deleteTransformFeedback = function(r) {\n          this._gl.deleteTransformFeedback(r);\n        }, Ue.a.prototype.bindTransformFeedback = function(r) {\n          this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, r);\n        }, Ue.a.prototype.beginTransformFeedback = function(r) {\n          r === void 0 && (r = !0), this._gl.beginTransformFeedback(r ? this._gl.POINTS : this._gl.TRIANGLES);\n        }, Ue.a.prototype.endTransformFeedback = function() {\n          this._gl.endTransformFeedback();\n        }, Ue.a.prototype.setTranformFeedbackVaryings = function(r, t) {\n          this._gl.transformFeedbackVaryings(r, t, this._gl.INTERLEAVED_ATTRIBS);\n        }, Ue.a.prototype.bindTransformFeedbackBuffer = function(r) {\n          this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, r ? r.underlyingResource : null);\n        }, f(126), wt.a.prototype.updateVideoTexture = function(r, t, e) {\n          if (r && !r._isDisabled) {\n            var n = this._bindTextureDirectly(this._gl.TEXTURE_2D, r, !0);\n            this._unpackFlipY(!e);\n            try {\n              if (this._videoTextureSupported === void 0 && (this._gl.getError(), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t), this._gl.getError() !== 0 ? this._videoTextureSupported = !1 : this._videoTextureSupported = !0), this._videoTextureSupported)\n                this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t);\n              else {\n                if (!r._workingCanvas) {\n                  r._workingCanvas = ns.a.CreateCanvas(r.width, r.height);\n                  var i = r._workingCanvas.getContext(\"2d\");\n                  if (!i)\n                    throw new Error(\"Unable to get 2d context\");\n                  r._workingContext = i, r._workingCanvas.width = r.width, r._workingCanvas.height = r.height;\n                }\n                r._workingContext.clearRect(0, 0, r.width, r.height), r._workingContext.drawImage(t, 0, 0, t.videoWidth, t.videoHeight, 0, 0, r.width, r.height), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, r._workingCanvas);\n              }\n              r.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), n || this._bindTextureDirectly(this._gl.TEXTURE_2D, null), r.isReady = !0;\n            } catch {\n              r._isDisabled = !0;\n            }\n          }\n        }, wt.a.prototype.restoreSingleAttachment = function() {\n          var r = this._gl;\n          this.bindAttachments([r.BACK]);\n        }, wt.a.prototype.buildTextureLayout = function(r) {\n          for (var t = this._gl, e = [], n = 0; n < r.length; n++)\n            r[n] ? e.push(t[\"COLOR_ATTACHMENT\" + n]) : e.push(t.NONE);\n          return e;\n        }, wt.a.prototype.bindAttachments = function(r) {\n          this._gl.drawBuffers(r);\n        }, wt.a.prototype.unBindMultiColorAttachmentFramebuffer = function(r, t, e) {\n          t === void 0 && (t = !1), this._currentRenderTarget = null;\n          var n = this._gl, i = r[0]._attachments, o = i.length;\n          if (r[0]._MSAAFramebuffer) {\n            n.bindFramebuffer(n.READ_FRAMEBUFFER, r[0]._MSAAFramebuffer), n.bindFramebuffer(n.DRAW_FRAMEBUFFER, r[0]._framebuffer);\n            for (var a = 0; a < o; a++) {\n              for (var s = r[a], d = 0; d < o; d++)\n                i[d] = n.NONE;\n              i[a] = n[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + a : \"COLOR_ATTACHMENT\" + a + \"_WEBGL\"], n.readBuffer(i[a]), n.drawBuffers(i), n.blitFramebuffer(0, 0, s.width, s.height, 0, 0, s.width, s.height, n.COLOR_BUFFER_BIT, n.NEAREST);\n            }\n            for (a = 0; a < o; a++)\n              i[a] = n[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + a : \"COLOR_ATTACHMENT\" + a + \"_WEBGL\"];\n            n.drawBuffers(i);\n          }\n          for (a = 0; a < o; a++)\n            !(s = r[a]).generateMipMaps || t || s.isCube || (this._bindTextureDirectly(n.TEXTURE_2D, s, !0), n.generateMipmap(n.TEXTURE_2D), this._bindTextureDirectly(n.TEXTURE_2D, null));\n          e && (r[0]._MSAAFramebuffer && this._bindUnboundFramebuffer(r[0]._framebuffer), e()), this._bindUnboundFramebuffer(null);\n        }, wt.a.prototype.createMultipleRenderTarget = function(r, t) {\n          var e = !1, n = !0, i = !1, o = !1, a = 1, s = h.a.TEXTURETYPE_UNSIGNED_INT, d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, p = new Array(), y = new Array();\n          t !== void 0 && (e = t.generateMipMaps !== void 0 && t.generateMipMaps, n = t.generateDepthBuffer === void 0 || t.generateDepthBuffer, i = t.generateStencilBuffer !== void 0 && t.generateStencilBuffer, o = t.generateDepthTexture !== void 0 && t.generateDepthTexture, a = t.textureCount || 1, t.types && (p = t.types), t.samplingModes && (y = t.samplingModes));\n          var P = this._gl, R = P.createFramebuffer();\n          this._bindUnboundFramebuffer(R);\n          for (var B = r.width || r, F = r.height || r, z = [], J = [], ie = this._setupFramebufferDepthAttachments(i, n, B, F), se = 0; se < a; se++) {\n            var ce = y[se] || d, ue = p[se] || s;\n            (ue !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (ue !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (ce = h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            var fe = this._getSamplingParameters(ce, e);\n            ue !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (ue = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\"));\n            var ve = new Pt.a(this, Pt.b.MultiRenderTarget), Te = P[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + se : \"COLOR_ATTACHMENT\" + se + \"_WEBGL\"];\n            z.push(ve), J.push(Te), P.activeTexture(P[\"TEXTURE\" + se]), P.bindTexture(P.TEXTURE_2D, ve._webGLTexture), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MAG_FILTER, fe.mag), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MIN_FILTER, fe.min), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_S, P.CLAMP_TO_EDGE), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_T, P.CLAMP_TO_EDGE), P.texImage2D(P.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(ue), B, F, 0, P.RGBA, this._getWebGLTextureType(ue), null), P.framebufferTexture2D(P.DRAW_FRAMEBUFFER, Te, P.TEXTURE_2D, ve._webGLTexture, 0), e && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(P.TEXTURE_2D, null), ve._framebuffer = R, ve._depthStencilBuffer = ie, ve.baseWidth = B, ve.baseHeight = F, ve.width = B, ve.height = F, ve.isReady = !0, ve.samples = 1, ve.generateMipMaps = e, ve.samplingMode = ce, ve.type = ue, ve._generateDepthBuffer = n, ve._generateStencilBuffer = i, ve._attachments = J, ve._textureArray = z, this._internalTexturesCache.push(ve);\n          }\n          if (o && this._caps.depthTextureExtension) {\n            var Re = new Pt.a(this, Pt.b.MultiRenderTarget);\n            P.activeTexture(P.TEXTURE0), P.bindTexture(P.TEXTURE_2D, Re._webGLTexture), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MAG_FILTER, P.NEAREST), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MIN_FILTER, P.NEAREST), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_S, P.CLAMP_TO_EDGE), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_T, P.CLAMP_TO_EDGE), P.texImage2D(P.TEXTURE_2D, 0, this.webGLVersion < 2 ? P.DEPTH_COMPONENT : P.DEPTH_COMPONENT16, B, F, 0, P.DEPTH_COMPONENT, P.UNSIGNED_SHORT, null), P.framebufferTexture2D(P.FRAMEBUFFER, P.DEPTH_ATTACHMENT, P.TEXTURE_2D, Re._webGLTexture, 0), Re._framebuffer = R, Re.baseWidth = B, Re.baseHeight = F, Re.width = B, Re.height = F, Re.isReady = !0, Re.samples = 1, Re.generateMipMaps = e, Re.samplingMode = P.NEAREST, Re._generateDepthBuffer = n, Re._generateStencilBuffer = i, z.push(Re), this._internalTexturesCache.push(Re);\n          }\n          return P.drawBuffers(J), this._bindUnboundFramebuffer(null), this.resetTextureCache(), z;\n        }, wt.a.prototype.updateMultipleRenderTargetTextureSampleCount = function(r, t) {\n          if (this.webGLVersion < 2 || !r)\n            return 1;\n          if (r[0].samples === t)\n            return t;\n          var e = r[0]._attachments.length;\n          if (e === 0)\n            return 1;\n          var n = this._gl;\n          t = Math.min(t, this.getCaps().maxMSAASamples), r[0]._depthStencilBuffer && (n.deleteRenderbuffer(r[0]._depthStencilBuffer), r[0]._depthStencilBuffer = null), r[0]._MSAAFramebuffer && (n.deleteFramebuffer(r[0]._MSAAFramebuffer), r[0]._MSAAFramebuffer = null);\n          for (var i = 0; i < e; i++)\n            r[i]._MSAARenderBuffer && (n.deleteRenderbuffer(r[i]._MSAARenderBuffer), r[i]._MSAARenderBuffer = null);\n          if (t > 1 && n.renderbufferStorageMultisample) {\n            var o = n.createFramebuffer();\n            if (!o)\n              throw new Error(\"Unable to create multi sampled framebuffer\");\n            this._bindUnboundFramebuffer(o);\n            var a = this._setupFramebufferDepthAttachments(r[0]._generateStencilBuffer, r[0]._generateDepthBuffer, r[0].width, r[0].height, t), s = [];\n            for (i = 0; i < e; i++) {\n              var d = r[i], p = n[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + i : \"COLOR_ATTACHMENT\" + i + \"_WEBGL\"], y = n.createRenderbuffer();\n              if (!y)\n                throw new Error(\"Unable to create multi sampled framebuffer\");\n              n.bindRenderbuffer(n.RENDERBUFFER, y), n.renderbufferStorageMultisample(n.RENDERBUFFER, t, this._getRGBAMultiSampleBufferFormat(d.type), d.width, d.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, p, n.RENDERBUFFER, y), d._MSAAFramebuffer = o, d._MSAARenderBuffer = y, d.samples = t, d._depthStencilBuffer = a, n.bindRenderbuffer(n.RENDERBUFFER, null), s.push(p);\n            }\n            n.drawBuffers(s);\n          } else\n            this._bindUnboundFramebuffer(r[0]._framebuffer);\n          return this._bindUnboundFramebuffer(null), t;\n        };\n        var Xr = f(56);\n        wt.a.prototype._createDepthStencilCubeTexture = function(r, t) {\n          var e = new Pt.a(this, Pt.b.Unknown);\n          if (e.isCube = !0, this.webGLVersion === 1)\n            return l.a.Error(\"Depth cube texture is not supported by WebGL 1.\"), e;\n          var n = Object(c.a)({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1 }, t), i = this._gl;\n          this._bindTextureDirectly(i.TEXTURE_CUBE_MAP, e, !0), this._setupDepthStencilTexture(e, r, n.generateStencil, n.bilinearFiltering, n.comparisonFunction);\n          for (var o = 0; o < 6; o++)\n            n.generateStencil ? i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + o, 0, i.DEPTH24_STENCIL8, r, r, 0, i.DEPTH_STENCIL, i.UNSIGNED_INT_24_8, null) : i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + o, 0, i.DEPTH_COMPONENT24, r, r, 0, i.DEPTH_COMPONENT, i.UNSIGNED_INT, null);\n          return this._bindTextureDirectly(i.TEXTURE_CUBE_MAP, null), e;\n        }, wt.a.prototype._partialLoadFile = function(r, t, e, n, i) {\n          i === void 0 && (i = null), this._loadFile(r, function(o) {\n            e[t] = o, e._internalCount++, e._internalCount === 6 && n(e);\n          }, void 0, void 0, !0, function(o, a) {\n            i && o && i(o.status + \" \" + o.statusText, a);\n          });\n        }, wt.a.prototype._cascadeLoadFiles = function(r, t, e, n) {\n          n === void 0 && (n = null);\n          var i = [];\n          i._internalCount = 0;\n          for (var o = 0; o < 6; o++)\n            this._partialLoadFile(e[o], o, i, t, n);\n        }, wt.a.prototype._cascadeLoadImgs = function(r, t, e, n, i) {\n          n === void 0 && (n = null);\n          var o = [];\n          o._internalCount = 0;\n          for (var a = 0; a < 6; a++)\n            this._partialLoadImg(e[a], a, o, r, t, n, i);\n        }, wt.a.prototype._partialLoadImg = function(r, t, e, n, i, o, a) {\n          var s;\n          o === void 0 && (o = null), s = Xr.a.LoadImage(r, function() {\n            s && (e[t] = s, e._internalCount++, n && n._removePendingData(s)), e._internalCount === 6 && i(e);\n          }, function(d, p) {\n            n && n._removePendingData(s), o && o(d, p);\n          }, n ? n.offlineProvider : null, a), n && s && n._addPendingData(s);\n        }, wt.a.prototype._setCubeMapTextureParams = function(r, t) {\n          var e = this._gl;\n          e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_MIN_FILTER, t ? e.LINEAR_MIPMAP_LINEAR : e.LINEAR), e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), r.samplingMode = t ? h.a.TEXTURE_TRILINEAR_SAMPLINGMODE : h.a.TEXTURE_LINEAR_LINEAR, this._bindTextureDirectly(e.TEXTURE_CUBE_MAP, null);\n        }, wt.a.prototype.createCubeTexture = function(r, t, e, n, i, o, a, s, d, p, y, P, R) {\n          var B = this;\n          i === void 0 && (i = null), o === void 0 && (o = null), s === void 0 && (s = null), d === void 0 && (d = !1), p === void 0 && (p = 0), y === void 0 && (y = 0), P === void 0 && (P = null);\n          var F = this._gl, z = P || new Pt.a(this, Pt.b.Cube);\n          z.isCube = !0, z.url = r, z.generateMipMaps = !n, z._lodGenerationScale = p, z._lodGenerationOffset = y, this._doNotHandleContextLost || (z._extension = s, z._files = e);\n          var J = r;\n          this._transformTextureUrl && !P && (r = this._transformTextureUrl(r));\n          for (var ie = r.lastIndexOf(\".\"), se = s || (ie > -1 ? r.substring(ie).toLowerCase() : \"\"), ce = null, ue = 0, fe = wt.a._TextureLoaders; ue < fe.length; ue++) {\n            var ve = fe[ue];\n            if (ve.canLoad(se)) {\n              ce = ve;\n              break;\n            }\n          }\n          if (ce) {\n            var Te = function(Re) {\n              B._bindTextureDirectly(F.TEXTURE_CUBE_MAP, z, !0), ce.loadCubeData(Re, z, d, i, o);\n            };\n            e && e.length === 6 ? ce.supportCascades ? this._cascadeLoadFiles(t, function(Re) {\n              return Te(Re.map(function(Ae) {\n                return new Uint8Array(Ae);\n              }));\n            }, e, o) : o ? o(\"Textures type does not support cascades.\") : l.a.Warn(\"Texture loader does not support cascades.\") : this._loadFile(r, function(Re) {\n              return Te(new Uint8Array(Re));\n            }, void 0, void 0, !0, function(Re, Ae) {\n              r === J ? o && Re && o(Re.status + \" \" + Re.statusText, Ae) : (l.a.Warn(\"Failed to load \" + r + \", falling back to the \" + J), B.createCubeTexture(J, t, e, n, i, o, a, s, d, p, y, z, R));\n            });\n          } else {\n            if (!e)\n              throw new Error(\"Cannot load cubemap because files were not defined\");\n            this._cascadeLoadImgs(t, function(Re) {\n              var Ae = B.needPOTTextures ? wt.a.GetExponentOfTwo(Re[0].width, B._caps.maxCubemapTextureSize) : Re[0].width, Ee = Ae, Se = [F.TEXTURE_CUBE_MAP_POSITIVE_X, F.TEXTURE_CUBE_MAP_POSITIVE_Y, F.TEXTURE_CUBE_MAP_POSITIVE_Z, F.TEXTURE_CUBE_MAP_NEGATIVE_X, F.TEXTURE_CUBE_MAP_NEGATIVE_Y, F.TEXTURE_CUBE_MAP_NEGATIVE_Z];\n              B._bindTextureDirectly(F.TEXTURE_CUBE_MAP, z, !0), B._unpackFlipY(!1);\n              for (var De = a ? B._getInternalFormat(a) : B._gl.RGBA, xe = 0; xe < Se.length; xe++)\n                if (Re[xe].width !== Ae || Re[xe].height !== Ee) {\n                  if (B._prepareWorkingCanvas(), !B._workingCanvas || !B._workingContext)\n                    return void l.a.Warn(\"Cannot create canvas to resize texture.\");\n                  B._workingCanvas.width = Ae, B._workingCanvas.height = Ee, B._workingContext.drawImage(Re[xe], 0, 0, Re[xe].width, Re[xe].height, 0, 0, Ae, Ee), F.texImage2D(Se[xe], 0, De, De, F.UNSIGNED_BYTE, B._workingCanvas);\n                } else\n                  F.texImage2D(Se[xe], 0, De, De, F.UNSIGNED_BYTE, Re[xe]);\n              n || F.generateMipmap(F.TEXTURE_CUBE_MAP), B._setCubeMapTextureParams(z, !n), z.width = Ae, z.height = Ee, z.isReady = !0, a && (z.format = a), z.onLoadedObservable.notifyObservers(z), z.onLoadedObservable.clear(), i && i();\n            }, e, o);\n          }\n          return this._internalTexturesCache.push(z), z;\n        }, f(153), f(124);\n        var Df = function() {\n        };\n        Ue.a.prototype.getInputElement = function() {\n          return this.inputElement || this.getRenderingCanvas();\n        }, Ue.a.prototype.registerView = function(r, t) {\n          var e = this;\n          this.views || (this.views = []);\n          for (var n = 0, i = this.views; n < i.length; n++) {\n            var o = i[n];\n            if (o.target === r)\n              return o;\n          }\n          var a = this.getRenderingCanvas();\n          a && (r.width = a.width, r.height = a.height);\n          var s = { target: r, camera: t };\n          return this.views.push(s), t && t.onDisposeObservable.add(function() {\n            e.unRegisterView(r);\n          }), s;\n        }, Ue.a.prototype.unRegisterView = function(r) {\n          if (!this.views)\n            return this;\n          for (var t = 0, e = this.views; t < e.length; t++) {\n            var n = e[t];\n            if (n.target === r) {\n              var i = this.views.indexOf(n);\n              i !== -1 && this.views.splice(i, 1);\n              break;\n            }\n          }\n          return this;\n        }, Ue.a.prototype._renderViews = function() {\n          if (!this.views)\n            return !1;\n          var r = this.getRenderingCanvas();\n          if (!r)\n            return !1;\n          for (var t = 0, e = this.views; t < e.length; t++) {\n            var n = e[t], i = n.target, o = i.getContext(\"2d\");\n            if (o) {\n              var a = n.camera, s = null, d = null;\n              if (a) {\n                if ((d = a.getScene()).activeCameras && d.activeCameras.length)\n                  continue;\n                this.activeView = n, s = d.activeCamera, d.activeCamera = a;\n              }\n              var p = i.width !== i.clientWidth || i.height !== i.clientHeight;\n              if (i.clientWidth && i.clientHeight && p && (i.width = i.clientWidth, i.height = i.clientHeight, r.width = i.clientWidth, r.height = i.clientHeight, this.resize()), !r.width || !r.height)\n                return !1;\n              this._renderFrame(), o.drawImage(r, 0, 0), s && d && (d.activeCamera = s);\n            }\n          }\n          return this.activeView = null, !0;\n        }, f(129);\n        function Lf(r) {\n          if (this._excludedCompressedTextures && this._excludedCompressedTextures.some(function(i) {\n            var o = \"\\\\b\" + i + \"\\\\b\";\n            return r && (r === i || r.match(new RegExp(o, \"g\")));\n          }))\n            return r;\n          var t = r.lastIndexOf(\".\"), e = r.lastIndexOf(\"?\"), n = e > -1 ? r.substring(e, r.length) : \"\";\n          return (t > -1 ? r.substring(0, t) : r) + this._textureFormatInUse + n;\n        }\n        Object.defineProperty(Ue.a.prototype, \"texturesSupported\", { get: function() {\n          var r = new Array();\n          return this._caps.astc && r.push(\"-astc.ktx\"), this._caps.s3tc && r.push(\"-dxt.ktx\"), this._caps.pvrtc && r.push(\"-pvrtc.ktx\"), this._caps.etc2 && r.push(\"-etc2.ktx\"), this._caps.etc1 && r.push(\"-etc1.ktx\"), r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Ue.a.prototype, \"textureFormatInUse\", { get: function() {\n          return this._textureFormatInUse || null;\n        }, enumerable: !0, configurable: !0 }), Ue.a.prototype.setCompressedTextureExclusions = function(r) {\n          this._excludedCompressedTextures = r;\n        }, Ue.a.prototype.setTextureFormatToUse = function(r) {\n          for (var t = this.texturesSupported, e = 0, n = t.length; e < n; e++)\n            for (var i = 0, o = r.length; i < o; i++)\n              if (t[e] === r[i].toLowerCase())\n                return this._transformTextureUrl = Lf.bind(this), this._textureFormatInUse = t[e];\n          return this._textureFormatInUse = \"\", this._transformTextureUrl = null, null;\n        };\n        var Nf = f(144), Gl = f(118), zl = f(89), li = [Math.sqrt(1 / (4 * Math.PI)), -Math.sqrt(3 / (4 * Math.PI)), Math.sqrt(3 / (4 * Math.PI)), -Math.sqrt(3 / (4 * Math.PI)), Math.sqrt(15 / (4 * Math.PI)), -Math.sqrt(15 / (4 * Math.PI)), Math.sqrt(5 / (16 * Math.PI)), -Math.sqrt(15 / (4 * Math.PI)), Math.sqrt(15 / (16 * Math.PI))], wf = [function(r) {\n          return 1;\n        }, function(r) {\n          return r.y;\n        }, function(r) {\n          return r.z;\n        }, function(r) {\n          return r.x;\n        }, function(r) {\n          return r.x * r.y;\n        }, function(r) {\n          return r.y * r.z;\n        }, function(r) {\n          return 3 * r.z * r.z - 1;\n        }, function(r) {\n          return r.x * r.z;\n        }, function(r) {\n          return r.x * r.x - r.y * r.y;\n        }], _i = function(r, t) {\n          return li[r] * wf[r](t);\n        }, mi = [Math.PI, 2 * Math.PI / 3, 2 * Math.PI / 3, 2 * Math.PI / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4], hs = function() {\n          function r() {\n            this.preScaled = !1, this.l00 = u.e.Zero(), this.l1_1 = u.e.Zero(), this.l10 = u.e.Zero(), this.l11 = u.e.Zero(), this.l2_2 = u.e.Zero(), this.l2_1 = u.e.Zero(), this.l20 = u.e.Zero(), this.l21 = u.e.Zero(), this.l22 = u.e.Zero();\n          }\n          return r.prototype.addLight = function(t, e, n) {\n            var i = new u.e(e.r, e.g, e.b).scale(n);\n            this.l00 = this.l00.add(i.scale(_i(0, t))), this.l1_1 = this.l1_1.add(i.scale(_i(1, t))), this.l10 = this.l10.add(i.scale(_i(2, t))), this.l11 = this.l11.add(i.scale(_i(3, t))), this.l2_2 = this.l2_2.add(i.scale(_i(4, t))), this.l2_1 = this.l2_1.add(i.scale(_i(5, t))), this.l20 = this.l20.add(i.scale(_i(6, t))), this.l21 = this.l21.add(i.scale(_i(7, t))), this.l22 = this.l22.add(i.scale(_i(8, t)));\n          }, r.prototype.scaleInPlace = function(t) {\n            this.l00.scaleInPlace(t), this.l1_1.scaleInPlace(t), this.l10.scaleInPlace(t), this.l11.scaleInPlace(t), this.l2_2.scaleInPlace(t), this.l2_1.scaleInPlace(t), this.l20.scaleInPlace(t), this.l21.scaleInPlace(t), this.l22.scaleInPlace(t);\n          }, r.prototype.convertIncidentRadianceToIrradiance = function() {\n            this.l00.scaleInPlace(mi[0]), this.l1_1.scaleInPlace(mi[1]), this.l10.scaleInPlace(mi[2]), this.l11.scaleInPlace(mi[3]), this.l2_2.scaleInPlace(mi[4]), this.l2_1.scaleInPlace(mi[5]), this.l20.scaleInPlace(mi[6]), this.l21.scaleInPlace(mi[7]), this.l22.scaleInPlace(mi[8]);\n          }, r.prototype.convertIrradianceToLambertianRadiance = function() {\n            this.scaleInPlace(1 / Math.PI);\n          }, r.prototype.preScaleForRendering = function() {\n            this.preScaled = !0, this.l00.scaleInPlace(li[0]), this.l1_1.scaleInPlace(li[1]), this.l10.scaleInPlace(li[2]), this.l11.scaleInPlace(li[3]), this.l2_2.scaleInPlace(li[4]), this.l2_1.scaleInPlace(li[5]), this.l20.scaleInPlace(li[6]), this.l21.scaleInPlace(li[7]), this.l22.scaleInPlace(li[8]);\n          }, r.FromArray = function(t) {\n            var e = new r();\n            return u.e.FromArrayToRef(t[0], 0, e.l00), u.e.FromArrayToRef(t[1], 0, e.l1_1), u.e.FromArrayToRef(t[2], 0, e.l10), u.e.FromArrayToRef(t[3], 0, e.l11), u.e.FromArrayToRef(t[4], 0, e.l2_2), u.e.FromArrayToRef(t[5], 0, e.l2_1), u.e.FromArrayToRef(t[6], 0, e.l20), u.e.FromArrayToRef(t[7], 0, e.l21), u.e.FromArrayToRef(t[8], 0, e.l22), e;\n          }, r.FromPolynomial = function(t) {\n            var e = new r();\n            return e.l00 = t.xx.scale(0.376127).add(t.yy.scale(0.376127)).add(t.zz.scale(0.376126)), e.l1_1 = t.y.scale(0.977204), e.l10 = t.z.scale(0.977204), e.l11 = t.x.scale(0.977204), e.l2_2 = t.xy.scale(1.16538), e.l2_1 = t.yz.scale(1.16538), e.l20 = t.zz.scale(1.34567).subtract(t.xx.scale(0.672834)).subtract(t.yy.scale(0.672834)), e.l21 = t.zx.scale(1.16538), e.l22 = t.xx.scale(1.16538).subtract(t.yy.scale(1.16538)), e.l1_1.scaleInPlace(-1), e.l11.scaleInPlace(-1), e.l2_1.scaleInPlace(-1), e.l21.scaleInPlace(-1), e.scaleInPlace(Math.PI), e;\n          }, r;\n        }(), Yr = function() {\n          function r() {\n            this.x = u.e.Zero(), this.y = u.e.Zero(), this.z = u.e.Zero(), this.xx = u.e.Zero(), this.yy = u.e.Zero(), this.zz = u.e.Zero(), this.xy = u.e.Zero(), this.yz = u.e.Zero(), this.zx = u.e.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"preScaledHarmonics\", { get: function() {\n            return this._harmonics || (this._harmonics = hs.FromPolynomial(this)), this._harmonics.preScaled || this._harmonics.preScaleForRendering(), this._harmonics;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addAmbient = function(t) {\n            var e = new u.e(t.r, t.g, t.b);\n            this.xx = this.xx.add(e), this.yy = this.yy.add(e), this.zz = this.zz.add(e);\n          }, r.prototype.scaleInPlace = function(t) {\n            this.x.scaleInPlace(t), this.y.scaleInPlace(t), this.z.scaleInPlace(t), this.xx.scaleInPlace(t), this.yy.scaleInPlace(t), this.zz.scaleInPlace(t), this.yz.scaleInPlace(t), this.zx.scaleInPlace(t), this.xy.scaleInPlace(t);\n          }, r.FromHarmonics = function(t) {\n            var e = new r();\n            return e._harmonics = t, e.x = t.l11.scale(1.02333).scale(-1), e.y = t.l1_1.scale(1.02333).scale(-1), e.z = t.l10.scale(1.02333), e.xx = t.l00.scale(0.886277).subtract(t.l20.scale(0.247708)).add(t.l22.scale(0.429043)), e.yy = t.l00.scale(0.886277).subtract(t.l20.scale(0.247708)).subtract(t.l22.scale(0.429043)), e.zz = t.l00.scale(0.886277).add(t.l20.scale(0.495417)), e.yz = t.l2_1.scale(0.858086).scale(-1), e.zx = t.l21.scale(0.858086).scale(-1), e.xy = t.l2_2.scale(0.858086), e.scaleInPlace(1 / Math.PI), e;\n          }, r.FromArray = function(t) {\n            var e = new r();\n            return u.e.FromArrayToRef(t[0], 0, e.x), u.e.FromArrayToRef(t[1], 0, e.y), u.e.FromArrayToRef(t[2], 0, e.z), u.e.FromArrayToRef(t[3], 0, e.xx), u.e.FromArrayToRef(t[4], 0, e.yy), u.e.FromArrayToRef(t[5], 0, e.zz), u.e.FromArrayToRef(t[6], 0, e.yz), u.e.FromArrayToRef(t[7], 0, e.zx), u.e.FromArrayToRef(t[8], 0, e.xy), e;\n          }, r;\n        }(), kn = f(52), dr = function(r, t, e, n) {\n          this.name = r, this.worldAxisForNormal = t, this.worldAxisForFileX = e, this.worldAxisForFileY = n;\n        }, Lo = function() {\n          function r() {\n          }\n          return r.ConvertCubeMapTextureToSphericalPolynomial = function(t) {\n            if (!t.isCube)\n              return null;\n            var e, n, i = t.getSize().width, o = t.readPixels(0), a = t.readPixels(1);\n            t.isRenderTarget ? (e = t.readPixels(3), n = t.readPixels(2)) : (e = t.readPixels(2), n = t.readPixels(3));\n            var s = t.readPixels(4), d = t.readPixels(5), p = t.gammaSpace, y = h.a.TEXTUREFORMAT_RGBA, P = h.a.TEXTURETYPE_UNSIGNED_INT;\n            t.textureType != h.a.TEXTURETYPE_FLOAT && t.textureType != h.a.TEXTURETYPE_HALF_FLOAT || (P = h.a.TEXTURETYPE_FLOAT);\n            var R = { size: i, right: o, left: a, up: e, down: n, front: s, back: d, format: y, type: P, gammaSpace: p };\n            return this.ConvertCubeMapToSphericalPolynomial(R);\n          }, r.ConvertCubeMapToSphericalPolynomial = function(t) {\n            for (var e = new hs(), n = 0, i = 2 / t.size, o = i, a = 0.5 * i - 1, s = 0; s < 6; s++)\n              for (var d = this.FileFaces[s], p = t[d.name], y = a, P = t.format === h.a.TEXTUREFORMAT_RGBA ? 4 : 3, R = 0; R < t.size; R++) {\n                for (var B = a, F = 0; F < t.size; F++) {\n                  var z = d.worldAxisForFileX.scale(B).add(d.worldAxisForFileY.scale(y)).add(d.worldAxisForNormal);\n                  z.normalize();\n                  var J = Math.pow(1 + B * B + y * y, -1.5), ie = p[R * t.size * P + F * P + 0], se = p[R * t.size * P + F * P + 1], ce = p[R * t.size * P + F * P + 2];\n                  isNaN(ie) && (ie = 0), isNaN(se) && (se = 0), isNaN(ce) && (ce = 0), t.type === h.a.TEXTURETYPE_UNSIGNED_INT && (ie /= 255, se /= 255, ce /= 255), t.gammaSpace && (ie = Math.pow($.a.Clamp(ie), Vt.c), se = Math.pow($.a.Clamp(se), Vt.c), ce = Math.pow($.a.Clamp(ce), Vt.c)), ie = $.a.Clamp(ie, 0, 4096), se = $.a.Clamp(se, 0, 4096), ce = $.a.Clamp(ce, 0, 4096);\n                  var ue = new I.a(ie, se, ce);\n                  e.addLight(z, ue, J), n += J, B += i;\n                }\n                y += o;\n              }\n            var fe = 6 * (4 * Math.PI) / 6 / n;\n            return e.scaleInPlace(fe), e.convertIncidentRadianceToIrradiance(), e.convertIrradianceToLambertianRadiance(), Yr.FromHarmonics(e);\n          }, r.FileFaces = [new dr(\"right\", new u.e(1, 0, 0), new u.e(0, 0, -1), new u.e(0, -1, 0)), new dr(\"left\", new u.e(-1, 0, 0), new u.e(0, 0, 1), new u.e(0, -1, 0)), new dr(\"up\", new u.e(0, 1, 0), new u.e(1, 0, 0), new u.e(0, 0, 1)), new dr(\"down\", new u.e(0, -1, 0), new u.e(1, 0, 0), new u.e(0, 0, -1)), new dr(\"front\", new u.e(0, 0, 1), new u.e(1, 0, 0), new u.e(0, -1, 0)), new dr(\"back\", new u.e(0, 0, -1), new u.e(-1, 0, 0), new u.e(0, -1, 0))], r;\n        }();\n        Object.defineProperty(kn.a.prototype, \"sphericalPolynomial\", { get: function() {\n          if (this._texture) {\n            if (this._texture._sphericalPolynomial)\n              return this._texture._sphericalPolynomial;\n            if (this._texture.isReady)\n              return this._texture._sphericalPolynomial = Lo.ConvertCubeMapTextureToSphericalPolynomial(this), this._texture._sphericalPolynomial;\n          }\n          return null;\n        }, set: function(r) {\n          this._texture && (this._texture._sphericalPolynomial = r);\n        }, enumerable: !0, configurable: !0 });\n        var Ff = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}`;\n        ze.a.ShadersStore.rgbdEncodePixelShader = Ff;\n        var Bf = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}`;\n        ze.a.ShadersStore.rgbdDecodePixelShader = Bf;\n        var gi = function() {\n          function r() {\n          }\n          return r.GetEnvInfo = function(t) {\n            for (var e = new DataView(t.buffer, t.byteOffset, t.byteLength), n = 0, i = 0; i < r._MagicBytes.length; i++)\n              if (e.getUint8(n++) !== r._MagicBytes[i])\n                return l.a.Error(\"Not a babylon environment map\"), null;\n            for (var o = \"\", a = 0; a = e.getUint8(n++); )\n              o += String.fromCharCode(a);\n            var s = JSON.parse(o);\n            return s.specular && (s.specular.specularDataPosition = n, s.specular.lodGenerationScale = s.specular.lodGenerationScale || 0.8), s;\n          }, r.CreateEnvTextureAsync = function(t) {\n            var e = this, n = t.getInternalTexture();\n            if (!n)\n              return Promise.reject(\"The cube texture is invalid.\");\n            var i = n.getEngine();\n            if (i && i.premultipliedAlpha)\n              return Promise.reject(\"Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.\");\n            if (t.textureType === h.a.TEXTURETYPE_UNSIGNED_INT)\n              return Promise.reject(\"The cube texture should allow HDR (Full Float or Half Float).\");\n            var o = i.getRenderingCanvas();\n            if (!o)\n              return Promise.reject(\"Env texture can only be created when the engine is associated to a canvas.\");\n            var a = h.a.TEXTURETYPE_FLOAT;\n            if (!i.getCaps().textureFloatRender && (a = h.a.TEXTURETYPE_HALF_FLOAT, !i.getCaps().textureHalfFloatRender))\n              return Promise.reject(\"Env texture can only be created when the browser supports half float or full float rendering.\");\n            var s = n.width, d = new _e.a(i), p = {}, y = [], P = $.a.Log2(n.width);\n            P = Math.round(P);\n            for (var R = function(F) {\n              for (var z = Math.pow(2, P - F), J = function(se) {\n                var ce = t.readPixels(se, F), ue = i.createRawTexture(ce, z, z, h.a.TEXTUREFORMAT_RGBA, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, null, a), fe = new Promise(function(ve, Te) {\n                  var Re = new ft(\"rgbdEncode\", \"rgbdEncode\", null, null, 1, null, h.a.TEXTURE_NEAREST_SAMPLINGMODE, i, !1, void 0, h.a.TEXTURETYPE_UNSIGNED_INT, void 0, null, !1);\n                  Re.getEffect().executeWhenCompiled(function() {\n                    Re.onApply = function(Se) {\n                      Se._bindTexture(\"textureSampler\", ue);\n                    };\n                    var Ae = i.getRenderWidth(), Ee = i.getRenderHeight();\n                    i.setSize(z, z), d.postProcessManager.directRender([Re], null), Xe.b.ToBlob(o, function(Se) {\n                      var De = new FileReader();\n                      De.onload = function(xe) {\n                        var Le = xe.target.result;\n                        p[6 * F + se] = Le, ve();\n                      }, De.readAsArrayBuffer(Se);\n                    }), i.setSize(Ae, Ee);\n                  });\n                });\n                y.push(fe);\n              }, ie = 0; ie < 6; ie++)\n                J(ie);\n            }, B = 0; B <= P; B++)\n              R(B);\n            return Promise.all(y).then(function() {\n              d.dispose();\n              for (var F = { version: 1, width: s, irradiance: e._CreateEnvTextureIrradiance(t), specular: { mipmaps: [], lodGenerationScale: t.lodGenerationScale } }, z = 0, J = 0; J <= P; J++)\n                for (var ie = 0; ie < 6; ie++) {\n                  var se = p[6 * J + ie].byteLength;\n                  F.specular.mipmaps.push({ length: se, position: z }), z += se;\n                }\n              for (var ce = JSON.stringify(F), ue = new ArrayBuffer(ce.length + 1), fe = new Uint8Array(ue), ve = (J = 0, ce.length); J < ve; J++)\n                fe[J] = ce.charCodeAt(J);\n              fe[ce.length] = 0;\n              var Te = r._MagicBytes.length + z + ue.byteLength, Re = new ArrayBuffer(Te), Ae = new Uint8Array(Re), Ee = new DataView(Re), Se = 0;\n              for (J = 0; J < r._MagicBytes.length; J++)\n                Ee.setUint8(Se++, r._MagicBytes[J]);\n              for (Ae.set(new Uint8Array(ue), Se), Se += ue.byteLength, J = 0; J <= P; J++)\n                for (ie = 0; ie < 6; ie++) {\n                  var De = p[6 * J + ie];\n                  Ae.set(new Uint8Array(De), Se), Se += De.byteLength;\n                }\n              return Re;\n            });\n          }, r._CreateEnvTextureIrradiance = function(t) {\n            var e = t.sphericalPolynomial;\n            return e == null ? null : { x: [e.x.x, e.x.y, e.x.z], y: [e.y.x, e.y.y, e.y.z], z: [e.z.x, e.z.y, e.z.z], xx: [e.xx.x, e.xx.y, e.xx.z], yy: [e.yy.x, e.yy.y, e.yy.z], zz: [e.zz.x, e.zz.y, e.zz.z], yz: [e.yz.x, e.yz.y, e.yz.z], zx: [e.zx.x, e.zx.y, e.zx.z], xy: [e.xy.x, e.xy.y, e.xy.z] };\n          }, r.CreateImageDataArrayBufferViews = function(t, e) {\n            if (e.version !== 1)\n              throw new Error('Unsupported babylon environment map version \"' + e.version + '\"');\n            var n = e.specular, i = $.a.Log2(e.width);\n            if (i = Math.round(i) + 1, n.mipmaps.length !== 6 * i)\n              throw new Error('Unsupported specular mipmaps number \"' + n.mipmaps.length + '\"');\n            for (var o = new Array(i), a = 0; a < i; a++) {\n              o[a] = new Array(6);\n              for (var s = 0; s < 6; s++) {\n                var d = n.mipmaps[6 * a + s];\n                o[a][s] = new Uint8Array(t.buffer, t.byteOffset + n.specularDataPosition + d.position, d.length);\n              }\n            }\n            return o;\n          }, r.UploadEnvLevelsAsync = function(t, e, n) {\n            if (n.version !== 1)\n              throw new Error('Unsupported babylon environment map version \"' + n.version + '\"');\n            var i = n.specular;\n            if (!i)\n              return Promise.resolve();\n            t._lodGenerationScale = i.lodGenerationScale;\n            var o = r.CreateImageDataArrayBufferViews(e, n);\n            return r.UploadLevelsAsync(t, o);\n          }, r._OnImageReadyAsync = function(t, e, n, i, o, a, s, d, p, y, P) {\n            return new Promise(function(R, B) {\n              if (n) {\n                var F = e.createTexture(null, !0, !0, null, h.a.TEXTURE_NEAREST_SAMPLINGMODE, null, function(J) {\n                  B(J);\n                }, t);\n                i.getEffect().executeWhenCompiled(function() {\n                  i.onApply = function(J) {\n                    J._bindTexture(\"textureSampler\", F), J.setFloat2(\"scale\", 1, 1);\n                  }, e.scenes[0].postProcessManager.directRender([i], y, !0, a, s), e.restoreDefaultFramebuffer(), F.dispose(), URL.revokeObjectURL(o), R();\n                });\n              } else {\n                if (e._uploadImageToTexture(P, t, a, s), d) {\n                  var z = p[s];\n                  z && e._uploadImageToTexture(z._texture, t, a, 0);\n                }\n                R();\n              }\n            });\n          }, r.UploadLevelsAsync = function(t, e) {\n            var n = this;\n            if (!Xe.b.IsExponentOfTwo(t.width))\n              throw new Error(\"Texture size must be a power of two\");\n            var i = Math.round($.a.Log2(t.width)) + 1, o = t.getEngine(), a = !1, s = !1, d = null, p = null, y = null, P = o.getCaps();\n            if (t.format = h.a.TEXTUREFORMAT_RGBA, t.type = h.a.TEXTURETYPE_UNSIGNED_INT, t.generateMipMaps = !0, t._cachedAnisotropicFilteringLevel = null, o.updateTextureSamplingMode(h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, t), P.textureLOD ? o.webGLVersion < 2 ? a = !1 : P.textureHalfFloatRender && P.textureHalfFloatLinearFiltering ? (a = !0, t.type = h.a.TEXTURETYPE_HALF_FLOAT) : P.textureFloatRender && P.textureFloatLinearFiltering && (a = !0, t.type = h.a.TEXTURETYPE_FLOAT) : (a = !1, s = !0, y = {}), a)\n              d = new ft(\"rgbdDecode\", \"rgbdDecode\", null, null, 1, null, h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, o, !1, void 0, t.type, void 0, null, !1), t._isRGBD = !1, t.invertY = !1, p = o.createRenderTargetCubeTexture(t.width, { generateDepthBuffer: !1, generateMipMaps: !0, generateStencilBuffer: !1, samplingMode: h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, type: t.type, format: h.a.TEXTUREFORMAT_RGBA });\n            else if (t._isRGBD = !0, t.invertY = !0, s)\n              for (var R = t._lodGenerationScale, B = t._lodGenerationOffset, F = 0; F < 3; F++) {\n                var z = (i - 1) * R + B, J = B + (z - B) * (1 - F / 2), ie = Math.round(Math.min(Math.max(J, 0), z)), se = new Pt.a(o, Pt.b.Temp);\n                se.isCube = !0, se.invertY = !0, se.generateMipMaps = !1, o.updateTextureSamplingMode(h.a.TEXTURE_LINEAR_LINEAR, se);\n                var ce = new kn.a(null);\n                switch (ce.isCube = !0, ce._texture = se, y[ie] = ce, F) {\n                  case 0:\n                    t._lodTextureLow = ce;\n                    break;\n                  case 1:\n                    t._lodTextureMid = ce;\n                    break;\n                  case 2:\n                    t._lodTextureHigh = ce;\n                }\n              }\n            var ue = [], fe = function(Ee) {\n              for (var Se = function(xe) {\n                var Le = e[Ee][xe], Me = new Blob([Le], { type: \"image/png\" }), we = URL.createObjectURL(Me), Ye = void 0;\n                if (typeof Image > \"u\")\n                  Ye = createImageBitmap(Me).then(function(nt) {\n                    return n._OnImageReadyAsync(nt, o, a, d, we, xe, Ee, s, y, p, t);\n                  });\n                else {\n                  var et = new Image();\n                  et.src = we, Ye = new Promise(function(nt, ct) {\n                    et.onload = function() {\n                      n._OnImageReadyAsync(et, o, a, d, we, xe, Ee, s, y, p, t).then(function() {\n                        return nt();\n                      }).catch(function(Ke) {\n                        ct(Ke);\n                      });\n                    }, et.onerror = function(Ke) {\n                      ct(Ke);\n                    };\n                  });\n                }\n                ue.push(Ye);\n              }, De = 0; De < 6; De++)\n                Se(De);\n            };\n            for (F = 0; F < e.length; F++)\n              fe(F);\n            if (e.length < i) {\n              var ve = void 0, Te = Math.pow(2, i - 1 - e.length), Re = Te * Te * 4;\n              switch (t.type) {\n                case h.a.TEXTURETYPE_UNSIGNED_INT:\n                  ve = new Uint8Array(Re);\n                  break;\n                case h.a.TEXTURETYPE_HALF_FLOAT:\n                  ve = new Uint16Array(Re);\n                  break;\n                case h.a.TEXTURETYPE_FLOAT:\n                  ve = new Float32Array(Re);\n              }\n              for (F = e.length; F < i; F++)\n                for (var Ae = 0; Ae < 6; Ae++)\n                  o._uploadArrayBufferViewToTexture(t, ve, Ae, F);\n            }\n            return Promise.all(ue).then(function() {\n              p && (o._releaseFramebufferObjects(p), o._releaseTexture(t), p._swapAndDie(t)), d && d.dispose(), s && (t._lodTextureHigh && t._lodTextureHigh._texture && (t._lodTextureHigh._texture.isReady = !0), t._lodTextureMid && t._lodTextureMid._texture && (t._lodTextureMid._texture.isReady = !0), t._lodTextureLow && t._lodTextureLow._texture && (t._lodTextureLow._texture.isReady = !0));\n            });\n          }, r.UploadEnvSpherical = function(t, e) {\n            e.version !== 1 && l.a.Warn('Unsupported babylon environment map version \"' + e.version + '\"');\n            var n = e.irradiance;\n            if (n) {\n              var i = new Yr();\n              u.e.FromArrayToRef(n.x, 0, i.x), u.e.FromArrayToRef(n.y, 0, i.y), u.e.FromArrayToRef(n.z, 0, i.z), u.e.FromArrayToRef(n.xx, 0, i.xx), u.e.FromArrayToRef(n.yy, 0, i.yy), u.e.FromArrayToRef(n.zz, 0, i.zz), u.e.FromArrayToRef(n.yz, 0, i.yz), u.e.FromArrayToRef(n.zx, 0, i.zx), u.e.FromArrayToRef(n.xy, 0, i.xy), t._sphericalPolynomial = i;\n            }\n          }, r._UpdateRGBDAsync = function(t, e, n, i, o) {\n            return t._source = Pt.b.CubeRawRGBD, t._bufferViewArrayArray = e, t._lodGenerationScale = i, t._lodGenerationOffset = o, t._sphericalPolynomial = n, r.UploadLevelsAsync(t, e).then(function() {\n              t.isReady = !0;\n            });\n          }, r._MagicBytes = [134, 22, 135, 150, 246, 214, 150, 54], r;\n        }();\n        Pt.a._UpdateRGBDAsync = gi._UpdateRGBDAsync;\n        var vi, ds = function() {\n          function r(t, e) {\n            e === void 0 && (e = 20), this.debug = !1, this._sourceCode = t, this._numMaxIterations = e, this._functionDescr = [], this.inlineToken = \"#define inline\";\n          }\n          return Object.defineProperty(r.prototype, \"code\", { get: function() {\n            return this._sourceCode;\n          }, enumerable: !1, configurable: !0 }), r.prototype.processCode = function() {\n            this.debug && console.log(\"Start inlining process (code size=\" + this._sourceCode.length + \")...\"), this._collectFunctions(), this._processInlining(this._numMaxIterations), this.debug && console.log(\"End of inlining process.\");\n          }, r.prototype._collectFunctions = function() {\n            for (var t = 0; t < this._sourceCode.length; ) {\n              var e = this._sourceCode.indexOf(this.inlineToken, t);\n              if (e < 0)\n                break;\n              var n = this._sourceCode.indexOf(\"(\", e + this.inlineToken.length);\n              if (n < 0)\n                this.debug && console.warn(\"Could not find the opening parenthesis after the token. startIndex=\" + t), t = e + this.inlineToken.length;\n              else {\n                var i = r._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(e + this.inlineToken.length, n));\n                if (i) {\n                  var o = [i[3], i[4]], a = o[0], s = o[1], d = this._extractBetweenMarkers(\"(\", \")\", this._sourceCode, n);\n                  if (d < 0)\n                    this.debug && console.warn(\"Could not extract the parameters the function '\" + s + \"' (type=\" + a + \"). funcParamsStartIndex=\" + n), t = e + this.inlineToken.length;\n                  else {\n                    var p = this._sourceCode.substring(n + 1, d), y = this._skipWhitespaces(this._sourceCode, d + 1);\n                    if (y !== this._sourceCode.length) {\n                      var P = this._extractBetweenMarkers(\"{\", \"}\", this._sourceCode, y);\n                      if (P < 0)\n                        this.debug && console.warn(\"Could not extract the body of the function '\" + s + \"' (type=\" + a + \"). funcBodyStartIndex=\" + y), t = e + this.inlineToken.length;\n                      else {\n                        for (var R = this._sourceCode.substring(y, P + 1), B = this._removeComments(p).split(\",\"), F = [], z = 0; z < B.length; ++z) {\n                          var J = B[z].trim(), ie = J.lastIndexOf(\" \");\n                          ie >= 0 && F.push(J.substring(ie + 1));\n                        }\n                        a !== \"void\" && F.push(\"return\"), this._functionDescr.push({ name: s, type: a, parameters: F, body: R, callIndex: 0 }), t = P + 1;\n                        var se = e > 0 ? this._sourceCode.substring(0, e) : \"\", ce = P + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(P + 1) : \"\";\n                        this._sourceCode = se + ce, t -= P + 1 - e;\n                      }\n                    } else\n                      this.debug && console.warn(\"Could not extract the body of the function '\" + s + \"' (type=\" + a + \"). funcParamsEndIndex=\" + d), t = e + this.inlineToken.length;\n                  }\n                } else\n                  this.debug && console.warn(\"Could not extract the name/type of the function from: \" + this._sourceCode.substring(e + this.inlineToken.length, n)), t = e + this.inlineToken.length;\n              }\n            }\n            this.debug && console.log(\"Collect functions: \" + this._functionDescr.length + \" functions found. functionDescr=\", this._functionDescr);\n          }, r.prototype._processInlining = function(t) {\n            for (t === void 0 && (t = 20); t-- >= 0 && this._replaceFunctionCallsByCode(); )\n              ;\n            return this.debug && console.log(\"numMaxIterations is \" + t + \" after inlining process\"), t >= 0;\n          }, r.prototype._extractBetweenMarkers = function(t, e, n, i) {\n            for (var o = i, a = 0, s = \"\"; o < n.length; ) {\n              var d = n.charAt(o);\n              if (s)\n                d === s ? s === '\"' || s === \"'\" ? n.charAt(o - 1) !== \"\\\\\" && (s = \"\") : s = \"\" : s === \"*/\" && d === \"*\" && o + 1 < n.length && (n.charAt(o + 1) === \"/\" && (s = \"\"), s === \"\" && o++);\n              else\n                switch (d) {\n                  case t:\n                    a++;\n                    break;\n                  case e:\n                    a--;\n                    break;\n                  case '\"':\n                  case \"'\":\n                  case \"`\":\n                    s = d;\n                    break;\n                  case \"/\":\n                    if (o + 1 < n.length) {\n                      var p = n.charAt(o + 1);\n                      p === \"/\" ? s = `\n` : p === \"*\" && (s = \"*/\");\n                    }\n                }\n              if (o++, a === 0)\n                break;\n            }\n            return a === 0 ? o - 1 : -1;\n          }, r.prototype._skipWhitespaces = function(t, e) {\n            for (; e < t.length; ) {\n              var n = t[e];\n              if (n !== \" \" && n !== `\n` && n !== \"\\r\" && n !== \"\t\" && n !== `\n` && n !== \" \")\n                break;\n              e++;\n            }\n            return e;\n          }, r.prototype._removeComments = function(t) {\n            for (var e = 0, n = \"\", i = !1, o = []; e < t.length; ) {\n              var a = t.charAt(e);\n              if (n)\n                a === n ? n === '\"' || n === \"'\" ? (t.charAt(e - 1) !== \"\\\\\" && (n = \"\"), o.push(a)) : (n = \"\", i = !1) : n === \"*/\" && a === \"*\" && e + 1 < t.length ? (t.charAt(e + 1) === \"/\" && (n = \"\"), n === \"\" && (i = !1, e++)) : i || o.push(a);\n              else {\n                switch (a) {\n                  case '\"':\n                  case \"'\":\n                  case \"`\":\n                    n = a;\n                    break;\n                  case \"/\":\n                    if (e + 1 < t.length) {\n                      var s = t.charAt(e + 1);\n                      s === \"/\" ? (n = `\n`, i = !0) : s === \"*\" && (n = \"*/\", i = !0);\n                    }\n                }\n                i || o.push(a);\n              }\n              e++;\n            }\n            return o.join(\"\");\n          }, r.prototype._replaceFunctionCallsByCode = function() {\n            for (var t = !1, e = 0, n = this._functionDescr; e < n.length; e++)\n              for (var i = n[e], o = i.name, a = i.type, s = i.parameters, d = i.body, p = 0; p < this._sourceCode.length; ) {\n                var y = this._sourceCode.indexOf(o, p);\n                if (y < 0)\n                  break;\n                var P = this._skipWhitespaces(this._sourceCode, y + o.length);\n                if (P !== this._sourceCode.length && this._sourceCode.charAt(P) === \"(\") {\n                  var R = this._extractBetweenMarkers(\"(\", \")\", this._sourceCode, P);\n                  if (R < 0)\n                    this.debug && console.warn(\"Could not extract the parameters of the function call. Function '\" + o + \"' (type=\" + a + \"). callParamsStartIndex=\" + P), p = y + o.length;\n                  else {\n                    for (var B = this._sourceCode.substring(P + 1, R), F = this._removeComments(B).split(\",\"), z = [], J = 0; J < F.length; ++J) {\n                      var ie = F[J].trim();\n                      z.push(ie);\n                    }\n                    var se = a !== \"void\" ? o + \"_\" + i.callIndex++ : null;\n                    if (se && z.push(se + \" =\"), z.length === s.length) {\n                      p = R + 1;\n                      var ce = this._replaceNames(d, s, z), ue = y > 0 ? this._sourceCode.substring(0, y) : \"\", fe = R + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(R + 1) : \"\";\n                      if (se) {\n                        var ve = this._findBackward(this._sourceCode, y - 1, `\n`);\n                        ue = this._sourceCode.substring(0, ve + 1);\n                        var Te = this._sourceCode.substring(ve + 1, y);\n                        this._sourceCode = ue + a + \" \" + se + `;\n` + ce + `\n` + Te + se + fe, this.debug && console.log(\"Replace function call by code. Function '\" + o + \"' (type=\" + a + \"). injectDeclarationIndex=\" + ve);\n                      } else\n                        this._sourceCode = ue + ce + fe, p += ce.length - (R + 1 - y), this.debug && console.log(\"Replace function call by code. Function '\" + o + \"' (type=\" + a + \"). functionCallIndex=\" + y);\n                      t = !0;\n                    } else\n                      this.debug && console.warn(\"Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '\" + o + \"' (type=\" + a + \"). function parameters=\" + s + \", call parameters=\" + z), p = y + o.length;\n                  }\n                } else\n                  p = y + o.length;\n              }\n            return t;\n          }, r.prototype._findBackward = function(t, e, n) {\n            for (; e >= 0 && t.charAt(e) !== n; )\n              e--;\n            return e;\n          }, r.prototype._escapeRegExp = function(t) {\n            return t.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n          }, r.prototype._replaceNames = function(t, e, n) {\n            for (var i = 0; i < e.length; ++i) {\n              var o = new RegExp(this._escapeRegExp(e[i]), \"g\"), a = n[i];\n              t = t.replace(o, a);\n            }\n            return t;\n          }, r._RegexpFindFunctionNameAndType = /((\\s+?)(\\w+)\\s+(\\w+)\\s*?)$/, r;\n        }(), Uf = function() {\n          function r() {\n            this.isAsync = !1, this.isReady = !1;\n          }\n          return r.prototype._getVertexShaderCode = function() {\n            return null;\n          }, r.prototype._getFragmentShaderCode = function() {\n            return null;\n          }, r.prototype._handlesSpectorRebuildCallback = function(t) {\n            throw new Error(\"Not implemented\");\n          }, r;\n        }(), jl = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t;\n        }(zl.a), Hl = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getInternalTexture = function() {\n            return this;\n          }, t.prototype.getViewCount = function() {\n            return 1;\n          }, t;\n        }(Pt.a), Vf = function(r) {\n          function t() {\n            var e = r.call(this, null) || this;\n            return e._native = new _native.Engine(), e.INVALID_HANDLE = 65535, e._boundBuffersVertexArray = null, e._currentDepthTest = e._native.DEPTH_TEST_LEQUAL, e._webGLVersion = 2, e.disableUniformBuffers = !0, e._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: 512, maxCubemapTextureSize: 512, maxRenderTextureSize: 512, maxVertexAttribs: 16, maxVaryingVectors: 16, maxFragmentUniformVectors: 16, maxVertexUniformVectors: 16, standardDerivatives: !0, astc: null, pvrtc: null, etc1: null, etc2: null, bptc: null, maxAnisotropy: 16, uintIndices: !0, fragmentDepthSupported: !1, highPrecisionShaderSupported: !0, colorBufferFloat: !1, textureFloat: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloat: !1, textureHalfFloatLinearFiltering: !1, textureHalfFloatRender: !1, textureLOD: !0, drawBuffersExtension: !1, depthTextureExtension: !1, vertexArrayObject: !0, instancedArrays: !1, canUseTimestampForTimerQuery: !1, blendMinMax: !1, maxMSAASamples: 1 }, Xe.b.Log(\"Babylon Native (v\" + Ue.a.Version + \") launched\"), Xe.b.LoadScript = function(n, i, o, a) {\n              Xe.b.LoadFile(n, function(s) {\n                Function(s).apply(null), i && i();\n              }, void 0, void 0, !1, function(s, d) {\n                o && o(\"LoadScript Error\", d);\n              });\n            }, typeof URL > \"u\" && (window.URL = { createObjectURL: function() {\n            }, revokeObjectURL: function() {\n            } }), typeof Blob > \"u\" && (window.Blob = function() {\n            }), e._shaderProcessor = new Gl.a(), e;\n          }\n          return Object(c.d)(t, r), t.prototype.getHardwareScalingLevel = function() {\n            return 1;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._boundBuffersVertexArray && this._native.deleteVertexArray(this._boundBuffersVertexArray), this._native.dispose();\n          }, t.prototype._queueNewFrame = function(e, n) {\n            return n.requestAnimationFrame && n !== window ? n.requestAnimationFrame(e) : this._native.requestAnimationFrame(e), 0;\n          }, t.prototype._bindUnboundFramebuffer = function(e) {\n            this._currentFramebuffer !== e && (this._currentFramebuffer && this._native.unbindFramebuffer(this._currentFramebuffer), e && this._native.bindFramebuffer(e), this._currentFramebuffer = e);\n          }, t.prototype.getHostDocument = function() {\n            return null;\n          }, t.prototype.clear = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = 0;\n            n && e && (this._native.clearColor(e.r, e.g, e.b, e.a !== void 0 ? e.a : 1), a |= this._native.CLEAR_FLAG_COLOR), i && (this._native.clearDepth(1), a |= this._native.CLEAR_FLAG_DEPTH), o && (this._native.clearStencil(0), a |= this._native.CLEAR_FLAG_STENCIL), this._native.clear(a);\n          }, t.prototype.createIndexBuffer = function(e, n) {\n            var i = this._normalizeIndexData(e), o = new jl();\n            if (o.references = 1, o.is32Bits = i.BYTES_PER_ELEMENT === 4, i.length) {\n              if (o.nativeIndexBuffer = this._native.createIndexBuffer(i, n != null && n), o.nativeVertexBuffer === this.INVALID_HANDLE)\n                throw new Error(\"Could not create a native index buffer.\");\n            } else\n              o.nativeVertexBuffer = this.INVALID_HANDLE;\n            return o;\n          }, t.prototype.createVertexBuffer = function(e, n) {\n            var i = new jl();\n            if (i.references = 1, i.nativeVertexBuffer = this._native.createVertexBuffer(ArrayBuffer.isView(e) ? e : new Float32Array(e), n != null && n), i.nativeVertexBuffer === this.INVALID_HANDLE)\n              throw new Error(\"Could not create a native vertex buffer.\");\n            return i;\n          }, t.prototype._recordVertexArrayObject = function(e, n, i, o) {\n            i && this._native.recordIndexBuffer(e, i.nativeIndexBuffer);\n            for (var a = o.getAttributesNames(), s = 0; s < a.length; s++) {\n              var d = o.getAttributeLocation(s);\n              if (d >= 0) {\n                var p = n[a[s]];\n                if (p) {\n                  var y = p.getBuffer();\n                  y && this._native.recordVertexBuffer(e, y.nativeVertexBuffer, d, p.byteOffset, p.byteStride, p.getSize(), this._getNativeAttribType(p.type), p.normalized);\n                }\n              }\n            }\n          }, t.prototype.bindBuffers = function(e, n, i) {\n            this._boundBuffersVertexArray && this._native.deleteVertexArray(this._boundBuffersVertexArray), this._boundBuffersVertexArray = this._native.createVertexArray(), this._recordVertexArrayObject(this._boundBuffersVertexArray, e, n, i), this._native.bindVertexArray(this._boundBuffersVertexArray);\n          }, t.prototype.recordVertexArrayObject = function(e, n, i) {\n            var o = this._native.createVertexArray();\n            return this._recordVertexArrayObject(o, e, n, i), o;\n          }, t.prototype.bindVertexArrayObject = function(e) {\n            this._native.bindVertexArray(e);\n          }, t.prototype.releaseVertexArrayObject = function(e) {\n            this._native.deleteVertexArray(e);\n          }, t.prototype.getAttributes = function(e, n) {\n            var i = e;\n            return this._native.getAttributes(i.nativeProgram, n);\n          }, t.prototype.drawElementsType = function(e, n, i, o) {\n            this._drawCalls.addCount(1, !1), this._native.drawIndexed(e, n, i);\n          }, t.prototype.drawArraysType = function(e, n, i, o) {\n            this._drawCalls.addCount(1, !1), this._native.draw(e, n, i);\n          }, t.prototype.createPipelineContext = function() {\n            return new Uf();\n          }, t.prototype._preparePipelineContext = function(e, n, i, o, a, s, d) {\n            var p = e;\n            p.nativeProgram = o ? this.createRawShaderProgram(e, n, i, void 0, d) : this.createShaderProgram(e, n, i, s, void 0, d);\n          }, t.prototype._isRenderingStateCompiled = function(e) {\n            return !0;\n          }, t.prototype._executeWhenRenderingStateIsCompiled = function(e, n) {\n            n();\n          }, t.prototype.createRawShaderProgram = function(e, n, i, o, a) {\n            throw new Error(\"Not Supported\");\n          }, t.prototype.createShaderProgram = function(e, n, i, o, a, s) {\n            this.onBeforeShaderCompilationObservable.notifyObservers(this);\n            var d = new ds(n);\n            d.processCode(), n = d.code;\n            var p = new ds(i);\n            p.processCode(), i = p.code, n = wt.a._ConcatenateShader(n, o), i = wt.a._ConcatenateShader(i, o);\n            var y = this._native.createProgram(n, i);\n            return this.onAfterShaderCompilationObservable.notifyObservers(this), y;\n          }, t.prototype._setProgram = function(e) {\n            this._currentProgram !== e && (this._native.setProgram(e), this._currentProgram = e);\n          }, t.prototype._releaseEffect = function(e) {\n          }, t.prototype._deletePipelineContext = function(e) {\n          }, t.prototype.getUniforms = function(e, n) {\n            var i = e;\n            return this._native.getUniforms(i.nativeProgram, n);\n          }, t.prototype.bindUniformBlock = function(e, n, i) {\n            throw new Error(\"Not Implemented\");\n          }, t.prototype.bindSamplers = function(e) {\n            var n = e.getPipelineContext();\n            this._setProgram(n.nativeProgram);\n            for (var i = e.getSamplers(), o = 0; o < i.length; o++) {\n              var a = e.getUniform(i[o]);\n              a && (this._boundUniforms[o] = a);\n            }\n            this._currentEffect = null;\n          }, t.prototype.setMatrix = function(e, n) {\n            e && this._native.setMatrix(e, n.toArray());\n          }, t.prototype.getRenderWidth = function(e) {\n            return e === void 0 && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._native.getRenderWidth();\n          }, t.prototype.getRenderHeight = function(e) {\n            return e === void 0 && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._native.getRenderHeight();\n          }, t.prototype.setViewport = function(e, n, i) {\n            this._cachedViewport = e, this._native.setViewPort(e.x, e.y, e.width, e.height);\n          }, t.prototype.setState = function(e, n, i, o) {\n            n === void 0 && (n = 0), o === void 0 && (o = !1), this._native.setState(e, n, o);\n          }, t.prototype.setZOffset = function(e) {\n            this._native.setZOffset(e);\n          }, t.prototype.getZOffset = function() {\n            return this._native.getZOffset();\n          }, t.prototype.setDepthBuffer = function(e) {\n            this._native.setDepthTest(e ? this._currentDepthTest : this._native.DEPTH_TEST_ALWAYS);\n          }, t.prototype.getDepthWrite = function() {\n            return this._native.getDepthWrite();\n          }, t.prototype.setDepthFunctionToGreater = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_GREATER, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthFunctionToGreaterOrEqual = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_GEQUAL, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthFunctionToLess = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_LESS, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthFunctionToLessOrEqual = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_LEQUAL, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthWrite = function(e) {\n            this._native.setDepthWrite(e);\n          }, t.prototype.setColorWrite = function(e) {\n            this._native.setColorWrite(e), this._colorWrite = e;\n          }, t.prototype.getColorWrite = function() {\n            return this._colorWrite;\n          }, t.prototype.setAlphaConstants = function(e, n, i, o) {\n            throw new Error(\"Setting alpha blend constant color not yet implemented.\");\n          }, t.prototype.setAlphaMode = function(e, n) {\n            n === void 0 && (n = !1), this._alphaMode !== e && (e = this._getNativeAlphaMode(e), this._native.setBlendMode(e), n || this.setDepthWrite(e === h.a.ALPHA_DISABLE), this._alphaMode = e);\n          }, t.prototype.getAlphaMode = function() {\n            return this._alphaMode;\n          }, t.prototype.setInt = function(e, n) {\n            return !!e && (this._native.setInt(e, n), !0);\n          }, t.prototype.setIntArray = function(e, n) {\n            return !!e && (this._native.setIntArray(e, n), !0);\n          }, t.prototype.setIntArray2 = function(e, n) {\n            return !!e && (this._native.setIntArray2(e, n), !0);\n          }, t.prototype.setIntArray3 = function(e, n) {\n            return !!e && (this._native.setIntArray3(e, n), !0);\n          }, t.prototype.setIntArray4 = function(e, n) {\n            return !!e && (this._native.setIntArray4(e, n), !0);\n          }, t.prototype.setFloatArray = function(e, n) {\n            return !!e && (this._native.setFloatArray(e, n), !0);\n          }, t.prototype.setFloatArray2 = function(e, n) {\n            return !!e && (this._native.setFloatArray2(e, n), !0);\n          }, t.prototype.setFloatArray3 = function(e, n) {\n            return !!e && (this._native.setFloatArray3(e, n), !0);\n          }, t.prototype.setFloatArray4 = function(e, n) {\n            return !!e && (this._native.setFloatArray4(e, n), !0);\n          }, t.prototype.setArray = function(e, n) {\n            return !!e && (this._native.setFloatArray(e, n), !0);\n          }, t.prototype.setArray2 = function(e, n) {\n            return !!e && (this._native.setFloatArray2(e, n), !0);\n          }, t.prototype.setArray3 = function(e, n) {\n            return !!e && (this._native.setFloatArray3(e, n), !0);\n          }, t.prototype.setArray4 = function(e, n) {\n            return !!e && (this._native.setFloatArray4(e, n), !0);\n          }, t.prototype.setMatrices = function(e, n) {\n            return !!e && (this._native.setMatrices(e, n), !0);\n          }, t.prototype.setMatrix3x3 = function(e, n) {\n            return !!e && (this._native.setMatrix3x3(e, n), !0);\n          }, t.prototype.setMatrix2x2 = function(e, n) {\n            return !!e && (this._native.setMatrix2x2(e, n), !0);\n          }, t.prototype.setFloat = function(e, n) {\n            return !!e && (this._native.setFloat(e, n), !0);\n          }, t.prototype.setFloat2 = function(e, n, i) {\n            return !!e && (this._native.setFloat2(e, n, i), !0);\n          }, t.prototype.setFloat3 = function(e, n, i, o) {\n            return !!e && (this._native.setFloat3(e, n, i, o), !0);\n          }, t.prototype.setFloat4 = function(e, n, i, o, a) {\n            return !!e && (this._native.setFloat4(e, n, i, o, a), !0);\n          }, t.prototype.setColor3 = function(e, n) {\n            return !!e && (this._native.setFloat3(e, n.r, n.g, n.b), !0);\n          }, t.prototype.setColor4 = function(e, n, i) {\n            return !!e && (this._native.setFloat4(e, n.r, n.g, n.b, i), !0);\n          }, t.prototype.wipeCaches = function(e) {\n            this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, e && (this._currentProgram = null, this._stencilState.reset(), this._depthCullingState.reset(), this._alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);\n          }, t.prototype._createTexture = function() {\n            return this._native.createTexture();\n          }, t.prototype._deleteTexture = function(e) {\n            this._native.deleteTexture(e);\n          }, t.prototype.updateDynamicTexture = function(e, n, i, o, a) {\n            this.createTexture(\"data:my_image_name\", !0, i, null, Ne.a.BILINEAR_SAMPLINGMODE, void 0, void 0, \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVChTY/z//z8DPsAEpXGC4aCAgQEAGGMDDWwwgqsAAAAASUVORK5CYII=\", e, t.TEXTUREFORMAT_RGBA, null, void 0);\n          }, t.prototype.createTexture = function(e, n, i, o, a, s, d, p, y, P, R, B, F) {\n            var z = this;\n            a === void 0 && (a = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), s === void 0 && (s = null), d === void 0 && (d = null), p === void 0 && (p = null), y === void 0 && (y = null), P === void 0 && (P = null), R === void 0 && (R = null);\n            var J = (e = e || \"\").substr(0, 5) === \"data:\", ie = J && e.indexOf(\";base64,\") !== -1, se = y || new Pt.a(this, Pt.b.Url), ce = e;\n            !this._transformTextureUrl || ie || y || p || (e = this._transformTextureUrl(e));\n            for (var ue = e.lastIndexOf(\".\"), fe = R || (ue > -1 ? e.substring(ue).toLowerCase() : \"\"), ve = null, Te = 0, Re = Ue.a._TextureLoaders; Te < Re.length; Te++) {\n              var Ae = Re[Te];\n              if (Ae.canLoad(fe)) {\n                ve = Ae;\n                break;\n              }\n            }\n            o && o._addPendingData(se), se.url = e, se.generateMipMaps = !n, se.samplingMode = a, se.invertY = i, this.doNotHandleContextLost || (se._buffer = p);\n            var Ee = null;\n            if (s && !y && (Ee = se.onLoadedObservable.add(s)), y || this._internalTexturesCache.push(se), ve)\n              throw new Error(\"Loading textures from IInternalTextureLoader not yet implemented.\");\n            var Se = function(De) {\n              var xe = se._webGLTexture;\n              xe ? z._native.loadTexture(xe, De, !n, i, function() {\n                se.baseWidth = z._native.getTextureWidth(xe), se.baseHeight = z._native.getTextureHeight(xe), se.width = se.baseWidth, se.height = se.baseHeight, se.isReady = !0;\n                var Le = z._getNativeSamplingMode(a);\n                z._native.setTextureSampling(xe, Le), o && o._removePendingData(se), se.onLoadedObservable.notifyObservers(se), se.onLoadedObservable.clear();\n              }, function() {\n                throw new Error(\"Could not load a native texture.\");\n              }) : o && o._removePendingData(se);\n            };\n            if (J)\n              if (p instanceof ArrayBuffer)\n                Se(new Uint8Array(p));\n              else if (ArrayBuffer.isView(p))\n                Se(p);\n              else {\n                if (typeof p != \"string\")\n                  throw new Error(\"Unsupported buffer type\");\n                Se(new Uint8Array(Xe.b.DecodeBase64(p)));\n              }\n            else\n              ie ? Se(new Uint8Array(Xe.b.DecodeBase64(e))) : this._loadFile(e, function(De) {\n                return Se(new Uint8Array(De));\n              }, void 0, void 0, !0, function(De, xe) {\n                (function(Le, Me) {\n                  o && o._removePendingData(se), e === ce ? (Ee && se.onLoadedObservable.remove(Ee), te.a.UseFallbackTexture && z.createTexture(te.a.FallbackTexture, n, se.invertY, o, a, null, d, p, se), d && d((Le || \"Unknown error\") + (te.a.UseFallbackTexture ? \" - Fallback texture was used\" : \"\"), Me)) : (l.a.Warn(\"Failed to load \" + e + \", falling back to \" + ce), z.createTexture(ce, n, se.invertY, o, a, s, d, p, se, P, R, B, F));\n                })(\"Unable to load \" + (De && De.responseURL, xe));\n              });\n            return se;\n          }, t.prototype._createDepthStencilTexture = function(e, n) {\n            var i = new Hl(this, Pt.b.Depth), o = e.width || e, a = e.height || e, s = this._native.createDepthTexture(i._webGLTexture, o, a);\n            return i._framebuffer = s, i;\n          }, t.prototype._releaseFramebufferObjects = function(e) {\n          }, t.prototype.createCubeTexture = function(e, n, i, o, a, s, d, p, y, P, R, B) {\n            var F = this;\n            a === void 0 && (a = null), s === void 0 && (s = null), p === void 0 && (p = null), P === void 0 && (P = 0), R === void 0 && (R = 0), B === void 0 && (B = null);\n            var z = B || new Pt.a(this, Pt.b.Cube);\n            z.isCube = !0, z.url = e, z.generateMipMaps = !o, z._lodGenerationScale = P, z._lodGenerationOffset = R, this._doNotHandleContextLost || (z._extension = p, z._files = i);\n            var J = e.lastIndexOf(\".\");\n            if ((p || (J > -1 ? e.substring(J).toLowerCase() : \"\")) === \".env\") {\n              if (i && i.length === 6)\n                throw new Error(\"Multi-file loading not allowed on env files.\");\n              this._loadFile(e, function(se) {\n                return function(ce) {\n                  var ue = gi.GetEnvInfo(ce);\n                  if (z.width = ue.width, z.height = ue.width, gi.UploadEnvSpherical(z, ue), ue.version !== 1)\n                    throw new Error('Unsupported babylon environment map version \"' + ue.version + '\"');\n                  var fe = ue.specular;\n                  if (!fe)\n                    throw new Error(\"Nothing else parsed so far\");\n                  z._lodGenerationScale = fe.lodGenerationScale;\n                  var ve = gi.CreateImageDataArrayBufferViews(ce, ue);\n                  z.format = h.a.TEXTUREFORMAT_RGBA, z.type = h.a.TEXTURETYPE_UNSIGNED_INT, z.generateMipMaps = !0, z.getEngine().updateTextureSamplingMode(Ne.a.TRILINEAR_SAMPLINGMODE, z), z._isRGBD = !0, z.invertY = !0, F._native.loadCubeTextureWithMips(z._webGLTexture, ve, function() {\n                    z.isReady = !0, a && a();\n                  }, function() {\n                    throw new Error(\"Could not load a native cube texture.\");\n                  });\n                }(new Uint8Array(se));\n              }, void 0, void 0, !0, function(se, ce) {\n                s && se && s(se.status + \" \" + se.statusText, ce);\n              });\n            } else {\n              if (!i || i.length !== 6)\n                throw new Error(\"Cannot load cubemap because 6 files were not defined\");\n              var ie = [i[0], i[3], i[1], i[4], i[2], i[5]];\n              Promise.all(ie.map(function(se) {\n                return Xe.b.LoadFileAsync(se).then(function(ce) {\n                  return new Uint8Array(ce);\n                });\n              })).then(function(se) {\n                return new Promise(function(ce, ue) {\n                  F._native.loadCubeTexture(z._webGLTexture, se, !o, ce, ue);\n                });\n              }).then(function() {\n                z.isReady = !0, a && a();\n              }, function(se) {\n                s && s(\"Failed to load cubemap: \" + se.message, se);\n              });\n            }\n            return this._internalTexturesCache.push(z), z;\n          }, t.prototype.createRenderTargetTexture = function(e, n) {\n            var i = new fl.a();\n            n !== void 0 && typeof n == \"object\" ? (i.generateMipMaps = n.generateMipMaps, i.generateDepthBuffer = n.generateDepthBuffer === void 0 || n.generateDepthBuffer, i.generateStencilBuffer = i.generateDepthBuffer && n.generateStencilBuffer, i.type = n.type === void 0 ? h.a.TEXTURETYPE_UNSIGNED_INT : n.type, i.samplingMode = n.samplingMode === void 0 ? h.a.TEXTURE_TRILINEAR_SAMPLINGMODE : n.samplingMode, i.format = n.format === void 0 ? h.a.TEXTUREFORMAT_RGBA : n.format) : (i.generateMipMaps = n, i.generateDepthBuffer = !0, i.generateStencilBuffer = !1, i.type = h.a.TEXTURETYPE_UNSIGNED_INT, i.samplingMode = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, i.format = h.a.TEXTUREFORMAT_RGBA), (i.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (i.type !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (i.samplingMode = h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            var o = new Hl(this, Pt.b.RenderTarget), a = e.width || e, s = e.height || e;\n            i.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (i.type = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\"));\n            var d = this._native.createFramebuffer(o._webGLTexture, a, s, this._getNativeTextureFormat(i.format, i.type), i.samplingMode, !!i.generateStencilBuffer, i.generateDepthBuffer, !!i.generateMipMaps);\n            return o._framebuffer = d, o.baseWidth = a, o.baseHeight = s, o.width = a, o.height = s, o.isReady = !0, o.samples = 1, o.generateMipMaps = !!i.generateMipMaps, o.samplingMode = i.samplingMode, o.type = i.type, o.format = i.format, o._generateDepthBuffer = i.generateDepthBuffer, o._generateStencilBuffer = !!i.generateStencilBuffer, this._internalTexturesCache.push(o), o;\n          }, t.prototype.updateTextureSamplingMode = function(e, n) {\n            if (n._webGLTexture) {\n              var i = this._getNativeSamplingMode(e);\n              this._native.setTextureSampling(n._webGLTexture, i);\n            }\n            n.samplingMode = e;\n          }, t.prototype.bindFramebuffer = function(e, n, i, o, a) {\n            if (n)\n              throw new Error(\"Cuboid frame buffers are not yet supported in NativeEngine.\");\n            if (i || o)\n              throw new Error(\"Required width/height for frame buffers not yet supported in NativeEngine.\");\n            e._depthStencilTexture ? this._bindUnboundFramebuffer(e._depthStencilTexture._framebuffer) : this._bindUnboundFramebuffer(e._framebuffer);\n          }, t.prototype.unBindFramebuffer = function(e, n, i) {\n            n === void 0 && (n = !1), n && l.a.Warn(\"Disabling mipmap generation not yet supported in NativeEngine. Ignoring.\"), i && i(), this._bindUnboundFramebuffer(null);\n          }, t.prototype.createDynamicVertexBuffer = function(e) {\n            return this.createVertexBuffer(e, !0);\n          }, t.prototype.updateDynamicIndexBuffer = function(e, n, i) {\n            i === void 0 && (i = 0);\n            var o = e, a = this._normalizeIndexData(n);\n            o.is32Bits = a.BYTES_PER_ELEMENT === 4, this._native.updateDynamicIndexBuffer(o.nativeIndexBuffer, a, i);\n          }, t.prototype.updateDynamicVertexBuffer = function(e, n, i, o) {\n            var a = e, s = ArrayBuffer.isView(n) ? n : new Float32Array(n);\n            this._native.updateDynamicVertexBuffer(a.nativeVertexBuffer, s, i ?? 0, o ?? s.byteLength);\n          }, t.prototype._setTexture = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a, s = this._boundUniforms[e];\n            if (!s)\n              return !1;\n            if (!n)\n              return this._boundTexturesCache[e] != null && (this._activeChannel = e, this._native.setTexture(s, null)), !1;\n            if (n.video)\n              this._activeChannel = e, n.update();\n            else if (n.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED)\n              return n.delayLoad(), !1;\n            return a = o ? n.depthStencilTexture : n.isReady() ? n.getInternalTexture() : n.isCube ? this.emptyCubeTexture : n.is3D ? this.emptyTexture3D : n.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, this._activeChannel = e, !(!a || !a._webGLTexture) && (this._native.setTextureWrapMode(a._webGLTexture, this._getAddressMode(n.wrapU), this._getAddressMode(n.wrapV), this._getAddressMode(n.wrapR)), this._updateAnisotropicLevel(n), this._native.setTexture(s, a._webGLTexture), !0);\n          }, t.prototype._updateAnisotropicLevel = function(e) {\n            var n = e.getInternalTexture(), i = e.anisotropicFilteringLevel;\n            n && n._webGLTexture && n._cachedAnisotropicFilteringLevel !== i && (this._native.setTextureAnisotropicLevel(n._webGLTexture, i), n._cachedAnisotropicFilteringLevel = i);\n          }, t.prototype._getAddressMode = function(e) {\n            switch (e) {\n              case h.a.TEXTURE_WRAP_ADDRESSMODE:\n                return this._native.ADDRESS_MODE_WRAP;\n              case h.a.TEXTURE_CLAMP_ADDRESSMODE:\n                return this._native.ADDRESS_MODE_CLAMP;\n              case h.a.TEXTURE_MIRROR_ADDRESSMODE:\n                return this._native.ADDRESS_MODE_MIRROR;\n              default:\n                throw new Error(\"Unexpected wrap mode: \" + e + \".\");\n            }\n          }, t.prototype._bindTexture = function(e, n) {\n            var i = this._boundUniforms[e];\n            i && this._native.setTexture(i, n._webGLTexture);\n          }, t.prototype._deleteBuffer = function(e) {\n            e.nativeIndexBuffer && (this._native.deleteIndexBuffer(e.nativeIndexBuffer), delete e.nativeIndexBuffer), e.nativeVertexBuffer && (this._native.deleteVertexBuffer(e.nativeVertexBuffer), delete e.nativeVertexBuffer);\n          }, t.prototype.releaseEffects = function() {\n          }, t.prototype._uploadCompressedDataToTextureDirectly = function(e, n, i, o, a, s, d) {\n            throw new Error(\"_uploadCompressedDataToTextureDirectly not implemented.\");\n          }, t.prototype._uploadDataToTextureDirectly = function(e, n, i, o) {\n            throw new Error(\"_uploadDataToTextureDirectly not implemented.\");\n          }, t.prototype._uploadArrayBufferViewToTexture = function(e, n, i, o) {\n            throw new Error(\"_uploadArrayBufferViewToTexture not implemented.\");\n          }, t.prototype._uploadImageToTexture = function(e, n, i, o) {\n            throw new Error(\"_uploadArrayBufferViewToTexture not implemented.\");\n          }, t.prototype._getNativeSamplingMode = function(e) {\n            switch (e) {\n              case h.a.TEXTURE_NEAREST_NEAREST:\n                return this._native.TEXTURE_NEAREST_NEAREST;\n              case h.a.TEXTURE_LINEAR_LINEAR:\n                return this._native.TEXTURE_LINEAR_LINEAR;\n              case h.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR:\n                return this._native.TEXTURE_LINEAR_LINEAR_MIPLINEAR;\n              case h.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST:\n                return this._native.TEXTURE_NEAREST_NEAREST_MIPNEAREST;\n              case h.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST:\n                return this._native.TEXTURE_NEAREST_LINEAR_MIPNEAREST;\n              case h.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR:\n                return this._native.TEXTURE_NEAREST_LINEAR_MIPLINEAR;\n              case h.a.TEXTURE_NEAREST_LINEAR:\n                return this._native.TEXTURE_NEAREST_LINEAR;\n              case h.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR:\n                return this._native.TEXTURE_NEAREST_NEAREST_MIPLINEAR;\n              case h.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST:\n                return this._native.TEXTURE_LINEAR_NEAREST_MIPNEAREST;\n              case h.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR:\n                return this._native.TEXTURE_LINEAR_NEAREST_MIPLINEAR;\n              case h.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST:\n                return this._native.TEXTURE_LINEAR_LINEAR_MIPNEAREST;\n              case h.a.TEXTURE_LINEAR_NEAREST:\n                return this._native.TEXTURE_LINEAR_NEAREST;\n              default:\n                throw new Error(\"Unsupported sampling mode: \" + e + \".\");\n            }\n          }, t.prototype._getNativeTextureFormat = function(e, n) {\n            if (e == h.a.TEXTUREFORMAT_RGBA && n == h.a.TEXTURETYPE_UNSIGNED_INT)\n              return this._native.TEXTURE_FORMAT_RGBA8;\n            if (e == h.a.TEXTUREFORMAT_RGBA && n == h.a.TEXTURETYPE_FLOAT)\n              return this._native.TEXTURE_FORMAT_RGBA32F;\n            throw new Error(\"Unsupported texture format or type: format \" + e + \", type \" + n + \".\");\n          }, t.prototype._getNativeAlphaMode = function(e) {\n            switch (e) {\n              case h.a.ALPHA_DISABLE:\n                return this._native.ALPHA_DISABLE;\n              case h.a.ALPHA_ADD:\n                return this._native.ALPHA_ADD;\n              case h.a.ALPHA_COMBINE:\n                return this._native.ALPHA_COMBINE;\n              case h.a.ALPHA_SUBTRACT:\n                return this._native.ALPHA_SUBTRACT;\n              case h.a.ALPHA_MULTIPLY:\n                return this._native.ALPHA_MULTIPLY;\n              case h.a.ALPHA_MAXIMIZED:\n                return this._native.ALPHA_MAXIMIZED;\n              case h.a.ALPHA_ONEONE:\n                return this._native.ALPHA_ONEONE;\n              case h.a.ALPHA_PREMULTIPLIED:\n                return this._native.ALPHA_PREMULTIPLIED;\n              case h.a.ALPHA_PREMULTIPLIED_PORTERDUFF:\n                return this._native.ALPHA_PREMULTIPLIED_PORTERDUFF;\n              case h.a.ALPHA_INTERPOLATE:\n                return this._native.ALPHA_INTERPOLATE;\n              case h.a.ALPHA_SCREENMODE:\n                return this._native.ALPHA_SCREENMODE;\n              default:\n                throw new Error(\"Unsupported alpha mode: \" + e + \".\");\n            }\n          }, t.prototype._getNativeAttribType = function(e) {\n            switch (e) {\n              case Oe.b.UNSIGNED_BYTE:\n                return this._native.ATTRIB_TYPE_UINT8;\n              case Oe.b.SHORT:\n                return this._native.ATTRIB_TYPE_INT16;\n              case Oe.b.FLOAT:\n                return this._native.ATTRIB_TYPE_FLOAT;\n              default:\n                throw new Error(\"Unsupported attribute type: \" + e + \".\");\n            }\n          }, t;\n        }(Ue.a), kf = f(74), No = function() {\n          function r() {\n          }\n          return r.COPY = 1, r.CUT = 2, r.PASTE = 3, r;\n        }(), Gf = function() {\n          function r(t, e) {\n            this.type = t, this.event = e;\n          }\n          return r.GetTypeFromCharacter = function(t) {\n            switch (t) {\n              case 67:\n                return No.COPY;\n              case 86:\n                return No.PASTE;\n              case 88:\n                return No.CUT;\n              default:\n                return -1;\n            }\n          }, r;\n        }(), fs = f(83), yi = f(69);\n        (function(r) {\n          r[r.Clean = 0] = \"Clean\", r[r.Stop = 1] = \"Stop\", r[r.Sync = 2] = \"Sync\", r[r.NoSync = 3] = \"NoSync\";\n        })(vi || (vi = {}));\n        var Ft = function() {\n          function r() {\n          }\n          return Object.defineProperty(r, \"ForceFullSceneLoadingForIncremental\", { get: function() {\n            return yi.a.ForceFullSceneLoadingForIncremental;\n          }, set: function(t) {\n            yi.a.ForceFullSceneLoadingForIncremental = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r, \"ShowLoadingScreen\", { get: function() {\n            return yi.a.ShowLoadingScreen;\n          }, set: function(t) {\n            yi.a.ShowLoadingScreen = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r, \"loggingLevel\", { get: function() {\n            return yi.a.loggingLevel;\n          }, set: function(t) {\n            yi.a.loggingLevel = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r, \"CleanBoneMatrixWeights\", { get: function() {\n            return yi.a.CleanBoneMatrixWeights;\n          }, set: function(t) {\n            yi.a.CleanBoneMatrixWeights = t;\n          }, enumerable: !1, configurable: !0 }), r.GetDefaultPlugin = function() {\n            return r._registeredPlugins[\".babylon\"];\n          }, r._GetPluginForExtension = function(t) {\n            var e = r._registeredPlugins[t];\n            return e || (l.a.Warn(\"Unable to find a plugin to load \" + t + \" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/how_to/load_from_any_file_type\"), r.GetDefaultPlugin());\n          }, r._GetPluginForDirectLoad = function(t) {\n            for (var e in r._registeredPlugins) {\n              var n = r._registeredPlugins[e].plugin;\n              if (n.canDirectLoad && n.canDirectLoad(t))\n                return r._registeredPlugins[e];\n            }\n            return r.GetDefaultPlugin();\n          }, r._GetPluginForFilename = function(t) {\n            var e = t.indexOf(\"?\");\n            e !== -1 && (t = t.substring(0, e));\n            var n = t.lastIndexOf(\".\"), i = t.substring(n, t.length).toLowerCase();\n            return r._GetPluginForExtension(i);\n          }, r._GetDirectLoad = function(t) {\n            return t.substr(0, 5) === \"data:\" ? t.substr(5) : null;\n          }, r._LoadData = function(t, e, n, i, o, a, s) {\n            var d, p = r._GetDirectLoad(t.name), y = s ? r._GetPluginForExtension(s) : p ? r._GetPluginForDirectLoad(t.name) : r._GetPluginForFilename(t.name);\n            if (!(d = y.plugin.createPlugin !== void 0 ? y.plugin.createPlugin() : y.plugin))\n              throw \"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.\";\n            if (r.OnPluginActivatedObservable.notifyObservers(d), p) {\n              if (d.directLoad) {\n                var P = d.directLoad(e, p);\n                P.then ? P.then(function(Ae) {\n                  n(d, Ae);\n                }).catch(function(Ae) {\n                  o(\"Error in directLoad of _loadData: \" + Ae, Ae);\n                }) : n(d, P);\n              } else\n                n(d, p);\n              return d;\n            }\n            var R = y.isBinary, B = function(Ae, Ee) {\n              e.isDisposed ? o(\"Scene has been disposed\") : n(d, Ae, Ee);\n            }, F = null, z = !1, J = d.onDisposeObservable;\n            J && J.add(function() {\n              z = !0, F && (F.abort(), F = null), a();\n            });\n            var ie = function() {\n              if (!z) {\n                var Ae = function(Se, De) {\n                  B(Se, De ? De.responseURL : void 0);\n                }, Ee = function(Se) {\n                  o(Se.message, Se);\n                };\n                F = d.requestFile ? d.requestFile(e, t.url, Ae, i, R, Ee) : e._requestFile(t.url, Ae, i, !0, R, Ee);\n              }\n            }, se = t.file || fs.a.FilesToLoad[t.name.toLowerCase()];\n            if (t.rootUrl.indexOf(\"file:\") === -1 || t.rootUrl.indexOf(\"file:\") !== -1 && !se) {\n              var ce = e.getEngine(), ue = ce.enableOfflineSupport;\n              if (ue) {\n                for (var fe = !1, ve = 0, Te = e.disableOfflineSupportExceptionRules; ve < Te.length; ve++)\n                  if (Te[ve].test(t.url)) {\n                    fe = !0;\n                    break;\n                  }\n                ue = !fe;\n              }\n              ue && Ue.a.OfflineProviderFactory ? e.offlineProvider = Ue.a.OfflineProviderFactory(t.url, ie, ce.disableManifestCheck) : ie();\n            } else if (se) {\n              var Re = function(Ae) {\n                o(Ae.message, Ae);\n              };\n              F = d.readFile ? d.readFile(e, se, B, i, R, Re) : e._readFile(se, B, i, R, Re);\n            } else\n              o(\"Unable to find file named \" + t.name);\n            return d;\n          }, r._GetFileInfo = function(t, e) {\n            var n, i, o = null;\n            if (e)\n              if (e.name) {\n                var a = e;\n                n = t + a.name, i = a.name, o = a;\n              } else {\n                var s = e;\n                if (s.substr(0, 1) === \"/\")\n                  return Xe.b.Error(\"Wrong sceneFilename parameter\"), null;\n                n = t + s, i = s;\n              }\n            else\n              n = t, i = Xe.b.GetFilename(t), t = Xe.b.GetFolderPath(t);\n            return { url: n, rootUrl: t, name: i, file: o };\n          }, r.GetPluginForExtension = function(t) {\n            return r._GetPluginForExtension(t).plugin;\n          }, r.IsPluginForExtensionAvailable = function(t) {\n            return !!r._registeredPlugins[t];\n          }, r.RegisterPlugin = function(t) {\n            if (typeof t.extensions == \"string\") {\n              var e = t.extensions;\n              r._registeredPlugins[e.toLowerCase()] = { plugin: t, isBinary: !1 };\n            } else {\n              var n = t.extensions;\n              Object.keys(n).forEach(function(i) {\n                r._registeredPlugins[i.toLowerCase()] = { plugin: t, isBinary: n[i].isBinary };\n              });\n            }\n          }, r.ImportMesh = function(t, e, n, i, o, a, s, d) {\n            if (n === void 0 && (n = \"\"), i === void 0 && (i = te.a.LastCreatedScene), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null), !i)\n              return l.a.Error(\"No scene available to import mesh to\"), null;\n            var p = r._GetFileInfo(e, n);\n            if (!p)\n              return null;\n            var y = {};\n            i._addPendingData(y);\n            var P = function() {\n              i._removePendingData(y);\n            }, R = function(z, J) {\n              var ie = \"Unable to import meshes from \" + p.url + \": \" + z;\n              s ? s(i, ie, J) : l.a.Error(ie), P();\n            }, B = a ? function(z) {\n              try {\n                a(z);\n              } catch (J) {\n                R(\"Error in onProgress callback: \" + J, J);\n              }\n            } : void 0, F = function(z, J, ie, se, ce, ue, fe) {\n              if (i.importedMeshesFiles.push(p.url), o)\n                try {\n                  o(z, J, ie, se, ce, ue, fe);\n                } catch (ve) {\n                  R(\"Error in onSuccess callback: \" + ve, ve);\n                }\n              i._removePendingData(y);\n            };\n            return r._LoadData(p, i, function(z, J, ie) {\n              if (z.rewriteRootURL && (p.rootUrl = z.rewriteRootURL(p.rootUrl, ie)), z.importMesh) {\n                var se = z, ce = new Array(), ue = new Array(), fe = new Array();\n                if (!se.importMesh(t, i, J, p.rootUrl, ce, ue, fe, R))\n                  return;\n                i.loadingPluginName = z.name, F(ce, ue, fe, [], [], [], []);\n              } else\n                z.importMeshAsync(t, i, J, p.rootUrl, B, p.name).then(function(ve) {\n                  i.loadingPluginName = z.name, F(ve.meshes, ve.particleSystems, ve.skeletons, ve.animationGroups, ve.transformNodes, ve.geometries, ve.lights);\n                }).catch(function(ve) {\n                  R(ve.message, ve);\n                });\n            }, B, R, P, d);\n          }, r.ImportMeshAsync = function(t, e, n, i, o, a) {\n            return n === void 0 && (n = \"\"), i === void 0 && (i = te.a.LastCreatedScene), o === void 0 && (o = null), a === void 0 && (a = null), new Promise(function(s, d) {\n              r.ImportMesh(t, e, n, i, function(p, y, P, R, B, F, z) {\n                s({ meshes: p, particleSystems: y, skeletons: P, animationGroups: R, transformNodes: B, geometries: F, lights: z });\n              }, o, function(p, y, P) {\n                d(P || new Error(y));\n              }, a);\n            });\n          }, r.Load = function(t, e, n, i, o, a, s) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedEngine), i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), n ? r.Append(t, e, new _e.a(n), i, o, a, s) : (Xe.b.Error(\"No engine available\"), null);\n          }, r.LoadAsync = function(t, e, n, i, o) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedEngine), i === void 0 && (i = null), o === void 0 && (o = null), new Promise(function(a, s) {\n              r.Load(t, e, n, function(d) {\n                a(d);\n              }, i, function(d, p, y) {\n                s(y || new Error(p));\n              }, o);\n            });\n          }, r.Append = function(t, e, n, i, o, a, s) {\n            var d = this;\n            if (e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), !n)\n              return l.a.Error(\"No scene available to append to\"), null;\n            var p = r._GetFileInfo(t, e);\n            if (!p)\n              return null;\n            r.ShowLoadingScreen && !this._showingLoadingScreen && (this._showingLoadingScreen = !0, n.getEngine().displayLoadingUI(), n.executeWhenReady(function() {\n              n.getEngine().hideLoadingUI(), d._showingLoadingScreen = !1;\n            }));\n            var y = {};\n            n._addPendingData(y);\n            var P = function() {\n              n._removePendingData(y);\n            }, R = function(z, J) {\n              var ie = \"Unable to load from \" + p.url + (z ? \": \" + z : \"\");\n              a ? a(n, ie, J) : l.a.Error(ie), P();\n            }, B = o ? function(z) {\n              try {\n                o(z);\n              } catch (J) {\n                R(\"Error in onProgress callback\", J);\n              }\n            } : void 0, F = function() {\n              if (i)\n                try {\n                  i(n);\n                } catch (z) {\n                  R(\"Error in onSuccess callback\", z);\n                }\n              n._removePendingData(y);\n            };\n            return r._LoadData(p, n, function(z, J) {\n              if (z.load) {\n                if (!z.load(n, J, p.rootUrl, R))\n                  return;\n                n.loadingPluginName = z.name, F();\n              } else\n                z.loadAsync(n, J, p.rootUrl, B, p.name).then(function() {\n                  n.loadingPluginName = z.name, F();\n                }).catch(function(ie) {\n                  R(ie.message, ie);\n                });\n            }, B, R, P, s);\n          }, r.AppendAsync = function(t, e, n, i, o) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), new Promise(function(a, s) {\n              r.Append(t, e, n, function(d) {\n                a(d);\n              }, i, function(d, p, y) {\n                s(y || new Error(p));\n              }, o);\n            });\n          }, r.LoadAssetContainer = function(t, e, n, i, o, a, s) {\n            if (e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), !n)\n              return l.a.Error(\"No scene available to load asset container to\"), null;\n            var d = r._GetFileInfo(t, e);\n            if (!d)\n              return null;\n            var p = {};\n            n._addPendingData(p);\n            var y = function() {\n              n._removePendingData(p);\n            }, P = function(F, z) {\n              var J = \"Unable to load assets from \" + d.url + (F ? \": \" + F : \"\");\n              z && z.message && (J += \" (\" + z.message + \")\"), a ? a(n, J, z) : l.a.Error(J), y();\n            }, R = o ? function(F) {\n              try {\n                o(F);\n              } catch (z) {\n                P(\"Error in onProgress callback\", z);\n              }\n            } : void 0, B = function(F) {\n              if (i)\n                try {\n                  i(F);\n                } catch (z) {\n                  P(\"Error in onSuccess callback\", z);\n                }\n              n._removePendingData(p);\n            };\n            return r._LoadData(d, n, function(F, z) {\n              if (F.loadAssetContainer) {\n                var J = F.loadAssetContainer(n, z, d.rootUrl, P);\n                if (!J)\n                  return;\n                n.loadingPluginName = F.name, B(J);\n              } else\n                F.loadAssetContainerAsync ? F.loadAssetContainerAsync(n, z, d.rootUrl, R, d.name).then(function(ie) {\n                  n.loadingPluginName = F.name, B(ie);\n                }).catch(function(ie) {\n                  P(ie.message, ie);\n                }) : P(\"LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.\");\n            }, R, P, y, s);\n          }, r.LoadAssetContainerAsync = function(t, e, n, i, o) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), new Promise(function(a, s) {\n              r.LoadAssetContainer(t, e, n, function(d) {\n                a(d);\n              }, i, function(d, p, y) {\n                s(y || new Error(p));\n              }, o);\n            });\n          }, r.ImportAnimations = function(t, e, n, i, o, a, s, d, p, y) {\n            if (e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = !0), o === void 0 && (o = vi.Clean), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null), p === void 0 && (p = null), y === void 0 && (y = null), n) {\n              if (i) {\n                for (var P = 0, R = n.animatables; P < R.length; P++)\n                  R[P].reset();\n                n.stopAllAnimations(), n.animationGroups.slice().forEach(function(F) {\n                  F.dispose();\n                }), n.getNodes().forEach(function(F) {\n                  F.animations && (F.animations = []);\n                });\n              } else\n                switch (o) {\n                  case vi.Clean:\n                    n.animationGroups.slice().forEach(function(F) {\n                      F.dispose();\n                    });\n                    break;\n                  case vi.Stop:\n                    n.animationGroups.forEach(function(F) {\n                      F.stop();\n                    });\n                    break;\n                  case vi.Sync:\n                    n.animationGroups.forEach(function(F) {\n                      F.reset(), F.restart();\n                    });\n                    break;\n                  case vi.NoSync:\n                    break;\n                  default:\n                    return void l.a.Error(\"Unknown animation group loading mode value '\" + o + \"'\");\n                }\n              var B = n.animatables.length;\n              this.LoadAssetContainer(t, e, n, function(F) {\n                F.mergeAnimationsTo(n, n.animatables.slice(B), a), F.dispose(), n.onAnimationFileImportedObservable.notifyObservers(n), s && s(n);\n              }, d, p, y);\n            } else\n              l.a.Error(\"No scene available to load animations to\");\n          }, r.ImportAnimationsAsync = function(t, e, n, i, o, a, s, d, p, y) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = !0), o === void 0 && (o = vi.Clean), a === void 0 && (a = null), d === void 0 && (d = null), y === void 0 && (y = null), new Promise(function(P, R) {\n              r.ImportAnimations(t, e, n, i, o, a, function(B) {\n                P(B);\n              }, d, function(B, F, z) {\n                R(z || new Error(F));\n              }, y);\n            });\n          }, r.NO_LOGGING = h.a.SCENELOADER_NO_LOGGING, r.MINIMAL_LOGGING = h.a.SCENELOADER_MINIMAL_LOGGING, r.SUMMARY_LOGGING = h.a.SCENELOADER_SUMMARY_LOGGING, r.DETAILED_LOGGING = h.a.SCENELOADER_DETAILED_LOGGING, r.OnPluginActivatedObservable = new C.c(), r._registeredPlugins = {}, r._showingLoadingScreen = !1, r;\n        }(), ps = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.controllerType = Jn.DAYDREAM, n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              i._defaultModel = o[1], i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            if (e === 0) {\n              var o = this.onTriggerStateChangedObservable;\n              o && o.notifyObservers(n);\n            } else\n              l.a.Warn(\"Unrecognized Daydream button index: \" + e);\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/generic/\", t.MODEL_FILENAME = \"generic.babylon\", t.GAMEPAD_ID_PREFIX = \"Daydream\", t;\n        }(Ri);\n        xi._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.indexOf(ps.GAMEPAD_ID_PREFIX) === 0;\n        }, create: function(r) {\n          return new ps(r);\n        } });\n        var _s = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._buttonIndexToObservableNameMap = [\"onPadStateChangedObservable\", \"onTriggerStateChangedObservable\"], n.controllerType = Jn.GEAR_VR, n._calculatedPosition = new u.e(n.hand == \"left\" ? -0.15 : 0.15, -0.5, 0.25), n._disableTrackPosition(n._calculatedPosition), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              var a = new Ie.a(\"\", e);\n              o[1].parent = a, o[1].position.z = -0.15, i._defaultModel = a, i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            if (e < this._buttonIndexToObservableNameMap.length) {\n              var o = this[this._buttonIndexToObservableNameMap[e]];\n              o && o.notifyObservers(n);\n            }\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/generic/\", t.MODEL_FILENAME = \"generic.babylon\", t.GAMEPAD_ID_PREFIX = \"Gear VR\", t;\n        }(Ri);\n        xi._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.indexOf(_s.GAMEPAD_ID_PREFIX) === 0 || r.id.indexOf(\"Oculus Go\") !== -1 || r.id.indexOf(\"Vive Focus\") !== -1;\n        }, create: function(r) {\n          return new _s(r);\n        } });\n        var wo = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              i._defaultModel = o[1], i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            console.log(\"Button id: \" + e + \"state: \"), console.dir(n);\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/generic/\", t.MODEL_FILENAME = \"generic.babylon\", t;\n        }(Ri);\n        xi._DefaultControllerFactory = function(r) {\n          return new wo(r);\n        };\n        var ms = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.onSecondaryTriggerStateChangedObservable = new C.c(), n.onThumbRestChangedObservable = new C.c(), n.controllerType = Jn.OCULUS, n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i, o = this;\n            i = this.hand === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, Ft.ImportMesh(\"\", t._IsQuest ? t.QUEST_MODEL_BASE_URL : t.MODEL_BASE_URL, i, e, function(a) {\n              o._defaultModel = t._IsQuest ? a[0] : a[1], o.attachToMesh(o._defaultModel), n && n(o._defaultModel);\n            });\n          }, Object.defineProperty(t.prototype, \"onAButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"right\")\n              return this.onMainButtonStateChangedObservable;\n            throw new Error(\"No A button on left hand\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onBButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"right\")\n              return this.onSecondaryButtonStateChangedObservable;\n            throw new Error(\"No B button on left hand\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onXButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"left\")\n              return this.onMainButtonStateChangedObservable;\n            throw new Error(\"No X button on right hand\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onYButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"left\")\n              return this.onSecondaryButtonStateChangedObservable;\n            throw new Error(\"No Y button on right hand\");\n          }, enumerable: !1, configurable: !0 }), t.prototype._handleButtonChange = function(e, n, i) {\n            var o = n, a = this.hand === \"right\" ? -1 : 1;\n            switch (e) {\n              case 0:\n                return void this.onPadStateChangedObservable.notifyObservers(o);\n              case 1:\n                return !t._IsQuest && this._defaultModel && (this._defaultModel.getChildren()[3].rotation.x = 0.2 * -o.value, this._defaultModel.getChildren()[3].position.y = 5e-3 * -o.value, this._defaultModel.getChildren()[3].position.z = 5e-3 * -o.value), void this.onTriggerStateChangedObservable.notifyObservers(o);\n              case 2:\n                return !t._IsQuest && this._defaultModel && (this._defaultModel.getChildren()[4].position.x = a * o.value * 35e-4), void this.onSecondaryTriggerStateChangedObservable.notifyObservers(o);\n              case 3:\n                return !t._IsQuest && this._defaultModel && (o.pressed ? this._defaultModel.getChildren()[1].position.y = -1e-3 : this._defaultModel.getChildren()[1].position.y = 0), void this.onMainButtonStateChangedObservable.notifyObservers(o);\n              case 4:\n                return !t._IsQuest && this._defaultModel && (o.pressed ? this._defaultModel.getChildren()[2].position.y = -1e-3 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(o);\n              case 5:\n                return void this.onThumbRestChangedObservable.notifyObservers(o);\n            }\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculus/\", t.MODEL_LEFT_FILENAME = \"left.babylon\", t.MODEL_RIGHT_FILENAME = \"right.babylon\", t.QUEST_MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculusQuest/\", t._IsQuest = !1, t;\n        }(Ri);\n        xi._ControllerFactories.push({ canCreate: function(r) {\n          return Ue.a.LastCreatedEngine && Ue.a.LastCreatedEngine._vrDisplay && Ue.a.LastCreatedEngine._vrDisplay.displayName === \"Oculus Quest\" && (ms._IsQuest = !0), r.id.indexOf(\"Oculus Touch\") !== -1;\n        }, create: function(r) {\n          return new ms(r);\n        } });\n        var Wl = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.controllerType = Jn.VIVE, n._invertLeftStickY = !0, n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              i._defaultModel = o[1], i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, Object.defineProperty(t.prototype, \"onLeftButtonStateChangedObservable\", { get: function() {\n            return this.onMainButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onRightButtonStateChangedObservable\", { get: function() {\n            return this.onMainButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onMenuButtonStateChangedObservable\", { get: function() {\n            return this.onSecondaryButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._handleButtonChange = function(e, n, i) {\n            var o = n;\n            switch (e) {\n              case 0:\n                return void this.onPadStateChangedObservable.notifyObservers(o);\n              case 1:\n                return this._defaultModel && (this._defaultModel.getChildren()[6].rotation.x = 0.15 * -o.value), void this.onTriggerStateChangedObservable.notifyObservers(o);\n              case 2:\n                return void this.onMainButtonStateChangedObservable.notifyObservers(o);\n              case 3:\n                return this._defaultModel && (o.pressed ? this._defaultModel.getChildren()[2].position.y = -1e-3 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(o);\n            }\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/vive/\", t.MODEL_FILENAME = \"wand.babylon\", t;\n        }(Ri);\n        xi._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.toLowerCase().indexOf(\"openvr\") !== -1;\n        }, create: function(r) {\n          return new Wl(r);\n        } });\n        var zf = function() {\n          this.buttonMeshes = {}, this.axisMeshes = {};\n        }, Fo = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._mapping = { buttons: [\"thumbstick\", \"trigger\", \"grip\", \"menu\", \"trackpad\"], buttonMeshNames: { trigger: \"SELECT\", menu: \"MENU\", grip: \"GRASP\", thumbstick: \"THUMBSTICK_PRESS\", trackpad: \"TOUCHPAD_PRESS\" }, buttonObservableNames: { trigger: \"onTriggerStateChangedObservable\", menu: \"onSecondaryButtonStateChangedObservable\", grip: \"onMainButtonStateChangedObservable\", thumbstick: \"onPadStateChangedObservable\", trackpad: \"onTrackpadChangedObservable\" }, axisMeshNames: [\"THUMBSTICK_X\", \"THUMBSTICK_Y\", \"TOUCHPAD_TOUCH_X\", \"TOUCHPAD_TOUCH_Y\"], pointingPoseMeshName: ar.POINTING_POSE }, n.onTrackpadChangedObservable = new C.c(), n.onTrackpadValuesChangedObservable = new C.c(), n.trackpad = { x: 0, y: 0 }, n.controllerType = Jn.WINDOWS, n._loadedMeshInfo = null, n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onTriggerButtonStateChangedObservable\", { get: function() {\n            return this.onTriggerStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onMenuButtonStateChangedObservable\", { get: function() {\n            return this.onSecondaryButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onGripButtonStateChangedObservable\", { get: function() {\n            return this.onMainButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onThumbstickButtonStateChangedObservable\", { get: function() {\n            return this.onPadStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onTouchpadButtonStateChangedObservable\", { get: function() {\n            return this.onTrackpadChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onTouchpadValuesChangedObservable\", { get: function() {\n            return this.onTrackpadValuesChangedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateTrackpad = function() {\n            !this.browserGamepad.axes || this.browserGamepad.axes[2] == this.trackpad.x && this.browserGamepad.axes[3] == this.trackpad.y || (this.trackpad.x = this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf(\"TOUCHPAD_TOUCH_X\")], this.trackpad.y = this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf(\"TOUCHPAD_TOUCH_Y\")], this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad));\n          }, t.prototype.update = function() {\n            if (r.prototype.update.call(this), this.browserGamepad.axes && (this._updateTrackpad(), this._loadedMeshInfo))\n              for (var e = 0; e < this._mapping.axisMeshNames.length; e++)\n                this._lerpAxisTransform(e, this.browserGamepad.axes[e]);\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            var o = this._mapping.buttons[e];\n            if (o) {\n              this._updateTrackpad();\n              var a = this[this._mapping.buttonObservableNames[o]];\n              a && a.notifyObservers(n), this._lerpButtonTransform(o, n.value);\n            }\n          }, t.prototype._lerpButtonTransform = function(e, n) {\n            if (this._loadedMeshInfo) {\n              var i = this._loadedMeshInfo.buttonMeshes[e];\n              i && i.unpressed.rotationQuaternion && i.pressed.rotationQuaternion && i.value.rotationQuaternion && (u.b.SlerpToRef(i.unpressed.rotationQuaternion, i.pressed.rotationQuaternion, n, i.value.rotationQuaternion), u.e.LerpToRef(i.unpressed.position, i.pressed.position, n, i.value.position));\n            }\n          }, t.prototype._lerpAxisTransform = function(e, n) {\n            if (this._loadedMeshInfo) {\n              var i = this._loadedMeshInfo.axisMeshes[e];\n              if (i && i.min.rotationQuaternion && i.max.rotationQuaternion && i.value.rotationQuaternion) {\n                var o = 0.5 * n + 0.5;\n                u.b.SlerpToRef(i.min.rotationQuaternion, i.max.rotationQuaternion, o, i.value.rotationQuaternion), u.e.LerpToRef(i.min.position, i.max.position, o, i.value.position);\n              }\n            }\n          }, t.prototype.initControllerMesh = function(e, n, i) {\n            var o, a, s = this;\n            if (i === void 0 && (i = !1), Ft.IsPluginForExtensionAvailable(\".glb\")) {\n              var d = \"default\";\n              if (this.id && !i) {\n                var p = this.id.match(t.GAMEPAD_ID_PATTERN);\n                d = p && p[0] || d;\n              }\n              a = this.hand === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, o = t.MODEL_BASE_URL + d + \"/\";\n            } else\n              l.a.Warn(\"You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models\"), o = wo.MODEL_BASE_URL, a = wo.MODEL_FILENAME;\n            Ft.ImportMesh(\"\", o, a, e, function(y) {\n              s._loadedMeshInfo = s.processModel(e, y), s._loadedMeshInfo && (s._defaultModel = s._loadedMeshInfo.rootNode, s.attachToMesh(s._defaultModel), n && n(s._defaultModel));\n            }, null, function(y, P) {\n              l.a.Log(P), l.a.Warn(\"Failed to retrieve controller model from the remote server: \" + o + a), i || s.initControllerMesh(y, n, !0);\n            });\n          }, t.prototype.processModel = function(e, n) {\n            for (var i = null, o = new Ie.a(this.id + \" \" + this.hand, e), a = null, s = 0; s < n.length; s++) {\n              var d = n[s];\n              if (!d.parent) {\n                d.isPickable = !1, a = d;\n                break;\n              }\n            }\n            return a ? (a.setParent(o), i = this.createMeshInfo(o)) : l.a.Warn(\"Could not find root node in model file.\"), i;\n          }, t.prototype.createMeshInfo = function(e) {\n            var n, i = new zf();\n            for (i.rootNode = e, i.buttonMeshes = {}, i.axisMeshes = {}, n = 0; n < this._mapping.buttons.length; n++) {\n              var o = this._mapping.buttonMeshNames[this._mapping.buttons[n]];\n              if (o) {\n                var a = P(e, o);\n                if (a) {\n                  var s = { index: n, value: R(a, \"VALUE\"), pressed: R(a, \"PRESSED\"), unpressed: R(a, \"UNPRESSED\") };\n                  s.value && s.pressed && s.unpressed ? i.buttonMeshes[this._mapping.buttons[n]] = s : l.a.Warn(\"Missing button submesh under mesh with name: \" + o + \"(VALUE: \" + !!s.value + \", PRESSED: \" + !!s.pressed + \", UNPRESSED:\" + !!s.unpressed + \")\");\n                } else\n                  l.a.Warn(\"Missing button mesh with name: \" + o);\n              } else\n                l.a.Log(\"Skipping unknown button at index: \" + n + \" with mapped name: \" + this._mapping.buttons[n]);\n            }\n            for (n = 0; n < this._mapping.axisMeshNames.length; n++) {\n              var d = this._mapping.axisMeshNames[n];\n              if (d) {\n                var p = P(e, d);\n                if (p) {\n                  var y = { index: n, value: R(p, \"VALUE\"), min: R(p, \"MIN\"), max: R(p, \"MAX\") };\n                  y.value && y.min && y.max ? i.axisMeshes[n] = y : l.a.Warn(\"Missing axis submesh under mesh with name: \" + d + \"(VALUE: \" + !!y.value + \", MIN: \" + !!y.min + \", MAX:\" + !!y.max + \")\");\n                } else\n                  l.a.Warn(\"Missing axis mesh with name: \" + d);\n              } else\n                l.a.Log(\"Skipping unknown axis at index: \" + n);\n            }\n            return i.pointingPoseNode = P(e, this._mapping.pointingPoseMeshName), i.pointingPoseNode ? this._pointingPoseNode = i.pointingPoseNode : l.a.Warn(\"Missing pointing pose mesh with name: \" + this._mapping.pointingPoseMeshName), i;\n            function P(B, F) {\n              return B.getChildren(function(z) {\n                return z.name === F;\n              }, !1)[0];\n            }\n            function R(B, F) {\n              return B.getChildren(function(z) {\n                return z.name == F;\n              }, !0)[0];\n            }\n          }, t.prototype.getForwardRay = function(e) {\n            if (e === void 0 && (e = 100), !this._loadedMeshInfo || !this._loadedMeshInfo.pointingPoseNode)\n              return r.prototype.getForwardRay.call(this, e);\n            var n = this._loadedMeshInfo.pointingPoseNode.getWorldMatrix(), i = n.getTranslation(), o = new u.e(0, 0, -1), a = u.e.TransformNormal(o, n), s = u.e.Normalize(a);\n            return new dn.a(i, s, e);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onTrackpadChangedObservable.clear(), this.onTrackpadValuesChangedObservable.clear();\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/microsoft/\", t.MODEL_LEFT_FILENAME = \"left.glb\", t.MODEL_RIGHT_FILENAME = \"right.glb\", t.GAMEPAD_ID_PREFIX = \"Spatial Controller (Spatial Interaction Source) \", t.GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/, t;\n        }(Ri), jf = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._mapping = { buttons: [\"trigger\", \"grip\", \"trackpad\", \"thumbstick\", \"menu\"], buttonMeshNames: { trigger: \"SELECT\", menu: \"MENU\", grip: \"GRASP\", thumbstick: \"THUMBSTICK_PRESS\", trackpad: \"TOUCHPAD_PRESS\" }, buttonObservableNames: { trigger: \"onTriggerStateChangedObservable\", menu: \"onSecondaryButtonStateChangedObservable\", grip: \"onMainButtonStateChangedObservable\", thumbstick: \"onThumbstickStateChangedObservable\", trackpad: \"onTrackpadChangedObservable\" }, axisMeshNames: [\"TOUCHPAD_TOUCH_X\", \"TOUCHPAD_TOUCH_Y\", \"THUMBSTICK_X\", \"THUMBSTICK_Y\"], pointingPoseMeshName: ar.POINTING_POSE }, n.thumbstickValues = { x: 0, y: 0 }, n.onThumbstickStateChangedObservable = new C.c(), n.onThumbstickValuesChangedObservable = new C.c(), n.onTrackpadChangedObservable = n.onPadStateChangedObservable, n.onTrackpadValuesChangedObservable = n.onPadValuesChangedObservable, n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onThumbstickButtonStateChangedObservable\", { get: function() {\n            return this.onThumbstickStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateTrackpad = function() {\n            !this.browserGamepad.axes || this.browserGamepad.axes[2] == this.thumbstickValues.x && this.browserGamepad.axes[3] == this.thumbstickValues.y || (this.trackpad.x = this.browserGamepad.axes[2], this.trackpad.y = this.browserGamepad.axes[3], this.onThumbstickValuesChangedObservable.notifyObservers(this.trackpad));\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onThumbstickStateChangedObservable.clear(), this.onThumbstickValuesChangedObservable.clear();\n          }, t;\n        }(Fo);\n        xi._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.indexOf(Fo.GAMEPAD_ID_PREFIX) === 0;\n        }, create: function(r) {\n          return new Fo(r);\n        } });\n        var Bo = f(75), fr = f(63), Ln = f(51), Cn = f(36), Kr = function(r) {\n          function t(e, n, i, o, a) {\n            var s, d, p, y, P, R, B;\n            n === void 0 && (n = I.a.Gray()), i === void 0 && (i = Cn.a.DefaultUtilityLayer), o === void 0 && (o = null), a === void 0 && (a = 1);\n            var F = r.call(this, i) || this;\n            F._pointerObserver = null, F.snapDistance = 0, F.onSnapObservable = new C.c(), F.uniformScaling = !1, F.sensitivity = 1, F._isEnabled = !0, F._parent = null, F._dragging = !1, F._tmpVector = new u.e(), F._tmpMatrix = new u.a(), F._tmpMatrix2 = new u.a(), F._parent = o, F._coloredMaterial = new Nt.a(\"\", i.utilityLayerScene), F._coloredMaterial.diffuseColor = n, F._coloredMaterial.specularColor = n.subtract(new I.a(0.1, 0.1, 0.1)), F._hoverMaterial = new Nt.a(\"\", i.utilityLayerScene), F._hoverMaterial.diffuseColor = I.a.Yellow(), F._disableMaterial = new Nt.a(\"\", i.utilityLayerScene), F._disableMaterial.diffuseColor = I.a.Gray(), F._disableMaterial.alpha = 0.4, F._gizmoMesh = new Ie.a(\"axis\", i.utilityLayerScene);\n            var z = F._createGizmoMesh(F._gizmoMesh, a), J = z.arrowMesh, ie = z.arrowTail, se = F._createGizmoMesh(F._gizmoMesh, a + 4, !0);\n            F._gizmoMesh.lookAt(F._rootMesh.position.add(e)), F._rootMesh.addChild(F._gizmoMesh), F._gizmoMesh.scaling.scaleInPlace(1 / 3);\n            var ce = J.position.clone(), ue = ie.position.clone(), fe = ie.scaling.clone(), ve = function(xe) {\n              var Le = xe * (3 / F._rootMesh.scaling.length()) * 6;\n              J.position.z += Le / 3.5, ie.scaling.y += Le, ie.position.z = J.position.z / 2;\n            }, Te = function() {\n              J.position.set(ce.x, ce.y, ce.z), ie.position.set(ue.x, ue.y, ue.z), ie.scaling.set(fe.x, fe.y, fe.z), F._dragging = !1;\n            };\n            F.dragBehavior = new fi.a({ dragAxis: e }), F.dragBehavior.moveAttached = !1, F._rootMesh.addBehavior(F.dragBehavior);\n            var Re = 0, Ae = new u.e(), Ee = { snapDistance: 0 };\n            F.dragBehavior.onDragObservable.add(function(xe) {\n              if (F.attachedNode) {\n                var Le = F.sensitivity * xe.dragDistance * (3 * F.scaleRatio / F._rootMesh.scaling.length()), Me = !1, we = 0;\n                F.uniformScaling ? (F.attachedNode.getWorldMatrix().decompose(Ae), Ae.normalize(), Ae.y < 0 && Ae.scaleInPlace(-1)) : Ae.copyFrom(e), F.snapDistance == 0 ? Ae.scaleToRef(Le, Ae) : (Re += Le, Math.abs(Re) > F.snapDistance ? (we = Math.floor(Math.abs(Re) / F.snapDistance), Re < 0 && (we *= -1), Re %= F.snapDistance, Ae.scaleToRef(F.snapDistance * we, Ae), Me = !0) : Ae.scaleInPlace(0)), u.a.ScalingToRef(1 + Ae.x, 1 + Ae.y, 1 + Ae.z, F._tmpMatrix2), F._tmpMatrix2.multiplyToRef(F.attachedNode.getWorldMatrix(), F._tmpMatrix), F._tmpMatrix.decompose(F._tmpVector), Math.abs(F._tmpVector.x) < 1e5 && Math.abs(F._tmpVector.y) < 1e5 && Math.abs(F._tmpVector.z) < 1e5 && F.attachedNode.getWorldMatrix().copyFrom(F._tmpMatrix), Me && (Ee.snapDistance = F.snapDistance * we, F.onSnapObservable.notifyObservers(Ee)), F._matrixChanged();\n              }\n            }), F.dragBehavior.onDragStartObservable.add(function() {\n              F._dragging = !0;\n            }), F.dragBehavior.onDragObservable.add(function(xe) {\n              return ve(xe.dragDistance);\n            }), F.dragBehavior.onDragEndObservable.add(Te), (p = (d = (s = o == null ? void 0 : o.uniformScaleGizmo) === null || s === void 0 ? void 0 : s.dragBehavior) === null || d === void 0 ? void 0 : d.onDragObservable) === null || p === void 0 || p.add(function(xe) {\n              return ve(xe.delta.y);\n            }), (R = (P = (y = o == null ? void 0 : o.uniformScaleGizmo) === null || y === void 0 ? void 0 : y.dragBehavior) === null || P === void 0 ? void 0 : P.onDragEndObservable) === null || R === void 0 || R.add(Te);\n            var Se = { gizmoMeshes: [J, ie], colliderMeshes: [se.arrowMesh, se.arrowTail], material: F._coloredMaterial, hoverMaterial: F._hoverMaterial, disableMaterial: F._disableMaterial, active: !1 };\n            (B = F._parent) === null || B === void 0 || B.addToAxisCache(F._gizmoMesh, Se), F._pointerObserver = i.utilityLayerScene.onPointerObservable.add(function(xe) {\n              var Le;\n              if (!F._customMeshSet && (F._isHovered = Se.colliderMeshes.indexOf((Le = xe == null ? void 0 : xe.pickInfo) === null || Le === void 0 ? void 0 : Le.pickedMesh) != -1, !F._parent)) {\n                var Me = F._isHovered || F._dragging ? F._hoverMaterial : F._coloredMaterial;\n                Se.gizmoMeshes.forEach(function(we) {\n                  we.material = Me, we.color && (we.color = Me.diffuseColor);\n                });\n              }\n            });\n            var De = i._getSharedGizmoLight();\n            return De.includedOnlyMeshes = De.includedOnlyMeshes.concat(F._rootMesh.getChildMeshes()), F;\n          }\n          return Object(c.d)(t, r), t.prototype._createGizmoMesh = function(e, n, i) {\n            i === void 0 && (i = !1);\n            var o = fr.a.CreateBox(\"yPosMesh\", { size: 0.4 * (1 + (n - 1) / 4) }, this.gizmoLayer.utilityLayerScene), a = ci.a.CreateCylinder(\"cylinder\", { diameterTop: 5e-3 * n, height: 0.275, diameterBottom: 5e-3 * n, tessellation: 96 }, this.gizmoLayer.utilityLayerScene);\n            return o.scaling.scaleInPlace(0.1), o.material = this._coloredMaterial, o.rotation.x = Math.PI / 2, o.position.z += 0.3, a.material = this._coloredMaterial, a.position.z += 0.1375, a.rotation.x = Math.PI / 2, i && (o.visibility = 0, a.visibility = 0), e.addChild(o), e.addChild(a), { arrowMesh: o, arrowTail: a };\n          }, t.prototype._attachedNodeChanged = function(e) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!e);\n          }, Object.defineProperty(t.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(e) {\n            this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);\n          }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(e) {\n              e && e.dispose();\n            }), r.prototype.dispose.call(this);\n          }, t.prototype.setCustomMesh = function(e, n) {\n            var i = this;\n            n === void 0 && (n = !1), r.prototype.setCustomMesh.call(this, e), n && (this._rootMesh.getChildMeshes().forEach(function(o) {\n              o.material = i._coloredMaterial, o.color && (o.color = i._coloredMaterial.diffuseColor);\n            }), this._customMeshSet = !1);\n          }, t;\n        }(Ln.a), Nn = f(45), sn = f(40), Xl = function(r) {\n          function t(e, n) {\n            e === void 0 && (e = I.a.Gray()), n === void 0 && (n = Cn.a.DefaultKeepDepthUtilityLayer);\n            var i = r.call(this, n) || this;\n            i._boundingDimensions = new u.e(1, 1, 1), i._renderObserver = null, i._pointerObserver = null, i._scaleDragSpeed = 0.2, i._tmpQuaternion = new u.b(), i._tmpVector = new u.e(0, 0, 0), i._tmpRotationMatrix = new u.a(), i.ignoreChildren = !1, i.includeChildPredicate = null, i.rotationSphereSize = 0.1, i.scaleBoxSize = 0.1, i.fixedDragMeshScreenSize = !1, i.fixedDragMeshBoundsSize = !1, i.fixedDragMeshScreenSizeDistanceFactor = 10, i.onDragStartObservable = new C.c(), i.onScaleBoxDragObservable = new C.c(), i.onScaleBoxDragEndObservable = new C.c(), i.onRotationSphereDragObservable = new C.c(), i.onRotationSphereDragEndObservable = new C.c(), i.scalePivot = null, i._existingMeshScale = new u.e(), i._dragMesh = null, i.pointerDragBehavior = new fi.a(), i.updateScale = !1, i._anchorMesh = new Mt.a(\"anchor\", n.utilityLayerScene), i.coloredMaterial = new Nt.a(\"\", n.utilityLayerScene), i.coloredMaterial.disableLighting = !0, i.hoverColoredMaterial = new Nt.a(\"\", n.utilityLayerScene), i.hoverColoredMaterial.disableLighting = !0, i._lineBoundingBox = new Mt.a(\"\", n.utilityLayerScene), i._lineBoundingBox.rotationQuaternion = new u.b();\n            var o = [];\n            o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, 0), new u.e(i._boundingDimensions.x, 0, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, 0), new u.e(0, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, 0), new u.e(0, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, 0, 0), new u.e(i._boundingDimensions.x, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, 0, 0), new u.e(i._boundingDimensions.x, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, i._boundingDimensions.y, 0), new u.e(i._boundingDimensions.x, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, i._boundingDimensions.y, 0), new u.e(0, i._boundingDimensions.y, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, i._boundingDimensions.z), new u.e(i._boundingDimensions.x, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, i._boundingDimensions.z), new u.e(0, i._boundingDimensions.y, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, i._boundingDimensions.y, i._boundingDimensions.z), new u.e(0, i._boundingDimensions.y, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, i._boundingDimensions.y, i._boundingDimensions.z), new u.e(i._boundingDimensions.x, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, i._boundingDimensions.y, i._boundingDimensions.z), new u.e(i._boundingDimensions.x, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.forEach(function(J) {\n              J.color = e, J.position.addInPlace(new u.e(-i._boundingDimensions.x / 2, -i._boundingDimensions.y / 2, -i._boundingDimensions.z / 2)), J.isPickable = !1, i._lineBoundingBox.addChild(J);\n            }), i._rootMesh.addChild(i._lineBoundingBox), i.setColor(e), i._rotateSpheresParent = new Mt.a(\"\", n.utilityLayerScene), i._rotateSpheresParent.rotationQuaternion = new u.b();\n            for (var a = function(J) {\n              var ie = Nn.a.CreateSphere(\"\", { diameter: 1 }, n.utilityLayerScene);\n              ie.rotationQuaternion = new u.b(), ie.material = s.coloredMaterial, (P = new fi.a({})).moveAttached = !1, P.updateDragPlane = !1, ie.addBehavior(P);\n              var se = new u.e(1, 0, 0), ce = 0;\n              P.onDragStartObservable.add(function() {\n                se.copyFrom(ie.forward), ce = 0;\n              }), P.onDragObservable.add(function(ue) {\n                if (i.onRotationSphereDragObservable.notifyObservers({}), i.attachedMesh) {\n                  var fe = i.attachedMesh.parent;\n                  if (fe && fe.scaling && fe.scaling.isNonUniformWithinEpsilon(1e-3))\n                    return void l.a.Warn(\"BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling\");\n                  Un.a._RemoveAndStorePivotPoint(i.attachedMesh);\n                  var ve = se, Te = ue.dragPlaneNormal.scale(u.e.Dot(ue.dragPlaneNormal, ve)), Re = ve.subtract(Te).normalizeToNew(), Ae = u.e.Dot(Re, ue.delta) < 0 ? Math.abs(ue.delta.length()) : -Math.abs(ue.delta.length());\n                  Ae = Ae / i._boundingDimensions.length() * i._anchorMesh.scaling.length(), i.attachedMesh.rotationQuaternion || (i.attachedMesh.rotationQuaternion = u.b.RotationYawPitchRoll(i.attachedMesh.rotation.y, i.attachedMesh.rotation.x, i.attachedMesh.rotation.z)), i._anchorMesh.rotationQuaternion || (i._anchorMesh.rotationQuaternion = u.b.RotationYawPitchRoll(i._anchorMesh.rotation.y, i._anchorMesh.rotation.x, i._anchorMesh.rotation.z)), ce += Ae, Math.abs(ce) <= 2 * Math.PI && (J >= 8 ? u.b.RotationYawPitchRollToRef(0, 0, Ae, i._tmpQuaternion) : J >= 4 ? u.b.RotationYawPitchRollToRef(Ae, 0, 0, i._tmpQuaternion) : u.b.RotationYawPitchRollToRef(0, Ae, 0, i._tmpQuaternion), i._anchorMesh.addChild(i.attachedMesh), i._anchorMesh.rotationQuaternion.multiplyToRef(i._tmpQuaternion, i._anchorMesh.rotationQuaternion), i._anchorMesh.removeChild(i.attachedMesh), i.attachedMesh.setParent(fe)), i.updateBoundingBox(), Un.a._RestorePivotPoint(i.attachedMesh);\n                }\n                i._updateDummy();\n              }), P.onDragStartObservable.add(function() {\n                i.onDragStartObservable.notifyObservers({}), i._selectNode(ie);\n              }), P.onDragEndObservable.add(function() {\n                i.onRotationSphereDragEndObservable.notifyObservers({}), i._selectNode(null), i._updateDummy();\n              }), s._rotateSpheresParent.addChild(ie);\n            }, s = this, d = 0; d < 12; d++)\n              a(d);\n            i._rootMesh.addChild(i._rotateSpheresParent), i._scaleBoxesParent = new Mt.a(\"\", n.utilityLayerScene), i._scaleBoxesParent.rotationQuaternion = new u.b();\n            for (var p = 0; p < 3; p++)\n              for (var y = 0; y < 3; y++)\n                for (var P, R = function() {\n                  var J = (p === 1 ? 1 : 0) + (y === 1 ? 1 : 0) + (F === 1 ? 1 : 0);\n                  if (J === 1 || J === 3)\n                    return \"continue\";\n                  var ie = fr.a.CreateBox(\"\", { size: 1 }, n.utilityLayerScene);\n                  ie.material = B.coloredMaterial, ie.metadata = J === 2;\n                  var se = new u.e(p - 1, y - 1, F - 1).normalize();\n                  (P = new fi.a({ dragAxis: se })).updateDragPlane = !1, P.moveAttached = !1, ie.addBehavior(P), P.onDragObservable.add(function(ce) {\n                    if (i.onScaleBoxDragObservable.notifyObservers({}), i.attachedMesh) {\n                      var ue = i.attachedMesh.parent;\n                      if (ue && ue.scaling && ue.scaling.isNonUniformWithinEpsilon(1e-3))\n                        return void l.a.Warn(\"BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling\");\n                      Un.a._RemoveAndStorePivotPoint(i.attachedMesh);\n                      var fe = ce.dragDistance / i._boundingDimensions.length() * i._anchorMesh.scaling.length(), ve = new u.e(fe, fe, fe);\n                      J === 2 && (ve.x *= Math.abs(se.x), ve.y *= Math.abs(se.y), ve.z *= Math.abs(se.z)), ve.scaleInPlace(i._scaleDragSpeed), i.updateBoundingBox(), i.scalePivot ? (i.attachedMesh.getWorldMatrix().getRotationMatrixToRef(i._tmpRotationMatrix), i._boundingDimensions.scaleToRef(0.5, i._tmpVector), u.e.TransformCoordinatesToRef(i._tmpVector, i._tmpRotationMatrix, i._tmpVector), i._anchorMesh.position.subtractInPlace(i._tmpVector), i._boundingDimensions.multiplyToRef(i.scalePivot, i._tmpVector), u.e.TransformCoordinatesToRef(i._tmpVector, i._tmpRotationMatrix, i._tmpVector), i._anchorMesh.position.addInPlace(i._tmpVector)) : (ie.absolutePosition.subtractToRef(i._anchorMesh.position, i._tmpVector), i._anchorMesh.position.subtractInPlace(i._tmpVector)), i._anchorMesh.addChild(i.attachedMesh), i._anchorMesh.scaling.addInPlace(ve), (i._anchorMesh.scaling.x < 0 || i._anchorMesh.scaling.y < 0 || i._anchorMesh.scaling.z < 0) && i._anchorMesh.scaling.subtractInPlace(ve), i._anchorMesh.removeChild(i.attachedMesh), i.attachedMesh.setParent(ue), Un.a._RestorePivotPoint(i.attachedMesh);\n                    }\n                    i._updateDummy();\n                  }), P.onDragStartObservable.add(function() {\n                    i.onDragStartObservable.notifyObservers({}), i._selectNode(ie);\n                  }), P.onDragEndObservable.add(function() {\n                    i.onScaleBoxDragEndObservable.notifyObservers({}), i._selectNode(null), i._updateDummy();\n                  }), B._scaleBoxesParent.addChild(ie);\n                }, B = this, F = 0; F < 3; F++)\n                  R();\n            i._rootMesh.addChild(i._scaleBoxesParent);\n            var z = new Array();\n            return i._pointerObserver = n.utilityLayerScene.onPointerObservable.add(function(J) {\n              z[J.event.pointerId] ? J.pickInfo && J.pickInfo.pickedMesh != z[J.event.pointerId] && (z[J.event.pointerId].material = i.coloredMaterial, delete z[J.event.pointerId]) : i._rotateSpheresParent.getChildMeshes().concat(i._scaleBoxesParent.getChildMeshes()).forEach(function(ie) {\n                J.pickInfo && J.pickInfo.pickedMesh == ie && (z[J.event.pointerId] = ie, ie.material = i.hoverColoredMaterial);\n              });\n            }), i._renderObserver = i.gizmoLayer.originalScene.onBeforeRenderObservable.add(function() {\n              i.attachedMesh && !i._existingMeshScale.equals(i.attachedMesh.scaling) ? i.updateBoundingBox() : (i.fixedDragMeshScreenSize || i.fixedDragMeshBoundsSize) && (i._updateRotationSpheres(), i._updateScaleBoxes()), i._dragMesh && i.attachedMesh && i.pointerDragBehavior.dragging && (i._lineBoundingBox.position.rotateByQuaternionToRef(i._rootMesh.rotationQuaternion, i._tmpVector), i.attachedMesh.setAbsolutePosition(i._dragMesh.position.add(i._tmpVector.scale(-1))));\n            }), i.updateBoundingBox(), i;\n          }\n          return Object(c.d)(t, r), t.prototype.setColor = function(e) {\n            this.coloredMaterial.emissiveColor = e, this.hoverColoredMaterial.emissiveColor = e.clone().add(new I.a(0.3, 0.3, 0.3)), this._lineBoundingBox.getChildren().forEach(function(n) {\n              n.color && (n.color = e);\n            });\n          }, t.prototype._attachedNodeChanged = function(e) {\n            var n = this;\n            if (e) {\n              Un.a._RemoveAndStorePivotPoint(e);\n              var i = e.parent;\n              this._anchorMesh.addChild(e), this._anchorMesh.removeChild(e), e.setParent(i), Un.a._RestorePivotPoint(e), this.updateBoundingBox(), e.getChildMeshes(!1).forEach(function(o) {\n                o.markAsDirty(\"scaling\");\n              }), this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(function() {\n                n._updateDummy();\n              });\n            }\n          }, t.prototype._selectNode = function(e) {\n            this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach(function(n) {\n              n.isVisible = !e || n == e;\n            });\n          }, t.prototype.updateBoundingBox = function() {\n            if (this.attachedMesh) {\n              Un.a._RemoveAndStorePivotPoint(this.attachedMesh);\n              var e = this.attachedMesh.parent;\n              this.attachedMesh.setParent(null);\n              var n = null;\n              this.attachedMesh.skeleton && (n = this.attachedMesh.skeleton.overrideMesh, this.attachedMesh.skeleton.overrideMesh = null), this._update(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = u.b.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = u.b.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpVector.copyFrom(this.attachedMesh.position), this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1), this.attachedMesh.position.set(0, 0, 0);\n              var i = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate);\n              i.max.subtractToRef(i.min, this._boundingDimensions), this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions), this._lineBoundingBox.position.set((i.max.x + i.min.x) / 2, (i.max.y + i.min.y) / 2, (i.max.z + i.min.z) / 2), this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position), this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position), this._lineBoundingBox.computeWorldMatrix(), this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition), this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion), this.attachedMesh.position.copyFrom(this._tmpVector), this.attachedMesh.setParent(e), this.attachedMesh.skeleton && (this.attachedMesh.skeleton.overrideMesh = n);\n            }\n            this._updateRotationSpheres(), this._updateScaleBoxes(), this.attachedMesh && (this._existingMeshScale.copyFrom(this.attachedMesh.scaling), Un.a._RestorePivotPoint(this.attachedMesh));\n          }, t.prototype._updateRotationSpheres = function() {\n            for (var e = this._rotateSpheresParent.getChildMeshes(), n = 0; n < 3; n++)\n              for (var i = 0; i < 2; i++)\n                for (var o = 0; o < 2; o++) {\n                  var a = 4 * n + 2 * i + o;\n                  if (n == 0 && (e[a].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * i, this._boundingDimensions.z * o), e[a].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[a].lookAt(u.e.Cross(e[a].position.normalizeToNew(), u.e.Right()).normalizeToNew().add(e[a].position))), n == 1 && (e[a].position.set(this._boundingDimensions.x * i, this._boundingDimensions.y / 2, this._boundingDimensions.z * o), e[a].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[a].lookAt(u.e.Cross(e[a].position.normalizeToNew(), u.e.Up()).normalizeToNew().add(e[a].position))), n == 2 && (e[a].position.set(this._boundingDimensions.x * i, this._boundingDimensions.y * o, this._boundingDimensions.z / 2), e[a].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[a].lookAt(u.e.Cross(e[a].position.normalizeToNew(), u.e.Forward()).normalizeToNew().add(e[a].position))), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {\n                    e[a].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);\n                    var s = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;\n                    e[a].scaling.set(s, s, s);\n                  } else\n                    this.fixedDragMeshBoundsSize ? e[a].scaling.set(this.rotationSphereSize * this._boundingDimensions.x, this.rotationSphereSize * this._boundingDimensions.y, this.rotationSphereSize * this._boundingDimensions.z) : e[a].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize);\n                }\n          }, t.prototype._updateScaleBoxes = function() {\n            for (var e = this._scaleBoxesParent.getChildMeshes(), n = 0, i = 0; i < 3; i++)\n              for (var o = 0; o < 3; o++)\n                for (var a = 0; a < 3; a++) {\n                  var s = (i === 1 ? 1 : 0) + (o === 1 ? 1 : 0) + (a === 1 ? 1 : 0);\n                  if (s !== 1 && s !== 3) {\n                    if (e[n])\n                      if (e[n].position.set(this._boundingDimensions.x * (i / 2), this._boundingDimensions.y * (o / 2), this._boundingDimensions.z * (a / 2)), e[n].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {\n                        e[n].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);\n                        var d = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;\n                        e[n].scaling.set(d, d, d);\n                      } else\n                        this.fixedDragMeshBoundsSize ? e[n].scaling.set(this.scaleBoxSize * this._boundingDimensions.x, this.scaleBoxSize * this._boundingDimensions.y, this.scaleBoxSize * this._boundingDimensions.z) : e[n].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize);\n                    n++;\n                  }\n                }\n          }, t.prototype.setEnabledRotationAxis = function(e) {\n            this._rotateSpheresParent.getChildMeshes().forEach(function(n, i) {\n              i < 4 ? n.setEnabled(e.indexOf(\"x\") != -1) : i < 8 ? n.setEnabled(e.indexOf(\"y\") != -1) : n.setEnabled(e.indexOf(\"z\") != -1);\n            });\n          }, t.prototype.setEnabledScaling = function(e, n) {\n            n === void 0 && (n = !1), this._scaleBoxesParent.getChildMeshes().forEach(function(i, o) {\n              var a = e;\n              n && i.metadata === !0 && (a = !1), i.setEnabled(a);\n            });\n          }, t.prototype._updateDummy = function() {\n            this._dragMesh && (this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()), this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling), this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion));\n          }, t.prototype.enableDragBehavior = function() {\n            this._dragMesh = Ie.a.CreateBox(\"dummy\", 1, this.gizmoLayer.utilityLayerScene), this._dragMesh.visibility = 0, this._dragMesh.rotationQuaternion = new u.b(), this.pointerDragBehavior.useObjectOrientationForDragging = !1, this._dragMesh.addBehavior(this.pointerDragBehavior);\n          }, t.prototype.dispose = function() {\n            this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver), this._lineBoundingBox.dispose(), this._rotateSpheresParent.dispose(), this._scaleBoxesParent.dispose(), this._dragMesh && this._dragMesh.dispose(), r.prototype.dispose.call(this);\n          }, t.MakeNotPickableAndWrapInBoundingBox = function(e) {\n            var n = function(d) {\n              d.isPickable = !1, d.getChildMeshes().forEach(function(p) {\n                n(p);\n              });\n            };\n            n(e), e.rotationQuaternion || (e.rotationQuaternion = u.b.RotationYawPitchRoll(e.rotation.y, e.rotation.x, e.rotation.z));\n            var i = e.position.clone(), o = e.rotationQuaternion.clone();\n            e.rotationQuaternion.set(0, 0, 0, 1), e.position.set(0, 0, 0);\n            var a = fr.a.CreateBox(\"box\", { size: 1 }, e.getScene()), s = e.getHierarchyBoundingVectors();\n            return s.max.subtractToRef(s.min, a.scaling), a.scaling.y === 0 && (a.scaling.y = Vt.a), a.scaling.x === 0 && (a.scaling.x = Vt.a), a.scaling.z === 0 && (a.scaling.z = Vt.a), a.position.set((s.max.x + s.min.x) / 2, (s.max.y + s.min.y) / 2, (s.max.z + s.min.z) / 2), e.addChild(a), e.rotationQuaternion.copyFrom(o), e.position.copyFrom(i), e.removeChild(a), a.addChild(e), a.visibility = 0, a;\n          }, t.prototype.setCustomMesh = function(e) {\n            l.a.Error(\"Custom meshes are not supported on this gizmo\");\n          }, t;\n        }(Ln.a), Uo = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p;\n            n === void 0 && (n = I.a.Gray()), i === void 0 && (i = Cn.a.DefaultUtilityLayer), o === void 0 && (o = 32), a === void 0 && (a = null), d === void 0 && (d = 1);\n            var y = r.call(this, i) || this;\n            y._pointerObserver = null, y.snapDistance = 0, y.onSnapObservable = new C.c(), y._isEnabled = !0, y._parent = null, y._dragging = !1, y._parent = a, y._coloredMaterial = new Nt.a(\"\", i.utilityLayerScene), y._coloredMaterial.diffuseColor = n, y._coloredMaterial.specularColor = n.subtract(new I.a(0.1, 0.1, 0.1)), y._hoverMaterial = new Nt.a(\"\", i.utilityLayerScene), y._hoverMaterial.diffuseColor = I.a.Yellow(), y._disableMaterial = new Nt.a(\"\", i.utilityLayerScene), y._disableMaterial.diffuseColor = I.a.Gray(), y._disableMaterial.alpha = 0.4, y._gizmoMesh = new Ie.a(\"\", i.utilityLayerScene);\n            var P = y._createGizmoMesh(y._gizmoMesh, d, o), R = P.rotationMesh, B = P.collider, F = [];\n            y._rotationCircle = y.setupRotationCircle(F, y._gizmoMesh), y._gizmoMesh.lookAt(y._rootMesh.position.add(e)), y._rootMesh.addChild(y._gizmoMesh), y._gizmoMesh.scaling.scaleInPlace(1 / 3), y.dragBehavior = new fi.a({ dragPlaneNormal: e }), y.dragBehavior.moveAttached = !1, y.dragBehavior.maxDragAngle = 9 * Math.PI / 20, y.dragBehavior._useAlternatePickedPointAboveMaxDragAngle = !0, y._rootMesh.addBehavior(y.dragBehavior);\n            var z = 0, J = new u.e(), ie = new u.e(), se = new u.a(), ce = new u.e(), ue = new u.e();\n            y.dragBehavior.onDragStartObservable.add(function(Se) {\n              if (y.attachedNode) {\n                J.copyFrom(Se.dragPlanePoint);\n                var De = new u.e(0, 0, 1), xe = y._rotationCircle.getDirection(De);\n                xe.normalize(), y._gizmoMesh.removeChild(y._rotationCircle), J.copyFrom(Se.dragPlanePoint), ie = Se.dragPlanePoint;\n                var Le = y._rotationCircle.getAbsolutePosition().clone(), Me = y._rotationCircle.getAbsolutePosition().clone().addInPlace(xe), we = Se.dragPlanePoint, Ye = u.e.GetAngleBetweenVectors(Me.subtract(Le), we.subtract(Le), y._rotationCircle.up);\n                y._rotationCircle.addRotation(0, Ye, 0), y._dragging = !0;\n              }\n            }), y.dragBehavior.onDragEndObservable.add(function() {\n              z = 0, y.updateRotationCircle(y._rotationCircle, F, z, ie), y._gizmoMesh.addChild(y._rotationCircle), y._dragging = !1;\n            });\n            var fe = { snapDistance: 0 }, ve = 0, Te = new u.a(), Re = new u.b();\n            y.dragBehavior.onDragObservable.add(function(Se) {\n              if (y.attachedNode) {\n                var De = new u.e(1, 1, 1), xe = new u.b(0, 0, 0, 1), Le = new u.e(0, 0, 0);\n                y.attachedNode.getWorldMatrix().decompose(De, xe, Le);\n                var Me = Se.dragPlanePoint.subtract(Le).normalize(), we = J.subtract(Le).normalize(), Ye = u.e.Cross(Me, we), et = u.e.Dot(Me, we), nt = Math.atan2(Ye.length(), et);\n                ce.copyFrom(e), ue.copyFrom(e), y.updateGizmoRotationToMatchAttachedMesh && (xe.toRotationMatrix(se), ue = u.e.TransformCoordinates(ce, se));\n                var ct = !1;\n                if (i.utilityLayerScene.activeCamera) {\n                  var Ke = i.utilityLayerScene.activeCamera.position.subtract(Le);\n                  u.e.Dot(Ke, ue) > 0 && (ce.scaleInPlace(-1), ue.scaleInPlace(-1), ct = !0);\n                }\n                u.e.Dot(ue, Ye) > 0 && (nt = -nt);\n                var rt = !1;\n                if (y.snapDistance != 0)\n                  if (ve += nt, Math.abs(ve) > y.snapDistance) {\n                    var it = Math.floor(Math.abs(ve) / y.snapDistance);\n                    ve < 0 && (it *= -1), ve %= y.snapDistance, nt = y.snapDistance * it, rt = !0;\n                  } else\n                    nt = 0;\n                z += ct ? -nt : nt, y.updateRotationCircle(y._rotationCircle, F, z, ie);\n                var qe = Math.sin(nt / 2);\n                if (Re.set(ce.x * qe, ce.y * qe, ce.z * qe, Math.cos(nt / 2)), Te.determinant() > 0) {\n                  var ut = new u.e();\n                  Re.toEulerAnglesToRef(ut), u.b.RotationYawPitchRollToRef(ut.y, -ut.x, -ut.z, Re);\n                }\n                y.updateGizmoRotationToMatchAttachedMesh ? xe.multiplyToRef(Re, xe) : Re.multiplyToRef(xe, xe), y.attachedNode.getWorldMatrix().copyFrom(u.a.Compose(De, xe, Le)), J.copyFrom(Se.dragPlanePoint), rt && (fe.snapDistance = nt, y.onSnapObservable.notifyObservers(fe)), y._matrixChanged();\n              }\n            });\n            var Ae = i._getSharedGizmoLight();\n            Ae.includedOnlyMeshes = Ae.includedOnlyMeshes.concat(y._rootMesh.getChildMeshes(!1));\n            var Ee = { colliderMeshes: [B], gizmoMeshes: [R], material: y._coloredMaterial, hoverMaterial: y._hoverMaterial, disableMaterial: y._disableMaterial, active: !1 };\n            return (p = y._parent) === null || p === void 0 || p.addToAxisCache(y._gizmoMesh, Ee), y._pointerObserver = i.utilityLayerScene.onPointerObservable.add(function(Se) {\n              var De;\n              if (!y._customMeshSet && (y._isHovered = Ee.colliderMeshes.indexOf((De = Se == null ? void 0 : Se.pickInfo) === null || De === void 0 ? void 0 : De.pickedMesh) != -1, !y._parent)) {\n                var xe = y._isHovered || y._dragging ? y._hoverMaterial : y._coloredMaterial;\n                Ee.gizmoMeshes.forEach(function(Le) {\n                  Le.material = xe, Le.color && (Le.color = xe.diffuseColor);\n                });\n              }\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype._createGizmoMesh = function(e, n, i) {\n            var o = Ie.a.CreateTorus(\"ignore\", 0.6, 0.03 * n, i, this.gizmoLayer.utilityLayerScene);\n            o.visibility = 0;\n            var a = Ie.a.CreateTorus(\"\", 0.6, 5e-3 * n, i, this.gizmoLayer.utilityLayerScene);\n            return a.material = this._coloredMaterial, a.rotation.x = Math.PI / 2, o.rotation.x = Math.PI / 2, e.addChild(a), e.addChild(o), { rotationMesh: a, collider: o };\n          }, t.prototype._attachedNodeChanged = function(e) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!e);\n          }, t.prototype.setupRotationCircle = function(e, n) {\n            for (var i = t._CircleConstants.pi2 / t._CircleConstants.tessellation, o = -Math.PI / 2; o < Math.PI / 2 - 1.5; o += i / 2) {\n              for (var a = [], s = 0; s < t._CircleConstants.pi2 * t._CircleConstants.rotationCircleRange + 0.01; s += i)\n                if (s < 0) {\n                  var d = t._CircleConstants.radius * Math.sin(s) * Math.cos(o), p = t._CircleConstants.radius * Math.cos(s) * Math.cos(o);\n                  a.push(new u.e(d, 0, p));\n                } else\n                  a.push(new u.e(0, 0, 0));\n              e.push(a);\n            }\n            var y = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene);\n            y.diffuseColor = I.a.Yellow(), y.backFaceCulling = !1;\n            var P = Ie.a.CreateRibbon(\"rotationCircle\", e, !1, !1, 0, this.gizmoLayer.utilityLayerScene, !0);\n            return P.material = y, P.material.alpha = 0.25, P.rotation.x = Math.PI / 2, n.addChild(P), P;\n          }, t.prototype.updateRotationPath = function(e, n) {\n            for (var i = t._CircleConstants.pi2 / t._CircleConstants.tessellation, o = 0, a = -Math.PI / 2; a < Math.PI / 2 - 1.5; a += i / 2) {\n              var s = e[o];\n              if (s)\n                for (var d = 0, p = 0; p < t._CircleConstants.pi2 * t._CircleConstants.rotationCircleRange + 0.01; p += i) {\n                  if (s[d])\n                    if (p < Math.abs(n)) {\n                      var y = n > 0 ? p : -1 * p, P = n > 0 ? a : -1 * a;\n                      s[d].set(t._CircleConstants.radius * Math.sin(y) * Math.cos(P), 0, t._CircleConstants.radius * Math.cos(y) * Math.cos(P));\n                    } else\n                      s[d].set(0, 0, 0);\n                  d++;\n                }\n              o++;\n            }\n          }, t.prototype.updateRotationCircle = function(e, n, i, o) {\n            this.updateRotationPath(n, i), Ie.a.CreateRibbon(\"rotationCircle\", n, !1, !1, 0, this.gizmoLayer.utilityLayerScene, void 0, void 0, e.geometry ? e : void 0);\n          }, Object.defineProperty(t.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(e) {\n            this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh) : this.attachedMesh = null;\n          }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), this._rotationCircle && this._rotationCircle.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(e) {\n              e && e.dispose();\n            }), r.prototype.dispose.call(this);\n          }, t._CircleConstants = { radius: 0.3, pi2: 2 * Math.PI, tessellation: 70, rotationCircleRange: 4 }, t;\n        }(Ln.a), Yl = function(r) {\n          function t(e, n, i, o, a) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer), n === void 0 && (n = 32), i === void 0 && (i = !1), o === void 0 && (o = 1);\n            var s = r.call(this, e) || this;\n            return s.onDragStartObservable = new C.c(), s.onDragEndObservable = new C.c(), s._observables = [], s._gizmoAxisCache = /* @__PURE__ */ new Map(), s.xGizmo = new Uo(new u.e(1, 0, 0), I.a.Red().scale(0.5), e, n, s, i, o), s.yGizmo = new Uo(new u.e(0, 1, 0), I.a.Green().scale(0.5), e, n, s, i, o), s.zGizmo = new Uo(new u.e(0, 0, 1), I.a.Blue().scale(0.5), e, n, s, i, o), [s.xGizmo, s.yGizmo, s.zGizmo].forEach(function(d) {\n              d.dragBehavior.onDragStartObservable.add(function() {\n                s.onDragStartObservable.notifyObservers({});\n              }), d.dragBehavior.onDragEndObservable.add(function() {\n                s.onDragEndObservable.notifyObservers({});\n              });\n            }), s.attachedMesh = null, s.attachedNode = null, a ? a.addToAxisCache(s._gizmoAxisCache) : Ln.a.GizmoAxisPointerObserver(e, s._gizmoAxisCache), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"attachedMesh\", { get: function() {\n            return this._meshAttached;\n          }, set: function(e) {\n            this._meshAttached = e, this._nodeAttached = e, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedMesh = e : n.attachedMesh = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"attachedNode\", { get: function() {\n            return this._nodeAttached;\n          }, set: function(e) {\n            this._meshAttached = null, this._nodeAttached = e, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedNode = e : n.attachedNode = null;\n            });\n          }, enumerable: !1, configurable: !0 }), t.prototype._checkBillboardTransform = function() {\n            this._nodeAttached && this._nodeAttached.billboardMode && console.log(\"Rotation Gizmo will not work with transforms in billboard mode.\");\n          }, Object.defineProperty(t.prototype, \"isHovered\", { get: function() {\n            var e = !1;\n            return [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              e = e || n.isHovered;\n            }), e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this.xGizmo.updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(e) {\n            this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapDistance\", { get: function() {\n            return this.xGizmo.snapDistance;\n          }, set: function(e) {\n            this.xGizmo && (this.xGizmo.snapDistance = e, this.yGizmo.snapDistance = e, this.zGizmo.snapDistance = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaleRatio\", { get: function() {\n            return this.xGizmo.scaleRatio;\n          }, set: function(e) {\n            this.xGizmo && (this.xGizmo.scaleRatio = e, this.yGizmo.scaleRatio = e, this.zGizmo.scaleRatio = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.addToAxisCache = function(e, n) {\n            this._gizmoAxisCache.set(e, n);\n          }, t.prototype.dispose = function() {\n            var e = this;\n            this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragEndObservable.clear(), this._observables.forEach(function(n) {\n              e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(n);\n            });\n          }, t.prototype.setCustomMesh = function(e) {\n            l.a.Error(\"Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)\");\n          }, t;\n        }(Ln.a), pr = f(46), gs = f(84), Vo = function(r) {\n          function t(e, n, i, o) {\n            var a;\n            n === void 0 && (n = I.a.Gray()), i === void 0 && (i = Cn.a.DefaultUtilityLayer), o === void 0 && (o = null);\n            var s = r.call(this, i) || this;\n            s._pointerObserver = null, s.snapDistance = 0, s.onSnapObservable = new C.c(), s._isEnabled = !1, s._parent = null, s._dragging = !1, s._parent = o, s._coloredMaterial = new Nt.a(\"\", i.utilityLayerScene), s._coloredMaterial.diffuseColor = n, s._coloredMaterial.specularColor = n.subtract(new I.a(0.1, 0.1, 0.1)), s._hoverMaterial = new Nt.a(\"\", i.utilityLayerScene), s._hoverMaterial.diffuseColor = I.a.Yellow(), s._disableMaterial = new Nt.a(\"\", i.utilityLayerScene), s._disableMaterial.diffuseColor = I.a.Gray(), s._disableMaterial.alpha = 0.4, s._gizmoMesh = t._CreatePlane(i.utilityLayerScene, s._coloredMaterial), s._gizmoMesh.lookAt(s._rootMesh.position.add(e)), s._gizmoMesh.scaling.scaleInPlace(1 / 3), s._gizmoMesh.parent = s._rootMesh;\n            var d = 0, p = new u.e(), y = { snapDistance: 0 };\n            s.dragBehavior = new fi.a({ dragPlaneNormal: e }), s.dragBehavior.moveAttached = !1, s._rootMesh.addBehavior(s.dragBehavior), s.dragBehavior.onDragObservable.add(function(B) {\n              if (s.attachedNode) {\n                if (s.snapDistance == 0)\n                  s.attachedNode.getWorldMatrix().addTranslationFromFloats(B.delta.x, B.delta.y, B.delta.z);\n                else if (d += B.dragDistance, Math.abs(d) > s.snapDistance) {\n                  var F = Math.floor(Math.abs(d) / s.snapDistance);\n                  d %= s.snapDistance, B.delta.normalizeToRef(p), p.scaleInPlace(s.snapDistance * F), s.attachedNode.getWorldMatrix().addTranslationFromFloats(p.x, p.y, p.z), y.snapDistance = s.snapDistance * F, s.onSnapObservable.notifyObservers(y);\n                }\n                s._matrixChanged();\n              }\n            }), s.dragBehavior.onDragStartObservable.add(function() {\n              s._dragging = !0;\n            }), s.dragBehavior.onDragEndObservable.add(function() {\n              s._dragging = !1;\n            });\n            var P = i._getSharedGizmoLight();\n            P.includedOnlyMeshes = P.includedOnlyMeshes.concat(s._rootMesh.getChildMeshes(!1));\n            var R = { gizmoMeshes: s._gizmoMesh.getChildMeshes(), colliderMeshes: s._gizmoMesh.getChildMeshes(), material: s._coloredMaterial, hoverMaterial: s._hoverMaterial, disableMaterial: s._disableMaterial, active: !1 };\n            return (a = s._parent) === null || a === void 0 || a.addToAxisCache(s._gizmoMesh, R), s._pointerObserver = i.utilityLayerScene.onPointerObservable.add(function(B) {\n              var F;\n              if (!s._customMeshSet && (s._isHovered = R.colliderMeshes.indexOf((F = B == null ? void 0 : B.pickInfo) === null || F === void 0 ? void 0 : F.pickedMesh) != -1, !s._parent)) {\n                var z = s._isHovered || s._dragging ? s._hoverMaterial : s._coloredMaterial;\n                R.gizmoMeshes.forEach(function(J) {\n                  J.material = z;\n                });\n              }\n            }), s;\n          }\n          return Object(c.d)(t, r), t._CreatePlane = function(e, n) {\n            var i = new pr.a(\"plane\", e), o = gs.a.CreatePlane(\"dragPlane\", { width: 0.1375, height: 0.1375, sideOrientation: 2 }, e);\n            return o.material = n, o.parent = i, i;\n          }, t.prototype._attachedNodeChanged = function(e) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!e);\n          }, Object.defineProperty(t.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(e) {\n            this._isEnabled = e, e ? this._parent && (this.attachedNode = this._parent.attachedNode) : this.attachedNode = null;\n          }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), r.prototype.dispose.call(this), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(e) {\n              e && e.dispose();\n            });\n          }, t;\n        }(Ln.a), Kl = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer), n === void 0 && (n = 1);\n            var o = r.call(this, e) || this;\n            return o._meshAttached = null, o._nodeAttached = null, o._observables = [], o._gizmoAxisCache = /* @__PURE__ */ new Map(), o.onDragStartObservable = new C.c(), o.onDragEndObservable = new C.c(), o._planarGizmoEnabled = !1, o.xGizmo = new Bo.a(new u.e(1, 0, 0), I.a.Red().scale(0.5), e, o, n), o.yGizmo = new Bo.a(new u.e(0, 1, 0), I.a.Green().scale(0.5), e, o, n), o.zGizmo = new Bo.a(new u.e(0, 0, 1), I.a.Blue().scale(0.5), e, o, n), o.xPlaneGizmo = new Vo(new u.e(1, 0, 0), I.a.Red().scale(0.5), o.gizmoLayer, o), o.yPlaneGizmo = new Vo(new u.e(0, 1, 0), I.a.Green().scale(0.5), o.gizmoLayer, o), o.zPlaneGizmo = new Vo(new u.e(0, 0, 1), I.a.Blue().scale(0.5), o.gizmoLayer, o), [o.xGizmo, o.yGizmo, o.zGizmo, o.xPlaneGizmo, o.yPlaneGizmo, o.zPlaneGizmo].forEach(function(a) {\n              a.dragBehavior.onDragStartObservable.add(function() {\n                o.onDragStartObservable.notifyObservers({});\n              }), a.dragBehavior.onDragEndObservable.add(function() {\n                o.onDragEndObservable.notifyObservers({});\n              });\n            }), o.attachedMesh = null, i ? i.addToAxisCache(o._gizmoAxisCache) : Ln.a.GizmoAxisPointerObserver(e, o._gizmoAxisCache), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"attachedMesh\", { get: function() {\n            return this._meshAttached;\n          }, set: function(e) {\n            this._meshAttached = e, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedMesh = e : n.attachedMesh = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"attachedNode\", { get: function() {\n            return this._nodeAttached;\n          }, set: function(e) {\n            this._meshAttached = null, this._nodeAttached = null, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedNode = e : n.attachedNode = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isHovered\", { get: function() {\n            var e = !1;\n            return [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              e = e || n.isHovered;\n            }), e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"planarGizmoEnabled\", { get: function() {\n            return this._planarGizmoEnabled;\n          }, set: function(e) {\n            var n = this;\n            this._planarGizmoEnabled = e, [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(i) {\n              i && (i.isEnabled = e, e && (i.attachedMesh ? i.attachedMesh = n.attachedMesh : i.attachedNode = n.attachedNode));\n            }, this);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this._updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(e) {\n            this._updateGizmoRotationToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && (n.updateGizmoRotationToMatchAttachedMesh = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapDistance\", { get: function() {\n            return this._snapDistance;\n          }, set: function(e) {\n            this._snapDistance = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && (n.snapDistance = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaleRatio\", { get: function() {\n            return this._scaleRatio;\n          }, set: function(e) {\n            this._scaleRatio = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && (n.scaleRatio = e);\n            });\n          }, enumerable: !1, configurable: !0 }), t.prototype.addToAxisCache = function(e, n) {\n            this._gizmoAxisCache.set(e, n);\n          }, t.prototype.dispose = function() {\n            var e = this;\n            [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && n.dispose();\n            }), this._observables.forEach(function(n) {\n              e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(n);\n            }), this.onDragStartObservable.clear(), this.onDragEndObservable.clear();\n          }, t.prototype.setCustomMesh = function(e) {\n            l.a.Error(\"Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)\");\n          }, t;\n        }(Ln.a);\n        ht.a.CreatePolyhedron = function(r) {\n          var t = [];\n          t[0] = { vertex: [[0, 0, 1.732051], [1.632993, 0, -0.5773503], [-0.8164966, 1.414214, -0.5773503], [-0.8164966, -1.414214, -0.5773503]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 1], [1, 3, 2]] }, t[1] = { vertex: [[0, 0, 1.414214], [1.414214, 0, 0], [0, 1.414214, 0], [-1.414214, 0, 0], [0, -1.414214, 0], [0, 0, -1.414214]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [3, 5, 4]] }, t[2] = { vertex: [[0, 0, 1.070466], [0.7136442, 0, 0.7978784], [-0.3568221, 0.618034, 0.7978784], [-0.3568221, -0.618034, 0.7978784], [0.7978784, 0.618034, 0.3568221], [0.7978784, -0.618034, 0.3568221], [-0.9341724, 0.381966, 0.3568221], [0.1362939, 1, 0.3568221], [0.1362939, -1, 0.3568221], [-0.9341724, -0.381966, 0.3568221], [0.9341724, 0.381966, -0.3568221], [0.9341724, -0.381966, -0.3568221], [-0.7978784, 0.618034, -0.3568221], [-0.1362939, 1, -0.3568221], [-0.1362939, -1, -0.3568221], [-0.7978784, -0.618034, -0.3568221], [0.3568221, 0.618034, -0.7978784], [0.3568221, -0.618034, -0.7978784], [-0.7136442, 0, -0.7978784], [0, 0, -1.070466]], face: [[0, 1, 4, 7, 2], [0, 2, 6, 9, 3], [0, 3, 8, 5, 1], [1, 5, 11, 10, 4], [2, 7, 13, 12, 6], [3, 9, 15, 14, 8], [4, 10, 16, 13, 7], [5, 8, 14, 17, 11], [6, 12, 18, 15, 9], [10, 11, 17, 19, 16], [12, 13, 16, 19, 18], [14, 15, 18, 19, 17]] }, t[3] = { vertex: [[0, 0, 1.175571], [1.051462, 0, 0.5257311], [0.3249197, 1, 0.5257311], [-0.8506508, 0.618034, 0.5257311], [-0.8506508, -0.618034, 0.5257311], [0.3249197, -1, 0.5257311], [0.8506508, 0.618034, -0.5257311], [0.8506508, -0.618034, -0.5257311], [-0.3249197, 1, -0.5257311], [-1.051462, 0, -0.5257311], [-0.3249197, -1, -0.5257311], [0, 0, -1.175571]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 5, 7], [1, 7, 6], [1, 6, 2], [2, 6, 8], [2, 8, 3], [3, 8, 9], [3, 9, 4], [4, 9, 10], [4, 10, 5], [5, 10, 7], [6, 7, 11], [6, 11, 8], [7, 10, 11], [8, 11, 9], [9, 11, 10]] }, t[4] = { vertex: [[0, 0, 1.070722], [0.7148135, 0, 0.7971752], [-0.104682, 0.7071068, 0.7971752], [-0.6841528, 0.2071068, 0.7971752], [-0.104682, -0.7071068, 0.7971752], [0.6101315, 0.7071068, 0.5236279], [1.04156, 0.2071068, 0.1367736], [0.6101315, -0.7071068, 0.5236279], [-0.3574067, 1, 0.1367736], [-0.7888348, -0.5, 0.5236279], [-0.9368776, 0.5, 0.1367736], [-0.3574067, -1, 0.1367736], [0.3574067, 1, -0.1367736], [0.9368776, -0.5, -0.1367736], [0.7888348, 0.5, -0.5236279], [0.3574067, -1, -0.1367736], [-0.6101315, 0.7071068, -0.5236279], [-1.04156, -0.2071068, -0.1367736], [-0.6101315, -0.7071068, -0.5236279], [0.104682, 0.7071068, -0.7971752], [0.6841528, -0.2071068, -0.7971752], [0.104682, -0.7071068, -0.7971752], [-0.7148135, 0, -0.7971752], [0, 0, -1.070722]], face: [[0, 2, 3], [1, 6, 5], [4, 9, 11], [7, 15, 13], [8, 16, 10], [12, 14, 19], [17, 22, 18], [20, 21, 23], [0, 1, 5, 2], [0, 3, 9, 4], [0, 4, 7, 1], [1, 7, 13, 6], [2, 5, 12, 8], [2, 8, 10, 3], [3, 10, 17, 9], [4, 11, 15, 7], [5, 6, 14, 12], [6, 13, 20, 14], [8, 12, 19, 16], [9, 17, 18, 11], [10, 16, 22, 17], [11, 18, 21, 15], [13, 15, 21, 20], [14, 20, 23, 19], [16, 19, 23, 22], [18, 22, 23, 21]] }, t[5] = { vertex: [[0, 0, 1.322876], [1.309307, 0, 0.1889822], [-0.9819805, 0.8660254, 0.1889822], [0.1636634, -1.299038, 0.1889822], [0.3273268, 0.8660254, -0.9449112], [-0.8183171, -0.4330127, -0.9449112]], face: [[0, 3, 1], [2, 4, 5], [0, 1, 4, 2], [0, 2, 5, 3], [1, 3, 5, 4]] }, t[6] = { vertex: [[0, 0, 1.159953], [1.013464, 0, 0.5642542], [-0.3501431, 0.9510565, 0.5642542], [-0.7715208, -0.6571639, 0.5642542], [0.6633206, 0.9510565, -0.03144481], [0.8682979, -0.6571639, -0.3996071], [-1.121664, 0.2938926, -0.03144481], [-0.2348831, -1.063314, -0.3996071], [0.5181548, 0.2938926, -0.9953061], [-0.5850262, -0.112257, -0.9953061]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 9, 7], [5, 7, 9, 8], [0, 3, 7, 5, 1], [2, 4, 8, 9, 6]] }, t[7] = { vertex: [[0, 0, 1.118034], [0.8944272, 0, 0.6708204], [-0.2236068, 0.8660254, 0.6708204], [-0.7826238, -0.4330127, 0.6708204], [0.6708204, 0.8660254, 0.2236068], [1.006231, -0.4330127, -0.2236068], [-1.006231, 0.4330127, 0.2236068], [-0.6708204, -0.8660254, -0.2236068], [0.7826238, 0.4330127, -0.6708204], [0.2236068, -0.8660254, -0.6708204], [-0.8944272, 0, -0.6708204], [0, 0, -1.118034]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 10, 7], [5, 9, 11, 8], [7, 10, 11, 9], [0, 3, 7, 9, 5, 1], [2, 4, 8, 11, 10, 6]] }, t[8] = { vertex: [[-0.729665, 0.670121, 0.319155], [-0.655235, -0.29213, -0.754096], [-0.093922, -0.607123, 0.537818], [0.702196, 0.595691, 0.485187], [0.776626, -0.36656, -0.588064]], face: [[1, 4, 2], [0, 1, 2], [3, 0, 2], [4, 3, 2], [4, 1, 0, 3]] }, t[9] = { vertex: [[-0.868849, -0.100041, 0.61257], [-0.329458, 0.976099, 0.28078], [-0.26629, -0.013796, -0.477654], [-0.13392, -1.034115, 0.229829], [0.738834, 0.707117, -0.307018], [0.859683, -0.535264, -0.338508]], face: [[3, 0, 2], [5, 3, 2], [4, 5, 2], [1, 4, 2], [0, 1, 2], [0, 3, 5, 4, 1]] }, t[10] = { vertex: [[-0.610389, 0.243975, 0.531213], [-0.187812, -0.48795, -0.664016], [-0.187812, 0.9759, -0.664016], [0.187812, -0.9759, 0.664016], [0.798201, 0.243975, 0.132803]], face: [[1, 3, 0], [3, 4, 0], [3, 1, 4], [0, 2, 1], [0, 4, 2], [2, 4, 1]] }, t[11] = { vertex: [[-1.028778, 0.392027, -0.048786], [-0.640503, -0.646161, 0.621837], [-0.125162, -0.395663, -0.540059], [4683e-6, 0.888447, -0.651988], [0.125161, 0.395663, 0.540059], [0.632925, -0.791376, 0.433102], [1.031672, 0.157063, -0.354165]], face: [[3, 2, 0], [2, 1, 0], [2, 5, 1], [0, 4, 3], [0, 1, 4], [4, 1, 5], [2, 3, 6], [3, 4, 6], [5, 2, 6], [4, 5, 6]] }, t[12] = { vertex: [[-0.669867, 0.334933, -0.529576], [-0.669867, 0.334933, 0.529577], [-0.4043, 1.212901, 0], [-0.334933, -0.669867, -0.529576], [-0.334933, -0.669867, 0.529577], [0.334933, 0.669867, -0.529576], [0.334933, 0.669867, 0.529577], [0.4043, -1.212901, 0], [0.669867, -0.334933, -0.529576], [0.669867, -0.334933, 0.529577]], face: [[8, 9, 7], [6, 5, 2], [3, 8, 7], [5, 0, 2], [4, 3, 7], [0, 1, 2], [9, 4, 7], [1, 6, 2], [9, 8, 5, 6], [8, 3, 0, 5], [3, 4, 1, 0], [4, 9, 6, 1]] }, t[13] = { vertex: [[-0.931836, 0.219976, -0.264632], [-0.636706, 0.318353, 0.692816], [-0.613483, -0.735083, -0.264632], [-0.326545, 0.979634, 0], [-0.318353, -0.636706, 0.692816], [-0.159176, 0.477529, -0.856368], [0.159176, -0.477529, -0.856368], [0.318353, 0.636706, 0.692816], [0.326545, -0.979634, 0], [0.613482, 0.735082, -0.264632], [0.636706, -0.318353, 0.692816], [0.931835, -0.219977, -0.264632]], face: [[11, 10, 8], [7, 9, 3], [6, 11, 8], [9, 5, 3], [2, 6, 8], [5, 0, 3], [4, 2, 8], [0, 1, 3], [10, 4, 8], [1, 7, 3], [10, 11, 9, 7], [11, 6, 5, 9], [6, 2, 0, 5], [2, 4, 1, 0], [4, 10, 7, 1]] }, t[14] = { vertex: [[-0.93465, 0.300459, -0.271185], [-0.838689, -0.260219, -0.516017], [-0.711319, 0.717591, 0.128359], [-0.710334, -0.156922, 0.080946], [-0.599799, 0.556003, -0.725148], [-0.503838, -4675e-6, -0.969981], [-0.487004, 0.26021, 0.48049], [-0.460089, -0.750282, -0.512622], [-0.376468, 0.973135, -0.325605], [-0.331735, -0.646985, 0.084342], [-0.254001, 0.831847, 0.530001], [-0.125239, -0.494738, -0.966586], [0.029622, 0.027949, 0.730817], [0.056536, -0.982543, -0.262295], [0.08085, 1.087391, 0.076037], [0.125583, -0.532729, 0.485984], [0.262625, 0.599586, 0.780328], [0.391387, -0.726999, -0.716259], [0.513854, -0.868287, 0.139347], [0.597475, 0.85513, 0.326364], [0.641224, 0.109523, 0.783723], [0.737185, -0.451155, 0.538891], [0.848705, -0.612742, -0.314616], [0.976075, 0.365067, 0.32976], [1.072036, -0.19561, 0.084927]], face: [[15, 18, 21], [12, 20, 16], [6, 10, 2], [3, 0, 1], [9, 7, 13], [2, 8, 4, 0], [0, 4, 5, 1], [1, 5, 11, 7], [7, 11, 17, 13], [13, 17, 22, 18], [18, 22, 24, 21], [21, 24, 23, 20], [20, 23, 19, 16], [16, 19, 14, 10], [10, 14, 8, 2], [15, 9, 13, 18], [12, 15, 21, 20], [6, 12, 16, 10], [3, 6, 2, 0], [9, 3, 1, 7], [9, 15, 12, 6, 3], [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]] };\n          var e, n, i, o, a, s, d = r.type && (r.type < 0 || r.type >= t.length) ? 0 : r.type || 0, p = r.size, y = r.sizeX || p || 1, P = r.sizeY || p || 1, R = r.sizeZ || p || 1, B = r.custom || t[d], F = B.face.length, z = r.faceUV || new Array(F), J = r.faceColors, ie = r.flat === void 0 || r.flat, se = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, ce = new Array(), ue = new Array(), fe = new Array(), ve = new Array(), Te = new Array(), Re = 0, Ae = 0, Ee = new Array(), Se = 0, De = 0;\n          if (ie)\n            for (De = 0; De < F; De++)\n              J && J[De] === void 0 && (J[De] = new I.b(1, 1, 1, 1)), z && z[De] === void 0 && (z[De] = new u.f(0, 0, 1, 1));\n          if (ie)\n            for (De = 0; De < F; De++) {\n              var xe = B.face[De].length;\n              for (i = 2 * Math.PI / xe, o = 0.5 * Math.tan(i / 2), a = 0.5, Se = 0; Se < xe; Se++)\n                ce.push(B.vertex[B.face[De][Se]][0] * y, B.vertex[B.face[De][Se]][1] * P, B.vertex[B.face[De][Se]][2] * R), Ee.push(Re), Re++, e = z[De].x + (z[De].z - z[De].x) * (0.5 + o), n = z[De].y + (z[De].w - z[De].y) * (a - 0.5), ve.push(e, n), s = o * Math.cos(i) - a * Math.sin(i), a = o * Math.sin(i) + a * Math.cos(i), o = s, J && Te.push(J[De].r, J[De].g, J[De].b, J[De].a);\n              for (Se = 0; Se < xe - 2; Se++)\n                ue.push(Ee[0 + Ae], Ee[Se + 2 + Ae], Ee[Se + 1 + Ae]);\n              Ae += xe;\n            }\n          else {\n            for (Se = 0; Se < B.vertex.length; Se++)\n              ce.push(B.vertex[Se][0] * y, B.vertex[Se][1] * P, B.vertex[Se][2] * R), ve.push(0, 0);\n            for (De = 0; De < F; De++)\n              for (Se = 0; Se < B.face[De].length - 2; Se++)\n                ue.push(B.face[De][0], B.face[De][Se + 2], B.face[De][Se + 1]);\n          }\n          ht.a.ComputeNormals(ce, ue, fe), ht.a._ComputeSides(se, ce, ue, fe, ve, r.frontUVs, r.backUVs);\n          var Le = new ht.a();\n          return Le.positions = ce, Le.indices = ue, Le.normals = fe, Le.uvs = ve, J && ie && (Le.colors = Te), Le;\n        }, Ie.a.CreatePolyhedron = function(r, t, e) {\n          return Qr.CreatePolyhedron(r, t, e);\n        };\n        var Qr = function() {\n          function r() {\n          }\n          return r.CreatePolyhedron = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreatePolyhedron(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }(), Ql = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer), n === void 0 && (n = 1);\n            var o = r.call(this, e) || this;\n            return o._meshAttached = null, o._nodeAttached = null, o._sensitivity = 1, o._observables = [], o._gizmoAxisCache = /* @__PURE__ */ new Map(), o.onDragStartObservable = new C.c(), o.onDragEndObservable = new C.c(), o.uniformScaleGizmo = o._createUniformScaleMesh(), o.xGizmo = new Kr(new u.e(1, 0, 0), I.a.Red().scale(0.5), e, o, n), o.yGizmo = new Kr(new u.e(0, 1, 0), I.a.Green().scale(0.5), e, o, n), o.zGizmo = new Kr(new u.e(0, 0, 1), I.a.Blue().scale(0.5), e, o, n), [o.xGizmo, o.yGizmo, o.zGizmo, o.uniformScaleGizmo].forEach(function(a) {\n              a.dragBehavior.onDragStartObservable.add(function() {\n                o.onDragStartObservable.notifyObservers({});\n              }), a.dragBehavior.onDragEndObservable.add(function() {\n                o.onDragEndObservable.notifyObservers({});\n              });\n            }), o.attachedMesh = null, o.attachedNode = null, i ? i.addToAxisCache(o._gizmoAxisCache) : Ln.a.GizmoAxisPointerObserver(e, o._gizmoAxisCache), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"attachedMesh\", { get: function() {\n            return this._meshAttached;\n          }, set: function(e) {\n            this._meshAttached = e, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedMesh = e : n.attachedMesh = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"attachedNode\", { get: function() {\n            return this._nodeAttached;\n          }, set: function(e) {\n            this._meshAttached = null, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedNode = e : n.attachedNode = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isHovered\", { get: function() {\n            var e = !1;\n            return [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              e = e || n.isHovered;\n            }), e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._createUniformScaleMesh = function() {\n            this._coloredMaterial = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = I.a.Gray(), this._hoverMaterial = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = I.a.Yellow(), this._disableMaterial = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = I.a.Gray(), this._disableMaterial.alpha = 0.4;\n            var e = new Kr(new u.e(0, 1, 0), I.a.Gray().scale(0.5), this.gizmoLayer, this);\n            e.updateGizmoRotationToMatchAttachedMesh = !1, e.uniformScaling = !0, this._uniformScalingMesh = Qr.CreatePolyhedron(\"uniform\", { type: 1 }, e.gizmoLayer.utilityLayerScene), this._uniformScalingMesh.scaling.scaleInPlace(0.01), this._uniformScalingMesh.visibility = 0, this._octahedron = Qr.CreatePolyhedron(\"\", { type: 1 }, e.gizmoLayer.utilityLayerScene), this._octahedron.scaling.scaleInPlace(7e-3), this._uniformScalingMesh.addChild(this._octahedron), e.setCustomMesh(this._uniformScalingMesh, !0);\n            var n = this.gizmoLayer._getSharedGizmoLight();\n            n.includedOnlyMeshes = n.includedOnlyMeshes.concat(this._octahedron);\n            var i = { gizmoMeshes: [this._octahedron, this._uniformScalingMesh], colliderMeshes: [this._uniformScalingMesh], material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1 };\n            return this.addToAxisCache(e._rootMesh, i), e;\n          }, Object.defineProperty(t.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this._updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(e) {\n            e ? (this._updateGizmoRotationToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.updateGizmoRotationToMatchAttachedMesh = e);\n            })) : l.a.Warn(\"Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapDistance\", { get: function() {\n            return this._snapDistance;\n          }, set: function(e) {\n            this._snapDistance = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.snapDistance = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaleRatio\", { get: function() {\n            return this._scaleRatio;\n          }, set: function(e) {\n            this._scaleRatio = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.scaleRatio = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sensitivity\", { get: function() {\n            return this._sensitivity;\n          }, set: function(e) {\n            this._sensitivity = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.sensitivity = e);\n            });\n          }, enumerable: !1, configurable: !0 }), t.prototype.addToAxisCache = function(e, n) {\n            this._gizmoAxisCache.set(e, n);\n          }, t.prototype.dispose = function() {\n            var e = this;\n            [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && n.dispose();\n            }), this._observables.forEach(function(n) {\n              e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(n);\n            }), this.onDragStartObservable.clear(), this.onDragEndObservable.clear(), [this._uniformScalingMesh, this._octahedron].forEach(function(n) {\n              n && n.dispose();\n            }), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(n) {\n              n && n.dispose();\n            });\n          }, t;\n        }(Ln.a), Hf = function() {\n          function r(t, e, n, i) {\n            e === void 0 && (e = 1), n === void 0 && (n = Cn.a.DefaultUtilityLayer), i === void 0 && (i = Cn.a.DefaultKeepDepthUtilityLayer), this.scene = t, this.clearGizmoOnEmptyPointerEvent = !1, this.onAttachedToMeshObservable = new C.c(), this.onAttachedToNodeObservable = new C.c(), this._gizmosEnabled = { positionGizmo: !1, rotationGizmo: !1, scaleGizmo: !1, boundingBoxGizmo: !1 }, this._pointerObservers = [], this._attachedMesh = null, this._attachedNode = null, this._boundingBoxColor = I.a.FromHexString(\"#0984e3\"), this._thickness = 1, this._gizmoAxisCache = /* @__PURE__ */ new Map(), this.boundingBoxDragBehavior = new Jc(), this.attachableMeshes = null, this.attachableNodes = null, this.usePointerToAttachGizmos = !0, this._defaultUtilityLayer = n, this._defaultKeepDepthUtilityLayer = i, this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, this._thickness = e, this.gizmos = { positionGizmo: null, rotationGizmo: null, scaleGizmo: null, boundingBoxGizmo: null };\n            var o = this._attachToMeshPointerObserver(t), a = Ln.a.GizmoAxisPointerObserver(this._defaultUtilityLayer, this._gizmoAxisCache);\n            this._pointerObservers = [o, a];\n          }\n          return Object.defineProperty(r.prototype, \"keepDepthUtilityLayer\", { get: function() {\n            return this._defaultKeepDepthUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"utilityLayer\", { get: function() {\n            return this._defaultUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isHovered\", { get: function() {\n            var t = !1;\n            for (var e in this.gizmos) {\n              var n = this.gizmos[e];\n              if (n && n.isHovered) {\n                t = !0;\n                break;\n              }\n            }\n            return t;\n          }, enumerable: !1, configurable: !0 }), r.prototype._attachToMeshPointerObserver = function(t) {\n            var e = this;\n            return t.onPointerObservable.add(function(n) {\n              if (e.usePointerToAttachGizmos && n.type == yt.a.POINTERDOWN)\n                if (n.pickInfo && n.pickInfo.pickedMesh) {\n                  var i = n.pickInfo.pickedMesh;\n                  if (e.attachableMeshes == null)\n                    for (; i && i.parent != null; )\n                      i = i.parent;\n                  else {\n                    var o = !1;\n                    e.attachableMeshes.forEach(function(a) {\n                      i && (i == a || i.isDescendantOf(a)) && (i = a, o = !0);\n                    }), o || (i = null);\n                  }\n                  i instanceof Mt.a ? e._attachedMesh != i && e.attachToMesh(i) : e.clearGizmoOnEmptyPointerEvent && e.attachToMesh(null);\n                } else\n                  e.clearGizmoOnEmptyPointerEvent && e.attachToMesh(null);\n            });\n          }, r.prototype.attachToMesh = function(t) {\n            for (var e in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = t, this._attachedNode = null, this.gizmos) {\n              var n = this.gizmos[e];\n              n && this._gizmosEnabled[e] && (n.attachedMesh = t);\n            }\n            this.boundingBoxGizmoEnabled && this._attachedMesh && this._attachedMesh.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToMeshObservable.notifyObservers(t);\n          }, r.prototype.attachToNode = function(t) {\n            for (var e in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = null, this._attachedNode = t, this.gizmos) {\n              var n = this.gizmos[e];\n              n && this._gizmosEnabled[e] && (n.attachedNode = t);\n            }\n            this.boundingBoxGizmoEnabled && this._attachedNode && this._attachedNode.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToNodeObservable.notifyObservers(t);\n          }, Object.defineProperty(r.prototype, \"positionGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.positionGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.positionGizmo || (this.gizmos.positionGizmo = new Kl(this._defaultUtilityLayer, this._thickness, this)), this._attachedNode ? this.gizmos.positionGizmo.attachedNode = this._attachedNode : this.gizmos.positionGizmo.attachedMesh = this._attachedMesh) : this.gizmos.positionGizmo && (this.gizmos.positionGizmo.attachedNode = null), this._gizmosEnabled.positionGizmo = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rotationGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.rotationGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.rotationGizmo || (this.gizmos.rotationGizmo = new Yl(this._defaultUtilityLayer, 32, !1, this._thickness, this)), this._attachedNode ? this.gizmos.rotationGizmo.attachedNode = this._attachedNode : this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh) : this.gizmos.rotationGizmo && (this.gizmos.rotationGizmo.attachedNode = null), this._gizmosEnabled.rotationGizmo = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"scaleGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.scaleGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new Ql(this._defaultUtilityLayer, this._thickness, this), this._attachedNode ? this.gizmos.scaleGizmo.attachedNode = this._attachedNode : this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh) : this.gizmos.scaleGizmo && (this.gizmos.scaleGizmo.attachedNode = null), this._gizmosEnabled.scaleGizmo = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"boundingBoxGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.boundingBoxGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new Xl(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer), this._attachedMesh ? this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh : this.gizmos.boundingBoxGizmo.attachedNode = this._attachedNode, this._attachedMesh ? (this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)) : this._attachedNode && (this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode.addBehavior(this.boundingBoxDragBehavior))) : this.gizmos.boundingBoxGizmo && (this._attachedMesh ? this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior) : this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this.gizmos.boundingBoxGizmo.attachedNode = null), this._gizmosEnabled.boundingBoxGizmo = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addToAxisCache = function(t) {\n            var e = this;\n            t.size > 0 && t.forEach(function(n, i) {\n              e._gizmoAxisCache.set(i, n);\n            });\n          }, r.prototype.dispose = function() {\n            var t = this;\n            for (var e in this._pointerObservers.forEach(function(i) {\n              t.scene.onPointerObservable.remove(i);\n            }), this.gizmos) {\n              var n = this.gizmos[e];\n              n && n.dispose();\n            }\n            this._defaultKeepDepthUtilityLayer.dispose(), this._defaultUtilityLayer.dispose(), this.boundingBoxDragBehavior.detach(), this.onAttachedToMeshObservable.clear();\n          }, r;\n        }(), bi = f(48), ko = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e._needProjectionMatrixCompute = !0, e;\n          }\n          return Object(c.d)(t, r), t.prototype._setPosition = function(e) {\n            this._position = e;\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(e) {\n            this._setPosition(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype._setDirection = function(e) {\n            this._direction = e;\n          }, Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._direction;\n          }, set: function(e) {\n            this._setDirection(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowMinZ\", { get: function() {\n            return this._shadowMinZ;\n          }, set: function(e) {\n            this._shadowMinZ = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowMaxZ\", { get: function() {\n            return this._shadowMaxZ;\n          }, set: function(e) {\n            this._shadowMaxZ = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), t.prototype.computeTransformedInformation = function() {\n            return !(!this.parent || !this.parent.getWorldMatrix) && (this.transformedPosition || (this.transformedPosition = u.e.Zero()), u.e.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition), this.direction && (this.transformedDirection || (this.transformedDirection = u.e.Zero()), u.e.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection)), !0);\n          }, t.prototype.getDepthScale = function() {\n            return 50;\n          }, t.prototype.getShadowDirection = function(e) {\n            return this.transformedDirection ? this.transformedDirection : this.direction;\n          }, t.prototype.getAbsolutePosition = function() {\n            return this.transformedPosition ? this.transformedPosition : this.position;\n          }, t.prototype.setDirectionToTarget = function(e) {\n            return this.direction = u.e.Normalize(e.subtract(this.position)), this.direction;\n          }, t.prototype.getRotation = function() {\n            this.direction.normalize();\n            var e = u.e.Cross(this.direction, be.a.Y), n = u.e.Cross(e, this.direction);\n            return u.e.RotationFromAxis(e, n, this.direction);\n          }, t.prototype.needCube = function() {\n            return !1;\n          }, t.prototype.needProjectionMatrixCompute = function() {\n            return this._needProjectionMatrixCompute;\n          }, t.prototype.forceProjectionMatrixCompute = function() {\n            this._needProjectionMatrixCompute = !0;\n          }, t.prototype._initCache = function() {\n            r.prototype._initCache.call(this), this._cache.position = u.e.Zero();\n          }, t.prototype._isSynchronized = function() {\n            return !!this._cache.position.equals(this.position);\n          }, t.prototype.computeWorldMatrix = function(e) {\n            return !e && this.isSynchronized() ? (this._currentRenderId = this.getScene().getRenderId(), this._worldMatrix) : (this._updateCache(), this._cache.position.copyFrom(this.position), this._worldMatrix || (this._worldMatrix = u.a.Identity()), u.a.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix), this.parent && this.parent.getWorldMatrix && (this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix), this._markSyncedWithParent()), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix);\n          }, t.prototype.getDepthMinZ = function(e) {\n            return this.shadowMinZ !== void 0 ? this.shadowMinZ : e.minZ;\n          }, t.prototype.getDepthMaxZ = function(e) {\n            return this.shadowMaxZ !== void 0 ? this.shadowMaxZ : e.maxZ;\n          }, t.prototype.setShadowProjectionMatrix = function(e, n, i) {\n            return this.customProjectionMatrixBuilder ? this.customProjectionMatrixBuilder(n, i, e) : this._setDefaultShadowProjectionMatrix(e, n, i), this;\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"position\", null), Object(c.c)([Object(L.o)()], t.prototype, \"direction\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowMinZ\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowMaxZ\", null), t;\n        }(bi.a);\n        Q.a.AddNodeConstructor(\"Light_Type_1\", function(r, t) {\n          return function() {\n            return new vs(r, u.e.Zero(), t);\n          };\n        });\n        var vs = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._shadowFrustumSize = 0, o._shadowOrthoScale = 0.1, o.autoUpdateExtends = !0, o.autoCalcShadowZBounds = !1, o._orthoLeft = Number.MAX_VALUE, o._orthoRight = Number.MIN_VALUE, o._orthoTop = Number.MIN_VALUE, o._orthoBottom = Number.MAX_VALUE, o.position = n.scale(-1), o.direction = n, o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"shadowFrustumSize\", { get: function() {\n            return this._shadowFrustumSize;\n          }, set: function(e) {\n            this._shadowFrustumSize = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowOrthoScale\", { get: function() {\n            return this._shadowOrthoScale;\n          }, set: function(e) {\n            this._shadowOrthoScale = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"DirectionalLight\";\n          }, t.prototype.getTypeID = function() {\n            return bi.a.LIGHTTYPEID_DIRECTIONALLIGHT;\n          }, t.prototype._setDefaultShadowProjectionMatrix = function(e, n, i) {\n            this.shadowFrustumSize > 0 ? this._setDefaultFixedFrustumShadowProjectionMatrix(e) : this._setDefaultAutoExtendShadowProjectionMatrix(e, n, i);\n          }, t.prototype._setDefaultFixedFrustumShadowProjectionMatrix = function(e) {\n            var n = this.getScene().activeCamera;\n            n && u.a.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== void 0 ? this.shadowMinZ : n.minZ, this.shadowMaxZ !== void 0 ? this.shadowMaxZ : n.maxZ, e);\n          }, t.prototype._setDefaultAutoExtendShadowProjectionMatrix = function(e, n, i) {\n            var o = this.getScene().activeCamera;\n            if (o) {\n              if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {\n                var a = u.e.Zero();\n                this._orthoLeft = Number.MAX_VALUE, this._orthoRight = Number.MIN_VALUE, this._orthoTop = Number.MIN_VALUE, this._orthoBottom = Number.MAX_VALUE;\n                for (var s = Number.MAX_VALUE, d = Number.MIN_VALUE, p = 0; p < i.length; p++) {\n                  var y = i[p];\n                  if (y)\n                    for (var P = y.getBoundingInfo().boundingBox, R = 0; R < P.vectorsWorld.length; R++)\n                      u.e.TransformCoordinatesToRef(P.vectorsWorld[R], n, a), a.x < this._orthoLeft && (this._orthoLeft = a.x), a.y < this._orthoBottom && (this._orthoBottom = a.y), a.x > this._orthoRight && (this._orthoRight = a.x), a.y > this._orthoTop && (this._orthoTop = a.y), this.autoCalcShadowZBounds && (a.z < s && (s = a.z), a.z > d && (d = a.z));\n                }\n                this.autoCalcShadowZBounds && (this._shadowMinZ = s, this._shadowMaxZ = d);\n              }\n              var B = this._orthoRight - this._orthoLeft, F = this._orthoTop - this._orthoBottom;\n              u.a.OrthoOffCenterLHToRef(this._orthoLeft - B * this.shadowOrthoScale, this._orthoRight + B * this.shadowOrthoScale, this._orthoBottom - F * this.shadowOrthoScale, this._orthoTop + F * this.shadowOrthoScale, this.shadowMinZ !== void 0 ? this.shadowMinZ : o.minZ, this.shadowMaxZ !== void 0 ? this.shadowMaxZ : o.maxZ, e);\n            }\n          }, t.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, t.prototype.transferToEffect = function(e, n) {\n            return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, n), this) : (this._uniformBuffer.updateFloat4(\"vLightData\", this.direction.x, this.direction.y, this.direction.z, 1, n), this);\n          }, t.prototype.transferToNodeMaterialEffect = function(e, n) {\n            return this.computeTransformedInformation() ? (e.setFloat3(n, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z), this) : (e.setFloat3(n, this.direction.x, this.direction.y, this.direction.z), this);\n          }, t.prototype.getDepthMinZ = function(e) {\n            return 1;\n          }, t.prototype.getDepthMaxZ = function(e) {\n            return 1;\n          }, t.prototype.prepareLightSpecificDefines = function(e, n) {\n            e[\"DIRLIGHT\" + n] = !0;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"shadowFrustumSize\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowOrthoScale\", null), Object(c.c)([Object(L.c)()], t.prototype, \"autoUpdateExtends\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"autoCalcShadowZBounds\", void 0), t;\n        }(ko);\n        Ie.a.CreateHemisphere = function(r, t, e, n) {\n          var i = { segments: t, diameter: e };\n          return Go.CreateHemisphere(r, i, n);\n        };\n        var Go = function() {\n          function r() {\n          }\n          return r.CreateHemisphere = function(t, e, n) {\n            e.diameter || (e.diameter = 1), e.segments || (e.segments = 16);\n            var i = Nn.a.CreateSphere(\"\", { slice: 0.5, diameter: e.diameter, segments: e.segments }, n), o = Ie.a.CreateDisc(\"\", e.diameter / 2, 3 * e.segments + (4 - e.segments), n);\n            o.rotation.x = -Math.PI / 2, o.parent = i;\n            var a = Ie.a.MergeMeshes([o, i], !0);\n            return a.name = t, a;\n          }, r;\n        }();\n        Q.a.AddNodeConstructor(\"Light_Type_2\", function(r, t) {\n          return function() {\n            return new ys(r, u.e.Zero(), u.e.Zero(), 0, 0, t);\n          };\n        });\n        var ys = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, s) || this;\n            return d._innerAngle = 0, d._projectionTextureMatrix = u.a.Zero(), d._projectionTextureLightNear = 1e-6, d._projectionTextureLightFar = 1e3, d._projectionTextureUpDirection = u.e.Up(), d._projectionTextureViewLightDirty = !0, d._projectionTextureProjectionLightDirty = !0, d._projectionTextureDirty = !0, d._projectionTextureViewTargetVector = u.e.Zero(), d._projectionTextureViewLightMatrix = u.a.Zero(), d._projectionTextureProjectionLightMatrix = u.a.Zero(), d._projectionTextureScalingMatrix = u.a.FromValues(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.5, 0, 0.5, 0.5, 0.5, 1), d.position = n, d.direction = i, d.angle = o, d.exponent = a, d;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"angle\", { get: function() {\n            return this._angle;\n          }, set: function(e) {\n            this._angle = e, this._cosHalfAngle = Math.cos(0.5 * e), this._projectionTextureProjectionLightDirty = !0, this.forceProjectionMatrixCompute(), this._computeAngleValues();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"innerAngle\", { get: function() {\n            return this._innerAngle;\n          }, set: function(e) {\n            this._innerAngle = e, this._computeAngleValues();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowAngleScale\", { get: function() {\n            return this._shadowAngleScale;\n          }, set: function(e) {\n            this._shadowAngleScale = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureMatrix\", { get: function() {\n            return this._projectionTextureMatrix;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureLightNear\", { get: function() {\n            return this._projectionTextureLightNear;\n          }, set: function(e) {\n            this._projectionTextureLightNear = e, this._projectionTextureProjectionLightDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureLightFar\", { get: function() {\n            return this._projectionTextureLightFar;\n          }, set: function(e) {\n            this._projectionTextureLightFar = e, this._projectionTextureProjectionLightDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureUpDirection\", { get: function() {\n            return this._projectionTextureUpDirection;\n          }, set: function(e) {\n            this._projectionTextureUpDirection = e, this._projectionTextureProjectionLightDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTexture\", { get: function() {\n            return this._projectionTexture;\n          }, set: function(e) {\n            var n = this;\n            this._projectionTexture !== e && (this._projectionTexture = e, this._projectionTextureDirty = !0, this._projectionTexture && !this._projectionTexture.isReady() && (t._IsProceduralTexture(this._projectionTexture) ? this._projectionTexture.getEffect().executeWhenCompiled(function() {\n              n._markMeshesAsLightDirty();\n            }) : t._IsTexture(this._projectionTexture) && this._projectionTexture.onLoadObservable.addOnce(function() {\n              n._markMeshesAsLightDirty();\n            })));\n          }, enumerable: !1, configurable: !0 }), t._IsProceduralTexture = function(e) {\n            return e.onGeneratedObservable !== void 0;\n          }, t._IsTexture = function(e) {\n            return e.onLoadObservable !== void 0;\n          }, t.prototype.getClassName = function() {\n            return \"SpotLight\";\n          }, t.prototype.getTypeID = function() {\n            return bi.a.LIGHTTYPEID_SPOTLIGHT;\n          }, t.prototype._setDirection = function(e) {\n            r.prototype._setDirection.call(this, e), this._projectionTextureViewLightDirty = !0;\n          }, t.prototype._setPosition = function(e) {\n            r.prototype._setPosition.call(this, e), this._projectionTextureViewLightDirty = !0;\n          }, t.prototype._setDefaultShadowProjectionMatrix = function(e, n, i) {\n            var o = this.getScene().activeCamera;\n            if (o) {\n              this._shadowAngleScale = this._shadowAngleScale || 1;\n              var a = this._shadowAngleScale * this._angle;\n              u.a.PerspectiveFovLHToRef(a, 1, this.getDepthMinZ(o), this.getDepthMaxZ(o), e);\n            }\n          }, t.prototype._computeProjectionTextureViewLightMatrix = function() {\n            this._projectionTextureViewLightDirty = !1, this._projectionTextureDirty = !0, this.position.addToRef(this.direction, this._projectionTextureViewTargetVector), u.a.LookAtLHToRef(this.position, this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);\n          }, t.prototype._computeProjectionTextureProjectionLightMatrix = function() {\n            this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;\n            var e = this.projectionTextureLightFar, n = this.projectionTextureLightNear, i = e / (e - n), o = -i * n, a = 1 / Math.tan(this._angle / 2);\n            u.a.FromValuesToRef(a / 1, 0, 0, 0, 0, a, 0, 0, 0, 0, i, 1, 0, 0, o, 0, this._projectionTextureProjectionLightMatrix);\n          }, t.prototype._computeProjectionTextureMatrix = function() {\n            if (this._projectionTextureDirty = !1, this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix), this._projectionTexture instanceof Ne.a) {\n              var e = this._projectionTexture.uScale / 2, n = this._projectionTexture.vScale / 2;\n              u.a.FromValuesToRef(e, 0, 0, 0, 0, n, 0, 0, 0, 0, 0.5, 0, 0.5, 0.5, 0.5, 1, this._projectionTextureScalingMatrix);\n            }\n            this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);\n          }, t.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"vLightDirection\", 3), this._uniformBuffer.addUniform(\"vLightFalloff\", 4), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, t.prototype._computeAngleValues = function() {\n            this._lightAngleScale = 1 / Math.max(1e-3, Math.cos(0.5 * this._innerAngle) - this._cosHalfAngle), this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;\n          }, t.prototype.transferTexturesToEffect = function(e, n) {\n            return this.projectionTexture && this.projectionTexture.isReady() && (this._projectionTextureViewLightDirty && this._computeProjectionTextureViewLightMatrix(), this._projectionTextureProjectionLightDirty && this._computeProjectionTextureProjectionLightMatrix(), this._projectionTextureDirty && this._computeProjectionTextureMatrix(), e.setMatrix(\"textureProjectionMatrix\" + n, this._projectionTextureMatrix), e.setTexture(\"projectionLightSampler\" + n, this.projectionTexture)), this;\n          }, t.prototype.transferToEffect = function(e, n) {\n            var i;\n            return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, n), i = u.e.Normalize(this.transformedDirection)) : (this._uniformBuffer.updateFloat4(\"vLightData\", this.position.x, this.position.y, this.position.z, this.exponent, n), i = u.e.Normalize(this.direction)), this._uniformBuffer.updateFloat4(\"vLightDirection\", i.x, i.y, i.z, this._cosHalfAngle, n), this._uniformBuffer.updateFloat4(\"vLightFalloff\", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, n), this;\n          }, t.prototype.transferToNodeMaterialEffect = function(e, n) {\n            var i;\n            return i = this.computeTransformedInformation() ? u.e.Normalize(this.transformedDirection) : u.e.Normalize(this.direction), this.getScene().useRightHandedSystem ? e.setFloat3(n, -i.x, -i.y, -i.z) : e.setFloat3(n, i.x, i.y, i.z), this;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._projectionTexture && this._projectionTexture.dispose();\n          }, t.prototype.prepareLightSpecificDefines = function(e, n) {\n            e[\"SPOTLIGHT\" + n] = !0, e[\"PROJECTEDLIGHTTEXTURE\" + n] = !(!this.projectionTexture || !this.projectionTexture.isReady());\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"angle\", null), Object(c.c)([Object(L.c)()], t.prototype, \"innerAngle\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowAngleScale\", null), Object(c.c)([Object(L.c)()], t.prototype, \"exponent\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"projectionTextureLightNear\", null), Object(c.c)([Object(L.c)()], t.prototype, \"projectionTextureLightFar\", null), Object(c.c)([Object(L.c)()], t.prototype, \"projectionTextureUpDirection\", null), Object(c.c)([Object(L.m)(\"projectedLightTexture\")], t.prototype, \"_projectionTexture\", void 0), t;\n        }(ko), Wf = function(r) {\n          function t(e) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer);\n            var n = r.call(this, e) || this;\n            return n._cachedPosition = new u.e(), n._cachedForward = new u.e(0, 0, 1), n._pointerObserver = null, n.onClickedObservable = new C.c(), n._light = null, n.attachedMesh = new Mt.a(\"\", n.gizmoLayer.utilityLayerScene), n._attachedMeshParent = new pr.a(\"parent\", n.gizmoLayer.utilityLayerScene), n.attachedMesh.parent = n._attachedMeshParent, n._material = new Nt.a(\"light\", n.gizmoLayer.utilityLayerScene), n._material.diffuseColor = new I.a(0.5, 0.5, 0.5), n._material.specularColor = new I.a(0.1, 0.1, 0.1), n._pointerObserver = e.utilityLayerScene.onPointerObservable.add(function(i) {\n              n._light && (n._isHovered = !(!i.pickInfo || n._rootMesh.getChildMeshes().indexOf(i.pickInfo.pickedMesh) == -1), n._isHovered && i.event.button === 0 && n.onClickedObservable.notifyObservers(n._light));\n            }, yt.a.POINTERDOWN), n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"light\", { get: function() {\n            return this._light;\n          }, set: function(e) {\n            var n = this;\n            if (this._light = e, e) {\n              this._lightMesh && this._lightMesh.dispose(), e instanceof Oo.a ? this._lightMesh = t._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene) : this._lightMesh = e instanceof vs ? t._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene) : e instanceof ys ? t._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene) : t._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene), this._lightMesh.getChildMeshes(!1).forEach(function(o) {\n                o.material = n._material;\n              }), this._lightMesh.parent = this._rootMesh;\n              var i = this.gizmoLayer._getSharedGizmoLight();\n              i.includedOnlyMeshes = i.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)), this._lightMesh.rotationQuaternion = new u.b(), this.attachedMesh.reservedDataStore || (this.attachedMesh.reservedDataStore = {}), this.attachedMesh.reservedDataStore.lightGizmo = this, e.parent && this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()), e.position && (this.attachedMesh.position.copyFrom(e.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position)), e.direction && (this.attachedMesh.setDirection(e.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(this.attachedMesh.forward)), this._update();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"material\", { get: function() {\n            return this._material;\n          }, enumerable: !1, configurable: !0 }), t.prototype._update = function() {\n            r.prototype._update.call(this), this._light && (this._light.parent && this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()), this._light.position && (this.attachedMesh.position.equals(this._cachedPosition) ? (this.attachedMesh.position.copyFrom(this._light.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position)) : (this._light.position.copyFrom(this.attachedMesh.position), this._cachedPosition.copyFrom(this.attachedMesh.position))), this._light.direction && (u.e.DistanceSquared(this.attachedMesh.forward, this._cachedForward) > 1e-4 ? (this._light.direction.copyFrom(this.attachedMesh.forward), this._cachedForward.copyFrom(this.attachedMesh.forward)) : u.e.DistanceSquared(this.attachedMesh.forward, this._light.direction) > 1e-4 && (this.attachedMesh.setDirection(this._light.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(this.attachedMesh.forward))));\n          }, t.prototype.dispose = function() {\n            this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._material.dispose(), r.prototype.dispose.call(this), this._attachedMeshParent.dispose();\n          }, t._CreateHemisphericLightMesh = function(e) {\n            var n = new Ie.a(\"hemisphereLight\", e), i = Go.CreateHemisphere(n.name, { segments: 10, diameter: 1 }, e);\n            i.position.z = -0.15, i.rotation.x = Math.PI / 2, i.parent = n;\n            var o = this._CreateLightLines(3, e);\n            return o.parent = n, o.position.z, n.scaling.scaleInPlace(t._Scale), n.rotation.x = Math.PI / 2, n;\n          }, t._CreatePointLightMesh = function(e) {\n            var n = new Ie.a(\"pointLight\", e), i = Nn.a.CreateSphere(n.name, { segments: 10, diameter: 1 }, e);\n            return i.rotation.x = Math.PI / 2, i.parent = n, this._CreateLightLines(5, e).parent = n, n.scaling.scaleInPlace(t._Scale), n.rotation.x = Math.PI / 2, n;\n          }, t._CreateSpotLightMesh = function(e) {\n            var n = new Ie.a(\"spotLight\", e);\n            Nn.a.CreateSphere(n.name, { segments: 10, diameter: 1 }, e).parent = n;\n            var i = Go.CreateHemisphere(n.name, { segments: 10, diameter: 2 }, e);\n            return i.parent = n, i.rotation.x = -Math.PI / 2, this._CreateLightLines(2, e).parent = n, n.scaling.scaleInPlace(t._Scale), n.rotation.x = Math.PI / 2, n;\n          }, t._CreateDirectionalLightMesh = function(e) {\n            var n = new Ie.a(\"directionalLight\", e), i = new Ie.a(n.name, e);\n            i.parent = n, Nn.a.CreateSphere(n.name, { diameter: 1.2, segments: 10 }, e).parent = i;\n            var o = Ie.a.CreateCylinder(n.name, 6, 0.3, 0.3, 6, 1, e);\n            o.parent = i, (a = o.clone(n.name)).scaling.y = 0.5, a.position.x += 1.25, (s = o.clone(n.name)).scaling.y = 0.5, s.position.x += -1.25;\n            var a, s, d = Ie.a.CreateCylinder(n.name, 1, 0, 0.6, 6, 1, e);\n            return d.position.y += 3, d.parent = i, (a = d.clone(n.name)).position.y = 1.5, a.position.x += 1.25, (s = d.clone(n.name)).position.y = 1.5, s.position.x += -1.25, i.scaling.scaleInPlace(t._Scale), i.rotation.z = Math.PI / 2, i.rotation.y = Math.PI / 2, n;\n          }, t._Scale = 7e-3, t._CreateLightLines = function(e, n) {\n            var i = new Ie.a(\"root\", n);\n            i.rotation.x = Math.PI / 2;\n            var o = new Ie.a(\"linePivot\", n);\n            o.parent = i;\n            var a = Ie.a.CreateCylinder(\"line\", 2, 0.2, 0.3, 6, 1, n);\n            if (a.position.y = a.scaling.y / 2 + 1.2, a.parent = o, e < 2)\n              return o;\n            for (var s = 0; s < 4; s++)\n              (d = o.clone(\"lineParentClone\")).rotation.z = Math.PI / 4, d.rotation.y = Math.PI / 2 + Math.PI / 2 * s, d.getChildMeshes()[0].scaling.y = 0.5, d.getChildMeshes()[0].scaling.x = d.getChildMeshes()[0].scaling.z = 0.8, d.getChildMeshes()[0].position.y = d.getChildMeshes()[0].scaling.y / 2 + 1.2;\n            if (e < 3)\n              return i;\n            for (s = 0; s < 4; s++)\n              (d = o.clone(\"linePivotClone\")).rotation.z = Math.PI / 2, d.rotation.y = Math.PI / 2 * s;\n            if (e < 4)\n              return i;\n            for (s = 0; s < 4; s++) {\n              var d;\n              (d = o.clone(\"linePivotClone\")).rotation.z = Math.PI + Math.PI / 4, d.rotation.y = Math.PI / 2 + Math.PI / 2 * s, d.getChildMeshes()[0].scaling.y = 0.5, d.getChildMeshes()[0].scaling.x = d.getChildMeshes()[0].scaling.z = 0.8, d.getChildMeshes()[0].position.y = d.getChildMeshes()[0].scaling.y / 2 + 1.2;\n            }\n            return e < 5 || ((d = o.clone(\"linePivotClone\")).rotation.z = Math.PI), i;\n          }, t;\n        }(Ln.a), bs = function() {\n          function r(t, e) {\n            t === void 0 && (t = u.e.Zero()), e === void 0 && (e = u.e.Up()), this.position = t, this.normal = e;\n          }\n          return r.prototype.clone = function() {\n            return new r(this.position.clone(), this.normal.clone());\n          }, r;\n        }(), Xf = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = u.e.Zero()), e === void 0 && (e = u.e.Up()), n === void 0 && (n = u.d.Zero()), this.position = t, this.normal = e, this.uv = n;\n          }\n          return r.prototype.clone = function() {\n            return new r(this.position.clone(), this.normal.clone(), this.uv.clone());\n          }, r;\n        }(), Yf = function(r) {\n          function t(e) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer);\n            var n = r.call(this, e) || this;\n            return n._pointerObserver = null, n.onClickedObservable = new C.c(), n._camera = null, n._invProjection = new u.a(), n._material = new Nt.a(\"cameraGizmoMaterial\", n.gizmoLayer.utilityLayerScene), n._material.diffuseColor = new I.a(0.5, 0.5, 0.5), n._material.specularColor = new I.a(0.1, 0.1, 0.1), n._pointerObserver = e.utilityLayerScene.onPointerObservable.add(function(i) {\n              n._camera && (n._isHovered = !(!i.pickInfo || n._rootMesh.getChildMeshes().indexOf(i.pickInfo.pickedMesh) == -1), n._isHovered && i.event.button === 0 && n.onClickedObservable.notifyObservers(n._camera));\n            }, yt.a.POINTERDOWN), n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"displayFrustum\", { get: function() {\n            return this._cameraLinesMesh.isEnabled();\n          }, set: function(e) {\n            this._cameraLinesMesh.setEnabled(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"camera\", { get: function() {\n            return this._camera;\n          }, set: function(e) {\n            var n = this;\n            if (this._camera = e, this.attachedNode = e, e) {\n              this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._cameraMesh = t._CreateCameraMesh(this.gizmoLayer.utilityLayerScene), this._cameraLinesMesh = t._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene), this._cameraMesh.getChildMeshes(!1).forEach(function(o) {\n                o.material = n._material;\n              }), this._cameraMesh.parent = this._rootMesh, this._cameraLinesMesh.parent = this._rootMesh, this.gizmoLayer.utilityLayerScene.activeCamera && this.gizmoLayer.utilityLayerScene.activeCamera.maxZ < 1.5 * e.maxZ && (this.gizmoLayer.utilityLayerScene.activeCamera.maxZ = 1.5 * e.maxZ), this.attachedNode.reservedDataStore || (this.attachedNode.reservedDataStore = {}), this.attachedNode.reservedDataStore.cameraGizmo = this;\n              var i = this.gizmoLayer._getSharedGizmoLight();\n              i.includedOnlyMeshes = i.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(!1)), this._update();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"material\", { get: function() {\n            return this._material;\n          }, enumerable: !1, configurable: !0 }), t.prototype._update = function() {\n            r.prototype._update.call(this), this._camera && (this._camera.getProjectionMatrix().invertToRef(this._invProjection), this._cameraLinesMesh.setPivotMatrix(this._invProjection, !1), this._cameraLinesMesh.scaling.x = 1 / this._rootMesh.scaling.x, this._cameraLinesMesh.scaling.y = 1 / this._rootMesh.scaling.y, this._cameraLinesMesh.scaling.z = 1 / this._rootMesh.scaling.z, this._cameraMesh.parent = null, this._cameraMesh.rotation.y = 0.5 * Math.PI * (this._camera.getScene().useRightHandedSystem ? 1 : -1), this._cameraMesh.parent = this._rootMesh);\n          }, t.prototype.dispose = function() {\n            this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._material.dispose(), r.prototype.dispose.call(this);\n          }, t._CreateCameraMesh = function(e) {\n            var n = new Ie.a(\"rootCameraGizmo\", e), i = new Ie.a(n.name, e);\n            i.parent = n, fr.a.CreateBox(n.name, { width: 1, height: 0.8, depth: 0.5 }, e).parent = i;\n            var o = ci.a.CreateCylinder(n.name, { height: 0.5, diameterTop: 0.8, diameterBottom: 0.8 }, e);\n            o.parent = i, o.position.y = 0.3, o.position.x = -0.6, o.rotation.x = 0.5 * Math.PI;\n            var a = ci.a.CreateCylinder(n.name, { height: 0.5, diameterTop: 0.6, diameterBottom: 0.6 }, e);\n            a.parent = i, a.position.y = 0.5, a.position.x = 0.4, a.rotation.x = 0.5 * Math.PI;\n            var s = ci.a.CreateCylinder(n.name, { height: 0.5, diameterTop: 0.5, diameterBottom: 0.5 }, e);\n            return s.parent = i, s.position.y = 0, s.position.x = 0.6, s.rotation.z = 0.5 * Math.PI, n.scaling.scaleInPlace(t._Scale), i.position.x = -0.9, n;\n          }, t._CreateCameraFrustum = function(e) {\n            var n = new Ie.a(\"rootCameraGizmo\", e), i = new Ie.a(n.name, e);\n            i.parent = n;\n            for (var o = 0; o < 4; o += 2)\n              for (var a = 0; a < 4; a += 2) {\n                var s;\n                (s = sn.a.CreateLines(\"lines\", { points: [new u.e(-1 + a, -1 + o, -1), new u.e(-1 + a, -1 + o, 1)] }, e)).parent = i, s.alwaysSelectAsActiveMesh = !0, s.isPickable = !1, (s = sn.a.CreateLines(\"lines\", { points: [new u.e(-1, -1 + a, -1 + o), new u.e(1, -1 + a, -1 + o)] }, e)).parent = i, s.alwaysSelectAsActiveMesh = !0, s.isPickable = !1, (s = sn.a.CreateLines(\"lines\", { points: [new u.e(-1 + a, -1, -1 + o), new u.e(-1 + a, 1, -1 + o)] }, e)).parent = i, s.alwaysSelectAsActiveMesh = !0, s.isPickable = !1;\n              }\n            return n;\n          }, t._Scale = 0.05, t;\n        }(Ln.a);\n        ze.a.IncludesShadersStore.kernelBlurVaryingDeclaration = \"varying vec2 sampleCoord{X};\";\n        var Kf = `vec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}`;\n        ze.a.IncludesShadersStore.packingFunctions = Kf;\n        var Qf = `#ifdef DOF\nfactor=sampleCoC(sampleCoord{X});\ncomputedWeight=KERNEL_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;\n#endif`;\n        ze.a.IncludesShadersStore.kernelBlurFragment = Qf;\n        var qf = `#ifdef DOF\nfactor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});\ncomputedWeight=KERNEL_DEP_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif`;\n        ze.a.IncludesShadersStore.kernelBlurFragment2 = qf;\n        var Zf = `\nuniform sampler2D textureSampler;\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#ifdef DOF\nuniform sampler2D circleOfConfusionSampler;\nuniform vec2 cameraMinMaxZ;\nfloat sampleDistance(const in vec2 offset) {\nfloat depth=texture2D(circleOfConfusionSampler,offset).g;\nreturn cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth;\n}\nfloat sampleCoC(const in vec2 offset) {\nfloat coc=texture2D(circleOfConfusionSampler,offset).r;\nreturn coc;\n}\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\nfloat computedWeight=0.0;\n#ifdef PACKEDFLOAT\nfloat blend=0.;\n#else\nvec4 blend=vec4(0.);\n#endif\n#ifdef DOF\nfloat sumOfWeights=CENTER_WEIGHT;\nfloat factor=0.0;\n\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\ngl_FragColor=pack(blend);\n#else\ngl_FragColor=blend;\n#endif\n#ifdef DOF\ngl_FragColor/=sumOfWeights;\n#endif\n}`;\n        ze.a.ShadersStore.kernelBlurPixelShader = Zf, ze.a.IncludesShadersStore.kernelBlurVertex = \"sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};\";\n        var Jf = `\nattribute vec2 position;\n\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nsampleCenter=(position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.kernelBlurVertexShader = Jf;\n        var _n = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R) {\n            s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE), y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT), P === void 0 && (P = \"\"), R === void 0 && (R = !1);\n            var B = r.call(this, e, \"kernelBlur\", [\"delta\", \"direction\", \"cameraMinMaxZ\"], [\"circleOfConfusionSampler\"], o, a, s, d, p, null, y, \"kernelBlur\", { varyingCount: 0, depCount: 0 }, !0) || this;\n            return B.blockCompilation = R, B._packedFloat = !1, B._staticDefines = \"\", B._staticDefines = P, B.direction = n, B.onApplyObservable.add(function(F) {\n              B._outputTexture ? F.setFloat2(\"delta\", 1 / B._outputTexture.width * B.direction.x, 1 / B._outputTexture.height * B.direction.y) : F.setFloat2(\"delta\", 1 / B.width * B.direction.x, 1 / B.height * B.direction.y);\n            }), B.kernel = i, B;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"kernel\", { get: function() {\n            return this._idealKernel;\n          }, set: function(e) {\n            this._idealKernel !== e && (e = Math.max(e, 1), this._idealKernel = e, this._kernel = this._nearestBestKernel(e), this.blockCompilation || this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"packedFloat\", { get: function() {\n            return this._packedFloat;\n          }, set: function(e) {\n            this._packedFloat !== e && (this._packedFloat = e, this.blockCompilation || this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"BlurPostProcess\";\n          }, t.prototype.updateEffect = function(e, n, i, o, a, s) {\n            this._updateParameters(a, s);\n          }, t.prototype._updateParameters = function(e, n) {\n            for (var i = this._kernel, o = (i - 1) / 2, a = [], s = [], d = 0, p = 0; p < i; p++) {\n              var y = p / (i - 1), P = this._gaussianWeight(2 * y - 1);\n              a[p] = p - o, s[p] = P, d += P;\n            }\n            for (p = 0; p < s.length; p++)\n              s[p] /= d;\n            var R = [], B = [], F = [];\n            for (p = 0; p <= o; p += 2) {\n              var z = Math.min(p + 1, Math.floor(o));\n              if (p === z)\n                F.push({ o: a[p], w: s[p] });\n              else {\n                var J = z === o, ie = s[p] + s[z] * (J ? 0.5 : 1), se = a[p] + 1 / (1 + s[p] / s[z]);\n                se === 0 ? (F.push({ o: a[p], w: s[p] }), F.push({ o: a[p + 1], w: s[p + 1] })) : (F.push({ o: se, w: ie }), F.push({ o: -se, w: ie }));\n              }\n            }\n            for (p = 0; p < F.length; p++)\n              B[p] = F[p].o, R[p] = F[p].w;\n            a = B, s = R;\n            var ce = this.getEngine().getCaps().maxVaryingVectors, ue = Math.max(ce, 0) - 1, fe = Math.min(a.length, ue), ve = \"\";\n            for (ve += this._staticDefines, this._staticDefines.indexOf(\"DOF\") != -1 && (ve += \"#define CENTER_WEIGHT \" + this._glslFloat(s[fe - 1]) + `\\r\n`, fe--), p = 0; p < fe; p++)\n              ve += \"#define KERNEL_OFFSET\" + p + \" \" + this._glslFloat(a[p]) + `\\r\n`, ve += \"#define KERNEL_WEIGHT\" + p + \" \" + this._glslFloat(s[p]) + `\\r\n`;\n            var Te = 0;\n            for (p = ue; p < a.length; p++)\n              ve += \"#define KERNEL_DEP_OFFSET\" + Te + \" \" + this._glslFloat(a[p]) + `\\r\n`, ve += \"#define KERNEL_DEP_WEIGHT\" + Te + \" \" + this._glslFloat(s[p]) + `\\r\n`, Te++;\n            this.packedFloat && (ve += \"#define PACKEDFLOAT 1\"), this.blockCompilation = !1, r.prototype.updateEffect.call(this, ve, null, null, { varyingCount: fe, depCount: Te }, e, n);\n          }, t.prototype._nearestBestKernel = function(e) {\n            for (var n = Math.round(e), i = 0, o = [n, n - 1, n + 1, n - 2, n + 2]; i < o.length; i++) {\n              var a = o[i];\n              if (a % 2 != 0 && Math.floor(a / 2) % 2 == 0 && a > 0)\n                return Math.max(a, 3);\n            }\n            return Math.max(n, 3);\n          }, t.prototype._gaussianWeight = function(e) {\n            var n = -e * e / 0.2222222222222222;\n            return 1 / (Math.sqrt(2 * Math.PI) * (1 / 3)) * Math.exp(n);\n          }, t.prototype._glslFloat = function(e, n) {\n            return n === void 0 && (n = 8), e.toFixed(n).replace(/0+$/, \"\");\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.direction, e.kernel, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType, void 0, !1);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)(\"kernel\")], t.prototype, \"_kernel\", void 0), Object(c.c)([Object(L.c)(\"packedFloat\")], t.prototype, \"_packedFloat\", void 0), Object(c.c)([Object(L.n)()], t.prototype, \"direction\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.BlurPostProcess\"] = _n;\n        var Ts = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            a === void 0 && (a = h.a.TEXTURETYPE_UNSIGNED_INT), s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE), d === void 0 && (d = !0);\n            var p = r.call(this, e, n, i, o, !0, a, !1, s, d) || this;\n            return p.scene = i, p.mirrorPlane = new ur.a(0, 1, 0, 1), p._transformMatrix = u.a.Zero(), p._mirrorMatrix = u.a.Zero(), p._adaptiveBlurKernel = 0, p._blurKernelX = 0, p._blurKernelY = 0, p._blurRatio = 1, p.ignoreCameraViewport = !0, p._updateGammaSpace(), p._imageProcessingConfigChangeObserver = i.imageProcessingConfiguration.onUpdateParameters.add(function() {\n              p._updateGammaSpace;\n            }), p.onBeforeRenderObservable.add(function() {\n              u.a.ReflectionToRef(p.mirrorPlane, p._mirrorMatrix), p._savedViewMatrix = i.getViewMatrix(), p._mirrorMatrix.multiplyToRef(p._savedViewMatrix, p._transformMatrix), i.setTransformMatrix(p._transformMatrix, i.getProjectionMatrix()), i.clipPlane = p.mirrorPlane, i.getEngine().cullBackFaces = !1, i._mirroredCameraPosition = u.e.TransformCoordinates(i.activeCamera.globalPosition, p._mirrorMatrix);\n            }), p.onAfterRenderObservable.add(function() {\n              i.setTransformMatrix(p._savedViewMatrix, i.getProjectionMatrix()), i.getEngine().cullBackFaces = !0, i._mirroredCameraPosition = null, i.clipPlane = null;\n            }), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"blurRatio\", { get: function() {\n            return this._blurRatio;\n          }, set: function(e) {\n            this._blurRatio !== e && (this._blurRatio = e, this._preparePostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"adaptiveBlurKernel\", { set: function(e) {\n            this._adaptiveBlurKernel = e, this._autoComputeBlurKernel();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurKernel\", { set: function(e) {\n            this.blurKernelX = e, this.blurKernelY = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurKernelX\", { get: function() {\n            return this._blurKernelX;\n          }, set: function(e) {\n            this._blurKernelX !== e && (this._blurKernelX = e, this._preparePostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurKernelY\", { get: function() {\n            return this._blurKernelY;\n          }, set: function(e) {\n            this._blurKernelY !== e && (this._blurKernelY = e, this._preparePostProcesses());\n          }, enumerable: !1, configurable: !0 }), t.prototype._autoComputeBlurKernel = function() {\n            var e = this.getScene().getEngine(), n = this.getRenderWidth() / e.getRenderWidth(), i = this.getRenderHeight() / e.getRenderHeight();\n            this.blurKernelX = this._adaptiveBlurKernel * n, this.blurKernelY = this._adaptiveBlurKernel * i;\n          }, t.prototype._onRatioRescale = function() {\n            this._sizeRatio && (this.resize(this._initialSizeParameter), this._adaptiveBlurKernel || this._preparePostProcesses()), this._adaptiveBlurKernel && this._autoComputeBlurKernel();\n          }, t.prototype._updateGammaSpace = function() {\n            this.gammaSpace = !this.scene.imageProcessingConfiguration.isEnabled || !this.scene.imageProcessingConfiguration.applyByPostProcess;\n          }, t.prototype._preparePostProcesses = function() {\n            if (this.clearPostProcesses(!0), this._blurKernelX && this._blurKernelY) {\n              var e = this.getScene().getEngine(), n = e.getCaps().textureFloatRender ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_HALF_FLOAT;\n              this._blurX = new _n(\"horizontal blur\", new u.d(1, 0), this._blurKernelX, this._blurRatio, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, n), this._blurX.autoClear = !1, this._blurRatio === 1 && this.samples < 2 && this._texture ? this._blurX.inputTexture = this._texture : this._blurX.alwaysForcePOT = !0, this._blurY = new _n(\"vertical blur\", new u.d(0, 1), this._blurKernelY, this._blurRatio, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, n), this._blurY.autoClear = !1, this._blurY.alwaysForcePOT = this._blurRatio !== 1, this.addPostProcess(this._blurX), this.addPostProcess(this._blurY);\n            } else\n              this._blurY && (this.removePostProcess(this._blurY), this._blurY.dispose(), this._blurY = null), this._blurX && (this.removePostProcess(this._blurX), this._blurX.dispose(), this._blurX = null);\n          }, t.prototype.clone = function() {\n            var e = this.getScene();\n            if (!e)\n              return this;\n            var n = this.getSize(), i = new t(this.name, n.width, e, this._renderTargetOptions.generateMipMaps, this._renderTargetOptions.type, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer);\n            return i.hasAlpha = this.hasAlpha, i.level = this.level, i.mirrorPlane = this.mirrorPlane.clone(), this.renderList && (i.renderList = this.renderList.slice(0)), i;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = r.prototype.serialize.call(this);\n            return e.mirrorPlane = this.mirrorPlane.asArray(), e;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver);\n          }, t;\n        }(on);\n        Ne.a._CreateMirror = function(r, t, e, n) {\n          return new Ts(r, t, e, n);\n        };\n        var Hn = f(34), ei = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R, B, F, z) {\n            var J;\n            i === void 0 && (i = null), o === void 0 && (o = !1), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null), p === void 0 && (p = h.a.TEXTUREFORMAT_RGBA), y === void 0 && (y = !1), P === void 0 && (P = null), R === void 0 && (R = !1), B === void 0 && (B = 0.8), F === void 0 && (F = 0);\n            var ie = r.call(this, n) || this;\n            if (ie.onLoadObservable = new C.c(), ie.boundingBoxPosition = u.e.Zero(), ie._rotationY = 0, ie._files = null, ie._forcedExtension = null, ie._extensions = null, ie.name = e, ie.url = e, ie._noMipmap = o, ie.hasAlpha = !1, ie._format = p, ie.isCube = !0, ie._textureMatrix = u.a.Identity(), ie._createPolynomials = R, ie.coordinatesMode = Ne.a.CUBIC_MODE, ie._extensions = i, ie._files = a, ie._forcedExtension = P, ie._loaderOptions = z, !e && !a)\n              return ie;\n            var se = e.lastIndexOf(\".\"), ce = P || (se > -1 ? e.substring(se).toLowerCase() : \"\"), ue = ce === \".dds\", fe = ce === \".env\";\n            if (fe ? (ie.gammaSpace = !1, ie._prefiltered = !1, ie.anisotropicFilteringLevel = 1) : (ie._prefiltered = y, y && (ie.gammaSpace = !1, ie.anisotropicFilteringLevel = 1)), ie._texture = ie._getFromCache(e, o), !a && (fe || ue || i || (i = [\"_px.jpg\", \"_py.jpg\", \"_pz.jpg\", \"_nx.jpg\", \"_ny.jpg\", \"_nz.jpg\"]), a = [], i))\n              for (var ve = 0; ve < i.length; ve++)\n                a.push(e + i[ve]);\n            ie._files = a;\n            var Te = function() {\n              ie.onLoadObservable.notifyObservers(ie), s && s();\n            };\n            if (ie._texture)\n              ie._texture.isReady ? Xe.b.SetImmediate(function() {\n                return Te();\n              }) : ie._texture.onLoadedObservable.add(function() {\n                return Te();\n              });\n            else {\n              var Re = ie.getScene();\n              Re != null && Re.useDelayedTextureLoading ? ie.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : (ie._texture = y ? ie._getEngine().createPrefilteredCubeTexture(e, Re, B, F, s, d, p, P, ie._createPolynomials) : ie._getEngine().createCubeTexture(e, Re, a, o, s, d, ie._format, P, !1, B, F, null, z), (J = ie._texture) === null || J === void 0 || J.onLoadedObservable.add(function() {\n                return ie.onLoadObservable.notifyObservers(ie);\n              }));\n            }\n            return ie;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"boundingBoxSize\", { get: function() {\n            return this._boundingBoxSize;\n          }, set: function(e) {\n            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {\n              this._boundingBoxSize = e;\n              var n = this.getScene();\n              n && n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotationY\", { get: function() {\n            return this._rotationY;\n          }, set: function(e) {\n            this._rotationY = e, this.setReflectionTextureMatrix(u.a.RotationY(this._rotationY));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"noMipmap\", { get: function() {\n            return this._noMipmap;\n          }, enumerable: !1, configurable: !0 }), t.CreateFromImages = function(e, n, i) {\n            var o = \"\";\n            return e.forEach(function(a) {\n              return o += a;\n            }), new t(o, n, null, i, e);\n          }, t.CreateFromPrefilteredData = function(e, n, i, o) {\n            i === void 0 && (i = null), o === void 0 && (o = !0);\n            var a = n.useDelayedTextureLoading;\n            n.useDelayedTextureLoading = !1;\n            var s = new t(e, n, null, !1, null, null, null, void 0, !0, i, o);\n            return n.useDelayedTextureLoading = a, s;\n          }, t.prototype.getClassName = function() {\n            return \"CubeTexture\";\n          }, t.prototype.updateURL = function(e, n, i, o) {\n            var a;\n            o === void 0 && (o = !1), this.url && (this.releaseInternalTexture(), (a = this.getScene()) === null || a === void 0 || a.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag)), this.name && !Hn.a.StartsWith(this.name, \"data:\") || (this.name = e), this.url = e, this.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED, this._prefiltered = o, this._prefiltered && (this.gammaSpace = !1, this.anisotropicFilteringLevel = 1), this._forcedExtension = n || null, i && (this._delayedOnLoad = i), this.delayLoad(n);\n          }, t.prototype.delayLoad = function(e) {\n            var n, i = this;\n            if (this.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = h.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap), !this._texture)) {\n              var o = this.getScene();\n              this._prefiltered ? this._texture = this._getEngine().createPrefilteredCubeTexture(this.url, o, 0.8, 0, this._delayedOnLoad, void 0, this._format, e, this._createPolynomials) : this._texture = this._getEngine().createCubeTexture(this.url, o, this._files, this._noMipmap, this._delayedOnLoad, null, this._format, e, !1, 0, 0, null, this._loaderOptions), (n = this._texture) === null || n === void 0 || n.onLoadedObservable.add(function() {\n                return i.onLoadObservable.notifyObservers(i);\n              });\n            }\n          }, t.prototype.getReflectionTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.setReflectionTextureMatrix = function(e) {\n            var n, i = this;\n            e.updateFlag !== this._textureMatrix.updateFlag && (e.isIdentity() !== this._textureMatrix.isIdentity() && ((n = this.getScene()) === null || n === void 0 || n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag, function(o) {\n              return o.getActiveTextures().indexOf(i) !== -1;\n            })), this._textureMatrix = e);\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              var p = !1;\n              return e.prefiltered && (p = e.prefiltered), new t(i + e.name, n, e.extensions, !1, e.files || null, null, null, void 0, p, e.forcedExtension);\n            }, e, n);\n            if (e.boundingBoxPosition && (o.boundingBoxPosition = u.e.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (o.boundingBoxSize = u.e.FromArray(e.boundingBoxSize)), e.animations)\n              for (var a = 0; a < e.animations.length; a++) {\n                var s = e.animations[a], d = O.a.GetClass(\"BABYLON.Animation\");\n                d && o.animations.push(d.Parse(s));\n              }\n            return o;\n          }, t.prototype.clone = function() {\n            var e = this, n = 0, i = L.a.Clone(function() {\n              var o = new t(e.url, e.getScene() || e._getEngine(), e._extensions, e._noMipmap, e._files);\n              return n = o.uniqueId, o;\n            }, this);\n            return i.uniqueId = n, i;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"url\", void 0), Object(c.c)([Object(L.c)(\"rotationY\")], t.prototype, \"rotationY\", null), Object(c.c)([Object(L.c)(\"files\")], t.prototype, \"_files\", void 0), Object(c.c)([Object(L.c)(\"forcedExtension\")], t.prototype, \"_forcedExtension\", void 0), Object(c.c)([Object(L.c)(\"extensions\")], t.prototype, \"_extensions\", void 0), Object(c.c)([Object(L.j)(\"textureMatrix\")], t.prototype, \"_textureMatrix\", void 0), t;\n        }(kn.a);\n        Ne.a._CubeTextureParser = ei.Parse, O.a.RegisteredTypes[\"BABYLON.CubeTexture\"] = ei;\n        var $e = f(15), zo = f(76), jo = f(87), lt = f(19), $f = ` uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;\nuniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif`;\n        ze.a.IncludesShadersStore.backgroundFragmentDeclaration = $f;\n        var ep = `layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec4 vPrimaryColor;\nuniform vec4 vPrimaryColorShadow;\nuniform vec2 vDiffuseInfos;\nuniform vec2 vReflectionInfos;\nuniform mat4 diffuseMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\nuniform float pointSize;\nuniform float shadowLevel;\nuniform float alpha;\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};`;\n        ze.a.IncludesShadersStore.backgroundUboDeclaration = ep, f(131), f(106), f(107), f(154), f(130), f(115), f(125), f(110), f(135), f(136);\n        var tp = `#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#define RECIPROCAL_PI2 0.15915494\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<helperFunctions>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\n\nfloat shadow=1.;\nfloat globalShadow=0.;\nfloat shadowLightCount=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\n\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\n\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nreflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nreflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nreflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);\nreflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\n\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\n\nvec3 diffuseColor=vec3(1.,1.,1.);\nfloat finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\n\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;\nvec3 reflectionReflectance0=vReflectionControl.yyy;\nvec3 reflectionReflectance90=vReflectionControl.zzz;\nfloat VdotN=dot(normalize(vEyePosition),normalW);\nvec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);\nreflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);\nreflectionDistanceFalloff*=reflectionDistanceFalloff;\nreflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition-vBackgroundCenter));\n\nconst float startAngle=0.1;\nfloat fadeFactor=saturate(viewAngleToFloor/startAngle);\nfinalAlpha*=fadeFactor*fadeFactor;\n#endif\n\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\n\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#else\n\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);\ncolor=max(color,0.0);\n#endif\ngl_FragColor=color;\n}\n`;\n        ze.a.ShadersStore.backgroundPixelShader = tp;\n        var np = `uniform mat4 view;\nuniform mat4 viewProjection;\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif`;\n        ze.a.IncludesShadersStore.backgroundVertexDeclaration = np, f(78), f(79), f(117), f(137), f(80), f(81), f(111), f(157), f(138);\n        var ip = `precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n} else {\ngl_Position=viewProjectionR*finalWorld*vec4(position,1.0);\n}\n#else\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));\nvec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));\nif (fFovMultiplier<=1.0) {\nvDirectionW=normalize(segment);\n} else {\nvDirectionW=normalize(vDirectionW+(vDirectionW-segment));\n}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n`;\n        ze.a.ShadersStore.backgroundVertexShader = ip;\n        var _r = f(67), rp = function(r) {\n          function t() {\n            var e = r.call(this) || this;\n            return e.DIFFUSE = !1, e.DIFFUSEDIRECTUV = 0, e.GAMMADIFFUSE = !1, e.DIFFUSEHASALPHA = !1, e.OPACITYFRESNEL = !1, e.REFLECTIONBLUR = !1, e.REFLECTIONFRESNEL = !1, e.REFLECTIONFALLOFF = !1, e.TEXTURELODSUPPORT = !1, e.PREMULTIPLYALPHA = !1, e.USERGBCOLOR = !1, e.USEHIGHLIGHTANDSHADOWCOLORS = !1, e.BACKMAT_SHADOWONLY = !1, e.NOISE = !1, e.REFLECTIONBGR = !1, e.IMAGEPROCESSING = !1, e.VIGNETTE = !1, e.VIGNETTEBLENDMODEMULTIPLY = !1, e.VIGNETTEBLENDMODEOPAQUE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = !1, e.SAMPLER3DBGRMAP = !1, e.IMAGEPROCESSINGPOSTPROCESS = !1, e.EXPOSURE = !1, e.MULTIVIEW = !1, e.REFLECTION = !1, e.REFLECTIONMAP_3D = !1, e.REFLECTIONMAP_SPHERICAL = !1, e.REFLECTIONMAP_PLANAR = !1, e.REFLECTIONMAP_CUBIC = !1, e.REFLECTIONMAP_PROJECTION = !1, e.REFLECTIONMAP_SKYBOX = !1, e.REFLECTIONMAP_EXPLICIT = !1, e.REFLECTIONMAP_EQUIRECTANGULAR = !1, e.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, e.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, e.INVERTCUBICMAP = !1, e.REFLECTIONMAP_OPPOSITEZ = !1, e.LODINREFLECTIONALPHA = !1, e.GAMMAREFLECTION = !1, e.RGBDREFLECTION = !1, e.EQUIRECTANGULAR_RELFECTION_FOV = !1, e.MAINUV1 = !1, e.MAINUV2 = !1, e.UV1 = !1, e.UV2 = !1, e.CLIPPLANE = !1, e.CLIPPLANE2 = !1, e.CLIPPLANE3 = !1, e.CLIPPLANE4 = !1, e.CLIPPLANE5 = !1, e.CLIPPLANE6 = !1, e.POINTSIZE = !1, e.FOG = !1, e.NORMAL = !1, e.NUM_BONE_INFLUENCERS = 0, e.BonesPerMesh = 0, e.INSTANCES = !1, e.SHADOWFLOAT = !1, e.rebuild(), e;\n          }\n          return Object(c.d)(t, r), t;\n        }(zo.a), qr = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.primaryColor = I.a.White(), i._primaryColorShadowLevel = 0, i._primaryColorHighlightLevel = 0, i.reflectionTexture = null, i.reflectionBlur = 0, i.diffuseTexture = null, i._shadowLights = null, i.shadowLights = null, i.shadowLevel = 0, i.sceneCenter = u.e.Zero(), i.opacityFresnel = !0, i.reflectionFresnel = !1, i.reflectionFalloffDistance = 0, i.reflectionAmount = 1, i.reflectionReflectance0 = 0.05, i.reflectionReflectance90 = 0.5, i.useRGBColor = !0, i.enableNoise = !1, i._fovMultiplier = 1, i.useEquirectangularFOV = !1, i._maxSimultaneousLights = 4, i.maxSimultaneousLights = 4, i._shadowOnly = !1, i.shadowOnly = !1, i._imageProcessingObserver = null, i.switchToBGR = !1, i._renderTargets = new si.a(16), i._reflectionControls = u.f.Zero(), i._white = I.a.White(), i._primaryShadowColor = I.a.Black(), i._primaryHighlightColor = I.a.Black(), i._attachImageProcessingConfiguration(null), i.getRenderTargetTextures = function() {\n              return i._renderTargets.reset(), i._diffuseTexture && i._diffuseTexture.isRenderTarget && i._renderTargets.push(i._diffuseTexture), i._reflectionTexture && i._reflectionTexture.isRenderTarget && i._renderTargets.push(i._reflectionTexture), i._renderTargets;\n            }, i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"_perceptualColor\", { get: function() {\n            return this.__perceptualColor;\n          }, set: function(e) {\n            this.__perceptualColor = e, this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsLightsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"primaryColorShadowLevel\", { get: function() {\n            return this._primaryColorShadowLevel;\n          }, set: function(e) {\n            this._primaryColorShadowLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"primaryColorHighlightLevel\", { get: function() {\n            return this._primaryColorHighlightLevel;\n          }, set: function(e) {\n            this._primaryColorHighlightLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflectionStandardFresnelWeight\", { set: function(e) {\n            var n = e;\n            n < 0.5 ? (n *= 2, this.reflectionReflectance0 = t.StandardReflectance0 * n, this.reflectionReflectance90 = t.StandardReflectance90 * n) : (n = 2 * n - 1, this.reflectionReflectance0 = t.StandardReflectance0 + (1 - t.StandardReflectance0) * n, this.reflectionReflectance90 = t.StandardReflectance90 + (1 - t.StandardReflectance90) * n);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fovMultiplier\", { get: function() {\n            return this._fovMultiplier;\n          }, set: function(e) {\n            isNaN(e) && (e = 1), this._fovMultiplier = Math.max(0, Math.min(2, e));\n          }, enumerable: !1, configurable: !0 }), t.prototype._attachImageProcessingConfiguration = function(e) {\n            var n = this;\n            e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              n._computePrimaryColorFromPerceptualColor(), n._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraToneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraExposure\", { get: function() {\n            return this._imageProcessingConfiguration.exposure;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.exposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraContrast\", { get: function() {\n            return this._imageProcessingConfiguration.contrast;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.contrast = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingTexture\", { get: function() {\n            return this._imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurves\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurves;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurves = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !(!this._diffuseTexture || !this._diffuseTexture.isRenderTarget) || !(!this._reflectionTexture || !this._reflectionTexture.isRenderTarget);\n          }, enumerable: !1, configurable: !0 }), t.prototype.needAlphaTesting = function() {\n            return !0;\n          }, t.prototype.needAlphaBlending = function() {\n            return this.alpha < 1 || this._diffuseTexture != null && this._diffuseTexture.hasAlpha || this._shadowOnly;\n          }, t.prototype.isReadyForSubMesh = function(e, n, i) {\n            var o = this;\n            if (i === void 0 && (i = !1), n.effect && this.isFrozen && n.effect._wasPreviouslyReady)\n              return !0;\n            n._materialDefines || (n._materialDefines = new rp());\n            var a = this.getScene(), s = n._materialDefines;\n            if (this._isReadyForSubMesh(n))\n              return !0;\n            var d = a.getEngine();\n            if ($e.a.PrepareDefinesForLights(a, e, s, !1, this._maxSimultaneousLights), s._needNormals = !0, $e.a.PrepareDefinesForMultiview(a, s), s._areTexturesDirty) {\n              if (s._needUVs = !1, a.texturesEnabled) {\n                if (a.getEngine().getCaps().textureLOD && (s.TEXTURELODSUPPORT = !0), this._diffuseTexture && lt.a.DiffuseTextureEnabled) {\n                  if (!this._diffuseTexture.isReadyOrNotBlocking())\n                    return !1;\n                  $e.a.PrepareDefinesForMergedUV(this._diffuseTexture, s, \"DIFFUSE\"), s.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha, s.GAMMADIFFUSE = this._diffuseTexture.gammaSpace, s.OPACITYFRESNEL = this._opacityFresnel;\n                } else\n                  s.DIFFUSE = !1, s.DIFFUSEHASALPHA = !1, s.GAMMADIFFUSE = !1, s.OPACITYFRESNEL = !1;\n                var p = this._reflectionTexture;\n                if (p && lt.a.ReflectionTextureEnabled) {\n                  if (!p.isReadyOrNotBlocking())\n                    return !1;\n                  switch (s.REFLECTION = !0, s.GAMMAREFLECTION = p.gammaSpace, s.RGBDREFLECTION = p.isRGBD, s.REFLECTIONBLUR = this._reflectionBlur > 0, s.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !p.invertZ : p.invertZ, s.LODINREFLECTIONALPHA = p.lodLevelInAlpha, s.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV, s.REFLECTIONBGR = this.switchToBGR, p.coordinatesMode === Ne.a.INVCUBIC_MODE && (s.INVERTCUBICMAP = !0), s.REFLECTIONMAP_3D = p.isCube, p.coordinatesMode) {\n                    case Ne.a.EXPLICIT_MODE:\n                      s.REFLECTIONMAP_EXPLICIT = !0;\n                      break;\n                    case Ne.a.PLANAR_MODE:\n                      s.REFLECTIONMAP_PLANAR = !0;\n                      break;\n                    case Ne.a.PROJECTION_MODE:\n                      s.REFLECTIONMAP_PROJECTION = !0;\n                      break;\n                    case Ne.a.SKYBOX_MODE:\n                      s.REFLECTIONMAP_SKYBOX = !0;\n                      break;\n                    case Ne.a.SPHERICAL_MODE:\n                      s.REFLECTIONMAP_SPHERICAL = !0;\n                      break;\n                    case Ne.a.EQUIRECTANGULAR_MODE:\n                      s.REFLECTIONMAP_EQUIRECTANGULAR = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MODE:\n                      s.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:\n                      s.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.CUBIC_MODE:\n                    case Ne.a.INVCUBIC_MODE:\n                    default:\n                      s.REFLECTIONMAP_CUBIC = !0;\n                  }\n                  this.reflectionFresnel ? (s.REFLECTIONFRESNEL = !0, s.REFLECTIONFALLOFF = this.reflectionFalloffDistance > 0, this._reflectionControls.x = this.reflectionAmount, this._reflectionControls.y = this.reflectionReflectance0, this._reflectionControls.z = this.reflectionReflectance90, this._reflectionControls.w = 1 / this.reflectionFalloffDistance) : (s.REFLECTIONFRESNEL = !1, s.REFLECTIONFALLOFF = !1);\n                } else\n                  s.REFLECTION = !1, s.REFLECTIONFRESNEL = !1, s.REFLECTIONFALLOFF = !1, s.REFLECTIONBLUR = !1, s.REFLECTIONMAP_3D = !1, s.REFLECTIONMAP_SPHERICAL = !1, s.REFLECTIONMAP_PLANAR = !1, s.REFLECTIONMAP_CUBIC = !1, s.REFLECTIONMAP_PROJECTION = !1, s.REFLECTIONMAP_SKYBOX = !1, s.REFLECTIONMAP_EXPLICIT = !1, s.REFLECTIONMAP_EQUIRECTANGULAR = !1, s.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, s.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, s.INVERTCUBICMAP = !1, s.REFLECTIONMAP_OPPOSITEZ = !1, s.LODINREFLECTIONALPHA = !1, s.GAMMAREFLECTION = !1, s.RGBDREFLECTION = !1;\n              }\n              s.PREMULTIPLYALPHA = this.alphaMode === h.a.ALPHA_PREMULTIPLIED || this.alphaMode === h.a.ALPHA_PREMULTIPLIED_PORTERDUFF, s.USERGBCOLOR = this._useRGBColor, s.NOISE = this._enableNoise;\n            }\n            if (s._areLightsDirty && (s.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (this._primaryColorShadowLevel !== 0 || this._primaryColorHighlightLevel !== 0), s.BACKMAT_SHADOWONLY = this._shadowOnly), s._areImageProcessingDirty && this._imageProcessingConfiguration) {\n              if (!this._imageProcessingConfiguration.isReady())\n                return !1;\n              this._imageProcessingConfiguration.prepareDefines(s);\n            }\n            if ($e.a.PrepareDefinesForMisc(e, a, !1, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), s), $e.a.PrepareDefinesForFrameBoundValues(a, d, s, i, null, n.getRenderingMesh().hasThinInstances), $e.a.PrepareDefinesForAttributes(e, s, !1, !0, !1) && e && (a.getEngine().getCaps().standardDerivatives || e.isVerticesDataPresent(Oe.b.NormalKind) || (e.createNormals(!0), l.a.Warn(\"BackgroundMaterial: Normals have been created for the mesh: \" + e.name))), s.isDirty) {\n              s.markAsProcessed(), a.resetCachedMaterial();\n              var y = new _r.a();\n              s.FOG && y.addFallback(0, \"FOG\"), s.POINTSIZE && y.addFallback(1, \"POINTSIZE\"), s.MULTIVIEW && y.addFallback(0, \"MULTIVIEW\"), $e.a.HandleFallbacksForShadows(s, y, this._maxSimultaneousLights);\n              var P = [Oe.b.PositionKind];\n              s.NORMAL && P.push(Oe.b.NormalKind), s.UV1 && P.push(Oe.b.UVKind), s.UV2 && P.push(Oe.b.UV2Kind), $e.a.PrepareAttributesForBones(P, e, s, y), $e.a.PrepareAttributesForInstances(P, s);\n              var R = [\"world\", \"view\", \"viewProjection\", \"vEyePosition\", \"vLightsType\", \"vFogInfos\", \"vFogColor\", \"pointSize\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"mBones\", \"vPrimaryColor\", \"vPrimaryColorShadow\", \"vReflectionInfos\", \"reflectionMatrix\", \"vReflectionMicrosurfaceInfos\", \"fFovMultiplier\", \"shadowLevel\", \"alpha\", \"vBackgroundCenter\", \"vReflectionControl\", \"vDiffuseInfos\", \"diffuseMatrix\"], B = [\"diffuseSampler\", \"reflectionSampler\", \"reflectionSamplerLow\", \"reflectionSamplerHigh\"], F = [\"Material\", \"Scene\"];\n              vn.a && (vn.a.PrepareUniforms(R, s), vn.a.PrepareSamplers(B, s)), $e.a.PrepareUniformsAndSamplersList({ uniformsNames: R, uniformBuffersNames: F, samplers: B, defines: s, maxSimultaneousLights: this._maxSimultaneousLights });\n              var z = s.toString();\n              n.setEffect(a.getEngine().createEffect(\"background\", { attributes: P, uniformsNames: R, uniformBuffersNames: F, samplers: B, defines: z, fallbacks: y, onCompiled: function(J) {\n                o.onCompiled && o.onCompiled(J), o.bindSceneUniformBuffer(J, a.getSceneUniformBuffer());\n              }, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights } }, d), s), this.buildUniformLayout();\n            }\n            return !(!n.effect || !n.effect.isReady()) && (s._renderId = a.getRenderId(), n.effect._wasPreviouslyReady = !0, !0);\n          }, t.prototype._computePrimaryColorFromPerceptualColor = function() {\n            this.__perceptualColor && (this._primaryColor.copyFrom(this.__perceptualColor), this._primaryColor.toLinearSpaceToRef(this._primaryColor), this._imageProcessingConfiguration && this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor), this._computePrimaryColors());\n          }, t.prototype._computePrimaryColors = function() {\n            this._primaryColorShadowLevel === 0 && this._primaryColorHighlightLevel === 0 || (this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor), this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor), this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor), this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor), this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor));\n          }, t.prototype.buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vPrimaryColor\", 4), this._uniformBuffer.addUniform(\"vPrimaryColorShadow\", 4), this._uniformBuffer.addUniform(\"vDiffuseInfos\", 2), this._uniformBuffer.addUniform(\"vReflectionInfos\", 2), this._uniformBuffer.addUniform(\"diffuseMatrix\", 16), this._uniformBuffer.addUniform(\"reflectionMatrix\", 16), this._uniformBuffer.addUniform(\"vReflectionMicrosurfaceInfos\", 3), this._uniformBuffer.addUniform(\"fFovMultiplier\", 1), this._uniformBuffer.addUniform(\"pointSize\", 1), this._uniformBuffer.addUniform(\"shadowLevel\", 1), this._uniformBuffer.addUniform(\"alpha\", 1), this._uniformBuffer.addUniform(\"vBackgroundCenter\", 3), this._uniformBuffer.addUniform(\"vReflectionControl\", 4), this._uniformBuffer.create();\n          }, t.prototype.unbind = function() {\n            this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._uniformBuffer.setTexture(\"diffuseSampler\", null), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._uniformBuffer.setTexture(\"reflectionSampler\", null), r.prototype.unbind.call(this);\n          }, t.prototype.bindOnlyWorldMatrix = function(e) {\n            this._activeEffect.setMatrix(\"world\", e);\n          }, t.prototype.bindForSubMesh = function(e, n, i) {\n            var o = this.getScene(), a = i._materialDefines;\n            if (a) {\n              var s = i.effect;\n              if (s) {\n                this._activeEffect = s, this.bindOnlyWorldMatrix(e), $e.a.BindBonesParameters(n, this._activeEffect);\n                var d = this._mustRebind(o, s, n.visibility);\n                if (d) {\n                  this._uniformBuffer.bindToEffect(s, \"Material\"), this.bindViewProjection(s);\n                  var p = this._reflectionTexture;\n                  this._uniformBuffer.useUbo && this.isFrozen && this._uniformBuffer.isSync || (o.texturesEnabled && (this._diffuseTexture && lt.a.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2(\"vDiffuseInfos\", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), $e.a.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, \"diffuse\")), p && lt.a.ReflectionTextureEnabled && (this._uniformBuffer.updateMatrix(\"reflectionMatrix\", p.getReflectionTextureMatrix()), this._uniformBuffer.updateFloat2(\"vReflectionInfos\", p.level, this._reflectionBlur), this._uniformBuffer.updateFloat3(\"vReflectionMicrosurfaceInfos\", p.getSize().width, p.lodGenerationScale, p.lodGenerationOffset))), this.shadowLevel > 0 && this._uniformBuffer.updateFloat(\"shadowLevel\", this.shadowLevel), this._uniformBuffer.updateFloat(\"alpha\", this.alpha), this.pointsCloud && this._uniformBuffer.updateFloat(\"pointSize\", this.pointSize), a.USEHIGHLIGHTANDSHADOWCOLORS ? (this._uniformBuffer.updateColor4(\"vPrimaryColor\", this._primaryHighlightColor, 1), this._uniformBuffer.updateColor4(\"vPrimaryColorShadow\", this._primaryShadowColor, 1)) : this._uniformBuffer.updateColor4(\"vPrimaryColor\", this._primaryColor, 1)), this._uniformBuffer.updateFloat(\"fFovMultiplier\", this._fovMultiplier), o.texturesEnabled && (this._diffuseTexture && lt.a.DiffuseTextureEnabled && this._uniformBuffer.setTexture(\"diffuseSampler\", this._diffuseTexture), p && lt.a.ReflectionTextureEnabled && (a.REFLECTIONBLUR && a.TEXTURELODSUPPORT ? this._uniformBuffer.setTexture(\"reflectionSampler\", p) : a.REFLECTIONBLUR ? (this._uniformBuffer.setTexture(\"reflectionSampler\", p._lodTextureMid || p), this._uniformBuffer.setTexture(\"reflectionSamplerLow\", p._lodTextureLow || p), this._uniformBuffer.setTexture(\"reflectionSamplerHigh\", p._lodTextureHigh || p)) : this._uniformBuffer.setTexture(\"reflectionSampler\", p), a.REFLECTIONFRESNEL && (this._uniformBuffer.updateFloat3(\"vBackgroundCenter\", this.sceneCenter.x, this.sceneCenter.y, this.sceneCenter.z), this._uniformBuffer.updateFloat4(\"vReflectionControl\", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w)))), $e.a.BindClipPlane(this._activeEffect, o), $e.a.BindEyePosition(s, o);\n                }\n                !d && this.isFrozen || (o.lightsEnabled && $e.a.BindLights(o, n, this._activeEffect, a, this._maxSimultaneousLights, !1), this.bindView(s), $e.a.BindFogParameters(o, n, this._activeEffect, !0), this._imageProcessingConfiguration && this._imageProcessingConfiguration.bind(this._activeEffect)), this._uniformBuffer.update(), this._afterBind(n, this._activeEffect);\n              }\n            }\n          }, t.prototype.hasTexture = function(e) {\n            return !!r.prototype.hasTexture.call(this, e) || this._reflectionTexture === e || this._diffuseTexture === e;\n          }, t.prototype.dispose = function(e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = !1), n && (this.diffuseTexture && this.diffuseTexture.dispose(), this.reflectionTexture && this.reflectionTexture.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), r.prototype.dispose.call(this, e);\n          }, t.prototype.clone = function(e) {\n            var n = this;\n            return L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.BackgroundMaterial\", e;\n          }, t.prototype.getClassName = function() {\n            return \"BackgroundMaterial\";\n          }, t.Parse = function(e, n, i) {\n            return L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n          }, t.StandardReflectance0 = 0.05, t.StandardReflectance90 = 0.5, Object(c.c)([Object(L.e)()], t.prototype, \"_primaryColor\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"primaryColor\", void 0), Object(c.c)([Object(L.e)()], t.prototype, \"__perceptualColor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_primaryColorShadowLevel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_primaryColorHighlightLevel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"primaryColorHighlightLevel\", null), Object(c.c)([Object(L.m)()], t.prototype, \"_reflectionTexture\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionBlur\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionBlur\", void 0), Object(c.c)([Object(L.m)()], t.prototype, \"_diffuseTexture\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"diffuseTexture\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"shadowLights\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_shadowLevel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"shadowLevel\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"_sceneCenter\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"sceneCenter\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_opacityFresnel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"opacityFresnel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionFresnel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionFresnel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionFalloffDistance\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionFalloffDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionAmount\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionAmount\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionReflectance0\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionReflectance0\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionReflectance90\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionReflectance90\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_useRGBColor\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRGBColor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_enableNoise\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"enableNoise\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_maxSimultaneousLights\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"maxSimultaneousLights\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_shadowOnly\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"shadowOnly\", void 0), Object(c.c)([Object(L.i)()], t.prototype, \"_imageProcessingConfiguration\", void 0), t;\n        }(jo.a);\n        O.a.RegisteredTypes[\"BABYLON.BackgroundMaterial\"] = qr;\n        var Es = function() {\n          function r(t, e) {\n            var n = this;\n            this._errorHandler = function(i, o) {\n              n.onErrorObservable.notifyObservers({ message: i, exception: o });\n            }, this._options = Object(c.a)(Object(c.a)({}, r._getDefaultOptions()), t), this._scene = e, this.onErrorObservable = new C.c(), this._setupBackground(), this._setupImageProcessing();\n          }\n          return r._getDefaultOptions = function() {\n            return { createGround: !0, groundSize: 15, groundTexture: this._groundTextureCDNUrl, groundColor: new I.a(0.2, 0.2, 0.3).toLinearSpace().scale(3), groundOpacity: 0.9, enableGroundShadow: !0, groundShadowLevel: 0.5, enableGroundMirror: !1, groundMirrorSizeRatio: 0.3, groundMirrorBlurKernel: 64, groundMirrorAmount: 1, groundMirrorFresnelWeight: 1, groundMirrorFallOffDistance: 0, groundMirrorTextureType: h.a.TEXTURETYPE_UNSIGNED_INT, groundYBias: 1e-5, createSkybox: !0, skyboxSize: 20, skyboxTexture: this._skyboxTextureCDNUrl, skyboxColor: new I.a(0.2, 0.2, 0.3).toLinearSpace().scale(3), backgroundYRotation: 0, sizeAuto: !0, rootPosition: u.e.Zero(), setupImageProcessing: !0, environmentTexture: this._environmentTextureCDNUrl, cameraExposure: 0.8, cameraContrast: 1.2, toneMappingEnabled: !0 };\n          }, Object.defineProperty(r.prototype, \"rootMesh\", { get: function() {\n            return this._rootMesh;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"skybox\", { get: function() {\n            return this._skybox;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"skyboxTexture\", { get: function() {\n            return this._skyboxTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"skyboxMaterial\", { get: function() {\n            return this._skyboxMaterial;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ground\", { get: function() {\n            return this._ground;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundTexture\", { get: function() {\n            return this._groundTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundMirror\", { get: function() {\n            return this._groundMirror;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundMirrorRenderList\", { get: function() {\n            return this._groundMirror ? this._groundMirror.renderList : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundMaterial\", { get: function() {\n            return this._groundMaterial;\n          }, enumerable: !1, configurable: !0 }), r.prototype.updateOptions = function(t) {\n            var e = Object(c.a)(Object(c.a)({}, this._options), t);\n            this._ground && !e.createGround && (this._ground.dispose(), this._ground = null), this._groundMaterial && !e.createGround && (this._groundMaterial.dispose(), this._groundMaterial = null), this._groundTexture && this._options.groundTexture != e.groundTexture && (this._groundTexture.dispose(), this._groundTexture = null), this._skybox && !e.createSkybox && (this._skybox.dispose(), this._skybox = null), this._skyboxMaterial && !e.createSkybox && (this._skyboxMaterial.dispose(), this._skyboxMaterial = null), this._skyboxTexture && this._options.skyboxTexture != e.skyboxTexture && (this._skyboxTexture.dispose(), this._skyboxTexture = null), this._groundMirror && !e.enableGroundMirror && (this._groundMirror.dispose(), this._groundMirror = null), this._scene.environmentTexture && this._options.environmentTexture != e.environmentTexture && this._scene.environmentTexture.dispose(), this._options = e, this._setupBackground(), this._setupImageProcessing();\n          }, r.prototype.setMainColor = function(t) {\n            this.groundMaterial && (this.groundMaterial.primaryColor = t), this.skyboxMaterial && (this.skyboxMaterial.primaryColor = t), this.groundMirror && (this.groundMirror.clearColor = new I.b(t.r, t.g, t.b, 1));\n          }, r.prototype._setupImageProcessing = function() {\n            this._options.setupImageProcessing && (this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast, this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure, this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled, this._setupEnvironmentTexture());\n          }, r.prototype._setupEnvironmentTexture = function() {\n            if (!this._scene.environmentTexture)\n              if (this._options.environmentTexture instanceof kn.a)\n                this._scene.environmentTexture = this._options.environmentTexture;\n              else {\n                var t = ei.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\n                this._scene.environmentTexture = t;\n              }\n          }, r.prototype._setupBackground = function() {\n            this._rootMesh || (this._rootMesh = new Ie.a(\"BackgroundHelper\", this._scene)), this._rootMesh.rotation.y = this._options.backgroundYRotation;\n            var t = this._getSceneSize();\n            this._options.createGround && (this._setupGround(t), this._setupGroundMaterial(), this._setupGroundDiffuseTexture(), this._options.enableGroundMirror && this._setupGroundMirrorTexture(t), this._setupMirrorInGroundMaterial()), this._options.createSkybox && (this._setupSkybox(t), this._setupSkyboxMaterial(), this._setupSkyboxReflectionTexture()), this._rootMesh.position.x = t.rootPosition.x, this._rootMesh.position.z = t.rootPosition.z, this._rootMesh.position.y = t.rootPosition.y;\n          }, r.prototype._getSceneSize = function() {\n            var t = this, e = this._options.groundSize, n = this._options.skyboxSize, i = this._options.rootPosition;\n            if (!this._scene.meshes || this._scene.meshes.length === 1)\n              return { groundSize: e, skyboxSize: n, rootPosition: i };\n            var o = this._scene.getWorldExtends(function(d) {\n              return d !== t._ground && d !== t._rootMesh && d !== t._skybox;\n            }), a = o.max.subtract(o.min);\n            if (this._options.sizeAuto) {\n              this._scene.activeCamera instanceof ji && this._scene.activeCamera.upperRadiusLimit && (n = e = 2 * this._scene.activeCamera.upperRadiusLimit);\n              var s = a.length();\n              s > e && (n = e = 2 * s), e *= 1.1, n *= 1.5, (i = o.min.add(a.scale(0.5))).y = o.min.y - this._options.groundYBias;\n            }\n            return { groundSize: e, skyboxSize: n, rootPosition: i };\n          }, r.prototype._setupGround = function(t) {\n            var e = this;\n            this._ground && !this._ground.isDisposed() || (this._ground = Ie.a.CreatePlane(\"BackgroundPlane\", t.groundSize, this._scene), this._ground.rotation.x = Math.PI / 2, this._ground.parent = this._rootMesh, this._ground.onDisposeObservable.add(function() {\n              e._ground = null;\n            })), this._ground.receiveShadows = this._options.enableGroundShadow;\n          }, r.prototype._setupGroundMaterial = function() {\n            this._groundMaterial || (this._groundMaterial = new qr(\"BackgroundPlaneMaterial\", this._scene)), this._groundMaterial.alpha = this._options.groundOpacity, this._groundMaterial.alphaMode = h.a.ALPHA_PREMULTIPLIED_PORTERDUFF, this._groundMaterial.shadowLevel = this._options.groundShadowLevel, this._groundMaterial.primaryColor = this._options.groundColor, this._groundMaterial.useRGBColor = !1, this._groundMaterial.enableNoise = !0, this._ground && (this._ground.material = this._groundMaterial);\n          }, r.prototype._setupGroundDiffuseTexture = function() {\n            this._groundMaterial && (this._groundTexture || (this._options.groundTexture instanceof kn.a ? this._groundMaterial.diffuseTexture = this._options.groundTexture : (this._groundTexture = new Ne.a(this._options.groundTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._groundTexture.gammaSpace = !1, this._groundTexture.hasAlpha = !0, this._groundMaterial.diffuseTexture = this._groundTexture)));\n          }, r.prototype._setupGroundMirrorTexture = function(t) {\n            var e = Ne.a.CLAMP_ADDRESSMODE;\n            if (!this._groundMirror && (this._groundMirror = new Ts(\"BackgroundPlaneMirrorTexture\", { ratio: this._options.groundMirrorSizeRatio }, this._scene, !1, this._options.groundMirrorTextureType, Ne.a.BILINEAR_SAMPLINGMODE, !0), this._groundMirror.mirrorPlane = new ur.a(0, -1, 0, t.rootPosition.y), this._groundMirror.anisotropicFilteringLevel = 1, this._groundMirror.wrapU = e, this._groundMirror.wrapV = e, this._groundMirror.gammaSpace = !1, this._groundMirror.renderList))\n              for (var n = 0; n < this._scene.meshes.length; n++) {\n                var i = this._scene.meshes[n];\n                i !== this._ground && i !== this._skybox && i !== this._rootMesh && this._groundMirror.renderList.push(i);\n              }\n            this._groundMirror.clearColor = new I.b(this._options.groundColor.r, this._options.groundColor.g, this._options.groundColor.b, 1), this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\n          }, r.prototype._setupMirrorInGroundMaterial = function() {\n            this._groundMaterial && (this._groundMaterial.reflectionTexture = this._groundMirror, this._groundMaterial.reflectionFresnel = !0, this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount, this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight, this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance);\n          }, r.prototype._setupSkybox = function(t) {\n            var e = this;\n            this._skybox && !this._skybox.isDisposed() || (this._skybox = Ie.a.CreateBox(\"BackgroundSkybox\", t.skyboxSize, this._scene, void 0, Ie.a.BACKSIDE), this._skybox.onDisposeObservable.add(function() {\n              e._skybox = null;\n            })), this._skybox.parent = this._rootMesh;\n          }, r.prototype._setupSkyboxMaterial = function() {\n            this._skybox && (this._skyboxMaterial || (this._skyboxMaterial = new qr(\"BackgroundSkyboxMaterial\", this._scene)), this._skyboxMaterial.useRGBColor = !1, this._skyboxMaterial.primaryColor = this._options.skyboxColor, this._skyboxMaterial.enableNoise = !0, this._skybox.material = this._skyboxMaterial);\n          }, r.prototype._setupSkyboxReflectionTexture = function() {\n            this._skyboxMaterial && (this._skyboxTexture || (this._options.skyboxTexture instanceof kn.a ? this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture : (this._skyboxTexture = new ei(this._options.skyboxTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._skyboxTexture.coordinatesMode = Ne.a.SKYBOX_MODE, this._skyboxTexture.gammaSpace = !1, this._skyboxMaterial.reflectionTexture = this._skyboxTexture)));\n          }, r.prototype.dispose = function() {\n            this._groundMaterial && this._groundMaterial.dispose(!0, !0), this._skyboxMaterial && this._skyboxMaterial.dispose(!0, !0), this._rootMesh.dispose(!1);\n          }, r._groundTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundGround.png\", r._skyboxTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundSkybox.dds\", r._environmentTextureCDNUrl = \"https://assets.babylonjs.com/environments/environmentSpecular.env\", r;\n        }(), Ii = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = null);\n            var s = r.call(this, e, o) || this;\n            s.onError = a, s._halfDome = !1, s._crossEye = !1, s._useDirectMapping = !1, s._textureMode = t.MODE_MONOSCOPIC, s._onBeforeCameraRenderObserver = null, s.onLoadErrorObservable = new C.c(), o = s.getScene(), e = e || \"textureDome\", i.resolution = 0 | Math.abs(i.resolution) || 32, i.clickToPlay = !!i.clickToPlay, i.autoPlay = i.autoPlay === void 0 || !!i.autoPlay, i.loop = i.loop === void 0 || !!i.loop, i.size = Math.abs(i.size) || (o.activeCamera ? 0.48 * o.activeCamera.maxZ : 1e3), i.useDirectMapping === void 0 ? s._useDirectMapping = !0 : s._useDirectMapping = i.useDirectMapping, i.faceForward === void 0 && (i.faceForward = !0), s._setReady(!1), s._mesh = Ie.a.CreateSphere(e + \"_mesh\", i.resolution, i.size, o, !1, Ie.a.BACKSIDE);\n            var d = s._material = new qr(e + \"_material\", o);\n            d.useEquirectangularFOV = !0, d.fovMultiplier = 1, d.opacityFresnel = !1;\n            var p = s._initTexture(n, o, i);\n            if (s.texture = p, s._mesh.material = d, s._mesh.parent = s, s._halfDomeMask = Nn.a.CreateSphere(\"\", { slice: 0.5, diameter: 0.98 * i.size, segments: 2 * i.resolution, sideOrientation: Ie.a.BACKSIDE }, o), s._halfDomeMask.rotate(be.a.X, -Math.PI / 2), s._halfDomeMask.parent = s._mesh, s._halfDome = !!i.halfDomeMode, s._halfDomeMask.setEnabled(s._halfDome), s._crossEye = !!i.crossEyeMode, s._texture.anisotropicFilteringLevel = 1, s._texture.onLoadObservable.addOnce(function() {\n              s._setReady(!0);\n            }), i.faceForward && o.activeCamera) {\n              var y = o.activeCamera, P = u.e.Forward(), R = u.e.TransformNormal(P, y.getViewMatrix());\n              R.normalize(), s.rotation.y = Math.acos(u.e.Dot(P, R));\n            }\n            return s._changeTextureMode(s._textureMode), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"texture\", { get: function() {\n            return this._texture;\n          }, set: function(e) {\n            this._texture !== e && (this._texture = e, this._useDirectMapping ? (this._texture.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._texture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._material.diffuseTexture = this._texture) : (this._texture.coordinatesMode = Ne.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE, this._texture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._material.reflectionTexture = this._texture), this._changeTextureMode(this._textureMode));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"mesh\", { get: function() {\n            return this._mesh;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fovMultiplier\", { get: function() {\n            return this._material.fovMultiplier;\n          }, set: function(e) {\n            this._material.fovMultiplier = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"textureMode\", { get: function() {\n            return this._textureMode;\n          }, set: function(e) {\n            this._textureMode !== e && this._changeTextureMode(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"halfDome\", { get: function() {\n            return this._halfDome;\n          }, set: function(e) {\n            this._halfDome = e, this._halfDomeMask.setEnabled(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"crossEye\", { get: function() {\n            return this._crossEye;\n          }, set: function(e) {\n            this._crossEye = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"material\", { get: function() {\n            return this._material;\n          }, enumerable: !1, configurable: !0 }), t.prototype._changeTextureMode = function(e) {\n            var n = this;\n            switch (this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._textureMode = e, this._texture.uScale = 1, this._texture.vScale = 1, this._texture.uOffset = 0, this._texture.vOffset = 0, this._texture.vAng = 0, e) {\n              case t.MODE_MONOSCOPIC:\n                this._halfDome && (this._texture.uScale = 2, this._texture.uOffset = -1);\n                break;\n              case t.MODE_SIDEBYSIDE:\n                this._texture.uScale = this._halfDome ? 0.99999 : 0.5;\n                var i = this._halfDome ? 0 : 0.5, o = this._halfDome ? -0.5 : 0;\n                this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add(function(a) {\n                  var s = a.isRightCamera;\n                  n._crossEye && (s = !s), n._texture.uOffset = s ? i : o;\n                });\n                break;\n              case t.MODE_TOPBOTTOM:\n                this._texture.vScale = this._halfDome ? 0.99999 : 0.5, this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add(function(a) {\n                  var s = a.isRightCamera;\n                  n._crossEye && (s = !s), n._texture.vOffset = s ? 0.5 : 0;\n                });\n            }\n          }, t.prototype.dispose = function(e, n) {\n            n === void 0 && (n = !1), this._texture.dispose(), this._mesh.dispose(), this._material.dispose(), this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this.onLoadErrorObservable.clear(), r.prototype.dispose.call(this, e, n);\n          }, t.MODE_MONOSCOPIC = 0, t.MODE_TOPBOTTOM = 1, t.MODE_SIDEBYSIDE = 2, t;\n        }(pr.a), op = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"photoTexture\", { get: function() {\n            return this.texture;\n          }, set: function(e) {\n            this.texture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageMode\", { get: function() {\n            return this.textureMode;\n          }, set: function(e) {\n            this.textureMode = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initTexture = function(e, n, i) {\n            var o = this;\n            return new Ne.a(e, n, !i.generateMipMaps, !this._useDirectMapping, void 0, void 0, function(a, s) {\n              o.onLoadErrorObservable.notifyObservers(a || \"Unknown error occured\"), o.onError && o.onError(a, s);\n            });\n          }, t.MODE_MONOSCOPIC = Ii.MODE_MONOSCOPIC, t.MODE_TOPBOTTOM = Ii.MODE_TOPBOTTOM, t.MODE_SIDEBYSIDE = Ii.MODE_SIDEBYSIDE, t;\n        }(Ii), ql = function() {\n          function r() {\n          }\n          return r.ExpandRGBDTexture = function(t) {\n            var e = t._texture;\n            if (e && t.isRGBD) {\n              var n = e.getEngine(), i = n.getCaps(), o = !1;\n              i.textureHalfFloatRender && i.textureHalfFloatLinearFiltering ? (o = !0, e.type = h.a.TEXTURETYPE_HALF_FLOAT) : i.textureFloatRender && i.textureFloatLinearFiltering && (o = !0, e.type = h.a.TEXTURETYPE_FLOAT), o && (e.isReady = !1, e._isRGBD = !1, e.invertY = !1), t.onLoadObservable.addOnce(function() {\n                if (o) {\n                  var a = new ft(\"rgbdDecode\", \"rgbdDecode\", null, null, 1, null, h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, n, !1, void 0, e.type, void 0, null, !1), s = n.createRenderTargetTexture(e.width, { generateDepthBuffer: !1, generateMipMaps: !1, generateStencilBuffer: !1, samplingMode: e.samplingMode, type: e.type, format: h.a.TEXTUREFORMAT_RGBA });\n                  a.getEffect().executeWhenCompiled(function() {\n                    a.onApply = function(d) {\n                      d._bindTexture(\"textureSampler\", e), d.setFloat2(\"scale\", 1, 1);\n                    }, t.getScene().postProcessManager.directRender([a], s, !0), n.restoreDefaultFramebuffer(), n._releaseTexture(e), n._releaseFramebufferObjects(s), a && a.dispose(), s._swapAndDie(e), e.isReady = !0;\n                  });\n                }\n              });\n            }\n          }, r;\n        }(), Ho = function() {\n          function r() {\n          }\n          return r.GetEnvironmentBRDFTexture = function(t) {\n            if (!t.environmentBRDFTexture) {\n              var e = t.useDelayedTextureLoading;\n              t.useDelayedTextureLoading = !1;\n              var n = t._blockEntityCollection;\n              t._blockEntityCollection = !1;\n              var i = Ne.a.CreateFromBase64String(this._environmentBRDFBase64Texture, \"EnvironmentBRDFTexture\" + this._instanceNumber++, t, !0, !1, Ne.a.BILINEAR_SAMPLINGMODE);\n              t._blockEntityCollection = n;\n              var o = t.getEngine().getLoadedTexturesCache(), a = o.indexOf(i.getInternalTexture());\n              a !== -1 && o.splice(a, 1), i.isRGBD = !0, i.wrapU = Ne.a.CLAMP_ADDRESSMODE, i.wrapV = Ne.a.CLAMP_ADDRESSMODE, t.environmentBRDFTexture = i, t.useDelayedTextureLoading = e, ql.ExpandRGBDTexture(i);\n            }\n            return t.environmentBRDFTexture;\n          }, r._instanceNumber = 0, r._environmentBRDFBase64Texture = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiPy9iPy/IvIzEfm5iPxCRH4lIt/c/393//9BRD6KyKf7f488fP74/PH544dJAF9cLl98IZfLBZtuqterXr/7Dt9982v95S9+Lv+gF/3i7Spv/8lf/vnf/vGf/dF/JfKnIvLnIvLvReQ/NEngn0TklyLy6/v/34jIt00iGJOBlxAsdvv54/PH5493SQCXy9t2ueh2ueimKorrFbjq9eNH+fDtb+TXv/ol/vHyhX4Fxfbx7euPf/Lnf/PfiPyeiPyhiPxxkwB+fk8AvxzQgJcIrGTwFsiAEXH4/PH54/PHUgLY7whgu2C7bLqpQgHB2xvePn6SDx8+6G9+84384vKF/IPu8iVU9Y/+7C/+jWxffiHytYj8VER+X0T+oEEBvxqQwCMJeIngo5EI3goIwVMIPn98/vj8ESaAbbtu2ybbvl8u2ybbdtluSECA65u8ffqIDx8+6G++/VZ/efkV/sO261dQXP7wT/7kX8vl8qXIFyLylbySwe/dE0CLAr65B/9vGn0gQwRMMqgmhM/J4fPH548eAezbZd/lsm3YtssNAYiqiogAAkCvb5/k46cP8u2HD/rrb7+R/2/b9Wu9yJe//8d/9Ney6S5yEZFdRL68/38khG/uKOCnAwoYkcCoEXwkEgGDDq7CeQfyOTl8/vhd1QCum26ybZtu2yabbrKpQvXue1yvuF6v+vbpTT5+/CDffviAX1++1V9sO77WXb/66R/+4V/dgkbllQi+aBLBV/dE8LWRALwkYCWCNyMZXElkwLTMeMkga/P4/PH547ccAVwuctkvdxSw6bbdtYDbTfSZBN7e8PHTR/3u4wf55vKd/nL7DX6mu3791U9//5+/gkNFZGuSgZUQvnKowKgLWLTAQgRtEniTuEfwaELw0MJvf3LQzynud+53uG+X6y3gN9kul+2y6XVT1U27JCDAFVc8ksAn/e7jR/nN5YP+avtWfq6Xy9f7Vz/9w1dgRYngiyYhfNkkgzYBWHTg44AEMmqQUYQKOmDaiCIa8TmsfmzB+DnZDQjgcpGLbti2y3bZHjRAdRMVvb/dcYU8kcDbPQlsH/CrbddfbF98+RPZfvLFnAQeieCRDC5DMvju/vmD4JkEvjRQgKULeGggowdHkAHTYxihg89vu88I5UeGAPSOAFTlrgPopiqbKPSmCKreUoAAkCcSePukHz590m8vH+WbD9/JP335k6/+tA86KxFchv8jMvhiogE4JQm8XhfKqOAqx5qRPyeGzx8/cgSwbXcUoLJtim27C4Oi93+4v6VxQwKAvl2v+Hj9pB8+fZJvt4/yzfbF9lPdv/wJnsE2BogmyeCRED40tGFvksIXiSbgiYSRRpDNDZ6BDI6ghM+J4fPHeyKAO+zX7cb9t4tedMMNAQju5V+f1uAtBSiu1zsduMrHy5t8ePsk3376KN98sX/xE5FPAnm7/782o0DiUINXMkCXCB7/P94/e87AWUmARQWVvgMuKej9t1RLBp+Tw+ePgwngsutFFdu26WXbbl+rSvdfbnqAiuA23QcBgCugV1zl7e1NPm5v+LC96XfbJ/1W9y++fgXjA3bDYXV+MuhRwSPwL3JLMFYC+HS/LU8HYrGwIhwyNOF12SvgM4SgztdifP85MXz+KGsA2C6X7aJ6bXSAOwrY5OYIqGy3d5uq4P5GhABXuV6veLvRAf10fZMPb2/y3b7vX7+g+9v98/WOBq7GG7RNAlYy+Dgkhhb+Xxp0sE8IAC4SGAP/TbgVJK/PoJPBnAiwPKxsXfbbnRg+i3s/JAK4Q/4b9NfLtomBAqCickMBjy7BuywAUVyv8na94tMjCVzf9KNcLl/0SeA6oAEYb1i9g+FtSALb/bKL8/+t+wxXFMyswqiHoK4ToIgKqslgpg1qUC0QoYbvJZg/B/q5v4szHmPX7YEAsD0CX25OwEUVm9xag1+agKg+nxQArnKjAtDr9U0+Xd/k4/UqH7bL5YsewrcBBiMJZPRAp6TwQgWfjM9vgRbgUYGL8AvLWH2gqhesCokeUmCSwPsnhs8fP2YNYMO2XeSmAWxy2VQaXeDmDIhApf33rD4PTUCuV+DtCn27XuXT5ir8VmCJ2G5BpBM8/r/dEcJb8/0lEQMtJHA5TAlqNuLRhJChhEpSqFabH3di+G1AGj+W1/dyAR4IYJNNnuLf6+tWC9CHHiAtFhAIFLjK2/Uqn65X+SS67aK+3QeTDoy/IG2ogQ7fb/dAtz5vBgrYGqrwNtCHsVfgIvwK07OTQBURVNCBFpKCOjqCHn5L/67TgTN+fpySAC56nwSUi256kXsSuFGAVyLoUIDo8/Pz7fdoErr/v17lk162HbgHvFpIYDfoAJJfW4sGPjkU4VNAF8ZEcLmLhdc7kljdY1y1Dq9yLiI4IiRqcLujb138KIPn80ejATwRwIbtBvn1cqv+2J78/5EI5N4cJA8qIPcmwRsKAHDF9WYP6mV7VmrgLuTpxYTcMEW0LAmoQxFsuvAI8tv/a/C5fV2ZMMiKg++FCM7RDPRu8ebWY7VG6VJi+Bzk35MI2LsAckMAgwvQ0gC5DQjd3ABg2HQLAPpEAlZ1Bu7VV7MGHDFRAbo3VKsTbAY9sPWC/uvx86gBbDK3D1eEQS8pbAeSgSwmhepnJb6uBv/o/PzHLzxWA/X7TH77De5j6AGQi6o0CUGfCOD2X7cXAlCFQABtEsGLDtxuOyQB2UTQBKZe5GUPXgkUYCUAbZJRhBDeuq8xBf+bgwbehDm+BFQi2IJksOocvA8ysIMfxluVcRsY/eB3JzH8GFDAXQO48X/dcIf9jyDHptIigDsFkEe066tBSETQUYF7ElDdYEBytN4+rk9UcBPfrKaZqFHWcw3i4J8/X4ev2//bSXqAhwTay6OEIPLD2Ipt8OtAGzxkwLw9WVFRjTc/qC6H3+YK/b1oAA0KuOizHfieCLaHHiAb5NYTIC9EMEbZrVEQt1xwhVy1UfBh8PUOquMizwaap3tQXfY5B//tea/NZdfhsvbz+PURQTDSGWB87VX/7WSd4KxjUqrIgE0IUkoKGnhIvwvawpGf6eECXJ7tv4qbA7DJgwpsKthEmmYgfaAAffYF3HLxo0vwNjJ0SwRWMG4db4eh1gPNm18vQ+us/0eGmxDemu/fnM/X4evq/8342ksGHgLY5LyT/zg0wM8lcMjgGFXwqIOVFJBQw99eCvF9oZL9Mfl3QwAvIXDsBRC9R+fz8x0FPBLB0xJEpwUobrfAkARgIAF41h3wQgP6QAmX5E/7eI43IxGwwf/moIkRyWRJQIPgt9CA9b39nzt4bYUWjAlCjWDPgv8IEjgLJfzuaAsrv9VdVG4OwOXW/fdoA35qAdL0BDwvf6AAUVHd8LIEu94A3K+Q+2YxaB84MOH62P//qoo38fCRDERE2zf0JfmDa+MieElAjcDPKz+mRKCOtdgGtXaBjgNJ4H2owSpNeAW/rRH4CaHSpMwnBYYycjgSJwfie9CR6mPu20Uv8kABF206AvXlBMiIBPSlB9wjBW1fwEuSb94296VCqgMaGCt/G1BbExi3IG+r3a3J6P48Gv/J0YmEYoiGY7V/SxwFCwGoE/xa0AJ0CEiV9QPCJb1OJ5F1VTjEY2/MO9AEJvj1BJTQpqLfTlGwjABuzT962e4IoKnyrdh3+/6mzDVJ4PHOxj0JqGKoy20+wBMN6D1gLWi9NQHfVP5MEEPzjGYy8BMAOnTAJgEr8HUIejRo5xrA5xkR5AngmiSHs+zDDAmMgWzTg55GSJEmHE8IvWPAoYTfhWak/Wn/bQ0CGLSAjv83SUEfKp5q24LXuQICpzrjrgWoza8xVE00CQCORdhMJuTUT/rjuls0gO4Iby8BIEgK6gS7BsGuTtDrScH/fR68biUHNVGBnxjeNyHEvQe/ve3LZQqgG3rof6cEclsNflG9J4KtaQ8WHcVBHS1BtHE4QP9OBMS98mpbKTeDW7dJwRsnHpMBTFJpV4I+b0kY/NqInVFSyBLANbnMSgBM8F+Fqfxq/h657/Up+GaBnwV9hRqc9bZ/vA6vu+T9E8KPJWns94UfTeCj2QXwCHS9dNL8Xf3Ho/rfewSeFODGDV69AU0y6NFAE1DP3qK++rdB7/1HRxf86gT376zOr99T/h/ioBiXWQkgQgVeIrCC/WomhDmQK+hASI2ARQZKooHMLdCJwGEBBXC3+uERwg+VOHZ9ioAt9H80AI06wGgJ3nQA3BoCut6AhxYwgcPOFnxuFnrphk+NIKIGrWPQtgz3b0i7Y6D5rs1GKqTop0nQX52vmQC4BkjA+r4a7Kx9WLENGeegkhSETBCrNXIMdi/444Rw1n6E96ry7OPuj8UfLxtQ78NA2iSBbg7gIiIbdDLsb5agPhLC3RkYKv8NDbS2YGsatNRAG2oQwf9ZIOydgy1MAzBkAw8UwEEIDzSAqdPQ6za0PkeJAMH3Z0wXniUSZoHvBXU2mcjQgv56TedIKglCpIoQfgwCIjOytd8WgN0bfxoR8Fn9Gx0Aj5Zgq0lIZbsH/ibSJoFnS+C98g9ooHEELI3gliy25yONIiE6pb0NfBlyNEYyENoodkKwgl6I6s8kARgJ4ZoEfuYWHLEJa0LhSBXm7kImGeSfVdoJ1DO2G7WXsehAptupSOoyrCSF904k+6vt98X/ZcM98Hsd4JYIXhQAIg3/f9AAUYhsLQKAtkHVBnzjCKhOoYl2ym+iBtvzDzQ2DLXJ4PUmbJHAVnBQX4jkxfvHhNDqAdHXGQJgv0aSDGItgOseHIU+K9hXnIJzkoGlEKzNHagTdJ6VWEUH4iCKH4fd2AwDPaYBm4Wgng4gQ9V/CoGiuNmD04AQtNGMGzSAAQ2I2pzfogY9LRh7BrbOh4+D30sAencljFu2CUFrwY8UAWRfWwGvVOVfbx2uIILM0pwDv082dUTw8hYs8L+uIWiHGpWgClnAa1lMPJogovvvbePPs/q3Xr++kgCsfgB5oQF9WYKPJqEn6G+OE3i5AqouF59FQOmahQC8rlPLj38kg1c2f30vw+XaoIX24/pMGIgSBoZqoH3wo0sIIGlA9PWcCPrAtpPB8eBf6x1o6cHra+2+tpIFP4PgBfxZtZUJfo4qxELT948D9ucK8Mt9+ccjIQw6QJcEbrD/1g340ATuDgDkFfx6twSf1f9xvuBECYxq/7ythQQGm+5JDx6Brw4CkMGT3wgscCUoQ4sU2t6DR2ciBjTgtcpenQoZVX9NuL4Owc+dVaDursYVkVALX+shjSBKBuvCYDUZjE5BdNkxdHAUBexyHwB6NP7Iyw7sxUDViwge1t+mz8B/LAvVx/c3PeBBCToB8IUGOgqA3iV4yUg6UAOxaUFHDx6CYS8SorMOue0CCJGAf5YfRhoAI+A1CvwxqNkAY5yAIx2EQmkFfeWOXi+nEdSQQA0ZHMEItiagJArQxDXIrj8nCfQi4HZPAttrIahso9oPQ/2/JwV5JQU8zw+7I4D7/sBn4EO6rjw0FR+i3Z9fHtahzsFvJgM0X+tmVH5vaYiNDGAigewAz+gyNLThnjCURQFR1b9d3lZvnVqmj9mEPDKIUIC4KCCjBXywS4N+otp/Hk3QVthOkwEKlV9PQwXjT7s/zwF4Qf9toAAzFdjuaEB6S7D1//U5FIQu2MevO0rQQH8ZmoXE6B/IkgE60XCjVoq8gt2iCG0S8L5GdxkM1cGsfsCMArSCAnrr7dzAZxCEEpepvB8tqHJ/q+bmJGGts/AcAXFOMMeTwC7Pw0B6CtCtA2vWgonqBQJFSwH0JQK29OB2kvgj2HHXAoyeAIsCQO0kMNECAhFMqCBf8mElAkyBbX1tJQP2RJ/ha0gpAfS9l+/5n00CkrQpq0MZbOdAuxmMvHswog62jZj7BnYQe19b14kxNq2D/ehX/p68HEcF+x3yP7z/V/A/q/5DA3i5A/dzA5pdgbKp3v3/wQF4Bb70WkCTHGRAA6+KL0bFl6FJaFw0ImZwm6igSwbbwPn9RMBWf3sN2JgA/BVh/Rg0kQBgePf6HglAHLFQwqQQOwDjbdVxNZjR4iM6Qa3WxwvNxh0JFb3g/WzFQQS8b/ttKcDWoABtUMAd8j9hf0MB2uDXhzX4CHj03L9DBU3Qjz0C0l4mLSLQPicOOwZoVCB6P6dA7nDbGkVuxcNr8PU2JQO4wX5trEqmccZaHU4q8oCDFOpzAnOwqyMIMktNNNAHouDGxO37DgArQZzlmp/14W1QlqHTMaIIx7SCx0+5yza7AKJ3IXBrNAHVDcMZAU/BT/vgv/ULPOA+XiLggAREDF2g0ci6xNDRglegd7P7TWWH5oJfayliEg7bScQRBVgI4Ookg/F6rvpLWP29swREqA3CaG8/FpKqS8DTAV4TiBqIqtxfzaQRLys5I0XEFIFrPbZRQb+16Fgi2LvJv8EFUPW1gGfQv1T/F/d/HBnccP7rAwnIIyHI4ArgWeGbU4eHy6Tx/EeTZIb5bo/BsMBjmjBE08f/RB0PHYBd9eVRAGY7cHRwiBf8WeCPHY1bgBTa9xKTELzEkQX9CPtl0gJiqsAmCT7I8xbjivh3JGFI+D2nBcSJQJ8agDX+O9iBL7UfG4bzAkcaICrbtYHz1ycSmGmAjJfL3CMgT3tQpmrfB7gxSzC1DnvdhQMieG47u75+kTouKNkM8c/+vq/Q7ZYjO/hhVvRq8F/9gGfhP8aqE9EIdR6LTwJ1h0BItyDqB8iFwuNqASscRnYioxOg9ApvnYA35f8e9Ohbfe8J4rknoFkO0lmA2gmAG0YK0DkB4ieEjiLoMD8wBzom27ANZkzIoU8EMHk/uo1mzeVoEoRWKn8L/62EYAX/lsB7D/LXg74uAMr9oGivJ0CNJCGD6i9DhZdQF+gtOp4S+NODRzsDVbhdgv4BqTMNyIL9SCKwL9/FGPp5oQKxIf8A/UX6r231H7YIqLML0Ae2GtrADOvRQH5b/MPE9dt9BGLNG8jVTAQvIaK5TtvvvWQgDvyXIClUA78S9Nfg7VtIBlO7cbsEYkQDMot+ygQ7QwmOawTHnAM2XUSnJvPIYRYMmYPS+sv3J+cfP3d04JYIXsF/EwMbBKB9Q9AY+BiSwFj9mzrSXmcJhFPVHySTbgHJCPvRQ/z7G/SVUETsg0ZF+i3CRoCjhf7y1A9mOiDD7TwdwEoEXjLwAv+avLE2B7Jnb+OqDpBoAchoQJskxKnss0vu7Q2YhcDv4ySeLOg9GsCKiUIihP7yfW7zbTsBh0TQfN0iAWn9f72Z56/Ax9P7j5OAH/Qvv3/QxKfk0DgDuP+R3USg3bzBC7bO/QT9Eeh9QvDPG7glBQzJwK740lAFFgFk8P88CqDGAa223YckWYhr+c0BPdwetl2ocnsfzePAWcVnnAIp6gDVhDLyfV4nqFEDPxHsbWD3k4BDkN+pARqKMLYBPzYEvxp9xmCHQQdgWH/9EtH2TIFpu3AH/cdGydv1j0TQbRrq+D/mLcX3ZACZ15bF378CG0My6Kq/zoGOQwhASDFwFbxyNGBuSxbCEhQ/uEPe/6gAERWQObCVVfjPpQX+rexxYhYFxIkgpgX7Y/vPs+Pvxf9vwt8kAs7i32t3QCP+3SPaTwIytQXP38u0PESm+YER+o9B3vr8mETAUfDrEkPI80ck0FZ0dXh9U+HRbhey0cAc2H7A4y4egoD6y8JfkBiigLdFP8v2W00E8deT2IeAKujZ/QAVKpAtKI20gLWksHedfgPcb+0+NEHefd9vB9rayi8h7J91gBbaw20MsnWAF5xHkyDUCOoXp+yrOwwxcKj0aL6fFppaaKDv6OpHR5sgx5BAlK/+fYhuP1D196o8e7lFBaKqv5YIMnFQpd0FGVR35RJCnCDaABaXBtgbiSwtICMtalKC+1JQ6bx/PLcDPQL91QFodQNKpwOgF/9eqcBxBBqRcKAAVk+ArQOMx1RYGgB6naDhlK+uQQwJYx4meQbxtNnYQwMjt/d4f3M9ZE4UOld1LAh99fbfzOxiEkKFCkTJIUIMUeVnJ/9sDt8/e1NEJOi9oVHDGYhgnSLss9DX2IAqw1zALUncKcDr0FB5NP+0cBQNrEezDiyiADPkt9qGpwoPdL0AGPx/NOKeyf3b9WJNdfcFv6bKd2cLMJVfJ6Y3B6wB9WFUfWWEwKMfGiQL+3bz9XGQz2EHKhF41GCtZyDi/gUCsNhYoAr3UNJ58YidHKqnMb/6AB5J4N73/4L+t7mAkeeP3P+1LNSB/l0SkMEd8DcEuUlguEw6t2AU/PCE/q++Akw6QFf1u6SBrj1ZnnhG50AfkoGIdf7gJv1KcSfgzWWkQ9U33Z3tHXYASKJ9e/YhU90rvD+q9Ej69/wxYJVs506Eg/r3DkMDzEdDBRGgcZay49XihLA30P+l8N+hf1f57/0AoxbQbwYaan/rBMirE9Dk+sBzTkC8JNDEUlv5McB8PP19Y01Gayep+hC/2zvQ/2HGLAurowsNGlA1cnqGGzeH5weiYLZm7h3QQC4O2tXdhvMMk1ZS5ebpgI8eMrPvPGkwaxayk8Yc6PMOBPEdC1XZ+2UfbfOPtxLMQQAG9BcZFoF0gp/RKjxe7+oAw9T7ZPWhgedodgz0gf5KBtrtIZhQAZpAV1Bi36w6t98qVfH7hqGI318lLCjLCUFlxRHwqYEH9a2qb4XjWvDT7kBwfbZA5P0+PNuRuW1yf4yNQH3zzwv6b70QOJ0G9OT/dhoYRUGT15uQH/71MjQLtQlxfDuiCXrtM+SkA+icQdH6sU/xz7Ze7FlubV4TpoTQ2osdpaEjtqADmEU7OkBEFoLeC3IWFFeswJXKXzkboNL+wzcFHU8hTGKIboO7CLi1/P+5F+gydQhuvRbwEgxvtACmANikhLTbj0gCYk8KdlYgmj+4Ymaod7TwahwadICuX0Cm2fE5iNHPK0x/CDV66Kyg1MnqjNFBnhBoLQCgUULfaVe5nq/6EQWY67bXCszUb+7232fVPz51iGB12owK9peyP1T4raMFF/OEYJP792mgXYfZ04GHMAhBkCSmSj+dKqRPgVFGHbpLEGMiGFeQWfSgrY52VxaeDUPSNJI0P7NoisG729HHl78z6hxfs9rV3m4JjgM/lsui2qmThjCfDFSb+I9vwUqG5wwL55U7C+6ot8B+7N2o6r3q37T9trfpjgmTvv7PSQATLLeRAOZhIJHBQfDQQJPBdUwEbVW3+L08EcEE/9G4ANrCeWcnPKRHDupbNynMx5AA9IRYLmrc/YLSiD5EaEBS/s/TgnU9ILcH19n+CpHwegLejx7Mn/d25fdN+e9U/1vgb7bqf08MOtf8EXxaoh+GY8L6gDfhvs4i6HQ7seYI2sv1GchdMsBIG3xlvxcCRzdgCPTn+6q/TW00VE8Q9FaFv+R2VlOM1vm/hhjhDCdgNflVKME5B47I9xT8z0YgPAJ8myb/LqHy36j/Mwqw9AALxuO1JVjiuQAYLcFzIhiEPe05fk8tRjGw7yWQbsfuLAT2VqOId1osnr0F49VM8INACPHDoBz4B5mqqSnUgyh3ArjXxfQH5BbgUS8gP7aU+w0zHD9GGD0CGHf+P1p/DeivlhU4BbxR9a2kYFR58YaDZCUR2P0DMmgED2eg77puegy6PgDphEB0CwlG/i9d+/Hs34pBEQrBn0W51mqGnJAk3ACCHeiqkQ1XFQA5AlKH7Lk8yJKWY3/nym14h2C3JvxeMwD9ZVMz0BPMi1n1RbKl1cYhIVblF3G0ATsRiCMUvoK9//OgcwYMoe+ZKOLlC6/Xk50br9NFz9fanqA8UIYSpCwlBO4kHc4WLLBfBHVaKwKgLQjmP4Un61Vq+3s7Bsyi0WztmLjJwJwFeE0I2vD/1Q6MVwefxfUf32skCPbCnxQqf+QMPEUDHZ7vGeyj020JgkPXXwsldA7SYR1RE3h94NvNtugswcgxXEkIcBPCGZ1rmrgDC0A4K88nm2fn/eTnpQtWyZfybRoK8Dro4zYDIMGsf7saTBzvX0SMbkAD6o9CYbsfMK38cJKD9l2FJt9/VGs0h5Gib33pxMKWNsigFUh3G2un+/N1WUglI/EEx8fq27vUNnwsiOoKecL7kQS8VnWAGCFUgn6dBtQhv40CmIYggwK0uwDHRGAuBXVdfwzHUjZzATLMAoyJ4FmBhzaWBlrHld9CCWpPHRqofBqMReMGTJ78q9rDes1Tv7/0m0v0AFHXNR6P6g30SHivin7V1BOhh3iWPwvps/yE836L2XiwnUT8x2iHgfqhnwn667QHEE8oLQjEvtEW7GYBZDrDVkwNIO4G5GiBDf9fGoFM6n+vbEtzXwP6u9AduaWnGYSLAlVdl/AU+ikrSeEIKgwdaZ4AACAASURBVKj4/wtgHcHtdO2nWKcBkPfxcvnNQvsj2Me9f02r76T8q0IBn9OLKfz1HX8yVXQYGoAB/2UeBQ5/5kCL6+H/OGGoRnLSwdd3oH8r7KkGTbgIxEwVWvnF8KOpHnyzfF9Jod5Px+IF1h8owyitDw/XEgRb5bPqbt1uvn7qBIQ16vtS/u+DP3cR7CH0WWJgd5mTJKYgNzoGjQrfvu99NDBC+bnyW1x/qhTatv2OaMKgJWPvv5kwnMgxHYGFRtJW8VMl3uP+MgoqSZyWFKr7+KIDw1d6+IiOgZI4+d5iYL3imzbgyO+tph9t2oSBxOM3ugHtPoFZ1LM0hF4kXNEBssvVgPdjdXZWK7uKvyS3q1Xb1WQwtVDqSUggq+Vw3t56JA2cz7PXOwGNW1ecwxPhfe3QEUsDsFaAz8jg0nf+iZMAHNg/XSazDuC18Iq1HBRrOsAQ8NLB+16g614jmuSgs3bROxE55D+WDDQNA4ivdMJ9M1b309UqknaDU8ObV9/PwmMPATvTMAxpABLBzugUtV9bLdhNDQA+7B9tQJ06/7QNDHGSwtgZOCIA47InIoDdROQGtt0U1HI3GaoUnCnC/rzBMQJteN17+VaAzYNA7e+PFqHQUyXPUYB7iQYa5ZFjq1Zqpx8Uqu/XT7+6BWC1Xaj0GlBIwMoHu7UzcI/6/Acb8KIq+hzmGWmAYnADrIpvKP7TZeLaf0LAeQkGgebbq9FToI44p654F47tekKkI0L5PQNZPsDwPBpy/ni+wKMN76Vav4+2cFZFf8+JwAraMt0DFB7beA/u4Zz/a+RXx0M/ct4/jwaNAS8G17eSwmta0Fhx0VRxJkHMivso+onMXr+YwdWKbgioy1jp4x4AzIKg5lEA7wvHEYCRmdx11TAuT6lDLVl4KvXkAET9P4RT8H2u+lg9EPQIpw+/NpJ7RwE8HaDv/Mu4f3OdNkq/EfAiEiOANjEALvcWL9gfFV4NZbgbQc6qPky4Pm35QZxtH1f4j+P/jXuaYPcWwIEH/fmEPBoAO4m4LGxV3txOQqDU+dXgey+UwSzuqP++uImO/u/6ogCb7wTc1n61sL+vZi87rxnrNas+giTg6QLzaUCjIp6JfhwtGI7AjBBB9JjDY4ePYVR6ZPgN4owVv6Q2N5hhVHwNeYrM+w6dN6K1sMHZm/Ce7bHe3dzKr1xw1w4JrSQMZtgnoQHlr18fzunAszD4qurNUg/TDqzx/lfCaO6t4tACMUQ6P6htWjDPC1hCoZ8kpODzJ70MUR9AODcgwyqyPhmE+wfHYB/hvSqt6qeXUShhXH+d9SR8DzrDaZZdpSp/HxqLMQuATgDU/qDPRgOIeT8cvz/h/XC6BtE7ACLOWPE0KIS4UUjmZaJ2grBphiWgT41BUVWZfP3AnEIT6OrfoF122l2rMycBoU5i/OXoUZ4/aglsXwLzHNU++FVF3qikOj5HXm2PBitT1WuvJRAB+6O//W0/PY8vQH5IrAsMs/WuVmAdHBrQgrbOxJShXwRSsu08h8JMBpo0+aDTALwV4tbswgzHrftG/dJKIAQb5h9KCssWIMeto+GYqG12/HWGjx8kzqNJaa0noMWOr2KwW01AMwJoNvhMQda2/RKQP/3ecABM3g9uD6BY68Ntz9+nDOMb5iV+hIE+dP/Zs/wwJhJ9mgBnohBuStABUXjugF3hkXF9ZZJAjefKdHZCc389LoStKvIl7QIEb1d9RyciQgFDI9Cjyccc/23Aam7/PZJBhgDgin5CtQvbCzX8ip9YgIFtOAt+w0owp/hOiCWgEGbVHuYjRigPGR/YOnEoqPDoV5z5YqB3mRq2ox5ICmSSgAP1Ne+XV2NE+/vuFbCTRADxtS70VRBCjgBk2OyDUQiUgfl77b7DwaHm2rAZ7osRSOOUoHgKfNBSLI767+oDYrfwZvqChSpGfj3pFwZFsCJg2jeIQQBUiyI4WgD68ww4qO8khuWkkIuDrxWv2nv+UTBpJYiPd0KemTA8qqFiuUF1jWS3BoG6pADJq751JqBI0wvAVPyMQvjcX1zbELltKK+zBiXRFiRxG+b7q3M9xuLdzR8g0gCGNzSM5gNYfqGO9CBT8OHct6oB3KsSDBisUnwsFuISQaRHxDSv0vptt2oeLHMERfRn/FG/Cx01EpgIQG8LP+/i37PKw53xn6sYCM4/JwSRrCnIeB1ZkLsawDhaPKv/njU3wnZ/dBdGE8+YTHSG8+ofGgIjsC19YnwdM/KAnTSsqj6ig7uGgIPw3nYFzhhIIvriAxFP9CQd4HSlnzgxONIdrE7A8ZDPx9fjib8ifgegNIliRgdx95+E1T7+3nQVNNhEzDgGA3T2rEDLduwtPpuuouPcs8swwXFjdTaMKt+jA5gUAQPcf95KJQxYU0cYxEDvsBSmYuukp7AwnqniC9Afa5z8vboI68ImT0t26CvwBzSggkj447r9IojvCn7U92J/Hw0QSdwZKNNjxPCfSxRqnATkdwpOwh88oc4J8KTSm/wdbZjrc+4iFP8YO0/5JJDCfaijK5xVXevqfg6zGRrQf83chvX4aRfAE//6vv5+6490U4ADdO7QgM/5bcHP/n4OtCQhBEFeDWSvos8DPq8/IwzLzjpa8/U6MMSkBklDm8e0mn3QIY7XG1Om8wzN48y7HwhOK3P0/ZwUQHHv4psbdoVeb9VlAjChBCdtDDpOKTh9ZfcagOYq31RFjN4/gwBYzp8lAwYNwBELhZoxECeZxMlAzWGdCRV0fQWGHo8+8Kx+AAxnCIzowAxy9KvNepWfsfp4RR9kUrD88CPVTuXRybhqqTHcnxEGndsgub1Gdug8yz9fHt3Hpl57x/mfCOC29FOSQ7/noAZR5W3Ob24UMpuPYAYiQrQgk1gnFoUIKr4vKFpV15pHUJO3Y5rfH3UFHU4bGkU+NKJ9f2hJyOMxDBDpjAgwiYqvk5TqNl9EH2Arb6fA3yaA4cBtPWewhkEcIQJBlGzYp6zRmr1v+e3Fv27xpzvyI44NGDkCIi7CGNV9Dw0M8NtHC2vUwHINumCGNG8erxOwtQINsW88Tlwdoc+F85nI559ngEDpt2F/Uu3hiXYrkN/pBFS26hYDAkFgErMK67y9mGBA3L5ore5izf8b3n805MOq/t7XU4WHv1DUF/5gugCSOAIW/59uMwl6CHWAib8bvfxWl9/rBGEMTTwDfG+ezEYG4yk6FvRPuPwE+wvc39IRjENWM+/cm5b0W4Pf4WuKUnw/vD6eDbB1ETs5vl77Dhnm/51g6wPWwQAqxnivgQaeS3gy/u/1H4hpTPrIgHAN0mSgXUX13YP5PMIuQAfBr/f70cdeE+QoCX3i8nFMLcAjInBoAIYqt1LhC1WdtvmSab28AYffaeivCB+ohdYQgfUa/WS4ToMsNLHLc9nnvPZLwn1/EefPVf+U/xvnCVSEQEkEQEnEQJO7S7RvYDxNeNYKrG7DKMhtsQ8cMmhgPKKKj+F7CiHYFR5KIIPxOmg5IVAtu3ACQSPh7CzUQOgAej5CWEkIe3vgxz0ROGO//qYfz/dnLT+ZxDr4QW0eNCJBorCFOVC312Ec2TiY5Bk0cAaQmiA1VH1MOwDHQ0kHdEDDf+2UTWhS4Z8diQMicLx8MLBfverLcP/jQzF0P8EJj5+NGK9RCz755S6F/f1+X/gxeP+Wsedv+vF8/54aSPJYFjIQd624MDz/UDLQnr8HU3ztKHRf8Qeno1vyAQJBaLcMtTV3cvgP56COCqd/QP9xLgBkH4BxO13n4hNUDtACC6G1S3zqooZ6Ba4lp/zcAFb7iERKQwQcF39IFJjdXECGADw0IE4gg674pYAnk4HoHPx54tD5daO5vxrugSkMjgiiqc7TVKAT6AT8R4ckbHEQCYR/IZBxJgA+XZjsR7vaoRpIxWqeqfXuGC2CxwudicwePEB1kNkaZCuwyF0DuKv/4sz9mzP/Qxdg3BDkBTMC8Q+loD6UGBzx0Kz6eAX/KArOQTlPHFoI4vVtf4rNuLrca9edRn4xBP7k8w+9AgZCgBfEUZWfEs8iFNZ3UO7TqmkjCO/rWdgco/yIqHcQWaC2EGTzgz5y/iXQAvyx3riyxxV/JeBriaGB9OrTA5g9/eokM+37GszqfA/UZk9iW5UnCtBqBl3XoNN6Ag/+zy6A5evPAp+TIFDn15gQw9rjrOzFX0s2JBVAxa/nP1a6AsNWYGjPNGPLTQgBsNUFvOA3Ht9o/rGDN0tWOCcxJGp+f7++kkP7PxcGv1+GjkaLt/fawpwwerQxBJNW4b+PJsYEgiAYYdEAGIlDNaAbRkIgK3ut0jKByp+8yz23X6GttmBmjwDvChgiYLP5V/zhH6/110sGcKo5CkggCngxnIPoPja0j2B+1BRkiYJiviaLJqghDI63G2nAgAxMCuDdnoD0wIQm+urMB3VuAwbBrFGgGgnhAFqg9+ujKsLxB3qGCQNEEtPinIQlAj4WgIw7/iXc9V/x/yUWFs2KH504bAh4aYWf4TrTLGTy9YbftyLeVOWNfYNyt/ji29mQnqMAltU3ioTtbX343yv/1u0YPUBz6zB702tQucnX0gWaFh6DgPdmhXaapGotw0SFz1qDiTMdd8h45HfcqCPRUhA3+NmKz1l9teCPaMd4urGaewRitNBDdahR5c3AfQmDCFT9vmtQEwqAYXX4XI2n23Z9B/Yb1FL+LWox6wHGbZSo6FR1LzyG+3hriSZvWT6jfXhl2cmQZJDrAbuYAqAHo1GA/EOgD8eGcU7A8eDvH4fQBuAhBL/Zp/vamPTrRENDGLTV/7E1WEPLDlP/PwzU4YhusIMUgfIPAr6Dhv5R4y2r8ldFwiFoYHnmr8TAHbhRQSZOctH598ZYhqt6wP7q/ouqe77RJxvzFYaji/z4vna4v5cUMDXqDAJ5ytktqtBDckyjvJg04hl16LB0xFfyMfD77PZjErGQRRjYIfSvoAXntks0ok8MsUC4KARWnYPlJBeIgLeFrUgDOHYCag0/XNAbWgRwQuLAsaQwIhC1g7+jCNKuT38JfnYSyTi+QQEwwHeT4/dWHYxJPxfOj5oAnRQqgU3YgGZSOaDyK3n/qkDYBKptzR3oD6B4fyRKjp2AzSl80YR/3P+/1vBjX18Jbu+YsrMRgbqPP8zrDLTAaupphfeZtyPs9BPztpLSBZjowF3woYRwBwOWaqbev15b7X4RWsiqYiY6ZkFEIoUwUA2OrkeEQE8HYNyD/rl3m88jCGgO/nPW3xy8x4Q/HBcM1dYg5q8N+B/SBSYhtD0EY1PRGLDoKIBHF3yLz4H/gSYQJRETgqeB2d4vC8L2NVnQn4PoVJJAcP0inahAfdXVI8CFszjRagCTtRdV7Sr895NBpRKXIT64RMFw/iw5eChhEvmmyUIH+k+Qu3cLzOAN6ILlFvgWnx3YWFDz0f38ze9GlfP6UQ3ojEY0gtqRIEbA5/WgQFhsEuIeL75uTzvqHktAWfj/OD6sQXssROcGiRgFn0QVkld7OznMDT7CJKzhMIqxW9B+LCOQdH4uyxIcE49VTSeLj0wKjzcp2oDXQA8YoDEGBLMW0BJw+eAxXejPV/IXd59/tp5rVyYXDw5BlRetSpQAcvgfOwVM8ObzBq/AQ2wX4lwkQV3vNhYFfn2LFgaoDU1ogqsfqGkJYmrj9Tr22KQwBLzbLuzDeA9yzyJjVRfwegWq0H+FThDPA6ZhZwX2M2Kh4waovCzAWJTzD/qY00c+6PM8coz08VNqglzx54LfHuTJK7z2rwX35ABLg1DzsZ7Qv7l/f2yXDlbf4C/irg0MJ0aCuD0wP74MrxfdFlX7tq+vtRdCpvt599EG9Yz3V+P+Oj/n4zLruZHcJ7oMt/MNp9eD6HEeFb6/TMfbWo85Pb79HJo8t3371/PuIAZqMvjPC34nVV6ZB4hEuA7AzA5cfU0y2n6ux89D/35/n2/vWY5Bf0qwf3tPLISO1Tap9qzFB6eap/beqI94NCCbGwgqOItY3CGl446CaQ8i2Q9g0AvmgJOnBoAA0gu17tsKtKS7D4udgCYERy2QIceCX/P7mBW+g/7D9S6Mn50CS0eAoQPDcBjopIA5+EcxEjLweRjXq0UbLIjcBxsGx2IZvlf0ATjz/6qypAmY7bhrk4ahsIis6ccXKHdueAfUgk+RWPCLh42c6zEeKyJpRTdRAOqBbl/Wq/uT+q+Fx3FoTIuCzc6+hN8j4veGjuAnhSE5gKnco3A3XwYlq2sq+lmP4yEOpqEoG0M+mGDYuYT0pKCFHgLHKt3T7T9p8GcWH+n1UwGa8X6kQt2x4CeqPexegT6o/Z4Cr313PHdgrsS2ZReLfpKIf+IMFnmVmwxQ9AhithYT73+p2s+JIVfrjwiHnpAZrSsr9CMstQXP1+1+510N/q8E/YoekMN9OMFvi5LvkRDsy9rgFCOoPdpgaQIWBZjf5KCSQszZJ1ivTvLokpen6tsJAVND0NFqb6GUGg2Im4Dyx9Pn7/0dm4pADAslJzTv+dKNrAPQ0wyySm7bj1RQgbAXsRa4R+mBJzpaQmHLmy0BLoL+Nh2ZRca8uUc6P37k97n451fvTieAE8BdZ2ItqFEK6oOJIYPsiU4woo140Oh+H/UC++gatHYcOFT+2y3AYvD1rM/fpxdUcsAi70c0OxAEP45X/hymE9XeoC0zfYhbcqfbhs09HpwnKMDR6g0mmYyKth/UcLl9ITGQ8N1S6s+gA1HvQCc2pluPvN2Br8SyZyfyxPP/VhCi1L1HWX2CQCuAE8TIq/sBYdANZmTIwqq0sb0HIzhhugBeUpBZLFyA8y+EErsBUYDZHYN9QAAooQwOws+uQlhdESSSqk5Qsh8LSYI6LDS1AbmOvLlRBqQIeITvM36+TP63VfE5hFClCTr9zEyVFwS3STQBy66DMHB+PJWIrfgGnYBx2dTboPa2X49GaBVlePA7CFx4iaGi4ns0aLVjMGvtPTDtmO4XEE8E5Kb/8qYai+NHl60LgAICcUCoJPVeiYG6Pxw/X9VFNVbFn9FNPzXoIRDTyzcpREYB5Fm1EQQn3KRi9wKApR8Tz48SwxnV3qM0q7ZhpdKvr0zfY+gO4oQf+EGPFYW/Xf5hwWsUgxiBbShGoGIx+D2eH1h2EeR3UQMH4zMaUKr4033nzkSkfQADelFbLOQCalxdxvN8mInhPas9bxtGJw29Fx3Y8429MAS0fL33Oeo7qFZeiToCC3B/VSNYuU0fgDnkhxGgMFdxiYEY7MYel+OHPH30IMeVFK1C79l+QdXVpFqHlMAXEf3EYDyfkkGdNvJ8f3RAXU0jpgM7jMNA5yCrtfzOicKG/M9bgEkEjqqPPDEcDfqVwGZv6zcO9avDfOhf4OmLFd9OLBHHdxp51HvOBlnAoQksYjASA1xnIhPsapTCPjbsGB2YevpPpgM73EYeSYIftgPgte6CWesVBB9QEgfnWYMgoeC8ql69bWoRIqYHvSIv/u26bj/jdqZ9KSGk74JRo6QS9PuTiSHm6Z62kLUGH0UO4rwWrhtRETkR4iKRdI8giJ2D2nUCMjsA0TXiVDb98NAf/rCMlajA9wesWHZrAe1dlwRyVI2jx4KkyUHSx7YDe6YD4tOC6XW01puEdAJwaEJzf1uATHi6ZlSCpBQscsh6C1xRcWEG4bCFeKcAVhVlDu54JQIkTT21hptIT/Afk0kMcS9BKfjBJozcDXCrtgbWXxbMAw3INQIxtQJPAGwXmYaBbYh4SCsuKwLOAQ5awKskCMmRg8P3xwlBfbosQaDqyZqBkyQe1CLQACoTgN4qbyHsPwkTiF2pYaj6MAXBmUosQHnUEYCsBL3MW39SNKMJ5PfoBsT33DVJCEbFnBCMOkHfvj6Xq8uw+dgRIhGgAiUqf5QgKDFyhe8nnYrlqn9sG1GoAfirubygX4H+8IM1CmQrMFAJ5ExzKIp54nPoVU2Auh6eBShDlTV4u5c4HE/fVvjFrsII0Ik6QX+Iq68jB19ziLoKC27FYe0gC+j1RSS+BgB7AvAM3m8HLdy5fV60C8RMVuhD1ieQB32MCCq0QPJuvuw5IHF/geMKwOPdpmsxBwVEfGEOgeincJqNmuSFIPhPq/xM81CWIIi+gCFBqDX3QPYd2OcCRo6GZBoA3AM+00aesAOQ7/2Pe/vBCXoguD4OBD1WfPwClzcui12AuH+gC0gEwW72KfjBCQRBr05D0IQc7N8PzOCMehPWK384MPVDJQim7yDdoiRTItzzFV/ZOX9sYFetP0fsQzb6O7wOoFjxk89YoQXv+BmSN+yYHYO+BsDRAXHhuJXsEFbdIEGZQWUkNVNzGA9NZUVBIQL7jASR0AclE4Pb7JN3BO72mG92+o8UG3nybj+mASh0FsLKn9GPxDrEcS2Au35BzHO1BksriIJdpqWjKR1wlpR4fN977rZqI+XbYjYDgVDpcYQalOYKMiuQbB3G6Pu/HlMbi9a0EMkksXtjvvXTfgMKAEZRN/i/O7yD8Da2S2Bdh3ICWfp8yuMkYl5a4df4vVWt4UF0yyqEnaT6swYyWB8/j111Y1ERS9oB0SLMtBGDEBD1PEHwtdjUEAHnqmoHU4wCDAoAS+lHwtu9eQLUAgmxVvAuMB9cELMV3m8EUtcBYYI9nkNIEEJYrQeUHfnzzRyC39j8CgSkir/E0P2odnAmAqDnDIhqrtV9BDNS2POjv/0pwKr6z1h/PMz3uf9ykFYq9TtoAXSwpz0HljdvBCVAPY6t7osv6gFhMpkX13rcfXQMIpuTsfTibkfOPRAC2meLRipI4mDPwMD5x+v3+Ey+qEfACwoUEkKQSMZxYJDz9R68PyP43yvo2aYf881rNQbZgRU/jp80QnW/hdXqJxMvCFxXQSNHpE8QiF4XI+wFfQcw7VL2Md7RRajsKgh2D+6SLAKPF356+/7yXYBTUgFy/38StUjFHweD+iiHh8/LV/i/TSvGk4L5x7F6AsIKbgb4C0YjgdGRIToGUx7cgS3JKP8pRcgak95BJGQbjaJdBYQ1qHYnYHL8F45QgHx2gLMQ2cDxBD/4SeR0LSDi5XzPQNjM4ySE/HGG6g+ugltLNSARn281BPtNO72eJLjdX4ITSEgpQvJYFEUg24f1qAYQNQdxx6Q/RcB85j9f+03zf2QV33IDPHegNgPABTfqFR8cZK9TA7/ll0EQbUUHW8Gr1d+MSadia+LRHwhunv87yWoJ3h/pRDwJAbDNQQFd2P2mH4kP/wDT/ZeN3CK3+ZjvgVpw4r20AMafb58j4N1UMknuj6iCx883PU9g2VHVH5JX2eEcPghSgRBCKPzK0Q3fknwPN0Hk0CyC0zBkz//7duEetgFjVtypASDI4CsknYJgYDhqsBxxy29+eyxrAZX75EEf8f+CkOcijMDDHx4ASYGGu8WHgPwpHJc0qOG8FgFTuVk0cRZVePFwHEIUEu8xSHoL5qWg4I7/HgOKXe2dcnu2SSdCGIDTA+AcxY1zYL6Q6AAFu+/1GvjKPSeEoJV3NiM4Dz9C6oWkEav+NWjPWXNOIkKgNTi2I8LeBgaZHJxqrC4oNXoB9pzzMws/OW3ghSyQJgjbygOVEDhoj4nHLld8HPD6UUMFVLIgKrTL7cFoBRLQgEdXIseZ2/HhFPKbk4d5tYWwwR0nIFQSD2P5gQhs6meVfB+Bkyz2fOIvX/zxqsSODuAGIOLtPNnmIPCrv6Kqvgz3q4tCwNl9lWYfnsdHj2HTgQw5IBHwULmfSu1jEV3gDFSxTBmqSEVqiYK2IkWcRiAkwV/cyW9YhqHXDw9dkNQAcO6HFNJT7oChfrPUYc3KY17zAd+evAwF2w5SCKLV4EuCEKsKfjBVWHu9Q9Arh4CoBqEMWYBsNX7YgKP/69uC3M7/mOOz232QT+ox4iCyJGEFP4oBHd+GVvXBwX35nqp7qeIbV6L6tdZub3ueJ+gBIKgC6S5gOQFxDoGr+Bv2nzqbknd7ph/EmXzO0o+kZdc/wqvQkAOUffVMzKtYgx5Vob1/+HAfCdzHSiXHenX35/2JTr3KZ9Ruj2lYiMhLIFoNyMq9hFroeYMTE0bSLbhb4l3YlFPa6hMd2jk8dmrDgdQCnC4/+ANFlYTB6ATlx2GDGXP1rvL+SnWHw+cJes5/rRWt4H2pw9GklD4uSMpwasIQiaYR92gIyFX5S8dtRZt/nCAH48VXW3hRE/HKOsGquj8EM85Q9cfeAV4XwNGAlmIFIwPYrfLKuxV476RRetzcdeAsRSZhiHizCKEIOHn3EMOWy5X4uIJnXX6sFiBFLaBm/THOQAkVJK9j6TKwiSDTBWpwHkSPQJX7U959uAkoaTUuug6oQCBz1Zlxm0OJSIoIw04M+7zCGuYiznCfHww9AN6Ir+HXA7lfn2oBSJ2FOOh8SzINfmcAyITq8JX/sOMPx6A9LeYtVfwgCBZhdu25OB9/XmWWNPUEPD5dUuJ68wd1AqD2+w1PI9KxE9BW5t3z/igdYGWiL7L+wPv9jgVY8f0ZcbCKCuLAHN+c5wa69Zpr0J9t2KnpAGzyiAIPiFalJ8/xXrrA6Y+/8NoDnWCPNwFJzf5DpVkHte8hx76P+HU1+HEytEeSEIzAsu5r6wPJGu6oLz8VrKofXLce+ywIHhNa/Dmw8LrptWXZ4NKZm4pr/QQ7Qk8ehMrPtAF7PQCD309QgRgRZMKgAbFREAfBBXNalbHA9cEHMo4IgIUuPjjBWEUFEQpYTkhVO43eRiynJw9Jjj8TOUIlJExK+0wA4gWgQvcFBHAc7P4/u78/Ff4CC5ATB3P3oUwFClYgcALcxzp/B9Ez4DUV8RjBbsCBrMH4dLNwIDaCGhA6o3pXksdBvYBsktrXDgNJKAFy1Z+ZGIy5NXgXoBT8a3ZgVSPIUAMV6DjLxhsV8wX4n4ibbONObHNyCr8Z4FinNFjg8ziiF5zSV8A99u7Zdf5OisvVaAAAG3VJREFU/kIPAJLWX3hUIFD6o7MD4WkHIMXBk4IftSrPNBJVk0OoC7ice8HGS8XBKDoz/YFBLaQi392lGpCMJfhD9xVkx5Xbj73P9V4m1j0v73x9FjDDPlYvATkgFAVWcdNvJBamliOjAwRV0EpeRymAe717kMYRyy/j5FwFBX0fP7Dyx8gq8wn2ZXi8GfGYR+lFcGJSxa3Y84WgzBHetlU4cvKY44Ps4iP9fsgsPGEhQTAcHqwwGCj61SoPexKwasXFqtxq8qhD9SixoBBYcJEDNzmIoi3J7QkoJActVHocTVpPBCDhElAvMDK1PT/Sq3DwB/ygmyB9GNhYDH4so4Foy48kkPtZfZEv1PQTxYpyX0EI3Bu+/5krcN8fgwVdwWu2JNVNWAk+PcOOPMNdGFyAZ5Aj6gicgzNfwuHZg0HrLxBWfjSRl88fVCo/apX/IBrIvf65ZxtEoK9Bec4KZIPLe76osQns46NwW0pUPCPAyMc4A/KXOwZzFLGbAqD5xhhbgBcWfoJBAlarcCSQgdQJ+Movnih4gjZQTw51rz588y/ZgxVUEAQ8soCfX8OR26JwujCLGFAMsOjnwGrlPuQw9D/PPv8BYVR7pG/eeFtQpsLzR2KFI8SwKj9KlX++HeLOPuSBKrKeHBi7L4b+Kx184+ptAp4Trcscv69oARVYzWgaK01H1X0K3zNSmARKtxXYHvwJuT+8gLGGWgpHcWOmBeljFB2Ckg6wiAYOqfxEK3GMCAj6kIiTWdCBCXhkjUKMgJcLk271N9uLSbtvvK0S69OXAvoA5z94VsFubbmZvx4QAnXgBnJxENyQjy38wef81uPhxMpPJIQzr5ckuUTKe0wZyN57iFTWga8GvCwlh5UqvYgmaNV9XSxEVWs40kkosFwA70RgNOu8mLZfR6wDiwRa35y7j08NksqPQhcfkRBK/J8R75Iz+9C8gJpqzwiIeZII3QnYOkJWbVEI5jNuA+o2BwK82ifwnpSgHwaC+GNAdmW2VXfC+vPu6wR6lBj84C9WfvivZyUhZMJlJhjSukDlFJ3g4AvGJfC1iEpQJ/CaEd7G9wds7p71+odruKrHip/C7RdsxeVjzIxhoNkFGOW/+sk/YVAGtltfzZAIfzix8gcHhZCXpcGN2u69qWqD9OlRFAy7x2fQBhHUiETB+DocqvArYt98f+AEAXApsEmEcNLC0t2uPHCqPQIXwHYDfI4/9+8LMpchqr5HK39MJSrBXwnutNqjovjHFdq+fcHLp7YLR4mGgduW5hFpAXUoL4cTTuW5HJSkB5PC0S7A+8c+837DyoM1J9iv/po/o3BunlDqPjOSO/YbLFd+FGy9sxKFeT8b+nLNPrkAyD53FtT27yUS32yqUaEGTMBiASGcZ0FmK8nWxbvjC1q6WQC4VdWdAcBY8eFoAzIrC0b7Wt8wlPcIdE1FhUWeKU1Igv8Q/0dl4k/NnYSxdlDon8diUDeuQB4c8XVzcahRgyyZmNC+LAgeCfSVALde8/t1DCYawNoePGT83wlOpFUdOZKwxn89OsMEf0X8CxJCBN/dwKbFwkSMgx0ACJJDJD4iC1JEYh6XcEqVHpx4+J4I4UiAl26r5x64sttvSlAn3LBuQCz6edU8C+J5epBrC4YP52EFDgHrCw1B0eU9bOaTgh3wmYvQV3Oqqcf53XnVNXUBELX1xtSgFrirlII5d3HFulxBCNEfZx0h7K2f34XwdHpuYQcguN189Ow/nPXclaUcqMH5leCXjKOjbv3F0a7i2ZaRHmBe5zwnhA9S736ZC8AH8LHkg/T5znYgmES1dtuzGo92qwHIquiWX+4KgVLd8utv9Ml1BQNhEJW/FOgweiTguCUoQHkEwYhjfQIgm8eAzPKzHqAG5xGiiPyxeGRRaYetUpDVpHVC1T9bHGyaknb/TQTnuG7rDYwYCUT7/cMjtILzA+Go/FPw581F/mWeTkDuBsBCAK8ki+A29nMzPn4Rzjv6QV7xWW4fzQFUxb9jQQ1qc28kMi4mDl1NBr4usIsz5ltZqNm7AeJXfuTHd7nioLEyPBISU+8/tP1AC4Il/n+YGmjg2NiBRdl6yCw//zG5ph7bqaBuz8B4VMU/TqSsNPbwCeZA1cdxyG9SgKzRZPL+GXFOiH1/SFZ9wX8M3zUgvH8a4rMBjZj/h1W9MrwTiN6MlsCKiI4gycBzgV/xUaQGjGDHwHiYi0VIzeEAasCpNuL76AC7BIEl7i4AIxnAfoMxk35eJbZ68wWEUChs8IPz/EEE9BkUoNA4RCWSLJkY1h0Y/dG9bVCtUVPe7QRhtStXG4nOECDfUxc4Uw/Ik8JkA9o9+a83IrfHH11EdFUWc4phNgVFWkPsIHBnCvCCYBSgqEN9qtoXuwHhByYoJJA7BxIkkRwpDGgAHo+vQ3ZGOwCFJCJKUAx4MBpFZWvReeLgtBBkDDQu2OJxXa7SE/P4ZiUPHABjY1DsFIhPAaygWewiXK72hHjow/k8gCL6gKES8qcDZ7A+EhYlWCPGCX1wXIwzkQEKt8cP6iqkC0FEhFj/ZYtvXCtwuBLcDT5wXN+9H6ZEIkTwV/x/s78fXFX3siWHEKrC3tw7EFZ31Ll7ttknQyEMGgAqCaVe1bGk8r8nFWCQQR0h7CY0dsU/mIeIuA1AGCo02Q0YVXxub36sG1Qgfo0CBBUXxap+ECFEycQVyViBEBFPt14TK9rZHB9EwMG7DPXOv0OVHkdtx7OSCXfb3av4CFZGTwQBwT7/hKPHE4PzpJ4L4+FM9r1n8B+B+9R9I4Fu9brYUZgCunZWNxdQgIs8mASBQ4F8hJpEiaf4GPihk8FdAxin/kybjZjTj+mAQy6ihZ9whDvHAWB6BKrBXQr+5SBfqPaINwiz12UIwoTmbPACZY/fshBBBKNlW8ZCHwH/cVKSOZMm4Mxk4OwE9JeB+EFkn1IzcPQoiSB4vGgNeJSoik1A7m0TCmE/HrggB+/1M12C1Z18ACGoIeH1pH2IhAqFWgBq+kDFEWAvA3X8tpW0cnSD5WAOriOHhnYraF1eLTkS8P/QsHUBdtMPnOrMaANJE9AZiaKWII5Ue/8PTHn/UcCSTgIF2xN4zdmAQYIAKeBFl6FiO0aKfq5jcImHfPwTxcEdRmD3LcFoAva1Hdjm9UgGggI9YOoPkOBYLsT8HlG3nucMDGkOOJ8CkNOELdSO7D5qqAeJYBb2GpABgRi2gxLITgrOQ9C937HgB+0i7MeRx3gfPWCXLtgbLJAu/gCFBPzRX8eADJqCvA3FViC/BlOQC4LZyrBq8BdQAOUKoKjqR7v7EFfVFMojPgEoSlJesNIePyLHwW9NRgq7E6HvUN8A0yj0wyWDHRZ3J2A1jHdMyu3hCGwSDwdRir7h9VP7AKLgPoMCgKziOFLtrUm8aIFHlgxYfz8WBYUU55iAXauo+evJaIK/NTgRJM9sUcZRzcCnMdNKMJc7usnAyrpxHYkTRHK+n1HxS01LheAHqRWwKIDqLvQC0+PupHZgBawfVGsiniTVHwZHRqbUI/D4Cd+ftgyLAR1ehkIiqaKFw7MJEwUIuK5zsu4svoFYCFKgBJZACBuppOId2RDkPZas8H9kULcA9a0KTCQDGtpnzT+RMJiOGseHl4BQ1C29AWUXIIf/OIwwqoNEK3SCuA7FRiBrE9B4/PcrGJ1OQNj83F4Xbol/TgVHfMiIZLAdcaVkgh8sLrd+liNQH/FqsNTfj15m1J0X+ffZuq/gTY7QnvIfJz6UzBJLs83ItQpt3RfZz5iuGfNPajpngUm0R8DoA5jDlzsOTAwZjzsC3Jjxg7H914PjlcskGdghgx9HG4OOQH34uwQyzz61/0qiYNQjXxECuWYbGM/DrjtPH/Mw/K+gBLLSA+cEfPr4MroArzcDuybbr8Zc72i2UnzeHnTgzD4Ug78SzIvCoARVOQxaFFR3TzWnkkHUVFShEuqKxZnKz4p4YYcf8ZhYhuu8wFgSHcuuwCJagI4bgchJQK/qe9c/RT6nGcg6KGREJpb+MI0EY/b0jcsni3AJBeCQNsBOFVYoApcM2Aom4VFgIRdHpeIG8D3YaxBD+qCiQ+rBOSVnci8hzkAG1t/pgHA4uwDzmu8xFKkkkIqCfkIRs204r/hiDgutoAAcowBMZ9+KS0CcXVBOHCvJw2jMQSJyeoeExF2DuTuRcuWAo9sefyUQ6/oBaIjPtiRH1KvQKvygAHb171d+vc4GRMDPoxN/kL5pwlVh1mBQ1quQJAJ5j0TgOAis+h8d3mnC8xTKE34+8sDNjyVXE6nFMN+H39TQDmocHScENvN74LoGScGU4f7g6IG3n3C3qnG6JBS+Z5tHOOzRYQx+u7MZmAl0OSsRLAS/VIKfRAWU92+12aaVPksGDBWQuCMvgNy2M2Mt8EwqbjosZAec5xLEAmXmcFTHiOWARWglpNpjdEtBQRxJJU5VL5/7F1X86XntXgUK4q+KggsUoIIK8oA+kgy4+zLaACqQGTVOX6MBWdehL6BxHn+tlyBMDGAqufd7WOX5WTJwKYDfXJJP2GXDPk7Tj5Ed7BOG7DMFaBRAJgI/+H2Ngeb2SKb0zkoGlQBHkefDr7xMA5HZeJPtKIzyApI9gmnPgf1c3mulfhe0gFekDCdNFnrOwi4Gs6eTACNjB+Uegcgojog4V25P8bctRYY6RL8AJklE9ACFAGZdBEahd4d4CmghFhbzcwaXYH5qTlS6DY+KfNH5Avzjo2JJ0poDkSCMxLn73H/eB+ifvgvyIFCWAji7BWC8hd0qj0FziMdrS70BlVbgamIgcmotGZDNPwm0L9l5iHv7WRoAFx57ScFS2r2iwot8oKu8l+TOCOg2mZ2nFdjTgOFQENzKkJ8OjEnsE8f6AzyXwT6MNF3RDRnuj0Lwo6wTlBMDIyqaz6G+RiLJMg/KUrQV/rh9uH0tWduwoxmky0kSMQ+rnXxZsGadgnxfgk1pCnsIsGYltvfdzTOBIclIsN8MLAGcz5gBwj94AE8DuC9Molip/JGwB57nRyJiyD3pyk6q5ij+3TzRLohcqyqCEQBTepF15+WVmW8SEr5jMUUkx3oMIsrH3ndwAQganKzyMpOJNxMQooGBYwcByw7axIhgPRGEr6GSGJhkAELoQ1YRg+dPeD5IIRDIqq5PA2Jh0Rq0YcS8XBi0ghGRFpCtWTdum5+yLOsQf2EuYY8AfnbQZDgCjHxBSKwTGpt8QCIDVH3/4H5OwEvldhliINwAFLsEyyIfGKV+vm3eEehVqKTdNxtDiPoLHCRiuwTJxCECxMDqDjTvZ63KaPKvRgV2i/F3ohm88V8LN8hgJcXD5pVGIPPNn9EBqSQC0I4AMxBUcQNCkarkFgSn/oCs9GCVep4eUG5BRAOcQOCWlGSc3If0IFqRfURQGRrKewPKEJ9sLnIowKCcw+f48N6UHjqYtgInaCCkBbPSj8VEkCr2g8U43wY1xX/BNkwreQrzg+oaJghOCGTU8RBxuIp6VFOGoEXgEsBLIgV6gBgxoLSI5CgiYNT+GBHsU01GthrceiMUtv9KgAYktgVNeGrBbtiOQVi9x8WjiAW7UNUnm4Vet7WtsFgDCDYEwQ/EVL1PnQf/xCDLTowTh4c4HPRDoQaiwhKIAae4B7xgCBydI/CDPOrevK0FR4p6w3VfoXgQiB3T1N8Y1PCD0X19JqcHGfzB5WkQE4p/kdeXBcEVUXEIFqSij82lMyrWq/7c+LFHA7z5/dwOHHg8s/Y8C2CmhbmALtare+4UWLfb25BmXABKABTniC8gRAP2yvDAiUAsElnrxFzITQa/sAFecAOY7zPV/8jMQHSbWAiUPGkQNABhw85xrSCv+mMSzFR8+7mjw01A8f4F8S/td4jnDHYxpT8/OEyV3gz2+GTfdAeAszswfJNGlQhEIjB0Bls0BKn4Iw7WKu9f1gmSagmvqleEwJwnZwjO7npz1HdCJ1hS/mlBcRXyF3i/M7NxqJFoeH27z7nnJaBmpUZKHsTbGUc1ALEoIGsGYl9ixS50gjAT/VhB8IzvGTrBVfWEz1MzAkRFTtecW731VdjNQPukVdhdn0Y8d/a7WYH6i/TBPBzUFwAlHwtGHOQISrgb1AMUgDETTA3+THAdeRJhg59V/Ektofa9I8wxVICkC7QQSAd2O3cftzPzdMK6aA4iZI4ILfYRbb9RgqICt2AxVnYZ4kkBvHOBxT/zN9ybHx/f5Ql2fkGCX6ANm6F8WCfqAS+Eq5AGcHJd2IFHagTMHAAj+mWBnDXuc81CjhsAi5dL2K8QCYI1aJ/PJtSSxEFXASv7C2I3ZB9/a0j/7nDn/j1pHsz9Jr8fNpxPBUAUUYD4wz5GBlmyAiORjtAIGDFwzSUwqiNZ1d1tPiB7/Q9VeI9KeJU16/knkEeQJEALjY4rkp74fCZiMDSA/PgvT/aT2gYgp5E/P29AKBQAo6TRth5T4VesQFb0i4K7RA2MZpgyFXCEQHCOixuYMPgy2L7+45ezSSKt2oUkURlpXkEMOLSiXPuDQZjk63N5bmzOSxQdLHX7AhwUEA0BAeQPJIQzkAuFlOK/GtyLdiGDKEBdllQ7YouxV2Xdwza9So4Kp5Z0yAgUhTlJgFzSFrznIHYIwKcCu2/L3LsCg6UI1b1/CA+ApIV5/32HqOIjdQusE4azip5Wc1b0q/QGIAlaWEJbXP3r/L+AEipw/+BtkQVY9fIM2i/ZhgVEgJO6DZ1ksVtlYdoQAPhVO0oKmYBmnAYco4DRCRB3TwCziptaE0auER9/VzRqKNOEYINOQg2m1l9GpGNQAhh1v6UmxNQh2M4+LmlUzll0OTjYQOaGlZAEMCrdhmBphaMBwBADrSQQc3//He8KgFETT7p6BHnjj2X9EXsDjrgBS6ihoAmcSQVYmE4JgYWFpp1waAQRoqDzxDhU+HxSnZHz/9JEY6Y5MJA+cwoWrt99+U3Mc/9g/NQTFaigAEtwB1yBzwzucZSX7RZEILhR1d5GDCsBLVUdIQvsldZfEJt5i/MHx2hGJZFkVVyK242iFeh58oBUFqIQbkfp2DV2X0CkAYgv1sU+P+I/HmBu8nErugdRnUWhfp+A/ddlbEH3uQlBsNobUEMHasK1HOYn8BEEvCUaiuigXRIKj+sGOPA4KAWz9/s7WxcgB4+a6/fI2osEwv4yOENAiPf+wQhbc/5f0gGisWuQaRFmGoIqguARWsBQgTTocDLMT5OJUQnhqdCEig+/EShKSEgTVV0MBMnz04BcshPnLk/+OaV0/dwKzB4QUt1NB6uTDfGOP+cNm9mEsBAFiM7AQh9AKVEU75vy68jeOxrUC4mDEuYO0oLqoSdHaEF2eXYYSm0V+oEOwpLmYFOF3Z4CmAeBTIGueiIw2xoKPzDBJVBXQ5g5O8/twwA+QguIjJt3+g0NQEcDfUXgO5gsqlTBLkQLdl86K3CWneitQ8sg/5oWAUJP2C3V3RoEyji5n4b9lB4t9pz2CA+cAFn1Z9I/uzYsU/ELtEBOCHYQQqGcFejV+yeuRJX31zsKV5IGjway9z6PLDxKwNEPsBuOEiqw57jGgOtZ1Y++T50AuMFl7hPIbhskiOwsATtRoc7rS7dXrpcgrMCGJca6ELJo+Y0be0BW5ZKGcFz4y8W9BduwcDnK9iO5fagsKpp9ANnvDPxeP8THNyIVFo1AMas8Qk5v2Ytm0LCCYAXqn+wQsPTBh/5Bcnne14Os3uCQt28vsK1WUESJFviBgAW//3u9PLxusXchcCR2WsNzv/ImvgZzzkUByDUAIrjTvmSHAowpJBQE4SUlxMxnARlQbIqkArVAJ6pBBvELCCKlkyCDAP45BYfEPfcUpfMch3Vn4bheYK4E66BxAxHSVd5INgEPgU/NBCDfNQ8Ho1CoINAPQAW/QT8OCIZlNFCB84XhoDChFByHGjx35v9BLgyhmojqHYb5QYXnuAecvua0hZe6BV9f7v4ibvgvamrmAc1TmaEir0LQ9h97eYAYVoM/nWA60i8Q3Ifezha9BqaaL3zvqd6IAuwwLSCCuCLuJWch4h30giPtyiAphKEBcCu9BV5wwzkMxID8rhMwdwMhcSFgrBT3RUTQboAUg3+p+Qe1IGarOioVnazmefV3lHpwA0AcLWCahUiXwePHWJsP+GH1gnp/we5KfOhJAbsj0H/BIEb04TbrTPsAyb2LLu93KwfCvn5PLAwrOXAa72eEQRo1CNdw5IprsAZ3hApy9zlcITG2vpCihsRSYxNS+J4vdBZ6B52eqRcQ/QXmSjAWSfa/5GA5qEg4iJFtm624AqXLrSA2gx8p1Mdqcghv41S0lSp/xAYs9gakQc4Ie2RTUYwYgt748mV+FU1Xgp14eW3XYZ6cdqGTNHwHICTwEeTPl0jEZwIgP9gDEaogeg5IHWCF+1eoAhvEKPB/EAeTRsM/pSAP5wjWEUMM1/NJRhwJbpJSgK7S7zF3EOsI5jBQBK9DV80Z8Y0COzvmWzJXgDl40KEC6cqvqgi4OB5cpgLFYK/1CvDiItXqC6/S87wfAUfPtxqfGNzlYaOjlf1IsHPPvffHgDAoEeEST4ZLZUd/RSo91/BjXY5ggWgQ4In3fyj4mUqPrInHOCLKO3wUwRsfyXpt1nEIRLrqcWeTuk7bigsbid1zD4iDRQtnIdQsyIXnFCn1I9D7ADgxEhOvR5AJosoUbu1FkJyYCi9OhQERoIx+4AX/YqUXQhtYEwKN4Cy1HntLMmtaAQpqfrT/UCoLSxeswjA5UWPPi0mjajUWxMTdVusNvt/ChMdmILK5IRMFu90BMEzFYHdg2GAgeYVHMMJIBTA7EFTx/5fpgTFXz9w/en0ZjD8kCDoKPNGwlB01BmoWQbh+AxR689mBponGJOr9OwmMu3dtJ/ylW1Tik4ElUPmR9RqII+pVhD9ychABMQ51gOIZg+/G+5mGIzLB1JJC5WhzYjhJ7IWmLDpA8jzsAafUPkB2WnFBF4iSxkq1ty7f25rv/+EQLOxs2oUdTSA9HIR9swdBlCcFe9owPC3XWDDC0ISVzsEVbSCF/sWdA5Fu4HJqankp2SeQCYYrImNalfmhpVxYrGkUS4LeSUjg8dD7+D7w/ybIfy7vlB9/HJ978zr7/45Qgajzj+4EjIK/ULHPRAOlKr/aG0AFcqCyu0GcW45Igh6JMJmhA49/U+cEssHNJhtXDC1MOya3j/sAiAGcrEtqtgjBD6wEzSDc7D8o6C8rIqAZyPk+NQoNLAZ1hR64Yl1FBY648smUYKnSg1Xwk/0DyRyArByMUobyByhCcPnOaPyoegREFS4jNfYAw+IHCjdC1J2WDZBke/OyN85J24WiXwDYPoJyYuCD238ulvuzwt6KgHf0shWKsqCFFGjB/w8HU8eeTED9wAAAAABJRU5ErkJggg==\", r;\n        }(), mr = function() {\n          function r(t) {\n            this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.roughness = 0, this._indexOfRefraction = r._DefaultIndexOfRefraction, this.indexOfRefraction = r._DefaultIndexOfRefraction, this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._textureRoughness = null, this.textureRoughness = null, this._remapF0OnInterfaceChange = !0, this.remapF0OnInterfaceChange = !0, this._bumpTexture = null, this.bumpTexture = null, this._isTintEnabled = !1, this.isTintEnabled = !1, this.tintColor = I.a.White(), this.tintColorAtDistance = 1, this.tintThickness = 1, this._tintTexture = null, this.tintTexture = null, this._internalMarkAllSubMeshesAsTexturesDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e, n, i) {\n            return !(t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.ClearCoatTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._textureRoughness && lt.a.ClearCoatTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking() || n.getCaps().standardDerivatives && this._bumpTexture && lt.a.ClearCoatBumpTextureEnabled && !i && !this._bumpTexture.isReady() || this._isTintEnabled && this._tintTexture && lt.a.ClearCoatTintTextureEnabled && !this._tintTexture.isReadyOrNotBlocking()));\n          }, r.prototype.prepareDefines = function(t, e) {\n            var n;\n            this._isEnabled ? (t.CLEARCOAT = !0, t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === ((n = this._textureRoughness) === null || n === void 0 ? void 0 : n._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), t.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange, t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.ClearCoatTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._texture, t, \"CLEARCOAT_TEXTURE\") : t.CLEARCOAT_TEXTURE = !1, this._textureRoughness && lt.a.ClearCoatTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._textureRoughness, t, \"CLEARCOAT_TEXTURE_ROUGHNESS\") : t.CLEARCOAT_TEXTURE_ROUGHNESS = !1, this._bumpTexture && lt.a.ClearCoatBumpTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._bumpTexture, t, \"CLEARCOAT_BUMP\") : t.CLEARCOAT_BUMP = !1, t.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === r._DefaultIndexOfRefraction, this._isTintEnabled ? (t.CLEARCOAT_TINT = !0, this._tintTexture && lt.a.ClearCoatTintTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._tintTexture, t, \"CLEARCOAT_TINT_TEXTURE\") : t.CLEARCOAT_TINT_TEXTURE = !1) : (t.CLEARCOAT_TINT = !1, t.CLEARCOAT_TINT_TEXTURE = !1))) : (t.CLEARCOAT = !1, t.CLEARCOAT_TEXTURE = !1, t.CLEARCOAT_TEXTURE_ROUGHNESS = !1, t.CLEARCOAT_BUMP = !1, t.CLEARCOAT_TINT = !1, t.CLEARCOAT_TINT_TEXTURE = !1, t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1);\n          }, r.prototype.bindForSubMesh = function(t, e, n, i, o, a, s, d) {\n            var p, y, P, R, B, F, z, J, ie = d._materialDefines, se = ie.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;\n            if (!t.useUbo || !o || !t.isSync) {\n              se && lt.a.ClearCoatTextureEnabled ? (t.updateFloat4(\"vClearCoatInfos\", this._texture.coordinatesIndex, this._texture.level, -1, -1), $e.a.BindTextureMatrix(this._texture, t, \"clearCoat\")) : (this._texture || this._textureRoughness) && lt.a.ClearCoatTextureEnabled && (t.updateFloat4(\"vClearCoatInfos\", (y = (p = this._texture) === null || p === void 0 ? void 0 : p.coordinatesIndex) !== null && y !== void 0 ? y : 0, (R = (P = this._texture) === null || P === void 0 ? void 0 : P.level) !== null && R !== void 0 ? R : 0, (F = (B = this._textureRoughness) === null || B === void 0 ? void 0 : B.coordinatesIndex) !== null && F !== void 0 ? F : 0, (J = (z = this._textureRoughness) === null || z === void 0 ? void 0 : z.level) !== null && J !== void 0 ? J : 0), this._texture && $e.a.BindTextureMatrix(this._texture, t, \"clearCoat\"), !this._textureRoughness || se || ie.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE || $e.a.BindTextureMatrix(this._textureRoughness, t, \"clearCoatRoughness\")), this._bumpTexture && n.getCaps().standardDerivatives && lt.a.ClearCoatTextureEnabled && !i && (t.updateFloat2(\"vClearCoatBumpInfos\", this._bumpTexture.coordinatesIndex, this._bumpTexture.level), $e.a.BindTextureMatrix(this._bumpTexture, t, \"clearCoatBump\"), e._mirroredCameraPosition ? t.updateFloat2(\"vClearCoatTangentSpaceParams\", a ? 1 : -1, s ? 1 : -1) : t.updateFloat2(\"vClearCoatTangentSpaceParams\", a ? -1 : 1, s ? -1 : 1)), this._tintTexture && lt.a.ClearCoatTintTextureEnabled && (t.updateFloat2(\"vClearCoatTintInfos\", this._tintTexture.coordinatesIndex, this._tintTexture.level), $e.a.BindTextureMatrix(this._tintTexture, t, \"clearCoatTint\")), t.updateFloat2(\"vClearCoatParams\", this.intensity, this.roughness);\n              var ce = 1 - this._indexOfRefraction, ue = 1 + this._indexOfRefraction, fe = Math.pow(-ce / ue, 2), ve = 1 / this._indexOfRefraction;\n              t.updateFloat4(\"vClearCoatRefractionParams\", fe, ve, ce, ue), this._isTintEnabled && (t.updateFloat4(\"vClearCoatTintParams\", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(1e-5, this.tintThickness)), t.updateFloat(\"clearCoatColorAtDistance\", Math.max(1e-5, this.tintColorAtDistance)));\n            }\n            e.texturesEnabled && (this._texture && lt.a.ClearCoatTextureEnabled && t.setTexture(\"clearCoatSampler\", this._texture), this._textureRoughness && !se && !ie.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && lt.a.ClearCoatTextureEnabled && t.setTexture(\"clearCoatRoughnessSampler\", this._textureRoughness), this._bumpTexture && n.getCaps().standardDerivatives && lt.a.ClearCoatBumpTextureEnabled && !i && t.setTexture(\"clearCoatBumpSampler\", this._bumpTexture), this._isTintEnabled && this._tintTexture && lt.a.ClearCoatTintTextureEnabled && t.setTexture(\"clearCoatTintSampler\", this._tintTexture));\n          }, r.prototype.hasTexture = function(t) {\n            return this._texture === t || this._textureRoughness === t || this._bumpTexture === t || this._tintTexture === t;\n          }, r.prototype.getActiveTextures = function(t) {\n            this._texture && t.push(this._texture), this._textureRoughness && t.push(this._textureRoughness), this._bumpTexture && t.push(this._bumpTexture), this._tintTexture && t.push(this._tintTexture);\n          }, r.prototype.getAnimatables = function(t) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && t.push(this._texture), this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0 && t.push(this._textureRoughness), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && t.push(this._bumpTexture), this._tintTexture && this._tintTexture.animations && this._tintTexture.animations.length > 0 && t.push(this._tintTexture);\n          }, r.prototype.dispose = function(t) {\n            var e, n, i, o;\n            t && ((e = this._texture) === null || e === void 0 || e.dispose(), (n = this._textureRoughness) === null || n === void 0 || n.dispose(), (i = this._bumpTexture) === null || i === void 0 || i.dispose(), (o = this._tintTexture) === null || o === void 0 || o.dispose());\n          }, r.prototype.getClassName = function() {\n            return \"PBRClearCoatConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.CLEARCOAT_BUMP && e.addFallback(n++, \"CLEARCOAT_BUMP\"), t.CLEARCOAT_TINT && e.addFallback(n++, \"CLEARCOAT_TINT\"), t.CLEARCOAT && e.addFallback(n++, \"CLEARCOAT\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vClearCoatTangentSpaceParams\", \"vClearCoatParams\", \"vClearCoatRefractionParams\", \"vClearCoatTintParams\", \"clearCoatColorAtDistance\", \"clearCoatMatrix\", \"clearCoatRoughnessMatrix\", \"clearCoatBumpMatrix\", \"clearCoatTintMatrix\", \"vClearCoatInfos\", \"vClearCoatBumpInfos\", \"vClearCoatTintInfos\");\n          }, r.AddSamplers = function(t) {\n            t.push(\"clearCoatSampler\", \"clearCoatRoughnessSampler\", \"clearCoatBumpSampler\", \"clearCoatTintSampler\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vClearCoatParams\", 2), t.addUniform(\"vClearCoatRefractionParams\", 4), t.addUniform(\"vClearCoatInfos\", 4), t.addUniform(\"clearCoatMatrix\", 16), t.addUniform(\"clearCoatRoughnessMatrix\", 16), t.addUniform(\"vClearCoatBumpInfos\", 2), t.addUniform(\"vClearCoatTangentSpaceParams\", 2), t.addUniform(\"clearCoatBumpMatrix\", 16), t.addUniform(\"vClearCoatTintParams\", 4), t.addUniform(\"clearCoatColorAtDistance\", 1), t.addUniform(\"vClearCoatTintInfos\", 2), t.addUniform(\"clearCoatTintMatrix\", 16);\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, r._DefaultIndexOfRefraction = 1.5, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"intensity\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"roughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"indexOfRefraction\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"texture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useRoughnessFromMainTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"textureRoughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"remapF0OnInterfaceChange\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"bumpTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isTintEnabled\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"tintColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"tintColorAtDistance\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"tintThickness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"tintTexture\", void 0), r;\n        }(), gr = function() {\n          function r(t) {\n            this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.direction = new u.d(1, 0), this._texture = null, this.texture = null, this._internalMarkAllSubMeshesAsTexturesDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e) {\n            return !(t._areTexturesDirty && e.texturesEnabled && this._texture && lt.a.AnisotropicTextureEnabled && !this._texture.isReadyOrNotBlocking());\n          }, r.prototype.prepareDefines = function(t, e, n) {\n            this._isEnabled ? (t.ANISOTROPIC = this._isEnabled, this._isEnabled && !e.isVerticesDataPresent(Oe.b.TangentKind) && (t._needUVs = !0, t.MAINUV1 = !0), t._areTexturesDirty && n.texturesEnabled && (this._texture && lt.a.AnisotropicTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._texture, t, \"ANISOTROPIC_TEXTURE\") : t.ANISOTROPIC_TEXTURE = !1)) : (t.ANISOTROPIC = !1, t.ANISOTROPIC_TEXTURE = !1);\n          }, r.prototype.bindForSubMesh = function(t, e, n) {\n            t.useUbo && n && t.isSync || (this._texture && lt.a.AnisotropicTextureEnabled && (t.updateFloat2(\"vAnisotropyInfos\", this._texture.coordinatesIndex, this._texture.level), $e.a.BindTextureMatrix(this._texture, t, \"anisotropy\")), t.updateFloat3(\"vAnisotropy\", this.direction.x, this.direction.y, this.intensity)), e.texturesEnabled && this._texture && lt.a.AnisotropicTextureEnabled && t.setTexture(\"anisotropySampler\", this._texture);\n          }, r.prototype.hasTexture = function(t) {\n            return this._texture === t;\n          }, r.prototype.getActiveTextures = function(t) {\n            this._texture && t.push(this._texture);\n          }, r.prototype.getAnimatables = function(t) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && t.push(this._texture);\n          }, r.prototype.dispose = function(t) {\n            t && this._texture && this._texture.dispose();\n          }, r.prototype.getClassName = function() {\n            return \"PBRAnisotropicConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.ANISOTROPIC && e.addFallback(n++, \"ANISOTROPIC\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vAnisotropy\", \"vAnisotropyInfos\", \"anisotropyMatrix\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vAnisotropy\", 3), t.addUniform(\"vAnisotropyInfos\", 2), t.addUniform(\"anisotropyMatrix\", 16);\n          }, r.AddSamplers = function(t) {\n            t.push(\"anisotropySampler\");\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"intensity\", void 0), Object(c.c)([Object(L.n)()], r.prototype, \"direction\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"texture\", void 0), r;\n        }(), ap = function() {\n          function r(t) {\n            this._useEnergyConservation = r.DEFAULT_USE_ENERGY_CONSERVATION, this.useEnergyConservation = r.DEFAULT_USE_ENERGY_CONSERVATION, this._useSmithVisibilityHeightCorrelated = r.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this.useSmithVisibilityHeightCorrelated = r.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this._useSphericalHarmonics = r.DEFAULT_USE_SPHERICAL_HARMONICS, this.useSphericalHarmonics = r.DEFAULT_USE_SPHERICAL_HARMONICS, this._useSpecularGlossinessInputEnergyConservation = r.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this.useSpecularGlossinessInputEnergyConservation = r.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this._internalMarkAllSubMeshesAsMiscDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsMiscDirty = function() {\n            this._internalMarkAllSubMeshesAsMiscDirty();\n          }, r.prototype.prepareDefines = function(t) {\n            t.BRDF_V_HEIGHT_CORRELATED = this._useSmithVisibilityHeightCorrelated, t.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated, t.SPHERICAL_HARMONICS = this._useSphericalHarmonics, t.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;\n          }, r.prototype.getClassName = function() {\n            return \"PBRBRDFConfiguration\";\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, r.DEFAULT_USE_ENERGY_CONSERVATION = !0, r.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = !0, r.DEFAULT_USE_SPHERICAL_HARMONICS = !0, r.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = !0, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useEnergyConservation\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useSmithVisibilityHeightCorrelated\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useSphericalHarmonics\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useSpecularGlossinessInputEnergyConservation\", void 0), r;\n        }(), Zr = function() {\n          function r(t) {\n            this._isEnabled = !1, this.isEnabled = !1, this._linkSheenWithAlbedo = !1, this.linkSheenWithAlbedo = !1, this.intensity = 1, this.color = I.a.White(), this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._roughness = null, this.roughness = null, this._textureRoughness = null, this.textureRoughness = null, this._albedoScaling = !1, this.albedoScaling = !1, this._internalMarkAllSubMeshesAsTexturesDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e) {\n            return !(t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.SheenTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._textureRoughness && lt.a.SheenTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking()));\n          }, r.prototype.prepareDefines = function(t, e) {\n            var n;\n            this._isEnabled ? (t.SHEEN = this._isEnabled, t.SHEEN_LINKWITHALBEDO = this._linkSheenWithAlbedo, t.SHEEN_ROUGHNESS = this._roughness !== null, t.SHEEN_ALBEDOSCALING = this._albedoScaling, t.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, t.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === ((n = this._textureRoughness) === null || n === void 0 ? void 0 : n._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.SheenTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._texture, t, \"SHEEN_TEXTURE\") : t.SHEEN_TEXTURE = !1, this._textureRoughness && lt.a.SheenTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._textureRoughness, t, \"SHEEN_TEXTURE_ROUGHNESS\") : t.SHEEN_TEXTURE_ROUGHNESS = !1)) : (t.SHEEN = !1, t.SHEEN_TEXTURE = !1, t.SHEEN_TEXTURE_ROUGHNESS = !1, t.SHEEN_LINKWITHALBEDO = !1, t.SHEEN_ROUGHNESS = !1, t.SHEEN_ALBEDOSCALING = !1, t.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, t.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1);\n          }, r.prototype.bindForSubMesh = function(t, e, n, i) {\n            var o, a, s, d, p, y, P, R, B = i._materialDefines, F = B.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL;\n            t.useUbo && n && t.isSync || (F && lt.a.SheenTextureEnabled ? (t.updateFloat4(\"vSheenInfos\", this._texture.coordinatesIndex, this._texture.level, -1, -1), $e.a.BindTextureMatrix(this._texture, t, \"sheen\")) : (this._texture || this._textureRoughness) && lt.a.SheenTextureEnabled && (t.updateFloat4(\"vSheenInfos\", (a = (o = this._texture) === null || o === void 0 ? void 0 : o.coordinatesIndex) !== null && a !== void 0 ? a : 0, (d = (s = this._texture) === null || s === void 0 ? void 0 : s.level) !== null && d !== void 0 ? d : 0, (y = (p = this._textureRoughness) === null || p === void 0 ? void 0 : p.coordinatesIndex) !== null && y !== void 0 ? y : 0, (R = (P = this._textureRoughness) === null || P === void 0 ? void 0 : P.level) !== null && R !== void 0 ? R : 0), this._texture && $e.a.BindTextureMatrix(this._texture, t, \"sheen\"), !this._textureRoughness || F || B.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE || $e.a.BindTextureMatrix(this._textureRoughness, t, \"sheenRoughness\")), t.updateFloat4(\"vSheenColor\", this.color.r, this.color.g, this.color.b, this.intensity), this._roughness !== null && t.updateFloat(\"vSheenRoughness\", this._roughness)), e.texturesEnabled && (this._texture && lt.a.SheenTextureEnabled && t.setTexture(\"sheenSampler\", this._texture), this._textureRoughness && !F && !B.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && lt.a.SheenTextureEnabled && t.setTexture(\"sheenRoughnessSampler\", this._textureRoughness));\n          }, r.prototype.hasTexture = function(t) {\n            return this._texture === t || this._textureRoughness === t;\n          }, r.prototype.getActiveTextures = function(t) {\n            this._texture && t.push(this._texture), this._textureRoughness && t.push(this._textureRoughness);\n          }, r.prototype.getAnimatables = function(t) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && t.push(this._texture), this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0 && t.push(this._textureRoughness);\n          }, r.prototype.dispose = function(t) {\n            var e, n;\n            t && ((e = this._texture) === null || e === void 0 || e.dispose(), (n = this._textureRoughness) === null || n === void 0 || n.dispose());\n          }, r.prototype.getClassName = function() {\n            return \"PBRSheenConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.SHEEN && e.addFallback(n++, \"SHEEN\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vSheenColor\", \"vSheenRoughness\", \"vSheenInfos\", \"sheenMatrix\", \"sheenRoughnessMatrix\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vSheenColor\", 4), t.addUniform(\"vSheenRoughness\", 1), t.addUniform(\"vSheenInfos\", 4), t.addUniform(\"sheenMatrix\", 16), t.addUniform(\"sheenRoughnessMatrix\", 16);\n          }, r.AddSamplers = function(t) {\n            t.push(\"sheenSampler\"), t.push(\"sheenRoughnessSampler\");\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"linkSheenWithAlbedo\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"intensity\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"color\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"texture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useRoughnessFromMainTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"roughness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"textureRoughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"albedoScaling\", void 0), r;\n        }(), Jr = function() {\n          function r(t, e, n) {\n            this._isRefractionEnabled = !1, this.isRefractionEnabled = !1, this._isTranslucencyEnabled = !1, this.isTranslucencyEnabled = !1, this._isScatteringEnabled = !1, this.isScatteringEnabled = !1, this._scatteringDiffusionProfileIndex = 0, this.refractionIntensity = 1, this.translucencyIntensity = 1, this.useAlbedoToTintRefraction = !1, this._thicknessTexture = null, this.thicknessTexture = null, this._refractionTexture = null, this.refractionTexture = null, this._indexOfRefraction = 1.5, this.indexOfRefraction = 1.5, this._volumeIndexOfRefraction = -1, this._invertRefractionY = !1, this.invertRefractionY = !1, this._linkRefractionWithTransparency = !1, this.linkRefractionWithTransparency = !1, this.minimumThickness = 0, this.maximumThickness = 1, this.tintColor = I.a.White(), this.tintColorAtDistance = 1, this.diffusionDistance = I.a.White(), this._useMaskFromThicknessTexture = !1, this.useMaskFromThicknessTexture = !1, this._useMaskFromThicknessTextureGltf = !1, this.useMaskFromThicknessTextureGltf = !1, this._internalMarkAllSubMeshesAsTexturesDirty = t, this._internalMarkScenePrePassDirty = e, this._scene = n;\n          }\n          return Object.defineProperty(r.prototype, \"scatteringDiffusionProfile\", { get: function() {\n            return this._scene.subSurfaceConfiguration ? this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex] : null;\n          }, set: function(t) {\n            this._scene.enableSubSurfaceForPrePass() && t && (this._scatteringDiffusionProfileIndex = this._scene.subSurfaceConfiguration.addDiffusionProfile(t));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"volumeIndexOfRefraction\", { get: function() {\n            return this._volumeIndexOfRefraction >= 1 ? this._volumeIndexOfRefraction : this._indexOfRefraction;\n          }, set: function(t) {\n            this._volumeIndexOfRefraction = t >= 1 ? t : -1;\n          }, enumerable: !1, configurable: !0 }), r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype._markScenePrePassDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty(), this._internalMarkScenePrePassDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e) {\n            if (t._areTexturesDirty && e.texturesEnabled) {\n              if (this._thicknessTexture && lt.a.ThicknessTextureEnabled && !this._thicknessTexture.isReadyOrNotBlocking())\n                return !1;\n              var n = this._getRefractionTexture(e);\n              if (n && lt.a.RefractionTextureEnabled && !n.isReadyOrNotBlocking())\n                return !1;\n            }\n            return !0;\n          }, r.prototype.prepareDefines = function(t, e) {\n            if (t._areTexturesDirty && (t.SUBSURFACE = !1, t.SS_TRANSLUCENCY = this._isTranslucencyEnabled, t.SS_SCATTERING = this._isScatteringEnabled, t.SS_THICKNESSANDMASK_TEXTURE = !1, t.SS_MASK_FROM_THICKNESS_TEXTURE = !1, t.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF = !1, t.SS_REFRACTION = !1, t.SS_REFRACTIONMAP_3D = !1, t.SS_GAMMAREFRACTION = !1, t.SS_RGBDREFRACTION = !1, t.SS_LINEARSPECULARREFRACTION = !1, t.SS_REFRACTIONMAP_OPPOSITEZ = !1, t.SS_LODINREFRACTIONALPHA = !1, t.SS_LINKREFRACTIONTOTRANSPARENCY = !1, t.SS_ALBEDOFORREFRACTIONTINT = !1, (this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled) && (t.SUBSURFACE = !0, t._areTexturesDirty && e.texturesEnabled && this._thicknessTexture && lt.a.ThicknessTextureEnabled && $e.a.PrepareDefinesForMergedUV(this._thicknessTexture, t, \"SS_THICKNESSANDMASK_TEXTURE\"), t.SS_MASK_FROM_THICKNESS_TEXTURE = this._useMaskFromThicknessTexture, t.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF = this._useMaskFromThicknessTextureGltf), this._isRefractionEnabled && e.texturesEnabled)) {\n              var n = this._getRefractionTexture(e);\n              n && lt.a.RefractionTextureEnabled && (t.SS_REFRACTION = !0, t.SS_REFRACTIONMAP_3D = n.isCube, t.SS_GAMMAREFRACTION = n.gammaSpace, t.SS_RGBDREFRACTION = n.isRGBD, t.SS_LINEARSPECULARREFRACTION = n.linearSpecularLOD, t.SS_REFRACTIONMAP_OPPOSITEZ = n.invertZ, t.SS_LODINREFRACTIONALPHA = n.lodLevelInAlpha, t.SS_LINKREFRACTIONTOTRANSPARENCY = this._linkRefractionWithTransparency, t.SS_ALBEDOFORREFRACTIONTINT = this.useAlbedoToTintRefraction);\n            }\n          }, r.prototype.bindForSubMesh = function(t, e, n, i, o, a) {\n            var s = this._getRefractionTexture(e);\n            if (!t.useUbo || !i || !t.isSync) {\n              if (this._thicknessTexture && lt.a.ThicknessTextureEnabled && (t.updateFloat2(\"vThicknessInfos\", this._thicknessTexture.coordinatesIndex, this._thicknessTexture.level), $e.a.BindTextureMatrix(this._thicknessTexture, t, \"thickness\")), t.updateFloat2(\"vThicknessParam\", this.minimumThickness, this.maximumThickness - this.minimumThickness), s && lt.a.RefractionTextureEnabled) {\n                t.updateMatrix(\"refractionMatrix\", s.getReflectionTextureMatrix());\n                var d = 1;\n                s.isCube || s.depth && (d = s.depth);\n                var p = s.getSize().width, y = this.volumeIndexOfRefraction;\n                t.updateFloat4(\"vRefractionInfos\", s.level, 1 / y, d, this._invertRefractionY ? -1 : 1), t.updateFloat3(\"vRefractionMicrosurfaceInfos\", p, s.lodGenerationScale, s.lodGenerationOffset), a && t.updateFloat2(\"vRefractionFilteringInfo\", p, $.a.Log2(p));\n              }\n              this.isScatteringEnabled && t.updateFloat(\"scatteringDiffusionProfile\", this._scatteringDiffusionProfileIndex), t.updateColor3(\"vDiffusionDistance\", this.diffusionDistance), t.updateFloat4(\"vTintColor\", this.tintColor.r, this.tintColor.g, this.tintColor.b, this.tintColorAtDistance), t.updateFloat3(\"vSubSurfaceIntensity\", this.refractionIntensity, this.translucencyIntensity, 0);\n            }\n            e.texturesEnabled && (this._thicknessTexture && lt.a.ThicknessTextureEnabled && t.setTexture(\"thicknessSampler\", this._thicknessTexture), s && lt.a.RefractionTextureEnabled && (o ? t.setTexture(\"refractionSampler\", s) : (t.setTexture(\"refractionSampler\", s._lodTextureMid || s), t.setTexture(\"refractionSamplerLow\", s._lodTextureLow || s), t.setTexture(\"refractionSamplerHigh\", s._lodTextureHigh || s))));\n          }, r.prototype.unbind = function(t) {\n            return !(!this._refractionTexture || !this._refractionTexture.isRenderTarget) && (t.setTexture(\"refractionSampler\", null), !0);\n          }, r.prototype._getRefractionTexture = function(t) {\n            return this._refractionTexture ? this._refractionTexture : this._isRefractionEnabled ? t.environmentTexture : null;\n          }, Object.defineProperty(r.prototype, \"disableAlphaBlending\", { get: function() {\n            return this.isRefractionEnabled && this._linkRefractionWithTransparency;\n          }, enumerable: !1, configurable: !0 }), r.prototype.fillRenderTargetTextures = function(t) {\n            lt.a.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget && t.push(this._refractionTexture);\n          }, r.prototype.hasTexture = function(t) {\n            return this._thicknessTexture === t || this._refractionTexture === t;\n          }, r.prototype.hasRenderTargetTextures = function() {\n            return !!(lt.a.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget);\n          }, r.prototype.getActiveTextures = function(t) {\n            this._thicknessTexture && t.push(this._thicknessTexture), this._refractionTexture && t.push(this._refractionTexture);\n          }, r.prototype.getAnimatables = function(t) {\n            this._thicknessTexture && this._thicknessTexture.animations && this._thicknessTexture.animations.length > 0 && t.push(this._thicknessTexture), this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0 && t.push(this._refractionTexture);\n          }, r.prototype.dispose = function(t) {\n            t && (this._thicknessTexture && this._thicknessTexture.dispose(), this._refractionTexture && this._refractionTexture.dispose());\n          }, r.prototype.getClassName = function() {\n            return \"PBRSubSurfaceConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.SS_SCATTERING && e.addFallback(n++, \"SS_SCATTERING\"), t.SS_TRANSLUCENCY && e.addFallback(n++, \"SS_TRANSLUCENCY\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vDiffusionDistance\", \"vTintColor\", \"vSubSurfaceIntensity\", \"vRefractionMicrosurfaceInfos\", \"vRefractionFilteringInfo\", \"vRefractionInfos\", \"vThicknessInfos\", \"vThicknessParam\", \"refractionMatrix\", \"thicknessMatrix\", \"scatteringDiffusionProfile\");\n          }, r.AddSamplers = function(t) {\n            t.push(\"thicknessSampler\", \"refractionSampler\", \"refractionSamplerLow\", \"refractionSamplerHigh\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vRefractionMicrosurfaceInfos\", 3), t.addUniform(\"vRefractionFilteringInfo\", 2), t.addUniform(\"vRefractionInfos\", 4), t.addUniform(\"refractionMatrix\", 16), t.addUniform(\"vThicknessInfos\", 2), t.addUniform(\"thicknessMatrix\", 16), t.addUniform(\"vThicknessParam\", 2), t.addUniform(\"vDiffusionDistance\", 3), t.addUniform(\"vTintColor\", 4), t.addUniform(\"vSubSurfaceIntensity\", 3), t.addUniform(\"scatteringDiffusionProfile\", 1);\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isRefractionEnabled\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isTranslucencyEnabled\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markScenePrePassDirty\")], r.prototype, \"isScatteringEnabled\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"_scatteringDiffusionProfileIndex\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"refractionIntensity\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"translucencyIntensity\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"useAlbedoToTintRefraction\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"thicknessTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"refractionTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"indexOfRefraction\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"_volumeIndexOfRefraction\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"volumeIndexOfRefraction\", null), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"invertRefractionY\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"linkRefractionWithTransparency\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"minimumThickness\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"maximumThickness\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"tintColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"tintColorAtDistance\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"diffusionDistance\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useMaskFromThicknessTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useMaskFromThicknessTextureGltf\", void 0), r;\n        }(), Ss = f(105), zt = f(25), sp = (f(160), `uniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\n\nuniform vec4 vLightingIntensity;\nuniform vec4 vReflectivityColor;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef ALBEDO\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\n#endif\n\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REALTIME_FILTERING\nuniform vec2 vReflectionFilteringInfo;\n#endif\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n\n#ifdef CLEARCOAT\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n#endif\n\n#ifdef ANISOTROPIC\nuniform vec3 vAnisotropy;\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\nuniform vec4 vSheenColor;\n#ifdef SHEEN_ROUGHNESS\nuniform float vSheenRoughness;\n#endif\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#ifdef REALTIME_FILTERING\nuniform vec2 vRefractionFilteringInfo;\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\n#endif\n#ifdef PREPASS\n#ifdef PREPASS_IRRADIANCE\nuniform float scatteringDiffusionProfile;\n#endif\n#endif`);\n        ze.a.IncludesShadersStore.pbrFragmentDeclaration = sp;\n        var cp = `layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec2 vAlbedoInfos;\nuniform vec4 vAmbientInfos;\nuniform vec2 vOpacityInfos;\nuniform vec2 vEmissiveInfos;\nuniform vec2 vLightmapInfos;\nuniform vec3 vReflectivityInfos;\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform vec2 vReflectionInfos;\nuniform vec2 vReflectionFilteringInfo;\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\nuniform vec3 vBumpInfos;\nuniform mat4 albedoMatrix;\nuniform mat4 ambientMatrix;\nuniform mat4 opacityMatrix;\nuniform mat4 emissiveMatrix;\nuniform mat4 lightmapMatrix;\nuniform mat4 reflectivityMatrix;\nuniform mat4 microSurfaceSamplerMatrix;\nuniform mat4 bumpMatrix;\nuniform vec2 vTangentSpaceParams;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\nuniform vec4 vLightingIntensity;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float pointSize;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\nuniform vec4 vClearCoatInfos;\nuniform mat4 clearCoatMatrix;\nuniform mat4 clearCoatRoughnessMatrix;\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\nuniform vec3 vAnisotropy;\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\nuniform vec4 vSheenColor;\nuniform float vSheenRoughness;\nuniform vec4 vSheenInfos;\nuniform mat4 sheenMatrix;\nuniform mat4 sheenRoughnessMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec2 vRefractionFilteringInfo;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\nuniform float scatteringDiffusionProfile;\nuniform vec4 vDetailInfos;\nuniform mat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};`;\n        ze.a.IncludesShadersStore.pbrUboDeclaration = cp;\n        var lp = `uniform vec4 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec4 vCameraInfos;\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nuniform vec2 vDebugMode;\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif`;\n        ze.a.IncludesShadersStore.pbrFragmentExtraDeclaration = lp;\n        var up = `#ifdef ALBEDO\n#if ALBEDODIRECTUV == 1\n#define vAlbedoUV vMainUV1\n#elif ALBEDODIRECTUV == 2\n#define vAlbedoUV vMainUV2\n#else\nvarying vec2 vAlbedoUV;\n#endif\nuniform sampler2D albedoSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFLECTIVITY\n#if REFLECTIVITYDIRECTUV == 1\n#define vReflectivityUV vMainUV1\n#elif REFLECTIVITYDIRECTUV == 2\n#define vReflectivityUV vMainUV2\n#else\nvarying vec2 vReflectivityUV;\n#endif\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef MICROSURFACEMAP\n#if MICROSURFACEMAPDIRECTUV == 1\n#define vMicroSurfaceSamplerUV vMainUV1\n#elif MICROSURFACEMAPDIRECTUV == 2\n#define vMicroSurfaceSamplerUV vMainUV2\n#else\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\nuniform sampler2D microSurfaceSampler;\n#endif\n#ifdef METALLIC_REFLECTANCE\n#if METALLIC_REFLECTANCEDIRECTUV == 1\n#define vMetallicReflectanceUV vMainUV1\n#elif METALLIC_REFLECTANCEDIRECTUV == 2\n#define vMetallicReflectanceUV vMainUV2\n#else\nvarying vec2 vMetallicReflectanceUV;\n#endif\nuniform sampler2D metallicReflectanceSampler;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE)\n#if CLEARCOAT_TEXTUREDIRECTUV == 1\n#define vClearCoatUV vMainUV1\n#elif CLEARCOAT_TEXTUREDIRECTUV == 2\n#define vClearCoatUV vMainUV2\n#else\nvarying vec2 vClearCoatUV;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)\n#if CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 1\n#define vClearCoatRoughnessUV vMainUV1\n#elif CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 2\n#define vClearCoatRoughnessUV vMainUV2\n#else\nvarying vec2 vClearCoatRoughnessUV;\n#endif\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform sampler2D clearCoatSampler;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL)\nuniform sampler2D clearCoatRoughnessSampler;\n#endif\n#ifdef CLEARCOAT_BUMP\n#if CLEARCOAT_BUMPDIRECTUV == 1\n#define vClearCoatBumpUV vMainUV1\n#elif CLEARCOAT_BUMPDIRECTUV == 2\n#define vClearCoatBumpUV vMainUV2\n#else\nvarying vec2 vClearCoatBumpUV;\n#endif\nuniform sampler2D clearCoatBumpSampler;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\n#if CLEARCOAT_TINT_TEXTUREDIRECTUV == 1\n#define vClearCoatTintUV vMainUV1\n#elif CLEARCOAT_TINT_TEXTUREDIRECTUV == 2\n#define vClearCoatTintUV vMainUV2\n#else\nvarying vec2 vClearCoatTintUV;\n#endif\nuniform sampler2D clearCoatTintSampler;\n#endif\n#endif\n#ifdef SHEEN\n#ifdef SHEEN_TEXTURE\n#if SHEEN_TEXTUREDIRECTUV == 1\n#define vSheenUV vMainUV1\n#elif SHEEN_TEXTUREDIRECTUV == 2\n#define vSheenUV vMainUV2\n#else\nvarying vec2 vSheenUV;\n#endif\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\n#if SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 1\n#define vSheenRoughnessUV vMainUV1\n#elif SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 2\n#define vSheenRoughnessUV vMainUV2\n#else\nvarying vec2 vSheenRoughnessUV;\n#endif\n#endif\n#ifdef SHEEN_TEXTURE\nuniform sampler2D sheenSampler;\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL)\nuniform sampler2D sheenRoughnessSampler;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\n#if ANISOTROPIC_TEXTUREDIRECTUV == 1\n#define vAnisotropyUV vMainUV1\n#elif ANISOTROPIC_TEXTUREDIRECTUV == 2\n#define vAnisotropyUV vMainUV2\n#else\nvarying vec2 vAnisotropyUV;\n#endif\nuniform sampler2D anisotropySampler;\n#endif\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform samplerCube irradianceSampler;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D reflectionSamplerLow;\nuniform sampler2D reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform sampler2D irradianceSampler;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D refractionSamplerLow;\nuniform sampler2D refractionSamplerHigh;\n#endif\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#if SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 1\n#define vThicknessUV vMainUV1\n#elif SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 2\n#define vThicknessUV vMainUV2\n#else\nvarying vec2 vThicknessUV;\n#endif\nuniform sampler2D thicknessSampler;\n#endif\n#endif`;\n        ze.a.IncludesShadersStore.pbrFragmentSamplersDeclaration = up, f(116), ze.a.IncludesShadersStore.subSurfaceScatteringFunctions = `bool testLightingForSSS(float diffusionProfile)\n{\nreturn diffusionProfile<1.;\n}`;\n        var hp = `\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereCosSample(vec2 u) {\n\nfloat phi=2.*PI*u.x;\nfloat cosTheta2=1.-u.y;\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDggx(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\n\nfloat cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\nfloat sinTheta=pow(u.y,a/(2.*a+1.));\nfloat cosTheta=sqrt(1.-sinTheta*sinTheta);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}`;\n        ze.a.IncludesShadersStore.importanceSampling = hp;\n        var dp = `\n#define RECIPROCAL_PI2 0.15915494\n#define RECIPROCAL_PI 0.31830988618\n\n#define MINIMUMVARIANCE 0.0005\nfloat convertRoughnessToAverageSlope(float roughness)\n{\n\nreturn square(roughness)+MINIMUMVARIANCE;\n}\nfloat fresnelGrazingReflectance(float reflectance0) {\n\n\nfloat reflectance90=saturate(reflectance0*25.0);\nreturn reflectance90;\n}\nvec2 getAARoughnessFactors(vec3 normalVector) {\n#ifdef SPECULARAA\nvec3 nDfdx=dFdx(normalVector.xyz);\nvec3 nDfdy=dFdy(normalVector.xyz);\nfloat slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));\n\nfloat geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);\n\nfloat geometricAlphaGFactor=sqrt(slopeSquare);\n\ngeometricAlphaGFactor*=0.75;\nreturn vec2(geometricRoughnessFactor,geometricAlphaGFactor);\n#else\nreturn vec2(0.);\n#endif\n}\n#ifdef ANISOTROPIC\n\n\nvec2 getAnisotropicRoughness(float alphaG,float anisotropy) {\nfloat alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);\nfloat alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);\nreturn vec2(alphaT,alphaB);\n}\n\n\nvec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy) {\nvec3 anisotropicFrameDirection=anisotropy>=0.0 ? B : T;\nvec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);\nvec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);\nvec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));\nreturn anisotropicNormal;\n\n}\n#endif\n#if defined(CLEARCOAT) || defined(SS_REFRACTION)\n\n\n\nvec3 cocaLambert(vec3 alpha,float distance) {\nreturn exp(-alpha*distance);\n}\n\nvec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {\nreturn cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));\n}\n\nvec3 computeColorAtDistanceInMedia(vec3 color,float distance) {\nreturn -log(color)/distance;\n}\nvec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 clearCoatAbsorption=mix(vec3(1.0),\ncocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),\nclearCoatIntensity);\nreturn clearCoatAbsorption;\n}\n#endif\n\n\n\n\n#ifdef MICROSURFACEAUTOMATIC\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{\nconst float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;\nfloat reflectivityLuminance=getLuminance(reflectivityColor);\nfloat reflectivityLuma=sqrt(reflectivityLuminance);\nmicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;\nreturn microSurface;\n}\n#endif`;\n        ze.a.IncludesShadersStore.pbrHelperFunctions = dp;\n        var fp = `#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;\nuniform vec3 vSphericalL1_1;\nuniform vec3 vSphericalL10;\nuniform vec3 vSphericalL11;\nuniform vec3 vSphericalL2_2;\nuniform vec3 vSphericalL2_1;\nuniform vec3 vSphericalL20;\nuniform vec3 vSphericalL21;\nuniform vec3 vSphericalL22;\n\n\n\n\n\n\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\nreturn vSphericalL00\n+vSphericalL1_1*(normal.y)\n+vSphericalL10*(normal.z)\n+vSphericalL11*(normal.x)\n+vSphericalL2_2*(normal.y*normal.x)\n+vSphericalL2_1*(normal.y*normal.z)\n+vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+vSphericalL21*(normal.z*normal.x)\n+vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));\n}\n#else\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX_ZZ;\nuniform vec3 vSphericalYY_ZZ;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\n\n\n\n\n\n\n\n\n\nfloat Nx=normal.x;\nfloat Ny=normal.y;\nfloat Nz=normal.z;\nvec3 C1=vSphericalZZ.rgb;\nvec3 Cx=vSphericalX.rgb;\nvec3 Cy=vSphericalY.rgb;\nvec3 Cz=vSphericalZ.rgb;\nvec3 Cxx_zz=vSphericalXX_ZZ.rgb;\nvec3 Cyy_zz=vSphericalYY_ZZ.rgb;\nvec3 Cxy=vSphericalXY.rgb;\nvec3 Cyz=vSphericalYZ.rgb;\nvec3 Czx=vSphericalZX.rgb;\nvec3 a1=Cyy_zz*Ny+Cy;\nvec3 a2=Cyz*Nz+a1;\nvec3 b1=Czx*Nz+Cx;\nvec3 b2=Cxy*Ny+b1;\nvec3 b3=Cxx_zz*Nx+b2;\nvec3 t1=Cz*Nz+C1;\nvec3 t2=a2*Ny+t1;\nvec3 t3=b3*Nx+t2;\nreturn t3;\n}\n#endif\n#endif`;\n        ze.a.IncludesShadersStore.harmonicsFunctions = fp;\n        var pp = `\nstruct preLightingInfo\n{\n\nvec3 lightOffset;\nfloat lightDistanceSquared;\nfloat lightDistance;\n\nfloat attenuation;\n\nvec3 L;\nvec3 H;\nfloat NdotV;\nfloat NdotLUnclamped;\nfloat NdotL;\nfloat VdotH;\nfloat roughness;\n};\npreLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightOffset=lightData.xyz-vPositionW;\nresult.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);\n\nresult.lightDistance=sqrt(result.lightDistanceSquared);\n\nresult.L=normalize(result.lightOffset);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightDistance=length(-lightData.xyz);\n\nresult.L=normalize(-lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\n\nresult.NdotL=dot(N,lightData.xyz)*0.5+0.5;\nresult.NdotL=saturateEps(result.NdotL);\nresult.NdotLUnclamped=result.NdotL;\n#ifdef SPECULARTERM\nresult.L=normalize(lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\n#endif\nreturn result;\n}`;\n        ze.a.IncludesShadersStore.pbrDirectLightingSetupFunctions = pp;\n        var _p = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)\n{\nreturn max(0.,1.0-length(lightOffset)/range);\n}\nfloat computeDistanceLightFalloff_Physical(float lightDistanceSquared)\n{\nreturn 1.0/maxEps(lightDistanceSquared);\n}\nfloat computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)\n{\nfloat lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);\nfloat factor=lightDistanceSquared*inverseSquaredRange;\nfloat attenuation=saturate(1.0-factor*factor);\nattenuation*=attenuation;\n\nlightDistanceFalloff*=attenuation;\nreturn lightDistanceFalloff;\n}\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfloat computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)\n{\nfloat falloff=0.0;\nfloat cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));\nif (cosAngle>=cosHalfAngle)\n{\nfalloff=max(0.,pow(cosAngle,exponent));\n}\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)\n{\nconst float kMinusLog2ConeAngleIntensityRatio=6.64385618977;\n\n\n\n\n\nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);\n\n\nvec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);\nfloat falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)\n{\n\n\n\nfloat cd=dot(-lightDirection,directionToLightCenterW);\nfloat falloff=saturate(cd*lightAngleScale+lightAngleOffset);\n\nfalloff*=falloff;\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}`;\n        ze.a.IncludesShadersStore.pbrDirectLightingFalloffFunctions = _p;\n        var mp = `\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\n\n\n\n#ifdef MS_BRDF_ENERGY_CONSERVATION\n\n\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\nreturn 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);\n}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {\n\nvec2 UV=vec2(NdotV,perceptualRoughness);\n\nvec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;\n}\n#endif\n\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nvec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n\nvec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {\nvec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;\nreturn sheenEnvironmentReflectance;\n}\n#endif\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\nfloat fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\n#ifdef CLEARCOAT\n\n\n\n\n\nvec3 getR0RemappedForClearCoat(vec3 f0) {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturate(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvec3 s=sqrt(f0);\nvec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);\nreturn t*t;\n#endif\n}\n#endif\n\n\n\n\n\n\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{\n\n\n\nfloat a2=square(alphaG);\nfloat d=NdotH*NdotH*(a2-1.0)+1.0;\nreturn a2/(PI*d*d);\n}\n#ifdef SHEEN\n\n\nfloat normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)\n{\nfloat invR=1./alphaG;\nfloat cos2h=NdotH*NdotH;\nfloat sin2h=1.-cos2h;\nreturn (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {\nfloat a2=alphaTB.x*alphaTB.y;\nvec3 v=vec3(alphaTB.y*TdotH,alphaTB.x*BdotH,a2*NdotH);\nfloat v2=dot(v,v);\nfloat w2=a2/v2;\nreturn a2*w2*w2*RECIPROCAL_PI;\n}\n#endif\n\n\n\n\n#ifdef BRDF_V_HEIGHT_CORRELATED\n\n\n\nfloat smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {\n#ifdef MOBILE\n\nfloat GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);\nfloat GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);\nreturn 0.5/(GGXV+GGXL);\n#else\nfloat a2=alphaG*alphaG;\nfloat GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);\nfloat GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);\nreturn 0.5/(GGXV+GGXL);\n#endif\n}\n#else\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfloat smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)\n{\n#ifdef MOBILE\n\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nfloat alphaSquared=alphaG*alphaG;\nreturn 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfloat smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)\n{\nfloat visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);\n\nreturn visibility;\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {\nfloat lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));\nfloat lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));\nfloat v=0.5/(lambdaV+lambdaL);\nreturn v;\n}\n#endif\n#ifdef CLEARCOAT\nfloat visibility_Kelemen(float VdotH) {\n\n\n\nreturn 0.25/(VdotH*VdotH);\n}\n#endif\n#ifdef SHEEN\n\n\n\nfloat visibility_Ashikhmin(float NdotL,float NdotV)\n{\nreturn 1./(4.*(NdotL+NdotV-NdotL*NdotV));\n}\n\n#endif\n\n\n\n\n\n\n\nfloat diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {\n\n\nfloat diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));\nfloat diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));\nfloat diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;\nfloat fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);\nreturn fresnel/PI;\n}\n#ifdef SS_TRANSLUCENCY\n\n\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {\nvec3 S=1./maxEps(diffusionDistance);\nvec3 temp=exp((-0.333333333*thickness)*S);\nreturn tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);\n}\n\n\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {\nfloat t=1.0+w;\nfloat invt2=1.0/square(t);\nreturn saturate((NdotL+w)*invt2);\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBRDFFunctions = mp;\n        var gp = `#ifdef NUM_SAMPLES\n#if NUM_SAMPLES>0\n#ifdef WEBGL2\n\n\nfloat radicalInverse_VdC(uint bits)\n{\nbits=(bits << 16u) | (bits >> 16u);\nbits=((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\nbits=((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\nbits=((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\nbits=((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\nreturn float(bits)*2.3283064365386963e-10;\n}\nvec2 hammersley(uint i,uint N)\n{\nreturn vec2(float(i)/float(N),radicalInverse_VdC(i));\n}\n#else\nfloat vanDerCorpus(int n,int base)\n{\nfloat invBase=1.0/float(base);\nfloat denom=1.0;\nfloat result=0.0;\nfor(int i=0; i<32; ++i)\n{\nif(n>0)\n{\ndenom=mod(float(n),2.0);\nresult+=denom*invBase;\ninvBase=invBase/2.0;\nn=int(float(n)/2.0);\n}\n}\nreturn result;\n}\nvec2 hammersley(int i,int N)\n{\nreturn vec2(float(i)/float(N),vanDerCorpus(i,2));\n}\n#endif\nfloat log4(float x) {\nreturn log2(x)/2.;\n}\nconst float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);\nconst float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;\nconst float K=4.;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#define inline\nvec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nvec3 result=vec3(0.0);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 Ls=hemisphereCosSample(Xi);\nLs=normalize(Ls);\nvec3 Ns=vec3(0.,0.,1.);\nfloat NoL=dot(Ns,Ls);\nif (NoL>0.) {\nfloat pdf_inversed=PI/NoL;\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(l,0.0,maxLevel);\nvec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c;\n}\n}\nresult=result*NUM_SAMPLES_FLOAT_INVERSED;\nreturn result;\n}\n#define inline\nvec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nif (alphaG == 0.) {\nvec3 c=textureCube(inputTexture,n).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nreturn c;\n}\nvec3 result=vec3(0.);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\nfloat weight=0.;\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);\nfloat NoV=1.;\nfloat NoH=H.z;\nfloat NoH2=H.z*H.z;\nfloat NoL=2.*NoH2-1.;\nvec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);\nL=normalize(L);\nif (NoL>0.) {\nfloat pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(float(l),0.0,maxLevel);\nweight+=NoL;\nvec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c*NoL;\n}\n}\nresult=result/weight;\nreturn result;\n}\n#endif\n#endif`;\n        ze.a.IncludesShadersStore.hdrFilteringFunctions = gp;\n        var vp = `#define CLEARCOATREFLECTANCE90 1.0\n\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef CLEARCOAT\n\n\nvec4 clearCoat;\n#endif\n#ifdef SHEEN\nvec3 sheen;\n#endif\n};\n\nfloat adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\n\nfloat lightRoughness=lightRadius/lightDistance;\n\nfloat totalRoughness=saturate(lightRoughness+roughness);\nreturn totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nvec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {\nreturn mix(groundColor,lightColor,info.NdotL);\n}\nvec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {\nfloat diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*info.attenuation*info.NdotL*lightColor;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn toLinearSpace(textureColor);\n}\n#ifdef SS_TRANSLUCENCY\nvec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {\nfloat NdotL=absEps(info.NdotLUnclamped);\n\nfloat wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);\n\nfloat trAdapt=step(0.,info.NdotLUnclamped);\nvec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);\nfloat diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;\n}\n#endif\n#ifdef SPECULARTERM\nvec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nfloat smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef ANISOTROPIC\nvec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat TdotH=dot(T,info.H);\nfloat BdotH=dot(B,info.H);\nfloat TdotV=dot(T,V);\nfloat BdotV=dot(B,V);\nfloat TdotL=dot(T,info.L);\nfloat BdotL=dot(B,info.L);\nfloat alphaG=convertRoughnessToAverageSlope(info.roughness);\nvec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);\nalphaTB=max(alphaTB,square(geometricRoughnessFactor));\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);\nfloat smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef CLEARCOAT\nvec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {\nfloat NccdotL=saturateEps(dot(Ncc,info.L));\nfloat NccdotH=saturateEps(dot(Ncc,info.H));\nfloat clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\nfloat fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnel*=clearCoatIntensity;\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);\nfloat kelemenVisibility=visibility_Kelemen(info.VdotH);\nfloat clearCoatTerm=fresnel*distribution*kelemenVisibility;\nreturn vec4(\nclearCoatTerm*info.attenuation*NccdotL*lightColor,\n1.0-fresnel\n);\n}\nvec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);\nfloat NdotLRefract=saturateEps(dot(Ncc,LRefract));\nvec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);\nreturn absorption;\n}\n#endif\n#ifdef SHEEN\nvec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\n\n\nfloat fresnel=1.;\nfloat distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);\n\nfloat visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);\n\nfloat sheenTerm=fresnel*distribution*visibility;\nreturn sheenTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrDirectLightingFunctions = vp;\n        var yp = `#if defined(REFLECTION) || defined(SS_REFRACTION)\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {\nfloat microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;\nfloat lod=log2(microsurfaceAverageSlopeTexels);\nreturn lod;\n}\nfloat getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {\nfloat lod=log2(cubeMapDimensionPixels)*roughness;\nreturn lod;\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)\nfloat environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {\n\n\nfloat temp=NdotVUnclamped+ambientOcclusion;\nreturn saturate(square(temp)-1.0+ambientOcclusion);\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)\nfloat environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {\n\nvec3 reflection=reflect(view,normal);\nfloat temp=saturate(1.0+1.1*dot(reflection,geometricNormal));\nreturn square(temp);\n}\n#endif\n\n\n\n\n#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)\n\n\n#define UNPACK_LOD(x) (1.0-x)*255.0\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {\nfloat microsurfaceAverageSlope=alphaG;\n\n\n\n\n\n\nmicrosurfaceAverageSlope*=sqrt(abs(NdotV));\nreturn getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);\n}\n#endif`;\n        ze.a.IncludesShadersStore.pbrIBLFunctions = yp, f(132), f(133);\n        var bp = `struct albedoOpacityOutParams\n{\nvec3 surfaceAlbedo;\nfloat alpha;\n};\n#define pbr_inline\nvoid albedoOpacityBlock(\nconst in vec4 vAlbedoColor,\n#ifdef ALBEDO\nconst in vec4 albedoTexture,\nconst in vec2 albedoInfos,\n#endif\n#ifdef OPACITY\nconst in vec4 opacityMap,\nconst in vec2 vOpacityInfos,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout albedoOpacityOutParams outParams\n)\n{\n\nvec3 surfaceAlbedo=vAlbedoColor.rgb;\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\n#ifdef GAMMAALBEDO\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\n#else\nsurfaceAlbedo*=albedoTexture.rgb;\n#endif\nsurfaceAlbedo*=albedoInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nsurfaceAlbedo*=vColor.rgb;\n#endif\n#ifdef DETAIL\nfloat detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);\nsurfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALBEDO\n\n#ifdef OPACITY\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;\noutParams.alpha=alpha;\n}\n`;\n        ze.a.IncludesShadersStore.pbrBlockAlbedoOpacity = bp;\n        var Tp = `struct reflectivityOutParams\n{\nfloat microSurface;\nfloat roughness;\nvec3 surfaceReflectivityColor;\n#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\n#endif\n#if DEBUGMODE>0\nvec4 surfaceMetallicColorMap;\nvec4 surfaceReflectivityColorMap;\nvec2 metallicRoughness;\nvec3 metallicF0;\n#endif\n};\n#define pbr_inline\nvoid reflectivityBlock(\nconst in vec4 vReflectivityColor,\n#ifdef METALLICWORKFLOW\nconst in vec3 surfaceAlbedo,\nconst in vec4 metallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nconst in vec3 reflectivityInfos,\nconst in vec4 surfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nconst in vec3 ambientOcclusionColorIn,\n#endif\n#ifdef MICROSURFACEMAP\nconst in vec4 microSurfaceTexel,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout reflectivityOutParams outParams\n)\n{\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\n#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);\noutParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\n#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);\nfloat loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);\nfloat hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);\nmetallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\n#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n#if DEBUGMODE>0\noutParams.metallicRoughness=metallicRoughness;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\n\nmicroSurface=1.0-metallicRoughness.g;\n\nvec3 baseColor=surfaceAlbedo;\n#ifdef FROSTBITE_REFLECTANCE\n\n\n\n\n\n\noutParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\n#else\nvec3 metallicF0=metallicReflectanceFactors.rgb;\n#if DEBUGMODE>0\noutParams.metallicF0=metallicF0;\n#endif\n\noutParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);\n#endif\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\n#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;\nmicroSurface*=reflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\n#endif\n\nmicroSurface=saturate(microSurface);\n\nfloat roughness=1.-microSurface;\noutParams.microSurface=microSurface;\noutParams.roughness=roughness;\noutParams.surfaceReflectivityColor=surfaceReflectivityColor;\n}\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflectivity = Tp;\n        var Ep = `struct ambientOcclusionOutParams\n{\nvec3 ambientOcclusionColor;\n#if DEBUGMODE>0\nvec3 ambientOcclusionColorMap;\n#endif\n};\n#define pbr_inline\nvoid ambientOcclusionBlock(\n#ifdef AMBIENT\nconst in vec3 ambientOcclusionColorMap_,\nconst in vec4 vAmbientInfos,\n#endif\nout ambientOcclusionOutParams outParams\n)\n{\nvec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#if DEBUGMODE>0\noutParams.ambientOcclusionColorMap=ambientOcclusionColorMap;\n#endif\n#endif\noutParams.ambientOcclusionColor=ambientOcclusionColor;\n}\n`;\n        ze.a.IncludesShadersStore.pbrBlockAmbientOcclusion = Ep;\n        var Sp = `#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nstruct alphaFresnelOutParams\n{\nfloat alpha;\n};\n#define pbr_inline\nvoid alphaFresnelBlock(\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nconst in float alpha,\nconst in float microSurface,\nout alphaFresnelOutParams outParams\n)\n{\n\n\n\nfloat opacityPerceptual=alpha;\n#ifdef LINEARALPHAFRESNEL\nfloat opacity0=opacityPerceptual;\n#else\nfloat opacity0=opacityPerceptual*opacityPerceptual;\n#endif\nfloat opacity90=fresnelGrazingReflectance(opacity0);\nvec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);\n\noutParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (outParams.alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\noutParams.alpha=1.0;\n#endif\n#endif\n}\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockAlphaFresnel = Sp;\n        var Ap = `#ifdef ANISOTROPIC\nstruct anisotropicOutParams\n{\nfloat anisotropy;\nvec3 anisotropicTangent;\nvec3 anisotropicBitangent;\nvec3 anisotropicNormal;\n#if DEBUGMODE>0\nvec3 anisotropyMapData;\n#endif\n};\n#define pbr_inline\nvoid anisotropicBlock(\nconst in vec3 vAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nconst in vec3 anisotropyMapData,\n#endif\nconst in mat3 TBN,\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nout anisotropicOutParams outParams\n)\n{\nfloat anisotropy=vAnisotropy.b;\nvec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nanisotropy*=anisotropyMapData.b;\nanisotropyDirection.rg*=anisotropyMapData.rg*2.0-1.0;\n#if DEBUGMODE>0\noutParams.anisotropyMapData=anisotropyMapData;\n#endif\n#endif\nmat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));\nvec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);\nvec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));\noutParams.anisotropy=anisotropy;\noutParams.anisotropicTangent=anisotropicTangent;\noutParams.anisotropicBitangent=anisotropicBitangent;\noutParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy);\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockAnisotropic = Ap;\n        var Pp = `#ifdef REFLECTION\nstruct reflectionOutParams\n{\nvec4 environmentRadiance;\nvec3 environmentIrradiance;\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords;\n#else\nvec2 reflectionCoords;\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nvec3 irradianceVector;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nvoid createReflectionCoords(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REFLECTIONMAP_3D\nout vec3 reflectionCoords\n#else\nout vec2 reflectionCoords\n#endif\n)\n{\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n}\n#define pbr_inline\n#define inline\nvoid sampleReflectionTexture(\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst vec2 reflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\nout vec4 environmentRadiance\n)\n{\n\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);\nfloat requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);\nif (lodReflectionNormalizedDoubled<1.0){\nenvironmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nenvironmentRadiance=mix(\nenvironmentMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\n\nenvironmentRadiance.rgb*=vReflectionInfos.x;\nenvironmentRadiance.rgb*=vReflectionColor.rgb;\n}\n#define pbr_inline\n#define inline\nvoid reflectionBlock(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nconst in vec3 vEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in mat4 reflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\nout reflectionOutParams outParams\n)\n{\n\nvec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=vec3(0.);\n#else\nvec2 reflectionCoords=vec2(0.);\n#endif\ncreateReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\nreflectionCoords\n);\nsampleReflectionTexture(\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionSampler,\nreflectionCoords,\n#else\nreflectionSampler,\nreflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentRadiance\n);\n\nvec3 environmentIrradiance=vec3(0.,0.,0.);\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;\noutParams.environmentRadiance=environmentRadiance;\noutParams.environmentIrradiance=environmentIrradiance;\noutParams.reflectionCoords=reflectionCoords;\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflection = Pp;\n        var xp = `#ifdef SHEEN\nstruct sheenOutParams\n{\nfloat sheenIntensity;\nvec3 sheenColor;\nfloat sheenRoughness;\n#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\n#endif\n#if DEBUGMODE>0\nvec4 sheenMapData;\nvec3 sheenEnvironmentReflectance;\n#endif\n};\n#define pbr_inline\n#define inline\nvoid sheenBlock(\nconst in vec4 vSheenColor,\n#ifdef SHEEN_ROUGHNESS\nconst in float vSheenRoughness,\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nconst in vec4 sheenMapRoughnessData,\n#endif\n#endif\nconst in float roughness,\n#ifdef SHEEN_TEXTURE\nconst in vec4 sheenMapData,\n#endif\nconst in float reflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nconst in vec3 baseColor,\nconst in vec3 surfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nconst in float NdotV,\nconst in vec3 environmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nconst in vec2 AARoughnessFactors,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst in vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst in vec2 reflectionCoords,\n#endif\nconst in float NdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nconst in float seo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nconst in float eho,\n#endif\n#endif\nout sheenOutParams outParams\n)\n{\nfloat sheenIntensity=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\n#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\nvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\nfloat sheenRoughness=sheenIntensity;\noutParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\nsheenColor.rgb*=sheenMapData.rgb;\n#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\n#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\n#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\n#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL\nsheenRoughness*=sheenMapData.a;\n#else\nsheenRoughness*=sheenMapRoughnessData.a;\n#endif\n#endif\n#else\nfloat sheenRoughness=roughness;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#endif\n\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\n#endif\n\nsheenColor*=sheenIntensity;\n#endif\n\n#ifdef ENVIRONMENTBRDF\n\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\n#else\nvec3 environmentSheenBrdf=environmentBrdf;\n#endif\n\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\n\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\nsampleReflectionTexture(\nsheenAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\n#endif\nreflectionSampler,\nreflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentSheenRadiance\n);\nvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\n#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\n#endif\noutParams.finalSheenRadianceScaled=\nenvironmentSheenRadiance.rgb *\nsheenEnvironmentReflectance *\nvLightingIntensity.z;\n\n\n\n\n\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\n\n\n\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\n#endif\n\noutParams.sheenIntensity=sheenIntensity;\noutParams.sheenColor=sheenColor;\noutParams.sheenRoughness=sheenRoughness;\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockSheen = xp;\n        var Cp = `struct clearcoatOutParams\n{\nvec3 specularEnvironmentR0;\nfloat conservationFactor;\nvec3 clearCoatNormalW;\nvec2 clearCoatAARoughnessFactors;\nfloat clearCoatIntensity;\nfloat clearCoatRoughness;\n#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;\nfloat clearCoatNdotVRefract;\nvec3 clearCoatColor;\nfloat clearCoatThickness;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\n#endif\n#if DEBUGMODE>0\nmat3 TBNClearCoat;\nvec2 clearCoatMapData;\nvec4 clearCoatTintMapData;\nvec4 environmentClearCoatRadiance;\nfloat clearCoatNdotV;\nvec3 clearCoatEnvironmentReflectance;\n#endif\n};\n#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nvoid clearcoatBlock(\nconst in vec3 vPositionW,\nconst in vec3 geometricNormalW,\nconst in vec3 viewDirectionW,\nconst in vec2 vClearCoatParams,\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nconst in vec4 clearCoatMapRoughnessData,\n#endif\nconst in vec3 specularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nconst in vec2 clearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nconst in vec4 vClearCoatTintParams,\nconst in float clearCoatColorAtDistance,\nconst in vec4 vClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nconst in vec4 clearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nconst in vec2 vClearCoatBumpInfos,\nconst in vec4 clearCoatBumpMapData,\nconst in vec2 vClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nconst in mat3 vTBN,\n#else\nconst in vec2 vClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nconst in mat4 normalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nconst in vec3 faceNormal,\n#endif\n#ifdef REFLECTION\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nconst in float ambientMonochrome,\n#endif\n#endif\nout clearcoatOutParams outParams\n)\n{\n\nfloat clearCoatIntensity=vClearCoatParams.x;\nfloat clearCoatRoughness=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\n#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL\nclearCoatRoughness*=clearCoatMapData.y;\n#else\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\n#endif\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;\noutParams.clearCoatRoughness=clearCoatRoughness;\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\nfloat clearCoatThickness=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatColor*=clearCoatTintMapData.rgb;\nclearCoatThickness*=clearCoatTintMapData.a;\n#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\n#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\noutParams.clearCoatThickness=clearCoatThickness;\n#endif\n\n\n\n\n#ifdef CLEARCOAT_REMAP_F0\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\n#else\nvec3 specularEnvironmentR0Updated=specularEnvironmentR0;\n#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\n\nvec3 clearCoatNormalW=geometricNormalW;\n#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\n#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\n#else\nmat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,vClearCoatBumpUV,vClearCoatTangentSpaceParams);\n#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz*2.0-1.0);\nclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=gl_FrontFacing ? clearCoatNormalW : -clearCoatNormalW;\n#endif\noutParams.clearCoatNormalW=clearCoatNormalW;\n\noutParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\n\nfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\n\nfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\n#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\n#endif\n#ifdef CLEARCOAT_TINT\n\nvec3 clearCoatVRefract=-refract(vPositionW,clearCoatNormalW,vClearCoatRefractionParams.y);\n\noutParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\n#endif\n\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\n\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\n#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);\nvec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\n#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\n#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\n#endif\nsampleReflectionTexture(\nclearCoatAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\n#endif\nreflectionSampler,\nclearCoatReflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentClearCoatRadiance\n);\n#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\n#endif\n\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\n#ifdef RADIANCEOCCLUSION\nfloat clearCoatSeo=environmentRadianceOcclusion(ambientMonochrome,clearCoatNdotVUnclamped);\nclearCoatEnvironmentReflectance*=clearCoatSeo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);\nclearCoatEnvironmentReflectance*=clearCoatEho;\n#endif\n#endif\n#endif\n#else\n\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\n#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\n#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\n#endif\noutParams.finalClearCoatRadianceScaled=\nenvironmentClearCoatRadiance.rgb *\nclearCoatEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(CLEARCOAT_TINT)\n\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#endif\n\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnelIBLClearCoat*=clearCoatIntensity;\noutParams.conservationFactor=(1.-fresnelIBLClearCoat);\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\n#endif\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockClearcoat = Cp;\n        var Rp = `struct subSurfaceOutParams\n{\nvec3 specularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nvec3 finalRefraction;\nvec3 surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\n#endif\n#ifdef REFLECTION\nfloat refractionFactorForIrradiance;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;\nfloat translucencyIntensity;\n#ifdef REFLECTION\nvec3 refractionIrradiance;\n#endif\n#endif\n#if DEBUGMODE>0\nvec4 thicknessMap;\nvec4 environmentRefraction;\nvec3 refractionTransmittance;\n#endif\n};\n#ifdef SUBSURFACE\n#define pbr_inline\n#define inline\nvoid subSurfaceBlock(\nconst in vec3 vSubSurfaceIntensity,\nconst in vec2 vThicknessParam,\nconst in vec4 vTintColor,\nconst in vec3 normalW,\nconst in vec3 specularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nconst in vec4 thicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nconst in mat4 reflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in vec3 irradianceVector_,\n#endif\n#if defined(REALTIME_FILTERING)\nconst in samplerCube reflectionSampler,\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nconst in vec3 vPositionW,\nconst in vec3 viewDirectionW,\nconst in mat4 view,\nconst in vec3 surfaceAlbedo,\nconst in vec4 vRefractionInfos,\nconst in mat4 refractionMatrix,\nconst in vec3 vRefractionMicrosurfaceInfos,\nconst in vec4 vLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nconst in float alpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nconst in float NdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nconst in float roughness,\n#else\nconst in float alphaG,\n#endif\n#ifdef SS_REFRACTIONMAP_3D\nconst in samplerCube refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in samplerCube refractionSamplerLow,\nconst in samplerCube refractionSamplerHigh,\n#endif\n#else\nconst in sampler2D refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in sampler2D refractionSamplerLow,\nconst in sampler2D refractionSamplerHigh,\n#endif\n#endif\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vRefractionFilteringInfo,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nconst in vec3 vDiffusionDistance,\n#endif\nout subSurfaceOutParams outParams\n)\n{\noutParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\n\n\n\n#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);\n\noutParams.alpha=1.0;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\n#endif\n#ifdef SS_MASK_FROM_THICKNESS_TEXTURE\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.g;\n#endif\n#ifdef SS_TRANSLUCENCY\ntranslucencyIntensity*=thicknessMap.b;\n#endif\n#elif defined(SS_MASK_FROM_THICKNESS_TEXTURE_GLTF)\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.r;\n#elif defined(SS_TRANSLUCENCY)\ntranslucencyIntensity*=thicknessMap.r;\n#endif\nthickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\n#endif\n#else\nfloat thickness=vThicknessParam.y;\n#endif\n\n\n\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);\nvec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);\ntransmittance*=translucencyIntensity;\noutParams.transmittance=transmittance;\noutParams.translucencyIntensity=translucencyIntensity;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);\n#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n\n#ifdef SS_REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nvec3 refractionCoords=refractionVector;\nrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,roughness);\n#else\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef SS_LODINREFRACTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\nfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\n#else\nfloat requestedRefractionLOD=refractionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\n#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\n#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));\nfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\nvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\nif (lodRefractionNormalizedDoubled<1.0){\nenvironmentRefraction=mix(\nsampleRefraction(refractionSamplerHigh,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);\n} else {\nenvironmentRefraction=mix(\nenvironmentRefractionMid,\nsampleRefraction(refractionSamplerLow,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\n\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\n\n\n\n\n\nrefractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\n#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\n\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);\nvec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);\n\nenvironmentRefraction.rgb*=volumeAlbedo;\n#else\n\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\nrefractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\n#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\n\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\n#endif\n\noutParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);\n#ifdef REFLECTION\n\noutParams.refractionFactorForIrradiance=(1.-refractionIntensity);\n\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\noutParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\n\nrefractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;\n#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\n#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;\n#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\n#endif\n#endif\n\n\n\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#else\nvec3 irradianceVector=irradianceVector_;\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);\n#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\n#else\nvec2 irradianceCoords=irradianceVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\n#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\n#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\n#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\n#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\n#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\n#endif\nrefractionIrradiance.rgb*=transmittance;\noutParams.refractionIrradiance=refractionIrradiance.rgb;\n#endif\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockSubSurface = Rp;\n        var Op = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#endif\nvec3 geometricNormalW=normalW;\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\ngeometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockNormalGeometric = Op, f(134);\n        var Mp = `#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=gl_FrontFacing ? faceNormal : -faceNormal;\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockNormalFinal = Mp, f(162);\n        var Ip = `#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\n#ifdef GAMMALIGHTMAP\nlightmapColor.rgb=toLinearSpace(lightmapColor.rgb);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockLightmapInit = Ip;\n        var Dp = `float NdotVUnclamped=dot(normalW,viewDirectionW);\n\nfloat NdotV=absEps(NdotVUnclamped);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);\n#ifdef SPECULARAA\n\nalphaG+=AARoughnessFactors.y;\n#endif\n#if defined(ENVIRONMENTBRDF)\n\nvec3 environmentBrdf=getBRDFLookup(NdotV,roughness);\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=aoOut.ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);\n#endif\n#endif\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockGeometryInfo = Dp;\n        var Lp = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);\nvec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);\n#else\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef ALPHAFRESNEL\nfloat reflectance90=fresnelGrazingReflectance(reflectance);\nspecularEnvironmentR90=specularEnvironmentR90*reflectance90;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflectance0 = Lp;\n        var Np = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);\n#ifdef RADIANCEOCCLUSION\nspecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nspecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\n\nvec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n#endif\n#ifdef CLEARCOAT\nspecularEnvironmentReflectance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nspecularEnvironmentReflectance*=clearcoatOut.absorption;\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflectance = Np;\n        var wp = `vec3 diffuseBase=vec3(0.,0.,0.);\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#ifdef CLEARCOAT\nvec3 clearCoatBase=vec3(0.,0.,0.);\n#endif\n#ifdef SHEEN\nvec3 sheenBase=vec3(0.,0.,0.);\n#endif\n\npreLightingInfo preInfo;\nlightingInfo info;\nfloat shadow=1.;\n#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\nvec3 absorption=vec3(0.);\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockDirectLighting = wp;\n        var Fp = `\n\n\n\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n#ifndef METALLICWORKFLOW\n#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\n#endif\n#endif\n#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)\nsurfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;\n#endif\n\n#ifdef REFLECTION\nvec3 finalIrradiance=reflectionOut.environmentIrradiance;\n#if defined(CLEARCOAT)\nfinalIrradiance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nfinalIrradiance*=clearcoatOut.absorption;\n#endif\n#endif\n#if defined(SS_REFRACTION)\nfinalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;\n#endif\n#if defined(SS_TRANSLUCENCY)\nfinalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);\nfinalIrradiance+=subSurfaceOut.refractionIrradiance;\n#endif\nfinalIrradiance*=surfaceAlbedo.rgb;\nfinalIrradiance*=vLightingIntensity.z;\nfinalIrradiance*=aoOut.ambientOcclusionColor;\n#endif\n\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;\nfinalSpecular=max(finalSpecular,0.0);\nvec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalSpecularScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef REFLECTION\nvec3 finalRadiance=reflectionOut.environmentRadiance.rgb;\nfinalRadiance*=subSurfaceOut.specularEnvironmentReflectance;\nvec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalRadianceScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef SHEEN\nvec3 finalSheen=sheenBase*sheenOut.sheenColor;\nfinalSheen=max(finalSheen,0.0);\nvec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef CLEARCOAT\nvec3 finalClearCoat=clearCoatBase;\nfinalClearCoat=max(finalClearCoat,0.0);\nvec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;\n#ifdef CLEARCOAT_TINT\nsubSurfaceOut.finalRefraction*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef ALPHABLEND\nfloat luminanceOverAlpha=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#if defined(CLEARCOAT)\nluminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);\n#endif\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalClearCoatScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)\nalpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockFinalLitComponents = Fp;\n        var Bp = `\nvec3 finalDiffuse=diffuseBase;\nfinalDiffuse*=surfaceAlbedo.rgb;\nfinalDiffuse=max(finalDiffuse,0.0);\nfinalDiffuse*=vLightingIntensity.x;\n\nvec3 finalAmbient=vAmbientColor;\nfinalAmbient*=surfaceAlbedo.rgb;\n\nvec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\nfinalEmissive*=vEmissiveInfos.y;\n#endif\nfinalEmissive*=vLightingIntensity.y;\n\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;\n#endif\nfinalAmbient*=aoOut.ambientOcclusionColor;\nfinalDiffuse*=ambientOcclusionForDirectDiffuse;\n`;\n        ze.a.IncludesShadersStore.pbrBlockFinalUnlitComponents = Bp;\n        var Up = `vec4 finalColor=vec4(\nfinalAmbient +\nfinalDiffuse +\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance +\n#endif\n#ifdef SPECULARTERM\nfinalSpecularScaled +\n#endif\n#ifdef SHEEN\nfinalSheenScaled +\n#endif\n#ifdef CLEARCOAT\nfinalClearCoatScaled +\n#endif\n#ifdef REFLECTION\nfinalRadianceScaled +\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled +\n#endif\n#ifdef CLEARCOAT\nclearcoatOut.finalClearCoatRadianceScaled +\n#endif\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction +\n#endif\n#endif\nfinalEmissive,\nalpha);\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor.rgb;\n#else\nfinalColor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\n\nfinalColor=max(finalColor,0.0);\n`;\n        ze.a.IncludesShadersStore.pbrBlockFinalColorComposition = Up, f(155);\n        var Vp = `#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\nfinalColor.rgb=clamp(finalColor.rgb,0.,30.0);\n#else\n\nfinalColor=applyImageProcessing(finalColor);\n#endif\nfinalColor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\nfinalColor.rgb*=finalColor.a;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockImageProcessing = Vp;\n        var kp = `#if DEBUGMODE>0\nif (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {\n\n#if DEBUGMODE == 1\ngl_FragColor.rgb=vPositionW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 2 && defined(NORMAL)\ngl_FragColor.rgb=vNormalW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 3 && defined(BUMP) || DEBUGMODE == 3 && defined(PARALLAX) || DEBUGMODE == 3 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 4 && defined(BUMP) || DEBUGMODE == 4 && defined(PARALLAX) || DEBUGMODE == 4 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 5\n\ngl_FragColor.rgb=normalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 6 && defined(MAINUV1)\ngl_FragColor.rgb=vec3(vMainUV1,0.0);\n#elif DEBUGMODE == 7 && defined(MAINUV2)\ngl_FragColor.rgb=vec3(vMainUV2,0.0);\n#elif DEBUGMODE == 8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 10 && defined(CLEARCOAT)\n\ngl_FragColor.rgb=clearcoatOut.clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 11 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 12 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 13 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicBitangent;\n#define DEBUGMODE_NORMALIZE\n\n#elif DEBUGMODE == 20 && defined(ALBEDO)\ngl_FragColor.rgb=albedoTexture.rgb;\n#elif DEBUGMODE == 21 && defined(AMBIENT)\ngl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;\n#elif DEBUGMODE == 22 && defined(OPACITY)\ngl_FragColor.rgb=opacityMap.rgb;\n#elif DEBUGMODE == 23 && defined(EMISSIVE)\ngl_FragColor.rgb=emissiveColorTex.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 24 && defined(LIGHTMAP)\ngl_FragColor.rgb=lightmapColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE == 26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);\n#elif DEBUGMODE == 28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ngl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;\n#elif DEBUGMODE == 29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ngl_FragColor.rgb=sheenOut.sheenMapData.rgb;\n#elif DEBUGMODE == 30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ngl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;\n#elif DEBUGMODE == 31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)\ngl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;\n\n#elif DEBUGMODE == 40 && defined(SS_REFRACTION)\n\ngl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 41 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 42 && defined(CLEARCOAT) && defined(REFLECTION)\ngl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 50\ngl_FragColor.rgb=diffuseBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 51 && defined(SPECULARTERM)\ngl_FragColor.rgb=specularBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 52 && defined(CLEARCOAT)\ngl_FragColor.rgb=clearCoatBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 53 && defined(SHEEN)\ngl_FragColor.rgb=sheenBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 54 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 60\ngl_FragColor.rgb=surfaceAlbedo.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 61\ngl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 62 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);\n#elif DEBUGMODE == 71 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.metallicF0;\n#elif DEBUGMODE == 63\ngl_FragColor.rgb=vec3(roughness);\n#elif DEBUGMODE == 64\ngl_FragColor.rgb=vec3(alphaG);\n#elif DEBUGMODE == 65\ngl_FragColor.rgb=vec3(NdotV);\n#elif DEBUGMODE == 66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ngl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 67 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);\n#elif DEBUGMODE == 68 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);\n#elif DEBUGMODE == 69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)\ngl_FragColor.rgb=subSurfaceOut.transmittance;\n#elif DEBUGMODE == 70 && defined(SUBSURFACE) && defined(SS_REFRACTION)\ngl_FragColor.rgb=subSurfaceOut.refractionTransmittance;\n\n#elif DEBUGMODE == 80 && defined(RADIANCEOCCLUSION)\ngl_FragColor.rgb=vec3(seo);\n#elif DEBUGMODE == 81 && defined(HORIZONOCCLUSION)\ngl_FragColor.rgb=vec3(eho);\n#elif DEBUGMODE == 82 && defined(MS_BRDF_ENERGY_CONSERVATION)\ngl_FragColor.rgb=vec3(energyConservationFactor);\n#elif DEBUGMODE == 83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=specularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 85 && defined(SHEEN) && defined(REFLECTION)\ngl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 86 && defined(ALPHABLEND)\ngl_FragColor.rgb=vec3(luminanceOverAlpha);\n#elif DEBUGMODE == 87\ngl_FragColor.rgb=vec3(alpha);\n#endif\ngl_FragColor.rgb*=vDebugMode.y;\n#ifdef DEBUGMODE_NORMALIZE\ngl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;\n#endif\n#ifdef DEBUGMODE_GAMMA\ngl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);\n#endif\ngl_FragColor.a=1.0;\n#ifdef PREPASS\ngl_FragData[0]=toLinearSpace(gl_FragColor);\ngl_FragData[1]=vec4(0.,0.,0.,0.);\n#endif\nreturn;\n}\n#endif`;\n        ze.a.IncludesShadersStore.pbrDebug = kp;\n        var Gp = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\nprecision highp float;\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE\n#endif\n\n#include<__decl__pbrFragment>\n#include<pbrFragmentExtraDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<pbrFragmentSamplersDeclaration>\n#include<imageProcessingDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<importanceSampling>\n#include<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<pbrBlockAlbedoOpacity>\n#include<pbrBlockReflectivity>\n#include<pbrBlockAmbientOcclusion>\n#include<pbrBlockAlphaFresnel>\n#include<pbrBlockAnisotropic>\n#include<pbrBlockReflection>\n#include<pbrBlockSheen>\n#include<pbrBlockClearcoat>\n#include<pbrBlockSubSurface>\n\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n\n#include<pbrBlockNormalGeometric>\n#include<bumpFragment>\n#include<pbrBlockNormalFinal>\n\nalbedoOpacityOutParams albedoOpacityOut;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#endif\nalbedoOpacityBlock(\nvAlbedoColor,\n#ifdef ALBEDO\nalbedoTexture,\nvAlbedoInfos,\n#endif\n#ifdef OPACITY\nopacityMap,\nvOpacityInfos,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nalbedoOpacityOut\n);\nvec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;\nfloat alpha=albedoOpacityOut.alpha;\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\n#include<depthPrePass>\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\nambientOcclusionOutParams aoOut;\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;\n#endif\nambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap,\nvAmbientInfos,\n#endif\naoOut\n);\n#include<pbrBlockLightmapInit>\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nvec3 baseColor=surfaceAlbedo;\nreflectivityOutParams reflectivityOut;\n#if defined(REFLECTIVITY)\nvec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\nvec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;\n#ifndef METALLICWORKFLOW\nsurfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);\nsurfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;\n#endif\n#endif\n#if defined(MICROSURFACEMAP)\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\n#endif\n#ifdef METALLICWORKFLOW\nvec4 metallicReflectanceFactors=vMetallicReflectanceFactors;\n#ifdef METALLIC_REFLECTANCE\nvec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);\nmetallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);\nmetallicReflectanceFactors*=metallicReflectanceFactorsMap;\n#endif\n#endif\nreflectivityBlock(\nvReflectivityColor,\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo,\nmetallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nvReflectivityInfos,\nsurfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor,\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurfaceTexel,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nreflectivityOut\n);\nfloat microSurface=reflectivityOut.microSurface;\nfloat roughness=reflectivityOut.roughness;\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo=reflectivityOut.surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;\n#endif\n\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nalphaFresnelOutParams alphaFresnelOut;\nalphaFresnelBlock(\nnormalW,\nviewDirectionW,\nalpha,\nmicroSurface,\nalphaFresnelOut\n);\nalpha=alphaFresnelOut.alpha;\n#endif\n#endif\n\n#include<pbrBlockGeometryInfo>\n\n#ifdef ANISOTROPIC\nanisotropicOutParams anisotropicOut;\n#ifdef ANISOTROPIC_TEXTURE\nvec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;\n#endif\nanisotropicBlock(\nvAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData,\n#endif\nTBN,\nnormalW,\nviewDirectionW,\nanisotropicOut\n);\n#endif\n\n#ifdef REFLECTION\nreflectionOutParams reflectionOut;\nreflectionBlock(\nvPositionW,\nnormalW,\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\nreflectionSampler,\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nvEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nreflectionOut\n);\n#endif\n\n#include<pbrBlockReflectance0>\n\n#ifdef SHEEN\nsheenOutParams sheenOut;\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData=toLinearSpace(texture2D(sheenSampler,vSheenUV+uvOffset))*vSheenInfos.y;\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;\n#endif\nsheenBlock(\nvSheenColor,\n#ifdef SHEEN_ROUGHNESS\nvSheenRoughness,\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nsheenMapRoughnessData,\n#endif\n#endif\nroughness,\n#ifdef SHEEN_TEXTURE\nsheenMapData,\n#endif\nreflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nbaseColor,\nsurfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nNdotV,\nenvironmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nAARoughnessFactors,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\nreflectionOut.reflectionCoords,\nNdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nseo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\neho,\n#endif\n#endif\nsheenOut\n);\n#ifdef SHEEN_LINKWITHALBEDO\nsurfaceAlbedo=sheenOut.surfaceAlbedo;\n#endif\n#endif\n\nclearcoatOutParams clearcoatOut;\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData=toLinearSpace(texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset));\n#endif\n#ifdef CLEARCOAT_BUMP\nvec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);\n#endif\nclearcoatBlock(\nvPositionW,\ngeometricNormalW,\nviewDirectionW,\nvClearCoatParams,\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nclearCoatMapRoughnessData,\n#endif\nspecularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nclearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nvClearCoatTintParams,\nclearCoatColorAtDistance,\nvClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nvClearCoatBumpInfos,\nclearCoatBumpMapData,\nvClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nvTBN,\n#else\nvClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nnormalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nfaceNormal,\n#endif\n#ifdef REFLECTION\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nambientMonochrome,\n#endif\n#endif\nclearcoatOut\n);\n#else\nclearcoatOut.specularEnvironmentR0=specularEnvironmentR0;\n#endif\n\n#include<pbrBlockReflectance>\n\nsubSurfaceOutParams subSurfaceOut;\n#ifdef SUBSURFACE\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);\n#endif\nsubSurfaceBlock(\nvSubSurfaceIntensity,\nvThicknessParam,\nvTintColor,\nnormalW,\nspecularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nthicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nreflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionOut.irradianceVector,\n#endif\n#if defined(REALTIME_FILTERING)\nreflectionSampler,\nvReflectionFilteringInfo,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nvPositionW,\nviewDirectionW,\nview,\nsurfaceAlbedo,\nvRefractionInfos,\nrefractionMatrix,\nvRefractionMicrosurfaceInfos,\nvLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nNdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nroughness,\n#else\nalphaG,\n#endif\nrefractionSampler,\n#ifndef LODBASEDMICROSFURACE\nrefractionSamplerLow,\nrefractionSamplerHigh,\n#endif\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#ifdef REALTIME_FILTERING\nvRefractionFilteringInfo,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvDiffusionDistance,\n#endif\nsubSurfaceOut\n);\n#ifdef SS_REFRACTION\nsurfaceAlbedo=subSurfaceOut.surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha=subSurfaceOut.alpha;\n#endif\n#endif\n#else\nsubSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;\n#endif\n\n#include<pbrBlockDirectLighting>\n#include<lightFragment>[0..maxSimultaneousLights]\n\n#include<pbrBlockFinalLitComponents>\n#endif\n#include<pbrBlockFinalUnlitComponents>\n#include<pbrBlockFinalColorComposition>\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#include<pbrBlockImageProcessing>\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef PREPASS_IRRADIANCE\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\nvec3 sqAlbedo=sqrt(surfaceAlbedo);\n#ifdef SS_SCATTERING\ngl_FragData[0]=vec4(finalColor.rgb-irradiance,finalColor.a);\nirradiance/=sqAlbedo;\n#else\ngl_FragData[0]=finalColor;\nfloat scatteringDiffusionProfile=255.;\n#endif\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(irradiance,scatteringDiffusionProfile/255.);\n#else\ngl_FragData[0]=vec4(finalColor.rgb,finalColor.a);\n#endif\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[PREPASS_DEPTHNORMAL_INDEX]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(sqAlbedo,1.0);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(REFLECTIVITY)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(baseReflectivity.rgb,1.0);\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=finalColor;\n#endif\n#include<pbrDebug>\n}\n`;\n        ze.a.ShadersStore.pbrPixelShader = Gp;\n        var zp = `uniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef ALBEDO\nuniform mat4 albedoMatrix;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\nuniform mat4 reflectivityMatrix;\n#endif\n#ifdef METALLIC_REFLECTANCE\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform mat4 microSurfaceSamplerMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\n#endif\n\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrVertexDeclaration = zp, f(163), f(164), f(93), f(94), f(100), f(165), f(156), f(158);\n        var jp = `precision highp float;\n#include<__decl__pbrVertex>\n#define CUSTOM_VERTEX_BEGIN\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nvarying vec2 vAlbedoUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nvarying vec2 vReflectivityUV;\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nvarying vec2 vMetallicReflectanceUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatUV;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 0\nvarying vec2 vClearCoatRoughnessUV;\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nvarying vec2 vClearCoatBumpUV;\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatTintUV;\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nvarying vec2 vSheenUV;\n#endif\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 0\nvarying vec2 vSheenRoughnessUV;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nvarying vec2 vAnisotropyUV;\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nvarying vec2 vThicknessUV;\n#endif\n#endif\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#include<harmonicsFunctions>\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#include<prePassVertex>\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#if DEBUGMODE>0\nvClipSpacePosition=gl_Position;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nif (vReflectivityInfos.x == 0.)\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nif (vMicroSurfaceSamplerInfos.x == 0.)\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nif (vMetallicReflectanceInfos.x == 0.)\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nif (vClearCoatInfos.x == 0.)\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 0\nif (vClearCoatInfos.z == 0.)\n{\nvClearCoatRoughnessUV=vec2(clearCoatRoughnessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatRoughnessUV=vec2(clearCoatRoughnessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nif (vClearCoatBumpInfos.x == 0.)\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nif (vClearCoatTintInfos.x == 0.)\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nif (vSheenInfos.x == 0.)\n{\nvSheenUV=vec2(sheenMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenUV=vec2(sheenMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 0\nif (vSheenInfos.z == 0.)\n{\nvSheenRoughnessUV=vec2(sheenRoughnessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenRoughnessUV=vec2(sheenRoughnessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nif (vAnisotropyInfos.x == 0.)\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nif (vThicknessInfos.x == 0.)\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n\n#include<bumpVertex>\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}`;\n        ze.a.ShadersStore.pbrVertexShader = jp;\n        var Wo = f(92), vr = { effect: null, subMesh: null }, As = function(r) {\n          function t() {\n            var e = r.call(this) || this;\n            return e.PBR = !0, e.NUM_SAMPLES = \"0\", e.REALTIME_FILTERING = !1, e.MAINUV1 = !1, e.MAINUV2 = !1, e.UV1 = !1, e.UV2 = !1, e.ALBEDO = !1, e.GAMMAALBEDO = !1, e.ALBEDODIRECTUV = 0, e.VERTEXCOLOR = !1, e.DETAIL = !1, e.DETAILDIRECTUV = 0, e.DETAIL_NORMALBLENDMETHOD = 0, e.AMBIENT = !1, e.AMBIENTDIRECTUV = 0, e.AMBIENTINGRAYSCALE = !1, e.OPACITY = !1, e.VERTEXALPHA = !1, e.OPACITYDIRECTUV = 0, e.OPACITYRGB = !1, e.ALPHATEST = !1, e.DEPTHPREPASS = !1, e.ALPHABLEND = !1, e.ALPHAFROMALBEDO = !1, e.ALPHATESTVALUE = \"0.5\", e.SPECULAROVERALPHA = !1, e.RADIANCEOVERALPHA = !1, e.ALPHAFRESNEL = !1, e.LINEARALPHAFRESNEL = !1, e.PREMULTIPLYALPHA = !1, e.EMISSIVE = !1, e.EMISSIVEDIRECTUV = 0, e.REFLECTIVITY = !1, e.REFLECTIVITYDIRECTUV = 0, e.SPECULARTERM = !1, e.MICROSURFACEFROMREFLECTIVITYMAP = !1, e.MICROSURFACEAUTOMATIC = !1, e.LODBASEDMICROSFURACE = !1, e.MICROSURFACEMAP = !1, e.MICROSURFACEMAPDIRECTUV = 0, e.METALLICWORKFLOW = !1, e.ROUGHNESSSTOREINMETALMAPALPHA = !1, e.ROUGHNESSSTOREINMETALMAPGREEN = !1, e.METALLNESSSTOREINMETALMAPBLUE = !1, e.AOSTOREINMETALMAPRED = !1, e.METALLIC_REFLECTANCE = !1, e.METALLIC_REFLECTANCEDIRECTUV = 0, e.ENVIRONMENTBRDF = !1, e.ENVIRONMENTBRDF_RGBD = !1, e.NORMAL = !1, e.TANGENT = !1, e.BUMP = !1, e.BUMPDIRECTUV = 0, e.OBJECTSPACE_NORMALMAP = !1, e.PARALLAX = !1, e.PARALLAXOCCLUSION = !1, e.NORMALXYSCALE = !0, e.LIGHTMAP = !1, e.LIGHTMAPDIRECTUV = 0, e.USELIGHTMAPASSHADOWMAP = !1, e.GAMMALIGHTMAP = !1, e.RGBDLIGHTMAP = !1, e.REFLECTION = !1, e.REFLECTIONMAP_3D = !1, e.REFLECTIONMAP_SPHERICAL = !1, e.REFLECTIONMAP_PLANAR = !1, e.REFLECTIONMAP_CUBIC = !1, e.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, e.REFLECTIONMAP_PROJECTION = !1, e.REFLECTIONMAP_SKYBOX = !1, e.REFLECTIONMAP_EXPLICIT = !1, e.REFLECTIONMAP_EQUIRECTANGULAR = !1, e.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, e.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, e.INVERTCUBICMAP = !1, e.USESPHERICALFROMREFLECTIONMAP = !1, e.USEIRRADIANCEMAP = !1, e.SPHERICAL_HARMONICS = !1, e.USESPHERICALINVERTEX = !1, e.REFLECTIONMAP_OPPOSITEZ = !1, e.LODINREFLECTIONALPHA = !1, e.GAMMAREFLECTION = !1, e.RGBDREFLECTION = !1, e.LINEARSPECULARREFLECTION = !1, e.RADIANCEOCCLUSION = !1, e.HORIZONOCCLUSION = !1, e.INSTANCES = !1, e.THIN_INSTANCES = !1, e.PREPASS = !1, e.PREPASS_IRRADIANCE = !1, e.PREPASS_IRRADIANCE_INDEX = -1, e.PREPASS_ALBEDO = !1, e.PREPASS_ALBEDO_INDEX = -1, e.PREPASS_DEPTHNORMAL = !1, e.PREPASS_DEPTHNORMAL_INDEX = -1, e.PREPASS_POSITION = !1, e.PREPASS_POSITION_INDEX = -1, e.PREPASS_VELOCITY = !1, e.PREPASS_VELOCITY_INDEX = -1, e.PREPASS_REFLECTIVITY = !1, e.PREPASS_REFLECTIVITY_INDEX = -1, e.SCENE_MRT_COUNT = 0, e.NUM_BONE_INFLUENCERS = 0, e.BonesPerMesh = 0, e.BONETEXTURE = !1, e.BONES_VELOCITY_ENABLED = !1, e.NONUNIFORMSCALING = !1, e.MORPHTARGETS = !1, e.MORPHTARGETS_NORMAL = !1, e.MORPHTARGETS_TANGENT = !1, e.MORPHTARGETS_UV = !1, e.NUM_MORPH_INFLUENCERS = 0, e.IMAGEPROCESSING = !1, e.VIGNETTE = !1, e.VIGNETTEBLENDMODEMULTIPLY = !1, e.VIGNETTEBLENDMODEOPAQUE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = !1, e.SAMPLER3DBGRMAP = !1, e.IMAGEPROCESSINGPOSTPROCESS = !1, e.EXPOSURE = !1, e.MULTIVIEW = !1, e.USEPHYSICALLIGHTFALLOFF = !1, e.USEGLTFLIGHTFALLOFF = !1, e.TWOSIDEDLIGHTING = !1, e.SHADOWFLOAT = !1, e.CLIPPLANE = !1, e.CLIPPLANE2 = !1, e.CLIPPLANE3 = !1, e.CLIPPLANE4 = !1, e.CLIPPLANE5 = !1, e.CLIPPLANE6 = !1, e.POINTSIZE = !1, e.FOG = !1, e.LOGARITHMICDEPTH = !1, e.FORCENORMALFORWARD = !1, e.SPECULARAA = !1, e.CLEARCOAT = !1, e.CLEARCOAT_DEFAULTIOR = !1, e.CLEARCOAT_TEXTURE = !1, e.CLEARCOAT_TEXTURE_ROUGHNESS = !1, e.CLEARCOAT_TEXTUREDIRECTUV = 0, e.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0, e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, e.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1, e.CLEARCOAT_BUMP = !1, e.CLEARCOAT_BUMPDIRECTUV = 0, e.CLEARCOAT_REMAP_F0 = !0, e.CLEARCOAT_TINT = !1, e.CLEARCOAT_TINT_TEXTURE = !1, e.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0, e.ANISOTROPIC = !1, e.ANISOTROPIC_TEXTURE = !1, e.ANISOTROPIC_TEXTUREDIRECTUV = 0, e.BRDF_V_HEIGHT_CORRELATED = !1, e.MS_BRDF_ENERGY_CONSERVATION = !1, e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = !1, e.SHEEN = !1, e.SHEEN_TEXTURE = !1, e.SHEEN_TEXTURE_ROUGHNESS = !1, e.SHEEN_TEXTUREDIRECTUV = 0, e.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0, e.SHEEN_LINKWITHALBEDO = !1, e.SHEEN_ROUGHNESS = !1, e.SHEEN_ALBEDOSCALING = !1, e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, e.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1, e.SUBSURFACE = !1, e.SS_REFRACTION = !1, e.SS_TRANSLUCENCY = !1, e.SS_SCATTERING = !1, e.SS_THICKNESSANDMASK_TEXTURE = !1, e.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0, e.SS_REFRACTIONMAP_3D = !1, e.SS_REFRACTIONMAP_OPPOSITEZ = !1, e.SS_LODINREFRACTIONALPHA = !1, e.SS_GAMMAREFRACTION = !1, e.SS_RGBDREFRACTION = !1, e.SS_LINEARSPECULARREFRACTION = !1, e.SS_LINKREFRACTIONTOTRANSPARENCY = !1, e.SS_ALBEDOFORREFRACTIONTINT = !1, e.SS_MASK_FROM_THICKNESS_TEXTURE = !1, e.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF = !1, e.UNLIT = !1, e.DEBUGMODE = 0, e.rebuild(), e;\n          }\n          return Object(c.d)(t, r), t.prototype.reset = function() {\n            r.prototype.reset.call(this), this.ALPHATESTVALUE = \"0.5\", this.PBR = !0;\n          }, t;\n        }(zo.a), pn = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i._directIntensity = 1, i._emissiveIntensity = 1, i._environmentIntensity = 1, i._specularIntensity = 1, i._lightingInfos = new u.f(i._directIntensity, i._emissiveIntensity, i._environmentIntensity, i._specularIntensity), i._disableBumpMap = !1, i._albedoTexture = null, i._ambientTexture = null, i._ambientTextureStrength = 1, i._ambientTextureImpactOnAnalyticalLights = t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, i._opacityTexture = null, i._reflectionTexture = null, i._emissiveTexture = null, i._reflectivityTexture = null, i._metallicTexture = null, i._metallic = null, i._roughness = null, i._metallicF0Factor = 1, i._metallicReflectanceColor = I.a.White(), i._metallicReflectanceTexture = null, i._microSurfaceTexture = null, i._bumpTexture = null, i._lightmapTexture = null, i._ambientColor = new I.a(0, 0, 0), i._albedoColor = new I.a(1, 1, 1), i._reflectivityColor = new I.a(1, 1, 1), i._reflectionColor = new I.a(1, 1, 1), i._emissiveColor = new I.a(0, 0, 0), i._microSurface = 0.9, i._useLightmapAsShadowmap = !1, i._useHorizonOcclusion = !0, i._useRadianceOcclusion = !0, i._useAlphaFromAlbedoTexture = !1, i._useSpecularOverAlpha = !0, i._useMicroSurfaceFromReflectivityMapAlpha = !1, i._useRoughnessFromMetallicTextureAlpha = !0, i._useRoughnessFromMetallicTextureGreen = !1, i._useMetallnessFromMetallicTextureBlue = !1, i._useAmbientOcclusionFromMetallicTextureRed = !1, i._useAmbientInGrayScale = !1, i._useAutoMicroSurfaceFromReflectivityMap = !1, i._lightFalloff = t.LIGHTFALLOFF_PHYSICAL, i._useRadianceOverAlpha = !0, i._useObjectSpaceNormalMap = !1, i._useParallax = !1, i._useParallaxOcclusion = !1, i._parallaxScaleBias = 0.05, i._disableLighting = !1, i._maxSimultaneousLights = 4, i._invertNormalMapX = !1, i._invertNormalMapY = !1, i._twoSidedLighting = !1, i._alphaCutOff = 0.4, i._forceAlphaTest = !1, i._useAlphaFresnel = !1, i._useLinearAlphaFresnel = !1, i._environmentBRDFTexture = null, i._forceIrradianceInFragment = !1, i._realTimeFiltering = !1, i._realTimeFilteringQuality = h.a.TEXTURE_FILTERING_QUALITY_LOW, i._forceNormalForward = !1, i._enableSpecularAntiAliasing = !1, i._imageProcessingObserver = null, i._renderTargets = new si.a(16), i._globalAmbientColor = new I.a(0, 0, 0), i._useLogarithmicDepth = !1, i._unlit = !1, i._debugMode = 0, i.debugMode = 0, i.debugLimit = -1, i.debugFactor = 1, i.clearCoat = new mr(i._markAllSubMeshesAsTexturesDirty.bind(i)), i.anisotropy = new gr(i._markAllSubMeshesAsTexturesDirty.bind(i)), i.brdf = new ap(i._markAllSubMeshesAsMiscDirty.bind(i)), i.sheen = new Zr(i._markAllSubMeshesAsTexturesDirty.bind(i)), i.detailMap = new Wo.a(i._markAllSubMeshesAsTexturesDirty.bind(i)), i._rebuildInParallel = !1, i._attachImageProcessingConfiguration(null), i.getRenderTargetTextures = function() {\n              return i._renderTargets.reset(), lt.a.ReflectionTextureEnabled && i._reflectionTexture && i._reflectionTexture.isRenderTarget && i._renderTargets.push(i._reflectionTexture), i.subSurface.fillRenderTargetTextures(i._renderTargets), i._renderTargets;\n            }, i._environmentBRDFTexture = Ho.GetEnvironmentBRDFTexture(n), i.subSurface = new Jr(i._markAllSubMeshesAsTexturesDirty.bind(i), i._markScenePrePassDirty.bind(i), n), i.prePassConfiguration = new Ss.a(), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"realTimeFiltering\", { get: function() {\n            return this._realTimeFiltering;\n          }, set: function(e) {\n            this._realTimeFiltering = e, this.markAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"realTimeFilteringQuality\", { get: function() {\n            return this._realTimeFilteringQuality;\n          }, set: function(e) {\n            this._realTimeFilteringQuality = e, this.markAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"canRenderToMRT\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), t.prototype._attachImageProcessingConfiguration = function(e) {\n            var n = this;\n            e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              n._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, Object.defineProperty(t.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !!(lt.a.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || this.subSurface.hasRenderTargetTextures();\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PBRBaseMaterial\";\n          }, Object.defineProperty(t.prototype, \"useLogarithmicDepth\", { get: function() {\n            return this._useLogarithmicDepth;\n          }, set: function(e) {\n            this._useLogarithmicDepth = e && this.getScene().getEngine().getCaps().fragmentDepthSupported;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"_disableAlphaBlending\", { get: function() {\n            return this.subSurface.disableAlphaBlending || this._transparencyMode === t.PBRMATERIAL_OPAQUE || this._transparencyMode === t.PBRMATERIAL_ALPHATEST;\n          }, enumerable: !1, configurable: !0 }), t.prototype.needAlphaBlending = function() {\n            return !this._disableAlphaBlending && (this.alpha < 1 || this._opacityTexture != null || this._shouldUseAlphaFromAlbedoTexture());\n          }, t.prototype.needAlphaTesting = function() {\n            return !!this._forceAlphaTest || !this.subSurface.disableAlphaBlending && this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === t.PBRMATERIAL_ALPHATEST);\n          }, t.prototype._shouldUseAlphaFromAlbedoTexture = function() {\n            return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== t.PBRMATERIAL_OPAQUE;\n          }, t.prototype._hasAlphaChannel = function() {\n            return this._albedoTexture != null && this._albedoTexture.hasAlpha || this._opacityTexture != null;\n          }, t.prototype.getAlphaTestTexture = function() {\n            return this._albedoTexture;\n          }, t.prototype.isReadyForSubMesh = function(e, n, i) {\n            if (n.effect && this.isFrozen && n.effect._wasPreviouslyReady)\n              return !0;\n            n._materialDefines || (n._materialDefines = new As());\n            var o = n._materialDefines;\n            if (this._isReadyForSubMesh(n))\n              return !0;\n            var a = this.getScene(), s = a.getEngine();\n            if (o._areTexturesDirty && a.texturesEnabled) {\n              if (this._albedoTexture && lt.a.DiffuseTextureEnabled && !this._albedoTexture.isReadyOrNotBlocking() || this._ambientTexture && lt.a.AmbientTextureEnabled && !this._ambientTexture.isReadyOrNotBlocking() || this._opacityTexture && lt.a.OpacityTextureEnabled && !this._opacityTexture.isReadyOrNotBlocking())\n                return !1;\n              var d = this._getReflectionTexture();\n              if (d && lt.a.ReflectionTextureEnabled && (!d.isReadyOrNotBlocking() || d.irradianceTexture && !d.irradianceTexture.isReadyOrNotBlocking()) || this._lightmapTexture && lt.a.LightmapTextureEnabled && !this._lightmapTexture.isReadyOrNotBlocking() || this._emissiveTexture && lt.a.EmissiveTextureEnabled && !this._emissiveTexture.isReadyOrNotBlocking())\n                return !1;\n              if (lt.a.SpecularTextureEnabled) {\n                if (this._metallicTexture) {\n                  if (!this._metallicTexture.isReadyOrNotBlocking())\n                    return !1;\n                } else if (this._reflectivityTexture && !this._reflectivityTexture.isReadyOrNotBlocking())\n                  return !1;\n                if (this._metallicReflectanceTexture && !this._metallicReflectanceTexture.isReadyOrNotBlocking() || this._microSurfaceTexture && !this._microSurfaceTexture.isReadyOrNotBlocking())\n                  return !1;\n              }\n              if (s.getCaps().standardDerivatives && this._bumpTexture && lt.a.BumpTextureEnabled && !this._disableBumpMap && !this._bumpTexture.isReady() || this._environmentBRDFTexture && lt.a.ReflectionTextureEnabled && !this._environmentBRDFTexture.isReady())\n                return !1;\n            }\n            if (!(this.subSurface.isReadyForSubMesh(o, a) && this.clearCoat.isReadyForSubMesh(o, a, s, this._disableBumpMap) && this.sheen.isReadyForSubMesh(o, a) && this.anisotropy.isReadyForSubMesh(o, a) && this.detailMap.isReadyForSubMesh(o, a)) || o._areImageProcessingDirty && this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady())\n              return !1;\n            s.getCaps().standardDerivatives || e.isVerticesDataPresent(Oe.b.NormalKind) || (e.createNormals(!0), l.a.Warn(\"PBRMaterial: Normals have been created for the mesh: \" + e.name));\n            var p = n.effect, y = o._areLightsDisposed, P = this._prepareEffect(e, o, this.onCompiled, this.onError, i, null, n.getRenderingMesh().hasThinInstances);\n            if (P)\n              if (this._onEffectCreatedObservable && (vr.effect = P, vr.subMesh = n, this._onEffectCreatedObservable.notifyObservers(vr)), this.allowShaderHotSwapping && p && !P.isReady()) {\n                if (P = p, this._rebuildInParallel = !0, o.markAsUnprocessed(), y)\n                  return o._areLightsDisposed = !0, !1;\n              } else\n                this._rebuildInParallel = !1, a.resetCachedMaterial(), n.setEffect(P, o), this.buildUniformLayout();\n            return !(!n.effect || !n.effect.isReady()) && (o._renderId = a.getRenderId(), n.effect._wasPreviouslyReady = !0, !0);\n          }, t.prototype.isMetallicWorkflow = function() {\n            return !(this._metallic == null && this._roughness == null && !this._metallicTexture);\n          }, t.prototype._prepareEffect = function(e, n, i, o, a, s, d) {\n            if (i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), this._prepareDefines(e, n, a, s, d), !n.isDirty)\n              return null;\n            n.markAsProcessed();\n            var p = this.getScene().getEngine(), y = new _r.a(), P = 0;\n            n.USESPHERICALINVERTEX && y.addFallback(P++, \"USESPHERICALINVERTEX\"), n.FOG && y.addFallback(P, \"FOG\"), n.SPECULARAA && y.addFallback(P, \"SPECULARAA\"), n.POINTSIZE && y.addFallback(P, \"POINTSIZE\"), n.LOGARITHMICDEPTH && y.addFallback(P, \"LOGARITHMICDEPTH\"), n.PARALLAX && y.addFallback(P, \"PARALLAX\"), n.PARALLAXOCCLUSION && y.addFallback(P++, \"PARALLAXOCCLUSION\"), P = gr.AddFallbacks(n, y, P), P = gr.AddFallbacks(n, y, P), P = Jr.AddFallbacks(n, y, P), P = Zr.AddFallbacks(n, y, P), n.ENVIRONMENTBRDF && y.addFallback(P++, \"ENVIRONMENTBRDF\"), n.TANGENT && y.addFallback(P++, \"TANGENT\"), n.BUMP && y.addFallback(P++, \"BUMP\"), P = $e.a.HandleFallbacksForShadows(n, y, this._maxSimultaneousLights, P++), n.SPECULARTERM && y.addFallback(P++, \"SPECULARTERM\"), n.USESPHERICALFROMREFLECTIONMAP && y.addFallback(P++, \"USESPHERICALFROMREFLECTIONMAP\"), n.USEIRRADIANCEMAP && y.addFallback(P++, \"USEIRRADIANCEMAP\"), n.LIGHTMAP && y.addFallback(P++, \"LIGHTMAP\"), n.NORMAL && y.addFallback(P++, \"NORMAL\"), n.AMBIENT && y.addFallback(P++, \"AMBIENT\"), n.EMISSIVE && y.addFallback(P++, \"EMISSIVE\"), n.VERTEXCOLOR && y.addFallback(P++, \"VERTEXCOLOR\"), n.MORPHTARGETS && y.addFallback(P++, \"MORPHTARGETS\"), n.MULTIVIEW && y.addFallback(0, \"MULTIVIEW\");\n            var R = [Oe.b.PositionKind];\n            n.NORMAL && R.push(Oe.b.NormalKind), n.TANGENT && R.push(Oe.b.TangentKind), n.UV1 && R.push(Oe.b.UVKind), n.UV2 && R.push(Oe.b.UV2Kind), n.VERTEXCOLOR && R.push(Oe.b.ColorKind), $e.a.PrepareAttributesForBones(R, e, n, y), $e.a.PrepareAttributesForInstances(R, n), $e.a.PrepareAttributesForMorphTargets(R, e, n);\n            var B = \"pbr\", F = [\"world\", \"view\", \"viewProjection\", \"vEyePosition\", \"vLightsType\", \"vAmbientColor\", \"vAlbedoColor\", \"vReflectivityColor\", \"vMetallicReflectanceFactors\", \"vEmissiveColor\", \"visibility\", \"vReflectionColor\", \"vFogInfos\", \"vFogColor\", \"pointSize\", \"vAlbedoInfos\", \"vAmbientInfos\", \"vOpacityInfos\", \"vReflectionInfos\", \"vReflectionPosition\", \"vReflectionSize\", \"vEmissiveInfos\", \"vReflectivityInfos\", \"vReflectionFilteringInfo\", \"vMetallicReflectanceInfos\", \"vMicroSurfaceSamplerInfos\", \"vBumpInfos\", \"vLightmapInfos\", \"mBones\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"albedoMatrix\", \"ambientMatrix\", \"opacityMatrix\", \"reflectionMatrix\", \"emissiveMatrix\", \"reflectivityMatrix\", \"normalMatrix\", \"microSurfaceSamplerMatrix\", \"bumpMatrix\", \"lightmapMatrix\", \"metallicReflectanceMatrix\", \"vLightingIntensity\", \"logarithmicDepthConstant\", \"vSphericalX\", \"vSphericalY\", \"vSphericalZ\", \"vSphericalXX_ZZ\", \"vSphericalYY_ZZ\", \"vSphericalZZ\", \"vSphericalXY\", \"vSphericalYZ\", \"vSphericalZX\", \"vSphericalL00\", \"vSphericalL1_1\", \"vSphericalL10\", \"vSphericalL11\", \"vSphericalL2_2\", \"vSphericalL2_1\", \"vSphericalL20\", \"vSphericalL21\", \"vSphericalL22\", \"vReflectionMicrosurfaceInfos\", \"vTangentSpaceParams\", \"boneTextureWidth\", \"vDebugMode\"], z = [\"albedoSampler\", \"reflectivitySampler\", \"ambientSampler\", \"emissiveSampler\", \"bumpSampler\", \"lightmapSampler\", \"opacitySampler\", \"reflectionSampler\", \"reflectionSamplerLow\", \"reflectionSamplerHigh\", \"irradianceSampler\", \"microSurfaceSampler\", \"environmentBrdfSampler\", \"boneSampler\", \"metallicReflectanceSampler\"], J = [\"Material\", \"Scene\"];\n            Wo.a.AddUniforms(F), Wo.a.AddSamplers(z), Jr.AddUniforms(F), Jr.AddSamplers(z), mr.AddUniforms(F), mr.AddSamplers(z), gr.AddUniforms(F), gr.AddSamplers(z), Zr.AddUniforms(F), Zr.AddSamplers(z), Ss.a.AddUniforms(F), Ss.a.AddSamplers(F), vn.a && (vn.a.PrepareUniforms(F, n), vn.a.PrepareSamplers(z, n)), $e.a.PrepareUniformsAndSamplersList({ uniformsNames: F, uniformBuffersNames: J, samplers: z, defines: n, maxSimultaneousLights: this._maxSimultaneousLights });\n            var ie = {};\n            this.customShaderNameResolve && (B = this.customShaderNameResolve(B, F, J, z, n, R, ie));\n            var se = n.toString();\n            return p.createEffect(B, { attributes: R, uniformsNames: F, uniformBuffersNames: J, samplers: z, defines: se, fallbacks: y, onCompiled: i, onError: o, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: n.NUM_MORPH_INFLUENCERS }, processFinalCode: ie.processFinalCode, multiTarget: n.PREPASS }, p);\n          }, t.prototype._prepareDefines = function(e, n, i, o, a) {\n            i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = !1);\n            var s = this.getScene(), d = s.getEngine();\n            if ($e.a.PrepareDefinesForLights(s, e, n, !0, this._maxSimultaneousLights, this._disableLighting), n._needNormals = !0, $e.a.PrepareDefinesForMultiview(s, n), $e.a.PrepareDefinesForPrePass(s, n, this.canRenderToMRT), n.METALLICWORKFLOW = this.isMetallicWorkflow(), n._areTexturesDirty) {\n              if (n._needUVs = !1, s.texturesEnabled) {\n                s.getEngine().getCaps().textureLOD && (n.LODBASEDMICROSFURACE = !0), this._albedoTexture && lt.a.DiffuseTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._albedoTexture, n, \"ALBEDO\"), n.GAMMAALBEDO = this._albedoTexture.gammaSpace) : n.ALBEDO = !1, this._ambientTexture && lt.a.AmbientTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._ambientTexture, n, \"AMBIENT\"), n.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale) : n.AMBIENT = !1, this._opacityTexture && lt.a.OpacityTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._opacityTexture, n, \"OPACITY\"), n.OPACITYRGB = this._opacityTexture.getAlphaFromRGB) : n.OPACITY = !1;\n                var p = this._getReflectionTexture();\n                if (p && lt.a.ReflectionTextureEnabled) {\n                  switch (n.REFLECTION = !0, n.GAMMAREFLECTION = p.gammaSpace, n.RGBDREFLECTION = p.isRGBD, n.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !p.invertZ : p.invertZ, n.LODINREFLECTIONALPHA = p.lodLevelInAlpha, n.LINEARSPECULARREFLECTION = p.linearSpecularLOD, this.realTimeFiltering && this.realTimeFilteringQuality > 0 ? (n.NUM_SAMPLES = \"\" + this.realTimeFilteringQuality, d.webGLVersion > 1 && (n.NUM_SAMPLES = n.NUM_SAMPLES + \"u\"), n.REALTIME_FILTERING = !0) : n.REALTIME_FILTERING = !1, p.coordinatesMode === Ne.a.INVCUBIC_MODE && (n.INVERTCUBICMAP = !0), n.REFLECTIONMAP_3D = p.isCube, n.REFLECTIONMAP_CUBIC = !1, n.REFLECTIONMAP_EXPLICIT = !1, n.REFLECTIONMAP_PLANAR = !1, n.REFLECTIONMAP_PROJECTION = !1, n.REFLECTIONMAP_SKYBOX = !1, n.REFLECTIONMAP_SPHERICAL = !1, n.REFLECTIONMAP_EQUIRECTANGULAR = !1, n.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, n.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, p.coordinatesMode) {\n                    case Ne.a.EXPLICIT_MODE:\n                      n.REFLECTIONMAP_EXPLICIT = !0;\n                      break;\n                    case Ne.a.PLANAR_MODE:\n                      n.REFLECTIONMAP_PLANAR = !0;\n                      break;\n                    case Ne.a.PROJECTION_MODE:\n                      n.REFLECTIONMAP_PROJECTION = !0;\n                      break;\n                    case Ne.a.SKYBOX_MODE:\n                      n.REFLECTIONMAP_SKYBOX = !0;\n                      break;\n                    case Ne.a.SPHERICAL_MODE:\n                      n.REFLECTIONMAP_SPHERICAL = !0;\n                      break;\n                    case Ne.a.EQUIRECTANGULAR_MODE:\n                      n.REFLECTIONMAP_EQUIRECTANGULAR = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MODE:\n                      n.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:\n                      n.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.CUBIC_MODE:\n                    case Ne.a.INVCUBIC_MODE:\n                    default:\n                      n.REFLECTIONMAP_CUBIC = !0, n.USE_LOCAL_REFLECTIONMAP_CUBIC = !!p.boundingBoxSize;\n                  }\n                  p.coordinatesMode !== Ne.a.SKYBOX_MODE && (p.irradianceTexture ? (n.USEIRRADIANCEMAP = !0, n.USESPHERICALFROMREFLECTIONMAP = !1) : p.isCube && (n.USESPHERICALFROMREFLECTIONMAP = !0, n.USEIRRADIANCEMAP = !1, this._forceIrradianceInFragment || this.realTimeFiltering || s.getEngine().getCaps().maxVaryingVectors <= 8 ? n.USESPHERICALINVERTEX = !1 : n.USESPHERICALINVERTEX = !0));\n                } else\n                  n.REFLECTION = !1, n.REFLECTIONMAP_3D = !1, n.REFLECTIONMAP_SPHERICAL = !1, n.REFLECTIONMAP_PLANAR = !1, n.REFLECTIONMAP_CUBIC = !1, n.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, n.REFLECTIONMAP_PROJECTION = !1, n.REFLECTIONMAP_SKYBOX = !1, n.REFLECTIONMAP_EXPLICIT = !1, n.REFLECTIONMAP_EQUIRECTANGULAR = !1, n.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, n.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, n.INVERTCUBICMAP = !1, n.USESPHERICALFROMREFLECTIONMAP = !1, n.USEIRRADIANCEMAP = !1, n.USESPHERICALINVERTEX = !1, n.REFLECTIONMAP_OPPOSITEZ = !1, n.LODINREFLECTIONALPHA = !1, n.GAMMAREFLECTION = !1, n.RGBDREFLECTION = !1, n.LINEARSPECULARREFLECTION = !1;\n                this._lightmapTexture && lt.a.LightmapTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._lightmapTexture, n, \"LIGHTMAP\"), n.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, n.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace, n.RGBDLIGHTMAP = this._lightmapTexture.isRGBD) : n.LIGHTMAP = !1, this._emissiveTexture && lt.a.EmissiveTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._emissiveTexture, n, \"EMISSIVE\") : n.EMISSIVE = !1, lt.a.SpecularTextureEnabled ? (this._metallicTexture ? ($e.a.PrepareDefinesForMergedUV(this._metallicTexture, n, \"REFLECTIVITY\"), n.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha, n.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen, n.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue, n.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed) : this._reflectivityTexture ? ($e.a.PrepareDefinesForMergedUV(this._reflectivityTexture, n, \"REFLECTIVITY\"), n.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha, n.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap) : n.REFLECTIVITY = !1, this._metallicReflectanceTexture ? $e.a.PrepareDefinesForMergedUV(this._metallicReflectanceTexture, n, \"METALLIC_REFLECTANCE\") : n.METALLIC_REFLECTANCE = !1, this._microSurfaceTexture ? $e.a.PrepareDefinesForMergedUV(this._microSurfaceTexture, n, \"MICROSURFACEMAP\") : n.MICROSURFACEMAP = !1) : (n.REFLECTIVITY = !1, n.MICROSURFACEMAP = !1), s.getEngine().getCaps().standardDerivatives && this._bumpTexture && lt.a.BumpTextureEnabled && !this._disableBumpMap ? ($e.a.PrepareDefinesForMergedUV(this._bumpTexture, n, \"BUMP\"), this._useParallax && this._albedoTexture && lt.a.DiffuseTextureEnabled ? (n.PARALLAX = !0, n.PARALLAXOCCLUSION = !!this._useParallaxOcclusion) : n.PARALLAX = !1, n.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap) : n.BUMP = !1, this._environmentBRDFTexture && lt.a.ReflectionTextureEnabled ? (n.ENVIRONMENTBRDF = !0, n.ENVIRONMENTBRDF_RGBD = this._environmentBRDFTexture.isRGBD) : (n.ENVIRONMENTBRDF = !1, n.ENVIRONMENTBRDF_RGBD = !1), this._shouldUseAlphaFromAlbedoTexture() ? n.ALPHAFROMALBEDO = !0 : n.ALPHAFROMALBEDO = !1;\n              }\n              n.SPECULAROVERALPHA = this._useSpecularOverAlpha, this._lightFalloff === t.LIGHTFALLOFF_STANDARD ? (n.USEPHYSICALLIGHTFALLOFF = !1, n.USEGLTFLIGHTFALLOFF = !1) : this._lightFalloff === t.LIGHTFALLOFF_GLTF ? (n.USEPHYSICALLIGHTFALLOFF = !1, n.USEGLTFLIGHTFALLOFF = !0) : (n.USEPHYSICALLIGHTFALLOFF = !0, n.USEGLTFLIGHTFALLOFF = !1), n.RADIANCEOVERALPHA = this._useRadianceOverAlpha, !this.backFaceCulling && this._twoSidedLighting ? n.TWOSIDEDLIGHTING = !0 : n.TWOSIDEDLIGHTING = !1, n.SPECULARAA = s.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing;\n            }\n            (n._areTexturesDirty || n._areMiscDirty) && (n.ALPHATESTVALUE = this._alphaCutOff + (this._alphaCutOff % 1 == 0 ? \".\" : \"\"), n.PREMULTIPLYALPHA = this.alphaMode === h.a.ALPHA_PREMULTIPLIED || this.alphaMode === h.a.ALPHA_PREMULTIPLIED_PORTERDUFF, n.ALPHABLEND = this.needAlphaBlendingForMesh(e), n.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel, n.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel), n._areImageProcessingDirty && this._imageProcessingConfiguration && this._imageProcessingConfiguration.prepareDefines(n), n.FORCENORMALFORWARD = this._forceNormalForward, n.RADIANCEOCCLUSION = this._useRadianceOcclusion, n.HORIZONOCCLUSION = this._useHorizonOcclusion, n._areMiscDirty && ($e.a.PrepareDefinesForMisc(e, s, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e) || this._forceAlphaTest, n), n.UNLIT = this._unlit || (this.pointsCloud || this.wireframe) && !e.isVerticesDataPresent(Oe.b.NormalKind), n.DEBUGMODE = this._debugMode), this.detailMap.prepareDefines(n, s), this.subSurface.prepareDefines(n, s), this.clearCoat.prepareDefines(n, s), this.anisotropy.prepareDefines(n, e, s), this.brdf.prepareDefines(n), this.sheen.prepareDefines(n, s), $e.a.PrepareDefinesForFrameBoundValues(s, d, n, !!i, o, a), $e.a.PrepareDefinesForAttributes(e, n, !0, !0, !0, this._transparencyMode !== t.PBRMATERIAL_OPAQUE);\n          }, t.prototype.forceCompilation = function(e, n, i) {\n            var o = this, a = Object(c.a)({ clipPlane: !1, useInstances: !1 }, i), s = new As(), d = this._prepareEffect(e, s, void 0, void 0, a.useInstances, a.clipPlane, e.hasThinInstances);\n            this._onEffectCreatedObservable && (vr.effect = d, vr.subMesh = null, this._onEffectCreatedObservable.notifyObservers(vr)), d.isReady() ? n && n(this) : d.onCompileObservable.add(function() {\n              n && n(o);\n            });\n          }, t.prototype.buildUniformLayout = function() {\n            var e = this._uniformBuffer;\n            e.addUniform(\"vAlbedoInfos\", 2), e.addUniform(\"vAmbientInfos\", 4), e.addUniform(\"vOpacityInfos\", 2), e.addUniform(\"vEmissiveInfos\", 2), e.addUniform(\"vLightmapInfos\", 2), e.addUniform(\"vReflectivityInfos\", 3), e.addUniform(\"vMicroSurfaceSamplerInfos\", 2), e.addUniform(\"vReflectionInfos\", 2), e.addUniform(\"vReflectionFilteringInfo\", 2), e.addUniform(\"vReflectionPosition\", 3), e.addUniform(\"vReflectionSize\", 3), e.addUniform(\"vBumpInfos\", 3), e.addUniform(\"albedoMatrix\", 16), e.addUniform(\"ambientMatrix\", 16), e.addUniform(\"opacityMatrix\", 16), e.addUniform(\"emissiveMatrix\", 16), e.addUniform(\"lightmapMatrix\", 16), e.addUniform(\"reflectivityMatrix\", 16), e.addUniform(\"microSurfaceSamplerMatrix\", 16), e.addUniform(\"bumpMatrix\", 16), e.addUniform(\"vTangentSpaceParams\", 2), e.addUniform(\"reflectionMatrix\", 16), e.addUniform(\"vReflectionColor\", 3), e.addUniform(\"vAlbedoColor\", 4), e.addUniform(\"vLightingIntensity\", 4), e.addUniform(\"vReflectionMicrosurfaceInfos\", 3), e.addUniform(\"pointSize\", 1), e.addUniform(\"vReflectivityColor\", 4), e.addUniform(\"vEmissiveColor\", 3), e.addUniform(\"visibility\", 1), e.addUniform(\"vMetallicReflectanceFactors\", 4), e.addUniform(\"vMetallicReflectanceInfos\", 2), e.addUniform(\"metallicReflectanceMatrix\", 16), mr.PrepareUniformBuffer(e), gr.PrepareUniformBuffer(e), Zr.PrepareUniformBuffer(e), Jr.PrepareUniformBuffer(e), Wo.a.PrepareUniformBuffer(e), e.create();\n          }, t.prototype.unbind = function() {\n            if (this._activeEffect) {\n              var e = !1;\n              this._reflectionTexture && this._reflectionTexture.isRenderTarget && (this._activeEffect.setTexture(\"reflection2DSampler\", null), e = !0), this.subSurface.unbind(this._activeEffect) && (e = !0), e && this._markAllSubMeshesAsTexturesDirty();\n            }\n            r.prototype.unbind.call(this);\n          }, t.prototype.bindForSubMesh = function(e, n, i) {\n            var o = this.getScene(), a = i._materialDefines;\n            if (a) {\n              var s = i.effect;\n              if (s) {\n                this._activeEffect = s, a.INSTANCES && !a.THIN_INSTANCES || this.bindOnlyWorldMatrix(e), this.prePassConfiguration.bindForSubMesh(this._activeEffect, o, n, e, this.isFrozen), a.OBJECTSPACE_NORMALMAP && (e.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));\n                var d = this._mustRebind(o, s, n.visibility);\n                $e.a.BindBonesParameters(n, this._activeEffect, this.prePassConfiguration);\n                var p = null, y = this._uniformBuffer;\n                if (d) {\n                  var P = o.getEngine();\n                  if (y.bindToEffect(s, \"Material\"), this.bindViewProjection(s), p = this._getReflectionTexture(), !y.useUbo || !this.isFrozen || !y.isSync) {\n                    if (o.texturesEnabled) {\n                      if (this._albedoTexture && lt.a.DiffuseTextureEnabled && (y.updateFloat2(\"vAlbedoInfos\", this._albedoTexture.coordinatesIndex, this._albedoTexture.level), $e.a.BindTextureMatrix(this._albedoTexture, y, \"albedo\")), this._ambientTexture && lt.a.AmbientTextureEnabled && (y.updateFloat4(\"vAmbientInfos\", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights), $e.a.BindTextureMatrix(this._ambientTexture, y, \"ambient\")), this._opacityTexture && lt.a.OpacityTextureEnabled && (y.updateFloat2(\"vOpacityInfos\", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), $e.a.BindTextureMatrix(this._opacityTexture, y, \"opacity\")), p && lt.a.ReflectionTextureEnabled) {\n                        if (y.updateMatrix(\"reflectionMatrix\", p.getReflectionTextureMatrix()), y.updateFloat2(\"vReflectionInfos\", p.level, 0), p.boundingBoxSize) {\n                          var R = p;\n                          y.updateVector3(\"vReflectionPosition\", R.boundingBoxPosition), y.updateVector3(\"vReflectionSize\", R.boundingBoxSize);\n                        }\n                        if (this.realTimeFiltering) {\n                          var B = p.getSize().width;\n                          y.updateFloat2(\"vReflectionFilteringInfo\", B, $.a.Log2(B));\n                        }\n                        if (!a.USEIRRADIANCEMAP) {\n                          var F = p.sphericalPolynomial;\n                          if (a.USESPHERICALFROMREFLECTIONMAP && F)\n                            if (a.SPHERICAL_HARMONICS) {\n                              var z = F.preScaledHarmonics;\n                              this._activeEffect.setVector3(\"vSphericalL00\", z.l00), this._activeEffect.setVector3(\"vSphericalL1_1\", z.l1_1), this._activeEffect.setVector3(\"vSphericalL10\", z.l10), this._activeEffect.setVector3(\"vSphericalL11\", z.l11), this._activeEffect.setVector3(\"vSphericalL2_2\", z.l2_2), this._activeEffect.setVector3(\"vSphericalL2_1\", z.l2_1), this._activeEffect.setVector3(\"vSphericalL20\", z.l20), this._activeEffect.setVector3(\"vSphericalL21\", z.l21), this._activeEffect.setVector3(\"vSphericalL22\", z.l22);\n                            } else\n                              this._activeEffect.setFloat3(\"vSphericalX\", F.x.x, F.x.y, F.x.z), this._activeEffect.setFloat3(\"vSphericalY\", F.y.x, F.y.y, F.y.z), this._activeEffect.setFloat3(\"vSphericalZ\", F.z.x, F.z.y, F.z.z), this._activeEffect.setFloat3(\"vSphericalXX_ZZ\", F.xx.x - F.zz.x, F.xx.y - F.zz.y, F.xx.z - F.zz.z), this._activeEffect.setFloat3(\"vSphericalYY_ZZ\", F.yy.x - F.zz.x, F.yy.y - F.zz.y, F.yy.z - F.zz.z), this._activeEffect.setFloat3(\"vSphericalZZ\", F.zz.x, F.zz.y, F.zz.z), this._activeEffect.setFloat3(\"vSphericalXY\", F.xy.x, F.xy.y, F.xy.z), this._activeEffect.setFloat3(\"vSphericalYZ\", F.yz.x, F.yz.y, F.yz.z), this._activeEffect.setFloat3(\"vSphericalZX\", F.zx.x, F.zx.y, F.zx.z);\n                        }\n                        y.updateFloat3(\"vReflectionMicrosurfaceInfos\", p.getSize().width, p.lodGenerationScale, p.lodGenerationOffset);\n                      }\n                      this._emissiveTexture && lt.a.EmissiveTextureEnabled && (y.updateFloat2(\"vEmissiveInfos\", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), $e.a.BindTextureMatrix(this._emissiveTexture, y, \"emissive\")), this._lightmapTexture && lt.a.LightmapTextureEnabled && (y.updateFloat2(\"vLightmapInfos\", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), $e.a.BindTextureMatrix(this._lightmapTexture, y, \"lightmap\")), lt.a.SpecularTextureEnabled && (this._metallicTexture ? (y.updateFloat3(\"vReflectivityInfos\", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength), $e.a.BindTextureMatrix(this._metallicTexture, y, \"reflectivity\")) : this._reflectivityTexture && (y.updateFloat3(\"vReflectivityInfos\", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1), $e.a.BindTextureMatrix(this._reflectivityTexture, y, \"reflectivity\")), this._metallicReflectanceTexture && (y.updateFloat2(\"vMetallicReflectanceInfos\", this._metallicReflectanceTexture.coordinatesIndex, this._metallicReflectanceTexture.level), $e.a.BindTextureMatrix(this._metallicReflectanceTexture, y, \"metallicReflectance\")), this._microSurfaceTexture && (y.updateFloat2(\"vMicroSurfaceSamplerInfos\", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level), $e.a.BindTextureMatrix(this._microSurfaceTexture, y, \"microSurfaceSampler\"))), this._bumpTexture && P.getCaps().standardDerivatives && lt.a.BumpTextureEnabled && !this._disableBumpMap && (y.updateFloat3(\"vBumpInfos\", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias), $e.a.BindTextureMatrix(this._bumpTexture, y, \"bump\"), o._mirroredCameraPosition ? y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1));\n                    }\n                    if (this.pointsCloud && y.updateFloat(\"pointSize\", this.pointSize), a.METALLICWORKFLOW) {\n                      I.c.Color3[0].r = this._metallic === void 0 || this._metallic === null ? 1 : this._metallic, I.c.Color3[0].g = this._roughness === void 0 || this._roughness === null ? 1 : this._roughness, y.updateColor4(\"vReflectivityColor\", I.c.Color3[0], 1);\n                      var J = this.subSurface.indexOfRefraction, ie = Math.pow((J - 1) / (J + 1), 2);\n                      this._metallicReflectanceColor.scaleToRef(ie * this._metallicF0Factor, I.c.Color3[0]);\n                      var se = this._metallicF0Factor;\n                      y.updateColor4(\"vMetallicReflectanceFactors\", I.c.Color3[0], se);\n                    } else\n                      y.updateColor4(\"vReflectivityColor\", this._reflectivityColor, this._microSurface);\n                    y.updateColor3(\"vEmissiveColor\", lt.a.EmissiveTextureEnabled ? this._emissiveColor : I.a.BlackReadOnly), y.updateColor3(\"vReflectionColor\", this._reflectionColor), !a.SS_REFRACTION && this.subSurface.linkRefractionWithTransparency ? y.updateColor4(\"vAlbedoColor\", this._albedoColor, 1) : y.updateColor4(\"vAlbedoColor\", this._albedoColor, this.alpha), this._lightingInfos.x = this._directIntensity, this._lightingInfos.y = this._emissiveIntensity, this._lightingInfos.z = this._environmentIntensity * o.environmentIntensity, this._lightingInfos.w = this._specularIntensity, y.updateVector4(\"vLightingIntensity\", this._lightingInfos);\n                  }\n                  y.updateFloat(\"visibility\", n.visibility), o.texturesEnabled && (this._albedoTexture && lt.a.DiffuseTextureEnabled && y.setTexture(\"albedoSampler\", this._albedoTexture), this._ambientTexture && lt.a.AmbientTextureEnabled && y.setTexture(\"ambientSampler\", this._ambientTexture), this._opacityTexture && lt.a.OpacityTextureEnabled && y.setTexture(\"opacitySampler\", this._opacityTexture), p && lt.a.ReflectionTextureEnabled && (a.LODBASEDMICROSFURACE ? y.setTexture(\"reflectionSampler\", p) : (y.setTexture(\"reflectionSampler\", p._lodTextureMid || p), y.setTexture(\"reflectionSamplerLow\", p._lodTextureLow || p), y.setTexture(\"reflectionSamplerHigh\", p._lodTextureHigh || p)), a.USEIRRADIANCEMAP && y.setTexture(\"irradianceSampler\", p.irradianceTexture)), a.ENVIRONMENTBRDF && y.setTexture(\"environmentBrdfSampler\", this._environmentBRDFTexture), this._emissiveTexture && lt.a.EmissiveTextureEnabled && y.setTexture(\"emissiveSampler\", this._emissiveTexture), this._lightmapTexture && lt.a.LightmapTextureEnabled && y.setTexture(\"lightmapSampler\", this._lightmapTexture), lt.a.SpecularTextureEnabled && (this._metallicTexture ? y.setTexture(\"reflectivitySampler\", this._metallicTexture) : this._reflectivityTexture && y.setTexture(\"reflectivitySampler\", this._reflectivityTexture), this._metallicReflectanceTexture && y.setTexture(\"metallicReflectanceSampler\", this._metallicReflectanceTexture), this._microSurfaceTexture && y.setTexture(\"microSurfaceSampler\", this._microSurfaceTexture)), this._bumpTexture && P.getCaps().standardDerivatives && lt.a.BumpTextureEnabled && !this._disableBumpMap && y.setTexture(\"bumpSampler\", this._bumpTexture)), this.detailMap.bindForSubMesh(y, o, this.isFrozen), this.subSurface.bindForSubMesh(y, o, P, this.isFrozen, a.LODBASEDMICROSFURACE, this.realTimeFiltering), this.clearCoat.bindForSubMesh(y, o, P, this._disableBumpMap, this.isFrozen, this._invertNormalMapX, this._invertNormalMapY, i), this.anisotropy.bindForSubMesh(y, o, this.isFrozen), this.sheen.bindForSubMesh(y, o, this.isFrozen, i), $e.a.BindClipPlane(this._activeEffect, o), o.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor);\n                  var ce = o._forcedViewPosition ? o._forcedViewPosition : o._mirroredCameraPosition ? o._mirroredCameraPosition : o.activeCamera.globalPosition, ue = o.useRightHandedSystem === (o._mirroredCameraPosition != null);\n                  s.setFloat4(\"vEyePosition\", ce.x, ce.y, ce.z, ue ? -1 : 1), s.setColor3(\"vAmbientColor\", this._globalAmbientColor), s.setFloat2(\"vDebugMode\", this.debugLimit, this.debugFactor);\n                }\n                !d && this.isFrozen || (o.lightsEnabled && !this._disableLighting && $e.a.BindLights(o, n, this._activeEffect, a, this._maxSimultaneousLights, this._rebuildInParallel), (o.fogEnabled && n.applyFog && o.fogMode !== _e.a.FOGMODE_NONE || p) && this.bindView(s), $e.a.BindFogParameters(o, n, this._activeEffect, !0), a.NUM_MORPH_INFLUENCERS && $e.a.BindMorphTargetParameters(n, this._activeEffect), this._imageProcessingConfiguration.bind(this._activeEffect), $e.a.BindLogDepth(a, this._activeEffect, o)), y.update(), this._afterBind(n, this._activeEffect);\n              }\n            }\n          }, t.prototype.getAnimatables = function() {\n            var e = [];\n            return this._albedoTexture && this._albedoTexture.animations && this._albedoTexture.animations.length > 0 && e.push(this._albedoTexture), 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._metallicTexture && this._metallicTexture.animations && this._metallicTexture.animations.length > 0 ? e.push(this._metallicTexture) : this._reflectivityTexture && this._reflectivityTexture.animations && this._reflectivityTexture.animations.length > 0 && e.push(this._reflectivityTexture), 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.detailMap.getAnimatables(e), this.subSurface.getAnimatables(e), this.clearCoat.getAnimatables(e), this.sheen.getAnimatables(e), this.anisotropy.getAnimatables(e), e;\n          }, t.prototype._getReflectionTexture = function() {\n            return this._reflectionTexture ? this._reflectionTexture : this.getScene().environmentTexture;\n          }, t.prototype.getActiveTextures = function() {\n            var e = r.prototype.getActiveTextures.call(this);\n            return this._albedoTexture && e.push(this._albedoTexture), 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._reflectivityTexture && e.push(this._reflectivityTexture), this._metallicTexture && e.push(this._metallicTexture), this._metallicReflectanceTexture && e.push(this._metallicReflectanceTexture), this._microSurfaceTexture && e.push(this._microSurfaceTexture), this._bumpTexture && e.push(this._bumpTexture), this._lightmapTexture && e.push(this._lightmapTexture), this.detailMap.getActiveTextures(e), this.subSurface.getActiveTextures(e), this.clearCoat.getActiveTextures(e), this.sheen.getActiveTextures(e), this.anisotropy.getActiveTextures(e), e;\n          }, t.prototype.hasTexture = function(e) {\n            return !!r.prototype.hasTexture.call(this, e) || this._albedoTexture === e || this._ambientTexture === e || this._opacityTexture === e || this._reflectionTexture === e || this._reflectivityTexture === e || this._metallicTexture === e || this._metallicReflectanceTexture === e || this._microSurfaceTexture === e || this._bumpTexture === e || this._lightmapTexture === e || this.detailMap.hasTexture(e) || this.subSurface.hasTexture(e) || this.clearCoat.hasTexture(e) || this.sheen.hasTexture(e) || this.anisotropy.hasTexture(e);\n          }, t.prototype.setPrePassRenderer = function(e) {\n            if (this.subSurface.isScatteringEnabled) {\n              var n = this.getScene().enableSubSurfaceForPrePass();\n              return n && (n.enabled = !0), !0;\n            }\n            return !1;\n          }, t.prototype.dispose = function(e, n) {\n            var i, o, a, s, d, p, y, P, R, B, F;\n            n && (this._environmentBRDFTexture && this.getScene().environmentBRDFTexture !== this._environmentBRDFTexture && this._environmentBRDFTexture.dispose(), (i = this._albedoTexture) === null || i === void 0 || i.dispose(), (o = this._ambientTexture) === null || o === void 0 || o.dispose(), (a = this._opacityTexture) === null || a === void 0 || a.dispose(), (s = this._reflectionTexture) === null || s === void 0 || s.dispose(), (d = this._emissiveTexture) === null || d === void 0 || d.dispose(), (p = this._metallicTexture) === null || p === void 0 || p.dispose(), (y = this._reflectivityTexture) === null || y === void 0 || y.dispose(), (P = this._bumpTexture) === null || P === void 0 || P.dispose(), (R = this._lightmapTexture) === null || R === void 0 || R.dispose(), (B = this._metallicReflectanceTexture) === null || B === void 0 || B.dispose(), (F = this._microSurfaceTexture) === null || F === void 0 || F.dispose()), this.detailMap.dispose(n), this.subSurface.dispose(n), this.clearCoat.dispose(n), this.sheen.dispose(n), this.anisotropy.dispose(n), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), r.prototype.dispose.call(this, e, n);\n          }, t.PBRMATERIAL_OPAQUE = zt.a.MATERIAL_OPAQUE, t.PBRMATERIAL_ALPHATEST = zt.a.MATERIAL_ALPHATEST, t.PBRMATERIAL_ALPHABLEND = zt.a.MATERIAL_ALPHABLEND, t.PBRMATERIAL_ALPHATESTANDBLEND = zt.a.MATERIAL_ALPHATESTANDBLEND, t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0, t.LIGHTFALLOFF_PHYSICAL = 0, t.LIGHTFALLOFF_GLTF = 1, t.LIGHTFALLOFF_STANDARD = 2, Object(c.c)([Object(L.i)()], t.prototype, \"_imageProcessingConfiguration\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], t.prototype, \"debugMode\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useLogarithmicDepth\", null), t;\n        }(jo.a), $r = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.directIntensity = 1, i.emissiveIntensity = 1, i.environmentIntensity = 1, i.specularIntensity = 1, i.disableBumpMap = !1, i.ambientTextureStrength = 1, i.ambientTextureImpactOnAnalyticalLights = t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, i.metallicF0Factor = 1, i.metallicReflectanceColor = I.a.White(), i.ambientColor = new I.a(0, 0, 0), i.albedoColor = new I.a(1, 1, 1), i.reflectivityColor = new I.a(1, 1, 1), i.reflectionColor = new I.a(1, 1, 1), i.emissiveColor = new I.a(0, 0, 0), i.microSurface = 1, i.useLightmapAsShadowmap = !1, i.useAlphaFromAlbedoTexture = !1, i.forceAlphaTest = !1, i.alphaCutOff = 0.4, i.useSpecularOverAlpha = !0, i.useMicroSurfaceFromReflectivityMapAlpha = !1, i.useRoughnessFromMetallicTextureAlpha = !0, i.useRoughnessFromMetallicTextureGreen = !1, i.useMetallnessFromMetallicTextureBlue = !1, i.useAmbientOcclusionFromMetallicTextureRed = !1, i.useAmbientInGrayScale = !1, i.useAutoMicroSurfaceFromReflectivityMap = !1, i.useRadianceOverAlpha = !0, i.useObjectSpaceNormalMap = !1, i.useParallax = !1, i.useParallaxOcclusion = !1, i.parallaxScaleBias = 0.05, i.disableLighting = !1, i.forceIrradianceInFragment = !1, i.maxSimultaneousLights = 4, i.invertNormalMapX = !1, i.invertNormalMapY = !1, i.twoSidedLighting = !1, i.useAlphaFresnel = !1, i.useLinearAlphaFresnel = !1, i.environmentBRDFTexture = null, i.forceNormalForward = !1, i.enableSpecularAntiAliasing = !1, i.useHorizonOcclusion = !0, i.useRadianceOcclusion = !0, i.unlit = !1, i._environmentBRDFTexture = Ho.GetEnvironmentBRDFTexture(n), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"refractionTexture\", { get: function() {\n            return this.subSurface.refractionTexture;\n          }, set: function(e) {\n            this.subSurface.refractionTexture = e, e ? this.subSurface.isRefractionEnabled = !0 : this.subSurface.linkRefractionWithTransparency || (this.subSurface.isRefractionEnabled = !1);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"indexOfRefraction\", { get: function() {\n            return this.subSurface.indexOfRefraction;\n          }, set: function(e) {\n            this.subSurface.indexOfRefraction = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"invertRefractionY\", { get: function() {\n            return this.subSurface.invertRefractionY;\n          }, set: function(e) {\n            this.subSurface.invertRefractionY = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"linkRefractionWithTransparency\", { get: function() {\n            return this.subSurface.linkRefractionWithTransparency;\n          }, set: function(e) {\n            this.subSurface.linkRefractionWithTransparency = e, e && (this.subSurface.isRefractionEnabled = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"usePhysicalLightFalloff\", { get: function() {\n            return this._lightFalloff === pn.LIGHTFALLOFF_PHYSICAL;\n          }, set: function(e) {\n            e !== this.usePhysicalLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = e ? pn.LIGHTFALLOFF_PHYSICAL : pn.LIGHTFALLOFF_STANDARD);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useGLTFLightFalloff\", { get: function() {\n            return this._lightFalloff === pn.LIGHTFALLOFF_GLTF;\n          }, set: function(e) {\n            e !== this.useGLTFLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = e ? pn.LIGHTFALLOFF_GLTF : pn.LIGHTFALLOFF_STANDARD);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraToneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraExposure\", { get: function() {\n            return this._imageProcessingConfiguration.exposure;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.exposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraContrast\", { get: function() {\n            return this._imageProcessingConfiguration.contrast;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.contrast = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingTexture\", { get: function() {\n            return this._imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.colorGradingTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurves\", { get: function() {\n            return this._imageProcessingConfiguration.colorCurves;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.colorCurves = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PBRMaterial\";\n          }, t.prototype.clone = function(e) {\n            var n = this, i = L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n            return i.id = e, i.name = e, this.clearCoat.copyTo(i.clearCoat), this.anisotropy.copyTo(i.anisotropy), this.brdf.copyTo(i.brdf), this.sheen.copyTo(i.sheen), this.subSurface.copyTo(i.subSurface), i;\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.PBRMaterial\", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return e.clearCoat && o.clearCoat.parse(e.clearCoat, n, i), e.anisotropy && o.anisotropy.parse(e.anisotropy, n, i), e.brdf && o.brdf.parse(e.brdf, n, i), e.sheen && o.sheen.parse(e.sheen, n, i), e.subSurface && o.subSurface.parse(e.subSurface, n, i), o;\n          }, t.PBRMATERIAL_OPAQUE = pn.PBRMATERIAL_OPAQUE, t.PBRMATERIAL_ALPHATEST = pn.PBRMATERIAL_ALPHATEST, t.PBRMATERIAL_ALPHABLEND = pn.PBRMATERIAL_ALPHABLEND, t.PBRMATERIAL_ALPHATESTANDBLEND = pn.PBRMATERIAL_ALPHATESTANDBLEND, t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = pn.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"directIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"environmentIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"specularIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"disableBumpMap\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"albedoTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientTextureStrength\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientTextureImpactOnAnalyticalLights\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"opacityTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectivityTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallic\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"roughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicF0Factor\", void 0), Object(c.c)([Object(L.e)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicReflectanceColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicReflectanceTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"microSurfaceTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"bumpTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", null)], t.prototype, \"lightmapTexture\", void 0), Object(c.c)([Object(L.e)(\"ambient\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientColor\", void 0), Object(c.c)([Object(L.e)(\"albedo\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"albedoColor\", void 0), Object(c.c)([Object(L.e)(\"reflectivity\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectivityColor\", void 0), Object(c.c)([Object(L.e)(\"reflection\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionColor\", void 0), Object(c.c)([Object(L.e)(\"emissive\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveColor\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"microSurface\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useLightmapAsShadowmap\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"useAlphaFromAlbedoTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"forceAlphaTest\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"alphaCutOff\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useSpecularOverAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useMicroSurfaceFromReflectivityMapAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRoughnessFromMetallicTextureAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRoughnessFromMetallicTextureGreen\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useMetallnessFromMetallicTextureBlue\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAmbientOcclusionFromMetallicTextureRed\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAmbientInGrayScale\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAutoMicroSurfaceFromReflectivityMap\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"usePhysicalLightFalloff\", null), Object(c.c)([Object(L.c)()], t.prototype, \"useGLTFLightFalloff\", null), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRadianceOverAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useObjectSpaceNormalMap\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useParallax\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useParallaxOcclusion\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"parallaxScaleBias\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"disableLighting\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"forceIrradianceInFragment\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"maxSimultaneousLights\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapX\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapY\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"twoSidedLighting\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAlphaFresnel\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useLinearAlphaFresnel\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"environmentBRDFTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"forceNormalForward\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"enableSpecularAntiAliasing\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useHorizonOcclusion\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRadianceOcclusion\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], t.prototype, \"unlit\", void 0), t;\n        }(pn);\n        O.a.RegisteredTypes[\"BABYLON.PBRMaterial\"] = $r;\n        function Xo(r) {\n          return r.charCodeAt(0) + (r.charCodeAt(1) << 8) + (r.charCodeAt(2) << 16) + (r.charCodeAt(3) << 24);\n        }\n        var Zl = Xo(\"DXT1\"), Jl = Xo(\"DXT3\"), $l = Xo(\"DXT5\"), Ps = Xo(\"DX10\"), Di = function() {\n          function r() {\n          }\n          return r.GetDDSInfo = function(t) {\n            var e = new Int32Array(t.buffer, t.byteOffset, 31), n = new Int32Array(t.buffer, t.byteOffset, 35), i = 1;\n            131072 & e[2] && (i = Math.max(1, e[7]));\n            var o = e[21], a = o === Ps ? n[32] : 0, s = h.a.TEXTURETYPE_UNSIGNED_INT;\n            switch (o) {\n              case 113:\n                s = h.a.TEXTURETYPE_HALF_FLOAT;\n                break;\n              case 116:\n                s = h.a.TEXTURETYPE_FLOAT;\n                break;\n              case Ps:\n                if (a === 10) {\n                  s = h.a.TEXTURETYPE_HALF_FLOAT;\n                  break;\n                }\n                if (a === 2) {\n                  s = h.a.TEXTURETYPE_FLOAT;\n                  break;\n                }\n            }\n            return { width: e[4], height: e[3], mipmapCount: i, isFourCC: (4 & e[20]) == 4, isRGB: (64 & e[20]) == 64, isLuminance: (131072 & e[20]) == 131072, isCube: (512 & e[28]) == 512, isCompressed: o === Zl || o === Jl || o === $l, dxgiFormat: a, textureType: s };\n          }, r._ToHalfFloat = function(t) {\n            r._FloatView || (r._FloatView = new Float32Array(1), r._Int32View = new Int32Array(r._FloatView.buffer)), r._FloatView[0] = t;\n            var e = r._Int32View[0], n = e >> 16 & 32768, i = e >> 12 & 2047, o = e >> 23 & 255;\n            return o < 103 ? n : o > 142 ? (n |= 31744, n |= (o == 255 ? 0 : 1) && 8388607 & e) : o < 113 ? n |= ((i |= 2048) >> 114 - o) + (i >> 113 - o & 1) : (n |= o - 112 << 10 | i >> 1, n += 1 & i);\n          }, r._FromHalfFloat = function(t) {\n            var e = (32768 & t) >> 15, n = (31744 & t) >> 10, i = 1023 & t;\n            return n === 0 ? (e ? -1 : 1) * Math.pow(2, -14) * (i / Math.pow(2, 10)) : n == 31 ? i ? NaN : 1 / 0 * (e ? -1 : 1) : (e ? -1 : 1) * Math.pow(2, n - 15) * (1 + i / Math.pow(2, 10));\n          }, r._GetHalfFloatAsFloatRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            for (var s = new Float32Array(i), d = new Uint16Array(o, n), p = 0, y = 0; y < e; y++)\n              for (var P = 0; P < t; P++) {\n                var R = 4 * (P + y * t);\n                s[p] = r._FromHalfFloat(d[R]), s[p + 1] = r._FromHalfFloat(d[R + 1]), s[p + 2] = r._FromHalfFloat(d[R + 2]), r.StoreLODInAlphaChannel ? s[p + 3] = a : s[p + 3] = r._FromHalfFloat(d[R + 3]), p += 4;\n              }\n            return s;\n          }, r._GetHalfFloatRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            if (r.StoreLODInAlphaChannel) {\n              for (var s = new Uint16Array(i), d = new Uint16Array(o, n), p = 0, y = 0; y < e; y++)\n                for (var P = 0; P < t; P++) {\n                  var R = 4 * (P + y * t);\n                  s[p] = d[R], s[p + 1] = d[R + 1], s[p + 2] = d[R + 2], s[p + 3] = r._ToHalfFloat(a), p += 4;\n                }\n              return s;\n            }\n            return new Uint16Array(o, n, i);\n          }, r._GetFloatRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            if (r.StoreLODInAlphaChannel) {\n              for (var s = new Float32Array(i), d = new Float32Array(o, n), p = 0, y = 0; y < e; y++)\n                for (var P = 0; P < t; P++) {\n                  var R = 4 * (P + y * t);\n                  s[p] = d[R], s[p + 1] = d[R + 1], s[p + 2] = d[R + 2], s[p + 3] = a, p += 4;\n                }\n              return s;\n            }\n            return new Float32Array(o, n, i);\n          }, r._GetFloatAsUIntRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            for (var s = new Uint8Array(i), d = new Float32Array(o, n), p = 0, y = 0; y < e; y++)\n              for (var P = 0; P < t; P++) {\n                var R = 4 * (P + y * t);\n                s[p] = 255 * $.a.Clamp(d[R]), s[p + 1] = 255 * $.a.Clamp(d[R + 1]), s[p + 2] = 255 * $.a.Clamp(d[R + 2]), r.StoreLODInAlphaChannel ? s[p + 3] = a : s[p + 3] = 255 * $.a.Clamp(d[R + 3]), p += 4;\n              }\n            return s;\n          }, r._GetHalfFloatAsUIntRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            for (var s = new Uint8Array(i), d = new Uint16Array(o, n), p = 0, y = 0; y < e; y++)\n              for (var P = 0; P < t; P++) {\n                var R = 4 * (P + y * t);\n                s[p] = 255 * $.a.Clamp(r._FromHalfFloat(d[R])), s[p + 1] = 255 * $.a.Clamp(r._FromHalfFloat(d[R + 1])), s[p + 2] = 255 * $.a.Clamp(r._FromHalfFloat(d[R + 2])), r.StoreLODInAlphaChannel ? s[p + 3] = a : s[p + 3] = 255 * $.a.Clamp(r._FromHalfFloat(d[R + 3])), p += 4;\n              }\n            return s;\n          }, r._GetRGBAArrayBuffer = function(t, e, n, i, o, a, s, d, p) {\n            for (var y = new Uint8Array(i), P = new Uint8Array(o, n), R = 0, B = 0; B < e; B++)\n              for (var F = 0; F < t; F++) {\n                var z = 4 * (F + B * t);\n                y[R] = P[z + a], y[R + 1] = P[z + s], y[R + 2] = P[z + d], y[R + 3] = P[z + p], R += 4;\n              }\n            return y;\n          }, r._ExtractLongWordOrder = function(t) {\n            return t === 0 || t === 255 || t === -16777216 ? 0 : 1 + r._ExtractLongWordOrder(t >> 8);\n          }, r._GetRGBArrayBuffer = function(t, e, n, i, o, a, s, d) {\n            for (var p = new Uint8Array(i), y = new Uint8Array(o, n), P = 0, R = 0; R < e; R++)\n              for (var B = 0; B < t; B++) {\n                var F = 3 * (B + R * t);\n                p[P] = y[F + a], p[P + 1] = y[F + s], p[P + 2] = y[F + d], P += 3;\n              }\n            return p;\n          }, r._GetLuminanceArrayBuffer = function(t, e, n, i, o) {\n            for (var a = new Uint8Array(i), s = new Uint8Array(o, n), d = 0, p = 0; p < e; p++)\n              for (var y = 0; y < t; y++) {\n                var P = y + p * t;\n                a[d] = s[P], d++;\n              }\n            return a;\n          }, r.UploadDDSLevels = function(t, e, n, i, o, a, s, d) {\n            s === void 0 && (s = -1);\n            var p = null;\n            i.sphericalPolynomial && (p = new Array());\n            var y, P, R, B, F, z, J, ie = t.getCaps().s3tc, se = new Int32Array(n.buffer, n.byteOffset, 31), ce = 0, ue = 0, fe = 1;\n            if (se[0] === 542327876)\n              if (i.isFourCC || i.isRGB || i.isLuminance)\n                if (!i.isCompressed || ie) {\n                  var ve = se[22];\n                  B = se[1] + 4;\n                  var Te, Re = !1;\n                  if (i.isFourCC)\n                    switch (y = se[21]) {\n                      case Zl:\n                        fe = 8, ue = ie.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n                        break;\n                      case Jl:\n                        fe = 16, ue = ie.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n                        break;\n                      case $l:\n                        fe = 16, ue = ie.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n                        break;\n                      case 113:\n                      case 116:\n                        Re = !0;\n                        break;\n                      case Ps:\n                        B += 20;\n                        var Ae = !1;\n                        switch (i.dxgiFormat) {\n                          case 10:\n                          case 2:\n                            Re = !0, Ae = !0;\n                            break;\n                          case 88:\n                            i.isRGB = !0, i.isFourCC = !1, ve = 32, Ae = !0;\n                        }\n                        if (Ae)\n                          break;\n                      default:\n                        return void console.error(\"Unsupported FourCC code:\", (Te = y, String.fromCharCode(255 & Te, Te >> 8 & 255, Te >> 16 & 255, Te >> 24 & 255)));\n                    }\n                  var Ee = r._ExtractLongWordOrder(se[23]), Se = r._ExtractLongWordOrder(se[24]), De = r._ExtractLongWordOrder(se[25]), xe = r._ExtractLongWordOrder(se[26]);\n                  Re && (ue = t._getRGBABufferInternalSizedFormat(i.textureType)), z = 1, 131072 & se[2] && o !== !1 && (z = Math.max(1, se[7]));\n                  for (var Le = d || 0; Le < a; Le++) {\n                    for (P = se[4], R = se[3], J = 0; J < z; ++J) {\n                      if (s === -1 || s === J) {\n                        var Me = s === -1 ? J : 0;\n                        if (!i.isCompressed && i.isFourCC) {\n                          e.format = h.a.TEXTUREFORMAT_RGBA, ce = P * R * 4;\n                          var we = null;\n                          t._badOS || t._badDesktopOS || !t.getCaps().textureHalfFloat && !t.getCaps().textureFloat ? (ve === 128 ? (we = r._GetFloatAsUIntRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(r._GetFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me))) : ve === 64 && (we = r._GetHalfFloatAsUIntRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(r._GetHalfFloatAsFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me))), e.type = h.a.TEXTURETYPE_UNSIGNED_INT) : ve === 128 ? (e.type = h.a.TEXTURETYPE_FLOAT, we = r._GetFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(we)) : ve !== 64 || t.getCaps().textureHalfFloat ? (e.type = h.a.TEXTURETYPE_HALF_FLOAT, we = r._GetHalfFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(r._GetHalfFloatAsFloatRGBAArrayBuffer(P, R, B, ce, n.buffer, Me))) : (e.type = h.a.TEXTURETYPE_FLOAT, we = r._GetHalfFloatAsFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(we)), we && t._uploadDataToTextureDirectly(e, we, Le, Me);\n                        } else if (i.isRGB)\n                          e.type = h.a.TEXTURETYPE_UNSIGNED_INT, ve === 24 ? (e.format = h.a.TEXTUREFORMAT_RGB, ce = P * R * 3, F = r._GetRGBArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Ee, Se, De), t._uploadDataToTextureDirectly(e, F, Le, Me)) : (e.format = h.a.TEXTUREFORMAT_RGBA, ce = P * R * 4, F = r._GetRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Ee, Se, De, xe), t._uploadDataToTextureDirectly(e, F, Le, Me));\n                        else if (i.isLuminance) {\n                          var Ye = t._getUnpackAlignement(), et = P;\n                          ce = Math.floor((P + Ye - 1) / Ye) * Ye * (R - 1) + et, F = r._GetLuminanceArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer), e.format = h.a.TEXTUREFORMAT_LUMINANCE, e.type = h.a.TEXTURETYPE_UNSIGNED_INT, t._uploadDataToTextureDirectly(e, F, Le, Me);\n                        } else\n                          ce = Math.max(4, P) / 4 * Math.max(4, R) / 4 * fe, F = new Uint8Array(n.buffer, n.byteOffset + B, ce), e.type = h.a.TEXTURETYPE_UNSIGNED_INT, t._uploadCompressedDataToTextureDirectly(e, ue, P, R, F, Le, Me);\n                      }\n                      B += ve ? P * R * (ve / 8) : ce, P *= 0.5, R *= 0.5, P = Math.max(1, P), R = Math.max(1, R);\n                    }\n                    if (d !== void 0)\n                      break;\n                  }\n                  p && p.length > 0 ? i.sphericalPolynomial = Lo.ConvertCubeMapToSphericalPolynomial({ size: se[4], right: p[0], left: p[1], up: p[2], down: p[3], front: p[4], back: p[5], format: h.a.TEXTUREFORMAT_RGBA, type: h.a.TEXTURETYPE_FLOAT, gammaSpace: !1 }) : i.sphericalPolynomial = void 0;\n                } else\n                  l.a.Error(\"Compressed textures are not supported on this platform.\");\n              else\n                l.a.Error(\"Unsupported format, must contain a FourCC, RGB or LUMINANCE code\");\n            else\n              l.a.Error(\"Invalid magic number in DDS header\");\n          }, r.StoreLODInAlphaChannel = !1, r;\n        }();\n        wt.a.prototype.createPrefilteredCubeTexture = function(r, t, e, n, i, o, a, s, d) {\n          var p = this;\n          return i === void 0 && (i = null), o === void 0 && (o = null), s === void 0 && (s = null), d === void 0 && (d = !0), this.createCubeTexture(r, t, null, !1, function(y) {\n            if (y) {\n              var P = y.texture;\n              if (d ? y.info.sphericalPolynomial && (P._sphericalPolynomial = y.info.sphericalPolynomial) : P._sphericalPolynomial = new Yr(), P._source = Pt.b.CubePrefiltered, p.getCaps().textureLOD)\n                i && i(P);\n              else {\n                var R = p._gl, B = y.width;\n                if (B) {\n                  for (var F = [], z = 0; z < 3; z++) {\n                    var J = 1 - z / 2, ie = n, se = $.a.Log2(B) * e + n, ce = ie + (se - ie) * J, ue = Math.round(Math.min(Math.max(ce, 0), se)), fe = new Pt.a(p, Pt.b.Temp);\n                    if (fe.type = P.type, fe.format = P.format, fe.width = Math.pow(2, Math.max($.a.Log2(B) - ue, 0)), fe.height = fe.width, fe.isCube = !0, p._bindTextureDirectly(R.TEXTURE_CUBE_MAP, fe, !0), fe.samplingMode = h.a.TEXTURE_LINEAR_LINEAR, R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_MAG_FILTER, R.LINEAR), R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_MIN_FILTER, R.LINEAR), R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_WRAP_S, R.CLAMP_TO_EDGE), R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_WRAP_T, R.CLAMP_TO_EDGE), y.isDDS) {\n                      var ve = y.info, Te = y.data;\n                      p._unpackFlipY(ve.isCompressed), Di.UploadDDSLevels(p, fe, Te, ve, !0, 6, ue);\n                    } else\n                      l.a.Warn(\"DDS is the only prefiltered cube map supported so far.\");\n                    p._bindTextureDirectly(R.TEXTURE_CUBE_MAP, null);\n                    var Re = new kn.a(t);\n                    Re.isCube = !0, Re._texture = fe, fe.isReady = !0, F.push(Re);\n                  }\n                  P._lodTextureHigh = F[2], P._lodTextureMid = F[1], P._lodTextureLow = F[0], i && i(P);\n                }\n              }\n            } else\n              i && i(null);\n          }, o, a, s, d, e, n);\n        };\n        var eu = function() {\n          function r() {\n            this.supportCascades = !0;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".dds\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            var a, s = e.getEngine(), d = !1;\n            if (Array.isArray(t))\n              for (var p = 0; p < t.length; p++) {\n                var y = t[p];\n                a = Di.GetDDSInfo(y), e.width = a.width, e.height = a.height, d = (a.isRGB || a.isLuminance || a.mipmapCount > 1) && e.generateMipMaps, s._unpackFlipY(a.isCompressed), Di.UploadDDSLevels(s, e, y, a, d, 6, -1, p), a.isFourCC || a.mipmapCount !== 1 || s.generateMipMapsForCubemap(e);\n              }\n            else {\n              var P = t;\n              a = Di.GetDDSInfo(P), e.width = a.width, e.height = a.height, n && (a.sphericalPolynomial = new Yr()), d = (a.isRGB || a.isLuminance || a.mipmapCount > 1) && e.generateMipMaps, s._unpackFlipY(a.isCompressed), Di.UploadDDSLevels(s, e, P, a, d, 6), a.isFourCC || a.mipmapCount !== 1 || s.generateMipMapsForCubemap(e, !1);\n            }\n            s._setCubeMapTextureParams(e, d), e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i({ isDDS: !0, width: e.width, info: a, data: t, texture: e });\n          }, r.prototype.loadData = function(t, e, n) {\n            var i = Di.GetDDSInfo(t), o = (i.isRGB || i.isLuminance || i.mipmapCount > 1) && e.generateMipMaps && i.width >> i.mipmapCount - 1 == 1;\n            n(i.width, i.height, o, i.isFourCC, function() {\n              Di.UploadDDSLevels(e.getEngine(), e, t, i, o, 1);\n            });\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new eu());\n        var tu = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".env\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            if (!Array.isArray(t)) {\n              var a = gi.GetEnvInfo(t);\n              a ? (e.width = a.width, e.height = a.width, gi.UploadEnvSpherical(e, a), gi.UploadEnvLevelsAsync(e, t, a).then(function() {\n                e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i();\n              })) : o && o(\"Can not parse the environment file\", null);\n            }\n          }, r.prototype.loadData = function(t, e, n) {\n            throw \".env not supported in 2d.\";\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new tu());\n        var Yo = function() {\n          function r(t, e, n, i) {\n            if (this.data = t, this.isInvalid = !1, !r.IsValid(t))\n              return this.isInvalid = !0, void l.a.Error(\"texture missing KTX identifier\");\n            var o = Uint32Array.BYTES_PER_ELEMENT, a = new DataView(this.data.buffer, this.data.byteOffset + 12, 13 * o), s = a.getUint32(0, !0) === 67305985;\n            this.glType = a.getUint32(1 * o, s), this.glTypeSize = a.getUint32(2 * o, s), this.glFormat = a.getUint32(3 * o, s), this.glInternalFormat = a.getUint32(4 * o, s), this.glBaseInternalFormat = a.getUint32(5 * o, s), this.pixelWidth = a.getUint32(6 * o, s), this.pixelHeight = a.getUint32(7 * o, s), this.pixelDepth = a.getUint32(8 * o, s), this.numberOfArrayElements = a.getUint32(9 * o, s), this.numberOfFaces = a.getUint32(10 * o, s), this.numberOfMipmapLevels = a.getUint32(11 * o, s), this.bytesOfKeyValueData = a.getUint32(12 * o, s), this.glType === 0 ? (this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels), this.pixelHeight !== 0 && this.pixelDepth === 0 ? this.numberOfArrayElements === 0 ? this.numberOfFaces === e ? this.loadType = r.COMPRESSED_2D : l.a.Error(\"number of faces expected\" + e + \", but found \" + this.numberOfFaces) : l.a.Error(\"texture arrays not currently supported\") : l.a.Error(\"only 2D textures currently supported\")) : l.a.Error(\"only compressed formats currently supported\");\n          }\n          return r.prototype.uploadLevels = function(t, e) {\n            switch (this.loadType) {\n              case r.COMPRESSED_2D:\n                this._upload2DCompressedLevels(t, e);\n                break;\n              case r.TEX_2D:\n              case r.COMPRESSED_3D:\n              case r.TEX_3D:\n            }\n          }, r.prototype._upload2DCompressedLevels = function(t, e) {\n            for (var n = r.HEADER_LEN + this.bytesOfKeyValueData, i = this.pixelWidth, o = this.pixelHeight, a = e ? this.numberOfMipmapLevels : 1, s = 0; s < a; s++) {\n              var d = new Int32Array(this.data.buffer, this.data.byteOffset + n, 1)[0];\n              n += 4;\n              for (var p = 0; p < this.numberOfFaces; p++) {\n                var y = new Uint8Array(this.data.buffer, this.data.byteOffset + n, d);\n                t.getEngine()._uploadCompressedDataToTextureDirectly(t, this.glInternalFormat, i, o, y, p, s), n += d, n += 3 - (d + 3) % 4;\n              }\n              i = Math.max(1, 0.5 * i), o = Math.max(1, 0.5 * o);\n            }\n          }, r.IsValid = function(t) {\n            if (t.byteLength >= 12) {\n              var e = new Uint8Array(t.buffer, t.byteOffset, 12);\n              if (e[0] === 171 && e[1] === 75 && e[2] === 84 && e[3] === 88 && e[4] === 32 && e[5] === 49 && e[6] === 49 && e[7] === 187 && e[8] === 13 && e[9] === 10 && e[10] === 26 && e[11] === 10)\n                return !0;\n            }\n            return !1;\n          }, r.HEADER_LEN = 64, r.COMPRESSED_2D = 0, r.COMPRESSED_3D = 1, r.TEX_2D = 2, r.TEX_3D = 3, r;\n        }(), xs = function() {\n          function r(t) {\n            this._pendingActions = new Array(), this._workerInfos = t.map(function(e) {\n              return { worker: e, active: !1 };\n            });\n          }\n          return r.prototype.dispose = function() {\n            for (var t = 0, e = this._workerInfos; t < e.length; t++)\n              e[t].worker.terminate();\n            this._workerInfos = [], this._pendingActions = [];\n          }, r.prototype.push = function(t) {\n            for (var e = 0, n = this._workerInfos; e < n.length; e++) {\n              var i = n[e];\n              if (!i.active)\n                return void this._execute(i, t);\n            }\n            this._pendingActions.push(t);\n          }, r.prototype._execute = function(t, e) {\n            var n = this;\n            t.active = !0, e(t.worker, function() {\n              t.active = !1;\n              var i = n._pendingActions.shift();\n              i && n._execute(t, i);\n            });\n          }, r;\n        }(), Cs = function() {\n          function r(t, e) {\n            e === void 0 && (e = r.DefaultNumWorkers), this._engine = t, r._Initialized || r._CreateWorkerPool(e);\n          }\n          return r.GetDefaultNumWorkers = function() {\n            return typeof navigator == \"object\" && navigator.hardwareConcurrency ? Math.min(Math.floor(0.5 * navigator.hardwareConcurrency), 4) : 1;\n          }, r._CreateWorkerPool = function(t) {\n            this._Initialized = !0, t && typeof Worker == \"function\" ? r._WorkerPoolPromise = new Promise(function(e) {\n              for (var n = \"(\" + Hp + \")()\", i = URL.createObjectURL(new Blob([n], { type: \"application/javascript\" })), o = new Array(t), a = 0; a < o.length; a++)\n                o[a] = new Promise(function(s, d) {\n                  var p = new Worker(i), y = function(R) {\n                    p.removeEventListener(\"error\", y), p.removeEventListener(\"message\", P), d(R);\n                  }, P = function(R) {\n                    R.data.action === \"init\" && (p.removeEventListener(\"error\", y), p.removeEventListener(\"message\", P), s(p));\n                  };\n                  p.addEventListener(\"error\", y), p.addEventListener(\"message\", P), p.postMessage({ action: \"init\", urls: r.URLConfig });\n                });\n              Promise.all(o).then(function(s) {\n                e(new xs(s));\n              });\n            }) : (KTX2DECODER.MSCTranscoder.UseFromWorkerThread = !1, KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread = !0);\n          }, r.prototype.uploadAsync = function(t, e, n) {\n            var i = this, o = this._engine.getCaps(), a = { astc: !!o.astc, bptc: !!o.bptc, s3tc: !!o.s3tc, pvrtc: !!o.pvrtc, etc2: !!o.etc2, etc1: !!o.etc1 };\n            return r._WorkerPoolPromise ? r._WorkerPoolPromise.then(function(s) {\n              return new Promise(function(d, p) {\n                s.push(function(y, P) {\n                  var R = function(F) {\n                    y.removeEventListener(\"error\", R), y.removeEventListener(\"message\", B), p(F), P();\n                  }, B = function(F) {\n                    if (F.data.action === \"decoded\") {\n                      if (y.removeEventListener(\"error\", R), y.removeEventListener(\"message\", B), F.data.success)\n                        try {\n                          i._createTexture(F.data.decodedData, e, n), d();\n                        } catch (z) {\n                          p({ message: z });\n                        }\n                      else\n                        p({ message: F.data.msg });\n                      P();\n                    }\n                  };\n                  y.addEventListener(\"error\", R), y.addEventListener(\"message\", B), y.postMessage({ action: \"decode\", data: t, caps: a, options: n });\n                });\n              });\n            }) : new Promise(function(s, d) {\n              r._Ktx2Decoder || (r._Ktx2Decoder = new KTX2DECODER.KTX2Decoder()), r._Ktx2Decoder.decode(t, o).then(function(p) {\n                i._createTexture(p, e), s();\n              }).catch(function(p) {\n                d({ message: p });\n              });\n            });\n          }, r.prototype.dispose = function() {\n            r._WorkerPoolPromise && r._WorkerPoolPromise.then(function(t) {\n              t.dispose();\n            }), delete r._WorkerPoolPromise;\n          }, r.prototype._createTexture = function(t, e, n) {\n            if (this._engine._bindTextureDirectly(this._engine._gl.TEXTURE_2D, e), n && (n.transcodedFormat = t.transcodedFormat, n.isInGammaSpace = t.isInGammaSpace, n.transcoderName = t.transcoderName), t.transcodedFormat === 32856 ? (e.type = h.a.TEXTURETYPE_UNSIGNED_BYTE, e.format = h.a.TEXTUREFORMAT_RGBA) : e.format = t.transcodedFormat, e._gammaSpace = t.isInGammaSpace, t.errors)\n              throw new Error(\"KTX2 container - could not transcode the data. \" + t.errors);\n            for (var i = 0; i < t.mipmaps.length; ++i) {\n              var o = t.mipmaps[i];\n              if (!o || !o.data)\n                throw new Error(\"KTX2 container - could not transcode one of the image\");\n              t.transcodedFormat === 32856 ? (e.width = o.width, e.height = o.height, this._engine._uploadDataToTextureDirectly(e, o.data, 0, i, void 0, !0)) : this._engine._uploadCompressedDataToTextureDirectly(e, t.transcodedFormat, o.width, o.height, o.data, 0, i);\n            }\n            e.width = t.mipmaps[0].width, e.height = t.mipmaps[0].height, e.generateMipMaps = t.mipmaps.length > 1, e.isReady = !0, this._engine._bindTextureDirectly(this._engine._gl.TEXTURE_2D, null);\n          }, r.IsValid = function(t) {\n            if (t.byteLength >= 12) {\n              var e = new Uint8Array(t.buffer, t.byteOffset, 12);\n              if (e[0] === 171 && e[1] === 75 && e[2] === 84 && e[3] === 88 && e[4] === 32 && e[5] === 50 && e[6] === 48 && e[7] === 187 && e[8] === 13 && e[9] === 10 && e[10] === 26 && e[11] === 10)\n                return !0;\n            }\n            return !1;\n          }, r.URLConfig = { jsDecoderModule: \"https://preview.babylonjs.com/babylon.ktx2Decoder.js\", wasmUASTCToASTC: null, wasmUASTCToBC7: null, wasmUASTCToRGBA_UNORM: null, wasmUASTCToRGBA_SRGB: null, jsMSCTranscoder: null, wasmMSCTranscoder: null }, r.DefaultNumWorkers = r.GetDefaultNumWorkers(), r;\n        }();\n        function Hp() {\n          var r;\n          onmessage = function(t) {\n            switch (t.data.action) {\n              case \"init\":\n                var e = t.data.urls;\n                importScripts(e.jsDecoderModule), e.wasmUASTCToASTC !== null && (KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL = e.wasmUASTCToASTC), e.wasmUASTCToBC7 !== null && (KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL = e.wasmUASTCToBC7), e.wasmUASTCToRGBA_UNORM !== null && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = e.wasmUASTCToRGBA_UNORM), e.wasmUASTCToRGBA_SRGB !== null && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = e.wasmUASTCToRGBA_SRGB), e.jsMSCTranscoder !== null && (KTX2DECODER.MSCTranscoder.JSModuleURL = e.jsMSCTranscoder), e.wasmMSCTranscoder !== null && (KTX2DECODER.MSCTranscoder.WasmModuleURL = e.wasmMSCTranscoder), r = new KTX2DECODER.KTX2Decoder(), postMessage({ action: \"init\" });\n                break;\n              case \"decode\":\n                r.decode(t.data.data, t.data.caps, t.data.options).then(function(n) {\n                  for (var i = [], o = 0; o < n.mipmaps.length; ++o) {\n                    var a = n.mipmaps[o];\n                    a && a.data && i.push(a.data.buffer);\n                  }\n                  postMessage({ action: \"decoded\", success: !0, decodedData: n }, i);\n                }).catch(function(n) {\n                  postMessage({ action: \"decoded\", success: !1, msg: n });\n                });\n            }\n          };\n        }\n        var nu = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t, e) {\n            return Hn.a.EndsWith(t, \".ktx\") || Hn.a.EndsWith(t, \".ktx2\") || e === \"image/ktx\" || e === \"image/ktx2\";\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            if (!Array.isArray(t)) {\n              e._invertVScale = !e.invertY;\n              var a = e.getEngine(), s = new Yo(t, 6), d = s.numberOfMipmapLevels > 1 && e.generateMipMaps;\n              a._unpackFlipY(!0), s.uploadLevels(e, e.generateMipMaps), e.width = s.pixelWidth, e.height = s.pixelHeight, a._setCubeMapTextureParams(e, d), e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i();\n            }\n          }, r.prototype.loadData = function(t, e, n, i) {\n            if (Yo.IsValid(t)) {\n              e._invertVScale = !e.invertY;\n              var o = new Yo(t, 1);\n              n(o.pixelWidth, o.pixelHeight, e.generateMipMaps, !0, function() {\n                o.uploadLevels(e, e.generateMipMaps);\n              }, o.isInvalid);\n            } else\n              Cs.IsValid(t) ? new Cs(e.getEngine()).uploadAsync(t, e, i).then(function() {\n                n(e.width, e.height, e.generateMipMaps, !0, function() {\n                }, !1);\n              }, function(a) {\n                l.a.Warn(\"Failed to load KTX2 texture data: \" + a.message), n(0, 0, !1, !1, function() {\n                }, !0);\n              }) : (l.a.Error(\"texture missing KTX identifier\"), n(0, 0, !1, !1, function() {\n              }, !0));\n          }, r;\n        }();\n        Ue.a._TextureLoaders.unshift(new nu());\n        var iu = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, u.e.Zero(), n) || this;\n            return o._xrSessionManager = i, o._firstFrame = !1, o._referenceQuaternion = u.b.Identity(), o._referencedPosition = new u.e(), o._xrInvPositionCache = new u.e(), o._xrInvQuaternionCache = u.b.Identity(), o._trackingState = Xi.NOT_TRACKING, o.onBeforeCameraTeleport = new C.c(), o.onAfterCameraTeleport = new C.c(), o.onTrackingStateChanged = new C.c(), o.compensateOnFirstFrame = !0, o._rotate180 = new u.b(0, 1, 0, 0), o.minZ = 0.1, o.rotationQuaternion = new u.b(), o.cameraRigMode = _t.a.RIG_MODE_CUSTOM, o.updateUpVectorFromRotation = !0, o._updateNumberOfRigCameras(1), o.freezeProjectionMatrix(), o._xrSessionManager.onXRSessionInit.add(function() {\n              o._referencedPosition.copyFromFloats(0, 0, 0), o._referenceQuaternion.copyFromFloats(0, 0, 0, 1), o._firstFrame = o.compensateOnFirstFrame;\n            }), o._xrSessionManager.onXRFrameObservable.add(function(a) {\n              o._firstFrame && o._updateFromXRSession(), o._updateReferenceSpace(), o._updateFromXRSession();\n            }, void 0, !0), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"trackingState\", { get: function() {\n            return this._trackingState;\n          }, enumerable: !1, configurable: !0 }), t.prototype._setTrackingState = function(e) {\n            this._trackingState !== e && (this._trackingState = e, this.onTrackingStateChanged.notifyObservers(e));\n          }, Object.defineProperty(t.prototype, \"realWorldHeight\", { get: function() {\n            var e = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);\n            return e && e.transform ? e.transform.position.y : 0;\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateForDualEyeDebugging = function() {\n            this._updateNumberOfRigCameras(2), this.rigCameras[0].viewport = new jn.a(0, 0, 0.5, 1), this.rigCameras[0].outputRenderTarget = null, this.rigCameras[1].viewport = new jn.a(0.5, 0, 0.5, 1), this.rigCameras[1].outputRenderTarget = null;\n          }, t.prototype.setTransformationFromNonVRCamera = function(e, n) {\n            e === void 0 && (e = this.getScene().activeCamera), n === void 0 && (n = !0), e && e !== this && (e.computeWorldMatrix().decompose(void 0, this.rotationQuaternion, this.position), this.position.y = 0, u.b.FromEulerAnglesToRef(0, this.rotationQuaternion.toEulerAngles().y, 0, this.rotationQuaternion), this._firstFrame = !0, n && this._xrSessionManager.resetReferenceSpace());\n          }, t.prototype.getClassName = function() {\n            return \"WebXRCamera\";\n          }, t.prototype._updateFromXRSession = function() {\n            var e = this, n = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);\n            if (n) {\n              var i = n.emulatedPosition ? Xi.TRACKING_LOST : Xi.TRACKING;\n              if (this._setTrackingState(i), n.transform) {\n                var o = n.transform.position;\n                this._referencedPosition.set(o.x, o.y, o.z);\n                var a = n.transform.orientation;\n                this._referenceQuaternion.set(a.x, a.y, a.z, a.w), this._scene.useRightHandedSystem || (this._referencedPosition.z *= -1, this._referenceQuaternion.z *= -1, this._referenceQuaternion.w *= -1), this._firstFrame ? (this._firstFrame = !1, this.position.y += this._referencedPosition.y, this._referenceQuaternion.copyFromFloats(0, 0, 0, 1)) : (this.rotationQuaternion.copyFrom(this._referenceQuaternion), this.position.copyFrom(this._referencedPosition));\n              }\n              this.rigCameras.length !== n.views.length && this._updateNumberOfRigCameras(n.views.length), n.views.forEach(function(s, d) {\n                var p = e.rigCameras[d];\n                p.isLeftCamera || p.isRightCamera || (s.eye === \"right\" ? p._isRightCamera = !0 : s.eye === \"left\" && (p._isLeftCamera = !0));\n                var y = s.transform.position, P = s.transform.orientation;\n                if (p.position.set(y.x, y.y, y.z), p.rotationQuaternion.set(P.x, P.y, P.z, P.w), e._scene.useRightHandedSystem ? p.rotationQuaternion.multiplyInPlace(e._rotate180) : (p.position.z *= -1, p.rotationQuaternion.z *= -1, p.rotationQuaternion.w *= -1), u.a.FromFloat32ArrayToRefScaled(s.projectionMatrix, 0, 1, p._projectionMatrix), e._scene.useRightHandedSystem || p._projectionMatrix.toggleProjectionMatrixHandInPlace(), d === 0 && e._projectionMatrix.copyFrom(p._projectionMatrix), e._xrSessionManager.session.renderState.baseLayer) {\n                  var R = e._xrSessionManager.session.renderState.baseLayer.getViewport(s), B = e._xrSessionManager.session.renderState.baseLayer.framebufferWidth, F = e._xrSessionManager.session.renderState.baseLayer.framebufferHeight;\n                  p.viewport.width = R.width / B, p.viewport.height = R.height / F, p.viewport.x = R.x / B, p.viewport.y = R.y / F;\n                }\n                p.outputRenderTarget = e._xrSessionManager.getRenderTargetTextureForEye(s.eye);\n              });\n            } else\n              this._setTrackingState(Xi.NOT_TRACKING);\n          }, t.prototype._updateNumberOfRigCameras = function(e) {\n            for (e === void 0 && (e = 1); this.rigCameras.length < e; ) {\n              var n = new Pi(\"XR-RigCamera: \" + this.rigCameras.length, u.e.Zero(), this.getScene());\n              n.minZ = 0.1, n.rotationQuaternion = new u.b(), n.updateUpVectorFromRotation = !0, n.isRigCamera = !0, n.rigParent = this, n.freezeProjectionMatrix(), this.rigCameras.push(n);\n            }\n            for (; this.rigCameras.length > e; ) {\n              var i = this.rigCameras.pop();\n              i && i.dispose();\n            }\n          }, t.prototype._updateReferenceSpace = function() {\n            this.position.equals(this._referencedPosition) && this.rotationQuaternion.equals(this._referenceQuaternion) || (this.position.subtractToRef(this._referencedPosition, this._referencedPosition), this._referenceQuaternion.conjugateInPlace(), this._referenceQuaternion.multiplyToRef(this.rotationQuaternion, this._referenceQuaternion), this._updateReferenceSpaceOffset(this._referencedPosition, this._referenceQuaternion.normalize()));\n          }, t.prototype._updateReferenceSpaceOffset = function(e, n, i) {\n            if (i === void 0 && (i = !1), this._xrSessionManager.referenceSpace && this._xrSessionManager.currentFrame) {\n              this._xrInvPositionCache.copyFrom(e), n ? this._xrInvQuaternionCache.copyFrom(n) : this._xrInvQuaternionCache.copyFromFloats(0, 0, 0, 1), this._scene.useRightHandedSystem || (this._xrInvPositionCache.z *= -1, this._xrInvQuaternionCache.z *= -1, this._xrInvQuaternionCache.w *= -1), this._xrInvPositionCache.negateInPlace(), this._xrInvQuaternionCache.conjugateInPlace(), this._xrInvPositionCache.rotateByQuaternionToRef(this._xrInvQuaternionCache, this._xrInvPositionCache), i && (this._xrInvPositionCache.y = 0);\n              var o = new XRRigidTransform({ x: this._xrInvPositionCache.x, y: this._xrInvPositionCache.y, z: this._xrInvPositionCache.z }, { x: this._xrInvQuaternionCache.x, y: this._xrInvQuaternionCache.y, z: this._xrInvQuaternionCache.z, w: this._xrInvQuaternionCache.w }), a = this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(o), s = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(a);\n              if (s) {\n                var d = new u.e(s.transform.position.x, s.transform.position.y, s.transform.position.z);\n                this._scene.useRightHandedSystem || (d.z *= -1), this.position.subtractToRef(d, d), this._scene.useRightHandedSystem || (d.z *= -1), d.negateInPlace();\n                var p = new XRRigidTransform({ x: d.x, y: d.y, z: d.z });\n                this._xrSessionManager.referenceSpace = a.getOffsetReferenceSpace(p);\n              }\n            }\n          }, t;\n        }(zn), ti = function() {\n          function r() {\n          }\n          return r.ANCHOR_SYSTEM = \"xr-anchor-system\", r.BACKGROUND_REMOVER = \"xr-background-remover\", r.HIT_TEST = \"xr-hit-test\", r.PHYSICS_CONTROLLERS = \"xr-physics-controller\", r.PLANE_DETECTION = \"xr-plane-detection\", r.POINTER_SELECTION = \"xr-controller-pointer-selection\", r.TELEPORTATION = \"xr-controller-teleportation\", r.FEATURE_POINTS = \"xr-feature-points\", r.HAND_TRACKING = \"xr-hand-tracking\", r;\n        }(), Wn = function() {\n          function r(t) {\n            var e = this;\n            this._xrSessionManager = t, this._features = {}, this._xrSessionManager.onXRSessionInit.add(function() {\n              e.getEnabledFeatures().forEach(function(n) {\n                var i = e._features[n];\n                !i.enabled || i.featureImplementation.attached || i.featureImplementation.disableAutoAttach || e.attachFeature(n);\n              });\n            }), this._xrSessionManager.onXRSessionEnded.add(function() {\n              e.getEnabledFeatures().forEach(function(n) {\n                var i = e._features[n];\n                i.enabled && i.featureImplementation.attached && e.detachFeature(n);\n              });\n            });\n          }\n          return r.AddWebXRFeature = function(t, e, n, i) {\n            n === void 0 && (n = 1), i === void 0 && (i = !1), this._AvailableFeatures[t] = this._AvailableFeatures[t] || { latest: n }, n > this._AvailableFeatures[t].latest && (this._AvailableFeatures[t].latest = n), i && (this._AvailableFeatures[t].stable = n), this._AvailableFeatures[t][n] = e;\n          }, r.ConstructFeature = function(t, e, n, i) {\n            e === void 0 && (e = 1);\n            var o = this._AvailableFeatures[t][e];\n            if (!o)\n              throw new Error(\"feature not found\");\n            return o(n, i);\n          }, r.GetAvailableFeatures = function() {\n            return Object.keys(this._AvailableFeatures);\n          }, r.GetAvailableVersions = function(t) {\n            return Object.keys(this._AvailableFeatures[t]);\n          }, r.GetLatestVersionOfFeature = function(t) {\n            return this._AvailableFeatures[t] && this._AvailableFeatures[t].latest || -1;\n          }, r.GetStableVersionOfFeature = function(t) {\n            return this._AvailableFeatures[t] && this._AvailableFeatures[t].stable || -1;\n          }, r.prototype.attachFeature = function(t) {\n            var e = this._features[t];\n            e && e.enabled && !e.featureImplementation.attached && e.featureImplementation.attach();\n          }, r.prototype.detachFeature = function(t) {\n            var e = this._features[t];\n            e && e.featureImplementation.attached && e.featureImplementation.detach();\n          }, r.prototype.disableFeature = function(t) {\n            var e = typeof t == \"string\" ? t : t.Name, n = this._features[e];\n            return !(!n || !n.enabled) && (n.enabled = !1, this.detachFeature(e), n.featureImplementation.dispose(), !0);\n          }, r.prototype.dispose = function() {\n            var t = this;\n            this.getEnabledFeatures().forEach(function(e) {\n              t.disableFeature(e), t._features[e].featureImplementation.dispose();\n            });\n          }, r.prototype.enableFeature = function(t, e, n, i, o) {\n            var a = this;\n            e === void 0 && (e = \"latest\"), n === void 0 && (n = {}), i === void 0 && (i = !0), o === void 0 && (o = !0);\n            var s = typeof t == \"string\" ? t : t.Name, d = 0;\n            if (typeof e == \"string\") {\n              if (!e)\n                throw new Error(\"Error in provided version - \" + s + \" (\" + e + \")\");\n              if ((d = e === \"stable\" ? r.GetStableVersionOfFeature(s) : e === \"latest\" ? r.GetLatestVersionOfFeature(s) : +e) === -1 || isNaN(d))\n                throw new Error(\"feature not found - \" + s + \" (\" + e + \")\");\n            } else\n              d = e;\n            var p = this._features[s], y = r.ConstructFeature(s, d, this._xrSessionManager, n);\n            if (!y)\n              throw new Error(\"feature not found - \" + s);\n            p && this.disableFeature(s);\n            var P = y();\n            if (P.dependsOn && !P.dependsOn.every(function(R) {\n              return !!a._features[R];\n            }))\n              throw new Error(\"Dependant features missing. Make sure the following features are enabled - \" + P.dependsOn.join(\", \"));\n            if (P.isCompatible())\n              return this._features[s] = { featureImplementation: P, enabled: !0, version: d, required: o }, i ? this._xrSessionManager.session && !this._features[s].featureImplementation.attached && this.attachFeature(s) : this._features[s].featureImplementation.disableAutoAttach = !0, this._features[s].featureImplementation;\n            if (o)\n              throw new Error(\"required feature not compatible\");\n            return Xe.b.Warn(\"Feature \" + s + \" not compatible with the current environment/browser and was not enabled.\"), P;\n          }, r.prototype.getEnabledFeature = function(t) {\n            return this._features[t] && this._features[t].featureImplementation;\n          }, r.prototype.getEnabledFeatures = function() {\n            return Object.keys(this._features);\n          }, r.prototype.extendXRSessionInitObject = function(t) {\n            var e = this;\n            return this.getEnabledFeatures().forEach(function(n) {\n              var i = e._features[n], o = i.featureImplementation.xrNativeFeatureName;\n              o && (i.required ? (t.requiredFeatures = t.requiredFeatures || [], t.requiredFeatures.indexOf(o) === -1 && t.requiredFeatures.push(o)) : (t.optionalFeatures = t.optionalFeatures || [], t.optionalFeatures.indexOf(o) === -1 && t.optionalFeatures.push(o)));\n            }), t;\n          }, r._AvailableFeatures = {}, r;\n        }(), ru = function() {\n          function r(t) {\n            var e = this;\n            this.scene = t, this._nonVRCamera = null, this._originalSceneAutoClear = !0, this._supported = !1, this.onInitialXRPoseSetObservable = new C.c(), this.onStateChangedObservable = new C.c(), this.state = fn.NOT_IN_XR, this.sessionManager = new rs(t), this.camera = new iu(\"\", t, this.sessionManager), this.featuresManager = new Wn(this.sessionManager), t.onDisposeObservable.add(function() {\n              e.exitXRAsync();\n            });\n          }\n          return r.CreateAsync = function(t) {\n            var e = new r(t);\n            return e.sessionManager.initializeAsync().then(function() {\n              return e._supported = !0, e;\n            }).catch(function(n) {\n              throw e._setState(fn.NOT_IN_XR), e.dispose(), n;\n            });\n          }, r.prototype.dispose = function() {\n            this.camera.dispose(), this.onStateChangedObservable.clear(), this.onInitialXRPoseSetObservable.clear(), this.sessionManager.dispose(), this._nonVRCamera && (this.scene.activeCamera = this._nonVRCamera);\n          }, r.prototype.enterXRAsync = function(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = this.sessionManager.getWebXRRenderTarget()), i === void 0 && (i = {}), !this._supported)\n              throw \"WebXR not supported in this browser or environment\";\n            return this._setState(fn.ENTERING_XR), e !== \"viewer\" && e !== \"local\" && (i.optionalFeatures = i.optionalFeatures || [], i.optionalFeatures.push(e)), this.featuresManager.extendXRSessionInitObject(i), t === \"immersive-ar\" && e !== \"unbounded\" && l.a.Warn(\"We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode\"), this.sessionManager.initializeSessionAsync(t, i).then(function() {\n              return o.sessionManager.setReferenceSpaceTypeAsync(e);\n            }).then(function() {\n              return n.initializeXRLayerAsync(o.sessionManager.session);\n            }).then(function() {\n              return o.sessionManager.updateRenderStateAsync({ depthFar: o.camera.maxZ, depthNear: o.camera.minZ, baseLayer: n.xrLayer });\n            }).then(function() {\n              return o.sessionManager.runXRRenderLoop(), o._originalSceneAutoClear = o.scene.autoClear, o._nonVRCamera = o.scene.activeCamera, o.scene.activeCamera = o.camera, t !== \"immersive-ar\" ? o._nonXRToXRCamera() : (o.scene.autoClear = !1, o.camera.compensateOnFirstFrame = !1), o.sessionManager.onXRSessionEnded.addOnce(function() {\n                o.camera.rigCameras.forEach(function(a) {\n                  a.outputRenderTarget = null;\n                }), o.scene.autoClear = o._originalSceneAutoClear, o.scene.activeCamera = o._nonVRCamera, t !== \"immersive-ar\" && o.camera.compensateOnFirstFrame && (o._nonVRCamera.setPosition ? o._nonVRCamera.setPosition(o.camera.position) : o._nonVRCamera.position.copyFrom(o.camera.position)), o._setState(fn.NOT_IN_XR);\n              }), o.sessionManager.onXRFrameObservable.addOnce(function() {\n                o._setState(fn.IN_XR);\n              }), o.sessionManager;\n            }).catch(function(a) {\n              throw console.log(a), console.log(a.message), o._setState(fn.NOT_IN_XR), a;\n            });\n          }, r.prototype.exitXRAsync = function() {\n            return this.state !== fn.IN_XR ? Promise.resolve() : (this._setState(fn.EXITING_XR), this.sessionManager.exitXRAsync());\n          }, r.prototype._nonXRToXRCamera = function() {\n            this.camera.setTransformationFromNonVRCamera(this._nonVRCamera), this.onInitialXRPoseSetObservable.notifyObservers(this.camera);\n          }, r.prototype._setState = function(t) {\n            this.state !== t && (this.state = t, this.onStateChangedObservable.notifyObservers(this.state));\n          }, r;\n        }(), yr = function() {\n          function r(t, e, n, i) {\n            n === void 0 && (n = -1), i === void 0 && (i = []), this.id = t, this.type = e, this._buttonIndex = n, this._axesIndices = i, this._axes = { x: 0, y: 0 }, this._changes = {}, this._currentValue = 0, this._hasChanges = !1, this._pressed = !1, this._touched = !1, this.onAxisValueChangedObservable = new C.c(), this.onButtonStateChangedObservable = new C.c();\n          }\n          return Object.defineProperty(r.prototype, \"axes\", { get: function() {\n            return this._axes;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"changes\", { get: function() {\n            return this._changes;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasChanges\", { get: function() {\n            return this._hasChanges;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"pressed\", { get: function() {\n            return this._pressed;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"touched\", { get: function() {\n            return this._touched;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"value\", { get: function() {\n            return this._currentValue;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.onAxisValueChangedObservable.clear(), this.onButtonStateChangedObservable.clear();\n          }, r.prototype.isAxes = function() {\n            return this._axesIndices.length !== 0;\n          }, r.prototype.isButton = function() {\n            return this._buttonIndex !== -1;\n          }, r.prototype.update = function(t) {\n            var e = !1, n = !1;\n            if (this._hasChanges = !1, this._changes = {}, this.isButton()) {\n              var i = t.buttons[this._buttonIndex];\n              if (!i)\n                return;\n              this._currentValue !== i.value && (this.changes.value = { current: i.value, previous: this._currentValue }, e = !0, this._currentValue = i.value), this._touched !== i.touched && (this.changes.touched = { current: i.touched, previous: this._touched }, e = !0, this._touched = i.touched), this._pressed !== i.pressed && (this.changes.pressed = { current: i.pressed, previous: this._pressed }, e = !0, this._pressed = i.pressed);\n            }\n            this.isAxes() && (this._axes.x !== t.axes[this._axesIndices[0]] && (this.changes.axes = { current: { x: t.axes[this._axesIndices[0]], y: this._axes.y }, previous: { x: this._axes.x, y: this._axes.y } }, this._axes.x = t.axes[this._axesIndices[0]], n = !0), this._axes.y !== t.axes[this._axesIndices[1]] && (this.changes.axes ? this.changes.axes.current.y = t.axes[this._axesIndices[1]] : this.changes.axes = { current: { x: this._axes.x, y: t.axes[this._axesIndices[1]] }, previous: { x: this._axes.x, y: this._axes.y } }, this._axes.y = t.axes[this._axesIndices[1]], n = !0)), e && (this._hasChanges = !0, this.onButtonStateChangedObservable.notifyObservers(this)), n && (this._hasChanges = !0, this.onAxisValueChangedObservable.notifyObservers(this._axes));\n          }, r.BUTTON_TYPE = \"button\", r.SQUEEZE_TYPE = \"squeeze\", r.THUMBSTICK_TYPE = \"thumbstick\", r.TOUCHPAD_TYPE = \"touchpad\", r.TRIGGER_TYPE = \"trigger\", r;\n        }(), br = function() {\n          function r(t, e, n, i, o) {\n            var a = this;\n            this.scene = t, this.layout = e, this.gamepadObject = n, this.handedness = i, this._initComponent = function(s) {\n              if (s) {\n                var d = a.layout.components[s], p = d.type, y = d.gamepadIndices.button, P = [];\n                d.gamepadIndices.xAxis !== void 0 && d.gamepadIndices.yAxis !== void 0 && P.push(d.gamepadIndices.xAxis, d.gamepadIndices.yAxis), a.components[s] = new yr(s, p, y, P);\n              }\n            }, this._modelReady = !1, this.components = {}, this.disableAnimation = !1, this.onModelLoadedObservable = new C.c(), e.components && Object.keys(e.components).forEach(this._initComponent);\n          }\n          return r.prototype.dispose = function() {\n            var t = this;\n            this.getComponentIds().forEach(function(e) {\n              return t.getComponent(e).dispose();\n            }), this.rootMesh && this.rootMesh.dispose();\n          }, r.prototype.getAllComponentsOfType = function(t) {\n            var e = this;\n            return this.getComponentIds().map(function(n) {\n              return e.components[n];\n            }).filter(function(n) {\n              return n.type === t;\n            });\n          }, r.prototype.getComponent = function(t) {\n            return this.components[t];\n          }, r.prototype.getComponentIds = function() {\n            return Object.keys(this.components);\n          }, r.prototype.getComponentOfType = function(t) {\n            return this.getAllComponentsOfType(t)[0] || null;\n          }, r.prototype.getMainComponent = function() {\n            return this.getComponent(this.layout.selectComponentId);\n          }, r.prototype.loadModel = function() {\n            return Object(c.b)(this, void 0, void 0, function() {\n              var t, e, n = this;\n              return Object(c.e)(this, function(i) {\n                return t = !this._getModelLoadingConstraints(), e = this._getGenericFilenameAndPath(), t ? l.a.Warn(\"Falling back to generic models\") : e = this._getFilenameAndPath(), [2, new Promise(function(o, a) {\n                  Ft.ImportMesh(\"\", e.path, e.filename, n.scene, function(s) {\n                    t ? n._getGenericParentMesh(s) : n._setRootMesh(s), n._processLoadedModel(s), n._modelReady = !0, n.onModelLoadedObservable.notifyObservers(n), o(!0);\n                  }, null, function(s, d) {\n                    l.a.Log(d), l.a.Warn(\"Failed to retrieve controller model of type \" + n.profileId + \" from the remote server: \" + e.path + e.filename), a(d);\n                  });\n                })];\n              });\n            });\n          }, r.prototype.updateFromXRFrame = function(t) {\n            var e = this;\n            this.getComponentIds().forEach(function(n) {\n              return e.getComponent(n).update(e.gamepadObject);\n            }), this.updateModel(t);\n          }, Object.defineProperty(r.prototype, \"handness\", { get: function() {\n            return this.handedness;\n          }, enumerable: !1, configurable: !0 }), r.prototype.pulse = function(t, e, n) {\n            return n === void 0 && (n = 0), this.gamepadObject.hapticActuators && this.gamepadObject.hapticActuators[n] ? this.gamepadObject.hapticActuators[n].pulse(t, e) : Promise.resolve(!1);\n          }, r.prototype._getChildByName = function(t, e) {\n            return t.getChildren(function(n) {\n              return n.name === e;\n            }, !1)[0];\n          }, r.prototype._getImmediateChildByName = function(t, e) {\n            return t.getChildren(function(n) {\n              return n.name == e;\n            }, !0)[0];\n          }, r.prototype._lerpTransform = function(t, e, n) {\n            if (t.minMesh && t.maxMesh && t.valueMesh && t.minMesh.rotationQuaternion && t.maxMesh.rotationQuaternion && t.valueMesh.rotationQuaternion) {\n              var i = n ? 0.5 * e + 0.5 : e;\n              u.b.SlerpToRef(t.minMesh.rotationQuaternion, t.maxMesh.rotationQuaternion, i, t.valueMesh.rotationQuaternion), u.e.LerpToRef(t.minMesh.position, t.maxMesh.position, i, t.valueMesh.position);\n            }\n          }, r.prototype.updateModel = function(t) {\n            this._modelReady && this._updateModel(t);\n          }, r.prototype._getGenericFilenameAndPath = function() {\n            return { filename: \"generic.babylon\", path: \"https://controllers.babylonjs.com/generic/\" };\n          }, r.prototype._getGenericParentMesh = function(t) {\n            var e = this;\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), t.forEach(function(n) {\n              n.parent || (n.isPickable = !1, n.setParent(e.rootMesh));\n            }), this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0);\n          }, r;\n        }(), Rs = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, Wp[i], n, i) || this;\n            return o.profileId = t.ProfileId, o;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: \"generic.babylon\", path: \"https://controllers.babylonjs.com/generic/\" };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            return !0;\n          }, t.prototype._processLoadedModel = function(e) {\n          }, t.prototype._setRootMesh = function(e) {\n            var n = this;\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), e.forEach(function(i) {\n              i.isPickable = !1, i.parent || i.setParent(n.rootMesh);\n            }), this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0);\n          }, t.prototype._updateModel = function() {\n          }, t.ProfileId = \"generic-trigger\", t;\n        }(br), Wp = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"generic-trigger-left\", assetPath: \"left.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"generic-trigger-right\", assetPath: \"right.glb\" }, none: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"generic-trigger-none\", assetPath: \"none.glb\" } }, ou = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, i.layouts[n.handedness || \"none\"], n.gamepad, n.handedness) || this;\n            return a._repositoryUrl = o, a._buttonMeshMapping = {}, a._touchDots = {}, a.profileId = i.profileId, a;\n          }\n          return Object(c.d)(t, r), t.prototype.dispose = function() {\n            var e = this;\n            r.prototype.dispose.call(this), Object.keys(this._touchDots).forEach(function(n) {\n              e._touchDots[n].dispose();\n            });\n          }, t.prototype._getFilenameAndPath = function() {\n            return { filename: this.layout.assetPath, path: this._repositoryUrl + \"/profiles/\" + this.profileId + \"/\" };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            var e = Ft.IsPluginForExtensionAvailable(\".glb\");\n            return e || l.a.Warn(\"glTF / glb loaded was not registered, using generic controller instead\"), e;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this;\n            this.getComponentIds().forEach(function(i) {\n              var o = n.layout.components[i];\n              n._buttonMeshMapping[i] = { mainMesh: n._getChildByName(n.rootMesh, o.rootNodeName), states: {} }, Object.keys(o.visualResponses).forEach(function(a) {\n                var s = o.visualResponses[a];\n                if (s.valueNodeProperty === \"transform\")\n                  n._buttonMeshMapping[i].states[a] = { valueMesh: n._getChildByName(n.rootMesh, s.valueNodeName), minMesh: n._getChildByName(n.rootMesh, s.minNodeName), maxMesh: n._getChildByName(n.rootMesh, s.maxNodeName) };\n                else {\n                  var d = o.type === yr.TOUCHPAD_TYPE && o.touchPointNodeName ? o.touchPointNodeName : s.valueNodeName;\n                  if (n._buttonMeshMapping[i].states[a] = { valueMesh: n._getChildByName(n.rootMesh, d) }, o.type === yr.TOUCHPAD_TYPE && !n._touchDots[a]) {\n                    var p = Nn.a.CreateSphere(a + \"dot\", { diameter: 15e-4, segments: 8 }, n.scene);\n                    p.material = new Nt.a(a + \"mat\", n.scene), p.material.diffuseColor = I.a.Red(), p.parent = n._buttonMeshMapping[i].states[a].valueMesh || null, p.isVisible = !1, n._touchDots[a] = p;\n                  }\n                }\n              });\n            });\n          }, t.prototype._setRootMesh = function(e) {\n            var n;\n            this.rootMesh = new Ie.a(this.profileId + \"-\" + this.handedness, this.scene), this.rootMesh.isPickable = !1;\n            for (var i = 0; i < e.length; i++) {\n              var o = e[i];\n              o.isPickable = !1, o.parent || (n = o);\n            }\n            n && n.setParent(this.rootMesh), this.scene.useRightHandedSystem || this.rootMesh.rotate(be.a.Y, Math.PI, be.c.WORLD);\n          }, t.prototype._updateModel = function(e) {\n            var n = this;\n            this.disableAnimation || this.getComponentIds().forEach(function(i) {\n              var o = n.getComponent(i);\n              if (o.hasChanges) {\n                var a = n._buttonMeshMapping[i], s = n.layout.components[i];\n                Object.keys(s.visualResponses).forEach(function(d) {\n                  var p = s.visualResponses[d], y = o.value;\n                  if (p.componentProperty === \"xAxis\" ? y = o.axes.x : p.componentProperty === \"yAxis\" && (y = o.axes.y), p.valueNodeProperty === \"transform\")\n                    n._lerpTransform(a.states[d], y, p.componentProperty !== \"button\");\n                  else {\n                    var P = a.states[d].valueMesh;\n                    P && (P.isVisible = o.touched || o.pressed), n._touchDots[d] && (n._touchDots[d].isVisible = o.touched || o.pressed);\n                  }\n                });\n              }\n            });\n          }, t;\n        }(br), wn = function() {\n          function r() {\n          }\n          return r.ClearProfilesCache = function() {\n            this._ProfilesList = null, this._ProfileLoadingPromises = {};\n          }, r.DefaultFallbacks = function() {\n            this.RegisterFallbacksForProfileId(\"google-daydream\", [\"generic-touchpad\"]), this.RegisterFallbacksForProfileId(\"htc-vive-focus\", [\"generic-trigger-touchpad\"]), this.RegisterFallbacksForProfileId(\"htc-vive\", [\"generic-trigger-squeeze-touchpad\"]), this.RegisterFallbacksForProfileId(\"magicleap-one\", [\"generic-trigger-squeeze-touchpad\"]), this.RegisterFallbacksForProfileId(\"windows-mixed-reality\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]), this.RegisterFallbacksForProfileId(\"microsoft-mixed-reality\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]), this.RegisterFallbacksForProfileId(\"oculus-go\", [\"generic-trigger-touchpad\"]), this.RegisterFallbacksForProfileId(\"oculus-touch-v2\", [\"oculus-touch\", \"generic-trigger-squeeze-thumbstick\"]), this.RegisterFallbacksForProfileId(\"oculus-touch\", [\"generic-trigger-squeeze-thumbstick\"]), this.RegisterFallbacksForProfileId(\"samsung-gearvr\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]), this.RegisterFallbacksForProfileId(\"samsung-odyssey\", [\"generic-touchpad\"]), this.RegisterFallbacksForProfileId(\"valve-index\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]);\n          }, r.FindFallbackWithProfileId = function(t) {\n            var e = this._Fallbacks[t] || [];\n            return e.unshift(t), e;\n          }, r.GetMotionControllerWithXRInput = function(t, e, n) {\n            var i = this, o = [];\n            if (n && o.push(n), o.push.apply(o, t.profiles || []), o.length && !o[0] && o.pop(), t.gamepad && t.gamepad.id)\n              switch (t.gamepad.id) {\n                case (t.gamepad.id.match(/oculus touch/gi) ? t.gamepad.id : void 0):\n                  o.push(\"oculus-touch-v2\");\n              }\n            var a = o.indexOf(\"windows-mixed-reality\");\n            if (a !== -1 && o.splice(a, 0, \"microsoft-mixed-reality\"), o.length || o.push(\"generic-trigger\"), this.UseOnlineRepository) {\n              var s = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers, d = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;\n              return s.call(this, o, t, e).catch(function() {\n                return d.call(i, o, t, e);\n              });\n            }\n            return this._LoadProfilesFromAvailableControllers(o, t, e);\n          }, r.RegisterController = function(t, e) {\n            this._AvailableControllers[t] = e;\n          }, r.RegisterFallbacksForProfileId = function(t, e) {\n            var n;\n            this._Fallbacks[t] ? (n = this._Fallbacks[t]).push.apply(n, e) : this._Fallbacks[t] = e;\n          }, r.UpdateProfilesList = function() {\n            return this._ProfilesList = Xe.b.LoadFileAsync(this.BaseRepositoryUrl + \"/profiles/profilesList.json\", !1).then(function(t) {\n              return JSON.parse(t.toString());\n            }), this._ProfilesList;\n          }, r._LoadProfileFromRepository = function(t, e, n) {\n            var i = this;\n            return Promise.resolve().then(function() {\n              return i._ProfilesList ? i._ProfilesList : i.UpdateProfilesList();\n            }).then(function(o) {\n              for (var a = 0; a < t.length; ++a)\n                if (t[a] && o[t[a]])\n                  return t[a];\n              throw new Error(\"neither controller \" + t[0] + \" nor all fallbacks were found in the repository,\");\n            }).then(function(o) {\n              return i._ProfileLoadingPromises[o] || (i._ProfileLoadingPromises[o] = Xe.b.LoadFileAsync(i.BaseRepositoryUrl + \"/profiles/\" + o + \"/profile.json\", !1).then(function(a) {\n                return JSON.parse(a);\n              })), i._ProfileLoadingPromises[o];\n            }).then(function(o) {\n              return new ou(n, e, o, i.BaseRepositoryUrl);\n            });\n          }, r._LoadProfilesFromAvailableControllers = function(t, e, n) {\n            for (var i = 0; i < t.length; ++i)\n              if (t[i])\n                for (var o = this.FindFallbackWithProfileId(t[i]), a = 0; a < o.length; ++a) {\n                  var s = this._AvailableControllers[o[a]];\n                  if (s)\n                    return Promise.resolve(s(e, n));\n                }\n            throw new Error(\"no controller requested was found in the available controllers list\");\n          }, r._AvailableControllers = {}, r._Fallbacks = {}, r._ProfileLoadingPromises = {}, r.BaseRepositoryUrl = \"https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist\", r.PrioritizeOnlineRepository = !0, r.UseOnlineRepository = !0, r;\n        }();\n        wn.RegisterController(Rs.ProfileId, function(r, t) {\n          return new Rs(t, r.gamepad, r.handedness);\n        }), wn.DefaultFallbacks();\n        var Xp = 0, au = function() {\n          function r(t, e, n) {\n            var i = this;\n            n === void 0 && (n = {}), this._scene = t, this.inputSource = e, this._options = n, this._tmpVector = new u.e(), this._disposed = !1, this.onDisposeObservable = new C.c(), this.onMeshLoadedObservable = new C.c(), this.onMotionControllerInitObservable = new C.c(), this._uniqueId = \"controller-\" + Xp++ + \"-\" + e.targetRayMode + \"-\" + e.handedness, this.pointer = new Mt.a(this._uniqueId + \"-pointer\", t), this.pointer.rotationQuaternion = new u.b(), this.inputSource.gripSpace && (this.grip = new Mt.a(this._uniqueId + \"-grip\", this._scene), this.grip.rotationQuaternion = new u.b()), this._tmpVector.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), this.inputSource.gamepad && wn.GetMotionControllerWithXRInput(e, t, this._options.forceControllerProfile).then(function(o) {\n              i.motionController = o, i.onMotionControllerInitObservable.notifyObservers(o), i._options.doNotLoadControllerMesh || i.motionController.loadModel().then(function(a) {\n                var s;\n                a && i.motionController && i.motionController.rootMesh && (i._options.renderingGroupId && (i.motionController.rootMesh.renderingGroupId = i._options.renderingGroupId, i.motionController.rootMesh.getChildMeshes(!1).forEach(function(d) {\n                  return d.renderingGroupId = i._options.renderingGroupId;\n                })), i.onMeshLoadedObservable.notifyObservers(i.motionController.rootMesh), i.motionController.rootMesh.parent = i.grip || i.pointer, i.motionController.disableAnimation = !!i._options.disableMotionControllerAnimation), i._disposed && ((s = i.motionController) === null || s === void 0 || s.dispose());\n              });\n            }, function() {\n              Xe.b.Warn(\"Could not find a matching motion controller for the registered input source\");\n            });\n          }\n          return Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.grip && this.grip.dispose(), this.motionController && this.motionController.dispose(), this.pointer.dispose(), this.onMotionControllerInitObservable.clear(), this.onMeshLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._disposed = !0;\n          }, r.prototype.getWorldPointerRayToRef = function(t, e) {\n            e === void 0 && (e = !1);\n            var n = e && this.grip ? this.grip : this.pointer;\n            u.e.TransformNormalToRef(this._tmpVector, n.getWorldMatrix(), t.direction), t.direction.normalize(), t.origin.copyFrom(n.absolutePosition), t.length = 1e3;\n          }, r.prototype.updateFromXRFrame = function(t, e) {\n            var n = t.getPose(this.inputSource.targetRaySpace, e);\n            if (n) {\n              var i = n.transform.position;\n              this.pointer.position.set(i.x, i.y, i.z);\n              var o = n.transform.orientation;\n              this.pointer.rotationQuaternion.set(o.x, o.y, o.z, o.w), this._scene.useRightHandedSystem || (this.pointer.position.z *= -1, this.pointer.rotationQuaternion.z *= -1, this.pointer.rotationQuaternion.w *= -1);\n            }\n            if (this.inputSource.gripSpace && this.grip) {\n              var a = t.getPose(this.inputSource.gripSpace, e);\n              if (a) {\n                i = a.transform.position;\n                var s = a.transform.orientation;\n                this.grip.position.set(i.x, i.y, i.z), this.grip.rotationQuaternion.set(s.x, s.y, s.z, s.w), this._scene.useRightHandedSystem || (this.grip.position.z *= -1, this.grip.rotationQuaternion.z *= -1, this.grip.rotationQuaternion.w *= -1);\n              }\n            }\n            this.motionController && this.motionController.updateFromXRFrame(t);\n          }, r;\n        }(), su = function() {\n          function r(t, e, n) {\n            var i = this;\n            if (n === void 0 && (n = {}), this.xrSessionManager = t, this.xrCamera = e, this.options = n, this.controllers = [], this.onControllerAddedObservable = new C.c(), this.onControllerRemovedObservable = new C.c(), this._onInputSourcesChange = function(o) {\n              i._addAndRemoveControllers(o.added, o.removed);\n            }, this._sessionEndedObserver = this.xrSessionManager.onXRSessionEnded.add(function() {\n              i._addAndRemoveControllers([], i.controllers.map(function(o) {\n                return o.inputSource;\n              }));\n            }), this._sessionInitObserver = this.xrSessionManager.onXRSessionInit.add(function(o) {\n              o.addEventListener(\"inputsourceschange\", i._onInputSourcesChange);\n            }), this._frameObserver = this.xrSessionManager.onXRFrameObservable.add(function(o) {\n              i.controllers.forEach(function(a) {\n                a.updateFromXRFrame(o, i.xrSessionManager.referenceSpace);\n              });\n            }), this.options.customControllersRepositoryURL && (wn.BaseRepositoryUrl = this.options.customControllersRepositoryURL), wn.UseOnlineRepository = !this.options.disableOnlineControllerRepository, wn.UseOnlineRepository)\n              try {\n                wn.UpdateProfilesList().catch(function() {\n                  wn.UseOnlineRepository = !1;\n                });\n              } catch {\n                wn.UseOnlineRepository = !1;\n              }\n          }\n          return r.prototype._addAndRemoveControllers = function(t, e) {\n            for (var n = this, i = this.controllers.map(function(P) {\n              return P.inputSource;\n            }), o = 0, a = t; o < a.length; o++) {\n              var s = a[o];\n              if (i.indexOf(s) === -1) {\n                var d = new au(this.xrSessionManager.scene, s, Object(c.a)(Object(c.a)({}, this.options.controllerOptions || {}), { forceControllerProfile: this.options.forceInputProfile, doNotLoadControllerMesh: this.options.doNotLoadControllerMeshes, disableMotionControllerAnimation: this.options.disableControllerAnimation }));\n                this.controllers.push(d), this.onControllerAddedObservable.notifyObservers(d);\n              }\n            }\n            var p = [], y = [];\n            this.controllers.forEach(function(P) {\n              e.indexOf(P.inputSource) === -1 ? p.push(P) : y.push(P);\n            }), this.controllers = p, y.forEach(function(P) {\n              n.onControllerRemovedObservable.notifyObservers(P), P.dispose();\n            });\n          }, r.prototype.dispose = function() {\n            this.controllers.forEach(function(t) {\n              t.dispose();\n            }), this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver), this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver), this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver), this.onControllerAddedObservable.clear(), this.onControllerRemovedObservable.clear();\n          }, r;\n        }(), ni = function() {\n          function r(t) {\n            this._xrSessionManager = t, this._attached = !1, this._removeOnDetach = [], this.isDisposed = !1, this.disableAutoAttach = !1, this.xrNativeFeatureName = \"\";\n          }\n          return Object.defineProperty(r.prototype, \"attached\", { get: function() {\n            return this._attached;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attach = function(t) {\n            var e = this;\n            if (this.isDisposed)\n              return !1;\n            if (t)\n              this.attached && this.detach();\n            else if (this.attached)\n              return !1;\n            return this._attached = !0, this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable, function(n) {\n              return e._onXRFrame(n);\n            }), !0;\n          }, r.prototype.detach = function() {\n            return this._attached ? (this._attached = !1, this._removeOnDetach.forEach(function(t) {\n              t.observable.remove(t.observer);\n            }), !0) : (this.disableAutoAttach = !0, !1);\n          }, r.prototype.dispose = function() {\n            this.detach(), this.isDisposed = !0;\n          }, r.prototype.isCompatible = function() {\n            return !0;\n          }, r.prototype._addNewAttachObserver = function(t, e) {\n            this._removeOnDetach.push({ observable: t, observer: t.add(e) });\n          }, r;\n        }(), eo = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i._options = n, i._attachController = function(o) {\n              if (!i._controllers[o.uniqueId]) {\n                var a = i._generateNewMeshPair(o.pointer), s = a.laserPointer, d = a.selectionMesh;\n                switch (i._controllers[o.uniqueId] = { xrController: o, laserPointer: s, selectionMesh: d, meshUnderPointer: null, pick: null, tmpRay: new dn.a(new u.e(), new u.e()), id: t._idCounter++ }, i._attachedController ? !i._options.enablePointerSelectionOnAllControllers && i._options.preferredHandedness && o.inputSource.handedness === i._options.preferredHandedness && (i._attachedController = o.uniqueId) : i._options.enablePointerSelectionOnAllControllers || (i._attachedController = o.uniqueId), o.inputSource.targetRayMode) {\n                  case \"tracked-pointer\":\n                    return i._attachTrackedPointerRayMode(o);\n                  case \"gaze\":\n                    return i._attachGazeMode(o);\n                  case \"screen\":\n                    return i._attachScreenRayMode(o);\n                }\n              }\n            }, i._controllers = {}, i._tmpVectorForPickCompare = new u.e(), i.disablePointerLighting = !0, i.disableSelectionMeshLighting = !0, i.displayLaserPointer = !0, i.displaySelectionMesh = !0, i.laserPointerPickedColor = new I.a(0.9, 0.9, 0.9), i.laserPointerDefaultColor = new I.a(0.7, 0.7, 0.7), i.selectionMeshDefaultColor = new I.a(0.8, 0.8, 0.8), i.selectionMeshPickedColor = new I.a(0.3, 0.3, 1), i._identityMatrix = u.a.Identity(), i._screenCoordinatesRef = u.e.Zero(), i._viewportRef = new jn.a(0, 0, 0, 0), i._scene = i._xrSessionManager.scene, i;\n          }\n          return Object(c.d)(t, r), t.prototype.attach = function() {\n            var e = this;\n            if (!r.prototype.attach.call(this))\n              return !1;\n            if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, function(s) {\n              e._detachController(s.uniqueId);\n            }), this._scene.constantlyUpdateMeshUnderPointer = !0, this._options.gazeCamera) {\n              var n = this._options.gazeCamera, i = this._generateNewMeshPair(n), o = i.laserPointer, a = i.selectionMesh;\n              this._controllers.camera = { webXRCamera: n, laserPointer: o, selectionMesh: a, meshUnderPointer: null, pick: null, tmpRay: new dn.a(new u.e(), new u.e()), id: t._idCounter++ }, this._attachGazeMode();\n            }\n            return !0;\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._controllers).forEach(function(n) {\n              e._detachController(n);\n            }), !0);\n          }, t.prototype.getMeshUnderPointer = function(e) {\n            return this._controllers[e] ? this._controllers[e].meshUnderPointer : null;\n          }, t.prototype.getXRControllerByPointerId = function(e) {\n            for (var n = Object.keys(this._controllers), i = 0; i < n.length; ++i)\n              if (this._controllers[n[i]].id === e)\n                return this._controllers[n[i]].xrController || null;\n            return null;\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            Object.keys(this._controllers).forEach(function(i) {\n              var o, a = n._controllers[i];\n              if (!n._options.enablePointerSelectionOnAllControllers && i !== n._attachedController)\n                return a.selectionMesh.isVisible = !1, a.laserPointer.isVisible = !1, void (a.pick = null);\n              if (a.laserPointer.isVisible = n.displayLaserPointer, a.xrController)\n                o = a.xrController.pointer.position, a.xrController.getWorldPointerRayToRef(a.tmpRay);\n              else {\n                if (!a.webXRCamera)\n                  return;\n                o = a.webXRCamera.position, a.webXRCamera.getForwardRayToRef(a.tmpRay);\n              }\n              if (n._options.maxPointerDistance && (a.tmpRay.length = n._options.maxPointerDistance), !n._options.disableScenePointerVectorUpdate && o) {\n                var s = n._xrSessionManager.scene, d = n._options.xrInput.xrCamera;\n                d && (d.viewport.toGlobalToRef(s.getEngine().getRenderWidth(), s.getEngine().getRenderHeight(), n._viewportRef), u.e.ProjectToRef(o, n._identityMatrix, s.getTransformMatrix(), n._viewportRef, n._screenCoordinatesRef), s.pointerX = n._screenCoordinatesRef.x, s.pointerY = n._screenCoordinatesRef.y);\n              }\n              a.pick = n._scene.pickWithRay(a.tmpRay, n._scene.pointerMovePredicate || n.raySelectionPredicate);\n              var p = a.pick;\n              if (p && p.pickedPoint && p.hit) {\n                n._updatePointerDistance(a.laserPointer, p.distance), a.selectionMesh.position.copyFrom(p.pickedPoint), a.selectionMesh.scaling.x = Math.sqrt(p.distance), a.selectionMesh.scaling.y = Math.sqrt(p.distance), a.selectionMesh.scaling.z = Math.sqrt(p.distance);\n                var y = n._convertNormalToDirectionOfRay(p.getNormal(!0), a.tmpRay);\n                if (a.selectionMesh.position.copyFrom(p.pickedPoint), y) {\n                  var P = u.e.Cross(be.a.Y, y), R = u.e.Cross(y, P);\n                  u.e.RotationFromAxisToRef(R, y, P, a.selectionMesh.rotation), a.selectionMesh.position.addInPlace(y.scale(1e-3));\n                }\n                a.selectionMesh.isVisible = n.displaySelectionMesh, a.meshUnderPointer = p.pickedMesh;\n              } else\n                a.selectionMesh.isVisible = !1, n._updatePointerDistance(a.laserPointer, 1), a.meshUnderPointer = null;\n            });\n          }, t.prototype._attachGazeMode = function(e) {\n            var n = this, i = this._controllers[e && e.uniqueId || \"camera\"], o = this._options.timeToSelect || 3e3, a = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Cn.a.DefaultUtilityLayer.utilityLayerScene : this._scene, s = new Yi.a(), d = lr.CreateTorus(\"selection\", { diameter: 0.0525, thickness: 0.015, tessellation: 20 }, a);\n            d.isVisible = !1, d.isPickable = !1, d.parent = i.selectionMesh;\n            var p = 0, y = !1;\n            i.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function() {\n              if (i.pick) {\n                if (i.laserPointer.material.alpha = 0, d.isVisible = !1, i.pick.hit)\n                  if (n._pickingMoved(s, i.pick))\n                    y && (n._options.disablePointerUpOnTouchOut || n._scene.simulatePointerUp(i.pick, { pointerId: i.id })), y = !1, p = 0;\n                  else if (p > o / 10 && (d.isVisible = !0), (p += n._scene.getEngine().getDeltaTime()) >= o)\n                    n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), y = !0, n._options.disablePointerUpOnTouchOut && n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), d.isVisible = !1;\n                  else {\n                    var P = 1 - p / o;\n                    d.scaling.set(P, P, P);\n                  }\n                else\n                  y = !1, p = 0;\n                n._scene.simulatePointerMove(i.pick, { pointerId: i.id }), s = i.pick;\n              }\n            }), this._options.renderingGroupId !== void 0 && (d.renderingGroupId = this._options.renderingGroupId), e && e.onDisposeObservable.addOnce(function() {\n              i.pick && !n._options.disablePointerUpOnTouchOut && y && n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), d.dispose();\n            });\n          }, t.prototype._attachScreenRayMode = function(e) {\n            var n = this, i = this._controllers[e.uniqueId], o = !1;\n            i.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function() {\n              !i.pick || n._options.disablePointerUpOnTouchOut && o || (o ? n._scene.simulatePointerMove(i.pick, { pointerId: i.id }) : (n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), o = !0, n._options.disablePointerUpOnTouchOut && n._scene.simulatePointerUp(i.pick, { pointerId: i.id })));\n            }), e.onDisposeObservable.addOnce(function() {\n              i.pick && o && !n._options.disablePointerUpOnTouchOut && n._scene.simulatePointerUp(i.pick, { pointerId: i.id });\n            });\n          }, t.prototype._attachTrackedPointerRayMode = function(e) {\n            var n = this, i = this._controllers[e.uniqueId];\n            if (this._options.forceGazeMode)\n              return this._attachGazeMode(e);\n            if (i.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function() {\n              i.laserPointer.material.disableLighting = n.disablePointerLighting, i.selectionMesh.material.disableLighting = n.disableSelectionMeshLighting, i.pick && n._scene.simulatePointerMove(i.pick, { pointerId: i.id });\n            }), e.inputSource.gamepad) {\n              var o = function(d) {\n                n._options.overrideButtonId && (i.selectionComponent = d.getComponent(n._options.overrideButtonId)), i.selectionComponent || (i.selectionComponent = d.getMainComponent()), i.onButtonChangedObserver = i.selectionComponent.onButtonStateChangedObservable.add(function(p) {\n                  if (p.changes.pressed) {\n                    var y = p.changes.pressed.current;\n                    i.pick ? (n._options.enablePointerSelectionOnAllControllers || e.uniqueId === n._attachedController) && (y ? (n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshPickedColor, i.laserPointer.material.emissiveColor = n.laserPointerPickedColor) : (n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshDefaultColor, i.laserPointer.material.emissiveColor = n.laserPointerDefaultColor)) : !y || n._options.enablePointerSelectionOnAllControllers || n._options.disableSwitchOnClick || (n._attachedController = e.uniqueId);\n                  }\n                });\n              };\n              e.motionController ? o(e.motionController) : e.onMotionControllerInitObservable.add(o);\n            } else {\n              var a = function(d) {\n                i.xrController && d.inputSource === i.xrController.inputSource && i.pick && (n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshPickedColor, i.laserPointer.material.emissiveColor = n.laserPointerPickedColor);\n              }, s = function(d) {\n                i.xrController && d.inputSource === i.xrController.inputSource && i.pick && (n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshDefaultColor, i.laserPointer.material.emissiveColor = n.laserPointerDefaultColor);\n              };\n              i.eventListeners = { selectend: s, selectstart: a }, this._xrSessionManager.session.addEventListener(\"selectstart\", a), this._xrSessionManager.session.addEventListener(\"selectend\", s);\n            }\n          }, t.prototype._convertNormalToDirectionOfRay = function(e, n) {\n            return e && Math.acos(u.e.Dot(e, n.direction)) < Math.PI / 2 && e.scaleInPlace(-1), e;\n          }, t.prototype._detachController = function(e) {\n            var n = this, i = this._controllers[e];\n            if (i && (i.selectionComponent && i.onButtonChangedObserver && i.selectionComponent.onButtonStateChangedObservable.remove(i.onButtonChangedObserver), i.onFrameObserver && this._xrSessionManager.onXRFrameObservable.remove(i.onFrameObserver), i.eventListeners && Object.keys(i.eventListeners).forEach(function(a) {\n              var s = i.eventListeners && i.eventListeners[a];\n              s && n._xrSessionManager.session.removeEventListener(a, s);\n            }), i.selectionMesh.dispose(), i.laserPointer.dispose(), delete this._controllers[e], this._attachedController === e)) {\n              var o = Object.keys(this._controllers);\n              o.length ? this._attachedController = o[0] : this._attachedController = \"\";\n            }\n          }, t.prototype._generateNewMeshPair = function(e) {\n            var n = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Cn.a.DefaultUtilityLayer.utilityLayerScene : this._scene, i = ci.a.CreateCylinder(\"laserPointer\", { height: 1, diameterTop: 2e-4, diameterBottom: 4e-3, tessellation: 20, subdivisions: 1 }, n);\n            i.parent = e;\n            var o = new Nt.a(\"laserPointerMat\", n);\n            o.emissiveColor = this.laserPointerDefaultColor, o.alpha = 0.7, i.material = o, i.rotation.x = Math.PI / 2, this._updatePointerDistance(i, 1), i.isPickable = !1;\n            var a = lr.CreateTorus(\"gazeTracker\", { diameter: 0.0105, thickness: 75e-4, tessellation: 20 }, n);\n            a.bakeCurrentTransformIntoVertices(), a.isPickable = !1, a.isVisible = !1;\n            var s = new Nt.a(\"targetMat\", n);\n            return s.specularColor = I.a.Black(), s.emissiveColor = this.selectionMeshDefaultColor, s.backFaceCulling = !1, a.material = s, this._options.renderingGroupId !== void 0 && (i.renderingGroupId = this._options.renderingGroupId, a.renderingGroupId = this._options.renderingGroupId), { laserPointer: i, selectionMesh: a };\n          }, t.prototype._pickingMoved = function(e, n) {\n            var i;\n            if (!e.hit || !n.hit || !(e.pickedMesh && e.pickedPoint && n.pickedMesh && n.pickedPoint) || e.pickedMesh !== n.pickedMesh)\n              return !0;\n            (i = e.pickedPoint) === null || i === void 0 || i.subtractToRef(n.pickedPoint, this._tmpVectorForPickCompare), this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x), Math.abs(this._tmpVectorForPickCompare.y), Math.abs(this._tmpVectorForPickCompare.z));\n            var o = 0.01 * (this._options.gazeModePointerMovedFactor || 1) * n.distance;\n            return this._tmpVectorForPickCompare.length() > o;\n          }, t.prototype._updatePointerDistance = function(e, n) {\n            n === void 0 && (n = 100), e.scaling.y = n, this._scene.useRightHandedSystem && (n *= -1), e.position.z = n / 2 + 0.05;\n          }, Object.defineProperty(t.prototype, \"lasterPointerDefaultColor\", { get: function() {\n            return this.laserPointerDefaultColor;\n          }, enumerable: !1, configurable: !0 }), t._idCounter = 200, t.Name = ti.POINTER_SELECTION, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(eo.Name, function(r, t) {\n          return function() {\n            return new eo(r, t);\n          };\n        }, eo.Version, !0);\n        var Li, cu = function() {\n          function r(t, e, n) {\n            this.element = t, this.sessionMode = e, this.referenceSpaceType = n;\n          }\n          return r.prototype.update = function(t) {\n          }, r;\n        }(), Yp = function() {\n        }, lu = function() {\n          function r(t, e) {\n            var n = this;\n            if (this.scene = t, this.options = e, this._activeButton = null, this._buttons = [], this.activeButtonChangedObservable = new C.c(), this.overlay = document.createElement(\"div\"), this.overlay.classList.add(\"xr-button-overlay\"), this.overlay.style.cssText = \"z-index:11;position: absolute; right: 20px;bottom: 50px;\", typeof window < \"u\" && window.location && window.location.protocol === \"http:\" && Xe.b.Warn(\"WebXR can only be served over HTTPS\"), e.customButtons)\n              this._buttons = e.customButtons;\n            else {\n              var i = e.sessionMode || \"immersive-vr\", o = e.referenceSpaceType || \"local-floor\", a = \".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(\" + (typeof SVGSVGElement > \"u\" ? \"https://cdn.babylonjs.com/Assets/vrButton.png\" : \"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A\") + \"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }\";\n              a += '.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: \"EXIT\"} .xr-error::after { content: \"ERROR\"}';\n              var s = document.createElement(\"style\");\n              s.appendChild(document.createTextNode(a)), document.getElementsByTagName(\"head\")[0].appendChild(s);\n              var d = document.createElement(\"button\");\n              d.className = \"babylonVRicon\", d.title = i + \" - \" + o, this._buttons.push(new cu(d, i, o)), this._buttons[this._buttons.length - 1].update = function(y) {\n                this.element.style.display = y === null || y === this ? \"\" : \"none\", d.className = \"babylonVRicon\" + (y === this ? \" vrdisplaypresenting\" : \"\");\n              }, this._updateButtons(null);\n            }\n            var p = t.getEngine().getInputElement();\n            p && p.parentNode && (p.parentNode.appendChild(this.overlay), t.onDisposeObservable.addOnce(function() {\n              n.dispose();\n            }));\n          }\n          return r.CreateAsync = function(t, e, n) {\n            var i = this, o = new r(t, n), a = o._buttons.map(function(s) {\n              return e.sessionManager.isSessionSupportedAsync(s.sessionMode);\n            });\n            return e.onStateChangedObservable.add(function(s) {\n              s == fn.NOT_IN_XR && o._updateButtons(null);\n            }), Promise.all(a).then(function(s) {\n              return s.forEach(function(d, p) {\n                d ? (o.overlay.appendChild(o._buttons[p].element), o._buttons[p].element.onclick = function() {\n                  return Object(c.b)(i, void 0, void 0, function() {\n                    var y, P, R;\n                    return Object(c.e)(this, function(B) {\n                      switch (B.label) {\n                        case 0:\n                          return e.state != fn.IN_XR ? [3, 2] : [4, e.exitXRAsync()];\n                        case 1:\n                          return B.sent(), o._updateButtons(null), [3, 6];\n                        case 2:\n                          if (e.state != fn.NOT_IN_XR)\n                            return [3, 6];\n                          if (!n.renderTarget)\n                            return [3, 6];\n                          B.label = 3;\n                        case 3:\n                          return B.trys.push([3, 5, , 6]), [4, e.enterXRAsync(o._buttons[p].sessionMode, o._buttons[p].referenceSpaceType, n.renderTarget, { optionalFeatures: n.optionalFeatures, requiredFeatures: n.requiredFeatures })];\n                        case 4:\n                          return B.sent(), o._updateButtons(o._buttons[p]), [3, 6];\n                        case 5:\n                          return y = B.sent(), o._updateButtons(null), P = o._buttons[p].element, R = P.title, P.title = \"Error entering XR session : \" + R, P.classList.add(\"xr-error\"), n.onError && n.onError(y), [3, 6];\n                        case 6:\n                          return [2];\n                      }\n                    });\n                  });\n                }) : Xe.b.Warn('Session mode \"' + o._buttons[p].sessionMode + '\" not supported in browser');\n              }), o;\n            });\n          }, r.prototype.dispose = function() {\n            var t = this.scene.getEngine().getInputElement();\n            t && t.parentNode && t.parentNode.contains(this.overlay) && t.parentNode.removeChild(this.overlay), this.activeButtonChangedObservable.clear();\n          }, r.prototype._updateButtons = function(t) {\n            var e = this;\n            this._activeButton = t, this._buttons.forEach(function(n) {\n              n.update(e._activeButton);\n            }), this.activeButtonChangedObservable.notifyObservers(this._activeButton);\n          }, r;\n        }();\n        function Os(r) {\n          var t, e = 0, n = Date.now();\n          r.observableParameters = (t = r.observableParameters) !== null && t !== void 0 ? t : {};\n          var i = r.contextObservable.add(function(o) {\n            var a = Date.now(), s = { startTime: n, currentTime: a, deltaTime: e = a - n, completeRate: e / r.timeout, payload: o };\n            r.onTick && r.onTick(s), r.breakCondition && r.breakCondition() && (r.contextObservable.remove(i), r.onAborted && r.onAborted(s)), e >= r.timeout && (r.contextObservable.remove(i), r.onEnded && r.onEnded(s));\n          }, r.observableParameters.mask, r.observableParameters.insertFirst, r.observableParameters.scope);\n          return i;\n        }\n        (function(r) {\n          r[r.INIT = 0] = \"INIT\", r[r.STARTED = 1] = \"STARTED\", r[r.ENDED = 2] = \"ENDED\";\n        })(Li || (Li = {}));\n        var Kp = function() {\n          function r(t) {\n            var e, n, i = this;\n            this.onEachCountObservable = new C.c(), this.onTimerAbortedObservable = new C.c(), this.onTimerEndedObservable = new C.c(), this.onStateChangedObservable = new C.c(), this._observer = null, this._breakOnNextTick = !1, this._tick = function(o) {\n              var a = Date.now();\n              i._timer = a - i._startTime;\n              var s = { startTime: i._startTime, currentTime: a, deltaTime: i._timer, completeRate: i._timer / i._timeToEnd, payload: o }, d = i._breakOnNextTick || i._breakCondition(s);\n              d || i._timer >= i._timeToEnd ? i._stop(s, d) : i.onEachCountObservable.notifyObservers(s);\n            }, this._setState(Li.INIT), this._contextObservable = t.contextObservable, this._observableParameters = (e = t.observableParameters) !== null && e !== void 0 ? e : {}, this._breakCondition = (n = t.breakCondition) !== null && n !== void 0 ? n : function() {\n              return !1;\n            }, t.onEnded && this.onTimerEndedObservable.add(t.onEnded), t.onTick && this.onEachCountObservable.add(t.onTick), t.onAborted && this.onTimerAbortedObservable.add(t.onAborted);\n          }\n          return Object.defineProperty(r.prototype, \"breakCondition\", { set: function(t) {\n            this._breakCondition = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.clearObservables = function() {\n            this.onEachCountObservable.clear(), this.onTimerAbortedObservable.clear(), this.onTimerEndedObservable.clear(), this.onStateChangedObservable.clear();\n          }, r.prototype.start = function(t) {\n            if (t === void 0 && (t = this._timeToEnd), this._state === Li.STARTED)\n              throw new Error(\"Timer already started. Please stop it before starting again\");\n            this._timeToEnd = t, this._startTime = Date.now(), this._timer = 0, this._observer = this._contextObservable.add(this._tick, this._observableParameters.mask, this._observableParameters.insertFirst, this._observableParameters.scope), this._setState(Li.STARTED);\n          }, r.prototype.stop = function() {\n            this._state === Li.STARTED && (this._breakOnNextTick = !0);\n          }, r.prototype.dispose = function() {\n            this._observer && this._contextObservable.remove(this._observer), this.clearObservables();\n          }, r.prototype._setState = function(t) {\n            this._state = t, this.onStateChangedObservable.notifyObservers(this._state);\n          }, r.prototype._stop = function(t, e) {\n            e === void 0 && (e = !1), this._contextObservable.remove(this._observer), this._setState(Li.ENDED), e ? this.onTimerAbortedObservable.notifyObservers(t) : this.onTimerEndedObservable.notifyObservers(t);\n          }, r;\n        }(), to = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i._options = n, i._controllers = {}, i._snappedToPoint = !1, i._tmpRay = new dn.a(new u.e(), new u.e()), i._tmpVector = new u.e(), i._tmpQuaternion = new u.b(), i.backwardsMovementEnabled = !0, i.backwardsTeleportationDistance = 0.7, i.parabolicCheckRadius = 5, i.parabolicRayEnabled = !0, i.straightRayEnabled = !0, i.rotationAngle = Math.PI / 8, i._rotationEnabled = !0, i._attachController = function(o) {\n              if (!(i._controllers[o.uniqueId] || i._options.forceHandedness && o.inputSource.handedness !== i._options.forceHandedness)) {\n                i._controllers[o.uniqueId] = { xrController: o, teleportationState: { forward: !1, backwards: !1, rotating: !1, currentRotation: 0, baseRotation: 0 } };\n                var a = i._controllers[o.uniqueId];\n                if (a.xrController.inputSource.targetRayMode === \"tracked-pointer\" && a.xrController.inputSource.gamepad) {\n                  var s = function() {\n                    if (o.motionController) {\n                      var d = o.motionController.getComponentOfType(yr.THUMBSTICK_TYPE) || o.motionController.getComponentOfType(yr.TOUCHPAD_TYPE);\n                      if (!d || i._options.useMainComponentOnly) {\n                        var p = o.motionController.getMainComponent();\n                        if (!p)\n                          return;\n                        a.teleportationComponent = p, a.onButtonChangedObserver = p.onButtonStateChangedObservable.add(function() {\n                          p.changes.pressed && (p.changes.pressed.current ? (a.teleportationState.forward = !0, i._currentTeleportationControllerId = a.xrController.uniqueId, a.teleportationState.baseRotation = i._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, a.teleportationState.currentRotation = 0, Os({ timeout: i._options.timeToTeleport || 3e3, contextObservable: i._xrSessionManager.onXRFrameObservable, breakCondition: function() {\n                            return !p.pressed;\n                          }, onEnded: function() {\n                            i._currentTeleportationControllerId === a.xrController.uniqueId && a.teleportationState.forward && i._teleportForward(o.uniqueId);\n                          } })) : (a.teleportationState.forward = !1, i._currentTeleportationControllerId = \"\"));\n                        });\n                      } else\n                        a.teleportationComponent = d, a.onAxisChangedObserver = d.onAxisValueChangedObservable.add(function(y) {\n                          if (y.y <= 0.7 && a.teleportationState.backwards && (a.teleportationState.backwards = !1), y.y > 0.7 && !a.teleportationState.forward && i.backwardsMovementEnabled && !i.snapPointsOnly && !a.teleportationState.backwards) {\n                            a.teleportationState.backwards = !0, i._tmpQuaternion.copyFrom(i._options.xrInput.xrCamera.rotationQuaternion), i._tmpQuaternion.toEulerAnglesToRef(i._tmpVector), i._tmpVector.x = 0, i._tmpVector.z = 0, u.b.FromEulerVectorToRef(i._tmpVector, i._tmpQuaternion), i._tmpVector.set(0, 0, i.backwardsTeleportationDistance * (i._xrSessionManager.scene.useRightHandedSystem ? 1 : -1)), i._tmpVector.rotateByQuaternionToRef(i._tmpQuaternion, i._tmpVector), i._tmpVector.addInPlace(i._options.xrInput.xrCamera.position), i._tmpRay.origin.copyFrom(i._tmpVector), i._tmpRay.length = i._options.xrInput.xrCamera.realWorldHeight + 0.1, i._tmpRay.direction.set(0, -1, 0);\n                            var P = i._xrSessionManager.scene.pickWithRay(i._tmpRay, function(B) {\n                              return i._floorMeshes.indexOf(B) !== -1;\n                            });\n                            P && P.pickedPoint && (i._options.xrInput.xrCamera.position.x = P.pickedPoint.x, i._options.xrInput.xrCamera.position.z = P.pickedPoint.z);\n                          }\n                          if (y.y < -0.7 && !i._currentTeleportationControllerId && !a.teleportationState.rotating && (a.teleportationState.forward = !0, i._currentTeleportationControllerId = a.xrController.uniqueId, a.teleportationState.baseRotation = i._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y), y.x) {\n                            if (a.teleportationState.forward)\n                              i._currentTeleportationControllerId === a.xrController.uniqueId && (i.rotationEnabled ? setTimeout(function() {\n                                a.teleportationState.currentRotation = Math.atan2(y.x, y.y * (i._xrSessionManager.scene.useRightHandedSystem ? 1 : -1));\n                              }) : a.teleportationState.currentRotation = 0);\n                            else if (!a.teleportationState.rotating && Math.abs(y.x) > 0.7) {\n                              a.teleportationState.rotating = !0;\n                              var R = i.rotationAngle * (y.x > 0 ? 1 : -1) * (i._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);\n                              i._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(u.b.FromEulerAngles(0, R, 0));\n                            }\n                          } else\n                            a.teleportationState.rotating = !1;\n                          y.x === 0 && y.y === 0 && a.teleportationState.forward && i._teleportForward(o.uniqueId);\n                        });\n                    }\n                  };\n                  o.motionController ? s() : o.onMotionControllerInitObservable.addOnce(function() {\n                    s();\n                  });\n                } else\n                  i._xrSessionManager.scene.onPointerObservable.add(function(d) {\n                    d.type === yt.a.POINTERDOWN ? (a.teleportationState.forward = !0, i._currentTeleportationControllerId = a.xrController.uniqueId, a.teleportationState.baseRotation = i._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, a.teleportationState.currentRotation = 0, Os({ timeout: i._options.timeToTeleport || 3e3, contextObservable: i._xrSessionManager.onXRFrameObservable, onEnded: function() {\n                      i._currentTeleportationControllerId === a.xrController.uniqueId && a.teleportationState.forward && i._teleportForward(o.uniqueId);\n                    } })) : d.type === yt.a.POINTERUP && (a.teleportationState.forward = !1, i._currentTeleportationControllerId = \"\");\n                  });\n              }\n            }, i._options.teleportationTargetMesh || i._createDefaultTargetMesh(), i._floorMeshes = i._options.floorMeshes || [], i._snapToPositions = i._options.snapPositions || [], i._setTargetMeshVisibility(!1), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"rotationEnabled\", { get: function() {\n            return this._rotationEnabled;\n          }, set: function(e) {\n            if (this._rotationEnabled = e, this._options.teleportationTargetMesh) {\n              var n = this._options.teleportationTargetMesh.getChildMeshes(!1, function(i) {\n                return i.name === \"rotationCone\";\n              });\n              n[0] && n[0].setEnabled(e);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"teleportationTargetMesh\", { get: function() {\n            return this._options.teleportationTargetMesh || null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapPointsOnly\", { get: function() {\n            return !!this._options.snapPointsOnly;\n          }, set: function(e) {\n            this._options.snapPointsOnly = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.addFloorMesh = function(e) {\n            this._floorMeshes.push(e);\n          }, t.prototype.addSnapPoint = function(e) {\n            this._snapToPositions.push(e);\n          }, t.prototype.attach = function() {\n            var e = this;\n            return !!r.prototype.attach.call(this) && (this._currentTeleportationControllerId = \"\", this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, function(n) {\n              e._detachController(n.uniqueId);\n            }), !0);\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._controllers).forEach(function(n) {\n              e._detachController(n);\n            }), this._setTargetMeshVisibility(!1), this._currentTeleportationControllerId = \"\", this._controllers = {}, !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.dispose(!1, !0);\n          }, t.prototype.removeFloorMesh = function(e) {\n            var n = this._floorMeshes.indexOf(e);\n            n !== -1 && this._floorMeshes.splice(n, 1);\n          }, t.prototype.removeFloorMeshByName = function(e) {\n            var n = this._xrSessionManager.scene.getMeshByName(e);\n            n && this.removeFloorMesh(n);\n          }, t.prototype.removeSnapPoint = function(e) {\n            var n = this._snapToPositions.indexOf(e);\n            if (n === -1) {\n              for (var i = 0; i < this._snapToPositions.length; ++i)\n                if (this._snapToPositions[i].equals(e)) {\n                  n = i;\n                  break;\n                }\n            }\n            return n !== -1 && (this._snapToPositions.splice(n, 1), !0);\n          }, t.prototype.setSelectionFeature = function(e) {\n            this._selectionFeature = e;\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this, i = this._xrSessionManager.currentFrame, o = this._xrSessionManager.scene;\n            if (this.attach && i) {\n              var a = this._options.teleportationTargetMesh;\n              if (this._currentTeleportationControllerId) {\n                if (!a)\n                  return;\n                a.rotationQuaternion = a.rotationQuaternion || new u.b();\n                var s = this._controllers[this._currentTeleportationControllerId];\n                if (s && s.teleportationState.forward) {\n                  u.b.RotationYawPitchRollToRef(s.teleportationState.currentRotation + s.teleportationState.baseRotation, 0, 0, a.rotationQuaternion);\n                  var d = !1;\n                  if (s.xrController.getWorldPointerRayToRef(this._tmpRay), this.straightRayEnabled) {\n                    if ((p = o.pickWithRay(this._tmpRay, function(B) {\n                      if (n._options.pickBlockerMeshes && n._options.pickBlockerMeshes.indexOf(B) !== -1)\n                        return !0;\n                      var F = n._floorMeshes.indexOf(B);\n                      return F !== -1 && n._floorMeshes[F].absolutePosition.y < n._options.xrInput.xrCamera.position.y;\n                    })) && p.pickedMesh && this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(p.pickedMesh) !== -1)\n                      return;\n                    p && p.pickedPoint && (d = !0, this._setTargetMeshPosition(p.pickedPoint), this._setTargetMeshVisibility(!0), this._showParabolicPath(p));\n                  }\n                  if (this.parabolicRayEnabled && !d) {\n                    var p, y = s.xrController.pointer.rotationQuaternion.toEulerAngles().x, P = Math.PI / 2 - Math.abs(y) + 1, R = this.parabolicCheckRadius * P;\n                    if (this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(2 * R), this._tmpVector), this._tmpVector.y = this._tmpRay.origin.y, this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(R)), this._tmpVector.subtractToRef(this._tmpRay.origin, this._tmpRay.direction), this._tmpRay.direction.normalize(), (p = o.pickWithRay(this._tmpRay, function(B) {\n                      return !(!n._options.pickBlockerMeshes || n._options.pickBlockerMeshes.indexOf(B) === -1) || n._floorMeshes.indexOf(B) !== -1;\n                    })) && p.pickedMesh && this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(p.pickedMesh) !== -1)\n                      return;\n                    p && p.pickedPoint && (d = !0, this._setTargetMeshPosition(p.pickedPoint), this._setTargetMeshVisibility(!0), this._showParabolicPath(p));\n                  }\n                  this._setTargetMeshVisibility(d);\n                } else\n                  this._setTargetMeshVisibility(!1);\n              } else\n                this._setTargetMeshVisibility(!1);\n            }\n          }, t.prototype._createDefaultTargetMesh = function() {\n            this._options.defaultTargetMeshOptions = this._options.defaultTargetMeshOptions || {};\n            var e = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Cn.a.DefaultUtilityLayer.utilityLayerScene : this._xrSessionManager.scene, n = Oi.CreateGround(\"teleportationTarget\", { width: 2, height: 2, subdivisions: 2 }, e);\n            n.isPickable = !1;\n            var i = new pi.a(\"teleportationPlaneDynamicTexture\", 512, e, !0);\n            i.hasAlpha = !0;\n            var o = i.getContext();\n            o.beginPath(), o.arc(256, 256, 200, 0, 2 * Math.PI, !1), o.fillStyle = this._options.defaultTargetMeshOptions.teleportationFillColor || \"#444444\", o.fill(), o.lineWidth = 10, o.strokeStyle = this._options.defaultTargetMeshOptions.teleportationBorderColor || \"#FFFFFF\", o.stroke(), o.closePath(), i.update();\n            var a = new Nt.a(\"teleportationPlaneMaterial\", e);\n            a.diffuseTexture = i, n.material = a;\n            var s = lr.CreateTorus(\"torusTeleportation\", { diameter: 0.75, thickness: 0.1, tessellation: 20 }, e);\n            if (s.isPickable = !1, s.parent = n, !this._options.defaultTargetMeshOptions.disableAnimation) {\n              var d = new k(\"animationInnerCircle\", \"position.y\", 30, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CYCLE), p = [];\n              p.push({ frame: 0, value: 0 }), p.push({ frame: 30, value: 0.4 }), p.push({ frame: 60, value: 0 }), d.setKeys(p);\n              var y = new nn();\n              y.setEasingMode(Ge.EASINGMODE_EASEINOUT), d.setEasingFunction(y), s.animations = [], s.animations.push(d), e.beginAnimation(s, 0, 60, !0);\n            }\n            var P = ci.a.CreateCylinder(\"rotationCone\", { diameterTop: 0, tessellation: 4 }, e);\n            if (P.isPickable = !1, P.scaling.set(0.5, 0.12, 0.2), P.rotate(be.a.X, Math.PI / 2), P.position.z = 0.6, P.parent = s, this._options.defaultTargetMeshOptions.torusArrowMaterial)\n              s.material = this._options.defaultTargetMeshOptions.torusArrowMaterial, P.material = this._options.defaultTargetMeshOptions.torusArrowMaterial;\n            else {\n              var R = new Nt.a(\"torusConsMat\", e);\n              R.disableLighting = !!this._options.defaultTargetMeshOptions.disableLighting, R.disableLighting ? R.emissiveColor = new I.a(0.3, 0.3, 1) : R.diffuseColor = new I.a(0.3, 0.3, 1), R.alpha = 0.9, s.material = R, P.material = R, this._teleportationRingMaterial = R;\n            }\n            this._options.renderingGroupId !== void 0 && (n.renderingGroupId = this._options.renderingGroupId, s.renderingGroupId = this._options.renderingGroupId, P.renderingGroupId = this._options.renderingGroupId), this._options.teleportationTargetMesh = n;\n          }, t.prototype._detachController = function(e) {\n            var n = this._controllers[e];\n            n && (n.teleportationComponent && (n.onAxisChangedObserver && n.teleportationComponent.onAxisValueChangedObservable.remove(n.onAxisChangedObserver), n.onButtonChangedObserver && n.teleportationComponent.onButtonStateChangedObservable.remove(n.onButtonChangedObserver)), delete this._controllers[e]);\n          }, t.prototype._findClosestSnapPointWithRadius = function(e, n) {\n            n === void 0 && (n = this._options.snapToPositionRadius || 0.8);\n            var i = null, o = Number.MAX_VALUE;\n            if (this._snapToPositions.length) {\n              var a = n * n;\n              this._snapToPositions.forEach(function(s) {\n                var d = u.e.DistanceSquared(s, e);\n                d <= a && d < o && (o = d, i = s);\n              });\n            }\n            return i;\n          }, t.prototype._setTargetMeshPosition = function(e) {\n            if (this._options.teleportationTargetMesh) {\n              var n = this._findClosestSnapPointWithRadius(e);\n              this._snappedToPoint = !!n, this.snapPointsOnly && !this._snappedToPoint && this._teleportationRingMaterial ? this._teleportationRingMaterial.diffuseColor.set(1, 0.3, 0.3) : this.snapPointsOnly && this._snappedToPoint && this._teleportationRingMaterial && this._teleportationRingMaterial.diffuseColor.set(0.3, 0.3, 1), this._options.teleportationTargetMesh.position.copyFrom(n || e), this._options.teleportationTargetMesh.position.y += 0.01;\n            }\n          }, t.prototype._setTargetMeshVisibility = function(e) {\n            this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible !== e && (this._options.teleportationTargetMesh.isVisible = e, this._options.teleportationTargetMesh.getChildren(void 0, !1).forEach(function(n) {\n              n.isVisible = e;\n            }), e ? this._selectionFeature && this._selectionFeature.detach() : (this._quadraticBezierCurve && (this._quadraticBezierCurve.dispose(), this._quadraticBezierCurve = null), this._selectionFeature && this._selectionFeature.attach()));\n          }, t.prototype._showParabolicPath = function(e) {\n            if (e.pickedPoint) {\n              var n = this._controllers[this._currentTeleportationControllerId], i = Qe.d.CreateQuadraticBezier(n.xrController.pointer.absolutePosition, e.ray.origin, e.pickedPoint, 25);\n              this._options.generateRayPathMesh ? this._quadraticBezierCurve = this._options.generateRayPathMesh(i.getPoints()) : this._quadraticBezierCurve = sn.a.CreateLines(\"teleportation path line\", { points: i.getPoints(), instance: this._quadraticBezierCurve, updatable: !0 }), this._quadraticBezierCurve.isPickable = !1;\n            }\n          }, t.prototype._teleportForward = function(e) {\n            var n = this._controllers[e];\n            if (n && n.teleportationState.forward && (n.teleportationState.forward = !1, this._currentTeleportationControllerId = \"\", (!this.snapPointsOnly || this._snappedToPoint) && this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible)) {\n              var i = this._options.xrInput.xrCamera.realWorldHeight;\n              this._options.xrInput.xrCamera.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position), this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position), this._options.xrInput.xrCamera.position.y += i, this._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(u.b.FromEulerAngles(0, n.teleportationState.currentRotation - (this._xrSessionManager.scene.useRightHandedSystem ? Math.PI : 0), 0)), this._options.xrInput.xrCamera.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position);\n            }\n          }, t.Name = ti.TELEPORTATION, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(to.Name, function(r, t) {\n          return function() {\n            return new to(r, t);\n          };\n        }, to.Version, !0);\n        var Qp = function() {\n        }, uu = function() {\n          function r() {\n          }\n          return r.CreateAsync = function(t, e) {\n            e === void 0 && (e = {});\n            var n = new r();\n            return ru.CreateAsync(t).then(function(i) {\n              if (n.baseExperience = i, e.ignoreNativeCameraTransformation && (n.baseExperience.camera.compensateOnFirstFrame = !1), n.input = new su(i.sessionManager, i.camera, Object(c.a)({ controllerOptions: { renderingGroupId: e.renderingGroupId } }, e.inputOptions || {})), n.pointerSelection = n.baseExperience.featuresManager.enableFeature(eo.Name, e.useStablePlugins ? \"stable\" : \"latest\", { xrInput: n.input, renderingGroupId: e.renderingGroupId }), e.disableTeleportation || (n.teleportation = n.baseExperience.featuresManager.enableFeature(to.Name, e.useStablePlugins ? \"stable\" : \"latest\", { floorMeshes: e.floorMeshes, xrInput: n.input, renderingGroupId: e.renderingGroupId }), n.teleportation.setSelectionFeature(n.pointerSelection)), n.renderTarget = n.baseExperience.sessionManager.getWebXRRenderTarget(e.outputCanvasOptions), !e.disableDefaultUI) {\n                var o = Object(c.a)({ renderTarget: n.renderTarget }, e.uiOptions || {});\n                return e.optionalFeatures && (typeof e.optionalFeatures == \"boolean\" ? o.optionalFeatures = [\"hit-test\", \"anchors\", \"plane-detection\", \"hand-tracking\"] : o.optionalFeatures = e.optionalFeatures), lu.CreateAsync(t, n.baseExperience, o).then(function(a) {\n                  n.enterExitUI = a;\n                });\n              }\n            }).then(function() {\n              return n;\n            }).catch(function(i) {\n              return l.a.Error(\"Error initializing XR\"), l.a.Error(i), n;\n            });\n          }, r.prototype.dispose = function() {\n            this.baseExperience && this.baseExperience.dispose(), this.input && this.input.dispose(), this.enterExitUI && this.enterExitUI.dispose(), this.renderTarget && this.renderTarget.dispose();\n          }, r;\n        }(), qp = !0;\n        _e.a.prototype.createDefaultLight = function(r) {\n          if (r === void 0 && (r = !1), r && this.lights)\n            for (var t = 0; t < this.lights.length; t++)\n              this.lights[t].dispose();\n          this.lights.length === 0 && new Oo.a(\"default light\", u.e.Up(), this);\n        }, _e.a.prototype.createDefaultCamera = function(r, t, e) {\n          if (r === void 0 && (r = !1), t === void 0 && (t = !1), e === void 0 && (e = !1), t && this.activeCamera && (this.activeCamera.dispose(), this.activeCamera = null), !this.activeCamera) {\n            var n, i = this.getWorldExtends(function(P) {\n              return P.isVisible && P.isEnabled();\n            }), o = i.max.subtract(i.min), a = i.min.add(o.scale(0.5)), s = 1.5 * o.length();\n            if (isFinite(s) || (s = 1, a.copyFromFloats(0, 0, 0)), r) {\n              var d = new ji(\"default camera\", -Math.PI / 2, Math.PI / 2, s, a, this);\n              d.lowerRadiusLimit = 0.01 * s, d.wheelPrecision = 100 / s, n = d;\n            } else {\n              var p = new zn(\"default camera\", new u.e(a.x, a.y, -s), this);\n              p.setTarget(a), n = p;\n            }\n            n.minZ = 0.01 * s, n.maxZ = 1e3 * s, n.speed = 0.2 * s, this.activeCamera = n;\n            var y = this.getEngine().getInputElement();\n            e && y && n.attachControl();\n          }\n        }, _e.a.prototype.createDefaultCameraOrLight = function(r, t, e) {\n          r === void 0 && (r = !1), t === void 0 && (t = !1), e === void 0 && (e = !1), this.createDefaultLight(t), this.createDefaultCamera(r, t, e);\n        }, _e.a.prototype.createDefaultSkybox = function(r, t, e, n, i) {\n          if (t === void 0 && (t = !1), e === void 0 && (e = 1e3), n === void 0 && (n = 0), i === void 0 && (i = !0), !r)\n            return l.a.Warn(\"Can not create default skybox without environment texture.\"), null;\n          i && r && (this.environmentTexture = r);\n          var o = Ie.a.CreateBox(\"hdrSkyBox\", e, this);\n          if (t) {\n            var a = new $r(\"skyBox\", this);\n            a.backFaceCulling = !1, a.reflectionTexture = r.clone(), a.reflectionTexture && (a.reflectionTexture.coordinatesMode = Ne.a.SKYBOX_MODE), a.microSurface = 1 - n, a.disableLighting = !0, a.twoSidedLighting = !0, o.infiniteDistance = !0, o.material = a;\n          } else {\n            var s = new Nt.a(\"skyBox\", this);\n            s.backFaceCulling = !1, s.reflectionTexture = r.clone(), s.reflectionTexture && (s.reflectionTexture.coordinatesMode = Ne.a.SKYBOX_MODE), s.disableLighting = !0, o.infiniteDistance = !0, o.material = s;\n          }\n          return o.isPickable = !1, o;\n        }, _e.a.prototype.createDefaultEnvironment = function(r) {\n          return Es ? new Es(r, this) : null;\n        }, _e.a.prototype.createDefaultVRExperience = function(r) {\n          return r === void 0 && (r = {}), new Il(this, r);\n        }, _e.a.prototype.createDefaultXRExperienceAsync = function(r) {\n          return r === void 0 && (r = {}), uu.CreateAsync(this, r).then(function(t) {\n            return t;\n          });\n        };\n        var hu = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            o === void 0 && (o = !1), a === void 0 && (a = !1), s === void 0 && (s = Ne.a.TRILINEAR_SAMPLINGMODE), d === void 0 && (d = { autoPlay: !0, loop: !0, autoUpdateTexture: !0 });\n            var p = r.call(this, null, i, !o, a) || this;\n            p._onUserActionRequestedObservable = null, p._stillImageCaptured = !1, p._displayingPosterTexture = !1, p._frameId = -1, p._currentSrc = null, p._createInternalTexture = function() {\n              if (p._texture != null) {\n                if (!p._displayingPosterTexture)\n                  return;\n                p._texture.dispose(), p._displayingPosterTexture = !1;\n              }\n              if (!p._getEngine().needPOTTextures || Xe.b.IsExponentOfTwo(p.video.videoWidth) && Xe.b.IsExponentOfTwo(p.video.videoHeight) ? (p.wrapU = Ne.a.WRAP_ADDRESSMODE, p.wrapV = Ne.a.WRAP_ADDRESSMODE) : (p.wrapU = Ne.a.CLAMP_ADDRESSMODE, p.wrapV = Ne.a.CLAMP_ADDRESSMODE, p._generateMipMaps = !1), p._texture = p._getEngine().createDynamicTexture(p.video.videoWidth, p.video.videoHeight, p._generateMipMaps, p.samplingMode), p.video.autoplay || p._settings.poster)\n                p._texture.isReady = !0, p._updateInternalTexture(), p.onLoadObservable.hasObservers() && p.onLoadObservable.notifyObservers(p);\n              else {\n                var P = p.video.onplaying, R = !1, B = p.video.muted;\n                p.video.muted = !0, p.video.onplaying = function() {\n                  p.video.muted = B, p.video.onplaying = P, p._texture.isReady = !0, p._updateInternalTexture(), R || p.video.pause(), p.onLoadObservable.hasObservers() && p.onLoadObservable.notifyObservers(p);\n                };\n                var F = p.video.play();\n                F ? F.then(function() {\n                }).catch(function() {\n                  R = !0, p._onUserActionRequestedObservable && p._onUserActionRequestedObservable.hasObservers() && p._onUserActionRequestedObservable.notifyObservers(p);\n                }) : (p.video.onplaying = P, p._texture.isReady = !0, p._updateInternalTexture(), p.onLoadObservable.hasObservers() && p.onLoadObservable.notifyObservers(p));\n              }\n            }, p.reset = function() {\n              p._texture != null && (p._displayingPosterTexture || (p._texture.dispose(), p._texture = null));\n            }, p._updateInternalTexture = function() {\n              if (p._texture != null && p._texture.isReady && !(p.video.readyState < p.video.HAVE_CURRENT_DATA || p._displayingPosterTexture)) {\n                var P = p.getScene().getFrameId();\n                p._frameId !== P && (p._frameId = P, p._getEngine().updateVideoTexture(p._texture, p.video, p._invertY));\n              }\n            }, p._generateMipMaps = o, p._initialSamplingMode = s, p.autoUpdateTexture = d.autoUpdateTexture, p._currentSrc = n, p.name = e || p._getName(n), p.video = p._getVideo(n), p._settings = d, d.poster && (p.video.poster = d.poster), d.autoPlay !== void 0 && (p.video.autoplay = d.autoPlay), d.loop !== void 0 && (p.video.loop = d.loop), d.muted !== void 0 && (p.video.muted = d.muted), p.video.setAttribute(\"playsinline\", \"\"), p.video.addEventListener(\"paused\", p._updateInternalTexture), p.video.addEventListener(\"seeked\", p._updateInternalTexture), p.video.addEventListener(\"emptied\", p.reset), p._createInternalTextureOnEvent = d.poster && !d.autoPlay ? \"play\" : \"canplay\", p.video.addEventListener(p._createInternalTextureOnEvent, p._createInternalTexture), d.autoPlay && p.video.play();\n            var y = p.video.readyState >= p.video.HAVE_CURRENT_DATA;\n            return !d.poster || d.autoPlay && y ? y && p._createInternalTexture() : (p._texture = p._getEngine().createTexture(d.poster, !1, !p.invertY, i), p._displayingPosterTexture = !0), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onUserActionRequestedObservable\", { get: function() {\n            return this._onUserActionRequestedObservable || (this._onUserActionRequestedObservable = new C.c()), this._onUserActionRequestedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._getName = function(e) {\n            return e instanceof HTMLVideoElement ? e.currentSrc : typeof e == \"object\" ? e.toString() : e;\n          }, t.prototype._getVideo = function(e) {\n            if (e instanceof HTMLVideoElement)\n              return Xe.b.SetCorsBehavior(e.currentSrc, e), e;\n            var n = document.createElement(\"video\");\n            return typeof e == \"string\" ? (Xe.b.SetCorsBehavior(e, n), n.src = e) : (Xe.b.SetCorsBehavior(e[0], n), e.forEach(function(i) {\n              var o = document.createElement(\"source\");\n              o.src = i, n.appendChild(o);\n            })), n;\n          }, t.prototype._rebuild = function() {\n            this.update();\n          }, t.prototype.update = function() {\n            this.autoUpdateTexture && this.updateTexture(!0);\n          }, t.prototype.updateTexture = function(e) {\n            e && (this.video.paused && this._stillImageCaptured || (this._stillImageCaptured = !0, this._updateInternalTexture()));\n          }, t.prototype.updateURL = function(e) {\n            this.video.src = e, this._currentSrc = e;\n          }, t.prototype.clone = function() {\n            return new t(this.name, this._currentSrc, this.getScene(), this._generateMipMaps, this.invertY, this.samplingMode, this._settings);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._currentSrc = null, this._onUserActionRequestedObservable && (this._onUserActionRequestedObservable.clear(), this._onUserActionRequestedObservable = null), this.video.removeEventListener(this._createInternalTextureOnEvent, this._createInternalTexture), this.video.removeEventListener(\"paused\", this._updateInternalTexture), this.video.removeEventListener(\"seeked\", this._updateInternalTexture), this.video.removeEventListener(\"emptied\", this.reset), this.video.pause();\n          }, t.CreateFromStreamAsync = function(e, n) {\n            var i = document.createElement(\"video\");\n            return e.getEngine()._badOS && (document.body.appendChild(i), i.style.transform = \"scale(0.0001, 0.0001)\", i.style.opacity = \"0\", i.style.position = \"fixed\", i.style.bottom = \"0px\", i.style.right = \"0px\"), i.setAttribute(\"autoplay\", \"\"), i.setAttribute(\"muted\", \"true\"), i.setAttribute(\"playsinline\", \"\"), i.muted = !0, i.mozSrcObject !== void 0 ? i.mozSrcObject = n : typeof i.srcObject == \"object\" ? i.srcObject = n : (window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL, i.src = window.URL && window.URL.createObjectURL(n)), new Promise(function(o) {\n              var a = function() {\n                o(new t(\"video\", i, e, !0, !0)), i.removeEventListener(\"playing\", a);\n              };\n              i.addEventListener(\"playing\", a), i.play();\n            });\n          }, t.CreateFromWebCamAsync = function(e, n, i) {\n            var o, a = this;\n            return i === void 0 && (i = !1), n && n.deviceId && (o = { exact: n.deviceId }), navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: n, audio: i }).then(function(s) {\n              return a.CreateFromStreamAsync(e, s);\n            }) : (navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, navigator.getUserMedia && navigator.getUserMedia({ video: { deviceId: o, width: { min: n && n.minWidth || 256, max: n && n.maxWidth || 640 }, height: { min: n && n.minHeight || 256, max: n && n.maxHeight || 480 } }, audio: i }, function(s) {\n              return a.CreateFromStreamAsync(e, s);\n            }, function(s) {\n              l.a.Error(s.name);\n            }), Promise.reject(\"No support for userMedia on this device\"));\n          }, t.CreateFromWebCam = function(e, n, i, o) {\n            o === void 0 && (o = !1), this.CreateFromWebCamAsync(e, i, o).then(function(a) {\n              n && n(a);\n            }).catch(function(a) {\n              l.a.Error(a.name);\n            });\n          }, t;\n        }(Ne.a), Zp = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"videoTexture\", { get: function() {\n            return this._texture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"videoMode\", { get: function() {\n            return this.textureMode;\n          }, set: function(e) {\n            this.textureMode = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initTexture = function(e, n, i) {\n            var o = this, a = { loop: i.loop, autoPlay: i.autoPlay, autoUpdateTexture: !0, poster: i.poster }, s = new hu((this.name || \"videoDome\") + \"_texture\", e, n, i.generateMipMaps, this._useDirectMapping, Ne.a.TRILINEAR_SAMPLINGMODE, a);\n            return i.clickToPlay && (n.onPointerUp = function() {\n              o._texture.video.play();\n            }), s;\n          }, t.MODE_MONOSCOPIC = Ii.MODE_MONOSCOPIC, t.MODE_TOPBOTTOM = Ii.MODE_TOPBOTTOM, t.MODE_SIDEBYSIDE = Ii.MODE_SIDEBYSIDE, t;\n        }(Ii), Gn = f(55), Jp = function() {\n          function r(t) {\n            this.engine = t, this._captureGPUFrameTime = !1, this._gpuFrameTime = new Gn.a(), this._captureShaderCompilationTime = !1, this._shaderCompilationTime = new Gn.a(), this._onBeginFrameObserver = null, this._onEndFrameObserver = null, this._onBeforeShaderCompilationObserver = null, this._onAfterShaderCompilationObserver = null;\n          }\n          return Object.defineProperty(r.prototype, \"gpuFrameTimeCounter\", { get: function() {\n            return this._gpuFrameTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureGPUFrameTime\", { get: function() {\n            return this._captureGPUFrameTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureGPUFrameTime && (this._captureGPUFrameTime = t, t ? (this._onBeginFrameObserver = this.engine.onBeginFrameObservable.add(function() {\n              e._gpuFrameTimeToken || (e._gpuFrameTimeToken = e.engine.startTimeQuery());\n            }), this._onEndFrameObserver = this.engine.onEndFrameObservable.add(function() {\n              if (e._gpuFrameTimeToken) {\n                var n = e.engine.endTimeQuery(e._gpuFrameTimeToken);\n                n > -1 && (e._gpuFrameTimeToken = null, e._gpuFrameTime.fetchNewFrame(), e._gpuFrameTime.addCount(n, !0));\n              }\n            })) : (this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"shaderCompilationTimeCounter\", { get: function() {\n            return this._shaderCompilationTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureShaderCompilationTime\", { get: function() {\n            return this._captureShaderCompilationTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureShaderCompilationTime && (this._captureShaderCompilationTime = t, t ? (this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(function() {\n              e._shaderCompilationTime.fetchNewFrame(), e._shaderCompilationTime.beginMonitoring();\n            }), this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(function() {\n              e._shaderCompilationTime.endMonitoring();\n            })) : (this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null));\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null, this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null, this.engine = null;\n          }, r;\n        }(), $p = function() {\n          function r(t) {\n            var e = this;\n            this.scene = t, this._captureActiveMeshesEvaluationTime = !1, this._activeMeshesEvaluationTime = new Gn.a(), this._captureRenderTargetsRenderTime = !1, this._renderTargetsRenderTime = new Gn.a(), this._captureFrameTime = !1, this._frameTime = new Gn.a(), this._captureRenderTime = !1, this._renderTime = new Gn.a(), this._captureInterFrameTime = !1, this._interFrameTime = new Gn.a(), this._captureParticlesRenderTime = !1, this._particlesRenderTime = new Gn.a(), this._captureSpritesRenderTime = !1, this._spritesRenderTime = new Gn.a(), this._capturePhysicsTime = !1, this._physicsTime = new Gn.a(), this._captureAnimationsTime = !1, this._animationsTime = new Gn.a(), this._captureCameraRenderTime = !1, this._cameraRenderTime = new Gn.a(), this._onBeforeActiveMeshesEvaluationObserver = null, this._onAfterActiveMeshesEvaluationObserver = null, this._onBeforeRenderTargetsRenderObserver = null, this._onAfterRenderTargetsRenderObserver = null, this._onAfterRenderObserver = null, this._onBeforeDrawPhaseObserver = null, this._onAfterDrawPhaseObserver = null, this._onBeforeAnimationsObserver = null, this._onBeforeParticlesRenderingObserver = null, this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver = null, this._onAfterSpritesRenderingObserver = null, this._onBeforePhysicsObserver = null, this._onAfterPhysicsObserver = null, this._onAfterAnimationsObserver = null, this._onBeforeCameraRenderObserver = null, this._onAfterCameraRenderObserver = null, this._onBeforeAnimationsObserver = t.onBeforeAnimationsObservable.add(function() {\n              e._captureActiveMeshesEvaluationTime && e._activeMeshesEvaluationTime.fetchNewFrame(), e._captureRenderTargetsRenderTime && e._renderTargetsRenderTime.fetchNewFrame(), e._captureFrameTime && (Xe.b.StartPerformanceCounter(\"Scene rendering\"), e._frameTime.beginMonitoring()), e._captureInterFrameTime && e._interFrameTime.endMonitoring(), e._captureParticlesRenderTime && e._particlesRenderTime.fetchNewFrame(), e._captureSpritesRenderTime && e._spritesRenderTime.fetchNewFrame(), e._captureAnimationsTime && e._animationsTime.beginMonitoring(), e.scene.getEngine()._drawCalls.fetchNewFrame();\n            }), this._onAfterRenderObserver = t.onAfterRenderObservable.add(function() {\n              e._captureFrameTime && (Xe.b.EndPerformanceCounter(\"Scene rendering\"), e._frameTime.endMonitoring()), e._captureRenderTime && e._renderTime.endMonitoring(!1), e._captureInterFrameTime && e._interFrameTime.beginMonitoring();\n            });\n          }\n          return Object.defineProperty(r.prototype, \"activeMeshesEvaluationTimeCounter\", { get: function() {\n            return this._activeMeshesEvaluationTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureActiveMeshesEvaluationTime\", { get: function() {\n            return this._captureActiveMeshesEvaluationTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureActiveMeshesEvaluationTime && (this._captureActiveMeshesEvaluationTime = t, t ? (this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Active meshes evaluation\"), e._activeMeshesEvaluationTime.beginMonitoring();\n            }), this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Active meshes evaluation\"), e._activeMeshesEvaluationTime.endMonitoring();\n            })) : (this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderTargetsRenderTimeCounter\", { get: function() {\n            return this._renderTargetsRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureRenderTargetsRenderTime\", { get: function() {\n            return this._captureRenderTargetsRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureRenderTargetsRenderTime && (this._captureRenderTargetsRenderTime = t, t ? (this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Render targets rendering\"), e._renderTargetsRenderTime.beginMonitoring();\n            }), this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Render targets rendering\"), e._renderTargetsRenderTime.endMonitoring(!1);\n            })) : (this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"particlesRenderTimeCounter\", { get: function() {\n            return this._particlesRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureParticlesRenderTime\", { get: function() {\n            return this._captureParticlesRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureParticlesRenderTime && (this._captureParticlesRenderTime = t, t ? (this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Particles\"), e._particlesRenderTime.beginMonitoring();\n            }), this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Particles\"), e._particlesRenderTime.endMonitoring(!1);\n            })) : (this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"spritesRenderTimeCounter\", { get: function() {\n            return this._spritesRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureSpritesRenderTime\", { get: function() {\n            return this._captureSpritesRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureSpritesRenderTime && (this._captureSpritesRenderTime = t, this.scene.spriteManagers && (t ? (this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Sprites\"), e._spritesRenderTime.beginMonitoring();\n            }), this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Sprites\"), e._spritesRenderTime.endMonitoring(!1);\n            })) : (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null, this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null)));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"physicsTimeCounter\", { get: function() {\n            return this._physicsTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"capturePhysicsTime\", { get: function() {\n            return this._capturePhysicsTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._capturePhysicsTime && this.scene.onBeforePhysicsObservable && (this._capturePhysicsTime = t, t ? (this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Physics\"), e._physicsTime.beginMonitoring();\n            }), this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Physics\"), e._physicsTime.endMonitoring();\n            })) : (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null, this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationsTimeCounter\", { get: function() {\n            return this._animationsTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureAnimationsTime\", { get: function() {\n            return this._captureAnimationsTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureAnimationsTime && (this._captureAnimationsTime = t, t ? this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(function() {\n              e._animationsTime.endMonitoring();\n            }) : (this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"frameTimeCounter\", { get: function() {\n            return this._frameTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureFrameTime\", { get: function() {\n            return this._captureFrameTime;\n          }, set: function(t) {\n            this._captureFrameTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"interFrameTimeCounter\", { get: function() {\n            return this._interFrameTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureInterFrameTime\", { get: function() {\n            return this._captureInterFrameTime;\n          }, set: function(t) {\n            this._captureInterFrameTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderTimeCounter\", { get: function() {\n            return this._renderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureRenderTime\", { get: function() {\n            return this._captureRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureRenderTime && (this._captureRenderTime = t, t ? (this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(function() {\n              e._renderTime.beginMonitoring(), Xe.b.StartPerformanceCounter(\"Main render\");\n            }), this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(function() {\n              e._renderTime.endMonitoring(!1), Xe.b.EndPerformanceCounter(\"Main render\");\n            })) : (this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cameraRenderTimeCounter\", { get: function() {\n            return this._cameraRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureCameraRenderTime\", { get: function() {\n            return this._captureCameraRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureCameraRenderTime && (this._captureCameraRenderTime = t, t ? (this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add(function(n) {\n              e._cameraRenderTime.beginMonitoring(), Xe.b.StartPerformanceCounter(\"Rendering camera \" + n.name);\n            }), this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add(function(n) {\n              e._cameraRenderTime.endMonitoring(!1), Xe.b.EndPerformanceCounter(\"Rendering camera \" + n.name);\n            })) : (this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"drawCallsCounter\", { get: function() {\n            return this.scene.getEngine()._drawCalls;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = null, this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null, this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null, this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver && (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null), this._onAfterSpritesRenderingObserver && (this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null), this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null, this._onBeforePhysicsObserver && (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null), this._onAfterPhysicsObserver && (this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null), this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null, this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null, this.scene = null;\n          }, r;\n        }(), e_ = `#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;\nvoid main(void)\n{\nvec4 finalColor=glowColor;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\n#ifdef GLOW\n\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef HIGHLIGHT\n\nfinalColor.a=albedoTexture.a;\n#endif\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE)\ndiscard;\n#endif\n#ifdef EMISSIVE\ngl_FragColor=texture2D(emissiveSampler,vUVEmissive)*finalColor;\n#else\ngl_FragColor=finalColor;\n#endif\n#ifdef HIGHLIGHT\n\ngl_FragColor.a=glowColor.a;\n#endif\n}`;\n        ze.a.ShadersStore.glowMapGenerationPixelShader = e_;\n        var t_ = `\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform mat4 opacityMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef VERTEXALPHA\nattribute vec4 color;\nvarying vec4 vColor;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(positionUpdated,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef DIFFUSE\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef OPACITY\n#ifdef OPACITYUV1\nvUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef OPACITYUV2\nvUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef VERTEXALPHA\nvColor=color;\n#endif\n}`;\n        ze.a.ShadersStore.glowMapGenerationVertexShader = t_;\n        var no = function() {\n          function r(t, e) {\n            this._vertexBuffers = {}, this._maxSize = 0, this._mainTextureDesiredSize = { width: 0, height: 0 }, this._shouldRender = !0, this._postProcesses = [], this._textures = [], this._emissiveTextureAndColor = { texture: null, color: new I.b() }, this.neutralColor = new I.b(), this.isEnabled = !0, this.disableBoundingBoxesFromEffectLayer = !1, this.onDisposeObservable = new C.c(), this.onBeforeRenderMainTextureObservable = new C.c(), this.onBeforeComposeObservable = new C.c(), this.onBeforeRenderMeshToEffect = new C.c(), this.onAfterRenderMeshToEffect = new C.c(), this.onAfterComposeObservable = new C.c(), this.onSizeChangedObservable = new C.c(), this.name = t, this._scene = e || te.a.LastCreatedScene, r._SceneComponentInitialization(this._scene), this._engine = this._scene.getEngine(), this._maxSize = this._engine.getCaps().maxTextureSize, this._scene.effectLayers.push(this), this._generateIndexBuffer(), this._generateVertexBuffer();\n          }\n          return Object.defineProperty(r.prototype, \"camera\", { get: function() {\n            return this._effectLayerOptions.camera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderingGroupId\", { get: function() {\n            return this._effectLayerOptions.renderingGroupId;\n          }, set: function(t) {\n            this._effectLayerOptions.renderingGroupId = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype._init = function(t) {\n            this._effectLayerOptions = Object(c.a)({ mainTextureRatio: 0.5, alphaBlendingMode: h.a.ALPHA_COMBINE, camera: null, renderingGroupId: -1 }, t), this._setMainTextureSize(), this._createMainTexture(), this._createTextureAndPostProcesses(), this._mergeEffect = this._createMergeEffect();\n          }, r.prototype._generateIndexBuffer = function() {\n            var t = [];\n            t.push(0), t.push(1), t.push(2), t.push(0), t.push(2), t.push(3), this._indexBuffer = this._engine.createIndexBuffer(t);\n          }, r.prototype._generateVertexBuffer = function() {\n            var t = [];\n            t.push(1, 1), t.push(-1, 1), t.push(-1, -1), t.push(1, -1);\n            var e = new Oe.b(this._engine, t, Oe.b.PositionKind, !1, !1, 2);\n            this._vertexBuffers[Oe.b.PositionKind] = e;\n          }, r.prototype._setMainTextureSize = function() {\n            this._effectLayerOptions.mainTextureFixedSize ? (this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize, this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize) : (this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.width = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize) : this._mainTextureDesiredSize.width, this._mainTextureDesiredSize.height = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize) : this._mainTextureDesiredSize.height), this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width), this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);\n          }, r.prototype._createMainTexture = function() {\n            var t = this;\n            this._mainTexture = new on(\"HighlightLayerMainRTT\", { width: this._mainTextureDesiredSize.width, height: this._mainTextureDesiredSize.height }, this._scene, !1, !0, h.a.TEXTURETYPE_UNSIGNED_INT), this._mainTexture.activeCamera = this._effectLayerOptions.camera, this._mainTexture.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._mainTexture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._mainTexture.anisotropicFilteringLevel = 1, this._mainTexture.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._mainTexture.renderParticles = !1, this._mainTexture.renderList = null, this._mainTexture.ignoreCameraViewport = !0, this._mainTexture.customRenderFunction = function(n, i, o, a) {\n              var s;\n              t.onBeforeRenderMainTextureObservable.notifyObservers(t);\n              var d = t._scene.getEngine();\n              if (a.length) {\n                for (d.setColorWrite(!1), s = 0; s < a.length; s++)\n                  t._renderSubMesh(a.data[s]);\n                d.setColorWrite(!0);\n              }\n              for (s = 0; s < n.length; s++)\n                t._renderSubMesh(n.data[s]);\n              for (s = 0; s < i.length; s++)\n                t._renderSubMesh(i.data[s]);\n              var p = d.getAlphaMode();\n              for (s = 0; s < o.length; s++)\n                t._renderSubMesh(o.data[s], !0);\n              d.setAlphaMode(p);\n            }, this._mainTexture.onClearObservable.add(function(n) {\n              n.clear(t.neutralColor, !0, !0, !0);\n            });\n            var e = this._scene.getBoundingBoxRenderer().enabled;\n            this._mainTexture.onBeforeBindObservable.add(function() {\n              t._scene.getBoundingBoxRenderer().enabled = !t.disableBoundingBoxesFromEffectLayer && e;\n            }), this._mainTexture.onAfterUnbindObservable.add(function() {\n              t._scene.getBoundingBoxRenderer().enabled = e;\n            });\n          }, r.prototype._addCustomEffectDefines = function(t) {\n          }, r.prototype._isReady = function(t, e, n) {\n            var i = t.getMaterial();\n            if (!i || !i.isReadyForSubMesh(t.getMesh(), t, e))\n              return !1;\n            var o = [], a = [Oe.b.PositionKind], s = t.getMesh(), d = !1, p = !1;\n            if (i) {\n              var y = i.needAlphaTesting(), P = i.getAlphaTestTexture(), R = P && P.hasAlpha && (i.useAlphaFromDiffuseTexture || i._useAlphaFromAlbedoTexture);\n              P && (y || R) && (o.push(\"#define DIFFUSE\"), s.isVerticesDataPresent(Oe.b.UV2Kind) && P.coordinatesIndex === 1 ? (o.push(\"#define DIFFUSEUV2\"), p = !0) : s.isVerticesDataPresent(Oe.b.UVKind) && (o.push(\"#define DIFFUSEUV1\"), d = !0), y && (o.push(\"#define ALPHATEST\"), o.push(\"#define ALPHATESTVALUE 0.4\")));\n              var B = i.opacityTexture;\n              B && (o.push(\"#define OPACITY\"), s.isVerticesDataPresent(Oe.b.UV2Kind) && B.coordinatesIndex === 1 ? (o.push(\"#define OPACITYUV2\"), p = !0) : s.isVerticesDataPresent(Oe.b.UVKind) && (o.push(\"#define OPACITYUV1\"), d = !0));\n            }\n            n && (o.push(\"#define EMISSIVE\"), s.isVerticesDataPresent(Oe.b.UV2Kind) && n.coordinatesIndex === 1 ? (o.push(\"#define EMISSIVEUV2\"), p = !0) : s.isVerticesDataPresent(Oe.b.UVKind) && (o.push(\"#define EMISSIVEUV1\"), d = !0)), s.isVerticesDataPresent(Oe.b.ColorKind) && s.hasVertexAlpha && (a.push(Oe.b.ColorKind), o.push(\"#define VERTEXALPHA\")), d && (a.push(Oe.b.UVKind), o.push(\"#define UV1\")), p && (a.push(Oe.b.UV2Kind), o.push(\"#define UV2\"));\n            var F = new _r.a();\n            if (s.useBones && s.computeBonesUsingShaders) {\n              a.push(Oe.b.MatricesIndicesKind), a.push(Oe.b.MatricesWeightsKind), s.numBoneInfluencers > 4 && (a.push(Oe.b.MatricesIndicesExtraKind), a.push(Oe.b.MatricesWeightsExtraKind)), o.push(\"#define NUM_BONE_INFLUENCERS \" + s.numBoneInfluencers);\n              var z = s.skeleton;\n              z && z.isUsingTextureForMatrices ? o.push(\"#define BONETEXTURE\") : o.push(\"#define BonesPerMesh \" + (z ? z.bones.length + 1 : 0)), s.numBoneInfluencers > 0 && F.addCPUSkinningFallback(0, s);\n            } else\n              o.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var J = s.morphTargetManager, ie = 0;\n            J && J.numInfluencers > 0 && (o.push(\"#define MORPHTARGETS\"), ie = J.numInfluencers, o.push(\"#define NUM_MORPH_INFLUENCERS \" + ie), $e.a.PrepareAttributesForMorphTargetsInfluencers(a, s, ie)), e && (o.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(a), t.getRenderingMesh().hasThinInstances && o.push(\"#define THIN_INSTANCES\")), this._addCustomEffectDefines(o);\n            var se = o.join(`\n`);\n            return this._cachedDefines !== se && (this._cachedDefines = se, this._effectLayerMapGenerationEffect = this._scene.getEngine().createEffect(\"glowMapGeneration\", a, [\"world\", \"mBones\", \"viewProjection\", \"glowColor\", \"morphTargetInfluences\", \"boneTextureWidth\", \"diffuseMatrix\", \"emissiveMatrix\", \"opacityMatrix\", \"opacityIntensity\"], [\"diffuseSampler\", \"emissiveSampler\", \"opacitySampler\", \"boneSampler\"], se, F, void 0, void 0, { maxSimultaneousMorphTargets: ie })), this._effectLayerMapGenerationEffect.isReady();\n          }, r.prototype.render = function() {\n            var t = this._mergeEffect;\n            if (t.isReady()) {\n              for (var e = 0; e < this._postProcesses.length; e++)\n                if (!this._postProcesses[e].isReady())\n                  return;\n              var n = this._scene.getEngine();\n              this.onBeforeComposeObservable.notifyObservers(this), n.enableEffect(t), n.setState(!1), n.bindBuffers(this._vertexBuffers, this._indexBuffer, t);\n              var i = n.getAlphaMode();\n              n.setAlphaMode(this._effectLayerOptions.alphaBlendingMode), this._internalRender(t), n.setAlphaMode(i), this.onAfterComposeObservable.notifyObservers(this);\n              var o = this._mainTexture.getSize();\n              this._setMainTextureSize(), o.width === this._mainTextureDesiredSize.width && o.height === this._mainTextureDesiredSize.height || (this.onSizeChangedObservable.notifyObservers(this), this._disposeTextureAndPostProcesses(), this._createMainTexture(), this._createTextureAndPostProcesses());\n            }\n          }, r.prototype.hasMesh = function(t) {\n            return this.renderingGroupId === -1 || t.renderingGroupId === this.renderingGroupId;\n          }, r.prototype.shouldRender = function() {\n            return this.isEnabled && this._shouldRender;\n          }, r.prototype._shouldRenderMesh = function(t) {\n            return !0;\n          }, r.prototype._canRenderMesh = function(t, e) {\n            return !e.needAlphaBlendingForMesh(t);\n          }, r.prototype._shouldRenderEmissiveTextureForMesh = function() {\n            return !0;\n          }, r.prototype._renderSubMesh = function(t, e) {\n            var n, i = this;\n            if (e === void 0 && (e = !1), this.shouldRender()) {\n              var o = t.getMaterial(), a = t.getMesh(), s = t.getReplacementMesh(), d = t.getRenderingMesh(), p = t.getEffectiveMesh(), y = this._scene, P = y.getEngine();\n              if (p._internalAbstractMeshDataInfo._isActiveIntermediate = !1, o && this._canRenderMesh(d, o)) {\n                var R = (n = d.overrideMaterialSideOrientation) !== null && n !== void 0 ? n : o.sideOrientation;\n                d._getWorldMatrixDeterminant() < 0 && (R = R === zt.a.ClockWiseSideOrientation ? zt.a.CounterClockWiseSideOrientation : zt.a.ClockWiseSideOrientation);\n                var B = R === zt.a.ClockWiseSideOrientation;\n                P.setState(o.backFaceCulling, o.zOffset, void 0, B);\n                var F = d._getInstancesRenderList(t._id, !!s);\n                if (!F.mustReturn && this._shouldRenderMesh(d)) {\n                  var z = F.hardwareInstancedRendering[t._id] || d.hasThinInstances;\n                  if (this._setEmissiveTextureAndColor(d, t, o), this.onBeforeRenderMeshToEffect.notifyObservers(a), this._useMeshMaterial(d))\n                    d.render(t, z, s || void 0);\n                  else if (this._isReady(t, z, this._emissiveTextureAndColor.texture)) {\n                    P.enableEffect(this._effectLayerMapGenerationEffect), d._bind(t, this._effectLayerMapGenerationEffect, zt.a.TriangleFillMode), this._effectLayerMapGenerationEffect.setMatrix(\"viewProjection\", y.getTransformMatrix()), this._effectLayerMapGenerationEffect.setMatrix(\"world\", p.getWorldMatrix()), this._effectLayerMapGenerationEffect.setFloat4(\"glowColor\", this._emissiveTextureAndColor.color.r, this._emissiveTextureAndColor.color.g, this._emissiveTextureAndColor.color.b, this._emissiveTextureAndColor.color.a);\n                    var J = o.needAlphaTesting(), ie = o.getAlphaTestTexture(), se = ie && ie.hasAlpha && (o.useAlphaFromDiffuseTexture || o._useAlphaFromAlbedoTexture);\n                    ie && (J || se) && (this._effectLayerMapGenerationEffect.setTexture(\"diffuseSampler\", ie), (ce = ie.getTextureMatrix()) && this._effectLayerMapGenerationEffect.setMatrix(\"diffuseMatrix\", ce));\n                    var ce, ue = o.opacityTexture;\n                    if (ue && (this._effectLayerMapGenerationEffect.setTexture(\"opacitySampler\", ue), this._effectLayerMapGenerationEffect.setFloat(\"opacityIntensity\", ue.level), (ce = ue.getTextureMatrix()) && this._effectLayerMapGenerationEffect.setMatrix(\"opacityMatrix\", ce)), this._emissiveTextureAndColor.texture && (this._effectLayerMapGenerationEffect.setTexture(\"emissiveSampler\", this._emissiveTextureAndColor.texture), this._effectLayerMapGenerationEffect.setMatrix(\"emissiveMatrix\", this._emissiveTextureAndColor.texture.getTextureMatrix())), d.useBones && d.computeBonesUsingShaders && d.skeleton) {\n                      var fe = d.skeleton;\n                      if (fe.isUsingTextureForMatrices) {\n                        var ve = fe.getTransformMatrixTexture(d);\n                        if (!ve)\n                          return;\n                        this._effectLayerMapGenerationEffect.setTexture(\"boneSampler\", ve), this._effectLayerMapGenerationEffect.setFloat(\"boneTextureWidth\", 4 * (fe.bones.length + 1));\n                      } else\n                        this._effectLayerMapGenerationEffect.setMatrices(\"mBones\", fe.getTransformMatrices(d));\n                    }\n                    $e.a.BindMorphTargetParameters(d, this._effectLayerMapGenerationEffect), e && P.setAlphaMode(o.alphaMode), d._processRendering(p, t, this._effectLayerMapGenerationEffect, o.fillMode, F, z, function(Te, Re) {\n                      return i._effectLayerMapGenerationEffect.setMatrix(\"world\", Re);\n                    });\n                  } else\n                    this._mainTexture.resetRefreshCounter();\n                  this.onAfterRenderMeshToEffect.notifyObservers(a);\n                }\n              }\n            }\n          }, r.prototype._useMeshMaterial = function(t) {\n            return !1;\n          }, r.prototype._rebuild = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && t._rebuild(), this._generateIndexBuffer();\n          }, r.prototype._disposeTextureAndPostProcesses = function() {\n            this._mainTexture.dispose();\n            for (var t = 0; t < this._postProcesses.length; t++)\n              this._postProcesses[t] && this._postProcesses[t].dispose();\n            for (this._postProcesses = [], t = 0; t < this._textures.length; t++)\n              this._textures[t] && this._textures[t].dispose();\n            this._textures = [];\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._disposeTextureAndPostProcesses();\n            var e = this._scene.effectLayers.indexOf(this, 0);\n            e > -1 && this._scene.effectLayers.splice(e, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderMainTextureObservable.clear(), this.onBeforeComposeObservable.clear(), this.onBeforeRenderMeshToEffect.clear(), this.onAfterRenderMeshToEffect.clear(), this.onAfterComposeObservable.clear(), this.onSizeChangedObservable.clear();\n          }, r.prototype.getClassName = function() {\n            return \"EffectLayer\";\n          }, r.Parse = function(t, e, n) {\n            return Xe.b.Instantiate(t.customType).Parse(t, e, n);\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"EffectLayerSceneComponent\");\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"name\", void 0), Object(c.c)([Object(L.f)()], r.prototype, \"neutralColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.d)()], r.prototype, \"camera\", null), Object(c.c)([Object(L.c)()], r.prototype, \"renderingGroupId\", null), Object(c.c)([Object(L.c)()], r.prototype, \"disableBoundingBoxesFromEffectLayer\", void 0), r;\n        }();\n        V.a.AddParser(ot.a.NAME_EFFECTLAYER, function(r, t, e, n) {\n          if (r.effectLayers) {\n            e.effectLayers || (e.effectLayers = new Array());\n            for (var i = 0; i < r.effectLayers.length; i++) {\n              var o = no.Parse(r.effectLayers[i], t, n);\n              e.effectLayers.push(o);\n            }\n          }\n        }), V.a.prototype.removeEffectLayer = function(r) {\n          var t = this.effectLayers.indexOf(r);\n          return t !== -1 && this.effectLayers.splice(t, 1), t;\n        }, V.a.prototype.addEffectLayer = function(r) {\n          this.effectLayers.push(r);\n        };\n        var du = function() {\n          function r(t) {\n            this.name = ot.a.NAME_EFFECTLAYER, this._renderEffects = !1, this._needStencil = !1, this._previousStencilState = !1, this.scene = t, this._engine = t.getEngine(), t.effectLayers = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._isReadyForMeshStage.registerStep(ot.a.STEP_ISREADYFORMESH_EFFECTLAYER, this, this._isReadyForMesh), this.scene._cameraDrawRenderTargetStage.registerStep(ot.a.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER, this, this._renderMainTexture), this.scene._beforeCameraDrawStage.registerStep(ot.a.STEP_BEFORECAMERADRAW_EFFECTLAYER, this, this._setStencil), this.scene._afterRenderingGroupDrawStage.registerStep(ot.a.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW, this, this._drawRenderingGroup), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_EFFECTLAYER, this, this._setStencilBack), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW, this, this._drawCamera);\n          }, r.prototype.rebuild = function() {\n            for (var t = 0, e = this.scene.effectLayers; t < e.length; t++)\n              e[t]._rebuild();\n          }, r.prototype.serialize = function(t) {\n            t.effectLayers = [];\n            for (var e = 0, n = this.scene.effectLayers; e < n.length; e++) {\n              var i = n[e];\n              i.serialize && t.effectLayers.push(i.serialize());\n            }\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.effectLayers && t.effectLayers.forEach(function(n) {\n              e.scene.addEffectLayer(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            t.effectLayers && t.effectLayers.forEach(function(i) {\n              n.scene.removeEffectLayer(i), e && i.dispose();\n            });\n          }, r.prototype.dispose = function() {\n            for (var t = this.scene.effectLayers; t.length; )\n              t[0].dispose();\n          }, r.prototype._isReadyForMesh = function(t, e) {\n            for (var n = 0, i = this.scene.effectLayers; n < i.length; n++) {\n              var o = i[n];\n              if (o.hasMesh(t))\n                for (var a = 0, s = t.subMeshes; a < s.length; a++) {\n                  var d = s[a];\n                  if (!o.isReady(d, e))\n                    return !1;\n                }\n            }\n            return !0;\n          }, r.prototype._renderMainTexture = function(t) {\n            this._renderEffects = !1, this._needStencil = !1;\n            var e = !1, n = this.scene.effectLayers;\n            if (n && n.length > 0) {\n              this._previousStencilState = this._engine.getStencilBuffer();\n              for (var i = 0, o = n; i < o.length; i++) {\n                var a = o[i];\n                if (a.shouldRender() && (!a.camera || a.camera.cameraRigMode === _t.a.RIG_MODE_NONE && t === a.camera || a.camera.cameraRigMode !== _t.a.RIG_MODE_NONE && a.camera._rigCameras.indexOf(t) > -1)) {\n                  this._renderEffects = !0, this._needStencil = this._needStencil || a.needStencil();\n                  var s = a._mainTexture;\n                  s._shouldRender() && (this.scene.incrementRenderId(), s.render(!1, !1), e = !0);\n                }\n              }\n              this.scene.incrementRenderId();\n            }\n            return e;\n          }, r.prototype._setStencil = function() {\n            this._needStencil && this._engine.setStencilBuffer(!0);\n          }, r.prototype._setStencilBack = function() {\n            this._needStencil && this._engine.setStencilBuffer(this._previousStencilState);\n          }, r.prototype._draw = function(t) {\n            if (this._renderEffects) {\n              this._engine.setDepthBuffer(!1);\n              for (var e = this.scene.effectLayers, n = 0; n < e.length; n++) {\n                var i = e[n];\n                i.renderingGroupId === t && i.shouldRender() && i.render();\n              }\n              this._engine.setDepthBuffer(!0);\n            }\n          }, r.prototype._drawCamera = function() {\n            this._renderEffects && this._draw(-1);\n          }, r.prototype._drawRenderingGroup = function(t) {\n            !this.scene._isInIntermediateRendering() && this._renderEffects && this._draw(t);\n          }, r;\n        }();\n        no._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_EFFECTLAYER);\n          t || (t = new du(r), r._addComponent(t));\n        };\n        var n_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\n\nuniform float offset;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);\nbaseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);\nbaseColor.a=alpha;\nbaseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.glowMapMergePixelShader = n_;\n        var i_ = `\nattribute vec2 position;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.glowMapMergeVertexShader = i_, V.a.prototype.getGlowLayerByName = function(r) {\n          for (var t = 0; t < this.effectLayers.length; t++)\n            if (this.effectLayers[t].name === r && this.effectLayers[t].getEffectName() === Ko.EffectName)\n              return this.effectLayers[t];\n          return null;\n        };\n        var Ko = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n) || this;\n            return o._intensity = 1, o._includedOnlyMeshes = [], o._excludedMeshes = [], o._meshesUsingTheirOwnMaterials = [], o.neutralColor = new I.b(0, 0, 0, 1), o._options = Object(c.a)({ mainTextureRatio: t.DefaultTextureRatio, blurKernelSize: 32, mainTextureFixedSize: void 0, camera: null, mainTextureSamples: 1, renderingGroupId: -1 }, i), o._init({ alphaBlendingMode: h.a.ALPHA_ADD, camera: o._options.camera, mainTextureFixedSize: o._options.mainTextureFixedSize, mainTextureRatio: o._options.mainTextureRatio, renderingGroupId: o._options.renderingGroupId }), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"blurKernelSize\", { get: function() {\n            return this._horizontalBlurPostprocess1.kernel;\n          }, set: function(e) {\n            this._horizontalBlurPostprocess1.kernel = e, this._verticalBlurPostprocess1.kernel = e, this._horizontalBlurPostprocess2.kernel = e, this._verticalBlurPostprocess2.kernel = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._intensity;\n          }, set: function(e) {\n            this._intensity = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getEffectName = function() {\n            return t.EffectName;\n          }, t.prototype._createMergeEffect = function() {\n            return this._engine.createEffect(\"glowMapMerge\", [Oe.b.PositionKind], [\"offset\"], [\"textureSampler\", \"textureSampler2\"], `#define EMISSIVE \n`);\n          }, t.prototype._createTextureAndPostProcesses = function() {\n            var e = this, n = this._mainTextureDesiredSize.width, i = this._mainTextureDesiredSize.height;\n            n = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(n, this._maxSize) : n, i = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(i, this._maxSize) : i;\n            var o = 0;\n            o = this._engine.getCaps().textureHalfFloatRender ? h.a.TEXTURETYPE_HALF_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INT, this._blurTexture1 = new on(\"GlowLayerBlurRTT\", { width: n, height: i }, this._scene, !1, !0, o), this._blurTexture1.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture1.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture1.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._blurTexture1.renderParticles = !1, this._blurTexture1.ignoreCameraViewport = !0;\n            var a = Math.floor(n / 2), s = Math.floor(i / 2);\n            this._blurTexture2 = new on(\"GlowLayerBlurRTT2\", { width: a, height: s }, this._scene, !1, !0, o), this._blurTexture2.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture2.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture2.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._blurTexture2.renderParticles = !1, this._blurTexture2.ignoreCameraViewport = !0, this._textures = [this._blurTexture1, this._blurTexture2], this._horizontalBlurPostprocess1 = new _n(\"GlowLayerHBP1\", new u.d(1, 0), this._options.blurKernelSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess1.width = n, this._horizontalBlurPostprocess1.height = i, this._horizontalBlurPostprocess1.onApplyObservable.add(function(d) {\n              d.setTexture(\"textureSampler\", e._mainTexture);\n            }), this._verticalBlurPostprocess1 = new _n(\"GlowLayerVBP1\", new u.d(0, 1), this._options.blurKernelSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess2 = new _n(\"GlowLayerHBP2\", new u.d(1, 0), this._options.blurKernelSize / 2, { width: a, height: s }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess2.width = a, this._horizontalBlurPostprocess2.height = s, this._horizontalBlurPostprocess2.onApplyObservable.add(function(d) {\n              d.setTexture(\"textureSampler\", e._blurTexture1);\n            }), this._verticalBlurPostprocess2 = new _n(\"GlowLayerVBP2\", new u.d(0, 1), this._options.blurKernelSize / 2, { width: a, height: s }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1], this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._mainTexture.samples = this._options.mainTextureSamples, this._mainTexture.onAfterUnbindObservable.add(function() {\n              var d = e._blurTexture1.getInternalTexture();\n              if (d) {\n                e._scene.postProcessManager.directRender(e._postProcesses1, d, !0);\n                var p = e._blurTexture2.getInternalTexture();\n                p && e._scene.postProcessManager.directRender(e._postProcesses2, p, !0), e._engine.unBindFramebuffer(p ?? d, !0);\n              }\n            }), this._postProcesses.map(function(d) {\n              d.autoClear = !1;\n            });\n          }, t.prototype.isReady = function(e, n) {\n            var i = e.getMaterial(), o = e.getRenderingMesh();\n            if (!i || !o)\n              return !1;\n            var a = i.emissiveTexture;\n            return r.prototype._isReady.call(this, e, n, a);\n          }, t.prototype.needStencil = function() {\n            return !1;\n          }, t.prototype._canRenderMesh = function(e, n) {\n            return !0;\n          }, t.prototype._internalRender = function(e) {\n            e.setTexture(\"textureSampler\", this._blurTexture1), e.setTexture(\"textureSampler2\", this._blurTexture2), e.setFloat(\"offset\", this._intensity);\n            var n = this._engine, i = n.getStencilBuffer();\n            n.setStencilBuffer(!1), n.drawElementsType(zt.a.TriangleFillMode, 0, 6), n.setStencilBuffer(i);\n          }, t.prototype._setEmissiveTextureAndColor = function(e, n, i) {\n            var o = 1;\n            this.customEmissiveTextureSelector ? this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(e, n, i) : i ? (this._emissiveTextureAndColor.texture = i.emissiveTexture, this._emissiveTextureAndColor.texture && (o = this._emissiveTextureAndColor.texture.level)) : this._emissiveTextureAndColor.texture = null, this.customEmissiveColorSelector ? this.customEmissiveColorSelector(e, n, i, this._emissiveTextureAndColor.color) : i.emissiveColor ? this._emissiveTextureAndColor.color.set(i.emissiveColor.r * o, i.emissiveColor.g * o, i.emissiveColor.b * o, i.alpha) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);\n          }, t.prototype._shouldRenderMesh = function(e) {\n            return this.hasMesh(e);\n          }, t.prototype._addCustomEffectDefines = function(e) {\n            e.push(\"#define GLOW\");\n          }, t.prototype.addExcludedMesh = function(e) {\n            this._excludedMeshes.indexOf(e.uniqueId) === -1 && this._excludedMeshes.push(e.uniqueId);\n          }, t.prototype.removeExcludedMesh = function(e) {\n            var n = this._excludedMeshes.indexOf(e.uniqueId);\n            n !== -1 && this._excludedMeshes.splice(n, 1);\n          }, t.prototype.addIncludedOnlyMesh = function(e) {\n            this._includedOnlyMeshes.indexOf(e.uniqueId) === -1 && this._includedOnlyMeshes.push(e.uniqueId);\n          }, t.prototype.removeIncludedOnlyMesh = function(e) {\n            var n = this._includedOnlyMeshes.indexOf(e.uniqueId);\n            n !== -1 && this._includedOnlyMeshes.splice(n, 1);\n          }, t.prototype.hasMesh = function(e) {\n            return !!r.prototype.hasMesh.call(this, e) && (this._includedOnlyMeshes.length ? this._includedOnlyMeshes.indexOf(e.uniqueId) !== -1 : !this._excludedMeshes.length || this._excludedMeshes.indexOf(e.uniqueId) === -1);\n          }, t.prototype._useMeshMaterial = function(e) {\n            return this._meshesUsingTheirOwnMaterials.length != 0 && this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId) > -1;\n          }, t.prototype.referenceMeshToUseItsOwnMaterial = function(e) {\n            this._meshesUsingTheirOwnMaterials.push(e.uniqueId);\n          }, t.prototype.unReferenceMeshFromUsingItsOwnMaterial = function(e) {\n            for (var n = this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId); n >= 0; )\n              this._meshesUsingTheirOwnMaterials.splice(n, 1), n = this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);\n          }, t.prototype._disposeMesh = function(e) {\n            this.removeIncludedOnlyMesh(e), this.removeExcludedMesh(e);\n          }, t.prototype.getClassName = function() {\n            return \"GlowLayer\";\n          }, t.prototype.serialize = function() {\n            var e, n = L.a.Serialize(this);\n            if (n.customType = \"BABYLON.GlowLayer\", n.includedMeshes = [], this._includedOnlyMeshes.length)\n              for (e = 0; e < this._includedOnlyMeshes.length; e++)\n                (i = this._scene.getMeshByUniqueID(this._includedOnlyMeshes[e])) && n.includedMeshes.push(i.id);\n            if (n.excludedMeshes = [], this._excludedMeshes.length)\n              for (e = 0; e < this._excludedMeshes.length; e++) {\n                var i;\n                (i = this._scene.getMeshByUniqueID(this._excludedMeshes[e])) && n.excludedMeshes.push(i.id);\n              }\n            return n;\n          }, t.Parse = function(e, n, i) {\n            var o, a = L.a.Parse(function() {\n              return new t(e.name, n, e.options);\n            }, e, n, i);\n            for (o = 0; o < e.excludedMeshes.length; o++)\n              (s = n.getMeshByID(e.excludedMeshes[o])) && a.addExcludedMesh(s);\n            for (o = 0; o < e.includedMeshes.length; o++) {\n              var s;\n              (s = n.getMeshByID(e.includedMeshes[o])) && a.addIncludedOnlyMesh(s);\n            }\n            return a;\n          }, t.EffectName = \"GlowLayer\", t.DefaultBlurKernelSize = 32, t.DefaultTextureRatio = 0.5, Object(c.c)([Object(L.c)()], t.prototype, \"blurKernelSize\", null), Object(c.c)([Object(L.c)()], t.prototype, \"intensity\", null), Object(c.c)([Object(L.c)(\"options\")], t.prototype, \"_options\", void 0), t;\n        }(no);\n        O.a.RegisteredTypes[\"BABYLON.GlowLayer\"] = Ko;\n        var r_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\n\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\n\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\n\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.glowBlurPostProcessPixelShader = r_, V.a.prototype.getHighlightLayerByName = function(r) {\n          for (var t = 0; t < this.effectLayers.length; t++)\n            if (this.effectLayers[t].name === r && this.effectLayers[t].getEffectName() === Ms.EffectName)\n              return this.effectLayers[t];\n          return null;\n        };\n        var fu = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE);\n            var y = r.call(this, e, \"glowBlurPostProcess\", [\"screenSize\", \"direction\", \"blurWidth\"], null, o, a, s, d, p) || this;\n            return y.direction = n, y.kernel = i, y.onApplyObservable.add(function(P) {\n              P.setFloat2(\"screenSize\", y.width, y.height), P.setVector2(\"direction\", y.direction), P.setFloat(\"blurWidth\", y.kernel);\n            }), y;\n          }\n          return Object(c.d)(t, r), t;\n        }(ft), Ms = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n) || this;\n            return o.name = e, o.innerGlow = !0, o.outerGlow = !0, o.onBeforeBlurObservable = new C.c(), o.onAfterBlurObservable = new C.c(), o._instanceGlowingMeshStencilReference = t.GlowingMeshStencilReference++, o._meshes = {}, o._excludedMeshes = {}, o.neutralColor = t.NeutralColor, o._engine.isStencilEnable || l.a.Warn(\"Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }\"), o._options = Object(c.a)({ mainTextureRatio: 0.5, blurTextureSizeRatio: 0.5, blurHorizontalSize: 1, blurVerticalSize: 1, alphaBlendingMode: h.a.ALPHA_COMBINE, camera: null, renderingGroupId: -1 }, i), o._init({ alphaBlendingMode: o._options.alphaBlendingMode, camera: o._options.camera, mainTextureFixedSize: o._options.mainTextureFixedSize, mainTextureRatio: o._options.mainTextureRatio, renderingGroupId: o._options.renderingGroupId }), o._shouldRender = !1, o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"blurHorizontalSize\", { get: function() {\n            return this._horizontalBlurPostprocess.kernel;\n          }, set: function(e) {\n            this._horizontalBlurPostprocess.kernel = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurVerticalSize\", { get: function() {\n            return this._verticalBlurPostprocess.kernel;\n          }, set: function(e) {\n            this._verticalBlurPostprocess.kernel = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getEffectName = function() {\n            return t.EffectName;\n          }, t.prototype._createMergeEffect = function() {\n            return this._engine.createEffect(\"glowMapMerge\", [Oe.b.PositionKind], [\"offset\"], [\"textureSampler\"], this._options.isStroke ? `#define STROKE \n` : void 0);\n          }, t.prototype._createTextureAndPostProcesses = function() {\n            var e = this, n = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio, i = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;\n            n = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(n, this._maxSize) : n, i = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(i, this._maxSize) : i;\n            var o = 0;\n            o = this._engine.getCaps().textureHalfFloatRender ? h.a.TEXTURETYPE_HALF_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INT, this._blurTexture = new on(\"HighlightLayerBlurRTT\", { width: n, height: i }, this._scene, !1, !0, o), this._blurTexture.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture.anisotropicFilteringLevel = 16, this._blurTexture.updateSamplingMode(Ne.a.TRILINEAR_SAMPLINGMODE), this._blurTexture.renderParticles = !1, this._blurTexture.ignoreCameraViewport = !0, this._textures = [this._blurTexture], this._options.alphaBlendingMode === h.a.ALPHA_COMBINE ? (this._downSamplePostprocess = new Ci(\"HighlightLayerPPP\", this._options.blurTextureSizeRatio, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._downSamplePostprocess.onApplyObservable.add(function(a) {\n              a.setTexture(\"textureSampler\", e._mainTexture);\n            }), this._horizontalBlurPostprocess = new fu(\"HighlightLayerHBP\", new u.d(1, 0), this._options.blurHorizontalSize, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._horizontalBlurPostprocess.onApplyObservable.add(function(a) {\n              a.setFloat2(\"screenSize\", n, i);\n            }), this._verticalBlurPostprocess = new fu(\"HighlightLayerVBP\", new u.d(0, 1), this._options.blurVerticalSize, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._verticalBlurPostprocess.onApplyObservable.add(function(a) {\n              a.setFloat2(\"screenSize\", n, i);\n            }), this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess]) : (this._horizontalBlurPostprocess = new _n(\"HighlightLayerHBP\", new u.d(1, 0), this._options.blurHorizontalSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess.width = n, this._horizontalBlurPostprocess.height = i, this._horizontalBlurPostprocess.onApplyObservable.add(function(a) {\n              a.setTexture(\"textureSampler\", e._mainTexture);\n            }), this._verticalBlurPostprocess = new _n(\"HighlightLayerVBP\", new u.d(0, 1), this._options.blurVerticalSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess]), this._mainTexture.onAfterUnbindObservable.add(function() {\n              e.onBeforeBlurObservable.notifyObservers(e);\n              var a = e._blurTexture.getInternalTexture();\n              a && (e._scene.postProcessManager.directRender(e._postProcesses, a, !0), e._engine.unBindFramebuffer(a, !0)), e.onAfterBlurObservable.notifyObservers(e);\n            }), this._postProcesses.map(function(a) {\n              a.autoClear = !1;\n            });\n          }, t.prototype.needStencil = function() {\n            return !0;\n          }, t.prototype.isReady = function(e, n) {\n            var i = e.getMaterial(), o = e.getRenderingMesh();\n            if (!i || !o || !this._meshes)\n              return !1;\n            var a = null, s = this._meshes[o.uniqueId];\n            return s && s.glowEmissiveOnly && i && (a = i.emissiveTexture), r.prototype._isReady.call(this, e, n, a);\n          }, t.prototype._internalRender = function(e) {\n            e.setTexture(\"textureSampler\", this._blurTexture);\n            var n = this._engine;\n            n.cacheStencilState(), n.setStencilOperationPass(h.a.REPLACE), n.setStencilOperationFail(h.a.KEEP), n.setStencilOperationDepthFail(h.a.KEEP), n.setStencilMask(0), n.setStencilBuffer(!0), n.setStencilFunctionReference(this._instanceGlowingMeshStencilReference), this.outerGlow && (e.setFloat(\"offset\", 0), n.setStencilFunction(h.a.NOTEQUAL), n.drawElementsType(zt.a.TriangleFillMode, 0, 6)), this.innerGlow && (e.setFloat(\"offset\", 1), n.setStencilFunction(h.a.EQUAL), n.drawElementsType(zt.a.TriangleFillMode, 0, 6)), n.restoreStencilState();\n          }, t.prototype.shouldRender = function() {\n            return !!r.prototype.shouldRender.call(this) && !!this._meshes;\n          }, t.prototype._shouldRenderMesh = function(e) {\n            return (!this._excludedMeshes || !this._excludedMeshes[e.uniqueId]) && !!r.prototype.hasMesh.call(this, e);\n          }, t.prototype._canRenderMesh = function(e, n) {\n            return !0;\n          }, t.prototype._addCustomEffectDefines = function(e) {\n            e.push(\"#define HIGHLIGHT\");\n          }, t.prototype._setEmissiveTextureAndColor = function(e, n, i) {\n            var o = this._meshes[e.uniqueId];\n            o ? this._emissiveTextureAndColor.color.set(o.color.r, o.color.g, o.color.b, 1) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a), o && o.glowEmissiveOnly && i ? (this._emissiveTextureAndColor.texture = i.emissiveTexture, this._emissiveTextureAndColor.color.set(1, 1, 1, 1)) : this._emissiveTextureAndColor.texture = null;\n          }, t.prototype.addExcludedMesh = function(e) {\n            this._excludedMeshes && (this._excludedMeshes[e.uniqueId] || (this._excludedMeshes[e.uniqueId] = { mesh: e, beforeBind: e.onBeforeBindObservable.add(function(n) {\n              n.getEngine().setStencilBuffer(!1);\n            }), afterRender: e.onAfterRenderObservable.add(function(n) {\n              n.getEngine().setStencilBuffer(!0);\n            }) }));\n          }, t.prototype.removeExcludedMesh = function(e) {\n            if (this._excludedMeshes) {\n              var n = this._excludedMeshes[e.uniqueId];\n              n && (n.beforeBind && e.onBeforeBindObservable.remove(n.beforeBind), n.afterRender && e.onAfterRenderObservable.remove(n.afterRender)), this._excludedMeshes[e.uniqueId] = null;\n            }\n          }, t.prototype.hasMesh = function(e) {\n            return !!this._meshes && !!r.prototype.hasMesh.call(this, e) && this._meshes[e.uniqueId] !== void 0 && this._meshes[e.uniqueId] !== null;\n          }, t.prototype.addMesh = function(e, n, i) {\n            var o = this;\n            if (i === void 0 && (i = !1), this._meshes) {\n              var a = this._meshes[e.uniqueId];\n              a ? a.color = n : (this._meshes[e.uniqueId] = { mesh: e, color: n, observerHighlight: e.onBeforeBindObservable.add(function(s) {\n                o.isEnabled && (o._excludedMeshes && o._excludedMeshes[s.uniqueId] ? o._defaultStencilReference(s) : s.getScene().getEngine().setStencilFunctionReference(o._instanceGlowingMeshStencilReference));\n              }), observerDefault: e.onAfterRenderObservable.add(function(s) {\n                o.isEnabled && o._defaultStencilReference(s);\n              }), glowEmissiveOnly: i }, e.onDisposeObservable.add(function() {\n                o._disposeMesh(e);\n              })), this._shouldRender = !0;\n            }\n          }, t.prototype.removeMesh = function(e) {\n            if (this._meshes) {\n              var n = this._meshes[e.uniqueId];\n              for (var i in n && (n.observerHighlight && e.onBeforeBindObservable.remove(n.observerHighlight), n.observerDefault && e.onAfterRenderObservable.remove(n.observerDefault), delete this._meshes[e.uniqueId]), this._shouldRender = !1, this._meshes)\n                if (this._meshes[i]) {\n                  this._shouldRender = !0;\n                  break;\n                }\n            }\n          }, t.prototype.removeAllMeshes = function() {\n            if (this._meshes) {\n              for (var e in this._meshes)\n                if (this._meshes.hasOwnProperty(e)) {\n                  var n = this._meshes[e];\n                  n && this.removeMesh(n.mesh);\n                }\n            }\n          }, t.prototype._defaultStencilReference = function(e) {\n            e.getScene().getEngine().setStencilFunctionReference(t.NormalMeshStencilReference);\n          }, t.prototype._disposeMesh = function(e) {\n            this.removeMesh(e), this.removeExcludedMesh(e);\n          }, t.prototype.dispose = function() {\n            if (this._meshes) {\n              for (var e in this._meshes)\n                (n = this._meshes[e]) && n.mesh && (n.observerHighlight && n.mesh.onBeforeBindObservable.remove(n.observerHighlight), n.observerDefault && n.mesh.onAfterRenderObservable.remove(n.observerDefault));\n              this._meshes = null;\n            }\n            if (this._excludedMeshes) {\n              for (var e in this._excludedMeshes) {\n                var n;\n                (n = this._excludedMeshes[e]) && (n.beforeBind && n.mesh.onBeforeBindObservable.remove(n.beforeBind), n.afterRender && n.mesh.onAfterRenderObservable.remove(n.afterRender));\n              }\n              this._excludedMeshes = null;\n            }\n            r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"HighlightLayer\";\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            if (e.customType = \"BABYLON.HighlightLayer\", e.meshes = [], this._meshes)\n              for (var n in this._meshes) {\n                var i = this._meshes[n];\n                i && e.meshes.push({ glowEmissiveOnly: i.glowEmissiveOnly, color: i.color.asArray(), meshId: i.mesh.id });\n              }\n            if (e.excludedMeshes = [], this._excludedMeshes)\n              for (var o in this._excludedMeshes) {\n                var a = this._excludedMeshes[o];\n                a && e.excludedMeshes.push(a.mesh.id);\n              }\n            return e;\n          }, t.Parse = function(e, n, i) {\n            var o, a = L.a.Parse(function() {\n              return new t(e.name, n, e.options);\n            }, e, n, i);\n            for (o = 0; o < e.excludedMeshes.length; o++)\n              (s = n.getMeshByID(e.excludedMeshes[o])) && a.addExcludedMesh(s);\n            for (o = 0; o < e.meshes.length; o++) {\n              var s, d = e.meshes[o];\n              (s = n.getMeshByID(d.meshId)) && a.addMesh(s, I.a.FromArray(d.color), d.glowEmissiveOnly);\n            }\n            return a;\n          }, t.EffectName = \"HighlightLayer\", t.NeutralColor = new I.b(0, 0, 0, 0), t.GlowingMeshStencilReference = 2, t.NormalMeshStencilReference = 1, Object(c.c)([Object(L.c)()], t.prototype, \"innerGlow\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"outerGlow\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"blurHorizontalSize\", null), Object(c.c)([Object(L.c)()], t.prototype, \"blurVerticalSize\", null), Object(c.c)([Object(L.c)(\"options\")], t.prototype, \"_options\", void 0), t;\n        }(no);\n        O.a.RegisteredTypes[\"BABYLON.HighlightLayer\"] = Ms;\n        var pu = function() {\n          function r(t) {\n            this.name = ot.a.NAME_LAYER, this.scene = t, this._engine = t.getEngine(), t.layers = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraDrawStage.registerStep(ot.a.STEP_BEFORECAMERADRAW_LAYER, this, this._drawCameraBackground), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_LAYER, this, this._drawCameraForeground), this.scene._beforeRenderTargetDrawStage.registerStep(ot.a.STEP_BEFORERENDERTARGETDRAW_LAYER, this, this._drawRenderTargetBackground), this.scene._afterRenderTargetDrawStage.registerStep(ot.a.STEP_AFTERRENDERTARGETDRAW_LAYER, this, this._drawRenderTargetForeground);\n          }, r.prototype.rebuild = function() {\n            for (var t = 0, e = this.scene.layers; t < e.length; t++)\n              e[t]._rebuild();\n          }, r.prototype.dispose = function() {\n            for (var t = this.scene.layers; t.length; )\n              t[0].dispose();\n          }, r.prototype._draw = function(t) {\n            var e = this.scene.layers;\n            if (e.length) {\n              this._engine.setDepthBuffer(!1);\n              for (var n = 0, i = e; n < i.length; n++) {\n                var o = i[n];\n                t(o) && o.render();\n              }\n              this._engine.setDepthBuffer(!0);\n            }\n          }, r.prototype._drawCameraPredicate = function(t, e, n) {\n            return !t.renderOnlyInRenderTargetTextures && t.isBackground === e && (t.layerMask & n) != 0;\n          }, r.prototype._drawCameraBackground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawCameraPredicate(n, !0, t.layerMask);\n            });\n          }, r.prototype._drawCameraForeground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawCameraPredicate(n, !1, t.layerMask);\n            });\n          }, r.prototype._drawRenderTargetPredicate = function(t, e, n, i) {\n            return t.renderTargetTextures.length > 0 && t.isBackground === e && t.renderTargetTextures.indexOf(i) > -1 && (t.layerMask & n) != 0;\n          }, r.prototype._drawRenderTargetBackground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawRenderTargetPredicate(n, !0, e.scene.activeCamera.layerMask, t);\n            });\n          }, r.prototype._drawRenderTargetForeground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawRenderTargetPredicate(n, !1, e.scene.activeCamera.layerMask, t);\n            });\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.layers && t.layers.forEach(function(n) {\n              e.scene.layers.push(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            e === void 0 && (e = !1), t.layers && t.layers.forEach(function(i) {\n              var o = n.scene.layers.indexOf(i);\n              o !== -1 && n.scene.layers.splice(o, 1), e && i.dispose();\n            });\n          }, r;\n        }(), o_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\n\n#include<helperFunctions>\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef LINEAR\nbaseColor.rgb=toGammaSpace(baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}`;\n        ze.a.ShadersStore.layerPixelShader = o_;\n        var a_ = `\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}`;\n        ze.a.ShadersStore.layerVertexShader = a_;\n        var s_ = function() {\n          function r(t, e, n, i, o) {\n            this.name = t, this.scale = new u.d(1, 1), this.offset = new u.d(0, 0), this.alphaBlendingMode = h.a.ALPHA_COMBINE, this.layerMask = 268435455, this.renderTargetTextures = [], this.renderOnlyInRenderTargetTextures = !1, this._vertexBuffers = {}, this.onDisposeObservable = new C.c(), this.onBeforeRenderObservable = new C.c(), this.onAfterRenderObservable = new C.c(), this.texture = e ? new Ne.a(e, n, !0) : null, this.isBackground = i === void 0 || i, this.color = o === void 0 ? new I.b(1, 1, 1, 1) : o, this._scene = n || te.a.LastCreatedScene;\n            var a = this._scene._getComponent(ot.a.NAME_LAYER);\n            a || (a = new pu(this._scene), this._scene._addComponent(a)), this._scene.layers.push(this);\n            var s = this._scene.getEngine(), d = [];\n            d.push(1, 1), d.push(-1, 1), d.push(-1, -1), d.push(1, -1);\n            var p = new Oe.b(s, d, Oe.b.PositionKind, !1, !1, 2);\n            this._vertexBuffers[Oe.b.PositionKind] = p, this._createIndexBuffer();\n          }\n          return Object.defineProperty(r.prototype, \"onDispose\", { set: function(t) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onBeforeRender\", { set: function(t) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onAfterRender\", { set: function(t) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._createIndexBuffer = function() {\n            var t = this._scene.getEngine(), e = [];\n            e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = t.createIndexBuffer(e);\n          }, r.prototype._rebuild = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && t._rebuild(), this._createIndexBuffer();\n          }, r.prototype.render = function() {\n            var t = this._scene.getEngine(), e = \"\";\n            this.alphaTest && (e = \"#define ALPHATEST\"), this.texture && !this.texture.gammaSpace && (e += `\\r\n#define LINEAR`), this._previousDefines !== e && (this._previousDefines = e, this._effect = t.createEffect(\"layer\", [Oe.b.PositionKind], [\"textureMatrix\", \"color\", \"scale\", \"offset\"], [\"textureSampler\"], e));\n            var n = this._effect;\n            n && n.isReady() && this.texture && this.texture.isReady() && (t = this._scene.getEngine(), this.onBeforeRenderObservable.notifyObservers(this), t.enableEffect(n), t.setState(!1), n.setTexture(\"textureSampler\", this.texture), n.setMatrix(\"textureMatrix\", this.texture.getTextureMatrix()), n.setFloat4(\"color\", this.color.r, this.color.g, this.color.b, this.color.a), n.setVector2(\"offset\", this.offset), n.setVector2(\"scale\", this.scale), t.bindBuffers(this._vertexBuffers, this._indexBuffer, n), this.alphaTest ? t.drawElementsType(zt.a.TriangleFillMode, 0, 6) : (t.setAlphaMode(this.alphaBlendingMode), t.drawElementsType(zt.a.TriangleFillMode, 0, 6), t.setAlphaMode(h.a.ALPHA_DISABLE)), this.onAfterRenderObservable.notifyObservers(this));\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this.texture && (this.texture.dispose(), this.texture = null), this.renderTargetTextures = [];\n            var e = this._scene.layers.indexOf(this);\n            this._scene.layers.splice(e, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderObservable.clear();\n          }, r;\n        }(), _u = function() {\n          function r(t, e, n, i, o) {\n            this.size = t, this.position = e, this.alphaMode = h.a.ALPHA_ONEONE, this.color = n || new I.a(1, 1, 1), this.texture = i ? new Ne.a(i, o.getScene(), !0) : null, this._system = o, o.lensFlares.push(this);\n          }\n          return r.AddFlare = function(t, e, n, i, o) {\n            return new r(t, e, n, i, o);\n          }, r.prototype.dispose = function() {\n            this.texture && this.texture.dispose();\n            var t = this._system.lensFlares.indexOf(this);\n            this._system.lensFlares.splice(t, 1);\n          }, r;\n        }(), c_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}`;\n        ze.a.ShadersStore.lensFlarePixelShader = c_;\n        var l_ = `\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.lensFlareVertexShader = l_;\n        var Is = function() {\n          function r(t, e, n) {\n            this.name = t, this.lensFlares = new Array(), this.borderLimit = 300, this.viewportBorder = 0, this.layerMask = 268435455, this._vertexBuffers = {}, this._isEnabled = !0, this._scene = n || te.a.LastCreatedScene, r._SceneComponentInitialization(this._scene), this._emitter = e, this.id = t, n.lensFlareSystems.push(this), this.meshesSelectionPredicate = function(s) {\n              return n.activeCamera && s.material && s.isVisible && s.isEnabled() && s.isBlocker && (s.layerMask & n.activeCamera.layerMask) != 0;\n            };\n            var i = n.getEngine(), o = [];\n            o.push(1, 1), o.push(-1, 1), o.push(-1, -1), o.push(1, -1), this._vertexBuffers[Oe.b.PositionKind] = new Oe.b(i, o, Oe.b.PositionKind, !1, !1, 2);\n            var a = [];\n            a.push(0), a.push(1), a.push(2), a.push(0), a.push(2), a.push(3), this._indexBuffer = i.createIndexBuffer(a), this._effect = i.createEffect(\"lensFlare\", [Oe.b.PositionKind], [\"color\", \"viewportMatrix\"], [\"textureSampler\"], \"\");\n          }\n          return Object.defineProperty(r.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(t) {\n            this._isEnabled = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getScene = function() {\n            return this._scene;\n          }, r.prototype.getEmitter = function() {\n            return this._emitter;\n          }, r.prototype.setEmitter = function(t) {\n            this._emitter = t;\n          }, r.prototype.getEmitterPosition = function() {\n            return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;\n          }, r.prototype.computeEffectivePosition = function(t) {\n            var e = this.getEmitterPosition();\n            return e = u.e.Project(e, u.a.Identity(), this._scene.getTransformMatrix(), t), this._positionX = e.x, this._positionY = e.y, e = u.e.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix()), this.viewportBorder > 0 && (t.x -= this.viewportBorder, t.y -= this.viewportBorder, t.width += 2 * this.viewportBorder, t.height += 2 * this.viewportBorder, e.x += this.viewportBorder, e.y += this.viewportBorder, this._positionX += this.viewportBorder, this._positionY += this.viewportBorder), e.z > 0 && (this._positionX > t.x && this._positionX < t.x + t.width && this._positionY > t.y && (this._positionY, t.y, t.height), !0);\n          }, r.prototype._isVisible = function() {\n            if (!this._isEnabled || !this._scene.activeCamera)\n              return !1;\n            var t = this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition), e = t.length();\n            t.normalize();\n            var n = new dn.a(this._scene.activeCamera.globalPosition, t), i = this._scene.pickWithRay(n, this.meshesSelectionPredicate, !0);\n            return !i || !i.hit || i.distance > e;\n          }, r.prototype.render = function() {\n            if (!this._effect.isReady() || !this._scene.activeCamera)\n              return !1;\n            var t, e, n = this._scene.getEngine(), i = this._scene.activeCamera.viewport.toGlobal(n.getRenderWidth(!0), n.getRenderHeight(!0));\n            if (!this.computeEffectivePosition(i) || !this._isVisible())\n              return !1;\n            var o = (t = this._positionX < this.borderLimit + i.x ? this.borderLimit + i.x - this._positionX : this._positionX > i.x + i.width - this.borderLimit ? this._positionX - i.x - i.width + this.borderLimit : 0) > (e = this._positionY < this.borderLimit + i.y ? this.borderLimit + i.y - this._positionY : this._positionY > i.y + i.height - this.borderLimit ? this._positionY - i.y - i.height + this.borderLimit : 0) ? t : e;\n            (o -= this.viewportBorder) > this.borderLimit && (o = this.borderLimit);\n            var a = 1 - $.a.Clamp(o / this.borderLimit, 0, 1);\n            if (a < 0)\n              return !1;\n            a > 1 && (a = 1), this.viewportBorder > 0 && (i.x += this.viewportBorder, i.y += this.viewportBorder, i.width -= 2 * this.viewportBorder, i.height -= 2 * this.viewportBorder, this._positionX -= this.viewportBorder, this._positionY -= this.viewportBorder);\n            var s = i.x + i.width / 2, d = i.y + i.height / 2, p = s - this._positionX, y = d - this._positionY;\n            n.enableEffect(this._effect), n.setState(!1), n.setDepthBuffer(!1), n.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect);\n            for (var P = 0; P < this.lensFlares.length; P++) {\n              var R = this.lensFlares[P];\n              if (!R.texture || R.texture.isReady()) {\n                n.setAlphaMode(R.alphaMode);\n                var B = s - p * R.position, F = d - y * R.position, z = R.size, J = R.size * n.getAspectRatio(this._scene.activeCamera, !0), ie = B / (i.width + 2 * i.x) * 2 - 1, se = 1 - F / (i.height + 2 * i.y) * 2, ce = u.a.FromValues(z / 2, 0, 0, 0, 0, J / 2, 0, 0, 0, 0, 1, 0, ie, se, 0, 1);\n                this._effect.setMatrix(\"viewportMatrix\", ce), this._effect.setTexture(\"textureSampler\", R.texture), this._effect.setFloat4(\"color\", R.color.r * a, R.color.g * a, R.color.b * a, 1), n.drawElementsType(zt.a.TriangleFillMode, 0, 6);\n              }\n            }\n            return n.setDepthBuffer(!0), n.setAlphaMode(h.a.ALPHA_DISABLE), !0;\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            for (t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null); this.lensFlares.length; )\n              this.lensFlares[0].dispose();\n            var e = this._scene.lensFlareSystems.indexOf(this);\n            this._scene.lensFlareSystems.splice(e, 1);\n          }, r.Parse = function(t, e, n) {\n            var i = e.getLastEntryByID(t.emitterId), o = t.name || \"lensFlareSystem#\" + t.emitterId, a = new r(o, i, e);\n            a.id = t.id || o, a.borderLimit = t.borderLimit;\n            for (var s = 0; s < t.flares.length; s++) {\n              var d = t.flares[s];\n              _u.AddFlare(d.size, d.position, I.a.FromArray(d.color), d.textureName ? n + d.textureName : \"\", a);\n            }\n            return a;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.id = this.id, t.name = this.name, t.emitterId = this.getEmitter().id, t.borderLimit = this.borderLimit, t.flares = [];\n            for (var e = 0; e < this.lensFlares.length; e++) {\n              var n = this.lensFlares[e];\n              t.flares.push({ size: n.size, position: n.position, color: n.color.asArray(), textureName: Xe.b.GetFilename(n.texture ? n.texture.name : \"\") });\n            }\n            return t;\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"LensFlareSystemSceneComponent\");\n          }, r;\n        }();\n        V.a.AddParser(ot.a.NAME_LENSFLARESYSTEM, function(r, t, e, n) {\n          if (r.lensFlareSystems !== void 0 && r.lensFlareSystems !== null) {\n            e.lensFlareSystems || (e.lensFlareSystems = new Array());\n            for (var i = 0, o = r.lensFlareSystems.length; i < o; i++) {\n              var a = r.lensFlareSystems[i], s = Is.Parse(a, t, n);\n              e.lensFlareSystems.push(s);\n            }\n          }\n        }), V.a.prototype.getLensFlareSystemByName = function(r) {\n          for (var t = 0; t < this.lensFlareSystems.length; t++)\n            if (this.lensFlareSystems[t].name === r)\n              return this.lensFlareSystems[t];\n          return null;\n        }, V.a.prototype.getLensFlareSystemByID = function(r) {\n          for (var t = 0; t < this.lensFlareSystems.length; t++)\n            if (this.lensFlareSystems[t].id === r)\n              return this.lensFlareSystems[t];\n          return null;\n        }, V.a.prototype.removeLensFlareSystem = function(r) {\n          var t = this.lensFlareSystems.indexOf(r);\n          return t !== -1 && this.lensFlareSystems.splice(t, 1), t;\n        }, V.a.prototype.addLensFlareSystem = function(r) {\n          this.lensFlareSystems.push(r);\n        };\n        var mu = function() {\n          function r(t) {\n            this.name = ot.a.NAME_LENSFLARESYSTEM, this.scene = t, t.lensFlareSystems = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM, this, this._draw);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.lensFlareSystems && t.lensFlareSystems.forEach(function(n) {\n              e.scene.addLensFlareSystem(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            t.lensFlareSystems && t.lensFlareSystems.forEach(function(i) {\n              n.scene.removeLensFlareSystem(i), e && i.dispose();\n            });\n          }, r.prototype.serialize = function(t) {\n            t.lensFlareSystems = [];\n            for (var e = 0, n = this.scene.lensFlareSystems; e < n.length; e++) {\n              var i = n[e];\n              t.lensFlareSystems.push(i.serialize());\n            }\n          }, r.prototype.dispose = function() {\n            for (var t = this.scene.lensFlareSystems; t.length; )\n              t[0].dispose();\n          }, r.prototype._draw = function(t) {\n            if (this.scene.lensFlaresEnabled) {\n              var e = this.scene.lensFlareSystems;\n              Xe.b.StartPerformanceCounter(\"Lens flares\", e.length > 0);\n              for (var n = 0, i = e; n < i.length; n++) {\n                var o = i[n];\n                t.layerMask & o.layerMask && o.render();\n              }\n              Xe.b.EndPerformanceCounter(\"Lens flares\", e.length > 0);\n            }\n          }, r;\n        }();\n        Is._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_LENSFLARESYSTEM);\n          t || (t = new mu(r), r._addComponent(t));\n        };\n        var u_ = `\n\n\n\n\nfloat bayerDither2(vec2 _P) {\nreturn mod(2.0*_P.y+_P.x+1.0,4.0);\n}\n\n\nfloat bayerDither4(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nreturn 4.0*bayerDither2(P1)+bayerDither2(P2);\n}\n\nfloat bayerDither8(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nvec2 P4=floor(0.25*mod(_P,8.0));\nreturn 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);\n}\n`;\n        ze.a.IncludesShadersStore.bayerDitherFunctions = u_;\n        var h_ = `#if SM_FLOAT == 0\n#include<packingFunctions>\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#include<bayerDitherFunctions>\nuniform float softTransparentShadowSM;\n#endif\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nuniform vec3 lightDataSM;\nvarying vec3 vPositionWSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapFragmentDeclaration = h_;\n        var d_ = ` float depthSM=vDepthMetricSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\n#if SM_USEDISTANCE == 1\ndepthSM=clamp(((length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#else\ndepthSM=clamp(((zSM+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#endif\ngl_FragDepth=depthSM;\n#elif SM_USEDISTANCE == 1\ndepthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y)+biasAndScaleSM.x;\n#endif\n#if SM_ESM == 1\ndepthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);\n#endif\n#if SM_FLOAT == 1\ngl_FragColor=vec4(depthSM,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depthSM);\n#endif\nreturn;`;\n        ze.a.IncludesShadersStore.shadowMapFragment = d_;\n        var f_ = `#include<shadowMapFragmentDeclaration>\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void)\n{\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nfloat alphaFromAlphaTexture=texture2D(diffuseSampler,vUV).a;\nif (alphaFromAlphaTexture<0.4)\ndiscard;\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#ifdef ALPHATEST\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alphaFromAlphaTexture) discard;\n#else\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM) discard;\n#endif\n#endif\n#include<shadowMapFragment>\n}`;\n        ze.a.ShadersStore.shadowMapPixelShader = f_;\n        var p_ = `#if SM_NORMALBIAS == 1\nuniform vec3 lightDataSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nvarying vec3 vPositionWSM;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapVertexDeclaration = p_;\n        var __ = `\n#if SM_NORMALBIAS == 1\n#if SM_DIRECTIONINLIGHTDATA == 1\nvec3 worldLightDirSM=normalize(-lightDataSM.xyz);\n#else\nvec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;\nvec3 worldLightDirSM=normalize(directionToLightSM);\n#endif\nfloat ndlSM=dot(vNormalW,worldLightDirSM);\nfloat sinNLSM=sqrt(1.0-ndlSM*ndlSM);\nfloat normalBiasSM=biasAndScaleSM.y*sinNLSM;\nworldPos.xyz-=vNormalW*normalBiasSM;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapVertexNormalBias = __;\n        var m_ = `#if SM_USEDISTANCE == 1\nvPositionWSM=worldPos.xyz;\n#endif\n#if SM_DEPTHTEXTURE == 1\n\ngl_Position.z+=biasAndScaleSM.x*gl_Position.w;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nzSM=gl_Position.z;\ngl_Position.z=0.0;\n#elif SM_USEDISTANCE == 0\n\nvDepthMetricSM=((gl_Position.z+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapVertexMetric = m_;\n        var g_ = `\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\n#include<helperFunctions>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<shadowMapVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normWorldSM=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));\nvNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvec3 vNormalW=normalize(normWorldSM*normalUpdated);\n#endif\n#endif\n#include<shadowMapVertexNormalBias>\n\ngl_Position=viewProjection*worldPos;\n#include<shadowMapVertexMetric>\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<clipPlaneVertex>\n}`;\n        ze.a.ShadersStore.shadowMapVertexShader = g_;\n        var v_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}`;\n        ze.a.ShadersStore.depthBoxBlurPixelShader = v_;\n        var y_ = `#if SM_SOFTTRANSPARENTSHADOW == 1\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow = y_;\n        var gu = new u.a(), vu = new u.a(), Fn = function() {\n          function r(t, e, n) {\n            this.onBeforeShadowMapRenderObservable = new C.c(), this.onAfterShadowMapRenderObservable = new C.c(), this.onBeforeShadowMapRenderMeshObservable = new C.c(), this.onAfterShadowMapRenderMeshObservable = new C.c(), this._bias = 5e-5, this._normalBias = 0, this._blurBoxOffset = 1, this._blurScale = 2, this._blurKernel = 1, this._useKernelBlur = !1, this._filter = r.FILTER_NONE, this._filteringQuality = r.QUALITY_HIGH, this._contactHardeningLightSizeUVRatio = 0.1, this._darkness = 0, this._transparencyShadow = !1, this.enableSoftTransparentShadow = !1, this.frustumEdgeFalloff = 0, this.forceBackFacesOnly = !1, this._lightDirection = u.e.Zero(), this._viewMatrix = u.a.Zero(), this._projectionMatrix = u.a.Zero(), this._transformMatrix = u.a.Zero(), this._cachedPosition = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cachedDirection = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._currentFaceIndex = 0, this._currentFaceIndexCache = 0, this._defaultTextureMatrix = u.a.Identity(), this._mapSize = t, this._light = e, this._scene = e.getScene(), e._shadowGenerator = this, this.id = e.id, r._SceneComponentInitialization(this._scene);\n            var i = this._scene.getEngine().getCaps();\n            n ? i.textureFloatRender && i.textureFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_FLOAT : i.textureHalfFloatRender && i.textureHalfFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_HALF_FLOAT : this._textureType = h.a.TEXTURETYPE_UNSIGNED_INT : i.textureHalfFloatRender && i.textureHalfFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_HALF_FLOAT : i.textureFloatRender && i.textureFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_FLOAT : this._textureType = h.a.TEXTURETYPE_UNSIGNED_INT, this._initializeGenerator(), this._applyFilterValues();\n          }\n          return Object.defineProperty(r.prototype, \"bias\", { get: function() {\n            return this._bias;\n          }, set: function(t) {\n            this._bias = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"normalBias\", { get: function() {\n            return this._normalBias;\n          }, set: function(t) {\n            this._normalBias = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blurBoxOffset\", { get: function() {\n            return this._blurBoxOffset;\n          }, set: function(t) {\n            this._blurBoxOffset !== t && (this._blurBoxOffset = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blurScale\", { get: function() {\n            return this._blurScale;\n          }, set: function(t) {\n            this._blurScale !== t && (this._blurScale = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blurKernel\", { get: function() {\n            return this._blurKernel;\n          }, set: function(t) {\n            this._blurKernel !== t && (this._blurKernel = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useKernelBlur\", { get: function() {\n            return this._useKernelBlur;\n          }, set: function(t) {\n            this._useKernelBlur !== t && (this._useKernelBlur = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"depthScale\", { get: function() {\n            return this._depthScale !== void 0 ? this._depthScale : this._light.getDepthScale();\n          }, set: function(t) {\n            this._depthScale = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype._validateFilter = function(t) {\n            return t;\n          }, Object.defineProperty(r.prototype, \"filter\", { get: function() {\n            return this._filter;\n          }, set: function(t) {\n            if (t = this._validateFilter(t), this._light.needCube()) {\n              if (t === r.FILTER_BLUREXPONENTIALSHADOWMAP)\n                return void (this.useExponentialShadowMap = !0);\n              if (t === r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)\n                return void (this.useCloseExponentialShadowMap = !0);\n              if (t === r.FILTER_PCF || t === r.FILTER_PCSS)\n                return void (this.usePoissonSampling = !0);\n            }\n            t !== r.FILTER_PCF && t !== r.FILTER_PCSS || this._scene.getEngine().webGLVersion !== 1 ? this._filter !== t && (this._filter = t, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty()) : this.usePoissonSampling = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"usePoissonSampling\", { get: function() {\n            return this.filter === r.FILTER_POISSONSAMPLING;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_POISSONSAMPLING);\n            (t || this.filter === r.FILTER_POISSONSAMPLING) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_EXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_EXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_EXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useBlurExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_BLUREXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_BLUREXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_BLUREXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useCloseExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_CLOSEEXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_CLOSEEXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_CLOSEEXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useBlurCloseExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"usePercentageCloserFiltering\", { get: function() {\n            return this.filter === r.FILTER_PCF;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_PCF);\n            (t || this.filter === r.FILTER_PCF) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"filteringQuality\", { get: function() {\n            return this._filteringQuality;\n          }, set: function(t) {\n            this._filteringQuality !== t && (this._filteringQuality = t, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useContactHardeningShadow\", { get: function() {\n            return this.filter === r.FILTER_PCSS;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_PCSS);\n            (t || this.filter === r.FILTER_PCSS) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"contactHardeningLightSizeUVRatio\", { get: function() {\n            return this._contactHardeningLightSizeUVRatio;\n          }, set: function(t) {\n            this._contactHardeningLightSizeUVRatio = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"darkness\", { get: function() {\n            return this._darkness;\n          }, set: function(t) {\n            this.setDarkness(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.getDarkness = function() {\n            return this._darkness;\n          }, r.prototype.setDarkness = function(t) {\n            return this._darkness = t >= 1 ? 1 : t <= 0 ? 0 : t, this;\n          }, Object.defineProperty(r.prototype, \"transparencyShadow\", { get: function() {\n            return this._transparencyShadow;\n          }, set: function(t) {\n            this.setTransparencyShadow(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.setTransparencyShadow = function(t) {\n            return this._transparencyShadow = t, this;\n          }, r.prototype.getShadowMap = function() {\n            return this._shadowMap;\n          }, r.prototype.getShadowMapForRendering = function() {\n            return this._shadowMap2 ? this._shadowMap2 : this._shadowMap;\n          }, r.prototype.getClassName = function() {\n            return r.CLASSNAME;\n          }, r.prototype.addShadowCaster = function(t, e) {\n            var n;\n            return e === void 0 && (e = !0), this._shadowMap ? (this._shadowMap.renderList || (this._shadowMap.renderList = []), this._shadowMap.renderList.push(t), e && (n = this._shadowMap.renderList).push.apply(n, t.getChildMeshes()), this) : this;\n          }, r.prototype.removeShadowCaster = function(t, e) {\n            if (e === void 0 && (e = !0), !this._shadowMap || !this._shadowMap.renderList)\n              return this;\n            var n = this._shadowMap.renderList.indexOf(t);\n            if (n !== -1 && this._shadowMap.renderList.splice(n, 1), e)\n              for (var i = 0, o = t.getChildren(); i < o.length; i++) {\n                var a = o[i];\n                this.removeShadowCaster(a);\n              }\n            return this;\n          }, r.prototype.getLight = function() {\n            return this._light;\n          }, Object.defineProperty(r.prototype, \"mapSize\", { get: function() {\n            return this._mapSize;\n          }, set: function(t) {\n            this._mapSize = t, this._light._markMeshesAsLightDirty(), this.recreateShadowMap();\n          }, enumerable: !1, configurable: !0 }), r.prototype._initializeGenerator = function() {\n            this._light._markMeshesAsLightDirty(), this._initializeShadowMap();\n          }, r.prototype._createTargetRenderTexture = function() {\n            this._scene.getEngine().webGLVersion > 1 ? (this._shadowMap = new on(this._light.name + \"_shadowMap\", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube(), void 0, !1, !1), this._shadowMap.createDepthStencilTexture(h.a.LESS, !0)) : this._shadowMap = new on(this._light.name + \"_shadowMap\", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube());\n          }, r.prototype._initializeShadowMap = function() {\n            var t = this;\n            if (this._createTargetRenderTexture(), this._shadowMap !== null) {\n              this._shadowMap.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap.anisotropicFilteringLevel = 1, this._shadowMap.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._shadowMap.renderParticles = !1, this._shadowMap.ignoreCameraViewport = !0, this._storedUniqueId && (this._shadowMap.uniqueId = this._storedUniqueId), this._shadowMap.customRenderFunction = this._renderForShadowMap.bind(this), this._shadowMap.customIsReadyFunction = function(a, s) {\n                return !0;\n              };\n              var e = this._scene.getEngine();\n              this._shadowMap.onBeforeRenderObservable.add(function(a) {\n                if (t._currentFaceIndex = a, t._filter === r.FILTER_PCF && e.setColorWrite(!1), t._scene.getSceneUniformBuffer().useUbo) {\n                  var s = t._scene.getSceneUniformBuffer();\n                  s.updateMatrix(\"viewProjection\", t.getTransformMatrix()), s.updateMatrix(\"view\", t._viewMatrix), s.update();\n                }\n              }), this._shadowMap.onAfterUnbindObservable.add(function() {\n                if (t._scene.getSceneUniformBuffer().useUbo) {\n                  var a = t._scene.getSceneUniformBuffer();\n                  a.updateMatrix(\"viewProjection\", t._scene.getTransformMatrix()), a.updateMatrix(\"view\", t._scene.getViewMatrix()), a.update();\n                }\n                if (t._filter === r.FILTER_PCF && e.setColorWrite(!0), t.useBlurExponentialShadowMap || t.useBlurCloseExponentialShadowMap) {\n                  var s = t.getShadowMapForRendering();\n                  if (s) {\n                    var d = s.getInternalTexture();\n                    t._scene.postProcessManager.directRender(t._blurPostProcesses, d, !0), e.unBindFramebuffer(d, !0);\n                  }\n                }\n              });\n              var n = new I.b(0, 0, 0, 0), i = new I.b(1, 1, 1, 1);\n              this._shadowMap.onClearObservable.add(function(a) {\n                t._filter === r.FILTER_PCF ? a.clear(i, !1, !0, !1) : t.useExponentialShadowMap || t.useBlurExponentialShadowMap ? a.clear(n, !0, !0, !1) : a.clear(i, !0, !0, !1);\n              }), this._shadowMap.onResizeObservable.add(function(a) {\n                t._storedUniqueId = t._shadowMap.uniqueId, t._mapSize = a.getRenderSize(), t._light._markMeshesAsLightDirty(), t.recreateShadowMap();\n              });\n              for (var o = Hr.b.MIN_RENDERINGGROUPS; o < Hr.b.MAX_RENDERINGGROUPS; o++)\n                this._shadowMap.setRenderingAutoClearDepthStencil(o, !1);\n            }\n          }, r.prototype._initializeBlurRTTAndPostProcesses = function() {\n            var t = this, e = this._scene.getEngine(), n = this._mapSize / this.blurScale;\n            this.useKernelBlur && this.blurScale === 1 || (this._shadowMap2 = new on(this._light.name + \"_shadowMap2\", n, this._scene, !1, !0, this._textureType), this._shadowMap2.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap2.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap2.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE)), this.useKernelBlur ? (this._kernelBlurXPostprocess = new _n(this._light.name + \"KernelBlurX\", new u.d(1, 0), this.blurKernel, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, this._textureType), this._kernelBlurXPostprocess.width = n, this._kernelBlurXPostprocess.height = n, this._kernelBlurXPostprocess.onApplyObservable.add(function(i) {\n              i.setTexture(\"textureSampler\", t._shadowMap);\n            }), this._kernelBlurYPostprocess = new _n(this._light.name + \"KernelBlurY\", new u.d(0, 1), this.blurKernel, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, this._textureType), this._kernelBlurXPostprocess.autoClear = !1, this._kernelBlurYPostprocess.autoClear = !1, this._textureType === h.a.TEXTURETYPE_UNSIGNED_INT && (this._kernelBlurXPostprocess.packedFloat = !0, this._kernelBlurYPostprocess.packedFloat = !0), this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess]) : (this._boxBlurPostprocess = new ft(this._light.name + \"DepthBoxBlur\", \"depthBoxBlur\", [\"screenSize\", \"boxOffset\"], [], 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, \"#define OFFSET \" + this._blurBoxOffset, this._textureType), this._boxBlurPostprocess.onApplyObservable.add(function(i) {\n              i.setFloat2(\"screenSize\", n, n), i.setTexture(\"textureSampler\", t._shadowMap);\n            }), this._boxBlurPostprocess.autoClear = !1, this._blurPostProcesses = [this._boxBlurPostprocess]);\n          }, r.prototype._renderForShadowMap = function(t, e, n, i) {\n            var o, a = this._scene.getEngine(), s = a.getColorWrite();\n            if (i.length) {\n              for (a.setColorWrite(!1), o = 0; o < i.length; o++)\n                this._renderSubMeshForShadowMap(i.data[o]);\n              a.setColorWrite(s);\n            }\n            for (o = 0; o < t.length; o++)\n              this._renderSubMeshForShadowMap(t.data[o]);\n            for (o = 0; o < e.length; o++)\n              this._renderSubMeshForShadowMap(e.data[o]);\n            if (this._transparencyShadow)\n              for (o = 0; o < n.length; o++)\n                this._renderSubMeshForShadowMap(n.data[o], !0);\n            else\n              for (o = 0; o < n.length; o++)\n                n.data[o].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = !1;\n          }, r.prototype._bindCustomEffectForRenderSubMeshForShadowMap = function(t, e, n, i) {\n            var o, a, s, d, p, y;\n            e.setMatrix((o = n == null ? void 0 : n.viewProjection) !== null && o !== void 0 ? o : \"viewProjection\", this.getTransformMatrix()), e.setMatrix((a = n == null ? void 0 : n.view) !== null && a !== void 0 ? a : \"view\", this._viewMatrix), e.setMatrix((s = n == null ? void 0 : n.projection) !== null && s !== void 0 ? s : \"projection\", this._projectionMatrix);\n            var P = i.getWorldMatrix();\n            e.setMatrix((d = n == null ? void 0 : n.world) !== null && d !== void 0 ? d : \"world\", P), P.multiplyToRef(this.getTransformMatrix(), gu), e.setMatrix((p = n == null ? void 0 : n.worldViewProjection) !== null && p !== void 0 ? p : \"worldViewProjection\", gu), P.multiplyToRef(this._viewMatrix, vu), e.setMatrix((y = n == null ? void 0 : n.worldView) !== null && y !== void 0 ? y : \"worldView\", vu);\n          }, r.prototype._renderSubMeshForShadowMap = function(t, e) {\n            var n, i;\n            e === void 0 && (e = !1);\n            var o = t.getRenderingMesh(), a = t.getEffectiveMesh(), s = this._scene, d = s.getEngine(), p = t.getMaterial();\n            if (a._internalAbstractMeshDataInfo._isActiveIntermediate = !1, p && t.verticesCount !== 0 && t._renderId !== s.getRenderId()) {\n              d.setState(p.backFaceCulling);\n              var y = o._getInstancesRenderList(t._id, !!t.getReplacementMesh());\n              if (!y.mustReturn) {\n                var P = d.getCaps().instancedArrays && (y.visibleInstances[t._id] !== null && y.visibleInstances[t._id] !== void 0 || o.hasThinInstances);\n                if (!this.customAllowRendering || this.customAllowRendering(t))\n                  if (this.isReady(t, P, e)) {\n                    t._renderId = s.getRenderId();\n                    var R = (n = o.material) === null || n === void 0 ? void 0 : n.shadowDepthWrapper, B = (i = R == null ? void 0 : R.getEffect(t, this)) !== null && i !== void 0 ? i : this._effect;\n                    if (d.enableEffect(B), o._bind(t, B, p.fillMode), this.getTransformMatrix(), B.setFloat3(\"biasAndScaleSM\", this.bias, this.normalBias, this.depthScale), this.getLight().getTypeID() === bi.a.LIGHTTYPEID_DIRECTIONALLIGHT ? B.setVector3(\"lightDataSM\", this._cachedDirection) : B.setVector3(\"lightDataSM\", this._cachedPosition), s.activeCamera && B.setFloat2(\"depthValuesSM\", this.getLight().getDepthMinZ(s.activeCamera), this.getLight().getDepthMinZ(s.activeCamera) + this.getLight().getDepthMaxZ(s.activeCamera)), e && this.enableSoftTransparentShadow && B.setFloat(\"softTransparentShadowSM\", a.visibility), R)\n                      t._effectOverride = B, R.standalone ? R.baseMaterial.bindForSubMesh(a.getWorldMatrix(), o, t) : p.bindForSubMesh(a.getWorldMatrix(), o, t), t._effectOverride = null;\n                    else {\n                      if (B.setMatrix(\"viewProjection\", this.getTransformMatrix()), p && p.needAlphaTesting()) {\n                        var F = p.getAlphaTestTexture();\n                        F && (B.setTexture(\"diffuseSampler\", F), B.setMatrix(\"diffuseMatrix\", F.getTextureMatrix() || this._defaultTextureMatrix));\n                      }\n                      if (o.useBones && o.computeBonesUsingShaders && o.skeleton) {\n                        var z = o.skeleton;\n                        if (z.isUsingTextureForMatrices) {\n                          var J = z.getTransformMatrixTexture(o);\n                          if (!J)\n                            return;\n                          B.setTexture(\"boneSampler\", J), B.setFloat(\"boneTextureWidth\", 4 * (z.bones.length + 1));\n                        } else\n                          B.setMatrices(\"mBones\", z.getTransformMatrices(o));\n                      }\n                      $e.a.BindMorphTargetParameters(o, B), $e.a.BindClipPlane(B, s);\n                    }\n                    this._bindCustomEffectForRenderSubMeshForShadowMap(t, B, R == null ? void 0 : R._matriceNames, a), this.forceBackFacesOnly && d.setState(!0, 0, !1, !0), this.onBeforeShadowMapRenderMeshObservable.notifyObservers(o), this.onBeforeShadowMapRenderObservable.notifyObservers(B), o._processRendering(a, t, B, p.fillMode, y, P, function(ie, se) {\n                      return B.setMatrix(\"world\", se);\n                    }), this.forceBackFacesOnly && d.setState(!0, 0, !1, !1), this.onAfterShadowMapRenderObservable.notifyObservers(B), this.onAfterShadowMapRenderMeshObservable.notifyObservers(o);\n                  } else\n                    this._shadowMap && this._shadowMap.resetRefreshCounter();\n              }\n            }\n          }, r.prototype._applyFilterValues = function() {\n            this._shadowMap && (this.filter === r.FILTER_NONE || this.filter === r.FILTER_PCSS ? this._shadowMap.updateSamplingMode(Ne.a.NEAREST_SAMPLINGMODE) : this._shadowMap.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE));\n          }, r.prototype.forceCompilation = function(t, e) {\n            var n = this, i = Object(c.a)({ useInstances: !1 }, e), o = this.getShadowMap();\n            if (o) {\n              var a = o.renderList;\n              if (a) {\n                for (var s = new Array(), d = 0, p = a; d < p.length; d++) {\n                  var y = p[d];\n                  s.push.apply(s, y.subMeshes);\n                }\n                if (s.length !== 0) {\n                  var P = 0, R = function() {\n                    var B, F;\n                    if (n._scene && n._scene.getEngine()) {\n                      for (; n.isReady(s[P], i.useInstances, (F = (B = s[P].getMaterial()) === null || B === void 0 ? void 0 : B.needAlphaBlendingForMesh(s[P].getMesh())) !== null && F !== void 0 && F); )\n                        if (++P >= s.length)\n                          return void (t && t(n));\n                      setTimeout(R, 16);\n                    }\n                  };\n                  R();\n                } else\n                  t && t(this);\n              } else\n                t && t(this);\n            } else\n              t && t(this);\n          }, r.prototype.forceCompilationAsync = function(t) {\n            var e = this;\n            return new Promise(function(n) {\n              e.forceCompilation(function() {\n                n();\n              }, t);\n            });\n          }, r.prototype._isReadyCustomDefines = function(t, e, n) {\n          }, r.prototype._prepareShadowDefines = function(t, e, n, i) {\n            n.push(\"#define SM_FLOAT \" + (this._textureType !== h.a.TEXTURETYPE_UNSIGNED_INT ? \"1\" : \"0\")), n.push(\"#define SM_ESM \" + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? \"1\" : \"0\")), n.push(\"#define SM_DEPTHTEXTURE \" + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? \"1\" : \"0\"));\n            var o = t.getMesh();\n            return n.push(\"#define SM_NORMALBIAS \" + (this.normalBias && o.isVerticesDataPresent(Oe.b.NormalKind) ? \"1\" : \"0\")), n.push(\"#define SM_DIRECTIONINLIGHTDATA \" + (this.getLight().getTypeID() === bi.a.LIGHTTYPEID_DIRECTIONALLIGHT ? \"1\" : \"0\")), n.push(\"#define SM_USEDISTANCE \" + (this._light.needCube() ? \"1\" : \"0\")), n.push(\"#define SM_SOFTTRANSPARENTSHADOW \" + (this.enableSoftTransparentShadow && i ? \"1\" : \"0\")), this._isReadyCustomDefines(n, t, e), n;\n          }, r.prototype.isReady = function(t, e, n) {\n            var i = t.getMaterial(), o = i == null ? void 0 : i.shadowDepthWrapper, a = [];\n            if (this._prepareShadowDefines(t, e, a, n), o) {\n              if (!o.isReadyForSubMesh(t, a, this, e))\n                return !1;\n            } else {\n              var s = [Oe.b.PositionKind], d = t.getMesh();\n              if (this.normalBias && d.isVerticesDataPresent(Oe.b.NormalKind) && (s.push(Oe.b.NormalKind), a.push(\"#define NORMAL\"), d.nonUniformScaling && a.push(\"#define NONUNIFORMSCALING\")), i && i.needAlphaTesting()) {\n                var p = i.getAlphaTestTexture();\n                if (p) {\n                  if (!p.isReady())\n                    return !1;\n                  a.push(\"#define ALPHATEST\"), d.isVerticesDataPresent(Oe.b.UVKind) && (s.push(Oe.b.UVKind), a.push(\"#define UV1\")), d.isVerticesDataPresent(Oe.b.UV2Kind) && p.coordinatesIndex === 1 && (s.push(Oe.b.UV2Kind), a.push(\"#define UV2\"));\n                }\n              }\n              var y = new _r.a();\n              if (d.useBones && d.computeBonesUsingShaders && d.skeleton) {\n                s.push(Oe.b.MatricesIndicesKind), s.push(Oe.b.MatricesWeightsKind), d.numBoneInfluencers > 4 && (s.push(Oe.b.MatricesIndicesExtraKind), s.push(Oe.b.MatricesWeightsExtraKind));\n                var P = d.skeleton;\n                a.push(\"#define NUM_BONE_INFLUENCERS \" + d.numBoneInfluencers), d.numBoneInfluencers > 0 && y.addCPUSkinningFallback(0, d), P.isUsingTextureForMatrices ? a.push(\"#define BONETEXTURE\") : a.push(\"#define BonesPerMesh \" + (P.bones.length + 1));\n              } else\n                a.push(\"#define NUM_BONE_INFLUENCERS 0\");\n              var R = d.morphTargetManager, B = 0;\n              R && R.numInfluencers > 0 && (a.push(\"#define MORPHTARGETS\"), B = R.numInfluencers, a.push(\"#define NUM_MORPH_INFLUENCERS \" + B), $e.a.PrepareAttributesForMorphTargetsInfluencers(s, d, B));\n              var F = this._scene;\n              if (F.clipPlane && a.push(\"#define CLIPPLANE\"), F.clipPlane2 && a.push(\"#define CLIPPLANE2\"), F.clipPlane3 && a.push(\"#define CLIPPLANE3\"), F.clipPlane4 && a.push(\"#define CLIPPLANE4\"), F.clipPlane5 && a.push(\"#define CLIPPLANE5\"), F.clipPlane6 && a.push(\"#define CLIPPLANE6\"), e && (a.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(s), t.getRenderingMesh().hasThinInstances && a.push(\"#define THIN_INSTANCES\")), this.customShaderOptions && this.customShaderOptions.defines)\n                for (var z = 0, J = this.customShaderOptions.defines; z < J.length; z++) {\n                  var ie = J[z];\n                  a.indexOf(ie) === -1 && a.push(ie);\n                }\n              var se = a.join(`\n`);\n              if (this._cachedDefines !== se) {\n                this._cachedDefines = se;\n                var ce = \"shadowMap\", ue = [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"lightDataSM\", \"depthValuesSM\", \"biasAndScaleSM\", \"morphTargetInfluences\", \"boneTextureWidth\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"softTransparentShadowSM\"], fe = [\"diffuseSampler\", \"boneSampler\"];\n                if (this.customShaderOptions) {\n                  if (ce = this.customShaderOptions.shaderName, this.customShaderOptions.attributes)\n                    for (var ve = 0, Te = this.customShaderOptions.attributes; ve < Te.length; ve++) {\n                      var Re = Te[ve];\n                      s.indexOf(Re) === -1 && s.push(Re);\n                    }\n                  if (this.customShaderOptions.uniforms)\n                    for (var Ae = 0, Ee = this.customShaderOptions.uniforms; Ae < Ee.length; Ae++) {\n                      var Se = Ee[Ae];\n                      ue.indexOf(Se) === -1 && ue.push(Se);\n                    }\n                  if (this.customShaderOptions.samplers)\n                    for (var De = 0, xe = this.customShaderOptions.samplers; De < xe.length; De++) {\n                      var Le = xe[De];\n                      fe.indexOf(Le) === -1 && fe.push(Le);\n                    }\n                }\n                this._effect = this._scene.getEngine().createEffect(ce, s, ue, fe, se, y, void 0, void 0, { maxSimultaneousMorphTargets: B });\n              }\n              if (!this._effect.isReady())\n                return !1;\n            }\n            return (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (this._blurPostProcesses && this._blurPostProcesses.length || this._initializeBlurRTTAndPostProcesses()), !(this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) && !(this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) && !(this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady());\n          }, r.prototype.prepareDefines = function(t, e) {\n            var n = this._scene, i = this._light;\n            n.shadowsEnabled && i.shadowEnabled && (t[\"SHADOW\" + e] = !0, this.useContactHardeningShadow ? (t[\"SHADOWPCSS\" + e] = !0, this._filteringQuality === r.QUALITY_LOW ? t[\"SHADOWLOWQUALITY\" + e] = !0 : this._filteringQuality === r.QUALITY_MEDIUM && (t[\"SHADOWMEDIUMQUALITY\" + e] = !0)) : this.usePercentageCloserFiltering ? (t[\"SHADOWPCF\" + e] = !0, this._filteringQuality === r.QUALITY_LOW ? t[\"SHADOWLOWQUALITY\" + e] = !0 : this._filteringQuality === r.QUALITY_MEDIUM && (t[\"SHADOWMEDIUMQUALITY\" + e] = !0)) : this.usePoissonSampling ? t[\"SHADOWPOISSON\" + e] = !0 : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? t[\"SHADOWESM\" + e] = !0 : (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (t[\"SHADOWCLOSEESM\" + e] = !0), i.needCube() && (t[\"SHADOWCUBE\" + e] = !0));\n          }, r.prototype.bindShadowLight = function(t, e) {\n            var n = this._light, i = this._scene;\n            if (i.shadowsEnabled && n.shadowEnabled) {\n              var o = i.activeCamera;\n              if (o) {\n                var a = this.getShadowMap();\n                a && (n.needCube() || e.setMatrix(\"lightMatrix\" + t, this.getTransformMatrix()), this._filter === r.FILTER_PCF ? (e.setDepthStencilTexture(\"shadowSampler\" + t, this.getShadowMapForRendering()), n._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), a.getSize().width, 1 / a.getSize().width, this.frustumEdgeFalloff, t)) : this._filter === r.FILTER_PCSS ? (e.setDepthStencilTexture(\"shadowSampler\" + t, this.getShadowMapForRendering()), e.setTexture(\"depthSampler\" + t, this.getShadowMapForRendering()), n._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), 1 / a.getSize().width, this._contactHardeningLightSizeUVRatio * a.getSize().width, this.frustumEdgeFalloff, t)) : (e.setTexture(\"shadowSampler\" + t, this.getShadowMapForRendering()), n._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), this.blurScale / a.getSize().width, this.depthScale, this.frustumEdgeFalloff, t)), n._uniformBuffer.updateFloat2(\"depthValues\", this.getLight().getDepthMinZ(o), this.getLight().getDepthMinZ(o) + this.getLight().getDepthMaxZ(o), t));\n              }\n            }\n          }, r.prototype.getTransformMatrix = function() {\n            var t = this._scene;\n            if (this._currentRenderID === t.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex)\n              return this._transformMatrix;\n            this._currentRenderID = t.getRenderId(), this._currentFaceIndexCache = this._currentFaceIndex;\n            var e = this._light.position;\n            if (this._light.computeTransformedInformation() && (e = this._light.transformedPosition), u.e.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection), Math.abs(u.e.Dot(this._lightDirection, u.e.Up())) === 1 && (this._lightDirection.z = 1e-13), this._light.needProjectionMatrixCompute() || !this._cachedPosition || !this._cachedDirection || !e.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) {\n              this._cachedPosition.copyFrom(e), this._cachedDirection.copyFrom(this._lightDirection), u.a.LookAtLHToRef(e, e.add(this._lightDirection), u.e.Up(), this._viewMatrix);\n              var n = this.getShadowMap();\n              if (n) {\n                var i = n.renderList;\n                i && this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, i);\n              }\n              this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\n            }\n            return this._transformMatrix;\n          }, r.prototype.recreateShadowMap = function() {\n            var t = this._shadowMap;\n            if (t) {\n              var e = t.renderList;\n              this._disposeRTTandPostProcesses(), this._initializeGenerator(), this.filter = this.filter, this._applyFilterValues(), this._shadowMap.renderList = e;\n            }\n          }, r.prototype._disposeBlurPostProcesses = function() {\n            this._shadowMap2 && (this._shadowMap2.dispose(), this._shadowMap2 = null), this._boxBlurPostprocess && (this._boxBlurPostprocess.dispose(), this._boxBlurPostprocess = null), this._kernelBlurXPostprocess && (this._kernelBlurXPostprocess.dispose(), this._kernelBlurXPostprocess = null), this._kernelBlurYPostprocess && (this._kernelBlurYPostprocess.dispose(), this._kernelBlurYPostprocess = null), this._blurPostProcesses = [];\n          }, r.prototype._disposeRTTandPostProcesses = function() {\n            this._shadowMap && (this._shadowMap.dispose(), this._shadowMap = null), this._disposeBlurPostProcesses();\n          }, r.prototype.dispose = function() {\n            this._disposeRTTandPostProcesses(), this._light && (this._light._shadowGenerator = null, this._light._markMeshesAsLightDirty()), this.onBeforeShadowMapRenderMeshObservable.clear(), this.onBeforeShadowMapRenderObservable.clear(), this.onAfterShadowMapRenderMeshObservable.clear(), this.onAfterShadowMapRenderObservable.clear();\n          }, r.prototype.serialize = function() {\n            var t = {}, e = this.getShadowMap();\n            if (!e)\n              return t;\n            if (t.className = this.getClassName(), t.lightId = this._light.id, t.id = this._light.id, t.mapSize = e.getRenderSize(), t.forceBackFacesOnly = this.forceBackFacesOnly, t.darkness = this.getDarkness(), t.transparencyShadow = this._transparencyShadow, t.frustumEdgeFalloff = this.frustumEdgeFalloff, t.bias = this.bias, t.normalBias = this.normalBias, t.usePercentageCloserFiltering = this.usePercentageCloserFiltering, t.useContactHardeningShadow = this.useContactHardeningShadow, t.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio, t.filteringQuality = this.filteringQuality, t.useExponentialShadowMap = this.useExponentialShadowMap, t.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap, t.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap, t.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap, t.usePoissonSampling = this.usePoissonSampling, t.depthScale = this.depthScale, t.blurBoxOffset = this.blurBoxOffset, t.blurKernel = this.blurKernel, t.blurScale = this.blurScale, t.useKernelBlur = this.useKernelBlur, t.renderList = [], e.renderList)\n              for (var n = 0; n < e.renderList.length; n++) {\n                var i = e.renderList[n];\n                t.renderList.push(i.id);\n              }\n            return t;\n          }, r.Parse = function(t, e, n) {\n            for (var i = e.getLightByID(t.lightId), o = n ? n(t.mapSize, i) : new r(t.mapSize, i), a = o.getShadowMap(), s = 0; s < t.renderList.length; s++)\n              e.getMeshesByID(t.renderList[s]).forEach(function(d) {\n                a && (a.renderList || (a.renderList = []), a.renderList.push(d));\n              });\n            return t.id !== void 0 && (o.id = t.id), o.forceBackFacesOnly = !!t.forceBackFacesOnly, t.darkness !== void 0 && o.setDarkness(t.darkness), t.transparencyShadow && o.setTransparencyShadow(!0), t.frustumEdgeFalloff !== void 0 && (o.frustumEdgeFalloff = t.frustumEdgeFalloff), t.bias !== void 0 && (o.bias = t.bias), t.normalBias !== void 0 && (o.normalBias = t.normalBias), t.usePercentageCloserFiltering ? o.usePercentageCloserFiltering = !0 : t.useContactHardeningShadow ? o.useContactHardeningShadow = !0 : t.usePoissonSampling ? o.usePoissonSampling = !0 : t.useExponentialShadowMap ? o.useExponentialShadowMap = !0 : t.useBlurExponentialShadowMap ? o.useBlurExponentialShadowMap = !0 : t.useCloseExponentialShadowMap ? o.useCloseExponentialShadowMap = !0 : t.useBlurCloseExponentialShadowMap ? o.useBlurCloseExponentialShadowMap = !0 : t.useVarianceShadowMap ? o.useExponentialShadowMap = !0 : t.useBlurVarianceShadowMap && (o.useBlurExponentialShadowMap = !0), t.contactHardeningLightSizeUVRatio !== void 0 && (o.contactHardeningLightSizeUVRatio = t.contactHardeningLightSizeUVRatio), t.filteringQuality !== void 0 && (o.filteringQuality = t.filteringQuality), t.depthScale && (o.depthScale = t.depthScale), t.blurScale && (o.blurScale = t.blurScale), t.blurBoxOffset && (o.blurBoxOffset = t.blurBoxOffset), t.useKernelBlur && (o.useKernelBlur = t.useKernelBlur), t.blurKernel && (o.blurKernel = t.blurKernel), o;\n          }, r.CLASSNAME = \"ShadowGenerator\", r.FILTER_NONE = 0, r.FILTER_EXPONENTIALSHADOWMAP = 1, r.FILTER_POISSONSAMPLING = 2, r.FILTER_BLUREXPONENTIALSHADOWMAP = 3, r.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4, r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5, r.FILTER_PCF = 6, r.FILTER_PCSS = 7, r.QUALITY_HIGH = 0, r.QUALITY_MEDIUM = 1, r.QUALITY_LOW = 2, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"ShadowGeneratorSceneComponent\");\n          }, r;\n        }(), b_ = `#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvarying float vDepthMetric;\n#ifdef PACKED\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef NONLINEARDEPTH\n#ifdef PACKED\ngl_FragColor=pack(gl_FragCoord.z);\n#else\ngl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);\n#endif\n#else\n#ifdef PACKED\ngl_FragColor=pack(vDepthMetric);\n#else\ngl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);\n#endif\n#endif\n}`;\n        ze.a.ShadersStore.depthPixelShader = b_;\n        var T_ = `\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n`;\n        ze.a.ShadersStore.depthVertexShader = T_;\n        var Qo = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            e === void 0 && (e = h.a.TEXTURETYPE_FLOAT), n === void 0 && (n = null), i === void 0 && (i = !1), this.enabled = !0, this.useOnlyInActiveCamera = !1, this._scene = t, this._storeNonLinearDepth = i, this.isPacked = e === h.a.TEXTURETYPE_UNSIGNED_BYTE, this.isPacked ? this._clearColor = new I.b(1, 1, 1, 1) : this._clearColor = new I.b(1, 0, 0, 1), r._SceneComponentInitialization(this._scene), this._camera = n;\n            var a = t.getEngine(), s = this.isPacked || a.webGLVersion === 1 ? h.a.TEXTUREFORMAT_RGBA : h.a.TEXTUREFORMAT_R;\n            this._depthMap = new on(\"depthMap\", { width: a.getRenderWidth(), height: a.getRenderHeight() }, this._scene, !1, !0, e, !1, void 0, void 0, void 0, void 0, s), this._depthMap.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._depthMap.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._depthMap.refreshRate = 1, this._depthMap.renderParticles = !1, this._depthMap.renderList = null, this._depthMap.activeCamera = this._camera, this._depthMap.ignoreCameraViewport = !0, this._depthMap.useCameraPostProcesses = !1, this._depthMap.onClearObservable.add(function(p) {\n              p.clear(o._clearColor, !0, !0, !0);\n            });\n            var d = function(p) {\n              var y = p.getRenderingMesh(), P = p.getEffectiveMesh(), R = o._scene, B = R.getEngine(), F = p.getMaterial();\n              if (P._internalAbstractMeshDataInfo._isActiveIntermediate = !1, F && p.verticesCount !== 0 && p._renderId !== R.getRenderId()) {\n                B.setState(F.backFaceCulling, 0, !1, R.useRightHandedSystem);\n                var z = y._getInstancesRenderList(p._id, !!p.getReplacementMesh());\n                if (!z.mustReturn) {\n                  var J = B.getCaps().instancedArrays && (z.visibleInstances[p._id] !== null && z.visibleInstances[p._id] !== void 0 || y.hasThinInstances), ie = o._camera || R.activeCamera;\n                  if (o.isReady(p, J) && ie) {\n                    if (p._renderId = R.getRenderId(), B.enableEffect(o._effect), y._bind(p, o._effect, F.fillMode), o._effect.setMatrix(\"viewProjection\", R.getTransformMatrix()), o._effect.setFloat2(\"depthValues\", ie.minZ, ie.minZ + ie.maxZ), F && F.needAlphaTesting()) {\n                      var se = F.getAlphaTestTexture();\n                      se && (o._effect.setTexture(\"diffuseSampler\", se), o._effect.setMatrix(\"diffuseMatrix\", se.getTextureMatrix()));\n                    }\n                    y.useBones && y.computeBonesUsingShaders && y.skeleton && o._effect.setMatrices(\"mBones\", y.skeleton.getTransformMatrices(y)), $e.a.BindMorphTargetParameters(y, o._effect), y._processRendering(P, p, o._effect, F.fillMode, z, J, function(ce, ue) {\n                      return o._effect.setMatrix(\"world\", ue);\n                    });\n                  }\n                }\n              }\n            };\n            this._depthMap.customRenderFunction = function(p, y, P, R) {\n              var B;\n              if (R.length) {\n                for (a.setColorWrite(!1), B = 0; B < R.length; B++)\n                  d(R.data[B]);\n                a.setColorWrite(!0);\n              }\n              for (B = 0; B < p.length; B++)\n                d(p.data[B]);\n              for (B = 0; B < y.length; B++)\n                d(y.data[B]);\n            };\n          }\n          return r.prototype.isReady = function(t, e) {\n            var n = t.getMaterial();\n            if (n.disableDepthWrite)\n              return !1;\n            var i = [], o = [Oe.b.PositionKind], a = t.getMesh();\n            n && n.needAlphaTesting() && n.getAlphaTestTexture() && (i.push(\"#define ALPHATEST\"), a.isVerticesDataPresent(Oe.b.UVKind) && (o.push(Oe.b.UVKind), i.push(\"#define UV1\")), a.isVerticesDataPresent(Oe.b.UV2Kind) && (o.push(Oe.b.UV2Kind), i.push(\"#define UV2\"))), a.useBones && a.computeBonesUsingShaders ? (o.push(Oe.b.MatricesIndicesKind), o.push(Oe.b.MatricesWeightsKind), a.numBoneInfluencers > 4 && (o.push(Oe.b.MatricesIndicesExtraKind), o.push(Oe.b.MatricesWeightsExtraKind)), i.push(\"#define NUM_BONE_INFLUENCERS \" + a.numBoneInfluencers), i.push(\"#define BonesPerMesh \" + (a.skeleton ? a.skeleton.bones.length + 1 : 0))) : i.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var s = a.morphTargetManager, d = 0;\n            s && s.numInfluencers > 0 && (d = s.numInfluencers, i.push(\"#define MORPHTARGETS\"), i.push(\"#define NUM_MORPH_INFLUENCERS \" + d), $e.a.PrepareAttributesForMorphTargetsInfluencers(o, a, d)), e && (i.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(o), t.getRenderingMesh().hasThinInstances && i.push(\"#define THIN_INSTANCES\")), this._storeNonLinearDepth && i.push(\"#define NONLINEARDEPTH\"), this.isPacked && i.push(\"#define PACKED\");\n            var p = i.join(`\n`);\n            return this._cachedDefines !== p && (this._cachedDefines = p, this._effect = this._scene.getEngine().createEffect(\"depth\", o, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"depthValues\", \"morphTargetInfluences\"], [\"diffuseSampler\"], p, void 0, void 0, void 0, { maxSimultaneousMorphTargets: d })), this._effect.isReady();\n          }, r.prototype.getDepthMap = function() {\n            return this._depthMap;\n          }, r.prototype.dispose = function() {\n            this._depthMap.dispose();\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"DepthRendererSceneComponent\");\n          }, r;\n        }(), E_ = `attribute vec2 vUV;\nuniform sampler2D textureSampler;\n#if defined(INITIAL)\nuniform sampler2D sourceTexture;\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nfloat f1=texelFetch(sourceTexture,coord,0).r;\nfloat f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;\nfloat f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;\nfloat f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;\nfloat minz=min(min(min(f1,f2),f3),f4);\n#ifdef DEPTH_REDUX\nfloat maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);\n#else\nfloat maxz=max(max(max(f1,f2),f3),f4);\n#endif\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(MAIN)\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nvec2 f1=texelFetch(textureSampler,coord,0).rg;\nvec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;\nvec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;\nvec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;\nfloat minz=min(min(min(f1.x,f2.x),f3.x),f4.x);\nfloat maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(ONEBEFORELAST)\nuniform ivec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*vec2(texSize-1));\nvec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;\nvec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;\nvec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;\nvec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;\nfloat minz=min(f1.x,f2.x);\nfloat maxz=max(f1.y,f2.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(LAST)\nvoid main(void)\n{\ndiscard;\nglFragColor=vec4(0.);\n}\n#endif\n`;\n        ze.a.ShadersStore.minmaxReduxPixelShader = E_;\n        var yu = function() {\n          function r(t) {\n            this.onAfterReductionPerformed = new C.c(), this._forceFullscreenViewport = !0, this._activated = !1, this._camera = t, this._postProcessManager = new es.a(t.getScene());\n          }\n          return Object.defineProperty(r.prototype, \"sourceTexture\", { get: function() {\n            return this._sourceTexture;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setSourceTexture = function(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = h.a.TEXTURETYPE_HALF_FLOAT), i === void 0 && (i = !0), t !== this._sourceTexture) {\n              this.dispose(!1), this._sourceTexture = t, this._reductionSteps = [], this._forceFullscreenViewport = i;\n              var a = this._camera.getScene(), s = new ft(\"Initial reduction phase\", \"minmaxRedux\", [\"texSize\"], [\"sourceTexture\"], 1, null, h.a.TEXTURE_NEAREST_NEAREST, a.getEngine(), !1, \"#define INITIAL\" + (e ? `\n#define DEPTH_REDUX` : \"\"), n, void 0, void 0, void 0, h.a.TEXTUREFORMAT_RG);\n              s.autoClear = !1, s.forceFullscreenViewport = i;\n              var d = this._sourceTexture.getRenderWidth(), p = this._sourceTexture.getRenderHeight();\n              s.onApply = /* @__PURE__ */ function(R, B) {\n                return function(F) {\n                  F.setTexture(\"sourceTexture\", o._sourceTexture), F.setFloatArray2(\"texSize\", new Float32Array([R, B]));\n                };\n              }(d, p), this._reductionSteps.push(s);\n              for (var y = 1; d > 1 || p > 1; ) {\n                d = Math.max(Math.round(d / 2), 1), p = Math.max(Math.round(p / 2), 1);\n                var P = new ft(\"Reduction phase \" + y, \"minmaxRedux\", [\"texSize\"], null, { width: d, height: p }, null, h.a.TEXTURE_NEAREST_NEAREST, a.getEngine(), !1, \"#define \" + (d == 1 && p == 1 ? \"LAST\" : d == 1 || p == 1 ? \"ONEBEFORELAST\" : \"MAIN\"), n, void 0, void 0, void 0, h.a.TEXTUREFORMAT_RG);\n                P.autoClear = !1, P.forceFullscreenViewport = i, P.onApply = /* @__PURE__ */ function(R, B) {\n                  return function(F) {\n                    R == 1 || B == 1 ? F.setIntArray2(\"texSize\", new Int32Array([R, B])) : F.setFloatArray2(\"texSize\", new Float32Array([R, B]));\n                  };\n                }(d, p), this._reductionSteps.push(P), y++, d == 1 && p == 1 && P.onAfterRenderObservable.add(function(R, B, F) {\n                  var z = new Float32Array(4 * R * B), J = { min: 0, max: 0 };\n                  return function() {\n                    a.getEngine()._readTexturePixels(F.inputTexture, R, B, -1, 0, z), J.min = z[0], J.max = z[1], o.onAfterReductionPerformed.notifyObservers(J);\n                  };\n                }(d, p, P));\n              }\n            }\n          }, Object.defineProperty(r.prototype, \"refreshRate\", { get: function() {\n            return this._sourceTexture ? this._sourceTexture.refreshRate : -1;\n          }, set: function(t) {\n            this._sourceTexture && (this._sourceTexture.refreshRate = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"activated\", { get: function() {\n            return this._activated;\n          }, enumerable: !1, configurable: !0 }), r.prototype.activate = function() {\n            var t = this;\n            !this._onAfterUnbindObserver && this._sourceTexture && (this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(function() {\n              t._reductionSteps[0].activate(t._camera), t._postProcessManager.directRender(t._reductionSteps, t._reductionSteps[0].inputTexture, t._forceFullscreenViewport), t._camera.getScene().getEngine().unBindFramebuffer(t._reductionSteps[0].inputTexture, !1);\n            }), this._activated = !0);\n          }, r.prototype.deactivate = function() {\n            this._onAfterUnbindObserver && this._sourceTexture && (this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = null, this._activated = !1);\n          }, r.prototype.dispose = function(t) {\n            if (t === void 0 && (t = !0), t && this.onAfterReductionPerformed.clear(), this.deactivate(), this._reductionSteps) {\n              for (var e = 0; e < this._reductionSteps.length; ++e)\n                this._reductionSteps[e].dispose();\n              this._reductionSteps = null;\n            }\n            this._postProcessManager && t && this._postProcessManager.dispose(), this._sourceTexture = null;\n          }, r;\n        }(), bu = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"depthRenderer\", { get: function() {\n            return this._depthRenderer;\n          }, enumerable: !1, configurable: !0 }), t.prototype.setDepthRenderer = function(e, n, i) {\n            e === void 0 && (e = null), n === void 0 && (n = h.a.TEXTURETYPE_HALF_FLOAT), i === void 0 && (i = !0);\n            var o = this._camera.getScene();\n            this._depthRenderer && (delete o._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null), e === null && (o._depthRenderer || (o._depthRenderer = {}), (e = this._depthRenderer = new Qo(o, n, this._camera, !1)).enabled = !1, this._depthRendererId = \"minmax\" + this._camera.id, o._depthRenderer[this._depthRendererId] = e), r.prototype.setSourceTexture.call(this, e.getDepthMap(), !0, n, i);\n          }, t.prototype.setSourceTexture = function(e, n, i, o) {\n            i === void 0 && (i = h.a.TEXTURETYPE_HALF_FLOAT), o === void 0 && (o = !0), r.prototype.setSourceTexture.call(this, e, n, i, o);\n          }, t.prototype.activate = function() {\n            this._depthRenderer && (this._depthRenderer.enabled = !0), r.prototype.activate.call(this);\n          }, t.prototype.deactivate = function() {\n            r.prototype.deactivate.call(this), this._depthRenderer && (this._depthRenderer.enabled = !1);\n          }, t.prototype.dispose = function(e) {\n            if (e === void 0 && (e = !0), r.prototype.dispose.call(this, e), this._depthRenderer && e) {\n              var n = this._depthRenderer.getDepthMap().getScene();\n              n && delete n._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null;\n            }\n          }, t;\n        }(yu), Tu = u.e.Up(), S_ = u.e.Zero(), mn = new u.e(), Tr = new u.e(), Er = new u.a(), Eu = new u.a(), Ds = function(r) {\n          function t(e, n, i) {\n            var o = this;\n            if (t.IsSupported)\n              return (o = r.call(this, e, n, i) || this).usePercentageCloserFiltering = !0, o;\n            l.a.Error(\"CascadedShadowMap needs WebGL 2 support.\");\n          }\n          return Object(c.d)(t, r), t.prototype._validateFilter = function(e) {\n            return e === Fn.FILTER_NONE || e === Fn.FILTER_PCF || e === Fn.FILTER_PCSS ? e : (console.error('Unsupported filter \"' + e + '\"!'), Fn.FILTER_NONE);\n          }, Object.defineProperty(t.prototype, \"numCascades\", { get: function() {\n            return this._numCascades;\n          }, set: function(e) {\n            (e = Math.min(Math.max(e, t.MIN_CASCADES_COUNT), t.MAX_CASCADES_COUNT)) !== this._numCascades && (this._numCascades = e, this.recreateShadowMap());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"freezeShadowCastersBoundingInfo\", { get: function() {\n            return this._freezeShadowCastersBoundingInfo;\n          }, set: function(e) {\n            this._freezeShadowCastersBoundingInfoObservable && e && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._freezeShadowCastersBoundingInfoObservable || e || (this._freezeShadowCastersBoundingInfoObservable = this._scene.onBeforeRenderObservable.add(this._computeShadowCastersBoundingInfo.bind(this))), this._freezeShadowCastersBoundingInfo = e, e && this._computeShadowCastersBoundingInfo();\n          }, enumerable: !1, configurable: !0 }), t.prototype._computeShadowCastersBoundingInfo = function() {\n            if (this._scbiMin.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._scbiMax.copyFromFloats(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE), this._shadowMap && this._shadowMap.renderList) {\n              for (var e = this._shadowMap.renderList, n = 0; n < e.length; n++)\n                if (a = e[n]) {\n                  var i = a.getBoundingInfo().boundingBox;\n                  this._scbiMin.minimizeInPlace(i.minimumWorld), this._scbiMax.maximizeInPlace(i.maximumWorld);\n                }\n              var o = this._scene.meshes;\n              for (n = 0; n < o.length; n++) {\n                var a;\n                (a = o[n]) && a.isVisible && a.isEnabled && a.receiveShadows && (i = a.getBoundingInfo().boundingBox, this._scbiMin.minimizeInPlace(i.minimumWorld), this._scbiMax.maximizeInPlace(i.maximumWorld));\n              }\n            }\n            this._shadowCastersBoundingInfo.reConstruct(this._scbiMin, this._scbiMax);\n          }, Object.defineProperty(t.prototype, \"shadowCastersBoundingInfo\", { get: function() {\n            return this._shadowCastersBoundingInfo;\n          }, set: function(e) {\n            this._shadowCastersBoundingInfo = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.setMinMaxDistance = function(e, n) {\n            this._minDistance === e && this._maxDistance === n || (e > n && (e = 0, n = 1), e < 0 && (e = 0), n > 1 && (n = 1), this._minDistance = e, this._maxDistance = n, this._breaksAreDirty = !0);\n          }, Object.defineProperty(t.prototype, \"minDistance\", { get: function() {\n            return this._minDistance;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"maxDistance\", { get: function() {\n            return this._maxDistance;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return t.CLASSNAME;\n          }, t.prototype.getCascadeMinExtents = function(e) {\n            return e >= 0 && e < this._numCascades ? this._cascadeMinExtents[e] : null;\n          }, t.prototype.getCascadeMaxExtents = function(e) {\n            return e >= 0 && e < this._numCascades ? this._cascadeMaxExtents[e] : null;\n          }, Object.defineProperty(t.prototype, \"shadowMaxZ\", { get: function() {\n            return this._scene && this._scene.activeCamera ? this._shadowMaxZ : 0;\n          }, set: function(e) {\n            this._scene && this._scene.activeCamera ? this._shadowMaxZ === e || e < this._scene.activeCamera.minZ || e > this._scene.activeCamera.maxZ || (this._shadowMaxZ = e, this._light._markMeshesAsLightDirty(), this._breaksAreDirty = !0) : this._shadowMaxZ = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"debug\", { get: function() {\n            return this._debug;\n          }, set: function(e) {\n            this._debug = e, this._light._markMeshesAsLightDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthClamp\", { get: function() {\n            return this._depthClamp;\n          }, set: function(e) {\n            this._depthClamp = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cascadeBlendPercentage\", { get: function() {\n            return this._cascadeBlendPercentage;\n          }, set: function(e) {\n            this._cascadeBlendPercentage = e, this._light._markMeshesAsLightDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"lambda\", { get: function() {\n            return this._lambda;\n          }, set: function(e) {\n            var n = Math.min(Math.max(e, 0), 1);\n            this._lambda != n && (this._lambda = n, this._breaksAreDirty = !0);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getCascadeViewMatrix = function(e) {\n            return e >= 0 && e < this._numCascades ? this._viewMatrices[e] : null;\n          }, t.prototype.getCascadeProjectionMatrix = function(e) {\n            return e >= 0 && e < this._numCascades ? this._projectionMatrices[e] : null;\n          }, t.prototype.getCascadeTransformMatrix = function(e) {\n            return e >= 0 && e < this._numCascades ? this._transformMatrices[e] : null;\n          }, t.prototype.setDepthRenderer = function(e) {\n            this._depthRenderer = e, this._depthReducer && this._depthReducer.setDepthRenderer(this._depthRenderer);\n          }, Object.defineProperty(t.prototype, \"autoCalcDepthBounds\", { get: function() {\n            return this._autoCalcDepthBounds;\n          }, set: function(e) {\n            var n = this, i = this._scene.activeCamera;\n            if (i) {\n              if (this._autoCalcDepthBounds = e, !e)\n                return this._depthReducer && this._depthReducer.deactivate(), void this.setMinMaxDistance(0, 1);\n              this._depthReducer || (this._depthReducer = new bu(i), this._depthReducer.onAfterReductionPerformed.add(function(o) {\n                var a = o.min, s = o.max;\n                a >= s && (a = 0, s = 1), a == n._minDistance && s == n._maxDistance || n.setMinMaxDistance(a, s);\n              }), this._depthReducer.setDepthRenderer(this._depthRenderer)), this._depthReducer.activate();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"autoCalcDepthBoundsRefreshRate\", { get: function() {\n            var e, n, i;\n            return (i = (n = (e = this._depthReducer) === null || e === void 0 ? void 0 : e.depthRenderer) === null || n === void 0 ? void 0 : n.getDepthMap().refreshRate) !== null && i !== void 0 ? i : -1;\n          }, set: function(e) {\n            var n;\n            !((n = this._depthReducer) === null || n === void 0) && n.depthRenderer && (this._depthReducer.depthRenderer.getDepthMap().refreshRate = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.splitFrustum = function() {\n            this._breaksAreDirty = !0;\n          }, t.prototype._splitFrustum = function() {\n            var e = this._scene.activeCamera;\n            if (e) {\n              for (var n = e.minZ, i = e.maxZ, o = i - n, a = this._minDistance, s = n + a * o, d = n + (this._shadowMaxZ < i && this._shadowMaxZ >= n ? Math.min((this._shadowMaxZ - n) / (i - n), this._maxDistance) : this._maxDistance) * o, p = d - s, y = d / s, P = 0; P < this._cascades.length; ++P) {\n                var R = (P + 1) / this._numCascades, B = s * Math.pow(y, R), F = s + p * R, z = this._lambda * (B - F) + F;\n                this._cascades[P].prevBreakDistance = P === 0 ? a : this._cascades[P - 1].breakDistance, this._cascades[P].breakDistance = (z - n) / o, this._viewSpaceFrustumsZ[P] = n + this._cascades[P].breakDistance * o, this._frustumLengths[P] = (this._cascades[P].breakDistance - this._cascades[P].prevBreakDistance) * o;\n              }\n              this._breaksAreDirty = !1;\n            }\n          }, t.prototype._computeMatrices = function() {\n            if (this._scene.activeCamera) {\n              u.e.NormalizeToRef(this._light.getShadowDirection(0), this._lightDirection), Math.abs(u.e.Dot(this._lightDirection, u.e.Up())) === 1 && (this._lightDirection.z = 1e-13), this._cachedDirection.copyFrom(this._lightDirection);\n              for (var e = 0; e < this._numCascades; ++e) {\n                this._computeFrustumInWorldSpace(e), this._computeCascadeFrustum(e), this._cascadeMaxExtents[e].subtractToRef(this._cascadeMinExtents[e], mn), this._frustumCenter[e].addToRef(this._lightDirection.scale(this._cascadeMinExtents[e].z), this._shadowCameraPos[e]), u.a.LookAtLHToRef(this._shadowCameraPos[e], this._frustumCenter[e], Tu, this._viewMatrices[e]);\n                var n = 0, i = mn.z, o = this._shadowCastersBoundingInfo;\n                o.update(this._viewMatrices[e]), i = Math.min(i, o.boundingBox.maximumWorld.z), n = this._depthClamp && this.filter !== Fn.FILTER_PCSS ? Math.max(n, o.boundingBox.minimumWorld.z) : Math.min(n, o.boundingBox.minimumWorld.z), u.a.OrthoOffCenterLHToRef(this._cascadeMinExtents[e].x, this._cascadeMaxExtents[e].x, this._cascadeMinExtents[e].y, this._cascadeMaxExtents[e].y, n, i, this._projectionMatrices[e]), this._cascadeMinExtents[e].z = n, this._cascadeMaxExtents[e].z = i, this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e], this._transformMatrices[e]), u.e.TransformCoordinatesToRef(S_, this._transformMatrices[e], mn), mn.scaleInPlace(this._mapSize / 2), Tr.copyFromFloats(Math.round(mn.x), Math.round(mn.y), Math.round(mn.z)), Tr.subtractInPlace(mn).scaleInPlace(2 / this._mapSize), u.a.TranslationToRef(Tr.x, Tr.y, 0, Er), this._projectionMatrices[e].multiplyToRef(Er, this._projectionMatrices[e]), this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e], this._transformMatrices[e]), this._transformMatrices[e].copyToArray(this._transformMatricesAsArray, 16 * e);\n              }\n            }\n          }, t.prototype._computeFrustumInWorldSpace = function(e) {\n            if (this._scene.activeCamera) {\n              var n = this._cascades[e].prevBreakDistance, i = this._cascades[e].breakDistance;\n              this._scene.activeCamera.getViewMatrix();\n              for (var o = u.a.Invert(this._scene.activeCamera.getTransformationMatrix()), a = 0; a < t.frustumCornersNDCSpace.length; ++a)\n                u.e.TransformCoordinatesToRef(t.frustumCornersNDCSpace[a], o, this._frustumCornersWorldSpace[e][a]);\n              for (a = 0; a < t.frustumCornersNDCSpace.length / 2; ++a)\n                mn.copyFrom(this._frustumCornersWorldSpace[e][a + 4]).subtractInPlace(this._frustumCornersWorldSpace[e][a]), Tr.copyFrom(mn).scaleInPlace(n), mn.scaleInPlace(i), mn.addInPlace(this._frustumCornersWorldSpace[e][a]), this._frustumCornersWorldSpace[e][a + 4].copyFrom(mn), this._frustumCornersWorldSpace[e][a].addInPlace(Tr);\n            }\n          }, t.prototype._computeCascadeFrustum = function(e) {\n            if (this._cascadeMinExtents[e].copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cascadeMaxExtents[e].copyFromFloats(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE), this._frustumCenter[e].copyFromFloats(0, 0, 0), this._scene.activeCamera) {\n              for (var n = 0; n < this._frustumCornersWorldSpace[e].length; ++n)\n                this._frustumCenter[e].addInPlace(this._frustumCornersWorldSpace[e][n]);\n              if (this._frustumCenter[e].scaleInPlace(1 / this._frustumCornersWorldSpace[e].length), this.stabilizeCascades) {\n                var i = 0;\n                for (n = 0; n < this._frustumCornersWorldSpace[e].length; ++n) {\n                  var o = this._frustumCornersWorldSpace[e][n].subtractToRef(this._frustumCenter[e], mn).length();\n                  i = Math.max(i, o);\n                }\n                i = Math.ceil(16 * i) / 16, this._cascadeMaxExtents[e].copyFromFloats(i, i, i), this._cascadeMinExtents[e].copyFromFloats(-i, -i, -i);\n              } else {\n                var a = this._frustumCenter[e];\n                for (this._frustumCenter[e].addToRef(this._lightDirection, mn), u.a.LookAtLHToRef(a, mn, Tu, Er), n = 0; n < this._frustumCornersWorldSpace[e].length; ++n)\n                  u.e.TransformCoordinatesToRef(this._frustumCornersWorldSpace[e][n], Er, mn), this._cascadeMinExtents[e].minimizeInPlace(mn), this._cascadeMaxExtents[e].maximizeInPlace(mn);\n              }\n            }\n          }, Object.defineProperty(t, \"IsSupported\", { get: function() {\n            var e = te.a.LastCreatedEngine;\n            return !!e && e.webGLVersion != 1;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initializeGenerator = function() {\n            var e, n, i, o, a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe;\n            this.penumbraDarkness = (e = this.penumbraDarkness) !== null && e !== void 0 ? e : 1, this._numCascades = (n = this._numCascades) !== null && n !== void 0 ? n : t.DEFAULT_CASCADES_COUNT, this.stabilizeCascades = (i = this.stabilizeCascades) !== null && i !== void 0 && i, this._freezeShadowCastersBoundingInfoObservable = (o = this._freezeShadowCastersBoundingInfoObservable) !== null && o !== void 0 ? o : null, this.freezeShadowCastersBoundingInfo = (a = this.freezeShadowCastersBoundingInfo) !== null && a !== void 0 && a, this._scbiMin = (s = this._scbiMin) !== null && s !== void 0 ? s : new u.e(0, 0, 0), this._scbiMax = (d = this._scbiMax) !== null && d !== void 0 ? d : new u.e(0, 0, 0), this._shadowCastersBoundingInfo = (p = this._shadowCastersBoundingInfo) !== null && p !== void 0 ? p : new Mi.a(new u.e(0, 0, 0), new u.e(0, 0, 0)), this._breaksAreDirty = (y = this._breaksAreDirty) === null || y === void 0 || y, this._minDistance = (P = this._minDistance) !== null && P !== void 0 ? P : 0, this._maxDistance = (R = this._maxDistance) !== null && R !== void 0 ? R : 1, this._currentLayer = (B = this._currentLayer) !== null && B !== void 0 ? B : 0, this._shadowMaxZ = (J = (F = this._shadowMaxZ) !== null && F !== void 0 ? F : (z = this._scene.activeCamera) === null || z === void 0 ? void 0 : z.maxZ) !== null && J !== void 0 ? J : 1e4, this._debug = (ie = this._debug) !== null && ie !== void 0 && ie, this._depthClamp = (se = this._depthClamp) === null || se === void 0 || se, this._cascadeBlendPercentage = (ce = this._cascadeBlendPercentage) !== null && ce !== void 0 ? ce : 0.1, this._lambda = (ue = this._lambda) !== null && ue !== void 0 ? ue : 0.5, this._autoCalcDepthBounds = (fe = this._autoCalcDepthBounds) !== null && fe !== void 0 && fe, r.prototype._initializeGenerator.call(this);\n          }, t.prototype._createTargetRenderTexture = function() {\n            var e = { width: this._mapSize, height: this._mapSize, layers: this.numCascades };\n            this._shadowMap = new on(this._light.name + \"_shadowMap\", e, this._scene, !1, !0, this._textureType, !1, void 0, !1, !1, void 0), this._shadowMap.createDepthStencilTexture(h.a.LESS, !0);\n          }, t.prototype._initializeShadowMap = function() {\n            var e = this;\n            if (r.prototype._initializeShadowMap.call(this), this._shadowMap !== null) {\n              this._transformMatricesAsArray = new Float32Array(16 * this._numCascades), this._viewSpaceFrustumsZ = new Array(this._numCascades), this._frustumLengths = new Array(this._numCascades), this._lightSizeUVCorrection = new Array(2 * this._numCascades), this._depthCorrection = new Array(this._numCascades), this._cascades = [], this._viewMatrices = [], this._projectionMatrices = [], this._transformMatrices = [], this._cascadeMinExtents = [], this._cascadeMaxExtents = [], this._frustumCenter = [], this._shadowCameraPos = [], this._frustumCornersWorldSpace = [];\n              for (var n = 0; n < this._numCascades; ++n) {\n                this._cascades[n] = { prevBreakDistance: 0, breakDistance: 0 }, this._viewMatrices[n] = u.a.Zero(), this._projectionMatrices[n] = u.a.Zero(), this._transformMatrices[n] = u.a.Zero(), this._cascadeMinExtents[n] = new u.e(), this._cascadeMaxExtents[n] = new u.e(), this._frustumCenter[n] = new u.e(), this._shadowCameraPos[n] = new u.e(), this._frustumCornersWorldSpace[n] = new Array(t.frustumCornersNDCSpace.length);\n                for (var i = 0; i < t.frustumCornersNDCSpace.length; ++i)\n                  this._frustumCornersWorldSpace[n][i] = new u.e();\n              }\n              this._shadowMap.onBeforeRenderObservable.add(function(o) {\n                if (e._currentLayer = o, e._scene.getSceneUniformBuffer().useUbo) {\n                  var a = e._scene.getSceneUniformBuffer();\n                  a.updateMatrix(\"viewProjection\", e.getCascadeTransformMatrix(o)), a.updateMatrix(\"view\", e.getCascadeViewMatrix(o)), a.update();\n                }\n              }), this._shadowMap.onBeforeBindObservable.add(function() {\n                e._breaksAreDirty && e._splitFrustum(), e._computeMatrices();\n              }), this._splitFrustum();\n            }\n          }, t.prototype._bindCustomEffectForRenderSubMeshForShadowMap = function(e, n, i, o) {\n            var a, s, d, p, y, P;\n            n.setMatrix((a = i == null ? void 0 : i.viewProjection) !== null && a !== void 0 ? a : \"viewProjection\", this.getCascadeTransformMatrix(this._currentLayer)), n.setMatrix((s = i == null ? void 0 : i.view) !== null && s !== void 0 ? s : \"view\", this.getCascadeViewMatrix(this._currentLayer)), n.setMatrix((d = i == null ? void 0 : i.projection) !== null && d !== void 0 ? d : \"projection\", this.getCascadeProjectionMatrix(this._currentLayer));\n            var R = o.getWorldMatrix();\n            n.setMatrix((p = i == null ? void 0 : i.world) !== null && p !== void 0 ? p : \"world\", R), R.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer), Er), n.setMatrix((y = i == null ? void 0 : i.worldViewProjection) !== null && y !== void 0 ? y : \"worldViewProjection\", Er), R.multiplyToRef(this.getCascadeViewMatrix(this._currentLayer), Eu), n.setMatrix((P = i == null ? void 0 : i.worldView) !== null && P !== void 0 ? P : \"worldView\", Eu);\n          }, t.prototype._isReadyCustomDefines = function(e, n, i) {\n            e.push(\"#define SM_DEPTHCLAMP \" + (this._depthClamp && this._filter !== Fn.FILTER_PCSS ? \"1\" : \"0\"));\n          }, t.prototype.prepareDefines = function(e, n) {\n            r.prototype.prepareDefines.call(this, e, n);\n            var i = this._scene, o = this._light;\n            if (i.shadowsEnabled && o.shadowEnabled) {\n              e[\"SHADOWCSM\" + n] = !0, e[\"SHADOWCSMDEBUG\" + n] = this.debug, e[\"SHADOWCSMNUM_CASCADES\" + n] = this.numCascades, e[\"SHADOWCSM_RIGHTHANDED\" + n] = i.useRightHandedSystem;\n              var a = i.activeCamera;\n              a && this._shadowMaxZ < a.maxZ && (e[\"SHADOWCSMUSESHADOWMAXZ\" + n] = !0), this.cascadeBlendPercentage === 0 && (e[\"SHADOWCSMNOBLEND\" + n] = !0);\n            }\n          }, t.prototype.bindShadowLight = function(e, n) {\n            var i = this._light, o = this._scene;\n            if (o.shadowsEnabled && i.shadowEnabled) {\n              var a = o.activeCamera;\n              if (a) {\n                var s = this.getShadowMap();\n                if (s) {\n                  var d = s.getSize().width;\n                  if (n.setMatrices(\"lightMatrix\" + e, this._transformMatricesAsArray), n.setArray(\"viewFrustumZ\" + e, this._viewSpaceFrustumsZ), n.setFloat(\"cascadeBlendFactor\" + e, this.cascadeBlendPercentage === 0 ? 1e4 : 1 / this.cascadeBlendPercentage), n.setArray(\"frustumLengths\" + e, this._frustumLengths), this._filter === Fn.FILTER_PCF)\n                    n.setDepthStencilTexture(\"shadowSampler\" + e, s), i._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), d, 1 / d, this.frustumEdgeFalloff, e);\n                  else if (this._filter === Fn.FILTER_PCSS) {\n                    for (var p = 0; p < this._numCascades; ++p)\n                      this._lightSizeUVCorrection[2 * p + 0] = p === 0 ? 1 : (this._cascadeMaxExtents[0].x - this._cascadeMinExtents[0].x) / (this._cascadeMaxExtents[p].x - this._cascadeMinExtents[p].x), this._lightSizeUVCorrection[2 * p + 1] = p === 0 ? 1 : (this._cascadeMaxExtents[0].y - this._cascadeMinExtents[0].y) / (this._cascadeMaxExtents[p].y - this._cascadeMinExtents[p].y), this._depthCorrection[p] = p === 0 ? 1 : (this._cascadeMaxExtents[p].z - this._cascadeMinExtents[p].z) / (this._cascadeMaxExtents[0].z - this._cascadeMinExtents[0].z);\n                    n.setDepthStencilTexture(\"shadowSampler\" + e, s), n.setTexture(\"depthSampler\" + e, s), n.setArray2(\"lightSizeUVCorrection\" + e, this._lightSizeUVCorrection), n.setArray(\"depthCorrection\" + e, this._depthCorrection), n.setFloat(\"penumbraDarkness\" + e, this.penumbraDarkness), i._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), 1 / d, this._contactHardeningLightSizeUVRatio * d, this.frustumEdgeFalloff, e);\n                  } else\n                    n.setTexture(\"shadowSampler\" + e, s), i._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), d, 1 / d, this.frustumEdgeFalloff, e);\n                  i._uniformBuffer.updateFloat2(\"depthValues\", this.getLight().getDepthMinZ(a), this.getLight().getDepthMinZ(a) + this.getLight().getDepthMaxZ(a), e);\n                }\n              }\n            }\n          }, t.prototype.getTransformMatrix = function() {\n            return this.getCascadeTransformMatrix(0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._freezeShadowCastersBoundingInfoObservable && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._depthReducer && (this._depthReducer.dispose(), this._depthReducer = null);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this), n = this.getShadowMap();\n            if (!n)\n              return e;\n            if (e.numCascades = this._numCascades, e.debug = this._debug, e.stabilizeCascades = this.stabilizeCascades, e.lambda = this._lambda, e.cascadeBlendPercentage = this.cascadeBlendPercentage, e.depthClamp = this._depthClamp, e.autoCalcDepthBounds = this.autoCalcDepthBounds, e.shadowMaxZ = this._shadowMaxZ, e.penumbraDarkness = this.penumbraDarkness, e.freezeShadowCastersBoundingInfo = this._freezeShadowCastersBoundingInfo, e.minDistance = this.minDistance, e.maxDistance = this.maxDistance, e.renderList = [], n.renderList)\n              for (var i = 0; i < n.renderList.length; i++) {\n                var o = n.renderList[i];\n                e.renderList.push(o.id);\n              }\n            return e;\n          }, t.Parse = function(e, n) {\n            var i = Fn.Parse(e, n, function(o, a) {\n              return new t(o, a);\n            });\n            return e.numCascades !== void 0 && (i.numCascades = e.numCascades), e.debug !== void 0 && (i.debug = e.debug), e.stabilizeCascades !== void 0 && (i.stabilizeCascades = e.stabilizeCascades), e.lambda !== void 0 && (i.lambda = e.lambda), e.cascadeBlendPercentage !== void 0 && (i.cascadeBlendPercentage = e.cascadeBlendPercentage), e.depthClamp !== void 0 && (i.depthClamp = e.depthClamp), e.autoCalcDepthBounds !== void 0 && (i.autoCalcDepthBounds = e.autoCalcDepthBounds), e.shadowMaxZ !== void 0 && (i.shadowMaxZ = e.shadowMaxZ), e.penumbraDarkness !== void 0 && (i.penumbraDarkness = e.penumbraDarkness), e.freezeShadowCastersBoundingInfo !== void 0 && (i.freezeShadowCastersBoundingInfo = e.freezeShadowCastersBoundingInfo), e.minDistance !== void 0 && e.maxDistance !== void 0 && i.setMinMaxDistance(e.minDistance, e.maxDistance), i;\n          }, t.frustumCornersNDCSpace = [new u.e(-1, 1, -1), new u.e(1, 1, -1), new u.e(1, -1, -1), new u.e(-1, -1, -1), new u.e(-1, 1, 1), new u.e(1, 1, 1), new u.e(1, -1, 1), new u.e(-1, -1, 1)], t.CLASSNAME = \"CascadedShadowGenerator\", t.DEFAULT_CASCADES_COUNT = 4, t.MIN_CASCADES_COUNT = 2, t.MAX_CASCADES_COUNT = 4, t._SceneComponentInitialization = function(e) {\n            throw En.a.WarnImport(\"ShadowGeneratorSceneComponent\");\n          }, t;\n        }(Fn);\n        V.a.AddParser(ot.a.NAME_SHADOWGENERATOR, function(r, t) {\n          if (r.shadowGenerators !== void 0 && r.shadowGenerators !== null)\n            for (var e = 0, n = r.shadowGenerators.length; e < n; e++) {\n              var i = r.shadowGenerators[e];\n              i.className === Ds.CLASSNAME ? Ds.Parse(i, t) : Fn.Parse(i, t);\n            }\n        });\n        var Su = function() {\n          function r(t) {\n            this.name = ot.a.NAME_SHADOWGENERATOR, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR, this, this._gatherRenderTargets);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.serialize = function(t) {\n            t.shadowGenerators = [];\n            for (var e = 0, n = this.scene.lights; e < n.length; e++) {\n              var i = n[e].getShadowGenerator();\n              i && t.shadowGenerators.push(i.serialize());\n            }\n          }, r.prototype.addFromContainer = function(t) {\n          }, r.prototype.removeFromContainer = function(t, e) {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._gatherRenderTargets = function(t) {\n            var e = this.scene;\n            if (this.scene.shadowsEnabled)\n              for (var n = 0; n < e.lights.length; n++) {\n                var i = e.lights[n], o = i.getShadowGenerator();\n                if (i.isEnabled() && i.shadowEnabled && o) {\n                  var a = o.getShadowMap();\n                  e.textures.indexOf(a) !== -1 && t.push(a);\n                }\n              }\n          }, r;\n        }();\n        Fn._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_SHADOWGENERATOR);\n          t || (t = new Su(r), r._addComponent(t));\n        }, Q.a.AddNodeConstructor(\"Light_Type_0\", function(r, t) {\n          return function() {\n            return new Ls(r, u.e.Zero(), t);\n          };\n        });\n        var Ls = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._shadowAngle = Math.PI / 2, o.position = n, o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"shadowAngle\", { get: function() {\n            return this._shadowAngle;\n          }, set: function(e) {\n            this._shadowAngle = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._direction;\n          }, set: function(e) {\n            var n = this.needCube();\n            this._direction = e, this.needCube() !== n && this._shadowGenerator && this._shadowGenerator.recreateShadowMap();\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PointLight\";\n          }, t.prototype.getTypeID = function() {\n            return bi.a.LIGHTTYPEID_POINTLIGHT;\n          }, t.prototype.needCube = function() {\n            return !this.direction;\n          }, t.prototype.getShadowDirection = function(e) {\n            if (this.direction)\n              return r.prototype.getShadowDirection.call(this, e);\n            switch (e) {\n              case 0:\n                return new u.e(1, 0, 0);\n              case 1:\n                return new u.e(-1, 0, 0);\n              case 2:\n                return new u.e(0, -1, 0);\n              case 3:\n                return new u.e(0, 1, 0);\n              case 4:\n                return new u.e(0, 0, 1);\n              case 5:\n                return new u.e(0, 0, -1);\n            }\n            return u.e.Zero();\n          }, t.prototype._setDefaultShadowProjectionMatrix = function(e, n, i) {\n            var o = this.getScene().activeCamera;\n            o && u.a.PerspectiveFovLHToRef(this.shadowAngle, 1, this.getDepthMinZ(o), this.getDepthMaxZ(o), e);\n          }, t.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"vLightFalloff\", 4), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, t.prototype.transferToEffect = function(e, n) {\n            return this.computeTransformedInformation() ? this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0, n) : this._uniformBuffer.updateFloat4(\"vLightData\", this.position.x, this.position.y, this.position.z, 0, n), this._uniformBuffer.updateFloat4(\"vLightFalloff\", this.range, this._inverseSquaredRange, 0, 0, n), this;\n          }, t.prototype.transferToNodeMaterialEffect = function(e, n) {\n            return this.computeTransformedInformation() ? e.setFloat3(n, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z) : e.setFloat3(n, this.position.x, this.position.y, this.position.z), this;\n          }, t.prototype.prepareLightSpecificDefines = function(e, n) {\n            e[\"POINTLIGHT\" + n] = !0;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"shadowAngle\", null), t;\n        }(ko), Au = function() {\n          function r(t, e, n) {\n            var i = this;\n            e === void 0 && (e = \"\"), n === void 0 && (n = \"black\"), this._renderingCanvas = t, this._loadingText = e, this._loadingDivBackgroundColor = n, this._resizeLoadingUI = function() {\n              var o = i._renderingCanvas.getBoundingClientRect(), a = window.getComputedStyle(i._renderingCanvas).position;\n              i._loadingDiv && (i._loadingDiv.style.position = a === \"fixed\" ? \"fixed\" : \"absolute\", i._loadingDiv.style.left = o.left + \"px\", i._loadingDiv.style.top = o.top + \"px\", i._loadingDiv.style.width = o.width + \"px\", i._loadingDiv.style.height = o.height + \"px\");\n            };\n          }\n          return r.prototype.displayLoadingUI = function() {\n            if (!this._loadingDiv) {\n              this._loadingDiv = document.createElement(\"div\"), this._loadingDiv.id = \"babylonjsLoadingDiv\", this._loadingDiv.style.opacity = \"0\", this._loadingDiv.style.transition = \"opacity 1.5s ease\", this._loadingDiv.style.pointerEvents = \"none\", this._loadingDiv.style.display = \"grid\", this._loadingDiv.style.gridTemplateRows = \"100%\", this._loadingDiv.style.gridTemplateColumns = \"100%\", this._loadingDiv.style.justifyItems = \"center\", this._loadingDiv.style.alignItems = \"center\", this._loadingTextDiv = document.createElement(\"div\"), this._loadingTextDiv.style.position = \"absolute\", this._loadingTextDiv.style.left = \"0\", this._loadingTextDiv.style.top = \"50%\", this._loadingTextDiv.style.marginTop = \"80px\", this._loadingTextDiv.style.width = \"100%\", this._loadingTextDiv.style.height = \"20px\", this._loadingTextDiv.style.fontFamily = \"Arial\", this._loadingTextDiv.style.fontSize = \"14px\", this._loadingTextDiv.style.color = \"white\", this._loadingTextDiv.style.textAlign = \"center\", this._loadingTextDiv.style.zIndex = \"1\", this._loadingTextDiv.innerHTML = \"Loading\", this._loadingDiv.appendChild(this._loadingTextDiv), this._loadingTextDiv.innerHTML = this._loadingText;\n              var t = document.createElement(\"style\");\n              t.type = \"text/css\", t.innerHTML = `@-webkit-keyframes spin1 {                    0% { -webkit-transform: rotate(0deg);}\n                    100% { -webkit-transform: rotate(360deg);}\n                }                @keyframes spin1 {                    0% { transform: rotate(0deg);}\n                    100% { transform: rotate(360deg);}\n                }`, document.getElementsByTagName(\"head\")[0].appendChild(t);\n              var e = !!window.SVGSVGElement, n = new Image();\n              r.DefaultLogoUrl ? n.src = r.DefaultLogoUrl : n.src = e ? \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+\" : \"https://cdn.babylonjs.com/Assets/babylonLogo.png\", n.style.width = \"150px\", n.style.gridColumn = \"1\", n.style.gridRow = \"1\", n.style.top = \"50%\", n.style.left = \"50%\", n.style.transform = \"translate(-50%, -50%)\", n.style.position = \"absolute\";\n              var i = document.createElement(\"div\");\n              i.style.width = \"300px\", i.style.gridColumn = \"1\", i.style.gridRow = \"1\", i.style.top = \"50%\", i.style.left = \"50%\", i.style.transform = \"translate(-50%, -50%)\", i.style.position = \"absolute\";\n              var o = new Image();\n              if (r.DefaultSpinnerUrl ? o.src = r.DefaultSpinnerUrl : o.src = e ? \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==\" : \"https://cdn.babylonjs.com/Assets/loadingIcon.png\", o.style.animation = \"spin1 0.75s infinite linear\", o.style.webkitAnimation = \"spin1 0.75s infinite linear\", o.style.transformOrigin = \"50% 50%\", o.style.webkitTransformOrigin = \"50% 50%\", !e) {\n                var a = { w: 16, h: 18.5 }, s = { w: 30, h: 30 };\n                n.style.width = a.w + \"vh\", n.style.height = a.h + \"vh\", n.style.left = \"calc(50% - \" + a.w / 2 + \"vh)\", n.style.top = \"calc(50% - \" + a.h / 2 + \"vh)\", o.style.width = s.w + \"vh\", o.style.height = s.h + \"vh\", o.style.left = \"calc(50% - \" + s.w / 2 + \"vh)\", o.style.top = \"calc(50% - \" + s.h / 2 + \"vh)\";\n              }\n              i.appendChild(o), this._loadingDiv.appendChild(n), this._loadingDiv.appendChild(i), this._resizeLoadingUI(), window.addEventListener(\"resize\", this._resizeLoadingUI), this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor, document.body.appendChild(this._loadingDiv), this._loadingDiv.style.opacity = \"1\";\n            }\n          }, r.prototype.hideLoadingUI = function() {\n            var t = this;\n            this._loadingDiv && (this._loadingDiv.style.opacity = \"0\", this._loadingDiv.addEventListener(\"transitionend\", function() {\n              t._loadingDiv && (t._loadingDiv.parentElement && t._loadingDiv.parentElement.removeChild(t._loadingDiv), window.removeEventListener(\"resize\", t._resizeLoadingUI), t._loadingDiv = null);\n            }));\n          }, Object.defineProperty(r.prototype, \"loadingUIText\", { get: function() {\n            return this._loadingText;\n          }, set: function(t) {\n            this._loadingText = t, this._loadingTextDiv && (this._loadingTextDiv.innerHTML = this._loadingText);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"loadingUIBackgroundColor\", { get: function() {\n            return this._loadingDivBackgroundColor;\n          }, set: function(t) {\n            this._loadingDivBackgroundColor = t, this._loadingDiv && (this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor);\n          }, enumerable: !1, configurable: !0 }), r.DefaultLogoUrl = \"\", r.DefaultSpinnerUrl = \"\", r;\n        }();\n        Ue.a.DefaultLoadingScreenFactory = function(r) {\n          return new Au(r);\n        };\n        var Ns = f(71), Qi = f(68), ws = function() {\n          function r() {\n          }\n          return r.ConvertPanoramaToCubemap = function(t, e, n, i) {\n            if (!t)\n              throw \"ConvertPanoramaToCubemap: input cannot be null\";\n            if (t.length != e * n * 3)\n              throw \"ConvertPanoramaToCubemap: input size is wrong\";\n            return { front: this.CreateCubemapTexture(i, this.FACE_FRONT, t, e, n), back: this.CreateCubemapTexture(i, this.FACE_BACK, t, e, n), left: this.CreateCubemapTexture(i, this.FACE_LEFT, t, e, n), right: this.CreateCubemapTexture(i, this.FACE_RIGHT, t, e, n), up: this.CreateCubemapTexture(i, this.FACE_UP, t, e, n), down: this.CreateCubemapTexture(i, this.FACE_DOWN, t, e, n), size: i, type: h.a.TEXTURETYPE_FLOAT, format: h.a.TEXTUREFORMAT_RGB, gammaSpace: !1 };\n          }, r.CreateCubemapTexture = function(t, e, n, i, o) {\n            for (var a = new ArrayBuffer(t * t * 4 * 3), s = new Float32Array(a), d = e[1].subtract(e[0]).scale(1 / t), p = e[3].subtract(e[2]).scale(1 / t), y = 1 / t, P = 0, R = 0; R < t; R++) {\n              for (var B = e[0], F = e[2], z = 0; z < t; z++) {\n                var J = F.subtract(B).scale(P).add(B);\n                J.normalize();\n                var ie = this.CalcProjectionSpherical(J, n, i, o);\n                s[R * t * 3 + 3 * z + 0] = ie.r, s[R * t * 3 + 3 * z + 1] = ie.g, s[R * t * 3 + 3 * z + 2] = ie.b, B = B.add(d), F = F.add(p);\n              }\n              P += y;\n            }\n            return s;\n          }, r.CalcProjectionSpherical = function(t, e, n, i) {\n            for (var o = Math.atan2(t.z, t.x), a = Math.acos(t.y); o < -Math.PI; )\n              o += 2 * Math.PI;\n            for (; o > Math.PI; )\n              o -= 2 * Math.PI;\n            var s = o / Math.PI, d = a / Math.PI;\n            s = 0.5 * s + 0.5;\n            var p = Math.round(s * n);\n            p < 0 ? p = 0 : p >= n && (p = n - 1);\n            var y = Math.round(d * i);\n            y < 0 ? y = 0 : y >= i && (y = i - 1);\n            var P = i - y - 1;\n            return { r: e[P * n * 3 + 3 * p + 0], g: e[P * n * 3 + 3 * p + 1], b: e[P * n * 3 + 3 * p + 2] };\n          }, r.FACE_LEFT = [new u.e(-1, -1, -1), new u.e(1, -1, -1), new u.e(-1, 1, -1), new u.e(1, 1, -1)], r.FACE_RIGHT = [new u.e(1, -1, 1), new u.e(-1, -1, 1), new u.e(1, 1, 1), new u.e(-1, 1, 1)], r.FACE_FRONT = [new u.e(1, -1, -1), new u.e(1, -1, 1), new u.e(1, 1, -1), new u.e(1, 1, 1)], r.FACE_BACK = [new u.e(-1, -1, 1), new u.e(-1, -1, -1), new u.e(-1, 1, 1), new u.e(-1, 1, -1)], r.FACE_DOWN = [new u.e(1, 1, -1), new u.e(1, 1, 1), new u.e(-1, 1, -1), new u.e(-1, 1, 1)], r.FACE_UP = [new u.e(-1, -1, -1), new u.e(-1, -1, 1), new u.e(1, -1, -1), new u.e(1, -1, 1)], r;\n        }(), Pu = function() {\n          function r() {\n          }\n          return r.Ldexp = function(t, e) {\n            return e > 1023 ? t * Math.pow(2, 1023) * Math.pow(2, e - 1023) : e < -1074 ? t * Math.pow(2, -1074) * Math.pow(2, e + 1074) : t * Math.pow(2, e);\n          }, r.Rgbe2float = function(t, e, n, i, o, a) {\n            o > 0 ? (o = this.Ldexp(1, o - 136), t[a + 0] = e * o, t[a + 1] = n * o, t[a + 2] = i * o) : (t[a + 0] = 0, t[a + 1] = 0, t[a + 2] = 0);\n          }, r.readStringLine = function(t, e) {\n            for (var n = \"\", i = \"\", o = e; o < t.length - e && (i = String.fromCharCode(t[o])) != `\n`; o++)\n              n += i;\n            return n;\n          }, r.RGBE_ReadHeader = function(t) {\n            var e, n, i = this.readStringLine(t, 0);\n            if (i[0] != \"#\" || i[1] != \"?\")\n              throw \"Bad HDR Format.\";\n            var o = !1, a = !1, s = 0;\n            do\n              s += i.length + 1, (i = this.readStringLine(t, s)) == \"FORMAT=32-bit_rle_rgbe\" ? a = !0 : i.length == 0 && (o = !0);\n            while (!o);\n            if (!a)\n              throw \"HDR Bad header format, unsupported FORMAT\";\n            s += i.length + 1, i = this.readStringLine(t, s);\n            var d = /^\\-Y (.*) \\+X (.*)$/g.exec(i);\n            if (!d || d.length < 3)\n              throw \"HDR Bad header format, no size\";\n            if (n = parseInt(d[2]), e = parseInt(d[1]), n < 8 || n > 32767)\n              throw \"HDR Bad header format, unsupported size\";\n            return { height: e, width: n, dataPosition: s += i.length + 1 };\n          }, r.GetCubeMapTextureData = function(t, e) {\n            var n = new Uint8Array(t), i = this.RGBE_ReadHeader(n), o = this.RGBE_ReadPixels(n, i);\n            return ws.ConvertPanoramaToCubemap(o, i.width, i.height, e);\n          }, r.RGBE_ReadPixels = function(t, e) {\n            return this.RGBE_ReadPixels_RLE(t, e);\n          }, r.RGBE_ReadPixels_RLE = function(t, e) {\n            for (var n, i, o, a, s, d = e.height, p = e.width, y = e.dataPosition, P = 0, R = 0, B = 0, F = new ArrayBuffer(4 * p), z = new Uint8Array(F), J = new ArrayBuffer(e.width * e.height * 4 * 3), ie = new Float32Array(J); d > 0; ) {\n              if (n = t[y++], i = t[y++], o = t[y++], a = t[y++], n != 2 || i != 2 || 128 & o || e.width < 8 || e.width > 32767)\n                return this.RGBE_ReadPixels_NOT_RLE(t, e);\n              if ((o << 8 | a) != p)\n                throw \"HDR Bad header format, wrong scan line width\";\n              for (P = 0, B = 0; B < 4; B++)\n                for (R = (B + 1) * p; P < R; )\n                  if (n = t[y++], i = t[y++], n > 128) {\n                    if ((s = n - 128) == 0 || s > R - P)\n                      throw \"HDR Bad Format, bad scanline data (run)\";\n                    for (; s-- > 0; )\n                      z[P++] = i;\n                  } else {\n                    if ((s = n) == 0 || s > R - P)\n                      throw \"HDR Bad Format, bad scanline data (non-run)\";\n                    if (z[P++] = i, --s > 0)\n                      for (var se = 0; se < s; se++)\n                        z[P++] = t[y++];\n                  }\n              for (B = 0; B < p; B++)\n                n = z[B], i = z[B + p], o = z[B + 2 * p], a = z[B + 3 * p], this.Rgbe2float(ie, n, i, o, a, (e.height - d) * p * 3 + 3 * B);\n              d--;\n            }\n            return ie;\n          }, r.RGBE_ReadPixels_NOT_RLE = function(t, e) {\n            for (var n, i, o, a, s, d = e.height, p = e.width, y = e.dataPosition, P = new ArrayBuffer(e.width * e.height * 4 * 3), R = new Float32Array(P); d > 0; ) {\n              for (s = 0; s < e.width; s++)\n                n = t[y++], i = t[y++], o = t[y++], a = t[y++], this.Rgbe2float(R, n, i, o, a, (e.height - d) * p * 3 + 3 * s);\n              d--;\n            }\n            return R;\n          }, r;\n        }(), xu = function() {\n          function r(t, e) {\n            var n;\n            e === void 0 && (e = r._DefaultOptions), this.engine = t, this._fullscreenViewport = new jn.a(0, 0, 1, 1), e = Object(c.a)(Object(c.a)({}, r._DefaultOptions), e), this._vertexBuffers = ((n = {})[Oe.b.PositionKind] = new Oe.b(t, e.positions, Oe.b.PositionKind, !1, !1, 2), n), this._indexBuffer = t.createIndexBuffer(e.indices);\n          }\n          return r.prototype.setViewport = function(t) {\n            t === void 0 && (t = this._fullscreenViewport), this.engine.setViewport(t);\n          }, r.prototype.bindBuffers = function(t) {\n            this.engine.bindBuffers(this._vertexBuffers, this._indexBuffer, t);\n          }, r.prototype.applyEffectWrapper = function(t) {\n            this.engine.depthCullingState.depthTest = !1, this.engine.stencilState.stencilTest = !1, this.engine.enableEffect(t.effect), this.bindBuffers(t.effect), t.onApplyObservable.notifyObservers({});\n          }, r.prototype.restoreStates = function() {\n            this.engine.depthCullingState.depthTest = !0, this.engine.stencilState.stencilTest = !0;\n          }, r.prototype.draw = function() {\n            this.engine.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, 6);\n          }, r.prototype.isRenderTargetTexture = function(t) {\n            return t.renderList !== void 0;\n          }, r.prototype.render = function(t, e) {\n            if (e === void 0 && (e = null), t.effect.isReady()) {\n              this.setViewport();\n              var n = e === null ? null : this.isRenderTargetTexture(e) ? e.getInternalTexture() : e;\n              n && this.engine.bindFramebuffer(n), this.applyEffectWrapper(t), this.draw(), n && this.engine.unBindFramebuffer(n), this.restoreStates();\n            }\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && (t.dispose(), delete this._vertexBuffers[Oe.b.PositionKind]), this._indexBuffer && this.engine._releaseBuffer(this._indexBuffer);\n          }, r._DefaultOptions = { positions: [1, 1, -1, 1, -1, -1, 1, -1], indices: [0, 1, 2, 0, 2, 3] }, r;\n        }(), Cu = function() {\n          function r(t) {\n            var e, n = this;\n            this.onApplyObservable = new C.c();\n            var i = t.uniformNames || [];\n            t.vertexShader ? e = { fragmentSource: t.fragmentShader, vertexSource: t.vertexShader, spectorName: t.name || \"effectWrapper\" } : (i.push(\"scale\"), e = { fragmentSource: t.fragmentShader, vertex: \"postprocess\", spectorName: t.name || \"effectWrapper\" }, this.onApplyObservable.add(function() {\n              n.effect.setFloat2(\"scale\", 1, 1);\n            }));\n            var o = t.defines ? t.defines.join(`\n`) : \"\";\n            t.useShaderStore ? (e.fragment = e.fragmentSource, e.vertex || (e.vertex = e.vertexSource), delete e.fragmentSource, delete e.vertexSource, this.effect = t.engine.createEffect(e.spectorName, t.attributeNames || [\"position\"], i, t.samplerNames, o, void 0, t.onCompiled)) : this.effect = new ze.a(e, t.attributeNames || [\"position\"], i, t.samplerNames, t.engine, o, void 0, t.onCompiled);\n          }\n          return r.prototype.dispose = function() {\n            this.effect.dispose();\n          }, r;\n        }(), A_ = `\nattribute vec2 position;\n\nvarying vec3 direction;\n\nuniform vec3 up;\nuniform vec3 right;\nuniform vec3 front;\nvoid main(void) {\nmat3 view=mat3(up,right,front);\ndirection=view*vec3(position,1.0);\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.hdrFilteringVertexShader = A_;\n        var P_ = `#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform float alphaG;\nuniform samplerCube inputTexture;\nuniform vec2 vFilteringInfo;\nuniform float hdrScale;\nvarying vec3 direction;\nvoid main() {\nvec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);\ngl_FragColor=vec4(color*hdrScale,1.0);\n}`;\n        ze.a.ShadersStore.hdrFilteringPixelShader = P_;\n        var Ru = function() {\n          function r(t, e) {\n            e === void 0 && (e = {}), this._lodGenerationOffset = 0, this._lodGenerationScale = 0.8, this.quality = h.a.TEXTURE_FILTERING_QUALITY_OFFLINE, this.hdrScale = 1, this._engine = t, this.hdrScale = e.hdrScale || this.hdrScale, this.quality = e.hdrScale || this.quality;\n          }\n          return r.prototype._createRenderTarget = function(t) {\n            var e = h.a.TEXTURETYPE_UNSIGNED_BYTE;\n            this._engine.getCaps().textureHalfFloatRender ? e = h.a.TEXTURETYPE_HALF_FLOAT : this._engine.getCaps().textureFloatRender && (e = h.a.TEXTURETYPE_FLOAT);\n            var n = this._engine.createRenderTargetCubeTexture(t, { format: h.a.TEXTUREFORMAT_RGBA, type: e, generateMipMaps: !1, generateDepthBuffer: !1, generateStencilBuffer: !1, samplingMode: h.a.TEXTURE_NEAREST_SAMPLINGMODE });\n            return this._engine.updateTextureWrappingMode(n, h.a.TEXTURE_CLAMP_ADDRESSMODE, h.a.TEXTURE_CLAMP_ADDRESSMODE, h.a.TEXTURE_CLAMP_ADDRESSMODE), this._engine.updateTextureSamplingMode(h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, n, !0), n;\n          }, r.prototype._prefilterInternal = function(t) {\n            var e = t.getSize().width, n = Math.round($.a.Log2(e)) + 1, i = this._effectWrapper.effect, o = this._createRenderTarget(e);\n            this._effectRenderer.setViewport();\n            var a = t.getInternalTexture();\n            a && this._engine.updateTextureSamplingMode(h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, a, !0), this._effectRenderer.applyEffectWrapper(this._effectWrapper);\n            var s = [[new u.e(0, 0, -1), new u.e(0, -1, 0), new u.e(1, 0, 0)], [new u.e(0, 0, 1), new u.e(0, -1, 0), new u.e(-1, 0, 0)], [new u.e(1, 0, 0), new u.e(0, 0, 1), new u.e(0, 1, 0)], [new u.e(1, 0, 0), new u.e(0, 0, -1), new u.e(0, -1, 0)], [new u.e(1, 0, 0), new u.e(0, -1, 0), new u.e(0, 0, 1)], [new u.e(-1, 0, 0), new u.e(0, -1, 0), new u.e(0, 0, -1)]];\n            i.setFloat(\"hdrScale\", this.hdrScale), i.setFloat2(\"vFilteringInfo\", t.getSize().width, n), i.setTexture(\"inputTexture\", t);\n            for (var d = 0; d < 6; d++) {\n              i.setVector3(\"up\", s[d][0]), i.setVector3(\"right\", s[d][1]), i.setVector3(\"front\", s[d][2]);\n              for (var p = 0; p < n; p++) {\n                this._engine.bindFramebuffer(o, d, void 0, void 0, !0, p), this._effectRenderer.applyEffectWrapper(this._effectWrapper);\n                var y = Math.pow(2, (p - this._lodGenerationOffset) / this._lodGenerationScale) / e;\n                p === 0 && (y = 0), i.setFloat(\"alphaG\", y), this._effectRenderer.draw();\n              }\n            }\n            return this._effectRenderer.restoreStates(), this._engine.restoreDefaultFramebuffer(), this._engine._releaseFramebufferObjects(o), this._engine._releaseTexture(t._texture), o._swapAndDie(t._texture), t._prefiltered = !0, t;\n          }, r.prototype._createEffect = function(t, e) {\n            var n = [];\n            return t.gammaSpace && n.push(\"#define GAMMA_INPUT\"), n.push(\"#define NUM_SAMPLES \" + this.quality + \"u\"), new Cu({ engine: this._engine, name: \"hdrFiltering\", vertexShader: \"hdrFiltering\", fragmentShader: \"hdrFiltering\", samplerNames: [\"inputTexture\"], uniformNames: [\"vSampleDirections\", \"vWeights\", \"up\", \"right\", \"front\", \"vFilteringInfo\", \"hdrScale\", \"alphaG\"], useShaderStore: !0, defines: n, onCompiled: e });\n          }, r.prototype.isReady = function(t) {\n            return t.isReady() && this._effectWrapper.effect.isReady();\n          }, r.prototype.prefilter = function(t, e) {\n            var n = this;\n            if (e === void 0 && (e = null), this._engine.webGLVersion !== 1)\n              return new Promise(function(i) {\n                n._effectRenderer = new xu(n._engine), n._effectWrapper = n._createEffect(t), n._effectWrapper.effect.executeWhenCompiled(function() {\n                  n._prefilterInternal(t), n._effectRenderer.dispose(), n._effectWrapper.dispose(), i(), e && e();\n                });\n              });\n            l.a.Warn(\"HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.\");\n          }, r;\n        }(), qo = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            var P;\n            o === void 0 && (o = !1), a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = !1), p === void 0 && (p = null), y === void 0 && (y = null);\n            var R = r.call(this, n) || this;\n            return R._generateHarmonics = !0, R._onLoad = null, R._onError = null, R._isBlocking = !0, R._rotationY = 0, R.boundingBoxPosition = u.e.Zero(), e && (R._coordinatesMode = Ne.a.CUBIC_MODE, R.name = e, R.url = e, R.hasAlpha = !1, R.isCube = !0, R._textureMatrix = u.a.Identity(), R._prefilterOnLoad = d, R._onLoad = p, R._onError = y, R.gammaSpace = s, R._noMipmap = o, R._size = i, R._generateHarmonics = a, R._texture = R._getFromCache(e, R._noMipmap), R._texture ? p && (R._texture.isReady ? Xe.b.SetImmediate(function() {\n              return p();\n            }) : R._texture.onLoadedObservable.add(p)) : !((P = R.getScene()) === null || P === void 0) && P.useDelayedTextureLoading ? R.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : R.loadTexture()), R;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"isBlocking\", { get: function() {\n            return this._isBlocking;\n          }, set: function(e) {\n            this._isBlocking = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotationY\", { get: function() {\n            return this._rotationY;\n          }, set: function(e) {\n            this._rotationY = e, this.setReflectionTextureMatrix(u.a.RotationY(this._rotationY));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"boundingBoxSize\", { get: function() {\n            return this._boundingBoxSize;\n          }, set: function(e) {\n            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {\n              this._boundingBoxSize = e;\n              var n = this.getScene();\n              n && n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n            }\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"HDRCubeTexture\";\n          }, t.prototype.loadTexture = function() {\n            var e = this, n = this._getEngine();\n            if (this._getEngine().webGLVersion >= 2 && this._prefilterOnLoad) {\n              var i = this._onLoad, o = new Ru(n);\n              this._onLoad = function() {\n                o.prefilter(e, i);\n              };\n            }\n            this._texture = n.createRawCubeTextureFromUrl(this.url, this.getScene(), this._size, h.a.TEXTUREFORMAT_RGB, n.getCaps().textureFloat ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INT, this._noMipmap, function(a) {\n              e.lodGenerationOffset = 0, e.lodGenerationScale = 0.8;\n              var s = Pu.GetCubeMapTextureData(a, e._size);\n              if (e._generateHarmonics) {\n                var d = Lo.ConvertCubeMapToSphericalPolynomial(s);\n                e.sphericalPolynomial = d;\n              }\n              for (var p = [], y = null, P = 0; P < 6; P++) {\n                if (!n.getCaps().textureFloat) {\n                  var R = new ArrayBuffer(e._size * e._size * 3);\n                  y = new Uint8Array(R);\n                }\n                var B = s[t._facesMapping[P]];\n                if (e.gammaSpace || y) {\n                  for (var F = 0; F < e._size * e._size; F++)\n                    if (e.gammaSpace && (B[3 * F + 0] = Math.pow(B[3 * F + 0], Vt.b), B[3 * F + 1] = Math.pow(B[3 * F + 1], Vt.b), B[3 * F + 2] = Math.pow(B[3 * F + 2], Vt.b)), y) {\n                      var z = Math.max(255 * B[3 * F + 0], 0), J = Math.max(255 * B[3 * F + 1], 0), ie = Math.max(255 * B[3 * F + 2], 0), se = Math.max(Math.max(z, J), ie);\n                      if (se > 255) {\n                        var ce = 255 / se;\n                        z *= ce, J *= ce, ie *= ce;\n                      }\n                      y[3 * F + 0] = z, y[3 * F + 1] = J, y[3 * F + 2] = ie;\n                    }\n                }\n                y ? p.push(y) : p.push(B);\n              }\n              return p;\n            }, null, this._onLoad, this._onError);\n          }, t.prototype.clone = function() {\n            var e = new t(this.url, this.getScene() || this._getEngine(), this._size, this._noMipmap, this._generateHarmonics, this.gammaSpace);\n            return e.level = this.level, e.wrapU = this.wrapU, e.wrapV = this.wrapV, e.coordinatesIndex = this.coordinatesIndex, e.coordinatesMode = this.coordinatesMode, e;\n          }, t.prototype.delayLoad = function() {\n            this.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = h.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap), this._texture || this.loadTexture());\n          }, t.prototype.getReflectionTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.setReflectionTextureMatrix = function(e) {\n            var n, i = this;\n            this._textureMatrix = e, e.updateFlag !== this._textureMatrix.updateFlag && e.isIdentity() !== this._textureMatrix.isIdentity() && ((n = this.getScene()) === null || n === void 0 || n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag, function(o) {\n              return o.getActiveTextures().indexOf(i) !== -1;\n            }));\n          }, t.Parse = function(e, n, i) {\n            var o = null;\n            return e.name && !e.isRenderTarget && ((o = new t(i + e.name, n, e.size, e.noMipmap, e.generateHarmonics, e.useInGammaSpace)).name = e.name, o.hasAlpha = e.hasAlpha, o.level = e.level, o.coordinatesMode = e.coordinatesMode, o.isBlocking = e.isBlocking), o && (e.boundingBoxPosition && (o.boundingBoxPosition = u.e.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (o.boundingBoxSize = u.e.FromArray(e.boundingBoxSize)), e.rotationY && (o.rotationY = e.rotationY)), o;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = {};\n            return e.name = this.name, e.hasAlpha = this.hasAlpha, e.isCube = !0, e.level = this.level, e.size = this._size, e.coordinatesMode = this.coordinatesMode, e.useInGammaSpace = this.gammaSpace, e.generateHarmonics = this._generateHarmonics, e.customType = \"BABYLON.HDRCubeTexture\", e.noMipmap = this._noMipmap, e.isBlocking = this._isBlocking, e.rotationY = this._rotationY, e;\n          }, t._facesMapping = [\"right\", \"left\", \"up\", \"down\", \"front\", \"back\"], t;\n        }(kn.a);\n        O.a.RegisteredTypes[\"BABYLON.HDRCubeTexture\"] = qo;\n        var Ou = function() {\n          function r(t, e, n) {\n            e === void 0 && (e = 0), n === void 0 && (n = null), this.name = t, this.animations = new Array(), this._positions = null, this._normals = null, this._tangents = null, this._uvs = null, this._uniqueId = 0, this.onInfluenceChanged = new C.c(), this._onDataLayoutChanged = new C.c(), this._animationPropertiesOverride = null, this._scene = n || te.a.LastCreatedScene, this.influence = e, this._scene && (this._uniqueId = this._scene.getUniqueId());\n          }\n          return Object.defineProperty(r.prototype, \"influence\", { get: function() {\n            return this._influence;\n          }, set: function(t) {\n            if (this._influence !== t) {\n              var e = this._influence;\n              this._influence = t, this.onInfluenceChanged.hasObservers() && this.onInfluenceChanged.notifyObservers(e === 0 || t === 0);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationPropertiesOverride\", { get: function() {\n            return !this._animationPropertiesOverride && this._scene ? this._scene.animationPropertiesOverride : this._animationPropertiesOverride;\n          }, set: function(t) {\n            this._animationPropertiesOverride = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasPositions\", { get: function() {\n            return !!this._positions;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasNormals\", { get: function() {\n            return !!this._normals;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasTangents\", { get: function() {\n            return !!this._tangents;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasUVs\", { get: function() {\n            return !!this._uvs;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setPositions = function(t) {\n            var e = this.hasPositions;\n            this._positions = t, e !== this.hasPositions && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getPositions = function() {\n            return this._positions;\n          }, r.prototype.setNormals = function(t) {\n            var e = this.hasNormals;\n            this._normals = t, e !== this.hasNormals && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getNormals = function() {\n            return this._normals;\n          }, r.prototype.setTangents = function(t) {\n            var e = this.hasTangents;\n            this._tangents = t, e !== this.hasTangents && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getTangents = function() {\n            return this._tangents;\n          }, r.prototype.setUVs = function(t) {\n            var e = this.hasUVs;\n            this._uvs = t, e !== this.hasUVs && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getUVs = function() {\n            return this._uvs;\n          }, r.prototype.clone = function() {\n            var t = this, e = L.a.Clone(function() {\n              return new r(t.name, t.influence, t._scene);\n            }, this);\n            return e._positions = this._positions, e._normals = this._normals, e._tangents = this._tangents, e._uvs = this._uvs, e;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.name = this.name, t.influence = this.influence, t.positions = Array.prototype.slice.call(this.getPositions()), this.id != null && (t.id = this.id), this.hasNormals && (t.normals = Array.prototype.slice.call(this.getNormals())), this.hasTangents && (t.tangents = Array.prototype.slice.call(this.getTangents())), this.hasUVs && (t.uvs = Array.prototype.slice.call(this.getUVs())), L.a.AppendSerializedAnimations(this, t), t;\n          }, r.prototype.getClassName = function() {\n            return \"MorphTarget\";\n          }, r.Parse = function(t) {\n            var e = new r(t.name, t.influence);\n            if (e.setPositions(t.positions), t.id != null && (e.id = t.id), t.normals && e.setNormals(t.normals), t.tangents && e.setTangents(t.tangents), t.uvs && e.setUVs(t.uvs), t.animations)\n              for (var n = 0; n < t.animations.length; n++) {\n                var i = t.animations[n], o = O.a.GetClass(\"BABYLON.Animation\");\n                o && e.animations.push(o.Parse(i));\n              }\n            return e;\n          }, r.FromMesh = function(t, e, n) {\n            e || (e = t.name);\n            var i = new r(e, n, t.getScene());\n            return i.setPositions(t.getVerticesData(Oe.b.PositionKind)), t.isVerticesDataPresent(Oe.b.NormalKind) && i.setNormals(t.getVerticesData(Oe.b.NormalKind)), t.isVerticesDataPresent(Oe.b.TangentKind) && i.setTangents(t.getVerticesData(Oe.b.TangentKind)), t.isVerticesDataPresent(Oe.b.UVKind) && i.setUVs(t.getVerticesData(Oe.b.UVKind)), i;\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"id\", void 0), r;\n        }(), Zo = function() {\n          function r(t) {\n            t === void 0 && (t = null), this._targets = new Array(), this._targetInfluenceChangedObservers = new Array(), this._targetDataLayoutChangedObservers = new Array(), this._activeTargets = new si.a(16), this._supportsNormals = !1, this._supportsTangents = !1, this._supportsUVs = !1, this._vertexCount = 0, this._uniqueId = 0, this._tempInfluences = new Array(), this.enableNormalMorphing = !0, this.enableTangentMorphing = !0, this.enableUVMorphing = !0, t || (t = te.a.LastCreatedScene), this._scene = t, this._scene && (this._scene.morphTargetManagers.push(this), this._uniqueId = this._scene.getUniqueId());\n          }\n          return Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"vertexCount\", { get: function() {\n            return this._vertexCount;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"supportsNormals\", { get: function() {\n            return this._supportsNormals && this.enableNormalMorphing;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"supportsTangents\", { get: function() {\n            return this._supportsTangents && this.enableTangentMorphing;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"supportsUVs\", { get: function() {\n            return this._supportsUVs && this.enableUVMorphing;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"numTargets\", { get: function() {\n            return this._targets.length;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"numInfluencers\", { get: function() {\n            return this._activeTargets.length;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"influences\", { get: function() {\n            return this._influences;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getActiveTarget = function(t) {\n            return this._activeTargets.data[t];\n          }, r.prototype.getTarget = function(t) {\n            return this._targets[t];\n          }, r.prototype.addTarget = function(t) {\n            var e = this;\n            this._targets.push(t), this._targetInfluenceChangedObservers.push(t.onInfluenceChanged.add(function(n) {\n              e._syncActiveTargets(n);\n            })), this._targetDataLayoutChangedObservers.push(t._onDataLayoutChanged.add(function() {\n              e._syncActiveTargets(!0);\n            })), this._syncActiveTargets(!0);\n          }, r.prototype.removeTarget = function(t) {\n            var e = this._targets.indexOf(t);\n            e >= 0 && (this._targets.splice(e, 1), t.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(e, 1)[0]), t._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(e, 1)[0]), this._syncActiveTargets(!0));\n          }, r.prototype.clone = function() {\n            for (var t = new r(this._scene), e = 0, n = this._targets; e < n.length; e++) {\n              var i = n[e];\n              t.addTarget(i.clone());\n            }\n            return t.enableNormalMorphing = this.enableNormalMorphing, t.enableTangentMorphing = this.enableTangentMorphing, t.enableUVMorphing = this.enableUVMorphing, t;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.id = this.uniqueId, t.targets = [];\n            for (var e = 0, n = this._targets; e < n.length; e++) {\n              var i = n[e];\n              t.targets.push(i.serialize());\n            }\n            return t;\n          }, r.prototype._syncActiveTargets = function(t) {\n            var e = 0;\n            this._activeTargets.reset(), this._supportsNormals = !0, this._supportsTangents = !0, this._supportsUVs = !0, this._vertexCount = 0;\n            for (var n = 0, i = this._targets; n < i.length; n++) {\n              var o = i[n];\n              if (o.influence !== 0) {\n                this._activeTargets.push(o), this._tempInfluences[e++] = o.influence, this._supportsNormals = this._supportsNormals && o.hasNormals, this._supportsTangents = this._supportsTangents && o.hasTangents, this._supportsUVs = this._supportsUVs && o.hasUVs;\n                var a = o.getPositions();\n                if (a) {\n                  var s = a.length / 3;\n                  if (this._vertexCount === 0)\n                    this._vertexCount = s;\n                  else if (this._vertexCount !== s)\n                    return void l.a.Error(\"Incompatible target. Targets must all have the same vertices count.\");\n                }\n              }\n            }\n            this._influences && this._influences.length === e || (this._influences = new Float32Array(e));\n            for (var d = 0; d < e; d++)\n              this._influences[d] = this._tempInfluences[d];\n            t && this.synchronize();\n          }, r.prototype.synchronize = function() {\n            if (this._scene)\n              for (var t = 0, e = this._scene.meshes; t < e.length; t++) {\n                var n = e[t];\n                n.morphTargetManager === this && n._syncGeometryWithMorphTargetManager();\n              }\n          }, r.Parse = function(t, e) {\n            var n = new r(e);\n            n._uniqueId = t.id;\n            for (var i = 0, o = t.targets; i < o.length; i++) {\n              var a = o[i];\n              n.addTarget(Ou.Parse(a));\n            }\n            return n;\n          }, r;\n        }(), At = f(32), Jt = f(50), Sr = function() {\n          function r(t, e) {\n            if (e === void 0 && (e = r.DefaultPluginFactory()), this._physicsPlugin = e, this._impostors = [], this._joints = [], this._subTimeStep = 0, !this._physicsPlugin.isSupported())\n              throw new Error(\"Physics Engine \" + this._physicsPlugin.name + \" cannot be found. Please make sure it is included.\");\n            t = t || new u.e(0, -9.807, 0), this.setGravity(t), this.setTimeStep();\n          }\n          return r.DefaultPluginFactory = function() {\n            throw En.a.WarnImport(\"CannonJSPlugin\");\n          }, r.prototype.setGravity = function(t) {\n            this.gravity = t, this._physicsPlugin.setGravity(this.gravity);\n          }, r.prototype.setTimeStep = function(t) {\n            t === void 0 && (t = 1 / 60), this._physicsPlugin.setTimeStep(t);\n          }, r.prototype.getTimeStep = function() {\n            return this._physicsPlugin.getTimeStep();\n          }, r.prototype.setSubTimeStep = function(t) {\n            t === void 0 && (t = 0), this._subTimeStep = t;\n          }, r.prototype.getSubTimeStep = function() {\n            return this._subTimeStep;\n          }, r.prototype.dispose = function() {\n            this._impostors.forEach(function(t) {\n              t.dispose();\n            }), this._physicsPlugin.dispose();\n          }, r.prototype.getPhysicsPluginName = function() {\n            return this._physicsPlugin.name;\n          }, r.prototype.addImpostor = function(t) {\n            t.uniqueId = this._impostors.push(t), t.parent || this._physicsPlugin.generatePhysicsBody(t);\n          }, r.prototype.removeImpostor = function(t) {\n            var e = this._impostors.indexOf(t);\n            e > -1 && this._impostors.splice(e, 1).length && this.getPhysicsPlugin().removePhysicsBody(t);\n          }, r.prototype.addJoint = function(t, e, n) {\n            var i = { mainImpostor: t, connectedImpostor: e, joint: n };\n            n.physicsPlugin = this._physicsPlugin, this._joints.push(i), this._physicsPlugin.generateJoint(i);\n          }, r.prototype.removeJoint = function(t, e, n) {\n            var i = this._joints.filter(function(o) {\n              return o.connectedImpostor === e && o.joint === n && o.mainImpostor === t;\n            });\n            i.length && this._physicsPlugin.removeJoint(i[0]);\n          }, r.prototype._step = function(t) {\n            var e = this;\n            this._impostors.forEach(function(n) {\n              n.isBodyInitRequired() && e._physicsPlugin.generatePhysicsBody(n);\n            }), t > 0.1 ? t = 0.1 : t <= 0 && (t = 1 / 60), this._physicsPlugin.executeStep(t, this._impostors);\n          }, r.prototype.getPhysicsPlugin = function() {\n            return this._physicsPlugin;\n          }, r.prototype.getImpostors = function() {\n            return this._impostors;\n          }, r.prototype.getImpostorForPhysicsObject = function(t) {\n            for (var e = 0; e < this._impostors.length; ++e)\n              if (this._impostors[e].object === t)\n                return this._impostors[e];\n            return null;\n          }, r.prototype.getImpostorWithPhysicsBody = function(t) {\n            for (var e = 0; e < this._impostors.length; ++e)\n              if (this._impostors[e].physicsBody === t)\n                return this._impostors[e];\n            return null;\n          }, r.prototype.raycast = function(t, e) {\n            return this._physicsPlugin.raycast(t, e);\n          }, r.Epsilon = 1e-3, r;\n        }(), Fs = function() {\n          function r() {\n            this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = u.e.Zero(), this._hitPointWorld = u.e.Zero(), this._rayFromWorld = u.e.Zero(), this._rayToWorld = u.e.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"hasHit\", { get: function() {\n            return this._hasHit;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hitDistance\", { get: function() {\n            return this._hitDistance;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hitNormalWorld\", { get: function() {\n            return this._hitNormalWorld;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hitPointWorld\", { get: function() {\n            return this._hitPointWorld;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rayFromWorld\", { get: function() {\n            return this._rayFromWorld;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rayToWorld\", { get: function() {\n            return this._rayToWorld;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setHitData = function(t, e) {\n            this._hasHit = !0, this._hitNormalWorld = new u.e(t.x, t.y, t.z), this._hitPointWorld = new u.e(e.x, e.y, e.z);\n          }, r.prototype.setHitDistance = function(t) {\n            this._hitDistance = t;\n          }, r.prototype.calculateHitDistance = function() {\n            this._hitDistance = u.e.Distance(this._rayFromWorld, this._hitPointWorld);\n          }, r.prototype.reset = function(t, e) {\n            t === void 0 && (t = u.e.Zero()), e === void 0 && (e = u.e.Zero()), this._rayFromWorld = t, this._rayToWorld = e, this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = u.e.Zero(), this._hitPointWorld = u.e.Zero();\n          }, r;\n        }(), Bs = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = !0), e === void 0 && (e = 10), n === void 0 && (n = CANNON), this._useDeltaForWorldStep = t, this.name = \"CannonJSPlugin\", this._physicsMaterials = new Array(), this._fixedTimeStep = 1 / 60, this._physicsBodysToRemoveAfterStep = new Array(), this._firstFrame = !0, this._minus90X = new u.b(-0.7071067811865475, 0, 0, 0.7071067811865475), this._plus90X = new u.b(0.7071067811865475, 0, 0, 0.7071067811865475), this._tmpPosition = u.e.Zero(), this._tmpDeltaPosition = u.e.Zero(), this._tmpUnityRotation = new u.b(), this.BJSCANNON = n, this.isSupported() ? (this._extendNamespace(), this.world = new this.BJSCANNON.World(), this.world.broadphase = new this.BJSCANNON.NaiveBroadphase(), this.world.solver.iterations = e, this._cannonRaycastResult = new this.BJSCANNON.RaycastResult(), this._raycastResult = new Fs()) : l.a.Error(\"CannonJS is not available. Please make sure you included the js file.\");\n          }\n          return r.prototype.setGravity = function(t) {\n            var e = t;\n            this.world.gravity.set(e.x, e.y, e.z);\n          }, r.prototype.setTimeStep = function(t) {\n            this._fixedTimeStep = t;\n          }, r.prototype.getTimeStep = function() {\n            return this._fixedTimeStep;\n          }, r.prototype.executeStep = function(t, e) {\n            if (this._firstFrame) {\n              this._firstFrame = !1;\n              for (var n = 0, i = e; n < i.length; n++) {\n                var o = i[n];\n                o.type != At.a.HeightmapImpostor && o.type !== At.a.PlaneImpostor && o.beforeStep();\n              }\n            }\n            this.world.step(this._useDeltaForWorldStep ? t : this._fixedTimeStep), this._removeMarkedPhysicsBodiesFromWorld();\n          }, r.prototype._removeMarkedPhysicsBodiesFromWorld = function() {\n            var t = this;\n            this._physicsBodysToRemoveAfterStep.length > 0 && (this._physicsBodysToRemoveAfterStep.forEach(function(e) {\n              t.world.remove(e);\n            }), this._physicsBodysToRemoveAfterStep = []);\n          }, r.prototype.applyImpulse = function(t, e, n) {\n            var i = new this.BJSCANNON.Vec3(n.x, n.y, n.z), o = new this.BJSCANNON.Vec3(e.x, e.y, e.z);\n            t.physicsBody.applyImpulse(o, i);\n          }, r.prototype.applyForce = function(t, e, n) {\n            var i = new this.BJSCANNON.Vec3(n.x, n.y, n.z), o = new this.BJSCANNON.Vec3(e.x, e.y, e.z);\n            t.physicsBody.applyForce(o, i);\n          }, r.prototype.generatePhysicsBody = function(t) {\n            if (this._removeMarkedPhysicsBodiesFromWorld(), t.parent)\n              t.physicsBody && (this.removePhysicsBody(t), t.forceUpdate());\n            else {\n              if (t.isBodyInitRequired()) {\n                var e = this._createShape(t), n = t.physicsBody;\n                n && this.removePhysicsBody(t);\n                var i = this._addMaterial(\"mat-\" + t.uniqueId, t.getParam(\"friction\"), t.getParam(\"restitution\")), o = { mass: t.getParam(\"mass\"), material: i }, a = t.getParam(\"nativeOptions\");\n                for (var s in a)\n                  a.hasOwnProperty(s) && (o[s] = a[s]);\n                t.physicsBody = new this.BJSCANNON.Body(o), t.physicsBody.addEventListener(\"collide\", t.onCollide), this.world.addEventListener(\"preStep\", t.beforeStep), this.world.addEventListener(\"postStep\", t.afterStep), t.physicsBody.addShape(e), this.world.add(t.physicsBody), n && [\"force\", \"torque\", \"velocity\", \"angularVelocity\"].forEach(function(d) {\n                  var p = n[d];\n                  t.physicsBody[d].set(p.x, p.y, p.z);\n                }), this._processChildMeshes(t);\n              }\n              this._updatePhysicsBodyTransformation(t);\n            }\n          }, r.prototype._processChildMeshes = function(t) {\n            var e = this, n = t.object.getChildMeshes ? t.object.getChildMeshes(!0) : [], i = t.object.rotationQuaternion;\n            if (n.length) {\n              var o = function(a) {\n                if (i && a.rotationQuaternion) {\n                  var s = a.getPhysicsImpostor();\n                  if (s && s.parent !== t) {\n                    var d = a.getAbsolutePosition().subtract(a.parent.getAbsolutePosition()), p = a.rotationQuaternion;\n                    s.physicsBody && (e.removePhysicsBody(s), s.physicsBody = null), s.parent = t, s.resetUpdateFlags(), t.physicsBody.addShape(e._createShape(s), new e.BJSCANNON.Vec3(d.x, d.y, d.z), new e.BJSCANNON.Quaternion(p.x, p.y, p.z, p.w)), t.physicsBody.mass += s.getParam(\"mass\");\n                  }\n                  i.multiplyInPlace(a.rotationQuaternion), a.getChildMeshes(!0).filter(function(y) {\n                    return !!y.physicsImpostor;\n                  }).forEach(o);\n                }\n              };\n              n.filter(function(a) {\n                return !!a.physicsImpostor;\n              }).forEach(o);\n            }\n          }, r.prototype.removePhysicsBody = function(t) {\n            t.physicsBody.removeEventListener(\"collide\", t.onCollide), this.world.removeEventListener(\"preStep\", t.beforeStep), this.world.removeEventListener(\"postStep\", t.afterStep), this._physicsBodysToRemoveAfterStep.indexOf(t.physicsBody) === -1 && this._physicsBodysToRemoveAfterStep.push(t.physicsBody);\n          }, r.prototype.generateJoint = function(t) {\n            var e = t.mainImpostor.physicsBody, n = t.connectedImpostor.physicsBody;\n            if (e && n) {\n              var i, o = t.joint.jointData, a = { pivotA: o.mainPivot ? new this.BJSCANNON.Vec3().set(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z) : null, pivotB: o.connectedPivot ? new this.BJSCANNON.Vec3().set(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z) : null, axisA: o.mainAxis ? new this.BJSCANNON.Vec3().set(o.mainAxis.x, o.mainAxis.y, o.mainAxis.z) : null, axisB: o.connectedAxis ? new this.BJSCANNON.Vec3().set(o.connectedAxis.x, o.connectedAxis.y, o.connectedAxis.z) : null, maxForce: o.nativeParams.maxForce, collideConnected: !!o.collision };\n              switch (t.joint.type) {\n                case Jt.e.HingeJoint:\n                case Jt.e.Hinge2Joint:\n                  i = new this.BJSCANNON.HingeConstraint(e, n, a);\n                  break;\n                case Jt.e.DistanceJoint:\n                  i = new this.BJSCANNON.DistanceConstraint(e, n, o.maxDistance || 2);\n                  break;\n                case Jt.e.SpringJoint:\n                  var s = o;\n                  i = new this.BJSCANNON.Spring(e, n, { restLength: s.length, stiffness: s.stiffness, damping: s.damping, localAnchorA: a.pivotA, localAnchorB: a.pivotB });\n                  break;\n                case Jt.e.LockJoint:\n                  i = new this.BJSCANNON.LockConstraint(e, n, a);\n                  break;\n                case Jt.e.PointToPointJoint:\n                case Jt.e.BallAndSocketJoint:\n                default:\n                  i = new this.BJSCANNON.PointToPointConstraint(e, a.pivotA, n, a.pivotB, a.maxForce);\n              }\n              i.collideConnected = !!o.collision, t.joint.physicsJoint = i, t.joint.type !== Jt.e.SpringJoint ? this.world.addConstraint(i) : (t.joint.jointData.forceApplicationCallback = t.joint.jointData.forceApplicationCallback || function() {\n                i.applyForce();\n              }, t.mainImpostor.registerAfterPhysicsStep(t.joint.jointData.forceApplicationCallback));\n            }\n          }, r.prototype.removeJoint = function(t) {\n            t.joint.type !== Jt.e.SpringJoint ? this.world.removeConstraint(t.joint.physicsJoint) : t.mainImpostor.unregisterAfterPhysicsStep(t.joint.jointData.forceApplicationCallback);\n          }, r.prototype._addMaterial = function(t, e, n) {\n            var i, o;\n            for (i = 0; i < this._physicsMaterials.length; i++)\n              if ((o = this._physicsMaterials[i]).friction === e && o.restitution === n)\n                return o;\n            var a = new this.BJSCANNON.Material(t);\n            return a.friction = e, a.restitution = n, this._physicsMaterials.push(a), a;\n          }, r.prototype._checkWithEpsilon = function(t) {\n            return t < Sr.Epsilon ? Sr.Epsilon : t;\n          }, r.prototype._createShape = function(t) {\n            var e, n = t.object, i = t.getObjectExtendSize();\n            switch (t.type) {\n              case At.a.SphereImpostor:\n                var o = i.x, a = i.y, s = i.z;\n                e = new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(o), this._checkWithEpsilon(a), this._checkWithEpsilon(s)) / 2);\n                break;\n              case At.a.CylinderImpostor:\n                var d = t.getParam(\"nativeOptions\");\n                d || (d = {});\n                var p = d.radiusTop !== void 0 ? d.radiusTop : this._checkWithEpsilon(i.x) / 2, y = d.radiusBottom !== void 0 ? d.radiusBottom : this._checkWithEpsilon(i.x) / 2, P = d.height !== void 0 ? d.height : this._checkWithEpsilon(i.y), R = d.numSegments !== void 0 ? d.numSegments : 16;\n                e = new this.BJSCANNON.Cylinder(p, y, P, R);\n                var B = new this.BJSCANNON.Quaternion();\n                B.setFromAxisAngle(new this.BJSCANNON.Vec3(1, 0, 0), -Math.PI / 2);\n                var F = new this.BJSCANNON.Vec3(0, 0, 0);\n                e.transformAllPoints(F, B);\n                break;\n              case At.a.BoxImpostor:\n                var z = i.scale(0.5);\n                e = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(z.x), this._checkWithEpsilon(z.y), this._checkWithEpsilon(z.z)));\n                break;\n              case At.a.PlaneImpostor:\n                l.a.Warn(\"Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead\"), e = new this.BJSCANNON.Plane();\n                break;\n              case At.a.MeshImpostor:\n                var J = n.getVerticesData ? n.getVerticesData(Oe.b.PositionKind) : [], ie = n.getIndices ? n.getIndices() : [];\n                if (!J)\n                  return;\n                var se = n.position.clone(), ce = n.rotation && n.rotation.clone(), ue = n.rotationQuaternion && n.rotationQuaternion.clone();\n                n.position.copyFromFloats(0, 0, 0), n.rotation && n.rotation.copyFromFloats(0, 0, 0), n.rotationQuaternion && n.rotationQuaternion.copyFrom(t.getParentsRotation()), n.rotationQuaternion && n.parent && n.rotationQuaternion.conjugateInPlace();\n                var fe, ve = n.computeWorldMatrix(!0), Te = new Array();\n                for (fe = 0; fe < J.length; fe += 3)\n                  u.e.TransformCoordinates(u.e.FromArray(J, fe), ve).toArray(Te, fe);\n                l.a.Warn(\"MeshImpostor only collides against spheres.\"), e = new this.BJSCANNON.Trimesh(Te, ie), n.position.copyFrom(se), ce && n.rotation && n.rotation.copyFrom(ce), ue && n.rotationQuaternion && n.rotationQuaternion.copyFrom(ue);\n                break;\n              case At.a.HeightmapImpostor:\n                var Re = n.position.clone(), Ae = n.rotation && n.rotation.clone(), Ee = n.rotationQuaternion && n.rotationQuaternion.clone();\n                n.position.copyFromFloats(0, 0, 0), n.rotation && n.rotation.copyFromFloats(0, 0, 0), n.rotationQuaternion && n.rotationQuaternion.copyFrom(t.getParentsRotation()), n.rotationQuaternion && n.parent && n.rotationQuaternion.conjugateInPlace(), n.rotationQuaternion && n.rotationQuaternion.multiplyInPlace(this._minus90X), e = this._createHeightmap(n), n.position.copyFrom(Re), Ae && n.rotation && n.rotation.copyFrom(Ae), Ee && n.rotationQuaternion && n.rotationQuaternion.copyFrom(Ee), n.computeWorldMatrix(!0);\n                break;\n              case At.a.ParticleImpostor:\n                e = new this.BJSCANNON.Particle();\n                break;\n              case At.a.NoImpostor:\n                e = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0, 0, 0));\n            }\n            return e;\n          }, r.prototype._createHeightmap = function(t, e) {\n            var n, i = t.getVerticesData(Oe.b.PositionKind), o = t.computeWorldMatrix(!0), a = new Array();\n            for (n = 0; n < i.length; n += 3)\n              u.e.TransformCoordinates(u.e.FromArray(i, n), o).toArray(a, n);\n            i = a;\n            for (var s = new Array(), d = e || ~~(Math.sqrt(i.length / 3) - 1), p = t.getBoundingInfo(), y = Math.min(p.boundingBox.extendSizeWorld.x, p.boundingBox.extendSizeWorld.y), P = p.boundingBox.extendSizeWorld.z, R = 2 * y / d, B = 0; B < i.length; B += 3) {\n              var F = Math.round(i[B + 0] / R + d / 2), z = Math.round(-1 * (i[B + 1] / R - d / 2)), J = -i[B + 2] + P;\n              s[F] || (s[F] = []), s[F][z] || (s[F][z] = J), s[F][z] = Math.max(J, s[F][z]);\n            }\n            for (F = 0; F <= d; ++F) {\n              if (!s[F]) {\n                for (var ie = 1; !s[(F + ie) % d]; )\n                  ie++;\n                s[F] = s[(F + ie) % d].slice();\n              }\n              for (z = 0; z <= d; ++z)\n                if (!s[F][z]) {\n                  var se;\n                  for (ie = 1; se === void 0; )\n                    se = s[F][(z + ie++) % d];\n                  s[F][z] = se;\n                }\n            }\n            var ce = new this.BJSCANNON.Heightfield(s, { elementSize: R });\n            return ce.minY = P, ce;\n          }, r.prototype._updatePhysicsBodyTransformation = function(t) {\n            var e = t.object;\n            if (e.computeWorldMatrix && e.computeWorldMatrix(!0), e.getBoundingInfo()) {\n              var n = t.getObjectCenter();\n              this._tmpDeltaPosition.copyFrom(e.getAbsolutePivotPoint().subtract(n)), this._tmpDeltaPosition.divideInPlace(t.object.scaling), this._tmpPosition.copyFrom(n);\n              var i = e.rotationQuaternion;\n              if (i) {\n                if (t.type !== At.a.PlaneImpostor && t.type !== At.a.HeightmapImpostor || (i = i.multiply(this._minus90X), t.setDeltaRotation(this._plus90X)), t.type === At.a.HeightmapImpostor) {\n                  var o = e, a = o.getBoundingInfo(), s = o.rotationQuaternion;\n                  o.rotationQuaternion = this._tmpUnityRotation, o.computeWorldMatrix(!0);\n                  var d = n.clone(), p = o.getPivotMatrix();\n                  p = p ? p.clone() : u.a.Identity();\n                  var y = u.a.Translation(a.boundingBox.extendSizeWorld.x, 0, -a.boundingBox.extendSizeWorld.z);\n                  o.setPreTransformMatrix(y), o.computeWorldMatrix(!0);\n                  var P = a.boundingBox.centerWorld.subtract(n).subtract(o.position).negate();\n                  this._tmpPosition.copyFromFloats(P.x, P.y - a.boundingBox.extendSizeWorld.y, P.z), this._tmpDeltaPosition.copyFrom(a.boundingBox.centerWorld.subtract(d)), this._tmpDeltaPosition.y += a.boundingBox.extendSizeWorld.y, o.rotationQuaternion = s, o.setPreTransformMatrix(p), o.computeWorldMatrix(!0);\n                } else\n                  t.type === At.a.MeshImpostor && this._tmpDeltaPosition.copyFromFloats(0, 0, 0);\n                t.setDeltaPosition(this._tmpDeltaPosition), t.physicsBody.position.set(this._tmpPosition.x, this._tmpPosition.y, this._tmpPosition.z), t.physicsBody.quaternion.set(i.x, i.y, i.z, i.w);\n              }\n            }\n          }, r.prototype.setTransformationFromPhysicsBody = function(t) {\n            if (t.object.position.set(t.physicsBody.position.x, t.physicsBody.position.y, t.physicsBody.position.z), t.object.rotationQuaternion) {\n              var e = t.physicsBody.quaternion;\n              t.object.rotationQuaternion.set(e.x, e.y, e.z, e.w);\n            }\n          }, r.prototype.setPhysicsBodyTransformation = function(t, e, n) {\n            t.physicsBody.position.set(e.x, e.y, e.z), t.physicsBody.quaternion.set(n.x, n.y, n.z, n.w);\n          }, r.prototype.isSupported = function() {\n            return this.BJSCANNON !== void 0;\n          }, r.prototype.setLinearVelocity = function(t, e) {\n            t.physicsBody.velocity.set(e.x, e.y, e.z);\n          }, r.prototype.setAngularVelocity = function(t, e) {\n            t.physicsBody.angularVelocity.set(e.x, e.y, e.z);\n          }, r.prototype.getLinearVelocity = function(t) {\n            var e = t.physicsBody.velocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.getAngularVelocity = function(t) {\n            var e = t.physicsBody.angularVelocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.setBodyMass = function(t, e) {\n            t.physicsBody.mass = e, t.physicsBody.updateMassProperties();\n          }, r.prototype.getBodyMass = function(t) {\n            return t.physicsBody.mass;\n          }, r.prototype.getBodyFriction = function(t) {\n            return t.physicsBody.material.friction;\n          }, r.prototype.setBodyFriction = function(t, e) {\n            t.physicsBody.material.friction = e;\n          }, r.prototype.getBodyRestitution = function(t) {\n            return t.physicsBody.material.restitution;\n          }, r.prototype.setBodyRestitution = function(t, e) {\n            t.physicsBody.material.restitution = e;\n          }, r.prototype.sleepBody = function(t) {\n            t.physicsBody.sleep();\n          }, r.prototype.wakeUpBody = function(t) {\n            t.physicsBody.wakeUp();\n          }, r.prototype.updateDistanceJoint = function(t, e) {\n            t.physicsJoint.distance = e;\n          }, r.prototype.setMotor = function(t, e, n, i) {\n            i || (t.physicsJoint.enableMotor(), t.physicsJoint.setMotorSpeed(e), n && this.setLimit(t, n));\n          }, r.prototype.setLimit = function(t, e, n) {\n            t.physicsJoint.motorEquation.maxForce = e, t.physicsJoint.motorEquation.minForce = n === void 0 ? -e : n;\n          }, r.prototype.syncMeshWithImpostor = function(t, e) {\n            var n = e.physicsBody;\n            t.position.x = n.position.x, t.position.y = n.position.y, t.position.z = n.position.z, t.rotationQuaternion && (t.rotationQuaternion.x = n.quaternion.x, t.rotationQuaternion.y = n.quaternion.y, t.rotationQuaternion.z = n.quaternion.z, t.rotationQuaternion.w = n.quaternion.w);\n          }, r.prototype.getRadius = function(t) {\n            return t.physicsBody.shapes[0].boundingSphereRadius;\n          }, r.prototype.getBoxSizeToRef = function(t, e) {\n            var n = t.physicsBody.shapes[0];\n            e.x = 2 * n.halfExtents.x, e.y = 2 * n.halfExtents.y, e.z = 2 * n.halfExtents.z;\n          }, r.prototype.dispose = function() {\n          }, r.prototype._extendNamespace = function() {\n            var t = new this.BJSCANNON.Vec3(), e = this.BJSCANNON;\n            this.BJSCANNON.World.prototype.step = function(n, i, o) {\n              if (o = o || 10, (i = i || 0) === 0)\n                this.internalStep(n), this.time += n;\n              else {\n                var a = Math.floor((this.time + i) / n) - Math.floor(this.time / n);\n                a = Math.min(a, o) || 1;\n                for (var s = performance.now(), d = 0; d !== a && (this.internalStep(n), !(performance.now() - s > 1e3 * n)); d++)\n                  ;\n                this.time += i;\n                for (var p = this.time % n / n, y = t, P = this.bodies, R = 0; R !== P.length; R++) {\n                  var B = P[R];\n                  B.type !== e.Body.STATIC && B.sleepState !== e.Body.SLEEPING ? (B.position.vsub(B.previousPosition, y), y.scale(p, y), B.position.vadd(y, B.interpolatedPosition)) : (B.interpolatedPosition.set(B.position.x, B.position.y, B.position.z), B.interpolatedQuaternion.set(B.quaternion.x, B.quaternion.y, B.quaternion.z, B.quaternion.w));\n                }\n              }\n            };\n          }, r.prototype.raycast = function(t, e) {\n            return this._cannonRaycastResult.reset(), this.world.raycastClosest(t, e, {}, this._cannonRaycastResult), this._raycastResult.reset(t, e), this._cannonRaycastResult.hasHit && (this._raycastResult.setHitData({ x: this._cannonRaycastResult.hitNormalWorld.x, y: this._cannonRaycastResult.hitNormalWorld.y, z: this._cannonRaycastResult.hitNormalWorld.z }, { x: this._cannonRaycastResult.hitPointWorld.x, y: this._cannonRaycastResult.hitPointWorld.y, z: this._cannonRaycastResult.hitPointWorld.z }), this._raycastResult.setHitDistance(this._cannonRaycastResult.distance)), this._raycastResult;\n          }, r;\n        }();\n        Sr.DefaultPluginFactory = function() {\n          return new Bs();\n        };\n        var Mu = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = !0), n === void 0 && (n = OIMO), this._useDeltaForWorldStep = t, this.name = \"OimoJSPlugin\", this._fixedTimeStep = 1 / 60, this._tmpImpostorsArray = [], this._tmpPositionVector = u.e.Zero(), this.BJSOIMO = n, this.world = new this.BJSOIMO.World({ iterations: e }), this.world.clear(), this._raycastResult = new Fs();\n          }\n          return r.prototype.setGravity = function(t) {\n            this.world.gravity.set(t.x, t.y, t.z);\n          }, r.prototype.setTimeStep = function(t) {\n            this.world.timeStep = t;\n          }, r.prototype.getTimeStep = function() {\n            return this.world.timeStep;\n          }, r.prototype.executeStep = function(t, e) {\n            var n = this;\n            e.forEach(function(s) {\n              s.beforeStep();\n            }), this.world.timeStep = this._useDeltaForWorldStep ? t : this._fixedTimeStep, this.world.step(), e.forEach(function(s) {\n              s.afterStep(), n._tmpImpostorsArray[s.uniqueId] = s;\n            });\n            for (var i = this.world.contacts; i !== null; )\n              if (!i.touching || i.body1.sleeping || i.body2.sleeping) {\n                var o = this._tmpImpostorsArray[+i.body1.name], a = this._tmpImpostorsArray[+i.body2.name];\n                o && a && (o.onCollide({ body: a.physicsBody, point: null }), a.onCollide({ body: o.physicsBody, point: null })), i = i.next;\n              } else\n                i = i.next;\n          }, r.prototype.applyImpulse = function(t, e, n) {\n            var i = t.physicsBody.mass;\n            t.physicsBody.applyImpulse(n.scale(this.world.invScale), e.scale(this.world.invScale * i));\n          }, r.prototype.applyForce = function(t, e, n) {\n            l.a.Warn(\"Oimo doesn't support applying force. Using impule instead.\"), this.applyImpulse(t, e, n);\n          }, r.prototype.generatePhysicsBody = function(t) {\n            var e = this;\n            if (t.parent)\n              t.physicsBody && (this.removePhysicsBody(t), t.forceUpdate());\n            else {\n              if (t.isBodyInitRequired()) {\n                var n = { name: t.uniqueId, config: [t.getParam(\"mass\") || 1e-3, t.getParam(\"friction\"), t.getParam(\"restitution\")], size: [], type: [], pos: [], posShape: [], rot: [], rotShape: [], move: t.getParam(\"mass\") !== 0, density: t.getParam(\"mass\"), friction: t.getParam(\"friction\"), restitution: t.getParam(\"restitution\"), world: this.world }, i = [t];\n                (s = t.object).getChildMeshes && s.getChildMeshes().forEach(function(d) {\n                  d.physicsImpostor && i.push(d.physicsImpostor);\n                });\n                var o = function(d) {\n                  return Math.max(d, Sr.Epsilon);\n                }, a = new u.b();\n                i.forEach(function(d) {\n                  if (d.object.rotationQuaternion) {\n                    var p = d.object.rotationQuaternion;\n                    a.copyFrom(p), d.object.rotationQuaternion.set(0, 0, 0, 1), d.object.computeWorldMatrix(!0);\n                    var y = a.toEulerAngles(), P = d.getObjectExtendSize();\n                    if (d === t) {\n                      var R = t.getObjectCenter();\n                      t.object.getAbsolutePivotPoint().subtractToRef(R, e._tmpPositionVector), e._tmpPositionVector.divideInPlace(t.object.scaling), n.pos.push(R.x), n.pos.push(R.y), n.pos.push(R.z), n.posShape.push(0, 0, 0), n.rotShape.push(0, 0, 0);\n                    } else {\n                      var B = d.object.position.clone();\n                      n.posShape.push(B.x), n.posShape.push(B.y), n.posShape.push(B.z), n.rotShape.push(57.29577951308232 * y.x, 57.29577951308232 * y.y, 57.29577951308232 * y.z);\n                    }\n                    switch (d.object.rotationQuaternion.copyFrom(a), d.type) {\n                      case At.a.ParticleImpostor:\n                        l.a.Warn(\"No Particle support in OIMO.js. using SphereImpostor instead\");\n                      case At.a.SphereImpostor:\n                        var F = P.x, z = P.y, J = P.z, ie = Math.max(o(F), o(z), o(J)) / 2;\n                        n.type.push(\"sphere\"), n.size.push(ie), n.size.push(ie), n.size.push(ie);\n                        break;\n                      case At.a.CylinderImpostor:\n                        var se = o(P.x) / 2, ce = o(P.y);\n                        n.type.push(\"cylinder\"), n.size.push(se), n.size.push(ce), n.size.push(ce);\n                        break;\n                      case At.a.PlaneImpostor:\n                      case At.a.BoxImpostor:\n                      default:\n                        se = o(P.x), ce = o(P.y);\n                        var ue = o(P.z);\n                        n.type.push(\"box\"), n.size.push(se), n.size.push(ce), n.size.push(ue);\n                    }\n                    d.object.rotationQuaternion = p;\n                  }\n                }), t.physicsBody = this.world.add(n), t.physicsBody.resetQuaternion(a), t.physicsBody.updatePosition(0);\n              } else\n                this._tmpPositionVector.copyFromFloats(0, 0, 0);\n              var s;\n              t.setDeltaPosition(this._tmpPositionVector);\n            }\n          }, r.prototype.removePhysicsBody = function(t) {\n            this.world.removeRigidBody(t.physicsBody);\n          }, r.prototype.generateJoint = function(t) {\n            var e = t.mainImpostor.physicsBody, n = t.connectedImpostor.physicsBody;\n            if (e && n) {\n              var i, o = t.joint.jointData, a = o.nativeParams || {}, s = { body1: e, body2: n, axe1: a.axe1 || (o.mainAxis ? o.mainAxis.asArray() : null), axe2: a.axe2 || (o.connectedAxis ? o.connectedAxis.asArray() : null), pos1: a.pos1 || (o.mainPivot ? o.mainPivot.asArray() : null), pos2: a.pos2 || (o.connectedPivot ? o.connectedPivot.asArray() : null), min: a.min, max: a.max, collision: a.collision || o.collision, spring: a.spring, world: this.world };\n              switch (t.joint.type) {\n                case Jt.e.BallAndSocketJoint:\n                  i = \"jointBall\";\n                  break;\n                case Jt.e.SpringJoint:\n                  l.a.Warn(\"OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead\");\n                  var d = o;\n                  s.min = d.length || s.min, s.max = Math.max(s.min, s.max);\n                case Jt.e.DistanceJoint:\n                  i = \"jointDistance\", s.max = o.maxDistance;\n                  break;\n                case Jt.e.PrismaticJoint:\n                  i = \"jointPrisme\";\n                  break;\n                case Jt.e.SliderJoint:\n                  i = \"jointSlide\";\n                  break;\n                case Jt.e.WheelJoint:\n                  i = \"jointWheel\";\n                  break;\n                case Jt.e.HingeJoint:\n                default:\n                  i = \"jointHinge\";\n              }\n              s.type = i, t.joint.physicsJoint = this.world.add(s);\n            }\n          }, r.prototype.removeJoint = function(t) {\n            try {\n              this.world.removeJoint(t.joint.physicsJoint);\n            } catch (e) {\n              l.a.Warn(e);\n            }\n          }, r.prototype.isSupported = function() {\n            return this.BJSOIMO !== void 0;\n          }, r.prototype.setTransformationFromPhysicsBody = function(t) {\n            if (!t.physicsBody.sleeping) {\n              if (t.physicsBody.shapes.next) {\n                for (var e = t.physicsBody.shapes; e.next; )\n                  e = e.next;\n                t.object.position.set(e.position.x, e.position.y, e.position.z);\n              } else {\n                var n = t.physicsBody.getPosition();\n                t.object.position.set(n.x, n.y, n.z);\n              }\n              if (t.object.rotationQuaternion) {\n                var i = t.physicsBody.getQuaternion();\n                t.object.rotationQuaternion.set(i.x, i.y, i.z, i.w);\n              }\n            }\n          }, r.prototype.setPhysicsBodyTransformation = function(t, e, n) {\n            var i = t.physicsBody;\n            t.physicsBody.shapes.next || (i.position.set(e.x, e.y, e.z), i.orientation.set(n.x, n.y, n.z, n.w), i.syncShapes(), i.awake());\n          }, r.prototype.setLinearVelocity = function(t, e) {\n            t.physicsBody.linearVelocity.set(e.x, e.y, e.z);\n          }, r.prototype.setAngularVelocity = function(t, e) {\n            t.physicsBody.angularVelocity.set(e.x, e.y, e.z);\n          }, r.prototype.getLinearVelocity = function(t) {\n            var e = t.physicsBody.linearVelocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.getAngularVelocity = function(t) {\n            var e = t.physicsBody.angularVelocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.setBodyMass = function(t, e) {\n            var n = e === 0;\n            t.physicsBody.shapes.density = n ? 1 : e, t.physicsBody.setupMass(n ? 2 : 1);\n          }, r.prototype.getBodyMass = function(t) {\n            return t.physicsBody.shapes.density;\n          }, r.prototype.getBodyFriction = function(t) {\n            return t.physicsBody.shapes.friction;\n          }, r.prototype.setBodyFriction = function(t, e) {\n            t.physicsBody.shapes.friction = e;\n          }, r.prototype.getBodyRestitution = function(t) {\n            return t.physicsBody.shapes.restitution;\n          }, r.prototype.setBodyRestitution = function(t, e) {\n            t.physicsBody.shapes.restitution = e;\n          }, r.prototype.sleepBody = function(t) {\n            t.physicsBody.sleep();\n          }, r.prototype.wakeUpBody = function(t) {\n            t.physicsBody.awake();\n          }, r.prototype.updateDistanceJoint = function(t, e, n) {\n            t.physicsJoint.limitMotor.upperLimit = e, n !== void 0 && (t.physicsJoint.limitMotor.lowerLimit = n);\n          }, r.prototype.setMotor = function(t, e, n, i) {\n            n !== void 0 ? l.a.Warn(\"OimoJS plugin currently has unexpected behavior when using setMotor with force parameter\") : n = 1e6, e *= -1;\n            var o = i ? t.physicsJoint.rotationalLimitMotor2 : t.physicsJoint.rotationalLimitMotor1 || t.physicsJoint.rotationalLimitMotor || t.physicsJoint.limitMotor;\n            o && o.setMotor(e, n);\n          }, r.prototype.setLimit = function(t, e, n, i) {\n            var o = i ? t.physicsJoint.rotationalLimitMotor2 : t.physicsJoint.rotationalLimitMotor1 || t.physicsJoint.rotationalLimitMotor || t.physicsJoint.limitMotor;\n            o && o.setLimit(e, n === void 0 ? -e : n);\n          }, r.prototype.syncMeshWithImpostor = function(t, e) {\n            var n = e.physicsBody;\n            t.position.x = n.position.x, t.position.y = n.position.y, t.position.z = n.position.z, t.rotationQuaternion && (t.rotationQuaternion.x = n.orientation.x, t.rotationQuaternion.y = n.orientation.y, t.rotationQuaternion.z = n.orientation.z, t.rotationQuaternion.w = n.orientation.s);\n          }, r.prototype.getRadius = function(t) {\n            return t.physicsBody.shapes.radius;\n          }, r.prototype.getBoxSizeToRef = function(t, e) {\n            var n = t.physicsBody.shapes;\n            e.x = 2 * n.halfWidth, e.y = 2 * n.halfHeight, e.z = 2 * n.halfDepth;\n          }, r.prototype.dispose = function() {\n            this.world.clear();\n          }, r.prototype.raycast = function(t, e) {\n            return l.a.Warn(\"raycast is not currently supported by the Oimo physics plugin\"), this._raycastResult.reset(t, e), this._raycastResult;\n          }, r;\n        }(), Jo = f(97), Iu = function() {\n          function r(t, e, n) {\n            var i = this;\n            t === void 0 && (t = !0), e === void 0 && (e = Ammo), n === void 0 && (n = null), this._useDeltaForWorldStep = t, this.bjsAMMO = {}, this.name = \"AmmoJSPlugin\", this._timeStep = 1 / 60, this._fixedTimeStep = 1 / 60, this._maxSteps = 5, this._tmpQuaternion = new u.b(), this._tmpContactCallbackResult = !1, this._tmpContactPoint = new u.e(), this._tmpMatrix = new u.a(), typeof e == \"function\" ? e(this.bjsAMMO) : this.bjsAMMO = e, this.isSupported() ? (this._collisionConfiguration = new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration(), this._dispatcher = new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration), this._overlappingPairCache = n || new this.bjsAMMO.btDbvtBroadphase(), this._solver = new this.bjsAMMO.btSequentialImpulseConstraintSolver(), this._softBodySolver = new this.bjsAMMO.btDefaultSoftBodySolver(), this.world = new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher, this._overlappingPairCache, this._solver, this._collisionConfiguration, this._softBodySolver), this._tmpAmmoConcreteContactResultCallback = new this.bjsAMMO.ConcreteContactResultCallback(), this._tmpAmmoConcreteContactResultCallback.addSingleResult = function(o, a, s, d) {\n              var p = (o = i.bjsAMMO.wrapPointer(o, Ammo.btManifoldPoint)).getPositionWorldOnA();\n              i._tmpContactPoint.x = p.x(), i._tmpContactPoint.y = p.y(), i._tmpContactPoint.z = p.z(), i._tmpContactCallbackResult = !0;\n            }, this._raycastResult = new Fs(), this._tmpAmmoTransform = new this.bjsAMMO.btTransform(), this._tmpAmmoTransform.setIdentity(), this._tmpAmmoQuaternion = new this.bjsAMMO.btQuaternion(0, 0, 0, 1), this._tmpAmmoVectorA = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorB = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorC = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorD = new this.bjsAMMO.btVector3(0, 0, 0)) : l.a.Error(\"AmmoJS is not available. Please make sure you included the js file.\");\n          }\n          return r.prototype.setGravity = function(t) {\n            this._tmpAmmoVectorA.setValue(t.x, t.y, t.z), this.world.setGravity(this._tmpAmmoVectorA), this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA);\n          }, r.prototype.setTimeStep = function(t) {\n            this._timeStep = t;\n          }, r.prototype.setFixedTimeStep = function(t) {\n            this._fixedTimeStep = t;\n          }, r.prototype.setMaxSteps = function(t) {\n            this._maxSteps = t;\n          }, r.prototype.getTimeStep = function() {\n            return this._timeStep;\n          }, r.prototype._isImpostorInContact = function(t) {\n            return this._tmpContactCallbackResult = !1, this.world.contactTest(t.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;\n          }, r.prototype._isImpostorPairInContact = function(t, e) {\n            return this._tmpContactCallbackResult = !1, this.world.contactPairTest(t.physicsBody, e.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;\n          }, r.prototype._stepSimulation = function(t, e, n) {\n            if (t === void 0 && (t = 1 / 60), e === void 0 && (e = 10), n === void 0 && (n = 1 / 60), e == 0)\n              this.world.stepSimulation(t, 0);\n            else\n              for (; e > 0 && t > 0; )\n                t - n < n ? (this.world.stepSimulation(t, 0), t = 0) : (t -= n, this.world.stepSimulation(n, 0)), e--;\n          }, r.prototype.executeStep = function(t, e) {\n            for (var n = 0, i = e; n < i.length; n++) {\n              var o = i[n];\n              o.soft || o.beforeStep();\n            }\n            this._stepSimulation(this._useDeltaForWorldStep ? t : this._timeStep, this._maxSteps, this._fixedTimeStep);\n            for (var a = 0, s = e; a < s.length; a++) {\n              var d = s[a];\n              if (d.soft ? this._afterSoftStep(d) : d.afterStep(), d._onPhysicsCollideCallbacks.length > 0 && this._isImpostorInContact(d))\n                for (var p = 0, y = d._onPhysicsCollideCallbacks; p < y.length; p++)\n                  for (var P = 0, R = y[p].otherImpostors; P < R.length; P++) {\n                    var B = R[P];\n                    (d.physicsBody.isActive() || B.physicsBody.isActive()) && this._isImpostorPairInContact(d, B) && (d.onCollide({ body: B.physicsBody, point: this._tmpContactPoint }), B.onCollide({ body: d.physicsBody, point: this._tmpContactPoint }));\n                  }\n            }\n          }, r.prototype._afterSoftStep = function(t) {\n            t.type === At.a.RopeImpostor ? this._ropeStep(t) : this._softbodyOrClothStep(t);\n          }, r.prototype._ropeStep = function(t) {\n            for (var e, n, i, o, a = t.physicsBody.get_m_nodes(), s = a.size(), d = new Array(), p = 0; p < s; p++)\n              n = (e = a.at(p).get_m_x()).x(), i = e.y(), o = e.z(), d.push(new u.e(n, i, o));\n            var y = t.object, P = t.getParam(\"shape\");\n            t._isFromLine ? t.object = sn.a.CreateLines(\"lines\", { points: d, instance: y }) : t.object = Jo.a.ExtrudeShape(\"ext\", { shape: P, path: d, instance: y });\n          }, r.prototype._softbodyOrClothStep = function(t) {\n            var e = t.type === At.a.ClothImpostor ? 1 : -1, n = t.object, i = n.getVerticesData(Oe.b.PositionKind);\n            i || (i = []);\n            var o = n.getVerticesData(Oe.b.NormalKind);\n            o || (o = []);\n            for (var a, s, d, p, y, P, R, B, F = i.length / 3, z = t.physicsBody.get_m_nodes(), J = 0; J < F; J++) {\n              var ie;\n              d = (s = (a = z.at(J)).get_m_x()).x(), p = s.y(), y = s.z() * e, P = (ie = a.get_m_n()).x(), R = ie.y(), B = ie.z() * e, i[3 * J] = d, i[3 * J + 1] = p, i[3 * J + 2] = y, o[3 * J] = P, o[3 * J + 1] = R, o[3 * J + 2] = B;\n            }\n            var se = new ht.a();\n            se.positions = i, se.normals = o, se.uvs = n.getVerticesData(Oe.b.UVKind), se.colors = n.getVerticesData(Oe.b.ColorKind), n && n.getIndices && (se.indices = n.getIndices()), se.applyToMesh(n);\n          }, r.prototype.applyImpulse = function(t, e, n) {\n            if (t.soft)\n              l.a.Warn(\"Cannot be applied to a soft body\");\n            else {\n              t.physicsBody.activate();\n              var i = this._tmpAmmoVectorA, o = this._tmpAmmoVectorB;\n              t.object && t.object.getWorldMatrix && n.subtractInPlace(t.object.getWorldMatrix().getTranslation()), i.setValue(n.x, n.y, n.z), o.setValue(e.x, e.y, e.z), t.physicsBody.applyImpulse(o, i);\n            }\n          }, r.prototype.applyForce = function(t, e, n) {\n            if (t.soft)\n              l.a.Warn(\"Cannot be applied to a soft body\");\n            else {\n              t.physicsBody.activate();\n              var i = this._tmpAmmoVectorA, o = this._tmpAmmoVectorB;\n              t.object && t.object.getWorldMatrix && n.subtractInPlace(t.object.getWorldMatrix().getTranslation()), i.setValue(n.x, n.y, n.z), o.setValue(e.x, e.y, e.z), t.physicsBody.applyForce(o, i);\n            }\n          }, r.prototype.generatePhysicsBody = function(t) {\n            if (t._pluginData.toDispose = [], t.parent)\n              t.physicsBody && (this.removePhysicsBody(t), t.forceUpdate());\n            else if (t.isBodyInitRequired()) {\n              var e = this._createShape(t), n = t.getParam(\"mass\");\n              if (t._pluginData.mass = n, t.soft)\n                e.get_m_cfg().set_collisions(17), e.get_m_cfg().set_kDP(t.getParam(\"damping\")), this.bjsAMMO.castObject(e, this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(t.getParam(\"margin\")), e.setActivationState(r.DISABLE_DEACTIVATION_FLAG), this.world.addSoftBody(e, 1, -1), t.physicsBody = e, t._pluginData.toDispose.push(e), this.setBodyPressure(t, 0), t.type === At.a.SoftbodyImpostor && this.setBodyPressure(t, t.getParam(\"pressure\")), this.setBodyStiffness(t, t.getParam(\"stiffness\")), this.setBodyVelocityIterations(t, t.getParam(\"velocityIterations\")), this.setBodyPositionIterations(t, t.getParam(\"positionIterations\"));\n              else {\n                var i = new this.bjsAMMO.btVector3(0, 0, 0), o = new this.bjsAMMO.btTransform();\n                o.setIdentity(), n !== 0 && e.calculateLocalInertia(n, i), this._tmpAmmoVectorA.setValue(t.object.position.x, t.object.position.y, t.object.position.z), this._tmpAmmoQuaternion.setValue(t.object.rotationQuaternion.x, t.object.rotationQuaternion.y, t.object.rotationQuaternion.z, t.object.rotationQuaternion.w), o.setOrigin(this._tmpAmmoVectorA), o.setRotation(this._tmpAmmoQuaternion);\n                var a = new this.bjsAMMO.btDefaultMotionState(o), s = new this.bjsAMMO.btRigidBodyConstructionInfo(n, a, e, i), d = new this.bjsAMMO.btRigidBody(s);\n                n === 0 && (d.setCollisionFlags(d.getCollisionFlags() | r.KINEMATIC_FLAG), d.setActivationState(r.DISABLE_DEACTIVATION_FLAG)), t.type != At.a.NoImpostor || e.getChildShape || d.setCollisionFlags(d.getCollisionFlags() | r.DISABLE_COLLISION_FLAG);\n                var p = t.getParam(\"group\"), y = t.getParam(\"mask\");\n                p && y ? this.world.addRigidBody(d, p, y) : this.world.addRigidBody(d), t.physicsBody = d, t._pluginData.toDispose = t._pluginData.toDispose.concat([d, s, a, o, i, e]);\n              }\n              this.setBodyRestitution(t, t.getParam(\"restitution\")), this.setBodyFriction(t, t.getParam(\"friction\"));\n            }\n          }, r.prototype.removePhysicsBody = function(t) {\n            var e = this;\n            this.world && (t.soft ? this.world.removeSoftBody(t.physicsBody) : this.world.removeRigidBody(t.physicsBody), t._pluginData && (t._pluginData.toDispose.forEach(function(n) {\n              e.bjsAMMO.destroy(n);\n            }), t._pluginData.toDispose = []));\n          }, r.prototype.generateJoint = function(t) {\n            var e = t.mainImpostor.physicsBody, n = t.connectedImpostor.physicsBody;\n            if (e && n) {\n              var i, o = t.joint.jointData;\n              switch (o.mainPivot || (o.mainPivot = new u.e(0, 0, 0)), o.connectedPivot || (o.connectedPivot = new u.e(0, 0, 0)), t.joint.type) {\n                case Jt.e.DistanceJoint:\n                  var a = o.maxDistance;\n                  a && (o.mainPivot = new u.e(0, -a / 2, 0), o.connectedPivot = new u.e(0, a / 2, 0)), i = new this.bjsAMMO.btPoint2PointConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z));\n                  break;\n                case Jt.e.HingeJoint:\n                  o.mainAxis || (o.mainAxis = new u.e(0, 0, 0)), o.connectedAxis || (o.connectedAxis = new u.e(0, 0, 0));\n                  var s = new this.bjsAMMO.btVector3(o.mainAxis.x, o.mainAxis.y, o.mainAxis.z), d = new this.bjsAMMO.btVector3(o.connectedAxis.x, o.connectedAxis.y, o.connectedAxis.z);\n                  i = new this.bjsAMMO.btHingeConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z), s, d);\n                  break;\n                case Jt.e.BallAndSocketJoint:\n                  i = new this.bjsAMMO.btPoint2PointConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z));\n                  break;\n                default:\n                  l.a.Warn(\"JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint\"), i = new this.bjsAMMO.btPoint2PointConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z));\n              }\n              this.world.addConstraint(i, !t.joint.jointData.collision), t.joint.physicsJoint = i;\n            }\n          }, r.prototype.removeJoint = function(t) {\n            this.world && this.world.removeConstraint(t.joint.physicsJoint);\n          }, r.prototype._addMeshVerts = function(t, e, n) {\n            var i = this, o = 0;\n            if (n && n.getIndices && n.getWorldMatrix && n.getChildMeshes) {\n              var a = n.getIndices();\n              a || (a = []);\n              var s = n.getVerticesData(Oe.b.PositionKind);\n              s || (s = []), n.computeWorldMatrix(!1);\n              for (var d = a.length / 3, p = 0; p < d; p++) {\n                for (var y = [], P = 0; P < 3; P++) {\n                  var R, B = new u.e(s[3 * a[3 * p + P] + 0], s[3 * a[3 * p + P] + 1], s[3 * a[3 * p + P] + 2]);\n                  u.a.ScalingToRef(n.scaling.x, n.scaling.y, n.scaling.z, this._tmpMatrix), B = u.e.TransformCoordinates(B, this._tmpMatrix), (R = P == 0 ? this._tmpAmmoVectorA : P == 1 ? this._tmpAmmoVectorB : this._tmpAmmoVectorC).setValue(B.x, B.y, B.z), y.push(R);\n                }\n                t.addTriangle(y[0], y[1], y[2]), o++;\n              }\n              n.getChildMeshes().forEach(function(F) {\n                o += i._addMeshVerts(t, e, F);\n              });\n            }\n            return o;\n          }, r.prototype._softVertexData = function(t) {\n            var e = t.object;\n            if (e && e.getIndices && e.getWorldMatrix && e.getChildMeshes) {\n              e.getIndices();\n              var n = e.getVerticesData(Oe.b.PositionKind);\n              n || (n = []);\n              var i = e.getVerticesData(Oe.b.NormalKind);\n              i || (i = []), e.computeWorldMatrix(!1);\n              for (var o = [], a = [], s = 0; s < n.length; s += 3) {\n                var d = new u.e(n[s], n[s + 1], n[s + 2]), p = new u.e(i[s], i[s + 1], i[s + 2]);\n                d = u.e.TransformCoordinates(d, e.getWorldMatrix()), p = u.e.TransformNormal(p, e.getWorldMatrix()), o.push(d.x, d.y, d.z), a.push(p.x, p.y, p.z);\n              }\n              var y = new ht.a();\n              return y.positions = o, y.normals = a, y.uvs = e.getVerticesData(Oe.b.UVKind), y.colors = e.getVerticesData(Oe.b.ColorKind), e && e.getIndices && (y.indices = e.getIndices()), y.applyToMesh(e), e.position = u.e.Zero(), e.rotationQuaternion = null, e.rotation = u.e.Zero(), e.computeWorldMatrix(!0), y;\n            }\n            return ht.a.ExtractFromMesh(e);\n          }, r.prototype._createSoftbody = function(t) {\n            var e = t.object;\n            if (e && e.getIndices) {\n              var n = e.getIndices();\n              n || (n = []);\n              var i = this._softVertexData(t), o = i.positions, a = i.normals;\n              if (o === null || a === null)\n                return new this.bjsAMMO.btCompoundShape();\n              for (var s = [], d = [], p = 0; p < o.length; p += 3) {\n                var y = new u.e(o[p], o[p + 1], o[p + 2]), P = new u.e(a[p], a[p + 1], a[p + 2]);\n                s.push(y.x, y.y, -y.z), d.push(P.x, P.y, -P.z);\n              }\n              var R = new this.bjsAMMO.btSoftBodyHelpers().CreateFromTriMesh(this.world.getWorldInfo(), s, e.getIndices(), n.length / 3, !0), B = o.length / 3, F = R.get_m_nodes();\n              for (p = 0; p < B; p++) {\n                var z;\n                (z = F.at(p).get_m_n()).setX(d[3 * p]), z.setY(d[3 * p + 1]), z.setZ(d[3 * p + 2]);\n              }\n              return R;\n            }\n          }, r.prototype._createCloth = function(t) {\n            var e = t.object;\n            if (e && e.getIndices) {\n              e.getIndices();\n              var n = this._softVertexData(t), i = n.positions, o = n.normals;\n              if (i === null || o === null)\n                return new this.bjsAMMO.btCompoundShape();\n              var a = i.length, s = Math.sqrt(a / 3);\n              t.segments = s;\n              var d = s - 1;\n              return this._tmpAmmoVectorA.setValue(i[0], i[1], i[2]), this._tmpAmmoVectorB.setValue(i[3 * d], i[3 * d + 1], i[3 * d + 2]), this._tmpAmmoVectorD.setValue(i[a - 3], i[a - 2], i[a - 1]), this._tmpAmmoVectorC.setValue(i[a - 3 - 3 * d], i[a - 2 - 3 * d], i[a - 1 - 3 * d]), new this.bjsAMMO.btSoftBodyHelpers().CreatePatch(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, this._tmpAmmoVectorC, this._tmpAmmoVectorD, s, s, t.getParam(\"fixedPoints\"), !0);\n            }\n          }, r.prototype._createRope = function(t) {\n            var e, n, i = this._softVertexData(t), o = i.positions, a = i.normals;\n            if (o === null || a === null)\n              return new this.bjsAMMO.btCompoundShape();\n            if (i.applyToMesh(t.object, !0), t._isFromLine = !0, a.map(function(y) {\n              return y * y;\n            }).reduce(function(y, P) {\n              return y + P;\n            }) === 0)\n              n = (e = o.length) / 3 - 1, this._tmpAmmoVectorA.setValue(o[0], o[1], o[2]), this._tmpAmmoVectorB.setValue(o[e - 3], o[e - 2], o[e - 1]);\n            else {\n              t._isFromLine = !1;\n              var s = t.getParam(\"path\");\n              if (t.getParam(\"shape\") === null)\n                return l.a.Warn(\"No shape available for extruded mesh\"), new this.bjsAMMO.btCompoundShape();\n              if (o.length % (3 * s.length) != 0)\n                return l.a.Warn(\"Path does not match extrusion\"), new this.bjsAMMO.btCompoundShape();\n              n = (e = s.length) - 1, this._tmpAmmoVectorA.setValue(s[0].x, s[0].y, s[0].z), this._tmpAmmoVectorB.setValue(s[e - 1].x, s[e - 1].y, s[e - 1].z);\n            }\n            t.segments = n;\n            var d = t.getParam(\"fixedPoints\");\n            d = d > 3 ? 3 : d;\n            var p = new this.bjsAMMO.btSoftBodyHelpers().CreateRope(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, n - 1, d);\n            return p.get_m_cfg().set_collisions(17), p;\n          }, r.prototype._createCustom = function(t) {\n            var e = null;\n            return this.onCreateCustomShape && (e = this.onCreateCustomShape(t)), e == null && (e = new this.bjsAMMO.btCompoundShape()), e;\n          }, r.prototype._addHullVerts = function(t, e, n) {\n            var i = this, o = 0;\n            if (n && n.getIndices && n.getWorldMatrix && n.getChildMeshes) {\n              var a = n.getIndices();\n              a || (a = []);\n              var s = n.getVerticesData(Oe.b.PositionKind);\n              s || (s = []), n.computeWorldMatrix(!1);\n              for (var d = a.length / 3, p = 0; p < d; p++) {\n                for (var y = [], P = 0; P < 3; P++) {\n                  var R, B = new u.e(s[3 * a[3 * p + P] + 0], s[3 * a[3 * p + P] + 1], s[3 * a[3 * p + P] + 2]);\n                  u.a.ScalingToRef(n.scaling.x, n.scaling.y, n.scaling.z, this._tmpMatrix), B = u.e.TransformCoordinates(B, this._tmpMatrix), (R = P == 0 ? this._tmpAmmoVectorA : P == 1 ? this._tmpAmmoVectorB : this._tmpAmmoVectorC).setValue(B.x, B.y, B.z), y.push(R);\n                }\n                t.addPoint(y[0], !0), t.addPoint(y[1], !0), t.addPoint(y[2], !0), o++;\n              }\n              n.getChildMeshes().forEach(function(F) {\n                o += i._addHullVerts(t, e, F);\n              });\n            }\n            return o;\n          }, r.prototype._createShape = function(t, e) {\n            var n = this;\n            e === void 0 && (e = !1);\n            var i, o = t.object, a = t.getObjectExtendSize();\n            if (!e) {\n              var s = t.object.getChildMeshes ? t.object.getChildMeshes(!0) : [];\n              i = new this.bjsAMMO.btCompoundShape();\n              var d = 0;\n              if (s.forEach(function(F) {\n                var z = F.getPhysicsImpostor();\n                if (z) {\n                  if (z.type == At.a.MeshImpostor)\n                    throw \"A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)\";\n                  var J = n._createShape(z), ie = F.parent.getWorldMatrix().clone(), se = new u.e();\n                  ie.decompose(se), n._tmpAmmoTransform.getOrigin().setValue(F.position.x * se.x, F.position.y * se.y, F.position.z * se.z), n._tmpAmmoQuaternion.setValue(F.rotationQuaternion.x, F.rotationQuaternion.y, F.rotationQuaternion.z, F.rotationQuaternion.w), n._tmpAmmoTransform.setRotation(n._tmpAmmoQuaternion), i.addChildShape(n._tmpAmmoTransform, J), z.dispose(), d++;\n                }\n              }), d > 0) {\n                if (t.type != At.a.NoImpostor) {\n                  var p = this._createShape(t, !0);\n                  p && (this._tmpAmmoTransform.getOrigin().setValue(0, 0, 0), this._tmpAmmoQuaternion.setValue(0, 0, 0, 1), this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion), i.addChildShape(this._tmpAmmoTransform, p));\n                }\n                return i;\n              }\n              this.bjsAMMO.destroy(i), i = null;\n            }\n            switch (t.type) {\n              case At.a.SphereImpostor:\n                if ($.a.WithinEpsilon(a.x, a.y, 1e-4) && $.a.WithinEpsilon(a.x, a.z, 1e-4))\n                  i = new this.bjsAMMO.btSphereShape(a.x / 2);\n                else {\n                  var y = [new this.bjsAMMO.btVector3(0, 0, 0)];\n                  (i = new this.bjsAMMO.btMultiSphereShape(y, [1], 1)).setLocalScaling(new this.bjsAMMO.btVector3(a.x / 2, a.y / 2, a.z / 2));\n                }\n                break;\n              case At.a.CapsuleImpostor:\n                i = new this.bjsAMMO.btCapsuleShape(a.x / 2, a.y / 2);\n                break;\n              case At.a.CylinderImpostor:\n                this._tmpAmmoVectorA.setValue(a.x / 2, a.y / 2, a.z / 2), i = new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);\n                break;\n              case At.a.PlaneImpostor:\n              case At.a.BoxImpostor:\n                this._tmpAmmoVectorA.setValue(a.x / 2, a.y / 2, a.z / 2), i = new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);\n                break;\n              case At.a.MeshImpostor:\n                if (t.getParam(\"mass\") == 0) {\n                  var P = new this.bjsAMMO.btTriangleMesh();\n                  t._pluginData.toDispose.push(P);\n                  var R = this._addMeshVerts(P, o, o);\n                  i = R == 0 ? new this.bjsAMMO.btCompoundShape() : new this.bjsAMMO.btBvhTriangleMeshShape(P);\n                  break;\n                }\n              case At.a.ConvexHullImpostor:\n                var B = new this.bjsAMMO.btConvexHullShape();\n                (R = this._addHullVerts(B, o, o)) == 0 ? (t._pluginData.toDispose.push(B), i = new this.bjsAMMO.btCompoundShape()) : i = B;\n                break;\n              case At.a.NoImpostor:\n                i = new this.bjsAMMO.btSphereShape(a.x / 2);\n                break;\n              case At.a.CustomImpostor:\n                i = this._createCustom(t);\n                break;\n              case At.a.SoftbodyImpostor:\n                i = this._createSoftbody(t);\n                break;\n              case At.a.ClothImpostor:\n                i = this._createCloth(t);\n                break;\n              case At.a.RopeImpostor:\n                i = this._createRope(t);\n                break;\n              default:\n                l.a.Warn(\"The impostor type is not currently supported by the ammo plugin.\");\n            }\n            return i;\n          }, r.prototype.setTransformationFromPhysicsBody = function(t) {\n            t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), t.object.position.set(this._tmpAmmoTransform.getOrigin().x(), this._tmpAmmoTransform.getOrigin().y(), this._tmpAmmoTransform.getOrigin().z()), t.object.rotationQuaternion ? t.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()) : t.object.rotation && (this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()), this._tmpQuaternion.toEulerAnglesToRef(t.object.rotation));\n          }, r.prototype.setPhysicsBodyTransformation = function(t, e, n) {\n            var i = t.physicsBody.getWorldTransform();\n            if (Math.abs(i.getOrigin().x() - e.x) > Vt.a || Math.abs(i.getOrigin().y() - e.y) > Vt.a || Math.abs(i.getOrigin().z() - e.z) > Vt.a || Math.abs(i.getRotation().x() - n.x) > Vt.a || Math.abs(i.getRotation().y() - n.y) > Vt.a || Math.abs(i.getRotation().z() - n.z) > Vt.a || Math.abs(i.getRotation().w() - n.w) > Vt.a)\n              if (this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), i.setOrigin(this._tmpAmmoVectorA), this._tmpAmmoQuaternion.setValue(n.x, n.y, n.z, n.w), i.setRotation(this._tmpAmmoQuaternion), t.physicsBody.setWorldTransform(i), t.mass == 0) {\n                var o = t.physicsBody.getMotionState();\n                o && o.setWorldTransform(i);\n              } else\n                t.physicsBody.activate();\n          }, r.prototype.isSupported = function() {\n            return this.bjsAMMO !== void 0;\n          }, r.prototype.setLinearVelocity = function(t, e) {\n            this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), t.soft ? t.physicsBody.linearVelocity(this._tmpAmmoVectorA) : t.physicsBody.setLinearVelocity(this._tmpAmmoVectorA);\n          }, r.prototype.setAngularVelocity = function(t, e) {\n            this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), t.soft ? t.physicsBody.angularVelocity(this._tmpAmmoVectorA) : t.physicsBody.setAngularVelocity(this._tmpAmmoVectorA);\n          }, r.prototype.getLinearVelocity = function(t) {\n            if (t.soft)\n              var e = t.physicsBody.linearVelocity();\n            else\n              e = t.physicsBody.getLinearVelocity();\n            if (!e)\n              return null;\n            var n = new u.e(e.x(), e.y(), e.z());\n            return this.bjsAMMO.destroy(e), n;\n          }, r.prototype.getAngularVelocity = function(t) {\n            if (t.soft)\n              var e = t.physicsBody.angularVelocity();\n            else\n              e = t.physicsBody.getAngularVelocity();\n            if (!e)\n              return null;\n            var n = new u.e(e.x(), e.y(), e.z());\n            return this.bjsAMMO.destroy(e), n;\n          }, r.prototype.setBodyMass = function(t, e) {\n            t.soft ? t.physicsBody.setTotalMass(e, !1) : t.physicsBody.setMassProps(e), t._pluginData.mass = e;\n          }, r.prototype.getBodyMass = function(t) {\n            return t._pluginData.mass || 0;\n          }, r.prototype.getBodyFriction = function(t) {\n            return t._pluginData.friction || 0;\n          }, r.prototype.setBodyFriction = function(t, e) {\n            t.soft ? t.physicsBody.get_m_cfg().set_kDF(e) : t.physicsBody.setFriction(e), t._pluginData.friction = e;\n          }, r.prototype.getBodyRestitution = function(t) {\n            return t._pluginData.restitution || 0;\n          }, r.prototype.setBodyRestitution = function(t, e) {\n            t.physicsBody.setRestitution(e), t._pluginData.restitution = e;\n          }, r.prototype.getBodyPressure = function(t) {\n            return t.soft ? t._pluginData.pressure || 0 : (l.a.Warn(\"Pressure is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyPressure = function(t, e) {\n            t.soft ? t.type === At.a.SoftbodyImpostor ? (t.physicsBody.get_m_cfg().set_kPR(e), t._pluginData.pressure = e) : (t.physicsBody.get_m_cfg().set_kPR(0), t._pluginData.pressure = 0) : l.a.Warn(\"Pressure can only be applied to a softbody\");\n          }, r.prototype.getBodyStiffness = function(t) {\n            return t.soft ? t._pluginData.stiffness || 0 : (l.a.Warn(\"Stiffness is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyStiffness = function(t, e) {\n            t.soft ? (e = (e = e < 0 ? 0 : e) > 1 ? 1 : e, t.physicsBody.get_m_materials().at(0).set_m_kLST(e), t._pluginData.stiffness = e) : l.a.Warn(\"Stiffness cannot be applied to a rigid body\");\n          }, r.prototype.getBodyVelocityIterations = function(t) {\n            return t.soft ? t._pluginData.velocityIterations || 0 : (l.a.Warn(\"Velocity iterations is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyVelocityIterations = function(t, e) {\n            t.soft ? (e = e < 0 ? 0 : e, t.physicsBody.get_m_cfg().set_viterations(e), t._pluginData.velocityIterations = e) : l.a.Warn(\"Velocity iterations cannot be applied to a rigid body\");\n          }, r.prototype.getBodyPositionIterations = function(t) {\n            return t.soft ? t._pluginData.positionIterations || 0 : (l.a.Warn(\"Position iterations is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyPositionIterations = function(t, e) {\n            t.soft ? (e = e < 0 ? 0 : e, t.physicsBody.get_m_cfg().set_piterations(e), t._pluginData.positionIterations = e) : l.a.Warn(\"Position iterations cannot be applied to a rigid body\");\n          }, r.prototype.appendAnchor = function(t, e, n, i, o, a) {\n            o === void 0 && (o = 1), a === void 0 && (a = !1);\n            var s = t.segments, d = Math.round((s - 1) * n) + s * (s - 1 - Math.round((s - 1) * i));\n            t.physicsBody.appendAnchor(d, e.physicsBody, a, o);\n          }, r.prototype.appendHook = function(t, e, n, i, o) {\n            i === void 0 && (i = 1), o === void 0 && (o = !1);\n            var a = Math.round(t.segments * n);\n            t.physicsBody.appendAnchor(a, e.physicsBody, o, i);\n          }, r.prototype.sleepBody = function(t) {\n            l.a.Warn(\"sleepBody is not currently supported by the Ammo physics plugin\");\n          }, r.prototype.wakeUpBody = function(t) {\n            t.physicsBody.activate();\n          }, r.prototype.updateDistanceJoint = function(t, e, n) {\n            l.a.Warn(\"updateDistanceJoint is not currently supported by the Ammo physics plugin\");\n          }, r.prototype.setMotor = function(t, e, n, i) {\n            t.physicsJoint.enableAngularMotor(!0, e, n);\n          }, r.prototype.setLimit = function(t, e, n) {\n            l.a.Warn(\"setLimit is not currently supported by the Ammo physics plugin\");\n          }, r.prototype.syncMeshWithImpostor = function(t, e) {\n            e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), t.position.x = this._tmpAmmoTransform.getOrigin().x(), t.position.y = this._tmpAmmoTransform.getOrigin().y(), t.position.z = this._tmpAmmoTransform.getOrigin().z(), t.rotationQuaternion && (t.rotationQuaternion.x = this._tmpAmmoTransform.getRotation().x(), t.rotationQuaternion.y = this._tmpAmmoTransform.getRotation().y(), t.rotationQuaternion.z = this._tmpAmmoTransform.getRotation().z(), t.rotationQuaternion.w = this._tmpAmmoTransform.getRotation().w());\n          }, r.prototype.getRadius = function(t) {\n            return t.getObjectExtendSize().x / 2;\n          }, r.prototype.getBoxSizeToRef = function(t, e) {\n            var n = t.getObjectExtendSize();\n            e.x = n.x, e.y = n.y, e.z = n.z;\n          }, r.prototype.dispose = function() {\n            this.bjsAMMO.destroy(this.world), this.bjsAMMO.destroy(this._solver), this.bjsAMMO.destroy(this._overlappingPairCache), this.bjsAMMO.destroy(this._dispatcher), this.bjsAMMO.destroy(this._collisionConfiguration), this.bjsAMMO.destroy(this._tmpAmmoVectorA), this.bjsAMMO.destroy(this._tmpAmmoVectorB), this.bjsAMMO.destroy(this._tmpAmmoVectorC), this.bjsAMMO.destroy(this._tmpAmmoTransform), this.bjsAMMO.destroy(this._tmpAmmoQuaternion), this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback), this.world = null;\n          }, r.prototype.raycast = function(t, e) {\n            this._tmpAmmoVectorRCA = new this.bjsAMMO.btVector3(t.x, t.y, t.z), this._tmpAmmoVectorRCB = new this.bjsAMMO.btVector3(e.x, e.y, e.z);\n            var n = new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB);\n            return this.world.rayTest(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB, n), this._raycastResult.reset(t, e), n.hasHit() && (this._raycastResult.setHitData({ x: n.get_m_hitNormalWorld().x(), y: n.get_m_hitNormalWorld().y(), z: n.get_m_hitNormalWorld().z() }, { x: n.get_m_hitPointWorld().x(), y: n.get_m_hitPointWorld().y(), z: n.get_m_hitPointWorld().z() }), this._raycastResult.calculateHitDistance()), this.bjsAMMO.destroy(n), this.bjsAMMO.destroy(this._tmpAmmoVectorRCA), this.bjsAMMO.destroy(this._tmpAmmoVectorRCB), this._raycastResult;\n          }, r.DISABLE_COLLISION_FLAG = 4, r.KINEMATIC_FLAG = 2, r.DISABLE_DEACTIVATION_FLAG = 4, r;\n        }();\n        V.a.prototype.removeReflectionProbe = function(r) {\n          if (!this.reflectionProbes)\n            return -1;\n          var t = this.reflectionProbes.indexOf(r);\n          return t !== -1 && this.reflectionProbes.splice(t, 1), t;\n        }, V.a.prototype.addReflectionProbe = function(r) {\n          this.reflectionProbes || (this.reflectionProbes = []), this.reflectionProbes.push(r);\n        };\n        var Du = function() {\n          function r(t, e, n, i, o) {\n            var a = this;\n            i === void 0 && (i = !0), o === void 0 && (o = !1), this.name = t, this._viewMatrix = u.a.Identity(), this._target = u.e.Zero(), this._add = u.e.Zero(), this._invertYAxis = !1, this.position = u.e.Zero(), this._scene = n, this._scene.reflectionProbes || (this._scene.reflectionProbes = new Array()), this._scene.reflectionProbes.push(this);\n            var s = h.a.TEXTURETYPE_UNSIGNED_BYTE;\n            if (o) {\n              var d = this._scene.getEngine().getCaps();\n              d.textureHalfFloatRender ? s = h.a.TEXTURETYPE_HALF_FLOAT : d.textureFloatRender && (s = h.a.TEXTURETYPE_FLOAT);\n            }\n            this._renderTargetTexture = new on(t, e, n, i, !0, s, !0), this._renderTargetTexture.onBeforeRenderObservable.add(function(p) {\n              switch (p) {\n                case 0:\n                  a._add.copyFromFloats(1, 0, 0);\n                  break;\n                case 1:\n                  a._add.copyFromFloats(-1, 0, 0);\n                  break;\n                case 2:\n                  a._add.copyFromFloats(0, a._invertYAxis ? 1 : -1, 0);\n                  break;\n                case 3:\n                  a._add.copyFromFloats(0, a._invertYAxis ? -1 : 1, 0);\n                  break;\n                case 4:\n                  a._add.copyFromFloats(0, 0, 1);\n                  break;\n                case 5:\n                  a._add.copyFromFloats(0, 0, -1);\n              }\n              a._attachedMesh && a.position.copyFrom(a._attachedMesh.getAbsolutePosition()), a.position.addToRef(a._add, a._target), u.a.LookAtLHToRef(a.position, a._target, u.e.Up(), a._viewMatrix), n.activeCamera && (a._projectionMatrix = u.a.PerspectiveFovLH(Math.PI / 2, 1, n.activeCamera.minZ, n.activeCamera.maxZ), n.setTransformMatrix(a._viewMatrix, a._projectionMatrix)), n._forcedViewPosition = a.position;\n            }), this._renderTargetTexture.onAfterUnbindObservable.add(function() {\n              n._forcedViewPosition = null, n.updateTransformMatrix(!0);\n            });\n          }\n          return Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this._renderTargetTexture.samples;\n          }, set: function(t) {\n            this._renderTargetTexture.samples = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"refreshRate\", { get: function() {\n            return this._renderTargetTexture.refreshRate;\n          }, set: function(t) {\n            this._renderTargetTexture.refreshRate = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getScene = function() {\n            return this._scene;\n          }, Object.defineProperty(r.prototype, \"cubeTexture\", { get: function() {\n            return this._renderTargetTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderList\", { get: function() {\n            return this._renderTargetTexture.renderList;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachToMesh = function(t) {\n            this._attachedMesh = t;\n          }, r.prototype.setRenderingAutoClearDepthStencil = function(t, e) {\n            this._renderTargetTexture.setRenderingAutoClearDepthStencil(t, e);\n          }, r.prototype.dispose = function() {\n            var t = this._scene.reflectionProbes.indexOf(this);\n            t !== -1 && this._scene.reflectionProbes.splice(t, 1), this._renderTargetTexture && (this._renderTargetTexture.dispose(), this._renderTargetTexture = null);\n          }, r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name;\n            return t && (e += \", position: \" + this.position.toString(), this._attachedMesh && (e += \", attached mesh: \" + this._attachedMesh.name)), e;\n          }, r.prototype.getClassName = function() {\n            return \"ReflectionProbe\";\n          }, r.prototype.serialize = function() {\n            var t = L.a.Serialize(this, this._renderTargetTexture.serialize());\n            return t.isReflectionProbe = !0, t;\n          }, r.Parse = function(t, e, n) {\n            var i = null;\n            if (e.reflectionProbes)\n              for (var o = 0; o < e.reflectionProbes.length; o++) {\n                var a = e.reflectionProbes[o];\n                if (a.name === t.name) {\n                  i = a;\n                  break;\n                }\n              }\n            return (i = L.a.Parse(function() {\n              return i || new r(t.name, t.renderTargetSize, e, t._generateMipMaps);\n            }, t, e, n)).cubeTexture._waitingRenderList = t.renderList, t._attachedMesh && i.attachToMesh(e.getMeshByID(t._attachedMesh)), i;\n          }, Object(c.c)([Object(L.k)()], r.prototype, \"_attachedMesh\", void 0), Object(c.c)([Object(L.o)()], r.prototype, \"position\", void 0), r;\n        }(), x_ = !0, $o = function() {\n          function r() {\n          }\n          return r.LoaderInjectedPhysicsEngine = void 0, r;\n        }(), Lu = function(r, t, e, n) {\n          for (var i = 0, o = t.materials.length; i < o; i++) {\n            var a = t.materials[i];\n            if (a.id === r)\n              return zt.a.Parse(a, e, n);\n          }\n          return null;\n        }, C_ = function(r, t, e) {\n          for (var n in t)\n            if (r.name === t[n])\n              return e.push(r.id), !0;\n          return !(!r.parentId || e.indexOf(r.parentId) === -1) && (e.push(r.id), !0);\n        }, Ar = function(r, t) {\n          return r + \" of \" + (t ? t.file + \" from \" + t.name + \" version: \" + t.version + \", exporter version: \" + t.exporter_version : \"unknown\");\n        }, Nu = function(r, t) {\n          var e = t;\n          if (t._waitingData.lods) {\n            if (t._waitingData.lods.ids && t._waitingData.lods.ids.length > 0) {\n              var n = t._waitingData.lods.ids, i = e.isEnabled(!1);\n              if (t._waitingData.lods.distances) {\n                var o = t._waitingData.lods.distances;\n                if (o.length >= n.length) {\n                  var a = o.length > n.length ? o[o.length - 1] : 0;\n                  e.setEnabled(!1);\n                  for (var s = 0; s < n.length; s++) {\n                    var d = n[s], p = r.getMeshByID(d);\n                    p != null && e.addLODLevel(o[s], p);\n                  }\n                  a > 0 && e.addLODLevel(a, null), i === !0 && e.setEnabled(!0);\n                } else\n                  Xe.b.Warn(\"Invalid level of detail distances for \" + t.name);\n              }\n            }\n            t._waitingData.lods = null;\n          }\n        }, wu = function(r, t, e, n, i) {\n          i === void 0 && (i = !1);\n          var o = new An(r), a = \"importScene has failed JSON parse\";\n          try {\n            var s = JSON.parse(t);\n            a = \"\";\n            var d, p, y = Ft.loggingLevel === Ft.DETAILED_LOGGING;\n            if (s.environmentTexture !== void 0 && s.environmentTexture !== null) {\n              var P = s.isPBR === void 0 || s.isPBR;\n              if (s.environmentTextureType && s.environmentTextureType === \"BABYLON.HDRCubeTexture\") {\n                var R = s.environmentTextureSize ? s.environmentTextureSize : 128, B = new qo((s.environmentTexture.match(/https?:\\/\\//g) ? \"\" : e) + s.environmentTexture, r, R, !0, !P);\n                s.environmentTextureRotationY && (B.rotationY = s.environmentTextureRotationY), r.environmentTexture = B;\n              } else if (Hn.a.EndsWith(s.environmentTexture, \".env\")) {\n                var F = new ei((s.environmentTexture.match(/https?:\\/\\//g) ? \"\" : e) + s.environmentTexture, r);\n                s.environmentTextureRotationY && (F.rotationY = s.environmentTextureRotationY), r.environmentTexture = F;\n              } else {\n                var z = ei.CreateFromPrefilteredData((s.environmentTexture.match(/https?:\\/\\//g) ? \"\" : e) + s.environmentTexture, r);\n                s.environmentTextureRotationY && (z.rotationY = s.environmentTextureRotationY), r.environmentTexture = z;\n              }\n              if (s.createDefaultSkybox === !0) {\n                var J = r.activeCamera !== void 0 && r.activeCamera !== null ? (r.activeCamera.maxZ - r.activeCamera.minZ) / 2 : 1e3, ie = s.skyboxBlurLevel || 0;\n                r.createDefaultSkybox(r.environmentTexture, P, J, ie);\n              }\n              o.environmentTexture = r.environmentTexture;\n            }\n            if (s.environmentIntensity !== void 0 && s.environmentIntensity !== null && (r.environmentIntensity = s.environmentIntensity), s.lights !== void 0 && s.lights !== null)\n              for (d = 0, p = s.lights.length; d < p; d++) {\n                var se = s.lights[d], ce = bi.a.Parse(se, r);\n                ce && (o.lights.push(ce), a += d === 0 ? `\n\tLights:` : \"\", a += `\n\t\t` + ce.toString(y));\n              }\n            if (s.reflectionProbes !== void 0 && s.reflectionProbes !== null)\n              for (d = 0, p = s.reflectionProbes.length; d < p; d++) {\n                var ue = s.reflectionProbes[d], fe = Du.Parse(ue, r, e);\n                fe && (o.reflectionProbes.push(fe), a += d === 0 ? `\n\tReflection Probes:` : \"\", a += `\n\t\t` + fe.toString(y));\n              }\n            if (s.animations !== void 0 && s.animations !== null)\n              for (d = 0, p = s.animations.length; d < p; d++) {\n                var ve = s.animations[d], Te = O.a.GetClass(\"BABYLON.Animation\");\n                if (Te) {\n                  var Re = Te.Parse(ve);\n                  r.animations.push(Re), o.animations.push(Re), a += d === 0 ? `\n\tAnimations:` : \"\", a += `\n\t\t` + Re.toString(y);\n                }\n              }\n            if (s.materials !== void 0 && s.materials !== null)\n              for (d = 0, p = s.materials.length; d < p; d++) {\n                var Ae = s.materials[d], Ee = zt.a.Parse(Ae, r, e);\n                Ee && (o.materials.push(Ee), a += d === 0 ? `\n\tMaterials:` : \"\", a += `\n\t\t` + Ee.toString(y), Ee.getActiveTextures().forEach(function(Kt) {\n                  o.textures.indexOf(Kt) == -1 && o.textures.push(Kt);\n                }));\n              }\n            if (s.multiMaterials !== void 0 && s.multiMaterials !== null)\n              for (d = 0, p = s.multiMaterials.length; d < p; d++) {\n                var Se = s.multiMaterials[d], De = Qi.a.ParseMultiMaterial(Se, r);\n                o.multiMaterials.push(De), a += d === 0 ? `\n\tMultiMaterials:` : \"\", a += `\n\t\t` + De.toString(y), De.getActiveTextures().forEach(function(Kt) {\n                  o.textures.indexOf(Kt) == -1 && o.textures.push(Kt);\n                });\n              }\n            if (s.morphTargetManagers !== void 0 && s.morphTargetManagers !== null)\n              for (var xe = 0, Le = s.morphTargetManagers; xe < Le.length; xe++) {\n                var Me = Le[xe];\n                o.morphTargetManagers.push(Zo.Parse(Me, r));\n              }\n            if (s.skeletons !== void 0 && s.skeletons !== null)\n              for (d = 0, p = s.skeletons.length; d < p; d++) {\n                var we = s.skeletons[d], Ye = Ao.Parse(we, r);\n                o.skeletons.push(Ye), a += d === 0 ? `\n\tSkeletons:` : \"\", a += `\n\t\t` + Ye.toString(y);\n              }\n            var et = s.geometries;\n            if (et != null) {\n              var nt = new Array(), ct = et.vertexData;\n              if (ct != null)\n                for (d = 0, p = ct.length; d < p; d++) {\n                  var Ke = ct[d];\n                  nt.push(Ns.a.Parse(Ke, r, e));\n                }\n              nt.forEach(function(Kt) {\n                Kt && o.geometries.push(Kt);\n              });\n            }\n            if (s.transformNodes !== void 0 && s.transformNodes !== null)\n              for (d = 0, p = s.transformNodes.length; d < p; d++) {\n                var rt = s.transformNodes[d], it = pr.a.Parse(rt, r, e);\n                o.transformNodes.push(it);\n              }\n            if (s.meshes !== void 0 && s.meshes !== null)\n              for (d = 0, p = s.meshes.length; d < p; d++) {\n                var qe = s.meshes[d], ut = Ie.a.Parse(qe, r, e);\n                if (o.meshes.push(ut), ut.hasInstances)\n                  for (var Ve = 0, Ze = ut.instances; Ve < Ze.length; Ve++) {\n                    var vt = Ze[Ve];\n                    o.meshes.push(vt);\n                  }\n                a += d === 0 ? `\n\tMeshes:` : \"\", a += `\n\t\t` + ut.toString(y);\n              }\n            if (s.cameras !== void 0 && s.cameras !== null)\n              for (d = 0, p = s.cameras.length; d < p; d++) {\n                var jt = s.cameras[d], Dt = _t.a.Parse(jt, r);\n                o.cameras.push(Dt), a += d === 0 ? `\n\tCameras:` : \"\", a += `\n\t\t` + Dt.toString(y);\n              }\n            if (s.postProcesses !== void 0 && s.postProcesses !== null)\n              for (d = 0, p = s.postProcesses.length; d < p; d++) {\n                var Yt = s.postProcesses[d], mt = ft.Parse(Yt, r, e);\n                mt && (o.postProcesses.push(mt), a += d === 0 ? `\nPostprocesses:` : \"\", a += `\n\t\t` + mt.toString());\n              }\n            if (s.animationGroups !== void 0 && s.animationGroups !== null)\n              for (d = 0, p = s.animationGroups.length; d < p; d++) {\n                var qt = s.animationGroups[d], Ht = je.Parse(qt, r);\n                o.animationGroups.push(Ht), a += d === 0 ? `\n\tAnimationGroups:` : \"\", a += `\n\t\t` + Ht.toString(y);\n              }\n            for (d = 0, p = r.cameras.length; d < p; d++)\n              (Dt = r.cameras[d])._waitingParentId && (Dt.parent = r.getLastEntryByID(Dt._waitingParentId), Dt._waitingParentId = null);\n            for (d = 0, p = r.lights.length; d < p; d++) {\n              var kt = r.lights[d];\n              kt && kt._waitingParentId && (kt.parent = r.getLastEntryByID(kt._waitingParentId), kt._waitingParentId = null);\n            }\n            for (d = 0, p = r.transformNodes.length; d < p; d++) {\n              var Wt = r.transformNodes[d];\n              Wt._waitingParentId && (Wt.parent = r.getLastEntryByID(Wt._waitingParentId), Wt._waitingParentId = null);\n            }\n            for (d = 0, p = r.meshes.length; d < p; d++)\n              (ut = r.meshes[d])._waitingParentId && (ut.parent = r.getLastEntryByID(ut._waitingParentId), ut._waitingParentId = null), ut._waitingData.lods && Nu(r, ut);\n            for (d = 0, p = r.skeletons.length; d < p; d++)\n              (Ye = r.skeletons[d])._hasWaitingData && (Ye.bones != null && Ye.bones.forEach(function(Kt) {\n                if (Kt._waitingTransformNodeId) {\n                  var oi = r.getLastEntryByID(Kt._waitingTransformNodeId);\n                  oi && Kt.linkTransformNode(oi), Kt._waitingTransformNodeId = null;\n                }\n              }), Ye._waitingOverrideMeshId && (Ye.overrideMesh = r.getMeshByID(Ye._waitingOverrideMeshId), Ye._waitingOverrideMeshId = null), Ye._hasWaitingData = null);\n            for (d = 0, p = r.meshes.length; d < p; d++) {\n              var bt = r.meshes[d];\n              bt._waitingData.freezeWorldMatrix ? (bt.freezeWorldMatrix(), bt._waitingData.freezeWorldMatrix = null) : bt.computeWorldMatrix(!0);\n            }\n            for (d = 0, p = r.lights.length; d < p; d++) {\n              var Rt = r.lights[d];\n              if (Rt._excludedMeshesIds.length > 0) {\n                for (var Zt = 0; Zt < Rt._excludedMeshesIds.length; Zt++) {\n                  var Mn = r.getMeshByID(Rt._excludedMeshesIds[Zt]);\n                  Mn && Rt.excludedMeshes.push(Mn);\n                }\n                Rt._excludedMeshesIds = [];\n              }\n              if (Rt._includedOnlyMeshesIds.length > 0) {\n                for (var Bn = 0; Bn < Rt._includedOnlyMeshesIds.length; Bn++) {\n                  var Kn = r.getMeshByID(Rt._includedOnlyMeshesIds[Bn]);\n                  Kn && Rt.includedOnlyMeshes.push(Kn);\n                }\n                Rt._includedOnlyMeshesIds = [];\n              }\n            }\n            for (V.a.Parse(s, r, o, e), d = 0, p = r.meshes.length; d < p; d++)\n              (ut = r.meshes[d])._waitingData.actions && (pe.Parse(ut._waitingData.actions, ut, r), ut._waitingData.actions = null);\n            s.actions !== void 0 && s.actions !== null && pe.Parse(s.actions, null, r);\n          } catch (Kt) {\n            var In = Ar(\"loadAssets\", s ? s.producer : \"Unknown\") + a;\n            if (!n)\n              throw l.a.Log(In), Kt;\n            n(In, Kt);\n          } finally {\n            i || o.removeAllFromScene(), a !== null && Ft.loggingLevel !== Ft.NO_LOGGING && l.a.Log(Ar(\"loadAssets\", s ? s.producer : \"Unknown\") + (Ft.loggingLevel !== Ft.MINIMAL_LOGGING ? a : \"\"));\n          }\n          return o;\n        };\n        Ft.RegisterPlugin({ name: \"babylon.js\", extensions: \".babylon\", canDirectLoad: function(r) {\n          return r.indexOf(\"babylon\") !== -1;\n        }, importMesh: function(r, t, e, n, i, o, a, s) {\n          var d = \"importMesh has failed JSON parse\";\n          try {\n            var p = JSON.parse(e);\n            d = \"\";\n            var y = Ft.loggingLevel === Ft.DETAILED_LOGGING;\n            r ? Array.isArray(r) || (r = [r]) : r = null;\n            var P = new Array();\n            if (p.meshes !== void 0 && p.meshes !== null) {\n              var R, B, F, z = [], J = [];\n              for (R = 0, B = p.meshes.length; R < B; R++) {\n                var ie = p.meshes[R];\n                if (r === null || C_(ie, r, P)) {\n                  if (r !== null && delete r[r.indexOf(ie.name)], ie.geometryId !== void 0 && ie.geometryId !== null && p.geometries !== void 0 && p.geometries !== null) {\n                    var se = !1;\n                    [\"boxes\", \"spheres\", \"cylinders\", \"toruses\", \"grounds\", \"planes\", \"torusKnots\", \"vertexData\"].forEach(function(it) {\n                      se !== !0 && p.geometries[it] && Array.isArray(p.geometries[it]) && p.geometries[it].forEach(function(qe) {\n                        if (qe.id === ie.geometryId) {\n                          switch (it) {\n                            case \"vertexData\":\n                              Ns.a.Parse(qe, t, n);\n                          }\n                          se = !0;\n                        }\n                      });\n                    }), se === !1 && l.a.Warn(\"Geometry not found for mesh \" + ie.id);\n                  }\n                  if (ie.materialId) {\n                    var ce = J.indexOf(ie.materialId) !== -1;\n                    if (ce === !1 && p.multiMaterials !== void 0 && p.multiMaterials !== null)\n                      for (var ue = 0, fe = p.multiMaterials.length; ue < fe; ue++) {\n                        var ve = p.multiMaterials[ue];\n                        if (ve.id === ie.materialId) {\n                          for (var Te = 0, Re = ve.materials.length; Te < Re; Te++) {\n                            var Ae, Ee = ve.materials[Te];\n                            J.push(Ee), (Ae = Lu(Ee, p, t, n)) && (d += `\n\tMaterial ` + Ae.toString(y));\n                          }\n                          J.push(ve.id);\n                          var Se = Qi.a.ParseMultiMaterial(ve, t);\n                          Se && (ce = !0, d += `\n\tMulti-Material ` + Se.toString(y));\n                          break;\n                        }\n                      }\n                    ce === !1 && (J.push(ie.materialId), (Ae = Lu(ie.materialId, p, t, n)) ? d += `\n\tMaterial ` + Ae.toString(y) : l.a.Warn(\"Material not found for mesh \" + ie.id));\n                  }\n                  if (ie.skeletonId > -1 && p.skeletons !== void 0 && p.skeletons !== null && !(z.indexOf(ie.skeletonId) > -1))\n                    for (var De = 0, xe = p.skeletons.length; De < xe; De++) {\n                      var Le = p.skeletons[De];\n                      if (Le.id === ie.skeletonId) {\n                        var Me = Ao.Parse(Le, t);\n                        a.push(Me), z.push(Le.id), d += `\n\tSkeleton ` + Me.toString(y);\n                      }\n                    }\n                  if (p.morphTargetManagers !== void 0 && p.morphTargetManagers !== null)\n                    for (var we = 0, Ye = p.morphTargetManagers; we < Ye.length; we++) {\n                      var et = Ye[we];\n                      Zo.Parse(et, t);\n                    }\n                  var nt = Ie.a.Parse(ie, t, n);\n                  i.push(nt), d += `\n\tMesh ` + nt.toString(y);\n                }\n              }\n              for (R = 0, B = t.meshes.length; R < B; R++)\n                (F = t.meshes[R])._waitingParentId && (F.parent = t.getLastEntryByID(F._waitingParentId), F._waitingParentId = null), F._waitingData.lods && Nu(t, F);\n              for (R = 0, B = t.skeletons.length; R < B; R++)\n                (Me = t.skeletons[R])._hasWaitingData && (Me.bones != null && Me.bones.forEach(function(it) {\n                  if (it._waitingTransformNodeId) {\n                    var qe = t.getLastEntryByID(it._waitingTransformNodeId);\n                    qe && it.linkTransformNode(qe), it._waitingTransformNodeId = null;\n                  }\n                }), Me._waitingOverrideMeshId && (Me.overrideMesh = t.getMeshByID(Me._waitingOverrideMeshId), Me._waitingOverrideMeshId = null), Me._hasWaitingData = null);\n              for (R = 0, B = t.meshes.length; R < B; R++)\n                (F = t.meshes[R])._waitingData.freezeWorldMatrix ? (F.freezeWorldMatrix(), F._waitingData.freezeWorldMatrix = null) : F.computeWorldMatrix(!0);\n            }\n            if (p.particleSystems !== void 0 && p.particleSystems !== null) {\n              var ct = V.a.GetIndividualParser(ot.a.NAME_PARTICLESYSTEM);\n              if (ct)\n                for (R = 0, B = p.particleSystems.length; R < B; R++) {\n                  var Ke = p.particleSystems[R];\n                  P.indexOf(Ke.emitterId) !== -1 && o.push(ct(Ke, t, n));\n                }\n            }\n            return !0;\n          } catch (it) {\n            var rt = Ar(\"importMesh\", p ? p.producer : \"Unknown\") + d;\n            if (!s)\n              throw l.a.Log(rt), it;\n            s(rt, it);\n          } finally {\n            d !== null && Ft.loggingLevel !== Ft.NO_LOGGING && l.a.Log(Ar(\"importMesh\", p ? p.producer : \"Unknown\") + (Ft.loggingLevel !== Ft.MINIMAL_LOGGING ? d : \"\"));\n          }\n          return !1;\n        }, load: function(r, t, e, n) {\n          var i = \"importScene has failed JSON parse\";\n          try {\n            var o = JSON.parse(t);\n            if (i = \"\", o.useDelayedTextureLoading !== void 0 && o.useDelayedTextureLoading !== null && (r.useDelayedTextureLoading = o.useDelayedTextureLoading && !Ft.ForceFullSceneLoadingForIncremental), o.autoClear !== void 0 && o.autoClear !== null && (r.autoClear = o.autoClear), o.clearColor !== void 0 && o.clearColor !== null && (r.clearColor = I.b.FromArray(o.clearColor)), o.ambientColor !== void 0 && o.ambientColor !== null && (r.ambientColor = I.a.FromArray(o.ambientColor)), o.gravity !== void 0 && o.gravity !== null && (r.gravity = u.e.FromArray(o.gravity)), o.fogMode && o.fogMode !== 0)\n              switch (r.fogMode = o.fogMode, r.fogColor = I.a.FromArray(o.fogColor), r.fogStart = o.fogStart, r.fogEnd = o.fogEnd, r.fogDensity = o.fogDensity, i += \"\tFog mode for scene:  \", r.fogMode) {\n                case 1:\n                  i += `exp\n`;\n                  break;\n                case 2:\n                  i += `exp2\n`;\n                  break;\n                case 3:\n                  i += `linear\n`;\n              }\n            if (o.physicsEnabled) {\n              var a;\n              o.physicsEngine === \"cannon\" ? a = new Bs(void 0, void 0, $o.LoaderInjectedPhysicsEngine) : o.physicsEngine === \"oimo\" ? a = new Mu(void 0, $o.LoaderInjectedPhysicsEngine) : o.physicsEngine === \"ammo\" && (a = new Iu(void 0, $o.LoaderInjectedPhysicsEngine, void 0)), i = \"\tPhysics engine \" + (o.physicsEngine ? o.physicsEngine : \"oimo\") + ` enabled\n`;\n              var s = o.physicsGravity ? u.e.FromArray(o.physicsGravity) : null;\n              r.enablePhysics(s, a);\n            }\n            return o.metadata !== void 0 && o.metadata !== null && (r.metadata = o.metadata), o.collisionsEnabled !== void 0 && o.collisionsEnabled !== null && (r.collisionsEnabled = o.collisionsEnabled), !!wu(r, t, e, n, !0) && (o.autoAnimate && r.beginAnimation(r, o.autoAnimateFrom, o.autoAnimateTo, o.autoAnimateLoop, o.autoAnimateSpeed || 1), o.activeCameraID !== void 0 && o.activeCameraID !== null && r.setActiveCameraByID(o.activeCameraID), !0);\n          } catch (p) {\n            var d = Ar(\"importScene\", o ? o.producer : \"Unknown\") + i;\n            if (!n)\n              throw l.a.Log(d), p;\n            n(d, p);\n          } finally {\n            i !== null && Ft.loggingLevel !== Ft.NO_LOGGING && l.a.Log(Ar(\"importScene\", o ? o.producer : \"Unknown\") + (Ft.loggingLevel !== Ft.MINIMAL_LOGGING ? i : \"\"));\n          }\n          return !1;\n        }, loadAssetContainer: function(r, t, e, n) {\n          return wu(r, t, e, n);\n        } });\n        var R_ = f(121), Fu = function() {\n          function r(t) {\n            t === void 0 && (t = {}), this._isEnabled = !0, this.bias = t.bias === void 0 ? 0 : t.bias, this.power = t.power === void 0 ? 1 : t.power, this.leftColor = t.leftColor || I.a.White(), this.rightColor = t.rightColor || I.a.Black(), t.isEnabled === !1 && (this.isEnabled = !1);\n          }\n          return Object.defineProperty(r.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(t) {\n            this._isEnabled !== t && (this._isEnabled = t, Ue.a.MarkAllMaterialsAsDirty(h.a.MATERIAL_FresnelDirtyFlag | h.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.equals = function(t) {\n            return t && this.bias === t.bias && this.power === t.power && this.leftColor.equals(t.leftColor) && this.rightColor.equals(t.rightColor) && this.isEnabled === t.isEnabled;\n          }, r.prototype.serialize = function() {\n            return { isEnabled: this.isEnabled, leftColor: this.leftColor.asArray(), rightColor: this.rightColor.asArray(), bias: this.bias, power: this.power };\n          }, r.Parse = function(t) {\n            return new r({ isEnabled: t.isEnabled, leftColor: I.a.FromArray(t.leftColor), rightColor: I.a.FromArray(t.rightColor), bias: t.bias, power: t.power || 1 });\n          }, r;\n        }();\n        L.a._FresnelParametersParser = Fu.Parse;\n        var Bu = f(119), Us = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.maxSimultaneousLights = 4, i.disableLighting = !1, i.invertNormalMapX = !1, i.invertNormalMapY = !1, i.emissiveColor = new I.a(0, 0, 0), i.occlusionStrength = 1, i.useLightmapAsShadowmap = !1, i._useAlphaFromAlbedoTexture = !0, i._useAmbientInGrayScale = !0, i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"doubleSided\", { get: function() {\n            return this._twoSidedLighting;\n          }, set: function(e) {\n            this._twoSidedLighting !== e && (this._twoSidedLighting = e, this.backFaceCulling = !e, this._markAllSubMeshesAsTexturesDirty());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PBRBaseSimpleMaterial\";\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"maxSimultaneousLights\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"disableLighting\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectionTexture\")], t.prototype, \"environmentTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapX\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapY\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_bumpTexture\")], t.prototype, \"normalTexture\", void 0), Object(c.c)([Object(L.e)(\"emissive\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTextureStrength\")], t.prototype, \"occlusionStrength\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTexture\")], t.prototype, \"occlusionTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_alphaCutOff\")], t.prototype, \"alphaCutOff\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"doubleSided\", null), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", null)], t.prototype, \"lightmapTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useLightmapAsShadowmap\", void 0), t;\n        }(pn), Uu = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i._useRoughnessFromMetallicTextureAlpha = !1, i._useRoughnessFromMetallicTextureGreen = !0, i._useMetallnessFromMetallicTextureBlue = !0, i.metallic = 1, i.roughness = 1, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PBRMetallicRoughnessMaterial\";\n          }, t.prototype.clone = function(e) {\n            var n = this, i = L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n            return i.id = e, i.name = e, this.clearCoat.copyTo(i.clearCoat), this.anisotropy.copyTo(i.anisotropy), this.brdf.copyTo(i.brdf), this.sheen.copyTo(i.sheen), this.subSurface.copyTo(i.subSurface), i;\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.PBRMetallicRoughnessMaterial\", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return e.clearCoat && o.clearCoat.parse(e.clearCoat, n, i), e.anisotropy && o.anisotropy.parse(e.anisotropy, n, i), e.brdf && o.brdf.parse(e.brdf, n, i), e.sheen && o.sheen.parse(e.sheen, n, i), e.subSurface && o.subSurface.parse(e.subSurface, n, i), o;\n          }, Object(c.c)([Object(L.e)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoColor\")], t.prototype, \"baseColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoTexture\")], t.prototype, \"baseTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallic\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"roughness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_metallicTexture\")], t.prototype, \"metallicRoughnessTexture\", void 0), t;\n        }(Us);\n        O.a.RegisteredTypes[\"BABYLON.PBRMetallicRoughnessMaterial\"] = Uu;\n        var Vu = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i._useMicroSurfaceFromReflectivityMapAlpha = !0, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PBRSpecularGlossinessMaterial\";\n          }, t.prototype.clone = function(e) {\n            var n = this, i = L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n            return i.id = e, i.name = e, this.clearCoat.copyTo(i.clearCoat), this.anisotropy.copyTo(i.anisotropy), this.brdf.copyTo(i.brdf), this.sheen.copyTo(i.sheen), this.subSurface.copyTo(i.subSurface), i;\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.PBRSpecularGlossinessMaterial\", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return e.clearCoat && o.clearCoat.parse(e.clearCoat, n, i), e.anisotropy && o.anisotropy.parse(e.anisotropy, n, i), e.brdf && o.brdf.parse(e.brdf, n, i), e.sheen && o.sheen.parse(e.sheen, n, i), e.subSurface && o.subSurface.parse(e.subSurface, n, i), o;\n          }, Object(c.c)([Object(L.e)(\"diffuse\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoColor\")], t.prototype, \"diffuseColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoTexture\")], t.prototype, \"diffuseTexture\", void 0), Object(c.c)([Object(L.e)(\"specular\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectivityColor\")], t.prototype, \"specularColor\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_microSurface\")], t.prototype, \"glossiness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectivityTexture\")], t.prototype, \"specularGlossinessTexture\", void 0), t;\n        }(Us);\n        O.a.RegisteredTypes[\"BABYLON.PBRSpecularGlossinessMaterial\"] = Vu;\n        var ea = f(73), ku = function(r) {\n          function t(e, n, i) {\n            i === void 0 && (i = null);\n            var o = r.call(this, n) || this;\n            if (!e)\n              return o;\n            if (o._textureMatrix = u.a.Identity(), o.name = e, o.url = e, o._onLoad = i, o._texture = o._getFromCache(e, !0), o._texture)\n              o._triggerOnLoad();\n            else {\n              var a = o.getScene();\n              a && a.useDelayedTextureLoading ? o.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : o.loadTexture();\n            }\n            return o;\n          }\n          return Object(c.d)(t, r), t.prototype._triggerOnLoad = function() {\n            this._onLoad && this._onLoad();\n          }, t.prototype.getTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.load3dlTexture = function() {\n            var e, n = this, i = this._getEngine();\n            e = i.webGLVersion === 1 ? i.createRawTexture(null, 1, 1, h.a.TEXTUREFORMAT_RGBA, !1, !1, h.a.TEXTURE_BILINEAR_SAMPLINGMODE, null, h.a.TEXTURETYPE_UNSIGNED_INT) : i.createRawTexture3D(null, 1, 1, 1, h.a.TEXTUREFORMAT_RGBA, !1, !1, h.a.TEXTURE_BILINEAR_SAMPLINGMODE, null, h.a.TEXTURETYPE_UNSIGNED_INT), this._texture = e, this._texture.isReady = !1, this.isCube = !1, this.is3D = i.webGLVersion > 1, this.wrapU = h.a.TEXTURE_CLAMP_ADDRESSMODE, this.wrapV = h.a.TEXTURE_CLAMP_ADDRESSMODE, this.wrapR = h.a.TEXTURE_CLAMP_ADDRESSMODE, this.anisotropicFilteringLevel = 1;\n            var o = function(s) {\n              if (typeof s == \"string\") {\n                for (var d, p = null, y = null, P = s.split(`\n`), R = 0, B = 0, F = 0, z = 0, J = 0, ie = 0; ie < P.length; ie++)\n                  if (d = P[ie], t._noneEmptyLineRegex.test(d) && d.indexOf(\"#\") !== 0) {\n                    var se = d.split(\" \");\n                    if (R !== 0) {\n                      if (R != 0) {\n                        var ce = Math.max(parseInt(se[0]), 0), ue = Math.max(parseInt(se[1]), 0), fe = Math.max(parseInt(se[2]), 0);\n                        J = Math.max(ce, J), J = Math.max(ue, J), J = Math.max(fe, J);\n                        var ve = 4 * (B + z * R + F * R * R);\n                        y && (y[ve + 0] = ce, y[ve + 1] = ue, y[ve + 2] = fe), ++F % R == 0 && (F = 0, ++z % R == 0 && (B++, z = 0));\n                      }\n                    } else\n                      R = se.length, p = new Uint8Array(R * R * R * 4), y = new Float32Array(R * R * R * 4);\n                  }\n                if (y && p)\n                  for (ie = 0; ie < y.length; ie++)\n                    if (ie > 0 && (ie + 1) % 4 == 0)\n                      p[ie] = 255;\n                    else {\n                      var Te = y[ie];\n                      p[ie] = Te / J * 255;\n                    }\n                e.is3D ? (e.updateSize(R, R, R), i.updateRawTexture3D(e, p, h.a.TEXTUREFORMAT_RGBA, !1)) : (e.updateSize(R * R, R), i.updateRawTexture(e, p, h.a.TEXTUREFORMAT_RGBA, !1)), e.isReady = !0, n._triggerOnLoad();\n              }\n            }, a = this.getScene();\n            return a ? a._loadFile(this.url, o) : i._loadFile(this.url, o), this._texture;\n          }, t.prototype.loadTexture = function() {\n            this.url && this.url.toLocaleLowerCase().indexOf(\".3dl\") == this.url.length - 4 && this.load3dlTexture();\n          }, t.prototype.clone = function() {\n            var e = new t(this.url, this.getScene() || this._getEngine());\n            return e.level = this.level, e;\n          }, t.prototype.delayLoad = function() {\n            this.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = h.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, !0), this._texture || this.loadTexture());\n          }, t.Parse = function(e, n) {\n            var i = null;\n            return e.name && !e.isRenderTarget && ((i = new t(e.name, n)).name = e.name, i.level = e.level), i;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = {};\n            return e.name = this.name, e.level = this.level, e.customType = \"BABYLON.ColorGradingTexture\", e;\n          }, t._noneEmptyLineRegex = /\\S+/, t;\n        }(kn.a);\n        O.a.RegisteredTypes[\"BABYLON.ColorGradingTexture\"] = ku;\n        var Gu = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            o === void 0 && (o = !1), a === void 0 && (a = !0), s === void 0 && (s = null), d === void 0 && (d = null);\n            var p = r.call(this, n) || this;\n            if (p._onLoad = null, p._onError = null, !e)\n              throw new Error(\"Image url is not set\");\n            return p._coordinatesMode = Ne.a.CUBIC_MODE, p.name = e, p.url = e, p._size = i, p._noMipmap = o, p.gammaSpace = a, p._onLoad = s, p._onError = d, p.hasAlpha = !1, p.isCube = !0, p._texture = p._getFromCache(e, p._noMipmap), p._texture ? s && (p._texture.isReady ? Xe.b.SetImmediate(function() {\n              return s();\n            }) : p._texture.onLoadedObservable.add(s)) : n.useDelayedTextureLoading ? p.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : p.loadImage(p.loadTexture.bind(p), p._onError), p;\n          }\n          return Object(c.d)(t, r), t.prototype.loadImage = function(e, n) {\n            var i = this, o = document.createElement(\"canvas\"), a = new Image();\n            a.addEventListener(\"load\", function() {\n              i._width = a.width, i._height = a.height, o.width = i._width, o.height = i._height;\n              var s = o.getContext(\"2d\");\n              s.drawImage(a, 0, 0);\n              var d = s.getImageData(0, 0, a.width, a.height);\n              i._buffer = d.data.buffer, o.remove(), e();\n            }), a.addEventListener(\"error\", function(s) {\n              n && n(i.getClassName() + \" could not be loaded\", s);\n            }), a.src = this.url;\n          }, t.prototype.loadTexture = function() {\n            var e = this, n = this.getScene();\n            n && (this._texture = n.getEngine().createRawCubeTextureFromUrl(this.url, n, this._size, h.a.TEXTUREFORMAT_RGB, n.getEngine().getCaps().textureFloat ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INTEGER, this._noMipmap, function() {\n              for (var i = e.getFloat32ArrayFromArrayBuffer(e._buffer), o = ws.ConvertPanoramaToCubemap(i, e._width, e._height, e._size), a = [], s = 0; s < 6; s++) {\n                var d = o[t._FacesMapping[s]];\n                a.push(d);\n              }\n              return a;\n            }, null, this._onLoad, this._onError));\n          }, t.prototype.getFloat32ArrayFromArrayBuffer = function(e) {\n            for (var n = new DataView(e), i = new Float32Array(3 * e.byteLength / 4), o = 0, a = 0; a < e.byteLength; a++)\n              (a + 1) % 4 != 0 && (i[o++] = n.getUint8(a) / 255);\n            return i;\n          }, t.prototype.getClassName = function() {\n            return \"EquiRectangularCubeTexture\";\n          }, t.prototype.clone = function() {\n            var e = this.getScene();\n            if (!e)\n              return this;\n            var n = new t(this.url, e, this._size, this._noMipmap, this.gammaSpace);\n            return n.level = this.level, n.wrapU = this.wrapU, n.wrapV = this.wrapV, n.coordinatesIndex = this.coordinatesIndex, n.coordinatesMode = this.coordinatesMode, n;\n          }, t._FacesMapping = [\"right\", \"left\", \"up\", \"down\", \"front\", \"back\"], t;\n        }(kn.a), O_ = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, i.scene || i.engine) || this;\n            return n && (i.engine || i.scene) && (i = Object(c.a)(Object(c.a)({}, t.DefaultOptions), i), o._generateMipMaps = i.generateMipMaps, o._samplingMode = i.samplingMode, o._textureMatrix = u.a.Identity(), o.name = e, o.element = n, o._isVideo = n instanceof HTMLVideoElement, o.anisotropicFilteringLevel = 1, o._createInternalTexture()), o;\n          }\n          return Object(c.d)(t, r), t.prototype._createInternalTexture = function() {\n            var e = 0, n = 0;\n            this._isVideo ? (e = this.element.videoWidth, n = this.element.videoHeight) : (e = this.element.width, n = this.element.height);\n            var i = this._getEngine();\n            i && (this._texture = i.createDynamicTexture(e, n, this._generateMipMaps, this._samplingMode)), this.update();\n          }, t.prototype.getTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.update = function(e) {\n            e === void 0 && (e = null);\n            var n = this._getEngine();\n            if (this._texture != null && n != null)\n              if (this._isVideo) {\n                var i = this.element;\n                if (i.readyState < i.HAVE_CURRENT_DATA)\n                  return;\n                n.updateVideoTexture(this._texture, i, e === null || e);\n              } else {\n                var o = this.element;\n                n.updateDynamicTexture(this._texture, o, e === null || e, !1);\n              }\n          }, t.DefaultOptions = { generateMipMaps: !1, samplingMode: h.a.TEXTURE_BILINEAR_SAMPLINGMODE, engine: null, scene: null }, t;\n        }(kn.a), ta = function() {\n          function r() {\n          }\n          return r.GetTGAHeader = function(t) {\n            var e = 0;\n            return { id_length: t[e++], colormap_type: t[e++], image_type: t[e++], colormap_index: t[e++] | t[e++] << 8, colormap_length: t[e++] | t[e++] << 8, colormap_size: t[e++], origin: [t[e++] | t[e++] << 8, t[e++] | t[e++] << 8], width: t[e++] | t[e++] << 8, height: t[e++] | t[e++] << 8, pixel_size: t[e++], flags: t[e++] };\n          }, r.UploadContent = function(t, e) {\n            if (e.length < 19)\n              l.a.Error(\"Unable to load TGA file - Not enough data to contain header\");\n            else {\n              var n = 18, i = r.GetTGAHeader(e);\n              if (i.id_length + n > e.length)\n                l.a.Error(\"Unable to load TGA file - Not enough data\");\n              else {\n                n += i.id_length;\n                var o, a = !1, s = !1, d = !1;\n                switch (i.image_type) {\n                  case r._TYPE_RLE_INDEXED:\n                    a = !0;\n                  case r._TYPE_INDEXED:\n                    s = !0;\n                    break;\n                  case r._TYPE_RLE_RGB:\n                    a = !0;\n                  case r._TYPE_RGB:\n                    break;\n                  case r._TYPE_RLE_GREY:\n                    a = !0;\n                  case r._TYPE_GREY:\n                    d = !0;\n                }\n                var p, y, P, R, B, F, z, J = i.pixel_size >> 3, ie = i.width * i.height * J;\n                if (s && (p = e.subarray(n, n += i.colormap_length * (i.colormap_size >> 3))), a) {\n                  var se, ce, ue;\n                  o = new Uint8Array(ie);\n                  for (var fe = 0, ve = new Uint8Array(J); n < ie && fe < ie; )\n                    if (ce = 1 + (127 & (se = e[n++])), 128 & se) {\n                      for (ue = 0; ue < J; ++ue)\n                        ve[ue] = e[n++];\n                      for (ue = 0; ue < ce; ++ue)\n                        o.set(ve, fe + ue * J);\n                      fe += J * ce;\n                    } else {\n                      for (ce *= J, ue = 0; ue < ce; ++ue)\n                        o[fe + ue] = e[n++];\n                      fe += ce;\n                    }\n                } else\n                  o = e.subarray(n, n += s ? i.width * i.height : ie);\n                switch ((i.flags & r._ORIGIN_MASK) >> r._ORIGIN_SHIFT) {\n                  default:\n                  case r._ORIGIN_UL:\n                    y = 0, R = 1, z = i.width, P = 0, B = 1, F = i.height;\n                    break;\n                  case r._ORIGIN_BL:\n                    y = 0, R = 1, z = i.width, P = i.height - 1, B = -1, F = -1;\n                    break;\n                  case r._ORIGIN_UR:\n                    y = i.width - 1, R = -1, z = -1, P = 0, B = 1, F = i.height;\n                    break;\n                  case r._ORIGIN_BR:\n                    y = i.width - 1, R = -1, z = -1, P = i.height - 1, B = -1, F = -1;\n                }\n                var Te = r[\"_getImageData\" + (d ? \"Grey\" : \"\") + i.pixel_size + \"bits\"](i, p, o, P, B, F, y, R, z);\n                t.getEngine()._uploadDataToTextureDirectly(t, Te);\n              }\n            }\n          }, r._getImageData8bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R, B = n, F = e, z = t.width, J = t.height, ie = 0, se = new Uint8Array(z * J * 4);\n            for (R = i; R !== a; R += o)\n              for (P = s; P !== p; P += d, ie++)\n                y = B[ie], se[4 * (P + z * R) + 3] = 255, se[4 * (P + z * R) + 2] = F[3 * y + 0], se[4 * (P + z * R) + 1] = F[3 * y + 1], se[4 * (P + z * R) + 0] = F[3 * y + 2];\n            return se;\n          }, r._getImageData16bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R, B = n, F = t.width, z = t.height, J = 0, ie = new Uint8Array(F * z * 4);\n            for (R = i; R !== a; R += o)\n              for (P = s; P !== p; P += d, J += 2) {\n                var se = 255 * ((31744 & (y = B[J + 0] + (B[J + 1] << 8))) >> 10) / 31 | 0, ce = 255 * ((992 & y) >> 5) / 31 | 0, ue = 255 * (31 & y) / 31 | 0;\n                ie[4 * (P + F * R) + 0] = se, ie[4 * (P + F * R) + 1] = ce, ie[4 * (P + F * R) + 2] = ue, ie[4 * (P + F * R) + 3] = 32768 & y ? 0 : 255;\n              }\n            return ie;\n          }, r._getImageData24bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R = n, B = t.width, F = t.height, z = 0, J = new Uint8Array(B * F * 4);\n            for (P = i; P !== a; P += o)\n              for (y = s; y !== p; y += d, z += 3)\n                J[4 * (y + B * P) + 3] = 255, J[4 * (y + B * P) + 2] = R[z + 0], J[4 * (y + B * P) + 1] = R[z + 1], J[4 * (y + B * P) + 0] = R[z + 2];\n            return J;\n          }, r._getImageData32bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R = n, B = t.width, F = t.height, z = 0, J = new Uint8Array(B * F * 4);\n            for (P = i; P !== a; P += o)\n              for (y = s; y !== p; y += d, z += 4)\n                J[4 * (y + B * P) + 2] = R[z + 0], J[4 * (y + B * P) + 1] = R[z + 1], J[4 * (y + B * P) + 0] = R[z + 2], J[4 * (y + B * P) + 3] = R[z + 3];\n            return J;\n          }, r._getImageDataGrey8bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R, B = n, F = t.width, z = t.height, J = 0, ie = new Uint8Array(F * z * 4);\n            for (R = i; R !== a; R += o)\n              for (P = s; P !== p; P += d, J++)\n                y = B[J], ie[4 * (P + F * R) + 0] = y, ie[4 * (P + F * R) + 1] = y, ie[4 * (P + F * R) + 2] = y, ie[4 * (P + F * R) + 3] = 255;\n            return ie;\n          }, r._getImageDataGrey16bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R = n, B = t.width, F = t.height, z = 0, J = new Uint8Array(B * F * 4);\n            for (P = i; P !== a; P += o)\n              for (y = s; y !== p; y += d, z += 2)\n                J[4 * (y + B * P) + 0] = R[z + 0], J[4 * (y + B * P) + 1] = R[z + 0], J[4 * (y + B * P) + 2] = R[z + 0], J[4 * (y + B * P) + 3] = R[z + 1];\n            return J;\n          }, r._TYPE_INDEXED = 1, r._TYPE_RGB = 2, r._TYPE_GREY = 3, r._TYPE_RLE_INDEXED = 9, r._TYPE_RLE_RGB = 10, r._TYPE_RLE_GREY = 11, r._ORIGIN_MASK = 48, r._ORIGIN_SHIFT = 4, r._ORIGIN_BL = 0, r._ORIGIN_BR = 1, r._ORIGIN_UL = 2, r._ORIGIN_UR = 3, r;\n        }(), zu = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".tga\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            throw \".env not supported in Cube.\";\n          }, r.prototype.loadData = function(t, e, n) {\n            var i = new Uint8Array(t.buffer, t.byteOffset, t.byteLength), o = ta.GetTGAHeader(i);\n            n(o.width, o.height, e.generateMipMaps, !1, function() {\n              ta.UploadContent(e, i);\n            });\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new zu());\n        var io, M_ = function() {\n        };\n        (function(r) {\n          r[r.cTFETC1 = 0] = \"cTFETC1\", r[r.cTFBC1 = 1] = \"cTFBC1\", r[r.cTFBC4 = 2] = \"cTFBC4\", r[r.cTFPVRTC1_4_OPAQUE_ONLY = 3] = \"cTFPVRTC1_4_OPAQUE_ONLY\", r[r.cTFBC7_M6_OPAQUE_ONLY = 4] = \"cTFBC7_M6_OPAQUE_ONLY\", r[r.cTFETC2 = 5] = \"cTFETC2\", r[r.cTFBC3 = 6] = \"cTFBC3\", r[r.cTFBC5 = 7] = \"cTFBC5\";\n        })(io || (io = {}));\n        var ro = function() {\n          function r() {\n          }\n          return r.GetInternalFormatFromBasisFormat = function(t) {\n            if (t === io.cTFETC1)\n              return 36196;\n            if (t === io.cTFBC1)\n              return 33776;\n            if (t === io.cTFBC3)\n              return 33779;\n            throw \"The chosen Basis transcoder format is not currently supported\";\n          }, r._CreateWorkerAsync = function() {\n            var t = this;\n            return this._WorkerPromise || (this._WorkerPromise = new Promise(function(e) {\n              t._Worker ? e(t._Worker) : Xe.b.LoadFileAsync(r.WasmModuleURL).then(function(n) {\n                var i = URL.createObjectURL(new Blob([\"(\" + I_ + \")()\"], { type: \"application/javascript\" }));\n                t._Worker = new Worker(i);\n                var o = function(a) {\n                  a.data.action === \"init\" && (t._Worker.removeEventListener(\"message\", o), e(t._Worker));\n                };\n                t._Worker.addEventListener(\"message\", o), t._Worker.postMessage({ action: \"init\", url: r.JSModuleURL, wasmBinary: n });\n              });\n            })), this._WorkerPromise;\n          }, r.TranscodeAsync = function(t, e) {\n            var n = this, i = t instanceof ArrayBuffer ? new Uint8Array(t) : t;\n            return new Promise(function(o, a) {\n              n._CreateWorkerAsync().then(function() {\n                var s = n._actionId++, d = function(y) {\n                  y.data.action === \"transcode\" && y.data.id === s && (n._Worker.removeEventListener(\"message\", d), y.data.success ? o(y.data) : a(\"Transcode is not supported on this device\"));\n                };\n                n._Worker.addEventListener(\"message\", d);\n                var p = new Uint8Array(i.byteLength);\n                p.set(new Uint8Array(i.buffer, i.byteOffset, i.byteLength)), n._Worker.postMessage({ action: \"transcode\", id: s, imageData: p, config: e, ignoreSupportedFormats: n._IgnoreSupportedFormats }, [p.buffer]);\n              });\n            });\n          }, r.LoadTextureFromTranscodeResult = function(t, e) {\n            for (var n, i = t.getEngine(), o = function() {\n              if (n = e.fileInfo.images[a].levels[0], t._invertVScale = t.invertY, e.format === -1)\n                if (t.type = h.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5, t.format = h.a.TEXTUREFORMAT_RGB, i.webGLVersion < 2 && ($.a.Log2(n.width) % 1 != 0 || $.a.Log2(n.height) % 1 != 0)) {\n                  var s = new Pt.a(i, Pt.b.Temp);\n                  t._invertVScale = t.invertY, s.type = h.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5, s.format = h.a.TEXTUREFORMAT_RGB, s.width = n.width + 3 & -4, s.height = n.height + 3 & -4, i._bindTextureDirectly(i._gl.TEXTURE_2D, s, !0), i._uploadDataToTextureDirectly(s, n.transcodedPixels, a, 0, h.a.TEXTUREFORMAT_RGB, !0), i._rescaleTexture(s, t, i.scenes[0], i._getInternalFormat(h.a.TEXTUREFORMAT_RGB), function() {\n                    i._releaseTexture(s), i._bindTextureDirectly(i._gl.TEXTURE_2D, t, !0);\n                  });\n                } else\n                  t._invertVScale = !t.invertY, t.width = n.width + 3 & -4, t.height = n.height + 3 & -4, i._uploadDataToTextureDirectly(t, n.transcodedPixels, a, 0, h.a.TEXTUREFORMAT_RGB, !0);\n              else\n                t.width = n.width, t.height = n.height, e.fileInfo.images[a].levels.forEach(function(d, p) {\n                  i._uploadCompressedDataToTextureDirectly(t, r.GetInternalFormatFromBasisFormat(e.format), d.width, d.height, d.transcodedPixels, a, p);\n                }), i.webGLVersion < 2 && ($.a.Log2(t.width) % 1 != 0 || $.a.Log2(t.height) % 1 != 0) && (Xe.b.Warn(\"Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1.\"), t._cachedWrapU = Ne.a.CLAMP_ADDRESSMODE, t._cachedWrapV = Ne.a.CLAMP_ADDRESSMODE);\n            }, a = 0; a < e.fileInfo.images.length; a++)\n              o();\n          }, r._IgnoreSupportedFormats = !1, r.JSModuleURL = \"https://preview.babylonjs.com/basisTranscoder/basis_transcoder.js\", r.WasmModuleURL = \"https://preview.babylonjs.com/basisTranscoder/basis_transcoder.wasm\", r._WorkerPromise = null, r._Worker = null, r._actionId = 0, r;\n        }();\n        function I_() {\n          var r = 0, t = 1, e = 5, n = 6, i = null;\n          function o(a, s, d, p, y) {\n            var P = a.getImageTranscodedSizeInBytes(s, d, p), R = new Uint8Array(P);\n            return a.transcodeImage(R, s, d, p, 1, 0) ? (y && (R = function(B, F, z, J) {\n              for (var ie = new Uint16Array(4), se = new Uint16Array(z * J), ce = z / 4, ue = J / 4, fe = 0; fe < ue; fe++)\n                for (var ve = 0; ve < ce; ve++) {\n                  var Te = F + 8 * (fe * ce + ve);\n                  ie[0] = B[Te] | B[Te + 1] << 8, ie[1] = B[Te + 2] | B[Te + 3] << 8, ie[2] = (2 * (31 & ie[0]) + 1 * (31 & ie[1])) / 3 | (2 * (2016 & ie[0]) + 1 * (2016 & ie[1])) / 3 & 2016 | (2 * (63488 & ie[0]) + 1 * (63488 & ie[1])) / 3 & 63488, ie[3] = (2 * (31 & ie[1]) + 1 * (31 & ie[0])) / 3 | (2 * (2016 & ie[1]) + 1 * (2016 & ie[0])) / 3 & 2016 | (2 * (63488 & ie[1]) + 1 * (63488 & ie[0])) / 3 & 63488;\n                  for (var Re = 0; Re < 4; Re++) {\n                    var Ae = B[Te + 4 + Re], Ee = (4 * fe + Re) * z + 4 * ve;\n                    se[Ee++] = ie[3 & Ae], se[Ee++] = ie[Ae >> 2 & 3], se[Ee++] = ie[Ae >> 4 & 3], se[Ee++] = ie[Ae >> 6 & 3];\n                  }\n                }\n              return se;\n            }(R, 0, a.getImageWidth(s, d) + 3 & -4, a.getImageHeight(s, d) + 3 & -4)), R) : null;\n          }\n          onmessage = function(a) {\n            if (a.data.action === \"init\")\n              i || (Module = { wasmBinary: a.data.wasmBinary }, importScripts(a.data.url), i = new Promise(function(fe) {\n                Module.onRuntimeInitialized = function() {\n                  Module.initializeBasis(), fe();\n                };\n              })), i.then(function() {\n                postMessage({ action: \"init\" });\n              });\n            else if (a.data.action === \"transcode\") {\n              var s = a.data.config, d = a.data.imageData, p = new Module.BasisFile(d), y = function(fe) {\n                for (var ve = fe.getHasAlpha(), Te = fe.getNumImages(), Re = [], Ae = 0; Ae < Te; Ae++) {\n                  for (var Ee = { levels: [] }, Se = fe.getNumLevels(Ae), De = 0; De < Se; De++) {\n                    var xe = { width: fe.getImageWidth(Ae, De), height: fe.getImageHeight(Ae, De) };\n                    Ee.levels.push(xe);\n                  }\n                  Re.push(Ee);\n                }\n                return { hasAlpha: ve, images: Re };\n              }(p), P = a.data.ignoreSupportedFormats ? null : function(fe, ve) {\n                var Te = null;\n                return fe.supportedCompressionFormats && (fe.supportedCompressionFormats.etc1 ? Te = r : fe.supportedCompressionFormats.s3tc ? Te = ve.hasAlpha ? n : t : fe.supportedCompressionFormats.pvrtc || fe.supportedCompressionFormats.etc2 && (Te = e)), Te;\n              }(a.data.config, y), R = !1;\n              P === null && (R = !0, P = y.hasAlpha ? n : t);\n              var B = !0;\n              p.startTranscoding() || (B = !1);\n              for (var F = [], z = 0; z < y.images.length && B; z++) {\n                var J = y.images[z];\n                if (s.loadSingleImage === void 0 || s.loadSingleImage === z) {\n                  var ie = J.levels.length;\n                  s.loadMipmapLevels === !1 && (ie = 1);\n                  for (var se = 0; se < ie; se++) {\n                    var ce = J.levels[se], ue = o(p, z, se, P, R);\n                    if (!ue) {\n                      B = !1;\n                      break;\n                    }\n                    ce.transcodedPixels = ue, F.push(ce.transcodedPixels.buffer);\n                  }\n                }\n              }\n              p.close(), p.delete(), R && (P = -1), B ? postMessage({ action: \"transcode\", success: B, id: a.data.id, fileInfo: y, format: P }, F) : postMessage({ action: \"transcode\", success: B, id: a.data.id });\n            }\n          };\n        }\n        var ju = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".basis\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            if (!Array.isArray(t)) {\n              var a = e.getEngine().getCaps(), s = { supportedCompressionFormats: { etc1: !!a.etc1, s3tc: !!a.s3tc, pvrtc: !!a.pvrtc, etc2: !!a.etc2 } };\n              ro.TranscodeAsync(t, s).then(function(d) {\n                var p = d.fileInfo.images[0].levels.length > 1 && e.generateMipMaps;\n                ro.LoadTextureFromTranscodeResult(e, d), e.getEngine()._setCubeMapTextureParams(e, p), e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i();\n              }).catch(function(d) {\n                Xe.b.Warn(\"Failed to transcode Basis file, transcoding may not be supported on this device\"), e.isReady = !0;\n              });\n            }\n          }, r.prototype.loadData = function(t, e, n) {\n            var i = e.getEngine().getCaps(), o = { supportedCompressionFormats: { etc1: !!i.etc1, s3tc: !!i.s3tc, pvrtc: !!i.pvrtc, etc2: !!i.etc2 } };\n            ro.TranscodeAsync(t, o).then(function(a) {\n              var s = a.fileInfo.images[0].levels[0], d = a.fileInfo.images[0].levels.length > 1 && e.generateMipMaps;\n              n(s.width, s.height, d, a.format !== -1, function() {\n                ro.LoadTextureFromTranscodeResult(e, a);\n              });\n            }).catch(function(a) {\n              Xe.b.Warn(\"Failed to transcode Basis file, transcoding may not be supported on this device\"), n(0, 0, !1, !1, function() {\n              });\n            });\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new ju());\n        var Vs = function(r) {\n          function t(e, n, i, o, a) {\n            var s = this, d = !(!a || !a.generateMipMaps) && a.generateMipMaps, p = !(!a || !a.generateDepthTexture) && a.generateDepthTexture, y = !a || a.doNotChangeAspectRatio === void 0 || a.doNotChangeAspectRatio;\n            if ((s = r.call(this, e, n, o, d, y) || this).isSupported) {\n              var P = [], R = [];\n              s._initTypes(i, P, R, a);\n              var B = !a || a.generateDepthBuffer === void 0 || a.generateDepthBuffer, F = !(!a || a.generateStencilBuffer === void 0) && a.generateStencilBuffer;\n              return s._size = n, s._multiRenderTargetOptions = { samplingModes: R, generateMipMaps: d, generateDepthBuffer: B, generateStencilBuffer: F, generateDepthTexture: p, types: P, textureCount: i }, s._count = i, s._createInternalTextures(), s._createTextures(), s;\n            }\n            s.dispose();\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"isSupported\", { get: function() {\n            return this._getEngine().webGLVersion > 1 || this._getEngine().getCaps().drawBuffersExtension;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"textures\", { get: function() {\n            return this._textures;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"count\", { get: function() {\n            return this._count;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthTexture\", { get: function() {\n            return this._textures[this._textures.length - 1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wrapU\", { set: function(e) {\n            if (this._textures)\n              for (var n = 0; n < this._textures.length; n++)\n                this._textures[n].wrapU = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wrapV\", { set: function(e) {\n            if (this._textures)\n              for (var n = 0; n < this._textures.length; n++)\n                this._textures[n].wrapV = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initTypes = function(e, n, i, o) {\n            for (var a = 0; a < e; a++)\n              o && o.types && o.types[a] !== void 0 ? n.push(o.types[a]) : n.push(o && o.defaultType ? o.defaultType : h.a.TEXTURETYPE_UNSIGNED_INT), o && o.samplingModes && o.samplingModes[a] !== void 0 ? i.push(o.samplingModes[a]) : i.push(Ne.a.BILINEAR_SAMPLINGMODE);\n          }, t.prototype._rebuild = function(e) {\n            e === void 0 && (e = !1), this.releaseInternalTextures(), this._createInternalTextures(), e && this._createTextures();\n            for (var n = 0; n < this._internalTextures.length; n++)\n              this._textures[n]._texture = this._internalTextures[n];\n            this._texture = this._internalTextures[0], this.samples !== 1 && this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures, this.samples);\n          }, t.prototype._createInternalTextures = function() {\n            this._internalTextures = this._getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions);\n          }, t.prototype._createTextures = function() {\n            this._textures = [];\n            for (var e = 0; e < this._internalTextures.length; e++) {\n              var n = new Ne.a(null, this.getScene());\n              n._texture = this._internalTextures[e], this._textures.push(n);\n            }\n            this._texture = this._internalTextures[0];\n          }, t.prototype.replaceTexture = function(e, n) {\n            e._texture && (this._textures[n] = e, this._internalTextures[n] = e._texture);\n          }, Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples !== e && (this._samples = this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures, e));\n          }, enumerable: !1, configurable: !0 }), t.prototype.resize = function(e) {\n            this._size = e, this._rebuild();\n          }, t.prototype.updateCount = function(e, n) {\n            this._multiRenderTargetOptions.textureCount = e, this._count = e;\n            var i = [], o = [];\n            this._initTypes(e, i, o, n), this._multiRenderTargetOptions.types = i, this._multiRenderTargetOptions.samplingModes = o, this._rebuild(!0);\n          }, t.prototype.unbindFrameBuffer = function(e, n) {\n            var i = this;\n            e.unBindMultiColorAttachmentFramebuffer(this._internalTextures, this.isCube, function() {\n              i.onAfterRenderObservable.notifyObservers(n);\n            });\n          }, t.prototype.dispose = function() {\n            this.releaseInternalTextures(), r.prototype.dispose.call(this);\n          }, t.prototype.releaseInternalTextures = function() {\n            if (this._internalTextures)\n              for (var e = this._internalTextures.length - 1; e >= 0; e--)\n                this._internalTextures[e] !== void 0 && (this._internalTextures[e].dispose(), this._internalTextures.splice(e, 1));\n          }, t;\n        }(on), ks = function(r, t, e) {\n          this.id = r, this.scale = t, this.offset = e;\n        }, D_ = function() {\n          function r(t, e, n, i) {\n            var o, a, s, d, p, y, P, R, B, F, z, J, ie;\n            return this.name = t, this.meshes = e, this.scene = i, this.options = n, this.options.map = (o = this.options.map) !== null && o !== void 0 ? o : [\"ambientTexture\", \"bumpTexture\", \"diffuseTexture\", \"emissiveTexture\", \"lightmapTexture\", \"opacityTexture\", \"reflectionTexture\", \"refractionTexture\", \"specularTexture\"], this.options.uvsIn = (a = this.options.uvsIn) !== null && a !== void 0 ? a : Oe.b.UVKind, this.options.uvsOut = (s = this.options.uvsOut) !== null && s !== void 0 ? s : Oe.b.UVKind, this.options.layout = (d = this.options.layout) !== null && d !== void 0 ? d : r.LAYOUT_STRIP, this.options.layout === r.LAYOUT_COLNUM && (this.options.colnum = (p = this.options.colnum) !== null && p !== void 0 ? p : 8), this.options.updateInputMeshes = (y = this.options.updateInputMeshes) === null || y === void 0 || y, this.options.disposeSources = (P = this.options.disposeSources) === null || P === void 0 || P, this._expecting = 0, this.options.fillBlanks = (R = this.options.fillBlanks) === null || R === void 0 || R, this.options.fillBlanks === !0 && (this.options.customFillColor = (B = this.options.customFillColor) !== null && B !== void 0 ? B : \"black\"), this.options.frameSize = (F = this.options.frameSize) !== null && F !== void 0 ? F : 256, this.options.paddingRatio = (z = this.options.paddingRatio) !== null && z !== void 0 ? z : 0.0115, this._paddingValue = Math.ceil(this.options.frameSize * this.options.paddingRatio), this._paddingValue % 2 != 0 && this._paddingValue++, this.options.paddingMode = (J = this.options.paddingMode) !== null && J !== void 0 ? J : r.SUBUV_WRAP, this.options.paddingMode === r.SUBUV_COLOR && (this.options.paddingColor = (ie = this.options.paddingColor) !== null && ie !== void 0 ? ie : new I.b(0, 0, 0, 1)), this.sets = {}, this.frames = [], this;\n          }\n          return r.prototype._createFrames = function(t) {\n            for (var e = this, n = this._calculateSize(), i = new u.d(1, 1).divide(n), o = 0, a = this._expecting, s = this.meshes.length, d = Object.keys(this.sets), p = 0; p < d.length; p++) {\n              var y = d[p], P = new pi.a(this.name + \".TexturePack.\" + y + \"Set\", { width: n.x, height: n.y }, this.scene, !0, Ne.a.TRILINEAR_SAMPLINGMODE, Ue.a.TEXTUREFORMAT_RGBA), R = P.getContext();\n              R.fillStyle = \"rgba(0,0,0,0)\", R.fillRect(0, 0, n.x, n.y), P.update(!1), this.sets[y] = P;\n            }\n            var B = this.options.frameSize || 256, F = this._paddingValue, z = B + 2 * F;\n            for (p = 0; p < s; p++)\n              for (var J = this.meshes[p].material, ie = function(ue) {\n                var fe = new pi.a(\"temp\", z, se.scene, !0), ve = fe.getContext(), Te = se._getFrameOffset(p), Re = function() {\n                  o++, fe.update(!1);\n                  var De = ve.getImageData(0, 0, z, z), xe = e.sets[Ae];\n                  if (xe.getContext().putImageData(De, n.x * Te.x, n.y * Te.y), fe.dispose(), xe.update(!1), o == a)\n                    return e._calculateMeshUVFrames(B, F, n, i, e.options.updateInputMeshes || !1), void t();\n                }, Ae = d[ue] || \"_blank\";\n                if (J && J[Ae] !== null) {\n                  var Ee = J[Ae], Se = new Image();\n                  Ee instanceof pi.a ? Se.src = Ee.getContext().canvas.toDataURL(\"image/png\") : Se.src = Ee.url, Xe.b.SetCorsBehavior(Se.src, Se), Se.onload = function() {\n                    ve.fillStyle = \"rgba(0,0,0,0)\", ve.fillRect(0, 0, z, z), fe.update(!1), ve.setTransform(1, 0, 0, -1, 0, 0);\n                    var De = [0, 0, 1, 0, 1, 1, 0, 1, -1, 1, -1, 0, -2, 0, -1, 1, -1];\n                    switch (e.options.paddingMode) {\n                      case 0:\n                        for (var xe = 0; xe < 9; xe++)\n                          ve.drawImage(Se, 0, 0, Se.width, Se.height, F + B * De[xe], F + B * De[xe + 1] - z, B, B);\n                        break;\n                      case 1:\n                        for (var Le = 0; Le < F; Le++)\n                          ve.drawImage(Se, 0, 0, Se.width, Se.height, Le + B * De[0], F - z, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, 2 * F - Le, F - z, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, F, Le - z, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, F, 2 * F - Le - z, B, B);\n                        ve.drawImage(Se, 0, 0, Se.width, Se.height, F + B * De[0], F + B * De[1] - z, B, B);\n                        break;\n                      case 2:\n                        ve.fillStyle = (e.options.paddingColor || I.a.Black()).toHexString(), ve.fillRect(0, 0, z, -z), ve.clearRect(F, F, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, F + B * De[0], F + B * De[1] - z, B, B);\n                    }\n                    ve.setTransform(1, 0, 0, 1, 0, 0), Re();\n                  };\n                } else\n                  ve.fillStyle = \"rgba(0,0,0,0)\", se.options.fillBlanks && (ve.fillStyle = se.options.customFillColor), ve.fillRect(0, 0, z, z), Re();\n              }, se = this, ce = 0; ce < d.length; ce++)\n                ie(ce);\n          }, r.prototype._calculateSize = function() {\n            var t = this.meshes.length || 0, e = this.options.frameSize || 0, n = this._paddingValue || 0;\n            switch (this.options.layout) {\n              case 0:\n                return new u.d(e * t + 2 * n * t, e + 2 * n);\n              case 1:\n                var i = Math.max(2, Math.ceil(Math.sqrt(t))), o = e * i + 2 * n * i;\n                return new u.d(o, o);\n              case 2:\n                var a = this.options.colnum || 1, s = Math.max(1, Math.ceil(t / a));\n                return new u.d(e * a + 2 * n * a, e * s + 2 * n * s);\n            }\n            return u.d.Zero();\n          }, r.prototype._calculateMeshUVFrames = function(t, e, n, i, o) {\n            for (var a = this.meshes.length, s = 0; s < a; s++) {\n              var d = this.meshes[s], p = new u.d(t / n.x, t / n.y), y = i.clone().scale(e), P = this._getFrameOffset(s).add(y), R = new ks(s, p, P);\n              this.frames.push(R), o && (this._updateMeshUV(d, s), this._updateTextureReferences(d));\n            }\n          }, r.prototype._getFrameOffset = function(t) {\n            var e, n, i, o = this.meshes.length;\n            switch (this.options.layout) {\n              case 0:\n                return e = 1 / o, new u.d(t * e, 0);\n              case 1:\n                var a = Math.max(2, Math.ceil(Math.sqrt(o)));\n                return i = t - (n = Math.floor(t / a)) * a, e = 1 / a, new u.d(i * e, n * e);\n              case 2:\n                var s = this.options.colnum || 1, d = Math.max(1, Math.ceil(o / s));\n                return n = t - (i = Math.floor(t / d)) * d, e = new u.d(1 / s, 1 / d), new u.d(i * e.x, n * e.y);\n            }\n            return u.d.Zero();\n          }, r.prototype._updateMeshUV = function(t, e) {\n            var n = this.frames[e], i = t.getVerticesData(this.options.uvsIn || Oe.b.UVKind), o = [], a = 0;\n            i.length && (a = i.length || 0);\n            for (var s = 0; s < a; s += 2)\n              o.push(i[s] * n.scale.x + n.offset.x, i[s + 1] * n.scale.y + n.offset.y);\n            t.setVerticesData(this.options.uvsOut || Oe.b.UVKind, o);\n          }, r.prototype._updateTextureReferences = function(t, e) {\n            e === void 0 && (e = !1);\n            for (var n = t.material, i = Object.keys(this.sets), o = function(d) {\n              d.dispose && d.dispose();\n            }, a = 0; a < i.length; a++) {\n              var s = i[a];\n              if (e)\n                n[s] !== null && o(n[s]), n[s] = this.sets[s];\n              else {\n                if (!n)\n                  return;\n                n[s] !== null && (o(n[s]), n[s] = this.sets[s]);\n              }\n            }\n          }, r.prototype.setMeshToFrame = function(t, e, n) {\n            n === void 0 && (n = !1), this._updateMeshUV(t, e), n && this._updateTextureReferences(t, !0);\n          }, r.prototype.processAsync = function() {\n            var t = this;\n            return new Promise(function(e, n) {\n              try {\n                if (t.meshes.length === 0)\n                  return void e();\n                for (var i = 0, o = function(d) {\n                  var p = t.meshes[d], y = p.material;\n                  if (!y)\n                    return ++i === t.meshes.length ? { value: t._createFrames(e) } : \"continue\";\n                  y.forceCompilationAsync(p).then(function() {\n                    (function(P) {\n                      if (i++, t.options.map) {\n                        for (var R = 0; R < t.options.map.length; R++)\n                          P[t.options.map[R]] !== null && (t.sets[t.options.map[R]] || (t.sets[t.options.map[R]] = !0), t._expecting++);\n                        i === t.meshes.length && t._createFrames(e);\n                      }\n                    })(y);\n                  });\n                }, a = 0; a < t.meshes.length; a++) {\n                  var s = o(a);\n                  if (typeof s == \"object\")\n                    return s.value;\n                }\n              } catch (d) {\n                return n(d);\n              }\n            });\n          }, r.prototype.dispose = function() {\n            for (var t = Object.keys(this.sets), e = 0; e < t.length; e++) {\n              var n = t[e];\n              this.sets[n].dispose();\n            }\n          }, r.prototype.download = function(t, e) {\n            var n = this;\n            t === void 0 && (t = \"png\"), e === void 0 && (e = 1), setTimeout(function() {\n              var i = { name: n.name, sets: {}, options: {}, frames: [] }, o = Object.keys(n.sets), a = Object.keys(n.options);\n              try {\n                for (var s = 0; s < o.length; s++) {\n                  var d = o[s], p = n.sets[d];\n                  i.sets[d] = p.getContext().canvas.toDataURL(\"image/\" + t, e);\n                }\n                for (s = 0; s < a.length; s++) {\n                  var y = a[s];\n                  i.options[y] = n.options[y];\n                }\n                for (s = 0; s < n.frames.length; s++) {\n                  var P = n.frames[s];\n                  i.frames.push(P.scale.x, P.scale.y, P.offset.x, P.offset.y);\n                }\n              } catch (F) {\n                return void l.a.Warn(\"Unable to download: \" + F);\n              }\n              var R = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(i, null, 4)), B = document.createElement(\"a\");\n              B.setAttribute(\"href\", R), B.setAttribute(\"download\", n.name + \"_texurePackage.json\"), document.body.appendChild(B), B.click(), B.remove();\n            }, 0);\n          }, r.prototype.updateFromJSON = function(t) {\n            try {\n              var e = JSON.parse(t);\n              this.name = e.name;\n              for (var n = Object.keys(e.options), i = 0; i < n.length; i++)\n                this.options[n[i]] = e.options[n[i]];\n              for (i = 0; i < e.frames.length; i += 4) {\n                var o = new ks(i / 4, new u.d(e.frames[i], e.frames[i + 1]), new u.d(e.frames[i + 2], e.frames[i + 3]));\n                this.frames.push(o);\n              }\n              var a = Object.keys(e.sets);\n              for (i = 0; i < a.length; i++) {\n                var s = new Ne.a(e.sets[a[i]], this.scene, !1, !1);\n                this.sets[a[i]] = s;\n              }\n            } catch (d) {\n              l.a.Warn(\"Unable to update from JSON: \" + d);\n            }\n          }, r.LAYOUT_STRIP = 0, r.LAYOUT_POWER2 = 1, r.LAYOUT_COLNUM = 2, r.SUBUV_WRAP = 0, r.SUBUV_EXTEND = 1, r.SUBUV_COLOR = 2, r;\n        }(), Hu = function() {\n          function r(t) {\n            this.name = ot.a.NAME_PROCEDURALTEXTURE, this.scene = t, this.scene.proceduralTextures = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeClearStage.registerStep(ot.a.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._beforeClear = function() {\n            if (this.scene.proceduralTexturesEnabled) {\n              Xe.b.StartPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n              for (var t = 0; t < this.scene.proceduralTextures.length; t++) {\n                var e = this.scene.proceduralTextures[t];\n                e._shouldRender() && e.render();\n              }\n              Xe.b.EndPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n            }\n          }, r;\n        }(), L_ = `\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.proceduralVertexShader = L_;\n        var oo = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            a === void 0 && (a = null), s === void 0 && (s = !0), d === void 0 && (d = !1), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, null, o, !s) || this;\n            y.isEnabled = !0, y.autoClear = !0, y.onGeneratedObservable = new C.c(), y.onBeforeGenerationObservable = new C.c(), y.nodeMaterialSource = null, y._textures = {}, y._currentRefreshId = -1, y._frameId = -1, y._refreshRate = 1, y._vertexBuffers = {}, y._uniforms = new Array(), y._samplers = new Array(), y._floats = {}, y._ints = {}, y._floatsArrays = {}, y._colors3 = {}, y._colors4 = {}, y._vectors2 = {}, y._vectors3 = {}, y._matrices = {}, y._fallbackTextureUsed = !1, y._cachedDefines = \"\", y._contentUpdateId = -1;\n            var P = (o = y.getScene() || te.a.LastCreatedScene)._getComponent(ot.a.NAME_PROCEDURALTEXTURE);\n            P || (P = new Hu(o), o._addComponent(P)), o.proceduralTextures.push(y), y._fullEngine = o.getEngine(), y.name = e, y.isRenderTarget = !0, y._size = n, y._generateMipMaps = s, y.setFragment(i), y._fallbackTexture = a, d ? (y._texture = y._fullEngine.createRenderTargetCubeTexture(n, { generateMipMaps: s, generateDepthBuffer: !1, generateStencilBuffer: !1, type: p }), y.setFloat(\"face\", 0)) : y._texture = y._fullEngine.createRenderTargetTexture(n, { generateMipMaps: s, generateDepthBuffer: !1, generateStencilBuffer: !1, type: p });\n            var R = [];\n            return R.push(1, 1), R.push(-1, 1), R.push(-1, -1), R.push(1, -1), y._vertexBuffers[Oe.b.PositionKind] = new Oe.b(y._fullEngine, R, Oe.b.PositionKind, !1, !1, 2), y._createIndexBuffer(), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getEffect = function() {\n            return this._effect;\n          }, t.prototype.getContent = function() {\n            return this._contentData && this._frameId === this._contentUpdateId || (this._contentData = this.readPixels(0, 0, this._contentData), this._contentUpdateId = this._frameId), this._contentData;\n          }, t.prototype._createIndexBuffer = function() {\n            var e = this._fullEngine, n = [];\n            n.push(0), n.push(1), n.push(2), n.push(0), n.push(2), n.push(3), this._indexBuffer = e.createIndexBuffer(n);\n          }, t.prototype._rebuild = function() {\n            var e = this._vertexBuffers[Oe.b.PositionKind];\n            e && e._rebuild(), this._createIndexBuffer(), this.refreshRate === on.REFRESHRATE_RENDER_ONCE && (this.refreshRate = on.REFRESHRATE_RENDER_ONCE);\n          }, t.prototype.reset = function() {\n            this._effect !== void 0 && this._effect.dispose();\n          }, t.prototype._getDefines = function() {\n            return \"\";\n          }, t.prototype.isReady = function() {\n            var e, n = this, i = this._fullEngine;\n            if (this.nodeMaterialSource)\n              return this._effect.isReady();\n            if (!this._fragment)\n              return !1;\n            if (this._fallbackTextureUsed)\n              return !0;\n            var o = this._getDefines();\n            return !(!this._effect || o !== this._cachedDefines || !this._effect.isReady()) || (e = this._fragment.fragmentElement !== void 0 ? { vertex: \"procedural\", fragmentElement: this._fragment.fragmentElement } : { vertex: \"procedural\", fragment: this._fragment }, this._cachedDefines = o, this._effect = i.createEffect(e, [Oe.b.PositionKind], this._uniforms, this._samplers, o, void 0, void 0, function() {\n              n.releaseInternalTexture(), n._fallbackTexture && (n._texture = n._fallbackTexture._texture, n._texture && n._texture.incrementReferences()), n._fallbackTextureUsed = !0;\n            }), this._effect.isReady());\n          }, t.prototype.resetRefreshCounter = function() {\n            this._currentRefreshId = -1;\n          }, t.prototype.setFragment = function(e) {\n            this._fragment = e;\n          }, Object.defineProperty(t.prototype, \"refreshRate\", { get: function() {\n            return this._refreshRate;\n          }, set: function(e) {\n            this._refreshRate = e, this.resetRefreshCounter();\n          }, enumerable: !1, configurable: !0 }), t.prototype._shouldRender = function() {\n            return this.isEnabled && this.isReady() && this._texture ? !this._fallbackTextureUsed && (this._currentRefreshId === -1 || this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, this._frameId++, !0) : (this._currentRefreshId++, !1)) : (this._texture && (this._texture.isReady = !1), !1);\n          }, t.prototype.getRenderSize = function() {\n            return this._size;\n          }, t.prototype.resize = function(e, n) {\n            this._fallbackTextureUsed || (this.releaseInternalTexture(), this._texture = this._fullEngine.createRenderTargetTexture(e, n), this._size = e, this._generateMipMaps = n);\n          }, t.prototype._checkUniform = function(e) {\n            this._uniforms.indexOf(e) === -1 && this._uniforms.push(e);\n          }, t.prototype.setTexture = function(e, n) {\n            return this._samplers.indexOf(e) === -1 && this._samplers.push(e), this._textures[e] = n, this;\n          }, t.prototype.setFloat = function(e, n) {\n            return this._checkUniform(e), this._floats[e] = n, this;\n          }, t.prototype.setInt = function(e, n) {\n            return this._checkUniform(e), this._ints[e] = n, this;\n          }, t.prototype.setFloats = function(e, n) {\n            return this._checkUniform(e), this._floatsArrays[e] = n, this;\n          }, t.prototype.setColor3 = function(e, n) {\n            return this._checkUniform(e), this._colors3[e] = n, this;\n          }, t.prototype.setColor4 = function(e, n) {\n            return this._checkUniform(e), this._colors4[e] = n, this;\n          }, t.prototype.setVector2 = function(e, n) {\n            return this._checkUniform(e), this._vectors2[e] = n, this;\n          }, t.prototype.setVector3 = function(e, n) {\n            return this._checkUniform(e), this._vectors3[e] = n, this;\n          }, t.prototype.setMatrix = function(e, n) {\n            return this._checkUniform(e), this._matrices[e] = n, this;\n          }, t.prototype.render = function(e) {\n            var n = this.getScene();\n            if (n) {\n              var i = this._fullEngine;\n              if (i.enableEffect(this._effect), this.onBeforeGenerationObservable.notifyObservers(this), i.setState(!1), !this.nodeMaterialSource) {\n                for (var o in this._textures)\n                  this._effect.setTexture(o, this._textures[o]);\n                for (o in this._ints)\n                  this._effect.setInt(o, this._ints[o]);\n                for (o in this._floats)\n                  this._effect.setFloat(o, this._floats[o]);\n                for (o in this._floatsArrays)\n                  this._effect.setArray(o, this._floatsArrays[o]);\n                for (o in this._colors3)\n                  this._effect.setColor3(o, this._colors3[o]);\n                for (o in this._colors4) {\n                  var a = this._colors4[o];\n                  this._effect.setFloat4(o, a.r, a.g, a.b, a.a);\n                }\n                for (o in this._vectors2)\n                  this._effect.setVector2(o, this._vectors2[o]);\n                for (o in this._vectors3)\n                  this._effect.setVector3(o, this._vectors3[o]);\n                for (o in this._matrices)\n                  this._effect.setMatrix(o, this._matrices[o]);\n              }\n              if (this._texture) {\n                if (this.isCube)\n                  for (var s = 0; s < 6; s++)\n                    i.bindFramebuffer(this._texture, s, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect), this._effect.setFloat(\"face\", s), this.autoClear && i.clear(n.clearColor, !0, !1, !1), i.drawElementsType(zt.a.TriangleFillMode, 0, 6), s === 5 && i.generateMipMapsForCubemap(this._texture);\n                else\n                  i.bindFramebuffer(this._texture, 0, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect), this.autoClear && i.clear(n.clearColor, !0, !1, !1), i.drawElementsType(zt.a.TriangleFillMode, 0, 6);\n                i.unBindFramebuffer(this._texture, this.isCube), this.onGenerated && this.onGenerated(), this.onGeneratedObservable.notifyObservers(this);\n              }\n            }\n          }, t.prototype.clone = function() {\n            var e = this.getSize(), n = new t(this.name, e.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps);\n            return n.hasAlpha = this.hasAlpha, n.level = this.level, n.coordinatesMode = this.coordinatesMode, n;\n          }, t.prototype.dispose = function() {\n            var e = this.getScene();\n            if (e) {\n              var n = e.proceduralTextures.indexOf(this);\n              n >= 0 && e.proceduralTextures.splice(n, 1);\n              var i = this._vertexBuffers[Oe.b.PositionKind];\n              i && (i.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && this._fullEngine._releaseBuffer(this._indexBuffer) && (this._indexBuffer = null), this.onGeneratedObservable.clear(), this.onBeforeGenerationObservable.clear(), r.prototype.dispose.call(this);\n            }\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"autoClear\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_generateMipMaps\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_size\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"refreshRate\", null), t;\n        }(Ne.a);\n        O.a.RegisteredTypes[\"BABYLON.ProceduralTexture\"] = oo;\n        var N_ = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, i, null, o, a, s) || this;\n            return d._animate = !0, d._time = 0, d._texturePath = n, d._loadJson(n), d.refreshRate = 1, d;\n          }\n          return Object(c.d)(t, r), t.prototype._loadJson = function(e) {\n            var n = this, i = function() {\n              try {\n                n.setFragment(n._texturePath);\n              } catch {\n                l.a.Error(\"No json or ShaderStore or DOM element found for CustomProceduralTexture\");\n              }\n            }, o = e + \"/config.json\", a = new re.a();\n            a.open(\"GET\", o), a.addEventListener(\"load\", function() {\n              if (a.status === 200 || a.responseText && a.responseText.length > 0)\n                try {\n                  n._config = JSON.parse(a.response), n.updateShaderUniforms(), n.updateTextures(), n.setFragment(n._texturePath + \"/custom\"), n._animate = n._config.animate, n.refreshRate = n._config.refreshrate;\n                } catch {\n                  i();\n                }\n              else\n                i();\n            }, !1), a.addEventListener(\"error\", function() {\n              i();\n            }, !1);\n            try {\n              a.send();\n            } catch {\n              l.a.Error(\"CustomProceduralTexture: Error on XHR send request.\");\n            }\n          }, t.prototype.isReady = function() {\n            if (!r.prototype.isReady.call(this))\n              return !1;\n            for (var e in this._textures)\n              if (!this._textures[e].isReady())\n                return !1;\n            return !0;\n          }, t.prototype.render = function(e) {\n            var n = this.getScene();\n            this._animate && n && (this._time += 0.03 * n.getAnimationRatio(), this.updateShaderUniforms()), r.prototype.render.call(this, e);\n          }, t.prototype.updateTextures = function() {\n            for (var e = 0; e < this._config.sampler2Ds.length; e++)\n              this.setTexture(this._config.sampler2Ds[e].sample2Dname, new Ne.a(this._texturePath + \"/\" + this._config.sampler2Ds[e].textureRelativeUrl, this.getScene()));\n          }, t.prototype.updateShaderUniforms = function() {\n            if (this._config)\n              for (var e = 0; e < this._config.uniforms.length; e++) {\n                var n = this._config.uniforms[e];\n                switch (n.type) {\n                  case \"float\":\n                    this.setFloat(n.name, n.value);\n                    break;\n                  case \"color3\":\n                    this.setColor3(n.name, new I.a(n.r, n.g, n.b));\n                    break;\n                  case \"color4\":\n                    this.setColor4(n.name, new I.b(n.r, n.g, n.b, n.a));\n                    break;\n                  case \"vector2\":\n                    this.setVector2(n.name, new u.d(n.x, n.y));\n                    break;\n                  case \"vector3\":\n                    this.setVector3(n.name, new u.e(n.x, n.y, n.z));\n                }\n              }\n            this.setFloat(\"time\", this._time);\n          }, Object.defineProperty(t.prototype, \"animate\", { get: function() {\n            return this._animate;\n          }, set: function(e) {\n            this._animate = e;\n          }, enumerable: !1, configurable: !0 }), t;\n        }(oo), w_ = `\n\nuniform float brightness;\nuniform float persistence;\nuniform float timeScale;\n\nvarying vec2 vUV;\n\nvec2 hash22(vec2 p)\n{\np=p*mat2(127.1,311.7,269.5,183.3);\np=-1.0+2.0*fract(sin(p)*43758.5453123);\nreturn sin(p*6.283+timeScale);\n}\nfloat interpolationNoise(vec2 p)\n{\nvec2 pi=floor(p);\nvec2 pf=p-pi;\nvec2 w=pf*pf*(3.-2.*pf);\nfloat f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));\nfloat f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));\nfloat f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));\nfloat f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));\nfloat xm1=mix(f00,f10,w.x);\nfloat xm2=mix(f01,f11,w.x);\nfloat ym=mix(xm1,xm2,w.y);\nreturn ym;\n}\nfloat perlinNoise2D(float x,float y)\n{\nfloat sum=0.0;\nfloat frequency=0.0;\nfloat amplitude=0.0;\nfor(int i=0; i<OCTAVES; i++)\n{\nfrequency=pow(2.0,float(i));\namplitude=pow(persistence,float(i));\nsum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;\n}\nreturn sum;\n}\n\nvoid main(void)\n{\nfloat x=abs(vUV.x);\nfloat y=abs(vUV.y);\nfloat noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);\ngl_FragColor=vec4(noise,noise,noise,1.0);\n}\n`;\n        ze.a.ShadersStore.noisePixelShader = w_;\n        var Wu = function(r) {\n          function t(e, n, i, o, a) {\n            n === void 0 && (n = 256), i === void 0 && (i = te.a.LastCreatedScene);\n            var s = r.call(this, e, n, \"noise\", i, o, a) || this;\n            return s.time = 0, s.brightness = 0.2, s.octaves = 3, s.persistence = 0.8, s.animationSpeedFactor = 1, s.autoClear = !1, s._updateShaderUniforms(), s;\n          }\n          return Object(c.d)(t, r), t.prototype._updateShaderUniforms = function() {\n            var e = this.getScene();\n            e && (this.time += e.getAnimationRatio() * this.animationSpeedFactor * 0.01, this.setFloat(\"brightness\", this.brightness), this.setFloat(\"persistence\", this.persistence), this.setFloat(\"timeScale\", this.time));\n          }, t.prototype._getDefines = function() {\n            return \"#define OCTAVES \" + (0 | this.octaves);\n          }, t.prototype.render = function(e) {\n            this._updateShaderUniforms(), r.prototype.render.call(this, e);\n          }, t.prototype.serialize = function() {\n            var e = { customType: \"BABYLON.NoiseProceduralTexture\" };\n            return e.brightness = this.brightness, e.octaves = this.octaves, e.persistence = this.persistence, e.animationSpeedFactor = this.animationSpeedFactor, e.size = this.getSize().width, e.generateMipMaps = this._generateMipMaps, e.time = this.time, e;\n          }, t.prototype.clone = function() {\n            var e = this.getSize(), n = new t(this.name, e.width, this.getScene(), this._fallbackTexture ? this._fallbackTexture : void 0, this._generateMipMaps);\n            return n.hasAlpha = this.hasAlpha, n.level = this.level, n.coordinatesMode = this.coordinatesMode, n.brightness = this.brightness, n.octaves = this.octaves, n.persistence = this.persistence, n.animationSpeedFactor = this.animationSpeedFactor, n.time = this.time, n;\n          }, t.Parse = function(e, n) {\n            var i, o = new t(e.name, e.size, n, void 0, e.generateMipMaps);\n            return o.brightness = e.brightness, o.octaves = e.octaves, o.persistence = e.persistence, o.animationSpeedFactor = e.animationSpeedFactor, o.time = (i = e.time) !== null && i !== void 0 ? i : 0, o;\n          }, t;\n        }(oo);\n        O.a.RegisteredTypes[\"BABYLON.NoiseProceduralTexture\"] = Wu;\n        var Ce, le, gn, gt, Rn, ii, yn, F_ = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            o === void 0 && (o = h.a.TEXTUREFORMAT_RGBA), a === void 0 && (a = h.a.TEXTURETYPE_UNSIGNED_INT), s === void 0 && (s = !1), d === void 0 && (d = !1), p === void 0 && (p = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), y === void 0 && (y = null);\n            var P = r.call(this, \"\", e) || this;\n            return P._texture = e.getEngine().createRawCubeTexture(n, i, o, a, s, d, p, y), P;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e, n, i, o, a) {\n            a === void 0 && (a = null), this._texture.getEngine().updateRawCubeTexture(this._texture, e, n, i, o, a);\n          }, t.prototype.updateRGBDAsync = function(e, n, i, o) {\n            return n === void 0 && (n = null), i === void 0 && (i = 0.8), o === void 0 && (o = 0), t._UpdateRGBDAsync(this._texture, e, n, i, o);\n          }, t.prototype.clone = function() {\n            var e = this;\n            return L.a.Clone(function() {\n              var n = e.getScene(), i = e._texture, o = new t(n, i._bufferViewArray, i.width, i.format, i.type, i.generateMipMaps, i.invertY, i.samplingMode, i._compression);\n              return i.source === Pt.b.CubeRawRGBD && o.updateRGBDAsync(i._bufferViewArrayArray, i._sphericalPolynomial, i._lodGenerationScale, i._lodGenerationOffset), o;\n            }, this);\n          }, t._UpdateRGBDAsync = function(e, n, i, o, a) {\n            return e._source = Pt.b.CubeRawRGBD, e._bufferViewArrayArray = n, e._lodGenerationScale = o, e._lodGenerationOffset = a, e._sphericalPolynomial = i, gi.UploadLevelsAsync(e, n).then(function() {\n              e.isReady = !0;\n            });\n          }, t;\n        }(ei), B_ = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            d === void 0 && (d = !0), p === void 0 && (p = !1), y === void 0 && (y = Ne.a.TRILINEAR_SAMPLINGMODE), P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var R = r.call(this, null, s, !d, p) || this;\n            return R.format = a, R._texture = s.getEngine().createRawTexture2DArray(e, n, i, o, a, d, p, y, null, P), R.is2DArray = !0, R;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e) {\n            this._texture && this._getEngine().updateRawTexture2DArray(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);\n          }, t;\n        }(Ne.a), U_ = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            d === void 0 && (d = !0), p === void 0 && (p = !1), y === void 0 && (y = Ne.a.TRILINEAR_SAMPLINGMODE), P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var R = r.call(this, null, s, !d, p) || this;\n            return R.format = a, R._texture = s.getEngine().createRawTexture3D(e, n, i, o, a, d, p, y, null, P), R.is3D = !0, R;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e) {\n            this._texture && this._getEngine().updateRawTexture3D(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);\n          }, t;\n        }(Ne.a), V_ = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, i, o, !0) || this;\n            return a.refractionPlane = new ur.a(0, 1, 0, 1), a.depth = 2, a.onBeforeRenderObservable.add(function() {\n              i.clipPlane = a.refractionPlane;\n            }), a.onAfterRenderObservable.add(function() {\n              i.clipPlane = null;\n            }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.clone = function() {\n            var e = this.getScene();\n            if (!e)\n              return this;\n            var n = this.getSize(), i = new t(this.name, n.width, e, this._generateMipMaps);\n            return i.hasAlpha = this.hasAlpha, i.level = this.level, i.refractionPlane = this.refractionPlane.clone(), this.renderList && (i.renderList = this.renderList.slice(0)), i.depth = this.depth, i;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = r.prototype.serialize.call(this);\n            return e.mirrorPlane = this.refractionPlane.asArray(), e.depth = this.depth, e;\n          }, t;\n        }(on);\n        (function(r) {\n          r[r.Vertex = 1] = \"Vertex\", r[r.Fragment = 2] = \"Fragment\", r[r.Neutral = 4] = \"Neutral\", r[r.VertexAndFragment = 3] = \"VertexAndFragment\";\n        })(Ce || (Ce = {})), function(r) {\n          r[r.Float = 1] = \"Float\", r[r.Int = 2] = \"Int\", r[r.Vector2 = 4] = \"Vector2\", r[r.Vector3 = 8] = \"Vector3\", r[r.Vector4 = 16] = \"Vector4\", r[r.Color3 = 32] = \"Color3\", r[r.Color4 = 64] = \"Color4\", r[r.Matrix = 128] = \"Matrix\", r[r.Object = 256] = \"Object\", r[r.AutoDetect = 1024] = \"AutoDetect\", r[r.BasedOnInput = 2048] = \"BasedOnInput\";\n        }(le || (le = {})), function(r) {\n          r[r.Uniform = 0] = \"Uniform\", r[r.Attribute = 1] = \"Attribute\", r[r.Varying = 2] = \"Varying\", r[r.Undefined = 3] = \"Undefined\";\n        }(gn || (gn = {})), function(r) {\n          r[r.World = 1] = \"World\", r[r.View = 2] = \"View\", r[r.Projection = 3] = \"Projection\", r[r.ViewProjection = 4] = \"ViewProjection\", r[r.WorldView = 5] = \"WorldView\", r[r.WorldViewProjection = 6] = \"WorldViewProjection\", r[r.CameraPosition = 7] = \"CameraPosition\", r[r.FogColor = 8] = \"FogColor\", r[r.DeltaTime = 9] = \"DeltaTime\";\n        }(gt || (gt = {})), function(r) {\n          r[r.Material = 0] = \"Material\", r[r.PostProcess = 1] = \"PostProcess\", r[r.Particle = 2] = \"Particle\", r[r.ProceduralTexture = 3] = \"ProceduralTexture\";\n        }(Rn || (Rn = {})), function(r) {\n          r[r.Compatible = 0] = \"Compatible\", r[r.TypeIncompatible = 1] = \"TypeIncompatible\", r[r.TargetIncompatible = 2] = \"TargetIncompatible\";\n        }(ii || (ii = {})), function(r) {\n          r[r.Input = 0] = \"Input\", r[r.Output = 1] = \"Output\";\n        }(yn || (yn = {}));\n        var na = function() {\n          function r(t, e, n) {\n            this._connectedPoint = null, this._endpoints = new Array(), this._typeConnectionSource = null, this._linkedConnectionSource = null, this._acceptedConnectionPointType = null, this._type = le.Float, this._enforceAssociatedVariableName = !1, this.needDualDirectionValidation = !1, this.acceptedConnectionPointTypes = new Array(), this.excludedConnectionPointTypes = new Array(), this.onConnectionObservable = new C.c(), this.isExposedOnFrame = !1, this.exposedPortPosition = -1, this._prioritizeVertex = !1, this._target = Ce.VertexAndFragment, this._ownerBlock = e, this.name = t, this._direction = n;\n          }\n          return r.AreEquivalentTypes = function(t, e) {\n            switch (t) {\n              case le.Vector3:\n                if (e === le.Color3)\n                  return !0;\n                break;\n              case le.Vector4:\n                if (e === le.Color4)\n                  return !0;\n                break;\n              case le.Color3:\n                if (e === le.Vector3)\n                  return !0;\n                break;\n              case le.Color4:\n                if (e === le.Vector4)\n                  return !0;\n            }\n            return !1;\n          }, Object.defineProperty(r.prototype, \"direction\", { get: function() {\n            return this._direction;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"associatedVariableName\", { get: function() {\n            return this._ownerBlock.isInput ? this._ownerBlock.associatedVariableName : this._enforceAssociatedVariableName && this._associatedVariableName || !this._connectedPoint ? this._associatedVariableName : this._connectedPoint.associatedVariableName;\n          }, set: function(t) {\n            this._associatedVariableName = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"innerType\", { get: function() {\n            return this._linkedConnectionSource && this._linkedConnectionSource.isConnected ? this.type : this._type;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"type\", { get: function() {\n            if (this._type === le.AutoDetect) {\n              if (this._ownerBlock.isInput)\n                return this._ownerBlock.type;\n              if (this._connectedPoint)\n                return this._connectedPoint.type;\n              if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected)\n                return this._linkedConnectionSource.type;\n            }\n            return this._type === le.BasedOnInput && this._typeConnectionSource ? this._typeConnectionSource.type : this._type;\n          }, set: function(t) {\n            this._type = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"target\", { get: function() {\n            return this._prioritizeVertex && this._ownerBlock ? this._target !== Ce.VertexAndFragment ? this._target : this._ownerBlock.target === Ce.Fragment ? Ce.Fragment : Ce.Vertex : this._target;\n          }, set: function(t) {\n            this._target = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnected\", { get: function() {\n            return this.connectedPoint !== null || this.hasEndpoints;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnectedToInputBlock\", { get: function() {\n            return this.connectedPoint !== null && this.connectedPoint.ownerBlock.isInput;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"connectInputBlock\", { get: function() {\n            return this.isConnectedToInputBlock ? this.connectedPoint.ownerBlock : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"connectedPoint\", { get: function() {\n            return this._connectedPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ownerBlock\", { get: function() {\n            return this._ownerBlock;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"sourceBlock\", { get: function() {\n            return this._connectedPoint ? this._connectedPoint.ownerBlock : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"connectedBlocks\", { get: function() {\n            return this._endpoints.length === 0 ? [] : this._endpoints.map(function(t) {\n              return t.ownerBlock;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"endpoints\", { get: function() {\n            return this._endpoints;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasEndpoints\", { get: function() {\n            return this._endpoints && this._endpoints.length > 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnectedInVertexShader\", { get: function() {\n            if (this.target === Ce.Vertex)\n              return !0;\n            if (!this.hasEndpoints)\n              return !1;\n            for (var t = 0, e = this._endpoints; t < e.length; t++) {\n              var n = e[t];\n              if (n.ownerBlock.target === Ce.Vertex || n.target === Ce.Vertex || (n.ownerBlock.target === Ce.Neutral || n.ownerBlock.target === Ce.VertexAndFragment) && n.ownerBlock.outputs.some(function(i) {\n                return i.isConnectedInVertexShader;\n              }))\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnectedInFragmentShader\", { get: function() {\n            if (this.target === Ce.Fragment)\n              return !0;\n            if (!this.hasEndpoints)\n              return !1;\n            for (var t = 0, e = this._endpoints; t < e.length; t++) {\n              var n = e[t];\n              if (n.ownerBlock.target === Ce.Fragment || (n.ownerBlock.target === Ce.Neutral || n.ownerBlock.target === Ce.VertexAndFragment) && n.ownerBlock.outputs.some(function(i) {\n                return i.isConnectedInFragmentShader;\n              }))\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.createCustomInputBlock = function() {\n            return null;\n          }, r.prototype.getClassName = function() {\n            return \"NodeMaterialConnectionPoint\";\n          }, r.prototype.canConnectTo = function(t) {\n            return this.checkCompatibilityState(t) === ii.Compatible;\n          }, r.prototype.checkCompatibilityState = function(t) {\n            if (this._ownerBlock.target === Ce.Fragment) {\n              var e = t.ownerBlock;\n              if (e.target === Ce.Vertex)\n                return ii.TargetIncompatible;\n              for (var n = 0, i = e.outputs; n < i.length; n++)\n                if (i[n].isConnectedInVertexShader)\n                  return ii.TargetIncompatible;\n            }\n            return this.type !== t.type && t.innerType !== le.AutoDetect ? r.AreEquivalentTypes(this.type, t.type) || t.acceptedConnectionPointTypes && t.acceptedConnectionPointTypes.indexOf(this.type) !== -1 || t._acceptedConnectionPointType && r.AreEquivalentTypes(t._acceptedConnectionPointType.type, this.type) ? ii.Compatible : ii.TypeIncompatible : t.excludedConnectionPointTypes && t.excludedConnectionPointTypes.indexOf(this.type) !== -1 ? 1 : ii.Compatible;\n          }, r.prototype.connectTo = function(t, e) {\n            if (e === void 0 && (e = !1), !e && !this.canConnectTo(t))\n              throw \"Cannot connect these two connectors.\";\n            return this._endpoints.push(t), t._connectedPoint = this, this._enforceAssociatedVariableName = !1, this.onConnectionObservable.notifyObservers(t), t.onConnectionObservable.notifyObservers(this), this;\n          }, r.prototype.disconnectFrom = function(t) {\n            var e = this._endpoints.indexOf(t);\n            return e === -1 || (this._endpoints.splice(e, 1), t._connectedPoint = null, this._enforceAssociatedVariableName = !1, t._enforceAssociatedVariableName = !1), this;\n          }, r.prototype.serialize = function(t) {\n            t === void 0 && (t = !0);\n            var e = {};\n            return e.name = this.name, e.displayName = this.displayName, t && this.connectedPoint && (e.inputName = this.name, e.targetBlockId = this.connectedPoint.ownerBlock.uniqueId, e.targetConnectionName = this.connectedPoint.name, e.isExposedOnFrame = !0, e.exposedPortPosition = this.exposedPortPosition), (this.isExposedOnFrame || this.exposedPortPosition >= 0) && (e.isExposedOnFrame = !0, e.exposedPortPosition = this.exposedPortPosition), e;\n          }, r.prototype.dispose = function() {\n            this.onConnectionObservable.clear();\n          }, r;\n        }(), k_ = f(152), dt = function() {\n          function r(t, e, n, i) {\n            e === void 0 && (e = Ce.Vertex), n === void 0 && (n = !1), i === void 0 && (i = !1), this._isFinalMerger = !1, this._isInput = !1, this._name = \"\", this._isUnique = !1, this.inputsAreExclusive = !1, this._codeVariableName = \"\", this._inputs = new Array(), this._outputs = new Array(), this.comments = \"\", this.visibleInInspector = !1, this._target = e, this._isFinalMerger = n, this._isInput = i, this._name = t, this.uniqueId = k_.a.UniqueId;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return this._name;\n          }, set: function(t) {\n            this.validateBlockName(t) && (this._name = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isUnique\", { get: function() {\n            return this._isUnique;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isFinalMerger\", { get: function() {\n            return this._isFinalMerger;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isInput\", { get: function() {\n            return this._isInput;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"buildId\", { get: function() {\n            return this._buildId;\n          }, set: function(t) {\n            this._buildId = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"target\", { get: function() {\n            return this._target;\n          }, set: function(t) {\n            !(this._target & t) && (this._target = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"inputs\", { get: function() {\n            return this._inputs;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"outputs\", { get: function() {\n            return this._outputs;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getInputByName = function(t) {\n            var e = this._inputs.filter(function(n) {\n              return n.name === t;\n            });\n            return e.length ? e[0] : null;\n          }, r.prototype.getOutputByName = function(t) {\n            var e = this._outputs.filter(function(n) {\n              return n.name === t;\n            });\n            return e.length ? e[0] : null;\n          }, r.prototype.initialize = function(t) {\n          }, r.prototype.bind = function(t, e, n, i) {\n          }, r.prototype._declareOutput = function(t, e) {\n            return e._getGLType(t.type) + \" \" + t.associatedVariableName;\n          }, r.prototype._writeVariable = function(t) {\n            return t.connectedPoint ? \"\" + t.associatedVariableName : \"0.\";\n          }, r.prototype._writeFloat = function(t) {\n            var e = t.toString();\n            return e.indexOf(\".\") === -1 && (e += \".0\"), \"\" + e;\n          }, r.prototype.getClassName = function() {\n            return \"NodeMaterialBlock\";\n          }, r.prototype.registerInput = function(t, e, n, i, o) {\n            return n === void 0 && (n = !1), (o = o ?? new na(t, this, yn.Input)).type = e, o.isOptional = n, i && (o.target = i), this._inputs.push(o), this;\n          }, r.prototype.registerOutput = function(t, e, n, i) {\n            return (i = i ?? new na(t, this, yn.Output)).type = e, n && (i.target = n), this._outputs.push(i), this;\n          }, r.prototype.getFirstAvailableInput = function(t) {\n            t === void 0 && (t = null);\n            for (var e = 0, n = this._inputs; e < n.length; e++) {\n              var i = n[e];\n              if (!(i.connectedPoint || t && t.type !== i.type && i.type !== le.AutoDetect))\n                return i;\n            }\n            return null;\n          }, r.prototype.getFirstAvailableOutput = function(t) {\n            t === void 0 && (t = null);\n            for (var e = 0, n = this._outputs; e < n.length; e++) {\n              var i = n[e];\n              if (!t || !t.target || t.target === Ce.Neutral || t.target & i.target)\n                return i;\n            }\n            return null;\n          }, r.prototype.getSiblingOutput = function(t) {\n            var e = this._outputs.indexOf(t);\n            return e === -1 || e >= this._outputs.length ? null : this._outputs[e + 1];\n          }, r.prototype.connectTo = function(t, e) {\n            if (this._outputs.length !== 0) {\n              for (var n = e && e.output ? this.getOutputByName(e.output) : this.getFirstAvailableOutput(t), i = !0; i; ) {\n                var o = e && e.input ? t.getInputByName(e.input) : t.getFirstAvailableInput(n);\n                if (n && o && n.canConnectTo(o))\n                  n.connectTo(o), i = !1;\n                else {\n                  if (!n)\n                    throw \"Unable to find a compatible match\";\n                  n = this.getSiblingOutput(n);\n                }\n              }\n              return this;\n            }\n          }, r.prototype._buildBlock = function(t) {\n          }, r.prototype.updateUniformsAndSamples = function(t, e, n, i) {\n          }, r.prototype.provideFallbacks = function(t, e) {\n          }, r.prototype.initializeDefines = function(t, e, n, i) {\n          }, r.prototype.prepareDefines = function(t, e, n, i, o) {\n          }, r.prototype.autoConfigure = function(t) {\n          }, r.prototype.replaceRepeatableContent = function(t, e, n, i) {\n          }, r.prototype.isReady = function(t, e, n, i) {\n            return !0;\n          }, r.prototype._linkConnectionTypes = function(t, e, n) {\n            n === void 0 && (n = !1), n ? this._inputs[e]._acceptedConnectionPointType = this._inputs[t] : this._inputs[t]._linkedConnectionSource = this._inputs[e], this._inputs[e]._linkedConnectionSource = this._inputs[t];\n          }, r.prototype._processBuild = function(t, e, n, i) {\n            t.build(e, i);\n            var o = e._vertexState != null, a = t._buildTarget === Ce.Vertex && t.target !== Ce.VertexAndFragment;\n            if (o && (!(t.target & t._buildTarget) || !(t.target & n.target) || this.target !== Ce.VertexAndFragment && a) && (!t.isInput && e.target !== t._buildTarget || t.isInput && t.isAttribute && !t._noContextSwitch)) {\n              var s = n.connectedPoint;\n              e._vertexState._emitVaryingFromString(\"v_\" + s.associatedVariableName, e._getGLType(s.type)) && (e._vertexState.compilationString += \"v_\" + s.associatedVariableName + \" = \" + s.associatedVariableName + `;\\r\n`), n.associatedVariableName = \"v_\" + s.associatedVariableName, n._enforceAssociatedVariableName = !0;\n            }\n          }, r.prototype.validateBlockName = function(t) {\n            for (var e = 0, n = [\"position\", \"normal\", \"tangent\", \"particle_positionw\", \"uv\", \"uv2\", \"position2d\", \"particle_uv\", \"matricesIndices\", \"matricesWeights\", \"world0\", \"world1\", \"world2\", \"world3\", \"particle_color\", \"particle_texturemask\"]; e < n.length; e++)\n              if (t === n[e])\n                return !1;\n            return !0;\n          }, r.prototype.build = function(t, e) {\n            if (this._buildId === t.sharedData.buildId)\n              return !0;\n            if (!this.isInput)\n              for (var n = 0, i = this._outputs; n < i.length; n++)\n                (y = i[n]).associatedVariableName || (y.associatedVariableName = t._getFreeVariableName(y.name));\n            for (var o = 0, a = this._inputs; o < a.length; o++) {\n              var s = a[o];\n              if (s.connectedPoint) {\n                if (this.target !== Ce.Neutral && (!(s.target & this.target) || !(s.target & t.target)))\n                  continue;\n                (B = s.connectedPoint.ownerBlock) && B !== this && this._processBuild(B, t, s, e);\n              } else\n                s.isOptional || t.sharedData.checks.notConnectedNonOptionalInputs.push(s);\n            }\n            if (this._buildId === t.sharedData.buildId)\n              return !0;\n            if (t.sharedData.verbose && console.log((t.target === Ce.Vertex ? \"Vertex shader\" : \"Fragment shader\") + \": Building \" + this.name + \" [\" + this.getClassName() + \"]\"), this.isFinalMerger)\n              switch (t.target) {\n                case Ce.Vertex:\n                  t.sharedData.checks.emitVertex = !0;\n                  break;\n                case Ce.Fragment:\n                  t.sharedData.checks.emitFragment = !0;\n              }\n            !this.isInput && t.sharedData.emitComments && (t.compilationString += `\\r\n//` + this.name + `\\r\n`), this._buildBlock(t), this._buildId = t.sharedData.buildId, this._buildTarget = t.target;\n            for (var d = 0, p = this._outputs; d < p.length; d++) {\n              var y;\n              if ((y = p[d]).target & t.target)\n                for (var P = 0, R = y.endpoints; P < R.length; P++) {\n                  var B, F = R[P];\n                  (B = F.ownerBlock) && B.target & t.target && e.indexOf(B) !== -1 && this._processBuild(B, t, F, e);\n                }\n            }\n            return !1;\n          }, r.prototype._inputRename = function(t) {\n            return t;\n          }, r.prototype._outputRename = function(t) {\n            return t;\n          }, r.prototype._dumpPropertiesCode = function() {\n            return this._codeVariableName + \".visibleInInspector = \" + this.visibleInInspector + `;\\r\n`;\n          }, r.prototype._dumpCode = function(t, e) {\n            var n;\n            e.push(this);\n            var i = this.name.replace(/[^A-Za-z_]+/g, \"\");\n            if (this._codeVariableName = i || this.getClassName() + \"_\" + this.uniqueId, t.indexOf(this._codeVariableName) !== -1) {\n              var o = 0;\n              do\n                o++, this._codeVariableName = i + o;\n              while (t.indexOf(this._codeVariableName) !== -1);\n            }\n            t.push(this._codeVariableName), n = `\\r\n// ` + this.getClassName() + `\\r\n`, this.comments && (n += \"// \" + this.comments + `\\r\n`), n += \"var \" + this._codeVariableName + \" = new BABYLON.\" + this.getClassName() + '(\"' + this.name + `\");\\r\n`, n += this._dumpPropertiesCode();\n            for (var a = 0, s = this.inputs; a < s.length; a++) {\n              var d = s[a];\n              if (d.isConnected) {\n                var p = d.connectedPoint.ownerBlock;\n                e.indexOf(p) === -1 && (n += p._dumpCode(t, e));\n              }\n            }\n            for (var y = 0, P = this.outputs; y < P.length; y++) {\n              var R = P[y];\n              if (R.hasEndpoints)\n                for (var B = 0, F = R.endpoints; B < F.length; B++)\n                  (p = F[B].ownerBlock) && e.indexOf(p) === -1 && (n += p._dumpCode(t, e));\n            }\n            return n;\n          }, r.prototype._dumpCodeForOutputConnections = function(t) {\n            var e = \"\";\n            if (t.indexOf(this) !== -1)\n              return e;\n            t.push(this);\n            for (var n = 0, i = this.inputs; n < i.length; n++) {\n              var o = i[n];\n              if (o.isConnected) {\n                var a = o.connectedPoint, s = a.ownerBlock;\n                e += s._dumpCodeForOutputConnections(t), e += s._codeVariableName + \".\" + s._outputRename(a.name) + \".connectTo(\" + this._codeVariableName + \".\" + this._inputRename(o.name) + `);\\r\n`;\n              }\n            }\n            return e;\n          }, r.prototype.clone = function(t, e) {\n            e === void 0 && (e = \"\");\n            var n = this.serialize(), i = O.a.GetClass(n.customType);\n            if (i) {\n              var o = new i();\n              return o._deserialize(n, t, e), o;\n            }\n            return null;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.customType = \"BABYLON.\" + this.getClassName(), t.id = this.uniqueId, t.name = this.name, t.comments = this.comments, t.visibleInInspector = this.visibleInInspector, t.inputs = [], t.outputs = [];\n            for (var e = 0, n = this.inputs; e < n.length; e++) {\n              var i = n[e];\n              t.inputs.push(i.serialize());\n            }\n            for (var o = 0, a = this.outputs; o < a.length; o++) {\n              var s = a[o];\n              t.outputs.push(s.serialize(!1));\n            }\n            return t;\n          }, r.prototype._deserialize = function(t, e, n) {\n            this.name = t.name, this.comments = t.comments, this.visibleInInspector = !!t.visibleInInspector, this._deserializePortDisplayNamesAndExposedOnFrame(t);\n          }, r.prototype._deserializePortDisplayNamesAndExposedOnFrame = function(t) {\n            var e = this, n = t.inputs, i = t.outputs;\n            n && n.forEach(function(o, a) {\n              o.displayName && (e.inputs[a].displayName = o.displayName), o.isExposedOnFrame && (e.inputs[a].isExposedOnFrame = o.isExposedOnFrame, e.inputs[a].exposedPortPosition = o.exposedPortPosition);\n            }), i && i.forEach(function(o, a) {\n              o.displayName && (e.outputs[a].displayName = o.displayName), o.isExposedOnFrame && (e.outputs[a].isExposedOnFrame = o.isExposedOnFrame, e.outputs[a].exposedPortPosition = o.exposedPortPosition);\n            });\n          }, r.prototype.dispose = function() {\n            for (var t = 0, e = this.inputs; t < e.length; t++)\n              e[t].dispose();\n            for (var n = 0, i = this.outputs; n < i.length; n++)\n              i[n].dispose();\n          }, r;\n        }(), Xu = function() {\n          function r() {\n            this.supportUniformBuffers = !1, this.attributes = new Array(), this.uniforms = new Array(), this.constants = new Array(), this.samplers = new Array(), this.functions = {}, this.extensions = {}, this.counters = {}, this._attributeDeclaration = \"\", this._uniformDeclaration = \"\", this._constantDeclaration = \"\", this._samplerDeclaration = \"\", this._varyingTransfer = \"\", this._injectAtEnd = \"\", this._repeatableContentAnchorIndex = 0, this._builtCompilationString = \"\", this.compilationString = \"\";\n          }\n          return r.prototype.finalize = function(t) {\n            var e = t.sharedData.emitComments, n = this.target === Ce.Fragment;\n            this.compilationString = `\\r\n` + (e ? `//Entry point\\r\n` : \"\") + `void main(void) {\\r\n` + this.compilationString, this._constantDeclaration && (this.compilationString = `\\r\n` + (e ? `//Constants\\r\n` : \"\") + this._constantDeclaration + `\\r\n` + this.compilationString);\n            var i = \"\";\n            for (var o in this.functions)\n              i += this.functions[o] + `\\r\n`;\n            for (var a in this.compilationString = `\\r\n` + i + `\\r\n` + this.compilationString, !n && this._varyingTransfer && (this.compilationString = this.compilationString + `\\r\n` + this._varyingTransfer), this._injectAtEnd && (this.compilationString = this.compilationString + `\\r\n` + this._injectAtEnd), this.compilationString = this.compilationString + `\\r\n}`, this.sharedData.varyingDeclaration && (this.compilationString = `\\r\n` + (e ? `//Varyings\\r\n` : \"\") + this.sharedData.varyingDeclaration + `\\r\n` + this.compilationString), this._samplerDeclaration && (this.compilationString = `\\r\n` + (e ? `//Samplers\\r\n` : \"\") + this._samplerDeclaration + `\\r\n` + this.compilationString), this._uniformDeclaration && (this.compilationString = `\\r\n` + (e ? `//Uniforms\\r\n` : \"\") + this._uniformDeclaration + `\\r\n` + this.compilationString), this._attributeDeclaration && !n && (this.compilationString = `\\r\n` + (e ? `//Attributes\\r\n` : \"\") + this._attributeDeclaration + `\\r\n` + this.compilationString), this.compilationString = `precision highp float;\\r\n` + this.compilationString, this.extensions) {\n              var s = this.extensions[a];\n              this.compilationString = `\\r\n` + s + `\\r\n` + this.compilationString;\n            }\n            this._builtCompilationString = this.compilationString;\n          }, Object.defineProperty(r.prototype, \"_repeatableContentAnchor\", { get: function() {\n            return \"###___ANCHOR\" + this._repeatableContentAnchorIndex++ + \"___###\";\n          }, enumerable: !1, configurable: !0 }), r.prototype._getFreeVariableName = function(t) {\n            return t = t.replace(/[^a-zA-Z_]+/g, \"\"), this.sharedData.variableNames[t] === void 0 ? (this.sharedData.variableNames[t] = 0, t === \"output\" || t === \"texture\" ? t + this.sharedData.variableNames[t] : t) : (this.sharedData.variableNames[t]++, t + this.sharedData.variableNames[t]);\n          }, r.prototype._getFreeDefineName = function(t) {\n            return this.sharedData.defineNames[t] === void 0 ? this.sharedData.defineNames[t] = 0 : this.sharedData.defineNames[t]++, t + this.sharedData.defineNames[t];\n          }, r.prototype._excludeVariableName = function(t) {\n            this.sharedData.variableNames[t] = 0;\n          }, r.prototype._emit2DSampler = function(t) {\n            this.samplers.indexOf(t) < 0 && (this._samplerDeclaration += \"uniform sampler2D \" + t + `;\\r\n`, this.samplers.push(t));\n          }, r.prototype._getGLType = function(t) {\n            switch (t) {\n              case le.Float:\n                return \"float\";\n              case le.Int:\n                return \"int\";\n              case le.Vector2:\n                return \"vec2\";\n              case le.Color3:\n              case le.Vector3:\n                return \"vec3\";\n              case le.Color4:\n              case le.Vector4:\n                return \"vec4\";\n              case le.Matrix:\n                return \"mat4\";\n            }\n            return \"\";\n          }, r.prototype._emitExtension = function(t, e, n) {\n            n === void 0 && (n = \"\"), this.extensions[t] || (n && (e = \"#if \" + n + `\\r\n` + e + `\\r\n#endif`), this.extensions[t] = e);\n          }, r.prototype._emitFunction = function(t, e, n) {\n            this.functions[t] || (this.sharedData.emitComments && (e = n + `\\r\n` + e), this.functions[t] = e);\n          }, r.prototype._emitCodeFromInclude = function(t, e, n) {\n            if (n && n.repeatKey)\n              return \"#include<\" + t + \">[0..\" + n.repeatKey + `]\\r\n`;\n            var i = ze.a.IncludesShadersStore[t] + `\\r\n`;\n            if (this.sharedData.emitComments && (i = e + `\\r\n` + i), !n)\n              return i;\n            if (n.replaceStrings)\n              for (var o = 0; o < n.replaceStrings.length; o++) {\n                var a = n.replaceStrings[o];\n                i = i.replace(a.search, a.replace);\n              }\n            return i;\n          }, r.prototype._emitFunctionFromInclude = function(t, e, n, i) {\n            i === void 0 && (i = \"\");\n            var o = t + i;\n            if (!this.functions[o]) {\n              if (!(n && (n.removeAttributes || n.removeUniforms || n.removeVaryings || n.removeIfDef || n.replaceStrings)))\n                return n && n.repeatKey ? this.functions[o] = \"#include<\" + t + \">[0..\" + n.repeatKey + `]\\r\n` : this.functions[o] = \"#include<\" + t + `>\\r\n`, void (this.sharedData.emitComments && (this.functions[o] = e + `\\r\n` + this.functions[o]));\n              if (this.functions[o] = ze.a.IncludesShadersStore[t], this.sharedData.emitComments && (this.functions[o] = e + `\\r\n` + this.functions[o]), n.removeIfDef && (this.functions[o] = this.functions[o].replace(/^\\s*?#ifdef.+$/gm, \"\"), this.functions[o] = this.functions[o].replace(/^\\s*?#endif.*$/gm, \"\"), this.functions[o] = this.functions[o].replace(/^\\s*?#else.*$/gm, \"\"), this.functions[o] = this.functions[o].replace(/^\\s*?#elif.*$/gm, \"\")), n.removeAttributes && (this.functions[o] = this.functions[o].replace(/^\\s*?attribute.+$/gm, \"\")), n.removeUniforms && (this.functions[o] = this.functions[o].replace(/^\\s*?uniform.+$/gm, \"\")), n.removeVaryings && (this.functions[o] = this.functions[o].replace(/^\\s*?varying.+$/gm, \"\")), n.replaceStrings)\n                for (var a = 0; a < n.replaceStrings.length; a++) {\n                  var s = n.replaceStrings[a];\n                  this.functions[o] = this.functions[o].replace(s.search, s.replace);\n                }\n            }\n          }, r.prototype._registerTempVariable = function(t) {\n            return this.sharedData.temps.indexOf(t) === -1 && (this.sharedData.temps.push(t), !0);\n          }, r.prototype._emitVaryingFromString = function(t, e, n, i) {\n            return n === void 0 && (n = \"\"), i === void 0 && (i = !1), this.sharedData.varyings.indexOf(t) === -1 && (this.sharedData.varyings.push(t), n && (Hn.a.StartsWith(n, \"defined(\") ? this.sharedData.varyingDeclaration += \"#if \" + n + `\\r\n` : this.sharedData.varyingDeclaration += (i ? \"#ifndef\" : \"#ifdef\") + \" \" + n + `\\r\n`), this.sharedData.varyingDeclaration += \"varying \" + e + \" \" + t + `;\\r\n`, n && (this.sharedData.varyingDeclaration += `#endif\\r\n`), !0);\n          }, r.prototype._emitUniformFromString = function(t, e, n, i) {\n            n === void 0 && (n = \"\"), i === void 0 && (i = !1), this.uniforms.indexOf(t) === -1 && (this.uniforms.push(t), n && (Hn.a.StartsWith(n, \"defined(\") ? this._uniformDeclaration += \"#if \" + n + `\\r\n` : this._uniformDeclaration += (i ? \"#ifndef\" : \"#ifdef\") + \" \" + n + `\\r\n`), this._uniformDeclaration += \"uniform \" + e + \" \" + t + `;\\r\n`, n && (this._uniformDeclaration += `#endif\\r\n`));\n          }, r.prototype._emitFloat = function(t) {\n            return t.toString() === t.toFixed(0) ? t + \".0\" : t.toString();\n          }, r;\n        }(), G_ = function() {\n          function r() {\n            this.temps = new Array(), this.varyings = new Array(), this.varyingDeclaration = \"\", this.inputBlocks = new Array(), this.textureBlocks = new Array(), this.bindableBlocks = new Array(), this.blocksWithFallbacks = new Array(), this.blocksWithDefines = new Array(), this.repeatableContentBlocks = new Array(), this.dynamicUniformBlocks = new Array(), this.blockingBlocks = new Array(), this.animatedInputs = new Array(), this.variableNames = {}, this.defineNames = {}, this.hints = { needWorldViewMatrix: !1, needWorldViewProjectionMatrix: !1, needAlphaBlending: !1, needAlphaTesting: !1 }, this.checks = { emitVertex: !1, emitFragment: !1, notConnectedNonOptionalInputs: new Array() }, this.allowEmptyVertexProgram = !1, this.variableNames.position = 0, this.variableNames.normal = 0, this.variableNames.tangent = 0, this.variableNames.uv = 0, this.variableNames.uv2 = 0, this.variableNames.uv3 = 0, this.variableNames.uv4 = 0, this.variableNames.uv4 = 0, this.variableNames.uv5 = 0, this.variableNames.uv6 = 0, this.variableNames.color = 0, this.variableNames.matricesIndices = 0, this.variableNames.matricesWeights = 0, this.variableNames.matricesIndicesExtra = 0, this.variableNames.matricesWeightsExtra = 0, this.variableNames.diffuseBase = 0, this.variableNames.specularBase = 0, this.variableNames.worldPos = 0, this.variableNames.shadow = 0, this.variableNames.view = 0, this.variableNames.vTBN = 0, this.defineNames.MAINUV0 = 0, this.defineNames.MAINUV1 = 0, this.defineNames.MAINUV2 = 0, this.defineNames.MAINUV3 = 0, this.defineNames.MAINUV4 = 0, this.defineNames.MAINUV5 = 0, this.defineNames.MAINUV6 = 0, this.defineNames.MAINUV7 = 0;\n          }\n          return r.prototype.emitErrors = function() {\n            var t = \"\";\n            this.checks.emitVertex || this.allowEmptyVertexProgram || (t += `NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\\r\n`), this.checks.emitFragment || (t += `NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\\r\n`);\n            for (var e = 0, n = this.checks.notConnectedNonOptionalInputs; e < n.length; e++) {\n              var i = n[e];\n              t += \"input \" + i.name + \" from block \" + i.ownerBlock.name + \"[\" + i.ownerBlock.getClassName() + `] is not connected and is not optional.\\r\n`;\n            }\n            if (t)\n              throw `Build of NodeMaterial failed:\\r\n` + t;\n          }, r;\n        }(), ia = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.complementW = 1, n.complementZ = 0, n.registerInput(\"vector\", le.AutoDetect), n.registerInput(\"transform\", le.Matrix), n.registerOutput(\"output\", le.Vector4), n.registerOutput(\"xyz\", le.Vector3), n._inputs[0].onConnectionObservable.add(function(i) {\n              if (i.ownerBlock.isInput) {\n                var o = i.ownerBlock;\n                o.name !== \"normal\" && o.name !== \"tangent\" || (n.complementW = 0);\n              }\n            }), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TransformBlock\";\n          }, Object.defineProperty(t.prototype, \"vector\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyz\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"transform\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.vector, i = this.transform;\n            if (n.connectedPoint) {\n              if (this.complementW === 0) {\n                var o = \"//\" + this.name;\n                e._emitFunctionFromInclude(\"helperFunctions\", o), e.sharedData.blocksWithDefines.push(this);\n                var a = e._getFreeVariableName(i.associatedVariableName + \"_NUS\");\n                switch (e.compilationString += \"mat3 \" + a + \" = mat3(\" + i.associatedVariableName + `);\\r\n`, e.compilationString += `#ifdef NONUNIFORMSCALING\\r\n`, e.compilationString += a + \" = transposeMat3(inverseMat3(\" + a + `));\\r\n`, e.compilationString += `#endif\\r\n`, n.connectedPoint.type) {\n                  case le.Vector2:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = vec4(\" + a + \" * vec3(\" + n.associatedVariableName + \", \" + this._writeFloat(this.complementZ) + \"), \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  case le.Vector3:\n                  case le.Color3:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = vec4(\" + a + \" * \" + n.associatedVariableName + \", \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  default:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = vec4(\" + a + \" * \" + n.associatedVariableName + \".xyz, \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                }\n              } else\n                switch (a = i.associatedVariableName, n.connectedPoint.type) {\n                  case le.Vector2:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = \" + a + \" * vec4(\" + n.associatedVariableName + \", \" + this._writeFloat(this.complementZ) + \", \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  case le.Vector3:\n                  case le.Color3:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = \" + a + \" * vec4(\" + n.associatedVariableName + \", \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  default:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = \" + a + \" * \" + n.associatedVariableName + `;\\r\n`;\n                }\n              this.xyz.hasEndpoints && (e.compilationString += this._declareOutput(this.xyz, e) + \" = \" + this.output.associatedVariableName + `.xyz;\\r\n`);\n            }\n            return this;\n          }, t.prototype.prepareDefines = function(e, n, i, o, a) {\n            e.nonUniformScaling && i.setValue(\"NONUNIFORMSCALING\", !0);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.complementZ = this.complementZ, e.complementW = this.complementW, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.complementZ = e.complementZ !== void 0 ? e.complementZ : 0, this.complementW = e.complementW !== void 0 ? e.complementW : 1;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".complementZ = \" + this.complementZ + `;\\r\n`;\n            return e += this._codeVariableName + \".complementW = \" + this.complementW + `;\\r\n`;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.TransformBlock\"] = ia;\n        var ao = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex, !0) || this;\n            return n.registerInput(\"vector\", le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VertexOutputBlock\";\n          }, Object.defineProperty(t.prototype, \"vector\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.vector;\n            return e.compilationString += \"gl_Position = \" + n.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.VertexOutputBlock\"] = ao;\n        var Ni, Pr = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment, !0) || this;\n            return n.registerInput(\"rgba\", le.Color4, !0), n.registerInput(\"rgb\", le.Color3, !0), n.registerInput(\"a\", le.Float, !0), n.rgb.acceptedConnectionPointTypes.push(le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FragmentOutputBlock\";\n          }, Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.rgba, i = this.rgb, o = this.a;\n            if (e.sharedData.hints.needAlphaBlending = n.isConnected || o.isConnected, n.connectedPoint)\n              o.isConnected ? e.compilationString += \"gl_FragColor = vec4(\" + n.associatedVariableName + \".rgb, \" + o.associatedVariableName + `);\\r\n` : e.compilationString += \"gl_FragColor = \" + n.associatedVariableName + `;\\r\n`;\n            else if (i.connectedPoint) {\n              var a = \"1.0\";\n              o.connectedPoint && (a = o.associatedVariableName), i.connectedPoint.type === le.Float ? e.compilationString += \"gl_FragColor = vec4(\" + i.associatedVariableName + \", \" + i.associatedVariableName + \", \" + i.associatedVariableName + \", \" + a + `);\\r\n` : e.compilationString += \"gl_FragColor = vec4(\" + i.associatedVariableName + \", \" + a + `);\\r\n`;\n            } else\n              e.sharedData.checks.notConnectedNonOptionalInputs.push(n);\n            return this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FragmentOutputBlock\"] = Pr, function(r) {\n          r[r.None = 0] = \"None\", r[r.Time = 1] = \"Time\";\n        }(Ni || (Ni = {}));\n        var z_ = { position2d: \"position\", particle_uv: \"vUV\", particle_color: \"vColor\", particle_texturemask: \"textureMask\", particle_positionw: \"vPositionW\" }, Gs = { particle_uv: !0, particle_color: !0, particle_texturemask: !0, particle_positionw: !0 }, Yu = { particle_texturemask: !0 }, Et = function(r) {\n          function t(e, n, i) {\n            n === void 0 && (n = Ce.Vertex), i === void 0 && (i = le.AutoDetect);\n            var o = r.call(this, e, n, !1, !0) || this;\n            return o._mode = gn.Undefined, o._animationType = Ni.None, o.min = 0, o.max = 0, o.isBoolean = !1, o.matrixMode = 0, o._systemValue = null, o.isConstant = !1, o.groupInInspector = \"\", o.onValueChangedObservable = new C.c(), o.convertToGammaSpace = !1, o.convertToLinearSpace = !1, o._type = i, o.setDefaultValue(), o.registerOutput(\"output\", i), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"type\", { get: function() {\n            if (this._type === le.AutoDetect) {\n              if (this.isUniform && this.value != null) {\n                if (!isNaN(this.value))\n                  return this._type = le.Float, this._type;\n                switch (this.value.getClassName()) {\n                  case \"Vector2\":\n                    return this._type = le.Vector2, this._type;\n                  case \"Vector3\":\n                    return this._type = le.Vector3, this._type;\n                  case \"Vector4\":\n                    return this._type = le.Vector4, this._type;\n                  case \"Color3\":\n                    return this._type = le.Color3, this._type;\n                  case \"Color4\":\n                    return this._type = le.Color4, this._type;\n                  case \"Matrix\":\n                    return this._type = le.Matrix, this._type;\n                }\n              }\n              if (this.isAttribute)\n                switch (this.name) {\n                  case \"position\":\n                  case \"normal\":\n                  case \"tangent\":\n                  case \"particle_positionw\":\n                    return this._type = le.Vector3, this._type;\n                  case \"uv\":\n                  case \"uv2\":\n                  case \"position2d\":\n                  case \"particle_uv\":\n                    return this._type = le.Vector2, this._type;\n                  case \"matricesIndices\":\n                  case \"matricesWeights\":\n                  case \"world0\":\n                  case \"world1\":\n                  case \"world2\":\n                  case \"world3\":\n                    return this._type = le.Vector4, this._type;\n                  case \"color\":\n                  case \"particle_color\":\n                  case \"particle_texturemask\":\n                    return this._type = le.Color4, this._type;\n                }\n              if (this.isSystemValue)\n                switch (this._systemValue) {\n                  case gt.World:\n                  case gt.WorldView:\n                  case gt.WorldViewProjection:\n                  case gt.View:\n                  case gt.ViewProjection:\n                  case gt.Projection:\n                    return this._type = le.Matrix, this._type;\n                  case gt.CameraPosition:\n                    return this._type = le.Vector3, this._type;\n                  case gt.FogColor:\n                    return this._type = le.Color3, this._type;\n                  case gt.DeltaTime:\n                    return this._type = le.Float, this._type;\n                }\n            }\n            return this._type;\n          }, enumerable: !1, configurable: !0 }), t.prototype.validateBlockName = function(e) {\n            return !!this.isAttribute || r.prototype.validateBlockName.call(this, e);\n          }, Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.setAsAttribute = function(e) {\n            return this._mode = gn.Attribute, e && (this.name = e), this;\n          }, t.prototype.setAsSystemValue = function(e) {\n            return this.systemValue = e, this;\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._storedValue;\n          }, set: function(e) {\n            this.type === le.Float && (this.isBoolean ? e = e ? 1 : 0 : this.min !== this.max && (e = Math.max(this.min, e), e = Math.min(this.max, e))), this._storedValue = e, this._mode = gn.Uniform, this.onValueChangedObservable.notifyObservers(this);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"valueCallback\", { get: function() {\n            return this._valueCallback;\n          }, set: function(e) {\n            this._valueCallback = e, this._mode = gn.Uniform;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"associatedVariableName\", { get: function() {\n            return this._associatedVariableName;\n          }, set: function(e) {\n            this._associatedVariableName = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"animationType\", { get: function() {\n            return this._animationType;\n          }, set: function(e) {\n            this._animationType = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isUndefined\", { get: function() {\n            return this._mode === gn.Undefined;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isUniform\", { get: function() {\n            return this._mode === gn.Uniform;\n          }, set: function(e) {\n            this._mode = e ? gn.Uniform : gn.Undefined, this.associatedVariableName = \"\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isAttribute\", { get: function() {\n            return this._mode === gn.Attribute;\n          }, set: function(e) {\n            this._mode = e ? gn.Attribute : gn.Undefined, this.associatedVariableName = \"\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isVarying\", { get: function() {\n            return this._mode === gn.Varying;\n          }, set: function(e) {\n            this._mode = e ? gn.Varying : gn.Undefined, this.associatedVariableName = \"\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isSystemValue\", { get: function() {\n            return this._systemValue != null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"systemValue\", { get: function() {\n            return this._systemValue;\n          }, set: function(e) {\n            this._mode = gn.Uniform, this.associatedVariableName = \"\", this._systemValue = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"InputBlock\";\n          }, t.prototype.animate = function(e) {\n            switch (this._animationType) {\n              case Ni.Time:\n                this.type === le.Float && (this.value += 0.01 * e.getAnimationRatio());\n            }\n          }, t.prototype._emitDefine = function(e) {\n            return e[0] === \"!\" ? \"#ifndef \" + e.substring(1) + `\\r\n` : \"#ifdef \" + e + `\\r\n`;\n          }, t.prototype.initialize = function(e) {\n            this.associatedVariableName = \"\";\n          }, t.prototype.setDefaultValue = function() {\n            switch (this.type) {\n              case le.Float:\n                this.value = 0;\n                break;\n              case le.Vector2:\n                this.value = u.d.Zero();\n                break;\n              case le.Vector3:\n                this.value = u.e.Zero();\n                break;\n              case le.Vector4:\n                this.value = u.f.Zero();\n                break;\n              case le.Color3:\n                this.value = I.a.White();\n                break;\n              case le.Color4:\n                this.value = new I.b(1, 1, 1, 1);\n                break;\n              case le.Matrix:\n                this.value = u.a.Identity();\n            }\n          }, t.prototype._emitConstant = function(e) {\n            switch (this.type) {\n              case le.Float:\n                return \"\" + e._emitFloat(this.value);\n              case le.Vector2:\n                return \"vec2(\" + this.value.x + \", \" + this.value.y + \")\";\n              case le.Vector3:\n                return \"vec3(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \")\";\n              case le.Vector4:\n                return \"vec4(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \", \" + this.value.w + \")\";\n              case le.Color3:\n                return I.c.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && I.c.Color3[0].toGammaSpaceToRef(I.c.Color3[0]), this.convertToLinearSpace && I.c.Color3[0].toLinearSpaceToRef(I.c.Color3[0]), \"vec3(\" + I.c.Color3[0].r + \", \" + I.c.Color3[0].g + \", \" + I.c.Color3[0].b + \")\";\n              case le.Color4:\n                return I.c.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && I.c.Color4[0].toGammaSpaceToRef(I.c.Color4[0]), this.convertToLinearSpace && I.c.Color4[0].toLinearSpaceToRef(I.c.Color4[0]), \"vec4(\" + I.c.Color4[0].r + \", \" + I.c.Color4[0].g + \", \" + I.c.Color4[0].b + \", \" + I.c.Color4[0].a + \")\";\n            }\n            return \"\";\n          }, Object.defineProperty(t.prototype, \"_noContextSwitch\", { get: function() {\n            return Gs[this.name];\n          }, enumerable: !1, configurable: !0 }), t.prototype._emit = function(e, n) {\n            var i;\n            if (this.isUniform) {\n              if (this.associatedVariableName || (this.associatedVariableName = e._getFreeVariableName(\"u_\" + this.name)), this.isConstant)\n                return e.constants.indexOf(this.associatedVariableName) !== -1 ? void 0 : (e.constants.push(this.associatedVariableName), void (e._constantDeclaration += this._declareOutput(this.output, e) + \" = \" + this._emitConstant(e) + `;\\r\n`));\n              if (e.uniforms.indexOf(this.associatedVariableName) !== -1)\n                return;\n              e.uniforms.push(this.associatedVariableName), n && (e._uniformDeclaration += this._emitDefine(n)), e._uniformDeclaration += \"uniform \" + e._getGLType(this.type) + \" \" + this.associatedVariableName + `;\\r\n`, n && (e._uniformDeclaration += `#endif\\r\n`);\n              var o = e.sharedData.hints;\n              if (this._systemValue !== null && this._systemValue !== void 0)\n                switch (this._systemValue) {\n                  case gt.WorldView:\n                    o.needWorldViewMatrix = !0;\n                    break;\n                  case gt.WorldViewProjection:\n                    o.needWorldViewProjectionMatrix = !0;\n                }\n              else\n                this._animationType !== Ni.None && e.sharedData.animatedInputs.push(this);\n            } else if (this.isAttribute) {\n              if (this.associatedVariableName = (i = z_[this.name]) !== null && i !== void 0 ? i : this.name, this.target === Ce.Vertex && e._vertexState)\n                return void (Gs[this.name] ? Yu[this.name] ? e._emitUniformFromString(this.associatedVariableName, e._getGLType(this.type), n) : e._emitVaryingFromString(this.associatedVariableName, e._getGLType(this.type), n) : this._emit(e._vertexState, n));\n              if (e.attributes.indexOf(this.associatedVariableName) !== -1)\n                return;\n              e.attributes.push(this.associatedVariableName), Gs[this.name] ? Yu[this.name] ? e._emitUniformFromString(this.associatedVariableName, e._getGLType(this.type), n) : e._emitVaryingFromString(this.associatedVariableName, e._getGLType(this.type), n) : (n && (e._attributeDeclaration += this._emitDefine(n)), e._attributeDeclaration += \"attribute \" + e._getGLType(this.type) + \" \" + this.associatedVariableName + `;\\r\n`, n && (e._attributeDeclaration += `#endif\\r\n`));\n            }\n          }, t.prototype._transmitWorld = function(e, n, i, o) {\n            if (this._systemValue) {\n              var a = this.associatedVariableName;\n              switch (this._systemValue) {\n                case gt.World:\n                  e.setMatrix(a, n);\n                  break;\n                case gt.WorldView:\n                  e.setMatrix(a, i);\n                  break;\n                case gt.WorldViewProjection:\n                  e.setMatrix(a, o);\n              }\n            }\n          }, t.prototype._transmit = function(e, n) {\n            if (!this.isAttribute) {\n              var i = this.associatedVariableName;\n              if (this._systemValue)\n                switch (this._systemValue) {\n                  case gt.World:\n                  case gt.WorldView:\n                  case gt.WorldViewProjection:\n                    return;\n                  case gt.View:\n                    e.setMatrix(i, n.getViewMatrix());\n                    break;\n                  case gt.Projection:\n                    e.setMatrix(i, n.getProjectionMatrix());\n                    break;\n                  case gt.ViewProjection:\n                    e.setMatrix(i, n.getTransformMatrix());\n                    break;\n                  case gt.CameraPosition:\n                    $e.a.BindEyePosition(e, n, i);\n                    break;\n                  case gt.FogColor:\n                    e.setColor3(i, n.fogColor);\n                    break;\n                  case gt.DeltaTime:\n                    e.setFloat(i, n.deltaTime / 1e3);\n                }\n              else {\n                var o = this._valueCallback ? this._valueCallback() : this._storedValue;\n                if (o !== null)\n                  switch (this.type) {\n                    case le.Float:\n                      e.setFloat(i, o);\n                      break;\n                    case le.Int:\n                      e.setInt(i, o);\n                      break;\n                    case le.Color3:\n                      I.c.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && I.c.Color3[0].toGammaSpaceToRef(I.c.Color3[0]), this.convertToLinearSpace && I.c.Color3[0].toLinearSpaceToRef(I.c.Color3[0]), e.setColor3(i, I.c.Color3[0]);\n                      break;\n                    case le.Color4:\n                      I.c.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && I.c.Color4[0].toGammaSpaceToRef(I.c.Color4[0]), this.convertToLinearSpace && I.c.Color4[0].toLinearSpaceToRef(I.c.Color4[0]), e.setDirectColor4(i, I.c.Color4[0]);\n                      break;\n                    case le.Vector2:\n                      e.setVector2(i, o);\n                      break;\n                    case le.Vector3:\n                      e.setVector3(i, o);\n                      break;\n                    case le.Vector4:\n                      e.setVector4(i, o);\n                      break;\n                    case le.Matrix:\n                      e.setMatrix(i, o);\n                  }\n              }\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), (this.isUniform || this.isSystemValue) && e.sharedData.inputBlocks.push(this), this._emit(e);\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName;\n            if (this.isAttribute)\n              return e + '.setAsAttribute(\"' + this.name + `\");\\r\n`;\n            if (this.isSystemValue)\n              return e + \".setAsSystemValue(BABYLON.NodeMaterialSystemValues.\" + gt[this._systemValue] + `);\\r\n`;\n            if (this.isUniform) {\n              var n = [], i = \"\";\n              switch (this.type) {\n                case le.Float:\n                  i = \"\" + this.value;\n                  break;\n                case le.Vector2:\n                  i = \"new BABYLON.Vector2(\" + this.value.x + \", \" + this.value.y + \")\";\n                  break;\n                case le.Vector3:\n                  i = \"new BABYLON.Vector3(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \")\";\n                  break;\n                case le.Vector4:\n                  i = \"new BABYLON.Vector4(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \", \" + this.value.w + \")\";\n                  break;\n                case le.Color3:\n                  i = \"new BABYLON.Color3(\" + this.value.r + \", \" + this.value.g + \", \" + this.value.b + \")\", this.convertToGammaSpace && (i += \".toGammaSpace()\"), this.convertToLinearSpace && (i += \".toLinearSpace()\");\n                  break;\n                case le.Color4:\n                  i = \"new BABYLON.Color4(\" + this.value.r + \", \" + this.value.g + \", \" + this.value.b + \", \" + this.value.a + \")\", this.convertToGammaSpace && (i += \".toGammaSpace()\"), this.convertToLinearSpace && (i += \".toLinearSpace()\");\n                  break;\n                case le.Matrix:\n                  i = \"BABYLON.Matrix.FromArray([\" + this.value.m + \"])\";\n              }\n              return n.push(e + \".value = \" + i), this.type === le.Float && n.push(e + \".min = \" + this.min, e + \".max = \" + this.max, e + \".isBoolean = \" + this.isBoolean, e + \".matrixMode = \" + this.matrixMode, e + \".animationType = BABYLON.AnimatedInputBlockTypes.\" + Ni[this.animationType]), n.push(e + \".isConstant = \" + this.isConstant), n.push(\"\"), n.join(`;\\r\n`);\n            }\n            return \"\";\n          }, t.prototype.dispose = function() {\n            this.onValueChangedObservable.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.type = this.type, e.mode = this._mode, e.systemValue = this._systemValue, e.animationType = this._animationType, e.min = this.min, e.max = this.max, e.isBoolean = this.isBoolean, e.matrixMode = this.matrixMode, e.isConstant = this.isConstant, e.groupInInspector = this.groupInInspector, e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this._storedValue != null && this._mode === gn.Uniform && (this._storedValue.asArray ? (e.valueType = \"BABYLON.\" + this._storedValue.getClassName(), e.value = this._storedValue.asArray()) : (e.valueType = \"number\", e.value = this._storedValue)), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            if (this._mode = e.mode, r.prototype._deserialize.call(this, e, n, i), this._type = e.type, this._systemValue = e.systemValue || e.wellKnownValue, this._animationType = e.animationType, this.min = e.min || 0, this.max = e.max || 0, this.isBoolean = !!e.isBoolean, this.matrixMode = e.matrixMode || 0, this.isConstant = !!e.isConstant, this.groupInInspector = e.groupInInspector || \"\", this.convertToGammaSpace = !!e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.valueType)\n              if (e.valueType === \"number\")\n                this._storedValue = e.value;\n              else {\n                var o = O.a.GetClass(e.valueType);\n                o && (this._storedValue = o.FromArray(e.value));\n              }\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.InputBlock\"] = Et;\n        var zs = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment) || this;\n            return n._samplerName = \"textureSampler\", n.convertToGammaSpace = !1, n.convertToLinearSpace = !1, n._isUnique = !1, n.registerInput(\"uv\", le.Vector2, !1, Ce.VertexAndFragment), n.registerOutput(\"rgba\", le.Color4, Ce.Neutral), n.registerOutput(\"rgb\", le.Color3, Ce.Neutral), n.registerOutput(\"r\", le.Float, Ce.Neutral), n.registerOutput(\"g\", le.Float, Ce.Neutral), n.registerOutput(\"b\", le.Float, Ce.Neutral), n.registerOutput(\"a\", le.Float, Ce.Neutral), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0]._prioritizeVertex = !1, n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"CurrentScreenBlock\";\n          }, Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"textureSampler\");\n          }, Object.defineProperty(t.prototype, \"target\", { get: function() {\n            return this.uv.isConnected ? this.uv.sourceBlock.isInput ? Ce.VertexAndFragment : Ce.Fragment : Ce.VertexAndFragment;\n          }, enumerable: !1, configurable: !0 }), t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(this._linearDefineName, this.convertToGammaSpace, !0), i.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);\n          }, t.prototype.isReady = function() {\n            return !(this.texture && !this.texture.isReadyOrNotBlocking());\n          }, t.prototype._injectVertexCode = function(e) {\n            var n = this.uv;\n            if (n.connectedPoint.ownerBlock.isInput && (n.connectedPoint.ownerBlock.isAttribute || e._emitUniformFromString(n.associatedVariableName, \"vec2\")), this._mainUVName = \"vMain\" + n.associatedVariableName, e._emitVaryingFromString(this._mainUVName, \"vec2\"), e.compilationString += this._mainUVName + \" = \" + n.associatedVariableName + `.xy;\\r\n`, this._outputs.some(function(s) {\n              return s.isConnectedInVertexShader;\n            })) {\n              this._writeTextureRead(e, !0);\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name, !0);\n              }\n            }\n          }, t.prototype._writeTextureRead = function(e, n) {\n            n === void 0 && (n = !1);\n            var i = this.uv;\n            if (n) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n            } else\n              this.uv.ownerBlock.target !== Ce.Fragment ? e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this._mainUVName + `);\\r\n` : e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n          }, t.prototype._writeOutput = function(e, n, i, o) {\n            if (o === void 0 && (o = !1), o) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n            } else\n              this.uv.ownerBlock.target !== Ce.Fragment ? (e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`, e.compilationString += \"#ifdef \" + this._linearDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toGammaSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += \"#ifdef \" + this._gammaDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toLinearSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`) : e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this._tempTextureRead = e._getFreeVariableName(\"tempTextureRead\"), e.sharedData.blockingBlocks.indexOf(this) < 0 && e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.indexOf(this) < 0 && e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.indexOf(this) < 0 && e.sharedData.blocksWithDefines.push(this), e.target !== Ce.Fragment)\n              return e._emit2DSampler(this._samplerName), void this._injectVertexCode(e);\n            if (this._outputs.some(function(s) {\n              return s.isConnectedInFragmentShader;\n            })) {\n              e._emit2DSampler(this._samplerName), this._linearDefineName = e._getFreeDefineName(\"ISLINEAR\"), this._gammaDefineName = e._getFreeDefineName(\"ISGAMMA\");\n              var n = \"//\" + this.name;\n              e._emitFunctionFromInclude(\"helperFunctions\", n), this._writeTextureRead(e);\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name);\n              }\n              return this;\n            }\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this.texture && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.CurrentScreenBlock\"] = zs;\n        var js = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._samplerName = \"diffuseSampler\", n.convertToGammaSpace = !1, n.convertToLinearSpace = !1, n._isUnique = !1, n.registerInput(\"uv\", le.Vector2, !1, Ce.VertexAndFragment), n.registerOutput(\"rgba\", le.Color4, Ce.Neutral), n.registerOutput(\"rgb\", le.Color3, Ce.Neutral), n.registerOutput(\"r\", le.Float, Ce.Neutral), n.registerOutput(\"g\", le.Float, Ce.Neutral), n.registerOutput(\"b\", le.Float, Ce.Neutral), n.registerOutput(\"a\", le.Float, Ce.Neutral), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ParticleTextureBlock\";\n          }, Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"diffuseSampler\");\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.uv.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.isAttribute && i.name === \"particle_uv\";\n              });\n              n || (n = new Et(\"uv\")).setAsAttribute(\"particle_uv\"), n.output.connectTo(this.uv);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(this._linearDefineName, this.convertToGammaSpace, !0), i.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);\n          }, t.prototype.isReady = function() {\n            return !(this.texture && !this.texture.isReadyOrNotBlocking());\n          }, t.prototype._writeOutput = function(e, n, i) {\n            e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`, e.compilationString += \"#ifdef \" + this._linearDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toGammaSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += \"#ifdef \" + this._gammaDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toLinearSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target !== Ce.Vertex) {\n              this._tempTextureRead = e._getFreeVariableName(\"tempTextureRead\"), e._emit2DSampler(this._samplerName), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), this._linearDefineName = e._getFreeDefineName(\"ISLINEAR\"), this._gammaDefineName = e._getFreeDefineName(\"ISGAMMA\");\n              var n = \"//\" + this.name;\n              e._emitFunctionFromInclude(\"helperFunctions\", n), e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this.uv.associatedVariableName + `);\\r\n`;\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name);\n              }\n              return this;\n            }\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this.texture && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ParticleTextureBlock\"] = js;\n        var Hs = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"color\", le.Color4, !1, Ce.Fragment), n.registerOutput(\"rampColor\", le.Color4, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ParticleRampGradientBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rampColor\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"remapRanges\"), e._excludeVariableName(\"rampSampler\"), e._excludeVariableName(\"baseColor\"), e._excludeVariableName(\"alpha\"), e._excludeVariableName(\"remappedColorIndex\"), e._excludeVariableName(\"rampColor\"), e._excludeVariableName(\"finalAlpha\");\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target !== Ce.Vertex)\n              return e._emit2DSampler(\"rampSampler\"), e._emitVaryingFromString(\"remapRanges\", \"vec4\", \"RAMPGRADIENT\"), e.compilationString += `\n            #ifdef RAMPGRADIENT\n                vec4 baseColor = ` + this.color.associatedVariableName + `;\n                float alpha = ` + this.color.associatedVariableName + `.a;\n\n                float remappedColorIndex = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);\n\n                vec4 rampColor = texture2D(rampSampler, vec2(1.0 - remappedColorIndex, 0.));\n                baseColor.rgb *= rampColor.rgb;\n\n                // Remapped alpha\n                float finalAlpha = baseColor.a;\n                baseColor.a = clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0);\n\n                ` + this._declareOutput(this.rampColor, e) + ` = baseColor;\n            #else\n                ` + this._declareOutput(this.rampColor, e) + \" = \" + this.color.associatedVariableName + `;\n            #endif\n        `, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ParticleRampGradientBlock\"] = Hs;\n        var Ws = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"color\", le.Color4, !1, Ce.Fragment), n.registerInput(\"alphaTexture\", le.Float, !1, Ce.Fragment), n.registerInput(\"alphaColor\", le.Float, !1, Ce.Fragment), n.registerOutput(\"blendColor\", le.Color4, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ParticleBlendMultiplyBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"alphaTexture\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"alphaColor\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blendColor\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"sourceAlpha\");\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target !== Ce.Vertex)\n              return e.compilationString += `\n            #ifdef BLENDMULTIPLYMODE\n                ` + this._declareOutput(this.blendColor, e) + `;\n                float sourceAlpha = ` + this.alphaColor.associatedVariableName + \" * \" + this.alphaTexture.associatedVariableName + `;\n                ` + this.blendColor.associatedVariableName + \".rgb = \" + this.color.associatedVariableName + `.rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha);\n                ` + this.blendColor.associatedVariableName + \".a = \" + this.color.associatedVariableName + `.a;\n            #else\n                ` + this._declareOutput(this.blendColor, e) + \" = \" + this.color.associatedVariableName + `;\n            #endif\n        `, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ParticleBlendMultiplyBlock\"] = Ws;\n        var It, so = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"xyz \", le.Vector3, !0), n.registerInput(\"xy \", le.Vector2, !0), n.registerInput(\"x\", le.Float, !0), n.registerInput(\"y\", le.Float, !0), n.registerInput(\"z\", le.Float, !0), n.registerInput(\"w\", le.Float, !0), n.registerOutput(\"xyzw\", le.Vector4), n.registerOutput(\"xyz\", le.Vector3), n.registerOutput(\"xy\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VectorMergerBlock\";\n          }, Object.defineProperty(t.prototype, \"xyzIn\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyIn\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"z\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"w\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzw\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzOut\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyOut\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xy\", { get: function() {\n            return this.xyOut;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyz\", { get: function() {\n            return this.xyzOut;\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.x, i = this.y, o = this.z, a = this.w, s = this.xyIn, d = this.xyzIn, p = this._outputs[0], y = this._outputs[1], P = this._outputs[2];\n            return d.isConnected ? p.hasEndpoints ? e.compilationString += this._declareOutput(p, e) + \" = vec4(\" + d.associatedVariableName + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : y.hasEndpoints ? e.compilationString += this._declareOutput(y, e) + \" = \" + d.associatedVariableName + `;\\r\n` : P.hasEndpoints && (e.compilationString += this._declareOutput(P, e) + \" = \" + d.associatedVariableName + `.xy;\\r\n`) : s.isConnected ? p.hasEndpoints ? e.compilationString += this._declareOutput(p, e) + \" = vec4(\" + s.associatedVariableName + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : y.hasEndpoints ? e.compilationString += this._declareOutput(y, e) + \" = vec3(\" + s.associatedVariableName + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + `);\\r\n` : P.hasEndpoints && (e.compilationString += this._declareOutput(P, e) + \" = \" + s.associatedVariableName + `;\\r\n`) : p.hasEndpoints ? e.compilationString += this._declareOutput(p, e) + \" = vec4(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : y.hasEndpoints ? e.compilationString += this._declareOutput(y, e) + \" = vec3(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + `);\\r\n` : P.hasEndpoints && (e.compilationString += this._declareOutput(P, e) + \" = vec2(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + `);\\r\n`), this;\n          }, t;\n        }(dt);\n        function Bt(r, t, e, n) {\n          return t === void 0 && (t = It.Boolean), e === void 0 && (e = \"PROPERTIES\"), function(i, o) {\n            var a = i._propStore;\n            a || (a = [], i._propStore = a), a.push({ propertyName: o, displayName: r, type: t, groupName: e, options: n ?? {} });\n          };\n        }\n        O.a.RegisteredTypes[\"BABYLON.VectorMergerBlock\"] = so, function(r) {\n          r[r.Boolean = 0] = \"Boolean\", r[r.Float = 1] = \"Float\", r[r.Vector2 = 2] = \"Vector2\", r[r.List = 3] = \"List\";\n        }(It || (It = {}));\n        var Xs = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.sourceRange = new u.d(-1, 1), n.targetRange = new u.d(0, 1), n.registerInput(\"input\", le.AutoDetect), n.registerInput(\"sourceMin\", le.Float, !0), n.registerInput(\"sourceMax\", le.Float, !0), n.registerInput(\"targetMin\", le.Float, !0), n.registerInput(\"targetMax\", le.Float, !0), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RemapBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sourceMin\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sourceMax\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"targetMin\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"targetMax\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this.sourceMin.isConnected ? this.sourceMin.associatedVariableName : this._writeFloat(this.sourceRange.x), o = this.sourceMax.isConnected ? this.sourceMax.associatedVariableName : this._writeFloat(this.sourceRange.y), a = this.targetMin.isConnected ? this.targetMin.associatedVariableName : this._writeFloat(this.targetRange.x), s = this.targetMax.isConnected ? this.targetMax.associatedVariableName : this._writeFloat(this.targetRange.y);\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + a + \" + (\" + this._inputs[0].associatedVariableName + \" - \" + i + \") * (\" + s + \" - \" + a + \") / (\" + o + \" - \" + i + `);\\r\n`, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".sourceRange = new BABYLON.Vector2(\" + this.sourceRange.x + \", \" + this.sourceRange.y + `);\\r\n`;\n            return e += this._codeVariableName + \".targetRange = new BABYLON.Vector2(\" + this.targetRange.x + \", \" + this.targetRange.y + `);\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.sourceRange = this.sourceRange.asArray(), e.targetRange = this.targetRange.asArray(), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.sourceRange = u.d.FromArray(e.sourceRange), this.targetRange = u.d.FromArray(e.targetRange);\n          }, Object(c.c)([Bt(\"From\", It.Vector2)], t.prototype, \"sourceRange\", void 0), Object(c.c)([Bt(\"To\", It.Vector2)], t.prototype, \"targetRange\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RemapBlock\"] = Xs;\n        var ra = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MultiplyBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" * \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MultiplyBlock\"] = ra;\n        var xr = function() {\n          function r() {\n            this.direction1 = new u.e(0, 1, 0), this.direction2 = new u.e(0, 1, 0), this.minEmitBox = new u.e(-0.5, -0.5, -0.5), this.maxEmitBox = new u.e(0.5, 0.5, 0.5);\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            if (i)\n              return e.x = o, e.y = a, void (e.z = s);\n            u.e.TransformNormalFromFloatsToRef(o, a, s, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(this.minEmitBox.x, this.maxEmitBox.x), a = $.a.RandomRange(this.minEmitBox.y, this.maxEmitBox.y), s = $.a.RandomRange(this.minEmitBox.z, this.maxEmitBox.z);\n            if (i)\n              return e.x = o, e.y = a, void (e.z = s);\n            u.e.TransformCoordinatesFromFloatsToRef(o, a, s, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setVector3(\"direction1\", this.direction1), t.setVector3(\"direction2\", this.direction2), t.setVector3(\"minEmitBox\", this.minEmitBox), t.setVector3(\"maxEmitBox\", this.maxEmitBox);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define BOXEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"BoxParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t.minEmitBox = this.minEmitBox.asArray(), t.maxEmitBox = this.maxEmitBox.asArray(), t;\n          }, r.prototype.parse = function(t) {\n            u.e.FromArrayToRef(t.direction1, 0, this.direction1), u.e.FromArrayToRef(t.direction2, 0, this.direction2), u.e.FromArrayToRef(t.minEmitBox, 0, this.minEmitBox), u.e.FromArrayToRef(t.maxEmitBox, 0, this.maxEmitBox);\n          }, r;\n        }(), Ys = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = Math.PI), n === void 0 && (n = 0), this.directionRandomizer = n, this.radiusRange = 1, this.heightRange = 1, this.emitFromSpawnPointOnly = !1, this.angle = e, this.radius = t;\n          }\n          return Object.defineProperty(r.prototype, \"radius\", { get: function() {\n            return this._radius;\n          }, set: function(t) {\n            this._radius = t, this._buildHeight();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"angle\", { get: function() {\n            return this._angle;\n          }, set: function(t) {\n            this._angle = t, this._buildHeight();\n          }, enumerable: !1, configurable: !0 }), r.prototype._buildHeight = function() {\n            this._angle !== 0 ? this._height = this._radius / Math.tan(this._angle / 2) : this._height = 1;\n          }, r.prototype.startDirectionFunction = function(t, e, n, i) {\n            i ? u.c.Vector3[0].copyFrom(n._localPosition).normalize() : n.position.subtractToRef(t.getTranslation(), u.c.Vector3[0]).normalize();\n            var o = $.a.RandomRange(0, this.directionRandomizer), a = $.a.RandomRange(0, this.directionRandomizer), s = $.a.RandomRange(0, this.directionRandomizer);\n            e.x = u.c.Vector3[0].x + o, e.y = u.c.Vector3[0].y + a, e.z = u.c.Vector3[0].z + s, e.normalize();\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o, a = $.a.RandomRange(0, 2 * Math.PI);\n            o = this.emitFromSpawnPointOnly ? 1e-4 : 1 - (o = $.a.RandomRange(0, this.heightRange)) * o;\n            var s = this._radius - $.a.RandomRange(0, this._radius * this.radiusRange), d = (s *= o) * Math.sin(a), p = s * Math.cos(a), y = o * this._height;\n            if (i)\n              return e.x = d, e.y = y, void (e.z = p);\n            u.e.TransformCoordinatesFromFloatsToRef(d, y, p, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this._radius, this._angle, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat2(\"radius\", this._radius, this.radiusRange), t.setFloat(\"coneAngle\", this._angle), t.setFloat2(\"height\", this._height, this.heightRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            var t = \"#define CONEEMITTER\";\n            return this.emitFromSpawnPointOnly && (t += `\n#define CONEEMITTERSPAWNPOINT`), t;\n          }, r.prototype.getClassName = function() {\n            return \"ConeParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this._radius, t.angle = this._angle, t.directionRandomizer = this.directionRandomizer, t.radiusRange = this.radiusRange, t.heightRange = this.heightRange, t.emitFromSpawnPointOnly = this.emitFromSpawnPointOnly, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.angle = t.angle, this.directionRandomizer = t.directionRandomizer, this.radiusRange = t.radiusRange !== void 0 ? t.radiusRange : 1, this.heightRange = t.radiusRange !== void 0 ? t.heightRange : 1, this.emitFromSpawnPointOnly = t.emitFromSpawnPointOnly !== void 0 && t.emitFromSpawnPointOnly;\n          }, r;\n        }(), oa = function() {\n          function r(t, e, n, i) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = 0), this.radius = t, this.height = e, this.radiusRange = n, this.directionRandomizer = i;\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = n.position.subtract(t.getTranslation()).normalize(), a = $.a.RandomRange(-this.directionRandomizer / 2, this.directionRandomizer / 2), s = Math.atan2(o.x, o.z);\n            s += $.a.RandomRange(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer, o.y = a, o.x = Math.sin(s), o.z = Math.cos(s), o.normalize(), i ? e.copyFrom(o) : u.e.TransformNormalFromFloatsToRef(o.x, o.y, o.z, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(-this.height / 2, this.height / 2), a = $.a.RandomRange(0, 2 * Math.PI), s = $.a.RandomRange((1 - this.radiusRange) * (1 - this.radiusRange), 1), d = Math.sqrt(s) * this.radius, p = d * Math.cos(a), y = d * Math.sin(a);\n            i ? e.copyFromFloats(p, o, y) : u.e.TransformCoordinatesFromFloatsToRef(p, o, y, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this.radius, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat(\"radius\", this.radius), t.setFloat(\"height\", this.height), t.setFloat(\"radiusRange\", this.radiusRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define CYLINDEREMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"CylinderParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this.radius, t.height = this.height, t.radiusRange = this.radiusRange, t.directionRandomizer = this.directionRandomizer, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.height = t.height, this.radiusRange = t.radiusRange, this.directionRandomizer = t.directionRandomizer;\n          }, r;\n        }(), Ks = function(r) {\n          function t(e, n, i, o, a) {\n            e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = 1), o === void 0 && (o = new u.e(0, 1, 0)), a === void 0 && (a = new u.e(0, 1, 0));\n            var s = r.call(this, e, n, i) || this;\n            return s.direction1 = o, s.direction2 = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.startDirectionFunction = function(e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            u.e.TransformNormalFromFloatsToRef(o, a, s, e, n);\n          }, t.prototype.clone = function() {\n            var e = new t(this.radius, this.height, this.radiusRange, this.direction1, this.direction2);\n            return de.a.DeepCopy(this, e), e;\n          }, t.prototype.applyToShader = function(e) {\n            e.setFloat(\"radius\", this.radius), e.setFloat(\"height\", this.height), e.setFloat(\"radiusRange\", this.radiusRange), e.setVector3(\"direction1\", this.direction1), e.setVector3(\"direction2\", this.direction2);\n          }, t.prototype.getEffectDefines = function() {\n            return `#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER`;\n          }, t.prototype.getClassName = function() {\n            return \"CylinderDirectedParticleEmitter\";\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;\n          }, t.prototype.parse = function(e) {\n            r.prototype.parse.call(this, e), this.direction1.copyFrom(e.direction1), this.direction2.copyFrom(e.direction2);\n          }, t;\n        }(oa), Qs = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 0), this.radius = t, this.radiusRange = e, this.directionRandomizer = n;\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = n.position.subtract(t.getTranslation()).normalize(), a = $.a.RandomRange(0, this.directionRandomizer), s = $.a.RandomRange(0, this.directionRandomizer), d = $.a.RandomRange(0, this.directionRandomizer);\n            o.x += a, o.y += s, o.z += d, o.normalize(), i ? e.copyFrom(o) : u.e.TransformNormalFromFloatsToRef(o.x, o.y, o.z, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = this.radius - $.a.RandomRange(0, this.radius * this.radiusRange), a = $.a.RandomRange(0, 1), s = $.a.RandomRange(0, 2 * Math.PI), d = Math.acos(2 * a - 1), p = o * Math.cos(s) * Math.sin(d), y = o * Math.cos(d), P = o * Math.sin(s) * Math.sin(d);\n            i ? e.copyFromFloats(p, Math.abs(y), P) : u.e.TransformCoordinatesFromFloatsToRef(p, Math.abs(y), P, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this.radius, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat(\"radius\", this.radius), t.setFloat(\"radiusRange\", this.radiusRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define HEMISPHERICEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"HemisphericParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this.radius, t.radiusRange = this.radiusRange, t.directionRandomizer = this.directionRandomizer, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.radiusRange = t.radiusRange, this.directionRandomizer = t.directionRandomizer;\n          }, r;\n        }(), qs = function() {\n          function r() {\n            this.direction1 = new u.e(0, 1, 0), this.direction2 = new u.e(0, 1, 0);\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            i ? e.copyFromFloats(o, a, s) : u.e.TransformNormalFromFloatsToRef(o, a, s, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            i ? e.copyFromFloats(0, 0, 0) : u.e.TransformCoordinatesFromFloatsToRef(0, 0, 0, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setVector3(\"direction1\", this.direction1), t.setVector3(\"direction2\", this.direction2);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define POINTEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"PointParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t;\n          }, r.prototype.parse = function(t) {\n            u.e.FromArrayToRef(t.direction1, 0, this.direction1), u.e.FromArrayToRef(t.direction2, 0, this.direction2);\n          }, r;\n        }(), aa = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 0), this.radius = t, this.radiusRange = e, this.directionRandomizer = n;\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = n.position.subtract(t.getTranslation()).normalize(), a = $.a.RandomRange(0, this.directionRandomizer), s = $.a.RandomRange(0, this.directionRandomizer), d = $.a.RandomRange(0, this.directionRandomizer);\n            o.x += a, o.y += s, o.z += d, o.normalize(), i ? e.copyFrom(o) : u.e.TransformNormalFromFloatsToRef(o.x, o.y, o.z, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = this.radius - $.a.RandomRange(0, this.radius * this.radiusRange), a = $.a.RandomRange(0, 1), s = $.a.RandomRange(0, 2 * Math.PI), d = Math.acos(2 * a - 1), p = o * Math.cos(s) * Math.sin(d), y = o * Math.cos(d), P = o * Math.sin(s) * Math.sin(d);\n            i ? e.copyFromFloats(p, y, P) : u.e.TransformCoordinatesFromFloatsToRef(p, y, P, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this.radius, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat(\"radius\", this.radius), t.setFloat(\"radiusRange\", this.radiusRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define SPHEREEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"SphereParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this.radius, t.radiusRange = this.radiusRange, t.directionRandomizer = this.directionRandomizer, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.radiusRange = t.radiusRange, this.directionRandomizer = t.directionRandomizer;\n          }, r;\n        }(), Zs = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = 1), n === void 0 && (n = new u.e(0, 1, 0)), i === void 0 && (i = new u.e(0, 1, 0));\n            var o = r.call(this, e) || this;\n            return o.direction1 = n, o.direction2 = i, o;\n          }\n          return Object(c.d)(t, r), t.prototype.startDirectionFunction = function(e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            u.e.TransformNormalFromFloatsToRef(o, a, s, e, n);\n          }, t.prototype.clone = function() {\n            var e = new t(this.radius, this.direction1, this.direction2);\n            return de.a.DeepCopy(this, e), e;\n          }, t.prototype.applyToShader = function(e) {\n            e.setFloat(\"radius\", this.radius), e.setFloat(\"radiusRange\", this.radiusRange), e.setVector3(\"direction1\", this.direction1), e.setVector3(\"direction2\", this.direction2);\n          }, t.prototype.getEffectDefines = function() {\n            return `#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER`;\n          }, t.prototype.getClassName = function() {\n            return \"SphereDirectedParticleEmitter\";\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;\n          }, t.prototype.parse = function(e) {\n            r.prototype.parse.call(this, e), this.direction1.copyFrom(e.direction1), this.direction2.copyFrom(e.direction2);\n          }, t;\n        }(aa), Cr = function() {\n          function r() {\n            this.particlePositionGenerator = function() {\n            }, this.particleDestinationGenerator = function() {\n            };\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = u.c.Vector3[0];\n            if (this.particleDestinationGenerator) {\n              this.particleDestinationGenerator(-1, n, o);\n              var a = u.c.Vector3[1];\n              o.subtractToRef(n.position, a), a.scaleToRef(1 / n.lifeTime, o);\n            } else\n              o.set(0, 0, 0);\n            i ? e.copyFrom(o) : u.e.TransformNormalToRef(o, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = u.c.Vector3[0];\n            this.particlePositionGenerator ? this.particlePositionGenerator(-1, n, o) : o.set(0, 0, 0), i ? e.copyFrom(o) : u.e.TransformCoordinatesToRef(o, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define CUSTOMEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"CustomParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t;\n          }, r.prototype.parse = function(t) {\n          }, r;\n        }(), Ku = function() {\n          function r(t) {\n            t === void 0 && (t = null), this._indices = null, this._positions = null, this._normals = null, this._storedNormal = u.e.Zero(), this._mesh = null, this.direction1 = new u.e(0, 1, 0), this.direction2 = new u.e(0, 1, 0), this.useMeshNormalsForDirection = !0, this.mesh = t;\n          }\n          return Object.defineProperty(r.prototype, \"mesh\", { get: function() {\n            return this._mesh;\n          }, set: function(t) {\n            this._mesh !== t && (this._mesh = t, t ? (this._indices = t.getIndices(), this._positions = t.getVerticesData(Oe.b.PositionKind), this._normals = t.getVerticesData(Oe.b.NormalKind)) : (this._indices = null, this._positions = null, this._normals = null));\n          }, enumerable: !1, configurable: !0 }), r.prototype.startDirectionFunction = function(t, e, n, i) {\n            if (this.useMeshNormalsForDirection && this._normals)\n              u.e.TransformNormalToRef(this._storedNormal, t, e);\n            else {\n              var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n              i ? e.copyFromFloats(o, a, s) : u.e.TransformNormalFromFloatsToRef(o, a, s, t, e);\n            }\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            if (this._indices && this._positions) {\n              var o = 3 * Math.random() * (this._indices.length / 3) | 0, a = Math.random(), s = Math.random() * (1 - a), d = 1 - a - s, p = this._indices[o], y = this._indices[o + 1], P = this._indices[o + 2], R = u.c.Vector3[0], B = u.c.Vector3[1], F = u.c.Vector3[2], z = u.c.Vector3[3];\n              u.e.FromArrayToRef(this._positions, 3 * p, R), u.e.FromArrayToRef(this._positions, 3 * y, B), u.e.FromArrayToRef(this._positions, 3 * P, F), z.x = a * R.x + s * B.x + d * F.x, z.y = a * R.y + s * B.y + d * F.y, z.z = a * R.z + s * B.z + d * F.z, i ? e.copyFromFloats(z.x, z.y, z.z) : u.e.TransformCoordinatesFromFloatsToRef(z.x, z.y, z.z, t, e), this.useMeshNormalsForDirection && this._normals && (u.e.FromArrayToRef(this._normals, 3 * p, R), u.e.FromArrayToRef(this._normals, 3 * y, B), u.e.FromArrayToRef(this._normals, 3 * P, F), this._storedNormal.x = a * R.x + s * B.x + d * F.x, this._storedNormal.y = a * R.y + s * B.y + d * F.y, this._storedNormal.z = a * R.z + s * B.z + d * F.z);\n            }\n          }, r.prototype.clone = function() {\n            var t = new r(this.mesh);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setVector3(\"direction1\", this.direction1), t.setVector3(\"direction2\", this.direction2);\n          }, r.prototype.getEffectDefines = function() {\n            return \"\";\n          }, r.prototype.getClassName = function() {\n            return \"MeshParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t, e = {};\n            return e.type = this.getClassName(), e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e.meshId = (t = this.mesh) === null || t === void 0 ? void 0 : t.id, e.useMeshNormalsForDirection = this.useMeshNormalsForDirection, e;\n          }, r.prototype.parse = function(t, e) {\n            u.e.FromArrayToRef(t.direction1, 0, this.direction1), u.e.FromArrayToRef(t.direction2, 0, this.direction2), t.meshId && e && (this.mesh = e.getLastMeshByID(t.meshId)), this.useMeshNormalsForDirection = t.useMeshNormalsForDirection;\n          }, r;\n        }(), co = function() {\n          function r(t) {\n            this.animations = [], this.renderingGroupId = 0, this.emitter = u.e.Zero(), this.emitRate = 10, this.manualEmitCount = -1, this.updateSpeed = 0.01, this.targetStopDuration = 0, this.disposeOnStop = !1, this.minEmitPower = 1, this.maxEmitPower = 1, this.minLifeTime = 1, this.maxLifeTime = 1, this.minSize = 1, this.maxSize = 1, this.minScaleX = 1, this.maxScaleX = 1, this.minScaleY = 1, this.maxScaleY = 1, this.minInitialRotation = 0, this.maxInitialRotation = 0, this.minAngularSpeed = 0, this.maxAngularSpeed = 0, this.layerMask = 268435455, this.customShader = null, this.preventAutoStart = !1, this.noiseStrength = new u.e(10, 10, 10), this.onAnimationEnd = null, this.blendMode = r.BLENDMODE_ONEONE, this.forceDepthWrite = !1, this.preWarmCycles = 0, this.preWarmStepOffset = 1, this.spriteCellChangeSpeed = 1, this.startSpriteCellID = 0, this.endSpriteCellID = 0, this.spriteCellWidth = 0, this.spriteCellHeight = 0, this.spriteRandomStartCell = !1, this.translationPivot = new u.d(0, 0), this.beginAnimationOnStart = !1, this.beginAnimationFrom = 0, this.beginAnimationTo = 60, this.beginAnimationLoop = !1, this.worldOffset = new u.e(0, 0, 0), this.gravity = u.e.Zero(), this._colorGradients = null, this._sizeGradients = null, this._lifeTimeGradients = null, this._angularSpeedGradients = null, this._velocityGradients = null, this._limitVelocityGradients = null, this._dragGradients = null, this._emitRateGradients = null, this._startSizeGradients = null, this._rampGradients = null, this._colorRemapGradients = null, this._alphaRemapGradients = null, this.startDelay = 0, this.limitVelocityDamping = 0.4, this.color1 = new I.b(1, 1, 1, 1), this.color2 = new I.b(1, 1, 1, 1), this.colorDead = new I.b(0, 0, 0, 1), this.textureMask = new I.b(1, 1, 1, 1), this._isSubEmitter = !1, this.billboardMode = h.a.PARTICLES_BILLBOARDMODE_ALL, this._isBillboardBased = !0, this._imageProcessingConfigurationDefines = new vn.b(), this.id = t, this.name = t;\n          }\n          return Object.defineProperty(r.prototype, \"noiseTexture\", { get: function() {\n            return this._noiseTexture;\n          }, set: function(t) {\n            this._noiseTexture !== t && (this._noiseTexture = t, this._reset());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isAnimationSheetEnabled\", { get: function() {\n            return this._isAnimationSheetEnabled;\n          }, set: function(t) {\n            this._isAnimationSheetEnabled != t && (this._isAnimationSheetEnabled = t, this._reset());\n          }, enumerable: !1, configurable: !0 }), r.prototype.getScene = function() {\n            return this._scene;\n          }, r.prototype._hasTargetStopDurationDependantGradient = function() {\n            return this._startSizeGradients && this._startSizeGradients.length > 0 || this._emitRateGradients && this._emitRateGradients.length > 0 || this._lifeTimeGradients && this._lifeTimeGradients.length > 0;\n          }, r.prototype.getDragGradients = function() {\n            return this._dragGradients;\n          }, r.prototype.getLimitVelocityGradients = function() {\n            return this._limitVelocityGradients;\n          }, r.prototype.getColorGradients = function() {\n            return this._colorGradients;\n          }, r.prototype.getSizeGradients = function() {\n            return this._sizeGradients;\n          }, r.prototype.getColorRemapGradients = function() {\n            return this._colorRemapGradients;\n          }, r.prototype.getAlphaRemapGradients = function() {\n            return this._alphaRemapGradients;\n          }, r.prototype.getLifeTimeGradients = function() {\n            return this._lifeTimeGradients;\n          }, r.prototype.getAngularSpeedGradients = function() {\n            return this._angularSpeedGradients;\n          }, r.prototype.getVelocityGradients = function() {\n            return this._velocityGradients;\n          }, r.prototype.getStartSizeGradients = function() {\n            return this._startSizeGradients;\n          }, r.prototype.getEmitRateGradients = function() {\n            return this._emitRateGradients;\n          }, Object.defineProperty(r.prototype, \"direction1\", { get: function() {\n            return this.particleEmitterType.direction1 ? this.particleEmitterType.direction1 : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.direction1 && (this.particleEmitterType.direction1 = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"direction2\", { get: function() {\n            return this.particleEmitterType.direction2 ? this.particleEmitterType.direction2 : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.direction2 && (this.particleEmitterType.direction2 = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"minEmitBox\", { get: function() {\n            return this.particleEmitterType.minEmitBox ? this.particleEmitterType.minEmitBox : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.minEmitBox && (this.particleEmitterType.minEmitBox = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxEmitBox\", { get: function() {\n            return this.particleEmitterType.maxEmitBox ? this.particleEmitterType.maxEmitBox : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.maxEmitBox && (this.particleEmitterType.maxEmitBox = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isBillboardBased\", { get: function() {\n            return this._isBillboardBased;\n          }, set: function(t) {\n            this._isBillboardBased !== t && (this._isBillboardBased = t, this._reset());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(t) {\n            this._attachImageProcessingConfiguration(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._attachImageProcessingConfiguration = function(t) {\n            t !== this._imageProcessingConfiguration && (!t && this._scene ? this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration : this._imageProcessingConfiguration = t);\n          }, r.prototype._reset = function() {\n          }, r.prototype._removeGradientAndTexture = function(t, e, n) {\n            if (!e)\n              return this;\n            for (var i = 0, o = 0, a = e; o < a.length; o++) {\n              if (a[o].gradient === t) {\n                e.splice(i, 1);\n                break;\n              }\n              i++;\n            }\n            return n && n.dispose(), this;\n          }, r.prototype.createPointEmitter = function(t, e) {\n            var n = new qs();\n            return n.direction1 = t, n.direction2 = e, this.particleEmitterType = n, n;\n          }, r.prototype.createHemisphericEmitter = function(t, e) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1);\n            var n = new Qs(t, e);\n            return this.particleEmitterType = n, n;\n          }, r.prototype.createSphereEmitter = function(t, e) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1);\n            var n = new aa(t, e);\n            return this.particleEmitterType = n, n;\n          }, r.prototype.createDirectedSphereEmitter = function(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = new u.e(0, 1, 0)), n === void 0 && (n = new u.e(0, 1, 0));\n            var i = new Zs(t, e, n);\n            return this.particleEmitterType = i, i;\n          }, r.prototype.createCylinderEmitter = function(t, e, n, i) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = 0);\n            var o = new oa(t, e, n, i);\n            return this.particleEmitterType = o, o;\n          }, r.prototype.createDirectedCylinderEmitter = function(t, e, n, i, o) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = new u.e(0, 1, 0)), o === void 0 && (o = new u.e(0, 1, 0));\n            var a = new Ks(t, e, n, i, o);\n            return this.particleEmitterType = a, a;\n          }, r.prototype.createConeEmitter = function(t, e) {\n            t === void 0 && (t = 1), e === void 0 && (e = Math.PI / 4);\n            var n = new Ys(t, e);\n            return this.particleEmitterType = n, n;\n          }, r.prototype.createBoxEmitter = function(t, e, n, i) {\n            var o = new xr();\n            return this.particleEmitterType = o, this.direction1 = t, this.direction2 = e, this.minEmitBox = n, this.maxEmitBox = i, o;\n          }, r.BLENDMODE_ONEONE = 0, r.BLENDMODE_STANDARD = 1, r.BLENDMODE_ADD = 2, r.BLENDMODE_MULTIPLY = 3, r.BLENDMODE_MULTIPLYADD = 4, r;\n        }(), Js = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"rgba\", le.Color4, !0), n.registerInput(\"rgb \", le.Color3, !0), n.registerOutput(\"rgb\", le.Color3), n.registerOutput(\"r\", le.Float), n.registerOutput(\"g\", le.Float), n.registerOutput(\"b\", le.Float), n.registerOutput(\"a\", le.Float), n.inputsAreExclusive = !0, n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ColorSplitterBlock\";\n          }, Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgbIn\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgbOut\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), t.prototype._inputRename = function(e) {\n            return e === \"rgb \" ? \"rgbIn\" : e;\n          }, t.prototype._outputRename = function(e) {\n            return e === \"rgb\" ? \"rgbOut\" : e;\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.rgba.isConnected ? this.rgba : this.rgbIn;\n            if (n.isConnected) {\n              var i = this._outputs[0], o = this._outputs[1], a = this._outputs[2], s = this._outputs[3], d = this._outputs[4];\n              return i.hasEndpoints && (e.compilationString += this._declareOutput(i, e) + \" = \" + n.associatedVariableName + `.rgb;\\r\n`), o.hasEndpoints && (e.compilationString += this._declareOutput(o, e) + \" = \" + n.associatedVariableName + `.r;\\r\n`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + \" = \" + n.associatedVariableName + `.g;\\r\n`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + \" = \" + n.associatedVariableName + `.b;\\r\n`), d.hasEndpoints && (e.compilationString += this._declareOutput(d, e) + \" = \" + n.associatedVariableName + `.a;\\r\n`), this;\n            }\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ColorSplitterBlock\"] = Js;\n        var tn, Qu = f(104);\n        (function(r) {\n          r[r.Cos = 0] = \"Cos\", r[r.Sin = 1] = \"Sin\", r[r.Abs = 2] = \"Abs\", r[r.Exp = 3] = \"Exp\", r[r.Exp2 = 4] = \"Exp2\", r[r.Round = 5] = \"Round\", r[r.Floor = 6] = \"Floor\", r[r.Ceiling = 7] = \"Ceiling\", r[r.Sqrt = 8] = \"Sqrt\", r[r.Log = 9] = \"Log\", r[r.Tan = 10] = \"Tan\", r[r.ArcTan = 11] = \"ArcTan\", r[r.ArcCos = 12] = \"ArcCos\", r[r.ArcSin = 13] = \"ArcSin\", r[r.Fract = 14] = \"Fract\", r[r.Sign = 15] = \"Sign\", r[r.Radians = 16] = \"Radians\", r[r.Degrees = 17] = \"Degrees\";\n        })(tn || (tn = {}));\n        var $s = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.operation = tn.Cos, n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TrigonometryBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = \"\";\n            switch (this.operation) {\n              case tn.Cos:\n                i = \"cos\";\n                break;\n              case tn.Sin:\n                i = \"sin\";\n                break;\n              case tn.Abs:\n                i = \"abs\";\n                break;\n              case tn.Exp:\n                i = \"exp\";\n                break;\n              case tn.Exp2:\n                i = \"exp2\";\n                break;\n              case tn.Round:\n                i = \"round\";\n                break;\n              case tn.Floor:\n                i = \"floor\";\n                break;\n              case tn.Ceiling:\n                i = \"ceil\";\n                break;\n              case tn.Sqrt:\n                i = \"sqrt\";\n                break;\n              case tn.Log:\n                i = \"log\";\n                break;\n              case tn.Tan:\n                i = \"tan\";\n                break;\n              case tn.ArcTan:\n                i = \"atan\";\n                break;\n              case tn.ArcCos:\n                i = \"acos\";\n                break;\n              case tn.ArcSin:\n                i = \"asin\";\n                break;\n              case tn.Fract:\n                i = \"fract\";\n                break;\n              case tn.Sign:\n                i = \"sign\";\n                break;\n              case tn.Radians:\n                i = \"radians\";\n                break;\n              case tn.Degrees:\n                i = \"degrees\";\n            }\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + i + \"(\" + this.input.associatedVariableName + `);\\r\n`, this;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.operation = this.operation, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.operation = e.operation;\n          }, t.prototype._dumpPropertiesCode = function() {\n            return this._codeVariableName + \".operation = BABYLON.TrigonometryBlockOperations.\" + tn[this.operation] + `;\\r\n`;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.TrigonometryBlock\"] = $s;\n        var ec = { effect: null, subMesh: null }, lo = function(r) {\n          function t() {\n            var e = r.call(this) || this;\n            return e.NORMAL = !1, e.TANGENT = !1, e.UV1 = !1, e.NUM_BONE_INFLUENCERS = 0, e.BonesPerMesh = 0, e.BONETEXTURE = !1, e.MORPHTARGETS = !1, e.MORPHTARGETS_NORMAL = !1, e.MORPHTARGETS_TANGENT = !1, e.MORPHTARGETS_UV = !1, e.NUM_MORPH_INFLUENCERS = 0, e.IMAGEPROCESSING = !1, e.VIGNETTE = !1, e.VIGNETTEBLENDMODEMULTIPLY = !1, e.VIGNETTEBLENDMODEOPAQUE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.EXPOSURE = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = !1, e.SAMPLER3DBGRMAP = !1, e.IMAGEPROCESSINGPOSTPROCESS = !1, e.BUMPDIRECTUV = 0, e.rebuild(), e;\n          }\n          return Object(c.d)(t, r), t.prototype.setValue = function(e, n, i) {\n            i === void 0 && (i = !1), this[e] === void 0 && this._keys.push(e), i && this[e] !== n && this.markAsUnprocessed(), this[e] = n;\n          }, t;\n        }(zo.a), sa = function(r) {\n          function t(e, n, i) {\n            i === void 0 && (i = {});\n            var o = r.call(this, e, n || Ue.a.LastCreatedScene) || this;\n            return o._buildId = t._BuildIdGenerator++, o._buildWasSuccessful = !1, o._cachedWorldViewMatrix = new u.a(), o._cachedWorldViewProjectionMatrix = new u.a(), o._optimizers = new Array(), o._animationFrame = -1, o.BJSNODEMATERIALEDITOR = o._getGlobalNodeMaterialEditor(), o.editorData = null, o.ignoreAlpha = !1, o.maxSimultaneousLights = 4, o.onBuildObservable = new C.c(), o._vertexOutputNodes = new Array(), o._fragmentOutputNodes = new Array(), o.attachedBlocks = new Array(), o._mode = Rn.Material, o._options = Object(c.a)({ emitComments: !1 }, i), o._attachImageProcessingConfiguration(null), o;\n          }\n          return Object(c.d)(t, r), t.prototype._getGlobalNodeMaterialEditor = function() {\n            return typeof NODEEDITOR < \"u\" ? NODEEDITOR : typeof BABYLON < \"u\" && BABYLON.NodeEditor !== void 0 ? BABYLON : void 0;\n          }, Object.defineProperty(t.prototype, \"options\", { get: function() {\n            return this._options;\n          }, set: function(e) {\n            this._options = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"mode\", { get: function() {\n            return this._mode;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"NodeMaterial\";\n          }, t.prototype._attachImageProcessingConfiguration = function(e) {\n            var n = this;\n            e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              n._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, t.prototype.getBlockByName = function(e) {\n            for (var n = null, i = 0, o = this.attachedBlocks; i < o.length; i++) {\n              var a = o[i];\n              if (a.name === e) {\n                if (n)\n                  return Xe.b.Warn(\"More than one block was found with the name `\" + e + \"`\"), n;\n                n = a;\n              }\n            }\n            return n;\n          }, t.prototype.getBlockByPredicate = function(e) {\n            for (var n = 0, i = this.attachedBlocks; n < i.length; n++) {\n              var o = i[n];\n              if (e(o))\n                return o;\n            }\n            return null;\n          }, t.prototype.getInputBlockByPredicate = function(e) {\n            for (var n = 0, i = this.attachedBlocks; n < i.length; n++) {\n              var o = i[n];\n              if (o.isInput && e(o))\n                return o;\n            }\n            return null;\n          }, t.prototype.getInputBlocks = function() {\n            for (var e = [], n = 0, i = this.attachedBlocks; n < i.length; n++) {\n              var o = i[n];\n              o.isInput && e.push(o);\n            }\n            return e;\n          }, t.prototype.registerOptimizer = function(e) {\n            if (!(this._optimizers.indexOf(e) > -1))\n              return this._optimizers.push(e), this;\n          }, t.prototype.unregisterOptimizer = function(e) {\n            var n = this._optimizers.indexOf(e);\n            if (n !== -1)\n              return this._optimizers.splice(n, 1), this;\n          }, t.prototype.addOutputNode = function(e) {\n            if (e.target === null)\n              throw \"This node is not meant to be an output node. You may want to explicitly set its target value.\";\n            return e.target & Ce.Vertex && this._addVertexOutputNode(e), e.target & Ce.Fragment && this._addFragmentOutputNode(e), this;\n          }, t.prototype.removeOutputNode = function(e) {\n            return e.target === null || (e.target & Ce.Vertex && this._removeVertexOutputNode(e), e.target & Ce.Fragment && this._removeFragmentOutputNode(e)), this;\n          }, t.prototype._addVertexOutputNode = function(e) {\n            if (this._vertexOutputNodes.indexOf(e) === -1)\n              return e.target = Ce.Vertex, this._vertexOutputNodes.push(e), this;\n          }, t.prototype._removeVertexOutputNode = function(e) {\n            var n = this._vertexOutputNodes.indexOf(e);\n            if (n !== -1)\n              return this._vertexOutputNodes.splice(n, 1), this;\n          }, t.prototype._addFragmentOutputNode = function(e) {\n            if (this._fragmentOutputNodes.indexOf(e) === -1)\n              return e.target = Ce.Fragment, this._fragmentOutputNodes.push(e), this;\n          }, t.prototype._removeFragmentOutputNode = function(e) {\n            var n = this._fragmentOutputNodes.indexOf(e);\n            if (n !== -1)\n              return this._fragmentOutputNodes.splice(n, 1), this;\n          }, t.prototype.needAlphaBlending = function() {\n            return !this.ignoreAlpha && (this.alpha < 1 || this._sharedData && this._sharedData.hints.needAlphaBlending);\n          }, t.prototype.needAlphaTesting = function() {\n            return this._sharedData && this._sharedData.hints.needAlphaTesting;\n          }, t.prototype._initializeBlock = function(e, n, i) {\n            if (e.initialize(n), e.autoConfigure(this), e._preparationId = this._buildId, this.attachedBlocks.indexOf(e) === -1) {\n              if (e.isUnique) {\n                for (var o = e.getClassName(), a = 0, s = this.attachedBlocks; a < s.length; a++)\n                  if (s[a].getClassName() === o)\n                    throw \"Cannot have multiple blocks of type \" + o + \" in the same NodeMaterial\";\n              }\n              this.attachedBlocks.push(e);\n            }\n            for (var d = 0, p = e.inputs; d < p.length; d++) {\n              var y = p[d];\n              y.associatedVariableName = \"\";\n              var P = y.connectedPoint;\n              if (P) {\n                var R = P.ownerBlock;\n                R !== e && ((R.target === Ce.VertexAndFragment || n.target === Ce.Fragment && R.target === Ce.Vertex && R._preparationId !== this._buildId) && i.push(R), this._initializeBlock(R, n, i));\n              }\n            }\n            for (var B = 0, F = e.outputs; B < F.length; B++)\n              F[B].associatedVariableName = \"\";\n          }, t.prototype._resetDualBlocks = function(e, n) {\n            e.target === Ce.VertexAndFragment && (e.buildId = n);\n            for (var i = 0, o = e.inputs; i < o.length; i++) {\n              var a = o[i].connectedPoint;\n              if (a) {\n                var s = a.ownerBlock;\n                s !== e && this._resetDualBlocks(s, n);\n              }\n            }\n          }, t.prototype.removeBlock = function(e) {\n            var n = this.attachedBlocks.indexOf(e);\n            n > -1 && this.attachedBlocks.splice(n, 1), e.isFinalMerger && this.removeOutputNode(e);\n          }, t.prototype.build = function(e) {\n            e === void 0 && (e = !1), this._buildWasSuccessful = !1;\n            var n = this.getScene().getEngine(), i = this._mode === Rn.Particle;\n            if (this._vertexOutputNodes.length === 0 && !i)\n              throw \"You must define at least one vertexOutputNode\";\n            if (this._fragmentOutputNodes.length === 0)\n              throw \"You must define at least one fragmentOutputNode\";\n            this._vertexCompilationState = new Xu(), this._vertexCompilationState.supportUniformBuffers = n.supportsUniformBuffers, this._vertexCompilationState.target = Ce.Vertex, this._fragmentCompilationState = new Xu(), this._fragmentCompilationState.supportUniformBuffers = n.supportsUniformBuffers, this._fragmentCompilationState.target = Ce.Fragment, this._sharedData = new G_(), this._vertexCompilationState.sharedData = this._sharedData, this._fragmentCompilationState.sharedData = this._sharedData, this._sharedData.buildId = this._buildId, this._sharedData.emitComments = this._options.emitComments, this._sharedData.verbose = e, this._sharedData.scene = this.getScene(), this._sharedData.allowEmptyVertexProgram = i;\n            for (var o = [], a = [], s = 0, d = this._vertexOutputNodes; s < d.length; s++) {\n              var p = d[s];\n              o.push(p), this._initializeBlock(p, this._vertexCompilationState, a);\n            }\n            for (var y = 0, P = this._fragmentOutputNodes; y < P.length; y++) {\n              var R = P[y];\n              a.push(R), this._initializeBlock(R, this._fragmentCompilationState, o);\n            }\n            this.optimize();\n            for (var B = 0, F = o; B < F.length; B++)\n              (p = F[B]).build(this._vertexCompilationState, o);\n            this._fragmentCompilationState.uniforms = this._vertexCompilationState.uniforms.slice(0), this._fragmentCompilationState._uniformDeclaration = this._vertexCompilationState._uniformDeclaration, this._fragmentCompilationState._constantDeclaration = this._vertexCompilationState._constantDeclaration, this._fragmentCompilationState._vertexState = this._vertexCompilationState;\n            for (var z = 0, J = a; z < J.length; z++)\n              R = J[z], this._resetDualBlocks(R, this._buildId - 1);\n            for (var ie = 0, se = a; ie < se.length; ie++)\n              (R = se[ie]).build(this._fragmentCompilationState, a);\n            this._vertexCompilationState.finalize(this._vertexCompilationState), this._fragmentCompilationState.finalize(this._fragmentCompilationState), this._buildId = t._BuildIdGenerator++, this._sharedData.emitErrors(), e && (console.log(\"Vertex shader:\"), console.log(this._vertexCompilationState.compilationString), console.log(\"Fragment shader:\"), console.log(this._fragmentCompilationState.compilationString)), this._buildWasSuccessful = !0, this.onBuildObservable.notifyObservers(this);\n            for (var ce = 0, ue = this.getScene().meshes; ce < ue.length; ce++) {\n              var fe = ue[ce];\n              if (fe.subMeshes)\n                for (var ve = 0, Te = fe.subMeshes; ve < Te.length; ve++) {\n                  var Re = Te[ve];\n                  if (Re.getMaterial() === this && Re._materialDefines) {\n                    var Ae = Re._materialDefines;\n                    Ae.markAllAsDirty(), Ae.reset();\n                  }\n                }\n            }\n          }, t.prototype.optimize = function() {\n            for (var e = 0, n = this._optimizers; e < n.length; e++)\n              n[e].optimize(this._vertexOutputNodes, this._fragmentOutputNodes);\n          }, t.prototype._prepareDefinesForAttributes = function(e, n) {\n            var i = n.NORMAL, o = n.TANGENT, a = n.UV1;\n            n.NORMAL = e.isVerticesDataPresent(Oe.b.NormalKind), n.TANGENT = e.isVerticesDataPresent(Oe.b.TangentKind), n.UV1 = e.isVerticesDataPresent(Oe.b.UVKind), i === n.NORMAL && o === n.TANGENT && a === n.UV1 || n.markAsAttributesDirty();\n          }, t.prototype.createPostProcess = function(e, n, i, o, a, s, d) {\n            return n === void 0 && (n = 1), i === void 0 && (i = h.a.TEXTURE_NEAREST_SAMPLINGMODE), s === void 0 && (s = h.a.TEXTURETYPE_UNSIGNED_INT), d === void 0 && (d = h.a.TEXTUREFORMAT_RGBA), this.mode !== Rn.PostProcess ? (console.log(\"Incompatible material mode\"), null) : this._createEffectForPostProcess(null, e, n, i, o, a, s, d);\n          }, t.prototype.createEffectForPostProcess = function(e) {\n            this._createEffectForPostProcess(e);\n          }, t.prototype._createEffectForPostProcess = function(e, n, i, o, a, s, d, p) {\n            var y = this;\n            i === void 0 && (i = 1), o === void 0 && (o = h.a.TEXTURE_NEAREST_SAMPLINGMODE), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = h.a.TEXTUREFORMAT_RGBA);\n            var P = this.name + this._buildId, R = new lo(), B = new Mt.a(P + \"PostProcess\", this.getScene()), F = this._buildId;\n            return this._processDefines(B, R), ze.a.RegisterShader(P, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), e ? e.updateEffect(R.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, void 0, void 0, P, P) : e = new ft(this.name + \"PostProcess\", P, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, i, n, o, a, s, R.toString(), d, P, { maxSimultaneousLights: this.maxSimultaneousLights }, !1, p), e.nodeMaterialSource = this, e.onApplyObservable.add(function(z) {\n              F !== y._buildId && (delete ze.a.ShadersStore[P + \"VertexShader\"], delete ze.a.ShadersStore[P + \"PixelShader\"], P = y.name + y._buildId, R.markAsUnprocessed(), F = y._buildId), y._processDefines(B, R) && (ze.a.RegisterShader(P, y._fragmentCompilationState._builtCompilationString, y._vertexCompilationState._builtCompilationString), Qu.a.SetImmediate(function() {\n                return e.updateEffect(R.toString(), y._fragmentCompilationState.uniforms, y._fragmentCompilationState.samplers, { maxSimultaneousLights: y.maxSimultaneousLights }, void 0, void 0, P, P);\n              })), y._checkInternals(z);\n            }), e;\n          }, t.prototype.createProceduralTexture = function(e, n) {\n            var i = this;\n            if (this.mode !== Rn.ProceduralTexture)\n              return console.log(\"Incompatible material mode\"), null;\n            var o = this.name + this._buildId, a = new oo(o, e, null, n), s = new Mt.a(o + \"Procedural\", this.getScene());\n            s.reservedDataStore = { hidden: !0 };\n            var d = new lo(), p = this._processDefines(s, d);\n            ze.a.RegisterShader(o, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);\n            var y = this.getScene().getEngine().createEffect({ vertexElement: o, fragmentElement: o }, [Oe.b.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, d.toString(), p == null ? void 0 : p.fallbacks, void 0);\n            a.nodeMaterialSource = this, a._effect = y;\n            var P = this._buildId;\n            return a.onBeforeGenerationObservable.add(function() {\n              P !== i._buildId && (delete ze.a.ShadersStore[o + \"VertexShader\"], delete ze.a.ShadersStore[o + \"PixelShader\"], o = i.name + i._buildId, d.markAsUnprocessed(), P = i._buildId);\n              var R = i._processDefines(s, d);\n              R && (ze.a.RegisterShader(o, i._fragmentCompilationState._builtCompilationString, i._vertexCompilationState._builtCompilationString), Qu.a.SetImmediate(function() {\n                y = i.getScene().getEngine().createEffect({ vertexElement: o, fragmentElement: o }, [Oe.b.PositionKind], i._fragmentCompilationState.uniforms, i._fragmentCompilationState.samplers, d.toString(), R == null ? void 0 : R.fallbacks, void 0), a._effect = y;\n              })), i._checkInternals(y);\n            }), a;\n          }, t.prototype._createEffectForParticles = function(e, n, i, o, a, s, d, p) {\n            var y = this;\n            p === void 0 && (p = \"\");\n            var P = this.name + this._buildId + \"_\" + n;\n            s || (s = new lo()), d || (d = this.getScene().getMeshByName(this.name + \"Particle\")) || ((d = new Mt.a(this.name + \"Particle\", this.getScene())).reservedDataStore = { hidden: !0 });\n            var R = this._buildId, B = [], F = p;\n            if (!a) {\n              var z = this._processDefines(d, s);\n              ze.a.RegisterShader(P, this._fragmentCompilationState._builtCompilationString), e.fillDefines(B, n), F = B.join(`\n`), a = this.getScene().getEngine().createEffectForParticles(P, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, s.toString() + `\n` + F, z == null ? void 0 : z.fallbacks, i, o, e), e.setCustomEffect(a, n);\n            }\n            a.onBindObservable.add(function(J) {\n              R !== y._buildId && (delete ze.a.ShadersStore[P + \"PixelShader\"], P = y.name + y._buildId + \"_\" + n, s.markAsUnprocessed(), R = y._buildId), B.length = 0, e.fillDefines(B, n);\n              var ie = B.join(`\n`);\n              ie !== F && (s.markAsUnprocessed(), F = ie);\n              var se = y._processDefines(d, s);\n              if (se)\n                return ze.a.RegisterShader(P, y._fragmentCompilationState._builtCompilationString), J = y.getScene().getEngine().createEffectForParticles(P, y._fragmentCompilationState.uniforms, y._fragmentCompilationState.samplers, s.toString() + `\n` + F, se == null ? void 0 : se.fallbacks, i, o, e), e.setCustomEffect(J, n), void y._createEffectForParticles(e, n, i, o, J, s, d, F);\n              y._checkInternals(J);\n            });\n          }, t.prototype._checkInternals = function(e) {\n            if (this._sharedData.animatedInputs) {\n              var n = this.getScene(), i = n.getFrameId();\n              if (this._animationFrame !== i) {\n                for (var o = 0, a = this._sharedData.animatedInputs; o < a.length; o++)\n                  a[o].animate(n);\n                this._animationFrame = i;\n              }\n            }\n            for (var s = 0, d = this._sharedData.bindableBlocks; s < d.length; s++)\n              d[s].bind(e, this);\n            for (var p = 0, y = this._sharedData.inputBlocks; p < y.length; p++)\n              y[p]._transmit(e, this.getScene());\n          }, t.prototype.createEffectForParticles = function(e, n, i) {\n            this.mode === Rn.Particle ? (this._createEffectForParticles(e, co.BLENDMODE_ONEONE, n, i), this._createEffectForParticles(e, co.BLENDMODE_MULTIPLY, n, i)) : console.log(\"Incompatible material mode\");\n          }, t.prototype._processDefines = function(e, n, i, o) {\n            var a = this;\n            i === void 0 && (i = !1);\n            var s = null;\n            if (this._sharedData.blocksWithDefines.forEach(function(B) {\n              B.initializeDefines(e, a, n, i);\n            }), this._sharedData.blocksWithDefines.forEach(function(B) {\n              B.prepareDefines(e, a, n, i, o);\n            }), n.isDirty) {\n              var d = n._areLightsDisposed;\n              n.markAsProcessed(), this._vertexCompilationState.compilationString = this._vertexCompilationState._builtCompilationString, this._fragmentCompilationState.compilationString = this._fragmentCompilationState._builtCompilationString, this._sharedData.repeatableContentBlocks.forEach(function(B) {\n                B.replaceRepeatableContent(a._vertexCompilationState, a._fragmentCompilationState, e, n);\n              });\n              var p = [];\n              this._sharedData.dynamicUniformBlocks.forEach(function(B) {\n                B.updateUniformsAndSamples(a._vertexCompilationState, a, n, p);\n              });\n              var y = this._vertexCompilationState.uniforms;\n              this._fragmentCompilationState.uniforms.forEach(function(B) {\n                y.indexOf(B) === -1 && y.push(B);\n              });\n              var P = this._vertexCompilationState.samplers;\n              this._fragmentCompilationState.samplers.forEach(function(B) {\n                P.indexOf(B) === -1 && P.push(B);\n              });\n              var R = new _r.a();\n              this._sharedData.blocksWithFallbacks.forEach(function(B) {\n                B.provideFallbacks(e, R);\n              }), s = { lightDisposed: d, uniformBuffers: p, mergedUniforms: y, mergedSamplers: P, fallbacks: R };\n            }\n            return s;\n          }, t.prototype.isReadyForSubMesh = function(e, n, i) {\n            var o = this;\n            if (i === void 0 && (i = !1), !this._buildWasSuccessful)\n              return !1;\n            var a = this.getScene();\n            if (this._sharedData.animatedInputs) {\n              var s = a.getFrameId();\n              if (this._animationFrame !== s) {\n                for (var d = 0, p = this._sharedData.animatedInputs; d < p.length; d++)\n                  p[d].animate(a);\n                this._animationFrame = s;\n              }\n            }\n            if (n.effect && this.isFrozen && n.effect._wasPreviouslyReady)\n              return !0;\n            n._materialDefines || (n._materialDefines = new lo());\n            var y = n._materialDefines;\n            if (this._isReadyForSubMesh(n))\n              return !0;\n            var P = a.getEngine();\n            if (this._prepareDefinesForAttributes(e, y), this._sharedData.blockingBlocks.some(function(J) {\n              return !J.isReady(e, o, y, i);\n            }))\n              return !1;\n            var R = this._processDefines(e, y, i, n);\n            if (R) {\n              var B = n.effect, F = y.toString(), z = P.createEffect({ vertex: \"nodeMaterial\" + this._buildId, fragment: \"nodeMaterial\" + this._buildId, vertexSource: this._vertexCompilationState.compilationString, fragmentSource: this._fragmentCompilationState.compilationString }, { attributes: this._vertexCompilationState.attributes, uniformsNames: R.mergedUniforms, uniformBuffersNames: R.uniformBuffers, samplers: R.mergedSamplers, defines: F, fallbacks: R.fallbacks, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights, maxSimultaneousMorphTargets: y.NUM_MORPH_INFLUENCERS } }, P);\n              if (z)\n                if (this._onEffectCreatedObservable && (ec.effect = z, ec.subMesh = n, this._onEffectCreatedObservable.notifyObservers(ec)), this.allowShaderHotSwapping && B && !z.isReady()) {\n                  if (z = B, y.markAsUnprocessed(), R.lightDisposed)\n                    return y._areLightsDisposed = !0, !1;\n                } else\n                  a.resetCachedMaterial(), n.setEffect(z, y);\n            }\n            return !(!n.effect || !n.effect.isReady()) && (y._renderId = a.getRenderId(), n.effect._wasPreviouslyReady = !0, !0);\n          }, Object.defineProperty(t.prototype, \"compiledShaders\", { get: function() {\n            return `// Vertex shader\\r\n` + this._vertexCompilationState.compilationString + `\\r\n\\r\n// Fragment shader\\r\n` + this._fragmentCompilationState.compilationString;\n          }, enumerable: !1, configurable: !0 }), t.prototype.bindOnlyWorldMatrix = function(e) {\n            var n = this.getScene();\n            if (this._activeEffect) {\n              var i = this._sharedData.hints;\n              i.needWorldViewMatrix && e.multiplyToRef(n.getViewMatrix(), this._cachedWorldViewMatrix), i.needWorldViewProjectionMatrix && e.multiplyToRef(n.getTransformMatrix(), this._cachedWorldViewProjectionMatrix);\n              for (var o = 0, a = this._sharedData.inputBlocks; o < a.length; o++)\n                a[o]._transmitWorld(this._activeEffect, e, this._cachedWorldViewMatrix, this._cachedWorldViewProjectionMatrix);\n            }\n          }, t.prototype.bindForSubMesh = function(e, n, i) {\n            var o = this.getScene(), a = i.effect;\n            if (a) {\n              if (this._activeEffect = a, this.bindOnlyWorldMatrix(e), this._mustRebind(o, a, n.visibility)) {\n                var s = this._sharedData;\n                if (a && o.getCachedEffect() !== a) {\n                  for (var d = 0, p = s.bindableBlocks; d < p.length; d++)\n                    p[d].bind(a, this, n, i);\n                  for (var y = 0, P = s.inputBlocks; y < P.length; y++)\n                    P[y]._transmit(a, o);\n                }\n              }\n              this._afterBind(n, this._activeEffect);\n            }\n          }, t.prototype.getActiveTextures = function() {\n            var e = r.prototype.getActiveTextures.call(this);\n            return this._sharedData && e.push.apply(e, this._sharedData.textureBlocks.filter(function(n) {\n              return n.texture;\n            }).map(function(n) {\n              return n.texture;\n            })), e;\n          }, t.prototype.getTextureBlocks = function() {\n            return this._sharedData ? this._sharedData.textureBlocks : [];\n          }, t.prototype.hasTexture = function(e) {\n            if (r.prototype.hasTexture.call(this, e))\n              return !0;\n            if (!this._sharedData)\n              return !1;\n            for (var n = 0, i = this._sharedData.textureBlocks; n < i.length; n++)\n              if (i[n].texture === e)\n                return !0;\n            return !1;\n          }, t.prototype.dispose = function(e, n, i) {\n            if (n)\n              for (var o = 0, a = this._sharedData.textureBlocks.filter(function(p) {\n                return p.texture;\n              }).map(function(p) {\n                return p.texture;\n              }); o < a.length; o++)\n                a[o].dispose();\n            for (var s = 0, d = this.attachedBlocks; s < d.length; s++)\n              d[s].dispose();\n            this.onBuildObservable.clear(), r.prototype.dispose.call(this, e, n, i);\n          }, t.prototype._createNodeEditor = function() {\n            this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor(), this.BJSNODEMATERIALEDITOR.NodeEditor.Show({ nodeMaterial: this });\n          }, t.prototype.edit = function(e) {\n            var n = this;\n            return new Promise(function(i, o) {\n              if (n.BJSNODEMATERIALEDITOR === void 0) {\n                var a = e && e.editorURL ? e.editorURL : t.EditorURL;\n                Xe.b.LoadScript(a, function() {\n                  n._createNodeEditor(), i();\n                });\n              } else\n                n._createNodeEditor(), i();\n            });\n          }, t.prototype.clear = function() {\n            this._vertexOutputNodes = [], this._fragmentOutputNodes = [], this.attachedBlocks = [];\n          }, t.prototype.setToDefault = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"Position\");\n            e.setAsAttribute(\"position\");\n            var n = new Et(\"World\");\n            n.setAsSystemValue(BABYLON.NodeMaterialSystemValues.World);\n            var i = new ia(\"WorldPos\");\n            e.connectTo(i), n.connectTo(i);\n            var o = new Et(\"ViewProjection\");\n            o.setAsSystemValue(BABYLON.NodeMaterialSystemValues.ViewProjection);\n            var a = new ia(\"WorldPos * ViewProjectionTransform\");\n            i.connectTo(a), o.connectTo(a);\n            var s = new ao(\"VertexOutput\");\n            a.connectTo(s);\n            var d = new Et(\"color\");\n            d.value = new I.b(0.8, 0.8, 0.8, 1);\n            var p = new Pr(\"FragmentOutput\");\n            d.connectTo(p), this.addOutputNode(s), this.addOutputNode(p), this._mode = Rn.Material;\n          }, t.prototype.setToDefaultPostProcess = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"Position\");\n            e.setAsAttribute(\"position2d\");\n            var n = new Et(\"Constant1\");\n            n.isConstant = !0, n.value = 1;\n            var i = new so(\"Position3D\");\n            e.connectTo(i), n.connectTo(i, { input: \"w\" });\n            var o = new ao(\"VertexOutput\");\n            i.connectTo(o);\n            var a = new Et(\"Scale\");\n            a.visibleInInspector = !0, a.value = new u.d(1, 1);\n            var s = new Xs(\"uv0\");\n            e.connectTo(s);\n            var d = new ra(\"UV scale\");\n            s.connectTo(d), a.connectTo(d);\n            var p = new zs(\"CurrentScreen\");\n            d.connectTo(p), p.texture = new Ne.a(\"https://assets.babylonjs.com/nme/currentScreenPostProcess.png\", this.getScene());\n            var y = new Pr(\"FragmentOutput\");\n            p.connectTo(y, { output: \"rgba\" }), this.addOutputNode(o), this.addOutputNode(y), this._mode = Rn.PostProcess;\n          }, t.prototype.setToDefaultProceduralTexture = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"Position\");\n            e.setAsAttribute(\"position2d\");\n            var n = new Et(\"Constant1\");\n            n.isConstant = !0, n.value = 1;\n            var i = new so(\"Position3D\");\n            e.connectTo(i), n.connectTo(i, { input: \"w\" });\n            var o = new ao(\"VertexOutput\");\n            i.connectTo(o);\n            var a = new Et(\"Time\");\n            a.value = 0, a.min = 0, a.max = 0, a.isBoolean = !1, a.matrixMode = 0, a.animationType = Ni.Time, a.isConstant = !1;\n            var s = new Et(\"Color3\");\n            s.value = new I.a(1, 1, 1), s.isConstant = !1;\n            var d = new Pr(\"FragmentOutput\"), p = new so(\"VectorMerger\");\n            p.visibleInInspector = !1;\n            var y = new $s(\"Cos\");\n            y.operation = tn.Cos, e.connectTo(p), a.output.connectTo(y.input), y.output.connectTo(p.z), p.xyzOut.connectTo(d.rgb), this.addOutputNode(o), this.addOutputNode(d), this._mode = Rn.ProceduralTexture;\n          }, t.prototype.setToDefaultParticle = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"uv\");\n            e.setAsAttribute(\"particle_uv\");\n            var n = new js(\"ParticleTexture\");\n            e.connectTo(n);\n            var i = new Et(\"Color\");\n            i.setAsAttribute(\"particle_color\");\n            var o = new ra(\"Texture * Color\");\n            n.connectTo(o), i.connectTo(o);\n            var a = new Hs(\"ParticleRampGradient\");\n            o.connectTo(a);\n            var s = new Js(\"ColorSplitter\");\n            i.connectTo(s);\n            var d = new Ws(\"ParticleBlendMultiply\");\n            a.connectTo(d), n.connectTo(d, { output: \"a\" }), s.connectTo(d, { output: \"a\" });\n            var p = new Pr(\"FragmentOutput\");\n            d.connectTo(p), this.addOutputNode(p), this._mode = Rn.Particle;\n          }, t.prototype.loadAsync = function(e) {\n            var n = this;\n            return this.getScene()._loadFileAsync(e).then(function(i) {\n              var o = JSON.parse(i);\n              n.loadFromSerialization(o, \"\");\n            });\n          }, t.prototype._gatherBlocks = function(e, n) {\n            if (n.indexOf(e) === -1) {\n              n.push(e);\n              for (var i = 0, o = e.inputs; i < o.length; i++) {\n                var a = o[i].connectedPoint;\n                if (a) {\n                  var s = a.ownerBlock;\n                  s !== e && this._gatherBlocks(s, n);\n                }\n              }\n            }\n          }, t.prototype.generateCode = function() {\n            for (var e = [], n = [], i = [], o = 0, a = this._vertexOutputNodes; o < a.length; o++) {\n              var s = a[o];\n              this._gatherBlocks(s, n);\n            }\n            for (var d = [], p = 0, y = this._fragmentOutputNodes; p < y.length; p++)\n              s = y[p], this._gatherBlocks(s, d);\n            for (var P = 'var nodeMaterial = new BABYLON.NodeMaterial(\"' + (this.name || \"node material\") + `\");\\r\n`, R = 0, B = n; R < B.length; R++)\n              (Re = B[R]).isInput && e.indexOf(Re) === -1 && (P += Re._dumpCode(i, e));\n            for (var F = 0, z = d; F < z.length; F++)\n              (Re = z[F]).isInput && e.indexOf(Re) === -1 && (P += Re._dumpCode(i, e));\n            e = [], P += `\\r\n// Connections\\r\n`;\n            for (var J = 0, ie = this._vertexOutputNodes; J < ie.length; J++)\n              P += (Re = ie[J])._dumpCodeForOutputConnections(e);\n            for (var se = 0, ce = this._fragmentOutputNodes; se < ce.length; se++)\n              P += (Re = ce[se])._dumpCodeForOutputConnections(e);\n            P += `\\r\n// Output nodes\\r\n`;\n            for (var ue = 0, fe = this._vertexOutputNodes; ue < fe.length; ue++)\n              P += \"nodeMaterial.addOutputNode(\" + (Re = fe[ue])._codeVariableName + `);\\r\n`;\n            for (var ve = 0, Te = this._fragmentOutputNodes; ve < Te.length; ve++) {\n              var Re;\n              P += \"nodeMaterial.addOutputNode(\" + (Re = Te[ve])._codeVariableName + `);\\r\n`;\n            }\n            return P += `nodeMaterial.build();\\r\n`;\n          }, t.prototype.serialize = function(e) {\n            var n = e ? {} : L.a.Serialize(this);\n            n.editorData = JSON.parse(JSON.stringify(this.editorData));\n            var i = [];\n            if (e)\n              i = e;\n            else {\n              n.customType = \"BABYLON.NodeMaterial\", n.outputNodes = [];\n              for (var o = 0, a = this._vertexOutputNodes; o < a.length; o++) {\n                var s = a[o];\n                this._gatherBlocks(s, i), n.outputNodes.push(s.uniqueId);\n              }\n              for (var d = 0, p = this._fragmentOutputNodes; d < p.length; d++)\n                s = p[d], this._gatherBlocks(s, i), n.outputNodes.indexOf(s.uniqueId) === -1 && n.outputNodes.push(s.uniqueId);\n            }\n            n.blocks = [];\n            for (var y = 0, P = i; y < P.length; y++) {\n              var R = P[y];\n              n.blocks.push(R.serialize());\n            }\n            if (!e)\n              for (var B = 0, F = this.attachedBlocks; B < F.length; B++)\n                R = F[B], i.indexOf(R) === -1 && n.blocks.push(R.serialize());\n            return n;\n          }, t.prototype._restoreConnections = function(e, n, i) {\n            for (var o = 0, a = e.outputs; o < a.length; o++)\n              for (var s = a[o], d = 0, p = n.blocks; d < p.length; d++) {\n                var y = p[d], P = i[y.id];\n                if (P)\n                  for (var R = 0, B = y.inputs; R < B.length; R++) {\n                    var F = B[R];\n                    if (!(i[F.targetBlockId] !== e || F.targetConnectionName !== s.name)) {\n                      var z = P.getInputByName(F.inputName);\n                      if (!z || z.isConnected)\n                        continue;\n                      s.connectTo(z, !0), this._restoreConnections(P, n, i);\n                    }\n                  }\n              }\n          }, t.prototype.loadFromSerialization = function(e, n, i) {\n            var o;\n            n === void 0 && (n = \"\"), i === void 0 && (i = !1), i || this.clear();\n            for (var a = {}, s = 0, d = e.blocks; s < d.length; s++) {\n              var p = d[s], y = O.a.GetClass(p.customType);\n              y && ((R = new y())._deserialize(p, this.getScene(), n), a[p.id] = R, this.attachedBlocks.push(R));\n            }\n            for (var P = 0; P < e.blocks.length; P++) {\n              var R;\n              (R = a[e.blocks[P].id]) && (R.inputs.length && !i || this._restoreConnections(R, e, a));\n            }\n            if (e.outputNodes)\n              for (var B = 0, F = e.outputNodes; B < F.length; B++) {\n                var z = F[B];\n                this.addOutputNode(a[z]);\n              }\n            if (e.locations || e.editorData && e.editorData.locations) {\n              for (var J = e.locations || e.editorData.locations, ie = 0, se = J; ie < se.length; ie++) {\n                var ce = se[ie];\n                a[ce.blockId] && (ce.blockId = a[ce.blockId].uniqueId);\n              }\n              i && this.editorData && this.editorData.locations && J.concat(this.editorData.locations), e.locations ? this.editorData = { locations: J } : (this.editorData = e.editorData, this.editorData.locations = J);\n              var ue = [];\n              for (var fe in a)\n                ue[fe] = a[fe].uniqueId;\n              this.editorData.map = ue;\n            }\n            this.comment = e.comment, i || (this._mode = (o = e.mode) !== null && o !== void 0 ? o : Rn.Material);\n          }, t.prototype.clone = function(e) {\n            var n = this, i = this.serialize(), o = L.a.Clone(function() {\n              return new t(e, n.getScene(), n.options);\n            }, this);\n            return o.id = e, o.name = e, o.loadFromSerialization(i), o.build(), o;\n          }, t.Parse = function(e, n, i) {\n            i === void 0 && (i = \"\");\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return o.loadFromSerialization(e, i), o.build(), o;\n          }, t.ParseFromFileAsync = function(e, n, i) {\n            var o = new t(e, i);\n            return new Promise(function(a, s) {\n              return o.loadAsync(n).then(function() {\n                o.build(), a(o);\n              }).catch(s);\n            });\n          }, t.ParseFromSnippetAsync = function(e, n, i, o) {\n            var a = this;\n            return i === void 0 && (i = \"\"), e === \"_BLANK\" ? Promise.resolve(this.CreateDefault(\"blank\", n)) : new Promise(function(s, d) {\n              var p = new re.a();\n              p.addEventListener(\"readystatechange\", function() {\n                if (p.readyState == 4)\n                  if (p.status == 200) {\n                    var y = JSON.parse(JSON.parse(p.responseText).jsonPayload), P = JSON.parse(y.nodeMaterial);\n                    o || ((o = L.a.Parse(function() {\n                      return new t(e, n);\n                    }, P, n, i)).uniqueId = n.getUniqueId()), o.loadFromSerialization(P), o.snippetId = e;\n                    try {\n                      o.build(), s(o);\n                    } catch (R) {\n                      d(R);\n                    }\n                  } else\n                    d(\"Unable to load the snippet \" + e);\n              }), p.open(\"GET\", a.SnippetUrl + \"/\" + e.replace(/#/g, \"/\")), p.send();\n            });\n          }, t.CreateDefault = function(e, n) {\n            var i = new t(e, n);\n            return i.setToDefault(), i.build(), i;\n          }, t._BuildIdGenerator = 0, t.EditorURL = \"https://unpkg.com/babylonjs-node-editor@\" + Ue.a.Version + \"/babylon.nodeEditor.js\", t.SnippetUrl = \"https://snippet.babylonjs.com\", t.IgnoreTexturesAtLoadTime = !1, Object(c.c)([Object(L.c)(\"mode\")], t.prototype, \"_mode\", void 0), Object(c.c)([Object(L.c)(\"comment\")], t.prototype, \"comment\", void 0), t;\n        }(jo.a);\n        O.a.RegisteredTypes[\"BABYLON.NodeMaterial\"] = sa;\n        var qu = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"matricesIndices\", le.Vector4), n.registerInput(\"matricesWeights\", le.Vector4), n.registerInput(\"matricesIndicesExtra\", le.Vector4, !0), n.registerInput(\"matricesWeightsExtra\", le.Vector4, !0), n.registerInput(\"world\", le.Matrix), n.registerOutput(\"output\", le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"boneSampler\"), e._excludeVariableName(\"boneTextureWidth\"), e._excludeVariableName(\"mBones\"), e._excludeVariableName(\"BonesPerMesh\");\n          }, t.prototype.getClassName = function() {\n            return \"BonesBlock\";\n          }, Object.defineProperty(t.prototype, \"matricesIndices\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"matricesWeights\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"matricesIndicesExtra\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"matricesWeightsExtra\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.matricesIndices.isConnected) {\n              var n = e.getInputBlockByPredicate(function(a) {\n                return a.isAttribute && a.name === \"matricesIndices\";\n              });\n              n || (n = new Et(\"matricesIndices\")).setAsAttribute(\"matricesIndices\"), n.output.connectTo(this.matricesIndices);\n            }\n            if (!this.matricesWeights.isConnected) {\n              var i = e.getInputBlockByPredicate(function(a) {\n                return a.isAttribute && a.name === \"matricesWeights\";\n              });\n              i || (i = new Et(\"matricesWeights\")).setAsAttribute(\"matricesWeights\"), i.output.connectTo(this.matricesWeights);\n            }\n            if (!this.world.isConnected) {\n              var o = e.getInputBlockByPredicate(function(a) {\n                return a.systemValue === gt.World;\n              });\n              o || (o = new Et(\"world\")).setAsSystemValue(gt.World), o.output.connectTo(this.world);\n            }\n          }, t.prototype.provideFallbacks = function(e, n) {\n            e && e.useBones && e.computeBonesUsingShaders && e.skeleton && n.addCPUSkinningFallback(0, e);\n          }, t.prototype.bind = function(e, n, i) {\n            $e.a.BindBonesParameters(i, e);\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i._areAttributesDirty && $e.a.PrepareDefinesForBones(e, i);\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithFallbacks.push(this), e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.uniforms.push(\"boneTextureWidth\"), e.uniforms.push(\"mBones\"), e.samplers.push(\"boneSampler\");\n            var n = \"//\" + this.name;\n            e._emitFunctionFromInclude(\"bonesDeclaration\", n, { removeAttributes: !0, removeUniforms: !1, removeVaryings: !0, removeIfDef: !1 });\n            var i = e._getFreeVariableName(\"influence\");\n            e.compilationString += e._emitCodeFromInclude(\"bonesVertex\", n, { replaceStrings: [{ search: /finalWorld=finalWorld\\*influence;/, replace: \"\" }, { search: /influence/gm, replace: i }] });\n            var o = this._outputs[0], a = this.world;\n            return e.compilationString += `#if NUM_BONE_INFLUENCERS>0\\r\n`, e.compilationString += this._declareOutput(o, e) + \" = \" + a.associatedVariableName + \" * \" + i + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(o, e) + \" = \" + a.associatedVariableName + `;\\r\n`, e.compilationString += `#endif\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.BonesBlock\"] = qu;\n        var Zu = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"world0\", le.Vector4), n.registerInput(\"world1\", le.Vector4), n.registerInput(\"world2\", le.Vector4), n.registerInput(\"world3\", le.Vector4), n.registerInput(\"world\", le.Matrix, !0), n.registerOutput(\"output\", le.Matrix), n.registerOutput(\"instanceID\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"InstancesBlock\";\n          }, Object.defineProperty(t.prototype, \"world0\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world1\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world2\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world3\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"instanceID\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.world0.connectedPoint) {\n              var n = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world0\";\n              });\n              n || (n = new Et(\"world0\")).setAsAttribute(\"world0\"), n.output.connectTo(this.world0);\n            }\n            if (!this.world1.connectedPoint) {\n              var i = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world1\";\n              });\n              i || (i = new Et(\"world1\")).setAsAttribute(\"world1\"), i.output.connectTo(this.world1);\n            }\n            if (!this.world2.connectedPoint) {\n              var o = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world2\";\n              });\n              o || (o = new Et(\"world2\")).setAsAttribute(\"world2\"), o.output.connectTo(this.world2);\n            }\n            if (!this.world3.connectedPoint) {\n              var a = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world3\";\n              });\n              a || (a = new Et(\"world3\")).setAsAttribute(\"world3\"), a.output.connectTo(this.world3);\n            }\n            if (!this.world.connectedPoint) {\n              var s = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world\";\n              });\n              s || (s = new Et(\"world\")).setAsSystemValue(gt.World), s.output.connectTo(this.world);\n            }\n            this.world.define = \"!INSTANCES || THIN_INSTANCES\";\n          }, t.prototype.prepareDefines = function(e, n, i, o, a) {\n            o === void 0 && (o = !1);\n            var s = !1;\n            i.INSTANCES !== o && (i.setValue(\"INSTANCES\", o), s = !0), a && i.THIN_INSTANCES !== !!(a != null && a.getRenderingMesh().hasThinInstances) && (i.setValue(\"THIN_INSTANCES\", !!(a != null && a.getRenderingMesh().hasThinInstances)), s = !0), s && i.markAsUnprocessed();\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithDefines.push(this);\n            var n = this._outputs[0], i = this._outputs[1], o = this.world0, a = this.world1, s = this.world2, d = this.world3;\n            return e.compilationString += `#ifdef INSTANCES\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = mat4(\" + o.associatedVariableName + \", \" + a.associatedVariableName + \", \" + s.associatedVariableName + \", \" + d.associatedVariableName + `);\\r\n`, e.compilationString += `#ifdef THIN_INSTANCES\\r\n`, e.compilationString += n.associatedVariableName + \" = \" + this.world.associatedVariableName + \" * \" + n.associatedVariableName + `;\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += this._declareOutput(i, e) + ` = float(gl_InstanceID);\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = \" + this.world.associatedVariableName + `;\\r\n`, e.compilationString += this._declareOutput(i, e) + ` = 0.0;\\r\n`, e.compilationString += `#endif\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.InstancesBlock\"] = Zu;\n        var Ju = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"position\", le.Vector3), n.registerInput(\"normal\", le.Vector3), n.registerInput(\"tangent\", le.Vector3), n.registerInput(\"uv\", le.Vector2), n.registerOutput(\"positionOutput\", le.Vector3), n.registerOutput(\"normalOutput\", le.Vector3), n.registerOutput(\"tangentOutput\", le.Vector3), n.registerOutput(\"uvOutput\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MorphTargetsBlock\";\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tangent\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"positionOutput\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalOutput\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tangentOutput\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uvOutput\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"morphTargetInfluences\");\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.position.isConnected) {\n              var n = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"position\";\n              });\n              n || (n = new Et(\"position\")).setAsAttribute(), n.output.connectTo(this.position);\n            }\n            if (!this.normal.isConnected) {\n              var i = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"normal\";\n              });\n              i || (i = new Et(\"normal\")).setAsAttribute(\"normal\"), i.output.connectTo(this.normal);\n            }\n            if (!this.tangent.isConnected) {\n              var o = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"tangent\";\n              });\n              o || (o = new Et(\"tangent\")).setAsAttribute(\"tangent\"), o.output.connectTo(this.tangent);\n            }\n            if (!this.uv.isConnected) {\n              var a = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"uv\";\n              });\n              a || (a = new Et(\"uv\")).setAsAttribute(\"uv\"), a.output.connectTo(this.uv);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i._areAttributesDirty && $e.a.PrepareDefinesForMorphTargets(e, i);\n          }, t.prototype.bind = function(e, n, i) {\n            i && i.morphTargetManager && i.morphTargetManager.numInfluencers > 0 && $e.a.BindMorphTargetParameters(i, e);\n          }, t.prototype.replaceRepeatableContent = function(e, n, i, o) {\n            for (var a = this.position, s = this.normal, d = this.tangent, p = this.uv, y = this.positionOutput, P = this.normalOutput, R = this.tangentOutput, B = this.uvOutput, F = e, z = o.NUM_MORPH_INFLUENCERS, J = i.morphTargetManager, ie = J && J.supportsNormals && o.NORMAL, se = J && J.supportsTangents && o.TANGENT, ce = J && J.supportsUVs && o.UV1, ue = \"\", fe = 0; fe < z; fe++)\n              ue += `#ifdef MORPHTARGETS\\r\n`, ue += y.associatedVariableName + \" += (position\" + fe + \" - \" + a.associatedVariableName + \") * morphTargetInfluences[\" + fe + `];\\r\n`, ie && (ue += `#ifdef MORPHTARGETS_NORMAL\\r\n`, ue += P.associatedVariableName + \" += (normal\" + fe + \" - \" + s.associatedVariableName + \") * morphTargetInfluences[\" + fe + `];\\r\n`, ue += `#endif\\r\n`), se && (ue += `#ifdef MORPHTARGETS_TANGENT\\r\n`, ue += R.associatedVariableName + \".xyz += (tangent\" + fe + \" - \" + d.associatedVariableName + \".xyz) * morphTargetInfluences[\" + fe + `];\\r\n`, ue += `#endif\\r\n`), ce && (ue += `#ifdef MORPHTARGETS_UV\\r\n`, ue += B.associatedVariableName + \".xy += (uv_\" + fe + \" - \" + p.associatedVariableName + \".xy) * morphTargetInfluences[\" + fe + `];\\r\n`, ue += `#endif\\r\n`), ue += `#endif\\r\n`;\n            if (F.compilationString = F.compilationString.replace(this._repeatableContentAnchor, ue), z > 0)\n              for (fe = 0; fe < z; fe++)\n                F.attributes.push(Oe.b.PositionKind + fe), ie && F.attributes.push(Oe.b.NormalKind + fe), se && F.attributes.push(Oe.b.TangentKind + fe), ce && F.attributes.push(Oe.b.UVKind + \"_\" + fe);\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), e.sharedData.repeatableContentBlocks.push(this);\n            var n = this.position, i = this.normal, o = this.tangent, a = this.uv, s = this.positionOutput, d = this.normalOutput, p = this.tangentOutput, y = this.uvOutput, P = \"//\" + this.name;\n            return e.uniforms.push(\"morphTargetInfluences\"), e._emitFunctionFromInclude(\"morphTargetsVertexGlobalDeclaration\", P), e._emitFunctionFromInclude(\"morphTargetsVertexDeclaration\", P, { repeatKey: \"maxSimultaneousMorphTargets\" }), e.compilationString += this._declareOutput(s, e) + \" = \" + n.associatedVariableName + `;\\r\n`, e.compilationString += `#ifdef NORMAL\\r\n`, e.compilationString += this._declareOutput(d, e) + \" = \" + i.associatedVariableName + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(d, e) + ` = vec3(0., 0., 0.);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += `#ifdef TANGENT\\r\n`, e.compilationString += this._declareOutput(p, e) + \" = \" + o.associatedVariableName + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(p, e) + ` = vec3(0., 0., 0.);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += `#ifdef UV1\\r\n`, e.compilationString += this._declareOutput(y, e) + \" = \" + a.associatedVariableName + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(y, e) + ` = vec2(0., 0.);\\r\n`, e.compilationString += `#endif\\r\n`, this._repeatableContentAnchor = e._repeatableContentAnchor, e.compilationString += this._repeatableContentAnchor, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MorphTargetsBlock\"] = Ju;\n        var $u = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerOutput(\"direction\", le.Vector3), n.registerOutput(\"color\", le.Color3), n.registerOutput(\"intensity\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LightInformationBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype.bind = function(e, n, i) {\n            if (i) {\n              this.light && this.light.isDisposed && (this.light = null);\n              var o = this.light, a = n.getScene();\n              if (!o && a.lights.length && (o = a.lights[0]), !o || !o.isEnabled)\n                return e.setFloat3(this._lightDataUniformName, 0, 0, 0), void e.setFloat4(this._lightColorUniformName, 0, 0, 0, 0);\n              o.transferToNodeMaterialEffect(e, this._lightDataUniformName), e.setColor4(this._lightColorUniformName, o.diffuse, o.intensity);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areLightsDirty) {\n              var o = this.light;\n              i.setValue(this._lightTypeDefineName, !!(o && o instanceof Ls));\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);\n            var n = this.direction, i = this.color, o = this.intensity;\n            return this._lightDataUniformName = e._getFreeVariableName(\"lightData\"), this._lightColorUniformName = e._getFreeVariableName(\"lightColor\"), this._lightTypeDefineName = e._getFreeDefineName(\"LIGHTPOINTTYPE\"), e._emitUniformFromString(this._lightDataUniformName, \"vec3\"), e._emitUniformFromString(this._lightColorUniformName, \"vec4\"), e.compilationString += \"#ifdef \" + this._lightTypeDefineName + `\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = normalize(\" + this.worldPosition.associatedVariableName + \".xyz - \" + this._lightDataUniformName + `);\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = \" + this._lightDataUniformName + `;\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += this._declareOutput(i, e) + \" = \" + this._lightColorUniformName + `.rgb;\\r\n`, e.compilationString += this._declareOutput(o, e) + \" = \" + this._lightColorUniformName + `.a;\\r\n`, this;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.light && (e.lightId = this.light.id), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.lightId && (this.light = n.getLightByID(e.lightId));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LightInformationBlock\"] = $u;\n        var eh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerInput(\"color\", le.Color4), n.registerOutput(\"output\", le.Color4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ImageProcessingBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"exposureLinear\"), e._excludeVariableName(\"contrast\"), e._excludeVariableName(\"vInverseScreenSize\"), e._excludeVariableName(\"vignetteSettings1\"), e._excludeVariableName(\"vignetteSettings2\"), e._excludeVariableName(\"vCameraColorCurveNegative\"), e._excludeVariableName(\"vCameraColorCurveNeutral\"), e._excludeVariableName(\"vCameraColorCurvePositive\"), e._excludeVariableName(\"txColorTransform\"), e._excludeVariableName(\"colorTransformSettings\");\n          }, t.prototype.isReady = function(e, n, i) {\n            return !(i._areImageProcessingDirty && n.imageProcessingConfiguration && !n.imageProcessingConfiguration.isReady());\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i._areImageProcessingDirty && n.imageProcessingConfiguration && n.imageProcessingConfiguration.prepareDefines(i);\n          }, t.prototype.bind = function(e, n, i) {\n            i && n.imageProcessingConfiguration && n.imageProcessingConfiguration.bind(e);\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithDefines.push(this), e.sharedData.blockingBlocks.push(this), e.sharedData.bindableBlocks.push(this), e.uniforms.push(\"exposureLinear\"), e.uniforms.push(\"contrast\"), e.uniforms.push(\"vInverseScreenSize\"), e.uniforms.push(\"vignetteSettings1\"), e.uniforms.push(\"vignetteSettings2\"), e.uniforms.push(\"vCameraColorCurveNegative\"), e.uniforms.push(\"vCameraColorCurveNeutral\"), e.uniforms.push(\"vCameraColorCurvePositive\"), e.uniforms.push(\"txColorTransform\"), e.uniforms.push(\"colorTransformSettings\");\n            var n = this.color, i = this._outputs[0], o = \"//\" + this.name;\n            return e._emitFunctionFromInclude(\"helperFunctions\", o), e._emitFunctionFromInclude(\"imageProcessingDeclaration\", o), e._emitFunctionFromInclude(\"imageProcessingFunctions\", o), n.connectedPoint.type === le.Color4 || n.connectedPoint.type === le.Vector4 ? e.compilationString += this._declareOutput(i, e) + \" = \" + n.associatedVariableName + `;\\r\n` : e.compilationString += this._declareOutput(i, e) + \" = vec4(\" + n.associatedVariableName + `, 1.0);\\r\n`, e.compilationString += `#ifdef IMAGEPROCESSINGPOSTPROCESS\\r\n`, e.compilationString += i.associatedVariableName + \".rgb = toLinearSpace(\" + n.associatedVariableName + `.rgb);\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += `#ifdef IMAGEPROCESSING\\r\n`, e.compilationString += i.associatedVariableName + \".rgb = toLinearSpace(\" + n.associatedVariableName + `.rgb);\\r\n`, e.compilationString += i.associatedVariableName + \" = applyImageProcessing(\" + i.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += `#endif\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ImageProcessingBlock\"] = eh;\n        var th = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._tangentSpaceParameterName = \"\", n.invertX = !1, n.invertY = !1, n.registerInput(\"worldPosition\", le.Vector4, !1), n.registerInput(\"worldNormal\", le.Vector4, !1), n.registerInput(\"worldTangent\", le.Vector4, !0), n.registerInput(\"uv\", le.Vector2, !1), n.registerInput(\"normalMapColor\", le.Color3, !1), n.registerInput(\"strength\", le.Float, !1), n.registerOutput(\"output\", le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PerturbNormalBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldTangent\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalMapColor\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"strength\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(\"BUMP\", !0);\n          }, t.prototype.bind = function(e, n, i) {\n            n.getScene()._mirroredCameraPosition ? e.setFloat2(this._tangentSpaceParameterName, this.invertX ? 1 : -1, this.invertY ? 1 : -1) : e.setFloat2(this._tangentSpaceParameterName, this.invertX ? -1 : 1, this.invertY ? -1 : 1);\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.uv.isConnected) {\n              var n = e.getInputBlockByPredicate(function(o) {\n                return o.isAttribute && o.name === \"uv\";\n              });\n              n || (n = new Et(\"uv\")).setAsAttribute(), n.output.connectTo(this.uv);\n            }\n            if (!this.strength.isConnected) {\n              var i = new Et(\"strength\");\n              i.value = 1, i.output.connectTo(this.strength);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = \"//\" + this.name, i = this.uv, o = this.worldPosition, a = this.worldNormal, s = this.worldTangent;\n            e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._tangentSpaceParameterName = e._getFreeDefineName(\"tangentSpaceParameter\"), e._emitUniformFromString(this._tangentSpaceParameterName, \"vec2\");\n            var d = this.strength.isConnectedToInputBlock && this.strength.connectInputBlock.isConstant ? \"\" + e._emitFloat(1 / this.strength.connectInputBlock.value) : \"1.0 / \" + this.strength.associatedVariableName;\n            e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\n            var p = { search: /defined\\(TANGENT\\)/g, replace: s.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\n            return s.isConnected && (e.compilationString += \"vec3 tbnNormal = normalize(\" + a.associatedVariableName + `.xyz);\\r\n`, e.compilationString += \"vec3 tbnTangent = normalize(\" + s.associatedVariableName + `.xyz);\\r\n`, e.compilationString += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\n`, e.compilationString += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\n`), e._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", n, { replaceStrings: [p] }), e._emitFunctionFromInclude(\"bumpFragmentFunctions\", n, { replaceStrings: [{ search: /vBumpInfos.y/g, replace: d }, { search: /vTangentSpaceParams/g, replace: this._tangentSpaceParameterName }, { search: /vPositionW/g, replace: o.associatedVariableName + \".xyz\" }] }), e.compilationString += this._declareOutput(this.output, e) + ` = vec4(0.);\\r\n`, e.compilationString += e._emitCodeFromInclude(\"bumpFragment\", n, { replaceStrings: [{ search: /perturbNormal\\(TBN,vBumpUV\\+uvOffset\\)/g, replace: \"perturbNormal(TBN, \" + this.normalMapColor.associatedVariableName + \")\" }, { search: /vBumpInfos.y/g, replace: d }, { search: /vBumpUV/g, replace: i.associatedVariableName }, { search: /vPositionW/g, replace: o.associatedVariableName + \".xyz\" }, { search: /normalW=/g, replace: this.output.associatedVariableName + \".xyz = \" }, { search: /mat3\\(normalMatrix\\)\\*normalW/g, replace: \"mat3(normalMatrix) * \" + this.output.associatedVariableName + \".xyz\" }, { search: /normalW/g, replace: a.associatedVariableName + \".xyz\" }, p] }), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".invertX = \" + this.invertX + `;\\r\n`;\n            return e += this._codeVariableName + \".invertY = \" + this.invertY + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.invertX = this.invertX, e.invertY = this.invertY, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.invertX = e.invertX, this.invertY = e.invertY;\n          }, Object(c.c)([Bt(\"Invert X axis\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !1 } })], t.prototype, \"invertX\", void 0), Object(c.c)([Bt(\"Invert Y axis\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !1 } })], t.prototype, \"invertY\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PerturbNormalBlock\"] = th;\n        var nh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment, !0) || this;\n            return n.registerInput(\"value\", le.Float, !0), n.registerInput(\"cutoff\", le.Float, !0), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DiscardBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cutoff\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.sharedData.hints.needAlphaTesting = !0, this.cutoff.isConnected && this.value.isConnected)\n              return e.compilationString += \"if (\" + this.value.associatedVariableName + \" < \" + this.cutoff.associatedVariableName + `) discard;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DiscardBlock\"] = nh;\n        var ih = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerOutput(\"output\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FrontFacingBlock\";\n          }, Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Vertex)\n              throw \"FrontFacingBlock must only be used in a fragment shader\";\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + ` = gl_FrontFacing ? 1.0 : 0.0;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FrontFacingBlock\"] = ih;\n        var rh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerInput(\"input\", le.AutoDetect, !1), n.registerOutput(\"dx\", le.BasedOnInput), n.registerOutput(\"dy\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._outputs[1]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DerivativeBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dx\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dy\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this._outputs[1];\n            return e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\"), n.hasEndpoints && (e.compilationString += this._declareOutput(n, e) + \" = dFdx(\" + this.input.associatedVariableName + `);\\r\n`), i.hasEndpoints && (e.compilationString += this._declareOutput(i, e) + \" = dFdy(\" + this.input.associatedVariableName + `);\\r\n`), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DerivativeBlock\"] = rh;\n        var oh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerOutput(\"xy\", le.Vector2, Ce.Fragment), n.registerOutput(\"xyz\", le.Vector3, Ce.Fragment), n.registerOutput(\"xyzw\", le.Vector4, Ce.Fragment), n.registerOutput(\"x\", le.Float, Ce.Fragment), n.registerOutput(\"y\", le.Float, Ce.Fragment), n.registerOutput(\"z\", le.Float, Ce.Fragment), n.registerOutput(\"w\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FragCoordBlock\";\n          }, Object.defineProperty(t.prototype, \"xy\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyz\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzw\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"z\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[6];\n          }, enumerable: !1, configurable: !0 }), t.prototype.writeOutputs = function(e) {\n            for (var n = \"\", i = 0, o = this._outputs; i < o.length; i++) {\n              var a = o[i];\n              a.hasEndpoints && (n += this._declareOutput(a, e) + \" = gl_FragCoord.\" + a.name + `;\\r\n`);\n            }\n            return n;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Vertex)\n              throw \"FragCoordBlock must only be used in a fragment shader\";\n            return e.compilationString += this.writeOutputs(e), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FragCoordBlock\"] = oh;\n        var ah = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerOutput(\"xy\", le.Vector2, Ce.Fragment), n.registerOutput(\"x\", le.Float, Ce.Fragment), n.registerOutput(\"y\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScreenSizeBlock\";\n          }, Object.defineProperty(t.prototype, \"xy\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype.bind = function(e, n, i) {\n            var o = this._scene.getEngine();\n            e.setFloat2(this._varName, o.getRenderWidth(), o.getRenderWidth());\n          }, t.prototype.writeOutputs = function(e, n) {\n            for (var i = \"\", o = 0, a = this._outputs; o < a.length; o++) {\n              var s = a[o];\n              s.hasEndpoints && (i += this._declareOutput(s, e) + \" = \" + n + \".\" + s.name + `;\\r\n`);\n            }\n            return i;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this._scene = e.sharedData.scene, e.target === Ce.Vertex)\n              throw \"ScreenSizeBlock must only be used in a fragment shader\";\n            return e.sharedData.bindableBlocks.push(this), this._varName = e._getFreeVariableName(\"screenSize\"), e._emitUniformFromString(this._varName, \"vec2\"), e.compilationString += this.writeOutputs(e, this._varName), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ScreenSizeBlock\"] = ah;\n        var sh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment, !0) || this;\n            return n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"view\", le.Matrix, !1, Ce.Vertex), n.registerInput(\"input\", le.Color3, !1, Ce.Fragment), n.registerInput(\"fogColor\", le.Color3, !1, Ce.Fragment), n.registerOutput(\"output\", le.Color3, Ce.Fragment), n.input.acceptedConnectionPointTypes.push(le.Color4), n.fogColor.acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FogBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fogColor\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.view.isConnected) {\n              var n = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.View;\n              });\n              n || (n = new Et(\"view\")).setAsSystemValue(gt.View), n.output.connectTo(this.view);\n            }\n            if (!this.fogColor.isConnected) {\n              var i = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.FogColor;\n              });\n              i || (i = new Et(\"fogColor\", void 0, le.Color3)).setAsSystemValue(gt.FogColor), i.output.connectTo(this.fogColor);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            var o = e.getScene();\n            i.setValue(\"FOG\", n.fogEnabled && $e.a.GetFogState(e, o));\n          }, t.prototype.bind = function(e, n, i) {\n            if (i) {\n              var o = i.getScene();\n              e.setFloat4(this._fogParameters, o.fogMode, o.fogStart, o.fogEnd, o.fogDensity);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Fragment) {\n              e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), e._emitFunctionFromInclude(\"fogFragmentDeclaration\", \"//\" + this.name, { removeUniforms: !0, removeVaryings: !0, removeIfDef: !1, replaceStrings: [{ search: /float CalcFogFactor\\(\\)/, replace: \"float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)\" }] });\n              var n = e._getFreeVariableName(\"fog\"), i = this.input, o = this.fogColor;\n              this._fogParameters = e._getFreeVariableName(\"fogParameters\");\n              var a = this._outputs[0];\n              e._emitUniformFromString(this._fogParameters, \"vec4\"), e.compilationString += `#ifdef FOG\\r\n`, e.compilationString += \"float \" + n + \" = CalcFogFactor(\" + this._fogDistanceName + \", \" + this._fogParameters + `);\\r\n`, e.compilationString += this._declareOutput(a, e) + \" = \" + n + \" * \" + i.associatedVariableName + \".rgb + (1.0 - \" + n + \") * \" + o.associatedVariableName + `.rgb;\\r\n`, e.compilationString += `#else\\r\n` + this._declareOutput(a, e) + \" =  \" + i.associatedVariableName + `.rgb;\\r\n`, e.compilationString += `#endif\\r\n`;\n            } else {\n              var s = this.worldPosition, d = this.view;\n              this._fogDistanceName = e._getFreeVariableName(\"vFogDistance\"), e._emitVaryingFromString(this._fogDistanceName, \"vec3\"), e.compilationString += this._fogDistanceName + \" = (\" + d.associatedVariableName + \" * \" + s.associatedVariableName + `).xyz;\\r\n`;\n            }\n            return this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FogBlock\"] = sh;\n        var ch = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment) || this;\n            return n._isUnique = !0, n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"worldNormal\", le.Vector4, !1, Ce.Fragment), n.registerInput(\"cameraPosition\", le.Vector3, !1, Ce.Fragment), n.registerInput(\"glossiness\", le.Float, !0, Ce.Fragment), n.registerInput(\"glossPower\", le.Float, !0, Ce.Fragment), n.registerInput(\"diffuseColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"specularColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"view\", le.Matrix, !0), n.registerOutput(\"diffuseOutput\", le.Color3, Ce.Fragment), n.registerOutput(\"specularOutput\", le.Color3, Ce.Fragment), n.registerOutput(\"shadow\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LightBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glossiness\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glossPower\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseColor\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularColor\", { get: function() {\n            return this._inputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseOutput\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularOutput\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadow\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areLightsDirty) {\n              var o = e.getScene();\n              if (this.light) {\n                var a = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };\n                $e.a.PrepareDefinesForLight(o, e, this.light, this._lightId, i, !0, a), a.needRebuild && i.rebuild();\n              } else\n                $e.a.PrepareDefinesForLights(o, e, i, !0, n.maxSimultaneousLights);\n            }\n          }, t.prototype.updateUniformsAndSamples = function(e, n, i, o) {\n            for (var a = 0; a < n.maxSimultaneousLights && i[\"LIGHT\" + a]; a++) {\n              var s = e.uniforms.indexOf(\"vLightData\" + a) >= 0;\n              $e.a.PrepareUniformsAndSamplersForLight(a, e.uniforms, e.samplers, i[\"PROJECTEDLIGHTTEXTURE\" + a], o, s);\n            }\n          }, t.prototype.bind = function(e, n, i) {\n            if (i) {\n              var o = i.getScene();\n              this.light ? $e.a.BindLight(this.light, this._lightId, o, e, !0) : $e.a.BindLights(o, i, e, !0, n.maxSimultaneousLights);\n            }\n          }, t.prototype._injectVertexCode = function(e) {\n            var n = this.worldPosition, i = \"//\" + this.name;\n            this.light ? (this._lightId = (e.counters.lightCounter !== void 0 ? e.counters.lightCounter : -1) + 1, e.counters.lightCounter = this._lightId, e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", i, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString())) : (e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", i, { repeatKey: \"maxSimultaneousLights\" }), this._lightId = 0, e.sharedData.dynamicUniformBlocks.push(this));\n            var o = \"v_\" + n.associatedVariableName;\n            e._emitVaryingFromString(o, \"vec4\") && (e.compilationString += o + \" = \" + n.associatedVariableName + `;\\r\n`), this.light ? e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", i, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, { search: /worldPos/g, replace: n.associatedVariableName }] }) : (e.compilationString += \"vec4 worldPos = \" + n.associatedVariableName + `;\\r\n`, this.view.isConnected && (e.compilationString += \"mat4 view = \" + this.view.associatedVariableName + `;\\r\n`), e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", i, { repeatKey: \"maxSimultaneousLights\" }));\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Fragment) {\n              e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);\n              var n = \"//\" + this.name, i = this.worldPosition;\n              e._emitFunctionFromInclude(\"helperFunctions\", n), e._emitFunctionFromInclude(\"lightsFragmentFunctions\", n, { replaceStrings: [{ search: /vPositionW/g, replace: \"v_\" + i.associatedVariableName + \".xyz\" }] }), e._emitFunctionFromInclude(\"shadowsFragmentFunctions\", n, { replaceStrings: [{ search: /vPositionW/g, replace: \"v_\" + i.associatedVariableName + \".xyz\" }] }), this.light ? e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", n, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString()) : e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", n, { repeatKey: \"maxSimultaneousLights\" }), this._lightId === 0 && (e._registerTempVariable(\"viewDirectionW\") && (e.compilationString += \"vec3 viewDirectionW = normalize(\" + this.cameraPosition.associatedVariableName + \" - v_\" + i.associatedVariableName + `.xyz);\\r\n`), e.compilationString += `lightingInfo info;\\r\n`, e.compilationString += `float shadow = 1.;\\r\n`, e.compilationString += \"float glossiness = \" + (this.glossiness.isConnected ? this.glossiness.associatedVariableName : \"1.0\") + \" * \" + (this.glossPower.isConnected ? this.glossPower.associatedVariableName : \"1024.0\") + `;\\r\n`, e.compilationString += `vec3 diffuseBase = vec3(0., 0., 0.);\\r\n`, e.compilationString += `vec3 specularBase = vec3(0., 0., 0.);\\r\n`, e.compilationString += \"vec3 normalW = \" + this.worldNormal.associatedVariableName + `.xyz;\\r\n`), this.light ? e.compilationString += e._emitCodeFromInclude(\"lightFragment\", n, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }) : e.compilationString += e._emitCodeFromInclude(\"lightFragment\", n, { repeatKey: \"maxSimultaneousLights\" });\n              var o = this.diffuseOutput, a = this.specularOutput;\n              return e.compilationString += this._declareOutput(o, e) + \" = diffuseBase\" + (this.diffuseColor.isConnected ? \" * \" + this.diffuseColor.associatedVariableName : \"\") + `;\\r\n`, a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + \" = specularBase\" + (this.specularColor.isConnected ? \" * \" + this.specularColor.associatedVariableName : \"\") + `;\\r\n`), this.shadow.hasEndpoints && (e.compilationString += this._declareOutput(this.shadow, e) + ` = shadow;\\r\n`), this;\n            }\n            this._injectVertexCode(e);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.light && (e.lightId = this.light.id), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.lightId && (this.light = n.getLightByID(e.lightId));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LightBlock\"] = ch;\n        var lh = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = !1);\n            var i = r.call(this, e, n ? Ce.Fragment : Ce.VertexAndFragment) || this;\n            return i.convertToGammaSpace = !1, i.convertToLinearSpace = !1, i._fragmentOnly = n, i.registerInput(\"uv\", le.Vector2, !1, Ce.VertexAndFragment), i.registerOutput(\"rgba\", le.Color4, Ce.Neutral), i.registerOutput(\"rgb\", le.Color3, Ce.Neutral), i.registerOutput(\"r\", le.Float, Ce.Neutral), i.registerOutput(\"g\", le.Float, Ce.Neutral), i.registerOutput(\"b\", le.Float, Ce.Neutral), i.registerOutput(\"a\", le.Float, Ce.Neutral), i._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), i._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), i._inputs[0]._prioritizeVertex = !n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TextureBlock\";\n          }, Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"target\", { get: function() {\n            if (this._fragmentOnly)\n              return Ce.Fragment;\n            if (!this.uv.isConnected || this.uv.sourceBlock.isInput)\n              return Ce.VertexAndFragment;\n            for (var e = this.uv.connectedPoint; e; ) {\n              if (e.target === Ce.Fragment)\n                return Ce.Fragment;\n              if (e.target === Ce.Vertex)\n                return Ce.VertexAndFragment;\n              if (e.target === Ce.Neutral || e.target === Ce.VertexAndFragment) {\n                var n = e.ownerBlock;\n                e = null;\n                for (var i = 0, o = n.inputs; i < o.length; i++) {\n                  var a = o[i];\n                  if (a.connectedPoint) {\n                    e = a.connectedPoint;\n                    break;\n                  }\n                }\n              }\n            }\n            return Ce.VertexAndFragment;\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.uv.isConnected)\n              if (e.mode === Rn.PostProcess)\n                (n = e.getBlockByPredicate(function(o) {\n                  return o.name === \"uv\";\n                })) && n.connectTo(this);\n              else {\n                var n, i = e.mode === Rn.Particle ? \"particle_uv\" : \"uv\";\n                (n = e.getInputBlockByPredicate(function(o) {\n                  return o.isAttribute && o.name === i;\n                })) || (n = new Et(\"uv\")).setAsAttribute(i), n.output.connectTo(this.uv);\n              }\n          }, t.prototype.initializeDefines = function(e, n, i, o) {\n            i._areTexturesDirty && i.setValue(this._mainUVDefineName, !1);\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areTexturesDirty) {\n              if (!this.texture || !this.texture.getTextureMatrix)\n                return i.setValue(this._defineName, !1), void i.setValue(this._mainUVDefineName, !0);\n              i.setValue(this._linearDefineName, this.convertToGammaSpace), i.setValue(this._gammaDefineName, this.convertToLinearSpace), this._isMixed && (this.texture.getTextureMatrix().isIdentityAs3x2() ? (i.setValue(this._defineName, !1), i.setValue(this._mainUVDefineName, !0)) : i.setValue(this._defineName, !0));\n            }\n          }, t.prototype.isReady = function() {\n            return !(this.texture && !this.texture.isReadyOrNotBlocking());\n          }, t.prototype.bind = function(e, n, i) {\n            this.texture && (this._isMixed && (e.setFloat(this._textureInfoName, this.texture.level), e.setMatrix(this._textureTransformName, this.texture.getTextureMatrix())), e.setTexture(this._samplerName, this.texture));\n          }, Object.defineProperty(t.prototype, \"_isMixed\", { get: function() {\n            return this.target !== Ce.Fragment;\n          }, enumerable: !1, configurable: !0 }), t.prototype._injectVertexCode = function(e) {\n            var n = this.uv;\n            if (this._defineName = e._getFreeDefineName(\"UVTRANSFORM\"), this._mainUVDefineName = \"VMAIN\" + n.associatedVariableName.toUpperCase(), n.connectedPoint.ownerBlock.isInput && (n.connectedPoint.ownerBlock.isAttribute || e._emitUniformFromString(n.associatedVariableName, \"vec2\")), this._mainUVName = \"vMain\" + n.associatedVariableName, this._transformedUVName = e._getFreeVariableName(\"transformedUV\"), this._textureTransformName = e._getFreeVariableName(\"textureTransform\"), this._textureInfoName = e._getFreeVariableName(\"textureInfoName\"), e._emitVaryingFromString(this._transformedUVName, \"vec2\", this._defineName), e._emitVaryingFromString(this._mainUVName, \"vec2\", this._mainUVDefineName), e._emitUniformFromString(this._textureTransformName, \"mat4\", this._defineName), e.compilationString += \"#ifdef \" + this._defineName + `\\r\n`, e.compilationString += this._transformedUVName + \" = vec2(\" + this._textureTransformName + \" * vec4(\" + n.associatedVariableName + `.xy, 1.0, 0.0));\\r\n`, e.compilationString += \"#elif defined(\" + this._mainUVDefineName + `)\\r\n`, e.compilationString += this._mainUVName + \" = \" + n.associatedVariableName + `.xy;\\r\n`, e.compilationString += `#endif\\r\n`, this._outputs.some(function(s) {\n              return s.isConnectedInVertexShader;\n            })) {\n              this._writeTextureRead(e, !0);\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name, !0);\n              }\n            }\n          }, t.prototype._writeTextureRead = function(e, n) {\n            n === void 0 && (n = !1);\n            var i = this.uv;\n            if (n) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n            } else\n              this.uv.ownerBlock.target !== Ce.Fragment ? (e.compilationString += \"#ifdef \" + this._defineName + `\\r\n`, e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this._transformedUVName + `);\\r\n`, e.compilationString += \"#elif defined(\" + this._mainUVDefineName + `)\\r\n`, e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this._mainUVName + `);\\r\n`, e.compilationString += `#endif\\r\n`) : e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n          }, t.prototype._writeOutput = function(e, n, i, o) {\n            if (o === void 0 && (o = !1), o) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n            } else if (this.uv.ownerBlock.target !== Ce.Fragment) {\n              var a = \" * \" + this._textureInfoName;\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + a + `;\\r\n`, i !== \"a\" && (e.compilationString += \"#ifdef \" + this._linearDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toGammaSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += \"#ifdef \" + this._gammaDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toLinearSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`);\n            } else\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), (e.target === Ce.Vertex || this._fragmentOnly) && (this._tempTextureRead = e._getFreeVariableName(\"tempTextureRead\")), (!this._isMixed && e.target === Ce.Fragment || this._isMixed && e.target === Ce.Vertex) && (this._samplerName = e._getFreeVariableName(this.name + \"Sampler\"), e._emit2DSampler(this._samplerName), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this)), e.target === Ce.Fragment) {\n              if (this._outputs.some(function(s) {\n                return s.isConnectedInFragmentShader;\n              })) {\n                this._isMixed && e._emit2DSampler(this._samplerName), this._linearDefineName = e._getFreeDefineName(\"ISLINEAR\"), this._gammaDefineName = e._getFreeDefineName(\"ISGAMMA\");\n                var n = \"//\" + this.name;\n                e._emitFunctionFromInclude(\"helperFunctions\", n), this._isMixed && e._emitUniformFromString(this._textureInfoName, \"float\"), this._writeTextureRead(e);\n                for (var i = 0, o = this._outputs; i < o.length; i++) {\n                  var a = o[i];\n                  a.hasEndpoints && this._writeOutput(e, a, a.name);\n                }\n                return this;\n              }\n            } else\n              this._injectVertexCode(e);\n          }, t.prototype._dumpPropertiesCode = function() {\n            if (!this.texture)\n              return \"\";\n            var e = this._codeVariableName + '.texture = new BABYLON.Texture(\"' + this.texture.name + `\", null);\\r\n`;\n            return e += this._codeVariableName + \".texture.wrapU = \" + this.texture.wrapU + `;\\r\n`, e += this._codeVariableName + \".texture.wrapV = \" + this.texture.wrapV + `;\\r\n`, e += this._codeVariableName + \".texture.uAng = \" + this.texture.uAng + `;\\r\n`, e += this._codeVariableName + \".texture.vAng = \" + this.texture.vAng + `;\\r\n`, e += this._codeVariableName + \".texture.wAng = \" + this.texture.wAng + `;\\r\n`, e += this._codeVariableName + \".texture.uOffset = \" + this.texture.uOffset + `;\\r\n`, e += this._codeVariableName + \".texture.vOffset = \" + this.texture.vOffset + `;\\r\n`, e += this._codeVariableName + \".texture.uScale = \" + this.texture.uScale + `;\\r\n`, e += this._codeVariableName + \".texture.vScale = \" + this.texture.vScale + `;\\r\n`, e += this._codeVariableName + \".convertToGammaSpace = \" + this.convertToGammaSpace + `;\\r\n`, e += this._codeVariableName + \".convertToLinearSpace = \" + this.convertToLinearSpace + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, e.fragmentOnly = this._fragmentOnly, this.texture && !this.texture.isRenderTarget && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, this._fragmentOnly = !!e.fragmentOnly, e.texture && !sa.IgnoreTexturesAtLoadTime && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.TextureBlock\"] = lh;\n        var tc = function(r) {\n          function t(e) {\n            return r.call(this, e, Ce.VertexAndFragment) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectionTextureBaseBlock\";\n          }, t.prototype._getTexture = function() {\n            return this.texture;\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.position.isConnected) {\n              var n = e.getInputBlockByPredicate(function(a) {\n                return a.isAttribute && a.name === \"position\";\n              });\n              n || (n = new Et(\"position\")).setAsAttribute(), n.output.connectTo(this.position);\n            }\n            if (!this.world.isConnected) {\n              var i = e.getInputBlockByPredicate(function(a) {\n                return a.systemValue === gt.World;\n              });\n              i || (i = new Et(\"world\")).setAsSystemValue(gt.World), i.output.connectTo(this.world);\n            }\n            if (this.view && !this.view.isConnected) {\n              var o = e.getInputBlockByPredicate(function(a) {\n                return a.systemValue === gt.View;\n              });\n              o || (o = new Et(\"view\")).setAsSystemValue(gt.View), o.output.connectTo(this.view);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areTexturesDirty) {\n              var o = this._getTexture();\n              o && o.getTextureMatrix && (i.setValue(this._define3DName, o.isCube, !0), i.setValue(this._defineLocalCubicName, !!o.boundingBoxSize, !0), i.setValue(this._defineExplicitName, o.coordinatesMode === h.a.TEXTURE_EXPLICIT_MODE, !0), i.setValue(this._defineSkyboxName, o.coordinatesMode === h.a.TEXTURE_SKYBOX_MODE, !0), i.setValue(this._defineCubicName, o.coordinatesMode === h.a.TEXTURE_CUBIC_MODE || o.coordinatesMode === h.a.TEXTURE_INVCUBIC_MODE, !0), i.setValue(\"INVERTCUBICMAP\", o.coordinatesMode === h.a.TEXTURE_INVCUBIC_MODE, !0), i.setValue(this._defineSphericalName, o.coordinatesMode === h.a.TEXTURE_SPHERICAL_MODE, !0), i.setValue(this._definePlanarName, o.coordinatesMode === h.a.TEXTURE_PLANAR_MODE, !0), i.setValue(this._defineProjectionName, o.coordinatesMode === h.a.TEXTURE_PROJECTION_MODE, !0), i.setValue(this._defineEquirectangularName, o.coordinatesMode === h.a.TEXTURE_EQUIRECTANGULAR_MODE, !0), i.setValue(this._defineEquirectangularFixedName, o.coordinatesMode === h.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, !0), i.setValue(this._defineMirroredEquirectangularFixedName, o.coordinatesMode === h.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, !0));\n            }\n          }, t.prototype.isReady = function() {\n            var e = this._getTexture();\n            return !(e && !e.isReadyOrNotBlocking());\n          }, t.prototype.bind = function(e, n, i) {\n            var o = this._getTexture();\n            i && o && (e.setMatrix(this._reflectionMatrixName, o.getReflectionTextureMatrix()), o.isCube ? e.setTexture(this._cubeSamplerName, o) : e.setTexture(this._2DSamplerName, o));\n          }, t.prototype.handleVertexSide = function(e) {\n            this._define3DName = e._getFreeDefineName(\"REFLECTIONMAP_3D\"), this._defineCubicName = e._getFreeDefineName(\"REFLECTIONMAP_CUBIC\"), this._defineSphericalName = e._getFreeDefineName(\"REFLECTIONMAP_SPHERICAL\"), this._definePlanarName = e._getFreeDefineName(\"REFLECTIONMAP_PLANAR\"), this._defineProjectionName = e._getFreeDefineName(\"REFLECTIONMAP_PROJECTION\"), this._defineExplicitName = e._getFreeDefineName(\"REFLECTIONMAP_EXPLICIT\"), this._defineEquirectangularName = e._getFreeDefineName(\"REFLECTIONMAP_EQUIRECTANGULAR\"), this._defineLocalCubicName = e._getFreeDefineName(\"USE_LOCAL_REFLECTIONMAP_CUBIC\"), this._defineMirroredEquirectangularFixedName = e._getFreeDefineName(\"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\"), this._defineEquirectangularFixedName = e._getFreeDefineName(\"REFLECTIONMAP_EQUIRECTANGULAR_FIXED\"), this._defineSkyboxName = e._getFreeDefineName(\"REFLECTIONMAP_SKYBOX\"), this._defineOppositeZ = e._getFreeDefineName(\"REFLECTIONMAP_OPPOSITEZ\"), this._reflectionMatrixName = e._getFreeVariableName(\"reflectionMatrix\"), e._emitUniformFromString(this._reflectionMatrixName, \"mat4\");\n            var n = \"\", i = \"v_\" + this.worldPosition.associatedVariableName;\n            return e._emitVaryingFromString(i, \"vec4\") && (n += i + \" = \" + this.worldPosition.associatedVariableName + `;\\r\n`), this._positionUVWName = e._getFreeVariableName(\"positionUVW\"), this._directionWName = e._getFreeVariableName(\"directionW\"), e._emitVaryingFromString(this._positionUVWName, \"vec3\", this._defineSkyboxName) && (n += \"#ifdef \" + this._defineSkyboxName + `\\r\n`, n += this._positionUVWName + \" = \" + this.position.associatedVariableName + `.xyz;\\r\n`, n += `#endif\\r\n`), e._emitVaryingFromString(this._directionWName, \"vec3\", \"defined(\" + this._defineEquirectangularFixedName + \") || defined(\" + this._defineMirroredEquirectangularFixedName + \")\") && (n += \"#if defined(\" + this._defineEquirectangularFixedName + \") || defined(\" + this._defineMirroredEquirectangularFixedName + `)\\r\n`, n += this._directionWName + \" = normalize(vec3(\" + this.world.associatedVariableName + \" * vec4(\" + this.position.associatedVariableName + `.xyz, 0.0)));\\r\n`, n += `#endif\\r\n`), n;\n          }, t.prototype.handleFragmentSideInits = function(e) {\n            e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), this._cubeSamplerName = e._getFreeVariableName(this.name + \"CubeSampler\"), e.samplers.push(this._cubeSamplerName), this._2DSamplerName = e._getFreeVariableName(this.name + \"2DSampler\"), e.samplers.push(this._2DSamplerName), e._samplerDeclaration += \"#ifdef \" + this._define3DName + `\\r\n`, e._samplerDeclaration += \"uniform samplerCube \" + this._cubeSamplerName + `;\\r\n`, e._samplerDeclaration += `#else\\r\n`, e._samplerDeclaration += \"uniform sampler2D \" + this._2DSamplerName + `;\\r\n`, e._samplerDeclaration += `#endif\\r\n`, e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this);\n            var n = \"//\" + this.name;\n            e._emitFunction(\"ReciprocalPI\", \"#define RECIPROCAL_PI2 0.15915494\", \"\"), e._emitFunctionFromInclude(\"reflectionFunction\", n, { replaceStrings: [{ search: /vec3 computeReflectionCoords/g, replace: \"void DUMMYFUNC\" }] }), this._reflectionColorName = e._getFreeVariableName(\"reflectionColor\"), this._reflectionVectorName = e._getFreeVariableName(\"reflectionUVW\"), this._reflectionCoordsName = e._getFreeVariableName(\"reflectionCoords\");\n          }, t.prototype.handleFragmentSideCodeReflectionCoords = function(e, n, i) {\n            i === void 0 && (i = !1), n || (n = \"v_\" + this.worldPosition.associatedVariableName);\n            var o = this._reflectionMatrixName, a = \"normalize(\" + this._directionWName + \")\", s = \"\" + this._positionUVWName, d = \"\" + this.cameraPosition.associatedVariableName, p = \"\" + this.view.associatedVariableName;\n            e += \".xyz\";\n            var y = `\n            #ifdef ` + this._defineMirroredEquirectangularFixedName + `\n                vec3 ` + this._reflectionVectorName + \" = computeMirroredFixedEquirectangularCoords(\" + n + \", \" + e + \", \" + a + `);\n            #endif\n\n            #ifdef ` + this._defineEquirectangularFixedName + `\n                vec3 ` + this._reflectionVectorName + \" = computeFixedEquirectangularCoords(\" + n + \", \" + e + \", \" + a + `);\n            #endif\n\n            #ifdef ` + this._defineEquirectangularName + `\n                vec3 ` + this._reflectionVectorName + \" = computeEquirectangularCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineSphericalName + `\n                vec3 ` + this._reflectionVectorName + \" = computeSphericalCoords(\" + n + \", \" + e + \", \" + p + \", \" + o + `);\n            #endif\n\n            #ifdef ` + this._definePlanarName + `\n                vec3 ` + this._reflectionVectorName + \" = computePlanarCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineCubicName + `\n                #ifdef ` + this._defineLocalCubicName + `\n                    vec3 ` + this._reflectionVectorName + \" = computeCubicLocalCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `, vReflectionSize, vReflectionPosition);\n                #else\n                vec3 ` + this._reflectionVectorName + \" = computeCubicCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `);\n                #endif\n            #endif\n\n            #ifdef ` + this._defineProjectionName + `\n                vec3 ` + this._reflectionVectorName + \" = computeProjectionCoords(\" + n + \", \" + p + \", \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineSkyboxName + `\n                vec3 ` + this._reflectionVectorName + \" = computeSkyBoxCoords(\" + s + \", \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineExplicitName + `\n                vec3 ` + this._reflectionVectorName + ` = vec3(0, 0, 0);\n            #endif\n\n            #ifdef ` + this._defineOppositeZ + `\n                ` + this._reflectionVectorName + `.z *= -1.0;\n            #endif\\r\n`;\n            return i || (y += `\n                #ifdef ` + this._define3DName + `\n                    vec3 ` + this._reflectionCoordsName + \" = \" + this._reflectionVectorName + `;\n                #else\n                    vec2 ` + this._reflectionCoordsName + \" = \" + this._reflectionVectorName + `.xy;\n                    #ifdef ` + this._defineProjectionName + `\n                        ` + this._reflectionCoordsName + \" /= \" + this._reflectionVectorName + `.z;\n                    #endif\n                    ` + this._reflectionCoordsName + \".y = 1.0 - \" + this._reflectionCoordsName + `.y;\n                #endif\\r\n`), y;\n          }, t.prototype.handleFragmentSideCodeReflectionColor = function(e, n) {\n            n === void 0 && (n = \".rgb\");\n            var i = \"vec\" + (n.length === 0 ? \"4\" : n.length - 1) + \" \" + this._reflectionColorName + `;\n            #ifdef ` + this._define3DName + `\\r\n`;\n            return i += e ? this._reflectionColorName + \" = textureCubeLodEXT(\" + this._cubeSamplerName + \", \" + this._reflectionVectorName + \", \" + e + \")\" + n + `;\\r\n` : this._reflectionColorName + \" = textureCube(\" + this._cubeSamplerName + \", \" + this._reflectionVectorName + \")\" + n + `;\\r\n`, i += `\n            #else\\r\n`, i += e ? this._reflectionColorName + \" = texture2DLodEXT(\" + this._2DSamplerName + \", \" + this._reflectionCoordsName + \", \" + e + \")\" + n + `;\\r\n` : this._reflectionColorName + \" = texture2D(\" + this._2DSamplerName + \", \" + this._reflectionCoordsName + \")\" + n + `;\\r\n`, i += `#endif\\r\n`;\n          }, t.prototype.writeOutputs = function(e, n) {\n            var i = \"\";\n            if (e.target === Ce.Fragment)\n              for (var o = 0, a = this._outputs; o < a.length; o++) {\n                var s = a[o];\n                s.hasEndpoints && (i += this._declareOutput(s, e) + \" = \" + n + \".\" + s.name + `;\\r\n`);\n              }\n            return i;\n          }, t.prototype._buildBlock = function(e) {\n            return r.prototype._buildBlock.call(this, e), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            return this.texture ? (e = this.texture.isCube ? this._codeVariableName + '.texture = new BABYLON.CubeTexture(\"' + this.texture.name + `\");\\r\n` : this._codeVariableName + '.texture = new BABYLON.Texture(\"' + this.texture.name + `\");\\r\n`, e += this._codeVariableName + \".texture.coordinatesMode = \" + this.texture.coordinatesMode + `;\\r\n`) : \"\";\n            var e;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.texture && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, e.texture.isCube ? this.texture = ei.Parse(e.texture, n, i) : this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReflectionTextureBaseBlock\"] = tc;\n        var uh = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.registerInput(\"position\", le.Vector3, !1, Ce.Vertex), n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"worldNormal\", le.Vector4, !1, Ce.Fragment), n.registerInput(\"world\", le.Matrix, !1, Ce.Vertex), n.registerInput(\"cameraPosition\", le.Vector3, !1, Ce.Fragment), n.registerInput(\"view\", le.Matrix, !1, Ce.Fragment), n.registerOutput(\"rgb\", le.Color3, Ce.Fragment), n.registerOutput(\"rgba\", le.Color4, Ce.Fragment), n.registerOutput(\"r\", le.Float, Ce.Fragment), n.registerOutput(\"g\", le.Float, Ce.Fragment), n.registerOutput(\"b\", le.Float, Ce.Fragment), n.registerOutput(\"a\", le.Float, Ce.Fragment), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectionTextureBlock\";\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (r.prototype.autoConfigure.call(this, e), !this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), !this.texture)\n              return e.compilationString += this.writeOutputs(e, \"vec3(0.)\"), this;\n            if (e.target !== Ce.Fragment)\n              return e.compilationString += this.handleVertexSide(e), this;\n            this.handleFragmentSideInits(e);\n            var n = e._getFreeVariableName(\"normalWUnit\");\n            return e.compilationString += \"vec4 \" + n + \" = normalize(\" + this.worldNormal.associatedVariableName + `);\\r\n`, e.compilationString += this.handleFragmentSideCodeReflectionCoords(n), e.compilationString += this.handleFragmentSideCodeReflectionColor(void 0, \"\"), e.compilationString += this.writeOutputs(e, this._reflectionColorName), this;\n          }, t;\n        }(tc);\n        O.a.RegisteredTypes[\"BABYLON.ReflectionTextureBlock\"] = uh;\n        var hh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AddBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" + \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.AddBlock\"] = hh;\n        var dh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerInput(\"factor\", le.Float), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScaleBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"factor\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.input.associatedVariableName + \" * \" + this.factor.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ScaleBlock\"] = dh;\n        var fh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.minimum = 0, n.maximum = 1, n.registerInput(\"value\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ClampBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = clamp(\" + this.value.associatedVariableName + \", \" + this._writeFloat(this.minimum) + \", \" + this._writeFloat(this.maximum) + `);\\r\n`, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".minimum = \" + this.minimum + `;\\r\n`;\n            return e += this._codeVariableName + \".maximum = \" + this.maximum + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.minimum = this.minimum, e.maximum = this.maximum, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.minimum = e.minimum, this.maximum = e.maximum;\n          }, Object(c.c)([Bt(\"Minimum\", It.Float)], t.prototype, \"minimum\", void 0), Object(c.c)([Bt(\"Maximum\", It.Float)], t.prototype, \"maximum\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ClampBlock\"] = fh;\n        var ph = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.Vector3), n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[0].excludedConnectionPointTypes.push(le.Vector2), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"CrossBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = cross(\" + this.left.associatedVariableName + \".xyz, \" + this.right.associatedVariableName + `.xyz);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.CrossBlock\"] = ph;\n        var _h = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.Float), n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DotBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = dot(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DotBlock\"] = _h;\n        var mh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NormalizeBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this._inputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = normalize(\" + i.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NormalizeBlock\"] = mh;\n        var gh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"rgb \", le.Color3, !0), n.registerInput(\"r\", le.Float, !0), n.registerInput(\"g\", le.Float, !0), n.registerInput(\"b\", le.Float, !0), n.registerInput(\"a\", le.Float, !0), n.registerOutput(\"rgba\", le.Color4), n.registerOutput(\"rgb\", le.Color3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ColorMergerBlock\";\n          }, Object.defineProperty(t.prototype, \"rgbIn\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgbOut\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this.rgbOut;\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.r, i = this.g, o = this.b, a = this.a, s = this.rgbIn, d = this._outputs[0], p = this._outputs[1];\n            return s.isConnected ? d.hasEndpoints ? e.compilationString += this._declareOutput(d, e) + \" = vec4(\" + s.associatedVariableName + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : p.hasEndpoints && (e.compilationString += this._declareOutput(p, e) + \" = \" + s.associatedVariableName + `;\\r\n`) : d.hasEndpoints ? e.compilationString += this._declareOutput(d, e) + \" = vec4(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : p.hasEndpoints && (e.compilationString += this._declareOutput(p, e) + \" = vec3(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + `);\\r\n`), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ColorMergerBlock\"] = gh;\n        var vh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"xyzw\", le.Vector4, !0), n.registerInput(\"xyz \", le.Vector3, !0), n.registerInput(\"xy \", le.Vector2, !0), n.registerOutput(\"xyz\", le.Vector3), n.registerOutput(\"xy\", le.Vector2), n.registerOutput(\"x\", le.Float), n.registerOutput(\"y\", le.Float), n.registerOutput(\"z\", le.Float), n.registerOutput(\"w\", le.Float), n.inputsAreExclusive = !0, n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VectorSplitterBlock\";\n          }, Object.defineProperty(t.prototype, \"xyzw\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzIn\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyIn\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzOut\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyOut\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"z\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"w\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype._inputRename = function(e) {\n            switch (e) {\n              case \"xy \":\n                return \"xyIn\";\n              case \"xyz \":\n                return \"xyzIn\";\n              default:\n                return e;\n            }\n          }, t.prototype._outputRename = function(e) {\n            switch (e) {\n              case \"xy\":\n                return \"xyOut\";\n              case \"xyz\":\n                return \"xyzOut\";\n              default:\n                return e;\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn, i = this._outputs[0], o = this._outputs[1], a = this._outputs[2], s = this._outputs[3], d = this._outputs[4], p = this._outputs[5];\n            return i.hasEndpoints && (n === this.xyIn ? e.compilationString += this._declareOutput(i, e) + \" = vec3(\" + n.associatedVariableName + `, 0.0);\\r\n` : e.compilationString += this._declareOutput(i, e) + \" = \" + n.associatedVariableName + `.xyz;\\r\n`), o.hasEndpoints && (e.compilationString += this._declareOutput(o, e) + \" = \" + n.associatedVariableName + `.xy;\\r\n`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + \" = \" + n.associatedVariableName + `.x;\\r\n`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + \" = \" + n.associatedVariableName + `.y;\\r\n`), d.hasEndpoints && (e.compilationString += this._declareOutput(d, e) + \" = \" + n.associatedVariableName + `.z;\\r\n`), p.hasEndpoints && (e.compilationString += this._declareOutput(p, e) + \" = \" + n.associatedVariableName + `.w;\\r\n`), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.VectorSplitterBlock\"] = vh;\n        var yh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerInput(\"gradient\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._linkConnectionTypes(1, 2, !0), n._inputs[2].acceptedConnectionPointTypes.push(le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LerpBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"gradient\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = mix(\" + this.left.associatedVariableName + \" , \" + this.right.associatedVariableName + \", \" + this.gradient.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LerpBlock\"] = yh;\n        var bh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DivideBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" / \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DivideBlock\"] = bh;\n        var Th = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SubtractBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" - \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SubtractBlock\"] = Th;\n        var Eh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.Float), n.registerInput(\"edge\", le.Float), n.registerOutput(\"output\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StepBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edge\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = step(\" + this.edge.associatedVariableName + \", \" + this.value.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.StepBlock\"] = Eh;\n        var nc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._outputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"OneMinusBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = 1. - \" + this.input.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.OneMinusBlock\"] = nc, O.a.RegisteredTypes[\"BABYLON.OppositeBlock\"] = nc;\n        var ic = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"worldPosition\", le.Vector4), n.registerInput(\"cameraPosition\", le.Vector3), n.registerOutput(\"output\", le.Vector3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ViewDirectionBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = normalize(\" + this.cameraPosition.associatedVariableName + \" - \" + this.worldPosition.associatedVariableName + `.xyz);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ViewDirectionBlock\"] = ic, f(161);\n        var Sh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"worldNormal\", le.Vector4), n.registerInput(\"viewDirection\", le.Vector3), n.registerInput(\"bias\", le.Float), n.registerInput(\"power\", le.Float), n.registerOutput(\"fresnel\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FresnelBlock\";\n          }, Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"viewDirection\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bias\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"power\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fresnel\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.viewDirection.isConnected) {\n              var n = new ic(\"View direction\");\n              n.output.connectTo(this.viewDirection), n.autoConfigure(e);\n            }\n            if (!this.bias.isConnected) {\n              var i = new Et(\"bias\");\n              i.value = 0, i.output.connectTo(this.bias);\n            }\n            if (!this.power.isConnected) {\n              var o = new Et(\"power\");\n              o.value = 1, o.output.connectTo(this.power);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = \"//\" + this.name;\n            return e._emitFunctionFromInclude(\"fresnelFunction\", n, { removeIfDef: !0 }), e.compilationString += this._declareOutput(this.fresnel, e) + \" = computeFresnelTerm(\" + this.viewDirection.associatedVariableName + \".xyz, \" + this.worldNormal.associatedVariableName + \".xyz, \" + this.bias.associatedVariableName + \", \" + this.power.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FresnelBlock\"] = Sh;\n        var Ah = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MaxBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = max(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MaxBlock\"] = Ah;\n        var Ph = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MinBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = min(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MinBlock\"] = Ph;\n        var xh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.Float), n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DistanceBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = length(\" + this.left.associatedVariableName + \" - \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DistanceBlock\"] = xh;\n        var Ch = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerOutput(\"output\", le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LengthBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = length(\" + this.value.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LengthBlock\"] = Ch;\n        var Rh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NegateBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = -1.0 * \" + this.value.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NegateBlock\"] = Rh;\n        var Oh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"power\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PowBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"power\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = pow(\" + this.value.associatedVariableName + \", \" + this.power.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PowBlock\"] = Oh;\n        var Mh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"seed\", le.Vector2), n.registerOutput(\"output\", le.Float), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RandomNumberBlock\";\n          }, Object.defineProperty(t.prototype, \"seed\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = \"//\" + this.name;\n            return e._emitFunctionFromInclude(\"helperFunctions\", i), e.compilationString += this._declareOutput(n, e) + \" = getRand(\" + this.seed.associatedVariableName + `.xy);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RandomNumberBlock\"] = Mh;\n        var Ih = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"x\", le.Float), n.registerInput(\"y\", le.Float), n.registerOutput(\"output\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ArcTan2Block\";\n          }, Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = atan(\" + this.x.associatedVariableName + \", \" + this.y.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ArcTan2Block\"] = Ih;\n        var Dh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"edge0\", le.Float), n.registerInput(\"edge1\", le.Float), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SmoothStepBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edge0\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edge1\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = smoothstep(\" + this.edge0.associatedVariableName + \", \" + this.edge1.associatedVariableName + \", \" + this.value.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SmoothStepBlock\"] = Dh;\n        var Lh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._outputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReciprocalBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = 1. / \" + this.input.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReciprocalBlock\"] = Lh;\n        var Nh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"reference\", le.AutoDetect), n.registerInput(\"distance\", le.Float), n.registerInput(\"replacement\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._linkConnectionTypes(0, 3), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n._inputs[3].excludedConnectionPointTypes.push(le.Float), n._inputs[3].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReplaceColorBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reference\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"distance\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"replacement\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + `;\\r\n`, e.compilationString += \"if (length(\" + this.value.associatedVariableName + \" - \" + this.reference.associatedVariableName + \") < \" + this.distance.associatedVariableName + `) {\\r\n`, e.compilationString += n.associatedVariableName + \" = \" + this.replacement.associatedVariableName + `;\\r\n`, e.compilationString += `} else {\\r\n`, e.compilationString += n.associatedVariableName + \" = \" + this.value.associatedVariableName + `;\\r\n`, e.compilationString += `}\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReplaceColorBlock\"] = Nh;\n        var qi, wh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"steps\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PosterizeBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"steps\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = floor(\" + this.value.associatedVariableName + \" / (1.0 / \" + this.steps.associatedVariableName + \")) * (1.0 / \" + this.steps.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PosterizeBlock\"] = wh, function(r) {\n          r[r.SawTooth = 0] = \"SawTooth\", r[r.Square = 1] = \"Square\", r[r.Triangle = 2] = \"Triangle\";\n        }(qi || (qi = {}));\n        var Fh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.kind = qi.SawTooth, n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"WaveBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            switch (this.kind) {\n              case qi.SawTooth:\n                e.compilationString += this._declareOutput(n, e) + \" = \" + this.input.associatedVariableName + \" - floor(0.5 + \" + this.input.associatedVariableName + `);\\r\n`;\n                break;\n              case qi.Square:\n                e.compilationString += this._declareOutput(n, e) + \" = 1.0 - 2.0 * round(fract(\" + this.input.associatedVariableName + `));\\r\n`;\n                break;\n              case qi.Triangle:\n                e.compilationString += this._declareOutput(n, e) + \" = 2.0 * abs(2.0 * (\" + this.input.associatedVariableName + \" - floor(0.5 + \" + this.input.associatedVariableName + `))) - 1.0;\\r\n`;\n            }\n            return this;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.kind = this.kind, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.kind = e.kind;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.WaveBlock\"] = Fh;\n        var ca = function() {\n          function r(t, e) {\n            this.step = t, this.color = e;\n          }\n          return Object.defineProperty(r.prototype, \"step\", { get: function() {\n            return this._step;\n          }, set: function(t) {\n            this._step = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"color\", { get: function() {\n            return this._color;\n          }, set: function(t) {\n            this._color = t;\n          }, enumerable: !1, configurable: !0 }), r;\n        }(), Bh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.colorSteps = [new ca(0, I.a.Black()), new ca(1, I.a.White())], n.onValueChangedObservable = new C.c(), n.registerInput(\"gradient\", le.Float), n.registerOutput(\"output\", le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector2), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.colorStepsUpdated = function() {\n            this.onValueChangedObservable.notifyObservers(this);\n          }, t.prototype.getClassName = function() {\n            return \"GradientBlock\";\n          }, Object.defineProperty(t.prototype, \"gradient\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._writeColorConstant = function(e) {\n            var n = this.colorSteps[e];\n            return \"vec3(\" + n.color.r + \", \" + n.color.g + \", \" + n.color.b + \")\";\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            if (this.colorSteps.length && this.gradient.connectedPoint) {\n              var i = e._getFreeVariableName(\"gradientTempColor\"), o = e._getFreeVariableName(\"gradientTempPosition\");\n              e.compilationString += \"vec3 \" + i + \" = \" + this._writeColorConstant(0) + `;\\r\n`, e.compilationString += \"float \" + o + `;\\r\n`;\n              var a = this.gradient.associatedVariableName;\n              this.gradient.connectedPoint.type !== le.Float && (a += \".x\");\n              for (var s = 1; s < this.colorSteps.length; s++) {\n                var d = this.colorSteps[s], p = this.colorSteps[s - 1];\n                e.compilationString += o + \" = clamp((\" + a + \" - \" + e._emitFloat(p.step) + \") / (\" + e._emitFloat(d.step) + \" -  \" + e._emitFloat(p.step) + \"), 0.0, 1.0) * step(\" + e._emitFloat(s) + \", \" + e._emitFloat(this.colorSteps.length - 1) + `);\\r\n`, e.compilationString += i + \" = mix(\" + i + \", \" + this._writeColorConstant(s) + \", \" + o + `);\\r\n`;\n              }\n              return e.compilationString += this._declareOutput(n, e) + \" = \" + i + `;\\r\n`, this;\n            }\n            e.compilationString += this._declareOutput(n, e) + ` = vec3(0., 0., 0.);\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            e.colorSteps = [];\n            for (var n = 0, i = this.colorSteps; n < i.length; n++) {\n              var o = i[n];\n              e.colorSteps.push({ step: o.step, color: { r: o.color.r, g: o.color.g, b: o.color.b } });\n            }\n            return e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.colorSteps = [];\n            for (var o = 0, a = e.colorSteps; o < a.length; o++) {\n              var s = a[o];\n              this.colorSteps.push(new ca(s.step, new I.a(s.color.r, s.color.g, s.color.b)));\n            }\n          }, t.prototype._dumpPropertiesCode = function() {\n            for (var e = \"\", n = 0, i = this.colorSteps; n < i.length; n++) {\n              var o = i[n];\n              e += this._codeVariableName + \".colorSteps.push(new BABYLON.GradientBlockColorStep(\" + o.step + \", new BABYLON.Color3(\" + o.color.r + \", \" + o.color.g + \", \" + o.color.b + `)));\\r\n`;\n            }\n            return e;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.GradientBlock\"] = Bh;\n        var Uh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerInput(\"gradient\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._linkConnectionTypes(1, 2, !0), n._inputs[2].acceptedConnectionPointTypes.push(le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NLerpBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"gradient\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = normalize(mix(\" + this.left.associatedVariableName + \" , \" + this.right.associatedVariableName + \", \" + this.gradient.associatedVariableName + `));\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NLerpBlock\"] = Uh;\n        var Vh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.manhattanDistance = !1, n.registerInput(\"seed\", le.Vector3), n.registerInput(\"jitter\", le.Float), n.registerOutput(\"output\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"WorleyNoise3DBlock\";\n          }, Object.defineProperty(t.prototype, \"seed\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"jitter\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this.seed.isConnected && this._outputs[0].hasEndpoints)\n              return e._emitFunction(\"worley3D\", `vec3 permute(vec3 x){\\r\n    return mod((34.0 * x + 1.0) * x, 289.0);\\r\n}\\r\n\\r\nvec3 dist(vec3 x, vec3 y, vec3 z,  bool manhattanDistance){\\r\n    return manhattanDistance ?  abs(x) + abs(y) + abs(z) :  (x * x + y * y + z * z);\\r\n}\\r\n\\r\nvec2 worley(vec3 P, float jitter, bool manhattanDistance){\\r\n    float K = 0.142857142857; // 1/7\\r\n    float Ko = 0.428571428571; // 1/2-K/2\\r\n    float  K2 = 0.020408163265306; // 1/(7*7)\\r\n    float Kz = 0.166666666667; // 1/6\\r\n    float Kzo = 0.416666666667; // 1/2-1/6*2\\r\n\\r\n    vec3 Pi = mod(floor(P), 289.0);\\r\n    vec3 Pf = fract(P) - 0.5;\\r\n\\r\n    vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\\r\n    vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\\r\n    vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\\r\n\\r\n    vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\\r\n    vec3 p1 = permute(p + Pi.y - 1.0);\\r\n    vec3 p2 = permute(p + Pi.y);\\r\n    vec3 p3 = permute(p + Pi.y + 1.0);\\r\n\\r\n    vec3 p11 = permute(p1 + Pi.z - 1.0);\\r\n    vec3 p12 = permute(p1 + Pi.z);\\r\n    vec3 p13 = permute(p1 + Pi.z + 1.0);\\r\n\\r\n    vec3 p21 = permute(p2 + Pi.z - 1.0);\\r\n    vec3 p22 = permute(p2 + Pi.z);\\r\n    vec3 p23 = permute(p2 + Pi.z + 1.0);\\r\n\\r\n    vec3 p31 = permute(p3 + Pi.z - 1.0);\\r\n    vec3 p32 = permute(p3 + Pi.z);\\r\n    vec3 p33 = permute(p3 + Pi.z + 1.0);\\r\n\\r\n    vec3 ox11 = fract(p11*K) - Ko;\\r\n    vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\\r\n    vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\\r\n\\r\n    vec3 ox12 = fract(p12*K) - Ko;\\r\n    vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\\r\n    vec3 oz12 = floor(p12*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox13 = fract(p13*K) - Ko;\\r\n    vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\\r\n    vec3 oz13 = floor(p13*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox21 = fract(p21*K) - Ko;\\r\n    vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\\r\n    vec3 oz21 = floor(p21*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox22 = fract(p22*K) - Ko;\\r\n    vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\\r\n    vec3 oz22 = floor(p22*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox23 = fract(p23*K) - Ko;\\r\n    vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\\r\n    vec3 oz23 = floor(p23*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox31 = fract(p31*K) - Ko;\\r\n    vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\\r\n    vec3 oz31 = floor(p31*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox32 = fract(p32*K) - Ko;\\r\n    vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\\r\n    vec3 oz32 = floor(p32*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox33 = fract(p33*K) - Ko;\\r\n    vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\\r\n    vec3 oz33 = floor(p33*K2)*Kz - Kzo;\\r\n\\r\n    vec3 dx11 = Pfx + jitter*ox11;\\r\n    vec3 dy11 = Pfy.x + jitter*oy11;\\r\n    vec3 dz11 = Pfz.x + jitter*oz11;\\r\n\\r\n    vec3 dx12 = Pfx + jitter*ox12;\\r\n    vec3 dy12 = Pfy.x + jitter*oy12;\\r\n    vec3 dz12 = Pfz.y + jitter*oz12;\\r\n\\r\n    vec3 dx13 = Pfx + jitter*ox13;\\r\n    vec3 dy13 = Pfy.x + jitter*oy13;\\r\n    vec3 dz13 = Pfz.z + jitter*oz13;\\r\n\\r\n    vec3 dx21 = Pfx + jitter*ox21;\\r\n    vec3 dy21 = Pfy.y + jitter*oy21;\\r\n    vec3 dz21 = Pfz.x + jitter*oz21;\\r\n\\r\n    vec3 dx22 = Pfx + jitter*ox22;\\r\n    vec3 dy22 = Pfy.y + jitter*oy22;\\r\n    vec3 dz22 = Pfz.y + jitter*oz22;\\r\n\\r\n    vec3 dx23 = Pfx + jitter*ox23;\\r\n    vec3 dy23 = Pfy.y + jitter*oy23;\\r\n    vec3 dz23 = Pfz.z + jitter*oz23;\\r\n\\r\n    vec3 dx31 = Pfx + jitter*ox31;\\r\n    vec3 dy31 = Pfy.z + jitter*oy31;\\r\n    vec3 dz31 = Pfz.x + jitter*oz31;\\r\n\\r\n    vec3 dx32 = Pfx + jitter*ox32;\\r\n    vec3 dy32 = Pfy.z + jitter*oy32;\\r\n    vec3 dz32 = Pfz.y + jitter*oz32;\\r\n\\r\n    vec3 dx33 = Pfx + jitter*ox33;\\r\n    vec3 dy33 = Pfy.z + jitter*oy33;\\r\n    vec3 dz33 = Pfz.z + jitter*oz33;\\r\n\\r\n    vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\\r\n    vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);\\r\n    vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\\r\n    vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\\r\n    vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\\r\n    vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\\r\n    vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\\r\n    vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\\r\n    vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\\r\n\\r\n    vec3 d1a = min(d11, d12);\\r\n    d12 = max(d11, d12);\\r\n    d11 = min(d1a, d13); // Smallest now not in d12 or d13\\r\n    d13 = max(d1a, d13);\\r\n    d12 = min(d12, d13); // 2nd smallest now not in d13\\r\n    vec3 d2a = min(d21, d22);\\r\n    d22 = max(d21, d22);\\r\n    d21 = min(d2a, d23); // Smallest now not in d22 or d23\\r\n    d23 = max(d2a, d23);\\r\n    d22 = min(d22, d23); // 2nd smallest now not in d23\\r\n    vec3 d3a = min(d31, d32);\\r\n    d32 = max(d31, d32);\\r\n    d31 = min(d3a, d33); // Smallest now not in d32 or d33\\r\n    d33 = max(d3a, d33);\\r\n    d32 = min(d32, d33); // 2nd smallest now not in d33\\r\n    vec3 da = min(d11, d21);\\r\n    d21 = max(d11, d21);\\r\n    d11 = min(da, d31); // Smallest now in d11\\r\n    d31 = max(da, d31); // 2nd smallest now not in d31\\r\n    d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;\\r\n    d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest\\r\n    d12 = min(d12, d21); // 2nd smallest now not in d21\\r\n    d12 = min(d12, d22); // nor in d22\\r\n    d12 = min(d12, d31); // nor in d31\\r\n    d12 = min(d12, d32); // nor in d32\\r\n    d11.yz = min(d11.yz,d12.xy); // nor in d12.yz\\r\n    d11.y = min(d11.y,d12.z); // Only two more to go\\r\n    d11.y = min(d11.y,d11.z); // Done! (Phew!)\\r\n    return sqrt(d11.xy); // F1, F2\\r\n}\\r\n\\r\n`, \"// Worley3D\"), e.compilationString += this._declareOutput(this._outputs[0], e) + \" = worley(\" + this.seed.associatedVariableName + \", \" + this.jitter.associatedVariableName + \", \" + this.manhattanDistance + `);\\r\n`, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            return this._codeVariableName + \".manhattanDistance = \" + this.manhattanDistance + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.manhattanDistance = this.manhattanDistance, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.manhattanDistance = e.manhattanDistance;\n          }, Object(c.c)([Bt(\"Use Manhattan Distance\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !1 } })], t.prototype, \"manhattanDistance\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.WorleyNoise3DBlock\"] = Vh;\n        var kh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"seed\", le.Vector3), n.registerOutput(\"output\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SimplexPerlin3DBlock\";\n          }, Object.defineProperty(t.prototype, \"seed\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this.seed.isConnected && this._outputs[0].hasEndpoints)\n              return e._emitFunction(\"SimplexPerlin3D\", `const float SKEWFACTOR = 1.0/3.0;\\r\nconst float UNSKEWFACTOR = 1.0/6.0;\\r\nconst float SIMPLEX_CORNER_POS = 0.5;\\r\nconst float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\\r\nfloat SimplexPerlin3D( vec3 P ){\\r\n    P *= SIMPLEX_TETRAHADRON_HEIGHT;\\r\n    vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );    vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\\r\n    vec3 g = step(x0.yzx, x0.xyz);\\r\n    vec3 l = 1.0 - g;\\r\n    vec3 Pi_1 = min( g.xyz, l.zxy );\\r\n    vec3 Pi_2 = max( g.xyz, l.zxy );\\r\n    vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\\r\n    vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\\r\n    vec3 x3 = x0 - SIMPLEX_CORNER_POS;\\r\n    vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\\r\n    vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\\r\n    vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\\r\n    Pi.xyz = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\\r\n    vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\\r\n    vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\\r\n    Pt *= Pt;\\r\n    vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\\r\n    Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\\r\n    const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\\r\n    const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\\r\n    vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\\r\n    vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\\r\n    Pi_1 = ( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods;\\r\n    Pi_2 = ( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods;\\r\n    vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\\r\n    vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\\r\n    vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\\r\n    vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\\r\n    const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\\r\n    vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\\r\n    kernel_weights = max(0.5 - kernel_weights, 0.0);\\r\n    kernel_weights = kernel_weights*kernel_weights*kernel_weights;\\r\n    return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\\r\n}\\r\n`, \"// SimplexPerlin3D\"), e.compilationString += this._declareOutput(this._outputs[0], e) + \" = SimplexPerlin3D(\" + this.seed.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SimplexPerlin3DBlock\"] = kh;\n        var Gh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"normalMap0\", le.Vector3), n.registerInput(\"normalMap1\", le.Vector3), n.registerOutput(\"output\", le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[1].acceptedConnectionPointTypes.push(le.Color3), n._inputs[1].acceptedConnectionPointTypes.push(le.Color4), n._inputs[1].acceptedConnectionPointTypes.push(le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NormalBlendBlock\";\n          }, Object.defineProperty(t.prototype, \"normalMap0\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalMap1\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this._inputs[0], o = this._inputs[1], a = e._getFreeVariableName(\"stepR\"), s = e._getFreeVariableName(\"stepG\");\n            return e.compilationString += \"float \" + a + \" = step(0.5, \" + i.associatedVariableName + `.r);\\r\n`, e.compilationString += \"float \" + s + \" = step(0.5, \" + i.associatedVariableName + `.g);\\r\n`, e.compilationString += this._declareOutput(n, e) + `;\\r\n`, e.compilationString += n.associatedVariableName + \".r = (1.0 - \" + a + \") * \" + i.associatedVariableName + \".r * \" + o.associatedVariableName + \".r * 2.0 + \" + a + \" * (1.0 - \" + i.associatedVariableName + \".r) * (1.0 - \" + o.associatedVariableName + `.r) * 2.0;\\r\n`, e.compilationString += n.associatedVariableName + \".g = (1.0 - \" + s + \") * \" + i.associatedVariableName + \".g * \" + o.associatedVariableName + \".g * 2.0 + \" + s + \" * (1.0 - \" + i.associatedVariableName + \".g) * (1.0 - \" + o.associatedVariableName + `.g) * 2.0;\\r\n`, e.compilationString += n.associatedVariableName + \".b = \" + i.associatedVariableName + \".b * \" + o.associatedVariableName + `.b;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NormalBlendBlock\"] = Gh;\n        var zh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.Vector2), n.registerInput(\"angle\", le.Float), n.registerOutput(\"output\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"Rotate2dBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"angle\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.angle.isConnected) {\n              var n = new Et(\"angle\");\n              n.value = 0, n.output.connectTo(this.angle);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this.angle, o = this.input;\n            return e.compilationString += this._declareOutput(n, e) + \" = vec2(cos(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + \".x - sin(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + \".y, sin(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + \".x + cos(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + `.y);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.Rotate2dBlock\"] = zh;\n        var jh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"incident\", le.Vector3), n.registerInput(\"normal\", le.Vector3), n.registerOutput(\"output\", le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n._inputs[1].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[1].acceptedConnectionPointTypes.push(le.Color3), n._inputs[1].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectBlock\";\n          }, Object.defineProperty(t.prototype, \"incident\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = reflect(\" + this.incident.associatedVariableName + \".xyz, \" + this.normal.associatedVariableName + `.xyz);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReflectBlock\"] = jh;\n        var Hh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"incident\", le.Vector3), n.registerInput(\"normal\", le.Vector3), n.registerInput(\"ior\", le.Float), n.registerOutput(\"output\", le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n._inputs[1].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[1].acceptedConnectionPointTypes.push(le.Color3), n._inputs[1].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RefractBlock\";\n          }, Object.defineProperty(t.prototype, \"incident\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ior\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = refract(\" + this.incident.associatedVariableName + \".xyz, \" + this.normal.associatedVariableName + \".xyz, \" + this.ior.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RefractBlock\"] = Hh;\n        var Wh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"color\", le.Color3), n.registerInput(\"level\", le.Float), n.registerOutput(\"output\", le.Color3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DesaturateBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"level\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this.color.associatedVariableName, o = e._getFreeVariableName(\"colorMin\"), a = e._getFreeVariableName(\"colorMax\"), s = e._getFreeVariableName(\"colorMerge\");\n            return e.compilationString += \"float \" + o + \" = min(min(\" + i + \".x, \" + i + \".y), \" + i + `.z);\\r\n`, e.compilationString += \"float \" + a + \" = max(max(\" + i + \".x, \" + i + \".y), \" + i + `.z);\\r\n`, e.compilationString += \"float \" + s + \" = 0.5 * (\" + o + \" + \" + a + `);\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = mix(\" + i + \", vec3(\" + s + \", \" + s + \", \" + s + \"), \" + this.level.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DesaturateBlock\"] = Wh;\n        var Xn = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, n, i) || this;\n            return d._blockType = o, d._blockName = a, d._nameForCheking = s, d._nameForCheking || (d._nameForCheking = e), d.needDualDirectionValidation = !0, d;\n          }\n          return Object(c.d)(t, r), t.prototype.checkCompatibilityState = function(e) {\n            return e instanceof t && e.name === this._nameForCheking ? ii.Compatible : ii.TypeIncompatible;\n          }, t.prototype.createCustomInputBlock = function() {\n            return [new this._blockType(this._blockName), this.name];\n          }, t;\n        }(na), rc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.albedoScaling = !1, n.linkSheenWithAlbedo = !1, n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !0, Ce.Fragment), n.registerInput(\"color\", le.Color3, !0, Ce.Fragment), n.registerInput(\"roughness\", le.Float, !0, Ce.Fragment), n.registerOutput(\"sheen\", le.Object, Ce.Fragment, new Xn(\"sheen\", n, yn.Output, t, \"SheenBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"sheenOut\"), e._excludeVariableName(\"sheenMapData\"), e._excludeVariableName(\"vSheenColor\"), e._excludeVariableName(\"vSheenRoughness\");\n          }, t.prototype.getClassName = function() {\n            return \"SheenBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"roughness\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheen\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i), i.setValue(\"SHEEN\", !0), i.setValue(\"SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\", !0, !0), i.setValue(\"SHEEN_LINKWITHALBEDO\", this.linkSheenWithAlbedo, !0), i.setValue(\"SHEEN_ROUGHNESS\", this.roughness.isConnected, !0), i.setValue(\"SHEEN_ALBEDOSCALING\", this.albedoScaling, !0);\n          }, t.prototype.getCode = function(e) {\n            return `#ifdef SHEEN\n            sheenOutParams sheenOut;\n\n            vec4 vSheenColor = vec4(` + (this.color.isConnected ? this.color.associatedVariableName : \"vec3(1.)\") + \", \" + (this.intensity.isConnected ? this.intensity.associatedVariableName : \"1.\") + `);\n\n            sheenBlock(\n                vSheenColor,\n            #ifdef SHEEN_ROUGHNESS\n                ` + (this.roughness.isConnected ? this.roughness.associatedVariableName : \"0.\") + `,\n            #endif\n                roughness,\n            #ifdef SHEEN_TEXTURE\n                vec4(0.),\n            #endif\n                reflectance,\n            #ifdef SHEEN_LINKWITHALBEDO\n                baseColor,\n                surfaceAlbedo,\n            #endif\n            #ifdef ENVIRONMENTBRDF\n                NdotV,\n                environmentBrdf,\n            #endif\n            #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n                AARoughnessFactors,\n                ` + (e == null ? void 0 : e._vReflectionMicrosurfaceInfosName) + `,\n                ` + (e == null ? void 0 : e._vReflectionInfosName) + `,\n                ` + (e == null ? void 0 : e.reflectionColor) + `,\n                vLightingIntensity,\n                #ifdef ` + (e == null ? void 0 : e._define3DName) + `\n                    ` + (e == null ? void 0 : e._cubeSamplerName) + `,\n                #else\n                    ` + (e == null ? void 0 : e._2DSamplerName) + `,\n                #endif\n                reflectionOut.reflectionCoords,\n                NdotVUnclamped,\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef ` + (e == null ? void 0 : e._define3DName) + `\n                        ` + (e == null ? void 0 : e._cubeSamplerName) + `,\n                        ` + (e == null ? void 0 : e._cubeSamplerName) + `,\n                    #else\n                        ` + (e == null ? void 0 : e._2DSamplerName) + `,\n                        ` + (e == null ? void 0 : e._2DSamplerName) + `,\n                    #endif\n                #endif\n                #if !defined(` + (e == null ? void 0 : e._defineSkyboxName) + `) && defined(RADIANCEOCCLUSION)\n                    seo,\n                #endif\n                #if !defined(` + (e == null ? void 0 : e._defineSkyboxName) + \") && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(\" + (e == null ? void 0 : e._define3DName) + `)\n                    eho,\n                #endif\n            #endif\n                sheenOut\n            );\n\n            #ifdef SHEEN_LINKWITHALBEDO\n                surfaceAlbedo = sheenOut.surfaceAlbedo;\n            #endif\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return e.target === Ce.Fragment && e.sharedData.blocksWithDefines.push(this), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = r.prototype._dumpPropertiesCode.call(this);\n            return e += this._codeVariableName + \".albedoScaling = \" + this.albedoScaling + `;\\r\n`, e += this._codeVariableName + \".linkSheenWithAlbedo = \" + this.linkSheenWithAlbedo + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.albedoScaling = this.albedoScaling, e.linkSheenWithAlbedo = this.linkSheenWithAlbedo, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.albedoScaling = e.albedoScaling, this.linkSheenWithAlbedo = e.linkSheenWithAlbedo;\n          }, Object(c.c)([Bt(\"Albedo scaling\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !0 } })], t.prototype, \"albedoScaling\", void 0), Object(c.c)([Bt(\"Link sheen with albedo\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !0 } })], t.prototype, \"linkSheenWithAlbedo\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SheenBlock\"] = rc;\n        var oc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !0, Ce.Fragment), n.registerInput(\"direction\", le.Vector2, !0, Ce.Fragment), n.registerInput(\"uv\", le.Vector2, !0), n.registerInput(\"worldTangent\", le.Vector4, !0), n.registerOutput(\"anisotropy\", le.Object, Ce.Fragment, new Xn(\"anisotropy\", n, yn.Output, t, \"AnisotropyBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"anisotropicOut\"), e._excludeVariableName(\"TBN\");\n          }, t.prototype.getClassName = function() {\n            return \"AnisotropyBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldTangent\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"anisotropy\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._generateTBNSpace = function(e) {\n            var n = \"\", i = \"//\" + this.name, o = this.uv, a = this.worldPositionConnectionPoint, s = this.worldNormalConnectionPoint, d = this.worldTangent;\n            o.isConnected || console.error(\"You must connect the 'uv' input of the Anisotropy block!\"), e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\n            var p = { search: /defined\\(TANGENT\\)/g, replace: d.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\n            return d.isConnected && (n += \"vec3 tbnNormal = normalize(\" + s.associatedVariableName + `.xyz);\\r\n`, n += \"vec3 tbnTangent = normalize(\" + d.associatedVariableName + `.xyz);\\r\n`, n += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\n`, n += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\n`), n += `\n            #if defined(` + (d.isConnected ? \"TANGENT\" : \"IGNORE\") + `) && defined(NORMAL)\n                mat3 TBN = vTBN;\n            #else\n                mat3 TBN = cotangent_frame(` + s.associatedVariableName + \".xyz, v_\" + a.associatedVariableName + \".xyz, \" + (o.isConnected ? o.associatedVariableName : \"vec2(0.)\") + `, vec2(1., 1.));\n            #endif\\r\n`, e._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", i, { replaceStrings: [p] }), n;\n          }, t.prototype.getCode = function(e, n) {\n            n === void 0 && (n = !1);\n            var i = \"\";\n            n && (i += this._generateTBNSpace(e));\n            var o = this.intensity.isConnected ? this.intensity.associatedVariableName : \"1.0\";\n            return i += `anisotropicOutParams anisotropicOut;\n            anisotropicBlock(\n                vec3(` + (this.direction.isConnected ? this.direction.associatedVariableName : \"vec2(1., 0.)\") + \", \" + o + `),\n            #ifdef ANISOTROPIC_TEXTURE\n                vec3(0.),\n            #endif\n                TBN,\n                normalW,\n                viewDirectionW,\n                anisotropicOut\n            );\\r\n`;\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i), i.setValue(\"ANISOTROPIC\", !0), i.setValue(\"ANISOTROPIC_TEXTURE\", !1, !0);\n          }, t.prototype._buildBlock = function(e) {\n            return e.target === Ce.Fragment && e.sharedData.blocksWithDefines.push(this), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.AnisotropyBlock\"] = oc;\n        var ac = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.useSphericalHarmonics = !0, n.forceIrradianceInFragment = !1, n._isUnique = !0, n.registerInput(\"position\", le.Vector3, !1, Ce.Vertex), n.registerInput(\"world\", le.Matrix, !1, Ce.Vertex), n.registerInput(\"color\", le.Color3, !0, Ce.Fragment), n.registerOutput(\"reflection\", le.Object, Ce.Fragment, new Xn(\"reflection\", n, yn.Output, t, \"ReflectionBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectionBlock\";\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this.worldPositionConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this.worldNormalConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this.cameraPositionConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this.viewConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflection\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasTexture\", { get: function() {\n            return !!this._getTexture();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflectionColor\", { get: function() {\n            return this.color.isConnected ? this.color.associatedVariableName : \"vec3(1., 1., 1.)\";\n          }, enumerable: !1, configurable: !0 }), t.prototype._getTexture = function() {\n            return this.texture ? this.texture : this._scene.environmentTexture;\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i);\n            var o = this._getTexture(), a = o && o.getTextureMatrix;\n            i.setValue(\"REFLECTION\", a, !0), a && (i.setValue(this._defineLODReflectionAlpha, o.lodLevelInAlpha, !0), i.setValue(this._defineLinearSpecularReflection, o.linearSpecularLOD, !0), i.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !o.invertZ : o.invertZ, !0), i.setValue(\"SPHERICAL_HARMONICS\", this.useSphericalHarmonics, !0), i.setValue(\"GAMMAREFLECTION\", o.gammaSpace, !0), i.setValue(\"RGBDREFLECTION\", o.isRGBD, !0), o && o.coordinatesMode !== Ne.a.SKYBOX_MODE && o.isCube && (i.setValue(\"USESPHERICALFROMREFLECTIONMAP\", !0), i.setValue(\"USEIRRADIANCEMAP\", !1), this.forceIrradianceInFragment || this._scene.getEngine().getCaps().maxVaryingVectors <= 8 ? i.setValue(\"USESPHERICALINVERTEX\", !1) : i.setValue(\"USESPHERICALINVERTEX\", !0)));\n          }, t.prototype.bind = function(e, n, i, o) {\n            r.prototype.bind.call(this, e, n, i);\n            var a = this._getTexture();\n            if (a && o) {\n              a.isCube ? e.setTexture(this._cubeSamplerName, a) : e.setTexture(this._2DSamplerName, a);\n              var s = a.getSize().width;\n              e.setFloat3(this._vReflectionMicrosurfaceInfosName, s, a.lodGenerationScale, a.lodGenerationOffset), e.setFloat2(this._vReflectionFilteringInfoName, s, $.a.Log2(s));\n              var d = o._materialDefines, p = a.sphericalPolynomial;\n              if (d.USESPHERICALFROMREFLECTIONMAP && p)\n                if (d.SPHERICAL_HARMONICS) {\n                  var y = p.preScaledHarmonics;\n                  e.setVector3(\"vSphericalL00\", y.l00), e.setVector3(\"vSphericalL1_1\", y.l1_1), e.setVector3(\"vSphericalL10\", y.l10), e.setVector3(\"vSphericalL11\", y.l11), e.setVector3(\"vSphericalL2_2\", y.l2_2), e.setVector3(\"vSphericalL2_1\", y.l2_1), e.setVector3(\"vSphericalL20\", y.l20), e.setVector3(\"vSphericalL21\", y.l21), e.setVector3(\"vSphericalL22\", y.l22);\n                } else\n                  e.setFloat3(\"vSphericalX\", p.x.x, p.x.y, p.x.z), e.setFloat3(\"vSphericalY\", p.y.x, p.y.y, p.y.z), e.setFloat3(\"vSphericalZ\", p.z.x, p.z.y, p.z.z), e.setFloat3(\"vSphericalXX_ZZ\", p.xx.x - p.zz.x, p.xx.y - p.zz.y, p.xx.z - p.zz.z), e.setFloat3(\"vSphericalYY_ZZ\", p.yy.x - p.zz.x, p.yy.y - p.zz.y, p.yy.z - p.zz.z), e.setFloat3(\"vSphericalZZ\", p.zz.x, p.zz.y, p.zz.z), e.setFloat3(\"vSphericalXY\", p.xy.x, p.xy.y, p.xy.z), e.setFloat3(\"vSphericalYZ\", p.yz.x, p.yz.y, p.yz.z), e.setFloat3(\"vSphericalZX\", p.zx.x, p.zx.y, p.zx.z);\n            }\n          }, t.prototype.handleVertexSide = function(e) {\n            var n = r.prototype.handleVertexSide.call(this, e);\n            e._emitFunctionFromInclude(\"harmonicsFunctions\", \"//\" + this.name, { replaceStrings: [{ search: /uniform vec3 vSphericalL00;[\\s\\S]*?uniform vec3 vSphericalL22;/g, replace: \"\" }, { search: /uniform vec3 vSphericalX;[\\s\\S]*?uniform vec3 vSphericalZX;/g, replace: \"\" }] });\n            var i = e._getFreeVariableName(\"reflectionVector\");\n            return this._vEnvironmentIrradianceName = e._getFreeVariableName(\"vEnvironmentIrradiance\"), e._emitVaryingFromString(this._vEnvironmentIrradianceName, \"vec3\", \"defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\"), e._emitUniformFromString(\"vSphericalL00\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL1_1\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL10\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL11\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL2_2\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL2_1\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL20\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL21\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL22\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalX\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalY\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalXX_ZZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalYY_ZZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalZZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalXY\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalYZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalZX\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), n += `#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n                vec3 ` + i + \" = vec3(\" + this._reflectionMatrixName + \" * vec4(normalize(\" + this.worldNormal.associatedVariableName + `).xyz, 0)).xyz;\n                #ifdef ` + this._defineOppositeZ + `\n                    ` + i + `.z *= -1.0;\n                #endif\n                ` + this._vEnvironmentIrradianceName + \" = computeEnvironmentIrradiance(\" + i + `);\n            #endif\\r\n`;\n          }, t.prototype.getCode = function(e, n) {\n            var i = \"\";\n            this.handleFragmentSideInits(e), e._emitFunctionFromInclude(\"harmonicsFunctions\", \"//\" + this.name, { replaceStrings: [{ search: /uniform vec3 vSphericalL00;[\\s\\S]*?uniform vec3 vSphericalL22;/g, replace: \"\" }, { search: /uniform vec3 vSphericalX;[\\s\\S]*?uniform vec3 vSphericalZX;/g, replace: \"\" }] }), e._emitFunction(\"sampleReflection\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleReflection(s, c) textureCube(s, c)\n            #else\n                #define sampleReflection(s, c) texture2D(s, c)\n            #endif\\r\n`, \"//\" + this.name), e._emitFunction(\"sampleReflectionLod\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)\n            #else\n                #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)\n            #endif\\r\n`, \"//\" + this.name);\n            var o = `\n            vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {\n                ` + this.handleFragmentSideCodeReflectionCoords(\"worldNormal\", \"worldPos\", !0) + `\n                return ` + this._reflectionVectorName + `;\n            }\\r\n`;\n            return e._emitFunction(\"computeReflectionCoordsPBR\", o, \"//\" + this.name), this._vReflectionMicrosurfaceInfosName = e._getFreeVariableName(\"vReflectionMicrosurfaceInfos\"), e._emitUniformFromString(this._vReflectionMicrosurfaceInfosName, \"vec3\"), this._vReflectionInfosName = e._getFreeVariableName(\"vReflectionInfos\"), this._vReflectionFilteringInfoName = e._getFreeVariableName(\"vReflectionFilteringInfo\"), e._emitUniformFromString(this._vReflectionFilteringInfoName, \"vec2\"), i += `#ifdef REFLECTION\n            vec2 ` + this._vReflectionInfosName + ` = vec2(1., 0.);\n\n            reflectionOutParams reflectionOut;\n\n            reflectionBlock(\n                v_` + this.worldPosition.associatedVariableName + `.xyz,\n                ` + n + `,\n                alphaG,\n                ` + this._vReflectionMicrosurfaceInfosName + `,\n                ` + this._vReflectionInfosName + `,\n                ` + this.reflectionColor + `,\n            #ifdef ANISOTROPIC\n                anisotropicOut,\n            #endif\n            #if defined(` + this._defineLODReflectionAlpha + \") && !defined(\" + this._defineSkyboxName + `)\n                NdotVUnclamped,\n            #endif\n            #ifdef ` + this._defineLinearSpecularReflection + `\n                roughness,\n            #endif\n            #ifdef ` + this._define3DName + `\n                ` + this._cubeSamplerName + `,\n            #else\n                ` + this._2DSamplerName + `,\n            #endif\n            #if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n                ` + this._vEnvironmentIrradianceName + `,\n            #endif\n            #ifdef USESPHERICALFROMREFLECTIONMAP\n                #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n                    ` + this._reflectionMatrixName + `,\n                #endif\n            #endif\n            #ifdef USEIRRADIANCEMAP\n                irradianceSampler, // ** not handled **\n            #endif\n            #ifndef LODBASEDMICROSFURACE\n                #ifdef ` + this._define3DName + `\n                    ` + this._cubeSamplerName + `,\n                    ` + this._cubeSamplerName + `,\n                #else\n                    ` + this._2DSamplerName + `,\n                    ` + this._2DSamplerName + `,\n                #endif\n            #endif\n            #ifdef REALTIME_FILTERING\n                ` + this._vReflectionFilteringInfoName + `,\n            #endif\n                reflectionOut\n            );\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return this._scene = e.sharedData.scene, e.target !== Ce.Fragment && (this._defineLODReflectionAlpha = e._getFreeDefineName(\"LODINREFLECTIONALPHA\"), this._defineLinearSpecularReflection = e._getFreeDefineName(\"LINEARSPECULARREFLECTION\")), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = r.prototype._dumpPropertiesCode.call(this);\n            return this.texture && (e += this._codeVariableName + \".texture.gammaSpace = \" + this.texture.gammaSpace + `);\\r\n`), e += this._codeVariableName + \".useSphericalHarmonics = \" + this.useSphericalHarmonics + `;\\r\n`, e += this._codeVariableName + \".forceIrradianceInFragment = \" + this.forceIrradianceInFragment + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e, n, i = r.prototype.serialize.call(this);\n            return i.useSphericalHarmonics = this.useSphericalHarmonics, i.forceIrradianceInFragment = this.forceIrradianceInFragment, i.gammaSpace = (n = (e = this.texture) === null || e === void 0 ? void 0 : e.gammaSpace) === null || n === void 0 || n, i;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.useSphericalHarmonics = e.useSphericalHarmonics, this.forceIrradianceInFragment = e.forceIrradianceInFragment, this.texture && (this.texture.gammaSpace = e.gammaSpace);\n          }, Object(c.c)([Bt(\"Spherical Harmonics\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useSphericalHarmonics\", void 0), Object(c.c)([Bt(\"Force irradiance in fragment\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"forceIrradianceInFragment\", void 0), t;\n        }(tc);\n        O.a.RegisteredTypes[\"BABYLON.ReflectionBlock\"] = ac;\n        var la = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.remapF0OnInterfaceChange = !0, n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !1, Ce.Fragment), n.registerInput(\"roughness\", le.Float, !0, Ce.Fragment), n.registerInput(\"indexOfRefraction\", le.Float, !0, Ce.Fragment), n.registerInput(\"normalMapColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"uv\", le.Vector2, !0, Ce.Fragment), n.registerInput(\"tintColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"tintAtDistance\", le.Float, !0, Ce.Fragment), n.registerInput(\"tintThickness\", le.Float, !0, Ce.Fragment), n.registerInput(\"worldTangent\", le.Vector4, !0), n.registerOutput(\"clearcoat\", le.Object, Ce.Fragment, new Xn(\"clearcoat\", n, yn.Output, t, \"ClearCoatBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"clearcoatOut\"), e._excludeVariableName(\"vClearCoatParams\"), e._excludeVariableName(\"vClearCoatTintParams\"), e._excludeVariableName(\"vClearCoatRefractionParams\"), e._excludeVariableName(\"vClearCoatTangentSpaceParams\");\n          }, t.prototype.getClassName = function() {\n            return \"ClearCoatBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"roughness\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"indexOfRefraction\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalMapColor\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintColor\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintAtDistance\", { get: function() {\n            return this._inputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintThickness\", { get: function() {\n            return this._inputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldTangent\", { get: function() {\n            return this._inputs[8];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoat\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.intensity.isConnected) {\n              var n = new Et(\"ClearCoat intensity\", Ce.Fragment, le.Float);\n              n.value = 1, n.output.connectTo(this.intensity);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i), i.setValue(\"CLEARCOAT\", !0), i.setValue(\"CLEARCOAT_TEXTURE\", !1, !0), i.setValue(\"CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\", !0, !0), i.setValue(\"CLEARCOAT_TINT\", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, !0), i.setValue(\"CLEARCOAT_BUMP\", this.normalMapColor.isConnected, !0), i.setValue(\"CLEARCOAT_DEFAULTIOR\", !this.indexOfRefraction.isConnected || this.indexOfRefraction.connectInputBlock.value === mr._DefaultIndexOfRefraction, !0), i.setValue(\"CLEARCOAT_REMAP_F0\", this.remapF0OnInterfaceChange, !0);\n          }, t.prototype.bind = function(e, n, i, o) {\n            var a, s;\n            r.prototype.bind.call(this, e, n, i);\n            var d = (s = (a = this.indexOfRefraction.connectInputBlock) === null || a === void 0 ? void 0 : a.value) !== null && s !== void 0 ? s : mr._DefaultIndexOfRefraction, p = 1 - d, y = 1 + d, P = Math.pow(-p / y, 2), R = 1 / d;\n            e.setFloat4(\"vClearCoatRefractionParams\", P, R, p, y);\n            var B = this.clearcoat.hasEndpoints ? this.clearcoat.endpoints[0].ownerBlock : null, F = B != null && B.perturbedNormal.isConnected ? B.perturbedNormal.connectedPoint.ownerBlock : null;\n            this._scene._mirroredCameraPosition ? e.setFloat2(\"vClearCoatTangentSpaceParams\", F != null && F.invertX ? 1 : -1, F != null && F.invertY ? 1 : -1) : e.setFloat2(\"vClearCoatTangentSpaceParams\", F != null && F.invertX ? -1 : 1, F != null && F.invertY ? -1 : 1);\n          }, t.prototype._generateTBNSpace = function(e, n, i) {\n            var o = \"\", a = \"//\" + this.name, s = this.worldTangent;\n            e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\n            var d = { search: /defined\\(TANGENT\\)/g, replace: s.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\n            return s.isConnected && (o += \"vec3 tbnNormal = normalize(\" + i + `.xyz);\\r\n`, o += \"vec3 tbnTangent = normalize(\" + s.associatedVariableName + `.xyz);\\r\n`, o += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\n`, o += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\n`), e._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", a, { replaceStrings: [d] }), o;\n          }, t.GetCode = function(e, n, i, o, a, s, d) {\n            var p = \"\", y = n != null && n.intensity.isConnected ? n.intensity.associatedVariableName : \"1.\", P = n != null && n.roughness.isConnected ? n.roughness.associatedVariableName : \"0.\", R = n != null && n.normalMapColor.isConnected ? n.normalMapColor.associatedVariableName : \"vec3(0.)\", B = n != null && n.uv.isConnected ? n.uv.associatedVariableName : \"vec2(0.)\", F = n != null && n.tintColor.isConnected ? n.tintColor.associatedVariableName : \"vec3(1.)\", z = n != null && n.tintThickness.isConnected ? n.tintThickness.associatedVariableName : \"1.\", J = n != null && n.tintAtDistance.isConnected ? n.tintAtDistance.associatedVariableName : \"1.\";\n            return n && (e._emitUniformFromString(\"vClearCoatRefractionParams\", \"vec4\"), e._emitUniformFromString(\"vClearCoatTangentSpaceParams\", \"vec2\")), a && n && (p += n._generateTBNSpace(e, o, d), s = n.worldTangent.isConnected), p += `clearcoatOutParams clearcoatOut;\n\n        #ifdef CLEARCOAT\n            vec2 vClearCoatParams = vec2(` + y + \", \" + P + `);\n            vec4 vClearCoatTintParams = vec4(` + F + \", \" + z + `);\n\n            clearcoatBlock(\n                ` + o + `.xyz,\n                geometricNormalW,\n                viewDirectionW,\n                vClearCoatParams,\n                specularEnvironmentR0,\n            #ifdef CLEARCOAT_TEXTURE\n                vec2(0.),\n            #endif\n            #ifdef CLEARCOAT_TINT\n                vClearCoatTintParams,\n                ` + J + `,\n                vClearCoatRefractionParams,\n                #ifdef CLEARCOAT_TINT_TEXTURE\n                    vec4(0.),\n                #endif\n            #endif\n            #ifdef CLEARCOAT_BUMP\n                vec2(0., 1.),\n                vec4(` + R + `, 0.),\n                ` + B + `,\n                #if defined(` + (s ? \"TANGENT\" : \"IGNORE\") + `) && defined(NORMAL)\n                    vTBN,\n                #else\n                    vClearCoatTangentSpaceParams,\n                #endif\n                #ifdef OBJECTSPACE_NORMALMAP\n                    normalMatrix,\n                #endif\n            #endif\n            #if defined(FORCENORMALFORWARD) && defined(NORMAL)\n                faceNormal,\n            #endif\n            #ifdef REFLECTION\n                ` + (i == null ? void 0 : i._vReflectionMicrosurfaceInfosName) + `,\n                ` + (i == null ? void 0 : i._vReflectionInfosName) + `,\n                ` + (i == null ? void 0 : i.reflectionColor) + `,\n                vLightingIntensity,\n                #ifdef ` + (i == null ? void 0 : i._define3DName) + `\n                    ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                #else\n                    ` + (i == null ? void 0 : i._2DSamplerName) + `,\n                #endif\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef ` + (i == null ? void 0 : i._define3DName) + `\n                        ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                        ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                    #else\n                        ` + (i == null ? void 0 : i._2DSamplerName) + `,\n                        ` + (i == null ? void 0 : i._2DSamplerName) + `,\n                    #endif\n                #endif\n            #endif\n            #if defined(ENVIRONMENTBRDF) && !defined(` + (i == null ? void 0 : i._defineSkyboxName) + `)\n                #ifdef RADIANCEOCCLUSION\n                    ambientMonochrome,\n                #endif\n            #endif\n                clearcoatOut\n            );\n        #else\n            clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return this._scene = e.sharedData.scene, e.target === Ce.Fragment && (e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this)), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = \"\";\n            return e += this._codeVariableName + \".remapF0OnInterfaceChange = \" + this.remapF0OnInterfaceChange + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.remapF0OnInterfaceChange = this.remapF0OnInterfaceChange, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            var o;\n            r.prototype._deserialize.call(this, e, n, i), this.remapF0OnInterfaceChange = (o = e.remapF0OnInterfaceChange) === null || o === void 0 || o;\n          }, Object(c.c)([Bt(\"Remap F0 on interface change\", It.Boolean, \"ADVANCED\")], t.prototype, \"remapF0OnInterfaceChange\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ClearCoatBlock\"] = la;\n        var sc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.linkRefractionWithTransparency = !1, n.invertRefractionY = !1, n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !1, Ce.Fragment), n.registerInput(\"tintAtDistance\", le.Float, !0, Ce.Fragment), n.registerOutput(\"refraction\", le.Object, Ce.Fragment, new Xn(\"refraction\", n, yn.Output, t, \"RefractionBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RefractionBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintAtDistance\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this.viewConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"refraction\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasTexture\", { get: function() {\n            return !!this._getTexture();\n          }, enumerable: !1, configurable: !0 }), t.prototype._getTexture = function() {\n            return this.texture ? this.texture : this._scene.environmentTexture;\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.intensity.isConnected) {\n              var n = new Et(\"Refraction intensity\", Ce.Fragment, le.Float);\n              n.value = 1, n.output.connectTo(this.intensity);\n            }\n            if (this.view && !this.view.isConnected) {\n              var i = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.View;\n              });\n              i || (i = new Et(\"view\")).setAsSystemValue(gt.View), i.output.connectTo(this.view);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i);\n            var o = this._getTexture(), a = o && o.getTextureMatrix;\n            i.setValue(\"SS_REFRACTION\", a, !0), a && (i.setValue(this._define3DName, o.isCube, !0), i.setValue(this._defineLODRefractionAlpha, o.lodLevelInAlpha, !0), i.setValue(this._defineLinearSpecularRefraction, o.linearSpecularLOD, !0), i.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !o.invertZ : o.invertZ, !0), i.setValue(\"SS_LINKREFRACTIONTOTRANSPARENCY\", this.linkRefractionWithTransparency, !0), i.setValue(\"SS_GAMMAREFRACTION\", o.gammaSpace, !0), i.setValue(\"SS_RGBDREFRACTION\", o.isRGBD, !0));\n          }, t.prototype.isReady = function() {\n            var e = this._getTexture();\n            return !(e && !e.isReadyOrNotBlocking());\n          }, t.prototype.bind = function(e, n, i, o) {\n            var a, s;\n            r.prototype.bind.call(this, e, n, i);\n            var d = this._getTexture();\n            if (d) {\n              d.isCube ? e.setTexture(this._cubeSamplerName, d) : e.setTexture(this._2DSamplerName, d), e.setMatrix(this._refractionMatrixName, d.getReflectionTextureMatrix());\n              var p = 1;\n              d.isCube || d.depth && (p = d.depth);\n              var y = (s = (a = this.indexOfRefractionConnectionPoint.connectInputBlock) === null || a === void 0 ? void 0 : a.value) !== null && s !== void 0 ? s : 1.5;\n              e.setFloat4(this._vRefractionInfosName, d.level, 1 / y, p, this.invertRefractionY ? -1 : 1), e.setFloat3(this._vRefractionMicrosurfaceInfosName, d.getSize().width, d.lodGenerationScale, d.lodGenerationOffset);\n              var P = d.getSize().width;\n              e.setFloat2(this._vRefractionFilteringInfoName, P, $.a.Log2(P));\n            }\n          }, t.prototype.getCode = function(e) {\n            return e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), this._cubeSamplerName = e._getFreeVariableName(this.name + \"CubeSampler\"), e.samplers.push(this._cubeSamplerName), this._2DSamplerName = e._getFreeVariableName(this.name + \"2DSampler\"), e.samplers.push(this._2DSamplerName), this._define3DName = e._getFreeDefineName(\"SS_REFRACTIONMAP_3D\"), e._samplerDeclaration += \"#ifdef \" + this._define3DName + `\\r\n`, e._samplerDeclaration += \"uniform samplerCube \" + this._cubeSamplerName + `;\\r\n`, e._samplerDeclaration += `#else\\r\n`, e._samplerDeclaration += \"uniform sampler2D \" + this._2DSamplerName + `;\\r\n`, e._samplerDeclaration += `#endif\\r\n`, e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._defineLODRefractionAlpha = e._getFreeDefineName(\"SS_LODINREFRACTIONALPHA\"), this._defineLinearSpecularRefraction = e._getFreeDefineName(\"SS_LINEARSPECULARREFRACTION\"), this._defineOppositeZ = e._getFreeDefineName(\"SS_REFRACTIONMAP_OPPOSITEZ\"), this._refractionMatrixName = e._getFreeVariableName(\"refractionMatrix\"), e._emitUniformFromString(this._refractionMatrixName, \"mat4\"), e._emitFunction(\"sampleRefraction\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleRefraction(s, c) textureCube(s, c)\n            #else\n                #define sampleRefraction(s, c) texture2D(s, c)\n            #endif\\r\n`, \"//\" + this.name), e._emitFunction(\"sampleRefractionLod\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\n            #else\n                #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\n            #endif\\r\n`, \"//\" + this.name), this._vRefractionMicrosurfaceInfosName = e._getFreeVariableName(\"vRefractionMicrosurfaceInfos\"), e._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, \"vec3\"), this._vRefractionInfosName = e._getFreeVariableName(\"vRefractionInfos\"), e._emitUniformFromString(this._vRefractionInfosName, \"vec4\"), this._vRefractionFilteringInfoName = e._getFreeVariableName(\"vRefractionFilteringInfo\"), e._emitUniformFromString(this._vRefractionFilteringInfoName, \"vec2\"), \"\";\n          }, t.prototype._buildBlock = function(e) {\n            return this._scene = e.sharedData.scene, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = r.prototype._dumpPropertiesCode.call(this);\n            return this.texture && (e = this.texture.isCube ? this._codeVariableName + '.texture = new BABYLON.CubeTexture(\"' + this.texture.name + `\");\\r\n` : this._codeVariableName + '.texture = new BABYLON.Texture(\"' + this.texture.name + `\");\\r\n`, e += this._codeVariableName + \".texture.coordinatesMode = \" + this.texture.coordinatesMode + `;\\r\n`), e += this._codeVariableName + \".linkRefractionWithTransparency = \" + this.linkRefractionWithTransparency + `;\\r\n`, e += this._codeVariableName + \".invertRefractionY = \" + this.invertRefractionY + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.texture && (e.texture = this.texture.serialize()), e.linkRefractionWithTransparency = this.linkRefractionWithTransparency, e.invertRefractionY = this.invertRefractionY, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, e.texture.isCube ? this.texture = ei.Parse(e.texture, n, i) : this.texture = Ne.a.Parse(e.texture, n, i)), this.linkRefractionWithTransparency = e.linkRefractionWithTransparency, this.invertRefractionY = e.invertRefractionY;\n          }, Object(c.c)([Bt(\"Link refraction to transparency\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"linkRefractionWithTransparency\", void 0), Object(c.c)([Bt(\"Invert refraction Y\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"invertRefractionY\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RefractionBlock\"] = sc;\n        var ua = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"thickness\", le.Float, !1, Ce.Fragment), n.registerInput(\"tintColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"translucencyIntensity\", le.Float, !0, Ce.Fragment), n.registerInput(\"translucencyDiffusionDist\", le.Color3, !0, Ce.Fragment), n.registerInput(\"refraction\", le.Object, !0, Ce.Fragment, new Xn(\"refraction\", n, yn.Input, sc, \"RefractionBlock\")), n.registerOutput(\"subsurface\", le.Object, Ce.Fragment, new Xn(\"subsurface\", n, yn.Output, t, \"SubSurfaceBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"subSurfaceOut\"), e._excludeVariableName(\"vThicknessParam\"), e._excludeVariableName(\"vTintColor\"), e._excludeVariableName(\"vSubSurfaceIntensity\");\n          }, t.prototype.getClassName = function() {\n            return \"SubSurfaceBlock\";\n          }, Object.defineProperty(t.prototype, \"thickness\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintColor\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"translucencyIntensity\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"translucencyDiffusionDist\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"refraction\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subsurface\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.thickness.isConnected) {\n              var n = new Et(\"SubSurface thickness\", Ce.Fragment, le.Float);\n              n.value = 0, n.output.connectTo(this.thickness);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i);\n            var o = this.translucencyDiffusionDist.isConnected || this.translucencyIntensity.isConnected;\n            i.setValue(\"SUBSURFACE\", o || this.refraction.isConnected, !0), i.setValue(\"SS_TRANSLUCENCY\", o, !0), i.setValue(\"SS_THICKNESSANDMASK_TEXTURE\", !1, !0), i.setValue(\"SS_MASK_FROM_THICKNESS_TEXTURE\", !1, !0), i.setValue(\"SS_MASK_FROM_THICKNESS_TEXTURE_GLTF\", !1, !0);\n          }, t.GetCode = function(e, n, i, o) {\n            var a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe, ve = \"\", Te = n != null && n.thickness.isConnected ? n.thickness.associatedVariableName : \"0.\", Re = n != null && n.tintColor.isConnected ? n.tintColor.associatedVariableName : \"vec3(1.)\", Ae = n != null && n.translucencyIntensity.isConnected ? n == null ? void 0 : n.translucencyIntensity.associatedVariableName : \"1.\", Ee = n != null && n.translucencyDiffusionDist.isConnected ? n == null ? void 0 : n.translucencyDiffusionDist.associatedVariableName : \"vec3(1.)\", Se = n != null && n.refraction.isConnected ? (a = n == null ? void 0 : n.refraction.connectedPoint) === null || a === void 0 ? void 0 : a.ownerBlock : null, De = Se != null && Se.tintAtDistance.isConnected ? Se.tintAtDistance.associatedVariableName : \"1.\", xe = Se != null && Se.intensity.isConnected ? Se.intensity.associatedVariableName : \"1.\", Le = Se != null && Se.view.isConnected ? Se.view.associatedVariableName : \"\";\n            return ve += (s = Se == null ? void 0 : Se.getCode(e)) !== null && s !== void 0 ? s : \"\", ve += `subSurfaceOutParams subSurfaceOut;\n\n        #ifdef SUBSURFACE\n            vec2 vThicknessParam = vec2(0., ` + Te + `);\n            vec4 vTintColor = vec4(` + Re + \", \" + De + `);\n            vec3 vSubSurfaceIntensity = vec3(` + xe + \", \" + Ae + `, 0.);\n\n            subSurfaceBlock(\n                vSubSurfaceIntensity,\n                vThicknessParam,\n                vTintColor,\n                normalW,\n                specularEnvironmentReflectance,\n            #ifdef SS_THICKNESSANDMASK_TEXTURE\n                vec4(0.),\n            #endif\n            #ifdef REFLECTION\n                #ifdef SS_TRANSLUCENCY\n                    ` + (i == null ? void 0 : i._reflectionMatrixName) + `,\n                    #ifdef USESPHERICALFROMREFLECTIONMAP\n                        #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n                            reflectionOut.irradianceVector,\n                        #endif\n                        #if defined(REALTIME_FILTERING)\n                            ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                            ` + (i == null ? void 0 : i._vReflectionFilteringInfoName) + `,\n                        #endif\n                        #endif\n                    #ifdef USEIRRADIANCEMAP\n                        irradianceSampler,\n                    #endif\n                #endif\n            #endif\n            #ifdef SS_REFRACTION\n                ` + o + `.xyz,\n                viewDirectionW,\n                ` + Le + `,\n                surfaceAlbedo,\n                ` + ((d = Se == null ? void 0 : Se._vRefractionInfosName) !== null && d !== void 0 ? d : \"\") + `,\n                ` + ((p = Se == null ? void 0 : Se._refractionMatrixName) !== null && p !== void 0 ? p : \"\") + `,\n                ` + ((y = Se == null ? void 0 : Se._vRefractionMicrosurfaceInfosName) !== null && y !== void 0 ? y : \"\") + `,\n                vLightingIntensity,\n                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n                    alpha,\n                #endif\n                #ifdef ` + ((P = Se == null ? void 0 : Se._defineLODRefractionAlpha) !== null && P !== void 0 ? P : \"IGNORE\") + `\n                    NdotVUnclamped,\n                #endif\n                #ifdef ` + ((R = Se == null ? void 0 : Se._defineLinearSpecularRefraction) !== null && R !== void 0 ? R : \"IGNORE\") + `\n                    roughness,\n                #else\n                    alphaG,\n                #endif\n                #ifdef ` + ((B = Se == null ? void 0 : Se._define3DName) !== null && B !== void 0 ? B : \"IGNORE\") + `\n                    ` + ((F = Se == null ? void 0 : Se._cubeSamplerName) !== null && F !== void 0 ? F : \"\") + `,\n                #else\n                    ` + ((z = Se == null ? void 0 : Se._2DSamplerName) !== null && z !== void 0 ? z : \"\") + `,\n                #endif\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef ` + ((J = Se == null ? void 0 : Se._define3DName) !== null && J !== void 0 ? J : \"IGNORE\") + `\n                        ` + ((ie = Se == null ? void 0 : Se._cubeSamplerName) !== null && ie !== void 0 ? ie : \"\") + `,\n                        ` + ((se = Se == null ? void 0 : Se._cubeSamplerName) !== null && se !== void 0 ? se : \"\") + `,\n                    #else\n                        ` + ((ce = Se == null ? void 0 : Se._2DSamplerName) !== null && ce !== void 0 ? ce : \"\") + `,\n                        ` + ((ue = Se == null ? void 0 : Se._2DSamplerName) !== null && ue !== void 0 ? ue : \"\") + `,\n                    #endif\n                #endif\n                #ifdef ANISOTROPIC\n                    anisotropicOut,\n                #endif\n                #ifdef REALTIME_FILTERING\n                    ` + ((fe = Se == null ? void 0 : Se._vRefractionFilteringInfoName) !== null && fe !== void 0 ? fe : \"\") + `,\n                #endif\n            #endif\n            #ifdef SS_TRANSLUCENCY\n                ` + Ee + `,\n            #endif\n                subSurfaceOut\n            );\n\n            #ifdef SS_REFRACTION\n                surfaceAlbedo = subSurfaceOut.surfaceAlbedo;\n                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n                    alpha = subSurfaceOut.alpha;\n                #endif\n            #endif\n        #else\n            subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return e.target === Ce.Fragment && e.sharedData.blocksWithDefines.push(this), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SubSurfaceBlock\"] = ua;\n        var j_ = { ambientClr: [\"finalAmbient\", \"\"], diffuseDir: [\"finalDiffuse\", \"\"], specularDir: [\"finalSpecularScaled\", \"!defined(UNLIT) && defined(SPECULARTERM)\"], clearcoatDir: [\"finalClearCoatScaled\", \"!defined(UNLIT) && defined(CLEARCOAT)\"], sheenDir: [\"finalSheenScaled\", \"!defined(UNLIT) && defined(SHEEN)\"], diffuseInd: [\"finalIrradiance\", \"!defined(UNLIT) && defined(REFLECTION)\"], specularInd: [\"finalRadianceScaled\", \"!defined(UNLIT) && defined(REFLECTION)\"], clearcoatInd: [\"clearcoatOut.finalClearCoatRadianceScaled\", \"!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)\"], sheenInd: [\"sheenOut.finalSheenRadianceScaled\", \"!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)\"], refraction: [\"subSurfaceOut.finalRefraction\", \"!defined(UNLIT) && defined(SS_REFRACTION)\"], lighting: [\"finalColor.rgb\", \"\"], shadow: [\"shadow\", \"\"], alpha: [\"alpha\", \"\"] }, Xh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment) || this;\n            return n._environmentBRDFTexture = null, n._metallicReflectanceColor = I.a.White(), n._metallicF0Factor = 1, n.directIntensity = 1, n.environmentIntensity = 1, n.specularIntensity = 1, n.lightFalloff = 0, n.useAlphaTest = !1, n.alphaTestCutoff = 0.5, n.useAlphaBlending = !1, n.useRadianceOverAlpha = !0, n.useSpecularOverAlpha = !0, n.enableSpecularAntiAliasing = !1, n.realTimeFiltering = !1, n.realTimeFilteringQuality = h.a.TEXTURE_FILTERING_QUALITY_LOW, n.useEnergyConservation = !0, n.useRadianceOcclusion = !0, n.useHorizonOcclusion = !0, n.unlit = !1, n.forceNormalForward = !1, n.debugMode = 0, n.debugLimit = 0, n.debugFactor = 1, n._isUnique = !0, n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"worldNormal\", le.Vector4, !1, Ce.Fragment), n.registerInput(\"view\", le.Matrix, !1), n.registerInput(\"cameraPosition\", le.Vector3, !1, Ce.Fragment), n.registerInput(\"perturbedNormal\", le.Vector4, !0, Ce.Fragment), n.registerInput(\"baseColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"metallic\", le.Float, !1, Ce.Fragment), n.registerInput(\"roughness\", le.Float, !1, Ce.Fragment), n.registerInput(\"ambientOcc\", le.Float, !0, Ce.Fragment), n.registerInput(\"opacity\", le.Float, !0, Ce.Fragment), n.registerInput(\"indexOfRefraction\", le.Float, !0, Ce.Fragment), n.registerInput(\"ambientColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"reflection\", le.Object, !0, Ce.Fragment, new Xn(\"reflection\", n, yn.Input, ac, \"ReflectionBlock\")), n.registerInput(\"clearcoat\", le.Object, !0, Ce.Fragment, new Xn(\"clearcoat\", n, yn.Input, la, \"ClearCoatBlock\")), n.registerInput(\"sheen\", le.Object, !0, Ce.Fragment, new Xn(\"sheen\", n, yn.Input, rc, \"SheenBlock\")), n.registerInput(\"subsurface\", le.Object, !0, Ce.Fragment, new Xn(\"subsurface\", n, yn.Input, ua, \"SubSurfaceBlock\")), n.registerInput(\"anisotropy\", le.Object, !0, Ce.Fragment, new Xn(\"anisotropy\", n, yn.Input, oc, \"AnisotropyBlock\")), n.registerOutput(\"ambientClr\", le.Color3, Ce.Fragment), n.registerOutput(\"diffuseDir\", le.Color3, Ce.Fragment), n.registerOutput(\"specularDir\", le.Color3, Ce.Fragment), n.registerOutput(\"clearcoatDir\", le.Color3, Ce.Fragment), n.registerOutput(\"sheenDir\", le.Color3, Ce.Fragment), n.registerOutput(\"diffuseInd\", le.Color3, Ce.Fragment), n.registerOutput(\"specularInd\", le.Color3, Ce.Fragment), n.registerOutput(\"clearcoatInd\", le.Color3, Ce.Fragment), n.registerOutput(\"sheenInd\", le.Color3, Ce.Fragment), n.registerOutput(\"refraction\", le.Color3, Ce.Fragment), n.registerOutput(\"lighting\", le.Color3, Ce.Fragment), n.registerOutput(\"shadow\", le.Float, Ce.Fragment), n.registerOutput(\"alpha\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"vLightingIntensity\"), e._excludeVariableName(\"geometricNormalW\"), e._excludeVariableName(\"normalW\"), e._excludeVariableName(\"faceNormal\"), e._excludeVariableName(\"albedoOpacityOut\"), e._excludeVariableName(\"surfaceAlbedo\"), e._excludeVariableName(\"alpha\"), e._excludeVariableName(\"aoOut\"), e._excludeVariableName(\"baseColor\"), e._excludeVariableName(\"reflectivityOut\"), e._excludeVariableName(\"microSurface\"), e._excludeVariableName(\"roughness\"), e._excludeVariableName(\"NdotVUnclamped\"), e._excludeVariableName(\"NdotV\"), e._excludeVariableName(\"alphaG\"), e._excludeVariableName(\"AARoughnessFactors\"), e._excludeVariableName(\"environmentBrdf\"), e._excludeVariableName(\"ambientMonochrome\"), e._excludeVariableName(\"seo\"), e._excludeVariableName(\"eho\"), e._excludeVariableName(\"environmentRadiance\"), e._excludeVariableName(\"irradianceVector\"), e._excludeVariableName(\"environmentIrradiance\"), e._excludeVariableName(\"diffuseBase\"), e._excludeVariableName(\"specularBase\"), e._excludeVariableName(\"preInfo\"), e._excludeVariableName(\"info\"), e._excludeVariableName(\"shadow\"), e._excludeVariableName(\"finalDiffuse\"), e._excludeVariableName(\"finalAmbient\"), e._excludeVariableName(\"ambientOcclusionForDirectDiffuse\"), e._excludeVariableName(\"finalColor\"), e._excludeVariableName(\"vClipSpacePosition\"), e._excludeVariableName(\"vDebugMode\");\n          }, t.prototype.getClassName = function() {\n            return \"PBRMetallicRoughnessBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"perturbedNormal\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"baseColor\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"metallic\", { get: function() {\n            return this._inputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"roughness\", { get: function() {\n            return this._inputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ambientOcc\", { get: function() {\n            return this._inputs[8];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"opacity\", { get: function() {\n            return this._inputs[9];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"indexOfRefraction\", { get: function() {\n            return this._inputs[10];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ambientColor\", { get: function() {\n            return this._inputs[11];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflection\", { get: function() {\n            return this._inputs[12];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoat\", { get: function() {\n            return this._inputs[13];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheen\", { get: function() {\n            return this._inputs[14];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subsurface\", { get: function() {\n            return this._inputs[15];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"anisotropy\", { get: function() {\n            return this._inputs[16];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ambientClr\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseDir\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularDir\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoatDir\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheenDir\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseIndirect\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularIndirect\", { get: function() {\n            return this._outputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoatIndirect\", { get: function() {\n            return this._outputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheenIndirect\", { get: function() {\n            return this._outputs[8];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"refraction\", { get: function() {\n            return this._outputs[9];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"lighting\", { get: function() {\n            return this._outputs[10];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadow\", { get: function() {\n            return this._outputs[11];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"alpha\", { get: function() {\n            return this._outputs[12];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n            if (!this.view.isConnected) {\n              var i = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.View;\n              });\n              i || (i = new Et(\"view\")).setAsSystemValue(gt.View), i.output.connectTo(this.view);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(\"PBR\", !0), i.setValue(\"METALLICWORKFLOW\", !0), i.setValue(\"DEBUGMODE\", this.debugMode, !0), i.setValue(\"NORMALXYSCALE\", !0), i.setValue(\"BUMP\", this.perturbedNormal.isConnected, !0), i.setValue(\"LODBASEDMICROSFURACE\", this._scene.getEngine().getCaps().textureLOD), i.setValue(\"ALBEDO\", !1, !0), i.setValue(\"OPACITY\", this.opacity.isConnected, !0), i.setValue(\"AMBIENT\", !0, !0), i.setValue(\"AMBIENTINGRAYSCALE\", !1, !0), i.setValue(\"REFLECTIVITY\", !1, !0), i.setValue(\"AOSTOREINMETALMAPRED\", !1, !0), i.setValue(\"METALLNESSSTOREINMETALMAPBLUE\", !1, !0), i.setValue(\"ROUGHNESSSTOREINMETALMAPALPHA\", !1, !0), i.setValue(\"ROUGHNESSSTOREINMETALMAPGREEN\", !1, !0), this.lightFalloff === pn.LIGHTFALLOFF_STANDARD ? (i.setValue(\"USEPHYSICALLIGHTFALLOFF\", !1), i.setValue(\"USEGLTFLIGHTFALLOFF\", !1)) : this.lightFalloff === pn.LIGHTFALLOFF_GLTF ? (i.setValue(\"USEPHYSICALLIGHTFALLOFF\", !1), i.setValue(\"USEGLTFLIGHTFALLOFF\", !0)) : (i.setValue(\"USEPHYSICALLIGHTFALLOFF\", !0), i.setValue(\"USEGLTFLIGHTFALLOFF\", !1));\n            var o = this.alphaTestCutoff.toString();\n            if (i.setValue(\"ALPHABLEND\", this.useAlphaBlending, !0), i.setValue(\"ALPHAFROMALBEDO\", !1, !0), i.setValue(\"ALPHATEST\", this.useAlphaTest, !0), i.setValue(\"ALPHATESTVALUE\", o.indexOf(\".\") < 0 ? o + \".\" : o, !0), i.setValue(\"OPACITYRGB\", !1, !0), i.setValue(\"RADIANCEOVERALPHA\", this.useRadianceOverAlpha, !0), i.setValue(\"SPECULAROVERALPHA\", this.useSpecularOverAlpha, !0), i.setValue(\"SPECULARAA\", this._scene.getEngine().getCaps().standardDerivatives && this.enableSpecularAntiAliasing, !0), i.setValue(\"REALTIME_FILTERING\", this.realTimeFiltering, !0), this._scene.getEngine().webGLVersion > 1 ? i.setValue(\"NUM_SAMPLES\", this.realTimeFilteringQuality + \"u\", !0) : i.setValue(\"NUM_SAMPLES\", \"\" + this.realTimeFilteringQuality, !0), i.setValue(\"BRDF_V_HEIGHT_CORRELATED\", !0), i.setValue(\"MS_BRDF_ENERGY_CONSERVATION\", this.useEnergyConservation, !0), i.setValue(\"RADIANCEOCCLUSION\", this.useRadianceOcclusion, !0), i.setValue(\"HORIZONOCCLUSION\", this.useHorizonOcclusion, !0), i.setValue(\"UNLIT\", this.unlit, !0), i.setValue(\"FORCENORMALFORWARD\", this.forceNormalForward, !0), this._environmentBRDFTexture && lt.a.ReflectionTextureEnabled ? (i.setValue(\"ENVIRONMENTBRDF\", !0), i.setValue(\"ENVIRONMENTBRDF_RGBD\", this._environmentBRDFTexture.isRGBD, !0)) : (i.setValue(\"ENVIRONMENTBRDF\", !1), i.setValue(\"ENVIRONMENTBRDF_RGBD\", !1)), i._areLightsDirty) {\n              var a = e.getScene();\n              if (this.light) {\n                var s = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };\n                $e.a.PrepareDefinesForLight(a, e, this.light, this._lightId, i, !0, s), s.needRebuild && i.rebuild();\n              } else\n                $e.a.PrepareDefinesForLights(a, e, i, !0, n.maxSimultaneousLights), i._needNormals = !0, $e.a.PrepareDefinesForMultiview(a, i);\n            }\n          }, t.prototype.updateUniformsAndSamples = function(e, n, i, o) {\n            for (var a = 0; a < n.maxSimultaneousLights && i[\"LIGHT\" + a]; a++) {\n              var s = e.uniforms.indexOf(\"vLightData\" + a) >= 0;\n              $e.a.PrepareUniformsAndSamplersForLight(a, e.uniforms, e.samplers, i[\"PROJECTEDLIGHTTEXTURE\" + a], o, s);\n            }\n          }, t.prototype.bind = function(e, n, i) {\n            var o, a;\n            if (i) {\n              var s = i.getScene();\n              this.light ? $e.a.BindLight(this.light, this._lightId, s, e, !0) : $e.a.BindLights(s, i, e, !0, n.maxSimultaneousLights), e.setTexture(this._environmentBrdfSamplerName, this._environmentBRDFTexture), e.setFloat2(\"vDebugMode\", this.debugLimit, this.debugFactor);\n              var d = this._scene.ambientColor;\n              d && e.setColor3(\"ambientFromScene\", d);\n              var p = s.useRightHandedSystem === (s._mirroredCameraPosition != null);\n              e.setFloat(this._invertNormalName, p ? -1 : 1), e.setFloat4(\"vLightingIntensity\", this.directIntensity, 1, this.environmentIntensity * this._scene.environmentIntensity, this.specularIntensity);\n              var y = (a = (o = this.indexOfRefraction.connectInputBlock) === null || o === void 0 ? void 0 : o.value) !== null && a !== void 0 ? a : 1.5, P = Math.pow((y - 1) / (y + 1), 2);\n              this._metallicReflectanceColor.scaleToRef(P * this._metallicF0Factor, I.c.Color3[0]);\n              var R = this._metallicF0Factor;\n              e.setColor4(this._vMetallicReflectanceFactorsName, I.c.Color3[0], R);\n            }\n          }, t.prototype._injectVertexCode = function(e) {\n            var n, i, o = this.worldPosition, a = \"//\" + this.name;\n            this.light ? (this._lightId = (e.counters.lightCounter !== void 0 ? e.counters.lightCounter : -1) + 1, e.counters.lightCounter = this._lightId, e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", a, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString())) : (e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", a, { repeatKey: \"maxSimultaneousLights\" }), this._lightId = 0, e.sharedData.dynamicUniformBlocks.push(this));\n            var s = \"v_\" + o.associatedVariableName;\n            e._emitVaryingFromString(s, \"vec4\") && (e.compilationString += s + \" = \" + o.associatedVariableName + `;\\r\n`);\n            var d = this.reflection.isConnected ? (n = this.reflection.connectedPoint) === null || n === void 0 ? void 0 : n.ownerBlock : null;\n            d && (d.viewConnectionPoint = this.view), e.compilationString += (i = d == null ? void 0 : d.handleVertexSide(e)) !== null && i !== void 0 ? i : \"\", e._emitUniformFromString(\"vDebugMode\", \"vec2\", \"defined(IGNORE) || DEBUGMODE > 0\"), e._emitUniformFromString(\"ambientFromScene\", \"vec3\"), e._emitVaryingFromString(\"vClipSpacePosition\", \"vec4\", \"defined(IGNORE) || DEBUGMODE > 0\") && (e._injectAtEnd += `#if DEBUGMODE > 0\\r\n`, e._injectAtEnd += `vClipSpacePosition = gl_Position;\\r\n`, e._injectAtEnd += `#endif\\r\n`), this.light ? e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", a, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, { search: /worldPos/g, replace: o.associatedVariableName }] }) : (e.compilationString += \"vec4 worldPos = \" + o.associatedVariableName + `;\\r\n`, this.view.isConnected && (e.compilationString += \"mat4 view = \" + this.view.associatedVariableName + `;\\r\n`), e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", a, { repeatKey: \"maxSimultaneousLights\" }));\n          }, t.prototype._getAlbedoOpacityCode = function() {\n            var e = `albedoOpacityOutParams albedoOpacityOut;\\r\n`;\n            return e += `albedoOpacityBlock(\n                vec4(` + (this.baseColor.isConnected ? this.baseColor.associatedVariableName : \"vec3(1.)\") + `, 1.),\n            #ifdef ALBEDO\n                vec4(1.),\n                vec2(1., 1.),\n            #endif\n            #ifdef OPACITY\n                vec4(` + (this.opacity.isConnected ? this.opacity.associatedVariableName : \"1.\") + `),\n                vec2(1., 1.),\n            #endif\n                albedoOpacityOut\n            );\n\n            vec3 surfaceAlbedo = albedoOpacityOut.surfaceAlbedo;\n            float alpha = albedoOpacityOut.alpha;\\r\n`;\n          }, t.prototype._getAmbientOcclusionCode = function() {\n            var e = `ambientOcclusionOutParams aoOut;\\r\n`;\n            return e += `ambientOcclusionBlock(\n            #ifdef AMBIENT\n                vec3(` + (this.ambientOcc.isConnected ? this.ambientOcc.associatedVariableName : \"1.\") + `),\n                vec4(0., 1.0, 1.0, 0.),\n            #endif\n                aoOut\n            );\\r\n`;\n          }, t.prototype._getReflectivityCode = function(e) {\n            var n = `reflectivityOutParams reflectivityOut;\\r\n`;\n            return this._vMetallicReflectanceFactorsName = e._getFreeVariableName(\"vMetallicReflectanceFactors\"), e._emitUniformFromString(this._vMetallicReflectanceFactorsName, \"vec4\"), n += `vec3 baseColor = surfaceAlbedo;\n\n            reflectivityBlock(\n                vec4(` + this.metallic.associatedVariableName + \", \" + this.roughness.associatedVariableName + `, 0., 0.),\n            #ifdef METALLICWORKFLOW\n                surfaceAlbedo,\n                ` + this._vMetallicReflectanceFactorsName + `,\n            #endif\n            #ifdef REFLECTIVITY\n                vec3(0., 0., 1.),\n                vec4(1.),\n            #endif\n            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY)  && defined(AOSTOREINMETALMAPRED)\n                aoOut.ambientOcclusionColor,\n            #endif\n            #ifdef MICROSURFACEMAP\n                microSurfaceTexel, <== not handled!\n            #endif\n                reflectivityOut\n            );\n\n            float microSurface = reflectivityOut.microSurface;\n            float roughness = reflectivityOut.roughness;\n\n            #ifdef METALLICWORKFLOW\n                surfaceAlbedo = reflectivityOut.surfaceAlbedo;\n            #endif\n            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n                aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;\n            #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            var n, i, o, a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe, ve, Te, Re, Ae, Ee, Se, De, xe, Le, Me, we, Ye, et, nt, ct, Ke, rt, it, qe, ut;\n            r.prototype._buildBlock.call(this, e), this._scene = e.sharedData.scene, this._environmentBRDFTexture || (this._environmentBRDFTexture = Ho.GetEnvironmentBRDFTexture(this._scene));\n            var Ve = this.reflection.isConnected ? (n = this.reflection.connectedPoint) === null || n === void 0 ? void 0 : n.ownerBlock : null;\n            if (Ve && (Ve.worldPositionConnectionPoint = this.worldPosition, Ve.cameraPositionConnectionPoint = this.cameraPosition, Ve.worldNormalConnectionPoint = this.worldNormal), e.target !== Ce.Fragment)\n              return this._injectVertexCode(e), this;\n            e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);\n            var Ze = \"//\" + this.name, vt = \"v_\" + this.worldPosition.associatedVariableName, jt = this.perturbedNormal;\n            this._environmentBrdfSamplerName = e._getFreeVariableName(\"environmentBrdfSampler\"), e._emit2DSampler(this._environmentBrdfSamplerName), e.sharedData.hints.needAlphaBlending = e.sharedData.hints.needAlphaBlending || this.useAlphaBlending, e.sharedData.hints.needAlphaTesting = e.sharedData.hints.needAlphaTesting || this.useAlphaTest, e._emitExtension(\"lod\", \"#extension GL_EXT_shader_texture_lod : enable\", \"defined(LODBASEDMICROSFURACE)\"), e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\"), this.light ? e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", Ze, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString()) : e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", Ze, { repeatKey: \"maxSimultaneousLights\" }), e._emitFunctionFromInclude(\"helperFunctions\", Ze), e._emitFunctionFromInclude(\"importanceSampling\", Ze), e._emitFunctionFromInclude(\"pbrHelperFunctions\", Ze), e._emitFunctionFromInclude(\"imageProcessingFunctions\", Ze), e._emitFunctionFromInclude(\"shadowsFragmentFunctions\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }] }), e._emitFunctionFromInclude(\"pbrDirectLightingSetupFunctions\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }] }), e._emitFunctionFromInclude(\"pbrDirectLightingFalloffFunctions\", Ze), e._emitFunctionFromInclude(\"pbrBRDFFunctions\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (i = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && i !== void 0 ? i : \"REFLECTIONMAP_SKYBOX\" }] }), e._emitFunctionFromInclude(\"hdrFilteringFunctions\", Ze), e._emitFunctionFromInclude(\"pbrDirectLightingFunctions\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }] }), e._emitFunctionFromInclude(\"pbrIBLFunctions\", Ze), e._emitFunctionFromInclude(\"pbrBlockAlbedoOpacity\", Ze), e._emitFunctionFromInclude(\"pbrBlockReflectivity\", Ze), e._emitFunctionFromInclude(\"pbrBlockAmbientOcclusion\", Ze), e._emitFunctionFromInclude(\"pbrBlockAlphaFresnel\", Ze), e._emitFunctionFromInclude(\"pbrBlockAnisotropic\", Ze), e._emitUniformFromString(\"vLightingIntensity\", \"vec4\"), this._vNormalWName = e._getFreeVariableName(\"vNormalW\"), e.compilationString += \"vec4 \" + this._vNormalWName + \" = normalize(\" + this.worldNormal.associatedVariableName + `);\\r\n`, e._registerTempVariable(\"viewDirectionW\") && (e.compilationString += \"vec3 viewDirectionW = normalize(\" + this.cameraPosition.associatedVariableName + \" - \" + vt + `.xyz);\\r\n`), e.compilationString += \"vec3 geometricNormalW = \" + this._vNormalWName + `.xyz;\\r\n`, e.compilationString += \"vec3 normalW = \" + (jt.isConnected ? \"normalize(\" + jt.associatedVariableName + \".xyz)\" : \"geometricNormalW\") + `;\\r\n`, this._invertNormalName = e._getFreeVariableName(\"invertNormal\"), e._emitUniformFromString(this._invertNormalName, \"float\"), e.compilationString += e._emitCodeFromInclude(\"pbrBlockNormalFinal\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }, { search: /vEyePosition.w/g, replace: this._invertNormalName }] }), e.compilationString += this._getAlbedoOpacityCode(), e.compilationString += e._emitCodeFromInclude(\"depthPrePass\", Ze), e.compilationString += this._getAmbientOcclusionCode(), e.compilationString += e._emitCodeFromInclude(\"pbrBlockLightmapInit\", Ze), e.compilationString += `#ifdef UNLIT\n                vec3 diffuseBase = vec3(1., 1., 1.);\n            #else\\r\n`, e.compilationString += this._getReflectivityCode(e), e.compilationString += e._emitCodeFromInclude(\"pbrBlockGeometryInfo\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (o = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && o !== void 0 ? o : \"REFLECTIONMAP_SKYBOX\" }, { search: /REFLECTIONMAP_3D/g, replace: (a = Ve == null ? void 0 : Ve._define3DName) !== null && a !== void 0 ? a : \"REFLECTIONMAP_3D\" }] });\n            var Dt = this.anisotropy.isConnected ? (s = this.anisotropy.connectedPoint) === null || s === void 0 ? void 0 : s.ownerBlock : null;\n            Dt && (Dt.worldPositionConnectionPoint = this.worldPosition, Dt.worldNormalConnectionPoint = this.worldNormal, e.compilationString += Dt.getCode(e, !this.perturbedNormal.isConnected)), Ve && Ve.hasTexture && (e.compilationString += Ve.getCode(e, Dt ? \"anisotropicOut.anisotropicNormal\" : \"normalW\")), e._emitFunctionFromInclude(\"pbrBlockReflection\", Ze, { replaceStrings: [{ search: /computeReflectionCoords/g, replace: \"computeReflectionCoordsPBR\" }, { search: /REFLECTIONMAP_3D/g, replace: (d = Ve == null ? void 0 : Ve._define3DName) !== null && d !== void 0 ? d : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (p = Ve == null ? void 0 : Ve._defineOppositeZ) !== null && p !== void 0 ? p : \"REFLECTIONMAP_OPPOSITEZ\" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: (y = Ve == null ? void 0 : Ve._defineProjectionName) !== null && y !== void 0 ? y : \"REFLECTIONMAP_PROJECTION\" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: (P = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && P !== void 0 ? P : \"REFLECTIONMAP_SKYBOX\" }, { search: /LODINREFLECTIONALPHA/g, replace: (R = Ve == null ? void 0 : Ve._defineLODReflectionAlpha) !== null && R !== void 0 ? R : \"LODINREFLECTIONALPHA\" }, { search: /LINEARSPECULARREFLECTION/g, replace: (B = Ve == null ? void 0 : Ve._defineLinearSpecularReflection) !== null && B !== void 0 ? B : \"LINEARSPECULARREFLECTION\" }, { search: /vReflectionFilteringInfo/g, replace: (F = Ve == null ? void 0 : Ve._vReflectionFilteringInfoName) !== null && F !== void 0 ? F : \"vReflectionFilteringInfo\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockReflectance0\", Ze, { replaceStrings: [{ search: /metallicReflectanceFactors/g, replace: this._vMetallicReflectanceFactorsName }] });\n            var Yt = this.sheen.isConnected ? (z = this.sheen.connectedPoint) === null || z === void 0 ? void 0 : z.ownerBlock : null;\n            Yt && (e.compilationString += Yt.getCode(Ve)), e._emitFunctionFromInclude(\"pbrBlockSheen\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_3D/g, replace: (J = Ve == null ? void 0 : Ve._define3DName) !== null && J !== void 0 ? J : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: (ie = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && ie !== void 0 ? ie : \"REFLECTIONMAP_SKYBOX\" }, { search: /LODINREFLECTIONALPHA/g, replace: (se = Ve == null ? void 0 : Ve._defineLODReflectionAlpha) !== null && se !== void 0 ? se : \"LODINREFLECTIONALPHA\" }, { search: /LINEARSPECULARREFLECTION/g, replace: (ce = Ve == null ? void 0 : Ve._defineLinearSpecularReflection) !== null && ce !== void 0 ? ce : \"LINEARSPECULARREFLECTION\" }] });\n            var mt = this.clearcoat.isConnected ? (ue = this.clearcoat.connectedPoint) === null || ue === void 0 ? void 0 : ue.ownerBlock : null, qt = !this.perturbedNormal.isConnected && !this.anisotropy.isConnected, Ht = this.perturbedNormal.isConnected && ((fe = this.perturbedNormal.connectedPoint) === null || fe === void 0 ? void 0 : fe.ownerBlock).worldTangent.isConnected, kt = this.anisotropy.isConnected && ((ve = this.anisotropy.connectedPoint) === null || ve === void 0 ? void 0 : ve.ownerBlock).worldTangent.isConnected, Wt = Ht || !this.perturbedNormal.isConnected && kt;\n            e.compilationString += la.GetCode(e, mt, Ve, vt, qt, Wt, this.worldNormal.associatedVariableName), qt && (Wt = (Te = mt == null ? void 0 : mt.worldTangent.isConnected) !== null && Te !== void 0 && Te), e._emitFunctionFromInclude(\"pbrBlockClearcoat\", Ze, { replaceStrings: [{ search: /computeReflectionCoords/g, replace: \"computeReflectionCoordsPBR\" }, { search: /REFLECTIONMAP_3D/g, replace: (Re = Ve == null ? void 0 : Ve._define3DName) !== null && Re !== void 0 ? Re : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (Ae = Ve == null ? void 0 : Ve._defineOppositeZ) !== null && Ae !== void 0 ? Ae : \"REFLECTIONMAP_OPPOSITEZ\" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: (Ee = Ve == null ? void 0 : Ve._defineProjectionName) !== null && Ee !== void 0 ? Ee : \"REFLECTIONMAP_PROJECTION\" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: (Se = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && Se !== void 0 ? Se : \"REFLECTIONMAP_SKYBOX\" }, { search: /LODINREFLECTIONALPHA/g, replace: (De = Ve == null ? void 0 : Ve._defineLODReflectionAlpha) !== null && De !== void 0 ? De : \"LODINREFLECTIONALPHA\" }, { search: /LINEARSPECULARREFLECTION/g, replace: (xe = Ve == null ? void 0 : Ve._defineLinearSpecularReflection) !== null && xe !== void 0 ? xe : \"LINEARSPECULARREFLECTION\" }, { search: /defined\\(TANGENT\\)/g, replace: Wt ? \"defined(TANGENT)\" : \"defined(IGNORE)\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockReflectance\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (Le = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && Le !== void 0 ? Le : \"REFLECTIONMAP_SKYBOX\" }, { search: /REFLECTIONMAP_3D/g, replace: (Me = Ve == null ? void 0 : Ve._define3DName) !== null && Me !== void 0 ? Me : \"REFLECTIONMAP_3D\" }] });\n            var bt = this.subsurface.isConnected ? (we = this.subsurface.connectedPoint) === null || we === void 0 ? void 0 : we.ownerBlock : null, Rt = this.subsurface.isConnected ? (et = ((Ye = this.subsurface.connectedPoint) === null || Ye === void 0 ? void 0 : Ye.ownerBlock).refraction.connectedPoint) === null || et === void 0 ? void 0 : et.ownerBlock : null;\n            Rt && (Rt.viewConnectionPoint = this.view, Rt.indexOfRefractionConnectionPoint = this.indexOfRefraction), e.compilationString += ua.GetCode(e, bt, Ve, vt), e._emitFunctionFromInclude(\"pbrBlockSubSurface\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_3D/g, replace: (nt = Ve == null ? void 0 : Ve._define3DName) !== null && nt !== void 0 ? nt : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (ct = Ve == null ? void 0 : Ve._defineOppositeZ) !== null && ct !== void 0 ? ct : \"REFLECTIONMAP_OPPOSITEZ\" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: (Ke = Ve == null ? void 0 : Ve._defineProjectionName) !== null && Ke !== void 0 ? Ke : \"REFLECTIONMAP_PROJECTION\" }, { search: /SS_REFRACTIONMAP_3D/g, replace: (rt = Rt == null ? void 0 : Rt._define3DName) !== null && rt !== void 0 ? rt : \"SS_REFRACTIONMAP_3D\" }, { search: /SS_LODINREFRACTIONALPHA/g, replace: (it = Rt == null ? void 0 : Rt._defineLODRefractionAlpha) !== null && it !== void 0 ? it : \"SS_LODINREFRACTIONALPHA\" }, { search: /SS_LINEARSPECULARREFRACTION/g, replace: (qe = Rt == null ? void 0 : Rt._defineLinearSpecularRefraction) !== null && qe !== void 0 ? qe : \"SS_LINEARSPECULARREFRACTION\" }, { search: /SS_REFRACTIONMAP_OPPOSITEZ/g, replace: (ut = Rt == null ? void 0 : Rt._defineOppositeZ) !== null && ut !== void 0 ? ut : \"SS_REFRACTIONMAP_OPPOSITEZ\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockDirectLighting\", Ze), this.light ? e.compilationString += e._emitCodeFromInclude(\"lightFragment\", Ze, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }) : e.compilationString += e._emitCodeFromInclude(\"lightFragment\", Ze, { repeatKey: \"maxSimultaneousLights\" }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockFinalLitComponents\", Ze), e.compilationString += `#endif\\r\n`;\n            var Zt = this.ambientColor.isConnected ? this.ambientColor.associatedVariableName : \"vec3(0., 0., 0.)\", Mn = pn.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();\n            Mn.indexOf(\".\") === -1 && (Mn += \".\"), e.compilationString += e._emitCodeFromInclude(\"pbrBlockFinalUnlitComponents\", Ze, { replaceStrings: [{ search: /vec3 finalEmissive[\\s\\S]*?finalEmissive\\*=vLightingIntensity\\.y;/g, replace: \"\" }, { search: /vAmbientColor/g, replace: Zt + \" * ambientFromScene\" }, { search: /vAmbientInfos\\.w/g, replace: Mn }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockFinalColorComposition\", Ze, { replaceStrings: [{ search: /finalEmissive/g, replace: \"vec3(0.)\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockImageProcessing\", Ze, { replaceStrings: [{ search: /visibility/g, replace: \"1.\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrDebug\", Ze, { replaceStrings: [{ search: /vNormalW/g, replace: this._vNormalWName }, { search: /vPositionW/g, replace: vt }, { search: /albedoTexture\\.rgb;/g, replace: `vec3(1.);\\r\ngl_FragColor.rgb = toGammaSpace(gl_FragColor.rgb);\\r\n` }] });\n            for (var Bn = 0, Kn = this._outputs; Bn < Kn.length; Bn++) {\n              var In = Kn[Bn];\n              if (In.hasEndpoints) {\n                var Kt = j_[In.name];\n                if (Kt) {\n                  var oi = Kt[0], Ti = Kt[1];\n                  Ti && (e.compilationString += \"#if \" + Ti + `\\r\n`), e.compilationString += this._declareOutput(In, e) + \" = \" + oi + `;\\r\n`, Ti && (e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(In, e) + ` = vec3(0.);\\r\n`, e.compilationString += `#endif\\r\n`);\n                } else\n                  console.error(\"There's no remapping for the \" + In.name + \" end point! No code generated\");\n              }\n            }\n            return this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = \"\";\n            return e += this._codeVariableName + \".lightFalloff = \" + this.lightFalloff + `;\\r\n`, e += this._codeVariableName + \".useAlphaTest = \" + this.useAlphaTest + `;\\r\n`, e += this._codeVariableName + \".alphaTestCutoff = \" + this.alphaTestCutoff + `;\\r\n`, e += this._codeVariableName + \".useAlphaBlending = \" + this.useAlphaBlending + `;\\r\n`, e += this._codeVariableName + \".useRadianceOverAlpha = \" + this.useRadianceOverAlpha + `;\\r\n`, e += this._codeVariableName + \".useSpecularOverAlpha = \" + this.useSpecularOverAlpha + `;\\r\n`, e += this._codeVariableName + \".enableSpecularAntiAliasing = \" + this.enableSpecularAntiAliasing + `;\\r\n`, e += this._codeVariableName + \".realTimeFiltering = \" + this.realTimeFiltering + `;\\r\n`, e += this._codeVariableName + \".realTimeFilteringQuality = \" + this.realTimeFilteringQuality + `;\\r\n`, e += this._codeVariableName + \".useEnergyConservation = \" + this.useEnergyConservation + `;\\r\n`, e += this._codeVariableName + \".useRadianceOcclusion = \" + this.useRadianceOcclusion + `;\\r\n`, e += this._codeVariableName + \".useHorizonOcclusion = \" + this.useHorizonOcclusion + `;\\r\n`, e += this._codeVariableName + \".unlit = \" + this.unlit + `;\\r\n`, e += this._codeVariableName + \".forceNormalForward = \" + this.forceNormalForward + `;\\r\n`, e += this._codeVariableName + \".debugMode = \" + this.debugMode + `;\\r\n`, e += this._codeVariableName + \".debugLimit = \" + this.debugLimit + `;\\r\n`, e += this._codeVariableName + \".debugFactor = \" + this.debugFactor + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.light && (e.lightId = this.light.id), e.lightFalloff = this.lightFalloff, e.useAlphaTest = this.useAlphaTest, e.alphaTestCutoff = this.alphaTestCutoff, e.useAlphaBlending = this.useAlphaBlending, e.useRadianceOverAlpha = this.useRadianceOverAlpha, e.useSpecularOverAlpha = this.useSpecularOverAlpha, e.enableSpecularAntiAliasing = this.enableSpecularAntiAliasing, e.realTimeFiltering = this.realTimeFiltering, e.realTimeFilteringQuality = this.realTimeFilteringQuality, e.useEnergyConservation = this.useEnergyConservation, e.useRadianceOcclusion = this.useRadianceOcclusion, e.useHorizonOcclusion = this.useHorizonOcclusion, e.unlit = this.unlit, e.forceNormalForward = this.forceNormalForward, e.debugMode = this.debugMode, e.debugLimit = this.debugLimit, e.debugFactor = this.debugFactor, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            var o, a;\n            r.prototype._deserialize.call(this, e, n, i), e.lightId && (this.light = n.getLightByID(e.lightId)), this.lightFalloff = (o = e.lightFalloff) !== null && o !== void 0 ? o : 0, this.useAlphaTest = e.useAlphaTest, this.alphaTestCutoff = e.alphaTestCutoff, this.useAlphaBlending = e.useAlphaBlending, this.useRadianceOverAlpha = e.useRadianceOverAlpha, this.useSpecularOverAlpha = e.useSpecularOverAlpha, this.enableSpecularAntiAliasing = e.enableSpecularAntiAliasing, this.realTimeFiltering = !!e.realTimeFiltering, this.realTimeFilteringQuality = (a = e.realTimeFilteringQuality) !== null && a !== void 0 ? a : h.a.TEXTURE_FILTERING_QUALITY_LOW, this.useEnergyConservation = e.useEnergyConservation, this.useRadianceOcclusion = e.useRadianceOcclusion, this.useHorizonOcclusion = e.useHorizonOcclusion, this.unlit = e.unlit, this.forceNormalForward = !!e.forceNormalForward, this.debugMode = e.debugMode, this.debugLimit = e.debugLimit, this.debugFactor = e.debugFactor;\n          }, Object(c.c)([Bt(\"Direct lights\", It.Float, \"INTENSITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"directIntensity\", void 0), Object(c.c)([Bt(\"Environment lights\", It.Float, \"INTENSITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"environmentIntensity\", void 0), Object(c.c)([Bt(\"Specular highlights\", It.Float, \"INTENSITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"specularIntensity\", void 0), Object(c.c)([Bt(\"Light falloff\", It.List, \"LIGHTING & COLORS\", { notifiers: { update: !0 }, options: [{ label: \"Physical\", value: pn.LIGHTFALLOFF_PHYSICAL }, { label: \"GLTF\", value: pn.LIGHTFALLOFF_GLTF }, { label: \"Standard\", value: pn.LIGHTFALLOFF_STANDARD }] })], t.prototype, \"lightFalloff\", void 0), Object(c.c)([Bt(\"Alpha Testing\", It.Boolean, \"OPACITY\")], t.prototype, \"useAlphaTest\", void 0), Object(c.c)([Bt(\"Alpha CutOff\", It.Float, \"OPACITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"alphaTestCutoff\", void 0), Object(c.c)([Bt(\"Alpha blending\", It.Boolean, \"OPACITY\")], t.prototype, \"useAlphaBlending\", void 0), Object(c.c)([Bt(\"Radiance over alpha\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"useRadianceOverAlpha\", void 0), Object(c.c)([Bt(\"Specular over alpha\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"useSpecularOverAlpha\", void 0), Object(c.c)([Bt(\"Specular anti-aliasing\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"enableSpecularAntiAliasing\", void 0), Object(c.c)([Bt(\"Realtime filtering\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"realTimeFiltering\", void 0), Object(c.c)([Bt(\"Realtime filtering quality\", It.List, \"RENDERING\", { notifiers: { update: !0 }, options: [{ label: \"Low\", value: h.a.TEXTURE_FILTERING_QUALITY_LOW }, { label: \"Medium\", value: h.a.TEXTURE_FILTERING_QUALITY_MEDIUM }, { label: \"High\", value: h.a.TEXTURE_FILTERING_QUALITY_HIGH }] })], t.prototype, \"realTimeFilteringQuality\", void 0), Object(c.c)([Bt(\"Energy Conservation\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useEnergyConservation\", void 0), Object(c.c)([Bt(\"Radiance occlusion\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useRadianceOcclusion\", void 0), Object(c.c)([Bt(\"Horizon occlusion\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useHorizonOcclusion\", void 0), Object(c.c)([Bt(\"Unlit\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"unlit\", void 0), Object(c.c)([Bt(\"Force normal forward\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"forceNormalForward\", void 0), Object(c.c)([Bt(\"Debug mode\", It.List, \"DEBUG\", { notifiers: { update: !0 }, options: [{ label: \"None\", value: 0 }, { label: \"Normalized position\", value: 1 }, { label: \"Normals\", value: 2 }, { label: \"Tangents\", value: 3 }, { label: \"Bitangents\", value: 4 }, { label: \"Bump Normals\", value: 5 }, { label: \"ClearCoat Normals\", value: 8 }, { label: \"ClearCoat Tangents\", value: 9 }, { label: \"ClearCoat Bitangents\", value: 10 }, { label: \"Anisotropic Normals\", value: 11 }, { label: \"Anisotropic Tangents\", value: 12 }, { label: \"Anisotropic Bitangents\", value: 13 }, { label: \"Env Refraction\", value: 40 }, { label: \"Env Reflection\", value: 41 }, { label: \"Env Clear Coat\", value: 42 }, { label: \"Direct Diffuse\", value: 50 }, { label: \"Direct Specular\", value: 51 }, { label: \"Direct Clear Coat\", value: 52 }, { label: \"Direct Sheen\", value: 53 }, { label: \"Env Irradiance\", value: 54 }, { label: \"Surface Albedo\", value: 60 }, { label: \"Reflectance 0\", value: 61 }, { label: \"Metallic\", value: 62 }, { label: \"Metallic F0\", value: 71 }, { label: \"Roughness\", value: 63 }, { label: \"AlphaG\", value: 64 }, { label: \"NdotV\", value: 65 }, { label: \"ClearCoat Color\", value: 66 }, { label: \"ClearCoat Roughness\", value: 67 }, { label: \"ClearCoat NdotV\", value: 68 }, { label: \"Transmittance\", value: 69 }, { label: \"Refraction Transmittance\", value: 70 }, { label: \"SEO\", value: 80 }, { label: \"EHO\", value: 81 }, { label: \"Energy Factor\", value: 82 }, { label: \"Specular Reflectance\", value: 83 }, { label: \"Clear Coat Reflectance\", value: 84 }, { label: \"Sheen Reflectance\", value: 85 }, { label: \"Luminance Over Alpha\", value: 86 }, { label: \"Alpha\", value: 87 }] })], t.prototype, \"debugMode\", void 0), Object(c.c)([Bt(\"Split position\", It.Float, \"DEBUG\", { min: -1, max: 1, notifiers: { update: !0 } })], t.prototype, \"debugLimit\", void 0), Object(c.c)([Bt(\"Output factor\", It.Float, \"DEBUG\", { min: 0, max: 5, notifiers: { update: !0 } })], t.prototype, \"debugFactor\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PBRMetallicRoughnessBlock\"] = Xh;\n        var Yh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ModBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = mod(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ModBlock\"] = Yh;\n        var H_ = function() {\n          function r() {\n          }\n          return r.prototype.optimize = function(t, e) {\n          }, r;\n        }(), W_ = f(120), X_ = function() {\n          function r() {\n            this.mm = /* @__PURE__ */ new Map();\n          }\n          return r.prototype.get = function(t, e) {\n            var n = this.mm.get(t);\n            if (n !== void 0)\n              return n.get(e);\n          }, r.prototype.set = function(t, e, n) {\n            var i = this.mm.get(t);\n            i === void 0 && this.mm.set(t, i = /* @__PURE__ */ new Map()), i.set(e, n);\n          }, r;\n        }(), Y_ = function() {\n          function r(t, e, n) {\n            var i = this;\n            this._baseMaterial = t, this._scene = e, this._options = n, this._subMeshToEffect = /* @__PURE__ */ new Map(), this._subMeshToDepthEffect = new X_(), this._meshes = /* @__PURE__ */ new Map();\n            var o = t.getClassName() === \"NodeMaterial\" ? \"u_\" : \"\";\n            if (o) {\n              this._matriceNames = { world: o + \"World\", view: o + \"View\", projection: o + \"Projection\", viewProjection: o + \"ViewProjection\", worldView: o + \"WorldxView\", worldViewProjection: o + \"WorldxViewxProjection\" };\n              for (var a = t.getInputBlocks(), s = 0; s < a.length; ++s)\n                switch (a[s]._systemValue) {\n                  case gt.World:\n                    this._matriceNames.world = a[s].associatedVariableName;\n                    break;\n                  case gt.View:\n                    this._matriceNames.view = a[s].associatedVariableName;\n                    break;\n                  case gt.Projection:\n                    this._matriceNames.projection = a[s].associatedVariableName;\n                    break;\n                  case gt.ViewProjection:\n                    this._matriceNames.viewProjection = a[s].associatedVariableName;\n                    break;\n                  case gt.WorldView:\n                    this._matriceNames.worldView = a[s].associatedVariableName;\n                    break;\n                  case gt.WorldViewProjection:\n                    this._matriceNames.worldViewProjection = a[s].associatedVariableName;\n                }\n            } else\n              this._matriceNames = { world: o + \"world\", view: o + \"view\", projection: o + \"projection\", viewProjection: o + \"viewProjection\", worldView: o + \"worldView\", worldViewProjection: o + \"worldViewProjection\" };\n            this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add(function(d) {\n              var p, y = (p = d.subMesh) === null || p === void 0 ? void 0 : p.getMesh();\n              y && !i._meshes.has(y) && i._meshes.set(y, y.onDisposeObservable.add(function(P) {\n                for (var R = i._subMeshToEffect.keys(), B = R.next(); B.done !== !0; B = R.next()) {\n                  var F = B.value;\n                  (F == null ? void 0 : F.getMesh()) === P && (i._subMeshToEffect.delete(F), i._subMeshToDepthEffect.mm.delete(F));\n                }\n              })), i._subMeshToEffect.set(d.subMesh, d.effect), i._subMeshToDepthEffect.mm.delete(d.subMesh);\n            });\n          }\n          return Object.defineProperty(r.prototype, \"standalone\", { get: function() {\n            var t, e;\n            return (e = (t = this._options) === null || t === void 0 ? void 0 : t.standalone) !== null && e !== void 0 && e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"baseMaterial\", { get: function() {\n            return this._baseMaterial;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getEffect = function(t, e) {\n            var n, i, o, a, s, d;\n            return (d = (o = (i = (n = this._subMeshToDepthEffect.mm.get(t)) === null || n === void 0 ? void 0 : n.get(e)) === null || i === void 0 ? void 0 : i.depthEffect) !== null && o !== void 0 ? o : (s = (a = this._subMeshToDepthEffect.mm.get(null)) === null || a === void 0 ? void 0 : a.get(e)) === null || s === void 0 ? void 0 : s.depthEffect) !== null && d !== void 0 ? d : null;\n          }, r.prototype.isReadyForSubMesh = function(t, e, n, i) {\n            var o, a;\n            return this.standalone && this._baseMaterial.isReadyForSubMesh(t.getMesh(), t, i), (a = (o = this._makeEffect(t, e, n)) === null || o === void 0 ? void 0 : o.isReady()) !== null && a !== void 0 && a;\n          }, r.prototype.dispose = function() {\n            this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver), this._onEffectCreatedObserver = null;\n            for (var t = this._meshes.entries(), e = t.next(); e.done !== !0; e = t.next()) {\n              var n = e.value, i = n[0], o = n[1];\n              i.onDisposeObservable.remove(o);\n            }\n          }, r.prototype._makeEffect = function(t, e, n) {\n            var i, o = (i = this._subMeshToEffect.get(t)) !== null && i !== void 0 ? i : this._subMeshToEffect.get(null);\n            if (!o)\n              return null;\n            var a = this._subMeshToDepthEffect.get(t, n);\n            a || (a = { depthEffect: null, depthDefines: \"\", token: W_.a.RandomId() }, this._subMeshToDepthEffect.set(t, n, a));\n            var s = e.join(`\n`);\n            if (a.depthEffect && s === a.depthDefines)\n              return a.depthEffect;\n            a.depthDefines = s;\n            var d = o.rawVertexSourceCode, p = o.rawFragmentSourceCode, y = this._options && this._options.remappedVariables ? \"#include<shadowMapVertexNormalBias>(\" + this._options.remappedVariables.join(\",\") + \")\" : ze.a.IncludesShadersStore.shadowMapVertexNormalBias, P = this._options && this._options.remappedVariables ? \"#include<shadowMapVertexMetric>(\" + this._options.remappedVariables.join(\",\") + \")\" : ze.a.IncludesShadersStore.shadowMapVertexMetric, R = this._options && this._options.remappedVariables ? \"#include<shadowMapFragmentSoftTransparentShadow>(\" + this._options.remappedVariables.join(\",\") + \")\" : ze.a.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow, B = ze.a.IncludesShadersStore.shadowMapFragment;\n            d = (d = (d = (d = d.replace(/void\\s+?main/g, ze.a.IncludesShadersStore.shadowMapVertexDeclaration + `\\r\nvoid main`)).replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g, y)).indexOf(\"#define SHADOWDEPTH_METRIC\") !== -1 ? d.replace(/#define SHADOWDEPTH_METRIC/g, P) : d.replace(/}\\s*$/g, P + `\\r\n}`)).replace(/#define SHADER_NAME.*?\\n|out vec4 glFragColor;\\n/g, \"\");\n            var F = p.indexOf(\"#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW\") >= 0 || p.indexOf(\"#define CUSTOM_FRAGMENT_BEFORE_FOG\") >= 0, z = p.indexOf(\"#define SHADOWDEPTH_FRAGMENT\") !== -1, J = \"\";\n            F ? p = p.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g, R) : J = R + `\\r\n`, p = p.replace(/void\\s+?main/g, ze.a.IncludesShadersStore.shadowMapFragmentDeclaration + `\\r\nvoid main`), z ? p = p.replace(/#define SHADOWDEPTH_FRAGMENT/g, B) : J += B + `\\r\n`, J && (p = p.replace(/}\\s*$/g, J + \"}\")), p = p.replace(/#define SHADER_NAME.*?\\n|out vec4 glFragColor;\\n/g, \"\");\n            var ie = o.getUniformNames().slice();\n            return ie.push(\"biasAndScaleSM\", \"depthValuesSM\", \"lightDataSM\", \"softTransparentShadowSM\"), a.depthEffect = this._scene.getEngine().createEffect({ vertexSource: d, fragmentSource: p, vertexToken: a.token, fragmentToken: a.token }, { attributes: o.getAttributesNames(), uniformsNames: ie, uniformBuffersNames: o.getUniformBuffersNames(), samplers: o.getSamplers(), defines: s + `\n` + o.defines.replace(\"#define SHADOWS\", \"\").replace(/#define SHADOW\\d/g, \"\"), indexParameters: o.getIndexParameters() }, this._scene.getEngine()), a.depthEffect;\n          }, r;\n        }(), Kh = f(101);\n        function cc(r, t, e, n, i) {\n          var o = new r.DecoderBuffer();\n          o.Init(t, t.byteLength);\n          var a, s, d = new r.Decoder();\n          try {\n            var p = d.GetEncodedGeometryType(o);\n            switch (p) {\n              case r.TRIANGULAR_MESH:\n                a = new r.Mesh(), s = d.DecodeBufferToMesh(o, a);\n                break;\n              case r.POINT_CLOUD:\n                a = new r.PointCloud(), s = d.DecodeBufferToPointCloud(o, a);\n                break;\n              default:\n                throw new Error(\"Invalid geometry type \" + p);\n            }\n            if (!s.ok() || !a.ptr)\n              throw new Error(s.error_msg());\n            if (p === r.TRIANGULAR_MESH) {\n              var y = 3 * a.num_faces(), P = 4 * y, R = r._malloc(P);\n              try {\n                d.GetTrianglesUInt32Array(a, P, R);\n                var B = new Uint32Array(y);\n                B.set(new Uint32Array(r.HEAPF32.buffer, R, y)), n(B);\n              } finally {\n                r._free(R);\n              }\n            }\n            var F = function(se, ce) {\n              var ue = ce.num_components(), fe = a.num_points(), ve = fe * ue, Te = ve * Float32Array.BYTES_PER_ELEMENT, Re = r._malloc(Te);\n              try {\n                d.GetAttributeDataArrayForAllPoints(a, ce, r.DT_FLOAT32, Te, Re);\n                var Ae = new Float32Array(r.HEAPF32.buffer, Re, ve);\n                if (se === \"color\" && ue === 3) {\n                  for (var Ee = new Float32Array(4 * fe), Se = 0, De = 0; Se < Ee.length; Se += 4, De += ue)\n                    Ee[Se + 0] = Ae[De + 0], Ee[Se + 1] = Ae[De + 1], Ee[Se + 2] = Ae[De + 2], Ee[Se + 3] = 1;\n                  i(se, Ee);\n                } else\n                  (Ee = new Float32Array(ve)).set(new Float32Array(r.HEAPF32.buffer, Re, ve)), i(se, Ee);\n              } finally {\n                r._free(Re);\n              }\n            };\n            if (e)\n              for (var z in e) {\n                var J = e[z];\n                F(z, d.GetAttributeByUniqueId(a, J));\n              }\n            else {\n              var ie = { position: \"POSITION\", normal: \"NORMAL\", color: \"COLOR\", uv: \"TEX_COORD\" };\n              for (var z in ie)\n                (J = d.GetAttributeId(a, r[ie[z]])) !== -1 && F(z, d.GetAttribute(a, J));\n            }\n          } finally {\n            a && r.destroy(a), r.destroy(d), r.destroy(o);\n          }\n        }\n        function K_() {\n          var r;\n          onmessage = function(t) {\n            var e = t.data;\n            switch (e.id) {\n              case \"init\":\n                var n = e.decoder;\n                n.url && (importScripts(n.url), r = DracoDecoderModule({ wasmBinary: n.wasmBinary })), postMessage(\"done\");\n                break;\n              case \"decodeMesh\":\n                if (!r)\n                  throw new Error(\"Draco decoder module is not available\");\n                r.then(function(i) {\n                  cc(i, e.dataView, e.attributes, function(o) {\n                    postMessage({ id: \"indices\", value: o }, [o.buffer]);\n                  }, function(o, a) {\n                    postMessage({ id: o, value: a }, [a.buffer]);\n                  }), postMessage(\"done\");\n                });\n            }\n          };\n        }\n        function Qh(r) {\n          return typeof document != \"object\" || typeof r != \"string\" ? r : Xe.b.GetAbsoluteUrl(r);\n        }\n        var Q_ = function() {\n          function r(t) {\n            t === void 0 && (t = r.DefaultNumWorkers);\n            var e = r.Configuration.decoder, n = e.wasmUrl && e.wasmBinaryUrl && typeof WebAssembly == \"object\" ? { url: e.wasmUrl, wasmBinaryPromise: Xe.b.LoadFileAsync(Qh(e.wasmBinaryUrl)) } : { url: e.fallbackUrl, wasmBinaryPromise: Promise.resolve(void 0) };\n            t && typeof Worker == \"function\" ? this._workerPoolPromise = n.wasmBinaryPromise.then(function(i) {\n              for (var o = cc + \"(\" + K_ + \")()\", a = URL.createObjectURL(new Blob([o], { type: \"application/javascript\" })), s = new Array(t), d = 0; d < s.length; d++)\n                s[d] = new Promise(function(p, y) {\n                  var P = new Worker(a), R = function(F) {\n                    P.removeEventListener(\"error\", R), P.removeEventListener(\"message\", B), y(F);\n                  }, B = function(F) {\n                    F.data === \"done\" && (P.removeEventListener(\"error\", R), P.removeEventListener(\"message\", B), p(P));\n                  };\n                  P.addEventListener(\"error\", R), P.addEventListener(\"message\", B), P.postMessage({ id: \"init\", decoder: { url: Qh(n.url), wasmBinary: i } });\n                });\n              return Promise.all(s).then(function(p) {\n                return new xs(p);\n              });\n            }) : this._decoderModulePromise = n.wasmBinaryPromise.then(function(i) {\n              if (!n.url)\n                throw new Error(\"Draco decoder module is not available\");\n              return Xe.b.LoadScriptAsync(n.url).then(function() {\n                return o = i, new Promise(function(a) {\n                  DracoDecoderModule({ wasmBinary: o }).then(function(s) {\n                    a({ module: s });\n                  });\n                });\n                var o;\n              });\n            });\n          }\n          return Object.defineProperty(r, \"DecoderAvailable\", { get: function() {\n            var t = r.Configuration.decoder;\n            return !!(t.wasmUrl && t.wasmBinaryUrl && typeof WebAssembly == \"object\" || t.fallbackUrl);\n          }, enumerable: !1, configurable: !0 }), r.GetDefaultNumWorkers = function() {\n            return typeof navigator == \"object\" && navigator.hardwareConcurrency ? Math.min(Math.floor(0.5 * navigator.hardwareConcurrency), 4) : 1;\n          }, Object.defineProperty(r, \"Default\", { get: function() {\n            return r._Default || (r._Default = new r()), r._Default;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._workerPoolPromise && this._workerPoolPromise.then(function(t) {\n              t.dispose();\n            }), delete this._workerPoolPromise, delete this._decoderModulePromise;\n          }, r.prototype.whenReadyAsync = function() {\n            return this._workerPoolPromise ? this._workerPoolPromise.then(function() {\n            }) : this._decoderModulePromise ? this._decoderModulePromise.then(function() {\n            }) : Promise.resolve();\n          }, r.prototype.decodeMeshAsync = function(t, e) {\n            var n = t instanceof ArrayBuffer ? new Uint8Array(t) : t;\n            if (this._workerPoolPromise)\n              return this._workerPoolPromise.then(function(i) {\n                return new Promise(function(o, a) {\n                  i.push(function(s, d) {\n                    var p = new ht.a(), y = function(B) {\n                      s.removeEventListener(\"error\", y), s.removeEventListener(\"message\", P), a(B), d();\n                    }, P = function(B) {\n                      B.data === \"done\" ? (s.removeEventListener(\"error\", y), s.removeEventListener(\"message\", P), o(p), d()) : B.data.id === \"indices\" ? p.indices = B.data.value : p.set(B.data.value, B.data.id);\n                    };\n                    s.addEventListener(\"error\", y), s.addEventListener(\"message\", P);\n                    var R = new Uint8Array(n.byteLength);\n                    R.set(new Uint8Array(n.buffer, n.byteOffset, n.byteLength)), s.postMessage({ id: \"decodeMesh\", dataView: R, attributes: e }, [R.buffer]);\n                  });\n                });\n              });\n            if (this._decoderModulePromise)\n              return this._decoderModulePromise.then(function(i) {\n                var o = new ht.a();\n                return cc(i.module, n, e, function(a) {\n                  o.indices = a;\n                }, function(a, s) {\n                  o.set(s, a);\n                }), o;\n              });\n            throw new Error(\"Draco decoder module is not available\");\n          }, r.Configuration = { decoder: { wasmUrl: \"https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js\", wasmBinaryUrl: \"https://preview.babylonjs.com/draco_decoder_gltf.wasm\", fallbackUrl: \"https://preview.babylonjs.com/draco_decoder_gltf.js\" } }, r.DefaultNumWorkers = r.GetDefaultNumWorkers(), r._Default = null, r;\n        }(), uo = f(61), qh = 0, q_ = function() {\n          function r(t, e, n, i) {\n            this.pos = t, this.normal = e, this.uv = n, this.vertColor = i;\n          }\n          return r.prototype.clone = function() {\n            var t, e;\n            return new r(this.pos.clone(), this.normal.clone(), (t = this.uv) === null || t === void 0 ? void 0 : t.clone(), (e = this.vertColor) === null || e === void 0 ? void 0 : e.clone());\n          }, r.prototype.flip = function() {\n            this.normal = this.normal.scale(-1);\n          }, r.prototype.interpolate = function(t, e) {\n            return new r(u.e.Lerp(this.pos, t.pos, e), u.e.Lerp(this.normal, t.normal, e), this.uv && t.uv ? u.d.Lerp(this.uv, t.uv, e) : void 0, this.vertColor && t.vertColor ? I.b.Lerp(this.vertColor, t.vertColor, e) : void 0);\n          }, r;\n        }(), Z_ = function() {\n          function r(t, e) {\n            this.normal = t, this.w = e;\n          }\n          return r.FromPoints = function(t, e, n) {\n            var i = n.subtract(t), o = e.subtract(t);\n            if (i.lengthSquared() === 0 || o.lengthSquared() === 0)\n              return null;\n            var a = u.e.Normalize(u.e.Cross(i, o));\n            return new r(a, u.e.Dot(a, t));\n          }, r.prototype.clone = function() {\n            return new r(this.normal.clone(), this.w);\n          }, r.prototype.flip = function() {\n            this.normal.scaleInPlace(-1), this.w = -this.w;\n          }, r.prototype.splitPolygon = function(t, e, n, i, o) {\n            var a, s, d = 0, p = [];\n            for (a = 0; a < t.vertices.length; a++) {\n              var y = (s = u.e.Dot(this.normal, t.vertices[a].pos) - this.w) < -r.EPSILON ? 2 : s > r.EPSILON ? 1 : 0;\n              d |= y, p.push(y);\n            }\n            switch (d) {\n              case 0:\n                (u.e.Dot(this.normal, t.plane.normal) > 0 ? e : n).push(t);\n                break;\n              case 1:\n                i.push(t);\n                break;\n              case 2:\n                o.push(t);\n                break;\n              case 3:\n                var P, R = [], B = [];\n                for (a = 0; a < t.vertices.length; a++) {\n                  var F = (a + 1) % t.vertices.length, z = p[a], J = p[F], ie = t.vertices[a], se = t.vertices[F];\n                  if (z !== 2 && R.push(ie), z !== 1 && B.push(z !== 2 ? ie.clone() : ie), (z | J) == 3) {\n                    s = (this.w - u.e.Dot(this.normal, ie.pos)) / u.e.Dot(this.normal, se.pos.subtract(ie.pos));\n                    var ce = ie.interpolate(se, s);\n                    R.push(ce), B.push(ce.clone());\n                  }\n                }\n                R.length >= 3 && (P = new lc(R, t.shared)).plane && i.push(P), B.length >= 3 && (P = new lc(B, t.shared)).plane && o.push(P);\n            }\n          }, r.EPSILON = 1e-5, r;\n        }(), lc = function() {\n          function r(t, e) {\n            this.vertices = t, this.shared = e, this.plane = Z_.FromPoints(t[0].pos, t[1].pos, t[2].pos);\n          }\n          return r.prototype.clone = function() {\n            return new r(this.vertices.map(function(t) {\n              return t.clone();\n            }), this.shared);\n          }, r.prototype.flip = function() {\n            this.vertices.reverse().map(function(t) {\n              t.flip();\n            }), this.plane.flip();\n          }, r;\n        }(), Yn = function() {\n          function r(t) {\n            this.plane = null, this.front = null, this.back = null, this.polygons = new Array(), t && this.build(t);\n          }\n          return r.prototype.clone = function() {\n            var t = new r();\n            return t.plane = this.plane && this.plane.clone(), t.front = this.front && this.front.clone(), t.back = this.back && this.back.clone(), t.polygons = this.polygons.map(function(e) {\n              return e.clone();\n            }), t;\n          }, r.prototype.invert = function() {\n            for (var t = 0; t < this.polygons.length; t++)\n              this.polygons[t].flip();\n            this.plane && this.plane.flip(), this.front && this.front.invert(), this.back && this.back.invert();\n            var e = this.front;\n            this.front = this.back, this.back = e;\n          }, r.prototype.clipPolygons = function(t) {\n            if (!this.plane)\n              return t.slice();\n            for (var e = new Array(), n = new Array(), i = 0; i < t.length; i++)\n              this.plane.splitPolygon(t[i], e, n, e, n);\n            return this.front && (e = this.front.clipPolygons(e)), n = this.back ? this.back.clipPolygons(n) : [], e.concat(n);\n          }, r.prototype.clipTo = function(t) {\n            this.polygons = t.clipPolygons(this.polygons), this.front && this.front.clipTo(t), this.back && this.back.clipTo(t);\n          }, r.prototype.allPolygons = function() {\n            var t = this.polygons.slice();\n            return this.front && (t = t.concat(this.front.allPolygons())), this.back && (t = t.concat(this.back.allPolygons())), t;\n          }, r.prototype.build = function(t) {\n            if (t.length) {\n              this.plane || (this.plane = t[0].plane.clone());\n              for (var e = new Array(), n = new Array(), i = 0; i < t.length; i++)\n                this.plane.splitPolygon(t[i], this.polygons, this.polygons, e, n);\n              e.length && (this.front || (this.front = new r()), this.front.build(e)), n.length && (this.back || (this.back = new r()), this.back.build(n));\n            }\n          }, r;\n        }(), J_ = function() {\n          function r() {\n            this.polygons = new Array();\n          }\n          return r.FromMesh = function(t) {\n            var e, n, i, o, a, s, d, p, y, P = void 0, R = void 0, B = new Array(), F = null;\n            if (!(t instanceof Ie.a))\n              throw \"BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh\";\n            t.computeWorldMatrix(!0), s = t.getWorldMatrix(), d = t.position.clone(), p = t.rotation.clone(), t.rotationQuaternion && (F = t.rotationQuaternion.clone()), y = t.scaling.clone();\n            for (var z = t.getIndices(), J = t.getVerticesData(Oe.b.PositionKind), ie = t.getVerticesData(Oe.b.NormalKind), se = t.getVerticesData(Oe.b.UVKind), ce = t.getVerticesData(Oe.b.ColorKind), ue = t.subMeshes, fe = 0, ve = ue.length; fe < ve; fe++)\n              for (var Te = ue[fe].indexStart, Re = ue[fe].indexCount + ue[fe].indexStart; Te < Re; Te += 3) {\n                a = [];\n                for (var Ae = 0; Ae < 3; Ae++) {\n                  var Ee = new u.e(ie[3 * z[Te + Ae]], ie[3 * z[Te + Ae] + 1], ie[3 * z[Te + Ae] + 2]);\n                  se && (P = new u.d(se[2 * z[Te + Ae]], se[2 * z[Te + Ae] + 1])), ce && (R = new I.b(ce[4 * z[Te + Ae]], ce[4 * z[Te + Ae] + 1], ce[4 * z[Te + Ae] + 2], ce[4 * z[Te + Ae] + 3]));\n                  var Se = new u.e(J[3 * z[Te + Ae]], J[3 * z[Te + Ae] + 1], J[3 * z[Te + Ae] + 2]);\n                  i = u.e.TransformCoordinates(Se, s), n = u.e.TransformNormal(Ee, s), e = new q_(i, n, P, R), a.push(e);\n                }\n                (o = new lc(a, { subMeshId: fe, meshId: qh, materialIndex: ue[fe].materialIndex })).plane && B.push(o);\n              }\n            var De = r.FromPolygons(B);\n            return De.matrix = s, De.position = d, De.rotation = p, De.scaling = y, De.rotationQuaternion = F, qh++, De;\n          }, r.FromPolygons = function(t) {\n            var e = new r();\n            return e.polygons = t, e;\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return t.polygons = this.polygons.map(function(e) {\n              return e.clone();\n            }), t.copyTransformAttributes(this), t;\n          }, r.prototype.union = function(t) {\n            var e = new Yn(this.clone().polygons), n = new Yn(t.clone().polygons);\n            return e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), r.FromPolygons(e.allPolygons()).copyTransformAttributes(this);\n          }, r.prototype.unionInPlace = function(t) {\n            var e = new Yn(this.polygons), n = new Yn(t.polygons);\n            e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), this.polygons = e.allPolygons();\n          }, r.prototype.subtract = function(t) {\n            var e = new Yn(this.clone().polygons), n = new Yn(t.clone().polygons);\n            return e.invert(), e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), e.invert(), r.FromPolygons(e.allPolygons()).copyTransformAttributes(this);\n          }, r.prototype.subtractInPlace = function(t) {\n            var e = new Yn(this.polygons), n = new Yn(t.polygons);\n            e.invert(), e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), e.invert(), this.polygons = e.allPolygons();\n          }, r.prototype.intersect = function(t) {\n            var e = new Yn(this.clone().polygons), n = new Yn(t.clone().polygons);\n            return e.invert(), n.clipTo(e), n.invert(), e.clipTo(n), n.clipTo(e), e.build(n.allPolygons()), e.invert(), r.FromPolygons(e.allPolygons()).copyTransformAttributes(this);\n          }, r.prototype.intersectInPlace = function(t) {\n            var e = new Yn(this.polygons), n = new Yn(t.polygons);\n            e.invert(), n.clipTo(e), n.invert(), e.clipTo(n), n.clipTo(e), e.build(n.allPolygons()), e.invert(), this.polygons = e.allPolygons();\n          }, r.prototype.inverse = function() {\n            var t = this.clone();\n            return t.inverseInPlace(), t;\n          }, r.prototype.inverseInPlace = function() {\n            this.polygons.map(function(t) {\n              t.flip();\n            });\n          }, r.prototype.copyTransformAttributes = function(t) {\n            return this.matrix = t.matrix, this.position = t.position, this.rotation = t.rotation, this.scaling = t.scaling, this.rotationQuaternion = t.rotationQuaternion, this;\n          }, r.prototype.buildMeshGeometry = function(t, e, n) {\n            var i = this.matrix.clone();\n            i.invert();\n            var o, a, s, d = new Ie.a(t, e), p = [], y = [], P = [], R = null, B = null, F = u.e.Zero(), z = u.e.Zero(), J = u.d.Zero(), ie = new I.b(0, 0, 0, 0), se = this.polygons, ce = [0, 0, 0], ue = {}, fe = 0, ve = {};\n            n && se.sort(function(ct, Ke) {\n              return ct.shared.meshId === Ke.shared.meshId ? ct.shared.subMeshId - Ke.shared.subMeshId : ct.shared.meshId - Ke.shared.meshId;\n            });\n            for (var Te = 0, Re = se.length; Te < Re; Te++) {\n              ve[(o = se[Te]).shared.meshId] || (ve[o.shared.meshId] = {}), ve[o.shared.meshId][o.shared.subMeshId] || (ve[o.shared.meshId][o.shared.subMeshId] = { indexStart: 1 / 0, indexEnd: -1 / 0, materialIndex: o.shared.materialIndex }), s = ve[o.shared.meshId][o.shared.subMeshId];\n              for (var Ae = 2, Ee = o.vertices.length; Ae < Ee; Ae++) {\n                ce[0] = 0, ce[1] = Ae - 1, ce[2] = Ae;\n                for (var Se = 0; Se < 3; Se++) {\n                  F.copyFrom(o.vertices[ce[Se]].pos), z.copyFrom(o.vertices[ce[Se]].normal), o.vertices[ce[Se]].uv && (R || (R = []), J.copyFrom(o.vertices[ce[Se]].uv)), o.vertices[ce[Se]].vertColor && (B || (B = []), ie.copyFrom(o.vertices[ce[Se]].vertColor));\n                  var De = u.e.TransformCoordinates(F, i), xe = u.e.TransformNormal(z, i);\n                  a = ue[De.x + \",\" + De.y + \",\" + De.z];\n                  var Le = !1;\n                  R && R[2 * a] !== J.x && R[2 * a + 1] !== J.y && (Le = !0);\n                  var Me = !1;\n                  B && B[4 * a] !== ie.r && B[4 * a + 1] !== ie.g && B[4 * a + 2] !== ie.b && B[4 * a + 3] !== ie.a && (Me = !0), (a === void 0 || P[3 * a] !== xe.x || P[3 * a + 1] !== xe.y || P[3 * a + 2] !== xe.z || Le || Me) && (p.push(De.x, De.y, De.z), R && R.push(J.x, J.y), P.push(z.x, z.y, z.z), B && B.push(ie.r, ie.g, ie.b, ie.a), a = ue[De.x + \",\" + De.y + \",\" + De.z] = p.length / 3 - 1), y.push(a), s.indexStart = Math.min(fe, s.indexStart), s.indexEnd = Math.max(fe, s.indexEnd), fe++;\n                }\n              }\n            }\n            if (d.setVerticesData(Oe.b.PositionKind, p), d.setVerticesData(Oe.b.NormalKind, P), R && d.setVerticesData(Oe.b.UVKind, R), B && d.setVerticesData(Oe.b.ColorKind, B), d.setIndices(y, null), n) {\n              var we, Ye = 0;\n              for (var et in d.subMeshes = new Array(), ve) {\n                for (var nt in we = -1, ve[et])\n                  s = ve[et][nt], uo.a.CreateFromIndices(s.materialIndex + Ye, s.indexStart, s.indexEnd - s.indexStart + 1, d), we = Math.max(s.materialIndex, we);\n                Ye += ++we;\n              }\n            }\n            return d;\n          }, r.prototype.toMesh = function(t, e, n, i) {\n            e === void 0 && (e = null);\n            var o = this.buildMeshGeometry(t, n, i);\n            return o.material = e, o.position.copyFrom(this.position), o.rotation.copyFrom(this.rotation), this.rotationQuaternion && (o.rotationQuaternion = this.rotationQuaternion.clone()), o.scaling.copyFrom(this.scaling), o.computeWorldMatrix(!0), o;\n          }, r;\n        }(), $_ = function(r) {\n          function t(e, n, i, o, a, s) {\n            o === void 0 && (o = 1), a === void 0 && (a = 60), s === void 0 && (s = !0);\n            var d = r.call(this, e, i) || this;\n            d._sectionPolygonPointsCount = 4, d._running = !1, d._autoStart = s, d._generator = n, d._diameter = o, d._length = a, d._sectionVectors = [], d._sectionNormalVectors = [];\n            for (var p = 0; p < d._sectionPolygonPointsCount; p++)\n              d._sectionVectors[p] = u.e.Zero(), d._sectionNormalVectors[p] = u.e.Zero();\n            return d._createMesh(), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TrailMesh\";\n          }, t.prototype._createMesh = function() {\n            var e = new ht.a(), n = [], i = [], o = [], a = u.e.Zero();\n            a = this._generator instanceof Mt.a && this._generator._boundingInfo ? this._generator._boundingInfo.boundingBox.centerWorld : this._generator.position;\n            for (var s = 2 * Math.PI / this._sectionPolygonPointsCount, d = 0; d < this._sectionPolygonPointsCount; d++)\n              n.push(a.x + Math.cos(d * s) * this._diameter, a.y + Math.sin(d * s) * this._diameter, a.z);\n            for (d = 1; d <= this._length; d++) {\n              for (var p = 0; p < this._sectionPolygonPointsCount; p++)\n                n.push(a.x + Math.cos(p * s) * this._diameter, a.y + Math.sin(p * s) * this._diameter, a.z);\n              var y = n.length / 3 - 2 * this._sectionPolygonPointsCount;\n              for (p = 0; p < this._sectionPolygonPointsCount - 1; p++)\n                o.push(y + p, y + p + this._sectionPolygonPointsCount, y + p + this._sectionPolygonPointsCount + 1), o.push(y + p, y + p + this._sectionPolygonPointsCount + 1, y + p + 1);\n              o.push(y + this._sectionPolygonPointsCount - 1, y + this._sectionPolygonPointsCount - 1 + this._sectionPolygonPointsCount, y + this._sectionPolygonPointsCount), o.push(y + this._sectionPolygonPointsCount - 1, y + this._sectionPolygonPointsCount, y);\n            }\n            ht.a.ComputeNormals(n, o, i), e.positions = n, e.normals = i, e.indices = o, e.applyToMesh(this, !0), this._autoStart && this.start();\n          }, t.prototype.start = function() {\n            var e = this;\n            this._running || (this._running = !0, this._beforeRenderObserver = this.getScene().onBeforeRenderObservable.add(function() {\n              e.update();\n            }));\n          }, t.prototype.stop = function() {\n            this._beforeRenderObserver && this._running && (this._running = !1, this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver));\n          }, t.prototype.update = function() {\n            var e = this.getVerticesData(Oe.b.PositionKind), n = this.getVerticesData(Oe.b.NormalKind), i = this._generator.getWorldMatrix();\n            if (e && n) {\n              for (var o = 3 * this._sectionPolygonPointsCount; o < e.length; o++)\n                e[o - 3 * this._sectionPolygonPointsCount] = e[o] - n[o] / this._length * this._diameter;\n              for (o = 3 * this._sectionPolygonPointsCount; o < n.length; o++)\n                n[o - 3 * this._sectionPolygonPointsCount] = n[o];\n              var a = e.length - 3 * this._sectionPolygonPointsCount, s = 2 * Math.PI / this._sectionPolygonPointsCount;\n              for (o = 0; o < this._sectionPolygonPointsCount; o++)\n                this._sectionVectors[o].copyFromFloats(Math.cos(o * s) * this._diameter, Math.sin(o * s) * this._diameter, 0), this._sectionNormalVectors[o].copyFromFloats(Math.cos(o * s), Math.sin(o * s), 0), u.e.TransformCoordinatesToRef(this._sectionVectors[o], i, this._sectionVectors[o]), u.e.TransformNormalToRef(this._sectionNormalVectors[o], i, this._sectionNormalVectors[o]);\n              for (o = 0; o < this._sectionPolygonPointsCount; o++)\n                e[a + 3 * o] = this._sectionVectors[o].x, e[a + 3 * o + 1] = this._sectionVectors[o].y, e[a + 3 * o + 2] = this._sectionVectors[o].z, n[a + 3 * o] = this._sectionNormalVectors[o].x, n[a + 3 * o + 1] = this._sectionNormalVectors[o].y, n[a + 3 * o + 2] = this._sectionNormalVectors[o].z;\n              this.updateVerticesData(Oe.b.PositionKind, e, !0, !1), this.updateVerticesData(Oe.b.NormalKind, n, !0, !1);\n            }\n          }, t.prototype.clone = function(e, n) {\n            return e === void 0 && (e = \"\"), new t(e, n === void 0 ? this._generator : n, this.getScene(), this._diameter, this._length, this._autoStart);\n          }, t.prototype.serialize = function(e) {\n            r.prototype.serialize.call(this, e);\n          }, t.Parse = function(e, n) {\n            return new t(e.name, e._generator, n, e._diameter, e._length, e._autoStart);\n          }, t;\n        }(Ie.a), em = f(151), ho = f(98), fo = f(82);\n        ht.a.CreateDisc = function(r) {\n          var t = new Array(), e = new Array(), n = new Array(), i = new Array(), o = r.radius || 0.5, a = r.tessellation || 64, s = r.arc && (r.arc <= 0 || r.arc > 1) ? 1 : r.arc || 1, d = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE;\n          t.push(0, 0, 0), i.push(0.5, 0.5);\n          for (var p = 2 * Math.PI * s, y = s === 1 ? p / a : p / (a - 1), P = 0, R = 0; R < a; R++) {\n            var B = Math.cos(P), F = Math.sin(P), z = (B + 1) / 2, J = (1 - F) / 2;\n            t.push(o * B, o * F, 0), i.push(z, J), P += y;\n          }\n          s === 1 && (t.push(t[3], t[4], t[5]), i.push(i[2], i[3]));\n          for (var ie = t.length / 3, se = 1; se < ie - 1; se++)\n            e.push(se + 1, 0, se);\n          ht.a.ComputeNormals(t, e, n), ht.a._ComputeSides(d, t, e, n, i, r.frontUVs, r.backUVs);\n          var ce = new ht.a();\n          return ce.indices = e, ce.positions = t, ce.normals = n, ce.uvs = i, ce;\n        }, Ie.a.CreateDisc = function(r, t, e, n, i, o) {\n          n === void 0 && (n = null);\n          var a = { radius: t, tessellation: e, sideOrientation: o, updatable: i };\n          return ha.CreateDisc(r, a, n);\n        };\n        var ha = function() {\n          function r() {\n          }\n          return r.CreateDisc = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateDisc(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        ht.a.CreateTiledBox = function(r) {\n          for (var t = r.faceUV || new Array(6), e = r.faceColors, n = r.pattern || Ie.a.NO_FLIP, i = r.width || r.size || 1, o = r.height || r.size || 1, a = r.depth || r.size || 1, s = r.tileWidth || r.tileSize || 1, d = r.tileHeight || r.tileSize || 1, p = r.alignHorizontal || 0, y = r.alignVertical || 0, P = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, R = 0; R < 6; R++)\n            t[R] === void 0 && (t[R] = new u.f(0, 0, 1, 1)), e && e[R] === void 0 && (e[R] = new I.b(1, 1, 1, 1));\n          var B = i / 2, F = o / 2, z = a / 2, J = [];\n          for (R = 0; R < 2; R++)\n            J[R] = ht.a.CreateTiledPlane({ pattern: n, tileWidth: s, tileHeight: d, width: i, height: o, alignVertical: y, alignHorizontal: p, sideOrientation: P });\n          for (R = 2; R < 4; R++)\n            J[R] = ht.a.CreateTiledPlane({ pattern: n, tileWidth: s, tileHeight: d, width: a, height: o, alignVertical: y, alignHorizontal: p, sideOrientation: P });\n          var ie = y;\n          for (y === Ie.a.BOTTOM ? ie = Ie.a.TOP : y === Ie.a.TOP && (ie = Ie.a.BOTTOM), R = 4; R < 6; R++)\n            J[R] = ht.a.CreateTiledPlane({ pattern: n, tileWidth: s, tileHeight: d, width: i, height: a, alignVertical: ie, alignHorizontal: p, sideOrientation: P });\n          var se = [], ce = [], ue = [], fe = [], ve = [], Te = [], Re = [], Ae = [], Ee = 0, Se = 0, De = 0;\n          for (R = 0; R < 6; R++) {\n            Ee = J[R].positions.length, Te[R] = [], Re[R] = [];\n            for (var xe = 0; xe < Ee / 3; xe++)\n              Te[R].push(new u.e(J[R].positions[3 * xe], J[R].positions[3 * xe + 1], J[R].positions[3 * xe + 2])), Re[R].push(new u.e(J[R].normals[3 * xe], J[R].normals[3 * xe + 1], J[R].normals[3 * xe + 2]));\n            Se = J[R].uvs.length, Ae[R] = [];\n            for (var Le = 0; Le < Se; Le += 2)\n              Ae[R][Le] = t[R].x + (t[R].z - t[R].x) * J[R].uvs[Le], Ae[R][Le + 1] = t[R].y + (t[R].w - t[R].y) * J[R].uvs[Le + 1];\n            if (ue = ue.concat(Ae[R]), fe = fe.concat(J[R].indices.map(function(Ve) {\n              return Ve + De;\n            })), De += Te[R].length, e)\n              for (var Me = 0; Me < 4; Me++)\n                ve.push(e[R].r, e[R].g, e[R].b, e[R].a);\n          }\n          var we = new u.e(0, 0, z), Ye = u.a.RotationY(Math.PI);\n          se = Te[0].map(function(Ve) {\n            return u.e.TransformNormal(Ve, Ye).add(we);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []), ce = Re[0].map(function(Ve) {\n            return u.e.TransformNormal(Ve, Ye);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []), se = se.concat(Te[1].map(function(Ve) {\n            return Ve.subtract(we);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[1].map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var et = new u.e(B, 0, 0), nt = u.a.RotationY(-Math.PI / 2);\n          se = se.concat(Te[2].map(function(Ve) {\n            return u.e.TransformNormal(Ve, nt).add(et);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[2].map(function(Ve) {\n            return u.e.TransformNormal(Ve, nt);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var ct = u.a.RotationY(Math.PI / 2);\n          se = se.concat(Te[3].map(function(Ve) {\n            return u.e.TransformNormal(Ve, ct).subtract(et);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[3].map(function(Ve) {\n            return u.e.TransformNormal(Ve, ct);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var Ke = new u.e(0, F, 0), rt = u.a.RotationX(Math.PI / 2);\n          se = se.concat(Te[4].map(function(Ve) {\n            return u.e.TransformNormal(Ve, rt).add(Ke);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[4].map(function(Ve) {\n            return u.e.TransformNormal(Ve, rt);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var it = u.a.RotationX(-Math.PI / 2);\n          se = se.concat(Te[5].map(function(Ve) {\n            return u.e.TransformNormal(Ve, it).subtract(Ke);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[5].map(function(Ve) {\n            return u.e.TransformNormal(Ve, it);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ht.a._ComputeSides(P, se, fe, ce, ue);\n          var qe = new ht.a();\n          if (qe.indices = fe, qe.positions = se, qe.normals = ce, qe.uvs = ue, e) {\n            var ut = P === ht.a.DOUBLESIDE ? ve.concat(ve) : ve;\n            qe.colors = ut;\n          }\n          return qe;\n        };\n        var Zh = function() {\n          function r() {\n          }\n          return r.CreateTiledBox = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTiledBox(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        ht.a.CreateTorusKnot = function(r) {\n          var t, e, n = new Array(), i = new Array(), o = new Array(), a = new Array(), s = r.radius || 2, d = r.tube || 0.5, p = r.radialSegments || 32, y = r.tubularSegments || 32, P = r.p || 2, R = r.q || 3, B = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, F = function(Le) {\n            var Me = Math.cos(Le), we = Math.sin(Le), Ye = R / P * Le, et = Math.cos(Ye), nt = s * (2 + et) * 0.5 * Me, ct = s * (2 + et) * we * 0.5, Ke = s * Math.sin(Ye) * 0.5;\n            return new u.e(nt, ct, Ke);\n          };\n          for (t = 0; t <= p; t++) {\n            var z = t % p / p * 2 * P * Math.PI, J = F(z), ie = F(z + 0.01), se = ie.subtract(J), ce = ie.add(J), ue = u.e.Cross(se, ce);\n            for (ce = u.e.Cross(ue, se), ue.normalize(), ce.normalize(), e = 0; e < y; e++) {\n              var fe = e % y / y * 2 * Math.PI, ve = -d * Math.cos(fe), Te = d * Math.sin(fe);\n              i.push(J.x + ve * ce.x + Te * ue.x), i.push(J.y + ve * ce.y + Te * ue.y), i.push(J.z + ve * ce.z + Te * ue.z), a.push(t / p), a.push(e / y);\n            }\n          }\n          for (t = 0; t < p; t++)\n            for (e = 0; e < y; e++) {\n              var Re = (e + 1) % y, Ae = t * y + e, Ee = (t + 1) * y + e, Se = (t + 1) * y + Re, De = t * y + Re;\n              n.push(De), n.push(Ee), n.push(Ae), n.push(De), n.push(Se), n.push(Ee);\n            }\n          ht.a.ComputeNormals(i, n, o), ht.a._ComputeSides(B, i, n, o, a, r.frontUVs, r.backUVs);\n          var xe = new ht.a();\n          return xe.indices = n, xe.positions = i, xe.normals = o, xe.uvs = a, xe;\n        }, Ie.a.CreateTorusKnot = function(r, t, e, n, i, o, a, s, d, p) {\n          var y = { radius: t, tube: e, radialSegments: n, tubularSegments: i, p: o, q: a, sideOrientation: p, updatable: d };\n          return uc.CreateTorusKnot(r, y, s);\n        };\n        var uc = function() {\n          function r() {\n          }\n          return r.CreateTorusKnot = function(t, e, n) {\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTorusKnot(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }(), tm = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e.x, e.y) || this;\n            return i.index = n, i;\n          }\n          return Object(c.d)(t, r), t;\n        }(u.d), hc = function() {\n          function r() {\n            this.elements = new Array();\n          }\n          return r.prototype.add = function(t) {\n            var e = this, n = new Array();\n            return t.forEach(function(i) {\n              var o = new tm(i, e.elements.length);\n              n.push(o), e.elements.push(o);\n            }), n;\n          }, r.prototype.computeBounds = function() {\n            var t = new u.d(this.elements[0].x, this.elements[0].y), e = new u.d(this.elements[0].x, this.elements[0].y);\n            return this.elements.forEach(function(n) {\n              n.x < t.x ? t.x = n.x : n.x > e.x && (e.x = n.x), n.y < t.y ? t.y = n.y : n.y > e.y && (e.y = n.y);\n            }), { min: t, max: e, width: e.x - t.x, height: e.y - t.y };\n          }, r;\n        }(), nm = function() {\n          function r() {\n          }\n          return r.Rectangle = function(t, e, n, i) {\n            return [new u.d(t, e), new u.d(n, e), new u.d(n, i), new u.d(t, i)];\n          }, r.Circle = function(t, e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = 0), i === void 0 && (i = 32);\n            for (var o = new Array(), a = 0, s = 2 * Math.PI / i, d = 0; d < i; d++)\n              o.push(new u.d(e + Math.cos(a) * t, n + Math.sin(a) * t)), a -= s;\n            return o;\n          }, r.Parse = function(t) {\n            var e, n = t.split(/[^-+eE\\.\\d]+/).map(parseFloat).filter(function(o) {\n              return !isNaN(o);\n            }), i = [];\n            for (e = 0; e < (2147483646 & n.length); e += 2)\n              i.push(new u.d(n[e], n[e + 1]));\n            return i;\n          }, r.StartingAt = function(t, e) {\n            return Qe.f.StartingAt(t, e);\n          }, r;\n        }(), Jh = function() {\n          function r(t, e, n, i) {\n            var o;\n            i === void 0 && (i = earcut), this._points = new hc(), this._outlinepoints = new hc(), this._holes = new Array(), this._epoints = new Array(), this._eholes = new Array(), this.bjsEarcut = i, this._name = t, this._scene = n || Ue.a.LastCreatedScene, o = e instanceof Qe.f ? e.getPoints() : e, this._addToepoint(o), this._points.add(o), this._outlinepoints.add(o), this.bjsEarcut === void 0 && l.a.Warn(\"Earcut was not found, the polygon will not be built.\");\n          }\n          return r.prototype._addToepoint = function(t) {\n            for (var e = 0, n = t; e < n.length; e++) {\n              var i = n[e];\n              this._epoints.push(i.x, i.y);\n            }\n          }, r.prototype.addHole = function(t) {\n            this._points.add(t);\n            var e = new hc();\n            return e.add(t), this._holes.push(e), this._eholes.push(this._epoints.length / 2), this._addToepoint(t), this;\n          }, r.prototype.build = function(t, e) {\n            t === void 0 && (t = !1), e === void 0 && (e = 0);\n            var n = new Ie.a(this._name, this._scene), i = this.buildVertexData(e);\n            return n.setVerticesData(Oe.b.PositionKind, i.positions, t), n.setVerticesData(Oe.b.NormalKind, i.normals, t), n.setVerticesData(Oe.b.UVKind, i.uvs, t), n.setIndices(i.indices), n;\n          }, r.prototype.buildVertexData = function(t) {\n            var e = this;\n            t === void 0 && (t = 0);\n            var n = new ht.a(), i = new Array(), o = new Array(), a = new Array(), s = this._points.computeBounds();\n            this._points.elements.forEach(function(J) {\n              i.push(0, 1, 0), o.push(J.x, 0, J.y), a.push((J.x - s.min.x) / s.width, (J.y - s.min.y) / s.height);\n            });\n            for (var d = new Array(), p = this.bjsEarcut(this._epoints, this._eholes, 2), y = 0; y < p.length; y++)\n              d.push(p[y]);\n            if (t > 0) {\n              var P = o.length / 3;\n              this._points.elements.forEach(function(J) {\n                i.push(0, -1, 0), o.push(J.x, -t, J.y), a.push(1 - (J.x - s.min.x) / s.width, 1 - (J.y - s.min.y) / s.height);\n              });\n              var R = d.length;\n              for (y = 0; y < R; y += 3) {\n                var B = d[y + 0], F = d[y + 1], z = d[y + 2];\n                d.push(z + P), d.push(F + P), d.push(B + P);\n              }\n              this.addSide(o, i, a, d, s, this._outlinepoints, t, !1), this._holes.forEach(function(J) {\n                e.addSide(o, i, a, d, s, J, t, !0);\n              });\n            }\n            return n.indices = d, n.positions = o, n.normals = i, n.uvs = a, n;\n          }, r.prototype.addSide = function(t, e, n, i, o, a, s, d) {\n            for (var p = t.length / 3, y = 0, P = 0; P < a.elements.length; P++) {\n              var R, B = a.elements[P];\n              R = P + 1 > a.elements.length - 1 ? a.elements[0] : a.elements[P + 1], t.push(B.x, 0, B.y), t.push(B.x, -s, B.y), t.push(R.x, 0, R.y), t.push(R.x, -s, R.y);\n              var F = new u.e(B.x, 0, B.y), z = new u.e(R.x, 0, R.y).subtract(F), J = new u.e(0, 1, 0), ie = u.e.Cross(z, J);\n              ie = ie.normalize(), n.push(y / o.width, 0), n.push(y / o.width, 1), y += z.length(), n.push(y / o.width, 0), n.push(y / o.width, 1), d ? (e.push(ie.x, ie.y, ie.z), e.push(ie.x, ie.y, ie.z), e.push(ie.x, ie.y, ie.z), e.push(ie.x, ie.y, ie.z), i.push(p), i.push(p + 2), i.push(p + 1), i.push(p + 1), i.push(p + 2), i.push(p + 3)) : (e.push(-ie.x, -ie.y, -ie.z), e.push(-ie.x, -ie.y, -ie.z), e.push(-ie.x, -ie.y, -ie.z), e.push(-ie.x, -ie.y, -ie.z), i.push(p), i.push(p + 1), i.push(p + 2), i.push(p + 1), i.push(p + 3), i.push(p + 2)), p += 4;\n            }\n          }, r;\n        }();\n        ht.a.CreatePolygon = function(r, t, e, n, i, o, a) {\n          for (var s = e || new Array(3), d = n, p = [], y = a || !1, P = 0; P < 3; P++)\n            s[P] === void 0 && (s[P] = new u.f(0, 0, 1, 1)), d && d[P] === void 0 && (d[P] = new I.b(1, 1, 1, 1));\n          var R = r.getVerticesData(Oe.b.PositionKind), B = r.getVerticesData(Oe.b.NormalKind), F = r.getVerticesData(Oe.b.UVKind), z = r.getIndices(), J = R.length / 9, ie = 0, se = 0, ce = 0, ue = 0, fe = [0];\n          if (y)\n            for (var ve = J; ve < R.length / 3; ve += 4)\n              se = R[3 * (ve + 2)] - R[3 * ve], ce = R[3 * (ve + 2) + 2] - R[3 * ve + 2], ue += Math.sqrt(se * se + ce * ce), fe.push(ue);\n          ve = 0;\n          for (var Te = 0, Re = 0; Re < B.length; Re += 3)\n            Math.abs(B[Re + 1]) < 1e-3 && (Te = 1), Math.abs(B[Re + 1] - 1) < 1e-3 && (Te = 0), Math.abs(B[Re + 1] + 1) < 1e-3 && (Te = 2), ve = Re / 3, Te === 1 ? (ie = ve - J, F[2 * ve] = ie % 4 < 1.5 ? y ? s[Te].x + (s[Te].z - s[Te].x) * fe[Math.floor(ie / 4)] / ue : s[Te].x : y ? s[Te].x + (s[Te].z - s[Te].x) * fe[Math.floor(ie / 4) + 1] / ue : s[Te].z, F[2 * ve + 1] = ie % 2 == 0 ? s[Te].w : s[Te].y) : (F[2 * ve] = (1 - F[2 * ve]) * s[Te].x + F[2 * ve] * s[Te].z, F[2 * ve + 1] = (1 - F[2 * ve + 1]) * s[Te].y + F[2 * ve + 1] * s[Te].w), d && p.push(d[Te].r, d[Te].g, d[Te].b, d[Te].a);\n          ht.a._ComputeSides(t, R, z, B, F, i, o);\n          var Ae = new ht.a();\n          if (Ae.indices = z, Ae.positions = R, Ae.normals = B, Ae.uvs = F, d) {\n            var Ee = t === ht.a.DOUBLESIDE ? p.concat(p) : p;\n            Ae.colors = Ee;\n          }\n          return Ae;\n        }, Ie.a.CreatePolygon = function(r, t, e, n, i, o, a) {\n          a === void 0 && (a = earcut);\n          var s = { shape: t, holes: n, updatable: i, sideOrientation: o };\n          return po.CreatePolygon(r, s, e, a);\n        }, Ie.a.ExtrudePolygon = function(r, t, e, n, i, o, a, s) {\n          s === void 0 && (s = earcut);\n          var d = { shape: t, holes: i, depth: e, updatable: o, sideOrientation: a };\n          return po.ExtrudePolygon(r, d, n, s);\n        };\n        var po = function() {\n          function r() {\n          }\n          return r.CreatePolygon = function(t, e, n, i) {\n            n === void 0 && (n = null), i === void 0 && (i = earcut), e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation);\n            for (var o = e.shape, a = e.holes || [], s = e.depth || 0, d = [], p = [], y = 0; y < o.length; y++)\n              d[y] = new u.d(o[y].x, o[y].z);\n            d[0].equalsWithEpsilon(d[d.length - 1], 1e-8) && d.pop();\n            for (var P = new Jh(t, d, n || te.a.LastCreatedScene, i), R = 0; R < a.length; R++) {\n              p = [];\n              for (var B = 0; B < a[R].length; B++)\n                p.push(new u.d(a[R][B].x, a[R][B].z));\n              P.addHole(p);\n            }\n            var F = P.build(e.updatable, s);\n            return F._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreatePolygon(F, e.sideOrientation, e.faceUV, e.faceColors, e.frontUVs, e.backUVs, e.wrap).applyToMesh(F, e.updatable), F;\n          }, r.ExtrudePolygon = function(t, e, n, i) {\n            return n === void 0 && (n = null), i === void 0 && (i = earcut), r.CreatePolygon(t, e, n, i);\n          }, r;\n        }();\n        Ie.a.CreateLathe = function(r, t, e, n, i, o, a) {\n          var s = { shape: t, radius: e, tessellation: n, sideOrientation: a, updatable: o };\n          return dc.CreateLathe(r, s, i);\n        };\n        var dc = function() {\n          function r() {\n          }\n          return r.CreateLathe = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i, o = e.arc ? e.arc <= 0 || e.arc > 1 ? 1 : e.arc : 1, a = e.closed === void 0 || e.closed, s = e.shape, d = e.radius || 1, p = e.tessellation || 64, y = e.clip || 0, P = e.updatable, R = Ie.a._GetDefaultSideOrientation(e.sideOrientation), B = e.cap || Ie.a.NO_CAP, F = 2 * Math.PI, z = new Array(), J = e.invertUV || !1, ie = 0, se = 0, ce = F / p * o, ue = new Array();\n            for (ie = 0; ie <= p - y; ie++) {\n              for (ue = [], B != Ie.a.CAP_START && B != Ie.a.CAP_ALL || (ue.push(new u.e(0, s[0].y, 0)), ue.push(new u.e(Math.cos(ie * ce) * s[0].x * d, s[0].y, Math.sin(ie * ce) * s[0].x * d))), se = 0; se < s.length; se++)\n                i = new u.e(Math.cos(ie * ce) * s[se].x * d, s[se].y, Math.sin(ie * ce) * s[se].x * d), ue.push(i);\n              B != Ie.a.CAP_END && B != Ie.a.CAP_ALL || (ue.push(new u.e(Math.cos(ie * ce) * s[s.length - 1].x * d, s[s.length - 1].y, Math.sin(ie * ce) * s[s.length - 1].x * d)), ue.push(new u.e(0, s[s.length - 1].y, 0))), z.push(ue);\n            }\n            return fo.a.CreateRibbon(t, { pathArray: z, closeArray: a, sideOrientation: R, updatable: P, invertUV: J, frontUVs: e.frontUVs, backUVs: e.backUVs }, n);\n          }, r;\n        }();\n        ht.a.CreateTiledPlane = function(r) {\n          var t = r.pattern || Ie.a.NO_FLIP, e = r.tileWidth || r.tileSize || 1, n = r.tileHeight || r.tileSize || 1, i = r.alignHorizontal || 0, o = r.alignVertical || 0, a = r.width || r.size || 1, s = Math.floor(a / e), d = a - s * e, p = r.height || r.size || 1, y = Math.floor(p / n), P = p - y * n, R = e * s / 2, B = n * y / 2, F = 0, z = 0, J = 0, ie = 0, se = 0, ce = 0;\n          if (d > 0 || P > 0) {\n            switch (J = -R, ie = -B, se = R, ce = B, i) {\n              case Ie.a.CENTER:\n                J -= d /= 2, se += d;\n                break;\n              case Ie.a.LEFT:\n                se += d, F = -d / 2;\n                break;\n              case Ie.a.RIGHT:\n                J -= d, F = d / 2;\n            }\n            switch (o) {\n              case Ie.a.CENTER:\n                ie -= P /= 2, ce += P;\n                break;\n              case Ie.a.BOTTOM:\n                ce += P, z = -P / 2;\n                break;\n              case Ie.a.TOP:\n                ie -= P, z = P / 2;\n            }\n          }\n          var ue = [], fe = [], ve = [];\n          ve[0] = [0, 0, 1, 0, 1, 1, 0, 1], ve[1] = [0, 0, 1, 0, 1, 1, 0, 1], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (ve[1] = [1, 1, 0, 1, 0, 0, 1, 0]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (ve[1] = [1, 0, 0, 0, 0, 1, 1, 1]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (ve[1] = [0, 1, 1, 1, 1, 0, 0, 0]);\n          for (var Te = [], Re = [], Ae = [], Ee = 0, Se = 0; Se < y; Se++)\n            for (var De = 0; De < s; De++)\n              ue.push(De * e - R + F, Se * n - B + z, 0), ue.push((De + 1) * e - R + F, Se * n - B + z, 0), ue.push((De + 1) * e - R + F, (Se + 1) * n - B + z, 0), ue.push(De * e - R + F, (Se + 1) * n - B + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(ve[(De % 2 + Se % 2) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(ve[Se % 2]) : Te.concat(ve[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1), Ee += 4;\n          if (d > 0 || P > 0) {\n            var xe, Le, Me, we, Ye = P > 0 && (o === Ie.a.CENTER || o === Ie.a.TOP), et = P > 0 && (o === Ie.a.CENTER || o === Ie.a.BOTTOM), nt = d > 0 && (i === Ie.a.CENTER || i === Ie.a.RIGHT), ct = d > 0 && (i === Ie.a.CENTER || i === Ie.a.LEFT), Ke = [];\n            if (Ye && nt && (ue.push(J + F, ie + z, 0), ue.push(-R + F, ie + z, 0), ue.push(-R + F, ie + P + z, 0), ue.push(J + F, ie + P + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 1 - d / e, Le = 1 - P / n, Me = 1, Le, Me, we = 1, xe, we], t === Ie.a.ROTATE_ROW && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t === Ie.a.FLIP_ROW && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t === Ie.a.FLIP_N_ROTATE_ROW && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), Ye && ct && (ue.push(R + F, ie + z, 0), ue.push(se + F, ie + z, 0), ue.push(se + F, ie + P + z, 0), ue.push(R + F, ie + P + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 0, Le = 1 - P / n, Me = d / e, Le, Me, we = 1, xe, we], (t === Ie.a.ROTATE_ROW || t === Ie.a.ROTATE_TILE && s % 2 == 0) && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), (t === Ie.a.FLIP_ROW || t === Ie.a.FLIP_TILE && s % 2 == 0) && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), (t === Ie.a.FLIP_N_ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_TILE && s % 2 == 0) && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), et && nt && (ue.push(J + F, B + z, 0), ue.push(-R + F, B + z, 0), ue.push(-R + F, ce + z, 0), ue.push(J + F, ce + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 1 - d / e, Le = 0, Me = 1, Le, Me, we = P / n, xe, we], (t === Ie.a.ROTATE_ROW && y % 2 == 1 || t === Ie.a.ROTATE_TILE && y % 1 == 0) && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), (t === Ie.a.FLIP_ROW && y % 2 == 1 || t === Ie.a.FLIP_TILE && y % 2 == 0) && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), (t === Ie.a.FLIP_N_ROTATE_ROW && y % 2 == 1 || t === Ie.a.FLIP_N_ROTATE_TILE && y % 2 == 0) && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), et && ct && (ue.push(R + F, B + z, 0), ue.push(se + F, B + z, 0), ue.push(se + F, ce + z, 0), ue.push(R + F, ce + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 0, Le = 0, Me = d / e, Le, Me, we = P / n, xe, we], (t === Ie.a.ROTATE_ROW && y % 2 == 1 || t === Ie.a.ROTATE_TILE && (y + s) % 2 == 1) && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), (t === Ie.a.FLIP_ROW && y % 2 == 1 || t === Ie.a.FLIP_TILE && (y + s) % 2 == 1) && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), (t === Ie.a.FLIP_N_ROTATE_ROW && y % 2 == 1 || t === Ie.a.FLIP_N_ROTATE_TILE && (y + s) % 2 == 1) && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), Ye) {\n              var rt = [];\n              for (xe = 0, Le = 1 - P / n, Me = 1, we = 1, rt[0] = [xe, Le, Me, Le, Me, we, xe, we], rt[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (rt[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (rt[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (rt[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), De = 0; De < s; De++)\n                ue.push(De * e - R + F, ie + z, 0), ue.push((De + 1) * e - R + F, ie + z, 0), ue.push((De + 1) * e - R + F, ie + P + z, 0), ue.push(De * e - R + F, ie + P + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(rt[(De + 1) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(rt[1]) : Te.concat(rt[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n            if (et) {\n              var it = [];\n              for (xe = 0, Le = 0, Me = 1, we = P / n, it[0] = [xe, Le, Me, Le, Me, we, xe, we], it[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (it[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (it[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (it[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), De = 0; De < s; De++)\n                ue.push(De * e - R + F, ce - P + z, 0), ue.push((De + 1) * e - R + F, ce - P + z, 0), ue.push((De + 1) * e - R + F, ce + z, 0), ue.push(De * e - R + F, ce + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(it[(De + y) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(it[y % 2]) : Te.concat(it[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n            if (nt) {\n              var qe = [];\n              for (xe = 1 - d / e, Le = 0, Me = 1, we = 1, qe[0] = [xe, Le, Me, Le, Me, we, xe, we], qe[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (qe[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (qe[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (qe[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Se = 0; Se < y; Se++)\n                ue.push(J + F, Se * n - B + z, 0), ue.push(J + d + F, Se * n - B + z, 0), ue.push(J + d + F, (Se + 1) * n - B + z, 0), ue.push(J + F, (Se + 1) * n - B + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(qe[(Se + 1) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(qe[Se % 2]) : Te.concat(qe[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n            if (ct) {\n              var ut = [];\n              for (xe = 0, Le = 0, Me = d / n, we = 1, ut[0] = [xe, Le, Me, Le, Me, we, xe, we], ut[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (ut[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (ut[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (ut[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Se = 0; Se < y; Se++)\n                ue.push(se - d + F, Se * n - B + z, 0), ue.push(se + F, Se * n - B + z, 0), ue.push(se + F, (Se + 1) * n - B + z, 0), ue.push(se - d + F, (Se + 1) * n - B + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(ut[(Se + s) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(ut[Se % 2]) : Te.concat(ut[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n          }\n          var Ve = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE;\n          ht.a._ComputeSides(Ve, ue, Ae, fe, Te, r.frontUVs, r.backUVs);\n          var Ze = new ht.a();\n          Ze.indices = Ae, Ze.positions = ue, Ze.normals = fe, Ze.uvs = Te;\n          var vt = Ve === ht.a.DOUBLESIDE ? Re.concat(Re) : Re;\n          return Ze.colors = vt, Ze;\n        };\n        var $h = function() {\n          function r() {\n          }\n          return r.CreateTiledPlane = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTiledPlane(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        Ie.a.CreateTube = function(r, t, e, n, i, o, a, s, d, p) {\n          var y = { path: t, radius: e, tessellation: n, radiusFunction: i, arc: 1, cap: o, updatable: s, sideOrientation: d, instance: p };\n          return fc.CreateTube(r, y, a);\n        };\n        var fc = function() {\n          function r() {\n          }\n          return r.CreateTube = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = e.path, o = e.instance, a = 1;\n            e.radius !== void 0 ? a = e.radius : o && (a = o._creationDataStorage.radius);\n            var s = e.tessellation || 64, d = e.radiusFunction || null, p = e.cap || Ie.a.NO_CAP, y = e.invertUV || !1, P = e.updatable, R = Ie.a._GetDefaultSideOrientation(e.sideOrientation);\n            e.arc = e.arc && (e.arc <= 0 || e.arc > 1) ? 1 : e.arc || 1;\n            var B, F, z = function(ce, ue, fe, ve, Te, Re, Ae, Ee) {\n              for (var Se, De, xe, Le, Me = ue.getTangents(), we = ue.getNormals(), Ye = ue.getDistances(), et = 2 * Math.PI / Te * Ee, nt = Re || function() {\n                return ve;\n              }, ct = u.c.Matrix[0], Ke = Ae === Ie.a.NO_CAP || Ae === Ie.a.CAP_END ? 0 : 2, rt = 0; rt < ce.length; rt++) {\n                De = nt(rt, Ye[rt]), Se = Array(), xe = we[rt];\n                for (var it = 0; it < Te; it++)\n                  u.a.RotationAxisToRef(Me[rt], et * it, ct), Le = Se[it] ? Se[it] : u.e.Zero(), u.e.TransformCoordinatesToRef(xe, ct, Le), Le.scaleInPlace(De).addInPlace(ce[rt]), Se[it] = Le;\n                fe[Ke] = Se, Ke++;\n              }\n              var qe = function(ut, Ve) {\n                for (var Ze = Array(), vt = 0; vt < ut; vt++)\n                  Ze.push(ce[Ve]);\n                return Ze;\n              };\n              switch (Ae) {\n                case Ie.a.NO_CAP:\n                  break;\n                case Ie.a.CAP_START:\n                  fe[0] = qe(Te, 0), fe[1] = fe[2].slice(0);\n                  break;\n                case Ie.a.CAP_END:\n                  fe[Ke] = fe[Ke - 1].slice(0), fe[Ke + 1] = qe(Te, ce.length - 1);\n                  break;\n                case Ie.a.CAP_ALL:\n                  fe[0] = qe(Te, 0), fe[1] = fe[2].slice(0), fe[Ke] = fe[Ke - 1].slice(0), fe[Ke + 1] = qe(Te, ce.length - 1);\n              }\n              return fe;\n            };\n            if (o) {\n              var J = o._creationDataStorage, ie = e.arc || J.arc;\n              return F = z(i, B = J.path3D.update(i), J.pathArray, a, J.tessellation, d, J.cap, ie), o = fo.a.CreateRibbon(\"\", { pathArray: F, instance: o }), J.path3D = B, J.pathArray = F, J.arc = ie, J.radius = a, o;\n            }\n            F = z(i, B = new Qe.g(i), new Array(), a, s, d, p = p < 0 || p > 3 ? 0 : p, e.arc);\n            var se = fo.a.CreateRibbon(t, { pathArray: F, closePath: !0, closeArray: !1, updatable: P, sideOrientation: R, invertUV: y, frontUVs: e.frontUVs, backUVs: e.backUVs }, n);\n            return se._creationDataStorage.pathArray = F, se._creationDataStorage.path3D = B, se._creationDataStorage.tessellation = s, se._creationDataStorage.cap = p, se._creationDataStorage.arc = e.arc, se._creationDataStorage.radius = a, se;\n          }, r;\n        }();\n        ht.a.CreateIcoSphere = function(r) {\n          var t, e = r.sideOrientation || ht.a.DEFAULTSIDE, n = r.radius || 1, i = r.flat === void 0 || r.flat, o = r.subdivisions || 4, a = r.radiusX || n, s = r.radiusY || n, d = r.radiusZ || n, p = (1 + Math.sqrt(5)) / 2, y = [-1, p, -0, 1, p, 0, -1, -p, 0, 1, -p, 0, 0, -1, -p, 0, 1, -p, 0, -1, p, 0, 1, p, p, 0, 1, p, 0, -1, -p, 0, 1, -p, 0, -1], P = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17, 23, 6, 13, 22, 19, 6, 18, 9, 8, 1], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 2, 3, 3, 3, 4, 7, 8, 9, 9, 10, 11], B = [5, 1, 3, 1, 6, 4, 0, 0, 5, 3, 4, 2, 2, 2, 4, 0, 2, 0, 1, 1, 6, 0, 6, 2, 0, 4, 3, 3, 4, 4, 3, 1, 4, 2, 4, 4, 0, 2, 1, 1, 2, 2, 3, 3, 1, 3, 2, 4], F = [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0], z = new Array(), J = new Array(), ie = new Array(), se = new Array(), ce = 0, ue = new Array(3), fe = new Array(3);\n          for (t = 0; t < 3; t++)\n            ue[t] = u.e.Zero(), fe[t] = u.d.Zero();\n          for (var ve = 0; ve < 20; ve++) {\n            for (t = 0; t < 3; t++) {\n              var Te = P[3 * ve + t];\n              ue[t].copyFromFloats(y[3 * R[Te]], y[3 * R[Te] + 1], y[3 * R[Te] + 2]), ue[t].normalize().scaleInPlace(n), fe[t].copyFromFloats(B[2 * Te] * (138 / 1024) + 60 / 1024 + F[ve] * (-40 / 1024), B[2 * Te + 1] * (239 / 1024) + 26 / 1024 + F[ve] * (20 / 1024));\n            }\n            for (var Re = function(De, xe, Le, Me) {\n              var we, Ye = u.e.Lerp(ue[0], ue[2], xe / o), et = u.e.Lerp(ue[1], ue[2], xe / o), nt = o === xe ? ue[2] : u.e.Lerp(Ye, et, De / (o - xe));\n              if (nt.normalize(), i) {\n                var ct = u.e.Lerp(ue[0], ue[2], Me / o), Ke = u.e.Lerp(ue[1], ue[2], Me / o);\n                we = u.e.Lerp(ct, Ke, Le / (o - Me));\n              } else\n                we = new u.e(nt.x, nt.y, nt.z);\n              we.x /= a, we.y /= s, we.z /= d, we.normalize();\n              var rt = u.d.Lerp(fe[0], fe[2], xe / o), it = u.d.Lerp(fe[1], fe[2], xe / o), qe = o === xe ? fe[2] : u.d.Lerp(rt, it, De / (o - xe));\n              J.push(nt.x * a, nt.y * s, nt.z * d), ie.push(we.x, we.y, we.z), se.push(qe.x, qe.y), z.push(ce), ce++;\n            }, Ae = 0; Ae < o; Ae++)\n              for (var Ee = 0; Ee + Ae < o; Ee++)\n                Re(Ee, Ae, Ee + 1 / 3, Ae + 1 / 3), Re(Ee + 1, Ae, Ee + 1 / 3, Ae + 1 / 3), Re(Ee, Ae + 1, Ee + 1 / 3, Ae + 1 / 3), Ee + Ae + 1 < o && (Re(Ee + 1, Ae, Ee + 2 / 3, Ae + 2 / 3), Re(Ee + 1, Ae + 1, Ee + 2 / 3, Ae + 2 / 3), Re(Ee, Ae + 1, Ee + 2 / 3, Ae + 2 / 3));\n          }\n          ht.a._ComputeSides(e, J, z, ie, se, r.frontUVs, r.backUVs);\n          var Se = new ht.a();\n          return Se.indices = z, Se.positions = J, Se.normals = ie, Se.uvs = se, Se;\n        }, Ie.a.CreateIcoSphere = function(r, t, e) {\n          return pc.CreateIcoSphere(r, t, e);\n        };\n        var pc = function() {\n          function r() {\n          }\n          return r.CreateIcoSphere = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateIcoSphere(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        Ie.a.CreateDecal = function(r, t, e, n, i, o) {\n          var a = { position: e, normal: n, size: i, angle: o };\n          return _c.CreateDecal(r, t, a);\n        };\n        var _c = function() {\n          function r() {\n          }\n          return r.CreateDecal = function(t, e, n) {\n            var i = e.getIndices(), o = e.getVerticesData(Oe.b.PositionKind), a = e.getVerticesData(Oe.b.NormalKind), s = n.position || u.e.Zero(), d = n.normal || u.e.Up(), p = n.size || u.e.One(), y = n.angle || 0;\n            if (!d) {\n              var P = new u.e(0, 0, 1), R = e.getScene().activeCamera, B = u.e.TransformCoordinates(P, R.getWorldMatrix());\n              d = R.globalPosition.subtract(B);\n            }\n            var F = -Math.atan2(d.z, d.x) - Math.PI / 2, z = Math.sqrt(d.x * d.x + d.z * d.z), J = Math.atan2(d.y, z), ie = u.a.RotationYawPitchRoll(F, J, y).multiply(u.a.Translation(s.x, s.y, s.z)), se = u.a.Invert(ie), ce = e.getWorldMatrix().multiply(se), ue = new ht.a();\n            ue.indices = [], ue.positions = [], ue.normals = [], ue.uvs = [];\n            for (var fe = 0, ve = function(xe) {\n              var Le = new bs();\n              if (!i || !o || !a)\n                return Le;\n              var Me = i[xe];\n              return Le.position = new u.e(o[3 * Me], o[3 * Me + 1], o[3 * Me + 2]), Le.position = u.e.TransformCoordinates(Le.position, ce), Le.normal = new u.e(a[3 * Me], a[3 * Me + 1], a[3 * Me + 2]), Le.normal = u.e.TransformNormal(Le.normal, ce), Le;\n            }, Te = function(xe, Le) {\n              if (xe.length === 0)\n                return xe;\n              for (var Me = 0.5 * Math.abs(u.e.Dot(p, Le)), we = function(Ve, Ze) {\n                var vt = u.e.GetClipFactor(Ve.position, Ze.position, Le, Me);\n                return new bs(u.e.Lerp(Ve.position, Ze.position, vt), u.e.Lerp(Ve.normal, Ze.normal, vt));\n              }, Ye = new Array(), et = 0; et < xe.length; et += 3) {\n                var nt, ct, Ke, rt = null, it = null, qe = null, ut = null;\n                switch (((nt = u.e.Dot(xe[et].position, Le) - Me > 0) ? 1 : 0) + ((ct = u.e.Dot(xe[et + 1].position, Le) - Me > 0) ? 1 : 0) + ((Ke = u.e.Dot(xe[et + 2].position, Le) - Me > 0) ? 1 : 0)) {\n                  case 0:\n                    Ye.push(xe[et]), Ye.push(xe[et + 1]), Ye.push(xe[et + 2]);\n                    break;\n                  case 1:\n                    if (nt && (rt = xe[et + 1], it = xe[et + 2], qe = we(xe[et], rt), ut = we(xe[et], it)), ct) {\n                      rt = xe[et], it = xe[et + 2], qe = we(xe[et + 1], rt), ut = we(xe[et + 1], it), Ye.push(qe), Ye.push(it.clone()), Ye.push(rt.clone()), Ye.push(it.clone()), Ye.push(qe.clone()), Ye.push(ut);\n                      break;\n                    }\n                    Ke && (rt = xe[et], it = xe[et + 1], qe = we(xe[et + 2], rt), ut = we(xe[et + 2], it)), rt && it && qe && ut && (Ye.push(rt.clone()), Ye.push(it.clone()), Ye.push(qe), Ye.push(ut), Ye.push(qe.clone()), Ye.push(it.clone()));\n                    break;\n                  case 2:\n                    nt || (it = we(rt = xe[et].clone(), xe[et + 1]), qe = we(rt, xe[et + 2]), Ye.push(rt), Ye.push(it), Ye.push(qe)), ct || (it = we(rt = xe[et + 1].clone(), xe[et + 2]), qe = we(rt, xe[et]), Ye.push(rt), Ye.push(it), Ye.push(qe)), Ke || (it = we(rt = xe[et + 2].clone(), xe[et]), qe = we(rt, xe[et + 1]), Ye.push(rt), Ye.push(it), Ye.push(qe));\n                }\n              }\n              return Ye;\n            }, Re = 0; Re < i.length; Re += 3) {\n              var Ae = new Array();\n              if (Ae.push(ve(Re)), Ae.push(ve(Re + 1)), Ae.push(ve(Re + 2)), Ae = Te(Ae, new u.e(1, 0, 0)), Ae = Te(Ae, new u.e(-1, 0, 0)), Ae = Te(Ae, new u.e(0, 1, 0)), Ae = Te(Ae, new u.e(0, -1, 0)), Ae = Te(Ae, new u.e(0, 0, 1)), (Ae = Te(Ae, new u.e(0, 0, -1))).length !== 0)\n                for (var Ee = 0; Ee < Ae.length; Ee++) {\n                  var Se = Ae[Ee];\n                  ue.indices.push(fe), Se.position.toArray(ue.positions, 3 * fe), Se.normal.toArray(ue.normals, 3 * fe), ue.uvs.push(0.5 + Se.position.x / p.x), ue.uvs.push(0.5 + Se.position.y / p.y), fe++;\n                }\n            }\n            var De = new Ie.a(t, e.getScene());\n            return ue.applyToMesh(De), De.position = s.clone(), De.rotation = new u.e(J, F, y), De;\n          }, r;\n        }();\n        ht.a.CreateCapsule = function(r) {\n          r === void 0 && (r = { subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 });\n          var t, e, n = Math.max(r.subdivisions ? r.subdivisions : 2, 1), i = Math.max(r.tessellation ? r.tessellation : 16, 3), o = Math.max(r.height ? r.height : 1, 0), a = Math.max(r.radius ? r.radius : 0.25, 0), s = Math.max(r.capSubdivisions ? r.capSubdivisions : 6, 1), d = i, p = n, y = Math.max(r.radiusTop ? r.radiusTop : a, 0), P = Math.max(r.radiusBottom ? r.radiusBottom : a, 0), R = o - (y + P), B = 2 * Math.PI, F = Math.max(r.topCapSubdivisions ? r.topCapSubdivisions : s, 1), z = Math.max(r.bottomCapSubdivisions ? r.bottomCapSubdivisions : s, 1), J = Math.acos((P - y) / o), ie = [], se = [], ce = [], ue = [], fe = 0, ve = [], Te = 0.5 * R, Re = 0.5 * Math.PI, Ae = u.e.Zero(), Ee = u.e.Zero(), Se = Math.cos(J), De = Math.sin(J), xe = new u.d(y * De, Te + y * Se).subtract(new u.d(P * De, P * Se - Te)).length(), Le = y * J + xe + P * (Re - J), Me = 0;\n          for (e = 0; e <= F; e++) {\n            var we = [], Ye = Re - J * (e / F);\n            Me += y * J / F;\n            var et = Math.cos(Ye), nt = Math.sin(Ye), ct = et * y;\n            for (t = 0; t <= d; t++) {\n              var Ke = (Ve = t / d) * B + 0, rt = Math.sin(Ke), it = Math.cos(Ke);\n              Ee.x = ct * rt, Ee.y = Te + nt * y, Ee.z = ct * it, se.push(Ee.x, Ee.y, Ee.z), Ae.set(et * rt, nt, et * it), ce.push(Ae.x, Ae.y, Ae.z), ue.push(Ve, 1 - Me / Le), we.push(fe), fe++;\n            }\n            ve.push(we);\n          }\n          var qe = o - y - P + Se * y - Se * P, ut = De * (P - y) / qe;\n          for (e = 1; e <= p; e++) {\n            for (we = [], Me += xe / p, ct = De * (e * (P - y) / p + y), t = 0; t <= d; t++)\n              Ke = (Ve = t / d) * B + 0, rt = Math.sin(Ke), it = Math.cos(Ke), Ee.x = ct * rt, Ee.y = Te + Se * y - e * qe / p, Ee.z = ct * it, se.push(Ee.x, Ee.y, Ee.z), Ae.set(rt, ut, it).normalize(), ce.push(Ae.x, Ae.y, Ae.z), ue.push(Ve, 1 - Me / Le), we.push(fe), fe++;\n            ve.push(we);\n          }\n          for (e = 1; e <= z; e++) {\n            for (we = [], Ye = Re - J - (Math.PI - J) * (e / z), Me += P * J / z, et = Math.cos(Ye), nt = Math.sin(Ye), ct = et * P, t = 0; t <= d; t++) {\n              var Ve;\n              Ke = (Ve = t / d) * B + 0, rt = Math.sin(Ke), it = Math.cos(Ke), Ee.x = ct * rt, Ee.y = nt * P - Te, Ee.z = ct * it, se.push(Ee.x, Ee.y, Ee.z), Ae.set(et * rt, nt, et * it), ce.push(Ae.x, Ae.y, Ae.z), ue.push(Ve, 1 - Me / Le), we.push(fe), fe++;\n            }\n            ve.push(we);\n          }\n          for (t = 0; t < d; t++)\n            for (e = 0; e < F + p + z; e++) {\n              var Ze = ve[e][t], vt = ve[e + 1][t], jt = ve[e + 1][t + 1], Dt = ve[e][t + 1];\n              ie.push(Ze), ie.push(vt), ie.push(Dt), ie.push(vt), ie.push(jt), ie.push(Dt);\n            }\n          if (ie = ie.reverse(), r.orientation && !r.orientation.equals(u.e.Up())) {\n            var Yt = new u.a();\n            r.orientation.clone().scale(0.5 * Math.PI).cross(u.e.Up()).toQuaternion().toRotationMatrix(Yt);\n            for (var mt = u.e.Zero(), qt = 0; qt < se.length; qt += 3)\n              mt.set(se[qt], se[qt + 1], se[qt + 2]), u.e.TransformCoordinatesToRef(mt.clone(), Yt, mt), se[qt] = mt.x, se[qt + 1] = mt.y, se[qt + 2] = mt.z;\n          }\n          var Ht = new ht.a();\n          return Ht.positions = se, Ht.normals = ce, Ht.uvs = ue, Ht.indices = ie, Ht;\n        }, Ie.a.CreateCapsule = function(r, t, e) {\n          return mc.CreateCapsule(r, t, e);\n        };\n        var _o, mc = function() {\n          function r() {\n          }\n          return r.CreateCapsule = function(t, e, n) {\n            e === void 0 && (e = { orientation: u.e.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 });\n            var i = new Ie.a(t, n);\n            return ht.a.CreateCapsule(e).applyToMesh(i), i;\n          }, r;\n        }(), im = function() {\n          function r() {\n          }\n          return r.CreateBox = function(t, e, n) {\n            return n === void 0 && (n = null), fr.a.CreateBox(t, e, n);\n          }, r.CreateTiledBox = function(t, e, n) {\n            return n === void 0 && (n = null), Zh.CreateTiledBox(t, e, n);\n          }, r.CreateSphere = function(t, e, n) {\n            return n === void 0 && (n = null), Nn.a.CreateSphere(t, e, n);\n          }, r.CreateDisc = function(t, e, n) {\n            return n === void 0 && (n = null), ha.CreateDisc(t, e, n);\n          }, r.CreateIcoSphere = function(t, e, n) {\n            return n === void 0 && (n = null), pc.CreateIcoSphere(t, e, n);\n          }, r.CreateRibbon = function(t, e, n) {\n            return n === void 0 && (n = null), fo.a.CreateRibbon(t, e, n);\n          }, r.CreateCylinder = function(t, e, n) {\n            return n === void 0 && (n = null), ci.a.CreateCylinder(t, e, n);\n          }, r.CreateTorus = function(t, e, n) {\n            return n === void 0 && (n = null), lr.CreateTorus(t, e, n);\n          }, r.CreateTorusKnot = function(t, e, n) {\n            return n === void 0 && (n = null), uc.CreateTorusKnot(t, e, n);\n          }, r.CreateLineSystem = function(t, e, n) {\n            return sn.a.CreateLineSystem(t, e, n);\n          }, r.CreateLines = function(t, e, n) {\n            return n === void 0 && (n = null), sn.a.CreateLines(t, e, n);\n          }, r.CreateDashedLines = function(t, e, n) {\n            return n === void 0 && (n = null), sn.a.CreateDashedLines(t, e, n);\n          }, r.ExtrudeShape = function(t, e, n) {\n            return n === void 0 && (n = null), Jo.a.ExtrudeShape(t, e, n);\n          }, r.ExtrudeShapeCustom = function(t, e, n) {\n            return n === void 0 && (n = null), Jo.a.ExtrudeShapeCustom(t, e, n);\n          }, r.CreateLathe = function(t, e, n) {\n            return n === void 0 && (n = null), dc.CreateLathe(t, e, n);\n          }, r.CreateTiledPlane = function(t, e, n) {\n            return n === void 0 && (n = null), $h.CreateTiledPlane(t, e, n);\n          }, r.CreatePlane = function(t, e, n) {\n            return n === void 0 && (n = null), gs.a.CreatePlane(t, e, n);\n          }, r.CreateGround = function(t, e, n) {\n            return n === void 0 && (n = null), Oi.CreateGround(t, e, n);\n          }, r.CreateTiledGround = function(t, e, n) {\n            return n === void 0 && (n = null), Oi.CreateTiledGround(t, e, n);\n          }, r.CreateGroundFromHeightMap = function(t, e, n, i) {\n            return i === void 0 && (i = null), Oi.CreateGroundFromHeightMap(t, e, n, i);\n          }, r.CreatePolygon = function(t, e, n, i) {\n            return n === void 0 && (n = null), i === void 0 && (i = earcut), po.CreatePolygon(t, e, n, i);\n          }, r.ExtrudePolygon = function(t, e, n, i) {\n            return n === void 0 && (n = null), i === void 0 && (i = earcut), po.ExtrudePolygon(t, e, n, i);\n          }, r.CreateTube = function(t, e, n) {\n            return n === void 0 && (n = null), fc.CreateTube(t, e, n);\n          }, r.CreatePolyhedron = function(t, e, n) {\n            return n === void 0 && (n = null), Qr.CreatePolyhedron(t, e, n);\n          }, r.CreateDecal = function(t, e, n) {\n            return _c.CreateDecal(t, e, n);\n          }, r.CreateCapsule = function(t, e, n) {\n            return e === void 0 && (e = { orientation: u.e.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 }), n === void 0 && (n = null), mc.CreateCapsule(t, e, n);\n          }, r;\n        }(), rm = function(r, t, e) {\n          this.quality = r, this.distance = t, this.optimizeMesh = e;\n        }, ed = function() {\n          function r() {\n            this.running = !1, this._simplificationArray = [];\n          }\n          return r.prototype.addTask = function(t) {\n            this._simplificationArray.push(t);\n          }, r.prototype.executeNext = function() {\n            var t = this._simplificationArray.pop();\n            t ? (this.running = !0, this.runSimplification(t)) : this.running = !1;\n          }, r.prototype.runSimplification = function(t) {\n            var e = this;\n            if (t.parallelProcessing)\n              t.settings.forEach(function(i) {\n                e.getSimplifier(t).simplify(i, function(o) {\n                  i.distance !== void 0 && t.mesh.addLODLevel(i.distance, o), o.isVisible = !0, i.quality === t.settings[t.settings.length - 1].quality && t.successCallback && t.successCallback(), e.executeNext();\n                });\n              });\n            else {\n              var n = this.getSimplifier(t);\n              Xe.a.Run(t.settings.length, function(i) {\n                var o, a;\n                o = t.settings[i.index], a = function() {\n                  i.executeNext();\n                }, n.simplify(o, function(s) {\n                  o.distance !== void 0 && t.mesh.addLODLevel(o.distance, s), s.isVisible = !0, a();\n                });\n              }, function() {\n                t.successCallback && t.successCallback(), e.executeNext();\n              });\n            }\n          }, r.prototype.getSimplifier = function(t) {\n            switch (t.simplificationType) {\n              case _o.QUADRATIC:\n              default:\n                return new nd(t.mesh);\n            }\n          }, r;\n        }();\n        (function(r) {\n          r[r.QUADRATIC = 0] = \"QUADRATIC\";\n        })(_o || (_o = {}));\n        var om = function(r) {\n          this.vertices = r, this.error = new Array(4), this.deleted = !1, this.isDirty = !1, this.deletePending = !1, this.borderFactor = 0;\n        }, am = function() {\n          function r(t, e) {\n            this.position = t, this.id = e, this.isBorder = !0, this.q = new td(), this.triangleCount = 0, this.triangleStart = 0, this.originalOffsets = [];\n          }\n          return r.prototype.updatePosition = function(t) {\n            this.position.copyFrom(t);\n          }, r;\n        }(), td = function() {\n          function r(t) {\n            this.data = new Array(10);\n            for (var e = 0; e < 10; ++e)\n              t && t[e] ? this.data[e] = t[e] : this.data[e] = 0;\n          }\n          return r.prototype.det = function(t, e, n, i, o, a, s, d, p) {\n            return this.data[t] * this.data[o] * this.data[p] + this.data[n] * this.data[i] * this.data[d] + this.data[e] * this.data[a] * this.data[s] - this.data[n] * this.data[o] * this.data[s] - this.data[t] * this.data[a] * this.data[d] - this.data[e] * this.data[i] * this.data[p];\n          }, r.prototype.addInPlace = function(t) {\n            for (var e = 0; e < 10; ++e)\n              this.data[e] += t.data[e];\n          }, r.prototype.addArrayInPlace = function(t) {\n            for (var e = 0; e < 10; ++e)\n              this.data[e] += t[e];\n          }, r.prototype.add = function(t) {\n            for (var e = new r(), n = 0; n < 10; ++n)\n              e.data[n] = this.data[n] + t.data[n];\n            return e;\n          }, r.FromData = function(t, e, n, i) {\n            return new r(r.DataFromNumbers(t, e, n, i));\n          }, r.DataFromNumbers = function(t, e, n, i) {\n            return [t * t, t * e, t * n, t * i, e * e, e * n, e * i, n * n, n * i, i * i];\n          }, r;\n        }(), sm = function(r, t) {\n          this.vertexId = r, this.triangleId = t;\n        }, nd = function() {\n          function r(t) {\n            this._mesh = t, this.syncIterations = 5e3, this.aggressiveness = 7, this.decimationIterations = 100, this.boundingBoxEpsilon = Vt.a;\n          }\n          return r.prototype.simplify = function(t, e) {\n            var n = this;\n            this.initDecimatedMesh(), Xe.a.Run(this._mesh.subMeshes.length, function(i) {\n              n.initWithMesh(i.index, function() {\n                n.runDecimation(t, i.index, function() {\n                  i.executeNext();\n                });\n              }, t.optimizeMesh);\n            }, function() {\n              setTimeout(function() {\n                e(n._reconstructedMesh);\n              }, 0);\n            });\n          }, r.prototype.runDecimation = function(t, e, n) {\n            var i = this, o = ~~(this.triangles.length * t.quality), a = 0, s = this.triangles.length;\n            Xe.a.Run(this.decimationIterations, function(d) {\n              var p, y;\n              s - a <= o ? d.breakLoop() : (p = d.index, y = function() {\n                d.executeNext();\n              }, setTimeout(function() {\n                p % 5 == 0 && i.updateMesh(p === 0);\n                for (var P = 0; P < i.triangles.length; ++P)\n                  i.triangles[P].isDirty = !1;\n                var R = 1e-9 * Math.pow(p + 3, i.aggressiveness);\n                Xe.a.SyncAsyncForLoop(i.triangles.length, i.syncIterations, function(B) {\n                  var F = ~~((i.triangles.length / 2 + B) % i.triangles.length), z = i.triangles[F];\n                  if (z && !(z.error[3] > R || z.deleted || z.isDirty)) {\n                    for (var J = 0; J < 3; ++J)\n                      if (z.error[J] < R) {\n                        var ie = [], se = [], ce = z.vertices[J], ue = z.vertices[(J + 1) % 3];\n                        if (ce.isBorder || ue.isBorder)\n                          continue;\n                        var fe = u.e.Zero();\n                        i.calculateError(ce, ue, fe);\n                        var ve = new Array();\n                        if (i.isFlipped(ce, ue, fe, ie, ve) || i.isFlipped(ue, ce, fe, se, ve) || ie.indexOf(!0) < 0 || se.indexOf(!0) < 0)\n                          continue;\n                        var Te = new Array();\n                        if (ve.forEach(function(Se) {\n                          Te.indexOf(Se) === -1 && (Se.deletePending = !0, Te.push(Se));\n                        }), Te.length % 2 != 0)\n                          continue;\n                        ce.q = ue.q.add(ce.q), ce.updatePosition(fe);\n                        var Re = i.references.length;\n                        a = i.updateTriangles(ce, ce, ie, a), a = i.updateTriangles(ce, ue, se, a);\n                        var Ae = i.references.length - Re;\n                        if (Ae <= ce.triangleCount) {\n                          if (Ae)\n                            for (var Ee = 0; Ee < Ae; Ee++)\n                              i.references[ce.triangleStart + Ee] = i.references[Re + Ee];\n                        } else\n                          ce.triangleStart = Re;\n                        ce.triangleCount = Ae;\n                        break;\n                      }\n                  }\n                }, y, function() {\n                  return s - a <= o;\n                });\n              }, 0));\n            }, function() {\n              setTimeout(function() {\n                i.reconstructMesh(e), n();\n              }, 0);\n            });\n          }, r.prototype.initWithMesh = function(t, e, n) {\n            var i = this;\n            this.vertices = [], this.triangles = [];\n            var o = this._mesh.getVerticesData(Oe.b.PositionKind), a = this._mesh.getIndices(), s = this._mesh.subMeshes[t], d = [], p = s.verticesCount;\n            Xe.a.SyncAsyncForLoop(p, this.syncIterations / 4 >> 0, function(y) {\n              if (o) {\n                var P = y + s.verticesStart, R = u.e.FromArray(o, 3 * P), B = function(F) {\n                  if (n) {\n                    for (var z = 0; z < i.vertices.length; ++z)\n                      if (i.vertices[z].position.equalsWithEpsilon(F, 1e-4))\n                        return i.vertices[z];\n                  }\n                  return null;\n                }(R) || new am(R, i.vertices.length);\n                B.originalOffsets.push(P), B.id === i.vertices.length && i.vertices.push(B), d.push(B.id);\n              }\n            }, function() {\n              Xe.a.SyncAsyncForLoop(s.indexCount / 3, i.syncIterations, function(y) {\n                if (a) {\n                  var P = 3 * (s.indexStart / 3 + y), R = a[P + 0], B = a[P + 1], F = a[P + 2], z = i.vertices[d[R - s.verticesStart]], J = i.vertices[d[B - s.verticesStart]], ie = i.vertices[d[F - s.verticesStart]], se = new om([z, J, ie]);\n                  se.originalOffset = P, i.triangles.push(se);\n                }\n              }, function() {\n                i.init(e);\n              });\n            });\n          }, r.prototype.init = function(t) {\n            var e = this;\n            Xe.a.SyncAsyncForLoop(this.triangles.length, this.syncIterations, function(n) {\n              var i = e.triangles[n];\n              i.normal = u.e.Cross(i.vertices[1].position.subtract(i.vertices[0].position), i.vertices[2].position.subtract(i.vertices[0].position)).normalize();\n              for (var o = 0; o < 3; o++)\n                i.vertices[o].q.addArrayInPlace(td.DataFromNumbers(i.normal.x, i.normal.y, i.normal.z, -u.e.Dot(i.normal, i.vertices[0].position)));\n            }, function() {\n              Xe.a.SyncAsyncForLoop(e.triangles.length, e.syncIterations, function(n) {\n                for (var i = e.triangles[n], o = 0; o < 3; ++o)\n                  i.error[o] = e.calculateError(i.vertices[o], i.vertices[(o + 1) % 3]);\n                i.error[3] = Math.min(i.error[0], i.error[1], i.error[2]);\n              }, function() {\n                t();\n              });\n            });\n          }, r.prototype.reconstructMesh = function(t) {\n            var e, n, i, o = [];\n            for (e = 0; e < this.vertices.length; ++e)\n              this.vertices[e].triangleCount = 0;\n            for (e = 0; e < this.triangles.length; ++e)\n              if (!this.triangles[e].deleted) {\n                for (n = this.triangles[e], i = 0; i < 3; ++i)\n                  n.vertices[i].triangleCount = 1;\n                o.push(n);\n              }\n            var a = this._reconstructedMesh.getVerticesData(Oe.b.PositionKind) || [], s = this._reconstructedMesh.getVerticesData(Oe.b.NormalKind) || [], d = this._reconstructedMesh.getVerticesData(Oe.b.UVKind) || [], p = this._reconstructedMesh.getVerticesData(Oe.b.ColorKind) || [], y = this._mesh.getVerticesData(Oe.b.NormalKind), P = this._mesh.getVerticesData(Oe.b.UVKind), R = this._mesh.getVerticesData(Oe.b.ColorKind), B = 0;\n            for (e = 0; e < this.vertices.length; ++e) {\n              var F = this.vertices[e];\n              F.id = B, F.triangleCount && F.originalOffsets.forEach(function(fe) {\n                a.push(F.position.x), a.push(F.position.y), a.push(F.position.z), y && y.length && (s.push(y[3 * fe]), s.push(y[3 * fe + 1]), s.push(y[3 * fe + 2])), P && P.length && (d.push(P[2 * fe]), d.push(P[2 * fe + 1])), R && R.length && (p.push(R[4 * fe]), p.push(R[4 * fe + 1]), p.push(R[4 * fe + 2]), p.push(R[4 * fe + 3])), ++B;\n              });\n            }\n            var z = this._reconstructedMesh.getTotalIndices(), J = this._reconstructedMesh.getTotalVertices(), ie = this._reconstructedMesh.subMeshes;\n            this._reconstructedMesh.subMeshes = [];\n            var se = this._reconstructedMesh.getIndices(), ce = this._mesh.getIndices();\n            for (e = 0; e < o.length; ++e)\n              n = o[e], [0, 1, 2].forEach(function(fe) {\n                var ve = ce[n.originalOffset + fe], Te = n.vertices[fe].originalOffsets.indexOf(ve);\n                Te < 0 && (Te = 0), se.push(n.vertices[fe].id + Te + J);\n              });\n            this._reconstructedMesh.setIndices(se), this._reconstructedMesh.setVerticesData(Oe.b.PositionKind, a), s.length > 0 && this._reconstructedMesh.setVerticesData(Oe.b.NormalKind, s), d.length > 0 && this._reconstructedMesh.setVerticesData(Oe.b.UVKind, d), p.length > 0 && this._reconstructedMesh.setVerticesData(Oe.b.ColorKind, p);\n            var ue = this._mesh.subMeshes[t];\n            t > 0 && (this._reconstructedMesh.subMeshes = [], ie.forEach(function(fe) {\n              uo.a.AddToMesh(fe.materialIndex, fe.verticesStart, fe.verticesCount, fe.indexStart, fe.indexCount, fe.getMesh());\n            }), uo.a.AddToMesh(ue.materialIndex, J, B, z, 3 * o.length, this._reconstructedMesh));\n          }, r.prototype.initDecimatedMesh = function() {\n            this._reconstructedMesh = new Ie.a(this._mesh.name + \"Decimated\", this._mesh.getScene()), this._reconstructedMesh.material = this._mesh.material, this._reconstructedMesh.parent = this._mesh.parent, this._reconstructedMesh.isVisible = !1, this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId;\n          }, r.prototype.isFlipped = function(t, e, n, i, o) {\n            for (var a = 0; a < t.triangleCount; ++a) {\n              var s = this.triangles[this.references[t.triangleStart + a].triangleId];\n              if (!s.deleted) {\n                var d = this.references[t.triangleStart + a].vertexId, p = s.vertices[(d + 1) % 3], y = s.vertices[(d + 2) % 3];\n                if (p !== e && y !== e) {\n                  var P = p.position.subtract(n);\n                  P = P.normalize();\n                  var R = y.position.subtract(n);\n                  if (R = R.normalize(), Math.abs(u.e.Dot(P, R)) > 0.999)\n                    return !0;\n                  var B = u.e.Cross(P, R).normalize();\n                  if (i[a] = !1, u.e.Dot(B, s.normal) < 0.2)\n                    return !0;\n                } else\n                  i[a] = !0, o.push(s);\n              }\n            }\n            return !1;\n          }, r.prototype.updateTriangles = function(t, e, n, i) {\n            for (var o = i, a = 0; a < e.triangleCount; ++a) {\n              var s = this.references[e.triangleStart + a], d = this.triangles[s.triangleId];\n              d.deleted || (n[a] && d.deletePending ? (d.deleted = !0, o++) : (d.vertices[s.vertexId] = t, d.isDirty = !0, d.error[0] = this.calculateError(d.vertices[0], d.vertices[1]) + d.borderFactor / 2, d.error[1] = this.calculateError(d.vertices[1], d.vertices[2]) + d.borderFactor / 2, d.error[2] = this.calculateError(d.vertices[2], d.vertices[0]) + d.borderFactor / 2, d.error[3] = Math.min(d.error[0], d.error[1], d.error[2]), this.references.push(s)));\n            }\n            return o;\n          }, r.prototype.identifyBorder = function() {\n            for (var t = 0; t < this.vertices.length; ++t) {\n              var e, n = [], i = [], o = this.vertices[t];\n              for (e = 0; e < o.triangleCount; ++e)\n                for (var a = this.triangles[this.references[o.triangleStart + e].triangleId], s = 0; s < 3; s++) {\n                  for (var d = 0, p = a.vertices[s]; d < n.length && i[d] !== p.id; )\n                    ++d;\n                  d === n.length ? (n.push(1), i.push(p.id)) : n[d]++;\n                }\n              for (e = 0; e < n.length; ++e)\n                n[e] === 1 ? this.vertices[i[e]].isBorder = !0 : this.vertices[i[e]].isBorder = !1;\n            }\n          }, r.prototype.updateMesh = function(t) {\n            var e, n, i, o;\n            if (t === void 0 && (t = !1), !t) {\n              var a = [];\n              for (e = 0; e < this.triangles.length; ++e)\n                this.triangles[e].deleted || a.push(this.triangles[e]);\n              this.triangles = a;\n            }\n            for (e = 0; e < this.vertices.length; ++e)\n              this.vertices[e].triangleCount = 0, this.vertices[e].triangleStart = 0;\n            for (e = 0; e < this.triangles.length; ++e)\n              for (n = this.triangles[e], i = 0; i < 3; ++i)\n                (o = n.vertices[i]).triangleCount++;\n            var s = 0;\n            for (e = 0; e < this.vertices.length; ++e)\n              this.vertices[e].triangleStart = s, s += this.vertices[e].triangleCount, this.vertices[e].triangleCount = 0;\n            var d = new Array(3 * this.triangles.length);\n            for (e = 0; e < this.triangles.length; ++e)\n              for (n = this.triangles[e], i = 0; i < 3; ++i)\n                d[(o = n.vertices[i]).triangleStart + o.triangleCount] = new sm(i, e), o.triangleCount++;\n            this.references = d, t && this.identifyBorder();\n          }, r.prototype.vertexError = function(t, e) {\n            var n = e.x, i = e.y, o = e.z;\n            return t.data[0] * n * n + 2 * t.data[1] * n * i + 2 * t.data[2] * n * o + 2 * t.data[3] * n + t.data[4] * i * i + 2 * t.data[5] * i * o + 2 * t.data[6] * i + t.data[7] * o * o + 2 * t.data[8] * o + t.data[9];\n          }, r.prototype.calculateError = function(t, e, n) {\n            var i = t.q.add(e.q), o = t.isBorder && e.isBorder, a = 0, s = i.det(0, 1, 2, 1, 4, 5, 2, 5, 7);\n            if (s === 0 || o) {\n              var d = t.position.add(e.position).divide(new u.e(2, 2, 2)), p = this.vertexError(i, t.position), y = this.vertexError(i, e.position), P = this.vertexError(i, d);\n              (a = Math.min(p, y, P)) === p ? n && n.copyFrom(t.position) : a === y ? n && n.copyFrom(e.position) : n && n.copyFrom(d);\n            } else\n              n || (n = u.e.Zero()), n.x = -1 / s * i.det(1, 2, 3, 4, 5, 6, 5, 7, 8), n.y = 1 / s * i.det(0, 2, 3, 1, 5, 6, 2, 7, 8), n.z = -1 / s * i.det(0, 1, 3, 1, 4, 6, 2, 5, 8), a = this.vertexError(i, n);\n            return a;\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"simplificationQueue\", { get: function() {\n          if (!this._simplificationQueue) {\n            this._simplificationQueue = new ed();\n            var r = this._getComponent(ot.a.NAME_SIMPLIFICATIONQUEUE);\n            r || (r = new id(this), this._addComponent(r));\n          }\n          return this._simplificationQueue;\n        }, set: function(r) {\n          this._simplificationQueue = r;\n        }, enumerable: !0, configurable: !0 }), Ie.a.prototype.simplify = function(r, t, e, n) {\n          return t === void 0 && (t = !0), e === void 0 && (e = _o.QUADRATIC), this.getScene().simplificationQueue.addTask({ settings: r, parallelProcessing: t, mesh: this, simplificationType: e, successCallback: n }), this;\n        };\n        var id = function() {\n          function r(t) {\n            this.name = ot.a.NAME_SIMPLIFICATIONQUEUE, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraUpdateStage.registerStep(ot.a.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE, this, this._beforeCameraUpdate);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._beforeCameraUpdate = function() {\n            this.scene._simplificationQueue && !this.scene._simplificationQueue.running && this.scene._simplificationQueue.executeNext();\n          }, r;\n        }(), cm = f(149), lm = f(88);\n        Ie.a.prototype.thinInstanceAdd = function(r, t) {\n          t === void 0 && (t = !0), this._thinInstanceUpdateBufferSize(\"matrix\", Array.isArray(r) ? r.length : 1);\n          var e = this._thinInstanceDataStorage.instancesCount;\n          if (Array.isArray(r))\n            for (var n = 0; n < r.length; ++n)\n              this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, r[n], n === r.length - 1 && t);\n          else\n            this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, r, t);\n          return e;\n        }, Ie.a.prototype.thinInstanceAddSelf = function(r) {\n          return r === void 0 && (r = !0), this.thinInstanceAdd(u.a.IdentityReadOnly, r);\n        }, Ie.a.prototype.thinInstanceRegisterAttribute = function(r, t) {\n          this.removeVerticesData(r), this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.strides[r] = t, this._userThinInstanceBuffersStorage.sizes[r] = t * Math.max(32, this._thinInstanceDataStorage.instancesCount), this._userThinInstanceBuffersStorage.data[r] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[r]), this._userThinInstanceBuffersStorage.vertexBuffers[r] = new Oe.b(this.getEngine(), this._userThinInstanceBuffersStorage.data[r], r, !0, !1, t, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[r]);\n        }, Ie.a.prototype.thinInstanceSetMatrixAt = function(r, t, e) {\n          if (e === void 0 && (e = !0), !this._thinInstanceDataStorage.matrixData || r >= this._thinInstanceDataStorage.instancesCount)\n            return !1;\n          var n = this._thinInstanceDataStorage.matrixData;\n          return t.copyToArray(n, 16 * r), this._thinInstanceDataStorage.worldMatrices && (this._thinInstanceDataStorage.worldMatrices[r] = t), e && (this.thinInstanceBufferUpdated(\"matrix\"), this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1)), !0;\n        }, Ie.a.prototype.thinInstanceSetAttributeAt = function(r, t, e, n) {\n          return n === void 0 && (n = !0), !(!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[r] || t >= this._thinInstanceDataStorage.instancesCount) && (this._thinInstanceUpdateBufferSize(r, 0), this._userThinInstanceBuffersStorage.data[r].set(e, t * this._userThinInstanceBuffersStorage.strides[r]), n && this.thinInstanceBufferUpdated(r), !0);\n        }, Object.defineProperty(Ie.a.prototype, \"thinInstanceCount\", { get: function() {\n          return this._thinInstanceDataStorage.instancesCount;\n        }, set: function(r) {\n          var t, e;\n          r <= ((e = (t = this._thinInstanceDataStorage.matrixData) === null || t === void 0 ? void 0 : t.length) !== null && e !== void 0 ? e : 0) / 16 && (this._thinInstanceDataStorage.instancesCount = r);\n        }, enumerable: !0, configurable: !0 }), Ie.a.prototype.thinInstanceSetBuffer = function(r, t, e, n) {\n          var i, o;\n          if (e === void 0 && (e = 0), n === void 0 && (n = !1), e = e || 16, r === \"matrix\")\n            if ((i = this._thinInstanceDataStorage.matrixBuffer) === null || i === void 0 || i.dispose(), this._thinInstanceDataStorage.matrixBuffer = null, this._thinInstanceDataStorage.matrixBufferSize = t ? t.length : 32 * e, this._thinInstanceDataStorage.matrixData = t, this._thinInstanceDataStorage.worldMatrices = null, t !== null) {\n              this._thinInstanceDataStorage.instancesCount = t.length / e;\n              var a = new Oe.a(this.getEngine(), t, !n, e, !1, !0);\n              this._thinInstanceDataStorage.matrixBuffer = a, this.setVerticesBuffer(a.createVertexBuffer(\"world0\", 0, 4)), this.setVerticesBuffer(a.createVertexBuffer(\"world1\", 4, 4)), this.setVerticesBuffer(a.createVertexBuffer(\"world2\", 8, 4)), this.setVerticesBuffer(a.createVertexBuffer(\"world3\", 12, 4)), this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1);\n            } else\n              this._thinInstanceDataStorage.instancesCount = 0, this.doNotSyncBoundingInfo || this.refreshBoundingInfo(!0);\n          else\n            t === null ? !((o = this._userThinInstanceBuffersStorage) === null || o === void 0) && o.data[r] && (this.removeVerticesData(r), delete this._userThinInstanceBuffersStorage.data[r], delete this._userThinInstanceBuffersStorage.strides[r], delete this._userThinInstanceBuffersStorage.sizes[r], delete this._userThinInstanceBuffersStorage.vertexBuffers[r]) : (this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.data[r] = t, this._userThinInstanceBuffersStorage.strides[r] = e, this._userThinInstanceBuffersStorage.sizes[r] = t.length, this._userThinInstanceBuffersStorage.vertexBuffers[r] = new Oe.b(this.getEngine(), t, r, !n, !1, e, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[r]));\n        }, Ie.a.prototype.thinInstanceBufferUpdated = function(r) {\n          var t;\n          r === \"matrix\" ? this._thinInstanceDataStorage.matrixBuffer && this._thinInstanceDataStorage.matrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount) : !((t = this._userThinInstanceBuffersStorage) === null || t === void 0) && t.vertexBuffers[r] && this._userThinInstanceBuffersStorage.vertexBuffers[r].updateDirectly(this._userThinInstanceBuffersStorage.data[r], 0);\n        }, Ie.a.prototype.thinInstancePartialBufferUpdate = function(r, t, e) {\n          var n;\n          r === \"matrix\" ? this._thinInstanceDataStorage.matrixBuffer && this._thinInstanceDataStorage.matrixBuffer.updateDirectly(t, e) : !((n = this._userThinInstanceBuffersStorage) === null || n === void 0) && n.vertexBuffers[r] && this._userThinInstanceBuffersStorage.vertexBuffers[r].updateDirectly(t, e);\n        }, Ie.a.prototype.thinInstanceGetWorldMatrices = function() {\n          if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer)\n            return [];\n          var r = this._thinInstanceDataStorage.matrixData;\n          if (!this._thinInstanceDataStorage.worldMatrices) {\n            this._thinInstanceDataStorage.worldMatrices = new Array();\n            for (var t = 0; t < this._thinInstanceDataStorage.instancesCount; ++t)\n              this._thinInstanceDataStorage.worldMatrices[t] = u.a.FromArray(r, 16 * t);\n          }\n          return this._thinInstanceDataStorage.worldMatrices;\n        }, Ie.a.prototype.thinInstanceRefreshBoundingInfo = function(r) {\n          if (r === void 0 && (r = !1), this._thinInstanceDataStorage.matrixData && this._thinInstanceDataStorage.matrixBuffer) {\n            var t = this._thinInstanceDataStorage.boundingVectors;\n            r && (t.length = 0, this.refreshBoundingInfo(!0));\n            var e = this.getBoundingInfo(), n = this._thinInstanceDataStorage.matrixData;\n            if (t.length === 0)\n              for (var i = 0; i < e.boundingBox.vectors.length; ++i)\n                t.push(e.boundingBox.vectors[i].clone());\n            u.c.Vector3[0].setAll(Number.POSITIVE_INFINITY), u.c.Vector3[1].setAll(Number.NEGATIVE_INFINITY);\n            for (var o = 0; o < this._thinInstanceDataStorage.instancesCount; ++o)\n              for (u.a.FromArrayToRef(n, 16 * o, u.c.Matrix[0]), i = 0; i < t.length; ++i)\n                u.e.TransformCoordinatesToRef(t[i], u.c.Matrix[0], u.c.Vector3[2]), u.c.Vector3[0].minimizeInPlace(u.c.Vector3[2]), u.c.Vector3[1].maximizeInPlace(u.c.Vector3[2]);\n            e.reConstruct(u.c.Vector3[0], u.c.Vector3[1]), this._updateBoundingInfo();\n          }\n        }, Ie.a.prototype._thinInstanceUpdateBufferSize = function(r, t) {\n          var e, n;\n          t === void 0 && (t = 1);\n          var i = r === \"matrix\";\n          if (i || this._userThinInstanceBuffersStorage && this._userThinInstanceBuffersStorage.strides[r]) {\n            for (var o = i ? 16 : this._userThinInstanceBuffersStorage.strides[r], a = i ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[r], s = i ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[r], d = (this._thinInstanceDataStorage.instancesCount + t) * o, p = a; p < d; )\n              p *= 2;\n            if (!s || a != p) {\n              if (s) {\n                var y = new Float32Array(p);\n                y.set(s, 0), s = y;\n              } else\n                s = new Float32Array(p);\n              if (i) {\n                (e = this._thinInstanceDataStorage.matrixBuffer) === null || e === void 0 || e.dispose();\n                var P = new Oe.a(this.getEngine(), s, !0, o, !1, !0);\n                this._thinInstanceDataStorage.matrixBuffer = P, this._thinInstanceDataStorage.matrixData = s, this._thinInstanceDataStorage.matrixBufferSize = p, this.setVerticesBuffer(P.createVertexBuffer(\"world0\", 0, 4)), this.setVerticesBuffer(P.createVertexBuffer(\"world1\", 4, 4)), this.setVerticesBuffer(P.createVertexBuffer(\"world2\", 8, 4)), this.setVerticesBuffer(P.createVertexBuffer(\"world3\", 12, 4));\n              } else\n                (n = this._userThinInstanceBuffersStorage.vertexBuffers[r]) === null || n === void 0 || n.dispose(), this._userThinInstanceBuffersStorage.data[r] = s, this._userThinInstanceBuffersStorage.sizes[r] = p, this._userThinInstanceBuffersStorage.vertexBuffers[r] = new Oe.b(this.getEngine(), s, r, !0, !1, o, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[r]);\n            }\n          }\n        }, Ie.a.prototype._thinInstanceInitializeUserStorage = function() {\n          this._userThinInstanceBuffersStorage || (this._userThinInstanceBuffersStorage = { data: {}, sizes: {}, vertexBuffers: {}, strides: {} });\n        }, Ie.a.prototype._disposeThinInstanceSpecificData = function() {\n          var r;\n          !((r = this._thinInstanceDataStorage) === null || r === void 0) && r.matrixBuffer && (this._thinInstanceDataStorage.matrixBuffer.dispose(), this._thinInstanceDataStorage.matrixBuffer = null);\n        };\n        var um = function() {\n          function r(t) {\n            t === void 0 && (t = Recast), this.bjsRECAST = {}, this.name = \"RecastJSPlugin\", this._maximumSubStepCount = 10, this._timeStep = 1 / 60, typeof t == \"function\" ? t(this.bjsRECAST) : this.bjsRECAST = t, this.isSupported() ? this.setTimeStep() : l.a.Error(\"RecastJS is not available. Please make sure you included the js file.\");\n          }\n          return r.prototype.setTimeStep = function(t) {\n            t === void 0 && (t = 1 / 60), this._timeStep = t;\n          }, r.prototype.getTimeStep = function() {\n            return this._timeStep;\n          }, r.prototype.setMaximumSubStepCount = function(t) {\n            t === void 0 && (t = 10), this._maximumSubStepCount = t;\n          }, r.prototype.getMaximumSubStepCount = function() {\n            return this._maximumSubStepCount;\n          }, r.prototype.createNavMesh = function(t, e) {\n            var n, i, o, a = new this.bjsRECAST.rcConfig();\n            a.cs = e.cs, a.ch = e.ch, a.borderSize = 0, a.tileSize = 0, a.walkableSlopeAngle = e.walkableSlopeAngle, a.walkableHeight = e.walkableHeight, a.walkableClimb = e.walkableClimb, a.walkableRadius = e.walkableRadius, a.maxEdgeLen = e.maxEdgeLen, a.maxSimplificationError = e.maxSimplificationError, a.minRegionArea = e.minRegionArea, a.mergeRegionArea = e.mergeRegionArea, a.maxVertsPerPoly = e.maxVertsPerPoly, a.detailSampleDist = e.detailSampleDist, a.detailSampleMaxError = e.detailSampleMaxError, this.navMesh = new this.bjsRECAST.NavMesh();\n            var s = [], d = [], p = 0;\n            for (n = 0; n < t.length; n++)\n              if (t[n]) {\n                var y = t[n], P = y.getIndices();\n                if (!P)\n                  continue;\n                var R = y.getVerticesData(Oe.b.PositionKind, !1, !1);\n                if (!R)\n                  continue;\n                var B = y.computeWorldMatrix(!0);\n                for (i = 0; i < P.length; i++)\n                  s.push(P[i] + p);\n                var F = u.e.Zero(), z = u.e.Zero();\n                for (o = 0; o < R.length; o += 3)\n                  u.e.FromArrayToRef(R, o, z), u.e.TransformCoordinatesToRef(z, B, F), d.push(F.x, F.y, F.z);\n                p += R.length / 3;\n              }\n            this.navMesh.build(d, p, s, s.length, a);\n          }, r.prototype.createDebugNavMesh = function(t) {\n            var e, n, i = this.navMesh.getDebugNavMesh(), o = i.getTriangleCount(), a = [], s = [];\n            for (e = 0; e < 3 * o; e++)\n              a.push(e);\n            for (e = 0; e < o; e++)\n              for (n = 0; n < 3; n++) {\n                var d = i.getTriangle(e).getPoint(n);\n                s.push(d.x, d.y, d.z);\n              }\n            var p = new Ie.a(\"NavMeshDebug\", t), y = new ht.a();\n            return y.indices = a, y.positions = s, y.applyToMesh(p, !1), p;\n          }, r.prototype.getClosestPoint = function(t) {\n            var e = new this.bjsRECAST.Vec3(t.x, t.y, t.z), n = this.navMesh.getClosestPoint(e);\n            return new u.e(n.x, n.y, n.z);\n          }, r.prototype.getClosestPointToRef = function(t, e) {\n            var n = new this.bjsRECAST.Vec3(t.x, t.y, t.z), i = this.navMesh.getClosestPoint(n);\n            e.set(i.x, i.y, i.z);\n          }, r.prototype.getRandomPointAround = function(t, e) {\n            var n = new this.bjsRECAST.Vec3(t.x, t.y, t.z), i = this.navMesh.getRandomPointAround(n, e);\n            return new u.e(i.x, i.y, i.z);\n          }, r.prototype.getRandomPointAroundToRef = function(t, e, n) {\n            var i = new this.bjsRECAST.Vec3(t.x, t.y, t.z), o = this.navMesh.getRandomPointAround(i, e);\n            n.set(o.x, o.y, o.z);\n          }, r.prototype.moveAlong = function(t, e) {\n            var n = new this.bjsRECAST.Vec3(t.x, t.y, t.z), i = new this.bjsRECAST.Vec3(e.x, e.y, e.z), o = this.navMesh.moveAlong(n, i);\n            return new u.e(o.x, o.y, o.z);\n          }, r.prototype.moveAlongToRef = function(t, e, n) {\n            var i = new this.bjsRECAST.Vec3(t.x, t.y, t.z), o = new this.bjsRECAST.Vec3(e.x, e.y, e.z), a = this.navMesh.moveAlong(i, o);\n            n.set(a.x, a.y, a.z);\n          }, r.prototype.computePath = function(t, e) {\n            var n, i = new this.bjsRECAST.Vec3(t.x, t.y, t.z), o = new this.bjsRECAST.Vec3(e.x, e.y, e.z), a = this.navMesh.computePath(i, o), s = a.getPointCount(), d = [];\n            for (n = 0; n < s; n++) {\n              var p = a.getPoint(n);\n              d.push(new u.e(p.x, p.y, p.z));\n            }\n            return d;\n          }, r.prototype.createCrowd = function(t, e, n) {\n            return new rd(this, t, e, n);\n          }, r.prototype.setDefaultQueryExtent = function(t) {\n            var e = new this.bjsRECAST.Vec3(t.x, t.y, t.z);\n            this.navMesh.setDefaultQueryExtent(e);\n          }, r.prototype.getDefaultQueryExtent = function() {\n            var t = this.navMesh.getDefaultQueryExtent();\n            return new u.e(t.x, t.y, t.z);\n          }, r.prototype.buildFromNavmeshData = function(t) {\n            var e = t.length * t.BYTES_PER_ELEMENT, n = this.bjsRECAST._malloc(e), i = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, n, e);\n            i.set(t);\n            var o = new this.bjsRECAST.NavmeshData();\n            o.dataPointer = i.byteOffset, o.size = t.length, this.navMesh = new this.bjsRECAST.NavMesh(), this.navMesh.buildFromNavmeshData(o), this.bjsRECAST._free(i.byteOffset);\n          }, r.prototype.getNavmeshData = function() {\n            var t = this.navMesh.getNavmeshData(), e = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, t.dataPointer, t.size), n = new Uint8Array(t.size);\n            return n.set(e), this.navMesh.freeNavmeshData(t), n;\n          }, r.prototype.getDefaultQueryExtentToRef = function(t) {\n            var e = this.navMesh.getDefaultQueryExtent();\n            t.set(e.x, e.y, e.z);\n          }, r.prototype.dispose = function() {\n          }, r.prototype.isSupported = function() {\n            return this.bjsRECAST !== void 0;\n          }, r;\n        }(), rd = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            this.recastCrowd = {}, this.transforms = new Array(), this.agents = new Array(), this._onBeforeAnimationsObserver = null, this.bjsRECASTPlugin = t, this.recastCrowd = new this.bjsRECASTPlugin.bjsRECAST.Crowd(e, n, this.bjsRECASTPlugin.navMesh.getNavMesh()), this._scene = i, this._onBeforeAnimationsObserver = i.onBeforeAnimationsObservable.add(function() {\n              o.update(1e-3 * i.getEngine().getDeltaTime());\n            });\n          }\n          return r.prototype.addAgent = function(t, e, n) {\n            var i = new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams();\n            i.radius = e.radius, i.height = e.height, i.maxAcceleration = e.maxAcceleration, i.maxSpeed = e.maxSpeed, i.collisionQueryRange = e.collisionQueryRange, i.pathOptimizationRange = e.pathOptimizationRange, i.separationWeight = e.separationWeight, i.updateFlags = 7, i.obstacleAvoidanceType = 0, i.queryFilterType = 0, i.userData = 0;\n            var o = this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x, t.y, t.z), i);\n            return this.transforms.push(n), this.agents.push(o), o;\n          }, r.prototype.getAgentPosition = function(t) {\n            var e = this.recastCrowd.getAgentPosition(t);\n            return new u.e(e.x, e.y, e.z);\n          }, r.prototype.getAgentPositionToRef = function(t, e) {\n            var n = this.recastCrowd.getAgentPosition(t);\n            e.set(n.x, n.y, n.z);\n          }, r.prototype.getAgentVelocity = function(t) {\n            var e = this.recastCrowd.getAgentVelocity(t);\n            return new u.e(e.x, e.y, e.z);\n          }, r.prototype.getAgentVelocityToRef = function(t, e) {\n            var n = this.recastCrowd.getAgentVelocity(t);\n            e.set(n.x, n.y, n.z);\n          }, r.prototype.getAgentNextTargetPath = function(t) {\n            var e = this.recastCrowd.getAgentNextTargetPath(t);\n            return new u.e(e.x, e.y, e.z);\n          }, r.prototype.getAgentNextTargetPathToRef = function(t, e) {\n            var n = this.recastCrowd.getAgentNextTargetPath(t);\n            e.set(n.x, n.y, n.z);\n          }, r.prototype.getAgentState = function(t) {\n            return this.recastCrowd.getAgentState(t);\n          }, r.prototype.overOffmeshConnection = function(t) {\n            return this.recastCrowd.overOffmeshConnection(t);\n          }, r.prototype.agentGoto = function(t, e) {\n            this.recastCrowd.agentGoto(t, new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x, e.y, e.z));\n          }, r.prototype.agentTeleport = function(t, e) {\n            this.recastCrowd.agentTeleport(t, new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x, e.y, e.z));\n          }, r.prototype.updateAgentParameters = function(t, e) {\n            var n = this.recastCrowd.getAgentParameters(t);\n            e.radius !== void 0 && (n.radius = e.radius), e.height !== void 0 && (n.height = e.height), e.maxAcceleration !== void 0 && (n.maxAcceleration = e.maxAcceleration), e.maxSpeed !== void 0 && (n.maxSpeed = e.maxSpeed), e.collisionQueryRange !== void 0 && (n.collisionQueryRange = e.collisionQueryRange), e.pathOptimizationRange !== void 0 && (n.pathOptimizationRange = e.pathOptimizationRange), e.separationWeight !== void 0 && (n.separationWeight = e.separationWeight), this.recastCrowd.setAgentParameters(t, n);\n          }, r.prototype.removeAgent = function(t) {\n            this.recastCrowd.removeAgent(t);\n            var e = this.agents.indexOf(t);\n            e > -1 && (this.agents.splice(e, 1), this.transforms.splice(e, 1));\n          }, r.prototype.getAgents = function() {\n            return this.agents;\n          }, r.prototype.update = function(t) {\n            var e = this.bjsRECASTPlugin.getTimeStep(), n = this.bjsRECASTPlugin.getMaximumSubStepCount();\n            if (e <= Vt.a)\n              this.recastCrowd.update(t);\n            else {\n              var i = t / e;\n              n && i > n && (i = n), i < 1 && (i = 1);\n              for (var o = 0; o < i; o++)\n                this.recastCrowd.update(e);\n            }\n            for (var a = 0; a < this.agents.length; a++)\n              this.transforms[a].position = this.getAgentPosition(this.agents[a]);\n          }, r.prototype.setDefaultQueryExtent = function(t) {\n            var e = new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x, t.y, t.z);\n            this.recastCrowd.setDefaultQueryExtent(e);\n          }, r.prototype.getDefaultQueryExtent = function() {\n            var t = this.recastCrowd.getDefaultQueryExtent();\n            return new u.e(t.x, t.y, t.z);\n          }, r.prototype.getDefaultQueryExtentToRef = function(t) {\n            var e = this.recastCrowd.getDefaultQueryExtent();\n            t.set(e.x, e.y, e.z);\n          }, r.prototype.dispose = function() {\n            this.recastCrowd.destroy(), this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null;\n          }, r;\n        }();\n        Ue.a.OfflineProviderFactory = function(r, t, e) {\n          return e === void 0 && (e = !1), new od(r, t, e);\n        };\n        var Rr, od = function() {\n          function r(t, e, n) {\n            var i = this;\n            n === void 0 && (n = !1), this._idbFactory = typeof window < \"u\" ? window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB : indexedDB, this._callbackManifestChecked = e, this._currentSceneUrl = r._ReturnFullUrlLocation(t), this._db = null, this._enableSceneOffline = !1, this._enableTexturesOffline = !1, this._manifestVersionFound = 0, this._mustUpdateRessources = !1, this._hasReachedQuota = !1, r.IDBStorageEnabled ? n ? (this._enableSceneOffline = !0, this._enableTexturesOffline = !0, this._manifestVersionFound = 1, Xe.b.SetImmediate(function() {\n              i._callbackManifestChecked(!0);\n            })) : this._checkManifestFile() : this._callbackManifestChecked(!0);\n          }\n          return Object.defineProperty(r.prototype, \"enableSceneOffline\", { get: function() {\n            return this._enableSceneOffline;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"enableTexturesOffline\", { get: function() {\n            return this._enableTexturesOffline;\n          }, enumerable: !1, configurable: !0 }), r.prototype._checkManifestFile = function() {\n            var t = this, e = function() {\n              t._enableSceneOffline = !1, t._enableTexturesOffline = !1, t._callbackManifestChecked(!1);\n            }, n = !1, i = this._currentSceneUrl + \".manifest\", o = new re.a();\n            navigator.onLine && (n = !0, i = i + (i.match(/\\?/) == null ? \"?\" : \"&\") + Date.now()), o.open(\"GET\", i), o.addEventListener(\"load\", function() {\n              if (o.status === 200 || r._ValidateXHRData(o, 1))\n                try {\n                  var a = JSON.parse(o.response);\n                  t._enableSceneOffline = a.enableSceneOffline, t._enableTexturesOffline = a.enableTexturesOffline && r.IsUASupportingBlobStorage, a.version && !isNaN(parseInt(a.version)) && (t._manifestVersionFound = a.version), t._callbackManifestChecked && t._callbackManifestChecked(!0);\n                } catch {\n                  e();\n                }\n              else\n                e();\n            }, !1), o.addEventListener(\"error\", function() {\n              if (n) {\n                n = !1;\n                var a = t._currentSceneUrl + \".manifest\";\n                o.open(\"GET\", a), o.send();\n              } else\n                e();\n            }, !1);\n            try {\n              o.send();\n            } catch {\n              l.a.Error(\"Error on XHR send request.\"), this._callbackManifestChecked(!1);\n            }\n          }, r.prototype.open = function(t, e) {\n            var n = this, i = function() {\n              n._isSupported = !1, e && e();\n            };\n            if (this._idbFactory && (this._enableSceneOffline || this._enableTexturesOffline))\n              if (this._db)\n                t && t();\n              else {\n                this._hasReachedQuota = !1, this._isSupported = !0;\n                var o = this._idbFactory.open(\"babylonjs\", 1);\n                o.onerror = function() {\n                  i();\n                }, o.onblocked = function() {\n                  l.a.Error(\"IDB request blocked. Please reload the page.\"), i();\n                }, o.onsuccess = function() {\n                  n._db = o.result, t();\n                }, o.onupgradeneeded = function(a) {\n                  if (n._db = a.target.result, n._db)\n                    try {\n                      n._db.createObjectStore(\"scenes\", { keyPath: \"sceneUrl\" }), n._db.createObjectStore(\"versions\", { keyPath: \"sceneUrl\" }), n._db.createObjectStore(\"textures\", { keyPath: \"textureUrl\" });\n                    } catch (s) {\n                      l.a.Error(\"Error while creating object stores. Exception: \" + s.message), i();\n                    }\n                };\n              }\n            else\n              this._isSupported = !1, e && e();\n          }, r.prototype.loadImage = function(t, e) {\n            var n = this, i = r._ReturnFullUrlLocation(t), o = function() {\n              n._hasReachedQuota || n._db === null ? e.src = t : n._saveImageIntoDBAsync(i, e);\n            };\n            this._mustUpdateRessources ? o() : this._loadImageFromDBAsync(i, e, o);\n          }, r.prototype._loadImageFromDBAsync = function(t, e, n) {\n            if (this._isSupported && this._db !== null) {\n              var i, o = this._db.transaction([\"textures\"]);\n              o.onabort = function() {\n                e.src = t;\n              }, o.oncomplete = function() {\n                var s;\n                if (i) {\n                  var d = window.URL || window.webkitURL;\n                  s = d.createObjectURL(i.data), e.onerror = function() {\n                    l.a.Error(\"Error loading image from blob URL: \" + s + \" switching back to web url: \" + t), e.src = t;\n                  }, e.src = s;\n                } else\n                  n();\n              };\n              var a = o.objectStore(\"textures\").get(t);\n              a.onsuccess = function(s) {\n                i = s.target.result;\n              }, a.onerror = function() {\n                l.a.Error(\"Error loading texture \" + t + \" from DB.\"), e.src = t;\n              };\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\"), e.src = t;\n          }, r.prototype._saveImageIntoDBAsync = function(t, e) {\n            var n = this;\n            if (this._isSupported) {\n              var i = function() {\n                var s;\n                if (o) {\n                  var d = window.URL || window.webkitURL;\n                  try {\n                    s = d.createObjectURL(o);\n                  } catch {\n                    s = d.createObjectURL(o);\n                  }\n                }\n                s && (e.src = s);\n              };\n              if (r.IsUASupportingBlobStorage) {\n                var o, a = new re.a();\n                a.open(\"GET\", t), a.responseType = \"blob\", a.addEventListener(\"load\", function() {\n                  if (a.status === 200 && n._db) {\n                    o = a.response;\n                    var s = n._db.transaction([\"textures\"], \"readwrite\");\n                    s.onabort = function(y) {\n                      try {\n                        var P = (y.srcElement || y.target).error;\n                        P && P.name === \"QuotaExceededError\" && (n._hasReachedQuota = !0);\n                      } catch {\n                      }\n                      i();\n                    }, s.oncomplete = function() {\n                      i();\n                    };\n                    var d = { textureUrl: t, data: o };\n                    try {\n                      var p = s.objectStore(\"textures\").put(d);\n                      p.onsuccess = function() {\n                      }, p.onerror = function() {\n                        i();\n                      };\n                    } catch (y) {\n                      y.code === 25 && (r.IsUASupportingBlobStorage = !1, n._enableTexturesOffline = !1), e.src = t;\n                    }\n                  } else\n                    e.src = t;\n                }, !1), a.addEventListener(\"error\", function() {\n                  l.a.Error(\"Error in XHR request in BABYLON.Database.\"), e.src = t;\n                }, !1), a.send();\n              } else\n                e.src = t;\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\"), e.src = t;\n          }, r.prototype._checkVersionFromDB = function(t, e) {\n            var n = this;\n            this._loadVersionFromDBAsync(t, e, function() {\n              n._saveVersionIntoDBAsync(t, e);\n            });\n          }, r.prototype._loadVersionFromDBAsync = function(t, e, n) {\n            var i, o = this;\n            if (this._isSupported && this._db)\n              try {\n                var a = this._db.transaction([\"versions\"]);\n                a.oncomplete = function() {\n                  i ? o._manifestVersionFound !== i.data ? (o._mustUpdateRessources = !0, n()) : e(i.data) : (o._mustUpdateRessources = !0, n());\n                }, a.onabort = function() {\n                  e(-1);\n                };\n                var s = a.objectStore(\"versions\").get(t);\n                s.onsuccess = function(d) {\n                  i = d.target.result;\n                }, s.onerror = function() {\n                  l.a.Error(\"Error loading version for scene \" + t + \" from DB.\"), e(-1);\n                };\n              } catch (d) {\n                l.a.Error(\"Error while accessing 'versions' object store (READ OP). Exception: \" + d.message), e(-1);\n              }\n            else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\"), e(-1);\n          }, r.prototype._saveVersionIntoDBAsync = function(t, e) {\n            var n = this;\n            if (this._isSupported && !this._hasReachedQuota && this._db)\n              try {\n                var i = this._db.transaction([\"versions\"], \"readwrite\");\n                i.onabort = function(s) {\n                  try {\n                    var d = s.srcElement.error;\n                    d && d.name === \"QuotaExceededError\" && (n._hasReachedQuota = !0);\n                  } catch {\n                  }\n                  e(-1);\n                }, i.oncomplete = function() {\n                  e(n._manifestVersionFound);\n                };\n                var o = { sceneUrl: t, data: this._manifestVersionFound }, a = i.objectStore(\"versions\").put(o);\n                a.onsuccess = function() {\n                }, a.onerror = function() {\n                  l.a.Error(\"Error in DB add version request in BABYLON.Database.\");\n                };\n              } catch (s) {\n                l.a.Error(\"Error while accessing 'versions' object store (WRITE OP). Exception: \" + s.message), e(-1);\n              }\n            else\n              e(-1);\n          }, r.prototype.loadFile = function(t, e, n, i, o) {\n            var a = this, s = r._ReturnFullUrlLocation(t), d = function() {\n              a._saveFileAsync(s, e, n, o, i);\n            };\n            this._checkVersionFromDB(s, function(p) {\n              p !== -1 ? a._mustUpdateRessources ? a._saveFileAsync(s, e, n, o, i) : a._loadFileAsync(s, e, d) : i && i();\n            });\n          }, r.prototype._loadFileAsync = function(t, e, n) {\n            if (this._isSupported && this._db) {\n              var i, o;\n              i = t.indexOf(\".babylon\") !== -1 ? \"scenes\" : \"textures\";\n              var a = this._db.transaction([i]);\n              a.oncomplete = function() {\n                o ? e(o.data) : n();\n              }, a.onabort = function() {\n                n();\n              };\n              var s = a.objectStore(i).get(t);\n              s.onsuccess = function(d) {\n                o = d.target.result;\n              }, s.onerror = function() {\n                l.a.Error(\"Error loading file \" + t + \" from DB.\"), n();\n              };\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\"), e();\n          }, r.prototype._saveFileAsync = function(t, e, n, i, o) {\n            var a = this;\n            if (this._isSupported) {\n              var s;\n              s = t.indexOf(\".babylon\") !== -1 ? \"scenes\" : \"textures\";\n              var d, p = new re.a();\n              p.open(\"GET\", t + \"?\" + Date.now()), i && (p.responseType = \"arraybuffer\"), n && (p.onprogress = n), p.addEventListener(\"load\", function() {\n                if (p.status === 200 || p.status < 400 && r._ValidateXHRData(p, i ? 6 : 1))\n                  if (d = i ? p.response : p.responseText, !a._hasReachedQuota && a._db) {\n                    var y, P = a._db.transaction([s], \"readwrite\");\n                    P.onabort = function(B) {\n                      try {\n                        var F = B.srcElement.error;\n                        F && F.name === \"QuotaExceededError\" && (a._hasReachedQuota = !0);\n                      } catch {\n                      }\n                      e(d);\n                    }, P.oncomplete = function() {\n                      e(d);\n                    }, y = s === \"scenes\" ? { sceneUrl: t, data: d, version: a._manifestVersionFound } : { textureUrl: t, data: d };\n                    try {\n                      var R = P.objectStore(s).put(y);\n                      R.onsuccess = function() {\n                      }, R.onerror = function() {\n                        l.a.Error(\"Error in DB add file request in BABYLON.Database.\");\n                      };\n                    } catch {\n                      e(d);\n                    }\n                  } else\n                    e(d);\n                else\n                  p.status >= 400 && o ? o(p) : e();\n              }, !1), p.addEventListener(\"error\", function() {\n                l.a.Error(\"error on XHR request.\"), e();\n              }, !1), p.send();\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\"), e();\n          }, r._ValidateXHRData = function(t, e) {\n            e === void 0 && (e = 7);\n            try {\n              if (1 & e) {\n                if (t.responseText && t.responseText.length > 0)\n                  return !0;\n                if (e === 1)\n                  return !1;\n              }\n              if (2 & e) {\n                var n = ta.GetTGAHeader(t.response);\n                if (n.width && n.height && n.width > 0 && n.height > 0)\n                  return !0;\n                if (e === 2)\n                  return !1;\n              }\n              if (4 & e) {\n                var i = new Uint8Array(t.response, 0, 3);\n                return i[0] === 68 && i[1] === 68 && i[2] === 83;\n              }\n            } catch {\n            }\n            return !1;\n          }, r.IsUASupportingBlobStorage = !0, r.IDBStorageEnabled = !1, r._ParseURL = function(t) {\n            document.createElement(\"a\").href = t;\n            var e = t.substring(0, t.lastIndexOf(\"#\")), n = t.substring(e.lastIndexOf(\"/\") + 1, t.length);\n            return t.substring(0, t.indexOf(n, 0));\n          }, r._ReturnFullUrlLocation = function(t) {\n            return t.indexOf(\"http:/\") === -1 && t.indexOf(\"https:/\") === -1 && typeof window < \"u\" ? r._ParseURL(window.location.href) + t : t;\n          }, r;\n        }(), gc = function() {\n          function r(t, e, n) {\n            this.gradient = t, this.color1 = e, this.color2 = n;\n          }\n          return r.prototype.getColorToRef = function(t) {\n            this.color2 ? I.b.LerpToRef(this.color1, this.color2, Math.random(), t) : t.copyFrom(this.color1);\n          }, r;\n        }(), ad = function(r, t) {\n          this.gradient = r, this.color = t;\n        }, vc = function() {\n          function r(t, e, n) {\n            this.gradient = t, this.factor1 = e, this.factor2 = n;\n          }\n          return r.prototype.getFactor = function() {\n            return this.factor2 === void 0 || this.factor2 === this.factor1 ? this.factor1 : this.factor1 + (this.factor2 - this.factor1) * Math.random();\n          }, r;\n        }(), On = function() {\n          function r() {\n          }\n          return r.GetCurrentGradient = function(t, e, n) {\n            if (e[0].gradient > t)\n              n(e[0], e[0], 1);\n            else {\n              for (var i = 0; i < e.length - 1; i++) {\n                var o = e[i], a = e[i + 1];\n                if (t >= o.gradient && t <= a.gradient)\n                  return void n(o, a, (t - o.gradient) / (a.gradient - o.gradient));\n              }\n              var s = e.length - 1;\n              n(e[s], e[s], 1);\n            }\n          }, r;\n        }(), sd = function() {\n          function r(t) {\n            this.particleSystem = t, this.position = u.e.Zero(), this.direction = u.e.Zero(), this.color = new I.b(0, 0, 0, 0), this.colorStep = new I.b(0, 0, 0, 0), this.lifeTime = 1, this.age = 0, this.size = 0, this.scale = new u.d(1, 1), this.angle = 0, this.angularSpeed = 0, this.cellIndex = 0, this._attachedSubEmitters = null, this._currentColor1 = new I.b(0, 0, 0, 0), this._currentColor2 = new I.b(0, 0, 0, 0), this._currentSize1 = 0, this._currentSize2 = 0, this._currentAngularSpeed1 = 0, this._currentAngularSpeed2 = 0, this._currentVelocity1 = 0, this._currentVelocity2 = 0, this._currentLimitVelocity1 = 0, this._currentLimitVelocity2 = 0, this._currentDrag1 = 0, this._currentDrag2 = 0, this.id = r._Count++, this.particleSystem.isAnimationSheetEnabled && this.updateCellInfoFromSystem();\n          }\n          return r.prototype.updateCellInfoFromSystem = function() {\n            this.cellIndex = this.particleSystem.startSpriteCellID;\n          }, r.prototype.updateCellIndex = function() {\n            var t = this.age, e = this.particleSystem.spriteCellChangeSpeed;\n            this.particleSystem.spriteRandomStartCell && (this._randomCellOffset === void 0 && (this._randomCellOffset = Math.random() * this.lifeTime), e === 0 ? (e = 1, t = this._randomCellOffset) : t += this._randomCellOffset);\n            var n = this._initialEndSpriteCellID - this._initialStartSpriteCellID, i = $.a.Clamp(t * e % this.lifeTime / this.lifeTime);\n            this.cellIndex = this._initialStartSpriteCellID + i * n | 0;\n          }, r.prototype._inheritParticleInfoToSubEmitter = function(t) {\n            if (t.particleSystem.emitter.position) {\n              var e = t.particleSystem.emitter;\n              if (e.position.copyFrom(this.position), t.inheritDirection) {\n                var n = u.c.Vector3[0];\n                this.direction.normalizeToRef(n), e.setDirection(n, 0, Math.PI / 2);\n              }\n            } else\n              t.particleSystem.emitter.copyFrom(this.position);\n            this.direction.scaleToRef(t.inheritedVelocityAmount / 2, u.c.Vector3[0]), t.particleSystem._inheritedVelocityOffset.copyFrom(u.c.Vector3[0]);\n          }, r.prototype._inheritParticleInfoToSubEmitters = function() {\n            var t = this;\n            this._attachedSubEmitters && this._attachedSubEmitters.length > 0 && this._attachedSubEmitters.forEach(function(e) {\n              t._inheritParticleInfoToSubEmitter(e);\n            });\n          }, r.prototype._reset = function() {\n            this.age = 0, this.id = r._Count++, this._currentColorGradient = null, this._currentSizeGradient = null, this._currentAngularSpeedGradient = null, this._currentVelocityGradient = null, this._currentLimitVelocityGradient = null, this._currentDragGradient = null, this.cellIndex = this.particleSystem.startSpriteCellID, this._randomCellOffset = void 0;\n          }, r.prototype.copyTo = function(t) {\n            t.position.copyFrom(this.position), this._initialDirection ? t._initialDirection ? t._initialDirection.copyFrom(this._initialDirection) : t._initialDirection = this._initialDirection.clone() : t._initialDirection = null, t.direction.copyFrom(this.direction), this._localPosition && (t._localPosition ? t._localPosition.copyFrom(this._localPosition) : t._localPosition = this._localPosition.clone()), t.color.copyFrom(this.color), t.colorStep.copyFrom(this.colorStep), t.lifeTime = this.lifeTime, t.age = this.age, t._randomCellOffset = this._randomCellOffset, t.size = this.size, t.scale.copyFrom(this.scale), t.angle = this.angle, t.angularSpeed = this.angularSpeed, t.particleSystem = this.particleSystem, t.cellIndex = this.cellIndex, t.id = this.id, t._attachedSubEmitters = this._attachedSubEmitters, this._currentColorGradient && (t._currentColorGradient = this._currentColorGradient, t._currentColor1.copyFrom(this._currentColor1), t._currentColor2.copyFrom(this._currentColor2)), this._currentSizeGradient && (t._currentSizeGradient = this._currentSizeGradient, t._currentSize1 = this._currentSize1, t._currentSize2 = this._currentSize2), this._currentAngularSpeedGradient && (t._currentAngularSpeedGradient = this._currentAngularSpeedGradient, t._currentAngularSpeed1 = this._currentAngularSpeed1, t._currentAngularSpeed2 = this._currentAngularSpeed2), this._currentVelocityGradient && (t._currentVelocityGradient = this._currentVelocityGradient, t._currentVelocity1 = this._currentVelocity1, t._currentVelocity2 = this._currentVelocity2), this._currentLimitVelocityGradient && (t._currentLimitVelocityGradient = this._currentLimitVelocityGradient, t._currentLimitVelocity1 = this._currentLimitVelocity1, t._currentLimitVelocity2 = this._currentLimitVelocity2), this._currentDragGradient && (t._currentDragGradient = this._currentDragGradient, t._currentDrag1 = this._currentDrag1, t._currentDrag2 = this._currentDrag2), this.particleSystem.isAnimationSheetEnabled && (t._initialStartSpriteCellID = this._initialStartSpriteCellID, t._initialEndSpriteCellID = this._initialEndSpriteCellID), this.particleSystem.useRampGradients && (t.remapData && this.remapData ? t.remapData.copyFrom(this.remapData) : t.remapData = new u.f(0, 0, 0, 0)), this._randomNoiseCoordinates1 && (t._randomNoiseCoordinates1 ? (t._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1), t._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)) : (t._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone(), t._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone()));\n          }, r._Count = 0, r;\n        }();\n        (function(r) {\n          r[r.ATTACHED = 0] = \"ATTACHED\", r[r.END = 1] = \"END\";\n        })(Rr || (Rr = {}));\n        var mo = function() {\n          function r(t) {\n            if (this.particleSystem = t, this.type = Rr.END, this.inheritDirection = !1, this.inheritedVelocityAmount = 0, !t.emitter || !t.emitter.dispose) {\n              var e = O.a.GetClass(\"BABYLON.AbstractMesh\");\n              t.emitter = new e(\"SubemitterSystemEmitter\", t.getScene());\n            }\n            t.onDisposeObservable.add(function() {\n              t.emitter && t.emitter.dispose && t.emitter.dispose();\n            });\n          }\n          return r.prototype.clone = function() {\n            var t = this.particleSystem.emitter;\n            t ? t instanceof u.e ? t = t.clone() : t.getClassName().indexOf(\"Mesh\") !== -1 && ((t = new (O.a.GetClass(\"BABYLON.Mesh\"))(\"\", t.getScene())).isVisible = !1) : t = new u.e();\n            var e = new r(this.particleSystem.clone(\"\", t));\n            return e.particleSystem.name += \"Clone\", e.type = this.type, e.inheritDirection = this.inheritDirection, e.inheritedVelocityAmount = this.inheritedVelocityAmount, e.particleSystem._disposeEmitterOnDispose = !0, e.particleSystem.disposeOnStop = !0, e;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.type, t.inheritDirection = this.inheritDirection, t.inheritedVelocityAmount = this.inheritedVelocityAmount, t.particleSystem = this.particleSystem.serialize(), t;\n          }, r._ParseParticleSystem = function(t, e, n) {\n            throw En.a.WarnImport(\"ParseParticle\");\n          }, r.Parse = function(t, e, n) {\n            var i = t.particleSystem, o = new r(r._ParseParticleSystem(i, e, n));\n            return o.type = t.type, o.inheritDirection = t.inheritDirection, o.inheritedVelocityAmount = t.inheritedVelocityAmount, o.particleSystem._isSubEmitter = !0, o;\n          }, r.prototype.dispose = function() {\n            this.particleSystem.dispose();\n          }, r;\n        }(), hm = `\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.particlesPixelShader = hm;\n        var dm = `\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos;\n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\nvarying vec3 vPositionW;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration>\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#endif\nvoid main(void) {\nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD\n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\nvPositionW=(invView*vec4(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0);\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvPositionW=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(vPositionW,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex*particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset/particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}`;\n        ze.a.ShadersStore.particlesVertexShader = dm;\n        var cn = function(r) {\n          function t(e, n, i, o, a, s) {\n            o === void 0 && (o = null), a === void 0 && (a = !1), s === void 0 && (s = 0.01);\n            var d = r.call(this, e) || this;\n            return d._inheritedVelocityOffset = new u.e(), d.onDisposeObservable = new C.c(), d.onStoppedObservable = new C.c(), d._particles = new Array(), d._stockParticles = new Array(), d._newPartsExcess = 0, d._vertexBuffers = {}, d._scaledColorStep = new I.b(0, 0, 0, 0), d._colorDiff = new I.b(0, 0, 0, 0), d._scaledDirection = u.e.Zero(), d._scaledGravity = u.e.Zero(), d._currentRenderId = -1, d._useInstancing = !1, d._started = !1, d._stopped = !1, d._actualFrame = 0, d._currentEmitRate1 = 0, d._currentEmitRate2 = 0, d._currentStartSize1 = 0, d._currentStartSize2 = 0, d._rawTextureWidth = 256, d._useRampGradients = !1, d._disposeEmitterOnDispose = !1, d.isLocal = !1, d._onBeforeDrawParticlesObservable = null, d.recycleParticle = function(p) {\n              var y = d._particles.pop();\n              y !== p && y.copyTo(p), d._stockParticles.push(y);\n            }, d._createParticle = function() {\n              var p;\n              if (d._stockParticles.length !== 0 ? (p = d._stockParticles.pop())._reset() : p = new sd(d), d._subEmitters && d._subEmitters.length > 0) {\n                var y = d._subEmitters[Math.floor(Math.random() * d._subEmitters.length)];\n                p._attachedSubEmitters = [], y.forEach(function(P) {\n                  if (P.type === Rr.ATTACHED) {\n                    var R = P.clone();\n                    p._attachedSubEmitters.push(R), R.particleSystem.start();\n                  }\n                });\n              }\n              return p;\n            }, d._emitFromParticle = function(p) {\n              if (d._subEmitters && d._subEmitters.length !== 0) {\n                var y = Math.floor(Math.random() * d._subEmitters.length);\n                d._subEmitters[y].forEach(function(P) {\n                  if (P.type === Rr.END) {\n                    var R = P.clone();\n                    p._inheritParticleInfoToSubEmitter(R), R.particleSystem._rootParticleSystem = d, d.activeSubSystems.push(R.particleSystem), R.particleSystem.start();\n                  }\n                });\n              }\n            }, d._capacity = n, d._epsilon = s, d._isAnimationSheetEnabled = a, i && i.getClassName() !== \"Scene\" ? (d._engine = i, d.defaultProjectionMatrix = u.a.PerspectiveFovLH(0.8, 1, 0.1, 100)) : (d._scene = i || te.a.LastCreatedScene, d._engine = d._scene.getEngine(), d.uniqueId = d._scene.getUniqueId(), d._scene.particleSystems.push(d)), d._engine.getCaps().vertexArrayObject && (d._vertexArrayObject = null), d._attachImageProcessingConfiguration(null), d._customEffect = { 0: o }, d._useInstancing = d._engine.getCaps().instancedArrays, d._createIndexBuffer(), d._createVertexBuffers(), d.particleEmitterType = new xr(), d.updateFunction = function(p) {\n              var y = null, P = null;\n              d.noiseTexture && (y = d.noiseTexture.getSize(), P = d.noiseTexture.getContent());\n              for (var R, B = function() {\n                R = p[F];\n                var z = d._scaledUpdateSpeed, J = R.age;\n                if (R.age += z, R.age > R.lifeTime) {\n                  var ie = R.age - J;\n                  z = (R.lifeTime - J) * z / ie, R.age = R.lifeTime;\n                }\n                var se = R.age / R.lifeTime;\n                d._colorGradients && d._colorGradients.length > 0 ? On.GetCurrentGradient(se, d._colorGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentColorGradient && (R._currentColor1.copyFrom(R._currentColor2), Ee.getColorToRef(R._currentColor2), R._currentColorGradient = Ae), I.b.LerpToRef(R._currentColor1, R._currentColor2, Se, R.color);\n                }) : (R.colorStep.scaleToRef(z, d._scaledColorStep), R.color.addInPlace(d._scaledColorStep), R.color.a < 0 && (R.color.a = 0)), d._angularSpeedGradients && d._angularSpeedGradients.length > 0 && On.GetCurrentGradient(se, d._angularSpeedGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentAngularSpeedGradient && (R._currentAngularSpeed1 = R._currentAngularSpeed2, R._currentAngularSpeed2 = Ee.getFactor(), R._currentAngularSpeedGradient = Ae), R.angularSpeed = $.a.Lerp(R._currentAngularSpeed1, R._currentAngularSpeed2, Se);\n                }), R.angle += R.angularSpeed * z;\n                var ce = z;\n                if (d._velocityGradients && d._velocityGradients.length > 0 && On.GetCurrentGradient(se, d._velocityGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentVelocityGradient && (R._currentVelocity1 = R._currentVelocity2, R._currentVelocity2 = Ee.getFactor(), R._currentVelocityGradient = Ae), ce *= $.a.Lerp(R._currentVelocity1, R._currentVelocity2, Se);\n                }), R.direction.scaleToRef(ce, d._scaledDirection), d._limitVelocityGradients && d._limitVelocityGradients.length > 0 && On.GetCurrentGradient(se, d._limitVelocityGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentLimitVelocityGradient && (R._currentLimitVelocity1 = R._currentLimitVelocity2, R._currentLimitVelocity2 = Ee.getFactor(), R._currentLimitVelocityGradient = Ae);\n                  var De = $.a.Lerp(R._currentLimitVelocity1, R._currentLimitVelocity2, Se);\n                  R.direction.length() > De && R.direction.scaleInPlace(d.limitVelocityDamping);\n                }), d._dragGradients && d._dragGradients.length > 0 && On.GetCurrentGradient(se, d._dragGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentDragGradient && (R._currentDrag1 = R._currentDrag2, R._currentDrag2 = Ee.getFactor(), R._currentDragGradient = Ae);\n                  var De = $.a.Lerp(R._currentDrag1, R._currentDrag2, Se);\n                  d._scaledDirection.scaleInPlace(1 - De);\n                }), d.isLocal && R._localPosition ? (R._localPosition.addInPlace(d._scaledDirection), u.e.TransformCoordinatesToRef(R._localPosition, d._emitterWorldMatrix, R.position)) : R.position.addInPlace(d._scaledDirection), P && y && R._randomNoiseCoordinates1) {\n                  var ue = d._fetchR(R._randomNoiseCoordinates1.x, R._randomNoiseCoordinates1.y, y.width, y.height, P), fe = d._fetchR(R._randomNoiseCoordinates1.z, R._randomNoiseCoordinates2.x, y.width, y.height, P), ve = d._fetchR(R._randomNoiseCoordinates2.y, R._randomNoiseCoordinates2.z, y.width, y.height, P), Te = u.c.Vector3[0], Re = u.c.Vector3[1];\n                  Te.copyFromFloats((2 * ue - 1) * d.noiseStrength.x, (2 * fe - 1) * d.noiseStrength.y, (2 * ve - 1) * d.noiseStrength.z), Te.scaleToRef(z, Re), R.direction.addInPlace(Re);\n                }\n                if (d.gravity.scaleToRef(z, d._scaledGravity), R.direction.addInPlace(d._scaledGravity), d._sizeGradients && d._sizeGradients.length > 0 && On.GetCurrentGradient(se, d._sizeGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentSizeGradient && (R._currentSize1 = R._currentSize2, R._currentSize2 = Ee.getFactor(), R._currentSizeGradient = Ae), R.size = $.a.Lerp(R._currentSize1, R._currentSize2, Se);\n                }), d._useRampGradients && (d._colorRemapGradients && d._colorRemapGradients.length > 0 && On.GetCurrentGradient(se, d._colorRemapGradients, function(Ae, Ee, Se) {\n                  var De = $.a.Lerp(Ae.factor1, Ee.factor1, Se), xe = $.a.Lerp(Ae.factor2, Ee.factor2, Se);\n                  R.remapData.x = De, R.remapData.y = xe - De;\n                }), d._alphaRemapGradients && d._alphaRemapGradients.length > 0 && On.GetCurrentGradient(se, d._alphaRemapGradients, function(Ae, Ee, Se) {\n                  var De = $.a.Lerp(Ae.factor1, Ee.factor1, Se), xe = $.a.Lerp(Ae.factor2, Ee.factor2, Se);\n                  R.remapData.z = De, R.remapData.w = xe - De;\n                })), d._isAnimationSheetEnabled && R.updateCellIndex(), R._inheritParticleInfoToSubEmitters(), R.age >= R.lifeTime)\n                  return d._emitFromParticle(R), R._attachedSubEmitters && (R._attachedSubEmitters.forEach(function(Ae) {\n                    Ae.particleSystem.disposeOnStop = !0, Ae.particleSystem.stop();\n                  }), R._attachedSubEmitters = null), d.recycleParticle(R), F--, \"continue\";\n              }, F = 0; F < p.length; F++)\n                B();\n            }, d;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onDispose\", { set: function(e) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useRampGradients\", { get: function() {\n            return this._useRampGradients;\n          }, set: function(e) {\n            this._useRampGradients !== e && (this._useRampGradients = e, this._resetEffect());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"particles\", { get: function() {\n            return this._particles;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getActiveCount = function() {\n            return this._particles.length;\n          }, t.prototype.getClassName = function() {\n            return \"ParticleSystem\";\n          }, t.prototype.isStopping = function() {\n            return this._stopped && this.isAlive();\n          }, t.prototype.getCustomEffect = function(e) {\n            var n;\n            return e === void 0 && (e = 0), (n = this._customEffect[e]) !== null && n !== void 0 ? n : this._customEffect[0];\n          }, t.prototype.setCustomEffect = function(e, n) {\n            n === void 0 && (n = 0), this._customEffect[n] = e;\n          }, Object.defineProperty(t.prototype, \"onBeforeDrawParticlesObservable\", { get: function() {\n            return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new C.c()), this._onBeforeDrawParticlesObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vertexShaderName\", { get: function() {\n            return \"particles\";\n          }, enumerable: !1, configurable: !0 }), t.prototype._addFactorGradient = function(e, n, i, o) {\n            var a = new vc(n, i, o);\n            e.push(a), e.sort(function(s, d) {\n              return s.gradient < d.gradient ? -1 : s.gradient > d.gradient ? 1 : 0;\n            });\n          }, t.prototype._removeFactorGradient = function(e, n) {\n            if (e)\n              for (var i = 0, o = 0, a = e; o < a.length; o++) {\n                if (a[o].gradient === n) {\n                  e.splice(i, 1);\n                  break;\n                }\n                i++;\n              }\n          }, t.prototype.addLifeTimeGradient = function(e, n, i) {\n            return this._lifeTimeGradients || (this._lifeTimeGradients = []), this._addFactorGradient(this._lifeTimeGradients, e, n, i), this;\n          }, t.prototype.removeLifeTimeGradient = function(e) {\n            return this._removeFactorGradient(this._lifeTimeGradients, e), this;\n          }, t.prototype.addSizeGradient = function(e, n, i) {\n            return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, n, i), this;\n          }, t.prototype.removeSizeGradient = function(e) {\n            return this._removeFactorGradient(this._sizeGradients, e), this;\n          }, t.prototype.addColorRemapGradient = function(e, n, i) {\n            return this._colorRemapGradients || (this._colorRemapGradients = []), this._addFactorGradient(this._colorRemapGradients, e, n, i), this;\n          }, t.prototype.removeColorRemapGradient = function(e) {\n            return this._removeFactorGradient(this._colorRemapGradients, e), this;\n          }, t.prototype.addAlphaRemapGradient = function(e, n, i) {\n            return this._alphaRemapGradients || (this._alphaRemapGradients = []), this._addFactorGradient(this._alphaRemapGradients, e, n, i), this;\n          }, t.prototype.removeAlphaRemapGradient = function(e) {\n            return this._removeFactorGradient(this._alphaRemapGradients, e), this;\n          }, t.prototype.addAngularSpeedGradient = function(e, n, i) {\n            return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, n, i), this;\n          }, t.prototype.removeAngularSpeedGradient = function(e) {\n            return this._removeFactorGradient(this._angularSpeedGradients, e), this;\n          }, t.prototype.addVelocityGradient = function(e, n, i) {\n            return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, n, i), this;\n          }, t.prototype.removeVelocityGradient = function(e) {\n            return this._removeFactorGradient(this._velocityGradients, e), this;\n          }, t.prototype.addLimitVelocityGradient = function(e, n, i) {\n            return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, n, i), this;\n          }, t.prototype.removeLimitVelocityGradient = function(e) {\n            return this._removeFactorGradient(this._limitVelocityGradients, e), this;\n          }, t.prototype.addDragGradient = function(e, n, i) {\n            return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, n, i), this;\n          }, t.prototype.removeDragGradient = function(e) {\n            return this._removeFactorGradient(this._dragGradients, e), this;\n          }, t.prototype.addEmitRateGradient = function(e, n, i) {\n            return this._emitRateGradients || (this._emitRateGradients = []), this._addFactorGradient(this._emitRateGradients, e, n, i), this;\n          }, t.prototype.removeEmitRateGradient = function(e) {\n            return this._removeFactorGradient(this._emitRateGradients, e), this;\n          }, t.prototype.addStartSizeGradient = function(e, n, i) {\n            return this._startSizeGradients || (this._startSizeGradients = []), this._addFactorGradient(this._startSizeGradients, e, n, i), this;\n          }, t.prototype.removeStartSizeGradient = function(e) {\n            return this._removeFactorGradient(this._startSizeGradients, e), this;\n          }, t.prototype._createRampGradientTexture = function() {\n            if (this._rampGradients && this._rampGradients.length && !this._rampGradientsTexture && this._scene) {\n              for (var e = new Uint8Array(4 * this._rawTextureWidth), n = I.c.Color3[0], i = 0; i < this._rawTextureWidth; i++) {\n                var o = i / this._rawTextureWidth;\n                On.GetCurrentGradient(o, this._rampGradients, function(a, s, d) {\n                  I.a.LerpToRef(a.color, s.color, d, n), e[4 * i] = 255 * n.r, e[4 * i + 1] = 255 * n.g, e[4 * i + 2] = 255 * n.b, e[4 * i + 3] = 255;\n                });\n              }\n              this._rampGradientsTexture = Zn.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n          }, t.prototype.getRampGradients = function() {\n            return this._rampGradients;\n          }, t.prototype.forceRefreshGradients = function() {\n            this._syncRampGradientTexture();\n          }, t.prototype._syncRampGradientTexture = function() {\n            this._rampGradients && (this._rampGradients.sort(function(e, n) {\n              return e.gradient < n.gradient ? -1 : e.gradient > n.gradient ? 1 : 0;\n            }), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._createRampGradientTexture());\n          }, t.prototype.addRampGradient = function(e, n) {\n            this._rampGradients || (this._rampGradients = []);\n            var i = new ad(e, n);\n            return this._rampGradients.push(i), this._syncRampGradientTexture(), this;\n          }, t.prototype.removeRampGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._rampGradients, this._rampGradientsTexture), this._rampGradientsTexture = null, this._rampGradients && this._rampGradients.length > 0 && this._createRampGradientTexture(), this;\n          }, t.prototype.addColorGradient = function(e, n, i) {\n            this._colorGradients || (this._colorGradients = []);\n            var o = new gc(e, n, i);\n            return this._colorGradients.push(o), this._colorGradients.sort(function(a, s) {\n              return a.gradient < s.gradient ? -1 : a.gradient > s.gradient ? 1 : 0;\n            }), this;\n          }, t.prototype.removeColorGradient = function(e) {\n            if (!this._colorGradients)\n              return this;\n            for (var n = 0, i = 0, o = this._colorGradients; i < o.length; i++) {\n              if (o[i].gradient === e) {\n                this._colorGradients.splice(n, 1);\n                break;\n              }\n              n++;\n            }\n            return this;\n          }, t.prototype._fetchR = function(e, n, i, o, a) {\n            return a[4 * (((e = 0.5 * Math.abs(e) + 0.5) * i % i | 0) + ((n = 0.5 * Math.abs(n) + 0.5) * o % o | 0) * i)] / 255;\n          }, t.prototype._reset = function() {\n            this._resetEffect();\n          }, t.prototype._resetEffect = function() {\n            this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this._createVertexBuffers();\n          }, t.prototype._createVertexBuffers = function() {\n            this._vertexBufferSize = this._useInstancing ? 10 : 12, this._isAnimationSheetEnabled && (this._vertexBufferSize += 1), this._isBillboardBased && this.billboardMode !== t.BILLBOARDMODE_STRETCHED || (this._vertexBufferSize += 3), this._useRampGradients && (this._vertexBufferSize += 4);\n            var e = this._engine;\n            this._vertexData = new Float32Array(this._capacity * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._vertexBuffer = new Oe.a(e, this._vertexData, !0, this._vertexBufferSize);\n            var n = 0, i = this._vertexBuffer.createVertexBuffer(Oe.b.PositionKind, n, 3, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers[Oe.b.PositionKind] = i, n += 3;\n            var o = this._vertexBuffer.createVertexBuffer(Oe.b.ColorKind, n, 4, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers[Oe.b.ColorKind] = o, n += 4;\n            var a = this._vertexBuffer.createVertexBuffer(\"angle\", n, 1, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers.angle = a, n += 1;\n            var s, d = this._vertexBuffer.createVertexBuffer(\"size\", n, 2, this._vertexBufferSize, this._useInstancing);\n            if (this._vertexBuffers.size = d, n += 2, this._isAnimationSheetEnabled) {\n              var p = this._vertexBuffer.createVertexBuffer(\"cellIndex\", n, 1, this._vertexBufferSize, this._useInstancing);\n              this._vertexBuffers.cellIndex = p, n += 1;\n            }\n            if (!this._isBillboardBased || this.billboardMode === t.BILLBOARDMODE_STRETCHED) {\n              var y = this._vertexBuffer.createVertexBuffer(\"direction\", n, 3, this._vertexBufferSize, this._useInstancing);\n              this._vertexBuffers.direction = y, n += 3;\n            }\n            if (this._useRampGradients) {\n              var P = this._vertexBuffer.createVertexBuffer(\"remapData\", n, 4, this._vertexBufferSize, this._useInstancing);\n              this._vertexBuffers.remapData = P, n += 4;\n            }\n            if (this._useInstancing) {\n              var R = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n              this._spriteBuffer = new Oe.a(e, R, !1, 2), s = this._spriteBuffer.createVertexBuffer(\"offset\", 0, 2);\n            } else\n              s = this._vertexBuffer.createVertexBuffer(\"offset\", n, 2, this._vertexBufferSize, this._useInstancing), n += 2;\n            this._vertexBuffers.offset = s;\n          }, t.prototype._createIndexBuffer = function() {\n            if (!this._useInstancing) {\n              for (var e = [], n = 0, i = 0; i < this._capacity; i++)\n                e.push(n), e.push(n + 1), e.push(n + 2), e.push(n), e.push(n + 2), e.push(n + 3), n += 4;\n              this._indexBuffer = this._engine.createIndexBuffer(e);\n            }\n          }, t.prototype.getCapacity = function() {\n            return this._capacity;\n          }, t.prototype.isAlive = function() {\n            return this._alive;\n          }, t.prototype.isStarted = function() {\n            return this._started;\n          }, t.prototype._prepareSubEmitterInternalArray = function() {\n            var e = this;\n            this._subEmitters = new Array(), this.subEmitters && this.subEmitters.forEach(function(n) {\n              n instanceof t ? e._subEmitters.push([new mo(n)]) : n instanceof mo ? e._subEmitters.push([n]) : n instanceof Array && e._subEmitters.push(n);\n            });\n          }, t.prototype.start = function(e) {\n            var n, i = this;\n            if (e === void 0 && (e = this.startDelay), !this.targetStopDuration && this._hasTargetStopDurationDependantGradient())\n              throw \"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set\";\n            if (e)\n              setTimeout(function() {\n                i.start(0);\n              }, e);\n            else {\n              if (this._prepareSubEmitterInternalArray(), this._started = !0, this._stopped = !1, this._actualFrame = 0, this._subEmitters && this._subEmitters.length != 0 && (this.activeSubSystems = new Array()), this._emitRateGradients && (this._emitRateGradients.length > 0 && (this._currentEmitRateGradient = this._emitRateGradients[0], this._currentEmitRate1 = this._currentEmitRateGradient.getFactor(), this._currentEmitRate2 = this._currentEmitRate1), this._emitRateGradients.length > 1 && (this._currentEmitRate2 = this._emitRateGradients[1].getFactor())), this._startSizeGradients && (this._startSizeGradients.length > 0 && (this._currentStartSizeGradient = this._startSizeGradients[0], this._currentStartSize1 = this._currentStartSizeGradient.getFactor(), this._currentStartSize2 = this._currentStartSize1), this._startSizeGradients.length > 1 && (this._currentStartSize2 = this._startSizeGradients[1].getFactor())), this.preWarmCycles) {\n                ((n = this.emitter) === null || n === void 0 ? void 0 : n.getClassName().indexOf(\"Mesh\")) !== -1 && this.emitter.computeWorldMatrix(!0);\n                var o = this.noiseTexture;\n                if (o && o.onGeneratedObservable)\n                  o.onGeneratedObservable.addOnce(function() {\n                    setTimeout(function() {\n                      for (var s = 0; s < i.preWarmCycles; s++)\n                        i.animate(!0), o.render();\n                    });\n                  });\n                else\n                  for (var a = 0; a < this.preWarmCycles; a++)\n                    this.animate(!0);\n              }\n              this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);\n            }\n          }, t.prototype.stop = function(e) {\n            e === void 0 && (e = !0), this._stopped || (this.onStoppedObservable.notifyObservers(this), this._stopped = !0, e && this._stopSubEmitters());\n          }, t.prototype.reset = function() {\n            this._stockParticles = [], this._particles = [];\n          }, t.prototype._appendParticleVertex = function(e, n, i, o) {\n            var a = e * this._vertexBufferSize;\n            if (this._vertexData[a++] = n.position.x + this.worldOffset.x, this._vertexData[a++] = n.position.y + this.worldOffset.y, this._vertexData[a++] = n.position.z + this.worldOffset.z, this._vertexData[a++] = n.color.r, this._vertexData[a++] = n.color.g, this._vertexData[a++] = n.color.b, this._vertexData[a++] = n.color.a, this._vertexData[a++] = n.angle, this._vertexData[a++] = n.scale.x * n.size, this._vertexData[a++] = n.scale.y * n.size, this._isAnimationSheetEnabled && (this._vertexData[a++] = n.cellIndex), this._isBillboardBased)\n              this.billboardMode === t.BILLBOARDMODE_STRETCHED && (this._vertexData[a++] = n.direction.x, this._vertexData[a++] = n.direction.y, this._vertexData[a++] = n.direction.z);\n            else if (n._initialDirection) {\n              var s = n._initialDirection;\n              this.isLocal && (u.e.TransformNormalToRef(s, this._emitterWorldMatrix, u.c.Vector3[0]), s = u.c.Vector3[0]), s.x === 0 && s.z === 0 && (s.x = 1e-3), this._vertexData[a++] = s.x, this._vertexData[a++] = s.y, this._vertexData[a++] = s.z;\n            } else {\n              var d = n.direction;\n              this.isLocal && (u.e.TransformNormalToRef(d, this._emitterWorldMatrix, u.c.Vector3[0]), d = u.c.Vector3[0]), d.x === 0 && d.z === 0 && (d.x = 1e-3), this._vertexData[a++] = d.x, this._vertexData[a++] = d.y, this._vertexData[a++] = d.z;\n            }\n            this._useRampGradients && n.remapData && (this._vertexData[a++] = n.remapData.x, this._vertexData[a++] = n.remapData.y, this._vertexData[a++] = n.remapData.z, this._vertexData[a++] = n.remapData.w), this._useInstancing || (this._isAnimationSheetEnabled && (i === 0 ? i = this._epsilon : i === 1 && (i = 1 - this._epsilon), o === 0 ? o = this._epsilon : o === 1 && (o = 1 - this._epsilon)), this._vertexData[a++] = i, this._vertexData[a++] = o);\n          }, t.prototype._stopSubEmitters = function() {\n            this.activeSubSystems && (this.activeSubSystems.forEach(function(e) {\n              e.stop(!0);\n            }), this.activeSubSystems = new Array());\n          }, t.prototype._removeFromRoot = function() {\n            if (this._rootParticleSystem) {\n              var e = this._rootParticleSystem.activeSubSystems.indexOf(this);\n              e !== -1 && this._rootParticleSystem.activeSubSystems.splice(e, 1), this._rootParticleSystem = null;\n            }\n          }, t.prototype._update = function(e) {\n            var n, i = this;\n            if (this._alive = this._particles.length > 0, this.emitter.position) {\n              var o = this.emitter;\n              this._emitterWorldMatrix = o.getWorldMatrix();\n            } else {\n              var a = this.emitter;\n              this._emitterWorldMatrix = u.a.Translation(a.x, a.y, a.z);\n            }\n            this.updateFunction(this._particles);\n            for (var s, d = function() {\n              if (p._particles.length === p._capacity)\n                return \"break\";\n              if (n = p._createParticle(), p._particles.push(n), p.targetStopDuration && p._lifeTimeGradients && p._lifeTimeGradients.length > 0) {\n                var P = $.a.Clamp(p._actualFrame / p.targetStopDuration);\n                On.GetCurrentGradient(P, p._lifeTimeGradients, function(F, z) {\n                  var J = F, ie = z, se = J.getFactor(), ce = ie.getFactor(), ue = (P - J.gradient) / (ie.gradient - J.gradient);\n                  n.lifeTime = $.a.Lerp(se, ce, ue);\n                });\n              } else\n                n.lifeTime = $.a.RandomRange(p.minLifeTime, p.maxLifeTime);\n              var R = $.a.RandomRange(p.minEmitPower, p.maxEmitPower);\n              if (p.startPositionFunction ? p.startPositionFunction(p._emitterWorldMatrix, n.position, n, p.isLocal) : p.particleEmitterType.startPositionFunction(p._emitterWorldMatrix, n.position, n, p.isLocal), p.isLocal && (n._localPosition ? n._localPosition.copyFrom(n.position) : n._localPosition = n.position.clone(), u.e.TransformCoordinatesToRef(n._localPosition, p._emitterWorldMatrix, n.position)), p.startDirectionFunction ? p.startDirectionFunction(p._emitterWorldMatrix, n.direction, n, p.isLocal) : p.particleEmitterType.startDirectionFunction(p._emitterWorldMatrix, n.direction, n, p.isLocal), R === 0 ? n._initialDirection ? n._initialDirection.copyFrom(n.direction) : n._initialDirection = n.direction.clone() : n._initialDirection = null, n.direction.scaleInPlace(R), p._sizeGradients && p._sizeGradients.length !== 0 ? (n._currentSizeGradient = p._sizeGradients[0], n._currentSize1 = n._currentSizeGradient.getFactor(), n.size = n._currentSize1, p._sizeGradients.length > 1 ? n._currentSize2 = p._sizeGradients[1].getFactor() : n._currentSize2 = n._currentSize1) : n.size = $.a.RandomRange(p.minSize, p.maxSize), n.scale.copyFromFloats($.a.RandomRange(p.minScaleX, p.maxScaleX), $.a.RandomRange(p.minScaleY, p.maxScaleY)), p._startSizeGradients && p._startSizeGradients[0] && p.targetStopDuration) {\n                var B = p._actualFrame / p.targetStopDuration;\n                On.GetCurrentGradient(B, p._startSizeGradients, function(F, z, J) {\n                  F !== i._currentStartSizeGradient && (i._currentStartSize1 = i._currentStartSize2, i._currentStartSize2 = z.getFactor(), i._currentStartSizeGradient = F);\n                  var ie = $.a.Lerp(i._currentStartSize1, i._currentStartSize2, J);\n                  n.scale.scaleInPlace(ie);\n                });\n              }\n              p._angularSpeedGradients && p._angularSpeedGradients.length !== 0 ? (n._currentAngularSpeedGradient = p._angularSpeedGradients[0], n.angularSpeed = n._currentAngularSpeedGradient.getFactor(), n._currentAngularSpeed1 = n.angularSpeed, p._angularSpeedGradients.length > 1 ? n._currentAngularSpeed2 = p._angularSpeedGradients[1].getFactor() : n._currentAngularSpeed2 = n._currentAngularSpeed1) : n.angularSpeed = $.a.RandomRange(p.minAngularSpeed, p.maxAngularSpeed), n.angle = $.a.RandomRange(p.minInitialRotation, p.maxInitialRotation), p._velocityGradients && p._velocityGradients.length > 0 && (n._currentVelocityGradient = p._velocityGradients[0], n._currentVelocity1 = n._currentVelocityGradient.getFactor(), p._velocityGradients.length > 1 ? n._currentVelocity2 = p._velocityGradients[1].getFactor() : n._currentVelocity2 = n._currentVelocity1), p._limitVelocityGradients && p._limitVelocityGradients.length > 0 && (n._currentLimitVelocityGradient = p._limitVelocityGradients[0], n._currentLimitVelocity1 = n._currentLimitVelocityGradient.getFactor(), p._limitVelocityGradients.length > 1 ? n._currentLimitVelocity2 = p._limitVelocityGradients[1].getFactor() : n._currentLimitVelocity2 = n._currentLimitVelocity1), p._dragGradients && p._dragGradients.length > 0 && (n._currentDragGradient = p._dragGradients[0], n._currentDrag1 = n._currentDragGradient.getFactor(), p._dragGradients.length > 1 ? n._currentDrag2 = p._dragGradients[1].getFactor() : n._currentDrag2 = n._currentDrag1), p._colorGradients && p._colorGradients.length !== 0 ? (n._currentColorGradient = p._colorGradients[0], n._currentColorGradient.getColorToRef(n.color), n._currentColor1.copyFrom(n.color), p._colorGradients.length > 1 ? p._colorGradients[1].getColorToRef(n._currentColor2) : n._currentColor2.copyFrom(n.color)) : (s = $.a.RandomRange(0, 1), I.b.LerpToRef(p.color1, p.color2, s, n.color), p.colorDead.subtractToRef(n.color, p._colorDiff), p._colorDiff.scaleToRef(1 / n.lifeTime, n.colorStep)), p._isAnimationSheetEnabled && (n._initialStartSpriteCellID = p.startSpriteCellID, n._initialEndSpriteCellID = p.endSpriteCellID), n.direction.addInPlace(p._inheritedVelocityOffset), p._useRampGradients && (n.remapData = new u.f(0, 1, 0, 1)), p.noiseTexture && (n._randomNoiseCoordinates1 ? (n._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random()), n._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random())) : (n._randomNoiseCoordinates1 = new u.e(Math.random(), Math.random(), Math.random()), n._randomNoiseCoordinates2 = new u.e(Math.random(), Math.random(), Math.random()))), n._inheritParticleInfoToSubEmitters();\n            }, p = this, y = 0; y < e && d() !== \"break\"; y++)\n              ;\n          }, t._GetAttributeNamesOrOptions = function(e, n, i) {\n            e === void 0 && (e = !1), n === void 0 && (n = !1), i === void 0 && (i = !1);\n            var o = [Oe.b.PositionKind, Oe.b.ColorKind, \"angle\", \"offset\", \"size\"];\n            return e && o.push(\"cellIndex\"), n || o.push(\"direction\"), i && o.push(\"remapData\"), o;\n          }, t._GetEffectCreationOptions = function(e) {\n            e === void 0 && (e = !1);\n            var n = [\"invView\", \"view\", \"projection\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"textureMask\", \"translationPivot\", \"eyePosition\"];\n            return e && n.push(\"particlesInfos\"), n;\n          }, t.prototype.fillDefines = function(e, n) {\n            if (this._scene && (this._scene.clipPlane && e.push(\"#define CLIPPLANE\"), this._scene.clipPlane2 && e.push(\"#define CLIPPLANE2\"), this._scene.clipPlane3 && e.push(\"#define CLIPPLANE3\"), this._scene.clipPlane4 && e.push(\"#define CLIPPLANE4\"), this._scene.clipPlane5 && e.push(\"#define CLIPPLANE5\"), this._scene.clipPlane6 && e.push(\"#define CLIPPLANE6\")), this._isAnimationSheetEnabled && e.push(\"#define ANIMATESHEET\"), n === t.BLENDMODE_MULTIPLY && e.push(\"#define BLENDMULTIPLYMODE\"), this._useRampGradients && e.push(\"#define RAMPGRADIENT\"), this._isBillboardBased)\n              switch (e.push(\"#define BILLBOARD\"), this.billboardMode) {\n                case t.BILLBOARDMODE_Y:\n                  e.push(\"#define BILLBOARDY\");\n                  break;\n                case t.BILLBOARDMODE_STRETCHED:\n                  e.push(\"#define BILLBOARDSTRETCHED\");\n                  break;\n                case t.BILLBOARDMODE_ALL:\n                  e.push(\"#define BILLBOARDMODE_ALL\");\n              }\n            this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e.push(this._imageProcessingConfigurationDefines.toString()));\n          }, t.prototype.fillUniformsAttributesAndSamplerNames = function(e, n, i) {\n            n.push.apply(n, t._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== t.BILLBOARDMODE_STRETCHED, this._useRampGradients)), e.push.apply(e, t._GetEffectCreationOptions(this._isAnimationSheetEnabled)), i.push(\"diffuseSampler\", \"rampSampler\"), this._imageProcessingConfiguration && (vn.a.PrepareUniforms(e, this._imageProcessingConfigurationDefines), vn.a.PrepareSamplers(i, this._imageProcessingConfigurationDefines));\n          }, t.prototype._getEffect = function(e) {\n            var n = this.getCustomEffect(e);\n            if (n)\n              return n;\n            var i = [];\n            this.fillDefines(i, e);\n            var o = i.join(`\n`);\n            if (this._cachedDefines !== o) {\n              this._cachedDefines = o;\n              var a = [], s = [], d = [];\n              this.fillUniformsAttributesAndSamplerNames(s, a, d), this._effect = this._engine.createEffect(\"particles\", a, s, d, o);\n            }\n            return this._effect;\n          }, t.prototype.animate = function(e) {\n            var n, i = this;\n            if (e === void 0 && (e = !1), this._started) {\n              if (!e && this._scene) {\n                if (!this.isReady() || this._currentRenderId === this._scene.getFrameId())\n                  return;\n                this._currentRenderId = this._scene.getFrameId();\n              }\n              var o;\n              if (this._scaledUpdateSpeed = this.updateSpeed * (e ? this.preWarmStepOffset : ((n = this._scene) === null || n === void 0 ? void 0 : n.getAnimationRatio()) || 1), this.manualEmitCount > -1)\n                o = this.manualEmitCount, this._newPartsExcess = 0, this.manualEmitCount = 0;\n              else {\n                var a = this.emitRate;\n                if (this._emitRateGradients && this._emitRateGradients.length > 0 && this.targetStopDuration) {\n                  var s = this._actualFrame / this.targetStopDuration;\n                  On.GetCurrentGradient(s, this._emitRateGradients, function(P, R, B) {\n                    P !== i._currentEmitRateGradient && (i._currentEmitRate1 = i._currentEmitRate2, i._currentEmitRate2 = R.getFactor(), i._currentEmitRateGradient = P), a = $.a.Lerp(i._currentEmitRate1, i._currentEmitRate2, B);\n                  });\n                }\n                o = a * this._scaledUpdateSpeed >> 0, this._newPartsExcess += a * this._scaledUpdateSpeed - o;\n              }\n              if (this._newPartsExcess > 1 && (o += this._newPartsExcess >> 0, this._newPartsExcess -= this._newPartsExcess >> 0), this._alive = !1, this._stopped ? o = 0 : (this._actualFrame += this._scaledUpdateSpeed, this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop()), this._update(o), this._stopped && (this._alive || (this._started = !1, this.onAnimationEnd && this.onAnimationEnd(), this.disposeOnStop && this._scene && this._scene._toBeDisposed.push(this))), !e) {\n                for (var d = 0, p = 0; p < this._particles.length; p++) {\n                  var y = this._particles[p];\n                  this._appendParticleVertices(d, y), d += this._useInstancing ? 1 : 4;\n                }\n                this._vertexBuffer && this._vertexBuffer.update(this._vertexData);\n              }\n              this.manualEmitCount === 0 && this.disposeOnStop && this.stop();\n            }\n          }, t.prototype._appendParticleVertices = function(e, n) {\n            this._appendParticleVertex(e++, n, 0, 0), this._useInstancing || (this._appendParticleVertex(e++, n, 1, 0), this._appendParticleVertex(e++, n, 1, 1), this._appendParticleVertex(e++, n, 0, 1));\n          }, t.prototype.rebuild = function() {\n            for (var e in this._createIndexBuffer(), this._vertexBuffer && this._vertexBuffer._rebuild(), this._vertexBuffers)\n              this._vertexBuffers[e]._rebuild();\n          }, t.prototype.isReady = function() {\n            if (!this.emitter || this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady())\n              return !1;\n            if (this.blendMode !== t.BLENDMODE_MULTIPLYADD) {\n              if (!this._getEffect(this.blendMode).isReady())\n                return !1;\n            } else if (!this._getEffect(t.BLENDMODE_MULTIPLY).isReady() || !this._getEffect(t.BLENDMODE_ADD).isReady())\n              return !1;\n            return !0;\n          }, t.prototype._render = function(e) {\n            var n, i, o = this._getEffect(e), a = this._engine;\n            a.enableEffect(o);\n            var s = (n = this.defaultViewMatrix) !== null && n !== void 0 ? n : this._scene.getViewMatrix();\n            if (o.setTexture(\"diffuseSampler\", this.particleTexture), o.setMatrix(\"view\", s), o.setMatrix(\"projection\", (i = this.defaultProjectionMatrix) !== null && i !== void 0 ? i : this._scene.getProjectionMatrix()), this._isAnimationSheetEnabled && this.particleTexture) {\n              var d = this.particleTexture.getBaseSize();\n              o.setFloat3(\"particlesInfos\", this.spriteCellWidth / d.width, this.spriteCellHeight / d.height, this.spriteCellWidth / d.width);\n            }\n            if (o.setVector2(\"translationPivot\", this.translationPivot), o.setFloat4(\"textureMask\", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a), this._isBillboardBased && this._scene) {\n              var p = this._scene.activeCamera;\n              o.setVector3(\"eyePosition\", p.globalPosition);\n            }\n            this._rampGradientsTexture && (this._rampGradients && this._rampGradients.length || (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), o.setTexture(\"rampSampler\", this._rampGradientsTexture));\n            var y = o.defines;\n            switch (this._scene && (this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4 || this._scene.clipPlane5 || this._scene.clipPlane6) && Bu.a.BindClipPlane(o, this._scene), y.indexOf(\"#define BILLBOARDMODE_ALL\") >= 0 && (s.invertToRef(u.c.Matrix[0]), o.setMatrix(\"invView\", u.c.Matrix[0])), this._vertexArrayObject !== void 0 ? (this._vertexArrayObject || (this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, o)), this._engine.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)) : a.bindBuffers(this._vertexBuffers, this._indexBuffer, o), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(o), e) {\n              case t.BLENDMODE_ADD:\n                a.setAlphaMode(h.a.ALPHA_ADD);\n                break;\n              case t.BLENDMODE_ONEONE:\n                a.setAlphaMode(h.a.ALPHA_ONEONE);\n                break;\n              case t.BLENDMODE_STANDARD:\n                a.setAlphaMode(h.a.ALPHA_COMBINE);\n                break;\n              case t.BLENDMODE_MULTIPLY:\n                a.setAlphaMode(h.a.ALPHA_MULTIPLY);\n            }\n            return this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(o), this._useInstancing ? a.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, this._particles.length) : a.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, 6 * this._particles.length), this._particles.length;\n          }, t.prototype.render = function() {\n            if (!this.isReady() || !this._particles.length)\n              return 0;\n            var e = this._engine;\n            e.setState && (e.setState(!1), this.forceDepthWrite && e.setDepthWrite(!0));\n            var n = 0;\n            return n = this.blendMode === t.BLENDMODE_MULTIPLYADD ? this._render(t.BLENDMODE_MULTIPLY) + this._render(t.BLENDMODE_ADD) : this._render(this.blendMode), this._engine.unbindInstanceAttributes(), this._engine.setAlphaMode(h.a.ALPHA_DISABLE), n;\n          }, t.prototype.dispose = function(e) {\n            if (e === void 0 && (e = !0), this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._removeFromRoot(), this._subEmitters && this._subEmitters.length) {\n              for (var n = 0; n < this._subEmitters.length; n++)\n                for (var i = 0, o = this._subEmitters[n]; i < o.length; i++)\n                  o[i].dispose();\n              this._subEmitters = [], this.subEmitters = [];\n            }\n            this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose && this.emitter.dispose(!0), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.clear(), this._scene && ((n = this._scene.particleSystems.indexOf(this)) > -1 && this._scene.particleSystems.splice(n, 1), this._scene._activeParticleSystems.dispose()), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onStoppedObservable.clear(), this.reset();\n          }, t.prototype.clone = function(e, n) {\n            var i = Object(c.a)({}, this._customEffect), o = null, a = this._engine;\n            if (a.createEffectForParticles && this.customShader != null) {\n              var s = (o = this.customShader).shaderOptions.defines.length > 0 ? o.shaderOptions.defines.join(`\n`) : \"\";\n              i[0] = a.createEffectForParticles(o.shaderPath.fragmentElement, o.shaderOptions.uniforms, o.shaderOptions.samplers, s);\n            }\n            var d = this.serialize(), p = t.Parse(d, this._scene || this._engine, \"\");\n            return p.name = e, p.customShader = o, p._customEffect = i, n === void 0 && (n = this.emitter), this.noiseTexture && (p.noiseTexture = this.noiseTexture.clone()), p.emitter = n, this.preventAutoStart || p.start(), p;\n          }, t.prototype.serialize = function(e) {\n            e === void 0 && (e = !1);\n            var n = {};\n            if (t._Serialize(n, this, e), n.textureMask = this.textureMask.asArray(), n.customShader = this.customShader, n.preventAutoStart = this.preventAutoStart, this.subEmitters) {\n              n.subEmitters = [], this._subEmitters || this._prepareSubEmitterInternalArray();\n              for (var i = 0, o = this._subEmitters; i < o.length; i++) {\n                for (var a = [], s = 0, d = o[i]; s < d.length; s++) {\n                  var p = d[s];\n                  a.push(p.serialize());\n                }\n                n.subEmitters.push(a);\n              }\n            }\n            return n;\n          }, t._Serialize = function(e, n, i) {\n            if (e.name = n.name, e.id = n.id, e.capacity = n.getCapacity(), n.emitter.position) {\n              var o = n.emitter;\n              e.emitterId = o.id;\n            } else {\n              var a = n.emitter;\n              e.emitter = a.asArray();\n            }\n            n.particleEmitterType && (e.particleEmitterType = n.particleEmitterType.serialize()), n.particleTexture && (i ? e.texture = n.particleTexture.serialize() : (e.textureName = n.particleTexture.name, e.invertY = !!n.particleTexture._invertY)), e.isLocal = n.isLocal, L.a.AppendSerializedAnimations(n, e), e.beginAnimationOnStart = n.beginAnimationOnStart, e.beginAnimationFrom = n.beginAnimationFrom, e.beginAnimationTo = n.beginAnimationTo, e.beginAnimationLoop = n.beginAnimationLoop, e.startDelay = n.startDelay, e.renderingGroupId = n.renderingGroupId, e.isBillboardBased = n.isBillboardBased, e.billboardMode = n.billboardMode, e.minAngularSpeed = n.minAngularSpeed, e.maxAngularSpeed = n.maxAngularSpeed, e.minSize = n.minSize, e.maxSize = n.maxSize, e.minScaleX = n.minScaleX, e.maxScaleX = n.maxScaleX, e.minScaleY = n.minScaleY, e.maxScaleY = n.maxScaleY, e.minEmitPower = n.minEmitPower, e.maxEmitPower = n.maxEmitPower, e.minLifeTime = n.minLifeTime, e.maxLifeTime = n.maxLifeTime, e.emitRate = n.emitRate, e.gravity = n.gravity.asArray(), e.noiseStrength = n.noiseStrength.asArray(), e.color1 = n.color1.asArray(), e.color2 = n.color2.asArray(), e.colorDead = n.colorDead.asArray(), e.updateSpeed = n.updateSpeed, e.targetStopDuration = n.targetStopDuration, e.blendMode = n.blendMode, e.preWarmCycles = n.preWarmCycles, e.preWarmStepOffset = n.preWarmStepOffset, e.minInitialRotation = n.minInitialRotation, e.maxInitialRotation = n.maxInitialRotation, e.startSpriteCellID = n.startSpriteCellID, e.endSpriteCellID = n.endSpriteCellID, e.spriteCellChangeSpeed = n.spriteCellChangeSpeed, e.spriteCellWidth = n.spriteCellWidth, e.spriteCellHeight = n.spriteCellHeight, e.spriteRandomStartCell = n.spriteRandomStartCell, e.isAnimationSheetEnabled = n.isAnimationSheetEnabled;\n            var s = n.getColorGradients();\n            if (s) {\n              e.colorGradients = [];\n              for (var d = 0, p = s; d < p.length; d++) {\n                var y = p[d], P = { gradient: y.gradient, color1: y.color1.asArray() };\n                y.color2 ? P.color2 = y.color2.asArray() : P.color2 = y.color1.asArray(), e.colorGradients.push(P);\n              }\n            }\n            var R = n.getRampGradients();\n            if (R) {\n              e.rampGradients = [];\n              for (var B = 0, F = R; B < F.length; B++) {\n                var z = F[B];\n                P = { gradient: z.gradient, color: z.color.asArray() }, e.rampGradients.push(P);\n              }\n              e.useRampGradients = n.useRampGradients;\n            }\n            var J = n.getColorRemapGradients();\n            if (J) {\n              e.colorRemapGradients = [];\n              for (var ie = 0, se = J; ie < se.length; ie++) {\n                var ce = se[ie];\n                P = { gradient: ce.gradient, factor1: ce.factor1 }, ce.factor2 !== void 0 ? P.factor2 = ce.factor2 : P.factor2 = ce.factor1, e.colorRemapGradients.push(P);\n              }\n            }\n            var ue = n.getAlphaRemapGradients();\n            if (ue) {\n              e.alphaRemapGradients = [];\n              for (var fe = 0, ve = ue; fe < ve.length; fe++) {\n                var Te = ve[fe];\n                P = { gradient: Te.gradient, factor1: Te.factor1 }, Te.factor2 !== void 0 ? P.factor2 = Te.factor2 : P.factor2 = Te.factor1, e.alphaRemapGradients.push(P);\n              }\n            }\n            var Re = n.getSizeGradients();\n            if (Re) {\n              e.sizeGradients = [];\n              for (var Ae = 0, Ee = Re; Ae < Ee.length; Ae++) {\n                var Se = Ee[Ae];\n                P = { gradient: Se.gradient, factor1: Se.factor1 }, Se.factor2 !== void 0 ? P.factor2 = Se.factor2 : P.factor2 = Se.factor1, e.sizeGradients.push(P);\n              }\n            }\n            var De = n.getAngularSpeedGradients();\n            if (De) {\n              e.angularSpeedGradients = [];\n              for (var xe = 0, Le = De; xe < Le.length; xe++) {\n                var Me = Le[xe];\n                P = { gradient: Me.gradient, factor1: Me.factor1 }, Me.factor2 !== void 0 ? P.factor2 = Me.factor2 : P.factor2 = Me.factor1, e.angularSpeedGradients.push(P);\n              }\n            }\n            var we = n.getVelocityGradients();\n            if (we) {\n              e.velocityGradients = [];\n              for (var Ye = 0, et = we; Ye < et.length; Ye++) {\n                var nt = et[Ye];\n                P = { gradient: nt.gradient, factor1: nt.factor1 }, nt.factor2 !== void 0 ? P.factor2 = nt.factor2 : P.factor2 = nt.factor1, e.velocityGradients.push(P);\n              }\n            }\n            var ct = n.getDragGradients();\n            if (ct) {\n              e.dragGradients = [];\n              for (var Ke = 0, rt = ct; Ke < rt.length; Ke++) {\n                var it = rt[Ke];\n                P = { gradient: it.gradient, factor1: it.factor1 }, it.factor2 !== void 0 ? P.factor2 = it.factor2 : P.factor2 = it.factor1, e.dragGradients.push(P);\n              }\n            }\n            var qe = n.getEmitRateGradients();\n            if (qe) {\n              e.emitRateGradients = [];\n              for (var ut = 0, Ve = qe; ut < Ve.length; ut++) {\n                var Ze = Ve[ut];\n                P = { gradient: Ze.gradient, factor1: Ze.factor1 }, Ze.factor2 !== void 0 ? P.factor2 = Ze.factor2 : P.factor2 = Ze.factor1, e.emitRateGradients.push(P);\n              }\n            }\n            var vt = n.getStartSizeGradients();\n            if (vt) {\n              e.startSizeGradients = [];\n              for (var jt = 0, Dt = vt; jt < Dt.length; jt++) {\n                var Yt = Dt[jt];\n                P = { gradient: Yt.gradient, factor1: Yt.factor1 }, Yt.factor2 !== void 0 ? P.factor2 = Yt.factor2 : P.factor2 = Yt.factor1, e.startSizeGradients.push(P);\n              }\n            }\n            var mt = n.getLifeTimeGradients();\n            if (mt) {\n              e.lifeTimeGradients = [];\n              for (var qt = 0, Ht = mt; qt < Ht.length; qt++) {\n                var kt = Ht[qt];\n                P = { gradient: kt.gradient, factor1: kt.factor1 }, kt.factor2 !== void 0 ? P.factor2 = kt.factor2 : P.factor2 = kt.factor1, e.lifeTimeGradients.push(P);\n              }\n            }\n            var Wt = n.getLimitVelocityGradients();\n            if (Wt) {\n              e.limitVelocityGradients = [];\n              for (var bt = 0, Rt = Wt; bt < Rt.length; bt++) {\n                var Zt = Rt[bt];\n                P = { gradient: Zt.gradient, factor1: Zt.factor1 }, Zt.factor2 !== void 0 ? P.factor2 = Zt.factor2 : P.factor2 = Zt.factor1, e.limitVelocityGradients.push(P);\n              }\n              e.limitVelocityDamping = n.limitVelocityDamping;\n            }\n            n.noiseTexture && (e.noiseTexture = n.noiseTexture.serialize());\n          }, t._Parse = function(e, n, i, o) {\n            var a;\n            a = i instanceof wt.a ? null : i;\n            var s, d = O.a.GetClass(\"BABYLON.Texture\");\n            if (d && a && (e.texture ? n.particleTexture = d.Parse(e.texture, a, o) : e.textureName && (n.particleTexture = new d(o + e.textureName, a, !1, e.invertY === void 0 || e.invertY), n.particleTexture.name = e.textureName)), e.emitterId || e.emitterId === 0 || e.emitter !== void 0 ? e.emitterId && a ? n.emitter = a.getLastMeshByID(e.emitterId) : n.emitter = u.e.FromArray(e.emitter) : n.emitter = u.e.Zero(), n.isLocal = !!e.isLocal, e.renderingGroupId !== void 0 && (n.renderingGroupId = e.renderingGroupId), e.isBillboardBased !== void 0 && (n.isBillboardBased = e.isBillboardBased), e.billboardMode !== void 0 && (n.billboardMode = e.billboardMode), e.animations) {\n              for (var p = 0; p < e.animations.length; p++) {\n                var y = e.animations[p], P = O.a.GetClass(\"BABYLON.Animation\");\n                P && n.animations.push(P.Parse(y));\n              }\n              n.beginAnimationOnStart = e.beginAnimationOnStart, n.beginAnimationFrom = e.beginAnimationFrom, n.beginAnimationTo = e.beginAnimationTo, n.beginAnimationLoop = e.beginAnimationLoop;\n            }\n            if (e.autoAnimate && a && a.beginAnimation(n, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), n.startDelay = 0 | e.startDelay, n.minAngularSpeed = e.minAngularSpeed, n.maxAngularSpeed = e.maxAngularSpeed, n.minSize = e.minSize, n.maxSize = e.maxSize, e.minScaleX && (n.minScaleX = e.minScaleX, n.maxScaleX = e.maxScaleX, n.minScaleY = e.minScaleY, n.maxScaleY = e.maxScaleY), e.preWarmCycles !== void 0 && (n.preWarmCycles = e.preWarmCycles, n.preWarmStepOffset = e.preWarmStepOffset), e.minInitialRotation !== void 0 && (n.minInitialRotation = e.minInitialRotation, n.maxInitialRotation = e.maxInitialRotation), n.minLifeTime = e.minLifeTime, n.maxLifeTime = e.maxLifeTime, n.minEmitPower = e.minEmitPower, n.maxEmitPower = e.maxEmitPower, n.emitRate = e.emitRate, n.gravity = u.e.FromArray(e.gravity), e.noiseStrength && (n.noiseStrength = u.e.FromArray(e.noiseStrength)), n.color1 = I.b.FromArray(e.color1), n.color2 = I.b.FromArray(e.color2), n.colorDead = I.b.FromArray(e.colorDead), n.updateSpeed = e.updateSpeed, n.targetStopDuration = e.targetStopDuration, n.blendMode = e.blendMode, e.colorGradients)\n              for (var R = 0, B = e.colorGradients; R < B.length; R++) {\n                var F = B[R];\n                n.addColorGradient(F.gradient, I.b.FromArray(F.color1), F.color2 ? I.b.FromArray(F.color2) : void 0);\n              }\n            if (e.rampGradients) {\n              for (var z = 0, J = e.rampGradients; z < J.length; z++) {\n                var ie = J[z];\n                n.addRampGradient(ie.gradient, I.a.FromArray(ie.color));\n              }\n              n.useRampGradients = e.useRampGradients;\n            }\n            if (e.colorRemapGradients)\n              for (var se = 0, ce = e.colorRemapGradients; se < ce.length; se++) {\n                var ue = ce[se];\n                n.addColorRemapGradient(ue.gradient, ue.factor1 !== void 0 ? ue.factor1 : ue.factor, ue.factor2);\n              }\n            if (e.alphaRemapGradients)\n              for (var fe = 0, ve = e.alphaRemapGradients; fe < ve.length; fe++) {\n                var Te = ve[fe];\n                n.addAlphaRemapGradient(Te.gradient, Te.factor1 !== void 0 ? Te.factor1 : Te.factor, Te.factor2);\n              }\n            if (e.sizeGradients)\n              for (var Re = 0, Ae = e.sizeGradients; Re < Ae.length; Re++) {\n                var Ee = Ae[Re];\n                n.addSizeGradient(Ee.gradient, Ee.factor1 !== void 0 ? Ee.factor1 : Ee.factor, Ee.factor2);\n              }\n            if (e.angularSpeedGradients)\n              for (var Se = 0, De = e.angularSpeedGradients; Se < De.length; Se++) {\n                var xe = De[Se];\n                n.addAngularSpeedGradient(xe.gradient, xe.factor1 !== void 0 ? xe.factor1 : xe.factor, xe.factor2);\n              }\n            if (e.velocityGradients)\n              for (var Le = 0, Me = e.velocityGradients; Le < Me.length; Le++) {\n                var we = Me[Le];\n                n.addVelocityGradient(we.gradient, we.factor1 !== void 0 ? we.factor1 : we.factor, we.factor2);\n              }\n            if (e.dragGradients)\n              for (var Ye = 0, et = e.dragGradients; Ye < et.length; Ye++) {\n                var nt = et[Ye];\n                n.addDragGradient(nt.gradient, nt.factor1 !== void 0 ? nt.factor1 : nt.factor, nt.factor2);\n              }\n            if (e.emitRateGradients)\n              for (var ct = 0, Ke = e.emitRateGradients; ct < Ke.length; ct++) {\n                var rt = Ke[ct];\n                n.addEmitRateGradient(rt.gradient, rt.factor1 !== void 0 ? rt.factor1 : rt.factor, rt.factor2);\n              }\n            if (e.startSizeGradients)\n              for (var it = 0, qe = e.startSizeGradients; it < qe.length; it++) {\n                var ut = qe[it];\n                n.addStartSizeGradient(ut.gradient, ut.factor1 !== void 0 ? ut.factor1 : ut.factor, ut.factor2);\n              }\n            if (e.lifeTimeGradients)\n              for (var Ve = 0, Ze = e.lifeTimeGradients; Ve < Ze.length; Ve++) {\n                var vt = Ze[Ve];\n                n.addLifeTimeGradient(vt.gradient, vt.factor1 !== void 0 ? vt.factor1 : vt.factor, vt.factor2);\n              }\n            if (e.limitVelocityGradients) {\n              for (var jt = 0, Dt = e.limitVelocityGradients; jt < Dt.length; jt++) {\n                var Yt = Dt[jt];\n                n.addLimitVelocityGradient(Yt.gradient, Yt.factor1 !== void 0 ? Yt.factor1 : Yt.factor, Yt.factor2);\n              }\n              n.limitVelocityDamping = e.limitVelocityDamping;\n            }\n            if (e.noiseTexture && a) {\n              var mt = O.a.GetClass(\"BABYLON.ProceduralTexture\");\n              n.noiseTexture = mt.Parse(e.noiseTexture, a, o);\n            }\n            if (e.particleEmitterType) {\n              switch (e.particleEmitterType.type) {\n                case \"SphereParticleEmitter\":\n                  s = new aa();\n                  break;\n                case \"SphereDirectedParticleEmitter\":\n                  s = new Zs();\n                  break;\n                case \"ConeEmitter\":\n                case \"ConeParticleEmitter\":\n                  s = new Ys();\n                  break;\n                case \"CylinderParticleEmitter\":\n                  s = new oa();\n                  break;\n                case \"CylinderDirectedParticleEmitter\":\n                  s = new Ks();\n                  break;\n                case \"HemisphericParticleEmitter\":\n                  s = new Qs();\n                  break;\n                case \"PointParticleEmitter\":\n                  s = new qs();\n                  break;\n                case \"MeshParticleEmitter\":\n                  s = new Ku();\n                  break;\n                case \"BoxEmitter\":\n                case \"BoxParticleEmitter\":\n                default:\n                  s = new xr();\n              }\n              s.parse(e.particleEmitterType, a);\n            } else\n              (s = new xr()).parse(e, a);\n            n.particleEmitterType = s, n.startSpriteCellID = e.startSpriteCellID, n.endSpriteCellID = e.endSpriteCellID, n.spriteCellWidth = e.spriteCellWidth, n.spriteCellHeight = e.spriteCellHeight, n.spriteCellChangeSpeed = e.spriteCellChangeSpeed, n.spriteRandomStartCell = e.spriteRandomStartCell;\n          }, t.Parse = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a, s = e.name, d = null, p = null;\n            if (a = n instanceof wt.a ? n : n.getEngine(), e.customShader && a.createEffectForParticles) {\n              var y = (p = e.customShader).shaderOptions.defines.length > 0 ? p.shaderOptions.defines.join(`\n`) : \"\";\n              d = a.createEffectForParticles(p.shaderPath.fragmentElement, p.shaderOptions.uniforms, p.shaderOptions.samplers, y);\n            }\n            var P = new t(s, e.capacity, n, d, e.isAnimationSheetEnabled);\n            if (P.customShader = p, e.id && (P.id = e.id), e.subEmitters) {\n              P.subEmitters = [];\n              for (var R = 0, B = e.subEmitters; R < B.length; R++) {\n                for (var F = [], z = 0, J = B[R]; z < J.length; z++) {\n                  var ie = J[z];\n                  F.push(mo.Parse(ie, n, i));\n                }\n                P.subEmitters.push(F);\n              }\n            }\n            return t._Parse(e, P, n, i), e.textureMask && (P.textureMask = I.b.FromArray(e.textureMask)), e.preventAutoStart && (P.preventAutoStart = e.preventAutoStart), o || P.preventAutoStart || P.start(), P;\n          }, t.BILLBOARDMODE_Y = h.a.PARTICLES_BILLBOARDMODE_Y, t.BILLBOARDMODE_ALL = h.a.PARTICLES_BILLBOARDMODE_ALL, t.BILLBOARDMODE_STRETCHED = h.a.PARTICLES_BILLBOARDMODE_STRETCHED, t;\n        }(co);\n        mo._ParseParticleSystem = cn.Parse, ze.a.ShadersStore.gpuUpdateParticlesPixelShader = `#version 300 es\nvoid main() {\ndiscard;\n}\n`;\n        var fm = `#version 300 es\n#define PI 3.14159\nuniform float currentCount;\nuniform float timeDelta;\nuniform float stopFactor;\n#ifndef LOCAL\nuniform mat4 emitterWM;\n#endif\nuniform vec2 lifeTime;\nuniform vec2 emitPower;\nuniform vec2 sizeRange;\nuniform vec4 scaleRange;\n#ifndef COLORGRADIENTS\nuniform vec4 color1;\nuniform vec4 color2;\n#endif\nuniform vec3 gravity;\nuniform sampler2D randomSampler;\nuniform sampler2D randomSampler2;\nuniform vec4 angleRange;\n#ifdef BOXEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\nuniform vec3 minEmitBox;\nuniform vec3 maxEmitBox;\n#endif\n#ifdef POINTEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#endif\n#ifdef HEMISPHERICEMITTER\nuniform float radius;\nuniform float radiusRange;\nuniform float directionRandomizer;\n#endif\n#ifdef SPHEREEMITTER\nuniform float radius;\nuniform float radiusRange;\n#ifdef DIRECTEDSPHEREEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nuniform float radius;\nuniform float height;\nuniform float radiusRange;\n#ifdef DIRECTEDCYLINDEREMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CONEEMITTER\nuniform vec2 radius;\nuniform float coneAngle;\nuniform vec2 height;\nuniform float directionRandomizer;\n#endif\n\nin vec3 position;\n#ifdef CUSTOMEMITTER\nin vec3 initialPosition;\n#endif\nin float age;\nin float life;\nin vec4 seed;\nin vec3 size;\n#ifndef COLORGRADIENTS\nin vec4 color;\n#endif\nin vec3 direction;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nin float angle;\n#else\nin vec2 angle;\n#endif\n#ifdef ANIMATESHEET\nin float cellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nin float cellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nin vec3 noiseCoordinates1;\nin vec3 noiseCoordinates2;\n#endif\n\nout vec3 outPosition;\n#ifdef CUSTOMEMITTER\nout vec3 outInitialPosition;\n#endif\nout float outAge;\nout float outLife;\nout vec4 outSeed;\nout vec3 outSize;\n#ifndef COLORGRADIENTS\nout vec4 outColor;\n#endif\nout vec3 outDirection;\n#ifndef BILLBOARD\nout vec3 outInitialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nout float outAngle;\n#else\nout vec2 outAngle;\n#endif\n#ifdef ANIMATESHEET\nout float outCellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nout float outCellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nout vec3 outNoiseCoordinates1;\nout vec3 outNoiseCoordinates2;\n#endif\n#ifdef SIZEGRADIENTS\nuniform sampler2D sizeGradientSampler;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nuniform sampler2D angularSpeedGradientSampler;\n#endif\n#ifdef VELOCITYGRADIENTS\nuniform sampler2D velocityGradientSampler;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nuniform sampler2D limitVelocityGradientSampler;\nuniform float limitVelocityDamping;\n#endif\n#ifdef DRAGGRADIENTS\nuniform sampler2D dragGradientSampler;\n#endif\n#ifdef NOISE\nuniform vec3 noiseStrength;\nuniform sampler2D noiseSampler;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 cellInfos;\n#endif\nvec3 getRandomVec3(float offset) {\nreturn texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;\n}\nvec4 getRandomVec4(float offset) {\nreturn texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));\n}\nvoid main() {\nfloat newAge=age+timeDelta;\n\nif (newAge>=life && stopFactor != 0.) {\nvec3 newPosition;\nvec3 newDirection;\n\nvec4 randoms=getRandomVec4(seed.x);\n\noutLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;\noutAge=newAge-life;\n\noutSeed=seed;\n\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(0,0)).r;\n#else\noutSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;\n#endif\noutSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;\noutSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a;\n#ifndef COLORGRADIENTS\n\noutColor=color1+(color2-color1)*randoms.b;\n#endif\n\n#ifndef ANGULARSPEEDGRADIENTS\noutAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;\noutAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#else\noutAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#endif\n\n#ifdef POINTEMITTER\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=vec3(0,0,0);\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(HEMISPHERICEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);\nnewDirection=newPosition+directionRandomizer*randoms3;\n#elif defined(SPHEREEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nnewDirection=newPosition+directionRandomizer*randoms3;\n#endif\n#elif defined(CYLINDEREMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat yPos=(randoms2.x-0.5)*height;\nfloat angle=randoms2.y*PI*2.;\nfloat inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));\nfloat positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));\nfloat xPos=positionRadius*cos(angle);\nfloat zPos=positionRadius*sin(angle);\nnewPosition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nangle=angle+((randoms3.x-0.5)*PI);\nnewDirection=vec3(cos(angle),randoms3.y-0.5,sin(angle));\nnewDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nfloat s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.0001;\n#else\nfloat h=randoms2.y*height.y;\n\nh=1.-h*h;\n#endif\nfloat lRadius=radius.x-radius.x*randoms2.z*radius.y;\nlRadius=lRadius*h;\nfloat randX=lRadius*sin(s);\nfloat randZ=lRadius*cos(s);\nfloat randY=h*height.x;\nnewPosition=vec3(randX,randY,randZ);\n\nif (abs(cos(coneAngle)) == 1.0) {\nnewDirection=vec3(0.,1.0,0.);\n} else {\nvec3 randoms3=getRandomVec3(seed.z);\nnewDirection=normalize(newPosition+directionRandomizer*randoms3);\n}\n#elif defined(CUSTOMEMITTER)\nnewPosition=initialPosition;\noutInitialPosition=initialPosition;\n#else\n\nnewPosition=vec3(0.,0.,0.);\n\nnewDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\n#ifdef LOCAL\noutPosition=newPosition;\n#else\noutPosition=(emitterWM*vec4(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#ifndef BILLBOARD\noutInitialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nvec3 initial=newDirection;\n#else\nvec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;\n#endif\noutDirection=initial*power;\n#ifndef BILLBOARD\noutInitialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET\noutCellIndex=cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=randoms.a*outLife;\n#endif\n#endif\n#ifdef NOISE\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n} else {\nfloat directionScale=timeDelta;\noutAge=newAge;\nfloat ageGradient=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#if defined(CUSTOMEMITTER)\noutPosition=position+(direction-position)*ageGradient;\noutInitialPosition=initialPosition;\n#else\noutPosition=position+direction*directionScale;\n#endif\noutLife=life;\noutSeed=seed;\n#ifndef COLORGRADIENTS\noutColor=color;\n#endif\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;\noutSize.yz=size.yz;\n#else\noutSize=size;\n#endif\n#ifndef BILLBOARD\noutInitialDirection=initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#else\nvec3 updatedDirection=direction+gravity*timeDelta;\n#ifdef LIMITVELOCITYGRADIENTS\nfloat limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;\nfloat currentVelocity=length(updatedDirection);\nif (currentVelocity>limitVelocity) {\nupdatedDirection=updatedDirection*limitVelocityDamping;\n}\n#endif\noutDirection=updatedDirection;\n#ifdef NOISE\nfloat fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;\nvec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;\noutDirection=outDirection+force*timeDelta;\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nfloat angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;\noutAngle=angle+angularSpeed*timeDelta;\n#else\noutAngle=vec2(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET\nfloat offsetAge=outAge;\nfloat dist=cellInfos.y-cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=cellStartOffset;\noffsetAge+=cellStartOffset;\n#else\nfloat cellStartOffset=0.;\n#endif\nfloat ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);\noutCellIndex=float(int(cellInfos.x+ratio*dist));\n#endif\n}\n}`;\n        ze.a.ShadersStore.gpuUpdateParticlesVertexShader = fm;\n        var pm = `#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nin float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nin float fClipDistance6;\n#endif`;\n        ze.a.IncludesShadersStore.clipPlaneFragmentDeclaration2 = pm;\n        var _m = `#version 300 es\nuniform sampler2D diffuseSampler;\nin vec2 vUV;\nin vec4 vColor;\nout vec4 outFragColor;\n#include<clipPlaneFragmentDeclaration2>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main() {\n#include<clipPlaneFragment>\nvec4 textureColor=texture(diffuseSampler,vUV);\noutFragColor=textureColor*vColor;\n#ifdef BLENDMULTIPLYMODE\nfloat alpha=vColor.a*textureColor.a;\noutFragColor.rgb=outFragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\noutFragColor=applyImageProcessing(outFragColor);\n#endif\n#endif\n}\n`;\n        ze.a.ShadersStore.gpuRenderParticlesPixelShader = _m;\n        var mm = `#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nout float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nout float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nout float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nout float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nout float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nout float fClipDistance6;\n#endif`;\n        ze.a.IncludesShadersStore.clipPlaneVertexDeclaration2 = mm;\n        var gm = `#version 300 es\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\nuniform vec3 worldOffset;\n#ifdef LOCAL\nuniform mat4 emitterWM;\n#endif\n\nin vec3 position;\nin float age;\nin float life;\nin vec3 size;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef BILLBOARDSTRETCHED\nin vec3 direction;\n#endif\nin float angle;\n#ifdef ANIMATESHEET\nin float cellIndex;\n#endif\nin vec2 offset;\nin vec2 uv;\nout vec2 vUV;\nout vec4 vColor;\nout vec3 vPositionW;\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration2>\n#ifdef COLORGRADIENTS\nuniform sampler2D colorGradientSampler;\n#else\nuniform vec4 colorDead;\nin vec4 color;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 sheetInfos;\n#endif\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#endif\nvoid main() {\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/sheetInfos.z);\nfloat columnOffset=cellIndex-rowOffset*sheetInfos.z;\nvec2 uvScale=sheetInfos.xy;\nvec2 uvOffset=vec2(uv.x ,1.0-uv.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=uv;\n#endif\nfloat ratio=age/life;\n#ifdef COLORGRADIENTS\nvColor=texture(colorGradientSampler,vec2(ratio,0));\n#else\nvColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);\n#endif\nvec2 cornerPos=(offset-translationPivot)*size.yz*size.x+translationPivot;\n#ifdef BILLBOARD\nvec4 rotatedCorner;\nrotatedCorner.w=0.;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=(position+worldOffset)-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=(position+worldOffset)-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#else\n\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\n#ifdef LOCAL\nvec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;\n#else\nvec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;\n#endif\nvPositionW=(invView*viewPosition).xyz;\n#endif\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=0.;\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nvec3 yaxis=normalize(initialDirection);\nvPositionW=rotate(yaxis,rotatedCorner);\n\nvec4 viewPosition=view*vec4(vPositionW,1.0);\n#endif\ngl_Position=projection*viewPosition;\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}`;\n        ze.a.ShadersStore.gpuRenderParticlesVertexShader = gm;\n        var Zi = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !1), a === void 0 && (a = null);\n            var s = r.call(this, e) || this;\n            s.layerMask = 268435455, s._accumulatedCount = 0, s._targetIndex = 0, s._currentRenderId = -1, s._started = !1, s._stopped = !1, s._timeDelta = 0, s._actualFrame = 0, s._rawTextureWidth = 256, s.onDisposeObservable = new C.c(), s.onStoppedObservable = new C.c(), s.forceDepthWrite = !1, s._preWarmDone = !1, s.isLocal = !1, s._onBeforeDrawParticlesObservable = null, i && i.getClassName() !== \"Scene\" ? (s._engine = i, s.defaultProjectionMatrix = u.a.PerspectiveFovLH(0.8, 1, 0.1, 100)) : (s._scene = i || te.a.LastCreatedScene, s._engine = s._scene.getEngine(), s.uniqueId = s._scene.getUniqueId(), s._scene.particleSystems.push(s)), s._customEffect = { 0: a }, s._attachImageProcessingConfiguration(null), n.randomTextureSize || delete n.randomTextureSize;\n            var d = Object(c.a)({ capacity: 5e4, randomTextureSize: s._engine.getCaps().maxTextureSize }, n), p = n;\n            isFinite(p) && (d.capacity = p), s._capacity = d.capacity, s._activeCount = d.capacity, s._currentActiveCount = 0, s._isAnimationSheetEnabled = o, s._updateEffectOptions = { attributes: [\"position\", \"initialPosition\", \"age\", \"life\", \"seed\", \"size\", \"color\", \"direction\", \"initialDirection\", \"angle\", \"cellIndex\", \"cellStartOffset\", \"noiseCoordinates1\", \"noiseCoordinates2\"], uniformsNames: [\"currentCount\", \"timeDelta\", \"emitterWM\", \"lifeTime\", \"color1\", \"color2\", \"sizeRange\", \"scaleRange\", \"gravity\", \"emitPower\", \"direction1\", \"direction2\", \"minEmitBox\", \"maxEmitBox\", \"radius\", \"directionRandomizer\", \"height\", \"coneAngle\", \"stopFactor\", \"angleRange\", \"radiusRange\", \"cellInfos\", \"noiseStrength\", \"limitVelocityDamping\"], uniformBuffersNames: [], samplers: [\"randomSampler\", \"randomSampler2\", \"sizeGradientSampler\", \"angularSpeedGradientSampler\", \"velocityGradientSampler\", \"limitVelocityGradientSampler\", \"noiseSampler\", \"dragGradientSampler\"], defines: \"\", fallbacks: null, onCompiled: null, onError: null, indexParameters: null, maxSimultaneousLights: 0, transformFeedbackVaryings: [] }, s.particleEmitterType = new xr();\n            for (var y = Math.min(s._engine.getCaps().maxTextureSize, d.randomTextureSize), P = [], R = 0; R < y; ++R)\n              P.push(Math.random()), P.push(Math.random()), P.push(Math.random()), P.push(Math.random());\n            for (s._randomTexture = new Zn(new Float32Array(P), y, 1, h.a.TEXTUREFORMAT_RGBA, i, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT), s._randomTexture.wrapU = h.a.TEXTURE_WRAP_ADDRESSMODE, s._randomTexture.wrapV = h.a.TEXTURE_WRAP_ADDRESSMODE, P = [], R = 0; R < y; ++R)\n              P.push(Math.random()), P.push(Math.random()), P.push(Math.random()), P.push(Math.random());\n            return s._randomTexture2 = new Zn(new Float32Array(P), y, 1, h.a.TEXTUREFORMAT_RGBA, i, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT), s._randomTexture2.wrapU = h.a.TEXTURE_WRAP_ADDRESSMODE, s._randomTexture2.wrapV = h.a.TEXTURE_WRAP_ADDRESSMODE, s._randomTextureSize = y, s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t, \"IsSupported\", { get: function() {\n            return !!te.a.LastCreatedEngine && te.a.LastCreatedEngine.webGLVersion > 1;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getCapacity = function() {\n            return this._capacity;\n          }, Object.defineProperty(t.prototype, \"activeParticleCount\", { get: function() {\n            return this._activeCount;\n          }, set: function(e) {\n            this._activeCount = Math.min(e, this._capacity);\n          }, enumerable: !1, configurable: !0 }), t.prototype.isReady = function() {\n            return this._updateEffect ? !!(this.emitter && this._updateEffect.isReady() && (!this._imageProcessingConfiguration || this._imageProcessingConfiguration.isReady()) && this._getEffect().isReady() && this.particleTexture && this.particleTexture.isReady()) : (this._recreateUpdateEffect(), this._recreateRenderEffect(), !1);\n          }, t.prototype.isStarted = function() {\n            return this._started;\n          }, t.prototype.isStopped = function() {\n            return this._stopped;\n          }, t.prototype.isStopping = function() {\n            return !1;\n          }, t.prototype.getActiveCount = function() {\n            return this._currentActiveCount;\n          }, t.prototype.start = function(e) {\n            var n = this;\n            if (e === void 0 && (e = this.startDelay), !this.targetStopDuration && this._hasTargetStopDurationDependantGradient())\n              throw \"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set\";\n            e ? setTimeout(function() {\n              n.start(0);\n            }, e) : (this._started = !0, this._stopped = !1, this._preWarmDone = !1, this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop));\n          }, t.prototype.stop = function() {\n            this._stopped || (this._stopped = !0);\n          }, t.prototype.reset = function() {\n            this._releaseBuffers(), this._releaseVAOs(), this._currentActiveCount = 0, this._targetIndex = 0;\n          }, t.prototype.getClassName = function() {\n            return \"GPUParticleSystem\";\n          }, t.prototype.getCustomEffect = function(e) {\n            var n;\n            return e === void 0 && (e = 0), (n = this._customEffect[e]) !== null && n !== void 0 ? n : this._customEffect[0];\n          }, t.prototype.setCustomEffect = function(e, n) {\n            n === void 0 && (n = 0), this._customEffect[n] = e;\n          }, Object.defineProperty(t.prototype, \"onBeforeDrawParticlesObservable\", { get: function() {\n            return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new C.c()), this._onBeforeDrawParticlesObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vertexShaderName\", { get: function() {\n            return \"gpuRenderParticles\";\n          }, enumerable: !1, configurable: !0 }), t.prototype._removeGradientAndTexture = function(e, n, i) {\n            return r.prototype._removeGradientAndTexture.call(this, e, n, i), this._releaseBuffers(), this;\n          }, t.prototype.addColorGradient = function(e, n, i) {\n            this._colorGradients || (this._colorGradients = []);\n            var o = new gc(e, n);\n            return this._colorGradients.push(o), this._refreshColorGradient(!0), this._releaseBuffers(), this;\n          }, t.prototype._refreshColorGradient = function(e) {\n            e === void 0 && (e = !1), this._colorGradients && (e && this._colorGradients.sort(function(n, i) {\n              return n.gradient < i.gradient ? -1 : n.gradient > i.gradient ? 1 : 0;\n            }), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null));\n          }, t.prototype.forceRefreshGradients = function() {\n            this._refreshColorGradient(), this._refreshFactorGradient(this._sizeGradients, \"_sizeGradientsTexture\"), this._refreshFactorGradient(this._angularSpeedGradients, \"_angularSpeedGradientsTexture\"), this._refreshFactorGradient(this._velocityGradients, \"_velocityGradientsTexture\"), this._refreshFactorGradient(this._limitVelocityGradients, \"_limitVelocityGradientsTexture\"), this._refreshFactorGradient(this._dragGradients, \"_dragGradientsTexture\"), this.reset();\n          }, t.prototype.removeColorGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._colorGradients, this._colorGradientsTexture), this._colorGradientsTexture = null, this;\n          }, t.prototype._addFactorGradient = function(e, n, i) {\n            var o = new vc(n, i);\n            e.push(o), this._releaseBuffers();\n          }, t.prototype.addSizeGradient = function(e, n) {\n            return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, n), this._refreshFactorGradient(this._sizeGradients, \"_sizeGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeSizeGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._sizeGradients, this._sizeGradientsTexture), this._sizeGradientsTexture = null, this;\n          }, t.prototype._refreshFactorGradient = function(e, n, i) {\n            i === void 0 && (i = !1), e && (i && e.sort(function(o, a) {\n              return o.gradient < a.gradient ? -1 : o.gradient > a.gradient ? 1 : 0;\n            }), this[n] && (this[n].dispose(), this[n] = null));\n          }, t.prototype.addAngularSpeedGradient = function(e, n) {\n            return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, n), this._refreshFactorGradient(this._angularSpeedGradients, \"_angularSpeedGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeAngularSpeedGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._angularSpeedGradients, this._angularSpeedGradientsTexture), this._angularSpeedGradientsTexture = null, this;\n          }, t.prototype.addVelocityGradient = function(e, n) {\n            return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, n), this._refreshFactorGradient(this._velocityGradients, \"_velocityGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeVelocityGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._velocityGradients, this._velocityGradientsTexture), this._velocityGradientsTexture = null, this;\n          }, t.prototype.addLimitVelocityGradient = function(e, n) {\n            return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, n), this._refreshFactorGradient(this._limitVelocityGradients, \"_limitVelocityGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeLimitVelocityGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._limitVelocityGradients, this._limitVelocityGradientsTexture), this._limitVelocityGradientsTexture = null, this;\n          }, t.prototype.addDragGradient = function(e, n) {\n            return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, n), this._refreshFactorGradient(this._dragGradients, \"_dragGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeDragGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._dragGradients, this._dragGradientsTexture), this._dragGradientsTexture = null, this;\n          }, t.prototype.addEmitRateGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeEmitRateGradient = function(e) {\n            return this;\n          }, t.prototype.addStartSizeGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeStartSizeGradient = function(e) {\n            return this;\n          }, t.prototype.addColorRemapGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeColorRemapGradient = function() {\n            return this;\n          }, t.prototype.addAlphaRemapGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeAlphaRemapGradient = function() {\n            return this;\n          }, t.prototype.addRampGradient = function(e, n) {\n            return this;\n          }, t.prototype.removeRampGradient = function() {\n            return this;\n          }, t.prototype.getRampGradients = function() {\n            return null;\n          }, Object.defineProperty(t.prototype, \"useRampGradients\", { get: function() {\n            return !1;\n          }, set: function(e) {\n          }, enumerable: !1, configurable: !0 }), t.prototype.addLifeTimeGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeLifeTimeGradient = function(e) {\n            return this;\n          }, t.prototype._reset = function() {\n            this._releaseBuffers();\n          }, t.prototype._createUpdateVAO = function(e) {\n            var n = {};\n            n.position = e.createVertexBuffer(\"position\", 0, 3);\n            var i = 3;\n            this.particleEmitterType instanceof Cr && (n.initialPosition = e.createVertexBuffer(\"initialPosition\", i, 3), i += 3), n.age = e.createVertexBuffer(\"age\", i, 1), i += 1, n.life = e.createVertexBuffer(\"life\", i, 1), i += 1, n.seed = e.createVertexBuffer(\"seed\", i, 4), i += 4, n.size = e.createVertexBuffer(\"size\", i, 3), i += 3, this._colorGradientsTexture || (n.color = e.createVertexBuffer(\"color\", i, 4), i += 4), n.direction = e.createVertexBuffer(\"direction\", i, 3), i += 3, this._isBillboardBased || (n.initialDirection = e.createVertexBuffer(\"initialDirection\", i, 3), i += 3), this._angularSpeedGradientsTexture ? (n.angle = e.createVertexBuffer(\"angle\", i, 1), i += 1) : (n.angle = e.createVertexBuffer(\"angle\", i, 2), i += 2), this._isAnimationSheetEnabled && (n.cellIndex = e.createVertexBuffer(\"cellIndex\", i, 1), i += 1, this.spriteRandomStartCell && (n.cellStartOffset = e.createVertexBuffer(\"cellStartOffset\", i, 1), i += 1)), this.noiseTexture && (n.noiseCoordinates1 = e.createVertexBuffer(\"noiseCoordinates1\", i, 3), i += 3, n.noiseCoordinates2 = e.createVertexBuffer(\"noiseCoordinates2\", i, 3), i += 3);\n            var o = this._engine.recordVertexArrayObject(n, null, this._updateEffect);\n            return this._engine.bindArrayBuffer(null), o;\n          }, t.prototype._createRenderVAO = function(e, n) {\n            var i = {};\n            i.position = e.createVertexBuffer(\"position\", 0, 3, this._attributesStrideSize, !0);\n            var o = 3;\n            this.particleEmitterType instanceof Cr && (o += 3), i.age = e.createVertexBuffer(\"age\", o, 1, this._attributesStrideSize, !0), o += 1, i.life = e.createVertexBuffer(\"life\", o, 1, this._attributesStrideSize, !0), o += 5, i.size = e.createVertexBuffer(\"size\", o, 3, this._attributesStrideSize, !0), o += 3, this._colorGradientsTexture || (i.color = e.createVertexBuffer(\"color\", o, 4, this._attributesStrideSize, !0), o += 4), this.billboardMode === cn.BILLBOARDMODE_STRETCHED && (i.direction = e.createVertexBuffer(\"direction\", o, 3, this._attributesStrideSize, !0)), o += 3, this._isBillboardBased || (i.initialDirection = e.createVertexBuffer(\"initialDirection\", o, 3, this._attributesStrideSize, !0), o += 3), i.angle = e.createVertexBuffer(\"angle\", o, 1, this._attributesStrideSize, !0), this._angularSpeedGradientsTexture ? o++ : o += 2, this._isAnimationSheetEnabled && (i.cellIndex = e.createVertexBuffer(\"cellIndex\", o, 1, this._attributesStrideSize, !0), o += 1, this.spriteRandomStartCell && (i.cellStartOffset = e.createVertexBuffer(\"cellStartOffset\", o, 1, this._attributesStrideSize, !0), o += 1)), this.noiseTexture && (i.noiseCoordinates1 = e.createVertexBuffer(\"noiseCoordinates1\", o, 3, this._attributesStrideSize, !0), o += 3, i.noiseCoordinates2 = e.createVertexBuffer(\"noiseCoordinates2\", o, 3, this._attributesStrideSize, !0), o += 3), i.offset = n.createVertexBuffer(\"offset\", 0, 2), i.uv = n.createVertexBuffer(\"uv\", 2, 2);\n            var a = this._engine.recordVertexArrayObject(i, null, this._getEffect());\n            return this._engine.bindArrayBuffer(null), a;\n          }, t.prototype._initialize = function(e) {\n            if (e === void 0 && (e = !1), !this._buffer0 || e) {\n              var n = this._engine, i = new Array();\n              this._attributesStrideSize = 21, this._targetIndex = 0, this.particleEmitterType instanceof Cr && (this._attributesStrideSize += 3), this.isBillboardBased || (this._attributesStrideSize += 3), this._colorGradientsTexture && (this._attributesStrideSize -= 4), this._angularSpeedGradientsTexture && (this._attributesStrideSize -= 1), this._isAnimationSheetEnabled && (this._attributesStrideSize += 1, this.spriteRandomStartCell && (this._attributesStrideSize += 1)), this.noiseTexture && (this._attributesStrideSize += 6);\n              for (var o = this.particleEmitterType instanceof Cr, a = u.c.Vector3[0], s = 0; s < this._capacity; s++)\n                i.push(0), i.push(0), i.push(0), o && (this.particleEmitterType.particlePositionGenerator(s, null, a), i.push(a.x), i.push(a.y), i.push(a.z)), i.push(0), i.push(0), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(0), i.push(0), i.push(0), this._colorGradientsTexture || (i.push(0), i.push(0), i.push(0), i.push(0)), o ? (this.particleEmitterType.particleDestinationGenerator(s, null, a), i.push(a.x), i.push(a.y), i.push(a.z)) : (i.push(0), i.push(0), i.push(0)), this.isBillboardBased || (i.push(0), i.push(0), i.push(0)), i.push(0), this._angularSpeedGradientsTexture || i.push(0), this._isAnimationSheetEnabled && (i.push(0), this.spriteRandomStartCell && i.push(0)), this.noiseTexture && (i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()));\n              var d = new Float32Array([0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1, -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0]);\n              this._buffer0 = new Oe.a(n, i, !1, this._attributesStrideSize), this._buffer1 = new Oe.a(n, i, !1, this._attributesStrideSize), this._spriteBuffer = new Oe.a(n, d, !1, 4), this._updateVAO = [], this._updateVAO.push(this._createUpdateVAO(this._buffer0)), this._updateVAO.push(this._createUpdateVAO(this._buffer1)), this._renderVAO = [], this._renderVAO.push(this._createRenderVAO(this._buffer1, this._spriteBuffer)), this._renderVAO.push(this._createRenderVAO(this._buffer0, this._spriteBuffer)), this._sourceBuffer = this._buffer0, this._targetBuffer = this._buffer1;\n            }\n          }, t.prototype._recreateUpdateEffect = function() {\n            var e = this.particleEmitterType ? this.particleEmitterType.getEffectDefines() : \"\";\n            this._isBillboardBased && (e += `\n#define BILLBOARD`), this._colorGradientsTexture && (e += `\n#define COLORGRADIENTS`), this._sizeGradientsTexture && (e += `\n#define SIZEGRADIENTS`), this._angularSpeedGradientsTexture && (e += `\n#define ANGULARSPEEDGRADIENTS`), this._velocityGradientsTexture && (e += `\n#define VELOCITYGRADIENTS`), this._limitVelocityGradientsTexture && (e += `\n#define LIMITVELOCITYGRADIENTS`), this._dragGradientsTexture && (e += `\n#define DRAGGRADIENTS`), this.isAnimationSheetEnabled && (e += `\n#define ANIMATESHEET`, this.spriteRandomStartCell && (e += `\n#define ANIMATESHEETRANDOMSTART`)), this.noiseTexture && (e += `\n#define NOISE`), this.isLocal && (e += `\n#define LOCAL`), this._updateEffect && this._updateEffectOptions.defines === e || (this._updateEffectOptions.transformFeedbackVaryings = [\"outPosition\"], this.particleEmitterType instanceof Cr && this._updateEffectOptions.transformFeedbackVaryings.push(\"outInitialPosition\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outAge\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outLife\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outSeed\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outSize\"), this._colorGradientsTexture || this._updateEffectOptions.transformFeedbackVaryings.push(\"outColor\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outDirection\"), this._isBillboardBased || this._updateEffectOptions.transformFeedbackVaryings.push(\"outInitialDirection\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outAngle\"), this.isAnimationSheetEnabled && (this._updateEffectOptions.transformFeedbackVaryings.push(\"outCellIndex\"), this.spriteRandomStartCell && this._updateEffectOptions.transformFeedbackVaryings.push(\"outCellStartOffset\")), this.noiseTexture && (this._updateEffectOptions.transformFeedbackVaryings.push(\"outNoiseCoordinates1\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outNoiseCoordinates2\")), this._updateEffectOptions.defines = e, this._updateEffect = new ze.a(\"gpuUpdateParticles\", this._updateEffectOptions, this._engine));\n          }, t.prototype._getEffect = function() {\n            var e;\n            return (e = this.getCustomEffect()) !== null && e !== void 0 ? e : this._renderEffect;\n          }, t.prototype.fillDefines = function(e, n) {\n            if (this._scene && (this._scene.clipPlane && e.push(\"#define CLIPPLANE\"), this._scene.clipPlane2 && e.push(\"#define CLIPPLANE2\"), this._scene.clipPlane3 && e.push(\"#define CLIPPLANE3\"), this._scene.clipPlane4 && e.push(\"#define CLIPPLANE4\"), this._scene.clipPlane5 && e.push(\"#define CLIPPLANE5\"), this._scene.clipPlane6 && e.push(\"#define CLIPPLANE6\")), this.blendMode === cn.BLENDMODE_MULTIPLY && e.push(\"#define BLENDMULTIPLYMODE\"), this.isLocal && e.push(\"#define LOCAL\"), this._isBillboardBased)\n              switch (e.push(\"#define BILLBOARD\"), this.billboardMode) {\n                case cn.BILLBOARDMODE_Y:\n                  e.push(\"#define BILLBOARDY\");\n                  break;\n                case cn.BILLBOARDMODE_STRETCHED:\n                  e.push(\"#define BILLBOARDSTRETCHED\");\n                  break;\n                case cn.BILLBOARDMODE_ALL:\n                  e.push(\"#define BILLBOARDMODE_ALL\");\n              }\n            this._colorGradientsTexture && e.push(\"#define COLORGRADIENTS\"), this.isAnimationSheetEnabled && e.push(\"#define ANIMATESHEET\"), this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e.push(\"\" + this._imageProcessingConfigurationDefines.toString()));\n          }, t.prototype.fillUniformsAttributesAndSamplerNames = function(e, n, i) {\n            n.push(\"position\", \"age\", \"life\", \"size\", \"color\", \"offset\", \"uv\", \"direction\", \"initialDirection\", \"angle\", \"cellIndex\"), e.push(\"emitterWM\", \"worldOffset\", \"view\", \"projection\", \"colorDead\", \"invView\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"sheetInfos\", \"translationPivot\", \"eyePosition\"), i.push(\"diffuseSampler\", \"colorGradientSampler\"), this._imageProcessingConfiguration && (vn.a.PrepareUniforms(e, this._imageProcessingConfigurationDefines), vn.a.PrepareSamplers(i, this._imageProcessingConfigurationDefines));\n          }, t.prototype._recreateRenderEffect = function() {\n            var e = this.getCustomEffect();\n            if (e)\n              return e;\n            var n = [];\n            this.fillDefines(n);\n            var i = n.join(`\n`);\n            if (this._renderEffect && this._renderEffect.defines === i)\n              return this._renderEffect;\n            var o = [], a = [], s = [];\n            return this.fillUniformsAttributesAndSamplerNames(a, o, s), this._renderEffect = new ze.a(\"gpuRenderParticles\", o, a, s, this._engine, i), this._renderEffect;\n          }, t.prototype.animate = function(e) {\n            var n;\n            e === void 0 && (e = !1), this._timeDelta = this.updateSpeed * (e ? this.preWarmStepOffset : ((n = this._scene) === null || n === void 0 ? void 0 : n.getAnimationRatio()) || 1), this._actualFrame += this._timeDelta, this._stopped || this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop();\n          }, t.prototype._createFactorGradientTexture = function(e, n) {\n            var i = this[n];\n            if (e && e.length && !i) {\n              for (var o = new Float32Array(this._rawTextureWidth), a = 0; a < this._rawTextureWidth; a++) {\n                var s = a / this._rawTextureWidth;\n                On.GetCurrentGradient(s, e, function(d, p, y) {\n                  o[a] = $.a.Lerp(d.factor1, p.factor1, y);\n                });\n              }\n              this[n] = Zn.CreateRTexture(o, this._rawTextureWidth, 1, this._scene || this._engine, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n          }, t.prototype._createSizeGradientTexture = function() {\n            this._createFactorGradientTexture(this._sizeGradients, \"_sizeGradientsTexture\");\n          }, t.prototype._createAngularSpeedGradientTexture = function() {\n            this._createFactorGradientTexture(this._angularSpeedGradients, \"_angularSpeedGradientsTexture\");\n          }, t.prototype._createVelocityGradientTexture = function() {\n            this._createFactorGradientTexture(this._velocityGradients, \"_velocityGradientsTexture\");\n          }, t.prototype._createLimitVelocityGradientTexture = function() {\n            this._createFactorGradientTexture(this._limitVelocityGradients, \"_limitVelocityGradientsTexture\");\n          }, t.prototype._createDragGradientTexture = function() {\n            this._createFactorGradientTexture(this._dragGradients, \"_dragGradientsTexture\");\n          }, t.prototype._createColorGradientTexture = function() {\n            if (this._colorGradients && this._colorGradients.length && !this._colorGradientsTexture) {\n              for (var e = new Uint8Array(4 * this._rawTextureWidth), n = I.c.Color4[0], i = 0; i < this._rawTextureWidth; i++) {\n                var o = i / this._rawTextureWidth;\n                On.GetCurrentGradient(o, this._colorGradients, function(a, s, d) {\n                  I.b.LerpToRef(a.color1, s.color1, d, n), e[4 * i] = 255 * n.r, e[4 * i + 1] = 255 * n.g, e[4 * i + 2] = 255 * n.b, e[4 * i + 3] = 255 * n.a;\n                });\n              }\n              this._colorGradientsTexture = Zn.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n          }, t.prototype.render = function(e) {\n            var n, i;\n            if (e === void 0 && (e = !1), !this._started || (this._createColorGradientTexture(), this._createSizeGradientTexture(), this._createAngularSpeedGradientTexture(), this._createVelocityGradientTexture(), this._createLimitVelocityGradientTexture(), this._createDragGradientTexture(), this._recreateUpdateEffect(), this._recreateRenderEffect(), !this.isReady()))\n              return 0;\n            if (!e && this._scene) {\n              if (!this._preWarmDone && this.preWarmCycles) {\n                for (var o = 0; o < this.preWarmCycles; o++)\n                  this.animate(!0), this.render(!0);\n                this._preWarmDone = !0;\n              }\n              if (this._currentRenderId === this._scene.getFrameId())\n                return 0;\n              this._currentRenderId = this._scene.getFrameId();\n            }\n            if (this._initialize(), this._accumulatedCount += this.emitRate * this._timeDelta, this._accumulatedCount > 1) {\n              var a = 0 | this._accumulatedCount;\n              this._accumulatedCount -= a, this._currentActiveCount = Math.min(this._activeCount, this._currentActiveCount + a);\n            }\n            if (!this._currentActiveCount)\n              return 0;\n            this._engine.enableEffect(this._updateEffect);\n            var s, d = this._engine;\n            if (!d.setState)\n              throw new Error(\"GPU particles cannot work with a full Engine. ThinEngine is not supported\");\n            if (this._updateEffect.setFloat(\"currentCount\", this._currentActiveCount), this._updateEffect.setFloat(\"timeDelta\", this._timeDelta), this._updateEffect.setFloat(\"stopFactor\", this._stopped ? 0 : 1), this._updateEffect.setTexture(\"randomSampler\", this._randomTexture), this._updateEffect.setTexture(\"randomSampler2\", this._randomTexture2), this._updateEffect.setFloat2(\"lifeTime\", this.minLifeTime, this.maxLifeTime), this._updateEffect.setFloat2(\"emitPower\", this.minEmitPower, this.maxEmitPower), this._colorGradientsTexture || (this._updateEffect.setDirectColor4(\"color1\", this.color1), this._updateEffect.setDirectColor4(\"color2\", this.color2)), this._updateEffect.setFloat2(\"sizeRange\", this.minSize, this.maxSize), this._updateEffect.setFloat4(\"scaleRange\", this.minScaleX, this.maxScaleX, this.minScaleY, this.maxScaleY), this._updateEffect.setFloat4(\"angleRange\", this.minAngularSpeed, this.maxAngularSpeed, this.minInitialRotation, this.maxInitialRotation), this._updateEffect.setVector3(\"gravity\", this.gravity), this._sizeGradientsTexture && this._updateEffect.setTexture(\"sizeGradientSampler\", this._sizeGradientsTexture), this._angularSpeedGradientsTexture && this._updateEffect.setTexture(\"angularSpeedGradientSampler\", this._angularSpeedGradientsTexture), this._velocityGradientsTexture && this._updateEffect.setTexture(\"velocityGradientSampler\", this._velocityGradientsTexture), this._limitVelocityGradientsTexture && (this._updateEffect.setTexture(\"limitVelocityGradientSampler\", this._limitVelocityGradientsTexture), this._updateEffect.setFloat(\"limitVelocityDamping\", this.limitVelocityDamping)), this._dragGradientsTexture && this._updateEffect.setTexture(\"dragGradientSampler\", this._dragGradientsTexture), this.particleEmitterType && this.particleEmitterType.applyToShader(this._updateEffect), this._isAnimationSheetEnabled && this._updateEffect.setFloat3(\"cellInfos\", this.startSpriteCellID, this.endSpriteCellID, this.spriteCellChangeSpeed), this.noiseTexture && (this._updateEffect.setTexture(\"noiseSampler\", this.noiseTexture), this._updateEffect.setVector3(\"noiseStrength\", this.noiseStrength)), this.emitter.position)\n              s = this.emitter.getWorldMatrix();\n            else {\n              var p = this.emitter;\n              s = u.a.Translation(p.x, p.y, p.z);\n            }\n            if (this.isLocal || this._updateEffect.setMatrix(\"emitterWM\", s), this._engine.bindVertexArrayObject(this._updateVAO[this._targetIndex], null), d.bindTransformFeedbackBuffer(this._targetBuffer.getBuffer()), d.setRasterizerState(!1), d.beginTransformFeedback(!0), d.drawArraysType(h.a.MATERIAL_PointListDrawMode, 0, this._currentActiveCount), d.endTransformFeedback(), d.setRasterizerState(!0), d.bindTransformFeedbackBuffer(null), !e) {\n              var y = this._getEffect();\n              this._engine.enableEffect(y);\n              var P = ((n = this._scene) === null || n === void 0 ? void 0 : n.getViewMatrix()) || u.a.IdentityReadOnly;\n              if (y.setMatrix(\"view\", P), y.setMatrix(\"projection\", (i = this.defaultProjectionMatrix) !== null && i !== void 0 ? i : this._scene.getProjectionMatrix()), y.setTexture(\"diffuseSampler\", this.particleTexture), y.setVector2(\"translationPivot\", this.translationPivot), y.setVector3(\"worldOffset\", this.worldOffset), this.isLocal && y.setMatrix(\"emitterWM\", s), this._colorGradientsTexture ? y.setTexture(\"colorGradientSampler\", this._colorGradientsTexture) : y.setDirectColor4(\"colorDead\", this.colorDead), this._isAnimationSheetEnabled && this.particleTexture) {\n                var R = this.particleTexture.getBaseSize();\n                y.setFloat3(\"sheetInfos\", this.spriteCellWidth / R.width, this.spriteCellHeight / R.height, R.width / this.spriteCellWidth);\n              }\n              if (this._isBillboardBased && this._scene) {\n                var B = this._scene.activeCamera;\n                y.setVector3(\"eyePosition\", B.globalPosition);\n              }\n              var F = y.defines;\n              if (this._scene && (this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4 || this._scene.clipPlane5 || this._scene.clipPlane6) && $e.a.BindClipPlane(y, this._scene), F.indexOf(\"#define BILLBOARDMODE_ALL\") >= 0) {\n                var z = P.clone();\n                z.invert(), y.setMatrix(\"invView\", z);\n              }\n              switch (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(y), this.blendMode) {\n                case cn.BLENDMODE_ADD:\n                  this._engine.setAlphaMode(h.a.ALPHA_ADD);\n                  break;\n                case cn.BLENDMODE_ONEONE:\n                  this._engine.setAlphaMode(h.a.ALPHA_ONEONE);\n                  break;\n                case cn.BLENDMODE_STANDARD:\n                  this._engine.setAlphaMode(h.a.ALPHA_COMBINE);\n                  break;\n                case cn.BLENDMODE_MULTIPLY:\n                  this._engine.setAlphaMode(h.a.ALPHA_MULTIPLY);\n              }\n              this.forceDepthWrite && d.setDepthWrite(!0), this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex], null), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(y), this._engine.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, this._currentActiveCount), this._engine.setAlphaMode(h.a.ALPHA_DISABLE);\n            }\n            this._targetIndex++, this._targetIndex === 2 && (this._targetIndex = 0);\n            var J = this._sourceBuffer;\n            return this._sourceBuffer = this._targetBuffer, this._targetBuffer = J, this._currentActiveCount;\n          }, t.prototype.rebuild = function() {\n            this._initialize(!0);\n          }, t.prototype._releaseBuffers = function() {\n            this._buffer0 && (this._buffer0.dispose(), this._buffer0 = null), this._buffer1 && (this._buffer1.dispose(), this._buffer1 = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null);\n          }, t.prototype._releaseVAOs = function() {\n            if (this._updateVAO) {\n              for (var e = 0; e < this._updateVAO.length; e++)\n                this._engine.releaseVertexArrayObject(this._updateVAO[e]);\n              for (this._updateVAO = [], e = 0; e < this._renderVAO.length; e++)\n                this._engine.releaseVertexArrayObject(this._renderVAO[e]);\n              this._renderVAO = [];\n            }\n          }, t.prototype.dispose = function(e) {\n            if (e === void 0 && (e = !0), this._scene) {\n              var n = this._scene.particleSystems.indexOf(this);\n              n > -1 && this._scene.particleSystems.splice(n, 1);\n            }\n            this._releaseBuffers(), this._releaseVAOs(), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null), this._sizeGradientsTexture && (this._sizeGradientsTexture.dispose(), this._sizeGradientsTexture = null), this._angularSpeedGradientsTexture && (this._angularSpeedGradientsTexture.dispose(), this._angularSpeedGradientsTexture = null), this._velocityGradientsTexture && (this._velocityGradientsTexture.dispose(), this._velocityGradientsTexture = null), this._limitVelocityGradientsTexture && (this._limitVelocityGradientsTexture.dispose(), this._limitVelocityGradientsTexture = null), this._dragGradientsTexture && (this._dragGradientsTexture.dispose(), this._dragGradientsTexture = null), this._randomTexture && (this._randomTexture.dispose(), this._randomTexture = null), this._randomTexture2 && (this._randomTexture2.dispose(), this._randomTexture2 = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this.onStoppedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n          }, t.prototype.clone = function(e, n) {\n            var i = this.serialize(), o = t.Parse(i, this._scene || this._engine, \"\"), a = Object(c.a)({}, this._customEffect);\n            return o.name = e, o._customEffect = a, n === void 0 && (n = this.emitter), o.emitter = n, o.noiseTexture = this.noiseTexture, o;\n          }, t.prototype.serialize = function(e) {\n            e === void 0 && (e = !1);\n            var n = {};\n            return cn._Serialize(n, this, e), n.activeParticleCount = this.activeParticleCount, n.randomTextureSize = this._randomTextureSize, n;\n          }, t.Parse = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = new t(e.name, { capacity: e.capacity, randomTextureSize: e.randomTextureSize }, n);\n            return e.activeParticleCount && (a.activeParticleCount = e.activeParticleCount), cn._Parse(e, a, n, i), e.preventAutoStart && (a.preventAutoStart = e.preventAutoStart), o || a.preventAutoStart || a.start(), a;\n          }, t;\n        }(co), da = function() {\n          function r() {\n            this.systems = new Array();\n          }\n          return Object.defineProperty(r.prototype, \"emitterNode\", { get: function() {\n            return this._emitterNode;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setEmitterAsSphere = function(t, e, n) {\n            this._emitterNode && this._emitterNode.dispose(), this._emitterCreationOptions = { kind: \"Sphere\", options: t, renderingGroupId: e };\n            var i = Nn.a.CreateSphere(\"emitterSphere\", { diameter: t.diameter, segments: t.segments }, n);\n            i.renderingGroupId = e;\n            var o = new Nt.a(\"emitterSphereMaterial\", n);\n            o.emissiveColor = t.color, i.material = o;\n            for (var a = 0, s = this.systems; a < s.length; a++)\n              s[a].emitter = i;\n            this._emitterNode = i;\n          }, r.prototype.start = function(t) {\n            for (var e = 0, n = this.systems; e < n.length; e++) {\n              var i = n[e];\n              t && (i.emitter = t), i.start();\n            }\n          }, r.prototype.dispose = function() {\n            for (var t = 0, e = this.systems; t < e.length; t++)\n              e[t].dispose();\n            this.systems = [], this._emitterNode && (this._emitterNode.dispose(), this._emitterNode = null);\n          }, r.prototype.serialize = function(t) {\n            t === void 0 && (t = !1);\n            for (var e = { systems: [] }, n = 0, i = this.systems; n < i.length; n++) {\n              var o = i[n];\n              e.systems.push(o.serialize(t));\n            }\n            return this._emitterNode && (e.emitter = this._emitterCreationOptions), e;\n          }, r.Parse = function(t, e, n) {\n            n === void 0 && (n = !1);\n            var i = new r(), o = this.BaseAssetsUrl + \"/textures/\";\n            e = e || te.a.LastCreatedScene;\n            for (var a = 0, s = t.systems; a < s.length; a++) {\n              var d = s[a];\n              i.systems.push(n ? Zi.Parse(d, e, o, !0) : cn.Parse(d, e, o, !0));\n            }\n            if (t.emitter) {\n              var p = t.emitter.options;\n              switch (t.emitter.kind) {\n                case \"Sphere\":\n                  i.setEmitterAsSphere({ diameter: p.diameter, segments: p.segments, color: I.a.FromArray(p.color) }, t.emitter.renderingGroupId, e);\n              }\n            }\n            return i;\n          }, r.BaseAssetsUrl = \"https://assets.babylonjs.com/particles\", r;\n        }(), vm = function() {\n          function r() {\n          }\n          return r.CreateDefault = function(t, e, n, i) {\n            var o;\n            return e === void 0 && (e = 500), i === void 0 && (i = !1), (o = i ? new Zi(\"default system\", { capacity: e }, n) : new cn(\"default system\", e, n)).emitter = t, o.particleTexture = new Ne.a(\"https://www.babylonjs.com/assets/Flare.png\", o.getScene()), o.createConeEmitter(0.1, Math.PI / 4), o.color1 = new I.b(1, 1, 1, 1), o.color2 = new I.b(1, 1, 1, 1), o.colorDead = new I.b(1, 1, 1, 0), o.minSize = 0.1, o.maxSize = 0.1, o.minEmitPower = 2, o.maxEmitPower = 2, o.updateSpeed = 1 / 60, o.emitRate = 30, o;\n          }, r.CreateAsync = function(t, e, n) {\n            n === void 0 && (n = !1), e || (e = te.a.LastCreatedScene);\n            var i = {};\n            return e._addPendingData(i), new Promise(function(o, a) {\n              if (n && !Zi.IsSupported)\n                return e._removePendingData(i), a(\"Particle system with GPU is not supported.\");\n              Xe.b.LoadFile(r.BaseAssetsUrl + \"/systems/\" + t + \".json\", function(s) {\n                e._removePendingData(i);\n                var d = JSON.parse(s.toString());\n                return o(da.Parse(d, e, n));\n              }, void 0, void 0, void 0, function() {\n                return e._removePendingData(i), a(\"An error occured while the creation of your particle system. Check if your type '\" + t + \"' exists.\");\n              });\n            });\n          }, r.ExportSet = function(t) {\n            for (var e = new da(), n = 0, i = t; n < i.length; n++) {\n              var o = i[n];\n              e.systems.push(o);\n            }\n            return e;\n          }, r.ParseFromFileAsync = function(t, e, n, i, o) {\n            return i === void 0 && (i = !1), o === void 0 && (o = \"\"), new Promise(function(a, s) {\n              var d = new re.a();\n              d.addEventListener(\"readystatechange\", function() {\n                if (d.readyState == 4)\n                  if (d.status == 200) {\n                    var p = JSON.parse(d.responseText), y = void 0;\n                    y = i ? Zi.Parse(p, n, o) : cn.Parse(p, n, o), t && (y.name = t), a(y);\n                  } else\n                    s(\"Unable to load the particle system\");\n              }), d.open(\"GET\", e), d.send();\n            });\n          }, r.CreateFromSnippetAsync = function(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = !1), i === void 0 && (i = \"\"), t === \"_BLANK\") {\n              var a = this.CreateDefault(null);\n              return a.start(), Promise.resolve(a);\n            }\n            return new Promise(function(s, d) {\n              var p = new re.a();\n              p.addEventListener(\"readystatechange\", function() {\n                if (p.readyState == 4)\n                  if (p.status == 200) {\n                    var y = JSON.parse(JSON.parse(p.responseText).jsonPayload), P = JSON.parse(y.particleSystem), R = void 0;\n                    (R = n ? Zi.Parse(P, e, i) : cn.Parse(P, e, i)).snippetId = t, s(R);\n                  } else\n                    d(\"Unable to load the snippet \" + t);\n              }), p.open(\"GET\", o.SnippetUrl + \"/\" + t.replace(/#/g, \"/\")), p.send();\n            });\n          }, r.BaseAssetsUrl = da.BaseAssetsUrl, r.SnippetUrl = \"https://snippet.babylonjs.com\", r;\n        }();\n        V.a.AddParser(ot.a.NAME_PARTICLESYSTEM, function(r, t, e, n) {\n          var i = V.a.GetIndividualParser(ot.a.NAME_PARTICLESYSTEM);\n          if (i && r.particleSystems !== void 0 && r.particleSystems !== null)\n            for (var o = 0, a = r.particleSystems.length; o < a; o++) {\n              var s = r.particleSystems[o];\n              e.particleSystems.push(i(s, t, n));\n            }\n        }), V.a.AddIndividualParser(ot.a.NAME_PARTICLESYSTEM, function(r, t, e) {\n          return r.activeParticleCount ? Zi.Parse(r, t, e) : cn.Parse(r, t, e);\n        }), Ue.a.prototype.createEffectForParticles = function(r, t, e, n, i, o, a, s) {\n          var d;\n          t === void 0 && (t = []), e === void 0 && (e = []), n === void 0 && (n = \"\");\n          var p = [], y = [], P = [];\n          return s ? s.fillUniformsAttributesAndSamplerNames(y, p, P) : (p = cn._GetAttributeNamesOrOptions(), y = cn._GetEffectCreationOptions()), n.indexOf(\" BILLBOARD\") === -1 && (n += `\n#define BILLBOARD\n`), e.indexOf(\"diffuseSampler\") === -1 && e.push(\"diffuseSampler\"), this.createEffect({ vertex: (d = s == null ? void 0 : s.vertexShaderName) !== null && d !== void 0 ? d : \"particles\", fragmentElement: r }, p, y.concat(t), P.concat(e), n, i, o, a);\n        }, Ie.a.prototype.getEmittedParticleSystems = function() {\n          for (var r = new Array(), t = 0; t < this.getScene().particleSystems.length; t++) {\n            var e = this.getScene().particleSystems[t];\n            e.emitter === this && r.push(e);\n          }\n          return r;\n        }, Ie.a.prototype.getHierarchyEmittedParticleSystems = function() {\n          var r = new Array(), t = this.getDescendants();\n          t.push(this);\n          for (var e = 0; e < this.getScene().particleSystems.length; e++) {\n            var n = this.getScene().particleSystems[e], i = n.emitter;\n            i.position && t.indexOf(i) !== -1 && r.push(n);\n          }\n          return r;\n        };\n        var bn, yc = function() {\n          function r(t, e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = null), y === void 0 && (y = null), this.idx = 0, this.id = 0, this.color = new I.b(1, 1, 1, 1), this.position = u.e.Zero(), this.rotation = u.e.Zero(), this.scaling = u.e.One(), this.uvs = new u.f(0, 0, 1, 1), this.velocity = u.e.Zero(), this.pivot = u.e.Zero(), this.translateFromPivot = !1, this.alive = !0, this.isVisible = !0, this._pos = 0, this._ind = 0, this.shapeId = 0, this.idxInShape = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this.materialIndex = null, this.props = null, this.cullingStrategy = Mt.a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, this._globalPosition = u.e.Zero(), this.idx = t, this.id = e, this._pos = n, this._ind = i, this._model = o, this.shapeId = a, this.idxInShape = s, this._sps = d, p && (this._modelBoundingInfo = p, this._boundingInfo = new Mi.a(p.minimum, p.maximum)), y !== null && (this.materialIndex = y);\n          }\n          return r.prototype.copyToRef = function(t) {\n            return t.position.copyFrom(this.position), t.rotation.copyFrom(this.rotation), this.rotationQuaternion && (t.rotationQuaternion ? t.rotationQuaternion.copyFrom(this.rotationQuaternion) : t.rotationQuaternion = this.rotationQuaternion.clone()), t.scaling.copyFrom(this.scaling), this.color && (t.color ? t.color.copyFrom(this.color) : t.color = this.color.clone()), t.uvs.copyFrom(this.uvs), t.velocity.copyFrom(this.velocity), t.pivot.copyFrom(this.pivot), t.translateFromPivot = this.translateFromPivot, t.alive = this.alive, t.isVisible = this.isVisible, t.parentId = this.parentId, t.cullingStrategy = this.cullingStrategy, this.materialIndex !== null && (t.materialIndex = this.materialIndex), this;\n          }, Object.defineProperty(r.prototype, \"scale\", { get: function() {\n            return this.scaling;\n          }, set: function(t) {\n            this.scaling = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"quaternion\", { get: function() {\n            return this.rotationQuaternion;\n          }, set: function(t) {\n            this.rotationQuaternion = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.intersectsMesh = function(t) {\n            return !(!this._boundingInfo || !t._boundingInfo) && (this._sps._bSphereOnly ? Nl.a.Intersects(this._boundingInfo.boundingSphere, t._boundingInfo.boundingSphere) : this._boundingInfo.intersects(t._boundingInfo, !1));\n          }, r.prototype.isInFrustum = function(t) {\n            return this._boundingInfo !== null && this._boundingInfo.isInFrustum(t, this.cullingStrategy);\n          }, r.prototype.getRotationMatrix = function(t) {\n            var e;\n            if (this.rotationQuaternion)\n              e = this.rotationQuaternion;\n            else {\n              e = u.c.Quaternion[0];\n              var n = this.rotation;\n              u.b.RotationYawPitchRollToRef(n.y, n.x, n.z, e);\n            }\n            e.toRotationMatrix(t);\n          }, r;\n        }(), bc = function(r, t, e, n, i, o, a, s, d) {\n          this._indicesLength = 0, this.shapeID = r, this._shape = t, this._indices = e, this._indicesLength = e.length, this._shapeUV = o, this._shapeColors = i, this._normals = n, this._positionFunction = a, this._vertexFunction = s, this._material = d;\n        }, cd = function(r, t, e, n) {\n          this.idx = 0, this.ind = 0, this.indicesLength = 0, this.sqDistance = 0, this.materialIndex = 0, this.idx = r, this.ind = t, this.indicesLength = e, this.materialIndex = n;\n        }, ld = function() {\n          function r() {\n            this.position = u.e.Zero(), this.color = new I.b(1, 1, 1, 1), this.uv = u.d.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"x\", { get: function() {\n            return this.position.x;\n          }, set: function(t) {\n            this.position.x = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"y\", { get: function() {\n            return this.position.y;\n          }, set: function(t) {\n            this.position.y = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"z\", { get: function() {\n            return this.position.z;\n          }, set: function(t) {\n            this.position.z = t;\n          }, enumerable: !1, configurable: !0 }), r;\n        }(), ym = function() {\n          function r(t, e, n) {\n            this.particles = new Array(), this.nbParticles = 0, this.billboard = !1, this.recomputeNormals = !1, this.counter = 0, this.vars = {}, this._bSphereOnly = !1, this._bSphereRadiusFactor = 1, this._positions = new Array(), this._indices = new Array(), this._normals = new Array(), this._colors = new Array(), this._uvs = new Array(), this._index = 0, this._updatable = !0, this._pickable = !1, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._depthSort = !1, this._expandable = !1, this._shapeCounter = 0, this._copy = new yc(0, 0, 0, 0, null, 0, 0, this), this._color = new I.b(0, 0, 0, 0), this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeParticleVertex = !1, this._computeBoundingBox = !1, this._depthSortParticles = !0, this._mustUnrotateFixedNormals = !1, this._particlesIntersect = !1, this._needs32Bits = !1, this._isNotBuilt = !0, this._lastParticleId = 0, this._idxOfId = [], this._multimaterialEnabled = !1, this._useModelMaterial = !1, this._depthSortFunction = function(i, o) {\n              return o.sqDistance - i.sqDistance;\n            }, this._materialSortFunction = function(i, o) {\n              return i.materialIndex - o.materialIndex;\n            }, this._autoUpdateSubMeshes = !1, this.name = t, this._scene = e || te.a.LastCreatedScene, this._camera = e.activeCamera, this._pickable = !!n && n.isPickable, this._depthSort = !!n && n.enableDepthSort, this._multimaterialEnabled = !!n && n.enableMultiMaterial, this._useModelMaterial = !!n && n.useModelMaterial, this._multimaterialEnabled = !!this._useModelMaterial || this._multimaterialEnabled, this._expandable = !!n && n.expandable, this._particlesIntersect = !!n && n.particleIntersection, this._bSphereOnly = !!n && n.boundingSphereOnly, this._bSphereRadiusFactor = n && n.bSphereRadiusFactor ? n.bSphereRadiusFactor : 1, n && n.updatable !== void 0 ? this._updatable = n.updatable : this._updatable = !0, this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]), (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []), this._multimaterialEnabled && (this._multimaterial = new Qi.a(this.name + \"MultiMaterial\", this._scene), this._materials = [], this._materialIndexesById = {}), this._tmpVertex = new ld();\n          }\n          return r.prototype.buildMesh = function() {\n            if (!this._isNotBuilt && this.mesh)\n              return this.mesh;\n            if (this.nbParticles === 0 && !this.mesh) {\n              var t = ha.CreateDisc(\"\", { radius: 1, tessellation: 3 }, this._scene);\n              this.addShape(t, 1), t.dispose();\n            }\n            if (this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors), !this.mesh) {\n              var e = new Ie.a(this.name, this._scene);\n              this.mesh = e;\n            }\n            !this._updatable && this._multimaterialEnabled && this._sortParticlesByMaterial(), this.recomputeNormals && ht.a.ComputeNormals(this._positions32, this._indices32, this._normals), this._normals32 = new Float32Array(this._normals), this._fixedNormal32 = new Float32Array(this._normals), this._mustUnrotateFixedNormals && this._unrotateFixedNormals();\n            var n = new ht.a();\n            if (n.indices = this._depthSort ? this._indices : this._indices32, n.set(this._positions32, Oe.b.PositionKind), n.set(this._normals32, Oe.b.NormalKind), this._uvs32.length > 0 && n.set(this._uvs32, Oe.b.UVKind), this._colors32.length > 0 && n.set(this._colors32, Oe.b.ColorKind), n.applyToMesh(this.mesh, this._updatable), this.mesh.isPickable = this._pickable, this._pickable) {\n              for (var i = 0, o = 0; o < this.nbParticles; o++)\n                for (var a = this.particles[o], s = a._model._indicesLength, d = 0; d < s; d++)\n                  if (d % 3 == 0) {\n                    var p = { idx: a.idx, faceId: i };\n                    this.pickedParticles[i] = p, i++;\n                  }\n            }\n            return this._multimaterialEnabled && this.setMultiMaterial(this._materials), this._expandable || (this._depthSort || this._multimaterialEnabled || (this._indices = null), this._positions = null, this._normals = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0)), this._isNotBuilt = !1, this.recomputeNormals = !1, this.mesh;\n          }, r.prototype.digest = function(t, e) {\n            var n = e && e.facetNb || 1, i = e && e.number || 0, o = e && e.delta || 0, a = t.getVerticesData(Oe.b.PositionKind), s = t.getIndices(), d = t.getVerticesData(Oe.b.UVKind), p = t.getVerticesData(Oe.b.ColorKind), y = t.getVerticesData(Oe.b.NormalKind), P = e && e.storage ? e.storage : null, R = 0, B = s.length / 3;\n            i ? (i = i > B ? B : i, n = Math.round(B / i), o = 0) : n = n > B ? B : n;\n            for (var F = [], z = [], J = [], ie = [], se = [], ce = u.e.Zero(), ue = n; R < B; ) {\n              R > B - (n = ue + Math.floor((1 + o) * Math.random())) && (n = B - R), F.length = 0, z.length = 0, J.length = 0, ie.length = 0, se.length = 0;\n              for (var fe = 0, ve = 3 * R; ve < 3 * (R + n); ve++) {\n                J.push(fe);\n                var Te = s[ve], Re = 3 * Te;\n                if (F.push(a[Re], a[Re + 1], a[Re + 2]), z.push(y[Re], y[Re + 1], y[Re + 2]), d) {\n                  var Ae = 2 * Te;\n                  ie.push(d[Ae], d[Ae + 1]);\n                }\n                if (p) {\n                  var Ee = 4 * Te;\n                  se.push(p[Ee], p[Ee + 1], p[Ee + 2], p[Ee + 3]);\n                }\n                fe++;\n              }\n              var Se, De = this.nbParticles, xe = this._posToShape(F), Le = this._uvsToShapeUV(ie), Me = Xe.b.Slice(J), we = Xe.b.Slice(se), Ye = Xe.b.Slice(z);\n              for (ce.copyFromFloats(0, 0, 0), Se = 0; Se < xe.length; Se++)\n                ce.addInPlace(xe[Se]);\n              ce.scaleInPlace(1 / xe.length);\n              var et, nt = new u.e(1 / 0, 1 / 0, 1 / 0), ct = new u.e(-1 / 0, -1 / 0, -1 / 0);\n              for (Se = 0; Se < xe.length; Se++)\n                xe[Se].subtractInPlace(ce), nt.minimizeInPlaceFromFloats(xe[Se].x, xe[Se].y, xe[Se].z), ct.maximizeInPlaceFromFloats(xe[Se].x, xe[Se].y, xe[Se].z);\n              this._particlesIntersect && (et = new Mi.a(nt, ct));\n              var Ke = null;\n              this._useModelMaterial && (Ke = t.material ? t.material : this._setDefaultMaterial());\n              var rt = new bc(this._shapeCounter, xe, Me, Ye, we, Le, null, null, Ke), it = this._positions.length, qe = this._indices.length;\n              this._meshBuilder(this._index, qe, xe, this._positions, Me, this._indices, ie, this._uvs, we, this._colors, Ye, this._normals, De, 0, null, rt), this._addParticle(De, this._lastParticleId, it, qe, rt, this._shapeCounter, 0, et, P), this.particles[this.nbParticles].position.addInPlace(ce), P || (this._index += xe.length, De++, this.nbParticles++, this._lastParticleId++), this._shapeCounter++, R += n;\n            }\n            return this._isNotBuilt = !0, this;\n          }, r.prototype._unrotateFixedNormals = function() {\n            for (var t = 0, e = 0, n = u.c.Vector3[0], i = u.c.Quaternion[0], o = u.c.Matrix[0], a = 0; a < this.particles.length; a++) {\n              var s = this.particles[a], d = s._model._shape;\n              if (s.rotationQuaternion)\n                s.rotationQuaternion.conjugateToRef(i);\n              else {\n                var p = s.rotation;\n                u.b.RotationYawPitchRollToRef(p.y, p.x, p.z, i), i.conjugateInPlace();\n              }\n              i.toRotationMatrix(o);\n              for (var y = 0; y < d.length; y++)\n                e = t + 3 * y, u.e.TransformNormalFromFloatsToRef(this._normals32[e], this._normals32[e + 1], this._normals32[e + 2], o, n), n.toArray(this._fixedNormal32, e);\n              t = e + 3;\n            }\n          }, r.prototype._resetCopy = function() {\n            var t = this._copy;\n            t.position.setAll(0), t.rotation.setAll(0), t.rotationQuaternion = null, t.scaling.setAll(1), t.uvs.copyFromFloats(0, 0, 1, 1), t.color = null, t.translateFromPivot = !1, t.shapeId = 0, t.materialIndex = null;\n          }, r.prototype._meshBuilder = function(t, e, n, i, o, a, s, d, p, y, P, R, B, F, z, J) {\n            var ie, se = 0, ce = 0, ue = 0;\n            this._resetCopy();\n            var fe = this._copy, ve = !(!z || !z.storage);\n            if (fe.idx = B, fe.idxInShape = F, fe.shapeId = J.shapeID, this._useModelMaterial) {\n              var Te = J._material.uniqueId, Re = this._materialIndexesById;\n              Re.hasOwnProperty(Te) || (Re[Te] = this._materials.length, this._materials.push(J._material));\n              var Ae = Re[Te];\n              fe.materialIndex = Ae;\n            }\n            if (z && z.positionFunction && (z.positionFunction(fe, B, F), this._mustUnrotateFixedNormals = !0), ve)\n              return fe;\n            var Ee = u.c.Matrix[0], Se = this._tmpVertex, De = Se.position, xe = Se.color, Le = Se.uv, Me = u.c.Vector3[1], we = u.c.Vector3[2], Ye = u.c.Vector3[3];\n            u.a.IdentityToRef(Ee), fe.getRotationMatrix(Ee), fe.pivot.multiplyToRef(fe.scaling, Ye), fe.translateFromPivot ? we.setAll(0) : we.copyFrom(Ye);\n            var et = z && z.vertexFunction;\n            for (ie = 0; ie < n.length; ie++) {\n              if (De.copyFrom(n[ie]), fe.color && xe.copyFrom(fe.color), s && Le.copyFromFloats(s[se], s[se + 1]), et && z.vertexFunction(fe, Se, ie), De.multiplyInPlace(fe.scaling).subtractInPlace(Ye), u.e.TransformCoordinatesToRef(De, Ee, Me), Me.addInPlace(we).addInPlace(fe.position), i.push(Me.x, Me.y, Me.z), s) {\n                var nt = fe.uvs;\n                d.push((nt.z - nt.x) * Le.x + nt.x, (nt.w - nt.y) * Le.y + nt.y), se += 2;\n              }\n              if (fe.color)\n                this._color.copyFrom(xe);\n              else {\n                var ct = this._color;\n                p && p[ce] !== void 0 ? (ct.r = p[ce], ct.g = p[ce + 1], ct.b = p[ce + 2], ct.a = p[ce + 3]) : (ct.r = 1, ct.g = 1, ct.b = 1, ct.a = 1);\n              }\n              y.push(this._color.r, this._color.g, this._color.b, this._color.a), ce += 4, !this.recomputeNormals && P && (u.e.TransformNormalFromFloatsToRef(P[ue], P[ue + 1], P[ue + 2], Ee, De), R.push(De.x, De.y, De.z), ue += 3);\n            }\n            for (ie = 0; ie < o.length; ie++) {\n              var Ke = t + o[ie];\n              a.push(Ke), Ke > 65535 && (this._needs32Bits = !0);\n            }\n            if (this._depthSort || this._multimaterialEnabled) {\n              var rt = fe.materialIndex !== null ? fe.materialIndex : 0;\n              this.depthSortedParticles.push(new cd(B, e, o.length, rt));\n            }\n            return fe;\n          }, r.prototype._posToShape = function(t) {\n            for (var e = [], n = 0; n < t.length; n += 3)\n              e.push(u.e.FromArray(t, n));\n            return e;\n          }, r.prototype._uvsToShapeUV = function(t) {\n            var e = [];\n            if (t)\n              for (var n = 0; n < t.length; n++)\n                e.push(t[n]);\n            return e;\n          }, r.prototype._addParticle = function(t, e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = null), p === void 0 && (p = null);\n            var y = new yc(t, e, n, i, o, a, s, this, d);\n            return (p || this.particles).push(y), y;\n          }, r.prototype.addShape = function(t, e, n) {\n            var i = t.getVerticesData(Oe.b.PositionKind), o = t.getIndices(), a = t.getVerticesData(Oe.b.UVKind), s = t.getVerticesData(Oe.b.ColorKind), d = t.getVerticesData(Oe.b.NormalKind);\n            this.recomputeNormals = !d;\n            var p = Xe.b.SliceToArray(o), y = Xe.b.SliceToArray(d), P = s ? Xe.b.SliceToArray(s) : [], R = n && n.storage ? n.storage : null, B = null;\n            this._particlesIntersect && (B = t.getBoundingInfo());\n            var F = this._posToShape(i), z = this._uvsToShapeUV(a), J = n ? n.positionFunction : null, ie = n ? n.vertexFunction : null, se = null;\n            this._useModelMaterial && (se = t.material ? t.material : this._setDefaultMaterial());\n            for (var ce = new bc(this._shapeCounter, F, p, y, P, z, J, ie, se), ue = 0; ue < e; ue++)\n              this._insertNewParticle(this.nbParticles, ue, ce, F, o, a, s, d, B, R, n);\n            return this._shapeCounter++, this._isNotBuilt = !0, this._shapeCounter - 1;\n          }, r.prototype._rebuildParticle = function(t, e) {\n            e === void 0 && (e = !1), this._resetCopy();\n            var n = this._copy;\n            t._model._positionFunction && t._model._positionFunction(n, t.idx, t.idxInShape);\n            var i = u.c.Matrix[0], o = u.c.Vector3[0], a = u.c.Vector3[1], s = u.c.Vector3[2], d = u.c.Vector3[3];\n            n.getRotationMatrix(i), t.pivot.multiplyToRef(t.scaling, d), n.translateFromPivot ? s.copyFromFloats(0, 0, 0) : s.copyFrom(d);\n            for (var p = t._model._shape, y = 0; y < p.length; y++)\n              o.copyFrom(p[y]), t._model._vertexFunction && t._model._vertexFunction(n, o, y), o.multiplyInPlace(n.scaling).subtractInPlace(d), u.e.TransformCoordinatesToRef(o, i, a), a.addInPlace(s).addInPlace(n.position).toArray(this._positions32, t._pos + 3 * y);\n            e && (t.position.setAll(0), t.rotation.setAll(0), t.rotationQuaternion = null, t.scaling.setAll(1), t.uvs.setAll(0), t.pivot.setAll(0), t.translateFromPivot = !1, t.parentId = null);\n          }, r.prototype.rebuildMesh = function(t) {\n            t === void 0 && (t = !1);\n            for (var e = 0; e < this.particles.length; e++)\n              this._rebuildParticle(this.particles[e], t);\n            return this.mesh.updateVerticesData(Oe.b.PositionKind, this._positions32, !1, !1), this;\n          }, r.prototype.removeParticles = function(t, e) {\n            var n = e - t + 1;\n            if (!this._expandable || n <= 0 || n >= this.nbParticles || !this._updatable)\n              return [];\n            var i = this.particles, o = this.nbParticles;\n            if (e < o - 1)\n              for (var a = e + 1, s = i[a]._pos - i[t]._pos, d = i[a]._ind - i[t]._ind, p = a; p < o; p++) {\n                var y = i[p];\n                y._pos -= s, y._ind -= d;\n              }\n            var P = i.splice(t, n);\n            this._positions.length = 0, this._indices.length = 0, this._colors.length = 0, this._uvs.length = 0, this._normals.length = 0, this._index = 0, this._idxOfId.length = 0, (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []);\n            for (var R = 0, B = i.length, F = 0; F < B; F++) {\n              var z = i[F], J = z._model, ie = J._shape, se = J._indices, ce = J._normals, ue = J._shapeColors, fe = J._shapeUV;\n              z.idx = F, this._idxOfId[z.id] = F, this._meshBuilder(this._index, R, ie, this._positions, se, this._indices, fe, this._uvs, ue, this._colors, ce, this._normals, z.idx, z.idxInShape, null, J), this._index += ie.length, R += se.length;\n            }\n            return this.nbParticles -= n, this._isNotBuilt = !0, P;\n          }, r.prototype.insertParticlesFromArray = function(t) {\n            if (!this._expandable)\n              return this;\n            for (var e = 0, n = t[0].shapeId, i = t.length, o = 0; o < i; o++) {\n              var a = t[o], s = a._model, d = s._shape, p = s._indices, y = s._shapeUV, P = s._shapeColors, R = s._normals, B = !R;\n              this.recomputeNormals = B || this.recomputeNormals;\n              var F = a._boundingInfo, z = this._insertNewParticle(this.nbParticles, e, s, d, p, y, P, R, F, null, null);\n              a.copyToRef(z), e++, n != a.shapeId && (n = a.shapeId, e = 0);\n            }\n            return this._isNotBuilt = !0, this;\n          }, r.prototype._insertNewParticle = function(t, e, n, i, o, a, s, d, p, y, P) {\n            var R = this._positions.length, B = this._indices.length, F = this._meshBuilder(this._index, B, i, this._positions, o, this._indices, a, this._uvs, s, this._colors, d, this._normals, t, e, P, n), z = null;\n            return this._updatable && ((z = this._addParticle(this.nbParticles, this._lastParticleId, R, B, n, this._shapeCounter, e, p, y)).position.copyFrom(F.position), z.rotation.copyFrom(F.rotation), F.rotationQuaternion && (z.rotationQuaternion ? z.rotationQuaternion.copyFrom(F.rotationQuaternion) : z.rotationQuaternion = F.rotationQuaternion.clone()), F.color && (z.color ? z.color.copyFrom(F.color) : z.color = F.color.clone()), z.scaling.copyFrom(F.scaling), z.uvs.copyFrom(F.uvs), F.materialIndex !== null && (z.materialIndex = F.materialIndex), this.expandable && (this._idxOfId[z.id] = z.idx)), y || (this._index += i.length, this.nbParticles++, this._lastParticleId++), z;\n          }, r.prototype.setParticles = function(t, e, n) {\n            if (t === void 0 && (t = 0), e === void 0 && (e = this.nbParticles - 1), n === void 0 && (n = !0), !this._updatable || this._isNotBuilt)\n              return this;\n            this.beforeUpdateParticles(t, e, n);\n            var i = u.c.Matrix[0], o = u.c.Matrix[1], a = this.mesh, s = this._colors32, d = this._positions32, p = this._normals32, y = this._uvs32, P = this._indices32, R = this._indices, B = this._fixedNormal32, F = u.c.Vector3, z = F[5].copyFromFloats(1, 0, 0), J = F[6].copyFromFloats(0, 1, 0), ie = F[7].copyFromFloats(0, 0, 1), se = F[8].setAll(Number.MAX_VALUE), ce = F[9].setAll(-Number.MAX_VALUE), ue = F[10].setAll(0), fe = this._tmpVertex, ve = fe.position, Te = fe.color, Re = fe.uv;\n            if ((this.billboard || this._depthSort) && (this.mesh.computeWorldMatrix(!0), this.mesh._worldMatrix.invertToRef(o)), this.billboard) {\n              var Ae = F[0];\n              this._camera.getDirectionToRef(be.a.Z, Ae), u.e.TransformNormalToRef(Ae, o, ie), ie.normalize();\n              var Ee = this._camera.getViewMatrix(!0);\n              u.e.TransformNormalFromFloatsToRef(Ee.m[1], Ee.m[5], Ee.m[9], o, J), u.e.CrossToRef(J, ie, z), J.normalize(), z.normalize();\n            }\n            this._depthSort && u.e.TransformCoordinatesToRef(this._camera.globalPosition, o, ue), u.a.IdentityToRef(i);\n            var Se = 0, De = 0, xe = 0, Le = 0, Me = 0, we = 0, Ye = 0;\n            if (this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), e = e >= this.nbParticles ? this.nbParticles - 1 : e, this._computeBoundingBox && (t != 0 || e != this.nbParticles - 1)) {\n              var et = this.mesh._boundingInfo;\n              et && (se.copyFrom(et.minimum), ce.copyFrom(et.maximum));\n            }\n            var nt = (De = this.particles[t]._pos) / 3 | 0;\n            Le = 4 * nt, we = 2 * nt;\n            for (var ct = t; ct <= e; ct++) {\n              var Ke = this.particles[ct];\n              this.updateParticle(Ke);\n              var rt = Ke._model._shape, it = Ke._model._shapeUV, qe = Ke._rotationMatrix, ut = Ke.position, Ve = Ke.rotation, Ze = Ke.scaling, vt = Ke._globalPosition;\n              if (this._depthSort && this._depthSortParticles) {\n                var jt = this.depthSortedParticles[ct];\n                jt.idx = Ke.idx, jt.ind = Ke._ind, jt.indicesLength = Ke._model._indicesLength, jt.sqDistance = u.e.DistanceSquared(Ke.position, ue);\n              }\n              if (!Ke.alive || Ke._stillInvisible && !Ke.isVisible)\n                De += 3 * (Ye = rt.length), Le += 4 * Ye, we += 2 * Ye;\n              else {\n                if (Ke.isVisible) {\n                  Ke._stillInvisible = !1;\n                  var Dt = F[12];\n                  if (Ke.pivot.multiplyToRef(Ze, Dt), this.billboard && (Ve.x = 0, Ve.y = 0), (this._computeParticleRotation || this.billboard) && Ke.getRotationMatrix(i), Ke.parentId !== null) {\n                    var Yt = this.getParticleById(Ke.parentId);\n                    if (Yt) {\n                      var mt = Yt._rotationMatrix, qt = Yt._globalPosition, Ht = ut.x * mt[1] + ut.y * mt[4] + ut.z * mt[7], kt = ut.x * mt[0] + ut.y * mt[3] + ut.z * mt[6], Wt = ut.x * mt[2] + ut.y * mt[5] + ut.z * mt[8];\n                      if (vt.x = qt.x + kt, vt.y = qt.y + Ht, vt.z = qt.z + Wt, this._computeParticleRotation || this.billboard) {\n                        var bt = i.m;\n                        qe[0] = bt[0] * mt[0] + bt[1] * mt[3] + bt[2] * mt[6], qe[1] = bt[0] * mt[1] + bt[1] * mt[4] + bt[2] * mt[7], qe[2] = bt[0] * mt[2] + bt[1] * mt[5] + bt[2] * mt[8], qe[3] = bt[4] * mt[0] + bt[5] * mt[3] + bt[6] * mt[6], qe[4] = bt[4] * mt[1] + bt[5] * mt[4] + bt[6] * mt[7], qe[5] = bt[4] * mt[2] + bt[5] * mt[5] + bt[6] * mt[8], qe[6] = bt[8] * mt[0] + bt[9] * mt[3] + bt[10] * mt[6], qe[7] = bt[8] * mt[1] + bt[9] * mt[4] + bt[10] * mt[7], qe[8] = bt[8] * mt[2] + bt[9] * mt[5] + bt[10] * mt[8];\n                      }\n                    } else\n                      Ke.parentId = null;\n                  } else\n                    vt.x = ut.x, vt.y = ut.y, vt.z = ut.z, (this._computeParticleRotation || this.billboard) && (bt = i.m, qe[0] = bt[0], qe[1] = bt[1], qe[2] = bt[2], qe[3] = bt[4], qe[4] = bt[5], qe[5] = bt[6], qe[6] = bt[8], qe[7] = bt[9], qe[8] = bt[10]);\n                  var Rt = F[11];\n                  for (Ke.translateFromPivot ? Rt.setAll(0) : Rt.copyFrom(Dt), Ye = 0; Ye < rt.length; Ye++) {\n                    Se = De + 3 * Ye, xe = Le + 4 * Ye, Me = we + 2 * Ye;\n                    var Zt = 2 * Ye, Mn = Zt + 1;\n                    ve.copyFrom(rt[Ye]), this._computeParticleColor && Ke.color && Te.copyFrom(Ke.color), this._computeParticleTexture && Re.copyFromFloats(it[Zt], it[Mn]), this._computeParticleVertex && this.updateParticleVertex(Ke, fe, Ye);\n                    var Bn = ve.x * Ze.x - Dt.x, Kn = ve.y * Ze.y - Dt.y, In = ve.z * Ze.z - Dt.z;\n                    kt = Bn * qe[0] + Kn * qe[3] + In * qe[6], Ht = Bn * qe[1] + Kn * qe[4] + In * qe[7], Wt = Bn * qe[2] + Kn * qe[5] + In * qe[8], kt += Rt.x, Ht += Rt.y, Wt += Rt.z;\n                    var Kt = d[Se] = vt.x + z.x * kt + J.x * Ht + ie.x * Wt, oi = d[Se + 1] = vt.y + z.y * kt + J.y * Ht + ie.y * Wt, Ti = d[Se + 2] = vt.z + z.z * kt + J.z * Ht + ie.z * Wt;\n                    if (this._computeBoundingBox && (se.minimizeInPlaceFromFloats(Kt, oi, Ti), ce.maximizeInPlaceFromFloats(Kt, oi, Ti)), !this._computeParticleVertex) {\n                      var Lr = B[Se], Nr = B[Se + 1], ai = B[Se + 2], wi = Lr * qe[0] + Nr * qe[3] + ai * qe[6], wr = Lr * qe[1] + Nr * qe[4] + ai * qe[7], Gt = Lr * qe[2] + Nr * qe[5] + ai * qe[8];\n                      p[Se] = z.x * wi + J.x * wr + ie.x * Gt, p[Se + 1] = z.y * wi + J.y * wr + ie.y * Gt, p[Se + 2] = z.z * wi + J.z * wr + ie.z * Gt;\n                    }\n                    if (this._computeParticleColor && Ke.color) {\n                      var Fi = this._colors32;\n                      Fi[xe] = Te.r, Fi[xe + 1] = Te.g, Fi[xe + 2] = Te.b, Fi[xe + 3] = Te.a;\n                    }\n                    if (this._computeParticleTexture) {\n                      var Tn = Ke.uvs;\n                      y[Me] = Re.x * (Tn.z - Tn.x) + Tn.x, y[Me + 1] = Re.y * (Tn.w - Tn.y) + Tn.y;\n                    }\n                  }\n                } else\n                  for (Ke._stillInvisible = !0, Ye = 0; Ye < rt.length; Ye++) {\n                    if (xe = Le + 4 * Ye, Me = we + 2 * Ye, d[Se = De + 3 * Ye] = d[Se + 1] = d[Se + 2] = 0, p[Se] = p[Se + 1] = p[Se + 2] = 0, this._computeParticleColor && Ke.color) {\n                      var er = Ke.color;\n                      s[xe] = er.r, s[xe + 1] = er.g, s[xe + 2] = er.b, s[xe + 3] = er.a;\n                    }\n                    this._computeParticleTexture && (Tn = Ke.uvs, y[Me] = it[2 * Ye] * (Tn.z - Tn.x) + Tn.x, y[Me + 1] = it[2 * Ye + 1] * (Tn.w - Tn.y) + Tn.y);\n                  }\n                if (this._particlesIntersect) {\n                  var Ei = Ke._boundingInfo, Ma = Ei.boundingBox, Ia = Ei.boundingSphere, Fr = Ke._modelBoundingInfo;\n                  if (!this._bSphereOnly) {\n                    var Bi = Fr.boundingBox.vectors, Ui = F[1], tr = F[2];\n                    Ui.setAll(Number.MAX_VALUE), tr.setAll(-Number.MAX_VALUE);\n                    for (var Vi = 0; Vi < 8; Vi++) {\n                      var Br = Bi[Vi].x * Ze.x, Ur = Bi[Vi].y * Ze.y, Vr = Bi[Vi].z * Ze.z, ki = (kt = Br * qe[0] + Ur * qe[3] + Vr * qe[6], Ht = Br * qe[1] + Ur * qe[4] + Vr * qe[7], Wt = Br * qe[2] + Ur * qe[5] + Vr * qe[8], ut.x + z.x * kt + J.x * Ht + ie.x * Wt), Gi = ut.y + z.y * kt + J.y * Ht + ie.y * Wt, kr = ut.z + z.z * kt + J.z * Ht + ie.z * Wt;\n                      Ui.minimizeInPlaceFromFloats(ki, Gi, kr), tr.maximizeInPlaceFromFloats(ki, Gi, kr);\n                    }\n                    Ma.reConstruct(Ui, tr, a._worldMatrix);\n                  }\n                  var Si = Fr.minimum.multiplyToRef(Ze, F[1]), Dn = Fr.maximum.multiplyToRef(Ze, F[2]), bo = Dn.addToRef(Si, F[3]).scaleInPlace(0.5).addInPlace(vt), nr = Dn.subtractToRef(Si, F[4]).scaleInPlace(0.5 * this._bSphereRadiusFactor), To = bo.subtractToRef(nr, F[1]), tv = bo.addToRef(nr, F[2]);\n                  Ia.reConstruct(To, tv, a._worldMatrix);\n                }\n                De = Se + 3, Le = xe + 4, we = Me + 2;\n              }\n            }\n            if (n) {\n              if (this._computeParticleColor && a.updateVerticesData(Oe.b.ColorKind, s, !1, !1), this._computeParticleTexture && a.updateVerticesData(Oe.b.UVKind, y, !1, !1), a.updateVerticesData(Oe.b.PositionKind, d, !1, !1), !a.areNormalsFrozen || a.isFacetDataEnabled) {\n                if (this._computeParticleVertex || a.isFacetDataEnabled) {\n                  var nv = a.isFacetDataEnabled ? a.getFacetDataParameters() : null;\n                  ht.a.ComputeNormals(d, P, p, nv);\n                  for (var Ai = 0; Ai < p.length; Ai++)\n                    B[Ai] = p[Ai];\n                }\n                a.areNormalsFrozen || a.updateVerticesData(Oe.b.NormalKind, p, !1, !1);\n              }\n              if (this._depthSort && this._depthSortParticles) {\n                var jc = this.depthSortedParticles;\n                jc.sort(this._depthSortFunction);\n                for (var iv = jc.length, nf = 0, Hc = 0, Wc = 0; Wc < iv; Wc++) {\n                  var Xc = jc[Wc], rv = Xc.indicesLength, ov = Xc.ind;\n                  for (Ai = 0; Ai < rv; Ai++)\n                    if (P[nf] = R[ov + Ai], nf++, this._pickable && Ai % 3 == 0) {\n                      var rf = this.pickedParticles[Hc];\n                      rf.idx = Xc.idx, rf.faceId = Hc, Hc++;\n                    }\n                }\n                a.updateIndices(P);\n              }\n            }\n            return this._computeBoundingBox && (a._boundingInfo ? a._boundingInfo.reConstruct(se, ce, a._worldMatrix) : a._boundingInfo = new Mi.a(se, ce, a._worldMatrix)), this._autoUpdateSubMeshes && this.computeSubMeshes(), this.afterUpdateParticles(t, e, n), this;\n          }, r.prototype.dispose = function() {\n            this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._normals32 = null, this._fixedNormal32 = null, this._uvs32 = null, this._colors32 = null, this.pickedParticles = null, this.pickedBySubMesh = null, this._materials = null, this._materialIndexes = null, this._indicesByMaterial = null, this._idxOfId = null;\n          }, r.prototype.pickedParticle = function(t) {\n            if (t.hit) {\n              var e = t.subMeshId, n = t.faceId, i = this.pickedBySubMesh;\n              if (i[e] && i[e][n])\n                return i[e][n];\n            }\n            return null;\n          }, r.prototype.getParticleById = function(t) {\n            var e = this.particles[t];\n            if (e && e.id == t)\n              return e;\n            var n = this.particles, i = this._idxOfId[t];\n            if (i !== void 0)\n              return n[i];\n            for (var o = 0, a = this.nbParticles; o < a; ) {\n              var s = n[o];\n              if (s.id == t)\n                return s;\n              o++;\n            }\n            return null;\n          }, r.prototype.getParticlesByShapeId = function(t) {\n            var e = [];\n            return this.getParticlesByShapeIdToRef(t, e), e;\n          }, r.prototype.getParticlesByShapeIdToRef = function(t, e) {\n            e.length = 0;\n            for (var n = 0; n < this.nbParticles; n++) {\n              var i = this.particles[n];\n              i.shapeId == t && e.push(i);\n            }\n            return this;\n          }, r.prototype.computeSubMeshes = function() {\n            if (!this.mesh || !this._multimaterialEnabled)\n              return this;\n            var t = this.depthSortedParticles;\n            if (this.particles.length > 0)\n              for (var e = 0; e < this.particles.length; e++) {\n                var n = this.particles[e];\n                n.materialIndex || (n.materialIndex = 0);\n                var i = t[e];\n                i.materialIndex = n.materialIndex, i.ind = n._ind, i.indicesLength = n._model._indicesLength, i.idx = n.idx;\n              }\n            this._sortParticlesByMaterial();\n            var o = this._indicesByMaterial, a = this._materialIndexes, s = this.mesh;\n            s.subMeshes = [];\n            for (var d = s.getTotalVertices(), p = 0; p < a.length; p++) {\n              var y = o[p], P = o[p + 1] - y, R = a[p];\n              new uo.a(R, 0, d, y, P, s);\n            }\n            return this;\n          }, r.prototype._sortParticlesByMaterial = function() {\n            var t = [0];\n            this._indicesByMaterial = t;\n            var e = [];\n            this._materialIndexes = e;\n            var n = this.depthSortedParticles;\n            n.sort(this._materialSortFunction);\n            var i = n.length, o = this._indices32, a = this._indices, s = 0, d = 0, p = 0, y = n[0].materialIndex;\n            e.push(y), this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]);\n            for (var P = 0; P < i; P++) {\n              var R = n[P], B = R.indicesLength, F = R.ind;\n              R.materialIndex !== y && (y = R.materialIndex, t.push(p), e.push(y), this._pickable && (s++, this.pickedBySubMesh[s] = [], d = 0));\n              for (var z = 0, J = 0; J < B; J++) {\n                if (o[p] = a[F + J], this._pickable && J % 3 == 0) {\n                  var ie = this.pickedBySubMesh[s][d];\n                  ie ? (ie.idx = R.idx, ie.faceId = z) : this.pickedBySubMesh[s][d] = { idx: R.idx, faceId: z }, d++, z++;\n                }\n                p++;\n              }\n            }\n            return t.push(o.length), this._updatable && this.mesh.updateIndices(o), this;\n          }, r.prototype._setMaterialIndexesById = function() {\n            this._materialIndexesById = {};\n            for (var t = 0; t < this._materials.length; t++) {\n              var e = this._materials[t].uniqueId;\n              this._materialIndexesById[e] = t;\n            }\n          }, r.prototype._filterUniqueMaterialId = function(t) {\n            return t.filter(function(e, n, i) {\n              return i.indexOf(e) === n;\n            });\n          }, r.prototype._setDefaultMaterial = function() {\n            return this._defaultMaterial || (this._defaultMaterial = new Nt.a(this.name + \"DefaultMaterial\", this._scene)), this._defaultMaterial;\n          }, r.prototype.refreshVisibleSize = function() {\n            return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this;\n          }, r.prototype.setVisibilityBox = function(t) {\n            var e = t / 2;\n            this.mesh._boundingInfo = new Mi.a(new u.e(-e, -e, -e), new u.e(e, e, e));\n          }, Object.defineProperty(r.prototype, \"isAlwaysVisible\", { get: function() {\n            return this._alwaysVisible;\n          }, set: function(t) {\n            this._alwaysVisible = t, this.mesh.alwaysSelectAsActiveMesh = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isVisibilityBoxLocked\", { get: function() {\n            return this._isVisibilityBoxLocked;\n          }, set: function(t) {\n            this._isVisibilityBoxLocked = t, this.mesh.getBoundingInfo().isLocked = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleRotation\", { get: function() {\n            return this._computeParticleRotation;\n          }, set: function(t) {\n            this._computeParticleRotation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleColor\", { get: function() {\n            return this._computeParticleColor;\n          }, set: function(t) {\n            this._computeParticleColor = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleTexture\", { get: function() {\n            return this._computeParticleTexture;\n          }, set: function(t) {\n            this._computeParticleTexture = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleVertex\", { get: function() {\n            return this._computeParticleVertex;\n          }, set: function(t) {\n            this._computeParticleVertex = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeBoundingBox\", { get: function() {\n            return this._computeBoundingBox;\n          }, set: function(t) {\n            this._computeBoundingBox = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"depthSortParticles\", { get: function() {\n            return this._depthSortParticles;\n          }, set: function(t) {\n            this._depthSortParticles = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"expandable\", { get: function() {\n            return this._expandable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"multimaterialEnabled\", { get: function() {\n            return this._multimaterialEnabled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useModelMaterial\", { get: function() {\n            return this._useModelMaterial;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"materials\", { get: function() {\n            return this._materials;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setMultiMaterial = function(t) {\n            this._materials = this._filterUniqueMaterialId(t), this._setMaterialIndexesById(), this._multimaterial && this._multimaterial.dispose(), this._multimaterial = new Qi.a(this.name + \"MultiMaterial\", this._scene);\n            for (var e = 0; e < this._materials.length; e++)\n              this._multimaterial.subMaterials.push(this._materials[e]);\n            this.computeSubMeshes(), this.mesh.material = this._multimaterial;\n          }, Object.defineProperty(r.prototype, \"multimaterial\", { get: function() {\n            return this._multimaterial;\n          }, set: function(t) {\n            this._multimaterial = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"autoUpdateSubMeshes\", { get: function() {\n            return this._autoUpdateSubMeshes;\n          }, set: function(t) {\n            this._autoUpdateSubMeshes = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.initParticles = function() {\n          }, r.prototype.recycleParticle = function(t) {\n            return t;\n          }, r.prototype.updateParticle = function(t) {\n            return t;\n          }, r.prototype.updateParticleVertex = function(t, e, n) {\n            return this;\n          }, r.prototype.beforeUpdateParticles = function(t, e, n) {\n          }, r.prototype.afterUpdateParticles = function(t, e, n) {\n          }, r;\n        }(), ud = function() {\n          function r(t, e, n, i, o) {\n            this.idx = 0, this.color = new I.b(1, 1, 1, 1), this.position = u.e.Zero(), this.rotation = u.e.Zero(), this.uv = new u.d(0, 0), this.velocity = u.e.Zero(), this.pivot = u.e.Zero(), this.translateFromPivot = !1, this._pos = 0, this._ind = 0, this.groupId = 0, this.idxInGroup = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this._globalPosition = u.e.Zero(), this.idx = t, this._group = e, this.groupId = n, this.idxInGroup = i, this._pcs = o;\n          }\n          return Object.defineProperty(r.prototype, \"size\", { get: function() {\n            return this.size;\n          }, set: function(t) {\n            this.size = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"quaternion\", { get: function() {\n            return this.rotationQuaternion;\n          }, set: function(t) {\n            this.rotationQuaternion = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.intersectsMesh = function(t, e) {\n            if (!t._boundingInfo)\n              return !1;\n            if (e = e || !1)\n              return t.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));\n            var n, i, o, a, s, d;\n            n = t.getBoundingInfo().boundingBox.maximumWorld.x, i = t.getBoundingInfo().boundingBox.minimumWorld.x, o = t.getBoundingInfo().boundingBox.maximumWorld.y, a = t.getBoundingInfo().boundingBox.minimumWorld.y, s = t.getBoundingInfo().boundingBox.maximumWorld.z, d = t.getBoundingInfo().boundingBox.minimumWorld.z;\n            var p = this.position.x + this._pcs.mesh.position.x, y = this.position.y + this._pcs.mesh.position.y, P = this.position.z + this._pcs.mesh.position.z;\n            return i <= p && p <= n && a <= y && y <= o && d <= P && P <= s;\n          }, r.prototype.getRotationMatrix = function(t) {\n            var e;\n            if (this.rotationQuaternion)\n              e = this.rotationQuaternion;\n            else {\n              e = u.c.Quaternion[0];\n              var n = this.rotation;\n              u.b.RotationYawPitchRollToRef(n.y, n.x, n.z, e);\n            }\n            e.toRotationMatrix(t);\n          }, r;\n        }(), fa = function(r, t) {\n          this.groupID = r, this._positionFunction = t;\n        };\n        (function(r) {\n          r[r.Color = 2] = \"Color\", r[r.UV = 1] = \"UV\", r[r.Random = 0] = \"Random\", r[r.Stated = 3] = \"Stated\";\n        })(bn || (bn = {}));\n        var bm = function() {\n          function r(t, e, n, i) {\n            this.particles = new Array(), this.nbParticles = 0, this.counter = 0, this.vars = {}, this._promises = [], this._positions = new Array(), this._indices = new Array(), this._normals = new Array(), this._colors = new Array(), this._uvs = new Array(), this._updatable = !0, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._groups = new Array(), this._groupCounter = 0, this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeBoundingBox = !1, this._isReady = !1, this.name = t, this._size = e, this._scene = n || te.a.LastCreatedScene, i && i.updatable !== void 0 ? this._updatable = i.updatable : this._updatable = !0;\n          }\n          return r.prototype.buildMeshAsync = function() {\n            var t = this;\n            return Promise.all(this._promises).then(function() {\n              return t._isReady = !0, t._buildMesh();\n            });\n          }, r.prototype._buildMesh = function() {\n            this.nbParticles === 0 && this.addPoints(1), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors);\n            var t = new ht.a();\n            t.set(this._positions32, Oe.b.PositionKind), this._uvs32.length > 0 && t.set(this._uvs32, Oe.b.UVKind);\n            var e = 0;\n            this._colors32.length > 0 && (e = 1, t.set(this._colors32, Oe.b.ColorKind));\n            var n = new Ie.a(this.name, this._scene);\n            t.applyToMesh(n, this._updatable), this.mesh = n, this._positions = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0);\n            var i = new Nt.a(\"point cloud material\", this._scene);\n            return i.emissiveColor = new I.a(e, e, e), i.disableLighting = !0, i.pointsCloud = !0, i.pointSize = this._size, n.material = i, new Promise(function(o) {\n              return o(n);\n            });\n          }, r.prototype._addParticle = function(t, e, n, i) {\n            var o = new ud(t, e, n, i, this);\n            return this.particles.push(o), o;\n          }, r.prototype._randomUnitVector = function(t) {\n            t.position = new u.e(Math.random(), Math.random(), Math.random()), t.color = new I.b(1, 1, 1, 1);\n          }, r.prototype._getColorIndicesForCoord = function(t, e, n, i) {\n            var o = t._groupImageData, a = n * (4 * i) + 4 * e, s = [a, a + 1, a + 2, a + 3], d = s[1], p = s[2], y = s[3], P = o[s[0]], R = o[d], B = o[p], F = o[y];\n            return new I.b(P / 255, R / 255, B / 255, F);\n          }, r.prototype._setPointsColorOrUV = function(t, e, n, i, o, a, s) {\n            n && t.updateFacetData();\n            var d = 2 * t.getBoundingInfo().boundingSphere.radius, p = t.getVerticesData(Oe.b.PositionKind), y = t.getIndices(), P = t.getVerticesData(Oe.b.UVKind), R = t.getVerticesData(Oe.b.ColorKind), B = u.e.Zero();\n            t.computeWorldMatrix();\n            var F = t.getWorldMatrix();\n            if (!F.isIdentity())\n              for (var z = 0; z < p.length / 3; z++)\n                u.e.TransformCoordinatesFromFloatsToRef(p[3 * z], p[3 * z + 1], p[3 * z + 2], F, B), p[3 * z] = B.x, p[3 * z + 1] = B.y, p[3 * z + 2] = B.z;\n            var J, ie, se = 0, ce = 0, ue = 0, fe = 0, ve = 0, Te = 0, Re = 0, Ae = 0, Ee = 0, Se = 0, De = 0, xe = 0, Le = 0, Me = 0, we = u.e.Zero(), Ye = u.e.Zero(), et = u.e.Zero(), nt = u.e.Zero(), ct = u.e.Zero(), Ke = 0, rt = 0, it = 0, qe = 0, ut = 0, Ve = 0, Ze = u.d.Zero(), vt = u.d.Zero(), jt = u.d.Zero(), Dt = u.d.Zero(), Yt = u.d.Zero(), mt = 0, qt = 0, Ht = 0, kt = 0, Wt = 0, bt = 0, Rt = 0, Zt = 0, Mn = 0, Bn = 0, Kn = 0, In = 0, Kt = u.f.Zero(), oi = u.f.Zero(), Ti = u.f.Zero(), Lr = u.f.Zero(), Nr = u.f.Zero(), ai = 0, wi = 0;\n            s = s || 0;\n            var wr, Gt = new u.f(0, 0, 0, 0), Fi = u.e.Zero(), Tn = u.e.Zero(), er = u.e.Zero(), Ei = 0, Ma = u.e.Zero(), Ia = 0, Fr = 0, Bi = new dn.a(u.e.Zero(), new u.e(1, 0, 0)), Ui = u.e.Zero();\n            for (ce = 0; ce < y.length / 3; ce++) {\n              var tr, Vi, Br, Ur, Vr, ki, Gi, kr;\n              ue = y[3 * ce], fe = y[3 * ce + 1], ve = y[3 * ce + 2], Te = p[3 * ue], Re = p[3 * ue + 1], Ae = p[3 * ue + 2], Ee = p[3 * fe], Se = p[3 * fe + 1], De = p[3 * fe + 2], xe = p[3 * ve], Le = p[3 * ve + 1], Me = p[3 * ve + 2], we.set(Te, Re, Ae), Ye.set(Ee, Se, De), et.set(xe, Le, Me), Ye.subtractToRef(we, nt), et.subtractToRef(Ye, ct), P && (Ke = P[2 * ue], rt = P[2 * ue + 1], it = P[2 * fe], qe = P[2 * fe + 1], ut = P[2 * ve], Ve = P[2 * ve + 1], Ze.set(Ke, rt), vt.set(it, qe), jt.set(ut, Ve), vt.subtractToRef(Ze, Dt), jt.subtractToRef(vt, Yt)), R && i && (mt = R[4 * ue], qt = R[4 * ue + 1], Ht = R[4 * ue + 2], kt = R[4 * ue + 3], Wt = R[4 * fe], bt = R[4 * fe + 1], Rt = R[4 * fe + 2], Zt = R[4 * fe + 3], Mn = R[4 * ve], Bn = R[4 * ve + 1], Kn = R[4 * ve + 2], In = R[4 * ve + 3], Kt.set(mt, qt, Ht, kt), oi.set(Wt, bt, Rt, Zt), Ti.set(Mn, Bn, Kn, In), oi.subtractToRef(Kt, Lr), Ti.subtractToRef(oi, Nr));\n              for (var Si, Dn, bo = new I.a(0, 0, 0), nr = new I.a(0, 0, 0), To = 0; To < e._groupDensity[ce]; To++)\n                se = this.particles.length, this._addParticle(se, e, this._groupCounter, ce + To), Dn = this.particles[se], ai = $.a.RandomRange(0, 1), wi = $.a.RandomRange(0, 1), J = we.add(nt.scale(ai)).add(ct.scale(ai * wi)), n && (Fi = t.getFacetNormal(ce).normalize().scale(-1), Tn = nt.clone().normalize(), er = u.e.Cross(Fi, Tn), Ei = $.a.RandomRange(0, 2 * Math.PI), Ma = Tn.scale(Math.cos(Ei)).add(er.scale(Math.sin(Ei))), Ei = $.a.RandomRange(0.1, Math.PI / 2), Ui = Ma.scale(Math.cos(Ei)).add(Fi.scale(Math.sin(Ei))), Bi.origin = J.add(Ui.scale(1e-5)), Bi.direction = Ui, Bi.length = d, (wr = Bi.intersectsMesh(t)).hit && (Fr = wr.pickedPoint.subtract(J).length(), Ia = $.a.RandomRange(0, 1) * Fr, J.addInPlace(Ui.scale(Ia)))), Dn.position = J.clone(), this._positions.push(Dn.position.x, Dn.position.y, Dn.position.z), i !== void 0 ? P && (ie = Ze.add(Dt.scale(ai)).add(Yt.scale(ai * wi)), i ? o && e._groupImageData !== null ? (tr = e._groupImgWidth, Vi = e._groupImgHeight, Si = this._getColorIndicesForCoord(e, Math.round(ie.x * tr), Math.round(ie.y * Vi), tr), Dn.color = Si, this._colors.push(Si.r, Si.g, Si.b, Si.a)) : R ? (Gt = Kt.add(Lr.scale(ai)).add(Nr.scale(ai * wi)), Dn.color = new I.b(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w)) : (Gt = Kt.set(Math.random(), Math.random(), Math.random(), 1), Dn.color = new I.b(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w)) : (Dn.uv = ie.clone(), this._uvs.push(Dn.uv.x, Dn.uv.y))) : (a ? (bo.set(a.r, a.g, a.b), Br = $.a.RandomRange(-s, s), Ur = $.a.RandomRange(-s, s), Vr = (kr = bo.toHSV()).r, (ki = kr.g + Br) < 0 && (ki = 0), ki > 1 && (ki = 1), (Gi = kr.b + Ur) < 0 && (Gi = 0), Gi > 1 && (Gi = 1), I.a.HSVtoRGBToRef(Vr, ki, Gi, nr), Gt.set(nr.r, nr.g, nr.b, 1)) : Gt = Kt.set(Math.random(), Math.random(), Math.random(), 1), Dn.color = new I.b(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w));\n            }\n          }, r.prototype._colorFromTexture = function(t, e, n) {\n            var i = this;\n            if (t.material === null)\n              return l.a.Warn(t.name + \"has no material.\"), e._groupImageData = null, void this._setPointsColorOrUV(t, e, n, !0, !1);\n            var o = t.material.getActiveTextures();\n            if (o.length === 0)\n              return l.a.Warn(t.name + \"has no useable texture.\"), e._groupImageData = null, void this._setPointsColorOrUV(t, e, n, !0, !1);\n            var a = t.clone();\n            a.setEnabled(!1), this._promises.push(new Promise(function(s) {\n              kn.a.WhenAllReady(o, function() {\n                var d = e._textureNb;\n                return d < 0 && (d = 0), d > o.length - 1 && (d = o.length - 1), e._groupImageData = o[d].readPixels(), e._groupImgWidth = o[d].getSize().width, e._groupImgHeight = o[d].getSize().height, i._setPointsColorOrUV(a, e, n, !0, !0), a.dispose(), s();\n              });\n            }));\n          }, r.prototype._calculateDensity = function(t, e, n) {\n            for (var i, o, a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe = new Array(), ve = u.e.Zero(), Te = u.e.Zero(), Re = u.e.Zero(), Ae = u.e.Zero(), Ee = u.e.Zero(), Se = u.e.Zero(), De = new Array(), xe = 0, Le = n.length / 3, Me = 0; Me < Le; Me++)\n              i = n[3 * Me], o = n[3 * Me + 1], a = n[3 * Me + 2], s = e[3 * i], d = e[3 * i + 1], p = e[3 * i + 2], y = e[3 * o], P = e[3 * o + 1], R = e[3 * o + 2], B = e[3 * a], F = e[3 * a + 1], z = e[3 * a + 2], ve.set(s, d, p), Te.set(y, P, R), Re.set(B, F, z), Te.subtractToRef(ve, Ae), Re.subtractToRef(Te, Ee), Re.subtractToRef(ve, Se), ce = ((J = Ae.length()) + (ie = Ee.length()) + (se = Se.length())) / 2, xe += ue = Math.sqrt(ce * (ce - J) * (ce - ie) * (ce - se)), De[Me] = ue;\n            var we = 0;\n            for (Me = 0; Me < Le; Me++)\n              fe[Me] = Math.floor(t * De[Me] / xe), we += fe[Me];\n            var Ye = t - we, et = Math.floor(Ye / Le), nt = Ye % Le;\n            for (et > 0 && (fe = fe.map(function(ct) {\n              return ct + et;\n            })), Me = 0; Me < nt; Me++)\n              fe[Me] += 1;\n            return fe;\n          }, r.prototype.addPoints = function(t, e) {\n            e === void 0 && (e = this._randomUnitVector);\n            for (var n, i = new fa(this._groupCounter, e), o = this.nbParticles, a = 0; a < t; a++)\n              n = this._addParticle(o, i, this._groupCounter, a), i && i._positionFunction && i._positionFunction(n, o, a), this._positions.push(n.position.x, n.position.y, n.position.z), n.color && this._colors.push(n.color.r, n.color.g, n.color.b, n.color.a), n.uv && this._uvs.push(n.uv.x, n.uv.y), o++;\n            return this.nbParticles += t, this._groupCounter++, this._groupCounter;\n          }, r.prototype.addSurfacePoints = function(t, e, n, i, o) {\n            var a = n || bn.Random;\n            (isNaN(a) || a < 0 || a > 3) && (a = bn.Random);\n            var s = t.getVerticesData(Oe.b.PositionKind), d = t.getIndices();\n            this._groups.push(this._groupCounter);\n            var p = new fa(this._groupCounter, null);\n            switch (p._groupDensity = this._calculateDensity(e, s, d), a === bn.Color ? p._textureNb = i || 0 : i = i || new I.b(1, 1, 1, 1), a) {\n              case bn.Color:\n                this._colorFromTexture(t, p, !1);\n                break;\n              case bn.UV:\n                this._setPointsColorOrUV(t, p, !1, !1, !1);\n                break;\n              case bn.Random:\n                this._setPointsColorOrUV(t, p, !1);\n                break;\n              case bn.Stated:\n                this._setPointsColorOrUV(t, p, !1, void 0, void 0, i, o);\n            }\n            return this.nbParticles += e, this._groupCounter++, this._groupCounter - 1;\n          }, r.prototype.addVolumePoints = function(t, e, n, i, o) {\n            var a = n || bn.Random;\n            (isNaN(a) || a < 0 || a > 3) && (a = bn.Random);\n            var s = t.getVerticesData(Oe.b.PositionKind), d = t.getIndices();\n            this._groups.push(this._groupCounter);\n            var p = new fa(this._groupCounter, null);\n            switch (p._groupDensity = this._calculateDensity(e, s, d), a === bn.Color ? p._textureNb = i || 0 : i = i || new I.b(1, 1, 1, 1), a) {\n              case bn.Color:\n                this._colorFromTexture(t, p, !0);\n                break;\n              case bn.UV:\n                this._setPointsColorOrUV(t, p, !0, !1, !1);\n                break;\n              case bn.Random:\n                this._setPointsColorOrUV(t, p, !0);\n                break;\n              case bn.Stated:\n                this._setPointsColorOrUV(t, p, !0, void 0, void 0, i, o);\n            }\n            return this.nbParticles += e, this._groupCounter++, this._groupCounter - 1;\n          }, r.prototype.setParticles = function(t, e, n) {\n            if (t === void 0 && (t = 0), e === void 0 && (e = this.nbParticles - 1), n === void 0 && (n = !0), !this._updatable || !this._isReady)\n              return this;\n            this.beforeUpdateParticles(t, e, n);\n            var i = u.c.Matrix[0], o = this.mesh, a = this._colors32, s = this._positions32, d = this._uvs32, p = u.c.Vector3, y = p[5].copyFromFloats(1, 0, 0), P = p[6].copyFromFloats(0, 1, 0), R = p[7].copyFromFloats(0, 0, 1), B = p[8].setAll(Number.MAX_VALUE), F = p[9].setAll(-Number.MAX_VALUE);\n            u.a.IdentityToRef(i);\n            var z = 0;\n            if (this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), e = e >= this.nbParticles ? this.nbParticles - 1 : e, this._computeBoundingBox && (t != 0 || e != this.nbParticles - 1)) {\n              var J = this.mesh._boundingInfo;\n              J && (B.copyFrom(J.minimum), F.copyFrom(J.maximum));\n            }\n            z = 0;\n            for (var ie = 0, se = 0, ce = 0, ue = t; ue <= e; ue++) {\n              var fe = this.particles[ue];\n              ie = 3 * (z = fe.idx), se = 4 * z, ce = 2 * z, this.updateParticle(fe);\n              var ve = fe._rotationMatrix, Te = fe.position, Re = fe._globalPosition;\n              if (this._computeParticleRotation && fe.getRotationMatrix(i), fe.parentId !== null) {\n                var Ae = this.particles[fe.parentId], Ee = Ae._rotationMatrix, Se = Ae._globalPosition, De = Te.x * Ee[1] + Te.y * Ee[4] + Te.z * Ee[7], xe = Te.x * Ee[0] + Te.y * Ee[3] + Te.z * Ee[6], Le = Te.x * Ee[2] + Te.y * Ee[5] + Te.z * Ee[8];\n                if (Re.x = Se.x + xe, Re.y = Se.y + De, Re.z = Se.z + Le, this._computeParticleRotation) {\n                  var Me = i.m;\n                  ve[0] = Me[0] * Ee[0] + Me[1] * Ee[3] + Me[2] * Ee[6], ve[1] = Me[0] * Ee[1] + Me[1] * Ee[4] + Me[2] * Ee[7], ve[2] = Me[0] * Ee[2] + Me[1] * Ee[5] + Me[2] * Ee[8], ve[3] = Me[4] * Ee[0] + Me[5] * Ee[3] + Me[6] * Ee[6], ve[4] = Me[4] * Ee[1] + Me[5] * Ee[4] + Me[6] * Ee[7], ve[5] = Me[4] * Ee[2] + Me[5] * Ee[5] + Me[6] * Ee[8], ve[6] = Me[8] * Ee[0] + Me[9] * Ee[3] + Me[10] * Ee[6], ve[7] = Me[8] * Ee[1] + Me[9] * Ee[4] + Me[10] * Ee[7], ve[8] = Me[8] * Ee[2] + Me[9] * Ee[5] + Me[10] * Ee[8];\n                }\n              } else\n                Re.x = 0, Re.y = 0, Re.z = 0, this._computeParticleRotation && (Me = i.m, ve[0] = Me[0], ve[1] = Me[1], ve[2] = Me[2], ve[3] = Me[4], ve[4] = Me[5], ve[5] = Me[6], ve[6] = Me[8], ve[7] = Me[9], ve[8] = Me[10]);\n              var we = p[11];\n              fe.translateFromPivot ? we.setAll(0) : we.copyFrom(fe.pivot);\n              var Ye = p[0];\n              Ye.copyFrom(fe.position);\n              var et = Ye.x - fe.pivot.x, nt = Ye.y - fe.pivot.y, ct = Ye.z - fe.pivot.z, Ke = et * ve[0] + nt * ve[3] + ct * ve[6], rt = et * ve[1] + nt * ve[4] + ct * ve[7], it = et * ve[2] + nt * ve[5] + ct * ve[8];\n              Ke += we.x, rt += we.y, it += we.z;\n              var qe = s[ie] = Re.x + y.x * Ke + P.x * rt + R.x * it, ut = s[ie + 1] = Re.y + y.y * Ke + P.y * rt + R.y * it, Ve = s[ie + 2] = Re.z + y.z * Ke + P.z * rt + R.z * it;\n              if (this._computeBoundingBox && (B.minimizeInPlaceFromFloats(qe, ut, Ve), F.maximizeInPlaceFromFloats(qe, ut, Ve)), this._computeParticleColor && fe.color) {\n                var Ze = fe.color, vt = this._colors32;\n                vt[se] = Ze.r, vt[se + 1] = Ze.g, vt[se + 2] = Ze.b, vt[se + 3] = Ze.a;\n              }\n              if (this._computeParticleTexture && fe.uv) {\n                var jt = fe.uv, Dt = this._uvs32;\n                Dt[ce] = jt.x, Dt[ce + 1] = jt.y;\n              }\n            }\n            return n && (this._computeParticleColor && o.updateVerticesData(Oe.b.ColorKind, a, !1, !1), this._computeParticleTexture && o.updateVerticesData(Oe.b.UVKind, d, !1, !1), o.updateVerticesData(Oe.b.PositionKind, s, !1, !1)), this._computeBoundingBox && (o._boundingInfo ? o._boundingInfo.reConstruct(B, F, o._worldMatrix) : o._boundingInfo = new Mi.a(B, F, o._worldMatrix)), this.afterUpdateParticles(t, e, n), this;\n          }, r.prototype.dispose = function() {\n            this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._uvs32 = null, this._colors32 = null;\n          }, r.prototype.refreshVisibleSize = function() {\n            return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this;\n          }, r.prototype.setVisibilityBox = function(t) {\n            var e = t / 2;\n            this.mesh._boundingInfo = new Mi.a(new u.e(-e, -e, -e), new u.e(e, e, e));\n          }, Object.defineProperty(r.prototype, \"isAlwaysVisible\", { get: function() {\n            return this._alwaysVisible;\n          }, set: function(t) {\n            this._alwaysVisible = t, this.mesh.alwaysSelectAsActiveMesh = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleRotation\", { set: function(t) {\n            this._computeParticleRotation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleColor\", { get: function() {\n            return this._computeParticleColor;\n          }, set: function(t) {\n            this._computeParticleColor = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleTexture\", { get: function() {\n            return this._computeParticleTexture;\n          }, set: function(t) {\n            this._computeParticleTexture = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeBoundingBox\", { get: function() {\n            return this._computeBoundingBox;\n          }, set: function(t) {\n            this._computeBoundingBox = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.initParticles = function() {\n          }, r.prototype.recycleParticle = function(t) {\n            return t;\n          }, r.prototype.updateParticle = function(t) {\n            return t;\n          }, r.prototype.beforeUpdateParticles = function(t, e, n) {\n          }, r.prototype.afterUpdateParticles = function(t, e, n) {\n          }, r;\n        }();\n        _e.a.prototype.getPhysicsEngine = function() {\n          return this._physicsEngine;\n        }, _e.a.prototype.enablePhysics = function(r, t) {\n          if (r === void 0 && (r = null), this._physicsEngine)\n            return !0;\n          var e = this._getComponent(ot.a.NAME_PHYSICSENGINE);\n          e || (e = new hd(this), this._addComponent(e));\n          try {\n            return this._physicsEngine = new Sr(r, t), this._physicsTimeAccumulator = 0, !0;\n          } catch (n) {\n            return l.a.Error(n.message), !1;\n          }\n        }, _e.a.prototype.disablePhysicsEngine = function() {\n          this._physicsEngine && (this._physicsEngine.dispose(), this._physicsEngine = null);\n        }, _e.a.prototype.isPhysicsEnabled = function() {\n          return this._physicsEngine !== void 0;\n        }, _e.a.prototype.deleteCompoundImpostor = function(r) {\n          var t = r.parts[0].mesh;\n          t.physicsImpostor && (t.physicsImpostor.dispose(), t.physicsImpostor = null);\n        }, _e.a.prototype._advancePhysicsEngineStep = function(r) {\n          if (this._physicsEngine) {\n            var t = this._physicsEngine.getSubTimeStep();\n            if (t > 0)\n              for (this._physicsTimeAccumulator += r; this._physicsTimeAccumulator > t; )\n                this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(t / 1e3), this.onAfterPhysicsObservable.notifyObservers(this), this._physicsTimeAccumulator -= t;\n            else\n              this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(r / 1e3), this.onAfterPhysicsObservable.notifyObservers(this);\n          }\n        }, Object.defineProperty(Mt.a.prototype, \"physicsImpostor\", { get: function() {\n          return this._physicsImpostor;\n        }, set: function(r) {\n          var t = this;\n          this._physicsImpostor !== r && (this._disposePhysicsObserver && this.onDisposeObservable.remove(this._disposePhysicsObserver), this._physicsImpostor = r, r && (this._disposePhysicsObserver = this.onDisposeObservable.add(function() {\n            t.physicsImpostor && (t.physicsImpostor.dispose(), t.physicsImpostor = null);\n          })));\n        }, enumerable: !0, configurable: !0 }), Mt.a.prototype.getPhysicsImpostor = function() {\n          return this.physicsImpostor;\n        }, Mt.a.prototype.applyImpulse = function(r, t) {\n          return this.physicsImpostor ? (this.physicsImpostor.applyImpulse(r, t), this) : this;\n        }, Mt.a.prototype.setPhysicsLinkWith = function(r, t, e, n) {\n          return this.physicsImpostor && r.physicsImpostor ? (this.physicsImpostor.createJoint(r.physicsImpostor, Jt.e.HingeJoint, { mainPivot: t, connectedPivot: e, nativeParams: n }), this) : this;\n        };\n        var go, Or, hd = function() {\n          function r(t) {\n            var e = this;\n            this.name = ot.a.NAME_PHYSICSENGINE, this.scene = t, this.scene.onBeforePhysicsObservable = new C.c(), this.scene.onAfterPhysicsObservable = new C.c(), this.scene.getDeterministicFrameTime = function() {\n              return e.scene._physicsEngine ? 1e3 * e.scene._physicsEngine.getTimeStep() : 1e3 / 60;\n            };\n          }\n          return r.prototype.register = function() {\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            this.scene.onBeforePhysicsObservable.clear(), this.scene.onAfterPhysicsObservable.clear(), this.scene._physicsEngine && this.scene.disablePhysicsEngine();\n          }, r;\n        }(), Tm = function() {\n          function r(t) {\n            this._scene = t, this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine || l.a.Warn(\"Physics engine not enabled. Please enable the physics before you can use the methods.\");\n          }\n          return r.prototype.applyRadialExplosionImpulse = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call this method.\"), null;\n            var o = this._physicsEngine.getImpostors();\n            if (o.length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Mr()).radius = e, e.strength = n || e.strength, e.falloff = i || e.falloff);\n            var a = new dd(this._scene, e), s = Array();\n            return o.forEach(function(d) {\n              var p = a.getImpostorHitData(d, t);\n              p && (d.applyImpulse(p.force, p.contactPoint), s.push({ impostor: d, hitData: p }));\n            }), a.triggerAffectedImpostorsCallback(s), a.dispose(!1), a;\n          }, r.prototype.applyRadialExplosionForce = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            var o = this._physicsEngine.getImpostors();\n            if (o.length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Mr()).radius = e, e.strength = n || e.strength, e.falloff = i || e.falloff);\n            var a = new dd(this._scene, e), s = Array();\n            return o.forEach(function(d) {\n              var p = a.getImpostorHitData(d, t);\n              p && (d.applyForce(p.force, p.contactPoint), s.push({ impostor: d, hitData: p }));\n            }), a.triggerAffectedImpostorsCallback(s), a.dispose(!1), a;\n          }, r.prototype.gravitationalField = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            if (this._physicsEngine.getImpostors().length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Mr()).radius = e, e.strength = n || e.strength, e.falloff = i || e.falloff);\n            var o = new Em(this, this._scene, t, e);\n            return o.dispose(!1), o;\n          }, r.prototype.updraft = function(t, e, n, i, o) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            if (this._physicsEngine.getImpostors().length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Tc()).radius = e, e.strength = n || e.strength, e.height = i || e.height, e.updraftMode = o || e.updraftMode);\n            var a = new Sm(this._scene, t, e);\n            return a.dispose(!1), a;\n          }, r.prototype.vortex = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            if (this._physicsEngine.getImpostors().length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Ec()).radius = e, e.strength = n || e.strength, e.height = i || e.height);\n            var o = new Am(this._scene, t, e);\n            return o.dispose(!1), o;\n          }, r;\n        }(), dd = function() {\n          function r(t, e) {\n            this._scene = t, this._options = e, this._dataFetched = !1, this._options = Object(c.a)(Object(c.a)({}, new Mr()), this._options);\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { sphere: this._sphere };\n          }, r.prototype.getImpostorHitData = function(t, e) {\n            if (t.mass === 0 || !this._intersectsWithSphere(t, e, this._options.radius) || t.object.getClassName() !== \"Mesh\" && t.object.getClassName() !== \"InstancedMesh\")\n              return null;\n            var n = t.getObjectCenter().subtract(e), i = new dn.a(e, n, this._options.radius).intersectsMesh(t.object).pickedPoint;\n            if (!i)\n              return null;\n            var o = u.e.Distance(e, i);\n            if (o > this._options.radius)\n              return null;\n            var a = this._options.falloff === go.Constant ? this._options.strength : this._options.strength * (1 - o / this._options.radius);\n            return { force: n.multiplyByFloats(a, a, a), contactPoint: i, distanceFromOrigin: o };\n          }, r.prototype.triggerAffectedImpostorsCallback = function(t) {\n            this._options.affectedImpostorsCallback && this._options.affectedImpostorsCallback(t);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), t ? this._sphere.dispose() : setTimeout(function() {\n              e._dataFetched || e._sphere.dispose();\n            }, 0);\n          }, r.prototype._prepareSphere = function() {\n            this._sphere || (this._sphere = Nn.a.CreateSphere(\"radialExplosionEventSphere\", this._options.sphere, this._scene), this._sphere.isVisible = !1);\n          }, r.prototype._intersectsWithSphere = function(t, e, n) {\n            var i = t.object;\n            return this._prepareSphere(), this._sphere.position = e, this._sphere.scaling = new u.e(2 * n, 2 * n, 2 * n), this._sphere._updateBoundingInfo(), this._sphere.computeWorldMatrix(!0), this._sphere.intersectsMesh(i, !0);\n          }, r;\n        }(), Em = function() {\n          function r(t, e, n, i) {\n            this._physicsHelper = t, this._scene = e, this._origin = n, this._options = i, this._dataFetched = !1, this._options = Object(c.a)(Object(c.a)({}, new Mr()), this._options), this._tickCallback = this._tick.bind(this), this._options.strength = -1 * this._options.strength;\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { sphere: this._sphere };\n          }, r.prototype.enable = function() {\n            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);\n          }, r.prototype.disable = function() {\n            this._scene.unregisterBeforeRender(this._tickCallback);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), t ? this._sphere.dispose() : setTimeout(function() {\n              e._dataFetched || e._sphere.dispose();\n            }, 0);\n          }, r.prototype._tick = function() {\n            if (this._sphere)\n              this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);\n            else {\n              var t = this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);\n              t && (this._sphere = t.getData().sphere.clone(\"radialExplosionEventSphereClone\"));\n            }\n          }, r;\n        }(), Sm = function() {\n          function r(t, e, n) {\n            this._scene = t, this._origin = e, this._options = n, this._originTop = u.e.Zero(), this._originDirection = u.e.Zero(), this._cylinderPosition = u.e.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = Object(c.a)(Object(c.a)({}, new Tc()), this._options), this._origin.addToRef(new u.e(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new u.e(0, this._options.height, 0), this._originTop), this._options.updraftMode === Or.Perpendicular && (this._originDirection = this._origin.subtract(this._originTop).normalize()), this._tickCallback = this._tick.bind(this), this._prepareCylinder();\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { cylinder: this._cylinder };\n          }, r.prototype.enable = function() {\n            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);\n          }, r.prototype.disable = function() {\n            this._scene.unregisterBeforeRender(this._tickCallback);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), this._cylinder && (t ? this._cylinder.dispose() : setTimeout(function() {\n              e._dataFetched || e._cylinder.dispose();\n            }, 0));\n          }, r.prototype.getImpostorHitData = function(t) {\n            if (t.mass === 0 || !this._intersectsWithCylinder(t))\n              return null;\n            var e = t.getObjectCenter();\n            if (this._options.updraftMode === Or.Perpendicular)\n              var n = this._originDirection;\n            else\n              n = e.subtract(this._originTop);\n            var i = u.e.Distance(this._origin, e), o = -1 * this._options.strength;\n            return { force: n.multiplyByFloats(o, o, o), contactPoint: e, distanceFromOrigin: i };\n          }, r.prototype._tick = function() {\n            var t = this;\n            this._physicsEngine.getImpostors().forEach(function(e) {\n              var n = t.getImpostorHitData(e);\n              n && e.applyForce(n.force, n.contactPoint);\n            });\n          }, r.prototype._prepareCylinder = function() {\n            this._cylinder || (this._cylinder = ci.a.CreateCylinder(\"updraftEventCylinder\", { height: this._options.height, diameter: 2 * this._options.radius }, this._scene), this._cylinder.isVisible = !1);\n          }, r.prototype._intersectsWithCylinder = function(t) {\n            var e = t.object;\n            return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(e, !0);\n          }, r;\n        }(), Am = function() {\n          function r(t, e, n) {\n            this._scene = t, this._origin = e, this._options = n, this._originTop = u.e.Zero(), this._cylinderPosition = u.e.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = Object(c.a)(Object(c.a)({}, new Ec()), this._options), this._origin.addToRef(new u.e(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new u.e(0, this._options.height, 0), this._originTop), this._tickCallback = this._tick.bind(this), this._prepareCylinder();\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { cylinder: this._cylinder };\n          }, r.prototype.enable = function() {\n            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);\n          }, r.prototype.disable = function() {\n            this._scene.unregisterBeforeRender(this._tickCallback);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), t ? this._cylinder.dispose() : setTimeout(function() {\n              e._dataFetched || e._cylinder.dispose();\n            }, 0);\n          }, r.prototype.getImpostorHitData = function(t) {\n            if (t.mass === 0 || !this._intersectsWithCylinder(t) || t.object.getClassName() !== \"Mesh\" && t.object.getClassName() !== \"InstancedMesh\")\n              return null;\n            var e = t.getObjectCenter(), n = new u.e(this._origin.x, e.y, this._origin.z), i = e.subtract(n), o = new dn.a(n, i, this._options.radius).intersectsMesh(t.object), a = o.pickedPoint;\n            if (!a)\n              return null;\n            var s = o.distance / this._options.radius, d = a.normalize();\n            if (s > this._options.centripetalForceThreshold && (d = d.negate()), s > this._options.centripetalForceThreshold)\n              var p = d.x * this._options.centripetalForceMultiplier, y = d.y * this._options.updraftForceMultiplier, P = d.z * this._options.centripetalForceMultiplier;\n            else {\n              var R = u.e.Cross(n, e).normalize();\n              p = (R.x + d.x) * this._options.centrifugalForceMultiplier, y = this._originTop.y * this._options.updraftForceMultiplier, P = (R.z + d.z) * this._options.centrifugalForceMultiplier;\n            }\n            var B = new u.e(p, y, P);\n            return { force: B = B.multiplyByFloats(this._options.strength, this._options.strength, this._options.strength), contactPoint: e, distanceFromOrigin: s };\n          }, r.prototype._tick = function() {\n            var t = this;\n            this._physicsEngine.getImpostors().forEach(function(e) {\n              var n = t.getImpostorHitData(e);\n              n && e.applyForce(n.force, n.contactPoint);\n            });\n          }, r.prototype._prepareCylinder = function() {\n            this._cylinder || (this._cylinder = ci.a.CreateCylinder(\"vortexEventCylinder\", { height: this._options.height, diameter: 2 * this._options.radius }, this._scene), this._cylinder.isVisible = !1);\n          }, r.prototype._intersectsWithCylinder = function(t) {\n            var e = t.object;\n            return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(e, !0);\n          }, r;\n        }(), Mr = function() {\n          this.radius = 5, this.strength = 10, this.falloff = go.Constant, this.sphere = { segments: 32, diameter: 1 };\n        }, Tc = function() {\n          this.radius = 5, this.strength = 10, this.height = 10, this.updraftMode = Or.Center;\n        }, Ec = function() {\n          this.radius = 5, this.strength = 10, this.height = 10, this.centripetalForceThreshold = 0.7, this.centripetalForceMultiplier = 5, this.centrifugalForceMultiplier = 0.5, this.updraftForceMultiplier = 0.02;\n        };\n        (function(r) {\n          r[r.Constant = 0] = \"Constant\", r[r.Linear = 1] = \"Linear\";\n        })(go || (go = {})), function(r) {\n          r[r.Center = 0] = \"Center\", r[r.Perpendicular = 1] = \"Perpendicular\";\n        }(Or || (Or = {}));\n        var Pm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void)\n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11));\nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}`;\n        ze.a.ShadersStore.blackAndWhitePixelShader = Pm;\n        var fd = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, \"blackAndWhite\", [\"degree\"], null, n, i, o, a, s) || this;\n            return d.degree = 1, d.onApplyObservable.add(function(p) {\n              p.setFloat(\"degree\", d.degree);\n            }), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"BlackAndWhitePostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"degree\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.BlackAndWhitePostProcess\"] = fd;\n        var xt = function() {\n          function r(t, e, n, i) {\n            this._name = e, this._singleInstance = i || !0, this._getPostProcesses = n, this._cameras = {}, this._indicesForCamera = {}, this._postProcesses = {};\n          }\n          return Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            for (var t in this._postProcesses)\n              if (this._postProcesses.hasOwnProperty(t)) {\n                for (var e = this._postProcesses[t], n = 0; n < e.length; n++)\n                  if (!e[n].isSupported)\n                    return !1;\n              }\n            return !0;\n          }, enumerable: !1, configurable: !0 }), r.prototype._update = function() {\n          }, r.prototype._attachCameras = function(t) {\n            var e, n = this, i = Xe.b.MakeArray(t || this._cameras);\n            if (i)\n              for (var o = 0; o < i.length; o++) {\n                var a = i[o];\n                if (a) {\n                  var s = a.name;\n                  if (e = this._singleInstance ? 0 : s, !this._postProcesses[e]) {\n                    var d = this._getPostProcesses();\n                    d && (this._postProcesses[e] = Array.isArray(d) ? d : [d]);\n                  }\n                  this._indicesForCamera[s] || (this._indicesForCamera[s] = []), this._postProcesses[e].forEach(function(p) {\n                    var y = a.attachPostProcess(p);\n                    n._indicesForCamera[s].push(y);\n                  }), this._cameras[s] || (this._cameras[s] = a);\n                }\n              }\n          }, r.prototype._detachCameras = function(t) {\n            var e = Xe.b.MakeArray(t || this._cameras);\n            if (e)\n              for (var n = 0; n < e.length; n++) {\n                var i = e[n], o = i.name, a = this._postProcesses[this._singleInstance ? 0 : o];\n                a && a.forEach(function(s) {\n                  i.detachPostProcess(s);\n                }), this._cameras[o] && (this._cameras[o] = null);\n              }\n          }, r.prototype._enable = function(t) {\n            var e = this, n = Xe.b.MakeArray(t || this._cameras);\n            if (n)\n              for (var i = 0; i < n.length; i++)\n                for (var o = n[i], a = o.name, s = 0; s < this._indicesForCamera[a].length; s++)\n                  o._postProcesses[this._indicesForCamera[a][s]] !== void 0 && o._postProcesses[this._indicesForCamera[a][s]] !== null || this._postProcesses[this._singleInstance ? 0 : a].forEach(function(d) {\n                    n[i].attachPostProcess(d, e._indicesForCamera[a][s]);\n                  });\n          }, r.prototype._disable = function(t) {\n            var e = Xe.b.MakeArray(t || this._cameras);\n            if (e)\n              for (var n = 0; n < e.length; n++) {\n                var i = e[n], o = i.name;\n                this._postProcesses[this._singleInstance ? 0 : o].forEach(function(a) {\n                  i.detachPostProcess(a);\n                });\n              }\n          }, r.prototype.getPostProcesses = function(t) {\n            return this._singleInstance ? this._postProcesses[0] : t ? this._postProcesses[t.name] : null;\n          }, r;\n        }(), xm = `#include<helperFunctions>\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float threshold;\nuniform float exposure;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nfloat luma=getLuminance(gl_FragColor.rgb*exposure);\ngl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;\n}`;\n        ze.a.ShadersStore.extractHighlightsPixelShader = xm;\n        var Sc = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"extractHighlights\", [\"threshold\", \"exposure\"], null, n, i, o, a, s, null, d, void 0, null, p) || this;\n            return y.threshold = 0.9, y._exposure = 1, y._inputPostProcess = null, y.onApplyObservable.add(function(P) {\n              y._inputPostProcess && P.setTextureFromPostProcess(\"textureSampler\", y._inputPostProcess), P.setFloat(\"threshold\", Math.pow(y.threshold, Vt.b)), P.setFloat(\"exposure\", y._exposure);\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ExtractHighlightsPostProcess\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"threshold\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ExtractHighlightsPostProcess\"] = Sc;\n        var Cm = `uniform sampler2D textureSampler;\nuniform sampler2D bloomBlur;\nvarying vec2 vUV;\nuniform float bloomWeight;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec3 blurred=texture2D(bloomBlur,vUV).rgb;\ngl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight);\n}\n`;\n        ze.a.ShadersStore.bloomMergePixelShader = Cm;\n        var Ac = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R) {\n            P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT), R === void 0 && (R = !1);\n            var B = r.call(this, e, \"bloomMerge\", [\"bloomWeight\"], [\"circleOfConfusionSampler\", \"blurStep0\", \"blurStep1\", \"blurStep2\", \"bloomBlur\"], a, s, d, p, y, null, P, void 0, null, !0) || this;\n            return B.weight = 1, B.weight = o, B.onApplyObservable.add(function(F) {\n              F.setTextureFromPostProcess(\"textureSampler\", n), F.setTextureFromPostProcessOutput(\"bloomBlur\", i), F.setFloat(\"bloomWeight\", B.weight);\n            }), R || B.updateEffect(), B;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"BloomMergePostProcess\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"weight\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.BloomMergePostProcess\"] = Ac;\n        var Pc = function(r) {\n          function t(e, n, i, o, a, s) {\n            a === void 0 && (a = 0), s === void 0 && (s = !1);\n            var d = r.call(this, e.getEngine(), \"bloom\", function() {\n              return d._effects;\n            }, !0) || this;\n            return d.bloomScale = n, d._effects = [], d._downscale = new Sc(\"highlights\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, s), d._blurX = new _n(\"horizontal blur\", new u.d(1, 0), 10, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, void 0, s), d._blurX.alwaysForcePOT = !0, d._blurX.autoClear = !1, d._blurY = new _n(\"vertical blur\", new u.d(0, 1), 10, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, void 0, s), d._blurY.alwaysForcePOT = !0, d._blurY.autoClear = !1, d.kernel = o, d._effects = [d._downscale, d._blurX, d._blurY], d._merge = new Ac(\"bloomMerge\", d._downscale, d._blurY, i, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, s), d._merge.autoClear = !1, d._effects.push(d._merge), d;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"threshold\", { get: function() {\n            return this._downscale.threshold;\n          }, set: function(e) {\n            this._downscale.threshold = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"weight\", { get: function() {\n            return this._merge.weight;\n          }, set: function(e) {\n            this._merge.weight = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"kernel\", { get: function() {\n            return this._blurX.kernel / this.bloomScale;\n          }, set: function(e) {\n            this._blurX.kernel = e * this.bloomScale, this._blurY.kernel = e * this.bloomScale;\n          }, enumerable: !1, configurable: !0 }), t.prototype.disposeEffects = function(e) {\n            for (var n = 0; n < this._effects.length; n++)\n              this._effects[n].dispose(e);\n          }, t.prototype._updateEffects = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              this._effects[e].updateEffect();\n          }, t.prototype._isReady = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              if (!this._effects[e].isReady())\n                return !1;\n            return !0;\n          }, t;\n        }(xt), Rm = `\nuniform sampler2D textureSampler;\n\nuniform float chromatic_aberration;\nuniform float radialIntensity;\nuniform vec2 direction;\nuniform vec2 centerPosition;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\nvoid main(void)\n{\nvec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);\nvec2 directionOfEffect=direction;\nif(directionOfEffect.x == 0. && directionOfEffect.y == 0.){\ndirectionOfEffect=normalize(centered_screen_pos);\n}\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+centered_screen_pos.y*centered_screen_pos.y;\nfloat radius=sqrt(radius2);\nvec4 original=texture2D(textureSampler,vUV);\n\nvec3 ref_indices=vec3(-0.3,0.0,0.3);\nfloat ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;\nfloat ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;\n\nvec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);\nvec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);\nvec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);\noriginal.r=texture2D(textureSampler,ref_coords_r).r;\noriginal.g=texture2D(textureSampler,ref_coords_g).g;\noriginal.b=texture2D(textureSampler,ref_coords_b).b;\noriginal.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);\ngl_FragColor=original;\n}`;\n        ze.a.ShadersStore.chromaticAberrationPixelShader = Rm;\n        var xc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT), P === void 0 && (P = !1);\n            var R = r.call(this, e, \"chromaticAberration\", [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"], [], o, a, s, d, p, null, y, void 0, null, P) || this;\n            return R.aberrationAmount = 30, R.radialIntensity = 0, R.direction = new u.d(0.707, 0.707), R.centerPosition = new u.d(0.5, 0.5), R.screenWidth = n, R.screenHeight = i, R.onApplyObservable.add(function(B) {\n              B.setFloat(\"chromatic_aberration\", R.aberrationAmount), B.setFloat(\"screen_width\", n), B.setFloat(\"screen_height\", i), B.setFloat(\"radialIntensity\", R.radialIntensity), B.setFloat2(\"direction\", R.direction.x, R.direction.y), B.setFloat2(\"centerPosition\", R.centerPosition.x, R.centerPosition.y);\n            }), R;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ChromaticAberrationPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.screenWidth, e.screenHeight, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType, !1);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"aberrationAmount\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radialIntensity\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"direction\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"centerPosition\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"screenWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"screenHeight\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ChromaticAberrationPostProcess\"] = xc;\n        var Om = `\nuniform sampler2D depthSampler;\n\nvarying vec2 vUV;\n\nuniform vec2 cameraMinMaxZ;\n\nuniform float focusDistance;\nuniform float cocPrecalculation;\nvoid main(void)\n{\nfloat depth=texture2D(depthSampler,vUV).r;\nfloat pixelDistance=(cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth)*1000.0;\nfloat coc=abs(cocPrecalculation* ((focusDistance-pixelDistance)/pixelDistance));\ncoc=clamp(coc,0.0,1.0);\ngl_FragColor=vec4(coc,depth,coc,1.0);\n}\n`;\n        ze.a.ShadersStore.circleOfConfusionPixelShader = Om;\n        var Cc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1);\n            var P = r.call(this, e, \"circleOfConfusion\", [\"cameraMinMaxZ\", \"focusDistance\", \"cocPrecalculation\"], [\"depthSampler\"], i, o, a, s, d, null, p, void 0, null, y) || this;\n            return P.lensSize = 50, P.fStop = 1.4, P.focusDistance = 2e3, P.focalLength = 50, P._depthTexture = null, P._depthTexture = n, P.onApplyObservable.add(function(R) {\n              if (P._depthTexture) {\n                R.setTexture(\"depthSampler\", P._depthTexture);\n                var B = P.lensSize / P.fStop * P.focalLength / (P.focusDistance - P.focalLength);\n                R.setFloat(\"focusDistance\", P.focusDistance), R.setFloat(\"cocPrecalculation\", B), R.setFloat2(\"cameraMinMaxZ\", P._depthTexture.activeCamera.minZ, P._depthTexture.activeCamera.maxZ);\n              } else\n                l.a.Warn(\"No depth texture set on CircleOfConfusionPostProcess\");\n            }), P;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"CircleOfConfusionPostProcess\";\n          }, Object.defineProperty(t.prototype, \"depthTexture\", { set: function(e) {\n            this._depthTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object(c.c)([Object(L.c)()], t.prototype, \"lensSize\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"fStop\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"focusDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"focalLength\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.CircleOfConfusionPostProcess\"] = Cc;\n        var Mm = `\nuniform sampler2D textureSampler;\nuniform sampler2D colorTable;\n\nvarying vec2 vUV;\n\nconst float SLICE_COUNT=16.0;\n\nvec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {\nfloat sliceSize=1.0/width;\nfloat slicePixelSize=sliceSize/width;\nfloat sliceInnerSize=slicePixelSize*(width-1.0);\nfloat zSlice0=min(floor(uv.z*width),width-1.0);\nfloat zSlice1=min(zSlice0+1.0,width-1.0);\nfloat xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;\nfloat s0=xOffset+(zSlice0*sliceSize);\nfloat s1=xOffset+(zSlice1*sliceSize);\nvec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));\nvec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));\nfloat zOffset=mod(uv.z*width,1.0);\nvec4 result=mix(slice0Color,slice1Color,zOffset);\nreturn result;\n}\nvoid main(void)\n{\nvec4 screen_color=texture2D(textureSampler,vUV);\ngl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);\n}`;\n        ze.a.ShadersStore.colorCorrectionPixelShader = Mm;\n        var pd = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, \"colorCorrection\", null, [\"colorTable\"], i, o, a, s, d) || this;\n            return p._colorTableTexture = new Ne.a(n, o.getScene(), !0, !1, Ne.a.TRILINEAR_SAMPLINGMODE), p._colorTableTexture.anisotropicFilteringLevel = 1, p._colorTableTexture.wrapU = Ne.a.CLAMP_ADDRESSMODE, p._colorTableTexture.wrapV = Ne.a.CLAMP_ADDRESSMODE, p.colorTableUrl = n, p.onApply = function(y) {\n              y.setTexture(\"colorTable\", p._colorTableTexture);\n            }, p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ColorCorrectionPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.colorTableUrl, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"colorTableUrl\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ColorCorrectionPostProcess\"] = pd;\n        var Im = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform float kernel[9];\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];\nfloat kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];\nif (kernelWeight<=0.0) {\nkernelWeight=1.0;\n}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);\n}`;\n        ze.a.ShadersStore.convolutionPixelShader = Im;\n        var _d = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, e, \"convolution\", [\"kernel\", \"screenSize\"], null, i, o, a, s, d, null, p) || this;\n            return y.kernel = n, y.onApply = function(P) {\n              P.setFloat2(\"screenSize\", y.width, y.height), P.setArray(\"kernel\", y.kernel);\n            }, y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ConvolutionPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.kernel, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType);\n            }, e, i, o);\n          }, t.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1], t.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0], t.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1], t.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0], t.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2], t.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0], Object(c.c)([Object(L.c)()], t.prototype, \"kernel\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ConvolutionPostProcess\"] = _d;\n        var pa = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R, B, F) {\n            p === void 0 && (p = null), y === void 0 && (y = Ne.a.BILINEAR_SAMPLINGMODE), B === void 0 && (B = h.a.TEXTURETYPE_UNSIGNED_INT), F === void 0 && (F = !1);\n            var z = r.call(this, e, i, o, a, s, y = h.a.TEXTURE_BILINEAR_SAMPLINGMODE, P, R, B = h.a.TEXTURETYPE_UNSIGNED_INT, `#define DOF 1\\r\n`, F) || this;\n            return z.direction = i, z.onApplyObservable.add(function(J) {\n              p != null && J.setTextureFromPostProcess(\"textureSampler\", p), J.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", d), n.activeCamera && J.setFloat2(\"cameraMinMaxZ\", n.activeCamera.minZ, n.activeCamera.maxZ);\n            }), z;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DepthOfFieldBlurPostProcess\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"direction\", void 0), t;\n        }(_n);\n        O.a.RegisteredTypes[\"BABYLON.DepthOfFieldBlurPostProcess\"] = pa;\n        var Dm = `uniform sampler2D textureSampler;\nvarying vec2 vUV;\nuniform sampler2D circleOfConfusionSampler;\nuniform sampler2D blurStep0;\n#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\n#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\n#endif\nvoid main(void)\n{\nfloat coc=texture2D(circleOfConfusionSampler,vUV).r;\n#if BLUR_LEVEL == 0\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred0=texture2D(blurStep0,vUV);\ngl_FragColor=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL == 1\nif(coc<0.5){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(original,blurred1,coc/0.5);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);\n}\n#endif\n#if BLUR_LEVEL == 2\nif(coc<0.33){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(original,blurred2,coc/0.33);\n}else if(coc<0.66){\nvec4 blurred1=texture2D(blurStep1,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);\n}\n#endif\n}\n`;\n        ze.a.ShadersStore.depthOfFieldMergePixelShader = Dm;\n        var Ji, Lm = function() {\n        }, md = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R) {\n            P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT), R === void 0 && (R = !1);\n            var B = r.call(this, e, \"depthOfFieldMerge\", [], [\"circleOfConfusionSampler\", \"blurStep0\", \"blurStep1\", \"blurStep2\"], a, s, d, p, y, null, P, void 0, null, !0) || this;\n            return B.blurSteps = o, B.onApplyObservable.add(function(F) {\n              F.setTextureFromPostProcess(\"textureSampler\", n), F.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", i), o.forEach(function(z, J) {\n                F.setTextureFromPostProcessOutput(\"blurStep\" + (o.length - J - 1), z);\n              });\n            }), R || B.updateEffect(), B;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DepthOfFieldMergePostProcess\";\n          }, t.prototype.updateEffect = function(e, n, i, o, a, s) {\n            e === void 0 && (e = null), n === void 0 && (n = null), i === void 0 && (i = null), e || (e = \"\", e += \"#define BLUR_LEVEL \" + (this.blurSteps.length - 1) + `\n`), r.prototype.updateEffect.call(this, e, n, i, o, a, s);\n          }, t;\n        }(ft);\n        (function(r) {\n          r[r.Low = 0] = \"Low\", r[r.Medium = 1] = \"Medium\", r[r.High = 2] = \"High\";\n        })(Ji || (Ji = {}));\n        var Rc = function(r) {\n          function t(e, n, i, o, a) {\n            i === void 0 && (i = Ji.Low), o === void 0 && (o = 0), a === void 0 && (a = !1);\n            var s = r.call(this, e.getEngine(), \"depth of field\", function() {\n              return s._effects;\n            }, !0) || this;\n            s._effects = [], s._circleOfConfusion = new Cc(\"circleOfConfusion\", n, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a), s._depthOfFieldBlurY = [], s._depthOfFieldBlurX = [];\n            var d = 1, p = 15;\n            switch (i) {\n              case Ji.High:\n                d = 3, p = 51;\n                break;\n              case Ji.Medium:\n                d = 2, p = 31;\n                break;\n              default:\n                p = 15, d = 1;\n            }\n            for (var y = p / Math.pow(2, d - 1), P = 1, R = 0; R < d; R++) {\n              var B = new pa(\"verticle blur\", e, new u.d(0, 1), y, P, null, s._circleOfConfusion, R == 0 ? s._circleOfConfusion : null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a);\n              B.autoClear = !1, P = 0.75 / Math.pow(2, R);\n              var F = new pa(\"horizontal blur\", e, new u.d(1, 0), y, P, null, s._circleOfConfusion, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a);\n              F.autoClear = !1, s._depthOfFieldBlurY.push(B), s._depthOfFieldBlurX.push(F);\n            }\n            for (s._effects = [s._circleOfConfusion], R = 0; R < s._depthOfFieldBlurX.length; R++)\n              s._effects.push(s._depthOfFieldBlurY[R]), s._effects.push(s._depthOfFieldBlurX[R]);\n            return s._dofMerge = new md(\"dofMerge\", s._circleOfConfusion, s._circleOfConfusion, s._depthOfFieldBlurX, P, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a), s._dofMerge.autoClear = !1, s._effects.push(s._dofMerge), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"focalLength\", { get: function() {\n            return this._circleOfConfusion.focalLength;\n          }, set: function(e) {\n            this._circleOfConfusion.focalLength = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fStop\", { get: function() {\n            return this._circleOfConfusion.fStop;\n          }, set: function(e) {\n            this._circleOfConfusion.fStop = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"focusDistance\", { get: function() {\n            return this._circleOfConfusion.focusDistance;\n          }, set: function(e) {\n            this._circleOfConfusion.focusDistance = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"lensSize\", { get: function() {\n            return this._circleOfConfusion.lensSize;\n          }, set: function(e) {\n            this._circleOfConfusion.lensSize = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"DepthOfFieldEffect\";\n          }, Object.defineProperty(t.prototype, \"depthTexture\", { set: function(e) {\n            this._circleOfConfusion.depthTexture = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.disposeEffects = function(e) {\n            for (var n = 0; n < this._effects.length; n++)\n              this._effects[n].dispose(e);\n          }, t.prototype._updateEffects = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              this._effects[e].updateEffect();\n          }, t.prototype._isReady = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              if (!this._effects[e].isReady())\n                return !1;\n            return !0;\n          }, t;\n        }(xt), Nm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D passSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(passSampler,vUV);\n}`;\n        ze.a.ShadersStore.displayPassPixelShader = Nm;\n        var gd = function(r) {\n          function t(e, n, i, o, a, s) {\n            return r.call(this, e, \"displayPass\", [\"passSampler\"], [\"passSampler\"], n, i, o, a, s) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DisplayPassPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.DisplayPassPostProcess\"] = gd;\n        var wm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform mat4 kernelMatrix;\nvoid main(void)\n{\nvec3 baseColor=texture2D(textureSampler,vUV).rgb;\nvec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;\ngl_FragColor=vec4(updatedColor,1.0);\n}`;\n        ze.a.ShadersStore.filterPixelShader = wm;\n        var vd = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, \"filter\", [\"kernelMatrix\"], null, i, o, a, s, d) || this;\n            return p.kernelMatrix = n, p.onApply = function(y) {\n              y.setMatrix(\"kernelMatrix\", p.kernelMatrix);\n            }, p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FilterPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.kernelMatrix, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.j)()], t.prototype, \"kernelMatrix\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.FilterPostProcess\"] = vd;\n        var Fm = `uniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst float fxaaQualitySubpix=1.0;\nconst float fxaaQualityEdgeThreshold=0.166;\nconst float fxaaQualityEdgeThresholdMin=0.0833;\nconst vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){\nvec2 posM;\nposM.x=vUV.x;\nposM.y=vUV.y;\nvec4 rgbyM=texture2D(textureSampler,vUV,0.0);\nfloat lumaM=FxaaLuma(rgbyM);\nfloat lumaS=FxaaLuma(texture2D(textureSampler,sampleCoordS,0.0));\nfloat lumaE=FxaaLuma(texture2D(textureSampler,sampleCoordE,0.0));\nfloat lumaN=FxaaLuma(texture2D(textureSampler,sampleCoordN,0.0));\nfloat lumaW=FxaaLuma(texture2D(textureSampler,sampleCoordW,0.0));\nfloat maxSM=max(lumaS,lumaM);\nfloat minSM=min(lumaS,lumaM);\nfloat maxESM=max(lumaE,maxSM);\nfloat minESM=min(lumaE,minSM);\nfloat maxWN=max(lumaN,lumaW);\nfloat minWN=min(lumaN,lumaW);\nfloat rangeMax=max(maxWN,maxESM);\nfloat rangeMin=min(minWN,minESM);\nfloat rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;\nfloat range=rangeMax-rangeMin;\nfloat rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\nreturn;\n}\n#endif\nfloat lumaNW=FxaaLuma(texture2D(textureSampler,sampleCoordNW,0.0));\nfloat lumaSE=FxaaLuma(texture2D(textureSampler,sampleCoordSE,0.0));\nfloat lumaNE=FxaaLuma(texture2D(textureSampler,sampleCoordNE,0.0));\nfloat lumaSW=FxaaLuma(texture2D(textureSampler,sampleCoordSW,0.0));\nfloat lumaNS=lumaN+lumaS;\nfloat lumaWE=lumaW+lumaE;\nfloat subpixRcpRange=1.0/range;\nfloat subpixNSWE=lumaNS+lumaWE;\nfloat edgeHorz1=(-2.0*lumaM)+lumaNS;\nfloat edgeVert1=(-2.0*lumaM)+lumaWE;\nfloat lumaNESE=lumaNE+lumaSE;\nfloat lumaNWNE=lumaNW+lumaNE;\nfloat edgeHorz2=(-2.0*lumaE)+lumaNESE;\nfloat edgeVert2=(-2.0*lumaN)+lumaNWNE;\nfloat lumaNWSW=lumaNW+lumaSW;\nfloat lumaSWSE=lumaSW+lumaSE;\nfloat edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);\nfloat edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);\nfloat edgeHorz3=(-2.0*lumaW)+lumaNWSW;\nfloat edgeVert3=(-2.0*lumaS)+lumaSWSE;\nfloat edgeHorz=abs(edgeHorz3)+edgeHorz4;\nfloat edgeVert=abs(edgeVert3)+edgeVert4;\nfloat subpixNWSWNESE=lumaNWSW+lumaNESE;\nfloat lengthSign=texelSize.x;\nbool horzSpan=edgeHorz>=edgeVert;\nfloat subpixA=subpixNSWE*2.0+subpixNWSWNESE;\nif (!horzSpan)\n{\nlumaN=lumaW;\n}\nif (!horzSpan)\n{\nlumaS=lumaE;\n}\nif (horzSpan)\n{\nlengthSign=texelSize.y;\n}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;\nfloat gradientN=lumaN-lumaM;\nfloat gradientS=lumaS-lumaM;\nfloat lumaNN=lumaN+lumaM;\nfloat lumaSS=lumaS+lumaM;\nbool pairN=abs(gradientN)>=abs(gradientS);\nfloat gradient=max(abs(gradientN),abs(gradientS));\nif (pairN)\n{\nlengthSign=-lengthSign;\n}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);\nvec2 posB;\nposB.x=posM.x;\nposB.y=posM.y;\nvec2 offNP;\noffNP.x=(!horzSpan) ? 0.0 : texelSize.x;\noffNP.y=(horzSpan) ? 0.0 : texelSize.y;\nif (!horzSpan)\n{\nposB.x+=lengthSign*0.5;\n}\nif (horzSpan)\n{\nposB.y+=lengthSign*0.5;\n}\nvec2 posN;\nposN.x=posB.x-offNP.x*1.5;\nposN.y=posB.y-offNP.y*1.5;\nvec2 posP;\nposP.x=posB.x+offNP.x*1.5;\nposP.y=posB.y+offNP.y*1.5;\nfloat subpixD=((-2.0)*subpixC)+3.0;\nfloat lumaEndN=FxaaLuma(texture2D(textureSampler,posN,0.0));\nfloat subpixE=subpixC*subpixC;\nfloat lumaEndP=FxaaLuma(texture2D(textureSampler,posP,0.0));\nif (!pairN)\n{\nlumaNN=lumaSS;\n}\nfloat gradientScaled=gradient*1.0/4.0;\nfloat lumaMM=lumaM-lumaNN*0.5;\nfloat subpixF=subpixD*subpixE;\nbool lumaMLTZero=lumaMM<0.0;\nlumaEndN-=lumaNN*0.5;\nlumaEndP-=lumaNN*0.5;\nbool doneN=abs(lumaEndN)>=gradientScaled;\nbool doneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN)\n{\nposN.x-=offNP.x*3.0;\n}\nif (!doneN)\n{\nposN.y-=offNP.y*3.0;\n}\nbool doneNP=(!doneN) || (!doneP);\nif (!doneP)\n{\nposP.x+=offNP.x*3.0;\n}\nif (!doneP)\n{\nposP.y+=offNP.y*3.0;\n}\nif (doneNP)\n{\nif (!doneN) lumaEndN=FxaaLuma(texture2D(textureSampler,posN.xy,0.0));\nif (!doneP) lumaEndP=FxaaLuma(texture2D(textureSampler,posP.xy,0.0));\nif (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;\nif (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;\ndoneN=abs(lumaEndN)>=gradientScaled;\ndoneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) posN.x-=offNP.x*12.0;\nif (!doneN) posN.y-=offNP.y*12.0;\ndoneNP=(!doneN) || (!doneP);\nif (!doneP) posP.x+=offNP.x*12.0;\nif (!doneP) posP.y+=offNP.y*12.0;\n}\nfloat dstN=posM.x-posN.x;\nfloat dstP=posP.x-posM.x;\nif (!horzSpan)\n{\ndstN=posM.y-posN.y;\n}\nif (!horzSpan)\n{\ndstP=posP.y-posM.y;\n}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;\nfloat spanLength=(dstP+dstN);\nbool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;\nfloat spanLengthRcp=1.0/spanLength;\nbool directionN=dstN<dstP;\nfloat dst=min(dstN,dstP);\nbool goodSpan=directionN ? goodSpanN : goodSpanP;\nfloat subpixG=subpixF*subpixF;\nfloat pixelOffset=(dst*(-spanLengthRcp))+0.5;\nfloat subpixH=subpixG*fxaaQualitySubpix;\nfloat pixelOffsetGood=goodSpan ? pixelOffset : 0.0;\nfloat pixelOffsetSubpix=max(pixelOffsetGood,subpixH);\nif (!horzSpan)\n{\nposM.x+=pixelOffsetSubpix*lengthSign;\n}\nif (horzSpan)\n{\nposM.y+=pixelOffsetSubpix*lengthSign;\n}\n#ifdef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\n}\nelse\n{\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n}\n#else\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n#endif\n}`;\n        ze.a.ShadersStore.fxaaPixelShader = Fm;\n        var Bm = `\nattribute vec2 position;\nuniform vec2 texelSize;\n\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd);\nsampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;\nsampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;\nsampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;\nsampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;\nsampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;\nsampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;\nsampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;\nsampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.fxaaVertexShader = Bm;\n        var vo = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var p = r.call(this, e, \"fxaa\", [\"texelSize\"], null, n, i, o || Ne.a.BILINEAR_SAMPLINGMODE, a, s, null, d, \"fxaa\", void 0, !0) || this, y = p._getDefines();\n            return p.updateEffect(y), p.onApplyObservable.add(function(P) {\n              var R = p.texelSize;\n              P.setFloat2(\"texelSize\", R.x, R.y);\n            }), p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FxaaPostProcess\";\n          }, t.prototype._getDefines = function() {\n            var e = this.getEngine();\n            if (!e)\n              return null;\n            var n = e.getGlInfo();\n            return n && n.renderer && n.renderer.toLowerCase().indexOf(\"mali\") > -1 ? `#define MALI 1\n` : null;\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.FxaaPostProcess\"] = vo;\n        var Um = `#include<helperFunctions>\n\nuniform sampler2D textureSampler;\n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}`;\n        ze.a.ShadersStore.grainPixelShader = Um;\n        var Oc = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"grain\", [\"intensity\", \"animatedSeed\"], [], n, i, o, a, s, null, d, void 0, null, p) || this;\n            return y.intensity = 30, y.animated = !1, y.onApplyObservable.add(function(P) {\n              P.setFloat(\"intensity\", y.intensity), P.setFloat(\"animatedSeed\", y.animated ? Math.random() + 1 : 1);\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"GrainPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"intensity\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"animated\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.GrainPostProcess\"] = Oc;\n        var Vm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void)\n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a);\n}`;\n        ze.a.ShadersStore.highlightsPixelShader = Vm;\n        var km = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            return d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), r.call(this, e, \"highlights\", null, null, n, i, o, a, s, null, d) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"HighlightsPostProcess\";\n          }, t;\n        }(ft);\n        ze.a.IncludesShadersStore.mrtFragmentDeclaration = `#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n`;\n        var Gm = `#extension GL_EXT_draw_buffers : require\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\nprecision highp float;\nprecision highp int;\n#ifdef BUMP\nvarying mat4 vWorldView;\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef NEED_UV\nvarying vec2 vUV;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef REFLECTIVITY\nvarying vec2 vReflectivityUV;\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef ALPHATEST\nuniform sampler2D diffuseSampler;\n#endif\n#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nvec3 normalOutput;\n#ifdef BUMP\nvec3 normalW=normalize(vNormalW);\n#include<bumpFragment>\nnormalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));\n#else\nnormalOutput=normalize(vNormalV);\n#endif\n#ifdef PREPASS\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[DEPTHNORMAL_INDEX]=vec4(vViewPos.z/vViewPos.w,normalOutput);\n#endif\n#else\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\ngl_FragData[1]=vec4(normalOutput,1.0);\n#endif\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef REFLECTIVITY\n#ifdef HAS_SPECULAR\n\nvec4 reflectivity=texture2D(reflectivitySampler,vReflectivityUV);\n#elif HAS_REFLECTIVITY\n\nvec4 reflectivity=vec4(texture2D(reflectivitySampler,vReflectivityUV).rgb,1.0);\n#else\nvec4 reflectivity=vec4(0.0,0.0,0.0,1.0);\n#endif\ngl_FragData[REFLECTIVITY_INDEX]=reflectivity;\n#endif\n}`;\n        ze.a.ShadersStore.geometryPixelShader = Gm;\n        var zm = `precision highp float;\nprecision highp int;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef NEED_UV\nvarying vec2 vUV;\n#ifdef ALPHATEST\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef BUMP\nuniform mat4 bumpMatrix;\nvarying vec2 vBumpUV;\n#endif\n#ifdef REFLECTIVITY\nuniform mat4 reflectivityMatrix;\nvarying vec2 vReflectivityUV;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef BUMP\nvarying mat4 vWorldView;\n#endif\n#ifdef BUMP\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\n#ifdef BONES_VELOCITY_ENABLED\n#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if defined(VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 pos=vec4(finalWorld*vec4(positionUpdated,1.0));\n#ifdef BUMP\nvWorldView=view*finalWorld;\nvNormalW=normalUpdated;\n#else\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));\n#endif\nvViewPos=view*pos;\n#if defined(VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvPositionW=pos.xyz/pos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#ifdef NEED_UV\n#ifdef UV1\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#else\nvUV=uv;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#endif\n#ifdef UV2\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#else\nvUV=uv2;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n`;\n        ze.a.ShadersStore.geometryVertexShader = zm;\n        var ri = function() {\n          function r(t, e) {\n            e === void 0 && (e = 1), this._previousTransformationMatrices = {}, this._previousBonesTransformationMatrices = {}, this.excludedSkinnedMeshesFromVelocity = [], this.renderTransparentMeshes = !0, this._resizeObserver = null, this._enablePosition = !1, this._enableVelocity = !1, this._enableReflectivity = !1, this._positionIndex = -1, this._velocityIndex = -1, this._reflectivityIndex = -1, this._depthNormalIndex = -1, this._linkedWithPrePass = !1, this._scene = t, this._ratio = e, r._SceneComponentInitialization(this._scene), this._createRenderTargets();\n          }\n          return r.prototype._linkPrePassRenderer = function(t) {\n            this._linkedWithPrePass = !0, this._prePassRenderer = t, this._multiRenderTarget && (this._multiRenderTarget.onClearObservable.clear(), this._multiRenderTarget.onClearObservable.add(function(e) {\n            }));\n          }, r.prototype._unlinkPrePassRenderer = function() {\n            this._linkedWithPrePass = !1, this._createRenderTargets();\n          }, r.prototype._resetLayout = function() {\n            this._enablePosition = !1, this._enableReflectivity = !1, this._enableVelocity = !1, this._attachments = [];\n          }, r.prototype._forceTextureType = function(t, e) {\n            t === r.POSITION_TEXTURE_TYPE ? (this._positionIndex = e, this._enablePosition = !0) : t === r.VELOCITY_TEXTURE_TYPE ? (this._velocityIndex = e, this._enableVelocity = !0) : t === r.REFLECTIVITY_TEXTURE_TYPE ? (this._reflectivityIndex = e, this._enableReflectivity = !0) : t === r.DEPTHNORMAL_TEXTURE_TYPE && (this._depthNormalIndex = e);\n          }, r.prototype._setAttachments = function(t) {\n            this._attachments = t;\n          }, r.prototype._linkInternalTexture = function(t) {\n            this._multiRenderTarget._texture = t;\n          }, Object.defineProperty(r.prototype, \"renderList\", { get: function() {\n            return this._multiRenderTarget.renderList;\n          }, set: function(t) {\n            this._multiRenderTarget.renderList = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            return this._multiRenderTarget.isSupported;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getTextureIndex = function(t) {\n            switch (t) {\n              case r.POSITION_TEXTURE_TYPE:\n                return this._positionIndex;\n              case r.VELOCITY_TEXTURE_TYPE:\n                return this._velocityIndex;\n              case r.REFLECTIVITY_TEXTURE_TYPE:\n                return this._reflectivityIndex;\n              default:\n                return -1;\n            }\n          }, Object.defineProperty(r.prototype, \"enablePosition\", { get: function() {\n            return this._enablePosition;\n          }, set: function(t) {\n            this._enablePosition = t, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"enableVelocity\", { get: function() {\n            return this._enableVelocity;\n          }, set: function(t) {\n            this._enableVelocity = t, t || (this._previousTransformationMatrices = {}), this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"enableReflectivity\", { get: function() {\n            return this._enableReflectivity;\n          }, set: function(t) {\n            this._enableReflectivity = t, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ratio\", { get: function() {\n            return this._ratio;\n          }, enumerable: !1, configurable: !0 }), r.prototype.isReady = function(t, e) {\n            var n = t.getMaterial();\n            if (n && n.disableDepthWrite)\n              return !1;\n            var i = [], o = [Oe.b.PositionKind, Oe.b.NormalKind], a = t.getMesh();\n            if (n) {\n              var s = !1;\n              n.needAlphaTesting() && (i.push(\"#define ALPHATEST\"), s = !0), n.bumpTexture && Nt.a.BumpTextureEnabled && (i.push(\"#define BUMP\"), i.push(\"#define BUMPDIRECTUV 0\"), s = !0), this._enableReflectivity && (n instanceof Nt.a && n.specularTexture ? (i.push(\"#define HAS_SPECULAR\"), s = !0) : n instanceof $r && n.reflectivityTexture && (i.push(\"#define HAS_REFLECTIVITY\"), s = !0)), s && (i.push(\"#define NEED_UV\"), a.isVerticesDataPresent(Oe.b.UVKind) && (o.push(Oe.b.UVKind), i.push(\"#define UV1\")), a.isVerticesDataPresent(Oe.b.UV2Kind) && (o.push(Oe.b.UV2Kind), i.push(\"#define UV2\")));\n            }\n            this._linkedWithPrePass && (i.push(\"#define PREPASS\"), this._depthNormalIndex !== -1 && (i.push(\"#define DEPTHNORMAL_INDEX \" + this._depthNormalIndex), i.push(\"#define PREPASS_DEPTHNORMAL\"))), this._enablePosition && (i.push(\"#define POSITION\"), i.push(\"#define POSITION_INDEX \" + this._positionIndex)), this._enableVelocity && (i.push(\"#define VELOCITY\"), i.push(\"#define VELOCITY_INDEX \" + this._velocityIndex), this.excludedSkinnedMeshesFromVelocity.indexOf(a) === -1 && i.push(\"#define BONES_VELOCITY_ENABLED\")), this._enableReflectivity && (i.push(\"#define REFLECTIVITY\"), i.push(\"#define REFLECTIVITY_INDEX \" + this._reflectivityIndex)), a.useBones && a.computeBonesUsingShaders ? (o.push(Oe.b.MatricesIndicesKind), o.push(Oe.b.MatricesWeightsKind), a.numBoneInfluencers > 4 && (o.push(Oe.b.MatricesIndicesExtraKind), o.push(Oe.b.MatricesWeightsExtraKind)), i.push(\"#define NUM_BONE_INFLUENCERS \" + a.numBoneInfluencers), i.push(\"#define BonesPerMesh \" + (a.skeleton ? a.skeleton.bones.length + 1 : 0))) : i.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var d = a.morphTargetManager, p = 0;\n            d && d.numInfluencers > 0 && (p = d.numInfluencers, i.push(\"#define MORPHTARGETS\"), i.push(\"#define NUM_MORPH_INFLUENCERS \" + p), $e.a.PrepareAttributesForMorphTargetsInfluencers(o, a, p)), e && (i.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(o), t.getRenderingMesh().hasThinInstances && i.push(\"#define THIN_INSTANCES\")), this._linkedWithPrePass ? i.push(\"#define RENDER_TARGET_COUNT \" + this._attachments.length) : i.push(\"#define RENDER_TARGET_COUNT \" + this._multiRenderTarget.textures.length);\n            var y = i.join(`\n`);\n            return this._cachedDefines !== y && (this._cachedDefines = y, this._effect = this._scene.getEngine().createEffect(\"geometry\", o, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"view\", \"previousWorld\", \"previousViewProjection\", \"mPreviousBones\", \"morphTargetInfluences\", \"bumpMatrix\", \"reflectivityMatrix\", \"vTangentSpaceParams\", \"vBumpInfos\"], [\"diffuseSampler\", \"bumpSampler\", \"reflectivitySampler\"], y, void 0, void 0, void 0, { buffersCount: this._multiRenderTarget.textures.length - 1, maxSimultaneousMorphTargets: p })), this._effect.isReady();\n          }, r.prototype.getGBuffer = function() {\n            return this._multiRenderTarget;\n          }, Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this._multiRenderTarget.samples;\n          }, set: function(t) {\n            this._multiRenderTarget.samples = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.getGBuffer().dispose();\n          }, r.prototype._assignRenderTargetIndices = function() {\n            var t = 2;\n            return this._enablePosition && (this._positionIndex = t, t++), this._enableVelocity && (this._velocityIndex = t, t++), this._enableReflectivity && (this._reflectivityIndex = t, t++), t;\n          }, r.prototype._createRenderTargets = function() {\n            var t = this, e = this._scene.getEngine(), n = this._assignRenderTargetIndices();\n            if (this._multiRenderTarget = new Vs(\"gBuffer\", { width: e.getRenderWidth() * this._ratio, height: e.getRenderHeight() * this._ratio }, n, this._scene, { generateMipMaps: !1, generateDepthTexture: !0, defaultType: h.a.TEXTURETYPE_FLOAT }), this.isSupported) {\n              this._multiRenderTarget.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._multiRenderTarget.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._multiRenderTarget.refreshRate = 1, this._multiRenderTarget.renderParticles = !1, this._multiRenderTarget.renderList = null, this._multiRenderTarget.onClearObservable.add(function(o) {\n                o.clear(new I.b(0, 0, 0, 1), !0, !0, !0);\n              }), this._resizeObserver = e.onResizeObservable.add(function() {\n                t._multiRenderTarget && t._multiRenderTarget.resize({ width: e.getRenderWidth() * t._ratio, height: e.getRenderHeight() * t._ratio });\n              });\n              var i = function(o) {\n                var a = o.getRenderingMesh(), s = o.getEffectiveMesh(), d = t._scene, p = d.getEngine(), y = o.getMaterial();\n                if (y) {\n                  if (s._internalAbstractMeshDataInfo._isActiveIntermediate = !1, t._enableVelocity && !t._previousTransformationMatrices[s.uniqueId] && (t._previousTransformationMatrices[s.uniqueId] = { world: u.a.Identity(), viewProjection: d.getTransformMatrix() }, a.skeleton)) {\n                    var P = a.skeleton.getTransformMatrices(a);\n                    t._previousBonesTransformationMatrices[a.uniqueId] = t._copyBonesTransformationMatrices(P, new Float32Array(P.length));\n                  }\n                  var R = a._getInstancesRenderList(o._id, !!o.getReplacementMesh());\n                  if (!R.mustReturn) {\n                    var B = p.getCaps().instancedArrays && (R.visibleInstances[o._id] !== null || a.hasThinInstances), F = s.getWorldMatrix();\n                    if (t.isReady(o, B)) {\n                      if (p.enableEffect(t._effect), a._bind(o, t._effect, y.fillMode), t._effect.setMatrix(\"viewProjection\", d.getTransformMatrix()), t._effect.setMatrix(\"view\", d.getViewMatrix()), y) {\n                        var z, J = s._instanceDataStorage;\n                        if (J.isFrozen || !y.backFaceCulling && y.overrideMaterialSideOrientation === null)\n                          z = J.sideOrientation;\n                        else {\n                          var ie = s._getWorldMatrixDeterminant();\n                          (z = y.overrideMaterialSideOrientation) == null && (z = y.sideOrientation), ie < 0 && (z = z === zt.a.ClockWiseSideOrientation ? zt.a.CounterClockWiseSideOrientation : zt.a.ClockWiseSideOrientation);\n                        }\n                        if (y._preBind(t._effect, z), y.needAlphaTesting()) {\n                          var se = y.getAlphaTestTexture();\n                          se && (t._effect.setTexture(\"diffuseSampler\", se), t._effect.setMatrix(\"diffuseMatrix\", se.getTextureMatrix()));\n                        }\n                        y.bumpTexture && d.getEngine().getCaps().standardDerivatives && Nt.a.BumpTextureEnabled && (t._effect.setFloat3(\"vBumpInfos\", y.bumpTexture.coordinatesIndex, 1 / y.bumpTexture.level, y.parallaxScaleBias), t._effect.setMatrix(\"bumpMatrix\", y.bumpTexture.getTextureMatrix()), t._effect.setTexture(\"bumpSampler\", y.bumpTexture), t._effect.setFloat2(\"vTangentSpaceParams\", y.invertNormalMapX ? -1 : 1, y.invertNormalMapY ? -1 : 1)), t._enableReflectivity && (y instanceof Nt.a && y.specularTexture ? (t._effect.setMatrix(\"reflectivityMatrix\", y.specularTexture.getTextureMatrix()), t._effect.setTexture(\"reflectivitySampler\", y.specularTexture)) : y instanceof $r && y.reflectivityTexture && (t._effect.setMatrix(\"reflectivityMatrix\", y.reflectivityTexture.getTextureMatrix()), t._effect.setTexture(\"reflectivitySampler\", y.reflectivityTexture)));\n                      }\n                      a.useBones && a.computeBonesUsingShaders && a.skeleton && (t._effect.setMatrices(\"mBones\", a.skeleton.getTransformMatrices(a)), t._enableVelocity && t._effect.setMatrices(\"mPreviousBones\", t._previousBonesTransformationMatrices[a.uniqueId])), $e.a.BindMorphTargetParameters(a, t._effect), t._enableVelocity && (t._effect.setMatrix(\"previousWorld\", t._previousTransformationMatrices[s.uniqueId].world), t._effect.setMatrix(\"previousViewProjection\", t._previousTransformationMatrices[s.uniqueId].viewProjection)), a._processRendering(s, o, t._effect, y.fillMode, R, B, function(ce, ue) {\n                        return t._effect.setMatrix(\"world\", ue);\n                      });\n                    }\n                    t._enableVelocity && (t._previousTransformationMatrices[s.uniqueId].world = F.clone(), t._previousTransformationMatrices[s.uniqueId].viewProjection = t._scene.getTransformMatrix().clone(), a.skeleton && t._copyBonesTransformationMatrices(a.skeleton.getTransformMatrices(a), t._previousBonesTransformationMatrices[s.uniqueId]));\n                  }\n                }\n              };\n              this._multiRenderTarget.customRenderFunction = function(o, a, s, d) {\n                var p;\n                if (t._linkedWithPrePass) {\n                  if (!t._prePassRenderer.enabled)\n                    return;\n                  t._scene.getEngine().bindAttachments(t._attachments);\n                }\n                if (d.length) {\n                  for (e.setColorWrite(!1), p = 0; p < d.length; p++)\n                    i(d.data[p]);\n                  e.setColorWrite(!0);\n                }\n                for (p = 0; p < o.length; p++)\n                  i(o.data[p]);\n                for (p = 0; p < a.length; p++)\n                  i(a.data[p]);\n                if (t.renderTransparentMeshes)\n                  for (p = 0; p < s.length; p++)\n                    i(s.data[p]);\n              };\n            }\n          }, r.prototype._copyBonesTransformationMatrices = function(t, e) {\n            for (var n = 0; n < t.length; n++)\n              e[n] = t[n];\n            return e;\n          }, r.DEPTHNORMAL_TEXTURE_TYPE = 0, r.POSITION_TEXTURE_TYPE = 1, r.VELOCITY_TEXTURE_TYPE = 2, r.REFLECTIVITY_TEXTURE_TYPE = 3, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"GeometryBufferRendererSceneComponent\");\n          }, r;\n        }(), jm = function() {\n          this.enabled = !1, this.name = \"motionBlur\", this.texturesRequired = [h.a.PREPASS_VELOCITY_TEXTURE_TYPE];\n        };\n        Object.defineProperty(_e.a.prototype, \"geometryBufferRenderer\", { get: function() {\n          this._geometryBufferRenderer;\n        }, set: function(r) {\n          r && r.isSupported && (this._geometryBufferRenderer = r);\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.enableGeometryBufferRenderer = function(r) {\n          return r === void 0 && (r = 1), this._geometryBufferRenderer || (this._geometryBufferRenderer = new ri(this, r), this._geometryBufferRenderer.isSupported || (this._geometryBufferRenderer = null)), this._geometryBufferRenderer;\n        }, _e.a.prototype.disableGeometryBufferRenderer = function() {\n          this._geometryBufferRenderer && (this._geometryBufferRenderer.dispose(), this._geometryBufferRenderer = null);\n        };\n        var yd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_GEOMETRYBUFFERRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER, this, this._gatherRenderTargets);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._gatherRenderTargets = function(t) {\n            this.scene._geometryBufferRenderer && t.push(this.scene._geometryBufferRenderer.getGBuffer());\n          }, r;\n        }();\n        ri._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_GEOMETRYBUFFERRENDERER);\n          t || (t = new yd(r), r._addComponent(t));\n        };\n        var Hm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float motionStrength;\nuniform float motionScale;\nuniform vec2 screenSize;\n#ifdef OBJECT_BASED\nuniform sampler2D velocitySampler;\n#else\nuniform sampler2D depthSampler;\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\n#endif\nvoid main(void)\n{\n#ifdef GEOMETRY_SUPPORTED\n#ifdef OBJECT_BASED\nvec2 texelSize=1.0/screenSize;\nvec2 velocityColor=texture2D(velocitySampler,vUV).rg*2.0-1.0;\nvec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0));\nvelocity*=motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint samplesCount=int(clamp(speed,1.0,SAMPLES));\nvelocity=normalize(velocity)*texelSize;\nfloat hlim=float(-samplesCount)*0.5+0.5;\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i)\n{\nif (i>=samplesCount)\nbreak;\nvec2 offset=vUV+velocity*(hlim+float(i));\nresult+=texture2D(textureSampler,offset);\n}\ngl_FragColor=result/float(samplesCount);\ngl_FragColor.a=1.0;\n#else\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n#endif\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n`;\n        ze.a.ShadersStore.motionBlurPixelShader = Hm;\n        var Mc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1), P === void 0 && (P = !0);\n            var R = r.call(this, e, \"motionBlur\", [\"motionStrength\", \"motionScale\", \"screenSize\", \"inverseViewProjection\", \"prevViewProjection\"], [\"velocitySampler\"], i, o, a, s, d, `#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED`, p, void 0, null, y) || this;\n            return R.motionStrength = 1, R._motionBlurSamples = 32, R._isObjectBased = !0, R._forceGeometryBuffer = !1, R._geometryBufferRenderer = null, R._prePassRenderer = null, R._invViewProjection = null, R._previousViewProjection = null, R._forceGeometryBuffer = P, R._forceGeometryBuffer ? (R._geometryBufferRenderer = n.enableGeometryBufferRenderer(), R._geometryBufferRenderer && (R._geometryBufferRenderer.enableVelocity = !0)) : (R._prePassRenderer = n.enablePrePassRenderer(), R._prePassRenderer && (R._prePassRenderer.markAsDirty(), R._prePassEffectConfiguration = new jm())), R._applyMode(), R;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"motionBlurSamples\", { get: function() {\n            return this._motionBlurSamples;\n          }, set: function(e) {\n            this._motionBlurSamples = e, this._updateEffect();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isObjectBased\", { get: function() {\n            return this._isObjectBased;\n          }, set: function(e) {\n            this._isObjectBased !== e && (this._isObjectBased = e, this._applyMode());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"MotionBlurPostProcess\";\n          }, t.prototype.excludeSkinnedMesh = function(e) {\n            if (e.skeleton) {\n              var n = void 0;\n              if (this._geometryBufferRenderer)\n                n = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\n              else {\n                if (!this._prePassRenderer)\n                  return;\n                n = this._prePassRenderer.excludedSkinnedMesh;\n              }\n              n.push(e);\n            }\n          }, t.prototype.removeExcludedSkinnedMesh = function(e) {\n            if (e.skeleton) {\n              var n = void 0;\n              if (this._geometryBufferRenderer)\n                n = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\n              else {\n                if (!this._prePassRenderer)\n                  return;\n                n = this._prePassRenderer.excludedSkinnedMesh;\n              }\n              var i = n.indexOf(e);\n              i !== -1 && n.splice(i, 1);\n            }\n          }, t.prototype.dispose = function(e) {\n            this._geometryBufferRenderer && (this._geometryBufferRenderer._previousTransformationMatrices = {}, this._geometryBufferRenderer._previousBonesTransformationMatrices = {}, this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = []), r.prototype.dispose.call(this, e);\n          }, t.prototype._applyMode = function() {\n            var e = this;\n            if (!this._geometryBufferRenderer && !this._prePassRenderer)\n              return l.a.Warn(\"Multiple Render Target support needed to compute object based motion blur\"), this.updateEffect();\n            this._updateEffect(), this._invViewProjection = null, this._previousViewProjection = null, this.isObjectBased ? (this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = h.a.PREPASS_VELOCITY_TEXTURE_TYPE), this.onApply = function(n) {\n              return e._onApplyObjectBased(n);\n            }) : (this._invViewProjection = u.a.Identity(), this._previousViewProjection = u.a.Identity(), this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE), this.onApply = function(n) {\n              return e._onApplyScreenBased(n);\n            });\n          }, t.prototype._onApplyObjectBased = function(e) {\n            if (e.setVector2(\"screenSize\", new u.d(this.width, this.height)), e.setFloat(\"motionScale\", this._scene.getAnimationRatio()), e.setFloat(\"motionStrength\", this.motionStrength), this._geometryBufferRenderer) {\n              var n = this._geometryBufferRenderer.getTextureIndex(ri.VELOCITY_TEXTURE_TYPE);\n              e.setTexture(\"velocitySampler\", this._geometryBufferRenderer.getGBuffer().textures[n]);\n            } else\n              this._prePassRenderer && (n = this._prePassRenderer.getIndex(h.a.PREPASS_VELOCITY_TEXTURE_TYPE), e.setTexture(\"velocitySampler\", this._prePassRenderer.prePassRT.textures[n]));\n          }, t.prototype._onApplyScreenBased = function(e) {\n            var n = this._scene.getProjectionMatrix().multiply(this._scene.getViewMatrix());\n            if (n.invertToRef(this._invViewProjection), e.setMatrix(\"inverseViewProjection\", this._invViewProjection), e.setMatrix(\"prevViewProjection\", this._previousViewProjection), this._previousViewProjection = n, e.setVector2(\"screenSize\", new u.d(this.width, this.height)), e.setFloat(\"motionScale\", this._scene.getAnimationRatio()), e.setFloat(\"motionStrength\", this.motionStrength), this._geometryBufferRenderer) {\n              var i = this._geometryBufferRenderer.getTextureIndex(ri.DEPTHNORMAL_TEXTURE_TYPE);\n              e.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[i]);\n            } else\n              this._prePassRenderer && (i = this._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE), e.setTexture(\"depthSampler\", this._prePassRenderer.prePassRT.textures[i]));\n          }, t.prototype._updateEffect = function() {\n            if (this._geometryBufferRenderer || this._prePassRenderer) {\n              var e = [\"#define GEOMETRY_SUPPORTED\", \"#define SAMPLES \" + this._motionBlurSamples.toFixed(1), this._isObjectBased ? \"#define OBJECT_BASED\" : \"#define SCREEN_BASED\"];\n              this.updateEffect(e.join(`\n`));\n            }\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, i, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType, !1);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"motionStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"motionBlurSamples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"isObjectBased\", null), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.MotionBlurPostProcess\"] = Mc;\n        var Wm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D refractionSampler;\n\nuniform vec3 baseColor;\nuniform float depth;\nuniform float colorLevel;\nvoid main() {\nfloat ref=1.0-texture2D(refractionSampler,vUV).r;\nvec2 uv=vUV-vec2(0.5);\nvec2 offset=uv*depth*ref;\nvec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;\ngl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);\n}`;\n        ze.a.ShadersStore.refractionPixelShader = Wm;\n        var bd = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            var R = r.call(this, e, \"refraction\", [\"baseColor\", \"depth\", \"colorLevel\"], [\"refractionSampler\"], s, d, p, y, P) || this;\n            return R._ownRefractionTexture = !0, R.color = i, R.depth = o, R.colorLevel = a, R.refractionTextureUrl = n, R.onActivateObservable.add(function(B) {\n              R._refTexture = R._refTexture || new Ne.a(n, B.getScene());\n            }), R.onApplyObservable.add(function(B) {\n              B.setColor3(\"baseColor\", R.color), B.setFloat(\"depth\", R.depth), B.setFloat(\"colorLevel\", R.colorLevel), B.setTexture(\"refractionSampler\", R._refTexture);\n            }), R;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"refractionTexture\", { get: function() {\n            return this._refTexture;\n          }, set: function(e) {\n            this._refTexture && this._ownRefractionTexture && this._refTexture.dispose(), this._refTexture = e, this._ownRefractionTexture = !1;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"RefractionPostProcess\";\n          }, t.prototype.dispose = function(e) {\n            this._refTexture && this._ownRefractionTexture && (this._refTexture.dispose(), this._refTexture = null), r.prototype.dispose.call(this, e);\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.refractionTextureUrl, e.color, e.depth, e.colorLevel, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"color\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"depth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"colorLevel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"refractionTextureUrl\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.RefractionPostProcess\"] = bd;\n        var Xm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform vec2 sharpnessAmounts;\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 color=texture2D(textureSampler,vUV);\nvec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1)) -\ncolor*4.0;\ngl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);\n}`;\n        ze.a.ShadersStore.sharpenPixelShader = Xm;\n        var Ic = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"sharpen\", [\"sharpnessAmounts\", \"screenSize\"], null, n, i, o, a, s, null, d, void 0, null, p) || this;\n            return y.colorAmount = 1, y.edgeAmount = 0.3, y.onApply = function(P) {\n              P.setFloat2(\"screenSize\", y.width, y.height), P.setFloat2(\"sharpnessAmounts\", y.edgeAmount, y.colorAmount);\n            }, y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SharpenPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.textureType, e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"colorAmount\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"edgeAmount\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.SharpenPostProcess\"] = Ic;\n        var Ir = function() {\n          function r(t, e) {\n            this.engine = t, this._name = e, this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array(), this._cameras = [];\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return this._name;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cameras\", { get: function() {\n            return this._cameras;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"PostProcessRenderPipeline\";\n          }, Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            for (var t in this._renderEffects)\n              if (this._renderEffects.hasOwnProperty(t) && !this._renderEffects[t].isSupported)\n                return !1;\n            return !0;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addEffect = function(t) {\n            this._renderEffects[t._name] = t;\n          }, r.prototype._rebuild = function() {\n          }, r.prototype._enableEffect = function(t, e) {\n            var n = this._renderEffects[t];\n            n && n._enable(Xe.b.MakeArray(e || this._cameras));\n          }, r.prototype._disableEffect = function(t, e) {\n            var n = this._renderEffects[t];\n            n && n._disable(Xe.b.MakeArray(e || this._cameras));\n          }, r.prototype._attachCameras = function(t, e) {\n            var n = Xe.b.MakeArray(t || this._cameras);\n            if (n) {\n              var i, o = [];\n              for (i = 0; i < n.length; i++) {\n                var a = n[i];\n                if (a) {\n                  var s = a.name;\n                  this._cameras.indexOf(a) === -1 ? this._cameras[s] = a : e && o.push(i);\n                }\n              }\n              for (i = 0; i < o.length; i++)\n                t.splice(o[i], 1);\n              for (var d in this._renderEffects)\n                this._renderEffects.hasOwnProperty(d) && this._renderEffects[d]._attachCameras(n);\n            }\n          }, r.prototype._detachCameras = function(t) {\n            var e = Xe.b.MakeArray(t || this._cameras);\n            if (e) {\n              for (var n in this._renderEffects)\n                this._renderEffects.hasOwnProperty(n) && this._renderEffects[n]._detachCameras(e);\n              for (var i = 0; i < e.length; i++)\n                this._cameras.splice(this._cameras.indexOf(e[i]), 1);\n            }\n          }, r.prototype._update = function() {\n            for (var t in this._renderEffects)\n              this._renderEffects.hasOwnProperty(t) && this._renderEffects[t]._update();\n            for (var e = 0; e < this._cameras.length; e++)\n              if (this._cameras[e]) {\n                var n = this._cameras[e].name;\n                this._renderEffectsForIsolatedPass[n] && this._renderEffectsForIsolatedPass[n]._update();\n              }\n          }, r.prototype._reset = function() {\n            this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array();\n          }, r.prototype._enableMSAAOnFirstPostProcess = function(t) {\n            if (this.engine.webGLVersion === 1)\n              return !1;\n            var e = Object.keys(this._renderEffects);\n            if (e.length > 0) {\n              var n = this._renderEffects[e[0]].getPostProcesses();\n              n && (n[0].samples = t);\n            }\n            return !0;\n          }, r.prototype.setPrePassRenderer = function(t) {\n            return !1;\n          }, r.prototype.dispose = function() {\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"_name\", void 0), r;\n        }(), Td = function() {\n          function r() {\n            this._renderPipelines = {};\n          }\n          return Object.defineProperty(r.prototype, \"supportedPipelines\", { get: function() {\n            var t = [];\n            for (var e in this._renderPipelines)\n              if (this._renderPipelines.hasOwnProperty(e)) {\n                var n = this._renderPipelines[e];\n                n.isSupported && t.push(n);\n              }\n            return t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addPipeline = function(t) {\n            this._renderPipelines[t._name] = t;\n          }, r.prototype.attachCamerasToRenderPipeline = function(t, e, n) {\n            n === void 0 && (n = !1);\n            var i = this._renderPipelines[t];\n            i && i._attachCameras(e, n);\n          }, r.prototype.detachCamerasFromRenderPipeline = function(t, e) {\n            var n = this._renderPipelines[t];\n            n && n._detachCameras(e);\n          }, r.prototype.enableEffectInPipeline = function(t, e, n) {\n            var i = this._renderPipelines[t];\n            i && i._enableEffect(e, n);\n          }, r.prototype.disableEffectInPipeline = function(t, e, n) {\n            var i = this._renderPipelines[t];\n            i && i._disableEffect(e, n);\n          }, r.prototype.update = function() {\n            for (var t in this._renderPipelines)\n              if (this._renderPipelines.hasOwnProperty(t)) {\n                var e = this._renderPipelines[t];\n                e.isSupported ? e._update() : (e.dispose(), delete this._renderPipelines[t]);\n              }\n          }, r.prototype._rebuild = function() {\n            for (var t in this._renderPipelines)\n              this._renderPipelines.hasOwnProperty(t) && this._renderPipelines[t]._rebuild();\n          }, r.prototype.dispose = function() {\n            for (var t in this._renderPipelines)\n              this._renderPipelines.hasOwnProperty(t) && this._renderPipelines[t].dispose();\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"postProcessRenderPipelineManager\", { get: function() {\n          if (!this._postProcessRenderPipelineManager) {\n            var r = this._getComponent(ot.a.NAME_POSTPROCESSRENDERPIPELINEMANAGER);\n            r || (r = new Ed(this), this._addComponent(r)), this._postProcessRenderPipelineManager = new Td();\n          }\n          return this._postProcessRenderPipelineManager;\n        }, enumerable: !0, configurable: !0 });\n        var Ed = function() {\n          function r(t) {\n            this.name = ot.a.NAME_POSTPROCESSRENDERPIPELINEMANAGER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER, this, this._gatherRenderTargets);\n          }, r.prototype.rebuild = function() {\n            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager._rebuild();\n          }, r.prototype.dispose = function() {\n            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.dispose();\n          }, r.prototype._gatherRenderTargets = function() {\n            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.update();\n          }, r;\n        }(), Sd = function(r) {\n          function t(e, n, i, o, a) {\n            e === void 0 && (e = \"\"), n === void 0 && (n = !0), i === void 0 && (i = te.a.LastCreatedScene), a === void 0 && (a = !0);\n            var s = r.call(this, i.getEngine(), e) || this;\n            s._camerasToBeAttached = [], s.SharpenPostProcessId = \"SharpenPostProcessEffect\", s.ImageProcessingPostProcessId = \"ImageProcessingPostProcessEffect\", s.FxaaPostProcessId = \"FxaaPostProcessEffect\", s.ChromaticAberrationPostProcessId = \"ChromaticAberrationPostProcessEffect\", s.GrainPostProcessId = \"GrainPostProcessEffect\", s._glowLayer = null, s.animations = [], s._imageProcessingConfigurationObserver = null, s._sharpenEnabled = !1, s._bloomEnabled = !1, s._depthOfFieldEnabled = !1, s._depthOfFieldBlurLevel = Ji.Low, s._fxaaEnabled = !1, s._imageProcessingEnabled = !0, s._bloomScale = 0.5, s._chromaticAberrationEnabled = !1, s._grainEnabled = !1, s._buildAllowed = !0, s.onBuildObservable = new C.c(), s._resizeObserver = null, s._hardwareScaleLevel = 1, s._bloomKernel = 64, s._bloomWeight = 0.15, s._bloomThreshold = 0.9, s._samples = 1, s._hasCleared = !1, s._prevPostProcess = null, s._prevPrevPostProcess = null, s._depthOfFieldSceneObserver = null, s._cameras = o || i.cameras, s._cameras = s._cameras.slice(), s._camerasToBeAttached = s._cameras.slice(), s._buildAllowed = a, s._scene = i;\n            var d = s._scene.getEngine().getCaps();\n            s._hdr = n && (d.textureHalfFloatRender || d.textureFloatRender), s._hdr ? d.textureHalfFloatRender ? s._defaultPipelineTextureType = h.a.TEXTURETYPE_HALF_FLOAT : d.textureFloatRender && (s._defaultPipelineTextureType = h.a.TEXTURETYPE_FLOAT) : s._defaultPipelineTextureType = h.a.TEXTURETYPE_UNSIGNED_INT, i.postProcessRenderPipelineManager.addPipeline(s);\n            var p = s._scene.getEngine();\n            return s.sharpen = new Ic(\"sharpen\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, p, !1, s._defaultPipelineTextureType, !0), s._sharpenEffect = new xt(p, s.SharpenPostProcessId, function() {\n              return s.sharpen;\n            }, !0), s.depthOfField = new Rc(s._scene, null, s._depthOfFieldBlurLevel, s._defaultPipelineTextureType, !0), s.bloom = new Pc(s._scene, s._bloomScale, s._bloomWeight, s.bloomKernel, s._defaultPipelineTextureType, !0), s.chromaticAberration = new xc(\"ChromaticAberration\", p.getRenderWidth(), p.getRenderHeight(), 1, null, Ne.a.BILINEAR_SAMPLINGMODE, p, !1, s._defaultPipelineTextureType, !0), s._chromaticAberrationEffect = new xt(p, s.ChromaticAberrationPostProcessId, function() {\n              return s.chromaticAberration;\n            }, !0), s.grain = new Oc(\"Grain\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, p, !1, s._defaultPipelineTextureType, !0), s._grainEffect = new xt(p, s.GrainPostProcessId, function() {\n              return s.grain;\n            }, !0), s._resizeObserver = p.onResizeObservable.add(function() {\n              s._hardwareScaleLevel = p.getHardwareScalingLevel(), s.bloomKernel = s.bloomKernel;\n            }), s._imageProcessingConfigurationObserver = s._scene.imageProcessingConfiguration.onUpdateParameters.add(function() {\n              s.bloom._downscale._exposure = s._scene.imageProcessingConfiguration.exposure, s.imageProcessingEnabled !== s._scene.imageProcessingConfiguration.isEnabled && (s._imageProcessingEnabled = s._scene.imageProcessingConfiguration.isEnabled, s._buildPipeline());\n            }), s._buildPipeline(), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sharpenEnabled\", { get: function() {\n            return this._sharpenEnabled;\n          }, set: function(e) {\n            this._sharpenEnabled !== e && (this._sharpenEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomKernel\", { get: function() {\n            return this._bloomKernel;\n          }, set: function(e) {\n            this._bloomKernel = e, this.bloom.kernel = e / this._hardwareScaleLevel;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomWeight\", { get: function() {\n            return this._bloomWeight;\n          }, set: function(e) {\n            this._bloomWeight !== e && (this.bloom.weight = e, this._bloomWeight = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomThreshold\", { get: function() {\n            return this._bloomThreshold;\n          }, set: function(e) {\n            this._bloomThreshold !== e && (this.bloom.threshold = e, this._bloomThreshold = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomScale\", { get: function() {\n            return this._bloomScale;\n          }, set: function(e) {\n            this._bloomScale !== e && (this._bloomScale = e, this._rebuildBloom(), this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomEnabled\", { get: function() {\n            return this._bloomEnabled;\n          }, set: function(e) {\n            this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), t.prototype._rebuildBloom = function() {\n            var e = this.bloom;\n            this.bloom = new Pc(this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel, this._defaultPipelineTextureType, !1), this.bloom.threshold = e.threshold;\n            for (var n = 0; n < this._cameras.length; n++)\n              e.disposeEffects(this._cameras[n]);\n          }, Object.defineProperty(t.prototype, \"depthOfFieldEnabled\", { get: function() {\n            return this._depthOfFieldEnabled;\n          }, set: function(e) {\n            this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthOfFieldBlurLevel\", { get: function() {\n            return this._depthOfFieldBlurLevel;\n          }, set: function(e) {\n            if (this._depthOfFieldBlurLevel !== e) {\n              this._depthOfFieldBlurLevel = e;\n              var n = this.depthOfField;\n              this.depthOfField = new Rc(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !1), this.depthOfField.focalLength = n.focalLength, this.depthOfField.focusDistance = n.focusDistance, this.depthOfField.fStop = n.fStop, this.depthOfField.lensSize = n.lensSize;\n              for (var i = 0; i < this._cameras.length; i++)\n                n.disposeEffects(this._cameras[i]);\n              this._buildPipeline();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fxaaEnabled\", { get: function() {\n            return this._fxaaEnabled;\n          }, set: function(e) {\n            this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples !== e && (this._samples = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageProcessingEnabled\", { get: function() {\n            return this._imageProcessingEnabled;\n          }, set: function(e) {\n            this._imageProcessingEnabled !== e && (this._scene.imageProcessingConfiguration.isEnabled = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glowLayerEnabled\", { get: function() {\n            return this._glowLayer != null;\n          }, set: function(e) {\n            e && !this._glowLayer ? this._glowLayer = new Ko(\"\", this._scene) : !e && this._glowLayer && (this._glowLayer.dispose(), this._glowLayer = null);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glowLayer\", { get: function() {\n            return this._glowLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"chromaticAberrationEnabled\", { get: function() {\n            return this._chromaticAberrationEnabled;\n          }, set: function(e) {\n            this._chromaticAberrationEnabled !== e && (this._chromaticAberrationEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"grainEnabled\", { get: function() {\n            return this._grainEnabled;\n          }, set: function(e) {\n            this._grainEnabled !== e && (this._grainEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"DefaultRenderingPipeline\";\n          }, t.prototype.prepare = function() {\n            var e = this._buildAllowed;\n            this._buildAllowed = !0, this._buildPipeline(), this._buildAllowed = e;\n          }, t.prototype._setAutoClearAndTextureSharing = function(e, n) {\n            n === void 0 && (n = !1), this._hasCleared ? e.autoClear = !1 : (e.autoClear = !0, this._scene.autoClear = !1, this._hasCleared = !0), n || (this._prevPrevPostProcess ? e.shareOutputWith(this._prevPrevPostProcess) : e.useOwnOutput(), this._prevPostProcess && (this._prevPrevPostProcess = this._prevPostProcess), this._prevPostProcess = e);\n          }, t.prototype._buildPipeline = function() {\n            var e = this;\n            if (this._buildAllowed) {\n              this._scene.autoClear = !0;\n              var n = this._scene.getEngine();\n              if (this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._prevPostProcess = null, this._prevPrevPostProcess = null, this._hasCleared = !1, this.depthOfFieldEnabled) {\n                if (this._cameras.length > 1) {\n                  for (var i = 0, o = this._cameras; i < o.length; i++) {\n                    var a = o[i];\n                    (s = this._scene.enableDepthRenderer(a)).useOnlyInActiveCamera = !0;\n                  }\n                  this._depthOfFieldSceneObserver = this._scene.onAfterRenderTargetsRenderObservable.add(function(d) {\n                    e._cameras.indexOf(d.activeCamera) > -1 && (e.depthOfField.depthTexture = d.enableDepthRenderer(d.activeCamera).getDepthMap());\n                  });\n                } else {\n                  this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);\n                  var s = this._scene.enableDepthRenderer(this._cameras[0]);\n                  this.depthOfField.depthTexture = s.getDepthMap();\n                }\n                this.depthOfField._isReady() || this.depthOfField._updateEffects(), this.addEffect(this.depthOfField), this._setAutoClearAndTextureSharing(this.depthOfField._effects[0], !0);\n              } else\n                this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);\n              this.bloomEnabled && (this.bloom._isReady() || this.bloom._updateEffects(), this.addEffect(this.bloom), this._setAutoClearAndTextureSharing(this.bloom._effects[0], !0)), this._imageProcessingEnabled && (this.imageProcessing = new Io(\"imageProcessing\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, n, !1, this._defaultPipelineTextureType), this._hdr ? (this.addEffect(new xt(n, this.ImageProcessingPostProcessId, function() {\n                return e.imageProcessing;\n              }, !0)), this._setAutoClearAndTextureSharing(this.imageProcessing)) : this._scene.imageProcessingConfiguration.applyByPostProcess = !1, this.cameras && this.cameras.length !== 0 || (this._scene.imageProcessingConfiguration.applyByPostProcess = !1), this.imageProcessing.getEffect() || this.imageProcessing._updateParameters()), this.sharpenEnabled && (this.sharpen.isReady() || this.sharpen.updateEffect(), this.addEffect(this._sharpenEffect), this._setAutoClearAndTextureSharing(this.sharpen)), this.grainEnabled && (this.grain.isReady() || this.grain.updateEffect(), this.addEffect(this._grainEffect), this._setAutoClearAndTextureSharing(this.grain)), this.chromaticAberrationEnabled && (this.chromaticAberration.isReady() || this.chromaticAberration.updateEffect(), this.addEffect(this._chromaticAberrationEffect), this._setAutoClearAndTextureSharing(this.chromaticAberration)), this.fxaaEnabled && (this.fxaa = new vo(\"fxaa\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, n, !1, this._defaultPipelineTextureType), this.addEffect(new xt(n, this.FxaaPostProcessId, function() {\n                return e.fxaa;\n              }, !0)), this._setAutoClearAndTextureSharing(this.fxaa, !0)), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), this._scene.activeCameras && this._scene.activeCameras.length > 1 && (this._scene.autoClear = !0), !this._enableMSAAOnFirstPostProcess(this.samples) && this.samples > 1 && l.a.Warn(\"MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0\"), this.onBuildObservable.notifyObservers(this);\n            }\n          }, t.prototype._disposePostProcesses = function(e) {\n            e === void 0 && (e = !1);\n            for (var n = 0; n < this._cameras.length; n++) {\n              var i = this._cameras[n];\n              this.imageProcessing && this.imageProcessing.dispose(i), this.fxaa && this.fxaa.dispose(i), e && (this.sharpen && this.sharpen.dispose(i), this.depthOfField && (this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver), this.depthOfField.disposeEffects(i)), this.bloom && this.bloom.disposeEffects(i), this.chromaticAberration && this.chromaticAberration.dispose(i), this.grain && this.grain.dispose(i), this._glowLayer && this._glowLayer.dispose());\n            }\n            this.imageProcessing = null, this.fxaa = null, e && (this.sharpen = null, this._sharpenEffect = null, this.depthOfField = null, this.bloom = null, this.chromaticAberration = null, this._chromaticAberrationEffect = null, this.grain = null, this._grainEffect = null, this._glowLayer = null);\n          }, t.prototype.addCamera = function(e) {\n            this._camerasToBeAttached.push(e), this._buildPipeline();\n          }, t.prototype.removeCamera = function(e) {\n            var n = this._camerasToBeAttached.indexOf(e);\n            this._camerasToBeAttached.splice(n, 1), this._buildPipeline();\n          }, t.prototype.dispose = function() {\n            this.onBuildObservable.clear(), this._disposePostProcesses(!0), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._scene.autoClear = !0, this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver), r.prototype.dispose.call(this);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"DefaultRenderingPipeline\", e;\n          }, t.Parse = function(e, n, i) {\n            return L.a.Parse(function() {\n              return new t(e._name, e._name._hdr, n);\n            }, e, n, i);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"sharpenEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomKernel\", null), Object(c.c)([Object(L.c)()], t.prototype, \"_bloomWeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_bloomThreshold\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_hdr\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"bloomWeight\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomThreshold\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomScale\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldBlurLevel\", null), Object(c.c)([Object(L.c)()], t.prototype, \"fxaaEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"samples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"imageProcessingEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"glowLayerEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"chromaticAberrationEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"grainEnabled\", null), t;\n        }(Ir);\n        O.a.RegisteredTypes[\"BABYLON.DefaultRenderingPipeline\"] = Sd;\n        var Ym = `\nuniform sampler2D textureSampler;\n\nuniform float gain;\nuniform float threshold;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\n\nvec4 highlightColor(vec4 color) {\nvec4 highlight=color;\nfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\nfloat lum_threshold;\nif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\n\nif (gain == -1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\n\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n\n}`;\n        ze.a.ShadersStore.lensHighlightsPixelShader = Ym;\n        var Km = `\n\n\n\n\nuniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\n\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\n\nuniform float screen_distance;\nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\n\nuniform float near;\nuniform float far;\n\nvarying vec2 vUV;\n\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1\n\nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\n\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\n\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion == 0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\n\nfloat sampleScreen(inout vec4 color,const in vec2 offset,const in float weight) {\n\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\n\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\n\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nif (size == 0.0) { return col; }\n\n\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight;\n\nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\n\n\n\n\nreturn col;\n}\nvoid main(void)\n{\n\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV);\nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height);\nfloat depth=texture2D(depthSampler,distorted_coords).r;\nfloat distance=near+(far-near)*depth;\nvec4 color=texture2D(textureSampler,vUV);\n\n\nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\n\nif (dof_enabled == false || coc<0.07) { coc=0.0; }\n\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\n\nfloat blur_amount=max(edge_blur_amount,coc);\n\nif (blur_amount == 0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\n\ngl_FragColor=getBlurColor(blur_amount*1.7);\n\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\n\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\n\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n`;\n        ze.a.ShadersStore.depthOfFieldPixelShader = Km;\n        var Qm = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = 1);\n            var s = r.call(this, i.getEngine(), e) || this;\n            return s.LensChromaticAberrationEffect = \"LensChromaticAberrationEffect\", s.HighlightsEnhancingEffect = \"HighlightsEnhancingEffect\", s.LensDepthOfFieldEffect = \"LensDepthOfFieldEffect\", s._pentagonBokehIsEnabled = !1, s._scene = i, s._depthTexture = i.enableDepthRenderer().getDepthMap(), n.grain_texture ? s._grainTexture = n.grain_texture : s._createGrainTexture(), s._edgeBlur = n.edge_blur ? n.edge_blur : 0, s._grainAmount = n.grain_amount ? n.grain_amount : 0, s._chromaticAberration = n.chromatic_aberration ? n.chromatic_aberration : 0, s._distortion = n.distortion ? n.distortion : 0, s._highlightsGain = n.dof_gain !== void 0 ? n.dof_gain : -1, s._highlightsThreshold = n.dof_threshold ? n.dof_threshold : 1, s._dofDistance = n.dof_focus_distance !== void 0 ? n.dof_focus_distance : -1, s._dofAperture = n.dof_aperture ? n.dof_aperture : 1, s._dofDarken = n.dof_darken ? n.dof_darken : 0, s._dofPentagon = n.dof_pentagon === void 0 || n.dof_pentagon, s._blurNoise = n.blur_noise === void 0 || n.blur_noise, s._createChromaticAberrationPostProcess(o), s._createHighlightsPostProcess(o), s._createDepthOfFieldPostProcess(o / 4), s.addEffect(new xt(i.getEngine(), s.LensChromaticAberrationEffect, function() {\n              return s._chromaticAberrationPostProcess;\n            }, !0)), s.addEffect(new xt(i.getEngine(), s.HighlightsEnhancingEffect, function() {\n              return s._highlightsPostProcess;\n            }, !0)), s.addEffect(new xt(i.getEngine(), s.LensDepthOfFieldEffect, function() {\n              return s._depthOfFieldPostProcess;\n            }, !0)), s._highlightsGain === -1 && s._disableEffect(s.HighlightsEnhancingEffect, null), i.postProcessRenderPipelineManager.addPipeline(s), a && i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, a), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LensRenderingPipeline\";\n          }, Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edgeBlur\", { get: function() {\n            return this._edgeBlur;\n          }, set: function(e) {\n            this.setEdgeBlur(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"grainAmount\", { get: function() {\n            return this._grainAmount;\n          }, set: function(e) {\n            this.setGrainAmount(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"chromaticAberration\", { get: function() {\n            return this._chromaticAberration;\n          }, set: function(e) {\n            this.setChromaticAberration(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dofAperture\", { get: function() {\n            return this._dofAperture;\n          }, set: function(e) {\n            this.setAperture(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edgeDistortion\", { get: function() {\n            return this._distortion;\n          }, set: function(e) {\n            this.setEdgeDistortion(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dofDistortion\", { get: function() {\n            return this._dofDistance;\n          }, set: function(e) {\n            this.setFocusDistance(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"darkenOutOfFocus\", { get: function() {\n            return this._dofDarken;\n          }, set: function(e) {\n            this.setDarkenOutOfFocus(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurNoise\", { get: function() {\n            return this._blurNoise;\n          }, set: function(e) {\n            this._blurNoise = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"pentagonBokeh\", { get: function() {\n            return this._pentagonBokehIsEnabled;\n          }, set: function(e) {\n            e ? this.enablePentagonBokeh() : this.disablePentagonBokeh();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"highlightsGain\", { get: function() {\n            return this._highlightsGain;\n          }, set: function(e) {\n            this.setHighlightsGain(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"highlightsThreshold\", { get: function() {\n            return this._highlightsThreshold;\n          }, set: function(e) {\n            this.setHighlightsThreshold(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.setEdgeBlur = function(e) {\n            this._edgeBlur = e;\n          }, t.prototype.disableEdgeBlur = function() {\n            this._edgeBlur = 0;\n          }, t.prototype.setGrainAmount = function(e) {\n            this._grainAmount = e;\n          }, t.prototype.disableGrain = function() {\n            this._grainAmount = 0;\n          }, t.prototype.setChromaticAberration = function(e) {\n            this._chromaticAberration = e;\n          }, t.prototype.disableChromaticAberration = function() {\n            this._chromaticAberration = 0;\n          }, t.prototype.setEdgeDistortion = function(e) {\n            this._distortion = e;\n          }, t.prototype.disableEdgeDistortion = function() {\n            this._distortion = 0;\n          }, t.prototype.setFocusDistance = function(e) {\n            this._dofDistance = e;\n          }, t.prototype.disableDepthOfField = function() {\n            this._dofDistance = -1;\n          }, t.prototype.setAperture = function(e) {\n            this._dofAperture = e;\n          }, t.prototype.setDarkenOutOfFocus = function(e) {\n            this._dofDarken = e;\n          }, t.prototype.enablePentagonBokeh = function() {\n            this._highlightsPostProcess.updateEffect(`#define PENTAGON\n`), this._pentagonBokehIsEnabled = !0;\n          }, t.prototype.disablePentagonBokeh = function() {\n            this._pentagonBokehIsEnabled = !1, this._highlightsPostProcess.updateEffect();\n          }, t.prototype.enableNoiseBlur = function() {\n            this._blurNoise = !0;\n          }, t.prototype.disableNoiseBlur = function() {\n            this._blurNoise = !1;\n          }, t.prototype.setHighlightsGain = function(e) {\n            this._highlightsGain = e;\n          }, t.prototype.setHighlightsThreshold = function(e) {\n            this._highlightsGain === -1 && (this._highlightsGain = 1), this._highlightsThreshold = e;\n          }, t.prototype.disableHighlights = function() {\n            this._highlightsGain = -1;\n          }, t.prototype.dispose = function(e) {\n            e === void 0 && (e = !1), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), this._chromaticAberrationPostProcess = null, this._highlightsPostProcess = null, this._depthOfFieldPostProcess = null, this._grainTexture.dispose(), e && this._scene.disableDepthRenderer();\n          }, t.prototype._createChromaticAberrationPostProcess = function(e) {\n            var n = this;\n            this._chromaticAberrationPostProcess = new ft(\"LensChromaticAberration\", \"chromaticAberration\", [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"], [], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._chromaticAberrationPostProcess.onApply = function(i) {\n              i.setFloat(\"chromatic_aberration\", n._chromaticAberration), i.setFloat(\"screen_width\", n._scene.getEngine().getRenderWidth()), i.setFloat(\"screen_height\", n._scene.getEngine().getRenderHeight()), i.setFloat(\"radialIntensity\", 1), i.setFloat2(\"direction\", 17, 17), i.setFloat2(\"centerPosition\", 0.5, 0.5);\n            };\n          }, t.prototype._createHighlightsPostProcess = function(e) {\n            var n = this;\n            this._highlightsPostProcess = new ft(\"LensHighlights\", \"lensHighlights\", [\"gain\", \"threshold\", \"screen_width\", \"screen_height\"], [], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, this._dofPentagon ? `#define PENTAGON\n` : \"\"), this._highlightsPostProcess.onApply = function(i) {\n              i.setFloat(\"gain\", n._highlightsGain), i.setFloat(\"threshold\", n._highlightsThreshold), i.setTextureFromPostProcess(\"textureSampler\", n._chromaticAberrationPostProcess), i.setFloat(\"screen_width\", n._scene.getEngine().getRenderWidth()), i.setFloat(\"screen_height\", n._scene.getEngine().getRenderHeight());\n            };\n          }, t.prototype._createDepthOfFieldPostProcess = function(e) {\n            var n = this;\n            this._depthOfFieldPostProcess = new ft(\"LensDepthOfField\", \"depthOfField\", [\"grain_amount\", \"blur_noise\", \"screen_width\", \"screen_height\", \"distortion\", \"dof_enabled\", \"screen_distance\", \"aperture\", \"darken\", \"edge_blur\", \"highlights\", \"near\", \"far\"], [\"depthSampler\", \"grainSampler\", \"highlightsSampler\"], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._depthOfFieldPostProcess.onApply = function(i) {\n              i.setTexture(\"depthSampler\", n._depthTexture), i.setTexture(\"grainSampler\", n._grainTexture), i.setTextureFromPostProcess(\"textureSampler\", n._highlightsPostProcess), i.setTextureFromPostProcess(\"highlightsSampler\", n._depthOfFieldPostProcess), i.setFloat(\"grain_amount\", n._grainAmount), i.setBool(\"blur_noise\", n._blurNoise), i.setFloat(\"screen_width\", n._scene.getEngine().getRenderWidth()), i.setFloat(\"screen_height\", n._scene.getEngine().getRenderHeight()), i.setFloat(\"distortion\", n._distortion), i.setBool(\"dof_enabled\", n._dofDistance !== -1), i.setFloat(\"screen_distance\", 1 / (0.1 - 1 / n._dofDistance)), i.setFloat(\"aperture\", n._dofAperture), i.setFloat(\"darken\", n._dofDarken), i.setFloat(\"edge_blur\", n._edgeBlur), i.setBool(\"highlights\", n._highlightsGain !== -1), n._scene.activeCamera && (i.setFloat(\"near\", n._scene.activeCamera.minZ), i.setFloat(\"far\", n._scene.activeCamera.maxZ));\n            };\n          }, t.prototype._createGrainTexture = function() {\n            this._grainTexture = new pi.a(\"LensNoiseTexture\", 512, this._scene, !1, Ne.a.BILINEAR_SAMPLINGMODE), this._grainTexture.wrapU = Ne.a.WRAP_ADDRESSMODE, this._grainTexture.wrapV = Ne.a.WRAP_ADDRESSMODE;\n            for (var e, n, i, o = this._grainTexture.getContext(), a = 0; a < 512; a++)\n              for (var s = 0; s < 512; s++)\n                e = Math.floor(255 * (n = 0.42, i = 0.58, Math.random() * (i - n) + n)), o.fillStyle = \"rgb(\" + e + \", \" + e + \", \" + e + \")\", o.fillRect(a, s, 1, 1);\n            this._grainTexture.update(!1);\n          }, t;\n        }(Ir), qm = function() {\n          this.enabled = !1, this.name = \"ssao2\", this.texturesRequired = [h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE];\n        }, Zm = `\nprecision highp float;\nuniform sampler2D textureSampler;\nuniform float near;\nuniform float far;\nuniform float radius;\nfloat scales[16]=float[16](\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);\nvarying vec2 vUV;\nfloat perspectiveDepthToViewZ( const in float invClipZ,const in float near,const in float far ) {\nreturn ( near*far )/( ( far-near )*invClipZ-far );\n}\nfloat viewZToPerspectiveDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( near*far/viewZ+far)/( far-near );\n}\nfloat viewZToOrthographicDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( viewZ+near )/( near-far );\n}\n#ifdef SSAO\nuniform sampler2D randomSampler;\n#ifndef GEOMETRYBUFFER\nuniform sampler2D depthNormalSampler;\n#else\nuniform sampler2D depthSampler;\nuniform sampler2D normalSampler;\n#endif\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float base;\nuniform float xViewport;\nuniform float yViewport;\nuniform float maxZ;\nuniform float minZAspect;\nuniform vec2 texelSize;\nuniform mat4 projection;\nvoid main()\n{\nvec3 random=texture2D(randomSampler,vUV*randTextureTiles).rgb;\n#ifndef GEOMETRYBUFFER\nfloat depth=texture2D(depthNormalSampler,vUV).r;\n#else\nfloat depth=texture2D(depthSampler,vUV).r;\n#endif\nfloat depthSign=depth/abs(depth);\ndepth=depth*depthSign;\n#ifndef GEOMETRYBUFFER\nvec3 normal=texture2D(depthNormalSampler,vUV).gba;\n#else\nvec3 normal=texture2D(normalSampler,vUV).rgb;\n#endif\nfloat occlusion=0.0;\nfloat correctedRadius=min(radius,minZAspect*depth/near);\nvec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);\nvec3 origin=vViewRay*depth;\nvec3 rvec=random*2.0-1.0;\nrvec.z=0.0;\n\nfloat dotProduct=dot(rvec,normal);\nrvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);\nvec3 tangent=normalize(rvec-normal*dot(rvec,normal));\nvec3 bitangent=cross(normal,tangent);\nmat3 tbn=mat3(tangent,bitangent,normal);\nfloat difference;\nfor (int i=0; i<SAMPLES; ++i) {\n\nvec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];\nsamplePosition=samplePosition*correctedRadius+origin;\n\nvec4 offset=vec4(samplePosition,1.0);\noffset=projection*offset;\noffset.xyz/=offset.w;\noffset.xy=offset.xy*0.5+0.5;\nif (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {\ncontinue;\n}\n\n#ifndef GEOMETRYBUFFER\nfloat sampleDepth=abs(texture2D(depthNormalSampler,offset.xy).r);\n#else\nfloat sampleDepth=abs(texture2D(depthSampler,offset.xy).r);\n#endif\n\ndifference=depthSign*samplePosition.z-sampleDepth;\nfloat rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);\nocclusion+=(difference>=0.0 ? 1.0 : 0.0)*rangeCheck;\n}\nocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor=vec4(vec3(result),1.0);\n}\n#endif\n#ifdef BILATERAL_BLUR\nuniform sampler2D depthNormalSampler;\nuniform float outSize;\nuniform float samplerOffsets[SAMPLES];\nvec4 blur9(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.3846153846)*direction;\nvec2 off2=vec2(3.2307692308)*direction;\ncolor+=texture2D(image,uv)*0.2270270270;\ncolor+=texture2D(image,uv+(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv-(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv+(off2/resolution))*0.0702702703;\ncolor+=texture2D(image,uv-(off2/resolution))*0.0702702703;\nreturn color;\n}\nvec4 blur13(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\ncolor+=texture2D(image,uv)*0.1964825501511404;\ncolor+=texture2D(image,uv+(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv-(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv+(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv-(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv+(off3/resolution))*0.010381362401148057;\ncolor+=texture2D(image,uv-(off3/resolution))*0.010381362401148057;\nreturn color;\n}\nvec4 blur13Bilateral(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\nfloat compareDepth=abs(texture2D(depthNormalSampler,uv).r);\nfloat sampleDepth;\nfloat weight;\nfloat weightSum=30.0;\ncolor+=texture2D(image,uv)*30.0;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off3/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off3/resolution))*weight;\nreturn color/weightSum;\n}\nvoid main()\n{\n#if EXPENSIVE\nfloat compareDepth=abs(texture2D(depthNormalSampler,vUV).r);\nfloat texelsize=1.0/outSize;\nfloat result=0.0;\nfloat weightSum=0.0;\nfor (int i=0; i<SAMPLES; ++i)\n{\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\nvec2 sampleOffset=vec2(texelsize*samplerOffsets[i],0.0);\n#else\nvec2 direction=vec2(0.0,1.0);\nvec2 sampleOffset=vec2(0.0,texelsize*samplerOffsets[i]);\n#endif\nvec2 samplePos=vUV+sampleOffset;\nfloat sampleDepth=abs(texture2D(depthNormalSampler,samplePos).r);\nfloat weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30000.0);\nresult+=texture2D(textureSampler,samplePos).r*weight;\nweightSum+=weight;\n}\nresult/=weightSum;\ngl_FragColor.rgb=vec3(result);\ngl_FragColor.a=1.0;\n#else\nvec4 color;\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#else\nvec2 direction=vec2(0.0,1.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#endif\ngl_FragColor.rgb=vec3(color.r);\ngl_FragColor.a=1.0;\n#endif\n}\n#endif\n`;\n        ze.a.ShadersStore.ssao2PixelShader = Zm;\n        var Jm = `uniform sampler2D textureSampler;\nuniform sampler2D originalColor;\nuniform vec4 viewport;\nvarying vec2 vUV;\nvoid main(void) {\nvec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);\nvec4 sceneColor=texture2D(originalColor,vUV);\ngl_FragColor=sceneColor*ssaoColor;\n}\n`;\n        ze.a.ShadersStore.ssaoCombinePixelShader = Jm;\n        var Ad = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = !0);\n            var s = r.call(this, n.getEngine(), e) || this;\n            if (s.SSAOOriginalSceneColorEffect = \"SSAOOriginalSceneColorEffect\", s.SSAORenderEffect = \"SSAORenderEffect\", s.SSAOBlurHRenderEffect = \"SSAOBlurHRenderEffect\", s.SSAOBlurVRenderEffect = \"SSAOBlurVRenderEffect\", s.SSAOCombineRenderEffect = \"SSAOCombineRenderEffect\", s.totalStrength = 1, s.maxZ = 100, s.minZAspect = 0.2, s._samples = 8, s._textureSamples = 1, s._forceGeometryBuffer = !1, s._expensiveBlur = !0, s.radius = 2, s.base = 0, s._bits = new Uint32Array(1), s._scene = n, s._ratio = i, s._forceGeometryBuffer = a, !s.isSupported)\n              return l.a.Error(\"SSAO 2 needs WebGL 2 support.\"), s;\n            var d = s._ratio.ssaoRatio || i, p = s._ratio.blurRatio || i;\n            return s._forceGeometryBuffer ? n.enableGeometryBufferRenderer() : s._prePassRenderer = n.enablePrePassRenderer(), s._createRandomTexture(), s._originalColorPostProcess = new Ci(\"SSAOOriginalSceneColor\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, n.getEngine(), !1), s._originalColorPostProcess.samples = s.textureSamples, s._createSSAOPostProcess(1), s._createBlurPostProcess(d, p), s._createSSAOCombinePostProcess(p), s.addEffect(new xt(n.getEngine(), s.SSAOOriginalSceneColorEffect, function() {\n              return s._originalColorPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAORenderEffect, function() {\n              return s._ssaoPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAOBlurHRenderEffect, function() {\n              return s._blurHPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAOBlurVRenderEffect, function() {\n              return s._blurVPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAOCombineRenderEffect, function() {\n              return s._ssaoCombinePostProcess;\n            }, !0)), n.postProcessRenderPipelineManager.addPipeline(s), o && n.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, o), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples = e, this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()), this._sampleSphere = this._generateHemisphere();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"textureSamples\", { get: function() {\n            return this._textureSamples;\n          }, set: function(e) {\n            this._textureSamples = e, this._originalColorPostProcess.samples = e, this._blurHPostProcess.samples = e, this._blurVPostProcess.samples = e, this._ssaoPostProcess.samples = e, this._ssaoCombinePostProcess.samples = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"expensiveBlur\", { get: function() {\n            return this._expensiveBlur;\n          }, set: function(e) {\n            this._blurHPostProcess.updateEffect(`#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE ` + (e ? \"1\" : \"0\") + `\n`, null, [\"textureSampler\", \"depthNormalSampler\"]), this._blurVPostProcess.updateEffect(`#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE ` + (e ? \"1\" : \"0\") + `\n`, null, [\"textureSampler\", \"depthNormalSampler\"]), this._expensiveBlur = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsSupported\", { get: function() {\n            var e = te.a.LastCreatedEngine;\n            return !!e && e.webGLVersion >= 2;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"SSAO2RenderingPipeline\";\n          }, t.prototype.dispose = function(e) {\n            e === void 0 && (e = !1);\n            for (var n = 0; n < this._scene.cameras.length; n++) {\n              var i = this._scene.cameras[n];\n              this._originalColorPostProcess.dispose(i), this._ssaoPostProcess.dispose(i), this._blurHPostProcess.dispose(i), this._blurVPostProcess.dispose(i), this._ssaoCombinePostProcess.dispose(i);\n            }\n            this._randomTexture.dispose(), e && this._scene.disableGeometryBufferRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), r.prototype.dispose.call(this);\n          }, t.prototype._createBlurPostProcess = function(e, n) {\n            var i = this;\n            this._samplerOffsets = [];\n            for (var o = this.expensiveBlur, a = -8; a < 8; a++)\n              this._samplerOffsets.push(2 * a + 0.5);\n            this._blurHPostProcess = new ft(\"BlurH\", \"ssao2\", [\"outSize\", \"samplerOffsets\", \"near\", \"far\", \"radius\"], [\"depthNormalSampler\"], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE ` + (o ? \"1\" : \"0\") + `\n`), this._blurHPostProcess.onApply = function(s) {\n              i._scene.activeCamera && (s.setFloat(\"outSize\", i._ssaoCombinePostProcess.width > 0 ? i._ssaoCombinePostProcess.width : i._originalColorPostProcess.width), s.setFloat(\"near\", i._scene.activeCamera.minZ), s.setFloat(\"far\", i._scene.activeCamera.maxZ), s.setFloat(\"radius\", i.radius), i._forceGeometryBuffer ? s.setTexture(\"depthNormalSampler\", i._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]) : s.setTexture(\"depthNormalSampler\", i._prePassRenderer.prePassRT.textures[i._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), s.setArray(\"samplerOffsets\", i._samplerOffsets));\n            }, this._blurVPostProcess = new ft(\"BlurV\", \"ssao2\", [\"outSize\", \"samplerOffsets\", \"near\", \"far\", \"radius\"], [\"depthNormalSampler\"], n, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE ` + (o ? \"1\" : \"0\") + `\n`), this._blurVPostProcess.onApply = function(s) {\n              i._scene.activeCamera && (s.setFloat(\"outSize\", i._ssaoCombinePostProcess.height > 0 ? i._ssaoCombinePostProcess.height : i._originalColorPostProcess.height), s.setFloat(\"near\", i._scene.activeCamera.minZ), s.setFloat(\"far\", i._scene.activeCamera.maxZ), s.setFloat(\"radius\", i.radius), i._forceGeometryBuffer ? s.setTexture(\"depthNormalSampler\", i._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]) : s.setTexture(\"depthNormalSampler\", i._prePassRenderer.prePassRT.textures[i._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), s.setArray(\"samplerOffsets\", i._samplerOffsets));\n            }, this._blurHPostProcess.samples = this.textureSamples, this._blurVPostProcess.samples = this.textureSamples;\n          }, t.prototype._rebuild = function() {\n            r.prototype._rebuild.call(this);\n          }, t.prototype._radicalInverse_VdC = function(e) {\n            return this._bits[0] = e, this._bits[0] = (this._bits[0] << 16 | this._bits[0] >> 16) >>> 0, this._bits[0] = (1431655765 & this._bits[0]) << 1 | (2863311530 & this._bits[0]) >>> 1 >>> 0, this._bits[0] = (858993459 & this._bits[0]) << 2 | (3435973836 & this._bits[0]) >>> 2 >>> 0, this._bits[0] = (252645135 & this._bits[0]) << 4 | (4042322160 & this._bits[0]) >>> 4 >>> 0, this._bits[0] = (16711935 & this._bits[0]) << 8 | (4278255360 & this._bits[0]) >>> 8 >>> 0, 23283064365386963e-26 * this._bits[0];\n          }, t.prototype._hammersley = function(e, n) {\n            return [e / n, this._radicalInverse_VdC(e)];\n          }, t.prototype._hemisphereSample_uniform = function(e, n) {\n            var i = 2 * n * Math.PI, o = 1 - (0.85 * e + 0.15), a = Math.sqrt(1 - o * o);\n            return new u.e(Math.cos(i) * a, Math.sin(i) * a, o);\n          }, t.prototype._generateHemisphere = function() {\n            for (var e, n = this.samples, i = [], o = 0; o < n; ) {\n              if (n < 16)\n                e = this._hemisphereSample_uniform(Math.random(), Math.random());\n              else {\n                var a = this._hammersley(o, n);\n                e = this._hemisphereSample_uniform(a[0], a[1]);\n              }\n              i.push(e.x, e.y, e.z), o++;\n            }\n            return i;\n          }, t.prototype._getDefinesForSSAO = function() {\n            var e = \"#define SAMPLES \" + this.samples + `\n#define SSAO`;\n            return this._forceGeometryBuffer && (e += `\n#define GEOMETRYBUFFER`), e;\n          }, t.prototype._createSSAOPostProcess = function(e) {\n            var n = this;\n            this._sampleSphere = this._generateHemisphere();\n            var i, o = this._getDefinesForSSAO();\n            i = this._forceGeometryBuffer ? [\"randomSampler\", \"depthSampler\", \"normalSampler\"] : [\"randomSampler\", \"depthNormalSampler\"], this._ssaoPostProcess = new ft(\"ssao2\", \"ssao2\", [\"sampleSphere\", \"samplesFactor\", \"randTextureTiles\", \"totalStrength\", \"radius\", \"base\", \"range\", \"projection\", \"near\", \"far\", \"texelSize\", \"xViewport\", \"yViewport\", \"maxZ\", \"minZAspect\"], i, e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._ssaoPostProcess.onApply = function(a) {\n              n._scene.activeCamera && (a.setArray3(\"sampleSphere\", n._sampleSphere), a.setFloat(\"randTextureTiles\", 32), a.setFloat(\"samplesFactor\", 1 / n.samples), a.setFloat(\"totalStrength\", n.totalStrength), a.setFloat2(\"texelSize\", 1 / n._ssaoPostProcess.width, 1 / n._ssaoPostProcess.height), a.setFloat(\"radius\", n.radius), a.setFloat(\"maxZ\", n.maxZ), a.setFloat(\"minZAspect\", n.minZAspect), a.setFloat(\"base\", n.base), a.setFloat(\"near\", n._scene.activeCamera.minZ), a.setFloat(\"far\", n._scene.activeCamera.maxZ), a.setFloat(\"xViewport\", Math.tan(n._scene.activeCamera.fov / 2) * n._scene.getEngine().getAspectRatio(n._scene.activeCamera, !0)), a.setFloat(\"yViewport\", Math.tan(n._scene.activeCamera.fov / 2)), a.setMatrix(\"projection\", n._scene.getProjectionMatrix()), n._forceGeometryBuffer ? (a.setTexture(\"depthSampler\", n._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]), a.setTexture(\"normalSampler\", n._scene.enableGeometryBufferRenderer().getGBuffer().textures[1])) : a.setTexture(\"depthNormalSampler\", n._prePassRenderer.prePassRT.textures[n._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), a.setTexture(\"randomSampler\", n._randomTexture));\n            }, this._ssaoPostProcess.samples = this.textureSamples;\n          }, t.prototype._createSSAOCombinePostProcess = function(e) {\n            var n = this;\n            this._ssaoCombinePostProcess = new ft(\"ssaoCombine\", \"ssaoCombine\", [], [\"originalColor\", \"viewport\"], e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = function(i) {\n              var o = n._scene.activeCamera.viewport;\n              i.setVector4(\"viewport\", u.c.Vector4[0].copyFromFloats(o.x, o.y, o.width, o.height)), i.setTextureFromPostProcessOutput(\"originalColor\", n._originalColorPostProcess);\n            }, this._ssaoCombinePostProcess.samples = this.textureSamples, this._forceGeometryBuffer || (this._ssaoCombinePostProcess._prePassEffectConfiguration = new qm());\n          }, t.prototype._createRandomTexture = function() {\n            this._randomTexture = new pi.a(\"SSAORandomTexture\", 128, this._scene, !1, Ne.a.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = Ne.a.WRAP_ADDRESSMODE, this._randomTexture.wrapV = Ne.a.WRAP_ADDRESSMODE;\n            for (var e = this._randomTexture.getContext(), n = function(s, d) {\n              return Math.random() * (d - s) + s;\n            }, i = u.e.Zero(), o = 0; o < 128; o++)\n              for (var a = 0; a < 128; a++)\n                i.x = n(0, 1), i.y = n(0, 1), i.z = 0, i.normalize(), i.scaleInPlace(255), i.x = Math.floor(i.x), i.y = Math.floor(i.y), e.fillStyle = \"rgb(\" + i.x + \", \" + i.y + \", \" + i.z + \")\", e.fillRect(o, a, 1, 1);\n            this._randomTexture.update(!1);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"SSAO2RenderingPipeline\", e;\n          }, t.Parse = function(e, n, i) {\n            return L.a.Parse(function() {\n              return new t(e._name, n, e._ratio);\n            }, e, n, i);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"totalStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"maxZ\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"minZAspect\", void 0), Object(c.c)([Object(L.c)(\"samples\")], t.prototype, \"_samples\", void 0), Object(c.c)([Object(L.c)(\"textureSamples\")], t.prototype, \"_textureSamples\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_ratio\", void 0), Object(c.c)([Object(L.c)(\"expensiveBlur\")], t.prototype, \"_expensiveBlur\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"base\", void 0), t;\n        }(Ir);\n        O.a.RegisteredTypes[\"BABYLON.SSAO2RenderingPipeline\"] = Ad;\n        var $m = `\nuniform sampler2D textureSampler;\nvarying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float radius;\nuniform float area;\nuniform float fallOff;\nuniform float base;\nvec3 normalFromDepth(float depth,vec2 coords)\n{\nvec2 offset1=vec2(0.0,radius);\nvec2 offset2=vec2(radius,0.0);\nfloat depth1=texture2D(textureSampler,coords+offset1).r;\nfloat depth2=texture2D(textureSampler,coords+offset2).r;\nvec3 p1=vec3(offset1,depth1-depth);\nvec3 p2=vec3(offset2,depth2-depth);\nvec3 normal=cross(p1,p2);\nnormal.z=-normal.z;\nreturn normalize(normal);\n}\nvoid main()\n{\nvec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);\nfloat depth=texture2D(textureSampler,vUV).r;\nvec3 position=vec3(vUV,depth);\nvec3 normal=normalFromDepth(depth,vUV);\nfloat radiusDepth=radius/depth;\nfloat occlusion=0.0;\nvec3 ray;\nvec3 hemiRay;\nfloat occlusionDepth;\nfloat difference;\nfor (int i=0; i<SAMPLES; i++)\n{\nray=radiusDepth*reflect(sampleSphere[i],random);\nhemiRay=position+sign(dot(ray,normal))*ray;\nocclusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;\ndifference=depth-occlusionDepth;\nocclusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));\n}\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor.r=result;\ngl_FragColor.g=result;\ngl_FragColor.b=result;\ngl_FragColor.a=1.0;\n}\n#endif\n`;\n        ze.a.ShadersStore.ssaoPixelShader = $m;\n        var eg = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, n.getEngine(), e) || this;\n            a.SSAOOriginalSceneColorEffect = \"SSAOOriginalSceneColorEffect\", a.SSAORenderEffect = \"SSAORenderEffect\", a.SSAOBlurHRenderEffect = \"SSAOBlurHRenderEffect\", a.SSAOBlurVRenderEffect = \"SSAOBlurVRenderEffect\", a.SSAOCombineRenderEffect = \"SSAOCombineRenderEffect\", a.totalStrength = 1, a.radius = 1e-4, a.area = 75e-4, a.fallOff = 1e-6, a.base = 0.5, a._firstUpdate = !0, a._scene = n, a._createRandomTexture(), a._depthTexture = n.enableDepthRenderer().getDepthMap();\n            var s = i.ssaoRatio || i, d = i.combineRatio || i;\n            return a._originalColorPostProcess = new Ci(\"SSAOOriginalSceneColor\", d, null, Ne.a.BILINEAR_SAMPLINGMODE, n.getEngine(), !1), a._createSSAOPostProcess(s), a._createBlurPostProcess(s), a._createSSAOCombinePostProcess(d), a.addEffect(new xt(n.getEngine(), a.SSAOOriginalSceneColorEffect, function() {\n              return a._originalColorPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAORenderEffect, function() {\n              return a._ssaoPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAOBlurHRenderEffect, function() {\n              return a._blurHPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAOBlurVRenderEffect, function() {\n              return a._blurVPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAOCombineRenderEffect, function() {\n              return a._ssaoCombinePostProcess;\n            }, !0)), n.postProcessRenderPipelineManager.addPipeline(a), o && n.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, o), a;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"SSAORenderingPipeline\";\n          }, t.prototype.dispose = function(e) {\n            e === void 0 && (e = !1);\n            for (var n = 0; n < this._scene.cameras.length; n++) {\n              var i = this._scene.cameras[n];\n              this._originalColorPostProcess.dispose(i), this._ssaoPostProcess.dispose(i), this._blurHPostProcess.dispose(i), this._blurVPostProcess.dispose(i), this._ssaoCombinePostProcess.dispose(i);\n            }\n            this._randomTexture.dispose(), e && this._scene.disableDepthRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), r.prototype.dispose.call(this);\n          }, t.prototype._createBlurPostProcess = function(e) {\n            var n = this;\n            this._blurHPostProcess = new _n(\"BlurH\", new u.d(1, 0), 16, e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT), this._blurVPostProcess = new _n(\"BlurV\", new u.d(0, 1), 16, e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT), this._blurHPostProcess.onActivateObservable.add(function() {\n              var i = n._blurHPostProcess.width / n._scene.getEngine().getRenderWidth();\n              n._blurHPostProcess.kernel = 16 * i;\n            }), this._blurVPostProcess.onActivateObservable.add(function() {\n              var i = n._blurVPostProcess.height / n._scene.getEngine().getRenderHeight();\n              n._blurVPostProcess.kernel = 16 * i;\n            });\n          }, t.prototype._rebuild = function() {\n            this._firstUpdate = !0, r.prototype._rebuild.call(this);\n          }, t.prototype._createSSAOPostProcess = function(e) {\n            var n = this, i = [0.5381, 0.1856, -0.4319, 0.1379, 0.2486, 0.443, 0.3371, 0.5679, -57e-4, -0.6999, -0.0451, -19e-4, 0.0689, -0.1598, -0.8547, 0.056, 69e-4, -0.1843, -0.0146, 0.1402, 0.0762, 0.01, -0.1924, -0.0344, -0.3577, -0.5301, -0.4358, -0.3169, 0.1063, 0.0158, 0.0103, -0.5869, 46e-4, -0.0897, -0.494, 0.3287, 0.7119, -0.0154, -0.0918, -0.0533, 0.0596, -0.5411, 0.0352, -0.0631, 0.546, -0.4776, 0.2847, -0.0271];\n            this._ssaoPostProcess = new ft(\"ssao\", \"ssao\", [\"sampleSphere\", \"samplesFactor\", \"randTextureTiles\", \"totalStrength\", \"radius\", \"area\", \"fallOff\", \"base\", \"range\", \"viewport\"], [\"randomSampler\"], e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define SAMPLES 16\n#define SSAO`), this._ssaoPostProcess.onApply = function(o) {\n              n._firstUpdate && (o.setArray3(\"sampleSphere\", i), o.setFloat(\"samplesFactor\", 1 / 16), o.setFloat(\"randTextureTiles\", 4)), o.setFloat(\"totalStrength\", n.totalStrength), o.setFloat(\"radius\", n.radius), o.setFloat(\"area\", n.area), o.setFloat(\"fallOff\", n.fallOff), o.setFloat(\"base\", n.base), o.setTexture(\"textureSampler\", n._depthTexture), o.setTexture(\"randomSampler\", n._randomTexture);\n            };\n          }, t.prototype._createSSAOCombinePostProcess = function(e) {\n            var n = this;\n            this._ssaoCombinePostProcess = new ft(\"ssaoCombine\", \"ssaoCombine\", [], [\"originalColor\", \"viewport\"], e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = function(i) {\n              i.setVector4(\"viewport\", u.c.Vector4[0].copyFromFloats(0, 0, 1, 1)), i.setTextureFromPostProcess(\"originalColor\", n._originalColorPostProcess);\n            };\n          }, t.prototype._createRandomTexture = function() {\n            this._randomTexture = new pi.a(\"SSAORandomTexture\", 512, this._scene, !1, Ne.a.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = Ne.a.WRAP_ADDRESSMODE, this._randomTexture.wrapV = Ne.a.WRAP_ADDRESSMODE;\n            for (var e = this._randomTexture.getContext(), n = function(s, d) {\n              return Math.random() * (d - s) + s;\n            }, i = u.e.Zero(), o = 0; o < 512; o++)\n              for (var a = 0; a < 512; a++)\n                i.x = Math.floor(255 * n(-1, 1)), i.y = Math.floor(255 * n(-1, 1)), i.z = Math.floor(255 * n(-1, 1)), e.fillStyle = \"rgb(\" + i.x + \", \" + i.y + \", \" + i.z + \")\", e.fillRect(o, a, 1, 1);\n            this._randomTexture.update(!1);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"totalStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"area\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"fallOff\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"base\", void 0), t;\n        }(Ir), tg = function() {\n          this.enabled = !1, this.name = \"screenSpaceReflections\", this.texturesRequired = [h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, h.a.PREPASS_POSITION_TEXTURE_TYPE];\n        }, ng = `\n\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform sampler2D positionSampler;\nuniform sampler2D reflectivitySampler;\nuniform mat4 view;\nuniform mat4 projection;\nuniform float step;\nuniform float strength;\nuniform float threshold;\nuniform float roughnessFactor;\nuniform float reflectionSpecularFalloffExponent;\n\nvarying vec2 vUV;\n\nstruct ReflectionInfo {\nvec3 color;\nvec4 coords;\n};\n\nvec3 fresnelSchlick(float cosTheta,vec3 F0)\n{\nreturn F0+(1.0-F0)*pow(1.0-cosTheta,5.0);\n}\n\nReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\ninfo.color=vec3(0.0);\nvec4 projectedCoord;\nfloat sampledDepth;\nfor(int i=0; i<SMOOTH_STEPS; i++)\n{\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\ndir*=0.5;\nif(depth>0.0)\nhitCoord-=dir;\nelse\nhitCoord+=dir;\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\n}\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\n\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,1.0);\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.color/=float(SMOOTH_STEPS+1);\nreturn info;\n}\n\nReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\nvec4 projectedCoord;\nfloat sampledDepth;\ndir*=step;\nfor(int i=0; i<REFLECTION_SAMPLES; i++)\n{\nhitCoord+=dir;\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\nif(((depth-dir.z)<threshold) && depth<=0.0)\n{\n#ifdef ENABLE_SMOOTH_REFLECTIONS\nreturn smoothReflectionInfo(dir,hitCoord);\n#else\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n#endif\n}\n}\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n}\nvec3 hash(vec3 a)\n{\na=fract(a*0.8);\na+=dot(a,a.yxz+19.19);\nreturn fract((a.xxy+a.yxx)*a.zyx);\n}\nvoid main()\n{\n#ifdef SSR_SUPPORTED\n\nvec4 albedoFull=texture2D(textureSampler,vUV);\nvec3 albedo=albedoFull.rgb;\nfloat spec=texture2D(reflectivitySampler,vUV).r;\nif (spec == 0.0) {\ngl_FragColor=albedoFull;\nreturn;\n}\n\n#ifdef PREPASS_LAYOUT\nvec3 normal=(texture2D(normalSampler,vUV)).gba;\n#else\nvec3 normal=(texture2D(normalSampler,vUV)).xyz;\n#endif\nvec3 position=(view*texture2D(positionSampler,vUV)).xyz;\nvec3 reflected=normalize(reflect(normalize(position),normalize(normal)));\nfloat roughness=1.0-texture2D(reflectivitySampler,vUV).a;\nvec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;\nReflectionInfo info=getReflectionInfo(jitt+reflected,position);\n\nvec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));\nfloat screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\n\nvec3 F0=vec3(0.04);\nF0=mix(F0,albedo,spec);\nvec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);\n\nfloat reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);\nfloat albedoMultiplier=1.0-reflectionMultiplier;\nvec3 SSR=info.color*fresnel;\ngl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n`;\n        ze.a.ShadersStore.screenSpaceReflectionPixelShader = ng;\n        var Dc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1), P === void 0 && (P = !0);\n            var R = r.call(this, e, \"screenSpaceReflection\", [\"projection\", \"view\", \"threshold\", \"reflectionSpecularFalloffExponent\", \"strength\", \"step\", \"roughnessFactor\"], [\"textureSampler\", \"normalSampler\", \"positionSampler\", \"reflectivitySampler\"], i, o, a, s, d, `#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n`, p, void 0, null, y) || this;\n            if (R.threshold = 1.2, R.strength = 1, R.reflectionSpecularFalloffExponent = 3, R.step = 1, R.roughnessFactor = 0.2, R._forceGeometryBuffer = !1, R._enableSmoothReflections = !1, R._reflectionSamples = 64, R._smoothSteps = 5, R._forceGeometryBuffer = P, R._forceGeometryBuffer) {\n              var B = n.enableGeometryBufferRenderer();\n              B && B.isSupported && (B.enablePosition = !0, B.enableReflectivity = !0, R._geometryBufferRenderer = B);\n            } else\n              R._prePassRenderer = n.enablePrePassRenderer(), R._prePassRenderer.markAsDirty(), R._prePassEffectConfiguration = new tg();\n            return R._updateEffectDefines(), R.onApply = function(F) {\n              var z = R._geometryBufferRenderer, J = R._prePassRenderer;\n              if (J || z) {\n                if (z) {\n                  var ie = z.getTextureIndex(ri.POSITION_TEXTURE_TYPE), se = z.getTextureIndex(ri.REFLECTIVITY_TEXTURE_TYPE);\n                  F.setTexture(\"normalSampler\", z.getGBuffer().textures[1]), F.setTexture(\"positionSampler\", z.getGBuffer().textures[ie]), F.setTexture(\"reflectivitySampler\", z.getGBuffer().textures[se]);\n                } else {\n                  ie = J.getIndex(h.a.PREPASS_POSITION_TEXTURE_TYPE), se = J.getIndex(h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE);\n                  var ce = J.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE);\n                  F.setTexture(\"normalSampler\", J.prePassRT.textures[ce]), F.setTexture(\"positionSampler\", J.prePassRT.textures[ie]), F.setTexture(\"reflectivitySampler\", J.prePassRT.textures[se]);\n                }\n                var ue = n.activeCamera;\n                if (ue) {\n                  var fe = ue.getViewMatrix(), ve = ue.getProjectionMatrix();\n                  F.setMatrix(\"projection\", ve), F.setMatrix(\"view\", fe), F.setFloat(\"threshold\", R.threshold), F.setFloat(\"reflectionSpecularFalloffExponent\", R.reflectionSpecularFalloffExponent), F.setFloat(\"strength\", R.strength), F.setFloat(\"step\", R.step), F.setFloat(\"roughnessFactor\", R.roughnessFactor);\n                }\n              }\n            }, R;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScreenSpaceReflectionPostProcess\";\n          }, Object.defineProperty(t.prototype, \"enableSmoothReflections\", { get: function() {\n            return this._enableSmoothReflections;\n          }, set: function(e) {\n            e !== this._enableSmoothReflections && (this._enableSmoothReflections = e, this._updateEffectDefines());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflectionSamples\", { get: function() {\n            return this._reflectionSamples;\n          }, set: function(e) {\n            e !== this._reflectionSamples && (this._reflectionSamples = e, this._updateEffectDefines());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"smoothSteps\", { get: function() {\n            return this._smoothSteps;\n          }, set: function(e) {\n            e !== this._smoothSteps && (this._smoothSteps = e, this._updateEffectDefines());\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateEffectDefines = function() {\n            var e = [];\n            (this._geometryBufferRenderer || this._prePassRenderer) && (e.push(\"#define SSR_SUPPORTED\"), this._prePassRenderer && e.push(\"#define PREPASS_LAYOUT\")), this._enableSmoothReflections && e.push(\"#define ENABLE_SMOOTH_REFLECTIONS\"), e.push(\"#define REFLECTION_SAMPLES \" + (this._reflectionSamples >> 0)), e.push(\"#define SMOOTH_STEPS \" + (this._smoothSteps >> 0)), this.updateEffect(e.join(`\n`));\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, i, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.textureType, e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"threshold\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"strength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"reflectionSpecularFalloffExponent\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"step\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"roughnessFactor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"enableSmoothReflections\", null), Object(c.c)([Object(L.c)()], t.prototype, \"reflectionSamples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"smoothSteps\", null), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ScreenSpaceReflectionPostProcess\"] = Dc;\n        var ig = `uniform sampler2D textureSampler;\nvarying vec2 vUV;\n#if defined(PASS_POST_PROCESS)\nvoid main(void)\n{\nvec4 color=texture2D(textureSampler,vUV);\ngl_FragColor=color;\n}\n#endif\n#if defined(DOWN_SAMPLE_X4)\nuniform vec2 dsOffsets[16];\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+dsOffsets[0]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[1]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[2]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[3]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[4]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[5]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[6]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[7]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[8]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[9]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[10]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[11]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[12]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[13]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[14]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[15]);\naverage/=16.0;\ngl_FragColor=average;\n}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];\nuniform float brightThreshold;\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));\naverage*=0.25;\nfloat luminance=length(average.rgb);\nif (luminance<brightThreshold) {\naverage=vec4(0.0,0.0,0.0,1.0);\n}\ngl_FragColor=average;\n}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;\nuniform sampler2D lensSampler;\nuniform float exposure;\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\ncolour*=exposure;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\ncolour+=colour*texture2D(lensSampler,vUV).rgb;\nvec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);\ngl_FragColor=finalColor;\n}\n#endif\n#if defined(VLS)\n#define PI 3.1415926535897932384626433832795\nuniform mat4 shadowViewProjection;\nuniform mat4 lightWorld;\nuniform vec3 cameraPosition;\nuniform vec3 sunDirection;\nuniform vec3 sunColor;\nuniform vec2 depthValues;\nuniform float scatteringCoefficient;\nuniform float scatteringPower;\nuniform sampler2D shadowMapSampler;\nuniform sampler2D positionSampler;\nfloat computeScattering(float lightDotView)\n{\nfloat result=1.0-scatteringCoefficient*scatteringCoefficient;\nresult/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));\nreturn result;\n}\nvoid main(void)\n{\n\nvec3 worldPos=texture2D(positionSampler,vUV).rgb;\nvec3 startPosition=cameraPosition;\nvec3 rayVector=worldPos-startPosition;\nfloat rayLength=length(rayVector);\nvec3 rayDirection=rayVector/rayLength;\nfloat stepLength=rayLength/NB_STEPS;\nvec3 stepL=rayDirection*stepLength;\nvec3 currentPosition=startPosition;\nvec3 accumFog=vec3(0.0);\nfor (int i=0; i<int(NB_STEPS); i++)\n{\nvec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);\nfloat depthMetric=(worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depthMetric,0.0,1.0);\nworldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;\nworldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);\nfloat shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;\nif (shadowMapValue>shadowPixelDepth)\naccumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));\ncurrentPosition+=stepL;\n}\naccumFog/=NB_STEPS;\nvec3 color=accumFog*scatteringPower;\ngl_FragColor=vec4(color*exp(color) ,1.0);\n}\n#endif\n#if defined(VLSMERGE)\nuniform sampler2D originalSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);\n}\n#endif\n#if defined(LUMINANCE)\nuniform vec2 lumOffsets[4];\nvoid main()\n{\nfloat average=0.0;\nvec4 color=vec4(0.0);\nfloat maximum=-1e20;\nvec3 weight=vec3(0.299,0.587,0.114);\nfor (int i=0; i<4; i++)\n{\ncolor=texture2D(textureSampler,vUV+ lumOffsets[i]);\n\nfloat GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));\n\n#ifdef WEIGHTED_AVERAGE\nfloat GreyValue=dot(color.rgb,weight);\n#endif\n#ifdef BRIGHTNESS\nfloat GreyValue=max(color.r,max(color.g,color.b));\n#endif\n#ifdef HSL_COMPONENT\nfloat GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));\n#endif\n#ifdef MAGNITUDE\nfloat GreyValue=length(color.rgb);\n#endif\nmaximum=max(maximum,GreyValue);\naverage+=(0.25*log(1e-5+GreyValue));\n}\naverage=exp(average);\ngl_FragColor=vec4(average,maximum,0.0,1.0);\n}\n#endif\n#if defined(LUMINANCE_DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];\nuniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLER\n#include<packingFunctions>\n#endif\nvoid main()\n{\nvec4 color=vec4(0.0);\nfloat average=0.0;\nfor (int i=0; i<9; i++)\n{\ncolor=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);\naverage+=color.r;\n}\naverage/=9.0;\n#ifdef FINAL_DOWN_SAMPLER\ngl_FragColor=pack(average);\n#else\ngl_FragColor=vec4(average,average,0.0,1.0);\n#endif\n}\n#endif\n#if defined(HDR)\nuniform sampler2D textureAdderSampler;\nuniform float averageLuminance;\nvoid main()\n{\nvec4 color=texture2D(textureAdderSampler,vUV);\n#ifndef AUTO_EXPOSURE\nvec4 adjustedColor=color/averageLuminance;\ncolor=adjustedColor;\ncolor.a=1.0;\n#endif\ngl_FragColor=color;\n}\n#endif\n#if defined(LENS_FLARE)\n#define GHOSTS 3\nuniform sampler2D lensColorSampler;\nuniform float strength;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform vec2 resolution;\nuniform float distortionStrength;\nfloat hash(vec2 p)\n{\nfloat h=dot(p,vec2(127.1,311.7));\nreturn -1.0+2.0*fract(sin(h)*43758.5453123);\n}\nfloat noise(in vec2 p)\n{\nvec2 i=floor(p);\nvec2 f=fract(p);\nvec2 u=f*f*(3.0-2.0*f);\nreturn mix(mix(hash(i+vec2(0.0,0.0)),\nhash(i+vec2(1.0,0.0)),u.x),\nmix(hash(i+vec2(0.0,1.0)),\nhash(i+vec2(1.0,1.0)),u.x),u.y);\n}\nfloat fbm(vec2 p)\n{\nfloat f=0.0;\nf+=0.5000*noise(p); p*=2.02;\nf+=0.2500*noise(p); p*=2.03;\nf+=0.1250*noise(p); p*=2.01;\nf+=0.0625*noise(p); p*=2.04;\nf/=0.9375;\nreturn f;\n}\nvec3 pattern(vec2 uv)\n{\nvec2 p=-1.0+2.0*uv;\nfloat p2=dot(p,p);\nfloat f=fbm(vec2(15.0*p2))/2.0;\nfloat r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));\nfloat g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));\nfloat b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));\nreturn (1.0-f)*vec3(r,g,b);\n}\nfloat luminance(vec3 color)\n{\nreturn dot(color.rgb,vec3(0.2126,0.7152,0.0722));\n}\nvec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)\n{\nreturn vec4(\ntexture2D(tex,texcoord+direction*distortion.r).r,\ntexture2D(tex,texcoord+direction*distortion.g).g,\ntexture2D(tex,texcoord+direction*distortion.b).b,\n1.0\n);\n}\nvoid main(void)\n{\nvec2 uv=-vUV+vec2(1.0);\nvec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;\nvec2 texelSize=1.0/resolution;\nvec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);\nvec4 result=vec4(0.0);\nfloat ghostIndice=1.0;\nfor (int i=0; i<GHOSTS; ++i)\n{\nvec2 offset=fract(uv+ghostDir*ghostIndice);\nfloat weight=length(vec2(0.5)-offset)/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;\nghostIndice+=1.0;\n}\nvec2 haloVec=normalize(ghostDir)*haloWidth;\nfloat weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;\nresult*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));\ngl_FragColor=result;\n}\n#endif\n#if defined(LENS_FLARE_COMPOSE)\nuniform sampler2D otherSampler;\nuniform sampler2D lensDirtSampler;\nuniform sampler2D lensStarSampler;\nuniform mat4 lensStarMatrix;\nvoid main(void)\n{\nvec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;\nvec4 lensMod=texture2D(lensDirtSampler,vUV);\nlensMod+=texture2D(lensStarSampler,vUV);\nvec4 result=texture2D(textureSampler,vUV)*lensMod;\ngl_FragColor=texture2D(otherSampler,vUV)+result;\n}\n#endif\n#if defined(DEPTH_OF_FIELD)\nuniform sampler2D otherSampler;\nuniform sampler2D depthSampler;\nuniform float distance;\nvoid main(void)\n{\nvec4 sharp=texture2D(otherSampler,vUV);\nvec4 blur=texture2D(textureSampler,vUV);\nfloat dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);\nfloat factor=0.0;\nif (dist<0.05)\nfactor=1.0;\nelse if (dist<0.1)\nfactor=20.0*(0.1-dist);\nelse if (dist<0.5)\nfactor=0.0;\nelse\nfactor=2.0*(dist-0.5);\nfactor=clamp(factor,0.0,0.90);\ngl_FragColor=mix(sharp,blur,factor);\n}\n#endif\n#if defined(MOTION_BLUR)\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\nuniform vec2 screenSize;\nuniform float motionScale;\nuniform float motionStrength;\nuniform sampler2D depthSampler;\nvoid main(void)\n{\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n}\n#endif\n`;\n        ze.a.ShadersStore.standardPixelShader = ig;\n        var Pd = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = null);\n            var s = r.call(this, n.getEngine(), e) || this;\n            return s.downSampleX4PostProcess = null, s.brightPassPostProcess = null, s.blurHPostProcesses = [], s.blurVPostProcesses = [], s.textureAdderPostProcess = null, s.volumetricLightPostProcess = null, s.volumetricLightSmoothXPostProcess = null, s.volumetricLightSmoothYPostProcess = null, s.volumetricLightMergePostProces = null, s.volumetricLightFinalPostProcess = null, s.luminancePostProcess = null, s.luminanceDownSamplePostProcesses = [], s.hdrPostProcess = null, s.textureAdderFinalPostProcess = null, s.lensFlareFinalPostProcess = null, s.hdrFinalPostProcess = null, s.lensFlarePostProcess = null, s.lensFlareComposePostProcess = null, s.motionBlurPostProcess = null, s.depthOfFieldPostProcess = null, s.fxaaPostProcess = null, s.screenSpaceReflectionPostProcess = null, s.brightThreshold = 1, s.blurWidth = 512, s.horizontalBlur = !1, s.lensTexture = null, s.volumetricLightCoefficient = 0.2, s.volumetricLightPower = 4, s.volumetricLightBlurScale = 64, s.sourceLight = null, s.hdrMinimumLuminance = 1, s.hdrDecreaseRate = 0.5, s.hdrIncreaseRate = 0.5, s.lensColorTexture = null, s.lensFlareStrength = 20, s.lensFlareGhostDispersal = 1.4, s.lensFlareHaloWidth = 0.7, s.lensFlareDistortionStrength = 16, s.lensFlareBlurWidth = 512, s.lensStarTexture = null, s.lensFlareDirtTexture = null, s.depthOfFieldDistance = 10, s.depthOfFieldBlurWidth = 64, s.animations = [], s._currentDepthOfFieldSource = null, s._fixedExposure = 1, s._currentExposure = 1, s._hdrAutoExposure = !1, s._hdrCurrentLuminance = 1, s._motionStrength = 1, s._isObjectBasedMotionBlur = !1, s._camerasToBeAttached = [], s._bloomEnabled = !1, s._depthOfFieldEnabled = !1, s._vlsEnabled = !1, s._lensFlareEnabled = !1, s._hdrEnabled = !1, s._motionBlurEnabled = !1, s._fxaaEnabled = !1, s._screenSpaceReflectionsEnabled = !1, s._motionBlurSamples = 64, s._volumetricLightStepsCount = 50, s._samples = 1, s._cameras = a || n.cameras, s._cameras = s._cameras.slice(), s._camerasToBeAttached = s._cameras.slice(), s._scene = n, s._basePostProcess = o, s._ratio = i, s._floatTextureType = n.getEngine().getCaps().textureFloatRender ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_HALF_FLOAT, n.postProcessRenderPipelineManager.addPipeline(s), s._buildPipeline(), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"exposure\", { get: function() {\n            return this._fixedExposure;\n          }, set: function(e) {\n            this._fixedExposure = e, this._currentExposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hdrAutoExposure\", { get: function() {\n            return this._hdrAutoExposure;\n          }, set: function(e) {\n            if (this._hdrAutoExposure = e, this.hdrPostProcess) {\n              var n = [\"#define HDR\"];\n              e && n.push(\"#define AUTO_EXPOSURE\"), this.hdrPostProcess.updateEffect(n.join(`\n`));\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"motionStrength\", { get: function() {\n            return this._motionStrength;\n          }, set: function(e) {\n            this._motionStrength = e, this._isObjectBasedMotionBlur && this.motionBlurPostProcess && (this.motionBlurPostProcess.motionStrength = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"objectBasedMotionBlur\", { get: function() {\n            return this._isObjectBasedMotionBlur;\n          }, set: function(e) {\n            var n = this._isObjectBasedMotionBlur !== e;\n            this._isObjectBasedMotionBlur = e, n && this._buildPipeline();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"BloomEnabled\", { get: function() {\n            return this._bloomEnabled;\n          }, set: function(e) {\n            this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"DepthOfFieldEnabled\", { get: function() {\n            return this._depthOfFieldEnabled;\n          }, set: function(e) {\n            this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"LensFlareEnabled\", { get: function() {\n            return this._lensFlareEnabled;\n          }, set: function(e) {\n            this._lensFlareEnabled !== e && (this._lensFlareEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"HDREnabled\", { get: function() {\n            return this._hdrEnabled;\n          }, set: function(e) {\n            this._hdrEnabled !== e && (this._hdrEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"VLSEnabled\", { get: function() {\n            return this._vlsEnabled;\n          }, set: function(e) {\n            if (this._vlsEnabled !== e) {\n              if (e && !this._scene.enableGeometryBufferRenderer())\n                return void l.a.Warn(\"Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline\");\n              this._vlsEnabled = e, this._buildPipeline();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"MotionBlurEnabled\", { get: function() {\n            return this._motionBlurEnabled;\n          }, set: function(e) {\n            this._motionBlurEnabled !== e && (this._motionBlurEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fxaaEnabled\", { get: function() {\n            return this._fxaaEnabled;\n          }, set: function(e) {\n            this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"screenSpaceReflectionsEnabled\", { get: function() {\n            return this._screenSpaceReflectionsEnabled;\n          }, set: function(e) {\n            this._screenSpaceReflectionsEnabled !== e && (this._screenSpaceReflectionsEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"volumetricLightStepsCount\", { get: function() {\n            return this._volumetricLightStepsCount;\n          }, set: function(e) {\n            this.volumetricLightPostProcess && this.volumetricLightPostProcess.updateEffect(`#define VLS\n#define NB_STEPS ` + e.toFixed(1)), this._volumetricLightStepsCount = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"motionBlurSamples\", { get: function() {\n            return this._motionBlurSamples;\n          }, set: function(e) {\n            this.motionBlurPostProcess && (this._isObjectBasedMotionBlur ? this.motionBlurPostProcess.motionBlurSamples = e : this.motionBlurPostProcess.updateEffect(`#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES ` + e.toFixed(1))), this._motionBlurSamples = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples !== e && (this._samples = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildPipeline = function() {\n            var e = this, n = this._ratio, i = this._scene;\n            this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._screenSpaceReflectionsEnabled && (this.screenSpaceReflectionPostProcess = new Dc(\"HDRPass\", i, n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, this._floatTextureType), this.screenSpaceReflectionPostProcess.onApplyObservable.add(function() {\n              e._currentDepthOfFieldSource = e.screenSpaceReflectionPostProcess;\n            }), this.addEffect(new xt(i.getEngine(), \"HDRScreenSpaceReflections\", function() {\n              return e.screenSpaceReflectionPostProcess;\n            }, !0))), this._basePostProcess ? this.originalPostProcess = this._basePostProcess : this.originalPostProcess = new ft(\"HDRPass\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", this._floatTextureType), this.originalPostProcess.autoClear = !this.screenSpaceReflectionPostProcess, this.originalPostProcess.onApplyObservable.add(function() {\n              e._currentDepthOfFieldSource = e.originalPostProcess;\n            }), this.addEffect(new xt(i.getEngine(), \"HDRPassPostProcess\", function() {\n              return e.originalPostProcess;\n            }, !0)), this._bloomEnabled && (this._createDownSampleX4PostProcess(i, n / 4), this._createBrightPassPostProcess(i, n / 4), this._createBlurPostProcesses(i, n / 4, 1), this._createTextureAdderPostProcess(i, n), this.textureAdderFinalPostProcess = new ft(\"HDRDepthOfFieldSource\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRBaseDepthOfFieldSource\", function() {\n              return e.textureAdderFinalPostProcess;\n            }, !0))), this._vlsEnabled && (this._createVolumetricLightPostProcess(i, n), this.volumetricLightFinalPostProcess = new ft(\"HDRVLSFinal\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRVLSFinal\", function() {\n              return e.volumetricLightFinalPostProcess;\n            }, !0))), this._lensFlareEnabled && (this._createLensFlarePostProcess(i, n), this.lensFlareFinalPostProcess = new ft(\"HDRPostLensFlareDepthOfFieldSource\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRPostLensFlareDepthOfFieldSource\", function() {\n              return e.lensFlareFinalPostProcess;\n            }, !0))), this._hdrEnabled && (this._createLuminancePostProcesses(i, this._floatTextureType), this._createHdrPostProcess(i, n), this.hdrFinalPostProcess = new ft(\"HDRPostHDReDepthOfFieldSource\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRPostHDReDepthOfFieldSource\", function() {\n              return e.hdrFinalPostProcess;\n            }, !0))), this._depthOfFieldEnabled && (this._createBlurPostProcesses(i, n / 2, 3, \"depthOfFieldBlurWidth\"), this._createDepthOfFieldPostProcess(i, n)), this._motionBlurEnabled && this._createMotionBlurPostProcess(i, n), this._fxaaEnabled && (this.fxaaPostProcess = new vo(\"fxaa\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRFxaa\", function() {\n              return e.fxaaPostProcess;\n            }, !0))), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), !this._enableMSAAOnFirstPostProcess(this._samples) && this._samples > 1 && l.a.Warn(\"MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0\");\n          }, t.prototype._createDownSampleX4PostProcess = function(e, n) {\n            var i = this, o = new Array(32);\n            this.downSampleX4PostProcess = new ft(\"HDRDownSampleX4\", \"standard\", [\"dsOffsets\"], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define DOWN_SAMPLE_X4\", this._floatTextureType), this.downSampleX4PostProcess.onApply = function(a) {\n              for (var s = 0, d = i.downSampleX4PostProcess.width, p = i.downSampleX4PostProcess.height, y = -2; y < 2; y++)\n                for (var P = -2; P < 2; P++)\n                  o[s] = (y + 0.5) * (1 / d), o[s + 1] = (P + 0.5) * (1 / p), s += 2;\n              a.setArray2(\"dsOffsets\", o);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRDownSampleX4\", function() {\n              return i.downSampleX4PostProcess;\n            }, !0));\n          }, t.prototype._createBrightPassPostProcess = function(e, n) {\n            var i = this, o = new Array(8);\n            this.brightPassPostProcess = new ft(\"HDRBrightPass\", \"standard\", [\"dsOffsets\", \"brightThreshold\"], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define BRIGHT_PASS\", this._floatTextureType), this.brightPassPostProcess.onApply = function(a) {\n              var s = 1 / i.brightPassPostProcess.width, d = 1 / i.brightPassPostProcess.height;\n              o[0] = -0.5 * s, o[1] = 0.5 * d, o[2] = 0.5 * s, o[3] = 0.5 * d, o[4] = -0.5 * s, o[5] = -0.5 * d, o[6] = 0.5 * s, o[7] = -0.5 * d, a.setArray2(\"dsOffsets\", o), a.setFloat(\"brightThreshold\", i.brightThreshold);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRBrightPass\", function() {\n              return i.brightPassPostProcess;\n            }, !0));\n          }, t.prototype._createBlurPostProcesses = function(e, n, i, o) {\n            var a = this;\n            o === void 0 && (o = \"blurWidth\");\n            var s = e.getEngine(), d = new _n(\"HDRBlurH_\" + i, new u.d(1, 0), this[o], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, this._floatTextureType), p = new _n(\"HDRBlurV_\" + i, new u.d(0, 1), this[o], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, this._floatTextureType);\n            d.onActivateObservable.add(function() {\n              var y = d.width / s.getRenderWidth();\n              d.kernel = a[o] * y;\n            }), p.onActivateObservable.add(function() {\n              var y = p.height / s.getRenderHeight();\n              p.kernel = a.horizontalBlur ? 64 * y : a[o] * y;\n            }), this.addEffect(new xt(e.getEngine(), \"HDRBlurH\" + i, function() {\n              return d;\n            }, !0)), this.addEffect(new xt(e.getEngine(), \"HDRBlurV\" + i, function() {\n              return p;\n            }, !0)), this.blurHPostProcesses.push(d), this.blurVPostProcesses.push(p);\n          }, t.prototype._createTextureAdderPostProcess = function(e, n) {\n            var i = this;\n            this.textureAdderPostProcess = new ft(\"HDRTextureAdder\", \"standard\", [\"exposure\"], [\"otherSampler\", \"lensSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define TEXTURE_ADDER\", this._floatTextureType), this.textureAdderPostProcess.onApply = function(o) {\n              o.setTextureFromPostProcess(\"otherSampler\", i._vlsEnabled ? i._currentDepthOfFieldSource : i.originalPostProcess), o.setTexture(\"lensSampler\", i.lensTexture), o.setFloat(\"exposure\", i._currentExposure), i._currentDepthOfFieldSource = i.textureAdderFinalPostProcess;\n            }, this.addEffect(new xt(e.getEngine(), \"HDRTextureAdder\", function() {\n              return i.textureAdderPostProcess;\n            }, !0));\n          }, t.prototype._createVolumetricLightPostProcess = function(e, n) {\n            var i = this, o = e.enableGeometryBufferRenderer();\n            o.enablePosition = !0;\n            var a = o.getGBuffer();\n            this.volumetricLightPostProcess = new ft(\"HDRVLS\", \"standard\", [\"shadowViewProjection\", \"cameraPosition\", \"sunDirection\", \"sunColor\", \"scatteringCoefficient\", \"scatteringPower\", \"depthValues\"], [\"shadowMapSampler\", \"positionSampler\"], n / 8, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, `#define VLS\n#define NB_STEPS ` + this._volumetricLightStepsCount.toFixed(1));\n            var s = u.d.Zero();\n            this.volumetricLightPostProcess.onApply = function(d) {\n              if (i.sourceLight && i.sourceLight.getShadowGenerator() && i._scene.activeCamera) {\n                var p = i.sourceLight.getShadowGenerator();\n                d.setTexture(\"shadowMapSampler\", p.getShadowMap()), d.setTexture(\"positionSampler\", a.textures[2]), d.setColor3(\"sunColor\", i.sourceLight.diffuse), d.setVector3(\"sunDirection\", i.sourceLight.getShadowDirection()), d.setVector3(\"cameraPosition\", i._scene.activeCamera.globalPosition), d.setMatrix(\"shadowViewProjection\", p.getTransformMatrix()), d.setFloat(\"scatteringCoefficient\", i.volumetricLightCoefficient), d.setFloat(\"scatteringPower\", i.volumetricLightPower), s.x = i.sourceLight.getDepthMinZ(i._scene.activeCamera), s.y = i.sourceLight.getDepthMaxZ(i._scene.activeCamera), d.setVector2(\"depthValues\", s);\n              }\n            }, this.addEffect(new xt(e.getEngine(), \"HDRVLS\", function() {\n              return i.volumetricLightPostProcess;\n            }, !0)), this._createBlurPostProcesses(e, n / 4, 0, \"volumetricLightBlurScale\"), this.volumetricLightMergePostProces = new ft(\"HDRVLSMerge\", \"standard\", [], [\"originalSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define VLSMERGE\"), this.volumetricLightMergePostProces.onApply = function(d) {\n              d.setTextureFromPostProcess(\"originalSampler\", i._bloomEnabled ? i.textureAdderFinalPostProcess : i.originalPostProcess), i._currentDepthOfFieldSource = i.volumetricLightFinalPostProcess;\n            }, this.addEffect(new xt(e.getEngine(), \"HDRVLSMerge\", function() {\n              return i.volumetricLightMergePostProces;\n            }, !0));\n          }, t.prototype._createLuminancePostProcesses = function(e, n) {\n            var i = this, o = Math.pow(3, t.LuminanceSteps);\n            this.luminancePostProcess = new ft(\"HDRLuminance\", \"standard\", [\"lumOffsets\"], [], { width: o, height: o }, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define LUMINANCE\", n);\n            var a = [];\n            this.luminancePostProcess.onApply = function(P) {\n              var R = 1 / i.luminancePostProcess.width, B = 1 / i.luminancePostProcess.height;\n              a[0] = -0.5 * R, a[1] = 0.5 * B, a[2] = 0.5 * R, a[3] = 0.5 * B, a[4] = -0.5 * R, a[5] = -0.5 * B, a[6] = 0.5 * R, a[7] = -0.5 * B, P.setArray2(\"lumOffsets\", a);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRLuminance\", function() {\n              return i.luminancePostProcess;\n            }, !0));\n            for (var s = t.LuminanceSteps - 1; s >= 0; s--) {\n              o = Math.pow(3, s);\n              var d = `#define LUMINANCE_DOWN_SAMPLE\n`;\n              s === 0 && (d += \"#define FINAL_DOWN_SAMPLER\");\n              var p = new ft(\"HDRLuminanceDownSample\" + s, \"standard\", [\"dsOffsets\", \"halfDestPixelSize\"], [], { width: o, height: o }, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, d, n);\n              this.luminanceDownSamplePostProcesses.push(p);\n            }\n            var y = this.luminancePostProcess;\n            this.luminanceDownSamplePostProcesses.forEach(function(P, R) {\n              var B = new Array(18);\n              P.onApply = function(F) {\n                if (y) {\n                  for (var z = 0, J = -1; J < 2; J++)\n                    for (var ie = -1; ie < 2; ie++)\n                      B[z] = J / y.width, B[z + 1] = ie / y.height, z += 2;\n                  F.setArray2(\"dsOffsets\", B), F.setFloat(\"halfDestPixelSize\", 0.5 / y.width), y = R === i.luminanceDownSamplePostProcesses.length - 1 ? i.luminancePostProcess : P;\n                }\n              }, R === i.luminanceDownSamplePostProcesses.length - 1 && (P.onAfterRender = function() {\n                var F = e.getEngine().readPixels(0, 0, 1, 1), z = new u.f(1 / 16581375, 1 / 65025, 1 / 255, 1);\n                i._hdrCurrentLuminance = (F[0] * z.x + F[1] * z.y + F[2] * z.z + F[3] * z.w) / 100;\n              }), i.addEffect(new xt(e.getEngine(), \"HDRLuminanceDownSample\" + R, function() {\n                return P;\n              }, !0));\n            });\n          }, t.prototype._createHdrPostProcess = function(e, n) {\n            var i = this, o = [\"#define HDR\"];\n            this._hdrAutoExposure && o.push(\"#define AUTO_EXPOSURE\"), this.hdrPostProcess = new ft(\"HDR\", \"standard\", [\"averageLuminance\"], [\"textureAdderSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o.join(`\n`), h.a.TEXTURETYPE_UNSIGNED_INT);\n            var a = 1, s = 0, d = 0;\n            this.hdrPostProcess.onApply = function(p) {\n              if (p.setTextureFromPostProcess(\"textureAdderSampler\", i._currentDepthOfFieldSource), s += e.getEngine().getDeltaTime(), a < 0)\n                a = i._hdrCurrentLuminance;\n              else {\n                var y = (d - s) / 1e3;\n                i._hdrCurrentLuminance < a + i.hdrDecreaseRate * y ? a += i.hdrDecreaseRate * y : i._hdrCurrentLuminance > a - i.hdrIncreaseRate * y ? a -= i.hdrIncreaseRate * y : a = i._hdrCurrentLuminance;\n              }\n              i.hdrAutoExposure ? i._currentExposure = i._fixedExposure / a : (a = $.a.Clamp(a, i.hdrMinimumLuminance, 1e20), p.setFloat(\"averageLuminance\", a)), d = s, i._currentDepthOfFieldSource = i.hdrFinalPostProcess;\n            }, this.addEffect(new xt(e.getEngine(), \"HDR\", function() {\n              return i.hdrPostProcess;\n            }, !0));\n          }, t.prototype._createLensFlarePostProcess = function(e, n) {\n            var i = this;\n            this.lensFlarePostProcess = new ft(\"HDRLensFlare\", \"standard\", [\"strength\", \"ghostDispersal\", \"haloWidth\", \"resolution\", \"distortionStrength\"], [\"lensColorSampler\"], n / 2, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define LENS_FLARE\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(e.getEngine(), \"HDRLensFlare\", function() {\n              return i.lensFlarePostProcess;\n            }, !0)), this._createBlurPostProcesses(e, n / 4, 2, \"lensFlareBlurWidth\"), this.lensFlareComposePostProcess = new ft(\"HDRLensFlareCompose\", \"standard\", [\"lensStarMatrix\"], [\"otherSampler\", \"lensDirtSampler\", \"lensStarSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define LENS_FLARE_COMPOSE\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(e.getEngine(), \"HDRLensFlareCompose\", function() {\n              return i.lensFlareComposePostProcess;\n            }, !0));\n            var o = new u.d(0, 0);\n            this.lensFlarePostProcess.onApply = function(d) {\n              d.setTextureFromPostProcess(\"textureSampler\", i._bloomEnabled ? i.blurHPostProcesses[0] : i.originalPostProcess), d.setTexture(\"lensColorSampler\", i.lensColorTexture), d.setFloat(\"strength\", i.lensFlareStrength), d.setFloat(\"ghostDispersal\", i.lensFlareGhostDispersal), d.setFloat(\"haloWidth\", i.lensFlareHaloWidth), o.x = i.lensFlarePostProcess.width, o.y = i.lensFlarePostProcess.height, d.setVector2(\"resolution\", o), d.setFloat(\"distortionStrength\", i.lensFlareDistortionStrength);\n            };\n            var a = u.a.FromValues(2, 0, -1, 0, 0, 2, -1, 0, 0, 0, 1, 0, 0, 0, 0, 1), s = u.a.FromValues(0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n            this.lensFlareComposePostProcess.onApply = function(d) {\n              if (i._scene.activeCamera) {\n                d.setTextureFromPostProcess(\"otherSampler\", i.lensFlarePostProcess), d.setTexture(\"lensDirtSampler\", i.lensFlareDirtTexture), d.setTexture(\"lensStarSampler\", i.lensStarTexture);\n                var p = i._scene.activeCamera.getViewMatrix().getRow(0), y = i._scene.activeCamera.getViewMatrix().getRow(2), P = u.e.Dot(p.toVector3(), new u.e(1, 0, 0)) + u.e.Dot(y.toVector3(), new u.e(0, 0, 1));\n                P *= 4;\n                var R = u.a.FromValues(0.5 * Math.cos(P), -Math.sin(P), 0, 0, Math.sin(P), 0.5 * Math.cos(P), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), B = s.multiply(R).multiply(a);\n                d.setMatrix(\"lensStarMatrix\", B), i._currentDepthOfFieldSource = i.lensFlareFinalPostProcess;\n              }\n            };\n          }, t.prototype._createDepthOfFieldPostProcess = function(e, n) {\n            var i = this;\n            this.depthOfFieldPostProcess = new ft(\"HDRDepthOfField\", \"standard\", [\"distance\"], [\"otherSampler\", \"depthSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define DEPTH_OF_FIELD\", h.a.TEXTURETYPE_UNSIGNED_INT), this.depthOfFieldPostProcess.onApply = function(o) {\n              o.setTextureFromPostProcess(\"otherSampler\", i._currentDepthOfFieldSource), o.setTexture(\"depthSampler\", i._getDepthTexture()), o.setFloat(\"distance\", i.depthOfFieldDistance);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRDepthOfField\", function() {\n              return i.depthOfFieldPostProcess;\n            }, !0));\n          }, t.prototype._createMotionBlurPostProcess = function(e, n) {\n            var i = this;\n            if (this._isObjectBasedMotionBlur) {\n              var o = new Mc(\"HDRMotionBlur\", e, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT);\n              o.motionStrength = this.motionStrength, o.motionBlurSamples = this.motionBlurSamples, this.motionBlurPostProcess = o;\n            } else {\n              this.motionBlurPostProcess = new ft(\"HDRMotionBlur\", \"standard\", [\"inverseViewProjection\", \"prevViewProjection\", \"screenSize\", \"motionScale\", \"motionStrength\"], [\"depthSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, `#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES ` + this.motionBlurSamples.toFixed(1), h.a.TEXTURETYPE_UNSIGNED_INT);\n              var a = 0, s = u.a.Identity(), d = u.a.Identity(), p = u.a.Identity(), y = u.d.Zero();\n              this.motionBlurPostProcess.onApply = function(P) {\n                (p = e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(d), P.setMatrix(\"inverseViewProjection\", d), P.setMatrix(\"prevViewProjection\", s), s = p, y.x = i.motionBlurPostProcess.width, y.y = i.motionBlurPostProcess.height, P.setVector2(\"screenSize\", y), a = e.getEngine().getFps() / 60, P.setFloat(\"motionScale\", a), P.setFloat(\"motionStrength\", i.motionStrength), P.setTexture(\"depthSampler\", i._getDepthTexture());\n              };\n            }\n            this.addEffect(new xt(e.getEngine(), \"HDRMotionBlur\", function() {\n              return i.motionBlurPostProcess;\n            }, !0));\n          }, t.prototype._getDepthTexture = function() {\n            return this._scene.getEngine().getCaps().drawBuffersExtension ? this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0] : this._scene.enableDepthRenderer().getDepthMap();\n          }, t.prototype._disposePostProcesses = function() {\n            for (var e = 0; e < this._cameras.length; e++) {\n              var n = this._cameras[e];\n              this.originalPostProcess && this.originalPostProcess.dispose(n), this.screenSpaceReflectionPostProcess && this.screenSpaceReflectionPostProcess.dispose(n), this.downSampleX4PostProcess && this.downSampleX4PostProcess.dispose(n), this.brightPassPostProcess && this.brightPassPostProcess.dispose(n), this.textureAdderPostProcess && this.textureAdderPostProcess.dispose(n), this.volumetricLightPostProcess && this.volumetricLightPostProcess.dispose(n), this.volumetricLightSmoothXPostProcess && this.volumetricLightSmoothXPostProcess.dispose(n), this.volumetricLightSmoothYPostProcess && this.volumetricLightSmoothYPostProcess.dispose(n), this.volumetricLightMergePostProces && this.volumetricLightMergePostProces.dispose(n), this.volumetricLightFinalPostProcess && this.volumetricLightFinalPostProcess.dispose(n), this.lensFlarePostProcess && this.lensFlarePostProcess.dispose(n), this.lensFlareComposePostProcess && this.lensFlareComposePostProcess.dispose(n);\n              for (var i = 0; i < this.luminanceDownSamplePostProcesses.length; i++)\n                this.luminanceDownSamplePostProcesses[i].dispose(n);\n              for (this.luminancePostProcess && this.luminancePostProcess.dispose(n), this.hdrPostProcess && this.hdrPostProcess.dispose(n), this.hdrFinalPostProcess && this.hdrFinalPostProcess.dispose(n), this.depthOfFieldPostProcess && this.depthOfFieldPostProcess.dispose(n), this.motionBlurPostProcess && this.motionBlurPostProcess.dispose(n), this.fxaaPostProcess && this.fxaaPostProcess.dispose(n), i = 0; i < this.blurHPostProcesses.length; i++)\n                this.blurHPostProcesses[i].dispose(n);\n              for (i = 0; i < this.blurVPostProcesses.length; i++)\n                this.blurVPostProcesses[i].dispose(n);\n            }\n            this.originalPostProcess = null, this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.textureAdderPostProcess = null, this.textureAdderFinalPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.luminancePostProcess = null, this.hdrPostProcess = null, this.hdrFinalPostProcess = null, this.depthOfFieldPostProcess = null, this.motionBlurPostProcess = null, this.fxaaPostProcess = null, this.screenSpaceReflectionPostProcess = null, this.luminanceDownSamplePostProcesses = [], this.blurHPostProcesses = [], this.blurVPostProcesses = [];\n          }, t.prototype.dispose = function() {\n            this._disposePostProcesses(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), r.prototype.dispose.call(this);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return this.sourceLight && (e.sourceLightId = this.sourceLight.id), this.screenSpaceReflectionPostProcess && (e.screenSpaceReflectionPostProcess = L.a.Serialize(this.screenSpaceReflectionPostProcess)), e.customType = \"StandardRenderingPipeline\", e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e._name, n, e._ratio);\n            }, e, n, i);\n            return e.sourceLightId && (o.sourceLight = n.getLightByID(e.sourceLightId)), e.screenSpaceReflectionPostProcess && L.a.Parse(function() {\n              return o.screenSpaceReflectionPostProcess;\n            }, e.screenSpaceReflectionPostProcess, n, i), o;\n          }, t.LuminanceSteps = 6, Object(c.c)([Object(L.c)()], t.prototype, \"brightThreshold\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"blurWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"horizontalBlur\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"exposure\", null), Object(c.c)([Object(L.m)(\"lensTexture\")], t.prototype, \"lensTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightCoefficient\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightPower\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightBlurScale\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrMinimumLuminance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrDecreaseRate\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrIncreaseRate\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrAutoExposure\", null), Object(c.c)([Object(L.m)(\"lensColorTexture\")], t.prototype, \"lensColorTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareGhostDispersal\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareHaloWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareDistortionStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareBlurWidth\", void 0), Object(c.c)([Object(L.m)(\"lensStarTexture\")], t.prototype, \"lensStarTexture\", void 0), Object(c.c)([Object(L.m)(\"lensFlareDirtTexture\")], t.prototype, \"lensFlareDirtTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldBlurWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"motionStrength\", null), Object(c.c)([Object(L.c)()], t.prototype, \"objectBasedMotionBlur\", null), Object(c.c)([Object(L.c)()], t.prototype, \"_ratio\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"BloomEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"DepthOfFieldEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"LensFlareEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"HDREnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"VLSEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"MotionBlurEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"fxaaEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"screenSpaceReflectionsEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightStepsCount\", null), Object(c.c)([Object(L.c)()], t.prototype, \"motionBlurSamples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"samples\", null), t;\n        }(Ir);\n        O.a.RegisteredTypes[\"BABYLON.StandardRenderingPipeline\"] = Pd;\n        var rg = `const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamA;\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\n#ifdef IS_STEREOSCOPIC_INTERLACED\nfloat rowNum=floor(vUV.y/stepSize.y);\nuseCamA=mod(rowNum,2.0) == 1.0;\nuseCamB=mod(rowNum,2.0) == 0.0;\ntexCoord1=vec2(vUV.x,vUV.y);\ntexCoord2=vec2(vUV.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else if (useCamA){\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}else {\ndiscard;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}\n`;\n        ze.a.ShadersStore.stereoscopicInterlacePixelShader = rg;\n        var og = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, \"stereoscopicInterlace\", [\"stepSize\"], [\"camASampler\"], 1, n[1], a, s, d, o ? \"#define IS_STEREOSCOPIC_INTERLACED 1\" : i ? \"#define IS_STEREOSCOPIC_HORIZ 1\" : void 0) || this;\n            return p._passedProcess = n[0]._rigPostProcess, p._stepSize = new u.d(1 / p.width, 1 / p.height), p.onSizeChangedObservable.add(function() {\n              p._stepSize = new u.d(1 / p.width, 1 / p.height);\n            }), p.onApplyObservable.add(function(y) {\n              y.setTextureFromPostProcess(\"camASampler\", p._passedProcess), y.setFloat2(\"stepSize\", p._stepSize.x, p._stepSize.y);\n            }), p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicInterlacePostProcessI\";\n          }, t;\n        }(ft), ag = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, \"stereoscopicInterlace\", [\"stepSize\"], [\"camASampler\"], 1, n[1], o, a, s, i ? \"#define IS_STEREOSCOPIC_HORIZ 1\" : void 0) || this;\n            return d._passedProcess = n[0]._rigPostProcess, d._stepSize = new u.d(1 / d.width, 1 / d.height), d.onSizeChangedObservable.add(function() {\n              d._stepSize = new u.d(1 / d.width, 1 / d.height);\n            }), d.onApplyObservable.add(function(p) {\n              p.setTextureFromPostProcess(\"camASampler\", d._passedProcess), p.setFloat2(\"stepSize\", d._stepSize.x, d._stepSize.y);\n            }), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicInterlacePostProcess\";\n          }, t;\n        }(ft), sg = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;\nconst float B=0.50;\nconst float C=0.10;\nconst float D=0.20;\nconst float E=0.02;\nconst float F=0.30;\nconst float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{\nreturn dot(c,vec3(0.22,0.707,0.071));\n}\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb);\nfloat lumTm=lum*_ExposureAdjustment;\nfloat scale=lumTm/(1.0+lumTm);\ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nconst float ExposureBias=2.0;\nvec3 x=ExposureBias*colour;\nvec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\nx=vec3(W,W,W);\nvec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);\ncolour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour=vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);\n}`;\n        ze.a.ShadersStore.tonemapPixelShader = sg;\n        var $i;\n        (function(r) {\n          r[r.Hable = 0] = \"Hable\", r[r.Reinhard = 1] = \"Reinhard\", r[r.HejiDawson = 2] = \"HejiDawson\", r[r.Photographic = 3] = \"Photographic\";\n        })($i || ($i = {}));\n        var cg = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            a === void 0 && (a = h.a.TEXTURE_BILINEAR_SAMPLINGMODE), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var p = r.call(this, e, \"tonemap\", [\"_ExposureAdjustment\"], null, 1, o, a, s, !0, null, d) || this;\n            p._operator = n, p.exposureAdjustment = i;\n            var y = \"#define \";\n            return p._operator === $i.Hable ? y += \"HABLE_TONEMAPPING\" : p._operator === $i.Reinhard ? y += \"REINHARD_TONEMAPPING\" : p._operator === $i.HejiDawson ? y += \"OPTIMIZED_HEJIDAWSON_TONEMAPPING\" : p._operator === $i.Photographic && (y += \"PHOTOGRAPHIC_TONEMAPPING\"), p.updateEffect(y), p.onApply = function(P) {\n              P.setFloat(\"_ExposureAdjustment\", p.exposureAdjustment);\n            }, p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TonemapPostProcess\";\n          }, t;\n        }(ft), lg = `uniform sampler2D textureSampler;\nuniform sampler2D lightScatteringSampler;\nuniform float decay;\nuniform float exposure;\nuniform float weight;\nuniform float density;\nuniform vec2 meshPositionOnScreen;\nvarying vec2 vUV;\nvoid main(void) {\nvec2 tc=vUV;\nvec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);\ndeltaTexCoord*=1.0/float(NUM_SAMPLES)*density;\nfloat illuminationDecay=1.0;\nvec4 color=texture2D(lightScatteringSampler,tc)*0.4;\nfor(int i=0; i<NUM_SAMPLES; i++) {\ntc-=deltaTexCoord;\nvec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;\ndataSample*=illuminationDecay*weight;\ncolor+=dataSample;\nilluminationDecay*=decay;\n}\nvec4 realColor=texture2D(textureSampler,vUV);\ngl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));\n}\n`;\n        ze.a.ShadersStore.volumetricLightScatteringPixelShader = lg;\n        var ug = `\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n`;\n        ze.a.ShadersStore.volumetricLightScatteringPassVertexShader = ug;\n        var hg = `#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\n#endif\n#if defined(ALPHATEST)\nuniform sampler2D diffuseSampler;\n#endif\nvoid main(void)\n{\n#if defined(ALPHATEST)\nvec4 diffuseColor=texture2D(diffuseSampler,vUV);\nif (diffuseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\n}\n`;\n        ze.a.ShadersStore.volumetricLightScatteringPassPixelShader = hg;\n        var xd = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            a === void 0 && (a = 100), s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE);\n            var P = r.call(this, e, \"volumetricLightScattering\", [\"decay\", \"exposure\", \"weight\", \"meshPositionOnScreen\", \"density\"], [\"lightScatteringSampler\"], n.postProcessRatio || n, i, s, d, p, \"#define NUM_SAMPLES \" + a) || this;\n            return P._screenCoordinates = u.d.Zero(), P.customMeshPosition = u.e.Zero(), P.useCustomMeshPosition = !1, P.invert = !0, P.excludedMeshes = new Array(), P.exposure = 0.3, P.decay = 0.96815, P.weight = 0.58767, P.density = 0.926, d = (y = i === null ? y : i.getScene()).getEngine(), P._viewPort = new jn.a(0, 0, 1, 1).toGlobal(d.getRenderWidth(), d.getRenderHeight()), P.mesh = o !== null ? o : t.CreateDefaultMesh(\"VolumetricLightScatteringMesh\", y), P._createPass(y, n.passRatio || n), P.onActivate = function(R) {\n              P.isSupported || P.dispose(R), P.onActivate = null;\n            }, P.onApplyObservable.add(function(R) {\n              P._updateMeshScreenCoordinates(y), R.setTexture(\"lightScatteringSampler\", P._volumetricLightScatteringRTT), R.setFloat(\"exposure\", P.exposure), R.setFloat(\"decay\", P.decay), R.setFloat(\"weight\", P.weight), R.setFloat(\"density\", P.density), R.setVector2(\"meshPositionOnScreen\", P._screenCoordinates);\n            }), P;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"useDiffuseColor\", { get: function() {\n            return l.a.Warn(\"VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead\"), !1;\n          }, set: function(e) {\n            l.a.Warn(\"VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead\");\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"VolumetricLightScatteringPostProcess\";\n          }, t.prototype._isReady = function(e, n) {\n            var i = e.getMesh();\n            if (i === this.mesh && i.material)\n              return i.material.isReady(i);\n            var o = [], a = [Oe.b.PositionKind], s = e.getMaterial();\n            s && (s.needAlphaTesting() && o.push(\"#define ALPHATEST\"), i.isVerticesDataPresent(Oe.b.UVKind) && (a.push(Oe.b.UVKind), o.push(\"#define UV1\")), i.isVerticesDataPresent(Oe.b.UV2Kind) && (a.push(Oe.b.UV2Kind), o.push(\"#define UV2\"))), i.useBones && i.computeBonesUsingShaders ? (a.push(Oe.b.MatricesIndicesKind), a.push(Oe.b.MatricesWeightsKind), o.push(\"#define NUM_BONE_INFLUENCERS \" + i.numBoneInfluencers), o.push(\"#define BonesPerMesh \" + (i.skeleton ? i.skeleton.bones.length + 1 : 0))) : o.push(\"#define NUM_BONE_INFLUENCERS 0\"), n && (o.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(a), e.getRenderingMesh().hasThinInstances && o.push(\"#define THIN_INSTANCES\"));\n            var d = o.join(`\n`);\n            return this._cachedDefines !== d && (this._cachedDefines = d, this._volumetricLightScatteringPass = i.getScene().getEngine().createEffect(\"volumetricLightScatteringPass\", a, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\"], [\"diffuseSampler\"], d, void 0, void 0, void 0, { maxSimultaneousMorphTargets: i.numBoneInfluencers })), this._volumetricLightScatteringPass.isReady();\n          }, t.prototype.setCustomMeshPosition = function(e) {\n            this.customMeshPosition = e;\n          }, t.prototype.getCustomMeshPosition = function() {\n            return this.customMeshPosition;\n          }, t.prototype.dispose = function(e) {\n            var n = e.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);\n            n !== -1 && e.getScene().customRenderTargets.splice(n, 1), this._volumetricLightScatteringRTT.dispose(), r.prototype.dispose.call(this, e);\n          }, t.prototype.getPass = function() {\n            return this._volumetricLightScatteringRTT;\n          }, t.prototype._meshExcluded = function(e) {\n            return this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(e) !== -1;\n          }, t.prototype._createPass = function(e, n) {\n            var i = this, o = e.getEngine();\n            this._volumetricLightScatteringRTT = new on(\"volumetricLightScatteringMap\", { width: o.getRenderWidth() * n, height: o.getRenderHeight() * n }, e, !1, !0, h.a.TEXTURETYPE_UNSIGNED_INT), this._volumetricLightScatteringRTT.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.renderList = null, this._volumetricLightScatteringRTT.renderParticles = !1, this._volumetricLightScatteringRTT.ignoreCameraViewport = !0;\n            var a = this.getCamera();\n            a ? a.customRenderTargets.push(this._volumetricLightScatteringRTT) : e.customRenderTargets.push(this._volumetricLightScatteringRTT);\n            var s, d = function(y) {\n              var P = y.getRenderingMesh(), R = y.getEffectiveMesh();\n              if (!i._meshExcluded(P)) {\n                R._internalAbstractMeshDataInfo._isActiveIntermediate = !1;\n                var B = y.getMaterial();\n                if (B) {\n                  var F = P.getScene(), z = F.getEngine();\n                  z.setState(B.backFaceCulling);\n                  var J = P._getInstancesRenderList(y._id, !!y.getReplacementMesh());\n                  if (!J.mustReturn) {\n                    var ie = z.getCaps().instancedArrays && (J.visibleInstances[y._id] !== null || P.hasThinInstances);\n                    if (i._isReady(y, ie)) {\n                      var se = i._volumetricLightScatteringPass;\n                      if (P === i.mesh && (se = y.effect ? y.effect : B.getEffect()), z.enableEffect(se), P._bind(y, se, B.fillMode), P === i.mesh)\n                        B.bind(R.getWorldMatrix(), P);\n                      else {\n                        if (i._volumetricLightScatteringPass.setMatrix(\"viewProjection\", F.getTransformMatrix()), B && B.needAlphaTesting()) {\n                          var ce = B.getAlphaTestTexture();\n                          i._volumetricLightScatteringPass.setTexture(\"diffuseSampler\", ce), ce && i._volumetricLightScatteringPass.setMatrix(\"diffuseMatrix\", ce.getTextureMatrix());\n                        }\n                        P.useBones && P.computeBonesUsingShaders && P.skeleton && i._volumetricLightScatteringPass.setMatrices(\"mBones\", P.skeleton.getTransformMatrices(P));\n                      }\n                      P._processRendering(R, y, i._volumetricLightScatteringPass, zt.a.TriangleFillMode, J, ie, function(ue, fe) {\n                        return se.setMatrix(\"world\", fe);\n                      });\n                    }\n                  }\n                }\n              }\n            }, p = new I.b(0, 0, 0, 1);\n            this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function() {\n              s = e.clearColor, e.clearColor = p;\n            }), this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function() {\n              e.clearColor = s;\n            }), this._volumetricLightScatteringRTT.customRenderFunction = function(y, P, R, B) {\n              var F, z = e.getEngine();\n              if (B.length) {\n                for (z.setColorWrite(!1), F = 0; F < B.length; F++)\n                  d(B.data[F]);\n                z.setColorWrite(!0);\n              }\n              for (F = 0; F < y.length; F++)\n                d(y.data[F]);\n              for (F = 0; F < P.length; F++)\n                d(P.data[F]);\n              if (R.length) {\n                for (F = 0; F < R.length; F++) {\n                  var J = R.data[F], ie = J.getBoundingInfo();\n                  ie && e.activeCamera && (J._alphaIndex = J.getMesh().alphaIndex, J._distanceToCamera = ie.boundingSphere.centerWorld.subtract(e.activeCamera.position).length());\n                }\n                var se = R.data.slice(0, R.length);\n                for (se.sort(function(ce, ue) {\n                  return ce._alphaIndex > ue._alphaIndex ? 1 : ce._alphaIndex < ue._alphaIndex ? -1 : ce._distanceToCamera < ue._distanceToCamera ? 1 : ce._distanceToCamera > ue._distanceToCamera ? -1 : 0;\n                }), z.setAlphaMode(h.a.ALPHA_COMBINE), F = 0; F < se.length; F++)\n                  d(se[F]);\n                z.setAlphaMode(h.a.ALPHA_DISABLE);\n              }\n            };\n          }, t.prototype._updateMeshScreenCoordinates = function(e) {\n            var n, i = e.getTransformMatrix();\n            n = this.useCustomMeshPosition ? this.customMeshPosition : this.attachedNode ? this.attachedNode.position : this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position;\n            var o = u.e.Project(n, u.a.Identity(), i, this._viewPort);\n            this._screenCoordinates.x = o.x / this._viewPort.width, this._screenCoordinates.y = o.y / this._viewPort.height, this.invert && (this._screenCoordinates.y = 1 - this._screenCoordinates.y);\n          }, t.CreateDefaultMesh = function(e, n) {\n            var i = Ie.a.CreatePlane(e, 1, n);\n            i.billboardMode = Mt.a.BILLBOARDMODE_ALL;\n            var o = new Nt.a(e + \"Material\", n);\n            return o.emissiveColor = new I.a(1, 1, 1), i.material = o, i;\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"customMeshPosition\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useCustomMeshPosition\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"invert\", void 0), Object(c.c)([Object(L.k)()], t.prototype, \"mesh\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"excludedMeshes\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"exposure\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"decay\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"weight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"density\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.VolumetricLightScatteringPostProcess\"] = xd;\n        var dg = `\n\nprecision highp float;\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform float curvature_ridge;\nuniform float curvature_valley;\n#ifndef CURVATURE_OFFSET\n#define CURVATURE_OFFSET 1\n#endif\nfloat curvature_soft_clamp(float curvature,float control)\n{\nif (curvature<0.5/control)\nreturn curvature*(1.0-curvature*control);\nreturn 0.25/control;\n}\nfloat calculate_curvature(ivec2 texel,float ridge,float valley)\n{\nvec2 normal_up=texelFetchOffset(normalSampler,texel,0,ivec2(0,CURVATURE_OFFSET)).rb;\nvec2 normal_down=texelFetchOffset(normalSampler,texel,0,ivec2(0,-CURVATURE_OFFSET)).rb;\nvec2 normal_left=texelFetchOffset(normalSampler,texel,0,ivec2(-CURVATURE_OFFSET,0)).rb;\nvec2 normal_right=texelFetchOffset(normalSampler,texel,0,ivec2( CURVATURE_OFFSET,0)).rb;\nfloat normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));\nif (normal_diff<0.0)\nreturn -2.0*curvature_soft_clamp(-normal_diff,valley);\nreturn 2.0*curvature_soft_clamp(normal_diff,ridge);\n}\nvoid main(void)\n{\nivec2 texel=ivec2(gl_FragCoord.xy);\nvec4 baseColor=texture2D(textureSampler,vUV);\nfloat curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);\nbaseColor.rgb*=curvature+1.0;\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.screenSpaceCurvaturePixelShader = dg;\n        var Cd = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1);\n            var P = r.call(this, e, \"screenSpaceCurvature\", [\"curvature_ridge\", \"curvature_valley\"], [\"textureSampler\", \"normalSampler\"], i, o, a, s, d, void 0, p, void 0, null, y) || this;\n            return P.ridge = 1, P.valley = 1, P._geometryBufferRenderer = n.enableGeometryBufferRenderer(), P._geometryBufferRenderer ? P.onApply = function(R) {\n              R.setFloat(\"curvature_ridge\", 0.5 / Math.max(P.ridge * P.ridge, 1e-4)), R.setFloat(\"curvature_valley\", 0.7 / Math.max(P.valley * P.valley, 1e-4));\n              var B = P._geometryBufferRenderer.getGBuffer().textures[1];\n              R.setTexture(\"normalSampler\", B);\n            } : l.a.Error(\"Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.\"), P;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScreenSpaceCurvaturePostProcess\";\n          }, Object.defineProperty(t, \"IsSupported\", { get: function() {\n            var e = te.a.LastCreatedEngine;\n            return !!e && (e.webGLVersion > 1 || e.getCaps().drawBuffersExtension);\n          }, enumerable: !1, configurable: !0 }), t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, i, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.textureType, e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"ridge\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"valley\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ScreenSpaceCurvaturePostProcess\"] = Cd, f(166), f(167), Object.defineProperty(_e.a.prototype, \"forceShowBoundingBoxes\", { get: function() {\n          return this._forceShowBoundingBoxes || !1;\n        }, set: function(r) {\n          this._forceShowBoundingBoxes = r, r && this.getBoundingBoxRenderer();\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.getBoundingBoxRenderer = function() {\n          return this._boundingBoxRenderer || (this._boundingBoxRenderer = new Rd(this)), this._boundingBoxRenderer;\n        }, Object.defineProperty(Mt.a.prototype, \"showBoundingBox\", { get: function() {\n          return this._showBoundingBox || !1;\n        }, set: function(r) {\n          this._showBoundingBox = r, r && this.getScene().getBoundingBoxRenderer();\n        }, enumerable: !0, configurable: !0 });\n        var Rd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_BOUNDINGBOXRENDERER, this.frontColor = new I.a(1, 1, 1), this.backColor = new I.a(0.1, 0.1, 0.1), this.showBackLines = !0, this.onBeforeBoxRenderingObservable = new C.c(), this.onAfterBoxRenderingObservable = new C.c(), this.onResourcesReadyObservable = new C.c(), this.enabled = !0, this.renderList = new si.a(32), this._vertexBuffers = {}, this._fillIndexBuffer = null, this._fillIndexData = null, this.scene = t, t._addComponent(this);\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeEvaluateActiveMeshStage.registerStep(ot.a.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER, this, this.reset), this.scene._preActiveMeshStage.registerStep(ot.a.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER, this, this._preActiveMesh), this.scene._evaluateSubMeshStage.registerStep(ot.a.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER, this, this._evaluateSubMesh), this.scene._afterRenderingGroupDrawStage.registerStep(ot.a.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER, this, this.render);\n          }, r.prototype._evaluateSubMesh = function(t, e) {\n            if (t.showSubMeshesBoundingBox) {\n              var n = e.getBoundingInfo();\n              n != null && (n.boundingBox._tag = t.renderingGroupId, this.renderList.push(n.boundingBox));\n            }\n          }, r.prototype._preActiveMesh = function(t) {\n            if (t.showBoundingBox || this.scene.forceShowBoundingBoxes) {\n              var e = t.getBoundingInfo();\n              e.boundingBox._tag = t.renderingGroupId, this.renderList.push(e.boundingBox);\n            }\n          }, r.prototype._prepareResources = function() {\n            if (!this._colorShader) {\n              this._colorShader = new ea.a(\"colorShader\", this.scene, \"color\", { attributes: [Oe.b.PositionKind], uniforms: [\"world\", \"viewProjection\", \"color\"] }), this._colorShader.reservedDataStore = { hidden: !0 };\n              var t = this.scene.getEngine(), e = ht.a.CreateBox({ size: 1 });\n              this._vertexBuffers[Oe.b.PositionKind] = new Oe.b(t, e.positions, Oe.b.PositionKind, !1), this._createIndexBuffer(), this._fillIndexData = e.indices, this.onResourcesReadyObservable.notifyObservers(this);\n            }\n          }, r.prototype._createIndexBuffer = function() {\n            var t = this.scene.getEngine();\n            this._indexBuffer = t.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);\n          }, r.prototype.rebuild = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && t._rebuild(), this._createIndexBuffer();\n          }, r.prototype.reset = function() {\n            this.renderList.reset();\n          }, r.prototype.render = function(t) {\n            if (this.renderList.length !== 0 && this.enabled && (this._prepareResources(), this._colorShader.isReady())) {\n              var e = this.scene.getEngine();\n              e.setDepthWrite(!1), this._colorShader._preBind();\n              for (var n = 0; n < this.renderList.length; n++) {\n                var i = this.renderList.data[n];\n                if (i._tag === t) {\n                  this.onBeforeBoxRenderingObservable.notifyObservers(i);\n                  var o = i.minimum, a = i.maximum.subtract(o), s = o.add(a.scale(0.5)), d = u.a.Scaling(a.x, a.y, a.z).multiply(u.a.Translation(s.x, s.y, s.z)).multiply(i.getWorldMatrix());\n                  e.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), this.showBackLines && (e.setDepthFunctionToGreaterOrEqual(), this.scene.resetCachedMaterial(), this._colorShader.setColor4(\"color\", this.backColor.toColor4()), this._colorShader.bind(d), e.drawElementsType(zt.a.LineListDrawMode, 0, 24)), e.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._colorShader.setColor4(\"color\", this.frontColor.toColor4()), this._colorShader.bind(d), e.drawElementsType(zt.a.LineListDrawMode, 0, 24), this.onAfterBoxRenderingObservable.notifyObservers(i);\n                }\n              }\n              this._colorShader.unbind(), e.setDepthFunctionToLessOrEqual(), e.setDepthWrite(!0);\n            }\n          }, r.prototype.renderOcclusionBoundingBox = function(t) {\n            if (this._prepareResources(), this._colorShader.isReady() && t._boundingInfo) {\n              var e = this.scene.getEngine();\n              this._fillIndexBuffer || (this._fillIndexBuffer = e.createIndexBuffer(this._fillIndexData)), e.setDepthWrite(!1), e.setColorWrite(!1), this._colorShader._preBind();\n              var n = t._boundingInfo.boundingBox, i = n.minimum, o = n.maximum.subtract(i), a = i.add(o.scale(0.5)), s = u.a.Scaling(o.x, o.y, o.z).multiply(u.a.Translation(a.x, a.y, a.z)).multiply(n.getWorldMatrix());\n              e.bindBuffers(this._vertexBuffers, this._fillIndexBuffer, this._colorShader.getEffect()), e.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._colorShader.bind(s), e.drawElementsType(zt.a.TriangleFillMode, 0, 36), this._colorShader.unbind(), e.setDepthFunctionToLessOrEqual(), e.setDepthWrite(!0), e.setColorWrite(!0);\n            }\n          }, r.prototype.dispose = function() {\n            if (this._colorShader) {\n              this.onBeforeBoxRenderingObservable.clear(), this.onAfterBoxRenderingObservable.clear(), this.onResourcesReadyObservable.clear(), this.renderList.dispose(), this._colorShader.dispose();\n              var t = this._vertexBuffers[Oe.b.PositionKind];\n              t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this.scene.getEngine()._releaseBuffer(this._indexBuffer), this._fillIndexBuffer && (this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer), this._fillIndexBuffer = null);\n            }\n          }, r;\n        }();\n        _e.a.prototype.enableDepthRenderer = function(r, t, e) {\n          if (t === void 0 && (t = !1), e === void 0 && (e = !1), !(r = r || this.activeCamera))\n            throw \"No camera available to enable depth renderer\";\n          if (this._depthRenderer || (this._depthRenderer = {}), !this._depthRenderer[r.id]) {\n            var n = !!this.getEngine().getCaps().textureFloatRender, i = 0;\n            i = !this.getEngine().getCaps().textureHalfFloatRender || e && n ? n ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_UNSIGNED_BYTE : h.a.TEXTURETYPE_HALF_FLOAT, this._depthRenderer[r.id] = new Qo(this, i, r, t);\n          }\n          return this._depthRenderer[r.id];\n        }, _e.a.prototype.disableDepthRenderer = function(r) {\n          (r = r || this.activeCamera) && this._depthRenderer && this._depthRenderer[r.id] && (this._depthRenderer[r.id].dispose(), delete this._depthRenderer[r.id]);\n        };\n        var Od = function() {\n          function r(t) {\n            this.name = ot.a.NAME_DEPTHRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets), this.scene._gatherActiveCameraRenderTargetsStage.registerStep(ot.a.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            for (var t in this.scene._depthRenderer)\n              this.scene._depthRenderer[t].dispose();\n          }, r.prototype._gatherRenderTargets = function(t) {\n            if (this.scene._depthRenderer)\n              for (var e in this.scene._depthRenderer) {\n                var n = this.scene._depthRenderer[e];\n                n.enabled && !n.useOnlyInActiveCamera && t.push(n.getDepthMap());\n              }\n          }, r.prototype._gatherActiveCameraRenderTargets = function(t) {\n            if (this.scene._depthRenderer)\n              for (var e in this.scene._depthRenderer) {\n                var n = this.scene._depthRenderer[e];\n                n.enabled && n.useOnlyInActiveCamera && this.scene.activeCamera.id === e && t.push(n.getDepthMap());\n              }\n          }, r;\n        }();\n        Qo._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_DEPTHRENDERER);\n          t || (t = new Od(r), r._addComponent(t));\n        }, ze.a.ShadersStore.linePixelShader = `uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}`;\n        var fg = `#include<instancesDeclaration>\n\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 viewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\n#include<instancesVertex>\nmat4 worldViewProjection=viewProjection*finalWorld;\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}`;\n        ze.a.ShadersStore.lineVertexShader = fg, Mt.a.prototype.disableEdgesRendering = function() {\n          return this._edgesRenderer && (this._edgesRenderer.dispose(), this._edgesRenderer = null), this;\n        }, Mt.a.prototype.enableEdgesRendering = function(r, t, e) {\n          return r === void 0 && (r = 0.95), t === void 0 && (t = !1), this.disableEdgesRendering(), this._edgesRenderer = new Lc(this, r, t, !0, e), this;\n        }, Object.defineProperty(Mt.a.prototype, \"edgesRenderer\", { get: function() {\n          return this._edgesRenderer;\n        }, enumerable: !0, configurable: !0 }), ho.b.prototype.enableEdgesRendering = function(r, t) {\n          return r === void 0 && (r = 0.95), t === void 0 && (t = !1), this.disableEdgesRendering(), this._edgesRenderer = new Md(this, r, t), this;\n        }, ho.a.prototype.enableEdgesRendering = function(r, t) {\n          return r === void 0 && (r = 0.95), t === void 0 && (t = !1), ho.b.prototype.enableEdgesRendering.apply(this, arguments), this;\n        };\n        var pg = function() {\n          this.edges = new Array(), this.edgesConnectedCount = 0;\n        }, Lc = function() {\n          function r(t, e, n, i, o) {\n            var a, s = this;\n            e === void 0 && (e = 0.95), n === void 0 && (n = !1), i === void 0 && (i = !0), this.edgesWidthScalerForOrthographic = 1e3, this.edgesWidthScalerForPerspective = 50, this._linesPositions = new Array(), this._linesNormals = new Array(), this._linesIndices = new Array(), this._buffers = {}, this._buffersForInstances = {}, this._checkVerticesInsteadOfIndices = !1, this.isEnabled = !0, this.customInstances = new si.a(32), this._source = t, this._checkVerticesInsteadOfIndices = n, this._options = o ?? null, this._epsilon = e, this._prepareRessources(), i && ((a = o == null ? void 0 : o.useAlternateEdgeFinder) === null || a === void 0 || a ? this._generateEdgesLinesAlternate() : this._generateEdgesLines()), this._meshRebuildObserver = this._source.onRebuildObservable.add(function() {\n              s._rebuild();\n            }), this._meshDisposeObserver = this._source.onDisposeObservable.add(function() {\n              s.dispose();\n            });\n          }\n          return Object.defineProperty(r.prototype, \"linesPositions\", { get: function() {\n            return this._linesPositions;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"linesNormals\", { get: function() {\n            return this._linesNormals;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"linesIndices\", { get: function() {\n            return this._linesIndices;\n          }, enumerable: !1, configurable: !0 }), r.GetShader = function(t) {\n            if (!t._edgeRenderLineShader) {\n              var e = new ea.a(\"lineShader\", t, \"line\", { attributes: [\"position\", \"normal\"], uniforms: [\"world\", \"viewProjection\", \"color\", \"width\", \"aspectRatio\"] });\n              e.disableDepthWrite = !0, e.backFaceCulling = !1, t._edgeRenderLineShader = e;\n            }\n            return t._edgeRenderLineShader;\n          }, r.prototype._prepareRessources = function() {\n            this._lineShader || (this._lineShader = r.GetShader(this._source.getScene()));\n          }, r.prototype._rebuild = function() {\n            var t = this._buffers[Oe.b.PositionKind];\n            t && t._rebuild(), (t = this._buffers[Oe.b.NormalKind]) && t._rebuild();\n            var e = this._source.getScene().getEngine();\n            this._ib = e.createIndexBuffer(this._linesIndices);\n          }, r.prototype.dispose = function() {\n            this._source.onRebuildObservable.remove(this._meshRebuildObserver), this._source.onDisposeObservable.remove(this._meshDisposeObserver);\n            var t = this._buffers[Oe.b.PositionKind];\n            t && (t.dispose(), this._buffers[Oe.b.PositionKind] = null), (t = this._buffers[Oe.b.NormalKind]) && (t.dispose(), this._buffers[Oe.b.NormalKind] = null), this._ib && this._source.getScene().getEngine()._releaseBuffer(this._ib), this._lineShader.dispose();\n          }, r.prototype._processEdgeForAdjacencies = function(t, e, n, i, o) {\n            return t === n && e === i || t === i && e === n ? 0 : t === i && e === o || t === o && e === i ? 1 : t === o && e === n || t === n && e === o ? 2 : -1;\n          }, r.prototype._processEdgeForAdjacenciesWithVertices = function(t, e, n, i, o) {\n            var a = 1e-10;\n            return t.equalsWithEpsilon(n, a) && e.equalsWithEpsilon(i, a) || t.equalsWithEpsilon(i, a) && e.equalsWithEpsilon(n, a) ? 0 : t.equalsWithEpsilon(i, a) && e.equalsWithEpsilon(o, a) || t.equalsWithEpsilon(o, a) && e.equalsWithEpsilon(i, a) ? 1 : t.equalsWithEpsilon(o, a) && e.equalsWithEpsilon(n, a) || t.equalsWithEpsilon(n, a) && e.equalsWithEpsilon(o, a) ? 2 : -1;\n          }, r.prototype._checkEdge = function(t, e, n, i, o) {\n            var a;\n            e === void 0 ? a = !0 : a = u.e.Dot(n[t], n[e]) < this._epsilon, a && this.createLine(i, o, this._linesPositions.length / 3);\n          }, r.prototype.createLine = function(t, e, n) {\n            this._linesPositions.push(t.x, t.y, t.z, t.x, t.y, t.z, e.x, e.y, e.z, e.x, e.y, e.z), this._linesNormals.push(e.x, e.y, e.z, -1, e.x, e.y, e.z, 1, t.x, t.y, t.z, -1, t.x, t.y, t.z, 1), this._linesIndices.push(n, n + 1, n + 2, n, n + 2, n + 3);\n          }, r.prototype._tessellateTriangle = function(t, e, n, i) {\n            var o = function(Ae, Ee, Se) {\n              Se >= 0 && Ee.push(Se);\n              for (var De = 0; De < Ae.length; ++De)\n                Ee.push(Ae[De][0]);\n            }, a = 0;\n            t[1].length >= t[0].length && t[1].length >= t[2].length ? a = 1 : t[2].length >= t[0].length && t[2].length >= t[1].length && (a = 2);\n            for (var s = 0; s < 3; ++s)\n              s === a ? t[s].sort(function(Ae, Ee) {\n                return Ae[1] < Ee[1] ? -1 : Ae[1] > Ee[1] ? 1 : 0;\n              }) : t[s].sort(function(Ae, Ee) {\n                return Ae[1] > Ee[1] ? -1 : Ae[1] < Ee[1] ? 1 : 0;\n              });\n            var d = [], p = [];\n            o(t[a], d, -1);\n            for (var y = d.length, P = a + 2; P >= a + 1; --P)\n              o(t[P % 3], p, P !== a + 2 ? i[n[e + (P + 1) % 3]] : -1);\n            var R = p.length;\n            n.push(i[n[e + a]], d[0], p[0]), n.push(i[n[e + (a + 1) % 3]], p[R - 1], d[y - 1]);\n            for (var B = y <= R, F = B ? y : R, z = B ? R : y, J = B ? y - 1 : R - 1, ie = B ? 0 : 1, se = y + R - 2, ce = 0, ue = 0, fe = B ? d : p, ve = B ? p : d, Te = 0; se-- > 0; ) {\n              ie ? n.push(fe[ce], ve[ue]) : n.push(ve[ue], fe[ce]);\n              var Re = void 0;\n              (Te += F) >= z && ce < J ? (Re = fe[++ce], Te -= z) : Re = ve[++ue], n.push(Re);\n            }\n            n[e + 0] = n[n.length - 3], n[e + 1] = n[n.length - 2], n[e + 2] = n[n.length - 1], n.length = n.length - 3;\n          }, r.prototype._generateEdgesLinesAlternate = function() {\n            var t, e, n, i, o, a, s, d, p, y = this._source.getVerticesData(Oe.b.PositionKind), P = this._source.getIndices();\n            if (P && y) {\n              Array.isArray(P) || (P = Xe.b.SliceToArray(P));\n              var R = (e = (t = this._options) === null || t === void 0 ? void 0 : t.useFastVertexMerger) === null || e === void 0 || e, B = R ? Math.round(-Math.log((i = (n = this._options) === null || n === void 0 ? void 0 : n.epsilonVertexMerge) !== null && i !== void 0 ? i : 1e-6) / Math.log(10)) : (a = (o = this._options) === null || o === void 0 ? void 0 : o.epsilonVertexMerge) !== null && a !== void 0 ? a : 1e-6, F = [], z = [];\n              if (R)\n                for (var J = {}, ie = 0; ie < y.length; ie += 3) {\n                  var se = y[ie + 0], ce = y[ie + 1], ue = y[ie + 2];\n                  if (J[Rt = se.toFixed(B) + \"|\" + ce.toFixed(B) + \"|\" + ue.toFixed(B)] !== void 0)\n                    F.push(J[Rt]);\n                  else {\n                    var fe = ie / 3;\n                    J[Rt] = fe, F.push(fe), z.push(fe);\n                  }\n                }\n              else\n                for (ie = 0; ie < y.length; ie += 3) {\n                  se = y[ie + 0], ce = y[ie + 1], ue = y[ie + 2];\n                  for (var ve = !1, Te = 0; Te < ie && !ve; Te += 3) {\n                    var Re = y[Te + 0], Ae = y[Te + 1], Ee = y[Te + 2];\n                    if (Math.abs(se - Re) < B && Math.abs(ce - Ae) < B && Math.abs(ue - Ee) < B) {\n                      F.push(Te / 3), ve = !0;\n                      break;\n                    }\n                  }\n                  ve || (F.push(ie / 3), z.push(ie / 3));\n                }\n              if (!((s = this._options) === null || s === void 0) && s.applyTessellation) {\n                for (var Se = (p = (d = this._options) === null || d === void 0 ? void 0 : d.epsilonVertexAligned) !== null && p !== void 0 ? p : 1e-6, De = [], xe = 0; xe < P.length; xe += 3)\n                  for (var Le = void 0, Me = 0; Me < 3; ++Me) {\n                    var we = F[P[xe + Me]], Ye = F[P[xe + (Me + 1) % 3]], et = F[P[xe + (Me + 2) % 3]];\n                    if (we !== Ye)\n                      for (var nt = y[3 * we + 0], ct = y[3 * we + 1], Ke = y[3 * we + 2], rt = y[3 * Ye + 0], it = y[3 * Ye + 1], qe = y[3 * Ye + 2], ut = Math.sqrt((rt - nt) * (rt - nt) + (it - ct) * (it - ct) + (qe - Ke) * (qe - Ke)), Ve = 0; Ve < z.length - 1; Ve++) {\n                        var Ze = z[Ve];\n                        if (Ze !== we && Ze !== Ye && Ze !== et) {\n                          var vt = y[3 * Ze + 0], jt = y[3 * Ze + 1], Dt = y[3 * Ze + 2], Yt = Math.sqrt((vt - nt) * (vt - nt) + (jt - ct) * (jt - ct) + (Dt - Ke) * (Dt - Ke)), mt = Math.sqrt((vt - rt) * (vt - rt) + (jt - it) * (jt - it) + (Dt - qe) * (Dt - qe));\n                          Math.abs(Yt + mt - ut) < Se && (Le || (Le = { index: xe, edgesPoints: [[], [], []] }, De.push(Le)), Le.edgesPoints[Me].push([Ze, Yt]));\n                        }\n                      }\n                  }\n                for (var qt = 0; qt < De.length; ++qt) {\n                  var Ht = De[qt];\n                  this._tessellateTriangle(Ht.edgesPoints, Ht.index, P, F);\n                }\n                De = null;\n              }\n              var kt = {};\n              for (xe = 0; xe < P.length; xe += 3) {\n                var Wt = void 0;\n                for (Me = 0; Me < 3; ++Me)\n                  if (we = F[P[xe + Me]], Ye = F[P[xe + (Me + 1) % 3]], et = F[P[xe + (Me + 2) % 3]], we !== Ye) {\n                    if (u.c.Vector3[0].copyFromFloats(y[3 * we + 0], y[3 * we + 1], y[3 * we + 2]), u.c.Vector3[1].copyFromFloats(y[3 * Ye + 0], y[3 * Ye + 1], y[3 * Ye + 2]), u.c.Vector3[2].copyFromFloats(y[3 * et + 0], y[3 * et + 1], y[3 * et + 2]), Wt || (u.c.Vector3[1].subtractToRef(u.c.Vector3[0], u.c.Vector3[3]), u.c.Vector3[2].subtractToRef(u.c.Vector3[1], u.c.Vector3[4]), (Wt = u.e.Cross(u.c.Vector3[3], u.c.Vector3[4])).normalize()), we > Ye) {\n                      var bt = we;\n                      we = Ye, Ye = bt;\n                    }\n                    (Zt = kt[Rt = we + \"_\" + Ye]) ? Zt.done || (u.e.Dot(Wt, Zt.normal) < this._epsilon && this.createLine(u.c.Vector3[0], u.c.Vector3[1], this._linesPositions.length / 3), Zt.done = !0) : kt[Rt] = { normal: Wt, done: !1, index: xe, i: Me };\n                  }\n              }\n              for (var Rt in kt) {\n                var Zt;\n                (Zt = kt[Rt]).done || (we = F[P[Zt.index + Zt.i]], Ye = F[P[Zt.index + (Zt.i + 1) % 3]], u.c.Vector3[0].copyFromFloats(y[3 * we + 0], y[3 * we + 1], y[3 * we + 2]), u.c.Vector3[1].copyFromFloats(y[3 * Ye + 0], y[3 * Ye + 1], y[3 * Ye + 2]), this.createLine(u.c.Vector3[0], u.c.Vector3[1], this._linesPositions.length / 3));\n              }\n              var Mn = this._source.getScene().getEngine();\n              this._buffers[Oe.b.PositionKind] = new Oe.b(Mn, this._linesPositions, Oe.b.PositionKind, !1), this._buffers[Oe.b.NormalKind] = new Oe.b(Mn, this._linesNormals, Oe.b.NormalKind, !1, !1, 4), this._buffersForInstances[Oe.b.PositionKind] = this._buffers[Oe.b.PositionKind], this._buffersForInstances[Oe.b.NormalKind] = this._buffers[Oe.b.NormalKind], this._ib = Mn.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;\n            }\n          }, r.prototype._generateEdgesLines = function() {\n            var t = this._source.getVerticesData(Oe.b.PositionKind), e = this._source.getIndices();\n            if (e && t) {\n              var n, i, o = new Array(), a = new Array();\n              for (n = 0; n < e.length; n += 3) {\n                i = new pg();\n                var s = e[n], d = e[n + 1], p = e[n + 2];\n                i.p0 = new u.e(t[3 * s], t[3 * s + 1], t[3 * s + 2]), i.p1 = new u.e(t[3 * d], t[3 * d + 1], t[3 * d + 2]), i.p2 = new u.e(t[3 * p], t[3 * p + 1], t[3 * p + 2]);\n                var y = u.e.Cross(i.p1.subtract(i.p0), i.p2.subtract(i.p1));\n                y.normalize(), a.push(y), o.push(i);\n              }\n              for (n = 0; n < o.length; n++) {\n                i = o[n];\n                for (var P = n + 1; P < o.length; P++) {\n                  var R = o[P];\n                  if (i.edgesConnectedCount === 3)\n                    break;\n                  if (R.edgesConnectedCount !== 3)\n                    for (var B = e[3 * P], F = e[3 * P + 1], z = e[3 * P + 2], J = 0; J < 3; J++) {\n                      var ie = 0;\n                      if (i.edges[J] === void 0) {\n                        switch (J) {\n                          case 0:\n                            ie = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(i.p0, i.p1, R.p0, R.p1, R.p2) : this._processEdgeForAdjacencies(e[3 * n], e[3 * n + 1], B, F, z);\n                            break;\n                          case 1:\n                            ie = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(i.p1, i.p2, R.p0, R.p1, R.p2) : this._processEdgeForAdjacencies(e[3 * n + 1], e[3 * n + 2], B, F, z);\n                            break;\n                          case 2:\n                            ie = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(i.p2, i.p0, R.p0, R.p1, R.p2) : this._processEdgeForAdjacencies(e[3 * n + 2], e[3 * n], B, F, z);\n                        }\n                        if (ie !== -1 && (i.edges[J] = P, R.edges[ie] = n, i.edgesConnectedCount++, R.edgesConnectedCount++, i.edgesConnectedCount === 3))\n                          break;\n                      }\n                    }\n                }\n              }\n              for (n = 0; n < o.length; n++) {\n                var se = o[n];\n                this._checkEdge(n, se.edges[0], a, se.p0, se.p1), this._checkEdge(n, se.edges[1], a, se.p1, se.p2), this._checkEdge(n, se.edges[2], a, se.p2, se.p0);\n              }\n              var ce = this._source.getScene().getEngine();\n              this._buffers[Oe.b.PositionKind] = new Oe.b(ce, this._linesPositions, Oe.b.PositionKind, !1), this._buffers[Oe.b.NormalKind] = new Oe.b(ce, this._linesNormals, Oe.b.NormalKind, !1, !1, 4), this._buffersForInstances[Oe.b.PositionKind] = this._buffers[Oe.b.PositionKind], this._buffersForInstances[Oe.b.NormalKind] = this._buffers[Oe.b.NormalKind], this._ib = ce.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;\n            }\n          }, r.prototype.isReady = function() {\n            return this._lineShader.isReady(this._source, this._source.hasInstances && this.customInstances.length > 0 || this._source.hasThinInstances);\n          }, r.prototype.render = function() {\n            var t = this._source.getScene();\n            if (this.isReady() && t.activeCamera) {\n              var e = t.getEngine();\n              this._lineShader._preBind(), this._source.edgesColor.a !== 1 ? e.setAlphaMode(h.a.ALPHA_COMBINE) : e.setAlphaMode(h.a.ALPHA_DISABLE);\n              var n = this._source.hasInstances && this.customInstances.length > 0, i = n || this._source.hasThinInstances, o = 0;\n              if (i)\n                if (this._buffersForInstances.world0 = this._source.getVertexBuffer(\"world0\"), this._buffersForInstances.world1 = this._source.getVertexBuffer(\"world1\"), this._buffersForInstances.world2 = this._source.getVertexBuffer(\"world2\"), this._buffersForInstances.world3 = this._source.getVertexBuffer(\"world3\"), n) {\n                  var a = this._source._instanceDataStorage;\n                  if (o = this.customInstances.length, !a.isFrozen) {\n                    for (var s = 0, d = 0; d < o; ++d)\n                      this.customInstances.data[d].copyToArray(a.instancesData, s), s += 16;\n                    a.instancesBuffer.updateDirectly(a.instancesData, 0, o);\n                  }\n                } else\n                  o = this._source.thinInstanceCount;\n              e.bindBuffers(i ? this._buffersForInstances : this._buffers, this._ib, this._lineShader.getEffect()), t.resetCachedMaterial(), this._lineShader.setColor4(\"color\", this._source.edgesColor), t.activeCamera.mode === _t.a.ORTHOGRAPHIC_CAMERA ? this._lineShader.setFloat(\"width\", this._source.edgesWidth / this.edgesWidthScalerForOrthographic) : this._lineShader.setFloat(\"width\", this._source.edgesWidth / this.edgesWidthScalerForPerspective), this._lineShader.setFloat(\"aspectRatio\", e.getAspectRatio(t.activeCamera)), this._lineShader.bind(this._source.getWorldMatrix()), e.drawElementsType(zt.a.TriangleFillMode, 0, this._indicesCount, o), this._lineShader.unbind(), i && e.unbindInstanceAttributes(), this._source.getScene()._activeMeshesFrozen || this.customInstances.reset();\n            }\n          }, r;\n        }(), Md = function(r) {\n          function t(e, n, i) {\n            n === void 0 && (n = 0.95), i === void 0 && (i = !1);\n            var o = r.call(this, e, n, i, !1) || this;\n            return o._generateEdgesLines(), o;\n          }\n          return Object(c.d)(t, r), t.prototype._generateEdgesLines = function() {\n            var e = this._source.getVerticesData(Oe.b.PositionKind), n = this._source.getIndices();\n            if (n && e) {\n              for (var i = u.c.Vector3[0], o = u.c.Vector3[1], a = n.length - 1, s = 0, d = 0; s < a; s += 2, d += 4)\n                u.e.FromArrayToRef(e, 3 * n[s], i), u.e.FromArrayToRef(e, 3 * n[s + 1], o), this.createLine(i, o, d);\n              var p = this._source.getScene().getEngine();\n              this._buffers[Oe.b.PositionKind] = new Oe.b(p, this._linesPositions, Oe.b.PositionKind, !1), this._buffers[Oe.b.NormalKind] = new Oe.b(p, this._linesNormals, Oe.b.NormalKind, !1, !1, 4), this._ib = p.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;\n            }\n          }, t;\n        }(Lc), Nc = function() {\n          function r(t) {\n            this._textureFormats = [{ type: h.a.PREPASS_IRRADIANCE_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_POSITION_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_VELOCITY_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, format: h.a.TEXTURETYPE_UNSIGNED_INT }, { type: h.a.PREPASS_COLOR_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_ALBEDO_TEXTURE_TYPE, format: h.a.TEXTURETYPE_UNSIGNED_INT }], this.excludedSkinnedMesh = [], this.excludedMaterials = [], this._textureIndices = [], this._isDirty = !1, this.mrtCount = 0, this._postProcesses = [], this._clearColor = new I.b(0, 0, 0, 0), this._effectConfigurations = [], this._mrtFormats = [], this._enabled = !1, this._useGeometryBufferFallback = !1, this.disableGammaTransform = !1, this._scene = t, this._engine = t.getEngine(), r._SceneComponentInitialization(this._scene), this._resetLayout();\n          }\n          return Object.defineProperty(r.prototype, \"enabled\", { get: function() {\n            return this._enabled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this.prePassRT.samples;\n          }, set: function(t) {\n            this.imageProcessingPostProcess || this._createCompositionEffect(), this.prePassRT.samples = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useGeometryBufferFallback\", { get: function() {\n            return this._useGeometryBufferFallback;\n          }, set: function(t) {\n            if (this._useGeometryBufferFallback = t, t) {\n              if (this._geometryBuffer = this._scene.enableGeometryBufferRenderer(), !this._geometryBuffer)\n                return void (this._useGeometryBufferFallback = !1);\n              this._geometryBuffer.renderList = [], this._geometryBuffer._linkPrePassRenderer(this), this._updateGeometryBufferLayout();\n            } else\n              this._geometryBuffer && this._geometryBuffer._unlinkPrePassRenderer(), this._geometryBuffer = null, this._scene.disableGeometryBufferRenderer();\n          }, enumerable: !1, configurable: !0 }), r.prototype._initializeAttachments = function() {\n            for (var t = [], e = [!1], n = [!0], i = 0; i < this.mrtCount; i++)\n              t.push(!0), i > 0 && (e.push(!0), n.push(!1));\n            this._multiRenderAttachments = this._engine.buildTextureLayout(t), this._clearAttachments = this._engine.buildTextureLayout(e), this._defaultAttachments = this._engine.buildTextureLayout(n);\n          }, r.prototype._createCompositionEffect = function() {\n            this.prePassRT = new Vs(\"sceneprePassRT\", { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, this.mrtCount, this._scene, { generateMipMaps: !1, generateDepthTexture: !0, defaultType: h.a.TEXTURETYPE_UNSIGNED_INT, types: this._mrtFormats }), this.prePassRT.samples = 1, this._initializeAttachments(), this._useGeometryBufferFallback && !this._geometryBuffer && (this.useGeometryBufferFallback = !0), this.imageProcessingPostProcess = new Io(\"sceneCompositionPass\", 1, null, void 0, this._engine), this.imageProcessingPostProcess.autoClear = !1;\n          }, Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            return this._engine.webGLVersion > 1 || this._scene.getEngine().getCaps().drawBuffersExtension;\n          }, enumerable: !1, configurable: !0 }), r.prototype.bindAttachmentsForEffect = function(t, e) {\n            if (this.enabled) {\n              if (t._multiTarget)\n                this._engine.bindAttachments(this._multiRenderAttachments);\n              else if (this._engine.bindAttachments(this._defaultAttachments), this._geometryBuffer) {\n                var n = e.getMaterial();\n                n && this.excludedMaterials.indexOf(n) === -1 && this._geometryBuffer.renderList.push(e.getRenderingMesh());\n              }\n            }\n          }, r.prototype.restoreAttachments = function() {\n            this.enabled && this._defaultAttachments && this._engine.bindAttachments(this._defaultAttachments);\n          }, r.prototype._beforeCameraDraw = function() {\n            this._isDirty && this._update(), this._geometryBuffer && (this._geometryBuffer.renderList.length = 0), this._bindFrameBuffer();\n          }, r.prototype._afterCameraDraw = function() {\n            if (this._enabled) {\n              var t = this._scene.activeCamera && this._scene.activeCamera._getFirstPostProcess();\n              t && this._postProcesses.length && this._scene.postProcessManager._prepareFrame(), this._scene.postProcessManager.directRender(this._postProcesses, t ? t.inputTexture : null);\n            }\n          }, r.prototype._checkRTSize = function() {\n            var t = this._engine.getRenderWidth(!0), e = this._engine.getRenderHeight(!0), n = this.prePassRT.getRenderWidth(), i = this.prePassRT.getRenderHeight();\n            n === t && i === e || (this.prePassRT.resize({ width: t, height: e }), this._updateGeometryBufferLayout(), this._bindPostProcessChain());\n          }, r.prototype._bindFrameBuffer = function() {\n            if (this._enabled) {\n              this._checkRTSize();\n              var t = this.prePassRT.getInternalTexture();\n              t && this._engine.bindFramebuffer(t);\n            }\n          }, r.prototype.clear = function() {\n            this._enabled && (this._bindFrameBuffer(), this._engine.clear(this._scene.clearColor, this._scene.autoClear || this._scene.forceWireframe || this._scene.forcePointsCloud, this._scene.autoClearDepthAndStencil, this._scene.autoClearDepthAndStencil), this._engine.bindAttachments(this._clearAttachments), this._engine.clear(this._clearColor, !0, !1, !1), this._engine.bindAttachments(this._defaultAttachments));\n          }, r.prototype._setState = function(t) {\n            this._enabled = t, this._scene.prePass = t, this.imageProcessingPostProcess && (this.imageProcessingPostProcess.imageProcessingConfiguration.applyByPostProcess = t);\n          }, r.prototype._updateGeometryBufferLayout = function() {\n            if (this._geometryBuffer) {\n              this._geometryBuffer._resetLayout();\n              for (var t = [], e = 0; e < this._mrtLayout.length; e++)\n                t.push(!1);\n              this._geometryBuffer._linkInternalTexture(this.prePassRT.getInternalTexture());\n              var n = [{ prePassConstant: h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, geometryBufferConstant: ri.DEPTHNORMAL_TEXTURE_TYPE }, { prePassConstant: h.a.PREPASS_POSITION_TEXTURE_TYPE, geometryBufferConstant: ri.POSITION_TEXTURE_TYPE }, { prePassConstant: h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, geometryBufferConstant: ri.REFLECTIVITY_TEXTURE_TYPE }, { prePassConstant: h.a.PREPASS_VELOCITY_TEXTURE_TYPE, geometryBufferConstant: ri.VELOCITY_TEXTURE_TYPE }];\n              for (e = 0; e < n.length; e++) {\n                var i = this._mrtLayout.indexOf(n[e].prePassConstant);\n                i !== -1 && (this._geometryBuffer._forceTextureType(n[e].geometryBufferConstant, i), t[i] = !0);\n              }\n              this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(t));\n            }\n          }, r.prototype.addEffectConfiguration = function(t) {\n            for (var e = 0; e < this._effectConfigurations.length; e++)\n              if (this._effectConfigurations[e].name === t.name)\n                return this._effectConfigurations[e];\n            return this._effectConfigurations.push(t), t;\n          }, r.prototype.getIndex = function(t) {\n            return this._textureIndices[t];\n          }, r.prototype._enable = function() {\n            for (var t, e, n = this.mrtCount, i = 0; i < this._effectConfigurations.length; i++)\n              this._effectConfigurations[i].enabled && this._enableTextures(this._effectConfigurations[i].texturesRequired);\n            for (this.prePassRT && this.mrtCount !== n && this.prePassRT.updateCount(this.mrtCount, { types: this._mrtFormats }), this._updateGeometryBufferLayout(), this._resetPostProcessChain(), i = 0; i < this._effectConfigurations.length; i++)\n              this._effectConfigurations[i].enabled && (!this._effectConfigurations[i].postProcess && this._effectConfigurations[i].createPostProcess && this._effectConfigurations[i].createPostProcess(), this._effectConfigurations[i].postProcess && this._postProcesses.push(this._effectConfigurations[i].postProcess));\n            this._initializeAttachments(), this.imageProcessingPostProcess || this._createCompositionEffect();\n            var o = !1;\n            if (!((t = this._scene.activeCamera) === null || t === void 0) && t._postProcesses)\n              for (i = 0; i < this._scene.activeCamera._postProcesses.length; i++)\n                ((e = this._scene.activeCamera._postProcesses[i]) === null || e === void 0 ? void 0 : e.getClassName()) === \"ImageProcessingPostProcess\" && (o = !0);\n            o || this.disableGammaTransform || this._postProcesses.push(this.imageProcessingPostProcess), this._bindPostProcessChain(), this._setState(!0);\n          }, r.prototype._disable = function() {\n            this._setState(!1), this._resetLayout();\n            for (var t = 0; t < this._effectConfigurations.length; t++)\n              this._effectConfigurations[t].enabled = !1;\n          }, r.prototype._resetLayout = function() {\n            for (var t = 0; t < this._textureFormats.length; t++)\n              this._textureIndices[this._textureFormats[t].type] = -1;\n            this._textureIndices[h.a.PREPASS_COLOR_TEXTURE_TYPE] = 0, this._mrtLayout = [h.a.PREPASS_COLOR_TEXTURE_TYPE], this._mrtFormats = [h.a.TEXTURETYPE_HALF_FLOAT], this.mrtCount = 1;\n          }, r.prototype._resetPostProcessChain = function() {\n            this._postProcesses = [], this.imageProcessingPostProcess && this.imageProcessingPostProcess.restoreDefaultInputTexture();\n            for (var t = 0; t < this._effectConfigurations.length; t++)\n              this._effectConfigurations[t].postProcess && this._effectConfigurations[t].postProcess.restoreDefaultInputTexture();\n          }, r.prototype._bindPostProcessChain = function() {\n            var t;\n            if (this._postProcesses.length)\n              this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture();\n            else {\n              var e = (t = this._scene.activeCamera) === null || t === void 0 ? void 0 : t._getFirstPostProcess();\n              e && (e.inputTexture = this.prePassRT.getInternalTexture());\n            }\n          }, r.prototype.markAsDirty = function() {\n            this._isDirty = !0;\n          }, r.prototype._enableTextures = function(t) {\n            for (var e = 0; e < t.length; e++) {\n              var n = t[e];\n              this._textureIndices[n] === -1 && (this._textureIndices[n] = this._mrtLayout.length, this._mrtLayout.push(n), this._mrtFormats.push(this._textureFormats[n].format), this.mrtCount++);\n            }\n          }, r.prototype._update = function() {\n            this._disable();\n            for (var t = !1, e = 0; e < this._scene.materials.length; e++)\n              this._scene.materials[e].setPrePassRenderer(this) && (t = !0);\n            var n = this._scene.activeCamera;\n            if (n) {\n              var i = n._postProcesses.filter(function(o) {\n                return o != null;\n              });\n              if (i)\n                for (e = 0; e < i.length; e++)\n                  i[e].setPrePassRenderer(this) && (t = !0);\n              this._markAllMaterialsAsPrePassDirty(), this._isDirty = !1, t && this._enable(), this.enabled || (this._engine.restoreDefaultFramebuffer(), this._engine.restoreSingleAttachment());\n            }\n          }, r.prototype._markAllMaterialsAsPrePassDirty = function() {\n            for (var t = this._scene.materials, e = 0; e < t.length; e++)\n              t[e].markAsDirty(zt.a.PrePassDirtyFlag);\n          }, r.prototype.dispose = function() {\n            for (var t = 0; t < this._effectConfigurations.length; t++)\n              this._effectConfigurations[t].dispose && this._effectConfigurations[t].dispose();\n            this.imageProcessingPostProcess.dispose(), this.prePassRT.dispose();\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"PrePassRendererSceneComponent\");\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"prePassRenderer\", { get: function() {\n          return this._prePassRenderer;\n        }, set: function(r) {\n          r && r.isSupported && (this._prePassRenderer = r);\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.enablePrePassRenderer = function() {\n          return this._prePassRenderer || (this._prePassRenderer = new Nc(this), this._prePassRenderer.isSupported || (this._prePassRenderer = null, l.a.Error(`PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering`))), this._prePassRenderer;\n        }, _e.a.prototype.disablePrePassRenderer = function() {\n          this._prePassRenderer && (this._prePassRenderer.dispose(), this._prePassRenderer = null);\n        };\n        var Id = function() {\n          function r(t) {\n            this.name = ot.a.NAME_PREPASSRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraDrawStage.registerStep(ot.a.STEP_BEFORECAMERADRAW_PREPASS, this, this._beforeCameraDraw), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterCameraDraw), this.scene._beforeClearStage.registerStep(ot.a.STEP_BEFORECLEARSTAGE_PREPASS, this, this._beforeClearStage), this.scene._beforeRenderingMeshStage.registerStep(ot.a.STEP_BEFORERENDERINGMESH_PREPASS, this, this._beforeRenderingMeshStage), this.scene._afterRenderingMeshStage.registerStep(ot.a.STEP_AFTERRENDERINGMESH_PREPASS, this, this._afterRenderingMeshStage);\n          }, r.prototype._beforeCameraDraw = function() {\n            this.scene.prePassRenderer && this.scene.prePassRenderer._beforeCameraDraw();\n          }, r.prototype._afterCameraDraw = function() {\n            this.scene.prePassRenderer && this.scene.prePassRenderer._afterCameraDraw();\n          }, r.prototype._beforeClearStage = function() {\n            this.scene.prePassRenderer && this.scene.prePassRenderer.clear();\n          }, r.prototype._beforeRenderingMeshStage = function(t, e, n, i) {\n            if (i) {\n              var o = t.getScene();\n              o.prePassRenderer && o.prePassRenderer.bindAttachmentsForEffect(i, e);\n            }\n          }, r.prototype._afterRenderingMeshStage = function(t) {\n            var e = t.getScene();\n            e.prePassRenderer && e.prePassRenderer.restoreAttachments();\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r;\n        }();\n        Nc._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_PREPASSRENDERER);\n          t || (t = new Id(r), r._addComponent(t));\n        };\n        var _g = `#define rcp(x) 1./x\n#define GOLDEN_RATIO 1.618033988749895\n#define TWO_PI 6.2831855\n\n\nvec2 Golden2dSeq(int i,float n)\n{\n\n\nreturn vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));\n}\nvec2 SampleDiskGolden(int i,int sampleCount)\n{\nvec2 f=Golden2dSeq(i,float(sampleCount));\nreturn vec2(sqrt(f.x),TWO_PI*f.y);\n}`;\n        ze.a.IncludesShadersStore.fibonacci = _g;\n        var mg = `uniform vec3 diffusionS[5];\nuniform float diffusionD[5];\nuniform float filterRadii[5];`;\n        ze.a.IncludesShadersStore.diffusionProfile = mg;\n        var gg = `\n#include<fibonacci>\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<diffusionProfile>\nvarying vec2 vUV;\nuniform vec2 texelSize;\nuniform sampler2D textureSampler;\nuniform sampler2D irradianceSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D albedoSampler;\nuniform vec2 viewportSize;\nuniform float metersPerUnit;\nconst float LOG2_E=1.4426950408889634;\nconst float SSS_PIXELS_PER_SAMPLE=4.;\nconst int _SssSampleBudget=40;\n#define rcp(x) 1./x\n#define Sq(x) x*x\n#define SSS_BILATERAL_FILTER true\n\n\nvec3 EvalBurleyDiffusionProfile(float r,vec3 S)\n{\nvec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S);\nvec3 expSum=exp_13*(1.+exp_13*exp_13);\nreturn (S*rcp(8.*PI))*expSum;\n}\n\n\n\n\n\n\nvec2 SampleBurleyDiffusionProfile(float u,float rcpS)\n{\nu=1.-u;\nfloat g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));\nfloat n=exp2(log2(g)*(-1.0/3.0));\nfloat p=(g*n)*n;\nfloat c=1.+p+n;\nfloat d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u);\nfloat x=(3./LOG2_E)*log2(c)-d;\n\n\n\n\n\n\nfloat rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));\nfloat r=x*rcpS;\nfloat rcpPdf=(8.*PI*rcpS)*rcpExp;\nreturn vec2(r,rcpPdf);\n}\n\n\nvec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)\n{\n#ifndef SSS_BILATERAL_FILTER\nz=0.;\n#endif\n\n\n\nfloat r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));\nfloat area=rcpPdf;\n#if SSS_CLAMP_ARTIFACT\nreturn clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);\n#else\nreturn EvalBurleyDiffusionProfile(r,S)*area;\n#endif\n}\nvoid EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,\nfloat phase,inout vec3 totalIrradiance,inout vec3 totalWeight)\n{\n\nfloat scale=rcp(float(n));\nfloat offset=rcp(float(n))*0.5;\n\nfloat sinPhase,cosPhase;\nsinPhase=sin(phase);\ncosPhase=cos(phase);\nvec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);\nfloat r=bdp.x;\nfloat rcpPdf=bdp.y;\nfloat phi=SampleDiskGolden(i,n).y;\nfloat sinPhi,cosPhi;\nsinPhi=sin(phi);\ncosPhi=cos(phi);\nfloat sinPsi=cosPhase*sinPhi+sinPhase*cosPhi;\nfloat cosPsi=cosPhase*cosPhi-sinPhase*sinPhi;\nvec2 vec=r*vec2(cosPsi,sinPsi);\n\nvec2 position;\nfloat xy2;\nposition=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;\nxy2=r*r;\nvec4 textureSample=texture2D(irradianceSampler,position);\nfloat viewZ=texture2D(depthSampler,position).r;\nvec3 irradiance=textureSample.rgb;\nif (testLightingForSSS(textureSample.a))\n{\n\nfloat relZ=viewZ-centerPosVS.z;\nvec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);\ntotalIrradiance+=weight*irradiance;\ntotalWeight+=weight;\n}\nelse\n{\n\n\n\n\n\n\n}\n}\nvoid main(void)\n{\nvec4 irradianceAndDiffusionProfile=texture2D(irradianceSampler,vUV);\nvec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;\nint diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));\nfloat centerDepth=0.;\nvec4 inputColor=texture2D(textureSampler,vUV);\nbool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);\nif (passedStencilTest)\n{\ncenterDepth=texture2D(depthSampler,vUV).r;\n}\nif (!passedStencilTest) {\ngl_FragColor=inputColor;\nreturn;\n}\nfloat distScale=1.;\nvec3 S=diffusionS[diffusionProfileIndex];\nfloat d=diffusionD[diffusionProfileIndex];\nfloat filterRadius=filterRadii[diffusionProfileIndex];\n\nvec2 centerPosNDC=vUV;\nvec2 cornerPosNDC=vUV+0.5*texelSize;\nvec3 centerPosVS=vec3(centerPosNDC*viewportSize,1.0)*centerDepth;\nvec3 cornerPosVS=vec3(cornerPosNDC*viewportSize,1.0)*centerDepth;\n\nfloat mmPerUnit=1000.*(metersPerUnit*rcp(distScale));\nfloat unitsPerMm=rcp(mmPerUnit);\n\n\nfloat unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);\nfloat pixelsPerMm=rcp(unitsPerPixel)*unitsPerMm;\n\nfloat filterArea=PI*Sq(filterRadius*pixelsPerMm);\nint sampleCount=int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));\nint sampleBudget=_SssSampleBudget;\nint texturingMode=0;\nvec3 albedo=texture2D(albedoSampler,vUV).rgb;\nif (distScale == 0. || sampleCount<1)\n{\n#ifdef DEBUG_SSS_SAMPLES\nvec3 green=vec3(0.,1.,0.);\ngl_FragColor=vec4(green,1.0);\nreturn;\n#endif\ngl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);\nreturn;\n}\n#ifdef DEBUG_SSS_SAMPLES\nvec3 red=vec3(1.,0.,0.);\nvec3 blue=vec3(0.,0.,1.);\ngl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);\nreturn;\n#endif\n\nfloat phase=0.;\nint n=min(sampleCount,sampleBudget);\n\nvec3 centerWeight=vec3(0.);\nvec3 totalIrradiance=vec3(0.);\nvec3 totalWeight=vec3(0.);\nfor (int i=0; i<n; i++)\n{\n\nEvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,\nphase,totalIrradiance,totalWeight);\n}\n\ntotalWeight=max(totalWeight,HALF_MIN);\ngl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);\n}`;\n        ze.a.ShadersStore.subSurfaceScatteringPixelShader = gg;\n        var vg = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            o === void 0 && (o = null), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, e, \"subSurfaceScattering\", [\"texelSize\", \"viewportSize\", \"metersPerUnit\"], [\"diffusionS\", \"diffusionD\", \"filterRadii\", \"irradianceSampler\", \"depthSampler\", \"albedoSampler\"], i, o, a || Ne.a.BILINEAR_SAMPLINGMODE, s, d, null, p, \"postprocess\", void 0, !0) || this;\n            return y._scene = n, y.updateEffect(), y.onApplyObservable.add(function(P) {\n              if (n.prePassRenderer && n.subSurfaceConfiguration) {\n                var R = y.texelSize;\n                P.setFloat(\"metersPerUnit\", n.subSurfaceConfiguration.metersPerUnit), P.setFloat2(\"texelSize\", R.x, R.y), P.setTexture(\"irradianceSampler\", n.prePassRenderer.prePassRT.textures[n.prePassRenderer.getIndex(h.a.PREPASS_IRRADIANCE_TEXTURE_TYPE)]), P.setTexture(\"depthSampler\", n.prePassRenderer.prePassRT.textures[n.prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), P.setTexture(\"albedoSampler\", n.prePassRenderer.prePassRT.textures[n.prePassRenderer.getIndex(h.a.PREPASS_ALBEDO_TEXTURE_TYPE)]), P.setFloat2(\"viewportSize\", Math.tan(n.activeCamera.fov / 2) * n.getEngine().getAspectRatio(n.activeCamera, !0), Math.tan(n.activeCamera.fov / 2)), P.setArray3(\"diffusionS\", n.subSurfaceConfiguration.ssDiffusionS), P.setArray(\"diffusionD\", n.subSurfaceConfiguration.ssDiffusionD), P.setArray(\"filterRadii\", n.subSurfaceConfiguration.ssFilterRadii);\n              } else\n                l.a.Error(\"PrePass and subsurface configuration needs to be enabled for subsurface scattering.\");\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SubSurfaceScatteringPostProcess\";\n          }, t;\n        }(ft), Dd = function() {\n          function r(t) {\n            this._ssDiffusionS = [], this._ssFilterRadii = [], this._ssDiffusionD = [], this.enabled = !1, this.name = ot.a.NAME_SUBSURFACE, this.ssDiffusionProfileColors = [], this.metersPerUnit = 1, this.texturesRequired = [h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, h.a.PREPASS_ALBEDO_TEXTURE_TYPE, h.a.PREPASS_COLOR_TEXTURE_TYPE, h.a.PREPASS_IRRADIANCE_TEXTURE_TYPE], this.addDiffusionProfile(new I.a(1, 1, 1)), this._scene = t, r._SceneComponentInitialization(this._scene);\n          }\n          return Object.defineProperty(r.prototype, \"ssDiffusionS\", { get: function() {\n            return this._ssDiffusionS;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ssDiffusionD\", { get: function() {\n            return this._ssDiffusionD;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ssFilterRadii\", { get: function() {\n            return this._ssFilterRadii;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addDiffusionProfile = function(t) {\n            if (this.ssDiffusionD.length >= 5)\n              return l.a.Error(\"You already reached the maximum number of diffusion profiles.\"), 0;\n            for (var e = 0; e < this._ssDiffusionS.length / 3; e++)\n              if (this._ssDiffusionS[3 * e] === t.r && this._ssDiffusionS[3 * e + 1] === t.g && this._ssDiffusionS[3 * e + 2] === t.b)\n                return e;\n            return this._ssDiffusionS.push(t.r, t.b, t.g), this._ssDiffusionD.push(Math.max(Math.max(t.r, t.b), t.g)), this._ssFilterRadii.push(this.getDiffusionProfileParameters(t)), this.ssDiffusionProfileColors.push(t), this._ssDiffusionD.length - 1;\n          }, r.prototype.createPostProcess = function() {\n            return this.postProcess = new vg(\"subSurfaceScattering\", this._scene, 1, null, void 0, this._scene.getEngine()), this.postProcess.autoClear = !1, this.postProcess;\n          }, r.prototype.clearAllDiffusionProfiles = function() {\n            this._ssDiffusionD = [], this._ssDiffusionS = [], this._ssFilterRadii = [], this.ssDiffusionProfileColors = [];\n          }, r.prototype.dispose = function() {\n            this.clearAllDiffusionProfiles(), this.postProcess.dispose();\n          }, r.prototype.getDiffusionProfileParameters = function(t) {\n            var e = Math.max(t.r, t.g, t.b);\n            return this._sampleBurleyDiffusionProfile(0.997, e);\n          }, r.prototype._sampleBurleyDiffusionProfile = function(t, e) {\n            var n = 1 + 4 * (t = 1 - t) * (2 * t + Math.sqrt(1 + 4 * t * t)), i = Math.pow(n, -1 / 3), o = 1 + n * i * i + i;\n            return 3 * Math.log(o / (4 * t)) * e;\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"PrePassRendererSceneComponent\");\n          }, r;\n        }();\n        V.a.AddParser(ot.a.NAME_SUBSURFACE, function(r, t) {\n          if (r.ssDiffusionProfileColors !== void 0 && r.ssDiffusionProfileColors !== null && (t.enableSubSurfaceForPrePass(), t.subSurfaceConfiguration))\n            for (var e = 0, n = r.ssDiffusionProfileColors.length; e < n; e++) {\n              var i = r.ssDiffusionProfileColors[e];\n              t.subSurfaceConfiguration.addDiffusionProfile(new I.a(i.r, i.g, i.b));\n            }\n        }), Object.defineProperty(_e.a.prototype, \"subSurfaceConfiguration\", { get: function() {\n          return this._subSurfaceConfiguration;\n        }, set: function(r) {\n          r && this.enablePrePassRenderer() && (this._subSurfaceConfiguration = r);\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.enableSubSurfaceForPrePass = function() {\n          if (this._subSurfaceConfiguration)\n            return this._subSurfaceConfiguration;\n          var r = this.enablePrePassRenderer();\n          return r ? (this._subSurfaceConfiguration = new Dd(this), r.addEffectConfiguration(this._subSurfaceConfiguration), this._subSurfaceConfiguration) : null;\n        }, _e.a.prototype.disableSubSurfaceForPrePass = function() {\n          this._subSurfaceConfiguration && (this._subSurfaceConfiguration.dispose(), this._subSurfaceConfiguration = null);\n        };\n        var Ld = function() {\n          function r(t) {\n            this.name = ot.a.NAME_PREPASSRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n          }, r.prototype.serialize = function(t) {\n            if (this.scene.subSurfaceConfiguration) {\n              var e = this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;\n              t.ssDiffusionProfileColors = [];\n              for (var n = 0; n < e.length; n++)\n                t.ssDiffusionProfileColors.push({ r: e[n].r, g: e[n].g, b: e[n].b });\n            }\n          }, r.prototype.addFromContainer = function(t) {\n          }, r.prototype.removeFromContainer = function(t, e) {\n            this.scene.prePassRenderer && this.scene.subSurfaceConfiguration && this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles();\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r;\n        }();\n        Dd._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_SUBSURFACE);\n          t || (t = new Ld(r), r._addComponent(t));\n        };\n        var yg = `#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#include<logDepthFragment>\ngl_FragColor=color;\n}`;\n        ze.a.ShadersStore.outlinePixelShader = yg;\n        var bg = `\nattribute vec3 position;\nattribute vec3 normal;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\nuniform float offset;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<logDepthDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nvec3 offsetPosition=positionUpdated+(normalUpdated*offset);\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(offsetPosition,1.0);\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<logDepthVertex>\n}\n`;\n        ze.a.ShadersStore.outlineVertexShader = bg, _e.a.prototype.getOutlineRenderer = function() {\n          return this._outlineRenderer || (this._outlineRenderer = new Nd(this)), this._outlineRenderer;\n        }, Object.defineProperty(Ie.a.prototype, \"renderOutline\", { get: function() {\n          return this._renderOutline;\n        }, set: function(r) {\n          r && this.getScene().getOutlineRenderer(), this._renderOutline = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Ie.a.prototype, \"renderOverlay\", { get: function() {\n          return this._renderOverlay;\n        }, set: function(r) {\n          r && this.getScene().getOutlineRenderer(), this._renderOverlay = r;\n        }, enumerable: !0, configurable: !0 });\n        var Nd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_OUTLINERENDERER, this.zOffset = 1, this.scene = t, this._engine = t.getEngine(), this.scene._addComponent(this);\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeRenderingMeshStage.registerStep(ot.a.STEP_BEFORERENDERINGMESH_OUTLINE, this, this._beforeRenderingMesh), this.scene._afterRenderingMeshStage.registerStep(ot.a.STEP_AFTERRENDERINGMESH_OUTLINE, this, this._afterRenderingMesh);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype.render = function(t, e, n) {\n            var i = this;\n            n === void 0 && (n = !1);\n            var o = this.scene, a = o.getEngine(), s = a.getCaps().instancedArrays && (e.visibleInstances[t._id] !== null && e.visibleInstances[t._id] !== void 0 || t.getRenderingMesh().hasThinInstances);\n            if (this.isReady(t, s)) {\n              var d = t.getMesh(), p = d._internalAbstractMeshDataInfo._actAsRegularMesh ? d : null, y = t.getRenderingMesh(), P = p || y, R = t.getMaterial();\n              if (R && o.activeCamera) {\n                if (a.enableEffect(this._effect), R.useLogarithmicDepth && this._effect.setFloat(\"logarithmicDepthConstant\", 2 / (Math.log(o.activeCamera.maxZ + 1) / Math.LN2)), this._effect.setFloat(\"offset\", n ? 0 : y.outlineWidth), this._effect.setColor4(\"color\", n ? y.overlayColor : y.outlineColor, n ? y.overlayAlpha : R.alpha), this._effect.setMatrix(\"viewProjection\", o.getTransformMatrix()), this._effect.setMatrix(\"world\", P.getWorldMatrix()), y.useBones && y.computeBonesUsingShaders && y.skeleton && this._effect.setMatrices(\"mBones\", y.skeleton.getTransformMatrices(y)), $e.a.BindMorphTargetParameters(y, this._effect), y._bind(t, this._effect, R.fillMode), R && R.needAlphaTesting()) {\n                  var B = R.getAlphaTestTexture();\n                  B && (this._effect.setTexture(\"diffuseSampler\", B), this._effect.setMatrix(\"diffuseMatrix\", B.getTextureMatrix()));\n                }\n                a.setZOffset(-this.zOffset), y._processRendering(P, t, this._effect, R.fillMode, e, s, function(F, z) {\n                  i._effect.setMatrix(\"world\", z);\n                }), a.setZOffset(0);\n              }\n            }\n          }, r.prototype.isReady = function(t, e) {\n            var n = [], i = [Oe.b.PositionKind, Oe.b.NormalKind], o = t.getMesh(), a = t.getMaterial();\n            a && (a.needAlphaTesting() && (n.push(\"#define ALPHATEST\"), o.isVerticesDataPresent(Oe.b.UVKind) && (i.push(Oe.b.UVKind), n.push(\"#define UV1\")), o.isVerticesDataPresent(Oe.b.UV2Kind) && (i.push(Oe.b.UV2Kind), n.push(\"#define UV2\"))), a.useLogarithmicDepth && n.push(\"#define LOGARITHMICDEPTH\")), o.useBones && o.computeBonesUsingShaders ? (i.push(Oe.b.MatricesIndicesKind), i.push(Oe.b.MatricesWeightsKind), o.numBoneInfluencers > 4 && (i.push(Oe.b.MatricesIndicesExtraKind), i.push(Oe.b.MatricesWeightsExtraKind)), n.push(\"#define NUM_BONE_INFLUENCERS \" + o.numBoneInfluencers), n.push(\"#define BonesPerMesh \" + (o.skeleton ? o.skeleton.bones.length + 1 : 0))) : n.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var s = o.morphTargetManager, d = 0;\n            s && s.numInfluencers > 0 && (d = s.numInfluencers, n.push(\"#define MORPHTARGETS\"), n.push(\"#define NUM_MORPH_INFLUENCERS \" + d), $e.a.PrepareAttributesForMorphTargetsInfluencers(i, o, d)), e && (n.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(i), t.getRenderingMesh().hasThinInstances && n.push(\"#define THIN_INSTANCES\"));\n            var p = n.join(`\n`);\n            return this._cachedDefines !== p && (this._cachedDefines = p, this._effect = this.scene.getEngine().createEffect(\"outline\", i, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"offset\", \"color\", \"logarithmicDepthConstant\", \"morphTargetInfluences\"], [\"diffuseSampler\"], p, void 0, void 0, void 0, { maxSimultaneousMorphTargets: d })), this._effect.isReady();\n          }, r.prototype._beforeRenderingMesh = function(t, e, n) {\n            if (this._savedDepthWrite = this._engine.getDepthWrite(), t.renderOutline) {\n              var i = e.getMaterial();\n              i && i.needAlphaBlendingForMesh(t) && (this._engine.cacheStencilState(), this._engine.setDepthWrite(!1), this._engine.setColorWrite(!1), this._engine.setStencilBuffer(!0), this._engine.setStencilOperationPass(h.a.REPLACE), this._engine.setStencilFunction(h.a.ALWAYS), this._engine.setStencilMask(r._StencilReference), this._engine.setStencilFunctionReference(r._StencilReference), this.render(e, n, !0), this._engine.setColorWrite(!0), this._engine.setStencilFunction(h.a.NOTEQUAL)), this._engine.setDepthWrite(!1), this.render(e, n), this._engine.setDepthWrite(this._savedDepthWrite), i && i.needAlphaBlendingForMesh(t) && this._engine.restoreStencilState();\n            }\n          }, r.prototype._afterRenderingMesh = function(t, e, n) {\n            if (t.renderOverlay) {\n              var i = this._engine.getAlphaMode(), o = this._engine.alphaState.alphaBlend;\n              this._engine.setAlphaMode(h.a.ALPHA_COMBINE), this.render(e, n, !0), this._engine.setAlphaMode(i), this._engine.setDepthWrite(this._savedDepthWrite), this._engine.alphaState.alphaBlend = o;\n            }\n            t.renderOutline && this._savedDepthWrite && (this._engine.setDepthWrite(!0), this._engine.setColorWrite(!1), this.render(e, n), this._engine.setColorWrite(!0));\n          }, r._StencilReference = 4, r;\n        }(), Tg = f(148), wd = function(r) {\n          function t(e, n) {\n            var i = r.call(this) || this;\n            return i.name = e, i.animations = new Array(), i.isPickable = !1, i.useAlphaForPicking = !1, i.onDisposeObservable = new C.c(), i._onAnimationEnd = null, i._endAnimation = function() {\n              i._onAnimationEnd && i._onAnimationEnd(), i.disposeWhenFinishedAnimating && i.dispose();\n            }, i.color = new I.b(1, 1, 1, 1), i.position = u.e.Zero(), i._manager = n, i._manager.sprites.push(i), i.uniqueId = i._manager.scene.getUniqueId(), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"size\", { get: function() {\n            return this.width;\n          }, set: function(e) {\n            this.width = e, this.height = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"manager\", { get: function() {\n            return this._manager;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"Sprite\";\n          }, Object.defineProperty(t.prototype, \"fromIndex\", { get: function() {\n            return this._fromIndex;\n          }, set: function(e) {\n            this.playAnimation(e, this._toIndex, this._loopAnimation, this._delay, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"toIndex\", { get: function() {\n            return this._toIndex;\n          }, set: function(e) {\n            this.playAnimation(this._fromIndex, e, this._loopAnimation, this._delay, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"loopAnimation\", { get: function() {\n            return this._loopAnimation;\n          }, set: function(e) {\n            this.playAnimation(this._fromIndex, this._toIndex, e, this._delay, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"delay\", { get: function() {\n            return Math.max(this._delay, 1);\n          }, set: function(e) {\n            this.playAnimation(this._fromIndex, this._toIndex, this._loopAnimation, e, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), t.prototype.playAnimation = function(e, n, i, o, a) {\n            a === void 0 && (a = null), this._onAnimationEnd = a, r.prototype.playAnimation.call(this, e, n, i, o, this._endAnimation);\n          }, t.prototype.dispose = function() {\n            for (var e = 0; e < this._manager.sprites.length; e++)\n              this._manager.sprites[e] == this && this._manager.sprites.splice(e, 1);\n            this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n          }, t.prototype.serialize = function() {\n            var e = {};\n            return e.name = this.name, e.position = this.position.asArray(), e.color = this.color.asArray(), e.width = this.width, e.height = this.height, e.angle = this.angle, e.cellIndex = this.cellIndex, e.cellRef = this.cellRef, e.invertU = this.invertU, e.invertV = this.invertV, e.disposeWhenFinishedAnimating = this.disposeWhenFinishedAnimating, e.isPickable = this.isPickable, e.isVisible = this.isVisible, e.useAlphaForPicking = this.useAlphaForPicking, e.animationStarted = this.animationStarted, e.fromIndex = this.fromIndex, e.toIndex = this.toIndex, e.loopAnimation = this.loopAnimation, e.delay = this.delay, e;\n          }, t.Parse = function(e, n) {\n            var i = new t(e.name, n);\n            return i.position = u.e.FromArray(e.position), i.color = I.b.FromArray(e.color), i.width = e.width, i.height = e.height, i.angle = e.angle, i.cellIndex = e.cellIndex, i.cellRef = e.cellRef, i.invertU = e.invertU, i.invertV = e.invertV, i.disposeWhenFinishedAnimating = e.disposeWhenFinishedAnimating, i.isPickable = e.isPickable, i.isVisible = e.isVisible, i.useAlphaForPicking = e.useAlphaForPicking, i.fromIndex = e.fromIndex, i.toIndex = e.toIndex, i.loopAnimation = e.loopAnimation, i.delay = e.delay, e.animationStarted && i.playAnimation(i.fromIndex, i.toIndex, i.loopAnimation, i.delay), i;\n          }, t;\n        }(function() {\n          function r() {\n            this.width = 1, this.height = 1, this.angle = 0, this.invertU = !1, this.invertV = !1, this.isVisible = !0, this._animationStarted = !1, this._loopAnimation = !1, this._fromIndex = 0, this._toIndex = 0, this._delay = 0, this._direction = 1, this._time = 0, this._onBaseAnimationEnd = null, this.position = { x: 1, y: 1, z: 1 }, this.color = { r: 1, g: 1, b: 1, a: 1 };\n          }\n          return Object.defineProperty(r.prototype, \"animationStarted\", { get: function() {\n            return this._animationStarted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"fromIndex\", { get: function() {\n            return this._fromIndex;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"toIndex\", { get: function() {\n            return this._toIndex;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"loopAnimation\", { get: function() {\n            return this._loopAnimation;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"delay\", { get: function() {\n            return Math.max(this._delay, 1);\n          }, enumerable: !1, configurable: !0 }), r.prototype.playAnimation = function(t, e, n, i, o) {\n            this._fromIndex = t, this._toIndex = e, this._loopAnimation = n, this._delay = i || 1, this._animationStarted = !0, this._onBaseAnimationEnd = o, t < e ? this._direction = 1 : (this._direction = -1, this._toIndex = t, this._fromIndex = e), this.cellIndex = t, this._time = 0;\n          }, r.prototype.stopAnimation = function() {\n            this._animationStarted = !1;\n          }, r.prototype._animate = function(t) {\n            this._animationStarted && (this._time += t, this._time > this._delay && (this._time = this._time % this._delay, this.cellIndex += this._direction, (this._direction > 0 && this.cellIndex > this._toIndex || this._direction < 0 && this.cellIndex < this._fromIndex) && (this._loopAnimation ? this.cellIndex = this._direction > 0 ? this._fromIndex : this._toIndex : (this.cellIndex = this._toIndex, this._animationStarted = !1, this._onBaseAnimationEnd && this._onBaseAnimationEnd()))));\n          }, r;\n        }());\n        _e.a.prototype._internalPickSprites = function(r, t, e, n) {\n          if (!Yi.a)\n            return null;\n          var i = null;\n          if (!n) {\n            if (!this.activeCamera)\n              return null;\n            n = this.activeCamera;\n          }\n          if (this.spriteManagers.length > 0)\n            for (var o = 0; o < this.spriteManagers.length; o++) {\n              var a = this.spriteManagers[o];\n              if (a.isPickable) {\n                var s = a.intersects(r, n, t, e);\n                if (s && s.hit && (e || i == null || !(s.distance >= i.distance)) && (i = s, e))\n                  break;\n              }\n            }\n          return i || new Yi.a();\n        }, _e.a.prototype._internalMultiPickSprites = function(r, t, e) {\n          if (!Yi.a)\n            return null;\n          var n = new Array();\n          if (!e) {\n            if (!this.activeCamera)\n              return null;\n            e = this.activeCamera;\n          }\n          if (this.spriteManagers.length > 0)\n            for (var i = 0; i < this.spriteManagers.length; i++) {\n              var o = this.spriteManagers[i];\n              if (o.isPickable) {\n                var a = o.multiIntersects(r, e, t);\n                a !== null && (n = n.concat(a));\n              }\n            }\n          return n;\n        }, _e.a.prototype.pickSprite = function(r, t, e, n, i) {\n          return this._tempSpritePickingRay ? (this.createPickingRayInCameraSpaceToRef(r, t, this._tempSpritePickingRay, i), this._internalPickSprites(this._tempSpritePickingRay, e, n, i)) : null;\n        }, _e.a.prototype.pickSpriteWithRay = function(r, t, e, n) {\n          if (!this._tempSpritePickingRay)\n            return null;\n          if (!n) {\n            if (!this.activeCamera)\n              return null;\n            n = this.activeCamera;\n          }\n          return dn.a.TransformToRef(r, n.getViewMatrix(), this._tempSpritePickingRay), this._internalPickSprites(this._tempSpritePickingRay, t, e, n);\n        }, _e.a.prototype.multiPickSprite = function(r, t, e, n) {\n          return this.createPickingRayInCameraSpaceToRef(r, t, this._tempSpritePickingRay, n), this._internalMultiPickSprites(this._tempSpritePickingRay, e, n);\n        }, _e.a.prototype.multiPickSpriteWithRay = function(r, t, e) {\n          if (!this._tempSpritePickingRay)\n            return null;\n          if (!e) {\n            if (!this.activeCamera)\n              return null;\n            e = this.activeCamera;\n          }\n          return dn.a.TransformToRef(r, e.getViewMatrix(), this._tempSpritePickingRay), this._internalMultiPickSprites(this._tempSpritePickingRay, t, e);\n        }, _e.a.prototype.setPointerOverSprite = function(r) {\n          this._pointerOverSprite !== r && (this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(h.a.ACTION_OnPointerOutTrigger, m.a.CreateNewFromSprite(this._pointerOverSprite, this)), this._pointerOverSprite = r, this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(h.a.ACTION_OnPointerOverTrigger, m.a.CreateNewFromSprite(this._pointerOverSprite, this)));\n        }, _e.a.prototype.getPointerOverSprite = function() {\n          return this._pointerOverSprite;\n        };\n        var Fd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_SPRITE, this.scene = t, this.scene.spriteManagers = new Array(), this.scene._tempSpritePickingRay = dn.a ? dn.a.Zero() : null, this.scene.onBeforeSpritesRenderingObservable = new C.c(), this.scene.onAfterSpritesRenderingObservable = new C.c(), this._spritePredicate = function(e) {\n              return !!e.actionManager && e.isPickable && e.actionManager.hasPointerTriggers;\n            };\n          }\n          return r.prototype.register = function() {\n            this.scene._pointerMoveStage.registerStep(ot.a.STEP_POINTERMOVE_SPRITE, this, this._pointerMove), this.scene._pointerDownStage.registerStep(ot.a.STEP_POINTERDOWN_SPRITE, this, this._pointerDown), this.scene._pointerUpStage.registerStep(ot.a.STEP_POINTERUP_SPRITE, this, this._pointerUp);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            this.scene.onBeforeSpritesRenderingObservable.clear(), this.scene.onAfterSpritesRenderingObservable.clear();\n            for (var t = this.scene.spriteManagers; t.length; )\n              t[0].dispose();\n          }, r.prototype._pickSpriteButKeepRay = function(t, e, n, i, o) {\n            var a = this.scene.pickSprite(e, n, this._spritePredicate, i, o);\n            return a && (a.ray = t ? t.ray : null), a;\n          }, r.prototype._pointerMove = function(t, e, n, i, o) {\n            var a = this.scene;\n            return i ? a.setPointerOverSprite(null) : (n = this._pickSpriteButKeepRay(n, t, e, !1, a.cameraToUseForPointers || void 0)) && n.hit && n.pickedSprite ? (a.setPointerOverSprite(n.pickedSprite), a.doNotHandleCursors || (a._pointerOverSprite && a._pointerOverSprite.actionManager && a._pointerOverSprite.actionManager.hoverCursor ? o.style.cursor = a._pointerOverSprite.actionManager.hoverCursor : o.style.cursor = a.hoverCursor)) : a.setPointerOverSprite(null), n;\n          }, r.prototype._pointerDown = function(t, e, n, i) {\n            var o = this.scene;\n            if (o._pickedDownSprite = null, o.spriteManagers.length > 0 && (n = o.pickSprite(t, e, this._spritePredicate, !1, o.cameraToUseForPointers || void 0)) && n.hit && n.pickedSprite && n.pickedSprite.actionManager) {\n              switch (o._pickedDownSprite = n.pickedSprite, i.button) {\n                case 0:\n                  n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnLeftPickTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n                  break;\n                case 1:\n                  n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnCenterPickTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n                  break;\n                case 2:\n                  n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnRightPickTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n              }\n              n.pickedSprite.actionManager && n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnPickDownTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n            }\n            return n;\n          }, r.prototype._pointerUp = function(t, e, n, i) {\n            var o = this.scene;\n            if (o.spriteManagers.length > 0) {\n              var a = o.pickSprite(t, e, this._spritePredicate, !1, o.cameraToUseForPointers || void 0);\n              a && (a.hit && a.pickedSprite && a.pickedSprite.actionManager && (a.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnPickUpTrigger, m.a.CreateNewFromSprite(a.pickedSprite, o, i)), a.pickedSprite.actionManager && (this.scene._inputManager._isPointerSwiping() || a.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnPickTrigger, m.a.CreateNewFromSprite(a.pickedSprite, o, i)))), o._pickedDownSprite && o._pickedDownSprite.actionManager && o._pickedDownSprite !== a.pickedSprite && o._pickedDownSprite.actionManager.processTrigger(h.a.ACTION_OnPickOutTrigger, m.a.CreateNewFromSprite(o._pickedDownSprite, o, i)));\n            }\n            return n;\n          }, r;\n        }();\n        ze.a.IncludesShadersStore.imageProcessingCompatibility = `#ifdef IMAGEPROCESSINGPOSTPROCESS\ngl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));\n#endif`;\n        var Eg = `uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest)\n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}`;\n        ze.a.ShadersStore.spritesPixelShader = Eg;\n        var Sg = `\nattribute vec4 position;\nattribute vec2 options;\nattribute vec2 offsets;\nattribute vec2 inverts;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include<fogVertexDeclaration>\nvoid main(void) {\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz;\nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=offsets.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0);\n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));\nvec2 uvPlace=cellInfo.xy;\nvec2 uvSize=cellInfo.zw;\nvUV.x=uvPlace.x+uvSize.x*uvOffset.x;\nvUV.y=uvPlace.y+uvSize.y*uvOffset.y;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}`;\n        ze.a.ShadersStore.spritesVertexShader = Sg;\n        var Ag = function() {\n          function r(t, e, n, i) {\n            if (n === void 0 && (n = 0.01), i === void 0 && (i = null), this.blendMode = h.a.ALPHA_COMBINE, this.autoResetAlpha = !0, this.disableDepthWrite = !1, this.fogEnabled = !0, this._useVAO = !1, this._useInstancing = !1, this._vertexBuffers = {}, this._capacity = e, this._epsilon = n, this._engine = t, this._useInstancing = t.getCaps().instancedArrays, this._useVAO = t.getCaps().vertexArrayObject && !t.disableVertexArrayObjects, this._scene = i, !this._useInstancing) {\n              for (var o = [], a = 0, s = 0; s < e; s++)\n                o.push(a), o.push(a + 1), o.push(a + 2), o.push(a), o.push(a + 2), o.push(a + 3), a += 4;\n              this._indexBuffer = t.createIndexBuffer(o);\n            }\n            this._vertexBufferSize = this._useInstancing ? 16 : 18, this._vertexData = new Float32Array(e * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._buffer = new Oe.a(t, this._vertexData, !0, this._vertexBufferSize);\n            var d, p = this._buffer.createVertexBuffer(Oe.b.PositionKind, 0, 4, this._vertexBufferSize, this._useInstancing), y = this._buffer.createVertexBuffer(\"options\", 4, 2, this._vertexBufferSize, this._useInstancing), P = 6;\n            if (this._useInstancing) {\n              var R = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n              this._spriteBuffer = new Oe.a(t, R, !1, 2), d = this._spriteBuffer.createVertexBuffer(\"offsets\", 0, 2);\n            } else\n              d = this._buffer.createVertexBuffer(\"offsets\", P, 2, this._vertexBufferSize, this._useInstancing), P += 2;\n            var B = this._buffer.createVertexBuffer(\"inverts\", P, 2, this._vertexBufferSize, this._useInstancing), F = this._buffer.createVertexBuffer(\"cellInfo\", P + 2, 4, this._vertexBufferSize, this._useInstancing), z = this._buffer.createVertexBuffer(Oe.b.ColorKind, P + 6, 4, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers[Oe.b.PositionKind] = p, this._vertexBuffers.options = y, this._vertexBuffers.offsets = d, this._vertexBuffers.inverts = B, this._vertexBuffers.cellInfo = F, this._vertexBuffers[Oe.b.ColorKind] = z, this._effectBase = this._engine.createEffect(\"sprites\", [Oe.b.PositionKind, \"options\", \"offsets\", \"inverts\", \"cellInfo\", Oe.b.ColorKind], [\"view\", \"projection\", \"textureInfos\", \"alphaTest\"], [\"diffuseSampler\"], \"\"), this._scene && (this._effectFog = this._scene.getEngine().createEffect(\"sprites\", [Oe.b.PositionKind, \"options\", \"offsets\", \"inverts\", \"cellInfo\", Oe.b.ColorKind], [\"view\", \"projection\", \"textureInfos\", \"alphaTest\", \"vFogInfos\", \"vFogColor\"], [\"diffuseSampler\"], \"#define FOG\"));\n          }\n          return Object.defineProperty(r.prototype, \"capacity\", { get: function() {\n            return this._capacity;\n          }, enumerable: !1, configurable: !0 }), r.prototype.render = function(t, e, n, i, o) {\n            if (o === void 0 && (o = null), this.texture && this.texture.isReady() && t.length) {\n              var a = this._effectBase, s = !1;\n              if (this.fogEnabled && this._scene && this._scene.fogEnabled && this._scene.fogMode !== 0 && (a = this._effectFog, s = !0), a.isReady()) {\n                for (var d = this._engine, p = !(!this._scene || !this._scene.useRightHandedSystem), y = this.texture.getBaseSize(), P = Math.min(this._capacity, t.length), R = 0, B = !0, F = 0; F < P; F++) {\n                  var z = t[F];\n                  z && z.isVisible && (B = !1, z._animate(e), this._appendSpriteVertex(R++, z, 0, 0, y, p, o), this._useInstancing || (this._appendSpriteVertex(R++, z, 1, 0, y, p, o), this._appendSpriteVertex(R++, z, 1, 1, y, p, o), this._appendSpriteVertex(R++, z, 0, 1, y, p, o)));\n                }\n                if (!B) {\n                  this._buffer.update(this._vertexData);\n                  var J = d.depthCullingState.cull || !0, ie = d.depthCullingState.zOffset;\n                  if (p && this._scene.getEngine().setState(J, ie, !1, !1), d.enableEffect(a), a.setTexture(\"diffuseSampler\", this.texture), a.setMatrix(\"view\", n), a.setMatrix(\"projection\", i), s) {\n                    var se = this._scene;\n                    a.setFloat4(\"vFogInfos\", se.fogMode, se.fogStart, se.fogEnd, se.fogDensity), a.setColor3(\"vFogColor\", se.fogColor);\n                  }\n                  this._useVAO ? (this._vertexArrayObject || (this._vertexArrayObject = d.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, a)), d.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)) : d.bindBuffers(this._vertexBuffers, this._indexBuffer, a), d.depthCullingState.depthFunc = h.a.LEQUAL, this.disableDepthWrite || (a.setBool(\"alphaTest\", !0), d.setColorWrite(!1), this._useInstancing ? d.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, R) : d.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, R / 4 * 6), d.setColorWrite(!0), a.setBool(\"alphaTest\", !1)), d.setAlphaMode(this.blendMode), this._useInstancing ? d.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, R) : d.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, R / 4 * 6), this.autoResetAlpha && d.setAlphaMode(h.a.ALPHA_DISABLE), p && this._scene.getEngine().setState(J, ie, !1, !0), d.unbindInstanceAttributes();\n                }\n              }\n            }\n          }, r.prototype._appendSpriteVertex = function(t, e, n, i, o, a, s) {\n            var d = t * this._vertexBufferSize;\n            if (n === 0 ? n = this._epsilon : n === 1 && (n = 1 - this._epsilon), i === 0 ? i = this._epsilon : i === 1 && (i = 1 - this._epsilon), s)\n              s(e, o);\n            else {\n              e.cellIndex || (e.cellIndex = 0);\n              var p = o.width / this.cellWidth, y = e.cellIndex / p >> 0;\n              e._xOffset = (e.cellIndex - y * p) * this.cellWidth / o.width, e._yOffset = y * this.cellHeight / o.height, e._xSize = this.cellWidth, e._ySize = this.cellHeight;\n            }\n            this._vertexData[d] = e.position.x, this._vertexData[d + 1] = e.position.y, this._vertexData[d + 2] = e.position.z, this._vertexData[d + 3] = e.angle, this._vertexData[d + 4] = e.width, this._vertexData[d + 5] = e.height, this._useInstancing ? d -= 2 : (this._vertexData[d + 6] = n, this._vertexData[d + 7] = i), this._vertexData[d + 8] = a ? e.invertU ? 0 : 1 : e.invertU ? 1 : 0, this._vertexData[d + 9] = e.invertV ? 1 : 0, this._vertexData[d + 10] = e._xOffset, this._vertexData[d + 11] = e._yOffset, this._vertexData[d + 12] = e._xSize / o.width, this._vertexData[d + 13] = e._ySize / o.height, this._vertexData[d + 14] = e.color.r, this._vertexData[d + 15] = e.color.g, this._vertexData[d + 16] = e.color.b, this._vertexData[d + 17] = e.color.a;\n          }, r.prototype.dispose = function() {\n            this._buffer && (this._buffer.dispose(), this._buffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this.texture && (this.texture.dispose(), this.texture = null);\n          }, r;\n        }(), Bd = function() {\n          function r(t, e, n, i, o, a, s, d, p) {\n            var y = this;\n            a === void 0 && (a = 0.01), s === void 0 && (s = Ne.a.TRILINEAR_SAMPLINGMODE), d === void 0 && (d = !1), p === void 0 && (p = null), this.name = t, this.sprites = new Array(), this.renderingGroupId = 0, this.layerMask = 268435455, this.isPickable = !1, this.onDisposeObservable = new C.c(), this.disableDepthWrite = !1, this._packedAndReady = !1, this._customUpdate = function(R, B) {\n              R.cellRef || (R.cellIndex = 0);\n              var F = R.cellIndex;\n              typeof F == \"number\" && isFinite(F) && Math.floor(F) === F && (R.cellRef = y._spriteMap[R.cellIndex]), R._xOffset = y._cellData[R.cellRef].frame.x / B.width, R._yOffset = y._cellData[R.cellRef].frame.y / B.height, R._xSize = y._cellData[R.cellRef].frame.w, R._ySize = y._cellData[R.cellRef].frame.h;\n            }, o || (o = Ue.a.LastCreatedScene), o._getComponent(ot.a.NAME_SPRITE) || o._addComponent(new Fd(o)), this._fromPacked = d, this._scene = o;\n            var P = this._scene.getEngine();\n            if (this._spriteRenderer = new Ag(P, n, a, o), i.width && i.height)\n              this.cellWidth = i.width, this.cellHeight = i.height;\n            else {\n              if (i === void 0)\n                return void (this._spriteRenderer = null);\n              this.cellWidth = i, this.cellHeight = i;\n            }\n            this._scene.spriteManagers.push(this), this.uniqueId = this.scene.getUniqueId(), e && (this.texture = new Ne.a(e, o, !0, !1, s)), this._fromPacked && this._makePacked(e, p);\n          }\n          return Object.defineProperty(r.prototype, \"onDispose\", { set: function(t) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"children\", { get: function() {\n            return this.sprites;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"capacity\", { get: function() {\n            return this._spriteRenderer.capacity;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"texture\", { get: function() {\n            return this._spriteRenderer.texture;\n          }, set: function(t) {\n            t.wrapU = Ne.a.CLAMP_ADDRESSMODE, t.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._spriteRenderer.texture = t, this._textureContent = null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cellWidth\", { get: function() {\n            return this._spriteRenderer.cellWidth;\n          }, set: function(t) {\n            this._spriteRenderer.cellWidth = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cellHeight\", { get: function() {\n            return this._spriteRenderer.cellHeight;\n          }, set: function(t) {\n            this._spriteRenderer.cellHeight = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"fogEnabled\", { get: function() {\n            return this._spriteRenderer.fogEnabled;\n          }, set: function(t) {\n            this._spriteRenderer.fogEnabled = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blendMode\", { get: function() {\n            return this._spriteRenderer.blendMode;\n          }, set: function(t) {\n            this._spriteRenderer.blendMode = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"SpriteManager\";\n          }, r.prototype._makePacked = function(t, e) {\n            var n = this;\n            if (e !== null)\n              try {\n                var i = void 0;\n                if ((i = typeof e == \"string\" ? JSON.parse(e) : e).frames.length) {\n                  for (var o = {}, a = 0; a < i.frames.length; a++) {\n                    var s = i.frames[a];\n                    if (typeof Object.keys(s)[0] != \"string\")\n                      throw new Error(\"Invalid JSON Format.  Check the frame values and make sure the name is the first parameter.\");\n                    o[s[Object.keys(s)[0]]] = s;\n                  }\n                  i.frames = o;\n                }\n                var d = Reflect.ownKeys(i.frames);\n                this._spriteMap = d, this._packedAndReady = !0, this._cellData = i.frames;\n              } catch {\n                throw this._fromPacked = !1, this._packedAndReady = !1, new Error(\"Invalid JSON from string. Spritesheet managed with constant cell size.\");\n              }\n            else {\n              var p = /\\./g, y = void 0;\n              do\n                y = p.lastIndex, p.test(t);\n              while (p.lastIndex > 0);\n              var P = t.substring(0, y - 1) + \".json\", R = new XMLHttpRequest();\n              R.open(\"GET\", P, !0), R.onerror = function() {\n                l.a.Error(\"JSON ERROR: Unable to load JSON file.\"), n._fromPacked = !1, n._packedAndReady = !1;\n              }, R.onload = function() {\n                try {\n                  var B = JSON.parse(R.response), F = Reflect.ownKeys(B.frames);\n                  n._spriteMap = F, n._packedAndReady = !0, n._cellData = B.frames;\n                } catch {\n                  throw n._fromPacked = !1, n._packedAndReady = !1, new Error(\"Invalid JSON format. Please check documentation for format specifications.\");\n                }\n              }, R.send();\n            }\n          }, r.prototype._checkTextureAlpha = function(t, e, n, i, o) {\n            if (!t.useAlphaForPicking || !this.texture)\n              return !0;\n            var a = this.texture.getSize();\n            this._textureContent || (this._textureContent = new Uint8Array(a.width * a.height * 4), this.texture.readPixels(0, 0, this._textureContent));\n            var s = u.c.Vector3[0];\n            s.copyFrom(e.direction), s.normalize(), s.scaleInPlace(n), s.addInPlace(e.origin);\n            var d = (s.x - i.x) / (o.x - i.x) - 0.5, p = 1 - (s.y - i.y) / (o.y - i.y) - 0.5, y = t.angle, P = d * Math.cos(y) - p * Math.sin(y) + 0.5, R = d * Math.sin(y) + p * Math.cos(y) + 0.5, B = t._xOffset * a.width + P * t._xSize | 0, F = t._yOffset * a.height + R * t._ySize | 0;\n            return this._textureContent[4 * (B + F * a.width) + 3] > 0.5;\n          }, r.prototype.intersects = function(t, e, n, i) {\n            for (var o = Math.min(this.capacity, this.sprites.length), a = u.e.Zero(), s = u.e.Zero(), d = Number.MAX_VALUE, p = null, y = u.c.Vector3[0], P = u.c.Vector3[1], R = e.getViewMatrix(), B = 0; B < o; B++) {\n              var F = this.sprites[B];\n              if (F) {\n                if (n) {\n                  if (!n(F))\n                    continue;\n                } else if (!F.isPickable)\n                  continue;\n                if (u.e.TransformCoordinatesToRef(F.position, R, P), a.copyFromFloats(P.x - F.width / 2, P.y - F.height / 2, P.z), s.copyFromFloats(P.x + F.width / 2, P.y + F.height / 2, P.z), t.intersectsBoxMinMax(a, s)) {\n                  var z = u.e.Distance(P, t.origin);\n                  if (d > z) {\n                    if (!this._checkTextureAlpha(F, t, z, a, s))\n                      continue;\n                    if (d = z, p = F, i)\n                      break;\n                  }\n                }\n              }\n            }\n            if (p) {\n              var J = new Yi.a();\n              R.invertToRef(u.c.Matrix[0]), J.hit = !0, J.pickedSprite = p, J.distance = d;\n              var ie = u.c.Vector3[2];\n              return ie.copyFrom(t.direction), ie.normalize(), ie.scaleInPlace(d), t.origin.addToRef(ie, y), J.pickedPoint = u.e.TransformCoordinates(y, u.c.Matrix[0]), J;\n            }\n            return null;\n          }, r.prototype.multiIntersects = function(t, e, n) {\n            for (var i, o = Math.min(this.capacity, this.sprites.length), a = u.e.Zero(), s = u.e.Zero(), d = [], p = u.c.Vector3[0].copyFromFloats(0, 0, 0), y = u.c.Vector3[1].copyFromFloats(0, 0, 0), P = e.getViewMatrix(), R = 0; R < o; R++) {\n              var B = this.sprites[R];\n              if (B) {\n                if (n) {\n                  if (!n(B))\n                    continue;\n                } else if (!B.isPickable)\n                  continue;\n                if (u.e.TransformCoordinatesToRef(B.position, P, y), a.copyFromFloats(y.x - B.width / 2, y.y - B.height / 2, y.z), s.copyFromFloats(y.x + B.width / 2, y.y + B.height / 2, y.z), t.intersectsBoxMinMax(a, s)) {\n                  if (i = u.e.Distance(y, t.origin), !this._checkTextureAlpha(B, t, i, a, s))\n                    continue;\n                  var F = new Yi.a();\n                  d.push(F), P.invertToRef(u.c.Matrix[0]), F.hit = !0, F.pickedSprite = B, F.distance = i;\n                  var z = u.c.Vector3[2];\n                  z.copyFrom(t.direction), z.normalize(), z.scaleInPlace(i), t.origin.addToRef(z, p), F.pickedPoint = u.e.TransformCoordinates(p, u.c.Matrix[0]);\n                }\n              }\n            }\n            return d;\n          }, r.prototype.render = function() {\n            if (!this._fromPacked || this._packedAndReady && this._spriteMap && this._cellData) {\n              var t = this._scene.getEngine().getDeltaTime();\n              this._packedAndReady ? this._spriteRenderer.render(this.sprites, t, this._scene.getViewMatrix(), this._scene.getProjectionMatrix(), this._customUpdate) : this._spriteRenderer.render(this.sprites, t, this._scene.getViewMatrix(), this._scene.getProjectionMatrix());\n            }\n          }, r.prototype.dispose = function() {\n            this._spriteRenderer && (this._spriteRenderer.dispose(), this._spriteRenderer = null), this._textureContent = null;\n            var t = this._scene.spriteManagers.indexOf(this);\n            this._scene.spriteManagers.splice(t, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n          }, r.prototype.serialize = function(t) {\n            t === void 0 && (t = !1);\n            var e = {};\n            e.name = this.name, e.capacity = this.capacity, e.cellWidth = this.cellWidth, e.cellHeight = this.cellHeight, this.texture && (t ? e.texture = this.texture.serialize() : (e.textureUrl = this.texture.name, e.invertY = this.texture._invertY)), e.sprites = [];\n            for (var n = 0, i = this.sprites; n < i.length; n++) {\n              var o = i[n];\n              e.sprites.push(o.serialize());\n            }\n            return e;\n          }, r.Parse = function(t, e, n) {\n            var i = new r(t.name, \"\", t.capacity, { width: t.cellWidth, height: t.cellHeight }, e);\n            t.texture ? i.texture = Ne.a.Parse(t.texture, e, n) : t.textureName && (i.texture = new Ne.a(n + t.textureUrl, e, !1, t.invertY === void 0 || t.invertY));\n            for (var o = 0, a = t.sprites; o < a.length; o++) {\n              var s = a[o];\n              wd.Parse(s, i);\n            }\n            return i;\n          }, r.ParseFromFileAsync = function(t, e, n, i) {\n            return i === void 0 && (i = \"\"), new Promise(function(o, a) {\n              var s = new re.a();\n              s.addEventListener(\"readystatechange\", function() {\n                if (s.readyState == 4)\n                  if (s.status == 200) {\n                    var d = JSON.parse(s.responseText), p = r.Parse(d, n || Ue.a.LastCreatedScene, i);\n                    t && (p.name = t), o(p);\n                  } else\n                    a(\"Unable to load the sprite manager\");\n              }), s.open(\"GET\", e), s.send();\n            });\n          }, r.CreateFromSnippetAsync = function(t, e, n) {\n            var i = this;\n            return n === void 0 && (n = \"\"), t === \"_BLANK\" ? Promise.resolve(new r(\"Default sprite manager\", \"//playground.babylonjs.com/textures/player.png\", 500, 64, e)) : new Promise(function(o, a) {\n              var s = new re.a();\n              s.addEventListener(\"readystatechange\", function() {\n                if (s.readyState == 4)\n                  if (s.status == 200) {\n                    var d = JSON.parse(JSON.parse(s.responseText).jsonPayload), p = JSON.parse(d.spriteManager), y = r.Parse(p, e || Ue.a.LastCreatedScene, n);\n                    y.snippetId = t, o(y);\n                  } else\n                    a(\"Unable to load the snippet \" + t);\n              }), s.open(\"GET\", i.SnippetUrl + \"/\" + t.replace(/#/g, \"/\")), s.send();\n            });\n          }, r.SnippetUrl = \"https://snippet.babylonjs.com\", r;\n        }(), Pg = `precision highp float;\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nuniform float time;\nuniform float spriteCount;\nuniform sampler2D spriteSheet;\nuniform vec2 spriteMapSize;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform sampler2D frameMap;\nuniform sampler2D tileMaps[LAYERS];\nuniform sampler2D animationMap;\nuniform vec3 colorMul;\nfloat mt;\nconst float fdStep=1./4.;\nconst float aFrameSteps=1./MAX_ANIMATION_FRAMES;\nmat4 getFrameData(float frameID){\nfloat fX=frameID/spriteCount;\nreturn mat4(\ntexture2D(frameMap,vec2(fX,0.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*1.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*2.),0.),\nvec4(0.)\n);\n}\nvoid main(){\nvec4 color=vec4(0.);\nvec2 tileUV=fract(tUV);\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\nvec2 tileID=floor(tUV);\nvec2 sheetUnits=1./spriteMapSize;\nfloat spriteUnits=1./spriteCount;\nvec2 stageUnits=1./stageSize;\nfor(int i=0; i<LAYERS; i++) {\nfloat frameID;\n#define LAYER_ID_SWITCH\nvec4 animationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,0.),0.);\nif(animationData.y>0.) {\nmt=mod(time*animationData.z,1.0);\nfor(float f=0.; f<MAX_ANIMATION_FRAMES; f++){\nif(animationData.y>mt){\nframeID=animationData.x;\nbreak;\n}\nanimationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.);\n}\n}\n\nmat4 frameData=getFrameData(frameID+0.5);\nvec2 frameSize=(frameData[0].wz)/spriteMapSize;\nvec2 offset=frameData[0].xy*sheetUnits;\nvec2 ratio=frameData[2].xy/frameData[0].wz;\n\nif (frameData[2].z == 1.){\ntileUV.xy=tileUV.yx;\n}\nif (i == 0){\ncolor=texture2D(spriteSheet,tileUV*frameSize+offset);\n} else {\nvec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);\nfloat alpha=min(color.a+nc.a,1.0);\nvec3 mixed=mix(color.xyz,nc.xyz,nc.a);\ncolor=vec4(mixed,alpha);\n}\n}\ncolor.xyz*=colorMul;\ngl_FragColor=color;\n}`;\n        ze.a.ShadersStore.spriteMapPixelShader = Pg;\n        var xg = `precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nvarying vec2 stageUnits;\nvarying vec2 levelUnits;\nvarying vec2 tileID;\n\nuniform float time;\nuniform mat4 worldViewProjection;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform vec2 spriteMapSize;\nuniform float stageScale;\nvoid main() {\nvec4 p=vec4( position,1. );\nvPosition=p.xyz;\nvUV=uv;\ntUV=uv*stageSize;\ngl_Position=worldViewProjection*p;\n}`;\n        ze.a.ShadersStore.spriteMapVertexShader = xg;\n        var ui, Cg = function() {\n          function r(t, e, n, i, o) {\n            var a = this;\n            this.name = t, this.sprites = [], this.atlasJSON = e, this.sprites = this.atlasJSON.frames, this.spriteSheet = n, this.options = i, i.stageSize = i.stageSize || new u.d(1, 1), i.outputSize = i.outputSize || i.stageSize, i.outputPosition = i.outputPosition || u.e.Zero(), i.outputRotation = i.outputRotation || u.e.Zero(), i.layerCount = i.layerCount || 1, i.maxAnimationFrames = i.maxAnimationFrames || 0, i.baseTile = i.baseTile || 0, i.flipU = i.flipU || !1, i.colorMultiply = i.colorMultiply || new u.e(1, 1, 1), this._scene = o, this._frameMap = this._createFrameBuffer(), this._tileMaps = new Array();\n            for (var s = 0; s < i.layerCount; s++)\n              this._tileMaps.push(this._createTileBuffer(null, s));\n            this._animationMap = this._createTileAnimationBuffer(null);\n            var d = [];\n            d.push(\"#define LAYERS \" + i.layerCount), i.flipU && d.push(\"#define FLIPU\"), d.push(\"#define MAX_ANIMATION_FRAMES \" + i.maxAnimationFrames + \".0\");\n            var p, y = ze.a.ShadersStore.spriteMapPixelShader;\n            if (this._scene.getEngine().webGLVersion === 1)\n              for (p = \"\", s = 0; s < i.layerCount; s++)\n                p += \"if (\" + s + \" == i) { frameID = texture2D(tileMaps[\" + s + \"], (tileID + 0.5) / stageSize, 0.).x; }\";\n            else {\n              for (p = \"switch(i) {\", s = 0; s < i.layerCount; s++)\n                p += \"case \" + s + \" : frameID = texture(tileMaps[\" + s + \"], (tileID + 0.5) / stageSize, 0.).x;\", p += \"break;\";\n              p += \"}\";\n            }\n            ze.a.ShadersStore[\"spriteMap\" + this.name + \"PixelShader\"] = y.replace(\"#define LAYER_ID_SWITCH\", p), this._material = new ea.a(\"spriteMap:\" + this.name, this._scene, { vertex: \"spriteMap\", fragment: \"spriteMap\" + this.name }, { defines: d, attributes: [\"position\", \"normal\", \"uv\"], uniforms: [\"worldViewProjection\", \"time\", \"stageSize\", \"outputSize\", \"spriteMapSize\", \"spriteCount\", \"time\", \"colorMul\", \"mousePosition\", \"curTile\", \"flipU\"], samplers: [\"spriteSheet\", \"frameMap\", \"tileMaps\", \"animationMap\"], needAlphaBlending: !0 }), this._time = 0, this._material.setFloat(\"spriteCount\", this.spriteCount), this._material.setVector2(\"stageSize\", i.stageSize), this._material.setVector2(\"outputSize\", i.outputSize), this._material.setTexture(\"spriteSheet\", this.spriteSheet), this._material.setVector2(\"spriteMapSize\", new u.d(1, 1)), this._material.setVector3(\"colorMul\", i.colorMultiply);\n            var P = 0, R = function() {\n              a.spriteSheet && a.spriteSheet.isReady() && a.spriteSheet._texture ? a._material.setVector2(\"spriteMapSize\", new u.d(a.spriteSheet._texture.baseWidth || 1, a.spriteSheet._texture.baseHeight || 1)) : P < 100 && setTimeout(function() {\n                P++, R();\n              }, 100);\n            };\n            R(), this._material.setVector3(\"colorMul\", i.colorMultiply), this._material.setTexture(\"frameMap\", this._frameMap), this._material.setTextureArray(\"tileMaps\", this._tileMaps), this._material.setTexture(\"animationMap\", this._animationMap), this._material.setFloat(\"time\", this._time), this._output = Ie.a.CreatePlane(t + \":output\", 1, o, !0), this._output.scaling.x = i.outputSize.x, this._output.scaling.y = i.outputSize.y, this.position = i.outputPosition, this.rotation = i.outputRotation, this._scene.onBeforeRenderObservable.add(function() {\n              a._time += a._scene.getEngine().getDeltaTime(), a._material.setFloat(\"time\", a._time);\n            }), this._output.material = this._material;\n          }\n          return Object.defineProperty(r.prototype, \"spriteCount\", { get: function() {\n            return this.sprites.length;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"position\", { get: function() {\n            return this._output.position;\n          }, set: function(t) {\n            this._output.position = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rotation\", { get: function() {\n            return this._output.rotation;\n          }, set: function(t) {\n            this._output.rotation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationMap\", { get: function() {\n            return this._animationMap;\n          }, set: function(t) {\n            var e = t._texture._bufferView, n = this._createTileAnimationBuffer(e);\n            this._animationMap.dispose(), this._animationMap = n, this._material.setTexture(\"animationMap\", this._animationMap);\n          }, enumerable: !1, configurable: !0 }), r.prototype.getTileID = function() {\n            var t = this.getMousePosition();\n            return t.multiplyInPlace(this.options.stageSize || u.d.Zero()), t.x = Math.floor(t.x), t.y = Math.floor(t.y), t;\n          }, r.prototype.getMousePosition = function() {\n            var t = this._output, e = this._scene.pick(this._scene.pointerX, this._scene.pointerY, function(i) {\n              return i === t;\n            });\n            if (!e || !e.hit || !e.getTextureCoordinates)\n              return new u.d(-1, -1);\n            var n = e.getTextureCoordinates();\n            return n || new u.d(-1, -1);\n          }, r.prototype._createFrameBuffer = function() {\n            for (var t = new Array(), e = 0; e < this.spriteCount; e++)\n              t.push(0, 0, 0, 0), t.push(0, 0, 0, 0), t.push(0, 0, 0, 0), t.push(0, 0, 0, 0);\n            for (e = 0; e < this.spriteCount; e++) {\n              var n = this.sprites[e].frame, i = this.sprites[e].spriteSourceSize, o = this.sprites[e].sourceSize, a = this.sprites[e].rotated ? 1 : 0, s = this.sprites[e].trimmed ? 1 : 0;\n              t[4 * e] = n.x, t[4 * e + 1] = n.y, t[4 * e + 2] = n.w, t[4 * e + 3] = n.h, t[4 * e + 4 * this.spriteCount] = i.x, t[4 * e + 1 + 4 * this.spriteCount] = i.y, t[4 * e + 3 + 4 * this.spriteCount] = i.h, t[4 * e + 8 * this.spriteCount] = o.w, t[4 * e + 1 + 8 * this.spriteCount] = o.h, t[4 * e + 2 + 8 * this.spriteCount] = a, t[4 * e + 3 + 8 * this.spriteCount] = s;\n            }\n            var d = new Float32Array(t);\n            return Zn.CreateRGBATexture(d, this.spriteCount, 4, this._scene, !1, !1, Ne.a.NEAREST_NEAREST, Ue.a.TEXTURETYPE_FLOAT);\n          }, r.prototype._createTileBuffer = function(t, e) {\n            e === void 0 && (e = 0);\n            var n = new Array(), i = this.options.stageSize.y || 0, o = this.options.stageSize.x || 0;\n            if (t)\n              n = t;\n            else {\n              var a = this.options.baseTile;\n              e != 0 && (a = 0);\n              for (var s = 0; s < i; s++)\n                for (var d = 0; d < 4 * o; d += 4)\n                  n.push(a, 0, 0, 0);\n            }\n            var p = new Float32Array(n);\n            return Zn.CreateRGBATexture(p, o, i, this._scene, !1, !1, Ne.a.NEAREST_NEAREST, Ue.a.TEXTURETYPE_FLOAT);\n          }, r.prototype.changeTiles = function(t, e, n) {\n            var i;\n            if (t === void 0 && (t = 0), n === void 0 && (n = 0), (i = this._tileMaps[t]._texture._bufferView) !== null) {\n              var o = new Array();\n              e instanceof u.d ? o.push(e) : o = e;\n              for (var a = this.options.stageSize.x || 0, s = 0; s < o.length; s++) {\n                var d = o[s];\n                d.x = Math.floor(d.x), d.y = Math.floor(d.y), i[4 * d.x + d.y * (4 * a)] = n;\n              }\n              var p = this._createTileBuffer(i);\n              this._tileMaps[t].dispose(), this._tileMaps[t] = p, this._material.setTextureArray(\"tileMap\", this._tileMaps);\n            }\n          }, r.prototype._createTileAnimationBuffer = function(t) {\n            var e, n = new Array();\n            if (t)\n              e = t;\n            else {\n              for (var i = 0; i < this.spriteCount; i++) {\n                n.push(0, 0, 0, 0);\n                for (var o = 1; o < (this.options.maxAnimationFrames || 4); )\n                  n.push(0, 0, 0, 0), o++;\n              }\n              e = new Float32Array(n);\n            }\n            return Zn.CreateRGBATexture(e, this.spriteCount, this.options.maxAnimationFrames || 4, this._scene, !1, !1, Ne.a.NEAREST_NEAREST, Ue.a.TEXTURETYPE_FLOAT);\n          }, r.prototype.addAnimationToTile = function(t, e, n, i, o) {\n            t === void 0 && (t = 0), e === void 0 && (e = 0), n === void 0 && (n = 0), i === void 0 && (i = 0), o === void 0 && (o = 1);\n            var a = this._animationMap._texture._bufferView, s = 4 * t + 4 * this.spriteCount * e;\n            if (a) {\n              a[s] = n, a[s + 1] = i, a[s + 2] = o;\n              var d = this._createTileAnimationBuffer(a);\n              this._animationMap.dispose(), this._animationMap = d, this._material.setTexture(\"animationMap\", this._animationMap);\n            }\n          }, r.prototype.saveTileMaps = function() {\n            for (var t = \"\", e = 0; e < this._tileMaps.length; e++)\n              e > 0 && (t += `\n\\r`), t += this._tileMaps[e]._texture._bufferView.toString();\n            var n = document.createElement(\"a\");\n            n.href = \"data:octet/stream;charset=utf-8,\" + encodeURI(t), n.target = \"_blank\", n.download = this.name + \".tilemaps\", n.click(), n.remove();\n          }, r.prototype.loadTileMaps = function(t) {\n            var e = this, n = new XMLHttpRequest();\n            n.open(\"GET\", t);\n            var i = this.options.layerCount || 0;\n            n.onload = function() {\n              for (var o = n.response.split(`\n\\r`), a = 0; a < i; a++) {\n                var s = o[a].split(\",\").map(Number), d = e._createTileBuffer(s);\n                e._tileMaps[a].dispose(), e._tileMaps[a] = d;\n              }\n              e._material.setTextureArray(\"tileMap\", e._tileMaps);\n            }, n.send();\n          }, r.prototype.dispose = function() {\n            this._output.dispose(), this._material.dispose(), this._animationMap.dispose(), this._tileMaps.forEach(function(t) {\n              t.dispose();\n            }), this._frameMap.dispose();\n          }, r;\n        }(), Rg = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            a === void 0 && (a = null), s === void 0 && (s = 0.01), d === void 0 && (d = Ne.a.TRILINEAR_SAMPLINGMODE);\n            var p = r.call(this, e, n, i, 64, o, s, d, !0, a) || this;\n            return p.name = e, p;\n          }\n          return Object(c.d)(t, r), t;\n        }(Bd), Og = f(143), Mg = f(141), Ig = f(142), Dg = f(139);\n        (function(r) {\n          r[r.INIT = 0] = \"INIT\", r[r.RUNNING = 1] = \"RUNNING\", r[r.DONE = 2] = \"DONE\", r[r.ERROR = 3] = \"ERROR\";\n        })(ui || (ui = {}));\n        var wc, hi = function() {\n          function r(t) {\n            this.name = t, this._isCompleted = !1, this._taskState = ui.INIT;\n          }\n          return Object.defineProperty(r.prototype, \"isCompleted\", { get: function() {\n            return this._isCompleted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"taskState\", { get: function() {\n            return this._taskState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"errorObject\", { get: function() {\n            return this._errorObject;\n          }, enumerable: !1, configurable: !0 }), r.prototype._setErrorObject = function(t, e) {\n            this._errorObject || (this._errorObject = { message: t, exception: e });\n          }, r.prototype.run = function(t, e, n) {\n            var i = this;\n            this._taskState = ui.RUNNING, this.runTask(t, function() {\n              i.onDoneCallback(e, n);\n            }, function(o, a) {\n              i.onErrorCallback(n, o, a);\n            });\n          }, r.prototype.runTask = function(t, e, n) {\n            throw new Error(\"runTask is not implemented\");\n          }, r.prototype.reset = function() {\n            this._taskState = ui.INIT;\n          }, r.prototype.onErrorCallback = function(t, e, n) {\n            this._taskState = ui.ERROR, this._errorObject = { message: e, exception: n }, this.onError && this.onError(this, e, n), t();\n          }, r.prototype.onDoneCallback = function(t, e) {\n            try {\n              this._taskState = ui.DONE, this._isCompleted = !0, this.onSuccess && this.onSuccess(this), t();\n            } catch (n) {\n              this.onErrorCallback(e, \"Task is done, error executing success callback(s)\", n);\n            }\n          }, r;\n        }(), Ud = function(r, t, e) {\n          this.remainingCount = r, this.totalCount = t, this.task = e;\n        }, Vd = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e) || this;\n            return a.name = e, a.meshesNames = n, a.rootUrl = i, a.sceneFilename = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            Ft.LoadAssetContainer(this.rootUrl, this.sceneFilename, e, function(a) {\n              o.loadedContainer = a, o.loadedMeshes = a.meshes, o.loadedParticleSystems = a.particleSystems, o.loadedSkeletons = a.skeletons, o.loadedAnimationGroups = a.animationGroups, n();\n            }, null, function(a, s, d) {\n              i(s, d);\n            });\n          }, t;\n        }(hi), kd = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e) || this;\n            return a.name = e, a.meshesNames = n, a.rootUrl = i, a.sceneFilename = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            Ft.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, e, function(a, s, d, p) {\n              o.loadedMeshes = a, o.loadedParticleSystems = s, o.loadedSkeletons = d, o.loadedAnimationGroups = p, n();\n            }, null, function(a, s, d) {\n              i(s, d);\n            });\n          }, t;\n        }(hi), Gd = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.name = e, i.url = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            e._loadFile(this.url, function(a) {\n              o.text = a, n();\n            }, void 0, !1, !1, function(a, s) {\n              a && i(a.status + \" \" + a.statusText, s);\n            });\n          }, t;\n        }(hi), zd = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.name = e, i.url = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            e._loadFile(this.url, function(a) {\n              o.data = a, n();\n            }, void 0, !0, !0, function(a, s) {\n              a && i(a.status + \" \" + a.statusText, s);\n            });\n          }, t;\n        }(hi), jd = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.name = e, i.url = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this, a = new Image();\n            Xe.b.SetCorsBehavior(this.url, a), a.onload = function() {\n              o.image = a, n();\n            }, a.onerror = function(s) {\n              i(\"Error loading image\", s);\n            }, a.src = this.url;\n          }, t;\n        }(hi), Hd = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !0), a === void 0 && (a = Ne.a.TRILINEAR_SAMPLINGMODE);\n            var s = r.call(this, e) || this;\n            return s.name = e, s.url = n, s.noMipmap = i, s.invertY = o, s.samplingMode = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new Ne.a(this.url, e, this.noMipmap, this.invertY, this.samplingMode, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Wd = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e) || this;\n            return s.name = e, s.url = n, s.extensions = i, s.noMipmap = o, s.files = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new ei(this.url, e, this.extensions, this.noMipmap, this.files, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Xd = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            o === void 0 && (o = !1), a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = !1);\n            var p = r.call(this, e) || this;\n            return p.name = e, p.url = n, p.size = i, p.noMipmap = o, p.generateHarmonics = a, p.gammaSpace = s, p.reserved = d, p;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new qo(this.url, e, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Yd = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !1), a === void 0 && (a = !0);\n            var s = r.call(this, e) || this;\n            return s.name = e, s.url = n, s.size = i, s.noMipmap = o, s.gammaSpace = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new Gu(this.url, e, this.size, this.noMipmap, this.gammaSpace, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Lg = function() {\n          function r(t) {\n            this._isLoading = !1, this._tasks = new Array(), this._waitingTasksCount = 0, this._totalTasksCount = 0, this.onTaskSuccessObservable = new C.c(), this.onTaskErrorObservable = new C.c(), this.onTasksDoneObservable = new C.c(), this.onProgressObservable = new C.c(), this.useDefaultLoadingScreen = !0, this.autoHideLoadingUI = !0, this._scene = t;\n          }\n          return r.prototype.addContainerTask = function(t, e, n, i) {\n            var o = new Vd(t, e, n, i);\n            return this._tasks.push(o), o;\n          }, r.prototype.addMeshTask = function(t, e, n, i) {\n            var o = new kd(t, e, n, i);\n            return this._tasks.push(o), o;\n          }, r.prototype.addTextFileTask = function(t, e) {\n            var n = new Gd(t, e);\n            return this._tasks.push(n), n;\n          }, r.prototype.addBinaryFileTask = function(t, e) {\n            var n = new zd(t, e);\n            return this._tasks.push(n), n;\n          }, r.prototype.addImageTask = function(t, e) {\n            var n = new jd(t, e);\n            return this._tasks.push(n), n;\n          }, r.prototype.addTextureTask = function(t, e, n, i, o) {\n            o === void 0 && (o = Ne.a.TRILINEAR_SAMPLINGMODE);\n            var a = new Hd(t, e, n, i, o);\n            return this._tasks.push(a), a;\n          }, r.prototype.addCubeTextureTask = function(t, e, n, i, o) {\n            var a = new Wd(t, e, n, i, o);\n            return this._tasks.push(a), a;\n          }, r.prototype.addHDRCubeTextureTask = function(t, e, n, i, o, a, s) {\n            i === void 0 && (i = !1), o === void 0 && (o = !0), a === void 0 && (a = !1), s === void 0 && (s = !1);\n            var d = new Xd(t, e, n, i, o, a, s);\n            return this._tasks.push(d), d;\n          }, r.prototype.addEquiRectangularCubeTextureAssetTask = function(t, e, n, i, o) {\n            i === void 0 && (i = !1), o === void 0 && (o = !0);\n            var a = new Yd(t, e, n, i, o);\n            return this._tasks.push(a), a;\n          }, r.prototype.removeTask = function(t) {\n            var e = this._tasks.indexOf(t);\n            e > -1 && this._tasks.splice(e, 1);\n          }, r.prototype._decreaseWaitingTasksCount = function(t) {\n            this._waitingTasksCount--;\n            try {\n              this.onProgress && this.onProgress(this._waitingTasksCount, this._totalTasksCount, t), this.onProgressObservable.notifyObservers(new Ud(this._waitingTasksCount, this._totalTasksCount, t));\n            } catch (a) {\n              l.a.Error(\"Error running progress callbacks.\"), console.log(a);\n            }\n            if (this._waitingTasksCount === 0) {\n              try {\n                var e = this._tasks.slice();\n                this.onFinish && this.onFinish(e);\n                for (var n = 0, i = e; n < i.length; n++)\n                  if ((t = i[n]).taskState === ui.DONE) {\n                    var o = this._tasks.indexOf(t);\n                    o > -1 && this._tasks.splice(o, 1);\n                  }\n                this.onTasksDoneObservable.notifyObservers(this._tasks);\n              } catch (a) {\n                l.a.Error(\"Error running tasks-done callbacks.\"), console.log(a);\n              }\n              this._isLoading = !1, this.autoHideLoadingUI && this._scene.getEngine().hideLoadingUI();\n            }\n          }, r.prototype._runTask = function(t) {\n            var e = this, n = function(i, o) {\n              t._setErrorObject(i, o), e.onTaskError && e.onTaskError(t), e.onTaskErrorObservable.notifyObservers(t), e._decreaseWaitingTasksCount(t);\n            };\n            t.run(this._scene, function() {\n              try {\n                e.onTaskSuccess && e.onTaskSuccess(t), e.onTaskSuccessObservable.notifyObservers(t), e._decreaseWaitingTasksCount(t);\n              } catch (i) {\n                n(\"Error executing task success callbacks\", i);\n              }\n            }, n);\n          }, r.prototype.reset = function() {\n            return this._isLoading = !1, this._tasks = new Array(), this;\n          }, r.prototype.load = function() {\n            if (this._isLoading)\n              return this;\n            if (this._isLoading = !0, this._waitingTasksCount = this._tasks.length, this._totalTasksCount = this._tasks.length, this._waitingTasksCount === 0)\n              return this._isLoading = !1, this.onFinish && this.onFinish(this._tasks), this.onTasksDoneObservable.notifyObservers(this._tasks), this;\n            this.useDefaultLoadingScreen && this._scene.getEngine().displayLoadingUI();\n            for (var t = 0; t < this._tasks.length; t++) {\n              var e = this._tasks[t];\n              e.taskState === ui.INIT && this._runTask(e);\n            }\n            return this;\n          }, r.prototype.loadAsync = function() {\n            var t = this;\n            return new Promise(function(e, n) {\n              t._isLoading ? e() : (t.onTasksDoneObservable.addOnce(function(i) {\n                i && i.length ? n(i) : e();\n              }), t.load());\n            });\n          }, r;\n        }(), Ng = function() {\n          function r() {\n            var t = this;\n            this.promise = new Promise(function(e, n) {\n              t._resolve = e, t._reject = n;\n            });\n          }\n          return Object.defineProperty(r.prototype, \"resolve\", { get: function() {\n            return this._resolve;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"reject\", { get: function() {\n            return this._reject;\n          }, enumerable: !1, configurable: !0 }), r;\n        }(), wg = function() {\n          function r(t, e) {\n            this._meshesOrigins = [], this._toCenterVectors = [], this._scaledDirection = u.e.Zero(), this._newPosition = u.e.Zero(), this._centerPosition = u.e.Zero(), this._meshes = t.slice(), e ? this._centerMesh = e : this._setCenterMesh();\n            var n = this._meshes.indexOf(this._centerMesh);\n            n >= 0 && this._meshes.splice(n, 1), this._centerPosition = this._centerMesh.getAbsolutePosition().clone();\n            for (var i = 0; i < this._meshes.length; i++)\n              if (this._meshes[i]) {\n                var o = this._meshes[i];\n                this._meshesOrigins[i] = o.getAbsolutePosition().clone(), this._toCenterVectors[i] = u.e.Zero(), o._boundingInfo && this._centerMesh._boundingInfo && o._boundingInfo.boundingBox.centerWorld.subtractToRef(this._centerMesh._boundingInfo.boundingBox.centerWorld, this._toCenterVectors[i]);\n              }\n          }\n          return r.prototype._setCenterMesh = function() {\n            for (var t = u.e.Zero(), e = u.e.Zero(), n = Number.MAX_VALUE, i = 0; i < this._meshes.length; i++)\n              this._meshes[i] && (a = (o = this._meshes[i]).getBoundingInfo()) && e.addInPlace(a.boundingBox.centerWorld);\n            for (t = e.scale(1 / this._meshes.length), i = 0; i < this._meshes.length; i++) {\n              var o, a;\n              if (this._meshes[i] && (a = (o = this._meshes[i]).getBoundingInfo())) {\n                var s = a.boundingBox.centerWorld.subtract(t).lengthSquared();\n                s < n && (this._centerMesh = o, n = s);\n              }\n            }\n          }, r.prototype.getClassName = function() {\n            return \"MeshExploder\";\n          }, r.prototype.getMeshes = function() {\n            var t = this._meshes.slice();\n            return t.unshift(this._centerMesh), t;\n          }, r.prototype.explode = function(t) {\n            t === void 0 && (t = 1);\n            for (var e = 0; e < this._meshes.length; e++)\n              this._meshes[e] && this._meshesOrigins[e] && this._toCenterVectors[e] && (this._toCenterVectors[e].scaleToRef(t, this._scaledDirection), this._meshesOrigins[e].addToRef(this._scaledDirection, this._newPosition), this._meshes[e].setAbsolutePosition(this._newPosition));\n            this._centerMesh.setAbsolutePosition(this._centerPosition);\n          }, r;\n        }(), Fg = function() {\n          function r(t, e, n, i, o, a, s, d, p) {\n            this.onProcessFileCallback = function() {\n              return !0;\n            }, this._engine = t, this._currentScene = e, this._sceneLoadedCallback = n, this._progressCallback = i, this._additionalRenderLoopLogicCallback = o, this._textureLoadingCallback = a, this._startingProcessingFilesCallback = s, this._onReloadCallback = d, this._errorCallback = p;\n          }\n          return Object.defineProperty(r, \"FilesToLoad\", { get: function() {\n            return fs.a.FilesToLoad;\n          }, enumerable: !1, configurable: !0 }), r.prototype.monitorElementForDragNDrop = function(t) {\n            var e = this;\n            t && (this._elementToMonitor = t, this._dragEnterHandler = function(n) {\n              e.drag(n);\n            }, this._dragOverHandler = function(n) {\n              e.drag(n);\n            }, this._dropHandler = function(n) {\n              e.drop(n);\n            }, this._elementToMonitor.addEventListener(\"dragenter\", this._dragEnterHandler, !1), this._elementToMonitor.addEventListener(\"dragover\", this._dragOverHandler, !1), this._elementToMonitor.addEventListener(\"drop\", this._dropHandler, !1));\n          }, Object.defineProperty(r.prototype, \"filesToLoad\", { get: function() {\n            return this._filesToLoad;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._elementToMonitor && (this._elementToMonitor.removeEventListener(\"dragenter\", this._dragEnterHandler), this._elementToMonitor.removeEventListener(\"dragover\", this._dragOverHandler), this._elementToMonitor.removeEventListener(\"drop\", this._dropHandler));\n          }, r.prototype.renderFunction = function() {\n            if (this._additionalRenderLoopLogicCallback && this._additionalRenderLoopLogicCallback(), this._currentScene) {\n              if (this._textureLoadingCallback) {\n                var t = this._currentScene.getWaitingItemsCount();\n                t > 0 && this._textureLoadingCallback(t);\n              }\n              this._currentScene.render();\n            }\n          }, r.prototype.drag = function(t) {\n            t.stopPropagation(), t.preventDefault();\n          }, r.prototype.drop = function(t) {\n            t.stopPropagation(), t.preventDefault(), this.loadFiles(t);\n          }, r.prototype._traverseFolder = function(t, e, n, i) {\n            var o = this, a = t.createReader(), s = t.fullPath.replace(/^\\//, \"\").replace(/(.+?)\\/?$/, \"$1/\");\n            a.readEntries(function(d) {\n              n.count += d.length;\n              for (var p = 0, y = d; p < y.length; p++) {\n                var P = y[p];\n                P.isFile ? P.file(function(R) {\n                  R.correctName = s + R.name, e.push(R), --n.count == 0 && i();\n                }) : P.isDirectory && o._traverseFolder(P, e, n, i);\n              }\n              --n.count == 0 && i();\n            });\n          }, r.prototype._processFiles = function(t) {\n            for (var e = 0; e < t.length; e++) {\n              var n = t[e].correctName.toLowerCase(), i = n.split(\".\").pop();\n              this.onProcessFileCallback(t[e], n, i) && (Ft.IsPluginForExtensionAvailable(\".\" + i) && (this._sceneFileToLoad = t[e]), r.FilesToLoad[n] = t[e]);\n            }\n          }, r.prototype.loadFiles = function(t) {\n            var e = this;\n            if (t && t.dataTransfer && t.dataTransfer.files && (this._filesToLoad = t.dataTransfer.files), t && t.target && t.target.files && (this._filesToLoad = t.target.files), this._filesToLoad && this._filesToLoad.length !== 0 && (this._startingProcessingFilesCallback && this._startingProcessingFilesCallback(this._filesToLoad), this._filesToLoad && this._filesToLoad.length > 0)) {\n              for (var n = new Array(), i = [], o = t.dataTransfer ? t.dataTransfer.items : null, a = 0; a < this._filesToLoad.length; a++) {\n                var s = this._filesToLoad[a], d = s.name.toLowerCase(), p = void 0;\n                if (s.correctName = d, o) {\n                  var y = o[a];\n                  y.getAsEntry ? p = y.getAsEntry() : y.webkitGetAsEntry && (p = y.webkitGetAsEntry());\n                }\n                p && p.isDirectory ? i.push(p) : n.push(s);\n              }\n              if (i.length === 0)\n                this._processFiles(n), this._processReload();\n              else\n                for (var P = { count: i.length }, R = 0, B = i; R < B.length; R++) {\n                  var F = B[R];\n                  this._traverseFolder(F, n, P, function() {\n                    e._processFiles(n), P.count === 0 && e._processReload();\n                  });\n                }\n            }\n          }, r.prototype._processReload = function() {\n            this._onReloadCallback ? this._onReloadCallback(this._sceneFileToLoad) : this.reload();\n          }, r.prototype.reload = function() {\n            var t = this;\n            this._sceneFileToLoad ? (this._currentScene && (l.a.errorsCount > 0 && l.a.ClearLogCache(), this._engine.stopRenderLoop()), Ft.ShowLoadingScreen = !1, this._engine.displayLoadingUI(), Ft.LoadAsync(\"file:\", this._sceneFileToLoad, this._engine, function(e) {\n              t._progressCallback && t._progressCallback(e);\n            }).then(function(e) {\n              t._currentScene && t._currentScene.dispose(), t._currentScene = e, t._sceneLoadedCallback && t._sceneLoadedCallback(t._sceneFileToLoad, t._currentScene), t._currentScene.executeWhenReady(function() {\n                t._engine.hideLoadingUI(), t._engine.runRenderLoop(function() {\n                  t.renderFunction();\n                });\n              });\n            }).catch(function(e) {\n              t._engine.hideLoadingUI(), t._errorCallback && t._errorCallback(t._sceneFileToLoad, t._currentScene, e.message);\n            })) : l.a.Error(\"Please provide a valid .babylon file.\");\n          }, r;\n        }(), Kd = f(146), Bg = f(145), di = function() {\n          function r(t) {\n            t === void 0 && (t = 0), this.priority = t;\n          }\n          return r.prototype.getDescription = function() {\n            return \"\";\n          }, r.prototype.apply = function(t, e) {\n            return !0;\n          }, r;\n        }(), _a = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = 1024), i === void 0 && (i = 0.5);\n            var o = r.call(this, e) || this;\n            return o.priority = e, o.maximumSize = n, o.step = i, o;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Reducing render target texture size to \" + this.maximumSize;\n          }, t.prototype.apply = function(e, n) {\n            for (var i = !0, o = 0; o < e.textures.length; o++) {\n              var a = e.textures[o];\n              if (a.canRescale && !a.getContext) {\n                var s = a.getSize();\n                Math.max(s.width, s.height) > this.maximumSize && (a.scale(this.step), i = !1);\n              }\n            }\n            return i;\n          }, t;\n        }(di), Fc = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = 2), i === void 0 && (i = 0.25);\n            var o = r.call(this, e) || this;\n            return o.priority = e, o.maximumScale = n, o.step = i, o._currentScale = -1, o._directionOffset = 1, o;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Setting hardware scaling level to \" + this._currentScale;\n          }, t.prototype.apply = function(e, n) {\n            return this._currentScale === -1 && (this._currentScale = e.getEngine().getHardwareScalingLevel(), this._currentScale > this.maximumScale && (this._directionOffset = -1)), this._currentScale += this._directionOffset * this.step, e.getEngine().setHardwareScalingLevel(this._currentScale), this._directionOffset === 1 ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale;\n          }, t;\n        }(di), ma = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning shadows on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.shadowsEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), ga = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning post-processes on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.postProcessesEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), va = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning lens flares on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.lensFlaresEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), Qd = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return this.onGetDescription ? this.onGetDescription() : \"Running user defined callback\";\n          }, t.prototype.apply = function(e, n) {\n            return !this.onApply || this.onApply(e, n);\n          }, t;\n        }(di), ya = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning particles on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.particlesEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), Bc = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning render targets off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.renderTargetsEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), ba = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e._canBeMerged = function(n) {\n              if (!(n instanceof Ie.a))\n                return !1;\n              var i = n;\n              return !i.isDisposed() && !(!i.isVisible || !i.isEnabled()) && !(i.instances.length > 0) && !i.skeleton && !i.hasLODLevels;\n            }, e;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t, \"UpdateSelectionTree\", { get: function() {\n            return t._UpdateSelectionTree;\n          }, set: function(e) {\n            t._UpdateSelectionTree = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getDescription = function() {\n            return \"Merging similar meshes together\";\n          }, t.prototype.apply = function(e, n, i) {\n            for (var o = e.meshes.slice(0), a = o.length, s = 0; s < a; s++) {\n              var d = new Array(), p = o[s];\n              if (this._canBeMerged(p)) {\n                d.push(p);\n                for (var y = s + 1; y < a; y++) {\n                  var P = o[y];\n                  this._canBeMerged(P) && P.material === p.material && P.checkCollisions === p.checkCollisions && (d.push(P), a--, o.splice(y, 1), y--);\n                }\n                d.length < 2 || Ie.a.MergeMeshes(d, void 0, !0);\n              }\n            }\n            var R = e;\n            return R.createOrUpdateSelectionOctree && (i != null ? i && R.createOrUpdateSelectionOctree() : t.UpdateSelectionTree && R.createOrUpdateSelectionOctree()), !0;\n          }, t._UpdateSelectionTree = !1, t;\n        }(di), Uc = function() {\n          function r(t, e) {\n            t === void 0 && (t = 60), e === void 0 && (e = 2e3), this.targetFrameRate = t, this.trackerDuration = e, this.optimizations = new Array();\n          }\n          return r.prototype.addOptimization = function(t) {\n            return this.optimizations.push(t), this;\n          }, r.prototype.addCustomOptimization = function(t, e, n) {\n            n === void 0 && (n = 0);\n            var i = new Qd(n);\n            return i.onApply = t, i.onGetDescription = e, this.optimizations.push(i), this;\n          }, r.LowDegradationAllowed = function(t) {\n            var e = new r(t), n = 0;\n            return e.addOptimization(new ba(n)), e.addOptimization(new ma(n)), e.addOptimization(new va(n)), n++, e.addOptimization(new ga(n)), e.addOptimization(new ya(n)), n++, e.addOptimization(new _a(n, 1024)), e;\n          }, r.ModerateDegradationAllowed = function(t) {\n            var e = new r(t), n = 0;\n            return e.addOptimization(new ba(n)), e.addOptimization(new ma(n)), e.addOptimization(new va(n)), n++, e.addOptimization(new ga(n)), e.addOptimization(new ya(n)), n++, e.addOptimization(new _a(n, 512)), n++, e.addOptimization(new Bc(n)), n++, e.addOptimization(new Fc(n, 2)), e;\n          }, r.HighDegradationAllowed = function(t) {\n            var e = new r(t), n = 0;\n            return e.addOptimization(new ba(n)), e.addOptimization(new ma(n)), e.addOptimization(new va(n)), n++, e.addOptimization(new ga(n)), e.addOptimization(new ya(n)), n++, e.addOptimization(new _a(n, 256)), n++, e.addOptimization(new Bc(n)), n++, e.addOptimization(new Fc(n, 4)), e;\n          }, r;\n        }(), Ug = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = !0), i === void 0 && (i = !1), this._isRunning = !1, this._currentPriorityLevel = 0, this._targetFrameRate = 60, this._trackerDuration = 2e3, this._currentFrameRate = 0, this._improvementMode = !1, this.onSuccessObservable = new C.c(), this.onNewOptimizationAppliedObservable = new C.c(), this.onFailureObservable = new C.c(), this._options = e || new Uc(), this._options.targetFrameRate && (this._targetFrameRate = this._options.targetFrameRate), this._options.trackerDuration && (this._trackerDuration = this._options.trackerDuration), n)\n              for (var a = 0, s = 0, d = this._options.optimizations; s < d.length; s++)\n                d[s].priority = a++;\n            this._improvementMode = i, this._scene = t || te.a.LastCreatedScene, this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function() {\n              o._sceneDisposeObserver = null, o.dispose();\n            });\n          }\n          return Object.defineProperty(r.prototype, \"isInImprovementMode\", { get: function() {\n            return this._improvementMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentPriorityLevel\", { get: function() {\n            return this._currentPriorityLevel;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentFrameRate\", { get: function() {\n            return this._currentFrameRate;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"targetFrameRate\", { get: function() {\n            return this._targetFrameRate;\n          }, set: function(t) {\n            this._targetFrameRate = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"trackerDuration\", { get: function() {\n            return this._trackerDuration;\n          }, set: function(t) {\n            this._trackerDuration = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"optimizations\", { get: function() {\n            return this._options.optimizations;\n          }, enumerable: !1, configurable: !0 }), r.prototype.stop = function() {\n            this._isRunning = !1;\n          }, r.prototype.reset = function() {\n            this._currentPriorityLevel = 0;\n          }, r.prototype.start = function() {\n            var t = this;\n            this._isRunning || (this._isRunning = !0, this._scene.executeWhenReady(function() {\n              setTimeout(function() {\n                t._checkCurrentState();\n              }, t._trackerDuration);\n            }));\n          }, r.prototype._checkCurrentState = function() {\n            var t = this;\n            if (this._isRunning) {\n              var e = this._scene, n = this._options;\n              if (this._currentFrameRate = Math.round(e.getEngine().getFps()), this._improvementMode && this._currentFrameRate <= this._targetFrameRate || !this._improvementMode && this._currentFrameRate >= this._targetFrameRate)\n                return this._isRunning = !1, void this.onSuccessObservable.notifyObservers(this);\n              for (var i = !0, o = !0, a = 0; a < n.optimizations.length; a++) {\n                var s = n.optimizations[a];\n                s.priority === this._currentPriorityLevel && (o = !1, i = i && s.apply(e, this), this.onNewOptimizationAppliedObservable.notifyObservers(s));\n              }\n              if (o)\n                return this._isRunning = !1, void this.onFailureObservable.notifyObservers(this);\n              i && this._currentPriorityLevel++, e.executeWhenReady(function() {\n                setTimeout(function() {\n                  t._checkCurrentState();\n                }, t._trackerDuration);\n              });\n            }\n          }, r.prototype.dispose = function() {\n            this.stop(), this.onSuccessObservable.clear(), this.onFailureObservable.clear(), this.onNewOptimizationAppliedObservable.clear(), this._sceneDisposeObserver && this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);\n          }, r.OptimizeAsync = function(t, e, n, i) {\n            var o = new r(t, e || Uc.ModerateDegradationAllowed(), !1);\n            return n && o.onSuccessObservable.add(function() {\n              n();\n            }), i && o.onFailureObservable.add(function() {\n              i();\n            }), o.start(), o;\n          }, r;\n        }(), Ta = [], Vc = function(r, t) {\n          Ta[r.id] || r.doNotSerialize || (t.vertexData.push(r.serializeVerticeData()), Ta[r.id] = !0);\n        }, qd = function(r, t) {\n          var e = {}, n = r._geometry;\n          return n && (r.getScene().getGeometryByID(n.id) || Vc(n, t.geometries)), r.serialize && r.serialize(e), e;\n        }, kc = function() {\n          function r() {\n          }\n          return r.ClearCache = function() {\n            Ta = [];\n          }, r.Serialize = function(t) {\n            var e, n, i, o = {};\n            if (r.ClearCache(), o.useDelayedTextureLoading = t.useDelayedTextureLoading, o.autoClear = t.autoClear, o.clearColor = t.clearColor.asArray(), o.ambientColor = t.ambientColor.asArray(), o.gravity = t.gravity.asArray(), o.collisionsEnabled = t.collisionsEnabled, t.fogMode && t.fogMode !== 0 && (o.fogMode = t.fogMode, o.fogColor = t.fogColor.asArray(), o.fogStart = t.fogStart, o.fogEnd = t.fogEnd, o.fogDensity = t.fogDensity), t.isPhysicsEnabled()) {\n              var a = t.getPhysicsEngine();\n              a && (o.physicsEnabled = !0, o.physicsGravity = a.gravity.asArray(), o.physicsEngine = a.getPhysicsPluginName());\n            }\n            t.metadata && (o.metadata = t.metadata), o.morphTargetManagers = [];\n            for (var s = 0, d = t.meshes; s < d.length; s++) {\n              var p = (se = d[s]).morphTargetManager;\n              p && o.morphTargetManagers.push(p.serialize());\n            }\n            for (o.lights = [], e = 0; e < t.lights.length; e++)\n              (n = t.lights[e]).doNotSerialize || o.lights.push(n.serialize());\n            for (o.cameras = [], e = 0; e < t.cameras.length; e++) {\n              var y = t.cameras[e];\n              y.doNotSerialize || o.cameras.push(y.serialize());\n            }\n            if (t.activeCamera && (o.activeCameraID = t.activeCamera.id), L.a.AppendSerializedAnimations(t, o), t.animationGroups && t.animationGroups.length > 0) {\n              o.animationGroups = [];\n              for (var P = 0; P < t.animationGroups.length; P++) {\n                var R = t.animationGroups[P];\n                o.animationGroups.push(R.serialize());\n              }\n            }\n            if (t.reflectionProbes && t.reflectionProbes.length > 0)\n              for (o.reflectionProbes = [], e = 0; e < t.reflectionProbes.length; e++) {\n                var B = t.reflectionProbes[e];\n                o.reflectionProbes.push(B.serialize());\n              }\n            for (o.materials = [], o.multiMaterials = [], e = 0; e < t.materials.length; e++)\n              (i = t.materials[e]).doNotSerialize || o.materials.push(i.serialize());\n            for (o.multiMaterials = [], e = 0; e < t.multiMaterials.length; e++) {\n              var F = t.multiMaterials[e];\n              o.multiMaterials.push(F.serialize());\n            }\n            for (t.environmentTexture && (o.environmentTexture = t.environmentTexture.name), o.environmentIntensity = t.environmentIntensity, o.skeletons = [], e = 0; e < t.skeletons.length; e++) {\n              var z = t.skeletons[e];\n              z.doNotSerialize || o.skeletons.push(z.serialize());\n            }\n            for (o.transformNodes = [], e = 0; e < t.transformNodes.length; e++)\n              t.transformNodes[e].doNotSerialize || o.transformNodes.push(t.transformNodes[e].serialize());\n            o.geometries = {}, o.geometries.boxes = [], o.geometries.spheres = [], o.geometries.cylinders = [], o.geometries.toruses = [], o.geometries.grounds = [], o.geometries.planes = [], o.geometries.torusKnots = [], o.geometries.vertexData = [], Ta = [];\n            var J = t.getGeometries();\n            for (e = 0; e < J.length; e++) {\n              var ie = J[e];\n              ie.isReady() && Vc(ie, o.geometries);\n            }\n            for (o.meshes = [], e = 0; e < t.meshes.length; e++) {\n              var se;\n              if ((se = t.meshes[e]) instanceof Ie.a) {\n                var ce = se;\n                ce.doNotSerialize || ce.delayLoadState !== h.a.DELAYLOADSTATE_LOADED && ce.delayLoadState !== h.a.DELAYLOADSTATE_NONE || o.meshes.push(qd(ce, o));\n              }\n            }\n            for (o.particleSystems = [], e = 0; e < t.particleSystems.length; e++)\n              o.particleSystems.push(t.particleSystems[e].serialize(!1));\n            for (o.postProcesses = [], e = 0; e < t.postProcesses.length; e++)\n              o.postProcesses.push(t.postProcesses[e].serialize());\n            t.actionManager && (o.actions = t.actionManager.serialize(\"scene\"));\n            for (var ue = 0, fe = t._serializableComponents; ue < fe.length; ue++)\n              fe[ue].serialize(o);\n            return o;\n          }, r.SerializeMesh = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = !1);\n            var i = {};\n            if (r.ClearCache(), t = t instanceof Array ? t : [t], e || n)\n              for (var o = 0; o < t.length; ++o)\n                n && t[o].getDescendants().forEach(function(a) {\n                  a instanceof Ie.a && t.indexOf(a) < 0 && !a.doNotSerialize && t.push(a);\n                }), e && t[o].parent && t.indexOf(t[o].parent) < 0 && !t[o].parent.doNotSerialize && t.push(t[o].parent);\n            return t.forEach(function(a) {\n              (function(s, d) {\n                if (s.delayLoadState === h.a.DELAYLOADSTATE_LOADED || s.delayLoadState === h.a.DELAYLOADSTATE_NONE) {\n                  if (s.material && !s.material.doNotSerialize)\n                    if (s.material instanceof Qi.a) {\n                      if (d.multiMaterials = d.multiMaterials || [], d.materials = d.materials || [], !d.multiMaterials.some(function(B) {\n                        return B.id === s.material.id;\n                      })) {\n                        d.multiMaterials.push(s.material.serialize());\n                        for (var p = function(B) {\n                          B && (d.materials.some(function(F) {\n                            return F.id === B.id;\n                          }) || d.materials.push(B.serialize()));\n                        }, y = 0, P = s.material.subMaterials; y < P.length; y++)\n                          p(P[y]);\n                      }\n                    } else\n                      d.materials = d.materials || [], d.materials.some(function(B) {\n                        return B.id === s.material.id;\n                      }) || d.materials.push(s.material.serialize());\n                  var R = s._geometry;\n                  R && (d.geometries || (d.geometries = {}, d.geometries.boxes = [], d.geometries.spheres = [], d.geometries.cylinders = [], d.geometries.toruses = [], d.geometries.grounds = [], d.geometries.planes = [], d.geometries.torusKnots = [], d.geometries.vertexData = []), Vc(R, d.geometries)), s.skeleton && !s.skeleton.doNotSerialize && (d.skeletons = d.skeletons || [], d.skeletons.push(s.skeleton.serialize())), d.meshes = d.meshes || [], d.meshes.push(qd(s, d));\n                }\n              })(a, i);\n            }), i;\n          }, r;\n        }(), Vg = f(37), kg = function() {\n          function r() {\n          }\n          return r.CreateResizedCopy = function(t, e, n, i) {\n            i === void 0 && (i = !0);\n            var o = t.getScene(), a = o.getEngine(), s = new on(\"resized\" + t.name, { width: e, height: n }, o, !t.noMipmap, !0, t._texture.type, !1, t.samplingMode, !1);\n            s.wrapU = t.wrapU, s.wrapV = t.wrapV, s.uOffset = t.uOffset, s.vOffset = t.vOffset, s.uScale = t.uScale, s.vScale = t.vScale, s.uAng = t.uAng, s.vAng = t.vAng, s.wAng = t.wAng, s.coordinatesIndex = t.coordinatesIndex, s.level = t.level, s.anisotropicFilteringLevel = t.anisotropicFilteringLevel, s._texture.isReady = !1, t.wrapU = Ne.a.CLAMP_ADDRESSMODE, t.wrapV = Ne.a.CLAMP_ADDRESSMODE;\n            var d = new Ci(\"pass\", 1, null, i ? Ne.a.BILINEAR_SAMPLINGMODE : Ne.a.NEAREST_SAMPLINGMODE, a, !1, h.a.TEXTURETYPE_UNSIGNED_INT);\n            return d.getEffect().executeWhenCompiled(function() {\n              d.onApply = function(y) {\n                y.setTexture(\"textureSampler\", t);\n              };\n              var p = s.getInternalTexture();\n              p && (o.postProcessManager.directRender([d], p), a.unBindFramebuffer(p), s.disposeFramebufferObjects(), d.dispose(), p.isReady = !0);\n            }), s;\n          }, r;\n        }(), Gg = function() {\n          function r(t, e) {\n            if (e === void 0 && (e = null), !r.IsSupported(t))\n              throw \"Your browser does not support recording so far.\";\n            var n = t.getRenderingCanvas();\n            if (!n)\n              throw \"The babylon engine must have a canvas to be recorded\";\n            this._canvas = n, this._canvas.isRecording = !1, this._options = Object(c.a)(Object(c.a)({}, r._defaultOptions), e);\n            var i = this._canvas.captureStream(this._options.fps);\n            if (this._options.audioTracks)\n              for (var o = 0, a = this._options.audioTracks; o < a.length; o++) {\n                var s = a[o];\n                i.addTrack(s);\n              }\n            this._mediaRecorder = new MediaRecorder(i, { mimeType: this._options.mimeType }), this._mediaRecorder.ondataavailable = this._handleDataAvailable.bind(this), this._mediaRecorder.onerror = this._handleError.bind(this), this._mediaRecorder.onstop = this._handleStop.bind(this);\n          }\n          return r.IsSupported = function(t) {\n            var e = t.getRenderingCanvas();\n            return !!e && typeof e.captureStream == \"function\";\n          }, Object.defineProperty(r.prototype, \"isRecording\", { get: function() {\n            return !!this._canvas && this._canvas.isRecording;\n          }, enumerable: !1, configurable: !0 }), r.prototype.stopRecording = function() {\n            this._canvas && this._mediaRecorder && this.isRecording && (this._canvas.isRecording = !1, this._mediaRecorder.stop());\n          }, r.prototype.startRecording = function(t, e) {\n            var n = this;\n            if (t === void 0 && (t = \"babylonjs.webm\"), e === void 0 && (e = 7), !this._canvas || !this._mediaRecorder)\n              throw \"Recorder has already been disposed\";\n            if (this.isRecording)\n              throw \"Recording already in progress\";\n            return e > 0 && setTimeout(function() {\n              n.stopRecording();\n            }, 1e3 * e), this._fileName = t, this._recordedChunks = [], this._resolve = null, this._reject = null, this._canvas.isRecording = !0, this._mediaRecorder.start(this._options.recordChunckSize), new Promise(function(i, o) {\n              n._resolve = i, n._reject = o;\n            });\n          }, r.prototype.dispose = function() {\n            this._canvas = null, this._mediaRecorder = null, this._recordedChunks = [], this._fileName = null, this._resolve = null, this._reject = null;\n          }, r.prototype._handleDataAvailable = function(t) {\n            t.data.size > 0 && this._recordedChunks.push(t.data);\n          }, r.prototype._handleError = function(t) {\n            if (this.stopRecording(), !this._reject)\n              throw new t.error();\n            this._reject(t.error);\n          }, r.prototype._handleStop = function() {\n            this.stopRecording();\n            var t = new Blob(this._recordedChunks);\n            this._resolve && this._resolve(t), window.URL.createObjectURL(t), this._fileName && Xe.b.Download(t, this._fileName);\n          }, r._defaultOptions = { mimeType: \"video/webm\", fps: 25, recordChunckSize: 3e3 }, r;\n        }(), yo = function() {\n          function r() {\n          }\n          return r.CreateScreenshot = function(t, e, n, i, o) {\n            o === void 0 && (o = \"image/png\");\n            var a = r._getScreenshotSize(t, e, n), s = a.height, d = a.width;\n            if (s && d) {\n              Xe.b._ScreenshotCanvas || (Xe.b._ScreenshotCanvas = document.createElement(\"canvas\")), Xe.b._ScreenshotCanvas.width = d, Xe.b._ScreenshotCanvas.height = s;\n              var p = Xe.b._ScreenshotCanvas.getContext(\"2d\"), y = t.getRenderWidth() / t.getRenderHeight(), P = d, R = P / y;\n              R > s && (P = (R = s) * y);\n              var B = Math.max(0, d - P) / 2, F = Math.max(0, s - R) / 2, z = t.getRenderingCanvas();\n              p && z && p.drawImage(z, B, F, P, R), Xe.b.EncodeScreenshotCanvasData(i, o);\n            } else\n              l.a.Error(\"Invalid 'size' parameter !\");\n          }, r.CreateScreenshotAsync = function(t, e, n, i) {\n            return i === void 0 && (i = \"image/png\"), new Promise(function(o, a) {\n              r.CreateScreenshot(t, e, n, function(s) {\n                s !== void 0 ? o(s) : a(new Error(\"Data is undefined\"));\n              }, i);\n            });\n          }, r.CreateScreenshotUsingRenderTarget = function(t, e, n, i, o, a, s, d, p, y) {\n            o === void 0 && (o = \"image/png\"), a === void 0 && (a = 1), s === void 0 && (s = !1), p === void 0 && (p = !1), y === void 0 && (y = !1);\n            var P = r._getScreenshotSize(t, e, n), R = P.height, B = P.width, F = { width: B, height: R };\n            if (R && B) {\n              var z = t.getRenderingCanvas();\n              if (z) {\n                var J = { width: z.width, height: z.height };\n                t.setSize(B, R);\n                var ie = e.getScene(), se = null, ce = ie.activeCameras;\n                (ie.activeCamera !== e || ie.activeCameras && ie.activeCameras.length) && (se = ie.activeCamera, ie.activeCamera = e), ie.render();\n                var ue = new on(\"screenShot\", F, ie, !1, !1, h.a.TEXTURETYPE_UNSIGNED_INT, !1, Ne.a.NEAREST_SAMPLINGMODE, void 0, y);\n                ue.renderList = null, ue.samples = a, ue.renderSprites = p, ue.onAfterRenderObservable.add(function() {\n                  Xe.b.DumpFramebuffer(B, R, t, i, o, d);\n                });\n                var fe = function() {\n                  ie.incrementRenderId(), ie.resetCachedMaterial(), ue.render(!0), ue.dispose(), se && (ie.activeCamera = se), ie.activeCameras = ce, t.setSize(J.width, J.height), e.getProjectionMatrix(!0);\n                };\n                if (s) {\n                  var ve = new vo(\"antialiasing\", 1, ie.activeCamera);\n                  ue.addPostProcess(ve), ve.getEffect().isReady() ? fe() : ve.getEffect().onCompiled = function() {\n                    fe();\n                  };\n                } else\n                  fe();\n              } else\n                l.a.Error(\"No rendering canvas found !\");\n            } else\n              l.a.Error(\"Invalid 'size' parameter !\");\n          }, r.CreateScreenshotUsingRenderTargetAsync = function(t, e, n, i, o, a, s, d) {\n            return i === void 0 && (i = \"image/png\"), o === void 0 && (o = 1), a === void 0 && (a = !1), d === void 0 && (d = !1), new Promise(function(p, y) {\n              r.CreateScreenshotUsingRenderTarget(t, e, n, function(P) {\n                P !== void 0 ? p(P) : y(new Error(\"Data is undefined\"));\n              }, i, o, a, s, d);\n            });\n          }, r._getScreenshotSize = function(t, e, n) {\n            var i = 0, o = 0;\n            if (typeof n == \"object\") {\n              var a = n.precision ? Math.abs(n.precision) : 1;\n              n.width && n.height ? (i = n.height * a, o = n.width * a) : n.width && !n.height ? (o = n.width * a, i = Math.round(o / t.getAspectRatio(e))) : n.height && !n.width ? (i = n.height * a, o = Math.round(i * t.getAspectRatio(e))) : (o = Math.round(t.getRenderWidth() * a), i = Math.round(o / t.getAspectRatio(e)));\n            } else\n              isNaN(n) || (i = n, o = n);\n            return o && (o = Math.floor(o)), i && (i = Math.floor(i)), { height: 0 | i, width: 0 | o };\n          }, r;\n        }();\n        Xe.b.CreateScreenshot = yo.CreateScreenshot, Xe.b.CreateScreenshotAsync = yo.CreateScreenshotAsync, Xe.b.CreateScreenshotUsingRenderTarget = yo.CreateScreenshotUsingRenderTarget, Xe.b.CreateScreenshotUsingRenderTargetAsync = yo.CreateScreenshotUsingRenderTargetAsync, function(r) {\n          r[r.Checkbox = 0] = \"Checkbox\", r[r.Slider = 1] = \"Slider\", r[r.Vector3 = 2] = \"Vector3\", r[r.Quaternion = 3] = \"Quaternion\", r[r.Color3 = 4] = \"Color3\", r[r.String = 5] = \"String\";\n        }(wc || (wc = {}));\n        var Dr, zg = f(140), jg = function() {\n          function r(t) {\n            this.byteOffset = 0, this.buffer = t;\n          }\n          return r.prototype.loadAsync = function(t) {\n            var e = this;\n            return this.buffer.readAsync(this.byteOffset, t).then(function(n) {\n              e._dataView = new DataView(n.buffer, n.byteOffset, n.byteLength), e._dataByteOffset = 0;\n            });\n          }, r.prototype.readUint32 = function() {\n            var t = this._dataView.getUint32(this._dataByteOffset, !0);\n            return this._dataByteOffset += 4, this.byteOffset += 4, t;\n          }, r.prototype.readUint8Array = function(t) {\n            var e = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._dataByteOffset, t);\n            return this._dataByteOffset += t, this.byteOffset += t, e;\n          }, r.prototype.readString = function(t) {\n            return Hn.a.Decode(this.readUint8Array(t));\n          }, r.prototype.skipBytes = function(t) {\n            this._dataByteOffset += t, this.byteOffset += t;\n          }, r;\n        }(), Hg = function() {\n          function r() {\n          }\n          return r._GetStorage = function() {\n            try {\n              return localStorage.setItem(\"test\", \"\"), localStorage.removeItem(\"test\"), localStorage;\n            } catch {\n              var t = {};\n              return { getItem: function(n) {\n                var i = t[n];\n                return i === void 0 ? null : i;\n              }, setItem: function(n, i) {\n                t[n] = i;\n              } };\n            }\n          }, r.ReadString = function(t, e) {\n            var n = this._Storage.getItem(t);\n            return n !== null ? n : e;\n          }, r.WriteString = function(t, e) {\n            this._Storage.setItem(t, e);\n          }, r.ReadBoolean = function(t, e) {\n            var n = this._Storage.getItem(t);\n            return n !== null ? n === \"true\" : e;\n          }, r.WriteBoolean = function(t, e) {\n            this._Storage.setItem(t, e ? \"true\" : \"false\");\n          }, r.ReadNumber = function(t, e) {\n            var n = this._Storage.getItem(t);\n            return n !== null ? parseFloat(n) : e;\n          }, r.WriteNumber = function(t, e) {\n            this._Storage.setItem(t, e.toString());\n          }, r._Storage = r._GetStorage(), r;\n        }(), Wg = function() {\n          function r() {\n            this._trackedScene = null;\n          }\n          return r.prototype.track = function(t) {\n            this._trackedScene = t, this._savedJSON = kc.Serialize(t);\n          }, r.prototype.getDelta = function() {\n            if (!this._trackedScene)\n              return null;\n            var t = kc.Serialize(this._trackedScene), e = {};\n            for (var n in t)\n              this._compareCollections(n, this._savedJSON[n], t[n], e);\n            return e;\n          }, r.prototype._compareArray = function(t, e, n, i) {\n            if (e.length === 0 && n.length === 0)\n              return !0;\n            if (e.length && !isNaN(e[0]) || n.length && !isNaN(n[0])) {\n              if (e.length !== n.length)\n                return !1;\n              if (e.length === 0)\n                return !0;\n              for (var o = 0; o < e.length; o++)\n                if (e[o] !== n[o])\n                  return i[t] = n, !1;\n              return !0;\n            }\n            var a = [], s = function() {\n              var P = e[o], R = P.uniqueId;\n              a.push(R);\n              var B = n.filter(function(J) {\n                return J.uniqueId === R;\n              });\n              if (B.length) {\n                var F = B[0], z = {};\n                d._compareObjects(P, F, z) || (i[t] || (i[t] = []), z.__state = { id: F.id || F.name }, i[t].push(z));\n              } else\n                z = { __state: { deleteId: P.id || P.name } }, i[t].push(z);\n            }, d = this;\n            for (o = 0; o < e.length; o++)\n              s();\n            for (o = 0; o < n.length; o++) {\n              var p = n[o], y = p.uniqueId;\n              a.indexOf(y) === -1 && (i[t] || (i[t] = []), i[t].push(p));\n            }\n            return !0;\n          }, r.prototype._compareObjects = function(t, e, n) {\n            var i = !1;\n            for (var o in t)\n              if (t.hasOwnProperty(o)) {\n                var a = t[o], s = e[o], d = !1;\n                Array.isArray(a) ? d = JSON.stringify(a) !== JSON.stringify(s) : isNaN(a) && Object.prototype.toString.call(a) != \"[object String]\" || (d = a !== s), d && (i = !0, n[o] = s);\n              }\n            return !i;\n          }, r.prototype._compareCollections = function(t, e, n, i) {\n            if (e !== n && e && n) {\n              if (Array.isArray(e) && Array.isArray(n)) {\n                if (this._compareArray(t, e, n, i))\n                  return;\n              } else if (typeof e == \"object\" && typeof n == \"object\") {\n                var o = {};\n                return void (this._compareObjects(e, n, o) || (i[t] = o));\n              }\n            }\n          }, r.GetShadowGeneratorById = function(t, e) {\n            for (var n = 0, i = t.lights.map(function(a) {\n              return a.getShadowGenerator();\n            }); n < i.length; n++) {\n              var o = i[n];\n              if (o && o.id === e)\n                return o;\n            }\n            return null;\n          }, r.ApplyDelta = function(t, e) {\n            var n = this;\n            typeof t == \"string\" && (t = JSON.parse(t));\n            var i = e;\n            for (var o in t) {\n              var a = t[o], s = i[o];\n              if (Array.isArray(s) || o === \"shadowGenerators\")\n                switch (o) {\n                  case \"cameras\":\n                    this._ApplyDeltaForEntity(a, e, e.getCameraByID.bind(e), function(d) {\n                      return _t.a.Parse(d, e);\n                    });\n                    break;\n                  case \"lights\":\n                    this._ApplyDeltaForEntity(a, e, e.getLightByID.bind(e), function(d) {\n                      return bi.a.Parse(d, e);\n                    });\n                    break;\n                  case \"shadowGenerators\":\n                    this._ApplyDeltaForEntity(a, e, function(d) {\n                      return n.GetShadowGeneratorById(e, d);\n                    }, function(d) {\n                      return Fn.Parse(d, e);\n                    });\n                    break;\n                  case \"meshes\":\n                    this._ApplyDeltaForEntity(a, e, e.getMeshByID.bind(e), function(d) {\n                      return Ie.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"skeletons\":\n                    this._ApplyDeltaForEntity(a, e, e.getSkeletonById.bind(e), function(d) {\n                      return Ao.Parse(d, e);\n                    });\n                    break;\n                  case \"materials\":\n                    this._ApplyDeltaForEntity(a, e, e.getMaterialByID.bind(e), function(d) {\n                      return zt.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"multiMaterials\":\n                    this._ApplyDeltaForEntity(a, e, e.getMaterialByID.bind(e), function(d) {\n                      return Qi.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"transformNodes\":\n                    this._ApplyDeltaForEntity(a, e, e.getTransformNodeByID.bind(e), function(d) {\n                      return pr.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"particleSystems\":\n                    this._ApplyDeltaForEntity(a, e, e.getParticleSystemByID.bind(e), function(d) {\n                      return cn.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"morphTargetManagers\":\n                    this._ApplyDeltaForEntity(a, e, e.getMorphTargetById.bind(e), function(d) {\n                      return Zo.Parse(d, e);\n                    });\n                    break;\n                  case \"postProcesses\":\n                    this._ApplyDeltaForEntity(a, e, e.getPostProcessByName.bind(e), function(d) {\n                      return ft.Parse(d, e, \"\");\n                    });\n                }\n              else\n                isNaN(s) ? s.fromArray && s.fromArray(a) : i[o] = a;\n            }\n          }, r._ApplyPropertiesToEntity = function(t, e) {\n            for (var n in t) {\n              var i = t[n], o = e[n];\n              o !== void 0 && (!isNaN(o) || Array.isArray(o) ? e[n] = i : o.fromArray && o.fromArray(i));\n            }\n          }, r._ApplyDeltaForEntity = function(t, e, n, i) {\n            for (var o = 0, a = t; o < a.length; o++) {\n              var s = a[o];\n              if (s.__state && s.__state.id !== void 0) {\n                var d = n(s.__state.id);\n                d && this._ApplyPropertiesToEntity(s, d);\n              } else if (s.__state && s.__state.deleteId !== void 0) {\n                var p = n(s.__state.deleteId);\n                p == null || p.dispose();\n              } else\n                i(s);\n            }\n          }, r;\n        }();\n        (function(r) {\n          var t = function() {\n            function n(i, o, a, s) {\n              var d;\n              o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), o = o ?? function() {\n                return 1;\n              }, a = a ?? function() {\n                return 1;\n              }, s = s ?? function(P, R) {\n                return P === R ? 0 : 1;\n              }, this._characterToIdx = /* @__PURE__ */ new Map(), this._insertionCosts = new Array(i.length), this._deletionCosts = new Array(i.length), this._substitutionCosts = new Array(i.length);\n              for (var p = 0; p < i.length; ++p) {\n                d = i[p], this._characterToIdx.set(d, p), this._insertionCosts[p] = o(d), this._deletionCosts[p] = a(d), this._substitutionCosts[p] = new Array(i.length);\n                for (var y = p; y < i.length; ++y)\n                  this._substitutionCosts[p][y] = s(d, i[y]);\n              }\n            }\n            return n.prototype.serialize = function() {\n              var i = {}, o = new Array(this._characterToIdx.size);\n              return this._characterToIdx.forEach(function(a, s) {\n                o[a] = s;\n              }), i.characters = o, i.insertionCosts = this._insertionCosts, i.deletionCosts = this._deletionCosts, i.substitutionCosts = this._substitutionCosts, JSON.stringify(i);\n            }, n.Deserialize = function(i) {\n              var o = JSON.parse(i), a = new n(o.characters);\n              return a._insertionCosts = o.insertionCosts, a._deletionCosts = o.deletionCosts, a._substitutionCosts = o.substitutionCosts, a;\n            }, n.prototype.getCharacterIdx = function(i) {\n              return this._characterToIdx.get(i);\n            }, n.prototype.getInsertionCost = function(i) {\n              return this._insertionCosts[i];\n            }, n.prototype.getDeletionCost = function(i) {\n              return this._deletionCosts[i];\n            }, n.prototype.getSubstitutionCost = function(i, o) {\n              var a = Math.min(i, o), s = Math.max(i, o);\n              return this._substitutionCosts[a][s];\n            }, n;\n          }();\n          r.Alphabet = t;\n          var e = function() {\n            function n(i, o) {\n              var a = this;\n              if (i.length > n.MAX_SEQUENCE_LENGTH)\n                throw new Error(\"Sequences longer than \" + n.MAX_SEQUENCE_LENGTH + \" not supported.\");\n              this._alphabet = o, this._characters = i.map(function(s) {\n                return a._alphabet.getCharacterIdx(s);\n              });\n            }\n            return n.prototype.serialize = function() {\n              return JSON.stringify(this._characters);\n            }, n.Deserialize = function(i, o) {\n              var a = new n([], o);\n              return a._characters = JSON.parse(i), a;\n            }, n.prototype.distance = function(i) {\n              return n._distance(this, i);\n            }, n._distance = function(i, o) {\n              var a = i._alphabet;\n              if (a !== o._alphabet)\n                throw new Error(\"Cannot Levenshtein compare Sequences built from different alphabets.\");\n              var s = i._characters, d = o._characters, p = s.length, y = d.length, P = n._costMatrix;\n              P[0][0] = 0;\n              for (var R = 0; R < p; ++R)\n                P[R + 1][0] = P[R][0] + a.getInsertionCost(s[R]);\n              for (R = 0; R < y; ++R)\n                P[0][R + 1] = P[0][R] + a.getInsertionCost(d[R]);\n              for (var B = 0; B < p; ++B)\n                for (var F = 0; F < y; ++F)\n                  n._insertionCost = P[B + 1][F] + a.getInsertionCost(d[F]), n._deletionCost = P[B][F + 1] + a.getDeletionCost(s[B]), n._substitutionCost = P[B][F] + a.getSubstitutionCost(s[B], d[F]), P[B + 1][F + 1] = Math.min(n._insertionCost, n._deletionCost, n._substitutionCost);\n              return P[p][y];\n            }, n.MAX_SEQUENCE_LENGTH = 256, n._costMatrix = Object(c.f)(Array(n.MAX_SEQUENCE_LENGTH + 1)).map(function(i) {\n              return new Array(n.MAX_SEQUENCE_LENGTH + 1);\n            }), n;\n          }();\n          r.Sequence = e;\n        })(Dr || (Dr = {}));\n        var Xg = function() {\n          function r(t) {\n            t === void 0 && (t = 0.01), this._points = [], this._segmentLength = t;\n          }\n          return r.prototype.serialize = function() {\n            return JSON.stringify(this);\n          }, r.Deserialize = function(t) {\n            var e = JSON.parse(t), n = new r(e._segmentLength);\n            return n._points = e._points.map(function(i) {\n              return new u.e(i._x, i._y, i._z);\n            }), n;\n          }, r.prototype.getLength = function() {\n            return this._points.length * this._segmentLength;\n          }, r.prototype.add = function(t) {\n            var e = this, n = this._points.length;\n            if (n === 0)\n              this._points.push(t.clone());\n            else\n              for (var i = function() {\n                return e._segmentLength / u.e.Distance(e._points[n - 1], t);\n              }, o = i(); o <= 1; o = i()) {\n                var a = this._points[n - 1].scale(1 - o);\n                t.scaleAndAddToRef(o, a), this._points.push(a), ++n;\n              }\n          }, r.prototype.resampleAtTargetResolution = function(t) {\n            var e = new r(this.getLength() / t);\n            return this._points.forEach(function(n) {\n              e.add(n);\n            }), e;\n          }, r.prototype.tokenize = function(t) {\n            for (var e = [], n = new u.e(), i = 2; i < this._points.length; ++i)\n              r._transformSegmentDirToRef(this._points[i - 2], this._points[i - 1], this._points[i], n) && e.push(r._tokenizeSegment(n, t));\n            return e;\n          }, r._transformSegmentDirToRef = function(t, e, n, i) {\n            return e.subtractToRef(t, r._forwardDir), r._forwardDir.normalize(), e.scaleToRef(-1, r._inverseFromVec), r._inverseFromVec.normalize(), !(Math.abs(u.e.Dot(r._forwardDir, r._inverseFromVec)) > 0.98) && (u.e.CrossToRef(r._forwardDir, r._inverseFromVec, r._upDir), r._upDir.normalize(), u.a.LookAtLHToRef(t, e, r._upDir, r._lookMatrix), n.subtractToRef(e, r._fromToVec), r._fromToVec.normalize(), u.e.TransformNormalToRef(r._fromToVec, r._lookMatrix, i), !0);\n          }, r._tokenizeSegment = function(t, e) {\n            r._bestMatch = 0, r._score = u.e.Dot(t, e[0]), r._bestScore = r._score;\n            for (var n = 1; n < e.length; ++n)\n              r._score = u.e.Dot(t, e[n]), r._score > r._bestScore && (r._bestMatch = n, r._bestScore = r._score);\n            return r._bestMatch;\n          }, r._forwardDir = new u.e(), r._inverseFromVec = new u.e(), r._upDir = new u.e(), r._fromToVec = new u.e(), r._lookMatrix = new u.a(), r;\n        }(), Zd = function() {\n          function r(t) {\n            this.chars = new Array(t);\n          }\n          return r.Generate = function(t, e, n, i, o) {\n            t === void 0 && (t = 64), e === void 0 && (e = 256), n === void 0 && (n = 0.1), i === void 0 && (i = 1e-3), o === void 0 && (o = []);\n            for (var a, s, d = new r(t), p = 0; p < t; ++p)\n              d.chars[p] = new u.e(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5), d.chars[p].normalize();\n            for (p = 0; p < o.length; ++p)\n              d.chars[p].copyFrom(o[p]);\n            for (var y, P = new u.e(), R = new u.e(), B = 0; B < e; ++B) {\n              a = (1 - (y = B / (e - 1))) * n + y * i;\n              var F = function(z) {\n                P.copyFromFloats(0, 0, 0), d.chars.forEach(function(J) {\n                  d.chars[z].subtractToRef(J, R), (s = R.lengthSquared()) > 1e-6 && R.scaleAndAddToRef(1 / (R.lengthSquared() * s), P);\n                }), P.scaleInPlace(a), d.chars[z].addInPlace(P), d.chars[z].normalize();\n              };\n              for (p = o.length; p < d.chars.length; ++p)\n                F(p);\n            }\n            return d;\n          }, r.prototype.serialize = function() {\n            return JSON.stringify(this.chars);\n          }, r.Deserialize = function(t) {\n            for (var e = JSON.parse(t), n = new r(e.length), i = 0; i < e.length; ++i)\n              n.chars[i] = new u.e(e[i]._x, e[i]._y, e[i]._z);\n            return n;\n          }, r;\n        }(), Gc = function() {\n          function r() {\n            this._sequences = [];\n          }\n          return r.prototype.serialize = function() {\n            return JSON.stringify(this._sequences.map(function(t) {\n              return t.serialize();\n            }));\n          }, r.Deserialize = function(t, e) {\n            var n = new r();\n            return n._sequences = JSON.parse(t).map(function(i) {\n              return Dr.Sequence.Deserialize(i, e);\n            }), n;\n          }, r.CreateFromTrajectory = function(t, e, n) {\n            return r.CreateFromTokenizationPyramid(r._getTokenizationPyramid(t, e), n);\n          }, r.CreateFromTokenizationPyramid = function(t, e) {\n            var n = new r();\n            return n._sequences = t.map(function(i) {\n              return new Dr.Sequence(i, e);\n            }), n;\n          }, r._getTokenizationPyramid = function(t, e, n) {\n            n === void 0 && (n = r.FINEST_DESCRIPTOR_RESOLUTION);\n            for (var i = [], o = n; o > 4; o = Math.floor(o / 2))\n              i.push(t.resampleAtTargetResolution(o).tokenize(e.chars));\n            return i;\n          }, r.prototype.distance = function(t) {\n            for (var e = 0, n = 0; n < this._sequences.length; ++n)\n              e += Math.pow(2, n) * this._sequences[n].distance(t._sequences[n]);\n            return e;\n          }, r.FINEST_DESCRIPTOR_RESOLUTION = 32, r;\n        }(), Jd = function() {\n          function r(t) {\n            t === void 0 && (t = []), this._descriptors = t, this._centroidIdx = -1, this._averageDistance = 0, this._refreshDescription();\n          }\n          return r.prototype.serialize = function() {\n            var t = {};\n            return t.descriptors = this._descriptors.map(function(e) {\n              return e.serialize();\n            }), t.centroidIdx = this._centroidIdx, t.averageDistance = this._averageDistance, JSON.stringify(t);\n          }, r.Deserialize = function(t, e) {\n            var n = JSON.parse(t), i = new r();\n            return i._descriptors = n.descriptors.map(function(o) {\n              return Gc.Deserialize(o, e);\n            }), i._centroidIdx = n.centroidIdx, i._averageDistance = n.averageDistance, i;\n          }, r.prototype.add = function(t) {\n            this._descriptors.push(t), this._refreshDescription();\n          }, r.prototype.getMatchCost = function(t) {\n            return t.distance(this._descriptors[this._centroidIdx]) / this._averageDistance;\n          }, r.prototype.getMatchMinimumDistance = function(t) {\n            return Math.min.apply(Math, this._descriptors.map(function(e) {\n              return e.distance(t);\n            }));\n          }, r.prototype._refreshDescription = function() {\n            var t, e = this;\n            this._centroidIdx = -1;\n            for (var n = this._descriptors.map(function(o) {\n              return t = 0, e._descriptors.forEach(function(a) {\n                t += o.distance(a);\n              }), t;\n            }), i = 0; i < n.length; ++i)\n              (this._centroidIdx < 0 || n[i] < n[this._centroidIdx]) && (this._centroidIdx = i);\n            this._averageDistance = 0, this._descriptors.forEach(function(o) {\n              e._averageDistance += o.distance(e._descriptors[e._centroidIdx]);\n            }), this._descriptors.length > 0 && (this._averageDistance = Math.max(this._averageDistance / this._descriptors.length, r.MIN_AVERAGE_DISTANCE));\n          }, r.MIN_AVERAGE_DISTANCE = 1, r;\n        }(), Yg = function() {\n          function r() {\n            this._maximumAllowableMatchCost = 4, this._nameToDescribedTrajectory = /* @__PURE__ */ new Map();\n          }\n          return r.prototype.serialize = function() {\n            var t = {};\n            return t.maximumAllowableMatchCost = this._maximumAllowableMatchCost, t.vector3Alphabet = this._vector3Alphabet.serialize(), t.levenshteinAlphabet = this._levenshteinAlphabet.serialize(), t.nameToDescribedTrajectory = [], this._nameToDescribedTrajectory.forEach(function(e, n) {\n              t.nameToDescribedTrajectory.push(n), t.nameToDescribedTrajectory.push(e.serialize());\n            }), JSON.stringify(t);\n          }, r.Deserialize = function(t) {\n            var e = JSON.parse(t), n = new r();\n            n._maximumAllowableMatchCost = e.maximumAllowableMatchCost, n._vector3Alphabet = Zd.Deserialize(e.vector3Alphabet), n._levenshteinAlphabet = Dr.Alphabet.Deserialize(e.levenshteinAlphabet);\n            for (var i = 0; i < e.nameToDescribedTrajectory.length; i += 2)\n              n._nameToDescribedTrajectory.set(e.nameToDescribedTrajectory[i], Jd.Deserialize(e.nameToDescribedTrajectory[i + 1], n._levenshteinAlphabet));\n            return n;\n          }, r.Generate = function() {\n            for (var t = Zd.Generate(64, 256, 0.1, 1e-3, [u.e.Forward()]), e = new Array(t.chars.length), n = 0; n < e.length; ++n)\n              e[n] = n;\n            var i = new Dr.Alphabet(e, function(a) {\n              return a === 0 ? 0 : 1;\n            }, function(a) {\n              return a === 0 ? 0 : 1;\n            }, function(a, s) {\n              return Math.min(1 - u.e.Dot(t.chars[a], t.chars[s]), 1);\n            }), o = new r();\n            return o._vector3Alphabet = t, o._levenshteinAlphabet = i, o;\n          }, r.prototype.addTrajectoryToClassification = function(t, e) {\n            this._nameToDescribedTrajectory.has(e) || this._nameToDescribedTrajectory.set(e, new Jd()), this._nameToDescribedTrajectory.get(e).add(Gc.CreateFromTrajectory(t, this._vector3Alphabet, this._levenshteinAlphabet));\n          }, r.prototype.deleteClassification = function(t) {\n            return this._nameToDescribedTrajectory.delete(t);\n          }, r.prototype.classifyTrajectory = function(t) {\n            var e = this, n = Gc.CreateFromTrajectory(t, this._vector3Alphabet, this._levenshteinAlphabet), i = [];\n            if (this._nameToDescribedTrajectory.forEach(function(p, y) {\n              p.getMatchCost(n) < e._maximumAllowableMatchCost && i.push(y);\n            }), i.length === 0)\n              return null;\n            for (var o, a = 0, s = this._nameToDescribedTrajectory.get(i[a]).getMatchMinimumDistance(n), d = 0; d < i.length; ++d)\n              (o = this._nameToDescribedTrajectory.get(i[d]).getMatchMinimumDistance(n)) < s && (s = o, a = d);\n            return i[a];\n          }, r;\n        }(), Kg = f(150), Ea = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i.options = n, i._direction = new u.e(0, 0, -1), i._mat = new u.a(), i._onSelectEnabled = !1, i._origin = new u.e(0, 0, 0), i.lastNativeXRHitResults = [], i.onHitTestResultObservable = new C.c(), i._onHitTestResults = function(o) {\n              var a = o.map(function(s) {\n                var d = u.a.FromArray(s.hitMatrix);\n                return i._xrSessionManager.scene.useRightHandedSystem || d.toggleModelMatrixHandInPlace(), i.options.worldParentNode && d.multiplyToRef(i.options.worldParentNode.getWorldMatrix(), d), { xrHitResult: s, transformationMatrix: d };\n              });\n              i.lastNativeXRHitResults = o, i.onHitTestResultObservable.notifyObservers(a);\n            }, i._onSelect = function(o) {\n              i._onSelectEnabled && t.XRHitTestWithSelectEvent(o, i._xrSessionManager.referenceSpace);\n            }, i.xrNativeFeatureName = \"hit-test\", Xe.b.Warn(\"A newer version of this plugin is available\"), i;\n          }\n          return Object(c.d)(t, r), t.XRHitTestWithRay = function(e, n, i, o) {\n            return e.requestHitTest(n, i).then(function(a) {\n              var s = o || function(d) {\n                return !!d.hitMatrix;\n              };\n              return a.filter(s);\n            });\n          }, t.XRHitTestWithSelectEvent = function(e, n) {\n            var i = e.frame.getPose(e.inputSource.targetRaySpace, n);\n            if (!i)\n              return Promise.resolve([]);\n            var o = new XRRay(i.transform);\n            return this.XRHitTestWithRay(e.frame.session, o, n);\n          }, t.prototype.attach = function() {\n            return !!r.prototype.attach.call(this) && (this.options.testOnPointerDownOnly && this._xrSessionManager.session.addEventListener(\"select\", this._onSelect, !1), !0);\n          }, t.prototype.detach = function() {\n            return !!r.prototype.detach.call(this) && (this._onSelectEnabled = !1, this._xrSessionManager.session.removeEventListener(\"select\", this._onSelect), !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onHitTestResultObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            if (this.attached && !this.options.testOnPointerDownOnly) {\n              var n = e.getViewerPose(this._xrSessionManager.referenceSpace);\n              if (n) {\n                u.a.FromArrayToRef(n.transform.matrix, 0, this._mat), u.e.TransformCoordinatesFromFloatsToRef(0, 0, 0, this._mat, this._origin), u.e.TransformCoordinatesFromFloatsToRef(0, 0, -1, this._mat, this._direction), this._direction.subtractInPlace(this._origin), this._direction.normalize();\n                var i = new XRRay({ x: this._origin.x, y: this._origin.y, z: this._origin.z, w: 0 }, { x: this._direction.x, y: this._direction.y, z: this._direction.z, w: 0 });\n                t.XRHitTestWithRay(this._xrSessionManager.session, i, this._xrSessionManager.referenceSpace).then(this._onHitTestResults);\n              }\n            }\n          }, t.Name = ti.HIT_TEST, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Ea.Name, function(r, t) {\n          return function() {\n            return new Ea(r, t);\n          };\n        }, Ea.Version, !1);\n        var Qg = 0, Sa = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i._options = n, i._lastFrameDetected = /* @__PURE__ */ new Set(), i._trackedAnchors = [], i._futureAnchors = [], i.onAnchorAddedObservable = new C.c(), i.onAnchorRemovedObservable = new C.c(), i.onAnchorUpdatedObservable = new C.c(), i._tmpVector = new u.e(), i._tmpQuaternion = new u.b(), i.xrNativeFeatureName = \"anchors\", i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"referenceSpaceForFrameAnchors\", { set: function(e) {\n            this._referenceSpaceForFrameAnchors = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._populateTmpTransformation = function(e, n) {\n            return this._tmpVector.copyFrom(e), this._tmpQuaternion.copyFrom(n), this._xrSessionManager.scene.useRightHandedSystem || (this._tmpVector.z *= -1, this._tmpQuaternion.z *= -1, this._tmpQuaternion.w *= -1), { position: this._tmpVector, rotationQuaternion: this._tmpQuaternion };\n          }, t.prototype.addAnchorPointUsingHitTestResultAsync = function(e, n, i) {\n            return n === void 0 && (n = new u.e()), i === void 0 && (i = new u.b()), Object(c.b)(this, void 0, void 0, function() {\n              var o, a, s, d = this;\n              return Object(c.e)(this, function(p) {\n                switch (p.label) {\n                  case 0:\n                    if (this._populateTmpTransformation(n, i), o = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w }), e.xrHitResult.createAnchor)\n                      return [3, 1];\n                    throw this.detach(), new Error(\"Anchors not enabled in this environment/browser\");\n                  case 1:\n                    return p.trys.push([1, 3, , 4]), [4, e.xrHitResult.createAnchor(o)];\n                  case 2:\n                    return a = p.sent(), [2, new Promise(function(y, P) {\n                      d._futureAnchors.push({ nativeAnchor: a, resolved: !1, submitted: !0, xrTransformation: o, resolve: y, reject: P });\n                    })];\n                  case 3:\n                    throw s = p.sent(), new Error(s);\n                  case 4:\n                    return [2];\n                }\n              });\n            });\n          }, t.prototype.addAnchorAtPositionAndRotationAsync = function(e, n, i) {\n            return n === void 0 && (n = new u.b()), i === void 0 && (i = !1), Object(c.b)(this, void 0, void 0, function() {\n              var o, a, s, d = this;\n              return Object(c.e)(this, function(p) {\n                switch (p.label) {\n                  case 0:\n                    return this._populateTmpTransformation(e, n), o = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w }), i && this.attached && this._xrSessionManager.currentFrame ? [4, this._createAnchorAtTransformation(o, this._xrSessionManager.currentFrame)] : [3, 2];\n                  case 1:\n                    return s = p.sent(), [3, 3];\n                  case 2:\n                    s = void 0, p.label = 3;\n                  case 3:\n                    return a = s, [2, new Promise(function(y, P) {\n                      d._futureAnchors.push({ nativeAnchor: a, resolved: !1, submitted: !1, xrTransformation: o, resolve: y, reject: P });\n                    })];\n                }\n              });\n            });\n          }, Object.defineProperty(t.prototype, \"anchors\", { get: function() {\n            return this._trackedAnchors;\n          }, enumerable: !1, configurable: !0 }), t.prototype.detach = function() {\n            if (!r.prototype.detach.call(this))\n              return !1;\n            if (!this._options.doNotRemoveAnchorsOnSessionEnded)\n              for (; this._trackedAnchors.length; ) {\n                var e = this._trackedAnchors.pop();\n                if (e) {\n                  try {\n                    e.remove();\n                  } catch {\n                  }\n                  this.onAnchorRemovedObservable.notifyObservers(e);\n                }\n              }\n            return !0;\n          }, t.prototype.dispose = function() {\n            this._futureAnchors.length = 0, r.prototype.dispose.call(this), this.onAnchorAddedObservable.clear(), this.onAnchorRemovedObservable.clear(), this.onAnchorUpdatedObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            if (this.attached && e) {\n              var i = e.trackedAnchors;\n              if (i) {\n                var o = this._trackedAnchors.filter(function(s) {\n                  return !i.has(s.xrAnchor);\n                }).map(function(s) {\n                  return n._trackedAnchors.indexOf(s);\n                }), a = 0;\n                o.forEach(function(s) {\n                  var d = n._trackedAnchors.splice(s - a, 1)[0];\n                  n.onAnchorRemovedObservable.notifyObservers(d), a++;\n                }), i.forEach(function(s) {\n                  if (n._lastFrameDetected.has(s)) {\n                    var d = n._findIndexInAnchorArray(s);\n                    y = n._trackedAnchors[d];\n                    try {\n                      n._updateAnchorWithXRFrame(s, y, e), y.attachedNode && (y.attachedNode.rotationQuaternion = y.attachedNode.rotationQuaternion || new u.b(), y.transformationMatrix.decompose(y.attachedNode.scaling, y.attachedNode.rotationQuaternion, y.attachedNode.position)), n.onAnchorUpdatedObservable.notifyObservers(y);\n                    } catch {\n                      Xe.b.Warn(\"Anchor could not be updated\");\n                    }\n                  } else {\n                    var p = { id: Qg++, xrAnchor: s, remove: s.delete }, y = n._updateAnchorWithXRFrame(s, p, e);\n                    n._trackedAnchors.push(y), n.onAnchorAddedObservable.notifyObservers(y);\n                    var P = n._futureAnchors.filter(function(R) {\n                      return R.nativeAnchor === s;\n                    })[0];\n                    P && (P.resolve(y), P.resolved = !0);\n                  }\n                }), this._lastFrameDetected = i;\n              }\n              this._futureAnchors.forEach(function(s) {\n                s.resolved || s.submitted || (n._createAnchorAtTransformation(s.xrTransformation, e).then(function(d) {\n                  s.nativeAnchor = d;\n                }, function(d) {\n                  s.resolved = !0, s.reject(d);\n                }), s.submitted = !0);\n              });\n            }\n          }, t.prototype._findIndexInAnchorArray = function(e) {\n            for (var n = 0; n < this._trackedAnchors.length; ++n)\n              if (this._trackedAnchors[n].xrAnchor === e)\n                return n;\n            return -1;\n          }, t.prototype._updateAnchorWithXRFrame = function(e, n, i) {\n            var o = i.getPose(e.anchorSpace, this._xrSessionManager.referenceSpace);\n            if (o) {\n              var a = n.transformationMatrix || new u.a();\n              u.a.FromArrayToRef(o.transform.matrix, 0, a), this._xrSessionManager.scene.useRightHandedSystem || a.toggleModelMatrixHandInPlace(), n.transformationMatrix = a, this._options.worldParentNode && a.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), a);\n            }\n            return n;\n          }, t.prototype._createAnchorAtTransformation = function(e, n) {\n            var i;\n            return Object(c.b)(this, void 0, void 0, function() {\n              return Object(c.e)(this, function(o) {\n                if (!n.createAnchor)\n                  throw this.detach(), new Error(\"Anchors are not enabled in your browser\");\n                try {\n                  return [2, n.createAnchor(e, (i = this._referenceSpaceForFrameAnchors) !== null && i !== void 0 ? i : this._xrSessionManager.referenceSpace)];\n                } catch (a) {\n                  throw new Error(a);\n                }\n                return [2];\n              });\n            });\n          }, t.Name = ti.ANCHOR_SYSTEM, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Sa.Name, function(r, t) {\n          return function() {\n            return new Sa(r, t);\n          };\n        }, Sa.Version);\n        var qg = 0, Aa = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i._options = n, i._detectedPlanes = [], i._enabled = !1, i._lastFrameDetected = /* @__PURE__ */ new Set(), i.onPlaneAddedObservable = new C.c(), i.onPlaneRemovedObservable = new C.c(), i.onPlaneUpdatedObservable = new C.c(), i.xrNativeFeatureName = \"plane-detection\", i._xrSessionManager.session ? i._init() : i._xrSessionManager.onXRSessionInit.addOnce(function() {\n              i._init();\n            }), i;\n          }\n          return Object(c.d)(t, r), t.prototype.detach = function() {\n            if (!r.prototype.detach.call(this))\n              return !1;\n            if (!this._options.doNotRemovePlanesOnSessionEnded)\n              for (; this._detectedPlanes.length; ) {\n                var e = this._detectedPlanes.pop();\n                e && this.onPlaneRemovedObservable.notifyObservers(e);\n              }\n            return !0;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onPlaneAddedObservable.clear(), this.onPlaneRemovedObservable.clear(), this.onPlaneUpdatedObservable.clear();\n          }, t.prototype.isCompatible = function() {\n            return typeof XRPlane < \"u\";\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            if (this.attached && this._enabled && e) {\n              var i = e.worldInformation.detectedPlanes;\n              if (i) {\n                var o = this._detectedPlanes.filter(function(s) {\n                  return !i.has(s.xrPlane);\n                }).map(function(s) {\n                  return n._detectedPlanes.indexOf(s);\n                }), a = 0;\n                o.forEach(function(s) {\n                  var d = n._detectedPlanes.splice(s - a, 1)[0];\n                  n.onPlaneRemovedObservable.notifyObservers(d), a++;\n                }), i.forEach(function(s) {\n                  if (n._lastFrameDetected.has(s)) {\n                    if (s.lastChangedTime === n._xrSessionManager.currentTimestamp) {\n                      var d = n.findIndexInPlaneArray(s);\n                      y = n._detectedPlanes[d], n._updatePlaneWithXRPlane(s, y, e), n.onPlaneUpdatedObservable.notifyObservers(y);\n                    }\n                  } else {\n                    var p = { id: qg++, xrPlane: s, polygonDefinition: [] }, y = n._updatePlaneWithXRPlane(s, p, e);\n                    n._detectedPlanes.push(y), n.onPlaneAddedObservable.notifyObservers(y);\n                  }\n                }), this._lastFrameDetected = i;\n              }\n            }\n          }, t.prototype._init = function() {\n            var e, n, i = this, o = function() {\n              i._enabled = !0, i._detectedPlanes.length && (i._detectedPlanes.length = 0);\n            };\n            this._xrSessionManager.session.updateWorldTrackingState ? (this._xrSessionManager.session.updateWorldTrackingState({ planeDetectionState: { enabled: !0 } }), o()) : !((n = (e = this._xrSessionManager.session.worldTrackingState) === null || e === void 0 ? void 0 : e.planeDetectionState) === null || n === void 0) && n.enabled && o();\n          }, t.prototype._updatePlaneWithXRPlane = function(e, n, i) {\n            var o = this;\n            n.polygonDefinition = e.polygon.map(function(d) {\n              var p = o._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;\n              return new u.e(d.x, d.y, d.z * p);\n            });\n            var a = i.getPose(e.planeSpace, this._xrSessionManager.referenceSpace);\n            if (a) {\n              var s = n.transformationMatrix || new u.a();\n              u.a.FromArrayToRef(a.transform.matrix, 0, s), this._xrSessionManager.scene.useRightHandedSystem || s.toggleModelMatrixHandInPlace(), n.transformationMatrix = s, this._options.worldParentNode && s.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), s);\n            }\n            return n;\n          }, t.prototype.findIndexInPlaneArray = function(e) {\n            for (var n = 0; n < this._detectedPlanes.length; ++n)\n              if (this._detectedPlanes[n].xrPlane === e)\n                return n;\n            return -1;\n          }, t.Name = ti.PLANE_DETECTION, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Aa.Name, function(r, t) {\n          return function() {\n            return new Aa(r, t);\n          };\n        }, Aa.Version);\n        var Pa = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i.options = n, i.onBackgroundStateChangedObservable = new C.c(), i;\n          }\n          return Object(c.d)(t, r), t.prototype.attach = function() {\n            return this._setBackgroundState(!1), r.prototype.attach.call(this);\n          }, t.prototype.detach = function() {\n            return this._setBackgroundState(!0), r.prototype.detach.call(this);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onBackgroundStateChangedObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n          }, t.prototype._setBackgroundState = function(e) {\n            var n = this._xrSessionManager.scene;\n            if (!this.options.ignoreEnvironmentHelper)\n              if (this.options.environmentHelperRemovalFlags) {\n                if (this.options.environmentHelperRemovalFlags.skyBox) {\n                  var i = n.getMeshByName(\"BackgroundSkybox\");\n                  i && i.setEnabled(e);\n                }\n                if (this.options.environmentHelperRemovalFlags.ground) {\n                  var o = n.getMeshByName(\"BackgroundPlane\");\n                  o && o.setEnabled(e);\n                }\n              } else {\n                var a = n.getMeshByName(\"BackgroundHelper\");\n                a && a.setEnabled(e);\n              }\n            this.options.backgroundMeshes && this.options.backgroundMeshes.forEach(function(s) {\n              return s.setEnabled(e);\n            }), this.onBackgroundStateChangedObservable.notifyObservers(e);\n          }, t.Name = ti.BACKGROUND_REMOVER, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Pa.Name, function(r, t) {\n          return function() {\n            return new Pa(r, t);\n          };\n        }, Pa.Version, !0);\n        var Zg = function() {\n        }, xa = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i._options = n, i._attachController = function(o) {\n              if (!i._controllers[o.uniqueId])\n                if (i._xrSessionManager.scene.isPhysicsEnabled() || l.a.Warn(\"physics engine not enabled, skipped. Please add this controller manually.\"), i._options.physicsProperties.useControllerMesh && o.inputSource.gamepad)\n                  o.onMotionControllerInitObservable.addOnce(function(P) {\n                    P.onModelLoadedObservable.addOnce(function() {\n                      var R = new At.a(P.rootMesh, At.a.MeshImpostor, Object(c.a)({ mass: 0 }, i._options.physicsProperties)), B = o.grip || o.pointer;\n                      i._controllers[o.uniqueId] = { xrController: o, impostor: R, oldPos: B.position.clone(), oldRotation: B.rotationQuaternion.clone() };\n                    });\n                  });\n                else {\n                  var a = i._options.physicsProperties.impostorType || At.a.SphereImpostor, s = i._options.physicsProperties.impostorSize || 0.1, d = Nn.a.CreateSphere(\"impostor-mesh-\" + o.uniqueId, { diameterX: typeof s == \"number\" ? s : s.width, diameterY: typeof s == \"number\" ? s : s.height, diameterZ: typeof s == \"number\" ? s : s.depth });\n                  d.isVisible = i._debugMode, d.isPickable = !1, d.rotationQuaternion = new u.b();\n                  var p = o.grip || o.pointer;\n                  d.position.copyFrom(p.position), d.rotationQuaternion.copyFrom(p.rotationQuaternion);\n                  var y = new At.a(d, a, Object(c.a)({ mass: 0 }, i._options.physicsProperties));\n                  i._controllers[o.uniqueId] = { xrController: o, impostor: y, impostorMesh: d };\n                }\n            }, i._controllers = {}, i._debugMode = !1, i._delta = 0, i._lastTimestamp = 0, i._tmpQuaternion = new u.b(), i._tmpVector = new u.e(), i._options.physicsProperties || (i._options.physicsProperties = {}), i;\n          }\n          return Object(c.d)(t, r), t.prototype._enablePhysicsDebug = function() {\n            var e = this;\n            this._debugMode = !0, Object.keys(this._controllers).forEach(function(n) {\n              var i = e._controllers[n];\n              i.impostorMesh && (i.impostorMesh.isVisible = !0);\n            });\n          }, t.prototype.addController = function(e) {\n            this._attachController(e);\n          }, t.prototype.attach = function() {\n            var e = this;\n            if (!r.prototype.attach.call(this))\n              return !1;\n            if (!this._options.xrInput)\n              return !0;\n            if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, function(o) {\n              e._detachController(o.uniqueId);\n            }), this._options.enableHeadsetImpostor) {\n              var n = this._options.headsetImpostorParams || { impostorType: At.a.SphereImpostor, restitution: 0.8, impostorSize: 0.3 }, i = n.impostorSize || 0.3;\n              this._headsetMesh = Nn.a.CreateSphere(\"headset-mesh\", { diameterX: typeof i == \"number\" ? i : i.width, diameterY: typeof i == \"number\" ? i : i.height, diameterZ: typeof i == \"number\" ? i : i.depth }), this._headsetMesh.rotationQuaternion = new u.b(), this._headsetMesh.isVisible = !1, this._headsetImpostor = new At.a(this._headsetMesh, n.impostorType, Object(c.a)({ mass: 0 }, n));\n            }\n            return !0;\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._controllers).forEach(function(n) {\n              e._detachController(n);\n            }), this._headsetMesh && this._headsetMesh.dispose(), !0);\n          }, t.prototype.getHeadsetImpostor = function() {\n            return this._headsetImpostor;\n          }, t.prototype.getImpostorForController = function(e) {\n            var n = typeof e == \"string\" ? e : e.uniqueId;\n            return this._controllers[n] ? this._controllers[n].impostor : null;\n          }, t.prototype.setPhysicsProperties = function(e) {\n            this._options.physicsProperties = Object(c.a)(Object(c.a)({}, this._options.physicsProperties), e);\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            this._delta = this._xrSessionManager.currentTimestamp - this._lastTimestamp, this._lastTimestamp = this._xrSessionManager.currentTimestamp, this._headsetMesh && (this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.position), this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion)), Object.keys(this._controllers).forEach(function(i) {\n              var o = n._controllers[i], a = o.xrController.grip || o.xrController.pointer, s = o.oldPos || o.impostorMesh.position, d = o.oldRotation || o.impostorMesh.rotationQuaternion;\n              if (a.position.subtractToRef(s, n._tmpVector), n._tmpVector.scaleInPlace(1e3 / n._delta), o.impostor.setLinearVelocity(n._tmpVector), n._debugMode && console.log(n._tmpVector, \"linear\"), !d.equalsWithEpsilon(a.rotationQuaternion)) {\n                d.conjugateInPlace().multiplyToRef(a.rotationQuaternion, n._tmpQuaternion);\n                var p = Math.sqrt(n._tmpQuaternion.x * n._tmpQuaternion.x + n._tmpQuaternion.y * n._tmpQuaternion.y + n._tmpQuaternion.z * n._tmpQuaternion.z);\n                if (n._tmpVector.set(n._tmpQuaternion.x, n._tmpQuaternion.y, n._tmpQuaternion.z), p < 1e-3)\n                  n._tmpVector.scaleInPlace(2);\n                else {\n                  var y = 2 * Math.atan2(p, n._tmpQuaternion.w);\n                  n._tmpVector.scaleInPlace(y / (p * (n._delta / 1e3)));\n                }\n                o.impostor.setAngularVelocity(n._tmpVector), n._debugMode && console.log(n._tmpVector, n._tmpQuaternion, \"angular\");\n              }\n              s.copyFrom(a.position), d.copyFrom(a.rotationQuaternion);\n            });\n          }, t.prototype._detachController = function(e) {\n            var n = this._controllers[e];\n            n && (n.impostorMesh && n.impostorMesh.dispose(), delete this._controllers[e]);\n          }, t.Name = ti.PHYSICS_CONTROLLERS, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(xa.Name, function(r, t) {\n          return function() {\n            return new xa(r, t);\n          };\n        }, xa.Version, !0);\n        var Ca = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i.options = n, i._tmpMat = new u.a(), i._tmpPos = new u.e(), i._tmpQuat = new u.b(), i.initHitTestSource = function(o) {\n              if (o) {\n                var a = new XRRay(i.options.offsetRay || {}), s = { space: i.options.useReferenceSpace ? o : i._xrSessionManager.viewerReferenceSpace, offsetRay: a };\n                i.options.entityTypes && (s.entityTypes = i.options.entityTypes), s.space ? i._xrSessionManager.session.requestHitTestSource(s).then(function(d) {\n                  i._xrHitTestSource && i._xrHitTestSource.cancel(), i._xrHitTestSource = d;\n                }) : Xe.b.Warn(\"waiting for viewer reference space to initialize\");\n              }\n            }, i.autoCloneTransformation = !1, i.onHitTestResultObservable = new C.c(), i.paused = !1, i.xrNativeFeatureName = \"hit-test\", Xe.b.Warn(\"Hit test is an experimental and unstable feature.\"), i;\n          }\n          return Object(c.d)(t, r), t.prototype.attach = function() {\n            var e = this;\n            if (!r.prototype.attach.call(this) || !this._xrSessionManager.session.requestHitTestSource)\n              return !1;\n            if (this.options.disablePermanentHitTest || (this._xrSessionManager.referenceSpace && this.initHitTestSource(this._xrSessionManager.referenceSpace), this._xrSessionManager.onXRReferenceSpaceChanged.add(this.initHitTestSource)), this.options.enableTransientHitTest) {\n              var n = new XRRay(this.options.transientOffsetRay || {});\n              this._xrSessionManager.session.requestHitTestSourceForTransientInput({ profile: \"generic-touchscreen\", offsetRay: n, entityTypes: this.options.entityTypes }).then(function(i) {\n                e._transientXrHitTestSource = i;\n              });\n            }\n            return !0;\n          }, t.prototype.detach = function() {\n            return !!r.prototype.detach.call(this) && (this._xrHitTestSource && (this._xrHitTestSource.cancel(), this._xrHitTestSource = null), this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this.initHitTestSource), this._transientXrHitTestSource && (this._transientXrHitTestSource.cancel(), this._transientXrHitTestSource = null), !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onHitTestResultObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            if (this.attached && !this.paused) {\n              if (this._xrHitTestSource) {\n                var i = e.getHitTestResults(this._xrHitTestSource);\n                this._processWebXRHitTestResult(i);\n              }\n              this._transientXrHitTestSource && e.getHitTestResultsForTransientInput(this._transientXrHitTestSource).forEach(function(o) {\n                n._processWebXRHitTestResult(o.results, o.inputSource);\n              });\n            }\n          }, t.prototype._processWebXRHitTestResult = function(e, n) {\n            var i = this, o = [];\n            e.forEach(function(a) {\n              var s = a.getPose(i._xrSessionManager.referenceSpace);\n              if (s) {\n                var d = s.transform.position, p = s.transform.orientation;\n                i._tmpPos.set(d.x, d.y, d.z), i._tmpQuat.set(p.x, p.y, p.z, p.w), u.a.FromFloat32ArrayToRefScaled(s.transform.matrix, 0, 1, i._tmpMat), i._xrSessionManager.scene.useRightHandedSystem || (i._tmpPos.z *= -1, i._tmpQuat.z *= -1, i._tmpQuat.w *= -1, i._tmpMat.toggleModelMatrixHandInPlace());\n                var y = { position: i.autoCloneTransformation ? i._tmpPos.clone() : i._tmpPos, rotationQuaternion: i.autoCloneTransformation ? i._tmpQuat.clone() : i._tmpQuat, transformationMatrix: i.autoCloneTransformation ? i._tmpMat.clone() : i._tmpMat, inputSource: n, isTransient: !!n, xrHitResult: a };\n                o.push(y);\n              }\n            }), this.onHitTestResultObservable.notifyObservers(o);\n          }, t.Name = ti.HIT_TEST, t.Version = 2, t;\n        }(ni);\n        Wn.AddWebXRFeature(Ca.Name, function(r, t) {\n          return function() {\n            return new Ca(r, t);\n          };\n        }, Ca.Version, !1);\n        var Ra = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._enabled = !1, n._featurePointCloud = [], n.onFeaturePointsAddedObservable = new C.c(), n.onFeaturePointsUpdatedObservable = new C.c(), n.xrNativeFeatureName = \"bjsfeature-points\", n._xrSessionManager.session ? n._init() : n._xrSessionManager.onXRSessionInit.addOnce(function() {\n              n._init();\n            }), n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"featurePointCloud\", { get: function() {\n            return this._featurePointCloud;\n          }, enumerable: !1, configurable: !0 }), t.prototype.detach = function() {\n            return !!r.prototype.detach.call(this) && (this.featurePointCloud.length = 0, !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._featurePointCloud.length = 0, this.onFeaturePointsUpdatedObservable.clear(), this.onFeaturePointsAddedObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            if (this.attached && this._enabled && e) {\n              var n = e.featurePointCloud;\n              if (n && n.length !== 0) {\n                if (n.length % 5 != 0)\n                  throw new Error(\"Received malformed feature point cloud of length: \" + n.length);\n                for (var i = n.length / 5, o = new Array(), a = new Array(), s = 0; s < i; s++) {\n                  var d = 5 * s, p = n[d + 4];\n                  this._featurePointCloud[p] ? o.push(p) : (this._featurePointCloud[p] = { position: new u.e(), confidenceValue: 0 }, a.push(p)), this._featurePointCloud[p].position.x = n[d], this._featurePointCloud[p].position.y = n[d + 1], this._featurePointCloud[p].position.z = n[d + 2], this._featurePointCloud[p].confidenceValue = n[d + 3];\n                }\n                a.length > 0 && this.onFeaturePointsAddedObservable.notifyObservers(a), o.length > 0 && this.onFeaturePointsUpdatedObservable.notifyObservers(o);\n              }\n            }\n          }, t.prototype._init = function() {\n            this._xrSessionManager.session.trySetFeaturePointCloudEnabled && this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0) && (this._enabled = !0);\n          }, t.Name = ti.FEATURE_POINTS, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Ra.Name, function(r) {\n          return function() {\n            return new Ra(r);\n          };\n        }, Ra.Version);\n        var $d = function() {\n          function r(t, e, n, i, o) {\n            this.xrController = t, this.trackedMeshes = e, this._handMesh = n, this._rigMapping = i, this._defaultHandMesh = !1, this._transformNodeMapping = [], this.handPartsDefinition = this.generateHandPartsDefinition(t.inputSource.hand), this._scene = e[0].getScene(), this._handMesh && this._rigMapping ? this._defaultHandMesh = !1 : o || this._generateDefaultHandMesh(), this.xrController.motionController && (this.xrController.motionController.rootMesh ? this.xrController.motionController.rootMesh.setEnabled(!1) : this.xrController.motionController.onModelLoadedObservable.add(function(a) {\n              a.rootMesh && a.rootMesh.setEnabled(!1);\n            })), this.xrController.onMotionControllerInitObservable.add(function(a) {\n              a.onModelLoadedObservable.add(function(s) {\n                s.rootMesh && s.rootMesh.setEnabled(!1);\n              }), a.rootMesh && a.rootMesh.setEnabled(!1);\n            });\n          }\n          return r.prototype.generateHandPartsDefinition = function(t) {\n            var e;\n            return (e = {}).wrist = [t.WRIST], e.thumb = [t.THUMB_METACARPAL, t.THUMB_PHALANX_PROXIMAL, t.THUMB_PHALANX_DISTAL, t.THUMB_PHALANX_TIP], e.index = [t.INDEX_METACARPAL, t.INDEX_PHALANX_PROXIMAL, t.INDEX_PHALANX_INTERMEDIATE, t.INDEX_PHALANX_DISTAL, t.INDEX_PHALANX_TIP], e.middle = [t.MIDDLE_METACARPAL, t.MIDDLE_PHALANX_PROXIMAL, t.MIDDLE_PHALANX_INTERMEDIATE, t.MIDDLE_PHALANX_DISTAL, t.MIDDLE_PHALANX_TIP], e.ring = [t.RING_METACARPAL, t.RING_PHALANX_PROXIMAL, t.RING_PHALANX_INTERMEDIATE, t.RING_PHALANX_DISTAL, t.RING_PHALANX_TIP], e.little = [t.LITTLE_METACARPAL, t.LITTLE_PHALANX_PROXIMAL, t.LITTLE_PHALANX_INTERMEDIATE, t.LITTLE_PHALANX_DISTAL, t.LITTLE_PHALANX_TIP], e;\n          }, r.prototype.updateFromXRFrame = function(t, e, n) {\n            var i = this;\n            n === void 0 && (n = 2);\n            var o = this.xrController.inputSource.hand;\n            o && this.trackedMeshes.forEach(function(a, s) {\n              var d = o[s];\n              if (d) {\n                var p = t.getJointPose(d, e);\n                if (!p || !p.transform)\n                  return;\n                var y = p.transform.position, P = p.transform.orientation;\n                a.position.set(y.x, y.y, y.z), a.rotationQuaternion.set(P.x, P.y, P.z, P.w);\n                var R = (p.radius || 8e-3) * n;\n                a.scaling.set(R, R, R), i._handMesh && i._rigMapping && i._rigMapping[s] && (i._transformNodeMapping[s] = i._transformNodeMapping[s] || i._scene.getTransformNodeByName(i._rigMapping[s]), i._transformNodeMapping[s] && (i._transformNodeMapping[s].position.copyFrom(a.position), i._transformNodeMapping[s].rotationQuaternion.copyFrom(a.rotationQuaternion), a.isVisible = !1)), a.getScene().useRightHandedSystem || (a.position.z *= -1, a.rotationQuaternion.z *= -1, a.rotationQuaternion.w *= -1);\n              }\n            });\n          }, r.prototype.getHandPartMeshes = function(t) {\n            var e = this;\n            return this.handPartsDefinition[t].map(function(n) {\n              return e.trackedMeshes[n];\n            });\n          }, r.prototype.dispose = function() {\n            this.trackedMeshes.forEach(function(t) {\n              return t.dispose();\n            }), this._defaultHandMesh && this._handMesh && this._handMesh.dispose();\n          }, r.prototype._generateDefaultHandMesh = function() {\n            return Object(c.b)(this, void 0, void 0, function() {\n              var t, e, n, i, o, a, s, d;\n              return Object(c.e)(this, function(p) {\n                switch (p.label) {\n                  case 0:\n                    return p.trys.push([0, 3, , 4]), t = this.xrController.inputSource.handedness === \"right\" ? \"right\" : \"left\", e = (t === \"right\" ? \"r\" : \"l\") + \"_hand_\" + (this._scene.useRightHandedSystem ? \"r\" : \"l\") + \"hs.glb\", [4, Ft.ImportMeshAsync(\"\", \"https://assets.babylonjs.com/meshes/HandMeshes/\", e, this._scene)];\n                  case 1:\n                    return n = p.sent(), i = { base: I.a.FromInts(116, 63, 203), fresnel: I.a.FromInts(149, 102, 229), fingerColor: I.a.FromInts(177, 130, 255), tipFresnel: I.a.FromInts(220, 200, 255) }, [4, (o = new sa(\"leftHandShader\", this._scene, { emitComments: !1 })).loadAsync(\"https://patrickryanms.github.io/BabylonJStextures/Demos/xrHandMesh/handsShader.json\")];\n                  case 2:\n                    if (p.sent(), o.build(!1), o.needDepthPrePass = !0, o.transparencyMode = zt.a.MATERIAL_ALPHABLEND, o.alphaMode = Ue.a.ALPHA_COMBINE, (a = { base: o.getBlockByName(\"baseColor\"), fresnel: o.getBlockByName(\"fresnelColor\"), fingerColor: o.getBlockByName(\"fingerColor\"), tipFresnel: o.getBlockByName(\"tipFresnelColor\") }).base.value = i.base, a.fresnel.value = i.fresnel, a.fingerColor.value = i.fingerColor, a.tipFresnel.value = i.tipFresnel, n.meshes[1].material = o, this._defaultHandMesh = !0, this._handMesh = n.meshes[0], this._rigMapping = [\"wrist_\", \"thumb_metacarpal_\", \"thumb_proxPhalanx_\", \"thumb_distPhalanx_\", \"thumb_tip_\", \"index_metacarpal_\", \"index_proxPhalanx_\", \"index_intPhalanx_\", \"index_distPhalanx_\", \"index_tip_\", \"middle_metacarpal_\", \"middle_proxPhalanx_\", \"middle_intPhalanx_\", \"middle_distPhalanx_\", \"middle_tip_\", \"ring_metacarpal_\", \"ring_proxPhalanx_\", \"ring_intPhalanx_\", \"ring_distPhalanx_\", \"ring_tip_\", \"little_metacarpal_\", \"little_proxPhalanx_\", \"little_intPhalanx_\", \"little_distPhalanx_\", \"little_tip_\"].map(function(y) {\n                      return y + (t === \"right\" ? \"R\" : \"L\");\n                    }), !(s = this._scene.getTransformNodeByName(this._rigMapping[0])))\n                      throw new Error(\"could not find the wrist node\");\n                    return s.parent && s.parent.rotate(be.a.Y, Math.PI), [3, 4];\n                  case 3:\n                    return d = p.sent(), Xe.b.Error(\"error loading hand mesh\"), console.log(d), [3, 4];\n                  case 4:\n                    return [2];\n                }\n              });\n            });\n          }, r;\n        }(), Oa = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.options = n, i.onHandAddedObservable = new C.c(), i.onHandRemovedObservable = new C.c(), i._hands = {}, i._attachHand = function(o) {\n              var a, s, d, p, y, P, R, B, F, z;\n              if (o.inputSource.hand && !i._hands[o.uniqueId]) {\n                var J = o.inputSource.hand, ie = [], se = ((a = i.options.jointMeshes) === null || a === void 0 ? void 0 : a.sourceMesh) || Nn.a.CreateSphere(\"jointParent\", { diameter: 1 });\n                se.isVisible = !!(!((s = i.options.jointMeshes) === null || s === void 0) && s.keepOriginalVisible);\n                for (var ce = 0; ce < J.length; ++ce) {\n                  var ue = se.createInstance(o.uniqueId + \"-handJoint-\" + ce);\n                  if (!((d = i.options.jointMeshes) === null || d === void 0) && d.onHandJointMeshGenerated) {\n                    var fe = i.options.jointMeshes.onHandJointMeshGenerated(ue, ce, o.uniqueId);\n                    fe && fe !== ue && (ue.dispose(), ue = fe);\n                  }\n                  if (ue.isPickable = !1, (p = i.options.jointMeshes) === null || p === void 0 ? void 0 : p.enablePhysics) {\n                    var ve = i.options.jointMeshes.physicsProps || {}, Te = ve.impostorType !== void 0 ? ve.impostorType : At.a.SphereImpostor;\n                    ue.physicsImpostor = new At.a(ue, Te, Object(c.a)({ mass: 0 }, ve));\n                  }\n                  ue.rotationQuaternion = new u.b(), !((y = i.options.jointMeshes) === null || y === void 0) && y.invisible && (ue.isVisible = !1), ie.push(ue);\n                }\n                var Re = o.inputSource.handedness === \"right\" ? \"right\" : \"left\", Ae = ((P = i.options.jointMeshes) === null || P === void 0 ? void 0 : P.handMeshes) && ((R = i.options.jointMeshes) === null || R === void 0 ? void 0 : R.handMeshes[Re]), Ee = ((B = i.options.jointMeshes) === null || B === void 0 ? void 0 : B.rigMapping) && ((F = i.options.jointMeshes) === null || F === void 0 ? void 0 : F.rigMapping[Re]), Se = new $d(o, ie, Ae, Ee, (z = i.options.jointMeshes) === null || z === void 0 ? void 0 : z.disableDefaultHandMesh);\n                i._hands[o.uniqueId] = { handObject: Se, id: t._idCounter++ }, i.onHandAddedObservable.notifyObservers(Se);\n              }\n            }, i.xrNativeFeatureName = \"hand-tracking\", i;\n          }\n          return Object(c.d)(t, r), t.prototype.isCompatible = function() {\n            return typeof XRHand < \"u\";\n          }, t.prototype.attach = function() {\n            var e = this;\n            return !!r.prototype.attach.call(this) && (this.options.xrInput.controllers.forEach(this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable, this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable, function(n) {\n              e._detachHand(n.uniqueId);\n            }), !0);\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._hands).forEach(function(n) {\n              e._detachHand(n);\n            }), !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onHandAddedObservable.clear();\n          }, t.prototype.getHandByControllerId = function(e) {\n            var n;\n            return ((n = this._hands[e]) === null || n === void 0 ? void 0 : n.handObject) || null;\n          }, t.prototype.getHandByHandedness = function(e) {\n            var n = this, i = Object.keys(this._hands).map(function(o) {\n              return n._hands[o].handObject.xrController.inputSource.handedness;\n            }).indexOf(e);\n            return i !== -1 ? this._hands[i].handObject : null;\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            Object.keys(this._hands).forEach(function(i) {\n              var o;\n              n._hands[i].handObject.updateFromXRFrame(e, n._xrSessionManager.referenceSpace, (o = n.options.jointMeshes) === null || o === void 0 ? void 0 : o.scaleFactor);\n            });\n          }, t.prototype._detachHand = function(e) {\n            this._hands[e] && (this.onHandRemovedObservable.notifyObservers(this._hands[e].handObject), this._hands[e].handObject.dispose());\n          }, t._idCounter = 0, t.Name = ti.HAND_TRACKING, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Oa.Name, function(r, t) {\n          return function() {\n            return new Oa(r, t);\n          };\n        }, Oa.Version, !1);\n        var ef = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, Jg[\"left-right\"], n, i) || this;\n            return o._mapping = { defaultButton: { valueNodeName: \"VALUE\", unpressedNodeName: \"UNPRESSED\", pressedNodeName: \"PRESSED\" }, defaultAxis: { valueNodeName: \"VALUE\", minNodeName: \"MIN\", maxNodeName: \"MAX\" }, buttons: { \"xr-standard-trigger\": { rootNodeName: \"SELECT\", componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"] }, \"xr-standard-squeeze\": { rootNodeName: \"GRASP\", componentProperty: \"state\", states: [\"pressed\"] }, \"xr-standard-touchpad\": { rootNodeName: \"TOUCHPAD_PRESS\", labelAnchorNodeName: \"squeeze-label\", touchPointNodeName: \"TOUCH\" }, \"xr-standard-thumbstick\": { rootNodeName: \"THUMBSTICK_PRESS\", componentProperty: \"state\", states: [\"pressed\"] } }, axes: { \"xr-standard-touchpad\": { \"x-axis\": { rootNodeName: \"TOUCHPAD_TOUCH_X\" }, \"y-axis\": { rootNodeName: \"TOUCHPAD_TOUCH_Y\" } }, \"xr-standard-thumbstick\": { \"x-axis\": { rootNodeName: \"THUMBSTICK_X\" }, \"y-axis\": { rootNodeName: \"THUMBSTICK_Y\" } } } }, o.profileId = \"microsoft-mixed-reality\", o;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: this.handedness === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, path: t.MODEL_BASE_URL + \"default/\" };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            var e = Ft.IsPluginForExtensionAvailable(\".glb\");\n            return e || l.a.Warn(\"glTF / glb loaded was not registered, using generic controller instead\"), e;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this;\n            this.rootMesh && (this.getComponentIds().forEach(function(i, o) {\n              if (!n.disableAnimation && i && n.rootMesh) {\n                var a = n._mapping.buttons[i], s = a.rootNodeName;\n                if (!s)\n                  return void l.a.Log(\"Skipping unknown button at index: \" + o + \" with mapped name: \" + i);\n                var d = n._getChildByName(n.rootMesh, s);\n                if (!d)\n                  return void l.a.Warn(\"Missing button mesh with name: \" + s);\n                if (a.valueMesh = n._getImmediateChildByName(d, n._mapping.defaultButton.valueNodeName), a.pressedMesh = n._getImmediateChildByName(d, n._mapping.defaultButton.pressedNodeName), a.unpressedMesh = n._getImmediateChildByName(d, n._mapping.defaultButton.unpressedNodeName), a.valueMesh && a.pressedMesh && a.unpressedMesh) {\n                  var p = n.getComponent(i);\n                  p && p.onButtonStateChangedObservable.add(function(y) {\n                    n._lerpTransform(a, y.value);\n                  }, void 0, !0);\n                } else\n                  l.a.Warn(\"Missing button submesh under mesh with name: \" + s);\n              }\n            }), this.getComponentIds().forEach(function(i, o) {\n              var a = n.getComponent(i);\n              a.isAxes() && [\"x-axis\", \"y-axis\"].forEach(function(s) {\n                if (n.rootMesh) {\n                  var d = n._mapping.axes[i][s], p = n._getChildByName(n.rootMesh, d.rootNodeName);\n                  p ? (d.valueMesh = n._getImmediateChildByName(p, n._mapping.defaultAxis.valueNodeName), d.minMesh = n._getImmediateChildByName(p, n._mapping.defaultAxis.minNodeName), d.maxMesh = n._getImmediateChildByName(p, n._mapping.defaultAxis.maxNodeName), d.valueMesh && d.minMesh && d.maxMesh ? a && a.onAxisValueChangedObservable.add(function(y) {\n                    var P = s === \"x-axis\" ? y.x : y.y;\n                    n._lerpTransform(d, P, !0);\n                  }, void 0, !0) : l.a.Warn(\"Missing axis submesh under mesh with name: \" + d.rootNodeName)) : l.a.Warn(\"Missing axis mesh with name: \" + d.rootNodeName);\n                }\n              });\n            }));\n          }, t.prototype._setRootMesh = function(e) {\n            var n;\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), this.rootMesh.isPickable = !1;\n            for (var i = 0; i < e.length; i++) {\n              var o = e[i];\n              o.isPickable = !1, o.parent || (n = o);\n            }\n            n && n.setParent(this.rootMesh), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0));\n          }, t.prototype._updateModel = function() {\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/microsoft/\", t.MODEL_LEFT_FILENAME = \"left.glb\", t.MODEL_RIGHT_FILENAME = \"right.glb\", t;\n        }(br);\n        wn.RegisterController(\"windows-mixed-reality\", function(r, t) {\n          return new ef(t, r.gamepad, r.handedness);\n        });\n        var Jg = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: { xr_standard_trigger_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_trigger_pressed_value\", minNodeName: \"xr_standard_trigger_pressed_min\", maxNodeName: \"xr_standard_trigger_pressed_max\" } } }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: { xr_standard_squeeze_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_squeeze_pressed_value\", minNodeName: \"xr_standard_squeeze_pressed_min\", maxNodeName: \"xr_standard_squeeze_pressed_max\" } } }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: { xr_standard_touchpad_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_pressed_value\", minNodeName: \"xr_standard_touchpad_pressed_min\", maxNodeName: \"xr_standard_touchpad_pressed_max\" }, xr_standard_touchpad_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_xaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_xaxis_pressed_max\" }, xr_standard_touchpad_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_yaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_yaxis_pressed_max\" }, xr_standard_touchpad_xaxis_touched: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_touched_value\", minNodeName: \"xr_standard_touchpad_xaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_xaxis_touched_max\" }, xr_standard_touchpad_yaxis_touched: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_touched_value\", minNodeName: \"xr_standard_touchpad_yaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_yaxis_touched_max\" }, xr_standard_touchpad_axes_touched: { componentProperty: \"state\", states: [\"touched\", \"pressed\"], valueNodeProperty: \"visibility\", valueNodeName: \"xr_standard_touchpad_axes_touched_value\" } }, touchPointNodeName: \"xr_standard_touchpad_axes_touched_value\" }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: { xr_standard_thumbstick_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_pressed_value\", minNodeName: \"xr_standard_thumbstick_pressed_min\", maxNodeName: \"xr_standard_thumbstick_pressed_max\" }, xr_standard_thumbstick_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_xaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_xaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_xaxis_pressed_max\" }, xr_standard_thumbstick_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_yaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_yaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_yaxis_pressed_max\" } } } }, gamepadMapping: \"xr-standard\", rootNodeName: \"microsoft-mixed-reality-left\", assetPath: \"left.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: { xr_standard_trigger_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_trigger_pressed_value\", minNodeName: \"xr_standard_trigger_pressed_min\", maxNodeName: \"xr_standard_trigger_pressed_max\" } } }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: { xr_standard_squeeze_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_squeeze_pressed_value\", minNodeName: \"xr_standard_squeeze_pressed_min\", maxNodeName: \"xr_standard_squeeze_pressed_max\" } } }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: { xr_standard_touchpad_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_pressed_value\", minNodeName: \"xr_standard_touchpad_pressed_min\", maxNodeName: \"xr_standard_touchpad_pressed_max\" }, xr_standard_touchpad_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_xaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_xaxis_pressed_max\" }, xr_standard_touchpad_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_yaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_yaxis_pressed_max\" }, xr_standard_touchpad_xaxis_touched: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_touched_value\", minNodeName: \"xr_standard_touchpad_xaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_xaxis_touched_max\" }, xr_standard_touchpad_yaxis_touched: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_touched_value\", minNodeName: \"xr_standard_touchpad_yaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_yaxis_touched_max\" }, xr_standard_touchpad_axes_touched: { componentProperty: \"state\", states: [\"touched\", \"pressed\"], valueNodeProperty: \"visibility\", valueNodeName: \"xr_standard_touchpad_axes_touched_value\" } }, touchPointNodeName: \"xr_standard_touchpad_axes_touched_value\" }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: { xr_standard_thumbstick_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_pressed_value\", minNodeName: \"xr_standard_thumbstick_pressed_min\", maxNodeName: \"xr_standard_thumbstick_pressed_max\" }, xr_standard_thumbstick_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_xaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_xaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_xaxis_pressed_max\" }, xr_standard_thumbstick_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_yaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_yaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_yaxis_pressed_max\" } } } }, gamepadMapping: \"xr-standard\", rootNodeName: \"microsoft-mixed-reality-right\", assetPath: \"right.glb\" } }, zc = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = !1);\n            var s = r.call(this, e, $g[i], n, i) || this;\n            return s._forceLegacyControllers = a, s.profileId = \"oculus-touch\", s;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: this.handedness === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, path: this._isQuest() ? t.QUEST_MODEL_BASE_URL : t.MODEL_BASE_URL };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            return !0;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this, i = this._isQuest(), o = this.handedness === \"right\" ? -1 : 1;\n            this.getComponentIds().forEach(function(a) {\n              var s = a && n.getComponent(a);\n              s && s.onButtonStateChangedObservable.add(function(d) {\n                if (n.rootMesh && !n.disableAnimation)\n                  switch (a) {\n                    case \"xr-standard-trigger\":\n                      return void (i || (n._modelRootNode.getChildren()[3].rotation.x = 0.2 * -d.value, n._modelRootNode.getChildren()[3].position.y = 5e-3 * -d.value, n._modelRootNode.getChildren()[3].position.z = 5e-3 * -d.value));\n                    case \"xr-standard-squeeze\":\n                      return void (i || (n._modelRootNode.getChildren()[4].position.x = o * d.value * 35e-4));\n                    case \"xr-standard-thumbstick\":\n                      return;\n                    case \"a-button\":\n                    case \"x-button\":\n                      return void (i || (d.pressed ? n._modelRootNode.getChildren()[1].position.y = -1e-3 : n._modelRootNode.getChildren()[1].position.y = 0));\n                    case \"b-button\":\n                    case \"y-button\":\n                      return void (i || (d.pressed ? n._modelRootNode.getChildren()[2].position.y = -1e-3 : n._modelRootNode.getChildren()[2].position.y = 0));\n                  }\n              }, void 0, !0);\n            });\n          }, t.prototype._setRootMesh = function(e) {\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0)), e.forEach(function(n) {\n              n.isPickable = !1;\n            }), this._isQuest() ? this._modelRootNode = e[0] : (this._modelRootNode = e[1], this.rootMesh.position.y = 0.034, this.rootMesh.position.z = 0.052), this._modelRootNode.parent = this.rootMesh;\n          }, t.prototype._updateModel = function() {\n          }, t.prototype._isQuest = function() {\n            return !!navigator.userAgent.match(/Quest/gi) && !this._forceLegacyControllers;\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculus/\", t.MODEL_LEFT_FILENAME = \"left.babylon\", t.MODEL_RIGHT_FILENAME = \"right.babylon\", t.QUEST_MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculusQuest/\", t;\n        }(br);\n        wn.RegisterController(\"oculus-touch\", function(r, t) {\n          return new zc(t, r.gamepad, r.handedness);\n        }), wn.RegisterController(\"oculus-touch-legacy\", function(r, t) {\n          return new zc(t, r.gamepad, r.handedness, !0);\n        });\n        var $g = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: {} }, \"x-button\": { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"x_button\", visualResponses: {} }, \"y-button\": { type: \"button\", gamepadIndices: { button: 5 }, rootNodeName: \"y_button\", visualResponses: {} }, thumbrest: { type: \"button\", gamepadIndices: { button: 6 }, rootNodeName: \"thumbrest\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"oculus-touch-v2-left\", assetPath: \"left.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: {} }, \"a-button\": { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"a_button\", visualResponses: {} }, \"b-button\": { type: \"button\", gamepadIndices: { button: 5 }, rootNodeName: \"b_button\", visualResponses: {} }, thumbrest: { type: \"button\", gamepadIndices: { button: 6 }, rootNodeName: \"thumbrest\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"oculus-touch-v2-right\", assetPath: \"right.glb\" } }, tf = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, ev[i], n, i) || this;\n            return o.profileId = \"htc-vive\", o;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: t.MODEL_FILENAME, path: t.MODEL_BASE_URL };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            return !0;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this;\n            this.getComponentIds().forEach(function(i) {\n              var o = i && n.getComponent(i);\n              o && o.onButtonStateChangedObservable.add(function(a) {\n                if (n.rootMesh && !n.disableAnimation)\n                  switch (i) {\n                    case \"xr-standard-trigger\":\n                      return void (n._modelRootNode.getChildren()[6].rotation.x = 0.15 * -a.value);\n                    case \"xr-standard-touchpad\":\n                    case \"xr-standard-squeeze\":\n                      return;\n                  }\n              }, void 0, !0);\n            });\n          }, t.prototype._setRootMesh = function(e) {\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), e.forEach(function(n) {\n              n.isPickable = !1;\n            }), this._modelRootNode = e[1], this._modelRootNode.parent = this.rootMesh, this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0));\n          }, t.prototype._updateModel = function() {\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/vive/\", t.MODEL_FILENAME = \"wand.babylon\", t;\n        }(br);\n        wn.RegisterController(\"htc-vive\", function(r, t) {\n          return new tf(t, r.gamepad, r.handedness);\n        });\n        var ev = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: {} }, menu: { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"menu\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"htc_vive_none\", assetPath: \"none.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: {} }, menu: { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"menu\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"htc_vive_none\", assetPath: \"none.glb\" }, none: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: {} }, menu: { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"menu\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"htc-vive-none\", assetPath: \"none.glb\" } };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return h;\n        });\n        var V = f(34), _ = function() {\n          function v() {\n            this.children = [];\n          }\n          return v.prototype.isValid = function(b) {\n            return !0;\n          }, v.prototype.process = function(b, D) {\n            var w = \"\";\n            if (this.line) {\n              var N = this.line, M = D.processor;\n              M && (M.lineProcessor && (N = M.lineProcessor(N, D.isFragment)), M.attributeProcessor && V.a.StartsWith(this.line, \"attribute\") ? N = M.attributeProcessor(this.line) : M.varyingProcessor && V.a.StartsWith(this.line, \"varying\") ? N = M.varyingProcessor(this.line, D.isFragment) : (M.uniformProcessor || M.uniformBufferProcessor) && V.a.StartsWith(this.line, \"uniform\") && (/uniform (.+) (.+)/.test(this.line) ? M.uniformProcessor && (N = M.uniformProcessor(this.line, D.isFragment)) : M.uniformBufferProcessor && (N = M.uniformBufferProcessor(this.line, D.isFragment), D.lookForClosingBracketForUniformBuffer = !0)), M.endOfUniformBufferProcessor && D.lookForClosingBracketForUniformBuffer && this.line.indexOf(\"}\") !== -1 && (D.lookForClosingBracketForUniformBuffer = !1, N = M.endOfUniformBufferProcessor(this.line, D.isFragment))), w += N + `\\r\n`;\n            }\n            return this.children.forEach(function(U) {\n              w += U.process(b, D);\n            }), this.additionalDefineKey && (b[this.additionalDefineKey] = this.additionalDefineValue || \"true\"), w;\n          }, v;\n        }(), C = function() {\n          function v() {\n          }\n          return Object.defineProperty(v.prototype, \"currentLine\", { get: function() {\n            return this._lines[this.lineIndex];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"canRead\", { get: function() {\n            return this.lineIndex < this._lines.length - 1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"lines\", { set: function(b) {\n            this._lines = [];\n            for (var D = 0, w = b; D < w.length; D++) {\n              var N = w[D];\n              if (N[0] !== \"#\")\n                for (var M = N.split(\";\"), U = 0; U < M.length; U++) {\n                  var X = M[U];\n                  (X = X.trim()) && this._lines.push(X + (U !== M.length - 1 ? \";\" : \"\"));\n                }\n              else\n                this._lines.push(N);\n            }\n          }, enumerable: !1, configurable: !0 }), v;\n        }(), u = f(1), I = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.process = function(D, w) {\n            for (var N = 0; N < this.children.length; N++) {\n              var M = this.children[N];\n              if (M.isValid(D))\n                return M.process(D, w);\n            }\n            return \"\";\n          }, b;\n        }(_), O = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.isValid = function(D) {\n            return this.testExpression.isTrue(D);\n          }, b;\n        }(_), x = function() {\n          function v() {\n          }\n          return v.prototype.isTrue = function(b) {\n            return !0;\n          }, v.postfixToInfix = function(b) {\n            for (var D = [], w = 0, N = b; w < N.length; w++) {\n              var M = N[w];\n              if (v._OperatorPriority[M] === void 0)\n                D.push(M);\n              else {\n                var U = D[D.length - 1], X = D[D.length - 2];\n                D.length -= 2, D.push(\"(\" + X + M + U + \")\");\n              }\n            }\n            return D[D.length - 1];\n          }, v.infixToPostfix = function(b) {\n            for (var D = [], w = -1, N = function() {\n              (ne = ne.trim()) !== \"\" && (D.push(ne), ne = \"\");\n            }, M = function(pe) {\n              w < v._Stack.length - 1 && (v._Stack[++w] = pe);\n            }, U = function() {\n              return v._Stack[w];\n            }, X = function() {\n              return w === -1 ? \"!!INVALID EXPRESSION!!\" : v._Stack[w--];\n            }, j = 0, ne = \"\"; j < b.length; ) {\n              var te = b.charAt(j), de = j < b.length - 1 ? b.substr(j, 2) : \"\";\n              if (te === \"(\")\n                ne = \"\", M(te);\n              else if (te === \")\") {\n                for (N(); w !== -1 && U() !== \"(\"; )\n                  D.push(X());\n                X();\n              } else if (v._OperatorPriority[de] > 1) {\n                for (N(); w !== -1 && v._OperatorPriority[U()] >= v._OperatorPriority[de]; )\n                  D.push(X());\n                M(de), j++;\n              } else\n                ne += te;\n              j++;\n            }\n            for (N(); w !== -1; )\n              U() === \"(\" ? X() : D.push(X());\n            return D;\n          }, v._OperatorPriority = { \")\": 0, \"(\": 1, \"||\": 2, \"&&\": 3 }, v._Stack = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"], v;\n        }(), m = function(v) {\n          function b(D, w) {\n            w === void 0 && (w = !1);\n            var N = v.call(this) || this;\n            return N.define = D, N.not = w, N;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            var w = D[this.define] !== void 0;\n            return this.not && (w = !w), w;\n          }, b;\n        }(x), c = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            return this.leftOperand.isTrue(D) || this.rightOperand.isTrue(D);\n          }, b;\n        }(x), T = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            return this.leftOperand.isTrue(D) && this.rightOperand.isTrue(D);\n          }, b;\n        }(x), S = function(v) {\n          function b(D, w, N) {\n            var M = v.call(this) || this;\n            return M.define = D, M.operand = w, M.testValue = N, M;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            var w = D[this.define];\n            w === void 0 && (w = this.define);\n            var N = !1, M = parseInt(w), U = parseInt(this.testValue);\n            switch (this.operand) {\n              case \">\":\n                N = M > U;\n                break;\n              case \"<\":\n                N = M < U;\n                break;\n              case \"<=\":\n                N = M <= U;\n                break;\n              case \">=\":\n                N = M >= U;\n                break;\n              case \"==\":\n                N = M === U;\n            }\n            return N;\n          }, b;\n        }(x), E = f(21), g = /defined\\s*?\\((.+?)\\)/g, l = /defined\\s*?\\[(.+?)\\]/g, h = function() {\n          function v() {\n          }\n          return v.Process = function(b, D, w, N) {\n            var M = this;\n            this._ProcessIncludes(b, D, function(U) {\n              var X = M._ProcessShaderConversion(U, D, N);\n              w(X);\n            });\n          }, v._ProcessPrecision = function(b, D) {\n            var w = D.shouldUseHighPrecisionShader;\n            return b.indexOf(\"precision highp float\") === -1 ? b = w ? `precision highp float;\n` + b : `precision mediump float;\n` + b : w || (b = b.replace(\"precision highp float\", \"precision mediump float\")), b;\n          }, v._ExtractOperation = function(b) {\n            var D = /defined\\((.+)\\)/.exec(b);\n            if (D && D.length)\n              return new m(D[1].trim(), b[0] === \"!\");\n            for (var w = \"\", N = 0, M = 0, U = [\"==\", \">=\", \"<=\", \"<\", \">\"]; M < U.length && (w = U[M], !((N = b.indexOf(w)) > -1)); M++)\n              ;\n            if (N === -1)\n              return new m(b);\n            var X = b.substring(0, N).trim(), j = b.substring(N + w.length).trim();\n            return new S(X, w, j);\n          }, v._BuildSubExpression = function(b) {\n            b = b.replace(g, \"defined[$1]\");\n            for (var D = [], w = 0, N = x.infixToPostfix(b); w < N.length; w++) {\n              var M = N[w];\n              if (M !== \"||\" && M !== \"&&\")\n                D.push(M);\n              else if (D.length >= 2) {\n                var U = D[D.length - 1], X = D[D.length - 2];\n                D.length -= 2;\n                var j = M == \"&&\" ? new T() : new c();\n                typeof U == \"string\" && (U = U.replace(l, \"defined($1)\")), typeof X == \"string\" && (X = X.replace(l, \"defined($1)\")), j.leftOperand = typeof X == \"string\" ? this._ExtractOperation(X) : X, j.rightOperand = typeof U == \"string\" ? this._ExtractOperation(U) : U, D.push(j);\n              }\n            }\n            var ne = D[D.length - 1];\n            return typeof ne == \"string\" && (ne = ne.replace(l, \"defined($1)\")), typeof ne == \"string\" ? this._ExtractOperation(ne) : ne;\n          }, v._BuildExpression = function(b, D) {\n            var w = new O(), N = b.substring(0, D), M = b.substring(D);\n            return M = M.substring(0, (M.indexOf(\"//\") + 1 || M.length + 1) - 1).trim(), w.testExpression = N === \"#ifdef\" ? new m(M) : N === \"#ifndef\" ? new m(M, !0) : this._BuildSubExpression(M), w;\n          }, v._MoveCursorWithinIf = function(b, D, w) {\n            for (var N = b.currentLine; this._MoveCursor(b, w); ) {\n              var M = (N = b.currentLine).substring(0, 5).toLowerCase();\n              if (M === \"#else\") {\n                var U = new _();\n                return D.children.push(U), void this._MoveCursor(b, U);\n              }\n              if (M === \"#elif\") {\n                var X = this._BuildExpression(N, 5);\n                D.children.push(X), w = X;\n              }\n            }\n          }, v._MoveCursor = function(b, D) {\n            for (; b.canRead; ) {\n              b.lineIndex++;\n              var w = b.currentLine, N = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(w);\n              if (N && N.length)\n                switch (N[0]) {\n                  case \"#ifdef\":\n                    var M = new I();\n                    D.children.push(M);\n                    var U = this._BuildExpression(w, 6);\n                    M.children.push(U), this._MoveCursorWithinIf(b, M, U);\n                    break;\n                  case \"#else\":\n                  case \"#elif\":\n                    return !0;\n                  case \"#endif\":\n                    return !1;\n                  case \"#ifndef\":\n                    M = new I(), D.children.push(M), U = this._BuildExpression(w, 7), M.children.push(U), this._MoveCursorWithinIf(b, M, U);\n                    break;\n                  case \"#if\":\n                    M = new I(), U = this._BuildExpression(w, 3), D.children.push(M), M.children.push(U), this._MoveCursorWithinIf(b, M, U);\n                }\n              else {\n                var X = new _();\n                if (X.line = w, D.children.push(X), w[0] === \"#\" && w[1] === \"d\") {\n                  var j = w.replace(\";\", \"\").split(\" \");\n                  X.additionalDefineKey = j[1], j.length === 3 && (X.additionalDefineValue = j[2]);\n                }\n              }\n            }\n            return !1;\n          }, v._EvaluatePreProcessors = function(b, D, w) {\n            var N = new _(), M = new C();\n            return M.lineIndex = -1, M.lines = b.split(`\n`), this._MoveCursor(M, N), N.process(D, w);\n          }, v._PreparePreProcessors = function(b) {\n            for (var D = {}, w = 0, N = b.defines; w < N.length; w++) {\n              var M = N[w].replace(\"#define\", \"\").replace(\";\", \"\").trim().split(\" \");\n              D[M[0]] = M.length > 1 ? M[1] : \"\";\n            }\n            return D.GL_ES = \"true\", D.__VERSION__ = b.version, D[b.platformName] = \"true\", D;\n          }, v._ProcessShaderConversion = function(b, D, w) {\n            var N = this._ProcessPrecision(b, D);\n            if (!D.processor)\n              return N;\n            if (N.indexOf(\"#version 3\") !== -1)\n              return N.replace(\"#version 300 es\", \"\");\n            var M = D.defines, U = this._PreparePreProcessors(D);\n            return D.processor.preProcessor && (N = D.processor.preProcessor(N, M, D.isFragment)), N = this._EvaluatePreProcessors(N, U, D), D.processor.postProcessor && (N = D.processor.postProcessor(N, M, D.isFragment, w)), N;\n          }, v._ProcessIncludes = function(b, D, w) {\n            for (var N = this, M = /#include<(.+)>(\\((.*)\\))*(\\[(.*)\\])*/g, U = M.exec(b), X = new String(b), j = !1; U != null; ) {\n              var ne = U[1];\n              if (ne.indexOf(\"__decl__\") !== -1 && (ne = ne.replace(/__decl__/, \"\"), D.supportsUniformBuffers && (ne = (ne = ne.replace(/Vertex/, \"Ubo\")).replace(/Fragment/, \"Ubo\")), ne += \"Declaration\"), !D.includesShadersStore[ne]) {\n                var te = D.shadersRepository + \"ShadersInclude/\" + ne + \".fx\";\n                return void v._FileToolsLoadFile(te, function(Y) {\n                  D.includesShadersStore[ne] = Y, N._ProcessIncludes(X, D, w);\n                });\n              }\n              var de = D.includesShadersStore[ne];\n              if (U[2])\n                for (var pe = U[3].split(\",\"), ae = 0; ae < pe.length; ae += 2) {\n                  var ee = new RegExp(pe[ae], \"g\"), K = pe[ae + 1];\n                  de = de.replace(ee, K);\n                }\n              if (U[4]) {\n                var $ = U[5];\n                if ($.indexOf(\"..\") !== -1) {\n                  var L = $.split(\"..\"), G = parseInt(L[0]), Q = parseInt(L[1]), oe = de.slice(0);\n                  de = \"\", isNaN(Q) && (Q = D.indexParameters[L[1]]);\n                  for (var re = G; re < Q; re++)\n                    D.supportsUniformBuffers || (oe = oe.replace(/light\\{X\\}.(\\w*)/g, function(Y, k) {\n                      return k + \"{X}\";\n                    })), de += oe.replace(/\\{X\\}/g, re.toString()) + `\n`;\n                } else\n                  D.supportsUniformBuffers || (de = de.replace(/light\\{X\\}.(\\w*)/g, function(Y, k) {\n                    return k + \"{X}\";\n                  })), de = de.replace(/\\{X\\}/g, $);\n              }\n              X = X.replace(U[0], de), j = j || de.indexOf(\"#include<\") >= 0, U = M.exec(b);\n            }\n            j ? this._ProcessIncludes(X.toString(), D, w) : w(X);\n          }, v._FileToolsLoadFile = function(b, D, w, N, M, U) {\n            throw E.a.WarnImport(\"FileTools\");\n          }, v;\n        }();\n      }, function(Be, A, f) {\n        f(26).a.prototype._readTexturePixels = function(V, _, C, u, I, O) {\n          u === void 0 && (u = -1), I === void 0 && (I = 0), O === void 0 && (O = null);\n          var x = this._gl;\n          if (!x)\n            throw new Error(\"Engine does not have gl rendering context.\");\n          if (!this._dummyFramebuffer) {\n            var m = x.createFramebuffer();\n            if (!m)\n              throw new Error(\"Unable to create dummy framebuffer\");\n            this._dummyFramebuffer = m;\n          }\n          x.bindFramebuffer(x.FRAMEBUFFER, this._dummyFramebuffer), u > -1 ? x.framebufferTexture2D(x.FRAMEBUFFER, x.COLOR_ATTACHMENT0, x.TEXTURE_CUBE_MAP_POSITIVE_X + u, V._webGLTexture, I) : x.framebufferTexture2D(x.FRAMEBUFFER, x.COLOR_ATTACHMENT0, x.TEXTURE_2D, V._webGLTexture, I);\n          var c = V.type !== void 0 ? this._getWebGLTextureType(V.type) : x.UNSIGNED_BYTE;\n          switch (c) {\n            case x.UNSIGNED_BYTE:\n              O || (O = new Uint8Array(4 * _ * C)), c = x.UNSIGNED_BYTE;\n              break;\n            default:\n              O || (O = new Float32Array(4 * _ * C)), c = x.FLOAT;\n          }\n          return x.readPixels(0, 0, _, C, x.RGBA, c, O), x.bindFramebuffer(x.FRAMEBUFFER, this._currentFramebuffer), O;\n        };\n      }, function(Be, A, f) {\n        var V = \"shadowsFragmentFunctions\", _ = `#ifdef SHADOWS\n#ifndef SHADOWFLOAT\n\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\n#define inline\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;\n}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);\n}\n#define inline\nfloat computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn esm;\n}\n#define inline\nfloat computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn esm;\n}\n#ifdef WEBGL2\n#define inline\nfloat computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nvec3 uvLayer=vec3(uv.x,uv.y,layer);\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uvLayer));\n#else\nfloat shadow=texture2D(shadowSampler,uvLayer).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadow=texture2D(shadowSampler,uv).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\n#ifndef SHADOWFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[1]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[2]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[3]*mapSize))<shadowPixelDepth) visibility-=0.25;\n#else\nif (texture2D(shadowSampler,uv+poissonDisk[0]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[1]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[2]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[3]*mapSize).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#ifdef WEBGL2\n#define GREATEST_LESS_THAN_ONE 0.99999994\n\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat shadow=texture(shadowSampler,uvDepthLayer);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat shadow=texture2D(shadowSampler,uvDepth);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.)\n);\nconst vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n\n\n\n\n\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);\nvec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec4 offset=vec4(poissonSamplers[i],0.);\n\noffset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);\nshadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n\n\n#define inline\nfloat computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);\nfloat filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec3 offset=poissonSamplers[i];\n\noffset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);\nshadow+=texture2D(shadowSampler,uvDepth+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,depthMetric-avgBlockerDepth);\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n}\n#define inline\nfloat computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);\n}\n#define inline\nfloat computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#endif\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"reflectionFunction\", _ = `vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {\n\nvec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;\nvec3 halfSize=cubeSize*0.5;\nvec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;\nvec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;\n\nvec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);\n\nfloat distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);\n\nvec3 intersectPositionWS=vertexPos+origVec*distance;\n\nreturn intersectPositionWS-cubePos;\n}\nvec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(1.0-s,t,0);\n}\nvec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);\nvec3 r=normalize(reflect(cameraToVertex,worldNormal));\nr=vec3(reflectionMatrix*vec4(r,0));\nfloat lon=atan(r.z,r.x);\nfloat lat=acos(r.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr=vec3(reflectionMatrix*vec4(r,0));\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n}\nvec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=worldPos.xyz-eyePosition;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n}\nvec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*(view*worldPos));\n}\nvec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*vec4(positionW,1.));\n}\n#ifdef REFLECTION\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(vPositionUVW,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"bumpFragmentMainFunctions\", _ = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#endif\nvec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)\n{\n#ifdef NORMALXYSCALE\nnormal=normalize(normal*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*normal);\n}\nvec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)\n{\nreturn perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)\n{\n\nuv=gl_FrontFacing ? uv : -uv;\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;\n\ntangent*=tangentSpaceParams.x;\nbitangent*=tangentSpaceParams.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(bitangent,bitangent)));\nreturn mat3(tangent*invmax,bitangent*invmax,normal);\n}\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"bumpFragmentFunctions\", _ = `#if defined(BUMP)\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nreturn perturbNormal(cotangentFrame,texture2D(bumpSampler,uv).xyz,vBumpInfos.y);\n}\n#endif\n#if defined(DETAIL)\n#if DETAILDIRECTUV == 1\n#define vDetailUV vMainUV1\n#elif DETAILDIRECTUV == 2\n#define vDetailUV vMainUV2\n#else\nvarying vec2 vDetailUV;\n#endif\nuniform sampler2D detailSampler;\n#endif\n#if defined(BUMP)\nvec3 perturbNormal(mat3 cotangentFrame,vec3 color)\n{\nreturn perturbNormal(cotangentFrame,color,vBumpInfos.y);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\nreturn cotangent_frame(normal,p,uv,vTangentSpaceParams);\n}\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; i<iMaxSamples; i++)\n{\ncurrSampledHeight=texture2D(bumpSampler,vBumpUV+vCurrOffset).w;\n\nif (currSampledHeight>currRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#elif defined(BUMP)\nfloat normalScale=vBumpInfos.y;\n#else\nfloat normalScale=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#elif defined(BUMP)\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vDetailUV,vec2(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW,vPositionW,vMainUV1,vec2(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);\nvec2 detailNormalRG=detailColor.wy*2.0-1.0;\nfloat detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));\nvec3 detailNormal=vec3(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz*2.0-1.0);\nnormalW=normalize(mat3(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#else\nvec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n\n#if DETAIL_NORMALBLENDMETHOD == 0\ndetailNormal.xy*=vDetailInfos.z;\nvec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD == 1\ndetailNormal.xy*=vDetailInfos.z;\nbumpNormal+=vec3(0.0,0.0,1.0);\ndetailNormal*=vec3(-1.0,-1.0,1.0);\nvec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;\nnormalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif`;\n        f(5).a.IncludesShadersStore.bumpFragment = V;\n      }, function(Be, A, f) {\n        var V = \"lightFragment\", _ = `#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n\n#else\n#ifdef PBR\n\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#endif\npreInfo.NdotV=NdotV;\n\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\npreInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\npreInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\n#elif defined(SS_TRANSLUCENCY)\ninfo.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef SPECULARTERM\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#endif\n\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\n\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef CLEARCOAT\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);\n#ifdef CLEARCOAT_TINT\n\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);\ninfo.diffuse*=absorption;\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\n\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)\n{\n#ifdef SHADOWCSM_RIGHTHANDED{X}\ndiff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;\n#else\ndiff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;\n#endif\nif (diff{X}>=0.) {\nindex{X}=i;\nbreak;\n}\n}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nfloat frustumLength=frustumLengths{X}[index{X}];\nfloat diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};\nif (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{\nindex{X}+=1;\nfloat nextShadow=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif`;\n        f(5).a.IncludesShadersStore.fogFragment = V;\n      }, function(Be, A, f) {\n        var V = \"fogVertexDeclaration\", _ = `#ifdef FOG\nvarying vec3 vFogDistance;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"shadowsVertex\", _ = `#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {\nvPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\nvDepthMetric{X}[i]=((vPositionFromLight{X}[i].z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\nvDepthMetric{X}=((vPositionFromLight{X}.z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.Eval = function(C, u) {\n            return (C = C.match(/\\([^\\(\\)]*\\)/g) ? C.replace(/\\([^\\(\\)]*\\)/g, function(I) {\n              return I = I.slice(1, I.length - 1), _._HandleParenthesisContent(I, u);\n            }) : _._HandleParenthesisContent(C, u)) === \"true\" || C !== \"false\" && _.Eval(C, u);\n          }, _._HandleParenthesisContent = function(C, u) {\n            var I;\n            u = u || function(E) {\n              return E === \"true\";\n            };\n            var O = C.split(\"||\");\n            for (var x in O)\n              if (O.hasOwnProperty(x)) {\n                var m = _._SimplifyNegation(O[x].trim()), c = m.split(\"&&\");\n                if (c.length > 1)\n                  for (var T = 0; T < c.length; ++T) {\n                    var S = _._SimplifyNegation(c[T].trim());\n                    if (!(I = S !== \"true\" && S !== \"false\" ? S[0] === \"!\" ? !u(S.substring(1)) : u(S) : S === \"true\")) {\n                      m = \"false\";\n                      break;\n                    }\n                  }\n                if (I || m === \"true\") {\n                  I = !0;\n                  break;\n                }\n                I = m !== \"true\" && m !== \"false\" ? m[0] === \"!\" ? !u(m.substring(1)) : u(m) : m === \"true\";\n              }\n            return I ? \"true\" : \"false\";\n          }, _._SimplifyNegation = function(C) {\n            return (C = (C = C.replace(/^[\\s!]+/, function(u) {\n              return (u = u.replace(/[\\s]/g, function() {\n                return \"\";\n              })).length % 2 ? \"!\" : \"\";\n            })).trim()) === \"!true\" ? C = \"false\" : C === \"!false\" && (C = \"true\"), C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.ExponentialBackoff = function(C, u) {\n            return C === void 0 && (C = 3), u === void 0 && (u = 500), function(I, O, x) {\n              return O.status !== 0 || x >= C || I.indexOf(\"file:\") !== -1 ? -1 : Math.pow(2, x) * u;\n            };\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._isDepthTestDirty = !1, this._isDepthMaskDirty = !1, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1, this.reset();\n          }\n          return Object.defineProperty(_.prototype, \"isDirty\", { get: function() {\n            return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"zOffset\", { get: function() {\n            return this._zOffset;\n          }, set: function(C) {\n            this._zOffset !== C && (this._zOffset = C, this._isZOffsetDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"cullFace\", { get: function() {\n            return this._cullFace;\n          }, set: function(C) {\n            this._cullFace !== C && (this._cullFace = C, this._isCullFaceDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"cull\", { get: function() {\n            return this._cull;\n          }, set: function(C) {\n            this._cull !== C && (this._cull = C, this._isCullDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"depthFunc\", { get: function() {\n            return this._depthFunc;\n          }, set: function(C) {\n            this._depthFunc !== C && (this._depthFunc = C, this._isDepthFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"depthMask\", { get: function() {\n            return this._depthMask;\n          }, set: function(C) {\n            this._depthMask !== C && (this._depthMask = C, this._isDepthMaskDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"depthTest\", { get: function() {\n            return this._depthTest;\n          }, set: function(C) {\n            this._depthTest !== C && (this._depthTest = C, this._isDepthTestDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"frontFace\", { get: function() {\n            return this._frontFace;\n          }, set: function(C) {\n            this._frontFace !== C && (this._frontFace = C, this._isFrontFaceDirty = !0);\n          }, enumerable: !1, configurable: !0 }), _.prototype.reset = function() {\n            this._depthMask = !0, this._depthTest = !0, this._depthFunc = null, this._cullFace = null, this._cull = null, this._zOffset = 0, this._frontFace = null, this._isDepthTestDirty = !0, this._isDepthMaskDirty = !0, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1;\n          }, _.prototype.apply = function(C) {\n            this.isDirty && (this._isCullDirty && (this.cull ? C.enable(C.CULL_FACE) : C.disable(C.CULL_FACE), this._isCullDirty = !1), this._isCullFaceDirty && (C.cullFace(this.cullFace), this._isCullFaceDirty = !1), this._isDepthMaskDirty && (C.depthMask(this.depthMask), this._isDepthMaskDirty = !1), this._isDepthTestDirty && (this.depthTest ? C.enable(C.DEPTH_TEST) : C.disable(C.DEPTH_TEST), this._isDepthTestDirty = !1), this._isDepthFuncDirty && (C.depthFunc(this.depthFunc), this._isDepthFuncDirty = !1), this._isZOffsetDirty && (this.zOffset ? (C.enable(C.POLYGON_OFFSET_FILL), C.polygonOffset(this.zOffset, 0)) : C.disable(C.POLYGON_OFFSET_FILL), this._isZOffsetDirty = !1), this._isFrontFaceDirty && (C.frontFace(this.frontFace), this._isFrontFaceDirty = !1));\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(2), _ = function() {\n          function C() {\n            this._isStencilTestDirty = !1, this._isStencilMaskDirty = !1, this._isStencilFuncDirty = !1, this._isStencilOpDirty = !1, this.reset();\n          }\n          return Object.defineProperty(C.prototype, \"isDirty\", { get: function() {\n            return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilFunc\", { get: function() {\n            return this._stencilFunc;\n          }, set: function(u) {\n            this._stencilFunc !== u && (this._stencilFunc = u, this._isStencilFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilFuncRef\", { get: function() {\n            return this._stencilFuncRef;\n          }, set: function(u) {\n            this._stencilFuncRef !== u && (this._stencilFuncRef = u, this._isStencilFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilFuncMask\", { get: function() {\n            return this._stencilFuncMask;\n          }, set: function(u) {\n            this._stencilFuncMask !== u && (this._stencilFuncMask = u, this._isStencilFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilOpStencilFail\", { get: function() {\n            return this._stencilOpStencilFail;\n          }, set: function(u) {\n            this._stencilOpStencilFail !== u && (this._stencilOpStencilFail = u, this._isStencilOpDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilOpDepthFail\", { get: function() {\n            return this._stencilOpDepthFail;\n          }, set: function(u) {\n            this._stencilOpDepthFail !== u && (this._stencilOpDepthFail = u, this._isStencilOpDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilOpStencilDepthPass\", { get: function() {\n            return this._stencilOpStencilDepthPass;\n          }, set: function(u) {\n            this._stencilOpStencilDepthPass !== u && (this._stencilOpStencilDepthPass = u, this._isStencilOpDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilMask\", { get: function() {\n            return this._stencilMask;\n          }, set: function(u) {\n            this._stencilMask !== u && (this._stencilMask = u, this._isStencilMaskDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilTest\", { get: function() {\n            return this._stencilTest;\n          }, set: function(u) {\n            this._stencilTest !== u && (this._stencilTest = u, this._isStencilTestDirty = !0);\n          }, enumerable: !1, configurable: !0 }), C.prototype.reset = function() {\n            this._stencilTest = !1, this._stencilMask = 255, this._stencilFunc = C.ALWAYS, this._stencilFuncRef = 1, this._stencilFuncMask = 255, this._stencilOpStencilFail = C.KEEP, this._stencilOpDepthFail = C.KEEP, this._stencilOpStencilDepthPass = C.REPLACE, this._isStencilTestDirty = !0, this._isStencilMaskDirty = !0, this._isStencilFuncDirty = !0, this._isStencilOpDirty = !0;\n          }, C.prototype.apply = function(u) {\n            this.isDirty && (this._isStencilTestDirty && (this.stencilTest ? u.enable(u.STENCIL_TEST) : u.disable(u.STENCIL_TEST), this._isStencilTestDirty = !1), this._isStencilMaskDirty && (u.stencilMask(this.stencilMask), this._isStencilMaskDirty = !1), this._isStencilFuncDirty && (u.stencilFunc(this.stencilFunc, this.stencilFuncRef, this.stencilFuncMask), this._isStencilFuncDirty = !1), this._isStencilOpDirty && (u.stencilOp(this.stencilOpStencilFail, this.stencilOpDepthFail, this.stencilOpStencilDepthPass), this._isStencilOpDirty = !1));\n          }, C.ALWAYS = V.a.ALWAYS, C.KEEP = V.a.KEEP, C.REPLACE = V.a.REPLACE, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._isAlphaBlendDirty = !1, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1, this._alphaBlend = !1, this._blendFunctionParameters = new Array(4), this._blendEquationParameters = new Array(2), this._blendConstants = new Array(4), this.reset();\n          }\n          return Object.defineProperty(_.prototype, \"isDirty\", { get: function() {\n            return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"alphaBlend\", { get: function() {\n            return this._alphaBlend;\n          }, set: function(C) {\n            this._alphaBlend !== C && (this._alphaBlend = C, this._isAlphaBlendDirty = !0);\n          }, enumerable: !1, configurable: !0 }), _.prototype.setAlphaBlendConstants = function(C, u, I, O) {\n            this._blendConstants[0] === C && this._blendConstants[1] === u && this._blendConstants[2] === I && this._blendConstants[3] === O || (this._blendConstants[0] = C, this._blendConstants[1] = u, this._blendConstants[2] = I, this._blendConstants[3] = O, this._isBlendConstantsDirty = !0);\n          }, _.prototype.setAlphaBlendFunctionParameters = function(C, u, I, O) {\n            this._blendFunctionParameters[0] === C && this._blendFunctionParameters[1] === u && this._blendFunctionParameters[2] === I && this._blendFunctionParameters[3] === O || (this._blendFunctionParameters[0] = C, this._blendFunctionParameters[1] = u, this._blendFunctionParameters[2] = I, this._blendFunctionParameters[3] = O, this._isBlendFunctionParametersDirty = !0);\n          }, _.prototype.setAlphaEquationParameters = function(C, u) {\n            this._blendEquationParameters[0] === C && this._blendEquationParameters[1] === u || (this._blendEquationParameters[0] = C, this._blendEquationParameters[1] = u, this._isBlendEquationParametersDirty = !0);\n          }, _.prototype.reset = function() {\n            this._alphaBlend = !1, this._blendFunctionParameters[0] = null, this._blendFunctionParameters[1] = null, this._blendFunctionParameters[2] = null, this._blendFunctionParameters[3] = null, this._blendEquationParameters[0] = null, this._blendEquationParameters[1] = null, this._blendConstants[0] = null, this._blendConstants[1] = null, this._blendConstants[2] = null, this._blendConstants[3] = null, this._isAlphaBlendDirty = !0, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1;\n          }, _.prototype.apply = function(C) {\n            this.isDirty && (this._isAlphaBlendDirty && (this._alphaBlend ? C.enable(C.BLEND) : C.disable(C.BLEND), this._isAlphaBlendDirty = !1), this._isBlendFunctionParametersDirty && (C.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]), this._isBlendFunctionParametersDirty = !1), this._isBlendEquationParametersDirty && (C.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]), this._isBlendEquationParametersDirty = !1), this._isBlendConstantsDirty && (C.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]), this._isBlendConstantsDirty = !1));\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this.vertexCompilationError = null, this.fragmentCompilationError = null, this.programLinkError = null, this.programValidationError = null;\n          }\n          return Object.defineProperty(_.prototype, \"isAsync\", { get: function() {\n            return this.isParallelCompiled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"isReady\", { get: function() {\n            return !!this.program && (!this.isParallelCompiled || this.engine._isRenderingStateCompiled(this));\n          }, enumerable: !1, configurable: !0 }), _.prototype._handlesSpectorRebuildCallback = function(C) {\n            C && this.program && C(this.program);\n          }, _.prototype._getVertexShaderCode = function() {\n            return this.vertexShader ? this.engine._getShaderSource(this.vertexShader) : null;\n          }, _.prototype._getFragmentShaderCode = function() {\n            return this.fragmentShader ? this.engine._getShaderSource(this.fragmentShader) : null;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        var V;\n        f.d(A, \"a\", function() {\n          return u;\n        }), function(I) {\n          I[I.Pending = 0] = \"Pending\", I[I.Fulfilled = 1] = \"Fulfilled\", I[I.Rejected = 2] = \"Rejected\";\n        }(V || (V = {}));\n        var _ = function() {\n          this.count = 0, this.target = 0, this.results = [];\n        }, C = function() {\n          function I(O) {\n            var x = this;\n            if (this._state = V.Pending, this._children = new Array(), this._rejectWasConsumed = !1, O)\n              try {\n                O(function(m) {\n                  x._resolve(m);\n                }, function(m) {\n                  x._reject(m);\n                });\n              } catch (m) {\n                this._reject(m);\n              }\n          }\n          return Object.defineProperty(I.prototype, \"_result\", { get: function() {\n            return this._resultValue;\n          }, set: function(O) {\n            this._resultValue = O, this._parent && this._parent._result === void 0 && (this._parent._result = O);\n          }, enumerable: !1, configurable: !0 }), I.prototype.catch = function(O) {\n            return this.then(void 0, O);\n          }, I.prototype.then = function(O, x) {\n            var m = this, c = new I();\n            return c._onFulfilled = O, c._onRejected = x, this._children.push(c), c._parent = this, this._state !== V.Pending && setTimeout(function() {\n              if (m._state === V.Fulfilled || m._rejectWasConsumed) {\n                var T = c._resolve(m._result);\n                if (T != null)\n                  if (T._state !== void 0) {\n                    var S = T;\n                    c._children.push(S), S._parent = c, c = S;\n                  } else\n                    c._result = T;\n              } else\n                c._reject(m._reason);\n            }), c;\n          }, I.prototype._moveChildren = function(O) {\n            var x, m = this;\n            if ((x = this._children).push.apply(x, O.splice(0, O.length)), this._children.forEach(function(g) {\n              g._parent = m;\n            }), this._state === V.Fulfilled)\n              for (var c = 0, T = this._children; c < T.length; c++)\n                T[c]._resolve(this._result);\n            else if (this._state === V.Rejected)\n              for (var S = 0, E = this._children; S < E.length; S++)\n                E[S]._reject(this._reason);\n          }, I.prototype._resolve = function(O) {\n            try {\n              this._state = V.Fulfilled;\n              var x = null;\n              if (this._onFulfilled && (x = this._onFulfilled(O)), x != null)\n                if (x._state !== void 0) {\n                  var m = x;\n                  m._parent = this, m._moveChildren(this._children), O = m._result;\n                } else\n                  O = x;\n              this._result = O;\n              for (var c = 0, T = this._children; c < T.length; c++)\n                T[c]._resolve(O);\n              this._children.length = 0, delete this._onFulfilled, delete this._onRejected;\n            } catch (S) {\n              this._reject(S, !0);\n            }\n          }, I.prototype._reject = function(O, x) {\n            if (x === void 0 && (x = !1), this._state = V.Rejected, this._reason = O, this._onRejected && !x)\n              try {\n                this._onRejected(O), this._rejectWasConsumed = !0;\n              } catch (S) {\n                O = S;\n              }\n            for (var m = 0, c = this._children; m < c.length; m++) {\n              var T = c[m];\n              this._rejectWasConsumed ? T._resolve(null) : T._reject(O);\n            }\n            this._children.length = 0, delete this._onFulfilled, delete this._onRejected;\n          }, I.resolve = function(O) {\n            var x = new I();\n            return x._resolve(O), x;\n          }, I._RegisterForFulfillment = function(O, x, m) {\n            O.then(function(c) {\n              return x.results[m] = c, x.count++, x.count === x.target && x.rootPromise._resolve(x.results), null;\n            }, function(c) {\n              x.rootPromise._state !== V.Rejected && x.rootPromise._reject(c);\n            });\n          }, I.all = function(O) {\n            var x = new I(), m = new _();\n            if (m.target = O.length, m.rootPromise = x, O.length)\n              for (var c = 0; c < O.length; c++)\n                I._RegisterForFulfillment(O[c], m, c);\n            else\n              x._resolve([]);\n            return x;\n          }, I.race = function(O) {\n            var x = new I();\n            if (O.length)\n              for (var m = 0, c = O; m < c.length; m++)\n                c[m].then(function(T) {\n                  return x && (x._resolve(T), x = null), null;\n                }, function(T) {\n                  x && (x._reject(T), x = null);\n                });\n            return x;\n          }, I;\n        }(), u = function() {\n          function I() {\n          }\n          return I.Apply = function(O) {\n            O === void 0 && (O = !1), (O || typeof Promise > \"u\") && (window.Promise = C);\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(57), _ = function() {\n          function u(I) {\n            I === void 0 && (I = 30), this._enabled = !0, this._rollingFrameTime = new C(I);\n          }\n          return u.prototype.sampleFrame = function(I) {\n            if (I === void 0 && (I = V.a.Now), this._enabled) {\n              if (this._lastFrameTimeMs != null) {\n                var O = I - this._lastFrameTimeMs;\n                this._rollingFrameTime.add(O);\n              }\n              this._lastFrameTimeMs = I;\n            }\n          }, Object.defineProperty(u.prototype, \"averageFrameTime\", { get: function() {\n            return this._rollingFrameTime.average;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"averageFrameTimeVariance\", { get: function() {\n            return this._rollingFrameTime.variance;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"instantaneousFrameTime\", { get: function() {\n            return this._rollingFrameTime.history(0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"averageFPS\", { get: function() {\n            return 1e3 / this._rollingFrameTime.average;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"instantaneousFPS\", { get: function() {\n            var I = this._rollingFrameTime.history(0);\n            return I === 0 ? 0 : 1e3 / I;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"isSaturated\", { get: function() {\n            return this._rollingFrameTime.isSaturated();\n          }, enumerable: !1, configurable: !0 }), u.prototype.enable = function() {\n            this._enabled = !0;\n          }, u.prototype.disable = function() {\n            this._enabled = !1, this._lastFrameTimeMs = null;\n          }, Object.defineProperty(u.prototype, \"isEnabled\", { get: function() {\n            return this._enabled;\n          }, enumerable: !1, configurable: !0 }), u.prototype.reset = function() {\n            this._lastFrameTimeMs = null, this._rollingFrameTime.reset();\n          }, u;\n        }(), C = function() {\n          function u(I) {\n            this._samples = new Array(I), this.reset();\n          }\n          return u.prototype.add = function(I) {\n            var O;\n            if (this.isSaturated()) {\n              var x = this._samples[this._pos];\n              O = x - this.average, this.average -= O / (this._sampleCount - 1), this._m2 -= O * (x - this.average);\n            } else\n              this._sampleCount++;\n            O = I - this.average, this.average += O / this._sampleCount, this._m2 += O * (I - this.average), this.variance = this._m2 / (this._sampleCount - 1), this._samples[this._pos] = I, this._pos++, this._pos %= this._samples.length;\n          }, u.prototype.history = function(I) {\n            if (I >= this._sampleCount || I >= this._samples.length)\n              return 0;\n            var O = this._wrapPosition(this._pos - 1);\n            return this._samples[this._wrapPosition(O - I)];\n          }, u.prototype.isSaturated = function() {\n            return this._sampleCount >= this._samples.length;\n          }, u.prototype.reset = function() {\n            this.average = 0, this.variance = 0, this._sampleCount = 0, this._pos = 0, this._m2 = 0;\n          }, u.prototype._wrapPosition = function(I) {\n            var O = this._samples.length;\n            return (I % O + O) % O;\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(0), _ = function() {\n          this._checkCollisions = !1, this._collisionMask = -1, this._collisionGroup = -1, this._surroundingMeshes = null, this._collider = null, this._oldPositionForCollisions = new V.e(0, 0, 0), this._diffPositionForCollisions = new V.e(0, 0, 0), this._collisionResponse = !0;\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(33), _ = f(0), C = f(2), u = function() {\n          function I(O, x, m, c, T) {\n            m === void 0 && (m = null), c === void 0 && (c = null), T === void 0 && (T = null), this.index = O, this._opaqueSubMeshes = new V.a(256), this._transparentSubMeshes = new V.a(256), this._alphaTestSubMeshes = new V.a(256), this._depthOnlySubMeshes = new V.a(256), this._particleSystems = new V.a(256), this._spriteManagers = new V.a(256), this._edgesRenderers = new V.b(16), this._scene = x, this.opaqueSortCompareFn = m, this.alphaTestSortCompareFn = c, this.transparentSortCompareFn = T;\n          }\n          return Object.defineProperty(I.prototype, \"opaqueSortCompareFn\", { set: function(O) {\n            this._opaqueSortCompareFn = O, this._renderOpaque = O ? this.renderOpaqueSorted : I.renderUnsorted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"alphaTestSortCompareFn\", { set: function(O) {\n            this._alphaTestSortCompareFn = O, this._renderAlphaTest = O ? this.renderAlphaTestSorted : I.renderUnsorted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"transparentSortCompareFn\", { set: function(O) {\n            this._transparentSortCompareFn = O || I.defaultTransparentSortCompare, this._renderTransparent = this.renderTransparentSorted;\n          }, enumerable: !1, configurable: !0 }), I.prototype.render = function(O, x, m, c) {\n            if (O)\n              O(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes);\n            else {\n              var T = this._scene.getEngine();\n              this._depthOnlySubMeshes.length !== 0 && (T.setColorWrite(!1), this._renderAlphaTest(this._depthOnlySubMeshes), T.setColorWrite(!0)), this._opaqueSubMeshes.length !== 0 && this._renderOpaque(this._opaqueSubMeshes), this._alphaTestSubMeshes.length !== 0 && this._renderAlphaTest(this._alphaTestSubMeshes);\n              var S = T.getStencilBuffer();\n              if (T.setStencilBuffer(!1), x && this._renderSprites(), m && this._renderParticles(c), this.onBeforeTransparentRendering && this.onBeforeTransparentRendering(), this._transparentSubMeshes.length !== 0 && (T.setStencilBuffer(S), this._renderTransparent(this._transparentSubMeshes), T.setAlphaMode(C.a.ALPHA_DISABLE)), T.setStencilBuffer(!1), this._edgesRenderers.length) {\n                for (var E = 0; E < this._edgesRenderers.length; E++)\n                  this._edgesRenderers.data[E].render();\n                T.setAlphaMode(C.a.ALPHA_DISABLE);\n              }\n              T.setStencilBuffer(S);\n            }\n          }, I.prototype.renderOpaqueSorted = function(O) {\n            return I.renderSorted(O, this._opaqueSortCompareFn, this._scene.activeCamera, !1);\n          }, I.prototype.renderAlphaTestSorted = function(O) {\n            return I.renderSorted(O, this._alphaTestSortCompareFn, this._scene.activeCamera, !1);\n          }, I.prototype.renderTransparentSorted = function(O) {\n            return I.renderSorted(O, this._transparentSortCompareFn, this._scene.activeCamera, !0);\n          }, I.renderSorted = function(O, x, m, c) {\n            for (var T, S = 0, E = m ? m.globalPosition : I._zeroVector; S < O.length; S++)\n              (T = O.data[S])._alphaIndex = T.getMesh().alphaIndex, T._distanceToCamera = _.e.Distance(T.getBoundingInfo().boundingSphere.centerWorld, E);\n            var g = O.data.slice(0, O.length);\n            for (x && g.sort(x), S = 0; S < g.length; S++) {\n              if (T = g[S], c) {\n                var l = T.getMaterial();\n                if (l && l.needDepthPrePass) {\n                  var h = l.getScene().getEngine();\n                  h.setColorWrite(!1), h.setAlphaMode(C.a.ALPHA_DISABLE), T.render(!1), h.setColorWrite(!0);\n                }\n              }\n              T.render(c);\n            }\n          }, I.renderUnsorted = function(O) {\n            for (var x = 0; x < O.length; x++)\n              O.data[x].render(!1);\n          }, I.defaultTransparentSortCompare = function(O, x) {\n            return O._alphaIndex > x._alphaIndex ? 1 : O._alphaIndex < x._alphaIndex ? -1 : I.backToFrontSortCompare(O, x);\n          }, I.backToFrontSortCompare = function(O, x) {\n            return O._distanceToCamera < x._distanceToCamera ? 1 : O._distanceToCamera > x._distanceToCamera ? -1 : 0;\n          }, I.frontToBackSortCompare = function(O, x) {\n            return O._distanceToCamera < x._distanceToCamera ? -1 : O._distanceToCamera > x._distanceToCamera ? 1 : 0;\n          }, I.prototype.prepare = function() {\n            this._opaqueSubMeshes.reset(), this._transparentSubMeshes.reset(), this._alphaTestSubMeshes.reset(), this._depthOnlySubMeshes.reset(), this._particleSystems.reset(), this._spriteManagers.reset(), this._edgesRenderers.reset();\n          }, I.prototype.dispose = function() {\n            this._opaqueSubMeshes.dispose(), this._transparentSubMeshes.dispose(), this._alphaTestSubMeshes.dispose(), this._depthOnlySubMeshes.dispose(), this._particleSystems.dispose(), this._spriteManagers.dispose(), this._edgesRenderers.dispose();\n          }, I.prototype.dispatch = function(O, x, m) {\n            x === void 0 && (x = O.getMesh()), m === void 0 && (m = O.getMaterial()), m != null && (m.needAlphaBlendingForMesh(x) ? this._transparentSubMeshes.push(O) : m.needAlphaTesting() ? (m.needDepthPrePass && this._depthOnlySubMeshes.push(O), this._alphaTestSubMeshes.push(O)) : (m.needDepthPrePass && this._depthOnlySubMeshes.push(O), this._opaqueSubMeshes.push(O)), x._renderingGroup = this, x._edgesRenderer && x._edgesRenderer.isEnabled && this._edgesRenderers.pushNoDuplicate(x._edgesRenderer));\n          }, I.prototype.dispatchSprites = function(O) {\n            this._spriteManagers.push(O);\n          }, I.prototype.dispatchParticles = function(O) {\n            this._particleSystems.push(O);\n          }, I.prototype._renderParticles = function(O) {\n            if (this._particleSystems.length !== 0) {\n              var x = this._scene.activeCamera;\n              this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);\n              for (var m = 0; m < this._particleSystems.length; m++) {\n                var c = this._particleSystems.data[m];\n                if ((x && x.layerMask & c.layerMask) !== 0) {\n                  var T = c.emitter;\n                  T.position && O && O.indexOf(T) === -1 || this._scene._activeParticles.addCount(c.render(), !1);\n                }\n              }\n              this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene);\n            }\n          }, I.prototype._renderSprites = function() {\n            if (this._scene.spritesEnabled && this._spriteManagers.length !== 0) {\n              var O = this._scene.activeCamera;\n              this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);\n              for (var x = 0; x < this._spriteManagers.length; x++) {\n                var m = this._spriteManagers.data[x];\n                (O && O.layerMask & m.layerMask) !== 0 && m.render();\n              }\n              this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene);\n            }\n          }, I._zeroVector = _.e.Zero(), I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function(_, C) {\n          this.distance = _, this.mesh = C;\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.GenerateBase64StringFromTexture = function(C, u, I) {\n            u === void 0 && (u = 0), I === void 0 && (I = 0);\n            var O = C.getInternalTexture();\n            if (!O)\n              return null;\n            var x = C.readPixels(u, I);\n            if (!x)\n              return null;\n            var m = C.getSize(), c = m.width, T = m.height;\n            if (x instanceof Float32Array) {\n              for (var S = x.byteLength / x.BYTES_PER_ELEMENT, E = new Uint8Array(S); --S >= 0; ) {\n                var g = x[S];\n                g < 0 ? g = 0 : g > 1 && (g = 1), E[S] = 255 * g;\n              }\n              x = E;\n            }\n            var l = document.createElement(\"canvas\");\n            l.width = c, l.height = T;\n            var h = l.getContext(\"2d\");\n            if (!h)\n              return null;\n            var v = h.createImageData(c, T);\n            if (v.data.set(x), h.putImageData(v, 0, 0), O.invertY) {\n              var b = document.createElement(\"canvas\");\n              b.width = c, b.height = T;\n              var D = b.getContext(\"2d\");\n              return D ? (D.translate(0, T), D.scale(1, -1), D.drawImage(l, 0, 0), b.toDataURL(\"image/png\")) : null;\n            }\n            return l.toDataURL(\"image/png\");\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return S;\n        });\n        var V = f(1), _ = f(0), C = f(8), u = f(31), I = f(7), O = f(41), x = f(46), m = f(4), c = f(43), T = f(12);\n        I.a._instancedMeshFactory = function(E, g) {\n          var l = new S(E, g);\n          if (g.instancedBuffers)\n            for (var h in l.instancedBuffers = {}, g.instancedBuffers)\n              l.instancedBuffers[h] = g.instancedBuffers[h];\n          return l;\n        };\n        var S = function(E) {\n          function g(l, h) {\n            var v = E.call(this, l, h.getScene()) || this;\n            v._indexInSourceMeshInstanceArray = -1, h.addInstance(v), v._sourceMesh = h, v._unIndexed = h._unIndexed, v.position.copyFrom(h.position), v.rotation.copyFrom(h.rotation), v.scaling.copyFrom(h.scaling), h.rotationQuaternion && (v.rotationQuaternion = h.rotationQuaternion.clone()), v.animations = T.b.Slice(h.animations);\n            for (var b = 0, D = h.getAnimationRanges(); b < D.length; b++) {\n              var w = D[b];\n              w != null && v.createAnimationRange(w.name, w.from, w.to);\n            }\n            return v.infiniteDistance = h.infiniteDistance, v.setPivotMatrix(h.getPivotMatrix()), v.refreshBoundingInfo(), v._syncSubMeshes(), v;\n          }\n          return Object(V.d)(g, E), g.prototype.getClassName = function() {\n            return \"InstancedMesh\";\n          }, Object.defineProperty(g.prototype, \"lightSources\", { get: function() {\n            return this._sourceMesh._lightSources;\n          }, enumerable: !1, configurable: !0 }), g.prototype._resyncLightSources = function() {\n          }, g.prototype._resyncLightSource = function(l) {\n          }, g.prototype._removeLightSource = function(l, h) {\n          }, Object.defineProperty(g.prototype, \"receiveShadows\", { get: function() {\n            return this._sourceMesh.receiveShadows;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"material\", { get: function() {\n            return this._sourceMesh.material;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"visibility\", { get: function() {\n            return this._sourceMesh.visibility;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"skeleton\", { get: function() {\n            return this._sourceMesh.skeleton;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"renderingGroupId\", { get: function() {\n            return this._sourceMesh.renderingGroupId;\n          }, set: function(l) {\n            this._sourceMesh && l !== this._sourceMesh.renderingGroupId && C.a.Warn(\"Note - setting renderingGroupId of an instanced mesh has no effect on the scene\");\n          }, enumerable: !1, configurable: !0 }), g.prototype.getTotalVertices = function() {\n            return this._sourceMesh ? this._sourceMesh.getTotalVertices() : 0;\n          }, g.prototype.getTotalIndices = function() {\n            return this._sourceMesh.getTotalIndices();\n          }, Object.defineProperty(g.prototype, \"sourceMesh\", { get: function() {\n            return this._sourceMesh;\n          }, enumerable: !1, configurable: !0 }), g.prototype.createInstance = function(l) {\n            return this._sourceMesh.createInstance(l);\n          }, g.prototype.isReady = function(l) {\n            return l === void 0 && (l = !1), this._sourceMesh.isReady(l, !0);\n          }, g.prototype.getVerticesData = function(l, h) {\n            return this._sourceMesh.getVerticesData(l, h);\n          }, g.prototype.setVerticesData = function(l, h, v, b) {\n            return this.sourceMesh && this.sourceMesh.setVerticesData(l, h, v, b), this.sourceMesh;\n          }, g.prototype.updateVerticesData = function(l, h, v, b) {\n            return this.sourceMesh && this.sourceMesh.updateVerticesData(l, h, v, b), this.sourceMesh;\n          }, g.prototype.setIndices = function(l, h) {\n            return h === void 0 && (h = null), this.sourceMesh && this.sourceMesh.setIndices(l, h), this.sourceMesh;\n          }, g.prototype.isVerticesDataPresent = function(l) {\n            return this._sourceMesh.isVerticesDataPresent(l);\n          }, g.prototype.getIndices = function() {\n            return this._sourceMesh.getIndices();\n          }, Object.defineProperty(g.prototype, \"_positions\", { get: function() {\n            return this._sourceMesh._positions;\n          }, enumerable: !1, configurable: !0 }), g.prototype.refreshBoundingInfo = function(l) {\n            if (l === void 0 && (l = !1), this._boundingInfo && this._boundingInfo.isLocked)\n              return this;\n            var h = this._sourceMesh.geometry ? this._sourceMesh.geometry.boundingBias : null;\n            return this._refreshBoundingInfo(this._sourceMesh._getPositionData(l), h), this;\n          }, g.prototype._preActivate = function() {\n            return this._currentLOD && this._currentLOD._preActivate(), this;\n          }, g.prototype._activate = function(l, h) {\n            if (this._sourceMesh.subMeshes || C.a.Warn(\"Instances should only be created for meshes with geometry.\"), this._currentLOD) {\n              if (this._currentLOD._getWorldMatrixDeterminant() > 0 != this._getWorldMatrixDeterminant() > 0)\n                return this._internalAbstractMeshDataInfo._actAsRegularMesh = !0, !0;\n              if (this._internalAbstractMeshDataInfo._actAsRegularMesh = !1, this._currentLOD._registerInstanceForRenderId(this, l), h) {\n                if (!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)\n                  return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !0, !0;\n              } else if (!this._currentLOD._internalAbstractMeshDataInfo._isActive)\n                return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances = !0, !0;\n            }\n            return !1;\n          }, g.prototype._postActivate = function() {\n            this._sourceMesh.edgesShareWithInstances && this._sourceMesh._edgesRenderer && this._sourceMesh._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup ? (this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer), this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())) : this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup && this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);\n          }, g.prototype.getWorldMatrix = function() {\n            if (this._currentLOD && this._currentLOD.billboardMode !== x.a.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {\n              var l = this._currentLOD._masterMesh;\n              return this._currentLOD._masterMesh = this, _.c.Vector3[7].copyFrom(this._currentLOD.position), this._currentLOD.position.set(0, 0, 0), _.c.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(!0)), this._currentLOD.position.copyFrom(_.c.Vector3[7]), this._currentLOD._masterMesh = l, _.c.Matrix[0];\n            }\n            return E.prototype.getWorldMatrix.call(this);\n          }, Object.defineProperty(g.prototype, \"isAnInstance\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype.getLOD = function(l) {\n            if (!l)\n              return this;\n            var h = this.getBoundingInfo();\n            return this._currentLOD = this.sourceMesh.getLOD(l, h.boundingSphere), this._currentLOD === this.sourceMesh ? this.sourceMesh : this._currentLOD;\n          }, g.prototype._preActivateForIntermediateRendering = function(l) {\n            return this.sourceMesh._preActivateForIntermediateRendering(l);\n          }, g.prototype._syncSubMeshes = function() {\n            if (this.releaseSubMeshes(), this._sourceMesh.subMeshes)\n              for (var l = 0; l < this._sourceMesh.subMeshes.length; l++)\n                this._sourceMesh.subMeshes[l].clone(this, this._sourceMesh);\n            return this;\n          }, g.prototype._generatePointsArray = function() {\n            return this._sourceMesh._generatePointsArray();\n          }, g.prototype._updateBoundingInfo = function() {\n            return this._boundingInfo ? this._boundingInfo.update(this.worldMatrixFromCache) : this._boundingInfo = new c.a(this.absolutePosition, this.absolutePosition, this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this;\n          }, g.prototype.clone = function(l, h, v) {\n            h === void 0 && (h = null);\n            var b = this._sourceMesh.createInstance(l);\n            if (O.a.DeepCopy(this, b, [\"name\", \"subMeshes\", \"uniqueId\", \"parent\", \"lightSources\", \"receiveShadows\", \"material\", \"visibility\", \"skeleton\", \"sourceMesh\", \"isAnInstance\", \"facetNb\", \"isFacetDataEnabled\", \"isBlocked\", \"useBones\", \"hasInstances\", \"collider\", \"edgesRenderer\", \"forward\", \"up\", \"right\", \"absolutePosition\", \"absoluteScaling\", \"absoluteRotationQuaternion\", \"isWorldMatrixFrozen\", \"nonUniformScaling\", \"behaviors\", \"worldMatrixFromCache\", \"hasThinInstances\"], []), this.refreshBoundingInfo(), h && (b.parent = h), !v)\n              for (var D = 0; D < this.getScene().meshes.length; D++) {\n                var w = this.getScene().meshes[D];\n                w.parent === this && w.clone(w.name, b);\n              }\n            return b.computeWorldMatrix(!0), b;\n          }, g.prototype.dispose = function(l, h) {\n            h === void 0 && (h = !1), this._sourceMesh.removeInstance(this), E.prototype.dispose.call(this, l, h);\n          }, g;\n        }(u.a);\n        I.a.prototype.edgesShareWithInstances = !1, I.a.prototype.registerInstancedBuffer = function(E, g) {\n          if (this.removeVerticesData(E), !this.instancedBuffers) {\n            this.instancedBuffers = {};\n            for (var l = 0, h = this.instances; l < h.length; l++)\n              h[l].instancedBuffers = {};\n            this._userInstancedBuffersStorage = { data: {}, vertexBuffers: {}, strides: {}, sizes: {} };\n          }\n          this.instancedBuffers[E] = null, this._userInstancedBuffersStorage.strides[E] = g, this._userInstancedBuffersStorage.sizes[E] = 32 * g, this._userInstancedBuffersStorage.data[E] = new Float32Array(this._userInstancedBuffersStorage.sizes[E]), this._userInstancedBuffersStorage.vertexBuffers[E] = new m.b(this.getEngine(), this._userInstancedBuffersStorage.data[E], E, !0, !1, g, !0), this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[E]);\n          for (var v = 0, b = this.instances; v < b.length; v++)\n            b[v].instancedBuffers[E] = null;\n        }, I.a.prototype._processInstancedBuffers = function(E, g) {\n          var l = E.length;\n          for (var h in this.instancedBuffers) {\n            for (var v = this._userInstancedBuffersStorage.sizes[h], b = this._userInstancedBuffersStorage.strides[h], D = (l + 1) * b; v < D; )\n              v *= 2;\n            this._userInstancedBuffersStorage.data[h].length != v && (this._userInstancedBuffersStorage.data[h] = new Float32Array(v), this._userInstancedBuffersStorage.sizes[h] = v, this._userInstancedBuffersStorage.vertexBuffers[h] && (this._userInstancedBuffersStorage.vertexBuffers[h].dispose(), this._userInstancedBuffersStorage.vertexBuffers[h] = null));\n            var w = this._userInstancedBuffersStorage.data[h], N = 0;\n            g && ((U = this.instancedBuffers[h]).toArray ? U.toArray(w, N) : U.copyToArray(w, N), N += b);\n            for (var M = 0; M < l; M++) {\n              var U;\n              (U = E[M].instancedBuffers[h]).toArray ? U.toArray(w, N) : U.copyToArray(w, N), N += b;\n            }\n            this._userInstancedBuffersStorage.vertexBuffers[h] ? this._userInstancedBuffersStorage.vertexBuffers[h].updateDirectly(w, 0) : (this._userInstancedBuffersStorage.vertexBuffers[h] = new m.b(this.getEngine(), this._userInstancedBuffersStorage.data[h], h, !0, !1, b, !0), this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[h]));\n          }\n        }, I.a.prototype._disposeInstanceSpecificData = function() {\n          for (this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null); this.instances.length; )\n            this.instances[0].dispose();\n          for (var E in this.instancedBuffers)\n            this._userInstancedBuffersStorage.vertexBuffers[E] && this._userInstancedBuffersStorage.vertexBuffers[E].dispose();\n          this.instancedBuffers = {};\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return Object.defineProperty(_, \"UniqueId\", { get: function() {\n            var C = this._UniqueIdCounter;\n            return this._UniqueIdCounter++, C;\n          }, enumerable: !1, configurable: !0 }), _._UniqueIdCounter = 0, _;\n        }();\n      }, function(Be, A, f) {\n        var V = f(26), _ = f(88);\n        V.a.prototype.createUniformBuffer = function(C) {\n          var u = this._gl.createBuffer();\n          if (!u)\n            throw new Error(\"Unable to create uniform buffer\");\n          var I = new _.a(u);\n          return this.bindUniformBuffer(I), C instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, C, this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(C), this._gl.STATIC_DRAW), this.bindUniformBuffer(null), I.references = 1, I;\n        }, V.a.prototype.createDynamicUniformBuffer = function(C) {\n          var u = this._gl.createBuffer();\n          if (!u)\n            throw new Error(\"Unable to create dynamic uniform buffer\");\n          var I = new _.a(u);\n          return this.bindUniformBuffer(I), C instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, C, this._gl.DYNAMIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(C), this._gl.DYNAMIC_DRAW), this.bindUniformBuffer(null), I.references = 1, I;\n        }, V.a.prototype.updateUniformBuffer = function(C, u, I, O) {\n          this.bindUniformBuffer(C), I === void 0 && (I = 0), O === void 0 ? u instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, I, u) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, I, new Float32Array(u)) : u instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, u.subarray(I, I + O)) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(u).subarray(I, I + O)), this.bindUniformBuffer(null);\n        }, V.a.prototype.bindUniformBuffer = function(C) {\n          this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, C ? C.underlyingResource : null);\n        }, V.a.prototype.bindUniformBufferBase = function(C, u) {\n          this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, u, C ? C.underlyingResource : null);\n        }, V.a.prototype.bindUniformBlock = function(C, u, I) {\n          var O = C.program, x = this._gl.getUniformBlockIndex(O, u);\n          this._gl.uniformBlockBinding(O, x, I);\n        };\n      }, function(Be, A, f) {\n        var V = \"lightsFragmentFunctions\", _ = `\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"logDepthFragment\", _ = `#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);\nvec3 tbnTangent=normalize(tangentUpdated.xyz);\nvec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;\nvTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore.bumpVertex = V;\n      }, function(Be, A, f) {\n        var V = `#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif`;\n        f(5).a.IncludesShadersStore.fogVertex = V;\n      }, function(Be, A, f) {\n        var V = \"logDepthVertex\", _ = `#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A) {\n        var f;\n        f = /* @__PURE__ */ function() {\n          return this;\n        }();\n        try {\n          f = f || new Function(\"return this\")();\n        } catch {\n          typeof window == \"object\" && (f = window);\n        }\n        Be.exports = f;\n      }, function(Be, A, f) {\n        var V = \"prePassDeclaration\", _ = `#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\n#ifdef WEBGL2\nlayout(location=0) out highp vec4 glFragData[{X}];\nhighp vec4 gl_FragColor;\n#endif\n#ifdef PREPASS_DEPTHNORMAL\nvarying highp vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nvarying highp vec4 vCurrentPosition;\nvarying highp vec4 vPreviousPosition;\n#endif\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"fresnelFunction\", _ = `#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif`;\n        f(5).a.IncludesShadersStore.depthPrePass = V;\n      }, function(Be, A, f) {\n        var V = \"prePassVertexDeclaration\", _ = `#ifdef PREPASS\n#ifdef PREPASS_DEPTHNORMAL\nvarying vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"bumpVertexDeclaration\", _ = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"prePassVertex\", _ = `#ifdef PREPASS_DEPTHNORMAL\nvViewPos=(view*worldPos).rgb;\n#endif\n#if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = f(5), _ = (f(115), f(110), \"colorPixelShader\"), C = `#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\n#ifdef VERTEXCOLOR\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n}`;\n        V.a.ShadersStore[_] = C;\n      }, function(Be, A, f) {\n        var V = f(5), _ = (f(78), f(117), f(79), f(80), f(81), f(111), \"colorVertexShader\"), C = `\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<clipPlaneVertexDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include<clipPlaneVertex>\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}`;\n        V.a.ShadersStore[_] = C;\n      }, function(Be, A, f) {\n        (function(V) {\n          f.d(A, \"b\", function() {\n            return T;\n          }), f.d(A, \"a\", function() {\n            return S;\n          });\n          var _ = f(1), C = f(8), u = f(13), I = f(102), O = f(27), x = f(2), m = f(89), c = f(74), T = function() {\n            this.renderWidth = 512, this.renderHeight = 256, this.textureSize = 512, this.deterministicLockstep = !1, this.lockstepMaxSteps = 4;\n          }, S = function(E) {\n            function g(l) {\n              l === void 0 && (l = new T());\n              var h = E.call(this, null) || this;\n              u.a.Instances.push(h), l.deterministicLockstep === void 0 && (l.deterministicLockstep = !1), l.lockstepMaxSteps === void 0 && (l.lockstepMaxSteps = 4), h._options = l, c.a.SetMatrixPrecision(!!l.useHighPrecisionMatrix), h._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: 512, maxCubemapTextureSize: 512, maxRenderTextureSize: 512, maxVertexAttribs: 16, maxVaryingVectors: 16, maxFragmentUniformVectors: 16, maxVertexUniformVectors: 16, standardDerivatives: !1, astc: null, pvrtc: null, etc1: null, etc2: null, bptc: null, maxAnisotropy: 0, uintIndices: !1, fragmentDepthSupported: !1, highPrecisionShaderSupported: !0, colorBufferFloat: !1, textureFloat: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloat: !1, textureHalfFloatLinearFiltering: !1, textureHalfFloatRender: !1, textureLOD: !1, drawBuffersExtension: !1, depthTextureExtension: !1, vertexArrayObject: !1, instancedArrays: !1, canUseTimestampForTimerQuery: !1, maxMSAASamples: 1, blendMinMax: !1 }, C.a.Log(\"Babylon.js v\" + u.a.Version + \" - Null engine\");\n              var v = typeof self < \"u\" ? self : V !== void 0 ? V : window;\n              return typeof URL > \"u\" && (v.URL = { createObjectURL: function() {\n              }, revokeObjectURL: function() {\n              } }), typeof Blob > \"u\" && (v.Blob = function() {\n              }), h;\n            }\n            return Object(_.d)(g, E), g.prototype.isDeterministicLockStep = function() {\n              return this._options.deterministicLockstep;\n            }, g.prototype.getLockstepMaxSteps = function() {\n              return this._options.lockstepMaxSteps;\n            }, g.prototype.getHardwareScalingLevel = function() {\n              return 1;\n            }, g.prototype.createVertexBuffer = function(l) {\n              var h = new m.a();\n              return h.references = 1, h;\n            }, g.prototype.createIndexBuffer = function(l) {\n              var h = new m.a();\n              return h.references = 1, h;\n            }, g.prototype.clear = function(l, h, v, b) {\n            }, g.prototype.getRenderWidth = function(l) {\n              return l === void 0 && (l = !1), !l && this._currentRenderTarget ? this._currentRenderTarget.width : this._options.renderWidth;\n            }, g.prototype.getRenderHeight = function(l) {\n              return l === void 0 && (l = !1), !l && this._currentRenderTarget ? this._currentRenderTarget.height : this._options.renderHeight;\n            }, g.prototype.setViewport = function(l, h, v) {\n              this._cachedViewport = l;\n            }, g.prototype.createShaderProgram = function(l, h, v, b, D) {\n              return { __SPECTOR_rebuildProgram: null };\n            }, g.prototype.getUniforms = function(l, h) {\n              return [];\n            }, g.prototype.getAttributes = function(l, h) {\n              return [];\n            }, g.prototype.bindSamplers = function(l) {\n              this._currentEffect = null;\n            }, g.prototype.enableEffect = function(l) {\n              this._currentEffect = l, l.onBind && l.onBind(l), l._onBindObservable && l._onBindObservable.notifyObservers(l);\n            }, g.prototype.setState = function(l, h, v, b) {\n            }, g.prototype.setIntArray = function(l, h) {\n              return !0;\n            }, g.prototype.setIntArray2 = function(l, h) {\n              return !0;\n            }, g.prototype.setIntArray3 = function(l, h) {\n              return !0;\n            }, g.prototype.setIntArray4 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray2 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray3 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray4 = function(l, h) {\n              return !0;\n            }, g.prototype.setArray = function(l, h) {\n              return !0;\n            }, g.prototype.setArray2 = function(l, h) {\n              return !0;\n            }, g.prototype.setArray3 = function(l, h) {\n              return !0;\n            }, g.prototype.setArray4 = function(l, h) {\n              return !0;\n            }, g.prototype.setMatrices = function(l, h) {\n              return !0;\n            }, g.prototype.setMatrix3x3 = function(l, h) {\n              return !0;\n            }, g.prototype.setMatrix2x2 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloat = function(l, h) {\n              return !0;\n            }, g.prototype.setFloat2 = function(l, h, v) {\n              return !0;\n            }, g.prototype.setFloat3 = function(l, h, v, b) {\n              return !0;\n            }, g.prototype.setBool = function(l, h) {\n              return !0;\n            }, g.prototype.setFloat4 = function(l, h, v, b, D) {\n              return !0;\n            }, g.prototype.setAlphaMode = function(l, h) {\n              h === void 0 && (h = !1), this._alphaMode !== l && (this.alphaState.alphaBlend = l !== x.a.ALPHA_DISABLE, h || this.setDepthWrite(l === x.a.ALPHA_DISABLE), this._alphaMode = l);\n            }, g.prototype.bindBuffers = function(l, h, v) {\n            }, g.prototype.wipeCaches = function(l) {\n              this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, l && (this._currentProgram = null, this.stencilState.reset(), this.depthCullingState.reset(), this.alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);\n            }, g.prototype.draw = function(l, h, v, b) {\n            }, g.prototype.drawElementsType = function(l, h, v, b) {\n            }, g.prototype.drawArraysType = function(l, h, v, b) {\n            }, g.prototype._createTexture = function() {\n              return {};\n            }, g.prototype._releaseTexture = function(l) {\n            }, g.prototype.createTexture = function(l, h, v, b, D, w, N, M, U, X, j, ne) {\n              D === void 0 && (D = x.a.TEXTURE_TRILINEAR_SAMPLINGMODE), w === void 0 && (w = null), X === void 0 && (X = null);\n              var te = new O.a(this, O.b.Url), de = String(l);\n              return te.url = de, te.generateMipMaps = !h, te.samplingMode = D, te.invertY = v, te.baseWidth = this._options.textureSize, te.baseHeight = this._options.textureSize, te.width = this._options.textureSize, te.height = this._options.textureSize, X && (te.format = X), te.isReady = !0, w && w(), this._internalTexturesCache.push(te), te;\n            }, g.prototype.createRenderTargetTexture = function(l, h) {\n              var v = new I.a();\n              h !== void 0 && typeof h == \"object\" ? (v.generateMipMaps = h.generateMipMaps, v.generateDepthBuffer = h.generateDepthBuffer === void 0 || h.generateDepthBuffer, v.generateStencilBuffer = v.generateDepthBuffer && h.generateStencilBuffer, v.type = h.type === void 0 ? x.a.TEXTURETYPE_UNSIGNED_INT : h.type, v.samplingMode = h.samplingMode === void 0 ? x.a.TEXTURE_TRILINEAR_SAMPLINGMODE : h.samplingMode) : (v.generateMipMaps = h, v.generateDepthBuffer = !0, v.generateStencilBuffer = !1, v.type = x.a.TEXTURETYPE_UNSIGNED_INT, v.samplingMode = x.a.TEXTURE_TRILINEAR_SAMPLINGMODE);\n              var b = new O.a(this, O.b.RenderTarget), D = l.width || l, w = l.height || l;\n              return b._depthStencilBuffer = {}, b._framebuffer = {}, b.baseWidth = D, b.baseHeight = w, b.width = D, b.height = w, b.isReady = !0, b.samples = 1, b.generateMipMaps = !!v.generateMipMaps, b.samplingMode = v.samplingMode, b.type = v.type, b._generateDepthBuffer = v.generateDepthBuffer, b._generateStencilBuffer = !!v.generateStencilBuffer, this._internalTexturesCache.push(b), b;\n            }, g.prototype.updateTextureSamplingMode = function(l, h) {\n              h.samplingMode = l;\n            }, g.prototype.bindFramebuffer = function(l, h, v, b, D) {\n              this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = l, this._currentFramebuffer = l._MSAAFramebuffer ? l._MSAAFramebuffer : l._framebuffer, this._cachedViewport && !D && this.setViewport(this._cachedViewport, v, b);\n            }, g.prototype.unBindFramebuffer = function(l, h, v) {\n              this._currentRenderTarget = null, v && (l._MSAAFramebuffer && (this._currentFramebuffer = l._framebuffer), v()), this._currentFramebuffer = null;\n            }, g.prototype.createDynamicVertexBuffer = function(l) {\n              var h = new m.a();\n              return h.references = 1, h.capacity = 1, h;\n            }, g.prototype.updateDynamicTexture = function(l, h, v, b, D) {\n            }, g.prototype.areAllEffectsReady = function() {\n              return !0;\n            }, g.prototype.getError = function() {\n              return 0;\n            }, g.prototype._getUnpackAlignement = function() {\n              return 1;\n            }, g.prototype._unpackFlipY = function(l) {\n            }, g.prototype.updateDynamicIndexBuffer = function(l, h, v) {\n            }, g.prototype.updateDynamicVertexBuffer = function(l, h, v, b) {\n            }, g.prototype._bindTextureDirectly = function(l, h) {\n              return this._boundTexturesCache[this._activeChannel] !== h && (this._boundTexturesCache[this._activeChannel] = h, !0);\n            }, g.prototype._bindTexture = function(l, h) {\n              l < 0 || this._bindTextureDirectly(0, h);\n            }, g.prototype._deleteBuffer = function(l) {\n            }, g.prototype.releaseEffects = function() {\n            }, g.prototype.displayLoadingUI = function() {\n            }, g.prototype.hideLoadingUI = function() {\n            }, g.prototype._uploadCompressedDataToTextureDirectly = function(l, h, v, b, D, w, N) {\n            }, g.prototype._uploadDataToTextureDirectly = function(l, h, v, b) {\n            }, g.prototype._uploadArrayBufferViewToTexture = function(l, h, v, b) {\n            }, g.prototype._uploadImageToTexture = function(l, h, v, b) {\n            }, g;\n          }(u.a);\n        }).call(this, f(159));\n      }, function(Be, A, f) {\n        f.r(A), (function(V) {\n          f.d(A, \"Debug\", function() {\n            return m;\n          });\n          var _ = f(127), C = f(99);\n          f.d(A, \"AbstractScene\", function() {\n            return _.AbstractScene;\n          }), f.d(A, \"AbstractActionManager\", function() {\n            return _.AbstractActionManager;\n          }), f.d(A, \"Action\", function() {\n            return _.Action;\n          }), f.d(A, \"ActionEvent\", function() {\n            return _.ActionEvent;\n          }), f.d(A, \"ActionManager\", function() {\n            return _.ActionManager;\n          }), f.d(A, \"Condition\", function() {\n            return _.Condition;\n          }), f.d(A, \"ValueCondition\", function() {\n            return _.ValueCondition;\n          }), f.d(A, \"PredicateCondition\", function() {\n            return _.PredicateCondition;\n          }), f.d(A, \"StateCondition\", function() {\n            return _.StateCondition;\n          }), f.d(A, \"SwitchBooleanAction\", function() {\n            return _.SwitchBooleanAction;\n          }), f.d(A, \"SetStateAction\", function() {\n            return _.SetStateAction;\n          }), f.d(A, \"SetValueAction\", function() {\n            return _.SetValueAction;\n          }), f.d(A, \"IncrementValueAction\", function() {\n            return _.IncrementValueAction;\n          }), f.d(A, \"PlayAnimationAction\", function() {\n            return _.PlayAnimationAction;\n          }), f.d(A, \"StopAnimationAction\", function() {\n            return _.StopAnimationAction;\n          }), f.d(A, \"DoNothingAction\", function() {\n            return _.DoNothingAction;\n          }), f.d(A, \"CombineAction\", function() {\n            return _.CombineAction;\n          }), f.d(A, \"ExecuteCodeAction\", function() {\n            return _.ExecuteCodeAction;\n          }), f.d(A, \"SetParentAction\", function() {\n            return _.SetParentAction;\n          }), f.d(A, \"PlaySoundAction\", function() {\n            return _.PlaySoundAction;\n          }), f.d(A, \"StopSoundAction\", function() {\n            return _.StopSoundAction;\n          }), f.d(A, \"InterpolateValueAction\", function() {\n            return _.InterpolateValueAction;\n          }), f.d(A, \"Animatable\", function() {\n            return _.Animatable;\n          }), f.d(A, \"_IAnimationState\", function() {\n            return _._IAnimationState;\n          }), f.d(A, \"Animation\", function() {\n            return _.Animation;\n          }), f.d(A, \"TargetedAnimation\", function() {\n            return _.TargetedAnimation;\n          }), f.d(A, \"AnimationGroup\", function() {\n            return _.AnimationGroup;\n          }), f.d(A, \"AnimationPropertiesOverride\", function() {\n            return _.AnimationPropertiesOverride;\n          }), f.d(A, \"EasingFunction\", function() {\n            return _.EasingFunction;\n          }), f.d(A, \"CircleEase\", function() {\n            return _.CircleEase;\n          }), f.d(A, \"BackEase\", function() {\n            return _.BackEase;\n          }), f.d(A, \"BounceEase\", function() {\n            return _.BounceEase;\n          }), f.d(A, \"CubicEase\", function() {\n            return _.CubicEase;\n          }), f.d(A, \"ElasticEase\", function() {\n            return _.ElasticEase;\n          }), f.d(A, \"ExponentialEase\", function() {\n            return _.ExponentialEase;\n          }), f.d(A, \"PowerEase\", function() {\n            return _.PowerEase;\n          }), f.d(A, \"QuadraticEase\", function() {\n            return _.QuadraticEase;\n          }), f.d(A, \"QuarticEase\", function() {\n            return _.QuarticEase;\n          }), f.d(A, \"QuinticEase\", function() {\n            return _.QuinticEase;\n          }), f.d(A, \"SineEase\", function() {\n            return _.SineEase;\n          }), f.d(A, \"BezierCurveEase\", function() {\n            return _.BezierCurveEase;\n          }), f.d(A, \"RuntimeAnimation\", function() {\n            return _.RuntimeAnimation;\n          }), f.d(A, \"AnimationEvent\", function() {\n            return _.AnimationEvent;\n          }), f.d(A, \"AnimationKeyInterpolation\", function() {\n            return _.AnimationKeyInterpolation;\n          }), f.d(A, \"AnimationRange\", function() {\n            return _.AnimationRange;\n          }), f.d(A, \"KeepAssets\", function() {\n            return _.KeepAssets;\n          }), f.d(A, \"InstantiatedEntries\", function() {\n            return _.InstantiatedEntries;\n          }), f.d(A, \"AssetContainer\", function() {\n            return _.AssetContainer;\n          }), f.d(A, \"Analyser\", function() {\n            return _.Analyser;\n          }), f.d(A, \"AudioEngine\", function() {\n            return _.AudioEngine;\n          }), f.d(A, \"AudioSceneComponent\", function() {\n            return _.AudioSceneComponent;\n          }), f.d(A, \"Sound\", function() {\n            return _.Sound;\n          }), f.d(A, \"SoundTrack\", function() {\n            return _.SoundTrack;\n          }), f.d(A, \"WeightedSound\", function() {\n            return _.WeightedSound;\n          }), f.d(A, \"AutoRotationBehavior\", function() {\n            return _.AutoRotationBehavior;\n          }), f.d(A, \"BouncingBehavior\", function() {\n            return _.BouncingBehavior;\n          }), f.d(A, \"FramingBehavior\", function() {\n            return _.FramingBehavior;\n          }), f.d(A, \"AttachToBoxBehavior\", function() {\n            return _.AttachToBoxBehavior;\n          }), f.d(A, \"FadeInOutBehavior\", function() {\n            return _.FadeInOutBehavior;\n          }), f.d(A, \"MultiPointerScaleBehavior\", function() {\n            return _.MultiPointerScaleBehavior;\n          }), f.d(A, \"PointerDragBehavior\", function() {\n            return _.PointerDragBehavior;\n          }), f.d(A, \"SixDofDragBehavior\", function() {\n            return _.SixDofDragBehavior;\n          }), f.d(A, \"Bone\", function() {\n            return _.Bone;\n          }), f.d(A, \"BoneIKController\", function() {\n            return _.BoneIKController;\n          }), f.d(A, \"BoneLookController\", function() {\n            return _.BoneLookController;\n          }), f.d(A, \"Skeleton\", function() {\n            return _.Skeleton;\n          }), f.d(A, \"ArcRotateCameraGamepadInput\", function() {\n            return _.ArcRotateCameraGamepadInput;\n          }), f.d(A, \"ArcRotateCameraKeyboardMoveInput\", function() {\n            return _.ArcRotateCameraKeyboardMoveInput;\n          }), f.d(A, \"ArcRotateCameraMouseWheelInput\", function() {\n            return _.ArcRotateCameraMouseWheelInput;\n          }), f.d(A, \"ArcRotateCameraPointersInput\", function() {\n            return _.ArcRotateCameraPointersInput;\n          }), f.d(A, \"ArcRotateCameraVRDeviceOrientationInput\", function() {\n            return _.ArcRotateCameraVRDeviceOrientationInput;\n          }), f.d(A, \"FlyCameraKeyboardInput\", function() {\n            return _.FlyCameraKeyboardInput;\n          }), f.d(A, \"FlyCameraMouseInput\", function() {\n            return _.FlyCameraMouseInput;\n          }), f.d(A, \"FollowCameraKeyboardMoveInput\", function() {\n            return _.FollowCameraKeyboardMoveInput;\n          }), f.d(A, \"FollowCameraMouseWheelInput\", function() {\n            return _.FollowCameraMouseWheelInput;\n          }), f.d(A, \"FollowCameraPointersInput\", function() {\n            return _.FollowCameraPointersInput;\n          }), f.d(A, \"FreeCameraDeviceOrientationInput\", function() {\n            return _.FreeCameraDeviceOrientationInput;\n          }), f.d(A, \"FreeCameraGamepadInput\", function() {\n            return _.FreeCameraGamepadInput;\n          }), f.d(A, \"FreeCameraKeyboardMoveInput\", function() {\n            return _.FreeCameraKeyboardMoveInput;\n          }), f.d(A, \"FreeCameraMouseInput\", function() {\n            return _.FreeCameraMouseInput;\n          }), f.d(A, \"FreeCameraMouseWheelInput\", function() {\n            return _.FreeCameraMouseWheelInput;\n          }), f.d(A, \"FreeCameraTouchInput\", function() {\n            return _.FreeCameraTouchInput;\n          }), f.d(A, \"FreeCameraVirtualJoystickInput\", function() {\n            return _.FreeCameraVirtualJoystickInput;\n          }), f.d(A, \"CameraInputTypes\", function() {\n            return _.CameraInputTypes;\n          }), f.d(A, \"CameraInputsManager\", function() {\n            return _.CameraInputsManager;\n          }), f.d(A, \"Camera\", function() {\n            return _.Camera;\n          }), f.d(A, \"TargetCamera\", function() {\n            return _.TargetCamera;\n          }), f.d(A, \"FreeCamera\", function() {\n            return _.FreeCamera;\n          }), f.d(A, \"FreeCameraInputsManager\", function() {\n            return _.FreeCameraInputsManager;\n          }), f.d(A, \"TouchCamera\", function() {\n            return _.TouchCamera;\n          }), f.d(A, \"ArcRotateCamera\", function() {\n            return _.ArcRotateCamera;\n          }), f.d(A, \"ArcRotateCameraInputsManager\", function() {\n            return _.ArcRotateCameraInputsManager;\n          }), f.d(A, \"DeviceOrientationCamera\", function() {\n            return _.DeviceOrientationCamera;\n          }), f.d(A, \"FlyCamera\", function() {\n            return _.FlyCamera;\n          }), f.d(A, \"FlyCameraInputsManager\", function() {\n            return _.FlyCameraInputsManager;\n          }), f.d(A, \"FollowCamera\", function() {\n            return _.FollowCamera;\n          }), f.d(A, \"ArcFollowCamera\", function() {\n            return _.ArcFollowCamera;\n          }), f.d(A, \"FollowCameraInputsManager\", function() {\n            return _.FollowCameraInputsManager;\n          }), f.d(A, \"GamepadCamera\", function() {\n            return _.GamepadCamera;\n          }), f.d(A, \"AnaglyphArcRotateCamera\", function() {\n            return _.AnaglyphArcRotateCamera;\n          }), f.d(A, \"AnaglyphFreeCamera\", function() {\n            return _.AnaglyphFreeCamera;\n          }), f.d(A, \"AnaglyphGamepadCamera\", function() {\n            return _.AnaglyphGamepadCamera;\n          }), f.d(A, \"AnaglyphUniversalCamera\", function() {\n            return _.AnaglyphUniversalCamera;\n          }), f.d(A, \"StereoscopicArcRotateCamera\", function() {\n            return _.StereoscopicArcRotateCamera;\n          }), f.d(A, \"StereoscopicFreeCamera\", function() {\n            return _.StereoscopicFreeCamera;\n          }), f.d(A, \"StereoscopicGamepadCamera\", function() {\n            return _.StereoscopicGamepadCamera;\n          }), f.d(A, \"StereoscopicUniversalCamera\", function() {\n            return _.StereoscopicUniversalCamera;\n          }), f.d(A, \"UniversalCamera\", function() {\n            return _.UniversalCamera;\n          }), f.d(A, \"VirtualJoysticksCamera\", function() {\n            return _.VirtualJoysticksCamera;\n          }), f.d(A, \"VRCameraMetrics\", function() {\n            return _.VRCameraMetrics;\n          }), f.d(A, \"VRDeviceOrientationArcRotateCamera\", function() {\n            return _.VRDeviceOrientationArcRotateCamera;\n          }), f.d(A, \"VRDeviceOrientationFreeCamera\", function() {\n            return _.VRDeviceOrientationFreeCamera;\n          }), f.d(A, \"VRDeviceOrientationGamepadCamera\", function() {\n            return _.VRDeviceOrientationGamepadCamera;\n          }), f.d(A, \"OnAfterEnteringVRObservableEvent\", function() {\n            return _.OnAfterEnteringVRObservableEvent;\n          }), f.d(A, \"VRExperienceHelper\", function() {\n            return _.VRExperienceHelper;\n          }), f.d(A, \"WebVRFreeCamera\", function() {\n            return _.WebVRFreeCamera;\n          }), f.d(A, \"Collider\", function() {\n            return _.Collider;\n          }), f.d(A, \"DefaultCollisionCoordinator\", function() {\n            return _.DefaultCollisionCoordinator;\n          }), f.d(A, \"PickingInfo\", function() {\n            return _.PickingInfo;\n          }), f.d(A, \"IntersectionInfo\", function() {\n            return _.IntersectionInfo;\n          }), f.d(A, \"_MeshCollisionData\", function() {\n            return _._MeshCollisionData;\n          }), f.d(A, \"BoundingBox\", function() {\n            return _.BoundingBox;\n          }), f.d(A, \"BoundingInfo\", function() {\n            return _.BoundingInfo;\n          }), f.d(A, \"BoundingSphere\", function() {\n            return _.BoundingSphere;\n          }), f.d(A, \"Octree\", function() {\n            return _.Octree;\n          }), f.d(A, \"OctreeBlock\", function() {\n            return _.OctreeBlock;\n          }), f.d(A, \"OctreeSceneComponent\", function() {\n            return _.OctreeSceneComponent;\n          }), f.d(A, \"Ray\", function() {\n            return _.Ray;\n          }), f.d(A, \"AxesViewer\", function() {\n            return _.AxesViewer;\n          }), f.d(A, \"BoneAxesViewer\", function() {\n            return _.BoneAxesViewer;\n          }), f.d(A, \"DebugLayerTab\", function() {\n            return _.DebugLayerTab;\n          }), f.d(A, \"DebugLayer\", function() {\n            return _.DebugLayer;\n          }), f.d(A, \"PhysicsViewer\", function() {\n            return _.PhysicsViewer;\n          }), f.d(A, \"RayHelper\", function() {\n            return _.RayHelper;\n          }), f.d(A, \"SkeletonViewer\", function() {\n            return _.SkeletonViewer;\n          }), f.d(A, \"DeviceInputSystem\", function() {\n            return _.DeviceInputSystem;\n          }), f.d(A, \"DeviceType\", function() {\n            return _.DeviceType;\n          }), f.d(A, \"PointerInput\", function() {\n            return _.PointerInput;\n          }), f.d(A, \"DualShockInput\", function() {\n            return _.DualShockInput;\n          }), f.d(A, \"XboxInput\", function() {\n            return _.XboxInput;\n          }), f.d(A, \"SwitchInput\", function() {\n            return _.SwitchInput;\n          }), f.d(A, \"DeviceSource\", function() {\n            return _.DeviceSource;\n          }), f.d(A, \"DeviceSourceManager\", function() {\n            return _.DeviceSourceManager;\n          }), f.d(A, \"Constants\", function() {\n            return _.Constants;\n          }), f.d(A, \"ThinEngine\", function() {\n            return _.ThinEngine;\n          }), f.d(A, \"Engine\", function() {\n            return _.Engine;\n          }), f.d(A, \"EngineStore\", function() {\n            return _.EngineStore;\n          }), f.d(A, \"NullEngineOptions\", function() {\n            return _.NullEngineOptions;\n          }), f.d(A, \"NullEngine\", function() {\n            return _.NullEngine;\n          }), f.d(A, \"_OcclusionDataStorage\", function() {\n            return _._OcclusionDataStorage;\n          }), f.d(A, \"_forceTransformFeedbackToBundle\", function() {\n            return _._forceTransformFeedbackToBundle;\n          }), f.d(A, \"EngineView\", function() {\n            return _.EngineView;\n          }), f.d(A, \"WebGLPipelineContext\", function() {\n            return _.WebGLPipelineContext;\n          }), f.d(A, \"WebGL2ShaderProcessor\", function() {\n            return _.WebGL2ShaderProcessor;\n          }), f.d(A, \"NativeEngine\", function() {\n            return _.NativeEngine;\n          }), f.d(A, \"ShaderCodeInliner\", function() {\n            return _.ShaderCodeInliner;\n          }), f.d(A, \"PerformanceConfigurator\", function() {\n            return _.PerformanceConfigurator;\n          }), f.d(A, \"KeyboardEventTypes\", function() {\n            return _.KeyboardEventTypes;\n          }), f.d(A, \"KeyboardInfo\", function() {\n            return _.KeyboardInfo;\n          }), f.d(A, \"KeyboardInfoPre\", function() {\n            return _.KeyboardInfoPre;\n          }), f.d(A, \"PointerEventTypes\", function() {\n            return _.PointerEventTypes;\n          }), f.d(A, \"PointerInfoBase\", function() {\n            return _.PointerInfoBase;\n          }), f.d(A, \"PointerInfoPre\", function() {\n            return _.PointerInfoPre;\n          }), f.d(A, \"PointerInfo\", function() {\n            return _.PointerInfo;\n          }), f.d(A, \"ClipboardEventTypes\", function() {\n            return _.ClipboardEventTypes;\n          }), f.d(A, \"ClipboardInfo\", function() {\n            return _.ClipboardInfo;\n          }), f.d(A, \"DaydreamController\", function() {\n            return _.DaydreamController;\n          }), f.d(A, \"GearVRController\", function() {\n            return _.GearVRController;\n          }), f.d(A, \"GenericController\", function() {\n            return _.GenericController;\n          }), f.d(A, \"OculusTouchController\", function() {\n            return _.OculusTouchController;\n          }), f.d(A, \"PoseEnabledControllerType\", function() {\n            return _.PoseEnabledControllerType;\n          }), f.d(A, \"PoseEnabledControllerHelper\", function() {\n            return _.PoseEnabledControllerHelper;\n          }), f.d(A, \"PoseEnabledController\", function() {\n            return _.PoseEnabledController;\n          }), f.d(A, \"ViveController\", function() {\n            return _.ViveController;\n          }), f.d(A, \"WebVRController\", function() {\n            return _.WebVRController;\n          }), f.d(A, \"WindowsMotionController\", function() {\n            return _.WindowsMotionController;\n          }), f.d(A, \"XRWindowsMotionController\", function() {\n            return _.XRWindowsMotionController;\n          }), f.d(A, \"StickValues\", function() {\n            return _.StickValues;\n          }), f.d(A, \"Gamepad\", function() {\n            return _.Gamepad;\n          }), f.d(A, \"GenericPad\", function() {\n            return _.GenericPad;\n          }), f.d(A, \"GamepadManager\", function() {\n            return _.GamepadManager;\n          }), f.d(A, \"GamepadSystemSceneComponent\", function() {\n            return _.GamepadSystemSceneComponent;\n          }), f.d(A, \"Xbox360Button\", function() {\n            return _.Xbox360Button;\n          }), f.d(A, \"Xbox360Dpad\", function() {\n            return _.Xbox360Dpad;\n          }), f.d(A, \"Xbox360Pad\", function() {\n            return _.Xbox360Pad;\n          }), f.d(A, \"DualShockButton\", function() {\n            return _.DualShockButton;\n          }), f.d(A, \"DualShockDpad\", function() {\n            return _.DualShockDpad;\n          }), f.d(A, \"DualShockPad\", function() {\n            return _.DualShockPad;\n          }), f.d(A, \"AxisDragGizmo\", function() {\n            return _.AxisDragGizmo;\n          }), f.d(A, \"AxisScaleGizmo\", function() {\n            return _.AxisScaleGizmo;\n          }), f.d(A, \"BoundingBoxGizmo\", function() {\n            return _.BoundingBoxGizmo;\n          }), f.d(A, \"Gizmo\", function() {\n            return _.Gizmo;\n          }), f.d(A, \"GizmoManager\", function() {\n            return _.GizmoManager;\n          }), f.d(A, \"PlaneRotationGizmo\", function() {\n            return _.PlaneRotationGizmo;\n          }), f.d(A, \"PositionGizmo\", function() {\n            return _.PositionGizmo;\n          }), f.d(A, \"RotationGizmo\", function() {\n            return _.RotationGizmo;\n          }), f.d(A, \"ScaleGizmo\", function() {\n            return _.ScaleGizmo;\n          }), f.d(A, \"LightGizmo\", function() {\n            return _.LightGizmo;\n          }), f.d(A, \"CameraGizmo\", function() {\n            return _.CameraGizmo;\n          }), f.d(A, \"PlaneDragGizmo\", function() {\n            return _.PlaneDragGizmo;\n          }), f.d(A, \"EnvironmentHelper\", function() {\n            return _.EnvironmentHelper;\n          }), f.d(A, \"PhotoDome\", function() {\n            return _.PhotoDome;\n          }), f.d(A, \"_forceSceneHelpersToBundle\", function() {\n            return _._forceSceneHelpersToBundle;\n          }), f.d(A, \"VideoDome\", function() {\n            return _.VideoDome;\n          }), f.d(A, \"EngineInstrumentation\", function() {\n            return _.EngineInstrumentation;\n          }), f.d(A, \"SceneInstrumentation\", function() {\n            return _.SceneInstrumentation;\n          }), f.d(A, \"_TimeToken\", function() {\n            return _._TimeToken;\n          }), f.d(A, \"EffectLayer\", function() {\n            return _.EffectLayer;\n          }), f.d(A, \"EffectLayerSceneComponent\", function() {\n            return _.EffectLayerSceneComponent;\n          }), f.d(A, \"GlowLayer\", function() {\n            return _.GlowLayer;\n          }), f.d(A, \"HighlightLayer\", function() {\n            return _.HighlightLayer;\n          }), f.d(A, \"Layer\", function() {\n            return _.Layer;\n          }), f.d(A, \"LayerSceneComponent\", function() {\n            return _.LayerSceneComponent;\n          }), f.d(A, \"LensFlare\", function() {\n            return _.LensFlare;\n          }), f.d(A, \"LensFlareSystem\", function() {\n            return _.LensFlareSystem;\n          }), f.d(A, \"LensFlareSystemSceneComponent\", function() {\n            return _.LensFlareSystemSceneComponent;\n          }), f.d(A, \"Light\", function() {\n            return _.Light;\n          }), f.d(A, \"ShadowLight\", function() {\n            return _.ShadowLight;\n          }), f.d(A, \"ShadowGenerator\", function() {\n            return _.ShadowGenerator;\n          }), f.d(A, \"CascadedShadowGenerator\", function() {\n            return _.CascadedShadowGenerator;\n          }), f.d(A, \"ShadowGeneratorSceneComponent\", function() {\n            return _.ShadowGeneratorSceneComponent;\n          }), f.d(A, \"DirectionalLight\", function() {\n            return _.DirectionalLight;\n          }), f.d(A, \"HemisphericLight\", function() {\n            return _.HemisphericLight;\n          }), f.d(A, \"PointLight\", function() {\n            return _.PointLight;\n          }), f.d(A, \"SpotLight\", function() {\n            return _.SpotLight;\n          }), f.d(A, \"DefaultLoadingScreen\", function() {\n            return _.DefaultLoadingScreen;\n          }), f.d(A, \"_BabylonLoaderRegistered\", function() {\n            return _._BabylonLoaderRegistered;\n          }), f.d(A, \"BabylonFileLoaderConfiguration\", function() {\n            return _.BabylonFileLoaderConfiguration;\n          }), f.d(A, \"SceneLoaderAnimationGroupLoadingMode\", function() {\n            return _.SceneLoaderAnimationGroupLoadingMode;\n          }), f.d(A, \"SceneLoader\", function() {\n            return _.SceneLoader;\n          }), f.d(A, \"SceneLoaderFlags\", function() {\n            return _.SceneLoaderFlags;\n          }), f.d(A, \"BackgroundMaterial\", function() {\n            return _.BackgroundMaterial;\n          }), f.d(A, \"ColorCurves\", function() {\n            return _.ColorCurves;\n          }), f.d(A, \"EffectFallbacks\", function() {\n            return _.EffectFallbacks;\n          }), f.d(A, \"Effect\", function() {\n            return _.Effect;\n          }), f.d(A, \"FresnelParameters\", function() {\n            return _.FresnelParameters;\n          }), f.d(A, \"ImageProcessingConfigurationDefines\", function() {\n            return _.ImageProcessingConfigurationDefines;\n          }), f.d(A, \"ImageProcessingConfiguration\", function() {\n            return _.ImageProcessingConfiguration;\n          }), f.d(A, \"Material\", function() {\n            return _.Material;\n          }), f.d(A, \"MaterialDefines\", function() {\n            return _.MaterialDefines;\n          }), f.d(A, \"ThinMaterialHelper\", function() {\n            return _.ThinMaterialHelper;\n          }), f.d(A, \"MaterialHelper\", function() {\n            return _.MaterialHelper;\n          }), f.d(A, \"MultiMaterial\", function() {\n            return _.MultiMaterial;\n          }), f.d(A, \"PBRMaterialDefines\", function() {\n            return _.PBRMaterialDefines;\n          }), f.d(A, \"PBRBaseMaterial\", function() {\n            return _.PBRBaseMaterial;\n          }), f.d(A, \"PBRBaseSimpleMaterial\", function() {\n            return _.PBRBaseSimpleMaterial;\n          }), f.d(A, \"PBRMaterial\", function() {\n            return _.PBRMaterial;\n          }), f.d(A, \"PBRMetallicRoughnessMaterial\", function() {\n            return _.PBRMetallicRoughnessMaterial;\n          }), f.d(A, \"PBRSpecularGlossinessMaterial\", function() {\n            return _.PBRSpecularGlossinessMaterial;\n          }), f.d(A, \"PushMaterial\", function() {\n            return _.PushMaterial;\n          }), f.d(A, \"ShaderMaterial\", function() {\n            return _.ShaderMaterial;\n          }), f.d(A, \"StandardMaterialDefines\", function() {\n            return _.StandardMaterialDefines;\n          }), f.d(A, \"StandardMaterial\", function() {\n            return _.StandardMaterial;\n          }), f.d(A, \"BaseTexture\", function() {\n            return _.BaseTexture;\n          }), f.d(A, \"ColorGradingTexture\", function() {\n            return _.ColorGradingTexture;\n          }), f.d(A, \"CubeTexture\", function() {\n            return _.CubeTexture;\n          }), f.d(A, \"DynamicTexture\", function() {\n            return _.DynamicTexture;\n          }), f.d(A, \"EquiRectangularCubeTexture\", function() {\n            return _.EquiRectangularCubeTexture;\n          }), f.d(A, \"HDRFiltering\", function() {\n            return _.HDRFiltering;\n          }), f.d(A, \"HDRCubeTexture\", function() {\n            return _.HDRCubeTexture;\n          }), f.d(A, \"HtmlElementTexture\", function() {\n            return _.HtmlElementTexture;\n          }), f.d(A, \"InternalTextureSource\", function() {\n            return _.InternalTextureSource;\n          }), f.d(A, \"InternalTexture\", function() {\n            return _.InternalTexture;\n          }), f.d(A, \"_DDSTextureLoader\", function() {\n            return _._DDSTextureLoader;\n          }), f.d(A, \"_ENVTextureLoader\", function() {\n            return _._ENVTextureLoader;\n          }), f.d(A, \"_KTXTextureLoader\", function() {\n            return _._KTXTextureLoader;\n          }), f.d(A, \"_TGATextureLoader\", function() {\n            return _._TGATextureLoader;\n          }), f.d(A, \"_BasisTextureLoader\", function() {\n            return _._BasisTextureLoader;\n          }), f.d(A, \"MirrorTexture\", function() {\n            return _.MirrorTexture;\n          }), f.d(A, \"MultiRenderTarget\", function() {\n            return _.MultiRenderTarget;\n          }), f.d(A, \"TexturePacker\", function() {\n            return _.TexturePacker;\n          }), f.d(A, \"TexturePackerFrame\", function() {\n            return _.TexturePackerFrame;\n          }), f.d(A, \"CustomProceduralTexture\", function() {\n            return _.CustomProceduralTexture;\n          }), f.d(A, \"NoiseProceduralTexture\", function() {\n            return _.NoiseProceduralTexture;\n          }), f.d(A, \"ProceduralTexture\", function() {\n            return _.ProceduralTexture;\n          }), f.d(A, \"ProceduralTextureSceneComponent\", function() {\n            return _.ProceduralTextureSceneComponent;\n          }), f.d(A, \"RawCubeTexture\", function() {\n            return _.RawCubeTexture;\n          }), f.d(A, \"RawTexture\", function() {\n            return _.RawTexture;\n          }), f.d(A, \"RawTexture2DArray\", function() {\n            return _.RawTexture2DArray;\n          }), f.d(A, \"RawTexture3D\", function() {\n            return _.RawTexture3D;\n          }), f.d(A, \"RefractionTexture\", function() {\n            return _.RefractionTexture;\n          }), f.d(A, \"RenderTargetTexture\", function() {\n            return _.RenderTargetTexture;\n          }), f.d(A, \"Texture\", function() {\n            return _.Texture;\n          }), f.d(A, \"VideoTexture\", function() {\n            return _.VideoTexture;\n          }), f.d(A, \"UniformBuffer\", function() {\n            return _.UniformBuffer;\n          }), f.d(A, \"MaterialFlags\", function() {\n            return _.MaterialFlags;\n          }), f.d(A, \"NodeMaterialBlockTargets\", function() {\n            return _.NodeMaterialBlockTargets;\n          }), f.d(A, \"NodeMaterialBlockConnectionPointTypes\", function() {\n            return _.NodeMaterialBlockConnectionPointTypes;\n          }), f.d(A, \"NodeMaterialBlockConnectionPointMode\", function() {\n            return _.NodeMaterialBlockConnectionPointMode;\n          }), f.d(A, \"NodeMaterialSystemValues\", function() {\n            return _.NodeMaterialSystemValues;\n          }), f.d(A, \"NodeMaterialModes\", function() {\n            return _.NodeMaterialModes;\n          }), f.d(A, \"NodeMaterialConnectionPointCompatibilityStates\", function() {\n            return _.NodeMaterialConnectionPointCompatibilityStates;\n          }), f.d(A, \"NodeMaterialConnectionPointDirection\", function() {\n            return _.NodeMaterialConnectionPointDirection;\n          }), f.d(A, \"NodeMaterialConnectionPoint\", function() {\n            return _.NodeMaterialConnectionPoint;\n          }), f.d(A, \"NodeMaterialBlock\", function() {\n            return _.NodeMaterialBlock;\n          }), f.d(A, \"NodeMaterialDefines\", function() {\n            return _.NodeMaterialDefines;\n          }), f.d(A, \"NodeMaterial\", function() {\n            return _.NodeMaterial;\n          }), f.d(A, \"VertexOutputBlock\", function() {\n            return _.VertexOutputBlock;\n          }), f.d(A, \"BonesBlock\", function() {\n            return _.BonesBlock;\n          }), f.d(A, \"InstancesBlock\", function() {\n            return _.InstancesBlock;\n          }), f.d(A, \"MorphTargetsBlock\", function() {\n            return _.MorphTargetsBlock;\n          }), f.d(A, \"LightInformationBlock\", function() {\n            return _.LightInformationBlock;\n          }), f.d(A, \"FragmentOutputBlock\", function() {\n            return _.FragmentOutputBlock;\n          }), f.d(A, \"ImageProcessingBlock\", function() {\n            return _.ImageProcessingBlock;\n          }), f.d(A, \"PerturbNormalBlock\", function() {\n            return _.PerturbNormalBlock;\n          }), f.d(A, \"DiscardBlock\", function() {\n            return _.DiscardBlock;\n          }), f.d(A, \"FrontFacingBlock\", function() {\n            return _.FrontFacingBlock;\n          }), f.d(A, \"DerivativeBlock\", function() {\n            return _.DerivativeBlock;\n          }), f.d(A, \"FragCoordBlock\", function() {\n            return _.FragCoordBlock;\n          }), f.d(A, \"ScreenSizeBlock\", function() {\n            return _.ScreenSizeBlock;\n          }), f.d(A, \"FogBlock\", function() {\n            return _.FogBlock;\n          }), f.d(A, \"LightBlock\", function() {\n            return _.LightBlock;\n          }), f.d(A, \"TextureBlock\", function() {\n            return _.TextureBlock;\n          }), f.d(A, \"ReflectionTextureBlock\", function() {\n            return _.ReflectionTextureBlock;\n          }), f.d(A, \"CurrentScreenBlock\", function() {\n            return _.CurrentScreenBlock;\n          }), f.d(A, \"InputBlock\", function() {\n            return _.InputBlock;\n          }), f.d(A, \"AnimatedInputBlockTypes\", function() {\n            return _.AnimatedInputBlockTypes;\n          }), f.d(A, \"MultiplyBlock\", function() {\n            return _.MultiplyBlock;\n          }), f.d(A, \"AddBlock\", function() {\n            return _.AddBlock;\n          }), f.d(A, \"ScaleBlock\", function() {\n            return _.ScaleBlock;\n          }), f.d(A, \"ClampBlock\", function() {\n            return _.ClampBlock;\n          }), f.d(A, \"CrossBlock\", function() {\n            return _.CrossBlock;\n          }), f.d(A, \"DotBlock\", function() {\n            return _.DotBlock;\n          }), f.d(A, \"TransformBlock\", function() {\n            return _.TransformBlock;\n          }), f.d(A, \"RemapBlock\", function() {\n            return _.RemapBlock;\n          }), f.d(A, \"NormalizeBlock\", function() {\n            return _.NormalizeBlock;\n          }), f.d(A, \"TrigonometryBlockOperations\", function() {\n            return _.TrigonometryBlockOperations;\n          }), f.d(A, \"TrigonometryBlock\", function() {\n            return _.TrigonometryBlock;\n          }), f.d(A, \"ColorMergerBlock\", function() {\n            return _.ColorMergerBlock;\n          }), f.d(A, \"VectorMergerBlock\", function() {\n            return _.VectorMergerBlock;\n          }), f.d(A, \"ColorSplitterBlock\", function() {\n            return _.ColorSplitterBlock;\n          }), f.d(A, \"VectorSplitterBlock\", function() {\n            return _.VectorSplitterBlock;\n          }), f.d(A, \"LerpBlock\", function() {\n            return _.LerpBlock;\n          }), f.d(A, \"DivideBlock\", function() {\n            return _.DivideBlock;\n          }), f.d(A, \"SubtractBlock\", function() {\n            return _.SubtractBlock;\n          }), f.d(A, \"StepBlock\", function() {\n            return _.StepBlock;\n          }), f.d(A, \"OneMinusBlock\", function() {\n            return _.OneMinusBlock;\n          }), f.d(A, \"ViewDirectionBlock\", function() {\n            return _.ViewDirectionBlock;\n          }), f.d(A, \"FresnelBlock\", function() {\n            return _.FresnelBlock;\n          }), f.d(A, \"MaxBlock\", function() {\n            return _.MaxBlock;\n          }), f.d(A, \"MinBlock\", function() {\n            return _.MinBlock;\n          }), f.d(A, \"DistanceBlock\", function() {\n            return _.DistanceBlock;\n          }), f.d(A, \"LengthBlock\", function() {\n            return _.LengthBlock;\n          }), f.d(A, \"NegateBlock\", function() {\n            return _.NegateBlock;\n          }), f.d(A, \"PowBlock\", function() {\n            return _.PowBlock;\n          }), f.d(A, \"RandomNumberBlock\", function() {\n            return _.RandomNumberBlock;\n          }), f.d(A, \"ArcTan2Block\", function() {\n            return _.ArcTan2Block;\n          }), f.d(A, \"SmoothStepBlock\", function() {\n            return _.SmoothStepBlock;\n          }), f.d(A, \"ReciprocalBlock\", function() {\n            return _.ReciprocalBlock;\n          }), f.d(A, \"ReplaceColorBlock\", function() {\n            return _.ReplaceColorBlock;\n          }), f.d(A, \"PosterizeBlock\", function() {\n            return _.PosterizeBlock;\n          }), f.d(A, \"WaveBlockKind\", function() {\n            return _.WaveBlockKind;\n          }), f.d(A, \"WaveBlock\", function() {\n            return _.WaveBlock;\n          }), f.d(A, \"GradientBlockColorStep\", function() {\n            return _.GradientBlockColorStep;\n          }), f.d(A, \"GradientBlock\", function() {\n            return _.GradientBlock;\n          }), f.d(A, \"NLerpBlock\", function() {\n            return _.NLerpBlock;\n          }), f.d(A, \"WorleyNoise3DBlock\", function() {\n            return _.WorleyNoise3DBlock;\n          }), f.d(A, \"SimplexPerlin3DBlock\", function() {\n            return _.SimplexPerlin3DBlock;\n          }), f.d(A, \"NormalBlendBlock\", function() {\n            return _.NormalBlendBlock;\n          }), f.d(A, \"Rotate2dBlock\", function() {\n            return _.Rotate2dBlock;\n          }), f.d(A, \"ReflectBlock\", function() {\n            return _.ReflectBlock;\n          }), f.d(A, \"RefractBlock\", function() {\n            return _.RefractBlock;\n          }), f.d(A, \"DesaturateBlock\", function() {\n            return _.DesaturateBlock;\n          }), f.d(A, \"PBRMetallicRoughnessBlock\", function() {\n            return _.PBRMetallicRoughnessBlock;\n          }), f.d(A, \"SheenBlock\", function() {\n            return _.SheenBlock;\n          }), f.d(A, \"AnisotropyBlock\", function() {\n            return _.AnisotropyBlock;\n          }), f.d(A, \"ReflectionBlock\", function() {\n            return _.ReflectionBlock;\n          }), f.d(A, \"ClearCoatBlock\", function() {\n            return _.ClearCoatBlock;\n          }), f.d(A, \"RefractionBlock\", function() {\n            return _.RefractionBlock;\n          }), f.d(A, \"SubSurfaceBlock\", function() {\n            return _.SubSurfaceBlock;\n          }), f.d(A, \"ParticleTextureBlock\", function() {\n            return _.ParticleTextureBlock;\n          }), f.d(A, \"ParticleRampGradientBlock\", function() {\n            return _.ParticleRampGradientBlock;\n          }), f.d(A, \"ParticleBlendMultiplyBlock\", function() {\n            return _.ParticleBlendMultiplyBlock;\n          }), f.d(A, \"ModBlock\", function() {\n            return _.ModBlock;\n          }), f.d(A, \"NodeMaterialOptimizer\", function() {\n            return _.NodeMaterialOptimizer;\n          }), f.d(A, \"PropertyTypeForEdition\", function() {\n            return _.PropertyTypeForEdition;\n          }), f.d(A, \"editableInPropertyPage\", function() {\n            return _.editableInPropertyPage;\n          }), f.d(A, \"EffectRenderer\", function() {\n            return _.EffectRenderer;\n          }), f.d(A, \"EffectWrapper\", function() {\n            return _.EffectWrapper;\n          }), f.d(A, \"ShadowDepthWrapper\", function() {\n            return _.ShadowDepthWrapper;\n          }), f.d(A, \"Scalar\", function() {\n            return _.Scalar;\n          }), f.d(A, \"extractMinAndMaxIndexed\", function() {\n            return _.extractMinAndMaxIndexed;\n          }), f.d(A, \"extractMinAndMax\", function() {\n            return _.extractMinAndMax;\n          }), f.d(A, \"Space\", function() {\n            return _.Space;\n          }), f.d(A, \"Axis\", function() {\n            return _.Axis;\n          }), f.d(A, \"Coordinate\", function() {\n            return _.Coordinate;\n          }), f.d(A, \"Color3\", function() {\n            return _.Color3;\n          }), f.d(A, \"Color4\", function() {\n            return _.Color4;\n          }), f.d(A, \"TmpColors\", function() {\n            return _.TmpColors;\n          }), f.d(A, \"ToGammaSpace\", function() {\n            return _.ToGammaSpace;\n          }), f.d(A, \"ToLinearSpace\", function() {\n            return _.ToLinearSpace;\n          }), f.d(A, \"Epsilon\", function() {\n            return _.Epsilon;\n          }), f.d(A, \"Frustum\", function() {\n            return _.Frustum;\n          }), f.d(A, \"Orientation\", function() {\n            return _.Orientation;\n          }), f.d(A, \"BezierCurve\", function() {\n            return _.BezierCurve;\n          }), f.d(A, \"Angle\", function() {\n            return _.Angle;\n          }), f.d(A, \"Arc2\", function() {\n            return _.Arc2;\n          }), f.d(A, \"Path2\", function() {\n            return _.Path2;\n          }), f.d(A, \"Path3D\", function() {\n            return _.Path3D;\n          }), f.d(A, \"Curve3\", function() {\n            return _.Curve3;\n          }), f.d(A, \"Plane\", function() {\n            return _.Plane;\n          }), f.d(A, \"Size\", function() {\n            return _.Size;\n          }), f.d(A, \"Vector2\", function() {\n            return _.Vector2;\n          }), f.d(A, \"Vector3\", function() {\n            return _.Vector3;\n          }), f.d(A, \"Vector4\", function() {\n            return _.Vector4;\n          }), f.d(A, \"Quaternion\", function() {\n            return _.Quaternion;\n          }), f.d(A, \"Matrix\", function() {\n            return _.Matrix;\n          }), f.d(A, \"TmpVectors\", function() {\n            return _.TmpVectors;\n          }), f.d(A, \"PositionNormalVertex\", function() {\n            return _.PositionNormalVertex;\n          }), f.d(A, \"PositionNormalTextureVertex\", function() {\n            return _.PositionNormalTextureVertex;\n          }), f.d(A, \"Viewport\", function() {\n            return _.Viewport;\n          }), f.d(A, \"SphericalHarmonics\", function() {\n            return _.SphericalHarmonics;\n          }), f.d(A, \"SphericalPolynomial\", function() {\n            return _.SphericalPolynomial;\n          }), f.d(A, \"AbstractMesh\", function() {\n            return _.AbstractMesh;\n          }), f.d(A, \"Buffer\", function() {\n            return _.Buffer;\n          }), f.d(A, \"VertexBuffer\", function() {\n            return _.VertexBuffer;\n          }), f.d(A, \"DracoCompression\", function() {\n            return _.DracoCompression;\n          }), f.d(A, \"CSG\", function() {\n            return _.CSG;\n          }), f.d(A, \"Geometry\", function() {\n            return _.Geometry;\n          }), f.d(A, \"GroundMesh\", function() {\n            return _.GroundMesh;\n          }), f.d(A, \"TrailMesh\", function() {\n            return _.TrailMesh;\n          }), f.d(A, \"InstancedMesh\", function() {\n            return _.InstancedMesh;\n          }), f.d(A, \"LinesMesh\", function() {\n            return _.LinesMesh;\n          }), f.d(A, \"InstancedLinesMesh\", function() {\n            return _.InstancedLinesMesh;\n          }), f.d(A, \"_CreationDataStorage\", function() {\n            return _._CreationDataStorage;\n          }), f.d(A, \"_InstancesBatch\", function() {\n            return _._InstancesBatch;\n          }), f.d(A, \"Mesh\", function() {\n            return _.Mesh;\n          }), f.d(A, \"VertexData\", function() {\n            return _.VertexData;\n          }), f.d(A, \"MeshBuilder\", function() {\n            return _.MeshBuilder;\n          }), f.d(A, \"SimplificationSettings\", function() {\n            return _.SimplificationSettings;\n          }), f.d(A, \"SimplificationQueue\", function() {\n            return _.SimplificationQueue;\n          }), f.d(A, \"SimplificationType\", function() {\n            return _.SimplificationType;\n          }), f.d(A, \"QuadraticErrorSimplification\", function() {\n            return _.QuadraticErrorSimplification;\n          }), f.d(A, \"SimplicationQueueSceneComponent\", function() {\n            return _.SimplicationQueueSceneComponent;\n          }), f.d(A, \"Polygon\", function() {\n            return _.Polygon;\n          }), f.d(A, \"PolygonMeshBuilder\", function() {\n            return _.PolygonMeshBuilder;\n          }), f.d(A, \"SubMesh\", function() {\n            return _.SubMesh;\n          }), f.d(A, \"MeshLODLevel\", function() {\n            return _.MeshLODLevel;\n          }), f.d(A, \"TransformNode\", function() {\n            return _.TransformNode;\n          }), f.d(A, \"BoxBuilder\", function() {\n            return _.BoxBuilder;\n          }), f.d(A, \"TiledBoxBuilder\", function() {\n            return _.TiledBoxBuilder;\n          }), f.d(A, \"DiscBuilder\", function() {\n            return _.DiscBuilder;\n          }), f.d(A, \"RibbonBuilder\", function() {\n            return _.RibbonBuilder;\n          }), f.d(A, \"SphereBuilder\", function() {\n            return _.SphereBuilder;\n          }), f.d(A, \"HemisphereBuilder\", function() {\n            return _.HemisphereBuilder;\n          }), f.d(A, \"CylinderBuilder\", function() {\n            return _.CylinderBuilder;\n          }), f.d(A, \"TorusBuilder\", function() {\n            return _.TorusBuilder;\n          }), f.d(A, \"TorusKnotBuilder\", function() {\n            return _.TorusKnotBuilder;\n          }), f.d(A, \"LinesBuilder\", function() {\n            return _.LinesBuilder;\n          }), f.d(A, \"PolygonBuilder\", function() {\n            return _.PolygonBuilder;\n          }), f.d(A, \"ShapeBuilder\", function() {\n            return _.ShapeBuilder;\n          }), f.d(A, \"LatheBuilder\", function() {\n            return _.LatheBuilder;\n          }), f.d(A, \"PlaneBuilder\", function() {\n            return _.PlaneBuilder;\n          }), f.d(A, \"TiledPlaneBuilder\", function() {\n            return _.TiledPlaneBuilder;\n          }), f.d(A, \"GroundBuilder\", function() {\n            return _.GroundBuilder;\n          }), f.d(A, \"TubeBuilder\", function() {\n            return _.TubeBuilder;\n          }), f.d(A, \"PolyhedronBuilder\", function() {\n            return _.PolyhedronBuilder;\n          }), f.d(A, \"IcoSphereBuilder\", function() {\n            return _.IcoSphereBuilder;\n          }), f.d(A, \"DecalBuilder\", function() {\n            return _.DecalBuilder;\n          }), f.d(A, \"CapsuleBuilder\", function() {\n            return _.CapsuleBuilder;\n          }), f.d(A, \"DataBuffer\", function() {\n            return _.DataBuffer;\n          }), f.d(A, \"WebGLDataBuffer\", function() {\n            return _.WebGLDataBuffer;\n          }), f.d(A, \"MorphTarget\", function() {\n            return _.MorphTarget;\n          }), f.d(A, \"MorphTargetManager\", function() {\n            return _.MorphTargetManager;\n          }), f.d(A, \"RecastJSPlugin\", function() {\n            return _.RecastJSPlugin;\n          }), f.d(A, \"RecastJSCrowd\", function() {\n            return _.RecastJSCrowd;\n          }), f.d(A, \"Node\", function() {\n            return _.Node;\n          }), f.d(A, \"Database\", function() {\n            return _.Database;\n          }), f.d(A, \"BaseParticleSystem\", function() {\n            return _.BaseParticleSystem;\n          }), f.d(A, \"BoxParticleEmitter\", function() {\n            return _.BoxParticleEmitter;\n          }), f.d(A, \"ConeParticleEmitter\", function() {\n            return _.ConeParticleEmitter;\n          }), f.d(A, \"CylinderParticleEmitter\", function() {\n            return _.CylinderParticleEmitter;\n          }), f.d(A, \"CylinderDirectedParticleEmitter\", function() {\n            return _.CylinderDirectedParticleEmitter;\n          }), f.d(A, \"HemisphericParticleEmitter\", function() {\n            return _.HemisphericParticleEmitter;\n          }), f.d(A, \"PointParticleEmitter\", function() {\n            return _.PointParticleEmitter;\n          }), f.d(A, \"SphereParticleEmitter\", function() {\n            return _.SphereParticleEmitter;\n          }), f.d(A, \"SphereDirectedParticleEmitter\", function() {\n            return _.SphereDirectedParticleEmitter;\n          }), f.d(A, \"CustomParticleEmitter\", function() {\n            return _.CustomParticleEmitter;\n          }), f.d(A, \"MeshParticleEmitter\", function() {\n            return _.MeshParticleEmitter;\n          }), f.d(A, \"GPUParticleSystem\", function() {\n            return _.GPUParticleSystem;\n          }), f.d(A, \"Particle\", function() {\n            return _.Particle;\n          }), f.d(A, \"ParticleHelper\", function() {\n            return _.ParticleHelper;\n          }), f.d(A, \"ParticleSystem\", function() {\n            return _.ParticleSystem;\n          }), f.d(A, \"ParticleSystemSet\", function() {\n            return _.ParticleSystemSet;\n          }), f.d(A, \"SolidParticle\", function() {\n            return _.SolidParticle;\n          }), f.d(A, \"ModelShape\", function() {\n            return _.ModelShape;\n          }), f.d(A, \"DepthSortedParticle\", function() {\n            return _.DepthSortedParticle;\n          }), f.d(A, \"SolidParticleVertex\", function() {\n            return _.SolidParticleVertex;\n          }), f.d(A, \"SolidParticleSystem\", function() {\n            return _.SolidParticleSystem;\n          }), f.d(A, \"CloudPoint\", function() {\n            return _.CloudPoint;\n          }), f.d(A, \"PointsGroup\", function() {\n            return _.PointsGroup;\n          }), f.d(A, \"PointColor\", function() {\n            return _.PointColor;\n          }), f.d(A, \"PointsCloudSystem\", function() {\n            return _.PointsCloudSystem;\n          }), f.d(A, \"SubEmitterType\", function() {\n            return _.SubEmitterType;\n          }), f.d(A, \"SubEmitter\", function() {\n            return _.SubEmitter;\n          }), f.d(A, \"PhysicsEngine\", function() {\n            return _.PhysicsEngine;\n          }), f.d(A, \"PhysicsEngineSceneComponent\", function() {\n            return _.PhysicsEngineSceneComponent;\n          }), f.d(A, \"PhysicsHelper\", function() {\n            return _.PhysicsHelper;\n          }), f.d(A, \"PhysicsRadialExplosionEventOptions\", function() {\n            return _.PhysicsRadialExplosionEventOptions;\n          }), f.d(A, \"PhysicsUpdraftEventOptions\", function() {\n            return _.PhysicsUpdraftEventOptions;\n          }), f.d(A, \"PhysicsVortexEventOptions\", function() {\n            return _.PhysicsVortexEventOptions;\n          }), f.d(A, \"PhysicsRadialImpulseFalloff\", function() {\n            return _.PhysicsRadialImpulseFalloff;\n          }), f.d(A, \"PhysicsUpdraftMode\", function() {\n            return _.PhysicsUpdraftMode;\n          }), f.d(A, \"PhysicsImpostor\", function() {\n            return _.PhysicsImpostor;\n          }), f.d(A, \"PhysicsJoint\", function() {\n            return _.PhysicsJoint;\n          }), f.d(A, \"DistanceJoint\", function() {\n            return _.DistanceJoint;\n          }), f.d(A, \"MotorEnabledJoint\", function() {\n            return _.MotorEnabledJoint;\n          }), f.d(A, \"HingeJoint\", function() {\n            return _.HingeJoint;\n          }), f.d(A, \"Hinge2Joint\", function() {\n            return _.Hinge2Joint;\n          }), f.d(A, \"CannonJSPlugin\", function() {\n            return _.CannonJSPlugin;\n          }), f.d(A, \"AmmoJSPlugin\", function() {\n            return _.AmmoJSPlugin;\n          }), f.d(A, \"OimoJSPlugin\", function() {\n            return _.OimoJSPlugin;\n          }), f.d(A, \"AnaglyphPostProcess\", function() {\n            return _.AnaglyphPostProcess;\n          }), f.d(A, \"BlackAndWhitePostProcess\", function() {\n            return _.BlackAndWhitePostProcess;\n          }), f.d(A, \"BloomEffect\", function() {\n            return _.BloomEffect;\n          }), f.d(A, \"BloomMergePostProcess\", function() {\n            return _.BloomMergePostProcess;\n          }), f.d(A, \"BlurPostProcess\", function() {\n            return _.BlurPostProcess;\n          }), f.d(A, \"ChromaticAberrationPostProcess\", function() {\n            return _.ChromaticAberrationPostProcess;\n          }), f.d(A, \"CircleOfConfusionPostProcess\", function() {\n            return _.CircleOfConfusionPostProcess;\n          }), f.d(A, \"ColorCorrectionPostProcess\", function() {\n            return _.ColorCorrectionPostProcess;\n          }), f.d(A, \"ConvolutionPostProcess\", function() {\n            return _.ConvolutionPostProcess;\n          }), f.d(A, \"DepthOfFieldBlurPostProcess\", function() {\n            return _.DepthOfFieldBlurPostProcess;\n          }), f.d(A, \"DepthOfFieldEffectBlurLevel\", function() {\n            return _.DepthOfFieldEffectBlurLevel;\n          }), f.d(A, \"DepthOfFieldEffect\", function() {\n            return _.DepthOfFieldEffect;\n          }), f.d(A, \"DepthOfFieldMergePostProcessOptions\", function() {\n            return _.DepthOfFieldMergePostProcessOptions;\n          }), f.d(A, \"DepthOfFieldMergePostProcess\", function() {\n            return _.DepthOfFieldMergePostProcess;\n          }), f.d(A, \"DisplayPassPostProcess\", function() {\n            return _.DisplayPassPostProcess;\n          }), f.d(A, \"ExtractHighlightsPostProcess\", function() {\n            return _.ExtractHighlightsPostProcess;\n          }), f.d(A, \"FilterPostProcess\", function() {\n            return _.FilterPostProcess;\n          }), f.d(A, \"FxaaPostProcess\", function() {\n            return _.FxaaPostProcess;\n          }), f.d(A, \"GrainPostProcess\", function() {\n            return _.GrainPostProcess;\n          }), f.d(A, \"HighlightsPostProcess\", function() {\n            return _.HighlightsPostProcess;\n          }), f.d(A, \"ImageProcessingPostProcess\", function() {\n            return _.ImageProcessingPostProcess;\n          }), f.d(A, \"MotionBlurPostProcess\", function() {\n            return _.MotionBlurPostProcess;\n          }), f.d(A, \"PassPostProcess\", function() {\n            return _.PassPostProcess;\n          }), f.d(A, \"PassCubePostProcess\", function() {\n            return _.PassCubePostProcess;\n          }), f.d(A, \"PostProcess\", function() {\n            return _.PostProcess;\n          }), f.d(A, \"PostProcessManager\", function() {\n            return _.PostProcessManager;\n          }), f.d(A, \"RefractionPostProcess\", function() {\n            return _.RefractionPostProcess;\n          }), f.d(A, \"DefaultRenderingPipeline\", function() {\n            return _.DefaultRenderingPipeline;\n          }), f.d(A, \"LensRenderingPipeline\", function() {\n            return _.LensRenderingPipeline;\n          }), f.d(A, \"SSAO2RenderingPipeline\", function() {\n            return _.SSAO2RenderingPipeline;\n          }), f.d(A, \"SSAORenderingPipeline\", function() {\n            return _.SSAORenderingPipeline;\n          }), f.d(A, \"StandardRenderingPipeline\", function() {\n            return _.StandardRenderingPipeline;\n          }), f.d(A, \"PostProcessRenderEffect\", function() {\n            return _.PostProcessRenderEffect;\n          }), f.d(A, \"PostProcessRenderPipeline\", function() {\n            return _.PostProcessRenderPipeline;\n          }), f.d(A, \"PostProcessRenderPipelineManager\", function() {\n            return _.PostProcessRenderPipelineManager;\n          }), f.d(A, \"PostProcessRenderPipelineManagerSceneComponent\", function() {\n            return _.PostProcessRenderPipelineManagerSceneComponent;\n          }), f.d(A, \"SharpenPostProcess\", function() {\n            return _.SharpenPostProcess;\n          }), f.d(A, \"StereoscopicInterlacePostProcessI\", function() {\n            return _.StereoscopicInterlacePostProcessI;\n          }), f.d(A, \"StereoscopicInterlacePostProcess\", function() {\n            return _.StereoscopicInterlacePostProcess;\n          }), f.d(A, \"TonemappingOperator\", function() {\n            return _.TonemappingOperator;\n          }), f.d(A, \"TonemapPostProcess\", function() {\n            return _.TonemapPostProcess;\n          }), f.d(A, \"VolumetricLightScatteringPostProcess\", function() {\n            return _.VolumetricLightScatteringPostProcess;\n          }), f.d(A, \"VRDistortionCorrectionPostProcess\", function() {\n            return _.VRDistortionCorrectionPostProcess;\n          }), f.d(A, \"VRMultiviewToSingleviewPostProcess\", function() {\n            return _.VRMultiviewToSingleviewPostProcess;\n          }), f.d(A, \"ScreenSpaceReflectionPostProcess\", function() {\n            return _.ScreenSpaceReflectionPostProcess;\n          }), f.d(A, \"ScreenSpaceCurvaturePostProcess\", function() {\n            return _.ScreenSpaceCurvaturePostProcess;\n          }), f.d(A, \"ReflectionProbe\", function() {\n            return _.ReflectionProbe;\n          }), f.d(A, \"BoundingBoxRenderer\", function() {\n            return _.BoundingBoxRenderer;\n          }), f.d(A, \"DepthRenderer\", function() {\n            return _.DepthRenderer;\n          }), f.d(A, \"DepthRendererSceneComponent\", function() {\n            return _.DepthRendererSceneComponent;\n          }), f.d(A, \"EdgesRenderer\", function() {\n            return _.EdgesRenderer;\n          }), f.d(A, \"LineEdgesRenderer\", function() {\n            return _.LineEdgesRenderer;\n          }), f.d(A, \"GeometryBufferRenderer\", function() {\n            return _.GeometryBufferRenderer;\n          }), f.d(A, \"GeometryBufferRendererSceneComponent\", function() {\n            return _.GeometryBufferRendererSceneComponent;\n          }), f.d(A, \"PrePassRenderer\", function() {\n            return _.PrePassRenderer;\n          }), f.d(A, \"PrePassRendererSceneComponent\", function() {\n            return _.PrePassRendererSceneComponent;\n          }), f.d(A, \"SubSurfaceSceneComponent\", function() {\n            return _.SubSurfaceSceneComponent;\n          }), f.d(A, \"OutlineRenderer\", function() {\n            return _.OutlineRenderer;\n          }), f.d(A, \"RenderingGroup\", function() {\n            return _.RenderingGroup;\n          }), f.d(A, \"RenderingGroupInfo\", function() {\n            return _.RenderingGroupInfo;\n          }), f.d(A, \"RenderingManager\", function() {\n            return _.RenderingManager;\n          }), f.d(A, \"UtilityLayerRenderer\", function() {\n            return _.UtilityLayerRenderer;\n          }), f.d(A, \"Scene\", function() {\n            return _.Scene;\n          }), f.d(A, \"SceneComponentConstants\", function() {\n            return _.SceneComponentConstants;\n          }), f.d(A, \"Stage\", function() {\n            return _.Stage;\n          }), f.d(A, \"Sprite\", function() {\n            return _.Sprite;\n          }), f.d(A, \"SpriteManager\", function() {\n            return _.SpriteManager;\n          }), f.d(A, \"SpriteMap\", function() {\n            return _.SpriteMap;\n          }), f.d(A, \"SpritePackedManager\", function() {\n            return _.SpritePackedManager;\n          }), f.d(A, \"SpriteSceneComponent\", function() {\n            return _.SpriteSceneComponent;\n          }), f.d(A, \"AlphaState\", function() {\n            return _.AlphaState;\n          }), f.d(A, \"DepthCullingState\", function() {\n            return _.DepthCullingState;\n          }), f.d(A, \"StencilState\", function() {\n            return _.StencilState;\n          }), f.d(A, \"AndOrNotEvaluator\", function() {\n            return _.AndOrNotEvaluator;\n          }), f.d(A, \"AssetTaskState\", function() {\n            return _.AssetTaskState;\n          }), f.d(A, \"AbstractAssetTask\", function() {\n            return _.AbstractAssetTask;\n          }), f.d(A, \"AssetsProgressEvent\", function() {\n            return _.AssetsProgressEvent;\n          }), f.d(A, \"ContainerAssetTask\", function() {\n            return _.ContainerAssetTask;\n          }), f.d(A, \"MeshAssetTask\", function() {\n            return _.MeshAssetTask;\n          }), f.d(A, \"TextFileAssetTask\", function() {\n            return _.TextFileAssetTask;\n          }), f.d(A, \"BinaryFileAssetTask\", function() {\n            return _.BinaryFileAssetTask;\n          }), f.d(A, \"ImageAssetTask\", function() {\n            return _.ImageAssetTask;\n          }), f.d(A, \"TextureAssetTask\", function() {\n            return _.TextureAssetTask;\n          }), f.d(A, \"CubeTextureAssetTask\", function() {\n            return _.CubeTextureAssetTask;\n          }), f.d(A, \"HDRCubeTextureAssetTask\", function() {\n            return _.HDRCubeTextureAssetTask;\n          }), f.d(A, \"EquiRectangularCubeTextureAssetTask\", function() {\n            return _.EquiRectangularCubeTextureAssetTask;\n          }), f.d(A, \"AssetsManager\", function() {\n            return _.AssetsManager;\n          }), f.d(A, \"BasisTranscodeConfiguration\", function() {\n            return _.BasisTranscodeConfiguration;\n          }), f.d(A, \"BasisTools\", function() {\n            return _.BasisTools;\n          }), f.d(A, \"DDSTools\", function() {\n            return _.DDSTools;\n          }), f.d(A, \"expandToProperty\", function() {\n            return _.expandToProperty;\n          }), f.d(A, \"serialize\", function() {\n            return _.serialize;\n          }), f.d(A, \"serializeAsTexture\", function() {\n            return _.serializeAsTexture;\n          }), f.d(A, \"serializeAsColor3\", function() {\n            return _.serializeAsColor3;\n          }), f.d(A, \"serializeAsFresnelParameters\", function() {\n            return _.serializeAsFresnelParameters;\n          }), f.d(A, \"serializeAsVector2\", function() {\n            return _.serializeAsVector2;\n          }), f.d(A, \"serializeAsVector3\", function() {\n            return _.serializeAsVector3;\n          }), f.d(A, \"serializeAsMeshReference\", function() {\n            return _.serializeAsMeshReference;\n          }), f.d(A, \"serializeAsColorCurves\", function() {\n            return _.serializeAsColorCurves;\n          }), f.d(A, \"serializeAsColor4\", function() {\n            return _.serializeAsColor4;\n          }), f.d(A, \"serializeAsImageProcessingConfiguration\", function() {\n            return _.serializeAsImageProcessingConfiguration;\n          }), f.d(A, \"serializeAsQuaternion\", function() {\n            return _.serializeAsQuaternion;\n          }), f.d(A, \"serializeAsMatrix\", function() {\n            return _.serializeAsMatrix;\n          }), f.d(A, \"serializeAsCameraReference\", function() {\n            return _.serializeAsCameraReference;\n          }), f.d(A, \"SerializationHelper\", function() {\n            return _.SerializationHelper;\n          }), f.d(A, \"Deferred\", function() {\n            return _.Deferred;\n          }), f.d(A, \"EnvironmentTextureTools\", function() {\n            return _.EnvironmentTextureTools;\n          }), f.d(A, \"MeshExploder\", function() {\n            return _.MeshExploder;\n          }), f.d(A, \"FilesInput\", function() {\n            return _.FilesInput;\n          }), f.d(A, \"CubeMapToSphericalPolynomialTools\", function() {\n            return _.CubeMapToSphericalPolynomialTools;\n          }), f.d(A, \"HDRTools\", function() {\n            return _.HDRTools;\n          }), f.d(A, \"PanoramaToCubeMapTools\", function() {\n            return _.PanoramaToCubeMapTools;\n          }), f.d(A, \"KhronosTextureContainer\", function() {\n            return _.KhronosTextureContainer;\n          }), f.d(A, \"EventState\", function() {\n            return _.EventState;\n          }), f.d(A, \"Observer\", function() {\n            return _.Observer;\n          }), f.d(A, \"MultiObserver\", function() {\n            return _.MultiObserver;\n          }), f.d(A, \"Observable\", function() {\n            return _.Observable;\n          }), f.d(A, \"PerformanceMonitor\", function() {\n            return _.PerformanceMonitor;\n          }), f.d(A, \"RollingAverage\", function() {\n            return _.RollingAverage;\n          }), f.d(A, \"PromisePolyfill\", function() {\n            return _.PromisePolyfill;\n          }), f.d(A, \"SceneOptimization\", function() {\n            return _.SceneOptimization;\n          }), f.d(A, \"TextureOptimization\", function() {\n            return _.TextureOptimization;\n          }), f.d(A, \"HardwareScalingOptimization\", function() {\n            return _.HardwareScalingOptimization;\n          }), f.d(A, \"ShadowsOptimization\", function() {\n            return _.ShadowsOptimization;\n          }), f.d(A, \"PostProcessesOptimization\", function() {\n            return _.PostProcessesOptimization;\n          }), f.d(A, \"LensFlaresOptimization\", function() {\n            return _.LensFlaresOptimization;\n          }), f.d(A, \"CustomOptimization\", function() {\n            return _.CustomOptimization;\n          }), f.d(A, \"ParticlesOptimization\", function() {\n            return _.ParticlesOptimization;\n          }), f.d(A, \"RenderTargetsOptimization\", function() {\n            return _.RenderTargetsOptimization;\n          }), f.d(A, \"MergeMeshesOptimization\", function() {\n            return _.MergeMeshesOptimization;\n          }), f.d(A, \"SceneOptimizerOptions\", function() {\n            return _.SceneOptimizerOptions;\n          }), f.d(A, \"SceneOptimizer\", function() {\n            return _.SceneOptimizer;\n          }), f.d(A, \"SceneSerializer\", function() {\n            return _.SceneSerializer;\n          }), f.d(A, \"SmartArray\", function() {\n            return _.SmartArray;\n          }), f.d(A, \"SmartArrayNoDuplicate\", function() {\n            return _.SmartArrayNoDuplicate;\n          }), f.d(A, \"StringDictionary\", function() {\n            return _.StringDictionary;\n          }), f.d(A, \"Tags\", function() {\n            return _.Tags;\n          }), f.d(A, \"TextureTools\", function() {\n            return _.TextureTools;\n          }), f.d(A, \"TGATools\", function() {\n            return _.TGATools;\n          }), f.d(A, \"Tools\", function() {\n            return _.Tools;\n          }), f.d(A, \"className\", function() {\n            return _.className;\n          }), f.d(A, \"AsyncLoop\", function() {\n            return _.AsyncLoop;\n          }), f.d(A, \"VideoRecorder\", function() {\n            return _.VideoRecorder;\n          }), f.d(A, \"JoystickAxis\", function() {\n            return _.JoystickAxis;\n          }), f.d(A, \"VirtualJoystick\", function() {\n            return _.VirtualJoystick;\n          }), f.d(A, \"WorkerPool\", function() {\n            return _.WorkerPool;\n          }), f.d(A, \"Logger\", function() {\n            return _.Logger;\n          }), f.d(A, \"_TypeStore\", function() {\n            return _._TypeStore;\n          }), f.d(A, \"FilesInputStore\", function() {\n            return _.FilesInputStore;\n          }), f.d(A, \"DeepCopier\", function() {\n            return _.DeepCopier;\n          }), f.d(A, \"PivotTools\", function() {\n            return _.PivotTools;\n          }), f.d(A, \"PrecisionDate\", function() {\n            return _.PrecisionDate;\n          }), f.d(A, \"ScreenshotTools\", function() {\n            return _.ScreenshotTools;\n          }), f.d(A, \"WebRequest\", function() {\n            return _.WebRequest;\n          }), f.d(A, \"InspectableType\", function() {\n            return _.InspectableType;\n          }), f.d(A, \"BRDFTextureTools\", function() {\n            return _.BRDFTextureTools;\n          }), f.d(A, \"RGBDTextureTools\", function() {\n            return _.RGBDTextureTools;\n          }), f.d(A, \"ColorGradient\", function() {\n            return _.ColorGradient;\n          }), f.d(A, \"Color3Gradient\", function() {\n            return _.Color3Gradient;\n          }), f.d(A, \"FactorGradient\", function() {\n            return _.FactorGradient;\n          }), f.d(A, \"GradientHelper\", function() {\n            return _.GradientHelper;\n          }), f.d(A, \"PerfCounter\", function() {\n            return _.PerfCounter;\n          }), f.d(A, \"RetryStrategy\", function() {\n            return _.RetryStrategy;\n          }), f.d(A, \"CanvasGenerator\", function() {\n            return _.CanvasGenerator;\n          }), f.d(A, \"LoadFileError\", function() {\n            return _.LoadFileError;\n          }), f.d(A, \"RequestFileError\", function() {\n            return _.RequestFileError;\n          }), f.d(A, \"ReadFileError\", function() {\n            return _.ReadFileError;\n          }), f.d(A, \"FileTools\", function() {\n            return _.FileTools;\n          }), f.d(A, \"StringTools\", function() {\n            return _.StringTools;\n          }), f.d(A, \"DataReader\", function() {\n            return _.DataReader;\n          }), f.d(A, \"MinMaxReducer\", function() {\n            return _.MinMaxReducer;\n          }), f.d(A, \"DepthReducer\", function() {\n            return _.DepthReducer;\n          }), f.d(A, \"DataStorage\", function() {\n            return _.DataStorage;\n          }), f.d(A, \"SceneRecorder\", function() {\n            return _.SceneRecorder;\n          }), f.d(A, \"KhronosTextureContainer2\", function() {\n            return _.KhronosTextureContainer2;\n          }), f.d(A, \"Trajectory\", function() {\n            return _.Trajectory;\n          }), f.d(A, \"TrajectoryClassifier\", function() {\n            return _.TrajectoryClassifier;\n          }), f.d(A, \"TimerState\", function() {\n            return _.TimerState;\n          }), f.d(A, \"setAndStartTimer\", function() {\n            return _.setAndStartTimer;\n          }), f.d(A, \"AdvancedTimer\", function() {\n            return _.AdvancedTimer;\n          }), f.d(A, \"CopyTools\", function() {\n            return _.CopyTools;\n          }), f.d(A, \"WebXRCamera\", function() {\n            return _.WebXRCamera;\n          }), f.d(A, \"WebXREnterExitUIButton\", function() {\n            return _.WebXREnterExitUIButton;\n          }), f.d(A, \"WebXREnterExitUIOptions\", function() {\n            return _.WebXREnterExitUIOptions;\n          }), f.d(A, \"WebXREnterExitUI\", function() {\n            return _.WebXREnterExitUI;\n          }), f.d(A, \"WebXRExperienceHelper\", function() {\n            return _.WebXRExperienceHelper;\n          }), f.d(A, \"WebXRInput\", function() {\n            return _.WebXRInput;\n          }), f.d(A, \"WebXRInputSource\", function() {\n            return _.WebXRInputSource;\n          }), f.d(A, \"WebXRManagedOutputCanvasOptions\", function() {\n            return _.WebXRManagedOutputCanvasOptions;\n          }), f.d(A, \"WebXRManagedOutputCanvas\", function() {\n            return _.WebXRManagedOutputCanvas;\n          }), f.d(A, \"WebXRState\", function() {\n            return _.WebXRState;\n          }), f.d(A, \"WebXRTrackingState\", function() {\n            return _.WebXRTrackingState;\n          }), f.d(A, \"WebXRSessionManager\", function() {\n            return _.WebXRSessionManager;\n          }), f.d(A, \"WebXRDefaultExperienceOptions\", function() {\n            return _.WebXRDefaultExperienceOptions;\n          }), f.d(A, \"WebXRDefaultExperience\", function() {\n            return _.WebXRDefaultExperience;\n          }), f.d(A, \"WebXRFeatureName\", function() {\n            return _.WebXRFeatureName;\n          }), f.d(A, \"WebXRFeaturesManager\", function() {\n            return _.WebXRFeaturesManager;\n          }), f.d(A, \"WebXRAbstractFeature\", function() {\n            return _.WebXRAbstractFeature;\n          }), f.d(A, \"WebXRHitTestLegacy\", function() {\n            return _.WebXRHitTestLegacy;\n          }), f.d(A, \"WebXRAnchorSystem\", function() {\n            return _.WebXRAnchorSystem;\n          }), f.d(A, \"WebXRPlaneDetector\", function() {\n            return _.WebXRPlaneDetector;\n          }), f.d(A, \"WebXRBackgroundRemover\", function() {\n            return _.WebXRBackgroundRemover;\n          }), f.d(A, \"WebXRMotionControllerTeleportation\", function() {\n            return _.WebXRMotionControllerTeleportation;\n          }), f.d(A, \"WebXRControllerPointerSelection\", function() {\n            return _.WebXRControllerPointerSelection;\n          }), f.d(A, \"IWebXRControllerPhysicsOptions\", function() {\n            return _.IWebXRControllerPhysicsOptions;\n          }), f.d(A, \"WebXRControllerPhysics\", function() {\n            return _.WebXRControllerPhysics;\n          }), f.d(A, \"WebXRHitTest\", function() {\n            return _.WebXRHitTest;\n          }), f.d(A, \"WebXRFeaturePointSystem\", function() {\n            return _.WebXRFeaturePointSystem;\n          }), f.d(A, \"WebXRHand\", function() {\n            return _.WebXRHand;\n          }), f.d(A, \"WebXRHandTracking\", function() {\n            return _.WebXRHandTracking;\n          }), f.d(A, \"WebXRAbstractMotionController\", function() {\n            return _.WebXRAbstractMotionController;\n          }), f.d(A, \"WebXRControllerComponent\", function() {\n            return _.WebXRControllerComponent;\n          }), f.d(A, \"WebXRGenericTriggerMotionController\", function() {\n            return _.WebXRGenericTriggerMotionController;\n          }), f.d(A, \"WebXRMicrosoftMixedRealityController\", function() {\n            return _.WebXRMicrosoftMixedRealityController;\n          }), f.d(A, \"WebXRMotionControllerManager\", function() {\n            return _.WebXRMotionControllerManager;\n          }), f.d(A, \"WebXROculusTouchMotionController\", function() {\n            return _.WebXROculusTouchMotionController;\n          }), f.d(A, \"WebXRHTCViveMotionController\", function() {\n            return _.WebXRHTCViveMotionController;\n          }), f.d(A, \"WebXRProfiledMotionController\", function() {\n            return _.WebXRProfiledMotionController;\n          });\n          var u = V !== void 0 ? V : typeof window < \"u\" ? window : void 0;\n          if (u !== void 0) {\n            u.BABYLON = I, u.BABYLON = u.BABYLON || {};\n            var I = u.BABYLON;\n            I.Debug = I.Debug || {};\n            var O = [];\n            for (var x in C)\n              I.Debug[x] = C[x], O.push(x);\n            for (var x in _)\n              I[x] = _[x];\n          }\n          var m = { AxesViewer: C.AxesViewer, BoneAxesViewer: C.BoneAxesViewer, PhysicsViewer: C.PhysicsViewer, SkeletonViewer: C.SkeletonViewer };\n        }).call(this, f(159));\n      }]);\n    });\n  }(Yc)), Yc.exports;\n}\nvar ir = sf(), cf = { exports: {} };\n(function(an, ln) {\n  (function(Be, A) {\n    an.exports = A(sf());\n  })(typeof self < \"u\" ? self : typeof Gr < \"u\" ? Gr : Gr, function(Be) {\n    return function(A) {\n      var f = {};\n      function V(_) {\n        if (f[_])\n          return f[_].exports;\n        var C = f[_] = { i: _, l: !1, exports: {} };\n        return A[_].call(C.exports, C, C.exports, V), C.l = !0, C.exports;\n      }\n      return V.m = A, V.c = f, V.d = function(_, C, u) {\n        V.o(_, C) || Object.defineProperty(_, C, { enumerable: !0, get: u });\n      }, V.r = function(_) {\n        typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(_, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(_, \"__esModule\", { value: !0 });\n      }, V.t = function(_, C) {\n        if (1 & C && (_ = V(_)), 8 & C || 4 & C && typeof _ == \"object\" && _ && _.__esModule)\n          return _;\n        var u = /* @__PURE__ */ Object.create(null);\n        if (V.r(u), Object.defineProperty(u, \"default\", { enumerable: !0, value: _ }), 2 & C && typeof _ != \"string\")\n          for (var I in _)\n            V.d(u, I, (function(O) {\n              return _[O];\n            }).bind(null, I));\n        return u;\n      }, V.n = function(_) {\n        var C = _ && _.__esModule ? function() {\n          return _.default;\n        } : function() {\n          return _;\n        };\n        return V.d(C, \"a\", C), C;\n      }, V.o = function(_, C) {\n        return Object.prototype.hasOwnProperty.call(_, C);\n      }, V.p = \"\", V(V.s = 20);\n    }([function(A, f) {\n      A.exports = Be;\n    }, function(A, f, V) {\n      V.d(f, \"a\", function() {\n        return u;\n      }), V.d(f, \"b\", function() {\n        return I;\n      });\n      var _ = V(0), C = V(2), u = function() {\n        function O() {\n        }\n        return O.Get = function(x, m, c) {\n          if (!m || c == null || !m[c])\n            throw new Error(x + \": Failed to find index (\" + c + \")\");\n          return m[c];\n        }, O.Assign = function(x) {\n          if (x)\n            for (var m = 0; m < x.length; m++)\n              x[m].index = m;\n        }, O;\n      }(), I = function() {\n        function O(x) {\n          this._completePromises = new Array(), this._forAssetContainer = !1, this._babylonLights = [], this._disableInstancedMesh = 0, this._disposed = !1, this._state = null, this._extensions = new Array(), this._defaultBabylonMaterialData = {}, this._parent = x;\n        }\n        return O.RegisterExtension = function(x, m) {\n          O.UnregisterExtension(x) && _.Logger.Warn(\"Extension with the name '\" + x + \"' already exists\"), O._RegisteredExtensions[x] = { factory: m };\n        }, O.UnregisterExtension = function(x) {\n          return !!O._RegisteredExtensions[x] && (delete O._RegisteredExtensions[x], !0);\n        }, Object.defineProperty(O.prototype, \"state\", { get: function() {\n          return this._state;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"gltf\", { get: function() {\n          return this._gltf;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"bin\", { get: function() {\n          return this._bin;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"parent\", { get: function() {\n          return this._parent;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"babylonScene\", { get: function() {\n          return this._babylonScene;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"rootBabylonMesh\", { get: function() {\n          return this._rootBabylonMesh;\n        }, enumerable: !1, configurable: !0 }), O.prototype.dispose = function() {\n          if (!this._disposed) {\n            for (var x in this._disposed = !0, this._completePromises.length = 0, this._extensions) {\n              var m = this._extensions[x];\n              m.dispose && m.dispose(), delete this._extensions[x];\n            }\n            this._gltf = null, this._babylonScene = null, this._rootBabylonMesh = null, this._parent.dispose();\n          }\n        }, O.prototype.importMeshAsync = function(x, m, c, T, S, E, g) {\n          var l = this;\n          return Promise.resolve().then(function() {\n            l._babylonScene = m, l._rootUrl = S, l._fileName = g || \"scene\", l._forAssetContainer = c, l._loadData(T);\n            var h = null;\n            if (x) {\n              var v = {};\n              if (l._gltf.nodes)\n                for (var b = 0, D = l._gltf.nodes; b < D.length; b++) {\n                  var w = D[b];\n                  w.name && (v[w.name] = w.index);\n                }\n              h = (x instanceof Array ? x : [x]).map(function(N) {\n                var M = v[N];\n                if (M === void 0)\n                  throw new Error(\"Failed to find node '\" + N + \"'\");\n                return M;\n              });\n            }\n            return l._loadAsync(h, function() {\n              return { meshes: l._getMeshes(), particleSystems: [], skeletons: l._getSkeletons(), animationGroups: l._getAnimationGroups(), lights: l._babylonLights, transformNodes: l._getTransformNodes(), geometries: l._getGeometries() };\n            });\n          });\n        }, O.prototype.loadAsync = function(x, m, c, T, S) {\n          var E = this;\n          return Promise.resolve().then(function() {\n            return E._babylonScene = x, E._rootUrl = c, E._fileName = S || \"scene\", E._loadData(m), E._loadAsync(null, function() {\n            });\n          });\n        }, O.prototype._loadAsync = function(x, m) {\n          var c = this;\n          return Promise.resolve().then(function() {\n            c._uniqueRootUrl = c._rootUrl.indexOf(\"file:\") === -1 && c._fileName ? c._rootUrl : \"\" + c._rootUrl + Date.now() + \"/\", c._loadExtensions(), c._checkExtensions();\n            var T = C.GLTFLoaderState[C.GLTFLoaderState.LOADING] + \" => \" + C.GLTFLoaderState[C.GLTFLoaderState.READY], S = C.GLTFLoaderState[C.GLTFLoaderState.LOADING] + \" => \" + C.GLTFLoaderState[C.GLTFLoaderState.COMPLETE];\n            c._parent._startPerformanceCounter(T), c._parent._startPerformanceCounter(S), c._setState(C.GLTFLoaderState.LOADING), c._extensionsOnLoading();\n            var E = new Array(), g = c._babylonScene.blockMaterialDirtyMechanism;\n            if (c._babylonScene.blockMaterialDirtyMechanism = !0, x)\n              E.push(c.loadSceneAsync(\"/nodes\", { nodes: x, index: -1 }));\n            else if (c._gltf.scene != null || c._gltf.scenes && c._gltf.scenes[0]) {\n              var l = u.Get(\"/scene\", c._gltf.scenes, c._gltf.scene || 0);\n              E.push(c.loadSceneAsync(\"/scenes/\" + l.index, l));\n            }\n            if (c.parent.loadAllMaterials && c._gltf.materials)\n              for (var h = 0; h < c._gltf.materials.length; ++h) {\n                var v = c._gltf.materials[h], b = \"/materials/\" + h, D = _.Material.TriangleFillMode;\n                E.push(c._loadMaterialAsync(b, v, null, D, function(N) {\n                }));\n              }\n            c._babylonScene.blockMaterialDirtyMechanism = g, c._parent.compileMaterials && E.push(c._compileMaterialsAsync()), c._parent.compileShadowGenerators && E.push(c._compileShadowGeneratorsAsync());\n            var w = Promise.all(E).then(function() {\n              return c._rootBabylonMesh && c._rootBabylonMesh.setEnabled(!0), c._extensionsOnReady(), c._setState(C.GLTFLoaderState.READY), c._startAnimations(), m();\n            });\n            return w.then(function() {\n              c._parent._endPerformanceCounter(T), _.Tools.SetImmediate(function() {\n                c._disposed || Promise.all(c._completePromises).then(function() {\n                  c._parent._endPerformanceCounter(S), c._setState(C.GLTFLoaderState.COMPLETE), c._parent.onCompleteObservable.notifyObservers(void 0), c._parent.onCompleteObservable.clear(), c.dispose();\n                }, function(N) {\n                  c._parent.onErrorObservable.notifyObservers(N), c._parent.onErrorObservable.clear(), c.dispose();\n                });\n              });\n            }), w;\n          }).catch(function(T) {\n            throw c._disposed || (c._parent.onErrorObservable.notifyObservers(T), c._parent.onErrorObservable.clear(), c.dispose()), T;\n          });\n        }, O.prototype._loadData = function(x) {\n          if (this._gltf = x.json, this._setupData(), x.bin) {\n            var m = this._gltf.buffers;\n            if (m && m[0] && !m[0].uri) {\n              var c = m[0];\n              (c.byteLength < x.bin.byteLength - 3 || c.byteLength > x.bin.byteLength) && _.Logger.Warn(\"Binary buffer length (\" + c.byteLength + \") from JSON does not match chunk length (\" + x.bin.byteLength + \")\"), this._bin = x.bin;\n            } else\n              _.Logger.Warn(\"Unexpected BIN chunk\");\n          }\n        }, O.prototype._setupData = function() {\n          if (u.Assign(this._gltf.accessors), u.Assign(this._gltf.animations), u.Assign(this._gltf.buffers), u.Assign(this._gltf.bufferViews), u.Assign(this._gltf.cameras), u.Assign(this._gltf.images), u.Assign(this._gltf.materials), u.Assign(this._gltf.meshes), u.Assign(this._gltf.nodes), u.Assign(this._gltf.samplers), u.Assign(this._gltf.scenes), u.Assign(this._gltf.skins), u.Assign(this._gltf.textures), this._gltf.nodes) {\n            for (var x = {}, m = 0, c = this._gltf.nodes; m < c.length; m++)\n              if ((h = c[m]).children)\n                for (var T = 0, S = h.children; T < S.length; T++)\n                  x[S[T]] = h.index;\n            for (var E = this._createRootNode(), g = 0, l = this._gltf.nodes; g < l.length; g++) {\n              var h, v = x[(h = l[g]).index];\n              h.parent = v === void 0 ? E : this._gltf.nodes[v];\n            }\n          }\n        }, O.prototype._loadExtensions = function() {\n          for (var x in O._RegisteredExtensions) {\n            var m = O._RegisteredExtensions[x].factory(this);\n            m.name !== x && _.Logger.Warn(\"The name of the glTF loader extension instance does not match the registered name: \" + m.name + \" !== \" + x), this._extensions.push(m), this._parent.onExtensionLoadedObservable.notifyObservers(m);\n          }\n          this._extensions.sort(function(c, T) {\n            return (c.order || Number.MAX_VALUE) - (T.order || Number.MAX_VALUE);\n          }), this._parent.onExtensionLoadedObservable.clear();\n        }, O.prototype._checkExtensions = function() {\n          if (this._gltf.extensionsRequired)\n            for (var x = function(S) {\n              if (!m._extensions.some(function(E) {\n                return E.name === S && E.enabled;\n              }))\n                throw new Error(\"Require extension \" + S + \" is not available\");\n            }, m = this, c = 0, T = this._gltf.extensionsRequired; c < T.length; c++)\n              x(T[c]);\n        }, O.prototype._setState = function(x) {\n          this._state = x, this.log(C.GLTFLoaderState[this._state]);\n        }, O.prototype._createRootNode = function() {\n          this._babylonScene._blockEntityCollection = this._forAssetContainer, this._rootBabylonMesh = new _.Mesh(\"__root__\", this._babylonScene), this._babylonScene._blockEntityCollection = !1, this._rootBabylonMesh.setEnabled(!1);\n          var x = { _babylonTransformNode: this._rootBabylonMesh, index: -1 };\n          switch (this._parent.coordinateSystemMode) {\n            case C.GLTFLoaderCoordinateSystemMode.AUTO:\n              this._babylonScene.useRightHandedSystem || (x.rotation = [0, 1, 0, 0], x.scale = [1, 1, -1], O._LoadTransform(x, this._rootBabylonMesh));\n              break;\n            case C.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:\n              this._babylonScene.useRightHandedSystem = !0;\n              break;\n            default:\n              throw new Error(\"Invalid coordinate system mode (\" + this._parent.coordinateSystemMode + \")\");\n          }\n          return this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh), x;\n        }, O.prototype.loadSceneAsync = function(x, m) {\n          var c = this, T = this._extensionsLoadSceneAsync(x, m);\n          if (T)\n            return T;\n          var S = new Array();\n          if (this.logOpen(x + \" \" + (m.name || \"\")), m.nodes)\n            for (var E = 0, g = m.nodes; E < g.length; E++) {\n              var l = g[E], h = u.Get(x + \"/nodes/\" + l, this._gltf.nodes, l);\n              S.push(this.loadNodeAsync(\"/nodes/\" + h.index, h, function(N) {\n                N.parent = c._rootBabylonMesh;\n              }));\n            }\n          if (this._gltf.nodes) {\n            for (var v = 0, b = this._gltf.nodes; v < b.length; v++)\n              if ((h = b[v])._babylonTransformNode && h._babylonBones)\n                for (var D = 0, w = h._babylonBones; D < w.length; D++)\n                  w[D].linkTransformNode(h._babylonTransformNode);\n          }\n          return S.push(this._loadAnimationsAsync()), this.logClose(), Promise.all(S).then(function() {\n          });\n        }, O.prototype._forEachPrimitive = function(x, m) {\n          if (x._primitiveBabylonMeshes)\n            for (var c = 0, T = x._primitiveBabylonMeshes; c < T.length; c++)\n              m(T[c]);\n        }, O.prototype._getGeometries = function() {\n          var x = new Array(), m = this._gltf.nodes;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              this._forEachPrimitive(S, function(E) {\n                var g = E.geometry;\n                g && x.indexOf(g) === -1 && x.push(g);\n              });\n            }\n          return x;\n        }, O.prototype._getMeshes = function() {\n          var x = new Array();\n          x.push(this._rootBabylonMesh);\n          var m = this._gltf.nodes;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              this._forEachPrimitive(S, function(E) {\n                x.push(E);\n              });\n            }\n          return x;\n        }, O.prototype._getTransformNodes = function() {\n          var x = new Array(), m = this._gltf.nodes;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              S._babylonTransformNode && S._babylonTransformNode.getClassName() === \"TransformNode\" && x.push(S._babylonTransformNode);\n            }\n          return x;\n        }, O.prototype._getSkeletons = function() {\n          var x = new Array(), m = this._gltf.skins;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              S._data && x.push(S._data.babylonSkeleton);\n            }\n          return x;\n        }, O.prototype._getAnimationGroups = function() {\n          var x = new Array(), m = this._gltf.animations;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              S._babylonAnimationGroup && x.push(S._babylonAnimationGroup);\n            }\n          return x;\n        }, O.prototype._startAnimations = function() {\n          switch (this._parent.animationStartMode) {\n            case C.GLTFLoaderAnimationStartMode.NONE:\n              break;\n            case C.GLTFLoaderAnimationStartMode.FIRST:\n              (x = this._getAnimationGroups()).length !== 0 && x[0].start(!0);\n              break;\n            case C.GLTFLoaderAnimationStartMode.ALL:\n              for (var x, m = 0, c = x = this._getAnimationGroups(); m < c.length; m++)\n                c[m].start(!0);\n              break;\n            default:\n              return void _.Logger.Error(\"Invalid animation start mode (\" + this._parent.animationStartMode + \")\");\n          }\n        }, O.prototype.loadNodeAsync = function(x, m, c) {\n          var T = this;\n          c === void 0 && (c = function() {\n          });\n          var S = this._extensionsLoadNodeAsync(x, m, c);\n          if (S)\n            return S;\n          if (m._babylonTransformNode)\n            throw new Error(x + \": Invalid recursive node hierarchy\");\n          var E = new Array();\n          this.logOpen(x + \" \" + (m.name || \"\"));\n          var g = function(v) {\n            if (O.AddPointerMetadata(v, x), O._LoadTransform(m, v), m.camera != null) {\n              var b = u.Get(x + \"/camera\", T._gltf.cameras, m.camera);\n              E.push(T.loadCameraAsync(\"/cameras/\" + b.index, b, function(U) {\n                U.parent = v;\n              }));\n            }\n            if (m.children)\n              for (var D = 0, w = m.children; D < w.length; D++) {\n                var N = w[D], M = u.Get(x + \"/children/\" + N, T._gltf.nodes, N);\n                E.push(T.loadNodeAsync(\"/nodes/\" + M.index, M, function(U) {\n                  U.parent = v;\n                }));\n              }\n            c(v);\n          };\n          if (m.mesh == null) {\n            var l = m.name || \"node\" + m.index;\n            this._babylonScene._blockEntityCollection = this._forAssetContainer, m._babylonTransformNode = new _.TransformNode(l, this._babylonScene), this._babylonScene._blockEntityCollection = !1, g(m._babylonTransformNode);\n          } else {\n            var h = u.Get(x + \"/mesh\", this._gltf.meshes, m.mesh);\n            E.push(this._loadMeshAsync(\"/meshes/\" + h.index, m, h, g));\n          }\n          return this.logClose(), Promise.all(E).then(function() {\n            return T._forEachPrimitive(m, function(v) {\n              v.geometry && v.geometry.useBoundingInfoFromGeometry ? v._updateBoundingInfo() : v.refreshBoundingInfo(!0);\n            }), m._babylonTransformNode;\n          });\n        }, O.prototype._loadMeshAsync = function(x, m, c, T) {\n          var S = c.primitives;\n          if (!S || !S.length)\n            throw new Error(x + \": Primitives are missing\");\n          S[0].index == null && u.Assign(S);\n          var E = new Array();\n          this.logOpen(x + \" \" + (c.name || \"\"));\n          var g = m.name || \"node\" + m.index;\n          if (S.length === 1) {\n            var l = c.primitives[0];\n            E.push(this._loadMeshPrimitiveAsync(x + \"/primitives/\" + l.index, g, m, c, l, function(D) {\n              m._babylonTransformNode = D, m._primitiveBabylonMeshes = [D];\n            }));\n          } else {\n            this._babylonScene._blockEntityCollection = this._forAssetContainer, m._babylonTransformNode = new _.TransformNode(g, this._babylonScene), this._babylonScene._blockEntityCollection = !1, m._primitiveBabylonMeshes = [];\n            for (var h = 0, v = S; h < v.length; h++)\n              l = v[h], E.push(this._loadMeshPrimitiveAsync(x + \"/primitives/\" + l.index, g + \"_primitive\" + l.index, m, c, l, function(D) {\n                D.parent = m._babylonTransformNode, m._primitiveBabylonMeshes.push(D);\n              }));\n          }\n          if (m.skin != null) {\n            var b = u.Get(x + \"/skin\", this._gltf.skins, m.skin);\n            E.push(this._loadSkinAsync(\"/skins/\" + b.index, m, b));\n          }\n          return T(m._babylonTransformNode), this.logClose(), Promise.all(E).then(function() {\n            return m._babylonTransformNode;\n          });\n        }, O.prototype._loadMeshPrimitiveAsync = function(x, m, c, T, S, E) {\n          var g = this, l = this._extensionsLoadMeshPrimitiveAsync(x, m, c, T, S, E);\n          if (l)\n            return l;\n          this.logOpen(\"\" + x);\n          var h, v, b = this._disableInstancedMesh === 0 && this._parent.createInstances && c.skin == null && !T.primitives[0].targets;\n          if (b && S._instanceData)\n            h = S._instanceData.babylonSourceMesh.createInstance(m), v = S._instanceData.promise;\n          else {\n            var D = new Array();\n            this._babylonScene._blockEntityCollection = this._forAssetContainer;\n            var w = new _.Mesh(m, this._babylonScene);\n            this._babylonScene._blockEntityCollection = !1, w.overrideMaterialSideOrientation = this._babylonScene.useRightHandedSystem ? _.Material.CounterClockWiseSideOrientation : _.Material.ClockWiseSideOrientation, this._createMorphTargets(x, c, T, S, w), D.push(this._loadVertexDataAsync(x, S, w).then(function(X) {\n              return g._loadMorphTargetsAsync(x, S, w, X).then(function() {\n                g._babylonScene._blockEntityCollection = g._forAssetContainer, X.applyToMesh(w), g._babylonScene._blockEntityCollection = !1;\n              });\n            }));\n            var N = O._GetDrawMode(x, S.mode);\n            if (S.material == null) {\n              var M = this._defaultBabylonMaterialData[N];\n              M || (M = this._createDefaultMaterial(\"__GLTFLoader._default\", N), this._parent.onMaterialLoadedObservable.notifyObservers(M), this._defaultBabylonMaterialData[N] = M), w.material = M;\n            } else {\n              var U = u.Get(x + \"/material\", this._gltf.materials, S.material);\n              D.push(this._loadMaterialAsync(\"/materials/\" + U.index, U, w, N, function(X) {\n                w.material = X;\n              }));\n            }\n            v = Promise.all(D), b && (S._instanceData = { babylonSourceMesh: w, promise: v }), h = w;\n          }\n          return O.AddPointerMetadata(h, x), this._parent.onMeshLoadedObservable.notifyObservers(h), E(h), this.logClose(), v.then(function() {\n            return h;\n          });\n        }, O.prototype._loadVertexDataAsync = function(x, m, c) {\n          var T = this, S = this._extensionsLoadVertexDataAsync(x, m, c);\n          if (S)\n            return S;\n          var E = m.attributes;\n          if (!E)\n            throw new Error(x + \": Attributes are missing\");\n          var g = new Array(), l = new _.Geometry(c.name, this._babylonScene);\n          if (m.indices == null)\n            c.isUnIndexed = !0;\n          else {\n            var h = u.Get(x + \"/indices\", this._gltf.accessors, m.indices);\n            g.push(this._loadIndicesAccessorAsync(\"/accessors/\" + h.index, h).then(function(b) {\n              l.setIndices(b);\n            }));\n          }\n          var v = function(b, D, w) {\n            if (E[b] != null) {\n              c._delayInfo = c._delayInfo || [], c._delayInfo.indexOf(D) === -1 && c._delayInfo.push(D);\n              var N = u.Get(x + \"/attributes/\" + b, T._gltf.accessors, E[b]);\n              g.push(T._loadVertexAccessorAsync(\"/accessors/\" + N.index, N, D).then(function(M) {\n                if (M.getKind() === _.VertexBuffer.PositionKind && !T.parent.alwaysComputeBoundingBox && !c.skeleton) {\n                  var U = N.min, X = N.max;\n                  if (U !== void 0 && X !== void 0) {\n                    var j = _.TmpVectors.Vector3[0], ne = _.TmpVectors.Vector3[1];\n                    j.copyFromFloats.apply(j, U), ne.copyFromFloats.apply(ne, X), l._boundingInfo = new _.BoundingInfo(j, ne), l.useBoundingInfoFromGeometry = !0;\n                  }\n                }\n                l.setVerticesBuffer(M, N.count);\n              })), D == _.VertexBuffer.MatricesIndicesExtraKind && (c.numBoneInfluencers = 8), w && w(N);\n            }\n          };\n          return v(\"POSITION\", _.VertexBuffer.PositionKind), v(\"NORMAL\", _.VertexBuffer.NormalKind), v(\"TANGENT\", _.VertexBuffer.TangentKind), v(\"TEXCOORD_0\", _.VertexBuffer.UVKind), v(\"TEXCOORD_1\", _.VertexBuffer.UV2Kind), v(\"JOINTS_0\", _.VertexBuffer.MatricesIndicesKind), v(\"WEIGHTS_0\", _.VertexBuffer.MatricesWeightsKind), v(\"JOINTS_1\", _.VertexBuffer.MatricesIndicesExtraKind), v(\"WEIGHTS_1\", _.VertexBuffer.MatricesWeightsExtraKind), v(\"COLOR_0\", _.VertexBuffer.ColorKind, function(b) {\n            b.type === \"VEC4\" && (c.hasVertexAlpha = !0);\n          }), Promise.all(g).then(function() {\n            return l;\n          });\n        }, O.prototype._createMorphTargets = function(x, m, c, T, S) {\n          if (T.targets) {\n            if (m._numMorphTargets == null)\n              m._numMorphTargets = T.targets.length;\n            else if (T.targets.length !== m._numMorphTargets)\n              throw new Error(x + \": Primitives do not have the same number of targets\");\n            var E = c.extras ? c.extras.targetNames : null;\n            S.morphTargetManager = new _.MorphTargetManager(S.getScene());\n            for (var g = 0; g < T.targets.length; g++) {\n              var l = m.weights ? m.weights[g] : c.weights ? c.weights[g] : 0, h = E ? E[g] : \"morphTarget\" + g;\n              S.morphTargetManager.addTarget(new _.MorphTarget(h, l, S.getScene()));\n            }\n          }\n        }, O.prototype._loadMorphTargetsAsync = function(x, m, c, T) {\n          if (!m.targets)\n            return Promise.resolve();\n          for (var S = new Array(), E = c.morphTargetManager, g = 0; g < E.numTargets; g++) {\n            var l = E.getTarget(g);\n            S.push(this._loadMorphTargetVertexDataAsync(x + \"/targets/\" + g, T, m.targets[g], l));\n          }\n          return Promise.all(S).then(function() {\n          });\n        }, O.prototype._loadMorphTargetVertexDataAsync = function(x, m, c, T) {\n          var S = this, E = new Array(), g = function(l, h, v) {\n            if (c[l] != null) {\n              var b = m.getVertexBuffer(h);\n              if (b) {\n                var D = u.Get(x + \"/\" + l, S._gltf.accessors, c[l]);\n                E.push(S._loadFloatAccessorAsync(\"/accessors/\" + D.index, D).then(function(w) {\n                  v(b, w);\n                }));\n              }\n            }\n          };\n          return g(\"POSITION\", _.VertexBuffer.PositionKind, function(l, h) {\n            var v = new Float32Array(h.length);\n            l.forEach(h.length, function(b, D) {\n              v[D] = h[D] + b;\n            }), T.setPositions(v);\n          }), g(\"NORMAL\", _.VertexBuffer.NormalKind, function(l, h) {\n            var v = new Float32Array(h.length);\n            l.forEach(v.length, function(b, D) {\n              v[D] = h[D] + b;\n            }), T.setNormals(v);\n          }), g(\"TANGENT\", _.VertexBuffer.TangentKind, function(l, h) {\n            var v = new Float32Array(h.length / 3 * 4), b = 0;\n            l.forEach(h.length / 3 * 4, function(D, w) {\n              (w + 1) % 4 != 0 && (v[b] = h[b] + D, b++);\n            }), T.setTangents(v);\n          }), Promise.all(E).then(function() {\n          });\n        }, O._LoadTransform = function(x, m) {\n          if (x.skin == null) {\n            var c = _.Vector3.Zero(), T = _.Quaternion.Identity(), S = _.Vector3.One();\n            x.matrix ? _.Matrix.FromArray(x.matrix).decompose(S, T, c) : (x.translation && (c = _.Vector3.FromArray(x.translation)), x.rotation && (T = _.Quaternion.FromArray(x.rotation)), x.scale && (S = _.Vector3.FromArray(x.scale))), m.position = c, m.rotationQuaternion = T, m.scaling = S;\n          }\n        }, O.prototype._loadSkinAsync = function(x, m, c) {\n          var T = this, S = this._extensionsLoadSkinAsync(x, m, c);\n          if (S)\n            return S;\n          var E = function(v) {\n            T._forEachPrimitive(m, function(b) {\n              b.skeleton = v;\n            });\n          };\n          if (c._data)\n            return E(c._data.babylonSkeleton), c._data.promise;\n          var g = \"skeleton\" + c.index;\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var l = new _.Skeleton(c.name || g, g, this._babylonScene);\n          this._babylonScene._blockEntityCollection = !1, l.overrideMesh = this._rootBabylonMesh, this._loadBones(x, c, l), E(l);\n          var h = this._loadSkinInverseBindMatricesDataAsync(x, c).then(function(v) {\n            T._updateBoneMatrices(l, v);\n          });\n          return c._data = { babylonSkeleton: l, promise: h }, h;\n        }, O.prototype._loadBones = function(x, m, c) {\n          for (var T = {}, S = 0, E = m.joints; S < E.length; S++) {\n            var g = E[S], l = u.Get(x + \"/joints/\" + g, this._gltf.nodes, g);\n            this._loadBone(l, m, c, T);\n          }\n        }, O.prototype._loadBone = function(x, m, c, T) {\n          var S = T[x.index];\n          if (S)\n            return S;\n          var E = null;\n          x.parent && x.parent._babylonTransformNode !== this._rootBabylonMesh && (E = this._loadBone(x.parent, m, c, T));\n          var g = m.joints.indexOf(x.index);\n          return S = new _.Bone(x.name || \"joint\" + x.index, c, E, this._getNodeMatrix(x), null, null, g), T[x.index] = S, x._babylonBones = x._babylonBones || [], x._babylonBones.push(S), S;\n        }, O.prototype._loadSkinInverseBindMatricesDataAsync = function(x, m) {\n          if (m.inverseBindMatrices == null)\n            return Promise.resolve(null);\n          var c = u.Get(x + \"/inverseBindMatrices\", this._gltf.accessors, m.inverseBindMatrices);\n          return this._loadFloatAccessorAsync(\"/accessors/\" + c.index, c);\n        }, O.prototype._updateBoneMatrices = function(x, m) {\n          for (var c = 0, T = x.bones; c < T.length; c++) {\n            var S = T[c], E = _.Matrix.Identity(), g = S._index;\n            m && g !== -1 && (_.Matrix.FromArrayToRef(m, 16 * g, E), E.invertToRef(E));\n            var l = S.getParent();\n            l && E.multiplyToRef(l.getInvertedAbsoluteTransform(), E), S.setBindPose(E), S.updateMatrix(E, !1, !1), S._updateDifferenceMatrix(void 0, !1);\n          }\n        }, O.prototype._getNodeMatrix = function(x) {\n          return x.matrix ? _.Matrix.FromArray(x.matrix) : _.Matrix.Compose(x.scale ? _.Vector3.FromArray(x.scale) : _.Vector3.One(), x.rotation ? _.Quaternion.FromArray(x.rotation) : _.Quaternion.Identity(), x.translation ? _.Vector3.FromArray(x.translation) : _.Vector3.Zero());\n        }, O.prototype.loadCameraAsync = function(x, m, c) {\n          c === void 0 && (c = function() {\n          });\n          var T = this._extensionsLoadCameraAsync(x, m, c);\n          if (T)\n            return T;\n          var S = new Array();\n          this.logOpen(x + \" \" + (m.name || \"\")), this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var E = new _.FreeCamera(m.name || \"camera\" + m.index, _.Vector3.Zero(), this._babylonScene, !1);\n          switch (this._babylonScene._blockEntityCollection = !1, E.ignoreParentScaling = !0, E.rotation = new _.Vector3(0, Math.PI, 0), m.type) {\n            case \"perspective\":\n              var g = m.perspective;\n              if (!g)\n                throw new Error(x + \": Camera perspective properties are missing\");\n              E.fov = g.yfov, E.minZ = g.znear, E.maxZ = g.zfar || Number.MAX_VALUE;\n              break;\n            case \"orthographic\":\n              if (!m.orthographic)\n                throw new Error(x + \": Camera orthographic properties are missing\");\n              E.mode = _.Camera.ORTHOGRAPHIC_CAMERA, E.orthoLeft = -m.orthographic.xmag, E.orthoRight = m.orthographic.xmag, E.orthoBottom = -m.orthographic.ymag, E.orthoTop = m.orthographic.ymag, E.minZ = m.orthographic.znear, E.maxZ = m.orthographic.zfar;\n              break;\n            default:\n              throw new Error(x + \": Invalid camera type (\" + m.type + \")\");\n          }\n          return O.AddPointerMetadata(E, x), this._parent.onCameraLoadedObservable.notifyObservers(E), c(E), this.logClose(), Promise.all(S).then(function() {\n            return E;\n          });\n        }, O.prototype._loadAnimationsAsync = function() {\n          var x = this._gltf.animations;\n          if (!x)\n            return Promise.resolve();\n          for (var m = new Array(), c = 0; c < x.length; c++) {\n            var T = x[c];\n            m.push(this.loadAnimationAsync(\"/animations/\" + T.index, T));\n          }\n          return Promise.all(m).then(function() {\n          });\n        }, O.prototype.loadAnimationAsync = function(x, m) {\n          var c = this._extensionsLoadAnimationAsync(x, m);\n          if (c)\n            return c;\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var T = new _.AnimationGroup(m.name || \"animation\" + m.index, this._babylonScene);\n          this._babylonScene._blockEntityCollection = !1, m._babylonAnimationGroup = T;\n          var S = new Array();\n          u.Assign(m.channels), u.Assign(m.samplers);\n          for (var E = 0, g = m.channels; E < g.length; E++) {\n            var l = g[E];\n            S.push(this._loadAnimationChannelAsync(x + \"/channels/\" + l.index, x, m, l, T));\n          }\n          return Promise.all(S).then(function() {\n            return T.normalize(0), T;\n          });\n        }, O.prototype._loadAnimationChannelAsync = function(x, m, c, T, S, E) {\n          var g = this;\n          if (E === void 0 && (E = null), T.target.node == null)\n            return Promise.resolve();\n          var l = u.Get(x + \"/target/node\", this._gltf.nodes, T.target.node);\n          if (T.target.path === \"weights\" && !l._numMorphTargets || T.target.path !== \"weights\" && !l._babylonTransformNode)\n            return Promise.resolve();\n          var h = u.Get(x + \"/sampler\", c.samplers, T.sampler);\n          return this._loadAnimationSamplerAsync(m + \"/samplers/\" + T.sampler, h).then(function(v) {\n            var b, D;\n            switch (T.target.path) {\n              case \"translation\":\n                b = \"position\", D = _.Animation.ANIMATIONTYPE_VECTOR3;\n                break;\n              case \"rotation\":\n                b = \"rotationQuaternion\", D = _.Animation.ANIMATIONTYPE_QUATERNION;\n                break;\n              case \"scale\":\n                b = \"scaling\", D = _.Animation.ANIMATIONTYPE_VECTOR3;\n                break;\n              case \"weights\":\n                b = \"influence\", D = _.Animation.ANIMATIONTYPE_FLOAT;\n                break;\n              default:\n                throw new Error(x + \"/target/path: Invalid value (\" + T.target.path + \")\");\n            }\n            var w, N, M = 0;\n            switch (b) {\n              case \"position\":\n                w = function() {\n                  var pe = _.Vector3.FromArray(v.output, M);\n                  return M += 3, pe;\n                };\n                break;\n              case \"rotationQuaternion\":\n                w = function() {\n                  var pe = _.Quaternion.FromArray(v.output, M);\n                  return M += 4, pe;\n                };\n                break;\n              case \"scaling\":\n                w = function() {\n                  var pe = _.Vector3.FromArray(v.output, M);\n                  return M += 3, pe;\n                };\n                break;\n              case \"influence\":\n                w = function() {\n                  for (var pe = new Array(l._numMorphTargets), ae = 0; ae < l._numMorphTargets; ae++)\n                    pe[ae] = v.output[M++];\n                  return pe;\n                };\n            }\n            switch (v.interpolation) {\n              case \"STEP\":\n                N = function(pe) {\n                  return { frame: v.input[pe], value: w(), interpolation: _.AnimationKeyInterpolation.STEP };\n                };\n                break;\n              case \"LINEAR\":\n                N = function(pe) {\n                  return { frame: v.input[pe], value: w() };\n                };\n                break;\n              case \"CUBICSPLINE\":\n                N = function(pe) {\n                  return { frame: v.input[pe], inTangent: w(), value: w(), outTangent: w() };\n                };\n            }\n            for (var U = new Array(v.input.length), X = 0; X < v.input.length; X++)\n              U[X] = N(X);\n            if (b === \"influence\")\n              for (var j = function(pe) {\n                var ae = S.name + \"_channel\" + S.targetedAnimations.length, ee = new _.Animation(ae, b, 1, D);\n                ee.setKeys(U.map(function(K) {\n                  return { frame: K.frame, inTangent: K.inTangent ? K.inTangent[pe] : void 0, value: K.value[pe], outTangent: K.outTangent ? K.outTangent[pe] : void 0 };\n                })), g._forEachPrimitive(l, function(K) {\n                  var $ = K.morphTargetManager.getTarget(pe), L = ee.clone();\n                  $.animations.push(L), S.addTargetedAnimation(L, $);\n                });\n              }, ne = 0; ne < l._numMorphTargets; ne++)\n                j(ne);\n            else {\n              var te = S.name + \"_channel\" + S.targetedAnimations.length, de = new _.Animation(te, b, 1, D);\n              de.setKeys(U), E != null && E.animations != null ? (E.animations.push(de), S.addTargetedAnimation(de, E)) : (l._babylonTransformNode.animations.push(de), S.addTargetedAnimation(de, l._babylonTransformNode));\n            }\n          });\n        }, O.prototype._loadAnimationSamplerAsync = function(x, m) {\n          if (m._data)\n            return m._data;\n          var c = m.interpolation || \"LINEAR\";\n          switch (c) {\n            case \"STEP\":\n            case \"LINEAR\":\n            case \"CUBICSPLINE\":\n              break;\n            default:\n              throw new Error(x + \"/interpolation: Invalid value (\" + m.interpolation + \")\");\n          }\n          var T = u.Get(x + \"/input\", this._gltf.accessors, m.input), S = u.Get(x + \"/output\", this._gltf.accessors, m.output);\n          return m._data = Promise.all([this._loadFloatAccessorAsync(\"/accessors/\" + T.index, T), this._loadFloatAccessorAsync(\"/accessors/\" + S.index, S)]).then(function(E) {\n            var g = E[0], l = E[1];\n            return { input: g, interpolation: c, output: l };\n          }), m._data;\n        }, O.prototype._loadBufferAsync = function(x, m, c, T) {\n          var S = this._extensionsLoadBufferAsync(x, m, c, T);\n          if (S)\n            return S;\n          if (!m._data)\n            if (m.uri)\n              m._data = this.loadUriAsync(x + \"/uri\", m, m.uri);\n            else {\n              if (!this._bin)\n                throw new Error(x + \": Uri is missing or the binary glTF is missing its binary chunk\");\n              m._data = this._bin.readAsync(0, m.byteLength);\n            }\n          return m._data.then(function(E) {\n            try {\n              return new Uint8Array(E.buffer, E.byteOffset + c, T);\n            } catch (g) {\n              throw new Error(x + \": \" + g.message);\n            }\n          });\n        }, O.prototype.loadBufferViewAsync = function(x, m) {\n          var c = this._extensionsLoadBufferViewAsync(x, m);\n          if (c)\n            return c;\n          if (m._data)\n            return m._data;\n          var T = u.Get(x + \"/buffer\", this._gltf.buffers, m.buffer);\n          return m._data = this._loadBufferAsync(\"/buffers/\" + T.index, T, m.byteOffset || 0, m.byteLength), m._data;\n        }, O.prototype._loadAccessorAsync = function(x, m, c) {\n          var T = this;\n          if (m._data)\n            return m._data;\n          var S = O._GetNumComponents(x, m.type), E = S * _.VertexBuffer.GetTypeByteLength(m.componentType), g = S * m.count;\n          if (m.bufferView == null)\n            m._data = Promise.resolve(new c(g));\n          else {\n            var l = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n            m._data = this.loadBufferViewAsync(\"/bufferViews/\" + l.index, l).then(function(v) {\n              if (m.componentType !== 5126 || m.normalized || l.byteStride && l.byteStride !== E) {\n                var b = new c(g);\n                return _.VertexBuffer.ForEach(v, m.byteOffset || 0, l.byteStride || E, S, m.componentType, b.length, m.normalized || !1, function(D, w) {\n                  b[w] = D;\n                }), b;\n              }\n              return O._GetTypedArray(x, m.componentType, v, m.byteOffset, g);\n            });\n          }\n          if (m.sparse) {\n            var h = m.sparse;\n            m._data = m._data.then(function(v) {\n              var b = v, D = u.Get(x + \"/sparse/indices/bufferView\", T._gltf.bufferViews, h.indices.bufferView), w = u.Get(x + \"/sparse/values/bufferView\", T._gltf.bufferViews, h.values.bufferView);\n              return Promise.all([T.loadBufferViewAsync(\"/bufferViews/\" + D.index, D), T.loadBufferViewAsync(\"/bufferViews/\" + w.index, w)]).then(function(N) {\n                var M, U = N[0], X = N[1], j = O._GetTypedArray(x + \"/sparse/indices\", h.indices.componentType, U, h.indices.byteOffset, h.count), ne = S * h.count;\n                if (m.componentType !== 5126 || m.normalized) {\n                  var te = O._GetTypedArray(x + \"/sparse/values\", m.componentType, X, h.values.byteOffset, ne);\n                  M = new c(ne), _.VertexBuffer.ForEach(te, 0, E, S, m.componentType, M.length, m.normalized || !1, function(K, $) {\n                    M[$] = K;\n                  });\n                } else\n                  M = O._GetTypedArray(x + \"/sparse/values\", m.componentType, X, h.values.byteOffset, ne);\n                for (var de = 0, pe = 0; pe < j.length; pe++)\n                  for (var ae = j[pe] * S, ee = 0; ee < S; ee++)\n                    b[ae++] = M[de++];\n                return b;\n              });\n            });\n          }\n          return m._data;\n        }, O.prototype._loadFloatAccessorAsync = function(x, m) {\n          return this._loadAccessorAsync(x, m, Float32Array);\n        }, O.prototype._loadIndicesAccessorAsync = function(x, m) {\n          if (m.type !== \"SCALAR\")\n            throw new Error(x + \"/type: Invalid value \" + m.type);\n          if (m.componentType !== 5121 && m.componentType !== 5123 && m.componentType !== 5125)\n            throw new Error(x + \"/componentType: Invalid value \" + m.componentType);\n          if (m._data)\n            return m._data;\n          if (m.sparse) {\n            var c = O._GetTypedArrayConstructor(x + \"/componentType\", m.componentType);\n            m._data = this._loadAccessorAsync(x, m, c);\n          } else {\n            var T = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n            m._data = this.loadBufferViewAsync(\"/bufferViews/\" + T.index, T).then(function(S) {\n              return O._GetTypedArray(x, m.componentType, S, m.byteOffset, m.count);\n            });\n          }\n          return m._data;\n        }, O.prototype._loadVertexBufferViewAsync = function(x, m) {\n          var c = this;\n          return x._babylonBuffer || (x._babylonBuffer = this.loadBufferViewAsync(\"/bufferViews/\" + x.index, x).then(function(T) {\n            return new _.Buffer(c._babylonScene.getEngine(), T, !1);\n          })), x._babylonBuffer;\n        }, O.prototype._loadVertexAccessorAsync = function(x, m, c) {\n          var T = this;\n          if (m._babylonVertexBuffer)\n            return m._babylonVertexBuffer;\n          if (m.sparse)\n            m._babylonVertexBuffer = this._loadFloatAccessorAsync(\"/accessors/\" + m.index, m).then(function(E) {\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1);\n            });\n          else if (m.byteOffset && m.byteOffset % _.VertexBuffer.GetTypeByteLength(m.componentType) != 0)\n            _.Logger.Warn(\"Accessor byte offset is not a multiple of component type byte length\"), m._babylonVertexBuffer = this._loadFloatAccessorAsync(\"/accessors/\" + m.index, m).then(function(E) {\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1);\n            });\n          else if (c === _.VertexBuffer.MatricesIndicesKind || c === _.VertexBuffer.MatricesIndicesExtraKind)\n            m._babylonVertexBuffer = this._loadFloatAccessorAsync(\"/accessors/\" + m.index, m).then(function(E) {\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1);\n            });\n          else {\n            var S = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n            m._babylonVertexBuffer = this._loadVertexBufferViewAsync(S, c).then(function(E) {\n              var g = O._GetNumComponents(x, m.type);\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1, !1, S.byteStride, !1, m.byteOffset, g, m.componentType, m.normalized, !0, 1, !0);\n            });\n          }\n          return m._babylonVertexBuffer;\n        }, O.prototype._loadMaterialMetallicRoughnessPropertiesAsync = function(x, m, c) {\n          if (!(c instanceof _.PBRMaterial))\n            throw new Error(x + \": Material type not supported\");\n          var T = new Array();\n          return m && (m.baseColorFactor ? (c.albedoColor = _.Color3.FromArray(m.baseColorFactor), c.alpha = m.baseColorFactor[3]) : c.albedoColor = _.Color3.White(), c.metallic = m.metallicFactor == null ? 1 : m.metallicFactor, c.roughness = m.roughnessFactor == null ? 1 : m.roughnessFactor, m.baseColorTexture && T.push(this.loadTextureInfoAsync(x + \"/baseColorTexture\", m.baseColorTexture, function(S) {\n            S.name = c.name + \" (Base Color)\", c.albedoTexture = S;\n          })), m.metallicRoughnessTexture && (m.metallicRoughnessTexture.nonColorData = !0, T.push(this.loadTextureInfoAsync(x + \"/metallicRoughnessTexture\", m.metallicRoughnessTexture, function(S) {\n            S.name = c.name + \" (Metallic Roughness)\", c.metallicTexture = S;\n          })), c.useMetallnessFromMetallicTextureBlue = !0, c.useRoughnessFromMetallicTextureGreen = !0, c.useRoughnessFromMetallicTextureAlpha = !1)), Promise.all(T).then(function() {\n          });\n        }, O.prototype._loadMaterialAsync = function(x, m, c, T, S) {\n          S === void 0 && (S = function() {\n          });\n          var E = this._extensionsLoadMaterialAsync(x, m, c, T, S);\n          if (E)\n            return E;\n          m._data = m._data || {};\n          var g = m._data[T];\n          if (!g) {\n            this.logOpen(x + \" \" + (m.name || \"\"));\n            var l = this.createMaterial(x, m, T);\n            g = { babylonMaterial: l, babylonMeshes: [], promise: this.loadMaterialPropertiesAsync(x, m, l) }, m._data[T] = g, O.AddPointerMetadata(l, x), this._parent.onMaterialLoadedObservable.notifyObservers(l), this.logClose();\n          }\n          return c && (g.babylonMeshes.push(c), c.onDisposeObservable.addOnce(function() {\n            var h = g.babylonMeshes.indexOf(c);\n            h !== -1 && g.babylonMeshes.splice(h, 1);\n          })), S(g.babylonMaterial), g.promise.then(function() {\n            return g.babylonMaterial;\n          });\n        }, O.prototype._createDefaultMaterial = function(x, m) {\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var c = new _.PBRMaterial(x, this._babylonScene);\n          return this._babylonScene._blockEntityCollection = !1, c.fillMode = m, c.enableSpecularAntiAliasing = !0, c.useRadianceOverAlpha = !this._parent.transparencyAsCoverage, c.useSpecularOverAlpha = !this._parent.transparencyAsCoverage, c.transparencyMode = _.PBRMaterial.PBRMATERIAL_OPAQUE, c.metallic = 1, c.roughness = 1, c;\n        }, O.prototype.createMaterial = function(x, m, c) {\n          var T = this._extensionsCreateMaterial(x, m, c);\n          if (T)\n            return T;\n          var S = m.name || \"material\" + m.index;\n          return this._createDefaultMaterial(S, c);\n        }, O.prototype.loadMaterialPropertiesAsync = function(x, m, c) {\n          var T = this._extensionsLoadMaterialPropertiesAsync(x, m, c);\n          if (T)\n            return T;\n          var S = new Array();\n          return S.push(this.loadMaterialBasePropertiesAsync(x, m, c)), m.pbrMetallicRoughness && S.push(this._loadMaterialMetallicRoughnessPropertiesAsync(x + \"/pbrMetallicRoughness\", m.pbrMetallicRoughness, c)), this.loadMaterialAlphaProperties(x, m, c), Promise.all(S).then(function() {\n          });\n        }, O.prototype.loadMaterialBasePropertiesAsync = function(x, m, c) {\n          if (!(c instanceof _.PBRMaterial))\n            throw new Error(x + \": Material type not supported\");\n          var T = new Array();\n          return c.emissiveColor = m.emissiveFactor ? _.Color3.FromArray(m.emissiveFactor) : new _.Color3(0, 0, 0), m.doubleSided && (c.backFaceCulling = !1, c.twoSidedLighting = !0), m.normalTexture && (m.normalTexture.nonColorData = !0, T.push(this.loadTextureInfoAsync(x + \"/normalTexture\", m.normalTexture, function(S) {\n            S.name = c.name + \" (Normal)\", c.bumpTexture = S;\n          })), c.invertNormalMapX = !this._babylonScene.useRightHandedSystem, c.invertNormalMapY = this._babylonScene.useRightHandedSystem, m.normalTexture.scale != null && (c.bumpTexture.level = m.normalTexture.scale), c.forceIrradianceInFragment = !0), m.occlusionTexture && (m.occlusionTexture.nonColorData = !0, T.push(this.loadTextureInfoAsync(x + \"/occlusionTexture\", m.occlusionTexture, function(S) {\n            S.name = c.name + \" (Occlusion)\", c.ambientTexture = S;\n          })), c.useAmbientInGrayScale = !0, m.occlusionTexture.strength != null && (c.ambientTextureStrength = m.occlusionTexture.strength)), m.emissiveTexture && T.push(this.loadTextureInfoAsync(x + \"/emissiveTexture\", m.emissiveTexture, function(S) {\n            S.name = c.name + \" (Emissive)\", c.emissiveTexture = S;\n          })), Promise.all(T).then(function() {\n          });\n        }, O.prototype.loadMaterialAlphaProperties = function(x, m, c) {\n          if (!(c instanceof _.PBRMaterial))\n            throw new Error(x + \": Material type not supported\");\n          switch (m.alphaMode || \"OPAQUE\") {\n            case \"OPAQUE\":\n              c.transparencyMode = _.PBRMaterial.PBRMATERIAL_OPAQUE;\n              break;\n            case \"MASK\":\n              c.transparencyMode = _.PBRMaterial.PBRMATERIAL_ALPHATEST, c.alphaCutOff = m.alphaCutoff == null ? 0.5 : m.alphaCutoff, c.albedoTexture && (c.albedoTexture.hasAlpha = !0);\n              break;\n            case \"BLEND\":\n              c.transparencyMode = _.PBRMaterial.PBRMATERIAL_ALPHABLEND, c.albedoTexture && (c.albedoTexture.hasAlpha = !0, c.useAlphaFromAlbedoTexture = !0);\n              break;\n            default:\n              throw new Error(x + \"/alphaMode: Invalid value (\" + m.alphaMode + \")\");\n          }\n        }, O.prototype.loadTextureInfoAsync = function(x, m, c) {\n          var T = this;\n          c === void 0 && (c = function() {\n          });\n          var S = this._extensionsLoadTextureInfoAsync(x, m, c);\n          if (S)\n            return S;\n          if (this.logOpen(\"\" + x), m.texCoord >= 2)\n            throw new Error(x + \"/texCoord: Invalid value (\" + m.texCoord + \")\");\n          var E = u.Get(x + \"/index\", this._gltf.textures, m.index);\n          E._textureInfo = m;\n          var g = this._loadTextureAsync(\"/textures/\" + m.index, E, function(l) {\n            l.coordinatesIndex = m.texCoord || 0, O.AddPointerMetadata(l, x), T._parent.onTextureLoadedObservable.notifyObservers(l), c(l);\n          });\n          return this.logClose(), g;\n        }, O.prototype._loadTextureAsync = function(x, m, c) {\n          c === void 0 && (c = function() {\n          });\n          var T = this._extensionsLoadTextureAsync(x, m, c);\n          if (T)\n            return T;\n          this.logOpen(x + \" \" + (m.name || \"\"));\n          var S = m.sampler == null ? O.DefaultSampler : u.Get(x + \"/sampler\", this._gltf.samplers, m.sampler), E = u.Get(x + \"/source\", this._gltf.images, m.source), g = this._createTextureAsync(x, S, E, c);\n          return this.logClose(), g;\n        }, O.prototype._createTextureAsync = function(x, m, c, T, S) {\n          var E = this;\n          T === void 0 && (T = function() {\n          });\n          var g = this._loadSampler(\"/samplers/\" + m.index, m), l = new Array(), h = new _.Deferred();\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var v = new _.Texture(null, this._babylonScene, g.noMipMaps, !1, g.samplingMode, function() {\n            E._disposed || h.resolve();\n          }, function(b, D) {\n            E._disposed || h.reject(new Error(x + \": \" + (D && D.message ? D.message : b || \"Failed to load texture\")));\n          }, void 0, void 0, void 0, c.mimeType, S);\n          return this._babylonScene._blockEntityCollection = !1, l.push(h.promise), l.push(this.loadImageAsync(\"/images/\" + c.index, c).then(function(b) {\n            var D = c.uri || E._fileName + \"#image\" + c.index, w = \"data:\" + E._uniqueRootUrl + D;\n            v.updateURL(w, b);\n          })), v.wrapU = g.wrapU, v.wrapV = g.wrapV, T(v), Promise.all(l).then(function() {\n            return v;\n          });\n        }, O.prototype._loadSampler = function(x, m) {\n          return m._data || (m._data = { noMipMaps: m.minFilter === 9728 || m.minFilter === 9729, samplingMode: O._GetTextureSamplingMode(x, m), wrapU: O._GetTextureWrapMode(x + \"/wrapS\", m.wrapS), wrapV: O._GetTextureWrapMode(x + \"/wrapT\", m.wrapT) }), m._data;\n        }, O.prototype.loadImageAsync = function(x, m) {\n          if (!m._data) {\n            if (this.logOpen(x + \" \" + (m.name || \"\")), m.uri)\n              m._data = this.loadUriAsync(x + \"/uri\", m, m.uri);\n            else {\n              var c = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n              m._data = this.loadBufferViewAsync(\"/bufferViews/\" + c.index, c);\n            }\n            this.logClose();\n          }\n          return m._data;\n        }, O.prototype.loadUriAsync = function(x, m, c) {\n          var T = this, S = this._extensionsLoadUriAsync(x, m, c);\n          if (S)\n            return S;\n          if (!O._ValidateUri(c))\n            throw new Error(x + \": '\" + c + \"' is invalid\");\n          if (_.Tools.IsBase64(c)) {\n            var E = new Uint8Array(_.Tools.DecodeBase64(c));\n            return this.log(\"Decoded \" + c.substr(0, 64) + \"... (\" + E.length + \" bytes)\"), Promise.resolve(E);\n          }\n          return this.log(\"Loading \" + c), this._parent.preprocessUrlAsync(this._rootUrl + c).then(function(g) {\n            return new Promise(function(l, h) {\n              T._parent._loadFile(g, T._babylonScene, function(v) {\n                T._disposed || (T.log(\"Loaded \" + c + \" (\" + v.byteLength + \" bytes)\"), l(new Uint8Array(v)));\n              }, !0, function(v) {\n                h(new _.LoadFileError(x + \": Failed to load '\" + c + \"'\" + (v ? \": \" + v.status + \" \" + v.statusText : \"\"), v));\n              });\n            });\n          });\n        }, O.AddPointerMetadata = function(x, m) {\n          var c = x.metadata = x.metadata || {}, T = c.gltf = c.gltf || {};\n          (T.pointers = T.pointers || []).push(m);\n        }, O._GetTextureWrapMode = function(x, m) {\n          switch (m = m ?? 10497) {\n            case 33071:\n              return _.Texture.CLAMP_ADDRESSMODE;\n            case 33648:\n              return _.Texture.MIRROR_ADDRESSMODE;\n            case 10497:\n              return _.Texture.WRAP_ADDRESSMODE;\n            default:\n              return _.Logger.Warn(x + \": Invalid value (\" + m + \")\"), _.Texture.WRAP_ADDRESSMODE;\n          }\n        }, O._GetTextureSamplingMode = function(x, m) {\n          var c = m.magFilter == null ? 9729 : m.magFilter, T = m.minFilter == null ? 9987 : m.minFilter;\n          if (c === 9729)\n            switch (T) {\n              case 9728:\n                return _.Texture.LINEAR_NEAREST;\n              case 9729:\n                return _.Texture.LINEAR_LINEAR;\n              case 9984:\n                return _.Texture.LINEAR_NEAREST_MIPNEAREST;\n              case 9985:\n                return _.Texture.LINEAR_LINEAR_MIPNEAREST;\n              case 9986:\n                return _.Texture.LINEAR_NEAREST_MIPLINEAR;\n              case 9987:\n                return _.Texture.LINEAR_LINEAR_MIPLINEAR;\n              default:\n                return _.Logger.Warn(x + \"/minFilter: Invalid value (\" + T + \")\"), _.Texture.LINEAR_LINEAR_MIPLINEAR;\n            }\n          else\n            switch (c !== 9728 && _.Logger.Warn(x + \"/magFilter: Invalid value (\" + c + \")\"), T) {\n              case 9728:\n                return _.Texture.NEAREST_NEAREST;\n              case 9729:\n                return _.Texture.NEAREST_LINEAR;\n              case 9984:\n                return _.Texture.NEAREST_NEAREST_MIPNEAREST;\n              case 9985:\n                return _.Texture.NEAREST_LINEAR_MIPNEAREST;\n              case 9986:\n                return _.Texture.NEAREST_NEAREST_MIPLINEAR;\n              case 9987:\n                return _.Texture.NEAREST_LINEAR_MIPLINEAR;\n              default:\n                return _.Logger.Warn(x + \"/minFilter: Invalid value (\" + T + \")\"), _.Texture.NEAREST_NEAREST_MIPNEAREST;\n            }\n        }, O._GetTypedArrayConstructor = function(x, m) {\n          switch (m) {\n            case 5120:\n              return Int8Array;\n            case 5121:\n              return Uint8Array;\n            case 5122:\n              return Int16Array;\n            case 5123:\n              return Uint16Array;\n            case 5125:\n              return Uint32Array;\n            case 5126:\n              return Float32Array;\n            default:\n              throw new Error(x + \": Invalid component type \" + m);\n          }\n        }, O._GetTypedArray = function(x, m, c, T, S) {\n          var E = c.buffer;\n          T = c.byteOffset + (T || 0);\n          var g = O._GetTypedArrayConstructor(x + \"/componentType\", m);\n          try {\n            return new g(E, T, S);\n          } catch (l) {\n            throw new Error(x + \": \" + l);\n          }\n        }, O._GetNumComponents = function(x, m) {\n          switch (m) {\n            case \"SCALAR\":\n              return 1;\n            case \"VEC2\":\n              return 2;\n            case \"VEC3\":\n              return 3;\n            case \"VEC4\":\n            case \"MAT2\":\n              return 4;\n            case \"MAT3\":\n              return 9;\n            case \"MAT4\":\n              return 16;\n          }\n          throw new Error(x + \": Invalid type (\" + m + \")\");\n        }, O._ValidateUri = function(x) {\n          return _.Tools.IsBase64(x) || x.indexOf(\"..\") === -1;\n        }, O._GetDrawMode = function(x, m) {\n          switch (m == null && (m = 4), m) {\n            case 0:\n              return _.Material.PointListDrawMode;\n            case 1:\n              return _.Material.LineListDrawMode;\n            case 2:\n              return _.Material.LineLoopDrawMode;\n            case 3:\n              return _.Material.LineStripDrawMode;\n            case 4:\n              return _.Material.TriangleFillMode;\n            case 5:\n              return _.Material.TriangleStripDrawMode;\n            case 6:\n              return _.Material.TriangleFanDrawMode;\n          }\n          throw new Error(x + \": Invalid mesh primitive mode (\" + m + \")\");\n        }, O.prototype._compileMaterialsAsync = function() {\n          var x = this;\n          this._parent._startPerformanceCounter(\"Compile materials\");\n          var m = new Array();\n          if (this._gltf.materials)\n            for (var c = 0, T = this._gltf.materials; c < T.length; c++) {\n              var S = T[c];\n              if (S._data)\n                for (var E in S._data)\n                  for (var g = S._data[E], l = 0, h = g.babylonMeshes; l < h.length; l++) {\n                    var v = h[l];\n                    v.computeWorldMatrix(!0);\n                    var b = g.babylonMaterial;\n                    m.push(b.forceCompilationAsync(v)), m.push(b.forceCompilationAsync(v, { useInstances: !0 })), this._parent.useClipPlane && (m.push(b.forceCompilationAsync(v, { clipPlane: !0 })), m.push(b.forceCompilationAsync(v, { clipPlane: !0, useInstances: !0 })));\n                  }\n            }\n          return Promise.all(m).then(function() {\n            x._parent._endPerformanceCounter(\"Compile materials\");\n          });\n        }, O.prototype._compileShadowGeneratorsAsync = function() {\n          var x = this;\n          this._parent._startPerformanceCounter(\"Compile shadow generators\");\n          for (var m = new Array(), c = 0, T = this._babylonScene.lights; c < T.length; c++) {\n            var S = T[c].getShadowGenerator();\n            S && m.push(S.forceCompilationAsync());\n          }\n          return Promise.all(m).then(function() {\n            x._parent._endPerformanceCounter(\"Compile shadow generators\");\n          });\n        }, O.prototype._forEachExtensions = function(x) {\n          for (var m = 0, c = this._extensions; m < c.length; m++) {\n            var T = c[m];\n            T.enabled && x(T);\n          }\n        }, O.prototype._applyExtensions = function(x, m, c) {\n          for (var T = 0, S = this._extensions; T < S.length; T++) {\n            var E = S[T];\n            if (E.enabled) {\n              var g = E.name + \".\" + m, l = x;\n              l._activeLoaderExtensionFunctions = l._activeLoaderExtensionFunctions || {};\n              var h = l._activeLoaderExtensionFunctions;\n              if (!h[g]) {\n                h[g] = !0;\n                try {\n                  var v = c(E);\n                  if (v)\n                    return v;\n                } finally {\n                  delete h[g];\n                }\n              }\n            }\n          }\n          return null;\n        }, O.prototype._extensionsOnLoading = function() {\n          this._forEachExtensions(function(x) {\n            return x.onLoading && x.onLoading();\n          });\n        }, O.prototype._extensionsOnReady = function() {\n          this._forEachExtensions(function(x) {\n            return x.onReady && x.onReady();\n          });\n        }, O.prototype._extensionsLoadSceneAsync = function(x, m) {\n          return this._applyExtensions(m, \"loadScene\", function(c) {\n            return c.loadSceneAsync && c.loadSceneAsync(x, m);\n          });\n        }, O.prototype._extensionsLoadNodeAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadNode\", function(T) {\n            return T.loadNodeAsync && T.loadNodeAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadCameraAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadCamera\", function(T) {\n            return T.loadCameraAsync && T.loadCameraAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadVertexDataAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadVertexData\", function(T) {\n            return T._loadVertexDataAsync && T._loadVertexDataAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadMeshPrimitiveAsync = function(x, m, c, T, S, E) {\n          return this._applyExtensions(S, \"loadMeshPrimitive\", function(g) {\n            return g._loadMeshPrimitiveAsync && g._loadMeshPrimitiveAsync(x, m, c, T, S, E);\n          });\n        }, O.prototype._extensionsLoadMaterialAsync = function(x, m, c, T, S) {\n          return this._applyExtensions(m, \"loadMaterial\", function(E) {\n            return E._loadMaterialAsync && E._loadMaterialAsync(x, m, c, T, S);\n          });\n        }, O.prototype._extensionsCreateMaterial = function(x, m, c) {\n          return this._applyExtensions(m, \"createMaterial\", function(T) {\n            return T.createMaterial && T.createMaterial(x, m, c);\n          });\n        }, O.prototype._extensionsLoadMaterialPropertiesAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadMaterialProperties\", function(T) {\n            return T.loadMaterialPropertiesAsync && T.loadMaterialPropertiesAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadTextureInfoAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadTextureInfo\", function(T) {\n            return T.loadTextureInfoAsync && T.loadTextureInfoAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadTextureAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadTexture\", function(T) {\n            return T._loadTextureAsync && T._loadTextureAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadAnimationAsync = function(x, m) {\n          return this._applyExtensions(m, \"loadAnimation\", function(c) {\n            return c.loadAnimationAsync && c.loadAnimationAsync(x, m);\n          });\n        }, O.prototype._extensionsLoadSkinAsync = function(x, m, c) {\n          return this._applyExtensions(c, \"loadSkin\", function(T) {\n            return T._loadSkinAsync && T._loadSkinAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadUriAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadUri\", function(T) {\n            return T._loadUriAsync && T._loadUriAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadBufferViewAsync = function(x, m) {\n          return this._applyExtensions(m, \"loadBufferView\", function(c) {\n            return c.loadBufferViewAsync && c.loadBufferViewAsync(x, m);\n          });\n        }, O.prototype._extensionsLoadBufferAsync = function(x, m, c, T) {\n          return this._applyExtensions(m, \"loadBuffer\", function(S) {\n            return S.loadBufferAsync && S.loadBufferAsync(x, m, c, T);\n          });\n        }, O.LoadExtensionAsync = function(x, m, c, T) {\n          if (!m.extensions)\n            return null;\n          var S = m.extensions[c];\n          return S ? T(x + \"/extensions/\" + c, S) : null;\n        }, O.LoadExtraAsync = function(x, m, c, T) {\n          if (!m.extras)\n            return null;\n          var S = m.extras[c];\n          return S ? T(x + \"/extras/\" + c, S) : null;\n        }, O.prototype.isExtensionUsed = function(x) {\n          return !!this._gltf.extensionsUsed && this._gltf.extensionsUsed.indexOf(x) !== -1;\n        }, O.prototype.logOpen = function(x) {\n          this._parent._logOpen(x);\n        }, O.prototype.logClose = function() {\n          this._parent._logClose();\n        }, O.prototype.log = function(x) {\n          this._parent._log(x);\n        }, O.prototype.startPerformanceCounter = function(x) {\n          this._parent._startPerformanceCounter(x);\n        }, O.prototype.endPerformanceCounter = function(x) {\n          this._parent._endPerformanceCounter(x);\n        }, O._RegisteredExtensions = {}, O.DefaultSampler = { index: -1 }, O;\n      }();\n      C.GLTFFileLoader._CreateGLTF2Loader = function(O) {\n        return new I(O);\n      };\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFLoaderCoordinateSystemMode\", function() {\n        return _;\n      }), V.d(f, \"GLTFLoaderAnimationStartMode\", function() {\n        return C;\n      }), V.d(f, \"GLTFLoaderState\", function() {\n        return u;\n      }), V.d(f, \"GLTFFileLoader\", function() {\n        return x;\n      });\n      var _, C, u, I = V(0), O = V(3);\n      (function(m) {\n        m[m.AUTO = 0] = \"AUTO\", m[m.FORCE_RIGHT_HANDED = 1] = \"FORCE_RIGHT_HANDED\";\n      })(_ || (_ = {})), function(m) {\n        m[m.NONE = 0] = \"NONE\", m[m.FIRST = 1] = \"FIRST\", m[m.ALL = 2] = \"ALL\";\n      }(C || (C = {})), function(m) {\n        m[m.LOADING = 0] = \"LOADING\", m[m.READY = 1] = \"READY\", m[m.COMPLETE = 2] = \"COMPLETE\";\n      }(u || (u = {}));\n      var x = function() {\n        function m() {\n          this.onParsedObservable = new I.Observable(), this.coordinateSystemMode = _.AUTO, this.animationStartMode = C.FIRST, this.compileMaterials = !1, this.useClipPlane = !1, this.compileShadowGenerators = !1, this.transparencyAsCoverage = !1, this.useRangeRequests = !1, this.createInstances = !0, this.alwaysComputeBoundingBox = !1, this.loadAllMaterials = !1, this.preprocessUrlAsync = function(c) {\n            return Promise.resolve(c);\n          }, this.onMeshLoadedObservable = new I.Observable(), this.onTextureLoadedObservable = new I.Observable(), this.onMaterialLoadedObservable = new I.Observable(), this.onCameraLoadedObservable = new I.Observable(), this.onCompleteObservable = new I.Observable(), this.onErrorObservable = new I.Observable(), this.onDisposeObservable = new I.Observable(), this.onExtensionLoadedObservable = new I.Observable(), this.validate = !1, this.onValidatedObservable = new I.Observable(), this._loader = null, this._requests = new Array(), this.name = \"gltf\", this.extensions = { \".gltf\": { isBinary: !1 }, \".glb\": { isBinary: !0 } }, this._logIndentLevel = 0, this._loggingEnabled = !1, this._log = this._logDisabled, this._capturePerformanceCounters = !1, this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled;\n        }\n        return Object.defineProperty(m.prototype, \"onParsed\", { set: function(c) {\n          this._onParsedObserver && this.onParsedObservable.remove(this._onParsedObserver), this._onParsedObserver = this.onParsedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onMeshLoaded\", { set: function(c) {\n          this._onMeshLoadedObserver && this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver), this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onTextureLoaded\", { set: function(c) {\n          this._onTextureLoadedObserver && this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver), this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onMaterialLoaded\", { set: function(c) {\n          this._onMaterialLoadedObserver && this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver), this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onCameraLoaded\", { set: function(c) {\n          this._onCameraLoadedObserver && this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver), this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onComplete\", { set: function(c) {\n          this._onCompleteObserver && this.onCompleteObservable.remove(this._onCompleteObserver), this._onCompleteObserver = this.onCompleteObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onError\", { set: function(c) {\n          this._onErrorObserver && this.onErrorObservable.remove(this._onErrorObserver), this._onErrorObserver = this.onErrorObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onDispose\", { set: function(c) {\n          this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onExtensionLoaded\", { set: function(c) {\n          this._onExtensionLoadedObserver && this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver), this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"loggingEnabled\", { get: function() {\n          return this._loggingEnabled;\n        }, set: function(c) {\n          this._loggingEnabled !== c && (this._loggingEnabled = c, this._loggingEnabled ? this._log = this._logEnabled : this._log = this._logDisabled);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"capturePerformanceCounters\", { get: function() {\n          return this._capturePerformanceCounters;\n        }, set: function(c) {\n          this._capturePerformanceCounters !== c && (this._capturePerformanceCounters = c, this._capturePerformanceCounters ? (this._startPerformanceCounter = this._startPerformanceCounterEnabled, this._endPerformanceCounter = this._endPerformanceCounterEnabled) : (this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled));\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onValidated\", { set: function(c) {\n          this._onValidatedObserver && this.onValidatedObservable.remove(this._onValidatedObserver), this._onValidatedObserver = this.onValidatedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), m.prototype.dispose = function() {\n          this._loader && (this._loader.dispose(), this._loader = null);\n          for (var c = 0, T = this._requests; c < T.length; c++)\n            T[c].abort();\n          this._requests.length = 0, delete this._progressCallback, this.preprocessUrlAsync = function(S) {\n            return Promise.resolve(S);\n          }, this.onMeshLoadedObservable.clear(), this.onTextureLoadedObservable.clear(), this.onMaterialLoadedObservable.clear(), this.onCameraLoadedObservable.clear(), this.onCompleteObservable.clear(), this.onExtensionLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(void 0), this.onDisposeObservable.clear();\n        }, m.prototype.requestFile = function(c, T, S, E, g, l) {\n          var h = this;\n          if (this._progressCallback = E, g) {\n            if (this.useRangeRequests) {\n              this.validate && I.Logger.Warn(\"glTF validation is not supported when range requests are enabled\");\n              var v = { abort: function() {\n              }, onCompleteObservable: new I.Observable() }, b = { readAsync: function(D, w) {\n                return new Promise(function(N, M) {\n                  h._requestFile(T, c, function(U) {\n                    N(new Uint8Array(U));\n                  }, !0, function(U) {\n                    M(U);\n                  }, function(U) {\n                    U.setRequestHeader(\"Range\", \"bytes=\" + D + \"-\" + (D + w - 1));\n                  });\n                });\n              }, byteLength: 0 };\n              return this._unpackBinaryAsync(new I.DataReader(b)).then(function(D) {\n                v.onCompleteObservable.notifyObservers(v), S(D);\n              }, l), v;\n            }\n            return this._requestFile(T, c, function(D, w) {\n              var N = D;\n              h._unpackBinaryAsync(new I.DataReader({ readAsync: function(M, U) {\n                return Promise.resolve(new Uint8Array(N, M, U));\n              }, byteLength: N.byteLength })).then(function(M) {\n                S(M, w);\n              }, l);\n            }, !0, l);\n          }\n          return this._requestFile(T, c, function(D, w) {\n            h._validate(c, D, I.Tools.GetFolderPath(T), I.Tools.GetFilename(T)), S({ json: h._parseJson(D) }, w);\n          }, g, l);\n        }, m.prototype.readFile = function(c, T, S, E, g, l) {\n          var h = this;\n          return c._readFile(T, function(v) {\n            if (h._validate(c, v, \"file:\", T.name), g) {\n              var b = v;\n              h._unpackBinaryAsync(new I.DataReader({ readAsync: function(D, w) {\n                return Promise.resolve(new Uint8Array(b, D, w));\n              }, byteLength: b.byteLength })).then(S, l);\n            } else\n              S({ json: h._parseJson(v) });\n          }, E, g, l);\n        }, m.prototype.importMeshAsync = function(c, T, S, E, g, l) {\n          var h = this;\n          return Promise.resolve().then(function() {\n            return h.onParsedObservable.notifyObservers(S), h.onParsedObservable.clear(), h._log(\"Loading \" + (l || \"\")), h._loader = h._getLoader(S), h._loader.importMeshAsync(c, T, !1, S, E, g, l);\n          });\n        }, m.prototype.loadAsync = function(c, T, S, E, g) {\n          var l = this;\n          return Promise.resolve().then(function() {\n            return l.onParsedObservable.notifyObservers(T), l.onParsedObservable.clear(), l._log(\"Loading \" + (g || \"\")), l._loader = l._getLoader(T), l._loader.loadAsync(c, T, S, E, g);\n          });\n        }, m.prototype.loadAssetContainerAsync = function(c, T, S, E, g) {\n          var l = this;\n          return Promise.resolve().then(function() {\n            l.onParsedObservable.notifyObservers(T), l.onParsedObservable.clear(), l._log(\"Loading \" + (g || \"\")), l._loader = l._getLoader(T);\n            var h = new I.AssetContainer(c), v = [];\n            l.onMaterialLoadedObservable.add(function(w) {\n              v.push(w), w.onDisposeObservable.addOnce(function() {\n                var N = h.materials.indexOf(w);\n                N > -1 && h.materials.splice(N, 1), (N = v.indexOf(w)) > -1 && v.splice(N, 1);\n              });\n            });\n            var b = [];\n            l.onTextureLoadedObservable.add(function(w) {\n              b.push(w), w.onDisposeObservable.addOnce(function() {\n                var N = h.textures.indexOf(w);\n                N > -1 && h.textures.splice(N, 1), (N = b.indexOf(w)) > -1 && b.splice(N, 1);\n              });\n            });\n            var D = [];\n            return l.onCameraLoadedObservable.add(function(w) {\n              D.push(w);\n            }), l._loader.importMeshAsync(null, c, !0, T, S, E, g).then(function(w) {\n              return Array.prototype.push.apply(h.geometries, w.geometries), Array.prototype.push.apply(h.meshes, w.meshes), Array.prototype.push.apply(h.particleSystems, w.particleSystems), Array.prototype.push.apply(h.skeletons, w.skeletons), Array.prototype.push.apply(h.animationGroups, w.animationGroups), Array.prototype.push.apply(h.materials, v), Array.prototype.push.apply(h.textures, b), Array.prototype.push.apply(h.lights, w.lights), Array.prototype.push.apply(h.transformNodes, w.transformNodes), Array.prototype.push.apply(h.cameras, D), h;\n            });\n          });\n        }, m.prototype.canDirectLoad = function(c) {\n          return c.indexOf(\"asset\") !== -1 && c.indexOf(\"version\") !== -1 || I.StringTools.StartsWith(c, \"data:base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(c, \"data:application/octet-stream;base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(c, \"data:model/gltf-binary;base64,\" + m.magicBase64Encoded);\n        }, m.prototype.directLoad = function(c, T) {\n          if (I.StringTools.StartsWith(T, \"base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(T, \"application/octet-stream;base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(T, \"model/gltf-binary;base64,\" + m.magicBase64Encoded)) {\n            var S = I.Tools.DecodeBase64(T);\n            return this._validate(c, S), this._unpackBinaryAsync(new I.DataReader({ readAsync: function(E, g) {\n              return Promise.resolve(new Uint8Array(S, E, g));\n            }, byteLength: S.byteLength }));\n          }\n          return this._validate(c, T), Promise.resolve({ json: this._parseJson(T) });\n        }, m.prototype.createPlugin = function() {\n          return new m();\n        }, Object.defineProperty(m.prototype, \"loaderState\", { get: function() {\n          return this._loader ? this._loader.state : null;\n        }, enumerable: !1, configurable: !0 }), m.prototype.whenCompleteAsync = function() {\n          var c = this;\n          return new Promise(function(T, S) {\n            c.onCompleteObservable.addOnce(function() {\n              T();\n            }), c.onErrorObservable.addOnce(function(E) {\n              S(E);\n            });\n          });\n        }, m.prototype._loadFile = function(c, T, S, E, g) {\n          var l = this, h = T._loadFile(c, S, function(v) {\n            l._onProgress(v, h);\n          }, void 0, E, g);\n          return h.onCompleteObservable.add(function(v) {\n            l._requests.splice(l._requests.indexOf(v), 1);\n          }), this._requests.push(h), h;\n        }, m.prototype._requestFile = function(c, T, S, E, g, l) {\n          var h = this, v = T._requestFile(c, S, function(b) {\n            h._onProgress(b, v);\n          }, void 0, E, g, l);\n          return v.onCompleteObservable.add(function(b) {\n            h._requests.splice(h._requests.indexOf(b), 1);\n          }), this._requests.push(v), v;\n        }, m.prototype._onProgress = function(c, T) {\n          if (this._progressCallback) {\n            T._lengthComputable = c.lengthComputable, T._loaded = c.loaded, T._total = c.total;\n            for (var S = !0, E = 0, g = 0, l = 0, h = this._requests; l < h.length; l++) {\n              var v = h[l];\n              if (v._lengthComputable === void 0 || v._loaded === void 0 || v._total === void 0)\n                return;\n              S = S && v._lengthComputable, E += v._loaded, g += v._total;\n            }\n            this._progressCallback({ lengthComputable: S, loaded: E, total: S ? g : 0 });\n          }\n        }, m.prototype._validate = function(c, T, S, E) {\n          var g = this;\n          S === void 0 && (S = \"\"), E === void 0 && (E = \"\"), this.validate && (this._startPerformanceCounter(\"Validate JSON\"), O.GLTFValidation.ValidateAsync(T, S, E, function(l) {\n            return g.preprocessUrlAsync(S + l).then(function(h) {\n              return c._loadFileAsync(h, void 0, !0, !0);\n            });\n          }).then(function(l) {\n            g._endPerformanceCounter(\"Validate JSON\"), g.onValidatedObservable.notifyObservers(l), g.onValidatedObservable.clear();\n          }, function(l) {\n            g._endPerformanceCounter(\"Validate JSON\"), I.Tools.Warn(\"Failed to validate: \" + l.message), g.onValidatedObservable.clear();\n          }));\n        }, m.prototype._getLoader = function(c) {\n          var T = c.json.asset || {};\n          this._log(\"Asset version: \" + T.version), T.minVersion && this._log(\"Asset minimum version: \" + T.minVersion), T.generator && this._log(\"Asset generator: \" + T.generator);\n          var S = m._parseVersion(T.version);\n          if (!S)\n            throw new Error(\"Invalid version: \" + T.version);\n          if (T.minVersion !== void 0) {\n            var E = m._parseVersion(T.minVersion);\n            if (!E)\n              throw new Error(\"Invalid minimum version: \" + T.minVersion);\n            if (m._compareVersion(E, { major: 2, minor: 0 }) > 0)\n              throw new Error(\"Incompatible minimum version: \" + T.minVersion);\n          }\n          var g = { 1: m._CreateGLTF1Loader, 2: m._CreateGLTF2Loader }[S.major];\n          if (!g)\n            throw new Error(\"Unsupported version: \" + T.version);\n          return g(this);\n        }, m.prototype._parseJson = function(c) {\n          this._startPerformanceCounter(\"Parse JSON\"), this._log(\"JSON length: \" + c.length);\n          var T = JSON.parse(c);\n          return this._endPerformanceCounter(\"Parse JSON\"), T;\n        }, m.prototype._unpackBinaryAsync = function(c) {\n          var T = this;\n          return this._startPerformanceCounter(\"Unpack Binary\"), c.loadAsync(20).then(function() {\n            var S = c.readUint32();\n            if (S !== 1179937895)\n              throw new Error(\"Unexpected magic: \" + S);\n            var E = c.readUint32();\n            T.loggingEnabled && T._log(\"Binary version: \" + E);\n            var g, l = c.readUint32();\n            if (c.buffer.byteLength !== 0 && l !== c.buffer.byteLength)\n              throw new Error(\"Length in header does not match actual data length: \" + l + \" != \" + c.buffer.byteLength);\n            switch (E) {\n              case 1:\n                g = T._unpackBinaryV1Async(c, l);\n                break;\n              case 2:\n                g = T._unpackBinaryV2Async(c, l);\n                break;\n              default:\n                throw new Error(\"Unsupported version: \" + E);\n            }\n            return T._endPerformanceCounter(\"Unpack Binary\"), g;\n          });\n        }, m.prototype._unpackBinaryV1Async = function(c, T) {\n          var S = c.readUint32(), E = c.readUint32();\n          if (E !== 0)\n            throw new Error(\"Unexpected content format: \" + E);\n          var g = T - c.byteOffset, l = { json: this._parseJson(c.readString(S)), bin: null };\n          if (g !== 0) {\n            var h = c.byteOffset;\n            l.bin = { readAsync: function(v, b) {\n              return c.buffer.readAsync(h + v, b);\n            }, byteLength: g };\n          }\n          return Promise.resolve(l);\n        }, m.prototype._unpackBinaryV2Async = function(c, T) {\n          var S = this, E = 1313821514, g = 5130562, l = c.readUint32();\n          if (c.readUint32() !== E)\n            throw new Error(\"First chunk format is not JSON\");\n          return c.byteOffset + l === T ? c.loadAsync(l).then(function() {\n            return { json: S._parseJson(c.readString(l)), bin: null };\n          }) : c.loadAsync(l + 8).then(function() {\n            var h = { json: S._parseJson(c.readString(l)), bin: null }, v = function() {\n              var b = c.readUint32();\n              switch (c.readUint32()) {\n                case E:\n                  throw new Error(\"Unexpected JSON chunk\");\n                case g:\n                  var D = c.byteOffset;\n                  h.bin = { readAsync: function(w, N) {\n                    return c.buffer.readAsync(D + w, N);\n                  }, byteLength: b }, c.skipBytes(b);\n                  break;\n                default:\n                  c.skipBytes(b);\n              }\n              return c.byteOffset !== T ? c.loadAsync(8).then(v) : Promise.resolve(h);\n            };\n            return v();\n          });\n        }, m._parseVersion = function(c) {\n          if (c === \"1.0\" || c === \"1.0.1\")\n            return { major: 1, minor: 0 };\n          var T = (c + \"\").match(/^(\\d+)\\.(\\d+)/);\n          return T ? { major: parseInt(T[1]), minor: parseInt(T[2]) } : null;\n        }, m._compareVersion = function(c, T) {\n          return c.major > T.major ? 1 : c.major < T.major ? -1 : c.minor > T.minor ? 1 : c.minor < T.minor ? -1 : 0;\n        }, m.prototype._logOpen = function(c) {\n          this._log(c), this._logIndentLevel++;\n        }, m.prototype._logClose = function() {\n          --this._logIndentLevel;\n        }, m.prototype._logEnabled = function(c) {\n          var T = m._logSpaces.substr(0, 2 * this._logIndentLevel);\n          I.Logger.Log(\"\" + T + c);\n        }, m.prototype._logDisabled = function(c) {\n        }, m.prototype._startPerformanceCounterEnabled = function(c) {\n          I.Tools.StartPerformanceCounter(c);\n        }, m.prototype._startPerformanceCounterDisabled = function(c) {\n        }, m.prototype._endPerformanceCounterEnabled = function(c) {\n          I.Tools.EndPerformanceCounter(c);\n        }, m.prototype._endPerformanceCounterDisabled = function(c) {\n        }, m.IncrementalLoading = !0, m.HomogeneousCoordinates = !1, m.magicBase64Encoded = \"Z2xURg\", m._logSpaces = \"                                \", m;\n      }();\n      I.SceneLoader && I.SceneLoader.RegisterPlugin(new x());\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFValidation\", function() {\n        return I;\n      });\n      var _ = V(0);\n      function C(O, x, m, c) {\n        var T = { externalResourceFunction: function(S) {\n          return c(S).then(function(E) {\n            return new Uint8Array(E);\n          });\n        } };\n        return m && (T.uri = x === \"file:\" ? m : x + m), O instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(O), T) : GLTFValidator.validateString(O, T);\n      }\n      function u() {\n        var O = [];\n        onmessage = function(x) {\n          var m = x.data;\n          switch (m.id) {\n            case \"init\":\n              importScripts(m.url);\n              break;\n            case \"validate\":\n              C(m.data, m.rootUrl, m.fileName, function(c) {\n                return new Promise(function(T, S) {\n                  var E = O.length;\n                  O.push({ resolve: T, reject: S }), postMessage({ id: \"getExternalResource\", index: E, uri: c });\n                });\n              }).then(function(c) {\n                postMessage({ id: \"validate.resolve\", value: c });\n              }, function(c) {\n                postMessage({ id: \"validate.reject\", reason: c });\n              });\n              break;\n            case \"getExternalResource.resolve\":\n              O[m.index].resolve(m.value);\n              break;\n            case \"getExternalResource.reject\":\n              O[m.index].reject(m.reason);\n          }\n        };\n      }\n      var I = function() {\n        function O() {\n        }\n        return O.ValidateAsync = function(x, m, c, T) {\n          var S = this;\n          return typeof Worker == \"function\" ? new Promise(function(E, g) {\n            var l = C + \"(\" + u + \")()\", h = URL.createObjectURL(new Blob([l], { type: \"application/javascript\" })), v = new Worker(h), b = function(w) {\n              v.removeEventListener(\"error\", b), v.removeEventListener(\"message\", D), g(w);\n            }, D = function(w) {\n              var N = w.data;\n              switch (N.id) {\n                case \"getExternalResource\":\n                  T(N.uri).then(function(M) {\n                    v.postMessage({ id: \"getExternalResource.resolve\", index: N.index, value: M }, [M]);\n                  }, function(M) {\n                    v.postMessage({ id: \"getExternalResource.reject\", index: N.index, reason: M });\n                  });\n                  break;\n                case \"validate.resolve\":\n                  v.removeEventListener(\"error\", b), v.removeEventListener(\"message\", D), E(N.value);\n                  break;\n                case \"validate.reject\":\n                  v.removeEventListener(\"error\", b), v.removeEventListener(\"message\", D), g(N.reason);\n              }\n            };\n            v.addEventListener(\"error\", b), v.addEventListener(\"message\", D), v.postMessage({ id: \"init\", url: _.Tools.GetAbsoluteUrl(S.Configuration.url) }), v.postMessage({ id: \"validate\", data: x, rootUrl: m, fileName: c });\n          }) : (this._LoadScriptPromise || (this._LoadScriptPromise = _.Tools.LoadScriptAsync(this.Configuration.url)), this._LoadScriptPromise.then(function() {\n            return C(x, m, c, T);\n          }));\n        }, O.Configuration = { url: \"https://preview.babylonjs.com/gltf_validator.js\" }, O;\n      }();\n    }, function(A, f, V) {\n      V.d(f, \"b\", function() {\n        return C;\n      }), V.d(f, \"a\", function() {\n        return u;\n      });\n      /*! *****************************************************************************\n      \tCopyright (c) Microsoft Corporation.\n      \n      \tPermission to use, copy, modify, and/or distribute this software for any\n      \tpurpose with or without fee is hereby granted.\n      \n      \tTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n      \tREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n      \tAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n      \tINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n      \tLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n      \tOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n      \tPERFORMANCE OF THIS SOFTWARE.\n      \t***************************************************************************** */\n      var _ = function(I, O) {\n        return (_ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(x, m) {\n          x.__proto__ = m;\n        } || function(x, m) {\n          for (var c in m)\n            Object.prototype.hasOwnProperty.call(m, c) && (x[c] = m[c]);\n        })(I, O);\n      };\n      function C(I, O) {\n        if (typeof O != \"function\" && O !== null)\n          throw new TypeError(\"Class extends value \" + String(O) + \" is not a constructor or null\");\n        function x() {\n          this.constructor = I;\n        }\n        _(I, O), I.prototype = O === null ? Object.create(O) : (x.prototype = O.prototype, new x());\n      }\n      var u = function() {\n        return (u = Object.assign || function(I) {\n          for (var O, x = 1, m = arguments.length; x < m; x++)\n            for (var c in O = arguments[x])\n              Object.prototype.hasOwnProperty.call(O, c) && (I[c] = O[c]);\n          return I;\n        }).apply(this, arguments);\n      };\n    }, function(A, f) {\n      var V;\n      V = /* @__PURE__ */ function() {\n        return this;\n      }();\n      try {\n        V = V || new Function(\"return this\")();\n      } catch {\n        typeof window == \"object\" && (V = window);\n      }\n      A.exports = V;\n    }, function(A, f, V) {\n      V.r(f);\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"EXT_lights_image_based\", function() {\n        return I;\n      }), V.d(f, \"EXT_mesh_gpu_instancing\", function() {\n        return O;\n      }), V.d(f, \"EXT_texture_webp\", function() {\n        return x;\n      }), V.d(f, \"KHR_draco_mesh_compression\", function() {\n        return m;\n      }), V.d(f, \"KHR_lights\", function() {\n        return c;\n      }), V.d(f, \"KHR_materials_pbrSpecularGlossiness\", function() {\n        return T;\n      }), V.d(f, \"KHR_materials_unlit\", function() {\n        return S;\n      }), V.d(f, \"KHR_materials_clearcoat\", function() {\n        return E;\n      }), V.d(f, \"KHR_materials_sheen\", function() {\n        return g;\n      }), V.d(f, \"KHR_materials_specular\", function() {\n        return l;\n      }), V.d(f, \"KHR_materials_ior\", function() {\n        return h;\n      }), V.d(f, \"KHR_materials_variants\", function() {\n        return v;\n      }), V.d(f, \"KHR_materials_transmission\", function() {\n        return w;\n      }), V.d(f, \"KHR_materials_translucency\", function() {\n        return N;\n      }), V.d(f, \"KHR_mesh_quantization\", function() {\n        return M;\n      }), V.d(f, \"KHR_texture_basisu\", function() {\n        return U;\n      }), V.d(f, \"KHR_texture_transform\", function() {\n        return X;\n      }), V.d(f, \"MSFT_audio_emitter\", function() {\n        return j;\n      }), V.d(f, \"MSFT_lod\", function() {\n        return ne;\n      }), V.d(f, \"MSFT_minecraftMesh\", function() {\n        return te;\n      }), V.d(f, \"MSFT_sRGBFactors\", function() {\n        return de;\n      }), V.d(f, \"ExtrasAsMetadata\", function() {\n        return pe;\n      });\n      var _ = V(0), C = V(1), u = \"EXT_lights_image_based\", I = function() {\n        function ae(ee) {\n          this.name = u, this._loader = ee, this.enabled = this._loader.isExtensionUsed(u);\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, delete this._lights;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._lights = K.lights;\n          }\n        }, ae.prototype.loadSceneAsync = function(ee, K) {\n          var $ = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(L, G) {\n            var Q = new Array();\n            Q.push($._loader.loadSceneAsync(ee, K)), $._loader.logOpen(\"\" + L);\n            var oe = C.a.Get(L + \"/light\", $._lights, G.light);\n            return Q.push($._loadLightAsync(\"/extensions/\" + $.name + \"/lights/\" + G.light, oe).then(function(re) {\n              $._loader.babylonScene.environmentTexture = re;\n            })), $._loader.logClose(), Promise.all(Q).then(function() {\n            });\n          });\n        }, ae.prototype._loadLightAsync = function(ee, K) {\n          var $ = this;\n          if (!K._loaded) {\n            var L = new Array();\n            this._loader.logOpen(\"\" + ee);\n            for (var G = new Array(K.specularImages.length), Q = function(Y) {\n              var k = K.specularImages[Y];\n              G[Y] = new Array(k.length);\n              for (var H = function(W) {\n                var q = ee + \"/specularImages/\" + Y + \"/\" + W;\n                oe._loader.logOpen(\"\" + q);\n                var he = k[W], ge = C.a.Get(q, oe._loader.gltf.images, he);\n                L.push(oe._loader.loadImageAsync(\"/images/\" + he, ge).then(function(me) {\n                  G[Y][W] = me;\n                })), oe._loader.logClose();\n              }, Z = 0; Z < k.length; Z++)\n                H(Z);\n            }, oe = this, re = 0; re < K.specularImages.length; re++)\n              Q(re);\n            this._loader.logClose(), K._loaded = Promise.all(L).then(function() {\n              var Y = new _.RawCubeTexture($._loader.babylonScene, null, K.specularImageSize);\n              if (Y.name = K.name || \"environment\", K._babylonTexture = Y, K.intensity != null && (Y.level = K.intensity), K.rotation) {\n                var k = _.Quaternion.FromArray(K.rotation);\n                $._loader.babylonScene.useRightHandedSystem || (k = _.Quaternion.Inverse(k)), _.Matrix.FromQuaternionToRef(k, Y.getReflectionTextureMatrix());\n              }\n              var H = _.SphericalHarmonics.FromArray(K.irradianceCoefficients);\n              H.scaleInPlace(K.intensity), H.convertIrradianceToLambertianRadiance();\n              var Z = _.SphericalPolynomial.FromHarmonics(H), W = (G.length - 1) / _.Scalar.Log2(K.specularImageSize);\n              return Y.updateRGBDAsync(G, Z, W);\n            });\n          }\n          return K._loaded.then(function() {\n            return K._babylonTexture;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(u, function(ae) {\n        return new I(ae);\n      });\n      var O = function() {\n        function ae(ee) {\n          this.name = \"EXT_mesh_gpu_instancing\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"EXT_mesh_gpu_instancing\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            L._loader._disableInstancedMesh++;\n            var oe = L._loader.loadNodeAsync(\"/nodes/\" + K.index, K, $);\n            if (L._loader._disableInstancedMesh--, !K._primitiveBabylonMeshes)\n              return oe;\n            var re = new Array(), Y = 0, k = function(H) {\n              if (Q.attributes[H] != null) {\n                var Z = C.a.Get(G + \"/attributes/\" + H, L._loader.gltf.accessors, Q.attributes[H]);\n                if (re.push(L._loader._loadFloatAccessorAsync(\"/accessors/\" + Z.bufferView, Z)), Y === 0)\n                  Y = Z.count;\n                else if (Y !== Z.count)\n                  throw new Error(G + \"/attributes: Instance buffer accessors do not have the same count.\");\n              } else\n                re.push(Promise.resolve(null));\n            };\n            return k(\"TRANSLATION\"), k(\"ROTATION\"), k(\"SCALE\"), oe.then(function(H) {\n              return Promise.all(re).then(function(Z) {\n                var W = Z[0], q = Z[1], he = Z[2], ge = new Float32Array(16 * Y);\n                _.TmpVectors.Vector3[0].copyFromFloats(0, 0, 0), _.TmpVectors.Quaternion[0].copyFromFloats(0, 0, 0, 1), _.TmpVectors.Vector3[1].copyFromFloats(1, 1, 1);\n                for (var me = 0; me < Y; ++me)\n                  W && _.Vector3.FromArrayToRef(W, 3 * me, _.TmpVectors.Vector3[0]), q && _.Quaternion.FromArrayToRef(q, 4 * me, _.TmpVectors.Quaternion[0]), he && _.Vector3.FromArrayToRef(he, 3 * me, _.TmpVectors.Vector3[1]), _.Matrix.ComposeToRef(_.TmpVectors.Vector3[1], _.TmpVectors.Quaternion[0], _.TmpVectors.Vector3[0], _.TmpVectors.Matrix[0]), _.TmpVectors.Matrix[0].copyToArray(ge, 16 * me);\n                for (var _e = 0, ye = K._primitiveBabylonMeshes; _e < ye.length; _e++)\n                  ye[_e].thinInstanceSetBuffer(\"matrix\", ge, 16, !0);\n                return H;\n              });\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"EXT_mesh_gpu_instancing\", function(ae) {\n        return new O(ae);\n      });\n      var x = function() {\n        function ae(ee) {\n          this.name = \"EXT_texture_webp\", this._loader = ee, this.enabled = ee.isExtensionUsed(\"EXT_texture_webp\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype._loadTextureAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = K.sampler == null ? C.b.DefaultSampler : C.a.Get(ee + \"/sampler\", L._loader.gltf.samplers, K.sampler), re = C.a.Get(G + \"/source\", L._loader.gltf.images, Q.source);\n            return L._loader._createTextureAsync(ee, oe, re, function(Y) {\n              $(Y);\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"EXT_texture_webp\", function(ae) {\n        return new x(ae);\n      });\n      var m = function() {\n        function ae(ee) {\n          this.name = \"KHR_draco_mesh_compression\", this._loader = ee, this.enabled = _.DracoCompression.DecoderAvailable && this._loader.isExtensionUsed(\"KHR_draco_mesh_compression\");\n        }\n        return ae.prototype.dispose = function() {\n          delete this.dracoCompression, this._loader = null;\n        }, ae.prototype._loadVertexDataAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            if (K.mode != null) {\n              if (K.mode !== 5 && K.mode !== 4)\n                throw new Error(ee + \": Unsupported mode \" + K.mode);\n              if (K.mode === 5)\n                throw new Error(ee + \": Mode \" + K.mode + \" is not currently supported\");\n            }\n            var oe = {}, re = function(k, H) {\n              var Z = Q.attributes[k];\n              Z != null && ($._delayInfo = $._delayInfo || [], $._delayInfo.indexOf(H) === -1 && $._delayInfo.push(H), oe[H] = Z);\n            };\n            re(\"POSITION\", _.VertexBuffer.PositionKind), re(\"NORMAL\", _.VertexBuffer.NormalKind), re(\"TANGENT\", _.VertexBuffer.TangentKind), re(\"TEXCOORD_0\", _.VertexBuffer.UVKind), re(\"TEXCOORD_1\", _.VertexBuffer.UV2Kind), re(\"JOINTS_0\", _.VertexBuffer.MatricesIndicesKind), re(\"WEIGHTS_0\", _.VertexBuffer.MatricesWeightsKind), re(\"COLOR_0\", _.VertexBuffer.ColorKind);\n            var Y = C.a.Get(G, L._loader.gltf.bufferViews, Q.bufferView);\n            return Y._dracoBabylonGeometry || (Y._dracoBabylonGeometry = L._loader.loadBufferViewAsync(\"/bufferViews/\" + Y.index, Y).then(function(k) {\n              return (L.dracoCompression || _.DracoCompression.Default).decodeMeshAsync(k, oe).then(function(H) {\n                var Z = new _.Geometry($.name, L._loader.babylonScene);\n                return H.applyToGeometry(Z), Z;\n              }).catch(function(H) {\n                throw new Error(ee + \": \" + H.message);\n              });\n            })), Y._dracoBabylonGeometry;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_draco_mesh_compression\", function(ae) {\n        return new m(ae);\n      });\n      var c = function() {\n        function ae(ee) {\n          this.name = \"KHR_lights_punctual\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_lights_punctual\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, delete this._lights;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._lights = K.lights;\n          }\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            return L._loader.loadNodeAsync(ee, K, function(oe) {\n              var re, Y = C.a.Get(G, L._lights, Q.light), k = Y.name || oe.name;\n              switch (L._loader.babylonScene._blockEntityCollection = L._loader._forAssetContainer, Y.type) {\n                case \"directional\":\n                  re = new _.DirectionalLight(k, _.Vector3.Backward(), L._loader.babylonScene);\n                  break;\n                case \"point\":\n                  re = new _.PointLight(k, _.Vector3.Zero(), L._loader.babylonScene);\n                  break;\n                case \"spot\":\n                  var H = new _.SpotLight(k, _.Vector3.Zero(), _.Vector3.Backward(), 0, 1, L._loader.babylonScene);\n                  H.angle = 2 * (Y.spot && Y.spot.outerConeAngle || Math.PI / 4), H.innerAngle = 2 * (Y.spot && Y.spot.innerConeAngle || 0), re = H;\n                  break;\n                default:\n                  throw L._loader.babylonScene._blockEntityCollection = !1, new Error(G + \": Invalid light type (\" + Y.type + \")\");\n              }\n              L._loader.babylonScene._blockEntityCollection = !1, re.falloffType = _.Light.FALLOFF_GLTF, re.diffuse = Y.color ? _.Color3.FromArray(Y.color) : _.Color3.White(), re.intensity = Y.intensity == null ? 1 : Y.intensity, re.range = Y.range == null ? Number.MAX_VALUE : Y.range, re.parent = oe, L._loader._babylonLights.push(re), C.b.AddPointerMetadata(re, G), $(oe);\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_lights_punctual\", function(ae) {\n        return new c(ae);\n      });\n      var T = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_pbrSpecularGlossiness\", this.order = 200, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_pbrSpecularGlossiness\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialBasePropertiesAsync(ee, K, $)), oe.push(L._loadSpecularGlossinessPropertiesAsync(G, K, Q, $)), L._loader.loadMaterialAlphaProperties(ee, K, $), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadSpecularGlossinessPropertiesAsync = function(ee, K, $, L) {\n          if (!(L instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var G = new Array();\n          return L.metallic = null, L.roughness = null, $.diffuseFactor ? (L.albedoColor = _.Color3.FromArray($.diffuseFactor), L.alpha = $.diffuseFactor[3]) : L.albedoColor = _.Color3.White(), L.reflectivityColor = $.specularFactor ? _.Color3.FromArray($.specularFactor) : _.Color3.White(), L.microSurface = $.glossinessFactor == null ? 1 : $.glossinessFactor, $.diffuseTexture && G.push(this._loader.loadTextureInfoAsync(ee + \"/diffuseTexture\", $.diffuseTexture, function(Q) {\n            Q.name = L.name + \" (Diffuse)\", L.albedoTexture = Q;\n          })), $.specularGlossinessTexture && ($.specularGlossinessTexture.nonColorData = !0, G.push(this._loader.loadTextureInfoAsync(ee + \"/specularGlossinessTexture\", $.specularGlossinessTexture, function(Q) {\n            Q.name = L.name + \" (Specular Glossiness)\", L.reflectivityTexture = Q;\n          })), L.reflectivityTexture.hasAlpha = !0, L.useMicroSurfaceFromReflectivityMapAlpha = !0), Promise.all(G).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_pbrSpecularGlossiness\", function(ae) {\n        return new T(ae);\n      });\n      var S = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_unlit\", this.order = 210, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_unlit\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function() {\n            return L._loadUnlitPropertiesAsync(ee, K, $);\n          });\n        }, ae.prototype._loadUnlitPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          $.unlit = !0;\n          var G = K.pbrMetallicRoughness;\n          return G && (G.baseColorFactor ? ($.albedoColor = _.Color3.FromArray(G.baseColorFactor), $.alpha = G.baseColorFactor[3]) : $.albedoColor = _.Color3.White(), G.baseColorTexture && L.push(this._loader.loadTextureInfoAsync(ee + \"/baseColorTexture\", G.baseColorTexture, function(Q) {\n            Q.name = $.name + \" (Base Color)\", $.albedoTexture = Q;\n          }))), K.doubleSided && ($.backFaceCulling = !1, $.twoSidedLighting = !0), this._loader.loadMaterialAlphaProperties(ee, K, $), Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_unlit\", function(ae) {\n        return new S(ae);\n      });\n      var E = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_clearcoat\", this.order = 190, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_clearcoat\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadClearCoatPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadClearCoatPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          return $.clearCoat.isEnabled = !0, $.clearCoat.useRoughnessFromMainTexture = !1, $.clearCoat.remapF0OnInterfaceChange = !1, K.clearcoatFactor != null ? $.clearCoat.intensity = K.clearcoatFactor : $.clearCoat.intensity = 0, K.clearcoatTexture && L.push(this._loader.loadTextureInfoAsync(ee + \"/clearcoatTexture\", K.clearcoatTexture, function(G) {\n            G.name = $.name + \" (ClearCoat Intensity)\", $.clearCoat.texture = G;\n          })), K.clearcoatRoughnessFactor != null ? $.clearCoat.roughness = K.clearcoatRoughnessFactor : $.clearCoat.roughness = 0, K.clearcoatRoughnessTexture && (K.clearcoatRoughnessTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/clearcoatRoughnessTexture\", K.clearcoatRoughnessTexture, function(G) {\n            G.name = $.name + \" (ClearCoat Roughness)\", $.clearCoat.textureRoughness = G;\n          }))), K.clearcoatNormalTexture && (K.clearcoatNormalTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/clearcoatNormalTexture\", K.clearcoatNormalTexture, function(G) {\n            G.name = $.name + \" (ClearCoat Normal)\", $.clearCoat.bumpTexture = G;\n          })), $.invertNormalMapX = !$.getScene().useRightHandedSystem, $.invertNormalMapY = $.getScene().useRightHandedSystem, K.clearcoatNormalTexture.scale != null && ($.clearCoat.bumpTexture.level = K.clearcoatNormalTexture.scale)), Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_clearcoat\", function(ae) {\n        return new E(ae);\n      });\n      var g = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_sheen\", this.order = 190, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_sheen\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadSheenPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadSheenPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          return $.sheen.isEnabled = !0, $.sheen.intensity = 1, K.sheenColorFactor != null ? $.sheen.color = _.Color3.FromArray(K.sheenColorFactor) : $.sheen.color = _.Color3.Black(), K.sheenColorTexture && L.push(this._loader.loadTextureInfoAsync(ee + \"/sheenColorTexture\", K.sheenColorTexture, function(G) {\n            G.name = $.name + \" (Sheen Color)\", $.sheen.texture = G;\n          })), K.sheenRoughnessFactor !== void 0 ? $.sheen.roughness = K.sheenRoughnessFactor : $.sheen.roughness = 0, K.sheenRoughnessTexture && (K.sheenRoughnessTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/sheenRoughnessTexture\", K.sheenRoughnessTexture, function(G) {\n            G.name = $.name + \" (Sheen Roughness)\", $.sheen.textureRoughness = G;\n          }))), $.sheen.albedoScaling = !0, $.sheen.useRoughnessFromMainTexture = !1, Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_sheen\", function(ae) {\n        return new g(ae);\n      });\n      var l = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_specular\", this.order = 190, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_specular\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadSpecularPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadSpecularPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          return K.specularFactor !== void 0 && ($.metallicF0Factor = K.specularFactor), K.specularColorFactor !== void 0 && ($.metallicReflectanceColor = _.Color3.FromArray(K.specularColorFactor)), K.specularTexture && (K.specularTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/specularTexture\", K.specularTexture, function(G) {\n            G.name = $.name + \" (Specular F0 Color)\", $.metallicReflectanceTexture = G;\n          }))), Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_specular\", function(ae) {\n        return new l(ae);\n      });\n      var h = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_ior\", this.order = 180, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_ior\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadIorPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadIorPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          return K.ior !== void 0 ? $.indexOfRefraction = K.ior : $.indexOfRefraction = ae._DEFAULT_IOR, Promise.resolve();\n        }, ae._DEFAULT_IOR = 1.5, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_ior\", function(ae) {\n        return new h(ae);\n      });\n      var v = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_variants\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_variants\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.GetAvailableVariants = function(ee) {\n          var K = this._GetExtensionMetadata(ee);\n          return K ? Object.keys(K.variants) : [];\n        }, ae.prototype.getAvailableVariants = function(ee) {\n          return ae.GetAvailableVariants(ee);\n        }, ae.SelectVariant = function(ee, K) {\n          var $ = this._GetExtensionMetadata(ee);\n          if (!$)\n            throw new Error(\"Cannot select variant on a glTF mesh that does not have the KHR_materials_variants extension\");\n          var L = function(oe) {\n            var re = $.variants[oe];\n            if (re)\n              for (var Y = 0, k = re; Y < k.length; Y++) {\n                var H = k[Y];\n                H.mesh.material = H.material;\n              }\n          };\n          if (K instanceof Array)\n            for (var G = 0, Q = K; G < Q.length; G++)\n              L(Q[G]);\n          else\n            L(K);\n          $.lastSelected = K;\n        }, ae.prototype.selectVariant = function(ee, K) {\n          return ae.SelectVariant(ee, K);\n        }, ae.Reset = function(ee) {\n          var K = this._GetExtensionMetadata(ee);\n          if (!K)\n            throw new Error(\"Cannot reset on a glTF mesh that does not have the KHR_materials_variants extension\");\n          for (var $ = 0, L = K.original; $ < L.length; $++) {\n            var G = L[$];\n            G.mesh.material = G.material;\n          }\n          K.lastSelected = null;\n        }, ae.prototype.reset = function(ee) {\n          return ae.Reset(ee);\n        }, ae.GetLastSelectedVariant = function(ee) {\n          var K = this._GetExtensionMetadata(ee);\n          if (!K)\n            throw new Error(\"Cannot get the last selected variant on a glTF mesh that does not have the KHR_materials_variants extension\");\n          return K.lastSelected;\n        }, ae.prototype.getLastSelectedVariant = function(ee) {\n          return ae.GetLastSelectedVariant(ee);\n        }, ae._GetExtensionMetadata = function(ee) {\n          var K, $;\n          return (($ = (K = ee == null ? void 0 : ee.metadata) === null || K === void 0 ? void 0 : K.gltf) === null || $ === void 0 ? void 0 : $.KHR_materials_variants) || null;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._variants = K.variants;\n          }\n        }, ae.prototype._loadMeshPrimitiveAsync = function(ee, K, $, L, G, Q) {\n          var oe = this;\n          return C.b.LoadExtensionAsync(ee, G, this.name, function(re, Y) {\n            var k = new Array();\n            return k.push(oe._loader._loadMeshPrimitiveAsync(ee, K, $, L, G, function(H) {\n              if (Q(H), H instanceof _.Mesh) {\n                var Z = C.b._GetDrawMode(ee, G.mode), W = oe._loader.rootBabylonMesh, q = W.metadata = W.metadata || {}, he = q.gltf = q.gltf || {}, ge = he.KHR_materials_variants = he.KHR_materials_variants || { lastSelected: null, original: [], variants: {} };\n                ge.original.push({ mesh: H, material: H.material });\n                for (var me = ge.variants, _e = 0, ye = Y.mappings; _e < ye.length; _e++)\n                  for (var Pe = ye[_e], be = function(We) {\n                    var je = C.a.Get(re + \"/mapping/\" + We, oe._variants, We), He = C.a.Get(\"#/materials/\", oe._loader.gltf.materials, Pe.material);\n                    k.push(oe._loader._loadMaterialAsync(\"#/materials/\" + Pe.material, He, H, Z, function(Qe) {\n                      me[je.name] = me[je.name] || [], me[je.name].push({ mesh: H, material: Qe });\n                    }));\n                  }, Fe = 0, ke = Pe.variants; Fe < ke.length; Fe++)\n                    be(ke[Fe]);\n              }\n            })), Promise.all(k).then(function(H) {\n              return H[0];\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_variants\", function(ae) {\n        return new v(ae);\n      });\n      var b = V(4), D = function() {\n        function ae(ee, K) {\n          var $ = this;\n          this._opaqueRenderTarget = null, this._opaqueMeshesCache = [], this._transparentMeshesCache = [], this._options = Object(b.a)(Object(b.a)({}, ae._getDefaultOptions()), ee), this._scene = K, this._scene._transmissionHelper = this, this.onErrorObservable = new _.Observable(), this._scene.onDisposeObservable.addOnce(function(L) {\n            $.dispose();\n          }), this._parseScene(), this._setupRenderTargets();\n        }\n        return ae._getDefaultOptions = function() {\n          return { renderSize: 512 };\n        }, ae.prototype.updateOptions = function(ee) {\n          var K = this;\n          if (Object.keys(ee).filter(function(G) {\n            return K._options[G] !== ee[G];\n          }).length) {\n            var $ = Object(b.a)(Object(b.a)({}, this._options), ee), L = this._options;\n            this._options = $, $.renderSize !== L.renderSize && this._setupRenderTargets();\n          }\n        }, ae.prototype.getOpaqueTarget = function() {\n          return this._opaqueRenderTarget;\n        }, ae.prototype.shouldRenderAsTransmission = function(ee) {\n          return !!ee && !!(ee instanceof _.PBRMaterial && ee.subSurface.isRefractionEnabled);\n        }, ae.prototype._addMesh = function(ee) {\n          ee instanceof _.Mesh && (ee.onMaterialChangedObservable.add(this.onMeshMaterialChanged.bind(this)), this.shouldRenderAsTransmission(ee.material) ? this._transparentMeshesCache.push(ee) : this._opaqueMeshesCache.push(ee));\n        }, ae.prototype._removeMesh = function(ee) {\n          if (ee instanceof _.Mesh) {\n            ee.onMaterialChangedObservable.remove(this.onMeshMaterialChanged.bind(this));\n            var K = this._transparentMeshesCache.indexOf(ee);\n            K !== -1 && this._transparentMeshesCache.splice(K, 1), (K = this._opaqueMeshesCache.indexOf(ee)) !== -1 && this._opaqueMeshesCache.splice(K, 1);\n          }\n        }, ae.prototype._parseScene = function() {\n          this._scene.meshes.forEach(this._addMesh.bind(this)), this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)), this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));\n        }, ae.prototype.onMeshMaterialChanged = function(ee) {\n          if (ee instanceof _.Mesh) {\n            var K = this._transparentMeshesCache.indexOf(ee), $ = this._opaqueMeshesCache.indexOf(ee);\n            this.shouldRenderAsTransmission(ee.material) ? (ee.material instanceof _.PBRMaterial && (ee.material.subSurface.refractionTexture = this._opaqueRenderTarget), $ !== -1 ? (this._opaqueMeshesCache.splice($, 1), this._transparentMeshesCache.push(ee)) : K === -1 && this._transparentMeshesCache.push(ee)) : K !== -1 ? (this._transparentMeshesCache.splice(K, 1), this._opaqueMeshesCache.push(ee)) : $ === -1 && this._opaqueMeshesCache.push(ee);\n          }\n        }, ae.prototype._setupRenderTargets = function() {\n          var ee = this, K = -1;\n          if (this._scene.layers && this._opaqueRenderTarget)\n            for (var $ = 0, L = this._scene.layers; $ < L.length; $++) {\n              var G = (re = L[$]).renderTargetTextures.indexOf(this._opaqueRenderTarget);\n              G >= 0 && re.renderTargetTextures.splice(G, 1);\n            }\n          if (this._opaqueRenderTarget && (K = this._scene.customRenderTargets.indexOf(this._opaqueRenderTarget), this._opaqueRenderTarget.dispose()), this._opaqueRenderTarget = new _.RenderTargetTexture(\"opaqueSceneTexture\", this._options.renderSize, this._scene, !0), this._opaqueRenderTarget.renderList = this._opaqueMeshesCache, this._opaqueRenderTarget.gammaSpace = !0, this._opaqueRenderTarget.lodGenerationScale = 1, this._opaqueRenderTarget.lodGenerationOffset = -4, K >= 0 ? this._scene.customRenderTargets.splice(K, 0, this._opaqueRenderTarget) : (K = this._scene.customRenderTargets.length, this._scene.customRenderTargets.push(this._opaqueRenderTarget)), this._scene.layers && this._opaqueRenderTarget)\n            for (var Q = 0, oe = this._scene.layers; Q < oe.length; Q++) {\n              var re;\n              (re = oe[Q]).renderTargetTextures.push(this._opaqueRenderTarget);\n            }\n          this._transparentMeshesCache.forEach(function(Y) {\n            ee.shouldRenderAsTransmission(Y.material) && Y.material instanceof _.PBRMaterial && (Y.material.refractionTexture = ee._opaqueRenderTarget);\n          });\n        }, ae.prototype.dispose = function() {\n          this._scene._transmissionHelper = void 0, this._opaqueRenderTarget && (this._opaqueRenderTarget.dispose(), this._opaqueRenderTarget = null), this._transparentMeshesCache = [], this._opaqueMeshesCache = [];\n        }, ae;\n      }(), w = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_transmission\", this.order = 175, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_transmission\"), this.enabled && (ee.parent.transparencyAsCoverage = !0);\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialBasePropertiesAsync(ee, K, $)), oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadTransparentPropertiesAsync(G, K, $, Q)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadTransparentPropertiesAsync = function(ee, K, $, L) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var G = $;\n          if (G.subSurface.isRefractionEnabled = !0, G.subSurface.volumeIndexOfRefraction = 1, G.subSurface.useAlbedoToTintRefraction = !0, L.transmissionFactor === void 0)\n            return G.subSurface.refractionIntensity = 0, G.subSurface.isRefractionEnabled = !1, Promise.resolve();\n          G.subSurface.refractionIntensity = L.transmissionFactor;\n          var Q = G.getScene();\n          return G.subSurface.refractionIntensity && !Q._transmissionHelper && new D({}, G.getScene()), L.transmissionTexture ? (L.transmissionTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(ee + \"/transmissionTexture\", L.transmissionTexture, void 0).then(function(oe) {\n            G.subSurface.thicknessTexture = oe, G.subSurface.useMaskFromThicknessTextureGltf = !0;\n          })) : Promise.resolve();\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_transmission\", function(ae) {\n        return new w(ae);\n      });\n      var N = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_translucency\", this.order = 175, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_translucency\"), this.enabled && (ee.parent.transparencyAsCoverage = !0);\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialBasePropertiesAsync(ee, K, $)), oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadTranslucentPropertiesAsync(G, K, $, Q)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadTranslucentPropertiesAsync = function(ee, K, $, L) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var G = $;\n          return G.subSurface.isTranslucencyEnabled = !0, G.subSurface.volumeIndexOfRefraction = 1, G.subSurface.minimumThickness = 0, G.subSurface.maximumThickness = 0, G.subSurface.useAlbedoToTintRefraction = !0, L.translucencyFactor === void 0 ? (G.subSurface.translucencyIntensity = 0, G.subSurface.isTranslucencyEnabled = !1, Promise.resolve()) : (G.subSurface.translucencyIntensity = L.translucencyFactor, L.translucencyTexture ? this._loader.loadTextureInfoAsync(ee + \"/translucencyTexture\", L.translucencyTexture).then(function(Q) {\n            G.subSurface.thicknessTexture = Q, G.subSurface.useMaskFromThicknessTextureGltf = !0;\n          }) : Promise.resolve());\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_translucency\", function(ae) {\n        return new N(ae);\n      });\n      var M = function() {\n        function ae(ee) {\n          this.name = \"KHR_mesh_quantization\", this.enabled = ee.isExtensionUsed(\"KHR_mesh_quantization\");\n        }\n        return ae.prototype.dispose = function() {\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_mesh_quantization\", function(ae) {\n        return new M(ae);\n      });\n      var U = function() {\n        function ae(ee) {\n          this.name = \"KHR_texture_basisu\", this._loader = ee, this.enabled = ee.isExtensionUsed(\"KHR_texture_basisu\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype._loadTextureAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = K.sampler == null ? C.b.DefaultSampler : C.a.Get(ee + \"/sampler\", L._loader.gltf.samplers, K.sampler), re = C.a.Get(G + \"/source\", L._loader.gltf.images, Q.source);\n            return L._loader._createTextureAsync(ee, oe, re, function(Y) {\n              $(Y);\n            }, K._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: !0 } : void 0);\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_texture_basisu\", function(ae) {\n        return new U(ae);\n      });\n      var X = function() {\n        function ae(ee) {\n          this.name = \"KHR_texture_transform\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_texture_transform\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadTextureInfoAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            return L._loader.loadTextureInfoAsync(ee, K, function(oe) {\n              if (!(oe instanceof _.Texture))\n                throw new Error(G + \": Texture type not supported\");\n              Q.offset && (oe.uOffset = Q.offset[0], oe.vOffset = Q.offset[1]), oe.uRotationCenter = 0, oe.vRotationCenter = 0, Q.rotation && (oe.wAng = -Q.rotation), Q.scale && (oe.uScale = Q.scale[0], oe.vScale = Q.scale[1]), Q.texCoord != null && (oe.coordinatesIndex = Q.texCoord), $(oe);\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_texture_transform\", function(ae) {\n        return new X(ae);\n      });\n      var j = function() {\n        function ae(ee) {\n          this.name = \"MSFT_audio_emitter\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_audio_emitter\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, this._clips = null, this._emitters = null;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._clips = K.clips, this._emitters = K.emitters, C.a.Assign(this._clips), C.a.Assign(this._emitters);\n          }\n        }, ae.prototype.loadSceneAsync = function(ee, K) {\n          var $ = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(L, G) {\n            var Q = new Array();\n            Q.push($._loader.loadSceneAsync(ee, K));\n            for (var oe = 0, re = G.emitters; oe < re.length; oe++) {\n              var Y = re[oe], k = C.a.Get(L + \"/emitters\", $._emitters, Y);\n              if (k.refDistance != null || k.maxDistance != null || k.rolloffFactor != null || k.distanceModel != null || k.innerAngle != null || k.outerAngle != null)\n                throw new Error(L + \": Direction or Distance properties are not allowed on emitters attached to a scene\");\n              Q.push($._loadEmitterAsync(L + \"/emitters/\" + k.index, k));\n            }\n            return Promise.all(Q).then(function() {\n            });\n          });\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return L._loader.loadNodeAsync(G, K, function(re) {\n              for (var Y = function(Z) {\n                var W = C.a.Get(G + \"/emitters\", L._emitters, Z);\n                oe.push(L._loadEmitterAsync(G + \"/emitters/\" + W.index, W).then(function() {\n                  for (var q = 0, he = W._babylonSounds; q < he.length; q++) {\n                    var ge = he[q];\n                    ge.attachToMesh(re), W.innerAngle == null && W.outerAngle == null || (ge.setLocalDirectionToMesh(_.Vector3.Forward()), ge.setDirectionalCone(2 * _.Tools.ToDegrees(W.innerAngle == null ? Math.PI : W.innerAngle), 2 * _.Tools.ToDegrees(W.outerAngle == null ? Math.PI : W.outerAngle), 0));\n                  }\n                }));\n              }, k = 0, H = Q.emitters; k < H.length; k++)\n                Y(H[k]);\n              $(re);\n            }).then(function(re) {\n              return Promise.all(oe).then(function() {\n                return re;\n              });\n            });\n          });\n        }, ae.prototype.loadAnimationAsync = function(ee, K) {\n          var $ = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(L, G) {\n            return $._loader.loadAnimationAsync(ee, K).then(function(Q) {\n              var oe = new Array();\n              C.a.Assign(G.events);\n              for (var re = 0, Y = G.events; re < Y.length; re++) {\n                var k = Y[re];\n                oe.push($._loadAnimationEventAsync(L + \"/events/\" + k.index, ee, K, k, Q));\n              }\n              return Promise.all(oe).then(function() {\n                return Q;\n              });\n            });\n          });\n        }, ae.prototype._loadClipAsync = function(ee, K) {\n          if (K._objectURL)\n            return K._objectURL;\n          var $;\n          if (K.uri)\n            $ = this._loader.loadUriAsync(ee, K, K.uri);\n          else {\n            var L = C.a.Get(ee + \"/bufferView\", this._loader.gltf.bufferViews, K.bufferView);\n            $ = this._loader.loadBufferViewAsync(\"/bufferViews/\" + L.index, L);\n          }\n          return K._objectURL = $.then(function(G) {\n            return URL.createObjectURL(new Blob([G], { type: K.mimeType }));\n          }), K._objectURL;\n        }, ae.prototype._loadEmitterAsync = function(ee, K) {\n          var $ = this;\n          if (K._babylonSounds = K._babylonSounds || [], !K._babylonData) {\n            for (var L = new Array(), G = K.name || \"emitter\" + K.index, Q = { loop: !1, autoplay: !1, volume: K.volume == null ? 1 : K.volume }, oe = function(H) {\n              var Z = \"/extensions/\" + re.name + \"/clips\", W = C.a.Get(Z, re._clips, K.clips[H].clip);\n              L.push(re._loadClipAsync(Z + \"/\" + K.clips[H].clip, W).then(function(q) {\n                var he = K._babylonSounds[H] = new _.Sound(G, q, $._loader.babylonScene, null, Q);\n                he.refDistance = K.refDistance || 1, he.maxDistance = K.maxDistance || 256, he.rolloffFactor = K.rolloffFactor || 1, he.distanceModel = K.distanceModel || \"exponential\", he._positionInEmitterSpace = !0;\n              }));\n            }, re = this, Y = 0; Y < K.clips.length; Y++)\n              oe(Y);\n            var k = Promise.all(L).then(function() {\n              var H = K.clips.map(function(W) {\n                return W.weight || 1;\n              }), Z = new _.WeightedSound(K.loop || !1, K._babylonSounds, H);\n              K.innerAngle && (Z.directionalConeInnerAngle = 2 * _.Tools.ToDegrees(K.innerAngle)), K.outerAngle && (Z.directionalConeOuterAngle = 2 * _.Tools.ToDegrees(K.outerAngle)), K.volume && (Z.volume = K.volume), K._babylonData.sound = Z;\n            });\n            K._babylonData = { loaded: k };\n          }\n          return K._babylonData.loaded;\n        }, ae.prototype._getEventAction = function(ee, K, $, L, G) {\n          switch ($) {\n            case \"play\":\n              return function(Q) {\n                var oe = (G || 0) + (Q - L);\n                K.play(oe);\n              };\n            case \"stop\":\n              return function(Q) {\n                K.stop();\n              };\n            case \"pause\":\n              return function(Q) {\n                K.pause();\n              };\n            default:\n              throw new Error(ee + \": Unsupported action \" + $);\n          }\n        }, ae.prototype._loadAnimationEventAsync = function(ee, K, $, L, G) {\n          var Q = this;\n          if (G.targetedAnimations.length == 0)\n            return Promise.resolve();\n          var oe = G.targetedAnimations[0], re = L.emitter, Y = C.a.Get(\"/extensions/\" + this.name + \"/emitters\", this._emitters, re);\n          return this._loadEmitterAsync(ee, Y).then(function() {\n            var k = Y._babylonData.sound;\n            if (k) {\n              var H = new _.AnimationEvent(L.time, Q._getEventAction(ee, k, L.action, L.time, L.startOffset));\n              oe.animation.addEvent(H), G.onAnimationGroupEndObservable.add(function() {\n                k.stop();\n              }), G.onAnimationGroupPauseObservable.add(function() {\n                k.pause();\n              });\n            }\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_audio_emitter\", function(ae) {\n        return new j(ae);\n      });\n      var ne = function() {\n        function ae(ee) {\n          this.name = \"MSFT_lod\", this.order = 100, this.maxLODsToLoad = 10, this.onNodeLODsLoadedObservable = new _.Observable(), this.onMaterialLODsLoadedObservable = new _.Observable(), this._bufferLODs = new Array(), this._nodeIndexLOD = null, this._nodeSignalLODs = new Array(), this._nodePromiseLODs = new Array(), this._nodeBufferLODs = new Array(), this._materialIndexLOD = null, this._materialSignalLODs = new Array(), this._materialPromiseLODs = new Array(), this._materialBufferLODs = new Array(), this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_lod\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, this._nodeIndexLOD = null, this._nodeSignalLODs.length = 0, this._nodePromiseLODs.length = 0, this._nodeBufferLODs.length = 0, this._materialIndexLOD = null, this._materialSignalLODs.length = 0, this._materialPromiseLODs.length = 0, this._materialBufferLODs.length = 0, this.onMaterialLODsLoadedObservable.clear(), this.onNodeLODsLoadedObservable.clear();\n        }, ae.prototype.onReady = function() {\n          for (var ee = this, K = function(oe) {\n            var re = Promise.all($._nodePromiseLODs[oe]).then(function() {\n              oe !== 0 && (ee._loader.endPerformanceCounter(\"Node LOD \" + oe), ee._loader.log(\"Loaded node LOD \" + oe)), ee.onNodeLODsLoadedObservable.notifyObservers(oe), oe !== ee._nodePromiseLODs.length - 1 && (ee._loader.startPerformanceCounter(\"Node LOD \" + (oe + 1)), ee._loadBufferLOD(ee._nodeBufferLODs, oe + 1), ee._nodeSignalLODs[oe] && ee._nodeSignalLODs[oe].resolve());\n            });\n            $._loader._completePromises.push(re);\n          }, $ = this, L = 0; L < this._nodePromiseLODs.length; L++)\n            K(L);\n          var G = function(oe) {\n            var re = Promise.all(Q._materialPromiseLODs[oe]).then(function() {\n              oe !== 0 && (ee._loader.endPerformanceCounter(\"Material LOD \" + oe), ee._loader.log(\"Loaded material LOD \" + oe)), ee.onMaterialLODsLoadedObservable.notifyObservers(oe), oe !== ee._materialPromiseLODs.length - 1 && (ee._loader.startPerformanceCounter(\"Material LOD \" + (oe + 1)), ee._loadBufferLOD(ee._materialBufferLODs, oe + 1), ee._materialSignalLODs[oe] && ee._materialSignalLODs[oe].resolve());\n            });\n            Q._loader._completePromises.push(re);\n          }, Q = this;\n          for (L = 0; L < this._materialPromiseLODs.length; L++)\n            G(L);\n        }, ae.prototype.loadSceneAsync = function(ee, K) {\n          var $ = this._loader.loadSceneAsync(ee, K);\n          return this._loadBufferLOD(this._bufferLODs, 0), $;\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe, re = L._getLODs(G, K, L._loader.gltf.nodes, Q.ids);\n            L._loader.logOpen(\"\" + G);\n            for (var Y = function(H) {\n              var Z = re[H];\n              H !== 0 && (L._nodeIndexLOD = H, L._nodeSignalLODs[H] = L._nodeSignalLODs[H] || new _.Deferred());\n              var W = L._loader.loadNodeAsync(\"/nodes/\" + Z.index, Z, function(q) {\n                q.setEnabled(!1);\n              }).then(function(q) {\n                if (H !== 0) {\n                  var he = re[H - 1];\n                  he._babylonTransformNode && (L._disposeTransformNode(he._babylonTransformNode), delete he._babylonTransformNode);\n                }\n                return q.setEnabled(!0), q;\n              });\n              L._nodePromiseLODs[H] = L._nodePromiseLODs[H] || [], H === 0 ? oe = W : (L._nodeIndexLOD = null, L._nodePromiseLODs[H].push(W));\n            }, k = 0; k < re.length; k++)\n              Y(k);\n            return L._loader.logClose(), oe;\n          });\n        }, ae.prototype._loadMaterialAsync = function(ee, K, $, L, G) {\n          var Q = this;\n          return this._nodeIndexLOD ? null : C.b.LoadExtensionAsync(ee, K, this.name, function(oe, re) {\n            var Y, k = Q._getLODs(oe, K, Q._loader.gltf.materials, re.ids);\n            Q._loader.logOpen(\"\" + oe);\n            for (var H = function(W) {\n              var q = k[W];\n              W !== 0 && (Q._materialIndexLOD = W);\n              var he = Q._loader._loadMaterialAsync(\"/materials/\" + q.index, q, $, L, function(ge) {\n                W === 0 && G(ge);\n              }).then(function(ge) {\n                if (W !== 0) {\n                  G(ge);\n                  var me = k[W - 1]._data;\n                  me[L] && (Q._disposeMaterials([me[L].babylonMaterial]), delete me[L]);\n                }\n                return ge;\n              });\n              Q._materialPromiseLODs[W] = Q._materialPromiseLODs[W] || [], W === 0 ? Y = he : (Q._materialIndexLOD = null, Q._materialPromiseLODs[W].push(he));\n            }, Z = 0; Z < k.length; Z++)\n              H(Z);\n            return Q._loader.logClose(), Y;\n          });\n        }, ae.prototype._loadUriAsync = function(ee, K, $) {\n          var L = this;\n          if (this._nodeIndexLOD !== null) {\n            this._loader.log(\"deferred\");\n            var G = this._nodeIndexLOD - 1;\n            return this._nodeSignalLODs[G] = this._nodeSignalLODs[G] || new _.Deferred(), this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(function() {\n              return L._loader.loadUriAsync(ee, K, $);\n            });\n          }\n          return this._materialIndexLOD !== null ? (this._loader.log(\"deferred\"), G = this._materialIndexLOD - 1, this._materialSignalLODs[G] = this._materialSignalLODs[G] || new _.Deferred(), this._materialSignalLODs[G].promise.then(function() {\n            return L._loader.loadUriAsync(ee, K, $);\n          })) : null;\n        }, ae.prototype.loadBufferAsync = function(ee, K, $, L) {\n          if (this._loader.parent.useRangeRequests && !K.uri) {\n            if (!this._loader.bin)\n              throw new Error(ee + \": Uri is missing or the binary glTF is missing its binary chunk\");\n            var G = function(Q, oe) {\n              var re = $, Y = re + L - 1, k = Q[oe];\n              return k ? (k.start = Math.min(k.start, re), k.end = Math.max(k.end, Y)) : (k = { start: re, end: Y, loaded: new _.Deferred() }, Q[oe] = k), k.loaded.promise.then(function(H) {\n                return new Uint8Array(H.buffer, H.byteOffset + $ - k.start, L);\n              });\n            };\n            return this._loader.log(\"deferred\"), this._nodeIndexLOD !== null ? G(this._nodeBufferLODs, this._nodeIndexLOD) : this._materialIndexLOD !== null ? G(this._materialBufferLODs, this._materialIndexLOD) : G(this._bufferLODs, 0);\n          }\n          return null;\n        }, ae.prototype._loadBufferLOD = function(ee, K) {\n          var $ = ee[K];\n          $ && (this._loader.log(\"Loading buffer range [\" + $.start + \"-\" + $.end + \"]\"), this._loader.bin.readAsync($.start, $.end - $.start + 1).then(function(L) {\n            $.loaded.resolve(L);\n          }, function(L) {\n            $.loaded.reject(L);\n          }));\n        }, ae.prototype._getLODs = function(ee, K, $, L) {\n          if (this.maxLODsToLoad <= 0)\n            throw new Error(\"maxLODsToLoad must be greater than zero\");\n          for (var G = new Array(), Q = L.length - 1; Q >= 0; Q--)\n            if (G.push(C.a.Get(ee + \"/ids/\" + L[Q], $, L[Q])), G.length === this.maxLODsToLoad)\n              return G;\n          return G.push(K), G;\n        }, ae.prototype._disposeTransformNode = function(ee) {\n          var K = this, $ = new Array(), L = ee.material;\n          L && $.push(L);\n          for (var G = 0, Q = ee.getChildMeshes(); G < Q.length; G++) {\n            var oe = Q[G];\n            oe.material && $.push(oe.material);\n          }\n          ee.dispose();\n          var re = $.filter(function(Y) {\n            return K._loader.babylonScene.meshes.every(function(k) {\n              return k.material != Y;\n            });\n          });\n          this._disposeMaterials(re);\n        }, ae.prototype._disposeMaterials = function(ee) {\n          for (var K = {}, $ = 0, L = ee; $ < L.length; $++) {\n            for (var G = 0, Q = (H = L[$]).getActiveTextures(); G < Q.length; G++) {\n              var oe = Q[G];\n              K[oe.uniqueId] = oe;\n            }\n            H.dispose();\n          }\n          for (var re in K)\n            for (var Y = 0, k = this._loader.babylonScene.materials; Y < k.length; Y++) {\n              var H;\n              (H = k[Y]).hasTexture(K[re]) && delete K[re];\n            }\n          for (var re in K)\n            K[re].dispose();\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_lod\", function(ae) {\n        return new ne(ae);\n      });\n      var te = function() {\n        function ae(ee) {\n          this.name = \"MSFT_minecraftMesh\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_minecraftMesh\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtraAsync(ee, K, this.name, function(G, Q) {\n            if (Q) {\n              if (!($ instanceof _.PBRMaterial))\n                throw new Error(G + \": Material type not supported\");\n              var oe = L._loader.loadMaterialPropertiesAsync(ee, K, $);\n              return $.needAlphaBlending() && ($.forceDepthWrite = !0, $.separateCullingPass = !0), $.backFaceCulling = $.forceDepthWrite, $.twoSidedLighting = !0, oe;\n            }\n            return null;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_minecraftMesh\", function(ae) {\n        return new te(ae);\n      });\n      var de = function() {\n        function ae(ee) {\n          this.name = \"MSFT_sRGBFactors\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_sRGBFactors\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtraAsync(ee, K, this.name, function(G, Q) {\n            if (Q) {\n              if (!($ instanceof _.PBRMaterial))\n                throw new Error(G + \": Material type not supported\");\n              var oe = L._loader.loadMaterialPropertiesAsync(ee, K, $);\n              return $.albedoTexture || $.albedoColor.toLinearSpaceToRef($.albedoColor), $.reflectivityTexture || $.reflectivityColor.toLinearSpaceToRef($.reflectivityColor), oe;\n            }\n            return null;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_sRGBFactors\", function(ae) {\n        return new de(ae);\n      });\n      var pe = function() {\n        function ae(ee) {\n          this.name = \"ExtrasAsMetadata\", this.enabled = !0, this._loader = ee;\n        }\n        return ae.prototype._assignExtras = function(ee, K) {\n          if (K.extras && Object.keys(K.extras).length > 0) {\n            var $ = ee.metadata = ee.metadata || {};\n            ($.gltf = $.gltf || {}).extras = K.extras;\n          }\n        }, ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return this._loader.loadNodeAsync(ee, K, function(G) {\n            L._assignExtras(G, K), $(G);\n          });\n        }, ae.prototype.loadCameraAsync = function(ee, K, $) {\n          var L = this;\n          return this._loader.loadCameraAsync(ee, K, function(G) {\n            L._assignExtras(G, K), $(G);\n          });\n        }, ae.prototype.createMaterial = function(ee, K, $) {\n          var L = this._loader.createMaterial(ee, K, $);\n          return this._assignExtras(L, K), L;\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"ExtrasAsMetadata\", function(ae) {\n        return new pe(ae);\n      });\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFBinaryExtension\", function() {\n        return H;\n      }), V.d(f, \"GLTFLoaderBase\", function() {\n        return re;\n      }), V.d(f, \"GLTFLoader\", function() {\n        return Y;\n      }), V.d(f, \"GLTFLoaderExtension\", function() {\n        return k;\n      }), V.d(f, \"EComponentType\", function() {\n        return _;\n      }), V.d(f, \"EShaderType\", function() {\n        return C;\n      }), V.d(f, \"EParameterType\", function() {\n        return u;\n      }), V.d(f, \"ETextureWrapMode\", function() {\n        return I;\n      }), V.d(f, \"ETextureFilterType\", function() {\n        return O;\n      }), V.d(f, \"ETextureFormat\", function() {\n        return x;\n      }), V.d(f, \"ECullingType\", function() {\n        return m;\n      }), V.d(f, \"EBlendingFunction\", function() {\n        return c;\n      }), V.d(f, \"GLTFUtils\", function() {\n        return g;\n      }), V.d(f, \"GLTFMaterialsCommonExtension\", function() {\n        return Z;\n      });\n      var _, C, u, I, O, x, m, c, T = V(4);\n      (function(W) {\n        W[W.BYTE = 5120] = \"BYTE\", W[W.UNSIGNED_BYTE = 5121] = \"UNSIGNED_BYTE\", W[W.SHORT = 5122] = \"SHORT\", W[W.UNSIGNED_SHORT = 5123] = \"UNSIGNED_SHORT\", W[W.FLOAT = 5126] = \"FLOAT\";\n      })(_ || (_ = {})), function(W) {\n        W[W.FRAGMENT = 35632] = \"FRAGMENT\", W[W.VERTEX = 35633] = \"VERTEX\";\n      }(C || (C = {})), function(W) {\n        W[W.BYTE = 5120] = \"BYTE\", W[W.UNSIGNED_BYTE = 5121] = \"UNSIGNED_BYTE\", W[W.SHORT = 5122] = \"SHORT\", W[W.UNSIGNED_SHORT = 5123] = \"UNSIGNED_SHORT\", W[W.INT = 5124] = \"INT\", W[W.UNSIGNED_INT = 5125] = \"UNSIGNED_INT\", W[W.FLOAT = 5126] = \"FLOAT\", W[W.FLOAT_VEC2 = 35664] = \"FLOAT_VEC2\", W[W.FLOAT_VEC3 = 35665] = \"FLOAT_VEC3\", W[W.FLOAT_VEC4 = 35666] = \"FLOAT_VEC4\", W[W.INT_VEC2 = 35667] = \"INT_VEC2\", W[W.INT_VEC3 = 35668] = \"INT_VEC3\", W[W.INT_VEC4 = 35669] = \"INT_VEC4\", W[W.BOOL = 35670] = \"BOOL\", W[W.BOOL_VEC2 = 35671] = \"BOOL_VEC2\", W[W.BOOL_VEC3 = 35672] = \"BOOL_VEC3\", W[W.BOOL_VEC4 = 35673] = \"BOOL_VEC4\", W[W.FLOAT_MAT2 = 35674] = \"FLOAT_MAT2\", W[W.FLOAT_MAT3 = 35675] = \"FLOAT_MAT3\", W[W.FLOAT_MAT4 = 35676] = \"FLOAT_MAT4\", W[W.SAMPLER_2D = 35678] = \"SAMPLER_2D\";\n      }(u || (u = {})), function(W) {\n        W[W.CLAMP_TO_EDGE = 33071] = \"CLAMP_TO_EDGE\", W[W.MIRRORED_REPEAT = 33648] = \"MIRRORED_REPEAT\", W[W.REPEAT = 10497] = \"REPEAT\";\n      }(I || (I = {})), function(W) {\n        W[W.NEAREST = 9728] = \"NEAREST\", W[W.LINEAR = 9728] = \"LINEAR\", W[W.NEAREST_MIPMAP_NEAREST = 9984] = \"NEAREST_MIPMAP_NEAREST\", W[W.LINEAR_MIPMAP_NEAREST = 9985] = \"LINEAR_MIPMAP_NEAREST\", W[W.NEAREST_MIPMAP_LINEAR = 9986] = \"NEAREST_MIPMAP_LINEAR\", W[W.LINEAR_MIPMAP_LINEAR = 9987] = \"LINEAR_MIPMAP_LINEAR\";\n      }(O || (O = {})), function(W) {\n        W[W.ALPHA = 6406] = \"ALPHA\", W[W.RGB = 6407] = \"RGB\", W[W.RGBA = 6408] = \"RGBA\", W[W.LUMINANCE = 6409] = \"LUMINANCE\", W[W.LUMINANCE_ALPHA = 6410] = \"LUMINANCE_ALPHA\";\n      }(x || (x = {})), function(W) {\n        W[W.FRONT = 1028] = \"FRONT\", W[W.BACK = 1029] = \"BACK\", W[W.FRONT_AND_BACK = 1032] = \"FRONT_AND_BACK\";\n      }(m || (m = {})), function(W) {\n        W[W.ZERO = 0] = \"ZERO\", W[W.ONE = 1] = \"ONE\", W[W.SRC_COLOR = 768] = \"SRC_COLOR\", W[W.ONE_MINUS_SRC_COLOR = 769] = \"ONE_MINUS_SRC_COLOR\", W[W.DST_COLOR = 774] = \"DST_COLOR\", W[W.ONE_MINUS_DST_COLOR = 775] = \"ONE_MINUS_DST_COLOR\", W[W.SRC_ALPHA = 770] = \"SRC_ALPHA\", W[W.ONE_MINUS_SRC_ALPHA = 771] = \"ONE_MINUS_SRC_ALPHA\", W[W.DST_ALPHA = 772] = \"DST_ALPHA\", W[W.ONE_MINUS_DST_ALPHA = 773] = \"ONE_MINUS_DST_ALPHA\", W[W.CONSTANT_COLOR = 32769] = \"CONSTANT_COLOR\", W[W.ONE_MINUS_CONSTANT_COLOR = 32770] = \"ONE_MINUS_CONSTANT_COLOR\", W[W.CONSTANT_ALPHA = 32771] = \"CONSTANT_ALPHA\", W[W.ONE_MINUS_CONSTANT_ALPHA = 32772] = \"ONE_MINUS_CONSTANT_ALPHA\", W[W.SRC_ALPHA_SATURATE = 776] = \"SRC_ALPHA_SATURATE\";\n      }(c || (c = {}));\n      var S, E = V(0), g = function() {\n        function W() {\n        }\n        return W.SetMatrix = function(q, he, ge, me, _e) {\n          var ye = null;\n          if (ge.semantic === \"MODEL\" ? ye = he.getWorldMatrix() : ge.semantic === \"PROJECTION\" ? ye = q.getProjectionMatrix() : ge.semantic === \"VIEW\" ? ye = q.getViewMatrix() : ge.semantic === \"MODELVIEWINVERSETRANSPOSE\" ? ye = E.Matrix.Transpose(he.getWorldMatrix().multiply(q.getViewMatrix()).invert()) : ge.semantic === \"MODELVIEW\" ? ye = he.getWorldMatrix().multiply(q.getViewMatrix()) : ge.semantic === \"MODELVIEWPROJECTION\" ? ye = he.getWorldMatrix().multiply(q.getTransformMatrix()) : ge.semantic === \"MODELINVERSE\" ? ye = he.getWorldMatrix().invert() : ge.semantic === \"VIEWINVERSE\" ? ye = q.getViewMatrix().invert() : ge.semantic === \"PROJECTIONINVERSE\" ? ye = q.getProjectionMatrix().invert() : ge.semantic === \"MODELVIEWINVERSE\" ? ye = he.getWorldMatrix().multiply(q.getViewMatrix()).invert() : ge.semantic === \"MODELVIEWPROJECTIONINVERSE\" ? ye = he.getWorldMatrix().multiply(q.getTransformMatrix()).invert() : ge.semantic === \"MODELINVERSETRANSPOSE\" && (ye = E.Matrix.Transpose(he.getWorldMatrix().invert())), ye)\n            switch (ge.type) {\n              case u.FLOAT_MAT2:\n                _e.setMatrix2x2(me, E.Matrix.GetAsMatrix2x2(ye));\n                break;\n              case u.FLOAT_MAT3:\n                _e.setMatrix3x3(me, E.Matrix.GetAsMatrix3x3(ye));\n                break;\n              case u.FLOAT_MAT4:\n                _e.setMatrix(me, ye);\n            }\n        }, W.SetUniform = function(q, he, ge, me) {\n          switch (me) {\n            case u.FLOAT:\n              return q.setFloat(he, ge), !0;\n            case u.FLOAT_VEC2:\n              return q.setVector2(he, E.Vector2.FromArray(ge)), !0;\n            case u.FLOAT_VEC3:\n              return q.setVector3(he, E.Vector3.FromArray(ge)), !0;\n            case u.FLOAT_VEC4:\n              return q.setVector4(he, E.Vector4.FromArray(ge)), !0;\n            default:\n              return !1;\n          }\n        }, W.GetWrapMode = function(q) {\n          switch (q) {\n            case I.CLAMP_TO_EDGE:\n              return E.Texture.CLAMP_ADDRESSMODE;\n            case I.MIRRORED_REPEAT:\n              return E.Texture.MIRROR_ADDRESSMODE;\n            case I.REPEAT:\n            default:\n              return E.Texture.WRAP_ADDRESSMODE;\n          }\n        }, W.GetByteStrideFromType = function(q) {\n          switch (q.type) {\n            case \"VEC2\":\n              return 2;\n            case \"VEC3\":\n              return 3;\n            case \"VEC4\":\n            case \"MAT2\":\n              return 4;\n            case \"MAT3\":\n              return 9;\n            case \"MAT4\":\n              return 16;\n            default:\n              return 1;\n          }\n        }, W.GetTextureFilterMode = function(q) {\n          switch (q) {\n            case O.LINEAR:\n            case O.LINEAR_MIPMAP_NEAREST:\n            case O.LINEAR_MIPMAP_LINEAR:\n              return E.Texture.TRILINEAR_SAMPLINGMODE;\n            case O.NEAREST:\n            case O.NEAREST_MIPMAP_NEAREST:\n              return E.Texture.NEAREST_SAMPLINGMODE;\n            default:\n              return E.Texture.BILINEAR_SAMPLINGMODE;\n          }\n        }, W.GetBufferFromBufferView = function(q, he, ge, me, _e) {\n          ge = he.byteOffset + ge;\n          var ye = q.loadedBufferViews[he.buffer];\n          if (ge + me > ye.byteLength)\n            throw new Error(\"Buffer access is out of range\");\n          var Pe = ye.buffer;\n          switch (ge += ye.byteOffset, _e) {\n            case _.BYTE:\n              return new Int8Array(Pe, ge, me);\n            case _.UNSIGNED_BYTE:\n              return new Uint8Array(Pe, ge, me);\n            case _.SHORT:\n              return new Int16Array(Pe, ge, me);\n            case _.UNSIGNED_SHORT:\n              return new Uint16Array(Pe, ge, me);\n            default:\n              return new Float32Array(Pe, ge, me);\n          }\n        }, W.GetBufferFromAccessor = function(q, he) {\n          var ge = q.bufferViews[he.bufferView], me = he.count * W.GetByteStrideFromType(he);\n          return W.GetBufferFromBufferView(q, ge, he.byteOffset, me, he.componentType);\n        }, W.DecodeBufferToText = function(q) {\n          for (var he = \"\", ge = q.byteLength, me = 0; me < ge; ++me)\n            he += String.fromCharCode(q[me]);\n          return he;\n        }, W.GetDefaultMaterial = function(q) {\n          if (!W._DefaultMaterial) {\n            E.Effect.ShadersStore.GLTFDefaultMaterialVertexShader = [\"precision highp float;\", \"\", \"uniform mat4 worldView;\", \"uniform mat4 projection;\", \"\", \"attribute vec3 position;\", \"\", \"void main(void)\", \"{\", \"    gl_Position = projection * worldView * vec4(position, 1.0);\", \"}\"].join(`\n`), E.Effect.ShadersStore.GLTFDefaultMaterialPixelShader = [\"precision highp float;\", \"\", \"uniform vec4 u_emission;\", \"\", \"void main(void)\", \"{\", \"    gl_FragColor = u_emission;\", \"}\"].join(`\n`);\n            var he = { attributes: [\"position\"], uniforms: [\"worldView\", \"projection\", \"u_emission\"], samplers: new Array(), needAlphaBlending: !1 };\n            W._DefaultMaterial = new E.ShaderMaterial(\"GLTFDefaultMaterial\", q, { vertex: \"GLTFDefaultMaterial\", fragment: \"GLTFDefaultMaterial\" }, he), W._DefaultMaterial.setColor4(\"u_emission\", new E.Color4(0.5, 0.5, 0.5, 1));\n          }\n          return W._DefaultMaterial;\n        }, W._DefaultMaterial = null, W;\n      }(), l = V(2);\n      (function(W) {\n        W[W.IDENTIFIER = 1] = \"IDENTIFIER\", W[W.UNKNOWN = 2] = \"UNKNOWN\", W[W.END_OF_INPUT = 3] = \"END_OF_INPUT\";\n      })(S || (S = {}));\n      var h = function() {\n        function W(q) {\n          this._pos = 0, this.currentToken = S.UNKNOWN, this.currentIdentifier = \"\", this.currentString = \"\", this.isLetterOrDigitPattern = /^[a-zA-Z0-9]+$/, this._toParse = q, this._maxPos = q.length;\n        }\n        return W.prototype.getNextToken = function() {\n          if (this.isEnd())\n            return S.END_OF_INPUT;\n          if (this.currentString = this.read(), this.currentToken = S.UNKNOWN, this.currentString === \"_\" || this.isLetterOrDigitPattern.test(this.currentString))\n            for (this.currentToken = S.IDENTIFIER, this.currentIdentifier = this.currentString; !this.isEnd() && (this.isLetterOrDigitPattern.test(this.currentString = this.peek()) || this.currentString === \"_\"); )\n              this.currentIdentifier += this.currentString, this.forward();\n          return this.currentToken;\n        }, W.prototype.peek = function() {\n          return this._toParse[this._pos];\n        }, W.prototype.read = function() {\n          return this._toParse[this._pos++];\n        }, W.prototype.forward = function() {\n          this._pos++;\n        }, W.prototype.isEnd = function() {\n          return this._pos >= this._maxPos;\n        }, W;\n      }(), v = [\"MODEL\", \"VIEW\", \"PROJECTION\", \"MODELVIEW\", \"MODELVIEWPROJECTION\", \"JOINTMATRIX\"], b = [\"world\", \"view\", \"projection\", \"worldView\", \"worldViewProjection\", \"mBones\"], D = [\"translation\", \"rotation\", \"scale\"], w = [\"position\", \"rotationQuaternion\", \"scaling\"], N = function(W, q, he) {\n        for (var ge in W) {\n          var me = W[ge];\n          he[q][ge] = me;\n        }\n      }, M = function(W) {\n        if (W)\n          for (var q = 0; q < W.length / 2; q++)\n            W[2 * q + 1] = 1 - W[2 * q + 1];\n      }, U = function(W) {\n        if (W.semantic === \"NORMAL\")\n          return \"normal\";\n        if (W.semantic === \"POSITION\")\n          return \"position\";\n        if (W.semantic === \"JOINT\")\n          return \"matricesIndices\";\n        if (W.semantic === \"WEIGHT\")\n          return \"matricesWeights\";\n        if (W.semantic === \"COLOR\")\n          return \"color\";\n        if (W.semantic && W.semantic.indexOf(\"TEXCOORD_\") !== -1) {\n          var q = Number(W.semantic.split(\"_\")[1]);\n          return \"uv\" + (q === 0 ? \"\" : q + 1);\n        }\n        return null;\n      }, X = function(W) {\n        var q = null;\n        if (W.translation || W.rotation || W.scale) {\n          var he = E.Vector3.FromArray(W.scale || [1, 1, 1]), ge = E.Quaternion.FromArray(W.rotation || [0, 0, 0, 1]), me = E.Vector3.FromArray(W.translation || [0, 0, 0]);\n          q = E.Matrix.Compose(he, ge, me);\n        } else\n          q = E.Matrix.FromArray(W.matrix);\n        return q;\n      }, j = function(W, q, he, ge) {\n        for (var me = 0; me < ge.bones.length; me++)\n          if (ge.bones[me].name === he)\n            return ge.bones[me];\n        var _e = W.nodes;\n        for (var ye in _e) {\n          var Pe = _e[ye];\n          if (Pe.jointName) {\n            var be = Pe.children;\n            for (me = 0; me < be.length; me++) {\n              var Fe = W.nodes[be[me]];\n              if (Fe.jointName && Fe.jointName === he) {\n                var ke = X(Pe), We = new E.Bone(Pe.name || \"\", ge, j(W, q, Pe.jointName, ge), ke);\n                return We.id = ye, We;\n              }\n            }\n          }\n        }\n        return null;\n      }, ne = function(W, q) {\n        for (var he = 0; he < W.length; he++)\n          for (var ge = W[he], me = 0; me < ge.node.children.length; me++)\n            if (ge.node.children[me] === q)\n              return ge.bone;\n        return null;\n      }, te = function(W, q) {\n        var he = W.nodes, ge = he[q];\n        if (ge)\n          return { node: ge, id: q };\n        for (var me in he)\n          if ((ge = he[me]).jointName === q)\n            return { node: ge, id: me };\n        return null;\n      }, de = function(W, q) {\n        for (var he = 0; he < W.jointNames.length; he++)\n          if (W.jointNames[he] === q)\n            return !0;\n        return !1;\n      }, pe = function(W, q, he, ge, me) {\n        if (ge || (ge = new E.Skeleton(q.name || \"\", \"\", W.scene)), !q.babylonSkeleton)\n          return ge;\n        var _e = [], ye = [];\n        (function(pt, Tt, Lt, Ot) {\n          for (var St in pt.nodes) {\n            var Ct = pt.nodes[St], nn = St;\n            if (Ct.jointName && !de(Lt, Ct.jointName)) {\n              var Qt = X(Ct), $t = new E.Bone(Ct.name || \"\", Tt, null, Qt);\n              $t.id = nn, Ot.push({ bone: $t, node: Ct, id: nn });\n            }\n          }\n          for (var Ie = 0; Ie < Ot.length; Ie++)\n            for (var Sn = Ot[Ie], en = Sn.node.children, An = 0; An < en.length; An++) {\n              for (var Ue = null, Pn = 0; Pn < Ot.length; Pn++)\n                if (Ot[Pn].id === en[An]) {\n                  Ue = Ot[Pn];\n                  break;\n                }\n              Ue && (Ue.bone._parent = Sn.bone, Sn.bone.children.push(Ue.bone));\n            }\n        })(W, ge, q, _e), ge.bones = [];\n        for (var Pe = 0; Pe < q.jointNames.length; Pe++)\n          if (at = te(W, q.jointNames[Pe])) {\n            var be = at.node;\n            if (be) {\n              me = at.id;\n              var Fe = W.scene.getBoneByID(me);\n              if (Fe)\n                ge.bones.push(Fe);\n              else {\n                for (var ke = !1, We = null, je = 0; je < Pe; je++) {\n                  var He = te(W, q.jointNames[je]);\n                  if (He) {\n                    var Qe = He.node;\n                    if (Qe) {\n                      var Ge = Qe.children;\n                      if (Ge) {\n                        ke = !1;\n                        for (var tt = 0; tt < Ge.length; tt++)\n                          if (Ge[tt] === me) {\n                            We = j(W, q, q.jointNames[je], ge), ke = !0;\n                            break;\n                          }\n                        if (ke)\n                          break;\n                      }\n                    } else\n                      E.Tools.Warn(\"Joint named \" + q.jointNames[je] + \" does not exist when looking for parent\");\n                  }\n                }\n                var Je = X(be);\n                !We && _e.length > 0 && (We = ne(_e, me)) && ye.indexOf(We) === -1 && ye.push(We), new E.Bone(be.jointName || \"\", ge, We, Je).id = me;\n              }\n            } else\n              E.Tools.Warn(\"Joint named \" + q.jointNames[Pe] + \" does not exist\");\n          }\n        var st = ge.bones;\n        for (ge.bones = [], Pe = 0; Pe < q.jointNames.length; Pe++) {\n          var at;\n          if (at = te(W, q.jointNames[Pe])) {\n            for (je = 0; je < st.length; je++)\n              if (st[je].id === at.id) {\n                ge.bones.push(st[je]);\n                break;\n              }\n          }\n        }\n        for (ge.prepare(), Pe = 0; Pe < ye.length; Pe++)\n          ge.bones.push(ye[Pe]);\n        return ge;\n      }, ae = function(W, q, he, ge, me) {\n        if (me || (W.scene._blockEntityCollection = W.forAssetContainer, me = new E.Mesh(q.name || \"\", W.scene), W.scene._blockEntityCollection = !1, me.id = ge), !q.babylonNode)\n          return me;\n        for (var _e, ye = [], Pe = null, be = new Array(), Fe = new Array(), ke = new Array(), We = new Array(), je = 0; je < he.length; je++) {\n          var He = he[je];\n          if ($t = W.meshes[He])\n            for (var Qe = 0; Qe < $t.primitives.length; Qe++) {\n              var Ge = new E.VertexData(), tt = $t.primitives[Qe];\n              tt.mode;\n              var Je = tt.attributes, st = null, at = null;\n              for (var pt in Je)\n                if (st = W.accessors[Je[pt]], at = g.GetBufferFromAccessor(W, st), pt === \"NORMAL\")\n                  Ge.normals = new Float32Array(at.length), Ge.normals.set(at);\n                else if (pt === \"POSITION\") {\n                  if (l.GLTFFileLoader.HomogeneousCoordinates) {\n                    Ge.positions = new Float32Array(at.length - at.length / 4);\n                    for (var Tt = 0; Tt < at.length; Tt += 4)\n                      Ge.positions[Tt] = at[Tt], Ge.positions[Tt + 1] = at[Tt + 1], Ge.positions[Tt + 2] = at[Tt + 2];\n                  } else\n                    Ge.positions = new Float32Array(at.length), Ge.positions.set(at);\n                  Fe.push(Ge.positions.length);\n                } else if (pt.indexOf(\"TEXCOORD_\") !== -1) {\n                  var Lt = Number(pt.split(\"_\")[1]), Ot = E.VertexBuffer.UVKind + (Lt === 0 ? \"\" : Lt + 1), St = new Float32Array(at.length);\n                  St.set(at), M(St), Ge.set(St, Ot);\n                } else\n                  pt === \"JOINT\" ? (Ge.matricesIndices = new Float32Array(at.length), Ge.matricesIndices.set(at)) : pt === \"WEIGHT\" ? (Ge.matricesWeights = new Float32Array(at.length), Ge.matricesWeights.set(at)) : pt === \"COLOR\" && (Ge.colors = new Float32Array(at.length), Ge.colors.set(at));\n              if (st = W.accessors[tt.indices])\n                at = g.GetBufferFromAccessor(W, st), Ge.indices = new Int32Array(at.length), Ge.indices.set(at), We.push(Ge.indices.length);\n              else {\n                var Ct = [];\n                for (Tt = 0; Tt < Ge.positions.length / 3; Tt++)\n                  Ct.push(Tt);\n                Ge.indices = new Int32Array(Ct), We.push(Ge.indices.length);\n              }\n              Pe ? Pe.merge(Ge) : Pe = Ge;\n              var nn = W.scene.getMaterialByID(tt.material);\n              ye.push(nn === null ? g.GetDefaultMaterial(W.scene) : nn), be.push(be.length === 0 ? 0 : be[be.length - 1] + Fe[Fe.length - 2]), ke.push(ke.length === 0 ? 0 : ke[ke.length - 1] + We[We.length - 2]);\n            }\n        }\n        W.scene._blockEntityCollection = W.forAssetContainer, ye.length > 1 ? (_e = new E.MultiMaterial(\"multimat\" + ge, W.scene)).subMaterials = ye : _e = new E.StandardMaterial(\"multimat\" + ge, W.scene), ye.length === 1 && (_e = ye[0]), me.material || (me.material = _e), new E.Geometry(ge, W.scene, Pe, !1, me), me.computeWorldMatrix(!0), W.scene._blockEntityCollection = !1, me.subMeshes = [];\n        var Qt = 0;\n        for (je = 0; je < he.length; je++) {\n          var $t;\n          if (He = he[je], $t = W.meshes[He])\n            for (Qe = 0; Qe < $t.primitives.length; Qe++)\n              $t.primitives[Qe].mode, E.SubMesh.AddToMesh(Qt, be[Qt], Fe[Qt], ke[Qt], We[Qt], me, me, !0), Qt++;\n        }\n        return me;\n      }, ee = function(W, q, he, ge) {\n        W.position && (W.position = q), (W.rotationQuaternion || W.rotation) && (W.rotationQuaternion = he), W.scaling && (W.scaling = ge);\n      }, K = function(W, q, he, ge) {\n        var me = null;\n        if (W.importOnlyMeshes && (q.skin || q.meshes) && W.importMeshesNames && W.importMeshesNames.length > 0 && W.importMeshesNames.indexOf(q.name || \"\") === -1)\n          return null;\n        if (q.skin) {\n          if (q.meshes) {\n            var _e = W.skins[q.skin];\n            (ye = ae(W, q, q.meshes, he, q.babylonNode)).skeleton = W.scene.getLastSkeletonByID(q.skin), ye.skeleton === null && (ye.skeleton = pe(W, _e, 0, _e.babylonSkeleton, q.skin), _e.babylonSkeleton || (_e.babylonSkeleton = ye.skeleton)), me = ye;\n          }\n        } else if (q.meshes) {\n          var ye;\n          me = ye = ae(W, q, q.mesh ? [q.mesh] : q.meshes, he, q.babylonNode);\n        } else if (!q.light || q.babylonNode || W.importOnlyMeshes) {\n          if (q.camera && !q.babylonNode && !W.importOnlyMeshes) {\n            var Pe = W.cameras[q.camera];\n            if (Pe) {\n              if (W.scene._blockEntityCollection = W.forAssetContainer, Pe.type === \"orthographic\") {\n                var be = new E.FreeCamera(q.camera, E.Vector3.Zero(), W.scene, !1);\n                be.name = q.name || \"\", be.mode = E.Camera.ORTHOGRAPHIC_CAMERA, be.attachControl(), me = be;\n              } else if (Pe.type === \"perspective\") {\n                var Fe = Pe[Pe.type], ke = new E.FreeCamera(q.camera, E.Vector3.Zero(), W.scene, !1);\n                ke.name = q.name || \"\", ke.attachControl(), Fe.aspectRatio || (Fe.aspectRatio = W.scene.getEngine().getRenderWidth() / W.scene.getEngine().getRenderHeight()), Fe.znear && Fe.zfar && (ke.maxZ = Fe.zfar, ke.minZ = Fe.znear), me = ke;\n              }\n              W.scene._blockEntityCollection = !1;\n            }\n          }\n        } else {\n          var We = W.lights[q.light];\n          if (We) {\n            if (We.type === \"ambient\") {\n              var je = We[We.type], He = new E.HemisphericLight(q.light, E.Vector3.Zero(), W.scene);\n              He.name = q.name || \"\", je.color && (He.diffuse = E.Color3.FromArray(je.color)), me = He;\n            } else if (We.type === \"directional\") {\n              var Qe = We[We.type], Ge = new E.DirectionalLight(q.light, E.Vector3.Zero(), W.scene);\n              Ge.name = q.name || \"\", Qe.color && (Ge.diffuse = E.Color3.FromArray(Qe.color)), me = Ge;\n            } else if (We.type === \"point\") {\n              var tt = We[We.type], Je = new E.PointLight(q.light, E.Vector3.Zero(), W.scene);\n              Je.name = q.name || \"\", tt.color && (Je.diffuse = E.Color3.FromArray(tt.color)), me = Je;\n            } else if (We.type === \"spot\") {\n              var st = We[We.type], at = new E.SpotLight(q.light, E.Vector3.Zero(), E.Vector3.Zero(), 0, 0, W.scene);\n              at.name = q.name || \"\", st.color && (at.diffuse = E.Color3.FromArray(st.color)), st.fallOfAngle && (at.angle = st.fallOfAngle), st.fallOffExponent && (at.exponent = st.fallOffExponent), me = at;\n            }\n          }\n        }\n        if (!q.jointName) {\n          if (q.babylonNode)\n            return q.babylonNode;\n          if (me === null) {\n            W.scene._blockEntityCollection = W.forAssetContainer;\n            var pt = new E.Mesh(q.name || \"\", W.scene);\n            W.scene._blockEntityCollection = !1, q.babylonNode = pt, me = pt;\n          }\n        }\n        if (me !== null) {\n          if (q.matrix && me instanceof E.Mesh)\n            (function(St, Ct, nn) {\n              if (Ct.matrix) {\n                var Qt = new E.Vector3(0, 0, 0), $t = new E.Quaternion(), Ie = new E.Vector3(0, 0, 0);\n                E.Matrix.FromArray(Ct.matrix).decompose(Ie, $t, Qt), ee(St, Qt, $t, Ie);\n              } else\n                Ct.translation && Ct.rotation && Ct.scale && ee(St, E.Vector3.FromArray(Ct.translation), E.Quaternion.FromArray(Ct.rotation), E.Vector3.FromArray(Ct.scale));\n              St.computeWorldMatrix(!0);\n            })(me, q);\n          else {\n            var Tt = q.translation || [0, 0, 0], Lt = q.rotation || [0, 0, 0, 1], Ot = q.scale || [1, 1, 1];\n            ee(me, E.Vector3.FromArray(Tt), E.Quaternion.FromArray(Lt), E.Vector3.FromArray(Ot));\n          }\n          me.updateCache(!0), q.babylonNode = me;\n        }\n        return me;\n      }, $ = function(W, q, he, ge) {\n        ge === void 0 && (ge = !1);\n        var me = W.nodes[q], _e = null;\n        if (ge = !(W.importOnlyMeshes && !ge && W.importMeshesNames) || W.importMeshesNames.indexOf(me.name || \"\") !== -1 || W.importMeshesNames.length === 0, !me.jointName && ge && (_e = K(W, me, q)) !== null && (_e.id = q, _e.parent = he), me.children)\n          for (var ye = 0; ye < me.children.length; ye++)\n            $(W, me.children[ye], _e, ge);\n      }, L = function(W) {\n        var q = W.currentScene;\n        if (q)\n          for (var he = 0; he < q.nodes.length; he++)\n            $(W, q.nodes[he], null);\n        else\n          for (var ge in W.scenes)\n            for (q = W.scenes[ge], he = 0; he < q.nodes.length; he++)\n              $(W, q.nodes[he], null);\n        for (function(_e) {\n          for (var ye in _e.animations) {\n            var Pe = _e.animations[ye];\n            if (Pe.channels && Pe.samplers)\n              for (var be = null, Fe = 0; Fe < Pe.channels.length; Fe++) {\n                var ke = Pe.channels[Fe], We = Pe.samplers[ke.sampler];\n                if (We) {\n                  var je = null, He = null;\n                  Pe.parameters ? (je = Pe.parameters[We.input], He = Pe.parameters[We.output]) : (je = We.input, He = We.output);\n                  var Qe = g.GetBufferFromAccessor(_e, _e.accessors[je]), Ge = g.GetBufferFromAccessor(_e, _e.accessors[He]), tt = ke.target.id, Je = _e.scene.getNodeByID(tt);\n                  if (Je === null && (Je = _e.scene.getNodeByName(tt)), Je !== null) {\n                    var st = Je instanceof E.Bone, at = ke.target.path, pt = D.indexOf(at);\n                    pt !== -1 && (at = w[pt]);\n                    var Tt = E.Animation.ANIMATIONTYPE_MATRIX;\n                    st || (at === \"rotationQuaternion\" ? (Tt = E.Animation.ANIMATIONTYPE_QUATERNION, Je.rotationQuaternion = new E.Quaternion()) : Tt = E.Animation.ANIMATIONTYPE_VECTOR3);\n                    var Lt = null, Ot = [], St = 0, Ct = !1;\n                    st && be && be.getKeys().length === Qe.length && (Lt = be, Ct = !0), Ct || (_e.scene._blockEntityCollection = _e.forAssetContainer, Lt = new E.Animation(ye, st ? \"_matrix\" : at, 1, Tt, E.Animation.ANIMATIONLOOPMODE_CYCLE), _e.scene._blockEntityCollection = !1);\n                    for (var nn = 0; nn < Qe.length; nn++) {\n                      var Qt = null;\n                      if (at === \"rotationQuaternion\" ? (Qt = E.Quaternion.FromArray([Ge[St], Ge[St + 1], Ge[St + 2], Ge[St + 3]]), St += 4) : (Qt = E.Vector3.FromArray([Ge[St], Ge[St + 1], Ge[St + 2]]), St += 3), st) {\n                        var $t = Je, Ie = E.Vector3.Zero(), Sn = new E.Quaternion(), en = E.Vector3.Zero(), An = $t.getBaseMatrix();\n                        Ct && be && (An = be.getKeys()[nn].value), An.decompose(en, Sn, Ie), at === \"position\" ? Ie = Qt : at === \"rotationQuaternion\" ? Sn = Qt : en = Qt, Qt = E.Matrix.Compose(en, Sn, Ie);\n                      }\n                      Ct ? be && (be.getKeys()[nn].value = Qt) : Ot.push({ frame: Qe[nn], value: Qt });\n                    }\n                    !Ct && Lt && (Lt.setKeys(Ot), Je.animations.push(Lt)), be = Lt, _e.scene.stopAnimation(Je), _e.scene.beginAnimation(Je, 0, Qe[Qe.length - 1], !0, 1);\n                  } else\n                    E.Tools.Warn(\"Creating animation named \" + ye + \". But cannot find node named \" + tt + \" to attach to\");\n                }\n              }\n          }\n        }(W), he = 0; he < W.scene.skeletons.length; he++) {\n          var me = W.scene.skeletons[he];\n          W.scene.beginAnimation(me, 0, Number.MAX_VALUE, !0, 1);\n        }\n      }, G = function(W, q, he, ge, me, _e) {\n        return function(ye) {\n          (function(Pe, be, Fe, ke, We) {\n            var je = ke.values || Fe.parameters, He = Fe.uniforms;\n            for (var Qe in We) {\n              var Ge = We[Qe], tt = Ge.type, Je = je[He[Qe]];\n              if (Je === void 0 && (Je = Ge.value), Je) {\n                var st = function(at) {\n                  return function(pt) {\n                    Ge.value && at && (be.setTexture(at, pt), delete We[at]);\n                  };\n                };\n                tt === u.SAMPLER_2D ? k.LoadTextureAsync(Pe, ke.values ? Je : Ge.value, st(Qe), function() {\n                  return st(null);\n                }) : Ge.value && g.SetUniform(be, Qe, ke.values ? Je : Ge.value, tt) && delete We[Qe];\n              }\n            }\n          })(W, q, he, ge, me), q.onBind = function(Pe) {\n            (function(be, Fe, ke, We, je, He, Qe) {\n              var Ge = He.values || je.parameters;\n              for (var tt in ke) {\n                var Je = ke[tt], st = Je.type;\n                if (st === u.FLOAT_MAT2 || st === u.FLOAT_MAT3 || st === u.FLOAT_MAT4)\n                  if (!Je.semantic || Je.source || Je.node) {\n                    if (Je.semantic && (Je.source || Je.node)) {\n                      var at = Fe.scene.getNodeByName(Je.source || Je.node || \"\");\n                      if (at === null && (at = Fe.scene.getNodeByID(Je.source || Je.node || \"\")), at === null)\n                        continue;\n                      g.SetMatrix(Fe.scene, at, Je, tt, We.getEffect());\n                    }\n                  } else\n                    g.SetMatrix(Fe.scene, be, Je, tt, We.getEffect());\n                else {\n                  var pt = Ge[je.uniforms[tt]];\n                  if (!pt)\n                    continue;\n                  if (st === u.SAMPLER_2D) {\n                    var Tt = Fe.textures[He.values ? pt : Je.value].babylonTexture;\n                    if (Tt == null)\n                      continue;\n                    We.getEffect().setTexture(tt, Tt);\n                  } else\n                    g.SetUniform(We.getEffect(), tt, pt, st);\n                }\n              }\n              Qe(We);\n            })(Pe, W, me, q, he, ge, _e);\n          };\n        };\n      }, Q = function(W, q, he) {\n        for (var ge in q.uniforms) {\n          var me = q.uniforms[ge], _e = q.parameters[me];\n          if (W.currentIdentifier === ge && _e.semantic && !_e.source && !_e.node) {\n            var ye = v.indexOf(_e.semantic);\n            if (ye !== -1)\n              return delete he[ge], b[ye];\n          }\n        }\n        return W.currentIdentifier;\n      }, oe = function(W) {\n        for (var q in W.materials)\n          k.LoadMaterialAsync(W, q, function(he) {\n          }, function() {\n          });\n      }, re = function() {\n        function W() {\n        }\n        return W.CreateRuntime = function(q, he, ge) {\n          var me = { extensions: {}, accessors: {}, buffers: {}, bufferViews: {}, meshes: {}, lights: {}, cameras: {}, nodes: {}, images: {}, textures: {}, shaders: {}, programs: {}, samplers: {}, techniques: {}, materials: {}, animations: {}, skins: {}, extensionsUsed: [], scenes: {}, buffersCount: 0, shaderscount: 0, scene: he, rootUrl: ge, loadedBufferCount: 0, loadedBufferViews: {}, loadedShaderCount: 0, importOnlyMeshes: !1, dummyNodes: [], forAssetContainer: !1 };\n          return q.extensions && N(q.extensions, \"extensions\", me), q.extensionsUsed && N(q.extensionsUsed, \"extensionsUsed\", me), q.buffers && function(_e, ye) {\n            for (var Pe in _e) {\n              var be = _e[Pe];\n              ye.buffers[Pe] = be, ye.buffersCount++;\n            }\n          }(q.buffers, me), q.bufferViews && N(q.bufferViews, \"bufferViews\", me), q.accessors && N(q.accessors, \"accessors\", me), q.meshes && N(q.meshes, \"meshes\", me), q.lights && N(q.lights, \"lights\", me), q.cameras && N(q.cameras, \"cameras\", me), q.nodes && N(q.nodes, \"nodes\", me), q.images && N(q.images, \"images\", me), q.textures && N(q.textures, \"textures\", me), q.shaders && function(_e, ye) {\n            for (var Pe in _e) {\n              var be = _e[Pe];\n              ye.shaders[Pe] = be, ye.shaderscount++;\n            }\n          }(q.shaders, me), q.programs && N(q.programs, \"programs\", me), q.samplers && N(q.samplers, \"samplers\", me), q.techniques && N(q.techniques, \"techniques\", me), q.materials && N(q.materials, \"materials\", me), q.animations && N(q.animations, \"animations\", me), q.skins && N(q.skins, \"skins\", me), q.scenes && (me.scenes = q.scenes), q.scene && q.scenes && (me.currentScene = q.scenes[q.scene]), me;\n        }, W.LoadBufferAsync = function(q, he, ge, me, _e) {\n          var ye = q.buffers[he];\n          E.Tools.IsBase64(ye.uri) ? setTimeout(function() {\n            return ge(new Uint8Array(E.Tools.DecodeBase64(ye.uri)));\n          }) : E.Tools.LoadFile(q.rootUrl + ye.uri, function(Pe) {\n            return ge(new Uint8Array(Pe));\n          }, _e, void 0, !0, function(Pe) {\n            Pe && me(Pe.status + \" \" + Pe.statusText);\n          });\n        }, W.LoadTextureBufferAsync = function(q, he, ge, me) {\n          var _e = q.textures[he];\n          if (_e && _e.source)\n            if (_e.babylonTexture)\n              ge(null);\n            else {\n              var ye = q.images[_e.source];\n              E.Tools.IsBase64(ye.uri) ? setTimeout(function() {\n                return ge(new Uint8Array(E.Tools.DecodeBase64(ye.uri)));\n              }) : E.Tools.LoadFile(q.rootUrl + ye.uri, function(Pe) {\n                return ge(new Uint8Array(Pe));\n              }, void 0, void 0, !0, function(Pe) {\n                Pe && me(Pe.status + \" \" + Pe.statusText);\n              });\n            }\n          else\n            me(\"\");\n        }, W.CreateTextureAsync = function(q, he, ge, me, _e) {\n          var ye = q.textures[he];\n          if (ye.babylonTexture)\n            me(ye.babylonTexture);\n          else {\n            var Pe = q.samplers[ye.sampler], be = Pe.minFilter === O.NEAREST_MIPMAP_NEAREST || Pe.minFilter === O.NEAREST_MIPMAP_LINEAR || Pe.minFilter === O.LINEAR_MIPMAP_NEAREST || Pe.minFilter === O.LINEAR_MIPMAP_LINEAR, Fe = E.Texture.BILINEAR_SAMPLINGMODE, ke = ge == null ? new Blob() : new Blob([ge]), We = URL.createObjectURL(ke), je = function() {\n              return URL.revokeObjectURL(We);\n            }, He = new E.Texture(We, q.scene, !be, !0, Fe, je, je);\n            Pe.wrapS !== void 0 && (He.wrapU = g.GetWrapMode(Pe.wrapS)), Pe.wrapT !== void 0 && (He.wrapV = g.GetWrapMode(Pe.wrapT)), He.name = he, ye.babylonTexture = He, me(He);\n          }\n        }, W.LoadShaderStringAsync = function(q, he, ge, me) {\n          var _e = q.shaders[he];\n          if (E.Tools.IsBase64(_e.uri)) {\n            var ye = atob(_e.uri.split(\",\")[1]);\n            ge && ge(ye);\n          } else\n            E.Tools.LoadFile(q.rootUrl + _e.uri, ge, void 0, void 0, !1, function(Pe) {\n              Pe && me && me(Pe.status + \" \" + Pe.statusText);\n            });\n        }, W.LoadMaterialAsync = function(q, he, ge, me) {\n          var _e = q.materials[he];\n          if (_e.technique) {\n            var ye = q.techniques[_e.technique];\n            if (!ye) {\n              q.scene._blockEntityCollection = q.forAssetContainer;\n              var Pe = new E.StandardMaterial(he, q.scene);\n              return q.scene._blockEntityCollection = !1, Pe.diffuseColor = new E.Color3(0.5, 0.5, 0.5), Pe.sideOrientation = E.Material.CounterClockWiseSideOrientation, void ge(Pe);\n            }\n            var be = q.programs[ye.program], Fe = ye.states, ke = E.Effect.ShadersStore[be.vertexShader + \"VertexShader\"], We = E.Effect.ShadersStore[be.fragmentShader + \"PixelShader\"], je = \"\", He = \"\", Qe = new h(ke), Ge = new h(We), tt = {}, Je = [], st = [], at = [];\n            for (var pt in ye.uniforms) {\n              var Tt = ye.uniforms[pt], Lt = ye.parameters[Tt];\n              if (tt[pt] = Lt, !Lt.semantic || Lt.node || Lt.source)\n                Lt.type === u.SAMPLER_2D ? at.push(pt) : Je.push(pt);\n              else {\n                var Ot = v.indexOf(Lt.semantic);\n                Ot !== -1 ? (Je.push(b[Ot]), delete tt[pt]) : Je.push(pt);\n              }\n            }\n            for (var St in ye.attributes) {\n              var Ct = ye.attributes[St];\n              if (($t = ye.parameters[Ct]).semantic) {\n                var nn = U($t);\n                nn && st.push(nn);\n              }\n            }\n            for (; !Qe.isEnd() && Qe.getNextToken(); )\n              if (Qe.currentToken === S.IDENTIFIER) {\n                var Qt = !1;\n                for (var St in ye.attributes) {\n                  Ct = ye.attributes[St];\n                  var $t = ye.parameters[Ct];\n                  if (Qe.currentIdentifier === St && $t.semantic) {\n                    je += U($t), Qt = !0;\n                    break;\n                  }\n                }\n                Qt || (je += Q(Qe, ye, tt));\n              } else\n                je += Qe.currentString;\n            for (; !Ge.isEnd() && Ge.getNextToken(); )\n              Ge.currentToken === S.IDENTIFIER ? He += Q(Ge, ye, tt) : He += Ge.currentString;\n            var Ie = { vertex: be.vertexShader + he, fragment: be.fragmentShader + he }, Sn = { attributes: st, uniforms: Je, samplers: at, needAlphaBlending: Fe && Fe.enable && Fe.enable.indexOf(3042) !== -1 };\n            E.Effect.ShadersStore[be.vertexShader + he + \"VertexShader\"] = je, E.Effect.ShadersStore[be.fragmentShader + he + \"PixelShader\"] = He;\n            var en = new E.ShaderMaterial(he, q.scene, Ie, Sn);\n            if (en.onError = /* @__PURE__ */ function(Pn, rr, Xe) {\n              return function(En, Qn) {\n                rr.dispose(!0), Xe(\"Cannot compile program named \" + Pn.name + \". Error: \" + Qn + \". Default material will be applied\");\n              };\n            }(be, en, me), en.onCompiled = G(q, en, ye, _e, tt, ge), en.sideOrientation = E.Material.CounterClockWiseSideOrientation, Fe && Fe.functions) {\n              var An = Fe.functions;\n              An.cullFace && An.cullFace[0] !== m.BACK && (en.backFaceCulling = !1);\n              var Ue = An.blendFuncSeparate;\n              Ue && (Ue[0] === c.SRC_ALPHA && Ue[1] === c.ONE_MINUS_SRC_ALPHA && Ue[2] === c.ONE && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_COMBINE : Ue[0] === c.ONE && Ue[1] === c.ONE && Ue[2] === c.ZERO && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_ONEONE : Ue[0] === c.SRC_ALPHA && Ue[1] === c.ONE && Ue[2] === c.ZERO && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_ADD : Ue[0] === c.ZERO && Ue[1] === c.ONE_MINUS_SRC_COLOR && Ue[2] === c.ONE && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_SUBTRACT : Ue[0] === c.DST_COLOR && Ue[1] === c.ZERO && Ue[2] === c.ONE && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_MULTIPLY : Ue[0] === c.SRC_ALPHA && Ue[1] === c.ONE_MINUS_SRC_COLOR && Ue[2] === c.ONE && Ue[3] === c.ONE && (en.alphaMode = E.Constants.ALPHA_MAXIMIZED));\n            }\n          } else\n            me && me(\"No technique found.\");\n        }, W;\n      }(), Y = function() {\n        function W() {\n          this.state = null;\n        }\n        return W.RegisterExtension = function(q) {\n          W.Extensions[q.name] ? E.Tools.Error('Tool with the same name \"' + q.name + '\" already exists') : W.Extensions[q.name] = q;\n        }, W.prototype.dispose = function() {\n        }, W.prototype._importMeshAsync = function(q, he, ge, me, _e, ye, Pe, be) {\n          var Fe = this;\n          return he.useRightHandedSystem = !0, k.LoadRuntimeAsync(he, ge, me, function(ke) {\n            ke.forAssetContainer = _e, ke.importOnlyMeshes = !0, q === \"\" ? ke.importMeshesNames = [] : typeof q == \"string\" ? ke.importMeshesNames = [q] : !q || q instanceof Array ? (ke.importMeshesNames = [], E.Tools.Warn(\"Argument meshesNames must be of type string or string[]\")) : ke.importMeshesNames = [q], Fe._createNodes(ke);\n            var We = new Array(), je = new Array();\n            for (var He in ke.nodes) {\n              var Qe = ke.nodes[He];\n              Qe.babylonNode instanceof E.AbstractMesh && We.push(Qe.babylonNode);\n            }\n            for (var Ge in ke.skins) {\n              var tt = ke.skins[Ge];\n              tt.babylonSkeleton instanceof E.Skeleton && je.push(tt.babylonSkeleton);\n            }\n            Fe._loadBuffersAsync(ke, function() {\n              Fe._loadShadersAsync(ke, function() {\n                oe(ke), L(ke), !l.GLTFFileLoader.IncrementalLoading && ye && ye(We, je);\n              });\n            }, Pe), l.GLTFFileLoader.IncrementalLoading && ye && ye(We, je);\n          }, be), !0;\n        }, W.prototype.importMeshAsync = function(q, he, ge, me, _e, ye) {\n          var Pe = this;\n          return new Promise(function(be, Fe) {\n            Pe._importMeshAsync(q, he, me, _e, ge, function(ke, We) {\n              be({ meshes: ke, particleSystems: [], skeletons: We, animationGroups: [], lights: [], transformNodes: [], geometries: [] });\n            }, ye, function(ke) {\n              Fe(new Error(ke));\n            });\n          });\n        }, W.prototype._loadAsync = function(q, he, ge, me, _e, ye, Pe) {\n          var be = this;\n          q.useRightHandedSystem = !0, k.LoadRuntimeAsync(q, he, ge, function(Fe) {\n            k.LoadRuntimeExtensionsAsync(Fe, function() {\n              be._createNodes(Fe), be._loadBuffersAsync(Fe, function() {\n                be._loadShadersAsync(Fe, function() {\n                  oe(Fe), L(Fe), l.GLTFFileLoader.IncrementalLoading || _e();\n                });\n              }), l.GLTFFileLoader.IncrementalLoading && _e();\n            }, Pe);\n          }, Pe);\n        }, W.prototype.loadAsync = function(q, he, ge, me) {\n          var _e = this;\n          return new Promise(function(ye, Pe) {\n            _e._loadAsync(q, he, ge, !1, function() {\n              ye();\n            }, me, function(be) {\n              Pe(new Error(be));\n            });\n          });\n        }, W.prototype._loadShadersAsync = function(q, he) {\n          var ge = !1, me = function(Pe, be) {\n            k.LoadShaderStringAsync(q, Pe, function(Fe) {\n              Fe instanceof ArrayBuffer || (q.loadedShaderCount++, Fe && (E.Effect.ShadersStore[Pe + (be.type === C.VERTEX ? \"VertexShader\" : \"PixelShader\")] = Fe), q.loadedShaderCount === q.shaderscount && he());\n            }, function() {\n              E.Tools.Error(\"Error when loading shader program named \" + Pe + \" located at \" + be.uri);\n            });\n          };\n          for (var _e in q.shaders) {\n            ge = !0;\n            var ye = q.shaders[_e];\n            ye ? me.bind(this, _e, ye)() : E.Tools.Error(\"No shader named: \" + _e);\n          }\n          ge || he();\n        }, W.prototype._loadBuffersAsync = function(q, he, ge) {\n          var me = !1, _e = function(be, Fe) {\n            k.LoadBufferAsync(q, be, function(ke) {\n              q.loadedBufferCount++, ke && (ke.byteLength != q.buffers[be].byteLength && E.Tools.Error(\"Buffer named \" + be + \" is length \" + ke.byteLength + \". Expected: \" + Fe.byteLength), q.loadedBufferViews[be] = ke), q.loadedBufferCount === q.buffersCount && he();\n            }, function() {\n              E.Tools.Error(\"Error when loading buffer named \" + be + \" located at \" + Fe.uri);\n            });\n          };\n          for (var ye in q.buffers) {\n            me = !0;\n            var Pe = q.buffers[ye];\n            Pe ? _e.bind(this, ye, Pe)() : E.Tools.Error(\"No buffer named: \" + ye);\n          }\n          me || he();\n        }, W.prototype._createNodes = function(q) {\n          var he = q.currentScene;\n          if (he)\n            for (var ge = 0; ge < he.nodes.length; ge++)\n              $(q, he.nodes[ge], null);\n          else\n            for (var me in q.scenes)\n              for (he = q.scenes[me], ge = 0; ge < he.nodes.length; ge++)\n                $(q, he.nodes[ge], null);\n        }, W.Extensions = {}, W;\n      }(), k = function() {\n        function W(q) {\n          this._name = q;\n        }\n        return Object.defineProperty(W.prototype, \"name\", { get: function() {\n          return this._name;\n        }, enumerable: !1, configurable: !0 }), W.prototype.loadRuntimeAsync = function(q, he, ge, me, _e) {\n          return !1;\n        }, W.prototype.loadRuntimeExtensionsAsync = function(q, he, ge) {\n          return !1;\n        }, W.prototype.loadBufferAsync = function(q, he, ge, me, _e) {\n          return !1;\n        }, W.prototype.loadTextureBufferAsync = function(q, he, ge, me) {\n          return !1;\n        }, W.prototype.createTextureAsync = function(q, he, ge, me, _e) {\n          return !1;\n        }, W.prototype.loadShaderStringAsync = function(q, he, ge, me) {\n          return !1;\n        }, W.prototype.loadMaterialAsync = function(q, he, ge, me) {\n          return !1;\n        }, W.LoadRuntimeAsync = function(q, he, ge, me, _e) {\n          W.ApplyExtensions(function(ye) {\n            return ye.loadRuntimeAsync(q, he, ge, me, _e);\n          }, function() {\n            setTimeout(function() {\n              me && me(re.CreateRuntime(he.json, q, ge));\n            });\n          });\n        }, W.LoadRuntimeExtensionsAsync = function(q, he, ge) {\n          W.ApplyExtensions(function(me) {\n            return me.loadRuntimeExtensionsAsync(q, he, ge);\n          }, function() {\n            setTimeout(function() {\n              he();\n            });\n          });\n        }, W.LoadBufferAsync = function(q, he, ge, me, _e) {\n          W.ApplyExtensions(function(ye) {\n            return ye.loadBufferAsync(q, he, ge, me, _e);\n          }, function() {\n            re.LoadBufferAsync(q, he, ge, me, _e);\n          });\n        }, W.LoadTextureAsync = function(q, he, ge, me) {\n          W.LoadTextureBufferAsync(q, he, function(_e) {\n            _e && W.CreateTextureAsync(q, he, _e, ge, me);\n          }, me);\n        }, W.LoadShaderStringAsync = function(q, he, ge, me) {\n          W.ApplyExtensions(function(_e) {\n            return _e.loadShaderStringAsync(q, he, ge, me);\n          }, function() {\n            re.LoadShaderStringAsync(q, he, ge, me);\n          });\n        }, W.LoadMaterialAsync = function(q, he, ge, me) {\n          W.ApplyExtensions(function(_e) {\n            return _e.loadMaterialAsync(q, he, ge, me);\n          }, function() {\n            re.LoadMaterialAsync(q, he, ge, me);\n          });\n        }, W.LoadTextureBufferAsync = function(q, he, ge, me) {\n          W.ApplyExtensions(function(_e) {\n            return _e.loadTextureBufferAsync(q, he, ge, me);\n          }, function() {\n            re.LoadTextureBufferAsync(q, he, ge, me);\n          });\n        }, W.CreateTextureAsync = function(q, he, ge, me, _e) {\n          W.ApplyExtensions(function(ye) {\n            return ye.createTextureAsync(q, he, ge, me, _e);\n          }, function() {\n            re.CreateTextureAsync(q, he, ge, me, _e);\n          });\n        }, W.ApplyExtensions = function(q, he) {\n          for (var ge in Y.Extensions)\n            if (q(Y.Extensions[ge]))\n              return;\n          he();\n        }, W;\n      }();\n      l.GLTFFileLoader._CreateGLTF1Loader = function() {\n        return new Y();\n      };\n      var H = function(W) {\n        function q() {\n          return W.call(this, \"KHR_binary_glTF\") || this;\n        }\n        return Object(T.b)(q, W), q.prototype.loadRuntimeAsync = function(he, ge, me, _e, ye) {\n          var Pe = ge.json.extensionsUsed;\n          return !(!Pe || Pe.indexOf(this.name) === -1 || !ge.bin) && (this._bin = ge.bin, _e(re.CreateRuntime(ge.json, he, me)), !0);\n        }, q.prototype.loadBufferAsync = function(he, ge, me, _e) {\n          return he.extensionsUsed.indexOf(this.name) !== -1 && ge === \"binary_glTF\" && (this._bin.readAsync(0, this._bin.byteLength).then(me, function(ye) {\n            return _e(ye.message);\n          }), !0);\n        }, q.prototype.loadTextureBufferAsync = function(he, ge, me, _e) {\n          var ye = he.textures[ge], Pe = he.images[ye.source];\n          if (!Pe.extensions || !(this.name in Pe.extensions))\n            return !1;\n          var be = Pe.extensions[this.name], Fe = he.bufferViews[be.bufferView];\n          return me(g.GetBufferFromBufferView(he, Fe, 0, Fe.byteLength, _.UNSIGNED_BYTE)), !0;\n        }, q.prototype.loadShaderStringAsync = function(he, ge, me, _e) {\n          var ye = he.shaders[ge];\n          if (!ye.extensions || !(this.name in ye.extensions))\n            return !1;\n          var Pe = ye.extensions[this.name], be = he.bufferViews[Pe.bufferView], Fe = g.GetBufferFromBufferView(he, be, 0, be.byteLength, _.UNSIGNED_BYTE);\n          return setTimeout(function() {\n            var ke = g.DecodeBufferToText(Fe);\n            me(ke);\n          }), !0;\n        }, q;\n      }(k);\n      Y.RegisterExtension(new H());\n      var Z = function(W) {\n        function q() {\n          return W.call(this, \"KHR_materials_common\") || this;\n        }\n        return Object(T.b)(q, W), q.prototype.loadRuntimeExtensionsAsync = function(he, ge, me) {\n          if (!he.extensions)\n            return !1;\n          var _e = he.extensions[this.name];\n          if (!_e)\n            return !1;\n          var ye = _e.lights;\n          if (ye)\n            for (var Pe in ye) {\n              var be = ye[Pe];\n              switch (be.type) {\n                case \"ambient\":\n                  var Fe = new E.HemisphericLight(be.name, new E.Vector3(0, 1, 0), he.scene), ke = be.ambient;\n                  ke && (Fe.diffuse = E.Color3.FromArray(ke.color || [1, 1, 1]));\n                  break;\n                case \"point\":\n                  var We = new E.PointLight(be.name, new E.Vector3(10, 10, 10), he.scene), je = be.point;\n                  je && (We.diffuse = E.Color3.FromArray(je.color || [1, 1, 1]));\n                  break;\n                case \"directional\":\n                  var He = new E.DirectionalLight(be.name, new E.Vector3(0, -1, 0), he.scene), Qe = be.directional;\n                  Qe && (He.diffuse = E.Color3.FromArray(Qe.color || [1, 1, 1]));\n                  break;\n                case \"spot\":\n                  var Ge = be.spot;\n                  Ge && (new E.SpotLight(be.name, new E.Vector3(0, 10, 0), new E.Vector3(0, -1, 0), Ge.fallOffAngle || Math.PI, Ge.fallOffExponent || 0, he.scene).diffuse = E.Color3.FromArray(Ge.color || [1, 1, 1]));\n                  break;\n                default:\n                  E.Tools.Warn('GLTF Material Common extension: light type \"' + be.type + \"” not supported\");\n              }\n            }\n          return !1;\n        }, q.prototype.loadMaterialAsync = function(he, ge, me, _e) {\n          var ye = he.materials[ge];\n          if (!ye || !ye.extensions)\n            return !1;\n          var Pe = ye.extensions[this.name];\n          if (!Pe)\n            return !1;\n          var be = new E.StandardMaterial(ge, he.scene);\n          return be.sideOrientation = E.Material.CounterClockWiseSideOrientation, Pe.technique === \"CONSTANT\" && (be.disableLighting = !0), be.backFaceCulling = Pe.doubleSided !== void 0 && !Pe.doubleSided, be.alpha = Pe.values.transparency === void 0 ? 1 : Pe.values.transparency, be.specularPower = Pe.values.shininess === void 0 ? 0 : Pe.values.shininess, typeof Pe.values.ambient == \"string\" ? this._loadTexture(he, Pe.values.ambient, be, \"ambientTexture\", _e) : be.ambientColor = E.Color3.FromArray(Pe.values.ambient || [0, 0, 0]), typeof Pe.values.diffuse == \"string\" ? this._loadTexture(he, Pe.values.diffuse, be, \"diffuseTexture\", _e) : be.diffuseColor = E.Color3.FromArray(Pe.values.diffuse || [0, 0, 0]), typeof Pe.values.emission == \"string\" ? this._loadTexture(he, Pe.values.emission, be, \"emissiveTexture\", _e) : be.emissiveColor = E.Color3.FromArray(Pe.values.emission || [0, 0, 0]), typeof Pe.values.specular == \"string\" ? this._loadTexture(he, Pe.values.specular, be, \"specularTexture\", _e) : be.specularColor = E.Color3.FromArray(Pe.values.specular || [0, 0, 0]), !0;\n        }, q.prototype._loadTexture = function(he, ge, me, _e, ye) {\n          re.LoadTextureBufferAsync(he, ge, function(Pe) {\n            re.CreateTextureAsync(he, ge, Pe, function(be) {\n              return me[_e] = be;\n            }, ye);\n          }, ye);\n        }, q;\n      }(k);\n      Y.RegisterExtension(new Z());\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"ArrayItem\", function() {\n        return _.a;\n      }), V.d(f, \"GLTFLoader\", function() {\n        return _.b;\n      }), V.d(f, \"EXT_lights_image_based\", function() {\n        return C.EXT_lights_image_based;\n      }), V.d(f, \"EXT_mesh_gpu_instancing\", function() {\n        return C.EXT_mesh_gpu_instancing;\n      }), V.d(f, \"EXT_texture_webp\", function() {\n        return C.EXT_texture_webp;\n      }), V.d(f, \"KHR_draco_mesh_compression\", function() {\n        return C.KHR_draco_mesh_compression;\n      }), V.d(f, \"KHR_lights\", function() {\n        return C.KHR_lights;\n      }), V.d(f, \"KHR_materials_pbrSpecularGlossiness\", function() {\n        return C.KHR_materials_pbrSpecularGlossiness;\n      }), V.d(f, \"KHR_materials_unlit\", function() {\n        return C.KHR_materials_unlit;\n      }), V.d(f, \"KHR_materials_clearcoat\", function() {\n        return C.KHR_materials_clearcoat;\n      }), V.d(f, \"KHR_materials_sheen\", function() {\n        return C.KHR_materials_sheen;\n      }), V.d(f, \"KHR_materials_specular\", function() {\n        return C.KHR_materials_specular;\n      }), V.d(f, \"KHR_materials_ior\", function() {\n        return C.KHR_materials_ior;\n      }), V.d(f, \"KHR_materials_variants\", function() {\n        return C.KHR_materials_variants;\n      }), V.d(f, \"KHR_materials_transmission\", function() {\n        return C.KHR_materials_transmission;\n      }), V.d(f, \"KHR_materials_translucency\", function() {\n        return C.KHR_materials_translucency;\n      }), V.d(f, \"KHR_mesh_quantization\", function() {\n        return C.KHR_mesh_quantization;\n      }), V.d(f, \"KHR_texture_basisu\", function() {\n        return C.KHR_texture_basisu;\n      }), V.d(f, \"KHR_texture_transform\", function() {\n        return C.KHR_texture_transform;\n      }), V.d(f, \"MSFT_audio_emitter\", function() {\n        return C.MSFT_audio_emitter;\n      }), V.d(f, \"MSFT_lod\", function() {\n        return C.MSFT_lod;\n      }), V.d(f, \"MSFT_minecraftMesh\", function() {\n        return C.MSFT_minecraftMesh;\n      }), V.d(f, \"MSFT_sRGBFactors\", function() {\n        return C.MSFT_sRGBFactors;\n      }), V.d(f, \"ExtrasAsMetadata\", function() {\n        return C.ExtrasAsMetadata;\n      });\n      var _ = V(1), C = (V(6), V(7));\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"MTLFileLoader\", function() {\n        return C;\n      }), V.d(f, \"OBJFileLoader\", function() {\n        return u;\n      });\n      var _ = V(0), C = function() {\n        function I() {\n          this.materials = [];\n        }\n        return I.prototype.parseMTL = function(O, x, m, c) {\n          if (!(x instanceof ArrayBuffer)) {\n            for (var T, S = x.split(`\n`), E = /\\s+/, g = null, l = 0; l < S.length; l++) {\n              var h = S[l].trim();\n              if (h.length !== 0 && h.charAt(0) !== \"#\") {\n                var v = h.indexOf(\" \"), b = v >= 0 ? h.substring(0, v) : h;\n                b = b.toLowerCase();\n                var D = v >= 0 ? h.substring(v + 1).trim() : \"\";\n                b === \"newmtl\" ? (g && this.materials.push(g), O._blockEntityCollection = c, g = new _.StandardMaterial(D, O), O._blockEntityCollection = !1) : b === \"kd\" && g ? (T = D.split(E, 3).map(parseFloat), g.diffuseColor = _.Color3.FromArray(T)) : b === \"ka\" && g ? (T = D.split(E, 3).map(parseFloat), g.ambientColor = _.Color3.FromArray(T)) : b === \"ks\" && g ? (T = D.split(E, 3).map(parseFloat), g.specularColor = _.Color3.FromArray(T)) : b === \"ke\" && g ? (T = D.split(E, 3).map(parseFloat), g.emissiveColor = _.Color3.FromArray(T)) : b === \"ns\" && g ? g.specularPower = parseFloat(D) : b === \"d\" && g ? g.alpha = parseFloat(D) : b === \"map_ka\" && g ? g.ambientTexture = I._getTexture(m, D, O) : b === \"map_kd\" && g ? g.diffuseTexture = I._getTexture(m, D, O) : b === \"map_ks\" && g ? g.specularTexture = I._getTexture(m, D, O) : b === \"map_ns\" || (b === \"map_bump\" && g ? g.bumpTexture = I._getTexture(m, D, O) : b === \"map_d\" && g && (g.opacityTexture = I._getTexture(m, D, O)));\n              }\n            }\n            g && this.materials.push(g);\n          }\n        }, I._getTexture = function(O, x, m) {\n          if (!x)\n            return null;\n          var c = O;\n          if (O === \"file:\") {\n            var T = x.lastIndexOf(\"\\\\\");\n            T === -1 && (T = x.lastIndexOf(\"/\")), c += T > -1 ? x.substr(T + 1) : x;\n          } else\n            c += x;\n          return new _.Texture(c, m, !1, I.INVERT_TEXTURE_Y);\n        }, I.INVERT_TEXTURE_Y = !0, I;\n      }(), u = function() {\n        function I(O) {\n          this.name = \"obj\", this.extensions = \".obj\", this.obj = /^o/, this.group = /^g/, this.mtllib = /^mtllib /, this.usemtl = /^usemtl /, this.smooth = /^s /, this.vertexPattern = /v(\\s+[\\d|\\.|\\+|\\-|e|E]+){3,7}/, this.normalPattern = /vn(\\s+[\\d|\\.|\\+|\\-|e|E]+)( +[\\d|\\.|\\+|\\-|e|E]+)( +[\\d|\\.|\\+|\\-|e|E]+)/, this.uvPattern = /vt(\\s+[\\d|\\.|\\+|\\-|e|E]+)( +[\\d|\\.|\\+|\\-|e|E]+)/, this.facePattern1 = /f\\s+(([\\d]{1,}[\\s]?){3,})+/, this.facePattern2 = /f\\s+((([\\d]{1,}\\/[\\d]{1,}[\\s]?){3,})+)/, this.facePattern3 = /f\\s+((([\\d]{1,}\\/[\\d]{1,}\\/[\\d]{1,}[\\s]?){3,})+)/, this.facePattern4 = /f\\s+((([\\d]{1,}\\/\\/[\\d]{1,}[\\s]?){3,})+)/, this.facePattern5 = /f\\s+(((-[\\d]{1,}\\/-[\\d]{1,}\\/-[\\d]{1,}[\\s]?){3,})+)/, this._forAssetContainer = !1, this._meshLoadOptions = O || I.currentMeshLoadOptions;\n        }\n        return Object.defineProperty(I, \"INVERT_TEXTURE_Y\", { get: function() {\n          return C.INVERT_TEXTURE_Y;\n        }, set: function(O) {\n          C.INVERT_TEXTURE_Y = O;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(I, \"currentMeshLoadOptions\", { get: function() {\n          return { ComputeNormals: I.COMPUTE_NORMALS, ImportVertexColors: I.IMPORT_VERTEX_COLORS, InvertY: I.INVERT_Y, InvertTextureY: I.INVERT_TEXTURE_Y, UVScaling: I.UV_SCALING, MaterialLoadingFailsSilently: I.MATERIAL_LOADING_FAILS_SILENTLY, OptimizeWithUV: I.OPTIMIZE_WITH_UV, SkipMaterials: I.SKIP_MATERIALS };\n        }, enumerable: !1, configurable: !0 }), I.prototype._loadMTL = function(O, x, m, c) {\n          var T = _.Tools.BaseUrl + x + O;\n          _.Tools.LoadFile(T, m, void 0, void 0, !1, function(S, E) {\n            c(T, E);\n          });\n        }, I.prototype.createPlugin = function() {\n          return new I(I.currentMeshLoadOptions);\n        }, I.prototype.canDirectLoad = function(O) {\n          return !1;\n        }, I.prototype.importMeshAsync = function(O, x, m, c, T, S) {\n          return this._parseSolid(O, x, m, c).then(function(E) {\n            return { meshes: E, particleSystems: [], skeletons: [], animationGroups: [], transformNodes: [], geometries: [], lights: [] };\n          });\n        }, I.prototype.loadAsync = function(O, x, m, c, T) {\n          return this.importMeshAsync(null, O, x, m, c).then(function() {\n          });\n        }, I.prototype.loadAssetContainerAsync = function(O, x, m, c, T) {\n          var S = this;\n          return this._forAssetContainer = !0, this.importMeshAsync(null, O, x, m).then(function(E) {\n            var g = new _.AssetContainer(O);\n            return E.meshes.forEach(function(l) {\n              return g.meshes.push(l);\n            }), E.meshes.forEach(function(l) {\n              var h = l.material;\n              h && g.materials.indexOf(h) == -1 && (g.materials.push(h), h.getActiveTextures().forEach(function(v) {\n                g.textures.indexOf(v) == -1 && g.textures.push(v);\n              }));\n            }), S._forAssetContainer = !1, g;\n          }).catch(function(E) {\n            throw S._forAssetContainer = !1, E;\n          });\n        }, I.prototype._parseSolid = function(O, x, m, c) {\n          for (var T, S = this, E = [], g = [], l = [], h = [], v = [], b = [], D = [], w = [], N = [], M = [], U = [], X = 0, j = !1, ne = [], te = [], de = [], pe = [], ae = [], ee = \"\", K = \"\", $ = new C(), L = 1, G = !0, Q = new _.Color4(0.5, 0.5, 0.5, 1), oe = function(Ge, tt, Je, st, at, pt, Tt) {\n            var Lt;\n            (Lt = S._meshLoadOptions.OptimizeWithUV ? function(Ot, St) {\n              Ot[St[0]] || (Ot[St[0]] = { normals: [], idx: [], uv: [] });\n              var Ct = Ot[St[0]].normals.indexOf(St[1]);\n              return Ct != 1 && St[2] === Ot[St[0]].uv[Ct] ? Ot[St[0]].idx[Ct] : -1;\n            }(U, [Ge, Je, tt]) : function(Ot, St) {\n              Ot[St[0]] || (Ot[St[0]] = { normals: [], idx: [] });\n              var Ct = Ot[St[0]].normals.indexOf(St[1]);\n              return Ct === -1 ? -1 : Ot[St[0]].idx[Ct];\n            }(U, [Ge, Je])) === -1 ? (b.push(D.length), D.push(st), w.push(at), M.push(pt), Tt !== void 0 && N.push(Tt), U[Ge].normals.push(Je), U[Ge].idx.push(X++), S._meshLoadOptions.OptimizeWithUV && U[Ge].uv.push(tt)) : b.push(Lt);\n          }, re = function() {\n            for (var Ge = 0; Ge < D.length; Ge++)\n              ne.push(D[Ge].x, D[Ge].y, D[Ge].z), de.push(M[Ge].x, M[Ge].y, M[Ge].z), pe.push(w[Ge].x, w[Ge].y), S._meshLoadOptions.ImportVertexColors === !0 && te.push(N[Ge].r, N[Ge].g, N[Ge].b, N[Ge].a);\n            D = [], M = [], w = [], N = [], U = [], X = 0;\n          }, Y = function(Ge, tt) {\n            for (var Je = tt; Je < Ge.length - 1; Je++)\n              ae.push(Ge[0], Ge[Je], Ge[Je + 1]);\n          }, k = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = parseInt(ae[Je]) - 1;\n              oe(st, 0, 0, E[st], _.Vector2.Zero(), _.Vector3.Up(), S._meshLoadOptions.ImportVertexColors === !0 ? h[st] : void 0);\n            }\n            ae = [];\n          }, H = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"/\"), at = parseInt(st[0]) - 1, pt = parseInt(st[1]) - 1;\n              oe(at, pt, 0, E[at], l[pt], _.Vector3.Up(), S._meshLoadOptions.ImportVertexColors === !0 ? h[at] : void 0);\n            }\n            ae = [];\n          }, Z = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"/\"), at = parseInt(st[0]) - 1, pt = parseInt(st[1]) - 1, Tt = parseInt(st[2]) - 1;\n              oe(at, pt, Tt, E[at], l[pt], g[Tt]);\n            }\n            ae = [];\n          }, W = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"//\"), at = parseInt(st[0]) - 1, pt = parseInt(st[1]) - 1;\n              oe(at, 1, pt, E[at], _.Vector2.Zero(), g[pt], S._meshLoadOptions.ImportVertexColors === !0 ? h[at] : void 0);\n            }\n            ae = [];\n          }, q = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"/\"), at = E.length + parseInt(st[0]), pt = l.length + parseInt(st[1]), Tt = g.length + parseInt(st[2]);\n              oe(at, pt, Tt, E[at], l[pt], g[Tt], S._meshLoadOptions.ImportVertexColors === !0 ? h[at] : void 0);\n            }\n            ae = [];\n          }, he = function() {\n            v.length > 0 && (T = v[v.length - 1], re(), b.reverse(), T.indices = b.slice(), T.positions = ne.slice(), T.normals = de.slice(), T.uvs = pe.slice(), S._meshLoadOptions.ImportVertexColors === !0 && (T.colors = te.slice()), b = [], ne = [], te = [], de = [], pe = []);\n          }, ge = m.split(`\n`), me = 0; me < ge.length; me++) {\n            var _e, ye = ge[me].trim().replace(/\\s\\s/g, \" \");\n            if (ye.length !== 0 && ye.charAt(0) !== \"#\")\n              if (this.vertexPattern.test(ye))\n                _e = ye.match(/[^ ]+/g), E.push(new _.Vector3(parseFloat(_e[1]), parseFloat(_e[2]), parseFloat(_e[3]))), this._meshLoadOptions.ImportVertexColors === !0 && (_e.length >= 7 ? h.push(new _.Color4(parseFloat(_e[4]), parseFloat(_e[5]), parseFloat(_e[6]), _e.length === 7 || _e[7] === void 0 ? 1 : parseFloat(_e[7]))) : h.push(Q));\n              else if ((_e = this.normalPattern.exec(ye)) !== null)\n                g.push(new _.Vector3(parseFloat(_e[1]), parseFloat(_e[2]), parseFloat(_e[3])));\n              else if ((_e = this.uvPattern.exec(ye)) !== null)\n                l.push(new _.Vector2(parseFloat(_e[1]) * I.UV_SCALING.x, parseFloat(_e[2]) * I.UV_SCALING.y));\n              else if ((_e = this.facePattern3.exec(ye)) !== null)\n                Z(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern4.exec(ye)) !== null)\n                W(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern5.exec(ye)) !== null)\n                q(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern2.exec(ye)) !== null)\n                H(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern1.exec(ye)) !== null)\n                k(_e[1].trim().split(\" \"), 1);\n              else if (this.group.test(ye) || this.obj.test(ye)) {\n                var Pe = { name: ye.substring(2).trim(), indices: void 0, positions: void 0, normals: void 0, uvs: void 0, colors: void 0, materialName: \"\" };\n                he(), v.push(Pe), j = !0, G = !0, L = 1;\n              } else\n                this.usemtl.test(ye) ? (ee = ye.substring(7).trim(), (!G || !j) && (he(), Pe = { name: \"mesh_mm\" + L.toString(), indices: void 0, positions: void 0, normals: void 0, uvs: void 0, colors: void 0, materialName: ee }, L++, v.push(Pe), j = !0), j && G && (v[v.length - 1].materialName = ee, G = !1)) : this.mtllib.test(ye) ? K = ye.substring(7).trim() : this.smooth.test(ye) || console.log(\"Unhandled expression at line : \" + ye);\n          }\n          j && (T = v[v.length - 1], b.reverse(), re(), T.indices = b, T.positions = ne, T.normals = de, T.uvs = pe, this._meshLoadOptions.ImportVertexColors === !0 && (T.colors = te)), j || (b.reverse(), re(), v.push({ name: _.Geometry.RandomId(), indices: b, positions: ne, colors: te, normals: de, uvs: pe, materialName: ee }));\n          for (var be = [], Fe = new Array(), ke = 0; ke < v.length; ke++) {\n            if (O && v[ke].name) {\n              if (O instanceof Array) {\n                if (O.indexOf(v[ke].name) === -1)\n                  continue;\n              } else if (v[ke].name !== O)\n                continue;\n            }\n            T = v[ke], x._blockEntityCollection = this._forAssetContainer;\n            var We = new _.Mesh(v[ke].name, x);\n            x._blockEntityCollection = !1, Fe.push(v[ke].materialName);\n            var je = new _.VertexData();\n            if (je.uvs = T.uvs, je.indices = T.indices, je.positions = T.positions, this._meshLoadOptions.ComputeNormals === !0) {\n              var He = new Array();\n              _.VertexData.ComputeNormals(T.positions, T.indices, He), je.normals = He;\n            } else\n              je.normals = T.normals;\n            this._meshLoadOptions.ImportVertexColors === !0 && (je.colors = T.colors), je.applyToMesh(We), this._meshLoadOptions.InvertY && (We.scaling.y *= -1), be.push(We);\n          }\n          var Qe = [];\n          return K !== \"\" && this._meshLoadOptions.SkipMaterials === !1 && Qe.push(new Promise(function(Ge, tt) {\n            S._loadMTL(K, c, function(Je) {\n              try {\n                $.parseMTL(x, Je, c, S._forAssetContainer);\n                for (var st = 0; st < $.materials.length; st++) {\n                  for (var at, pt = 0, Tt = []; (at = Fe.indexOf($.materials[st].name, pt)) > -1; )\n                    Tt.push(at), pt = at + 1;\n                  if (at === -1 && Tt.length === 0)\n                    $.materials[st].dispose();\n                  else\n                    for (var Lt = 0; Lt < Tt.length; Lt++)\n                      be[Tt[Lt]].material = $.materials[st];\n                }\n                Ge();\n              } catch (Ot) {\n                _.Tools.Warn(\"Error processing MTL file: '\" + K + \"'\"), S._meshLoadOptions.MaterialLoadingFailsSilently ? Ge() : tt(Ot);\n              }\n            }, function(Je, st) {\n              _.Tools.Warn(\"Error downloading MTL file: '\" + K + \"'\"), S._meshLoadOptions.MaterialLoadingFailsSilently ? Ge() : tt(st);\n            });\n          })), Promise.all(Qe).then(function() {\n            return be;\n          });\n        }, I.OPTIMIZE_WITH_UV = !0, I.INVERT_Y = !1, I.IMPORT_VERTEX_COLORS = !1, I.COMPUTE_NORMALS = !1, I.UV_SCALING = new _.Vector2(1, 1), I.SKIP_MATERIALS = !1, I.MATERIAL_LOADING_FAILS_SILENTLY = !0, I;\n      }();\n      _.SceneLoader && _.SceneLoader.RegisterPlugin(new u());\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"STLFileLoader\", function() {\n        return C;\n      });\n      var _ = V(0), C = function() {\n        function u() {\n          this.solidPattern = /solid (\\S*)([\\S\\s]*?)endsolid[ ]*(\\S*)/g, this.facetsPattern = /facet([\\s\\S]*?)endfacet/g, this.normalPattern = /normal[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g, this.vertexPattern = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g, this.name = \"stl\", this.extensions = { \".stl\": { isBinary: !0 } };\n        }\n        return u.prototype.importMesh = function(I, O, x, m, c, T, S) {\n          var E;\n          if (typeof x != \"string\") {\n            if (this._isBinary(x)) {\n              var g = new _.Mesh(\"stlmesh\", O);\n              return this._parseBinary(g, x), c && c.push(g), !0;\n            }\n            for (var l = new Uint8Array(x), h = \"\", v = 0; v < x.byteLength; v++)\n              h += String.fromCharCode(l[v]);\n            x = h;\n          }\n          for (; E = this.solidPattern.exec(x); ) {\n            var b = E[1];\n            if (b != E[3])\n              return _.Tools.Error(\"Error in STL, solid name != endsolid name\"), !1;\n            if (I && b) {\n              if (I instanceof Array) {\n                if (!I.indexOf(b))\n                  continue;\n              } else if (b !== I)\n                continue;\n            }\n            b = b || \"stlmesh\", g = new _.Mesh(b, O), this._parseASCII(g, E[2]), c && c.push(g);\n          }\n          return !0;\n        }, u.prototype.load = function(I, O, x) {\n          return this.importMesh(null, I, O, x, null, null, null);\n        }, u.prototype.loadAssetContainer = function(I, O, x, m) {\n          var c = new _.AssetContainer(I);\n          return I._blockEntityCollection = !0, this.importMesh(null, I, O, x, c.meshes, null, null), I._blockEntityCollection = !1, c;\n        }, u.prototype._isBinary = function(I) {\n          var O;\n          if (84 + 50 * (O = new DataView(I)).getUint32(80, !0) === O.byteLength)\n            return !0;\n          for (var x = O.byteLength, m = 0; m < x; m++)\n            if (O.getUint8(m) > 127)\n              return !0;\n          return !1;\n        }, u.prototype._parseBinary = function(I, O) {\n          for (var x = new DataView(O), m = x.getUint32(80, !0), c = 0, T = new Float32Array(3 * m * 3), S = new Float32Array(3 * m * 3), E = new Uint32Array(3 * m), g = 0, l = 0; l < m; l++) {\n            for (var h = 84 + 50 * l, v = x.getFloat32(h, !0), b = x.getFloat32(h + 4, !0), D = x.getFloat32(h + 8, !0), w = 1; w <= 3; w++) {\n              var N = h + 12 * w;\n              T[c] = x.getFloat32(N, !0), T[c + 2] = x.getFloat32(N + 4, !0), T[c + 1] = x.getFloat32(N + 8, !0), S[c] = v, S[c + 2] = b, S[c + 1] = D, c += 3;\n            }\n            E[g] = g++, E[g] = g++, E[g] = g++;\n          }\n          I.setVerticesData(_.VertexBuffer.PositionKind, T), I.setVerticesData(_.VertexBuffer.NormalKind, S), I.setIndices(E), I.computeWorldMatrix(!0);\n        }, u.prototype._parseASCII = function(I, O) {\n          for (var x, m = [], c = [], T = [], S = 0; x = this.facetsPattern.exec(O); ) {\n            var E = x[1], g = this.normalPattern.exec(E);\n            if (this.normalPattern.lastIndex = 0, g) {\n              for (var l, h = [Number(g[1]), Number(g[5]), Number(g[3])]; l = this.vertexPattern.exec(E); )\n                m.push(Number(l[1]), Number(l[5]), Number(l[3])), c.push(h[0], h[1], h[2]);\n              T.push(S++, S++, S++), this.vertexPattern.lastIndex = 0;\n            }\n          }\n          this.facetsPattern.lastIndex = 0, I.setVerticesData(_.VertexBuffer.PositionKind, m), I.setVerticesData(_.VertexBuffer.NormalKind, c), I.setIndices(T), I.computeWorldMatrix(!0);\n        }, u;\n      }();\n      _.SceneLoader && _.SceneLoader.RegisterPlugin(new C());\n    }, function(A, f, V) {\n      (function(_) {\n        var C = V(2), u = V(3);\n        V.d(f, \"a\", function() {\n          return C.GLTFFileLoader;\n        }), V.d(f, \"b\", function() {\n          return C.GLTFLoaderAnimationStartMode;\n        }), V.d(f, \"c\", function() {\n          return C.GLTFLoaderCoordinateSystemMode;\n        }), V.d(f, \"d\", function() {\n          return C.GLTFLoaderState;\n        }), V.d(f, \"e\", function() {\n          return u.GLTFValidation;\n        });\n        var I = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (I !== void 0) {\n          for (var O in I.BABYLON = I.BABYLON || {}, C)\n            I.BABYLON[O] = C[O];\n          for (var O in u)\n            I.BABYLON[O] = u[O];\n        }\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      (function(_) {\n        var C = V(8);\n        V.d(f, \"a\", function() {\n          return C;\n        });\n        var u = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (u !== void 0)\n          for (var I in u.BABYLON = u.BABYLON || {}, u.BABYLON.GLTF1 = u.BABYLON.GLTF1 || {}, C)\n            u.BABYLON.GLTF1[I] = C[I];\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      (function(_) {\n        var C = V(7), u = V(6), I = V(9);\n        V.d(f, \"a\", function() {\n          return I;\n        });\n        var O = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (O !== void 0) {\n          O.BABYLON = O.BABYLON || {};\n          var x = O.BABYLON;\n          x.GLTF2 = x.GLTF2 || {}, x.GLTF2.Loader = x.GLTF2.Loader || {}, x.GLTF2.Loader.Extensions = x.GLTF2.Loader.Extensions || {};\n          var m = [];\n          for (var c in C)\n            x.GLTF2.Loader.Extensions[c] = C[c], m.push(c);\n          for (var c in u)\n            x.GLTF2.Loader[c] = u[c], m.push(c);\n          for (var c in I)\n            m.indexOf(c) > -1 || (x.GLTF2[c] = I[c]);\n        }\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      V.r(f), (function(_) {\n        var C = V(10);\n        V.d(f, \"MTLFileLoader\", function() {\n          return C.MTLFileLoader;\n        }), V.d(f, \"OBJFileLoader\", function() {\n          return C.OBJFileLoader;\n        });\n        var u = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (u !== void 0)\n          for (var I in C)\n            u.BABYLON[I] = C[I];\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      V.r(f), (function(_) {\n        var C = V(11);\n        V.d(f, \"STLFileLoader\", function() {\n          return C.STLFileLoader;\n        });\n        var u = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (u !== void 0)\n          for (var I in C)\n            u.BABYLON[I] = C[I];\n      }).call(this, V(5));\n    }, , , , function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFLoaderCoordinateSystemMode\", function() {\n        return _.c;\n      }), V.d(f, \"GLTFLoaderAnimationStartMode\", function() {\n        return _.b;\n      }), V.d(f, \"GLTFLoaderState\", function() {\n        return _.d;\n      }), V.d(f, \"GLTFFileLoader\", function() {\n        return _.a;\n      }), V.d(f, \"GLTFValidation\", function() {\n        return _.e;\n      }), V.d(f, \"GLTF1\", function() {\n        return C.a;\n      }), V.d(f, \"GLTF2\", function() {\n        return u.a;\n      }), V.d(f, \"MTLFileLoader\", function() {\n        return I.MTLFileLoader;\n      }), V.d(f, \"OBJFileLoader\", function() {\n        return I.OBJFileLoader;\n      }), V.d(f, \"STLFileLoader\", function() {\n        return O.STLFileLoader;\n      }), V(2), V(3), V(8), V(9), V(10), V(11);\n      var _ = V(12), C = V(13), u = V(14), I = V(15), O = V(16);\n    }]);\n  });\n})(cf);\nvar Eo = cf.exports;\nconst lv = /* @__PURE__ */ av(Eo), af = /* @__PURE__ */ cv({\n  __proto__: null,\n  default: lv\n}, [Eo]), {\n  SvelteComponent: uv,\n  binding_callbacks: hv,\n  detach: dv,\n  element: fv,\n  init: pv,\n  insert: _v,\n  noop: Kc,\n  safe_not_equal: mv\n} = window.__gradio__svelte__internal, { onMount: gv } = window.__gradio__svelte__internal;\nfunction vv(an) {\n  let ln;\n  return {\n    c() {\n      ln = fv(\"canvas\");\n    },\n    m(Be, A) {\n      _v(Be, ln, A), an[12](ln);\n    },\n    p: Kc,\n    i: Kc,\n    o: Kc,\n    d(Be) {\n      Be && dv(ln), an[12](null);\n    }\n  };\n}\nfunction yv(an, ln) {\n  return an ?? ln();\n}\nfunction bv(an, ln, Be) {\n  let A, { value: f } = ln, { clear_color: V } = ln, { camera_position: _ } = ln, { zoom_speed: C } = ln, { pan_speed: u } = ln, { resolved_url: I = void 0 } = ln, O, x, m, c, T = !1;\n  gv(() => {\n    c = new ir.Engine(x, !0), m = new ir.Scene(c), m.createDefaultCameraOrLight(), m.clearColor = m.clearColor = new ir.Color4(...V), c.runRenderLoop(() => {\n      m.render();\n    });\n    function h() {\n      c.resize();\n    }\n    return window.addEventListener(\"resize\", h), Be(10, T = !0), () => {\n      m.dispose(), c.dispose(), window.removeEventListener(\"resize\", h);\n    };\n  });\n  function S(h) {\n    m && (m.meshes.forEach((v) => {\n      v.dispose();\n    }), h && (ir.SceneLoader.ShowLoadingScreen = !1, ir.SceneLoader.Append(h, \"\", m, () => E(m, _, C, u), void 0, void 0, \".\" + f.path.split(\".\").pop())));\n  }\n  function E(h, v, b, D) {\n    h.createDefaultCamera(!0, !0, !0);\n    var w = h.activeCamera;\n    v[0] !== null && (w.alpha = ir.Tools.ToRadians(v[0])), v[1] !== null && (w.beta = ir.Tools.ToRadians(v[1])), v[2] !== null && (w.radius = v[2]), w.lowerRadiusLimit = 0.1;\n    const N = () => {\n      w.wheelPrecision = 250 / (w.radius * b), w.panningSensibility = 1e4 * D / w.radius;\n    };\n    N(), w.attachControl(!0), w.onAfterCheckInputsObservable.add(N);\n  }\n  function g(h, v, b) {\n    m && (m.removeCamera(m.activeCamera), E(m, h, v, b));\n  }\n  function l(h) {\n    hv[h ? \"unshift\" : \"push\"](() => {\n      x = h, Be(0, x);\n    });\n  }\n  return an.$$set = (h) => {\n    \"value\" in h && Be(2, f = h.value), \"clear_color\" in h && Be(3, V = h.clear_color), \"camera_position\" in h && Be(4, _ = h.camera_position), \"zoom_speed\" in h && Be(5, C = h.zoom_speed), \"pan_speed\" in h && Be(6, u = h.pan_speed), \"resolved_url\" in h && Be(1, I = h.resolved_url);\n  }, an.$$.update = () => {\n    if (an.$$.dirty & /*BABYLON_LOADERS*/\n    256 && Eo.OBJFileLoader != null && !Eo.OBJFileLoader.IMPORT_VERTEX_COLORS && Be(8, Eo.OBJFileLoader.IMPORT_VERTEX_COLORS = !0, af), an.$$.dirty & /*value*/\n    4 && Be(11, A = f.url), an.$$.dirty & /*url, latest_url*/\n    2560 && (Be(1, I = A), A)) {\n      Be(9, O = A);\n      const h = A;\n      sv(A).then((v) => {\n        O === h ? Be(1, I = yv(v, () => {\n        })) : v && URL.revokeObjectURL(v);\n      });\n    }\n    an.$$.dirty & /*mounted, resolved_url*/\n    1026 && T && S(I);\n  }, [\n    x,\n    I,\n    f,\n    V,\n    _,\n    C,\n    u,\n    g,\n    af,\n    O,\n    T,\n    A,\n    l\n  ];\n}\nclass Ev extends uv {\n  constructor(ln) {\n    super(), pv(this, ln, bv, vv, mv, {\n      value: 2,\n      clear_color: 3,\n      camera_position: 4,\n      zoom_speed: 5,\n      pan_speed: 6,\n      resolved_url: 1,\n      reset_camera_position: 7\n    });\n  }\n  get reset_camera_position() {\n    return this.$$.ctx[7];\n  }\n}\nexport {\n  Ev as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/Canvas3DGS-0fbc0d9a.js",
    "content": "import { r as KU } from \"./Index-f5583db3.js\";\nclass X {\n  constructor(U = 0, Q = 0, F = 0) {\n    this.x = U, this.y = Q, this.z = F;\n  }\n  equals(U) {\n    return this.x === U.x && this.y === U.y && this.z === U.z;\n  }\n  add(U) {\n    return typeof U == \"number\" ? new X(this.x + U, this.y + U, this.z + U) : new X(this.x + U.x, this.y + U.y, this.z + U.z);\n  }\n  subtract(U) {\n    return typeof U == \"number\" ? new X(this.x - U, this.y - U, this.z - U) : new X(this.x - U.x, this.y - U.y, this.z - U.z);\n  }\n  multiply(U) {\n    return typeof U == \"number\" ? new X(this.x * U, this.y * U, this.z * U) : U instanceof X ? new X(this.x * U.x, this.y * U.y, this.z * U.z) : new X(this.x * U.buffer[0] + this.y * U.buffer[4] + this.z * U.buffer[8] + U.buffer[12], this.x * U.buffer[1] + this.y * U.buffer[5] + this.z * U.buffer[9] + U.buffer[13], this.x * U.buffer[2] + this.y * U.buffer[6] + this.z * U.buffer[10] + U.buffer[14]);\n  }\n  divide(U) {\n    return typeof U == \"number\" ? new X(this.x / U, this.y / U, this.z / U) : new X(this.x / U.x, this.y / U.y, this.z / U.z);\n  }\n  cross(U) {\n    const Q = this.y * U.z - this.z * U.y, F = this.z * U.x - this.x * U.z, l = this.x * U.y - this.y * U.x;\n    return new X(Q, F, l);\n  }\n  dot(U) {\n    return this.x * U.x + this.y * U.y + this.z * U.z;\n  }\n  lerp(U, Q) {\n    return new X(this.x + (U.x - this.x) * Q, this.y + (U.y - this.y) * Q, this.z + (U.z - this.z) * Q);\n  }\n  magnitude() {\n    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n  }\n  distanceTo(U) {\n    return Math.sqrt((this.x - U.x) ** 2 + (this.y - U.y) ** 2 + (this.z - U.z) ** 2);\n  }\n  normalize() {\n    const U = this.magnitude();\n    return new X(this.x / U, this.y / U, this.z / U);\n  }\n  flat() {\n    return [this.x, this.y, this.z];\n  }\n  clone() {\n    return new X(this.x, this.y, this.z);\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n  static One(U = 1) {\n    return new X(U, U, U);\n  }\n}\nclass z {\n  constructor(U = 0, Q = 0, F = 0, l = 1) {\n    this.x = U, this.y = Q, this.z = F, this.w = l;\n  }\n  equals(U) {\n    return this.x === U.x && this.y === U.y && this.z === U.z && this.w === U.w;\n  }\n  normalize() {\n    const U = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n    return new z(this.x / U, this.y / U, this.z / U, this.w / U);\n  }\n  multiply(U) {\n    const Q = this.w, F = this.x, l = this.y, Z = this.z, t = U.w, d = U.x, B = U.y, n = U.z;\n    return new z(Q * d + F * t + l * n - Z * B, Q * B - F * n + l * t + Z * d, Q * n + F * B - l * d + Z * t, Q * t - F * d - l * B - Z * n);\n  }\n  inverse() {\n    const U = this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n    return new z(-this.x / U, -this.y / U, -this.z / U, this.w / U);\n  }\n  apply(U) {\n    const Q = new z(U.x, U.y, U.z, 0), F = new z(-this.x, -this.y, -this.z, this.w), l = this.multiply(Q).multiply(F);\n    return new X(l.x, l.y, l.z);\n  }\n  flat() {\n    return [this.x, this.y, this.z, this.w];\n  }\n  clone() {\n    return new z(this.x, this.y, this.z, this.w);\n  }\n  static FromEuler(U) {\n    const Q = U.x / 2, F = U.y / 2, l = U.z / 2, Z = Math.cos(F), t = Math.sin(F), d = Math.cos(Q), B = Math.sin(Q), n = Math.cos(l), V = Math.sin(l);\n    return new z(Z * B * n + t * d * V, t * d * n - Z * B * V, Z * d * V - t * B * n, Z * d * n + t * B * V);\n  }\n  toEuler() {\n    const U = 2 * (this.w * this.x + this.y * this.z), Q = 1 - 2 * (this.x * this.x + this.y * this.y), F = Math.atan2(U, Q);\n    let l;\n    const Z = 2 * (this.w * this.y - this.z * this.x);\n    l = Math.abs(Z) >= 1 ? Math.sign(Z) * Math.PI / 2 : Math.asin(Z);\n    const t = 2 * (this.w * this.z + this.x * this.y), d = 1 - 2 * (this.y * this.y + this.z * this.z), B = Math.atan2(t, d);\n    return new X(F, l, B);\n  }\n  static FromMatrix3(U) {\n    const Q = U.buffer, F = Q[0] + Q[4] + Q[8];\n    let l, Z, t, d;\n    if (F > 0) {\n      const B = 0.5 / Math.sqrt(F + 1);\n      d = 0.25 / B, l = (Q[7] - Q[5]) * B, Z = (Q[2] - Q[6]) * B, t = (Q[3] - Q[1]) * B;\n    } else if (Q[0] > Q[4] && Q[0] > Q[8]) {\n      const B = 2 * Math.sqrt(1 + Q[0] - Q[4] - Q[8]);\n      d = (Q[7] - Q[5]) / B, l = 0.25 * B, Z = (Q[1] + Q[3]) / B, t = (Q[2] + Q[6]) / B;\n    } else if (Q[4] > Q[8]) {\n      const B = 2 * Math.sqrt(1 + Q[4] - Q[0] - Q[8]);\n      d = (Q[2] - Q[6]) / B, l = (Q[1] + Q[3]) / B, Z = 0.25 * B, t = (Q[5] + Q[7]) / B;\n    } else {\n      const B = 2 * Math.sqrt(1 + Q[8] - Q[0] - Q[4]);\n      d = (Q[3] - Q[1]) / B, l = (Q[2] + Q[6]) / B, Z = (Q[5] + Q[7]) / B, t = 0.25 * B;\n    }\n    return new z(l, Z, t, d);\n  }\n  static FromAxisAngle(U, Q) {\n    const F = Q / 2, l = Math.sin(F), Z = Math.cos(F);\n    return new z(U.x * l, U.y * l, U.z * l, Z);\n  }\n  static LookRotation(U) {\n    const Q = new X(0, 0, 1), F = Q.dot(U);\n    if (Math.abs(F - -1) < 1e-6)\n      return new z(0, 1, 0, Math.PI);\n    if (Math.abs(F - 1) < 1e-6)\n      return new z();\n    const l = Math.acos(F), Z = Q.cross(U).normalize();\n    return z.FromAxisAngle(Z, l);\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n}\nclass gU {\n  constructor() {\n    const U = /* @__PURE__ */ new Map();\n    this.addEventListener = (Q, F) => {\n      U.has(Q) || U.set(Q, /* @__PURE__ */ new Set()), U.get(Q).add(F);\n    }, this.removeEventListener = (Q, F) => {\n      U.has(Q) && U.get(Q).delete(F);\n    }, this.hasEventListener = (Q, F) => !!U.has(Q) && U.get(Q).has(F), this.dispatchEvent = (Q) => {\n      if (U.has(Q.type))\n        for (const F of U.get(Q.type))\n          F(Q);\n    };\n  }\n}\nclass nU {\n  constructor(U = 1, Q = 0, F = 0, l = 0, Z = 0, t = 1, d = 0, B = 0, n = 0, V = 0, R = 1, s = 0, h = 0, c = 0, C = 0, I = 1) {\n    this.buffer = [U, Q, F, l, Z, t, d, B, n, V, R, s, h, c, C, I];\n  }\n  equals(U) {\n    if (this.buffer.length !== U.buffer.length)\n      return !1;\n    if (this.buffer === U.buffer)\n      return !0;\n    for (let Q = 0; Q < this.buffer.length; Q++)\n      if (this.buffer[Q] !== U.buffer[Q])\n        return !1;\n    return !0;\n  }\n  multiply(U) {\n    const Q = this.buffer, F = U.buffer;\n    return new nU(F[0] * Q[0] + F[1] * Q[4] + F[2] * Q[8] + F[3] * Q[12], F[0] * Q[1] + F[1] * Q[5] + F[2] * Q[9] + F[3] * Q[13], F[0] * Q[2] + F[1] * Q[6] + F[2] * Q[10] + F[3] * Q[14], F[0] * Q[3] + F[1] * Q[7] + F[2] * Q[11] + F[3] * Q[15], F[4] * Q[0] + F[5] * Q[4] + F[6] * Q[8] + F[7] * Q[12], F[4] * Q[1] + F[5] * Q[5] + F[6] * Q[9] + F[7] * Q[13], F[4] * Q[2] + F[5] * Q[6] + F[6] * Q[10] + F[7] * Q[14], F[4] * Q[3] + F[5] * Q[7] + F[6] * Q[11] + F[7] * Q[15], F[8] * Q[0] + F[9] * Q[4] + F[10] * Q[8] + F[11] * Q[12], F[8] * Q[1] + F[9] * Q[5] + F[10] * Q[9] + F[11] * Q[13], F[8] * Q[2] + F[9] * Q[6] + F[10] * Q[10] + F[11] * Q[14], F[8] * Q[3] + F[9] * Q[7] + F[10] * Q[11] + F[11] * Q[15], F[12] * Q[0] + F[13] * Q[4] + F[14] * Q[8] + F[15] * Q[12], F[12] * Q[1] + F[13] * Q[5] + F[14] * Q[9] + F[15] * Q[13], F[12] * Q[2] + F[13] * Q[6] + F[14] * Q[10] + F[15] * Q[14], F[12] * Q[3] + F[13] * Q[7] + F[14] * Q[11] + F[15] * Q[15]);\n  }\n  clone() {\n    const U = this.buffer;\n    return new nU(U[0], U[1], U[2], U[3], U[4], U[5], U[6], U[7], U[8], U[9], U[10], U[11], U[12], U[13], U[14], U[15]);\n  }\n  determinant() {\n    const U = this.buffer;\n    return U[12] * U[9] * U[6] * U[3] - U[8] * U[13] * U[6] * U[3] - U[12] * U[5] * U[10] * U[3] + U[4] * U[13] * U[10] * U[3] + U[8] * U[5] * U[14] * U[3] - U[4] * U[9] * U[14] * U[3] - U[12] * U[9] * U[2] * U[7] + U[8] * U[13] * U[2] * U[7] + U[12] * U[1] * U[10] * U[7] - U[0] * U[13] * U[10] * U[7] - U[8] * U[1] * U[14] * U[7] + U[0] * U[9] * U[14] * U[7] + U[12] * U[5] * U[2] * U[11] - U[4] * U[13] * U[2] * U[11] - U[12] * U[1] * U[6] * U[11] + U[0] * U[13] * U[6] * U[11] + U[4] * U[1] * U[14] * U[11] - U[0] * U[5] * U[14] * U[11] - U[8] * U[5] * U[2] * U[15] + U[4] * U[9] * U[2] * U[15] + U[8] * U[1] * U[6] * U[15] - U[0] * U[9] * U[6] * U[15] - U[4] * U[1] * U[10] * U[15] + U[0] * U[5] * U[10] * U[15];\n  }\n  invert() {\n    const U = this.buffer, Q = this.determinant();\n    if (Q === 0)\n      throw new Error(\"Matrix is not invertible.\");\n    const F = 1 / Q;\n    return new nU(F * (U[5] * U[10] * U[15] - U[5] * U[11] * U[14] - U[9] * U[6] * U[15] + U[9] * U[7] * U[14] + U[13] * U[6] * U[11] - U[13] * U[7] * U[10]), F * (-U[1] * U[10] * U[15] + U[1] * U[11] * U[14] + U[9] * U[2] * U[15] - U[9] * U[3] * U[14] - U[13] * U[2] * U[11] + U[13] * U[3] * U[10]), F * (U[1] * U[6] * U[15] - U[1] * U[7] * U[14] - U[5] * U[2] * U[15] + U[5] * U[3] * U[14] + U[13] * U[2] * U[7] - U[13] * U[3] * U[6]), F * (-U[1] * U[6] * U[11] + U[1] * U[7] * U[10] + U[5] * U[2] * U[11] - U[5] * U[3] * U[10] - U[9] * U[2] * U[7] + U[9] * U[3] * U[6]), F * (-U[4] * U[10] * U[15] + U[4] * U[11] * U[14] + U[8] * U[6] * U[15] - U[8] * U[7] * U[14] - U[12] * U[6] * U[11] + U[12] * U[7] * U[10]), F * (U[0] * U[10] * U[15] - U[0] * U[11] * U[14] - U[8] * U[2] * U[15] + U[8] * U[3] * U[14] + U[12] * U[2] * U[11] - U[12] * U[3] * U[10]), F * (-U[0] * U[6] * U[15] + U[0] * U[7] * U[14] + U[4] * U[2] * U[15] - U[4] * U[3] * U[14] - U[12] * U[2] * U[7] + U[12] * U[3] * U[6]), F * (U[0] * U[6] * U[11] - U[0] * U[7] * U[10] - U[4] * U[2] * U[11] + U[4] * U[3] * U[10] + U[8] * U[2] * U[7] - U[8] * U[3] * U[6]), F * (U[4] * U[9] * U[15] - U[4] * U[11] * U[13] - U[8] * U[5] * U[15] + U[8] * U[7] * U[13] + U[12] * U[5] * U[11] - U[12] * U[7] * U[9]), F * (-U[0] * U[9] * U[15] + U[0] * U[11] * U[13] + U[8] * U[1] * U[15] - U[8] * U[3] * U[13] - U[12] * U[1] * U[11] + U[12] * U[3] * U[9]), F * (U[0] * U[5] * U[15] - U[0] * U[7] * U[13] - U[4] * U[1] * U[15] + U[4] * U[3] * U[13] + U[12] * U[1] * U[7] - U[12] * U[3] * U[5]), F * (-U[0] * U[5] * U[11] + U[0] * U[7] * U[9] + U[4] * U[1] * U[11] - U[4] * U[3] * U[9] - U[8] * U[1] * U[7] + U[8] * U[3] * U[5]), F * (-U[4] * U[9] * U[14] + U[4] * U[10] * U[13] + U[8] * U[5] * U[14] - U[8] * U[6] * U[13] - U[12] * U[5] * U[10] + U[12] * U[6] * U[9]), F * (U[0] * U[9] * U[14] - U[0] * U[10] * U[13] - U[8] * U[1] * U[14] + U[8] * U[2] * U[13] + U[12] * U[1] * U[10] - U[12] * U[2] * U[9]), F * (-U[0] * U[5] * U[14] + U[0] * U[6] * U[13] + U[4] * U[1] * U[14] - U[4] * U[2] * U[13] - U[12] * U[1] * U[6] + U[12] * U[2] * U[5]), F * (U[0] * U[5] * U[10] - U[0] * U[6] * U[9] - U[4] * U[1] * U[10] + U[4] * U[2] * U[9] + U[8] * U[1] * U[6] - U[8] * U[2] * U[5]));\n  }\n  static Compose(U, Q, F) {\n    const l = Q.x, Z = Q.y, t = Q.z, d = Q.w, B = l + l, n = Z + Z, V = t + t, R = l * B, s = l * n, h = l * V, c = Z * n, C = Z * V, I = t * V, E = d * B, N = d * n, G = d * V, u = F.x, T = F.y, j = F.z;\n    return new nU((1 - (c + I)) * u, (s + G) * u, (h - N) * u, 0, (s - G) * T, (1 - (R + I)) * T, (C + E) * T, 0, (h + N) * j, (C - E) * j, (1 - (R + c)) * j, 0, U.x, U.y, U.z, 1);\n  }\n  toString() {\n    return `[${this.buffer.join(\", \")}]`;\n  }\n}\nclass jU extends Event {\n  constructor(U) {\n    super(\"objectAdded\"), this.object = U;\n  }\n}\nclass OU extends Event {\n  constructor(U) {\n    super(\"objectRemoved\"), this.object = U;\n  }\n}\nclass LU extends Event {\n  constructor(U) {\n    super(\"objectChanged\"), this.object = U;\n  }\n}\nclass NU extends gU {\n  constructor() {\n    super(), this.positionChanged = !1, this.rotationChanged = !1, this.scaleChanged = !1, this._position = new X(), this._rotation = new z(), this._scale = new X(1, 1, 1), this._transform = new nU(), this._changeEvent = new LU(this), this.update = () => {\n    }, this.applyPosition = () => {\n      this.position = new X();\n    }, this.applyRotation = () => {\n      this.rotation = new z();\n    }, this.applyScale = () => {\n      this.scale = new X(1, 1, 1);\n    }, this.raiseChangeEvent = () => {\n      this.dispatchEvent(this._changeEvent);\n    };\n  }\n  _updateMatrix() {\n    this._transform = nU.Compose(this._position, this._rotation, this._scale);\n  }\n  get position() {\n    return this._position;\n  }\n  set position(U) {\n    this._position.equals(U) || (this._position = U, this.positionChanged = !0, this._updateMatrix(), this.dispatchEvent(this._changeEvent));\n  }\n  get rotation() {\n    return this._rotation;\n  }\n  set rotation(U) {\n    this._rotation.equals(U) || (this._rotation = U, this.rotationChanged = !0, this._updateMatrix(), this.dispatchEvent(this._changeEvent));\n  }\n  get scale() {\n    return this._scale;\n  }\n  set scale(U) {\n    this._scale.equals(U) || (this._scale = U, this.scaleChanged = !0, this._updateMatrix(), this.dispatchEvent(this._changeEvent));\n  }\n  get forward() {\n    let U = new X(0, 0, 1);\n    return U = this.rotation.apply(U), U;\n  }\n  get transform() {\n    return this._transform;\n  }\n}\nclass VU {\n  constructor(U = 1, Q = 0, F = 0, l = 0, Z = 1, t = 0, d = 0, B = 0, n = 1) {\n    this.buffer = [U, Q, F, l, Z, t, d, B, n];\n  }\n  equals(U) {\n    if (this.buffer.length !== U.buffer.length)\n      return !1;\n    if (this.buffer === U.buffer)\n      return !0;\n    for (let Q = 0; Q < this.buffer.length; Q++)\n      if (this.buffer[Q] !== U.buffer[Q])\n        return !1;\n    return !0;\n  }\n  multiply(U) {\n    const Q = this.buffer, F = U.buffer;\n    return new VU(F[0] * Q[0] + F[3] * Q[1] + F[6] * Q[2], F[1] * Q[0] + F[4] * Q[1] + F[7] * Q[2], F[2] * Q[0] + F[5] * Q[1] + F[8] * Q[2], F[0] * Q[3] + F[3] * Q[4] + F[6] * Q[5], F[1] * Q[3] + F[4] * Q[4] + F[7] * Q[5], F[2] * Q[3] + F[5] * Q[4] + F[8] * Q[5], F[0] * Q[6] + F[3] * Q[7] + F[6] * Q[8], F[1] * Q[6] + F[4] * Q[7] + F[7] * Q[8], F[2] * Q[6] + F[5] * Q[7] + F[8] * Q[8]);\n  }\n  clone() {\n    const U = this.buffer;\n    return new VU(U[0], U[1], U[2], U[3], U[4], U[5], U[6], U[7], U[8]);\n  }\n  static Eye(U = 1) {\n    return new VU(U, 0, 0, 0, U, 0, 0, 0, U);\n  }\n  static Diagonal(U) {\n    return new VU(U.x, 0, 0, 0, U.y, 0, 0, 0, U.z);\n  }\n  static RotationFromQuaternion(U) {\n    return new VU(1 - 2 * U.y * U.y - 2 * U.z * U.z, 2 * U.x * U.y - 2 * U.z * U.w, 2 * U.x * U.z + 2 * U.y * U.w, 2 * U.x * U.y + 2 * U.z * U.w, 1 - 2 * U.x * U.x - 2 * U.z * U.z, 2 * U.y * U.z - 2 * U.x * U.w, 2 * U.x * U.z - 2 * U.y * U.w, 2 * U.y * U.z + 2 * U.x * U.w, 1 - 2 * U.x * U.x - 2 * U.y * U.y);\n  }\n  static RotationFromEuler(U) {\n    const Q = Math.cos(U.x), F = Math.sin(U.x), l = Math.cos(U.y), Z = Math.sin(U.y), t = Math.cos(U.z), d = Math.sin(U.z);\n    return new VU(l * t + Z * F * d, -l * d + Z * F * t, Z * Q, Q * d, Q * t, -F, -Z * t + l * F * d, Z * d + l * F * t, l * Q);\n  }\n  toString() {\n    return `[${this.buffer.join(\", \")}]`;\n  }\n}\nclass FU {\n  constructor(U = 0, Q = null, F = null, l = null, Z = null) {\n    this.changed = !1, this.detached = !1, this._vertexCount = U, this._positions = Q || new Float32Array(0), this._rotations = F || new Float32Array(0), this._scales = l || new Float32Array(0), this._colors = Z || new Uint8Array(0), this._selection = new Uint8Array(this.vertexCount), this.translate = (t) => {\n      for (let d = 0; d < this.vertexCount; d++)\n        this.positions[3 * d + 0] += t.x, this.positions[3 * d + 1] += t.y, this.positions[3 * d + 2] += t.z;\n      this.changed = !0;\n    }, this.rotate = (t) => {\n      const d = VU.RotationFromQuaternion(t).buffer;\n      for (let B = 0; B < this.vertexCount; B++) {\n        const n = this.positions[3 * B + 0], V = this.positions[3 * B + 1], R = this.positions[3 * B + 2];\n        this.positions[3 * B + 0] = d[0] * n + d[1] * V + d[2] * R, this.positions[3 * B + 1] = d[3] * n + d[4] * V + d[5] * R, this.positions[3 * B + 2] = d[6] * n + d[7] * V + d[8] * R;\n        const s = new z(this.rotations[4 * B + 1], this.rotations[4 * B + 2], this.rotations[4 * B + 3], this.rotations[4 * B + 0]), h = t.multiply(s);\n        this.rotations[4 * B + 1] = h.x, this.rotations[4 * B + 2] = h.y, this.rotations[4 * B + 3] = h.z, this.rotations[4 * B + 0] = h.w;\n      }\n      this.changed = !0;\n    }, this.scale = (t) => {\n      for (let d = 0; d < this.vertexCount; d++)\n        this.positions[3 * d + 0] *= t.x, this.positions[3 * d + 1] *= t.y, this.positions[3 * d + 2] *= t.z, this.scales[3 * d + 0] *= t.x, this.scales[3 * d + 1] *= t.y, this.scales[3 * d + 2] *= t.z;\n      this.changed = !0;\n    }, this.serialize = () => {\n      const t = new Uint8Array(this.vertexCount * FU.RowLength), d = new Float32Array(t.buffer), B = new Uint8Array(t.buffer);\n      for (let n = 0; n < this.vertexCount; n++)\n        d[8 * n + 0] = this.positions[3 * n + 0], d[8 * n + 1] = this.positions[3 * n + 1], d[8 * n + 2] = this.positions[3 * n + 2], B[32 * n + 24 + 0] = this.colors[4 * n + 0], B[32 * n + 24 + 1] = this.colors[4 * n + 1], B[32 * n + 24 + 2] = this.colors[4 * n + 2], B[32 * n + 24 + 3] = this.colors[4 * n + 3], d[8 * n + 3 + 0] = this.scales[3 * n + 0], d[8 * n + 3 + 1] = this.scales[3 * n + 1], d[8 * n + 3 + 2] = this.scales[3 * n + 2], B[32 * n + 28 + 0] = 128 * this.rotations[4 * n + 0] + 128 & 255, B[32 * n + 28 + 1] = 128 * this.rotations[4 * n + 1] + 128 & 255, B[32 * n + 28 + 2] = 128 * this.rotations[4 * n + 2] + 128 & 255, B[32 * n + 28 + 3] = 128 * this.rotations[4 * n + 3] + 128 & 255;\n      return t;\n    }, this.reattach = (t, d, B, n, V) => {\n      console.assert(t.byteLength === 3 * this.vertexCount * 4, `Expected ${3 * this.vertexCount * 4} bytes, got ${t.byteLength} bytes`), this._positions = new Float32Array(t), this._rotations = new Float32Array(d), this._scales = new Float32Array(B), this._colors = new Uint8Array(n), this._selection = new Uint8Array(V), this.detached = !1;\n    };\n  }\n  static Deserialize(U) {\n    const Q = U.length / FU.RowLength, F = new Float32Array(3 * Q), l = new Float32Array(4 * Q), Z = new Float32Array(3 * Q), t = new Uint8Array(4 * Q), d = new Float32Array(U.buffer), B = new Uint8Array(U.buffer);\n    for (let n = 0; n < Q; n++)\n      F[3 * n + 0] = d[8 * n + 0], F[3 * n + 1] = d[8 * n + 1], F[3 * n + 2] = d[8 * n + 2], l[4 * n + 0] = (B[32 * n + 28 + 0] - 128) / 128, l[4 * n + 1] = (B[32 * n + 28 + 1] - 128) / 128, l[4 * n + 2] = (B[32 * n + 28 + 2] - 128) / 128, l[4 * n + 3] = (B[32 * n + 28 + 3] - 128) / 128, Z[3 * n + 0] = d[8 * n + 3 + 0], Z[3 * n + 1] = d[8 * n + 3 + 1], Z[3 * n + 2] = d[8 * n + 3 + 2], t[4 * n + 0] = B[32 * n + 24 + 0], t[4 * n + 1] = B[32 * n + 24 + 1], t[4 * n + 2] = B[32 * n + 24 + 2], t[4 * n + 3] = B[32 * n + 24 + 3];\n    return new FU(Q, F, l, Z, t);\n  }\n  get vertexCount() {\n    return this._vertexCount;\n  }\n  get positions() {\n    return this._positions;\n  }\n  get rotations() {\n    return this._rotations;\n  }\n  get scales() {\n    return this._scales;\n  }\n  get colors() {\n    return this._colors;\n  }\n  get selection() {\n    return this._selection;\n  }\n}\nFU.RowLength = 32;\nclass WU {\n  static SplatToPLY(U, Q) {\n    let F = `ply\nformat binary_little_endian 1.0\n`;\n    F += `element vertex ${Q}\n`;\n    const l = [\"x\", \"y\", \"z\", \"nx\", \"ny\", \"nz\", \"f_dc_0\", \"f_dc_1\", \"f_dc_2\"];\n    for (let c = 0; c < 45; c++)\n      l.push(`f_rest_${c}`);\n    l.push(\"opacity\"), l.push(\"scale_0\"), l.push(\"scale_1\"), l.push(\"scale_2\"), l.push(\"rot_0\"), l.push(\"rot_1\"), l.push(\"rot_2\"), l.push(\"rot_3\");\n    for (const c of l)\n      F += `property float ${c}\n`;\n    F += `end_header\n`;\n    const Z = new TextEncoder().encode(F), t = 248, d = Q * t, B = new DataView(new ArrayBuffer(Z.length + d));\n    new Uint8Array(B.buffer).set(Z, 0);\n    const n = new Float32Array(U), V = new Uint8Array(U), R = Z.length, s = 220, h = 232;\n    for (let c = 0; c < Q; c++) {\n      const C = n[8 * c + 0], I = n[8 * c + 1], E = n[8 * c + 2], N = (V[32 * c + 24 + 0] / 255 - 0.5) / this.SH_C0, G = (V[32 * c + 24 + 1] / 255 - 0.5) / this.SH_C0, u = (V[32 * c + 24 + 2] / 255 - 0.5) / this.SH_C0, T = V[32 * c + 24 + 3] / 255, j = Math.log(T / (1 - T)), D = Math.log(n[8 * c + 3 + 0]), k = Math.log(n[8 * c + 3 + 1]), S = Math.log(n[8 * c + 3 + 2]);\n      let w = new z((V[32 * c + 28 + 1] - 128) / 128, (V[32 * c + 28 + 2] - 128) / 128, (V[32 * c + 28 + 3] - 128) / 128, (V[32 * c + 28 + 0] - 128) / 128);\n      w = w.normalize();\n      const lU = w.w, QU = w.x, p = w.y, f = w.z;\n      B.setFloat32(R + t * c + 0, C, !0), B.setFloat32(R + t * c + 4, I, !0), B.setFloat32(R + t * c + 8, E, !0), B.setFloat32(R + t * c + 24 + 0, N, !0), B.setFloat32(R + t * c + 24 + 4, G, !0), B.setFloat32(R + t * c + 24 + 8, u, !0), B.setFloat32(R + t * c + 216, j, !0), B.setFloat32(R + t * c + s + 0, D, !0), B.setFloat32(R + t * c + s + 4, k, !0), B.setFloat32(R + t * c + s + 8, S, !0), B.setFloat32(R + t * c + h + 0, lU, !0), B.setFloat32(R + t * c + h + 4, QU, !0), B.setFloat32(R + t * c + h + 8, p, !0), B.setFloat32(R + t * c + h + 12, f, !0);\n    }\n    return B.buffer;\n  }\n}\nWU.SH_C0 = 0.28209479177387814;\nclass ZU extends NU {\n  constructor(U = void 0) {\n    super(), this.selectedChanged = !1, this.colorTransformChanged = !1, this._selected = !1, this._colorTransforms = [], this._colorTransformsMap = /* @__PURE__ */ new Map(), this._data = U || new FU(), this.applyPosition = () => {\n      this.data.translate(this.position), this.position = new X();\n    }, this.applyRotation = () => {\n      this.data.rotate(this.rotation), this.rotation = new z();\n    }, this.applyScale = () => {\n      this.data.scale(this.scale), this.scale = new X(1, 1, 1);\n    };\n  }\n  saveToFile(U = null, Q = null) {\n    if (!document)\n      return;\n    if (Q) {\n      if (Q !== \"splat\" && Q !== \"ply\")\n        throw new Error(\"Invalid format. Must be 'splat' or 'ply'\");\n    } else\n      Q = \"splat\";\n    if (!U) {\n      const t = /* @__PURE__ */ new Date();\n      U = `splat-${t.getFullYear()}-${t.getMonth() + 1}-${t.getDate()}.${Q}`;\n    }\n    this.applyRotation(), this.applyScale(), this.applyPosition();\n    const F = this.data.serialize();\n    let l;\n    if (Q === \"ply\") {\n      const t = WU.SplatToPLY(F.buffer, this.data.vertexCount);\n      l = new Blob([t], { type: \"application/octet-stream\" });\n    } else\n      l = new Blob([F.buffer], { type: \"application/octet-stream\" });\n    const Z = document.createElement(\"a\");\n    Z.download = U, Z.href = URL.createObjectURL(l), Z.click();\n  }\n  get data() {\n    return this._data;\n  }\n  get selected() {\n    return this._selected;\n  }\n  set selected(U) {\n    this._selected !== U && (this._selected = U, this.selectedChanged = !0, this.dispatchEvent(this._changeEvent));\n  }\n  get colorTransforms() {\n    return this._colorTransforms;\n  }\n  get colorTransformsMap() {\n    return this._colorTransformsMap;\n  }\n}\nclass PU {\n  constructor() {\n    this._fx = 1132, this._fy = 1132, this._near = 0.1, this._far = 100, this._width = 512, this._height = 512, this._projectionMatrix = new nU(), this._viewMatrix = new nU(), this._viewProj = new nU(), this._updateProjectionMatrix = () => {\n      this._projectionMatrix = new nU(2 * this.fx / this.width, 0, 0, 0, 0, -2 * this.fy / this.height, 0, 0, 0, 0, this.far / (this.far - this.near), 1, 0, 0, -this.far * this.near / (this.far - this.near), 0), this._viewProj = this.projectionMatrix.multiply(this.viewMatrix);\n    }, this.update = (U, Q) => {\n      const F = VU.RotationFromQuaternion(Q).buffer, l = U.flat();\n      this._viewMatrix = new nU(F[0], F[1], F[2], 0, F[3], F[4], F[5], 0, F[6], F[7], F[8], 0, -l[0] * F[0] - l[1] * F[3] - l[2] * F[6], -l[0] * F[1] - l[1] * F[4] - l[2] * F[7], -l[0] * F[2] - l[1] * F[5] - l[2] * F[8], 1), this._viewProj = this.projectionMatrix.multiply(this.viewMatrix);\n    }, this.setSize = (U, Q) => {\n      this._width = U, this._height = Q, this._updateProjectionMatrix();\n    };\n  }\n  get fx() {\n    return this._fx;\n  }\n  set fx(U) {\n    this._fx !== U && (this._fx = U, this._updateProjectionMatrix());\n  }\n  get fy() {\n    return this._fy;\n  }\n  set fy(U) {\n    this._fy !== U && (this._fy = U, this._updateProjectionMatrix());\n  }\n  get near() {\n    return this._near;\n  }\n  set near(U) {\n    this._near !== U && (this._near = U, this._updateProjectionMatrix());\n  }\n  get far() {\n    return this._far;\n  }\n  set far(U) {\n    this._far !== U && (this._far = U, this._updateProjectionMatrix());\n  }\n  get width() {\n    return this._width;\n  }\n  get height() {\n    return this._height;\n  }\n  get projectionMatrix() {\n    return this._projectionMatrix;\n  }\n  get viewMatrix() {\n    return this._viewMatrix;\n  }\n  get viewProj() {\n    return this._viewProj;\n  }\n}\nclass BU {\n  constructor(U = 0, Q = 0, F = 0, l = 0) {\n    this.x = U, this.y = Q, this.z = F, this.w = l;\n  }\n  equals(U) {\n    return this.x === U.x && this.y === U.y && this.z === U.z && this.w === U.w;\n  }\n  add(U) {\n    return typeof U == \"number\" ? new BU(this.x + U, this.y + U, this.z + U, this.w + U) : new BU(this.x + U.x, this.y + U.y, this.z + U.z, this.w + U.w);\n  }\n  subtract(U) {\n    return typeof U == \"number\" ? new BU(this.x - U, this.y - U, this.z - U, this.w - U) : new BU(this.x - U.x, this.y - U.y, this.z - U.z, this.w - U.w);\n  }\n  multiply(U) {\n    return typeof U == \"number\" ? new BU(this.x * U, this.y * U, this.z * U, this.w * U) : U instanceof BU ? new BU(this.x * U.x, this.y * U.y, this.z * U.z, this.w * U.w) : new BU(this.x * U.buffer[0] + this.y * U.buffer[4] + this.z * U.buffer[8] + this.w * U.buffer[12], this.x * U.buffer[1] + this.y * U.buffer[5] + this.z * U.buffer[9] + this.w * U.buffer[13], this.x * U.buffer[2] + this.y * U.buffer[6] + this.z * U.buffer[10] + this.w * U.buffer[14], this.x * U.buffer[3] + this.y * U.buffer[7] + this.z * U.buffer[11] + this.w * U.buffer[15]);\n  }\n  dot(U) {\n    return this.x * U.x + this.y * U.y + this.z * U.z + this.w * U.w;\n  }\n  lerp(U, Q) {\n    return new BU(this.x + (U.x - this.x) * Q, this.y + (U.y - this.y) * Q, this.z + (U.z - this.z) * Q, this.w + (U.w - this.w) * Q);\n  }\n  magnitude() {\n    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n  }\n  distanceTo(U) {\n    return Math.sqrt((this.x - U.x) ** 2 + (this.y - U.y) ** 2 + (this.z - U.z) ** 2 + (this.w - U.w) ** 2);\n  }\n  normalize() {\n    const U = this.magnitude();\n    return new BU(this.x / U, this.y / U, this.z / U, this.w / U);\n  }\n  flat() {\n    return [this.x, this.y, this.z, this.w];\n  }\n  clone() {\n    return new BU(this.x, this.y, this.z, this.w);\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n}\nclass _U extends NU {\n  constructor(U = void 0) {\n    super(), this._data = U || new PU(), this._position = new X(0, 0, -5), this.update = () => {\n      this.data.update(this.position, this.rotation);\n    }, this.screenPointToRay = (Q, F) => {\n      const l = new BU(Q, F, -1, 1), Z = this._data.projectionMatrix.invert(), t = l.multiply(Z), d = this._data.viewMatrix.invert(), B = t.multiply(d);\n      return new X(B.x / B.w, B.y / B.w, B.z / B.w).subtract(this.position).normalize();\n    };\n  }\n  get data() {\n    return this._data;\n  }\n}\nclass qU extends gU {\n  constructor() {\n    super(), this._objects = [], this.addObject = (U) => {\n      this.objects.push(U), this.dispatchEvent(new jU(U));\n    }, this.removeObject = (U) => {\n      const Q = this.objects.indexOf(U);\n      if (Q < 0)\n        throw new Error(\"Object not found in scene\");\n      this.objects.splice(Q, 1), this.dispatchEvent(new OU(U));\n    }, this.findObject = (U) => {\n      for (const Q of this.objects)\n        if (U(Q))\n          return Q;\n    }, this.findObjectOfType = (U) => {\n      for (const Q of this.objects)\n        if (Q instanceof U)\n          return Q;\n    }, this.reset = () => {\n      const U = this.objects.slice();\n      for (const Q of U)\n        this.removeObject(Q);\n    }, this.reset();\n  }\n  saveToFile(U = null, Q = null) {\n    if (!document)\n      return;\n    if (Q) {\n      if (Q !== \"splat\" && Q !== \"ply\")\n        throw new Error(\"Invalid format. Must be 'splat' or 'ply'\");\n    } else\n      Q = \"splat\";\n    if (!U) {\n      const n = /* @__PURE__ */ new Date();\n      U = `scene-${n.getFullYear()}-${n.getMonth() + 1}-${n.getDate()}.${Q}`;\n    }\n    const F = [];\n    let l = 0;\n    for (const n of this.objects)\n      if (n.applyRotation(), n.applyScale(), n.applyPosition(), n instanceof ZU) {\n        const V = n.data.serialize();\n        F.push(V), l += n.data.vertexCount;\n      }\n    const Z = new Uint8Array(l * FU.RowLength);\n    let t, d = 0;\n    for (const n of F)\n      Z.set(n, d), d += n.length;\n    if (Q === \"ply\") {\n      const n = WU.SplatToPLY(Z.buffer, l);\n      t = new Blob([n], { type: \"application/octet-stream\" });\n    } else\n      t = new Blob([Z.buffer], { type: \"application/octet-stream\" });\n    const B = document.createElement(\"a\");\n    B.download = U, B.href = URL.createObjectURL(t), B.click();\n  }\n  get objects() {\n    return this._objects;\n  }\n}\nasync function GU(g, U) {\n  const Q = await fetch(g, { mode: \"cors\", credentials: \"omit\", cache: U ? \"force-cache\" : \"default\" });\n  if (Q.status != 200)\n    throw new Error(Q.status + \" Unable to load \" + Q.url);\n  return Q;\n}\nasync function EU(g, U) {\n  return g.headers.has(\"content-length\") ? async function(Q, F) {\n    const l = Q.body.getReader(), Z = parseInt(Q.headers.get(\"content-length\")), t = new Uint8Array(Z);\n    let d = 0;\n    for (; ; ) {\n      const { done: B, value: n } = await l.read();\n      if (B)\n        break;\n      t.set(n, d), d += n.length, F == null || F(d / Z);\n    }\n    return t;\n  }(g, U) : async function(Q, F) {\n    const l = Q.body.getReader(), Z = [];\n    let t = 0;\n    for (; ; ) {\n      const { done: n, value: V } = await l.read();\n      if (n)\n        break;\n      Z.push(V), t += V.length;\n    }\n    const d = new Uint8Array(t);\n    let B = 0;\n    for (const n of Z)\n      d.set(n, B), B += n.length, F == null || F(B / t);\n    return d;\n  }(g, U);\n}\nclass $U {\n  static async LoadAsync(U, Q, F, l = !1) {\n    const Z = await GU(U, l), t = await EU(Z, F);\n    return this.LoadFromArrayBuffer(t, Q);\n  }\n  static async LoadFromFileAsync(U, Q, F) {\n    const l = new FileReader();\n    let Z = new ZU();\n    return l.onload = (t) => {\n      Z = this.LoadFromArrayBuffer(t.target.result, Q);\n    }, l.onprogress = (t) => {\n      F == null || F(t.loaded / t.total);\n    }, l.readAsArrayBuffer(U), await new Promise((t) => {\n      l.onloadend = () => {\n        t();\n      };\n    }), Z;\n  }\n  static LoadFromArrayBuffer(U, Q) {\n    const F = new Uint8Array(U), l = FU.Deserialize(F), Z = new ZU(l);\n    return Q.addObject(Z), Z;\n  }\n}\nclass UF {\n  static async LoadAsync(U, Q, F, l = \"\", Z = !1) {\n    const t = await GU(U, Z), d = await EU(t, F);\n    if (d[0] !== 112 || d[1] !== 108 || d[2] !== 121 || d[3] !== 10)\n      throw new Error(\"Invalid PLY file\");\n    return this.LoadFromArrayBuffer(d.buffer, Q, l);\n  }\n  static async LoadFromFileAsync(U, Q, F, l = \"\") {\n    const Z = new FileReader();\n    let t = new ZU();\n    return Z.onload = (d) => {\n      t = this.LoadFromArrayBuffer(d.target.result, Q, l);\n    }, Z.onprogress = (d) => {\n      F == null || F(d.loaded / d.total);\n    }, Z.readAsArrayBuffer(U), await new Promise((d) => {\n      Z.onloadend = () => {\n        d();\n      };\n    }), t;\n  }\n  static LoadFromArrayBuffer(U, Q, F = \"\") {\n    const l = new Uint8Array(this._ParsePLYBuffer(U, F)), Z = FU.Deserialize(l), t = new ZU(Z);\n    return Q.addObject(t), t;\n  }\n  static _ParsePLYBuffer(U, Q) {\n    const F = new Uint8Array(U), l = new TextDecoder().decode(F.slice(0, 10240)), Z = `end_header\n`, t = l.indexOf(Z);\n    if (t < 0)\n      throw new Error(\"Unable to read .ply file header\");\n    const d = parseInt(/element vertex (\\d+)\\n/.exec(l)[1]);\n    let B = 0;\n    const n = { double: 8, int: 4, uint: 4, float: 4, short: 2, ushort: 2, uchar: 1 }, V = [];\n    for (const c of l.slice(0, t).split(`\n`).filter((C) => C.startsWith(\"property \"))) {\n      const [C, I, E] = c.split(\" \");\n      if (V.push({ name: E, type: I, offset: B }), !n[I])\n        throw new Error(`Unsupported property type: ${I}`);\n      B += n[I];\n    }\n    const R = new DataView(U, t + 11), s = new ArrayBuffer(FU.RowLength * d), h = z.FromEuler(new X(Math.PI / 2, 0, 0));\n    for (let c = 0; c < d; c++) {\n      const C = new Float32Array(s, c * FU.RowLength, 3), I = new Float32Array(s, c * FU.RowLength + 12, 3), E = new Uint8ClampedArray(s, c * FU.RowLength + 24, 4), N = new Uint8ClampedArray(s, c * FU.RowLength + 28, 4);\n      let G = 255, u = 0, T = 0, j = 0;\n      V.forEach((k) => {\n        let S;\n        switch (k.type) {\n          case \"float\":\n            S = R.getFloat32(k.offset + c * B, !0);\n            break;\n          case \"int\":\n            S = R.getInt32(k.offset + c * B, !0);\n            break;\n          default:\n            throw new Error(`Unsupported property type: ${k.type}`);\n        }\n        switch (k.name) {\n          case \"x\":\n            C[0] = S;\n            break;\n          case \"y\":\n            C[1] = S;\n            break;\n          case \"z\":\n            C[2] = S;\n            break;\n          case \"scale_0\":\n            I[0] = Math.exp(S);\n            break;\n          case \"scale_1\":\n            I[1] = Math.exp(S);\n            break;\n          case \"scale_2\":\n            I[2] = Math.exp(S);\n            break;\n          case \"red\":\n            E[0] = S;\n            break;\n          case \"green\":\n            E[1] = S;\n            break;\n          case \"blue\":\n            E[2] = S;\n            break;\n          case \"f_dc_0\":\n            E[0] = 255 * (0.5 + WU.SH_C0 * S);\n            break;\n          case \"f_dc_1\":\n            E[1] = 255 * (0.5 + WU.SH_C0 * S);\n            break;\n          case \"f_dc_2\":\n            E[2] = 255 * (0.5 + WU.SH_C0 * S);\n            break;\n          case \"f_dc_3\":\n            E[3] = 255 * (0.5 + WU.SH_C0 * S);\n            break;\n          case \"opacity\":\n            E[3] = 1 / (1 + Math.exp(-S)) * 255;\n            break;\n          case \"rot_0\":\n            G = S;\n            break;\n          case \"rot_1\":\n            u = S;\n            break;\n          case \"rot_2\":\n            T = S;\n            break;\n          case \"rot_3\":\n            j = S;\n        }\n      });\n      let D = new z(u, T, j, G);\n      switch (Q) {\n        case \"polycam\": {\n          const k = C[1];\n          C[1] = -C[2], C[2] = k, D = h.multiply(D);\n          break;\n        }\n        case \"\":\n          break;\n        default:\n          throw new Error(`Unsupported format: ${Q}`);\n      }\n      D = D.normalize(), N[0] = 128 * D.w + 128, N[1] = 128 * D.x + 128, N[2] = 128 * D.y + 128, N[3] = 128 * D.z + 128;\n    }\n    return s;\n  }\n}\nfunction FF(g, U, Q) {\n  var F = U === void 0 ? null : U, l = function(B, n) {\n    var V = atob(B);\n    if (n) {\n      for (var R = new Uint8Array(V.length), s = 0, h = V.length; s < h; ++s)\n        R[s] = V.charCodeAt(s);\n      return String.fromCharCode.apply(null, new Uint16Array(R.buffer));\n    }\n    return V;\n  }(g, Q !== void 0 && Q), Z = l.indexOf(`\n`, 10) + 1, t = l.substring(Z) + (F ? \"//# sourceMappingURL=\" + F : \"\"), d = new Blob([t], { type: \"application/javascript\" });\n  return URL.createObjectURL(d);\n}\nfunction XU(g, U, Q) {\n  var F;\n  return function(l) {\n    return F = F || FF(g, U, Q), new Worker(F, l);\n  };\n}\nvar lF = XU(\"Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgdmFyIGxvYWRXYXNtID0gKCgpID0+IHsKICAgIAogICAgcmV0dXJuICgKICBmdW5jdGlvbihtb2R1bGVBcmcgPSB7fSkgewoKICB2YXIgTW9kdWxlPW1vZHVsZUFyZzt2YXIgcmVhZHlQcm9taXNlUmVzb2x2ZSxyZWFkeVByb21pc2VSZWplY3Q7TW9kdWxlWyJyZWFkeSJdPW5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PntyZWFkeVByb21pc2VSZXNvbHZlPXJlc29sdmU7cmVhZHlQcm9taXNlUmVqZWN0PXJlamVjdDt9KTt2YXIgbW9kdWxlT3ZlcnJpZGVzPU9iamVjdC5hc3NpZ24oe30sTW9kdWxlKTt2YXIgc2NyaXB0RGlyZWN0b3J5PSIiO2Z1bmN0aW9uIGxvY2F0ZUZpbGUocGF0aCl7aWYoTW9kdWxlWyJsb2NhdGVGaWxlIl0pe3JldHVybiBNb2R1bGVbImxvY2F0ZUZpbGUiXShwYXRoLHNjcmlwdERpcmVjdG9yeSl9cmV0dXJuIHNjcmlwdERpcmVjdG9yeStwYXRofXZhciByZWFkQmluYXJ5O3t7c2NyaXB0RGlyZWN0b3J5PXNlbGYubG9jYXRpb24uaHJlZjt9aWYoc2NyaXB0RGlyZWN0b3J5LnN0YXJ0c1dpdGgoImJsb2I6Iikpe3NjcmlwdERpcmVjdG9yeT0iIjt9ZWxzZSB7c2NyaXB0RGlyZWN0b3J5PXNjcmlwdERpcmVjdG9yeS5zdWJzdHIoMCxzY3JpcHREaXJlY3RvcnkucmVwbGFjZSgvWz8jXS4qLywiIikubGFzdEluZGV4T2YoIi8iKSsxKTt9e3tyZWFkQmluYXJ5PXVybD0+e3ZhciB4aHI9bmV3IFhNTEh0dHBSZXF1ZXN0O3hoci5vcGVuKCJHRVQiLHVybCxmYWxzZSk7eGhyLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiO3hoci5zZW5kKG51bGwpO3JldHVybiBuZXcgVWludDhBcnJheSh4aHIucmVzcG9uc2UpfTt9fX1Nb2R1bGVbInByaW50Il18fGNvbnNvbGUubG9nLmJpbmQoY29uc29sZSk7dmFyIGVycj1Nb2R1bGVbInByaW50RXJyIl18fGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTtPYmplY3QuYXNzaWduKE1vZHVsZSxtb2R1bGVPdmVycmlkZXMpO21vZHVsZU92ZXJyaWRlcz1udWxsO2lmKE1vZHVsZVsiYXJndW1lbnRzIl0pTW9kdWxlWyJhcmd1bWVudHMiXTtpZihNb2R1bGVbInRoaXNQcm9ncmFtIl0pTW9kdWxlWyJ0aGlzUHJvZ3JhbSJdO2lmKE1vZHVsZVsicXVpdCJdKU1vZHVsZVsicXVpdCJdO3ZhciB3YXNtQmluYXJ5O2lmKE1vZHVsZVsid2FzbUJpbmFyeSJdKXdhc21CaW5hcnk9TW9kdWxlWyJ3YXNtQmluYXJ5Il07aWYodHlwZW9mIFdlYkFzc2VtYmx5IT0ib2JqZWN0Iil7YWJvcnQoIm5vIG5hdGl2ZSB3YXNtIHN1cHBvcnQgZGV0ZWN0ZWQiKTt9ZnVuY3Rpb24gaW50QXJyYXlGcm9tQmFzZTY0KHMpe3ZhciBkZWNvZGVkPWF0b2Iocyk7dmFyIGJ5dGVzPW5ldyBVaW50OEFycmF5KGRlY29kZWQubGVuZ3RoKTtmb3IodmFyIGk9MDtpPGRlY29kZWQubGVuZ3RoOysraSl7Ynl0ZXNbaV09ZGVjb2RlZC5jaGFyQ29kZUF0KGkpO31yZXR1cm4gYnl0ZXN9ZnVuY3Rpb24gdHJ5UGFyc2VBc0RhdGFVUkkoZmlsZW5hbWUpe2lmKCFpc0RhdGFVUkkoZmlsZW5hbWUpKXtyZXR1cm59cmV0dXJuIGludEFycmF5RnJvbUJhc2U2NChmaWxlbmFtZS5zbGljZShkYXRhVVJJUHJlZml4Lmxlbmd0aCkpfXZhciB3YXNtTWVtb3J5O3ZhciBBQk9SVD1mYWxzZTt2YXIgSEVBUDgsSEVBUFU4LEhFQVAxNixIRUFQVTE2LEhFQVAzMixIRUFQVTMyLEhFQVBGMzIsSEVBUEY2NDtmdW5jdGlvbiB1cGRhdGVNZW1vcnlWaWV3cygpe3ZhciBiPXdhc21NZW1vcnkuYnVmZmVyO01vZHVsZVsiSEVBUDgiXT1IRUFQOD1uZXcgSW50OEFycmF5KGIpO01vZHVsZVsiSEVBUDE2Il09SEVBUDE2PW5ldyBJbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUFU4Il09SEVBUFU4PW5ldyBVaW50OEFycmF5KGIpO01vZHVsZVsiSEVBUFUxNiJdPUhFQVBVMTY9bmV3IFVpbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUDMyIl09SEVBUDMyPW5ldyBJbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUFUzMiJdPUhFQVBVMzI9bmV3IFVpbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUEYzMiJdPUhFQVBGMzI9bmV3IEZsb2F0MzJBcnJheShiKTtNb2R1bGVbIkhFQVBGNjQiXT1IRUFQRjY0PW5ldyBGbG9hdDY0QXJyYXkoYik7fXZhciBfX0FUUFJFUlVOX189W107dmFyIF9fQVRJTklUX189W107dmFyIF9fQVRQT1NUUlVOX189W107ZnVuY3Rpb24gcHJlUnVuKCl7aWYoTW9kdWxlWyJwcmVSdW4iXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlUnVuIl09PSJmdW5jdGlvbiIpTW9kdWxlWyJwcmVSdW4iXT1bTW9kdWxlWyJwcmVSdW4iXV07d2hpbGUoTW9kdWxlWyJwcmVSdW4iXS5sZW5ndGgpe2FkZE9uUHJlUnVuKE1vZHVsZVsicHJlUnVuIl0uc2hpZnQoKSk7fX1jYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUUFJFUlVOX18pO31mdW5jdGlvbiBpbml0UnVudGltZSgpe2NhbGxSdW50aW1lQ2FsbGJhY2tzKF9fQVRJTklUX18pO31mdW5jdGlvbiBwb3N0UnVuKCl7aWYoTW9kdWxlWyJwb3N0UnVuIl0pe2lmKHR5cGVvZiBNb2R1bGVbInBvc3RSdW4iXT09ImZ1bmN0aW9uIilNb2R1bGVbInBvc3RSdW4iXT1bTW9kdWxlWyJwb3N0UnVuIl1dO3doaWxlKE1vZHVsZVsicG9zdFJ1biJdLmxlbmd0aCl7YWRkT25Qb3N0UnVuKE1vZHVsZVsicG9zdFJ1biJdLnNoaWZ0KCkpO319Y2FsbFJ1bnRpbWVDYWxsYmFja3MoX19BVFBPU1RSVU5fXyk7fWZ1bmN0aW9uIGFkZE9uUHJlUnVuKGNiKXtfX0FUUFJFUlVOX18udW5zaGlmdChjYik7fWZ1bmN0aW9uIGFkZE9uSW5pdChjYil7X19BVElOSVRfXy51bnNoaWZ0KGNiKTt9ZnVuY3Rpb24gYWRkT25Qb3N0UnVuKGNiKXtfX0FUUE9TVFJVTl9fLnVuc2hpZnQoY2IpO312YXIgcnVuRGVwZW5kZW5jaWVzPTA7dmFyIGRlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2Z1bmN0aW9uIGFkZFJ1bkRlcGVuZGVuY3koaWQpe3J1bkRlcGVuZGVuY2llcysrO01vZHVsZVsibW9uaXRvclJ1bkRlcGVuZGVuY2llcyJdPy4ocnVuRGVwZW5kZW5jaWVzKTt9ZnVuY3Rpb24gcmVtb3ZlUnVuRGVwZW5kZW5jeShpZCl7cnVuRGVwZW5kZW5jaWVzLS07TW9kdWxlWyJtb25pdG9yUnVuRGVwZW5kZW5jaWVzIl0/LihydW5EZXBlbmRlbmNpZXMpO2lmKHJ1bkRlcGVuZGVuY2llcz09MCl7aWYoZGVwZW5kZW5jaWVzRnVsZmlsbGVkKXt2YXIgY2FsbGJhY2s9ZGVwZW5kZW5jaWVzRnVsZmlsbGVkO2RlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2NhbGxiYWNrKCk7fX19ZnVuY3Rpb24gYWJvcnQod2hhdCl7TW9kdWxlWyJvbkFib3J0Il0/Lih3aGF0KTt3aGF0PSJBYm9ydGVkKCIrd2hhdCsiKSI7ZXJyKHdoYXQpO0FCT1JUPXRydWU7d2hhdCs9Ii4gQnVpbGQgd2l0aCAtc0FTU0VSVElPTlMgZm9yIG1vcmUgaW5mby4iO3ZhciBlPW5ldyBXZWJBc3NlbWJseS5SdW50aW1lRXJyb3Iod2hhdCk7cmVhZHlQcm9taXNlUmVqZWN0KGUpO3Rocm93IGV9dmFyIGRhdGFVUklQcmVmaXg9ImRhdGE6YXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtO2Jhc2U2NCwiO3ZhciBpc0RhdGFVUkk9ZmlsZW5hbWU9PmZpbGVuYW1lLnN0YXJ0c1dpdGgoZGF0YVVSSVByZWZpeCk7dmFyIHdhc21CaW5hcnlGaWxlO3dhc21CaW5hcnlGaWxlPSJkYXRhOmFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTtiYXNlNjQsQUdGemJRRUFBQUFCV3cxZ0JIOS9mMzhBWUFOL2YzOEFZQVYvZjM5L2Z3QmdCbjkvZjM5L2Z3QmdBWDhCZjJBQmZ3QmdBMzkvZndGL1lBSi9md0JnQUFCZ0FuOS9BWDlnQjM5L2YzOS9mMzhBWUFSL2YzNStBR0FLZjM5L2YzOS9mMzkvZndBQ1BRb0JZUUZoQUFFQllRRmlBQUlCWVFGakFBRUJZUUZrQUFjQllRRmxBQUVCWVFGbUFBb0JZUUZuQUFRQllRRm9BQVVCWVFGcEFBQUJZUUZxQUFjREdSZ0dCQVVJQlFVSkN3Z0JBQUVFQkFNREFnSUFBQWtHQmd3RUJRRndBUkFRQlFjQkFZQUNnSUFDQmdnQmZ3RkJzSjRFQ3djWkJnRnJBZ0FCYkFBTkFXMEFJUUZ1QVFBQmJ3QVhBWEFBRHdrVkFRQkJBUXNQRWhZTURnNGdEQjhZR2gwTUdSc2NDc0pPR0hFQkFYOGdBa1VFUUNBQUtBSUVJQUVvQWdSR0R3c2dBQ0FCUmdSQVFRRVBDd0pBSUFBb0FnUWlBaTBBQUNJQVJTQUFJQUVvQWdRaUFTMEFBQ0lEUjNJTkFBTkFJQUV0QUFFaEF5QUNMUUFCSWdCRkRRRWdBVUVCYWlFQklBSkJBV29oQWlBQUlBTkdEUUFMQ3lBQUlBTkdDMDhCQW45QnFCb29BZ0FpQVNBQVFRZHFRWGh4SWdKcUlRQUNRQ0FDUVFBZ0FDQUJUUnRGQkVBZ0FEOEFRUkIwVFEwQklBQVFCZzBCQzBHNEdrRXdOZ0lBUVg4UEMwR29HaUFBTmdJQUlBRUxCZ0FnQUJBUEN5a0FRYkFhUVFFMkFnQkJ0QnBCQURZQ0FCQVNRYlFhUWF3YUtBSUFOZ0lBUWF3YVFiQWFOZ0lBQ3dJQUM5a0xBUWQvQWtBZ0FFVU5BQ0FBUVFocklnTWdBRUVFYXlnQ0FDSUJRWGh4SWdCcUlRVUNRQ0FCUVFGeERRQWdBVUVDY1VVTkFTQURJQU1vQWdBaUFXc2lBMEhNR2lnQ0FFa05BU0FBSUFGcUlRQUNRQUpBUWRBYUtBSUFJQU5IQkVBZ0F5Z0NEQ0VDSUFGQi93Rk5CRUFnQVVFRGRpRUJJQU1vQWdnaUJDQUNSZ1JBUWJ3YVFid2FLQUlBUVg0Z0FYZHhOZ0lBREFVTElBUWdBallDRENBQ0lBUTJBZ2dNQkFzZ0F5Z0NHQ0VHSUFJZ0EwY0VRQ0FES0FJSUlnRWdBallDRENBQ0lBRTJBZ2dNQXdzZ0F5Z0NGQ0lCQkg4Z0EwRVVhZ1VnQXlnQ0VDSUJSUTBDSUFOQkVHb0xJUVFEUUNBRUlRY2dBU0lDUVJScUlRUWdBaWdDRkNJQkRRQWdBa0VRYWlFRUlBSW9BaEFpQVEwQUN5QUhRUUEyQWdBTUFnc2dCU2dDQkNJQlFRTnhRUU5IRFFKQnhCb2dBRFlDQUNBRklBRkJmbkUyQWdRZ0F5QUFRUUZ5TmdJRUlBVWdBRFlDQUE4TFFRQWhBZ3NnQmtVTkFBSkFJQU1vQWh3aUFVRUNkRUhzSEdvaUJDZ0NBQ0FEUmdSQUlBUWdBallDQUNBQ0RRRkJ3QnBCd0Jvb0FnQkJmaUFCZDNFMkFnQU1BZ3NnQmtFUVFSUWdCaWdDRUNBRFJodHFJQUkyQWdBZ0FrVU5BUXNnQWlBR05nSVlJQU1vQWhBaUFRUkFJQUlnQVRZQ0VDQUJJQUkyQWhnTElBTW9BaFFpQVVVTkFDQUNJQUUyQWhRZ0FTQUNOZ0lZQ3lBRElBVlBEUUFnQlNnQ0JDSUJRUUZ4UlEwQUFrQUNRQUpBQWtBZ0FVRUNjVVVFUUVIVUdpZ0NBQ0FGUmdSQVFkUWFJQU0yQWdCQnlCcEJ5Qm9vQWdBZ0FHb2lBRFlDQUNBRElBQkJBWEkyQWdRZ0EwSFFHaWdDQUVjTkJrSEVHa0VBTmdJQVFkQWFRUUEyQWdBUEMwSFFHaWdDQUNBRlJnUkFRZEFhSUFNMkFnQkJ4QnBCeEJvb0FnQWdBR29pQURZQ0FDQURJQUJCQVhJMkFnUWdBQ0FEYWlBQU5nSUFEd3NnQVVGNGNTQUFhaUVBSUFVb0Fnd2hBaUFCUWY4QlRRUkFJQUZCQTNZaEFTQUZLQUlJSWdRZ0FrWUVRRUc4R2tHOEdpZ0NBRUYrSUFGM2NUWUNBQXdGQ3lBRUlBSTJBZ3dnQWlBRU5nSUlEQVFMSUFVb0FoZ2hCaUFDSUFWSEJFQkJ6Qm9vQWdBYUlBVW9BZ2dpQVNBQ05nSU1JQUlnQVRZQ0NBd0RDeUFGS0FJVUlnRUVmeUFGUVJScUJTQUZLQUlRSWdGRkRRSWdCVUVRYWdzaEJBTkFJQVFoQnlBQklnSkJGR29oQkNBQ0tBSVVJZ0VOQUNBQ1FSQnFJUVFnQWlnQ0VDSUJEUUFMSUFkQkFEWUNBQXdDQ3lBRklBRkJmbkUyQWdRZ0F5QUFRUUZ5TmdJRUlBQWdBMm9nQURZQ0FBd0RDMEVBSVFJTElBWkZEUUFDUUNBRktBSWNJZ0ZCQW5SQjdCeHFJZ1FvQWdBZ0JVWUVRQ0FFSUFJMkFnQWdBZzBCUWNBYVFjQWFLQUlBUVg0Z0FYZHhOZ0lBREFJTElBWkJFRUVVSUFZb0FoQWdCVVliYWlBQ05nSUFJQUpGRFFFTElBSWdCallDR0NBRktBSVFJZ0VFUUNBQ0lBRTJBaEFnQVNBQ05nSVlDeUFGS0FJVUlnRkZEUUFnQWlBQk5nSVVJQUVnQWpZQ0dBc2dBeUFBUVFGeU5nSUVJQUFnQTJvZ0FEWUNBQ0FEUWRBYUtBSUFSdzBBUWNRYUlBQTJBZ0FQQ3lBQVFmOEJUUVJBSUFCQmVIRkI1QnBxSVFFQ2YwRzhHaWdDQUNJRVFRRWdBRUVEZG5RaUFIRkZCRUJCdkJvZ0FDQUVjallDQUNBQkRBRUxJQUVvQWdnTElRQWdBU0FETmdJSUlBQWdBellDRENBRElBRTJBZ3dnQXlBQU5nSUlEd3RCSHlFQ0lBQkIvLy8vQjAwRVFDQUFRU1lnQUVFSWRtY2lBV3QyUVFGeElBRkJBWFJyUVQ1cUlRSUxJQU1nQWpZQ0hDQURRZ0EzQWhBZ0FrRUNkRUhzSEdvaEJ3Si9Ba0FDZjBIQUdpZ0NBQ0lCUVFFZ0FuUWlCSEZGQkVCQndCb2dBU0FFY2pZQ0FFRVlJUUlnQnlFRVFRZ01BUXNnQUVFWklBSkJBWFpyUVFBZ0FrRWZSeHQwSVFJZ0J5Z0NBQ0VFQTBBZ0JDSUJLQUlFUVhoeElBQkdEUUlnQWtFZGRpRUVJQUpCQVhRaEFpQUJJQVJCQkhGcVFSQnFJZ2NvQWdBaUJBMEFDMEVZSVFJZ0FTRUVRUWdMSVFBZ0F5SUJEQUVMSUFFb0FnZ2lCQ0FETmdJTVFRZ2hBaUFCUVFocUlRZEJHQ0VBUVFBTElRVWdCeUFETmdJQUlBSWdBMm9nQkRZQ0FDQURJQUUyQWd3Z0FDQURhaUFGTmdJQVFkd2FRZHdhS0FJQVFRRnJJZ0JCZnlBQUd6WUNBQXNMS1FFQmZ5QUJCRUFnQUNFQ0EwQWdBa0VBT2dBQUlBSkJBV29oQWlBQlFRRnJJZ0VOQUFzTElBQUxIQUFnQUNBQlFRZ2dBcWNnQWtJZ2lLY2dBNmNnQTBJZ2lLY1FCUXZlQXdCQjNCZEJpZ2tRQ1VIb0YwRzVDRUVCUVFBUUNFSDBGMEcwQ0VFQlFZQi9RZjhBRUFGQmpCaEJyUWhCQVVHQWYwSC9BQkFCUVlBWVFhc0lRUUZCQUVIL0FSQUJRWmdZUVlrSVFRSkJnSUIrUWYvL0FSQUJRYVFZUVlBSVFRSkJBRUgvL3dNUUFVR3dHRUdZQ0VFRVFZQ0FnSUI0UWYvLy8vOEhFQUZCdkJoQmp3aEJCRUVBUVg4UUFVSElHRUhIQ0VFRVFZQ0FnSUI0UWYvLy8vOEhFQUZCMUJoQnZnaEJCRUVBUVg4UUFVSGdHRUdqQ0VLQWdJQ0FnSUNBZ0lCL1F2Ly8vLy8vLy8vLy93QVFFVUhzR0VHaUNFSUFRbjhRRVVINEdFR2NDRUVFRUFSQmhCbEJnd2xCQ0JBRVFmUU9RZGtJRUFOQnZBOUJodzBRQTBHRUVFRUVRY3dJRUFKQjBCQkJBa0hsQ0JBQ1Fad1JRUVJCOUFnUUFrRzRFUkFIUWVBUlFRQkJ3Z3dRQUVHSUVrRUFRYWdORUFCQnNCSkJBVUhnREJBQVFkZ1NRUUpCandrUUFFR0FFMEVEUWE0SkVBQkJxQk5CQkVIV0NSQUFRZEFUUVFWQjh3a1FBRUg0RTBFRVFjME5FQUJCb0JSQkJVSHJEUkFBUVlnU1FRQkIyUW9RQUVHd0VrRUJRYmdLRUFCQjJCSkJBa0diQ3hBQVFZQVRRUU5CK1FvUUFFR29FMEVFUWFFTUVBQkIwQk5CQlVIL0N4QUFRY2dVUVFoQjNnc1FBRUh3RkVFSlFid0xFQUJCbUJWQkJrR1pDaEFBUWNBVlFRZEJrZzRRQUFzZ0FBSkFJQUFvQWdRZ0FVY05BQ0FBS0FJY1FRRkdEUUFnQUNBQ05nSWNDd3VhQVFBZ0FFRUJPZ0ExQWtBZ0FDZ0NCQ0FDUncwQUlBQkJBVG9BTkFKQUlBQW9BaEFpQWtVRVFDQUFRUUUyQWlRZ0FDQUROZ0lZSUFBZ0FUWUNFQ0FEUVFGSERRSWdBQ2dDTUVFQlJnMEJEQUlMSUFFZ0FrWUVRQ0FBS0FJWUlnSkJBa1lFUUNBQUlBTTJBaGdnQXlFQ0N5QUFLQUl3UVFGSERRSWdBa0VCUmcwQkRBSUxJQUFnQUNnQ0pFRUJhallDSkFzZ0FFRUJPZ0EyQ3d0ZEFRRi9JQUFvQWhBaUEwVUVRQ0FBUVFFMkFpUWdBQ0FDTmdJWUlBQWdBVFlDRUE4TEFrQWdBU0FEUmdSQUlBQW9BaGhCQWtjTkFTQUFJQUkyQWhnUEN5QUFRUUU2QURZZ0FFRUNOZ0lZSUFBZ0FDZ0NKRUVCYWpZQ0pBc0xCQUFnQUF2WEp3RU1meU1BUVJCcklnb2tBQUpBQWtBQ1FBSkFBa0FDUUFKQUFrQUNRQUpBSUFCQjlBRk5CRUJCdkJvb0FnQWlCRUVRSUFCQkMycEIrQU54SUFCQkMwa2JJZ1pCQTNZaUFIWWlBVUVEY1FSQUFrQWdBVUYvYzBFQmNTQUFhaUlDUVFOMElnRkI1QnBxSWdBZ0FVSHNHbW9vQWdBaUFTZ0NDQ0lGUmdSQVFid2FJQVJCZmlBQ2QzRTJBZ0FNQVFzZ0JTQUFOZ0lNSUFBZ0JUWUNDQXNnQVVFSWFpRUFJQUVnQWtFRGRDSUNRUU55TmdJRUlBRWdBbW9pQVNBQktBSUVRUUZ5TmdJRURBc0xJQVpCeEJvb0FnQWlDRTBOQVNBQkJFQUNRRUVDSUFCMElnSkJBQ0FDYTNJZ0FTQUFkSEZvSWdGQkEzUWlBRUhrR21vaUFpQUFRZXdhYWlnQ0FDSUFLQUlJSWdWR0JFQkJ2Qm9nQkVGK0lBRjNjU0lFTmdJQURBRUxJQVVnQWpZQ0RDQUNJQVUyQWdnTElBQWdCa0VEY2pZQ0JDQUFJQVpxSWdjZ0FVRURkQ0lCSUFacklnVkJBWEkyQWdRZ0FDQUJhaUFGTmdJQUlBZ0VRQ0FJUVhoeFFlUWFhaUVCUWRBYUtBSUFJUUlDZnlBRVFRRWdDRUVEZG5RaUEzRkZCRUJCdkJvZ0F5QUVjallDQUNBQkRBRUxJQUVvQWdnTElRTWdBU0FDTmdJSUlBTWdBallDRENBQ0lBRTJBZ3dnQWlBRE5nSUlDeUFBUVFocUlRQkIwQm9nQnpZQ0FFSEVHaUFGTmdJQURBc0xRY0FhS0FJQUlndEZEUUVnQzJoQkFuUkI3QnhxS0FJQUlnSW9BZ1JCZUhFZ0Jtc2hBeUFDSVFFRFFBSkFJQUVvQWhBaUFFVUVRQ0FCS0FJVUlnQkZEUUVMSUFBb0FnUkJlSEVnQm1zaUFTQURJQUVnQTBraUFSc2hBeUFBSUFJZ0FSc2hBaUFBSVFFTUFRc0xJQUlvQWhnaENTQUNJQUlvQWd3aUFFY0VRRUhNR2lnQ0FCb2dBaWdDQ0NJQklBQTJBZ3dnQUNBQk5nSUlEQW9MSUFJb0FoUWlBUVIvSUFKQkZHb0ZJQUlvQWhBaUFVVU5BeUFDUVJCcUN5RUZBMEFnQlNFSElBRWlBRUVVYWlFRklBQW9BaFFpQVEwQUlBQkJFR29oQlNBQUtBSVFJZ0VOQUFzZ0IwRUFOZ0lBREFrTFFYOGhCaUFBUWI5L1N3MEFJQUJCQzJvaUFFRjRjU0VHUWNBYUtBSUFJZ2RGRFFCQkFDQUdheUVEQWtBQ1FBSkFBbjlCQUNBR1FZQUNTUTBBR2tFZklBWkIvLy8vQjBzTkFCb2dCa0VtSUFCQkNIWm5JZ0JyZGtFQmNTQUFRUUYwYTBFK2Fnc2lDRUVDZEVIc0hHb29BZ0FpQVVVRVFFRUFJUUFNQVF0QkFDRUFJQVpCR1NBSVFRRjJhMEVBSUFoQkgwY2JkQ0VDQTBBQ1FDQUJLQUlFUVhoeElBWnJJZ1FnQTA4TkFDQUJJUVVnQkNJRERRQkJBQ0VESUFFaEFBd0RDeUFBSUFFb0FoUWlCQ0FFSUFFZ0FrRWRka0VFY1dvb0FoQWlBVVliSUFBZ0JCc2hBQ0FDUVFGMElRSWdBUTBBQ3dzZ0FDQUZja1VFUUVFQUlRVkJBaUFJZENJQVFRQWdBR3R5SUFkeElnQkZEUU1nQUdoQkFuUkI3QnhxS0FJQUlRQUxJQUJGRFFFTEEwQWdBQ2dDQkVGNGNTQUdheUlDSUFOSklRRWdBaUFESUFFYklRTWdBQ0FGSUFFYklRVWdBQ2dDRUNJQkJIOGdBUVVnQUNnQ0ZBc2lBQTBBQ3dzZ0JVVU5BQ0FEUWNRYUtBSUFJQVpyVHcwQUlBVW9BaGdoQ0NBRklBVW9BZ3dpQUVjRVFFSE1HaWdDQUJvZ0JTZ0NDQ0lCSUFBMkFnd2dBQ0FCTmdJSURBZ0xJQVVvQWhRaUFRUi9JQVZCRkdvRklBVW9BaEFpQVVVTkF5QUZRUkJxQ3lFQ0EwQWdBaUVFSUFFaUFFRVVhaUVDSUFBb0FoUWlBUTBBSUFCQkVHb2hBaUFBS0FJUUlnRU5BQXNnQkVFQU5nSUFEQWNMSUFaQnhCb29BZ0FpQlUwRVFFSFFHaWdDQUNFQUFrQWdCU0FHYXlJQlFSQlBCRUFnQUNBR2FpSUNJQUZCQVhJMkFnUWdBQ0FGYWlBQk5nSUFJQUFnQmtFRGNqWUNCQXdCQ3lBQUlBVkJBM0kyQWdRZ0FDQUZhaUlCSUFFb0FnUkJBWEkyQWdSQkFDRUNRUUFoQVF0QnhCb2dBVFlDQUVIUUdpQUNOZ0lBSUFCQkNHb2hBQXdKQ3lBR1FjZ2FLQUlBSWdKSkJFQkJ5Qm9nQWlBR2F5SUJOZ0lBUWRRYVFkUWFLQUlBSWdBZ0Jtb2lBallDQUNBQ0lBRkJBWEkyQWdRZ0FDQUdRUU55TmdJRUlBQkJDR29oQUF3SkMwRUFJUUFnQmtFdmFpSURBbjlCbEI0b0FnQUVRRUdjSGlnQ0FBd0JDMEdnSGtKL053SUFRWmdlUW9DZ2dJQ0FnQVEzQWdCQmxCNGdDa0VNYWtGd2NVSFlxdFdxQlhNMkFnQkJxQjVCQURZQ0FFSDRIVUVBTmdJQVFZQWdDeUlCYWlJRVFRQWdBV3NpQjNFaUFTQUdUUTBJUWZRZEtBSUFJZ1VFUUVIc0hTZ0NBQ0lJSUFGcUlna2dDRTBnQlNBSlNYSU5DUXNDUUVINEhTMEFBRUVFY1VVRVFBSkFBa0FDUUFKQVFkUWFLQUlBSWdVRVFFSDhIU0VBQTBBZ0JTQUFLQUlBSWdoUEJFQWdDQ0FBS0FJRWFpQUZTdzBEQ3lBQUtBSUlJZ0FOQUFzTFFRQVFDeUlDUVg5R0RRTWdBU0VFUVpnZUtBSUFJZ0JCQVdzaUJTQUNjUVJBSUFFZ0Ftc2dBaUFGYWtFQUlBQnJjV29oQkFzZ0JDQUdUUTBEUWZRZEtBSUFJZ0FFUUVIc0hTZ0NBQ0lGSUFScUlnY2dCVTBnQUNBSFNYSU5CQXNnQkJBTElnQWdBa2NOQVF3RkN5QUVJQUpySUFkeElnUVFDeUlDSUFBb0FnQWdBQ2dDQkdwR0RRRWdBaUVBQ3lBQVFYOUdEUUVnQmtFd2FpQUVUUVJBSUFBaEFnd0VDMEdjSGlnQ0FDSUNJQU1nQkd0cVFRQWdBbXR4SWdJUUMwRi9SZzBCSUFJZ0JHb2hCQ0FBSVFJTUF3c2dBa0YvUncwQ0MwSDRIVUg0SFNnQ0FFRUVjallDQUFzZ0FSQUxJZ0pCZjBaQkFCQUxJZ0JCZjBaeUlBQWdBazF5RFFVZ0FDQUNheUlFSUFaQktHcE5EUVVMUWV3ZFFld2RLQUlBSUFScUlnQTJBZ0JCOEIwb0FnQWdBRWtFUUVId0hTQUFOZ0lBQ3dKQVFkUWFLQUlBSWdNRVFFSDhIU0VBQTBBZ0FpQUFLQUlBSWdFZ0FDZ0NCQ0lGYWtZTkFpQUFLQUlJSWdBTkFBc01CQXRCekJvb0FnQWlBRUVBSUFBZ0FrMGJSUVJBUWN3YUlBSTJBZ0FMUVFBaEFFR0FIaUFFTmdJQVFmd2RJQUkyQWdCQjNCcEJmellDQUVIZ0drR1VIaWdDQURZQ0FFR0lIa0VBTmdJQUEwQWdBRUVEZENJQlFld2FhaUFCUWVRYWFpSUZOZ0lBSUFGQjhCcHFJQVUyQWdBZ0FFRUJhaUlBUVNCSERRQUxRY2dhSUFSQktHc2lBRUY0SUFKclFRZHhJZ0ZySWdVMkFnQkIxQm9nQVNBQ2FpSUJOZ0lBSUFFZ0JVRUJjallDQkNBQUlBSnFRU2cyQWdSQjJCcEJwQjRvQWdBMkFnQU1CQXNnQWlBRFRTQUJJQU5MY2cwQ0lBQW9BZ3hCQ0hFTkFpQUFJQVFnQldvMkFnUkIxQm9nQTBGNElBTnJRUWR4SWdCcUlnRTJBZ0JCeUJwQnlCb29BZ0FnQkdvaUFpQUFheUlBTmdJQUlBRWdBRUVCY2pZQ0JDQUNJQU5xUVNnMkFnUkIyQnBCcEI0b0FnQTJBZ0FNQXd0QkFDRUFEQVlMUVFBaEFBd0VDMEhNR2lnQ0FDQUNTd1JBUWN3YUlBSTJBZ0FMSUFJZ0JHb2hBVUg4SFNFQUFrQURRQ0FCSUFBb0FnQkhCRUFnQUNnQ0NDSUFEUUVNQWdzTElBQXRBQXhCQ0hGRkRRTUxRZndkSVFBRFFBSkFJQU1nQUNnQ0FDSUJUd1JBSUFFZ0FDZ0NCR29pQlNBRFN3MEJDeUFBS0FJSUlRQU1BUXNMUWNnYUlBUkJLR3NpQUVGNElBSnJRUWR4SWdGcklnYzJBZ0JCMUJvZ0FTQUNhaUlCTmdJQUlBRWdCMEVCY2pZQ0JDQUFJQUpxUVNnMkFnUkIyQnBCcEI0b0FnQTJBZ0FnQXlBRlFTY2dCV3RCQjNGcVFTOXJJZ0FnQUNBRFFSQnFTUnNpQVVFYk5nSUVJQUZCaEI0cEFnQTNBaEFnQVVIOEhTa0NBRGNDQ0VHRUhpQUJRUWhxTmdJQVFZQWVJQVEyQWdCQi9CMGdBallDQUVHSUhrRUFOZ0lBSUFGQkdHb2hBQU5BSUFCQkJ6WUNCQ0FBUVFocUlRd2dBRUVFYWlFQUlBd2dCVWtOQUFzZ0FTQURSZzBBSUFFZ0FTZ0NCRUYrY1RZQ0JDQURJQUVnQTJzaUFrRUJjallDQkNBQklBSTJBZ0FDZnlBQ1FmOEJUUVJBSUFKQmVIRkI1QnBxSVFBQ2YwRzhHaWdDQUNJQlFRRWdBa0VEZG5RaUFuRkZCRUJCdkJvZ0FTQUNjallDQUNBQURBRUxJQUFvQWdnTElRRWdBQ0FETmdJSUlBRWdBellDREVFTUlRSkJDQXdCQzBFZklRQWdBa0gvLy84SFRRUkFJQUpCSmlBQ1FRaDJaeUlBYTNaQkFYRWdBRUVCZEd0QlBtb2hBQXNnQXlBQU5nSWNJQU5DQURjQ0VDQUFRUUowUWV3Y2FpRUJBa0FDUUVIQUdpZ0NBQ0lGUVFFZ0FIUWlCSEZGQkVCQndCb2dCQ0FGY2pZQ0FDQUJJQU0yQWdBTUFRc2dBa0VaSUFCQkFYWnJRUUFnQUVFZlJ4dDBJUUFnQVNnQ0FDRUZBMEFnQlNJQktBSUVRWGh4SUFKR0RRSWdBRUVkZGlFRklBQkJBWFFoQUNBQklBVkJCSEZxSWdRb0FoQWlCUTBBQ3lBRUlBTTJBaEFMSUFNZ0FUWUNHRUVJSVFJZ0F5SUJJUUJCREF3QkN5QUJLQUlJSWdBZ0F6WUNEQ0FCSUFNMkFnZ2dBeUFBTmdJSVFRQWhBRUVZSVFKQkRBc2dBMm9nQVRZQ0FDQUNJQU5xSUFBMkFnQUxRY2dhS0FJQUlnQWdCazBOQUVISUdpQUFJQVpySWdFMkFnQkIxQnBCMUJvb0FnQWlBQ0FHYWlJQ05nSUFJQUlnQVVFQmNqWUNCQ0FBSUFaQkEzSTJBZ1FnQUVFSWFpRUFEQVFMUWJnYVFUQTJBZ0JCQUNFQURBTUxJQUFnQWpZQ0FDQUFJQUFvQWdRZ0JHbzJBZ1FnQWtGNElBSnJRUWR4YWlJSUlBWkJBM0kyQWdRZ0FVRjRJQUZyUVFkeGFpSUVJQVlnQ0dvaUEyc2hCd0pBUWRRYUtBSUFJQVJHQkVCQjFCb2dBellDQUVISUdrSElHaWdDQUNBSGFpSUFOZ0lBSUFNZ0FFRUJjallDQkF3QkMwSFFHaWdDQUNBRVJnUkFRZEFhSUFNMkFnQkJ4QnBCeEJvb0FnQWdCMm9pQURZQ0FDQURJQUJCQVhJMkFnUWdBQ0FEYWlBQU5nSUFEQUVMSUFRb0FnUWlBRUVEY1VFQlJnUkFJQUJCZUhFaENTQUVLQUlNSVFJQ1FDQUFRZjhCVFFSQUlBUW9BZ2dpQVNBQ1JnUkFRYndhUWJ3YUtBSUFRWDRnQUVFRGRuZHhOZ0lBREFJTElBRWdBallDRENBQ0lBRTJBZ2dNQVFzZ0JDZ0NHQ0VHQWtBZ0FpQUVSd1JBUWN3YUtBSUFHaUFFS0FJSUlnQWdBallDRENBQ0lBQTJBZ2dNQVFzQ1FDQUVLQUlVSWdBRWZ5QUVRUlJxQlNBRUtBSVFJZ0JGRFFFZ0JFRVFhZ3NoQVFOQUlBRWhCU0FBSWdKQkZHb2hBU0FBS0FJVUlnQU5BQ0FDUVJCcUlRRWdBaWdDRUNJQURRQUxJQVZCQURZQ0FBd0JDMEVBSVFJTElBWkZEUUFDUUNBRUtBSWNJZ0JCQW5SQjdCeHFJZ0VvQWdBZ0JFWUVRQ0FCSUFJMkFnQWdBZzBCUWNBYVFjQWFLQUlBUVg0Z0FIZHhOZ0lBREFJTElBWkJFRUVVSUFZb0FoQWdCRVliYWlBQ05nSUFJQUpGRFFFTElBSWdCallDR0NBRUtBSVFJZ0FFUUNBQ0lBQTJBaEFnQUNBQ05nSVlDeUFFS0FJVUlnQkZEUUFnQWlBQU5nSVVJQUFnQWpZQ0dBc2dCeUFKYWlFSElBUWdDV29pQkNnQ0JDRUFDeUFFSUFCQmZuRTJBZ1FnQXlBSFFRRnlOZ0lFSUFNZ0Iyb2dCellDQUNBSFFmOEJUUVJBSUFkQmVIRkI1QnBxSVFBQ2YwRzhHaWdDQUNJQlFRRWdCMEVEZG5RaUFuRkZCRUJCdkJvZ0FTQUNjallDQUNBQURBRUxJQUFvQWdnTElRRWdBQ0FETmdJSUlBRWdBellDRENBRElBQTJBZ3dnQXlBQk5nSUlEQUVMUVI4aEFpQUhRZi8vL3dkTkJFQWdCMEVtSUFkQkNIWm5JZ0JyZGtFQmNTQUFRUUYwYTBFK2FpRUNDeUFESUFJMkFod2dBMElBTndJUUlBSkJBblJCN0J4cUlRQUNRQUpBUWNBYUtBSUFJZ0ZCQVNBQ2RDSUZjVVVFUUVIQUdpQUJJQVZ5TmdJQUlBQWdBellDQUF3QkN5QUhRUmtnQWtFQmRtdEJBQ0FDUVI5SEczUWhBaUFBS0FJQUlRRURRQ0FCSWdBb0FnUkJlSEVnQjBZTkFpQUNRUjEySVFFZ0FrRUJkQ0VDSUFBZ0FVRUVjV29pQlNnQ0VDSUJEUUFMSUFVZ0F6WUNFQXNnQXlBQU5nSVlJQU1nQXpZQ0RDQURJQU0yQWdnTUFRc2dBQ2dDQ0NJQklBTTJBZ3dnQUNBRE5nSUlJQU5CQURZQ0dDQURJQUEyQWd3Z0F5QUJOZ0lJQ3lBSVFRaHFJUUFNQWdzQ1FDQUlSUTBBQWtBZ0JTZ0NIQ0lCUVFKMFFld2NhaUlDS0FJQUlBVkdCRUFnQWlBQU5nSUFJQUFOQVVIQUdpQUhRWDRnQVhkeElnYzJBZ0FNQWdzZ0NFRVFRUlFnQ0NnQ0VDQUZSaHRxSUFBMkFnQWdBRVVOQVFzZ0FDQUlOZ0lZSUFVb0FoQWlBUVJBSUFBZ0FUWUNFQ0FCSUFBMkFoZ0xJQVVvQWhRaUFVVU5BQ0FBSUFFMkFoUWdBU0FBTmdJWUN3SkFJQU5CRDAwRVFDQUZJQU1nQm1vaUFFRURjallDQkNBQUlBVnFJZ0FnQUNnQ0JFRUJjallDQkF3QkN5QUZJQVpCQTNJMkFnUWdCU0FHYWlJRUlBTkJBWEkyQWdRZ0F5QUVhaUFETmdJQUlBTkIvd0ZOQkVBZ0EwRjRjVUhrR21vaEFBSi9RYndhS0FJQUlnRkJBU0FEUVFOMmRDSUNjVVVFUUVHOEdpQUJJQUp5TmdJQUlBQU1BUXNnQUNnQ0NBc2hBU0FBSUFRMkFnZ2dBU0FFTmdJTUlBUWdBRFlDRENBRUlBRTJBZ2dNQVF0Qkh5RUFJQU5CLy8vL0IwMEVRQ0FEUVNZZ0EwRUlkbWNpQUd0MlFRRnhJQUJCQVhSclFUNXFJUUFMSUFRZ0FEWUNIQ0FFUWdBM0FoQWdBRUVDZEVIc0hHb2hBUUpBQWtBZ0IwRUJJQUIwSWdKeFJRUkFRY0FhSUFJZ0IzSTJBZ0FnQVNBRU5nSUFJQVFnQVRZQ0dBd0JDeUFEUVJrZ0FFRUJkbXRCQUNBQVFSOUhHM1FoQUNBQktBSUFJUUVEUUNBQklnSW9BZ1JCZUhFZ0EwWU5BaUFBUVIxMklRRWdBRUVCZENFQUlBSWdBVUVFY1dvaUJ5Z0NFQ0lCRFFBTElBY2dCRFlDRUNBRUlBSTJBaGdMSUFRZ0JEWUNEQ0FFSUFRMkFnZ01BUXNnQWlnQ0NDSUFJQVEyQWd3Z0FpQUVOZ0lJSUFSQkFEWUNHQ0FFSUFJMkFnd2dCQ0FBTmdJSUN5QUZRUWhxSVFBTUFRc0NRQ0FKUlEwQUFrQWdBaWdDSENJQlFRSjBRZXdjYWlJRktBSUFJQUpHQkVBZ0JTQUFOZ0lBSUFBTkFVSEFHaUFMUVg0Z0FYZHhOZ0lBREFJTElBbEJFRUVVSUFrb0FoQWdBa1liYWlBQU5nSUFJQUJGRFFFTElBQWdDVFlDR0NBQ0tBSVFJZ0VFUUNBQUlBRTJBaEFnQVNBQU5nSVlDeUFDS0FJVUlnRkZEUUFnQUNBQk5nSVVJQUVnQURZQ0dBc0NRQ0FEUVE5TkJFQWdBaUFESUFacUlnQkJBM0kyQWdRZ0FDQUNhaUlBSUFBb0FnUkJBWEkyQWdRTUFRc2dBaUFHUVFOeU5nSUVJQUlnQm1vaUJTQURRUUZ5TmdJRUlBTWdCV29nQXpZQ0FDQUlCRUFnQ0VGNGNVSGtHbW9oQUVIUUdpZ0NBQ0VCQW45QkFTQUlRUU4yZENJSElBUnhSUVJBUWJ3YUlBUWdCM0kyQWdBZ0FBd0JDeUFBS0FJSUN5RUVJQUFnQVRZQ0NDQUVJQUUyQWd3Z0FTQUFOZ0lNSUFFZ0JEWUNDQXRCMEJvZ0JUWUNBRUhFR2lBRE5nSUFDeUFDUVFocUlRQUxJQXBCRUdva0FDQUFDeG9BSUFBZ0FTZ0NDQ0FGRUFvRVFDQUJJQUlnQXlBRUVCUUxDemNBSUFBZ0FTZ0NDQ0FGRUFvRVFDQUJJQUlnQXlBRUVCUVBDeUFBS0FJSUlnQWdBU0FDSUFNZ0JDQUZJQUFvQWdBb0FoUVJBd0FMa1FFQUlBQWdBU2dDQ0NBRUVBb0VRQ0FCSUFJZ0F4QVREd3NDUUNBQUlBRW9BZ0FnQkJBS1JRMEFBa0FnQWlBQktBSVFSd1JBSUFFb0FoUWdBa2NOQVFzZ0EwRUJSdzBCSUFGQkFUWUNJQThMSUFFZ0FqWUNGQ0FCSUFNMkFpQWdBU0FCS0FJb1FRRnFOZ0lvQWtBZ0FTZ0NKRUVCUncwQUlBRW9BaGhCQWtjTkFDQUJRUUU2QURZTElBRkJCRFlDTEFzTDhnRUFJQUFnQVNnQ0NDQUVFQW9FUUNBQklBSWdBeEFURHdzQ1FDQUFJQUVvQWdBZ0JCQUtCRUFDUUNBQ0lBRW9BaEJIQkVBZ0FTZ0NGQ0FDUncwQkN5QURRUUZIRFFJZ0FVRUJOZ0lnRHdzZ0FTQUROZ0lnQWtBZ0FTZ0NMRUVFUmcwQUlBRkJBRHNCTkNBQUtBSUlJZ0FnQVNBQ0lBSkJBU0FFSUFBb0FnQW9BaFFSQXdBZ0FTMEFOUVJBSUFGQkF6WUNMQ0FCTFFBMFJRMEJEQU1MSUFGQkJEWUNMQXNnQVNBQ05nSVVJQUVnQVNnQ0tFRUJhallDS0NBQktBSWtRUUZIRFFFZ0FTZ0NHRUVDUncwQklBRkJBVG9BTmc4TElBQW9BZ2dpQUNBQklBSWdBeUFFSUFBb0FnQW9BaGdSQWdBTEN6RUFJQUFnQVNnQ0NFRUFFQW9FUUNBQklBSWdBeEFWRHdzZ0FDZ0NDQ0lBSUFFZ0FpQURJQUFvQWdBb0Fod1JBQUFMR0FBZ0FDQUJLQUlJUVFBUUNnUkFJQUVnQWlBREVCVUxDNEFEQVFSL0l3QkI4QUJySWdJa0FDQUFLQUlBSWdOQkJHc29BZ0FoQkNBRFFRaHJLQUlBSVFVZ0FrSUFOd0pRSUFKQ0FEY0NXQ0FDUWdBM0FtQWdBa0lBTndCbklBSkNBRGNDU0NBQ1FRQTJBa1FnQWtIc0ZUWUNRQ0FDSUFBMkFqd2dBaUFCTmdJNElBQWdCV29oQXdKQUlBUWdBVUVBRUFvRVFFRUFJQU1nQlJzaEFBd0JDeUFBSUFOT0JFQWdBa0lBTndBdklBSkNBRGNDR0NBQ1FnQTNBaUFnQWtJQU53SW9JQUpDQURjQ0VDQUNRUUEyQWd3Z0FpQUJOZ0lJSUFJZ0FEWUNCQ0FDSUFRMkFnQWdBa0VCTmdJd0lBUWdBaUFESUFOQkFVRUFJQVFvQWdBb0FoUVJBd0FnQWlnQ0dBMEJDMEVBSVFBZ0JDQUNRVGhxSUFOQkFVRUFJQVFvQWdBb0FoZ1JBZ0FDUUFKQUlBSW9BbHdPQWdBQkFnc2dBaWdDVEVFQUlBSW9BbGhCQVVZYlFRQWdBaWdDVkVFQlJodEJBQ0FDS0FKZ1FRRkdHeUVBREFFTElBSW9BbEJCQVVjRVFDQUNLQUpnRFFFZ0FpZ0NWRUVCUncwQklBSW9BbGhCQVVjTkFRc2dBaWdDU0NFQUN5QUNRZkFBYWlRQUlBQUxtZ0VCQW44akFFRkFhaUlESkFBQ2YwRUJJQUFnQVVFQUVBb05BQnBCQUNBQlJRMEFHa0VBSUFGQm5CWVFIaUlCUlEwQUdpQURRUXhxUVRRUUVCb2dBMEVCTmdJNElBTkJmellDRkNBRElBQTJBaEFnQXlBQk5nSUlJQUVnQTBFSWFpQUNLQUlBUVFFZ0FTZ0NBQ2dDSEJFQUFDQURLQUlnSWdCQkFVWUVRQ0FDSUFNb0FoZzJBZ0FMSUFCQkFVWUxJUVFnQTBGQWF5UUFJQVFMQ2dBZ0FDQUJRUUFRQ2d1QUNnSUlmeUo5UWYvLy8vOEhJUTVCZ0lDQWdIZ2hEMEYvSVFvRFFDQURJQXhHQkVCQkFDRUFJQWxCZ0lBUUVCQWhBVU1BLzM5SElBOGdEbXV5bFNFZEEwQWdBQ0FEUmdSQVFRQWhBQ0FJUVFBMkFnQWdBVUVFYXlFQlFRQWhERUVCSVFzRFFDQUxRWUNBQkVaRkJFQWdDQ0FMUVFKMElnSnFJQUVnQW1vb0FnQWdER29pRERZQ0FDQUxRUUZxSVFzTUFRc0xBMEFnQUNBRFJrVUVRQ0FJSUFZZ0FFRUNkR29vQWdCQkFuUnFJZ0VnQVNnQ0FDSUJRUUZxTmdJQUlBY2dBVUVDZEdvZ0FEWUNBQ0FBUVFGcUlRQU1BUXNMQlFKL0lCMGdCaUFBUVFKMGFpSUNLQUlBSUE1cnM1UWlFa01BQUlCUFhTQVNRd0FBQUFCZ2NRUkFJQktwREFFTFFRQUxJUXNnQWlBTE5nSUFJQUVnQzBFQ2RHb2lBaUFDS0FJQVFRRnFOZ0lBSUFCQkFXb2hBQXdCQ3dzRklBUWdERUVNYkdvaUN5b0NBQ0VTSUFzcUFnZ2hIU0FMS2dJRUlTRWdDaUFDSUF4QkFuUWlEV29vQWdBaUMwY0VRQ0FCSUF0QjBBQnNhaUlLS2dJOEloUWdBQ29DUENJVmxDQUtLZ0k0SWhZZ0FDb0NMQ0lZbENBS0tnSXdJaGtnQUNvQ0RDSWFsQ0FBS2dJY0loNGdDaW9DTkNJVGxKS1NraUVwSUJRZ0FDb0NPQ0lmbENBV0lBQXFBaWdpSUpRZ0dTQUFLZ0lJSWlLVUlBQXFBaGdpSXlBVGxKS1NraUVxSUJRZ0FDb0NOQ0lrbENBV0lBQXFBaVFpSlpRZ0dTQUFLZ0lFSWlhVUlBQXFBaFFpSnlBVGxKS1NraUVySUJRZ0FDb0NNQ0lVbENBV0lBQXFBaUFpRnBRZ0dTQUFLZ0lBSWhtVUlBQXFBaEFpS0NBVGxKS1NraUVzSUFvcUFpd2lFeUFWbENBS0tnSW9JaGNnR0pRZ0Npb0NJQ0liSUJxVUlCNGdDaW9DSkNJY2xKS1NraUV0SUJNZ0g1UWdGeUFnbENBYklDS1VJQ01nSEpTU2twSWhMaUFUSUNTVUlCY2dKWlFnR3lBbWxDQW5JQnlVa3BLU0lTOGdFeUFVbENBWElCYVVJQnNnR1pRZ0tDQWNsSktTa2lFd0lBb3FBaHdpRXlBVmxDQUtLZ0lZSWhjZ0dKUWdDaW9DRUNJYklCcVVJQjRnQ2lvQ0ZDSWNsSktTa2lFeElCTWdINVFnRnlBZ2xDQWJJQ0tVSUNNZ0hKU1NrcEloTWlBVElDU1VJQmNnSlpRZ0d5QW1sQ0FuSUJ5VWtwS1NJVE1nRXlBVWxDQVhJQmFVSUJzZ0daUWdLQ0FjbEpLU2tpRVhJQW9xQWd3aUV5QVZsQ0FLS2dJSUloVWdHSlFnQ2lvQ0FDSVlJQnFVSUFvcUFnUWlHaUFlbEpLU2tpRWVJQk1nSDVRZ0ZTQWdsQ0FZSUNLVUlCb2dJNVNTa3BJaEh5QVRJQ1NVSUJVZ0paUWdHQ0FtbENBYUlDZVVrcEtTSVNBZ0V5QVVsQ0FWSUJhVUlCZ2dHWlFnR2lBb2xKS1NraUVXSUFzaENnc2dCaUFOYWdKL0lDNGdIWlFnSHlBU2xDQWhJREtVa3BJZ0twSkRBQUNBUlpRaUZJdERBQUFBVDEwRVFDQVVxQXdCQzBHQWdJQ0FlQXNpQ3pZQ0FDQUxJQTVLSVJBZ0N5QVBTQ0VSUWY4QklRMENRQ0F0SUIyVUlCNGdFcFFnSVNBeGxKS1NJQ21TSWhSREFBQUFBRnNOQUNBd0lCMlVJQllnRXBRZ0lTQVhsSktTSUN5U0lCU1ZRd0FBZ0QrU1F3QUFBRCtVSWhWREFBQUFBR0JGSUJWREFBQ0FQMTFGY2cwQUlDOGdIWlFnSUNBU2xDQWhJRE9Va3BJZ0s1SWdGSlZEQUFDQVA1SkRBQUFBUDVRaUVrTUFBQUFBWUVVZ0VrTUFBSUEvWFVWeURRQUNmeUFTUXdBQWNFR1VJaEpEQUFDQVQxMGdFa01BQUFBQVlIRUVRQ0FTcVF3QkMwRUFDMEVQYkNFTkFuOGdGVU1BQUhCQmxDSVNRd0FBZ0U5ZElCSkRBQUFBQUdCeEJFQWdFcWtNQVF0QkFBc2dEV29oRFFzZ0RpQUxJQkFiSVE0Z0R5QUxJQkViSVE4Z0JTQU1haUFOT2dBQUlBeEJBV29oREF3QkN3c0xDN2NTQWdCQmdBZ0xwaEoxYm5OcFoyNWxaQ0J6YUc5eWRBQjFibk5wWjI1bFpDQnBiblFBWm14dllYUUFkV2x1ZERZMFgzUUFkVzV6YVdkdVpXUWdZMmhoY2dCaWIyOXNBSFZ1YzJsbmJtVmtJR3h2Ym1jQWMzUmtPanAzYzNSeWFXNW5BSE4wWkRvNmMzUnlhVzVuQUhOMFpEbzZkVEUyYzNSeWFXNW5BSE4wWkRvNmRUTXljM1J5YVc1bkFHUnZkV0pzWlFCMmIybGtBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BITm9iM0owUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYm5OcFoyNWxaQ0J6YUc5eWRENEFaVzF6WTNKcGNIUmxiam82YldWdGIzSjVYM1pwWlhjOGFXNTBQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eDFibk5wWjI1bFpDQnBiblErQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQR1pzYjJGMFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4MWFXNTBPRjkwUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkenhwYm5RNFgzUStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BIVnBiblF4Tmw5MFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4cGJuUXhObDkwUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYVc1ME5qUmZkRDRBWlcxelkzSnBjSFJsYmpvNmJXVnRiM0o1WDNacFpYYzhhVzUwTmpSZmRENEFaVzF6WTNKcGNIUmxiam82YldWdGIzSjVYM1pwWlhjOGRXbHVkRE15WDNRK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEdsdWRETXlYM1ErQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQR05vWVhJK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEhWdWMybG5ibVZrSUdOb1lYSStBSE4wWkRvNlltRnphV05mYzNSeWFXNW5QSFZ1YzJsbmJtVmtJR05vWVhJK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEhOcFoyNWxaQ0JqYUdGeVBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4c2IyNW5QZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eDFibk5wWjI1bFpDQnNiMjVuUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkenhrYjNWaWJHVStBRTVUZEROZlh6SXhNbUpoYzJsalgzTjBjbWx1WjBsalRsTmZNVEZqYUdGeVgzUnlZV2wwYzBsalJVVk9VMTg1WVd4c2IyTmhkRzl5U1dORlJVVkZBQUFBQUpRTUFBQXlCd0FBVGxOME0xOWZNakV5WW1GemFXTmZjM1J5YVc1blNXaE9VMTh4TVdOb1lYSmZkSEpoYVhSelNXaEZSVTVUWHpsaGJHeHZZMkYwYjNKSmFFVkZSVVVBQUpRTUFBQjhCd0FBVGxOME0xOWZNakV5WW1GemFXTmZjM1J5YVc1blNYZE9VMTh4TVdOb1lYSmZkSEpoYVhSelNYZEZSVTVUWHpsaGJHeHZZMkYwYjNKSmQwVkZSVVVBQUpRTUFBREVCd0FBVGxOME0xOWZNakV5WW1GemFXTmZjM1J5YVc1blNVUnpUbE5mTVRGamFHRnlYM1J5WVdsMGMwbEVjMFZGVGxOZk9XRnNiRzlqWVhSdmNrbEVjMFZGUlVVQUFBQ1VEQUFBREFnQUFFNVRkRE5mWHpJeE1tSmhjMmxqWDNOMGNtbHVaMGxFYVU1VFh6RXhZMmhoY2w5MGNtRnBkSE5KUkdsRlJVNVRYemxoYkd4dlkyRjBiM0pKUkdsRlJVVkZBQUFBbEF3QUFGZ0lBQUJPTVRCbGJYTmpjbWx3ZEdWdU0zWmhiRVVBQUpRTUFBQ2tDQUFBVGpFd1pXMXpZM0pwY0hSbGJqRXhiV1Z0YjNKNVgzWnBaWGRKWTBWRkFBQ1VEQUFBd0FnQUFFNHhNR1Z0YzJOeWFYQjBaVzR4TVcxbGJXOXllVjkyYVdWM1NXRkZSUUFBbEF3QUFPZ0lBQUJPTVRCbGJYTmpjbWx3ZEdWdU1URnRaVzF2Y25sZmRtbGxkMGxvUlVVQUFKUU1BQUFRQ1FBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSmMwVkZBQUNVREFBQU9Ba0FBRTR4TUdWdGMyTnlhWEIwWlc0eE1XMWxiVzl5ZVY5MmFXVjNTWFJGUlFBQWxBd0FBR0FKQUFCT01UQmxiWE5qY21sd2RHVnVNVEZ0WlcxdmNubGZkbWxsZDBscFJVVUFBSlFNQUFDSUNRQUFUakV3WlcxelkzSnBjSFJsYmpFeGJXVnRiM0o1WDNacFpYZEpha1ZGQUFDVURBQUFzQWtBQUU0eE1HVnRjMk55YVhCMFpXNHhNVzFsYlc5eWVWOTJhV1YzU1d4RlJRQUFsQXdBQU5nSkFBQk9NVEJsYlhOamNtbHdkR1Z1TVRGdFpXMXZjbmxmZG1sbGQwbHRSVVVBQUpRTUFBQUFDZ0FBVGpFd1pXMXpZM0pwY0hSbGJqRXhiV1Z0YjNKNVgzWnBaWGRKZUVWRkFBQ1VEQUFBS0FvQUFFNHhNR1Z0YzJOeWFYQjBaVzR4TVcxbGJXOXllVjkyYVdWM1NYbEZSUUFBbEF3QUFGQUtBQUJPTVRCbGJYTmpjbWx3ZEdWdU1URnRaVzF2Y25sZmRtbGxkMGxtUlVVQUFKUU1BQUI0Q2dBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSlpFVkZBQUNVREFBQW9Bb0FBRTR4TUY5ZlkzaDRZV0pwZGpFeE5sOWZjMmhwYlY5MGVYQmxYMmx1Wm05RkFBQUFBTHdNQUFESUNnQUFJQTBBQUU0eE1GOWZZM2g0WVdKcGRqRXhOMTlmWTJ4aGMzTmZkSGx3WlY5cGJtWnZSUUFBQUx3TUFBRDRDZ0FBN0FvQUFFNHhNRjlmWTNoNFlXSnBkakV4TjE5ZmNHSmhjMlZmZEhsd1pWOXBibVp2UlFBQUFMd01BQUFvQ3dBQTdBb0FBRTR4TUY5ZlkzaDRZV0pwZGpFeE9WOWZjRzlwYm5SbGNsOTBlWEJsWDJsdVptOUZBTHdNQUFCWUN3QUFUQXNBQUFBQUFBRE1Dd0FBQWdBQUFBTUFBQUFFQUFBQUJRQUFBQVlBQUFCT01UQmZYMk40ZUdGaWFYWXhNak5mWDJaMWJtUmhiV1Z1ZEdGc1gzUjVjR1ZmYVc1bWIwVUF2QXdBQUtRTEFBRHNDZ0FBZGdBQUFKQUxBQURZQ3dBQVlnQUFBSkFMQUFEa0N3QUFZd0FBQUpBTEFBRHdDd0FBYUFBQUFKQUxBQUQ4Q3dBQVlRQUFBSkFMQUFBSURBQUFjd0FBQUpBTEFBQVVEQUFBZEFBQUFKQUxBQUFnREFBQWFRQUFBSkFMQUFBc0RBQUFhZ0FBQUpBTEFBQTREQUFBYkFBQUFKQUxBQUJFREFBQWJRQUFBSkFMQUFCUURBQUFlQUFBQUpBTEFBQmNEQUFBZVFBQUFKQUxBQUJvREFBQVpnQUFBSkFMQUFCMERBQUFaQUFBQUpBTEFBQ0FEQUFBQUFBQUFCd0xBQUFDQUFBQUJ3QUFBQVFBQUFBRkFBQUFDQUFBQUFrQUFBQUtBQUFBQ3dBQUFBQUFBQUFFRFFBQUFnQUFBQXdBQUFBRUFBQUFCUUFBQUFnQUFBQU5BQUFBRGdBQUFBOEFBQUJPTVRCZlgyTjRlR0ZpYVhZeE1qQmZYM05wWDJOc1lYTnpYM1I1Y0dWZmFXNW1iMFVBQUFBQXZBd0FBTndNQUFBY0N3QUFVM1E1ZEhsd1pWOXBibVp2QUFBQUFKUU1BQUFRRFFCQnFCb0xBekFQQVE9PSI7aWYoIWlzRGF0YVVSSSh3YXNtQmluYXJ5RmlsZSkpe3dhc21CaW5hcnlGaWxlPWxvY2F0ZUZpbGUod2FzbUJpbmFyeUZpbGUpO31mdW5jdGlvbiBnZXRCaW5hcnlTeW5jKGZpbGUpe2lmKGZpbGU9PXdhc21CaW5hcnlGaWxlJiZ3YXNtQmluYXJ5KXtyZXR1cm4gbmV3IFVpbnQ4QXJyYXkod2FzbUJpbmFyeSl9dmFyIGJpbmFyeT10cnlQYXJzZUFzRGF0YVVSSShmaWxlKTtpZihiaW5hcnkpe3JldHVybiBiaW5hcnl9aWYocmVhZEJpbmFyeSl7cmV0dXJuIHJlYWRCaW5hcnkoZmlsZSl9dGhyb3cgImJvdGggYXN5bmMgYW5kIHN5bmMgZmV0Y2hpbmcgb2YgdGhlIHdhc20gZmFpbGVkIn1mdW5jdGlvbiBnZXRCaW5hcnlQcm9taXNlKGJpbmFyeUZpbGUpe3JldHVybiBQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5nZXRCaW5hcnlTeW5jKGJpbmFyeUZpbGUpKX1mdW5jdGlvbiBpbnN0YW50aWF0ZUFycmF5QnVmZmVyKGJpbmFyeUZpbGUsaW1wb3J0cyxyZWNlaXZlcil7cmV0dXJuIGdldEJpbmFyeVByb21pc2UoYmluYXJ5RmlsZSkudGhlbihiaW5hcnk9PldlYkFzc2VtYmx5Lmluc3RhbnRpYXRlKGJpbmFyeSxpbXBvcnRzKSkudGhlbihyZWNlaXZlcixyZWFzb249PntlcnIoYGZhaWxlZCB0byBhc3luY2hyb25vdXNseSBwcmVwYXJlIHdhc206ICR7cmVhc29ufWApO2Fib3J0KHJlYXNvbik7fSl9ZnVuY3Rpb24gaW5zdGFudGlhdGVBc3luYyhiaW5hcnksYmluYXJ5RmlsZSxpbXBvcnRzLGNhbGxiYWNrKXtyZXR1cm4gaW5zdGFudGlhdGVBcnJheUJ1ZmZlcihiaW5hcnlGaWxlLGltcG9ydHMsY2FsbGJhY2spfWZ1bmN0aW9uIGNyZWF0ZVdhc20oKXt2YXIgaW5mbz17ImEiOndhc21JbXBvcnRzfTtmdW5jdGlvbiByZWNlaXZlSW5zdGFuY2UoaW5zdGFuY2UsbW9kdWxlKXt3YXNtRXhwb3J0cz1pbnN0YW5jZS5leHBvcnRzO3dhc21NZW1vcnk9d2FzbUV4cG9ydHNbImsiXTt1cGRhdGVNZW1vcnlWaWV3cygpO2FkZE9uSW5pdCh3YXNtRXhwb3J0c1sibCJdKTtyZW1vdmVSdW5EZXBlbmRlbmN5KCk7cmV0dXJuIHdhc21FeHBvcnRzfWFkZFJ1bkRlcGVuZGVuY3koKTtmdW5jdGlvbiByZWNlaXZlSW5zdGFudGlhdGlvblJlc3VsdChyZXN1bHQpe3JlY2VpdmVJbnN0YW5jZShyZXN1bHRbImluc3RhbmNlIl0pO31pZihNb2R1bGVbImluc3RhbnRpYXRlV2FzbSJdKXt0cnl7cmV0dXJuIE1vZHVsZVsiaW5zdGFudGlhdGVXYXNtIl0oaW5mbyxyZWNlaXZlSW5zdGFuY2UpfWNhdGNoKGUpe2VycihgTW9kdWxlLmluc3RhbnRpYXRlV2FzbSBjYWxsYmFjayBmYWlsZWQgd2l0aCBlcnJvcjogJHtlfWApO3JlYWR5UHJvbWlzZVJlamVjdChlKTt9fWluc3RhbnRpYXRlQXN5bmMod2FzbUJpbmFyeSx3YXNtQmluYXJ5RmlsZSxpbmZvLHJlY2VpdmVJbnN0YW50aWF0aW9uUmVzdWx0KS5jYXRjaChyZWFkeVByb21pc2VSZWplY3QpO3JldHVybiB7fX12YXIgY2FsbFJ1bnRpbWVDYWxsYmFja3M9Y2FsbGJhY2tzPT57d2hpbGUoY2FsbGJhY2tzLmxlbmd0aD4wKXtjYWxsYmFja3Muc2hpZnQoKShNb2R1bGUpO319O01vZHVsZVsibm9FeGl0UnVudGltZSJdfHx0cnVlO3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9iaWdpbnQ9KHByaW1pdGl2ZVR5cGUsbmFtZSxzaXplLG1pblJhbmdlLG1heFJhbmdlKT0+e307dmFyIGVtYmluZF9pbml0X2NoYXJDb2Rlcz0oKT0+e3ZhciBjb2Rlcz1uZXcgQXJyYXkoMjU2KTtmb3IodmFyIGk9MDtpPDI1NjsrK2kpe2NvZGVzW2ldPVN0cmluZy5mcm9tQ2hhckNvZGUoaSk7fWVtYmluZF9jaGFyQ29kZXM9Y29kZXM7fTt2YXIgZW1iaW5kX2NoYXJDb2Rlczt2YXIgcmVhZExhdGluMVN0cmluZz1wdHI9Pnt2YXIgcmV0PSIiO3ZhciBjPXB0cjt3aGlsZShIRUFQVThbY10pe3JldCs9ZW1iaW5kX2NoYXJDb2Rlc1tIRUFQVThbYysrXV07fXJldHVybiByZXR9O3ZhciBhd2FpdGluZ0RlcGVuZGVuY2llcz17fTt2YXIgcmVnaXN0ZXJlZFR5cGVzPXt9O3ZhciBCaW5kaW5nRXJyb3I7dmFyIHRocm93QmluZGluZ0Vycm9yPW1lc3NhZ2U9Pnt0aHJvdyBuZXcgQmluZGluZ0Vycm9yKG1lc3NhZ2UpfTtmdW5jdGlvbiBzaGFyZWRSZWdpc3RlclR5cGUocmF3VHlwZSxyZWdpc3RlcmVkSW5zdGFuY2Usb3B0aW9ucz17fSl7dmFyIG5hbWU9cmVnaXN0ZXJlZEluc3RhbmNlLm5hbWU7aWYoIXJhd1R5cGUpe3Rocm93QmluZGluZ0Vycm9yKGB0eXBlICIke25hbWV9IiBtdXN0IGhhdmUgYSBwb3NpdGl2ZSBpbnRlZ2VyIHR5cGVpZCBwb2ludGVyYCk7fWlmKHJlZ2lzdGVyZWRUeXBlcy5oYXNPd25Qcm9wZXJ0eShyYXdUeXBlKSl7aWYob3B0aW9ucy5pZ25vcmVEdXBsaWNhdGVSZWdpc3RyYXRpb25zKXtyZXR1cm59ZWxzZSB7dGhyb3dCaW5kaW5nRXJyb3IoYENhbm5vdCByZWdpc3RlciB0eXBlICcke25hbWV9JyB0d2ljZWApO319cmVnaXN0ZXJlZFR5cGVzW3Jhd1R5cGVdPXJlZ2lzdGVyZWRJbnN0YW5jZTtpZihhd2FpdGluZ0RlcGVuZGVuY2llcy5oYXNPd25Qcm9wZXJ0eShyYXdUeXBlKSl7dmFyIGNhbGxiYWNrcz1hd2FpdGluZ0RlcGVuZGVuY2llc1tyYXdUeXBlXTtkZWxldGUgYXdhaXRpbmdEZXBlbmRlbmNpZXNbcmF3VHlwZV07Y2FsbGJhY2tzLmZvckVhY2goY2I9PmNiKCkpO319ZnVuY3Rpb24gcmVnaXN0ZXJUeXBlKHJhd1R5cGUscmVnaXN0ZXJlZEluc3RhbmNlLG9wdGlvbnM9e30pe2lmKCEoImFyZ1BhY2tBZHZhbmNlImluIHJlZ2lzdGVyZWRJbnN0YW5jZSkpe3Rocm93IG5ldyBUeXBlRXJyb3IoInJlZ2lzdGVyVHlwZSByZWdpc3RlcmVkSW5zdGFuY2UgcmVxdWlyZXMgYXJnUGFja0FkdmFuY2UiKX1yZXR1cm4gc2hhcmVkUmVnaXN0ZXJUeXBlKHJhd1R5cGUscmVnaXN0ZXJlZEluc3RhbmNlLG9wdGlvbnMpfXZhciBHZW5lcmljV2lyZVR5cGVTaXplPTg7dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2Jvb2w9KHJhd1R5cGUsbmFtZSx0cnVlVmFsdWUsZmFsc2VWYWx1ZSk9PntuYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjpmdW5jdGlvbih3dCl7cmV0dXJuICEhd3R9LCJ0b1dpcmVUeXBlIjpmdW5jdGlvbihkZXN0cnVjdG9ycyxvKXtyZXR1cm4gbz90cnVlVmFsdWU6ZmFsc2VWYWx1ZX0sImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6ZnVuY3Rpb24ocG9pbnRlcil7cmV0dXJuIHRoaXNbImZyb21XaXJlVHlwZSJdKEhFQVBVOFtwb2ludGVyXSl9LGRlc3RydWN0b3JGdW5jdGlvbjpudWxsfSk7fTt2YXIgZW12YWxfZnJlZWxpc3Q9W107dmFyIGVtdmFsX2hhbmRsZXM9W107dmFyIF9fZW12YWxfZGVjcmVmPWhhbmRsZT0+e2lmKGhhbmRsZT45JiYwPT09LS1lbXZhbF9oYW5kbGVzW2hhbmRsZSsxXSl7ZW12YWxfaGFuZGxlc1toYW5kbGVdPXVuZGVmaW5lZDtlbXZhbF9mcmVlbGlzdC5wdXNoKGhhbmRsZSk7fX07dmFyIGNvdW50X2VtdmFsX2hhbmRsZXM9KCk9PmVtdmFsX2hhbmRsZXMubGVuZ3RoLzItNS1lbXZhbF9mcmVlbGlzdC5sZW5ndGg7dmFyIGluaXRfZW12YWw9KCk9PntlbXZhbF9oYW5kbGVzLnB1c2goMCwxLHVuZGVmaW5lZCwxLG51bGwsMSx0cnVlLDEsZmFsc2UsMSk7TW9kdWxlWyJjb3VudF9lbXZhbF9oYW5kbGVzIl09Y291bnRfZW12YWxfaGFuZGxlczt9O3ZhciBFbXZhbD17dG9WYWx1ZTpoYW5kbGU9PntpZighaGFuZGxlKXt0aHJvd0JpbmRpbmdFcnJvcigiQ2Fubm90IHVzZSBkZWxldGVkIHZhbC4gaGFuZGxlID0gIitoYW5kbGUpO31yZXR1cm4gZW12YWxfaGFuZGxlc1toYW5kbGVdfSx0b0hhbmRsZTp2YWx1ZT0+e3N3aXRjaCh2YWx1ZSl7Y2FzZSB1bmRlZmluZWQ6cmV0dXJuIDI7Y2FzZSBudWxsOnJldHVybiA0O2Nhc2UgdHJ1ZTpyZXR1cm4gNjtjYXNlIGZhbHNlOnJldHVybiA4O2RlZmF1bHQ6e2NvbnN0IGhhbmRsZT1lbXZhbF9mcmVlbGlzdC5wb3AoKXx8ZW12YWxfaGFuZGxlcy5sZW5ndGg7ZW12YWxfaGFuZGxlc1toYW5kbGVdPXZhbHVlO2VtdmFsX2hhbmRsZXNbaGFuZGxlKzFdPTE7cmV0dXJuIGhhbmRsZX19fX07ZnVuY3Rpb24gcmVhZFBvaW50ZXIocG9pbnRlcil7cmV0dXJuIHRoaXNbImZyb21XaXJlVHlwZSJdKEhFQVBVMzJbcG9pbnRlcj4+Ml0pfXZhciBFbVZhbFR5cGU9e25hbWU6ImVtc2NyaXB0ZW46OnZhbCIsImZyb21XaXJlVHlwZSI6aGFuZGxlPT57dmFyIHJ2PUVtdmFsLnRvVmFsdWUoaGFuZGxlKTtfX2VtdmFsX2RlY3JlZihoYW5kbGUpO3JldHVybiBydn0sInRvV2lyZVR5cGUiOihkZXN0cnVjdG9ycyx2YWx1ZSk9PkVtdmFsLnRvSGFuZGxlKHZhbHVlKSwiYXJnUGFja0FkdmFuY2UiOkdlbmVyaWNXaXJlVHlwZVNpemUsInJlYWRWYWx1ZUZyb21Qb2ludGVyIjpyZWFkUG9pbnRlcixkZXN0cnVjdG9yRnVuY3Rpb246bnVsbH07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2VtdmFsPXJhd1R5cGU9PnJlZ2lzdGVyVHlwZShyYXdUeXBlLEVtVmFsVHlwZSk7dmFyIGZsb2F0UmVhZFZhbHVlRnJvbVBvaW50ZXI9KG5hbWUsd2lkdGgpPT57c3dpdGNoKHdpZHRoKXtjYXNlIDQ6cmV0dXJuIGZ1bmN0aW9uKHBvaW50ZXIpe3JldHVybiB0aGlzWyJmcm9tV2lyZVR5cGUiXShIRUFQRjMyW3BvaW50ZXI+PjJdKX07Y2FzZSA4OnJldHVybiBmdW5jdGlvbihwb2ludGVyKXtyZXR1cm4gdGhpc1siZnJvbVdpcmVUeXBlIl0oSEVBUEY2NFtwb2ludGVyPj4zXSl9O2RlZmF1bHQ6dGhyb3cgbmV3IFR5cGVFcnJvcihgaW52YWxpZCBmbG9hdCB3aWR0aCAoJHt3aWR0aH0pOiAke25hbWV9YCl9fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfZmxvYXQ9KHJhd1R5cGUsbmFtZSxzaXplKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTtyZWdpc3RlclR5cGUocmF3VHlwZSx7bmFtZTpuYW1lLCJmcm9tV2lyZVR5cGUiOnZhbHVlPT52YWx1ZSwidG9XaXJlVHlwZSI6KGRlc3RydWN0b3JzLHZhbHVlKT0+dmFsdWUsImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6ZmxvYXRSZWFkVmFsdWVGcm9tUG9pbnRlcihuYW1lLHNpemUpLGRlc3RydWN0b3JGdW5jdGlvbjpudWxsfSk7fTt2YXIgaW50ZWdlclJlYWRWYWx1ZUZyb21Qb2ludGVyPShuYW1lLHdpZHRoLHNpZ25lZCk9Pntzd2l0Y2god2lkdGgpe2Nhc2UgMTpyZXR1cm4gc2lnbmVkP3BvaW50ZXI9PkhFQVA4W3BvaW50ZXJdOnBvaW50ZXI9PkhFQVBVOFtwb2ludGVyXTtjYXNlIDI6cmV0dXJuIHNpZ25lZD9wb2ludGVyPT5IRUFQMTZbcG9pbnRlcj4+MV06cG9pbnRlcj0+SEVBUFUxNltwb2ludGVyPj4xXTtjYXNlIDQ6cmV0dXJuIHNpZ25lZD9wb2ludGVyPT5IRUFQMzJbcG9pbnRlcj4+Ml06cG9pbnRlcj0+SEVBUFUzMltwb2ludGVyPj4yXTtkZWZhdWx0OnRocm93IG5ldyBUeXBlRXJyb3IoYGludmFsaWQgaW50ZWdlciB3aWR0aCAoJHt3aWR0aH0pOiAke25hbWV9YCl9fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfaW50ZWdlcj0ocHJpbWl0aXZlVHlwZSxuYW1lLHNpemUsbWluUmFuZ2UsbWF4UmFuZ2UpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3ZhciBmcm9tV2lyZVR5cGU9dmFsdWU9PnZhbHVlO2lmKG1pblJhbmdlPT09MCl7dmFyIGJpdHNoaWZ0PTMyLTgqc2l6ZTtmcm9tV2lyZVR5cGU9dmFsdWU9PnZhbHVlPDxiaXRzaGlmdD4+PmJpdHNoaWZ0O312YXIgaXNVbnNpZ25lZFR5cGU9bmFtZS5pbmNsdWRlcygidW5zaWduZWQiKTt2YXIgY2hlY2tBc3NlcnRpb25zPSh2YWx1ZSx0b1R5cGVOYW1lKT0+e307dmFyIHRvV2lyZVR5cGU7aWYoaXNVbnNpZ25lZFR5cGUpe3RvV2lyZVR5cGU9ZnVuY3Rpb24oZGVzdHJ1Y3RvcnMsdmFsdWUpe2NoZWNrQXNzZXJ0aW9ucyh2YWx1ZSx0aGlzLm5hbWUpO3JldHVybiB2YWx1ZT4+PjB9O31lbHNlIHt0b1dpcmVUeXBlPWZ1bmN0aW9uKGRlc3RydWN0b3JzLHZhbHVlKXtjaGVja0Fzc2VydGlvbnModmFsdWUsdGhpcy5uYW1lKTtyZXR1cm4gdmFsdWV9O31yZWdpc3RlclR5cGUocHJpbWl0aXZlVHlwZSx7bmFtZTpuYW1lLCJmcm9tV2lyZVR5cGUiOmZyb21XaXJlVHlwZSwidG9XaXJlVHlwZSI6dG9XaXJlVHlwZSwiYXJnUGFja0FkdmFuY2UiOkdlbmVyaWNXaXJlVHlwZVNpemUsInJlYWRWYWx1ZUZyb21Qb2ludGVyIjppbnRlZ2VyUmVhZFZhbHVlRnJvbVBvaW50ZXIobmFtZSxzaXplLG1pblJhbmdlIT09MCksZGVzdHJ1Y3RvckZ1bmN0aW9uOm51bGx9KTt9O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9tZW1vcnlfdmlldz0ocmF3VHlwZSxkYXRhVHlwZUluZGV4LG5hbWUpPT57dmFyIHR5cGVNYXBwaW5nPVtJbnQ4QXJyYXksVWludDhBcnJheSxJbnQxNkFycmF5LFVpbnQxNkFycmF5LEludDMyQXJyYXksVWludDMyQXJyYXksRmxvYXQzMkFycmF5LEZsb2F0NjRBcnJheV07dmFyIFRBPXR5cGVNYXBwaW5nW2RhdGFUeXBlSW5kZXhdO2Z1bmN0aW9uIGRlY29kZU1lbW9yeVZpZXcoaGFuZGxlKXt2YXIgc2l6ZT1IRUFQVTMyW2hhbmRsZT4+Ml07dmFyIGRhdGE9SEVBUFUzMltoYW5kbGUrND4+Ml07cmV0dXJuIG5ldyBUQShIRUFQOC5idWZmZXIsZGF0YSxzaXplKX1uYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjpkZWNvZGVNZW1vcnlWaWV3LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOmRlY29kZU1lbW9yeVZpZXd9LHtpZ25vcmVEdXBsaWNhdGVSZWdpc3RyYXRpb25zOnRydWV9KTt9O3ZhciBzdHJpbmdUb1VURjhBcnJheT0oc3RyLGhlYXAsb3V0SWR4LG1heEJ5dGVzVG9Xcml0ZSk9PntpZighKG1heEJ5dGVzVG9Xcml0ZT4wKSlyZXR1cm4gMDt2YXIgc3RhcnRJZHg9b3V0SWR4O3ZhciBlbmRJZHg9b3V0SWR4K21heEJ5dGVzVG9Xcml0ZS0xO2Zvcih2YXIgaT0wO2k8c3RyLmxlbmd0aDsrK2kpe3ZhciB1PXN0ci5jaGFyQ29kZUF0KGkpO2lmKHU+PTU1Mjk2JiZ1PD01NzM0Myl7dmFyIHUxPXN0ci5jaGFyQ29kZUF0KCsraSk7dT02NTUzNisoKHUmMTAyMyk8PDEwKXx1MSYxMDIzO31pZih1PD0xMjcpe2lmKG91dElkeD49ZW5kSWR4KWJyZWFrO2hlYXBbb3V0SWR4KytdPXU7fWVsc2UgaWYodTw9MjA0Nyl7aWYob3V0SWR4KzE+PWVuZElkeClicmVhaztoZWFwW291dElkeCsrXT0xOTJ8dT4+NjtoZWFwW291dElkeCsrXT0xMjh8dSY2Mzt9ZWxzZSBpZih1PD02NTUzNSl7aWYob3V0SWR4KzI+PWVuZElkeClicmVhaztoZWFwW291dElkeCsrXT0yMjR8dT4+MTI7aGVhcFtvdXRJZHgrK109MTI4fHU+PjYmNjM7aGVhcFtvdXRJZHgrK109MTI4fHUmNjM7fWVsc2Uge2lmKG91dElkeCszPj1lbmRJZHgpYnJlYWs7aGVhcFtvdXRJZHgrK109MjQwfHU+PjE4O2hlYXBbb3V0SWR4KytdPTEyOHx1Pj4xMiY2MztoZWFwW291dElkeCsrXT0xMjh8dT4+NiY2MztoZWFwW291dElkeCsrXT0xMjh8dSY2Mzt9fWhlYXBbb3V0SWR4XT0wO3JldHVybiBvdXRJZHgtc3RhcnRJZHh9O3ZhciBzdHJpbmdUb1VURjg9KHN0cixvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKT0+c3RyaW5nVG9VVEY4QXJyYXkoc3RyLEhFQVBVOCxvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKTt2YXIgbGVuZ3RoQnl0ZXNVVEY4PXN0cj0+e3ZhciBsZW49MDtmb3IodmFyIGk9MDtpPHN0ci5sZW5ndGg7KytpKXt2YXIgYz1zdHIuY2hhckNvZGVBdChpKTtpZihjPD0xMjcpe2xlbisrO31lbHNlIGlmKGM8PTIwNDcpe2xlbis9Mjt9ZWxzZSBpZihjPj01NTI5NiYmYzw9NTczNDMpe2xlbis9NDsrK2k7fWVsc2Uge2xlbis9Mzt9fXJldHVybiBsZW59O3ZhciBVVEY4RGVjb2Rlcj10eXBlb2YgVGV4dERlY29kZXIhPSJ1bmRlZmluZWQiP25ldyBUZXh0RGVjb2RlcigidXRmOCIpOnVuZGVmaW5lZDt2YXIgVVRGOEFycmF5VG9TdHJpbmc9KGhlYXBPckFycmF5LGlkeCxtYXhCeXRlc1RvUmVhZCk9Pnt2YXIgZW5kSWR4PWlkeCttYXhCeXRlc1RvUmVhZDt2YXIgZW5kUHRyPWlkeDt3aGlsZShoZWFwT3JBcnJheVtlbmRQdHJdJiYhKGVuZFB0cj49ZW5kSWR4KSkrK2VuZFB0cjtpZihlbmRQdHItaWR4PjE2JiZoZWFwT3JBcnJheS5idWZmZXImJlVURjhEZWNvZGVyKXtyZXR1cm4gVVRGOERlY29kZXIuZGVjb2RlKGhlYXBPckFycmF5LnN1YmFycmF5KGlkeCxlbmRQdHIpKX12YXIgc3RyPSIiO3doaWxlKGlkeDxlbmRQdHIpe3ZhciB1MD1oZWFwT3JBcnJheVtpZHgrK107aWYoISh1MCYxMjgpKXtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUodTApO2NvbnRpbnVlfXZhciB1MT1oZWFwT3JBcnJheVtpZHgrK10mNjM7aWYoKHUwJjIyNCk9PTE5Mil7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKCh1MCYzMSk8PDZ8dTEpO2NvbnRpbnVlfXZhciB1Mj1oZWFwT3JBcnJheVtpZHgrK10mNjM7aWYoKHUwJjI0MCk9PTIyNCl7dTA9KHUwJjE1KTw8MTJ8dTE8PDZ8dTI7fWVsc2Uge3UwPSh1MCY3KTw8MTh8dTE8PDEyfHUyPDw2fGhlYXBPckFycmF5W2lkeCsrXSY2Mzt9aWYodTA8NjU1MzYpe3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSh1MCk7fWVsc2Uge3ZhciBjaD11MC02NTUzNjtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoNTUyOTZ8Y2g+PjEwLDU2MzIwfGNoJjEwMjMpO319cmV0dXJuIHN0cn07dmFyIFVURjhUb1N0cmluZz0ocHRyLG1heEJ5dGVzVG9SZWFkKT0+cHRyP1VURjhBcnJheVRvU3RyaW5nKEhFQVBVOCxwdHIsbWF4Qnl0ZXNUb1JlYWQpOiIiO3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9zdGRfc3RyaW5nPShyYXdUeXBlLG5hbWUpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3ZhciBzdGRTdHJpbmdJc1VURjg9bmFtZT09PSJzdGQ6OnN0cmluZyI7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIih2YWx1ZSl7dmFyIGxlbmd0aD1IRUFQVTMyW3ZhbHVlPj4yXTt2YXIgcGF5bG9hZD12YWx1ZSs0O3ZhciBzdHI7aWYoc3RkU3RyaW5nSXNVVEY4KXt2YXIgZGVjb2RlU3RhcnRQdHI9cGF5bG9hZDtmb3IodmFyIGk9MDtpPD1sZW5ndGg7KytpKXt2YXIgY3VycmVudEJ5dGVQdHI9cGF5bG9hZCtpO2lmKGk9PWxlbmd0aHx8SEVBUFU4W2N1cnJlbnRCeXRlUHRyXT09MCl7dmFyIG1heFJlYWQ9Y3VycmVudEJ5dGVQdHItZGVjb2RlU3RhcnRQdHI7dmFyIHN0cmluZ1NlZ21lbnQ9VVRGOFRvU3RyaW5nKGRlY29kZVN0YXJ0UHRyLG1heFJlYWQpO2lmKHN0cj09PXVuZGVmaW5lZCl7c3RyPXN0cmluZ1NlZ21lbnQ7fWVsc2Uge3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSgwKTtzdHIrPXN0cmluZ1NlZ21lbnQ7fWRlY29kZVN0YXJ0UHRyPWN1cnJlbnRCeXRlUHRyKzE7fX19ZWxzZSB7dmFyIGE9bmV3IEFycmF5KGxlbmd0aCk7Zm9yKHZhciBpPTA7aTxsZW5ndGg7KytpKXthW2ldPVN0cmluZy5mcm9tQ2hhckNvZGUoSEVBUFU4W3BheWxvYWQraV0pO31zdHI9YS5qb2luKCIiKTt9X2ZyZWUodmFsdWUpO3JldHVybiBzdHJ9LCJ0b1dpcmVUeXBlIihkZXN0cnVjdG9ycyx2YWx1ZSl7aWYodmFsdWUgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlcil7dmFsdWU9bmV3IFVpbnQ4QXJyYXkodmFsdWUpO312YXIgbGVuZ3RoO3ZhciB2YWx1ZUlzT2ZUeXBlU3RyaW5nPXR5cGVvZiB2YWx1ZT09InN0cmluZyI7aWYoISh2YWx1ZUlzT2ZUeXBlU3RyaW5nfHx2YWx1ZSBpbnN0YW5jZW9mIFVpbnQ4QXJyYXl8fHZhbHVlIGluc3RhbmNlb2YgVWludDhDbGFtcGVkQXJyYXl8fHZhbHVlIGluc3RhbmNlb2YgSW50OEFycmF5KSl7dGhyb3dCaW5kaW5nRXJyb3IoIkNhbm5vdCBwYXNzIG5vbi1zdHJpbmcgdG8gc3RkOjpzdHJpbmciKTt9aWYoc3RkU3RyaW5nSXNVVEY4JiZ2YWx1ZUlzT2ZUeXBlU3RyaW5nKXtsZW5ndGg9bGVuZ3RoQnl0ZXNVVEY4KHZhbHVlKTt9ZWxzZSB7bGVuZ3RoPXZhbHVlLmxlbmd0aDt9dmFyIGJhc2U9X21hbGxvYyg0K2xlbmd0aCsxKTt2YXIgcHRyPWJhc2UrNDtIRUFQVTMyW2Jhc2U+PjJdPWxlbmd0aDtpZihzdGRTdHJpbmdJc1VURjgmJnZhbHVlSXNPZlR5cGVTdHJpbmcpe3N0cmluZ1RvVVRGOCh2YWx1ZSxwdHIsbGVuZ3RoKzEpO31lbHNlIHtpZih2YWx1ZUlzT2ZUeXBlU3RyaW5nKXtmb3IodmFyIGk9MDtpPGxlbmd0aDsrK2kpe3ZhciBjaGFyQ29kZT12YWx1ZS5jaGFyQ29kZUF0KGkpO2lmKGNoYXJDb2RlPjI1NSl7X2ZyZWUocHRyKTt0aHJvd0JpbmRpbmdFcnJvcigiU3RyaW5nIGhhcyBVVEYtMTYgY29kZSB1bml0cyB0aGF0IGRvIG5vdCBmaXQgaW4gOCBiaXRzIik7fUhFQVBVOFtwdHIraV09Y2hhckNvZGU7fX1lbHNlIHtmb3IodmFyIGk9MDtpPGxlbmd0aDsrK2kpe0hFQVBVOFtwdHIraV09dmFsdWVbaV07fX19aWYoZGVzdHJ1Y3RvcnMhPT1udWxsKXtkZXN0cnVjdG9ycy5wdXNoKF9mcmVlLGJhc2UpO31yZXR1cm4gYmFzZX0sImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6cmVhZFBvaW50ZXIsZGVzdHJ1Y3RvckZ1bmN0aW9uKHB0cil7X2ZyZWUocHRyKTt9fSk7fTt2YXIgVVRGMTZEZWNvZGVyPXR5cGVvZiBUZXh0RGVjb2RlciE9InVuZGVmaW5lZCI/bmV3IFRleHREZWNvZGVyKCJ1dGYtMTZsZSIpOnVuZGVmaW5lZDt2YXIgVVRGMTZUb1N0cmluZz0ocHRyLG1heEJ5dGVzVG9SZWFkKT0+e3ZhciBlbmRQdHI9cHRyO3ZhciBpZHg9ZW5kUHRyPj4xO3ZhciBtYXhJZHg9aWR4K21heEJ5dGVzVG9SZWFkLzI7d2hpbGUoIShpZHg+PW1heElkeCkmJkhFQVBVMTZbaWR4XSkrK2lkeDtlbmRQdHI9aWR4PDwxO2lmKGVuZFB0ci1wdHI+MzImJlVURjE2RGVjb2RlcilyZXR1cm4gVVRGMTZEZWNvZGVyLmRlY29kZShIRUFQVTguc3ViYXJyYXkocHRyLGVuZFB0cikpO3ZhciBzdHI9IiI7Zm9yKHZhciBpPTA7IShpPj1tYXhCeXRlc1RvUmVhZC8yKTsrK2kpe3ZhciBjb2RlVW5pdD1IRUFQMTZbcHRyK2kqMj4+MV07aWYoY29kZVVuaXQ9PTApYnJlYWs7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKGNvZGVVbml0KTt9cmV0dXJuIHN0cn07dmFyIHN0cmluZ1RvVVRGMTY9KHN0cixvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKT0+e21heEJ5dGVzVG9Xcml0ZT8/PTIxNDc0ODM2NDc7aWYobWF4Qnl0ZXNUb1dyaXRlPDIpcmV0dXJuIDA7bWF4Qnl0ZXNUb1dyaXRlLT0yO3ZhciBzdGFydFB0cj1vdXRQdHI7dmFyIG51bUNoYXJzVG9Xcml0ZT1tYXhCeXRlc1RvV3JpdGU8c3RyLmxlbmd0aCoyP21heEJ5dGVzVG9Xcml0ZS8yOnN0ci5sZW5ndGg7Zm9yKHZhciBpPTA7aTxudW1DaGFyc1RvV3JpdGU7KytpKXt2YXIgY29kZVVuaXQ9c3RyLmNoYXJDb2RlQXQoaSk7SEVBUDE2W291dFB0cj4+MV09Y29kZVVuaXQ7b3V0UHRyKz0yO31IRUFQMTZbb3V0UHRyPj4xXT0wO3JldHVybiBvdXRQdHItc3RhcnRQdHJ9O3ZhciBsZW5ndGhCeXRlc1VURjE2PXN0cj0+c3RyLmxlbmd0aCoyO3ZhciBVVEYzMlRvU3RyaW5nPShwdHIsbWF4Qnl0ZXNUb1JlYWQpPT57dmFyIGk9MDt2YXIgc3RyPSIiO3doaWxlKCEoaT49bWF4Qnl0ZXNUb1JlYWQvNCkpe3ZhciB1dGYzMj1IRUFQMzJbcHRyK2kqND4+Ml07aWYodXRmMzI9PTApYnJlYWs7KytpO2lmKHV0ZjMyPj02NTUzNil7dmFyIGNoPXV0ZjMyLTY1NTM2O3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSg1NTI5NnxjaD4+MTAsNTYzMjB8Y2gmMTAyMyk7fWVsc2Uge3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSh1dGYzMik7fX1yZXR1cm4gc3RyfTt2YXIgc3RyaW5nVG9VVEYzMj0oc3RyLG91dFB0cixtYXhCeXRlc1RvV3JpdGUpPT57bWF4Qnl0ZXNUb1dyaXRlPz89MjE0NzQ4MzY0NztpZihtYXhCeXRlc1RvV3JpdGU8NClyZXR1cm4gMDt2YXIgc3RhcnRQdHI9b3V0UHRyO3ZhciBlbmRQdHI9c3RhcnRQdHIrbWF4Qnl0ZXNUb1dyaXRlLTQ7Zm9yKHZhciBpPTA7aTxzdHIubGVuZ3RoOysraSl7dmFyIGNvZGVVbml0PXN0ci5jaGFyQ29kZUF0KGkpO2lmKGNvZGVVbml0Pj01NTI5NiYmY29kZVVuaXQ8PTU3MzQzKXt2YXIgdHJhaWxTdXJyb2dhdGU9c3RyLmNoYXJDb2RlQXQoKytpKTtjb2RlVW5pdD02NTUzNisoKGNvZGVVbml0JjEwMjMpPDwxMCl8dHJhaWxTdXJyb2dhdGUmMTAyMzt9SEVBUDMyW291dFB0cj4+Ml09Y29kZVVuaXQ7b3V0UHRyKz00O2lmKG91dFB0cis0PmVuZFB0cilicmVha31IRUFQMzJbb3V0UHRyPj4yXT0wO3JldHVybiBvdXRQdHItc3RhcnRQdHJ9O3ZhciBsZW5ndGhCeXRlc1VURjMyPXN0cj0+e3ZhciBsZW49MDtmb3IodmFyIGk9MDtpPHN0ci5sZW5ndGg7KytpKXt2YXIgY29kZVVuaXQ9c3RyLmNoYXJDb2RlQXQoaSk7aWYoY29kZVVuaXQ+PTU1Mjk2JiZjb2RlVW5pdDw9NTczNDMpKytpO2xlbis9NDt9cmV0dXJuIGxlbn07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX3N0ZF93c3RyaW5nPShyYXdUeXBlLGNoYXJTaXplLG5hbWUpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3ZhciBkZWNvZGVTdHJpbmcsZW5jb2RlU3RyaW5nLHJlYWRDaGFyQXQsbGVuZ3RoQnl0ZXNVVEY7aWYoY2hhclNpemU9PT0yKXtkZWNvZGVTdHJpbmc9VVRGMTZUb1N0cmluZztlbmNvZGVTdHJpbmc9c3RyaW5nVG9VVEYxNjtsZW5ndGhCeXRlc1VURj1sZW5ndGhCeXRlc1VURjE2O3JlYWRDaGFyQXQ9cG9pbnRlcj0+SEVBUFUxNltwb2ludGVyPj4xXTt9ZWxzZSBpZihjaGFyU2l6ZT09PTQpe2RlY29kZVN0cmluZz1VVEYzMlRvU3RyaW5nO2VuY29kZVN0cmluZz1zdHJpbmdUb1VURjMyO2xlbmd0aEJ5dGVzVVRGPWxlbmd0aEJ5dGVzVVRGMzI7cmVhZENoYXJBdD1wb2ludGVyPT5IRUFQVTMyW3BvaW50ZXI+PjJdO31yZWdpc3RlclR5cGUocmF3VHlwZSx7bmFtZTpuYW1lLCJmcm9tV2lyZVR5cGUiOnZhbHVlPT57dmFyIGxlbmd0aD1IRUFQVTMyW3ZhbHVlPj4yXTt2YXIgc3RyO3ZhciBkZWNvZGVTdGFydFB0cj12YWx1ZSs0O2Zvcih2YXIgaT0wO2k8PWxlbmd0aDsrK2kpe3ZhciBjdXJyZW50Qnl0ZVB0cj12YWx1ZSs0K2kqY2hhclNpemU7aWYoaT09bGVuZ3RofHxyZWFkQ2hhckF0KGN1cnJlbnRCeXRlUHRyKT09MCl7dmFyIG1heFJlYWRCeXRlcz1jdXJyZW50Qnl0ZVB0ci1kZWNvZGVTdGFydFB0cjt2YXIgc3RyaW5nU2VnbWVudD1kZWNvZGVTdHJpbmcoZGVjb2RlU3RhcnRQdHIsbWF4UmVhZEJ5dGVzKTtpZihzdHI9PT11bmRlZmluZWQpe3N0cj1zdHJpbmdTZWdtZW50O31lbHNlIHtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoMCk7c3RyKz1zdHJpbmdTZWdtZW50O31kZWNvZGVTdGFydFB0cj1jdXJyZW50Qnl0ZVB0citjaGFyU2l6ZTt9fV9mcmVlKHZhbHVlKTtyZXR1cm4gc3RyfSwidG9XaXJlVHlwZSI6KGRlc3RydWN0b3JzLHZhbHVlKT0+e2lmKCEodHlwZW9mIHZhbHVlPT0ic3RyaW5nIikpe3Rocm93QmluZGluZ0Vycm9yKGBDYW5ub3QgcGFzcyBub24tc3RyaW5nIHRvIEMrKyBzdHJpbmcgdHlwZSAke25hbWV9YCk7fXZhciBsZW5ndGg9bGVuZ3RoQnl0ZXNVVEYodmFsdWUpO3ZhciBwdHI9X21hbGxvYyg0K2xlbmd0aCtjaGFyU2l6ZSk7SEVBUFUzMltwdHI+PjJdPWxlbmd0aC9jaGFyU2l6ZTtlbmNvZGVTdHJpbmcodmFsdWUscHRyKzQsbGVuZ3RoK2NoYXJTaXplKTtpZihkZXN0cnVjdG9ycyE9PW51bGwpe2Rlc3RydWN0b3JzLnB1c2goX2ZyZWUscHRyKTt9cmV0dXJuIHB0cn0sImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6cmVhZFBvaW50ZXIsZGVzdHJ1Y3RvckZ1bmN0aW9uKHB0cil7X2ZyZWUocHRyKTt9fSk7fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfdm9pZD0ocmF3VHlwZSxuYW1lKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTtyZWdpc3RlclR5cGUocmF3VHlwZSx7aXNWb2lkOnRydWUsbmFtZTpuYW1lLCJhcmdQYWNrQWR2YW5jZSI6MCwiZnJvbVdpcmVUeXBlIjooKT0+dW5kZWZpbmVkLCJ0b1dpcmVUeXBlIjooZGVzdHJ1Y3RvcnMsbyk9PnVuZGVmaW5lZH0pO307dmFyIGdldEhlYXBNYXg9KCk9PjIxNDc0ODM2NDg7dmFyIGdyb3dNZW1vcnk9c2l6ZT0+e3ZhciBiPXdhc21NZW1vcnkuYnVmZmVyO3ZhciBwYWdlcz0oc2l6ZS1iLmJ5dGVMZW5ndGgrNjU1MzUpLzY1NTM2O3RyeXt3YXNtTWVtb3J5Lmdyb3cocGFnZXMpO3VwZGF0ZU1lbW9yeVZpZXdzKCk7cmV0dXJuIDF9Y2F0Y2goZSl7fX07dmFyIF9lbXNjcmlwdGVuX3Jlc2l6ZV9oZWFwPXJlcXVlc3RlZFNpemU9Pnt2YXIgb2xkU2l6ZT1IRUFQVTgubGVuZ3RoO3JlcXVlc3RlZFNpemU+Pj49MDt2YXIgbWF4SGVhcFNpemU9Z2V0SGVhcE1heCgpO2lmKHJlcXVlc3RlZFNpemU+bWF4SGVhcFNpemUpe3JldHVybiBmYWxzZX12YXIgYWxpZ25VcD0oeCxtdWx0aXBsZSk9PngrKG11bHRpcGxlLXglbXVsdGlwbGUpJW11bHRpcGxlO2Zvcih2YXIgY3V0RG93bj0xO2N1dERvd248PTQ7Y3V0RG93bio9Mil7dmFyIG92ZXJHcm93bkhlYXBTaXplPW9sZFNpemUqKDErLjIvY3V0RG93bik7b3Zlckdyb3duSGVhcFNpemU9TWF0aC5taW4ob3Zlckdyb3duSGVhcFNpemUscmVxdWVzdGVkU2l6ZSsxMDA2NjMyOTYpO3ZhciBuZXdTaXplPU1hdGgubWluKG1heEhlYXBTaXplLGFsaWduVXAoTWF0aC5tYXgocmVxdWVzdGVkU2l6ZSxvdmVyR3Jvd25IZWFwU2l6ZSksNjU1MzYpKTt2YXIgcmVwbGFjZW1lbnQ9Z3Jvd01lbW9yeShuZXdTaXplKTtpZihyZXBsYWNlbWVudCl7cmV0dXJuIHRydWV9fXJldHVybiBmYWxzZX07ZW1iaW5kX2luaXRfY2hhckNvZGVzKCk7QmluZGluZ0Vycm9yPU1vZHVsZVsiQmluZGluZ0Vycm9yIl09Y2xhc3MgQmluZGluZ0Vycm9yIGV4dGVuZHMgRXJyb3J7Y29uc3RydWN0b3IobWVzc2FnZSl7c3VwZXIobWVzc2FnZSk7dGhpcy5uYW1lPSJCaW5kaW5nRXJyb3IiO319O01vZHVsZVsiSW50ZXJuYWxFcnJvciJdPWNsYXNzIEludGVybmFsRXJyb3IgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihtZXNzYWdlKXtzdXBlcihtZXNzYWdlKTt0aGlzLm5hbWU9IkludGVybmFsRXJyb3IiO319O2luaXRfZW12YWwoKTt2YXIgd2FzbUltcG9ydHM9e2Y6X19lbWJpbmRfcmVnaXN0ZXJfYmlnaW50LGk6X19lbWJpbmRfcmVnaXN0ZXJfYm9vbCxoOl9fZW1iaW5kX3JlZ2lzdGVyX2VtdmFsLGU6X19lbWJpbmRfcmVnaXN0ZXJfZmxvYXQsYjpfX2VtYmluZF9yZWdpc3Rlcl9pbnRlZ2VyLGE6X19lbWJpbmRfcmVnaXN0ZXJfbWVtb3J5X3ZpZXcsZDpfX2VtYmluZF9yZWdpc3Rlcl9zdGRfc3RyaW5nLGM6X19lbWJpbmRfcmVnaXN0ZXJfc3RkX3dzdHJpbmcsajpfX2VtYmluZF9yZWdpc3Rlcl92b2lkLGc6X2Vtc2NyaXB0ZW5fcmVzaXplX2hlYXB9O3ZhciB3YXNtRXhwb3J0cz1jcmVhdGVXYXNtKCk7TW9kdWxlWyJfc29ydCJdPShhMCxhMSxhMixhMyxhNCxhNSxhNixhNyxhOCxhOSk9PihNb2R1bGVbIl9zb3J0Il09d2FzbUV4cG9ydHNbIm0iXSkoYTAsYTEsYTIsYTMsYTQsYTUsYTYsYTcsYTgsYTkpO3ZhciBfbWFsbG9jPU1vZHVsZVsiX21hbGxvYyJdPWEwPT4oX21hbGxvYz1Nb2R1bGVbIl9tYWxsb2MiXT13YXNtRXhwb3J0c1sibyJdKShhMCk7dmFyIF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT1hMD0+KF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT13YXNtRXhwb3J0c1sicCJdKShhMCk7dmFyIGNhbGxlZFJ1bjtkZXBlbmRlbmNpZXNGdWxmaWxsZWQ9ZnVuY3Rpb24gcnVuQ2FsbGVyKCl7aWYoIWNhbGxlZFJ1bilydW4oKTtpZighY2FsbGVkUnVuKWRlcGVuZGVuY2llc0Z1bGZpbGxlZD1ydW5DYWxsZXI7fTtmdW5jdGlvbiBydW4oKXtpZihydW5EZXBlbmRlbmNpZXM+MCl7cmV0dXJufXByZVJ1bigpO2lmKHJ1bkRlcGVuZGVuY2llcz4wKXtyZXR1cm59ZnVuY3Rpb24gZG9SdW4oKXtpZihjYWxsZWRSdW4pcmV0dXJuO2NhbGxlZFJ1bj10cnVlO01vZHVsZVsiY2FsbGVkUnVuIl09dHJ1ZTtpZihBQk9SVClyZXR1cm47aW5pdFJ1bnRpbWUoKTtyZWFkeVByb21pc2VSZXNvbHZlKE1vZHVsZSk7aWYoTW9kdWxlWyJvblJ1bnRpbWVJbml0aWFsaXplZCJdKU1vZHVsZVsib25SdW50aW1lSW5pdGlhbGl6ZWQiXSgpO3Bvc3RSdW4oKTt9aWYoTW9kdWxlWyJzZXRTdGF0dXMiXSl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiUnVubmluZy4uLiIpO3NldFRpbWVvdXQoZnVuY3Rpb24oKXtzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiIik7fSwxKTtkb1J1bigpO30sMSk7fWVsc2Uge2RvUnVuKCk7fX1pZihNb2R1bGVbInByZUluaXQiXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlSW5pdCJdPT0iZnVuY3Rpb24iKU1vZHVsZVsicHJlSW5pdCJdPVtNb2R1bGVbInByZUluaXQiXV07d2hpbGUoTW9kdWxlWyJwcmVJbml0Il0ubGVuZ3RoPjApe01vZHVsZVsicHJlSW5pdCJdLnBvcCgpKCk7fX1ydW4oKTsKCgogICAgcmV0dXJuIG1vZHVsZUFyZy5yZWFkeQogIH0KICApOwogIH0pKCk7CgogIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55CiAgbGV0IHdhc21Nb2R1bGU7CiAgYXN5bmMgZnVuY3Rpb24gaW5pdFdhc20oKSB7CiAgICAgIHdhc21Nb2R1bGUgPSBhd2FpdCBsb2FkV2FzbSgpOwogIH0KICBsZXQgc29ydERhdGE7CiAgbGV0IHZpZXdQcm9qUHRyOwogIGxldCB0cmFuc2Zvcm1zUHRyOwogIGxldCB0cmFuc2Zvcm1JbmRpY2VzUHRyOwogIGxldCBwb3NpdGlvbnNQdHI7CiAgbGV0IGNodW5rc1B0cjsKICBsZXQgZGVwdGhCdWZmZXJQdHI7CiAgbGV0IGRlcHRoSW5kZXhQdHI7CiAgbGV0IHN0YXJ0c1B0cjsKICBsZXQgY291bnRzUHRyOwogIGxldCBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCA9IDA7CiAgbGV0IGFsbG9jYXRlZFRyYW5zZm9ybUNvdW50ID0gMDsKICBsZXQgdmlld1Byb2ogPSBuZXcgRmxvYXQzMkFycmF5KDE2KTsKICBsZXQgbG9jayA9IGZhbHNlOwogIGxldCBhbGxvY2F0aW9uUGVuZGluZyA9IGZhbHNlOwogIGxldCBzb3J0aW5nID0gZmFsc2U7CiAgY29uc3QgYWxsb2NhdGVCdWZmZXJzID0gYXN5bmMgKCkgPT4gewogICAgICBpZiAobG9jaykgewogICAgICAgICAgYWxsb2NhdGlvblBlbmRpbmcgPSB0cnVlOwogICAgICAgICAgcmV0dXJuOwogICAgICB9CiAgICAgIGxvY2sgPSB0cnVlOwogICAgICBhbGxvY2F0aW9uUGVuZGluZyA9IGZhbHNlOwogICAgICBpZiAoIXdhc21Nb2R1bGUpCiAgICAgICAgICBhd2FpdCBpbml0V2FzbSgpOwogICAgICBjb25zdCB0YXJnZXRBbGxvY2F0ZWRWZXJ0ZXhDb3VudCA9IE1hdGgucG93KDIsIE1hdGguY2VpbChNYXRoLmxvZzIoc29ydERhdGEudmVydGV4Q291bnQpKSk7CiAgICAgIGlmIChhbGxvY2F0ZWRWZXJ0ZXhDb3VudCA8IHRhcmdldEFsbG9jYXRlZFZlcnRleENvdW50KSB7CiAgICAgICAgICBpZiAoYWxsb2NhdGVkVmVydGV4Q291bnQgPiAwKSB7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZSh2aWV3UHJvalB0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZSh0cmFuc2Zvcm1JbmRpY2VzUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHBvc2l0aW9uc1B0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShjaHVua3NQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoZGVwdGhCdWZmZXJQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoZGVwdGhJbmRleFB0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShzdGFydHNQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoY291bnRzUHRyKTsKICAgICAgICAgIH0KICAgICAgICAgIGFsbG9jYXRlZFZlcnRleENvdW50ID0gdGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQ7CiAgICAgICAgICB2aWV3UHJvalB0ciA9IHdhc21Nb2R1bGUuX21hbGxvYygxNiAqIDQpOwogICAgICAgICAgdHJhbnNmb3JtSW5kaWNlc1B0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyhhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICAgICAgcG9zaXRpb25zUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKDMgKiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICAgICAgY2h1bmtzUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFZlcnRleENvdW50KTsKICAgICAgICAgIGRlcHRoQnVmZmVyUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBkZXB0aEluZGV4UHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBzdGFydHNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoYWxsb2NhdGVkVmVydGV4Q291bnQgKiA0KTsKICAgICAgICAgIGNvdW50c1B0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyhhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICB9CiAgICAgIGlmIChhbGxvY2F0ZWRUcmFuc2Zvcm1Db3VudCA8IHNvcnREYXRhLnRyYW5zZm9ybXMubGVuZ3RoKSB7CiAgICAgICAgICBpZiAoYWxsb2NhdGVkVHJhbnNmb3JtQ291bnQgPiAwKSB7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZSh0cmFuc2Zvcm1zUHRyKTsKICAgICAgICAgIH0KICAgICAgICAgIGFsbG9jYXRlZFRyYW5zZm9ybUNvdW50ID0gc29ydERhdGEudHJhbnNmb3Jtcy5sZW5ndGg7CiAgICAgICAgICB0cmFuc2Zvcm1zUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFRyYW5zZm9ybUNvdW50ICogNCk7CiAgICAgIH0KICAgICAgbG9jayA9IGZhbHNlOwogICAgICBpZiAoYWxsb2NhdGlvblBlbmRpbmcpIHsKICAgICAgICAgIGFsbG9jYXRpb25QZW5kaW5nID0gZmFsc2U7CiAgICAgICAgICBhd2FpdCBhbGxvY2F0ZUJ1ZmZlcnMoKTsKICAgICAgfQogIH07CiAgY29uc3QgcnVuU29ydCA9ICgpID0+IHsKICAgICAgaWYgKGxvY2sgfHwgYWxsb2NhdGlvblBlbmRpbmcgfHwgIXdhc21Nb2R1bGUpCiAgICAgICAgICByZXR1cm47CiAgICAgIGxvY2sgPSB0cnVlOwogICAgICB3YXNtTW9kdWxlLkhFQVBGMzIuc2V0KHNvcnREYXRhLnBvc2l0aW9ucywgcG9zaXRpb25zUHRyIC8gNCk7CiAgICAgIHdhc21Nb2R1bGUuSEVBUEYzMi5zZXQoc29ydERhdGEudHJhbnNmb3JtcywgdHJhbnNmb3Jtc1B0ciAvIDQpOwogICAgICB3YXNtTW9kdWxlLkhFQVBVMzIuc2V0KHNvcnREYXRhLnRyYW5zZm9ybUluZGljZXMsIHRyYW5zZm9ybUluZGljZXNQdHIgLyA0KTsKICAgICAgd2FzbU1vZHVsZS5IRUFQRjMyLnNldCh2aWV3UHJvaiwgdmlld1Byb2pQdHIgLyA0KTsKICAgICAgd2FzbU1vZHVsZS5fc29ydCh2aWV3UHJvalB0ciwgdHJhbnNmb3Jtc1B0ciwgdHJhbnNmb3JtSW5kaWNlc1B0ciwgc29ydERhdGEudmVydGV4Q291bnQsIHBvc2l0aW9uc1B0ciwgY2h1bmtzUHRyLCBkZXB0aEJ1ZmZlclB0ciwgZGVwdGhJbmRleFB0ciwgc3RhcnRzUHRyLCBjb3VudHNQdHIpOwogICAgICBjb25zdCBkZXB0aEluZGV4ID0gbmV3IFVpbnQzMkFycmF5KHdhc21Nb2R1bGUuSEVBUFUzMi5idWZmZXIsIGRlcHRoSW5kZXhQdHIsIHNvcnREYXRhLnZlcnRleENvdW50KTsKICAgICAgY29uc3QgZGV0YWNoZWREZXB0aEluZGV4ID0gbmV3IFVpbnQzMkFycmF5KGRlcHRoSW5kZXguc2xpY2UoKS5idWZmZXIpOwogICAgICBjb25zdCBjaHVua3MgPSBuZXcgVWludDhBcnJheSh3YXNtTW9kdWxlLkhFQVBVOC5idWZmZXIsIGNodW5rc1B0ciwgc29ydERhdGEudmVydGV4Q291bnQpOwogICAgICBjb25zdCBkZXRhY2hlZENodW5rcyA9IG5ldyBVaW50OEFycmF5KGNodW5rcy5zbGljZSgpLmJ1ZmZlcik7CiAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyBkZXB0aEluZGV4OiBkZXRhY2hlZERlcHRoSW5kZXgsIGNodW5rczogZGV0YWNoZWRDaHVua3MgfSwgWwogICAgICAgICAgZGV0YWNoZWREZXB0aEluZGV4LmJ1ZmZlciwKICAgICAgICAgIGRldGFjaGVkQ2h1bmtzLmJ1ZmZlciwKICAgICAgXSk7CiAgICAgIGxvY2sgPSBmYWxzZTsKICB9OwogIGNvbnN0IHRocm90dGxlZFNvcnQgPSAoKSA9PiB7CiAgICAgIGlmICghc29ydGluZykgewogICAgICAgICAgc29ydGluZyA9IHRydWU7CiAgICAgICAgICBydW5Tb3J0KCk7CiAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHsKICAgICAgICAgICAgICBzb3J0aW5nID0gZmFsc2U7CiAgICAgICAgICAgICAgdGhyb3R0bGVkU29ydCgpOwogICAgICAgICAgfSk7CiAgICAgIH0KICB9OwogIHNlbGYub25tZXNzYWdlID0gKGUpID0+IHsKICAgICAgaWYgKGUuZGF0YS5zb3J0RGF0YSkgewogICAgICAgICAgc29ydERhdGEgPSB7CiAgICAgICAgICAgICAgcG9zaXRpb25zOiBGbG9hdDMyQXJyYXkuZnJvbShlLmRhdGEuc29ydERhdGEucG9zaXRpb25zKSwKICAgICAgICAgICAgICB0cmFuc2Zvcm1zOiBGbG9hdDMyQXJyYXkuZnJvbShlLmRhdGEuc29ydERhdGEudHJhbnNmb3JtcyksCiAgICAgICAgICAgICAgdHJhbnNmb3JtSW5kaWNlczogVWludDMyQXJyYXkuZnJvbShlLmRhdGEuc29ydERhdGEudHJhbnNmb3JtSW5kaWNlcyksCiAgICAgICAgICAgICAgdmVydGV4Q291bnQ6IGUuZGF0YS5zb3J0RGF0YS52ZXJ0ZXhDb3VudCwKICAgICAgICAgIH07CiAgICAgICAgICBhbGxvY2F0ZUJ1ZmZlcnMoKTsKICAgICAgfQogICAgICBpZiAoZS5kYXRhLnZpZXdQcm9qKSB7CiAgICAgICAgICB2aWV3UHJvaiA9IEZsb2F0MzJBcnJheS5mcm9tKGUuZGF0YS52aWV3UHJvaik7CiAgICAgICAgICB0aHJvdHRsZWRTb3J0KCk7CiAgICAgIH0KICB9OwoKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9U29ydFdvcmtlci5qcy5tYXAKCg==\", null, !1);\nclass QF {\n  constructor(U, Q) {\n    this._scene = null, this._camera = null, this._started = !1, this._initialized = !1, this._renderer = U;\n    const F = U.gl;\n    this._program = F.createProgram(), this._passes = Q || [];\n    const l = F.createShader(F.VERTEX_SHADER);\n    F.shaderSource(l, this._getVertexSource()), F.compileShader(l), F.getShaderParameter(l, F.COMPILE_STATUS) || console.error(F.getShaderInfoLog(l));\n    const Z = F.createShader(F.FRAGMENT_SHADER);\n    F.shaderSource(Z, this._getFragmentSource()), F.compileShader(Z), F.getShaderParameter(Z, F.COMPILE_STATUS) || console.error(F.getShaderInfoLog(Z)), F.attachShader(this.program, l), F.attachShader(this.program, Z), F.linkProgram(this.program), F.getProgramParameter(this.program, F.LINK_STATUS) || console.error(F.getProgramInfoLog(this.program)), this.resize = () => {\n      F.useProgram(this._program), this._resize();\n    }, this.initialize = () => {\n      console.assert(!this._initialized, \"ShaderProgram already initialized\"), F.useProgram(this._program), this._initialize();\n      for (const t of this.passes)\n        t.initialize(this);\n      this._initialized = !0, this._started = !0;\n    }, this.render = (t, d) => {\n      F.useProgram(this._program), this._scene === t && this._camera === d || (this.dispose(), this._scene = t, this._camera = d, this.initialize());\n      for (const B of this.passes)\n        B.render();\n      this._render();\n    }, this.dispose = () => {\n      if (this._initialized) {\n        F.useProgram(this._program);\n        for (const t of this.passes)\n          t.dispose();\n        this._dispose(), this._scene = null, this._camera = null, this._initialized = !1;\n      }\n    };\n  }\n  get renderer() {\n    return this._renderer;\n  }\n  get scene() {\n    return this._scene;\n  }\n  get camera() {\n    return this._camera;\n  }\n  get program() {\n    return this._program;\n  }\n  get passes() {\n    return this._passes;\n  }\n  get started() {\n    return this._started;\n  }\n}\nvar tF = XU(\"Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgdmFyIGxvYWRXYXNtID0gKCgpID0+IHsKICAgIAogICAgcmV0dXJuICgKICBmdW5jdGlvbihtb2R1bGVBcmcgPSB7fSkgewoKICB2YXIgTW9kdWxlPW1vZHVsZUFyZzt2YXIgcmVhZHlQcm9taXNlUmVzb2x2ZSxyZWFkeVByb21pc2VSZWplY3Q7TW9kdWxlWyJyZWFkeSJdPW5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PntyZWFkeVByb21pc2VSZXNvbHZlPXJlc29sdmU7cmVhZHlQcm9taXNlUmVqZWN0PXJlamVjdDt9KTt2YXIgbW9kdWxlT3ZlcnJpZGVzPU9iamVjdC5hc3NpZ24oe30sTW9kdWxlKTt2YXIgc2NyaXB0RGlyZWN0b3J5PSIiO2Z1bmN0aW9uIGxvY2F0ZUZpbGUocGF0aCl7aWYoTW9kdWxlWyJsb2NhdGVGaWxlIl0pe3JldHVybiBNb2R1bGVbImxvY2F0ZUZpbGUiXShwYXRoLHNjcmlwdERpcmVjdG9yeSl9cmV0dXJuIHNjcmlwdERpcmVjdG9yeStwYXRofXZhciByZWFkQmluYXJ5O3t7c2NyaXB0RGlyZWN0b3J5PXNlbGYubG9jYXRpb24uaHJlZjt9aWYoc2NyaXB0RGlyZWN0b3J5LnN0YXJ0c1dpdGgoImJsb2I6Iikpe3NjcmlwdERpcmVjdG9yeT0iIjt9ZWxzZSB7c2NyaXB0RGlyZWN0b3J5PXNjcmlwdERpcmVjdG9yeS5zdWJzdHIoMCxzY3JpcHREaXJlY3RvcnkucmVwbGFjZSgvWz8jXS4qLywiIikubGFzdEluZGV4T2YoIi8iKSsxKTt9e3tyZWFkQmluYXJ5PXVybD0+e3ZhciB4aHI9bmV3IFhNTEh0dHBSZXF1ZXN0O3hoci5vcGVuKCJHRVQiLHVybCxmYWxzZSk7eGhyLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiO3hoci5zZW5kKG51bGwpO3JldHVybiBuZXcgVWludDhBcnJheSh4aHIucmVzcG9uc2UpfTt9fX1Nb2R1bGVbInByaW50Il18fGNvbnNvbGUubG9nLmJpbmQoY29uc29sZSk7dmFyIGVycj1Nb2R1bGVbInByaW50RXJyIl18fGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTtPYmplY3QuYXNzaWduKE1vZHVsZSxtb2R1bGVPdmVycmlkZXMpO21vZHVsZU92ZXJyaWRlcz1udWxsO2lmKE1vZHVsZVsiYXJndW1lbnRzIl0pTW9kdWxlWyJhcmd1bWVudHMiXTtpZihNb2R1bGVbInRoaXNQcm9ncmFtIl0pTW9kdWxlWyJ0aGlzUHJvZ3JhbSJdO2lmKE1vZHVsZVsicXVpdCJdKU1vZHVsZVsicXVpdCJdO3ZhciB3YXNtQmluYXJ5O2lmKE1vZHVsZVsid2FzbUJpbmFyeSJdKXdhc21CaW5hcnk9TW9kdWxlWyJ3YXNtQmluYXJ5Il07aWYodHlwZW9mIFdlYkFzc2VtYmx5IT0ib2JqZWN0Iil7YWJvcnQoIm5vIG5hdGl2ZSB3YXNtIHN1cHBvcnQgZGV0ZWN0ZWQiKTt9ZnVuY3Rpb24gaW50QXJyYXlGcm9tQmFzZTY0KHMpe3ZhciBkZWNvZGVkPWF0b2Iocyk7dmFyIGJ5dGVzPW5ldyBVaW50OEFycmF5KGRlY29kZWQubGVuZ3RoKTtmb3IodmFyIGk9MDtpPGRlY29kZWQubGVuZ3RoOysraSl7Ynl0ZXNbaV09ZGVjb2RlZC5jaGFyQ29kZUF0KGkpO31yZXR1cm4gYnl0ZXN9ZnVuY3Rpb24gdHJ5UGFyc2VBc0RhdGFVUkkoZmlsZW5hbWUpe2lmKCFpc0RhdGFVUkkoZmlsZW5hbWUpKXtyZXR1cm59cmV0dXJuIGludEFycmF5RnJvbUJhc2U2NChmaWxlbmFtZS5zbGljZShkYXRhVVJJUHJlZml4Lmxlbmd0aCkpfXZhciB3YXNtTWVtb3J5O3ZhciBBQk9SVD1mYWxzZTt2YXIgSEVBUDgsSEVBUFU4LEhFQVAxNixIRUFQVTE2LEhFQVAzMixIRUFQVTMyLEhFQVBGMzIsSEVBUEY2NDtmdW5jdGlvbiB1cGRhdGVNZW1vcnlWaWV3cygpe3ZhciBiPXdhc21NZW1vcnkuYnVmZmVyO01vZHVsZVsiSEVBUDgiXT1IRUFQOD1uZXcgSW50OEFycmF5KGIpO01vZHVsZVsiSEVBUDE2Il09SEVBUDE2PW5ldyBJbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUFU4Il09SEVBUFU4PW5ldyBVaW50OEFycmF5KGIpO01vZHVsZVsiSEVBUFUxNiJdPUhFQVBVMTY9bmV3IFVpbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUDMyIl09SEVBUDMyPW5ldyBJbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUFUzMiJdPUhFQVBVMzI9bmV3IFVpbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUEYzMiJdPUhFQVBGMzI9bmV3IEZsb2F0MzJBcnJheShiKTtNb2R1bGVbIkhFQVBGNjQiXT1IRUFQRjY0PW5ldyBGbG9hdDY0QXJyYXkoYik7fXZhciBfX0FUUFJFUlVOX189W107dmFyIF9fQVRJTklUX189W107dmFyIF9fQVRQT1NUUlVOX189W107ZnVuY3Rpb24gcHJlUnVuKCl7aWYoTW9kdWxlWyJwcmVSdW4iXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlUnVuIl09PSJmdW5jdGlvbiIpTW9kdWxlWyJwcmVSdW4iXT1bTW9kdWxlWyJwcmVSdW4iXV07d2hpbGUoTW9kdWxlWyJwcmVSdW4iXS5sZW5ndGgpe2FkZE9uUHJlUnVuKE1vZHVsZVsicHJlUnVuIl0uc2hpZnQoKSk7fX1jYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUUFJFUlVOX18pO31mdW5jdGlvbiBpbml0UnVudGltZSgpe2NhbGxSdW50aW1lQ2FsbGJhY2tzKF9fQVRJTklUX18pO31mdW5jdGlvbiBwb3N0UnVuKCl7aWYoTW9kdWxlWyJwb3N0UnVuIl0pe2lmKHR5cGVvZiBNb2R1bGVbInBvc3RSdW4iXT09ImZ1bmN0aW9uIilNb2R1bGVbInBvc3RSdW4iXT1bTW9kdWxlWyJwb3N0UnVuIl1dO3doaWxlKE1vZHVsZVsicG9zdFJ1biJdLmxlbmd0aCl7YWRkT25Qb3N0UnVuKE1vZHVsZVsicG9zdFJ1biJdLnNoaWZ0KCkpO319Y2FsbFJ1bnRpbWVDYWxsYmFja3MoX19BVFBPU1RSVU5fXyk7fWZ1bmN0aW9uIGFkZE9uUHJlUnVuKGNiKXtfX0FUUFJFUlVOX18udW5zaGlmdChjYik7fWZ1bmN0aW9uIGFkZE9uSW5pdChjYil7X19BVElOSVRfXy51bnNoaWZ0KGNiKTt9ZnVuY3Rpb24gYWRkT25Qb3N0UnVuKGNiKXtfX0FUUE9TVFJVTl9fLnVuc2hpZnQoY2IpO312YXIgcnVuRGVwZW5kZW5jaWVzPTA7dmFyIGRlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2Z1bmN0aW9uIGFkZFJ1bkRlcGVuZGVuY3koaWQpe3J1bkRlcGVuZGVuY2llcysrO01vZHVsZVsibW9uaXRvclJ1bkRlcGVuZGVuY2llcyJdPy4ocnVuRGVwZW5kZW5jaWVzKTt9ZnVuY3Rpb24gcmVtb3ZlUnVuRGVwZW5kZW5jeShpZCl7cnVuRGVwZW5kZW5jaWVzLS07TW9kdWxlWyJtb25pdG9yUnVuRGVwZW5kZW5jaWVzIl0/LihydW5EZXBlbmRlbmNpZXMpO2lmKHJ1bkRlcGVuZGVuY2llcz09MCl7aWYoZGVwZW5kZW5jaWVzRnVsZmlsbGVkKXt2YXIgY2FsbGJhY2s9ZGVwZW5kZW5jaWVzRnVsZmlsbGVkO2RlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2NhbGxiYWNrKCk7fX19ZnVuY3Rpb24gYWJvcnQod2hhdCl7TW9kdWxlWyJvbkFib3J0Il0/Lih3aGF0KTt3aGF0PSJBYm9ydGVkKCIrd2hhdCsiKSI7ZXJyKHdoYXQpO0FCT1JUPXRydWU7d2hhdCs9Ii4gQnVpbGQgd2l0aCAtc0FTU0VSVElPTlMgZm9yIG1vcmUgaW5mby4iO3ZhciBlPW5ldyBXZWJBc3NlbWJseS5SdW50aW1lRXJyb3Iod2hhdCk7cmVhZHlQcm9taXNlUmVqZWN0KGUpO3Rocm93IGV9dmFyIGRhdGFVUklQcmVmaXg9ImRhdGE6YXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtO2Jhc2U2NCwiO3ZhciBpc0RhdGFVUkk9ZmlsZW5hbWU9PmZpbGVuYW1lLnN0YXJ0c1dpdGgoZGF0YVVSSVByZWZpeCk7dmFyIHdhc21CaW5hcnlGaWxlO3dhc21CaW5hcnlGaWxlPSJkYXRhOmFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTtiYXNlNjQsQUdGemJRRUFBQUFCWnc5Z0JIOS9mMzhBWUFOL2YzOEFZQVYvZjM5L2Z3QmdCbjkvZjM5L2Z3QmdBWDhCZjJBQmZ3QmdBbjkvQUdBRGYzOS9BWDlnQUFCZ0IzOS9mMzkvZjM4QVlBSjlmUUYvWUFSL2YzNStBR0FCZlFGL1lBdC9mMzkvZjM5L2YzOS9md0JnQW45L0FYOENQUW9CWVFGaEFBRUJZUUZpQUFJQllRRmpBQUVCWVFGa0FBWUJZUUZsQUFFQllRRm1BQWtCWVFGbkFBUUJZUUZvQUFVQllRRnBBQUFCWVFGcUFBWURHeG9IQkFvRkNBVUdDQXNCQUFFRkRBUUVEUU1EQWdJQUFBNEhCd1FGQVhBQkVCQUZCd0VCZ0FLQWdBSUdDQUYvQVVHd25nUUxCeGtHQVdzQ0FBRnNBQTRCYlFBYUFXNEJBQUZ2QUJrQmNBQVBDUlVCQUVFQkN3OFJHQTBXRmlNTkloc2RJQTBjSGg4SzZWQWFjUUVCZnlBQ1JRUkFJQUFvQWdRZ0FTZ0NCRVlQQ3lBQUlBRkdCRUJCQVE4TEFrQWdBQ2dDQkNJQ0xRQUFJZ0JGSUFBZ0FTZ0NCQ0lCTFFBQUlnTkhjZzBBQTBBZ0FTMEFBU0VESUFJdEFBRWlBRVVOQVNBQlFRRnFJUUVnQWtFQmFpRUNJQUFnQTBZTkFBc0xJQUFnQTBZTFR3RUNmMEdvR2lnQ0FDSUJJQUJCQjJwQmVIRWlBbW9oQUFKQUlBSkJBQ0FBSUFGTkcwVUVRQ0FBUHdCQkVIUk5EUUVnQUJBR0RRRUxRYmdhUVRBMkFnQkJmdzhMUWFnYUlBQTJBZ0FnQVFzT0FDQUFFQmNnQVJBWFFSQjBjZ3NHQUNBQUVBOExLUUJCc0JwQkFUWUNBRUcwR2tFQU5nSUFFQkZCdEJwQnJCb29BZ0EyQWdCQnJCcEJzQm8yQWdBTDJRc0JCMzhDUUNBQVJRMEFJQUJCQ0dzaUF5QUFRUVJyS0FJQUlnRkJlSEVpQUdvaEJRSkFJQUZCQVhFTkFDQUJRUUp4UlEwQklBTWdBeWdDQUNJQmF5SURRY3dhS0FJQVNRMEJJQUFnQVdvaEFBSkFBa0JCMEJvb0FnQWdBMGNFUUNBREtBSU1JUUlnQVVIL0FVMEVRQ0FCUVFOMklRRWdBeWdDQ0NJRUlBSkdCRUJCdkJwQnZCb29BZ0JCZmlBQmQzRTJBZ0FNQlFzZ0JDQUNOZ0lNSUFJZ0JEWUNDQXdFQ3lBREtBSVlJUVlnQWlBRFJ3UkFJQU1vQWdnaUFTQUNOZ0lNSUFJZ0FUWUNDQXdEQ3lBREtBSVVJZ0VFZnlBRFFSUnFCU0FES0FJUUlnRkZEUUlnQTBFUWFnc2hCQU5BSUFRaEJ5QUJJZ0pCRkdvaEJDQUNLQUlVSWdFTkFDQUNRUkJxSVFRZ0FpZ0NFQ0lCRFFBTElBZEJBRFlDQUF3Q0N5QUZLQUlFSWdGQkEzRkJBMGNOQWtIRUdpQUFOZ0lBSUFVZ0FVRitjVFlDQkNBRElBQkJBWEkyQWdRZ0JTQUFOZ0lBRHd0QkFDRUNDeUFHUlEwQUFrQWdBeWdDSENJQlFRSjBRZXdjYWlJRUtBSUFJQU5HQkVBZ0JDQUNOZ0lBSUFJTkFVSEFHa0hBR2lnQ0FFRitJQUYzY1RZQ0FBd0NDeUFHUVJCQkZDQUdLQUlRSUFOR0cyb2dBallDQUNBQ1JRMEJDeUFDSUFZMkFoZ2dBeWdDRUNJQkJFQWdBaUFCTmdJUUlBRWdBallDR0FzZ0F5Z0NGQ0lCUlEwQUlBSWdBVFlDRkNBQklBSTJBaGdMSUFNZ0JVOE5BQ0FGS0FJRUlnRkJBWEZGRFFBQ1FBSkFBa0FDUUNBQlFRSnhSUVJBUWRRYUtBSUFJQVZHQkVCQjFCb2dBellDQUVISUdrSElHaWdDQUNBQWFpSUFOZ0lBSUFNZ0FFRUJjallDQkNBRFFkQWFLQUlBUncwR1FjUWFRUUEyQWdCQjBCcEJBRFlDQUE4TFFkQWFLQUlBSUFWR0JFQkIwQm9nQXpZQ0FFSEVHa0hFR2lnQ0FDQUFhaUlBTmdJQUlBTWdBRUVCY2pZQ0JDQUFJQU5xSUFBMkFnQVBDeUFCUVhoeElBQnFJUUFnQlNnQ0RDRUNJQUZCL3dGTkJFQWdBVUVEZGlFQklBVW9BZ2dpQkNBQ1JnUkFRYndhUWJ3YUtBSUFRWDRnQVhkeE5nSUFEQVVMSUFRZ0FqWUNEQ0FDSUFRMkFnZ01CQXNnQlNnQ0dDRUdJQUlnQlVjRVFFSE1HaWdDQUJvZ0JTZ0NDQ0lCSUFJMkFnd2dBaUFCTmdJSURBTUxJQVVvQWhRaUFRUi9JQVZCRkdvRklBVW9BaEFpQVVVTkFpQUZRUkJxQ3lFRUEwQWdCQ0VISUFFaUFrRVVhaUVFSUFJb0FoUWlBUTBBSUFKQkVHb2hCQ0FDS0FJUUlnRU5BQXNnQjBFQU5nSUFEQUlMSUFVZ0FVRitjVFlDQkNBRElBQkJBWEkyQWdRZ0FDQURhaUFBTmdJQURBTUxRUUFoQWdzZ0JrVU5BQUpBSUFVb0Fod2lBVUVDZEVIc0hHb2lCQ2dDQUNBRlJnUkFJQVFnQWpZQ0FDQUNEUUZCd0JwQndCb29BZ0JCZmlBQmQzRTJBZ0FNQWdzZ0JrRVFRUlFnQmlnQ0VDQUZSaHRxSUFJMkFnQWdBa1VOQVFzZ0FpQUdOZ0lZSUFVb0FoQWlBUVJBSUFJZ0FUWUNFQ0FCSUFJMkFoZ0xJQVVvQWhRaUFVVU5BQ0FDSUFFMkFoUWdBU0FDTmdJWUN5QURJQUJCQVhJMkFnUWdBQ0FEYWlBQU5nSUFJQU5CMEJvb0FnQkhEUUJCeEJvZ0FEWUNBQThMSUFCQi93Rk5CRUFnQUVGNGNVSGtHbW9oQVFKL1Fid2FLQUlBSWdSQkFTQUFRUU4yZENJQWNVVUVRRUc4R2lBQUlBUnlOZ0lBSUFFTUFRc2dBU2dDQ0FzaEFDQUJJQU0yQWdnZ0FDQUROZ0lNSUFNZ0FUWUNEQ0FESUFBMkFnZ1BDMEVmSVFJZ0FFSC8vLzhIVFFSQUlBQkJKaUFBUVFoMlp5SUJhM1pCQVhFZ0FVRUJkR3RCUG1vaEFnc2dBeUFDTmdJY0lBTkNBRGNDRUNBQ1FRSjBRZXdjYWlFSEFuOENRQUovUWNBYUtBSUFJZ0ZCQVNBQ2RDSUVjVVVFUUVIQUdpQUJJQVJ5TmdJQVFSZ2hBaUFISVFSQkNBd0JDeUFBUVJrZ0FrRUJkbXRCQUNBQ1FSOUhHM1FoQWlBSEtBSUFJUVFEUUNBRUlnRW9BZ1JCZUhFZ0FFWU5BaUFDUVIxMklRUWdBa0VCZENFQ0lBRWdCRUVFY1dwQkVHb2lCeWdDQUNJRURRQUxRUmdoQWlBQklRUkJDQXNoQUNBRElnRU1BUXNnQVNnQ0NDSUVJQU0yQWd4QkNDRUNJQUZCQ0dvaEIwRVlJUUJCQUFzaEJTQUhJQU0yQWdBZ0FpQURhaUFFTmdJQUlBTWdBVFlDRENBQUlBTnFJQVUyQWdCQjNCcEIzQm9vQWdCQkFXc2lBRUYvSUFBYk5nSUFDd3NoQUNBQkJFQURRQ0FBUVFBNkFBQWdBRUVCYWlFQUlBRkJBV3NpQVEwQUN3c0wzZ01BUWR3WFFZb0pFQWxCNkJkQnVRaEJBVUVBRUFoQjlCZEJ0QWhCQVVHQWYwSC9BQkFCUVl3WVFhMElRUUZCZ0g5Qi93QVFBVUdBR0VHckNFRUJRUUJCL3dFUUFVR1lHRUdKQ0VFQ1FZQ0Fma0gvL3dFUUFVR2tHRUdBQ0VFQ1FRQkIvLzhERUFGQnNCaEJtQWhCQkVHQWdJQ0FlRUgvLy8vL0J4QUJRYndZUVk4SVFRUkJBRUYvRUFGQnlCaEJ4d2hCQkVHQWdJQ0FlRUgvLy8vL0J4QUJRZFFZUWI0SVFRUkJBRUYvRUFGQjRCaEJvd2hDZ0lDQWdJQ0FnSUNBZjBMLy8vLy8vLy8vLy84QUVCSkI3QmhCb2doQ0FFSi9FQkpCK0JoQm5BaEJCQkFFUVlRWlFZTUpRUWdRQkVIMERrSFpDQkFEUWJ3UFFZY05FQU5CaEJCQkJFSE1DQkFDUWRBUVFRSkI1UWdRQWtHY0VVRUVRZlFJRUFKQnVCRVFCMEhnRVVFQVFjSU1FQUJCaUJKQkFFR29EUkFBUWJBU1FRRkI0QXdRQUVIWUVrRUNRWThKRUFCQmdCTkJBMEd1Q1JBQVFhZ1RRUVJCMWdrUUFFSFFFMEVGUWZNSkVBQkIrQk5CQkVITkRSQUFRYUFVUVFWQjZ3MFFBRUdJRWtFQVFka0tFQUJCc0JKQkFVRzRDaEFBUWRnU1FRSkJtd3NRQUVHQUUwRURRZmtLRUFCQnFCTkJCRUdoREJBQVFkQVRRUVZCL3dzUUFFSElGRUVJUWQ0TEVBQkI4QlJCQ1VHOEN4QUFRWmdWUVFaQm1Rb1FBRUhBRlVFSFFaSU9FQUFMSEFBZ0FDQUJRUWdnQXFjZ0FrSWdpS2NnQTZjZ0EwSWdpS2NRQlFzZ0FBSkFJQUFvQWdRZ0FVY05BQ0FBS0FJY1FRRkdEUUFnQUNBQ05nSWNDd3VhQVFBZ0FFRUJPZ0ExQWtBZ0FDZ0NCQ0FDUncwQUlBQkJBVG9BTkFKQUlBQW9BaEFpQWtVRVFDQUFRUUUyQWlRZ0FDQUROZ0lZSUFBZ0FUWUNFQ0FEUVFGSERRSWdBQ2dDTUVFQlJnMEJEQUlMSUFFZ0FrWUVRQ0FBS0FJWUlnSkJBa1lFUUNBQUlBTTJBaGdnQXlFQ0N5QUFLQUl3UVFGSERRSWdBa0VCUmcwQkRBSUxJQUFnQUNnQ0pFRUJhallDSkFzZ0FFRUJPZ0EyQ3d0ZEFRRi9JQUFvQWhBaUEwVUVRQ0FBUVFFMkFpUWdBQ0FDTmdJWUlBQWdBVFlDRUE4TEFrQWdBU0FEUmdSQUlBQW9BaGhCQWtjTkFTQUFJQUkyQWhnUEN5QUFRUUU2QURZZ0FFRUNOZ0lZSUFBZ0FDZ0NKRUVCYWpZQ0pBc0xBZ0FMZHdFRWZ5QUF2Q0lFUWYvLy93TnhJUUVDUUNBRVFSZDJRZjhCY1NJQ1JRMEFJQUpCOEFCTkJFQWdBVUdBZ0lBRWNrSHhBQ0FDYTNZaEFRd0JDeUFDUVkwQlN3UkFRWUQ0QVNFRFFRQWhBUXdCQ3lBQ1FRcDBRWUNBQjJzaEF3c2dBeUFFUVJCMlFZQ0FBbkZ5SUFGQkRYWnlRZi8vQTNFTEJBQWdBQXZYSndFTWZ5TUFRUkJySWdva0FBSkFBa0FDUUFKQUFrQUNRQUpBQWtBQ1FBSkFJQUJCOUFGTkJFQkJ2Qm9vQWdBaUJFRVFJQUJCQzJwQitBTnhJQUJCQzBrYklnWkJBM1lpQUhZaUFVRURjUVJBQWtBZ0FVRi9jMEVCY1NBQWFpSUNRUU4wSWdGQjVCcHFJZ0FnQVVIc0dtb29BZ0FpQVNnQ0NDSUZSZ1JBUWJ3YUlBUkJmaUFDZDNFMkFnQU1BUXNnQlNBQU5nSU1JQUFnQlRZQ0NBc2dBVUVJYWlFQUlBRWdBa0VEZENJQ1FRTnlOZ0lFSUFFZ0Ftb2lBU0FCS0FJRVFRRnlOZ0lFREFzTElBWkJ4Qm9vQWdBaUNFME5BU0FCQkVBQ1FFRUNJQUIwSWdKQkFDQUNhM0lnQVNBQWRIRm9JZ0ZCQTNRaUFFSGtHbW9pQWlBQVFld2FhaWdDQUNJQUtBSUlJZ1ZHQkVCQnZCb2dCRUYrSUFGM2NTSUVOZ0lBREFFTElBVWdBallDRENBQ0lBVTJBZ2dMSUFBZ0JrRURjallDQkNBQUlBWnFJZ2NnQVVFRGRDSUJJQVpySWdWQkFYSTJBZ1FnQUNBQmFpQUZOZ0lBSUFnRVFDQUlRWGh4UWVRYWFpRUJRZEFhS0FJQUlRSUNmeUFFUVFFZ0NFRURkblFpQTNGRkJFQkJ2Qm9nQXlBRWNqWUNBQ0FCREFFTElBRW9BZ2dMSVFNZ0FTQUNOZ0lJSUFNZ0FqWUNEQ0FDSUFFMkFnd2dBaUFETmdJSUN5QUFRUWhxSVFCQjBCb2dCellDQUVIRUdpQUZOZ0lBREFzTFFjQWFLQUlBSWd0RkRRRWdDMmhCQW5SQjdCeHFLQUlBSWdJb0FnUkJlSEVnQm1zaEF5QUNJUUVEUUFKQUlBRW9BaEFpQUVVRVFDQUJLQUlVSWdCRkRRRUxJQUFvQWdSQmVIRWdCbXNpQVNBRElBRWdBMGtpQVJzaEF5QUFJQUlnQVJzaEFpQUFJUUVNQVFzTElBSW9BaGdoQ1NBQ0lBSW9BZ3dpQUVjRVFFSE1HaWdDQUJvZ0FpZ0NDQ0lCSUFBMkFnd2dBQ0FCTmdJSURBb0xJQUlvQWhRaUFRUi9JQUpCRkdvRklBSW9BaEFpQVVVTkF5QUNRUkJxQ3lFRkEwQWdCU0VISUFFaUFFRVVhaUVGSUFBb0FoUWlBUTBBSUFCQkVHb2hCU0FBS0FJUUlnRU5BQXNnQjBFQU5nSUFEQWtMUVg4aEJpQUFRYjkvU3cwQUlBQkJDMm9pQUVGNGNTRUdRY0FhS0FJQUlnZEZEUUJCQUNBR2F5RURBa0FDUUFKQUFuOUJBQ0FHUVlBQ1NRMEFHa0VmSUFaQi8vLy9CMHNOQUJvZ0JrRW1JQUJCQ0habklnQnJka0VCY1NBQVFRRjBhMEUrYWdzaUNFRUNkRUhzSEdvb0FnQWlBVVVFUUVFQUlRQU1BUXRCQUNFQUlBWkJHU0FJUVFGMmEwRUFJQWhCSDBjYmRDRUNBMEFDUUNBQktBSUVRWGh4SUFacklnUWdBMDhOQUNBQklRVWdCQ0lERFFCQkFDRURJQUVoQUF3REN5QUFJQUVvQWhRaUJDQUVJQUVnQWtFZGRrRUVjV29vQWhBaUFVWWJJQUFnQkJzaEFDQUNRUUYwSVFJZ0FRMEFDd3NnQUNBRmNrVUVRRUVBSVFWQkFpQUlkQ0lBUVFBZ0FHdHlJQWR4SWdCRkRRTWdBR2hCQW5SQjdCeHFLQUlBSVFBTElBQkZEUUVMQTBBZ0FDZ0NCRUY0Y1NBR2F5SUNJQU5KSVFFZ0FpQURJQUViSVFNZ0FDQUZJQUViSVFVZ0FDZ0NFQ0lCQkg4Z0FRVWdBQ2dDRkFzaUFBMEFDd3NnQlVVTkFDQURRY1FhS0FJQUlBWnJUdzBBSUFVb0FoZ2hDQ0FGSUFVb0Fnd2lBRWNFUUVITUdpZ0NBQm9nQlNnQ0NDSUJJQUEyQWd3Z0FDQUJOZ0lJREFnTElBVW9BaFFpQVFSL0lBVkJGR29GSUFVb0FoQWlBVVVOQXlBRlFSQnFDeUVDQTBBZ0FpRUVJQUVpQUVFVWFpRUNJQUFvQWhRaUFRMEFJQUJCRUdvaEFpQUFLQUlRSWdFTkFBc2dCRUVBTmdJQURBY0xJQVpCeEJvb0FnQWlCVTBFUUVIUUdpZ0NBQ0VBQWtBZ0JTQUdheUlCUVJCUEJFQWdBQ0FHYWlJQ0lBRkJBWEkyQWdRZ0FDQUZhaUFCTmdJQUlBQWdCa0VEY2pZQ0JBd0JDeUFBSUFWQkEzSTJBZ1FnQUNBRmFpSUJJQUVvQWdSQkFYSTJBZ1JCQUNFQ1FRQWhBUXRCeEJvZ0FUWUNBRUhRR2lBQ05nSUFJQUJCQ0dvaEFBd0pDeUFHUWNnYUtBSUFJZ0pKQkVCQnlCb2dBaUFHYXlJQk5nSUFRZFFhUWRRYUtBSUFJZ0FnQm1vaUFqWUNBQ0FDSUFGQkFYSTJBZ1FnQUNBR1FRTnlOZ0lFSUFCQkNHb2hBQXdKQzBFQUlRQWdCa0V2YWlJREFuOUJsQjRvQWdBRVFFR2NIaWdDQUF3QkMwR2dIa0ovTndJQVFaZ2VRb0NnZ0lDQWdBUTNBZ0JCbEI0Z0NrRU1ha0Z3Y1VIWXF0V3FCWE0yQWdCQnFCNUJBRFlDQUVINEhVRUFOZ0lBUVlBZ0N5SUJhaUlFUVFBZ0FXc2lCM0VpQVNBR1RRMElRZlFkS0FJQUlnVUVRRUhzSFNnQ0FDSUlJQUZxSWdrZ0NFMGdCU0FKU1hJTkNRc0NRRUg0SFMwQUFFRUVjVVVFUUFKQUFrQUNRQUpBUWRRYUtBSUFJZ1VFUUVIOEhTRUFBMEFnQlNBQUtBSUFJZ2hQQkVBZ0NDQUFLQUlFYWlBRlN3MERDeUFBS0FJSUlnQU5BQXNMUVFBUUN5SUNRWDlHRFFNZ0FTRUVRWmdlS0FJQUlnQkJBV3NpQlNBQ2NRUkFJQUVnQW1zZ0FpQUZha0VBSUFCcmNXb2hCQXNnQkNBR1RRMERRZlFkS0FJQUlnQUVRRUhzSFNnQ0FDSUZJQVJxSWdjZ0JVMGdBQ0FIU1hJTkJBc2dCQkFMSWdBZ0FrY05BUXdGQ3lBRUlBSnJJQWR4SWdRUUN5SUNJQUFvQWdBZ0FDZ0NCR3BHRFFFZ0FpRUFDeUFBUVg5R0RRRWdCa0V3YWlBRVRRUkFJQUFoQWd3RUMwR2NIaWdDQUNJQ0lBTWdCR3RxUVFBZ0FtdHhJZ0lRQzBGL1JnMEJJQUlnQkdvaEJDQUFJUUlNQXdzZ0FrRi9SdzBDQzBINEhVSDRIU2dDQUVFRWNqWUNBQXNnQVJBTElnSkJmMFpCQUJBTElnQkJmMFp5SUFBZ0FrMXlEUVVnQUNBQ2F5SUVJQVpCS0dwTkRRVUxRZXdkUWV3ZEtBSUFJQVJxSWdBMkFnQkI4QjBvQWdBZ0FFa0VRRUh3SFNBQU5nSUFDd0pBUWRRYUtBSUFJZ01FUUVIOEhTRUFBMEFnQWlBQUtBSUFJZ0VnQUNnQ0JDSUZha1lOQWlBQUtBSUlJZ0FOQUFzTUJBdEJ6Qm9vQWdBaUFFRUFJQUFnQWswYlJRUkFRY3dhSUFJMkFnQUxRUUFoQUVHQUhpQUVOZ0lBUWZ3ZElBSTJBZ0JCM0JwQmZ6WUNBRUhnR2tHVUhpZ0NBRFlDQUVHSUhrRUFOZ0lBQTBBZ0FFRURkQ0lCUWV3YWFpQUJRZVFhYWlJRk5nSUFJQUZCOEJwcUlBVTJBZ0FnQUVFQmFpSUFRU0JIRFFBTFFjZ2FJQVJCS0dzaUFFRjRJQUpyUVFkeElnRnJJZ1UyQWdCQjFCb2dBU0FDYWlJQk5nSUFJQUVnQlVFQmNqWUNCQ0FBSUFKcVFTZzJBZ1JCMkJwQnBCNG9BZ0EyQWdBTUJBc2dBaUFEVFNBQklBTkxjZzBDSUFBb0FneEJDSEVOQWlBQUlBUWdCV28yQWdSQjFCb2dBMEY0SUFOclFRZHhJZ0JxSWdFMkFnQkJ5QnBCeUJvb0FnQWdCR29pQWlBQWF5SUFOZ0lBSUFFZ0FFRUJjallDQkNBQ0lBTnFRU2cyQWdSQjJCcEJwQjRvQWdBMkFnQU1Bd3RCQUNFQURBWUxRUUFoQUF3RUMwSE1HaWdDQUNBQ1N3UkFRY3dhSUFJMkFnQUxJQUlnQkdvaEFVSDhIU0VBQWtBRFFDQUJJQUFvQWdCSEJFQWdBQ2dDQ0NJQURRRU1BZ3NMSUFBdEFBeEJDSEZGRFFNTFFmd2RJUUFEUUFKQUlBTWdBQ2dDQUNJQlR3UkFJQUVnQUNnQ0JHb2lCU0FEU3cwQkN5QUFLQUlJSVFBTUFRc0xRY2dhSUFSQktHc2lBRUY0SUFKclFRZHhJZ0ZySWdjMkFnQkIxQm9nQVNBQ2FpSUJOZ0lBSUFFZ0IwRUJjallDQkNBQUlBSnFRU2cyQWdSQjJCcEJwQjRvQWdBMkFnQWdBeUFGUVNjZ0JXdEJCM0ZxUVM5cklnQWdBQ0FEUVJCcVNSc2lBVUViTmdJRUlBRkJoQjRwQWdBM0FoQWdBVUg4SFNrQ0FEY0NDRUdFSGlBQlFRaHFOZ0lBUVlBZUlBUTJBZ0JCL0IwZ0FqWUNBRUdJSGtFQU5nSUFJQUZCR0dvaEFBTkFJQUJCQnpZQ0JDQUFRUWhxSVF3Z0FFRUVhaUVBSUF3Z0JVa05BQXNnQVNBRFJnMEFJQUVnQVNnQ0JFRitjVFlDQkNBRElBRWdBMnNpQWtFQmNqWUNCQ0FCSUFJMkFnQUNmeUFDUWY4QlRRUkFJQUpCZUhGQjVCcHFJUUFDZjBHOEdpZ0NBQ0lCUVFFZ0FrRURkblFpQW5GRkJFQkJ2Qm9nQVNBQ2NqWUNBQ0FBREFFTElBQW9BZ2dMSVFFZ0FDQUROZ0lJSUFFZ0F6WUNERUVNSVFKQkNBd0JDMEVmSVFBZ0FrSC8vLzhIVFFSQUlBSkJKaUFDUVFoMlp5SUFhM1pCQVhFZ0FFRUJkR3RCUG1vaEFBc2dBeUFBTmdJY0lBTkNBRGNDRUNBQVFRSjBRZXdjYWlFQkFrQUNRRUhBR2lnQ0FDSUZRUUVnQUhRaUJIRkZCRUJCd0JvZ0JDQUZjallDQUNBQklBTTJBZ0FNQVFzZ0FrRVpJQUJCQVhaclFRQWdBRUVmUnh0MElRQWdBU2dDQUNFRkEwQWdCU0lCS0FJRVFYaHhJQUpHRFFJZ0FFRWRkaUVGSUFCQkFYUWhBQ0FCSUFWQkJIRnFJZ1FvQWhBaUJRMEFDeUFFSUFNMkFoQUxJQU1nQVRZQ0dFRUlJUUlnQXlJQklRQkJEQXdCQ3lBQktBSUlJZ0FnQXpZQ0RDQUJJQU0yQWdnZ0F5QUFOZ0lJUVFBaEFFRVlJUUpCREFzZ0Eyb2dBVFlDQUNBQ0lBTnFJQUEyQWdBTFFjZ2FLQUlBSWdBZ0JrME5BRUhJR2lBQUlBWnJJZ0UyQWdCQjFCcEIxQm9vQWdBaUFDQUdhaUlDTmdJQUlBSWdBVUVCY2pZQ0JDQUFJQVpCQTNJMkFnUWdBRUVJYWlFQURBUUxRYmdhUVRBMkFnQkJBQ0VBREFNTElBQWdBallDQUNBQUlBQW9BZ1FnQkdvMkFnUWdBa0Y0SUFKclFRZHhhaUlJSUFaQkEzSTJBZ1FnQVVGNElBRnJRUWR4YWlJRUlBWWdDR29pQTJzaEJ3SkFRZFFhS0FJQUlBUkdCRUJCMUJvZ0F6WUNBRUhJR2tISUdpZ0NBQ0FIYWlJQU5nSUFJQU1nQUVFQmNqWUNCQXdCQzBIUUdpZ0NBQ0FFUmdSQVFkQWFJQU0yQWdCQnhCcEJ4Qm9vQWdBZ0Iyb2lBRFlDQUNBRElBQkJBWEkyQWdRZ0FDQURhaUFBTmdJQURBRUxJQVFvQWdRaUFFRURjVUVCUmdSQUlBQkJlSEVoQ1NBRUtBSU1JUUlDUUNBQVFmOEJUUVJBSUFRb0FnZ2lBU0FDUmdSQVFid2FRYndhS0FJQVFYNGdBRUVEZG5keE5nSUFEQUlMSUFFZ0FqWUNEQ0FDSUFFMkFnZ01BUXNnQkNnQ0dDRUdBa0FnQWlBRVJ3UkFRY3dhS0FJQUdpQUVLQUlJSWdBZ0FqWUNEQ0FDSUFBMkFnZ01BUXNDUUNBRUtBSVVJZ0FFZnlBRVFSUnFCU0FFS0FJUUlnQkZEUUVnQkVFUWFnc2hBUU5BSUFFaEJTQUFJZ0pCRkdvaEFTQUFLQUlVSWdBTkFDQUNRUkJxSVFFZ0FpZ0NFQ0lBRFFBTElBVkJBRFlDQUF3QkMwRUFJUUlMSUFaRkRRQUNRQ0FFS0FJY0lnQkJBblJCN0J4cUlnRW9BZ0FnQkVZRVFDQUJJQUkyQWdBZ0FnMEJRY0FhUWNBYUtBSUFRWDRnQUhkeE5nSUFEQUlMSUFaQkVFRVVJQVlvQWhBZ0JFWWJhaUFDTmdJQUlBSkZEUUVMSUFJZ0JqWUNHQ0FFS0FJUUlnQUVRQ0FDSUFBMkFoQWdBQ0FDTmdJWUN5QUVLQUlVSWdCRkRRQWdBaUFBTmdJVUlBQWdBallDR0FzZ0J5QUphaUVISUFRZ0NXb2lCQ2dDQkNFQUN5QUVJQUJCZm5FMkFnUWdBeUFIUVFGeU5nSUVJQU1nQjJvZ0J6WUNBQ0FIUWY4QlRRUkFJQWRCZUhGQjVCcHFJUUFDZjBHOEdpZ0NBQ0lCUVFFZ0IwRURkblFpQW5GRkJFQkJ2Qm9nQVNBQ2NqWUNBQ0FBREFFTElBQW9BZ2dMSVFFZ0FDQUROZ0lJSUFFZ0F6WUNEQ0FESUFBMkFnd2dBeUFCTmdJSURBRUxRUjhoQWlBSFFmLy8vd2ROQkVBZ0IwRW1JQWRCQ0habklnQnJka0VCY1NBQVFRRjBhMEUrYWlFQ0N5QURJQUkyQWh3Z0EwSUFOd0lRSUFKQkFuUkI3QnhxSVFBQ1FBSkFRY0FhS0FJQUlnRkJBU0FDZENJRmNVVUVRRUhBR2lBQklBVnlOZ0lBSUFBZ0F6WUNBQXdCQ3lBSFFSa2dBa0VCZG10QkFDQUNRUjlIRzNRaEFpQUFLQUlBSVFFRFFDQUJJZ0FvQWdSQmVIRWdCMFlOQWlBQ1FSMTJJUUVnQWtFQmRDRUNJQUFnQVVFRWNXb2lCU2dDRUNJQkRRQUxJQVVnQXpZQ0VBc2dBeUFBTmdJWUlBTWdBellDRENBRElBTTJBZ2dNQVFzZ0FDZ0NDQ0lCSUFNMkFnd2dBQ0FETmdJSUlBTkJBRFlDR0NBRElBQTJBZ3dnQXlBQk5nSUlDeUFJUVFocUlRQU1BZ3NDUUNBSVJRMEFBa0FnQlNnQ0hDSUJRUUowUWV3Y2FpSUNLQUlBSUFWR0JFQWdBaUFBTmdJQUlBQU5BVUhBR2lBSFFYNGdBWGR4SWdjMkFnQU1BZ3NnQ0VFUVFSUWdDQ2dDRUNBRlJodHFJQUEyQWdBZ0FFVU5BUXNnQUNBSU5nSVlJQVVvQWhBaUFRUkFJQUFnQVRZQ0VDQUJJQUEyQWhnTElBVW9BaFFpQVVVTkFDQUFJQUUyQWhRZ0FTQUFOZ0lZQ3dKQUlBTkJEMDBFUUNBRklBTWdCbW9pQUVFRGNqWUNCQ0FBSUFWcUlnQWdBQ2dDQkVFQmNqWUNCQXdCQ3lBRklBWkJBM0kyQWdRZ0JTQUdhaUlFSUFOQkFYSTJBZ1FnQXlBRWFpQUROZ0lBSUFOQi93Rk5CRUFnQTBGNGNVSGtHbW9oQUFKL1Fid2FLQUlBSWdGQkFTQURRUU4yZENJQ2NVVUVRRUc4R2lBQklBSnlOZ0lBSUFBTUFRc2dBQ2dDQ0FzaEFTQUFJQVEyQWdnZ0FTQUVOZ0lNSUFRZ0FEWUNEQ0FFSUFFMkFnZ01BUXRCSHlFQUlBTkIvLy8vQjAwRVFDQURRU1lnQTBFSWRtY2lBR3QyUVFGeElBQkJBWFJyUVQ1cUlRQUxJQVFnQURZQ0hDQUVRZ0EzQWhBZ0FFRUNkRUhzSEdvaEFRSkFBa0FnQjBFQklBQjBJZ0p4UlFSQVFjQWFJQUlnQjNJMkFnQWdBU0FFTmdJQUlBUWdBVFlDR0F3QkN5QURRUmtnQUVFQmRtdEJBQ0FBUVI5SEczUWhBQ0FCS0FJQUlRRURRQ0FCSWdJb0FnUkJlSEVnQTBZTkFpQUFRUjEySVFFZ0FFRUJkQ0VBSUFJZ0FVRUVjV29pQnlnQ0VDSUJEUUFMSUFjZ0JEWUNFQ0FFSUFJMkFoZ0xJQVFnQkRZQ0RDQUVJQVEyQWdnTUFRc2dBaWdDQ0NJQUlBUTJBZ3dnQWlBRU5nSUlJQVJCQURZQ0dDQUVJQUkyQWd3Z0JDQUFOZ0lJQ3lBRlFRaHFJUUFNQVFzQ1FDQUpSUTBBQWtBZ0FpZ0NIQ0lCUVFKMFFld2NhaUlGS0FJQUlBSkdCRUFnQlNBQU5nSUFJQUFOQVVIQUdpQUxRWDRnQVhkeE5nSUFEQUlMSUFsQkVFRVVJQWtvQWhBZ0FrWWJhaUFBTmdJQUlBQkZEUUVMSUFBZ0NUWUNHQ0FDS0FJUUlnRUVRQ0FBSUFFMkFoQWdBU0FBTmdJWUN5QUNLQUlVSWdGRkRRQWdBQ0FCTmdJVUlBRWdBRFlDR0FzQ1FDQURRUTlOQkVBZ0FpQURJQVpxSWdCQkEzSTJBZ1FnQUNBQ2FpSUFJQUFvQWdSQkFYSTJBZ1FNQVFzZ0FpQUdRUU55TmdJRUlBSWdCbW9pQlNBRFFRRnlOZ0lFSUFNZ0JXb2dBellDQUNBSUJFQWdDRUY0Y1VIa0dtb2hBRUhRR2lnQ0FDRUJBbjlCQVNBSVFRTjJkQ0lISUFSeFJRUkFRYndhSUFRZ0IzSTJBZ0FnQUF3QkN5QUFLQUlJQ3lFRUlBQWdBVFlDQ0NBRUlBRTJBZ3dnQVNBQU5nSU1JQUVnQkRZQ0NBdEIwQm9nQlRZQ0FFSEVHaUFETmdJQUN5QUNRUWhxSVFBTElBcEJFR29rQUNBQUM2a0xBZ3QvQ1gwakFFR2dBV3NpQ3lRQUlBdEJNR3BCSkJBUUEwQWdBU0FOUndSQUlBSWdEVUVEYkNJTVFRSnFRUUowSWc1cUtnSUFJUmNnQWlBTVFRRnFRUUowSWc5cUtnSUFJUmdnQ0NBTVFRSjBJaEJxSUFJZ0VHb3FBZ0FpR1RnQ0FDQUlJQTlxSUJnNEFnQWdDQ0FPYWlBWE9BSUFJQWNnRFVFRmRHb2lEQ0FZT0FJRUlBd2dHVGdDQUNBTUlCYzRBZ2dnREVFQU5nSU1Ba0FnQUVVRVFDQUdJQTFxTFFBQVJRMEJDeUFNUVlDQWdBZzJBZ3dMSUFjZ0RVRUZkR29pRVNBRklBMUJBblFpREVFQmNpSVNhaTBBQUVFSWRDQUZJQXhxTFFBQWNpQUZJQXhCQW5JaUUyb3RBQUJCRUhSeUlBVWdERUVEY2lJTWFpMEFBRUVZZEhJMkFod2dDeUFESUJKQkFuUWlFbW9xQWdBaUZ6Z0NrQUVnQ3lBRElCTkJBblFpRTJvcUFnQWlHRGdDbEFFZ0N5QURJQXhCQW5RaUZHb3FBZ0FpR1RnQ21BRWdDeUFESUExQkJIUWlGV29xQWdDTUlobzRBcHdCSUF0QjRBQnFJZ3dnQ3lvQ21BRWlGa01BQUFEQWxDQVdsQ0FMS2dLVUFTSVdRd0FBQU1DVUlCYVVRd0FBZ0QrU2tqZ0NBQ0FNSUFzcUFwQUJJaFlnRnBJZ0N5b0NsQUdVSUFzcUFwZ0JRd0FBQU1DVUlBc3FBcHdCbEpJNEFnUWdEQ0FMS2dLUUFTSVdJQmFTSUFzcUFwZ0JsQ0FMS2dLVUFTSVdJQmFTSUFzcUFwd0JsSkk0QWdnZ0RDQUxLZ0tRQVNJV0lCYVNJQXNxQXBRQmxDQUxLZ0tZQVNJV0lCYVNJQXNxQXB3QmxKSTRBZ3dnRENBTEtnS1lBU0lXUXdBQUFNQ1VJQmFVSUFzcUFwQUJJaFpEQUFBQXdKUWdGcFJEQUFDQVA1S1NPQUlRSUF3Z0N5b0NsQUVpRmlBV2tpQUxLZ0tZQVpRZ0N5b0NrQUZEQUFBQXdKUWdDeW9DbkFHVWtqZ0NGQ0FNSUFzcUFwQUJJaFlnRnBJZ0N5b0NtQUdVSUFzcUFwUUJRd0FBQU1DVUlBc3FBcHdCbEpJNEFoZ2dEQ0FMS2dLVUFTSVdJQmFTSUFzcUFwZ0JsQ0FMS2dLUUFTSVdJQmFTSUFzcUFwd0JsSkk0QWh3Z0RDQUxLZ0tVQVNJV1F3QUFBTUNVSUJhVUlBc3FBcEFCSWhaREFBQUF3SlFnRnBSREFBQ0FQNUtTT0FJZ0lBa2dGV29nRnpnQ0FDQUpJQkpxSUJnNEFnQWdDU0FUYWlBWk9BSUFJQWtnRkdvZ0dqZ0NBQ0FMSUFRZ0VHb3FBZ0FpRnpnQ01DQUxJQVFnRDJvcUFnQWlHRGdDUUNBTElBUWdEbW9xQWdBaUdUZ0NVQ0FLSUJCcUlCYzRBZ0FnQ2lBUGFpQVlPQUlBSUFvZ0Rtb2dHVGdDQUNBTElBd3FBaGdnQ3lvQ09KUWdEQ29DQUNBTEtnSXdsQ0FNS2dJTUlBc3FBalNVa3BJNEFnQWdDeUFNS2dJY0lBc3FBamlVSUF3cUFnUWdDeW9DTUpRZ0RDb0NFQ0FMS2dJMGxKS1NPQUlFSUFzZ0RDb0NJQ0FMS2dJNGxDQU1LZ0lJSUFzcUFqQ1VJQXdxQWhRZ0N5b0NOSlNTa2pnQ0NDQUxJQXdxQWhnZ0N5b0NSSlFnRENvQ0FDQUxLZ0k4bENBTUtnSU1JQXNxQWtDVWtwSTRBZ3dnQ3lBTUtnSWNJQXNxQWtTVUlBd3FBZ1FnQ3lvQ1BKUWdEQ29DRUNBTEtnSkFsSktTT0FJUUlBc2dEQ29DSUNBTEtnSkVsQ0FNS2dJSUlBc3FBanlVSUF3cUFoUWdDeW9DUUpTU2tqZ0NGQ0FMSUF3cUFoZ2dDeW9DVUpRZ0RDb0NBQ0FMS2dKSWxDQU1LZ0lNSUFzcUFreVVrcEk0QWhnZ0N5QU1LZ0ljSUFzcUFsQ1VJQXdxQWdRZ0N5b0NTSlFnRENvQ0VDQUxLZ0pNbEpLU09BSWNJQXNnRENvQ0lDQUxLZ0pRbENBTUtnSUlJQXNxQWtpVUlBd3FBaFFnQ3lvQ1RKU1NramdDSUNBTEtnSWdJUmNnQ3lvQ0NDRVlJQXNxQWhRaEdTQVJJQXNxQWhnaUdpQWFsQ0FMS2dJQUloWWdGcFFnQ3lvQ0RDSWJJQnVVa3BKREFBQ0FRSlFnR2lBTEtnSWNJaHlVSUJZZ0N5b0NCQ0lkbENBYklBc3FBaEFpSHBTU2trTUFBSUJBbEJBTU5nSVFJQkVnR2lBWGxDQVdJQmlVSUJzZ0daU1Nra01BQUlCQWxDQWNJQnlVSUIwZ0haUWdIaUFlbEpLU1F3QUFnRUNVRUF3MkFoUWdFU0FjSUJlVUlCMGdHSlFnSGlBWmxKS1NRd0FBZ0VDVUlCY2dGNVFnR0NBWWxDQVpJQm1Va3BKREFBQ0FRSlFRRERZQ0dDQU5RUUZxSVEwTUFRc0xJQXRCb0FGcUpBQUxHZ0FnQUNBQktBSUlJQVVRQ2dSQUlBRWdBaUFESUFRUUZBc0xOd0FnQUNBQktBSUlJQVVRQ2dSQUlBRWdBaUFESUFRUUZBOExJQUFvQWdnaUFDQUJJQUlnQXlBRUlBVWdBQ2dDQUNnQ0ZCRURBQXVSQVFBZ0FDQUJLQUlJSUFRUUNnUkFJQUVnQWlBREVCTVBDd0pBSUFBZ0FTZ0NBQ0FFRUFwRkRRQUNRQ0FDSUFFb0FoQkhCRUFnQVNnQ0ZDQUNSdzBCQ3lBRFFRRkhEUUVnQVVFQk5nSWdEd3NnQVNBQ05nSVVJQUVnQXpZQ0lDQUJJQUVvQWloQkFXbzJBaWdDUUNBQktBSWtRUUZIRFFBZ0FTZ0NHRUVDUncwQUlBRkJBVG9BTmdzZ0FVRUVOZ0lzQ3d2eUFRQWdBQ0FCS0FJSUlBUVFDZ1JBSUFFZ0FpQURFQk1QQ3dKQUlBQWdBU2dDQUNBRUVBb0VRQUpBSUFJZ0FTZ0NFRWNFUUNBQktBSVVJQUpIRFFFTElBTkJBVWNOQWlBQlFRRTJBaUFQQ3lBQklBTTJBaUFDUUNBQktBSXNRUVJHRFFBZ0FVRUFPd0UwSUFBb0FnZ2lBQ0FCSUFJZ0FrRUJJQVFnQUNnQ0FDZ0NGQkVEQUNBQkxRQTFCRUFnQVVFRE5nSXNJQUV0QURSRkRRRU1Bd3NnQVVFRU5nSXNDeUFCSUFJMkFoUWdBU0FCS0FJb1FRRnFOZ0lvSUFFb0FpUkJBVWNOQVNBQktBSVlRUUpIRFFFZ0FVRUJPZ0EyRHdzZ0FDZ0NDQ0lBSUFFZ0FpQURJQVFnQUNnQ0FDZ0NHQkVDQUFzTE1RQWdBQ0FCS0FJSVFRQVFDZ1JBSUFFZ0FpQURFQlVQQ3lBQUtBSUlJZ0FnQVNBQ0lBTWdBQ2dDQUNnQ0hCRUFBQXNZQUNBQUlBRW9BZ2hCQUJBS0JFQWdBU0FDSUFNUUZRc0xnQU1CQkg4akFFSHdBR3NpQWlRQUlBQW9BZ0FpQTBFRWF5Z0NBQ0VFSUFOQkNHc29BZ0FoQlNBQ1FnQTNBbEFnQWtJQU53SllJQUpDQURjQ1lDQUNRZ0EzQUdjZ0FrSUFOd0pJSUFKQkFEWUNSQ0FDUWV3Vk5nSkFJQUlnQURZQ1BDQUNJQUUyQWpnZ0FDQUZhaUVEQWtBZ0JDQUJRUUFRQ2dSQVFRQWdBeUFGR3lFQURBRUxJQUFnQTA0RVFDQUNRZ0EzQUM4Z0FrSUFOd0lZSUFKQ0FEY0NJQ0FDUWdBM0FpZ2dBa0lBTndJUUlBSkJBRFlDRENBQ0lBRTJBZ2dnQWlBQU5nSUVJQUlnQkRZQ0FDQUNRUUUyQWpBZ0JDQUNJQU1nQTBFQlFRQWdCQ2dDQUNnQ0ZCRURBQ0FDS0FJWURRRUxRUUFoQUNBRUlBSkJPR29nQTBFQlFRQWdCQ2dDQUNnQ0dCRUNBQUpBQWtBZ0FpZ0NYQTRDQUFFQ0N5QUNLQUpNUVFBZ0FpZ0NXRUVCUmh0QkFDQUNLQUpVUVFGR0cwRUFJQUlvQW1CQkFVWWJJUUFNQVFzZ0FpZ0NVRUVCUndSQUlBSW9BbUFOQVNBQ0tBSlVRUUZIRFFFZ0FpZ0NXRUVCUncwQkN5QUNLQUpJSVFBTElBSkI4QUJxSkFBZ0FBdVpBUUVDZnlNQVFVQnFJZ01rQUFKL1FRRWdBQ0FCUVFBUUNnMEFHa0VBSUFGRkRRQWFRUUFnQVVHY0ZoQWhJZ0ZGRFFBYUlBTkJER3BCTkJBUUlBTkJBVFlDT0NBRFFYODJBaFFnQXlBQU5nSVFJQU1nQVRZQ0NDQUJJQU5CQ0dvZ0FpZ0NBRUVCSUFFb0FnQW9BaHdSQUFBZ0F5Z0NJQ0lBUVFGR0JFQWdBaUFES0FJWU5nSUFDeUFBUVFGR0N5RUVJQU5CUUdza0FDQUVDd29BSUFBZ0FVRUFFQW9MQzdjU0FnQkJnQWdMcGhKMWJuTnBaMjVsWkNCemFHOXlkQUIxYm5OcFoyNWxaQ0JwYm5RQVpteHZZWFFBZFdsdWREWTBYM1FBZFc1emFXZHVaV1FnWTJoaGNnQmliMjlzQUhWdWMybG5ibVZrSUd4dmJtY0FjM1JrT2pwM2MzUnlhVzVuQUhOMFpEbzZjM1J5YVc1bkFITjBaRG82ZFRFMmMzUnlhVzVuQUhOMFpEbzZkVE15YzNSeWFXNW5BR1J2ZFdKc1pRQjJiMmxrQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQSE5vYjNKMFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4MWJuTnBaMjVsWkNCemFHOXlkRDRBWlcxelkzSnBjSFJsYmpvNmJXVnRiM0o1WDNacFpYYzhhVzUwUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYm5OcFoyNWxaQ0JwYm5RK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEdac2IyRjBQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eDFhVzUwT0Y5MFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4cGJuUTRYM1ErQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQSFZwYm5ReE5sOTBQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eHBiblF4Tmw5MFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4MWFXNTBOalJmZEQ0QVpXMXpZM0pwY0hSbGJqbzZiV1Z0YjNKNVgzWnBaWGM4YVc1ME5qUmZkRDRBWlcxelkzSnBjSFJsYmpvNmJXVnRiM0o1WDNacFpYYzhkV2x1ZERNeVgzUStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BHbHVkRE15WDNRK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEdOb1lYSStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BIVnVjMmxuYm1Wa0lHTm9ZWEkrQUhOMFpEbzZZbUZ6YVdOZmMzUnlhVzVuUEhWdWMybG5ibVZrSUdOb1lYSStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BITnBaMjVsWkNCamFHRnlQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eHNiMjVuUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYm5OcFoyNWxaQ0JzYjI1blBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4a2IzVmliR1UrQUU1VGRETmZYekl4TW1KaGMybGpYM04wY21sdVowbGpUbE5mTVRGamFHRnlYM1J5WVdsMGMwbGpSVVZPVTE4NVlXeHNiMk5oZEc5eVNXTkZSVVZGQUFBQUFKUU1BQUF5QndBQVRsTjBNMTlmTWpFeVltRnphV05mYzNSeWFXNW5TV2hPVTE4eE1XTm9ZWEpmZEhKaGFYUnpTV2hGUlU1VFh6bGhiR3h2WTJGMGIzSkphRVZGUlVVQUFKUU1BQUI4QndBQVRsTjBNMTlmTWpFeVltRnphV05mYzNSeWFXNW5TWGRPVTE4eE1XTm9ZWEpmZEhKaGFYUnpTWGRGUlU1VFh6bGhiR3h2WTJGMGIzSkpkMFZGUlVVQUFKUU1BQURFQndBQVRsTjBNMTlmTWpFeVltRnphV05mYzNSeWFXNW5TVVJ6VGxOZk1URmphR0Z5WDNSeVlXbDBjMGxFYzBWRlRsTmZPV0ZzYkc5allYUnZja2xFYzBWRlJVVUFBQUNVREFBQURBZ0FBRTVUZEROZlh6SXhNbUpoYzJsalgzTjBjbWx1WjBsRWFVNVRYekV4WTJoaGNsOTBjbUZwZEhOSlJHbEZSVTVUWHpsaGJHeHZZMkYwYjNKSlJHbEZSVVZGQUFBQWxBd0FBRmdJQUFCT01UQmxiWE5qY21sd2RHVnVNM1poYkVVQUFKUU1BQUNrQ0FBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSlkwVkZBQUNVREFBQXdBZ0FBRTR4TUdWdGMyTnlhWEIwWlc0eE1XMWxiVzl5ZVY5MmFXVjNTV0ZGUlFBQWxBd0FBT2dJQUFCT01UQmxiWE5qY21sd2RHVnVNVEZ0WlcxdmNubGZkbWxsZDBsb1JVVUFBSlFNQUFBUUNRQUFUakV3WlcxelkzSnBjSFJsYmpFeGJXVnRiM0o1WDNacFpYZEpjMFZGQUFDVURBQUFPQWtBQUU0eE1HVnRjMk55YVhCMFpXNHhNVzFsYlc5eWVWOTJhV1YzU1hSRlJRQUFsQXdBQUdBSkFBQk9NVEJsYlhOamNtbHdkR1Z1TVRGdFpXMXZjbmxmZG1sbGQwbHBSVVVBQUpRTUFBQ0lDUUFBVGpFd1pXMXpZM0pwY0hSbGJqRXhiV1Z0YjNKNVgzWnBaWGRKYWtWRkFBQ1VEQUFBc0FrQUFFNHhNR1Z0YzJOeWFYQjBaVzR4TVcxbGJXOXllVjkyYVdWM1NXeEZSUUFBbEF3QUFOZ0pBQUJPTVRCbGJYTmpjbWx3ZEdWdU1URnRaVzF2Y25sZmRtbGxkMGx0UlVVQUFKUU1BQUFBQ2dBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSmVFVkZBQUNVREFBQUtBb0FBRTR4TUdWdGMyTnlhWEIwWlc0eE1XMWxiVzl5ZVY5MmFXVjNTWGxGUlFBQWxBd0FBRkFLQUFCT01UQmxiWE5qY21sd2RHVnVNVEZ0WlcxdmNubGZkbWxsZDBsbVJVVUFBSlFNQUFCNENnQUFUakV3WlcxelkzSnBjSFJsYmpFeGJXVnRiM0o1WDNacFpYZEpaRVZGQUFDVURBQUFvQW9BQUU0eE1GOWZZM2g0WVdKcGRqRXhObDlmYzJocGJWOTBlWEJsWDJsdVptOUZBQUFBQUx3TUFBRElDZ0FBSUEwQUFFNHhNRjlmWTNoNFlXSnBkakV4TjE5ZlkyeGhjM05mZEhsd1pWOXBibVp2UlFBQUFMd01BQUQ0Q2dBQTdBb0FBRTR4TUY5ZlkzaDRZV0pwZGpFeE4xOWZjR0poYzJWZmRIbHdaVjlwYm1adlJRQUFBTHdNQUFBb0N3QUE3QW9BQUU0eE1GOWZZM2g0WVdKcGRqRXhPVjlmY0c5cGJuUmxjbDkwZVhCbFgybHVabTlGQUx3TUFBQllDd0FBVEFzQUFBQUFBQURNQ3dBQUFnQUFBQU1BQUFBRUFBQUFCUUFBQUFZQUFBQk9NVEJmWDJONGVHRmlhWFl4TWpOZlgyWjFibVJoYldWdWRHRnNYM1I1Y0dWZmFXNW1iMFVBdkF3QUFLUUxBQURzQ2dBQWRnQUFBSkFMQUFEWUN3QUFZZ0FBQUpBTEFBRGtDd0FBWXdBQUFKQUxBQUR3Q3dBQWFBQUFBSkFMQUFEOEN3QUFZUUFBQUpBTEFBQUlEQUFBY3dBQUFKQUxBQUFVREFBQWRBQUFBSkFMQUFBZ0RBQUFhUUFBQUpBTEFBQXNEQUFBYWdBQUFKQUxBQUE0REFBQWJBQUFBSkFMQUFCRURBQUFiUUFBQUpBTEFBQlFEQUFBZUFBQUFKQUxBQUJjREFBQWVRQUFBSkFMQUFCb0RBQUFaZ0FBQUpBTEFBQjBEQUFBWkFBQUFKQUxBQUNBREFBQUFBQUFBQndMQUFBQ0FBQUFCd0FBQUFRQUFBQUZBQUFBQ0FBQUFBa0FBQUFLQUFBQUN3QUFBQUFBQUFBRURRQUFBZ0FBQUF3QUFBQUVBQUFBQlFBQUFBZ0FBQUFOQUFBQURnQUFBQThBQUFCT01UQmZYMk40ZUdGaWFYWXhNakJmWDNOcFgyTnNZWE56WDNSNWNHVmZhVzVtYjBVQUFBQUF2QXdBQU53TUFBQWNDd0FBVTNRNWRIbHdaVjlwYm1adkFBQUFBSlFNQUFBUURRQkJxQm9MQXpBUEFRPT0iO2lmKCFpc0RhdGFVUkkod2FzbUJpbmFyeUZpbGUpKXt3YXNtQmluYXJ5RmlsZT1sb2NhdGVGaWxlKHdhc21CaW5hcnlGaWxlKTt9ZnVuY3Rpb24gZ2V0QmluYXJ5U3luYyhmaWxlKXtpZihmaWxlPT13YXNtQmluYXJ5RmlsZSYmd2FzbUJpbmFyeSl7cmV0dXJuIG5ldyBVaW50OEFycmF5KHdhc21CaW5hcnkpfXZhciBiaW5hcnk9dHJ5UGFyc2VBc0RhdGFVUkkoZmlsZSk7aWYoYmluYXJ5KXtyZXR1cm4gYmluYXJ5fWlmKHJlYWRCaW5hcnkpe3JldHVybiByZWFkQmluYXJ5KGZpbGUpfXRocm93ICJib3RoIGFzeW5jIGFuZCBzeW5jIGZldGNoaW5nIG9mIHRoZSB3YXNtIGZhaWxlZCJ9ZnVuY3Rpb24gZ2V0QmluYXJ5UHJvbWlzZShiaW5hcnlGaWxlKXtyZXR1cm4gUHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+Z2V0QmluYXJ5U3luYyhiaW5hcnlGaWxlKSl9ZnVuY3Rpb24gaW5zdGFudGlhdGVBcnJheUJ1ZmZlcihiaW5hcnlGaWxlLGltcG9ydHMscmVjZWl2ZXIpe3JldHVybiBnZXRCaW5hcnlQcm9taXNlKGJpbmFyeUZpbGUpLnRoZW4oYmluYXJ5PT5XZWJBc3NlbWJseS5pbnN0YW50aWF0ZShiaW5hcnksaW1wb3J0cykpLnRoZW4ocmVjZWl2ZXIscmVhc29uPT57ZXJyKGBmYWlsZWQgdG8gYXN5bmNocm9ub3VzbHkgcHJlcGFyZSB3YXNtOiAke3JlYXNvbn1gKTthYm9ydChyZWFzb24pO30pfWZ1bmN0aW9uIGluc3RhbnRpYXRlQXN5bmMoYmluYXJ5LGJpbmFyeUZpbGUsaW1wb3J0cyxjYWxsYmFjayl7cmV0dXJuIGluc3RhbnRpYXRlQXJyYXlCdWZmZXIoYmluYXJ5RmlsZSxpbXBvcnRzLGNhbGxiYWNrKX1mdW5jdGlvbiBjcmVhdGVXYXNtKCl7dmFyIGluZm89eyJhIjp3YXNtSW1wb3J0c307ZnVuY3Rpb24gcmVjZWl2ZUluc3RhbmNlKGluc3RhbmNlLG1vZHVsZSl7d2FzbUV4cG9ydHM9aW5zdGFuY2UuZXhwb3J0czt3YXNtTWVtb3J5PXdhc21FeHBvcnRzWyJrIl07dXBkYXRlTWVtb3J5Vmlld3MoKTthZGRPbkluaXQod2FzbUV4cG9ydHNbImwiXSk7cmVtb3ZlUnVuRGVwZW5kZW5jeSgpO3JldHVybiB3YXNtRXhwb3J0c31hZGRSdW5EZXBlbmRlbmN5KCk7ZnVuY3Rpb24gcmVjZWl2ZUluc3RhbnRpYXRpb25SZXN1bHQocmVzdWx0KXtyZWNlaXZlSW5zdGFuY2UocmVzdWx0WyJpbnN0YW5jZSJdKTt9aWYoTW9kdWxlWyJpbnN0YW50aWF0ZVdhc20iXSl7dHJ5e3JldHVybiBNb2R1bGVbImluc3RhbnRpYXRlV2FzbSJdKGluZm8scmVjZWl2ZUluc3RhbmNlKX1jYXRjaChlKXtlcnIoYE1vZHVsZS5pbnN0YW50aWF0ZVdhc20gY2FsbGJhY2sgZmFpbGVkIHdpdGggZXJyb3I6ICR7ZX1gKTtyZWFkeVByb21pc2VSZWplY3QoZSk7fX1pbnN0YW50aWF0ZUFzeW5jKHdhc21CaW5hcnksd2FzbUJpbmFyeUZpbGUsaW5mbyxyZWNlaXZlSW5zdGFudGlhdGlvblJlc3VsdCkuY2F0Y2gocmVhZHlQcm9taXNlUmVqZWN0KTtyZXR1cm4ge319dmFyIGNhbGxSdW50aW1lQ2FsbGJhY2tzPWNhbGxiYWNrcz0+e3doaWxlKGNhbGxiYWNrcy5sZW5ndGg+MCl7Y2FsbGJhY2tzLnNoaWZ0KCkoTW9kdWxlKTt9fTtNb2R1bGVbIm5vRXhpdFJ1bnRpbWUiXXx8dHJ1ZTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfYmlnaW50PShwcmltaXRpdmVUeXBlLG5hbWUsc2l6ZSxtaW5SYW5nZSxtYXhSYW5nZSk9Pnt9O3ZhciBlbWJpbmRfaW5pdF9jaGFyQ29kZXM9KCk9Pnt2YXIgY29kZXM9bmV3IEFycmF5KDI1Nik7Zm9yKHZhciBpPTA7aTwyNTY7KytpKXtjb2Rlc1tpXT1TdHJpbmcuZnJvbUNoYXJDb2RlKGkpO31lbWJpbmRfY2hhckNvZGVzPWNvZGVzO307dmFyIGVtYmluZF9jaGFyQ29kZXM7dmFyIHJlYWRMYXRpbjFTdHJpbmc9cHRyPT57dmFyIHJldD0iIjt2YXIgYz1wdHI7d2hpbGUoSEVBUFU4W2NdKXtyZXQrPWVtYmluZF9jaGFyQ29kZXNbSEVBUFU4W2MrK11dO31yZXR1cm4gcmV0fTt2YXIgYXdhaXRpbmdEZXBlbmRlbmNpZXM9e307dmFyIHJlZ2lzdGVyZWRUeXBlcz17fTt2YXIgQmluZGluZ0Vycm9yO3ZhciB0aHJvd0JpbmRpbmdFcnJvcj1tZXNzYWdlPT57dGhyb3cgbmV3IEJpbmRpbmdFcnJvcihtZXNzYWdlKX07ZnVuY3Rpb24gc2hhcmVkUmVnaXN0ZXJUeXBlKHJhd1R5cGUscmVnaXN0ZXJlZEluc3RhbmNlLG9wdGlvbnM9e30pe3ZhciBuYW1lPXJlZ2lzdGVyZWRJbnN0YW5jZS5uYW1lO2lmKCFyYXdUeXBlKXt0aHJvd0JpbmRpbmdFcnJvcihgdHlwZSAiJHtuYW1lfSIgbXVzdCBoYXZlIGEgcG9zaXRpdmUgaW50ZWdlciB0eXBlaWQgcG9pbnRlcmApO31pZihyZWdpc3RlcmVkVHlwZXMuaGFzT3duUHJvcGVydHkocmF3VHlwZSkpe2lmKG9wdGlvbnMuaWdub3JlRHVwbGljYXRlUmVnaXN0cmF0aW9ucyl7cmV0dXJufWVsc2Uge3Rocm93QmluZGluZ0Vycm9yKGBDYW5ub3QgcmVnaXN0ZXIgdHlwZSAnJHtuYW1lfScgdHdpY2VgKTt9fXJlZ2lzdGVyZWRUeXBlc1tyYXdUeXBlXT1yZWdpc3RlcmVkSW5zdGFuY2U7aWYoYXdhaXRpbmdEZXBlbmRlbmNpZXMuaGFzT3duUHJvcGVydHkocmF3VHlwZSkpe3ZhciBjYWxsYmFja3M9YXdhaXRpbmdEZXBlbmRlbmNpZXNbcmF3VHlwZV07ZGVsZXRlIGF3YWl0aW5nRGVwZW5kZW5jaWVzW3Jhd1R5cGVdO2NhbGxiYWNrcy5mb3JFYWNoKGNiPT5jYigpKTt9fWZ1bmN0aW9uIHJlZ2lzdGVyVHlwZShyYXdUeXBlLHJlZ2lzdGVyZWRJbnN0YW5jZSxvcHRpb25zPXt9KXtpZighKCJhcmdQYWNrQWR2YW5jZSJpbiByZWdpc3RlcmVkSW5zdGFuY2UpKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJyZWdpc3RlclR5cGUgcmVnaXN0ZXJlZEluc3RhbmNlIHJlcXVpcmVzIGFyZ1BhY2tBZHZhbmNlIil9cmV0dXJuIHNoYXJlZFJlZ2lzdGVyVHlwZShyYXdUeXBlLHJlZ2lzdGVyZWRJbnN0YW5jZSxvcHRpb25zKX12YXIgR2VuZXJpY1dpcmVUeXBlU2l6ZT04O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9ib29sPShyYXdUeXBlLG5hbWUsdHJ1ZVZhbHVlLGZhbHNlVmFsdWUpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3JlZ2lzdGVyVHlwZShyYXdUeXBlLHtuYW1lOm5hbWUsImZyb21XaXJlVHlwZSI6ZnVuY3Rpb24od3Qpe3JldHVybiAhIXd0fSwidG9XaXJlVHlwZSI6ZnVuY3Rpb24oZGVzdHJ1Y3RvcnMsbyl7cmV0dXJuIG8/dHJ1ZVZhbHVlOmZhbHNlVmFsdWV9LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOmZ1bmN0aW9uKHBvaW50ZXIpe3JldHVybiB0aGlzWyJmcm9tV2lyZVR5cGUiXShIRUFQVThbcG9pbnRlcl0pfSxkZXN0cnVjdG9yRnVuY3Rpb246bnVsbH0pO307dmFyIGVtdmFsX2ZyZWVsaXN0PVtdO3ZhciBlbXZhbF9oYW5kbGVzPVtdO3ZhciBfX2VtdmFsX2RlY3JlZj1oYW5kbGU9PntpZihoYW5kbGU+OSYmMD09PS0tZW12YWxfaGFuZGxlc1toYW5kbGUrMV0pe2VtdmFsX2hhbmRsZXNbaGFuZGxlXT11bmRlZmluZWQ7ZW12YWxfZnJlZWxpc3QucHVzaChoYW5kbGUpO319O3ZhciBjb3VudF9lbXZhbF9oYW5kbGVzPSgpPT5lbXZhbF9oYW5kbGVzLmxlbmd0aC8yLTUtZW12YWxfZnJlZWxpc3QubGVuZ3RoO3ZhciBpbml0X2VtdmFsPSgpPT57ZW12YWxfaGFuZGxlcy5wdXNoKDAsMSx1bmRlZmluZWQsMSxudWxsLDEsdHJ1ZSwxLGZhbHNlLDEpO01vZHVsZVsiY291bnRfZW12YWxfaGFuZGxlcyJdPWNvdW50X2VtdmFsX2hhbmRsZXM7fTt2YXIgRW12YWw9e3RvVmFsdWU6aGFuZGxlPT57aWYoIWhhbmRsZSl7dGhyb3dCaW5kaW5nRXJyb3IoIkNhbm5vdCB1c2UgZGVsZXRlZCB2YWwuIGhhbmRsZSA9ICIraGFuZGxlKTt9cmV0dXJuIGVtdmFsX2hhbmRsZXNbaGFuZGxlXX0sdG9IYW5kbGU6dmFsdWU9Pntzd2l0Y2godmFsdWUpe2Nhc2UgdW5kZWZpbmVkOnJldHVybiAyO2Nhc2UgbnVsbDpyZXR1cm4gNDtjYXNlIHRydWU6cmV0dXJuIDY7Y2FzZSBmYWxzZTpyZXR1cm4gODtkZWZhdWx0Ontjb25zdCBoYW5kbGU9ZW12YWxfZnJlZWxpc3QucG9wKCl8fGVtdmFsX2hhbmRsZXMubGVuZ3RoO2VtdmFsX2hhbmRsZXNbaGFuZGxlXT12YWx1ZTtlbXZhbF9oYW5kbGVzW2hhbmRsZSsxXT0xO3JldHVybiBoYW5kbGV9fX19O2Z1bmN0aW9uIHJlYWRQb2ludGVyKHBvaW50ZXIpe3JldHVybiB0aGlzWyJmcm9tV2lyZVR5cGUiXShIRUFQVTMyW3BvaW50ZXI+PjJdKX12YXIgRW1WYWxUeXBlPXtuYW1lOiJlbXNjcmlwdGVuOjp2YWwiLCJmcm9tV2lyZVR5cGUiOmhhbmRsZT0+e3ZhciBydj1FbXZhbC50b1ZhbHVlKGhhbmRsZSk7X19lbXZhbF9kZWNyZWYoaGFuZGxlKTtyZXR1cm4gcnZ9LCJ0b1dpcmVUeXBlIjooZGVzdHJ1Y3RvcnMsdmFsdWUpPT5FbXZhbC50b0hhbmRsZSh2YWx1ZSksImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6cmVhZFBvaW50ZXIsZGVzdHJ1Y3RvckZ1bmN0aW9uOm51bGx9O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9lbXZhbD1yYXdUeXBlPT5yZWdpc3RlclR5cGUocmF3VHlwZSxFbVZhbFR5cGUpO3ZhciBmbG9hdFJlYWRWYWx1ZUZyb21Qb2ludGVyPShuYW1lLHdpZHRoKT0+e3N3aXRjaCh3aWR0aCl7Y2FzZSA0OnJldHVybiBmdW5jdGlvbihwb2ludGVyKXtyZXR1cm4gdGhpc1siZnJvbVdpcmVUeXBlIl0oSEVBUEYzMltwb2ludGVyPj4yXSl9O2Nhc2UgODpyZXR1cm4gZnVuY3Rpb24ocG9pbnRlcil7cmV0dXJuIHRoaXNbImZyb21XaXJlVHlwZSJdKEhFQVBGNjRbcG9pbnRlcj4+M10pfTtkZWZhdWx0OnRocm93IG5ldyBUeXBlRXJyb3IoYGludmFsaWQgZmxvYXQgd2lkdGggKCR7d2lkdGh9KTogJHtuYW1lfWApfX07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2Zsb2F0PShyYXdUeXBlLG5hbWUsc2l6ZSk9PntuYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjp2YWx1ZT0+dmFsdWUsInRvV2lyZVR5cGUiOihkZXN0cnVjdG9ycyx2YWx1ZSk9PnZhbHVlLCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOmZsb2F0UmVhZFZhbHVlRnJvbVBvaW50ZXIobmFtZSxzaXplKSxkZXN0cnVjdG9yRnVuY3Rpb246bnVsbH0pO307dmFyIGludGVnZXJSZWFkVmFsdWVGcm9tUG9pbnRlcj0obmFtZSx3aWR0aCxzaWduZWQpPT57c3dpdGNoKHdpZHRoKXtjYXNlIDE6cmV0dXJuIHNpZ25lZD9wb2ludGVyPT5IRUFQOFtwb2ludGVyXTpwb2ludGVyPT5IRUFQVThbcG9pbnRlcl07Y2FzZSAyOnJldHVybiBzaWduZWQ/cG9pbnRlcj0+SEVBUDE2W3BvaW50ZXI+PjFdOnBvaW50ZXI9PkhFQVBVMTZbcG9pbnRlcj4+MV07Y2FzZSA0OnJldHVybiBzaWduZWQ/cG9pbnRlcj0+SEVBUDMyW3BvaW50ZXI+PjJdOnBvaW50ZXI9PkhFQVBVMzJbcG9pbnRlcj4+Ml07ZGVmYXVsdDp0aHJvdyBuZXcgVHlwZUVycm9yKGBpbnZhbGlkIGludGVnZXIgd2lkdGggKCR7d2lkdGh9KTogJHtuYW1lfWApfX07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2ludGVnZXI9KHByaW1pdGl2ZVR5cGUsbmFtZSxzaXplLG1pblJhbmdlLG1heFJhbmdlKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTt2YXIgZnJvbVdpcmVUeXBlPXZhbHVlPT52YWx1ZTtpZihtaW5SYW5nZT09PTApe3ZhciBiaXRzaGlmdD0zMi04KnNpemU7ZnJvbVdpcmVUeXBlPXZhbHVlPT52YWx1ZTw8Yml0c2hpZnQ+Pj5iaXRzaGlmdDt9dmFyIGlzVW5zaWduZWRUeXBlPW5hbWUuaW5jbHVkZXMoInVuc2lnbmVkIik7dmFyIGNoZWNrQXNzZXJ0aW9ucz0odmFsdWUsdG9UeXBlTmFtZSk9Pnt9O3ZhciB0b1dpcmVUeXBlO2lmKGlzVW5zaWduZWRUeXBlKXt0b1dpcmVUeXBlPWZ1bmN0aW9uKGRlc3RydWN0b3JzLHZhbHVlKXtjaGVja0Fzc2VydGlvbnModmFsdWUsdGhpcy5uYW1lKTtyZXR1cm4gdmFsdWU+Pj4wfTt9ZWxzZSB7dG9XaXJlVHlwZT1mdW5jdGlvbihkZXN0cnVjdG9ycyx2YWx1ZSl7Y2hlY2tBc3NlcnRpb25zKHZhbHVlLHRoaXMubmFtZSk7cmV0dXJuIHZhbHVlfTt9cmVnaXN0ZXJUeXBlKHByaW1pdGl2ZVR5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjpmcm9tV2lyZVR5cGUsInRvV2lyZVR5cGUiOnRvV2lyZVR5cGUsImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6aW50ZWdlclJlYWRWYWx1ZUZyb21Qb2ludGVyKG5hbWUsc2l6ZSxtaW5SYW5nZSE9PTApLGRlc3RydWN0b3JGdW5jdGlvbjpudWxsfSk7fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfbWVtb3J5X3ZpZXc9KHJhd1R5cGUsZGF0YVR5cGVJbmRleCxuYW1lKT0+e3ZhciB0eXBlTWFwcGluZz1bSW50OEFycmF5LFVpbnQ4QXJyYXksSW50MTZBcnJheSxVaW50MTZBcnJheSxJbnQzMkFycmF5LFVpbnQzMkFycmF5LEZsb2F0MzJBcnJheSxGbG9hdDY0QXJyYXldO3ZhciBUQT10eXBlTWFwcGluZ1tkYXRhVHlwZUluZGV4XTtmdW5jdGlvbiBkZWNvZGVNZW1vcnlWaWV3KGhhbmRsZSl7dmFyIHNpemU9SEVBUFUzMltoYW5kbGU+PjJdO3ZhciBkYXRhPUhFQVBVMzJbaGFuZGxlKzQ+PjJdO3JldHVybiBuZXcgVEEoSEVBUDguYnVmZmVyLGRhdGEsc2l6ZSl9bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3JlZ2lzdGVyVHlwZShyYXdUeXBlLHtuYW1lOm5hbWUsImZyb21XaXJlVHlwZSI6ZGVjb2RlTWVtb3J5VmlldywiYXJnUGFja0FkdmFuY2UiOkdlbmVyaWNXaXJlVHlwZVNpemUsInJlYWRWYWx1ZUZyb21Qb2ludGVyIjpkZWNvZGVNZW1vcnlWaWV3fSx7aWdub3JlRHVwbGljYXRlUmVnaXN0cmF0aW9uczp0cnVlfSk7fTt2YXIgc3RyaW5nVG9VVEY4QXJyYXk9KHN0cixoZWFwLG91dElkeCxtYXhCeXRlc1RvV3JpdGUpPT57aWYoIShtYXhCeXRlc1RvV3JpdGU+MCkpcmV0dXJuIDA7dmFyIHN0YXJ0SWR4PW91dElkeDt2YXIgZW5kSWR4PW91dElkeCttYXhCeXRlc1RvV3JpdGUtMTtmb3IodmFyIGk9MDtpPHN0ci5sZW5ndGg7KytpKXt2YXIgdT1zdHIuY2hhckNvZGVBdChpKTtpZih1Pj01NTI5NiYmdTw9NTczNDMpe3ZhciB1MT1zdHIuY2hhckNvZGVBdCgrK2kpO3U9NjU1MzYrKCh1JjEwMjMpPDwxMCl8dTEmMTAyMzt9aWYodTw9MTI3KXtpZihvdXRJZHg+PWVuZElkeClicmVhaztoZWFwW291dElkeCsrXT11O31lbHNlIGlmKHU8PTIwNDcpe2lmKG91dElkeCsxPj1lbmRJZHgpYnJlYWs7aGVhcFtvdXRJZHgrK109MTkyfHU+PjY7aGVhcFtvdXRJZHgrK109MTI4fHUmNjM7fWVsc2UgaWYodTw9NjU1MzUpe2lmKG91dElkeCsyPj1lbmRJZHgpYnJlYWs7aGVhcFtvdXRJZHgrK109MjI0fHU+PjEyO2hlYXBbb3V0SWR4KytdPTEyOHx1Pj42JjYzO2hlYXBbb3V0SWR4KytdPTEyOHx1JjYzO31lbHNlIHtpZihvdXRJZHgrMz49ZW5kSWR4KWJyZWFrO2hlYXBbb3V0SWR4KytdPTI0MHx1Pj4xODtoZWFwW291dElkeCsrXT0xMjh8dT4+MTImNjM7aGVhcFtvdXRJZHgrK109MTI4fHU+PjYmNjM7aGVhcFtvdXRJZHgrK109MTI4fHUmNjM7fX1oZWFwW291dElkeF09MDtyZXR1cm4gb3V0SWR4LXN0YXJ0SWR4fTt2YXIgc3RyaW5nVG9VVEY4PShzdHIsb3V0UHRyLG1heEJ5dGVzVG9Xcml0ZSk9PnN0cmluZ1RvVVRGOEFycmF5KHN0cixIRUFQVTgsb3V0UHRyLG1heEJ5dGVzVG9Xcml0ZSk7dmFyIGxlbmd0aEJ5dGVzVVRGOD1zdHI9Pnt2YXIgbGVuPTA7Zm9yKHZhciBpPTA7aTxzdHIubGVuZ3RoOysraSl7dmFyIGM9c3RyLmNoYXJDb2RlQXQoaSk7aWYoYzw9MTI3KXtsZW4rKzt9ZWxzZSBpZihjPD0yMDQ3KXtsZW4rPTI7fWVsc2UgaWYoYz49NTUyOTYmJmM8PTU3MzQzKXtsZW4rPTQ7KytpO31lbHNlIHtsZW4rPTM7fX1yZXR1cm4gbGVufTt2YXIgVVRGOERlY29kZXI9dHlwZW9mIFRleHREZWNvZGVyIT0idW5kZWZpbmVkIj9uZXcgVGV4dERlY29kZXIoInV0ZjgiKTp1bmRlZmluZWQ7dmFyIFVURjhBcnJheVRvU3RyaW5nPShoZWFwT3JBcnJheSxpZHgsbWF4Qnl0ZXNUb1JlYWQpPT57dmFyIGVuZElkeD1pZHgrbWF4Qnl0ZXNUb1JlYWQ7dmFyIGVuZFB0cj1pZHg7d2hpbGUoaGVhcE9yQXJyYXlbZW5kUHRyXSYmIShlbmRQdHI+PWVuZElkeCkpKytlbmRQdHI7aWYoZW5kUHRyLWlkeD4xNiYmaGVhcE9yQXJyYXkuYnVmZmVyJiZVVEY4RGVjb2Rlcil7cmV0dXJuIFVURjhEZWNvZGVyLmRlY29kZShoZWFwT3JBcnJheS5zdWJhcnJheShpZHgsZW5kUHRyKSl9dmFyIHN0cj0iIjt3aGlsZShpZHg8ZW5kUHRyKXt2YXIgdTA9aGVhcE9yQXJyYXlbaWR4KytdO2lmKCEodTAmMTI4KSl7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKHUwKTtjb250aW51ZX12YXIgdTE9aGVhcE9yQXJyYXlbaWR4KytdJjYzO2lmKCh1MCYyMjQpPT0xOTIpe3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSgodTAmMzEpPDw2fHUxKTtjb250aW51ZX12YXIgdTI9aGVhcE9yQXJyYXlbaWR4KytdJjYzO2lmKCh1MCYyNDApPT0yMjQpe3UwPSh1MCYxNSk8PDEyfHUxPDw2fHUyO31lbHNlIHt1MD0odTAmNyk8PDE4fHUxPDwxMnx1Mjw8NnxoZWFwT3JBcnJheVtpZHgrK10mNjM7fWlmKHUwPDY1NTM2KXtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUodTApO31lbHNlIHt2YXIgY2g9dTAtNjU1MzY7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKDU1Mjk2fGNoPj4xMCw1NjMyMHxjaCYxMDIzKTt9fXJldHVybiBzdHJ9O3ZhciBVVEY4VG9TdHJpbmc9KHB0cixtYXhCeXRlc1RvUmVhZCk9PnB0cj9VVEY4QXJyYXlUb1N0cmluZyhIRUFQVTgscHRyLG1heEJ5dGVzVG9SZWFkKToiIjt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfc3RkX3N0cmluZz0ocmF3VHlwZSxuYW1lKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTt2YXIgc3RkU3RyaW5nSXNVVEY4PW5hbWU9PT0ic3RkOjpzdHJpbmciO3JlZ2lzdGVyVHlwZShyYXdUeXBlLHtuYW1lOm5hbWUsImZyb21XaXJlVHlwZSIodmFsdWUpe3ZhciBsZW5ndGg9SEVBUFUzMlt2YWx1ZT4+Ml07dmFyIHBheWxvYWQ9dmFsdWUrNDt2YXIgc3RyO2lmKHN0ZFN0cmluZ0lzVVRGOCl7dmFyIGRlY29kZVN0YXJ0UHRyPXBheWxvYWQ7Zm9yKHZhciBpPTA7aTw9bGVuZ3RoOysraSl7dmFyIGN1cnJlbnRCeXRlUHRyPXBheWxvYWQraTtpZihpPT1sZW5ndGh8fEhFQVBVOFtjdXJyZW50Qnl0ZVB0cl09PTApe3ZhciBtYXhSZWFkPWN1cnJlbnRCeXRlUHRyLWRlY29kZVN0YXJ0UHRyO3ZhciBzdHJpbmdTZWdtZW50PVVURjhUb1N0cmluZyhkZWNvZGVTdGFydFB0cixtYXhSZWFkKTtpZihzdHI9PT11bmRlZmluZWQpe3N0cj1zdHJpbmdTZWdtZW50O31lbHNlIHtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoMCk7c3RyKz1zdHJpbmdTZWdtZW50O31kZWNvZGVTdGFydFB0cj1jdXJyZW50Qnl0ZVB0cisxO319fWVsc2Uge3ZhciBhPW5ldyBBcnJheShsZW5ndGgpO2Zvcih2YXIgaT0wO2k8bGVuZ3RoOysraSl7YVtpXT1TdHJpbmcuZnJvbUNoYXJDb2RlKEhFQVBVOFtwYXlsb2FkK2ldKTt9c3RyPWEuam9pbigiIik7fV9mcmVlKHZhbHVlKTtyZXR1cm4gc3RyfSwidG9XaXJlVHlwZSIoZGVzdHJ1Y3RvcnMsdmFsdWUpe2lmKHZhbHVlIGluc3RhbmNlb2YgQXJyYXlCdWZmZXIpe3ZhbHVlPW5ldyBVaW50OEFycmF5KHZhbHVlKTt9dmFyIGxlbmd0aDt2YXIgdmFsdWVJc09mVHlwZVN0cmluZz10eXBlb2YgdmFsdWU9PSJzdHJpbmciO2lmKCEodmFsdWVJc09mVHlwZVN0cmluZ3x8dmFsdWUgaW5zdGFuY2VvZiBVaW50OEFycmF5fHx2YWx1ZSBpbnN0YW5jZW9mIFVpbnQ4Q2xhbXBlZEFycmF5fHx2YWx1ZSBpbnN0YW5jZW9mIEludDhBcnJheSkpe3Rocm93QmluZGluZ0Vycm9yKCJDYW5ub3QgcGFzcyBub24tc3RyaW5nIHRvIHN0ZDo6c3RyaW5nIik7fWlmKHN0ZFN0cmluZ0lzVVRGOCYmdmFsdWVJc09mVHlwZVN0cmluZyl7bGVuZ3RoPWxlbmd0aEJ5dGVzVVRGOCh2YWx1ZSk7fWVsc2Uge2xlbmd0aD12YWx1ZS5sZW5ndGg7fXZhciBiYXNlPV9tYWxsb2MoNCtsZW5ndGgrMSk7dmFyIHB0cj1iYXNlKzQ7SEVBUFUzMltiYXNlPj4yXT1sZW5ndGg7aWYoc3RkU3RyaW5nSXNVVEY4JiZ2YWx1ZUlzT2ZUeXBlU3RyaW5nKXtzdHJpbmdUb1VURjgodmFsdWUscHRyLGxlbmd0aCsxKTt9ZWxzZSB7aWYodmFsdWVJc09mVHlwZVN0cmluZyl7Zm9yKHZhciBpPTA7aTxsZW5ndGg7KytpKXt2YXIgY2hhckNvZGU9dmFsdWUuY2hhckNvZGVBdChpKTtpZihjaGFyQ29kZT4yNTUpe19mcmVlKHB0cik7dGhyb3dCaW5kaW5nRXJyb3IoIlN0cmluZyBoYXMgVVRGLTE2IGNvZGUgdW5pdHMgdGhhdCBkbyBub3QgZml0IGluIDggYml0cyIpO31IRUFQVThbcHRyK2ldPWNoYXJDb2RlO319ZWxzZSB7Zm9yKHZhciBpPTA7aTxsZW5ndGg7KytpKXtIRUFQVThbcHRyK2ldPXZhbHVlW2ldO319fWlmKGRlc3RydWN0b3JzIT09bnVsbCl7ZGVzdHJ1Y3RvcnMucHVzaChfZnJlZSxiYXNlKTt9cmV0dXJuIGJhc2V9LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOnJlYWRQb2ludGVyLGRlc3RydWN0b3JGdW5jdGlvbihwdHIpe19mcmVlKHB0cik7fX0pO307dmFyIFVURjE2RGVjb2Rlcj10eXBlb2YgVGV4dERlY29kZXIhPSJ1bmRlZmluZWQiP25ldyBUZXh0RGVjb2RlcigidXRmLTE2bGUiKTp1bmRlZmluZWQ7dmFyIFVURjE2VG9TdHJpbmc9KHB0cixtYXhCeXRlc1RvUmVhZCk9Pnt2YXIgZW5kUHRyPXB0cjt2YXIgaWR4PWVuZFB0cj4+MTt2YXIgbWF4SWR4PWlkeCttYXhCeXRlc1RvUmVhZC8yO3doaWxlKCEoaWR4Pj1tYXhJZHgpJiZIRUFQVTE2W2lkeF0pKytpZHg7ZW5kUHRyPWlkeDw8MTtpZihlbmRQdHItcHRyPjMyJiZVVEYxNkRlY29kZXIpcmV0dXJuIFVURjE2RGVjb2Rlci5kZWNvZGUoSEVBUFU4LnN1YmFycmF5KHB0cixlbmRQdHIpKTt2YXIgc3RyPSIiO2Zvcih2YXIgaT0wOyEoaT49bWF4Qnl0ZXNUb1JlYWQvMik7KytpKXt2YXIgY29kZVVuaXQ9SEVBUDE2W3B0citpKjI+PjFdO2lmKGNvZGVVbml0PT0wKWJyZWFrO3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZShjb2RlVW5pdCk7fXJldHVybiBzdHJ9O3ZhciBzdHJpbmdUb1VURjE2PShzdHIsb3V0UHRyLG1heEJ5dGVzVG9Xcml0ZSk9PnttYXhCeXRlc1RvV3JpdGU/Pz0yMTQ3NDgzNjQ3O2lmKG1heEJ5dGVzVG9Xcml0ZTwyKXJldHVybiAwO21heEJ5dGVzVG9Xcml0ZS09Mjt2YXIgc3RhcnRQdHI9b3V0UHRyO3ZhciBudW1DaGFyc1RvV3JpdGU9bWF4Qnl0ZXNUb1dyaXRlPHN0ci5sZW5ndGgqMj9tYXhCeXRlc1RvV3JpdGUvMjpzdHIubGVuZ3RoO2Zvcih2YXIgaT0wO2k8bnVtQ2hhcnNUb1dyaXRlOysraSl7dmFyIGNvZGVVbml0PXN0ci5jaGFyQ29kZUF0KGkpO0hFQVAxNltvdXRQdHI+PjFdPWNvZGVVbml0O291dFB0cis9Mjt9SEVBUDE2W291dFB0cj4+MV09MDtyZXR1cm4gb3V0UHRyLXN0YXJ0UHRyfTt2YXIgbGVuZ3RoQnl0ZXNVVEYxNj1zdHI9PnN0ci5sZW5ndGgqMjt2YXIgVVRGMzJUb1N0cmluZz0ocHRyLG1heEJ5dGVzVG9SZWFkKT0+e3ZhciBpPTA7dmFyIHN0cj0iIjt3aGlsZSghKGk+PW1heEJ5dGVzVG9SZWFkLzQpKXt2YXIgdXRmMzI9SEVBUDMyW3B0citpKjQ+PjJdO2lmKHV0ZjMyPT0wKWJyZWFrOysraTtpZih1dGYzMj49NjU1MzYpe3ZhciBjaD11dGYzMi02NTUzNjtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoNTUyOTZ8Y2g+PjEwLDU2MzIwfGNoJjEwMjMpO31lbHNlIHtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUodXRmMzIpO319cmV0dXJuIHN0cn07dmFyIHN0cmluZ1RvVVRGMzI9KHN0cixvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKT0+e21heEJ5dGVzVG9Xcml0ZT8/PTIxNDc0ODM2NDc7aWYobWF4Qnl0ZXNUb1dyaXRlPDQpcmV0dXJuIDA7dmFyIHN0YXJ0UHRyPW91dFB0cjt2YXIgZW5kUHRyPXN0YXJ0UHRyK21heEJ5dGVzVG9Xcml0ZS00O2Zvcih2YXIgaT0wO2k8c3RyLmxlbmd0aDsrK2kpe3ZhciBjb2RlVW5pdD1zdHIuY2hhckNvZGVBdChpKTtpZihjb2RlVW5pdD49NTUyOTYmJmNvZGVVbml0PD01NzM0Myl7dmFyIHRyYWlsU3Vycm9nYXRlPXN0ci5jaGFyQ29kZUF0KCsraSk7Y29kZVVuaXQ9NjU1MzYrKChjb2RlVW5pdCYxMDIzKTw8MTApfHRyYWlsU3Vycm9nYXRlJjEwMjM7fUhFQVAzMltvdXRQdHI+PjJdPWNvZGVVbml0O291dFB0cis9NDtpZihvdXRQdHIrND5lbmRQdHIpYnJlYWt9SEVBUDMyW291dFB0cj4+Ml09MDtyZXR1cm4gb3V0UHRyLXN0YXJ0UHRyfTt2YXIgbGVuZ3RoQnl0ZXNVVEYzMj1zdHI9Pnt2YXIgbGVuPTA7Zm9yKHZhciBpPTA7aTxzdHIubGVuZ3RoOysraSl7dmFyIGNvZGVVbml0PXN0ci5jaGFyQ29kZUF0KGkpO2lmKGNvZGVVbml0Pj01NTI5NiYmY29kZVVuaXQ8PTU3MzQzKSsraTtsZW4rPTQ7fXJldHVybiBsZW59O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9zdGRfd3N0cmluZz0ocmF3VHlwZSxjaGFyU2l6ZSxuYW1lKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTt2YXIgZGVjb2RlU3RyaW5nLGVuY29kZVN0cmluZyxyZWFkQ2hhckF0LGxlbmd0aEJ5dGVzVVRGO2lmKGNoYXJTaXplPT09Mil7ZGVjb2RlU3RyaW5nPVVURjE2VG9TdHJpbmc7ZW5jb2RlU3RyaW5nPXN0cmluZ1RvVVRGMTY7bGVuZ3RoQnl0ZXNVVEY9bGVuZ3RoQnl0ZXNVVEYxNjtyZWFkQ2hhckF0PXBvaW50ZXI9PkhFQVBVMTZbcG9pbnRlcj4+MV07fWVsc2UgaWYoY2hhclNpemU9PT00KXtkZWNvZGVTdHJpbmc9VVRGMzJUb1N0cmluZztlbmNvZGVTdHJpbmc9c3RyaW5nVG9VVEYzMjtsZW5ndGhCeXRlc1VURj1sZW5ndGhCeXRlc1VURjMyO3JlYWRDaGFyQXQ9cG9pbnRlcj0+SEVBUFUzMltwb2ludGVyPj4yXTt9cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjp2YWx1ZT0+e3ZhciBsZW5ndGg9SEVBUFUzMlt2YWx1ZT4+Ml07dmFyIHN0cjt2YXIgZGVjb2RlU3RhcnRQdHI9dmFsdWUrNDtmb3IodmFyIGk9MDtpPD1sZW5ndGg7KytpKXt2YXIgY3VycmVudEJ5dGVQdHI9dmFsdWUrNCtpKmNoYXJTaXplO2lmKGk9PWxlbmd0aHx8cmVhZENoYXJBdChjdXJyZW50Qnl0ZVB0cik9PTApe3ZhciBtYXhSZWFkQnl0ZXM9Y3VycmVudEJ5dGVQdHItZGVjb2RlU3RhcnRQdHI7dmFyIHN0cmluZ1NlZ21lbnQ9ZGVjb2RlU3RyaW5nKGRlY29kZVN0YXJ0UHRyLG1heFJlYWRCeXRlcyk7aWYoc3RyPT09dW5kZWZpbmVkKXtzdHI9c3RyaW5nU2VnbWVudDt9ZWxzZSB7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKDApO3N0cis9c3RyaW5nU2VnbWVudDt9ZGVjb2RlU3RhcnRQdHI9Y3VycmVudEJ5dGVQdHIrY2hhclNpemU7fX1fZnJlZSh2YWx1ZSk7cmV0dXJuIHN0cn0sInRvV2lyZVR5cGUiOihkZXN0cnVjdG9ycyx2YWx1ZSk9PntpZighKHR5cGVvZiB2YWx1ZT09InN0cmluZyIpKXt0aHJvd0JpbmRpbmdFcnJvcihgQ2Fubm90IHBhc3Mgbm9uLXN0cmluZyB0byBDKysgc3RyaW5nIHR5cGUgJHtuYW1lfWApO312YXIgbGVuZ3RoPWxlbmd0aEJ5dGVzVVRGKHZhbHVlKTt2YXIgcHRyPV9tYWxsb2MoNCtsZW5ndGgrY2hhclNpemUpO0hFQVBVMzJbcHRyPj4yXT1sZW5ndGgvY2hhclNpemU7ZW5jb2RlU3RyaW5nKHZhbHVlLHB0cis0LGxlbmd0aCtjaGFyU2l6ZSk7aWYoZGVzdHJ1Y3RvcnMhPT1udWxsKXtkZXN0cnVjdG9ycy5wdXNoKF9mcmVlLHB0cik7fXJldHVybiBwdHJ9LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOnJlYWRQb2ludGVyLGRlc3RydWN0b3JGdW5jdGlvbihwdHIpe19mcmVlKHB0cik7fX0pO307dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX3ZvaWQ9KHJhd1R5cGUsbmFtZSk9PntuYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse2lzVm9pZDp0cnVlLG5hbWU6bmFtZSwiYXJnUGFja0FkdmFuY2UiOjAsImZyb21XaXJlVHlwZSI6KCk9PnVuZGVmaW5lZCwidG9XaXJlVHlwZSI6KGRlc3RydWN0b3JzLG8pPT51bmRlZmluZWR9KTt9O3ZhciBnZXRIZWFwTWF4PSgpPT4yMTQ3NDgzNjQ4O3ZhciBncm93TWVtb3J5PXNpemU9Pnt2YXIgYj13YXNtTWVtb3J5LmJ1ZmZlcjt2YXIgcGFnZXM9KHNpemUtYi5ieXRlTGVuZ3RoKzY1NTM1KS82NTUzNjt0cnl7d2FzbU1lbW9yeS5ncm93KHBhZ2VzKTt1cGRhdGVNZW1vcnlWaWV3cygpO3JldHVybiAxfWNhdGNoKGUpe319O3ZhciBfZW1zY3JpcHRlbl9yZXNpemVfaGVhcD1yZXF1ZXN0ZWRTaXplPT57dmFyIG9sZFNpemU9SEVBUFU4Lmxlbmd0aDtyZXF1ZXN0ZWRTaXplPj4+PTA7dmFyIG1heEhlYXBTaXplPWdldEhlYXBNYXgoKTtpZihyZXF1ZXN0ZWRTaXplPm1heEhlYXBTaXplKXtyZXR1cm4gZmFsc2V9dmFyIGFsaWduVXA9KHgsbXVsdGlwbGUpPT54KyhtdWx0aXBsZS14JW11bHRpcGxlKSVtdWx0aXBsZTtmb3IodmFyIGN1dERvd249MTtjdXREb3duPD00O2N1dERvd24qPTIpe3ZhciBvdmVyR3Jvd25IZWFwU2l6ZT1vbGRTaXplKigxKy4yL2N1dERvd24pO292ZXJHcm93bkhlYXBTaXplPU1hdGgubWluKG92ZXJHcm93bkhlYXBTaXplLHJlcXVlc3RlZFNpemUrMTAwNjYzMjk2KTt2YXIgbmV3U2l6ZT1NYXRoLm1pbihtYXhIZWFwU2l6ZSxhbGlnblVwKE1hdGgubWF4KHJlcXVlc3RlZFNpemUsb3Zlckdyb3duSGVhcFNpemUpLDY1NTM2KSk7dmFyIHJlcGxhY2VtZW50PWdyb3dNZW1vcnkobmV3U2l6ZSk7aWYocmVwbGFjZW1lbnQpe3JldHVybiB0cnVlfX1yZXR1cm4gZmFsc2V9O2VtYmluZF9pbml0X2NoYXJDb2RlcygpO0JpbmRpbmdFcnJvcj1Nb2R1bGVbIkJpbmRpbmdFcnJvciJdPWNsYXNzIEJpbmRpbmdFcnJvciBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKG1lc3NhZ2Upe3N1cGVyKG1lc3NhZ2UpO3RoaXMubmFtZT0iQmluZGluZ0Vycm9yIjt9fTtNb2R1bGVbIkludGVybmFsRXJyb3IiXT1jbGFzcyBJbnRlcm5hbEVycm9yIGV4dGVuZHMgRXJyb3J7Y29uc3RydWN0b3IobWVzc2FnZSl7c3VwZXIobWVzc2FnZSk7dGhpcy5uYW1lPSJJbnRlcm5hbEVycm9yIjt9fTtpbml0X2VtdmFsKCk7dmFyIHdhc21JbXBvcnRzPXtmOl9fZW1iaW5kX3JlZ2lzdGVyX2JpZ2ludCxpOl9fZW1iaW5kX3JlZ2lzdGVyX2Jvb2wsaDpfX2VtYmluZF9yZWdpc3Rlcl9lbXZhbCxlOl9fZW1iaW5kX3JlZ2lzdGVyX2Zsb2F0LGI6X19lbWJpbmRfcmVnaXN0ZXJfaW50ZWdlcixhOl9fZW1iaW5kX3JlZ2lzdGVyX21lbW9yeV92aWV3LGQ6X19lbWJpbmRfcmVnaXN0ZXJfc3RkX3N0cmluZyxjOl9fZW1iaW5kX3JlZ2lzdGVyX3N0ZF93c3RyaW5nLGo6X19lbWJpbmRfcmVnaXN0ZXJfdm9pZCxnOl9lbXNjcmlwdGVuX3Jlc2l6ZV9oZWFwfTt2YXIgd2FzbUV4cG9ydHM9Y3JlYXRlV2FzbSgpO01vZHVsZVsiX3BhY2siXT0oYTAsYTEsYTIsYTMsYTQsYTUsYTYsYTcsYTgsYTksYTEwKT0+KE1vZHVsZVsiX3BhY2siXT13YXNtRXhwb3J0c1sibSJdKShhMCxhMSxhMixhMyxhNCxhNSxhNixhNyxhOCxhOSxhMTApO3ZhciBfbWFsbG9jPU1vZHVsZVsiX21hbGxvYyJdPWEwPT4oX21hbGxvYz1Nb2R1bGVbIl9tYWxsb2MiXT13YXNtRXhwb3J0c1sibyJdKShhMCk7dmFyIF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT1hMD0+KF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT13YXNtRXhwb3J0c1sicCJdKShhMCk7dmFyIGNhbGxlZFJ1bjtkZXBlbmRlbmNpZXNGdWxmaWxsZWQ9ZnVuY3Rpb24gcnVuQ2FsbGVyKCl7aWYoIWNhbGxlZFJ1bilydW4oKTtpZighY2FsbGVkUnVuKWRlcGVuZGVuY2llc0Z1bGZpbGxlZD1ydW5DYWxsZXI7fTtmdW5jdGlvbiBydW4oKXtpZihydW5EZXBlbmRlbmNpZXM+MCl7cmV0dXJufXByZVJ1bigpO2lmKHJ1bkRlcGVuZGVuY2llcz4wKXtyZXR1cm59ZnVuY3Rpb24gZG9SdW4oKXtpZihjYWxsZWRSdW4pcmV0dXJuO2NhbGxlZFJ1bj10cnVlO01vZHVsZVsiY2FsbGVkUnVuIl09dHJ1ZTtpZihBQk9SVClyZXR1cm47aW5pdFJ1bnRpbWUoKTtyZWFkeVByb21pc2VSZXNvbHZlKE1vZHVsZSk7aWYoTW9kdWxlWyJvblJ1bnRpbWVJbml0aWFsaXplZCJdKU1vZHVsZVsib25SdW50aW1lSW5pdGlhbGl6ZWQiXSgpO3Bvc3RSdW4oKTt9aWYoTW9kdWxlWyJzZXRTdGF0dXMiXSl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiUnVubmluZy4uLiIpO3NldFRpbWVvdXQoZnVuY3Rpb24oKXtzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiIik7fSwxKTtkb1J1bigpO30sMSk7fWVsc2Uge2RvUnVuKCk7fX1pZihNb2R1bGVbInByZUluaXQiXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlSW5pdCJdPT0iZnVuY3Rpb24iKU1vZHVsZVsicHJlSW5pdCJdPVtNb2R1bGVbInByZUluaXQiXV07d2hpbGUoTW9kdWxlWyJwcmVJbml0Il0ubGVuZ3RoPjApe01vZHVsZVsicHJlSW5pdCJdLnBvcCgpKCk7fX1ydW4oKTsKCgogICAgcmV0dXJuIG1vZHVsZUFyZy5yZWFkeQogIH0KICApOwogIH0pKCk7CgogIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55CiAgbGV0IHdhc21Nb2R1bGU7CiAgYXN5bmMgZnVuY3Rpb24gaW5pdFdhc20oKSB7CiAgICAgIHdhc21Nb2R1bGUgPSBhd2FpdCBsb2FkV2FzbSgpOwogIH0KICBsZXQgYWxsb2NhdGVkVmVydGV4Q291bnQgPSAwOwogIGNvbnN0IHVwZGF0ZVF1ZXVlID0gbmV3IEFycmF5KCk7CiAgbGV0IHJ1bm5pbmcgPSBmYWxzZTsKICBsZXQgbG9hZGluZyA9IGZhbHNlOwogIGxldCBwb3NpdGlvbnNQdHI7CiAgbGV0IHJvdGF0aW9uc1B0cjsKICBsZXQgc2NhbGVzUHRyOwogIGxldCBjb2xvcnNQdHI7CiAgbGV0IHNlbGVjdGlvblB0cjsKICBsZXQgZGF0YVB0cjsKICBsZXQgd29ybGRQb3NpdGlvbnNQdHI7CiAgbGV0IHdvcmxkUm90YXRpb25zUHRyOwogIGxldCB3b3JsZFNjYWxlc1B0cjsKICBjb25zdCBwYWNrID0gYXN5bmMgKHNwbGF0KSA9PiB7CiAgICAgIHdoaWxlIChsb2FkaW5nKSB7CiAgICAgICAgICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAwKSk7CiAgICAgIH0KICAgICAgaWYgKCF3YXNtTW9kdWxlKSB7CiAgICAgICAgICBsb2FkaW5nID0gdHJ1ZTsKICAgICAgICAgIGF3YWl0IGluaXRXYXNtKCk7CiAgICAgICAgICBsb2FkaW5nID0gZmFsc2U7CiAgICAgIH0KICAgICAgY29uc3QgdGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQgPSBNYXRoLnBvdygyLCBNYXRoLmNlaWwoTWF0aC5sb2cyKHNwbGF0LnZlcnRleENvdW50KSkpOwogICAgICBpZiAodGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQgPiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCkgewogICAgICAgICAgaWYgKGFsbG9jYXRlZFZlcnRleENvdW50ID4gMCkgewogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUocG9zaXRpb25zUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHJvdGF0aW9uc1B0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShzY2FsZXNQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoY29sb3JzUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHNlbGVjdGlvblB0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShkYXRhUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHdvcmxkUG9zaXRpb25zUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHdvcmxkUm90YXRpb25zUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHdvcmxkU2NhbGVzUHRyKTsKICAgICAgICAgIH0KICAgICAgICAgIGFsbG9jYXRlZFZlcnRleENvdW50ID0gdGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQ7CiAgICAgICAgICBwb3NpdGlvbnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoMyAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICByb3RhdGlvbnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoNCAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBzY2FsZXNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoMyAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBjb2xvcnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoNCAqIGFsbG9jYXRlZFZlcnRleENvdW50KTsKICAgICAgICAgIHNlbGVjdGlvblB0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyhhbGxvY2F0ZWRWZXJ0ZXhDb3VudCk7CiAgICAgICAgICBkYXRhUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKDggKiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICAgICAgd29ybGRQb3NpdGlvbnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoMyAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICB3b3JsZFJvdGF0aW9uc1B0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyg0ICogYWxsb2NhdGVkVmVydGV4Q291bnQgKiA0KTsKICAgICAgICAgIHdvcmxkU2NhbGVzUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKDMgKiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICB9CiAgICAgIHdhc21Nb2R1bGUuSEVBUEYzMi5zZXQoc3BsYXQucG9zaXRpb25zLCBwb3NpdGlvbnNQdHIgLyA0KTsKICAgICAgd2FzbU1vZHVsZS5IRUFQRjMyLnNldChzcGxhdC5yb3RhdGlvbnMsIHJvdGF0aW9uc1B0ciAvIDQpOwogICAgICB3YXNtTW9kdWxlLkhFQVBGMzIuc2V0KHNwbGF0LnNjYWxlcywgc2NhbGVzUHRyIC8gNCk7CiAgICAgIHdhc21Nb2R1bGUuSEVBUFU4LnNldChzcGxhdC5jb2xvcnMsIGNvbG9yc1B0cik7CiAgICAgIHdhc21Nb2R1bGUuSEVBUFU4LnNldChzcGxhdC5zZWxlY3Rpb24sIHNlbGVjdGlvblB0cik7CiAgICAgIHdhc21Nb2R1bGUuX3BhY2soc3BsYXQuc2VsZWN0ZWQsIHNwbGF0LnZlcnRleENvdW50LCBwb3NpdGlvbnNQdHIsIHJvdGF0aW9uc1B0ciwgc2NhbGVzUHRyLCBjb2xvcnNQdHIsIHNlbGVjdGlvblB0ciwgZGF0YVB0ciwgd29ybGRQb3NpdGlvbnNQdHIsIHdvcmxkUm90YXRpb25zUHRyLCB3b3JsZFNjYWxlc1B0cik7CiAgICAgIGNvbnN0IG91dERhdGEgPSBuZXcgVWludDMyQXJyYXkod2FzbU1vZHVsZS5IRUFQVTMyLmJ1ZmZlciwgZGF0YVB0ciwgc3BsYXQudmVydGV4Q291bnQgKiA4KTsKICAgICAgY29uc3QgZGV0YWNoZWREYXRhID0gbmV3IFVpbnQzMkFycmF5KG91dERhdGEuc2xpY2UoKS5idWZmZXIpOwogICAgICBjb25zdCB3b3JsZFBvc2l0aW9ucyA9IG5ldyBGbG9hdDMyQXJyYXkod2FzbU1vZHVsZS5IRUFQRjMyLmJ1ZmZlciwgd29ybGRQb3NpdGlvbnNQdHIsIHNwbGF0LnZlcnRleENvdW50ICogMyk7CiAgICAgIGNvbnN0IGRldGFjaGVkV29ybGRQb3NpdGlvbnMgPSBuZXcgRmxvYXQzMkFycmF5KHdvcmxkUG9zaXRpb25zLnNsaWNlKCkuYnVmZmVyKTsKICAgICAgY29uc3Qgd29ybGRSb3RhdGlvbnMgPSBuZXcgRmxvYXQzMkFycmF5KHdhc21Nb2R1bGUuSEVBUEYzMi5idWZmZXIsIHdvcmxkUm90YXRpb25zUHRyLCBzcGxhdC52ZXJ0ZXhDb3VudCAqIDQpOwogICAgICBjb25zdCBkZXRhY2hlZFdvcmxkUm90YXRpb25zID0gbmV3IEZsb2F0MzJBcnJheSh3b3JsZFJvdGF0aW9ucy5zbGljZSgpLmJ1ZmZlcik7CiAgICAgIGNvbnN0IHdvcmxkU2NhbGVzID0gbmV3IEZsb2F0MzJBcnJheSh3YXNtTW9kdWxlLkhFQVBGMzIuYnVmZmVyLCB3b3JsZFNjYWxlc1B0ciwgc3BsYXQudmVydGV4Q291bnQgKiAzKTsKICAgICAgY29uc3QgZGV0YWNoZWRXb3JsZFNjYWxlcyA9IG5ldyBGbG9hdDMyQXJyYXkod29ybGRTY2FsZXMuc2xpY2UoKS5idWZmZXIpOwogICAgICBjb25zdCByZXNwb25zZSA9IHsKICAgICAgICAgIGRhdGE6IGRldGFjaGVkRGF0YSwKICAgICAgICAgIHdvcmxkUG9zaXRpb25zOiBkZXRhY2hlZFdvcmxkUG9zaXRpb25zLAogICAgICAgICAgd29ybGRSb3RhdGlvbnM6IGRldGFjaGVkV29ybGRSb3RhdGlvbnMsCiAgICAgICAgICB3b3JsZFNjYWxlczogZGV0YWNoZWRXb3JsZFNjYWxlcywKICAgICAgICAgIG9mZnNldDogc3BsYXQub2Zmc2V0LAogICAgICAgICAgdmVydGV4Q291bnQ6IHNwbGF0LnZlcnRleENvdW50LAogICAgICAgICAgcG9zaXRpb25zOiBzcGxhdC5wb3NpdGlvbnMuYnVmZmVyLAogICAgICAgICAgcm90YXRpb25zOiBzcGxhdC5yb3RhdGlvbnMuYnVmZmVyLAogICAgICAgICAgc2NhbGVzOiBzcGxhdC5zY2FsZXMuYnVmZmVyLAogICAgICAgICAgY29sb3JzOiBzcGxhdC5jb2xvcnMuYnVmZmVyLAogICAgICAgICAgc2VsZWN0aW9uOiBzcGxhdC5zZWxlY3Rpb24uYnVmZmVyLAogICAgICB9OwogICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgcmVzcG9uc2U6IHJlc3BvbnNlIH0sIFsKICAgICAgICAgIHJlc3BvbnNlLmRhdGEuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2Uud29ybGRQb3NpdGlvbnMuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2Uud29ybGRSb3RhdGlvbnMuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2Uud29ybGRTY2FsZXMuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2UucG9zaXRpb25zLAogICAgICAgICAgcmVzcG9uc2Uucm90YXRpb25zLAogICAgICAgICAgcmVzcG9uc2Uuc2NhbGVzLAogICAgICAgICAgcmVzcG9uc2UuY29sb3JzLAogICAgICAgICAgcmVzcG9uc2Uuc2VsZWN0aW9uLAogICAgICBdKTsKICAgICAgcnVubmluZyA9IGZhbHNlOwogIH07CiAgY29uc3QgcGFja1Rocm90dGxlZCA9ICgpID0+IHsKICAgICAgaWYgKHVwZGF0ZVF1ZXVlLmxlbmd0aCA9PT0gMCkKICAgICAgICAgIHJldHVybjsKICAgICAgaWYgKCFydW5uaW5nKSB7CiAgICAgICAgICBydW5uaW5nID0gdHJ1ZTsKICAgICAgICAgIGNvbnN0IHNwbGF0ID0gdXBkYXRlUXVldWUuc2hpZnQoKTsKICAgICAgICAgIHBhY2soc3BsYXQpOwogICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlOwogICAgICAgICAgICAgIHBhY2tUaHJvdHRsZWQoKTsKICAgICAgICAgIH0sIDApOwogICAgICB9CiAgfTsKICBzZWxmLm9ubWVzc2FnZSA9IChlKSA9PiB7CiAgICAgIGlmIChlLmRhdGEuc3BsYXQpIHsKICAgICAgICAgIGNvbnN0IHNwbGF0ID0gZS5kYXRhLnNwbGF0OwogICAgICAgICAgZm9yIChjb25zdCBbaW5kZXgsIGV4aXN0aW5nXSBvZiB1cGRhdGVRdWV1ZS5lbnRyaWVzKCkpIHsKICAgICAgICAgICAgICBpZiAoZXhpc3Rpbmcub2Zmc2V0ID09PSBzcGxhdC5vZmZzZXQpIHsKICAgICAgICAgICAgICAgICAgdXBkYXRlUXVldWVbaW5kZXhdID0gc3BsYXQ7CiAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICB1cGRhdGVRdWV1ZS5wdXNoKHNwbGF0KTsKICAgICAgICAgIHBhY2tUaHJvdHRsZWQoKTsKICAgICAgfQogIH07Cgp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1EYXRhV29ya2VyLmpzLm1hcAoK\", null, !1), dF = function(g = {}) {\n  var U, Q, F = g;\n  F.ready = new Promise((A, e) => {\n    U = A, Q = e;\n  });\n  var l, Z = Object.assign({}, F), t = \"\";\n  t = (t = self.location.href).startsWith(\"blob:\") ? \"\" : t.substr(0, t.replace(/[?#].*/, \"\").lastIndexOf(\"/\") + 1), l = (A) => {\n    var e = new XMLHttpRequest();\n    return e.open(\"GET\", A, !1), e.responseType = \"arraybuffer\", e.send(null), new Uint8Array(e.response);\n  }, F.print || console.log.bind(console);\n  var d, B, n = F.printErr || console.error.bind(console);\n  function V(A) {\n    if (f(A))\n      return function(e) {\n        for (var a = atob(e), W = new Uint8Array(a.length), o = 0; o < a.length; ++o)\n          W[o] = a.charCodeAt(o);\n        return W;\n      }(A.slice(p.length));\n  }\n  Object.assign(F, Z), Z = null, F.arguments && F.arguments, F.thisProgram && F.thisProgram, F.quit && F.quit, F.wasmBinary && (d = F.wasmBinary), typeof WebAssembly != \"object\" && w(\"no native wasm support detected\");\n  var R, s, h, c, C, I, E, N, G = !1;\n  function u() {\n    var A = B.buffer;\n    F.HEAP8 = R = new Int8Array(A), F.HEAP16 = h = new Int16Array(A), F.HEAPU8 = s = new Uint8Array(A), F.HEAPU16 = c = new Uint16Array(A), F.HEAP32 = C = new Int32Array(A), F.HEAPU32 = I = new Uint32Array(A), F.HEAPF32 = E = new Float32Array(A), F.HEAPF64 = N = new Float64Array(A);\n  }\n  var T = [], j = [], D = [], k = 0, S = null;\n  function w(A) {\n    var a;\n    (a = F.onAbort) == null || a.call(F, A), n(A = \"Aborted(\" + A + \")\"), G = !0, A += \". Build with -sASSERTIONS for more info.\";\n    var e = new WebAssembly.RuntimeError(A);\n    throw Q(e), e;\n  }\n  var lU, QU, p = \"data:application/octet-stream;base64,\", f = (A) => A.startsWith(p);\n  function M(A) {\n    return Promise.resolve().then(() => function(e) {\n      if (e == lU && d)\n        return new Uint8Array(d);\n      var a = V(e);\n      if (a)\n        return a;\n      if (l)\n        return l(e);\n      throw \"both async and sync fetching of the wasm failed\";\n    }(A));\n  }\n  function i(A, e, a, W) {\n    return function(o, J, r) {\n      return M(o).then((m) => WebAssembly.instantiate(m, J)).then(r, (m) => {\n        n(`failed to asynchronously prepare wasm: ${m}`), w(m);\n      });\n    }(e, a, W);\n  }\n  f(lU = \"data:application/octet-stream;base64,AGFzbQEAAAABZw9gBH9/f38AYAN/f38AYAV/f39/fwBgBn9/f39/fwBgAX8Bf2ABfwBgAn9/AGADf39/AX9gAABgB39/f39/f38AYAJ9fQF/YAR/f35+AGABfQF/YAt/f39/f39/f39/fwBgAn9/AX8CPQoBYQFhAAEBYQFiAAIBYQFjAAEBYQFkAAYBYQFlAAEBYQFmAAkBYQFnAAQBYQFoAAUBYQFpAAABYQFqAAYDGxoHBAoFCAUGCAsBAAEFDAQEDQMDAgIAAA4HBwQFAXABEBAFBwEBgAKAgAIGCAF/AUGwngQLBxkGAWsCAAFsAA4BbQAaAW4BAAFvABkBcAAPCRUBAEEBCw8RGA0WFiMNIhsdIA0cHh8K6VAacQEBfyACRQRAIAAoAgQgASgCBEYPCyAAIAFGBEBBAQ8LAkAgACgCBCICLQAAIgBFIAAgASgCBCIBLQAAIgNHcg0AA0AgAS0AASEDIAItAAEiAEUNASABQQFqIQEgAkEBaiECIAAgA0YNAAsLIAAgA0YLTwECf0GoGigCACIBIABBB2pBeHEiAmohAAJAIAJBACAAIAFNG0UEQCAAPwBBEHRNDQEgABAGDQELQbgaQTA2AgBBfw8LQagaIAA2AgAgAQsOACAAEBcgARAXQRB0cgsGACAAEA8LKQBBsBpBATYCAEG0GkEANgIAEBFBtBpBrBooAgA2AgBBrBpBsBo2AgAL2QsBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQJxRQ0BIAMgAygCACIBayIDQcwaKAIASQ0BIAAgAWohAAJAAkBB0BooAgAgA0cEQCADKAIMIQIgAUH/AU0EQCABQQN2IQEgAygCCCIEIAJGBEBBvBpBvBooAgBBfiABd3E2AgAMBQsgBCACNgIMIAIgBDYCCAwECyADKAIYIQYgAiADRwRAIAMoAggiASACNgIMIAIgATYCCAwDCyADKAIUIgEEfyADQRRqBSADKAIQIgFFDQIgA0EQagshBANAIAQhByABIgJBFGohBCACKAIUIgENACACQRBqIQQgAigCECIBDQALIAdBADYCAAwCCyAFKAIEIgFBA3FBA0cNAkHEGiAANgIAIAUgAUF+cTYCBCADIABBAXI2AgQgBSAANgIADwtBACECCyAGRQ0AAkAgAygCHCIBQQJ0QewcaiIEKAIAIANGBEAgBCACNgIAIAINAUHAGkHAGigCAEF+IAF3cTYCAAwCCyAGQRBBFCAGKAIQIANGG2ogAjYCACACRQ0BCyACIAY2AhggAygCECIBBEAgAiABNgIQIAEgAjYCGAsgAygCFCIBRQ0AIAIgATYCFCABIAI2AhgLIAMgBU8NACAFKAIEIgFBAXFFDQACQAJAAkACQCABQQJxRQRAQdQaKAIAIAVGBEBB1BogAzYCAEHIGkHIGigCACAAaiIANgIAIAMgAEEBcjYCBCADQdAaKAIARw0GQcQaQQA2AgBB0BpBADYCAA8LQdAaKAIAIAVGBEBB0BogAzYCAEHEGkHEGigCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQAgBSgCDCECIAFB/wFNBEAgAUEDdiEBIAUoAggiBCACRgRAQbwaQbwaKAIAQX4gAXdxNgIADAULIAQgAjYCDCACIAQ2AggMBAsgBSgCGCEGIAIgBUcEQEHMGigCABogBSgCCCIBIAI2AgwgAiABNgIIDAMLIAUoAhQiAQR/IAVBFGoFIAUoAhAiAUUNAiAFQRBqCyEEA0AgBCEHIAEiAkEUaiEEIAIoAhQiAQ0AIAJBEGohBCACKAIQIgENAAsgB0EANgIADAILIAUgAUF+cTYCBCADIABBAXI2AgQgACADaiAANgIADAMLQQAhAgsgBkUNAAJAIAUoAhwiAUECdEHsHGoiBCgCACAFRgRAIAQgAjYCACACDQFBwBpBwBooAgBBfiABd3E2AgAMAgsgBkEQQRQgBigCECAFRhtqIAI2AgAgAkUNAQsgAiAGNgIYIAUoAhAiAQRAIAIgATYCECABIAI2AhgLIAUoAhQiAUUNACACIAE2AhQgASACNgIYCyADIABBAXI2AgQgACADaiAANgIAIANB0BooAgBHDQBBxBogADYCAA8LIABB/wFNBEAgAEF4cUHkGmohAQJ/QbwaKAIAIgRBASAAQQN2dCIAcUUEQEG8GiAAIARyNgIAIAEMAQsgASgCCAshACABIAM2AgggACADNgIMIAMgATYCDCADIAA2AggPC0EfIQIgAEH///8HTQRAIABBJiAAQQh2ZyIBa3ZBAXEgAUEBdGtBPmohAgsgAyACNgIcIANCADcCECACQQJ0QewcaiEHAn8CQAJ/QcAaKAIAIgFBASACdCIEcUUEQEHAGiABIARyNgIAQRghAiAHIQRBCAwBCyAAQRkgAkEBdmtBACACQR9HG3QhAiAHKAIAIQQDQCAEIgEoAgRBeHEgAEYNAiACQR12IQQgAkEBdCECIAEgBEEEcWpBEGoiBygCACIEDQALQRghAiABIQRBCAshACADIgEMAQsgASgCCCIEIAM2AgxBCCECIAFBCGohB0EYIQBBAAshBSAHIAM2AgAgAiADaiAENgIAIAMgATYCDCAAIANqIAU2AgBB3BpB3BooAgBBAWsiAEF/IAAbNgIACwshACABBEADQCAAQQA6AAAgAEEBaiEAIAFBAWsiAQ0ACwsL3gMAQdwXQYoJEAlB6BdBuQhBAUEAEAhB9BdBtAhBAUGAf0H/ABABQYwYQa0IQQFBgH9B/wAQAUGAGEGrCEEBQQBB/wEQAUGYGEGJCEECQYCAfkH//wEQAUGkGEGACEECQQBB//8DEAFBsBhBmAhBBEGAgICAeEH/////BxABQbwYQY8IQQRBAEF/EAFByBhBxwhBBEGAgICAeEH/////BxABQdQYQb4IQQRBAEF/EAFB4BhBowhCgICAgICAgICAf0L///////////8AEBJB7BhBoghCAEJ/EBJB+BhBnAhBBBAEQYQZQYMJQQgQBEH0DkHZCBADQbwPQYcNEANBhBBBBEHMCBACQdAQQQJB5QgQAkGcEUEEQfQIEAJBuBEQB0HgEUEAQcIMEABBiBJBAEGoDRAAQbASQQFB4AwQAEHYEkECQY8JEABBgBNBA0GuCRAAQagTQQRB1gkQAEHQE0EFQfMJEABB+BNBBEHNDRAAQaAUQQVB6w0QAEGIEkEAQdkKEABBsBJBAUG4ChAAQdgSQQJBmwsQAEGAE0EDQfkKEABBqBNBBEGhDBAAQdATQQVB/wsQAEHIFEEIQd4LEABB8BRBCUG8CxAAQZgVQQZBmQoQAEHAFUEHQZIOEAALHAAgACABQQggAqcgAkIgiKcgA6cgA0IgiKcQBQsgAAJAIAAoAgQgAUcNACAAKAIcQQFGDQAgACACNgIcCwuaAQAgAEEBOgA1AkAgACgCBCACRw0AIABBAToANAJAIAAoAhAiAkUEQCAAQQE2AiQgACADNgIYIAAgATYCECADQQFHDQIgACgCMEEBRg0BDAILIAEgAkYEQCAAKAIYIgJBAkYEQCAAIAM2AhggAyECCyAAKAIwQQFHDQIgAkEBRg0BDAILIAAgACgCJEEBajYCJAsgAEEBOgA2CwtdAQF/IAAoAhAiA0UEQCAAQQE2AiQgACACNgIYIAAgATYCEA8LAkAgASADRgRAIAAoAhhBAkcNASAAIAI2AhgPCyAAQQE6ADYgAEECNgIYIAAgACgCJEEBajYCJAsLAgALdwEEfyAAvCIEQf///wNxIQECQCAEQRd2Qf8BcSICRQ0AIAJB8ABNBEAgAUGAgIAEckHxACACa3YhAQwBCyACQY0BSwRAQYD4ASEDQQAhAQwBCyACQQp0QYCAB2shAwsgAyAEQRB2QYCAAnFyIAFBDXZyQf//A3ELBAAgAAvXJwEMfyMAQRBrIgokAAJAAkACQAJAAkACQAJAAkACQAJAIABB9AFNBEBBvBooAgAiBEEQIABBC2pB+ANxIABBC0kbIgZBA3YiAHYiAUEDcQRAAkAgAUF/c0EBcSAAaiICQQN0IgFB5BpqIgAgAUHsGmooAgAiASgCCCIFRgRAQbwaIARBfiACd3E2AgAMAQsgBSAANgIMIAAgBTYCCAsgAUEIaiEAIAEgAkEDdCICQQNyNgIEIAEgAmoiASABKAIEQQFyNgIEDAsLIAZBxBooAgAiCE0NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgFBA3QiAEHkGmoiAiAAQewaaigCACIAKAIIIgVGBEBBvBogBEF+IAF3cSIENgIADAELIAUgAjYCDCACIAU2AggLIAAgBkEDcjYCBCAAIAZqIgcgAUEDdCIBIAZrIgVBAXI2AgQgACABaiAFNgIAIAgEQCAIQXhxQeQaaiEBQdAaKAIAIQICfyAEQQEgCEEDdnQiA3FFBEBBvBogAyAEcjYCACABDAELIAEoAggLIQMgASACNgIIIAMgAjYCDCACIAE2AgwgAiADNgIICyAAQQhqIQBB0BogBzYCAEHEGiAFNgIADAsLQcAaKAIAIgtFDQEgC2hBAnRB7BxqKAIAIgIoAgRBeHEgBmshAyACIQEDQAJAIAEoAhAiAEUEQCABKAIUIgBFDQELIAAoAgRBeHEgBmsiASADIAEgA0kiARshAyAAIAIgARshAiAAIQEMAQsLIAIoAhghCSACIAIoAgwiAEcEQEHMGigCABogAigCCCIBIAA2AgwgACABNgIIDAoLIAIoAhQiAQR/IAJBFGoFIAIoAhAiAUUNAyACQRBqCyEFA0AgBSEHIAEiAEEUaiEFIAAoAhQiAQ0AIABBEGohBSAAKAIQIgENAAsgB0EANgIADAkLQX8hBiAAQb9/Sw0AIABBC2oiAEF4cSEGQcAaKAIAIgdFDQBBACAGayEDAkACQAJAAn9BACAGQYACSQ0AGkEfIAZB////B0sNABogBkEmIABBCHZnIgBrdkEBcSAAQQF0a0E+agsiCEECdEHsHGooAgAiAUUEQEEAIQAMAQtBACEAIAZBGSAIQQF2a0EAIAhBH0cbdCECA0ACQCABKAIEQXhxIAZrIgQgA08NACABIQUgBCIDDQBBACEDIAEhAAwDCyAAIAEoAhQiBCAEIAEgAkEddkEEcWooAhAiAUYbIAAgBBshACACQQF0IQIgAQ0ACwsgACAFckUEQEEAIQVBAiAIdCIAQQAgAGtyIAdxIgBFDQMgAGhBAnRB7BxqKAIAIQALIABFDQELA0AgACgCBEF4cSAGayICIANJIQEgAiADIAEbIQMgACAFIAEbIQUgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBUUNACADQcQaKAIAIAZrTw0AIAUoAhghCCAFIAUoAgwiAEcEQEHMGigCABogBSgCCCIBIAA2AgwgACABNgIIDAgLIAUoAhQiAQR/IAVBFGoFIAUoAhAiAUUNAyAFQRBqCyECA0AgAiEEIAEiAEEUaiECIAAoAhQiAQ0AIABBEGohAiAAKAIQIgENAAsgBEEANgIADAcLIAZBxBooAgAiBU0EQEHQGigCACEAAkAgBSAGayIBQRBPBEAgACAGaiICIAFBAXI2AgQgACAFaiABNgIAIAAgBkEDcjYCBAwBCyAAIAVBA3I2AgQgACAFaiIBIAEoAgRBAXI2AgRBACECQQAhAQtBxBogATYCAEHQGiACNgIAIABBCGohAAwJCyAGQcgaKAIAIgJJBEBByBogAiAGayIBNgIAQdQaQdQaKAIAIgAgBmoiAjYCACACIAFBAXI2AgQgACAGQQNyNgIEIABBCGohAAwJC0EAIQAgBkEvaiIDAn9BlB4oAgAEQEGcHigCAAwBC0GgHkJ/NwIAQZgeQoCggICAgAQ3AgBBlB4gCkEMakFwcUHYqtWqBXM2AgBBqB5BADYCAEH4HUEANgIAQYAgCyIBaiIEQQAgAWsiB3EiASAGTQ0IQfQdKAIAIgUEQEHsHSgCACIIIAFqIgkgCE0gBSAJSXINCQsCQEH4HS0AAEEEcUUEQAJAAkACQAJAQdQaKAIAIgUEQEH8HSEAA0AgBSAAKAIAIghPBEAgCCAAKAIEaiAFSw0DCyAAKAIIIgANAAsLQQAQCyICQX9GDQMgASEEQZgeKAIAIgBBAWsiBSACcQRAIAEgAmsgAiAFakEAIABrcWohBAsgBCAGTQ0DQfQdKAIAIgAEQEHsHSgCACIFIARqIgcgBU0gACAHSXINBAsgBBALIgAgAkcNAQwFCyAEIAJrIAdxIgQQCyICIAAoAgAgACgCBGpGDQEgAiEACyAAQX9GDQEgBkEwaiAETQRAIAAhAgwEC0GcHigCACICIAMgBGtqQQAgAmtxIgIQC0F/Rg0BIAIgBGohBCAAIQIMAwsgAkF/Rw0CC0H4HUH4HSgCAEEEcjYCAAsgARALIgJBf0ZBABALIgBBf0ZyIAAgAk1yDQUgACACayIEIAZBKGpNDQULQewdQewdKAIAIARqIgA2AgBB8B0oAgAgAEkEQEHwHSAANgIACwJAQdQaKAIAIgMEQEH8HSEAA0AgAiAAKAIAIgEgACgCBCIFakYNAiAAKAIIIgANAAsMBAtBzBooAgAiAEEAIAAgAk0bRQRAQcwaIAI2AgALQQAhAEGAHiAENgIAQfwdIAI2AgBB3BpBfzYCAEHgGkGUHigCADYCAEGIHkEANgIAA0AgAEEDdCIBQewaaiABQeQaaiIFNgIAIAFB8BpqIAU2AgAgAEEBaiIAQSBHDQALQcgaIARBKGsiAEF4IAJrQQdxIgFrIgU2AgBB1BogASACaiIBNgIAIAEgBUEBcjYCBCAAIAJqQSg2AgRB2BpBpB4oAgA2AgAMBAsgAiADTSABIANLcg0CIAAoAgxBCHENAiAAIAQgBWo2AgRB1BogA0F4IANrQQdxIgBqIgE2AgBByBpByBooAgAgBGoiAiAAayIANgIAIAEgAEEBcjYCBCACIANqQSg2AgRB2BpBpB4oAgA2AgAMAwtBACEADAYLQQAhAAwEC0HMGigCACACSwRAQcwaIAI2AgALIAIgBGohAUH8HSEAAkADQCABIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQMLQfwdIQADQAJAIAMgACgCACIBTwRAIAEgACgCBGoiBSADSw0BCyAAKAIIIQAMAQsLQcgaIARBKGsiAEF4IAJrQQdxIgFrIgc2AgBB1BogASACaiIBNgIAIAEgB0EBcjYCBCAAIAJqQSg2AgRB2BpBpB4oAgA2AgAgAyAFQScgBWtBB3FqQS9rIgAgACADQRBqSRsiAUEbNgIEIAFBhB4pAgA3AhAgAUH8HSkCADcCCEGEHiABQQhqNgIAQYAeIAQ2AgBB/B0gAjYCAEGIHkEANgIAIAFBGGohAANAIABBBzYCBCAAQQhqIQwgAEEEaiEAIAwgBUkNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siAkEBcjYCBCABIAI2AgACfyACQf8BTQRAIAJBeHFB5BpqIQACf0G8GigCACIBQQEgAkEDdnQiAnFFBEBBvBogASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDEEMIQJBCAwBC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgAyAANgIcIANCADcCECAAQQJ0QewcaiEBAkACQEHAGigCACIFQQEgAHQiBHFFBEBBwBogBCAFcjYCACABIAM2AgAMAQsgAkEZIABBAXZrQQAgAEEfRxt0IQAgASgCACEFA0AgBSIBKAIEQXhxIAJGDQIgAEEddiEFIABBAXQhACABIAVBBHFqIgQoAhAiBQ0ACyAEIAM2AhALIAMgATYCGEEIIQIgAyIBIQBBDAwBCyABKAIIIgAgAzYCDCABIAM2AgggAyAANgIIQQAhAEEYIQJBDAsgA2ogATYCACACIANqIAA2AgALQcgaKAIAIgAgBk0NAEHIGiAAIAZrIgE2AgBB1BpB1BooAgAiACAGaiICNgIAIAIgAUEBcjYCBCAAIAZBA3I2AgQgAEEIaiEADAQLQbgaQTA2AgBBACEADAMLIAAgAjYCACAAIAAoAgQgBGo2AgQgAkF4IAJrQQdxaiIIIAZBA3I2AgQgAUF4IAFrQQdxaiIEIAYgCGoiA2shBwJAQdQaKAIAIARGBEBB1BogAzYCAEHIGkHIGigCACAHaiIANgIAIAMgAEEBcjYCBAwBC0HQGigCACAERgRAQdAaIAM2AgBBxBpBxBooAgAgB2oiADYCACADIABBAXI2AgQgACADaiAANgIADAELIAQoAgQiAEEDcUEBRgRAIABBeHEhCSAEKAIMIQICQCAAQf8BTQRAIAQoAggiASACRgRAQbwaQbwaKAIAQX4gAEEDdndxNgIADAILIAEgAjYCDCACIAE2AggMAQsgBCgCGCEGAkAgAiAERwRAQcwaKAIAGiAEKAIIIgAgAjYCDCACIAA2AggMAQsCQCAEKAIUIgAEfyAEQRRqBSAEKAIQIgBFDQEgBEEQagshAQNAIAEhBSAAIgJBFGohASAAKAIUIgANACACQRBqIQEgAigCECIADQALIAVBADYCAAwBC0EAIQILIAZFDQACQCAEKAIcIgBBAnRB7BxqIgEoAgAgBEYEQCABIAI2AgAgAg0BQcAaQcAaKAIAQX4gAHdxNgIADAILIAZBEEEUIAYoAhAgBEYbaiACNgIAIAJFDQELIAIgBjYCGCAEKAIQIgAEQCACIAA2AhAgACACNgIYCyAEKAIUIgBFDQAgAiAANgIUIAAgAjYCGAsgByAJaiEHIAQgCWoiBCgCBCEACyAEIABBfnE2AgQgAyAHQQFyNgIEIAMgB2ogBzYCACAHQf8BTQRAIAdBeHFB5BpqIQACf0G8GigCACIBQQEgB0EDdnQiAnFFBEBBvBogASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDCADIAA2AgwgAyABNgIIDAELQR8hAiAHQf///wdNBEAgB0EmIAdBCHZnIgBrdkEBcSAAQQF0a0E+aiECCyADIAI2AhwgA0IANwIQIAJBAnRB7BxqIQACQAJAQcAaKAIAIgFBASACdCIFcUUEQEHAGiABIAVyNgIAIAAgAzYCAAwBCyAHQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQEDQCABIgAoAgRBeHEgB0YNAiACQR12IQEgAkEBdCECIAAgAUEEcWoiBSgCECIBDQALIAUgAzYCEAsgAyAANgIYIAMgAzYCDCADIAM2AggMAQsgACgCCCIBIAM2AgwgACADNgIIIANBADYCGCADIAA2AgwgAyABNgIICyAIQQhqIQAMAgsCQCAIRQ0AAkAgBSgCHCIBQQJ0QewcaiICKAIAIAVGBEAgAiAANgIAIAANAUHAGiAHQX4gAXdxIgc2AgAMAgsgCEEQQRQgCCgCECAFRhtqIAA2AgAgAEUNAQsgACAINgIYIAUoAhAiAQRAIAAgATYCECABIAA2AhgLIAUoAhQiAUUNACAAIAE2AhQgASAANgIYCwJAIANBD00EQCAFIAMgBmoiAEEDcjYCBCAAIAVqIgAgACgCBEEBcjYCBAwBCyAFIAZBA3I2AgQgBSAGaiIEIANBAXI2AgQgAyAEaiADNgIAIANB/wFNBEAgA0F4cUHkGmohAAJ/QbwaKAIAIgFBASADQQN2dCICcUUEQEG8GiABIAJyNgIAIAAMAQsgACgCCAshASAAIAQ2AgggASAENgIMIAQgADYCDCAEIAE2AggMAQtBHyEAIANB////B00EQCADQSYgA0EIdmciAGt2QQFxIABBAXRrQT5qIQALIAQgADYCHCAEQgA3AhAgAEECdEHsHGohAQJAAkAgB0EBIAB0IgJxRQRAQcAaIAIgB3I2AgAgASAENgIAIAQgATYCGAwBCyADQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQEDQCABIgIoAgRBeHEgA0YNAiAAQR12IQEgAEEBdCEAIAIgAUEEcWoiBygCECIBDQALIAcgBDYCECAEIAI2AhgLIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAFQQhqIQAMAQsCQCAJRQ0AAkAgAigCHCIBQQJ0QewcaiIFKAIAIAJGBEAgBSAANgIAIAANAUHAGiALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAkYbaiAANgIAIABFDQELIAAgCTYCGCACKAIQIgEEQCAAIAE2AhAgASAANgIYCyACKAIUIgFFDQAgACABNgIUIAEgADYCGAsCQCADQQ9NBEAgAiADIAZqIgBBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMAQsgAiAGQQNyNgIEIAIgBmoiBSADQQFyNgIEIAMgBWogAzYCACAIBEAgCEF4cUHkGmohAEHQGigCACEBAn9BASAIQQN2dCIHIARxRQRAQbwaIAQgB3I2AgAgAAwBCyAAKAIICyEEIAAgATYCCCAEIAE2AgwgASAANgIMIAEgBDYCCAtB0BogBTYCAEHEGiADNgIACyACQQhqIQALIApBEGokACAAC6kLAgt/CX0jAEGgAWsiCyQAIAtBMGpBJBAQA0AgASANRwRAIAIgDUEDbCIMQQJqQQJ0Ig5qKgIAIRcgAiAMQQFqQQJ0Ig9qKgIAIRggCCAMQQJ0IhBqIAIgEGoqAgAiGTgCACAIIA9qIBg4AgAgCCAOaiAXOAIAIAcgDUEFdGoiDCAYOAIEIAwgGTgCACAMIBc4AgggDEEANgIMAkAgAEUEQCAGIA1qLQAARQ0BCyAMQYCAgAg2AgwLIAcgDUEFdGoiESAFIA1BAnQiDEEBciISai0AAEEIdCAFIAxqLQAAciAFIAxBAnIiE2otAABBEHRyIAUgDEEDciIMai0AAEEYdHI2AhwgCyADIBJBAnQiEmoqAgAiFzgCkAEgCyADIBNBAnQiE2oqAgAiGDgClAEgCyADIAxBAnQiFGoqAgAiGTgCmAEgCyADIA1BBHQiFWoqAgCMIho4ApwBIAtB4ABqIgwgCyoCmAEiFkMAAADAlCAWlCALKgKUASIWQwAAAMCUIBaUQwAAgD+SkjgCACAMIAsqApABIhYgFpIgCyoClAGUIAsqApgBQwAAAMCUIAsqApwBlJI4AgQgDCALKgKQASIWIBaSIAsqApgBlCALKgKUASIWIBaSIAsqApwBlJI4AgggDCALKgKQASIWIBaSIAsqApQBlCALKgKYASIWIBaSIAsqApwBlJI4AgwgDCALKgKYASIWQwAAAMCUIBaUIAsqApABIhZDAAAAwJQgFpRDAACAP5KSOAIQIAwgCyoClAEiFiAWkiALKgKYAZQgCyoCkAFDAAAAwJQgCyoCnAGUkjgCFCAMIAsqApABIhYgFpIgCyoCmAGUIAsqApQBQwAAAMCUIAsqApwBlJI4AhggDCALKgKUASIWIBaSIAsqApgBlCALKgKQASIWIBaSIAsqApwBlJI4AhwgDCALKgKUASIWQwAAAMCUIBaUIAsqApABIhZDAAAAwJQgFpRDAACAP5KSOAIgIAkgFWogFzgCACAJIBJqIBg4AgAgCSATaiAZOAIAIAkgFGogGjgCACALIAQgEGoqAgAiFzgCMCALIAQgD2oqAgAiGDgCQCALIAQgDmoqAgAiGTgCUCAKIBBqIBc4AgAgCiAPaiAYOAIAIAogDmogGTgCACALIAwqAhggCyoCOJQgDCoCACALKgIwlCAMKgIMIAsqAjSUkpI4AgAgCyAMKgIcIAsqAjiUIAwqAgQgCyoCMJQgDCoCECALKgI0lJKSOAIEIAsgDCoCICALKgI4lCAMKgIIIAsqAjCUIAwqAhQgCyoCNJSSkjgCCCALIAwqAhggCyoCRJQgDCoCACALKgI8lCAMKgIMIAsqAkCUkpI4AgwgCyAMKgIcIAsqAkSUIAwqAgQgCyoCPJQgDCoCECALKgJAlJKSOAIQIAsgDCoCICALKgJElCAMKgIIIAsqAjyUIAwqAhQgCyoCQJSSkjgCFCALIAwqAhggCyoCUJQgDCoCACALKgJIlCAMKgIMIAsqAkyUkpI4AhggCyAMKgIcIAsqAlCUIAwqAgQgCyoCSJQgDCoCECALKgJMlJKSOAIcIAsgDCoCICALKgJQlCAMKgIIIAsqAkiUIAwqAhQgCyoCTJSSkjgCICALKgIgIRcgCyoCCCEYIAsqAhQhGSARIAsqAhgiGiAalCALKgIAIhYgFpQgCyoCDCIbIBuUkpJDAACAQJQgGiALKgIcIhyUIBYgCyoCBCIdlCAbIAsqAhAiHpSSkkMAAIBAlBAMNgIQIBEgGiAXlCAWIBiUIBsgGZSSkkMAAIBAlCAcIByUIB0gHZQgHiAelJKSQwAAgECUEAw2AhQgESAcIBeUIB0gGJQgHiAZlJKSQwAAgECUIBcgF5QgGCAYlCAZIBmUkpJDAACAQJQQDDYCGCANQQFqIQ0MAQsLIAtBoAFqJAALGgAgACABKAIIIAUQCgRAIAEgAiADIAQQFAsLNwAgACABKAIIIAUQCgRAIAEgAiADIAQQFA8LIAAoAggiACABIAIgAyAEIAUgACgCACgCFBEDAAuRAQAgACABKAIIIAQQCgRAIAEgAiADEBMPCwJAIAAgASgCACAEEApFDQACQCACIAEoAhBHBEAgASgCFCACRw0BCyADQQFHDQEgAUEBNgIgDwsgASACNgIUIAEgAzYCICABIAEoAihBAWo2AigCQCABKAIkQQFHDQAgASgCGEECRw0AIAFBAToANgsgAUEENgIsCwvyAQAgACABKAIIIAQQCgRAIAEgAiADEBMPCwJAIAAgASgCACAEEAoEQAJAIAIgASgCEEcEQCABKAIUIAJHDQELIANBAUcNAiABQQE2AiAPCyABIAM2AiACQCABKAIsQQRGDQAgAUEAOwE0IAAoAggiACABIAIgAkEBIAQgACgCACgCFBEDACABLQA1BEAgAUEDNgIsIAEtADRFDQEMAwsgAUEENgIsCyABIAI2AhQgASABKAIoQQFqNgIoIAEoAiRBAUcNASABKAIYQQJHDQEgAUEBOgA2DwsgACgCCCIAIAEgAiADIAQgACgCACgCGBECAAsLMQAgACABKAIIQQAQCgRAIAEgAiADEBUPCyAAKAIIIgAgASACIAMgACgCACgCHBEAAAsYACAAIAEoAghBABAKBEAgASACIAMQFQsLgAMBBH8jAEHwAGsiAiQAIAAoAgAiA0EEaygCACEEIANBCGsoAgAhBSACQgA3AlAgAkIANwJYIAJCADcCYCACQgA3AGcgAkIANwJIIAJBADYCRCACQewVNgJAIAIgADYCPCACIAE2AjggACAFaiEDAkAgBCABQQAQCgRAQQAgAyAFGyEADAELIAAgA04EQCACQgA3AC8gAkIANwIYIAJCADcCICACQgA3AiggAkIANwIQIAJBADYCDCACIAE2AgggAiAANgIEIAIgBDYCACACQQE2AjAgBCACIAMgA0EBQQAgBCgCACgCFBEDACACKAIYDQELQQAhACAEIAJBOGogA0EBQQAgBCgCACgCGBECAAJAAkAgAigCXA4CAAECCyACKAJMQQAgAigCWEEBRhtBACACKAJUQQFGG0EAIAIoAmBBAUYbIQAMAQsgAigCUEEBRwRAIAIoAmANASACKAJUQQFHDQEgAigCWEEBRw0BCyACKAJIIQALIAJB8ABqJAAgAAuZAQECfyMAQUBqIgMkAAJ/QQEgACABQQAQCg0AGkEAIAFFDQAaQQAgAUGcFhAhIgFFDQAaIANBDGpBNBAQIANBATYCOCADQX82AhQgAyAANgIQIAMgATYCCCABIANBCGogAigCAEEBIAEoAgAoAhwRAAAgAygCICIAQQFGBEAgAiADKAIYNgIACyAAQQFGCyEEIANBQGskACAECwoAIAAgAUEAEAoLC7cSAgBBgAgLphJ1bnNpZ25lZCBzaG9ydAB1bnNpZ25lZCBpbnQAZmxvYXQAdWludDY0X3QAdW5zaWduZWQgY2hhcgBib29sAHVuc2lnbmVkIGxvbmcAc3RkOjp3c3RyaW5nAHN0ZDo6c3RyaW5nAHN0ZDo6dTE2c3RyaW5nAHN0ZDo6dTMyc3RyaW5nAGRvdWJsZQB2b2lkAGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGNoYXI+AHN0ZDo6YmFzaWNfc3RyaW5nPHVuc2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNpZ25lZCBjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+AE5TdDNfXzIxMmJhc2ljX3N0cmluZ0ljTlNfMTFjaGFyX3RyYWl0c0ljRUVOU185YWxsb2NhdG9ySWNFRUVFAAAAAJQMAAAyBwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSWhOU18xMWNoYXJfdHJhaXRzSWhFRU5TXzlhbGxvY2F0b3JJaEVFRUUAAJQMAAB8BwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSXdOU18xMWNoYXJfdHJhaXRzSXdFRU5TXzlhbGxvY2F0b3JJd0VFRUUAAJQMAADEBwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSURzTlNfMTFjaGFyX3RyYWl0c0lEc0VFTlNfOWFsbG9jYXRvcklEc0VFRUUAAACUDAAADAgAAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0lEaU5TXzExY2hhcl90cmFpdHNJRGlFRU5TXzlhbGxvY2F0b3JJRGlFRUVFAAAAlAwAAFgIAABOMTBlbXNjcmlwdGVuM3ZhbEUAAJQMAACkCAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJY0VFAACUDAAAwAgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWFFRQAAlAwAAOgIAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0loRUUAAJQMAAAQCQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJc0VFAACUDAAAOAkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXRFRQAAlAwAAGAJAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lpRUUAAJQMAACICQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJakVFAACUDAAAsAkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWxFRQAAlAwAANgJAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0ltRUUAAJQMAAAACgAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJeEVFAACUDAAAKAoAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXlFRQAAlAwAAFAKAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lmRUUAAJQMAAB4CgAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJZEVFAACUDAAAoAoAAE4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAAAAALwMAADICgAAIA0AAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAALwMAAD4CgAA7AoAAE4xMF9fY3h4YWJpdjExN19fcGJhc2VfdHlwZV9pbmZvRQAAALwMAAAoCwAA7AoAAE4xMF9fY3h4YWJpdjExOV9fcG9pbnRlcl90eXBlX2luZm9FALwMAABYCwAATAsAAAAAAADMCwAAAgAAAAMAAAAEAAAABQAAAAYAAABOMTBfX2N4eGFiaXYxMjNfX2Z1bmRhbWVudGFsX3R5cGVfaW5mb0UAvAwAAKQLAADsCgAAdgAAAJALAADYCwAAYgAAAJALAADkCwAAYwAAAJALAADwCwAAaAAAAJALAAD8CwAAYQAAAJALAAAIDAAAcwAAAJALAAAUDAAAdAAAAJALAAAgDAAAaQAAAJALAAAsDAAAagAAAJALAAA4DAAAbAAAAJALAABEDAAAbQAAAJALAABQDAAAeAAAAJALAABcDAAAeQAAAJALAABoDAAAZgAAAJALAAB0DAAAZAAAAJALAACADAAAAAAAABwLAAACAAAABwAAAAQAAAAFAAAACAAAAAkAAAAKAAAACwAAAAAAAAAEDQAAAgAAAAwAAAAEAAAABQAAAAgAAAANAAAADgAAAA8AAABOMTBfX2N4eGFiaXYxMjBfX3NpX2NsYXNzX3R5cGVfaW5mb0UAAAAAvAwAANwMAAAcCwAAU3Q5dHlwZV9pbmZvAAAAAJQMAAAQDQBBqBoLAzAPAQ==\") || (QU = lU, lU = F.locateFile ? F.locateFile(QU, t) : t + QU);\n  var Y = (A) => {\n    for (; A.length > 0; )\n      A.shift()(F);\n  };\n  F.noExitRuntime;\n  var H, K, UU = (A) => {\n    for (var e = \"\", a = A; s[a]; )\n      e += H[s[a++]];\n    return e;\n  }, AU = {}, P = {}, $ = (A) => {\n    throw new K(A);\n  };\n  function O(A, e, a = {}) {\n    if (!(\"argPackAdvance\" in e))\n      throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");\n    return function(W, o, J = {}) {\n      var r = o.name;\n      if (W || $(`type \"${r}\" must have a positive integer typeid pointer`), P.hasOwnProperty(W)) {\n        if (J.ignoreDuplicateRegistrations)\n          return;\n        $(`Cannot register type '${r}' twice`);\n      }\n      if (P[W] = o, AU.hasOwnProperty(W)) {\n        var m = AU[W];\n        delete AU[W], m.forEach((b) => b());\n      }\n    }(A, e, a);\n  }\n  var tU = [], dU = [], hU = () => dU.length / 2 - 5 - tU.length, pU = (A) => (A || $(\"Cannot use deleted val. handle = \" + A), dU[A]), yU = (A) => {\n    switch (A) {\n      case void 0:\n        return 2;\n      case null:\n        return 4;\n      case !0:\n        return 6;\n      case !1:\n        return 8;\n      default: {\n        const e = tU.pop() || dU.length;\n        return dU[e] = A, dU[e + 1] = 1, e;\n      }\n    }\n  };\n  function oU(A) {\n    return this.fromWireType(I[A >> 2]);\n  }\n  var YU = { name: \"emscripten::val\", fromWireType: (A) => {\n    var e = pU(A);\n    return ((a) => {\n      a > 9 && --dU[a + 1] == 0 && (dU[a] = void 0, tU.push(a));\n    })(A), e;\n  }, toWireType: (A, e) => yU(e), argPackAdvance: 8, readValueFromPointer: oU, destructorFunction: null }, kU = (A, e) => {\n    switch (e) {\n      case 4:\n        return function(a) {\n          return this.fromWireType(E[a >> 2]);\n        };\n      case 8:\n        return function(a) {\n          return this.fromWireType(N[a >> 3]);\n        };\n      default:\n        throw new TypeError(`invalid float width (${e}): ${A}`);\n    }\n  }, uU = (A, e, a) => {\n    switch (e) {\n      case 1:\n        return a ? (W) => R[W] : (W) => s[W];\n      case 2:\n        return a ? (W) => h[W >> 1] : (W) => c[W >> 1];\n      case 4:\n        return a ? (W) => C[W >> 2] : (W) => I[W >> 2];\n      default:\n        throw new TypeError(`invalid integer width (${e}): ${A}`);\n    }\n  }, mU = typeof TextDecoder < \"u\" ? new TextDecoder(\"utf8\") : void 0, TU = (A, e) => A ? ((a, W, o) => {\n    for (var J = W + o, r = W; a[r] && !(r >= J); )\n      ++r;\n    if (r - W > 16 && a.buffer && mU)\n      return mU.decode(a.subarray(W, r));\n    for (var m = \"\"; W < r; ) {\n      var b = a[W++];\n      if (128 & b) {\n        var y = 63 & a[W++];\n        if ((224 & b) != 192) {\n          var L = 63 & a[W++];\n          if ((b = (240 & b) == 224 ? (15 & b) << 12 | y << 6 | L : (7 & b) << 18 | y << 12 | L << 6 | 63 & a[W++]) < 65536)\n            m += String.fromCharCode(b);\n          else {\n            var _ = b - 65536;\n            m += String.fromCharCode(55296 | _ >> 10, 56320 | 1023 & _);\n          }\n        } else\n          m += String.fromCharCode((31 & b) << 6 | y);\n      } else\n        m += String.fromCharCode(b);\n    }\n    return m;\n  })(s, A, e) : \"\", bU = typeof TextDecoder < \"u\" ? new TextDecoder(\"utf-16le\") : void 0, HU = (A, e) => {\n    for (var a = A, W = a >> 1, o = W + e / 2; !(W >= o) && c[W]; )\n      ++W;\n    if ((a = W << 1) - A > 32 && bU)\n      return bU.decode(s.subarray(A, a));\n    for (var J = \"\", r = 0; !(r >= e / 2); ++r) {\n      var m = h[A + 2 * r >> 1];\n      if (m == 0)\n        break;\n      J += String.fromCharCode(m);\n    }\n    return J;\n  }, xU = (A, e, a) => {\n    if (a ?? (a = 2147483647), a < 2)\n      return 0;\n    for (var W = e, o = (a -= 2) < 2 * A.length ? a / 2 : A.length, J = 0; J < o; ++J) {\n      var r = A.charCodeAt(J);\n      h[e >> 1] = r, e += 2;\n    }\n    return h[e >> 1] = 0, e - W;\n  }, DU = (A) => 2 * A.length, fU = (A, e) => {\n    for (var a = 0, W = \"\"; !(a >= e / 4); ) {\n      var o = C[A + 4 * a >> 2];\n      if (o == 0)\n        break;\n      if (++a, o >= 65536) {\n        var J = o - 65536;\n        W += String.fromCharCode(55296 | J >> 10, 56320 | 1023 & J);\n      } else\n        W += String.fromCharCode(o);\n    }\n    return W;\n  }, MU = (A, e, a) => {\n    if (a ?? (a = 2147483647), a < 4)\n      return 0;\n    for (var W = e, o = W + a - 4, J = 0; J < A.length; ++J) {\n      var r = A.charCodeAt(J);\n      if (r >= 55296 && r <= 57343 && (r = 65536 + ((1023 & r) << 10) | 1023 & A.charCodeAt(++J)), C[e >> 2] = r, (e += 4) + 4 > o)\n        break;\n    }\n    return C[e >> 2] = 0, e - W;\n  }, wU = (A) => {\n    for (var e = 0, a = 0; a < A.length; ++a) {\n      var W = A.charCodeAt(a);\n      W >= 55296 && W <= 57343 && ++a, e += 4;\n    }\n    return e;\n  }, vU = (A) => {\n    var e = (A - B.buffer.byteLength + 65535) / 65536;\n    try {\n      return B.grow(e), u(), 1;\n    } catch {\n    }\n  };\n  (() => {\n    for (var A = new Array(256), e = 0; e < 256; ++e)\n      A[e] = String.fromCharCode(e);\n    H = A;\n  })(), K = F.BindingError = class extends Error {\n    constructor(A) {\n      super(A), this.name = \"BindingError\";\n    }\n  }, F.InternalError = class extends Error {\n    constructor(A) {\n      super(A), this.name = \"InternalError\";\n    }\n  }, dU.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), F.count_emval_handles = hU;\n  var zU = { f: (A, e, a, W, o) => {\n  }, i: (A, e, a, W) => {\n    O(A, { name: e = UU(e), fromWireType: function(o) {\n      return !!o;\n    }, toWireType: function(o, J) {\n      return J ? a : W;\n    }, argPackAdvance: 8, readValueFromPointer: function(o) {\n      return this.fromWireType(s[o]);\n    }, destructorFunction: null });\n  }, h: (A) => O(A, YU), e: (A, e, a) => {\n    O(A, { name: e = UU(e), fromWireType: (W) => W, toWireType: (W, o) => o, argPackAdvance: 8, readValueFromPointer: kU(e, a), destructorFunction: null });\n  }, b: (A, e, a, W, o) => {\n    e = UU(e);\n    var J = (b) => b;\n    if (W === 0) {\n      var r = 32 - 8 * a;\n      J = (b) => b << r >>> r;\n    }\n    var m = e.includes(\"unsigned\");\n    O(A, { name: e, fromWireType: J, toWireType: m ? function(b, y) {\n      return this.name, y >>> 0;\n    } : function(b, y) {\n      return this.name, y;\n    }, argPackAdvance: 8, readValueFromPointer: uU(e, a, W !== 0), destructorFunction: null });\n  }, a: (A, e, a) => {\n    var W = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][e];\n    function o(J) {\n      var r = I[J >> 2], m = I[J + 4 >> 2];\n      return new W(R.buffer, m, r);\n    }\n    O(A, { name: a = UU(a), fromWireType: o, argPackAdvance: 8, readValueFromPointer: o }, { ignoreDuplicateRegistrations: !0 });\n  }, d: (A, e) => {\n    var a = (e = UU(e)) === \"std::string\";\n    O(A, { name: e, fromWireType(W) {\n      var o, J = I[W >> 2], r = W + 4;\n      if (a)\n        for (var m = r, b = 0; b <= J; ++b) {\n          var y = r + b;\n          if (b == J || s[y] == 0) {\n            var L = TU(m, y - m);\n            o === void 0 ? o = L : (o += \"\\0\", o += L), m = y + 1;\n          }\n        }\n      else {\n        var _ = new Array(J);\n        for (b = 0; b < J; ++b)\n          _[b] = String.fromCharCode(s[r + b]);\n        o = _.join(\"\");\n      }\n      return eU(W), o;\n    }, toWireType(W, o) {\n      var J;\n      o instanceof ArrayBuffer && (o = new Uint8Array(o));\n      var r = typeof o == \"string\";\n      r || o instanceof Uint8Array || o instanceof Uint8ClampedArray || o instanceof Int8Array || $(\"Cannot pass non-string to std::string\"), J = a && r ? ((_) => {\n        for (var v = 0, x = 0; x < _.length; ++x) {\n          var aU = _.charCodeAt(x);\n          aU <= 127 ? v++ : aU <= 2047 ? v += 2 : aU >= 55296 && aU <= 57343 ? (v += 4, ++x) : v += 3;\n        }\n        return v;\n      })(o) : o.length;\n      var m = IU(4 + J + 1), b = m + 4;\n      if (I[m >> 2] = J, a && r)\n        ((_, v, x, aU) => {\n          if (!(aU > 0))\n            return 0;\n          for (var iU = x + aU - 1, sU = 0; sU < _.length; ++sU) {\n            var q = _.charCodeAt(sU);\n            if (q >= 55296 && q <= 57343 && (q = 65536 + ((1023 & q) << 10) | 1023 & _.charCodeAt(++sU)), q <= 127) {\n              if (x >= iU)\n                break;\n              v[x++] = q;\n            } else if (q <= 2047) {\n              if (x + 1 >= iU)\n                break;\n              v[x++] = 192 | q >> 6, v[x++] = 128 | 63 & q;\n            } else if (q <= 65535) {\n              if (x + 2 >= iU)\n                break;\n              v[x++] = 224 | q >> 12, v[x++] = 128 | q >> 6 & 63, v[x++] = 128 | 63 & q;\n            } else {\n              if (x + 3 >= iU)\n                break;\n              v[x++] = 240 | q >> 18, v[x++] = 128 | q >> 12 & 63, v[x++] = 128 | q >> 6 & 63, v[x++] = 128 | 63 & q;\n            }\n          }\n          v[x] = 0;\n        })(o, s, b, J + 1);\n      else if (r)\n        for (var y = 0; y < J; ++y) {\n          var L = o.charCodeAt(y);\n          L > 255 && (eU(b), $(\"String has UTF-16 code units that do not fit in 8 bits\")), s[b + y] = L;\n        }\n      else\n        for (y = 0; y < J; ++y)\n          s[b + y] = o[y];\n      return W !== null && W.push(eU, m), m;\n    }, argPackAdvance: 8, readValueFromPointer: oU, destructorFunction(W) {\n      eU(W);\n    } });\n  }, c: (A, e, a) => {\n    var W, o, J, r;\n    a = UU(a), e === 2 ? (W = HU, o = xU, r = DU, J = (m) => c[m >> 1]) : e === 4 && (W = fU, o = MU, r = wU, J = (m) => I[m >> 2]), O(A, { name: a, fromWireType: (m) => {\n      for (var b, y = I[m >> 2], L = m + 4, _ = 0; _ <= y; ++_) {\n        var v = m + 4 + _ * e;\n        if (_ == y || J(v) == 0) {\n          var x = W(L, v - L);\n          b === void 0 ? b = x : (b += \"\\0\", b += x), L = v + e;\n        }\n      }\n      return eU(m), b;\n    }, toWireType: (m, b) => {\n      typeof b != \"string\" && $(`Cannot pass non-string to C++ string type ${a}`);\n      var y = r(b), L = IU(4 + y + e);\n      return I[L >> 2] = y / e, o(b, L + 4, y + e), m !== null && m.push(eU, L), L;\n    }, argPackAdvance: 8, readValueFromPointer: oU, destructorFunction(m) {\n      eU(m);\n    } });\n  }, j: (A, e) => {\n    O(A, { isVoid: !0, name: e = UU(e), argPackAdvance: 0, fromWireType: () => {\n    }, toWireType: (a, W) => {\n    } });\n  }, g: (A) => {\n    var e = s.length, a = 2147483648;\n    if ((A >>>= 0) > a)\n      return !1;\n    for (var W, o, J = 1; J <= 4; J *= 2) {\n      var r = e * (1 + 0.2 / J);\n      r = Math.min(r, A + 100663296);\n      var m = Math.min(a, (W = Math.max(A, r)) + ((o = 65536) - W % o) % o);\n      if (vU(m))\n        return !0;\n    }\n    return !1;\n  } }, RU = function() {\n    var a;\n    var A = { a: zU };\n    function e(W, o) {\n      var J;\n      return RU = W.exports, B = RU.k, u(), J = RU.l, j.unshift(J), function(r) {\n        var b;\n        if (k--, (b = F.monitorRunDependencies) == null || b.call(F, k), k == 0 && S) {\n          var m = S;\n          S = null, m();\n        }\n      }(), RU;\n    }\n    if (k++, (a = F.monitorRunDependencies) == null || a.call(F, k), F.instantiateWasm)\n      try {\n        return F.instantiateWasm(A, e);\n      } catch (W) {\n        n(`Module.instantiateWasm callback failed with error: ${W}`), Q(W);\n      }\n    return i(0, lU, A, function(W) {\n      e(W.instance);\n    }).catch(Q), {};\n  }();\n  F._pack = (A, e, a, W, o, J, r, m, b, y, L) => (F._pack = RU.m)(A, e, a, W, o, J, r, m, b, y, L);\n  var cU, IU = F._malloc = (A) => (IU = F._malloc = RU.o)(A), eU = F._free = (A) => (eU = F._free = RU.p)(A);\n  function CU() {\n    function A() {\n      cU || (cU = !0, F.calledRun = !0, G || (Y(j), U(F), F.onRuntimeInitialized && F.onRuntimeInitialized(), function() {\n        if (F.postRun)\n          for (typeof F.postRun == \"function\" && (F.postRun = [F.postRun]); F.postRun.length; )\n            e = F.postRun.shift(), D.unshift(e);\n        var e;\n        Y(D);\n      }()));\n    }\n    k > 0 || (function() {\n      if (F.preRun)\n        for (typeof F.preRun == \"function\" && (F.preRun = [F.preRun]); F.preRun.length; )\n          e = F.preRun.shift(), T.unshift(e);\n      var e;\n      Y(T);\n    }(), k > 0 || (F.setStatus ? (F.setStatus(\"Running...\"), setTimeout(function() {\n      setTimeout(function() {\n        F.setStatus(\"\");\n      }, 1), A();\n    }, 1)) : A()));\n  }\n  if (S = function A() {\n    cU || CU(), cU || (S = A);\n  }, F.preInit)\n    for (typeof F.preInit == \"function\" && (F.preInit = [F.preInit]); F.preInit.length > 0; )\n      F.preInit.pop()();\n  return CU(), g.ready;\n};\nclass BF {\n  constructor(U) {\n    this.dataChanged = !1, this.transformsChanged = !1, this.colorTransformsChanged = !1, this._updating = /* @__PURE__ */ new Set(), this._dirty = /* @__PURE__ */ new Set();\n    let Q = 0, F = 0;\n    this._splatIndices = /* @__PURE__ */ new Map(), this._offsets = /* @__PURE__ */ new Map();\n    const l = /* @__PURE__ */ new Map();\n    for (const V of U.objects)\n      V instanceof ZU && (this._splatIndices.set(V, F), this._offsets.set(V, Q), l.set(Q, V), Q += V.data.vertexCount, F++);\n    this._vertexCount = Q, this._width = 2048, this._height = Math.ceil(2 * this.vertexCount / this.width), this._data = new Uint32Array(this.width * this.height * 4), this._transformsWidth = 5, this._transformsHeight = l.size, this._transforms = new Float32Array(this._transformsWidth * this._transformsHeight * 4), this._transformIndicesWidth = 1024, this._transformIndicesHeight = Math.ceil(this.vertexCount / this._transformIndicesWidth), this._transformIndices = new Uint32Array(this._transformIndicesWidth * this._transformIndicesHeight), this._colorTransformsWidth = 4, this._colorTransformsHeight = 64, this._colorTransforms = new Float32Array(this._colorTransformsWidth * this._colorTransformsHeight * 4), this._colorTransforms.fill(0), this._colorTransforms[0] = 1, this._colorTransforms[5] = 1, this._colorTransforms[10] = 1, this._colorTransforms[15] = 1, this._colorTransformIndicesWidth = 1024, this._colorTransformIndicesHeight = Math.ceil(this.vertexCount / this._colorTransformIndicesWidth), this._colorTransformIndices = new Uint32Array(this._colorTransformIndicesWidth * this._colorTransformIndicesHeight), this.colorTransformIndices.fill(0), this._positions = new Float32Array(3 * this.vertexCount), this._rotations = new Float32Array(4 * this.vertexCount), this._scales = new Float32Array(3 * this.vertexCount), this._worker = new tF();\n    const Z = (V) => {\n      const R = this._splatIndices.get(V);\n      this._transforms.set(V.transform.buffer, 20 * R), this._transforms[20 * R + 16] = V.selected ? 1 : 0, V.positionChanged = !1, V.rotationChanged = !1, V.scaleChanged = !1, V.selectedChanged = !1, this.transformsChanged = !0;\n    }, t = () => {\n      let V = !1;\n      for (const h of this._splatIndices.keys())\n        if (h.colorTransformChanged) {\n          V = !0;\n          break;\n        }\n      if (!V)\n        return;\n      const R = [new nU()];\n      this._colorTransformIndices.fill(0);\n      let s = 1;\n      for (const h of this._splatIndices.keys()) {\n        const c = this._offsets.get(h);\n        for (const C of h.colorTransforms)\n          R.includes(C) || (R.push(C), s++);\n        for (const C of h.colorTransformsMap.keys()) {\n          const I = h.colorTransformsMap.get(C);\n          this._colorTransformIndices[C + c] = I + s - 1;\n        }\n        h.colorTransformChanged = !1;\n      }\n      for (let h = 0; h < R.length; h++) {\n        const c = R[h];\n        this._colorTransforms.set(c.buffer, 16 * h);\n      }\n      this.colorTransformsChanged = !0;\n    };\n    let d;\n    this._worker.onmessage = (V) => {\n      if (V.data.response) {\n        const R = V.data.response, s = l.get(R.offset);\n        Z(s), t();\n        const h = this._splatIndices.get(s);\n        for (let c = 0; c < s.data.vertexCount; c++)\n          this._transformIndices[R.offset + c] = h;\n        this._data.set(R.data, 8 * R.offset), s.data.reattach(R.positions, R.rotations, R.scales, R.colors, R.selection), this._positions.set(R.worldPositions, 3 * R.offset), this._rotations.set(R.worldRotations, 4 * R.offset), this._scales.set(R.worldScales, 3 * R.offset), this._updating.delete(s), s.selectedChanged = !1, this.dataChanged = !0;\n      }\n    }, async function() {\n      d = await dF();\n    }();\n    const B = (V) => {\n      if (!d)\n        return void async function() {\n          for (; !d; )\n            await new Promise((w) => setTimeout(w, 0));\n        }().then(() => {\n          B(V);\n        });\n      Z(V);\n      const R = d._malloc(3 * V.data.vertexCount * 4), s = d._malloc(4 * V.data.vertexCount * 4), h = d._malloc(3 * V.data.vertexCount * 4), c = d._malloc(4 * V.data.vertexCount), C = d._malloc(V.data.vertexCount), I = d._malloc(8 * V.data.vertexCount * 4), E = d._malloc(3 * V.data.vertexCount * 4), N = d._malloc(4 * V.data.vertexCount * 4), G = d._malloc(3 * V.data.vertexCount * 4);\n      d.HEAPF32.set(V.data.positions, R / 4), d.HEAPF32.set(V.data.rotations, s / 4), d.HEAPF32.set(V.data.scales, h / 4), d.HEAPU8.set(V.data.colors, c), d.HEAPU8.set(V.data.selection, C), d._pack(V.selected, V.data.vertexCount, R, s, h, c, C, I, E, N, G);\n      const u = new Uint32Array(d.HEAPU32.buffer, I, 8 * V.data.vertexCount), T = new Float32Array(d.HEAPF32.buffer, E, 3 * V.data.vertexCount), j = new Float32Array(d.HEAPF32.buffer, N, 4 * V.data.vertexCount), D = new Float32Array(d.HEAPF32.buffer, G, 3 * V.data.vertexCount), k = this._splatIndices.get(V), S = this._offsets.get(V);\n      for (let w = 0; w < V.data.vertexCount; w++)\n        this._transformIndices[S + w] = k;\n      this._data.set(u, 8 * S), this._positions.set(T, 3 * S), this._rotations.set(j, 4 * S), this._scales.set(D, 3 * S), d._free(R), d._free(s), d._free(h), d._free(c), d._free(C), d._free(I), d._free(E), d._free(N), d._free(G), this.dataChanged = !0, this.colorTransformsChanged = !0;\n    }, n = (V) => {\n      if ((V.positionChanged || V.rotationChanged || V.scaleChanged || V.selectedChanged) && Z(V), V.colorTransformChanged && t(), !V.data.changed || V.data.detached)\n        return;\n      const R = { position: new Float32Array(V.position.flat()), rotation: new Float32Array(V.rotation.flat()), scale: new Float32Array(V.scale.flat()), selected: V.selected, vertexCount: V.data.vertexCount, positions: V.data.positions, rotations: V.data.rotations, scales: V.data.scales, colors: V.data.colors, selection: V.data.selection, offset: this._offsets.get(V) };\n      this._worker.postMessage({ splat: R }, [R.position.buffer, R.rotation.buffer, R.scale.buffer, R.positions.buffer, R.rotations.buffer, R.scales.buffer, R.colors.buffer, R.selection.buffer]), this._updating.add(V), V.data.detached = !0;\n    };\n    this.getSplat = (V) => {\n      let R = null;\n      for (const [s, h] of this._offsets) {\n        if (!(V >= h))\n          break;\n        R = s;\n      }\n      return R;\n    }, this.getLocalIndex = (V, R) => R - this._offsets.get(V), this.markDirty = (V) => {\n      this._dirty.add(V);\n    }, this.rebuild = () => {\n      for (const V of this._dirty)\n        n(V);\n      this._dirty.clear();\n    }, this.dispose = () => {\n      this._worker.terminate();\n    };\n    for (const V of this._splatIndices.keys())\n      B(V);\n    t();\n  }\n  get offsets() {\n    return this._offsets;\n  }\n  get data() {\n    return this._data;\n  }\n  get width() {\n    return this._width;\n  }\n  get height() {\n    return this._height;\n  }\n  get transforms() {\n    return this._transforms;\n  }\n  get transformsWidth() {\n    return this._transformsWidth;\n  }\n  get transformsHeight() {\n    return this._transformsHeight;\n  }\n  get transformIndices() {\n    return this._transformIndices;\n  }\n  get transformIndicesWidth() {\n    return this._transformIndicesWidth;\n  }\n  get transformIndicesHeight() {\n    return this._transformIndicesHeight;\n  }\n  get colorTransforms() {\n    return this._colorTransforms;\n  }\n  get colorTransformsWidth() {\n    return this._colorTransformsWidth;\n  }\n  get colorTransformsHeight() {\n    return this._colorTransformsHeight;\n  }\n  get colorTransformIndices() {\n    return this._colorTransformIndices;\n  }\n  get colorTransformIndicesWidth() {\n    return this._colorTransformIndicesWidth;\n  }\n  get colorTransformIndicesHeight() {\n    return this._colorTransformIndicesHeight;\n  }\n  get positions() {\n    return this._positions;\n  }\n  get rotations() {\n    return this._rotations;\n  }\n  get scales() {\n    return this._scales;\n  }\n  get vertexCount() {\n    return this._vertexCount;\n  }\n  get needsRebuild() {\n    return this._dirty.size > 0;\n  }\n  get updating() {\n    return this._updating.size > 0;\n  }\n}\nclass rU {\n  constructor(U = 0, Q = 0, F = 0, l = 255) {\n    this.r = U, this.g = Q, this.b = F, this.a = l;\n  }\n  flat() {\n    return [this.r, this.g, this.b, this.a];\n  }\n  flatNorm() {\n    return [this.r / 255, this.g / 255, this.b / 255, this.a / 255];\n  }\n  toHexString() {\n    return \"#\" + this.flat().map((U) => U.toString(16).padStart(2, \"0\")).join(\"\");\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n}\nclass SU extends QF {\n  constructor(U, Q) {\n    super(U, Q), this._outlineThickness = 10, this._outlineColor = new rU(255, 165, 0, 255), this._renderData = null, this._depthIndex = new Uint32Array(), this._chunks = null, this._splatTexture = null;\n    const F = U.canvas, l = U.gl;\n    let Z, t, d, B, n, V, R, s, h, c, C, I, E, N, G, u, T, j, D, k;\n    this._resize = () => {\n      this._camera && (this._camera.data.setSize(F.width, F.height), this._camera.update(), t = l.getUniformLocation(this.program, \"projection\"), l.uniformMatrix4fv(t, !1, this._camera.data.projectionMatrix.buffer), d = l.getUniformLocation(this.program, \"viewport\"), l.uniform2fv(d, new Float32Array([F.width, F.height])));\n    };\n    const S = () => {\n      Z = new lF(), Z.onmessage = (p) => {\n        if (p.data.depthIndex) {\n          const { depthIndex: f, chunks: M } = p.data;\n          this._depthIndex = f, this._chunks = M, l.bindBuffer(l.ARRAY_BUFFER, k), l.bufferData(l.ARRAY_BUFFER, f, l.STATIC_DRAW);\n        }\n      };\n    };\n    this._initialize = () => {\n      if (this._scene && this._camera) {\n        this._resize(), this._scene.addEventListener(\"objectAdded\", w), this._scene.addEventListener(\"objectRemoved\", lU);\n        for (const p of this._scene.objects)\n          p instanceof ZU && p.addEventListener(\"objectChanged\", QU);\n        this._renderData = new BF(this._scene), B = l.getUniformLocation(this.program, \"focal\"), l.uniform2fv(B, new Float32Array([this._camera.data.fx, this._camera.data.fy])), n = l.getUniformLocation(this.program, \"view\"), l.uniformMatrix4fv(n, !1, this._camera.data.viewMatrix.buffer), C = l.getUniformLocation(this.program, \"outlineThickness\"), l.uniform1f(C, this.outlineThickness), I = l.getUniformLocation(this.program, \"outlineColor\"), l.uniform4fv(I, new Float32Array(this.outlineColor.flatNorm())), this._splatTexture = l.createTexture(), V = l.getUniformLocation(this.program, \"u_texture\"), l.uniform1i(V, 0), G = l.createTexture(), R = l.getUniformLocation(this.program, \"u_transforms\"), l.uniform1i(R, 1), u = l.createTexture(), s = l.getUniformLocation(this.program, \"u_transformIndices\"), l.uniform1i(s, 2), T = l.createTexture(), h = l.getUniformLocation(this.program, \"u_colorTransforms\"), l.uniform1i(h, 3), j = l.createTexture(), c = l.getUniformLocation(this.program, \"u_colorTransformIndices\"), l.uniform1i(c, 4), D = l.createBuffer(), l.bindBuffer(l.ARRAY_BUFFER, D), l.bufferData(l.ARRAY_BUFFER, new Float32Array([-2, -2, 2, -2, 2, 2, -2, 2]), l.STATIC_DRAW), E = l.getAttribLocation(this.program, \"position\"), l.enableVertexAttribArray(E), l.vertexAttribPointer(E, 2, l.FLOAT, !1, 0, 0), k = l.createBuffer(), N = l.getAttribLocation(this.program, \"index\"), l.enableVertexAttribArray(N), l.bindBuffer(l.ARRAY_BUFFER, k), S();\n      } else\n        console.error(\"Cannot render without scene and camera\");\n    };\n    const w = (p) => {\n      const f = p;\n      f.object instanceof ZU && f.object.addEventListener(\"objectChanged\", QU), this.dispose();\n    }, lU = (p) => {\n      const f = p;\n      f.object instanceof ZU && f.object.removeEventListener(\"objectChanged\", QU), this.dispose();\n    }, QU = (p) => {\n      const f = p;\n      f.object instanceof ZU && this._renderData && this._renderData.markDirty(f.object);\n    };\n    this._render = () => {\n      if (this._scene && this._camera && this.renderData) {\n        if (this.renderData.needsRebuild && this.renderData.rebuild(), this.renderData.dataChanged || this.renderData.transformsChanged || this.renderData.colorTransformsChanged) {\n          this.renderData.dataChanged && (l.activeTexture(l.TEXTURE0), l.bindTexture(l.TEXTURE_2D, this.splatTexture), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.NEAREST), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MAG_FILTER, l.NEAREST), l.texImage2D(l.TEXTURE_2D, 0, l.RGBA32UI, this.renderData.width, this.renderData.height, 0, l.RGBA_INTEGER, l.UNSIGNED_INT, this.renderData.data)), this.renderData.transformsChanged && (l.activeTexture(l.TEXTURE1), l.bindTexture(l.TEXTURE_2D, G), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.NEAREST), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MAG_FILTER, l.NEAREST), l.texImage2D(l.TEXTURE_2D, 0, l.RGBA32F, this.renderData.transformsWidth, this.renderData.transformsHeight, 0, l.RGBA, l.FLOAT, this.renderData.transforms), l.activeTexture(l.TEXTURE2), l.bindTexture(l.TEXTURE_2D, u), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.NEAREST), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MAG_FILTER, l.NEAREST), l.texImage2D(l.TEXTURE_2D, 0, l.R32UI, this.renderData.transformIndicesWidth, this.renderData.transformIndicesHeight, 0, l.RED_INTEGER, l.UNSIGNED_INT, this.renderData.transformIndices)), this.renderData.colorTransformsChanged && (l.activeTexture(l.TEXTURE3), l.bindTexture(l.TEXTURE_2D, T), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.NEAREST), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MAG_FILTER, l.NEAREST), l.texImage2D(l.TEXTURE_2D, 0, l.RGBA32F, this.renderData.colorTransformsWidth, this.renderData.colorTransformsHeight, 0, l.RGBA, l.FLOAT, this.renderData.colorTransforms), l.activeTexture(l.TEXTURE4), l.bindTexture(l.TEXTURE_2D, j), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_S, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_WRAP_T, l.CLAMP_TO_EDGE), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.NEAREST), l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MAG_FILTER, l.NEAREST), l.texImage2D(l.TEXTURE_2D, 0, l.R32UI, this.renderData.colorTransformIndicesWidth, this.renderData.colorTransformIndicesHeight, 0, l.RED_INTEGER, l.UNSIGNED_INT, this.renderData.colorTransformIndices));\n          const p = new Float32Array(this.renderData.positions.slice().buffer), f = new Float32Array(this.renderData.transforms.slice().buffer), M = new Uint32Array(this.renderData.transformIndices.slice().buffer);\n          Z.postMessage({ sortData: { positions: p, transforms: f, transformIndices: M, vertexCount: this.renderData.vertexCount } }, [p.buffer, f.buffer, M.buffer]), this.renderData.dataChanged = !1, this.renderData.transformsChanged = !1, this.renderData.colorTransformsChanged = !1;\n        }\n        this._camera.update(), Z.postMessage({ viewProj: this._camera.data.viewProj.buffer }), l.viewport(0, 0, F.width, F.height), l.clearColor(0, 0, 0, 0), l.clear(l.COLOR_BUFFER_BIT), l.disable(l.DEPTH_TEST), l.enable(l.BLEND), l.blendFuncSeparate(l.ONE_MINUS_DST_ALPHA, l.ONE, l.ONE_MINUS_DST_ALPHA, l.ONE), l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD), l.uniformMatrix4fv(t, !1, this._camera.data.projectionMatrix.buffer), l.uniformMatrix4fv(n, !1, this._camera.data.viewMatrix.buffer), l.bindBuffer(l.ARRAY_BUFFER, D), l.vertexAttribPointer(E, 2, l.FLOAT, !1, 0, 0), l.bindBuffer(l.ARRAY_BUFFER, k), l.bufferData(l.ARRAY_BUFFER, this.depthIndex, l.STATIC_DRAW), l.vertexAttribIPointer(N, 1, l.INT, 0, 0), l.vertexAttribDivisor(N, 1), l.drawArraysInstanced(l.TRIANGLE_FAN, 0, 4, this.renderData.vertexCount);\n      } else\n        console.error(\"Cannot render without scene and camera\");\n    }, this._dispose = () => {\n      if (this._scene && this._camera && this.renderData) {\n        this._scene.removeEventListener(\"objectAdded\", w), this._scene.removeEventListener(\"objectRemoved\", lU);\n        for (const p of this._scene.objects)\n          p instanceof ZU && p.removeEventListener(\"objectChanged\", QU);\n        Z.terminate(), this.renderData.dispose(), l.deleteTexture(this.splatTexture), l.deleteTexture(G), l.deleteTexture(u), l.deleteBuffer(k), l.deleteBuffer(D);\n      } else\n        console.error(\"Cannot dispose without scene and camera\");\n    }, this._setOutlineThickness = (p) => {\n      this._outlineThickness = p, this._initialized && l.uniform1f(C, p);\n    }, this._setOutlineColor = (p) => {\n      this._outlineColor = p, this._initialized && l.uniform4fv(I, new Float32Array(p.flatNorm()));\n    };\n  }\n  get renderData() {\n    return this._renderData;\n  }\n  get depthIndex() {\n    return this._depthIndex;\n  }\n  get chunks() {\n    return this._chunks;\n  }\n  get splatTexture() {\n    return this._splatTexture;\n  }\n  get outlineThickness() {\n    return this._outlineThickness;\n  }\n  set outlineThickness(U) {\n    this._setOutlineThickness(U);\n  }\n  get outlineColor() {\n    return this._outlineColor;\n  }\n  set outlineColor(U) {\n    this._setOutlineColor(U);\n  }\n  _getVertexSource() {\n    return `#version 300 es\nprecision highp float;\nprecision highp int;\n\nuniform highp usampler2D u_texture;\nuniform highp sampler2D u_transforms;\nuniform highp usampler2D u_transformIndices;\nuniform highp sampler2D u_colorTransforms;\nuniform highp usampler2D u_colorTransformIndices;\nuniform mat4 projection, view;\nuniform vec2 focal;\nuniform vec2 viewport;\n\nuniform bool useDepthFade;\nuniform float depthFade;\n\nin vec2 position;\nin int index;\n\nout vec4 vColor;\nout vec2 vPosition;\nout float vSize;\nout float vSelected;\n\nvoid main () {\n    uvec4 cen = texelFetch(u_texture, ivec2((uint(index) & 0x3ffu) << 1, uint(index) >> 10), 0);\n    float selected = float((cen.w >> 24) & 0xffu);\n\n    uint transformIndex = texelFetch(u_transformIndices, ivec2(uint(index) & 0x3ffu, uint(index) >> 10), 0).x;\n    mat4 transform = mat4(\n        texelFetch(u_transforms, ivec2(0, transformIndex), 0),\n        texelFetch(u_transforms, ivec2(1, transformIndex), 0),\n        texelFetch(u_transforms, ivec2(2, transformIndex), 0),\n        texelFetch(u_transforms, ivec2(3, transformIndex), 0)\n    );\n\n    if (selected < 0.5) {\n        selected = texelFetch(u_transforms, ivec2(4, transformIndex), 0).x;\n    }\n\n    mat4 viewTransform = view * transform;\n\n    vec4 cam = viewTransform * vec4(uintBitsToFloat(cen.xyz), 1);\n    vec4 pos2d = projection * cam;\n\n    float clip = 1.2 * pos2d.w;\n    if (pos2d.z < -pos2d.w || pos2d.z > pos2d.w || pos2d.x < -clip || pos2d.x > clip || pos2d.y < -clip || pos2d.y > clip) {\n        gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\n        return;\n    }\n\n    uvec4 cov = texelFetch(u_texture, ivec2(((uint(index) & 0x3ffu) << 1) | 1u, uint(index) >> 10), 0);\n    vec2 u1 = unpackHalf2x16(cov.x), u2 = unpackHalf2x16(cov.y), u3 = unpackHalf2x16(cov.z);\n    mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);\n\n    mat3 J = mat3(\n        focal.x / cam.z, 0., -(focal.x * cam.x) / (cam.z * cam.z), \n        0., -focal.y / cam.z, (focal.y * cam.y) / (cam.z * cam.z), \n        0., 0., 0.\n    );\n\n    mat3 T = transpose(mat3(viewTransform)) * J;\n    mat3 cov2d = transpose(T) * Vrk * T;\n\n    float mid = (cov2d[0][0] + cov2d[1][1]) / 2.0;\n    float radius = length(vec2((cov2d[0][0] - cov2d[1][1]) / 2.0, cov2d[0][1]));\n    float lambda1 = mid + radius, lambda2 = mid - radius;\n\n    if (lambda2 < 0.0) return;\n    vec2 diagonalVector = normalize(vec2(cov2d[0][1], lambda1 - cov2d[0][0]));\n    vec2 majorAxis = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector;\n    vec2 minorAxis = min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x);\n\n    uint colorTransformIndex = texelFetch(u_colorTransformIndices, ivec2(uint(index) & 0x3ffu, uint(index) >> 10), 0).x;\n    mat4 colorTransform = mat4(\n        texelFetch(u_colorTransforms, ivec2(0, colorTransformIndex), 0),\n        texelFetch(u_colorTransforms, ivec2(1, colorTransformIndex), 0),\n        texelFetch(u_colorTransforms, ivec2(2, colorTransformIndex), 0),\n        texelFetch(u_colorTransforms, ivec2(3, colorTransformIndex), 0)\n    );\n\n    vec4 color = vec4((cov.w) & 0xffu, (cov.w >> 8) & 0xffu, (cov.w >> 16) & 0xffu, (cov.w >> 24) & 0xffu) / 255.0;\n    vColor = colorTransform * color;\n\n    vPosition = position;\n    vSize = length(majorAxis);\n    vSelected = selected;\n\n    float scalingFactor = 1.0;\n\n    if (useDepthFade) {\n        float depthNorm = (pos2d.z / pos2d.w + 1.0) / 2.0;\n        float near = 0.1; float far = 100.0;\n        float normalizedDepth = (2.0 * near) / (far + near - depthNorm * (far - near));\n        float start = max(normalizedDepth - 0.1, 0.0);\n        float end = min(normalizedDepth + 0.1, 1.0);\n        scalingFactor = clamp((depthFade - start) / (end - start), 0.0, 1.0);\n    }\n\n    vec2 vCenter = vec2(pos2d) / pos2d.w;\n    gl_Position = vec4(\n        vCenter \n        + position.x * majorAxis * scalingFactor / viewport\n        + position.y * minorAxis * scalingFactor / viewport, 0.0, 1.0);\n}\n`;\n  }\n  _getFragmentSource() {\n    return `#version 300 es\nprecision highp float;\n\nuniform float outlineThickness;\nuniform vec4 outlineColor;\n\nin vec4 vColor;\nin vec2 vPosition;\nin float vSize;\nin float vSelected;\n\nout vec4 fragColor;\n\nvoid main () {\n    float A = -dot(vPosition, vPosition);\n\n    if (A < -4.0) discard;\n\n    if (vSelected < 0.5) {\n        float B = exp(A) * vColor.a;\n        fragColor = vec4(B * vColor.rgb, B);\n        return;\n    }\n\n    float outlineThreshold = -4.0 + (outlineThickness / vSize);\n\n    if (A < outlineThreshold) {\n        fragColor = outlineColor;\n    } \n    else {\n        float B = exp(A) * vColor.a;\n        fragColor = vec4(B * vColor.rgb, B);\n    }\n}\n`;\n  }\n}\nclass nF {\n  constructor(U = 1) {\n    let Q, F, l, Z, t = 0, d = !1;\n    this.initialize = (B) => {\n      if (!(B instanceof SU))\n        throw new Error(\"FadeInPass requires a RenderProgram\");\n      t = B.started ? 1 : 0, d = !0, Q = B, F = B.renderer.gl, l = F.getUniformLocation(Q.program, \"useDepthFade\"), F.uniform1i(l, 1), Z = F.getUniformLocation(Q.program, \"depthFade\"), F.uniform1f(Z, t);\n    }, this.render = () => {\n      var B;\n      d && !(!((B = Q.renderData) === null || B === void 0) && B.updating) && (F.useProgram(Q.program), t = Math.min(t + 0.01 * U, 1), t >= 1 && (d = !1, F.uniform1i(l, 0)), F.uniform1f(Z, t));\n    };\n  }\n  dispose() {\n  }\n}\nclass VF {\n  constructor(U = null, Q = null) {\n    this._backgroundColor = new rU();\n    const F = U || document.createElement(\"canvas\");\n    U || (F.style.display = \"block\", F.style.boxSizing = \"border-box\", F.style.width = \"100%\", F.style.height = \"100%\", F.style.margin = \"0\", F.style.padding = \"0\", document.body.appendChild(F)), F.style.background = this._backgroundColor.toHexString(), this._canvas = F, this._gl = F.getContext(\"webgl2\", { antialias: !1 });\n    const l = Q || [];\n    Q || l.push(new nF()), this._renderProgram = new SU(this, l);\n    const Z = [this._renderProgram];\n    this.resize = () => {\n      const t = F.clientWidth, d = F.clientHeight;\n      F.width === t && F.height === d || this.setSize(t, d);\n    }, this.setSize = (t, d) => {\n      F.width = t, F.height = d, this._gl.viewport(0, 0, F.width, F.height);\n      for (const B of Z)\n        B.resize();\n    }, this.render = (t, d) => {\n      for (const B of Z)\n        B.render(t, d);\n    }, this.dispose = () => {\n      for (const t of Z)\n        t.dispose();\n    }, this.addProgram = (t) => {\n      Z.push(t);\n    }, this.removeProgram = (t) => {\n      const d = Z.indexOf(t);\n      if (d < 0)\n        throw new Error(\"Program not found\");\n      Z.splice(d, 1);\n    }, this.resize();\n  }\n  get canvas() {\n    return this._canvas;\n  }\n  get gl() {\n    return this._gl;\n  }\n  get renderProgram() {\n    return this._renderProgram;\n  }\n  get backgroundColor() {\n    return this._backgroundColor;\n  }\n  set backgroundColor(U) {\n    this._backgroundColor = U, this._canvas.style.background = U.toHexString();\n  }\n}\nclass ZF {\n  constructor(U, Q, F = 0.5, l = 0.5, Z = 5, t = !0, d = new X()) {\n    this.minAngle = -90, this.maxAngle = 90, this.minZoom = 0.1, this.maxZoom = 30, this.orbitSpeed = 1, this.panSpeed = 1, this.zoomSpeed = 1, this.dampening = 0.12, this.setCameraTarget = () => {\n    };\n    let B = d.clone(), n = B.clone(), V = F, R = l, s = Z, h = !1, c = !1, C = 0, I = 0, E = 0;\n    const N = {};\n    let G = !1;\n    U.addEventListener(\"objectChanged\", () => {\n      if (G)\n        return;\n      const i = U.rotation.toEuler();\n      V = -i.y, R = -i.x;\n      const Y = U.position.x - s * Math.sin(V) * Math.cos(R), H = U.position.y + s * Math.sin(R), K = U.position.z + s * Math.cos(V) * Math.cos(R);\n      n = new X(Y, H, K);\n    }), this.setCameraTarget = (i) => {\n      const Y = i.x - U.position.x, H = i.y - U.position.y, K = i.z - U.position.z;\n      s = Math.sqrt(Y * Y + H * H + K * K), R = Math.atan2(H, Math.sqrt(Y * Y + K * K)), V = -Math.atan2(Y, K), n = new X(i.x, i.y, i.z);\n    };\n    const u = () => 0.1 + 0.9 * (s - this.minZoom) / (this.maxZoom - this.minZoom), T = (i) => {\n      N[i.code] = !0, i.code === \"ArrowUp\" && (N.KeyW = !0), i.code === \"ArrowDown\" && (N.KeyS = !0), i.code === \"ArrowLeft\" && (N.KeyA = !0), i.code === \"ArrowRight\" && (N.KeyD = !0);\n    }, j = (i) => {\n      N[i.code] = !1, i.code === \"ArrowUp\" && (N.KeyW = !1), i.code === \"ArrowDown\" && (N.KeyS = !1), i.code === \"ArrowLeft\" && (N.KeyA = !1), i.code === \"ArrowRight\" && (N.KeyD = !1);\n    }, D = (i) => {\n      M(i), h = !0, c = i.button === 2, I = i.clientX, E = i.clientY, window.addEventListener(\"mouseup\", k);\n    }, k = (i) => {\n      M(i), h = !1, c = !1, window.removeEventListener(\"mouseup\", k);\n    }, S = (i) => {\n      if (M(i), !h || !U)\n        return;\n      const Y = i.clientX - I, H = i.clientY - E;\n      if (c) {\n        const K = u(), UU = -Y * this.panSpeed * 0.01 * K, AU = -H * this.panSpeed * 0.01 * K, P = VU.RotationFromQuaternion(U.rotation).buffer, $ = new X(P[0], P[3], P[6]), O = new X(P[1], P[4], P[7]);\n        n = n.add($.multiply(UU)), n = n.add(O.multiply(AU));\n      } else\n        V -= Y * this.orbitSpeed * 3e-3, R += H * this.orbitSpeed * 3e-3, R = Math.min(Math.max(R, this.minAngle * Math.PI / 180), this.maxAngle * Math.PI / 180);\n      I = i.clientX, E = i.clientY;\n    }, w = (i) => {\n      M(i);\n      const Y = u();\n      s += i.deltaY * this.zoomSpeed * 0.025 * Y, s = Math.min(Math.max(s, this.minZoom), this.maxZoom);\n    }, lU = (i) => {\n      if (M(i), i.touches.length === 1)\n        h = !0, c = !1, I = i.touches[0].clientX, E = i.touches[0].clientY, C = 0;\n      else if (i.touches.length === 2) {\n        h = !0, c = !0, I = (i.touches[0].clientX + i.touches[1].clientX) / 2, E = (i.touches[0].clientY + i.touches[1].clientY) / 2;\n        const Y = i.touches[0].clientX - i.touches[1].clientX, H = i.touches[0].clientY - i.touches[1].clientY;\n        C = Math.sqrt(Y * Y + H * H);\n      }\n    }, QU = (i) => {\n      M(i), h = !1, c = !1;\n    }, p = (i) => {\n      if (M(i), h && U)\n        if (c) {\n          const Y = u(), H = i.touches[0].clientX - i.touches[1].clientX, K = i.touches[0].clientY - i.touches[1].clientY, UU = Math.sqrt(H * H + K * K);\n          s += (C - UU) * this.zoomSpeed * 0.1 * Y, s = Math.min(Math.max(s, this.minZoom), this.maxZoom), C = UU;\n          const AU = (i.touches[0].clientX + i.touches[1].clientX) / 2, P = (i.touches[0].clientY + i.touches[1].clientY) / 2, $ = AU - I, O = P - E, tU = VU.RotationFromQuaternion(U.rotation).buffer, dU = new X(tU[0], tU[3], tU[6]), hU = new X(tU[1], tU[4], tU[7]);\n          n = n.add(dU.multiply(-$ * this.panSpeed * 0.025 * Y)), n = n.add(hU.multiply(-O * this.panSpeed * 0.025 * Y)), I = AU, E = P;\n        } else {\n          const Y = i.touches[0].clientX - I, H = i.touches[0].clientY - E;\n          V -= Y * this.orbitSpeed * 3e-3, R += H * this.orbitSpeed * 3e-3, R = Math.min(Math.max(R, this.minAngle * Math.PI / 180), this.maxAngle * Math.PI / 180), I = i.touches[0].clientX, E = i.touches[0].clientY;\n        }\n    }, f = (i, Y, H) => (1 - H) * i + H * Y;\n    this.update = () => {\n      G = !0, F = f(F, V, this.dampening), l = f(l, R, this.dampening), Z = f(Z, s, this.dampening), B = B.lerp(n, this.dampening);\n      const i = B.x + Z * Math.sin(F) * Math.cos(l), Y = B.y - Z * Math.sin(l), H = B.z - Z * Math.cos(F) * Math.cos(l);\n      U.position = new X(i, Y, H);\n      const K = B.subtract(U.position).normalize(), UU = Math.asin(-K.y), AU = Math.atan2(K.x, K.z);\n      U.rotation = z.FromEuler(new X(UU, AU, 0));\n      const P = 0.025, $ = 0.01, O = VU.RotationFromQuaternion(U.rotation).buffer, tU = new X(-O[2], -O[5], -O[8]), dU = new X(O[0], O[3], O[6]);\n      N.KeyS && (n = n.add(tU.multiply(P))), N.KeyW && (n = n.subtract(tU.multiply(P))), N.KeyA && (n = n.subtract(dU.multiply(P))), N.KeyD && (n = n.add(dU.multiply(P))), N.KeyE && (V += $), N.KeyQ && (V -= $), N.KeyR && (R += $), N.KeyF && (R -= $), G = !1;\n    };\n    const M = (i) => {\n      i.preventDefault(), i.stopPropagation();\n    };\n    this.dispose = () => {\n      Q.removeEventListener(\"dragenter\", M), Q.removeEventListener(\"dragover\", M), Q.removeEventListener(\"dragleave\", M), Q.removeEventListener(\"contextmenu\", M), Q.removeEventListener(\"mousedown\", D), Q.removeEventListener(\"mousemove\", S), Q.removeEventListener(\"wheel\", w), Q.removeEventListener(\"touchstart\", lU), Q.removeEventListener(\"touchend\", QU), Q.removeEventListener(\"touchmove\", p), t && (window.removeEventListener(\"keydown\", T), window.removeEventListener(\"keyup\", j));\n    }, t && (window.addEventListener(\"keydown\", T), window.addEventListener(\"keyup\", j)), Q.addEventListener(\"dragenter\", M), Q.addEventListener(\"dragover\", M), Q.addEventListener(\"dragleave\", M), Q.addEventListener(\"contextmenu\", M), Q.addEventListener(\"mousedown\", D), Q.addEventListener(\"mousemove\", S), Q.addEventListener(\"wheel\", w), Q.addEventListener(\"touchstart\", lU), Q.addEventListener(\"touchend\", QU), Q.addEventListener(\"touchmove\", p), this.update();\n  }\n}\nconst {\n  SvelteComponent: AF,\n  binding_callbacks: eF,\n  detach: RF,\n  element: aF,\n  init: WF,\n  insert: cF,\n  noop: JU,\n  safe_not_equal: iF\n} = window.__gradio__svelte__internal, { onMount: sF } = window.__gradio__svelte__internal;\nfunction hF(g) {\n  let U;\n  return {\n    c() {\n      U = aF(\"canvas\");\n    },\n    m(Q, F) {\n      cF(Q, U, F), g[9](U);\n    },\n    p: JU,\n    i: JU,\n    o: JU,\n    d(Q) {\n      Q && RF(U), g[9](null);\n    }\n  };\n}\nfunction oF(g, U) {\n  return g ?? U();\n}\nfunction IF(g, U, Q) {\n  let F, l, { value: Z } = U, { zoom_speed: t } = U, { pan_speed: d } = U, { resolved_url: B = void 0 } = U, n, V, R, s, h = null, c, C = !1, I = null;\n  function E() {\n    if (I !== null && (cancelAnimationFrame(I), I = null), h !== null && (h.dispose(), h = null), R = new qU(), s = new _U(), h = new VF(V), h.backgroundColor = new rU(255, 255, 255, 255), c = new ZF(s, V), c.zoomSpeed = t, c.panSpeed = d, !Z)\n      return;\n    let G = !1;\n    const u = async () => {\n      if (G) {\n        console.error(\"Already loading\");\n        return;\n      }\n      if (!B)\n        throw new Error(\"No resolved URL\");\n      if (G = !0, B.endsWith(\".ply\"))\n        await UF.LoadAsync(B, R, void 0);\n      else if (B.endsWith(\".splat\"))\n        await $U.LoadAsync(B, R, void 0);\n      else\n        throw new Error(\"Unsupported file type\");\n      G = !1;\n    }, T = () => {\n      if (h) {\n        if (G) {\n          I = requestAnimationFrame(T);\n          return;\n        }\n        c.update(), h.render(R, s), I = requestAnimationFrame(T);\n      }\n    };\n    u(), I = requestAnimationFrame(T);\n  }\n  sF(() => (Z != null && E(), Q(6, C = !0), () => {\n    h && h.dispose();\n  }));\n  function N(G) {\n    eF[G ? \"unshift\" : \"push\"](() => {\n      V = G, Q(0, V);\n    });\n  }\n  return g.$$set = (G) => {\n    \"value\" in G && Q(2, Z = G.value), \"zoom_speed\" in G && Q(3, t = G.zoom_speed), \"pan_speed\" in G && Q(4, d = G.pan_speed), \"resolved_url\" in G && Q(1, B = G.resolved_url);\n  }, g.$$.update = () => {\n    if (g.$$.dirty & /*value*/\n    4 && Q(8, F = Z.url), g.$$.dirty & /*url, latest_url*/\n    288 && (Q(1, B = F), F)) {\n      Q(5, n = F);\n      const G = F;\n      KU(F).then((u) => {\n        n === G ? Q(1, B = oF(u, () => {\n        })) : u && URL.revokeObjectURL(u);\n      });\n    }\n    g.$$.dirty & /*value*/\n    4 && Q(7, { path: l } = Z || { path: void 0 }, l), g.$$.dirty & /*canvas, mounted, path*/\n    193 && V && C && l && E();\n  }, [\n    V,\n    B,\n    Z,\n    t,\n    d,\n    n,\n    C,\n    l,\n    F,\n    N\n  ];\n}\nclass rF extends AF {\n  constructor(U) {\n    super(), WF(this, U, IF, hF, iF, {\n      value: 2,\n      zoom_speed: 3,\n      pan_speed: 4,\n      resolved_url: 1\n    });\n  }\n}\nexport {\n  rF as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/Index-f5583db3.js",
    "content": "const {\n  SvelteComponent: Ml,\n  assign: Rl,\n  create_slot: Ul,\n  detach: Fl,\n  element: Gl,\n  get_all_dirty_from_scope: jl,\n  get_slot_changes: ql,\n  get_spread_update: zl,\n  init: Vl,\n  insert: Xl,\n  safe_not_equal: Wl,\n  set_dynamic_element_data: Kr,\n  set_style: he,\n  toggle_class: je,\n  transition_in: po,\n  transition_out: go,\n  update_slot_base: Zl\n} = window.__gradio__svelte__internal;\nfunction xl(e) {\n  let t, n, r;\n  const i = (\n    /*#slots*/\n    e[18].default\n  ), o = Ul(\n    i,\n    e,\n    /*$$scope*/\n    e[17],\n    null\n  );\n  let l = [\n    { \"data-testid\": (\n      /*test_id*/\n      e[7]\n    ) },\n    { id: (\n      /*elem_id*/\n      e[2]\n    ) },\n    {\n      class: n = \"block \" + /*elem_classes*/\n      e[3].join(\" \") + \" svelte-1t38q2d\"\n    }\n  ], a = {};\n  for (let s = 0; s < l.length; s += 1)\n    a = Rl(a, l[s]);\n  return {\n    c() {\n      t = Gl(\n        /*tag*/\n        e[14]\n      ), o && o.c(), Kr(\n        /*tag*/\n        e[14]\n      )(t, a), je(\n        t,\n        \"hidden\",\n        /*visible*/\n        e[10] === !1\n      ), je(\n        t,\n        \"padded\",\n        /*padding*/\n        e[6]\n      ), je(\n        t,\n        \"border_focus\",\n        /*border_mode*/\n        e[5] === \"focus\"\n      ), je(t, \"hide-container\", !/*explicit_call*/\n      e[8] && !/*container*/\n      e[9]), he(\n        t,\n        \"height\",\n        /*get_dimension*/\n        e[15](\n          /*height*/\n          e[0]\n        )\n      ), he(t, \"width\", typeof /*width*/\n      e[1] == \"number\" ? `calc(min(${/*width*/\n      e[1]}px, 100%))` : (\n        /*get_dimension*/\n        e[15](\n          /*width*/\n          e[1]\n        )\n      )), he(\n        t,\n        \"border-style\",\n        /*variant*/\n        e[4]\n      ), he(\n        t,\n        \"overflow\",\n        /*allow_overflow*/\n        e[11] ? \"visible\" : \"hidden\"\n      ), he(\n        t,\n        \"flex-grow\",\n        /*scale*/\n        e[12]\n      ), he(t, \"min-width\", `calc(min(${/*min_width*/\n      e[13]}px, 100%))`), he(t, \"border-width\", \"var(--block-border-width)\");\n    },\n    m(s, u) {\n      Xl(s, t, u), o && o.m(t, null), r = !0;\n    },\n    p(s, u) {\n      o && o.p && (!r || u & /*$$scope*/\n      131072) && Zl(\n        o,\n        i,\n        s,\n        /*$$scope*/\n        s[17],\n        r ? ql(\n          i,\n          /*$$scope*/\n          s[17],\n          u,\n          null\n        ) : jl(\n          /*$$scope*/\n          s[17]\n        ),\n        null\n      ), Kr(\n        /*tag*/\n        s[14]\n      )(t, a = zl(l, [\n        (!r || u & /*test_id*/\n        128) && { \"data-testid\": (\n          /*test_id*/\n          s[7]\n        ) },\n        (!r || u & /*elem_id*/\n        4) && { id: (\n          /*elem_id*/\n          s[2]\n        ) },\n        (!r || u & /*elem_classes*/\n        8 && n !== (n = \"block \" + /*elem_classes*/\n        s[3].join(\" \") + \" svelte-1t38q2d\")) && { class: n }\n      ])), je(\n        t,\n        \"hidden\",\n        /*visible*/\n        s[10] === !1\n      ), je(\n        t,\n        \"padded\",\n        /*padding*/\n        s[6]\n      ), je(\n        t,\n        \"border_focus\",\n        /*border_mode*/\n        s[5] === \"focus\"\n      ), je(t, \"hide-container\", !/*explicit_call*/\n      s[8] && !/*container*/\n      s[9]), u & /*height*/\n      1 && he(\n        t,\n        \"height\",\n        /*get_dimension*/\n        s[15](\n          /*height*/\n          s[0]\n        )\n      ), u & /*width*/\n      2 && he(t, \"width\", typeof /*width*/\n      s[1] == \"number\" ? `calc(min(${/*width*/\n      s[1]}px, 100%))` : (\n        /*get_dimension*/\n        s[15](\n          /*width*/\n          s[1]\n        )\n      )), u & /*variant*/\n      16 && he(\n        t,\n        \"border-style\",\n        /*variant*/\n        s[4]\n      ), u & /*allow_overflow*/\n      2048 && he(\n        t,\n        \"overflow\",\n        /*allow_overflow*/\n        s[11] ? \"visible\" : \"hidden\"\n      ), u & /*scale*/\n      4096 && he(\n        t,\n        \"flex-grow\",\n        /*scale*/\n        s[12]\n      ), u & /*min_width*/\n      8192 && he(t, \"min-width\", `calc(min(${/*min_width*/\n      s[13]}px, 100%))`);\n    },\n    i(s) {\n      r || (po(o, s), r = !0);\n    },\n    o(s) {\n      go(o, s), r = !1;\n    },\n    d(s) {\n      s && Fl(t), o && o.d(s);\n    }\n  };\n}\nfunction Jl(e) {\n  let t, n = (\n    /*tag*/\n    e[14] && xl(e)\n  );\n  return {\n    c() {\n      n && n.c();\n    },\n    m(r, i) {\n      n && n.m(r, i), t = !0;\n    },\n    p(r, [i]) {\n      /*tag*/\n      r[14] && n.p(r, i);\n    },\n    i(r) {\n      t || (po(n, r), t = !0);\n    },\n    o(r) {\n      go(n, r), t = !1;\n    },\n    d(r) {\n      n && n.d(r);\n    }\n  };\n}\nfunction Ql(e, t, n) {\n  let { $$slots: r = {}, $$scope: i } = t, { height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: a = \"\" } = t, { elem_classes: s = [] } = t, { variant: u = \"solid\" } = t, { border_mode: f = \"base\" } = t, { padding: c = !0 } = t, { type: _ = \"normal\" } = t, { test_id: h = void 0 } = t, { explicit_call: d = !1 } = t, { container: p = !0 } = t, { visible: w = !0 } = t, { allow_overflow: v = !0 } = t, { scale: E = null } = t, { min_width: b = 0 } = t, S = _ === \"fieldset\" ? \"fieldset\" : \"div\";\n  const H = (g) => {\n    if (g !== void 0) {\n      if (typeof g == \"number\")\n        return g + \"px\";\n      if (typeof g == \"string\")\n        return g;\n    }\n  };\n  return e.$$set = (g) => {\n    \"height\" in g && n(0, o = g.height), \"width\" in g && n(1, l = g.width), \"elem_id\" in g && n(2, a = g.elem_id), \"elem_classes\" in g && n(3, s = g.elem_classes), \"variant\" in g && n(4, u = g.variant), \"border_mode\" in g && n(5, f = g.border_mode), \"padding\" in g && n(6, c = g.padding), \"type\" in g && n(16, _ = g.type), \"test_id\" in g && n(7, h = g.test_id), \"explicit_call\" in g && n(8, d = g.explicit_call), \"container\" in g && n(9, p = g.container), \"visible\" in g && n(10, w = g.visible), \"allow_overflow\" in g && n(11, v = g.allow_overflow), \"scale\" in g && n(12, E = g.scale), \"min_width\" in g && n(13, b = g.min_width), \"$$scope\" in g && n(17, i = g.$$scope);\n  }, [\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c,\n    h,\n    d,\n    p,\n    w,\n    v,\n    E,\n    b,\n    S,\n    H,\n    _,\n    i,\n    r\n  ];\n}\nclass bo extends Ml {\n  constructor(t) {\n    super(), Vl(this, t, Ql, Jl, Wl, {\n      height: 0,\n      width: 1,\n      elem_id: 2,\n      elem_classes: 3,\n      variant: 4,\n      border_mode: 5,\n      padding: 6,\n      type: 16,\n      test_id: 7,\n      explicit_call: 8,\n      container: 9,\n      visible: 10,\n      allow_overflow: 11,\n      scale: 12,\n      min_width: 13\n    });\n  }\n}\nconst {\n  SvelteComponent: Yl,\n  append: qn,\n  attr: on,\n  create_component: Kl,\n  destroy_component: $l,\n  detach: es,\n  element: $r,\n  init: ts,\n  insert: ns,\n  mount_component: rs,\n  safe_not_equal: is,\n  set_data: os,\n  space: ls,\n  text: ss,\n  toggle_class: qe,\n  transition_in: as,\n  transition_out: us\n} = window.__gradio__svelte__internal;\nfunction fs(e) {\n  let t, n, r, i, o, l;\n  return r = new /*Icon*/\n  e[1]({}), {\n    c() {\n      t = $r(\"label\"), n = $r(\"span\"), Kl(r.$$.fragment), i = ls(), o = ss(\n        /*label*/\n        e[0]\n      ), on(n, \"class\", \"svelte-9gxdi0\"), on(t, \"for\", \"\"), on(t, \"data-testid\", \"block-label\"), on(t, \"class\", \"svelte-9gxdi0\"), qe(t, \"hide\", !/*show_label*/\n      e[2]), qe(t, \"sr-only\", !/*show_label*/\n      e[2]), qe(\n        t,\n        \"float\",\n        /*float*/\n        e[4]\n      ), qe(\n        t,\n        \"hide-label\",\n        /*disable*/\n        e[3]\n      );\n    },\n    m(a, s) {\n      ns(a, t, s), qn(t, n), rs(r, n, null), qn(t, i), qn(t, o), l = !0;\n    },\n    p(a, [s]) {\n      (!l || s & /*label*/\n      1) && os(\n        o,\n        /*label*/\n        a[0]\n      ), (!l || s & /*show_label*/\n      4) && qe(t, \"hide\", !/*show_label*/\n      a[2]), (!l || s & /*show_label*/\n      4) && qe(t, \"sr-only\", !/*show_label*/\n      a[2]), (!l || s & /*float*/\n      16) && qe(\n        t,\n        \"float\",\n        /*float*/\n        a[4]\n      ), (!l || s & /*disable*/\n      8) && qe(\n        t,\n        \"hide-label\",\n        /*disable*/\n        a[3]\n      );\n    },\n    i(a) {\n      l || (as(r.$$.fragment, a), l = !0);\n    },\n    o(a) {\n      us(r.$$.fragment, a), l = !1;\n    },\n    d(a) {\n      a && es(t), $l(r);\n    }\n  };\n}\nfunction cs(e, t, n) {\n  let { label: r = null } = t, { Icon: i } = t, { show_label: o = !0 } = t, { disable: l = !1 } = t, { float: a = !0 } = t;\n  return e.$$set = (s) => {\n    \"label\" in s && n(0, r = s.label), \"Icon\" in s && n(1, i = s.Icon), \"show_label\" in s && n(2, o = s.show_label), \"disable\" in s && n(3, l = s.disable), \"float\" in s && n(4, a = s.float);\n  }, [r, i, o, l, a];\n}\nclass Fr extends Yl {\n  constructor(t) {\n    super(), ts(this, t, cs, fs, is, {\n      label: 0,\n      Icon: 1,\n      show_label: 2,\n      disable: 3,\n      float: 4\n    });\n  }\n}\nconst {\n  SvelteComponent: _s,\n  append: gr,\n  attr: Ue,\n  bubble: hs,\n  create_component: ds,\n  destroy_component: ms,\n  detach: wo,\n  element: br,\n  init: ps,\n  insert: vo,\n  listen: gs,\n  mount_component: bs,\n  safe_not_equal: ws,\n  set_data: vs,\n  set_style: ln,\n  space: ys,\n  text: Es,\n  toggle_class: ge,\n  transition_in: Ss,\n  transition_out: ks\n} = window.__gradio__svelte__internal;\nfunction ei(e) {\n  let t, n;\n  return {\n    c() {\n      t = br(\"span\"), n = Es(\n        /*label*/\n        e[1]\n      ), Ue(t, \"class\", \"svelte-lpi64a\");\n    },\n    m(r, i) {\n      vo(r, t, i), gr(t, n);\n    },\n    p(r, i) {\n      i & /*label*/\n      2 && vs(\n        n,\n        /*label*/\n        r[1]\n      );\n    },\n    d(r) {\n      r && wo(t);\n    }\n  };\n}\nfunction Ts(e) {\n  let t, n, r, i, o, l, a, s = (\n    /*show_label*/\n    e[2] && ei(e)\n  );\n  return i = new /*Icon*/\n  e[0]({}), {\n    c() {\n      t = br(\"button\"), s && s.c(), n = ys(), r = br(\"div\"), ds(i.$$.fragment), Ue(r, \"class\", \"svelte-lpi64a\"), ge(\n        r,\n        \"small\",\n        /*size*/\n        e[4] === \"small\"\n      ), ge(\n        r,\n        \"large\",\n        /*size*/\n        e[4] === \"large\"\n      ), t.disabled = /*disabled*/\n      e[7], Ue(\n        t,\n        \"aria-label\",\n        /*label*/\n        e[1]\n      ), Ue(\n        t,\n        \"aria-haspopup\",\n        /*hasPopup*/\n        e[8]\n      ), Ue(\n        t,\n        \"title\",\n        /*label*/\n        e[1]\n      ), Ue(t, \"class\", \"svelte-lpi64a\"), ge(\n        t,\n        \"pending\",\n        /*pending*/\n        e[3]\n      ), ge(\n        t,\n        \"padded\",\n        /*padded*/\n        e[5]\n      ), ge(\n        t,\n        \"highlight\",\n        /*highlight*/\n        e[6]\n      ), ge(\n        t,\n        \"transparent\",\n        /*transparent*/\n        e[9]\n      ), ln(t, \"color\", !/*disabled*/\n      e[7] && /*_color*/\n      e[11] ? (\n        /*_color*/\n        e[11]\n      ) : \"var(--block-label-text-color)\"), ln(t, \"--bg-color\", /*disabled*/\n      e[7] ? \"auto\" : (\n        /*background*/\n        e[10]\n      ));\n    },\n    m(u, f) {\n      vo(u, t, f), s && s.m(t, null), gr(t, n), gr(t, r), bs(i, r, null), o = !0, l || (a = gs(\n        t,\n        \"click\",\n        /*click_handler*/\n        e[13]\n      ), l = !0);\n    },\n    p(u, [f]) {\n      /*show_label*/\n      u[2] ? s ? s.p(u, f) : (s = ei(u), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!o || f & /*size*/\n      16) && ge(\n        r,\n        \"small\",\n        /*size*/\n        u[4] === \"small\"\n      ), (!o || f & /*size*/\n      16) && ge(\n        r,\n        \"large\",\n        /*size*/\n        u[4] === \"large\"\n      ), (!o || f & /*disabled*/\n      128) && (t.disabled = /*disabled*/\n      u[7]), (!o || f & /*label*/\n      2) && Ue(\n        t,\n        \"aria-label\",\n        /*label*/\n        u[1]\n      ), (!o || f & /*hasPopup*/\n      256) && Ue(\n        t,\n        \"aria-haspopup\",\n        /*hasPopup*/\n        u[8]\n      ), (!o || f & /*label*/\n      2) && Ue(\n        t,\n        \"title\",\n        /*label*/\n        u[1]\n      ), (!o || f & /*pending*/\n      8) && ge(\n        t,\n        \"pending\",\n        /*pending*/\n        u[3]\n      ), (!o || f & /*padded*/\n      32) && ge(\n        t,\n        \"padded\",\n        /*padded*/\n        u[5]\n      ), (!o || f & /*highlight*/\n      64) && ge(\n        t,\n        \"highlight\",\n        /*highlight*/\n        u[6]\n      ), (!o || f & /*transparent*/\n      512) && ge(\n        t,\n        \"transparent\",\n        /*transparent*/\n        u[9]\n      ), f & /*disabled, _color*/\n      2176 && ln(t, \"color\", !/*disabled*/\n      u[7] && /*_color*/\n      u[11] ? (\n        /*_color*/\n        u[11]\n      ) : \"var(--block-label-text-color)\"), f & /*disabled, background*/\n      1152 && ln(t, \"--bg-color\", /*disabled*/\n      u[7] ? \"auto\" : (\n        /*background*/\n        u[10]\n      ));\n    },\n    i(u) {\n      o || (Ss(i.$$.fragment, u), o = !0);\n    },\n    o(u) {\n      ks(i.$$.fragment, u), o = !1;\n    },\n    d(u) {\n      u && wo(t), s && s.d(), ms(i), l = !1, a();\n    }\n  };\n}\nfunction As(e, t, n) {\n  let r, { Icon: i } = t, { label: o = \"\" } = t, { show_label: l = !1 } = t, { pending: a = !1 } = t, { size: s = \"small\" } = t, { padded: u = !0 } = t, { highlight: f = !1 } = t, { disabled: c = !1 } = t, { hasPopup: _ = !1 } = t, { color: h = \"var(--block-label-text-color)\" } = t, { transparent: d = !1 } = t, { background: p = \"var(--background-fill-primary)\" } = t;\n  function w(v) {\n    hs.call(this, e, v);\n  }\n  return e.$$set = (v) => {\n    \"Icon\" in v && n(0, i = v.Icon), \"label\" in v && n(1, o = v.label), \"show_label\" in v && n(2, l = v.show_label), \"pending\" in v && n(3, a = v.pending), \"size\" in v && n(4, s = v.size), \"padded\" in v && n(5, u = v.padded), \"highlight\" in v && n(6, f = v.highlight), \"disabled\" in v && n(7, c = v.disabled), \"hasPopup\" in v && n(8, _ = v.hasPopup), \"color\" in v && n(12, h = v.color), \"transparent\" in v && n(9, d = v.transparent), \"background\" in v && n(10, p = v.background);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*highlight, color*/\n    4160 && n(11, r = f ? \"var(--color-accent)\" : h);\n  }, [\n    i,\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c,\n    _,\n    d,\n    p,\n    r,\n    h,\n    w\n  ];\n}\nclass Pt extends _s {\n  constructor(t) {\n    super(), ps(this, t, As, Ts, ws, {\n      Icon: 0,\n      label: 1,\n      show_label: 2,\n      pending: 3,\n      size: 4,\n      padded: 5,\n      highlight: 6,\n      disabled: 7,\n      hasPopup: 8,\n      color: 12,\n      transparent: 9,\n      background: 10\n    });\n  }\n}\nconst {\n  SvelteComponent: Bs,\n  append: Cs,\n  attr: zn,\n  binding_callbacks: Hs,\n  create_slot: Ns,\n  detach: Ps,\n  element: ti,\n  get_all_dirty_from_scope: Is,\n  get_slot_changes: Ls,\n  init: Os,\n  insert: Ds,\n  safe_not_equal: Ms,\n  toggle_class: ze,\n  transition_in: Rs,\n  transition_out: Us,\n  update_slot_base: Fs\n} = window.__gradio__svelte__internal;\nfunction Gs(e) {\n  let t, n, r;\n  const i = (\n    /*#slots*/\n    e[5].default\n  ), o = Ns(\n    i,\n    e,\n    /*$$scope*/\n    e[4],\n    null\n  );\n  return {\n    c() {\n      t = ti(\"div\"), n = ti(\"div\"), o && o.c(), zn(n, \"class\", \"icon svelte-3w3rth\"), zn(t, \"class\", \"empty svelte-3w3rth\"), zn(t, \"aria-label\", \"Empty value\"), ze(\n        t,\n        \"small\",\n        /*size*/\n        e[0] === \"small\"\n      ), ze(\n        t,\n        \"large\",\n        /*size*/\n        e[0] === \"large\"\n      ), ze(\n        t,\n        \"unpadded_box\",\n        /*unpadded_box*/\n        e[1]\n      ), ze(\n        t,\n        \"small_parent\",\n        /*parent_height*/\n        e[3]\n      );\n    },\n    m(l, a) {\n      Ds(l, t, a), Cs(t, n), o && o.m(n, null), e[6](t), r = !0;\n    },\n    p(l, [a]) {\n      o && o.p && (!r || a & /*$$scope*/\n      16) && Fs(\n        o,\n        i,\n        l,\n        /*$$scope*/\n        l[4],\n        r ? Ls(\n          i,\n          /*$$scope*/\n          l[4],\n          a,\n          null\n        ) : Is(\n          /*$$scope*/\n          l[4]\n        ),\n        null\n      ), (!r || a & /*size*/\n      1) && ze(\n        t,\n        \"small\",\n        /*size*/\n        l[0] === \"small\"\n      ), (!r || a & /*size*/\n      1) && ze(\n        t,\n        \"large\",\n        /*size*/\n        l[0] === \"large\"\n      ), (!r || a & /*unpadded_box*/\n      2) && ze(\n        t,\n        \"unpadded_box\",\n        /*unpadded_box*/\n        l[1]\n      ), (!r || a & /*parent_height*/\n      8) && ze(\n        t,\n        \"small_parent\",\n        /*parent_height*/\n        l[3]\n      );\n    },\n    i(l) {\n      r || (Rs(o, l), r = !0);\n    },\n    o(l) {\n      Us(o, l), r = !1;\n    },\n    d(l) {\n      l && Ps(t), o && o.d(l), e[6](null);\n    }\n  };\n}\nfunction js(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nfunction qs(e, t, n) {\n  let r, { $$slots: i = {}, $$scope: o } = t, { size: l = \"small\" } = t, { unpadded_box: a = !1 } = t, s;\n  function u(c) {\n    if (!c)\n      return !1;\n    const { height: _ } = c.getBoundingClientRect(), { height: h } = js([\n      c,\n      \"access\",\n      (d) => d.parentElement,\n      \"optionalAccess\",\n      (d) => d.getBoundingClientRect,\n      \"call\",\n      (d) => d()\n    ]) || { height: _ };\n    return _ > h + 2;\n  }\n  function f(c) {\n    Hs[c ? \"unshift\" : \"push\"](() => {\n      s = c, n(2, s);\n    });\n  }\n  return e.$$set = (c) => {\n    \"size\" in c && n(0, l = c.size), \"unpadded_box\" in c && n(1, a = c.unpadded_box), \"$$scope\" in c && n(4, o = c.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*el*/\n    4 && n(3, r = u(s));\n  }, [l, a, s, r, o, i, f];\n}\nclass zs extends Bs {\n  constructor(t) {\n    super(), Os(this, t, qs, Gs, Ms, { size: 0, unpadded_box: 1 });\n  }\n}\nconst {\n  SvelteComponent: Vs,\n  append: Vn,\n  attr: Ae,\n  detach: Xs,\n  init: Ws,\n  insert: Zs,\n  noop: Xn,\n  safe_not_equal: xs,\n  set_style: Pe,\n  svg_element: sn\n} = window.__gradio__svelte__internal;\nfunction Js(e) {\n  let t, n, r, i;\n  return {\n    c() {\n      t = sn(\"svg\"), n = sn(\"g\"), r = sn(\"path\"), i = sn(\"path\"), Ae(r, \"d\", \"M18,6L6.087,17.913\"), Pe(r, \"fill\", \"none\"), Pe(r, \"fill-rule\", \"nonzero\"), Pe(r, \"stroke-width\", \"2px\"), Ae(n, \"transform\", \"matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)\"), Ae(i, \"d\", \"M4.364,4.364L19.636,19.636\"), Pe(i, \"fill\", \"none\"), Pe(i, \"fill-rule\", \"nonzero\"), Pe(i, \"stroke-width\", \"2px\"), Ae(t, \"width\", \"100%\"), Ae(t, \"height\", \"100%\"), Ae(t, \"viewBox\", \"0 0 24 24\"), Ae(t, \"version\", \"1.1\"), Ae(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), Ae(t, \"xmlns:xlink\", \"http://www.w3.org/1999/xlink\"), Ae(t, \"xml:space\", \"preserve\"), Ae(t, \"stroke\", \"currentColor\"), Pe(t, \"fill-rule\", \"evenodd\"), Pe(t, \"clip-rule\", \"evenodd\"), Pe(t, \"stroke-linecap\", \"round\"), Pe(t, \"stroke-linejoin\", \"round\");\n    },\n    m(o, l) {\n      Zs(o, t, l), Vn(t, n), Vn(n, r), Vn(t, i);\n    },\n    p: Xn,\n    i: Xn,\n    o: Xn,\n    d(o) {\n      o && Xs(t);\n    }\n  };\n}\nclass Qs extends Vs {\n  constructor(t) {\n    super(), Ws(this, t, null, Js, xs, {});\n  }\n}\nconst {\n  SvelteComponent: Ys,\n  append: Ks,\n  attr: bt,\n  detach: $s,\n  init: ea,\n  insert: ta,\n  noop: Wn,\n  safe_not_equal: na,\n  svg_element: ni\n} = window.__gradio__svelte__internal;\nfunction ra(e) {\n  let t, n;\n  return {\n    c() {\n      t = ni(\"svg\"), n = ni(\"path\"), bt(n, \"fill\", \"currentColor\"), bt(n, \"d\", \"M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z\"), bt(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), bt(t, \"width\", \"100%\"), bt(t, \"height\", \"100%\"), bt(t, \"viewBox\", \"0 0 32 32\");\n    },\n    m(r, i) {\n      ta(r, t, i), Ks(t, n);\n    },\n    p: Wn,\n    i: Wn,\n    o: Wn,\n    d(r) {\n      r && $s(t);\n    }\n  };\n}\nclass yo extends Ys {\n  constructor(t) {\n    super(), ea(this, t, null, ra, na, {});\n  }\n}\nconst {\n  SvelteComponent: ia,\n  append: oa,\n  attr: Be,\n  detach: la,\n  init: sa,\n  insert: aa,\n  noop: Zn,\n  safe_not_equal: ua,\n  svg_element: ri\n} = window.__gradio__svelte__internal;\nfunction fa(e) {\n  let t, n;\n  return {\n    c() {\n      t = ri(\"svg\"), n = ri(\"path\"), Be(n, \"d\", \"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\"), Be(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), Be(t, \"width\", \"100%\"), Be(t, \"height\", \"100%\"), Be(t, \"viewBox\", \"0 0 24 24\"), Be(t, \"fill\", \"none\"), Be(t, \"stroke\", \"currentColor\"), Be(t, \"stroke-width\", \"1.5\"), Be(t, \"stroke-linecap\", \"round\"), Be(t, \"stroke-linejoin\", \"round\"), Be(t, \"class\", \"feather feather-edit-2\");\n    },\n    m(r, i) {\n      aa(r, t, i), oa(t, n);\n    },\n    p: Zn,\n    i: Zn,\n    o: Zn,\n    d(r) {\n      r && la(t);\n    }\n  };\n}\nclass ca extends ia {\n  constructor(t) {\n    super(), sa(this, t, null, fa, ua, {});\n  }\n}\nconst {\n  SvelteComponent: _a,\n  append: ii,\n  attr: be,\n  detach: ha,\n  init: da,\n  insert: ma,\n  noop: xn,\n  safe_not_equal: pa,\n  svg_element: Jn\n} = window.__gradio__svelte__internal;\nfunction ga(e) {\n  let t, n, r;\n  return {\n    c() {\n      t = Jn(\"svg\"), n = Jn(\"path\"), r = Jn(\"polyline\"), be(n, \"d\", \"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z\"), be(r, \"points\", \"13 2 13 9 20 9\"), be(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), be(t, \"width\", \"100%\"), be(t, \"height\", \"100%\"), be(t, \"viewBox\", \"0 0 24 24\"), be(t, \"fill\", \"none\"), be(t, \"stroke\", \"currentColor\"), be(t, \"stroke-width\", \"1.5\"), be(t, \"stroke-linecap\", \"round\"), be(t, \"stroke-linejoin\", \"round\"), be(t, \"class\", \"feather feather-file\");\n    },\n    m(i, o) {\n      ma(i, t, o), ii(t, n), ii(t, r);\n    },\n    p: xn,\n    i: xn,\n    o: xn,\n    d(i) {\n      i && ha(t);\n    }\n  };\n}\nlet Cn = class extends _a {\n  constructor(t) {\n    super(), da(this, t, null, ga, pa, {});\n  }\n};\nconst {\n  SvelteComponent: ba,\n  append: wa,\n  attr: wt,\n  detach: va,\n  init: ya,\n  insert: Ea,\n  noop: Qn,\n  safe_not_equal: Sa,\n  svg_element: oi\n} = window.__gradio__svelte__internal;\nfunction ka(e) {\n  let t, n;\n  return {\n    c() {\n      t = oi(\"svg\"), n = oi(\"path\"), wt(n, \"fill\", \"currentColor\"), wt(n, \"d\", \"M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a3.99 3.99 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2h3.5Zm2.245 2.096L16 4.25c0-.052-.002-.103-.005-.154ZM13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5ZM15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3h-5Zm0 11a2.985 2.985 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A2.985 2.985 0 0 1 20 23h-5Zm5-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z\"), wt(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), wt(t, \"width\", \"100%\"), wt(t, \"height\", \"100%\"), wt(t, \"viewBox\", \"0 0 24 24\");\n    },\n    m(r, i) {\n      Ea(r, t, i), wa(t, n);\n    },\n    p: Qn,\n    i: Qn,\n    o: Qn,\n    d(r) {\n      r && va(t);\n    }\n  };\n}\nclass Ta extends ba {\n  constructor(t) {\n    super(), ya(this, t, null, ka, Sa, {});\n  }\n}\nconst {\n  SvelteComponent: Aa,\n  append: li,\n  attr: we,\n  detach: Ba,\n  init: Ca,\n  insert: Ha,\n  noop: Yn,\n  safe_not_equal: Na,\n  svg_element: Kn\n} = window.__gradio__svelte__internal;\nfunction Pa(e) {\n  let t, n, r;\n  return {\n    c() {\n      t = Kn(\"svg\"), n = Kn(\"polyline\"), r = Kn(\"path\"), we(n, \"points\", \"1 4 1 10 7 10\"), we(r, \"d\", \"M3.51 15a9 9 0 1 0 2.13-9.36L1 10\"), we(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), we(t, \"width\", \"100%\"), we(t, \"height\", \"100%\"), we(t, \"viewBox\", \"0 0 24 24\"), we(t, \"fill\", \"none\"), we(t, \"stroke\", \"currentColor\"), we(t, \"stroke-width\", \"2\"), we(t, \"stroke-linecap\", \"round\"), we(t, \"stroke-linejoin\", \"round\"), we(t, \"class\", \"feather feather-rotate-ccw\");\n    },\n    m(i, o) {\n      Ha(i, t, o), li(t, n), li(t, r);\n    },\n    p: Yn,\n    i: Yn,\n    o: Yn,\n    d(i) {\n      i && Ba(t);\n    }\n  };\n}\nclass Eo extends Aa {\n  constructor(t) {\n    super(), Ca(this, t, null, Pa, Na, {});\n  }\n}\nconst {\n  SvelteComponent: Ia,\n  append: $n,\n  attr: K,\n  detach: La,\n  init: Oa,\n  insert: Da,\n  noop: er,\n  safe_not_equal: Ma,\n  svg_element: an\n} = window.__gradio__svelte__internal;\nfunction Ra(e) {\n  let t, n, r, i;\n  return {\n    c() {\n      t = an(\"svg\"), n = an(\"path\"), r = an(\"polyline\"), i = an(\"line\"), K(n, \"d\", \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"), K(r, \"points\", \"17 8 12 3 7 8\"), K(i, \"x1\", \"12\"), K(i, \"y1\", \"3\"), K(i, \"x2\", \"12\"), K(i, \"y2\", \"15\"), K(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), K(t, \"width\", \"90%\"), K(t, \"height\", \"90%\"), K(t, \"viewBox\", \"0 0 24 24\"), K(t, \"fill\", \"none\"), K(t, \"stroke\", \"currentColor\"), K(t, \"stroke-width\", \"2\"), K(t, \"stroke-linecap\", \"round\"), K(t, \"stroke-linejoin\", \"round\"), K(t, \"class\", \"feather feather-upload\");\n    },\n    m(o, l) {\n      Da(o, t, l), $n(t, n), $n(t, r), $n(t, i);\n    },\n    p: er,\n    i: er,\n    o: er,\n    d(o) {\n      o && La(t);\n    }\n  };\n}\nlet Ua = class extends Ia {\n  constructor(t) {\n    super(), Oa(this, t, null, Ra, Ma, {});\n  }\n};\nconst Fa = [\n  { color: \"red\", primary: 600, secondary: 100 },\n  { color: \"green\", primary: 600, secondary: 100 },\n  { color: \"blue\", primary: 600, secondary: 100 },\n  { color: \"yellow\", primary: 500, secondary: 100 },\n  { color: \"purple\", primary: 600, secondary: 100 },\n  { color: \"teal\", primary: 600, secondary: 100 },\n  { color: \"orange\", primary: 600, secondary: 100 },\n  { color: \"cyan\", primary: 600, secondary: 100 },\n  { color: \"lime\", primary: 500, secondary: 100 },\n  { color: \"pink\", primary: 600, secondary: 100 }\n], si = {\n  inherit: \"inherit\",\n  current: \"currentColor\",\n  transparent: \"transparent\",\n  black: \"#000\",\n  white: \"#fff\",\n  slate: {\n    50: \"#f8fafc\",\n    100: \"#f1f5f9\",\n    200: \"#e2e8f0\",\n    300: \"#cbd5e1\",\n    400: \"#94a3b8\",\n    500: \"#64748b\",\n    600: \"#475569\",\n    700: \"#334155\",\n    800: \"#1e293b\",\n    900: \"#0f172a\",\n    950: \"#020617\"\n  },\n  gray: {\n    50: \"#f9fafb\",\n    100: \"#f3f4f6\",\n    200: \"#e5e7eb\",\n    300: \"#d1d5db\",\n    400: \"#9ca3af\",\n    500: \"#6b7280\",\n    600: \"#4b5563\",\n    700: \"#374151\",\n    800: \"#1f2937\",\n    900: \"#111827\",\n    950: \"#030712\"\n  },\n  zinc: {\n    50: \"#fafafa\",\n    100: \"#f4f4f5\",\n    200: \"#e4e4e7\",\n    300: \"#d4d4d8\",\n    400: \"#a1a1aa\",\n    500: \"#71717a\",\n    600: \"#52525b\",\n    700: \"#3f3f46\",\n    800: \"#27272a\",\n    900: \"#18181b\",\n    950: \"#09090b\"\n  },\n  neutral: {\n    50: \"#fafafa\",\n    100: \"#f5f5f5\",\n    200: \"#e5e5e5\",\n    300: \"#d4d4d4\",\n    400: \"#a3a3a3\",\n    500: \"#737373\",\n    600: \"#525252\",\n    700: \"#404040\",\n    800: \"#262626\",\n    900: \"#171717\",\n    950: \"#0a0a0a\"\n  },\n  stone: {\n    50: \"#fafaf9\",\n    100: \"#f5f5f4\",\n    200: \"#e7e5e4\",\n    300: \"#d6d3d1\",\n    400: \"#a8a29e\",\n    500: \"#78716c\",\n    600: \"#57534e\",\n    700: \"#44403c\",\n    800: \"#292524\",\n    900: \"#1c1917\",\n    950: \"#0c0a09\"\n  },\n  red: {\n    50: \"#fef2f2\",\n    100: \"#fee2e2\",\n    200: \"#fecaca\",\n    300: \"#fca5a5\",\n    400: \"#f87171\",\n    500: \"#ef4444\",\n    600: \"#dc2626\",\n    700: \"#b91c1c\",\n    800: \"#991b1b\",\n    900: \"#7f1d1d\",\n    950: \"#450a0a\"\n  },\n  orange: {\n    50: \"#fff7ed\",\n    100: \"#ffedd5\",\n    200: \"#fed7aa\",\n    300: \"#fdba74\",\n    400: \"#fb923c\",\n    500: \"#f97316\",\n    600: \"#ea580c\",\n    700: \"#c2410c\",\n    800: \"#9a3412\",\n    900: \"#7c2d12\",\n    950: \"#431407\"\n  },\n  amber: {\n    50: \"#fffbeb\",\n    100: \"#fef3c7\",\n    200: \"#fde68a\",\n    300: \"#fcd34d\",\n    400: \"#fbbf24\",\n    500: \"#f59e0b\",\n    600: \"#d97706\",\n    700: \"#b45309\",\n    800: \"#92400e\",\n    900: \"#78350f\",\n    950: \"#451a03\"\n  },\n  yellow: {\n    50: \"#fefce8\",\n    100: \"#fef9c3\",\n    200: \"#fef08a\",\n    300: \"#fde047\",\n    400: \"#facc15\",\n    500: \"#eab308\",\n    600: \"#ca8a04\",\n    700: \"#a16207\",\n    800: \"#854d0e\",\n    900: \"#713f12\",\n    950: \"#422006\"\n  },\n  lime: {\n    50: \"#f7fee7\",\n    100: \"#ecfccb\",\n    200: \"#d9f99d\",\n    300: \"#bef264\",\n    400: \"#a3e635\",\n    500: \"#84cc16\",\n    600: \"#65a30d\",\n    700: \"#4d7c0f\",\n    800: \"#3f6212\",\n    900: \"#365314\",\n    950: \"#1a2e05\"\n  },\n  green: {\n    50: \"#f0fdf4\",\n    100: \"#dcfce7\",\n    200: \"#bbf7d0\",\n    300: \"#86efac\",\n    400: \"#4ade80\",\n    500: \"#22c55e\",\n    600: \"#16a34a\",\n    700: \"#15803d\",\n    800: \"#166534\",\n    900: \"#14532d\",\n    950: \"#052e16\"\n  },\n  emerald: {\n    50: \"#ecfdf5\",\n    100: \"#d1fae5\",\n    200: \"#a7f3d0\",\n    300: \"#6ee7b7\",\n    400: \"#34d399\",\n    500: \"#10b981\",\n    600: \"#059669\",\n    700: \"#047857\",\n    800: \"#065f46\",\n    900: \"#064e3b\",\n    950: \"#022c22\"\n  },\n  teal: {\n    50: \"#f0fdfa\",\n    100: \"#ccfbf1\",\n    200: \"#99f6e4\",\n    300: \"#5eead4\",\n    400: \"#2dd4bf\",\n    500: \"#14b8a6\",\n    600: \"#0d9488\",\n    700: \"#0f766e\",\n    800: \"#115e59\",\n    900: \"#134e4a\",\n    950: \"#042f2e\"\n  },\n  cyan: {\n    50: \"#ecfeff\",\n    100: \"#cffafe\",\n    200: \"#a5f3fc\",\n    300: \"#67e8f9\",\n    400: \"#22d3ee\",\n    500: \"#06b6d4\",\n    600: \"#0891b2\",\n    700: \"#0e7490\",\n    800: \"#155e75\",\n    900: \"#164e63\",\n    950: \"#083344\"\n  },\n  sky: {\n    50: \"#f0f9ff\",\n    100: \"#e0f2fe\",\n    200: \"#bae6fd\",\n    300: \"#7dd3fc\",\n    400: \"#38bdf8\",\n    500: \"#0ea5e9\",\n    600: \"#0284c7\",\n    700: \"#0369a1\",\n    800: \"#075985\",\n    900: \"#0c4a6e\",\n    950: \"#082f49\"\n  },\n  blue: {\n    50: \"#eff6ff\",\n    100: \"#dbeafe\",\n    200: \"#bfdbfe\",\n    300: \"#93c5fd\",\n    400: \"#60a5fa\",\n    500: \"#3b82f6\",\n    600: \"#2563eb\",\n    700: \"#1d4ed8\",\n    800: \"#1e40af\",\n    900: \"#1e3a8a\",\n    950: \"#172554\"\n  },\n  indigo: {\n    50: \"#eef2ff\",\n    100: \"#e0e7ff\",\n    200: \"#c7d2fe\",\n    300: \"#a5b4fc\",\n    400: \"#818cf8\",\n    500: \"#6366f1\",\n    600: \"#4f46e5\",\n    700: \"#4338ca\",\n    800: \"#3730a3\",\n    900: \"#312e81\",\n    950: \"#1e1b4b\"\n  },\n  violet: {\n    50: \"#f5f3ff\",\n    100: \"#ede9fe\",\n    200: \"#ddd6fe\",\n    300: \"#c4b5fd\",\n    400: \"#a78bfa\",\n    500: \"#8b5cf6\",\n    600: \"#7c3aed\",\n    700: \"#6d28d9\",\n    800: \"#5b21b6\",\n    900: \"#4c1d95\",\n    950: \"#2e1065\"\n  },\n  purple: {\n    50: \"#faf5ff\",\n    100: \"#f3e8ff\",\n    200: \"#e9d5ff\",\n    300: \"#d8b4fe\",\n    400: \"#c084fc\",\n    500: \"#a855f7\",\n    600: \"#9333ea\",\n    700: \"#7e22ce\",\n    800: \"#6b21a8\",\n    900: \"#581c87\",\n    950: \"#3b0764\"\n  },\n  fuchsia: {\n    50: \"#fdf4ff\",\n    100: \"#fae8ff\",\n    200: \"#f5d0fe\",\n    300: \"#f0abfc\",\n    400: \"#e879f9\",\n    500: \"#d946ef\",\n    600: \"#c026d3\",\n    700: \"#a21caf\",\n    800: \"#86198f\",\n    900: \"#701a75\",\n    950: \"#4a044e\"\n  },\n  pink: {\n    50: \"#fdf2f8\",\n    100: \"#fce7f3\",\n    200: \"#fbcfe8\",\n    300: \"#f9a8d4\",\n    400: \"#f472b6\",\n    500: \"#ec4899\",\n    600: \"#db2777\",\n    700: \"#be185d\",\n    800: \"#9d174d\",\n    900: \"#831843\",\n    950: \"#500724\"\n  },\n  rose: {\n    50: \"#fff1f2\",\n    100: \"#ffe4e6\",\n    200: \"#fecdd3\",\n    300: \"#fda4af\",\n    400: \"#fb7185\",\n    500: \"#f43f5e\",\n    600: \"#e11d48\",\n    700: \"#be123c\",\n    800: \"#9f1239\",\n    900: \"#881337\",\n    950: \"#4c0519\"\n  }\n};\nFa.reduce(\n  (e, { color: t, primary: n, secondary: r }) => ({\n    ...e,\n    [t]: {\n      primary: si[t][n],\n      secondary: si[t][r]\n    }\n  }),\n  {}\n);\nconst {\n  SvelteComponent: Ga,\n  append: rt,\n  attr: wr,\n  check_outros: ja,\n  create_component: So,\n  destroy_component: ko,\n  detach: hn,\n  element: vr,\n  group_outros: qa,\n  init: za,\n  insert: dn,\n  mount_component: To,\n  safe_not_equal: Va,\n  set_data: yr,\n  space: Er,\n  text: Rt,\n  toggle_class: ai,\n  transition_in: gn,\n  transition_out: bn\n} = window.__gradio__svelte__internal;\nfunction Xa(e) {\n  let t, n;\n  return t = new Ua({}), {\n    c() {\n      So(t.$$.fragment);\n    },\n    m(r, i) {\n      To(t, r, i), n = !0;\n    },\n    i(r) {\n      n || (gn(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      bn(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      ko(t, r);\n    }\n  };\n}\nfunction Wa(e) {\n  let t, n;\n  return t = new Ta({}), {\n    c() {\n      So(t.$$.fragment);\n    },\n    m(r, i) {\n      To(t, r, i), n = !0;\n    },\n    i(r) {\n      n || (gn(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      bn(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      ko(t, r);\n    }\n  };\n}\nfunction ui(e) {\n  let t, n, r = (\n    /*i18n*/\n    e[1](\"common.or\") + \"\"\n  ), i, o, l, a = (\n    /*message*/\n    (e[2] || /*i18n*/\n    e[1](\"upload_text.click_to_upload\")) + \"\"\n  ), s;\n  return {\n    c() {\n      t = vr(\"span\"), n = Rt(\"- \"), i = Rt(r), o = Rt(\" -\"), l = Er(), s = Rt(a), wr(t, \"class\", \"or svelte-kzcjhc\");\n    },\n    m(u, f) {\n      dn(u, t, f), rt(t, n), rt(t, i), rt(t, o), dn(u, l, f), dn(u, s, f);\n    },\n    p(u, f) {\n      f & /*i18n*/\n      2 && r !== (r = /*i18n*/\n      u[1](\"common.or\") + \"\") && yr(i, r), f & /*message, i18n*/\n      6 && a !== (a = /*message*/\n      (u[2] || /*i18n*/\n      u[1](\"upload_text.click_to_upload\")) + \"\") && yr(s, a);\n    },\n    d(u) {\n      u && (hn(t), hn(l), hn(s));\n    }\n  };\n}\nfunction Za(e) {\n  let t, n, r, i, o, l = (\n    /*i18n*/\n    e[1](\n      /*defs*/\n      e[5][\n        /*type*/\n        e[0]\n      ] || /*defs*/\n      e[5].file\n    ) + \"\"\n  ), a, s, u;\n  const f = [Wa, Xa], c = [];\n  function _(d, p) {\n    return (\n      /*type*/\n      d[0] === \"clipboard\" ? 0 : 1\n    );\n  }\n  r = _(e), i = c[r] = f[r](e);\n  let h = (\n    /*mode*/\n    e[3] !== \"short\" && ui(e)\n  );\n  return {\n    c() {\n      t = vr(\"div\"), n = vr(\"span\"), i.c(), o = Er(), a = Rt(l), s = Er(), h && h.c(), wr(n, \"class\", \"icon-wrap svelte-kzcjhc\"), ai(\n        n,\n        \"hovered\",\n        /*hovered*/\n        e[4]\n      ), wr(t, \"class\", \"wrap svelte-kzcjhc\");\n    },\n    m(d, p) {\n      dn(d, t, p), rt(t, n), c[r].m(n, null), rt(t, o), rt(t, a), rt(t, s), h && h.m(t, null), u = !0;\n    },\n    p(d, [p]) {\n      let w = r;\n      r = _(d), r !== w && (qa(), bn(c[w], 1, 1, () => {\n        c[w] = null;\n      }), ja(), i = c[r], i || (i = c[r] = f[r](d), i.c()), gn(i, 1), i.m(n, null)), (!u || p & /*hovered*/\n      16) && ai(\n        n,\n        \"hovered\",\n        /*hovered*/\n        d[4]\n      ), (!u || p & /*i18n, type*/\n      3) && l !== (l = /*i18n*/\n      d[1](\n        /*defs*/\n        d[5][\n          /*type*/\n          d[0]\n        ] || /*defs*/\n        d[5].file\n      ) + \"\") && yr(a, l), /*mode*/\n      d[3] !== \"short\" ? h ? h.p(d, p) : (h = ui(d), h.c(), h.m(t, null)) : h && (h.d(1), h = null);\n    },\n    i(d) {\n      u || (gn(i), u = !0);\n    },\n    o(d) {\n      bn(i), u = !1;\n    },\n    d(d) {\n      d && hn(t), c[r].d(), h && h.d();\n    }\n  };\n}\nfunction xa(e, t, n) {\n  let { type: r = \"file\" } = t, { i18n: i } = t, { message: o = void 0 } = t, { mode: l = \"full\" } = t, { hovered: a = !1 } = t;\n  const s = {\n    image: \"upload_text.drop_image\",\n    video: \"upload_text.drop_video\",\n    audio: \"upload_text.drop_audio\",\n    file: \"upload_text.drop_file\",\n    csv: \"upload_text.drop_csv\",\n    gallery: \"upload_text.drop_gallery\",\n    clipboard: \"upload_text.paste_clipboard\"\n  };\n  return e.$$set = (u) => {\n    \"type\" in u && n(0, r = u.type), \"i18n\" in u && n(1, i = u.i18n), \"message\" in u && n(2, o = u.message), \"mode\" in u && n(3, l = u.mode), \"hovered\" in u && n(4, a = u.hovered);\n  }, [r, i, o, l, a, s];\n}\nclass Ja extends Ga {\n  constructor(t) {\n    super(), za(this, t, xa, Za, Va, {\n      type: 0,\n      i18n: 1,\n      message: 2,\n      mode: 3,\n      hovered: 4\n    });\n  }\n}\nvar fi = Object.prototype.hasOwnProperty;\nfunction ci(e, t, n) {\n  for (n of e.keys())\n    if (Ft(n, t))\n      return n;\n}\nfunction Ft(e, t) {\n  var n, r, i;\n  if (e === t)\n    return !0;\n  if (e && t && (n = e.constructor) === t.constructor) {\n    if (n === Date)\n      return e.getTime() === t.getTime();\n    if (n === RegExp)\n      return e.toString() === t.toString();\n    if (n === Array) {\n      if ((r = e.length) === t.length)\n        for (; r-- && Ft(e[r], t[r]); )\n          ;\n      return r === -1;\n    }\n    if (n === Set) {\n      if (e.size !== t.size)\n        return !1;\n      for (r of e)\n        if (i = r, i && typeof i == \"object\" && (i = ci(t, i), !i) || !t.has(i))\n          return !1;\n      return !0;\n    }\n    if (n === Map) {\n      if (e.size !== t.size)\n        return !1;\n      for (r of e)\n        if (i = r[0], i && typeof i == \"object\" && (i = ci(t, i), !i) || !Ft(r[1], t.get(i)))\n          return !1;\n      return !0;\n    }\n    if (n === ArrayBuffer)\n      e = new Uint8Array(e), t = new Uint8Array(t);\n    else if (n === DataView) {\n      if ((r = e.byteLength) === t.byteLength)\n        for (; r-- && e.getInt8(r) === t.getInt8(r); )\n          ;\n      return r === -1;\n    }\n    if (ArrayBuffer.isView(e)) {\n      if ((r = e.byteLength) === t.byteLength)\n        for (; r-- && e[r] === t[r]; )\n          ;\n      return r === -1;\n    }\n    if (!n || typeof e == \"object\") {\n      r = 0;\n      for (n in e)\n        if (fi.call(e, n) && ++r && !fi.call(t, n) || !(n in t) || !Ft(e[n], t[n]))\n          return !1;\n      return Object.keys(t).length === r;\n    }\n  }\n  return e !== e && t !== t;\n}\nconst {\n  SvelteComponent: Qa,\n  add_flush_callback: Ao,\n  append: un,\n  attr: Qe,\n  bind: wn,\n  binding_callbacks: Gt,\n  check_outros: jt,\n  construct_svelte_component: vn,\n  create_component: lt,\n  destroy_component: st,\n  detach: qt,\n  element: tr,\n  empty: Gr,\n  group_outros: zt,\n  init: Ya,\n  insert: Vt,\n  mount_component: at,\n  noop: Ka,\n  safe_not_equal: $a,\n  space: Sr,\n  transition_in: ne,\n  transition_out: me\n} = window.__gradio__svelte__internal;\nfunction _i(e) {\n  let t, n, r, i, o, l, a, s, u, f, c = !/*use_3dgs*/\n  e[8] && hi(e);\n  o = new Pt({\n    props: {\n      Icon: yo,\n      label: (\n        /*i18n*/\n        e[4](\"common.download\")\n      )\n    }\n  });\n  const _ = [tu, eu], h = [];\n  function d(p, w) {\n    return (\n      /*use_3dgs*/\n      p[8] ? 0 : 1\n    );\n  }\n  return s = d(e), u = h[s] = _[s](e), {\n    c() {\n      t = tr(\"div\"), n = tr(\"div\"), c && c.c(), r = Sr(), i = tr(\"a\"), lt(o.$$.fragment), a = Sr(), u.c(), Qe(\n        i,\n        \"href\",\n        /*resolved_url*/\n        e[12]\n      ), Qe(i, \"target\", window.__is_colab__ ? \"_blank\" : null), Qe(i, \"download\", l = window.__is_colab__ ? null : (\n        /*value*/\n        e[0].orig_name || /*value*/\n        e[0].path\n      )), Qe(n, \"class\", \"buttons svelte-14rtuon\"), Qe(t, \"class\", \"model3D svelte-14rtuon\");\n    },\n    m(p, w) {\n      Vt(p, t, w), un(t, n), c && c.m(n, null), un(n, r), un(n, i), at(o, i, null), un(t, a), h[s].m(t, null), f = !0;\n    },\n    p(p, w) {\n      /*use_3dgs*/\n      p[8] ? c && (zt(), me(c, 1, 1, () => {\n        c = null;\n      }), jt()) : c ? (c.p(p, w), w & /*use_3dgs*/\n      256 && ne(c, 1)) : (c = hi(p), c.c(), ne(c, 1), c.m(n, r));\n      const v = {};\n      w & /*i18n*/\n      16 && (v.label = /*i18n*/\n      p[4](\"common.download\")), o.$set(v), (!f || w & /*resolved_url*/\n      4096) && Qe(\n        i,\n        \"href\",\n        /*resolved_url*/\n        p[12]\n      ), (!f || w & /*value*/\n      1 && l !== (l = window.__is_colab__ ? null : (\n        /*value*/\n        p[0].orig_name || /*value*/\n        p[0].path\n      ))) && Qe(i, \"download\", l);\n      let E = s;\n      s = d(p), s === E ? h[s].p(p, w) : (zt(), me(h[E], 1, 1, () => {\n        h[E] = null;\n      }), jt(), u = h[s], u ? u.p(p, w) : (u = h[s] = _[s](p), u.c()), ne(u, 1), u.m(t, null));\n    },\n    i(p) {\n      f || (ne(c), ne(o.$$.fragment, p), ne(u), f = !0);\n    },\n    o(p) {\n      me(c), me(o.$$.fragment, p), me(u), f = !1;\n    },\n    d(p) {\n      p && qt(t), c && c.d(), st(o), h[s].d();\n    }\n  };\n}\nfunction hi(e) {\n  let t, n;\n  return t = new Pt({ props: { Icon: Eo, label: \"Undo\" } }), t.$on(\n    \"click\",\n    /*click_handler*/\n    e[15]\n  ), {\n    c() {\n      lt(t.$$.fragment);\n    },\n    m(r, i) {\n      at(t, r, i), n = !0;\n    },\n    p: Ka,\n    i(r) {\n      n || (ne(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      me(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      st(t, r);\n    }\n  };\n}\nfunction eu(e) {\n  let t, n, r, i;\n  function o(s) {\n    e[18](s);\n  }\n  var l = (\n    /*Canvas3DComponent*/\n    e[11]\n  );\n  function a(s, u) {\n    let f = {\n      value: (\n        /*value*/\n        s[0]\n      ),\n      clear_color: (\n        /*clear_color*/\n        s[1]\n      ),\n      camera_position: (\n        /*camera_position*/\n        s[7]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        s[5]\n      ),\n      pan_speed: (\n        /*pan_speed*/\n        s[6]\n      )\n    };\n    return (\n      /*resolved_url*/\n      s[12] !== void 0 && (f.resolved_url = /*resolved_url*/\n      s[12]), { props: f }\n    );\n  }\n  return l && (t = vn(l, a(e)), e[17](t), Gt.push(() => wn(t, \"resolved_url\", o))), {\n    c() {\n      t && lt(t.$$.fragment), r = Gr();\n    },\n    m(s, u) {\n      t && at(t, s, u), Vt(s, r, u), i = !0;\n    },\n    p(s, u) {\n      if (u & /*Canvas3DComponent*/\n      2048 && l !== (l = /*Canvas3DComponent*/\n      s[11])) {\n        if (t) {\n          zt();\n          const f = t;\n          me(f.$$.fragment, 1, 0, () => {\n            st(f, 1);\n          }), jt();\n        }\n        l ? (t = vn(l, a(s)), s[17](t), Gt.push(() => wn(t, \"resolved_url\", o)), lt(t.$$.fragment), ne(t.$$.fragment, 1), at(t, r.parentNode, r)) : t = null;\n      } else if (l) {\n        const f = {};\n        u & /*value*/\n        1 && (f.value = /*value*/\n        s[0]), u & /*clear_color*/\n        2 && (f.clear_color = /*clear_color*/\n        s[1]), u & /*camera_position*/\n        128 && (f.camera_position = /*camera_position*/\n        s[7]), u & /*zoom_speed*/\n        32 && (f.zoom_speed = /*zoom_speed*/\n        s[5]), u & /*pan_speed*/\n        64 && (f.pan_speed = /*pan_speed*/\n        s[6]), !n && u & /*resolved_url*/\n        4096 && (n = !0, f.resolved_url = /*resolved_url*/\n        s[12], Ao(() => n = !1)), t.$set(f);\n      }\n    },\n    i(s) {\n      i || (t && ne(t.$$.fragment, s), i = !0);\n    },\n    o(s) {\n      t && me(t.$$.fragment, s), i = !1;\n    },\n    d(s) {\n      s && qt(r), e[17](null), t && st(t, s);\n    }\n  };\n}\nfunction tu(e) {\n  let t, n, r, i;\n  function o(s) {\n    e[16](s);\n  }\n  var l = (\n    /*Canvas3DGSComponent*/\n    e[10]\n  );\n  function a(s, u) {\n    let f = {\n      value: (\n        /*value*/\n        s[0]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        s[5]\n      ),\n      pan_speed: (\n        /*pan_speed*/\n        s[6]\n      )\n    };\n    return (\n      /*resolved_url*/\n      s[12] !== void 0 && (f.resolved_url = /*resolved_url*/\n      s[12]), { props: f }\n    );\n  }\n  return l && (t = vn(l, a(e)), Gt.push(() => wn(t, \"resolved_url\", o))), {\n    c() {\n      t && lt(t.$$.fragment), r = Gr();\n    },\n    m(s, u) {\n      t && at(t, s, u), Vt(s, r, u), i = !0;\n    },\n    p(s, u) {\n      if (u & /*Canvas3DGSComponent*/\n      1024 && l !== (l = /*Canvas3DGSComponent*/\n      s[10])) {\n        if (t) {\n          zt();\n          const f = t;\n          me(f.$$.fragment, 1, 0, () => {\n            st(f, 1);\n          }), jt();\n        }\n        l ? (t = vn(l, a(s)), Gt.push(() => wn(t, \"resolved_url\", o)), lt(t.$$.fragment), ne(t.$$.fragment, 1), at(t, r.parentNode, r)) : t = null;\n      } else if (l) {\n        const f = {};\n        u & /*value*/\n        1 && (f.value = /*value*/\n        s[0]), u & /*zoom_speed*/\n        32 && (f.zoom_speed = /*zoom_speed*/\n        s[5]), u & /*pan_speed*/\n        64 && (f.pan_speed = /*pan_speed*/\n        s[6]), !n && u & /*resolved_url*/\n        4096 && (n = !0, f.resolved_url = /*resolved_url*/\n        s[12], Ao(() => n = !1)), t.$set(f);\n      }\n    },\n    i(s) {\n      i || (t && ne(t.$$.fragment, s), i = !0);\n    },\n    o(s) {\n      t && me(t.$$.fragment, s), i = !1;\n    },\n    d(s) {\n      s && qt(r), t && st(t, s);\n    }\n  };\n}\nfunction nu(e) {\n  let t, n, r, i;\n  t = new Fr({\n    props: {\n      show_label: (\n        /*show_label*/\n        e[3]\n      ),\n      Icon: Cn,\n      label: (\n        /*label*/\n        e[2] || /*i18n*/\n        e[4](\"3D_model.3d_model\")\n      )\n    }\n  });\n  let o = (\n    /*value*/\n    e[0] && _i(e)\n  );\n  return {\n    c() {\n      lt(t.$$.fragment), n = Sr(), o && o.c(), r = Gr();\n    },\n    m(l, a) {\n      at(t, l, a), Vt(l, n, a), o && o.m(l, a), Vt(l, r, a), i = !0;\n    },\n    p(l, [a]) {\n      const s = {};\n      a & /*show_label*/\n      8 && (s.show_label = /*show_label*/\n      l[3]), a & /*label, i18n*/\n      20 && (s.label = /*label*/\n      l[2] || /*i18n*/\n      l[4](\"3D_model.3d_model\")), t.$set(s), /*value*/\n      l[0] ? o ? (o.p(l, a), a & /*value*/\n      1 && ne(o, 1)) : (o = _i(l), o.c(), ne(o, 1), o.m(r.parentNode, r)) : o && (zt(), me(o, 1, 1, () => {\n        o = null;\n      }), jt());\n    },\n    i(l) {\n      i || (ne(t.$$.fragment, l), ne(o), i = !0);\n    },\n    o(l) {\n      me(t.$$.fragment, l), me(o), i = !1;\n    },\n    d(l) {\n      l && (qt(n), qt(r)), st(t, l), o && o.d(l);\n    }\n  };\n}\nfunction di(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nasync function ru() {\n  return (await import(\"./Canvas3D-60a8d213.js\")).default;\n}\nasync function iu() {\n  return (await import(\"./Canvas3DGS-0fbc0d9a.js\")).default;\n}\nfunction ou(e, t, n) {\n  let { value: r } = t, { clear_color: i = [0, 0, 0, 0] } = t, { label: o = \"\" } = t, { show_label: l } = t, { i18n: a } = t, { zoom_speed: s = 1 } = t, { pan_speed: u = 1 } = t, { camera_position: f = [null, null, null] } = t, c = { camera_position: f, zoom_speed: s, pan_speed: u }, _ = !1, h, d, p;\n  function w() {\n    di([\n      p,\n      \"optionalAccess\",\n      (g) => g.reset_camera_position,\n      \"call\",\n      (g) => g(f, s, u)\n    ]);\n  }\n  let v;\n  const E = () => w();\n  function b(g) {\n    v = g, n(12, v);\n  }\n  function S(g) {\n    Gt[g ? \"unshift\" : \"push\"](() => {\n      p = g, n(9, p);\n    });\n  }\n  function H(g) {\n    v = g, n(12, v);\n  }\n  return e.$$set = (g) => {\n    \"value\" in g && n(0, r = g.value), \"clear_color\" in g && n(1, i = g.clear_color), \"label\" in g && n(2, o = g.label), \"show_label\" in g && n(3, l = g.show_label), \"i18n\" in g && n(4, a = g.i18n), \"zoom_speed\" in g && n(5, s = g.zoom_speed), \"pan_speed\" in g && n(6, u = g.pan_speed), \"camera_position\" in g && n(7, f = g.camera_position);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*value, use_3dgs*/\n    257 && r && (n(8, _ = r.path.endsWith(\".splat\") || r.path.endsWith(\".ply\")), _ ? iu().then((g) => {\n      n(10, h = g);\n    }) : ru().then((g) => {\n      n(11, d = g);\n    })), e.$$.dirty & /*current_settings, camera_position, zoom_speed, pan_speed, canvas3d*/\n    17120 && (!Ft(c.camera_position, f) || c.zoom_speed !== s || c.pan_speed !== u) && (di([\n      p,\n      \"optionalAccess\",\n      (g) => g.reset_camera_position,\n      \"call\",\n      (g) => g(f, s, u)\n    ]), n(14, c = { camera_position: f, zoom_speed: s, pan_speed: u }));\n  }, [\n    r,\n    i,\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    _,\n    p,\n    h,\n    d,\n    v,\n    w,\n    c,\n    E,\n    b,\n    S,\n    H\n  ];\n}\nclass lu extends Qa {\n  constructor(t) {\n    super(), Ya(this, t, ou, nu, $a, {\n      value: 0,\n      clear_color: 1,\n      label: 2,\n      show_label: 3,\n      i18n: 4,\n      zoom_speed: 5,\n      pan_speed: 6,\n      camera_position: 7\n    });\n  }\n}\nvar nr = new Intl.Collator(0, { numeric: 1 }).compare;\nfunction mi(e, t, n) {\n  return e = e.split(\".\"), t = t.split(\".\"), nr(e[0], t[0]) || nr(e[1], t[1]) || (t[2] = t.slice(2).join(\".\"), n = /[.-]/.test(e[2] = e.slice(2).join(\".\")), n == /[.-]/.test(t[2]) ? nr(e[2], t[2]) : n ? -1 : 1);\n}\nfunction Bo(e, t, n) {\n  return t.startsWith(\"http://\") || t.startsWith(\"https://\") ? n ? e : t : e + t;\n}\nfunction rr(e) {\n  if (e.startsWith(\"http\")) {\n    const { protocol: t, host: n } = new URL(e);\n    return n.endsWith(\"hf.space\") ? {\n      ws_protocol: \"wss\",\n      host: n,\n      http_protocol: t\n    } : {\n      ws_protocol: t === \"https:\" ? \"wss\" : \"ws\",\n      http_protocol: t,\n      host: n\n    };\n  } else if (e.startsWith(\"file:\"))\n    return {\n      ws_protocol: \"ws\",\n      http_protocol: \"http:\",\n      host: \"lite.local\"\n      // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.\n    };\n  return {\n    ws_protocol: \"wss\",\n    http_protocol: \"https:\",\n    host: e\n  };\n}\nconst Co = /^[^\\/]*\\/[^\\/]*$/, su = /.*hf\\.space\\/{0,1}$/;\nasync function au(e, t) {\n  const n = {};\n  t && (n.Authorization = `Bearer ${t}`);\n  const r = e.trim();\n  if (Co.test(r))\n    try {\n      const i = await fetch(\n        `https://huggingface.co/api/spaces/${r}/host`,\n        { headers: n }\n      );\n      if (i.status !== 200)\n        throw new Error(\"Space metadata could not be loaded.\");\n      const o = (await i.json()).host;\n      return {\n        space_id: e,\n        ...rr(o)\n      };\n    } catch (i) {\n      throw new Error(\"Space metadata could not be loaded.\" + i.message);\n    }\n  if (su.test(r)) {\n    const { ws_protocol: i, http_protocol: o, host: l } = rr(r);\n    return {\n      space_id: l.replace(\".hf.space\", \"\"),\n      ws_protocol: i,\n      http_protocol: o,\n      host: l\n    };\n  }\n  return {\n    space_id: !1,\n    ...rr(r)\n  };\n}\nfunction uu(e) {\n  let t = {};\n  return e.forEach(({ api_name: n }, r) => {\n    n && (t[n] = r);\n  }), t;\n}\nconst fu = /^(?=[^]*\\b[dD]iscussions{0,1}\\b)(?=[^]*\\b[dD]isabled\\b)[^]*$/;\nasync function pi(e) {\n  try {\n    const n = (await fetch(\n      `https://huggingface.co/api/spaces/${e}/discussions`,\n      {\n        method: \"HEAD\"\n      }\n    )).headers.get(\"x-error-message\");\n    return !(n && fu.test(n));\n  } catch {\n    return !1;\n  }\n}\nfunction cu(e, t, n, r) {\n  if (t.length === 0) {\n    if (n === \"replace\")\n      return r;\n    if (n === \"append\")\n      return e + r;\n    throw new Error(`Unsupported action: ${n}`);\n  }\n  let i = e;\n  for (let l = 0; l < t.length - 1; l++)\n    i = i[t[l]];\n  const o = t[t.length - 1];\n  switch (n) {\n    case \"replace\":\n      i[o] = r;\n      break;\n    case \"append\":\n      i[o] += r;\n      break;\n    case \"add\":\n      Array.isArray(i) ? i.splice(Number(o), 0, r) : i[o] = r;\n      break;\n    case \"delete\":\n      Array.isArray(i) ? i.splice(Number(o), 1) : delete i[o];\n      break;\n    default:\n      throw new Error(`Unknown action: ${n}`);\n  }\n  return e;\n}\nfunction _u(e, t) {\n  return t.forEach(([n, r, i]) => {\n    e = cu(e, r, n, i);\n  }), e;\n}\nasync function hu(e, t, n, r = pu) {\n  let i = (Array.isArray(e) ? e : [e]).map(\n    (o) => o.blob\n  );\n  return await Promise.all(\n    await r(t, i, void 0, n).then(\n      async (o) => {\n        if (o.error)\n          throw new Error(o.error);\n        return o.files ? o.files.map((l, a) => new jr({\n          ...e[a],\n          path: l,\n          url: t + \"/file=\" + l\n        })) : [];\n      }\n    )\n  );\n}\nasync function du(e, t) {\n  return e.map(\n    (n, r) => new jr({\n      path: n.name,\n      orig_name: n.name,\n      blob: n,\n      size: n.size,\n      mime_type: n.type,\n      is_stream: t\n    })\n  );\n}\nclass jr {\n  constructor({\n    path: t,\n    url: n,\n    orig_name: r,\n    size: i,\n    blob: o,\n    is_stream: l,\n    mime_type: a,\n    alt_text: s\n  }) {\n    this.meta = { _type: \"gradio.FileData\" }, this.path = t, this.url = n, this.orig_name = r, this.size = i, this.blob = n ? void 0 : o, this.is_stream = l, this.mime_type = a, this.alt_text = s;\n  }\n}\nconst Ho = \"This application is too busy. Keep trying!\", Ye = \"Connection errored out.\";\nlet No;\nfunction mu(e, t) {\n  return { post_data: n, upload_files: r, client: i, handle_blob: o };\n  async function n(l, a, s) {\n    const u = { \"Content-Type\": \"application/json\" };\n    s && (u.Authorization = `Bearer ${s}`);\n    try {\n      var f = await e(l, {\n        method: \"POST\",\n        body: JSON.stringify(a),\n        headers: u\n      });\n    } catch {\n      return [{ error: Ye }, 500];\n    }\n    let c, _;\n    try {\n      c = await f.json(), _ = f.status;\n    } catch (h) {\n      c = { error: `Could not parse server response: ${h}` }, _ = 500;\n    }\n    return [c, _];\n  }\n  async function r(l, a, s, u) {\n    const f = {};\n    s && (f.Authorization = `Bearer ${s}`);\n    const c = 1e3, _ = [];\n    for (let d = 0; d < a.length; d += c) {\n      const p = a.slice(d, d + c), w = new FormData();\n      p.forEach((E) => {\n        w.append(\"files\", E);\n      });\n      try {\n        const E = u ? `${l}/upload?upload_id=${u}` : `${l}/upload`;\n        var h = await e(E, {\n          method: \"POST\",\n          body: w,\n          headers: f\n        });\n      } catch {\n        return { error: Ye };\n      }\n      const v = await h.json();\n      _.push(...v);\n    }\n    return { files: _ };\n  }\n  async function i(l, a = {}) {\n    return new Promise(async (s) => {\n      const { status_callback: u, hf_token: f } = a, c = {\n        predict: Re,\n        submit: fe,\n        view_api: xe,\n        component_server: gt\n      };\n      if ((typeof window > \"u\" || !(\"WebSocket\" in window)) && !global.Websocket) {\n        const A = await import(\"./wrapper-6f348d45-19fa94bf.js\");\n        No = (await import(\"./__vite-browser-external-2447137e.js\")).Blob, global.WebSocket = A.WebSocket;\n      }\n      const { ws_protocol: _, http_protocol: h, host: d, space_id: p } = await au(l, f), w = Math.random().toString(36).substring(2), v = {};\n      let E = !1, b = {}, S = {}, H = null;\n      const g = {}, Z = /* @__PURE__ */ new Set();\n      let P, T = {}, k = !1;\n      f && p && (k = await bu(p, f));\n      async function ke(A) {\n        if (P = A, window.location.protocol === \"https:\" && (P.root = P.root.replace(\"http://\", \"https://\")), T = uu((A == null ? void 0 : A.dependencies) || []), P.auth_required)\n          return {\n            config: P,\n            ...c\n          };\n        try {\n          ue = await xe(P);\n        } catch (W) {\n          console.error(`Could not get api details: ${W.message}`);\n        }\n        return {\n          config: P,\n          ...c\n        };\n      }\n      let ue;\n      async function Te(A) {\n        if (u && u(A), A.status === \"running\")\n          try {\n            P = await vi(\n              e,\n              `${h}//${d}`,\n              f\n            );\n            const W = await ke(P);\n            s(W);\n          } catch (W) {\n            console.error(W), u && u({\n              status: \"error\",\n              message: \"Could not load this space.\",\n              load_status: \"error\",\n              detail: \"NOT_FOUND\"\n            });\n          }\n      }\n      try {\n        P = await vi(\n          e,\n          `${h}//${d}`,\n          f\n        );\n        const A = await ke(P);\n        s(A);\n      } catch (A) {\n        console.error(A), p ? Tr(\n          p,\n          Co.test(p) ? \"space_name\" : \"subdomain\",\n          Te\n        ) : u && u({\n          status: \"error\",\n          message: \"Could not load this space.\",\n          load_status: \"error\",\n          detail: \"NOT_FOUND\"\n        });\n      }\n      function Re(A, W, J) {\n        let m = !1, y = !1, M;\n        if (typeof A == \"number\")\n          M = P.dependencies[A];\n        else {\n          const D = A.replace(/^\\//, \"\");\n          M = P.dependencies[T[D]];\n        }\n        if (M.types.continuous)\n          throw new Error(\n            \"Cannot call predict on this function as it may run forever. Use submit instead\"\n          );\n        return new Promise((D, re) => {\n          const ce = fe(A, W, J);\n          let N;\n          ce.on(\"data\", (pe) => {\n            y && (ce.destroy(), D(pe)), m = !0, N = pe;\n          }).on(\"status\", (pe) => {\n            pe.stage === \"error\" && re(pe), pe.stage === \"complete\" && (y = !0, m && (ce.destroy(), D(N)));\n          });\n        });\n      }\n      function fe(A, W, J, m = null) {\n        let y, M;\n        if (typeof A == \"number\")\n          y = A, M = ue.unnamed_endpoints[y];\n        else {\n          const q = A.replace(/^\\//, \"\");\n          y = T[q], M = ue.named_endpoints[A.trim()];\n        }\n        if (typeof y != \"number\")\n          throw new Error(\n            \"There is no endpoint matching that name of fn_index matching that number.\"\n          );\n        let D, re, ce = P.protocol ?? \"ws\";\n        const N = typeof A == \"number\" ? \"/predict\" : A;\n        let pe, ie = null, _e = !1;\n        const Dt = {};\n        let Ge = \"\";\n        typeof window < \"u\" && (Ge = new URLSearchParams(window.location.search).toString()), o(`${P.root}`, W, M, f).then(\n          (q) => {\n            if (pe = {\n              data: q || [],\n              event_data: J,\n              fn_index: y,\n              trigger_id: m\n            }, wu(y, P))\n              R({\n                type: \"status\",\n                endpoint: N,\n                stage: \"pending\",\n                queue: !1,\n                fn_index: y,\n                time: /* @__PURE__ */ new Date()\n              }), n(\n                `${P.root}/run${N.startsWith(\"/\") ? N : `/${N}`}${Ge ? \"?\" + Ge : \"\"}`,\n                {\n                  ...pe,\n                  session_hash: w\n                },\n                f\n              ).then(([V, j]) => {\n                const Q = V.data;\n                j == 200 ? (R({\n                  type: \"data\",\n                  endpoint: N,\n                  fn_index: y,\n                  data: Q,\n                  time: /* @__PURE__ */ new Date()\n                }), R({\n                  type: \"status\",\n                  endpoint: N,\n                  fn_index: y,\n                  stage: \"complete\",\n                  eta: V.average_duration,\n                  queue: !1,\n                  time: /* @__PURE__ */ new Date()\n                })) : R({\n                  type: \"status\",\n                  stage: \"error\",\n                  endpoint: N,\n                  fn_index: y,\n                  message: V.error,\n                  queue: !1,\n                  time: /* @__PURE__ */ new Date()\n                });\n              }).catch((V) => {\n                R({\n                  type: \"status\",\n                  stage: \"error\",\n                  message: V.message,\n                  endpoint: N,\n                  fn_index: y,\n                  queue: !1,\n                  time: /* @__PURE__ */ new Date()\n                });\n              });\n            else if (ce == \"ws\") {\n              R({\n                type: \"status\",\n                stage: \"pending\",\n                queue: !0,\n                endpoint: N,\n                fn_index: y,\n                time: /* @__PURE__ */ new Date()\n              });\n              let V = new URL(`${_}://${Bo(\n                d,\n                P.path,\n                !0\n              )}\n\t\t\t\t\t\t\t/queue/join${Ge ? \"?\" + Ge : \"\"}`);\n              k && V.searchParams.set(\"__sign\", k), D = new WebSocket(V), D.onclose = (j) => {\n                j.wasClean || R({\n                  type: \"status\",\n                  stage: \"error\",\n                  broken: !0,\n                  message: Ye,\n                  queue: !0,\n                  endpoint: N,\n                  fn_index: y,\n                  time: /* @__PURE__ */ new Date()\n                });\n              }, D.onmessage = function(j) {\n                const Q = JSON.parse(j.data), { type: x, status: F, data: G } = ir(\n                  Q,\n                  v[y]\n                );\n                if (x === \"update\" && F && !_e)\n                  R({\n                    type: \"status\",\n                    endpoint: N,\n                    fn_index: y,\n                    time: /* @__PURE__ */ new Date(),\n                    ...F\n                  }), F.stage === \"error\" && D.close();\n                else if (x === \"hash\") {\n                  D.send(JSON.stringify({ fn_index: y, session_hash: w }));\n                  return;\n                } else\n                  x === \"data\" ? D.send(JSON.stringify({ ...pe, session_hash: w })) : x === \"complete\" ? _e = F : x === \"log\" ? R({\n                    type: \"log\",\n                    log: G.log,\n                    level: G.level,\n                    endpoint: N,\n                    fn_index: y\n                  }) : x === \"generating\" && R({\n                    type: \"status\",\n                    time: /* @__PURE__ */ new Date(),\n                    ...F,\n                    stage: F == null ? void 0 : F.stage,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: y\n                  });\n                G && (R({\n                  type: \"data\",\n                  time: /* @__PURE__ */ new Date(),\n                  data: G.data,\n                  endpoint: N,\n                  fn_index: y\n                }), _e && (R({\n                  type: \"status\",\n                  time: /* @__PURE__ */ new Date(),\n                  ..._e,\n                  stage: F == null ? void 0 : F.stage,\n                  queue: !0,\n                  endpoint: N,\n                  fn_index: y\n                }), D.close()));\n              }, mi(P.version || \"2.0.0\", \"3.6\") < 0 && addEventListener(\n                \"open\",\n                () => D.send(JSON.stringify({ hash: w }))\n              );\n            } else if (ce == \"sse\") {\n              R({\n                type: \"status\",\n                stage: \"pending\",\n                queue: !0,\n                endpoint: N,\n                fn_index: y,\n                time: /* @__PURE__ */ new Date()\n              });\n              var Y = new URLSearchParams({\n                fn_index: y.toString(),\n                session_hash: w\n              }).toString();\n              let V = new URL(\n                `${P.root}/queue/join?${Ge ? Ge + \"&\" : \"\"}${Y}`\n              );\n              re = t(V), re.onmessage = async function(j) {\n                const Q = JSON.parse(j.data), { type: x, status: F, data: G } = ir(\n                  Q,\n                  v[y]\n                );\n                if (x === \"update\" && F && !_e)\n                  R({\n                    type: \"status\",\n                    endpoint: N,\n                    fn_index: y,\n                    time: /* @__PURE__ */ new Date(),\n                    ...F\n                  }), F.stage === \"error\" && re.close();\n                else if (x === \"data\") {\n                  ie = Q.event_id;\n                  let [Je, Dl] = await n(\n                    `${P.root}/queue/data`,\n                    {\n                      ...pe,\n                      session_hash: w,\n                      event_id: ie\n                    },\n                    f\n                  );\n                  Dl !== 200 && (R({\n                    type: \"status\",\n                    stage: \"error\",\n                    message: Ye,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: y,\n                    time: /* @__PURE__ */ new Date()\n                  }), re.close());\n                } else\n                  x === \"complete\" ? _e = F : x === \"log\" ? R({\n                    type: \"log\",\n                    log: G.log,\n                    level: G.level,\n                    endpoint: N,\n                    fn_index: y\n                  }) : x === \"generating\" && R({\n                    type: \"status\",\n                    time: /* @__PURE__ */ new Date(),\n                    ...F,\n                    stage: F == null ? void 0 : F.stage,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: y\n                  });\n                G && (R({\n                  type: \"data\",\n                  time: /* @__PURE__ */ new Date(),\n                  data: G.data,\n                  endpoint: N,\n                  fn_index: y\n                }), _e && (R({\n                  type: \"status\",\n                  time: /* @__PURE__ */ new Date(),\n                  ..._e,\n                  stage: F == null ? void 0 : F.stage,\n                  queue: !0,\n                  endpoint: N,\n                  fn_index: y\n                }), re.close()));\n              };\n            } else\n              (ce == \"sse_v1\" || ce == \"sse_v2\" || ce == \"sse_v2.1\") && (R({\n                type: \"status\",\n                stage: \"pending\",\n                queue: !0,\n                endpoint: N,\n                fn_index: y,\n                time: /* @__PURE__ */ new Date()\n              }), n(\n                `${P.root}/queue/join?${Ge}`,\n                {\n                  ...pe,\n                  session_hash: w\n                },\n                f\n              ).then(([V, j]) => {\n                if (j === 503)\n                  R({\n                    type: \"status\",\n                    stage: \"error\",\n                    message: Ho,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: y,\n                    time: /* @__PURE__ */ new Date()\n                  });\n                else if (j !== 200)\n                  R({\n                    type: \"status\",\n                    stage: \"error\",\n                    message: Ye,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: y,\n                    time: /* @__PURE__ */ new Date()\n                  });\n                else {\n                  ie = V.event_id;\n                  let Q = async function(x) {\n                    try {\n                      const { type: F, status: G, data: Je } = ir(\n                        x,\n                        v[y]\n                      );\n                      if (F == \"heartbeat\")\n                        return;\n                      if (F === \"update\" && G && !_e)\n                        R({\n                          type: \"status\",\n                          endpoint: N,\n                          fn_index: y,\n                          time: /* @__PURE__ */ new Date(),\n                          ...G\n                        });\n                      else if (F === \"complete\")\n                        _e = G;\n                      else if (F == \"unexpected_error\")\n                        console.error(\"Unexpected error\", G == null ? void 0 : G.message), R({\n                          type: \"status\",\n                          stage: \"error\",\n                          message: (G == null ? void 0 : G.message) || \"An Unexpected Error Occurred!\",\n                          queue: !0,\n                          endpoint: N,\n                          fn_index: y,\n                          time: /* @__PURE__ */ new Date()\n                        });\n                      else if (F === \"log\") {\n                        R({\n                          type: \"log\",\n                          log: Je.log,\n                          level: Je.level,\n                          endpoint: N,\n                          fn_index: y\n                        });\n                        return;\n                      } else\n                        F === \"generating\" && (R({\n                          type: \"status\",\n                          time: /* @__PURE__ */ new Date(),\n                          ...G,\n                          stage: G == null ? void 0 : G.stage,\n                          queue: !0,\n                          endpoint: N,\n                          fn_index: y\n                        }), Je && (ce === \"sse_v2\" || ce === \"sse_v2.1\") && Ol(ie, Je));\n                      Je && (R({\n                        type: \"data\",\n                        time: /* @__PURE__ */ new Date(),\n                        data: Je.data,\n                        endpoint: N,\n                        fn_index: y\n                      }), _e && R({\n                        type: \"status\",\n                        time: /* @__PURE__ */ new Date(),\n                        ..._e,\n                        stage: G == null ? void 0 : G.stage,\n                        queue: !0,\n                        endpoint: N,\n                        fn_index: y\n                      })), ((G == null ? void 0 : G.stage) === \"complete\" || (G == null ? void 0 : G.stage) === \"error\") && (g[ie] && delete g[ie], ie in S && delete S[ie]);\n                    } catch (F) {\n                      console.error(\"Unexpected client exception\", F), R({\n                        type: \"status\",\n                        stage: \"error\",\n                        message: \"An Unexpected Error Occurred!\",\n                        queue: !0,\n                        endpoint: N,\n                        fn_index: y,\n                        time: /* @__PURE__ */ new Date()\n                      }), Ze();\n                    }\n                  };\n                  ie in b && (b[ie].forEach(\n                    (x) => Q(x)\n                  ), delete b[ie]), g[ie] = Q, Z.add(ie), E || pt();\n                }\n              }));\n          }\n        );\n        function Ol(q, Y) {\n          !S[q] ? (S[q] = [], Y.data.forEach((j, Q) => {\n            S[q][Q] = j;\n          })) : Y.data.forEach((j, Q) => {\n            let x = _u(\n              S[q][Q],\n              j\n            );\n            S[q][Q] = x, Y.data[Q] = x;\n          });\n        }\n        function R(q) {\n          const V = Dt[q.type] || [];\n          V == null || V.forEach((j) => j(q));\n        }\n        function Fn(q, Y) {\n          const V = Dt, j = V[q] || [];\n          return V[q] = j, j == null || j.push(Y), { on: Fn, off: rn, cancel: Gn, destroy: jn };\n        }\n        function rn(q, Y) {\n          const V = Dt;\n          let j = V[q] || [];\n          return j = j == null ? void 0 : j.filter((Q) => Q !== Y), V[q] = j, { on: Fn, off: rn, cancel: Gn, destroy: jn };\n        }\n        async function Gn() {\n          const q = {\n            stage: \"complete\",\n            queue: !1,\n            time: /* @__PURE__ */ new Date()\n          };\n          _e = q, R({\n            ...q,\n            type: \"status\",\n            endpoint: N,\n            fn_index: y\n          });\n          let Y = {};\n          ce === \"ws\" ? (D && D.readyState === 0 ? D.addEventListener(\"open\", () => {\n            D.close();\n          }) : D.close(), Y = { fn_index: y, session_hash: w }) : (re.close(), Y = { event_id: ie });\n          try {\n            await e(`${P.root}/reset`, {\n              headers: { \"Content-Type\": \"application/json\" },\n              method: \"POST\",\n              body: JSON.stringify(Y)\n            });\n          } catch {\n            console.warn(\n              \"The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.\"\n            );\n          }\n        }\n        function jn() {\n          for (const q in Dt)\n            Dt[q].forEach((Y) => {\n              rn(q, Y);\n            });\n        }\n        return {\n          on: Fn,\n          off: rn,\n          cancel: Gn,\n          destroy: jn\n        };\n      }\n      function pt() {\n        E = !0;\n        let A = new URLSearchParams({\n          session_hash: w\n        }).toString(), W = new URL(`${P.root}/queue/data?${A}`);\n        H = t(W), H.onmessage = async function(J) {\n          let m = JSON.parse(J.data);\n          const y = m.event_id;\n          if (!y)\n            await Promise.all(\n              Object.keys(g).map(\n                (M) => g[M](m)\n              )\n            );\n          else if (g[y]) {\n            m.msg === \"process_completed\" && (Z.delete(y), Z.size === 0 && Ze());\n            let M = g[y];\n            window.setTimeout(M, 0, m);\n          } else\n            b[y] || (b[y] = []), b[y].push(m);\n        }, H.onerror = async function(J) {\n          await Promise.all(\n            Object.keys(g).map(\n              (m) => g[m]({\n                msg: \"unexpected_error\",\n                message: Ye\n              })\n            )\n          ), Ze();\n        };\n      }\n      function Ze() {\n        E = !1, H == null || H.close();\n      }\n      async function gt(A, W, J) {\n        var m;\n        const y = { \"Content-Type\": \"application/json\" };\n        f && (y.Authorization = `Bearer ${f}`);\n        let M, D = P.components.find(\n          (N) => N.id === A\n        );\n        (m = D == null ? void 0 : D.props) != null && m.root_url ? M = D.props.root_url : M = P.root;\n        const re = await e(\n          `${M}/component_server/`,\n          {\n            method: \"POST\",\n            body: JSON.stringify({\n              data: J,\n              component_id: A,\n              fn_name: W,\n              session_hash: w\n            }),\n            headers: y\n          }\n        );\n        if (!re.ok)\n          throw new Error(\n            \"Could not connect to component server: \" + re.statusText\n          );\n        return await re.json();\n      }\n      async function xe(A) {\n        if (ue)\n          return ue;\n        const W = { \"Content-Type\": \"application/json\" };\n        f && (W.Authorization = `Bearer ${f}`);\n        let J;\n        if (mi(A.version || \"2.0.0\", \"3.30\") < 0 ? J = await e(\n          \"https://gradio-space-api-fetcher-v2.hf.space/api\",\n          {\n            method: \"POST\",\n            body: JSON.stringify({\n              serialize: !1,\n              config: JSON.stringify(A)\n            }),\n            headers: W\n          }\n        ) : J = await e(`${A.root}/info`, {\n          headers: W\n        }), !J.ok)\n          throw new Error(Ye);\n        let m = await J.json();\n        return \"api\" in m && (m = m.api), m.named_endpoints[\"/predict\"] && !m.unnamed_endpoints[0] && (m.unnamed_endpoints[0] = m.named_endpoints[\"/predict\"]), gu(m, A, T);\n      }\n    });\n  }\n  async function o(l, a, s, u) {\n    const f = await kr(\n      a,\n      void 0,\n      [],\n      !0,\n      s\n    );\n    return Promise.all(\n      f.map(async ({ path: c, blob: _, type: h }) => {\n        if (_) {\n          const d = (await r(l, [_], u)).files[0];\n          return { path: c, file_url: d, type: h, name: _ == null ? void 0 : _.name };\n        }\n        return { path: c, type: h };\n      })\n    ).then((c) => (c.forEach(({ path: _, file_url: h, type: d, name: p }) => {\n      if (d === \"Gallery\")\n        wi(a, h, _);\n      else if (h) {\n        const w = new jr({ path: h, orig_name: p });\n        wi(a, w, _);\n      }\n    }), a));\n  }\n}\nconst { post_data: J_, upload_files: pu, client: Q_, handle_blob: Y_ } = mu(\n  fetch,\n  (...e) => new EventSource(...e)\n);\nfunction gi(e, t, n, r) {\n  switch (e.type) {\n    case \"string\":\n      return \"string\";\n    case \"boolean\":\n      return \"boolean\";\n    case \"number\":\n      return \"number\";\n  }\n  if (n === \"JSONSerializable\" || n === \"StringSerializable\")\n    return \"any\";\n  if (n === \"ListStringSerializable\")\n    return \"string[]\";\n  if (t === \"Image\")\n    return r === \"parameter\" ? \"Blob | File | Buffer\" : \"string\";\n  if (n === \"FileSerializable\")\n    return (e == null ? void 0 : e.type) === \"array\" ? r === \"parameter\" ? \"(Blob | File | Buffer)[]\" : \"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]\" : r === \"parameter\" ? \"Blob | File | Buffer\" : \"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}\";\n  if (n === \"GallerySerializable\")\n    return r === \"parameter\" ? \"[(Blob | File | Buffer), (string | null)][]\" : \"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]\";\n}\nfunction bi(e, t) {\n  return t === \"GallerySerializable\" ? \"array of [file, label] tuples\" : t === \"ListStringSerializable\" ? \"array of strings\" : t === \"FileSerializable\" ? \"array of files or single file\" : e.description;\n}\nfunction gu(e, t, n) {\n  const r = {\n    named_endpoints: {},\n    unnamed_endpoints: {}\n  };\n  for (const i in e) {\n    const o = e[i];\n    for (const l in o) {\n      const a = t.dependencies[l] ? l : n[l.replace(\"/\", \"\")], s = o[l];\n      r[i][l] = {}, r[i][l].parameters = {}, r[i][l].returns = {}, r[i][l].type = t.dependencies[a].types, r[i][l].parameters = s.parameters.map(\n        ({ label: u, component: f, type: c, serializer: _ }) => ({\n          label: u,\n          component: f,\n          type: gi(c, f, _, \"parameter\"),\n          description: bi(c, _)\n        })\n      ), r[i][l].returns = s.returns.map(\n        ({ label: u, component: f, type: c, serializer: _ }) => ({\n          label: u,\n          component: f,\n          type: gi(c, f, _, \"return\"),\n          description: bi(c, _)\n        })\n      );\n    }\n  }\n  return r;\n}\nasync function bu(e, t) {\n  try {\n    return (await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`, {\n      headers: {\n        Authorization: `Bearer ${t}`\n      }\n    })).json()).token || !1;\n  } catch (n) {\n    return console.error(n), !1;\n  }\n}\nfunction wi(e, t, n) {\n  for (; n.length > 1; )\n    e = e[n.shift()];\n  e[n.shift()] = t;\n}\nasync function kr(e, t = void 0, n = [], r = !1, i = void 0) {\n  if (Array.isArray(e)) {\n    let o = [];\n    return await Promise.all(\n      e.map(async (l, a) => {\n        var s;\n        let u = n.slice();\n        u.push(a);\n        const f = await kr(\n          e[a],\n          r ? ((s = i == null ? void 0 : i.parameters[a]) == null ? void 0 : s.component) || void 0 : t,\n          u,\n          !1,\n          i\n        );\n        o = o.concat(f);\n      })\n    ), o;\n  } else {\n    if (globalThis.Buffer && e instanceof globalThis.Buffer)\n      return [\n        {\n          path: n,\n          blob: t === \"Image\" ? !1 : new No([e]),\n          type: t\n        }\n      ];\n    if (typeof e == \"object\") {\n      let o = [];\n      for (let l in e)\n        if (e.hasOwnProperty(l)) {\n          let a = n.slice();\n          a.push(l), o = o.concat(\n            await kr(\n              e[l],\n              void 0,\n              a,\n              !1,\n              i\n            )\n          );\n        }\n      return o;\n    }\n  }\n  return [];\n}\nfunction wu(e, t) {\n  var n, r, i, o;\n  return !(((r = (n = t == null ? void 0 : t.dependencies) == null ? void 0 : n[e]) == null ? void 0 : r.queue) === null ? t.enable_queue : (o = (i = t == null ? void 0 : t.dependencies) == null ? void 0 : i[e]) != null && o.queue) || !1;\n}\nasync function vi(e, t, n) {\n  const r = {};\n  if (n && (r.Authorization = `Bearer ${n}`), typeof window < \"u\" && window.gradio_config && location.origin !== \"http://localhost:9876\" && !window.gradio_config.dev_mode) {\n    const i = window.gradio_config.root, o = window.gradio_config;\n    return o.root = Bo(t, o.root, !1), { ...o, path: i };\n  } else if (t) {\n    let i = await e(`${t}/config`, {\n      headers: r\n    });\n    if (i.status === 200) {\n      const o = await i.json();\n      return o.path = o.path ?? \"\", o.root = t, o;\n    }\n    throw new Error(\"Could not get config.\");\n  }\n  throw new Error(\"No config or app endpoint found\");\n}\nasync function Tr(e, t, n) {\n  let r = t === \"subdomain\" ? `https://huggingface.co/api/spaces/by-subdomain/${e}` : `https://huggingface.co/api/spaces/${e}`, i, o;\n  try {\n    if (i = await fetch(r), o = i.status, o !== 200)\n      throw new Error();\n    i = await i.json();\n  } catch {\n    n({\n      status: \"error\",\n      load_status: \"error\",\n      message: \"Could not get space status\",\n      detail: \"NOT_FOUND\"\n    });\n    return;\n  }\n  if (!i || o !== 200)\n    return;\n  const {\n    runtime: { stage: l },\n    id: a\n  } = i;\n  switch (l) {\n    case \"STOPPED\":\n    case \"SLEEPING\":\n      n({\n        status: \"sleeping\",\n        load_status: \"pending\",\n        message: \"Space is asleep. Waking it up...\",\n        detail: l\n      }), setTimeout(() => {\n        Tr(e, t, n);\n      }, 1e3);\n      break;\n    case \"PAUSED\":\n      n({\n        status: \"paused\",\n        load_status: \"error\",\n        message: \"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.\",\n        detail: l,\n        discussions_enabled: await pi(a)\n      });\n      break;\n    case \"RUNNING\":\n    case \"RUNNING_BUILDING\":\n      n({\n        status: \"running\",\n        load_status: \"complete\",\n        message: \"\",\n        detail: l\n      });\n      break;\n    case \"BUILDING\":\n      n({\n        status: \"building\",\n        load_status: \"pending\",\n        message: \"Space is building...\",\n        detail: l\n      }), setTimeout(() => {\n        Tr(e, t, n);\n      }, 1e3);\n      break;\n    default:\n      n({\n        status: \"space_error\",\n        load_status: \"error\",\n        message: \"This space is experiencing an issue.\",\n        detail: l,\n        discussions_enabled: await pi(a)\n      });\n      break;\n  }\n}\nfunction ir(e, t) {\n  switch (e.msg) {\n    case \"send_data\":\n      return { type: \"data\" };\n    case \"send_hash\":\n      return { type: \"hash\" };\n    case \"queue_full\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          message: Ho,\n          stage: \"error\",\n          code: e.code,\n          success: e.success\n        }\n      };\n    case \"heartbeat\":\n      return {\n        type: \"heartbeat\"\n      };\n    case \"unexpected_error\":\n      return {\n        type: \"unexpected_error\",\n        status: {\n          queue: !0,\n          message: e.message,\n          stage: \"error\",\n          success: !1\n        }\n      };\n    case \"estimation\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          stage: t || \"pending\",\n          code: e.code,\n          size: e.queue_size,\n          position: e.rank,\n          eta: e.rank_eta,\n          success: e.success\n        }\n      };\n    case \"progress\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          stage: \"pending\",\n          code: e.code,\n          progress_data: e.progress_data,\n          success: e.success\n        }\n      };\n    case \"log\":\n      return { type: \"log\", data: e };\n    case \"process_generating\":\n      return {\n        type: \"generating\",\n        status: {\n          queue: !0,\n          message: e.success ? null : e.output.error,\n          stage: e.success ? \"generating\" : \"error\",\n          code: e.code,\n          progress_data: e.progress_data,\n          eta: e.average_duration\n        },\n        data: e.success ? e.output : null\n      };\n    case \"process_completed\":\n      return \"error\" in e.output ? {\n        type: \"update\",\n        status: {\n          queue: !0,\n          message: e.output.error,\n          stage: \"error\",\n          code: e.code,\n          success: e.success\n        }\n      } : {\n        type: \"complete\",\n        status: {\n          queue: !0,\n          message: e.success ? void 0 : e.output.error,\n          stage: e.success ? \"complete\" : \"error\",\n          code: e.code,\n          progress_data: e.progress_data\n        },\n        data: e.success ? e.output : null\n      };\n    case \"process_starts\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          stage: \"pending\",\n          code: e.code,\n          size: e.rank,\n          position: 0,\n          success: e.success,\n          eta: e.eta\n        }\n      };\n  }\n  return { type: \"none\", status: { stage: \"error\", queue: !0 } };\n}\nfunction ot() {\n}\nfunction vu(e) {\n  return e();\n}\nfunction yu(e) {\n  e.forEach(vu);\n}\nfunction Eu(e) {\n  return typeof e == \"function\";\n}\nfunction Su(e, t) {\n  return e != e ? t == t : e !== t || e && typeof e == \"object\" || typeof e == \"function\";\n}\nfunction ku(e, ...t) {\n  if (e == null) {\n    for (const r of t)\n      r(void 0);\n    return ot;\n  }\n  const n = e.subscribe(...t);\n  return n.unsubscribe ? () => n.unsubscribe() : n;\n}\nconst Po = typeof window < \"u\";\nlet yi = Po ? () => window.performance.now() : () => Date.now(), Io = Po ? (e) => requestAnimationFrame(e) : ot;\nconst kt = /* @__PURE__ */ new Set();\nfunction Lo(e) {\n  kt.forEach((t) => {\n    t.c(e) || (kt.delete(t), t.f());\n  }), kt.size !== 0 && Io(Lo);\n}\nfunction Tu(e) {\n  let t;\n  return kt.size === 0 && Io(Lo), {\n    promise: new Promise((n) => {\n      kt.add(t = { c: e, f: n });\n    }),\n    abort() {\n      kt.delete(t);\n    }\n  };\n}\nconst vt = [];\nfunction Au(e, t) {\n  return {\n    subscribe: Yt(e, t).subscribe\n  };\n}\nfunction Yt(e, t = ot) {\n  let n;\n  const r = /* @__PURE__ */ new Set();\n  function i(a) {\n    if (Su(e, a) && (e = a, n)) {\n      const s = !vt.length;\n      for (const u of r)\n        u[1](), vt.push(u, e);\n      if (s) {\n        for (let u = 0; u < vt.length; u += 2)\n          vt[u][0](vt[u + 1]);\n        vt.length = 0;\n      }\n    }\n  }\n  function o(a) {\n    i(a(e));\n  }\n  function l(a, s = ot) {\n    const u = [a, s];\n    return r.add(u), r.size === 1 && (n = t(i, o) || ot), a(e), () => {\n      r.delete(u), r.size === 0 && n && (n(), n = null);\n    };\n  }\n  return { set: i, update: o, subscribe: l };\n}\nfunction It(e, t, n) {\n  const r = !Array.isArray(e), i = r ? [e] : e;\n  if (!i.every(Boolean))\n    throw new Error(\"derived() expects stores as input, got a falsy value\");\n  const o = t.length < 2;\n  return Au(n, (l, a) => {\n    let s = !1;\n    const u = [];\n    let f = 0, c = ot;\n    const _ = () => {\n      if (f)\n        return;\n      c();\n      const d = t(r ? u[0] : u, l, a);\n      o ? l(d) : c = Eu(d) ? d : ot;\n    }, h = i.map(\n      (d, p) => ku(\n        d,\n        (w) => {\n          u[p] = w, f &= ~(1 << p), s && _();\n        },\n        () => {\n          f |= 1 << p;\n        }\n      )\n    );\n    return s = !0, _(), function() {\n      yu(h), c(), s = !1;\n    };\n  });\n}\nfunction Ei(e) {\n  return Object.prototype.toString.call(e) === \"[object Date]\";\n}\nfunction Ar(e, t, n, r) {\n  if (typeof n == \"number\" || Ei(n)) {\n    const i = r - n, o = (n - t) / (e.dt || 1 / 60), l = e.opts.stiffness * i, a = e.opts.damping * o, s = (l - a) * e.inv_mass, u = (o + s) * e.dt;\n    return Math.abs(u) < e.opts.precision && Math.abs(i) < e.opts.precision ? r : (e.settled = !1, Ei(n) ? new Date(n.getTime() + u) : n + u);\n  } else {\n    if (Array.isArray(n))\n      return n.map(\n        (i, o) => Ar(e, t[o], n[o], r[o])\n      );\n    if (typeof n == \"object\") {\n      const i = {};\n      for (const o in n)\n        i[o] = Ar(e, t[o], n[o], r[o]);\n      return i;\n    } else\n      throw new Error(`Cannot spring ${typeof n} values`);\n  }\n}\nfunction Si(e, t = {}) {\n  const n = Yt(e), { stiffness: r = 0.15, damping: i = 0.8, precision: o = 0.01 } = t;\n  let l, a, s, u = e, f = e, c = 1, _ = 0, h = !1;\n  function d(w, v = {}) {\n    f = w;\n    const E = s = {};\n    return e == null || v.hard || p.stiffness >= 1 && p.damping >= 1 ? (h = !0, l = yi(), u = w, n.set(e = f), Promise.resolve()) : (v.soft && (_ = 1 / ((v.soft === !0 ? 0.5 : +v.soft) * 60), c = 0), a || (l = yi(), h = !1, a = Tu((b) => {\n      if (h)\n        return h = !1, a = null, !1;\n      c = Math.min(c + _, 1);\n      const S = {\n        inv_mass: c,\n        opts: p,\n        settled: !0,\n        dt: (b - l) * 60 / 1e3\n      }, H = Ar(S, u, e, f);\n      return l = b, u = e, n.set(e = H), S.settled && (a = null), !S.settled;\n    })), new Promise((b) => {\n      a.promise.then(() => {\n        E === s && b();\n      });\n    }));\n  }\n  const p = {\n    set: d,\n    update: (w, v) => d(w(f, e), v),\n    subscribe: n.subscribe,\n    stiffness: r,\n    damping: i,\n    precision: o\n  };\n  return p;\n}\nvar K_ = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {};\nfunction Bu(e) {\n  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;\n}\nvar Cu = function(t) {\n  return Hu(t) && !Nu(t);\n};\nfunction Hu(e) {\n  return !!e && typeof e == \"object\";\n}\nfunction Nu(e) {\n  var t = Object.prototype.toString.call(e);\n  return t === \"[object RegExp]\" || t === \"[object Date]\" || Lu(e);\n}\nvar Pu = typeof Symbol == \"function\" && Symbol.for, Iu = Pu ? Symbol.for(\"react.element\") : 60103;\nfunction Lu(e) {\n  return e.$$typeof === Iu;\n}\nfunction Ou(e) {\n  return Array.isArray(e) ? [] : {};\n}\nfunction Xt(e, t) {\n  return t.clone !== !1 && t.isMergeableObject(e) ? Tt(Ou(e), e, t) : e;\n}\nfunction Du(e, t, n) {\n  return e.concat(t).map(function(r) {\n    return Xt(r, n);\n  });\n}\nfunction Mu(e, t) {\n  if (!t.customMerge)\n    return Tt;\n  var n = t.customMerge(e);\n  return typeof n == \"function\" ? n : Tt;\n}\nfunction Ru(e) {\n  return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {\n    return Object.propertyIsEnumerable.call(e, t);\n  }) : [];\n}\nfunction ki(e) {\n  return Object.keys(e).concat(Ru(e));\n}\nfunction Oo(e, t) {\n  try {\n    return t in e;\n  } catch {\n    return !1;\n  }\n}\nfunction Uu(e, t) {\n  return Oo(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));\n}\nfunction Fu(e, t, n) {\n  var r = {};\n  return n.isMergeableObject(e) && ki(e).forEach(function(i) {\n    r[i] = Xt(e[i], n);\n  }), ki(t).forEach(function(i) {\n    Uu(e, i) || (Oo(e, i) && n.isMergeableObject(t[i]) ? r[i] = Mu(i, n)(e[i], t[i], n) : r[i] = Xt(t[i], n));\n  }), r;\n}\nfunction Tt(e, t, n) {\n  n = n || {}, n.arrayMerge = n.arrayMerge || Du, n.isMergeableObject = n.isMergeableObject || Cu, n.cloneUnlessOtherwiseSpecified = Xt;\n  var r = Array.isArray(t), i = Array.isArray(e), o = r === i;\n  return o ? r ? n.arrayMerge(e, t, n) : Fu(e, t, n) : Xt(t, n);\n}\nTt.all = function(t, n) {\n  if (!Array.isArray(t))\n    throw new Error(\"first argument should be an array\");\n  return t.reduce(function(r, i) {\n    return Tt(r, i, n);\n  }, {});\n};\nvar Gu = Tt, ju = Gu;\nconst qu = /* @__PURE__ */ Bu(ju);\nvar Br = function(e, t) {\n  return Br = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {\n    n.__proto__ = r;\n  } || function(n, r) {\n    for (var i in r)\n      Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);\n  }, Br(e, t);\n};\nfunction Hn(e, t) {\n  if (typeof t != \"function\" && t !== null)\n    throw new TypeError(\"Class extends value \" + String(t) + \" is not a constructor or null\");\n  Br(e, t);\n  function n() {\n    this.constructor = e;\n  }\n  e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());\n}\nvar U = function() {\n  return U = Object.assign || function(t) {\n    for (var n, r = 1, i = arguments.length; r < i; r++) {\n      n = arguments[r];\n      for (var o in n)\n        Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);\n    }\n    return t;\n  }, U.apply(this, arguments);\n};\nfunction or(e, t, n) {\n  if (n || arguments.length === 2)\n    for (var r = 0, i = t.length, o; r < i; r++)\n      (o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);\n  return e.concat(o || Array.prototype.slice.call(t));\n}\nvar I;\n(function(e) {\n  e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\", e[e.EMPTY_ARGUMENT = 2] = \"EMPTY_ARGUMENT\", e[e.MALFORMED_ARGUMENT = 3] = \"MALFORMED_ARGUMENT\", e[e.EXPECT_ARGUMENT_TYPE = 4] = \"EXPECT_ARGUMENT_TYPE\", e[e.INVALID_ARGUMENT_TYPE = 5] = \"INVALID_ARGUMENT_TYPE\", e[e.EXPECT_ARGUMENT_STYLE = 6] = \"EXPECT_ARGUMENT_STYLE\", e[e.INVALID_NUMBER_SKELETON = 7] = \"INVALID_NUMBER_SKELETON\", e[e.INVALID_DATE_TIME_SKELETON = 8] = \"INVALID_DATE_TIME_SKELETON\", e[e.EXPECT_NUMBER_SKELETON = 9] = \"EXPECT_NUMBER_SKELETON\", e[e.EXPECT_DATE_TIME_SKELETON = 10] = \"EXPECT_DATE_TIME_SKELETON\", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\", e[e.MISSING_OTHER_CLAUSE = 22] = \"MISSING_OTHER_CLAUSE\", e[e.INVALID_TAG = 23] = \"INVALID_TAG\", e[e.INVALID_TAG_NAME = 25] = \"INVALID_TAG_NAME\", e[e.UNMATCHED_CLOSING_TAG = 26] = \"UNMATCHED_CLOSING_TAG\", e[e.UNCLOSED_TAG = 27] = \"UNCLOSED_TAG\";\n})(I || (I = {}));\nvar z;\n(function(e) {\n  e[e.literal = 0] = \"literal\", e[e.argument = 1] = \"argument\", e[e.number = 2] = \"number\", e[e.date = 3] = \"date\", e[e.time = 4] = \"time\", e[e.select = 5] = \"select\", e[e.plural = 6] = \"plural\", e[e.pound = 7] = \"pound\", e[e.tag = 8] = \"tag\";\n})(z || (z = {}));\nvar At;\n(function(e) {\n  e[e.number = 0] = \"number\", e[e.dateTime = 1] = \"dateTime\";\n})(At || (At = {}));\nfunction Ti(e) {\n  return e.type === z.literal;\n}\nfunction zu(e) {\n  return e.type === z.argument;\n}\nfunction Do(e) {\n  return e.type === z.number;\n}\nfunction Mo(e) {\n  return e.type === z.date;\n}\nfunction Ro(e) {\n  return e.type === z.time;\n}\nfunction Uo(e) {\n  return e.type === z.select;\n}\nfunction Fo(e) {\n  return e.type === z.plural;\n}\nfunction Vu(e) {\n  return e.type === z.pound;\n}\nfunction Go(e) {\n  return e.type === z.tag;\n}\nfunction jo(e) {\n  return !!(e && typeof e == \"object\" && e.type === At.number);\n}\nfunction Cr(e) {\n  return !!(e && typeof e == \"object\" && e.type === At.dateTime);\n}\nvar qo = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/, Xu = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\nfunction Wu(e) {\n  var t = {};\n  return e.replace(Xu, function(n) {\n    var r = n.length;\n    switch (n[0]) {\n      case \"G\":\n        t.era = r === 4 ? \"long\" : r === 5 ? \"narrow\" : \"short\";\n        break;\n      case \"y\":\n        t.year = r === 2 ? \"2-digit\" : \"numeric\";\n        break;\n      case \"Y\":\n      case \"u\":\n      case \"U\":\n      case \"r\":\n        throw new RangeError(\"`Y/u/U/r` (year) patterns are not supported, use `y` instead\");\n      case \"q\":\n      case \"Q\":\n        throw new RangeError(\"`q/Q` (quarter) patterns are not supported\");\n      case \"M\":\n      case \"L\":\n        t.month = [\"numeric\", \"2-digit\", \"short\", \"long\", \"narrow\"][r - 1];\n        break;\n      case \"w\":\n      case \"W\":\n        throw new RangeError(\"`w/W` (week) patterns are not supported\");\n      case \"d\":\n        t.day = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"D\":\n      case \"F\":\n      case \"g\":\n        throw new RangeError(\"`D/F/g` (day) patterns are not supported, use `d` instead\");\n      case \"E\":\n        t.weekday = r === 4 ? \"short\" : r === 5 ? \"narrow\" : \"short\";\n        break;\n      case \"e\":\n        if (r < 4)\n          throw new RangeError(\"`e..eee` (weekday) patterns are not supported\");\n        t.weekday = [\"short\", \"long\", \"narrow\", \"short\"][r - 4];\n        break;\n      case \"c\":\n        if (r < 4)\n          throw new RangeError(\"`c..ccc` (weekday) patterns are not supported\");\n        t.weekday = [\"short\", \"long\", \"narrow\", \"short\"][r - 4];\n        break;\n      case \"a\":\n        t.hour12 = !0;\n        break;\n      case \"b\":\n      case \"B\":\n        throw new RangeError(\"`b/B` (period) patterns are not supported, use `a` instead\");\n      case \"h\":\n        t.hourCycle = \"h12\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"H\":\n        t.hourCycle = \"h23\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"K\":\n        t.hourCycle = \"h11\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"k\":\n        t.hourCycle = \"h24\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"j\":\n      case \"J\":\n      case \"C\":\n        throw new RangeError(\"`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead\");\n      case \"m\":\n        t.minute = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"s\":\n        t.second = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"S\":\n      case \"A\":\n        throw new RangeError(\"`S/A` (second) patterns are not supported, use `s` instead\");\n      case \"z\":\n        t.timeZoneName = r < 4 ? \"short\" : \"long\";\n        break;\n      case \"Z\":\n      case \"O\":\n      case \"v\":\n      case \"V\":\n      case \"X\":\n      case \"x\":\n        throw new RangeError(\"`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead\");\n    }\n    return \"\";\n  }), t;\n}\nvar Zu = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\nfunction xu(e) {\n  if (e.length === 0)\n    throw new Error(\"Number skeleton cannot be empty\");\n  for (var t = e.split(Zu).filter(function(_) {\n    return _.length > 0;\n  }), n = [], r = 0, i = t; r < i.length; r++) {\n    var o = i[r], l = o.split(\"/\");\n    if (l.length === 0)\n      throw new Error(\"Invalid number skeleton\");\n    for (var a = l[0], s = l.slice(1), u = 0, f = s; u < f.length; u++) {\n      var c = f[u];\n      if (c.length === 0)\n        throw new Error(\"Invalid number skeleton\");\n    }\n    n.push({ stem: a, options: s });\n  }\n  return n;\n}\nfunction Ju(e) {\n  return e.replace(/^(.*?)-/, \"\");\n}\nvar Ai = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g, zo = /^(@+)?(\\+|#+)?[rs]?$/g, Qu = /(\\*)(0+)|(#+)(0+)|(0+)/g, Vo = /^(0+)$/;\nfunction Bi(e) {\n  var t = {};\n  return e[e.length - 1] === \"r\" ? t.roundingPriority = \"morePrecision\" : e[e.length - 1] === \"s\" && (t.roundingPriority = \"lessPrecision\"), e.replace(zo, function(n, r, i) {\n    return typeof i != \"string\" ? (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length) : i === \"+\" ? t.minimumSignificantDigits = r.length : r[0] === \"#\" ? t.maximumSignificantDigits = r.length : (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length + (typeof i == \"string\" ? i.length : 0)), \"\";\n  }), t;\n}\nfunction Xo(e) {\n  switch (e) {\n    case \"sign-auto\":\n      return {\n        signDisplay: \"auto\"\n      };\n    case \"sign-accounting\":\n    case \"()\":\n      return {\n        currencySign: \"accounting\"\n      };\n    case \"sign-always\":\n    case \"+!\":\n      return {\n        signDisplay: \"always\"\n      };\n    case \"sign-accounting-always\":\n    case \"()!\":\n      return {\n        signDisplay: \"always\",\n        currencySign: \"accounting\"\n      };\n    case \"sign-except-zero\":\n    case \"+?\":\n      return {\n        signDisplay: \"exceptZero\"\n      };\n    case \"sign-accounting-except-zero\":\n    case \"()?\":\n      return {\n        signDisplay: \"exceptZero\",\n        currencySign: \"accounting\"\n      };\n    case \"sign-never\":\n    case \"+_\":\n      return {\n        signDisplay: \"never\"\n      };\n  }\n}\nfunction Yu(e) {\n  var t;\n  if (e[0] === \"E\" && e[1] === \"E\" ? (t = {\n    notation: \"engineering\"\n  }, e = e.slice(2)) : e[0] === \"E\" && (t = {\n    notation: \"scientific\"\n  }, e = e.slice(1)), t) {\n    var n = e.slice(0, 2);\n    if (n === \"+!\" ? (t.signDisplay = \"always\", e = e.slice(2)) : n === \"+?\" && (t.signDisplay = \"exceptZero\", e = e.slice(2)), !Vo.test(e))\n      throw new Error(\"Malformed concise eng/scientific notation\");\n    t.minimumIntegerDigits = e.length;\n  }\n  return t;\n}\nfunction Ci(e) {\n  var t = {}, n = Xo(e);\n  return n || t;\n}\nfunction Ku(e) {\n  for (var t = {}, n = 0, r = e; n < r.length; n++) {\n    var i = r[n];\n    switch (i.stem) {\n      case \"percent\":\n      case \"%\":\n        t.style = \"percent\";\n        continue;\n      case \"%x100\":\n        t.style = \"percent\", t.scale = 100;\n        continue;\n      case \"currency\":\n        t.style = \"currency\", t.currency = i.options[0];\n        continue;\n      case \"group-off\":\n      case \",_\":\n        t.useGrouping = !1;\n        continue;\n      case \"precision-integer\":\n      case \".\":\n        t.maximumFractionDigits = 0;\n        continue;\n      case \"measure-unit\":\n      case \"unit\":\n        t.style = \"unit\", t.unit = Ju(i.options[0]);\n        continue;\n      case \"compact-short\":\n      case \"K\":\n        t.notation = \"compact\", t.compactDisplay = \"short\";\n        continue;\n      case \"compact-long\":\n      case \"KK\":\n        t.notation = \"compact\", t.compactDisplay = \"long\";\n        continue;\n      case \"scientific\":\n        t = U(U(U({}, t), { notation: \"scientific\" }), i.options.reduce(function(s, u) {\n          return U(U({}, s), Ci(u));\n        }, {}));\n        continue;\n      case \"engineering\":\n        t = U(U(U({}, t), { notation: \"engineering\" }), i.options.reduce(function(s, u) {\n          return U(U({}, s), Ci(u));\n        }, {}));\n        continue;\n      case \"notation-simple\":\n        t.notation = \"standard\";\n        continue;\n      case \"unit-width-narrow\":\n        t.currencyDisplay = \"narrowSymbol\", t.unitDisplay = \"narrow\";\n        continue;\n      case \"unit-width-short\":\n        t.currencyDisplay = \"code\", t.unitDisplay = \"short\";\n        continue;\n      case \"unit-width-full-name\":\n        t.currencyDisplay = \"name\", t.unitDisplay = \"long\";\n        continue;\n      case \"unit-width-iso-code\":\n        t.currencyDisplay = \"symbol\";\n        continue;\n      case \"scale\":\n        t.scale = parseFloat(i.options[0]);\n        continue;\n      case \"integer-width\":\n        if (i.options.length > 1)\n          throw new RangeError(\"integer-width stems only accept a single optional option\");\n        i.options[0].replace(Qu, function(s, u, f, c, _, h) {\n          if (u)\n            t.minimumIntegerDigits = f.length;\n          else {\n            if (c && _)\n              throw new Error(\"We currently do not support maximum integer digits\");\n            if (h)\n              throw new Error(\"We currently do not support exact integer digits\");\n          }\n          return \"\";\n        });\n        continue;\n    }\n    if (Vo.test(i.stem)) {\n      t.minimumIntegerDigits = i.stem.length;\n      continue;\n    }\n    if (Ai.test(i.stem)) {\n      if (i.options.length > 1)\n        throw new RangeError(\"Fraction-precision stems only accept a single optional option\");\n      i.stem.replace(Ai, function(s, u, f, c, _, h) {\n        return f === \"*\" ? t.minimumFractionDigits = u.length : c && c[0] === \"#\" ? t.maximumFractionDigits = c.length : _ && h ? (t.minimumFractionDigits = _.length, t.maximumFractionDigits = _.length + h.length) : (t.minimumFractionDigits = u.length, t.maximumFractionDigits = u.length), \"\";\n      });\n      var o = i.options[0];\n      o === \"w\" ? t = U(U({}, t), { trailingZeroDisplay: \"stripIfInteger\" }) : o && (t = U(U({}, t), Bi(o)));\n      continue;\n    }\n    if (zo.test(i.stem)) {\n      t = U(U({}, t), Bi(i.stem));\n      continue;\n    }\n    var l = Xo(i.stem);\n    l && (t = U(U({}, t), l));\n    var a = Yu(i.stem);\n    a && (t = U(U({}, t), a));\n  }\n  return t;\n}\nvar fn = {\n  AX: [\n    \"H\"\n  ],\n  BQ: [\n    \"H\"\n  ],\n  CP: [\n    \"H\"\n  ],\n  CZ: [\n    \"H\"\n  ],\n  DK: [\n    \"H\"\n  ],\n  FI: [\n    \"H\"\n  ],\n  ID: [\n    \"H\"\n  ],\n  IS: [\n    \"H\"\n  ],\n  ML: [\n    \"H\"\n  ],\n  NE: [\n    \"H\"\n  ],\n  RU: [\n    \"H\"\n  ],\n  SE: [\n    \"H\"\n  ],\n  SJ: [\n    \"H\"\n  ],\n  SK: [\n    \"H\"\n  ],\n  AS: [\n    \"h\",\n    \"H\"\n  ],\n  BT: [\n    \"h\",\n    \"H\"\n  ],\n  DJ: [\n    \"h\",\n    \"H\"\n  ],\n  ER: [\n    \"h\",\n    \"H\"\n  ],\n  GH: [\n    \"h\",\n    \"H\"\n  ],\n  IN: [\n    \"h\",\n    \"H\"\n  ],\n  LS: [\n    \"h\",\n    \"H\"\n  ],\n  PG: [\n    \"h\",\n    \"H\"\n  ],\n  PW: [\n    \"h\",\n    \"H\"\n  ],\n  SO: [\n    \"h\",\n    \"H\"\n  ],\n  TO: [\n    \"h\",\n    \"H\"\n  ],\n  VU: [\n    \"h\",\n    \"H\"\n  ],\n  WS: [\n    \"h\",\n    \"H\"\n  ],\n  \"001\": [\n    \"H\",\n    \"h\"\n  ],\n  AL: [\n    \"h\",\n    \"H\",\n    \"hB\"\n  ],\n  TD: [\n    \"h\",\n    \"H\",\n    \"hB\"\n  ],\n  \"ca-ES\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  CF: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  CM: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"fr-CA\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"gl-ES\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"it-CH\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"it-IT\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  LU: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  NP: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  PF: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  SC: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  SM: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  SN: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  TF: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  VA: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  CY: [\n    \"h\",\n    \"H\",\n    \"hb\",\n    \"hB\"\n  ],\n  GR: [\n    \"h\",\n    \"H\",\n    \"hb\",\n    \"hB\"\n  ],\n  CO: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  DO: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  KP: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  KR: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  NA: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  PA: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  PR: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  VE: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  AC: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  AI: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  BW: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  BZ: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  CC: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  CK: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  CX: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  DG: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  FK: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  GB: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  GG: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  GI: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  IE: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  IM: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  IO: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  JE: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  LT: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  MK: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  MN: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  MS: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NF: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NG: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NR: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NU: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  PN: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  SH: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  SX: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  TA: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  ZA: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  \"af-ZA\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  AR: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  CL: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  CR: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  CU: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  EA: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-BO\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-BR\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-EC\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-ES\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-GQ\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-PE\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  GT: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  HN: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  IC: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  KG: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  KM: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  LK: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  MA: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  MX: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  NI: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  PY: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  SV: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  UY: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  JP: [\n    \"H\",\n    \"h\",\n    \"K\"\n  ],\n  AD: [\n    \"H\",\n    \"hB\"\n  ],\n  AM: [\n    \"H\",\n    \"hB\"\n  ],\n  AO: [\n    \"H\",\n    \"hB\"\n  ],\n  AT: [\n    \"H\",\n    \"hB\"\n  ],\n  AW: [\n    \"H\",\n    \"hB\"\n  ],\n  BE: [\n    \"H\",\n    \"hB\"\n  ],\n  BF: [\n    \"H\",\n    \"hB\"\n  ],\n  BJ: [\n    \"H\",\n    \"hB\"\n  ],\n  BL: [\n    \"H\",\n    \"hB\"\n  ],\n  BR: [\n    \"H\",\n    \"hB\"\n  ],\n  CG: [\n    \"H\",\n    \"hB\"\n  ],\n  CI: [\n    \"H\",\n    \"hB\"\n  ],\n  CV: [\n    \"H\",\n    \"hB\"\n  ],\n  DE: [\n    \"H\",\n    \"hB\"\n  ],\n  EE: [\n    \"H\",\n    \"hB\"\n  ],\n  FR: [\n    \"H\",\n    \"hB\"\n  ],\n  GA: [\n    \"H\",\n    \"hB\"\n  ],\n  GF: [\n    \"H\",\n    \"hB\"\n  ],\n  GN: [\n    \"H\",\n    \"hB\"\n  ],\n  GP: [\n    \"H\",\n    \"hB\"\n  ],\n  GW: [\n    \"H\",\n    \"hB\"\n  ],\n  HR: [\n    \"H\",\n    \"hB\"\n  ],\n  IL: [\n    \"H\",\n    \"hB\"\n  ],\n  IT: [\n    \"H\",\n    \"hB\"\n  ],\n  KZ: [\n    \"H\",\n    \"hB\"\n  ],\n  MC: [\n    \"H\",\n    \"hB\"\n  ],\n  MD: [\n    \"H\",\n    \"hB\"\n  ],\n  MF: [\n    \"H\",\n    \"hB\"\n  ],\n  MQ: [\n    \"H\",\n    \"hB\"\n  ],\n  MZ: [\n    \"H\",\n    \"hB\"\n  ],\n  NC: [\n    \"H\",\n    \"hB\"\n  ],\n  NL: [\n    \"H\",\n    \"hB\"\n  ],\n  PM: [\n    \"H\",\n    \"hB\"\n  ],\n  PT: [\n    \"H\",\n    \"hB\"\n  ],\n  RE: [\n    \"H\",\n    \"hB\"\n  ],\n  RO: [\n    \"H\",\n    \"hB\"\n  ],\n  SI: [\n    \"H\",\n    \"hB\"\n  ],\n  SR: [\n    \"H\",\n    \"hB\"\n  ],\n  ST: [\n    \"H\",\n    \"hB\"\n  ],\n  TG: [\n    \"H\",\n    \"hB\"\n  ],\n  TR: [\n    \"H\",\n    \"hB\"\n  ],\n  WF: [\n    \"H\",\n    \"hB\"\n  ],\n  YT: [\n    \"H\",\n    \"hB\"\n  ],\n  BD: [\n    \"h\",\n    \"hB\",\n    \"H\"\n  ],\n  PK: [\n    \"h\",\n    \"hB\",\n    \"H\"\n  ],\n  AZ: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  BA: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  BG: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  CH: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  GE: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  LI: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  ME: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  RS: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  UA: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  UZ: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  XK: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  AG: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  AU: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BB: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BS: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  CA: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  DM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  \"en-001\": [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  FJ: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  FM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GD: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GU: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GY: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  JM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  KI: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  KN: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  KY: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  LC: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  LR: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  MH: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  MP: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  MW: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  NZ: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SB: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SG: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SL: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SS: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SZ: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  TC: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  TT: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  UM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  US: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  VC: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  VG: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  VI: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  ZM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BO: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  EC: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  ES: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  GQ: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  PE: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  AE: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  \"ar-001\": [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  BH: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  DZ: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  EG: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  EH: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  HK: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  IQ: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  JO: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  KW: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  LB: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  LY: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  MO: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  MR: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  OM: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  PH: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  PS: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  QA: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  SA: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  SD: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  SY: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  TN: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  YE: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  AF: [\n    \"H\",\n    \"hb\",\n    \"hB\",\n    \"h\"\n  ],\n  LA: [\n    \"H\",\n    \"hb\",\n    \"hB\",\n    \"h\"\n  ],\n  CN: [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  LV: [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  TL: [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  \"zu-ZA\": [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  CD: [\n    \"hB\",\n    \"H\"\n  ],\n  IR: [\n    \"hB\",\n    \"H\"\n  ],\n  \"hi-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  \"kn-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  \"ml-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  \"te-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  KH: [\n    \"hB\",\n    \"h\",\n    \"H\",\n    \"hb\"\n  ],\n  \"ta-IN\": [\n    \"hB\",\n    \"h\",\n    \"hb\",\n    \"H\"\n  ],\n  BN: [\n    \"hb\",\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  MY: [\n    \"hb\",\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  ET: [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  \"gu-IN\": [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  \"mr-IN\": [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  \"pa-IN\": [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  TW: [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  KE: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ],\n  MM: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ],\n  TZ: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ],\n  UG: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ]\n};\nfunction $u(e, t) {\n  for (var n = \"\", r = 0; r < e.length; r++) {\n    var i = e.charAt(r);\n    if (i === \"j\") {\n      for (var o = 0; r + 1 < e.length && e.charAt(r + 1) === i; )\n        o++, r++;\n      var l = 1 + (o & 1), a = o < 2 ? 1 : 3 + (o >> 1), s = \"a\", u = ef(t);\n      for ((u == \"H\" || u == \"k\") && (a = 0); a-- > 0; )\n        n += s;\n      for (; l-- > 0; )\n        n = u + n;\n    } else\n      i === \"J\" ? n += \"H\" : n += i;\n  }\n  return n;\n}\nfunction ef(e) {\n  var t = e.hourCycle;\n  if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet\n  e.hourCycles && // @ts-ignore\n  e.hourCycles.length && (t = e.hourCycles[0]), t)\n    switch (t) {\n      case \"h24\":\n        return \"k\";\n      case \"h23\":\n        return \"H\";\n      case \"h12\":\n        return \"h\";\n      case \"h11\":\n        return \"K\";\n      default:\n        throw new Error(\"Invalid hourCycle\");\n    }\n  var n = e.language, r;\n  n !== \"root\" && (r = e.maximize().region);\n  var i = fn[r || \"\"] || fn[n || \"\"] || fn[\"\".concat(n, \"-001\")] || fn[\"001\"];\n  return i[0];\n}\nvar lr, tf = new RegExp(\"^\".concat(qo.source, \"*\")), nf = new RegExp(\"\".concat(qo.source, \"*$\"));\nfunction L(e, t) {\n  return { start: e, end: t };\n}\nvar rf = !!String.prototype.startsWith, of = !!String.fromCodePoint, lf = !!Object.fromEntries, sf = !!String.prototype.codePointAt, af = !!String.prototype.trimStart, uf = !!String.prototype.trimEnd, ff = !!Number.isSafeInteger, cf = ff ? Number.isSafeInteger : function(e) {\n  return typeof e == \"number\" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;\n}, Hr = !0;\ntry {\n  var _f = Zo(\"([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)\", \"yu\");\n  Hr = ((lr = _f.exec(\"a\")) === null || lr === void 0 ? void 0 : lr[0]) === \"a\";\n} catch {\n  Hr = !1;\n}\nvar Hi = rf ? (\n  // Native\n  function(t, n, r) {\n    return t.startsWith(n, r);\n  }\n) : (\n  // For IE11\n  function(t, n, r) {\n    return t.slice(r, r + n.length) === n;\n  }\n), Nr = of ? String.fromCodePoint : (\n  // IE11\n  function() {\n    for (var t = [], n = 0; n < arguments.length; n++)\n      t[n] = arguments[n];\n    for (var r = \"\", i = t.length, o = 0, l; i > o; ) {\n      if (l = t[o++], l > 1114111)\n        throw RangeError(l + \" is not a valid code point\");\n      r += l < 65536 ? String.fromCharCode(l) : String.fromCharCode(((l -= 65536) >> 10) + 55296, l % 1024 + 56320);\n    }\n    return r;\n  }\n), Ni = (\n  // native\n  lf ? Object.fromEntries : (\n    // Ponyfill\n    function(t) {\n      for (var n = {}, r = 0, i = t; r < i.length; r++) {\n        var o = i[r], l = o[0], a = o[1];\n        n[l] = a;\n      }\n      return n;\n    }\n  )\n), Wo = sf ? (\n  // Native\n  function(t, n) {\n    return t.codePointAt(n);\n  }\n) : (\n  // IE 11\n  function(t, n) {\n    var r = t.length;\n    if (!(n < 0 || n >= r)) {\n      var i = t.charCodeAt(n), o;\n      return i < 55296 || i > 56319 || n + 1 === r || (o = t.charCodeAt(n + 1)) < 56320 || o > 57343 ? i : (i - 55296 << 10) + (o - 56320) + 65536;\n    }\n  }\n), hf = af ? (\n  // Native\n  function(t) {\n    return t.trimStart();\n  }\n) : (\n  // Ponyfill\n  function(t) {\n    return t.replace(tf, \"\");\n  }\n), df = uf ? (\n  // Native\n  function(t) {\n    return t.trimEnd();\n  }\n) : (\n  // Ponyfill\n  function(t) {\n    return t.replace(nf, \"\");\n  }\n);\nfunction Zo(e, t) {\n  return new RegExp(e, t);\n}\nvar Pr;\nif (Hr) {\n  var Pi = Zo(\"([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)\", \"yu\");\n  Pr = function(t, n) {\n    var r;\n    Pi.lastIndex = n;\n    var i = Pi.exec(t);\n    return (r = i[1]) !== null && r !== void 0 ? r : \"\";\n  };\n} else\n  Pr = function(t, n) {\n    for (var r = []; ; ) {\n      var i = Wo(t, n);\n      if (i === void 0 || xo(i) || bf(i))\n        break;\n      r.push(i), n += i >= 65536 ? 2 : 1;\n    }\n    return Nr.apply(void 0, r);\n  };\nvar mf = (\n  /** @class */\n  function() {\n    function e(t, n) {\n      n === void 0 && (n = {}), this.message = t, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!n.ignoreTag, this.locale = n.locale, this.requiresOtherClause = !!n.requiresOtherClause, this.shouldParseSkeletons = !!n.shouldParseSkeletons;\n    }\n    return e.prototype.parse = function() {\n      if (this.offset() !== 0)\n        throw Error(\"parser can only be used once\");\n      return this.parseMessage(0, \"\", !1);\n    }, e.prototype.parseMessage = function(t, n, r) {\n      for (var i = []; !this.isEOF(); ) {\n        var o = this.char();\n        if (o === 123) {\n          var l = this.parseArgument(t, r);\n          if (l.err)\n            return l;\n          i.push(l.val);\n        } else {\n          if (o === 125 && t > 0)\n            break;\n          if (o === 35 && (n === \"plural\" || n === \"selectordinal\")) {\n            var a = this.clonePosition();\n            this.bump(), i.push({\n              type: z.pound,\n              location: L(a, this.clonePosition())\n            });\n          } else if (o === 60 && !this.ignoreTag && this.peek() === 47) {\n            if (r)\n              break;\n            return this.error(I.UNMATCHED_CLOSING_TAG, L(this.clonePosition(), this.clonePosition()));\n          } else if (o === 60 && !this.ignoreTag && Ir(this.peek() || 0)) {\n            var l = this.parseTag(t, n);\n            if (l.err)\n              return l;\n            i.push(l.val);\n          } else {\n            var l = this.parseLiteral(t, n);\n            if (l.err)\n              return l;\n            i.push(l.val);\n          }\n        }\n      }\n      return { val: i, err: null };\n    }, e.prototype.parseTag = function(t, n) {\n      var r = this.clonePosition();\n      this.bump();\n      var i = this.parseTagName();\n      if (this.bumpSpace(), this.bumpIf(\"/>\"))\n        return {\n          val: {\n            type: z.literal,\n            value: \"<\".concat(i, \"/>\"),\n            location: L(r, this.clonePosition())\n          },\n          err: null\n        };\n      if (this.bumpIf(\">\")) {\n        var o = this.parseMessage(t + 1, n, !0);\n        if (o.err)\n          return o;\n        var l = o.val, a = this.clonePosition();\n        if (this.bumpIf(\"</\")) {\n          if (this.isEOF() || !Ir(this.char()))\n            return this.error(I.INVALID_TAG, L(a, this.clonePosition()));\n          var s = this.clonePosition(), u = this.parseTagName();\n          return i !== u ? this.error(I.UNMATCHED_CLOSING_TAG, L(s, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(\">\") ? {\n            val: {\n              type: z.tag,\n              value: i,\n              children: l,\n              location: L(r, this.clonePosition())\n            },\n            err: null\n          } : this.error(I.INVALID_TAG, L(a, this.clonePosition())));\n        } else\n          return this.error(I.UNCLOSED_TAG, L(r, this.clonePosition()));\n      } else\n        return this.error(I.INVALID_TAG, L(r, this.clonePosition()));\n    }, e.prototype.parseTagName = function() {\n      var t = this.offset();\n      for (this.bump(); !this.isEOF() && gf(this.char()); )\n        this.bump();\n      return this.message.slice(t, this.offset());\n    }, e.prototype.parseLiteral = function(t, n) {\n      for (var r = this.clonePosition(), i = \"\"; ; ) {\n        var o = this.tryParseQuote(n);\n        if (o) {\n          i += o;\n          continue;\n        }\n        var l = this.tryParseUnquoted(t, n);\n        if (l) {\n          i += l;\n          continue;\n        }\n        var a = this.tryParseLeftAngleBracket();\n        if (a) {\n          i += a;\n          continue;\n        }\n        break;\n      }\n      var s = L(r, this.clonePosition());\n      return {\n        val: { type: z.literal, value: i, location: s },\n        err: null\n      };\n    }, e.prototype.tryParseLeftAngleBracket = function() {\n      return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.\n      !pf(this.peek() || 0)) ? (this.bump(), \"<\") : null;\n    }, e.prototype.tryParseQuote = function(t) {\n      if (this.isEOF() || this.char() !== 39)\n        return null;\n      switch (this.peek()) {\n        case 39:\n          return this.bump(), this.bump(), \"'\";\n        case 123:\n        case 60:\n        case 62:\n        case 125:\n          break;\n        case 35:\n          if (t === \"plural\" || t === \"selectordinal\")\n            break;\n          return null;\n        default:\n          return null;\n      }\n      this.bump();\n      var n = [this.char()];\n      for (this.bump(); !this.isEOF(); ) {\n        var r = this.char();\n        if (r === 39)\n          if (this.peek() === 39)\n            n.push(39), this.bump();\n          else {\n            this.bump();\n            break;\n          }\n        else\n          n.push(r);\n        this.bump();\n      }\n      return Nr.apply(void 0, n);\n    }, e.prototype.tryParseUnquoted = function(t, n) {\n      if (this.isEOF())\n        return null;\n      var r = this.char();\n      return r === 60 || r === 123 || r === 35 && (n === \"plural\" || n === \"selectordinal\") || r === 125 && t > 0 ? null : (this.bump(), Nr(r));\n    }, e.prototype.parseArgument = function(t, n) {\n      var r = this.clonePosition();\n      if (this.bump(), this.bumpSpace(), this.isEOF())\n        return this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, L(r, this.clonePosition()));\n      if (this.char() === 125)\n        return this.bump(), this.error(I.EMPTY_ARGUMENT, L(r, this.clonePosition()));\n      var i = this.parseIdentifierIfPossible().value;\n      if (!i)\n        return this.error(I.MALFORMED_ARGUMENT, L(r, this.clonePosition()));\n      if (this.bumpSpace(), this.isEOF())\n        return this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, L(r, this.clonePosition()));\n      switch (this.char()) {\n        case 125:\n          return this.bump(), {\n            val: {\n              type: z.argument,\n              // value does not include the opening and closing braces.\n              value: i,\n              location: L(r, this.clonePosition())\n            },\n            err: null\n          };\n        case 44:\n          return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, L(r, this.clonePosition())) : this.parseArgumentOptions(t, n, i, r);\n        default:\n          return this.error(I.MALFORMED_ARGUMENT, L(r, this.clonePosition()));\n      }\n    }, e.prototype.parseIdentifierIfPossible = function() {\n      var t = this.clonePosition(), n = this.offset(), r = Pr(this.message, n), i = n + r.length;\n      this.bumpTo(i);\n      var o = this.clonePosition(), l = L(t, o);\n      return { value: r, location: l };\n    }, e.prototype.parseArgumentOptions = function(t, n, r, i) {\n      var o, l = this.clonePosition(), a = this.parseIdentifierIfPossible().value, s = this.clonePosition();\n      switch (a) {\n        case \"\":\n          return this.error(I.EXPECT_ARGUMENT_TYPE, L(l, s));\n        case \"number\":\n        case \"date\":\n        case \"time\": {\n          this.bumpSpace();\n          var u = null;\n          if (this.bumpIf(\",\")) {\n            this.bumpSpace();\n            var f = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible();\n            if (c.err)\n              return c;\n            var _ = df(c.val);\n            if (_.length === 0)\n              return this.error(I.EXPECT_ARGUMENT_STYLE, L(this.clonePosition(), this.clonePosition()));\n            var h = L(f, this.clonePosition());\n            u = { style: _, styleLocation: h };\n          }\n          var d = this.tryParseArgumentClose(i);\n          if (d.err)\n            return d;\n          var p = L(i, this.clonePosition());\n          if (u && Hi(u == null ? void 0 : u.style, \"::\", 0)) {\n            var w = hf(u.style.slice(2));\n            if (a === \"number\") {\n              var c = this.parseNumberSkeletonFromString(w, u.styleLocation);\n              return c.err ? c : {\n                val: { type: z.number, value: r, location: p, style: c.val },\n                err: null\n              };\n            } else {\n              if (w.length === 0)\n                return this.error(I.EXPECT_DATE_TIME_SKELETON, p);\n              var v = w;\n              this.locale && (v = $u(w, this.locale));\n              var _ = {\n                type: At.dateTime,\n                pattern: v,\n                location: u.styleLocation,\n                parsedOptions: this.shouldParseSkeletons ? Wu(v) : {}\n              }, E = a === \"date\" ? z.date : z.time;\n              return {\n                val: { type: E, value: r, location: p, style: _ },\n                err: null\n              };\n            }\n          }\n          return {\n            val: {\n              type: a === \"number\" ? z.number : a === \"date\" ? z.date : z.time,\n              value: r,\n              location: p,\n              style: (o = u == null ? void 0 : u.style) !== null && o !== void 0 ? o : null\n            },\n            err: null\n          };\n        }\n        case \"plural\":\n        case \"selectordinal\":\n        case \"select\": {\n          var b = this.clonePosition();\n          if (this.bumpSpace(), !this.bumpIf(\",\"))\n            return this.error(I.EXPECT_SELECT_ARGUMENT_OPTIONS, L(b, U({}, b)));\n          this.bumpSpace();\n          var S = this.parseIdentifierIfPossible(), H = 0;\n          if (a !== \"select\" && S.value === \"offset\") {\n            if (!this.bumpIf(\":\"))\n              return this.error(I.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, L(this.clonePosition(), this.clonePosition()));\n            this.bumpSpace();\n            var c = this.tryParseDecimalInteger(I.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, I.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n            if (c.err)\n              return c;\n            this.bumpSpace(), S = this.parseIdentifierIfPossible(), H = c.val;\n          }\n          var g = this.tryParsePluralOrSelectOptions(t, a, n, S);\n          if (g.err)\n            return g;\n          var d = this.tryParseArgumentClose(i);\n          if (d.err)\n            return d;\n          var Z = L(i, this.clonePosition());\n          return a === \"select\" ? {\n            val: {\n              type: z.select,\n              value: r,\n              options: Ni(g.val),\n              location: Z\n            },\n            err: null\n          } : {\n            val: {\n              type: z.plural,\n              value: r,\n              options: Ni(g.val),\n              offset: H,\n              pluralType: a === \"plural\" ? \"cardinal\" : \"ordinal\",\n              location: Z\n            },\n            err: null\n          };\n        }\n        default:\n          return this.error(I.INVALID_ARGUMENT_TYPE, L(l, s));\n      }\n    }, e.prototype.tryParseArgumentClose = function(t) {\n      return this.isEOF() || this.char() !== 125 ? this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, L(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });\n    }, e.prototype.parseSimpleArgStyleIfPossible = function() {\n      for (var t = 0, n = this.clonePosition(); !this.isEOF(); ) {\n        var r = this.char();\n        switch (r) {\n          case 39: {\n            this.bump();\n            var i = this.clonePosition();\n            if (!this.bumpUntil(\"'\"))\n              return this.error(I.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, L(i, this.clonePosition()));\n            this.bump();\n            break;\n          }\n          case 123: {\n            t += 1, this.bump();\n            break;\n          }\n          case 125: {\n            if (t > 0)\n              t -= 1;\n            else\n              return {\n                val: this.message.slice(n.offset, this.offset()),\n                err: null\n              };\n            break;\n          }\n          default:\n            this.bump();\n            break;\n        }\n      }\n      return {\n        val: this.message.slice(n.offset, this.offset()),\n        err: null\n      };\n    }, e.prototype.parseNumberSkeletonFromString = function(t, n) {\n      var r = [];\n      try {\n        r = xu(t);\n      } catch {\n        return this.error(I.INVALID_NUMBER_SKELETON, n);\n      }\n      return {\n        val: {\n          type: At.number,\n          tokens: r,\n          location: n,\n          parsedOptions: this.shouldParseSkeletons ? Ku(r) : {}\n        },\n        err: null\n      };\n    }, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r, i) {\n      for (var o, l = !1, a = [], s = /* @__PURE__ */ new Set(), u = i.value, f = i.location; ; ) {\n        if (u.length === 0) {\n          var c = this.clonePosition();\n          if (n !== \"select\" && this.bumpIf(\"=\")) {\n            var _ = this.tryParseDecimalInteger(I.EXPECT_PLURAL_ARGUMENT_SELECTOR, I.INVALID_PLURAL_ARGUMENT_SELECTOR);\n            if (_.err)\n              return _;\n            f = L(c, this.clonePosition()), u = this.message.slice(c.offset, this.offset());\n          } else\n            break;\n        }\n        if (s.has(u))\n          return this.error(n === \"select\" ? I.DUPLICATE_SELECT_ARGUMENT_SELECTOR : I.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f);\n        u === \"other\" && (l = !0), this.bumpSpace();\n        var h = this.clonePosition();\n        if (!this.bumpIf(\"{\"))\n          return this.error(n === \"select\" ? I.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : I.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, L(this.clonePosition(), this.clonePosition()));\n        var d = this.parseMessage(t + 1, n, r);\n        if (d.err)\n          return d;\n        var p = this.tryParseArgumentClose(h);\n        if (p.err)\n          return p;\n        a.push([\n          u,\n          {\n            value: d.val,\n            location: L(h, this.clonePosition())\n          }\n        ]), s.add(u), this.bumpSpace(), o = this.parseIdentifierIfPossible(), u = o.value, f = o.location;\n      }\n      return a.length === 0 ? this.error(n === \"select\" ? I.EXPECT_SELECT_ARGUMENT_SELECTOR : I.EXPECT_PLURAL_ARGUMENT_SELECTOR, L(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !l ? this.error(I.MISSING_OTHER_CLAUSE, L(this.clonePosition(), this.clonePosition())) : { val: a, err: null };\n    }, e.prototype.tryParseDecimalInteger = function(t, n) {\n      var r = 1, i = this.clonePosition();\n      this.bumpIf(\"+\") || this.bumpIf(\"-\") && (r = -1);\n      for (var o = !1, l = 0; !this.isEOF(); ) {\n        var a = this.char();\n        if (a >= 48 && a <= 57)\n          o = !0, l = l * 10 + (a - 48), this.bump();\n        else\n          break;\n      }\n      var s = L(i, this.clonePosition());\n      return o ? (l *= r, cf(l) ? { val: l, err: null } : this.error(n, s)) : this.error(t, s);\n    }, e.prototype.offset = function() {\n      return this.position.offset;\n    }, e.prototype.isEOF = function() {\n      return this.offset() === this.message.length;\n    }, e.prototype.clonePosition = function() {\n      return {\n        offset: this.position.offset,\n        line: this.position.line,\n        column: this.position.column\n      };\n    }, e.prototype.char = function() {\n      var t = this.position.offset;\n      if (t >= this.message.length)\n        throw Error(\"out of bound\");\n      var n = Wo(this.message, t);\n      if (n === void 0)\n        throw Error(\"Offset \".concat(t, \" is at invalid UTF-16 code unit boundary\"));\n      return n;\n    }, e.prototype.error = function(t, n) {\n      return {\n        val: null,\n        err: {\n          kind: t,\n          message: this.message,\n          location: n\n        }\n      };\n    }, e.prototype.bump = function() {\n      if (!this.isEOF()) {\n        var t = this.char();\n        t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);\n      }\n    }, e.prototype.bumpIf = function(t) {\n      if (Hi(this.message, t, this.offset())) {\n        for (var n = 0; n < t.length; n++)\n          this.bump();\n        return !0;\n      }\n      return !1;\n    }, e.prototype.bumpUntil = function(t) {\n      var n = this.offset(), r = this.message.indexOf(t, n);\n      return r >= 0 ? (this.bumpTo(r), !0) : (this.bumpTo(this.message.length), !1);\n    }, e.prototype.bumpTo = function(t) {\n      if (this.offset() > t)\n        throw Error(\"targetOffset \".concat(t, \" must be greater than or equal to the current offset \").concat(this.offset()));\n      for (t = Math.min(t, this.message.length); ; ) {\n        var n = this.offset();\n        if (n === t)\n          break;\n        if (n > t)\n          throw Error(\"targetOffset \".concat(t, \" is at invalid UTF-16 code unit boundary\"));\n        if (this.bump(), this.isEOF())\n          break;\n      }\n    }, e.prototype.bumpSpace = function() {\n      for (; !this.isEOF() && xo(this.char()); )\n        this.bump();\n    }, e.prototype.peek = function() {\n      if (this.isEOF())\n        return null;\n      var t = this.char(), n = this.offset(), r = this.message.charCodeAt(n + (t >= 65536 ? 2 : 1));\n      return r ?? null;\n    }, e;\n  }()\n);\nfunction Ir(e) {\n  return e >= 97 && e <= 122 || e >= 65 && e <= 90;\n}\nfunction pf(e) {\n  return Ir(e) || e === 47;\n}\nfunction gf(e) {\n  return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;\n}\nfunction xo(e) {\n  return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;\n}\nfunction bf(e) {\n  return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;\n}\nfunction Lr(e) {\n  e.forEach(function(t) {\n    if (delete t.location, Uo(t) || Fo(t))\n      for (var n in t.options)\n        delete t.options[n].location, Lr(t.options[n].value);\n    else\n      Do(t) && jo(t.style) || (Mo(t) || Ro(t)) && Cr(t.style) ? delete t.style.location : Go(t) && Lr(t.children);\n  });\n}\nfunction wf(e, t) {\n  t === void 0 && (t = {}), t = U({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);\n  var n = new mf(e, t).parse();\n  if (n.err) {\n    var r = SyntaxError(I[n.err.kind]);\n    throw r.location = n.err.location, r.originalMessage = n.err.message, r;\n  }\n  return t != null && t.captureLocation || Lr(n.val), n.val;\n}\nfunction sr(e, t) {\n  var n = t && t.cache ? t.cache : Tf, r = t && t.serializer ? t.serializer : kf, i = t && t.strategy ? t.strategy : yf;\n  return i(e, {\n    cache: n,\n    serializer: r\n  });\n}\nfunction vf(e) {\n  return e == null || typeof e == \"number\" || typeof e == \"boolean\";\n}\nfunction Jo(e, t, n, r) {\n  var i = vf(r) ? r : n(r), o = t.get(i);\n  return typeof o > \"u\" && (o = e.call(this, r), t.set(i, o)), o;\n}\nfunction Qo(e, t, n) {\n  var r = Array.prototype.slice.call(arguments, 3), i = n(r), o = t.get(i);\n  return typeof o > \"u\" && (o = e.apply(this, r), t.set(i, o)), o;\n}\nfunction qr(e, t, n, r, i) {\n  return n.bind(t, e, r, i);\n}\nfunction yf(e, t) {\n  var n = e.length === 1 ? Jo : Qo;\n  return qr(e, this, n, t.cache.create(), t.serializer);\n}\nfunction Ef(e, t) {\n  return qr(e, this, Qo, t.cache.create(), t.serializer);\n}\nfunction Sf(e, t) {\n  return qr(e, this, Jo, t.cache.create(), t.serializer);\n}\nvar kf = function() {\n  return JSON.stringify(arguments);\n};\nfunction zr() {\n  this.cache = /* @__PURE__ */ Object.create(null);\n}\nzr.prototype.get = function(e) {\n  return this.cache[e];\n};\nzr.prototype.set = function(e, t) {\n  this.cache[e] = t;\n};\nvar Tf = {\n  create: function() {\n    return new zr();\n  }\n}, ar = {\n  variadic: Ef,\n  monadic: Sf\n}, Bt;\n(function(e) {\n  e.MISSING_VALUE = \"MISSING_VALUE\", e.INVALID_VALUE = \"INVALID_VALUE\", e.MISSING_INTL_API = \"MISSING_INTL_API\";\n})(Bt || (Bt = {}));\nvar Nn = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r, i) {\n      var o = e.call(this, n) || this;\n      return o.code = r, o.originalMessage = i, o;\n    }\n    return t.prototype.toString = function() {\n      return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n    }, t;\n  }(Error)\n), Ii = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r, i, o) {\n      return e.call(this, 'Invalid values for \"'.concat(n, '\": \"').concat(r, '\". Options are \"').concat(Object.keys(i).join('\", \"'), '\"'), Bt.INVALID_VALUE, o) || this;\n    }\n    return t;\n  }(Nn)\n), Af = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r, i) {\n      return e.call(this, 'Value for \"'.concat(n, '\" must be of type ').concat(r), Bt.INVALID_VALUE, i) || this;\n    }\n    return t;\n  }(Nn)\n), Bf = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r) {\n      return e.call(this, 'The intl string context variable \"'.concat(n, '\" was not provided to the string \"').concat(r, '\"'), Bt.MISSING_VALUE, r) || this;\n    }\n    return t;\n  }(Nn)\n), te;\n(function(e) {\n  e[e.literal = 0] = \"literal\", e[e.object = 1] = \"object\";\n})(te || (te = {}));\nfunction Cf(e) {\n  return e.length < 2 ? e : e.reduce(function(t, n) {\n    var r = t[t.length - 1];\n    return !r || r.type !== te.literal || n.type !== te.literal ? t.push(n) : r.value += n.value, t;\n  }, []);\n}\nfunction Hf(e) {\n  return typeof e == \"function\";\n}\nfunction mn(e, t, n, r, i, o, l) {\n  if (e.length === 1 && Ti(e[0]))\n    return [\n      {\n        type: te.literal,\n        value: e[0].value\n      }\n    ];\n  for (var a = [], s = 0, u = e; s < u.length; s++) {\n    var f = u[s];\n    if (Ti(f)) {\n      a.push({\n        type: te.literal,\n        value: f.value\n      });\n      continue;\n    }\n    if (Vu(f)) {\n      typeof o == \"number\" && a.push({\n        type: te.literal,\n        value: n.getNumberFormat(t).format(o)\n      });\n      continue;\n    }\n    var c = f.value;\n    if (!(i && c in i))\n      throw new Bf(c, l);\n    var _ = i[c];\n    if (zu(f)) {\n      (!_ || typeof _ == \"string\" || typeof _ == \"number\") && (_ = typeof _ == \"string\" || typeof _ == \"number\" ? String(_) : \"\"), a.push({\n        type: typeof _ == \"string\" ? te.literal : te.object,\n        value: _\n      });\n      continue;\n    }\n    if (Mo(f)) {\n      var h = typeof f.style == \"string\" ? r.date[f.style] : Cr(f.style) ? f.style.parsedOptions : void 0;\n      a.push({\n        type: te.literal,\n        value: n.getDateTimeFormat(t, h).format(_)\n      });\n      continue;\n    }\n    if (Ro(f)) {\n      var h = typeof f.style == \"string\" ? r.time[f.style] : Cr(f.style) ? f.style.parsedOptions : r.time.medium;\n      a.push({\n        type: te.literal,\n        value: n.getDateTimeFormat(t, h).format(_)\n      });\n      continue;\n    }\n    if (Do(f)) {\n      var h = typeof f.style == \"string\" ? r.number[f.style] : jo(f.style) ? f.style.parsedOptions : void 0;\n      h && h.scale && (_ = _ * (h.scale || 1)), a.push({\n        type: te.literal,\n        value: n.getNumberFormat(t, h).format(_)\n      });\n      continue;\n    }\n    if (Go(f)) {\n      var d = f.children, p = f.value, w = i[p];\n      if (!Hf(w))\n        throw new Af(p, \"function\", l);\n      var v = mn(d, t, n, r, i, o), E = w(v.map(function(H) {\n        return H.value;\n      }));\n      Array.isArray(E) || (E = [E]), a.push.apply(a, E.map(function(H) {\n        return {\n          type: typeof H == \"string\" ? te.literal : te.object,\n          value: H\n        };\n      }));\n    }\n    if (Uo(f)) {\n      var b = f.options[_] || f.options.other;\n      if (!b)\n        throw new Ii(f.value, _, Object.keys(f.options), l);\n      a.push.apply(a, mn(b.value, t, n, r, i));\n      continue;\n    }\n    if (Fo(f)) {\n      var b = f.options[\"=\".concat(_)];\n      if (!b) {\n        if (!Intl.PluralRules)\n          throw new Nn(`Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n`, Bt.MISSING_INTL_API, l);\n        var S = n.getPluralRules(t, { type: f.pluralType }).select(_ - (f.offset || 0));\n        b = f.options[S] || f.options.other;\n      }\n      if (!b)\n        throw new Ii(f.value, _, Object.keys(f.options), l);\n      a.push.apply(a, mn(b.value, t, n, r, i, _ - (f.offset || 0)));\n      continue;\n    }\n  }\n  return Cf(a);\n}\nfunction Nf(e, t) {\n  return t ? U(U(U({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) {\n    return n[r] = U(U({}, e[r]), t[r] || {}), n;\n  }, {})) : e;\n}\nfunction Pf(e, t) {\n  return t ? Object.keys(e).reduce(function(n, r) {\n    return n[r] = Nf(e[r], t[r]), n;\n  }, U({}, e)) : e;\n}\nfunction ur(e) {\n  return {\n    create: function() {\n      return {\n        get: function(t) {\n          return e[t];\n        },\n        set: function(t, n) {\n          e[t] = n;\n        }\n      };\n    }\n  };\n}\nfunction If(e) {\n  return e === void 0 && (e = {\n    number: {},\n    dateTime: {},\n    pluralRules: {}\n  }), {\n    getNumberFormat: sr(function() {\n      for (var t, n = [], r = 0; r < arguments.length; r++)\n        n[r] = arguments[r];\n      return new ((t = Intl.NumberFormat).bind.apply(t, or([void 0], n, !1)))();\n    }, {\n      cache: ur(e.number),\n      strategy: ar.variadic\n    }),\n    getDateTimeFormat: sr(function() {\n      for (var t, n = [], r = 0; r < arguments.length; r++)\n        n[r] = arguments[r];\n      return new ((t = Intl.DateTimeFormat).bind.apply(t, or([void 0], n, !1)))();\n    }, {\n      cache: ur(e.dateTime),\n      strategy: ar.variadic\n    }),\n    getPluralRules: sr(function() {\n      for (var t, n = [], r = 0; r < arguments.length; r++)\n        n[r] = arguments[r];\n      return new ((t = Intl.PluralRules).bind.apply(t, or([void 0], n, !1)))();\n    }, {\n      cache: ur(e.pluralRules),\n      strategy: ar.variadic\n    })\n  };\n}\nvar Lf = (\n  /** @class */\n  function() {\n    function e(t, n, r, i) {\n      var o = this;\n      if (n === void 0 && (n = e.defaultLocale), this.formatterCache = {\n        number: {},\n        dateTime: {},\n        pluralRules: {}\n      }, this.format = function(l) {\n        var a = o.formatToParts(l);\n        if (a.length === 1)\n          return a[0].value;\n        var s = a.reduce(function(u, f) {\n          return !u.length || f.type !== te.literal || typeof u[u.length - 1] != \"string\" ? u.push(f.value) : u[u.length - 1] += f.value, u;\n        }, []);\n        return s.length <= 1 ? s[0] || \"\" : s;\n      }, this.formatToParts = function(l) {\n        return mn(o.ast, o.locales, o.formatters, o.formats, l, void 0, o.message);\n      }, this.resolvedOptions = function() {\n        return {\n          locale: o.resolvedLocale.toString()\n        };\n      }, this.getAst = function() {\n        return o.ast;\n      }, this.locales = n, this.resolvedLocale = e.resolveLocale(n), typeof t == \"string\") {\n        if (this.message = t, !e.__parse)\n          throw new TypeError(\"IntlMessageFormat.__parse must be set to process `message` of type `string`\");\n        this.ast = e.__parse(t, {\n          ignoreTag: i == null ? void 0 : i.ignoreTag,\n          locale: this.resolvedLocale\n        });\n      } else\n        this.ast = t;\n      if (!Array.isArray(this.ast))\n        throw new TypeError(\"A message must be provided as a String or AST.\");\n      this.formats = Pf(e.formats, r), this.formatters = i && i.formatters || If(this.formatterCache);\n    }\n    return Object.defineProperty(e, \"defaultLocale\", {\n      get: function() {\n        return e.memoizedDefaultLocale || (e.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), e.memoizedDefaultLocale;\n      },\n      enumerable: !1,\n      configurable: !0\n    }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) {\n      var n = Intl.NumberFormat.supportedLocalesOf(t);\n      return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == \"string\" ? t : t[0]);\n    }, e.__parse = wf, e.formats = {\n      number: {\n        integer: {\n          maximumFractionDigits: 0\n        },\n        currency: {\n          style: \"currency\"\n        },\n        percent: {\n          style: \"percent\"\n        }\n      },\n      date: {\n        short: {\n          month: \"numeric\",\n          day: \"numeric\",\n          year: \"2-digit\"\n        },\n        medium: {\n          month: \"short\",\n          day: \"numeric\",\n          year: \"numeric\"\n        },\n        long: {\n          month: \"long\",\n          day: \"numeric\",\n          year: \"numeric\"\n        },\n        full: {\n          weekday: \"long\",\n          month: \"long\",\n          day: \"numeric\",\n          year: \"numeric\"\n        }\n      },\n      time: {\n        short: {\n          hour: \"numeric\",\n          minute: \"numeric\"\n        },\n        medium: {\n          hour: \"numeric\",\n          minute: \"numeric\",\n          second: \"numeric\"\n        },\n        long: {\n          hour: \"numeric\",\n          minute: \"numeric\",\n          second: \"numeric\",\n          timeZoneName: \"short\"\n        },\n        full: {\n          hour: \"numeric\",\n          minute: \"numeric\",\n          second: \"numeric\",\n          timeZoneName: \"short\"\n        }\n      }\n    }, e;\n  }()\n);\nfunction Of(e, t) {\n  if (t == null)\n    return;\n  if (t in e)\n    return e[t];\n  const n = t.split(\".\");\n  let r = e;\n  for (let i = 0; i < n.length; i++)\n    if (typeof r == \"object\") {\n      if (i > 0) {\n        const o = n.slice(i, n.length).join(\".\");\n        if (o in r) {\n          r = r[o];\n          break;\n        }\n      }\n      r = r[n[i]];\n    } else\n      r = void 0;\n  return r;\n}\nconst Ve = {}, Df = (e, t, n) => n && (t in Ve || (Ve[t] = {}), e in Ve[t] || (Ve[t][e] = n), n), Yo = (e, t) => {\n  if (t == null)\n    return;\n  if (t in Ve && e in Ve[t])\n    return Ve[t][e];\n  const n = Pn(t);\n  for (let r = 0; r < n.length; r++) {\n    const i = n[r], o = Rf(i, e);\n    if (o)\n      return Df(e, t, o);\n  }\n};\nlet Vr;\nconst Kt = Yt({});\nfunction Mf(e) {\n  return Vr[e] || null;\n}\nfunction Ko(e) {\n  return e in Vr;\n}\nfunction Rf(e, t) {\n  if (!Ko(e))\n    return null;\n  const n = Mf(e);\n  return Of(n, t);\n}\nfunction Uf(e) {\n  if (e == null)\n    return;\n  const t = Pn(e);\n  for (let n = 0; n < t.length; n++) {\n    const r = t[n];\n    if (Ko(r))\n      return r;\n  }\n}\nfunction Ff(e, ...t) {\n  delete Ve[e], Kt.update((n) => (n[e] = qu.all([n[e] || {}, ...t]), n));\n}\nIt(\n  [Kt],\n  ([e]) => Object.keys(e)\n);\nKt.subscribe((e) => Vr = e);\nconst pn = {};\nfunction Gf(e, t) {\n  pn[e].delete(t), pn[e].size === 0 && delete pn[e];\n}\nfunction $o(e) {\n  return pn[e];\n}\nfunction jf(e) {\n  return Pn(e).map((t) => {\n    const n = $o(t);\n    return [t, n ? [...n] : []];\n  }).filter(([, t]) => t.length > 0);\n}\nfunction Or(e) {\n  return e == null ? !1 : Pn(e).some(\n    (t) => {\n      var n;\n      return (n = $o(t)) == null ? void 0 : n.size;\n    }\n  );\n}\nfunction qf(e, t) {\n  return Promise.all(\n    t.map((r) => (Gf(e, r), r().then((i) => i.default || i)))\n  ).then((r) => Ff(e, ...r));\n}\nconst Mt = {};\nfunction el(e) {\n  if (!Or(e))\n    return e in Mt ? Mt[e] : Promise.resolve();\n  const t = jf(e);\n  return Mt[e] = Promise.all(\n    t.map(\n      ([n, r]) => qf(n, r)\n    )\n  ).then(() => {\n    if (Or(e))\n      return el(e);\n    delete Mt[e];\n  }), Mt[e];\n}\nconst zf = {\n  number: {\n    scientific: { notation: \"scientific\" },\n    engineering: { notation: \"engineering\" },\n    compactLong: { notation: \"compact\", compactDisplay: \"long\" },\n    compactShort: { notation: \"compact\", compactDisplay: \"short\" }\n  },\n  date: {\n    short: { month: \"numeric\", day: \"numeric\", year: \"2-digit\" },\n    medium: { month: \"short\", day: \"numeric\", year: \"numeric\" },\n    long: { month: \"long\", day: \"numeric\", year: \"numeric\" },\n    full: { weekday: \"long\", month: \"long\", day: \"numeric\", year: \"numeric\" }\n  },\n  time: {\n    short: { hour: \"numeric\", minute: \"numeric\" },\n    medium: { hour: \"numeric\", minute: \"numeric\", second: \"numeric\" },\n    long: {\n      hour: \"numeric\",\n      minute: \"numeric\",\n      second: \"numeric\",\n      timeZoneName: \"short\"\n    },\n    full: {\n      hour: \"numeric\",\n      minute: \"numeric\",\n      second: \"numeric\",\n      timeZoneName: \"short\"\n    }\n  }\n}, Vf = {\n  fallbackLocale: null,\n  loadingDelay: 200,\n  formats: zf,\n  warnOnMissingMessages: !0,\n  handleMissingMessage: void 0,\n  ignoreTag: !0\n}, Xf = Vf;\nfunction Ct() {\n  return Xf;\n}\nconst fr = Yt(!1);\nvar Wf = Object.defineProperty, Zf = Object.defineProperties, xf = Object.getOwnPropertyDescriptors, Li = Object.getOwnPropertySymbols, Jf = Object.prototype.hasOwnProperty, Qf = Object.prototype.propertyIsEnumerable, Oi = (e, t, n) => t in e ? Wf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Yf = (e, t) => {\n  for (var n in t || (t = {}))\n    Jf.call(t, n) && Oi(e, n, t[n]);\n  if (Li)\n    for (var n of Li(t))\n      Qf.call(t, n) && Oi(e, n, t[n]);\n  return e;\n}, Kf = (e, t) => Zf(e, xf(t));\nlet Dr;\nconst yn = Yt(null);\nfunction Di(e) {\n  return e.split(\"-\").map((t, n, r) => r.slice(0, n + 1).join(\"-\")).reverse();\n}\nfunction Pn(e, t = Ct().fallbackLocale) {\n  const n = Di(e);\n  return t ? [.../* @__PURE__ */ new Set([...n, ...Di(t)])] : n;\n}\nfunction mt() {\n  return Dr ?? void 0;\n}\nyn.subscribe((e) => {\n  Dr = e ?? void 0, typeof window < \"u\" && e != null && document.documentElement.setAttribute(\"lang\", e);\n});\nconst $f = (e) => {\n  if (e && Uf(e) && Or(e)) {\n    const { loadingDelay: t } = Ct();\n    let n;\n    return typeof window < \"u\" && mt() != null && t ? n = window.setTimeout(\n      () => fr.set(!0),\n      t\n    ) : fr.set(!0), el(e).then(() => {\n      yn.set(e);\n    }).finally(() => {\n      clearTimeout(n), fr.set(!1);\n    });\n  }\n  return yn.set(e);\n}, $t = Kf(Yf({}, yn), {\n  set: $f\n}), In = (e) => {\n  const t = /* @__PURE__ */ Object.create(null);\n  return (r) => {\n    const i = JSON.stringify(r);\n    return i in t ? t[i] : t[i] = e(r);\n  };\n};\nvar ec = Object.defineProperty, En = Object.getOwnPropertySymbols, tl = Object.prototype.hasOwnProperty, nl = Object.prototype.propertyIsEnumerable, Mi = (e, t, n) => t in e ? ec(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Xr = (e, t) => {\n  for (var n in t || (t = {}))\n    tl.call(t, n) && Mi(e, n, t[n]);\n  if (En)\n    for (var n of En(t))\n      nl.call(t, n) && Mi(e, n, t[n]);\n  return e;\n}, Lt = (e, t) => {\n  var n = {};\n  for (var r in e)\n    tl.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);\n  if (e != null && En)\n    for (var r of En(e))\n      t.indexOf(r) < 0 && nl.call(e, r) && (n[r] = e[r]);\n  return n;\n};\nconst Wt = (e, t) => {\n  const { formats: n } = Ct();\n  if (e in n && t in n[e])\n    return n[e][t];\n  throw new Error(`[svelte-i18n] Unknown \"${t}\" ${e} format.`);\n}, tc = In(\n  (e) => {\n    var t = e, { locale: n, format: r } = t, i = Lt(t, [\"locale\", \"format\"]);\n    if (n == null)\n      throw new Error('[svelte-i18n] A \"locale\" must be set to format numbers');\n    return r && (i = Wt(\"number\", r)), new Intl.NumberFormat(n, i);\n  }\n), nc = In(\n  (e) => {\n    var t = e, { locale: n, format: r } = t, i = Lt(t, [\"locale\", \"format\"]);\n    if (n == null)\n      throw new Error('[svelte-i18n] A \"locale\" must be set to format dates');\n    return r ? i = Wt(\"date\", r) : Object.keys(i).length === 0 && (i = Wt(\"date\", \"short\")), new Intl.DateTimeFormat(n, i);\n  }\n), rc = In(\n  (e) => {\n    var t = e, { locale: n, format: r } = t, i = Lt(t, [\"locale\", \"format\"]);\n    if (n == null)\n      throw new Error(\n        '[svelte-i18n] A \"locale\" must be set to format time values'\n      );\n    return r ? i = Wt(\"time\", r) : Object.keys(i).length === 0 && (i = Wt(\"time\", \"short\")), new Intl.DateTimeFormat(n, i);\n  }\n), ic = (e = {}) => {\n  var t = e, {\n    locale: n = mt()\n  } = t, r = Lt(t, [\n    \"locale\"\n  ]);\n  return tc(Xr({ locale: n }, r));\n}, oc = (e = {}) => {\n  var t = e, {\n    locale: n = mt()\n  } = t, r = Lt(t, [\n    \"locale\"\n  ]);\n  return nc(Xr({ locale: n }, r));\n}, lc = (e = {}) => {\n  var t = e, {\n    locale: n = mt()\n  } = t, r = Lt(t, [\n    \"locale\"\n  ]);\n  return rc(Xr({ locale: n }, r));\n}, sc = In(\n  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n  (e, t = mt()) => new Lf(e, t, Ct().formats, {\n    ignoreTag: Ct().ignoreTag\n  })\n), ac = (e, t = {}) => {\n  var n, r, i, o;\n  let l = t;\n  typeof e == \"object\" && (l = e, e = l.id);\n  const {\n    values: a,\n    locale: s = mt(),\n    default: u\n  } = l;\n  if (s == null)\n    throw new Error(\n      \"[svelte-i18n] Cannot format a message without first setting the initial locale.\"\n    );\n  let f = Yo(e, s);\n  if (!f)\n    f = (o = (i = (r = (n = Ct()).handleMissingMessage) == null ? void 0 : r.call(n, { locale: s, id: e, defaultValue: u })) != null ? i : u) != null ? o : e;\n  else if (typeof f != \"string\")\n    return console.warn(\n      `[svelte-i18n] Message with id \"${e}\" must be of type \"string\", found: \"${typeof f}\". Gettin its value through the \"$format\" method is deprecated; use the \"json\" method instead.`\n    ), f;\n  if (!a)\n    return f;\n  let c = f;\n  try {\n    c = sc(f, s).format(a);\n  } catch (_) {\n    _ instanceof Error && console.warn(\n      `[svelte-i18n] Message \"${e}\" has syntax error:`,\n      _.message\n    );\n  }\n  return c;\n}, uc = (e, t) => lc(t).format(e), fc = (e, t) => oc(t).format(e), cc = (e, t) => ic(t).format(e), _c = (e, t = mt()) => Yo(e, t);\nIt([$t, Kt], () => ac);\nIt([$t], () => uc);\nIt([$t], () => fc);\nIt([$t], () => cc);\nIt([$t, Kt], () => _c);\nconst {\n  SvelteComponent: hc,\n  append: le,\n  attr: tt,\n  detach: rl,\n  element: nt,\n  init: dc,\n  insert: il,\n  noop: Ri,\n  safe_not_equal: mc,\n  set_data: Sn,\n  set_style: cr,\n  space: Mr,\n  text: Et,\n  toggle_class: Ui\n} = window.__gradio__svelte__internal, { onMount: pc, createEventDispatcher: gc, getContext: bc } = window.__gradio__svelte__internal;\nfunction Fi(e) {\n  let t, n, r, i, o = Ut(\n    /*file_to_display*/\n    e[2]\n  ) + \"\", l, a, s, u, f = (\n    /*file_to_display*/\n    e[2].orig_name + \"\"\n  ), c;\n  return {\n    c() {\n      t = nt(\"div\"), n = nt(\"span\"), r = nt(\"div\"), i = nt(\"progress\"), l = Et(o), s = Mr(), u = nt(\"span\"), c = Et(f), cr(i, \"visibility\", \"hidden\"), cr(i, \"height\", \"0\"), cr(i, \"width\", \"0\"), i.value = a = Ut(\n        /*file_to_display*/\n        e[2]\n      ), tt(i, \"max\", \"100\"), tt(i, \"class\", \"svelte-cr2edf\"), tt(r, \"class\", \"progress-bar svelte-cr2edf\"), tt(u, \"class\", \"file-name svelte-cr2edf\"), tt(t, \"class\", \"file svelte-cr2edf\");\n    },\n    m(_, h) {\n      il(_, t, h), le(t, n), le(n, r), le(r, i), le(i, l), le(t, s), le(t, u), le(u, c);\n    },\n    p(_, h) {\n      h & /*file_to_display*/\n      4 && o !== (o = Ut(\n        /*file_to_display*/\n        _[2]\n      ) + \"\") && Sn(l, o), h & /*file_to_display*/\n      4 && a !== (a = Ut(\n        /*file_to_display*/\n        _[2]\n      )) && (i.value = a), h & /*file_to_display*/\n      4 && f !== (f = /*file_to_display*/\n      _[2].orig_name + \"\") && Sn(c, f);\n    },\n    d(_) {\n      _ && rl(t);\n    }\n  };\n}\nfunction wc(e) {\n  let t, n, r, i = (\n    /*files_with_progress*/\n    e[0].length + \"\"\n  ), o, l, a = (\n    /*files_with_progress*/\n    e[0].length > 1 ? \"files\" : \"file\"\n  ), s, u, f, c = (\n    /*file_to_display*/\n    e[2] && Fi(e)\n  );\n  return {\n    c() {\n      t = nt(\"div\"), n = nt(\"span\"), r = Et(\"Uploading \"), o = Et(i), l = Mr(), s = Et(a), u = Et(\"...\"), f = Mr(), c && c.c(), tt(n, \"class\", \"uploading svelte-cr2edf\"), tt(t, \"class\", \"wrap svelte-cr2edf\"), Ui(\n        t,\n        \"progress\",\n        /*progress*/\n        e[1]\n      );\n    },\n    m(_, h) {\n      il(_, t, h), le(t, n), le(n, r), le(n, o), le(n, l), le(n, s), le(n, u), le(t, f), c && c.m(t, null);\n    },\n    p(_, [h]) {\n      h & /*files_with_progress*/\n      1 && i !== (i = /*files_with_progress*/\n      _[0].length + \"\") && Sn(o, i), h & /*files_with_progress*/\n      1 && a !== (a = /*files_with_progress*/\n      _[0].length > 1 ? \"files\" : \"file\") && Sn(s, a), /*file_to_display*/\n      _[2] ? c ? c.p(_, h) : (c = Fi(_), c.c(), c.m(t, null)) : c && (c.d(1), c = null), h & /*progress*/\n      2 && Ui(\n        t,\n        \"progress\",\n        /*progress*/\n        _[1]\n      );\n    },\n    i: Ri,\n    o: Ri,\n    d(_) {\n      _ && rl(t), c && c.d();\n    }\n  };\n}\nfunction Ut(e) {\n  return e.progress * 100 / (e.size || 0) || 0;\n}\nfunction vc(e) {\n  let t = 0;\n  return e.forEach((n) => {\n    t += Ut(n);\n  }), document.documentElement.style.setProperty(\"--upload-progress-width\", (t / e.length).toFixed(2) + \"%\"), t / e.length;\n}\nfunction yc(e, t, n) {\n  let { upload_id: r } = t, { root: i } = t, { files: o } = t, l, a = !1, s, u, f = o.map((d) => ({ ...d, progress: 0 }));\n  const c = gc();\n  function _(d, p) {\n    n(0, f = f.map((w) => (w.orig_name === d && (w.progress += p), w)));\n  }\n  const h = bc(\"EventSource_factory\");\n  return pc(() => {\n    l = h(new URL(`${i}/upload_progress?upload_id=${r}`)), l.onmessage = async function(d) {\n      const p = JSON.parse(d.data);\n      a || n(1, a = !0), p.msg === \"done\" ? (l.close(), c(\"done\")) : (n(6, s = p), _(p.orig_name, p.chunk_size));\n    };\n  }), e.$$set = (d) => {\n    \"upload_id\" in d && n(3, r = d.upload_id), \"root\" in d && n(4, i = d.root), \"files\" in d && n(5, o = d.files);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*files_with_progress*/\n    1 && vc(f), e.$$.dirty & /*current_file_upload, files_with_progress*/\n    65 && n(2, u = s || f[0]);\n  }, [\n    f,\n    a,\n    u,\n    r,\n    i,\n    o,\n    s\n  ];\n}\nclass Ec extends hc {\n  constructor(t) {\n    super(), dc(this, t, yc, wc, mc, { upload_id: 3, root: 4, files: 5 });\n  }\n}\nconst {\n  SvelteComponent: Sc,\n  append: Gi,\n  attr: $,\n  binding_callbacks: kc,\n  bubble: Ke,\n  check_outros: ol,\n  create_component: Tc,\n  create_slot: ll,\n  destroy_component: Ac,\n  detach: Ln,\n  element: Rr,\n  empty: sl,\n  get_all_dirty_from_scope: al,\n  get_slot_changes: ul,\n  group_outros: fl,\n  init: Bc,\n  insert: On,\n  listen: de,\n  mount_component: Cc,\n  prevent_default: $e,\n  run_all: Hc,\n  safe_not_equal: Nc,\n  set_style: cl,\n  space: Pc,\n  stop_propagation: et,\n  toggle_class: ee,\n  transition_in: We,\n  transition_out: ut,\n  update_slot_base: _l\n} = window.__gradio__svelte__internal, { createEventDispatcher: Ic, tick: Lc, getContext: Oc } = window.__gradio__svelte__internal;\nfunction Dc(e) {\n  let t, n, r, i, o, l, a, s, u, f;\n  const c = (\n    /*#slots*/\n    e[22].default\n  ), _ = ll(\n    c,\n    e,\n    /*$$scope*/\n    e[21],\n    null\n  );\n  return {\n    c() {\n      t = Rr(\"button\"), _ && _.c(), n = Pc(), r = Rr(\"input\"), $(r, \"aria-label\", \"file upload\"), $(r, \"data-testid\", \"file-upload\"), $(r, \"type\", \"file\"), $(\n        r,\n        \"accept\",\n        /*accept_file_types*/\n        e[12]\n      ), r.multiple = i = /*file_count*/\n      e[5] === \"multiple\" || void 0, $(r, \"webkitdirectory\", o = /*file_count*/\n      e[5] === \"directory\" || void 0), $(r, \"mozdirectory\", l = /*file_count*/\n      e[5] === \"directory\" || void 0), $(r, \"class\", \"svelte-1aq8tno\"), $(t, \"tabindex\", a = /*hidden*/\n      e[7] ? -1 : 0), $(t, \"class\", \"svelte-1aq8tno\"), ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        e[7]\n      ), ee(\n        t,\n        \"center\",\n        /*center*/\n        e[3]\n      ), ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        e[2]\n      ), ee(\n        t,\n        \"flex\",\n        /*flex*/\n        e[4]\n      ), cl(t, \"height\", \"100%\");\n    },\n    m(h, d) {\n      On(h, t, d), _ && _.m(t, null), Gi(t, n), Gi(t, r), e[30](r), s = !0, u || (f = [\n        de(\n          r,\n          \"change\",\n          /*load_files_from_upload*/\n          e[15]\n        ),\n        de(t, \"drag\", et($e(\n          /*drag_handler*/\n          e[23]\n        ))),\n        de(t, \"dragstart\", et($e(\n          /*dragstart_handler*/\n          e[24]\n        ))),\n        de(t, \"dragend\", et($e(\n          /*dragend_handler*/\n          e[25]\n        ))),\n        de(t, \"dragover\", et($e(\n          /*dragover_handler*/\n          e[26]\n        ))),\n        de(t, \"dragenter\", et($e(\n          /*dragenter_handler*/\n          e[27]\n        ))),\n        de(t, \"dragleave\", et($e(\n          /*dragleave_handler*/\n          e[28]\n        ))),\n        de(t, \"drop\", et($e(\n          /*drop_handler*/\n          e[29]\n        ))),\n        de(\n          t,\n          \"click\",\n          /*open_file_upload*/\n          e[9]\n        ),\n        de(\n          t,\n          \"drop\",\n          /*loadFilesFromDrop*/\n          e[16]\n        ),\n        de(\n          t,\n          \"dragenter\",\n          /*updateDragging*/\n          e[14]\n        ),\n        de(\n          t,\n          \"dragleave\",\n          /*updateDragging*/\n          e[14]\n        )\n      ], u = !0);\n    },\n    p(h, d) {\n      _ && _.p && (!s || d[0] & /*$$scope*/\n      2097152) && _l(\n        _,\n        c,\n        h,\n        /*$$scope*/\n        h[21],\n        s ? ul(\n          c,\n          /*$$scope*/\n          h[21],\n          d,\n          null\n        ) : al(\n          /*$$scope*/\n          h[21]\n        ),\n        null\n      ), (!s || d[0] & /*accept_file_types*/\n      4096) && $(\n        r,\n        \"accept\",\n        /*accept_file_types*/\n        h[12]\n      ), (!s || d[0] & /*file_count*/\n      32 && i !== (i = /*file_count*/\n      h[5] === \"multiple\" || void 0)) && (r.multiple = i), (!s || d[0] & /*file_count*/\n      32 && o !== (o = /*file_count*/\n      h[5] === \"directory\" || void 0)) && $(r, \"webkitdirectory\", o), (!s || d[0] & /*file_count*/\n      32 && l !== (l = /*file_count*/\n      h[5] === \"directory\" || void 0)) && $(r, \"mozdirectory\", l), (!s || d[0] & /*hidden*/\n      128 && a !== (a = /*hidden*/\n      h[7] ? -1 : 0)) && $(t, \"tabindex\", a), (!s || d[0] & /*hidden*/\n      128) && ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        h[7]\n      ), (!s || d[0] & /*center*/\n      8) && ee(\n        t,\n        \"center\",\n        /*center*/\n        h[3]\n      ), (!s || d[0] & /*boundedheight*/\n      4) && ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        h[2]\n      ), (!s || d[0] & /*flex*/\n      16) && ee(\n        t,\n        \"flex\",\n        /*flex*/\n        h[4]\n      );\n    },\n    i(h) {\n      s || (We(_, h), s = !0);\n    },\n    o(h) {\n      ut(_, h), s = !1;\n    },\n    d(h) {\n      h && Ln(t), _ && _.d(h), e[30](null), u = !1, Hc(f);\n    }\n  };\n}\nfunction Mc(e) {\n  let t, n, r = !/*hidden*/\n  e[7] && ji(e);\n  return {\n    c() {\n      r && r.c(), t = sl();\n    },\n    m(i, o) {\n      r && r.m(i, o), On(i, t, o), n = !0;\n    },\n    p(i, o) {\n      /*hidden*/\n      i[7] ? r && (fl(), ut(r, 1, 1, () => {\n        r = null;\n      }), ol()) : r ? (r.p(i, o), o[0] & /*hidden*/\n      128 && We(r, 1)) : (r = ji(i), r.c(), We(r, 1), r.m(t.parentNode, t));\n    },\n    i(i) {\n      n || (We(r), n = !0);\n    },\n    o(i) {\n      ut(r), n = !1;\n    },\n    d(i) {\n      i && Ln(t), r && r.d(i);\n    }\n  };\n}\nfunction Rc(e) {\n  let t, n, r, i, o;\n  const l = (\n    /*#slots*/\n    e[22].default\n  ), a = ll(\n    l,\n    e,\n    /*$$scope*/\n    e[21],\n    null\n  );\n  return {\n    c() {\n      t = Rr(\"button\"), a && a.c(), $(t, \"tabindex\", n = /*hidden*/\n      e[7] ? -1 : 0), $(t, \"class\", \"svelte-1aq8tno\"), ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        e[7]\n      ), ee(\n        t,\n        \"center\",\n        /*center*/\n        e[3]\n      ), ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        e[2]\n      ), ee(\n        t,\n        \"flex\",\n        /*flex*/\n        e[4]\n      ), cl(t, \"height\", \"100%\");\n    },\n    m(s, u) {\n      On(s, t, u), a && a.m(t, null), r = !0, i || (o = de(\n        t,\n        \"click\",\n        /*paste_clipboard*/\n        e[8]\n      ), i = !0);\n    },\n    p(s, u) {\n      a && a.p && (!r || u[0] & /*$$scope*/\n      2097152) && _l(\n        a,\n        l,\n        s,\n        /*$$scope*/\n        s[21],\n        r ? ul(\n          l,\n          /*$$scope*/\n          s[21],\n          u,\n          null\n        ) : al(\n          /*$$scope*/\n          s[21]\n        ),\n        null\n      ), (!r || u[0] & /*hidden*/\n      128 && n !== (n = /*hidden*/\n      s[7] ? -1 : 0)) && $(t, \"tabindex\", n), (!r || u[0] & /*hidden*/\n      128) && ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        s[7]\n      ), (!r || u[0] & /*center*/\n      8) && ee(\n        t,\n        \"center\",\n        /*center*/\n        s[3]\n      ), (!r || u[0] & /*boundedheight*/\n      4) && ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        s[2]\n      ), (!r || u[0] & /*flex*/\n      16) && ee(\n        t,\n        \"flex\",\n        /*flex*/\n        s[4]\n      );\n    },\n    i(s) {\n      r || (We(a, s), r = !0);\n    },\n    o(s) {\n      ut(a, s), r = !1;\n    },\n    d(s) {\n      s && Ln(t), a && a.d(s), i = !1, o();\n    }\n  };\n}\nfunction ji(e) {\n  let t, n;\n  return t = new Ec({\n    props: {\n      root: (\n        /*root*/\n        e[6]\n      ),\n      upload_id: (\n        /*upload_id*/\n        e[10]\n      ),\n      files: (\n        /*file_data*/\n        e[11]\n      )\n    }\n  }), {\n    c() {\n      Tc(t.$$.fragment);\n    },\n    m(r, i) {\n      Cc(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i[0] & /*root*/\n      64 && (o.root = /*root*/\n      r[6]), i[0] & /*upload_id*/\n      1024 && (o.upload_id = /*upload_id*/\n      r[10]), i[0] & /*file_data*/\n      2048 && (o.files = /*file_data*/\n      r[11]), t.$set(o);\n    },\n    i(r) {\n      n || (We(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ut(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Ac(t, r);\n    }\n  };\n}\nfunction Uc(e) {\n  let t, n, r, i;\n  const o = [Rc, Mc, Dc], l = [];\n  function a(s, u) {\n    return (\n      /*filetype*/\n      s[0] === \"clipboard\" ? 0 : (\n        /*uploading*/\n        s[1] ? 1 : 2\n      )\n    );\n  }\n  return t = a(e), n = l[t] = o[t](e), {\n    c() {\n      n.c(), r = sl();\n    },\n    m(s, u) {\n      l[t].m(s, u), On(s, r, u), i = !0;\n    },\n    p(s, u) {\n      let f = t;\n      t = a(s), t === f ? l[t].p(s, u) : (fl(), ut(l[f], 1, 1, () => {\n        l[f] = null;\n      }), ol(), n = l[t], n ? n.p(s, u) : (n = l[t] = o[t](s), n.c()), We(n, 1), n.m(r.parentNode, r));\n    },\n    i(s) {\n      i || (We(n), i = !0);\n    },\n    o(s) {\n      ut(n), i = !1;\n    },\n    d(s) {\n      s && Ln(r), l[t].d(s);\n    }\n  };\n}\nfunction qi(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nfunction Fc(e, t, n) {\n  if (!e || e === \"*\" || e === \"file/*\" || Array.isArray(e) && e.some((i) => i === \"*\" || i === \"file/*\"))\n    return !0;\n  let r;\n  if (typeof e == \"string\")\n    r = e.split(\",\").map((i) => i.trim());\n  else if (Array.isArray(e))\n    r = e;\n  else\n    return !1;\n  return r.includes(t) || r.some((i) => {\n    const [o] = i.split(\"/\").map((l) => l.trim());\n    return i.endsWith(\"/*\") && n.startsWith(o + \"/\");\n  });\n}\nfunction Gc(e, t, n) {\n  let { $$slots: r = {}, $$scope: i } = t, { filetype: o = null } = t, { dragging: l = !1 } = t, { boundedheight: a = !0 } = t, { center: s = !0 } = t, { flex: u = !0 } = t, { file_count: f = \"single\" } = t, { disable_click: c = !1 } = t, { root: _ } = t, { hidden: h = !1 } = t, { format: d = \"file\" } = t, { uploading: p = !1 } = t, w, v, E;\n  const b = Oc(\"upload_files\");\n  let S;\n  const H = Ic(), g = [\"image\", \"video\", \"audio\", \"text\", \"file\"], Z = (m) => m.startsWith(\".\") || m.endsWith(\"/*\") ? m : g.includes(m) ? m + \"/*\" : \".\" + m;\n  function P() {\n    n(17, l = !l);\n  }\n  function T() {\n    navigator.clipboard.read().then(async (m) => {\n      for (let y = 0; y < m.length; y++) {\n        const M = m[y].types.find((D) => D.startsWith(\"image/\"));\n        if (M) {\n          m[y].getType(M).then(async (D) => {\n            const re = new File([D], `clipboard.${M.replace(\"image/\", \"\")}`);\n            await ue([re]);\n          });\n          break;\n        }\n      }\n    });\n  }\n  function k() {\n    c || (n(13, S.value = \"\", S), S.click());\n  }\n  async function ke(m) {\n    await Lc(), n(10, w = Math.random().toString(36).substring(2, 15)), n(1, p = !0);\n    const y = await hu(m, _, w, b);\n    return H(\"load\", f === \"single\" ? qi([y, \"optionalAccess\", (M) => M[0]]) : y), n(1, p = !1), y || [];\n  }\n  async function ue(m) {\n    if (!m.length)\n      return;\n    let y = m.map((M) => new File([M], M.name));\n    return n(11, v = await du(y)), await ke(v);\n  }\n  async function Te(m) {\n    const y = m.target;\n    if (y.files)\n      if (d != \"blob\")\n        await ue(Array.from(y.files));\n      else {\n        if (f === \"single\") {\n          H(\"load\", y.files[0]);\n          return;\n        }\n        H(\"load\", y.files);\n      }\n  }\n  async function Re(m) {\n    if (n(17, l = !1), !qi([m, \"access\", (M) => M.dataTransfer, \"optionalAccess\", (M) => M.files]))\n      return;\n    const y = Array.from(m.dataTransfer.files).filter((M) => {\n      const D = \".\" + M.name.split(\".\").pop();\n      return D && Fc(E, D, M.type) || (D && Array.isArray(o) ? o.includes(D) : D === o) ? !0 : (H(\"error\", `Invalid file type only ${o} allowed.`), !1);\n    });\n    await ue(y);\n  }\n  function fe(m) {\n    Ke.call(this, e, m);\n  }\n  function pt(m) {\n    Ke.call(this, e, m);\n  }\n  function Ze(m) {\n    Ke.call(this, e, m);\n  }\n  function gt(m) {\n    Ke.call(this, e, m);\n  }\n  function xe(m) {\n    Ke.call(this, e, m);\n  }\n  function A(m) {\n    Ke.call(this, e, m);\n  }\n  function W(m) {\n    Ke.call(this, e, m);\n  }\n  function J(m) {\n    kc[m ? \"unshift\" : \"push\"](() => {\n      S = m, n(13, S);\n    });\n  }\n  return e.$$set = (m) => {\n    \"filetype\" in m && n(0, o = m.filetype), \"dragging\" in m && n(17, l = m.dragging), \"boundedheight\" in m && n(2, a = m.boundedheight), \"center\" in m && n(3, s = m.center), \"flex\" in m && n(4, u = m.flex), \"file_count\" in m && n(5, f = m.file_count), \"disable_click\" in m && n(18, c = m.disable_click), \"root\" in m && n(6, _ = m.root), \"hidden\" in m && n(7, h = m.hidden), \"format\" in m && n(19, d = m.format), \"uploading\" in m && n(1, p = m.uploading), \"$$scope\" in m && n(21, i = m.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty[0] & /*filetype*/\n    1 && (o == null ? n(12, E = null) : typeof o == \"string\" ? n(12, E = Z(o)) : (n(0, o = o.map(Z)), n(12, E = o.join(\", \"))));\n  }, [\n    o,\n    p,\n    a,\n    s,\n    u,\n    f,\n    _,\n    h,\n    T,\n    k,\n    w,\n    v,\n    E,\n    S,\n    P,\n    Te,\n    Re,\n    l,\n    c,\n    d,\n    ue,\n    i,\n    r,\n    fe,\n    pt,\n    Ze,\n    gt,\n    xe,\n    A,\n    W,\n    J\n  ];\n}\nclass jc extends Sc {\n  constructor(t) {\n    super(), Bc(\n      this,\n      t,\n      Gc,\n      Uc,\n      Nc,\n      {\n        filetype: 0,\n        dragging: 17,\n        boundedheight: 2,\n        center: 3,\n        flex: 4,\n        file_count: 5,\n        disable_click: 18,\n        root: 6,\n        hidden: 7,\n        format: 19,\n        uploading: 1,\n        paste_clipboard: 8,\n        open_file_upload: 9,\n        load_files: 20\n      },\n      null,\n      [-1, -1]\n    );\n  }\n  get paste_clipboard() {\n    return this.$$.ctx[8];\n  }\n  get open_file_upload() {\n    return this.$$.ctx[9];\n  }\n  get load_files() {\n    return this.$$.ctx[20];\n  }\n}\nconst { setContext: $_, getContext: qc } = window.__gradio__svelte__internal, zc = \"WORKER_PROXY_CONTEXT_KEY\";\nfunction hl() {\n  return qc(zc);\n}\nfunction Vc(e) {\n  return e.host === window.location.host || e.host === \"localhost:7860\" || e.host === \"127.0.0.1:7860\" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194\n  e.host === \"lite.local\";\n}\nfunction dl(e, t) {\n  const n = t.toLowerCase();\n  for (const [r, i] of Object.entries(e))\n    if (r.toLowerCase() === n)\n      return i;\n}\nfunction ml(e) {\n  if (e == null)\n    return !1;\n  const t = new URL(e, window.location.href);\n  return !(!Vc(t) || t.protocol !== \"http:\" && t.protocol !== \"https:\");\n}\nasync function eh(e) {\n  if (e == null || !ml(e))\n    return e;\n  const t = hl();\n  if (t == null)\n    return e;\n  const r = new URL(e, window.location.href).pathname;\n  return t.httpRequest({\n    method: \"GET\",\n    path: r,\n    headers: {},\n    query_string: \"\"\n  }).then((i) => {\n    if (i.status !== 200)\n      throw new Error(`Failed to get file ${r} from the Wasm worker.`);\n    const o = new Blob([i.body], {\n      type: dl(i.headers, \"content-type\")\n    });\n    return URL.createObjectURL(o);\n  });\n}\nconst {\n  SvelteComponent: Xc,\n  assign: kn,\n  check_outros: pl,\n  compute_rest_props: zi,\n  create_slot: Wr,\n  detach: Dn,\n  element: gl,\n  empty: bl,\n  exclude_internal_props: Wc,\n  get_all_dirty_from_scope: Zr,\n  get_slot_changes: xr,\n  get_spread_update: wl,\n  group_outros: vl,\n  init: Zc,\n  insert: Mn,\n  listen: yl,\n  prevent_default: xc,\n  safe_not_equal: Jc,\n  set_attributes: Tn,\n  transition_in: ft,\n  transition_out: ct,\n  update_slot_base: Jr\n} = window.__gradio__svelte__internal, { createEventDispatcher: Qc } = window.__gradio__svelte__internal;\nfunction Yc(e) {\n  let t, n, r, i, o;\n  const l = (\n    /*#slots*/\n    e[8].default\n  ), a = Wr(\n    l,\n    e,\n    /*$$scope*/\n    e[7],\n    null\n  );\n  let s = [\n    { href: (\n      /*href*/\n      e[0]\n    ) },\n    {\n      target: n = typeof window < \"u\" && window.__is_colab__ ? \"_blank\" : null\n    },\n    { rel: \"noopener noreferrer\" },\n    { download: (\n      /*download*/\n      e[1]\n    ) },\n    /*$$restProps*/\n    e[6]\n  ], u = {};\n  for (let f = 0; f < s.length; f += 1)\n    u = kn(u, s[f]);\n  return {\n    c() {\n      t = gl(\"a\"), a && a.c(), Tn(t, u);\n    },\n    m(f, c) {\n      Mn(f, t, c), a && a.m(t, null), r = !0, i || (o = yl(\n        t,\n        \"click\",\n        /*dispatch*/\n        e[3].bind(null, \"click\")\n      ), i = !0);\n    },\n    p(f, c) {\n      a && a.p && (!r || c & /*$$scope*/\n      128) && Jr(\n        a,\n        l,\n        f,\n        /*$$scope*/\n        f[7],\n        r ? xr(\n          l,\n          /*$$scope*/\n          f[7],\n          c,\n          null\n        ) : Zr(\n          /*$$scope*/\n          f[7]\n        ),\n        null\n      ), Tn(t, u = wl(s, [\n        (!r || c & /*href*/\n        1) && { href: (\n          /*href*/\n          f[0]\n        ) },\n        { target: n },\n        { rel: \"noopener noreferrer\" },\n        (!r || c & /*download*/\n        2) && { download: (\n          /*download*/\n          f[1]\n        ) },\n        c & /*$$restProps*/\n        64 && /*$$restProps*/\n        f[6]\n      ]));\n    },\n    i(f) {\n      r || (ft(a, f), r = !0);\n    },\n    o(f) {\n      ct(a, f), r = !1;\n    },\n    d(f) {\n      f && Dn(t), a && a.d(f), i = !1, o();\n    }\n  };\n}\nfunction Kc(e) {\n  let t, n, r, i;\n  const o = [e0, $c], l = [];\n  function a(s, u) {\n    return (\n      /*is_downloading*/\n      s[2] ? 0 : 1\n    );\n  }\n  return t = a(e), n = l[t] = o[t](e), {\n    c() {\n      n.c(), r = bl();\n    },\n    m(s, u) {\n      l[t].m(s, u), Mn(s, r, u), i = !0;\n    },\n    p(s, u) {\n      let f = t;\n      t = a(s), t === f ? l[t].p(s, u) : (vl(), ct(l[f], 1, 1, () => {\n        l[f] = null;\n      }), pl(), n = l[t], n ? n.p(s, u) : (n = l[t] = o[t](s), n.c()), ft(n, 1), n.m(r.parentNode, r));\n    },\n    i(s) {\n      i || (ft(n), i = !0);\n    },\n    o(s) {\n      ct(n), i = !1;\n    },\n    d(s) {\n      s && Dn(r), l[t].d(s);\n    }\n  };\n}\nfunction $c(e) {\n  let t, n, r, i;\n  const o = (\n    /*#slots*/\n    e[8].default\n  ), l = Wr(\n    o,\n    e,\n    /*$$scope*/\n    e[7],\n    null\n  );\n  let a = [\n    /*$$restProps*/\n    e[6],\n    { href: (\n      /*href*/\n      e[0]\n    ) }\n  ], s = {};\n  for (let u = 0; u < a.length; u += 1)\n    s = kn(s, a[u]);\n  return {\n    c() {\n      t = gl(\"a\"), l && l.c(), Tn(t, s);\n    },\n    m(u, f) {\n      Mn(u, t, f), l && l.m(t, null), n = !0, r || (i = yl(t, \"click\", xc(\n        /*wasm_click_handler*/\n        e[5]\n      )), r = !0);\n    },\n    p(u, f) {\n      l && l.p && (!n || f & /*$$scope*/\n      128) && Jr(\n        l,\n        o,\n        u,\n        /*$$scope*/\n        u[7],\n        n ? xr(\n          o,\n          /*$$scope*/\n          u[7],\n          f,\n          null\n        ) : Zr(\n          /*$$scope*/\n          u[7]\n        ),\n        null\n      ), Tn(t, s = wl(a, [\n        f & /*$$restProps*/\n        64 && /*$$restProps*/\n        u[6],\n        (!n || f & /*href*/\n        1) && { href: (\n          /*href*/\n          u[0]\n        ) }\n      ]));\n    },\n    i(u) {\n      n || (ft(l, u), n = !0);\n    },\n    o(u) {\n      ct(l, u), n = !1;\n    },\n    d(u) {\n      u && Dn(t), l && l.d(u), r = !1, i();\n    }\n  };\n}\nfunction e0(e) {\n  let t;\n  const n = (\n    /*#slots*/\n    e[8].default\n  ), r = Wr(\n    n,\n    e,\n    /*$$scope*/\n    e[7],\n    null\n  );\n  return {\n    c() {\n      r && r.c();\n    },\n    m(i, o) {\n      r && r.m(i, o), t = !0;\n    },\n    p(i, o) {\n      r && r.p && (!t || o & /*$$scope*/\n      128) && Jr(\n        r,\n        n,\n        i,\n        /*$$scope*/\n        i[7],\n        t ? xr(\n          n,\n          /*$$scope*/\n          i[7],\n          o,\n          null\n        ) : Zr(\n          /*$$scope*/\n          i[7]\n        ),\n        null\n      );\n    },\n    i(i) {\n      t || (ft(r, i), t = !0);\n    },\n    o(i) {\n      ct(r, i), t = !1;\n    },\n    d(i) {\n      r && r.d(i);\n    }\n  };\n}\nfunction t0(e) {\n  let t, n, r, i, o;\n  const l = [Kc, Yc], a = [];\n  function s(u, f) {\n    return f & /*href*/\n    1 && (t = null), t == null && (t = !!/*worker_proxy*/\n    (u[4] && ml(\n      /*href*/\n      u[0]\n    ))), t ? 0 : 1;\n  }\n  return n = s(e, -1), r = a[n] = l[n](e), {\n    c() {\n      r.c(), i = bl();\n    },\n    m(u, f) {\n      a[n].m(u, f), Mn(u, i, f), o = !0;\n    },\n    p(u, [f]) {\n      let c = n;\n      n = s(u, f), n === c ? a[n].p(u, f) : (vl(), ct(a[c], 1, 1, () => {\n        a[c] = null;\n      }), pl(), r = a[n], r ? r.p(u, f) : (r = a[n] = l[n](u), r.c()), ft(r, 1), r.m(i.parentNode, i));\n    },\n    i(u) {\n      o || (ft(r), o = !0);\n    },\n    o(u) {\n      ct(r), o = !1;\n    },\n    d(u) {\n      u && Dn(i), a[n].d(u);\n    }\n  };\n}\nfunction n0(e, t, n) {\n  const r = [\"href\", \"download\"];\n  let i = zi(t, r), { $$slots: o = {}, $$scope: l } = t, { href: a = void 0 } = t, { download: s } = t;\n  const u = Qc();\n  let f = !1;\n  const c = hl();\n  async function _() {\n    if (f)\n      return;\n    if (u(\"click\"), a == null)\n      throw new Error(\"href is not defined.\");\n    if (c == null)\n      throw new Error(\"Wasm worker proxy is not available.\");\n    const d = new URL(a, window.location.href).pathname;\n    n(2, f = !0), c.httpRequest({\n      method: \"GET\",\n      path: d,\n      headers: {},\n      query_string: \"\"\n    }).then((p) => {\n      if (p.status !== 200)\n        throw new Error(`Failed to get file ${d} from the Wasm worker.`);\n      const w = new Blob(\n        [p.body],\n        {\n          type: dl(p.headers, \"content-type\")\n        }\n      ), v = URL.createObjectURL(w), E = document.createElement(\"a\");\n      E.href = v, E.download = s, E.click(), URL.revokeObjectURL(v);\n    }).finally(() => {\n      n(2, f = !1);\n    });\n  }\n  return e.$$set = (h) => {\n    t = kn(kn({}, t), Wc(h)), n(6, i = zi(t, r)), \"href\" in h && n(0, a = h.href), \"download\" in h && n(1, s = h.download), \"$$scope\" in h && n(7, l = h.$$scope);\n  }, [\n    a,\n    s,\n    f,\n    u,\n    c,\n    _,\n    i,\n    l,\n    o\n  ];\n}\nclass r0 extends Xc {\n  constructor(t) {\n    super(), Zc(this, t, n0, t0, Jc, { href: 0, download: 1 });\n  }\n}\nconst {\n  SvelteComponent: i0,\n  append: _r,\n  attr: o0,\n  check_outros: hr,\n  create_component: en,\n  destroy_component: tn,\n  detach: l0,\n  element: s0,\n  group_outros: dr,\n  init: a0,\n  insert: u0,\n  mount_component: nn,\n  safe_not_equal: f0,\n  set_style: Vi,\n  space: mr,\n  toggle_class: Xi,\n  transition_in: oe,\n  transition_out: Ne\n} = window.__gradio__svelte__internal, { createEventDispatcher: c0 } = window.__gradio__svelte__internal;\nfunction Wi(e) {\n  let t, n;\n  return t = new Pt({\n    props: {\n      Icon: ca,\n      label: (\n        /*i18n*/\n        e[4](\"common.edit\")\n      )\n    }\n  }), t.$on(\n    \"click\",\n    /*click_handler*/\n    e[6]\n  ), {\n    c() {\n      en(t.$$.fragment);\n    },\n    m(r, i) {\n      nn(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*i18n*/\n      16 && (o.label = /*i18n*/\n      r[4](\"common.edit\")), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ne(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      tn(t, r);\n    }\n  };\n}\nfunction Zi(e) {\n  let t, n;\n  return t = new Pt({\n    props: {\n      Icon: Eo,\n      label: (\n        /*i18n*/\n        e[4](\"common.undo\")\n      )\n    }\n  }), t.$on(\n    \"click\",\n    /*click_handler_1*/\n    e[7]\n  ), {\n    c() {\n      en(t.$$.fragment);\n    },\n    m(r, i) {\n      nn(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*i18n*/\n      16 && (o.label = /*i18n*/\n      r[4](\"common.undo\")), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ne(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      tn(t, r);\n    }\n  };\n}\nfunction xi(e) {\n  let t, n;\n  return t = new r0({\n    props: {\n      href: (\n        /*download*/\n        e[2]\n      ),\n      download: !0,\n      $$slots: { default: [_0] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      en(t.$$.fragment);\n    },\n    m(r, i) {\n      nn(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*download*/\n      4 && (o.href = /*download*/\n      r[2]), i & /*$$scope, i18n*/\n      528 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ne(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      tn(t, r);\n    }\n  };\n}\nfunction _0(e) {\n  let t, n;\n  return t = new Pt({\n    props: {\n      Icon: yo,\n      label: (\n        /*i18n*/\n        e[4](\"common.download\")\n      )\n    }\n  }), {\n    c() {\n      en(t.$$.fragment);\n    },\n    m(r, i) {\n      nn(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*i18n*/\n      16 && (o.label = /*i18n*/\n      r[4](\"common.download\")), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ne(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      tn(t, r);\n    }\n  };\n}\nfunction h0(e) {\n  let t, n, r, i, o, l, a = (\n    /*editable*/\n    e[0] && Wi(e)\n  ), s = (\n    /*undoable*/\n    e[1] && Zi(e)\n  ), u = (\n    /*download*/\n    e[2] && xi(e)\n  );\n  return o = new Pt({\n    props: {\n      Icon: Qs,\n      label: (\n        /*i18n*/\n        e[4](\"common.clear\")\n      )\n    }\n  }), o.$on(\n    \"click\",\n    /*click_handler_2*/\n    e[8]\n  ), {\n    c() {\n      t = s0(\"div\"), a && a.c(), n = mr(), s && s.c(), r = mr(), u && u.c(), i = mr(), en(o.$$.fragment), o0(t, \"class\", \"svelte-1wj0ocy\"), Xi(t, \"not-absolute\", !/*absolute*/\n      e[3]), Vi(\n        t,\n        \"position\",\n        /*absolute*/\n        e[3] ? \"absolute\" : \"static\"\n      );\n    },\n    m(f, c) {\n      u0(f, t, c), a && a.m(t, null), _r(t, n), s && s.m(t, null), _r(t, r), u && u.m(t, null), _r(t, i), nn(o, t, null), l = !0;\n    },\n    p(f, [c]) {\n      /*editable*/\n      f[0] ? a ? (a.p(f, c), c & /*editable*/\n      1 && oe(a, 1)) : (a = Wi(f), a.c(), oe(a, 1), a.m(t, n)) : a && (dr(), Ne(a, 1, 1, () => {\n        a = null;\n      }), hr()), /*undoable*/\n      f[1] ? s ? (s.p(f, c), c & /*undoable*/\n      2 && oe(s, 1)) : (s = Zi(f), s.c(), oe(s, 1), s.m(t, r)) : s && (dr(), Ne(s, 1, 1, () => {\n        s = null;\n      }), hr()), /*download*/\n      f[2] ? u ? (u.p(f, c), c & /*download*/\n      4 && oe(u, 1)) : (u = xi(f), u.c(), oe(u, 1), u.m(t, i)) : u && (dr(), Ne(u, 1, 1, () => {\n        u = null;\n      }), hr());\n      const _ = {};\n      c & /*i18n*/\n      16 && (_.label = /*i18n*/\n      f[4](\"common.clear\")), o.$set(_), (!l || c & /*absolute*/\n      8) && Xi(t, \"not-absolute\", !/*absolute*/\n      f[3]), c & /*absolute*/\n      8 && Vi(\n        t,\n        \"position\",\n        /*absolute*/\n        f[3] ? \"absolute\" : \"static\"\n      );\n    },\n    i(f) {\n      l || (oe(a), oe(s), oe(u), oe(o.$$.fragment, f), l = !0);\n    },\n    o(f) {\n      Ne(a), Ne(s), Ne(u), Ne(o.$$.fragment, f), l = !1;\n    },\n    d(f) {\n      f && l0(t), a && a.d(), s && s.d(), u && u.d(), tn(o);\n    }\n  };\n}\nfunction d0(e, t, n) {\n  let { editable: r = !1 } = t, { undoable: i = !1 } = t, { download: o = null } = t, { absolute: l = !0 } = t, { i18n: a } = t;\n  const s = c0(), u = () => s(\"edit\"), f = () => s(\"undo\"), c = (_) => {\n    s(\"clear\"), _.stopPropagation();\n  };\n  return e.$$set = (_) => {\n    \"editable\" in _ && n(0, r = _.editable), \"undoable\" in _ && n(1, i = _.undoable), \"download\" in _ && n(2, o = _.download), \"absolute\" in _ && n(3, l = _.absolute), \"i18n\" in _ && n(4, a = _.i18n);\n  }, [\n    r,\n    i,\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c\n  ];\n}\nclass m0 extends i0 {\n  constructor(t) {\n    super(), a0(this, t, d0, h0, f0, {\n      editable: 0,\n      undoable: 1,\n      download: 2,\n      absolute: 3,\n      i18n: 4\n    });\n  }\n}\nconst {\n  SvelteComponent: p0,\n  add_flush_callback: g0,\n  append: b0,\n  attr: w0,\n  bind: v0,\n  binding_callbacks: El,\n  check_outros: Rn,\n  construct_svelte_component: An,\n  create_component: _t,\n  create_slot: y0,\n  destroy_component: ht,\n  detach: Zt,\n  element: E0,\n  empty: Qr,\n  get_all_dirty_from_scope: S0,\n  get_slot_changes: k0,\n  group_outros: Un,\n  init: T0,\n  insert: xt,\n  mount_component: dt,\n  safe_not_equal: A0,\n  space: Sl,\n  transition_in: ye,\n  transition_out: Ee,\n  update_slot_base: B0\n} = window.__gradio__svelte__internal, { createEventDispatcher: C0, tick: Ji } = window.__gradio__svelte__internal;\nfunction H0(e) {\n  let t, n, r, i, o, l;\n  n = new m0({\n    props: {\n      undoable: !/*use_3dgs*/\n      e[9],\n      i18n: (\n        /*i18n*/\n        e[5]\n      ),\n      absolute: !0\n    }\n  }), n.$on(\n    \"clear\",\n    /*handle_clear*/\n    e[15]\n  ), n.$on(\n    \"undo\",\n    /*handle_undo*/\n    e[16]\n  );\n  const a = [I0, P0], s = [];\n  function u(f, c) {\n    return (\n      /*use_3dgs*/\n      f[9] ? 0 : 1\n    );\n  }\n  return i = u(e), o = s[i] = a[i](e), {\n    c() {\n      t = E0(\"div\"), _t(n.$$.fragment), r = Sl(), o.c(), w0(t, \"class\", \"input-model svelte-1oz8ks8\");\n    },\n    m(f, c) {\n      xt(f, t, c), dt(n, t, null), b0(t, r), s[i].m(t, null), l = !0;\n    },\n    p(f, c) {\n      const _ = {};\n      c & /*use_3dgs*/\n      512 && (_.undoable = !/*use_3dgs*/\n      f[9]), c & /*i18n*/\n      32 && (_.i18n = /*i18n*/\n      f[5]), n.$set(_);\n      let h = i;\n      i = u(f), i === h ? s[i].p(f, c) : (Un(), Ee(s[h], 1, 1, () => {\n        s[h] = null;\n      }), Rn(), o = s[i], o ? o.p(f, c) : (o = s[i] = a[i](f), o.c()), ye(o, 1), o.m(t, null));\n    },\n    i(f) {\n      l || (ye(n.$$.fragment, f), ye(o), l = !0);\n    },\n    o(f) {\n      Ee(n.$$.fragment, f), Ee(o), l = !1;\n    },\n    d(f) {\n      f && Zt(t), ht(n), s[i].d();\n    }\n  };\n}\nfunction N0(e) {\n  let t, n, r;\n  function i(l) {\n    e[18](l);\n  }\n  let o = {\n    root: (\n      /*root*/\n      e[4]\n    ),\n    filetype: [\".stl\", \".obj\", \".gltf\", \".glb\", \"model/obj\", \".splat\", \".ply\"],\n    $$slots: { default: [L0] },\n    $$scope: { ctx: e }\n  };\n  return (\n    /*dragging*/\n    e[10] !== void 0 && (o.dragging = /*dragging*/\n    e[10]), t = new jc({ props: o }), El.push(() => v0(t, \"dragging\", i)), t.$on(\n      \"load\",\n      /*handle_upload*/\n      e[14]\n    ), {\n      c() {\n        _t(t.$$.fragment);\n      },\n      m(l, a) {\n        dt(t, l, a), r = !0;\n      },\n      p(l, a) {\n        const s = {};\n        a & /*root*/\n        16 && (s.root = /*root*/\n        l[4]), a & /*$$scope*/\n        1048576 && (s.$$scope = { dirty: a, ctx: l }), !n && a & /*dragging*/\n        1024 && (n = !0, s.dragging = /*dragging*/\n        l[10], g0(() => n = !1)), t.$set(s);\n      },\n      i(l) {\n        r || (ye(t.$$.fragment, l), r = !0);\n      },\n      o(l) {\n        Ee(t.$$.fragment, l), r = !1;\n      },\n      d(l) {\n        ht(t, l);\n      }\n    }\n  );\n}\nfunction P0(e) {\n  let t, n, r;\n  var i = (\n    /*Canvas3DComponent*/\n    e[12]\n  );\n  function o(l, a) {\n    return { props: {\n      value: (\n        /*value*/\n        l[0]\n      ),\n      clear_color: (\n        /*clear_color*/\n        l[1]\n      ),\n      camera_position: (\n        /*camera_position*/\n        l[8]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        l[6]\n      ),\n      pan_speed: (\n        /*pan_speed*/\n        l[7]\n      )\n    } };\n  }\n  return i && (t = An(i, o(e)), e[19](t)), {\n    c() {\n      t && _t(t.$$.fragment), n = Qr();\n    },\n    m(l, a) {\n      t && dt(t, l, a), xt(l, n, a), r = !0;\n    },\n    p(l, a) {\n      if (a & /*Canvas3DComponent*/\n      4096 && i !== (i = /*Canvas3DComponent*/\n      l[12])) {\n        if (t) {\n          Un();\n          const s = t;\n          Ee(s.$$.fragment, 1, 0, () => {\n            ht(s, 1);\n          }), Rn();\n        }\n        i ? (t = An(i, o(l)), l[19](t), _t(t.$$.fragment), ye(t.$$.fragment, 1), dt(t, n.parentNode, n)) : t = null;\n      } else if (i) {\n        const s = {};\n        a & /*value*/\n        1 && (s.value = /*value*/\n        l[0]), a & /*clear_color*/\n        2 && (s.clear_color = /*clear_color*/\n        l[1]), a & /*camera_position*/\n        256 && (s.camera_position = /*camera_position*/\n        l[8]), a & /*zoom_speed*/\n        64 && (s.zoom_speed = /*zoom_speed*/\n        l[6]), a & /*pan_speed*/\n        128 && (s.pan_speed = /*pan_speed*/\n        l[7]), t.$set(s);\n      }\n    },\n    i(l) {\n      r || (t && ye(t.$$.fragment, l), r = !0);\n    },\n    o(l) {\n      t && Ee(t.$$.fragment, l), r = !1;\n    },\n    d(l) {\n      l && Zt(n), e[19](null), t && ht(t, l);\n    }\n  };\n}\nfunction I0(e) {\n  let t, n, r;\n  var i = (\n    /*Canvas3DGSComponent*/\n    e[11]\n  );\n  function o(l, a) {\n    return {\n      props: {\n        value: (\n          /*value*/\n          l[0]\n        ),\n        zoom_speed: (\n          /*zoom_speed*/\n          l[6]\n        ),\n        pan_speed: (\n          /*pan_speed*/\n          l[7]\n        )\n      }\n    };\n  }\n  return i && (t = An(i, o(e))), {\n    c() {\n      t && _t(t.$$.fragment), n = Qr();\n    },\n    m(l, a) {\n      t && dt(t, l, a), xt(l, n, a), r = !0;\n    },\n    p(l, a) {\n      if (a & /*Canvas3DGSComponent*/\n      2048 && i !== (i = /*Canvas3DGSComponent*/\n      l[11])) {\n        if (t) {\n          Un();\n          const s = t;\n          Ee(s.$$.fragment, 1, 0, () => {\n            ht(s, 1);\n          }), Rn();\n        }\n        i ? (t = An(i, o(l)), _t(t.$$.fragment), ye(t.$$.fragment, 1), dt(t, n.parentNode, n)) : t = null;\n      } else if (i) {\n        const s = {};\n        a & /*value*/\n        1 && (s.value = /*value*/\n        l[0]), a & /*zoom_speed*/\n        64 && (s.zoom_speed = /*zoom_speed*/\n        l[6]), a & /*pan_speed*/\n        128 && (s.pan_speed = /*pan_speed*/\n        l[7]), t.$set(s);\n      }\n    },\n    i(l) {\n      r || (t && ye(t.$$.fragment, l), r = !0);\n    },\n    o(l) {\n      t && Ee(t.$$.fragment, l), r = !1;\n    },\n    d(l) {\n      l && Zt(n), t && ht(t, l);\n    }\n  };\n}\nfunction L0(e) {\n  let t;\n  const n = (\n    /*#slots*/\n    e[17].default\n  ), r = y0(\n    n,\n    e,\n    /*$$scope*/\n    e[20],\n    null\n  );\n  return {\n    c() {\n      r && r.c();\n    },\n    m(i, o) {\n      r && r.m(i, o), t = !0;\n    },\n    p(i, o) {\n      r && r.p && (!t || o & /*$$scope*/\n      1048576) && B0(\n        r,\n        n,\n        i,\n        /*$$scope*/\n        i[20],\n        t ? k0(\n          n,\n          /*$$scope*/\n          i[20],\n          o,\n          null\n        ) : S0(\n          /*$$scope*/\n          i[20]\n        ),\n        null\n      );\n    },\n    i(i) {\n      t || (ye(r, i), t = !0);\n    },\n    o(i) {\n      Ee(r, i), t = !1;\n    },\n    d(i) {\n      r && r.d(i);\n    }\n  };\n}\nfunction O0(e) {\n  let t, n, r, i, o, l;\n  t = new Fr({\n    props: {\n      show_label: (\n        /*show_label*/\n        e[3]\n      ),\n      Icon: Cn,\n      label: (\n        /*label*/\n        e[2] || \"3D Model\"\n      )\n    }\n  });\n  const a = [N0, H0], s = [];\n  function u(f, c) {\n    return (\n      /*value*/\n      f[0] === null ? 0 : 1\n    );\n  }\n  return r = u(e), i = s[r] = a[r](e), {\n    c() {\n      _t(t.$$.fragment), n = Sl(), i.c(), o = Qr();\n    },\n    m(f, c) {\n      dt(t, f, c), xt(f, n, c), s[r].m(f, c), xt(f, o, c), l = !0;\n    },\n    p(f, [c]) {\n      const _ = {};\n      c & /*show_label*/\n      8 && (_.show_label = /*show_label*/\n      f[3]), c & /*label*/\n      4 && (_.label = /*label*/\n      f[2] || \"3D Model\"), t.$set(_);\n      let h = r;\n      r = u(f), r === h ? s[r].p(f, c) : (Un(), Ee(s[h], 1, 1, () => {\n        s[h] = null;\n      }), Rn(), i = s[r], i ? i.p(f, c) : (i = s[r] = a[r](f), i.c()), ye(i, 1), i.m(o.parentNode, o));\n    },\n    i(f) {\n      l || (ye(t.$$.fragment, f), ye(i), l = !0);\n    },\n    o(f) {\n      Ee(t.$$.fragment, f), Ee(i), l = !1;\n    },\n    d(f) {\n      f && (Zt(n), Zt(o)), ht(t, f), s[r].d(f);\n    }\n  };\n}\nfunction D0(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nasync function M0() {\n  return (await import(\"./Canvas3D-60a8d213.js\")).default;\n}\nasync function R0() {\n  return (await import(\"./Canvas3DGS-0fbc0d9a.js\")).default;\n}\nfunction U0(e, t, n) {\n  let { $$slots: r = {}, $$scope: i } = t, { value: o } = t, { clear_color: l = [0, 0, 0, 0] } = t, { label: a = \"\" } = t, { show_label: s } = t, { root: u } = t, { i18n: f } = t, { zoom_speed: c = 1 } = t, { pan_speed: _ = 1 } = t, { camera_position: h = [null, null, null] } = t;\n  async function d({ detail: T }) {\n    n(0, o = T), await Ji(), H(\"change\", o), H(\"load\", o);\n  }\n  async function p() {\n    n(0, o = null), await Ji(), H(\"clear\"), H(\"change\");\n  }\n  let w = !1, v, E, b;\n  async function S() {\n    D0([\n      b,\n      \"optionalAccess\",\n      (T) => T.reset_camera_position,\n      \"call\",\n      (T) => T(h, c, _)\n    ]);\n  }\n  const H = C0();\n  let g = !1;\n  function Z(T) {\n    g = T, n(10, g);\n  }\n  function P(T) {\n    El[T ? \"unshift\" : \"push\"](() => {\n      b = T, n(13, b);\n    });\n  }\n  return e.$$set = (T) => {\n    \"value\" in T && n(0, o = T.value), \"clear_color\" in T && n(1, l = T.clear_color), \"label\" in T && n(2, a = T.label), \"show_label\" in T && n(3, s = T.show_label), \"root\" in T && n(4, u = T.root), \"i18n\" in T && n(5, f = T.i18n), \"zoom_speed\" in T && n(6, c = T.zoom_speed), \"pan_speed\" in T && n(7, _ = T.pan_speed), \"camera_position\" in T && n(8, h = T.camera_position), \"$$scope\" in T && n(20, i = T.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*value, use_3dgs*/\n    513 && o && (n(9, w = o.path.endsWith(\".splat\") || o.path.endsWith(\".ply\")), w ? R0().then((T) => {\n      n(11, v = T);\n    }) : M0().then((T) => {\n      n(12, E = T);\n    })), e.$$.dirty & /*dragging*/\n    1024 && H(\"drag\", g);\n  }, [\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c,\n    _,\n    h,\n    w,\n    g,\n    v,\n    E,\n    b,\n    d,\n    p,\n    S,\n    r,\n    Z,\n    P,\n    i\n  ];\n}\nclass F0 extends p0 {\n  constructor(t) {\n    super(), T0(this, t, U0, O0, A0, {\n      value: 0,\n      clear_color: 1,\n      label: 2,\n      show_label: 3,\n      root: 4,\n      i18n: 5,\n      zoom_speed: 6,\n      pan_speed: 7,\n      camera_position: 8\n    });\n  }\n}\nfunction St(e) {\n  let t = [\"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\"], n = 0;\n  for (; e > 1e3 && n < t.length - 1; )\n    e /= 1e3, n++;\n  let r = t[n];\n  return (Number.isInteger(e) ? e : e.toFixed(1)) + r;\n}\nconst {\n  SvelteComponent: G0,\n  append: Ce,\n  attr: O,\n  component_subscribe: Qi,\n  detach: j0,\n  element: q0,\n  init: z0,\n  insert: V0,\n  noop: Yi,\n  safe_not_equal: X0,\n  set_style: cn,\n  svg_element: He,\n  toggle_class: Ki\n} = window.__gradio__svelte__internal, { onMount: W0 } = window.__gradio__svelte__internal;\nfunction Z0(e) {\n  let t, n, r, i, o, l, a, s, u, f, c, _;\n  return {\n    c() {\n      t = q0(\"div\"), n = He(\"svg\"), r = He(\"g\"), i = He(\"path\"), o = He(\"path\"), l = He(\"path\"), a = He(\"path\"), s = He(\"g\"), u = He(\"path\"), f = He(\"path\"), c = He(\"path\"), _ = He(\"path\"), O(i, \"d\", \"M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z\"), O(i, \"fill\", \"#FF7C00\"), O(i, \"fill-opacity\", \"0.4\"), O(i, \"class\", \"svelte-43sxxs\"), O(o, \"d\", \"M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z\"), O(o, \"fill\", \"#FF7C00\"), O(o, \"class\", \"svelte-43sxxs\"), O(l, \"d\", \"M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z\"), O(l, \"fill\", \"#FF7C00\"), O(l, \"fill-opacity\", \"0.4\"), O(l, \"class\", \"svelte-43sxxs\"), O(a, \"d\", \"M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z\"), O(a, \"fill\", \"#FF7C00\"), O(a, \"class\", \"svelte-43sxxs\"), cn(r, \"transform\", \"translate(\" + /*$top*/\n      e[1][0] + \"px, \" + /*$top*/\n      e[1][1] + \"px)\"), O(u, \"d\", \"M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z\"), O(u, \"fill\", \"#FF7C00\"), O(u, \"fill-opacity\", \"0.4\"), O(u, \"class\", \"svelte-43sxxs\"), O(f, \"d\", \"M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z\"), O(f, \"fill\", \"#FF7C00\"), O(f, \"class\", \"svelte-43sxxs\"), O(c, \"d\", \"M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z\"), O(c, \"fill\", \"#FF7C00\"), O(c, \"fill-opacity\", \"0.4\"), O(c, \"class\", \"svelte-43sxxs\"), O(_, \"d\", \"M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z\"), O(_, \"fill\", \"#FF7C00\"), O(_, \"class\", \"svelte-43sxxs\"), cn(s, \"transform\", \"translate(\" + /*$bottom*/\n      e[2][0] + \"px, \" + /*$bottom*/\n      e[2][1] + \"px)\"), O(n, \"viewBox\", \"-1200 -1200 3000 3000\"), O(n, \"fill\", \"none\"), O(n, \"xmlns\", \"http://www.w3.org/2000/svg\"), O(n, \"class\", \"svelte-43sxxs\"), O(t, \"class\", \"svelte-43sxxs\"), Ki(\n        t,\n        \"margin\",\n        /*margin*/\n        e[0]\n      );\n    },\n    m(h, d) {\n      V0(h, t, d), Ce(t, n), Ce(n, r), Ce(r, i), Ce(r, o), Ce(r, l), Ce(r, a), Ce(n, s), Ce(s, u), Ce(s, f), Ce(s, c), Ce(s, _);\n    },\n    p(h, [d]) {\n      d & /*$top*/\n      2 && cn(r, \"transform\", \"translate(\" + /*$top*/\n      h[1][0] + \"px, \" + /*$top*/\n      h[1][1] + \"px)\"), d & /*$bottom*/\n      4 && cn(s, \"transform\", \"translate(\" + /*$bottom*/\n      h[2][0] + \"px, \" + /*$bottom*/\n      h[2][1] + \"px)\"), d & /*margin*/\n      1 && Ki(\n        t,\n        \"margin\",\n        /*margin*/\n        h[0]\n      );\n    },\n    i: Yi,\n    o: Yi,\n    d(h) {\n      h && j0(t);\n    }\n  };\n}\nfunction x0(e, t, n) {\n  let r, i, { margin: o = !0 } = t;\n  const l = Si([0, 0]);\n  Qi(e, l, (_) => n(1, r = _));\n  const a = Si([0, 0]);\n  Qi(e, a, (_) => n(2, i = _));\n  let s;\n  async function u() {\n    await Promise.all([l.set([125, 140]), a.set([-125, -140])]), await Promise.all([l.set([-125, 140]), a.set([125, -140])]), await Promise.all([l.set([-125, 0]), a.set([125, -0])]), await Promise.all([l.set([125, 0]), a.set([-125, 0])]);\n  }\n  async function f() {\n    await u(), s || f();\n  }\n  async function c() {\n    await Promise.all([l.set([125, 0]), a.set([-125, 0])]), f();\n  }\n  return W0(() => (c(), () => s = !0)), e.$$set = (_) => {\n    \"margin\" in _ && n(0, o = _.margin);\n  }, [o, r, i, l, a];\n}\nclass J0 extends G0 {\n  constructor(t) {\n    super(), z0(this, t, x0, Z0, X0, { margin: 0 });\n  }\n}\nconst {\n  SvelteComponent: Q0,\n  append: it,\n  attr: Ie,\n  binding_callbacks: $i,\n  check_outros: kl,\n  create_component: Y0,\n  create_slot: K0,\n  destroy_component: $0,\n  destroy_each: Tl,\n  detach: B,\n  element: Fe,\n  empty: Ot,\n  ensure_array_like: Bn,\n  get_all_dirty_from_scope: e_,\n  get_slot_changes: t_,\n  group_outros: Al,\n  init: n_,\n  insert: C,\n  mount_component: r_,\n  noop: Ur,\n  safe_not_equal: i_,\n  set_data: Se,\n  set_style: Xe,\n  space: Le,\n  text: X,\n  toggle_class: ve,\n  transition_in: Ht,\n  transition_out: Nt,\n  update_slot_base: o_\n} = window.__gradio__svelte__internal, { tick: l_ } = window.__gradio__svelte__internal, { onDestroy: s_ } = window.__gradio__svelte__internal, a_ = (e) => ({}), eo = (e) => ({});\nfunction to(e, t, n) {\n  const r = e.slice();\n  return r[38] = t[n], r[40] = n, r;\n}\nfunction no(e, t, n) {\n  const r = e.slice();\n  return r[38] = t[n], r;\n}\nfunction u_(e) {\n  let t, n = (\n    /*i18n*/\n    e[1](\"common.error\") + \"\"\n  ), r, i, o;\n  const l = (\n    /*#slots*/\n    e[29].error\n  ), a = K0(\n    l,\n    e,\n    /*$$scope*/\n    e[28],\n    eo\n  );\n  return {\n    c() {\n      t = Fe(\"span\"), r = X(n), i = Le(), a && a.c(), Ie(t, \"class\", \"error svelte-1yserjw\");\n    },\n    m(s, u) {\n      C(s, t, u), it(t, r), C(s, i, u), a && a.m(s, u), o = !0;\n    },\n    p(s, u) {\n      (!o || u[0] & /*i18n*/\n      2) && n !== (n = /*i18n*/\n      s[1](\"common.error\") + \"\") && Se(r, n), a && a.p && (!o || u[0] & /*$$scope*/\n      268435456) && o_(\n        a,\n        l,\n        s,\n        /*$$scope*/\n        s[28],\n        o ? t_(\n          l,\n          /*$$scope*/\n          s[28],\n          u,\n          a_\n        ) : e_(\n          /*$$scope*/\n          s[28]\n        ),\n        eo\n      );\n    },\n    i(s) {\n      o || (Ht(a, s), o = !0);\n    },\n    o(s) {\n      Nt(a, s), o = !1;\n    },\n    d(s) {\n      s && (B(t), B(i)), a && a.d(s);\n    }\n  };\n}\nfunction f_(e) {\n  let t, n, r, i, o, l, a, s, u, f = (\n    /*variant*/\n    e[8] === \"default\" && /*show_eta_bar*/\n    e[18] && /*show_progress*/\n    e[6] === \"full\" && ro(e)\n  );\n  function c(b, S) {\n    if (\n      /*progress*/\n      b[7]\n    )\n      return h_;\n    if (\n      /*queue_position*/\n      b[2] !== null && /*queue_size*/\n      b[3] !== void 0 && /*queue_position*/\n      b[2] >= 0\n    )\n      return __;\n    if (\n      /*queue_position*/\n      b[2] === 0\n    )\n      return c_;\n  }\n  let _ = c(e), h = _ && _(e), d = (\n    /*timer*/\n    e[5] && lo(e)\n  );\n  const p = [g_, p_], w = [];\n  function v(b, S) {\n    return (\n      /*last_progress_level*/\n      b[15] != null ? 0 : (\n        /*show_progress*/\n        b[6] === \"full\" ? 1 : -1\n      )\n    );\n  }\n  ~(o = v(e)) && (l = w[o] = p[o](e));\n  let E = !/*timer*/\n  e[5] && ho(e);\n  return {\n    c() {\n      f && f.c(), t = Le(), n = Fe(\"div\"), h && h.c(), r = Le(), d && d.c(), i = Le(), l && l.c(), a = Le(), E && E.c(), s = Ot(), Ie(n, \"class\", \"progress-text svelte-1yserjw\"), ve(\n        n,\n        \"meta-text-center\",\n        /*variant*/\n        e[8] === \"center\"\n      ), ve(\n        n,\n        \"meta-text\",\n        /*variant*/\n        e[8] === \"default\"\n      );\n    },\n    m(b, S) {\n      f && f.m(b, S), C(b, t, S), C(b, n, S), h && h.m(n, null), it(n, r), d && d.m(n, null), C(b, i, S), ~o && w[o].m(b, S), C(b, a, S), E && E.m(b, S), C(b, s, S), u = !0;\n    },\n    p(b, S) {\n      /*variant*/\n      b[8] === \"default\" && /*show_eta_bar*/\n      b[18] && /*show_progress*/\n      b[6] === \"full\" ? f ? f.p(b, S) : (f = ro(b), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), _ === (_ = c(b)) && h ? h.p(b, S) : (h && h.d(1), h = _ && _(b), h && (h.c(), h.m(n, r))), /*timer*/\n      b[5] ? d ? d.p(b, S) : (d = lo(b), d.c(), d.m(n, null)) : d && (d.d(1), d = null), (!u || S[0] & /*variant*/\n      256) && ve(\n        n,\n        \"meta-text-center\",\n        /*variant*/\n        b[8] === \"center\"\n      ), (!u || S[0] & /*variant*/\n      256) && ve(\n        n,\n        \"meta-text\",\n        /*variant*/\n        b[8] === \"default\"\n      );\n      let H = o;\n      o = v(b), o === H ? ~o && w[o].p(b, S) : (l && (Al(), Nt(w[H], 1, 1, () => {\n        w[H] = null;\n      }), kl()), ~o ? (l = w[o], l ? l.p(b, S) : (l = w[o] = p[o](b), l.c()), Ht(l, 1), l.m(a.parentNode, a)) : l = null), /*timer*/\n      b[5] ? E && (E.d(1), E = null) : E ? E.p(b, S) : (E = ho(b), E.c(), E.m(s.parentNode, s));\n    },\n    i(b) {\n      u || (Ht(l), u = !0);\n    },\n    o(b) {\n      Nt(l), u = !1;\n    },\n    d(b) {\n      b && (B(t), B(n), B(i), B(a), B(s)), f && f.d(b), h && h.d(), d && d.d(), ~o && w[o].d(b), E && E.d(b);\n    }\n  };\n}\nfunction ro(e) {\n  let t, n = `translateX(${/*eta_level*/\n  (e[17] || 0) * 100 - 100}%)`;\n  return {\n    c() {\n      t = Fe(\"div\"), Ie(t, \"class\", \"eta-bar svelte-1yserjw\"), Xe(t, \"transform\", n);\n    },\n    m(r, i) {\n      C(r, t, i);\n    },\n    p(r, i) {\n      i[0] & /*eta_level*/\n      131072 && n !== (n = `translateX(${/*eta_level*/\n      (r[17] || 0) * 100 - 100}%)`) && Xe(t, \"transform\", n);\n    },\n    d(r) {\n      r && B(t);\n    }\n  };\n}\nfunction c_(e) {\n  let t;\n  return {\n    c() {\n      t = X(\"processing |\");\n    },\n    m(n, r) {\n      C(n, t, r);\n    },\n    p: Ur,\n    d(n) {\n      n && B(t);\n    }\n  };\n}\nfunction __(e) {\n  let t, n = (\n    /*queue_position*/\n    e[2] + 1 + \"\"\n  ), r, i, o, l;\n  return {\n    c() {\n      t = X(\"queue: \"), r = X(n), i = X(\"/\"), o = X(\n        /*queue_size*/\n        e[3]\n      ), l = X(\" |\");\n    },\n    m(a, s) {\n      C(a, t, s), C(a, r, s), C(a, i, s), C(a, o, s), C(a, l, s);\n    },\n    p(a, s) {\n      s[0] & /*queue_position*/\n      4 && n !== (n = /*queue_position*/\n      a[2] + 1 + \"\") && Se(r, n), s[0] & /*queue_size*/\n      8 && Se(\n        o,\n        /*queue_size*/\n        a[3]\n      );\n    },\n    d(a) {\n      a && (B(t), B(r), B(i), B(o), B(l));\n    }\n  };\n}\nfunction h_(e) {\n  let t, n = Bn(\n    /*progress*/\n    e[7]\n  ), r = [];\n  for (let i = 0; i < n.length; i += 1)\n    r[i] = oo(no(e, n, i));\n  return {\n    c() {\n      for (let i = 0; i < r.length; i += 1)\n        r[i].c();\n      t = Ot();\n    },\n    m(i, o) {\n      for (let l = 0; l < r.length; l += 1)\n        r[l] && r[l].m(i, o);\n      C(i, t, o);\n    },\n    p(i, o) {\n      if (o[0] & /*progress*/\n      128) {\n        n = Bn(\n          /*progress*/\n          i[7]\n        );\n        let l;\n        for (l = 0; l < n.length; l += 1) {\n          const a = no(i, n, l);\n          r[l] ? r[l].p(a, o) : (r[l] = oo(a), r[l].c(), r[l].m(t.parentNode, t));\n        }\n        for (; l < r.length; l += 1)\n          r[l].d(1);\n        r.length = n.length;\n      }\n    },\n    d(i) {\n      i && B(t), Tl(r, i);\n    }\n  };\n}\nfunction io(e) {\n  let t, n = (\n    /*p*/\n    e[38].unit + \"\"\n  ), r, i, o = \" \", l;\n  function a(f, c) {\n    return (\n      /*p*/\n      f[38].length != null ? m_ : d_\n    );\n  }\n  let s = a(e), u = s(e);\n  return {\n    c() {\n      u.c(), t = Le(), r = X(n), i = X(\" | \"), l = X(o);\n    },\n    m(f, c) {\n      u.m(f, c), C(f, t, c), C(f, r, c), C(f, i, c), C(f, l, c);\n    },\n    p(f, c) {\n      s === (s = a(f)) && u ? u.p(f, c) : (u.d(1), u = s(f), u && (u.c(), u.m(t.parentNode, t))), c[0] & /*progress*/\n      128 && n !== (n = /*p*/\n      f[38].unit + \"\") && Se(r, n);\n    },\n    d(f) {\n      f && (B(t), B(r), B(i), B(l)), u.d(f);\n    }\n  };\n}\nfunction d_(e) {\n  let t = St(\n    /*p*/\n    e[38].index || 0\n  ) + \"\", n;\n  return {\n    c() {\n      n = X(t);\n    },\n    m(r, i) {\n      C(r, n, i);\n    },\n    p(r, i) {\n      i[0] & /*progress*/\n      128 && t !== (t = St(\n        /*p*/\n        r[38].index || 0\n      ) + \"\") && Se(n, t);\n    },\n    d(r) {\n      r && B(n);\n    }\n  };\n}\nfunction m_(e) {\n  let t = St(\n    /*p*/\n    e[38].index || 0\n  ) + \"\", n, r, i = St(\n    /*p*/\n    e[38].length\n  ) + \"\", o;\n  return {\n    c() {\n      n = X(t), r = X(\"/\"), o = X(i);\n    },\n    m(l, a) {\n      C(l, n, a), C(l, r, a), C(l, o, a);\n    },\n    p(l, a) {\n      a[0] & /*progress*/\n      128 && t !== (t = St(\n        /*p*/\n        l[38].index || 0\n      ) + \"\") && Se(n, t), a[0] & /*progress*/\n      128 && i !== (i = St(\n        /*p*/\n        l[38].length\n      ) + \"\") && Se(o, i);\n    },\n    d(l) {\n      l && (B(n), B(r), B(o));\n    }\n  };\n}\nfunction oo(e) {\n  let t, n = (\n    /*p*/\n    e[38].index != null && io(e)\n  );\n  return {\n    c() {\n      n && n.c(), t = Ot();\n    },\n    m(r, i) {\n      n && n.m(r, i), C(r, t, i);\n    },\n    p(r, i) {\n      /*p*/\n      r[38].index != null ? n ? n.p(r, i) : (n = io(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);\n    },\n    d(r) {\n      r && B(t), n && n.d(r);\n    }\n  };\n}\nfunction lo(e) {\n  let t, n = (\n    /*eta*/\n    e[0] ? `/${/*formatted_eta*/\n    e[19]}` : \"\"\n  ), r, i;\n  return {\n    c() {\n      t = X(\n        /*formatted_timer*/\n        e[20]\n      ), r = X(n), i = X(\"s\");\n    },\n    m(o, l) {\n      C(o, t, l), C(o, r, l), C(o, i, l);\n    },\n    p(o, l) {\n      l[0] & /*formatted_timer*/\n      1048576 && Se(\n        t,\n        /*formatted_timer*/\n        o[20]\n      ), l[0] & /*eta, formatted_eta*/\n      524289 && n !== (n = /*eta*/\n      o[0] ? `/${/*formatted_eta*/\n      o[19]}` : \"\") && Se(r, n);\n    },\n    d(o) {\n      o && (B(t), B(r), B(i));\n    }\n  };\n}\nfunction p_(e) {\n  let t, n;\n  return t = new J0({\n    props: { margin: (\n      /*variant*/\n      e[8] === \"default\"\n    ) }\n  }), {\n    c() {\n      Y0(t.$$.fragment);\n    },\n    m(r, i) {\n      r_(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i[0] & /*variant*/\n      256 && (o.margin = /*variant*/\n      r[8] === \"default\"), t.$set(o);\n    },\n    i(r) {\n      n || (Ht(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Nt(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      $0(t, r);\n    }\n  };\n}\nfunction g_(e) {\n  let t, n, r, i, o, l = `${/*last_progress_level*/\n  e[15] * 100}%`, a = (\n    /*progress*/\n    e[7] != null && so(e)\n  );\n  return {\n    c() {\n      t = Fe(\"div\"), n = Fe(\"div\"), a && a.c(), r = Le(), i = Fe(\"div\"), o = Fe(\"div\"), Ie(n, \"class\", \"progress-level-inner svelte-1yserjw\"), Ie(o, \"class\", \"progress-bar svelte-1yserjw\"), Xe(o, \"width\", l), Ie(i, \"class\", \"progress-bar-wrap svelte-1yserjw\"), Ie(t, \"class\", \"progress-level svelte-1yserjw\");\n    },\n    m(s, u) {\n      C(s, t, u), it(t, n), a && a.m(n, null), it(t, r), it(t, i), it(i, o), e[30](o);\n    },\n    p(s, u) {\n      /*progress*/\n      s[7] != null ? a ? a.p(s, u) : (a = so(s), a.c(), a.m(n, null)) : a && (a.d(1), a = null), u[0] & /*last_progress_level*/\n      32768 && l !== (l = `${/*last_progress_level*/\n      s[15] * 100}%`) && Xe(o, \"width\", l);\n    },\n    i: Ur,\n    o: Ur,\n    d(s) {\n      s && B(t), a && a.d(), e[30](null);\n    }\n  };\n}\nfunction so(e) {\n  let t, n = Bn(\n    /*progress*/\n    e[7]\n  ), r = [];\n  for (let i = 0; i < n.length; i += 1)\n    r[i] = _o(to(e, n, i));\n  return {\n    c() {\n      for (let i = 0; i < r.length; i += 1)\n        r[i].c();\n      t = Ot();\n    },\n    m(i, o) {\n      for (let l = 0; l < r.length; l += 1)\n        r[l] && r[l].m(i, o);\n      C(i, t, o);\n    },\n    p(i, o) {\n      if (o[0] & /*progress_level, progress*/\n      16512) {\n        n = Bn(\n          /*progress*/\n          i[7]\n        );\n        let l;\n        for (l = 0; l < n.length; l += 1) {\n          const a = to(i, n, l);\n          r[l] ? r[l].p(a, o) : (r[l] = _o(a), r[l].c(), r[l].m(t.parentNode, t));\n        }\n        for (; l < r.length; l += 1)\n          r[l].d(1);\n        r.length = n.length;\n      }\n    },\n    d(i) {\n      i && B(t), Tl(r, i);\n    }\n  };\n}\nfunction ao(e) {\n  let t, n, r, i, o = (\n    /*i*/\n    e[40] !== 0 && b_()\n  ), l = (\n    /*p*/\n    e[38].desc != null && uo(e)\n  ), a = (\n    /*p*/\n    e[38].desc != null && /*progress_level*/\n    e[14] && /*progress_level*/\n    e[14][\n      /*i*/\n      e[40]\n    ] != null && fo()\n  ), s = (\n    /*progress_level*/\n    e[14] != null && co(e)\n  );\n  return {\n    c() {\n      o && o.c(), t = Le(), l && l.c(), n = Le(), a && a.c(), r = Le(), s && s.c(), i = Ot();\n    },\n    m(u, f) {\n      o && o.m(u, f), C(u, t, f), l && l.m(u, f), C(u, n, f), a && a.m(u, f), C(u, r, f), s && s.m(u, f), C(u, i, f);\n    },\n    p(u, f) {\n      /*p*/\n      u[38].desc != null ? l ? l.p(u, f) : (l = uo(u), l.c(), l.m(n.parentNode, n)) : l && (l.d(1), l = null), /*p*/\n      u[38].desc != null && /*progress_level*/\n      u[14] && /*progress_level*/\n      u[14][\n        /*i*/\n        u[40]\n      ] != null ? a || (a = fo(), a.c(), a.m(r.parentNode, r)) : a && (a.d(1), a = null), /*progress_level*/\n      u[14] != null ? s ? s.p(u, f) : (s = co(u), s.c(), s.m(i.parentNode, i)) : s && (s.d(1), s = null);\n    },\n    d(u) {\n      u && (B(t), B(n), B(r), B(i)), o && o.d(u), l && l.d(u), a && a.d(u), s && s.d(u);\n    }\n  };\n}\nfunction b_(e) {\n  let t;\n  return {\n    c() {\n      t = X(\" /\");\n    },\n    m(n, r) {\n      C(n, t, r);\n    },\n    d(n) {\n      n && B(t);\n    }\n  };\n}\nfunction uo(e) {\n  let t = (\n    /*p*/\n    e[38].desc + \"\"\n  ), n;\n  return {\n    c() {\n      n = X(t);\n    },\n    m(r, i) {\n      C(r, n, i);\n    },\n    p(r, i) {\n      i[0] & /*progress*/\n      128 && t !== (t = /*p*/\n      r[38].desc + \"\") && Se(n, t);\n    },\n    d(r) {\n      r && B(n);\n    }\n  };\n}\nfunction fo(e) {\n  let t;\n  return {\n    c() {\n      t = X(\"-\");\n    },\n    m(n, r) {\n      C(n, t, r);\n    },\n    d(n) {\n      n && B(t);\n    }\n  };\n}\nfunction co(e) {\n  let t = (100 * /*progress_level*/\n  (e[14][\n    /*i*/\n    e[40]\n  ] || 0)).toFixed(1) + \"\", n, r;\n  return {\n    c() {\n      n = X(t), r = X(\"%\");\n    },\n    m(i, o) {\n      C(i, n, o), C(i, r, o);\n    },\n    p(i, o) {\n      o[0] & /*progress_level*/\n      16384 && t !== (t = (100 * /*progress_level*/\n      (i[14][\n        /*i*/\n        i[40]\n      ] || 0)).toFixed(1) + \"\") && Se(n, t);\n    },\n    d(i) {\n      i && (B(n), B(r));\n    }\n  };\n}\nfunction _o(e) {\n  let t, n = (\n    /*p*/\n    (e[38].desc != null || /*progress_level*/\n    e[14] && /*progress_level*/\n    e[14][\n      /*i*/\n      e[40]\n    ] != null) && ao(e)\n  );\n  return {\n    c() {\n      n && n.c(), t = Ot();\n    },\n    m(r, i) {\n      n && n.m(r, i), C(r, t, i);\n    },\n    p(r, i) {\n      /*p*/\n      r[38].desc != null || /*progress_level*/\n      r[14] && /*progress_level*/\n      r[14][\n        /*i*/\n        r[40]\n      ] != null ? n ? n.p(r, i) : (n = ao(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);\n    },\n    d(r) {\n      r && B(t), n && n.d(r);\n    }\n  };\n}\nfunction ho(e) {\n  let t, n;\n  return {\n    c() {\n      t = Fe(\"p\"), n = X(\n        /*loading_text*/\n        e[9]\n      ), Ie(t, \"class\", \"loading svelte-1yserjw\");\n    },\n    m(r, i) {\n      C(r, t, i), it(t, n);\n    },\n    p(r, i) {\n      i[0] & /*loading_text*/\n      512 && Se(\n        n,\n        /*loading_text*/\n        r[9]\n      );\n    },\n    d(r) {\n      r && B(t);\n    }\n  };\n}\nfunction w_(e) {\n  let t, n, r, i, o;\n  const l = [f_, u_], a = [];\n  function s(u, f) {\n    return (\n      /*status*/\n      u[4] === \"pending\" ? 0 : (\n        /*status*/\n        u[4] === \"error\" ? 1 : -1\n      )\n    );\n  }\n  return ~(n = s(e)) && (r = a[n] = l[n](e)), {\n    c() {\n      t = Fe(\"div\"), r && r.c(), Ie(t, \"class\", i = \"wrap \" + /*variant*/\n      e[8] + \" \" + /*show_progress*/\n      e[6] + \" svelte-1yserjw\"), ve(t, \"hide\", !/*status*/\n      e[4] || /*status*/\n      e[4] === \"complete\" || /*show_progress*/\n      e[6] === \"hidden\"), ve(\n        t,\n        \"translucent\",\n        /*variant*/\n        e[8] === \"center\" && /*status*/\n        (e[4] === \"pending\" || /*status*/\n        e[4] === \"error\") || /*translucent*/\n        e[11] || /*show_progress*/\n        e[6] === \"minimal\"\n      ), ve(\n        t,\n        \"generating\",\n        /*status*/\n        e[4] === \"generating\"\n      ), ve(\n        t,\n        \"border\",\n        /*border*/\n        e[12]\n      ), Xe(\n        t,\n        \"position\",\n        /*absolute*/\n        e[10] ? \"absolute\" : \"static\"\n      ), Xe(\n        t,\n        \"padding\",\n        /*absolute*/\n        e[10] ? \"0\" : \"var(--size-8) 0\"\n      );\n    },\n    m(u, f) {\n      C(u, t, f), ~n && a[n].m(t, null), e[31](t), o = !0;\n    },\n    p(u, f) {\n      let c = n;\n      n = s(u), n === c ? ~n && a[n].p(u, f) : (r && (Al(), Nt(a[c], 1, 1, () => {\n        a[c] = null;\n      }), kl()), ~n ? (r = a[n], r ? r.p(u, f) : (r = a[n] = l[n](u), r.c()), Ht(r, 1), r.m(t, null)) : r = null), (!o || f[0] & /*variant, show_progress*/\n      320 && i !== (i = \"wrap \" + /*variant*/\n      u[8] + \" \" + /*show_progress*/\n      u[6] + \" svelte-1yserjw\")) && Ie(t, \"class\", i), (!o || f[0] & /*variant, show_progress, status, show_progress*/\n      336) && ve(t, \"hide\", !/*status*/\n      u[4] || /*status*/\n      u[4] === \"complete\" || /*show_progress*/\n      u[6] === \"hidden\"), (!o || f[0] & /*variant, show_progress, variant, status, translucent, show_progress*/\n      2384) && ve(\n        t,\n        \"translucent\",\n        /*variant*/\n        u[8] === \"center\" && /*status*/\n        (u[4] === \"pending\" || /*status*/\n        u[4] === \"error\") || /*translucent*/\n        u[11] || /*show_progress*/\n        u[6] === \"minimal\"\n      ), (!o || f[0] & /*variant, show_progress, status*/\n      336) && ve(\n        t,\n        \"generating\",\n        /*status*/\n        u[4] === \"generating\"\n      ), (!o || f[0] & /*variant, show_progress, border*/\n      4416) && ve(\n        t,\n        \"border\",\n        /*border*/\n        u[12]\n      ), f[0] & /*absolute*/\n      1024 && Xe(\n        t,\n        \"position\",\n        /*absolute*/\n        u[10] ? \"absolute\" : \"static\"\n      ), f[0] & /*absolute*/\n      1024 && Xe(\n        t,\n        \"padding\",\n        /*absolute*/\n        u[10] ? \"0\" : \"var(--size-8) 0\"\n      );\n    },\n    i(u) {\n      o || (Ht(r), o = !0);\n    },\n    o(u) {\n      Nt(r), o = !1;\n    },\n    d(u) {\n      u && B(t), ~n && a[n].d(), e[31](null);\n    }\n  };\n}\nlet _n = [], pr = !1;\nasync function v_(e, t = !0) {\n  if (!(window.__gradio_mode__ === \"website\" || window.__gradio_mode__ !== \"app\" && t !== !0)) {\n    if (_n.push(e), !pr)\n      pr = !0;\n    else\n      return;\n    await l_(), requestAnimationFrame(() => {\n      let n = [0, 0];\n      for (let r = 0; r < _n.length; r++) {\n        const o = _n[r].getBoundingClientRect();\n        (r === 0 || o.top + window.scrollY <= n[0]) && (n[0] = o.top + window.scrollY, n[1] = r);\n      }\n      window.scrollTo({ top: n[0] - 20, behavior: \"smooth\" }), pr = !1, _n = [];\n    });\n  }\n}\nfunction y_(e, t, n) {\n  let r, { $$slots: i = {}, $$scope: o } = t, { i18n: l } = t, { eta: a = null } = t, { queue_position: s } = t, { queue_size: u } = t, { status: f } = t, { scroll_to_output: c = !1 } = t, { timer: _ = !0 } = t, { show_progress: h = \"full\" } = t, { message: d = null } = t, { progress: p = null } = t, { variant: w = \"default\" } = t, { loading_text: v = \"Loading...\" } = t, { absolute: E = !0 } = t, { translucent: b = !1 } = t, { border: S = !1 } = t, { autoscroll: H } = t, g, Z = !1, P = 0, T = 0, k = null, ke = null, ue = 0, Te = null, Re, fe = null, pt = !0;\n  const Ze = () => {\n    n(0, a = n(26, k = n(19, A = null))), n(24, P = performance.now()), n(25, T = 0), Z = !0, gt();\n  };\n  function gt() {\n    requestAnimationFrame(() => {\n      n(25, T = (performance.now() - P) / 1e3), Z && gt();\n    });\n  }\n  function xe() {\n    n(25, T = 0), n(0, a = n(26, k = n(19, A = null))), Z && (Z = !1);\n  }\n  s_(() => {\n    Z && xe();\n  });\n  let A = null;\n  function W(m) {\n    $i[m ? \"unshift\" : \"push\"](() => {\n      fe = m, n(16, fe), n(7, p), n(14, Te), n(15, Re);\n    });\n  }\n  function J(m) {\n    $i[m ? \"unshift\" : \"push\"](() => {\n      g = m, n(13, g);\n    });\n  }\n  return e.$$set = (m) => {\n    \"i18n\" in m && n(1, l = m.i18n), \"eta\" in m && n(0, a = m.eta), \"queue_position\" in m && n(2, s = m.queue_position), \"queue_size\" in m && n(3, u = m.queue_size), \"status\" in m && n(4, f = m.status), \"scroll_to_output\" in m && n(21, c = m.scroll_to_output), \"timer\" in m && n(5, _ = m.timer), \"show_progress\" in m && n(6, h = m.show_progress), \"message\" in m && n(22, d = m.message), \"progress\" in m && n(7, p = m.progress), \"variant\" in m && n(8, w = m.variant), \"loading_text\" in m && n(9, v = m.loading_text), \"absolute\" in m && n(10, E = m.absolute), \"translucent\" in m && n(11, b = m.translucent), \"border\" in m && n(12, S = m.border), \"autoscroll\" in m && n(23, H = m.autoscroll), \"$$scope\" in m && n(28, o = m.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/\n    218103809 && (a === null && n(0, a = k), a != null && k !== a && (n(27, ke = (performance.now() - P) / 1e3 + a), n(19, A = ke.toFixed(1)), n(26, k = a))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/\n    167772160 && n(17, ue = ke === null || ke <= 0 || !T ? null : Math.min(T / ke, 1)), e.$$.dirty[0] & /*progress*/\n    128 && p != null && n(18, pt = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/\n    114816 && (p != null ? n(14, Te = p.map((m) => {\n      if (m.index != null && m.length != null)\n        return m.index / m.length;\n      if (m.progress != null)\n        return m.progress;\n    })) : n(14, Te = null), Te ? (n(15, Re = Te[Te.length - 1]), fe && (Re === 0 ? n(16, fe.style.transition = \"0\", fe) : n(16, fe.style.transition = \"150ms\", fe))) : n(15, Re = void 0)), e.$$.dirty[0] & /*status*/\n    16 && (f === \"pending\" ? Ze() : xe()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/\n    10493968 && g && c && (f === \"pending\" || f === \"complete\") && v_(g, H), e.$$.dirty[0] & /*status, message*/\n    4194320, e.$$.dirty[0] & /*timer_diff*/\n    33554432 && n(20, r = T.toFixed(1));\n  }, [\n    a,\n    l,\n    s,\n    u,\n    f,\n    _,\n    h,\n    p,\n    w,\n    v,\n    E,\n    b,\n    S,\n    g,\n    Te,\n    Re,\n    fe,\n    ue,\n    pt,\n    A,\n    r,\n    c,\n    d,\n    H,\n    P,\n    T,\n    k,\n    ke,\n    o,\n    i,\n    W,\n    J\n  ];\n}\nclass Bl extends Q0 {\n  constructor(t) {\n    super(), n_(\n      this,\n      t,\n      y_,\n      w_,\n      i_,\n      {\n        i18n: 1,\n        eta: 0,\n        queue_position: 2,\n        queue_size: 3,\n        status: 4,\n        scroll_to_output: 21,\n        timer: 5,\n        show_progress: 6,\n        message: 22,\n        progress: 7,\n        variant: 8,\n        loading_text: 9,\n        absolute: 10,\n        translucent: 11,\n        border: 12,\n        autoscroll: 23\n      },\n      null,\n      [-1, -1]\n    );\n  }\n}\nconst {\n  SvelteComponent: E_,\n  append: S_,\n  attr: k_,\n  detach: T_,\n  element: A_,\n  init: B_,\n  insert: C_,\n  noop: mo,\n  safe_not_equal: H_,\n  set_data: N_,\n  text: P_,\n  toggle_class: yt\n} = window.__gradio__svelte__internal;\nfunction I_(e) {\n  let t, n = (\n    /*value*/\n    (e[0] ? (\n      /*value*/\n      e[0]\n    ) : \"\") + \"\"\n  ), r;\n  return {\n    c() {\n      t = A_(\"div\"), r = P_(n), k_(t, \"class\", \"svelte-1gecy8w\"), yt(\n        t,\n        \"table\",\n        /*type*/\n        e[1] === \"table\"\n      ), yt(\n        t,\n        \"gallery\",\n        /*type*/\n        e[1] === \"gallery\"\n      ), yt(\n        t,\n        \"selected\",\n        /*selected*/\n        e[2]\n      );\n    },\n    m(i, o) {\n      C_(i, t, o), S_(t, r);\n    },\n    p(i, [o]) {\n      o & /*value*/\n      1 && n !== (n = /*value*/\n      (i[0] ? (\n        /*value*/\n        i[0]\n      ) : \"\") + \"\") && N_(r, n), o & /*type*/\n      2 && yt(\n        t,\n        \"table\",\n        /*type*/\n        i[1] === \"table\"\n      ), o & /*type*/\n      2 && yt(\n        t,\n        \"gallery\",\n        /*type*/\n        i[1] === \"gallery\"\n      ), o & /*selected*/\n      4 && yt(\n        t,\n        \"selected\",\n        /*selected*/\n        i[2]\n      );\n    },\n    i: mo,\n    o: mo,\n    d(i) {\n      i && T_(t);\n    }\n  };\n}\nfunction L_(e, t, n) {\n  let { value: r } = t, { type: i } = t, { selected: o = !1 } = t;\n  return e.$$set = (l) => {\n    \"value\" in l && n(0, r = l.value), \"type\" in l && n(1, i = l.type), \"selected\" in l && n(2, o = l.selected);\n  }, [r, i, o];\n}\nclass th extends E_ {\n  constructor(t) {\n    super(), B_(this, t, L_, I_, H_, { value: 0, type: 1, selected: 2 });\n  }\n}\nconst {\n  SvelteComponent: O_,\n  assign: Cl,\n  check_outros: Hl,\n  create_component: Oe,\n  destroy_component: De,\n  detach: Jt,\n  empty: Nl,\n  get_spread_object: Pl,\n  get_spread_update: Il,\n  group_outros: Ll,\n  init: D_,\n  insert: Qt,\n  mount_component: Me,\n  safe_not_equal: M_,\n  space: Yr,\n  transition_in: se,\n  transition_out: ae\n} = window.__gradio__svelte__internal;\nfunction R_(e) {\n  let t, n;\n  return t = new bo({\n    props: {\n      visible: (\n        /*visible*/\n        e[3]\n      ),\n      variant: (\n        /*value*/\n        e[0] === null ? \"dashed\" : \"solid\"\n      ),\n      border_mode: (\n        /*dragging*/\n        e[17] ? \"focus\" : \"base\"\n      ),\n      padding: !1,\n      elem_id: (\n        /*elem_id*/\n        e[1]\n      ),\n      elem_classes: (\n        /*elem_classes*/\n        e[2]\n      ),\n      container: (\n        /*container*/\n        e[9]\n      ),\n      scale: (\n        /*scale*/\n        e[10]\n      ),\n      min_width: (\n        /*min_width*/\n        e[11]\n      ),\n      height: (\n        /*height*/\n        e[13]\n      ),\n      $$slots: { default: [G_] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      Me(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*visible*/\n      8 && (o.visible = /*visible*/\n      r[3]), i & /*value*/\n      1 && (o.variant = /*value*/\n      r[0] === null ? \"dashed\" : \"solid\"), i & /*dragging*/\n      131072 && (o.border_mode = /*dragging*/\n      r[17] ? \"focus\" : \"base\"), i & /*elem_id*/\n      2 && (o.elem_id = /*elem_id*/\n      r[1]), i & /*elem_classes*/\n      4 && (o.elem_classes = /*elem_classes*/\n      r[2]), i & /*container*/\n      512 && (o.container = /*container*/\n      r[9]), i & /*scale*/\n      1024 && (o.scale = /*scale*/\n      r[10]), i & /*min_width*/\n      2048 && (o.min_width = /*min_width*/\n      r[11]), i & /*height*/\n      8192 && (o.height = /*height*/\n      r[13]), i & /*$$scope, label, show_label, root, clear_color, value, camera_position, zoom_speed, gradio, dragging, loading_status*/\n      8573425 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o);\n    },\n    i(r) {\n      n || (se(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ae(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      De(t, r);\n    }\n  };\n}\nfunction U_(e) {\n  let t, n;\n  return t = new bo({\n    props: {\n      visible: (\n        /*visible*/\n        e[3]\n      ),\n      variant: (\n        /*value*/\n        e[0] === null ? \"dashed\" : \"solid\"\n      ),\n      border_mode: (\n        /*dragging*/\n        e[17] ? \"focus\" : \"base\"\n      ),\n      padding: !1,\n      elem_id: (\n        /*elem_id*/\n        e[1]\n      ),\n      elem_classes: (\n        /*elem_classes*/\n        e[2]\n      ),\n      container: (\n        /*container*/\n        e[9]\n      ),\n      scale: (\n        /*scale*/\n        e[10]\n      ),\n      min_width: (\n        /*min_width*/\n        e[11]\n      ),\n      height: (\n        /*height*/\n        e[13]\n      ),\n      $$slots: { default: [V_] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      Me(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*visible*/\n      8 && (o.visible = /*visible*/\n      r[3]), i & /*value*/\n      1 && (o.variant = /*value*/\n      r[0] === null ? \"dashed\" : \"solid\"), i & /*dragging*/\n      131072 && (o.border_mode = /*dragging*/\n      r[17] ? \"focus\" : \"base\"), i & /*elem_id*/\n      2 && (o.elem_id = /*elem_id*/\n      r[1]), i & /*elem_classes*/\n      4 && (o.elem_classes = /*elem_classes*/\n      r[2]), i & /*container*/\n      512 && (o.container = /*container*/\n      r[9]), i & /*scale*/\n      1024 && (o.scale = /*scale*/\n      r[10]), i & /*min_width*/\n      2048 && (o.min_width = /*min_width*/\n      r[11]), i & /*height*/\n      8192 && (o.height = /*height*/\n      r[13]), i & /*$$scope, value, gradio, clear_color, label, show_label, camera_position, zoom_speed, loading_status*/\n      8442337 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o);\n    },\n    i(r) {\n      n || (se(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ae(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      De(t, r);\n    }\n  };\n}\nfunction F_(e) {\n  let t, n;\n  return t = new Ja({\n    props: {\n      i18n: (\n        /*gradio*/\n        e[12].i18n\n      ),\n      type: \"file\"\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      Me(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*gradio*/\n      4096 && (o.i18n = /*gradio*/\n      r[12].i18n), t.$set(o);\n    },\n    i(r) {\n      n || (se(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ae(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      De(t, r);\n    }\n  };\n}\nfunction G_(e) {\n  let t, n, r, i;\n  const o = [\n    {\n      autoscroll: (\n        /*gradio*/\n        e[12].autoscroll\n      )\n    },\n    { i18n: (\n      /*gradio*/\n      e[12].i18n\n    ) },\n    /*loading_status*/\n    e[6]\n  ];\n  let l = {};\n  for (let a = 0; a < o.length; a += 1)\n    l = Cl(l, o[a]);\n  return t = new Bl({ props: l }), r = new F0({\n    props: {\n      label: (\n        /*label*/\n        e[7]\n      ),\n      show_label: (\n        /*show_label*/\n        e[8]\n      ),\n      root: (\n        /*root*/\n        e[4]\n      ),\n      clear_color: (\n        /*clear_color*/\n        e[5]\n      ),\n      value: (\n        /*value*/\n        e[0]\n      ),\n      camera_position: (\n        /*camera_position*/\n        e[15]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        e[14]\n      ),\n      i18n: (\n        /*gradio*/\n        e[12].i18n\n      ),\n      $$slots: { default: [F_] },\n      $$scope: { ctx: e }\n    }\n  }), r.$on(\n    \"change\",\n    /*change_handler*/\n    e[18]\n  ), r.$on(\n    \"drag\",\n    /*drag_handler*/\n    e[19]\n  ), r.$on(\n    \"change\",\n    /*change_handler_1*/\n    e[20]\n  ), r.$on(\n    \"clear\",\n    /*clear_handler*/\n    e[21]\n  ), r.$on(\n    \"load\",\n    /*load_handler*/\n    e[22]\n  ), {\n    c() {\n      Oe(t.$$.fragment), n = Yr(), Oe(r.$$.fragment);\n    },\n    m(a, s) {\n      Me(t, a, s), Qt(a, n, s), Me(r, a, s), i = !0;\n    },\n    p(a, s) {\n      const u = s & /*gradio, loading_status*/\n      4160 ? Il(o, [\n        s & /*gradio*/\n        4096 && {\n          autoscroll: (\n            /*gradio*/\n            a[12].autoscroll\n          )\n        },\n        s & /*gradio*/\n        4096 && { i18n: (\n          /*gradio*/\n          a[12].i18n\n        ) },\n        s & /*loading_status*/\n        64 && Pl(\n          /*loading_status*/\n          a[6]\n        )\n      ]) : {};\n      t.$set(u);\n      const f = {};\n      s & /*label*/\n      128 && (f.label = /*label*/\n      a[7]), s & /*show_label*/\n      256 && (f.show_label = /*show_label*/\n      a[8]), s & /*root*/\n      16 && (f.root = /*root*/\n      a[4]), s & /*clear_color*/\n      32 && (f.clear_color = /*clear_color*/\n      a[5]), s & /*value*/\n      1 && (f.value = /*value*/\n      a[0]), s & /*camera_position*/\n      32768 && (f.camera_position = /*camera_position*/\n      a[15]), s & /*zoom_speed*/\n      16384 && (f.zoom_speed = /*zoom_speed*/\n      a[14]), s & /*gradio*/\n      4096 && (f.i18n = /*gradio*/\n      a[12].i18n), s & /*$$scope, gradio*/\n      8392704 && (f.$$scope = { dirty: s, ctx: a }), r.$set(f);\n    },\n    i(a) {\n      i || (se(t.$$.fragment, a), se(r.$$.fragment, a), i = !0);\n    },\n    o(a) {\n      ae(t.$$.fragment, a), ae(r.$$.fragment, a), i = !1;\n    },\n    d(a) {\n      a && Jt(n), De(t, a), De(r, a);\n    }\n  };\n}\nfunction j_(e) {\n  let t, n, r, i;\n  return t = new Fr({\n    props: {\n      show_label: (\n        /*show_label*/\n        e[8]\n      ),\n      Icon: Cn,\n      label: (\n        /*label*/\n        e[7] || \"3D Model\"\n      )\n    }\n  }), r = new zs({\n    props: {\n      unpadded_box: !0,\n      size: \"large\",\n      $$slots: { default: [z_] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment), n = Yr(), Oe(r.$$.fragment);\n    },\n    m(o, l) {\n      Me(t, o, l), Qt(o, n, l), Me(r, o, l), i = !0;\n    },\n    p(o, l) {\n      const a = {};\n      l & /*show_label*/\n      256 && (a.show_label = /*show_label*/\n      o[8]), l & /*label*/\n      128 && (a.label = /*label*/\n      o[7] || \"3D Model\"), t.$set(a);\n      const s = {};\n      l & /*$$scope*/\n      8388608 && (s.$$scope = { dirty: l, ctx: o }), r.$set(s);\n    },\n    i(o) {\n      i || (se(t.$$.fragment, o), se(r.$$.fragment, o), i = !0);\n    },\n    o(o) {\n      ae(t.$$.fragment, o), ae(r.$$.fragment, o), i = !1;\n    },\n    d(o) {\n      o && Jt(n), De(t, o), De(r, o);\n    }\n  };\n}\nfunction q_(e) {\n  let t, n;\n  return t = new lu({\n    props: {\n      value: (\n        /*value*/\n        e[0]\n      ),\n      i18n: (\n        /*gradio*/\n        e[12].i18n\n      ),\n      clear_color: (\n        /*clear_color*/\n        e[5]\n      ),\n      label: (\n        /*label*/\n        e[7]\n      ),\n      show_label: (\n        /*show_label*/\n        e[8]\n      ),\n      camera_position: (\n        /*camera_position*/\n        e[15]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        e[14]\n      )\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      Me(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*value*/\n      1 && (o.value = /*value*/\n      r[0]), i & /*gradio*/\n      4096 && (o.i18n = /*gradio*/\n      r[12].i18n), i & /*clear_color*/\n      32 && (o.clear_color = /*clear_color*/\n      r[5]), i & /*label*/\n      128 && (o.label = /*label*/\n      r[7]), i & /*show_label*/\n      256 && (o.show_label = /*show_label*/\n      r[8]), i & /*camera_position*/\n      32768 && (o.camera_position = /*camera_position*/\n      r[15]), i & /*zoom_speed*/\n      16384 && (o.zoom_speed = /*zoom_speed*/\n      r[14]), t.$set(o);\n    },\n    i(r) {\n      n || (se(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ae(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      De(t, r);\n    }\n  };\n}\nfunction z_(e) {\n  let t, n;\n  return t = new Cn({}), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      Me(t, r, i), n = !0;\n    },\n    i(r) {\n      n || (se(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ae(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      De(t, r);\n    }\n  };\n}\nfunction V_(e) {\n  let t, n, r, i, o, l;\n  const a = [\n    {\n      autoscroll: (\n        /*gradio*/\n        e[12].autoscroll\n      )\n    },\n    { i18n: (\n      /*gradio*/\n      e[12].i18n\n    ) },\n    /*loading_status*/\n    e[6]\n  ];\n  let s = {};\n  for (let _ = 0; _ < a.length; _ += 1)\n    s = Cl(s, a[_]);\n  t = new Bl({ props: s });\n  const u = [q_, j_], f = [];\n  function c(_, h) {\n    return (\n      /*value*/\n      _[0] ? 0 : 1\n    );\n  }\n  return r = c(e), i = f[r] = u[r](e), {\n    c() {\n      Oe(t.$$.fragment), n = Yr(), i.c(), o = Nl();\n    },\n    m(_, h) {\n      Me(t, _, h), Qt(_, n, h), f[r].m(_, h), Qt(_, o, h), l = !0;\n    },\n    p(_, h) {\n      const d = h & /*gradio, loading_status*/\n      4160 ? Il(a, [\n        h & /*gradio*/\n        4096 && {\n          autoscroll: (\n            /*gradio*/\n            _[12].autoscroll\n          )\n        },\n        h & /*gradio*/\n        4096 && { i18n: (\n          /*gradio*/\n          _[12].i18n\n        ) },\n        h & /*loading_status*/\n        64 && Pl(\n          /*loading_status*/\n          _[6]\n        )\n      ]) : {};\n      t.$set(d);\n      let p = r;\n      r = c(_), r === p ? f[r].p(_, h) : (Ll(), ae(f[p], 1, 1, () => {\n        f[p] = null;\n      }), Hl(), i = f[r], i ? i.p(_, h) : (i = f[r] = u[r](_), i.c()), se(i, 1), i.m(o.parentNode, o));\n    },\n    i(_) {\n      l || (se(t.$$.fragment, _), se(i), l = !0);\n    },\n    o(_) {\n      ae(t.$$.fragment, _), ae(i), l = !1;\n    },\n    d(_) {\n      _ && (Jt(n), Jt(o)), De(t, _), f[r].d(_);\n    }\n  };\n}\nfunction X_(e) {\n  let t, n, r, i;\n  const o = [U_, R_], l = [];\n  function a(s, u) {\n    return (\n      /*interactive*/\n      s[16] ? 1 : 0\n    );\n  }\n  return t = a(e), n = l[t] = o[t](e), {\n    c() {\n      n.c(), r = Nl();\n    },\n    m(s, u) {\n      l[t].m(s, u), Qt(s, r, u), i = !0;\n    },\n    p(s, [u]) {\n      let f = t;\n      t = a(s), t === f ? l[t].p(s, u) : (Ll(), ae(l[f], 1, 1, () => {\n        l[f] = null;\n      }), Hl(), n = l[t], n ? n.p(s, u) : (n = l[t] = o[t](s), n.c()), se(n, 1), n.m(r.parentNode, r));\n    },\n    i(s) {\n      i || (se(n), i = !0);\n    },\n    o(s) {\n      ae(n), i = !1;\n    },\n    d(s) {\n      s && Jt(r), l[t].d(s);\n    }\n  };\n}\nfunction W_(e, t, n) {\n  let { elem_id: r = \"\" } = t, { elem_classes: i = [] } = t, { visible: o = !0 } = t, { value: l = null } = t, { root: a } = t, { clear_color: s } = t, { loading_status: u } = t, { label: f } = t, { show_label: c } = t, { container: _ = !0 } = t, { scale: h = null } = t, { min_width: d = void 0 } = t, { gradio: p } = t, { height: w = void 0 } = t, { zoom_speed: v = 1 } = t, { camera_position: E = [null, null, null] } = t, { interactive: b } = t, S = !1;\n  const H = ({ detail: k }) => n(0, l = k), g = ({ detail: k }) => n(17, S = k), Z = ({ detail: k }) => p.dispatch(\"change\", k), P = () => {\n    n(0, l = null), p.dispatch(\"clear\");\n  }, T = ({ detail: k }) => {\n    n(0, l = k), p.dispatch(\"upload\");\n  };\n  return e.$$set = (k) => {\n    \"elem_id\" in k && n(1, r = k.elem_id), \"elem_classes\" in k && n(2, i = k.elem_classes), \"visible\" in k && n(3, o = k.visible), \"value\" in k && n(0, l = k.value), \"root\" in k && n(4, a = k.root), \"clear_color\" in k && n(5, s = k.clear_color), \"loading_status\" in k && n(6, u = k.loading_status), \"label\" in k && n(7, f = k.label), \"show_label\" in k && n(8, c = k.show_label), \"container\" in k && n(9, _ = k.container), \"scale\" in k && n(10, h = k.scale), \"min_width\" in k && n(11, d = k.min_width), \"gradio\" in k && n(12, p = k.gradio), \"height\" in k && n(13, w = k.height), \"zoom_speed\" in k && n(14, v = k.zoom_speed), \"camera_position\" in k && n(15, E = k.camera_position), \"interactive\" in k && n(16, b = k.interactive);\n  }, [\n    l,\n    r,\n    i,\n    o,\n    a,\n    s,\n    u,\n    f,\n    c,\n    _,\n    h,\n    d,\n    p,\n    w,\n    v,\n    E,\n    b,\n    S,\n    H,\n    g,\n    Z,\n    P,\n    T\n  ];\n}\nclass nh extends O_ {\n  constructor(t) {\n    super(), D_(this, t, W_, X_, M_, {\n      elem_id: 1,\n      elem_classes: 2,\n      visible: 3,\n      value: 0,\n      root: 4,\n      clear_color: 5,\n      loading_status: 6,\n      label: 7,\n      show_label: 8,\n      container: 9,\n      scale: 10,\n      min_width: 11,\n      gradio: 12,\n      height: 13,\n      zoom_speed: 14,\n      camera_position: 15,\n      interactive: 16\n    });\n  }\n}\nexport {\n  th as E,\n  nh as I,\n  F0 as M,\n  lu as a,\n  K_ as c,\n  Bu as g,\n  eh as r\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/__vite-browser-external-2447137e.js",
    "content": "const e = {};\nexport {\n  e as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/index.js",
    "content": "import { E as s, a as l, M as o, I as d } from \"./Index-f5583db3.js\";\nexport {\n  s as BaseExample,\n  l as BaseModel3D,\n  o as BaseModel3DUpload,\n  d as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/style.css",
    "content": ".block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1jp3vgd{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1jp3vgd{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1jp3vgd{color:var(--color-accent)}.icon.svelte-1jp3vgd:hover,.icon.svelte-1jp3vgd:focus{color:var(--color-accent)}.model3D.svelte-14rtuon{display:flex;position:relative;width:var(--size-full);height:var(--size-full)}.model3D.svelte-14rtuon canvas{width:var(--size-full);height:var(--size-full);object-fit:contain;overflow:hidden}.buttons.svelte-14rtuon{display:flex;position:absolute;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-5)}.wrap.svelte-cr2edf.svelte-cr2edf{overflow-y:auto;transition:opacity .5s ease-in-out;background:var(--block-background-fill);position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:var(--size-40);width:var(--size-full)}.wrap.svelte-cr2edf.svelte-cr2edf:after{content:\"\";position:absolute;top:0;left:0;width:var(--upload-progress-width);height:100%;transition:all .5s ease-in-out;z-index:1}.uploading.svelte-cr2edf.svelte-cr2edf{font-size:var(--text-lg);font-family:var(--font);z-index:2}.file-name.svelte-cr2edf.svelte-cr2edf{margin:var(--spacing-md);font-size:var(--text-lg);color:var(--body-text-color-subdued)}.file.svelte-cr2edf.svelte-cr2edf{font-size:var(--text-md);z-index:2;display:flex;align-items:center}.file.svelte-cr2edf progress.svelte-cr2edf{display:inline;height:var(--size-1);width:100%;transition:all .5s ease-in-out;color:var(--color-accent);border:none}.file.svelte-cr2edf progress[value].svelte-cr2edf::-webkit-progress-value{background-color:var(--color-accent);border-radius:20px}.file.svelte-cr2edf progress[value].svelte-cr2edf::-webkit-progress-bar{background-color:var(--border-color-accent);border-radius:20px}.progress-bar.svelte-cr2edf.svelte-cr2edf{width:14px;height:14px;border-radius:50%;background:radial-gradient(closest-side,var(--block-background-fill) 64%,transparent 53% 100%),conic-gradient(var(--color-accent) var(--upload-progress-width),var(--border-color-accent) 0);transition:all .5s ease-in-out}button.svelte-1aq8tno{cursor:pointer;width:var(--size-full)}.hidden.svelte-1aq8tno{display:none;height:0!important;position:absolute;width:0;flex-grow:0}.center.svelte-1aq8tno{display:flex;justify-content:center}.flex.svelte-1aq8tno{display:flex;justify-content:center;align-items:center}input.svelte-1aq8tno{display:none}div.svelte-1wj0ocy{display:flex;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-1)}.not-absolute.svelte-1wj0ocy{margin:var(--size-1)}.input-model.svelte-1oz8ks8{display:flex;position:relative;justify-content:center;align-items:center;width:var(--size-full);height:var(--size-full)}.input-model.svelte-1oz8ks8 canvas{width:var(--size-full);height:var(--size-full);object-fit:contain;overflow:hidden}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-1yserjw.svelte-1yserjw{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-top);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-1yserjw.svelte-1yserjw{top:0;right:0;left:0}.wrap.default.svelte-1yserjw.svelte-1yserjw{top:0;right:0;bottom:0;left:0}.hide.svelte-1yserjw.svelte-1yserjw{opacity:0;pointer-events:none}.generating.svelte-1yserjw.svelte-1yserjw{animation:svelte-1yserjw-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent;z-index:var(--layer-1)}.translucent.svelte-1yserjw.svelte-1yserjw{background:none}@keyframes svelte-1yserjw-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-1yserjw.svelte-1yserjw{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-1yserjw.svelte-1yserjw{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-1yserjw.svelte-1yserjw{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-1yserjw.svelte-1yserjw{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-1yserjw.svelte-1yserjw{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-1yserjw.svelte-1yserjw{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-1yserjw.svelte-1yserjw{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-1yserjw.svelte-1yserjw{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-1yserjw.svelte-1yserjw{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-1yserjw .progress-text.svelte-1yserjw{background:var(--block-background-fill)}.border.svelte-1yserjw.svelte-1yserjw{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}.gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/component/wrapper-6f348d45-19fa94bf.js",
    "content": "import S from \"./__vite-browser-external-2447137e.js\";\nfunction z(s) {\n  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, \"default\") ? s.default : s;\n}\nfunction gt(s) {\n  if (s.__esModule)\n    return s;\n  var e = s.default;\n  if (typeof e == \"function\") {\n    var t = function r() {\n      if (this instanceof r) {\n        var i = [null];\n        i.push.apply(i, arguments);\n        var n = Function.bind.apply(e, i);\n        return new n();\n      }\n      return e.apply(this, arguments);\n    };\n    t.prototype = e.prototype;\n  } else\n    t = {};\n  return Object.defineProperty(t, \"__esModule\", { value: !0 }), Object.keys(s).forEach(function(r) {\n    var i = Object.getOwnPropertyDescriptor(s, r);\n    Object.defineProperty(t, r, i.get ? i : {\n      enumerable: !0,\n      get: function() {\n        return s[r];\n      }\n    });\n  }), t;\n}\nconst { Duplex: yt } = S;\nfunction Oe(s) {\n  s.emit(\"close\");\n}\nfunction vt() {\n  !this.destroyed && this._writableState.finished && this.destroy();\n}\nfunction Qe(s) {\n  this.removeListener(\"error\", Qe), this.destroy(), this.listenerCount(\"error\") === 0 && this.emit(\"error\", s);\n}\nfunction St(s, e) {\n  let t = !0;\n  const r = new yt({\n    ...e,\n    autoDestroy: !1,\n    emitClose: !1,\n    objectMode: !1,\n    writableObjectMode: !1\n  });\n  return s.on(\"message\", function(n, o) {\n    const l = !o && r._readableState.objectMode ? n.toString() : n;\n    r.push(l) || s.pause();\n  }), s.once(\"error\", function(n) {\n    r.destroyed || (t = !1, r.destroy(n));\n  }), s.once(\"close\", function() {\n    r.destroyed || r.push(null);\n  }), r._destroy = function(i, n) {\n    if (s.readyState === s.CLOSED) {\n      n(i), process.nextTick(Oe, r);\n      return;\n    }\n    let o = !1;\n    s.once(\"error\", function(f) {\n      o = !0, n(f);\n    }), s.once(\"close\", function() {\n      o || n(i), process.nextTick(Oe, r);\n    }), t && s.terminate();\n  }, r._final = function(i) {\n    if (s.readyState === s.CONNECTING) {\n      s.once(\"open\", function() {\n        r._final(i);\n      });\n      return;\n    }\n    s._socket !== null && (s._socket._writableState.finished ? (i(), r._readableState.endEmitted && r.destroy()) : (s._socket.once(\"finish\", function() {\n      i();\n    }), s.close()));\n  }, r._read = function() {\n    s.isPaused && s.resume();\n  }, r._write = function(i, n, o) {\n    if (s.readyState === s.CONNECTING) {\n      s.once(\"open\", function() {\n        r._write(i, n, o);\n      });\n      return;\n    }\n    s.send(i, o);\n  }, r.on(\"end\", vt), r.on(\"error\", Qe), r;\n}\nvar Et = St;\nconst Vs = /* @__PURE__ */ z(Et);\nvar te = { exports: {} }, U = {\n  BINARY_TYPES: [\"nodebuffer\", \"arraybuffer\", \"fragments\"],\n  EMPTY_BUFFER: Buffer.alloc(0),\n  GUID: \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\",\n  kForOnEventAttribute: Symbol(\"kIsForOnEventAttribute\"),\n  kListener: Symbol(\"kListener\"),\n  kStatusCode: Symbol(\"status-code\"),\n  kWebSocket: Symbol(\"websocket\"),\n  NOOP: () => {\n  }\n}, bt, xt;\nconst { EMPTY_BUFFER: kt } = U, Se = Buffer[Symbol.species];\nfunction wt(s, e) {\n  if (s.length === 0)\n    return kt;\n  if (s.length === 1)\n    return s[0];\n  const t = Buffer.allocUnsafe(e);\n  let r = 0;\n  for (let i = 0; i < s.length; i++) {\n    const n = s[i];\n    t.set(n, r), r += n.length;\n  }\n  return r < e ? new Se(t.buffer, t.byteOffset, r) : t;\n}\nfunction Je(s, e, t, r, i) {\n  for (let n = 0; n < i; n++)\n    t[r + n] = s[n] ^ e[n & 3];\n}\nfunction et(s, e) {\n  for (let t = 0; t < s.length; t++)\n    s[t] ^= e[t & 3];\n}\nfunction Ot(s) {\n  return s.length === s.buffer.byteLength ? s.buffer : s.buffer.slice(s.byteOffset, s.byteOffset + s.length);\n}\nfunction Ee(s) {\n  if (Ee.readOnly = !0, Buffer.isBuffer(s))\n    return s;\n  let e;\n  return s instanceof ArrayBuffer ? e = new Se(s) : ArrayBuffer.isView(s) ? e = new Se(s.buffer, s.byteOffset, s.byteLength) : (e = Buffer.from(s), Ee.readOnly = !1), e;\n}\nte.exports = {\n  concat: wt,\n  mask: Je,\n  toArrayBuffer: Ot,\n  toBuffer: Ee,\n  unmask: et\n};\nif (!process.env.WS_NO_BUFFER_UTIL)\n  try {\n    const s = require(\"bufferutil\");\n    xt = te.exports.mask = function(e, t, r, i, n) {\n      n < 48 ? Je(e, t, r, i, n) : s.mask(e, t, r, i, n);\n    }, bt = te.exports.unmask = function(e, t) {\n      e.length < 32 ? et(e, t) : s.unmask(e, t);\n    };\n  } catch {\n  }\nvar ne = te.exports;\nconst Ce = Symbol(\"kDone\"), ue = Symbol(\"kRun\");\nlet Ct = class {\n  /**\n   * Creates a new `Limiter`.\n   *\n   * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n   *     to run concurrently\n   */\n  constructor(e) {\n    this[Ce] = () => {\n      this.pending--, this[ue]();\n    }, this.concurrency = e || 1 / 0, this.jobs = [], this.pending = 0;\n  }\n  /**\n   * Adds a job to the queue.\n   *\n   * @param {Function} job The job to run\n   * @public\n   */\n  add(e) {\n    this.jobs.push(e), this[ue]();\n  }\n  /**\n   * Removes a job from the queue and runs it if possible.\n   *\n   * @private\n   */\n  [ue]() {\n    if (this.pending !== this.concurrency && this.jobs.length) {\n      const e = this.jobs.shift();\n      this.pending++, e(this[Ce]);\n    }\n  }\n};\nvar Tt = Ct;\nconst W = S, Te = ne, Lt = Tt, { kStatusCode: tt } = U, Nt = Buffer[Symbol.species], Pt = Buffer.from([0, 0, 255, 255]), se = Symbol(\"permessage-deflate\"), w = Symbol(\"total-length\"), V = Symbol(\"callback\"), C = Symbol(\"buffers\"), J = Symbol(\"error\");\nlet K, Rt = class {\n  /**\n   * Creates a PerMessageDeflate instance.\n   *\n   * @param {Object} [options] Configuration options\n   * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n   *     for, or request, a custom client window size\n   * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n   *     acknowledge disabling of client context takeover\n   * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n   *     calls to zlib\n   * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n   *     use of a custom server window size\n   * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n   *     disabling of server context takeover\n   * @param {Number} [options.threshold=1024] Size (in bytes) below which\n   *     messages should not be compressed if context takeover is disabled\n   * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n   *     deflate\n   * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n   *     inflate\n   * @param {Boolean} [isServer=false] Create the instance in either server or\n   *     client mode\n   * @param {Number} [maxPayload=0] The maximum allowed message length\n   */\n  constructor(e, t, r) {\n    if (this._maxPayload = r | 0, this._options = e || {}, this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024, this._isServer = !!t, this._deflate = null, this._inflate = null, this.params = null, !K) {\n      const i = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10;\n      K = new Lt(i);\n    }\n  }\n  /**\n   * @type {String}\n   */\n  static get extensionName() {\n    return \"permessage-deflate\";\n  }\n  /**\n   * Create an extension negotiation offer.\n   *\n   * @return {Object} Extension parameters\n   * @public\n   */\n  offer() {\n    const e = {};\n    return this._options.serverNoContextTakeover && (e.server_no_context_takeover = !0), this._options.clientNoContextTakeover && (e.client_no_context_takeover = !0), this._options.serverMaxWindowBits && (e.server_max_window_bits = this._options.serverMaxWindowBits), this._options.clientMaxWindowBits ? e.client_max_window_bits = this._options.clientMaxWindowBits : this._options.clientMaxWindowBits == null && (e.client_max_window_bits = !0), e;\n  }\n  /**\n   * Accept an extension negotiation offer/response.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Object} Accepted configuration\n   * @public\n   */\n  accept(e) {\n    return e = this.normalizeParams(e), this.params = this._isServer ? this.acceptAsServer(e) : this.acceptAsClient(e), this.params;\n  }\n  /**\n   * Releases all resources used by the extension.\n   *\n   * @public\n   */\n  cleanup() {\n    if (this._inflate && (this._inflate.close(), this._inflate = null), this._deflate) {\n      const e = this._deflate[V];\n      this._deflate.close(), this._deflate = null, e && e(\n        new Error(\n          \"The deflate stream was closed while data was being processed\"\n        )\n      );\n    }\n  }\n  /**\n   *  Accept an extension negotiation offer.\n   *\n   * @param {Array} offers The extension negotiation offers\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsServer(e) {\n    const t = this._options, r = e.find((i) => !(t.serverNoContextTakeover === !1 && i.server_no_context_takeover || i.server_max_window_bits && (t.serverMaxWindowBits === !1 || typeof t.serverMaxWindowBits == \"number\" && t.serverMaxWindowBits > i.server_max_window_bits) || typeof t.clientMaxWindowBits == \"number\" && !i.client_max_window_bits));\n    if (!r)\n      throw new Error(\"None of the extension offers can be accepted\");\n    return t.serverNoContextTakeover && (r.server_no_context_takeover = !0), t.clientNoContextTakeover && (r.client_no_context_takeover = !0), typeof t.serverMaxWindowBits == \"number\" && (r.server_max_window_bits = t.serverMaxWindowBits), typeof t.clientMaxWindowBits == \"number\" ? r.client_max_window_bits = t.clientMaxWindowBits : (r.client_max_window_bits === !0 || t.clientMaxWindowBits === !1) && delete r.client_max_window_bits, r;\n  }\n  /**\n   * Accept the extension negotiation response.\n   *\n   * @param {Array} response The extension negotiation response\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsClient(e) {\n    const t = e[0];\n    if (this._options.clientNoContextTakeover === !1 && t.client_no_context_takeover)\n      throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n    if (!t.client_max_window_bits)\n      typeof this._options.clientMaxWindowBits == \"number\" && (t.client_max_window_bits = this._options.clientMaxWindowBits);\n    else if (this._options.clientMaxWindowBits === !1 || typeof this._options.clientMaxWindowBits == \"number\" && t.client_max_window_bits > this._options.clientMaxWindowBits)\n      throw new Error(\n        'Unexpected or invalid parameter \"client_max_window_bits\"'\n      );\n    return t;\n  }\n  /**\n   * Normalize parameters.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Array} The offers/response with normalized parameters\n   * @private\n   */\n  normalizeParams(e) {\n    return e.forEach((t) => {\n      Object.keys(t).forEach((r) => {\n        let i = t[r];\n        if (i.length > 1)\n          throw new Error(`Parameter \"${r}\" must have only a single value`);\n        if (i = i[0], r === \"client_max_window_bits\") {\n          if (i !== !0) {\n            const n = +i;\n            if (!Number.isInteger(n) || n < 8 || n > 15)\n              throw new TypeError(\n                `Invalid value for parameter \"${r}\": ${i}`\n              );\n            i = n;\n          } else if (!this._isServer)\n            throw new TypeError(\n              `Invalid value for parameter \"${r}\": ${i}`\n            );\n        } else if (r === \"server_max_window_bits\") {\n          const n = +i;\n          if (!Number.isInteger(n) || n < 8 || n > 15)\n            throw new TypeError(\n              `Invalid value for parameter \"${r}\": ${i}`\n            );\n          i = n;\n        } else if (r === \"client_no_context_takeover\" || r === \"server_no_context_takeover\") {\n          if (i !== !0)\n            throw new TypeError(\n              `Invalid value for parameter \"${r}\": ${i}`\n            );\n        } else\n          throw new Error(`Unknown parameter \"${r}\"`);\n        t[r] = i;\n      });\n    }), e;\n  }\n  /**\n   * Decompress data. Concurrency limited.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  decompress(e, t, r) {\n    K.add((i) => {\n      this._decompress(e, t, (n, o) => {\n        i(), r(n, o);\n      });\n    });\n  }\n  /**\n   * Compress data. Concurrency limited.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  compress(e, t, r) {\n    K.add((i) => {\n      this._compress(e, t, (n, o) => {\n        i(), r(n, o);\n      });\n    });\n  }\n  /**\n   * Decompress data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _decompress(e, t, r) {\n    const i = this._isServer ? \"client\" : \"server\";\n    if (!this._inflate) {\n      const n = `${i}_max_window_bits`, o = typeof this.params[n] != \"number\" ? W.Z_DEFAULT_WINDOWBITS : this.params[n];\n      this._inflate = W.createInflateRaw({\n        ...this._options.zlibInflateOptions,\n        windowBits: o\n      }), this._inflate[se] = this, this._inflate[w] = 0, this._inflate[C] = [], this._inflate.on(\"error\", Bt), this._inflate.on(\"data\", st);\n    }\n    this._inflate[V] = r, this._inflate.write(e), t && this._inflate.write(Pt), this._inflate.flush(() => {\n      const n = this._inflate[J];\n      if (n) {\n        this._inflate.close(), this._inflate = null, r(n);\n        return;\n      }\n      const o = Te.concat(\n        this._inflate[C],\n        this._inflate[w]\n      );\n      this._inflate._readableState.endEmitted ? (this._inflate.close(), this._inflate = null) : (this._inflate[w] = 0, this._inflate[C] = [], t && this.params[`${i}_no_context_takeover`] && this._inflate.reset()), r(null, o);\n    });\n  }\n  /**\n   * Compress data.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _compress(e, t, r) {\n    const i = this._isServer ? \"server\" : \"client\";\n    if (!this._deflate) {\n      const n = `${i}_max_window_bits`, o = typeof this.params[n] != \"number\" ? W.Z_DEFAULT_WINDOWBITS : this.params[n];\n      this._deflate = W.createDeflateRaw({\n        ...this._options.zlibDeflateOptions,\n        windowBits: o\n      }), this._deflate[w] = 0, this._deflate[C] = [], this._deflate.on(\"data\", Ut);\n    }\n    this._deflate[V] = r, this._deflate.write(e), this._deflate.flush(W.Z_SYNC_FLUSH, () => {\n      if (!this._deflate)\n        return;\n      let n = Te.concat(\n        this._deflate[C],\n        this._deflate[w]\n      );\n      t && (n = new Nt(n.buffer, n.byteOffset, n.length - 4)), this._deflate[V] = null, this._deflate[w] = 0, this._deflate[C] = [], t && this.params[`${i}_no_context_takeover`] && this._deflate.reset(), r(null, n);\n    });\n  }\n};\nvar oe = Rt;\nfunction Ut(s) {\n  this[C].push(s), this[w] += s.length;\n}\nfunction st(s) {\n  if (this[w] += s.length, this[se]._maxPayload < 1 || this[w] <= this[se]._maxPayload) {\n    this[C].push(s);\n    return;\n  }\n  this[J] = new RangeError(\"Max payload size exceeded\"), this[J].code = \"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH\", this[J][tt] = 1009, this.removeListener(\"data\", st), this.reset();\n}\nfunction Bt(s) {\n  this[se]._inflate = null, s[tt] = 1007, this[V](s);\n}\nvar re = { exports: {} };\nconst $t = {}, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n  __proto__: null,\n  default: $t\n}, Symbol.toStringTag, { value: \"Module\" })), It = /* @__PURE__ */ gt(Mt);\nvar Le;\nconst { isUtf8: Ne } = S, Dt = [\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  // 0 - 15\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  // 16 - 31\n  0,\n  1,\n  0,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  0,\n  1,\n  1,\n  0,\n  1,\n  1,\n  0,\n  // 32 - 47\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  // 48 - 63\n  0,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  // 64 - 79\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  0,\n  0,\n  1,\n  1,\n  // 80 - 95\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  // 96 - 111\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  1,\n  0,\n  1,\n  0\n  // 112 - 127\n];\nfunction Wt(s) {\n  return s >= 1e3 && s <= 1014 && s !== 1004 && s !== 1005 && s !== 1006 || s >= 3e3 && s <= 4999;\n}\nfunction be(s) {\n  const e = s.length;\n  let t = 0;\n  for (; t < e; )\n    if (!(s[t] & 128))\n      t++;\n    else if ((s[t] & 224) === 192) {\n      if (t + 1 === e || (s[t + 1] & 192) !== 128 || (s[t] & 254) === 192)\n        return !1;\n      t += 2;\n    } else if ((s[t] & 240) === 224) {\n      if (t + 2 >= e || (s[t + 1] & 192) !== 128 || (s[t + 2] & 192) !== 128 || s[t] === 224 && (s[t + 1] & 224) === 128 || // Overlong\n      s[t] === 237 && (s[t + 1] & 224) === 160)\n        return !1;\n      t += 3;\n    } else if ((s[t] & 248) === 240) {\n      if (t + 3 >= e || (s[t + 1] & 192) !== 128 || (s[t + 2] & 192) !== 128 || (s[t + 3] & 192) !== 128 || s[t] === 240 && (s[t + 1] & 240) === 128 || // Overlong\n      s[t] === 244 && s[t + 1] > 143 || s[t] > 244)\n        return !1;\n      t += 4;\n    } else\n      return !1;\n  return !0;\n}\nre.exports = {\n  isValidStatusCode: Wt,\n  isValidUTF8: be,\n  tokenChars: Dt\n};\nif (Ne)\n  Le = re.exports.isValidUTF8 = function(s) {\n    return s.length < 24 ? be(s) : Ne(s);\n  };\nelse if (!process.env.WS_NO_UTF_8_VALIDATE)\n  try {\n    const s = It;\n    Le = re.exports.isValidUTF8 = function(e) {\n      return e.length < 32 ? be(e) : s(e);\n    };\n  } catch {\n  }\nvar ae = re.exports;\nconst { Writable: At } = S, Pe = oe, {\n  BINARY_TYPES: Ft,\n  EMPTY_BUFFER: Re,\n  kStatusCode: jt,\n  kWebSocket: Gt\n} = U, { concat: de, toArrayBuffer: Vt, unmask: Ht } = ne, { isValidStatusCode: zt, isValidUTF8: Ue } = ae, X = Buffer[Symbol.species], A = 0, Be = 1, $e = 2, Me = 3, _e = 4, Yt = 5;\nlet qt = class extends At {\n  /**\n   * Creates a Receiver instance.\n   *\n   * @param {Object} [options] Options object\n   * @param {String} [options.binaryType=nodebuffer] The type for binary data\n   * @param {Object} [options.extensions] An object containing the negotiated\n   *     extensions\n   * @param {Boolean} [options.isServer=false] Specifies whether to operate in\n   *     client or server mode\n   * @param {Number} [options.maxPayload=0] The maximum allowed message length\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   */\n  constructor(e = {}) {\n    super(), this._binaryType = e.binaryType || Ft[0], this._extensions = e.extensions || {}, this._isServer = !!e.isServer, this._maxPayload = e.maxPayload | 0, this._skipUTF8Validation = !!e.skipUTF8Validation, this[Gt] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = !1, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = !1, this._fin = !1, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._fragments = [], this._state = A, this._loop = !1;\n  }\n  /**\n   * Implements `Writable.prototype._write()`.\n   *\n   * @param {Buffer} chunk The chunk of data to write\n   * @param {String} encoding The character encoding of `chunk`\n   * @param {Function} cb Callback\n   * @private\n   */\n  _write(e, t, r) {\n    if (this._opcode === 8 && this._state == A)\n      return r();\n    this._bufferedBytes += e.length, this._buffers.push(e), this.startLoop(r);\n  }\n  /**\n   * Consumes `n` bytes from the buffered data.\n   *\n   * @param {Number} n The number of bytes to consume\n   * @return {Buffer} The consumed bytes\n   * @private\n   */\n  consume(e) {\n    if (this._bufferedBytes -= e, e === this._buffers[0].length)\n      return this._buffers.shift();\n    if (e < this._buffers[0].length) {\n      const r = this._buffers[0];\n      return this._buffers[0] = new X(\n        r.buffer,\n        r.byteOffset + e,\n        r.length - e\n      ), new X(r.buffer, r.byteOffset, e);\n    }\n    const t = Buffer.allocUnsafe(e);\n    do {\n      const r = this._buffers[0], i = t.length - e;\n      e >= r.length ? t.set(this._buffers.shift(), i) : (t.set(new Uint8Array(r.buffer, r.byteOffset, e), i), this._buffers[0] = new X(\n        r.buffer,\n        r.byteOffset + e,\n        r.length - e\n      )), e -= r.length;\n    } while (e > 0);\n    return t;\n  }\n  /**\n   * Starts the parsing loop.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  startLoop(e) {\n    let t;\n    this._loop = !0;\n    do\n      switch (this._state) {\n        case A:\n          t = this.getInfo();\n          break;\n        case Be:\n          t = this.getPayloadLength16();\n          break;\n        case $e:\n          t = this.getPayloadLength64();\n          break;\n        case Me:\n          this.getMask();\n          break;\n        case _e:\n          t = this.getData(e);\n          break;\n        default:\n          this._loop = !1;\n          return;\n      }\n    while (this._loop);\n    e(t);\n  }\n  /**\n   * Reads the first two bytes of a frame.\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  getInfo() {\n    if (this._bufferedBytes < 2) {\n      this._loop = !1;\n      return;\n    }\n    const e = this.consume(2);\n    if (e[0] & 48)\n      return this._loop = !1, g(\n        RangeError,\n        \"RSV2 and RSV3 must be clear\",\n        !0,\n        1002,\n        \"WS_ERR_UNEXPECTED_RSV_2_3\"\n      );\n    const t = (e[0] & 64) === 64;\n    if (t && !this._extensions[Pe.extensionName])\n      return this._loop = !1, g(\n        RangeError,\n        \"RSV1 must be clear\",\n        !0,\n        1002,\n        \"WS_ERR_UNEXPECTED_RSV_1\"\n      );\n    if (this._fin = (e[0] & 128) === 128, this._opcode = e[0] & 15, this._payloadLength = e[1] & 127, this._opcode === 0) {\n      if (t)\n        return this._loop = !1, g(\n          RangeError,\n          \"RSV1 must be clear\",\n          !0,\n          1002,\n          \"WS_ERR_UNEXPECTED_RSV_1\"\n        );\n      if (!this._fragmented)\n        return this._loop = !1, g(\n          RangeError,\n          \"invalid opcode 0\",\n          !0,\n          1002,\n          \"WS_ERR_INVALID_OPCODE\"\n        );\n      this._opcode = this._fragmented;\n    } else if (this._opcode === 1 || this._opcode === 2) {\n      if (this._fragmented)\n        return this._loop = !1, g(\n          RangeError,\n          `invalid opcode ${this._opcode}`,\n          !0,\n          1002,\n          \"WS_ERR_INVALID_OPCODE\"\n        );\n      this._compressed = t;\n    } else if (this._opcode > 7 && this._opcode < 11) {\n      if (!this._fin)\n        return this._loop = !1, g(\n          RangeError,\n          \"FIN must be set\",\n          !0,\n          1002,\n          \"WS_ERR_EXPECTED_FIN\"\n        );\n      if (t)\n        return this._loop = !1, g(\n          RangeError,\n          \"RSV1 must be clear\",\n          !0,\n          1002,\n          \"WS_ERR_UNEXPECTED_RSV_1\"\n        );\n      if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1)\n        return this._loop = !1, g(\n          RangeError,\n          `invalid payload length ${this._payloadLength}`,\n          !0,\n          1002,\n          \"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH\"\n        );\n    } else\n      return this._loop = !1, g(\n        RangeError,\n        `invalid opcode ${this._opcode}`,\n        !0,\n        1002,\n        \"WS_ERR_INVALID_OPCODE\"\n      );\n    if (!this._fin && !this._fragmented && (this._fragmented = this._opcode), this._masked = (e[1] & 128) === 128, this._isServer) {\n      if (!this._masked)\n        return this._loop = !1, g(\n          RangeError,\n          \"MASK must be set\",\n          !0,\n          1002,\n          \"WS_ERR_EXPECTED_MASK\"\n        );\n    } else if (this._masked)\n      return this._loop = !1, g(\n        RangeError,\n        \"MASK must be clear\",\n        !0,\n        1002,\n        \"WS_ERR_UNEXPECTED_MASK\"\n      );\n    if (this._payloadLength === 126)\n      this._state = Be;\n    else if (this._payloadLength === 127)\n      this._state = $e;\n    else\n      return this.haveLength();\n  }\n  /**\n   * Gets extended payload length (7+16).\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  getPayloadLength16() {\n    if (this._bufferedBytes < 2) {\n      this._loop = !1;\n      return;\n    }\n    return this._payloadLength = this.consume(2).readUInt16BE(0), this.haveLength();\n  }\n  /**\n   * Gets extended payload length (7+64).\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  getPayloadLength64() {\n    if (this._bufferedBytes < 8) {\n      this._loop = !1;\n      return;\n    }\n    const e = this.consume(8), t = e.readUInt32BE(0);\n    return t > Math.pow(2, 21) - 1 ? (this._loop = !1, g(\n      RangeError,\n      \"Unsupported WebSocket frame: payload length > 2^53 - 1\",\n      !1,\n      1009,\n      \"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH\"\n    )) : (this._payloadLength = t * Math.pow(2, 32) + e.readUInt32BE(4), this.haveLength());\n  }\n  /**\n   * Payload length has been read.\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  haveLength() {\n    if (this._payloadLength && this._opcode < 8 && (this._totalPayloadLength += this._payloadLength, this._totalPayloadLength > this._maxPayload && this._maxPayload > 0))\n      return this._loop = !1, g(\n        RangeError,\n        \"Max payload size exceeded\",\n        !1,\n        1009,\n        \"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH\"\n      );\n    this._masked ? this._state = Me : this._state = _e;\n  }\n  /**\n   * Reads mask bytes.\n   *\n   * @private\n   */\n  getMask() {\n    if (this._bufferedBytes < 4) {\n      this._loop = !1;\n      return;\n    }\n    this._mask = this.consume(4), this._state = _e;\n  }\n  /**\n   * Reads data bytes.\n   *\n   * @param {Function} cb Callback\n   * @return {(Error|RangeError|undefined)} A possible error\n   * @private\n   */\n  getData(e) {\n    let t = Re;\n    if (this._payloadLength) {\n      if (this._bufferedBytes < this._payloadLength) {\n        this._loop = !1;\n        return;\n      }\n      t = this.consume(this._payloadLength), this._masked && this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3] && Ht(t, this._mask);\n    }\n    if (this._opcode > 7)\n      return this.controlMessage(t);\n    if (this._compressed) {\n      this._state = Yt, this.decompress(t, e);\n      return;\n    }\n    return t.length && (this._messageLength = this._totalPayloadLength, this._fragments.push(t)), this.dataMessage();\n  }\n  /**\n   * Decompresses data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Function} cb Callback\n   * @private\n   */\n  decompress(e, t) {\n    this._extensions[Pe.extensionName].decompress(e, this._fin, (i, n) => {\n      if (i)\n        return t(i);\n      if (n.length) {\n        if (this._messageLength += n.length, this._messageLength > this._maxPayload && this._maxPayload > 0)\n          return t(\n            g(\n              RangeError,\n              \"Max payload size exceeded\",\n              !1,\n              1009,\n              \"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH\"\n            )\n          );\n        this._fragments.push(n);\n      }\n      const o = this.dataMessage();\n      if (o)\n        return t(o);\n      this.startLoop(t);\n    });\n  }\n  /**\n   * Handles a data message.\n   *\n   * @return {(Error|undefined)} A possible error\n   * @private\n   */\n  dataMessage() {\n    if (this._fin) {\n      const e = this._messageLength, t = this._fragments;\n      if (this._totalPayloadLength = 0, this._messageLength = 0, this._fragmented = 0, this._fragments = [], this._opcode === 2) {\n        let r;\n        this._binaryType === \"nodebuffer\" ? r = de(t, e) : this._binaryType === \"arraybuffer\" ? r = Vt(de(t, e)) : r = t, this.emit(\"message\", r, !0);\n      } else {\n        const r = de(t, e);\n        if (!this._skipUTF8Validation && !Ue(r))\n          return this._loop = !1, g(\n            Error,\n            \"invalid UTF-8 sequence\",\n            !0,\n            1007,\n            \"WS_ERR_INVALID_UTF8\"\n          );\n        this.emit(\"message\", r, !1);\n      }\n    }\n    this._state = A;\n  }\n  /**\n   * Handles a control message.\n   *\n   * @param {Buffer} data Data to handle\n   * @return {(Error|RangeError|undefined)} A possible error\n   * @private\n   */\n  controlMessage(e) {\n    if (this._opcode === 8)\n      if (this._loop = !1, e.length === 0)\n        this.emit(\"conclude\", 1005, Re), this.end();\n      else {\n        const t = e.readUInt16BE(0);\n        if (!zt(t))\n          return g(\n            RangeError,\n            `invalid status code ${t}`,\n            !0,\n            1002,\n            \"WS_ERR_INVALID_CLOSE_CODE\"\n          );\n        const r = new X(\n          e.buffer,\n          e.byteOffset + 2,\n          e.length - 2\n        );\n        if (!this._skipUTF8Validation && !Ue(r))\n          return g(\n            Error,\n            \"invalid UTF-8 sequence\",\n            !0,\n            1007,\n            \"WS_ERR_INVALID_UTF8\"\n          );\n        this.emit(\"conclude\", t, r), this.end();\n      }\n    else\n      this._opcode === 9 ? this.emit(\"ping\", e) : this.emit(\"pong\", e);\n    this._state = A;\n  }\n};\nvar rt = qt;\nfunction g(s, e, t, r, i) {\n  const n = new s(\n    t ? `Invalid WebSocket frame: ${e}` : e\n  );\n  return Error.captureStackTrace(n, g), n.code = i, n[jt] = r, n;\n}\nconst qs = /* @__PURE__ */ z(rt), { randomFillSync: Kt } = S, Ie = oe, { EMPTY_BUFFER: Xt } = U, { isValidStatusCode: Zt } = ae, { mask: De, toBuffer: M } = ne, x = Symbol(\"kByteLength\"), Qt = Buffer.alloc(4);\nlet Jt = class P {\n  /**\n   * Creates a Sender instance.\n   *\n   * @param {(net.Socket|tls.Socket)} socket The connection socket\n   * @param {Object} [extensions] An object containing the negotiated extensions\n   * @param {Function} [generateMask] The function used to generate the masking\n   *     key\n   */\n  constructor(e, t, r) {\n    this._extensions = t || {}, r && (this._generateMask = r, this._maskBuffer = Buffer.alloc(4)), this._socket = e, this._firstFragment = !0, this._compress = !1, this._bufferedBytes = 0, this._deflating = !1, this._queue = [];\n  }\n  /**\n   * Frames a piece of data according to the HyBi WebSocket protocol.\n   *\n   * @param {(Buffer|String)} data The data to frame\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @return {(Buffer|String)[]} The framed data\n   * @public\n   */\n  static frame(e, t) {\n    let r, i = !1, n = 2, o = !1;\n    t.mask && (r = t.maskBuffer || Qt, t.generateMask ? t.generateMask(r) : Kt(r, 0, 4), o = (r[0] | r[1] | r[2] | r[3]) === 0, n = 6);\n    let l;\n    typeof e == \"string\" ? (!t.mask || o) && t[x] !== void 0 ? l = t[x] : (e = Buffer.from(e), l = e.length) : (l = e.length, i = t.mask && t.readOnly && !o);\n    let f = l;\n    l >= 65536 ? (n += 8, f = 127) : l > 125 && (n += 2, f = 126);\n    const a = Buffer.allocUnsafe(i ? l + n : n);\n    return a[0] = t.fin ? t.opcode | 128 : t.opcode, t.rsv1 && (a[0] |= 64), a[1] = f, f === 126 ? a.writeUInt16BE(l, 2) : f === 127 && (a[2] = a[3] = 0, a.writeUIntBE(l, 4, 6)), t.mask ? (a[1] |= 128, a[n - 4] = r[0], a[n - 3] = r[1], a[n - 2] = r[2], a[n - 1] = r[3], o ? [a, e] : i ? (De(e, r, a, n, l), [a]) : (De(e, r, e, 0, l), [a, e])) : [a, e];\n  }\n  /**\n   * Sends a close message to the other peer.\n   *\n   * @param {Number} [code] The status code component of the body\n   * @param {(String|Buffer)} [data] The message component of the body\n   * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  close(e, t, r, i) {\n    let n;\n    if (e === void 0)\n      n = Xt;\n    else {\n      if (typeof e != \"number\" || !Zt(e))\n        throw new TypeError(\"First argument must be a valid error code number\");\n      if (t === void 0 || !t.length)\n        n = Buffer.allocUnsafe(2), n.writeUInt16BE(e, 0);\n      else {\n        const l = Buffer.byteLength(t);\n        if (l > 123)\n          throw new RangeError(\"The message must not be greater than 123 bytes\");\n        n = Buffer.allocUnsafe(2 + l), n.writeUInt16BE(e, 0), typeof t == \"string\" ? n.write(t, 2) : n.set(t, 2);\n      }\n    }\n    const o = {\n      [x]: n.length,\n      fin: !0,\n      generateMask: this._generateMask,\n      mask: r,\n      maskBuffer: this._maskBuffer,\n      opcode: 8,\n      readOnly: !1,\n      rsv1: !1\n    };\n    this._deflating ? this.enqueue([this.dispatch, n, !1, o, i]) : this.sendFrame(P.frame(n, o), i);\n  }\n  /**\n   * Sends a ping message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  ping(e, t, r) {\n    let i, n;\n    if (typeof e == \"string\" ? (i = Buffer.byteLength(e), n = !1) : (e = M(e), i = e.length, n = M.readOnly), i > 125)\n      throw new RangeError(\"The data size must not be greater than 125 bytes\");\n    const o = {\n      [x]: i,\n      fin: !0,\n      generateMask: this._generateMask,\n      mask: t,\n      maskBuffer: this._maskBuffer,\n      opcode: 9,\n      readOnly: n,\n      rsv1: !1\n    };\n    this._deflating ? this.enqueue([this.dispatch, e, !1, o, r]) : this.sendFrame(P.frame(e, o), r);\n  }\n  /**\n   * Sends a pong message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  pong(e, t, r) {\n    let i, n;\n    if (typeof e == \"string\" ? (i = Buffer.byteLength(e), n = !1) : (e = M(e), i = e.length, n = M.readOnly), i > 125)\n      throw new RangeError(\"The data size must not be greater than 125 bytes\");\n    const o = {\n      [x]: i,\n      fin: !0,\n      generateMask: this._generateMask,\n      mask: t,\n      maskBuffer: this._maskBuffer,\n      opcode: 10,\n      readOnly: n,\n      rsv1: !1\n    };\n    this._deflating ? this.enqueue([this.dispatch, e, !1, o, r]) : this.sendFrame(P.frame(e, o), r);\n  }\n  /**\n   * Sends a data message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Object} options Options object\n   * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n   *     or text\n   * @param {Boolean} [options.compress=false] Specifies whether or not to\n   *     compress `data`\n   * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  send(e, t, r) {\n    const i = this._extensions[Ie.extensionName];\n    let n = t.binary ? 2 : 1, o = t.compress, l, f;\n    if (typeof e == \"string\" ? (l = Buffer.byteLength(e), f = !1) : (e = M(e), l = e.length, f = M.readOnly), this._firstFragment ? (this._firstFragment = !1, o && i && i.params[i._isServer ? \"server_no_context_takeover\" : \"client_no_context_takeover\"] && (o = l >= i._threshold), this._compress = o) : (o = !1, n = 0), t.fin && (this._firstFragment = !0), i) {\n      const a = {\n        [x]: l,\n        fin: t.fin,\n        generateMask: this._generateMask,\n        mask: t.mask,\n        maskBuffer: this._maskBuffer,\n        opcode: n,\n        readOnly: f,\n        rsv1: o\n      };\n      this._deflating ? this.enqueue([this.dispatch, e, this._compress, a, r]) : this.dispatch(e, this._compress, a, r);\n    } else\n      this.sendFrame(\n        P.frame(e, {\n          [x]: l,\n          fin: t.fin,\n          generateMask: this._generateMask,\n          mask: t.mask,\n          maskBuffer: this._maskBuffer,\n          opcode: n,\n          readOnly: f,\n          rsv1: !1\n        }),\n        r\n      );\n  }\n  /**\n   * Dispatches a message.\n   *\n   * @param {(Buffer|String)} data The message to send\n   * @param {Boolean} [compress=false] Specifies whether or not to compress\n   *     `data`\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  dispatch(e, t, r, i) {\n    if (!t) {\n      this.sendFrame(P.frame(e, r), i);\n      return;\n    }\n    const n = this._extensions[Ie.extensionName];\n    this._bufferedBytes += r[x], this._deflating = !0, n.compress(e, r.fin, (o, l) => {\n      if (this._socket.destroyed) {\n        const f = new Error(\n          \"The socket was closed while data was being compressed\"\n        );\n        typeof i == \"function\" && i(f);\n        for (let a = 0; a < this._queue.length; a++) {\n          const c = this._queue[a], h = c[c.length - 1];\n          typeof h == \"function\" && h(f);\n        }\n        return;\n      }\n      this._bufferedBytes -= r[x], this._deflating = !1, r.readOnly = !1, this.sendFrame(P.frame(l, r), i), this.dequeue();\n    });\n  }\n  /**\n   * Executes queued send operations.\n   *\n   * @private\n   */\n  dequeue() {\n    for (; !this._deflating && this._queue.length; ) {\n      const e = this._queue.shift();\n      this._bufferedBytes -= e[3][x], Reflect.apply(e[0], this, e.slice(1));\n    }\n  }\n  /**\n   * Enqueues a send operation.\n   *\n   * @param {Array} params Send operation parameters.\n   * @private\n   */\n  enqueue(e) {\n    this._bufferedBytes += e[3][x], this._queue.push(e);\n  }\n  /**\n   * Sends a frame.\n   *\n   * @param {Buffer[]} list The frame to send\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  sendFrame(e, t) {\n    e.length === 2 ? (this._socket.cork(), this._socket.write(e[0]), this._socket.write(e[1], t), this._socket.uncork()) : this._socket.write(e[0], t);\n  }\n};\nvar it = Jt;\nconst Ks = /* @__PURE__ */ z(it), { kForOnEventAttribute: F, kListener: pe } = U, We = Symbol(\"kCode\"), Ae = Symbol(\"kData\"), Fe = Symbol(\"kError\"), je = Symbol(\"kMessage\"), Ge = Symbol(\"kReason\"), I = Symbol(\"kTarget\"), Ve = Symbol(\"kType\"), He = Symbol(\"kWasClean\");\nclass B {\n  /**\n   * Create a new `Event`.\n   *\n   * @param {String} type The name of the event\n   * @throws {TypeError} If the `type` argument is not specified\n   */\n  constructor(e) {\n    this[I] = null, this[Ve] = e;\n  }\n  /**\n   * @type {*}\n   */\n  get target() {\n    return this[I];\n  }\n  /**\n   * @type {String}\n   */\n  get type() {\n    return this[Ve];\n  }\n}\nObject.defineProperty(B.prototype, \"target\", { enumerable: !0 });\nObject.defineProperty(B.prototype, \"type\", { enumerable: !0 });\nclass Y extends B {\n  /**\n   * Create a new `CloseEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {Number} [options.code=0] The status code explaining why the\n   *     connection was closed\n   * @param {String} [options.reason=''] A human-readable string explaining why\n   *     the connection was closed\n   * @param {Boolean} [options.wasClean=false] Indicates whether or not the\n   *     connection was cleanly closed\n   */\n  constructor(e, t = {}) {\n    super(e), this[We] = t.code === void 0 ? 0 : t.code, this[Ge] = t.reason === void 0 ? \"\" : t.reason, this[He] = t.wasClean === void 0 ? !1 : t.wasClean;\n  }\n  /**\n   * @type {Number}\n   */\n  get code() {\n    return this[We];\n  }\n  /**\n   * @type {String}\n   */\n  get reason() {\n    return this[Ge];\n  }\n  /**\n   * @type {Boolean}\n   */\n  get wasClean() {\n    return this[He];\n  }\n}\nObject.defineProperty(Y.prototype, \"code\", { enumerable: !0 });\nObject.defineProperty(Y.prototype, \"reason\", { enumerable: !0 });\nObject.defineProperty(Y.prototype, \"wasClean\", { enumerable: !0 });\nclass le extends B {\n  /**\n   * Create a new `ErrorEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.error=null] The error that generated this event\n   * @param {String} [options.message=''] The error message\n   */\n  constructor(e, t = {}) {\n    super(e), this[Fe] = t.error === void 0 ? null : t.error, this[je] = t.message === void 0 ? \"\" : t.message;\n  }\n  /**\n   * @type {*}\n   */\n  get error() {\n    return this[Fe];\n  }\n  /**\n   * @type {String}\n   */\n  get message() {\n    return this[je];\n  }\n}\nObject.defineProperty(le.prototype, \"error\", { enumerable: !0 });\nObject.defineProperty(le.prototype, \"message\", { enumerable: !0 });\nclass xe extends B {\n  /**\n   * Create a new `MessageEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.data=null] The message content\n   */\n  constructor(e, t = {}) {\n    super(e), this[Ae] = t.data === void 0 ? null : t.data;\n  }\n  /**\n   * @type {*}\n   */\n  get data() {\n    return this[Ae];\n  }\n}\nObject.defineProperty(xe.prototype, \"data\", { enumerable: !0 });\nconst es = {\n  /**\n   * Register an event listener.\n   *\n   * @param {String} type A string representing the event type to listen for\n   * @param {(Function|Object)} handler The listener to add\n   * @param {Object} [options] An options object specifies characteristics about\n   *     the event listener\n   * @param {Boolean} [options.once=false] A `Boolean` indicating that the\n   *     listener should be invoked at most once after being added. If `true`,\n   *     the listener would be automatically removed when invoked.\n   * @public\n   */\n  addEventListener(s, e, t = {}) {\n    for (const i of this.listeners(s))\n      if (!t[F] && i[pe] === e && !i[F])\n        return;\n    let r;\n    if (s === \"message\")\n      r = function(n, o) {\n        const l = new xe(\"message\", {\n          data: o ? n : n.toString()\n        });\n        l[I] = this, Z(e, this, l);\n      };\n    else if (s === \"close\")\n      r = function(n, o) {\n        const l = new Y(\"close\", {\n          code: n,\n          reason: o.toString(),\n          wasClean: this._closeFrameReceived && this._closeFrameSent\n        });\n        l[I] = this, Z(e, this, l);\n      };\n    else if (s === \"error\")\n      r = function(n) {\n        const o = new le(\"error\", {\n          error: n,\n          message: n.message\n        });\n        o[I] = this, Z(e, this, o);\n      };\n    else if (s === \"open\")\n      r = function() {\n        const n = new B(\"open\");\n        n[I] = this, Z(e, this, n);\n      };\n    else\n      return;\n    r[F] = !!t[F], r[pe] = e, t.once ? this.once(s, r) : this.on(s, r);\n  },\n  /**\n   * Remove an event listener.\n   *\n   * @param {String} type A string representing the event type to remove\n   * @param {(Function|Object)} handler The listener to remove\n   * @public\n   */\n  removeEventListener(s, e) {\n    for (const t of this.listeners(s))\n      if (t[pe] === e && !t[F]) {\n        this.removeListener(s, t);\n        break;\n      }\n  }\n};\nvar ts = {\n  CloseEvent: Y,\n  ErrorEvent: le,\n  Event: B,\n  EventTarget: es,\n  MessageEvent: xe\n};\nfunction Z(s, e, t) {\n  typeof s == \"object\" && s.handleEvent ? s.handleEvent.call(s, t) : s.call(e, t);\n}\nconst { tokenChars: j } = ae;\nfunction k(s, e, t) {\n  s[e] === void 0 ? s[e] = [t] : s[e].push(t);\n}\nfunction ss(s) {\n  const e = /* @__PURE__ */ Object.create(null);\n  let t = /* @__PURE__ */ Object.create(null), r = !1, i = !1, n = !1, o, l, f = -1, a = -1, c = -1, h = 0;\n  for (; h < s.length; h++)\n    if (a = s.charCodeAt(h), o === void 0)\n      if (c === -1 && j[a] === 1)\n        f === -1 && (f = h);\n      else if (h !== 0 && (a === 32 || a === 9))\n        c === -1 && f !== -1 && (c = h);\n      else if (a === 59 || a === 44) {\n        if (f === -1)\n          throw new SyntaxError(`Unexpected character at index ${h}`);\n        c === -1 && (c = h);\n        const v = s.slice(f, c);\n        a === 44 ? (k(e, v, t), t = /* @__PURE__ */ Object.create(null)) : o = v, f = c = -1;\n      } else\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n    else if (l === void 0)\n      if (c === -1 && j[a] === 1)\n        f === -1 && (f = h);\n      else if (a === 32 || a === 9)\n        c === -1 && f !== -1 && (c = h);\n      else if (a === 59 || a === 44) {\n        if (f === -1)\n          throw new SyntaxError(`Unexpected character at index ${h}`);\n        c === -1 && (c = h), k(t, s.slice(f, c), !0), a === 44 && (k(e, o, t), t = /* @__PURE__ */ Object.create(null), o = void 0), f = c = -1;\n      } else if (a === 61 && f !== -1 && c === -1)\n        l = s.slice(f, h), f = c = -1;\n      else\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n    else if (i) {\n      if (j[a] !== 1)\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n      f === -1 ? f = h : r || (r = !0), i = !1;\n    } else if (n)\n      if (j[a] === 1)\n        f === -1 && (f = h);\n      else if (a === 34 && f !== -1)\n        n = !1, c = h;\n      else if (a === 92)\n        i = !0;\n      else\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n    else if (a === 34 && s.charCodeAt(h - 1) === 61)\n      n = !0;\n    else if (c === -1 && j[a] === 1)\n      f === -1 && (f = h);\n    else if (f !== -1 && (a === 32 || a === 9))\n      c === -1 && (c = h);\n    else if (a === 59 || a === 44) {\n      if (f === -1)\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n      c === -1 && (c = h);\n      let v = s.slice(f, c);\n      r && (v = v.replace(/\\\\/g, \"\"), r = !1), k(t, l, v), a === 44 && (k(e, o, t), t = /* @__PURE__ */ Object.create(null), o = void 0), l = void 0, f = c = -1;\n    } else\n      throw new SyntaxError(`Unexpected character at index ${h}`);\n  if (f === -1 || n || a === 32 || a === 9)\n    throw new SyntaxError(\"Unexpected end of input\");\n  c === -1 && (c = h);\n  const p = s.slice(f, c);\n  return o === void 0 ? k(e, p, t) : (l === void 0 ? k(t, p, !0) : r ? k(t, l, p.replace(/\\\\/g, \"\")) : k(t, l, p), k(e, o, t)), e;\n}\nfunction rs(s) {\n  return Object.keys(s).map((e) => {\n    let t = s[e];\n    return Array.isArray(t) || (t = [t]), t.map((r) => [e].concat(\n      Object.keys(r).map((i) => {\n        let n = r[i];\n        return Array.isArray(n) || (n = [n]), n.map((o) => o === !0 ? i : `${i}=${o}`).join(\"; \");\n      })\n    ).join(\"; \")).join(\", \");\n  }).join(\", \");\n}\nvar nt = { format: rs, parse: ss };\nconst is = S, ns = S, os = S, ot = S, as = S, { randomBytes: ls, createHash: fs } = S, { URL: me } = S, T = oe, hs = rt, cs = it, {\n  BINARY_TYPES: ze,\n  EMPTY_BUFFER: Q,\n  GUID: us,\n  kForOnEventAttribute: ge,\n  kListener: ds,\n  kStatusCode: _s,\n  kWebSocket: y,\n  NOOP: at\n} = U, {\n  EventTarget: { addEventListener: ps, removeEventListener: ms }\n} = ts, { format: gs, parse: ys } = nt, { toBuffer: vs } = ne, Ss = 30 * 1e3, lt = Symbol(\"kAborted\"), ye = [8, 13], O = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], Es = /^[!#$%&'*+\\-.0-9A-Z^_`|a-z~]+$/;\nlet m = class d extends is {\n  /**\n   * Create a new `WebSocket`.\n   *\n   * @param {(String|URL)} address The URL to which to connect\n   * @param {(String|String[])} [protocols] The subprotocols\n   * @param {Object} [options] Connection options\n   */\n  constructor(e, t, r) {\n    super(), this._binaryType = ze[0], this._closeCode = 1006, this._closeFrameReceived = !1, this._closeFrameSent = !1, this._closeMessage = Q, this._closeTimer = null, this._extensions = {}, this._paused = !1, this._protocol = \"\", this._readyState = d.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, e !== null ? (this._bufferedAmount = 0, this._isServer = !1, this._redirects = 0, t === void 0 ? t = [] : Array.isArray(t) || (typeof t == \"object\" && t !== null ? (r = t, t = []) : t = [t]), ht(this, e, t, r)) : this._isServer = !0;\n  }\n  /**\n   * This deviates from the WHATWG interface since ws doesn't support the\n   * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n   * type).\n   *\n   * @type {String}\n   */\n  get binaryType() {\n    return this._binaryType;\n  }\n  set binaryType(e) {\n    ze.includes(e) && (this._binaryType = e, this._receiver && (this._receiver._binaryType = e));\n  }\n  /**\n   * @type {Number}\n   */\n  get bufferedAmount() {\n    return this._socket ? this._socket._writableState.length + this._sender._bufferedBytes : this._bufferedAmount;\n  }\n  /**\n   * @type {String}\n   */\n  get extensions() {\n    return Object.keys(this._extensions).join();\n  }\n  /**\n   * @type {Boolean}\n   */\n  get isPaused() {\n    return this._paused;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onclose() {\n    return null;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onerror() {\n    return null;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onopen() {\n    return null;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onmessage() {\n    return null;\n  }\n  /**\n   * @type {String}\n   */\n  get protocol() {\n    return this._protocol;\n  }\n  /**\n   * @type {Number}\n   */\n  get readyState() {\n    return this._readyState;\n  }\n  /**\n   * @type {String}\n   */\n  get url() {\n    return this._url;\n  }\n  /**\n   * Set up the socket and the internal resources.\n   *\n   * @param {(net.Socket|tls.Socket)} socket The network socket between the\n   *     server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Object} options Options object\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Number} [options.maxPayload=0] The maximum allowed message size\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @private\n   */\n  setSocket(e, t, r) {\n    const i = new hs({\n      binaryType: this.binaryType,\n      extensions: this._extensions,\n      isServer: this._isServer,\n      maxPayload: r.maxPayload,\n      skipUTF8Validation: r.skipUTF8Validation\n    });\n    this._sender = new cs(e, this._extensions, r.generateMask), this._receiver = i, this._socket = e, i[y] = this, e[y] = this, i.on(\"conclude\", ks), i.on(\"drain\", ws), i.on(\"error\", Os), i.on(\"message\", Cs), i.on(\"ping\", Ts), i.on(\"pong\", Ls), e.setTimeout(0), e.setNoDelay(), t.length > 0 && e.unshift(t), e.on(\"close\", ut), e.on(\"data\", fe), e.on(\"end\", dt), e.on(\"error\", _t), this._readyState = d.OPEN, this.emit(\"open\");\n  }\n  /**\n   * Emit the `'close'` event.\n   *\n   * @private\n   */\n  emitClose() {\n    if (!this._socket) {\n      this._readyState = d.CLOSED, this.emit(\"close\", this._closeCode, this._closeMessage);\n      return;\n    }\n    this._extensions[T.extensionName] && this._extensions[T.extensionName].cleanup(), this._receiver.removeAllListeners(), this._readyState = d.CLOSED, this.emit(\"close\", this._closeCode, this._closeMessage);\n  }\n  /**\n   * Start a closing handshake.\n   *\n   *          +----------+   +-----------+   +----------+\n   *     - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n   *    |     +----------+   +-----------+   +----------+     |\n   *          +----------+   +-----------+         |\n   * CLOSING  |ws.close()|<--|close frame|<--+-----+       CLOSING\n   *          +----------+   +-----------+   |\n   *    |           |                        |   +---+        |\n   *                +------------------------+-->|fin| - - - -\n   *    |         +---+                      |   +---+\n   *     - - - - -|fin|<---------------------+\n   *              +---+\n   *\n   * @param {Number} [code] Status code explaining why the connection is closing\n   * @param {(String|Buffer)} [data] The reason why the connection is\n   *     closing\n   * @public\n   */\n  close(e, t) {\n    if (this.readyState !== d.CLOSED) {\n      if (this.readyState === d.CONNECTING) {\n        b(this, this._req, \"WebSocket was closed before the connection was established\");\n        return;\n      }\n      if (this.readyState === d.CLOSING) {\n        this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end();\n        return;\n      }\n      this._readyState = d.CLOSING, this._sender.close(e, t, !this._isServer, (r) => {\n        r || (this._closeFrameSent = !0, (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end());\n      }), this._closeTimer = setTimeout(\n        this._socket.destroy.bind(this._socket),\n        Ss\n      );\n    }\n  }\n  /**\n   * Pause the socket.\n   *\n   * @public\n   */\n  pause() {\n    this.readyState === d.CONNECTING || this.readyState === d.CLOSED || (this._paused = !0, this._socket.pause());\n  }\n  /**\n   * Send a ping.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the ping is sent\n   * @public\n   */\n  ping(e, t, r) {\n    if (this.readyState === d.CONNECTING)\n      throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");\n    if (typeof e == \"function\" ? (r = e, e = t = void 0) : typeof t == \"function\" && (r = t, t = void 0), typeof e == \"number\" && (e = e.toString()), this.readyState !== d.OPEN) {\n      ve(this, e, r);\n      return;\n    }\n    t === void 0 && (t = !this._isServer), this._sender.ping(e || Q, t, r);\n  }\n  /**\n   * Send a pong.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the pong is sent\n   * @public\n   */\n  pong(e, t, r) {\n    if (this.readyState === d.CONNECTING)\n      throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");\n    if (typeof e == \"function\" ? (r = e, e = t = void 0) : typeof t == \"function\" && (r = t, t = void 0), typeof e == \"number\" && (e = e.toString()), this.readyState !== d.OPEN) {\n      ve(this, e, r);\n      return;\n    }\n    t === void 0 && (t = !this._isServer), this._sender.pong(e || Q, t, r);\n  }\n  /**\n   * Resume the socket.\n   *\n   * @public\n   */\n  resume() {\n    this.readyState === d.CONNECTING || this.readyState === d.CLOSED || (this._paused = !1, this._receiver._writableState.needDrain || this._socket.resume());\n  }\n  /**\n   * Send a data message.\n   *\n   * @param {*} data The message to send\n   * @param {Object} [options] Options object\n   * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n   *     text\n   * @param {Boolean} [options.compress] Specifies whether or not to compress\n   *     `data`\n   * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when data is written out\n   * @public\n   */\n  send(e, t, r) {\n    if (this.readyState === d.CONNECTING)\n      throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");\n    if (typeof t == \"function\" && (r = t, t = {}), typeof e == \"number\" && (e = e.toString()), this.readyState !== d.OPEN) {\n      ve(this, e, r);\n      return;\n    }\n    const i = {\n      binary: typeof e != \"string\",\n      mask: !this._isServer,\n      compress: !0,\n      fin: !0,\n      ...t\n    };\n    this._extensions[T.extensionName] || (i.compress = !1), this._sender.send(e || Q, i, r);\n  }\n  /**\n   * Forcibly close the connection.\n   *\n   * @public\n   */\n  terminate() {\n    if (this.readyState !== d.CLOSED) {\n      if (this.readyState === d.CONNECTING) {\n        b(this, this._req, \"WebSocket was closed before the connection was established\");\n        return;\n      }\n      this._socket && (this._readyState = d.CLOSING, this._socket.destroy());\n    }\n  }\n};\nObject.defineProperty(m, \"CONNECTING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(m.prototype, \"CONNECTING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(m, \"OPEN\", {\n  enumerable: !0,\n  value: O.indexOf(\"OPEN\")\n});\nObject.defineProperty(m.prototype, \"OPEN\", {\n  enumerable: !0,\n  value: O.indexOf(\"OPEN\")\n});\nObject.defineProperty(m, \"CLOSING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSING\")\n});\nObject.defineProperty(m.prototype, \"CLOSING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSING\")\n});\nObject.defineProperty(m, \"CLOSED\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSED\")\n});\nObject.defineProperty(m.prototype, \"CLOSED\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSED\")\n});\n[\n  \"binaryType\",\n  \"bufferedAmount\",\n  \"extensions\",\n  \"isPaused\",\n  \"protocol\",\n  \"readyState\",\n  \"url\"\n].forEach((s) => {\n  Object.defineProperty(m.prototype, s, { enumerable: !0 });\n});\n[\"open\", \"error\", \"close\", \"message\"].forEach((s) => {\n  Object.defineProperty(m.prototype, `on${s}`, {\n    enumerable: !0,\n    get() {\n      for (const e of this.listeners(s))\n        if (e[ge])\n          return e[ds];\n      return null;\n    },\n    set(e) {\n      for (const t of this.listeners(s))\n        if (t[ge]) {\n          this.removeListener(s, t);\n          break;\n        }\n      typeof e == \"function\" && this.addEventListener(s, e, {\n        [ge]: !0\n      });\n    }\n  });\n});\nm.prototype.addEventListener = ps;\nm.prototype.removeEventListener = ms;\nvar ft = m;\nfunction ht(s, e, t, r) {\n  const i = {\n    protocolVersion: ye[1],\n    maxPayload: 104857600,\n    skipUTF8Validation: !1,\n    perMessageDeflate: !0,\n    followRedirects: !1,\n    maxRedirects: 10,\n    ...r,\n    createConnection: void 0,\n    socketPath: void 0,\n    hostname: void 0,\n    protocol: void 0,\n    timeout: void 0,\n    method: \"GET\",\n    host: void 0,\n    path: void 0,\n    port: void 0\n  };\n  if (!ye.includes(i.protocolVersion))\n    throw new RangeError(\n      `Unsupported protocol version: ${i.protocolVersion} (supported versions: ${ye.join(\", \")})`\n    );\n  let n;\n  if (e instanceof me)\n    n = e, s._url = e.href;\n  else {\n    try {\n      n = new me(e);\n    } catch {\n      throw new SyntaxError(`Invalid URL: ${e}`);\n    }\n    s._url = e;\n  }\n  const o = n.protocol === \"wss:\", l = n.protocol === \"ws+unix:\";\n  let f;\n  if (n.protocol !== \"ws:\" && !o && !l ? f = `The URL's protocol must be one of \"ws:\", \"wss:\", or \"ws+unix:\"` : l && !n.pathname ? f = \"The URL's pathname is empty\" : n.hash && (f = \"The URL contains a fragment identifier\"), f) {\n    const u = new SyntaxError(f);\n    if (s._redirects === 0)\n      throw u;\n    ee(s, u);\n    return;\n  }\n  const a = o ? 443 : 80, c = ls(16).toString(\"base64\"), h = o ? ns.request : os.request, p = /* @__PURE__ */ new Set();\n  let v;\n  if (i.createConnection = o ? xs : bs, i.defaultPort = i.defaultPort || a, i.port = n.port || a, i.host = n.hostname.startsWith(\"[\") ? n.hostname.slice(1, -1) : n.hostname, i.headers = {\n    ...i.headers,\n    \"Sec-WebSocket-Version\": i.protocolVersion,\n    \"Sec-WebSocket-Key\": c,\n    Connection: \"Upgrade\",\n    Upgrade: \"websocket\"\n  }, i.path = n.pathname + n.search, i.timeout = i.handshakeTimeout, i.perMessageDeflate && (v = new T(\n    i.perMessageDeflate !== !0 ? i.perMessageDeflate : {},\n    !1,\n    i.maxPayload\n  ), i.headers[\"Sec-WebSocket-Extensions\"] = gs({\n    [T.extensionName]: v.offer()\n  })), t.length) {\n    for (const u of t) {\n      if (typeof u != \"string\" || !Es.test(u) || p.has(u))\n        throw new SyntaxError(\n          \"An invalid or duplicated subprotocol was specified\"\n        );\n      p.add(u);\n    }\n    i.headers[\"Sec-WebSocket-Protocol\"] = t.join(\",\");\n  }\n  if (i.origin && (i.protocolVersion < 13 ? i.headers[\"Sec-WebSocket-Origin\"] = i.origin : i.headers.Origin = i.origin), (n.username || n.password) && (i.auth = `${n.username}:${n.password}`), l) {\n    const u = i.path.split(\":\");\n    i.socketPath = u[0], i.path = u[1];\n  }\n  let _;\n  if (i.followRedirects) {\n    if (s._redirects === 0) {\n      s._originalIpc = l, s._originalSecure = o, s._originalHostOrSocketPath = l ? i.socketPath : n.host;\n      const u = r && r.headers;\n      if (r = { ...r, headers: {} }, u)\n        for (const [E, $] of Object.entries(u))\n          r.headers[E.toLowerCase()] = $;\n    } else if (s.listenerCount(\"redirect\") === 0) {\n      const u = l ? s._originalIpc ? i.socketPath === s._originalHostOrSocketPath : !1 : s._originalIpc ? !1 : n.host === s._originalHostOrSocketPath;\n      (!u || s._originalSecure && !o) && (delete i.headers.authorization, delete i.headers.cookie, u || delete i.headers.host, i.auth = void 0);\n    }\n    i.auth && !r.headers.authorization && (r.headers.authorization = \"Basic \" + Buffer.from(i.auth).toString(\"base64\")), _ = s._req = h(i), s._redirects && s.emit(\"redirect\", s.url, _);\n  } else\n    _ = s._req = h(i);\n  i.timeout && _.on(\"timeout\", () => {\n    b(s, _, \"Opening handshake has timed out\");\n  }), _.on(\"error\", (u) => {\n    _ === null || _[lt] || (_ = s._req = null, ee(s, u));\n  }), _.on(\"response\", (u) => {\n    const E = u.headers.location, $ = u.statusCode;\n    if (E && i.followRedirects && $ >= 300 && $ < 400) {\n      if (++s._redirects > i.maxRedirects) {\n        b(s, _, \"Maximum redirects exceeded\");\n        return;\n      }\n      _.abort();\n      let q;\n      try {\n        q = new me(E, e);\n      } catch {\n        const L = new SyntaxError(`Invalid URL: ${E}`);\n        ee(s, L);\n        return;\n      }\n      ht(s, q, t, r);\n    } else\n      s.emit(\"unexpected-response\", _, u) || b(\n        s,\n        _,\n        `Unexpected server response: ${u.statusCode}`\n      );\n  }), _.on(\"upgrade\", (u, E, $) => {\n    if (s.emit(\"upgrade\", u), s.readyState !== m.CONNECTING)\n      return;\n    if (_ = s._req = null, u.headers.upgrade.toLowerCase() !== \"websocket\") {\n      b(s, E, \"Invalid Upgrade header\");\n      return;\n    }\n    const q = fs(\"sha1\").update(c + us).digest(\"base64\");\n    if (u.headers[\"sec-websocket-accept\"] !== q) {\n      b(s, E, \"Invalid Sec-WebSocket-Accept header\");\n      return;\n    }\n    const D = u.headers[\"sec-websocket-protocol\"];\n    let L;\n    if (D !== void 0 ? p.size ? p.has(D) || (L = \"Server sent an invalid subprotocol\") : L = \"Server sent a subprotocol but none was requested\" : p.size && (L = \"Server sent no subprotocol\"), L) {\n      b(s, E, L);\n      return;\n    }\n    D && (s._protocol = D);\n    const ke = u.headers[\"sec-websocket-extensions\"];\n    if (ke !== void 0) {\n      if (!v) {\n        b(s, E, \"Server sent a Sec-WebSocket-Extensions header but no extension was requested\");\n        return;\n      }\n      let he;\n      try {\n        he = ys(ke);\n      } catch {\n        b(s, E, \"Invalid Sec-WebSocket-Extensions header\");\n        return;\n      }\n      const we = Object.keys(he);\n      if (we.length !== 1 || we[0] !== T.extensionName) {\n        b(s, E, \"Server indicated an extension that was not requested\");\n        return;\n      }\n      try {\n        v.accept(he[T.extensionName]);\n      } catch {\n        b(s, E, \"Invalid Sec-WebSocket-Extensions header\");\n        return;\n      }\n      s._extensions[T.extensionName] = v;\n    }\n    s.setSocket(E, $, {\n      generateMask: i.generateMask,\n      maxPayload: i.maxPayload,\n      skipUTF8Validation: i.skipUTF8Validation\n    });\n  }), i.finishRequest ? i.finishRequest(_, s) : _.end();\n}\nfunction ee(s, e) {\n  s._readyState = m.CLOSING, s.emit(\"error\", e), s.emitClose();\n}\nfunction bs(s) {\n  return s.path = s.socketPath, ot.connect(s);\n}\nfunction xs(s) {\n  return s.path = void 0, !s.servername && s.servername !== \"\" && (s.servername = ot.isIP(s.host) ? \"\" : s.host), as.connect(s);\n}\nfunction b(s, e, t) {\n  s._readyState = m.CLOSING;\n  const r = new Error(t);\n  Error.captureStackTrace(r, b), e.setHeader ? (e[lt] = !0, e.abort(), e.socket && !e.socket.destroyed && e.socket.destroy(), process.nextTick(ee, s, r)) : (e.destroy(r), e.once(\"error\", s.emit.bind(s, \"error\")), e.once(\"close\", s.emitClose.bind(s)));\n}\nfunction ve(s, e, t) {\n  if (e) {\n    const r = vs(e).length;\n    s._socket ? s._sender._bufferedBytes += r : s._bufferedAmount += r;\n  }\n  if (t) {\n    const r = new Error(\n      `WebSocket is not open: readyState ${s.readyState} (${O[s.readyState]})`\n    );\n    process.nextTick(t, r);\n  }\n}\nfunction ks(s, e) {\n  const t = this[y];\n  t._closeFrameReceived = !0, t._closeMessage = e, t._closeCode = s, t._socket[y] !== void 0 && (t._socket.removeListener(\"data\", fe), process.nextTick(ct, t._socket), s === 1005 ? t.close() : t.close(s, e));\n}\nfunction ws() {\n  const s = this[y];\n  s.isPaused || s._socket.resume();\n}\nfunction Os(s) {\n  const e = this[y];\n  e._socket[y] !== void 0 && (e._socket.removeListener(\"data\", fe), process.nextTick(ct, e._socket), e.close(s[_s])), e.emit(\"error\", s);\n}\nfunction Ye() {\n  this[y].emitClose();\n}\nfunction Cs(s, e) {\n  this[y].emit(\"message\", s, e);\n}\nfunction Ts(s) {\n  const e = this[y];\n  e.pong(s, !e._isServer, at), e.emit(\"ping\", s);\n}\nfunction Ls(s) {\n  this[y].emit(\"pong\", s);\n}\nfunction ct(s) {\n  s.resume();\n}\nfunction ut() {\n  const s = this[y];\n  this.removeListener(\"close\", ut), this.removeListener(\"data\", fe), this.removeListener(\"end\", dt), s._readyState = m.CLOSING;\n  let e;\n  !this._readableState.endEmitted && !s._closeFrameReceived && !s._receiver._writableState.errorEmitted && (e = s._socket.read()) !== null && s._receiver.write(e), s._receiver.end(), this[y] = void 0, clearTimeout(s._closeTimer), s._receiver._writableState.finished || s._receiver._writableState.errorEmitted ? s.emitClose() : (s._receiver.on(\"error\", Ye), s._receiver.on(\"finish\", Ye));\n}\nfunction fe(s) {\n  this[y]._receiver.write(s) || this.pause();\n}\nfunction dt() {\n  const s = this[y];\n  s._readyState = m.CLOSING, s._receiver.end(), this.end();\n}\nfunction _t() {\n  const s = this[y];\n  this.removeListener(\"error\", _t), this.on(\"error\", at), s && (s._readyState = m.CLOSING, this.destroy());\n}\nconst Xs = /* @__PURE__ */ z(ft), { tokenChars: Ns } = ae;\nfunction Ps(s) {\n  const e = /* @__PURE__ */ new Set();\n  let t = -1, r = -1, i = 0;\n  for (i; i < s.length; i++) {\n    const o = s.charCodeAt(i);\n    if (r === -1 && Ns[o] === 1)\n      t === -1 && (t = i);\n    else if (i !== 0 && (o === 32 || o === 9))\n      r === -1 && t !== -1 && (r = i);\n    else if (o === 44) {\n      if (t === -1)\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      r === -1 && (r = i);\n      const l = s.slice(t, r);\n      if (e.has(l))\n        throw new SyntaxError(`The \"${l}\" subprotocol is duplicated`);\n      e.add(l), t = r = -1;\n    } else\n      throw new SyntaxError(`Unexpected character at index ${i}`);\n  }\n  if (t === -1 || r !== -1)\n    throw new SyntaxError(\"Unexpected end of input\");\n  const n = s.slice(t, i);\n  if (e.has(n))\n    throw new SyntaxError(`The \"${n}\" subprotocol is duplicated`);\n  return e.add(n), e;\n}\nvar Rs = { parse: Ps };\nconst Us = S, ie = S, { createHash: Bs } = S, qe = nt, N = oe, $s = Rs, Ms = ft, { GUID: Is, kWebSocket: Ds } = U, Ws = /^[+/0-9A-Za-z]{22}==$/, Ke = 0, Xe = 1, pt = 2;\nclass As extends Us {\n  /**\n   * Create a `WebSocketServer` instance.\n   *\n   * @param {Object} options Configuration options\n   * @param {Number} [options.backlog=511] The maximum length of the queue of\n   *     pending connections\n   * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n   *     track clients\n   * @param {Function} [options.handleProtocols] A hook to handle protocols\n   * @param {String} [options.host] The hostname where to bind the server\n   * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n   *     size\n   * @param {Boolean} [options.noServer=false] Enable no server mode\n   * @param {String} [options.path] Accept only connections matching this path\n   * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n   *     permessage-deflate\n   * @param {Number} [options.port] The port where to bind the server\n   * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n   *     server to use\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @param {Function} [options.verifyClient] A hook to reject connections\n   * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`\n   *     class to use. It must be the `WebSocket` class or class that extends it\n   * @param {Function} [callback] A listener for the `listening` event\n   */\n  constructor(e, t) {\n    if (super(), e = {\n      maxPayload: 100 * 1024 * 1024,\n      skipUTF8Validation: !1,\n      perMessageDeflate: !1,\n      handleProtocols: null,\n      clientTracking: !0,\n      verifyClient: null,\n      noServer: !1,\n      backlog: null,\n      // use default (511 as implemented in net.js)\n      server: null,\n      host: null,\n      path: null,\n      port: null,\n      WebSocket: Ms,\n      ...e\n    }, e.port == null && !e.server && !e.noServer || e.port != null && (e.server || e.noServer) || e.server && e.noServer)\n      throw new TypeError(\n        'One and only one of the \"port\", \"server\", or \"noServer\" options must be specified'\n      );\n    if (e.port != null ? (this._server = ie.createServer((r, i) => {\n      const n = ie.STATUS_CODES[426];\n      i.writeHead(426, {\n        \"Content-Length\": n.length,\n        \"Content-Type\": \"text/plain\"\n      }), i.end(n);\n    }), this._server.listen(\n      e.port,\n      e.host,\n      e.backlog,\n      t\n    )) : e.server && (this._server = e.server), this._server) {\n      const r = this.emit.bind(this, \"connection\");\n      this._removeListeners = js(this._server, {\n        listening: this.emit.bind(this, \"listening\"),\n        error: this.emit.bind(this, \"error\"),\n        upgrade: (i, n, o) => {\n          this.handleUpgrade(i, n, o, r);\n        }\n      });\n    }\n    e.perMessageDeflate === !0 && (e.perMessageDeflate = {}), e.clientTracking && (this.clients = /* @__PURE__ */ new Set(), this._shouldEmitClose = !1), this.options = e, this._state = Ke;\n  }\n  /**\n   * Returns the bound address, the address family name, and port of the server\n   * as reported by the operating system if listening on an IP socket.\n   * If the server is listening on a pipe or UNIX domain socket, the name is\n   * returned as a string.\n   *\n   * @return {(Object|String|null)} The address of the server\n   * @public\n   */\n  address() {\n    if (this.options.noServer)\n      throw new Error('The server is operating in \"noServer\" mode');\n    return this._server ? this._server.address() : null;\n  }\n  /**\n   * Stop the server from accepting new connections and emit the `'close'` event\n   * when all existing connections are closed.\n   *\n   * @param {Function} [cb] A one-time listener for the `'close'` event\n   * @public\n   */\n  close(e) {\n    if (this._state === pt) {\n      e && this.once(\"close\", () => {\n        e(new Error(\"The server is not running\"));\n      }), process.nextTick(G, this);\n      return;\n    }\n    if (e && this.once(\"close\", e), this._state !== Xe)\n      if (this._state = Xe, this.options.noServer || this.options.server)\n        this._server && (this._removeListeners(), this._removeListeners = this._server = null), this.clients ? this.clients.size ? this._shouldEmitClose = !0 : process.nextTick(G, this) : process.nextTick(G, this);\n      else {\n        const t = this._server;\n        this._removeListeners(), this._removeListeners = this._server = null, t.close(() => {\n          G(this);\n        });\n      }\n  }\n  /**\n   * See if a given request should be handled by this server instance.\n   *\n   * @param {http.IncomingMessage} req Request object to inspect\n   * @return {Boolean} `true` if the request is valid, else `false`\n   * @public\n   */\n  shouldHandle(e) {\n    if (this.options.path) {\n      const t = e.url.indexOf(\"?\");\n      if ((t !== -1 ? e.url.slice(0, t) : e.url) !== this.options.path)\n        return !1;\n    }\n    return !0;\n  }\n  /**\n   * Handle a HTTP Upgrade request.\n   *\n   * @param {http.IncomingMessage} req The request object\n   * @param {(net.Socket|tls.Socket)} socket The network socket between the\n   *     server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @public\n   */\n  handleUpgrade(e, t, r, i) {\n    t.on(\"error\", Ze);\n    const n = e.headers[\"sec-websocket-key\"], o = +e.headers[\"sec-websocket-version\"];\n    if (e.method !== \"GET\") {\n      R(this, e, t, 405, \"Invalid HTTP method\");\n      return;\n    }\n    if (e.headers.upgrade.toLowerCase() !== \"websocket\") {\n      R(this, e, t, 400, \"Invalid Upgrade header\");\n      return;\n    }\n    if (!n || !Ws.test(n)) {\n      R(this, e, t, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n      return;\n    }\n    if (o !== 8 && o !== 13) {\n      R(this, e, t, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n      return;\n    }\n    if (!this.shouldHandle(e)) {\n      H(t, 400);\n      return;\n    }\n    const l = e.headers[\"sec-websocket-protocol\"];\n    let f = /* @__PURE__ */ new Set();\n    if (l !== void 0)\n      try {\n        f = $s.parse(l);\n      } catch {\n        R(this, e, t, 400, \"Invalid Sec-WebSocket-Protocol header\");\n        return;\n      }\n    const a = e.headers[\"sec-websocket-extensions\"], c = {};\n    if (this.options.perMessageDeflate && a !== void 0) {\n      const h = new N(\n        this.options.perMessageDeflate,\n        !0,\n        this.options.maxPayload\n      );\n      try {\n        const p = qe.parse(a);\n        p[N.extensionName] && (h.accept(p[N.extensionName]), c[N.extensionName] = h);\n      } catch {\n        R(this, e, t, 400, \"Invalid or unacceptable Sec-WebSocket-Extensions header\");\n        return;\n      }\n    }\n    if (this.options.verifyClient) {\n      const h = {\n        origin: e.headers[`${o === 8 ? \"sec-websocket-origin\" : \"origin\"}`],\n        secure: !!(e.socket.authorized || e.socket.encrypted),\n        req: e\n      };\n      if (this.options.verifyClient.length === 2) {\n        this.options.verifyClient(h, (p, v, _, u) => {\n          if (!p)\n            return H(t, v || 401, _, u);\n          this.completeUpgrade(\n            c,\n            n,\n            f,\n            e,\n            t,\n            r,\n            i\n          );\n        });\n        return;\n      }\n      if (!this.options.verifyClient(h))\n        return H(t, 401);\n    }\n    this.completeUpgrade(c, n, f, e, t, r, i);\n  }\n  /**\n   * Upgrade the connection to WebSocket.\n   *\n   * @param {Object} extensions The accepted extensions\n   * @param {String} key The value of the `Sec-WebSocket-Key` header\n   * @param {Set} protocols The subprotocols\n   * @param {http.IncomingMessage} req The request object\n   * @param {(net.Socket|tls.Socket)} socket The network socket between the\n   *     server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @throws {Error} If called more than once with the same socket\n   * @private\n   */\n  completeUpgrade(e, t, r, i, n, o, l) {\n    if (!n.readable || !n.writable)\n      return n.destroy();\n    if (n[Ds])\n      throw new Error(\n        \"server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration\"\n      );\n    if (this._state > Ke)\n      return H(n, 503);\n    const a = [\n      \"HTTP/1.1 101 Switching Protocols\",\n      \"Upgrade: websocket\",\n      \"Connection: Upgrade\",\n      `Sec-WebSocket-Accept: ${Bs(\"sha1\").update(t + Is).digest(\"base64\")}`\n    ], c = new this.options.WebSocket(null);\n    if (r.size) {\n      const h = this.options.handleProtocols ? this.options.handleProtocols(r, i) : r.values().next().value;\n      h && (a.push(`Sec-WebSocket-Protocol: ${h}`), c._protocol = h);\n    }\n    if (e[N.extensionName]) {\n      const h = e[N.extensionName].params, p = qe.format({\n        [N.extensionName]: [h]\n      });\n      a.push(`Sec-WebSocket-Extensions: ${p}`), c._extensions = e;\n    }\n    this.emit(\"headers\", a, i), n.write(a.concat(`\\r\n`).join(`\\r\n`)), n.removeListener(\"error\", Ze), c.setSocket(n, o, {\n      maxPayload: this.options.maxPayload,\n      skipUTF8Validation: this.options.skipUTF8Validation\n    }), this.clients && (this.clients.add(c), c.on(\"close\", () => {\n      this.clients.delete(c), this._shouldEmitClose && !this.clients.size && process.nextTick(G, this);\n    })), l(c, i);\n  }\n}\nvar Fs = As;\nfunction js(s, e) {\n  for (const t of Object.keys(e))\n    s.on(t, e[t]);\n  return function() {\n    for (const r of Object.keys(e))\n      s.removeListener(r, e[r]);\n  };\n}\nfunction G(s) {\n  s._state = pt, s.emit(\"close\");\n}\nfunction Ze() {\n  this.destroy();\n}\nfunction H(s, e, t, r) {\n  t = t || ie.STATUS_CODES[e], r = {\n    Connection: \"close\",\n    \"Content-Type\": \"text/html\",\n    \"Content-Length\": Buffer.byteLength(t),\n    ...r\n  }, s.once(\"finish\", s.destroy), s.end(\n    `HTTP/1.1 ${e} ${ie.STATUS_CODES[e]}\\r\n` + Object.keys(r).map((i) => `${i}: ${r[i]}`).join(`\\r\n`) + `\\r\n\\r\n` + t\n  );\n}\nfunction R(s, e, t, r, i) {\n  if (s.listenerCount(\"wsClientError\")) {\n    const n = new Error(i);\n    Error.captureStackTrace(n, R), s.emit(\"wsClientError\", n, t, e);\n  } else\n    H(t, r, i);\n}\nconst Zs = /* @__PURE__ */ z(Fs);\nexport {\n  qs as Receiver,\n  Ks as Sender,\n  Xs as WebSocket,\n  Zs as WebSocketServer,\n  Vs as createWebSocketStream,\n  Xs as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/example/index.js",
    "content": "const {\n  SvelteComponent: u,\n  append: c,\n  attr: d,\n  detach: g,\n  element: v,\n  init: o,\n  insert: r,\n  noop: f,\n  safe_not_equal: y,\n  set_data: m,\n  text: b,\n  toggle_class: _\n} = window.__gradio__svelte__internal;\nfunction w(a) {\n  let e, n = (\n    /*value*/\n    (a[0] ? (\n      /*value*/\n      a[0]\n    ) : \"\") + \"\"\n  ), s;\n  return {\n    c() {\n      e = v(\"div\"), s = b(n), d(e, \"class\", \"svelte-1gecy8w\"), _(\n        e,\n        \"table\",\n        /*type*/\n        a[1] === \"table\"\n      ), _(\n        e,\n        \"gallery\",\n        /*type*/\n        a[1] === \"gallery\"\n      ), _(\n        e,\n        \"selected\",\n        /*selected*/\n        a[2]\n      );\n    },\n    m(t, l) {\n      r(t, e, l), c(e, s);\n    },\n    p(t, [l]) {\n      l & /*value*/\n      1 && n !== (n = /*value*/\n      (t[0] ? (\n        /*value*/\n        t[0]\n      ) : \"\") + \"\") && m(s, n), l & /*type*/\n      2 && _(\n        e,\n        \"table\",\n        /*type*/\n        t[1] === \"table\"\n      ), l & /*type*/\n      2 && _(\n        e,\n        \"gallery\",\n        /*type*/\n        t[1] === \"gallery\"\n      ), l & /*selected*/\n      4 && _(\n        e,\n        \"selected\",\n        /*selected*/\n        t[2]\n      );\n    },\n    i: f,\n    o: f,\n    d(t) {\n      t && g(e);\n    }\n  };\n}\nfunction h(a, e, n) {\n  let { value: s } = e, { type: t } = e, { selected: l = !1 } = e;\n  return a.$$set = (i) => {\n    \"value\" in i && n(0, s = i.value), \"type\" in i && n(1, t = i.type), \"selected\" in i && n(2, l = i.selected);\n  }, [s, t, l];\n}\nclass E extends u {\n  constructor(e) {\n    super(), o(this, e, h, w, y, { value: 0, type: 1, selected: 2 });\n  }\n}\nexport {\n  E as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_customgs/templates/example/style.css",
    "content": ".gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/__init__.py",
    "content": "from .custommodel3d import CustomModel3D\n\n__all__ = ['CustomModel3D']\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/custommodel3d.py",
    "content": "\"\"\"gr.Model3D() component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom pathlib import Path\nfrom typing import Callable\n\nfrom gradio_client.documentation import document\n\nfrom gradio.components.base import Component\nfrom gradio.data_classes import FileData\nfrom gradio.events import Events\n\n\nclass CustomModel3D(Component):\n    \"\"\"\n    Creates a component allows users to upload or view 3D Model files (.glb).\n\n    Demos: model3D\n    Guides: how-to-use-3D-model-component\n    \"\"\"\n\n    EVENTS = [Events.change, Events.upload, Events.edit, Events.clear]\n\n    data_model = FileData\n\n    def __init__(\n        self,\n        value: str | Callable | None = None,\n        *,\n        clear_color: tuple[float, float, float, float] | None = None,\n        camera_position: tuple[\n            int | float | None, int | float | None, int | float | None\n        ] = (\n            None,\n            None,\n            None,\n        ),\n        zoom_speed: float = 1,\n        pan_speed: float = 1,\n        height: int | str | None = None,\n        label: str | None = None,\n        show_label: bool | None = None,\n        every: float | None = None,\n        container: bool = True,\n        scale: int | None = None,\n        min_width: int = 160,\n        interactive: bool | None = None,\n        visible: bool = True,\n        elem_id: str | None = None,\n        elem_classes: list[str] | str | None = None,\n        render: bool = True,\n    ):\n        \"\"\"\n        Parameters:\n            value: path to .glb file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.\n            clear_color: background color of scene, should be a tuple of 4 floats between 0 and 1 representing RGBA values.\n            camera_position: initial camera position of scene, provided as a tuple of `(alpha, beta, radius)`. Each value is optional. If provided, `alpha` and `beta` should be in degrees reflecting the angular position along the longitudinal and latitudinal axes, respectively. Radius corresponds to the distance from the center of the object to the camera.\n            zoom_speed: the speed of zooming in and out of the scene when the cursor wheel is rotated or when screen is pinched on a mobile device. Should be a positive float, increase this value to make zooming faster, decrease to make it slower. Affects the wheelPrecision property of the camera.\n            pan_speed: the speed of panning the scene when the cursor is dragged or when the screen is dragged on a mobile device. Should be a positive float, increase this value to make panning faster, decrease to make it slower. Affects the panSensibility property of the camera.\n            height: The height of the model3D component, specified in pixels if a number is passed, or in CSS units if a string is passed.\n            interactive: if True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output.\n            label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.\n            show_label: if True, will display label.\n            every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n            container: If True, will place the component in a container - providing some extra padding around the border.\n            scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.\n            min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.\n            visible: If False, component will be hidden.\n            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n            elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.\n            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.\n        \"\"\"\n        self.clear_color = clear_color or [0, 0, 0, 0]\n        self.camera_position = camera_position\n        self.height = height\n        self.zoom_speed = zoom_speed\n        self.pan_speed = pan_speed\n        super().__init__(\n            label=label,\n            every=every,\n            show_label=show_label,\n            container=container,\n            scale=scale,\n            min_width=min_width,\n            interactive=interactive,\n            visible=visible,\n            elem_id=elem_id,\n            elem_classes=elem_classes,\n            render=render,\n            value=value,\n        )\n\n    def preprocess(self, payload: FileData | None) -> str | None:\n        \"\"\"\n        Parameters:\n            payload: the uploaded file as an instance of `FileData`.\n        Returns:\n            Passes the uploaded file as a {str} filepath to the function.\n        \"\"\"\n        if payload is None:\n            return payload\n        return payload.path\n\n    def postprocess(self, value: str | Path | None) -> FileData | None:\n        \"\"\"\n        Parameters:\n            value: Expects function to return a {str} or {pathlib.Path} filepath of type (.obj, .glb, .stl, or .gltf)\n        Returns:\n            The uploaded file as an instance of `FileData`.\n        \"\"\"\n        if value is None:\n            return value\n        return FileData(path=str(value), orig_name=Path(value).name)\n\n    def process_example(self, input_data: str | Path | None) -> str:\n        return Path(input_data).name if input_data else \"\"\n\n    def example_inputs(self):\n        # TODO: Use permanent link\n        return \"https://raw.githubusercontent.com/gradio-app/gradio/main/demo/model3D/files/Fox.gltf\"\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/custommodel3d.pyi",
    "content": "\"\"\"gr.Model3D() component.\"\"\"\n\nfrom __future__ import annotations\n\nfrom pathlib import Path\nfrom typing import Callable\n\nfrom gradio_client.documentation import document\n\nfrom gradio.components.base import Component\nfrom gradio.data_classes import FileData\nfrom gradio.events import Events\n\nfrom gradio.events import Dependency\n\nclass CustomModel3D(Component):\n    \"\"\"\n    Creates a component allows users to upload or view 3D Model files (.glb).\n\n    Demos: model3D\n    Guides: how-to-use-3D-model-component\n    \"\"\"\n\n    EVENTS = [Events.change, Events.upload, Events.edit, Events.clear]\n\n    data_model = FileData\n\n    def __init__(\n        self,\n        value: str | Callable | None = None,\n        *,\n        clear_color: tuple[float, float, float, float] | None = None,\n        camera_position: tuple[\n            int | float | None, int | float | None, int | float | None\n        ] = (\n            None,\n            None,\n            None,\n        ),\n        zoom_speed: float = 1,\n        pan_speed: float = 1,\n        height: int | str | None = None,\n        label: str | None = None,\n        show_label: bool | None = None,\n        every: float | None = None,\n        container: bool = True,\n        scale: int | None = None,\n        min_width: int = 160,\n        interactive: bool | None = None,\n        visible: bool = True,\n        elem_id: str | None = None,\n        elem_classes: list[str] | str | None = None,\n        render: bool = True,\n    ):\n        \"\"\"\n        Parameters:\n            value: path to .glb file to show in model3D viewer. If callable, the function will be called whenever the app loads to set the initial value of the component.\n            clear_color: background color of scene, should be a tuple of 4 floats between 0 and 1 representing RGBA values.\n            camera_position: initial camera position of scene, provided as a tuple of `(alpha, beta, radius)`. Each value is optional. If provided, `alpha` and `beta` should be in degrees reflecting the angular position along the longitudinal and latitudinal axes, respectively. Radius corresponds to the distance from the center of the object to the camera.\n            zoom_speed: the speed of zooming in and out of the scene when the cursor wheel is rotated or when screen is pinched on a mobile device. Should be a positive float, increase this value to make zooming faster, decrease to make it slower. Affects the wheelPrecision property of the camera.\n            pan_speed: the speed of panning the scene when the cursor is dragged or when the screen is dragged on a mobile device. Should be a positive float, increase this value to make panning faster, decrease to make it slower. Affects the panSensibility property of the camera.\n            height: The height of the model3D component, specified in pixels if a number is passed, or in CSS units if a string is passed.\n            interactive: if True, will allow users to upload a file; if False, can only be used to display files. If not provided, this is inferred based on whether the component is used as an input or output.\n            label: The label for this component. Appears above the component and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component is assigned to.\n            show_label: if True, will display label.\n            every: If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute.\n            container: If True, will place the component in a container - providing some extra padding around the border.\n            scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.\n            min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.\n            visible: If False, component will be hidden.\n            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.\n            elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.\n            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.\n        \"\"\"\n        self.clear_color = clear_color or [0, 0, 0, 0]\n        self.camera_position = camera_position\n        self.height = height\n        self.zoom_speed = zoom_speed\n        self.pan_speed = pan_speed\n        super().__init__(\n            label=label,\n            every=every,\n            show_label=show_label,\n            container=container,\n            scale=scale,\n            min_width=min_width,\n            interactive=interactive,\n            visible=visible,\n            elem_id=elem_id,\n            elem_classes=elem_classes,\n            render=render,\n            value=value,\n        )\n\n    def preprocess(self, payload: FileData | None) -> str | None:\n        \"\"\"\n        Parameters:\n            payload: the uploaded file as an instance of `FileData`.\n        Returns:\n            Passes the uploaded file as a {str} filepath to the function.\n        \"\"\"\n        if payload is None:\n            return payload\n        return payload.path\n\n    def postprocess(self, value: str | Path | None) -> FileData | None:\n        \"\"\"\n        Parameters:\n            value: Expects function to return a {str} or {pathlib.Path} filepath of type (.obj, .glb, .stl, or .gltf)\n        Returns:\n            The uploaded file as an instance of `FileData`.\n        \"\"\"\n        if value is None:\n            return value\n        return FileData(path=str(value), orig_name=Path(value).name)\n\n    def process_example(self, input_data: str | Path | None) -> str:\n        return Path(input_data).name if input_data else \"\"\n\n    def example_inputs(self):\n        # TODO: Use permanent link\n        return \"https://raw.githubusercontent.com/gradio-app/gradio/main/demo/model3D/files/Fox.gltf\"\n    from typing import Callable, Literal, Sequence, Any, TYPE_CHECKING\n    from gradio.blocks import Block\n    if TYPE_CHECKING:\n        from gradio.components import Timer\n\n    \n    def change(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ...\n    \n    def upload(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ...\n    \n    def edit(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ...\n    \n    def clear(self,\n        fn: Callable[..., Any] | None = None,\n        inputs: Block | Sequence[Block] | set[Block] | None = None,\n        outputs: Block | Sequence[Block] | None = None,\n        api_name: str | None | Literal[False] = None,\n        scroll_to_output: bool = False,\n        show_progress: Literal[\"full\", \"minimal\", \"hidden\"] = \"full\",\n        queue: bool | None = None,\n        batch: bool = False,\n        max_batch_size: int = 4,\n        preprocess: bool = True,\n        postprocess: bool = True,\n        cancels: dict[str, Any] | list[dict[str, Any]] | None = None,\n        every: Timer | float | None = None,\n        trigger_mode: Literal[\"once\", \"multiple\", \"always_last\"] | None = None,\n        js: str | None = None,\n        concurrency_limit: int | None | Literal[\"default\"] = \"default\",\n        concurrency_id: str | None = None,\n        show_api: bool = True,\n    \n        ) -> Dependency:\n        \"\"\"\n        Parameters:\n            fn: the function to call when this event is triggered. Often a machine learning model's prediction function. Each parameter of the function corresponds to one input component, and the function should return a single value or a tuple of values, with each element in the tuple corresponding to one output component.\n            inputs: list of gradio.components to use as inputs. If the function takes no inputs, this should be an empty list.\n            outputs: list of gradio.components to use as outputs. If the function returns no outputs, this should be an empty list.\n            api_name: defines how the endpoint appears in the API docs. Can be a string, None, or False. If False, the endpoint will not be exposed in the api docs. If set to None, the endpoint will be exposed in the api docs as an unnamed endpoint, although this behavior will be changed in Gradio 4.0. If set to a string, the endpoint will be exposed in the api docs with the given name.\n            scroll_to_output: if True, will scroll to output component on completion\n            show_progress: how to show the progress animation while event is running: \"full\" shows a spinner which covers the output component area as well as a runtime display in the upper right corner, \"minimal\" only shows the runtime display, \"hidden\" shows no progress animation at all\n            queue: if True, will place the request on the queue, if the queue has been enabled. If False, will not put this event on the queue, even if the queue has been enabled. If None, will use the queue setting of the gradio app.\n            batch: if True, then the function should process a batch of inputs, meaning that it should accept a list of input values for each parameter. The lists should be of equal length (and be up to length `max_batch_size`). The function is then *required* to return a tuple of lists (even if there is only 1 output component), with each list in the tuple corresponding to one output component.\n            max_batch_size: maximum number of inputs to batch together if this is called from the queue (only relevant if batch=True)\n            preprocess: if False, will not run preprocessing of component data before running 'fn' (e.g. leaving it as a base64 string if this method is called with the `Image` component).\n            postprocess: if False, will not run postprocessing of component data before returning 'fn' output to the browser.\n            cancels: a list of other events to cancel when this listener is triggered. For example, setting cancels=[click_event] will cancel the click_event, where click_event is the return value of another components .click method. Functions that have not yet run (or generators that are iterating) will be cancelled, but functions that are currently running will be allowed to finish.\n            every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.\n            trigger_mode: if \"once\" (default for all events except `.change()`) would not allow any submissions while an event is pending. If set to \"multiple\", unlimited submissions are allowed while pending, and \"always_last\" (default for `.change()` and `.key_up()` events) would allow a second submission after the pending event is complete.\n            js: optional frontend js method to run before running 'fn'. Input arguments for js method are values of 'inputs' and 'outputs', return should be a list of values for output components.\n            concurrency_limit: if set, this is the maximum number of this event that can be running simultaneously. Can be set to None to mean no concurrency_limit (any number of this event can be running simultaneously). Set to \"default\" to use the default concurrency limit (defined by the `default_concurrency_limit` parameter in `Blocks.queue()`, which itself is 1 by default).\n            concurrency_id: if set, this is the id of the concurrency group. Events with the same concurrency_id will be limited by the lowest set concurrency_limit.\n            show_api: whether to show this event in the \"view API\" page of the Gradio app, or in the \".view_api()\" method of the Gradio clients. Unlike setting api_name to False, setting show_api to False will still allow downstream apps as well as the Clients to use this event. If fn is None, show_api will automatically be set to False.\n        \n        \"\"\"\n        ..."
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/Canvas3D-e42d3d6b.js",
    "content": "import { c as Gr, g as av, r as sv } from \"./Index-0bb1de05.js\";\nfunction cv(an, ln) {\n  for (var Be = 0; Be < ln.length; Be++) {\n    const A = ln[Be];\n    if (typeof A != \"string\" && !Array.isArray(A)) {\n      for (const f in A)\n        if (f !== \"default\" && !(f in an)) {\n          const V = Object.getOwnPropertyDescriptor(A, f);\n          V && Object.defineProperty(an, f, V.get ? V : {\n            enumerable: !0,\n            get: () => A[f]\n          });\n        }\n    }\n  }\n  return Object.freeze(Object.defineProperty(an, Symbol.toStringTag, { value: \"Module\" }));\n}\nvar Yc = { exports: {} }, of;\nfunction sf() {\n  return of || (of = 1, function(an, ln) {\n    (function(Be, A) {\n      an.exports = A();\n    })(typeof self < \"u\" ? self : typeof Gr < \"u\" ? Gr : Gr, function() {\n      return function(Be) {\n        var A = {};\n        function f(V) {\n          if (A[V])\n            return A[V].exports;\n          var _ = A[V] = { i: V, l: !1, exports: {} };\n          return Be[V].call(_.exports, _, _.exports, f), _.l = !0, _.exports;\n        }\n        return f.m = Be, f.c = A, f.d = function(V, _, C) {\n          f.o(V, _) || Object.defineProperty(V, _, { enumerable: !0, get: C });\n        }, f.r = function(V) {\n          typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(V, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(V, \"__esModule\", { value: !0 });\n        }, f.t = function(V, _) {\n          if (1 & _ && (V = f(V)), 8 & _ || 4 & _ && typeof V == \"object\" && V && V.__esModule)\n            return V;\n          var C = /* @__PURE__ */ Object.create(null);\n          if (f.r(C), Object.defineProperty(C, \"default\", { enumerable: !0, value: V }), 2 & _ && typeof V != \"string\")\n            for (var u in V)\n              f.d(C, u, (function(I) {\n                return V[I];\n              }).bind(null, u));\n          return C;\n        }, f.n = function(V) {\n          var _ = V && V.__esModule ? function() {\n            return V.default;\n          } : function() {\n            return V;\n          };\n          return f.d(_, \"a\", _), _;\n        }, f.o = function(V, _) {\n          return Object.prototype.hasOwnProperty.call(V, _);\n        }, f.p = \"\", f(f.s = 169);\n      }([function(Be, A, f) {\n        f.d(A, \"d\", function() {\n          return O;\n        }), f.d(A, \"e\", function() {\n          return x;\n        }), f.d(A, \"f\", function() {\n          return m;\n        }), f.d(A, \"b\", function() {\n          return c;\n        }), f.d(A, \"a\", function() {\n          return T;\n        }), f.d(A, \"c\", function() {\n          return E;\n        });\n        var V = f(14), _ = f(28), C = f(44), u = f(11), I = f(74), O = function() {\n          function g(l, h) {\n            l === void 0 && (l = 0), h === void 0 && (h = 0), this.x = l, this.y = h;\n          }\n          return g.prototype.toString = function() {\n            return \"{X: \" + this.x + \" Y: \" + this.y + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Vector2\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this.x;\n            return l = 397 * l ^ (0 | this.y);\n          }, g.prototype.toArray = function(l, h) {\n            return h === void 0 && (h = 0), l[h] = this.x, l[h + 1] = this.y, this;\n          }, g.prototype.fromArray = function(l, h) {\n            return h === void 0 && (h = 0), g.FromArrayToRef(l, h, this), this;\n          }, g.prototype.asArray = function() {\n            var l = new Array();\n            return this.toArray(l, 0), l;\n          }, g.prototype.copyFrom = function(l) {\n            return this.x = l.x, this.y = l.y, this;\n          }, g.prototype.copyFromFloats = function(l, h) {\n            return this.x = l, this.y = h, this;\n          }, g.prototype.set = function(l, h) {\n            return this.copyFromFloats(l, h);\n          }, g.prototype.add = function(l) {\n            return new g(this.x + l.x, this.y + l.y);\n          }, g.prototype.addToRef = function(l, h) {\n            return h.x = this.x + l.x, h.y = this.y + l.y, this;\n          }, g.prototype.addInPlace = function(l) {\n            return this.x += l.x, this.y += l.y, this;\n          }, g.prototype.addVector3 = function(l) {\n            return new g(this.x + l.x, this.y + l.y);\n          }, g.prototype.subtract = function(l) {\n            return new g(this.x - l.x, this.y - l.y);\n          }, g.prototype.subtractToRef = function(l, h) {\n            return h.x = this.x - l.x, h.y = this.y - l.y, this;\n          }, g.prototype.subtractInPlace = function(l) {\n            return this.x -= l.x, this.y -= l.y, this;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.x *= l.x, this.y *= l.y, this;\n          }, g.prototype.multiply = function(l) {\n            return new g(this.x * l.x, this.y * l.y);\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return h.x = this.x * l.x, h.y = this.y * l.y, this;\n          }, g.prototype.multiplyByFloats = function(l, h) {\n            return new g(this.x * l, this.y * h);\n          }, g.prototype.divide = function(l) {\n            return new g(this.x / l.x, this.y / l.y);\n          }, g.prototype.divideToRef = function(l, h) {\n            return h.x = this.x / l.x, h.y = this.y / l.y, this;\n          }, g.prototype.divideInPlace = function(l) {\n            return this.divideToRef(l, this);\n          }, g.prototype.negate = function() {\n            return new g(-this.x, -this.y);\n          }, g.prototype.negateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this;\n          }, g.prototype.negateToRef = function(l) {\n            return l.copyFromFloats(-1 * this.x, -1 * this.y);\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this;\n          }, g.prototype.scale = function(l) {\n            var h = new g(0, 0);\n            return this.scaleToRef(l, h), h;\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.x = this.x * l, h.y = this.y * l, this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.x += this.x * l, h.y += this.y * l, this;\n          }, g.prototype.equals = function(l) {\n            return l && this.x === l.x && this.y === l.y;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this.x, l.x, h) && V.a.WithinEpsilon(this.y, l.y, h);\n          }, g.prototype.floor = function() {\n            return new g(Math.floor(this.x), Math.floor(this.y));\n          }, g.prototype.fract = function() {\n            return new g(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\n          }, g.prototype.length = function() {\n            return Math.sqrt(this.x * this.x + this.y * this.y);\n          }, g.prototype.lengthSquared = function() {\n            return this.x * this.x + this.y * this.y;\n          }, g.prototype.normalize = function() {\n            var l = this.length();\n            return l === 0 || (this.x /= l, this.y /= l), this;\n          }, g.prototype.clone = function() {\n            return new g(this.x, this.y);\n          }, g.Zero = function() {\n            return new g(0, 0);\n          }, g.One = function() {\n            return new g(1, 1);\n          }, g.FromArray = function(l, h) {\n            return h === void 0 && (h = 0), new g(l[h], l[h + 1]);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1];\n          }, g.CatmullRom = function(l, h, v, b, D) {\n            var w = D * D, N = D * w;\n            return new g(0.5 * (2 * h.x + (-l.x + v.x) * D + (2 * l.x - 5 * h.x + 4 * v.x - b.x) * w + (-l.x + 3 * h.x - 3 * v.x + b.x) * N), 0.5 * (2 * h.y + (-l.y + v.y) * D + (2 * l.y - 5 * h.y + 4 * v.y - b.y) * w + (-l.y + 3 * h.y - 3 * v.y + b.y) * N));\n          }, g.Clamp = function(l, h, v) {\n            var b = l.x;\n            b = (b = b > v.x ? v.x : b) < h.x ? h.x : b;\n            var D = l.y;\n            return new g(b, D = (D = D > v.y ? v.y : D) < h.y ? h.y : D);\n          }, g.Hermite = function(l, h, v, b, D) {\n            var w = D * D, N = D * w, M = 2 * N - 3 * w + 1, U = -2 * N + 3 * w, X = N - 2 * w + D, j = N - w;\n            return new g(l.x * M + v.x * U + h.x * X + b.x * j, l.y * M + v.y * U + h.y * X + b.y * j);\n          }, g.Lerp = function(l, h, v) {\n            return new g(l.x + (h.x - l.x) * v, l.y + (h.y - l.y) * v);\n          }, g.Dot = function(l, h) {\n            return l.x * h.x + l.y * h.y;\n          }, g.Normalize = function(l) {\n            var h = l.clone();\n            return h.normalize(), h;\n          }, g.Minimize = function(l, h) {\n            return new g(l.x < h.x ? l.x : h.x, l.y < h.y ? l.y : h.y);\n          }, g.Maximize = function(l, h) {\n            return new g(l.x > h.x ? l.x : h.x, l.y > h.y ? l.y : h.y);\n          }, g.Transform = function(l, h) {\n            var v = g.Zero();\n            return g.TransformToRef(l, h, v), v;\n          }, g.TransformToRef = function(l, h, v) {\n            var b = h.m, D = l.x * b[0] + l.y * b[4] + b[12], w = l.x * b[1] + l.y * b[5] + b[13];\n            v.x = D, v.y = w;\n          }, g.PointInTriangle = function(l, h, v, b) {\n            var D = 0.5 * (-v.y * b.x + h.y * (-v.x + b.x) + h.x * (v.y - b.y) + v.x * b.y), w = D < 0 ? -1 : 1, N = (h.y * b.x - h.x * b.y + (b.y - h.y) * l.x + (h.x - b.x) * l.y) * w, M = (h.x * v.y - h.y * v.x + (h.y - v.y) * l.x + (v.x - h.x) * l.y) * w;\n            return N > 0 && M > 0 && N + M < 2 * D * w;\n          }, g.Distance = function(l, h) {\n            return Math.sqrt(g.DistanceSquared(l, h));\n          }, g.DistanceSquared = function(l, h) {\n            var v = l.x - h.x, b = l.y - h.y;\n            return v * v + b * b;\n          }, g.Center = function(l, h) {\n            var v = l.add(h);\n            return v.scaleInPlace(0.5), v;\n          }, g.DistanceOfPointFromSegment = function(l, h, v) {\n            var b = g.DistanceSquared(h, v);\n            if (b === 0)\n              return g.Distance(l, h);\n            var D = v.subtract(h), w = Math.max(0, Math.min(1, g.Dot(l.subtract(h), D) / b)), N = h.add(D.multiplyByFloats(w, w));\n            return g.Distance(l, N);\n          }, g;\n        }(), x = function() {\n          function g(l, h, v) {\n            l === void 0 && (l = 0), h === void 0 && (h = 0), v === void 0 && (v = 0), this._isDirty = !0, this._x = l, this._y = h, this._z = v;\n          }\n          return Object.defineProperty(g.prototype, \"x\", { get: function() {\n            return this._x;\n          }, set: function(l) {\n            this._x = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"y\", { get: function() {\n            return this._y;\n          }, set: function(l) {\n            this._y = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"z\", { get: function() {\n            return this._z;\n          }, set: function(l) {\n            this._z = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype.toString = function() {\n            return \"{X: \" + this._x + \" Y:\" + this._y + \" Z:\" + this._z + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Vector3\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this._x;\n            return l = 397 * (l = 397 * l ^ (0 | this._y)) ^ (0 | this._z);\n          }, g.prototype.asArray = function() {\n            var l = [];\n            return this.toArray(l, 0), l;\n          }, g.prototype.toArray = function(l, h) {\n            return h === void 0 && (h = 0), l[h] = this._x, l[h + 1] = this._y, l[h + 2] = this._z, this;\n          }, g.prototype.fromArray = function(l, h) {\n            return h === void 0 && (h = 0), g.FromArrayToRef(l, h, this), this;\n          }, g.prototype.toQuaternion = function() {\n            return c.RotationYawPitchRoll(this._y, this._x, this._z);\n          }, g.prototype.addInPlace = function(l) {\n            return this.addInPlaceFromFloats(l._x, l._y, l._z);\n          }, g.prototype.addInPlaceFromFloats = function(l, h, v) {\n            return this.x += l, this.y += h, this.z += v, this;\n          }, g.prototype.add = function(l) {\n            return new g(this._x + l._x, this._y + l._y, this._z + l._z);\n          }, g.prototype.addToRef = function(l, h) {\n            return h.copyFromFloats(this._x + l._x, this._y + l._y, this._z + l._z);\n          }, g.prototype.subtractInPlace = function(l) {\n            return this.x -= l._x, this.y -= l._y, this.z -= l._z, this;\n          }, g.prototype.subtract = function(l) {\n            return new g(this._x - l._x, this._y - l._y, this._z - l._z);\n          }, g.prototype.subtractToRef = function(l, h) {\n            return this.subtractFromFloatsToRef(l._x, l._y, l._z, h);\n          }, g.prototype.subtractFromFloats = function(l, h, v) {\n            return new g(this._x - l, this._y - h, this._z - v);\n          }, g.prototype.subtractFromFloatsToRef = function(l, h, v, b) {\n            return b.copyFromFloats(this._x - l, this._y - h, this._z - v);\n          }, g.prototype.negate = function() {\n            return new g(-this._x, -this._y, -this._z);\n          }, g.prototype.negateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this.z *= -1, this;\n          }, g.prototype.negateToRef = function(l) {\n            return l.copyFromFloats(-1 * this._x, -1 * this._y, -1 * this._z);\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this.z *= l, this;\n          }, g.prototype.scale = function(l) {\n            return new g(this._x * l, this._y * l, this._z * l);\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.copyFromFloats(this._x * l, this._y * l, this._z * l);\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.addInPlaceFromFloats(this._x * l, this._y * l, this._z * l);\n          }, g.prototype.projectOnPlane = function(l, h) {\n            var v = g.Zero();\n            return this.projectOnPlaneToRef(l, h, v), v;\n          }, g.prototype.projectOnPlaneToRef = function(l, h, v) {\n            var b = l.normal, D = l.d, w = S.Vector3[0];\n            this.subtractToRef(h, w), w.normalize();\n            var N = g.Dot(w, b), M = -(g.Dot(h, b) + D) / N, U = w.scaleInPlace(M);\n            h.addToRef(U, v);\n          }, g.prototype.equals = function(l) {\n            return l && this._x === l._x && this._y === l._y && this._z === l._z;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this._x, l._x, h) && V.a.WithinEpsilon(this._y, l._y, h) && V.a.WithinEpsilon(this._z, l._z, h);\n          }, g.prototype.equalsToFloats = function(l, h, v) {\n            return this._x === l && this._y === h && this._z === v;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.x *= l._x, this.y *= l._y, this.z *= l._z, this;\n          }, g.prototype.multiply = function(l) {\n            return this.multiplyByFloats(l._x, l._y, l._z);\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return h.copyFromFloats(this._x * l._x, this._y * l._y, this._z * l._z);\n          }, g.prototype.multiplyByFloats = function(l, h, v) {\n            return new g(this._x * l, this._y * h, this._z * v);\n          }, g.prototype.divide = function(l) {\n            return new g(this._x / l._x, this._y / l._y, this._z / l._z);\n          }, g.prototype.divideToRef = function(l, h) {\n            return h.copyFromFloats(this._x / l._x, this._y / l._y, this._z / l._z);\n          }, g.prototype.divideInPlace = function(l) {\n            return this.divideToRef(l, this);\n          }, g.prototype.minimizeInPlace = function(l) {\n            return this.minimizeInPlaceFromFloats(l._x, l._y, l._z);\n          }, g.prototype.maximizeInPlace = function(l) {\n            return this.maximizeInPlaceFromFloats(l._x, l._y, l._z);\n          }, g.prototype.minimizeInPlaceFromFloats = function(l, h, v) {\n            return l < this._x && (this.x = l), h < this._y && (this.y = h), v < this._z && (this.z = v), this;\n          }, g.prototype.maximizeInPlaceFromFloats = function(l, h, v) {\n            return l > this._x && (this.x = l), h > this._y && (this.y = h), v > this._z && (this.z = v), this;\n          }, g.prototype.isNonUniformWithinEpsilon = function(l) {\n            var h = Math.abs(this._x), v = Math.abs(this._y);\n            if (!V.a.WithinEpsilon(h, v, l))\n              return !0;\n            var b = Math.abs(this._z);\n            return !V.a.WithinEpsilon(h, b, l) || !V.a.WithinEpsilon(v, b, l);\n          }, Object.defineProperty(g.prototype, \"isNonUniform\", { get: function() {\n            var l = Math.abs(this._x);\n            return l !== Math.abs(this._y) || l !== Math.abs(this._z);\n          }, enumerable: !1, configurable: !0 }), g.prototype.floor = function() {\n            return new g(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\n          }, g.prototype.fract = function() {\n            return new g(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));\n          }, g.prototype.length = function() {\n            return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);\n          }, g.prototype.lengthSquared = function() {\n            return this._x * this._x + this._y * this._y + this._z * this._z;\n          }, g.prototype.normalize = function() {\n            return this.normalizeFromLength(this.length());\n          }, g.prototype.reorderInPlace = function(l) {\n            var h = this;\n            return (l = l.toLowerCase()) === \"xyz\" || (S.Vector3[0].copyFrom(this), [\"x\", \"y\", \"z\"].forEach(function(v, b) {\n              h[v] = S.Vector3[0][l[b]];\n            })), this;\n          }, g.prototype.rotateByQuaternionToRef = function(l, h) {\n            return l.toRotationMatrix(S.Matrix[0]), g.TransformCoordinatesToRef(this, S.Matrix[0], h), h;\n          }, g.prototype.rotateByQuaternionAroundPointToRef = function(l, h, v) {\n            return this.subtractToRef(h, S.Vector3[0]), S.Vector3[0].rotateByQuaternionToRef(l, S.Vector3[0]), h.addToRef(S.Vector3[0], v), v;\n          }, g.prototype.cross = function(l) {\n            return g.Cross(this, l);\n          }, g.prototype.normalizeFromLength = function(l) {\n            return l === 0 || l === 1 ? this : this.scaleInPlace(1 / l);\n          }, g.prototype.normalizeToNew = function() {\n            var l = new g(0, 0, 0);\n            return this.normalizeToRef(l), l;\n          }, g.prototype.normalizeToRef = function(l) {\n            var h = this.length();\n            return h === 0 || h === 1 ? l.copyFromFloats(this._x, this._y, this._z) : this.scaleToRef(1 / h, l);\n          }, g.prototype.clone = function() {\n            return new g(this._x, this._y, this._z);\n          }, g.prototype.copyFrom = function(l) {\n            return this.copyFromFloats(l._x, l._y, l._z);\n          }, g.prototype.copyFromFloats = function(l, h, v) {\n            return this.x = l, this.y = h, this.z = v, this;\n          }, g.prototype.set = function(l, h, v) {\n            return this.copyFromFloats(l, h, v);\n          }, g.prototype.setAll = function(l) {\n            return this.x = this.y = this.z = l, this;\n          }, g.GetClipFactor = function(l, h, v, b) {\n            var D = g.Dot(l, v) - b;\n            return D / (D - (g.Dot(h, v) - b));\n          }, g.GetAngleBetweenVectors = function(l, h, v) {\n            var b = l.normalizeToRef(S.Vector3[1]), D = h.normalizeToRef(S.Vector3[2]), w = g.Dot(b, D), N = S.Vector3[3];\n            return g.CrossToRef(b, D, N), g.Dot(N, v) > 0 ? Math.acos(w) : -Math.acos(w);\n          }, g.FromArray = function(l, h) {\n            return h === void 0 && (h = 0), new g(l[h], l[h + 1], l[h + 2]);\n          }, g.FromFloatArray = function(l, h) {\n            return g.FromArray(l, h);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1], v.z = l[h + 2];\n          }, g.FromFloatArrayToRef = function(l, h, v) {\n            return g.FromArrayToRef(l, h, v);\n          }, g.FromFloatsToRef = function(l, h, v, b) {\n            b.copyFromFloats(l, h, v);\n          }, g.Zero = function() {\n            return new g(0, 0, 0);\n          }, g.One = function() {\n            return new g(1, 1, 1);\n          }, g.Up = function() {\n            return new g(0, 1, 0);\n          }, Object.defineProperty(g, \"UpReadOnly\", { get: function() {\n            return g._UpReadOnly;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g, \"ZeroReadOnly\", { get: function() {\n            return g._ZeroReadOnly;\n          }, enumerable: !1, configurable: !0 }), g.Down = function() {\n            return new g(0, -1, 0);\n          }, g.Forward = function(l) {\n            return l === void 0 && (l = !1), new g(0, 0, l ? -1 : 1);\n          }, g.Backward = function(l) {\n            return l === void 0 && (l = !1), new g(0, 0, l ? 1 : -1);\n          }, g.Right = function() {\n            return new g(1, 0, 0);\n          }, g.Left = function() {\n            return new g(-1, 0, 0);\n          }, g.TransformCoordinates = function(l, h) {\n            var v = g.Zero();\n            return g.TransformCoordinatesToRef(l, h, v), v;\n          }, g.TransformCoordinatesToRef = function(l, h, v) {\n            g.TransformCoordinatesFromFloatsToRef(l._x, l._y, l._z, h, v);\n          }, g.TransformCoordinatesFromFloatsToRef = function(l, h, v, b, D) {\n            var w = b.m, N = l * w[0] + h * w[4] + v * w[8] + w[12], M = l * w[1] + h * w[5] + v * w[9] + w[13], U = l * w[2] + h * w[6] + v * w[10] + w[14], X = 1 / (l * w[3] + h * w[7] + v * w[11] + w[15]);\n            D.x = N * X, D.y = M * X, D.z = U * X;\n          }, g.TransformNormal = function(l, h) {\n            var v = g.Zero();\n            return g.TransformNormalToRef(l, h, v), v;\n          }, g.TransformNormalToRef = function(l, h, v) {\n            this.TransformNormalFromFloatsToRef(l._x, l._y, l._z, h, v);\n          }, g.TransformNormalFromFloatsToRef = function(l, h, v, b, D) {\n            var w = b.m;\n            D.x = l * w[0] + h * w[4] + v * w[8], D.y = l * w[1] + h * w[5] + v * w[9], D.z = l * w[2] + h * w[6] + v * w[10];\n          }, g.CatmullRom = function(l, h, v, b, D) {\n            var w = D * D, N = D * w;\n            return new g(0.5 * (2 * h._x + (-l._x + v._x) * D + (2 * l._x - 5 * h._x + 4 * v._x - b._x) * w + (-l._x + 3 * h._x - 3 * v._x + b._x) * N), 0.5 * (2 * h._y + (-l._y + v._y) * D + (2 * l._y - 5 * h._y + 4 * v._y - b._y) * w + (-l._y + 3 * h._y - 3 * v._y + b._y) * N), 0.5 * (2 * h._z + (-l._z + v._z) * D + (2 * l._z - 5 * h._z + 4 * v._z - b._z) * w + (-l._z + 3 * h._z - 3 * v._z + b._z) * N));\n          }, g.Clamp = function(l, h, v) {\n            var b = new g();\n            return g.ClampToRef(l, h, v, b), b;\n          }, g.ClampToRef = function(l, h, v, b) {\n            var D = l._x;\n            D = (D = D > v._x ? v._x : D) < h._x ? h._x : D;\n            var w = l._y;\n            w = (w = w > v._y ? v._y : w) < h._y ? h._y : w;\n            var N = l._z;\n            N = (N = N > v._z ? v._z : N) < h._z ? h._z : N, b.copyFromFloats(D, w, N);\n          }, g.CheckExtends = function(l, h, v) {\n            h.minimizeInPlace(l), v.maximizeInPlace(l);\n          }, g.Hermite = function(l, h, v, b, D) {\n            var w = D * D, N = D * w, M = 2 * N - 3 * w + 1, U = -2 * N + 3 * w, X = N - 2 * w + D, j = N - w;\n            return new g(l._x * M + v._x * U + h._x * X + b._x * j, l._y * M + v._y * U + h._y * X + b._y * j, l._z * M + v._z * U + h._z * X + b._z * j);\n          }, g.Lerp = function(l, h, v) {\n            var b = new g(0, 0, 0);\n            return g.LerpToRef(l, h, v, b), b;\n          }, g.LerpToRef = function(l, h, v, b) {\n            b.x = l._x + (h._x - l._x) * v, b.y = l._y + (h._y - l._y) * v, b.z = l._z + (h._z - l._z) * v;\n          }, g.Dot = function(l, h) {\n            return l._x * h._x + l._y * h._y + l._z * h._z;\n          }, g.Cross = function(l, h) {\n            var v = g.Zero();\n            return g.CrossToRef(l, h, v), v;\n          }, g.CrossToRef = function(l, h, v) {\n            var b = l._y * h._z - l._z * h._y, D = l._z * h._x - l._x * h._z, w = l._x * h._y - l._y * h._x;\n            v.copyFromFloats(b, D, w);\n          }, g.Normalize = function(l) {\n            var h = g.Zero();\n            return g.NormalizeToRef(l, h), h;\n          }, g.NormalizeToRef = function(l, h) {\n            l.normalizeToRef(h);\n          }, g.Project = function(l, h, v, b) {\n            var D = new g();\n            return g.ProjectToRef(l, h, v, b, D), D;\n          }, g.ProjectToRef = function(l, h, v, b, D) {\n            var w = b.width, N = b.height, M = b.x, U = b.y, X = S.Matrix[1];\n            T.FromValuesToRef(w / 2, 0, 0, 0, 0, -N / 2, 0, 0, 0, 0, 0.5, 0, M + w / 2, N / 2 + U, 0.5, 1, X);\n            var j = S.Matrix[0];\n            return h.multiplyToRef(v, j), j.multiplyToRef(X, j), g.TransformCoordinatesToRef(l, j, D), D;\n          }, g._UnprojectFromInvertedMatrixToRef = function(l, h, v) {\n            g.TransformCoordinatesToRef(l, h, v);\n            var b = h.m, D = l._x * b[3] + l._y * b[7] + l._z * b[11] + b[15];\n            V.a.WithinEpsilon(D, 1) && v.scaleInPlace(1 / D);\n          }, g.UnprojectFromTransform = function(l, h, v, b, D) {\n            var w = S.Matrix[0];\n            b.multiplyToRef(D, w), w.invert(), l.x = l._x / h * 2 - 1, l.y = -(l._y / v * 2 - 1);\n            var N = new g();\n            return g._UnprojectFromInvertedMatrixToRef(l, w, N), N;\n          }, g.Unproject = function(l, h, v, b, D, w) {\n            var N = g.Zero();\n            return g.UnprojectToRef(l, h, v, b, D, w, N), N;\n          }, g.UnprojectToRef = function(l, h, v, b, D, w, N) {\n            g.UnprojectFloatsToRef(l._x, l._y, l._z, h, v, b, D, w, N);\n          }, g.UnprojectFloatsToRef = function(l, h, v, b, D, w, N, M, U) {\n            var X = S.Matrix[0];\n            w.multiplyToRef(N, X), X.multiplyToRef(M, X), X.invert();\n            var j = S.Vector3[0];\n            j.x = l / b * 2 - 1, j.y = -(h / D * 2 - 1), j.z = 2 * v - 1, g._UnprojectFromInvertedMatrixToRef(j, X, U);\n          }, g.Minimize = function(l, h) {\n            var v = l.clone();\n            return v.minimizeInPlace(h), v;\n          }, g.Maximize = function(l, h) {\n            var v = l.clone();\n            return v.maximizeInPlace(h), v;\n          }, g.Distance = function(l, h) {\n            return Math.sqrt(g.DistanceSquared(l, h));\n          }, g.DistanceSquared = function(l, h) {\n            var v = l._x - h._x, b = l._y - h._y, D = l._z - h._z;\n            return v * v + b * b + D * D;\n          }, g.Center = function(l, h) {\n            var v = l.add(h);\n            return v.scaleInPlace(0.5), v;\n          }, g.RotationFromAxis = function(l, h, v) {\n            var b = g.Zero();\n            return g.RotationFromAxisToRef(l, h, v, b), b;\n          }, g.RotationFromAxisToRef = function(l, h, v, b) {\n            var D = S.Quaternion[0];\n            c.RotationQuaternionFromAxisToRef(l, h, v, D), D.toEulerAnglesToRef(b);\n          }, g._UpReadOnly = g.Up(), g._ZeroReadOnly = g.Zero(), g;\n        }(), m = function() {\n          function g(l, h, v, b) {\n            this.x = l, this.y = h, this.z = v, this.w = b;\n          }\n          return g.prototype.toString = function() {\n            return \"{X: \" + this.x + \" Y:\" + this.y + \" Z:\" + this.z + \" W:\" + this.w + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Vector4\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this.x;\n            return l = 397 * (l = 397 * (l = 397 * l ^ (0 | this.y)) ^ (0 | this.z)) ^ (0 | this.w);\n          }, g.prototype.asArray = function() {\n            var l = new Array();\n            return this.toArray(l, 0), l;\n          }, g.prototype.toArray = function(l, h) {\n            return h === void 0 && (h = 0), l[h] = this.x, l[h + 1] = this.y, l[h + 2] = this.z, l[h + 3] = this.w, this;\n          }, g.prototype.fromArray = function(l, h) {\n            return h === void 0 && (h = 0), g.FromArrayToRef(l, h, this), this;\n          }, g.prototype.addInPlace = function(l) {\n            return this.x += l.x, this.y += l.y, this.z += l.z, this.w += l.w, this;\n          }, g.prototype.add = function(l) {\n            return new g(this.x + l.x, this.y + l.y, this.z + l.z, this.w + l.w);\n          }, g.prototype.addToRef = function(l, h) {\n            return h.x = this.x + l.x, h.y = this.y + l.y, h.z = this.z + l.z, h.w = this.w + l.w, this;\n          }, g.prototype.subtractInPlace = function(l) {\n            return this.x -= l.x, this.y -= l.y, this.z -= l.z, this.w -= l.w, this;\n          }, g.prototype.subtract = function(l) {\n            return new g(this.x - l.x, this.y - l.y, this.z - l.z, this.w - l.w);\n          }, g.prototype.subtractToRef = function(l, h) {\n            return h.x = this.x - l.x, h.y = this.y - l.y, h.z = this.z - l.z, h.w = this.w - l.w, this;\n          }, g.prototype.subtractFromFloats = function(l, h, v, b) {\n            return new g(this.x - l, this.y - h, this.z - v, this.w - b);\n          }, g.prototype.subtractFromFloatsToRef = function(l, h, v, b, D) {\n            return D.x = this.x - l, D.y = this.y - h, D.z = this.z - v, D.w = this.w - b, this;\n          }, g.prototype.negate = function() {\n            return new g(-this.x, -this.y, -this.z, -this.w);\n          }, g.prototype.negateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this.z *= -1, this.w *= -1, this;\n          }, g.prototype.negateToRef = function(l) {\n            return l.copyFromFloats(-1 * this.x, -1 * this.y, -1 * this.z, -1 * this.w);\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this.z *= l, this.w *= l, this;\n          }, g.prototype.scale = function(l) {\n            return new g(this.x * l, this.y * l, this.z * l, this.w * l);\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.x = this.x * l, h.y = this.y * l, h.z = this.z * l, h.w = this.w * l, this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.x += this.x * l, h.y += this.y * l, h.z += this.z * l, h.w += this.w * l, this;\n          }, g.prototype.equals = function(l) {\n            return l && this.x === l.x && this.y === l.y && this.z === l.z && this.w === l.w;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this.x, l.x, h) && V.a.WithinEpsilon(this.y, l.y, h) && V.a.WithinEpsilon(this.z, l.z, h) && V.a.WithinEpsilon(this.w, l.w, h);\n          }, g.prototype.equalsToFloats = function(l, h, v, b) {\n            return this.x === l && this.y === h && this.z === v && this.w === b;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.x *= l.x, this.y *= l.y, this.z *= l.z, this.w *= l.w, this;\n          }, g.prototype.multiply = function(l) {\n            return new g(this.x * l.x, this.y * l.y, this.z * l.z, this.w * l.w);\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return h.x = this.x * l.x, h.y = this.y * l.y, h.z = this.z * l.z, h.w = this.w * l.w, this;\n          }, g.prototype.multiplyByFloats = function(l, h, v, b) {\n            return new g(this.x * l, this.y * h, this.z * v, this.w * b);\n          }, g.prototype.divide = function(l) {\n            return new g(this.x / l.x, this.y / l.y, this.z / l.z, this.w / l.w);\n          }, g.prototype.divideToRef = function(l, h) {\n            return h.x = this.x / l.x, h.y = this.y / l.y, h.z = this.z / l.z, h.w = this.w / l.w, this;\n          }, g.prototype.divideInPlace = function(l) {\n            return this.divideToRef(l, this);\n          }, g.prototype.minimizeInPlace = function(l) {\n            return l.x < this.x && (this.x = l.x), l.y < this.y && (this.y = l.y), l.z < this.z && (this.z = l.z), l.w < this.w && (this.w = l.w), this;\n          }, g.prototype.maximizeInPlace = function(l) {\n            return l.x > this.x && (this.x = l.x), l.y > this.y && (this.y = l.y), l.z > this.z && (this.z = l.z), l.w > this.w && (this.w = l.w), this;\n          }, g.prototype.floor = function() {\n            return new g(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));\n          }, g.prototype.fract = function() {\n            return new g(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));\n          }, g.prototype.length = function() {\n            return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n          }, g.prototype.lengthSquared = function() {\n            return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n          }, g.prototype.normalize = function() {\n            var l = this.length();\n            return l === 0 ? this : this.scaleInPlace(1 / l);\n          }, g.prototype.toVector3 = function() {\n            return new x(this.x, this.y, this.z);\n          }, g.prototype.clone = function() {\n            return new g(this.x, this.y, this.z, this.w);\n          }, g.prototype.copyFrom = function(l) {\n            return this.x = l.x, this.y = l.y, this.z = l.z, this.w = l.w, this;\n          }, g.prototype.copyFromFloats = function(l, h, v, b) {\n            return this.x = l, this.y = h, this.z = v, this.w = b, this;\n          }, g.prototype.set = function(l, h, v, b) {\n            return this.copyFromFloats(l, h, v, b);\n          }, g.prototype.setAll = function(l) {\n            return this.x = this.y = this.z = this.w = l, this;\n          }, g.FromArray = function(l, h) {\n            return h || (h = 0), new g(l[h], l[h + 1], l[h + 2], l[h + 3]);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1], v.z = l[h + 2], v.w = l[h + 3];\n          }, g.FromFloatArrayToRef = function(l, h, v) {\n            g.FromArrayToRef(l, h, v);\n          }, g.FromFloatsToRef = function(l, h, v, b, D) {\n            D.x = l, D.y = h, D.z = v, D.w = b;\n          }, g.Zero = function() {\n            return new g(0, 0, 0, 0);\n          }, g.One = function() {\n            return new g(1, 1, 1, 1);\n          }, g.Normalize = function(l) {\n            var h = g.Zero();\n            return g.NormalizeToRef(l, h), h;\n          }, g.NormalizeToRef = function(l, h) {\n            h.copyFrom(l), h.normalize();\n          }, g.Minimize = function(l, h) {\n            var v = l.clone();\n            return v.minimizeInPlace(h), v;\n          }, g.Maximize = function(l, h) {\n            var v = l.clone();\n            return v.maximizeInPlace(h), v;\n          }, g.Distance = function(l, h) {\n            return Math.sqrt(g.DistanceSquared(l, h));\n          }, g.DistanceSquared = function(l, h) {\n            var v = l.x - h.x, b = l.y - h.y, D = l.z - h.z, w = l.w - h.w;\n            return v * v + b * b + D * D + w * w;\n          }, g.Center = function(l, h) {\n            var v = l.add(h);\n            return v.scaleInPlace(0.5), v;\n          }, g.TransformNormal = function(l, h) {\n            var v = g.Zero();\n            return g.TransformNormalToRef(l, h, v), v;\n          }, g.TransformNormalToRef = function(l, h, v) {\n            var b = h.m, D = l.x * b[0] + l.y * b[4] + l.z * b[8], w = l.x * b[1] + l.y * b[5] + l.z * b[9], N = l.x * b[2] + l.y * b[6] + l.z * b[10];\n            v.x = D, v.y = w, v.z = N, v.w = l.w;\n          }, g.TransformNormalFromFloatsToRef = function(l, h, v, b, D, w) {\n            var N = D.m;\n            w.x = l * N[0] + h * N[4] + v * N[8], w.y = l * N[1] + h * N[5] + v * N[9], w.z = l * N[2] + h * N[6] + v * N[10], w.w = b;\n          }, g.FromVector3 = function(l, h) {\n            return h === void 0 && (h = 0), new g(l._x, l._y, l._z, h);\n          }, g;\n        }(), c = function() {\n          function g(l, h, v, b) {\n            l === void 0 && (l = 0), h === void 0 && (h = 0), v === void 0 && (v = 0), b === void 0 && (b = 1), this._isDirty = !0, this._x = l, this._y = h, this._z = v, this._w = b;\n          }\n          return Object.defineProperty(g.prototype, \"x\", { get: function() {\n            return this._x;\n          }, set: function(l) {\n            this._x = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"y\", { get: function() {\n            return this._y;\n          }, set: function(l) {\n            this._y = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"z\", { get: function() {\n            return this._z;\n          }, set: function(l) {\n            this._z = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"w\", { get: function() {\n            return this._w;\n          }, set: function(l) {\n            this._w = l, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype.toString = function() {\n            return \"{X: \" + this._x + \" Y:\" + this._y + \" Z:\" + this._z + \" W:\" + this._w + \"}\";\n          }, g.prototype.getClassName = function() {\n            return \"Quaternion\";\n          }, g.prototype.getHashCode = function() {\n            var l = 0 | this._x;\n            return l = 397 * (l = 397 * (l = 397 * l ^ (0 | this._y)) ^ (0 | this._z)) ^ (0 | this._w);\n          }, g.prototype.asArray = function() {\n            return [this._x, this._y, this._z, this._w];\n          }, g.prototype.equals = function(l) {\n            return l && this._x === l._x && this._y === l._y && this._z === l._z && this._w === l._w;\n          }, g.prototype.equalsWithEpsilon = function(l, h) {\n            return h === void 0 && (h = _.a), l && V.a.WithinEpsilon(this._x, l._x, h) && V.a.WithinEpsilon(this._y, l._y, h) && V.a.WithinEpsilon(this._z, l._z, h) && V.a.WithinEpsilon(this._w, l._w, h);\n          }, g.prototype.clone = function() {\n            return new g(this._x, this._y, this._z, this._w);\n          }, g.prototype.copyFrom = function(l) {\n            return this.x = l._x, this.y = l._y, this.z = l._z, this.w = l._w, this;\n          }, g.prototype.copyFromFloats = function(l, h, v, b) {\n            return this.x = l, this.y = h, this.z = v, this.w = b, this;\n          }, g.prototype.set = function(l, h, v, b) {\n            return this.copyFromFloats(l, h, v, b);\n          }, g.prototype.add = function(l) {\n            return new g(this._x + l._x, this._y + l._y, this._z + l._z, this._w + l._w);\n          }, g.prototype.addInPlace = function(l) {\n            return this._x += l._x, this._y += l._y, this._z += l._z, this._w += l._w, this;\n          }, g.prototype.subtract = function(l) {\n            return new g(this._x - l._x, this._y - l._y, this._z - l._z, this._w - l._w);\n          }, g.prototype.scale = function(l) {\n            return new g(this._x * l, this._y * l, this._z * l, this._w * l);\n          }, g.prototype.scaleToRef = function(l, h) {\n            return h.x = this._x * l, h.y = this._y * l, h.z = this._z * l, h.w = this._w * l, this;\n          }, g.prototype.scaleInPlace = function(l) {\n            return this.x *= l, this.y *= l, this.z *= l, this.w *= l, this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            return h.x += this._x * l, h.y += this._y * l, h.z += this._z * l, h.w += this._w * l, this;\n          }, g.prototype.multiply = function(l) {\n            var h = new g(0, 0, 0, 1);\n            return this.multiplyToRef(l, h), h;\n          }, g.prototype.multiplyToRef = function(l, h) {\n            var v = this._x * l._w + this._y * l._z - this._z * l._y + this._w * l._x, b = -this._x * l._z + this._y * l._w + this._z * l._x + this._w * l._y, D = this._x * l._y - this._y * l._x + this._z * l._w + this._w * l._z, w = -this._x * l._x - this._y * l._y - this._z * l._z + this._w * l._w;\n            return h.copyFromFloats(v, b, D, w), this;\n          }, g.prototype.multiplyInPlace = function(l) {\n            return this.multiplyToRef(l, this), this;\n          }, g.prototype.conjugateToRef = function(l) {\n            return l.copyFromFloats(-this._x, -this._y, -this._z, this._w), this;\n          }, g.prototype.conjugateInPlace = function() {\n            return this.x *= -1, this.y *= -1, this.z *= -1, this;\n          }, g.prototype.conjugate = function() {\n            return new g(-this._x, -this._y, -this._z, this._w);\n          }, g.prototype.length = function() {\n            return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n          }, g.prototype.normalize = function() {\n            var l = this.length();\n            if (l === 0)\n              return this;\n            var h = 1 / l;\n            return this.x *= h, this.y *= h, this.z *= h, this.w *= h, this;\n          }, g.prototype.toEulerAngles = function(l) {\n            var h = x.Zero();\n            return this.toEulerAnglesToRef(h), h;\n          }, g.prototype.toEulerAnglesToRef = function(l) {\n            var h = this._z, v = this._x, b = this._y, D = this._w, w = D * D, N = h * h, M = v * v, U = b * b, X = b * h - v * D;\n            return X < -0.4999999 ? (l.y = 2 * Math.atan2(b, D), l.x = Math.PI / 2, l.z = 0) : X > 0.4999999 ? (l.y = 2 * Math.atan2(b, D), l.x = -Math.PI / 2, l.z = 0) : (l.z = Math.atan2(2 * (v * b + h * D), -N - M + U + w), l.x = Math.asin(-2 * (h * b - v * D)), l.y = Math.atan2(2 * (h * v + b * D), N - M - U + w)), this;\n          }, g.prototype.toRotationMatrix = function(l) {\n            return T.FromQuaternionToRef(this, l), this;\n          }, g.prototype.fromRotationMatrix = function(l) {\n            return g.FromRotationMatrixToRef(l, this), this;\n          }, g.FromRotationMatrix = function(l) {\n            var h = new g();\n            return g.FromRotationMatrixToRef(l, h), h;\n          }, g.FromRotationMatrixToRef = function(l, h) {\n            var v, b = l.m, D = b[0], w = b[4], N = b[8], M = b[1], U = b[5], X = b[9], j = b[2], ne = b[6], te = b[10], de = D + U + te;\n            de > 0 ? (v = 0.5 / Math.sqrt(de + 1), h.w = 0.25 / v, h.x = (ne - X) * v, h.y = (N - j) * v, h.z = (M - w) * v) : D > U && D > te ? (v = 2 * Math.sqrt(1 + D - U - te), h.w = (ne - X) / v, h.x = 0.25 * v, h.y = (w + M) / v, h.z = (N + j) / v) : U > te ? (v = 2 * Math.sqrt(1 + U - D - te), h.w = (N - j) / v, h.x = (w + M) / v, h.y = 0.25 * v, h.z = (X + ne) / v) : (v = 2 * Math.sqrt(1 + te - D - U), h.w = (M - w) / v, h.x = (N + j) / v, h.y = (X + ne) / v, h.z = 0.25 * v);\n          }, g.Dot = function(l, h) {\n            return l._x * h._x + l._y * h._y + l._z * h._z + l._w * h._w;\n          }, g.AreClose = function(l, h) {\n            return g.Dot(l, h) >= 0;\n          }, g.Zero = function() {\n            return new g(0, 0, 0, 0);\n          }, g.Inverse = function(l) {\n            return new g(-l._x, -l._y, -l._z, l._w);\n          }, g.InverseToRef = function(l, h) {\n            return h.set(-l._x, -l._y, -l._z, l._w), h;\n          }, g.Identity = function() {\n            return new g(0, 0, 0, 1);\n          }, g.IsIdentity = function(l) {\n            return l && l._x === 0 && l._y === 0 && l._z === 0 && l._w === 1;\n          }, g.RotationAxis = function(l, h) {\n            return g.RotationAxisToRef(l, h, new g());\n          }, g.RotationAxisToRef = function(l, h, v) {\n            var b = Math.sin(h / 2);\n            return l.normalize(), v.w = Math.cos(h / 2), v.x = l._x * b, v.y = l._y * b, v.z = l._z * b, v;\n          }, g.FromArray = function(l, h) {\n            return h || (h = 0), new g(l[h], l[h + 1], l[h + 2], l[h + 3]);\n          }, g.FromArrayToRef = function(l, h, v) {\n            v.x = l[h], v.y = l[h + 1], v.z = l[h + 2], v.w = l[h + 3];\n          }, g.FromEulerAngles = function(l, h, v) {\n            var b = new g();\n            return g.RotationYawPitchRollToRef(h, l, v, b), b;\n          }, g.FromEulerAnglesToRef = function(l, h, v, b) {\n            return g.RotationYawPitchRollToRef(h, l, v, b), b;\n          }, g.FromEulerVector = function(l) {\n            var h = new g();\n            return g.RotationYawPitchRollToRef(l._y, l._x, l._z, h), h;\n          }, g.FromEulerVectorToRef = function(l, h) {\n            return g.RotationYawPitchRollToRef(l._y, l._x, l._z, h), h;\n          }, g.RotationYawPitchRoll = function(l, h, v) {\n            var b = new g();\n            return g.RotationYawPitchRollToRef(l, h, v, b), b;\n          }, g.RotationYawPitchRollToRef = function(l, h, v, b) {\n            var D = 0.5 * v, w = 0.5 * h, N = 0.5 * l, M = Math.sin(D), U = Math.cos(D), X = Math.sin(w), j = Math.cos(w), ne = Math.sin(N), te = Math.cos(N);\n            b.x = te * X * U + ne * j * M, b.y = ne * j * U - te * X * M, b.z = te * j * M - ne * X * U, b.w = te * j * U + ne * X * M;\n          }, g.RotationAlphaBetaGamma = function(l, h, v) {\n            var b = new g();\n            return g.RotationAlphaBetaGammaToRef(l, h, v, b), b;\n          }, g.RotationAlphaBetaGammaToRef = function(l, h, v, b) {\n            var D = 0.5 * (v + l), w = 0.5 * (v - l), N = 0.5 * h;\n            b.x = Math.cos(w) * Math.sin(N), b.y = Math.sin(w) * Math.sin(N), b.z = Math.sin(D) * Math.cos(N), b.w = Math.cos(D) * Math.cos(N);\n          }, g.RotationQuaternionFromAxis = function(l, h, v) {\n            var b = new g(0, 0, 0, 0);\n            return g.RotationQuaternionFromAxisToRef(l, h, v, b), b;\n          }, g.RotationQuaternionFromAxisToRef = function(l, h, v, b) {\n            var D = S.Matrix[0];\n            T.FromXYZAxesToRef(l.normalize(), h.normalize(), v.normalize(), D), g.FromRotationMatrixToRef(D, b);\n          }, g.Slerp = function(l, h, v) {\n            var b = g.Identity();\n            return g.SlerpToRef(l, h, v, b), b;\n          }, g.SlerpToRef = function(l, h, v, b) {\n            var D, w, N = l._x * h._x + l._y * h._y + l._z * h._z + l._w * h._w, M = !1;\n            if (N < 0 && (M = !0, N = -N), N > 0.999999)\n              w = 1 - v, D = M ? -v : v;\n            else {\n              var U = Math.acos(N), X = 1 / Math.sin(U);\n              w = Math.sin((1 - v) * U) * X, D = M ? -Math.sin(v * U) * X : Math.sin(v * U) * X;\n            }\n            b.x = w * l._x + D * h._x, b.y = w * l._y + D * h._y, b.z = w * l._z + D * h._z, b.w = w * l._w + D * h._w;\n          }, g.Hermite = function(l, h, v, b, D) {\n            var w = D * D, N = D * w, M = 2 * N - 3 * w + 1, U = -2 * N + 3 * w, X = N - 2 * w + D, j = N - w;\n            return new g(l._x * M + v._x * U + h._x * X + b._x * j, l._y * M + v._y * U + h._y * X + b._y * j, l._z * M + v._z * U + h._z * X + b._z * j, l._w * M + v._w * U + h._w * X + b._w * j);\n          }, g;\n        }(), T = function() {\n          function g() {\n            this._isIdentity = !1, this._isIdentityDirty = !0, this._isIdentity3x2 = !0, this._isIdentity3x2Dirty = !0, this.updateFlag = -1, I.a.MatrixTrackPrecisionChange && I.a.MatrixTrackedMatrices.push(this), this._m = new I.a.MatrixCurrentType(16), this._updateIdentityStatus(!1);\n          }\n          return Object.defineProperty(g, \"Use64Bits\", { get: function() {\n            return I.a.MatrixUse64Bits;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"m\", { get: function() {\n            return this._m;\n          }, enumerable: !1, configurable: !0 }), g.prototype._markAsUpdated = function() {\n            this.updateFlag = g._updateFlagSeed++, this._isIdentity = !1, this._isIdentity3x2 = !1, this._isIdentityDirty = !0, this._isIdentity3x2Dirty = !0;\n          }, g.prototype._updateIdentityStatus = function(l, h, v, b) {\n            h === void 0 && (h = !1), v === void 0 && (v = !1), b === void 0 && (b = !0), this.updateFlag = g._updateFlagSeed++, this._isIdentity = l, this._isIdentity3x2 = l || v, this._isIdentityDirty = !this._isIdentity && h, this._isIdentity3x2Dirty = !this._isIdentity3x2 && b;\n          }, g.prototype.isIdentity = function() {\n            if (this._isIdentityDirty) {\n              this._isIdentityDirty = !1;\n              var l = this._m;\n              this._isIdentity = l[0] === 1 && l[1] === 0 && l[2] === 0 && l[3] === 0 && l[4] === 0 && l[5] === 1 && l[6] === 0 && l[7] === 0 && l[8] === 0 && l[9] === 0 && l[10] === 1 && l[11] === 0 && l[12] === 0 && l[13] === 0 && l[14] === 0 && l[15] === 1;\n            }\n            return this._isIdentity;\n          }, g.prototype.isIdentityAs3x2 = function() {\n            return this._isIdentity3x2Dirty && (this._isIdentity3x2Dirty = !1, this._m[0] !== 1 || this._m[5] !== 1 || this._m[15] !== 1 || this._m[1] !== 0 || this._m[2] !== 0 || this._m[3] !== 0 || this._m[4] !== 0 || this._m[6] !== 0 || this._m[7] !== 0 || this._m[8] !== 0 || this._m[9] !== 0 || this._m[10] !== 0 || this._m[11] !== 0 || this._m[12] !== 0 || this._m[13] !== 0 || this._m[14] !== 0 ? this._isIdentity3x2 = !1 : this._isIdentity3x2 = !0), this._isIdentity3x2;\n          }, g.prototype.determinant = function() {\n            if (this._isIdentity === !0)\n              return 1;\n            var l = this._m, h = l[0], v = l[1], b = l[2], D = l[3], w = l[4], N = l[5], M = l[6], U = l[7], X = l[8], j = l[9], ne = l[10], te = l[11], de = l[12], pe = l[13], ae = l[14], ee = l[15], K = ne * ee - ae * te, $ = j * ee - pe * te, L = j * ae - pe * ne, G = X * ee - de * te, Q = X * ae - ne * de, oe = X * pe - de * j;\n            return h * +(N * K - M * $ + U * L) + v * -(w * K - M * G + U * Q) + b * +(w * $ - N * G + U * oe) + D * -(w * L - N * Q + M * oe);\n          }, g.prototype.toArray = function() {\n            return this._m;\n          }, g.prototype.asArray = function() {\n            return this._m;\n          }, g.prototype.invert = function() {\n            return this.invertToRef(this), this;\n          }, g.prototype.reset = function() {\n            return g.FromValuesToRef(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, this), this._updateIdentityStatus(!1), this;\n          }, g.prototype.add = function(l) {\n            var h = new g();\n            return this.addToRef(l, h), h;\n          }, g.prototype.addToRef = function(l, h) {\n            for (var v = this._m, b = h._m, D = l.m, w = 0; w < 16; w++)\n              b[w] = v[w] + D[w];\n            return h._markAsUpdated(), this;\n          }, g.prototype.addToSelf = function(l) {\n            for (var h = this._m, v = l.m, b = 0; b < 16; b++)\n              h[b] += v[b];\n            return this._markAsUpdated(), this;\n          }, g.prototype.invertToRef = function(l) {\n            if (this._isIdentity === !0)\n              return g.IdentityToRef(l), this;\n            var h = this._m, v = h[0], b = h[1], D = h[2], w = h[3], N = h[4], M = h[5], U = h[6], X = h[7], j = h[8], ne = h[9], te = h[10], de = h[11], pe = h[12], ae = h[13], ee = h[14], K = h[15], $ = te * K - ee * de, L = ne * K - ae * de, G = ne * ee - ae * te, Q = j * K - pe * de, oe = j * ee - te * pe, re = j * ae - pe * ne, Y = +(M * $ - U * L + X * G), k = -(N * $ - U * Q + X * oe), H = +(N * L - M * Q + X * re), Z = -(N * G - M * oe + U * re), W = v * Y + b * k + D * H + w * Z;\n            if (W === 0)\n              return l.copyFrom(this), this;\n            var q = 1 / W, he = U * K - ee * X, ge = M * K - ae * X, me = M * ee - ae * U, _e = N * K - pe * X, ye = N * ee - pe * U, Pe = N * ae - pe * M, be = U * de - te * X, Fe = M * de - ne * X, ke = M * te - ne * U, We = N * de - j * X, je = N * te - j * U, He = N * ne - j * M, Qe = -(b * $ - D * L + w * G), Ge = +(v * $ - D * Q + w * oe), tt = -(v * L - b * Q + w * re), Je = +(v * G - b * oe + D * re), st = +(b * he - D * ge + w * me), at = -(v * he - D * _e + w * ye), pt = +(v * ge - b * _e + w * Pe), Tt = -(v * me - b * ye + D * Pe), Lt = -(b * be - D * Fe + w * ke), Ot = +(v * be - D * We + w * je), St = -(v * Fe - b * We + w * He), Ct = +(v * ke - b * je + D * He);\n            return g.FromValuesToRef(Y * q, Qe * q, st * q, Lt * q, k * q, Ge * q, at * q, Ot * q, H * q, tt * q, pt * q, St * q, Z * q, Je * q, Tt * q, Ct * q, l), this;\n          }, g.prototype.addAtIndex = function(l, h) {\n            return this._m[l] += h, this._markAsUpdated(), this;\n          }, g.prototype.multiplyAtIndex = function(l, h) {\n            return this._m[l] *= h, this._markAsUpdated(), this;\n          }, g.prototype.setTranslationFromFloats = function(l, h, v) {\n            return this._m[12] = l, this._m[13] = h, this._m[14] = v, this._markAsUpdated(), this;\n          }, g.prototype.addTranslationFromFloats = function(l, h, v) {\n            return this._m[12] += l, this._m[13] += h, this._m[14] += v, this._markAsUpdated(), this;\n          }, g.prototype.setTranslation = function(l) {\n            return this.setTranslationFromFloats(l._x, l._y, l._z);\n          }, g.prototype.getTranslation = function() {\n            return new x(this._m[12], this._m[13], this._m[14]);\n          }, g.prototype.getTranslationToRef = function(l) {\n            return l.x = this._m[12], l.y = this._m[13], l.z = this._m[14], this;\n          }, g.prototype.removeRotationAndScaling = function() {\n            var l = this.m;\n            return g.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, l[12], l[13], l[14], l[15], this), this._updateIdentityStatus(l[12] === 0 && l[13] === 0 && l[14] === 0 && l[15] === 1), this;\n          }, g.prototype.multiply = function(l) {\n            var h = new g();\n            return this.multiplyToRef(l, h), h;\n          }, g.prototype.copyFrom = function(l) {\n            l.copyToArray(this._m);\n            var h = l;\n            return this._updateIdentityStatus(h._isIdentity, h._isIdentityDirty, h._isIdentity3x2, h._isIdentity3x2Dirty), this;\n          }, g.prototype.copyToArray = function(l, h) {\n            h === void 0 && (h = 0);\n            var v = this._m;\n            return l[h] = v[0], l[h + 1] = v[1], l[h + 2] = v[2], l[h + 3] = v[3], l[h + 4] = v[4], l[h + 5] = v[5], l[h + 6] = v[6], l[h + 7] = v[7], l[h + 8] = v[8], l[h + 9] = v[9], l[h + 10] = v[10], l[h + 11] = v[11], l[h + 12] = v[12], l[h + 13] = v[13], l[h + 14] = v[14], l[h + 15] = v[15], this;\n          }, g.prototype.multiplyToRef = function(l, h) {\n            return this._isIdentity ? (h.copyFrom(l), this) : l._isIdentity ? (h.copyFrom(this), this) : (this.multiplyToArray(l, h._m, 0), h._markAsUpdated(), this);\n          }, g.prototype.multiplyToArray = function(l, h, v) {\n            var b = this._m, D = l.m, w = b[0], N = b[1], M = b[2], U = b[3], X = b[4], j = b[5], ne = b[6], te = b[7], de = b[8], pe = b[9], ae = b[10], ee = b[11], K = b[12], $ = b[13], L = b[14], G = b[15], Q = D[0], oe = D[1], re = D[2], Y = D[3], k = D[4], H = D[5], Z = D[6], W = D[7], q = D[8], he = D[9], ge = D[10], me = D[11], _e = D[12], ye = D[13], Pe = D[14], be = D[15];\n            return h[v] = w * Q + N * k + M * q + U * _e, h[v + 1] = w * oe + N * H + M * he + U * ye, h[v + 2] = w * re + N * Z + M * ge + U * Pe, h[v + 3] = w * Y + N * W + M * me + U * be, h[v + 4] = X * Q + j * k + ne * q + te * _e, h[v + 5] = X * oe + j * H + ne * he + te * ye, h[v + 6] = X * re + j * Z + ne * ge + te * Pe, h[v + 7] = X * Y + j * W + ne * me + te * be, h[v + 8] = de * Q + pe * k + ae * q + ee * _e, h[v + 9] = de * oe + pe * H + ae * he + ee * ye, h[v + 10] = de * re + pe * Z + ae * ge + ee * Pe, h[v + 11] = de * Y + pe * W + ae * me + ee * be, h[v + 12] = K * Q + $ * k + L * q + G * _e, h[v + 13] = K * oe + $ * H + L * he + G * ye, h[v + 14] = K * re + $ * Z + L * ge + G * Pe, h[v + 15] = K * Y + $ * W + L * me + G * be, this;\n          }, g.prototype.equals = function(l) {\n            var h = l;\n            if (!h)\n              return !1;\n            if ((this._isIdentity || h._isIdentity) && !this._isIdentityDirty && !h._isIdentityDirty)\n              return this._isIdentity && h._isIdentity;\n            var v = this.m, b = h.m;\n            return v[0] === b[0] && v[1] === b[1] && v[2] === b[2] && v[3] === b[3] && v[4] === b[4] && v[5] === b[5] && v[6] === b[6] && v[7] === b[7] && v[8] === b[8] && v[9] === b[9] && v[10] === b[10] && v[11] === b[11] && v[12] === b[12] && v[13] === b[13] && v[14] === b[14] && v[15] === b[15];\n          }, g.prototype.clone = function() {\n            var l = new g();\n            return l.copyFrom(this), l;\n          }, g.prototype.getClassName = function() {\n            return \"Matrix\";\n          }, g.prototype.getHashCode = function() {\n            for (var l = 0 | this._m[0], h = 1; h < 16; h++)\n              l = 397 * l ^ (0 | this._m[h]);\n            return l;\n          }, g.prototype.decompose = function(l, h, v) {\n            if (this._isIdentity)\n              return v && v.setAll(0), l && l.setAll(1), h && h.copyFromFloats(0, 0, 0, 1), !0;\n            var b = this._m;\n            if (v && v.copyFromFloats(b[12], b[13], b[14]), (l = l || S.Vector3[0]).x = Math.sqrt(b[0] * b[0] + b[1] * b[1] + b[2] * b[2]), l.y = Math.sqrt(b[4] * b[4] + b[5] * b[5] + b[6] * b[6]), l.z = Math.sqrt(b[8] * b[8] + b[9] * b[9] + b[10] * b[10]), this.determinant() <= 0 && (l.y *= -1), l._x === 0 || l._y === 0 || l._z === 0)\n              return h && h.copyFromFloats(0, 0, 0, 1), !1;\n            if (h) {\n              var D = 1 / l._x, w = 1 / l._y, N = 1 / l._z;\n              g.FromValuesToRef(b[0] * D, b[1] * D, b[2] * D, 0, b[4] * w, b[5] * w, b[6] * w, 0, b[8] * N, b[9] * N, b[10] * N, 0, 0, 0, 0, 1, S.Matrix[0]), c.FromRotationMatrixToRef(S.Matrix[0], h);\n            }\n            return !0;\n          }, g.prototype.getRow = function(l) {\n            if (l < 0 || l > 3)\n              return null;\n            var h = 4 * l;\n            return new m(this._m[h + 0], this._m[h + 1], this._m[h + 2], this._m[h + 3]);\n          }, g.prototype.setRow = function(l, h) {\n            return this.setRowFromFloats(l, h.x, h.y, h.z, h.w);\n          }, g.prototype.transpose = function() {\n            return g.Transpose(this);\n          }, g.prototype.transposeToRef = function(l) {\n            return g.TransposeToRef(this, l), this;\n          }, g.prototype.setRowFromFloats = function(l, h, v, b, D) {\n            if (l < 0 || l > 3)\n              return this;\n            var w = 4 * l;\n            return this._m[w + 0] = h, this._m[w + 1] = v, this._m[w + 2] = b, this._m[w + 3] = D, this._markAsUpdated(), this;\n          }, g.prototype.scale = function(l) {\n            var h = new g();\n            return this.scaleToRef(l, h), h;\n          }, g.prototype.scaleToRef = function(l, h) {\n            for (var v = 0; v < 16; v++)\n              h._m[v] = this._m[v] * l;\n            return h._markAsUpdated(), this;\n          }, g.prototype.scaleAndAddToRef = function(l, h) {\n            for (var v = 0; v < 16; v++)\n              h._m[v] += this._m[v] * l;\n            return h._markAsUpdated(), this;\n          }, g.prototype.toNormalMatrix = function(l) {\n            var h = S.Matrix[0];\n            this.invertToRef(h), h.transposeToRef(l);\n            var v = l._m;\n            g.FromValuesToRef(v[0], v[1], v[2], 0, v[4], v[5], v[6], 0, v[8], v[9], v[10], 0, 0, 0, 0, 1, l);\n          }, g.prototype.getRotationMatrix = function() {\n            var l = new g();\n            return this.getRotationMatrixToRef(l), l;\n          }, g.prototype.getRotationMatrixToRef = function(l) {\n            var h = S.Vector3[0];\n            if (!this.decompose(h))\n              return g.IdentityToRef(l), this;\n            var v = this._m, b = 1 / h._x, D = 1 / h._y, w = 1 / h._z;\n            return g.FromValuesToRef(v[0] * b, v[1] * b, v[2] * b, 0, v[4] * D, v[5] * D, v[6] * D, 0, v[8] * w, v[9] * w, v[10] * w, 0, 0, 0, 0, 1, l), this;\n          }, g.prototype.toggleModelMatrixHandInPlace = function() {\n            var l = this._m;\n            l[2] *= -1, l[6] *= -1, l[8] *= -1, l[9] *= -1, l[14] *= -1, this._markAsUpdated();\n          }, g.prototype.toggleProjectionMatrixHandInPlace = function() {\n            var l = this._m;\n            l[8] *= -1, l[9] *= -1, l[10] *= -1, l[11] *= -1, this._markAsUpdated();\n          }, g.FromArray = function(l, h) {\n            h === void 0 && (h = 0);\n            var v = new g();\n            return g.FromArrayToRef(l, h, v), v;\n          }, g.FromArrayToRef = function(l, h, v) {\n            for (var b = 0; b < 16; b++)\n              v._m[b] = l[b + h];\n            v._markAsUpdated();\n          }, g.FromFloat32ArrayToRefScaled = function(l, h, v, b) {\n            for (var D = 0; D < 16; D++)\n              b._m[D] = l[D + h] * v;\n            b._markAsUpdated();\n          }, Object.defineProperty(g, \"IdentityReadOnly\", { get: function() {\n            return g._identityReadOnly;\n          }, enumerable: !1, configurable: !0 }), g.FromValuesToRef = function(l, h, v, b, D, w, N, M, U, X, j, ne, te, de, pe, ae, ee) {\n            var K = ee._m;\n            K[0] = l, K[1] = h, K[2] = v, K[3] = b, K[4] = D, K[5] = w, K[6] = N, K[7] = M, K[8] = U, K[9] = X, K[10] = j, K[11] = ne, K[12] = te, K[13] = de, K[14] = pe, K[15] = ae, ee._markAsUpdated();\n          }, g.FromValues = function(l, h, v, b, D, w, N, M, U, X, j, ne, te, de, pe, ae) {\n            var ee = new g(), K = ee._m;\n            return K[0] = l, K[1] = h, K[2] = v, K[3] = b, K[4] = D, K[5] = w, K[6] = N, K[7] = M, K[8] = U, K[9] = X, K[10] = j, K[11] = ne, K[12] = te, K[13] = de, K[14] = pe, K[15] = ae, ee._markAsUpdated(), ee;\n          }, g.Compose = function(l, h, v) {\n            var b = new g();\n            return g.ComposeToRef(l, h, v, b), b;\n          }, g.ComposeToRef = function(l, h, v, b) {\n            var D = b._m, w = h._x, N = h._y, M = h._z, U = h._w, X = w + w, j = N + N, ne = M + M, te = w * X, de = w * j, pe = w * ne, ae = N * j, ee = N * ne, K = M * ne, $ = U * X, L = U * j, G = U * ne, Q = l._x, oe = l._y, re = l._z;\n            D[0] = (1 - (ae + K)) * Q, D[1] = (de + G) * Q, D[2] = (pe - L) * Q, D[3] = 0, D[4] = (de - G) * oe, D[5] = (1 - (te + K)) * oe, D[6] = (ee + $) * oe, D[7] = 0, D[8] = (pe + L) * re, D[9] = (ee - $) * re, D[10] = (1 - (te + ae)) * re, D[11] = 0, D[12] = v._x, D[13] = v._y, D[14] = v._z, D[15] = 1, b._markAsUpdated();\n          }, g.Identity = function() {\n            var l = g.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n            return l._updateIdentityStatus(!0), l;\n          }, g.IdentityToRef = function(l) {\n            g.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, l), l._updateIdentityStatus(!0);\n          }, g.Zero = function() {\n            var l = g.FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n            return l._updateIdentityStatus(!1), l;\n          }, g.RotationX = function(l) {\n            var h = new g();\n            return g.RotationXToRef(l, h), h;\n          }, g.Invert = function(l) {\n            var h = new g();\n            return l.invertToRef(h), h;\n          }, g.RotationXToRef = function(l, h) {\n            var v = Math.sin(l), b = Math.cos(l);\n            g.FromValuesToRef(1, 0, 0, 0, 0, b, v, 0, 0, -v, b, 0, 0, 0, 0, 1, h), h._updateIdentityStatus(b === 1 && v === 0);\n          }, g.RotationY = function(l) {\n            var h = new g();\n            return g.RotationYToRef(l, h), h;\n          }, g.RotationYToRef = function(l, h) {\n            var v = Math.sin(l), b = Math.cos(l);\n            g.FromValuesToRef(b, 0, -v, 0, 0, 1, 0, 0, v, 0, b, 0, 0, 0, 0, 1, h), h._updateIdentityStatus(b === 1 && v === 0);\n          }, g.RotationZ = function(l) {\n            var h = new g();\n            return g.RotationZToRef(l, h), h;\n          }, g.RotationZToRef = function(l, h) {\n            var v = Math.sin(l), b = Math.cos(l);\n            g.FromValuesToRef(b, v, 0, 0, -v, b, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, h), h._updateIdentityStatus(b === 1 && v === 0);\n          }, g.RotationAxis = function(l, h) {\n            var v = new g();\n            return g.RotationAxisToRef(l, h, v), v;\n          }, g.RotationAxisToRef = function(l, h, v) {\n            var b = Math.sin(-h), D = Math.cos(-h), w = 1 - D;\n            l.normalize();\n            var N = v._m;\n            N[0] = l._x * l._x * w + D, N[1] = l._x * l._y * w - l._z * b, N[2] = l._x * l._z * w + l._y * b, N[3] = 0, N[4] = l._y * l._x * w + l._z * b, N[5] = l._y * l._y * w + D, N[6] = l._y * l._z * w - l._x * b, N[7] = 0, N[8] = l._z * l._x * w - l._y * b, N[9] = l._z * l._y * w + l._x * b, N[10] = l._z * l._z * w + D, N[11] = 0, N[12] = 0, N[13] = 0, N[14] = 0, N[15] = 1, v._markAsUpdated();\n          }, g.RotationAlignToRef = function(l, h, v) {\n            var b = x.Cross(h, l), D = x.Dot(h, l), w = 1 / (1 + D), N = v._m;\n            N[0] = b._x * b._x * w + D, N[1] = b._y * b._x * w - b._z, N[2] = b._z * b._x * w + b._y, N[3] = 0, N[4] = b._x * b._y * w + b._z, N[5] = b._y * b._y * w + D, N[6] = b._z * b._y * w - b._x, N[7] = 0, N[8] = b._x * b._z * w - b._y, N[9] = b._y * b._z * w + b._x, N[10] = b._z * b._z * w + D, N[11] = 0, N[12] = 0, N[13] = 0, N[14] = 0, N[15] = 1, v._markAsUpdated();\n          }, g.RotationYawPitchRoll = function(l, h, v) {\n            var b = new g();\n            return g.RotationYawPitchRollToRef(l, h, v, b), b;\n          }, g.RotationYawPitchRollToRef = function(l, h, v, b) {\n            c.RotationYawPitchRollToRef(l, h, v, S.Quaternion[0]), S.Quaternion[0].toRotationMatrix(b);\n          }, g.Scaling = function(l, h, v) {\n            var b = new g();\n            return g.ScalingToRef(l, h, v, b), b;\n          }, g.ScalingToRef = function(l, h, v, b) {\n            g.FromValuesToRef(l, 0, 0, 0, 0, h, 0, 0, 0, 0, v, 0, 0, 0, 0, 1, b), b._updateIdentityStatus(l === 1 && h === 1 && v === 1);\n          }, g.Translation = function(l, h, v) {\n            var b = new g();\n            return g.TranslationToRef(l, h, v, b), b;\n          }, g.TranslationToRef = function(l, h, v, b) {\n            g.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, l, h, v, 1, b), b._updateIdentityStatus(l === 0 && h === 0 && v === 0);\n          }, g.Lerp = function(l, h, v) {\n            var b = new g();\n            return g.LerpToRef(l, h, v, b), b;\n          }, g.LerpToRef = function(l, h, v, b) {\n            for (var D = b._m, w = l.m, N = h.m, M = 0; M < 16; M++)\n              D[M] = w[M] * (1 - v) + N[M] * v;\n            b._markAsUpdated();\n          }, g.DecomposeLerp = function(l, h, v) {\n            var b = new g();\n            return g.DecomposeLerpToRef(l, h, v, b), b;\n          }, g.DecomposeLerpToRef = function(l, h, v, b) {\n            var D = S.Vector3[0], w = S.Quaternion[0], N = S.Vector3[1];\n            l.decompose(D, w, N);\n            var M = S.Vector3[2], U = S.Quaternion[1], X = S.Vector3[3];\n            h.decompose(M, U, X);\n            var j = S.Vector3[4];\n            x.LerpToRef(D, M, v, j);\n            var ne = S.Quaternion[2];\n            c.SlerpToRef(w, U, v, ne);\n            var te = S.Vector3[5];\n            x.LerpToRef(N, X, v, te), g.ComposeToRef(j, ne, te, b);\n          }, g.LookAtLH = function(l, h, v) {\n            var b = new g();\n            return g.LookAtLHToRef(l, h, v, b), b;\n          }, g.LookAtLHToRef = function(l, h, v, b) {\n            var D = S.Vector3[0], w = S.Vector3[1], N = S.Vector3[2];\n            h.subtractToRef(l, N), N.normalize(), x.CrossToRef(v, N, D);\n            var M = D.lengthSquared();\n            M === 0 ? D.x = 1 : D.normalizeFromLength(Math.sqrt(M)), x.CrossToRef(N, D, w), w.normalize();\n            var U = -x.Dot(D, l), X = -x.Dot(w, l), j = -x.Dot(N, l);\n            g.FromValuesToRef(D._x, w._x, N._x, 0, D._y, w._y, N._y, 0, D._z, w._z, N._z, 0, U, X, j, 1, b);\n          }, g.LookAtRH = function(l, h, v) {\n            var b = new g();\n            return g.LookAtRHToRef(l, h, v, b), b;\n          }, g.LookAtRHToRef = function(l, h, v, b) {\n            var D = S.Vector3[0], w = S.Vector3[1], N = S.Vector3[2];\n            l.subtractToRef(h, N), N.normalize(), x.CrossToRef(v, N, D);\n            var M = D.lengthSquared();\n            M === 0 ? D.x = 1 : D.normalizeFromLength(Math.sqrt(M)), x.CrossToRef(N, D, w), w.normalize();\n            var U = -x.Dot(D, l), X = -x.Dot(w, l), j = -x.Dot(N, l);\n            g.FromValuesToRef(D._x, w._x, N._x, 0, D._y, w._y, N._y, 0, D._z, w._z, N._z, 0, U, X, j, 1, b);\n          }, g.OrthoLH = function(l, h, v, b) {\n            var D = new g();\n            return g.OrthoLHToRef(l, h, v, b, D), D;\n          }, g.OrthoLHToRef = function(l, h, v, b, D) {\n            var w = 2 / l, N = 2 / h, M = 2 / (b - v), U = -(b + v) / (b - v);\n            g.FromValuesToRef(w, 0, 0, 0, 0, N, 0, 0, 0, 0, M, 0, 0, 0, U, 1, D), D._updateIdentityStatus(w === 1 && N === 1 && M === 1 && U === 0);\n          }, g.OrthoOffCenterLH = function(l, h, v, b, D, w) {\n            var N = new g();\n            return g.OrthoOffCenterLHToRef(l, h, v, b, D, w, N), N;\n          }, g.OrthoOffCenterLHToRef = function(l, h, v, b, D, w, N) {\n            var M = 2 / (h - l), U = 2 / (b - v), X = 2 / (w - D), j = -(w + D) / (w - D), ne = (l + h) / (l - h), te = (b + v) / (v - b);\n            g.FromValuesToRef(M, 0, 0, 0, 0, U, 0, 0, 0, 0, X, 0, ne, te, j, 1, N), N._markAsUpdated();\n          }, g.OrthoOffCenterRH = function(l, h, v, b, D, w) {\n            var N = new g();\n            return g.OrthoOffCenterRHToRef(l, h, v, b, D, w, N), N;\n          }, g.OrthoOffCenterRHToRef = function(l, h, v, b, D, w, N) {\n            g.OrthoOffCenterLHToRef(l, h, v, b, D, w, N), N._m[10] *= -1;\n          }, g.PerspectiveLH = function(l, h, v, b) {\n            var D = new g(), w = 2 * v / l, N = 2 * v / h, M = (b + v) / (b - v), U = -2 * b * v / (b - v);\n            return g.FromValuesToRef(w, 0, 0, 0, 0, N, 0, 0, 0, 0, M, 1, 0, 0, U, 0, D), D._updateIdentityStatus(!1), D;\n          }, g.PerspectiveFovLH = function(l, h, v, b) {\n            var D = new g();\n            return g.PerspectiveFovLHToRef(l, h, v, b, D), D;\n          }, g.PerspectiveFovLHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = v, M = b, U = 1 / Math.tan(0.5 * l), X = w ? U / h : U, j = w ? U : U * h, ne = (M + N) / (M - N), te = -2 * M * N / (M - N);\n            g.FromValuesToRef(X, 0, 0, 0, 0, j, 0, 0, 0, 0, ne, 1, 0, 0, te, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovReverseLHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = 1 / Math.tan(0.5 * l), M = w ? N / h : N, U = w ? N : N * h;\n            g.FromValuesToRef(M, 0, 0, 0, 0, U, 0, 0, 0, 0, -v, 1, 0, 0, 1, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovRH = function(l, h, v, b) {\n            var D = new g();\n            return g.PerspectiveFovRHToRef(l, h, v, b, D), D;\n          }, g.PerspectiveFovRHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = v, M = b, U = 1 / Math.tan(0.5 * l), X = w ? U / h : U, j = w ? U : U * h, ne = -(M + N) / (M - N), te = -2 * M * N / (M - N);\n            g.FromValuesToRef(X, 0, 0, 0, 0, j, 0, 0, 0, 0, ne, -1, 0, 0, te, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovReverseRHToRef = function(l, h, v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = 1 / Math.tan(0.5 * l), M = w ? N / h : N, U = w ? N : N * h;\n            g.FromValuesToRef(M, 0, 0, 0, 0, U, 0, 0, 0, 0, -v, -1, 0, 0, -1, 0, D), D._updateIdentityStatus(!1);\n          }, g.PerspectiveFovWebVRToRef = function(l, h, v, b, D) {\n            D === void 0 && (D = !1);\n            var w = D ? -1 : 1, N = Math.tan(l.upDegrees * Math.PI / 180), M = Math.tan(l.downDegrees * Math.PI / 180), U = Math.tan(l.leftDegrees * Math.PI / 180), X = Math.tan(l.rightDegrees * Math.PI / 180), j = 2 / (U + X), ne = 2 / (N + M), te = b._m;\n            te[0] = j, te[1] = te[2] = te[3] = te[4] = 0, te[5] = ne, te[6] = te[7] = 0, te[8] = (U - X) * j * 0.5, te[9] = -(N - M) * ne * 0.5, te[10] = -v / (h - v), te[11] = 1 * w, te[12] = te[13] = te[15] = 0, te[14] = -2 * v * h / (v - h), b._markAsUpdated();\n          }, g.GetFinalMatrix = function(l, h, v, b, D, w) {\n            var N = l.width, M = l.height, U = l.x, X = l.y, j = g.FromValues(N / 2, 0, 0, 0, 0, -M / 2, 0, 0, 0, 0, w - D, 0, U + N / 2, M / 2 + X, D, 1), ne = S.Matrix[0];\n            return h.multiplyToRef(v, ne), ne.multiplyToRef(b, ne), ne.multiply(j);\n          }, g.GetAsMatrix2x2 = function(l) {\n            var h = l.m, v = [h[0], h[1], h[4], h[5]];\n            return I.a.MatrixUse64Bits ? v : new Float32Array(v);\n          }, g.GetAsMatrix3x3 = function(l) {\n            var h = l.m, v = [h[0], h[1], h[2], h[4], h[5], h[6], h[8], h[9], h[10]];\n            return I.a.MatrixUse64Bits ? v : new Float32Array(v);\n          }, g.Transpose = function(l) {\n            var h = new g();\n            return g.TransposeToRef(l, h), h;\n          }, g.TransposeToRef = function(l, h) {\n            var v = h._m, b = l.m;\n            v[0] = b[0], v[1] = b[4], v[2] = b[8], v[3] = b[12], v[4] = b[1], v[5] = b[5], v[6] = b[9], v[7] = b[13], v[8] = b[2], v[9] = b[6], v[10] = b[10], v[11] = b[14], v[12] = b[3], v[13] = b[7], v[14] = b[11], v[15] = b[15], h._updateIdentityStatus(l._isIdentity, l._isIdentityDirty);\n          }, g.Reflection = function(l) {\n            var h = new g();\n            return g.ReflectionToRef(l, h), h;\n          }, g.ReflectionToRef = function(l, h) {\n            l.normalize();\n            var v = l.normal.x, b = l.normal.y, D = l.normal.z, w = -2 * v, N = -2 * b, M = -2 * D;\n            g.FromValuesToRef(w * v + 1, N * v, M * v, 0, w * b, N * b + 1, M * b, 0, w * D, N * D, M * D + 1, 0, w * l.d, N * l.d, M * l.d, 1, h);\n          }, g.FromXYZAxesToRef = function(l, h, v, b) {\n            g.FromValuesToRef(l._x, l._y, l._z, 0, h._x, h._y, h._z, 0, v._x, v._y, v._z, 0, 0, 0, 0, 1, b);\n          }, g.FromQuaternionToRef = function(l, h) {\n            var v = l._x * l._x, b = l._y * l._y, D = l._z * l._z, w = l._x * l._y, N = l._z * l._w, M = l._z * l._x, U = l._y * l._w, X = l._y * l._z, j = l._x * l._w;\n            h._m[0] = 1 - 2 * (b + D), h._m[1] = 2 * (w + N), h._m[2] = 2 * (M - U), h._m[3] = 0, h._m[4] = 2 * (w - N), h._m[5] = 1 - 2 * (D + v), h._m[6] = 2 * (X + j), h._m[7] = 0, h._m[8] = 2 * (M + U), h._m[9] = 2 * (X - j), h._m[10] = 1 - 2 * (b + v), h._m[11] = 0, h._m[12] = 0, h._m[13] = 0, h._m[14] = 0, h._m[15] = 1, h._markAsUpdated();\n          }, g._updateFlagSeed = 0, g._identityReadOnly = g.Identity(), g;\n        }(), S = function() {\n          function g() {\n          }\n          return g.Vector3 = C.a.BuildArray(6, x.Zero), g.Matrix = C.a.BuildArray(2, T.Identity), g.Quaternion = C.a.BuildArray(3, c.Zero), g;\n        }(), E = function() {\n          function g() {\n          }\n          return g.Vector2 = C.a.BuildArray(3, O.Zero), g.Vector3 = C.a.BuildArray(13, x.Zero), g.Vector4 = C.a.BuildArray(3, m.Zero), g.Quaternion = C.a.BuildArray(2, c.Zero), g.Matrix = C.a.BuildArray(8, T.Identity), g;\n        }();\n        u.a.RegisteredTypes[\"BABYLON.Vector2\"] = O, u.a.RegisteredTypes[\"BABYLON.Vector3\"] = x, u.a.RegisteredTypes[\"BABYLON.Vector4\"] = m, u.a.RegisteredTypes[\"BABYLON.Matrix\"] = T;\n      }, function(Be, A, f) {\n        f.d(A, \"d\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        }), f.d(A, \"b\", function() {\n          return I;\n        }), f.d(A, \"e\", function() {\n          return O;\n        }), f.d(A, \"f\", function() {\n          return x;\n        });\n        /*! *****************************************************************************\n        \t\tCopyright (c) Microsoft Corporation.\n        \n        \t\tPermission to use, copy, modify, and/or distribute this software for any\n        \t\tpurpose with or without fee is hereby granted.\n        \n        \t\tTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n        \t\tREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n        \t\tAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n        \t\tINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n        \t\tLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n        \t\tOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n        \t\tPERFORMANCE OF THIS SOFTWARE.\n        \t\t***************************************************************************** */\n        var V = function(m, c) {\n          return (V = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(T, S) {\n            T.__proto__ = S;\n          } || function(T, S) {\n            for (var E in S)\n              Object.prototype.hasOwnProperty.call(S, E) && (T[E] = S[E]);\n          })(m, c);\n        };\n        function _(m, c) {\n          if (typeof c != \"function\" && c !== null)\n            throw new TypeError(\"Class extends value \" + String(c) + \" is not a constructor or null\");\n          function T() {\n            this.constructor = m;\n          }\n          V(m, c), m.prototype = c === null ? Object.create(c) : (T.prototype = c.prototype, new T());\n        }\n        var C = function() {\n          return (C = Object.assign || function(m) {\n            for (var c, T = 1, S = arguments.length; T < S; T++)\n              for (var E in c = arguments[T])\n                Object.prototype.hasOwnProperty.call(c, E) && (m[E] = c[E]);\n            return m;\n          }).apply(this, arguments);\n        };\n        function u(m, c, T, S) {\n          var E, g = arguments.length, l = g < 3 ? c : S === null ? S = Object.getOwnPropertyDescriptor(c, T) : S;\n          if (typeof Reflect == \"object\" && typeof Reflect.decorate == \"function\")\n            l = Reflect.decorate(m, c, T, S);\n          else\n            for (var h = m.length - 1; h >= 0; h--)\n              (E = m[h]) && (l = (g < 3 ? E(l) : g > 3 ? E(c, T, l) : E(c, T)) || l);\n          return g > 3 && l && Object.defineProperty(c, T, l), l;\n        }\n        function I(m, c, T, S) {\n          return new (T || (T = Promise))(function(E, g) {\n            function l(b) {\n              try {\n                v(S.next(b));\n              } catch (D) {\n                g(D);\n              }\n            }\n            function h(b) {\n              try {\n                v(S.throw(b));\n              } catch (D) {\n                g(D);\n              }\n            }\n            function v(b) {\n              var D;\n              b.done ? E(b.value) : (D = b.value, D instanceof T ? D : new T(function(w) {\n                w(D);\n              })).then(l, h);\n            }\n            v((S = S.apply(m, c || [])).next());\n          });\n        }\n        function O(m, c) {\n          var T, S, E, g, l = { label: 0, sent: function() {\n            if (1 & E[0])\n              throw E[1];\n            return E[1];\n          }, trys: [], ops: [] };\n          return g = { next: h(0), throw: h(1), return: h(2) }, typeof Symbol == \"function\" && (g[Symbol.iterator] = function() {\n            return this;\n          }), g;\n          function h(v) {\n            return function(b) {\n              return function(D) {\n                if (T)\n                  throw new TypeError(\"Generator is already executing.\");\n                for (; l; )\n                  try {\n                    if (T = 1, S && (E = 2 & D[0] ? S.return : D[0] ? S.throw || ((E = S.return) && E.call(S), 0) : S.next) && !(E = E.call(S, D[1])).done)\n                      return E;\n                    switch (S = 0, E && (D = [2 & D[0], E.value]), D[0]) {\n                      case 0:\n                      case 1:\n                        E = D;\n                        break;\n                      case 4:\n                        return l.label++, { value: D[1], done: !1 };\n                      case 5:\n                        l.label++, S = D[1], D = [0];\n                        continue;\n                      case 7:\n                        D = l.ops.pop(), l.trys.pop();\n                        continue;\n                      default:\n                        if (E = l.trys, !((E = E.length > 0 && E[E.length - 1]) || D[0] !== 6 && D[0] !== 2)) {\n                          l = 0;\n                          continue;\n                        }\n                        if (D[0] === 3 && (!E || D[1] > E[0] && D[1] < E[3])) {\n                          l.label = D[1];\n                          break;\n                        }\n                        if (D[0] === 6 && l.label < E[1]) {\n                          l.label = E[1], E = D;\n                          break;\n                        }\n                        if (E && l.label < E[2]) {\n                          l.label = E[2], l.ops.push(D);\n                          break;\n                        }\n                        E[2] && l.ops.pop(), l.trys.pop();\n                        continue;\n                    }\n                    D = c.call(m, l);\n                  } catch (w) {\n                    D = [6, w], S = 0;\n                  } finally {\n                    T = E = 0;\n                  }\n                if (5 & D[0])\n                  throw D[1];\n                return { value: D[0] ? D[1] : void 0, done: !0 };\n              }([v, b]);\n            };\n          }\n        }\n        function x() {\n          for (var m = 0, c = 0, T = arguments.length; c < T; c++)\n            m += arguments[c].length;\n          var S = Array(m), E = 0;\n          for (c = 0; c < T; c++)\n            for (var g = arguments[c], l = 0, h = g.length; l < h; l++, E++)\n              S[E] = g[l];\n          return S;\n        }\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.ALPHA_DISABLE = 0, _.ALPHA_ADD = 1, _.ALPHA_COMBINE = 2, _.ALPHA_SUBTRACT = 3, _.ALPHA_MULTIPLY = 4, _.ALPHA_MAXIMIZED = 5, _.ALPHA_ONEONE = 6, _.ALPHA_PREMULTIPLIED = 7, _.ALPHA_PREMULTIPLIED_PORTERDUFF = 8, _.ALPHA_INTERPOLATE = 9, _.ALPHA_SCREENMODE = 10, _.ALPHA_ONEONE_ONEONE = 11, _.ALPHA_ALPHATOCOLOR = 12, _.ALPHA_REVERSEONEMINUS = 13, _.ALPHA_SRC_DSTONEMINUSSRCALPHA = 14, _.ALPHA_ONEONE_ONEZERO = 15, _.ALPHA_EXCLUSION = 16, _.ALPHA_EQUATION_ADD = 0, _.ALPHA_EQUATION_SUBSTRACT = 1, _.ALPHA_EQUATION_REVERSE_SUBTRACT = 2, _.ALPHA_EQUATION_MAX = 3, _.ALPHA_EQUATION_MIN = 4, _.ALPHA_EQUATION_DARKEN = 5, _.DELAYLOADSTATE_NONE = 0, _.DELAYLOADSTATE_LOADED = 1, _.DELAYLOADSTATE_LOADING = 2, _.DELAYLOADSTATE_NOTLOADED = 4, _.NEVER = 512, _.ALWAYS = 519, _.LESS = 513, _.EQUAL = 514, _.LEQUAL = 515, _.GREATER = 516, _.GEQUAL = 518, _.NOTEQUAL = 517, _.KEEP = 7680, _.REPLACE = 7681, _.INCR = 7682, _.DECR = 7683, _.INVERT = 5386, _.INCR_WRAP = 34055, _.DECR_WRAP = 34056, _.TEXTURE_CLAMP_ADDRESSMODE = 0, _.TEXTURE_WRAP_ADDRESSMODE = 1, _.TEXTURE_MIRROR_ADDRESSMODE = 2, _.TEXTUREFORMAT_ALPHA = 0, _.TEXTUREFORMAT_LUMINANCE = 1, _.TEXTUREFORMAT_LUMINANCE_ALPHA = 2, _.TEXTUREFORMAT_RGB = 4, _.TEXTUREFORMAT_RGBA = 5, _.TEXTUREFORMAT_RED = 6, _.TEXTUREFORMAT_R = 6, _.TEXTUREFORMAT_RG = 7, _.TEXTUREFORMAT_RED_INTEGER = 8, _.TEXTUREFORMAT_R_INTEGER = 8, _.TEXTUREFORMAT_RG_INTEGER = 9, _.TEXTUREFORMAT_RGB_INTEGER = 10, _.TEXTUREFORMAT_RGBA_INTEGER = 11, _.TEXTURETYPE_UNSIGNED_BYTE = 0, _.TEXTURETYPE_UNSIGNED_INT = 0, _.TEXTURETYPE_FLOAT = 1, _.TEXTURETYPE_HALF_FLOAT = 2, _.TEXTURETYPE_BYTE = 3, _.TEXTURETYPE_SHORT = 4, _.TEXTURETYPE_UNSIGNED_SHORT = 5, _.TEXTURETYPE_INT = 6, _.TEXTURETYPE_UNSIGNED_INTEGER = 7, _.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8, _.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9, _.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10, _.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11, _.TEXTURETYPE_UNSIGNED_INT_24_8 = 12, _.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13, _.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14, _.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15, _.TEXTURE_NEAREST_SAMPLINGMODE = 1, _.TEXTURE_NEAREST_NEAREST = 1, _.TEXTURE_BILINEAR_SAMPLINGMODE = 2, _.TEXTURE_LINEAR_LINEAR = 2, _.TEXTURE_TRILINEAR_SAMPLINGMODE = 3, _.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3, _.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4, _.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5, _.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6, _.TEXTURE_NEAREST_LINEAR = 7, _.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8, _.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9, _.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10, _.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11, _.TEXTURE_LINEAR_NEAREST = 12, _.TEXTURE_EXPLICIT_MODE = 0, _.TEXTURE_SPHERICAL_MODE = 1, _.TEXTURE_PLANAR_MODE = 2, _.TEXTURE_CUBIC_MODE = 3, _.TEXTURE_PROJECTION_MODE = 4, _.TEXTURE_SKYBOX_MODE = 5, _.TEXTURE_INVCUBIC_MODE = 6, _.TEXTURE_EQUIRECTANGULAR_MODE = 7, _.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8, _.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9, _.TEXTURE_FILTERING_QUALITY_OFFLINE = 4096, _.TEXTURE_FILTERING_QUALITY_HIGH = 64, _.TEXTURE_FILTERING_QUALITY_MEDIUM = 16, _.TEXTURE_FILTERING_QUALITY_LOW = 8, _.SCALEMODE_FLOOR = 1, _.SCALEMODE_NEAREST = 2, _.SCALEMODE_CEILING = 3, _.MATERIAL_TextureDirtyFlag = 1, _.MATERIAL_LightDirtyFlag = 2, _.MATERIAL_FresnelDirtyFlag = 4, _.MATERIAL_AttributesDirtyFlag = 8, _.MATERIAL_MiscDirtyFlag = 16, _.MATERIAL_PrePassDirtyFlag = 32, _.MATERIAL_AllDirtyFlag = 63, _.MATERIAL_TriangleFillMode = 0, _.MATERIAL_WireFrameFillMode = 1, _.MATERIAL_PointFillMode = 2, _.MATERIAL_PointListDrawMode = 3, _.MATERIAL_LineListDrawMode = 4, _.MATERIAL_LineLoopDrawMode = 5, _.MATERIAL_LineStripDrawMode = 6, _.MATERIAL_TriangleStripDrawMode = 7, _.MATERIAL_TriangleFanDrawMode = 8, _.MATERIAL_ClockWiseSideOrientation = 0, _.MATERIAL_CounterClockWiseSideOrientation = 1, _.ACTION_NothingTrigger = 0, _.ACTION_OnPickTrigger = 1, _.ACTION_OnLeftPickTrigger = 2, _.ACTION_OnRightPickTrigger = 3, _.ACTION_OnCenterPickTrigger = 4, _.ACTION_OnPickDownTrigger = 5, _.ACTION_OnDoublePickTrigger = 6, _.ACTION_OnPickUpTrigger = 7, _.ACTION_OnPickOutTrigger = 16, _.ACTION_OnLongPressTrigger = 8, _.ACTION_OnPointerOverTrigger = 9, _.ACTION_OnPointerOutTrigger = 10, _.ACTION_OnEveryFrameTrigger = 11, _.ACTION_OnIntersectionEnterTrigger = 12, _.ACTION_OnIntersectionExitTrigger = 13, _.ACTION_OnKeyDownTrigger = 14, _.ACTION_OnKeyUpTrigger = 15, _.PARTICLES_BILLBOARDMODE_Y = 2, _.PARTICLES_BILLBOARDMODE_ALL = 7, _.PARTICLES_BILLBOARDMODE_STRETCHED = 8, _.MESHES_CULLINGSTRATEGY_STANDARD = 0, _.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = 1, _.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = 2, _.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = 3, _.SCENELOADER_NO_LOGGING = 0, _.SCENELOADER_MINIMAL_LOGGING = 1, _.SCENELOADER_SUMMARY_LOGGING = 2, _.SCENELOADER_DETAILED_LOGGING = 3, _.PREPASS_IRRADIANCE_TEXTURE_TYPE = 0, _.PREPASS_POSITION_TEXTURE_TYPE = 1, _.PREPASS_VELOCITY_TEXTURE_TYPE = 2, _.PREPASS_REFLECTIVITY_TEXTURE_TYPE = 3, _.PREPASS_COLOR_TEXTURE_TYPE = 4, _.PREPASS_DEPTHNORMAL_TEXTURE_TYPE = 5, _.PREPASS_ALBEDO_TEXTURE_TYPE = 6, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return T;\n        }), f.d(A, \"c\", function() {\n          return S;\n        }), f.d(A, \"m\", function() {\n          return E;\n        }), f.d(A, \"e\", function() {\n          return g;\n        }), f.d(A, \"h\", function() {\n          return l;\n        }), f.d(A, \"n\", function() {\n          return h;\n        }), f.d(A, \"o\", function() {\n          return v;\n        }), f.d(A, \"k\", function() {\n          return b;\n        }), f.d(A, \"g\", function() {\n          return D;\n        }), f.d(A, \"f\", function() {\n          return w;\n        }), f.d(A, \"i\", function() {\n          return N;\n        }), f.d(A, \"l\", function() {\n          return M;\n        }), f.d(A, \"j\", function() {\n          return U;\n        }), f.d(A, \"d\", function() {\n          return X;\n        }), f.d(A, \"a\", function() {\n          return j;\n        });\n        var V = f(37), _ = f(0), C = f(21), u = f(9), I = {}, O = {}, x = function(ne, te, de) {\n          var pe = ne();\n          V.a && V.a.AddTagsTo(pe, te.tags);\n          var ae = m(pe);\n          for (var ee in ae) {\n            var K = ae[ee], $ = te[ee], L = K.type;\n            if ($ != null && ee !== \"uniqueId\")\n              switch (L) {\n                case 0:\n                case 6:\n                case 11:\n                  pe[ee] = $;\n                  break;\n                case 1:\n                  pe[ee] = de || $.isRenderTarget ? $ : $.clone();\n                  break;\n                case 2:\n                case 3:\n                case 4:\n                case 5:\n                case 7:\n                case 10:\n                case 12:\n                  pe[ee] = de ? $ : $.clone();\n              }\n          }\n          return pe;\n        };\n        function m(ne) {\n          var te = ne.getClassName();\n          if (O[te])\n            return O[te];\n          O[te] = {};\n          for (var de = O[te], pe = ne, ae = te; ae; ) {\n            var ee = I[ae];\n            for (var K in ee)\n              de[K] = ee[K];\n            var $ = void 0, L = !1;\n            do {\n              if (!($ = Object.getPrototypeOf(pe)).getClassName) {\n                L = !0;\n                break;\n              }\n              if ($.getClassName() !== ae)\n                break;\n              pe = $;\n            } while ($);\n            if (L)\n              break;\n            ae = $.getClassName(), pe = $;\n          }\n          return de;\n        }\n        function c(ne, te) {\n          return function(de, pe) {\n            var ae = function(ee) {\n              var K = ee.getClassName();\n              return I[K] || (I[K] = {}), I[K];\n            }(de);\n            ae[pe] || (ae[pe] = { type: ne, sourceName: te });\n          };\n        }\n        function T(ne, te) {\n          return te === void 0 && (te = null), function(de, pe) {\n            return pe === void 0 && (pe = null), function(ae, ee) {\n              var K = pe || \"_\" + ee;\n              Object.defineProperty(ae, ee, { get: function() {\n                return this[K];\n              }, set: function($) {\n                this[K] !== $ && (this[K] = $, ae[de].apply(this));\n              }, enumerable: !0, configurable: !0 });\n            };\n          }(ne, te);\n        }\n        function S(ne) {\n          return c(0, ne);\n        }\n        function E(ne) {\n          return c(1, ne);\n        }\n        function g(ne) {\n          return c(2, ne);\n        }\n        function l(ne) {\n          return c(3, ne);\n        }\n        function h(ne) {\n          return c(4, ne);\n        }\n        function v(ne) {\n          return c(5, ne);\n        }\n        function b(ne) {\n          return c(6, ne);\n        }\n        function D(ne) {\n          return c(7, ne);\n        }\n        function w(ne) {\n          return c(8, ne);\n        }\n        function N(ne) {\n          return c(9, ne);\n        }\n        function M(ne) {\n          return c(10, ne);\n        }\n        function U(ne) {\n          return c(12, ne);\n        }\n        function X(ne) {\n          return c(11, ne);\n        }\n        var j = function() {\n          function ne() {\n          }\n          return ne.AppendSerializedAnimations = function(te, de) {\n            if (te.animations) {\n              de.animations = [];\n              for (var pe = 0; pe < te.animations.length; pe++) {\n                var ae = te.animations[pe];\n                de.animations.push(ae.serialize());\n              }\n            }\n          }, ne.Serialize = function(te, de) {\n            de || (de = {}), V.a && (de.tags = V.a.GetTags(te));\n            var pe = m(te);\n            for (var ae in pe) {\n              var ee = pe[ae], K = ee.sourceName || ae, $ = ee.type, L = te[ae];\n              if (L != null && ae !== \"uniqueId\")\n                switch ($) {\n                  case 0:\n                    de[K] = L;\n                    break;\n                  case 1:\n                    de[K] = L.serialize();\n                    break;\n                  case 2:\n                    de[K] = L.asArray();\n                    break;\n                  case 3:\n                    de[K] = L.serialize();\n                    break;\n                  case 4:\n                  case 5:\n                    de[K] = L.asArray();\n                    break;\n                  case 6:\n                    de[K] = L.id;\n                    break;\n                  case 7:\n                    de[K] = L.serialize();\n                    break;\n                  case 8:\n                    de[K] = L.asArray();\n                    break;\n                  case 9:\n                    de[K] = L.serialize();\n                    break;\n                  case 10:\n                    de[K] = L.asArray();\n                    break;\n                  case 11:\n                    de[K] = L.id;\n                  case 12:\n                    de[K] = L.asArray();\n                }\n            }\n            return de;\n          }, ne.Parse = function(te, de, pe, ae) {\n            ae === void 0 && (ae = null);\n            var ee = te();\n            ae || (ae = \"\"), V.a && V.a.AddTagsTo(ee, de.tags);\n            var K = m(ee);\n            for (var $ in K) {\n              var L = K[$], G = de[L.sourceName || $], Q = L.type;\n              if (G != null && $ !== \"uniqueId\") {\n                var oe = ee;\n                switch (Q) {\n                  case 0:\n                    oe[$] = G;\n                    break;\n                  case 1:\n                    pe && (oe[$] = ne._TextureParser(G, pe, ae));\n                    break;\n                  case 2:\n                    oe[$] = u.a.FromArray(G);\n                    break;\n                  case 3:\n                    oe[$] = ne._FresnelParametersParser(G);\n                    break;\n                  case 4:\n                    oe[$] = _.d.FromArray(G);\n                    break;\n                  case 5:\n                    oe[$] = _.e.FromArray(G);\n                    break;\n                  case 6:\n                    pe && (oe[$] = pe.getLastMeshByID(G));\n                    break;\n                  case 7:\n                    oe[$] = ne._ColorCurvesParser(G);\n                    break;\n                  case 8:\n                    oe[$] = u.b.FromArray(G);\n                    break;\n                  case 9:\n                    oe[$] = ne._ImageProcessingConfigurationParser(G);\n                    break;\n                  case 10:\n                    oe[$] = _.b.FromArray(G);\n                    break;\n                  case 11:\n                    pe && (oe[$] = pe.getCameraByID(G));\n                  case 12:\n                    oe[$] = _.a.FromArray(G);\n                }\n              }\n            }\n            return ee;\n          }, ne.Clone = function(te, de) {\n            return x(te, de, !1);\n          }, ne.Instanciate = function(te, de) {\n            return x(te, de, !0);\n          }, ne._ImageProcessingConfigurationParser = function(te) {\n            throw C.a.WarnImport(\"ImageProcessingConfiguration\");\n          }, ne._FresnelParametersParser = function(te) {\n            throw C.a.WarnImport(\"FresnelParameters\");\n          }, ne._ColorCurvesParser = function(te) {\n            throw C.a.WarnImport(\"ColorCurves\");\n          }, ne._TextureParser = function(te, de, pe) {\n            throw C.a.WarnImport(\"Texture\");\n          }, ne;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        }), f.d(A, \"b\", function() {\n          return _;\n        });\n        var V = function() {\n          function C(u, I, O, x, m, c, T, S) {\n            x === void 0 && (x = 0), m === void 0 && (m = !1), c === void 0 && (c = !1), T === void 0 && (T = !1), this._isAlreadyOwned = !1, u.getScene ? this._engine = u.getScene().getEngine() : this._engine = u, this._updatable = O, this._instanced = c, this._divisor = S || 1, this._data = I, this.byteStride = T ? x : x * Float32Array.BYTES_PER_ELEMENT, m || this.create();\n          }\n          return C.prototype.createVertexBuffer = function(u, I, O, x, m, c, T) {\n            c === void 0 && (c = !1);\n            var S = c ? I : I * Float32Array.BYTES_PER_ELEMENT, E = x ? c ? x : x * Float32Array.BYTES_PER_ELEMENT : this.byteStride;\n            return new _(this._engine, this, u, this._updatable, !0, E, m === void 0 ? this._instanced : m, S, O, void 0, void 0, !0, this._divisor || T);\n          }, C.prototype.isUpdatable = function() {\n            return this._updatable;\n          }, C.prototype.getData = function() {\n            return this._data;\n          }, C.prototype.getBuffer = function() {\n            return this._buffer;\n          }, C.prototype.getStrideSize = function() {\n            return this.byteStride / Float32Array.BYTES_PER_ELEMENT;\n          }, C.prototype.create = function(u) {\n            u === void 0 && (u = null), !u && this._buffer || (u = u || this._data) && (this._buffer ? this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, u), this._data = u) : this._updatable ? (this._buffer = this._engine.createDynamicVertexBuffer(u), this._data = u) : this._buffer = this._engine.createVertexBuffer(u));\n          }, C.prototype._rebuild = function() {\n            this._buffer = null, this.create(this._data);\n          }, C.prototype.update = function(u) {\n            this.create(u);\n          }, C.prototype.updateDirectly = function(u, I, O, x) {\n            x === void 0 && (x = !1), this._buffer && this._updatable && (this._engine.updateDynamicVertexBuffer(this._buffer, u, x ? I : I * Float32Array.BYTES_PER_ELEMENT, O ? O * this.byteStride : void 0), this._data = null);\n          }, C.prototype._increaseReferences = function() {\n            this._buffer && (this._isAlreadyOwned ? this._buffer.references++ : this._isAlreadyOwned = !0);\n          }, C.prototype.dispose = function() {\n            this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null);\n          }, C;\n        }(), _ = function() {\n          function C(u, I, O, x, m, c, T, S, E, g, l, h, v, b) {\n            if (l === void 0 && (l = !1), h === void 0 && (h = !1), v === void 0 && (v = 1), b === void 0 && (b = !1), I instanceof V ? (this._buffer = I, this._ownsBuffer = b, b && this._buffer._increaseReferences()) : (this._buffer = new V(u, I, x, c, m, T, h), this._ownsBuffer = !0), this._kind = O, g == null) {\n              var D = this.getData();\n              this.type = C.FLOAT, D instanceof Int8Array ? this.type = C.BYTE : D instanceof Uint8Array ? this.type = C.UNSIGNED_BYTE : D instanceof Int16Array ? this.type = C.SHORT : D instanceof Uint16Array ? this.type = C.UNSIGNED_SHORT : D instanceof Int32Array ? this.type = C.INT : D instanceof Uint32Array && (this.type = C.UNSIGNED_INT);\n            } else\n              this.type = g;\n            var w = C.GetTypeByteLength(this.type);\n            h ? (this._size = E || (c ? c / w : C.DeduceStride(O)), this.byteStride = c || this._buffer.byteStride || this._size * w, this.byteOffset = S || 0) : (this._size = E || c || C.DeduceStride(O), this.byteStride = c ? c * w : this._buffer.byteStride || this._size * w, this.byteOffset = (S || 0) * w), this.normalized = l, this._instanced = T !== void 0 && T, this._instanceDivisor = T ? v : 0;\n          }\n          return Object.defineProperty(C.prototype, \"instanceDivisor\", { get: function() {\n            return this._instanceDivisor;\n          }, set: function(u) {\n            this._instanceDivisor = u, this._instanced = u != 0;\n          }, enumerable: !1, configurable: !0 }), C.prototype._rebuild = function() {\n            this._buffer && this._buffer._rebuild();\n          }, C.prototype.getKind = function() {\n            return this._kind;\n          }, C.prototype.isUpdatable = function() {\n            return this._buffer.isUpdatable();\n          }, C.prototype.getData = function() {\n            return this._buffer.getData();\n          }, C.prototype.getBuffer = function() {\n            return this._buffer.getBuffer();\n          }, C.prototype.getStrideSize = function() {\n            return this.byteStride / C.GetTypeByteLength(this.type);\n          }, C.prototype.getOffset = function() {\n            return this.byteOffset / C.GetTypeByteLength(this.type);\n          }, C.prototype.getSize = function() {\n            return this._size;\n          }, C.prototype.getIsInstanced = function() {\n            return this._instanced;\n          }, C.prototype.getInstanceDivisor = function() {\n            return this._instanceDivisor;\n          }, C.prototype.create = function(u) {\n            this._buffer.create(u);\n          }, C.prototype.update = function(u) {\n            this._buffer.update(u);\n          }, C.prototype.updateDirectly = function(u, I, O) {\n            O === void 0 && (O = !1), this._buffer.updateDirectly(u, I, void 0, O);\n          }, C.prototype.dispose = function() {\n            this._ownsBuffer && this._buffer.dispose();\n          }, C.prototype.forEach = function(u, I) {\n            C.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, u, this.normalized, I);\n          }, C.DeduceStride = function(u) {\n            switch (u) {\n              case C.UVKind:\n              case C.UV2Kind:\n              case C.UV3Kind:\n              case C.UV4Kind:\n              case C.UV5Kind:\n              case C.UV6Kind:\n                return 2;\n              case C.NormalKind:\n              case C.PositionKind:\n                return 3;\n              case C.ColorKind:\n              case C.MatricesIndicesKind:\n              case C.MatricesIndicesExtraKind:\n              case C.MatricesWeightsKind:\n              case C.MatricesWeightsExtraKind:\n              case C.TangentKind:\n                return 4;\n              default:\n                throw new Error(\"Invalid kind '\" + u + \"'\");\n            }\n          }, C.GetTypeByteLength = function(u) {\n            switch (u) {\n              case C.BYTE:\n              case C.UNSIGNED_BYTE:\n                return 1;\n              case C.SHORT:\n              case C.UNSIGNED_SHORT:\n                return 2;\n              case C.INT:\n              case C.UNSIGNED_INT:\n              case C.FLOAT:\n                return 4;\n              default:\n                throw new Error(\"Invalid type '\" + u + \"'\");\n            }\n          }, C.ForEach = function(u, I, O, x, m, c, T, S) {\n            if (u instanceof Array)\n              for (var E = I / 4, g = O / 4, l = 0; l < c; l += x) {\n                for (var h = 0; h < x; h++)\n                  S(u[E + h], l + h);\n                E += g;\n              }\n            else {\n              var v = u instanceof ArrayBuffer ? new DataView(u) : new DataView(u.buffer, u.byteOffset, u.byteLength), b = C.GetTypeByteLength(m);\n              for (l = 0; l < c; l += x) {\n                var D = I;\n                for (h = 0; h < x; h++)\n                  S(C._GetFloatValue(v, m, D, T), l + h), D += b;\n                I += O;\n              }\n            }\n          }, C._GetFloatValue = function(u, I, O, x) {\n            switch (I) {\n              case C.BYTE:\n                var m = u.getInt8(O);\n                return x && (m = Math.max(m / 127, -1)), m;\n              case C.UNSIGNED_BYTE:\n                return m = u.getUint8(O), x && (m /= 255), m;\n              case C.SHORT:\n                return m = u.getInt16(O, !0), x && (m = Math.max(m / 32767, -1)), m;\n              case C.UNSIGNED_SHORT:\n                return m = u.getUint16(O, !0), x && (m /= 65535), m;\n              case C.INT:\n                return u.getInt32(O, !0);\n              case C.UNSIGNED_INT:\n                return u.getUint32(O, !0);\n              case C.FLOAT:\n                return u.getFloat32(O, !0);\n              default:\n                throw new Error(\"Invalid component type \" + I);\n            }\n          }, C.BYTE = 5120, C.UNSIGNED_BYTE = 5121, C.SHORT = 5122, C.UNSIGNED_SHORT = 5123, C.INT = 5124, C.UNSIGNED_INT = 5125, C.FLOAT = 5126, C.PositionKind = \"position\", C.NormalKind = \"normal\", C.TangentKind = \"tangent\", C.UVKind = \"uv\", C.UV2Kind = \"uv2\", C.UV3Kind = \"uv3\", C.UV4Kind = \"uv4\", C.UV5Kind = \"uv5\", C.UV6Kind = \"uv6\", C.ColorKind = \"color\", C.MatricesIndicesKind = \"matricesIndices\", C.MatricesWeightsKind = \"matricesWeights\", C.MatricesIndicesExtraKind = \"matricesIndicesExtra\", C.MatricesWeightsExtraKind = \"matricesWeightsExtra\", C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(6), _ = f(2), C = f(38), u = f(8), I = f(128), O = function() {\n          function x(m, c, T, S, E, g, l, h, v, b) {\n            var D, w = this;\n            S === void 0 && (S = null), g === void 0 && (g = null), l === void 0 && (l = null), h === void 0 && (h = null), v === void 0 && (v = null), this.name = null, this.defines = \"\", this.onCompiled = null, this.onError = null, this.onBind = null, this.uniqueId = 0, this.onCompileObservable = new V.c(), this.onErrorObservable = new V.c(), this._onBindObservable = null, this._wasPreviouslyReady = !1, this._bonesComputationForcedToCPU = !1, this._multiTarget = !1, this._uniformBuffersNames = {}, this._samplers = {}, this._isReady = !1, this._compilationError = \"\", this._allFallbacksProcessed = !1, this._uniforms = {}, this._key = \"\", this._fallbacks = null, this._vertexSourceCode = \"\", this._fragmentSourceCode = \"\", this._vertexSourceCodeOverride = \"\", this._fragmentSourceCodeOverride = \"\", this._transformFeedbackVaryings = null, this._rawVertexSourceCode = \"\", this._rawFragmentSourceCode = \"\", this._pipelineContext = null, this._valueCache = {}, this.name = m;\n            var N, M, U = null;\n            if (c.attributes) {\n              var X = c;\n              if (this._engine = T, this._attributesNames = X.attributes, this._uniformsNames = X.uniformsNames.concat(X.samplers), this._samplerList = X.samplers.slice(), this.defines = X.defines, this.onError = X.onError, this.onCompiled = X.onCompiled, this._fallbacks = X.fallbacks, this._indexParameters = X.indexParameters, this._transformFeedbackVaryings = X.transformFeedbackVaryings || null, this._multiTarget = !!X.multiTarget, X.uniformBuffersNames) {\n                this._uniformBuffersNamesList = X.uniformBuffersNames.slice();\n                for (var j = 0; j < X.uniformBuffersNames.length; j++)\n                  this._uniformBuffersNames[X.uniformBuffersNames[j]] = j;\n              }\n              U = (D = X.processFinalCode) !== null && D !== void 0 ? D : null;\n            } else\n              this._engine = E, this.defines = g ?? \"\", this._uniformsNames = T.concat(S), this._samplerList = S ? S.slice() : [], this._attributesNames = c, this._uniformBuffersNamesList = [], this.onError = v, this.onCompiled = h, this._indexParameters = b, this._fallbacks = l;\n            this._attributeLocationByName = {}, this.uniqueId = x._uniqueIdSeed++;\n            var ne = C.a.IsWindowObjectExist() ? this._engine.getHostDocument() : null;\n            m.vertexSource ? N = \"source:\" + m.vertexSource : m.vertexElement ? (N = ne ? ne.getElementById(m.vertexElement) : null) || (N = m.vertexElement) : N = m.vertex || m, m.fragmentSource ? M = \"source:\" + m.fragmentSource : m.fragmentElement ? (M = ne ? ne.getElementById(m.fragmentElement) : null) || (M = m.fragmentElement) : M = m.fragment || m;\n            var te = { defines: this.defines.split(`\n`), indexParameters: this._indexParameters, isFragment: !1, shouldUseHighPrecisionShader: this._engine._shouldUseHighPrecisionShader, processor: this._engine._shaderProcessor, supportsUniformBuffers: this._engine.supportsUniformBuffers, shadersRepository: x.ShadersRepository, includesShadersStore: x.IncludesShadersStore, version: (100 * this._engine.webGLVersion).toString(), platformName: this._engine.webGLVersion >= 2 ? \"WEBGL2\" : \"WEBGL1\" };\n            this._loadShader(N, \"Vertex\", \"\", function(de) {\n              w._rawVertexSourceCode = de, w._loadShader(M, \"Fragment\", \"Pixel\", function(pe) {\n                w._rawFragmentSourceCode = pe, I.a.Process(de, te, function(ae) {\n                  U && (ae = U(\"vertex\", ae)), te.isFragment = !0, I.a.Process(pe, te, function(ee) {\n                    U && (ee = U(\"fragment\", ee)), w._useFinalCode(ae, ee, m);\n                  }, w._engine);\n                }, w._engine);\n              });\n            });\n          }\n          return Object.defineProperty(x.prototype, \"onBindObservable\", { get: function() {\n            return this._onBindObservable || (this._onBindObservable = new V.c()), this._onBindObservable;\n          }, enumerable: !1, configurable: !0 }), x.prototype._useFinalCode = function(m, c, T) {\n            if (T) {\n              var S = T.vertexElement || T.vertex || T.spectorName || T, E = T.fragmentElement || T.fragment || T.spectorName || T;\n              this._vertexSourceCode = \"#define SHADER_NAME vertex:\" + S + `\n` + m, this._fragmentSourceCode = \"#define SHADER_NAME fragment:\" + E + `\n` + c;\n            } else\n              this._vertexSourceCode = m, this._fragmentSourceCode = c;\n            this._prepareEffect();\n          }, Object.defineProperty(x.prototype, \"key\", { get: function() {\n            return this._key;\n          }, enumerable: !1, configurable: !0 }), x.prototype.isReady = function() {\n            try {\n              return this._isReadyInternal();\n            } catch {\n              return !1;\n            }\n          }, x.prototype._isReadyInternal = function() {\n            return !!this._isReady || !!this._pipelineContext && this._pipelineContext.isReady;\n          }, x.prototype.getEngine = function() {\n            return this._engine;\n          }, x.prototype.getPipelineContext = function() {\n            return this._pipelineContext;\n          }, x.prototype.getAttributesNames = function() {\n            return this._attributesNames;\n          }, x.prototype.getAttributeLocation = function(m) {\n            return this._attributes[m];\n          }, x.prototype.getAttributeLocationByName = function(m) {\n            return this._attributeLocationByName[m];\n          }, x.prototype.getAttributesCount = function() {\n            return this._attributes.length;\n          }, x.prototype.getUniformIndex = function(m) {\n            return this._uniformsNames.indexOf(m);\n          }, x.prototype.getUniform = function(m) {\n            return this._uniforms[m];\n          }, x.prototype.getSamplers = function() {\n            return this._samplerList;\n          }, x.prototype.getUniformNames = function() {\n            return this._uniformsNames;\n          }, x.prototype.getUniformBuffersNames = function() {\n            return this._uniformBuffersNamesList;\n          }, x.prototype.getIndexParameters = function() {\n            return this._indexParameters;\n          }, x.prototype.getCompilationError = function() {\n            return this._compilationError;\n          }, x.prototype.allFallbacksProcessed = function() {\n            return this._allFallbacksProcessed;\n          }, x.prototype.executeWhenCompiled = function(m) {\n            var c = this;\n            this.isReady() ? m(this) : (this.onCompileObservable.add(function(T) {\n              m(T);\n            }), this._pipelineContext && !this._pipelineContext.isAsync || setTimeout(function() {\n              c._checkIsReady(null);\n            }, 16));\n          }, x.prototype._checkIsReady = function(m) {\n            var c = this;\n            try {\n              if (this._isReadyInternal())\n                return;\n            } catch (T) {\n              return void this._processCompilationErrors(T, m);\n            }\n            setTimeout(function() {\n              c._checkIsReady(m);\n            }, 16);\n          }, x.prototype._loadShader = function(m, c, T, S) {\n            var E;\n            if (typeof HTMLElement < \"u\" && m instanceof HTMLElement)\n              return void S(C.a.GetDOMTextContent(m));\n            m.substr(0, 7) !== \"source:\" ? m.substr(0, 7) !== \"base64:\" ? x.ShadersStore[m + c + \"Shader\"] ? S(x.ShadersStore[m + c + \"Shader\"]) : T && x.ShadersStore[m + T + \"Shader\"] ? S(x.ShadersStore[m + T + \"Shader\"]) : (E = m[0] === \".\" || m[0] === \"/\" || m.indexOf(\"http\") > -1 ? m : x.ShadersRepository + m, this._engine._loadFile(E + \".\" + c.toLowerCase() + \".fx\", S)) : S(window.atob(m.substr(7))) : S(m.substr(7));\n          }, Object.defineProperty(x.prototype, \"vertexSourceCode\", { get: function() {\n            return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._vertexSourceCodeOverride : this._vertexSourceCode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"fragmentSourceCode\", { get: function() {\n            return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? this._fragmentSourceCodeOverride : this._fragmentSourceCode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"rawVertexSourceCode\", { get: function() {\n            return this._rawVertexSourceCode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"rawFragmentSourceCode\", { get: function() {\n            return this._rawFragmentSourceCode;\n          }, enumerable: !1, configurable: !0 }), x.prototype._rebuildProgram = function(m, c, T, S) {\n            var E = this;\n            this._isReady = !1, this._vertexSourceCodeOverride = m, this._fragmentSourceCodeOverride = c, this.onError = function(g, l) {\n              S && S(l);\n            }, this.onCompiled = function() {\n              var g = E.getEngine().scenes;\n              if (g)\n                for (var l = 0; l < g.length; l++)\n                  g[l].markAllMaterialsAsDirty(_.a.MATERIAL_AllDirtyFlag);\n              E._pipelineContext._handlesSpectorRebuildCallback(T);\n            }, this._fallbacks = null, this._prepareEffect();\n          }, x.prototype._prepareEffect = function() {\n            var m = this, c = this._attributesNames, T = this.defines;\n            this._valueCache = {};\n            var S = this._pipelineContext;\n            try {\n              var E = this._engine;\n              this._pipelineContext = E.createPipelineContext();\n              var g = this._rebuildProgram.bind(this);\n              this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride ? E._preparePipelineContext(this._pipelineContext, this._vertexSourceCodeOverride, this._fragmentSourceCodeOverride, !0, g, null, this._transformFeedbackVaryings) : E._preparePipelineContext(this._pipelineContext, this._vertexSourceCode, this._fragmentSourceCode, !1, g, T, this._transformFeedbackVaryings), E._executeWhenRenderingStateIsCompiled(this._pipelineContext, function() {\n                if (E.supportsUniformBuffers)\n                  for (var l in m._uniformBuffersNames)\n                    m.bindUniformBlock(l, m._uniformBuffersNames[l]);\n                var h;\n                if (E.getUniforms(m._pipelineContext, m._uniformsNames).forEach(function(D, w) {\n                  m._uniforms[m._uniformsNames[w]] = D;\n                }), m._attributes = E.getAttributes(m._pipelineContext, c), c)\n                  for (var v = 0; v < c.length; v++) {\n                    var b = c[v];\n                    m._attributeLocationByName[b] = m._attributes[v];\n                  }\n                for (h = 0; h < m._samplerList.length; h++)\n                  m.getUniform(m._samplerList[h]) == null && (m._samplerList.splice(h, 1), h--);\n                m._samplerList.forEach(function(D, w) {\n                  m._samplers[D] = w;\n                }), E.bindSamplers(m), m._compilationError = \"\", m._isReady = !0, m.onCompiled && m.onCompiled(m), m.onCompileObservable.notifyObservers(m), m.onCompileObservable.clear(), m._fallbacks && m._fallbacks.unBindMesh(), S && m.getEngine()._deletePipelineContext(S);\n              }), this._pipelineContext.isAsync && this._checkIsReady(S);\n            } catch (l) {\n              this._processCompilationErrors(l, S);\n            }\n          }, x.prototype._getShaderCodeAndErrorLine = function(m, c, T) {\n            var S = T ? /FRAGMENT SHADER ERROR: 0:(\\d+?):/ : /VERTEX SHADER ERROR: 0:(\\d+?):/, E = null;\n            if (c && m) {\n              var g = c.match(S);\n              if (g && g.length === 2) {\n                var l = parseInt(g[1]), h = m.split(`\n`, -1);\n                h.length >= l && (E = \"Offending line [\" + l + \"] in \" + (T ? \"fragment\" : \"vertex\") + \" code: \" + h[l - 1]);\n              }\n            }\n            return [m, E];\n          }, x.prototype._processCompilationErrors = function(m, c) {\n            var T, S, E, g, l;\n            c === void 0 && (c = null), this._compilationError = m.message;\n            var h = this._attributesNames, v = this._fallbacks;\n            if (u.a.Error(\"Unable to compile effect:\"), u.a.Error(\"Uniforms: \" + this._uniformsNames.map(function(N) {\n              return \" \" + N;\n            })), u.a.Error(\"Attributes: \" + h.map(function(N) {\n              return \" \" + N;\n            })), u.a.Error(`Defines:\\r\n` + this.defines), x.LogShaderCodeOnCompilationError) {\n              var b = null, D = null, w = null;\n              !((E = this._pipelineContext) === null || E === void 0) && E._getVertexShaderCode() && (w = (T = this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(), this._compilationError, !1))[0], b = T[1], w && (u.a.Error(\"Vertex code:\"), u.a.Error(w))), !((g = this._pipelineContext) === null || g === void 0) && g._getFragmentShaderCode() && (w = (S = this._getShaderCodeAndErrorLine((l = this._pipelineContext) === null || l === void 0 ? void 0 : l._getFragmentShaderCode(), this._compilationError, !0))[0], D = S[1], w && (u.a.Error(\"Fragment code:\"), u.a.Error(w))), b && u.a.Error(b), D && u.a.Error(D);\n            }\n            u.a.Error(\"Error: \" + this._compilationError), c && (this._pipelineContext = c, this._isReady = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this)), v ? (this._pipelineContext = null, v.hasMoreFallbacks ? (this._allFallbacksProcessed = !1, u.a.Error(\"Trying next fallback.\"), this.defines = v.reduce(this.defines, this), this._prepareEffect()) : (this._allFallbacksProcessed = !0, this.onError && this.onError(this, this._compilationError), this.onErrorObservable.notifyObservers(this), this.onErrorObservable.clear(), this._fallbacks && this._fallbacks.unBindMesh())) : this._allFallbacksProcessed = !0;\n          }, Object.defineProperty(x.prototype, \"isSupported\", { get: function() {\n            return this._compilationError === \"\";\n          }, enumerable: !1, configurable: !0 }), x.prototype._bindTexture = function(m, c) {\n            this._engine._bindTexture(this._samplers[m], c);\n          }, x.prototype.setTexture = function(m, c) {\n            this._engine.setTexture(this._samplers[m], this._uniforms[m], c);\n          }, x.prototype.setDepthStencilTexture = function(m, c) {\n            this._engine.setDepthStencilTexture(this._samplers[m], this._uniforms[m], c);\n          }, x.prototype.setTextureArray = function(m, c) {\n            var T = m + \"Ex\";\n            if (this._samplerList.indexOf(T + \"0\") === -1) {\n              for (var S = this._samplerList.indexOf(m), E = 1; E < c.length; E++) {\n                var g = T + (E - 1).toString();\n                this._samplerList.splice(S + E, 0, g);\n              }\n              for (var l = 0, h = 0, v = this._samplerList; h < v.length; h++) {\n                var b = v[h];\n                this._samplers[b] = l, l += 1;\n              }\n            }\n            this._engine.setTextureArray(this._samplers[m], this._uniforms[m], c);\n          }, x.prototype.setTextureFromPostProcess = function(m, c) {\n            this._engine.setTextureFromPostProcess(this._samplers[m], c);\n          }, x.prototype.setTextureFromPostProcessOutput = function(m, c) {\n            this._engine.setTextureFromPostProcessOutput(this._samplers[m], c);\n          }, x.prototype._cacheMatrix = function(m, c) {\n            var T = this._valueCache[m], S = c.updateFlag;\n            return (T === void 0 || T !== S) && (this._valueCache[m] = S, !0);\n          }, x.prototype._cacheFloat2 = function(m, c, T) {\n            var S = this._valueCache[m];\n            if (!S || S.length !== 2)\n              return S = [c, T], this._valueCache[m] = S, !0;\n            var E = !1;\n            return S[0] !== c && (S[0] = c, E = !0), S[1] !== T && (S[1] = T, E = !0), E;\n          }, x.prototype._cacheFloat3 = function(m, c, T, S) {\n            var E = this._valueCache[m];\n            if (!E || E.length !== 3)\n              return E = [c, T, S], this._valueCache[m] = E, !0;\n            var g = !1;\n            return E[0] !== c && (E[0] = c, g = !0), E[1] !== T && (E[1] = T, g = !0), E[2] !== S && (E[2] = S, g = !0), g;\n          }, x.prototype._cacheFloat4 = function(m, c, T, S, E) {\n            var g = this._valueCache[m];\n            if (!g || g.length !== 4)\n              return g = [c, T, S, E], this._valueCache[m] = g, !0;\n            var l = !1;\n            return g[0] !== c && (g[0] = c, l = !0), g[1] !== T && (g[1] = T, l = !0), g[2] !== S && (g[2] = S, l = !0), g[3] !== E && (g[3] = E, l = !0), l;\n          }, x.prototype.bindUniformBuffer = function(m, c) {\n            var T = this._uniformBuffersNames[c];\n            T !== void 0 && x._baseCache[T] !== m && (x._baseCache[T] = m, this._engine.bindUniformBufferBase(m, T));\n          }, x.prototype.bindUniformBlock = function(m, c) {\n            this._engine.bindUniformBlock(this._pipelineContext, m, c);\n          }, x.prototype.setInt = function(m, c) {\n            var T = this._valueCache[m];\n            return T !== void 0 && T === c || this._engine.setInt(this._uniforms[m], c) && (this._valueCache[m] = c), this;\n          }, x.prototype.setIntArray = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray(this._uniforms[m], c), this;\n          }, x.prototype.setIntArray2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray2(this._uniforms[m], c), this;\n          }, x.prototype.setIntArray3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray3(this._uniforms[m], c), this;\n          }, x.prototype.setIntArray4 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setIntArray4(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray2(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray3(this._uniforms[m], c), this;\n          }, x.prototype.setFloatArray4 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray4(this._uniforms[m], c), this;\n          }, x.prototype.setArray = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray(this._uniforms[m], c), this;\n          }, x.prototype.setArray2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray2(this._uniforms[m], c), this;\n          }, x.prototype.setArray3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray3(this._uniforms[m], c), this;\n          }, x.prototype.setArray4 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setArray4(this._uniforms[m], c), this;\n          }, x.prototype.setMatrices = function(m, c) {\n            return c ? (this._valueCache[m] = null, this._engine.setMatrices(this._uniforms[m], c), this) : this;\n          }, x.prototype.setMatrix = function(m, c) {\n            return this._cacheMatrix(m, c) && (this._engine.setMatrices(this._uniforms[m], c.toArray()) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setMatrix3x3 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setMatrix3x3(this._uniforms[m], c), this;\n          }, x.prototype.setMatrix2x2 = function(m, c) {\n            return this._valueCache[m] = null, this._engine.setMatrix2x2(this._uniforms[m], c), this;\n          }, x.prototype.setFloat = function(m, c) {\n            var T = this._valueCache[m];\n            return T !== void 0 && T === c || this._engine.setFloat(this._uniforms[m], c) && (this._valueCache[m] = c), this;\n          }, x.prototype.setBool = function(m, c) {\n            var T = this._valueCache[m];\n            return T !== void 0 && T === c || this._engine.setInt(this._uniforms[m], c ? 1 : 0) && (this._valueCache[m] = c), this;\n          }, x.prototype.setVector2 = function(m, c) {\n            return this._cacheFloat2(m, c.x, c.y) && (this._engine.setFloat2(this._uniforms[m], c.x, c.y) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setFloat2 = function(m, c, T) {\n            return this._cacheFloat2(m, c, T) && (this._engine.setFloat2(this._uniforms[m], c, T) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setVector3 = function(m, c) {\n            return this._cacheFloat3(m, c.x, c.y, c.z) && (this._engine.setFloat3(this._uniforms[m], c.x, c.y, c.z) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setFloat3 = function(m, c, T, S) {\n            return this._cacheFloat3(m, c, T, S) && (this._engine.setFloat3(this._uniforms[m], c, T, S) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setVector4 = function(m, c) {\n            return this._cacheFloat4(m, c.x, c.y, c.z, c.w) && (this._engine.setFloat4(this._uniforms[m], c.x, c.y, c.z, c.w) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setFloat4 = function(m, c, T, S, E) {\n            return this._cacheFloat4(m, c, T, S, E) && (this._engine.setFloat4(this._uniforms[m], c, T, S, E) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setColor3 = function(m, c) {\n            return this._cacheFloat3(m, c.r, c.g, c.b) && (this._engine.setFloat3(this._uniforms[m], c.r, c.g, c.b) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setColor4 = function(m, c, T) {\n            return this._cacheFloat4(m, c.r, c.g, c.b, T) && (this._engine.setFloat4(this._uniforms[m], c.r, c.g, c.b, T) || (this._valueCache[m] = null)), this;\n          }, x.prototype.setDirectColor4 = function(m, c) {\n            return this._cacheFloat4(m, c.r, c.g, c.b, c.a) && (this._engine.setFloat4(this._uniforms[m], c.r, c.g, c.b, c.a) || (this._valueCache[m] = null)), this;\n          }, x.prototype.dispose = function() {\n            this._engine._releaseEffect(this);\n          }, x.RegisterShader = function(m, c, T) {\n            c && (x.ShadersStore[m + \"PixelShader\"] = c), T && (x.ShadersStore[m + \"VertexShader\"] = T);\n          }, x.ResetCache = function() {\n            x._baseCache = {};\n          }, x.ShadersRepository = \"src/Shaders/\", x.LogShaderCodeOnCompilationError = !0, x._uniqueIdSeed = 0, x._baseCache = {}, x.ShadersStore = {}, x.IncludesShadersStore = {}, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        }), f.d(A, \"d\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        });\n        var V = function() {\n          function I(O, x, m, c) {\n            x === void 0 && (x = !1), this.initalize(O, x, m, c);\n          }\n          return I.prototype.initalize = function(O, x, m, c) {\n            return x === void 0 && (x = !1), this.mask = O, this.skipNextObservers = x, this.target = m, this.currentTarget = c, this;\n          }, I;\n        }(), _ = function(I, O, x) {\n          x === void 0 && (x = null), this.callback = I, this.mask = O, this.scope = x, this._willBeUnregistered = !1, this.unregisterOnNextCall = !1;\n        }, C = function() {\n          function I() {\n          }\n          return I.prototype.dispose = function() {\n            if (this._observers && this._observables)\n              for (var O = 0; O < this._observers.length; O++)\n                this._observables[O].remove(this._observers[O]);\n            this._observers = null, this._observables = null;\n          }, I.Watch = function(O, x, m, c) {\n            m === void 0 && (m = -1), c === void 0 && (c = null);\n            var T = new I();\n            T._observers = new Array(), T._observables = O;\n            for (var S = 0, E = O; S < E.length; S++) {\n              var g = E[S].add(x, m, !1, c);\n              g && T._observers.push(g);\n            }\n            return T;\n          }, I;\n        }(), u = function() {\n          function I(O) {\n            this._observers = new Array(), this._eventState = new V(0), O && (this._onObserverAdded = O);\n          }\n          return Object.defineProperty(I.prototype, \"observers\", { get: function() {\n            return this._observers;\n          }, enumerable: !1, configurable: !0 }), I.prototype.add = function(O, x, m, c, T) {\n            if (x === void 0 && (x = -1), m === void 0 && (m = !1), c === void 0 && (c = null), T === void 0 && (T = !1), !O)\n              return null;\n            var S = new _(O, x, c);\n            return S.unregisterOnNextCall = T, m ? this._observers.unshift(S) : this._observers.push(S), this._onObserverAdded && this._onObserverAdded(S), S;\n          }, I.prototype.addOnce = function(O) {\n            return this.add(O, void 0, void 0, void 0, !0);\n          }, I.prototype.remove = function(O) {\n            return !!O && this._observers.indexOf(O) !== -1 && (this._deferUnregister(O), !0);\n          }, I.prototype.removeCallback = function(O, x) {\n            for (var m = 0; m < this._observers.length; m++) {\n              var c = this._observers[m];\n              if (!c._willBeUnregistered && c.callback === O && (!x || x === c.scope))\n                return this._deferUnregister(c), !0;\n            }\n            return !1;\n          }, I.prototype._deferUnregister = function(O) {\n            var x = this;\n            O.unregisterOnNextCall = !1, O._willBeUnregistered = !0, setTimeout(function() {\n              x._remove(O);\n            }, 0);\n          }, I.prototype._remove = function(O) {\n            if (!O)\n              return !1;\n            var x = this._observers.indexOf(O);\n            return x !== -1 && (this._observers.splice(x, 1), !0);\n          }, I.prototype.makeObserverTopPriority = function(O) {\n            this._remove(O), this._observers.unshift(O);\n          }, I.prototype.makeObserverBottomPriority = function(O) {\n            this._remove(O), this._observers.push(O);\n          }, I.prototype.notifyObservers = function(O, x, m, c, T) {\n            if (x === void 0 && (x = -1), !this._observers.length)\n              return !0;\n            var S = this._eventState;\n            S.mask = x, S.target = m, S.currentTarget = c, S.skipNextObservers = !1, S.lastReturnValue = O, S.userInfo = T;\n            for (var E = 0, g = this._observers; E < g.length; E++) {\n              var l = g[E];\n              if (!l._willBeUnregistered && (l.mask & x && (l.scope ? S.lastReturnValue = l.callback.apply(l.scope, [O, S]) : S.lastReturnValue = l.callback(O, S), l.unregisterOnNextCall && this._deferUnregister(l)), S.skipNextObservers))\n                return !1;\n            }\n            return !0;\n          }, I.prototype.notifyObserversWithPromise = function(O, x, m, c, T) {\n            var S = this;\n            x === void 0 && (x = -1);\n            var E = Promise.resolve(O);\n            if (!this._observers.length)\n              return E;\n            var g = this._eventState;\n            return g.mask = x, g.target = m, g.currentTarget = c, g.skipNextObservers = !1, g.userInfo = T, this._observers.forEach(function(l) {\n              g.skipNextObservers || l._willBeUnregistered || l.mask & x && (E = l.scope ? E.then(function(h) {\n                return g.lastReturnValue = h, l.callback.apply(l.scope, [O, g]);\n              }) : E.then(function(h) {\n                return g.lastReturnValue = h, l.callback(O, g);\n              }), l.unregisterOnNextCall && S._deferUnregister(l));\n            }), E.then(function() {\n              return O;\n            });\n          }, I.prototype.notifyObserver = function(O, x, m) {\n            m === void 0 && (m = -1);\n            var c = this._eventState;\n            c.mask = m, c.skipNextObservers = !1, O.callback(x, c);\n          }, I.prototype.hasObservers = function() {\n            return this._observers.length > 0;\n          }, I.prototype.clear = function() {\n            this._observers = new Array(), this._onObserverAdded = null;\n          }, I.prototype.clone = function() {\n            var O = new I();\n            return O._observers = this._observers.slice(0), O;\n          }, I.prototype.hasSpecificMask = function(O) {\n            O === void 0 && (O = -1);\n            for (var x = 0, m = this._observers; x < m.length; x++) {\n              var c = m[x];\n              if (c.mask & O || c.mask === O)\n                return !0;\n            }\n            return !1;\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return te;\n        }), f.d(A, \"c\", function() {\n          return pe;\n        }), f.d(A, \"a\", function() {\n          return K;\n        });\n        var V = f(1), _ = f(6), C = f(12), u = f(41), I = f(37), O = f(0), x = f(9), m = f(29), c = f(4), T = f(16), S = f(71), E = f(31), g = f(61), l = f(43), h = f(25), v = f(68), b = f(69), D = f(2), w = f(3), N = f(8), M = f(11), U = f(21), X = f(17), j = f(149), ne = f(70), te = function() {\n        }, de = function() {\n          this.visibleInstances = {}, this.batchCache = new pe(), this.instancesBufferSize = 2048;\n        }, pe = function() {\n          this.mustReturn = !1, this.visibleInstances = new Array(), this.renderSelf = new Array(), this.hardwareInstancedRendering = new Array();\n        }, ae = function() {\n          this.instancesCount = 0, this.matrixBuffer = null, this.matrixBufferSize = 512, this.boundingVectors = [], this.worldMatrices = null;\n        }, ee = function() {\n          this._areNormalsFrozen = !1, this._source = null, this.meshMap = null, this._preActivateId = -1, this._LODLevels = new Array(), this._morphTargetManager = null;\n        }, K = function($) {\n          function L(G, Q, oe, re, Y, k) {\n            Q === void 0 && (Q = null), oe === void 0 && (oe = null), re === void 0 && (re = null), k === void 0 && (k = !0);\n            var H = $.call(this, G, Q) || this;\n            if (H._internalMeshDataInfo = new ee(), H.delayLoadState = D.a.DELAYLOADSTATE_NONE, H.instances = new Array(), H._creationDataStorage = null, H._geometry = null, H._instanceDataStorage = new de(), H._thinInstanceDataStorage = new ae(), H._effectiveMaterial = null, H._shouldGenerateFlatShading = !1, H._originalBuilderSideOrientation = L.DEFAULTSIDE, H.overrideMaterialSideOrientation = null, Q = H.getScene(), re) {\n              if (re._geometry && re._geometry.applyToMesh(H), u.a.DeepCopy(re, H, [\"name\", \"material\", \"skeleton\", \"instances\", \"parent\", \"uniqueId\", \"source\", \"metadata\", \"morphTargetManager\", \"hasInstances\", \"source\", \"worldMatrixInstancedBuffer\", \"hasLODLevels\", \"geometry\", \"isBlocked\", \"areNormalsFrozen\", \"facetNb\", \"isFacetDataEnabled\", \"lightSources\", \"useBones\", \"isAnInstance\", \"collider\", \"edgesRenderer\", \"forward\", \"up\", \"right\", \"absolutePosition\", \"absoluteScaling\", \"absoluteRotationQuaternion\", \"isWorldMatrixFrozen\", \"nonUniformScaling\", \"behaviors\", \"worldMatrixFromCache\", \"hasThinInstances\", \"cloneMeshMap\"], [\"_poseMatrix\"]), H._internalMeshDataInfo._source = re, Q.useClonedMeshMap && (re._internalMeshDataInfo.meshMap || (re._internalMeshDataInfo.meshMap = {}), re._internalMeshDataInfo.meshMap[H.uniqueId] = H), H._originalBuilderSideOrientation = re._originalBuilderSideOrientation, H._creationDataStorage = re._creationDataStorage, re._ranges) {\n                var Z = re._ranges;\n                for (var G in Z)\n                  Z.hasOwnProperty(G) && Z[G] && H.createAnimationRange(G, Z[G].from, Z[G].to);\n              }\n              var W;\n              if (re.metadata && re.metadata.clone ? H.metadata = re.metadata.clone() : H.metadata = re.metadata, I.a && I.a.HasTags(re) && I.a.AddTagsTo(H, I.a.GetTags(re, !0)), H.setEnabled(re.isEnabled()), H.parent = re.parent, H.setPivotMatrix(re.getPivotMatrix()), H.id = G + \".\" + re.id, H.material = re.material, !Y)\n                for (var q = re.getDescendants(!0), he = 0; he < q.length; he++) {\n                  var ge = q[he];\n                  ge.clone && ge.clone(G + \".\" + ge.name, H);\n                }\n              if (re.morphTargetManager && (H.morphTargetManager = re.morphTargetManager), Q.getPhysicsEngine) {\n                var me = Q.getPhysicsEngine();\n                if (k && me) {\n                  var _e = me.getImpostorForPhysicsObject(re);\n                  _e && (H.physicsImpostor = _e.clone(H));\n                }\n              }\n              for (W = 0; W < Q.particleSystems.length; W++) {\n                var ye = Q.particleSystems[W];\n                ye.emitter === re && ye.clone(ye.name, H);\n              }\n              H.refreshBoundingInfo(), H.computeWorldMatrix(!0);\n            }\n            return oe !== null && (H.parent = oe), H._instanceDataStorage.hardwareInstancedRendering = H.getEngine().getCaps().instancedArrays, H;\n          }\n          return Object(V.d)(L, $), L._GetDefaultSideOrientation = function(G) {\n            return G || L.FRONTSIDE;\n          }, Object.defineProperty(L.prototype, \"computeBonesUsingShaders\", { get: function() {\n            return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;\n          }, set: function(G) {\n            this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== G && (G && this._internalMeshDataInfo._sourcePositions && (this.setVerticesData(c.b.PositionKind, this._internalMeshDataInfo._sourcePositions.slice(), !0), this._internalMeshDataInfo._sourceNormals && this.setVerticesData(c.b.NormalKind, this._internalMeshDataInfo._sourceNormals.slice(), !0)), this._internalAbstractMeshDataInfo._computeBonesUsingShaders = G, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeRenderObservable\", { get: function() {\n            return this._internalMeshDataInfo._onBeforeRenderObservable || (this._internalMeshDataInfo._onBeforeRenderObservable = new _.c()), this._internalMeshDataInfo._onBeforeRenderObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeBindObservable\", { get: function() {\n            return this._internalMeshDataInfo._onBeforeBindObservable || (this._internalMeshDataInfo._onBeforeBindObservable = new _.c()), this._internalMeshDataInfo._onBeforeBindObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onAfterRenderObservable\", { get: function() {\n            return this._internalMeshDataInfo._onAfterRenderObservable || (this._internalMeshDataInfo._onAfterRenderObservable = new _.c()), this._internalMeshDataInfo._onAfterRenderObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeDrawObservable\", { get: function() {\n            return this._internalMeshDataInfo._onBeforeDrawObservable || (this._internalMeshDataInfo._onBeforeDrawObservable = new _.c()), this._internalMeshDataInfo._onBeforeDrawObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"onBeforeDraw\", { set: function(G) {\n            this._onBeforeDrawObserver && this.onBeforeDrawObservable.remove(this._onBeforeDrawObserver), this._onBeforeDrawObserver = this.onBeforeDrawObservable.add(G);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"hasInstances\", { get: function() {\n            return this.instances.length > 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"hasThinInstances\", { get: function() {\n            var G;\n            return ((G = this._thinInstanceDataStorage.instancesCount) !== null && G !== void 0 ? G : 0) > 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"morphTargetManager\", { get: function() {\n            return this._internalMeshDataInfo._morphTargetManager;\n          }, set: function(G) {\n            this._internalMeshDataInfo._morphTargetManager !== G && (this._internalMeshDataInfo._morphTargetManager = G, this._syncGeometryWithMorphTargetManager());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"source\", { get: function() {\n            return this._internalMeshDataInfo._source;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"cloneMeshMap\", { get: function() {\n            return this._internalMeshDataInfo.meshMap;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"isUnIndexed\", { get: function() {\n            return this._unIndexed;\n          }, set: function(G) {\n            this._unIndexed !== G && (this._unIndexed = G, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"worldMatrixInstancedBuffer\", { get: function() {\n            return this._instanceDataStorage.instancesData;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(L.prototype, \"manualUpdateOfWorldMatrixInstancedBuffer\", { get: function() {\n            return this._instanceDataStorage.manualUpdate;\n          }, set: function(G) {\n            this._instanceDataStorage.manualUpdate = G;\n          }, enumerable: !1, configurable: !0 }), L.prototype.instantiateHierarchy = function(G, Q, oe) {\n            G === void 0 && (G = null);\n            var re = !(this.getTotalVertices() > 0) || Q && Q.doNotInstantiate ? this.clone(\"Clone of \" + (this.name || this.id), G || this.parent, !0) : this.createInstance(\"instance of \" + (this.name || this.id));\n            re && (re.parent = G || this.parent, re.position = this.position.clone(), re.scaling = this.scaling.clone(), this.rotationQuaternion ? re.rotationQuaternion = this.rotationQuaternion.clone() : re.rotation = this.rotation.clone(), oe && oe(this, re));\n            for (var Y = 0, k = this.getChildTransformNodes(!0); Y < k.length; Y++)\n              k[Y].instantiateHierarchy(re, Q, oe);\n            return re;\n          }, L.prototype.getClassName = function() {\n            return \"Mesh\";\n          }, Object.defineProperty(L.prototype, \"_isMesh\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), L.prototype.toString = function(G) {\n            var Q = $.prototype.toString.call(this, G);\n            if (Q += \", n vertices: \" + this.getTotalVertices(), Q += \", parent: \" + (this._waitingParentId ? this._waitingParentId : this.parent ? this.parent.name : \"NONE\"), this.animations)\n              for (var oe = 0; oe < this.animations.length; oe++)\n                Q += \", animation[0]: \" + this.animations[oe].toString(G);\n            if (G)\n              if (this._geometry) {\n                var re = this.getIndices(), Y = this.getVerticesData(c.b.PositionKind);\n                Y && re && (Q += \", flat shading: \" + (Y.length / 3 === re.length ? \"YES\" : \"NO\"));\n              } else\n                Q += \", flat shading: UNKNOWN\";\n            return Q;\n          }, L.prototype._unBindEffect = function() {\n            $.prototype._unBindEffect.call(this);\n            for (var G = 0, Q = this.instances; G < Q.length; G++)\n              Q[G]._unBindEffect();\n          }, Object.defineProperty(L.prototype, \"hasLODLevels\", { get: function() {\n            return this._internalMeshDataInfo._LODLevels.length > 0;\n          }, enumerable: !1, configurable: !0 }), L.prototype.getLODLevels = function() {\n            return this._internalMeshDataInfo._LODLevels;\n          }, L.prototype._sortLODLevels = function() {\n            this._internalMeshDataInfo._LODLevels.sort(function(G, Q) {\n              return G.distance < Q.distance ? 1 : G.distance > Q.distance ? -1 : 0;\n            });\n          }, L.prototype.addLODLevel = function(G, Q) {\n            if (Q && Q._masterMesh)\n              return N.a.Warn(\"You cannot use a mesh as LOD level twice\"), this;\n            var oe = new j.a(G, Q);\n            return this._internalMeshDataInfo._LODLevels.push(oe), Q && (Q._masterMesh = this), this._sortLODLevels(), this;\n          }, L.prototype.getLODLevelAtDistance = function(G) {\n            for (var Q = this._internalMeshDataInfo, oe = 0; oe < Q._LODLevels.length; oe++) {\n              var re = Q._LODLevels[oe];\n              if (re.distance === G)\n                return re.mesh;\n            }\n            return null;\n          }, L.prototype.removeLODLevel = function(G) {\n            for (var Q = this._internalMeshDataInfo, oe = 0; oe < Q._LODLevels.length; oe++)\n              Q._LODLevels[oe].mesh === G && (Q._LODLevels.splice(oe, 1), G && (G._masterMesh = null));\n            return this._sortLODLevels(), this;\n          }, L.prototype.getLOD = function(G, Q) {\n            var oe, re = this._internalMeshDataInfo;\n            if (!re._LODLevels || re._LODLevels.length === 0)\n              return this;\n            Q ? oe = Q : oe = this.getBoundingInfo().boundingSphere;\n            var Y = oe.centerWorld.subtract(G.globalPosition).length();\n            if (re._LODLevels[re._LODLevels.length - 1].distance > Y)\n              return this.onLODLevelSelection && this.onLODLevelSelection(Y, this, this), this;\n            for (var k = 0; k < re._LODLevels.length; k++) {\n              var H = re._LODLevels[k];\n              if (H.distance < Y) {\n                if (H.mesh) {\n                  if (H.mesh.delayLoadState === D.a.DELAYLOADSTATE_NOTLOADED)\n                    return H.mesh._checkDelayState(), this;\n                  if (H.mesh.delayLoadState === D.a.DELAYLOADSTATE_LOADING)\n                    return this;\n                  H.mesh._preActivate(), H.mesh._updateSubMeshesBoundingInfo(this.worldMatrixFromCache);\n                }\n                return this.onLODLevelSelection && this.onLODLevelSelection(Y, this, H.mesh), H.mesh;\n              }\n            }\n            return this.onLODLevelSelection && this.onLODLevelSelection(Y, this, this), this;\n          }, Object.defineProperty(L.prototype, \"geometry\", { get: function() {\n            return this._geometry;\n          }, enumerable: !1, configurable: !0 }), L.prototype.getTotalVertices = function() {\n            return this._geometry === null || this._geometry === void 0 ? 0 : this._geometry.getTotalVertices();\n          }, L.prototype.getVerticesData = function(G, Q, oe) {\n            return this._geometry ? this._geometry.getVerticesData(G, Q, oe) : null;\n          }, L.prototype.getVertexBuffer = function(G) {\n            return this._geometry ? this._geometry.getVertexBuffer(G) : null;\n          }, L.prototype.isVerticesDataPresent = function(G) {\n            return this._geometry ? this._geometry.isVerticesDataPresent(G) : !!this._delayInfo && this._delayInfo.indexOf(G) !== -1;\n          }, L.prototype.isVertexBufferUpdatable = function(G) {\n            return this._geometry ? this._geometry.isVertexBufferUpdatable(G) : !!this._delayInfo && this._delayInfo.indexOf(G) !== -1;\n          }, L.prototype.getVerticesDataKinds = function() {\n            if (!this._geometry) {\n              var G = new Array();\n              return this._delayInfo && this._delayInfo.forEach(function(Q) {\n                G.push(Q);\n              }), G;\n            }\n            return this._geometry.getVerticesDataKinds();\n          }, L.prototype.getTotalIndices = function() {\n            return this._geometry ? this._geometry.getTotalIndices() : 0;\n          }, L.prototype.getIndices = function(G, Q) {\n            return this._geometry ? this._geometry.getIndices(G, Q) : [];\n          }, Object.defineProperty(L.prototype, \"isBlocked\", { get: function() {\n            return this._masterMesh !== null && this._masterMesh !== void 0;\n          }, enumerable: !1, configurable: !0 }), L.prototype.isReady = function(G, Q) {\n            var oe, re, Y, k, H, Z;\n            if (G === void 0 && (G = !1), Q === void 0 && (Q = !1), this.delayLoadState === D.a.DELAYLOADSTATE_LOADING || !$.prototype.isReady.call(this, G))\n              return !1;\n            if (!this.subMeshes || this.subMeshes.length === 0 || !G)\n              return !0;\n            var W = this.getEngine(), q = this.getScene(), he = Q || W.getCaps().instancedArrays && (this.instances.length > 0 || this.hasThinInstances);\n            this.computeWorldMatrix();\n            var ge = this.material || q.defaultMaterial;\n            if (ge) {\n              if (ge._storeEffectOnSubMeshes)\n                for (var me = 0, _e = this.subMeshes; me < _e.length; me++) {\n                  var ye = (je = _e[me]).getMaterial();\n                  if (ye) {\n                    if (ye._storeEffectOnSubMeshes) {\n                      if (!ye.isReadyForSubMesh(this, je, he))\n                        return !1;\n                    } else if (!ye.isReady(this, he))\n                      return !1;\n                  }\n                }\n              else if (!ge.isReady(this, he))\n                return !1;\n            }\n            for (var Pe = 0, be = this.lightSources; Pe < be.length; Pe++) {\n              var Fe = be[Pe].getShadowGenerator();\n              if (Fe && (!(!((oe = Fe.getShadowMap()) === null || oe === void 0) && oe.renderList) || !((re = Fe.getShadowMap()) === null || re === void 0) && re.renderList && ((k = (Y = Fe.getShadowMap()) === null || Y === void 0 ? void 0 : Y.renderList) === null || k === void 0 ? void 0 : k.indexOf(this)) !== -1))\n                for (var ke = 0, We = this.subMeshes; ke < We.length; ke++) {\n                  var je = We[ke];\n                  if (!Fe.isReady(je, he, (Z = (H = je.getMaterial()) === null || H === void 0 ? void 0 : H.needAlphaBlendingForMesh(this)) !== null && Z !== void 0 && Z))\n                    return !1;\n                }\n            }\n            for (var He = 0, Qe = this._internalMeshDataInfo._LODLevels; He < Qe.length; He++) {\n              var Ge = Qe[He];\n              if (Ge.mesh && !Ge.mesh.isReady(he))\n                return !1;\n            }\n            return !0;\n          }, Object.defineProperty(L.prototype, \"areNormalsFrozen\", { get: function() {\n            return this._internalMeshDataInfo._areNormalsFrozen;\n          }, enumerable: !1, configurable: !0 }), L.prototype.freezeNormals = function() {\n            return this._internalMeshDataInfo._areNormalsFrozen = !0, this;\n          }, L.prototype.unfreezeNormals = function() {\n            return this._internalMeshDataInfo._areNormalsFrozen = !1, this;\n          }, Object.defineProperty(L.prototype, \"overridenInstanceCount\", { set: function(G) {\n            this._instanceDataStorage.overridenInstanceCount = G;\n          }, enumerable: !1, configurable: !0 }), L.prototype._preActivate = function() {\n            var G = this._internalMeshDataInfo, Q = this.getScene().getRenderId();\n            return G._preActivateId === Q || (G._preActivateId = Q, this._instanceDataStorage.visibleInstances = null), this;\n          }, L.prototype._preActivateForIntermediateRendering = function(G) {\n            return this._instanceDataStorage.visibleInstances && (this._instanceDataStorage.visibleInstances.intermediateDefaultRenderId = G), this;\n          }, L.prototype._registerInstanceForRenderId = function(G, Q) {\n            return this._instanceDataStorage.visibleInstances || (this._instanceDataStorage.visibleInstances = { defaultRenderId: Q, selfDefaultRenderId: this._renderId }), this._instanceDataStorage.visibleInstances[Q] || (this._instanceDataStorage.previousRenderId !== void 0 && this._instanceDataStorage.isFrozen && (this._instanceDataStorage.visibleInstances[this._instanceDataStorage.previousRenderId] = null), this._instanceDataStorage.previousRenderId = Q, this._instanceDataStorage.visibleInstances[Q] = new Array()), this._instanceDataStorage.visibleInstances[Q].push(G), this;\n          }, L.prototype._afterComputeWorldMatrix = function() {\n            $.prototype._afterComputeWorldMatrix.call(this), this.hasThinInstances && (this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1));\n          }, L.prototype._postActivate = function() {\n            this.edgesShareWithInstances && this.edgesRenderer && this.edgesRenderer.isEnabled && this._renderingGroup && (this._renderingGroup._edgesRenderers.pushNoDuplicate(this.edgesRenderer), this.edgesRenderer.customInstances.push(this.getWorldMatrix()));\n          }, L.prototype.refreshBoundingInfo = function(G) {\n            if (G === void 0 && (G = !1), this._boundingInfo && this._boundingInfo.isLocked)\n              return this;\n            var Q = this.geometry ? this.geometry.boundingBias : null;\n            return this._refreshBoundingInfo(this._getPositionData(G), Q), this;\n          }, L.prototype._createGlobalSubMesh = function(G) {\n            var Q = this.getTotalVertices();\n            if (!Q || !this.getIndices())\n              return null;\n            if (this.subMeshes && this.subMeshes.length > 0) {\n              var oe = this.getIndices();\n              if (!oe)\n                return null;\n              var re = oe.length, Y = !1;\n              if (G)\n                Y = !0;\n              else\n                for (var k = 0, H = this.subMeshes; k < H.length; k++) {\n                  var Z = H[k];\n                  if (Z.indexStart + Z.indexCount > re) {\n                    Y = !0;\n                    break;\n                  }\n                  if (Z.verticesStart + Z.verticesCount > Q) {\n                    Y = !0;\n                    break;\n                  }\n                }\n              if (!Y)\n                return this.subMeshes[0];\n            }\n            return this.releaseSubMeshes(), new g.a(0, 0, Q, 0, this.getTotalIndices(), this);\n          }, L.prototype.subdivide = function(G) {\n            if (!(G < 1)) {\n              for (var Q = this.getTotalIndices(), oe = Q / G | 0, re = 0; oe % 3 != 0; )\n                oe++;\n              this.releaseSubMeshes();\n              for (var Y = 0; Y < G && !(re >= Q); Y++)\n                g.a.CreateFromIndices(0, re, Y === G - 1 ? Q - re : oe, this), re += oe;\n              this.synchronizeInstances();\n            }\n          }, L.prototype.setVerticesData = function(G, Q, oe, re) {\n            if (oe === void 0 && (oe = !1), this._geometry)\n              this._geometry.setVerticesData(G, Q, oe, re);\n            else {\n              var Y = new T.a();\n              Y.set(Q, G);\n              var k = this.getScene();\n              new S.a(S.a.RandomId(), k, Y, oe, this);\n            }\n            return this;\n          }, L.prototype.removeVerticesData = function(G) {\n            this._geometry && this._geometry.removeVerticesData(G);\n          }, L.prototype.markVerticesDataAsUpdatable = function(G, Q) {\n            Q === void 0 && (Q = !0);\n            var oe = this.getVertexBuffer(G);\n            oe && oe.isUpdatable() !== Q && this.setVerticesData(G, this.getVerticesData(G), Q);\n          }, L.prototype.setVerticesBuffer = function(G) {\n            return this._geometry || (this._geometry = S.a.CreateGeometryForMesh(this)), this._geometry.setVerticesBuffer(G), this;\n          }, L.prototype.updateVerticesData = function(G, Q, oe, re) {\n            return this._geometry ? (re ? (this.makeGeometryUnique(), this.updateVerticesData(G, Q, oe, !1)) : this._geometry.updateVerticesData(G, Q, oe), this) : this;\n          }, L.prototype.updateMeshPositions = function(G, Q) {\n            Q === void 0 && (Q = !0);\n            var oe = this.getVerticesData(c.b.PositionKind);\n            if (!oe)\n              return this;\n            if (G(oe), this.updateVerticesData(c.b.PositionKind, oe, !1, !1), Q) {\n              var re = this.getIndices(), Y = this.getVerticesData(c.b.NormalKind);\n              if (!Y)\n                return this;\n              T.a.ComputeNormals(oe, re, Y), this.updateVerticesData(c.b.NormalKind, Y, !1, !1);\n            }\n            return this;\n          }, L.prototype.makeGeometryUnique = function() {\n            if (!this._geometry)\n              return this;\n            if (this._geometry.meshes.length === 1)\n              return this;\n            var G = this._geometry, Q = this._geometry.copy(S.a.RandomId());\n            return G.releaseForMesh(this, !0), Q.applyToMesh(this), this;\n          }, L.prototype.setIndices = function(G, Q, oe) {\n            if (Q === void 0 && (Q = null), oe === void 0 && (oe = !1), this._geometry)\n              this._geometry.setIndices(G, Q, oe);\n            else {\n              var re = new T.a();\n              re.indices = G;\n              var Y = this.getScene();\n              new S.a(S.a.RandomId(), Y, re, oe, this);\n            }\n            return this;\n          }, L.prototype.updateIndices = function(G, Q, oe) {\n            return oe === void 0 && (oe = !1), this._geometry ? (this._geometry.updateIndices(G, Q, oe), this) : this;\n          }, L.prototype.toLeftHanded = function() {\n            return this._geometry ? (this._geometry.toLeftHanded(), this) : this;\n          }, L.prototype._bind = function(G, Q, oe) {\n            if (!this._geometry)\n              return this;\n            var re, Y = this.getScene().getEngine();\n            if (this._unIndexed)\n              re = null;\n            else\n              switch (oe) {\n                case h.a.PointFillMode:\n                  re = null;\n                  break;\n                case h.a.WireFrameFillMode:\n                  re = G._getLinesIndexBuffer(this.getIndices(), Y);\n                  break;\n                default:\n                case h.a.TriangleFillMode:\n                  re = this._geometry.getIndexBuffer();\n              }\n            return this._geometry._bind(Q, re), this;\n          }, L.prototype._draw = function(G, Q, oe) {\n            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())\n              return this;\n            this._internalMeshDataInfo._onBeforeDrawObservable && this._internalMeshDataInfo._onBeforeDrawObservable.notifyObservers(this);\n            var re = this.getScene().getEngine();\n            return this._unIndexed || Q == h.a.PointFillMode ? re.drawArraysType(Q, G.verticesStart, G.verticesCount, oe) : Q == h.a.WireFrameFillMode ? re.drawElementsType(Q, 0, G._linesIndexCount, oe) : re.drawElementsType(Q, G.indexStart, G.indexCount, oe), this;\n          }, L.prototype.registerBeforeRender = function(G) {\n            return this.onBeforeRenderObservable.add(G), this;\n          }, L.prototype.unregisterBeforeRender = function(G) {\n            return this.onBeforeRenderObservable.removeCallback(G), this;\n          }, L.prototype.registerAfterRender = function(G) {\n            return this.onAfterRenderObservable.add(G), this;\n          }, L.prototype.unregisterAfterRender = function(G) {\n            return this.onAfterRenderObservable.removeCallback(G), this;\n          }, L.prototype._getInstancesRenderList = function(G, Q) {\n            if (Q === void 0 && (Q = !1), this._instanceDataStorage.isFrozen && this._instanceDataStorage.previousBatch)\n              return this._instanceDataStorage.previousBatch;\n            var oe = this.getScene(), re = oe._isInIntermediateRendering(), Y = re ? this._internalAbstractMeshDataInfo._onlyForInstancesIntermediate : this._internalAbstractMeshDataInfo._onlyForInstances, k = this._instanceDataStorage.batchCache;\n            if (k.mustReturn = !1, k.renderSelf[G] = Q || !Y && this.isEnabled() && this.isVisible, k.visibleInstances[G] = null, this._instanceDataStorage.visibleInstances && !Q) {\n              var H = this._instanceDataStorage.visibleInstances, Z = oe.getRenderId(), W = re ? H.intermediateDefaultRenderId : H.defaultRenderId;\n              k.visibleInstances[G] = H[Z], !k.visibleInstances[G] && W && (k.visibleInstances[G] = H[W]);\n            }\n            return k.hardwareInstancedRendering[G] = !Q && this._instanceDataStorage.hardwareInstancedRendering && k.visibleInstances[G] !== null && k.visibleInstances[G] !== void 0, this._instanceDataStorage.previousBatch = k, k;\n          }, L.prototype._renderWithInstances = function(G, Q, oe, re, Y) {\n            var k = oe.visibleInstances[G._id];\n            if (!k)\n              return this;\n            for (var H = this._instanceDataStorage, Z = H.instancesBufferSize, W = H.instancesBuffer, q = 16 * (k.length + 1) * 4; H.instancesBufferSize < q; )\n              H.instancesBufferSize *= 2;\n            H.instancesData && Z == H.instancesBufferSize || (H.instancesData = new Float32Array(H.instancesBufferSize / 4));\n            var he = 0, ge = 0, me = oe.renderSelf[G._id], _e = !W || Z !== H.instancesBufferSize;\n            if (this._instanceDataStorage.manualUpdate || H.isFrozen && !_e)\n              ge = (me ? 1 : 0) + k.length;\n            else {\n              var ye = this._effectiveMesh.getWorldMatrix();\n              if (me && (ye.copyToArray(H.instancesData, he), he += 16, ge++), k)\n                for (var Pe = 0; Pe < k.length; Pe++)\n                  k[Pe].getWorldMatrix().copyToArray(H.instancesData, he), he += 16, ge++;\n            }\n            return _e ? (W && W.dispose(), W = new c.a(Y, H.instancesData, !0, 16, !1, !0), H.instancesBuffer = W, this.setVerticesBuffer(W.createVertexBuffer(\"world0\", 0, 4)), this.setVerticesBuffer(W.createVertexBuffer(\"world1\", 4, 4)), this.setVerticesBuffer(W.createVertexBuffer(\"world2\", 8, 4)), this.setVerticesBuffer(W.createVertexBuffer(\"world3\", 12, 4))) : this._instanceDataStorage.isFrozen || W.updateDirectly(H.instancesData, 0, ge), this._processInstancedBuffers(k, me), this.getScene()._activeIndices.addCount(G.indexCount * ge, !1), this._bind(G, re, Q), this._draw(G, Q, ge), Y.unbindInstanceAttributes(), this;\n          }, L.prototype._renderWithThinInstances = function(G, Q, oe, re) {\n            var Y, k, H = (k = (Y = this._thinInstanceDataStorage) === null || Y === void 0 ? void 0 : Y.instancesCount) !== null && k !== void 0 ? k : 0;\n            this.getScene()._activeIndices.addCount(G.indexCount * H, !1), this._bind(G, oe, Q), this._draw(G, Q, H), re.unbindInstanceAttributes();\n          }, L.prototype._processInstancedBuffers = function(G, Q) {\n          }, L.prototype._processRendering = function(G, Q, oe, re, Y, k, H, Z) {\n            var W = this.getScene(), q = W.getEngine();\n            if (k && Q.getRenderingMesh().hasThinInstances)\n              return this._renderWithThinInstances(Q, re, oe, q), this;\n            if (k)\n              this._renderWithInstances(Q, re, Y, oe, q);\n            else {\n              var he = 0;\n              Y.renderSelf[Q._id] && (H && H(!1, G._effectiveMesh.getWorldMatrix(), Z), he++, this._draw(Q, re, this._instanceDataStorage.overridenInstanceCount));\n              var ge = Y.visibleInstances[Q._id];\n              if (ge) {\n                var me = ge.length;\n                he += me;\n                for (var _e = 0; _e < me; _e++) {\n                  var ye = ge[_e].getWorldMatrix();\n                  H && H(!0, ye, Z), this._draw(Q, re);\n                }\n              }\n              W._activeIndices.addCount(Q.indexCount * he, !1);\n            }\n            return this;\n          }, L.prototype._rebuild = function() {\n            this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null), $.prototype._rebuild.call(this);\n          }, L.prototype._freeze = function() {\n            if (this.subMeshes) {\n              for (var G = 0; G < this.subMeshes.length; G++)\n                this._getInstancesRenderList(G);\n              this._effectiveMaterial = null, this._instanceDataStorage.isFrozen = !0;\n            }\n          }, L.prototype._unFreeze = function() {\n            this._instanceDataStorage.isFrozen = !1, this._instanceDataStorage.previousBatch = null;\n          }, L.prototype.render = function(G, Q, oe) {\n            var re = this.getScene();\n            if (this._internalAbstractMeshDataInfo._isActiveIntermediate ? this._internalAbstractMeshDataInfo._isActiveIntermediate = !1 : this._internalAbstractMeshDataInfo._isActive = !1, this._checkOcclusionQuery())\n              return this;\n            var Y = this._getInstancesRenderList(G._id, !!oe);\n            if (Y.mustReturn)\n              return this;\n            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())\n              return this;\n            this._internalMeshDataInfo._onBeforeRenderObservable && this._internalMeshDataInfo._onBeforeRenderObservable.notifyObservers(this);\n            var k, H = re.getEngine(), Z = Y.hardwareInstancedRendering[G._id] || G.getRenderingMesh().hasThinInstances, W = this._instanceDataStorage, q = G.getMaterial();\n            if (!q)\n              return this;\n            if (!W.isFrozen || !this._effectiveMaterial || this._effectiveMaterial !== q) {\n              if (q._storeEffectOnSubMeshes) {\n                if (!q.isReadyForSubMesh(this, G, Z))\n                  return this;\n              } else if (!q.isReady(this, Z))\n                return this;\n              this._effectiveMaterial = q;\n            }\n            Q && H.setAlphaMode(this._effectiveMaterial.alphaMode), k = this._effectiveMaterial._storeEffectOnSubMeshes ? G.effect : this._effectiveMaterial.getEffect();\n            for (var he = 0, ge = re._beforeRenderingMeshStage; he < ge.length; he++)\n              ge[he].action(this, G, Y, k);\n            if (!k)\n              return this;\n            var me, _e = oe || this._effectiveMesh;\n            if (W.isFrozen || !this._effectiveMaterial.backFaceCulling && this.overrideMaterialSideOrientation === null)\n              me = W.sideOrientation;\n            else {\n              var ye = _e._getWorldMatrixDeterminant();\n              (me = this.overrideMaterialSideOrientation) == null && (me = this._effectiveMaterial.sideOrientation), ye < 0 && (me = me === h.a.ClockWiseSideOrientation ? h.a.CounterClockWiseSideOrientation : h.a.ClockWiseSideOrientation), W.sideOrientation = me;\n            }\n            var Pe = this._effectiveMaterial._preBind(k, me);\n            this._effectiveMaterial.forceDepthWrite && H.setDepthWrite(!0);\n            var be = re.forcePointsCloud ? h.a.PointFillMode : re.forceWireframe ? h.a.WireFrameFillMode : this._effectiveMaterial.fillMode;\n            this._internalMeshDataInfo._onBeforeBindObservable && this._internalMeshDataInfo._onBeforeBindObservable.notifyObservers(this), Z || this._bind(G, k, be);\n            var Fe = _e.getWorldMatrix();\n            this._effectiveMaterial._storeEffectOnSubMeshes ? this._effectiveMaterial.bindForSubMesh(Fe, this, G) : this._effectiveMaterial.bind(Fe, this), !this._effectiveMaterial.backFaceCulling && this._effectiveMaterial.separateCullingPass && (H.setState(!0, this._effectiveMaterial.zOffset, !1, !Pe), this._processRendering(this, G, k, be, Y, Z, this._onBeforeDraw, this._effectiveMaterial), H.setState(!0, this._effectiveMaterial.zOffset, !1, Pe)), this._processRendering(this, G, k, be, Y, Z, this._onBeforeDraw, this._effectiveMaterial), this._effectiveMaterial.unbind();\n            for (var ke = 0, We = re._afterRenderingMeshStage; ke < We.length; ke++)\n              We[ke].action(this, G, Y, k);\n            return this._internalMeshDataInfo._onAfterRenderObservable && this._internalMeshDataInfo._onAfterRenderObservable.notifyObservers(this), this;\n          }, L.prototype._onBeforeDraw = function(G, Q, oe) {\n            G && oe && oe.bindOnlyWorldMatrix(Q);\n          }, L.prototype.cleanMatrixWeights = function() {\n            this.isVerticesDataPresent(c.b.MatricesWeightsKind) && (this.isVerticesDataPresent(c.b.MatricesWeightsExtraKind) ? this.normalizeSkinWeightsAndExtra() : this.normalizeSkinFourWeights());\n          }, L.prototype.normalizeSkinFourWeights = function() {\n            for (var G = this.getVerticesData(c.b.MatricesWeightsKind), Q = G.length, oe = 0; oe < Q; oe += 4) {\n              var re = G[oe] + G[oe + 1] + G[oe + 2] + G[oe + 3];\n              if (re === 0)\n                G[oe] = 1;\n              else {\n                var Y = 1 / re;\n                G[oe] *= Y, G[oe + 1] *= Y, G[oe + 2] *= Y, G[oe + 3] *= Y;\n              }\n            }\n            this.setVerticesData(c.b.MatricesWeightsKind, G);\n          }, L.prototype.normalizeSkinWeightsAndExtra = function() {\n            for (var G = this.getVerticesData(c.b.MatricesWeightsExtraKind), Q = this.getVerticesData(c.b.MatricesWeightsKind), oe = Q.length, re = 0; re < oe; re += 4) {\n              var Y = Q[re] + Q[re + 1] + Q[re + 2] + Q[re + 3];\n              if ((Y += G[re] + G[re + 1] + G[re + 2] + G[re + 3]) === 0)\n                Q[re] = 1;\n              else {\n                var k = 1 / Y;\n                Q[re] *= k, Q[re + 1] *= k, Q[re + 2] *= k, Q[re + 3] *= k, G[re] *= k, G[re + 1] *= k, G[re + 2] *= k, G[re + 3] *= k;\n              }\n            }\n            this.setVerticesData(c.b.MatricesWeightsKind, Q), this.setVerticesData(c.b.MatricesWeightsKind, G);\n          }, L.prototype.validateSkinning = function() {\n            var G = this.getVerticesData(c.b.MatricesWeightsExtraKind), Q = this.getVerticesData(c.b.MatricesWeightsKind);\n            if (Q === null || this.skeleton == null)\n              return { skinned: !1, valid: !0, report: \"not skinned\" };\n            for (var oe = Q.length, re = 0, Y = 0, k = 0, H = 0, Z = G === null ? 4 : 8, W = new Array(), q = 0; q <= Z; q++)\n              W[q] = 0;\n            for (q = 0; q < oe; q += 4) {\n              for (var he = Q[q], ge = he, me = ge === 0 ? 0 : 1, _e = 1; _e < Z; _e++) {\n                var ye = _e < 4 ? Q[q + _e] : G[q + _e - 4];\n                ye > he && re++, ye !== 0 && me++, ge += ye, he = ye;\n              }\n              if (W[me]++, me > k && (k = me), ge === 0)\n                Y++;\n              else {\n                var Pe = 1 / ge, be = 0;\n                for (_e = 0; _e < Z; _e++)\n                  be += _e < 4 ? Math.abs(Q[q + _e] - Q[q + _e] * Pe) : Math.abs(G[q + _e - 4] - G[q + _e - 4] * Pe);\n                be > 1e-3 && H++;\n              }\n            }\n            var Fe = this.skeleton.bones.length, ke = this.getVerticesData(c.b.MatricesIndicesKind), We = this.getVerticesData(c.b.MatricesIndicesExtraKind), je = 0;\n            for (q = 0; q < oe; q += 4)\n              for (_e = 0; _e < Z; _e++) {\n                var He = _e < 4 ? ke[q + _e] : We[q + _e - 4];\n                (He >= Fe || He < 0) && je++;\n              }\n            return { skinned: !0, valid: Y === 0 && H === 0 && je === 0, report: \"Number of Weights = \" + oe / 4 + `\nMaximum influences = ` + k + `\nMissing Weights = ` + Y + `\nNot Sorted = ` + re + `\nNot Normalized = ` + H + `\nWeightCounts = [` + W + `]\nNumber of bones = ` + Fe + `\nBad Bone Indices = ` + je };\n          }, L.prototype._checkDelayState = function() {\n            var G = this.getScene();\n            return this._geometry ? this._geometry.load(G) : this.delayLoadState === D.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = D.a.DELAYLOADSTATE_LOADING, this._queueLoad(G)), this;\n          }, L.prototype._queueLoad = function(G) {\n            var Q = this;\n            G._addPendingData(this);\n            var oe = this.delayLoadingFile.indexOf(\".babylonbinarymeshdata\") !== -1;\n            return C.b.LoadFile(this.delayLoadingFile, function(re) {\n              re instanceof ArrayBuffer ? Q._delayLoadingFunction(re, Q) : Q._delayLoadingFunction(JSON.parse(re), Q), Q.instances.forEach(function(Y) {\n                Y.refreshBoundingInfo(), Y._syncSubMeshes();\n              }), Q.delayLoadState = D.a.DELAYLOADSTATE_LOADED, G._removePendingData(Q);\n            }, function() {\n            }, G.offlineProvider, oe), this;\n          }, L.prototype.isInFrustum = function(G) {\n            return this.delayLoadState !== D.a.DELAYLOADSTATE_LOADING && !!$.prototype.isInFrustum.call(this, G) && (this._checkDelayState(), !0);\n          }, L.prototype.setMaterialByID = function(G) {\n            var Q, oe = this.getScene().materials;\n            for (Q = oe.length - 1; Q > -1; Q--)\n              if (oe[Q].id === G)\n                return this.material = oe[Q], this;\n            var re = this.getScene().multiMaterials;\n            for (Q = re.length - 1; Q > -1; Q--)\n              if (re[Q].id === G)\n                return this.material = re[Q], this;\n            return this;\n          }, L.prototype.getAnimatables = function() {\n            var G = new Array();\n            return this.material && G.push(this.material), this.skeleton && G.push(this.skeleton), G;\n          }, L.prototype.bakeTransformIntoVertices = function(G) {\n            if (!this.isVerticesDataPresent(c.b.PositionKind))\n              return this;\n            var Q = this.subMeshes.splice(0);\n            this._resetPointsArrayCache();\n            var oe, re = this.getVerticesData(c.b.PositionKind), Y = new Array();\n            for (oe = 0; oe < re.length; oe += 3)\n              O.e.TransformCoordinates(O.e.FromArray(re, oe), G).toArray(Y, oe);\n            if (this.setVerticesData(c.b.PositionKind, Y, this.getVertexBuffer(c.b.PositionKind).isUpdatable()), this.isVerticesDataPresent(c.b.NormalKind)) {\n              for (re = this.getVerticesData(c.b.NormalKind), Y = [], oe = 0; oe < re.length; oe += 3)\n                O.e.TransformNormal(O.e.FromArray(re, oe), G).normalize().toArray(Y, oe);\n              this.setVerticesData(c.b.NormalKind, Y, this.getVertexBuffer(c.b.NormalKind).isUpdatable());\n            }\n            return G.m[0] * G.m[5] * G.m[10] < 0 && this.flipFaces(), this.releaseSubMeshes(), this.subMeshes = Q, this;\n          }, L.prototype.bakeCurrentTransformIntoVertices = function(G) {\n            return G === void 0 && (G = !0), this.bakeTransformIntoVertices(this.computeWorldMatrix(!0)), this.resetLocalMatrix(G), this;\n          }, Object.defineProperty(L.prototype, \"_positions\", { get: function() {\n            return this._geometry ? this._geometry._positions : null;\n          }, enumerable: !1, configurable: !0 }), L.prototype._resetPointsArrayCache = function() {\n            return this._geometry && this._geometry._resetPointsArrayCache(), this;\n          }, L.prototype._generatePointsArray = function() {\n            return !!this._geometry && this._geometry._generatePointsArray();\n          }, L.prototype.clone = function(G, Q, oe, re) {\n            return G === void 0 && (G = \"\"), Q === void 0 && (Q = null), re === void 0 && (re = !0), new L(G, this.getScene(), Q, this, oe, re);\n          }, L.prototype.dispose = function(G, Q) {\n            Q === void 0 && (Q = !1), this.morphTargetManager = null, this._geometry && this._geometry.releaseForMesh(this, !0);\n            var oe = this._internalMeshDataInfo;\n            if (oe._onBeforeDrawObservable && oe._onBeforeDrawObservable.clear(), oe._onBeforeBindObservable && oe._onBeforeBindObservable.clear(), oe._onBeforeRenderObservable && oe._onBeforeRenderObservable.clear(), oe._onAfterRenderObservable && oe._onAfterRenderObservable.clear(), this._scene.useClonedMeshMap) {\n              if (oe.meshMap)\n                for (var re in oe.meshMap)\n                  (H = oe.meshMap[re]) && (H._internalMeshDataInfo._source = null, oe.meshMap[re] = void 0);\n              oe._source && oe._source._internalMeshDataInfo.meshMap && (oe._source._internalMeshDataInfo.meshMap[this.uniqueId] = void 0);\n            } else\n              for (var Y = 0, k = this.getScene().meshes; Y < k.length; Y++) {\n                var H;\n                (H = k[Y])._internalMeshDataInfo && H._internalMeshDataInfo._source && H._internalMeshDataInfo._source === this && (H._internalMeshDataInfo._source = null);\n              }\n            oe._source = null, this._disposeInstanceSpecificData(), this._disposeThinInstanceSpecificData(), $.prototype.dispose.call(this, G, Q);\n          }, L.prototype._disposeInstanceSpecificData = function() {\n          }, L.prototype._disposeThinInstanceSpecificData = function() {\n          }, L.prototype.applyDisplacementMap = function(G, Q, oe, re, Y, k, H) {\n            var Z = this;\n            H === void 0 && (H = !1);\n            var W = this.getScene();\n            return C.b.LoadImage(G, function(q) {\n              var he = q.width, ge = q.height, me = ne.a.CreateCanvas(he, ge).getContext(\"2d\");\n              me.drawImage(q, 0, 0);\n              var _e = me.getImageData(0, 0, he, ge).data;\n              Z.applyDisplacementMapFromBuffer(_e, he, ge, Q, oe, Y, k, H), re && re(Z);\n            }, function() {\n            }, W.offlineProvider), this;\n          }, L.prototype.applyDisplacementMapFromBuffer = function(G, Q, oe, re, Y, k, H, Z) {\n            if (Z === void 0 && (Z = !1), !this.isVerticesDataPresent(c.b.PositionKind) || !this.isVerticesDataPresent(c.b.NormalKind) || !this.isVerticesDataPresent(c.b.UVKind))\n              return N.a.Warn(\"Cannot call applyDisplacementMap: Given mesh is not complete. Position, Normal or UV are missing\"), this;\n            var W = this.getVerticesData(c.b.PositionKind, !0, !0), q = this.getVerticesData(c.b.NormalKind), he = this.getVerticesData(c.b.UVKind), ge = O.e.Zero(), me = O.e.Zero(), _e = O.d.Zero();\n            k = k || O.d.Zero(), H = H || new O.d(1, 1);\n            for (var ye = 0; ye < W.length; ye += 3) {\n              O.e.FromArrayToRef(W, ye, ge), O.e.FromArrayToRef(q, ye, me), O.d.FromArrayToRef(he, ye / 3 * 2, _e);\n              var Pe = 4 * ((Math.abs(_e.x * H.x + k.x % 1) * (Q - 1) % Q | 0) + (Math.abs(_e.y * H.y + k.y % 1) * (oe - 1) % oe | 0) * Q), be = 0.3 * (G[Pe] / 255) + 0.59 * (G[Pe + 1] / 255) + 0.11 * (G[Pe + 2] / 255);\n              me.normalize(), me.scaleInPlace(re + (Y - re) * be), (ge = ge.add(me)).toArray(W, ye);\n            }\n            return T.a.ComputeNormals(W, this.getIndices(), q), Z ? (this.setVerticesData(c.b.PositionKind, W), this.setVerticesData(c.b.NormalKind, q)) : (this.updateVerticesData(c.b.PositionKind, W), this.updateVerticesData(c.b.NormalKind, q)), this;\n          }, L.prototype.convertToFlatShadedMesh = function() {\n            var G, Q, oe = this.getVerticesDataKinds(), re = {}, Y = {}, k = {}, H = !1;\n            for (G = 0; G < oe.length; G++) {\n              Q = oe[G];\n              var Z = this.getVertexBuffer(Q);\n              Q !== c.b.NormalKind ? (re[Q] = Z, Y[Q] = re[Q].getData(), k[Q] = []) : (H = Z.isUpdatable(), oe.splice(G, 1), G--);\n            }\n            var W, q = this.subMeshes.slice(0), he = this.getIndices(), ge = this.getTotalIndices();\n            for (W = 0; W < ge; W++) {\n              var me = he[W];\n              for (G = 0; G < oe.length; G++)\n                for (var _e = re[Q = oe[G]].getStrideSize(), ye = 0; ye < _e; ye++)\n                  k[Q].push(Y[Q][me * _e + ye]);\n            }\n            var Pe = [], be = k[c.b.PositionKind];\n            for (W = 0; W < ge; W += 3) {\n              he[W] = W, he[W + 1] = W + 1, he[W + 2] = W + 2;\n              for (var Fe = O.e.FromArray(be, 3 * W), ke = O.e.FromArray(be, 3 * (W + 1)), We = O.e.FromArray(be, 3 * (W + 2)), je = Fe.subtract(ke), He = We.subtract(ke), Qe = O.e.Normalize(O.e.Cross(je, He)), Ge = 0; Ge < 3; Ge++)\n                Pe.push(Qe.x), Pe.push(Qe.y), Pe.push(Qe.z);\n            }\n            for (this.setIndices(he), this.setVerticesData(c.b.NormalKind, Pe, H), G = 0; G < oe.length; G++)\n              Q = oe[G], this.setVerticesData(Q, k[Q], re[Q].isUpdatable());\n            this.releaseSubMeshes();\n            for (var tt = 0; tt < q.length; tt++) {\n              var Je = q[tt];\n              g.a.AddToMesh(Je.materialIndex, Je.indexStart, Je.indexCount, Je.indexStart, Je.indexCount, this);\n            }\n            return this.synchronizeInstances(), this;\n          }, L.prototype.convertToUnIndexedMesh = function() {\n            var G, Q, oe = this.getVerticesDataKinds(), re = {}, Y = {}, k = {};\n            for (G = 0; G < oe.length; G++) {\n              Q = oe[G];\n              var H = this.getVertexBuffer(Q);\n              re[Q] = H, Y[Q] = re[Q].getData(), k[Q] = [];\n            }\n            var Z, W = this.subMeshes.slice(0), q = this.getIndices(), he = this.getTotalIndices();\n            for (Z = 0; Z < he; Z++) {\n              var ge = q[Z];\n              for (G = 0; G < oe.length; G++)\n                for (var me = re[Q = oe[G]].getStrideSize(), _e = 0; _e < me; _e++)\n                  k[Q].push(Y[Q][ge * me + _e]);\n            }\n            for (Z = 0; Z < he; Z += 3)\n              q[Z] = Z, q[Z + 1] = Z + 1, q[Z + 2] = Z + 2;\n            for (this.setIndices(q), G = 0; G < oe.length; G++)\n              Q = oe[G], this.setVerticesData(Q, k[Q], re[Q].isUpdatable());\n            this.releaseSubMeshes();\n            for (var ye = 0; ye < W.length; ye++) {\n              var Pe = W[ye];\n              g.a.AddToMesh(Pe.materialIndex, Pe.indexStart, Pe.indexCount, Pe.indexStart, Pe.indexCount, this);\n            }\n            return this._unIndexed = !0, this.synchronizeInstances(), this;\n          }, L.prototype.flipFaces = function(G) {\n            G === void 0 && (G = !1);\n            var Q, oe, re = T.a.ExtractFromMesh(this);\n            if (G && this.isVerticesDataPresent(c.b.NormalKind) && re.normals)\n              for (Q = 0; Q < re.normals.length; Q++)\n                re.normals[Q] *= -1;\n            if (re.indices)\n              for (Q = 0; Q < re.indices.length; Q += 3)\n                oe = re.indices[Q + 1], re.indices[Q + 1] = re.indices[Q + 2], re.indices[Q + 2] = oe;\n            return re.applyToMesh(this, this.isVertexBufferUpdatable(c.b.PositionKind)), this;\n          }, L.prototype.increaseVertices = function(G) {\n            var Q = T.a.ExtractFromMesh(this), oe = Q.uvs, re = Q.indices, Y = Q.positions, k = Q.normals;\n            if (re && Y && k && oe) {\n              for (var H, Z, W = G + 1, q = new Array(), he = 0; he < W + 1; he++)\n                q[he] = new Array();\n              var ge, me = new O.e(0, 0, 0), _e = new O.e(0, 0, 0), ye = new O.d(0, 0), Pe = new Array(), be = new Array(), Fe = new Array(), ke = Y.length, We = oe.length;\n              for (he = 0; he < re.length; he += 3) {\n                be[0] = re[he], be[1] = re[he + 1], be[2] = re[he + 2];\n                for (var je = 0; je < 3; je++)\n                  if (H = be[je], Z = be[(je + 1) % 3], Fe[H] === void 0 && Fe[Z] === void 0 ? (Fe[H] = new Array(), Fe[Z] = new Array()) : (Fe[H] === void 0 && (Fe[H] = new Array()), Fe[Z] === void 0 && (Fe[Z] = new Array())), Fe[H][Z] === void 0 && Fe[Z][H] === void 0) {\n                    Fe[H][Z] = [], me.x = (Y[3 * Z] - Y[3 * H]) / W, me.y = (Y[3 * Z + 1] - Y[3 * H + 1]) / W, me.z = (Y[3 * Z + 2] - Y[3 * H + 2]) / W, _e.x = (k[3 * Z] - k[3 * H]) / W, _e.y = (k[3 * Z + 1] - k[3 * H + 1]) / W, _e.z = (k[3 * Z + 2] - k[3 * H + 2]) / W, ye.x = (oe[2 * Z] - oe[2 * H]) / W, ye.y = (oe[2 * Z + 1] - oe[2 * H + 1]) / W, Fe[H][Z].push(H);\n                    for (var He = 1; He < W; He++)\n                      Fe[H][Z].push(Y.length / 3), Y[ke] = Y[3 * H] + He * me.x, k[ke++] = k[3 * H] + He * _e.x, Y[ke] = Y[3 * H + 1] + He * me.y, k[ke++] = k[3 * H + 1] + He * _e.y, Y[ke] = Y[3 * H + 2] + He * me.z, k[ke++] = k[3 * H + 2] + He * _e.z, oe[We++] = oe[2 * H] + He * ye.x, oe[We++] = oe[2 * H + 1] + He * ye.y;\n                    Fe[H][Z].push(Z), Fe[Z][H] = new Array(), ge = Fe[H][Z].length;\n                    for (var Qe = 0; Qe < ge; Qe++)\n                      Fe[Z][H][Qe] = Fe[H][Z][ge - 1 - Qe];\n                  }\n                for (q[0][0] = re[he], q[1][0] = Fe[re[he]][re[he + 1]][1], q[1][1] = Fe[re[he]][re[he + 2]][1], He = 2; He < W; He++)\n                  for (q[He][0] = Fe[re[he]][re[he + 1]][He], q[He][He] = Fe[re[he]][re[he + 2]][He], me.x = (Y[3 * q[He][He]] - Y[3 * q[He][0]]) / He, me.y = (Y[3 * q[He][He] + 1] - Y[3 * q[He][0] + 1]) / He, me.z = (Y[3 * q[He][He] + 2] - Y[3 * q[He][0] + 2]) / He, _e.x = (k[3 * q[He][He]] - k[3 * q[He][0]]) / He, _e.y = (k[3 * q[He][He] + 1] - k[3 * q[He][0] + 1]) / He, _e.z = (k[3 * q[He][He] + 2] - k[3 * q[He][0] + 2]) / He, ye.x = (oe[2 * q[He][He]] - oe[2 * q[He][0]]) / He, ye.y = (oe[2 * q[He][He] + 1] - oe[2 * q[He][0] + 1]) / He, je = 1; je < He; je++)\n                    q[He][je] = Y.length / 3, Y[ke] = Y[3 * q[He][0]] + je * me.x, k[ke++] = k[3 * q[He][0]] + je * _e.x, Y[ke] = Y[3 * q[He][0] + 1] + je * me.y, k[ke++] = k[3 * q[He][0] + 1] + je * _e.y, Y[ke] = Y[3 * q[He][0] + 2] + je * me.z, k[ke++] = k[3 * q[He][0] + 2] + je * _e.z, oe[We++] = oe[2 * q[He][0]] + je * ye.x, oe[We++] = oe[2 * q[He][0] + 1] + je * ye.y;\n                for (q[W] = Fe[re[he + 1]][re[he + 2]], Pe.push(q[0][0], q[1][0], q[1][1]), He = 1; He < W; He++) {\n                  for (je = 0; je < He; je++)\n                    Pe.push(q[He][je], q[He + 1][je], q[He + 1][je + 1]), Pe.push(q[He][je], q[He + 1][je + 1], q[He][je + 1]);\n                  Pe.push(q[He][je], q[He + 1][je], q[He + 1][je + 1]);\n                }\n              }\n              Q.indices = Pe, Q.applyToMesh(this, this.isVertexBufferUpdatable(c.b.PositionKind));\n            } else\n              N.a.Warn(\"VertexData contains null entries\");\n          }, L.prototype.forceSharedVertices = function() {\n            var G = T.a.ExtractFromMesh(this), Q = G.uvs, oe = G.indices, re = G.positions, Y = G.colors;\n            if (oe === void 0 || re === void 0 || oe === null || re === null)\n              N.a.Warn(\"VertexData contains empty entries\");\n            else {\n              for (var k, H, Z = new Array(), W = new Array(), q = new Array(), he = new Array(), ge = new Array(), me = 0, _e = {}, ye = 0; ye < oe.length; ye += 3) {\n                H = [oe[ye], oe[ye + 1], oe[ye + 2]], ge = new Array();\n                for (var Pe = 0; Pe < 3; Pe++) {\n                  ge[Pe] = \"\";\n                  for (var be = 0; be < 3; be++)\n                    Math.abs(re[3 * H[Pe] + be]) < 1e-8 && (re[3 * H[Pe] + be] = 0), ge[Pe] += re[3 * H[Pe] + be] + \"|\";\n                }\n                if (ge[0] != ge[1] && ge[0] != ge[2] && ge[1] != ge[2])\n                  for (Pe = 0; Pe < 3; Pe++) {\n                    if ((k = _e[ge[Pe]]) === void 0) {\n                      for (_e[ge[Pe]] = me, k = me++, be = 0; be < 3; be++)\n                        Z.push(re[3 * H[Pe] + be]);\n                      if (Y != null)\n                        for (be = 0; be < 4; be++)\n                          he.push(Y[4 * H[Pe] + be]);\n                      if (Q != null)\n                        for (be = 0; be < 2; be++)\n                          q.push(Q[2 * H[Pe] + be]);\n                    }\n                    W.push(k);\n                  }\n              }\n              var Fe = new Array();\n              T.a.ComputeNormals(Z, W, Fe), G.positions = Z, G.indices = W, G.normals = Fe, Q != null && (G.uvs = q), Y != null && (G.colors = he), G.applyToMesh(this, this.isVertexBufferUpdatable(c.b.PositionKind));\n            }\n          }, L._instancedMeshFactory = function(G, Q) {\n            throw U.a.WarnImport(\"InstancedMesh\");\n          }, L._PhysicsImpostorParser = function(G, Q, oe) {\n            throw U.a.WarnImport(\"PhysicsImpostor\");\n          }, L.prototype.createInstance = function(G) {\n            var Q = this.geometry;\n            if (Q && Q.meshes.length > 1)\n              for (var oe = 0, re = Q.meshes.slice(0); oe < re.length; oe++) {\n                var Y = re[oe];\n                Y !== this && Y.makeGeometryUnique();\n              }\n            return L._instancedMeshFactory(G, this);\n          }, L.prototype.synchronizeInstances = function() {\n            this._geometry && this._geometry.meshes.length !== 1 && this.instances.length && this.makeGeometryUnique();\n            for (var G = 0; G < this.instances.length; G++)\n              this.instances[G]._syncSubMeshes();\n            return this;\n          }, L.prototype.optimizeIndices = function(G) {\n            var Q = this, oe = this.getIndices(), re = this.getVerticesData(c.b.PositionKind);\n            if (!re || !oe)\n              return this;\n            for (var Y = new Array(), k = 0; k < re.length; k += 3)\n              Y.push(O.e.FromArray(re, k));\n            var H = new Array();\n            return C.a.SyncAsyncForLoop(Y.length, 40, function(Z) {\n              for (var W = Y.length - 1 - Z, q = Y[W], he = 0; he < W; ++he) {\n                var ge = Y[he];\n                if (q.equals(ge)) {\n                  H[W] = he;\n                  break;\n                }\n              }\n            }, function() {\n              for (var Z = 0; Z < oe.length; ++Z)\n                oe[Z] = H[oe[Z]] || oe[Z];\n              var W = Q.subMeshes.slice(0);\n              Q.setIndices(oe), Q.subMeshes = W, G && G(Q);\n            }), this;\n          }, L.prototype.serialize = function(G) {\n            G.name = this.name, G.id = this.id, G.uniqueId = this.uniqueId, G.type = this.getClassName(), I.a && I.a.HasTags(this) && (G.tags = I.a.GetTags(this)), G.position = this.position.asArray(), this.rotationQuaternion ? G.rotationQuaternion = this.rotationQuaternion.asArray() : this.rotation && (G.rotation = this.rotation.asArray()), G.scaling = this.scaling.asArray(), this._postMultiplyPivotMatrix ? G.pivotMatrix = this.getPivotMatrix().asArray() : G.localMatrix = this.getPivotMatrix().asArray(), G.isEnabled = this.isEnabled(!1), G.isVisible = this.isVisible, G.infiniteDistance = this.infiniteDistance, G.pickable = this.isPickable, G.receiveShadows = this.receiveShadows, G.billboardMode = this.billboardMode, G.visibility = this.visibility, G.checkCollisions = this.checkCollisions, G.isBlocker = this.isBlocker, G.overrideMaterialSideOrientation = this.overrideMaterialSideOrientation, this.parent && (G.parentId = this.parent.id), G.isUnIndexed = this.isUnIndexed;\n            var Q = this._geometry;\n            if (Q) {\n              var oe = Q.id;\n              G.geometryId = oe, G.subMeshes = [];\n              for (var re = 0; re < this.subMeshes.length; re++) {\n                var Y = this.subMeshes[re];\n                G.subMeshes.push({ materialIndex: Y.materialIndex, verticesStart: Y.verticesStart, verticesCount: Y.verticesCount, indexStart: Y.indexStart, indexCount: Y.indexCount });\n              }\n            }\n            this.material ? this.material.doNotSerialize || (G.materialId = this.material.id) : this.material = null, this.morphTargetManager && (G.morphTargetManagerId = this.morphTargetManager.uniqueId), this.skeleton && (G.skeletonId = this.skeleton.id, G.numBoneInfluencers = this.numBoneInfluencers), this.getScene()._getComponent(X.a.NAME_PHYSICSENGINE) && (Z = this.getPhysicsImpostor()) && (G.physicsMass = Z.getParam(\"mass\"), G.physicsFriction = Z.getParam(\"friction\"), G.physicsRestitution = Z.getParam(\"mass\"), G.physicsImpostor = Z.type), this.metadata && (G.metadata = this.metadata), G.instances = [];\n            for (var k = 0; k < this.instances.length; k++) {\n              var H = this.instances[k];\n              if (!H.doNotSerialize) {\n                var Z, W = { name: H.name, id: H.id, isEnabled: H.isEnabled(!1), isVisible: H.isVisible, isPickable: H.isPickable, checkCollisions: H.checkCollisions, position: H.position.asArray(), scaling: H.scaling.asArray() };\n                H.parent && (W.parentId = H.parent.id), H.rotationQuaternion ? W.rotationQuaternion = H.rotationQuaternion.asArray() : H.rotation && (W.rotation = H.rotation.asArray()), this.getScene()._getComponent(X.a.NAME_PHYSICSENGINE) && (Z = H.getPhysicsImpostor()) && (W.physicsMass = Z.getParam(\"mass\"), W.physicsFriction = Z.getParam(\"friction\"), W.physicsRestitution = Z.getParam(\"mass\"), W.physicsImpostor = Z.type), H.metadata && (W.metadata = H.metadata), G.instances.push(W), w.a.AppendSerializedAnimations(H, W), W.ranges = H.serializeAnimationRanges();\n              }\n            }\n            if (this._thinInstanceDataStorage.instancesCount && this._thinInstanceDataStorage.matrixData && (G.thinInstances = { instancesCount: this._thinInstanceDataStorage.instancesCount, matrixData: C.b.SliceToArray(this._thinInstanceDataStorage.matrixData), matrixBufferSize: this._thinInstanceDataStorage.matrixBufferSize }, this._userThinInstanceBuffersStorage)) {\n              var q = { data: {}, sizes: {}, strides: {} };\n              for (var he in this._userThinInstanceBuffersStorage.data)\n                q.data[he] = C.b.SliceToArray(this._userThinInstanceBuffersStorage.data[he]), q.sizes[he] = this._userThinInstanceBuffersStorage.sizes[he], q.strides[he] = this._userThinInstanceBuffersStorage.strides[he];\n              G.thinInstances.userThinInstance = q;\n            }\n            w.a.AppendSerializedAnimations(this, G), G.ranges = this.serializeAnimationRanges(), G.layerMask = this.layerMask, G.alphaIndex = this.alphaIndex, G.hasVertexAlpha = this.hasVertexAlpha, G.overlayAlpha = this.overlayAlpha, G.overlayColor = this.overlayColor.asArray(), G.renderOverlay = this.renderOverlay, G.applyFog = this.applyFog, this.actionManager && (G.actions = this.actionManager.serialize(this.name));\n          }, L.prototype._syncGeometryWithMorphTargetManager = function() {\n            if (this.geometry) {\n              this._markSubMeshesAsAttributesDirty();\n              var G = this._internalMeshDataInfo._morphTargetManager;\n              if (G && G.vertexCount) {\n                if (G.vertexCount !== this.getTotalVertices())\n                  return N.a.Error(\"Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count.\"), void (this.morphTargetManager = null);\n                for (var Q = 0; Q < G.numInfluencers; Q++) {\n                  var oe = G.getActiveTarget(Q), re = oe.getPositions();\n                  if (!re)\n                    return void N.a.Error(\"Invalid morph target. Target must have positions.\");\n                  this.geometry.setVerticesData(c.b.PositionKind + Q, re, !1, 3);\n                  var Y = oe.getNormals();\n                  Y && this.geometry.setVerticesData(c.b.NormalKind + Q, Y, !1, 3);\n                  var k = oe.getTangents();\n                  k && this.geometry.setVerticesData(c.b.TangentKind + Q, k, !1, 3);\n                  var H = oe.getUVs();\n                  H && this.geometry.setVerticesData(c.b.UVKind + \"_\" + Q, H, !1, 2);\n                }\n              } else\n                for (Q = 0; this.geometry.isVerticesDataPresent(c.b.PositionKind + Q); )\n                  this.geometry.removeVerticesData(c.b.PositionKind + Q), this.geometry.isVerticesDataPresent(c.b.NormalKind + Q) && this.geometry.removeVerticesData(c.b.NormalKind + Q), this.geometry.isVerticesDataPresent(c.b.TangentKind + Q) && this.geometry.removeVerticesData(c.b.TangentKind + Q), this.geometry.isVerticesDataPresent(c.b.UVKind + Q) && this.geometry.removeVerticesData(c.b.UVKind + \"_\" + Q), Q++;\n            }\n          }, L.Parse = function(G, Q, oe) {\n            var re;\n            if ((re = G.type && G.type === \"GroundMesh\" ? L._GroundMeshParser(G, Q) : new L(G.name, Q)).id = G.id, I.a && I.a.AddTagsTo(re, G.tags), re.position = O.e.FromArray(G.position), G.metadata !== void 0 && (re.metadata = G.metadata), G.rotationQuaternion ? re.rotationQuaternion = O.b.FromArray(G.rotationQuaternion) : G.rotation && (re.rotation = O.e.FromArray(G.rotation)), re.scaling = O.e.FromArray(G.scaling), G.localMatrix ? re.setPreTransformMatrix(O.a.FromArray(G.localMatrix)) : G.pivotMatrix && re.setPivotMatrix(O.a.FromArray(G.pivotMatrix)), re.setEnabled(G.isEnabled), re.isVisible = G.isVisible, re.infiniteDistance = G.infiniteDistance, re.showBoundingBox = G.showBoundingBox, re.showSubMeshesBoundingBox = G.showSubMeshesBoundingBox, G.applyFog !== void 0 && (re.applyFog = G.applyFog), G.pickable !== void 0 && (re.isPickable = G.pickable), G.alphaIndex !== void 0 && (re.alphaIndex = G.alphaIndex), re.receiveShadows = G.receiveShadows, re.billboardMode = G.billboardMode, G.visibility !== void 0 && (re.visibility = G.visibility), re.checkCollisions = G.checkCollisions, re.overrideMaterialSideOrientation = G.overrideMaterialSideOrientation, G.isBlocker !== void 0 && (re.isBlocker = G.isBlocker), re._shouldGenerateFlatShading = G.useFlatShading, G.freezeWorldMatrix && (re._waitingData.freezeWorldMatrix = G.freezeWorldMatrix), G.parentId && (re._waitingParentId = G.parentId), G.actions !== void 0 && (re._waitingData.actions = G.actions), G.overlayAlpha !== void 0 && (re.overlayAlpha = G.overlayAlpha), G.overlayColor !== void 0 && (re.overlayColor = x.a.FromArray(G.overlayColor)), G.renderOverlay !== void 0 && (re.renderOverlay = G.renderOverlay), re.isUnIndexed = !!G.isUnIndexed, re.hasVertexAlpha = G.hasVertexAlpha, G.delayLoadingFile ? (re.delayLoadState = D.a.DELAYLOADSTATE_NOTLOADED, re.delayLoadingFile = oe + G.delayLoadingFile, re._boundingInfo = new l.a(O.e.FromArray(G.boundingBoxMinimum), O.e.FromArray(G.boundingBoxMaximum)), G._binaryInfo && (re._binaryInfo = G._binaryInfo), re._delayInfo = [], G.hasUVs && re._delayInfo.push(c.b.UVKind), G.hasUVs2 && re._delayInfo.push(c.b.UV2Kind), G.hasUVs3 && re._delayInfo.push(c.b.UV3Kind), G.hasUVs4 && re._delayInfo.push(c.b.UV4Kind), G.hasUVs5 && re._delayInfo.push(c.b.UV5Kind), G.hasUVs6 && re._delayInfo.push(c.b.UV6Kind), G.hasColors && re._delayInfo.push(c.b.ColorKind), G.hasMatricesIndices && re._delayInfo.push(c.b.MatricesIndicesKind), G.hasMatricesWeights && re._delayInfo.push(c.b.MatricesWeightsKind), re._delayLoadingFunction = S.a._ImportGeometry, b.a.ForceFullSceneLoadingForIncremental && re._checkDelayState()) : S.a._ImportGeometry(G, re), G.materialId ? re.setMaterialByID(G.materialId) : re.material = null, G.morphTargetManagerId > -1 && (re.morphTargetManager = Q.getMorphTargetManagerById(G.morphTargetManagerId)), G.skeletonId !== void 0 && G.skeletonId !== null && (re.skeleton = Q.getLastSkeletonByID(G.skeletonId), G.numBoneInfluencers && (re.numBoneInfluencers = G.numBoneInfluencers)), G.animations) {\n              for (var Y = 0; Y < G.animations.length; Y++) {\n                var k = G.animations[Y];\n                (q = M.a.GetClass(\"BABYLON.Animation\")) && re.animations.push(q.Parse(k));\n              }\n              m.a.ParseAnimationRanges(re, G, Q);\n            }\n            if (G.autoAnimate && Q.beginAnimation(re, G.autoAnimateFrom, G.autoAnimateTo, G.autoAnimateLoop, G.autoAnimateSpeed || 1), G.layerMask && !isNaN(G.layerMask) ? re.layerMask = Math.abs(parseInt(G.layerMask)) : re.layerMask = 268435455, G.physicsImpostor && L._PhysicsImpostorParser(Q, re, G), G.lodMeshIds && (re._waitingData.lods = { ids: G.lodMeshIds, distances: G.lodDistances ? G.lodDistances : null, coverages: G.lodCoverages ? G.lodCoverages : null }), G.instances)\n              for (var H = 0; H < G.instances.length; H++) {\n                var Z = G.instances[H], W = re.createInstance(Z.name);\n                if (Z.id && (W.id = Z.id), I.a && (Z.tags ? I.a.AddTagsTo(W, Z.tags) : I.a.AddTagsTo(W, G.tags)), W.position = O.e.FromArray(Z.position), Z.metadata !== void 0 && (W.metadata = Z.metadata), Z.parentId && (W._waitingParentId = Z.parentId), Z.isEnabled !== void 0 && Z.isEnabled !== null && W.setEnabled(Z.isEnabled), Z.isVisible !== void 0 && Z.isVisible !== null && (W.isVisible = Z.isVisible), Z.isPickable !== void 0 && Z.isPickable !== null && (W.isPickable = Z.isPickable), Z.rotationQuaternion ? W.rotationQuaternion = O.b.FromArray(Z.rotationQuaternion) : Z.rotation && (W.rotation = O.e.FromArray(Z.rotation)), W.scaling = O.e.FromArray(Z.scaling), Z.checkCollisions != null && Z.checkCollisions != null && (W.checkCollisions = Z.checkCollisions), Z.pickable != null && Z.pickable != null && (W.isPickable = Z.pickable), Z.showBoundingBox != null && Z.showBoundingBox != null && (W.showBoundingBox = Z.showBoundingBox), Z.showSubMeshesBoundingBox != null && Z.showSubMeshesBoundingBox != null && (W.showSubMeshesBoundingBox = Z.showSubMeshesBoundingBox), Z.alphaIndex != null && Z.showSubMeshesBoundingBox != null && (W.alphaIndex = Z.alphaIndex), Z.physicsImpostor && L._PhysicsImpostorParser(Q, W, Z), Z.animations) {\n                  for (Y = 0; Y < Z.animations.length; Y++) {\n                    var q;\n                    k = Z.animations[Y], (q = M.a.GetClass(\"BABYLON.Animation\")) && W.animations.push(q.Parse(k));\n                  }\n                  m.a.ParseAnimationRanges(W, Z, Q), Z.autoAnimate && Q.beginAnimation(W, Z.autoAnimateFrom, Z.autoAnimateTo, Z.autoAnimateLoop, Z.autoAnimateSpeed || 1);\n                }\n              }\n            if (G.thinInstances) {\n              var he = G.thinInstances;\n              if (he.matrixData ? (re.thinInstanceSetBuffer(\"matrix\", new Float32Array(he.matrixData), 16, !1), re._thinInstanceDataStorage.matrixBufferSize = he.matrixBufferSize, re._thinInstanceDataStorage.instancesCount = he.instancesCount) : re._thinInstanceDataStorage.matrixBufferSize = he.matrixBufferSize, G.thinInstances.userThinInstance) {\n                var ge = G.thinInstances.userThinInstance;\n                for (var me in ge.data)\n                  re.thinInstanceSetBuffer(me, new Float32Array(ge.data[me]), ge.strides[me], !1), re._userThinInstanceBuffersStorage.sizes[me] = ge.sizes[me];\n              }\n            }\n            return re;\n          }, L.CreateRibbon = function(G, Q, oe, re, Y, k, H, Z, W) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateDisc = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateBox = function(G, Q, oe, re, Y) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateSphere = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateHemisphere = function(G, Q, oe, re) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateCylinder = function(G, Q, oe, re, Y, k, H, Z, W) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTorus = function(G, Q, oe, re, Y, k, H) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTorusKnot = function(G, Q, oe, re, Y, k, H, Z, W, q) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateLines = function(G, Q, oe, re, Y) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateDashedLines = function(G, Q, oe, re, Y, k, H, Z) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreatePolygon = function(G, Q, oe, re, Y, k, H) {\n            throw H === void 0 && (H = earcut), U.a.WarnImport(\"MeshBuilder\");\n          }, L.ExtrudePolygon = function(G, Q, oe, re, Y, k, H, Z) {\n            throw Z === void 0 && (Z = earcut), U.a.WarnImport(\"MeshBuilder\");\n          }, L.ExtrudeShape = function(G, Q, oe, re, Y, k, H, Z, W, q) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.ExtrudeShapeCustom = function(G, Q, oe, re, Y, k, H, Z, W, q, he, ge) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateLathe = function(G, Q, oe, re, Y, k, H) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreatePlane = function(G, Q, oe, re, Y) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateGround = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTiledGround = function(G, Q, oe, re, Y, k, H, Z, W) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateGroundFromHeightMap = function(G, Q, oe, re, Y, k, H, Z, W, q, he) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateTube = function(G, Q, oe, re, Y, k, H, Z, W, q) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreatePolyhedron = function(G, Q, oe) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateIcoSphere = function(G, Q, oe) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateDecal = function(G, Q, oe, re, Y, k) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.CreateCapsule = function(G, Q, oe) {\n            throw U.a.WarnImport(\"MeshBuilder\");\n          }, L.prototype.setPositionsForCPUSkinning = function() {\n            var G = this._internalMeshDataInfo;\n            if (!G._sourcePositions) {\n              var Q = this.getVerticesData(c.b.PositionKind);\n              if (!Q)\n                return G._sourcePositions;\n              G._sourcePositions = new Float32Array(Q), this.isVertexBufferUpdatable(c.b.PositionKind) || this.setVerticesData(c.b.PositionKind, Q, !0);\n            }\n            return G._sourcePositions;\n          }, L.prototype.setNormalsForCPUSkinning = function() {\n            var G = this._internalMeshDataInfo;\n            if (!G._sourceNormals) {\n              var Q = this.getVerticesData(c.b.NormalKind);\n              if (!Q)\n                return G._sourceNormals;\n              G._sourceNormals = new Float32Array(Q), this.isVertexBufferUpdatable(c.b.NormalKind) || this.setVerticesData(c.b.NormalKind, Q, !0);\n            }\n            return G._sourceNormals;\n          }, L.prototype.applySkeleton = function(G) {\n            if (!this.geometry)\n              return this;\n            if (this.geometry._softwareSkinningFrameId == this.getScene().getFrameId())\n              return this;\n            if (this.geometry._softwareSkinningFrameId = this.getScene().getFrameId(), !this.isVerticesDataPresent(c.b.PositionKind))\n              return this;\n            if (!this.isVerticesDataPresent(c.b.MatricesIndicesKind))\n              return this;\n            if (!this.isVerticesDataPresent(c.b.MatricesWeightsKind))\n              return this;\n            var Q = this.isVerticesDataPresent(c.b.NormalKind), oe = this._internalMeshDataInfo;\n            if (!oe._sourcePositions) {\n              var re = this.subMeshes.slice();\n              this.setPositionsForCPUSkinning(), this.subMeshes = re;\n            }\n            Q && !oe._sourceNormals && this.setNormalsForCPUSkinning();\n            var Y = this.getVerticesData(c.b.PositionKind);\n            if (!Y)\n              return this;\n            Y instanceof Float32Array || (Y = new Float32Array(Y));\n            var k = this.getVerticesData(c.b.NormalKind);\n            if (Q) {\n              if (!k)\n                return this;\n              k instanceof Float32Array || (k = new Float32Array(k));\n            }\n            var H = this.getVerticesData(c.b.MatricesIndicesKind), Z = this.getVerticesData(c.b.MatricesWeightsKind);\n            if (!Z || !H)\n              return this;\n            for (var W, q = this.numBoneInfluencers > 4, he = q ? this.getVerticesData(c.b.MatricesIndicesExtraKind) : null, ge = q ? this.getVerticesData(c.b.MatricesWeightsExtraKind) : null, me = G.getTransformMatrices(this), _e = O.e.Zero(), ye = new O.a(), Pe = new O.a(), be = 0, Fe = 0; Fe < Y.length; Fe += 3, be += 4) {\n              var ke;\n              for (W = 0; W < 4; W++)\n                (ke = Z[be + W]) > 0 && (O.a.FromFloat32ArrayToRefScaled(me, Math.floor(16 * H[be + W]), ke, Pe), ye.addToSelf(Pe));\n              if (q)\n                for (W = 0; W < 4; W++)\n                  (ke = ge[be + W]) > 0 && (O.a.FromFloat32ArrayToRefScaled(me, Math.floor(16 * he[be + W]), ke, Pe), ye.addToSelf(Pe));\n              O.e.TransformCoordinatesFromFloatsToRef(oe._sourcePositions[Fe], oe._sourcePositions[Fe + 1], oe._sourcePositions[Fe + 2], ye, _e), _e.toArray(Y, Fe), Q && (O.e.TransformNormalFromFloatsToRef(oe._sourceNormals[Fe], oe._sourceNormals[Fe + 1], oe._sourceNormals[Fe + 2], ye, _e), _e.toArray(k, Fe)), ye.reset();\n            }\n            return this.updateVerticesData(c.b.PositionKind, Y), Q && this.updateVerticesData(c.b.NormalKind, k), this;\n          }, L.MinMax = function(G) {\n            var Q = null, oe = null;\n            return G.forEach(function(re) {\n              var Y = re.getBoundingInfo().boundingBox;\n              Q && oe ? (Q.minimizeInPlace(Y.minimumWorld), oe.maximizeInPlace(Y.maximumWorld)) : (Q = Y.minimumWorld, oe = Y.maximumWorld);\n            }), Q && oe ? { min: Q, max: oe } : { min: O.e.Zero(), max: O.e.Zero() };\n          }, L.Center = function(G) {\n            var Q = G instanceof Array ? L.MinMax(G) : G;\n            return O.e.Center(Q.min, Q.max);\n          }, L.MergeMeshes = function(G, Q, oe, re, Y, k) {\n            var H;\n            if (Q === void 0 && (Q = !0), !oe) {\n              var Z = 0;\n              for (H = 0; H < G.length; H++)\n                if (G[H] && (Z += G[H].getTotalVertices()) >= 65536)\n                  return N.a.Warn(\"Cannot merge meshes because resulting mesh will have more than 65536 vertices. Please use allow32BitsIndices = true to use 32 bits indices\"), null;\n            }\n            if (k) {\n              var W, q, he = null;\n              Y = !1;\n            }\n            var ge, me = new Array(), _e = new Array(), ye = null, Pe = new Array(), be = null;\n            for (H = 0; H < G.length; H++)\n              if (G[H]) {\n                var Fe = G[H];\n                if (Fe.isAnInstance)\n                  return N.a.Warn(\"Cannot merge instance meshes.\"), null;\n                var ke = Fe.computeWorldMatrix(!0);\n                if ((ge = T.a.ExtractFromMesh(Fe, !0, !0)).transform(ke), ye ? ye.merge(ge, oe) : (ye = ge, be = Fe), Y && Pe.push(Fe.getTotalIndices()), k)\n                  if (Fe.material) {\n                    var We = Fe.material;\n                    if (We instanceof v.a) {\n                      for (q = 0; q < We.subMaterials.length; q++)\n                        me.indexOf(We.subMaterials[q]) < 0 && me.push(We.subMaterials[q]);\n                      for (W = 0; W < Fe.subMeshes.length; W++)\n                        _e.push(me.indexOf(We.subMaterials[Fe.subMeshes[W].materialIndex])), Pe.push(Fe.subMeshes[W].indexCount);\n                    } else\n                      for (me.indexOf(We) < 0 && me.push(We), W = 0; W < Fe.subMeshes.length; W++)\n                        _e.push(me.indexOf(We)), Pe.push(Fe.subMeshes[W].indexCount);\n                  } else\n                    for (W = 0; W < Fe.subMeshes.length; W++)\n                      _e.push(0), Pe.push(Fe.subMeshes[W].indexCount);\n              }\n            if (be = be, re || (re = new L(be.name + \"_merged\", be.getScene())), ye.applyToMesh(re), re.checkCollisions = be.checkCollisions, re.overrideMaterialSideOrientation = be.overrideMaterialSideOrientation, Q)\n              for (H = 0; H < G.length; H++)\n                G[H] && G[H].dispose();\n            if (Y || k) {\n              re.releaseSubMeshes(), H = 0;\n              for (var je = 0; H < Pe.length; )\n                g.a.CreateFromIndices(0, je, Pe[H], re), je += Pe[H], H++;\n            }\n            if (k) {\n              for ((he = new v.a(be.name + \"_merged\", be.getScene())).subMaterials = me, W = 0; W < re.subMeshes.length; W++)\n                re.subMeshes[W].materialIndex = _e[W];\n              re.material = he;\n            } else\n              re.material = be.material;\n            return re;\n          }, L.prototype.addInstance = function(G) {\n            G._indexInSourceMeshInstanceArray = this.instances.length, this.instances.push(G);\n          }, L.prototype.removeInstance = function(G) {\n            var Q = G._indexInSourceMeshInstanceArray;\n            if (Q != -1) {\n              if (Q !== this.instances.length - 1) {\n                var oe = this.instances[this.instances.length - 1];\n                this.instances[Q] = oe, oe._indexInSourceMeshInstanceArray = Q;\n              }\n              G._indexInSourceMeshInstanceArray = -1, this.instances.pop();\n            }\n          }, L.FRONTSIDE = T.a.FRONTSIDE, L.BACKSIDE = T.a.BACKSIDE, L.DOUBLESIDE = T.a.DOUBLESIDE, L.DEFAULTSIDE = T.a.DEFAULTSIDE, L.NO_CAP = 0, L.CAP_START = 1, L.CAP_END = 2, L.CAP_ALL = 3, L.NO_FLIP = 0, L.FLIP_TILE = 1, L.ROTATE_TILE = 2, L.FLIP_ROW = 3, L.ROTATE_ROW = 4, L.FLIP_N_ROTATE_TILE = 5, L.FLIP_N_ROTATE_ROW = 6, L.CENTER = 0, L.LEFT = 1, L.RIGHT = 2, L.TOP = 3, L.BOTTOM = 4, L._GroundMeshParser = function(G, Q) {\n            throw U.a.WarnImport(\"GroundMesh\");\n          }, L;\n        }(E.a);\n        M.a.RegisteredTypes[\"BABYLON.Mesh\"] = K;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _._AddLogEntry = function(C) {\n            _._LogCache = C + _._LogCache, _.OnNewCacheEntry && _.OnNewCacheEntry(C);\n          }, _._FormatMessage = function(C) {\n            var u = function(O) {\n              return O < 10 ? \"0\" + O : \"\" + O;\n            }, I = /* @__PURE__ */ new Date();\n            return \"[\" + u(I.getHours()) + \":\" + u(I.getMinutes()) + \":\" + u(I.getSeconds()) + \"]: \" + C;\n          }, _._LogDisabled = function(C) {\n          }, _._LogEnabled = function(C) {\n            var u = _._FormatMessage(C);\n            console.log(\"BJS - \" + u);\n            var I = \"<div style='color:white'>\" + u + \"</div><br>\";\n            _._AddLogEntry(I);\n          }, _._WarnDisabled = function(C) {\n          }, _._WarnEnabled = function(C) {\n            var u = _._FormatMessage(C);\n            console.warn(\"BJS - \" + u);\n            var I = \"<div style='color:orange'>\" + u + \"</div><br>\";\n            _._AddLogEntry(I);\n          }, _._ErrorDisabled = function(C) {\n          }, _._ErrorEnabled = function(C) {\n            _.errorsCount++;\n            var u = _._FormatMessage(C);\n            console.error(\"BJS - \" + u);\n            var I = \"<div style='color:red'>\" + u + \"</div><br>\";\n            _._AddLogEntry(I);\n          }, Object.defineProperty(_, \"LogCache\", { get: function() {\n            return _._LogCache;\n          }, enumerable: !1, configurable: !0 }), _.ClearLogCache = function() {\n            _._LogCache = \"\", _.errorsCount = 0;\n          }, Object.defineProperty(_, \"LogLevels\", { set: function(C) {\n            (C & _.MessageLogLevel) === _.MessageLogLevel ? _.Log = _._LogEnabled : _.Log = _._LogDisabled, (C & _.WarningLogLevel) === _.WarningLogLevel ? _.Warn = _._WarnEnabled : _.Warn = _._WarnDisabled, (C & _.ErrorLogLevel) === _.ErrorLogLevel ? _.Error = _._ErrorEnabled : _.Error = _._ErrorDisabled;\n          }, enumerable: !1, configurable: !0 }), _.NoneLogLevel = 0, _.MessageLogLevel = 1, _.WarningLogLevel = 2, _.ErrorLogLevel = 4, _.AllLogLevel = 7, _._LogCache = \"\", _.errorsCount = 0, _.Log = _._LogEnabled, _.Warn = _._WarnEnabled, _.Error = _._ErrorEnabled, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        }), f.d(A, \"b\", function() {\n          return O;\n        }), f.d(A, \"c\", function() {\n          return x;\n        });\n        var V = f(14), _ = f(28), C = f(44), u = f(11), I = function() {\n          function m(c, T, S) {\n            c === void 0 && (c = 0), T === void 0 && (T = 0), S === void 0 && (S = 0), this.r = c, this.g = T, this.b = S;\n          }\n          return m.prototype.toString = function() {\n            return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \"}\";\n          }, m.prototype.getClassName = function() {\n            return \"Color3\";\n          }, m.prototype.getHashCode = function() {\n            var c = 255 * this.r | 0;\n            return c = 397 * (c = 397 * c ^ (255 * this.g | 0)) ^ (255 * this.b | 0);\n          }, m.prototype.toArray = function(c, T) {\n            return T === void 0 && (T = 0), c[T] = this.r, c[T + 1] = this.g, c[T + 2] = this.b, this;\n          }, m.prototype.fromArray = function(c, T) {\n            return T === void 0 && (T = 0), m.FromArrayToRef(c, T, this), this;\n          }, m.prototype.toColor4 = function(c) {\n            return c === void 0 && (c = 1), new O(this.r, this.g, this.b, c);\n          }, m.prototype.asArray = function() {\n            var c = new Array();\n            return this.toArray(c, 0), c;\n          }, m.prototype.toLuminance = function() {\n            return 0.3 * this.r + 0.59 * this.g + 0.11 * this.b;\n          }, m.prototype.multiply = function(c) {\n            return new m(this.r * c.r, this.g * c.g, this.b * c.b);\n          }, m.prototype.multiplyToRef = function(c, T) {\n            return T.r = this.r * c.r, T.g = this.g * c.g, T.b = this.b * c.b, this;\n          }, m.prototype.equals = function(c) {\n            return c && this.r === c.r && this.g === c.g && this.b === c.b;\n          }, m.prototype.equalsFloats = function(c, T, S) {\n            return this.r === c && this.g === T && this.b === S;\n          }, m.prototype.scale = function(c) {\n            return new m(this.r * c, this.g * c, this.b * c);\n          }, m.prototype.scaleToRef = function(c, T) {\n            return T.r = this.r * c, T.g = this.g * c, T.b = this.b * c, this;\n          }, m.prototype.scaleAndAddToRef = function(c, T) {\n            return T.r += this.r * c, T.g += this.g * c, T.b += this.b * c, this;\n          }, m.prototype.clampToRef = function(c, T, S) {\n            return c === void 0 && (c = 0), T === void 0 && (T = 1), S.r = V.a.Clamp(this.r, c, T), S.g = V.a.Clamp(this.g, c, T), S.b = V.a.Clamp(this.b, c, T), this;\n          }, m.prototype.add = function(c) {\n            return new m(this.r + c.r, this.g + c.g, this.b + c.b);\n          }, m.prototype.addToRef = function(c, T) {\n            return T.r = this.r + c.r, T.g = this.g + c.g, T.b = this.b + c.b, this;\n          }, m.prototype.subtract = function(c) {\n            return new m(this.r - c.r, this.g - c.g, this.b - c.b);\n          }, m.prototype.subtractToRef = function(c, T) {\n            return T.r = this.r - c.r, T.g = this.g - c.g, T.b = this.b - c.b, this;\n          }, m.prototype.clone = function() {\n            return new m(this.r, this.g, this.b);\n          }, m.prototype.copyFrom = function(c) {\n            return this.r = c.r, this.g = c.g, this.b = c.b, this;\n          }, m.prototype.copyFromFloats = function(c, T, S) {\n            return this.r = c, this.g = T, this.b = S, this;\n          }, m.prototype.set = function(c, T, S) {\n            return this.copyFromFloats(c, T, S);\n          }, m.prototype.toHexString = function() {\n            var c = 255 * this.r | 0, T = 255 * this.g | 0, S = 255 * this.b | 0;\n            return \"#\" + V.a.ToHex(c) + V.a.ToHex(T) + V.a.ToHex(S);\n          }, m.prototype.toLinearSpace = function() {\n            var c = new m();\n            return this.toLinearSpaceToRef(c), c;\n          }, m.prototype.toHSV = function() {\n            var c = new m();\n            return this.toHSVToRef(c), c;\n          }, m.prototype.toHSVToRef = function(c) {\n            var T = this.r, S = this.g, E = this.b, g = Math.max(T, S, E), l = Math.min(T, S, E), h = 0, v = 0, b = g, D = g - l;\n            g !== 0 && (v = D / g), g != l && (g == T ? (h = (S - E) / D, S < E && (h += 6)) : g == S ? h = (E - T) / D + 2 : g == E && (h = (T - S) / D + 4), h *= 60), c.r = h, c.g = v, c.b = b;\n          }, m.prototype.toLinearSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.c), c.g = Math.pow(this.g, _.c), c.b = Math.pow(this.b, _.c), this;\n          }, m.prototype.toGammaSpace = function() {\n            var c = new m();\n            return this.toGammaSpaceToRef(c), c;\n          }, m.prototype.toGammaSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.b), c.g = Math.pow(this.g, _.b), c.b = Math.pow(this.b, _.b), this;\n          }, m.HSVtoRGBToRef = function(c, T, S, E) {\n            var g = S * T, l = c / 60, h = g * (1 - Math.abs(l % 2 - 1)), v = 0, b = 0, D = 0;\n            l >= 0 && l <= 1 ? (v = g, b = h) : l >= 1 && l <= 2 ? (v = h, b = g) : l >= 2 && l <= 3 ? (b = g, D = h) : l >= 3 && l <= 4 ? (b = h, D = g) : l >= 4 && l <= 5 ? (v = h, D = g) : l >= 5 && l <= 6 && (v = g, D = h);\n            var w = S - g;\n            E.set(v + w, b + w, D + w);\n          }, m.FromHexString = function(c) {\n            if (c.substring(0, 1) !== \"#\" || c.length !== 7)\n              return new m(0, 0, 0);\n            var T = parseInt(c.substring(1, 3), 16), S = parseInt(c.substring(3, 5), 16), E = parseInt(c.substring(5, 7), 16);\n            return m.FromInts(T, S, E);\n          }, m.FromArray = function(c, T) {\n            return T === void 0 && (T = 0), new m(c[T], c[T + 1], c[T + 2]);\n          }, m.FromArrayToRef = function(c, T, S) {\n            T === void 0 && (T = 0), S.r = c[T], S.g = c[T + 1], S.b = c[T + 2];\n          }, m.FromInts = function(c, T, S) {\n            return new m(c / 255, T / 255, S / 255);\n          }, m.Lerp = function(c, T, S) {\n            var E = new m(0, 0, 0);\n            return m.LerpToRef(c, T, S, E), E;\n          }, m.LerpToRef = function(c, T, S, E) {\n            E.r = c.r + (T.r - c.r) * S, E.g = c.g + (T.g - c.g) * S, E.b = c.b + (T.b - c.b) * S;\n          }, m.Red = function() {\n            return new m(1, 0, 0);\n          }, m.Green = function() {\n            return new m(0, 1, 0);\n          }, m.Blue = function() {\n            return new m(0, 0, 1);\n          }, m.Black = function() {\n            return new m(0, 0, 0);\n          }, Object.defineProperty(m, \"BlackReadOnly\", { get: function() {\n            return m._BlackReadOnly;\n          }, enumerable: !1, configurable: !0 }), m.White = function() {\n            return new m(1, 1, 1);\n          }, m.Purple = function() {\n            return new m(0.5, 0, 0.5);\n          }, m.Magenta = function() {\n            return new m(1, 0, 1);\n          }, m.Yellow = function() {\n            return new m(1, 1, 0);\n          }, m.Gray = function() {\n            return new m(0.5, 0.5, 0.5);\n          }, m.Teal = function() {\n            return new m(0, 1, 1);\n          }, m.Random = function() {\n            return new m(Math.random(), Math.random(), Math.random());\n          }, m._BlackReadOnly = m.Black(), m;\n        }(), O = function() {\n          function m(c, T, S, E) {\n            c === void 0 && (c = 0), T === void 0 && (T = 0), S === void 0 && (S = 0), E === void 0 && (E = 1), this.r = c, this.g = T, this.b = S, this.a = E;\n          }\n          return m.prototype.addInPlace = function(c) {\n            return this.r += c.r, this.g += c.g, this.b += c.b, this.a += c.a, this;\n          }, m.prototype.asArray = function() {\n            var c = new Array();\n            return this.toArray(c, 0), c;\n          }, m.prototype.toArray = function(c, T) {\n            return T === void 0 && (T = 0), c[T] = this.r, c[T + 1] = this.g, c[T + 2] = this.b, c[T + 3] = this.a, this;\n          }, m.prototype.fromArray = function(c, T) {\n            return T === void 0 && (T = 0), m.FromArrayToRef(c, T, this), this;\n          }, m.prototype.equals = function(c) {\n            return c && this.r === c.r && this.g === c.g && this.b === c.b && this.a === c.a;\n          }, m.prototype.add = function(c) {\n            return new m(this.r + c.r, this.g + c.g, this.b + c.b, this.a + c.a);\n          }, m.prototype.subtract = function(c) {\n            return new m(this.r - c.r, this.g - c.g, this.b - c.b, this.a - c.a);\n          }, m.prototype.subtractToRef = function(c, T) {\n            return T.r = this.r - c.r, T.g = this.g - c.g, T.b = this.b - c.b, T.a = this.a - c.a, this;\n          }, m.prototype.scale = function(c) {\n            return new m(this.r * c, this.g * c, this.b * c, this.a * c);\n          }, m.prototype.scaleToRef = function(c, T) {\n            return T.r = this.r * c, T.g = this.g * c, T.b = this.b * c, T.a = this.a * c, this;\n          }, m.prototype.scaleAndAddToRef = function(c, T) {\n            return T.r += this.r * c, T.g += this.g * c, T.b += this.b * c, T.a += this.a * c, this;\n          }, m.prototype.clampToRef = function(c, T, S) {\n            return c === void 0 && (c = 0), T === void 0 && (T = 1), S.r = V.a.Clamp(this.r, c, T), S.g = V.a.Clamp(this.g, c, T), S.b = V.a.Clamp(this.b, c, T), S.a = V.a.Clamp(this.a, c, T), this;\n          }, m.prototype.multiply = function(c) {\n            return new m(this.r * c.r, this.g * c.g, this.b * c.b, this.a * c.a);\n          }, m.prototype.multiplyToRef = function(c, T) {\n            return T.r = this.r * c.r, T.g = this.g * c.g, T.b = this.b * c.b, T.a = this.a * c.a, T;\n          }, m.prototype.toString = function() {\n            return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \" A:\" + this.a + \"}\";\n          }, m.prototype.getClassName = function() {\n            return \"Color4\";\n          }, m.prototype.getHashCode = function() {\n            var c = 255 * this.r | 0;\n            return c = 397 * (c = 397 * (c = 397 * c ^ (255 * this.g | 0)) ^ (255 * this.b | 0)) ^ (255 * this.a | 0);\n          }, m.prototype.clone = function() {\n            return new m(this.r, this.g, this.b, this.a);\n          }, m.prototype.copyFrom = function(c) {\n            return this.r = c.r, this.g = c.g, this.b = c.b, this.a = c.a, this;\n          }, m.prototype.copyFromFloats = function(c, T, S, E) {\n            return this.r = c, this.g = T, this.b = S, this.a = E, this;\n          }, m.prototype.set = function(c, T, S, E) {\n            return this.copyFromFloats(c, T, S, E);\n          }, m.prototype.toHexString = function(c) {\n            c === void 0 && (c = !1);\n            var T = 255 * this.r | 0, S = 255 * this.g | 0, E = 255 * this.b | 0;\n            if (c)\n              return \"#\" + V.a.ToHex(T) + V.a.ToHex(S) + V.a.ToHex(E);\n            var g = 255 * this.a | 0;\n            return \"#\" + V.a.ToHex(T) + V.a.ToHex(S) + V.a.ToHex(E) + V.a.ToHex(g);\n          }, m.prototype.toLinearSpace = function() {\n            var c = new m();\n            return this.toLinearSpaceToRef(c), c;\n          }, m.prototype.toLinearSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.c), c.g = Math.pow(this.g, _.c), c.b = Math.pow(this.b, _.c), c.a = this.a, this;\n          }, m.prototype.toGammaSpace = function() {\n            var c = new m();\n            return this.toGammaSpaceToRef(c), c;\n          }, m.prototype.toGammaSpaceToRef = function(c) {\n            return c.r = Math.pow(this.r, _.b), c.g = Math.pow(this.g, _.b), c.b = Math.pow(this.b, _.b), c.a = this.a, this;\n          }, m.FromHexString = function(c) {\n            if (c.substring(0, 1) !== \"#\" || c.length !== 9)\n              return new m(0, 0, 0, 0);\n            var T = parseInt(c.substring(1, 3), 16), S = parseInt(c.substring(3, 5), 16), E = parseInt(c.substring(5, 7), 16), g = parseInt(c.substring(7, 9), 16);\n            return m.FromInts(T, S, E, g);\n          }, m.Lerp = function(c, T, S) {\n            var E = new m(0, 0, 0, 0);\n            return m.LerpToRef(c, T, S, E), E;\n          }, m.LerpToRef = function(c, T, S, E) {\n            E.r = c.r + (T.r - c.r) * S, E.g = c.g + (T.g - c.g) * S, E.b = c.b + (T.b - c.b) * S, E.a = c.a + (T.a - c.a) * S;\n          }, m.FromColor3 = function(c, T) {\n            return T === void 0 && (T = 1), new m(c.r, c.g, c.b, T);\n          }, m.FromArray = function(c, T) {\n            return T === void 0 && (T = 0), new m(c[T], c[T + 1], c[T + 2], c[T + 3]);\n          }, m.FromArrayToRef = function(c, T, S) {\n            T === void 0 && (T = 0), S.r = c[T], S.g = c[T + 1], S.b = c[T + 2], S.a = c[T + 3];\n          }, m.FromInts = function(c, T, S, E) {\n            return new m(c / 255, T / 255, S / 255, E / 255);\n          }, m.CheckColors4 = function(c, T) {\n            if (c.length === 3 * T) {\n              for (var S = [], E = 0; E < c.length; E += 3) {\n                var g = E / 3 * 4;\n                S[g] = c[E], S[g + 1] = c[E + 1], S[g + 2] = c[E + 2], S[g + 3] = 1;\n              }\n              return S;\n            }\n            return c;\n          }, m;\n        }(), x = function() {\n          function m() {\n          }\n          return m.Color3 = C.a.BuildArray(3, I.Black), m.Color4 = C.a.BuildArray(3, function() {\n            return new O(0, 0, 0, 0);\n          }), m;\n        }();\n        u.a.RegisteredTypes[\"BABYLON.Color3\"] = I, u.a.RegisteredTypes[\"BABYLON.Color4\"] = O;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return l;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(0), I = f(52), O = f(2), x = f(11), m = f(21), c = f(104), T = f(122), S = f(64), E = f(34), g = f(150), l = function(h) {\n          function v(b, D, w, N, M, U, X, j, ne, te, de, pe) {\n            w === void 0 && (w = !1), N === void 0 && (N = !0), M === void 0 && (M = v.TRILINEAR_SAMPLINGMODE), U === void 0 && (U = null), X === void 0 && (X = null), j === void 0 && (j = null), ne === void 0 && (ne = !1);\n            var ae = h.call(this, D) || this;\n            ae.url = null, ae.uOffset = 0, ae.vOffset = 0, ae.uScale = 1, ae.vScale = 1, ae.uAng = 0, ae.vAng = 0, ae.wAng = 0, ae.uRotationCenter = 0.5, ae.vRotationCenter = 0.5, ae.wRotationCenter = 0.5, ae.homogeneousRotationInUVTransform = !1, ae.inspectableCustomProperties = null, ae._noMipmap = !1, ae._invertY = !1, ae._rowGenerationMatrix = null, ae._cachedTextureMatrix = null, ae._projectionModeMatrix = null, ae._t0 = null, ae._t1 = null, ae._t2 = null, ae._cachedUOffset = -1, ae._cachedVOffset = -1, ae._cachedUScale = 0, ae._cachedVScale = 0, ae._cachedUAng = -1, ae._cachedVAng = -1, ae._cachedWAng = -1, ae._cachedProjectionMatrixId = -1, ae._cachedURotationCenter = -1, ae._cachedVRotationCenter = -1, ae._cachedWRotationCenter = -1, ae._cachedHomogeneousRotationInUVTransform = !1, ae._cachedCoordinatesMode = -1, ae._initialSamplingMode = v.BILINEAR_SAMPLINGMODE, ae._buffer = null, ae._deleteBuffer = !1, ae._format = null, ae._delayedOnLoad = null, ae._delayedOnError = null, ae.onLoadObservable = new C.c(), ae._isBlocking = !0, ae.name = b || \"\", ae.url = b, ae._noMipmap = w, ae._invertY = N, ae._initialSamplingMode = M, ae._buffer = j, ae._deleteBuffer = ne, ae._mimeType = de, ae._loaderOptions = pe, te && (ae._format = te);\n            var ee = ae.getScene(), K = ae._getEngine();\n            if (!K)\n              return ae;\n            K.onBeforeTextureInitObservable.notifyObservers(ae);\n            var $ = function() {\n              ae._texture && (ae._texture._invertVScale && (ae.vScale *= -1, ae.vOffset += 1), ae._texture._cachedWrapU !== null && (ae.wrapU = ae._texture._cachedWrapU, ae._texture._cachedWrapU = null), ae._texture._cachedWrapV !== null && (ae.wrapV = ae._texture._cachedWrapV, ae._texture._cachedWrapV = null), ae._texture._cachedWrapR !== null && (ae.wrapR = ae._texture._cachedWrapR, ae._texture._cachedWrapR = null)), ae.onLoadObservable.hasObservers() && ae.onLoadObservable.notifyObservers(ae), U && U(), !ae.isBlocking && ee && ee.resetCachedMaterial();\n            };\n            return ae.url ? (ae._texture = ae._getFromCache(ae.url, w, M, N), ae._texture ? ae._texture.isReady ? c.a.SetImmediate(function() {\n              return $();\n            }) : ae._texture.onLoadedObservable.add($) : ee && ee.useDelayedTextureLoading ? (ae.delayLoadState = O.a.DELAYLOADSTATE_NOTLOADED, ae._delayedOnLoad = $, ae._delayedOnError = X) : (ae._texture = K.createTexture(ae.url, w, N, ee, M, $, X, ae._buffer, void 0, ae._format, null, de, pe), ne && (ae._buffer = null)), ae) : (ae._delayedOnLoad = $, ae._delayedOnError = X, ae);\n          }\n          return Object(V.d)(v, h), Object.defineProperty(v.prototype, \"noMipmap\", { get: function() {\n            return this._noMipmap;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"mimeType\", { get: function() {\n            return this._mimeType;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"isBlocking\", { get: function() {\n            return this._isBlocking;\n          }, set: function(b) {\n            this._isBlocking = b;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"samplingMode\", { get: function() {\n            return this._texture ? this._texture.samplingMode : this._initialSamplingMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"invertY\", { get: function() {\n            return this._invertY;\n          }, enumerable: !1, configurable: !0 }), v.prototype.updateURL = function(b, D, w) {\n            D === void 0 && (D = null), this.url && (this.releaseInternalTexture(), this.getScene().markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag)), this.name && !E.a.StartsWith(this.name, \"data:\") || (this.name = b), this.url = b, this._buffer = D, this.delayLoadState = O.a.DELAYLOADSTATE_NOTLOADED, w && (this._delayedOnLoad = w), this.delayLoad();\n          }, v.prototype.delayLoad = function() {\n            if (this.delayLoadState === O.a.DELAYLOADSTATE_NOTLOADED) {\n              var b = this.getScene();\n              b && (this.delayLoadState = O.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap, this.samplingMode, this._invertY), this._texture ? this._delayedOnLoad && (this._texture.isReady ? c.a.SetImmediate(this._delayedOnLoad) : this._texture.onLoadedObservable.add(this._delayedOnLoad)) : (this._texture = b.getEngine().createTexture(this.url, this._noMipmap, this._invertY, b, this.samplingMode, this._delayedOnLoad, this._delayedOnError, this._buffer, null, this._format, null, this._mimeType, this._loaderOptions), this._deleteBuffer && (this._buffer = null)), this._delayedOnLoad = null, this._delayedOnError = null);\n            }\n          }, v.prototype._prepareRowForTextureGeneration = function(b, D, w, N) {\n            b *= this._cachedUScale, D *= this._cachedVScale, b -= this.uRotationCenter * this._cachedUScale, D -= this.vRotationCenter * this._cachedVScale, w -= this.wRotationCenter, u.e.TransformCoordinatesFromFloatsToRef(b, D, w, this._rowGenerationMatrix, N), N.x += this.uRotationCenter * this._cachedUScale + this._cachedUOffset, N.y += this.vRotationCenter * this._cachedVScale + this._cachedVOffset, N.z += this.wRotationCenter;\n          }, v.prototype.checkTransformsAreIdentical = function(b) {\n            return b !== null && this.uOffset === b.uOffset && this.vOffset === b.vOffset && this.uScale === b.uScale && this.vScale === b.vScale && this.uAng === b.uAng && this.vAng === b.vAng && this.wAng === b.wAng;\n          }, v.prototype.getTextureMatrix = function(b) {\n            var D = this;\n            if (b === void 0 && (b = 1), this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale * b === this._cachedUScale && this.vScale === this._cachedVScale && this.uAng === this._cachedUAng && this.vAng === this._cachedVAng && this.wAng === this._cachedWAng && this.uRotationCenter === this._cachedURotationCenter && this.vRotationCenter === this._cachedVRotationCenter && this.wRotationCenter === this._cachedWRotationCenter && this.homogeneousRotationInUVTransform === this._cachedHomogeneousRotationInUVTransform)\n              return this._cachedTextureMatrix;\n            this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale * b, this._cachedVScale = this.vScale, this._cachedUAng = this.uAng, this._cachedVAng = this.vAng, this._cachedWAng = this.wAng, this._cachedURotationCenter = this.uRotationCenter, this._cachedVRotationCenter = this.vRotationCenter, this._cachedWRotationCenter = this.wRotationCenter, this._cachedHomogeneousRotationInUVTransform = this.homogeneousRotationInUVTransform, this._cachedTextureMatrix && this._rowGenerationMatrix || (this._cachedTextureMatrix = u.a.Zero(), this._rowGenerationMatrix = new u.a(), this._t0 = u.e.Zero(), this._t1 = u.e.Zero(), this._t2 = u.e.Zero()), u.a.RotationYawPitchRollToRef(this.vAng, this.uAng, this.wAng, this._rowGenerationMatrix), this.homogeneousRotationInUVTransform ? (u.a.TranslationToRef(-this._cachedURotationCenter, -this._cachedVRotationCenter, -this._cachedWRotationCenter, u.c.Matrix[0]), u.a.TranslationToRef(this._cachedURotationCenter, this._cachedVRotationCenter, this._cachedWRotationCenter, u.c.Matrix[1]), u.a.ScalingToRef(this._cachedUScale, this._cachedVScale, 0, u.c.Matrix[2]), u.a.TranslationToRef(this._cachedUOffset, this._cachedVOffset, 0, u.c.Matrix[3]), u.c.Matrix[0].multiplyToRef(this._rowGenerationMatrix, this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(u.c.Matrix[1], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(u.c.Matrix[2], this._cachedTextureMatrix), this._cachedTextureMatrix.multiplyToRef(u.c.Matrix[3], this._cachedTextureMatrix), this._cachedTextureMatrix.setRowFromFloats(2, this._cachedTextureMatrix.m[12], this._cachedTextureMatrix.m[13], this._cachedTextureMatrix.m[14], 1)) : (this._prepareRowForTextureGeneration(0, 0, 0, this._t0), this._prepareRowForTextureGeneration(1, 0, 0, this._t1), this._prepareRowForTextureGeneration(0, 1, 0, this._t2), this._t1.subtractInPlace(this._t0), this._t2.subtractInPlace(this._t0), u.a.FromValuesToRef(this._t1.x, this._t1.y, this._t1.z, 0, this._t2.x, this._t2.y, this._t2.z, 0, this._t0.x, this._t0.y, this._t0.z, 0, 0, 0, 0, 1, this._cachedTextureMatrix));\n            var w = this.getScene();\n            return w ? (w.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag, function(N) {\n              return N.hasTexture(D);\n            }), this._cachedTextureMatrix) : this._cachedTextureMatrix;\n          }, v.prototype.getReflectionTextureMatrix = function() {\n            var b = this, D = this.getScene();\n            if (!D)\n              return this._cachedTextureMatrix;\n            if (this.uOffset === this._cachedUOffset && this.vOffset === this._cachedVOffset && this.uScale === this._cachedUScale && this.vScale === this._cachedVScale && this.coordinatesMode === this._cachedCoordinatesMode) {\n              if (this.coordinatesMode !== v.PROJECTION_MODE)\n                return this._cachedTextureMatrix;\n              if (this._cachedProjectionMatrixId === D.getProjectionMatrix().updateFlag)\n                return this._cachedTextureMatrix;\n            }\n            switch (this._cachedTextureMatrix || (this._cachedTextureMatrix = u.a.Zero()), this._projectionModeMatrix || (this._projectionModeMatrix = u.a.Zero()), this._cachedUOffset = this.uOffset, this._cachedVOffset = this.vOffset, this._cachedUScale = this.uScale, this._cachedVScale = this.vScale, this._cachedCoordinatesMode = this.coordinatesMode, this.coordinatesMode) {\n              case v.PLANAR_MODE:\n                u.a.IdentityToRef(this._cachedTextureMatrix), this._cachedTextureMatrix[0] = this.uScale, this._cachedTextureMatrix[5] = this.vScale, this._cachedTextureMatrix[12] = this.uOffset, this._cachedTextureMatrix[13] = this.vOffset;\n                break;\n              case v.PROJECTION_MODE:\n                u.a.FromValuesToRef(0.5, 0, 0, 0, 0, -0.5, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 1, 1, this._projectionModeMatrix);\n                var w = D.getProjectionMatrix();\n                this._cachedProjectionMatrixId = w.updateFlag, w.multiplyToRef(this._projectionModeMatrix, this._cachedTextureMatrix);\n                break;\n              default:\n                u.a.IdentityToRef(this._cachedTextureMatrix);\n            }\n            return D.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag, function(N) {\n              return N.getActiveTextures().indexOf(b) !== -1;\n            }), this._cachedTextureMatrix;\n          }, v.prototype.clone = function() {\n            var b = this;\n            return _.a.Clone(function() {\n              return new v(b._texture ? b._texture.url : null, b.getScene(), b._noMipmap, b._invertY, b.samplingMode, void 0, void 0, b._texture ? b._texture._buffer : void 0);\n            }, this);\n          }, v.prototype.serialize = function() {\n            var b = this.name;\n            v.SerializeBuffers || E.a.StartsWith(this.name, \"data:\") && (this.name = \"\"), E.a.StartsWith(this.name, \"data:\") && this.url === this.name && (this.url = \"\");\n            var D = h.prototype.serialize.call(this);\n            return D ? ((v.SerializeBuffers || v.ForceSerializeBuffers) && (typeof this._buffer == \"string\" && this._buffer.substr(0, 5) === \"data:\" ? (D.base64String = this._buffer, D.name = D.name.replace(\"data:\", \"\")) : this.url && E.a.StartsWith(this.url, \"data:\") && this._buffer instanceof Uint8Array ? D.base64String = \"data:image/png;base64,\" + E.a.EncodeArrayBufferToBase64(this._buffer) : v.ForceSerializeBuffers && (D.base64String = g.a.GenerateBase64StringFromTexture(this))), D.invertY = this._invertY, D.samplingMode = this.samplingMode, this.name = b, D) : null;\n          }, v.prototype.getClassName = function() {\n            return \"Texture\";\n          }, v.prototype.dispose = function() {\n            h.prototype.dispose.call(this), this.onLoadObservable.clear(), this._delayedOnLoad = null, this._delayedOnError = null;\n          }, v.Parse = function(b, D, w) {\n            if (b.customType) {\n              var N = T.a.Instantiate(b.customType).Parse(b, D, w);\n              return b.samplingMode && N.updateSamplingMode && N._samplingMode && N._samplingMode !== b.samplingMode && N.updateSamplingMode(b.samplingMode), N;\n            }\n            if (b.isCube && !b.isRenderTarget)\n              return v._CubeTextureParser(b, D, w);\n            if (!b.name && !b.isRenderTarget)\n              return null;\n            var M = function() {\n              if (U && U._texture && (U._texture._cachedWrapU = null, U._texture._cachedWrapV = null, U._texture._cachedWrapR = null), b.samplingMode) {\n                var X = b.samplingMode;\n                U && U.samplingMode !== X && U.updateSamplingMode(X);\n              }\n              if (U && b.animations)\n                for (var j = 0; j < b.animations.length; j++) {\n                  var ne = b.animations[j], te = x.a.GetClass(\"BABYLON.Animation\");\n                  te && U.animations.push(te.Parse(ne));\n                }\n            }, U = _.a.Parse(function() {\n              var X, j = !0;\n              if (b.noMipmap && (j = !1), b.mirrorPlane) {\n                var ne = v._CreateMirror(b.name, b.renderTargetSize, D, j);\n                return ne._waitingRenderList = b.renderList, ne.mirrorPlane = S.a.FromArray(b.mirrorPlane), M(), ne;\n              }\n              if (b.isRenderTarget) {\n                var te = null;\n                if (b.isCube) {\n                  if (D.reflectionProbes)\n                    for (var de = 0; de < D.reflectionProbes.length; de++) {\n                      var pe = D.reflectionProbes[de];\n                      if (pe.name === b.name)\n                        return pe.cubeTexture;\n                    }\n                } else\n                  (te = v._CreateRenderTargetTexture(b.name, b.renderTargetSize, D, j))._waitingRenderList = b.renderList;\n                return M(), te;\n              }\n              if (b.base64String)\n                X = v.CreateFromBase64String(b.base64String, b.name, D, !j, b.invertY, void 0, M);\n              else {\n                var ae = void 0;\n                ae = b.name && b.name.indexOf(\"://\") > 0 ? b.name : w + b.name, (E.a.StartsWith(b.url, \"data:\") || v.UseSerializedUrlIfAny && b.url) && (ae = b.url), X = new v(ae, D, !j, b.invertY, void 0, M);\n              }\n              return X;\n            }, b, D);\n            return U;\n          }, v.CreateFromBase64String = function(b, D, w, N, M, U, X, j, ne) {\n            return U === void 0 && (U = v.TRILINEAR_SAMPLINGMODE), X === void 0 && (X = null), j === void 0 && (j = null), ne === void 0 && (ne = O.a.TEXTUREFORMAT_RGBA), new v(\"data:\" + D, w, N, M, U, X, j, b, !1, ne);\n          }, v.LoadFromDataString = function(b, D, w, N, M, U, X, j, ne, te) {\n            return N === void 0 && (N = !1), M === void 0 && (M = !1), U === void 0 && (U = !0), X === void 0 && (X = v.TRILINEAR_SAMPLINGMODE), j === void 0 && (j = null), ne === void 0 && (ne = null), te === void 0 && (te = O.a.TEXTUREFORMAT_RGBA), b.substr(0, 5) !== \"data:\" && (b = \"data:\" + b), new v(b, w, M, U, X, j, ne, D, N, te);\n          }, v.SerializeBuffers = !0, v.ForceSerializeBuffers = !1, v._CubeTextureParser = function(b, D, w) {\n            throw m.a.WarnImport(\"CubeTexture\");\n          }, v._CreateMirror = function(b, D, w, N) {\n            throw m.a.WarnImport(\"MirrorTexture\");\n          }, v._CreateRenderTargetTexture = function(b, D, w, N) {\n            throw m.a.WarnImport(\"RenderTargetTexture\");\n          }, v.NEAREST_SAMPLINGMODE = O.a.TEXTURE_NEAREST_SAMPLINGMODE, v.NEAREST_NEAREST_MIPLINEAR = O.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR, v.BILINEAR_SAMPLINGMODE = O.a.TEXTURE_BILINEAR_SAMPLINGMODE, v.LINEAR_LINEAR_MIPNEAREST = O.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST, v.TRILINEAR_SAMPLINGMODE = O.a.TEXTURE_TRILINEAR_SAMPLINGMODE, v.LINEAR_LINEAR_MIPLINEAR = O.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR, v.NEAREST_NEAREST_MIPNEAREST = O.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST, v.NEAREST_LINEAR_MIPNEAREST = O.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST, v.NEAREST_LINEAR_MIPLINEAR = O.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR, v.NEAREST_LINEAR = O.a.TEXTURE_NEAREST_LINEAR, v.NEAREST_NEAREST = O.a.TEXTURE_NEAREST_NEAREST, v.LINEAR_NEAREST_MIPNEAREST = O.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST, v.LINEAR_NEAREST_MIPLINEAR = O.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR, v.LINEAR_LINEAR = O.a.TEXTURE_LINEAR_LINEAR, v.LINEAR_NEAREST = O.a.TEXTURE_LINEAR_NEAREST, v.EXPLICIT_MODE = O.a.TEXTURE_EXPLICIT_MODE, v.SPHERICAL_MODE = O.a.TEXTURE_SPHERICAL_MODE, v.PLANAR_MODE = O.a.TEXTURE_PLANAR_MODE, v.CUBIC_MODE = O.a.TEXTURE_CUBIC_MODE, v.PROJECTION_MODE = O.a.TEXTURE_PROJECTION_MODE, v.SKYBOX_MODE = O.a.TEXTURE_SKYBOX_MODE, v.INVCUBIC_MODE = O.a.TEXTURE_INVCUBIC_MODE, v.EQUIRECTANGULAR_MODE = O.a.TEXTURE_EQUIRECTANGULAR_MODE, v.FIXED_EQUIRECTANGULAR_MODE = O.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, v.FIXED_EQUIRECTANGULAR_MIRRORED_MODE = O.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, v.CLAMP_ADDRESSMODE = O.a.TEXTURE_CLAMP_ADDRESSMODE, v.WRAP_ADDRESSMODE = O.a.TEXTURE_WRAP_ADDRESSMODE, v.MIRROR_ADDRESSMODE = O.a.TEXTURE_MIRROR_ADDRESSMODE, v.UseSerializedUrlIfAny = !1, Object(V.c)([Object(_.c)()], v.prototype, \"url\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uOffset\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vOffset\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uScale\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vScale\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uAng\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vAng\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"wAng\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"uRotationCenter\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"vRotationCenter\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"wRotationCenter\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"homogeneousRotationInUVTransform\", void 0), Object(V.c)([Object(_.c)()], v.prototype, \"isBlocking\", null), v;\n        }(I.a);\n        x.a.RegisteredTypes[\"BABYLON.Texture\"] = l, _.a._TextureParser = l.Parse;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.GetClass = function(C) {\n            return this.RegisteredTypes && this.RegisteredTypes[C] ? this.RegisteredTypes[C] : null;\n          }, _.RegisteredTypes = {}, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return l;\n        }), f.d(A, \"c\", function() {\n          return h;\n        }), f.d(A, \"a\", function() {\n          return v;\n        });\n        var V = f(6), _ = f(38), C = f(8), u = f(41), I = f(57), O = f(21), x = f(49), m = f(22), c = f(56), T = f(145), S = f(104), E = f(122), g = f(120), l = function() {\n          function b() {\n          }\n          return Object.defineProperty(b, \"BaseUrl\", { get: function() {\n            return c.a.BaseUrl;\n          }, set: function(D) {\n            c.a.BaseUrl = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"DefaultRetryStrategy\", { get: function() {\n            return c.a.DefaultRetryStrategy;\n          }, set: function(D) {\n            c.a.DefaultRetryStrategy = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"CorsBehavior\", { get: function() {\n            return c.a.CorsBehavior;\n          }, set: function(D) {\n            c.a.CorsBehavior = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"UseFallbackTexture\", { get: function() {\n            return m.a.UseFallbackTexture;\n          }, set: function(D) {\n            m.a.UseFallbackTexture = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"RegisteredExternalClasses\", { get: function() {\n            return E.a.RegisteredExternalClasses;\n          }, set: function(D) {\n            E.a.RegisteredExternalClasses = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"fallbackTexture\", { get: function() {\n            return m.a.FallbackTexture;\n          }, set: function(D) {\n            m.a.FallbackTexture = D;\n          }, enumerable: !1, configurable: !0 }), b.FetchToRef = function(D, w, N, M, U, X) {\n            var j = 4 * ((Math.abs(D) * N % N | 0) + (Math.abs(w) * M % M | 0) * N);\n            X.r = U[j] / 255, X.g = U[j + 1] / 255, X.b = U[j + 2] / 255, X.a = U[j + 3] / 255;\n          }, b.Mix = function(D, w, N) {\n            return D * (1 - N) + w * N;\n          }, b.Instantiate = function(D) {\n            return E.a.Instantiate(D);\n          }, b.Slice = function(D, w, N) {\n            return D.slice ? D.slice(w, N) : Array.prototype.slice.call(D, w, N);\n          }, b.SliceToArray = function(D, w, N) {\n            return Array.isArray(D) ? D.slice(w, N) : Array.prototype.slice.call(D, w, N);\n          }, b.SetImmediate = function(D) {\n            S.a.SetImmediate(D);\n          }, b.IsExponentOfTwo = function(D) {\n            var w = 1;\n            do\n              w *= 2;\n            while (w < D);\n            return w === D;\n          }, b.FloatRound = function(D) {\n            return Math.fround ? Math.fround(D) : b._tmpFloatArray[0] = D;\n          }, b.GetFilename = function(D) {\n            var w = D.lastIndexOf(\"/\");\n            return w < 0 ? D : D.substring(w + 1);\n          }, b.GetFolderPath = function(D, w) {\n            w === void 0 && (w = !1);\n            var N = D.lastIndexOf(\"/\");\n            return N < 0 ? w ? D : \"\" : D.substring(0, N + 1);\n          }, b.ToDegrees = function(D) {\n            return 180 * D / Math.PI;\n          }, b.ToRadians = function(D) {\n            return D * Math.PI / 180;\n          }, b.MakeArray = function(D, w) {\n            return w === !0 || D !== void 0 && D != null ? Array.isArray(D) ? D : [D] : null;\n          }, b.GetPointerPrefix = function(D) {\n            var w = \"pointer\";\n            return _.a.IsWindowObjectExist() && !window.PointerEvent && _.a.IsNavigatorAvailable() && !navigator.pointerEnabled && (w = \"mouse\"), !D._badDesktopOS || D._badOS || document && \"ontouchend\" in document || (w = \"mouse\"), w;\n          }, b.SetCorsBehavior = function(D, w) {\n            c.a.SetCorsBehavior(D, w);\n          }, b.CleanUrl = function(D) {\n            return D = D.replace(/#/gm, \"%23\");\n          }, Object.defineProperty(b, \"PreprocessUrl\", { get: function() {\n            return c.a.PreprocessUrl;\n          }, set: function(D) {\n            c.a.PreprocessUrl = D;\n          }, enumerable: !1, configurable: !0 }), b.LoadImage = function(D, w, N, M, U) {\n            return c.a.LoadImage(D, w, N, M, U);\n          }, b.LoadFile = function(D, w, N, M, U, X) {\n            return c.a.LoadFile(D, w, N, M, U, X);\n          }, b.LoadFileAsync = function(D, w) {\n            return w === void 0 && (w = !0), new Promise(function(N, M) {\n              c.a.LoadFile(D, function(U) {\n                N(U);\n              }, void 0, void 0, w, function(U, X) {\n                M(X);\n              });\n            });\n          }, b.LoadScript = function(D, w, N, M) {\n            if (_.a.IsWindowObjectExist()) {\n              var U = document.getElementsByTagName(\"head\")[0], X = document.createElement(\"script\");\n              X.setAttribute(\"type\", \"text/javascript\"), X.setAttribute(\"src\", D), M && (X.id = M), X.onload = function() {\n                w && w();\n              }, X.onerror = function(j) {\n                N && N(\"Unable to load script '\" + D + \"'\", j);\n              }, U.appendChild(X);\n            }\n          }, b.LoadScriptAsync = function(D, w) {\n            var N = this;\n            return new Promise(function(M, U) {\n              N.LoadScript(D, function() {\n                M();\n              }, function(X, j) {\n                U(j);\n              });\n            });\n          }, b.ReadFileAsDataURL = function(D, w, N) {\n            var M = new FileReader(), U = { onCompleteObservable: new V.c(), abort: function() {\n              return M.abort();\n            } };\n            return M.onloadend = function(X) {\n              U.onCompleteObservable.notifyObservers(U);\n            }, M.onload = function(X) {\n              w(X.target.result);\n            }, M.onprogress = N, M.readAsDataURL(D), U;\n          }, b.ReadFile = function(D, w, N, M, U) {\n            return c.a.ReadFile(D, w, N, M, U);\n          }, b.FileAsURL = function(D) {\n            var w = new Blob([D]);\n            return (window.URL || window.webkitURL).createObjectURL(w);\n          }, b.Format = function(D, w) {\n            return w === void 0 && (w = 2), D.toFixed(w);\n          }, b.DeepCopy = function(D, w, N, M) {\n            u.a.DeepCopy(D, w, N, M);\n          }, b.IsEmpty = function(D) {\n            for (var w in D)\n              if (D.hasOwnProperty(w))\n                return !1;\n            return !0;\n          }, b.RegisterTopRootEvents = function(D, w) {\n            for (var N = 0; N < w.length; N++) {\n              var M = w[N];\n              D.addEventListener(M.name, M.handler, !1);\n              try {\n                window.parent && window.parent.addEventListener(M.name, M.handler, !1);\n              } catch {\n              }\n            }\n          }, b.UnregisterTopRootEvents = function(D, w) {\n            for (var N = 0; N < w.length; N++) {\n              var M = w[N];\n              D.removeEventListener(M.name, M.handler);\n              try {\n                D.parent && D.parent.removeEventListener(M.name, M.handler);\n              } catch {\n              }\n            }\n          }, b.DumpFramebuffer = function(D, w, N, M, U, X) {\n            U === void 0 && (U = \"image/png\");\n            for (var j = 4 * D, ne = w / 2, te = N.readPixels(0, 0, D, w), de = 0; de < ne; de++)\n              for (var pe = 0; pe < j; pe++) {\n                var ae = pe + de * j, ee = pe + (w - de - 1) * j, K = te[ae];\n                te[ae] = te[ee], te[ee] = K;\n              }\n            b._ScreenshotCanvas || (b._ScreenshotCanvas = document.createElement(\"canvas\")), b._ScreenshotCanvas.width = D, b._ScreenshotCanvas.height = w;\n            var $ = b._ScreenshotCanvas.getContext(\"2d\");\n            if ($) {\n              var L = $.createImageData(D, w);\n              L.data.set(te), $.putImageData(L, 0, 0), b.EncodeScreenshotCanvasData(M, U, X);\n            }\n          }, b.ToBlob = function(D, w, N) {\n            N === void 0 && (N = \"image/png\"), D.toBlob || (D.toBlob = function(M, U, X) {\n              var j = this;\n              setTimeout(function() {\n                for (var ne = atob(j.toDataURL(U, X).split(\",\")[1]), te = ne.length, de = new Uint8Array(te), pe = 0; pe < te; pe++)\n                  de[pe] = ne.charCodeAt(pe);\n                M(new Blob([de]));\n              });\n            }), D.toBlob(function(M) {\n              w(M);\n            }, N);\n          }, b.EncodeScreenshotCanvasData = function(D, w, N) {\n            w === void 0 && (w = \"image/png\"), D ? D(b._ScreenshotCanvas.toDataURL(w)) : this.ToBlob(b._ScreenshotCanvas, function(M) {\n              if (\"download\" in document.createElement(\"a\")) {\n                if (!N) {\n                  var U = /* @__PURE__ */ new Date(), X = (U.getFullYear() + \"-\" + (U.getMonth() + 1)).slice(2) + \"-\" + U.getDate() + \"_\" + U.getHours() + \"-\" + (\"0\" + U.getMinutes()).slice(-2);\n                  N = \"screenshot_\" + X + \".png\";\n                }\n                b.Download(M, N);\n              } else {\n                var j = URL.createObjectURL(M), ne = window.open(\"\");\n                if (!ne)\n                  return;\n                var te = ne.document.createElement(\"img\");\n                te.onload = function() {\n                  URL.revokeObjectURL(j);\n                }, te.src = j, ne.document.body.appendChild(te);\n              }\n            }, w);\n          }, b.Download = function(D, w) {\n            if (navigator && navigator.msSaveBlob)\n              navigator.msSaveBlob(D, w);\n            else {\n              var N = window.URL.createObjectURL(D), M = document.createElement(\"a\");\n              document.body.appendChild(M), M.style.display = \"none\", M.href = N, M.download = w, M.addEventListener(\"click\", function() {\n                M.parentElement && M.parentElement.removeChild(M);\n              }), M.click(), window.URL.revokeObjectURL(N);\n            }\n          }, b.BackCompatCameraNoPreventDefault = function(D) {\n            return typeof D[0] == \"boolean\" ? D[0] : typeof D[1] == \"boolean\" && D[1];\n          }, b.CreateScreenshot = function(D, w, N, M, U) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.CreateScreenshotAsync = function(D, w, N, M) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.CreateScreenshotUsingRenderTarget = function(D, w, N, M, U, X, j, ne) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.CreateScreenshotUsingRenderTargetAsync = function(D, w, N, M, U, X, j) {\n            throw O.a.WarnImport(\"ScreenshotTools\");\n          }, b.RandomId = function() {\n            return g.a.RandomId();\n          }, b.IsBase64 = function(D) {\n            return !(D.length < 5) && D.substr(0, 5) === \"data:\";\n          }, b.DecodeBase64 = function(D) {\n            for (var w = atob(D.split(\",\")[1]), N = w.length, M = new Uint8Array(new ArrayBuffer(N)), U = 0; U < N; U++)\n              M[U] = w.charCodeAt(U);\n            return M.buffer;\n          }, b.GetAbsoluteUrl = function(D) {\n            var w = document.createElement(\"a\");\n            return w.href = D, w.href;\n          }, Object.defineProperty(b, \"errorsCount\", { get: function() {\n            return C.a.errorsCount;\n          }, enumerable: !1, configurable: !0 }), b.Log = function(D) {\n            C.a.Log(D);\n          }, b.Warn = function(D) {\n            C.a.Warn(D);\n          }, b.Error = function(D) {\n            C.a.Error(D);\n          }, Object.defineProperty(b, \"LogCache\", { get: function() {\n            return C.a.LogCache;\n          }, enumerable: !1, configurable: !0 }), b.ClearLogCache = function() {\n            C.a.ClearLogCache();\n          }, Object.defineProperty(b, \"LogLevels\", { set: function(D) {\n            C.a.LogLevels = D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(b, \"PerformanceLogLevel\", { set: function(D) {\n            return (D & b.PerformanceUserMarkLogLevel) === b.PerformanceUserMarkLogLevel ? (b.StartPerformanceCounter = b._StartUserMark, void (b.EndPerformanceCounter = b._EndUserMark)) : (D & b.PerformanceConsoleLogLevel) === b.PerformanceConsoleLogLevel ? (b.StartPerformanceCounter = b._StartPerformanceConsole, void (b.EndPerformanceCounter = b._EndPerformanceConsole)) : (b.StartPerformanceCounter = b._StartPerformanceCounterDisabled, void (b.EndPerformanceCounter = b._EndPerformanceCounterDisabled));\n          }, enumerable: !1, configurable: !0 }), b._StartPerformanceCounterDisabled = function(D, w) {\n          }, b._EndPerformanceCounterDisabled = function(D, w) {\n          }, b._StartUserMark = function(D, w) {\n            if (w === void 0 && (w = !0), !b._performance) {\n              if (!_.a.IsWindowObjectExist())\n                return;\n              b._performance = window.performance;\n            }\n            w && b._performance.mark && b._performance.mark(D + \"-Begin\");\n          }, b._EndUserMark = function(D, w) {\n            w === void 0 && (w = !0), w && b._performance.mark && (b._performance.mark(D + \"-End\"), b._performance.measure(D, D + \"-Begin\", D + \"-End\"));\n          }, b._StartPerformanceConsole = function(D, w) {\n            w === void 0 && (w = !0), w && (b._StartUserMark(D, w), console.time && console.time(D));\n          }, b._EndPerformanceConsole = function(D, w) {\n            w === void 0 && (w = !0), w && (b._EndUserMark(D, w), console.timeEnd(D));\n          }, Object.defineProperty(b, \"Now\", { get: function() {\n            return I.a.Now;\n          }, enumerable: !1, configurable: !0 }), b.GetClassName = function(D, w) {\n            w === void 0 && (w = !1);\n            var N = null;\n            return !w && D.getClassName ? N = D.getClassName() : (D instanceof Object && (N = (w ? D : Object.getPrototypeOf(D)).constructor.__bjsclassName__), N || (N = typeof D)), N;\n          }, b.First = function(D, w) {\n            for (var N = 0, M = D; N < M.length; N++) {\n              var U = M[N];\n              if (w(U))\n                return U;\n            }\n            return null;\n          }, b.getFullClassName = function(D, w) {\n            w === void 0 && (w = !1);\n            var N = null, M = null;\n            if (!w && D.getClassName)\n              N = D.getClassName();\n            else {\n              if (D instanceof Object) {\n                var U = w ? D : Object.getPrototypeOf(D);\n                N = U.constructor.__bjsclassName__, M = U.constructor.__bjsmoduleName__;\n              }\n              N || (N = typeof D);\n            }\n            return N ? (M != null ? M + \".\" : \"\") + N : null;\n          }, b.DelayAsync = function(D) {\n            return new Promise(function(w) {\n              setTimeout(function() {\n                w();\n              }, D);\n            });\n          }, b.IsSafari = function() {\n            return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n          }, b.UseCustomRequestHeaders = !1, b.CustomRequestHeaders = x.a.CustomRequestHeaders, b._tmpFloatArray = new Float32Array(1), b.GetDOMTextContent = _.a.GetDOMTextContent, b.NoneLogLevel = C.a.NoneLogLevel, b.MessageLogLevel = C.a.MessageLogLevel, b.WarningLogLevel = C.a.WarningLogLevel, b.ErrorLogLevel = C.a.ErrorLogLevel, b.AllLogLevel = C.a.AllLogLevel, b.IsWindowObjectExist = _.a.IsWindowObjectExist, b.PerformanceNoneLogLevel = 0, b.PerformanceUserMarkLogLevel = 1, b.PerformanceConsoleLogLevel = 2, b.StartPerformanceCounter = b._StartPerformanceCounterDisabled, b.EndPerformanceCounter = b._EndPerformanceCounterDisabled, b;\n        }();\n        function h(b, D) {\n          return function(w) {\n            w.__bjsclassName__ = b, w.__bjsmoduleName__ = D ?? null;\n          };\n        }\n        var v = function() {\n          function b(D, w, N, M) {\n            M === void 0 && (M = 0), this.iterations = D, this.index = M - 1, this._done = !1, this._fn = w, this._successCallback = N;\n          }\n          return b.prototype.executeNext = function() {\n            this._done || (this.index + 1 < this.iterations ? (++this.index, this._fn(this)) : this.breakLoop());\n          }, b.prototype.breakLoop = function() {\n            this._done = !0, this._successCallback();\n          }, b.Run = function(D, w, N, M) {\n            M === void 0 && (M = 0);\n            var U = new b(D, w, N, M);\n            return U.executeNext(), U;\n          }, b.SyncAsyncForLoop = function(D, w, N, M, U, X) {\n            return X === void 0 && (X = 0), b.Run(Math.ceil(D / w), function(j) {\n              U && U() ? j.breakLoop() : setTimeout(function() {\n                for (var ne = 0; ne < w; ++ne) {\n                  var te = j.index * w + ne;\n                  if (te >= D)\n                    break;\n                  if (N(te), U && U()) {\n                    j.breakLoop();\n                    break;\n                  }\n                }\n                j.executeNext();\n              }, X);\n            }, M);\n          }, b;\n        }();\n        m.a.FallbackTexture = \"data:image/jpg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBmRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAAQAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQubmV0IDQuMC41AP/bAEMABAIDAwMCBAMDAwQEBAQFCQYFBQUFCwgIBgkNCw0NDQsMDA4QFBEODxMPDAwSGBITFRYXFxcOERkbGRYaFBYXFv/bAEMBBAQEBQUFCgYGChYPDA8WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFv/AABEIAQABAAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APH6KKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76CiiigD5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BQooooA+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/voKKKKAPl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FCiiigD6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++gooooA+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gUKKKKAPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76Pl+iiivuj+BT6gooor4U/vo+X6KKK+6P4FPqCiiivhT++j5fooor7o/gU+oKKKK+FP76P//Z\", T.a.Apply();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return E;\n        });\n        var V = f(1), _ = f(6), C = f(38), u = f(22), I = f(21), O = f(26), x = f(2), m = f(146), c = f(55), T = f(88), S = f(8), E = (f(123), f(129), f(124), function(g) {\n          function l(h, v, b, D) {\n            D === void 0 && (D = !1);\n            var w = g.call(this, h, v, b, D) || this;\n            if (w.enableOfflineSupport = !1, w.disableManifestCheck = !1, w.scenes = new Array(), w.onNewSceneAddedObservable = new _.c(), w.postProcesses = new Array(), w.isPointerLock = !1, w.onResizeObservable = new _.c(), w.onCanvasBlurObservable = new _.c(), w.onCanvasFocusObservable = new _.c(), w.onCanvasPointerOutObservable = new _.c(), w.onBeginFrameObservable = new _.c(), w.customAnimationFrameRequester = null, w.onEndFrameObservable = new _.c(), w.onBeforeShaderCompilationObservable = new _.c(), w.onAfterShaderCompilationObservable = new _.c(), w._deterministicLockstep = !1, w._lockstepMaxSteps = 4, w._timeStep = 1 / 60, w._fps = 60, w._deltaTime = 0, w._drawCalls = new c.a(), w.canvasTabIndex = 1, w.disablePerformanceMonitorInBackground = !1, w._performanceMonitor = new m.a(), l.Instances.push(w), !h)\n              return w;\n            if (b = w._creationOptions, h.getContext) {\n              var N = h;\n              if (w._onCanvasFocus = function() {\n                w.onCanvasFocusObservable.notifyObservers(w);\n              }, w._onCanvasBlur = function() {\n                w.onCanvasBlurObservable.notifyObservers(w);\n              }, N.addEventListener(\"focus\", w._onCanvasFocus), N.addEventListener(\"blur\", w._onCanvasBlur), w._onBlur = function() {\n                w.disablePerformanceMonitorInBackground && w._performanceMonitor.disable(), w._windowIsBackground = !0;\n              }, w._onFocus = function() {\n                w.disablePerformanceMonitorInBackground && w._performanceMonitor.enable(), w._windowIsBackground = !1;\n              }, w._onCanvasPointerOut = function(X) {\n                w.onCanvasPointerOutObservable.notifyObservers(X);\n              }, N.addEventListener(\"pointerout\", w._onCanvasPointerOut), C.a.IsWindowObjectExist()) {\n                var M = w.getHostWindow();\n                M.addEventListener(\"blur\", w._onBlur), M.addEventListener(\"focus\", w._onFocus);\n                var U = document;\n                w._onFullscreenChange = function() {\n                  U.fullscreen !== void 0 ? w.isFullscreen = U.fullscreen : U.mozFullScreen !== void 0 ? w.isFullscreen = U.mozFullScreen : U.webkitIsFullScreen !== void 0 ? w.isFullscreen = U.webkitIsFullScreen : U.msIsFullScreen !== void 0 && (w.isFullscreen = U.msIsFullScreen), w.isFullscreen && w._pointerLockRequested && N && l._RequestPointerlock(N);\n                }, document.addEventListener(\"fullscreenchange\", w._onFullscreenChange, !1), document.addEventListener(\"mozfullscreenchange\", w._onFullscreenChange, !1), document.addEventListener(\"webkitfullscreenchange\", w._onFullscreenChange, !1), document.addEventListener(\"msfullscreenchange\", w._onFullscreenChange, !1), w._onPointerLockChange = function() {\n                  w.isPointerLock = U.mozPointerLockElement === N || U.webkitPointerLockElement === N || U.msPointerLockElement === N || U.pointerLockElement === N;\n                }, document.addEventListener(\"pointerlockchange\", w._onPointerLockChange, !1), document.addEventListener(\"mspointerlockchange\", w._onPointerLockChange, !1), document.addEventListener(\"mozpointerlockchange\", w._onPointerLockChange, !1), document.addEventListener(\"webkitpointerlockchange\", w._onPointerLockChange, !1), !l.audioEngine && b.audioEngine && l.AudioEngineFactory && (l.audioEngine = l.AudioEngineFactory(w.getRenderingCanvas()));\n              }\n              w._connectVREvents(), w.enableOfflineSupport = l.OfflineProviderFactory !== void 0, b.doNotHandleTouchAction || w._disableTouchAction(), w._deterministicLockstep = !!b.deterministicLockstep, w._lockstepMaxSteps = b.lockstepMaxSteps || 0, w._timeStep = b.timeStep || 1 / 60;\n            }\n            return w._prepareVRComponent(), b.autoEnableWebVR && w.initWebVR(), w;\n          }\n          return Object(V.d)(l, g), Object.defineProperty(l, \"NpmPackage\", { get: function() {\n            return O.a.NpmPackage;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"Version\", { get: function() {\n            return O.a.Version;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"Instances\", { get: function() {\n            return u.a.Instances;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"LastCreatedEngine\", { get: function() {\n            return u.a.LastCreatedEngine;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l, \"LastCreatedScene\", { get: function() {\n            return u.a.LastCreatedScene;\n          }, enumerable: !1, configurable: !0 }), l.MarkAllMaterialsAsDirty = function(h, v) {\n            for (var b = 0; b < l.Instances.length; b++)\n              for (var D = l.Instances[b], w = 0; w < D.scenes.length; w++)\n                D.scenes[w].markAllMaterialsAsDirty(h, v);\n          }, l.DefaultLoadingScreenFactory = function(h) {\n            throw I.a.WarnImport(\"LoadingScreen\");\n          }, Object.defineProperty(l.prototype, \"_supportsHardwareTextureRescaling\", { get: function() {\n            return !!l._RescalePostProcessFactory;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l.prototype, \"performanceMonitor\", { get: function() {\n            return this._performanceMonitor;\n          }, enumerable: !1, configurable: !0 }), l.prototype.getInputElement = function() {\n            return this._renderingCanvas;\n          }, l.prototype.getAspectRatio = function(h, v) {\n            v === void 0 && (v = !1);\n            var b = h.viewport;\n            return this.getRenderWidth(v) * b.width / (this.getRenderHeight(v) * b.height);\n          }, l.prototype.getScreenAspectRatio = function() {\n            return this.getRenderWidth(!0) / this.getRenderHeight(!0);\n          }, l.prototype.getRenderingCanvasClientRect = function() {\n            return this._renderingCanvas ? this._renderingCanvas.getBoundingClientRect() : null;\n          }, l.prototype.getInputElementClientRect = function() {\n            return this._renderingCanvas ? this.getInputElement().getBoundingClientRect() : null;\n          }, l.prototype.isDeterministicLockStep = function() {\n            return this._deterministicLockstep;\n          }, l.prototype.getLockstepMaxSteps = function() {\n            return this._lockstepMaxSteps;\n          }, l.prototype.getTimeStep = function() {\n            return 1e3 * this._timeStep;\n          }, l.prototype.generateMipMapsForCubemap = function(h, v) {\n            if (v === void 0 && (v = !0), h.generateMipMaps) {\n              var b = this._gl;\n              this._bindTextureDirectly(b.TEXTURE_CUBE_MAP, h, !0), b.generateMipmap(b.TEXTURE_CUBE_MAP), v && this._bindTextureDirectly(b.TEXTURE_CUBE_MAP, null);\n            }\n          }, l.prototype.setState = function(h, v, b, D) {\n            v === void 0 && (v = 0), D === void 0 && (D = !1), (this._depthCullingState.cull !== h || b) && (this._depthCullingState.cull = h);\n            var w = this.cullBackFaces ? this._gl.BACK : this._gl.FRONT;\n            (this._depthCullingState.cullFace !== w || b) && (this._depthCullingState.cullFace = w), this.setZOffset(v);\n            var N = D ? this._gl.CW : this._gl.CCW;\n            (this._depthCullingState.frontFace !== N || b) && (this._depthCullingState.frontFace = N);\n          }, l.prototype.setZOffset = function(h) {\n            this._depthCullingState.zOffset = h;\n          }, l.prototype.getZOffset = function() {\n            return this._depthCullingState.zOffset;\n          }, l.prototype.setDepthBuffer = function(h) {\n            this._depthCullingState.depthTest = h;\n          }, l.prototype.getDepthWrite = function() {\n            return this._depthCullingState.depthMask;\n          }, l.prototype.setDepthWrite = function(h) {\n            this._depthCullingState.depthMask = h;\n          }, l.prototype.getStencilBuffer = function() {\n            return this._stencilState.stencilTest;\n          }, l.prototype.setStencilBuffer = function(h) {\n            this._stencilState.stencilTest = h;\n          }, l.prototype.getStencilMask = function() {\n            return this._stencilState.stencilMask;\n          }, l.prototype.setStencilMask = function(h) {\n            this._stencilState.stencilMask = h;\n          }, l.prototype.getStencilFunction = function() {\n            return this._stencilState.stencilFunc;\n          }, l.prototype.getStencilFunctionReference = function() {\n            return this._stencilState.stencilFuncRef;\n          }, l.prototype.getStencilFunctionMask = function() {\n            return this._stencilState.stencilFuncMask;\n          }, l.prototype.setStencilFunction = function(h) {\n            this._stencilState.stencilFunc = h;\n          }, l.prototype.setStencilFunctionReference = function(h) {\n            this._stencilState.stencilFuncRef = h;\n          }, l.prototype.setStencilFunctionMask = function(h) {\n            this._stencilState.stencilFuncMask = h;\n          }, l.prototype.getStencilOperationFail = function() {\n            return this._stencilState.stencilOpStencilFail;\n          }, l.prototype.getStencilOperationDepthFail = function() {\n            return this._stencilState.stencilOpDepthFail;\n          }, l.prototype.getStencilOperationPass = function() {\n            return this._stencilState.stencilOpStencilDepthPass;\n          }, l.prototype.setStencilOperationFail = function(h) {\n            this._stencilState.stencilOpStencilFail = h;\n          }, l.prototype.setStencilOperationDepthFail = function(h) {\n            this._stencilState.stencilOpDepthFail = h;\n          }, l.prototype.setStencilOperationPass = function(h) {\n            this._stencilState.stencilOpStencilDepthPass = h;\n          }, l.prototype.setDitheringState = function(h) {\n            h ? this._gl.enable(this._gl.DITHER) : this._gl.disable(this._gl.DITHER);\n          }, l.prototype.setRasterizerState = function(h) {\n            h ? this._gl.disable(this._gl.RASTERIZER_DISCARD) : this._gl.enable(this._gl.RASTERIZER_DISCARD);\n          }, l.prototype.getDepthFunction = function() {\n            return this._depthCullingState.depthFunc;\n          }, l.prototype.setDepthFunction = function(h) {\n            this._depthCullingState.depthFunc = h;\n          }, l.prototype.setDepthFunctionToGreater = function() {\n            this._depthCullingState.depthFunc = this._gl.GREATER;\n          }, l.prototype.setDepthFunctionToGreaterOrEqual = function() {\n            this._depthCullingState.depthFunc = this._gl.GEQUAL;\n          }, l.prototype.setDepthFunctionToLess = function() {\n            this._depthCullingState.depthFunc = this._gl.LESS;\n          }, l.prototype.setDepthFunctionToLessOrEqual = function() {\n            this._depthCullingState.depthFunc = this._gl.LEQUAL;\n          }, l.prototype.cacheStencilState = function() {\n            this._cachedStencilBuffer = this.getStencilBuffer(), this._cachedStencilFunction = this.getStencilFunction(), this._cachedStencilMask = this.getStencilMask(), this._cachedStencilOperationPass = this.getStencilOperationPass(), this._cachedStencilOperationFail = this.getStencilOperationFail(), this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail(), this._cachedStencilReference = this.getStencilFunctionReference();\n          }, l.prototype.restoreStencilState = function() {\n            this.setStencilFunction(this._cachedStencilFunction), this.setStencilMask(this._cachedStencilMask), this.setStencilBuffer(this._cachedStencilBuffer), this.setStencilOperationPass(this._cachedStencilOperationPass), this.setStencilOperationFail(this._cachedStencilOperationFail), this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail), this.setStencilFunctionReference(this._cachedStencilReference);\n          }, l.prototype.setDirectViewport = function(h, v, b, D) {\n            var w = this._cachedViewport;\n            return this._cachedViewport = null, this._viewport(h, v, b, D), w;\n          }, l.prototype.scissorClear = function(h, v, b, D, w) {\n            this.enableScissor(h, v, b, D), this.clear(w, !0, !0, !0), this.disableScissor();\n          }, l.prototype.enableScissor = function(h, v, b, D) {\n            var w = this._gl;\n            w.enable(w.SCISSOR_TEST), w.scissor(h, v, b, D);\n          }, l.prototype.disableScissor = function() {\n            var h = this._gl;\n            h.disable(h.SCISSOR_TEST);\n          }, l.prototype._reportDrawCall = function() {\n            this._drawCalls.addCount(1, !1);\n          }, l.prototype.initWebVR = function() {\n            throw I.a.WarnImport(\"WebVRCamera\");\n          }, l.prototype._prepareVRComponent = function() {\n          }, l.prototype._connectVREvents = function(h, v) {\n          }, l.prototype._submitVRFrame = function() {\n          }, l.prototype.disableVR = function() {\n          }, l.prototype.isVRPresenting = function() {\n            return !1;\n          }, l.prototype._requestVRFrame = function() {\n          }, l.prototype._loadFileAsync = function(h, v, b) {\n            var D = this;\n            return new Promise(function(w, N) {\n              D._loadFile(h, function(M) {\n                w(M);\n              }, void 0, v, b, function(M, U) {\n                N(U);\n              });\n            });\n          }, l.prototype.getVertexShaderSource = function(h) {\n            var v = this._gl.getAttachedShaders(h);\n            return v ? this._gl.getShaderSource(v[0]) : null;\n          }, l.prototype.getFragmentShaderSource = function(h) {\n            var v = this._gl.getAttachedShaders(h);\n            return v ? this._gl.getShaderSource(v[1]) : null;\n          }, l.prototype.setDepthStencilTexture = function(h, v, b) {\n            h !== void 0 && (v && (this._boundUniforms[h] = v), b && b.depthStencilTexture ? this._setTexture(h, b, !1, !0) : this._setTexture(h, null));\n          }, l.prototype.setTextureFromPostProcess = function(h, v) {\n            this._bindTexture(h, v ? v._textures.data[v._currentRenderTextureInd] : null);\n          }, l.prototype.setTextureFromPostProcessOutput = function(h, v) {\n            this._bindTexture(h, v ? v._outputTexture : null);\n          }, l.prototype._rebuildBuffers = function() {\n            for (var h = 0, v = this.scenes; h < v.length; h++) {\n              var b = v[h];\n              b.resetCachedMaterial(), b._rebuildGeometries(), b._rebuildTextures();\n            }\n            g.prototype._rebuildBuffers.call(this);\n          }, l.prototype._renderFrame = function() {\n            for (var h = 0; h < this._activeRenderLoops.length; h++)\n              (0, this._activeRenderLoops[h])();\n          }, l.prototype._renderLoop = function() {\n            if (!this._contextWasLost) {\n              var h = !0;\n              !this.renderEvenInBackground && this._windowIsBackground && (h = !1), h && (this.beginFrame(), this._renderViews() || this._renderFrame(), this.endFrame());\n            }\n            this._activeRenderLoops.length > 0 ? this.customAnimationFrameRequester ? (this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester), this._frameHandler = this.customAnimationFrameRequester.requestID) : this.isVRPresenting() ? this._requestVRFrame() : this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;\n          }, l.prototype._renderViews = function() {\n            return !1;\n          }, l.prototype.switchFullscreen = function(h) {\n            this.isFullscreen ? this.exitFullscreen() : this.enterFullscreen(h);\n          }, l.prototype.enterFullscreen = function(h) {\n            this.isFullscreen || (this._pointerLockRequested = h, this._renderingCanvas && l._RequestFullscreen(this._renderingCanvas));\n          }, l.prototype.exitFullscreen = function() {\n            this.isFullscreen && l._ExitFullscreen();\n          }, l.prototype.enterPointerlock = function() {\n            this._renderingCanvas && l._RequestPointerlock(this._renderingCanvas);\n          }, l.prototype.exitPointerlock = function() {\n            l._ExitPointerlock();\n          }, l.prototype.beginFrame = function() {\n            this._measureFps(), this.onBeginFrameObservable.notifyObservers(this), g.prototype.beginFrame.call(this);\n          }, l.prototype.endFrame = function() {\n            g.prototype.endFrame.call(this), this._submitVRFrame(), this.onEndFrameObservable.notifyObservers(this);\n          }, l.prototype.resize = function() {\n            this.isVRPresenting() || g.prototype.resize.call(this);\n          }, l.prototype.setSize = function(h, v) {\n            if (!this._renderingCanvas || !g.prototype.setSize.call(this, h, v))\n              return !1;\n            if (this.scenes) {\n              for (var b = 0; b < this.scenes.length; b++)\n                for (var D = this.scenes[b], w = 0; w < D.cameras.length; w++)\n                  D.cameras[w]._currentRenderId = 0;\n              this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this);\n            }\n            return !0;\n          }, l.prototype._deletePipelineContext = function(h) {\n            var v = h;\n            v && v.program && v.transformFeedback && (this.deleteTransformFeedback(v.transformFeedback), v.transformFeedback = null), g.prototype._deletePipelineContext.call(this, h);\n          }, l.prototype.createShaderProgram = function(h, v, b, D, w, N) {\n            N === void 0 && (N = null), w = w || this._gl, this.onBeforeShaderCompilationObservable.notifyObservers(this);\n            var M = g.prototype.createShaderProgram.call(this, h, v, b, D, w, N);\n            return this.onAfterShaderCompilationObservable.notifyObservers(this), M;\n          }, l.prototype._createShaderProgram = function(h, v, b, D, w) {\n            w === void 0 && (w = null);\n            var N = D.createProgram();\n            if (h.program = N, !N)\n              throw new Error(\"Unable to create program\");\n            if (D.attachShader(N, v), D.attachShader(N, b), this.webGLVersion > 1 && w) {\n              var M = this.createTransformFeedback();\n              this.bindTransformFeedback(M), this.setTranformFeedbackVaryings(N, w), h.transformFeedback = M;\n            }\n            return D.linkProgram(N), this.webGLVersion > 1 && w && this.bindTransformFeedback(null), h.context = D, h.vertexShader = v, h.fragmentShader = b, h.isParallelCompiled || this._finalizePipelineContext(h), N;\n          }, l.prototype._releaseTexture = function(h) {\n            g.prototype._releaseTexture.call(this, h), this.scenes.forEach(function(v) {\n              v.postProcesses.forEach(function(b) {\n                b._outputTexture == h && (b._outputTexture = null);\n              }), v.cameras.forEach(function(b) {\n                b._postProcesses.forEach(function(D) {\n                  D && D._outputTexture == h && (D._outputTexture = null);\n                });\n              });\n            });\n          }, l.prototype._rescaleTexture = function(h, v, b, D, w) {\n            var N = this;\n            this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);\n            var M = this.createRenderTargetTexture({ width: v.width, height: v.height }, { generateMipMaps: !1, type: x.a.TEXTURETYPE_UNSIGNED_INT, samplingMode: x.a.TEXTURE_BILINEAR_SAMPLINGMODE, generateDepthBuffer: !1, generateStencilBuffer: !1 });\n            !this._rescalePostProcess && l._RescalePostProcessFactory && (this._rescalePostProcess = l._RescalePostProcessFactory(this)), this._rescalePostProcess.getEffect().executeWhenCompiled(function() {\n              N._rescalePostProcess.onApply = function(X) {\n                X._bindTexture(\"textureSampler\", h);\n              };\n              var U = b;\n              U || (U = N.scenes[N.scenes.length - 1]), U.postProcessManager.directRender([N._rescalePostProcess], M, !0), N._bindTextureDirectly(N._gl.TEXTURE_2D, v, !0), N._gl.copyTexImage2D(N._gl.TEXTURE_2D, 0, D, 0, 0, v.width, v.height, 0), N.unBindFramebuffer(M), N._releaseTexture(M), w && w();\n            });\n          }, l.prototype.getFps = function() {\n            return this._fps;\n          }, l.prototype.getDeltaTime = function() {\n            return this._deltaTime;\n          }, l.prototype._measureFps = function() {\n            this._performanceMonitor.sampleFrame(), this._fps = this._performanceMonitor.averageFPS, this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\n          }, l.prototype._uploadImageToTexture = function(h, v, b, D) {\n            b === void 0 && (b = 0), D === void 0 && (D = 0);\n            var w = this._gl, N = this._getWebGLTextureType(h.type), M = this._getInternalFormat(h.format), U = this._getRGBABufferInternalSizedFormat(h.type, M), X = h.isCube ? w.TEXTURE_CUBE_MAP : w.TEXTURE_2D;\n            this._bindTextureDirectly(X, h, !0), this._unpackFlipY(h.invertY);\n            var j = w.TEXTURE_2D;\n            h.isCube && (j = w.TEXTURE_CUBE_MAP_POSITIVE_X + b), w.texImage2D(j, D, U, M, N, v), this._bindTextureDirectly(X, null, !0);\n          }, l.prototype.updateRenderTargetTextureSampleCount = function(h, v) {\n            if (this.webGLVersion < 2 || !h)\n              return 1;\n            if (h.samples === v)\n              return v;\n            var b = this._gl;\n            if (v = Math.min(v, this.getCaps().maxMSAASamples), h._depthStencilBuffer && (b.deleteRenderbuffer(h._depthStencilBuffer), h._depthStencilBuffer = null), h._MSAAFramebuffer && (b.deleteFramebuffer(h._MSAAFramebuffer), h._MSAAFramebuffer = null), h._MSAARenderBuffer && (b.deleteRenderbuffer(h._MSAARenderBuffer), h._MSAARenderBuffer = null), v > 1 && b.renderbufferStorageMultisample) {\n              var D = b.createFramebuffer();\n              if (!D)\n                throw new Error(\"Unable to create multi sampled framebuffer\");\n              h._MSAAFramebuffer = D, this._bindUnboundFramebuffer(h._MSAAFramebuffer);\n              var w = b.createRenderbuffer();\n              if (!w)\n                throw new Error(\"Unable to create multi sampled framebuffer\");\n              b.bindRenderbuffer(b.RENDERBUFFER, w), b.renderbufferStorageMultisample(b.RENDERBUFFER, v, this._getRGBAMultiSampleBufferFormat(h.type), h.width, h.height), b.framebufferRenderbuffer(b.FRAMEBUFFER, b.COLOR_ATTACHMENT0, b.RENDERBUFFER, w), h._MSAARenderBuffer = w;\n            } else\n              this._bindUnboundFramebuffer(h._framebuffer);\n            return h.samples = v, h._depthStencilBuffer = this._setupFramebufferDepthAttachments(h._generateStencilBuffer, h._generateDepthBuffer, h.width, h.height, v), this._bindUnboundFramebuffer(null), v;\n          }, l.prototype.updateTextureComparisonFunction = function(h, v) {\n            if (this.webGLVersion !== 1) {\n              var b = this._gl;\n              h.isCube ? (this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, h, !0), v === 0 ? (b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_FUNC, x.a.LEQUAL), b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_MODE, b.NONE)) : (b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_FUNC, v), b.texParameteri(b.TEXTURE_CUBE_MAP, b.TEXTURE_COMPARE_MODE, b.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null)) : (this._bindTextureDirectly(this._gl.TEXTURE_2D, h, !0), v === 0 ? (b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_FUNC, x.a.LEQUAL), b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_MODE, b.NONE)) : (b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_FUNC, v), b.texParameteri(b.TEXTURE_2D, b.TEXTURE_COMPARE_MODE, b.COMPARE_REF_TO_TEXTURE)), this._bindTextureDirectly(this._gl.TEXTURE_2D, null)), h._comparisonFunction = v;\n            } else\n              S.a.Error(\"WebGL 1 does not support texture comparison.\");\n          }, l.prototype.createInstancesBuffer = function(h) {\n            var v = this._gl.createBuffer();\n            if (!v)\n              throw new Error(\"Unable to create instance buffer\");\n            var b = new T.a(v);\n            return b.capacity = h, this.bindArrayBuffer(b), this._gl.bufferData(this._gl.ARRAY_BUFFER, h, this._gl.DYNAMIC_DRAW), b;\n          }, l.prototype.deleteInstancesBuffer = function(h) {\n            this._gl.deleteBuffer(h);\n          }, l.prototype._clientWaitAsync = function(h, v, b) {\n            v === void 0 && (v = 0), b === void 0 && (b = 10);\n            var D = this._gl;\n            return new Promise(function(w, N) {\n              var M = function() {\n                var U = D.clientWaitSync(h, v, 0);\n                U != D.WAIT_FAILED ? U != D.TIMEOUT_EXPIRED ? w() : setTimeout(M, b) : N();\n              };\n              M();\n            });\n          }, l.prototype._readPixelsAsync = function(h, v, b, D, w, N, M) {\n            if (this._webGLVersion < 2)\n              throw new Error(\"_readPixelsAsync only work on WebGL2+\");\n            var U = this._gl, X = U.createBuffer();\n            U.bindBuffer(U.PIXEL_PACK_BUFFER, X), U.bufferData(U.PIXEL_PACK_BUFFER, M.byteLength, U.STREAM_READ), U.readPixels(h, v, b, D, w, N, 0), U.bindBuffer(U.PIXEL_PACK_BUFFER, null);\n            var j = U.fenceSync(U.SYNC_GPU_COMMANDS_COMPLETE, 0);\n            return j ? (U.flush(), this._clientWaitAsync(j, 0, 10).then(function() {\n              return U.deleteSync(j), U.bindBuffer(U.PIXEL_PACK_BUFFER, X), U.getBufferSubData(U.PIXEL_PACK_BUFFER, 0, M), U.bindBuffer(U.PIXEL_PACK_BUFFER, null), U.deleteBuffer(X), M;\n            })) : null;\n          }, l.prototype.dispose = function() {\n            for (this.hideLoadingUI(), this.onNewSceneAddedObservable.clear(); this.postProcesses.length; )\n              this.postProcesses[0].dispose();\n            for (this._rescalePostProcess && this._rescalePostProcess.dispose(); this.scenes.length; )\n              this.scenes[0].dispose();\n            l.Instances.length === 1 && l.audioEngine && l.audioEngine.dispose(), this.disableVR(), C.a.IsWindowObjectExist() && (window.removeEventListener(\"blur\", this._onBlur), window.removeEventListener(\"focus\", this._onFocus), this._renderingCanvas && (this._renderingCanvas.removeEventListener(\"focus\", this._onCanvasFocus), this._renderingCanvas.removeEventListener(\"blur\", this._onCanvasBlur), this._renderingCanvas.removeEventListener(\"pointerout\", this._onCanvasPointerOut)), C.a.IsDocumentAvailable() && (document.removeEventListener(\"fullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"mozfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"webkitfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"msfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"pointerlockchange\", this._onPointerLockChange), document.removeEventListener(\"mspointerlockchange\", this._onPointerLockChange), document.removeEventListener(\"mozpointerlockchange\", this._onPointerLockChange), document.removeEventListener(\"webkitpointerlockchange\", this._onPointerLockChange))), g.prototype.dispose.call(this);\n            var h = l.Instances.indexOf(this);\n            h >= 0 && l.Instances.splice(h, 1), this.onResizeObservable.clear(), this.onCanvasBlurObservable.clear(), this.onCanvasFocusObservable.clear(), this.onCanvasPointerOutObservable.clear(), this.onBeginFrameObservable.clear(), this.onEndFrameObservable.clear();\n          }, l.prototype._disableTouchAction = function() {\n            this._renderingCanvas && this._renderingCanvas.setAttribute && (this._renderingCanvas.setAttribute(\"touch-action\", \"none\"), this._renderingCanvas.style.touchAction = \"none\", this._renderingCanvas.style.msTouchAction = \"none\");\n          }, l.prototype.displayLoadingUI = function() {\n            if (C.a.IsWindowObjectExist()) {\n              var h = this.loadingScreen;\n              h && h.displayLoadingUI();\n            }\n          }, l.prototype.hideLoadingUI = function() {\n            if (C.a.IsWindowObjectExist()) {\n              var h = this._loadingScreen;\n              h && h.hideLoadingUI();\n            }\n          }, Object.defineProperty(l.prototype, \"loadingScreen\", { get: function() {\n            return !this._loadingScreen && this._renderingCanvas && (this._loadingScreen = l.DefaultLoadingScreenFactory(this._renderingCanvas)), this._loadingScreen;\n          }, set: function(h) {\n            this._loadingScreen = h;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l.prototype, \"loadingUIText\", { set: function(h) {\n            this.loadingScreen.loadingUIText = h;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(l.prototype, \"loadingUIBackgroundColor\", { set: function(h) {\n            this.loadingScreen.loadingUIBackgroundColor = h;\n          }, enumerable: !1, configurable: !0 }), l._RequestPointerlock = function(h) {\n            h.requestPointerLock = h.requestPointerLock || h.msRequestPointerLock || h.mozRequestPointerLock || h.webkitRequestPointerLock, h.requestPointerLock && h.requestPointerLock();\n          }, l._ExitPointerlock = function() {\n            var h = document;\n            document.exitPointerLock = document.exitPointerLock || h.msExitPointerLock || h.mozExitPointerLock || h.webkitExitPointerLock, document.exitPointerLock && document.exitPointerLock();\n          }, l._RequestFullscreen = function(h) {\n            var v = h.requestFullscreen || h.msRequestFullscreen || h.webkitRequestFullscreen || h.mozRequestFullScreen;\n            v && v.call(h);\n          }, l._ExitFullscreen = function() {\n            var h = document;\n            document.exitFullscreen ? document.exitFullscreen() : h.mozCancelFullScreen ? h.mozCancelFullScreen() : h.webkitCancelFullScreen ? h.webkitCancelFullScreen() : h.msCancelFullScreen && h.msCancelFullScreen();\n          }, l.ALPHA_DISABLE = x.a.ALPHA_DISABLE, l.ALPHA_ADD = x.a.ALPHA_ADD, l.ALPHA_COMBINE = x.a.ALPHA_COMBINE, l.ALPHA_SUBTRACT = x.a.ALPHA_SUBTRACT, l.ALPHA_MULTIPLY = x.a.ALPHA_MULTIPLY, l.ALPHA_MAXIMIZED = x.a.ALPHA_MAXIMIZED, l.ALPHA_ONEONE = x.a.ALPHA_ONEONE, l.ALPHA_PREMULTIPLIED = x.a.ALPHA_PREMULTIPLIED, l.ALPHA_PREMULTIPLIED_PORTERDUFF = x.a.ALPHA_PREMULTIPLIED_PORTERDUFF, l.ALPHA_INTERPOLATE = x.a.ALPHA_INTERPOLATE, l.ALPHA_SCREENMODE = x.a.ALPHA_SCREENMODE, l.DELAYLOADSTATE_NONE = x.a.DELAYLOADSTATE_NONE, l.DELAYLOADSTATE_LOADED = x.a.DELAYLOADSTATE_LOADED, l.DELAYLOADSTATE_LOADING = x.a.DELAYLOADSTATE_LOADING, l.DELAYLOADSTATE_NOTLOADED = x.a.DELAYLOADSTATE_NOTLOADED, l.NEVER = x.a.NEVER, l.ALWAYS = x.a.ALWAYS, l.LESS = x.a.LESS, l.EQUAL = x.a.EQUAL, l.LEQUAL = x.a.LEQUAL, l.GREATER = x.a.GREATER, l.GEQUAL = x.a.GEQUAL, l.NOTEQUAL = x.a.NOTEQUAL, l.KEEP = x.a.KEEP, l.REPLACE = x.a.REPLACE, l.INCR = x.a.INCR, l.DECR = x.a.DECR, l.INVERT = x.a.INVERT, l.INCR_WRAP = x.a.INCR_WRAP, l.DECR_WRAP = x.a.DECR_WRAP, l.TEXTURE_CLAMP_ADDRESSMODE = x.a.TEXTURE_CLAMP_ADDRESSMODE, l.TEXTURE_WRAP_ADDRESSMODE = x.a.TEXTURE_WRAP_ADDRESSMODE, l.TEXTURE_MIRROR_ADDRESSMODE = x.a.TEXTURE_MIRROR_ADDRESSMODE, l.TEXTUREFORMAT_ALPHA = x.a.TEXTUREFORMAT_ALPHA, l.TEXTUREFORMAT_LUMINANCE = x.a.TEXTUREFORMAT_LUMINANCE, l.TEXTUREFORMAT_LUMINANCE_ALPHA = x.a.TEXTUREFORMAT_LUMINANCE_ALPHA, l.TEXTUREFORMAT_RGB = x.a.TEXTUREFORMAT_RGB, l.TEXTUREFORMAT_RGBA = x.a.TEXTUREFORMAT_RGBA, l.TEXTUREFORMAT_RED = x.a.TEXTUREFORMAT_RED, l.TEXTUREFORMAT_R = x.a.TEXTUREFORMAT_R, l.TEXTUREFORMAT_RG = x.a.TEXTUREFORMAT_RG, l.TEXTUREFORMAT_RED_INTEGER = x.a.TEXTUREFORMAT_RED_INTEGER, l.TEXTUREFORMAT_R_INTEGER = x.a.TEXTUREFORMAT_R_INTEGER, l.TEXTUREFORMAT_RG_INTEGER = x.a.TEXTUREFORMAT_RG_INTEGER, l.TEXTUREFORMAT_RGB_INTEGER = x.a.TEXTUREFORMAT_RGB_INTEGER, l.TEXTUREFORMAT_RGBA_INTEGER = x.a.TEXTUREFORMAT_RGBA_INTEGER, l.TEXTURETYPE_UNSIGNED_BYTE = x.a.TEXTURETYPE_UNSIGNED_BYTE, l.TEXTURETYPE_UNSIGNED_INT = x.a.TEXTURETYPE_UNSIGNED_INT, l.TEXTURETYPE_FLOAT = x.a.TEXTURETYPE_FLOAT, l.TEXTURETYPE_HALF_FLOAT = x.a.TEXTURETYPE_HALF_FLOAT, l.TEXTURETYPE_BYTE = x.a.TEXTURETYPE_BYTE, l.TEXTURETYPE_SHORT = x.a.TEXTURETYPE_SHORT, l.TEXTURETYPE_UNSIGNED_SHORT = x.a.TEXTURETYPE_UNSIGNED_SHORT, l.TEXTURETYPE_INT = x.a.TEXTURETYPE_INT, l.TEXTURETYPE_UNSIGNED_INTEGER = x.a.TEXTURETYPE_UNSIGNED_INTEGER, l.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = x.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4, l.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = x.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1, l.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = x.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5, l.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = x.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV, l.TEXTURETYPE_UNSIGNED_INT_24_8 = x.a.TEXTURETYPE_UNSIGNED_INT_24_8, l.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = x.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV, l.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = x.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV, l.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = x.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV, l.TEXTURE_NEAREST_SAMPLINGMODE = x.a.TEXTURE_NEAREST_SAMPLINGMODE, l.TEXTURE_BILINEAR_SAMPLINGMODE = x.a.TEXTURE_BILINEAR_SAMPLINGMODE, l.TEXTURE_TRILINEAR_SAMPLINGMODE = x.a.TEXTURE_TRILINEAR_SAMPLINGMODE, l.TEXTURE_NEAREST_NEAREST_MIPLINEAR = x.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR, l.TEXTURE_LINEAR_LINEAR_MIPNEAREST = x.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST, l.TEXTURE_LINEAR_LINEAR_MIPLINEAR = x.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR, l.TEXTURE_NEAREST_NEAREST_MIPNEAREST = x.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST, l.TEXTURE_NEAREST_LINEAR_MIPNEAREST = x.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST, l.TEXTURE_NEAREST_LINEAR_MIPLINEAR = x.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR, l.TEXTURE_NEAREST_LINEAR = x.a.TEXTURE_NEAREST_LINEAR, l.TEXTURE_NEAREST_NEAREST = x.a.TEXTURE_NEAREST_NEAREST, l.TEXTURE_LINEAR_NEAREST_MIPNEAREST = x.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST, l.TEXTURE_LINEAR_NEAREST_MIPLINEAR = x.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR, l.TEXTURE_LINEAR_LINEAR = x.a.TEXTURE_LINEAR_LINEAR, l.TEXTURE_LINEAR_NEAREST = x.a.TEXTURE_LINEAR_NEAREST, l.TEXTURE_EXPLICIT_MODE = x.a.TEXTURE_EXPLICIT_MODE, l.TEXTURE_SPHERICAL_MODE = x.a.TEXTURE_SPHERICAL_MODE, l.TEXTURE_PLANAR_MODE = x.a.TEXTURE_PLANAR_MODE, l.TEXTURE_CUBIC_MODE = x.a.TEXTURE_CUBIC_MODE, l.TEXTURE_PROJECTION_MODE = x.a.TEXTURE_PROJECTION_MODE, l.TEXTURE_SKYBOX_MODE = x.a.TEXTURE_SKYBOX_MODE, l.TEXTURE_INVCUBIC_MODE = x.a.TEXTURE_INVCUBIC_MODE, l.TEXTURE_EQUIRECTANGULAR_MODE = x.a.TEXTURE_EQUIRECTANGULAR_MODE, l.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = x.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, l.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = x.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, l.SCALEMODE_FLOOR = x.a.SCALEMODE_FLOOR, l.SCALEMODE_NEAREST = x.a.SCALEMODE_NEAREST, l.SCALEMODE_CEILING = x.a.SCALEMODE_CEILING, l._RescalePostProcessFactory = null, l;\n        }(O.a));\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.WithinEpsilon = function(C, u, I) {\n            I === void 0 && (I = 1401298e-51);\n            var O = C - u;\n            return -I <= O && O <= I;\n          }, _.ToHex = function(C) {\n            var u = C.toString(16);\n            return C <= 15 ? (\"0\" + u).toUpperCase() : u.toUpperCase();\n          }, _.Sign = function(C) {\n            return (C = +C) == 0 || isNaN(C) ? C : C > 0 ? 1 : -1;\n          }, _.Clamp = function(C, u, I) {\n            return u === void 0 && (u = 0), I === void 0 && (I = 1), Math.min(I, Math.max(u, C));\n          }, _.Log2 = function(C) {\n            return Math.log(C) * Math.LOG2E;\n          }, _.Repeat = function(C, u) {\n            return C - Math.floor(C / u) * u;\n          }, _.Normalize = function(C, u, I) {\n            return (C - u) / (I - u);\n          }, _.Denormalize = function(C, u, I) {\n            return C * (I - u) + u;\n          }, _.DeltaAngle = function(C, u) {\n            var I = _.Repeat(u - C, 360);\n            return I > 180 && (I -= 360), I;\n          }, _.PingPong = function(C, u) {\n            var I = _.Repeat(C, 2 * u);\n            return u - Math.abs(I - u);\n          }, _.SmoothStep = function(C, u, I) {\n            var O = _.Clamp(I);\n            return u * (O = -2 * O * O * O + 3 * O * O) + C * (1 - O);\n          }, _.MoveTowards = function(C, u, I) {\n            return Math.abs(u - C) <= I ? u : C + _.Sign(u - C) * I;\n          }, _.MoveTowardsAngle = function(C, u, I) {\n            var O = _.DeltaAngle(C, u), x = 0;\n            return -I < O && O < I ? x = u : (u = C + O, x = _.MoveTowards(C, u, I)), x;\n          }, _.Lerp = function(C, u, I) {\n            return C + (u - C) * I;\n          }, _.LerpAngle = function(C, u, I) {\n            var O = _.Repeat(u - C, 360);\n            return O > 180 && (O -= 360), C + O * _.Clamp(I);\n          }, _.InverseLerp = function(C, u, I) {\n            return C != u ? _.Clamp((I - C) / (u - C)) : 0;\n          }, _.Hermite = function(C, u, I, O, x) {\n            var m = x * x, c = x * m;\n            return C * (2 * c - 3 * m + 1) + I * (-2 * c + 3 * m) + u * (c - 2 * m + x) + O * (c - m);\n          }, _.RandomRange = function(C, u) {\n            return C === u ? C : Math.random() * (u - C) + C;\n          }, _.RangeToPercent = function(C, u, I) {\n            return (C - u) / (I - u);\n          }, _.PercentToRange = function(C, u, I) {\n            return (I - u) * C + u;\n          }, _.NormalizeRadians = function(C) {\n            return C -= _.TwoPi * Math.floor((C + Math.PI) / _.TwoPi);\n          }, _.TwoPi = 2 * Math.PI, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return c;\n        });\n        var V = f(8), _ = f(20), C = f(22), u = f(4), I = f(48), O = f(2), x = f(9), m = f(119), c = function() {\n          function T() {\n          }\n          return T.BindEyePosition = function(S, E, g) {\n            if (g === void 0 && (g = \"vEyePosition\"), E._forcedViewPosition)\n              S.setVector3(g, E._forcedViewPosition);\n            else {\n              var l = E.activeCamera.globalPosition;\n              l || (l = E.activeCamera.devicePosition), S.setVector3(g, E._mirroredCameraPosition ? E._mirroredCameraPosition : l);\n            }\n          }, T.PrepareDefinesForMergedUV = function(S, E, g) {\n            E._needUVs = !0, E[g] = !0, S.getTextureMatrix().isIdentityAs3x2() ? (E[g + \"DIRECTUV\"] = S.coordinatesIndex + 1, S.coordinatesIndex === 0 ? E.MAINUV1 = !0 : E.MAINUV2 = !0) : E[g + \"DIRECTUV\"] = 0;\n          }, T.BindTextureMatrix = function(S, E, g) {\n            var l = S.getTextureMatrix();\n            E.updateMatrix(g + \"Matrix\", l);\n          }, T.GetFogState = function(S, E) {\n            return E.fogEnabled && S.applyFog && E.fogMode !== _.a.FOGMODE_NONE;\n          }, T.PrepareDefinesForMisc = function(S, E, g, l, h, v, b) {\n            b._areMiscDirty && (b.LOGARITHMICDEPTH = g, b.POINTSIZE = l, b.FOG = h && this.GetFogState(S, E), b.NONUNIFORMSCALING = S.nonUniformScaling, b.ALPHATEST = v);\n          }, T.PrepareDefinesForFrameBoundValues = function(S, E, g, l, h, v) {\n            h === void 0 && (h = null), v === void 0 && (v = !1);\n            var b, D, w, N, M, U, X = !1;\n            b = h ?? (S.clipPlane !== void 0 && S.clipPlane !== null), D = h ?? (S.clipPlane2 !== void 0 && S.clipPlane2 !== null), w = h ?? (S.clipPlane3 !== void 0 && S.clipPlane3 !== null), N = h ?? (S.clipPlane4 !== void 0 && S.clipPlane4 !== null), M = h ?? (S.clipPlane5 !== void 0 && S.clipPlane5 !== null), U = h ?? (S.clipPlane6 !== void 0 && S.clipPlane6 !== null), g.CLIPPLANE !== b && (g.CLIPPLANE = b, X = !0), g.CLIPPLANE2 !== D && (g.CLIPPLANE2 = D, X = !0), g.CLIPPLANE3 !== w && (g.CLIPPLANE3 = w, X = !0), g.CLIPPLANE4 !== N && (g.CLIPPLANE4 = N, X = !0), g.CLIPPLANE5 !== M && (g.CLIPPLANE5 = M, X = !0), g.CLIPPLANE6 !== U && (g.CLIPPLANE6 = U, X = !0), g.DEPTHPREPASS !== !E.getColorWrite() && (g.DEPTHPREPASS = !g.DEPTHPREPASS, X = !0), g.INSTANCES !== l && (g.INSTANCES = l, X = !0), g.THIN_INSTANCES !== v && (g.THIN_INSTANCES = v, X = !0), X && g.markAsUnprocessed();\n          }, T.PrepareDefinesForBones = function(S, E) {\n            if (S.useBones && S.computeBonesUsingShaders && S.skeleton) {\n              E.NUM_BONE_INFLUENCERS = S.numBoneInfluencers;\n              var g = E.BONETEXTURE !== void 0;\n              if (S.skeleton.isUsingTextureForMatrices && g)\n                E.BONETEXTURE = !0;\n              else {\n                E.BonesPerMesh = S.skeleton.bones.length + 1, E.BONETEXTURE = !g && void 0;\n                var l = S.getScene().prePassRenderer;\n                if (l && l.enabled) {\n                  var h = l.excludedSkinnedMesh.indexOf(S) === -1;\n                  E.BONES_VELOCITY_ENABLED = h;\n                }\n              }\n            } else\n              E.NUM_BONE_INFLUENCERS = 0, E.BonesPerMesh = 0;\n          }, T.PrepareDefinesForMorphTargets = function(S, E) {\n            var g = S.morphTargetManager;\n            g ? (E.MORPHTARGETS_UV = g.supportsUVs && E.UV1, E.MORPHTARGETS_TANGENT = g.supportsTangents && E.TANGENT, E.MORPHTARGETS_NORMAL = g.supportsNormals && E.NORMAL, E.MORPHTARGETS = g.numInfluencers > 0, E.NUM_MORPH_INFLUENCERS = g.numInfluencers) : (E.MORPHTARGETS_UV = !1, E.MORPHTARGETS_TANGENT = !1, E.MORPHTARGETS_NORMAL = !1, E.MORPHTARGETS = !1, E.NUM_MORPH_INFLUENCERS = 0);\n          }, T.PrepareDefinesForAttributes = function(S, E, g, l, h, v) {\n            if (h === void 0 && (h = !1), v === void 0 && (v = !0), !E._areAttributesDirty && E._needNormals === E._normals && E._needUVs === E._uvs)\n              return !1;\n            if (E._normals = E._needNormals, E._uvs = E._needUVs, E.NORMAL = E._needNormals && S.isVerticesDataPresent(u.b.NormalKind), E._needNormals && S.isVerticesDataPresent(u.b.TangentKind) && (E.TANGENT = !0), E._needUVs ? (E.UV1 = S.isVerticesDataPresent(u.b.UVKind), E.UV2 = S.isVerticesDataPresent(u.b.UV2Kind)) : (E.UV1 = !1, E.UV2 = !1), g) {\n              var b = S.useVertexColors && S.isVerticesDataPresent(u.b.ColorKind);\n              E.VERTEXCOLOR = b, E.VERTEXALPHA = S.hasVertexAlpha && b && v;\n            }\n            return l && this.PrepareDefinesForBones(S, E), h && this.PrepareDefinesForMorphTargets(S, E), !0;\n          }, T.PrepareDefinesForMultiview = function(S, E) {\n            if (S.activeCamera) {\n              var g = E.MULTIVIEW;\n              E.MULTIVIEW = S.activeCamera.outputRenderTarget !== null && S.activeCamera.outputRenderTarget.getViewCount() > 1, E.MULTIVIEW != g && E.markAsUnprocessed();\n            }\n          }, T.PrepareDefinesForPrePass = function(S, E, g) {\n            var l = E.PREPASS;\n            if (E._arePrePassDirty) {\n              var h = [{ type: O.a.PREPASS_POSITION_TEXTURE_TYPE, define: \"PREPASS_POSITION\", index: \"PREPASS_POSITION_INDEX\" }, { type: O.a.PREPASS_VELOCITY_TEXTURE_TYPE, define: \"PREPASS_VELOCITY\", index: \"PREPASS_VELOCITY_INDEX\" }, { type: O.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, define: \"PREPASS_REFLECTIVITY\", index: \"PREPASS_REFLECTIVITY_INDEX\" }, { type: O.a.PREPASS_IRRADIANCE_TEXTURE_TYPE, define: \"PREPASS_IRRADIANCE\", index: \"PREPASS_IRRADIANCE_INDEX\" }, { type: O.a.PREPASS_ALBEDO_TEXTURE_TYPE, define: \"PREPASS_ALBEDO\", index: \"PREPASS_ALBEDO_INDEX\" }, { type: O.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, define: \"PREPASS_DEPTHNORMAL\", index: \"PREPASS_DEPTHNORMAL_INDEX\" }];\n              if (S.prePassRenderer && S.prePassRenderer.enabled && g) {\n                E.PREPASS = !0, E.SCENE_MRT_COUNT = S.prePassRenderer.mrtCount;\n                for (var v = 0; v < h.length; v++) {\n                  var b = S.prePassRenderer.getIndex(h[v].type);\n                  b !== -1 ? (E[h[v].define] = !0, E[h[v].index] = b) : E[h[v].define] = !1;\n                }\n              } else\n                for (E.PREPASS = !1, v = 0; v < h.length; v++)\n                  E[h[v].define] = !1;\n              E.PREPASS != l && (E.markAsUnprocessed(), E.markAsImageProcessingDirty());\n            }\n          }, T.PrepareDefinesForLight = function(S, E, g, l, h, v, b) {\n            switch (b.needNormals = !0, h[\"LIGHT\" + l] === void 0 && (b.needRebuild = !0), h[\"LIGHT\" + l] = !0, h[\"SPOTLIGHT\" + l] = !1, h[\"HEMILIGHT\" + l] = !1, h[\"POINTLIGHT\" + l] = !1, h[\"DIRLIGHT\" + l] = !1, g.prepareLightSpecificDefines(h, l), h[\"LIGHT_FALLOFF_PHYSICAL\" + l] = !1, h[\"LIGHT_FALLOFF_GLTF\" + l] = !1, h[\"LIGHT_FALLOFF_STANDARD\" + l] = !1, g.falloffType) {\n              case I.a.FALLOFF_GLTF:\n                h[\"LIGHT_FALLOFF_GLTF\" + l] = !0;\n                break;\n              case I.a.FALLOFF_PHYSICAL:\n                h[\"LIGHT_FALLOFF_PHYSICAL\" + l] = !0;\n                break;\n              case I.a.FALLOFF_STANDARD:\n                h[\"LIGHT_FALLOFF_STANDARD\" + l] = !0;\n            }\n            if (v && !g.specular.equalsFloats(0, 0, 0) && (b.specularEnabled = !0), h[\"SHADOW\" + l] = !1, h[\"SHADOWCSM\" + l] = !1, h[\"SHADOWCSMDEBUG\" + l] = !1, h[\"SHADOWCSMNUM_CASCADES\" + l] = !1, h[\"SHADOWCSMUSESHADOWMAXZ\" + l] = !1, h[\"SHADOWCSMNOBLEND\" + l] = !1, h[\"SHADOWCSM_RIGHTHANDED\" + l] = !1, h[\"SHADOWPCF\" + l] = !1, h[\"SHADOWPCSS\" + l] = !1, h[\"SHADOWPOISSON\" + l] = !1, h[\"SHADOWESM\" + l] = !1, h[\"SHADOWCLOSEESM\" + l] = !1, h[\"SHADOWCUBE\" + l] = !1, h[\"SHADOWLOWQUALITY\" + l] = !1, h[\"SHADOWMEDIUMQUALITY\" + l] = !1, E && E.receiveShadows && S.shadowsEnabled && g.shadowEnabled) {\n              var D = g.getShadowGenerator();\n              if (D) {\n                var w = D.getShadowMap();\n                w && w.renderList && w.renderList.length > 0 && (b.shadowEnabled = !0, D.prepareDefines(h, l));\n              }\n            }\n            g.lightmapMode != I.a.LIGHTMAP_DEFAULT ? (b.lightmapMode = !0, h[\"LIGHTMAPEXCLUDED\" + l] = !0, h[\"LIGHTMAPNOSPECULAR\" + l] = g.lightmapMode == I.a.LIGHTMAP_SHADOWSONLY) : (h[\"LIGHTMAPEXCLUDED\" + l] = !1, h[\"LIGHTMAPNOSPECULAR\" + l] = !1);\n          }, T.PrepareDefinesForLights = function(S, E, g, l, h, v) {\n            if (h === void 0 && (h = 4), v === void 0 && (v = !1), !g._areLightsDirty)\n              return g._needNormals;\n            var b = 0, D = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };\n            if (S.lightsEnabled && !v)\n              for (var w = 0, N = E.lightSources; w < N.length; w++) {\n                var M = N[w];\n                if (this.PrepareDefinesForLight(S, E, M, b, g, l, D), ++b === h)\n                  break;\n              }\n            g.SPECULARTERM = D.specularEnabled, g.SHADOWS = D.shadowEnabled;\n            for (var U = b; U < h; U++)\n              g[\"LIGHT\" + U] !== void 0 && (g[\"LIGHT\" + U] = !1, g[\"HEMILIGHT\" + U] = !1, g[\"POINTLIGHT\" + U] = !1, g[\"DIRLIGHT\" + U] = !1, g[\"SPOTLIGHT\" + U] = !1, g[\"SHADOW\" + U] = !1, g[\"SHADOWCSM\" + U] = !1, g[\"SHADOWCSMDEBUG\" + U] = !1, g[\"SHADOWCSMNUM_CASCADES\" + U] = !1, g[\"SHADOWCSMUSESHADOWMAXZ\" + U] = !1, g[\"SHADOWCSMNOBLEND\" + U] = !1, g[\"SHADOWCSM_RIGHTHANDED\" + U] = !1, g[\"SHADOWPCF\" + U] = !1, g[\"SHADOWPCSS\" + U] = !1, g[\"SHADOWPOISSON\" + U] = !1, g[\"SHADOWESM\" + U] = !1, g[\"SHADOWCLOSEESM\" + U] = !1, g[\"SHADOWCUBE\" + U] = !1, g[\"SHADOWLOWQUALITY\" + U] = !1, g[\"SHADOWMEDIUMQUALITY\" + U] = !1);\n            var X = S.getEngine().getCaps();\n            return g.SHADOWFLOAT === void 0 && (D.needRebuild = !0), g.SHADOWFLOAT = D.shadowEnabled && (X.textureFloatRender && X.textureFloatLinearFiltering || X.textureHalfFloatRender && X.textureHalfFloatLinearFiltering), g.LIGHTMAPEXCLUDED = D.lightmapMode, D.needRebuild && g.rebuild(), D.needNormals;\n          }, T.PrepareUniformsAndSamplersForLight = function(S, E, g, l, h, v) {\n            h === void 0 && (h = null), v === void 0 && (v = !1), h && h.push(\"Light\" + S), v || (E.push(\"vLightData\" + S, \"vLightDiffuse\" + S, \"vLightSpecular\" + S, \"vLightDirection\" + S, \"vLightFalloff\" + S, \"vLightGround\" + S, \"lightMatrix\" + S, \"shadowsInfo\" + S, \"depthValues\" + S), g.push(\"shadowSampler\" + S), g.push(\"depthSampler\" + S), E.push(\"viewFrustumZ\" + S, \"cascadeBlendFactor\" + S, \"lightSizeUVCorrection\" + S, \"depthCorrection\" + S, \"penumbraDarkness\" + S, \"frustumLengths\" + S), l && (g.push(\"projectionLightSampler\" + S), E.push(\"textureProjectionMatrix\" + S)));\n          }, T.PrepareUniformsAndSamplersList = function(S, E, g, l) {\n            var h;\n            l === void 0 && (l = 4);\n            var v = null;\n            if (S.uniformsNames) {\n              var b = S;\n              h = b.uniformsNames, v = b.uniformBuffersNames, E = b.samplers, g = b.defines, l = b.maxSimultaneousLights || 0;\n            } else\n              h = S, E || (E = []);\n            for (var D = 0; D < l && g[\"LIGHT\" + D]; D++)\n              this.PrepareUniformsAndSamplersForLight(D, h, E, g[\"PROJECTEDLIGHTTEXTURE\" + D], v);\n            g.NUM_MORPH_INFLUENCERS && h.push(\"morphTargetInfluences\");\n          }, T.HandleFallbacksForShadows = function(S, E, g, l) {\n            g === void 0 && (g = 4), l === void 0 && (l = 0);\n            for (var h = 0, v = 0; v < g && S[\"LIGHT\" + v]; v++)\n              v > 0 && (h = l + v, E.addFallback(h, \"LIGHT\" + v)), S.SHADOWS || (S[\"SHADOW\" + v] && E.addFallback(l, \"SHADOW\" + v), S[\"SHADOWPCF\" + v] && E.addFallback(l, \"SHADOWPCF\" + v), S[\"SHADOWPCSS\" + v] && E.addFallback(l, \"SHADOWPCSS\" + v), S[\"SHADOWPOISSON\" + v] && E.addFallback(l, \"SHADOWPOISSON\" + v), S[\"SHADOWESM\" + v] && E.addFallback(l, \"SHADOWESM\" + v), S[\"SHADOWCLOSEESM\" + v] && E.addFallback(l, \"SHADOWCLOSEESM\" + v));\n            return h++;\n          }, T.PrepareAttributesForMorphTargetsInfluencers = function(S, E, g) {\n            this._TmpMorphInfluencers.NUM_MORPH_INFLUENCERS = g, this.PrepareAttributesForMorphTargets(S, E, this._TmpMorphInfluencers);\n          }, T.PrepareAttributesForMorphTargets = function(S, E, g) {\n            var l = g.NUM_MORPH_INFLUENCERS;\n            if (l > 0 && C.a.LastCreatedEngine)\n              for (var h = C.a.LastCreatedEngine.getCaps().maxVertexAttribs, v = E.morphTargetManager, b = v && v.supportsNormals && g.NORMAL, D = v && v.supportsTangents && g.TANGENT, w = v && v.supportsUVs && g.UV1, N = 0; N < l; N++)\n                S.push(u.b.PositionKind + N), b && S.push(u.b.NormalKind + N), D && S.push(u.b.TangentKind + N), w && S.push(u.b.UVKind + \"_\" + N), S.length > h && V.a.Error(\"Cannot add more vertex attributes for mesh \" + E.name);\n          }, T.PrepareAttributesForBones = function(S, E, g, l) {\n            g.NUM_BONE_INFLUENCERS > 0 && (l.addCPUSkinningFallback(0, E), S.push(u.b.MatricesIndicesKind), S.push(u.b.MatricesWeightsKind), g.NUM_BONE_INFLUENCERS > 4 && (S.push(u.b.MatricesIndicesExtraKind), S.push(u.b.MatricesWeightsExtraKind)));\n          }, T.PrepareAttributesForInstances = function(S, E) {\n            (E.INSTANCES || E.THIN_INSTANCES) && this.PushAttributesForInstances(S);\n          }, T.PushAttributesForInstances = function(S) {\n            S.push(\"world0\"), S.push(\"world1\"), S.push(\"world2\"), S.push(\"world3\");\n          }, T.BindLightProperties = function(S, E, g) {\n            S.transferToEffect(E, g + \"\");\n          }, T.BindLight = function(S, E, g, l, h, v) {\n            v === void 0 && (v = !1), S._bindLight(E, g, l, h, v);\n          }, T.BindLights = function(S, E, g, l, h, v) {\n            h === void 0 && (h = 4), v === void 0 && (v = !1);\n            for (var b = Math.min(E.lightSources.length, h), D = 0; D < b; D++) {\n              var w = E.lightSources[D];\n              this.BindLight(w, D, S, g, typeof l == \"boolean\" ? l : l.SPECULARTERM, v);\n            }\n          }, T.BindFogParameters = function(S, E, g, l) {\n            l === void 0 && (l = !1), S.fogEnabled && E.applyFog && S.fogMode !== _.a.FOGMODE_NONE && (g.setFloat4(\"vFogInfos\", S.fogMode, S.fogStart, S.fogEnd, S.fogDensity), l ? (S.fogColor.toLinearSpaceToRef(this._tempFogColor), g.setColor3(\"vFogColor\", this._tempFogColor)) : g.setColor3(\"vFogColor\", S.fogColor));\n          }, T.BindBonesParameters = function(S, E, g) {\n            if (E && S && (S.computeBonesUsingShaders && E._bonesComputationForcedToCPU && (S.computeBonesUsingShaders = !1), S.useBones && S.computeBonesUsingShaders && S.skeleton)) {\n              var l = S.skeleton;\n              if (l.isUsingTextureForMatrices && E.getUniformIndex(\"boneTextureWidth\") > -1) {\n                var h = l.getTransformMatrixTexture(S);\n                E.setTexture(\"boneSampler\", h), E.setFloat(\"boneTextureWidth\", 4 * (l.bones.length + 1));\n              } else {\n                var v = l.getTransformMatrices(S);\n                v && (E.setMatrices(\"mBones\", v), g && S.getScene().prePassRenderer && S.getScene().prePassRenderer.getIndex(O.a.PREPASS_VELOCITY_TEXTURE_TYPE) && (g.previousBones[S.uniqueId] && E.setMatrices(\"mPreviousBones\", g.previousBones[S.uniqueId]), T._CopyBonesTransformationMatrices(v, g.previousBones[S.uniqueId])));\n              }\n            }\n          }, T._CopyBonesTransformationMatrices = function(S, E) {\n            return E.set(S), E;\n          }, T.BindMorphTargetParameters = function(S, E) {\n            var g = S.morphTargetManager;\n            S && g && E.setFloatArray(\"morphTargetInfluences\", g.influences);\n          }, T.BindLogDepth = function(S, E, g) {\n            S.LOGARITHMICDEPTH && E.setFloat(\"logarithmicDepthConstant\", 2 / (Math.log(g.activeCamera.maxZ + 1) / Math.LN2));\n          }, T.BindClipPlane = function(S, E) {\n            m.a.BindClipPlane(S, E);\n          }, T._TmpMorphInfluencers = { NUM_MORPH_INFLUENCERS: 0 }, T._tempFogColor = x.a.Black(), T;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(0), _ = f(4), C = f(21), u = f(9), I = f(8), O = function() {\n          function x() {\n          }\n          return x.prototype.set = function(m, c) {\n            switch (m.length || I.a.Warn(\"Setting vertex data kind '\" + c + \"' with an empty array\"), c) {\n              case _.b.PositionKind:\n                this.positions = m;\n                break;\n              case _.b.NormalKind:\n                this.normals = m;\n                break;\n              case _.b.TangentKind:\n                this.tangents = m;\n                break;\n              case _.b.UVKind:\n                this.uvs = m;\n                break;\n              case _.b.UV2Kind:\n                this.uvs2 = m;\n                break;\n              case _.b.UV3Kind:\n                this.uvs3 = m;\n                break;\n              case _.b.UV4Kind:\n                this.uvs4 = m;\n                break;\n              case _.b.UV5Kind:\n                this.uvs5 = m;\n                break;\n              case _.b.UV6Kind:\n                this.uvs6 = m;\n                break;\n              case _.b.ColorKind:\n                this.colors = m;\n                break;\n              case _.b.MatricesIndicesKind:\n                this.matricesIndices = m;\n                break;\n              case _.b.MatricesWeightsKind:\n                this.matricesWeights = m;\n                break;\n              case _.b.MatricesIndicesExtraKind:\n                this.matricesIndicesExtra = m;\n                break;\n              case _.b.MatricesWeightsExtraKind:\n                this.matricesWeightsExtra = m;\n            }\n          }, x.prototype.applyToMesh = function(m, c) {\n            return this._applyTo(m, c), this;\n          }, x.prototype.applyToGeometry = function(m, c) {\n            return this._applyTo(m, c), this;\n          }, x.prototype.updateMesh = function(m) {\n            return this._update(m), this;\n          }, x.prototype.updateGeometry = function(m) {\n            return this._update(m), this;\n          }, x.prototype._applyTo = function(m, c) {\n            return c === void 0 && (c = !1), this.positions && m.setVerticesData(_.b.PositionKind, this.positions, c), this.normals && m.setVerticesData(_.b.NormalKind, this.normals, c), this.tangents && m.setVerticesData(_.b.TangentKind, this.tangents, c), this.uvs && m.setVerticesData(_.b.UVKind, this.uvs, c), this.uvs2 && m.setVerticesData(_.b.UV2Kind, this.uvs2, c), this.uvs3 && m.setVerticesData(_.b.UV3Kind, this.uvs3, c), this.uvs4 && m.setVerticesData(_.b.UV4Kind, this.uvs4, c), this.uvs5 && m.setVerticesData(_.b.UV5Kind, this.uvs5, c), this.uvs6 && m.setVerticesData(_.b.UV6Kind, this.uvs6, c), this.colors && m.setVerticesData(_.b.ColorKind, this.colors, c), this.matricesIndices && m.setVerticesData(_.b.MatricesIndicesKind, this.matricesIndices, c), this.matricesWeights && m.setVerticesData(_.b.MatricesWeightsKind, this.matricesWeights, c), this.matricesIndicesExtra && m.setVerticesData(_.b.MatricesIndicesExtraKind, this.matricesIndicesExtra, c), this.matricesWeightsExtra && m.setVerticesData(_.b.MatricesWeightsExtraKind, this.matricesWeightsExtra, c), this.indices ? m.setIndices(this.indices, null, c) : m.setIndices([], null), this;\n          }, x.prototype._update = function(m, c, T) {\n            return this.positions && m.updateVerticesData(_.b.PositionKind, this.positions, c, T), this.normals && m.updateVerticesData(_.b.NormalKind, this.normals, c, T), this.tangents && m.updateVerticesData(_.b.TangentKind, this.tangents, c, T), this.uvs && m.updateVerticesData(_.b.UVKind, this.uvs, c, T), this.uvs2 && m.updateVerticesData(_.b.UV2Kind, this.uvs2, c, T), this.uvs3 && m.updateVerticesData(_.b.UV3Kind, this.uvs3, c, T), this.uvs4 && m.updateVerticesData(_.b.UV4Kind, this.uvs4, c, T), this.uvs5 && m.updateVerticesData(_.b.UV5Kind, this.uvs5, c, T), this.uvs6 && m.updateVerticesData(_.b.UV6Kind, this.uvs6, c, T), this.colors && m.updateVerticesData(_.b.ColorKind, this.colors, c, T), this.matricesIndices && m.updateVerticesData(_.b.MatricesIndicesKind, this.matricesIndices, c, T), this.matricesWeights && m.updateVerticesData(_.b.MatricesWeightsKind, this.matricesWeights, c, T), this.matricesIndicesExtra && m.updateVerticesData(_.b.MatricesIndicesExtraKind, this.matricesIndicesExtra, c, T), this.matricesWeightsExtra && m.updateVerticesData(_.b.MatricesWeightsExtraKind, this.matricesWeightsExtra, c, T), this.indices && m.setIndices(this.indices, null), this;\n          }, x.prototype.transform = function(m) {\n            var c, T = m.determinant() < 0, S = V.e.Zero();\n            if (this.positions) {\n              var E = V.e.Zero();\n              for (c = 0; c < this.positions.length; c += 3)\n                V.e.FromArrayToRef(this.positions, c, E), V.e.TransformCoordinatesToRef(E, m, S), this.positions[c] = S.x, this.positions[c + 1] = S.y, this.positions[c + 2] = S.z;\n            }\n            if (this.normals) {\n              var g = V.e.Zero();\n              for (c = 0; c < this.normals.length; c += 3)\n                V.e.FromArrayToRef(this.normals, c, g), V.e.TransformNormalToRef(g, m, S), this.normals[c] = S.x, this.normals[c + 1] = S.y, this.normals[c + 2] = S.z;\n            }\n            if (this.tangents) {\n              var l = V.f.Zero(), h = V.f.Zero();\n              for (c = 0; c < this.tangents.length; c += 4)\n                V.f.FromArrayToRef(this.tangents, c, l), V.f.TransformNormalToRef(l, m, h), this.tangents[c] = h.x, this.tangents[c + 1] = h.y, this.tangents[c + 2] = h.z, this.tangents[c + 3] = h.w;\n            }\n            if (T && this.indices)\n              for (c = 0; c < this.indices.length; c += 3) {\n                var v = this.indices[c + 1];\n                this.indices[c + 1] = this.indices[c + 2], this.indices[c + 2] = v;\n              }\n            return this;\n          }, x.prototype.merge = function(m, c) {\n            if (c === void 0 && (c = !1), this._validate(), m._validate(), !this.normals != !m.normals || !this.tangents != !m.tangents || !this.uvs != !m.uvs || !this.uvs2 != !m.uvs2 || !this.uvs3 != !m.uvs3 || !this.uvs4 != !m.uvs4 || !this.uvs5 != !m.uvs5 || !this.uvs6 != !m.uvs6 || !this.colors != !m.colors || !this.matricesIndices != !m.matricesIndices || !this.matricesWeights != !m.matricesWeights || !this.matricesIndicesExtra != !m.matricesIndicesExtra || !this.matricesWeightsExtra != !m.matricesWeightsExtra)\n              throw new Error(\"Cannot merge vertex data that do not have the same set of attributes\");\n            if (m.indices) {\n              this.indices || (this.indices = []);\n              var T = this.positions ? this.positions.length / 3 : 0;\n              if (this.indices.BYTES_PER_ELEMENT !== void 0) {\n                var S = this.indices.length + m.indices.length, E = c || this.indices instanceof Uint32Array ? new Uint32Array(S) : new Uint16Array(S);\n                E.set(this.indices);\n                for (var g = this.indices.length, l = 0; l < m.indices.length; l++)\n                  E[g + l] = m.indices[l] + T;\n                this.indices = E;\n              } else\n                for (l = 0; l < m.indices.length; l++)\n                  this.indices.push(m.indices[l] + T);\n            }\n            return this.positions = this._mergeElement(this.positions, m.positions), this.normals = this._mergeElement(this.normals, m.normals), this.tangents = this._mergeElement(this.tangents, m.tangents), this.uvs = this._mergeElement(this.uvs, m.uvs), this.uvs2 = this._mergeElement(this.uvs2, m.uvs2), this.uvs3 = this._mergeElement(this.uvs3, m.uvs3), this.uvs4 = this._mergeElement(this.uvs4, m.uvs4), this.uvs5 = this._mergeElement(this.uvs5, m.uvs5), this.uvs6 = this._mergeElement(this.uvs6, m.uvs6), this.colors = this._mergeElement(this.colors, m.colors), this.matricesIndices = this._mergeElement(this.matricesIndices, m.matricesIndices), this.matricesWeights = this._mergeElement(this.matricesWeights, m.matricesWeights), this.matricesIndicesExtra = this._mergeElement(this.matricesIndicesExtra, m.matricesIndicesExtra), this.matricesWeightsExtra = this._mergeElement(this.matricesWeightsExtra, m.matricesWeightsExtra), this;\n          }, x.prototype._mergeElement = function(m, c) {\n            if (!m)\n              return c;\n            if (!c)\n              return m;\n            var T = c.length + m.length, S = m instanceof Float32Array, E = c instanceof Float32Array;\n            if (S) {\n              var g = new Float32Array(T);\n              return g.set(m), g.set(c, m.length), g;\n            }\n            if (E) {\n              var l = m.slice(0), h = 0;\n              for (T = c.length; h < T; h++)\n                l.push(c[h]);\n              return l;\n            }\n            return m.concat(c);\n          }, x.prototype._validate = function() {\n            if (!this.positions)\n              throw new Error(\"Positions are required\");\n            var m = function(S, E) {\n              var g = _.b.DeduceStride(S);\n              if (E.length % g != 0)\n                throw new Error(\"The \" + S + \"s array count must be a multiple of \" + g);\n              return E.length / g;\n            }, c = m(_.b.PositionKind, this.positions), T = function(S, E) {\n              var g = m(S, E);\n              if (g !== c)\n                throw new Error(\"The \" + S + \"s element count (\" + g + \") does not match the positions count (\" + c + \")\");\n            };\n            this.normals && T(_.b.NormalKind, this.normals), this.tangents && T(_.b.TangentKind, this.tangents), this.uvs && T(_.b.UVKind, this.uvs), this.uvs2 && T(_.b.UV2Kind, this.uvs2), this.uvs3 && T(_.b.UV3Kind, this.uvs3), this.uvs4 && T(_.b.UV4Kind, this.uvs4), this.uvs5 && T(_.b.UV5Kind, this.uvs5), this.uvs6 && T(_.b.UV6Kind, this.uvs6), this.colors && T(_.b.ColorKind, this.colors), this.matricesIndices && T(_.b.MatricesIndicesKind, this.matricesIndices), this.matricesWeights && T(_.b.MatricesWeightsKind, this.matricesWeights), this.matricesIndicesExtra && T(_.b.MatricesIndicesExtraKind, this.matricesIndicesExtra), this.matricesWeightsExtra && T(_.b.MatricesWeightsExtraKind, this.matricesWeightsExtra);\n          }, x.prototype.serialize = function() {\n            var m = this.serialize();\n            return this.positions && (m.positions = this.positions), this.normals && (m.normals = this.normals), this.tangents && (m.tangents = this.tangents), this.uvs && (m.uvs = this.uvs), this.uvs2 && (m.uvs2 = this.uvs2), this.uvs3 && (m.uvs3 = this.uvs3), this.uvs4 && (m.uvs4 = this.uvs4), this.uvs5 && (m.uvs5 = this.uvs5), this.uvs6 && (m.uvs6 = this.uvs6), this.colors && (m.colors = this.colors), this.matricesIndices && (m.matricesIndices = this.matricesIndices, m.matricesIndices._isExpanded = !0), this.matricesWeights && (m.matricesWeights = this.matricesWeights), this.matricesIndicesExtra && (m.matricesIndicesExtra = this.matricesIndicesExtra, m.matricesIndicesExtra._isExpanded = !0), this.matricesWeightsExtra && (m.matricesWeightsExtra = this.matricesWeightsExtra), m.indices = this.indices, m;\n          }, x.ExtractFromMesh = function(m, c, T) {\n            return x._ExtractFrom(m, c, T);\n          }, x.ExtractFromGeometry = function(m, c, T) {\n            return x._ExtractFrom(m, c, T);\n          }, x._ExtractFrom = function(m, c, T) {\n            var S = new x();\n            return m.isVerticesDataPresent(_.b.PositionKind) && (S.positions = m.getVerticesData(_.b.PositionKind, c, T)), m.isVerticesDataPresent(_.b.NormalKind) && (S.normals = m.getVerticesData(_.b.NormalKind, c, T)), m.isVerticesDataPresent(_.b.TangentKind) && (S.tangents = m.getVerticesData(_.b.TangentKind, c, T)), m.isVerticesDataPresent(_.b.UVKind) && (S.uvs = m.getVerticesData(_.b.UVKind, c, T)), m.isVerticesDataPresent(_.b.UV2Kind) && (S.uvs2 = m.getVerticesData(_.b.UV2Kind, c, T)), m.isVerticesDataPresent(_.b.UV3Kind) && (S.uvs3 = m.getVerticesData(_.b.UV3Kind, c, T)), m.isVerticesDataPresent(_.b.UV4Kind) && (S.uvs4 = m.getVerticesData(_.b.UV4Kind, c, T)), m.isVerticesDataPresent(_.b.UV5Kind) && (S.uvs5 = m.getVerticesData(_.b.UV5Kind, c, T)), m.isVerticesDataPresent(_.b.UV6Kind) && (S.uvs6 = m.getVerticesData(_.b.UV6Kind, c, T)), m.isVerticesDataPresent(_.b.ColorKind) && (S.colors = m.getVerticesData(_.b.ColorKind, c, T)), m.isVerticesDataPresent(_.b.MatricesIndicesKind) && (S.matricesIndices = m.getVerticesData(_.b.MatricesIndicesKind, c, T)), m.isVerticesDataPresent(_.b.MatricesWeightsKind) && (S.matricesWeights = m.getVerticesData(_.b.MatricesWeightsKind, c, T)), m.isVerticesDataPresent(_.b.MatricesIndicesExtraKind) && (S.matricesIndicesExtra = m.getVerticesData(_.b.MatricesIndicesExtraKind, c, T)), m.isVerticesDataPresent(_.b.MatricesWeightsExtraKind) && (S.matricesWeightsExtra = m.getVerticesData(_.b.MatricesWeightsExtraKind, c, T)), S.indices = m.getIndices(c, T), S;\n          }, x.CreateRibbon = function(m) {\n            throw C.a.WarnImport(\"ribbonBuilder\");\n          }, x.CreateBox = function(m) {\n            throw C.a.WarnImport(\"boxBuilder\");\n          }, x.CreateTiledBox = function(m) {\n            throw C.a.WarnImport(\"tiledBoxBuilder\");\n          }, x.CreateTiledPlane = function(m) {\n            throw C.a.WarnImport(\"tiledPlaneBuilder\");\n          }, x.CreateSphere = function(m) {\n            throw C.a.WarnImport(\"sphereBuilder\");\n          }, x.CreateCylinder = function(m) {\n            throw C.a.WarnImport(\"cylinderBuilder\");\n          }, x.CreateTorus = function(m) {\n            throw C.a.WarnImport(\"torusBuilder\");\n          }, x.CreateLineSystem = function(m) {\n            throw C.a.WarnImport(\"linesBuilder\");\n          }, x.CreateDashedLines = function(m) {\n            throw C.a.WarnImport(\"linesBuilder\");\n          }, x.CreateGround = function(m) {\n            throw C.a.WarnImport(\"groundBuilder\");\n          }, x.CreateTiledGround = function(m) {\n            throw C.a.WarnImport(\"groundBuilder\");\n          }, x.CreateGroundFromHeightMap = function(m) {\n            throw C.a.WarnImport(\"groundBuilder\");\n          }, x.CreatePlane = function(m) {\n            throw C.a.WarnImport(\"planeBuilder\");\n          }, x.CreateDisc = function(m) {\n            throw C.a.WarnImport(\"discBuilder\");\n          }, x.CreatePolygon = function(m, c, T, S, E, g, l) {\n            throw C.a.WarnImport(\"polygonBuilder\");\n          }, x.CreateIcoSphere = function(m) {\n            throw C.a.WarnImport(\"icoSphereBuilder\");\n          }, x.CreatePolyhedron = function(m) {\n            throw C.a.WarnImport(\"polyhedronBuilder\");\n          }, x.CreateCapsule = function(m) {\n            throw m === void 0 && (m = { orientation: V.e.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 }), C.a.WarnImport(\"capsuleBuilder\");\n          }, x.CreateTorusKnot = function(m) {\n            throw C.a.WarnImport(\"torusKnotBuilder\");\n          }, x.ComputeNormals = function(m, c, T, S) {\n            var E = 0, g = 0, l = 0, h = 0, v = 0, b = 0, D = 0, w = 0, N = 0, M = 0, U = 0, X = 0, j = 0, ne = 0, te = 0, de = 0, pe = 0, ae = 0, ee = 0, K = 0, $ = !1, L = !1, G = !1, Q = !1, oe = 1, re = 0, Y = null;\n            if (S && ($ = !!S.facetNormals, L = !!S.facetPositions, G = !!S.facetPartitioning, oe = S.useRightHandedSystem === !0 ? -1 : 1, re = S.ratio || 0, Q = !!S.depthSort, Y = S.distanceTo, Q)) {\n              Y === void 0 && (Y = V.e.Zero());\n              var k = S.depthSortedFacets;\n            }\n            var H = 0, Z = 0, W = 0, q = 0;\n            if (G && S && S.bbSize) {\n              var he = 0, ge = 0, me = 0, _e = 0, ye = 0, Pe = 0, be = 0, Fe = 0, ke = 0, We = 0, je = 0, He = 0, Qe = 0, Ge = 0, tt = 0, Je = 0, st = S.bbSize.x > S.bbSize.y ? S.bbSize.x : S.bbSize.y;\n              st = st > S.bbSize.z ? st : S.bbSize.z, H = S.subDiv.X * re / S.bbSize.x, Z = S.subDiv.Y * re / S.bbSize.y, W = S.subDiv.Z * re / S.bbSize.z, q = S.subDiv.max * S.subDiv.max, S.facetPartitioning.length = 0;\n            }\n            for (E = 0; E < m.length; E++)\n              T[E] = 0;\n            var at = c.length / 3 | 0;\n            for (E = 0; E < at; E++) {\n              if (j = (X = 3 * c[3 * E]) + 1, ne = X + 2, de = (te = 3 * c[3 * E + 1]) + 1, pe = te + 2, ee = (ae = 3 * c[3 * E + 2]) + 1, K = ae + 2, g = m[X] - m[te], l = m[j] - m[de], h = m[ne] - m[pe], v = m[ae] - m[te], b = m[ee] - m[de], w = oe * (l * (D = m[K] - m[pe]) - h * b), N = oe * (h * v - g * D), M = oe * (g * b - l * v), w /= U = (U = Math.sqrt(w * w + N * N + M * M)) === 0 ? 1 : U, N /= U, M /= U, $ && S && (S.facetNormals[E].x = w, S.facetNormals[E].y = N, S.facetNormals[E].z = M), L && S && (S.facetPositions[E].x = (m[X] + m[te] + m[ae]) / 3, S.facetPositions[E].y = (m[j] + m[de] + m[ee]) / 3, S.facetPositions[E].z = (m[ne] + m[pe] + m[K]) / 3), G && S && (he = Math.floor((S.facetPositions[E].x - S.bInfo.minimum.x * re) * H), ge = Math.floor((S.facetPositions[E].y - S.bInfo.minimum.y * re) * Z), me = Math.floor((S.facetPositions[E].z - S.bInfo.minimum.z * re) * W), _e = Math.floor((m[X] - S.bInfo.minimum.x * re) * H), ye = Math.floor((m[j] - S.bInfo.minimum.y * re) * Z), Pe = Math.floor((m[ne] - S.bInfo.minimum.z * re) * W), be = Math.floor((m[te] - S.bInfo.minimum.x * re) * H), Fe = Math.floor((m[de] - S.bInfo.minimum.y * re) * Z), ke = Math.floor((m[pe] - S.bInfo.minimum.z * re) * W), We = Math.floor((m[ae] - S.bInfo.minimum.x * re) * H), je = Math.floor((m[ee] - S.bInfo.minimum.y * re) * Z), He = Math.floor((m[K] - S.bInfo.minimum.z * re) * W), Ge = _e + S.subDiv.max * ye + q * Pe, tt = be + S.subDiv.max * Fe + q * ke, Je = We + S.subDiv.max * je + q * He, Qe = he + S.subDiv.max * ge + q * me, S.facetPartitioning[Qe] = S.facetPartitioning[Qe] ? S.facetPartitioning[Qe] : new Array(), S.facetPartitioning[Ge] = S.facetPartitioning[Ge] ? S.facetPartitioning[Ge] : new Array(), S.facetPartitioning[tt] = S.facetPartitioning[tt] ? S.facetPartitioning[tt] : new Array(), S.facetPartitioning[Je] = S.facetPartitioning[Je] ? S.facetPartitioning[Je] : new Array(), S.facetPartitioning[Ge].push(E), tt != Ge && S.facetPartitioning[tt].push(E), Je != tt && Je != Ge && S.facetPartitioning[Je].push(E), Qe != Ge && Qe != tt && Qe != Je && S.facetPartitioning[Qe].push(E)), Q && S && S.facetPositions) {\n                var pt = k[E];\n                pt.ind = 3 * E, pt.sqDistance = V.e.DistanceSquared(S.facetPositions[E], Y);\n              }\n              T[X] += w, T[j] += N, T[ne] += M, T[te] += w, T[de] += N, T[pe] += M, T[ae] += w, T[ee] += N, T[K] += M;\n            }\n            for (E = 0; E < T.length / 3; E++)\n              w = T[3 * E], N = T[3 * E + 1], M = T[3 * E + 2], w /= U = (U = Math.sqrt(w * w + N * N + M * M)) === 0 ? 1 : U, N /= U, M /= U, T[3 * E] = w, T[3 * E + 1] = N, T[3 * E + 2] = M;\n          }, x._ComputeSides = function(m, c, T, S, E, g, l) {\n            var h, v, b = T.length, D = S.length;\n            switch (m = m || x.DEFAULTSIDE) {\n              case x.FRONTSIDE:\n                break;\n              case x.BACKSIDE:\n                var w;\n                for (h = 0; h < b; h += 3)\n                  w = T[h], T[h] = T[h + 2], T[h + 2] = w;\n                for (v = 0; v < D; v++)\n                  S[v] = -S[v];\n                break;\n              case x.DOUBLESIDE:\n                for (var N = c.length, M = N / 3, U = 0; U < N; U++)\n                  c[N + U] = c[U];\n                for (h = 0; h < b; h += 3)\n                  T[h + b] = T[h + 2] + M, T[h + 1 + b] = T[h + 1] + M, T[h + 2 + b] = T[h] + M;\n                for (v = 0; v < D; v++)\n                  S[D + v] = -S[v];\n                var X = E.length, j = 0;\n                for (j = 0; j < X; j++)\n                  E[j + X] = E[j];\n                for (g = g || new V.f(0, 0, 1, 1), l = l || new V.f(0, 0, 1, 1), j = 0, h = 0; h < X / 2; h++)\n                  E[j] = g.x + (g.z - g.x) * E[j], E[j + 1] = g.y + (g.w - g.y) * E[j + 1], E[j + X] = l.x + (l.z - l.x) * E[j + X], E[j + X + 1] = l.y + (l.w - l.y) * E[j + X + 1], j += 2;\n            }\n          }, x.ImportVertexData = function(m, c) {\n            var T = new x(), S = m.positions;\n            S && T.set(S, _.b.PositionKind);\n            var E = m.normals;\n            E && T.set(E, _.b.NormalKind);\n            var g = m.tangents;\n            g && T.set(g, _.b.TangentKind);\n            var l = m.uvs;\n            l && T.set(l, _.b.UVKind);\n            var h = m.uv2s;\n            h && T.set(h, _.b.UV2Kind);\n            var v = m.uv3s;\n            v && T.set(v, _.b.UV3Kind);\n            var b = m.uv4s;\n            b && T.set(b, _.b.UV4Kind);\n            var D = m.uv5s;\n            D && T.set(D, _.b.UV5Kind);\n            var w = m.uv6s;\n            w && T.set(w, _.b.UV6Kind);\n            var N = m.colors;\n            N && T.set(u.b.CheckColors4(N, S.length / 3), _.b.ColorKind);\n            var M = m.matricesIndices;\n            M && T.set(M, _.b.MatricesIndicesKind);\n            var U = m.matricesWeights;\n            U && T.set(U, _.b.MatricesWeightsKind);\n            var X = m.indices;\n            X && (T.indices = X), c.setAllVerticesData(T, m.updatable);\n          }, x.FRONTSIDE = 0, x.BACKSIDE = 1, x.DOUBLESIDE = 2, x.DEFAULTSIDE = 0, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(1), _ = function() {\n          function u() {\n          }\n          return u.NAME_EFFECTLAYER = \"EffectLayer\", u.NAME_LAYER = \"Layer\", u.NAME_LENSFLARESYSTEM = \"LensFlareSystem\", u.NAME_BOUNDINGBOXRENDERER = \"BoundingBoxRenderer\", u.NAME_PARTICLESYSTEM = \"ParticleSystem\", u.NAME_GAMEPAD = \"Gamepad\", u.NAME_SIMPLIFICATIONQUEUE = \"SimplificationQueue\", u.NAME_GEOMETRYBUFFERRENDERER = \"GeometryBufferRenderer\", u.NAME_PREPASSRENDERER = \"PrePassRenderer\", u.NAME_DEPTHRENDERER = \"DepthRenderer\", u.NAME_POSTPROCESSRENDERPIPELINEMANAGER = \"PostProcessRenderPipelineManager\", u.NAME_SPRITE = \"Sprite\", u.NAME_SUBSURFACE = \"SubSurface\", u.NAME_OUTLINERENDERER = \"Outline\", u.NAME_PROCEDURALTEXTURE = \"ProceduralTexture\", u.NAME_SHADOWGENERATOR = \"ShadowGenerator\", u.NAME_OCTREE = \"Octree\", u.NAME_PHYSICSENGINE = \"PhysicsEngine\", u.NAME_AUDIO = \"Audio\", u.STEP_ISREADYFORMESH_EFFECTLAYER = 0, u.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0, u.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0, u.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0, u.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1, u.STEP_BEFORECAMERADRAW_EFFECTLAYER = 0, u.STEP_BEFORECAMERADRAW_LAYER = 1, u.STEP_BEFORECAMERADRAW_PREPASS = 2, u.STEP_BEFORERENDERTARGETDRAW_LAYER = 0, u.STEP_BEFORERENDERINGMESH_PREPASS = 0, u.STEP_BEFORERENDERINGMESH_OUTLINE = 1, u.STEP_AFTERRENDERINGMESH_PREPASS = 0, u.STEP_AFTERRENDERINGMESH_OUTLINE = 1, u.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0, u.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1, u.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0, u.STEP_BEFORECAMERAUPDATE_GAMEPAD = 1, u.STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0, u.STEP_AFTERRENDERTARGETDRAW_LAYER = 0, u.STEP_AFTERCAMERADRAW_EFFECTLAYER = 0, u.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 1, u.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 2, u.STEP_AFTERCAMERADRAW_LAYER = 3, u.STEP_AFTERCAMERADRAW_PREPASS = 4, u.STEP_AFTERRENDER_AUDIO = 0, u.STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0, u.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1, u.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2, u.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3, u.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0, u.STEP_BEFORECLEARSTAGE_PREPASS = 0, u.STEP_POINTERMOVE_SPRITE = 0, u.STEP_POINTERDOWN_SPRITE = 0, u.STEP_POINTERUP_SPRITE = 0, u;\n        }(), C = function(u) {\n          function I(O) {\n            return u.apply(this, O) || this;\n          }\n          return Object(V.d)(I, u), I.Create = function() {\n            return Object.create(I.prototype);\n          }, I.prototype.registerStep = function(O, x, m) {\n            var c = 0;\n            for (Number.MAX_VALUE; c < this.length && !(O < this[c].index); c++)\n              ;\n            this.splice(c, 0, { index: O, component: x, action: m.bind(x) });\n          }, I.prototype.clear = function() {\n            this.length = 0;\n          }, I;\n        }(Array);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        }), f.d(A, \"d\", function() {\n          return I;\n        }), f.d(A, \"b\", function() {\n          return O;\n        });\n        var V = f(1), _ = f(0), C = function() {\n          function x() {\n          }\n          return x.POINTERDOWN = 1, x.POINTERUP = 2, x.POINTERMOVE = 4, x.POINTERWHEEL = 8, x.POINTERPICK = 16, x.POINTERTAP = 32, x.POINTERDOUBLETAP = 64, x;\n        }(), u = function(x, m) {\n          this.type = x, this.event = m;\n        }, I = function(x) {\n          function m(c, T, S, E) {\n            var g = x.call(this, c, T) || this;\n            return g.ray = null, g.skipOnPointerObservable = !1, g.localPosition = new _.d(S, E), g;\n          }\n          return Object(V.d)(m, x), m;\n        }(u), O = function(x) {\n          function m(c, T, S) {\n            var E = x.call(this, c, T) || this;\n            return E.pickInfo = S, E;\n          }\n          return Object(V.d)(m, x), m;\n        }(u);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(13), _ = f(2), C = function() {\n          function u() {\n          }\n          return Object.defineProperty(u, \"DiffuseTextureEnabled\", { get: function() {\n            return this._DiffuseTextureEnabled;\n          }, set: function(I) {\n            this._DiffuseTextureEnabled !== I && (this._DiffuseTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"DetailTextureEnabled\", { get: function() {\n            return this._DetailTextureEnabled;\n          }, set: function(I) {\n            this._DetailTextureEnabled !== I && (this._DetailTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"AmbientTextureEnabled\", { get: function() {\n            return this._AmbientTextureEnabled;\n          }, set: function(I) {\n            this._AmbientTextureEnabled !== I && (this._AmbientTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"OpacityTextureEnabled\", { get: function() {\n            return this._OpacityTextureEnabled;\n          }, set: function(I) {\n            this._OpacityTextureEnabled !== I && (this._OpacityTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ReflectionTextureEnabled\", { get: function() {\n            return this._ReflectionTextureEnabled;\n          }, set: function(I) {\n            this._ReflectionTextureEnabled !== I && (this._ReflectionTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"EmissiveTextureEnabled\", { get: function() {\n            return this._EmissiveTextureEnabled;\n          }, set: function(I) {\n            this._EmissiveTextureEnabled !== I && (this._EmissiveTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"SpecularTextureEnabled\", { get: function() {\n            return this._SpecularTextureEnabled;\n          }, set: function(I) {\n            this._SpecularTextureEnabled !== I && (this._SpecularTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"BumpTextureEnabled\", { get: function() {\n            return this._BumpTextureEnabled;\n          }, set: function(I) {\n            this._BumpTextureEnabled !== I && (this._BumpTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"LightmapTextureEnabled\", { get: function() {\n            return this._LightmapTextureEnabled;\n          }, set: function(I) {\n            this._LightmapTextureEnabled !== I && (this._LightmapTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"RefractionTextureEnabled\", { get: function() {\n            return this._RefractionTextureEnabled;\n          }, set: function(I) {\n            this._RefractionTextureEnabled !== I && (this._RefractionTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ColorGradingTextureEnabled\", { get: function() {\n            return this._ColorGradingTextureEnabled;\n          }, set: function(I) {\n            this._ColorGradingTextureEnabled !== I && (this._ColorGradingTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"FresnelEnabled\", { get: function() {\n            return this._FresnelEnabled;\n          }, set: function(I) {\n            this._FresnelEnabled !== I && (this._FresnelEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_FresnelDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ClearCoatTextureEnabled\", { get: function() {\n            return this._ClearCoatTextureEnabled;\n          }, set: function(I) {\n            this._ClearCoatTextureEnabled !== I && (this._ClearCoatTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ClearCoatBumpTextureEnabled\", { get: function() {\n            return this._ClearCoatBumpTextureEnabled;\n          }, set: function(I) {\n            this._ClearCoatBumpTextureEnabled !== I && (this._ClearCoatBumpTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ClearCoatTintTextureEnabled\", { get: function() {\n            return this._ClearCoatTintTextureEnabled;\n          }, set: function(I) {\n            this._ClearCoatTintTextureEnabled !== I && (this._ClearCoatTintTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"SheenTextureEnabled\", { get: function() {\n            return this._SheenTextureEnabled;\n          }, set: function(I) {\n            this._SheenTextureEnabled !== I && (this._SheenTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"AnisotropicTextureEnabled\", { get: function() {\n            return this._AnisotropicTextureEnabled;\n          }, set: function(I) {\n            this._AnisotropicTextureEnabled !== I && (this._AnisotropicTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u, \"ThicknessTextureEnabled\", { get: function() {\n            return this._ThicknessTextureEnabled;\n          }, set: function(I) {\n            this._ThicknessTextureEnabled !== I && (this._ThicknessTextureEnabled = I, V.a.MarkAllMaterialsAsDirty(_.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), u._DiffuseTextureEnabled = !0, u._DetailTextureEnabled = !0, u._AmbientTextureEnabled = !0, u._OpacityTextureEnabled = !0, u._ReflectionTextureEnabled = !0, u._EmissiveTextureEnabled = !0, u._SpecularTextureEnabled = !0, u._BumpTextureEnabled = !0, u._LightmapTextureEnabled = !0, u._RefractionTextureEnabled = !0, u._ColorGradingTextureEnabled = !0, u._FresnelEnabled = !0, u._ClearCoatTextureEnabled = !0, u._ClearCoatBumpTextureEnabled = !0, u._ClearCoatTintTextureEnabled = !0, u._SheenTextureEnabled = !0, u._AnisotropicTextureEnabled = !0, u._ThicknessTextureEnabled = !0, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return oe;\n        });\n        var V = f(1), _ = f(12), C = f(57), u = f(6), I = f(33), O = f(112), x = f(37), m = f(0), c = f(46), T = f(31), S = f(24), E = f(35), g = f(42), l = f(85), h = f(48), v = f(54), b = f(47), D = f(95), w = f(96), N = f(17), M = f(2), U = f(38), X = f(8), j = f(22), ne = f(21), te = f(18), de = f(91), pe = f(66), ae = function() {\n          function re() {\n            this._singleClick = !1, this._doubleClick = !1, this._hasSwiped = !1, this._ignore = !1;\n          }\n          return Object.defineProperty(re.prototype, \"singleClick\", { get: function() {\n            return this._singleClick;\n          }, set: function(Y) {\n            this._singleClick = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"doubleClick\", { get: function() {\n            return this._doubleClick;\n          }, set: function(Y) {\n            this._doubleClick = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"hasSwiped\", { get: function() {\n            return this._hasSwiped;\n          }, set: function(Y) {\n            this._hasSwiped = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"ignore\", { get: function() {\n            return this._ignore;\n          }, set: function(Y) {\n            this._ignore = Y;\n          }, enumerable: !1, configurable: !0 }), re;\n        }(), ee = function() {\n          function re(Y) {\n            this._alreadyAttached = !1, this._wheelEventName = \"\", this._meshPickProceed = !1, this._currentPickResult = null, this._previousPickResult = null, this._totalPointersPressed = 0, this._doubleClickOccured = !1, this._pointerX = 0, this._pointerY = 0, this._startingPointerPosition = new m.d(0, 0), this._previousStartingPointerPosition = new m.d(0, 0), this._startingPointerTime = 0, this._previousStartingPointerTime = 0, this._pointerCaptures = {}, this._meshUnderPointerId = [], this._keyboardIsAttached = !1, this._scene = Y;\n          }\n          return Object.defineProperty(re.prototype, \"meshUnderPointer\", { get: function() {\n            return this._pointerOverMesh;\n          }, enumerable: !1, configurable: !0 }), re.prototype.getMeshUnderPointerByPointerId = function(Y) {\n            return this._meshUnderPointerId[Y];\n          }, Object.defineProperty(re.prototype, \"unTranslatedPointer\", { get: function() {\n            return new m.d(this._unTranslatedPointerX, this._unTranslatedPointerY);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"pointerX\", { get: function() {\n            return this._pointerX;\n          }, set: function(Y) {\n            this._pointerX = Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(re.prototype, \"pointerY\", { get: function() {\n            return this._pointerY;\n          }, set: function(Y) {\n            this._pointerY = Y;\n          }, enumerable: !1, configurable: !0 }), re.prototype._updatePointerPosition = function(Y) {\n            var k = this._scene.getEngine().getInputElementClientRect();\n            k && (this._pointerX = Y.clientX - k.left, this._pointerY = Y.clientY - k.top, this._unTranslatedPointerX = this._pointerX, this._unTranslatedPointerY = this._pointerY);\n          }, re.prototype._processPointerMove = function(Y, k) {\n            var H = this._scene, Z = H.getEngine(), W = Z.getInputElement();\n            if (W) {\n              W.tabIndex = Z.canvasTabIndex, H.doNotHandleCursors || (W.style.cursor = H.defaultCursor);\n              var q = !!(Y && Y.hit && Y.pickedMesh);\n              q ? (H.setPointerOverMesh(Y.pickedMesh, k.pointerId), this._pointerOverMesh && this._pointerOverMesh.actionManager && this._pointerOverMesh.actionManager.hasPointerTriggers && (H.doNotHandleCursors || (this._pointerOverMesh.actionManager.hoverCursor ? W.style.cursor = this._pointerOverMesh.actionManager.hoverCursor : W.style.cursor = H.hoverCursor))) : H.setPointerOverMesh(null, k.pointerId);\n              for (var he = 0, ge = H._pointerMoveStage; he < ge.length; he++)\n                Y = ge[he].action(this._unTranslatedPointerX, this._unTranslatedPointerY, Y, q, W);\n              if (Y) {\n                var me = k.type === this._wheelEventName ? te.a.POINTERWHEEL : te.a.POINTERMOVE;\n                if (H.onPointerMove && H.onPointerMove(k, Y, me), H.onPointerObservable.hasObservers()) {\n                  var _e = new te.b(me, k, Y);\n                  this._setRayOnPointerInfo(_e), H.onPointerObservable.notifyObservers(_e, me);\n                }\n              }\n            }\n          }, re.prototype._setRayOnPointerInfo = function(Y) {\n            var k = this._scene;\n            Y.pickInfo && !Y.pickInfo._pickingUnavailable && (Y.pickInfo.ray || (Y.pickInfo.ray = k.createPickingRay(Y.event.offsetX, Y.event.offsetY, m.a.Identity(), k.activeCamera)));\n          }, re.prototype._checkPrePointerObservable = function(Y, k, H) {\n            var Z = this._scene, W = new te.d(H, k, this._unTranslatedPointerX, this._unTranslatedPointerY);\n            return Y && (W.ray = Y.ray), Z.onPrePointerObservable.notifyObservers(W, H), !!W.skipOnPointerObservable;\n          }, re.prototype.simulatePointerMove = function(Y, k) {\n            var H = new PointerEvent(\"pointermove\", k);\n            this._checkPrePointerObservable(Y, H, te.a.POINTERMOVE) || this._processPointerMove(Y, H);\n          }, re.prototype.simulatePointerDown = function(Y, k) {\n            var H = new PointerEvent(\"pointerdown\", k);\n            this._checkPrePointerObservable(Y, H, te.a.POINTERDOWN) || this._processPointerDown(Y, H);\n          }, re.prototype._processPointerDown = function(Y, k) {\n            var H = this, Z = this._scene;\n            if (Y && Y.hit && Y.pickedMesh) {\n              this._pickedDownMesh = Y.pickedMesh;\n              var W = Y.pickedMesh._getActionManagerForTrigger();\n              if (W) {\n                if (W.hasPickTriggers)\n                  switch (W.processTrigger(M.a.ACTION_OnPickDownTrigger, b.a.CreateNew(Y.pickedMesh, k)), k.button) {\n                    case 0:\n                      W.processTrigger(M.a.ACTION_OnLeftPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                      break;\n                    case 1:\n                      W.processTrigger(M.a.ACTION_OnCenterPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                      break;\n                    case 2:\n                      W.processTrigger(M.a.ACTION_OnRightPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                  }\n                W.hasSpecificTrigger(M.a.ACTION_OnLongPressTrigger) && window.setTimeout(function() {\n                  var _e = Z.pick(H._unTranslatedPointerX, H._unTranslatedPointerY, function(ye) {\n                    return ye.isPickable && ye.isVisible && ye.isReady() && ye.actionManager && ye.actionManager.hasSpecificTrigger(M.a.ACTION_OnLongPressTrigger) && ye == H._pickedDownMesh;\n                  }, !1, Z.cameraToUseForPointers);\n                  _e && _e.hit && _e.pickedMesh && W && H._totalPointersPressed !== 0 && Date.now() - H._startingPointerTime > re.LongPressDelay && !H._isPointerSwiping() && (H._startingPointerTime = 0, W.processTrigger(M.a.ACTION_OnLongPressTrigger, b.a.CreateNew(_e.pickedMesh, k)));\n                }, re.LongPressDelay);\n              }\n            } else\n              for (var q = 0, he = Z._pointerDownStage; q < he.length; q++)\n                Y = he[q].action(this._unTranslatedPointerX, this._unTranslatedPointerY, Y, k);\n            if (Y) {\n              var ge = te.a.POINTERDOWN;\n              if (Z.onPointerDown && Z.onPointerDown(k, Y, ge), Z.onPointerObservable.hasObservers()) {\n                var me = new te.b(ge, k, Y);\n                this._setRayOnPointerInfo(me), Z.onPointerObservable.notifyObservers(me, ge);\n              }\n            }\n          }, re.prototype._isPointerSwiping = function() {\n            return Math.abs(this._startingPointerPosition.x - this._pointerX) > re.DragMovementThreshold || Math.abs(this._startingPointerPosition.y - this._pointerY) > re.DragMovementThreshold;\n          }, re.prototype.simulatePointerUp = function(Y, k, H) {\n            var Z = new PointerEvent(\"pointerup\", k), W = new ae();\n            H ? W.doubleClick = !0 : W.singleClick = !0, this._checkPrePointerObservable(Y, Z, te.a.POINTERUP) || this._processPointerUp(Y, Z, W);\n          }, re.prototype._processPointerUp = function(Y, k, H) {\n            var Z = this._scene;\n            if (Y && Y && Y.pickedMesh) {\n              if (this._pickedUpMesh = Y.pickedMesh, this._pickedDownMesh === this._pickedUpMesh && (Z.onPointerPick && Z.onPointerPick(k, Y), H.singleClick && !H.ignore && Z.onPointerObservable.hasObservers())) {\n                var W = te.a.POINTERPICK, q = new te.b(W, k, Y);\n                this._setRayOnPointerInfo(q), Z.onPointerObservable.notifyObservers(q, W);\n              }\n              var he = Y.pickedMesh._getActionManagerForTrigger();\n              if (he && !H.ignore) {\n                he.processTrigger(M.a.ACTION_OnPickUpTrigger, b.a.CreateNew(Y.pickedMesh, k)), !H.hasSwiped && H.singleClick && he.processTrigger(M.a.ACTION_OnPickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n                var ge = Y.pickedMesh._getActionManagerForTrigger(M.a.ACTION_OnDoublePickTrigger);\n                H.doubleClick && ge && ge.processTrigger(M.a.ACTION_OnDoublePickTrigger, b.a.CreateNew(Y.pickedMesh, k));\n              }\n            } else if (!H.ignore)\n              for (var me = 0, _e = Z._pointerUpStage; me < _e.length; me++)\n                Y = _e[me].action(this._unTranslatedPointerX, this._unTranslatedPointerY, Y, k);\n            if (this._pickedDownMesh && this._pickedDownMesh !== this._pickedUpMesh) {\n              var ye = this._pickedDownMesh._getActionManagerForTrigger(M.a.ACTION_OnPickOutTrigger);\n              ye && ye.processTrigger(M.a.ACTION_OnPickOutTrigger, b.a.CreateNew(this._pickedDownMesh, k));\n            }\n            var Pe = 0;\n            Z.onPointerObservable.hasObservers() && (!H.ignore && !H.hasSwiped && (H.singleClick && Z.onPointerObservable.hasSpecificMask(te.a.POINTERTAP) ? Pe = te.a.POINTERTAP : H.doubleClick && Z.onPointerObservable.hasSpecificMask(te.a.POINTERDOUBLETAP) && (Pe = te.a.POINTERDOUBLETAP), Pe) && (q = new te.b(Pe, k, Y), this._setRayOnPointerInfo(q), Z.onPointerObservable.notifyObservers(q, Pe)), H.ignore || (Pe = te.a.POINTERUP, q = new te.b(Pe, k, Y), this._setRayOnPointerInfo(q), Z.onPointerObservable.notifyObservers(q, Pe))), Z.onPointerUp && !H.ignore && Z.onPointerUp(k, Y, Pe);\n          }, re.prototype.isPointerCaptured = function(Y) {\n            return Y === void 0 && (Y = 0), this._pointerCaptures[Y];\n          }, re.prototype.attachControl = function(Y, k, H, Z) {\n            var W = this;\n            Y === void 0 && (Y = !0), k === void 0 && (k = !0), H === void 0 && (H = !0), Z === void 0 && (Z = null);\n            var q = this._scene;\n            if (Z || (Z = q.getEngine().getInputElement()), Z) {\n              this._alreadyAttached && this.detachControl(), this._alreadyAttachedTo = Z;\n              var he = q.getEngine();\n              this._initActionManager = function(ye, Pe) {\n                if (!W._meshPickProceed) {\n                  var be = q.pick(W._unTranslatedPointerX, W._unTranslatedPointerY, q.pointerDownPredicate, !1, q.cameraToUseForPointers);\n                  W._currentPickResult = be, be && (ye = be.hit && be.pickedMesh ? be.pickedMesh._getActionManagerForTrigger() : null), W._meshPickProceed = !0;\n                }\n                return ye;\n              }, this._delayedSimpleClick = function(ye, Pe, be) {\n                (Date.now() - W._previousStartingPointerTime > re.DoubleClickDelay && !W._doubleClickOccured || ye !== W._previousButtonPressed) && (W._doubleClickOccured = !1, Pe.singleClick = !0, Pe.ignore = !1, be(Pe, W._currentPickResult));\n              }, this._initClickEvent = function(ye, Pe, be, Fe) {\n                var ke = new ae();\n                W._currentPickResult = null;\n                var We = null, je = ye.hasSpecificMask(te.a.POINTERPICK) || Pe.hasSpecificMask(te.a.POINTERPICK) || ye.hasSpecificMask(te.a.POINTERTAP) || Pe.hasSpecificMask(te.a.POINTERTAP) || ye.hasSpecificMask(te.a.POINTERDOUBLETAP) || Pe.hasSpecificMask(te.a.POINTERDOUBLETAP);\n                !je && de.a && (We = W._initActionManager(We, ke)) && (je = We.hasPickTriggers);\n                var He = !1;\n                if (je) {\n                  var Qe = be.button;\n                  if (ke.hasSwiped = W._isPointerSwiping(), !ke.hasSwiped) {\n                    var Ge = !re.ExclusiveDoubleClickMode;\n                    Ge || (Ge = !ye.hasSpecificMask(te.a.POINTERDOUBLETAP) && !Pe.hasSpecificMask(te.a.POINTERDOUBLETAP)) && !de.a.HasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger) && (We = W._initActionManager(We, ke)) && (Ge = !We.hasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger)), Ge ? (Date.now() - W._previousStartingPointerTime > re.DoubleClickDelay || Qe !== W._previousButtonPressed) && (ke.singleClick = !0, Fe(ke, W._currentPickResult), He = !0) : (W._previousDelayedSimpleClickTimeout = W._delayedSimpleClickTimeout, W._delayedSimpleClickTimeout = window.setTimeout(W._delayedSimpleClick.bind(W, Qe, ke, Fe), re.DoubleClickDelay));\n                    var tt = ye.hasSpecificMask(te.a.POINTERDOUBLETAP) || Pe.hasSpecificMask(te.a.POINTERDOUBLETAP);\n                    !tt && de.a.HasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger) && (We = W._initActionManager(We, ke)) && (tt = We.hasSpecificTrigger(M.a.ACTION_OnDoublePickTrigger)), tt && (Qe === W._previousButtonPressed && Date.now() - W._previousStartingPointerTime < re.DoubleClickDelay && !W._doubleClickOccured ? (ke.hasSwiped || W._isPointerSwiping() ? (W._doubleClickOccured = !1, W._previousStartingPointerTime = W._startingPointerTime, W._previousStartingPointerPosition.x = W._startingPointerPosition.x, W._previousStartingPointerPosition.y = W._startingPointerPosition.y, W._previousButtonPressed = Qe, re.ExclusiveDoubleClickMode ? (W._previousDelayedSimpleClickTimeout && clearTimeout(W._previousDelayedSimpleClickTimeout), W._previousDelayedSimpleClickTimeout = W._delayedSimpleClickTimeout, Fe(ke, W._previousPickResult)) : Fe(ke, W._currentPickResult)) : (W._previousStartingPointerTime = 0, W._doubleClickOccured = !0, ke.doubleClick = !0, ke.ignore = !1, re.ExclusiveDoubleClickMode && W._previousDelayedSimpleClickTimeout && clearTimeout(W._previousDelayedSimpleClickTimeout), W._previousDelayedSimpleClickTimeout = W._delayedSimpleClickTimeout, Fe(ke, W._currentPickResult)), He = !0) : (W._doubleClickOccured = !1, W._previousStartingPointerTime = W._startingPointerTime, W._previousStartingPointerPosition.x = W._startingPointerPosition.x, W._previousStartingPointerPosition.y = W._startingPointerPosition.y, W._previousButtonPressed = Qe));\n                  }\n                }\n                He || Fe(ke, W._currentPickResult);\n              }, this._onPointerMove = function(ye) {\n                if (ye.pointerId === void 0 && (ye.pointerId = 0), W._updatePointerPosition(ye), !W._checkPrePointerObservable(null, ye, ye.type === W._wheelEventName ? te.a.POINTERWHEEL : te.a.POINTERMOVE) && (q.cameraToUseForPointers || q.activeCamera)) {\n                  q.pointerMovePredicate || (q.pointerMovePredicate = function(be) {\n                    return be.isPickable && be.isVisible && be.isReady() && be.isEnabled() && (be.enablePointerMoveEvents || q.constantlyUpdateMeshUnderPointer || be._getActionManagerForTrigger() != null) && (!q.cameraToUseForPointers || (q.cameraToUseForPointers.layerMask & be.layerMask) != 0);\n                  });\n                  var Pe = q.pick(W._unTranslatedPointerX, W._unTranslatedPointerY, q.pointerMovePredicate, !1, q.cameraToUseForPointers);\n                  W._processPointerMove(Pe, ye);\n                }\n              }, this._onPointerDown = function(ye) {\n                if (W._totalPointersPressed++, W._pickedDownMesh = null, W._meshPickProceed = !1, ye.pointerId === void 0 && (ye.pointerId = 0), W._updatePointerPosition(ye), q.preventDefaultOnPointerDown && Z && (ye.preventDefault(), Z.focus()), W._startingPointerPosition.x = W._pointerX, W._startingPointerPosition.y = W._pointerY, W._startingPointerTime = Date.now(), !W._checkPrePointerObservable(null, ye, te.a.POINTERDOWN) && (q.cameraToUseForPointers || q.activeCamera)) {\n                  W._pointerCaptures[ye.pointerId] = !0, q.pointerDownPredicate || (q.pointerDownPredicate = function(be) {\n                    return be.isPickable && be.isVisible && be.isReady() && be.isEnabled() && (!q.cameraToUseForPointers || (q.cameraToUseForPointers.layerMask & be.layerMask) != 0);\n                  }), W._pickedDownMesh = null;\n                  var Pe = q.pick(W._unTranslatedPointerX, W._unTranslatedPointerY, q.pointerDownPredicate, !1, q.cameraToUseForPointers);\n                  W._processPointerDown(Pe, ye);\n                }\n              }, this._onPointerUp = function(ye) {\n                W._totalPointersPressed !== 0 && (W._totalPointersPressed--, W._pickedUpMesh = null, W._meshPickProceed = !1, ye.pointerId === void 0 && (ye.pointerId = 0), W._updatePointerPosition(ye), q.preventDefaultOnPointerUp && Z && (ye.preventDefault(), Z.focus()), W._initClickEvent(q.onPrePointerObservable, q.onPointerObservable, ye, function(Pe, be) {\n                  q.onPrePointerObservable.hasObservers() && !Pe.ignore && (!Pe.hasSwiped && (Pe.singleClick && q.onPrePointerObservable.hasSpecificMask(te.a.POINTERTAP) && W._checkPrePointerObservable(null, ye, te.a.POINTERTAP) || Pe.doubleClick && q.onPrePointerObservable.hasSpecificMask(te.a.POINTERDOUBLETAP) && W._checkPrePointerObservable(null, ye, te.a.POINTERDOUBLETAP)) || W._checkPrePointerObservable(null, ye, te.a.POINTERUP)) || W._pointerCaptures[ye.pointerId] && (W._pointerCaptures[ye.pointerId] = !1, (q.cameraToUseForPointers || q.activeCamera) && (q.pointerUpPredicate || (q.pointerUpPredicate = function(Fe) {\n                    return Fe.isPickable && Fe.isVisible && Fe.isReady() && Fe.isEnabled() && (!q.cameraToUseForPointers || (q.cameraToUseForPointers.layerMask & Fe.layerMask) != 0);\n                  }), !W._meshPickProceed && (de.a && de.a.HasTriggers || q.onPointerObservable.hasObservers()) && W._initActionManager(null, Pe), be || (be = W._currentPickResult), W._processPointerUp(be, ye, Pe), W._previousPickResult = W._currentPickResult));\n                }));\n              }, this._onKeyDown = function(ye) {\n                var Pe = pe.a.KEYDOWN;\n                if (q.onPreKeyboardObservable.hasObservers()) {\n                  var be = new pe.c(Pe, ye);\n                  if (q.onPreKeyboardObservable.notifyObservers(be, Pe), be.skipOnPointerObservable)\n                    return;\n                }\n                q.onKeyboardObservable.hasObservers() && (be = new pe.b(Pe, ye), q.onKeyboardObservable.notifyObservers(be, Pe)), q.actionManager && q.actionManager.processTrigger(M.a.ACTION_OnKeyDownTrigger, b.a.CreateNewFromScene(q, ye));\n              }, this._onKeyUp = function(ye) {\n                var Pe = pe.a.KEYUP;\n                if (q.onPreKeyboardObservable.hasObservers()) {\n                  var be = new pe.c(Pe, ye);\n                  if (q.onPreKeyboardObservable.notifyObservers(be, Pe), be.skipOnPointerObservable)\n                    return;\n                }\n                q.onKeyboardObservable.hasObservers() && (be = new pe.b(Pe, ye), q.onKeyboardObservable.notifyObservers(be, Pe)), q.actionManager && q.actionManager.processTrigger(M.a.ACTION_OnKeyUpTrigger, b.a.CreateNewFromScene(q, ye));\n              };\n              var ge = function() {\n                Z && !W._keyboardIsAttached && (Z.addEventListener(\"keydown\", W._onKeyDown, !1), Z.addEventListener(\"keyup\", W._onKeyUp, !1), W._keyboardIsAttached = !0);\n              };\n              this._onCanvasFocusObserver = he.onCanvasFocusObservable.add((document.activeElement === Z && ge(), ge)), this._onCanvasBlurObserver = he.onCanvasBlurObservable.add(function() {\n                Z && (Z.removeEventListener(\"keydown\", W._onKeyDown), Z.removeEventListener(\"keyup\", W._onKeyUp), W._keyboardIsAttached = !1);\n              }), ge();\n              var me = _.b.GetPointerPrefix(he);\n              if (H && (Z.addEventListener(me + \"move\", this._onPointerMove, !1), this._wheelEventName = \"onwheel\" in document.createElement(\"div\") ? \"wheel\" : document.onmousewheel !== void 0 ? \"mousewheel\" : \"DOMMouseScroll\", Z.addEventListener(this._wheelEventName, this._onPointerMove, !1)), k && Z.addEventListener(me + \"down\", this._onPointerDown, !1), Y) {\n                var _e = q.getEngine().getHostWindow();\n                _e && _e.addEventListener(me + \"up\", this._onPointerUp, !1);\n              }\n              this._alreadyAttached = !0;\n            }\n          }, re.prototype.detachControl = function() {\n            var Y = this._scene.getEngine(), k = _.b.GetPointerPrefix(Y);\n            this._alreadyAttachedTo && this._alreadyAttached && (this._alreadyAttachedTo.removeEventListener(k + \"move\", this._onPointerMove), this._alreadyAttachedTo.removeEventListener(this._wheelEventName, this._onPointerMove), this._alreadyAttachedTo.removeEventListener(k + \"down\", this._onPointerDown), window.removeEventListener(k + \"up\", this._onPointerUp), this._onCanvasBlurObserver && Y.onCanvasBlurObservable.remove(this._onCanvasBlurObserver), this._onCanvasFocusObserver && Y.onCanvasFocusObservable.remove(this._onCanvasFocusObserver), this._alreadyAttachedTo.removeEventListener(\"keydown\", this._onKeyDown), this._alreadyAttachedTo.removeEventListener(\"keyup\", this._onKeyUp), this._scene.doNotHandleCursors || (this._alreadyAttachedTo.style.cursor = this._scene.defaultCursor), this._alreadyAttached = !1);\n          }, re.prototype.setPointerOverMesh = function(Y, k) {\n            if (k === void 0 && (k = 0), k < 0 && (k = 0), this._meshUnderPointerId[k] !== Y) {\n              var H, Z = this._meshUnderPointerId[k];\n              Z && (H = Z._getActionManagerForTrigger(M.a.ACTION_OnPointerOutTrigger)) && H.processTrigger(M.a.ACTION_OnPointerOutTrigger, b.a.CreateNew(Z, void 0, { pointerId: k })), this._meshUnderPointerId[k] = Y, this._pointerOverMesh = Y, (Z = this._meshUnderPointerId[k]) && (H = Z._getActionManagerForTrigger(M.a.ACTION_OnPointerOverTrigger)) && H.processTrigger(M.a.ACTION_OnPointerOverTrigger, b.a.CreateNew(Z, void 0, { pointerId: k }));\n            }\n          }, re.prototype.getPointerOverMesh = function() {\n            return this._pointerOverMesh;\n          }, re.DragMovementThreshold = 10, re.LongPressDelay = 500, re.DoubleClickDelay = 300, re.ExclusiveDoubleClickMode = !1, re;\n        }(), K = f(55), $ = f(9), L = f(90), G = f(152), Q = f(56), oe = function(re) {\n          function Y(k, H) {\n            var Z = re.call(this) || this;\n            Z._inputManager = new ee(Z), Z.cameraToUseForPointers = null, Z._isScene = !0, Z._blockEntityCollection = !1, Z.autoClear = !0, Z.autoClearDepthAndStencil = !0, Z.clearColor = new $.b(0.2, 0.2, 0.3, 1), Z.ambientColor = new $.a(0, 0, 0), Z._environmentIntensity = 1, Z._forceWireframe = !1, Z._skipFrustumClipping = !1, Z._forcePointsCloud = !1, Z.animationsEnabled = !0, Z._animationPropertiesOverride = null, Z.useConstantAnimationDeltaTime = !1, Z.constantlyUpdateMeshUnderPointer = !1, Z.hoverCursor = \"pointer\", Z.defaultCursor = \"\", Z.doNotHandleCursors = !1, Z.preventDefaultOnPointerDown = !0, Z.preventDefaultOnPointerUp = !0, Z.metadata = null, Z.reservedDataStore = null, Z.disableOfflineSupportExceptionRules = new Array(), Z.onDisposeObservable = new u.c(), Z._onDisposeObserver = null, Z.onBeforeRenderObservable = new u.c(), Z._onBeforeRenderObserver = null, Z.onAfterRenderObservable = new u.c(), Z.onAfterRenderCameraObservable = new u.c(), Z._onAfterRenderObserver = null, Z.onBeforeAnimationsObservable = new u.c(), Z.onAfterAnimationsObservable = new u.c(), Z.onBeforeDrawPhaseObservable = new u.c(), Z.onAfterDrawPhaseObservable = new u.c(), Z.onReadyObservable = new u.c(), Z.onBeforeCameraRenderObservable = new u.c(), Z._onBeforeCameraRenderObserver = null, Z.onAfterCameraRenderObservable = new u.c(), Z._onAfterCameraRenderObserver = null, Z.onBeforeActiveMeshesEvaluationObservable = new u.c(), Z.onAfterActiveMeshesEvaluationObservable = new u.c(), Z.onBeforeParticlesRenderingObservable = new u.c(), Z.onAfterParticlesRenderingObservable = new u.c(), Z.onDataLoadedObservable = new u.c(), Z.onNewCameraAddedObservable = new u.c(), Z.onCameraRemovedObservable = new u.c(), Z.onNewLightAddedObservable = new u.c(), Z.onLightRemovedObservable = new u.c(), Z.onNewGeometryAddedObservable = new u.c(), Z.onGeometryRemovedObservable = new u.c(), Z.onNewTransformNodeAddedObservable = new u.c(), Z.onTransformNodeRemovedObservable = new u.c(), Z.onNewMeshAddedObservable = new u.c(), Z.onMeshRemovedObservable = new u.c(), Z.onNewSkeletonAddedObservable = new u.c(), Z.onSkeletonRemovedObservable = new u.c(), Z.onNewMaterialAddedObservable = new u.c(), Z.onNewMultiMaterialAddedObservable = new u.c(), Z.onMaterialRemovedObservable = new u.c(), Z.onMultiMaterialRemovedObservable = new u.c(), Z.onNewTextureAddedObservable = new u.c(), Z.onTextureRemovedObservable = new u.c(), Z.onBeforeRenderTargetsRenderObservable = new u.c(), Z.onAfterRenderTargetsRenderObservable = new u.c(), Z.onBeforeStepObservable = new u.c(), Z.onAfterStepObservable = new u.c(), Z.onActiveCameraChanged = new u.c(), Z.onBeforeRenderingGroupObservable = new u.c(), Z.onAfterRenderingGroupObservable = new u.c(), Z.onMeshImportedObservable = new u.c(), Z.onAnimationFileImportedObservable = new u.c(), Z._registeredForLateAnimationBindings = new I.b(256), Z.onPrePointerObservable = new u.c(), Z.onPointerObservable = new u.c(), Z.onPreKeyboardObservable = new u.c(), Z.onKeyboardObservable = new u.c(), Z._useRightHandedSystem = !1, Z._timeAccumulator = 0, Z._currentStepId = 0, Z._currentInternalStep = 0, Z._fogEnabled = !0, Z._fogMode = Y.FOGMODE_NONE, Z.fogColor = new $.a(0.2, 0.2, 0.3), Z.fogDensity = 0.1, Z.fogStart = 0, Z.fogEnd = 1e3, Z.prePass = !1, Z._shadowsEnabled = !0, Z._lightsEnabled = !0, Z.activeCameras = new Array(), Z._texturesEnabled = !0, Z.physicsEnabled = !0, Z.particlesEnabled = !0, Z.spritesEnabled = !0, Z._skeletonsEnabled = !0, Z.lensFlaresEnabled = !0, Z.collisionsEnabled = !0, Z.gravity = new m.e(0, -9.807, 0), Z.postProcessesEnabled = !0, Z.renderTargetsEnabled = !0, Z.dumpNextRenderTargets = !1, Z.customRenderTargets = new Array(), Z.importedMeshesFiles = new Array(), Z.probesEnabled = !0, Z._meshesForIntersections = new I.b(256), Z.proceduralTexturesEnabled = !0, Z._totalVertices = new K.a(), Z._activeIndices = new K.a(), Z._activeParticles = new K.a(), Z._activeBones = new K.a(), Z._animationTime = 0, Z.animationTimeScale = 1, Z._renderId = 0, Z._frameId = 0, Z._executeWhenReadyTimeoutId = -1, Z._intermediateRendering = !1, Z._viewUpdateFlag = -1, Z._projectionUpdateFlag = -1, Z._toBeDisposed = new Array(256), Z._activeRequests = new Array(), Z._pendingData = new Array(), Z._isDisposed = !1, Z.dispatchAllSubMeshesOfActiveMeshes = !1, Z._activeMeshes = new I.a(256), Z._processedMaterials = new I.a(256), Z._renderTargets = new I.b(256), Z._activeParticleSystems = new I.a(256), Z._activeSkeletons = new I.b(32), Z._softwareSkinnedMeshes = new I.b(32), Z._activeAnimatables = new Array(), Z._transformMatrix = m.a.Zero(), Z.requireLightSorting = !1, Z._components = [], Z._serializableComponents = [], Z._transientComponents = [], Z._beforeCameraUpdateStage = N.b.Create(), Z._beforeClearStage = N.b.Create(), Z._gatherRenderTargetsStage = N.b.Create(), Z._gatherActiveCameraRenderTargetsStage = N.b.Create(), Z._isReadyForMeshStage = N.b.Create(), Z._beforeEvaluateActiveMeshStage = N.b.Create(), Z._evaluateSubMeshStage = N.b.Create(), Z._preActiveMeshStage = N.b.Create(), Z._cameraDrawRenderTargetStage = N.b.Create(), Z._beforeCameraDrawStage = N.b.Create(), Z._beforeRenderTargetDrawStage = N.b.Create(), Z._beforeRenderingGroupDrawStage = N.b.Create(), Z._beforeRenderingMeshStage = N.b.Create(), Z._afterRenderingMeshStage = N.b.Create(), Z._afterRenderingGroupDrawStage = N.b.Create(), Z._afterCameraDrawStage = N.b.Create(), Z._afterRenderTargetDrawStage = N.b.Create(), Z._afterRenderStage = N.b.Create(), Z._pointerMoveStage = N.b.Create(), Z._pointerDownStage = N.b.Create(), Z._pointerUpStage = N.b.Create(), Z.geometriesByUniqueId = null, Z._defaultMeshCandidates = { data: [], length: 0 }, Z._defaultSubMeshCandidates = { data: [], length: 0 }, Z._preventFreeActiveMeshesAndRenderingGroups = !1, Z._activeMeshesFrozen = !1, Z._skipEvaluateActiveMeshesCompletely = !1, Z._allowPostProcessClearColor = !0, Z.getDeterministicFrameTime = function() {\n              return Z._engine.getTimeStep();\n            }, Z._blockMaterialDirtyMechanism = !1;\n            var W = Object(V.a)({ useGeometryUniqueIdsMap: !0, useMaterialMeshMap: !0, useClonedMeshMap: !0, virtual: !1 }, H);\n            return Z._engine = k || j.a.LastCreatedEngine, W.virtual || (j.a._LastCreatedScene = Z, Z._engine.scenes.push(Z)), Z._uid = null, Z._renderingManager = new w.b(Z), D.a && (Z.postProcessManager = new D.a(Z)), U.a.IsWindowObjectExist() && Z.attachControl(), Z._createUbo(), g.a && (Z._imageProcessingConfiguration = new g.a()), Z.setDefaultCandidateProviders(), W.useGeometryUniqueIdsMap && (Z.geometriesByUniqueId = {}), Z.useMaterialMeshMap = W.useMaterialMeshMap, Z.useClonedMeshMap = W.useClonedMeshMap, H && H.virtual || Z._engine.onNewSceneAddedObservable.notifyObservers(Z), Z;\n          }\n          return Object(V.d)(Y, re), Y.DefaultMaterialFactory = function(k) {\n            throw ne.a.WarnImport(\"StandardMaterial\");\n          }, Y.CollisionCoordinatorFactory = function() {\n            throw ne.a.WarnImport(\"DefaultCollisionCoordinator\");\n          }, Object.defineProperty(Y.prototype, \"environmentTexture\", { get: function() {\n            return this._environmentTexture;\n          }, set: function(k) {\n            this._environmentTexture !== k && (this._environmentTexture = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"environmentIntensity\", { get: function() {\n            return this._environmentIntensity;\n          }, set: function(k) {\n            this._environmentIntensity !== k && (this._environmentIntensity = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"forceWireframe\", { get: function() {\n            return this._forceWireframe;\n          }, set: function(k) {\n            this._forceWireframe !== k && (this._forceWireframe = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"skipFrustumClipping\", { get: function() {\n            return this._skipFrustumClipping;\n          }, set: function(k) {\n            this._skipFrustumClipping !== k && (this._skipFrustumClipping = k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"forcePointsCloud\", { get: function() {\n            return this._forcePointsCloud;\n          }, set: function(k) {\n            this._forcePointsCloud !== k && (this._forcePointsCloud = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._animationPropertiesOverride;\n          }, set: function(k) {\n            this._animationPropertiesOverride = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"onDispose\", { set: function(k) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"beforeRender\", { set: function(k) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), k && (this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(k));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"afterRender\", { set: function(k) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), k && (this._onAfterRenderObserver = this.onAfterRenderObservable.add(k));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"beforeCameraRender\", { set: function(k) {\n            this._onBeforeCameraRenderObserver && this.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = this.onBeforeCameraRenderObservable.add(k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"afterCameraRender\", { set: function(k) {\n            this._onAfterCameraRenderObserver && this.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = this.onAfterCameraRenderObservable.add(k);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"unTranslatedPointer\", { get: function() {\n            return this._inputManager.unTranslatedPointer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"DragMovementThreshold\", { get: function() {\n            return ee.DragMovementThreshold;\n          }, set: function(k) {\n            ee.DragMovementThreshold = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"LongPressDelay\", { get: function() {\n            return ee.LongPressDelay;\n          }, set: function(k) {\n            ee.LongPressDelay = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"DoubleClickDelay\", { get: function() {\n            return ee.DoubleClickDelay;\n          }, set: function(k) {\n            ee.DoubleClickDelay = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y, \"ExclusiveDoubleClickMode\", { get: function() {\n            return ee.ExclusiveDoubleClickMode;\n          }, set: function(k) {\n            ee.ExclusiveDoubleClickMode = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"useRightHandedSystem\", { get: function() {\n            return this._useRightHandedSystem;\n          }, set: function(k) {\n            this._useRightHandedSystem !== k && (this._useRightHandedSystem = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Y.prototype.setStepId = function(k) {\n            this._currentStepId = k;\n          }, Y.prototype.getStepId = function() {\n            return this._currentStepId;\n          }, Y.prototype.getInternalStep = function() {\n            return this._currentInternalStep;\n          }, Object.defineProperty(Y.prototype, \"fogEnabled\", { get: function() {\n            return this._fogEnabled;\n          }, set: function(k) {\n            this._fogEnabled !== k && (this._fogEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"fogMode\", { get: function() {\n            return this._fogMode;\n          }, set: function(k) {\n            this._fogMode !== k && (this._fogMode = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"shadowsEnabled\", { get: function() {\n            return this._shadowsEnabled;\n          }, set: function(k) {\n            this._shadowsEnabled !== k && (this._shadowsEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_LightDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"lightsEnabled\", { get: function() {\n            return this._lightsEnabled;\n          }, set: function(k) {\n            this._lightsEnabled !== k && (this._lightsEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_LightDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"activeCamera\", { get: function() {\n            return this._activeCamera;\n          }, set: function(k) {\n            k !== this._activeCamera && (this._activeCamera = k, this.onActiveCameraChanged.notifyObservers(this));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"defaultMaterial\", { get: function() {\n            return this._defaultMaterial || (this._defaultMaterial = Y.DefaultMaterialFactory(this)), this._defaultMaterial;\n          }, set: function(k) {\n            this._defaultMaterial = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"texturesEnabled\", { get: function() {\n            return this._texturesEnabled;\n          }, set: function(k) {\n            this._texturesEnabled !== k && (this._texturesEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"skeletonsEnabled\", { get: function() {\n            return this._skeletonsEnabled;\n          }, set: function(k) {\n            this._skeletonsEnabled !== k && (this._skeletonsEnabled = k, this.markAllMaterialsAsDirty(M.a.MATERIAL_AttributesDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"collisionCoordinator\", { get: function() {\n            return this._collisionCoordinator || (this._collisionCoordinator = Y.CollisionCoordinatorFactory(), this._collisionCoordinator.init(this)), this._collisionCoordinator;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"frustumPlanes\", { get: function() {\n            return this._frustumPlanes;\n          }, enumerable: !1, configurable: !0 }), Y.prototype._registerTransientComponents = function() {\n            if (this._transientComponents.length > 0) {\n              for (var k = 0, H = this._transientComponents; k < H.length; k++)\n                H[k].register();\n              this._transientComponents = [];\n            }\n          }, Y.prototype._addComponent = function(k) {\n            this._components.push(k), this._transientComponents.push(k);\n            var H = k;\n            H.addFromContainer && H.serialize && this._serializableComponents.push(H);\n          }, Y.prototype._getComponent = function(k) {\n            for (var H = 0, Z = this._components; H < Z.length; H++) {\n              var W = Z[H];\n              if (W.name === k)\n                return W;\n            }\n            return null;\n          }, Y.prototype.getClassName = function() {\n            return \"Scene\";\n          }, Y.prototype._getDefaultMeshCandidates = function() {\n            return this._defaultMeshCandidates.data = this.meshes, this._defaultMeshCandidates.length = this.meshes.length, this._defaultMeshCandidates;\n          }, Y.prototype._getDefaultSubMeshCandidates = function(k) {\n            return this._defaultSubMeshCandidates.data = k.subMeshes, this._defaultSubMeshCandidates.length = k.subMeshes.length, this._defaultSubMeshCandidates;\n          }, Y.prototype.setDefaultCandidateProviders = function() {\n            this.getActiveMeshCandidates = this._getDefaultMeshCandidates.bind(this), this.getActiveSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getIntersectingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this), this.getCollidingSubMeshCandidates = this._getDefaultSubMeshCandidates.bind(this);\n          }, Object.defineProperty(Y.prototype, \"meshUnderPointer\", { get: function() {\n            return this._inputManager.meshUnderPointer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"pointerX\", { get: function() {\n            return this._inputManager.pointerX;\n          }, set: function(k) {\n            this._inputManager.pointerX = k;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(Y.prototype, \"pointerY\", { get: function() {\n            return this._inputManager.pointerY;\n          }, set: function(k) {\n            this._inputManager.pointerY = k;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getCachedMaterial = function() {\n            return this._cachedMaterial;\n          }, Y.prototype.getCachedEffect = function() {\n            return this._cachedEffect;\n          }, Y.prototype.getCachedVisibility = function() {\n            return this._cachedVisibility;\n          }, Y.prototype.isCachedMaterialInvalid = function(k, H, Z) {\n            return Z === void 0 && (Z = 1), this._cachedEffect !== H || this._cachedMaterial !== k || this._cachedVisibility !== Z;\n          }, Y.prototype.getEngine = function() {\n            return this._engine;\n          }, Y.prototype.getTotalVertices = function() {\n            return this._totalVertices.current;\n          }, Object.defineProperty(Y.prototype, \"totalVerticesPerfCounter\", { get: function() {\n            return this._totalVertices;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveIndices = function() {\n            return this._activeIndices.current;\n          }, Object.defineProperty(Y.prototype, \"totalActiveIndicesPerfCounter\", { get: function() {\n            return this._activeIndices;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveParticles = function() {\n            return this._activeParticles.current;\n          }, Object.defineProperty(Y.prototype, \"activeParticlesPerfCounter\", { get: function() {\n            return this._activeParticles;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveBones = function() {\n            return this._activeBones.current;\n          }, Object.defineProperty(Y.prototype, \"activeBonesPerfCounter\", { get: function() {\n            return this._activeBones;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.getActiveMeshes = function() {\n            return this._activeMeshes;\n          }, Y.prototype.getAnimationRatio = function() {\n            return this._animationRatio !== void 0 ? this._animationRatio : 1;\n          }, Y.prototype.getRenderId = function() {\n            return this._renderId;\n          }, Y.prototype.getFrameId = function() {\n            return this._frameId;\n          }, Y.prototype.incrementRenderId = function() {\n            this._renderId++;\n          }, Y.prototype._createUbo = function() {\n            this._sceneUbo = new l.a(this._engine, void 0, !0), this._sceneUbo.addUniform(\"viewProjection\", 16), this._sceneUbo.addUniform(\"view\", 16);\n          }, Y.prototype.simulatePointerMove = function(k, H) {\n            return this._inputManager.simulatePointerMove(k, H), this;\n          }, Y.prototype.simulatePointerDown = function(k, H) {\n            return this._inputManager.simulatePointerDown(k, H), this;\n          }, Y.prototype.simulatePointerUp = function(k, H, Z) {\n            return this._inputManager.simulatePointerUp(k, H, Z), this;\n          }, Y.prototype.isPointerCaptured = function(k) {\n            return k === void 0 && (k = 0), this._inputManager.isPointerCaptured(k);\n          }, Y.prototype.attachControl = function(k, H, Z) {\n            k === void 0 && (k = !0), H === void 0 && (H = !0), Z === void 0 && (Z = !0), this._inputManager.attachControl(k, H, Z);\n          }, Y.prototype.detachControl = function() {\n            this._inputManager.detachControl();\n          }, Y.prototype.isReady = function() {\n            if (this._isDisposed)\n              return !1;\n            var k, H = this.getEngine();\n            if (!H.areAllEffectsReady() || this._pendingData.length > 0)\n              return !1;\n            for (k = 0; k < this.meshes.length; k++) {\n              var Z = this.meshes[k];\n              if (Z.isEnabled() && Z.subMeshes && Z.subMeshes.length !== 0) {\n                if (!Z.isReady(!0))\n                  return !1;\n                for (var W = Z.hasThinInstances || Z.getClassName() === \"InstancedMesh\" || Z.getClassName() === \"InstancedLinesMesh\" || H.getCaps().instancedArrays && Z.instances.length > 0, q = 0, he = this._isReadyForMeshStage; q < he.length; q++)\n                  if (!he[q].action(Z, W))\n                    return !1;\n              }\n            }\n            for (k = 0; k < this.geometries.length; k++)\n              if (this.geometries[k].delayLoadState === M.a.DELAYLOADSTATE_LOADING)\n                return !1;\n            if (this.activeCameras && this.activeCameras.length > 0) {\n              for (var ge = 0, me = this.activeCameras; ge < me.length; ge++)\n                if (!me[ge].isReady(!0))\n                  return !1;\n            } else if (this.activeCamera && !this.activeCamera.isReady(!0))\n              return !1;\n            for (var _e = 0, ye = this.particleSystems; _e < ye.length; _e++)\n              if (!ye[_e].isReady())\n                return !1;\n            return !0;\n          }, Y.prototype.resetCachedMaterial = function() {\n            this._cachedMaterial = null, this._cachedEffect = null, this._cachedVisibility = null;\n          }, Y.prototype.registerBeforeRender = function(k) {\n            this.onBeforeRenderObservable.add(k);\n          }, Y.prototype.unregisterBeforeRender = function(k) {\n            this.onBeforeRenderObservable.removeCallback(k);\n          }, Y.prototype.registerAfterRender = function(k) {\n            this.onAfterRenderObservable.add(k);\n          }, Y.prototype.unregisterAfterRender = function(k) {\n            this.onAfterRenderObservable.removeCallback(k);\n          }, Y.prototype._executeOnceBeforeRender = function(k) {\n            var H = this, Z = function() {\n              k(), setTimeout(function() {\n                H.unregisterBeforeRender(Z);\n              });\n            };\n            this.registerBeforeRender(Z);\n          }, Y.prototype.executeOnceBeforeRender = function(k, H) {\n            var Z = this;\n            H !== void 0 ? setTimeout(function() {\n              Z._executeOnceBeforeRender(k);\n            }, H) : this._executeOnceBeforeRender(k);\n          }, Y.prototype._addPendingData = function(k) {\n            this._pendingData.push(k);\n          }, Y.prototype._removePendingData = function(k) {\n            var H = this.isLoading, Z = this._pendingData.indexOf(k);\n            Z !== -1 && this._pendingData.splice(Z, 1), H && !this.isLoading && this.onDataLoadedObservable.notifyObservers(this);\n          }, Y.prototype.getWaitingItemsCount = function() {\n            return this._pendingData.length;\n          }, Object.defineProperty(Y.prototype, \"isLoading\", { get: function() {\n            return this._pendingData.length > 0;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.executeWhenReady = function(k) {\n            var H = this;\n            this.onReadyObservable.add(k), this._executeWhenReadyTimeoutId === -1 && (this._executeWhenReadyTimeoutId = setTimeout(function() {\n              H._checkIsReady();\n            }, 150));\n          }, Y.prototype.whenReadyAsync = function() {\n            var k = this;\n            return new Promise(function(H) {\n              k.executeWhenReady(function() {\n                H();\n              });\n            });\n          }, Y.prototype._checkIsReady = function() {\n            var k = this;\n            return this._registerTransientComponents(), this.isReady() ? (this.onReadyObservable.notifyObservers(this), this.onReadyObservable.clear(), void (this._executeWhenReadyTimeoutId = -1)) : this._isDisposed ? (this.onReadyObservable.clear(), void (this._executeWhenReadyTimeoutId = -1)) : void (this._executeWhenReadyTimeoutId = setTimeout(function() {\n              k._checkIsReady();\n            }, 150));\n          }, Object.defineProperty(Y.prototype, \"animatables\", { get: function() {\n            return this._activeAnimatables;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.resetLastAnimationTimeFrame = function() {\n            this._animationTimeLast = C.a.Now;\n          }, Y.prototype.getViewMatrix = function() {\n            return this._viewMatrix;\n          }, Y.prototype.getProjectionMatrix = function() {\n            return this._projectionMatrix;\n          }, Y.prototype.getTransformMatrix = function() {\n            return this._transformMatrix;\n          }, Y.prototype.setTransformMatrix = function(k, H, Z, W) {\n            this._viewUpdateFlag === k.updateFlag && this._projectionUpdateFlag === H.updateFlag || (this._viewUpdateFlag = k.updateFlag, this._projectionUpdateFlag = H.updateFlag, this._viewMatrix = k, this._projectionMatrix = H, this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._frustumPlanes ? L.a.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = L.a.GetPlanes(this._transformMatrix), this._multiviewSceneUbo && this._multiviewSceneUbo.useUbo ? this._updateMultiviewUbo(Z, W) : this._sceneUbo.useUbo && (this._sceneUbo.updateMatrix(\"viewProjection\", this._transformMatrix), this._sceneUbo.updateMatrix(\"view\", this._viewMatrix), this._sceneUbo.update()));\n          }, Y.prototype.getSceneUniformBuffer = function() {\n            return this._multiviewSceneUbo ? this._multiviewSceneUbo : this._sceneUbo;\n          }, Y.prototype.getUniqueId = function() {\n            return G.a.UniqueId;\n          }, Y.prototype.addMesh = function(k, H) {\n            var Z = this;\n            H === void 0 && (H = !1), this._blockEntityCollection || (this.meshes.push(k), k._resyncLightSources(), k.parent || k._addToSceneRootNodes(), this.onNewMeshAddedObservable.notifyObservers(k), H && k.getChildMeshes().forEach(function(W) {\n              Z.addMesh(W);\n            }));\n          }, Y.prototype.removeMesh = function(k, H) {\n            var Z = this;\n            H === void 0 && (H = !1);\n            var W = this.meshes.indexOf(k);\n            return W !== -1 && (this.meshes[W] = this.meshes[this.meshes.length - 1], this.meshes.pop(), k.parent || k._removeFromSceneRootNodes()), this.onMeshRemovedObservable.notifyObservers(k), H && k.getChildMeshes().forEach(function(q) {\n              Z.removeMesh(q);\n            }), W;\n          }, Y.prototype.addTransformNode = function(k) {\n            this._blockEntityCollection || (k._indexInSceneTransformNodesArray = this.transformNodes.length, this.transformNodes.push(k), k.parent || k._addToSceneRootNodes(), this.onNewTransformNodeAddedObservable.notifyObservers(k));\n          }, Y.prototype.removeTransformNode = function(k) {\n            var H = k._indexInSceneTransformNodesArray;\n            if (H !== -1) {\n              if (H !== this.transformNodes.length - 1) {\n                var Z = this.transformNodes[this.transformNodes.length - 1];\n                this.transformNodes[H] = Z, Z._indexInSceneTransformNodesArray = H;\n              }\n              k._indexInSceneTransformNodesArray = -1, this.transformNodes.pop(), k.parent || k._removeFromSceneRootNodes();\n            }\n            return this.onTransformNodeRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeSkeleton = function(k) {\n            var H = this.skeletons.indexOf(k);\n            return H !== -1 && (this.skeletons.splice(H, 1), this.onSkeletonRemovedObservable.notifyObservers(k)), H;\n          }, Y.prototype.removeMorphTargetManager = function(k) {\n            var H = this.morphTargetManagers.indexOf(k);\n            return H !== -1 && this.morphTargetManagers.splice(H, 1), H;\n          }, Y.prototype.removeLight = function(k) {\n            var H = this.lights.indexOf(k);\n            if (H !== -1) {\n              for (var Z = 0, W = this.meshes; Z < W.length; Z++)\n                W[Z]._removeLightSource(k, !1);\n              this.lights.splice(H, 1), this.sortLightsByPriority(), k.parent || k._removeFromSceneRootNodes();\n            }\n            return this.onLightRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeCamera = function(k) {\n            var H = this.cameras.indexOf(k);\n            if (H !== -1 && (this.cameras.splice(H, 1), k.parent || k._removeFromSceneRootNodes()), this.activeCameras) {\n              var Z = this.activeCameras.indexOf(k);\n              Z !== -1 && this.activeCameras.splice(Z, 1);\n            }\n            return this.activeCamera === k && (this.cameras.length > 0 ? this.activeCamera = this.cameras[0] : this.activeCamera = null), this.onCameraRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeParticleSystem = function(k) {\n            var H = this.particleSystems.indexOf(k);\n            return H !== -1 && this.particleSystems.splice(H, 1), H;\n          }, Y.prototype.removeAnimation = function(k) {\n            var H = this.animations.indexOf(k);\n            return H !== -1 && this.animations.splice(H, 1), H;\n          }, Y.prototype.stopAnimation = function(k, H, Z) {\n          }, Y.prototype.removeAnimationGroup = function(k) {\n            var H = this.animationGroups.indexOf(k);\n            return H !== -1 && this.animationGroups.splice(H, 1), H;\n          }, Y.prototype.removeMultiMaterial = function(k) {\n            var H = this.multiMaterials.indexOf(k);\n            return H !== -1 && this.multiMaterials.splice(H, 1), this.onMultiMaterialRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeMaterial = function(k) {\n            var H = k._indexInSceneMaterialArray;\n            if (H !== -1 && H < this.materials.length) {\n              if (H !== this.materials.length - 1) {\n                var Z = this.materials[this.materials.length - 1];\n                this.materials[H] = Z, Z._indexInSceneMaterialArray = H;\n              }\n              k._indexInSceneMaterialArray = -1, this.materials.pop();\n            }\n            return this.onMaterialRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.removeActionManager = function(k) {\n            var H = this.actionManagers.indexOf(k);\n            return H !== -1 && this.actionManagers.splice(H, 1), H;\n          }, Y.prototype.removeTexture = function(k) {\n            var H = this.textures.indexOf(k);\n            return H !== -1 && this.textures.splice(H, 1), this.onTextureRemovedObservable.notifyObservers(k), H;\n          }, Y.prototype.addLight = function(k) {\n            if (!this._blockEntityCollection) {\n              this.lights.push(k), this.sortLightsByPriority(), k.parent || k._addToSceneRootNodes();\n              for (var H = 0, Z = this.meshes; H < Z.length; H++) {\n                var W = Z[H];\n                W.lightSources.indexOf(k) === -1 && (W.lightSources.push(k), W._resyncLightSources());\n              }\n              this.onNewLightAddedObservable.notifyObservers(k);\n            }\n          }, Y.prototype.sortLightsByPriority = function() {\n            this.requireLightSorting && this.lights.sort(h.a.CompareLightsPriority);\n          }, Y.prototype.addCamera = function(k) {\n            this._blockEntityCollection || (this.cameras.push(k), this.onNewCameraAddedObservable.notifyObservers(k), k.parent || k._addToSceneRootNodes());\n          }, Y.prototype.addSkeleton = function(k) {\n            this._blockEntityCollection || (this.skeletons.push(k), this.onNewSkeletonAddedObservable.notifyObservers(k));\n          }, Y.prototype.addParticleSystem = function(k) {\n            this._blockEntityCollection || this.particleSystems.push(k);\n          }, Y.prototype.addAnimation = function(k) {\n            this._blockEntityCollection || this.animations.push(k);\n          }, Y.prototype.addAnimationGroup = function(k) {\n            this._blockEntityCollection || this.animationGroups.push(k);\n          }, Y.prototype.addMultiMaterial = function(k) {\n            this._blockEntityCollection || (this.multiMaterials.push(k), this.onNewMultiMaterialAddedObservable.notifyObservers(k));\n          }, Y.prototype.addMaterial = function(k) {\n            this._blockEntityCollection || (k._indexInSceneMaterialArray = this.materials.length, this.materials.push(k), this.onNewMaterialAddedObservable.notifyObservers(k));\n          }, Y.prototype.addMorphTargetManager = function(k) {\n            this._blockEntityCollection || this.morphTargetManagers.push(k);\n          }, Y.prototype.addGeometry = function(k) {\n            this._blockEntityCollection || (this.geometriesByUniqueId && (this.geometriesByUniqueId[k.uniqueId] = this.geometries.length), this.geometries.push(k));\n          }, Y.prototype.addActionManager = function(k) {\n            this.actionManagers.push(k);\n          }, Y.prototype.addTexture = function(k) {\n            this._blockEntityCollection || (this.textures.push(k), this.onNewTextureAddedObservable.notifyObservers(k));\n          }, Y.prototype.switchActiveCamera = function(k, H) {\n            H === void 0 && (H = !0), this._engine.getInputElement() && (this.activeCamera && this.activeCamera.detachControl(), this.activeCamera = k, H && k.attachControl());\n          }, Y.prototype.setActiveCameraByID = function(k) {\n            var H = this.getCameraByID(k);\n            return H ? (this.activeCamera = H, H) : null;\n          }, Y.prototype.setActiveCameraByName = function(k) {\n            var H = this.getCameraByName(k);\n            return H ? (this.activeCamera = H, H) : null;\n          }, Y.prototype.getAnimationGroupByName = function(k) {\n            for (var H = 0; H < this.animationGroups.length; H++)\n              if (this.animationGroups[H].name === k)\n                return this.animationGroups[H];\n            return null;\n          }, Y.prototype.getMaterialByUniqueID = function(k) {\n            for (var H = 0; H < this.materials.length; H++)\n              if (this.materials[H].uniqueId === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getMaterialByID = function(k) {\n            for (var H = 0; H < this.materials.length; H++)\n              if (this.materials[H].id === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getLastMaterialByID = function(k) {\n            for (var H = this.materials.length - 1; H >= 0; H--)\n              if (this.materials[H].id === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getMaterialByName = function(k) {\n            for (var H = 0; H < this.materials.length; H++)\n              if (this.materials[H].name === k)\n                return this.materials[H];\n            return null;\n          }, Y.prototype.getTextureByUniqueID = function(k) {\n            for (var H = 0; H < this.textures.length; H++)\n              if (this.textures[H].uniqueId === k)\n                return this.textures[H];\n            return null;\n          }, Y.prototype.getCameraByID = function(k) {\n            for (var H = 0; H < this.cameras.length; H++)\n              if (this.cameras[H].id === k)\n                return this.cameras[H];\n            return null;\n          }, Y.prototype.getCameraByUniqueID = function(k) {\n            for (var H = 0; H < this.cameras.length; H++)\n              if (this.cameras[H].uniqueId === k)\n                return this.cameras[H];\n            return null;\n          }, Y.prototype.getCameraByName = function(k) {\n            for (var H = 0; H < this.cameras.length; H++)\n              if (this.cameras[H].name === k)\n                return this.cameras[H];\n            return null;\n          }, Y.prototype.getBoneByID = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              for (var Z = this.skeletons[H], W = 0; W < Z.bones.length; W++)\n                if (Z.bones[W].id === k)\n                  return Z.bones[W];\n            return null;\n          }, Y.prototype.getBoneByName = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              for (var Z = this.skeletons[H], W = 0; W < Z.bones.length; W++)\n                if (Z.bones[W].name === k)\n                  return Z.bones[W];\n            return null;\n          }, Y.prototype.getLightByName = function(k) {\n            for (var H = 0; H < this.lights.length; H++)\n              if (this.lights[H].name === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getLightByID = function(k) {\n            for (var H = 0; H < this.lights.length; H++)\n              if (this.lights[H].id === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getLightByUniqueID = function(k) {\n            for (var H = 0; H < this.lights.length; H++)\n              if (this.lights[H].uniqueId === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getParticleSystemByID = function(k) {\n            for (var H = 0; H < this.particleSystems.length; H++)\n              if (this.particleSystems[H].id === k)\n                return this.particleSystems[H];\n            return null;\n          }, Y.prototype.getGeometryByID = function(k) {\n            for (var H = 0; H < this.geometries.length; H++)\n              if (this.geometries[H].id === k)\n                return this.geometries[H];\n            return null;\n          }, Y.prototype._getGeometryByUniqueID = function(k) {\n            if (this.geometriesByUniqueId) {\n              var H = this.geometriesByUniqueId[k];\n              if (H !== void 0)\n                return this.geometries[H];\n            } else\n              for (var Z = 0; Z < this.geometries.length; Z++)\n                if (this.geometries[Z].uniqueId === k)\n                  return this.geometries[Z];\n            return null;\n          }, Y.prototype.pushGeometry = function(k, H) {\n            return !(!H && this._getGeometryByUniqueID(k.uniqueId)) && (this.addGeometry(k), this.onNewGeometryAddedObservable.notifyObservers(k), !0);\n          }, Y.prototype.removeGeometry = function(k) {\n            var H;\n            if (this.geometriesByUniqueId) {\n              if ((H = this.geometriesByUniqueId[k.uniqueId]) === void 0)\n                return !1;\n            } else if ((H = this.geometries.indexOf(k)) < 0)\n              return !1;\n            if (H !== this.geometries.length - 1) {\n              var Z = this.geometries[this.geometries.length - 1];\n              Z && (this.geometries[H] = Z, this.geometriesByUniqueId && (this.geometriesByUniqueId[Z.uniqueId] = H, this.geometriesByUniqueId[k.uniqueId] = void 0));\n            }\n            return this.geometries.pop(), this.onGeometryRemovedObservable.notifyObservers(k), !0;\n          }, Y.prototype.getGeometries = function() {\n            return this.geometries;\n          }, Y.prototype.getMeshByID = function(k) {\n            for (var H = 0; H < this.meshes.length; H++)\n              if (this.meshes[H].id === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getMeshesByID = function(k) {\n            return this.meshes.filter(function(H) {\n              return H.id === k;\n            });\n          }, Y.prototype.getTransformNodeByID = function(k) {\n            for (var H = 0; H < this.transformNodes.length; H++)\n              if (this.transformNodes[H].id === k)\n                return this.transformNodes[H];\n            return null;\n          }, Y.prototype.getTransformNodeByUniqueID = function(k) {\n            for (var H = 0; H < this.transformNodes.length; H++)\n              if (this.transformNodes[H].uniqueId === k)\n                return this.transformNodes[H];\n            return null;\n          }, Y.prototype.getTransformNodesByID = function(k) {\n            return this.transformNodes.filter(function(H) {\n              return H.id === k;\n            });\n          }, Y.prototype.getMeshByUniqueID = function(k) {\n            for (var H = 0; H < this.meshes.length; H++)\n              if (this.meshes[H].uniqueId === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getLastMeshByID = function(k) {\n            for (var H = this.meshes.length - 1; H >= 0; H--)\n              if (this.meshes[H].id === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getLastEntryByID = function(k) {\n            var H;\n            for (H = this.meshes.length - 1; H >= 0; H--)\n              if (this.meshes[H].id === k)\n                return this.meshes[H];\n            for (H = this.transformNodes.length - 1; H >= 0; H--)\n              if (this.transformNodes[H].id === k)\n                return this.transformNodes[H];\n            for (H = this.cameras.length - 1; H >= 0; H--)\n              if (this.cameras[H].id === k)\n                return this.cameras[H];\n            for (H = this.lights.length - 1; H >= 0; H--)\n              if (this.lights[H].id === k)\n                return this.lights[H];\n            return null;\n          }, Y.prototype.getNodeByID = function(k) {\n            var H = this.getMeshByID(k);\n            if (H)\n              return H;\n            var Z = this.getTransformNodeByID(k);\n            if (Z)\n              return Z;\n            var W = this.getLightByID(k);\n            if (W)\n              return W;\n            var q = this.getCameraByID(k);\n            if (q)\n              return q;\n            var he = this.getBoneByID(k);\n            return he || null;\n          }, Y.prototype.getNodeByName = function(k) {\n            var H = this.getMeshByName(k);\n            if (H)\n              return H;\n            var Z = this.getTransformNodeByName(k);\n            if (Z)\n              return Z;\n            var W = this.getLightByName(k);\n            if (W)\n              return W;\n            var q = this.getCameraByName(k);\n            if (q)\n              return q;\n            var he = this.getBoneByName(k);\n            return he || null;\n          }, Y.prototype.getMeshByName = function(k) {\n            for (var H = 0; H < this.meshes.length; H++)\n              if (this.meshes[H].name === k)\n                return this.meshes[H];\n            return null;\n          }, Y.prototype.getTransformNodeByName = function(k) {\n            for (var H = 0; H < this.transformNodes.length; H++)\n              if (this.transformNodes[H].name === k)\n                return this.transformNodes[H];\n            return null;\n          }, Y.prototype.getLastSkeletonByID = function(k) {\n            for (var H = this.skeletons.length - 1; H >= 0; H--)\n              if (this.skeletons[H].id === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getSkeletonByUniqueId = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              if (this.skeletons[H].uniqueId === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getSkeletonById = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              if (this.skeletons[H].id === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getSkeletonByName = function(k) {\n            for (var H = 0; H < this.skeletons.length; H++)\n              if (this.skeletons[H].name === k)\n                return this.skeletons[H];\n            return null;\n          }, Y.prototype.getMorphTargetManagerById = function(k) {\n            for (var H = 0; H < this.morphTargetManagers.length; H++)\n              if (this.morphTargetManagers[H].uniqueId === k)\n                return this.morphTargetManagers[H];\n            return null;\n          }, Y.prototype.getMorphTargetById = function(k) {\n            for (var H = 0; H < this.morphTargetManagers.length; ++H)\n              for (var Z = this.morphTargetManagers[H], W = 0; W < Z.numTargets; ++W) {\n                var q = Z.getTarget(W);\n                if (q.id === k)\n                  return q;\n              }\n            return null;\n          }, Y.prototype.getMorphTargetByName = function(k) {\n            for (var H = 0; H < this.morphTargetManagers.length; ++H)\n              for (var Z = this.morphTargetManagers[H], W = 0; W < Z.numTargets; ++W) {\n                var q = Z.getTarget(W);\n                if (q.name === k)\n                  return q;\n              }\n            return null;\n          }, Y.prototype.getPostProcessByName = function(k) {\n            for (var H = 0; H < this.postProcesses.length; ++H) {\n              var Z = this.postProcesses[H];\n              if (Z.name === k)\n                return Z;\n            }\n            return null;\n          }, Y.prototype.isActiveMesh = function(k) {\n            return this._activeMeshes.indexOf(k) !== -1;\n          }, Object.defineProperty(Y.prototype, \"uid\", { get: function() {\n            return this._uid || (this._uid = _.b.RandomId()), this._uid;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.addExternalData = function(k, H) {\n            return this._externalData || (this._externalData = new O.a()), this._externalData.add(k, H);\n          }, Y.prototype.getExternalData = function(k) {\n            return this._externalData ? this._externalData.get(k) : null;\n          }, Y.prototype.getOrAddExternalDataWithFactory = function(k, H) {\n            return this._externalData || (this._externalData = new O.a()), this._externalData.getOrAddWithFactory(k, H);\n          }, Y.prototype.removeExternalData = function(k) {\n            return this._externalData.remove(k);\n          }, Y.prototype._evaluateSubMesh = function(k, H, Z) {\n            if (Z.hasInstances || Z.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || H.alwaysSelectAsActiveMesh || H.subMeshes.length === 1 || k.isInFrustum(this._frustumPlanes)) {\n              for (var W = 0, q = this._evaluateSubMeshStage; W < q.length; W++)\n                q[W].action(H, k);\n              var he = k.getMaterial();\n              he != null && (he.hasRenderTargetTextures && he.getRenderTargetTextures != null && this._processedMaterials.indexOf(he) === -1 && (this._processedMaterials.push(he), this._renderTargets.concatWithNoDuplicate(he.getRenderTargetTextures())), this._renderingManager.dispatch(k, H, he));\n            }\n          }, Y.prototype.freeProcessedMaterials = function() {\n            this._processedMaterials.dispose();\n          }, Object.defineProperty(Y.prototype, \"blockfreeActiveMeshesAndRenderingGroups\", { get: function() {\n            return this._preventFreeActiveMeshesAndRenderingGroups;\n          }, set: function(k) {\n            this._preventFreeActiveMeshesAndRenderingGroups !== k && (k && (this.freeActiveMeshes(), this.freeRenderingGroups()), this._preventFreeActiveMeshesAndRenderingGroups = k);\n          }, enumerable: !1, configurable: !0 }), Y.prototype.freeActiveMeshes = function() {\n            if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._activeMeshes.dispose(), this.activeCamera && this.activeCamera._activeMeshes && this.activeCamera._activeMeshes.dispose(), this.activeCameras))\n              for (var k = 0; k < this.activeCameras.length; k++) {\n                var H = this.activeCameras[k];\n                H && H._activeMeshes && H._activeMeshes.dispose();\n              }\n          }, Y.prototype.freeRenderingGroups = function() {\n            if (!this.blockfreeActiveMeshesAndRenderingGroups && (this._renderingManager && this._renderingManager.freeRenderingGroups(), this.textures))\n              for (var k = 0; k < this.textures.length; k++) {\n                var H = this.textures[k];\n                H && H.renderList && H.freeRenderingGroups();\n              }\n          }, Y.prototype._isInIntermediateRendering = function() {\n            return this._intermediateRendering;\n          }, Y.prototype.freezeActiveMeshes = function(k, H, Z) {\n            var W = this;\n            return k === void 0 && (k = !1), this.executeWhenReady(function() {\n              if (W.activeCamera) {\n                W._frustumPlanes || W.setTransformMatrix(W.activeCamera.getViewMatrix(), W.activeCamera.getProjectionMatrix()), W._evaluateActiveMeshes(), W._activeMeshesFrozen = !0, W._skipEvaluateActiveMeshesCompletely = k;\n                for (var q = 0; q < W._activeMeshes.length; q++)\n                  W._activeMeshes.data[q]._freeze();\n                H && H();\n              } else\n                Z && Z(\"No active camera found\");\n            }), this;\n          }, Y.prototype.unfreezeActiveMeshes = function() {\n            for (var k = 0; k < this.meshes.length; k++) {\n              var H = this.meshes[k];\n              H._internalAbstractMeshDataInfo && (H._internalAbstractMeshDataInfo._isActive = !1);\n            }\n            for (k = 0; k < this._activeMeshes.length; k++)\n              this._activeMeshes.data[k]._unFreeze();\n            return this._activeMeshesFrozen = !1, this;\n          }, Y.prototype._evaluateActiveMeshes = function() {\n            if (this._activeMeshesFrozen && this._activeMeshes.length) {\n              if (!this._skipEvaluateActiveMeshesCompletely)\n                for (var k = this._activeMeshes.length, H = 0; H < k; H++)\n                  (me = this._activeMeshes.data[H]).computeWorldMatrix();\n              if (this._activeParticleSystems) {\n                var Z = this._activeParticleSystems.length;\n                for (H = 0; H < Z; H++)\n                  this._activeParticleSystems.data[H].animate();\n              }\n            } else if (this.activeCamera) {\n              this.onBeforeActiveMeshesEvaluationObservable.notifyObservers(this), this.activeCamera._activeMeshes.reset(), this._activeMeshes.reset(), this._renderingManager.reset(), this._processedMaterials.reset(), this._activeParticleSystems.reset(), this._activeSkeletons.reset(), this._softwareSkinnedMeshes.reset();\n              for (var W = 0, q = this._beforeEvaluateActiveMeshStage; W < q.length; W++)\n                q[W].action();\n              var he = this.getActiveMeshCandidates(), ge = he.length;\n              for (H = 0; H < ge; H++) {\n                var me;\n                if ((me = he.data[H])._internalAbstractMeshDataInfo._currentLODIsUpToDate = !1, !me.isBlocked && (this._totalVertices.addCount(me.getTotalVertices(), !1), me.isReady() && me.isEnabled() && me.scaling.lengthSquared() !== 0)) {\n                  me.computeWorldMatrix(), me.actionManager && me.actionManager.hasSpecificTriggers2(M.a.ACTION_OnIntersectionEnterTrigger, M.a.ACTION_OnIntersectionExitTrigger) && this._meshesForIntersections.pushNoDuplicate(me);\n                  var _e = this.customLODSelector ? this.customLODSelector(me, this.activeCamera) : me.getLOD(this.activeCamera);\n                  if (me._internalAbstractMeshDataInfo._currentLOD = _e, me._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0, _e != null && (_e !== me && _e.billboardMode !== c.a.BILLBOARDMODE_NONE && _e.computeWorldMatrix(), me._preActivate(), me.isVisible && me.visibility > 0 && (me.layerMask & this.activeCamera.layerMask) != 0 && (this._skipFrustumClipping || me.alwaysSelectAsActiveMesh || me.isInFrustum(this._frustumPlanes)))) {\n                    this._activeMeshes.push(me), this.activeCamera._activeMeshes.push(me), _e !== me && _e._activate(this._renderId, !1);\n                    for (var ye = 0, Pe = this._preActiveMeshStage; ye < Pe.length; ye++)\n                      Pe[ye].action(me);\n                    me._activate(this._renderId, !1) && (me.isAnInstance ? me._internalAbstractMeshDataInfo._actAsRegularMesh && (_e = me) : _e._internalAbstractMeshDataInfo._onlyForInstances = !1, _e._internalAbstractMeshDataInfo._isActive = !0, this._activeMesh(me, _e)), me._postActivate();\n                  }\n                }\n              }\n              if (this.onAfterActiveMeshesEvaluationObservable.notifyObservers(this), this.particlesEnabled) {\n                this.onBeforeParticlesRenderingObservable.notifyObservers(this);\n                for (var be = 0; be < this.particleSystems.length; be++) {\n                  var Fe = this.particleSystems[be];\n                  if (Fe.isStarted() && Fe.emitter) {\n                    var ke = Fe.emitter;\n                    ke.position && !ke.isEnabled() || (this._activeParticleSystems.push(Fe), Fe.animate(), this._renderingManager.dispatchParticles(Fe));\n                  }\n                }\n                this.onAfterParticlesRenderingObservable.notifyObservers(this);\n              }\n            }\n          }, Y.prototype._activeMesh = function(k, H) {\n            if (this._skeletonsEnabled && H.skeleton !== null && H.skeleton !== void 0 && (this._activeSkeletons.pushNoDuplicate(H.skeleton) && H.skeleton.prepare(), H.computeBonesUsingShaders || this._softwareSkinnedMeshes.pushNoDuplicate(H)), H != null && H.subMeshes !== void 0 && H.subMeshes !== null && H.subMeshes.length > 0)\n              for (var Z = this.getActiveSubMeshCandidates(H), W = Z.length, q = 0; q < W; q++) {\n                var he = Z.data[q];\n                this._evaluateSubMesh(he, H, k);\n              }\n          }, Y.prototype.updateTransformMatrix = function(k) {\n            this.activeCamera && this.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(k));\n          }, Y.prototype._bindFrameBuffer = function() {\n            if (this.activeCamera && this.activeCamera._multiviewTexture)\n              this.activeCamera._multiviewTexture._bindFrameBuffer();\n            else if (this.activeCamera && this.activeCamera.outputRenderTarget)\n              if (this.getEngine().getCaps().multiview && this.activeCamera.outputRenderTarget && this.activeCamera.outputRenderTarget.getViewCount() > 1)\n                this.activeCamera.outputRenderTarget._bindFrameBuffer();\n              else {\n                var k = this.activeCamera.outputRenderTarget.getInternalTexture();\n                k ? this.getEngine().bindFramebuffer(k) : X.a.Error(\"Camera contains invalid customDefaultRenderTarget\");\n              }\n            else\n              this.getEngine().restoreDefaultFramebuffer();\n          }, Y.prototype._renderForCamera = function(k, H) {\n            if (!k || !k._skipRendering) {\n              var Z = this._engine;\n              if (this._activeCamera = k, !this.activeCamera)\n                throw new Error(\"Active camera not set\");\n              Z.setViewport(this.activeCamera.viewport), this.resetCachedMaterial(), this._renderId++, this.getEngine().getCaps().multiview && k.outputRenderTarget && k.outputRenderTarget.getViewCount() > 1 ? this.setTransformMatrix(k._rigCameras[0].getViewMatrix(), k._rigCameras[0].getProjectionMatrix(), k._rigCameras[1].getViewMatrix(), k._rigCameras[1].getProjectionMatrix()) : this.updateTransformMatrix(), this.onBeforeCameraRenderObservable.notifyObservers(this.activeCamera), this._evaluateActiveMeshes();\n              for (var W = 0; W < this._softwareSkinnedMeshes.length; W++) {\n                var q = this._softwareSkinnedMeshes.data[W];\n                q.applySkeleton(q.skeleton);\n              }\n              this.onBeforeRenderTargetsRenderObservable.notifyObservers(this), k.customRenderTargets && k.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(k.customRenderTargets), H && H.customRenderTargets && H.customRenderTargets.length > 0 && this._renderTargets.concatWithNoDuplicate(H.customRenderTargets);\n              for (var he = 0, ge = this._gatherActiveCameraRenderTargetsStage; he < ge.length; he++)\n                ge[he].action(this._renderTargets);\n              var me = !1;\n              if (this.renderTargetsEnabled) {\n                if (this._intermediateRendering = !0, this._renderTargets.length > 0) {\n                  _.b.StartPerformanceCounter(\"Render targets\", this._renderTargets.length > 0);\n                  for (var _e = 0; _e < this._renderTargets.length; _e++) {\n                    var ye = this._renderTargets.data[_e];\n                    if (ye._shouldRender()) {\n                      this._renderId++;\n                      var Pe = ye.activeCamera && ye.activeCamera !== this.activeCamera;\n                      ye.render(Pe, this.dumpNextRenderTargets), me = !0;\n                    }\n                  }\n                  _.b.EndPerformanceCounter(\"Render targets\", this._renderTargets.length > 0), this._renderId++;\n                }\n                for (var be = 0, Fe = this._cameraDrawRenderTargetStage; be < Fe.length; be++)\n                  me = Fe[be].action(this.activeCamera) || me;\n                this._intermediateRendering = !1, this.activeCamera && this.activeCamera.outputRenderTarget && (me = !0);\n              }\n              me && !this.prePass && this._bindFrameBuffer(), this.onAfterRenderTargetsRenderObservable.notifyObservers(this), !this.postProcessManager || k._multiviewTexture || this.prePass || this.postProcessManager._prepareFrame();\n              for (var ke = 0, We = this._beforeCameraDrawStage; ke < We.length; ke++)\n                We[ke].action(this.activeCamera);\n              this.onBeforeDrawPhaseObservable.notifyObservers(this), this._renderingManager.render(null, null, !0, !0), this.onAfterDrawPhaseObservable.notifyObservers(this);\n              for (var je = 0, He = this._afterCameraDrawStage; je < He.length; je++)\n                He[je].action(this.activeCamera);\n              if (this.postProcessManager && !k._multiviewTexture) {\n                var Qe = k.outputRenderTarget ? k.outputRenderTarget.getInternalTexture() : void 0;\n                this.postProcessManager._finalizeFrame(k.isIntermediate, Qe);\n              }\n              this._renderTargets.reset(), this.onAfterCameraRenderObservable.notifyObservers(this.activeCamera);\n            }\n          }, Y.prototype._processSubCameras = function(k) {\n            if (k.cameraRigMode === S.a.RIG_MODE_NONE || k.outputRenderTarget && k.outputRenderTarget.getViewCount() > 1 && this.getEngine().getCaps().multiview)\n              return this._renderForCamera(k), void this.onAfterRenderCameraObservable.notifyObservers(k);\n            if (k._useMultiviewToSingleView)\n              this._renderMultiviewToSingleView(k);\n            else\n              for (var H = 0; H < k._rigCameras.length; H++)\n                this._renderForCamera(k._rigCameras[H], k);\n            this._activeCamera = k, this.setTransformMatrix(this._activeCamera.getViewMatrix(), this._activeCamera.getProjectionMatrix()), this.onAfterRenderCameraObservable.notifyObservers(k);\n          }, Y.prototype._checkIntersections = function() {\n            for (var k = 0; k < this._meshesForIntersections.length; k++) {\n              var H = this._meshesForIntersections.data[k];\n              if (H.actionManager)\n                for (var Z = 0; H.actionManager && Z < H.actionManager.actions.length; Z++) {\n                  var W = H.actionManager.actions[Z];\n                  if (W.trigger === M.a.ACTION_OnIntersectionEnterTrigger || W.trigger === M.a.ACTION_OnIntersectionExitTrigger) {\n                    var q = W.getTriggerParameter(), he = q instanceof T.a ? q : q.mesh, ge = he.intersectsMesh(H, q.usePreciseIntersection), me = H._intersectionsInProgress.indexOf(he);\n                    ge && me === -1 ? W.trigger === M.a.ACTION_OnIntersectionEnterTrigger ? (W._executeCurrent(b.a.CreateNew(H, void 0, he)), H._intersectionsInProgress.push(he)) : W.trigger === M.a.ACTION_OnIntersectionExitTrigger && H._intersectionsInProgress.push(he) : !ge && me > -1 && (W.trigger === M.a.ACTION_OnIntersectionExitTrigger && W._executeCurrent(b.a.CreateNew(H, void 0, he)), H.actionManager.hasSpecificTrigger(M.a.ACTION_OnIntersectionExitTrigger, function(_e) {\n                      var ye = _e instanceof T.a ? _e : _e.mesh;\n                      return he === ye;\n                    }) && W.trigger !== M.a.ACTION_OnIntersectionExitTrigger || H._intersectionsInProgress.splice(me, 1));\n                  }\n                }\n            }\n          }, Y.prototype._advancePhysicsEngineStep = function(k) {\n          }, Y.prototype._animate = function() {\n          }, Y.prototype.animate = function() {\n            if (this._engine.isDeterministicLockStep()) {\n              var k = Math.max(Y.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Y.MaxDeltaTime)) + this._timeAccumulator, H = this._engine.getTimeStep(), Z = 1e3 / H / 1e3, W = 0, q = this._engine.getLockstepMaxSteps(), he = Math.floor(k / H);\n              for (he = Math.min(he, q); k > 0 && W < he; )\n                this.onBeforeStepObservable.notifyObservers(this), this._animationRatio = H * Z, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(H), this.onAfterStepObservable.notifyObservers(this), this._currentStepId++, W++, k -= H;\n              this._timeAccumulator = k < 0 ? 0 : k;\n            } else\n              k = this.useConstantAnimationDeltaTime ? 16 : Math.max(Y.MinDeltaTime, Math.min(this._engine.getDeltaTime(), Y.MaxDeltaTime)), this._animationRatio = 0.06 * k, this._animate(), this.onAfterAnimationsObservable.notifyObservers(this), this.physicsEnabled && this._advancePhysicsEngineStep(k);\n          }, Y.prototype.render = function(k, H) {\n            if (k === void 0 && (k = !0), H === void 0 && (H = !1), !this.isDisposed) {\n              this.onReadyObservable.hasObservers() && this._executeWhenReadyTimeoutId === -1 && this._checkIsReady(), this._frameId++, this._registerTransientComponents(), this._activeParticles.fetchNewFrame(), this._totalVertices.fetchNewFrame(), this._activeIndices.fetchNewFrame(), this._activeBones.fetchNewFrame(), this._meshesForIntersections.reset(), this.resetCachedMaterial(), this.onBeforeAnimationsObservable.notifyObservers(this), this.actionManager && this.actionManager.processTrigger(M.a.ACTION_OnEveryFrameTrigger), H || this.animate();\n              for (var Z = 0, W = this._beforeCameraUpdateStage; Z < W.length; Z++)\n                W[Z].action();\n              if (k) {\n                if (this.activeCameras && this.activeCameras.length > 0)\n                  for (var q = 0; q < this.activeCameras.length; q++) {\n                    var he = this.activeCameras[q];\n                    if (he.update(), he.cameraRigMode !== S.a.RIG_MODE_NONE)\n                      for (var ge = 0; ge < he._rigCameras.length; ge++)\n                        he._rigCameras[ge].update();\n                  }\n                else if (this.activeCamera && (this.activeCamera.update(), this.activeCamera.cameraRigMode !== S.a.RIG_MODE_NONE))\n                  for (ge = 0; ge < this.activeCamera._rigCameras.length; ge++)\n                    this.activeCamera._rigCameras[ge].update();\n              }\n              this.onBeforeRenderObservable.notifyObservers(this), this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);\n              var me = this.getEngine(), _e = this.activeCamera;\n              if (this.renderTargetsEnabled) {\n                _.b.StartPerformanceCounter(\"Custom render targets\", this.customRenderTargets.length > 0), this._intermediateRendering = !0;\n                for (var ye = 0; ye < this.customRenderTargets.length; ye++) {\n                  var Pe = this.customRenderTargets[ye];\n                  if (Pe._shouldRender()) {\n                    if (this._renderId++, this.activeCamera = Pe.activeCamera || this.activeCamera, !this.activeCamera)\n                      throw new Error(\"Active camera not set\");\n                    me.setViewport(this.activeCamera.viewport), this.updateTransformMatrix(), Pe.render(_e !== this.activeCamera, this.dumpNextRenderTargets);\n                  }\n                }\n                _.b.EndPerformanceCounter(\"Custom render targets\", this.customRenderTargets.length > 0), this._intermediateRendering = !1, this._renderId++;\n              }\n              this.activeCamera = _e, this._activeCamera && this._activeCamera.cameraRigMode !== S.a.RIG_MODE_CUSTOM && !this.prePass && this._bindFrameBuffer(), this.onAfterRenderTargetsRenderObservable.notifyObservers(this);\n              for (var be = 0, Fe = this._beforeClearStage; be < Fe.length; be++)\n                Fe[be].action();\n              !this.autoClearDepthAndStencil && !this.autoClear || this.prePass || this._engine.clear(this.clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);\n              for (var ke = 0, We = this._gatherRenderTargetsStage; ke < We.length; ke++)\n                We[ke].action(this._renderTargets);\n              if (this.activeCameras && this.activeCameras.length > 0)\n                for (q = 0; q < this.activeCameras.length; q++)\n                  q > 0 && this._engine.clear(null, !1, !0, !0), this._processSubCameras(this.activeCameras[q]);\n              else {\n                if (!this.activeCamera)\n                  throw new Error(\"No camera defined\");\n                this._processSubCameras(this.activeCamera);\n              }\n              this._checkIntersections();\n              for (var je = 0, He = this._afterRenderStage; je < He.length; je++)\n                He[je].action();\n              if (this.afterRender && this.afterRender(), this.onAfterRenderObservable.notifyObservers(this), this._toBeDisposed.length) {\n                for (ge = 0; ge < this._toBeDisposed.length; ge++) {\n                  var Qe = this._toBeDisposed[ge];\n                  Qe && Qe.dispose();\n                }\n                this._toBeDisposed = [];\n              }\n              this.dumpNextRenderTargets && (this.dumpNextRenderTargets = !1), this._activeBones.addCount(0, !0), this._activeIndices.addCount(0, !0), this._activeParticles.addCount(0, !0);\n            }\n          }, Y.prototype.freezeMaterials = function() {\n            for (var k = 0; k < this.materials.length; k++)\n              this.materials[k].freeze();\n          }, Y.prototype.unfreezeMaterials = function() {\n            for (var k = 0; k < this.materials.length; k++)\n              this.materials[k].unfreeze();\n          }, Y.prototype.dispose = function() {\n            this.beforeRender = null, this.afterRender = null, j.a._LastCreatedScene === this && (j.a._LastCreatedScene = null), this.skeletons = [], this.morphTargetManagers = [], this._transientComponents = [], this._isReadyForMeshStage.clear(), this._beforeEvaluateActiveMeshStage.clear(), this._evaluateSubMeshStage.clear(), this._preActiveMeshStage.clear(), this._cameraDrawRenderTargetStage.clear(), this._beforeCameraDrawStage.clear(), this._beforeRenderTargetDrawStage.clear(), this._beforeRenderingGroupDrawStage.clear(), this._beforeRenderingMeshStage.clear(), this._afterRenderingMeshStage.clear(), this._afterRenderingGroupDrawStage.clear(), this._afterCameraDrawStage.clear(), this._afterRenderTargetDrawStage.clear(), this._afterRenderStage.clear(), this._beforeCameraUpdateStage.clear(), this._beforeClearStage.clear(), this._gatherRenderTargetsStage.clear(), this._gatherActiveCameraRenderTargetsStage.clear(), this._pointerMoveStage.clear(), this._pointerDownStage.clear(), this._pointerUpStage.clear();\n            for (var k = 0, H = this._components; k < H.length; k++)\n              H[k].dispose();\n            this.importedMeshesFiles = new Array(), this.stopAllAnimations && this.stopAllAnimations(), this.resetCachedMaterial(), this.activeCamera && (this.activeCamera._activeMeshes.dispose(), this.activeCamera = null), this._activeMeshes.dispose(), this._renderingManager.dispose(), this._processedMaterials.dispose(), this._activeParticleSystems.dispose(), this._activeSkeletons.dispose(), this._softwareSkinnedMeshes.dispose(), this._renderTargets.dispose(), this._registeredForLateAnimationBindings.dispose(), this._meshesForIntersections.dispose(), this._toBeDisposed = [];\n            for (var Z = 0, W = this._activeRequests; Z < W.length; Z++)\n              W[Z].abort();\n            var q;\n            if (this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderTargetsRenderObservable.clear(), this.onAfterRenderTargetsRenderObservable.clear(), this.onAfterStepObservable.clear(), this.onBeforeStepObservable.clear(), this.onBeforeActiveMeshesEvaluationObservable.clear(), this.onAfterActiveMeshesEvaluationObservable.clear(), this.onBeforeParticlesRenderingObservable.clear(), this.onAfterParticlesRenderingObservable.clear(), this.onBeforeDrawPhaseObservable.clear(), this.onAfterDrawPhaseObservable.clear(), this.onBeforeAnimationsObservable.clear(), this.onAfterAnimationsObservable.clear(), this.onDataLoadedObservable.clear(), this.onBeforeRenderingGroupObservable.clear(), this.onAfterRenderingGroupObservable.clear(), this.onMeshImportedObservable.clear(), this.onBeforeCameraRenderObservable.clear(), this.onAfterCameraRenderObservable.clear(), this.onReadyObservable.clear(), this.onNewCameraAddedObservable.clear(), this.onCameraRemovedObservable.clear(), this.onNewLightAddedObservable.clear(), this.onLightRemovedObservable.clear(), this.onNewGeometryAddedObservable.clear(), this.onGeometryRemovedObservable.clear(), this.onNewTransformNodeAddedObservable.clear(), this.onTransformNodeRemovedObservable.clear(), this.onNewMeshAddedObservable.clear(), this.onMeshRemovedObservable.clear(), this.onNewSkeletonAddedObservable.clear(), this.onSkeletonRemovedObservable.clear(), this.onNewMaterialAddedObservable.clear(), this.onNewMultiMaterialAddedObservable.clear(), this.onMaterialRemovedObservable.clear(), this.onMultiMaterialRemovedObservable.clear(), this.onNewTextureAddedObservable.clear(), this.onTextureRemovedObservable.clear(), this.onPrePointerObservable.clear(), this.onPointerObservable.clear(), this.onPreKeyboardObservable.clear(), this.onKeyboardObservable.clear(), this.onActiveCameraChanged.clear(), this.detachControl(), this._engine.getInputElement())\n              for (q = 0; q < this.cameras.length; q++)\n                this.cameras[q].detachControl();\n            for (; this.animationGroups.length; )\n              this.animationGroups[0].dispose();\n            for (; this.lights.length; )\n              this.lights[0].dispose();\n            for (; this.meshes.length; )\n              this.meshes[0].dispose(!0);\n            for (; this.transformNodes.length; )\n              this.transformNodes[0].dispose(!0);\n            for (; this.cameras.length; )\n              this.cameras[0].dispose();\n            for (this._defaultMaterial && this._defaultMaterial.dispose(); this.multiMaterials.length; )\n              this.multiMaterials[0].dispose();\n            for (; this.materials.length; )\n              this.materials[0].dispose();\n            for (; this.particleSystems.length; )\n              this.particleSystems[0].dispose();\n            for (; this.postProcesses.length; )\n              this.postProcesses[0].dispose();\n            for (; this.textures.length; )\n              this.textures[0].dispose();\n            this._sceneUbo.dispose(), this._multiviewSceneUbo && this._multiviewSceneUbo.dispose(), this.postProcessManager.dispose(), (q = this._engine.scenes.indexOf(this)) > -1 && this._engine.scenes.splice(q, 1), this._engine.wipeCaches(!0), this._isDisposed = !0;\n          }, Object.defineProperty(Y.prototype, \"isDisposed\", { get: function() {\n            return this._isDisposed;\n          }, enumerable: !1, configurable: !0 }), Y.prototype.clearCachedVertexData = function() {\n            for (var k = 0; k < this.meshes.length; k++) {\n              var H = this.meshes[k].geometry;\n              if (H)\n                for (var Z in H._indices = [], H._vertexBuffers)\n                  H._vertexBuffers.hasOwnProperty(Z) && (H._vertexBuffers[Z]._buffer._data = null);\n            }\n          }, Y.prototype.cleanCachedTextureBuffer = function() {\n            for (var k = 0, H = this.textures; k < H.length; k++) {\n              var Z = H[k];\n              Z._buffer && (Z._buffer = null);\n            }\n          }, Y.prototype.getWorldExtends = function(k) {\n            var H = new m.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), Z = new m.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n            return k = k || function() {\n              return !0;\n            }, this.meshes.filter(k).forEach(function(W) {\n              if (W.computeWorldMatrix(!0), W.subMeshes && W.subMeshes.length !== 0 && !W.infiniteDistance) {\n                var q = W.getBoundingInfo(), he = q.boundingBox.minimumWorld, ge = q.boundingBox.maximumWorld;\n                m.e.CheckExtends(he, H, Z), m.e.CheckExtends(ge, H, Z);\n              }\n            }), { min: H, max: Z };\n          }, Y.prototype.createPickingRay = function(k, H, Z, W, q) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.createPickingRayToRef = function(k, H, Z, W, q, he) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.createPickingRayInCameraSpace = function(k, H, Z) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.createPickingRayInCameraSpaceToRef = function(k, H, Z, W) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.pick = function(k, H, Z, W, q, he) {\n            var ge = new v.a();\n            return ge._pickingUnavailable = !0, ge;\n          }, Y.prototype.pickWithBoundingInfo = function(k, H, Z, W, q) {\n            var he = new v.a();\n            return he._pickingUnavailable = !0, he;\n          }, Y.prototype.pickWithRay = function(k, H, Z, W) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.multiPick = function(k, H, Z, W, q) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.multiPickWithRay = function(k, H, Z) {\n            throw ne.a.WarnImport(\"Ray\");\n          }, Y.prototype.setPointerOverMesh = function(k, H) {\n            this._inputManager.setPointerOverMesh(k, H);\n          }, Y.prototype.getPointerOverMesh = function() {\n            return this._inputManager.getPointerOverMesh();\n          }, Y.prototype._rebuildGeometries = function() {\n            for (var k = 0, H = this.geometries; k < H.length; k++)\n              H[k]._rebuild();\n            for (var Z = 0, W = this.meshes; Z < W.length; Z++)\n              W[Z]._rebuild();\n            this.postProcessManager && this.postProcessManager._rebuild();\n            for (var q = 0, he = this._components; q < he.length; q++)\n              he[q].rebuild();\n            for (var ge = 0, me = this.particleSystems; ge < me.length; ge++)\n              me[ge].rebuild();\n          }, Y.prototype._rebuildTextures = function() {\n            for (var k = 0, H = this.textures; k < H.length; k++)\n              H[k]._rebuild();\n            this.markAllMaterialsAsDirty(M.a.MATERIAL_TextureDirtyFlag);\n          }, Y.prototype._getByTags = function(k, H, Z) {\n            if (H === void 0)\n              return k;\n            var W = [];\n            for (var q in Z = Z || function(ge) {\n            }, k) {\n              var he = k[q];\n              x.a && x.a.MatchesQuery(he, H) && (W.push(he), Z(he));\n            }\n            return W;\n          }, Y.prototype.getMeshesByTags = function(k, H) {\n            return this._getByTags(this.meshes, k, H);\n          }, Y.prototype.getCamerasByTags = function(k, H) {\n            return this._getByTags(this.cameras, k, H);\n          }, Y.prototype.getLightsByTags = function(k, H) {\n            return this._getByTags(this.lights, k, H);\n          }, Y.prototype.getMaterialByTags = function(k, H) {\n            return this._getByTags(this.materials, k, H).concat(this._getByTags(this.multiMaterials, k, H));\n          }, Y.prototype.getTransformNodesByTags = function(k, H) {\n            return this._getByTags(this.transformNodes, k, H);\n          }, Y.prototype.setRenderingOrder = function(k, H, Z, W) {\n            H === void 0 && (H = null), Z === void 0 && (Z = null), W === void 0 && (W = null), this._renderingManager.setRenderingOrder(k, H, Z, W);\n          }, Y.prototype.setRenderingAutoClearDepthStencil = function(k, H, Z, W) {\n            Z === void 0 && (Z = !0), W === void 0 && (W = !0), this._renderingManager.setRenderingAutoClearDepthStencil(k, H, Z, W);\n          }, Y.prototype.getAutoClearDepthStencilSetup = function(k) {\n            return this._renderingManager.getAutoClearDepthStencilSetup(k);\n          }, Object.defineProperty(Y.prototype, \"blockMaterialDirtyMechanism\", { get: function() {\n            return this._blockMaterialDirtyMechanism;\n          }, set: function(k) {\n            this._blockMaterialDirtyMechanism !== k && (this._blockMaterialDirtyMechanism = k, k || this.markAllMaterialsAsDirty(M.a.MATERIAL_AllDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Y.prototype.markAllMaterialsAsDirty = function(k, H) {\n            if (!this._blockMaterialDirtyMechanism)\n              for (var Z = 0, W = this.materials; Z < W.length; Z++) {\n                var q = W[Z];\n                H && !H(q) || q.markAsDirty(k);\n              }\n          }, Y.prototype._loadFile = function(k, H, Z, W, q, he) {\n            var ge = this, me = Q.a.LoadFile(k, H, Z, W ? this.offlineProvider : void 0, q, he);\n            return this._activeRequests.push(me), me.onCompleteObservable.add(function(_e) {\n              ge._activeRequests.splice(ge._activeRequests.indexOf(_e), 1);\n            }), me;\n          }, Y.prototype._loadFileAsync = function(k, H, Z, W) {\n            var q = this;\n            return new Promise(function(he, ge) {\n              q._loadFile(k, function(me) {\n                he(me);\n              }, H, Z, W, function(me, _e) {\n                ge(_e);\n              });\n            });\n          }, Y.prototype._requestFile = function(k, H, Z, W, q, he, ge) {\n            var me = this, _e = Q.a.RequestFile(k, H, Z, W ? this.offlineProvider : void 0, q, he, ge);\n            return this._activeRequests.push(_e), _e.onCompleteObservable.add(function(ye) {\n              me._activeRequests.splice(me._activeRequests.indexOf(ye), 1);\n            }), _e;\n          }, Y.prototype._requestFileAsync = function(k, H, Z, W, q) {\n            var he = this;\n            return new Promise(function(ge, me) {\n              he._requestFile(k, function(_e) {\n                ge(_e);\n              }, H, Z, W, function(_e) {\n                me(_e);\n              }, q);\n            });\n          }, Y.prototype._readFile = function(k, H, Z, W, q) {\n            var he = this, ge = Q.a.ReadFile(k, H, Z, W, q);\n            return this._activeRequests.push(ge), ge.onCompleteObservable.add(function(me) {\n              he._activeRequests.splice(he._activeRequests.indexOf(me), 1);\n            }), ge;\n          }, Y.prototype._readFileAsync = function(k, H, Z) {\n            var W = this;\n            return new Promise(function(q, he) {\n              W._readFile(k, function(ge) {\n                q(ge);\n              }, H, Z, function(ge) {\n                he(ge);\n              });\n            });\n          }, Y.FOGMODE_NONE = 0, Y.FOGMODE_EXP = 1, Y.FOGMODE_EXP2 = 2, Y.FOGMODE_LINEAR = 3, Y.MinDeltaTime = 1, Y.MaxDeltaTime = 1e3, Y;\n        }(E.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.WarnImport = function(C) {\n            return C + \" needs to be imported before as it contains a side-effect required by your code.\";\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return Object.defineProperty(_, \"LastCreatedEngine\", { get: function() {\n            return this.Instances.length === 0 ? null : this.Instances[this.Instances.length - 1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_, \"LastCreatedScene\", { get: function() {\n            return this._LastCreatedScene;\n          }, enumerable: !1, configurable: !0 }), _.Instances = new Array(), _._LastCreatedScene = null, _.UseFallbackTexture = !0, _.FallbackTexture = \"\", _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"c\", function() {\n          return V;\n        }), f.d(A, \"a\", function() {\n          return u;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V, _ = f(0);\n        (function(I) {\n          I[I.LOCAL = 0] = \"LOCAL\", I[I.WORLD = 1] = \"WORLD\", I[I.BONE = 2] = \"BONE\";\n        })(V || (V = {}));\n        var C, u = function() {\n          function I() {\n          }\n          return I.X = new _.e(1, 0, 0), I.Y = new _.e(0, 1, 0), I.Z = new _.e(0, 0, 1), I;\n        }();\n        (function(I) {\n          I[I.X = 0] = \"X\", I[I.Y = 1] = \"Y\", I[I.Z = 2] = \"Z\";\n        })(C || (C = {}));\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return g;\n        });\n        var V = f(1), _ = f(3), C = f(33), u = f(12), I = f(6), O = f(0), x = f(29), m = f(8), c = f(11), T = f(21), S = f(58), E = f(90), g = function(l) {\n          function h(v, b, D, w) {\n            w === void 0 && (w = !0);\n            var N = l.call(this, v, D) || this;\n            return N._position = O.e.Zero(), N._upVector = O.e.Up(), N.orthoLeft = null, N.orthoRight = null, N.orthoBottom = null, N.orthoTop = null, N.fov = 0.8, N.minZ = 1, N.maxZ = 1e4, N.inertia = 0.9, N.mode = h.PERSPECTIVE_CAMERA, N.isIntermediate = !1, N.viewport = new S.a(0, 0, 1, 1), N.layerMask = 268435455, N.fovMode = h.FOVMODE_VERTICAL_FIXED, N.cameraRigMode = h.RIG_MODE_NONE, N.customRenderTargets = new Array(), N.outputRenderTarget = null, N.onViewMatrixChangedObservable = new I.c(), N.onProjectionMatrixChangedObservable = new I.c(), N.onAfterCheckInputsObservable = new I.c(), N.onRestoreStateObservable = new I.c(), N.isRigCamera = !1, N._rigCameras = new Array(), N._webvrViewMatrix = O.a.Identity(), N._skipRendering = !1, N._projectionMatrix = new O.a(), N._postProcesses = new Array(), N._activeMeshes = new C.a(256), N._globalPosition = O.e.Zero(), N._computedViewMatrix = O.a.Identity(), N._doNotComputeProjectionMatrix = !1, N._transformMatrix = O.a.Zero(), N._refreshFrustumPlanes = !0, N._isCamera = !0, N._isLeftCamera = !1, N._isRightCamera = !1, N.getScene().addCamera(N), w && !N.getScene().activeCamera && (N.getScene().activeCamera = N), N.position = b, N;\n          }\n          return Object(V.d)(h, l), Object.defineProperty(h.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(v) {\n            this._position = v;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"upVector\", { get: function() {\n            return this._upVector;\n          }, set: function(v) {\n            this._upVector = v;\n          }, enumerable: !1, configurable: !0 }), h.prototype.storeState = function() {\n            return this._stateStored = !0, this._storedFov = this.fov, this;\n          }, h.prototype._restoreStateValues = function() {\n            return !!this._stateStored && (this.fov = this._storedFov, !0);\n          }, h.prototype.restoreState = function() {\n            return !!this._restoreStateValues() && (this.onRestoreStateObservable.notifyObservers(this), !0);\n          }, h.prototype.getClassName = function() {\n            return \"Camera\";\n          }, h.prototype.toString = function(v) {\n            var b = \"Name: \" + this.name;\n            if (b += \", type: \" + this.getClassName(), this.animations)\n              for (var D = 0; D < this.animations.length; D++)\n                b += \", animation[0]: \" + this.animations[D].toString(v);\n            return b;\n          }, Object.defineProperty(h.prototype, \"globalPosition\", { get: function() {\n            return this._globalPosition;\n          }, enumerable: !1, configurable: !0 }), h.prototype.getActiveMeshes = function() {\n            return this._activeMeshes;\n          }, h.prototype.isActiveMesh = function(v) {\n            return this._activeMeshes.indexOf(v) !== -1;\n          }, h.prototype.isReady = function(v) {\n            if (v === void 0 && (v = !1), v)\n              for (var b = 0, D = this._postProcesses; b < D.length; b++) {\n                var w = D[b];\n                if (w && !w.isReady())\n                  return !1;\n              }\n            return l.prototype.isReady.call(this, v);\n          }, h.prototype._initCache = function() {\n            l.prototype._initCache.call(this), this._cache.position = new O.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.upVector = new O.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.mode = void 0, this._cache.minZ = void 0, this._cache.maxZ = void 0, this._cache.fov = void 0, this._cache.fovMode = void 0, this._cache.aspectRatio = void 0, this._cache.orthoLeft = void 0, this._cache.orthoRight = void 0, this._cache.orthoBottom = void 0, this._cache.orthoTop = void 0, this._cache.renderWidth = void 0, this._cache.renderHeight = void 0;\n          }, h.prototype._updateCache = function(v) {\n            v || l.prototype._updateCache.call(this), this._cache.position.copyFrom(this.position), this._cache.upVector.copyFrom(this.upVector);\n          }, h.prototype._isSynchronized = function() {\n            return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();\n          }, h.prototype._isSynchronizedViewMatrix = function() {\n            return !!l.prototype._isSynchronized.call(this) && this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();\n          }, h.prototype._isSynchronizedProjectionMatrix = function() {\n            var v = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;\n            if (!v)\n              return !1;\n            var b = this.getEngine();\n            return v = this.mode === h.PERSPECTIVE_CAMERA ? this._cache.fov === this.fov && this._cache.fovMode === this.fovMode && this._cache.aspectRatio === b.getAspectRatio(this) : this._cache.orthoLeft === this.orthoLeft && this._cache.orthoRight === this.orthoRight && this._cache.orthoBottom === this.orthoBottom && this._cache.orthoTop === this.orthoTop && this._cache.renderWidth === b.getRenderWidth() && this._cache.renderHeight === b.getRenderHeight();\n          }, h.prototype.attachControl = function(v, b) {\n          }, h.prototype.detachControl = function(v) {\n          }, h.prototype.update = function() {\n            this._checkInputs(), this.cameraRigMode !== h.RIG_MODE_NONE && this._updateRigCameras();\n          }, h.prototype._checkInputs = function() {\n            this.onAfterCheckInputsObservable.notifyObservers(this);\n          }, Object.defineProperty(h.prototype, \"rigCameras\", { get: function() {\n            return this._rigCameras;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"rigPostProcess\", { get: function() {\n            return this._rigPostProcess;\n          }, enumerable: !1, configurable: !0 }), h.prototype._getFirstPostProcess = function() {\n            for (var v = 0; v < this._postProcesses.length; v++)\n              if (this._postProcesses[v] !== null)\n                return this._postProcesses[v];\n            return null;\n          }, h.prototype._cascadePostProcessesToRigCams = function() {\n            var v = this._getFirstPostProcess();\n            v && v.markTextureDirty();\n            for (var b = 0, D = this._rigCameras.length; b < D; b++) {\n              var w = this._rigCameras[b], N = w._rigPostProcess;\n              N ? (N.getEffectName() === \"pass\" && (w.isIntermediate = this._postProcesses.length === 0), w._postProcesses = this._postProcesses.slice(0).concat(N), N.markTextureDirty()) : w._postProcesses = this._postProcesses.slice(0);\n            }\n          }, h.prototype.attachPostProcess = function(v, b) {\n            return b === void 0 && (b = null), !v.isReusable() && this._postProcesses.indexOf(v) > -1 ? (m.a.Error(\"You're trying to reuse a post process not defined as reusable.\"), 0) : (b == null || b < 0 ? this._postProcesses.push(v) : this._postProcesses[b] === null ? this._postProcesses[b] = v : this._postProcesses.splice(b, 0, v), this._cascadePostProcessesToRigCams(), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._postProcesses.indexOf(v));\n          }, h.prototype.detachPostProcess = function(v) {\n            var b = this._postProcesses.indexOf(v);\n            b !== -1 && (this._postProcesses[b] = null), this._scene.prePassRenderer && this._scene.prePassRenderer.markAsDirty(), this._cascadePostProcessesToRigCams();\n          }, h.prototype.getWorldMatrix = function() {\n            return this._isSynchronizedViewMatrix() || this.getViewMatrix(), this._worldMatrix;\n          }, h.prototype._getViewMatrix = function() {\n            return O.a.Identity();\n          }, h.prototype.getViewMatrix = function(v) {\n            return !v && this._isSynchronizedViewMatrix() || (this.updateCache(), this._computedViewMatrix = this._getViewMatrix(), this._currentRenderId = this.getScene().getRenderId(), this._childUpdateId++, this._refreshFrustumPlanes = !0, this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix && this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix), this.parent && this.parent.onViewMatrixChangedObservable && this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent), this.onViewMatrixChangedObservable.notifyObservers(this), this._computedViewMatrix.invertToRef(this._worldMatrix)), this._computedViewMatrix;\n          }, h.prototype.freezeProjectionMatrix = function(v) {\n            this._doNotComputeProjectionMatrix = !0, v !== void 0 && (this._projectionMatrix = v);\n          }, h.prototype.unfreezeProjectionMatrix = function() {\n            this._doNotComputeProjectionMatrix = !1;\n          }, h.prototype.getProjectionMatrix = function(v) {\n            var b, D, w, N, M, U, X, j;\n            if (this._doNotComputeProjectionMatrix || !v && this._isSynchronizedProjectionMatrix())\n              return this._projectionMatrix;\n            this._cache.mode = this.mode, this._cache.minZ = this.minZ, this._cache.maxZ = this.maxZ, this._refreshFrustumPlanes = !0;\n            var ne = this.getEngine(), te = this.getScene();\n            if (this.mode === h.PERSPECTIVE_CAMERA) {\n              this._cache.fov = this.fov, this._cache.fovMode = this.fovMode, this._cache.aspectRatio = ne.getAspectRatio(this), this.minZ <= 0 && (this.minZ = 0.1);\n              var de = ne.useReverseDepthBuffer;\n              (te.useRightHandedSystem ? de ? O.a.PerspectiveFovReverseRHToRef : O.a.PerspectiveFovRHToRef : de ? O.a.PerspectiveFovReverseLHToRef : O.a.PerspectiveFovLHToRef)(this.fov, ne.getAspectRatio(this), this.minZ, this.maxZ, this._projectionMatrix, this.fovMode === h.FOVMODE_VERTICAL_FIXED);\n            } else {\n              var pe = ne.getRenderWidth() / 2, ae = ne.getRenderHeight() / 2;\n              te.useRightHandedSystem ? O.a.OrthoOffCenterRHToRef((b = this.orthoLeft) !== null && b !== void 0 ? b : -pe, (D = this.orthoRight) !== null && D !== void 0 ? D : pe, (w = this.orthoBottom) !== null && w !== void 0 ? w : -ae, (N = this.orthoTop) !== null && N !== void 0 ? N : ae, this.minZ, this.maxZ, this._projectionMatrix) : O.a.OrthoOffCenterLHToRef((M = this.orthoLeft) !== null && M !== void 0 ? M : -pe, (U = this.orthoRight) !== null && U !== void 0 ? U : pe, (X = this.orthoBottom) !== null && X !== void 0 ? X : -ae, (j = this.orthoTop) !== null && j !== void 0 ? j : ae, this.minZ, this.maxZ, this._projectionMatrix), this._cache.orthoLeft = this.orthoLeft, this._cache.orthoRight = this.orthoRight, this._cache.orthoBottom = this.orthoBottom, this._cache.orthoTop = this.orthoTop, this._cache.renderWidth = ne.getRenderWidth(), this._cache.renderHeight = ne.getRenderHeight();\n            }\n            return this.onProjectionMatrixChangedObservable.notifyObservers(this), this._projectionMatrix;\n          }, h.prototype.getTransformationMatrix = function() {\n            return this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix), this._transformMatrix;\n          }, h.prototype._updateFrustumPlanes = function() {\n            this._refreshFrustumPlanes && (this.getTransformationMatrix(), this._frustumPlanes ? E.a.GetPlanesToRef(this._transformMatrix, this._frustumPlanes) : this._frustumPlanes = E.a.GetPlanes(this._transformMatrix), this._refreshFrustumPlanes = !1);\n          }, h.prototype.isInFrustum = function(v, b) {\n            if (b === void 0 && (b = !1), this._updateFrustumPlanes(), b && this.rigCameras.length > 0) {\n              var D = !1;\n              return this.rigCameras.forEach(function(w) {\n                w._updateFrustumPlanes(), D = D || v.isInFrustum(w._frustumPlanes);\n              }), D;\n            }\n            return v.isInFrustum(this._frustumPlanes);\n          }, h.prototype.isCompletelyInFrustum = function(v) {\n            return this._updateFrustumPlanes(), v.isCompletelyInFrustum(this._frustumPlanes);\n          }, h.prototype.getForwardRay = function(v, b, D) {\n            throw T.a.WarnImport(\"Ray\");\n          }, h.prototype.getForwardRayToRef = function(v, b, D, w) {\n            throw T.a.WarnImport(\"Ray\");\n          }, h.prototype.dispose = function(v, b) {\n            for (b === void 0 && (b = !1), this.onViewMatrixChangedObservable.clear(), this.onProjectionMatrixChangedObservable.clear(), this.onAfterCheckInputsObservable.clear(), this.onRestoreStateObservable.clear(), this.inputs && this.inputs.clear(), this.getScene().stopAnimation(this), this.getScene().removeCamera(this); this._rigCameras.length > 0; ) {\n              var D = this._rigCameras.pop();\n              D && D.dispose();\n            }\n            if (this._rigPostProcess)\n              this._rigPostProcess.dispose(this), this._rigPostProcess = null, this._postProcesses = [];\n            else if (this.cameraRigMode !== h.RIG_MODE_NONE)\n              this._rigPostProcess = null, this._postProcesses = [];\n            else\n              for (var w = this._postProcesses.length; --w >= 0; ) {\n                var N = this._postProcesses[w];\n                N && N.dispose(this);\n              }\n            for (w = this.customRenderTargets.length; --w >= 0; )\n              this.customRenderTargets[w].dispose();\n            this.customRenderTargets = [], this._activeMeshes.dispose(), l.prototype.dispose.call(this, v, b);\n          }, Object.defineProperty(h.prototype, \"isLeftCamera\", { get: function() {\n            return this._isLeftCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"isRightCamera\", { get: function() {\n            return this._isRightCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"leftCamera\", { get: function() {\n            return this._rigCameras.length < 1 ? null : this._rigCameras[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(h.prototype, \"rightCamera\", { get: function() {\n            return this._rigCameras.length < 2 ? null : this._rigCameras[1];\n          }, enumerable: !1, configurable: !0 }), h.prototype.getLeftTarget = function() {\n            return this._rigCameras.length < 1 ? null : this._rigCameras[0].getTarget();\n          }, h.prototype.getRightTarget = function() {\n            return this._rigCameras.length < 2 ? null : this._rigCameras[1].getTarget();\n          }, h.prototype.setCameraRigMode = function(v, b) {\n            if (this.cameraRigMode !== v) {\n              for (; this._rigCameras.length > 0; ) {\n                var D = this._rigCameras.pop();\n                D && D.dispose();\n              }\n              if (this.cameraRigMode = v, this._cameraRigParams = {}, this._cameraRigParams.interaxialDistance = b.interaxialDistance || 0.0637, this._cameraRigParams.stereoHalfAngle = u.b.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637), this.cameraRigMode !== h.RIG_MODE_NONE) {\n                var w = this.createRigCamera(this.name + \"_L\", 0);\n                w && (w._isLeftCamera = !0);\n                var N = this.createRigCamera(this.name + \"_R\", 1);\n                N && (N._isRightCamera = !0), w && N && (this._rigCameras.push(w), this._rigCameras.push(N));\n              }\n              switch (this.cameraRigMode) {\n                case h.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n                  h._setStereoscopicAnaglyphRigMode(this);\n                  break;\n                case h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n                case h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n                case h.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n                case h.RIG_MODE_STEREOSCOPIC_INTERLACED:\n                  h._setStereoscopicRigMode(this);\n                  break;\n                case h.RIG_MODE_VR:\n                  h._setVRRigMode(this, b);\n                  break;\n                case h.RIG_MODE_WEBVR:\n                  h._setWebVRRigMode(this, b);\n              }\n              this._cascadePostProcessesToRigCams(), this.update();\n            }\n          }, h._setStereoscopicRigMode = function(v) {\n            throw \"Import Cameras/RigModes/stereoscopicRigMode before using stereoscopic rig mode\";\n          }, h._setStereoscopicAnaglyphRigMode = function(v) {\n            throw \"Import Cameras/RigModes/stereoscopicAnaglyphRigMode before using stereoscopic anaglyph rig mode\";\n          }, h._setVRRigMode = function(v, b) {\n            throw \"Import Cameras/RigModes/vrRigMode before using VR rig mode\";\n          }, h._setWebVRRigMode = function(v, b) {\n            throw \"Import Cameras/RigModes/WebVRRigMode before using Web VR rig mode\";\n          }, h.prototype._getVRProjectionMatrix = function() {\n            return O.a.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix), this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix), this._projectionMatrix;\n          }, h.prototype._updateCameraRotationMatrix = function() {\n          }, h.prototype._updateWebVRCameraRotationMatrix = function() {\n          }, h.prototype._getWebVRProjectionMatrix = function() {\n            return O.a.Identity();\n          }, h.prototype._getWebVRViewMatrix = function() {\n            return O.a.Identity();\n          }, h.prototype.setCameraRigParameter = function(v, b) {\n            this._cameraRigParams || (this._cameraRigParams = {}), this._cameraRigParams[v] = b, v === \"interaxialDistance\" && (this._cameraRigParams.stereoHalfAngle = u.b.ToRadians(b / 0.0637));\n          }, h.prototype.createRigCamera = function(v, b) {\n            return null;\n          }, h.prototype._updateRigCameras = function() {\n            for (var v = 0; v < this._rigCameras.length; v++)\n              this._rigCameras[v].minZ = this.minZ, this._rigCameras[v].maxZ = this.maxZ, this._rigCameras[v].fov = this.fov, this._rigCameras[v].upVector.copyFrom(this.upVector);\n            this.cameraRigMode === h.RIG_MODE_STEREOSCOPIC_ANAGLYPH && (this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport);\n          }, h.prototype._setupInputs = function() {\n          }, h.prototype.serialize = function() {\n            var v = _.a.Serialize(this);\n            return v.type = this.getClassName(), this.parent && (v.parentId = this.parent.id), this.inputs && this.inputs.serialize(v), _.a.AppendSerializedAnimations(this, v), v.ranges = this.serializeAnimationRanges(), v;\n          }, h.prototype.clone = function(v) {\n            return _.a.Clone(h.GetConstructorFromName(this.getClassName(), v, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);\n          }, h.prototype.getDirection = function(v) {\n            var b = O.e.Zero();\n            return this.getDirectionToRef(v, b), b;\n          }, Object.defineProperty(h.prototype, \"absoluteRotation\", { get: function() {\n            var v = O.b.Zero();\n            return this.getWorldMatrix().decompose(void 0, v), v;\n          }, enumerable: !1, configurable: !0 }), h.prototype.getDirectionToRef = function(v, b) {\n            O.e.TransformNormalToRef(v, this.getWorldMatrix(), b);\n          }, h.GetConstructorFromName = function(v, b, D, w, N) {\n            w === void 0 && (w = 0), N === void 0 && (N = !0);\n            var M = x.a.Construct(v, b, D, { interaxial_distance: w, isStereoscopicSideBySide: N });\n            return M || function() {\n              return h._createDefaultParsedCamera(b, D);\n            };\n          }, h.prototype.computeWorldMatrix = function() {\n            return this.getWorldMatrix();\n          }, h.Parse = function(v, b) {\n            var D = v.type, w = h.GetConstructorFromName(D, v.name, b, v.interaxial_distance, v.isStereoscopicSideBySide), N = _.a.Parse(w, v, b);\n            if (v.parentId && (N._waitingParentId = v.parentId), N.inputs && (N.inputs.parse(v), N._setupInputs()), v.upVector && (N.upVector = O.e.FromArray(v.upVector)), N.setPosition && (N.position.copyFromFloats(0, 0, 0), N.setPosition(O.e.FromArray(v.position))), v.target && N.setTarget && N.setTarget(O.e.FromArray(v.target)), v.cameraRigMode) {\n              var M = v.interaxial_distance ? { interaxialDistance: v.interaxial_distance } : {};\n              N.setCameraRigMode(v.cameraRigMode, M);\n            }\n            if (v.animations) {\n              for (var U = 0; U < v.animations.length; U++) {\n                var X = v.animations[U], j = c.a.GetClass(\"BABYLON.Animation\");\n                j && N.animations.push(j.Parse(X));\n              }\n              x.a.ParseAnimationRanges(N, v, b);\n            }\n            return v.autoAnimate && b.beginAnimation(N, v.autoAnimateFrom, v.autoAnimateTo, v.autoAnimateLoop, v.autoAnimateSpeed || 1), N;\n          }, h._createDefaultParsedCamera = function(v, b) {\n            throw T.a.WarnImport(\"UniversalCamera\");\n          }, h.PERSPECTIVE_CAMERA = 0, h.ORTHOGRAPHIC_CAMERA = 1, h.FOVMODE_VERTICAL_FIXED = 0, h.FOVMODE_HORIZONTAL_FIXED = 1, h.RIG_MODE_NONE = 0, h.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10, h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11, h.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12, h.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13, h.RIG_MODE_STEREOSCOPIC_INTERLACED = 14, h.RIG_MODE_VR = 20, h.RIG_MODE_WEBVR = 21, h.RIG_MODE_CUSTOM = 22, h.ForceAttachControlToAlwaysPreventDefault = !1, Object(V.c)([Object(_.o)(\"position\")], h.prototype, \"_position\", void 0), Object(V.c)([Object(_.o)(\"upVector\")], h.prototype, \"_upVector\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoLeft\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoRight\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoBottom\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"orthoTop\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"fov\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"minZ\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"maxZ\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"inertia\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"mode\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"layerMask\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"fovMode\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"cameraRigMode\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"interaxialDistance\", void 0), Object(V.c)([Object(_.c)()], h.prototype, \"isStereoscopicSideBySide\", void 0), h;\n        }(x.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return S;\n        });\n        var V = f(1), _ = f(3), C = f(12), u = f(6), I = f(22), O = f(61), x = f(85), m = f(2), c = f(8), T = f(64), S = function() {\n          function E(g, l, h) {\n            this.shadowDepthWrapper = null, this.allowShaderHotSwapping = !0, this.metadata = null, this.reservedDataStore = null, this.checkReadyOnEveryCall = !1, this.checkReadyOnlyOnce = !1, this.state = \"\", this._alpha = 1, this._backFaceCulling = !0, this.onCompiled = null, this.onError = null, this.getRenderTargetTextures = null, this.doNotSerialize = !1, this._storeEffectOnSubMeshes = !1, this.animations = null, this.onDisposeObservable = new u.c(), this._onDisposeObserver = null, this._onUnBindObservable = null, this._onBindObserver = null, this._alphaMode = m.a.ALPHA_COMBINE, this._needDepthPrePass = !1, this.disableDepthWrite = !1, this.disableColorWrite = !1, this.forceDepthWrite = !1, this.depthFunction = 0, this.separateCullingPass = !1, this._fogEnabled = !0, this.pointSize = 1, this.zOffset = 0, this._effect = null, this._useUBO = !1, this._fillMode = E.TriangleFillMode, this._cachedDepthWriteState = !1, this._cachedColorWriteState = !1, this._cachedDepthFunctionState = 0, this._indexInSceneMaterialArray = -1, this.meshMap = null, this._forceAlphaTest = !1, this._transparencyMode = null, this.name = g;\n            var v = 1;\n            for (this._scene = l || I.a.LastCreatedScene, this.id = g || C.b.RandomId(); this._scene.getMaterialByID(this.id); )\n              this.id = g + \" \" + v++;\n            this.uniqueId = this._scene.getUniqueId(), this._scene.useRightHandedSystem ? this.sideOrientation = E.ClockWiseSideOrientation : this.sideOrientation = E.CounterClockWiseSideOrientation, this._uniformBuffer = new x.a(this._scene.getEngine()), this._useUBO = this.getScene().getEngine().supportsUniformBuffers, h || this._scene.addMaterial(this), this._scene.useMaterialMeshMap && (this.meshMap = {});\n          }\n          return Object.defineProperty(E.prototype, \"canRenderToMRT\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"alpha\", { get: function() {\n            return this._alpha;\n          }, set: function(g) {\n            this._alpha !== g && (this._alpha = g, this.markAsDirty(E.MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"backFaceCulling\", { get: function() {\n            return this._backFaceCulling;\n          }, set: function(g) {\n            this._backFaceCulling !== g && (this._backFaceCulling = g, this.markAsDirty(E.TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onDispose\", { set: function(g) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(g);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onBindObservable\", { get: function() {\n            return this._onBindObservable || (this._onBindObservable = new u.c()), this._onBindObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onBind\", { set: function(g) {\n            this._onBindObserver && this.onBindObservable.remove(this._onBindObserver), this._onBindObserver = this.onBindObservable.add(g);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onUnBindObservable\", { get: function() {\n            return this._onUnBindObservable || (this._onUnBindObservable = new u.c()), this._onUnBindObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"onEffectCreatedObservable\", { get: function() {\n            return this._onEffectCreatedObservable || (this._onEffectCreatedObservable = new u.c()), this._onEffectCreatedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"alphaMode\", { get: function() {\n            return this._alphaMode;\n          }, set: function(g) {\n            this._alphaMode !== g && (this._alphaMode = g, this.markAsDirty(E.TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"needDepthPrePass\", { get: function() {\n            return this._needDepthPrePass;\n          }, set: function(g) {\n            this._needDepthPrePass !== g && (this._needDepthPrePass = g, this._needDepthPrePass && (this.checkReadyOnEveryCall = !0));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"fogEnabled\", { get: function() {\n            return this._fogEnabled;\n          }, set: function(g) {\n            this._fogEnabled !== g && (this._fogEnabled = g, this.markAsDirty(E.MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"wireframe\", { get: function() {\n            switch (this._fillMode) {\n              case E.WireFrameFillMode:\n              case E.LineListDrawMode:\n              case E.LineLoopDrawMode:\n              case E.LineStripDrawMode:\n                return !0;\n            }\n            return this._scene.forceWireframe;\n          }, set: function(g) {\n            this.fillMode = g ? E.WireFrameFillMode : E.TriangleFillMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"pointsCloud\", { get: function() {\n            switch (this._fillMode) {\n              case E.PointFillMode:\n              case E.PointListDrawMode:\n                return !0;\n            }\n            return this._scene.forcePointsCloud;\n          }, set: function(g) {\n            this.fillMode = g ? E.PointFillMode : E.TriangleFillMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"fillMode\", { get: function() {\n            return this._fillMode;\n          }, set: function(g) {\n            this._fillMode !== g && (this._fillMode = g, this.markAsDirty(E.MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), E.prototype.toString = function(g) {\n            return \"Name: \" + this.name;\n          }, E.prototype.getClassName = function() {\n            return \"Material\";\n          }, Object.defineProperty(E.prototype, \"isFrozen\", { get: function() {\n            return this.checkReadyOnlyOnce;\n          }, enumerable: !1, configurable: !0 }), E.prototype.freeze = function() {\n            this.markDirty(), this.checkReadyOnlyOnce = !0;\n          }, E.prototype.unfreeze = function() {\n            this.markDirty(), this.checkReadyOnlyOnce = !1;\n          }, E.prototype.isReady = function(g, l) {\n            return !0;\n          }, E.prototype.isReadyForSubMesh = function(g, l, h) {\n            return !1;\n          }, E.prototype.getEffect = function() {\n            return this._effect;\n          }, E.prototype.getScene = function() {\n            return this._scene;\n          }, Object.defineProperty(E.prototype, \"transparencyMode\", { get: function() {\n            return this._transparencyMode;\n          }, set: function(g) {\n            this._transparencyMode !== g && (this._transparencyMode = g, this._forceAlphaTest = g === E.MATERIAL_ALPHATESTANDBLEND, this._markAllSubMeshesAsTexturesAndMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"_disableAlphaBlending\", { get: function() {\n            return this._transparencyMode === E.MATERIAL_OPAQUE || this._transparencyMode === E.MATERIAL_ALPHATEST;\n          }, enumerable: !1, configurable: !0 }), E.prototype.needAlphaBlending = function() {\n            return !this._disableAlphaBlending && this.alpha < 1;\n          }, E.prototype.needAlphaBlendingForMesh = function(g) {\n            return !(this._disableAlphaBlending && g.visibility >= 1) && (this.needAlphaBlending() || g.visibility < 1 || g.hasVertexAlpha);\n          }, E.prototype.needAlphaTesting = function() {\n            return !!this._forceAlphaTest;\n          }, E.prototype._shouldTurnAlphaTestOn = function(g) {\n            return !this.needAlphaBlendingForMesh(g) && this.needAlphaTesting();\n          }, E.prototype.getAlphaTestTexture = function() {\n            return null;\n          }, E.prototype.markDirty = function() {\n            for (var g = 0, l = this.getScene().meshes; g < l.length; g++) {\n              var h = l[g];\n              if (h.subMeshes)\n                for (var v = 0, b = h.subMeshes; v < b.length; v++) {\n                  var D = b[v];\n                  D.getMaterial() === this && D.effect && (D.effect._wasPreviouslyReady = !1);\n                }\n            }\n          }, E.prototype._preBind = function(g, l) {\n            l === void 0 && (l = null);\n            var h = this._scene.getEngine(), v = (l ?? this.sideOrientation) === E.ClockWiseSideOrientation;\n            return h.enableEffect(g || this._effect), h.setState(this.backFaceCulling, this.zOffset, !1, v), v;\n          }, E.prototype.bind = function(g, l) {\n          }, E.prototype.bindForSubMesh = function(g, l, h) {\n          }, E.prototype.bindOnlyWorldMatrix = function(g) {\n          }, E.prototype.bindSceneUniformBuffer = function(g, l) {\n            l.bindToEffect(g, \"Scene\");\n          }, E.prototype.bindView = function(g) {\n            this._useUBO ? this.bindSceneUniformBuffer(g, this.getScene().getSceneUniformBuffer()) : g.setMatrix(\"view\", this.getScene().getViewMatrix());\n          }, E.prototype.bindViewProjection = function(g) {\n            this._useUBO ? this.bindSceneUniformBuffer(g, this.getScene().getSceneUniformBuffer()) : g.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix());\n          }, E.prototype._afterBind = function(g) {\n            if (this._scene._cachedMaterial = this, this._scene._cachedVisibility = g ? g.visibility : 1, this._onBindObservable && g && this._onBindObservable.notifyObservers(g), this.disableDepthWrite) {\n              var l = this._scene.getEngine();\n              this._cachedDepthWriteState = l.getDepthWrite(), l.setDepthWrite(!1);\n            }\n            this.disableColorWrite && (l = this._scene.getEngine(), this._cachedColorWriteState = l.getColorWrite(), l.setColorWrite(!1)), this.depthFunction !== 0 && (l = this._scene.getEngine(), this._cachedDepthFunctionState = l.getDepthFunction() || 0, l.setDepthFunction(this.depthFunction));\n          }, E.prototype.unbind = function() {\n            this._onUnBindObservable && this._onUnBindObservable.notifyObservers(this), this.depthFunction !== 0 && this._scene.getEngine().setDepthFunction(this._cachedDepthFunctionState), this.disableDepthWrite && this._scene.getEngine().setDepthWrite(this._cachedDepthWriteState), this.disableColorWrite && this._scene.getEngine().setColorWrite(this._cachedColorWriteState);\n          }, E.prototype.getActiveTextures = function() {\n            return [];\n          }, E.prototype.hasTexture = function(g) {\n            return !1;\n          }, E.prototype.clone = function(g) {\n            return null;\n          }, E.prototype.getBindedMeshes = function() {\n            var g = this;\n            if (this.meshMap) {\n              var l = new Array();\n              for (var h in this.meshMap) {\n                var v = this.meshMap[h];\n                v && l.push(v);\n              }\n              return l;\n            }\n            return this._scene.meshes.filter(function(b) {\n              return b.material === g;\n            });\n          }, E.prototype.forceCompilation = function(g, l, h, v) {\n            var b = this, D = Object(V.a)({ clipPlane: !1, useInstances: !1 }, h), w = this.getScene(), N = this.allowShaderHotSwapping;\n            this.allowShaderHotSwapping = !1;\n            var M = function() {\n              if (b._scene && b._scene.getEngine()) {\n                var U = w.clipPlane;\n                if (D.clipPlane && (w.clipPlane = new T.a(0, 0, 0, 1)), b._storeEffectOnSubMeshes) {\n                  var X = !0, j = null;\n                  if (g.subMeshes) {\n                    var ne = new O.a(0, 0, 0, 0, 0, g, void 0, !1, !1);\n                    ne._materialDefines && (ne._materialDefines._renderId = -1), b.isReadyForSubMesh(g, ne, D.useInstances) || (ne.effect && ne.effect.getCompilationError() && ne.effect.allFallbacksProcessed() ? j = ne.effect.getCompilationError() : (X = !1, setTimeout(M, 16)));\n                  }\n                  X && (b.allowShaderHotSwapping = N, j && v && v(j), l && l(b));\n                } else\n                  b.isReady() ? (b.allowShaderHotSwapping = N, l && l(b)) : setTimeout(M, 16);\n                D.clipPlane && (w.clipPlane = U);\n              }\n            };\n            M();\n          }, E.prototype.forceCompilationAsync = function(g, l) {\n            var h = this;\n            return new Promise(function(v, b) {\n              h.forceCompilation(g, function() {\n                v();\n              }, l, function(D) {\n                b(D);\n              });\n            });\n          }, E.prototype.markAsDirty = function(g) {\n            this.getScene().blockMaterialDirtyMechanism || (E._DirtyCallbackArray.length = 0, g & E.TextureDirtyFlag && E._DirtyCallbackArray.push(E._TextureDirtyCallBack), g & E.LightDirtyFlag && E._DirtyCallbackArray.push(E._LightsDirtyCallBack), g & E.FresnelDirtyFlag && E._DirtyCallbackArray.push(E._FresnelDirtyCallBack), g & E.AttributesDirtyFlag && E._DirtyCallbackArray.push(E._AttributeDirtyCallBack), g & E.MiscDirtyFlag && E._DirtyCallbackArray.push(E._MiscDirtyCallBack), g & E.PrePassDirtyFlag && E._DirtyCallbackArray.push(E._PrePassDirtyCallBack), E._DirtyCallbackArray.length && this._markAllSubMeshesAsDirty(E._RunDirtyCallBacks), this.getScene().resetCachedMaterial());\n          }, E.prototype._markAllSubMeshesAsDirty = function(g) {\n            if (!this.getScene().blockMaterialDirtyMechanism)\n              for (var l = 0, h = this.getScene().meshes; l < h.length; l++) {\n                var v = h[l];\n                if (v.subMeshes)\n                  for (var b = 0, D = v.subMeshes; b < D.length; b++) {\n                    var w = D[b];\n                    w.getMaterial() === this && w._materialDefines && g(w._materialDefines);\n                  }\n              }\n          }, E.prototype._markScenePrePassDirty = function() {\n            if (!this.getScene().blockMaterialDirtyMechanism) {\n              var g = this.getScene().enablePrePassRenderer();\n              g && g.markAsDirty();\n            }\n          }, E.prototype._markAllSubMeshesAsAllDirty = function() {\n            this._markAllSubMeshesAsDirty(E._AllDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsImageProcessingDirty = function() {\n            this._markAllSubMeshesAsDirty(E._ImageProcessingDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._markAllSubMeshesAsDirty(E._TextureDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsFresnelDirty = function() {\n            this._markAllSubMeshesAsDirty(E._FresnelDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsFresnelAndMiscDirty = function() {\n            this._markAllSubMeshesAsDirty(E._FresnelAndMiscDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsLightsDirty = function() {\n            this._markAllSubMeshesAsDirty(E._LightsDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsAttributesDirty = function() {\n            this._markAllSubMeshesAsDirty(E._AttributeDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsMiscDirty = function() {\n            this._markAllSubMeshesAsDirty(E._MiscDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsPrePassDirty = function() {\n            this._markAllSubMeshesAsDirty(E._MiscDirtyCallBack);\n          }, E.prototype._markAllSubMeshesAsTexturesAndMiscDirty = function() {\n            this._markAllSubMeshesAsDirty(E._TextureAndMiscDirtyCallBack);\n          }, E.prototype.setPrePassRenderer = function(g) {\n            return !1;\n          }, E.prototype.dispose = function(g, l, h) {\n            var v = this.getScene();\n            if (v.stopAnimation(this), v.freeProcessedMaterials(), v.removeMaterial(this), h !== !0)\n              if (this.meshMap)\n                for (var b in this.meshMap)\n                  (N = this.meshMap[b]) && (N.material = null, this.releaseVertexArrayObject(N, g));\n              else\n                for (var D = 0, w = v.meshes; D < w.length; D++) {\n                  var N;\n                  (N = w[D]).material !== this || N.sourceMesh || (N.material = null, this.releaseVertexArrayObject(N, g));\n                }\n            this._uniformBuffer.dispose(), g && this._effect && (this._storeEffectOnSubMeshes || this._effect.dispose(), this._effect = null), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._onBindObservable && this._onBindObservable.clear(), this._onUnBindObservable && this._onUnBindObservable.clear(), this._onEffectCreatedObservable && this._onEffectCreatedObservable.clear();\n          }, E.prototype.releaseVertexArrayObject = function(g, l) {\n            if (g.geometry) {\n              var h = g.geometry;\n              if (this._storeEffectOnSubMeshes)\n                for (var v = 0, b = g.subMeshes; v < b.length; v++) {\n                  var D = b[v];\n                  h._releaseVertexArrayObject(D._materialEffect), l && D._materialEffect && D._materialEffect.dispose();\n                }\n              else\n                h._releaseVertexArrayObject(this._effect);\n            }\n          }, E.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, E.Parse = function(g, l, h) {\n            if (g.customType) {\n              if (g.customType === \"BABYLON.PBRMaterial\" && g.overloadedAlbedo && (g.customType = \"BABYLON.LegacyPBRMaterial\", !BABYLON.LegacyPBRMaterial))\n                return c.a.Error(\"Your scene is trying to load a legacy version of the PBRMaterial, please, include it from the materials library.\"), null;\n            } else\n              g.customType = \"BABYLON.StandardMaterial\";\n            return C.b.Instantiate(g.customType).Parse(g, l, h);\n          }, E.TriangleFillMode = m.a.MATERIAL_TriangleFillMode, E.WireFrameFillMode = m.a.MATERIAL_WireFrameFillMode, E.PointFillMode = m.a.MATERIAL_PointFillMode, E.PointListDrawMode = m.a.MATERIAL_PointListDrawMode, E.LineListDrawMode = m.a.MATERIAL_LineListDrawMode, E.LineLoopDrawMode = m.a.MATERIAL_LineLoopDrawMode, E.LineStripDrawMode = m.a.MATERIAL_LineStripDrawMode, E.TriangleStripDrawMode = m.a.MATERIAL_TriangleStripDrawMode, E.TriangleFanDrawMode = m.a.MATERIAL_TriangleFanDrawMode, E.ClockWiseSideOrientation = m.a.MATERIAL_ClockWiseSideOrientation, E.CounterClockWiseSideOrientation = m.a.MATERIAL_CounterClockWiseSideOrientation, E.TextureDirtyFlag = m.a.MATERIAL_TextureDirtyFlag, E.LightDirtyFlag = m.a.MATERIAL_LightDirtyFlag, E.FresnelDirtyFlag = m.a.MATERIAL_FresnelDirtyFlag, E.AttributesDirtyFlag = m.a.MATERIAL_AttributesDirtyFlag, E.MiscDirtyFlag = m.a.MATERIAL_MiscDirtyFlag, E.PrePassDirtyFlag = m.a.MATERIAL_PrePassDirtyFlag, E.AllDirtyFlag = m.a.MATERIAL_AllDirtyFlag, E.MATERIAL_OPAQUE = 0, E.MATERIAL_ALPHATEST = 1, E.MATERIAL_ALPHABLEND = 2, E.MATERIAL_ALPHATESTANDBLEND = 3, E.MATERIAL_NORMALBLENDMETHOD_WHITEOUT = 0, E.MATERIAL_NORMALBLENDMETHOD_RNM = 1, E._AllDirtyCallBack = function(g) {\n            return g.markAllAsDirty();\n          }, E._ImageProcessingDirtyCallBack = function(g) {\n            return g.markAsImageProcessingDirty();\n          }, E._TextureDirtyCallBack = function(g) {\n            return g.markAsTexturesDirty();\n          }, E._FresnelDirtyCallBack = function(g) {\n            return g.markAsFresnelDirty();\n          }, E._MiscDirtyCallBack = function(g) {\n            return g.markAsMiscDirty();\n          }, E._PrePassDirtyCallBack = function(g) {\n            return g.markAsPrePassDirty();\n          }, E._LightsDirtyCallBack = function(g) {\n            return g.markAsLightDirty();\n          }, E._AttributeDirtyCallBack = function(g) {\n            return g.markAsAttributesDirty();\n          }, E._FresnelAndMiscDirtyCallBack = function(g) {\n            E._FresnelDirtyCallBack(g), E._MiscDirtyCallBack(g);\n          }, E._TextureAndMiscDirtyCallBack = function(g) {\n            E._TextureDirtyCallBack(g), E._MiscDirtyCallBack(g);\n          }, E._DirtyCallbackArray = [], E._RunDirtyCallBacks = function(g) {\n            for (var l = 0, h = E._DirtyCallbackArray; l < h.length; l++)\n              (0, h[l])(g);\n          }, Object(V.c)([Object(_.c)()], E.prototype, \"id\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"uniqueId\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"name\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"checkReadyOnEveryCall\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"checkReadyOnlyOnce\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"state\", void 0), Object(V.c)([Object(_.c)(\"alpha\")], E.prototype, \"_alpha\", void 0), Object(V.c)([Object(_.c)(\"backFaceCulling\")], E.prototype, \"_backFaceCulling\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"sideOrientation\", void 0), Object(V.c)([Object(_.c)(\"alphaMode\")], E.prototype, \"_alphaMode\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"_needDepthPrePass\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"disableDepthWrite\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"disableColorWrite\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"forceDepthWrite\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"depthFunction\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"separateCullingPass\", void 0), Object(V.c)([Object(_.c)(\"fogEnabled\")], E.prototype, \"_fogEnabled\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"pointSize\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"zOffset\", void 0), Object(V.c)([Object(_.c)()], E.prototype, \"pointsCloud\", null), Object(V.c)([Object(_.c)()], E.prototype, \"fillMode\", null), Object(V.c)([Object(_.c)()], E.prototype, \"transparencyMode\", null), E;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return w;\n        });\n        var V = f(22), _ = f(5), C = f(21), u = f(6), I = f(141), O = f(142), x = f(143), m = f(2), c = f(27), T = f(8), S = f(38), E = function() {\n          function N() {\n          }\n          return N.prototype.postProcessor = function(M, U, X, j) {\n            return j.getCaps().drawBuffersExtension || (M = M.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g, \"\")), M;\n          }, N;\n        }(), g = f(118), l = f(88), h = f(144), v = f(70), b = f(74), D = function() {\n        }, w = function() {\n          function N(M, U, X, j) {\n            var ne = this;\n            j === void 0 && (j = !1), this.forcePOTTextures = !1, this.isFullscreen = !1, this.cullBackFaces = !0, this.renderEvenInBackground = !0, this.preventCacheWipeBetweenFrames = !1, this.validateShaderPrograms = !1, this.useReverseDepthBuffer = !1, this.disableUniformBuffers = !1, this._uniformBuffers = new Array(), this._webGLVersion = 1, this._windowIsBackground = !1, this._highPrecisionShadersAllowed = !0, this._badOS = !1, this._badDesktopOS = !1, this._renderingQueueLaunched = !1, this._activeRenderLoops = new Array(), this.onContextLostObservable = new u.c(), this.onContextRestoredObservable = new u.c(), this._contextWasLost = !1, this._doNotHandleContextLost = !1, this.disableVertexArrayObjects = !1, this._colorWrite = !0, this._colorWriteChanged = !0, this._depthCullingState = new I.a(), this._stencilState = new O.a(), this._alphaState = new x.a(), this._alphaMode = m.a.ALPHA_ADD, this._alphaEquation = m.a.ALPHA_DISABLE, this._internalTexturesCache = new Array(), this._activeChannel = 0, this._currentTextureChannel = -1, this._boundTexturesCache = {}, this._compiledEffects = {}, this._vertexAttribArraysEnabled = [], this._uintIndicesCurrentlySet = !1, this._currentBoundBuffer = new Array(), this._currentFramebuffer = null, this._dummyFramebuffer = null, this._currentBufferPointers = new Array(), this._currentInstanceLocations = new Array(), this._currentInstanceBuffers = new Array(), this._vaoRecordInProgress = !1, this._mustWipeVertexAttributes = !1, this._nextFreeTextureSlots = new Array(), this._maxSimultaneousTextures = 0, this._activeRequests = new Array(), this._transformTextureUrl = null, this.hostInformation = { isMobile: !1 }, this.premultipliedAlpha = !0, this.onBeforeTextureInitObservable = new u.c(), this._viewportCached = { x: 0, y: 0, z: 0, w: 0 }, this._unpackFlipYCached = null, this.enableUnpackFlipYCached = !0, this._getDepthStencilBuffer = function(W, q, he, ge, me, _e) {\n              var ye = ne._gl, Pe = ye.createRenderbuffer();\n              return ye.bindRenderbuffer(ye.RENDERBUFFER, Pe), he > 1 && ye.renderbufferStorageMultisample ? ye.renderbufferStorageMultisample(ye.RENDERBUFFER, he, me, W, q) : ye.renderbufferStorage(ye.RENDERBUFFER, ge, W, q), ye.framebufferRenderbuffer(ye.FRAMEBUFFER, _e, ye.RENDERBUFFER, Pe), ye.bindRenderbuffer(ye.RENDERBUFFER, null), Pe;\n            }, this._boundUniforms = {};\n            var te = null;\n            if (M) {\n              if (X = X || {}, b.a.SetMatrixPrecision(!!X.useHighPrecisionMatrix), M.getContext) {\n                if (te = M, this._renderingCanvas = te, U != null && (X.antialias = U), X.deterministicLockstep === void 0 && (X.deterministicLockstep = !1), X.lockstepMaxSteps === void 0 && (X.lockstepMaxSteps = 4), X.timeStep === void 0 && (X.timeStep = 1 / 60), X.preserveDrawingBuffer === void 0 && (X.preserveDrawingBuffer = !1), X.audioEngine === void 0 && (X.audioEngine = !0), X.stencil === void 0 && (X.stencil = !0), X.premultipliedAlpha === !1 && (this.premultipliedAlpha = !1), X.xrCompatible === void 0 && (X.xrCompatible = !0), this._doNotHandleContextLost = !!X.doNotHandleContextLost, navigator && navigator.userAgent) {\n                  var de = navigator.userAgent;\n                  this.hostInformation.isMobile = de.indexOf(\"Mobile\") !== -1;\n                  for (var pe = 0, ae = N.ExceptionList; pe < ae.length; pe++) {\n                    var ee = ae[pe], K = ee.key, $ = ee.targets;\n                    if (new RegExp(K).test(de)) {\n                      if (ee.capture && ee.captureConstraint) {\n                        var L = ee.capture, G = ee.captureConstraint, Q = new RegExp(L).exec(de);\n                        if (Q && Q.length > 0 && parseInt(Q[Q.length - 1]) >= G)\n                          continue;\n                      }\n                      for (var oe = 0, re = $; oe < re.length; oe++)\n                        switch (re[oe]) {\n                          case \"uniformBuffer\":\n                            this.disableUniformBuffers = !0;\n                            break;\n                          case \"vao\":\n                            this.disableVertexArrayObjects = !0;\n                        }\n                    }\n                  }\n                }\n                if (this._doNotHandleContextLost || (this._onContextLost = function(W) {\n                  W.preventDefault(), ne._contextWasLost = !0, T.a.Warn(\"WebGL context lost.\"), ne.onContextLostObservable.notifyObservers(ne);\n                }, this._onContextRestored = function() {\n                  setTimeout(function() {\n                    ne._initGLContext(), ne._rebuildEffects(), ne._rebuildInternalTextures(), ne._rebuildBuffers(), ne.wipeCaches(!0), T.a.Warn(\"WebGL context successfully restored.\"), ne.onContextRestoredObservable.notifyObservers(ne), ne._contextWasLost = !1;\n                  }, 0);\n                }, te.addEventListener(\"webglcontextlost\", this._onContextLost, !1), te.addEventListener(\"webglcontextrestored\", this._onContextRestored, !1), X.powerPreference = \"high-performance\"), !X.disableWebGL2Support)\n                  try {\n                    this._gl = te.getContext(\"webgl2\", X) || te.getContext(\"experimental-webgl2\", X), this._gl && (this._webGLVersion = 2, this._gl.deleteQuery || (this._webGLVersion = 1));\n                  } catch {\n                  }\n                if (!this._gl) {\n                  if (!te)\n                    throw new Error(\"The provided canvas is null or undefined.\");\n                  try {\n                    this._gl = te.getContext(\"webgl\", X) || te.getContext(\"experimental-webgl\", X);\n                  } catch {\n                    throw new Error(\"WebGL not supported\");\n                  }\n                }\n                if (!this._gl)\n                  throw new Error(\"WebGL not supported\");\n              } else {\n                this._gl = M, this._renderingCanvas = this._gl.canvas, this._gl.renderbufferStorageMultisample && (this._webGLVersion = 2);\n                var Y = this._gl.getContextAttributes();\n                Y && (X.stencil = Y.stencil);\n              }\n              this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), X.useHighPrecisionFloats !== void 0 && (this._highPrecisionShadersAllowed = X.useHighPrecisionFloats);\n              var k = S.a.IsWindowObjectExist() && window.devicePixelRatio || 1, H = X.limitDeviceRatio || k;\n              this._hardwareScalingLevel = j ? 1 / Math.min(H, k) : 1, this.resize(), this._isStencilEnable = !!X.stencil, this._initGLContext();\n              for (var Z = 0; Z < this._caps.maxVertexAttribs; Z++)\n                this._currentBufferPointers[Z] = new D();\n              this.webGLVersion > 1 ? this._shaderProcessor = new g.a() : this._shaderProcessor = new E(), this._badOS = /iPad/i.test(navigator.userAgent) || /iPhone/i.test(navigator.userAgent), this._badDesktopOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), this._creationOptions = X, console.log(\"Babylon.js v\" + N.Version + \" - \" + this.description);\n            }\n          }\n          return Object.defineProperty(N, \"NpmPackage\", { get: function() {\n            return \"babylonjs@4.2.2\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N, \"Version\", { get: function() {\n            return \"4.2.2\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"description\", { get: function() {\n            var M = \"WebGL\" + this.webGLVersion;\n            return this._caps.parallelShaderCompile && (M += \" - Parallel shader compilation\"), M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N, \"ShadersRepository\", { get: function() {\n            return _.a.ShadersRepository;\n          }, set: function(M) {\n            _.a.ShadersRepository = M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"supportsUniformBuffers\", { get: function() {\n            return this.webGLVersion > 1 && !this.disableUniformBuffers;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"_shouldUseHighPrecisionShader\", { get: function() {\n            return !(!this._caps.highPrecisionShaderSupported || !this._highPrecisionShadersAllowed);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"needPOTTextures\", { get: function() {\n            return this._webGLVersion < 2 || this.forcePOTTextures;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"doNotHandleContextLost\", { get: function() {\n            return this._doNotHandleContextLost;\n          }, set: function(M) {\n            this._doNotHandleContextLost = M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"_supportsHardwareTextureRescaling\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"framebufferDimensionsObject\", { set: function(M) {\n            this._framebufferDimensionsObject = M;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"currentViewport\", { get: function() {\n            return this._cachedViewport;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyTexture\", { get: function() {\n            return this._emptyTexture || (this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, m.a.TEXTUREFORMAT_RGBA, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyTexture3D\", { get: function() {\n            return this._emptyTexture3D || (this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, m.a.TEXTUREFORMAT_RGBA, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture3D;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyTexture2DArray\", { get: function() {\n            return this._emptyTexture2DArray || (this._emptyTexture2DArray = this.createRawTexture2DArray(new Uint8Array(4), 1, 1, 1, m.a.TEXTUREFORMAT_RGBA, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE)), this._emptyTexture2DArray;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"emptyCubeTexture\", { get: function() {\n            if (!this._emptyCubeTexture) {\n              var M = new Uint8Array(4), U = [M, M, M, M, M, M];\n              this._emptyCubeTexture = this.createRawCubeTexture(U, 1, m.a.TEXTUREFORMAT_RGBA, m.a.TEXTURETYPE_UNSIGNED_INT, !1, !1, m.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n            return this._emptyCubeTexture;\n          }, enumerable: !1, configurable: !0 }), N.prototype._rebuildInternalTextures = function() {\n            for (var M = 0, U = this._internalTexturesCache.slice(); M < U.length; M++)\n              U[M]._rebuild();\n          }, N.prototype._rebuildEffects = function() {\n            for (var M in this._compiledEffects)\n              this._compiledEffects[M]._prepareEffect();\n            _.a.ResetCache();\n          }, N.prototype.areAllEffectsReady = function() {\n            for (var M in this._compiledEffects)\n              if (!this._compiledEffects[M].isReady())\n                return !1;\n            return !0;\n          }, N.prototype._rebuildBuffers = function() {\n            for (var M = 0, U = this._uniformBuffers; M < U.length; M++)\n              U[M]._rebuild();\n          }, N.prototype._initGLContext = function() {\n            this._caps = { maxTexturesImageUnits: this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS), maxCombinedTexturesImageUnits: this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS), maxVertexTextureImageUnits: this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), maxTextureSize: this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE), maxSamples: this._webGLVersion > 1 ? this._gl.getParameter(this._gl.MAX_SAMPLES) : 1, maxCubemapTextureSize: this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE), maxRenderTextureSize: this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE), maxVertexAttribs: this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS), maxVaryingVectors: this._gl.getParameter(this._gl.MAX_VARYING_VECTORS), maxFragmentUniformVectors: this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS), maxVertexUniformVectors: this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS), parallelShaderCompile: this._gl.getExtension(\"KHR_parallel_shader_compile\"), standardDerivatives: this._webGLVersion > 1 || this._gl.getExtension(\"OES_standard_derivatives\") !== null, maxAnisotropy: 1, astc: this._gl.getExtension(\"WEBGL_compressed_texture_astc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_astc\"), bptc: this._gl.getExtension(\"EXT_texture_compression_bptc\") || this._gl.getExtension(\"WEBKIT_EXT_texture_compression_bptc\"), s3tc: this._gl.getExtension(\"WEBGL_compressed_texture_s3tc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_s3tc\"), pvrtc: this._gl.getExtension(\"WEBGL_compressed_texture_pvrtc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\"), etc1: this._gl.getExtension(\"WEBGL_compressed_texture_etc1\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_etc1\"), etc2: this._gl.getExtension(\"WEBGL_compressed_texture_etc\") || this._gl.getExtension(\"WEBKIT_WEBGL_compressed_texture_etc\") || this._gl.getExtension(\"WEBGL_compressed_texture_es3_0\"), textureAnisotropicFilterExtension: this._gl.getExtension(\"EXT_texture_filter_anisotropic\") || this._gl.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\") || this._gl.getExtension(\"MOZ_EXT_texture_filter_anisotropic\"), uintIndices: this._webGLVersion > 1 || this._gl.getExtension(\"OES_element_index_uint\") !== null, fragmentDepthSupported: this._webGLVersion > 1 || this._gl.getExtension(\"EXT_frag_depth\") !== null, highPrecisionShaderSupported: !1, timerQuery: this._gl.getExtension(\"EXT_disjoint_timer_query_webgl2\") || this._gl.getExtension(\"EXT_disjoint_timer_query\"), canUseTimestampForTimerQuery: !1, drawBuffersExtension: !1, maxMSAASamples: 1, colorBufferFloat: this._webGLVersion > 1 && this._gl.getExtension(\"EXT_color_buffer_float\"), textureFloat: !!(this._webGLVersion > 1 || this._gl.getExtension(\"OES_texture_float\")), textureHalfFloat: !!(this._webGLVersion > 1 || this._gl.getExtension(\"OES_texture_half_float\")), textureHalfFloatRender: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloatLinearFiltering: !1, vertexArrayObject: !1, instancedArrays: !1, textureLOD: !!(this._webGLVersion > 1 || this._gl.getExtension(\"EXT_shader_texture_lod\")), blendMinMax: !1, multiview: this._gl.getExtension(\"OVR_multiview2\"), oculusMultiview: this._gl.getExtension(\"OCULUS_multiview\"), depthTextureExtension: !1 }, this._glVersion = this._gl.getParameter(this._gl.VERSION);\n            var M = this._gl.getExtension(\"WEBGL_debug_renderer_info\");\n            if (M != null && (this._glRenderer = this._gl.getParameter(M.UNMASKED_RENDERER_WEBGL), this._glVendor = this._gl.getParameter(M.UNMASKED_VENDOR_WEBGL)), this._glVendor || (this._glVendor = \"Unknown vendor\"), this._glRenderer || (this._glRenderer = \"Unknown renderer\"), this._gl.HALF_FLOAT_OES !== 36193 && (this._gl.HALF_FLOAT_OES = 36193), this._gl.RGBA16F !== 34842 && (this._gl.RGBA16F = 34842), this._gl.RGBA32F !== 34836 && (this._gl.RGBA32F = 34836), this._gl.DEPTH24_STENCIL8 !== 35056 && (this._gl.DEPTH24_STENCIL8 = 35056), this._caps.timerQuery && (this._webGLVersion === 1 && (this._gl.getQuery = this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)), this._caps.canUseTimestampForTimerQuery = this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT, this._caps.timerQuery.QUERY_COUNTER_BITS_EXT) > 0), this._caps.maxAnisotropy = this._caps.textureAnisotropicFilterExtension ? this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0, this._caps.textureFloatLinearFiltering = !(!this._caps.textureFloat || !this._gl.getExtension(\"OES_texture_float_linear\")), this._caps.textureFloatRender = !(!this._caps.textureFloat || !this._canRenderToFloatFramebuffer()), this._caps.textureHalfFloatLinearFiltering = !!(this._webGLVersion > 1 || this._caps.textureHalfFloat && this._gl.getExtension(\"OES_texture_half_float_linear\")), this._webGLVersion > 1 && this._gl.HALF_FLOAT_OES !== 5131 && (this._gl.HALF_FLOAT_OES = 5131), this._caps.textureHalfFloatRender = this._caps.textureHalfFloat && this._canRenderToHalfFloatFramebuffer(), this._webGLVersion > 1)\n              this._caps.drawBuffersExtension = !0, this._caps.maxMSAASamples = this._gl.getParameter(this._gl.MAX_SAMPLES);\n            else {\n              var U = this._gl.getExtension(\"WEBGL_draw_buffers\");\n              if (U !== null) {\n                this._caps.drawBuffersExtension = !0, this._gl.drawBuffers = U.drawBuffersWEBGL.bind(U), this._gl.DRAW_FRAMEBUFFER = this._gl.FRAMEBUFFER;\n                for (var X = 0; X < 16; X++)\n                  this._gl[\"COLOR_ATTACHMENT\" + X + \"_WEBGL\"] = U[\"COLOR_ATTACHMENT\" + X + \"_WEBGL\"];\n              }\n            }\n            if (this._webGLVersion > 1)\n              this._caps.depthTextureExtension = !0;\n            else {\n              var j = this._gl.getExtension(\"WEBGL_depth_texture\");\n              j != null && (this._caps.depthTextureExtension = !0, this._gl.UNSIGNED_INT_24_8 = j.UNSIGNED_INT_24_8_WEBGL);\n            }\n            if (this.disableVertexArrayObjects)\n              this._caps.vertexArrayObject = !1;\n            else if (this._webGLVersion > 1)\n              this._caps.vertexArrayObject = !0;\n            else {\n              var ne = this._gl.getExtension(\"OES_vertex_array_object\");\n              ne != null && (this._caps.vertexArrayObject = !0, this._gl.createVertexArray = ne.createVertexArrayOES.bind(ne), this._gl.bindVertexArray = ne.bindVertexArrayOES.bind(ne), this._gl.deleteVertexArray = ne.deleteVertexArrayOES.bind(ne));\n            }\n            if (this._webGLVersion > 1)\n              this._caps.instancedArrays = !0;\n            else {\n              var te = this._gl.getExtension(\"ANGLE_instanced_arrays\");\n              te != null ? (this._caps.instancedArrays = !0, this._gl.drawArraysInstanced = te.drawArraysInstancedANGLE.bind(te), this._gl.drawElementsInstanced = te.drawElementsInstancedANGLE.bind(te), this._gl.vertexAttribDivisor = te.vertexAttribDivisorANGLE.bind(te)) : this._caps.instancedArrays = !1;\n            }\n            if (this._gl.getShaderPrecisionFormat) {\n              var de = this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER, this._gl.HIGH_FLOAT), pe = this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER, this._gl.HIGH_FLOAT);\n              de && pe && (this._caps.highPrecisionShaderSupported = de.precision !== 0 && pe.precision !== 0);\n            }\n            if (this._webGLVersion > 1)\n              this._caps.blendMinMax = !0;\n            else {\n              var ae = this._gl.getExtension(\"EXT_blend_minmax\");\n              ae != null && (this._caps.blendMinMax = !0, this._gl.MAX = ae.MAX_EXT, this._gl.MIN = ae.MIN_EXT);\n            }\n            this._depthCullingState.depthTest = !0, this._depthCullingState.depthFunc = this._gl.LEQUAL, this._depthCullingState.depthMask = !0, this._maxSimultaneousTextures = this._caps.maxCombinedTexturesImageUnits;\n            for (var ee = 0; ee < this._maxSimultaneousTextures; ee++)\n              this._nextFreeTextureSlots.push(ee);\n          }, Object.defineProperty(N.prototype, \"webGLVersion\", { get: function() {\n            return this._webGLVersion;\n          }, enumerable: !1, configurable: !0 }), N.prototype.getClassName = function() {\n            return \"ThinEngine\";\n          }, Object.defineProperty(N.prototype, \"isStencilEnable\", { get: function() {\n            return this._isStencilEnable;\n          }, enumerable: !1, configurable: !0 }), N.prototype._prepareWorkingCanvas = function() {\n            if (!this._workingCanvas) {\n              this._workingCanvas = v.a.CreateCanvas(1, 1);\n              var M = this._workingCanvas.getContext(\"2d\");\n              M && (this._workingContext = M);\n            }\n          }, N.prototype.resetTextureCache = function() {\n            for (var M in this._boundTexturesCache)\n              this._boundTexturesCache.hasOwnProperty(M) && (this._boundTexturesCache[M] = null);\n            this._currentTextureChannel = -1;\n          }, N.prototype.getGlInfo = function() {\n            return { vendor: this._glVendor, renderer: this._glRenderer, version: this._glVersion };\n          }, N.prototype.setHardwareScalingLevel = function(M) {\n            this._hardwareScalingLevel = M, this.resize();\n          }, N.prototype.getHardwareScalingLevel = function() {\n            return this._hardwareScalingLevel;\n          }, N.prototype.getLoadedTexturesCache = function() {\n            return this._internalTexturesCache;\n          }, N.prototype.getCaps = function() {\n            return this._caps;\n          }, N.prototype.stopRenderLoop = function(M) {\n            if (M) {\n              var U = this._activeRenderLoops.indexOf(M);\n              U >= 0 && this._activeRenderLoops.splice(U, 1);\n            } else\n              this._activeRenderLoops = [];\n          }, N.prototype._renderLoop = function() {\n            if (!this._contextWasLost) {\n              var M = !0;\n              if (!this.renderEvenInBackground && this._windowIsBackground && (M = !1), M) {\n                this.beginFrame();\n                for (var U = 0; U < this._activeRenderLoops.length; U++)\n                  (0, this._activeRenderLoops[U])();\n                this.endFrame();\n              }\n            }\n            this._activeRenderLoops.length > 0 ? this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow()) : this._renderingQueueLaunched = !1;\n          }, N.prototype.getRenderingCanvas = function() {\n            return this._renderingCanvas;\n          }, N.prototype.getHostWindow = function() {\n            return S.a.IsWindowObjectExist() ? this._renderingCanvas && this._renderingCanvas.ownerDocument && this._renderingCanvas.ownerDocument.defaultView ? this._renderingCanvas.ownerDocument.defaultView : window : null;\n          }, N.prototype.getRenderWidth = function(M) {\n            return M === void 0 && (M = !1), !M && this._currentRenderTarget ? this._currentRenderTarget.width : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferWidth : this._gl.drawingBufferWidth;\n          }, N.prototype.getRenderHeight = function(M) {\n            return M === void 0 && (M = !1), !M && this._currentRenderTarget ? this._currentRenderTarget.height : this._framebufferDimensionsObject ? this._framebufferDimensionsObject.framebufferHeight : this._gl.drawingBufferHeight;\n          }, N.prototype._queueNewFrame = function(M, U) {\n            return N.QueueNewFrame(M, U);\n          }, N.prototype.runRenderLoop = function(M) {\n            this._activeRenderLoops.indexOf(M) === -1 && (this._activeRenderLoops.push(M), this._renderingQueueLaunched || (this._renderingQueueLaunched = !0, this._boundRenderFunction = this._renderLoop.bind(this), this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow())));\n          }, N.prototype.clear = function(M, U, X, j) {\n            j === void 0 && (j = !1), this.applyStates();\n            var ne = 0;\n            U && M && (this._gl.clearColor(M.r, M.g, M.b, M.a !== void 0 ? M.a : 1), ne |= this._gl.COLOR_BUFFER_BIT), X && (this.useReverseDepthBuffer ? (this._depthCullingState.depthFunc = this._gl.GREATER, this._gl.clearDepth(0)) : this._gl.clearDepth(1), ne |= this._gl.DEPTH_BUFFER_BIT), j && (this._gl.clearStencil(0), ne |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(ne);\n          }, N.prototype._viewport = function(M, U, X, j) {\n            M === this._viewportCached.x && U === this._viewportCached.y && X === this._viewportCached.z && j === this._viewportCached.w || (this._viewportCached.x = M, this._viewportCached.y = U, this._viewportCached.z = X, this._viewportCached.w = j, this._gl.viewport(M, U, X, j));\n          }, N.prototype.setViewport = function(M, U, X) {\n            var j = U || this.getRenderWidth(), ne = X || this.getRenderHeight(), te = M.x || 0, de = M.y || 0;\n            this._cachedViewport = M, this._viewport(te * j, de * ne, j * M.width, ne * M.height);\n          }, N.prototype.beginFrame = function() {\n          }, N.prototype.endFrame = function() {\n            this._badOS && this.flushFramebuffer();\n          }, N.prototype.resize = function() {\n            var M, U;\n            S.a.IsWindowObjectExist() ? (M = this._renderingCanvas ? this._renderingCanvas.clientWidth || this._renderingCanvas.width : window.innerWidth, U = this._renderingCanvas ? this._renderingCanvas.clientHeight || this._renderingCanvas.height : window.innerHeight) : (M = this._renderingCanvas ? this._renderingCanvas.width : 100, U = this._renderingCanvas ? this._renderingCanvas.height : 100), this.setSize(M / this._hardwareScalingLevel, U / this._hardwareScalingLevel);\n          }, N.prototype.setSize = function(M, U) {\n            return !!this._renderingCanvas && (M |= 0, U |= 0, (this._renderingCanvas.width !== M || this._renderingCanvas.height !== U) && (this._renderingCanvas.width = M, this._renderingCanvas.height = U, !0));\n          }, N.prototype.bindFramebuffer = function(M, U, X, j, ne, te, de) {\n            U === void 0 && (U = 0), te === void 0 && (te = 0), de === void 0 && (de = 0), this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = M, this._bindUnboundFramebuffer(M._MSAAFramebuffer ? M._MSAAFramebuffer : M._framebuffer);\n            var pe = this._gl;\n            M.is2DArray ? pe.framebufferTextureLayer(pe.FRAMEBUFFER, pe.COLOR_ATTACHMENT0, M._webGLTexture, te, de) : M.isCube && pe.framebufferTexture2D(pe.FRAMEBUFFER, pe.COLOR_ATTACHMENT0, pe.TEXTURE_CUBE_MAP_POSITIVE_X + U, M._webGLTexture, te);\n            var ae = M._depthStencilTexture;\n            if (ae) {\n              var ee = ae._generateStencilBuffer ? pe.DEPTH_STENCIL_ATTACHMENT : pe.DEPTH_ATTACHMENT;\n              M.is2DArray ? pe.framebufferTextureLayer(pe.FRAMEBUFFER, ee, ae._webGLTexture, te, de) : M.isCube ? pe.framebufferTexture2D(pe.FRAMEBUFFER, ee, pe.TEXTURE_CUBE_MAP_POSITIVE_X + U, ae._webGLTexture, te) : pe.framebufferTexture2D(pe.FRAMEBUFFER, ee, pe.TEXTURE_2D, ae._webGLTexture, te);\n            }\n            this._cachedViewport && !ne ? this.setViewport(this._cachedViewport, X, j) : (X || (X = M.width, te && (X /= Math.pow(2, te))), j || (j = M.height, te && (j /= Math.pow(2, te))), this._viewport(0, 0, X, j)), this.wipeCaches();\n          }, N.prototype._bindUnboundFramebuffer = function(M) {\n            this._currentFramebuffer !== M && (this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, M), this._currentFramebuffer = M);\n          }, N.prototype.unBindFramebuffer = function(M, U, X) {\n            U === void 0 && (U = !1), this._currentRenderTarget = null;\n            var j = this._gl;\n            if (M._MSAAFramebuffer) {\n              if (M._textureArray)\n                return void this.unBindMultiColorAttachmentFramebuffer(M._textureArray, U, X);\n              j.bindFramebuffer(j.READ_FRAMEBUFFER, M._MSAAFramebuffer), j.bindFramebuffer(j.DRAW_FRAMEBUFFER, M._framebuffer), j.blitFramebuffer(0, 0, M.width, M.height, 0, 0, M.width, M.height, j.COLOR_BUFFER_BIT, j.NEAREST);\n            }\n            !M.generateMipMaps || U || M.isCube || (this._bindTextureDirectly(j.TEXTURE_2D, M, !0), j.generateMipmap(j.TEXTURE_2D), this._bindTextureDirectly(j.TEXTURE_2D, null)), X && (M._MSAAFramebuffer && this._bindUnboundFramebuffer(M._framebuffer), X()), this._bindUnboundFramebuffer(null);\n          }, N.prototype.flushFramebuffer = function() {\n            this._gl.flush();\n          }, N.prototype.restoreDefaultFramebuffer = function() {\n            this._currentRenderTarget ? this.unBindFramebuffer(this._currentRenderTarget) : this._bindUnboundFramebuffer(null), this._cachedViewport && this.setViewport(this._cachedViewport), this.wipeCaches();\n          }, N.prototype._resetVertexBufferBinding = function() {\n            this.bindArrayBuffer(null), this._cachedVertexBuffers = null;\n          }, N.prototype.createVertexBuffer = function(M) {\n            return this._createVertexBuffer(M, this._gl.STATIC_DRAW);\n          }, N.prototype._createVertexBuffer = function(M, U) {\n            var X = this._gl.createBuffer();\n            if (!X)\n              throw new Error(\"Unable to create vertex buffer\");\n            var j = new l.a(X);\n            return this.bindArrayBuffer(j), M instanceof Array ? this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(M), this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.ARRAY_BUFFER, M, this._gl.STATIC_DRAW), this._resetVertexBufferBinding(), j.references = 1, j;\n          }, N.prototype.createDynamicVertexBuffer = function(M) {\n            return this._createVertexBuffer(M, this._gl.DYNAMIC_DRAW);\n          }, N.prototype._resetIndexBufferBinding = function() {\n            this.bindIndexBuffer(null), this._cachedIndexBuffer = null;\n          }, N.prototype.createIndexBuffer = function(M, U) {\n            var X = this._gl.createBuffer(), j = new l.a(X);\n            if (!X)\n              throw new Error(\"Unable to create index buffer\");\n            this.bindIndexBuffer(j);\n            var ne = this._normalizeIndexData(M);\n            return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, ne, U ? this._gl.DYNAMIC_DRAW : this._gl.STATIC_DRAW), this._resetIndexBufferBinding(), j.references = 1, j.is32Bits = ne.BYTES_PER_ELEMENT === 4, j;\n          }, N.prototype._normalizeIndexData = function(M) {\n            if (M instanceof Uint16Array)\n              return M;\n            if (this._caps.uintIndices) {\n              if (M instanceof Uint32Array)\n                return M;\n              for (var U = 0; U < M.length; U++)\n                if (M[U] >= 65535)\n                  return new Uint32Array(M);\n              return new Uint16Array(M);\n            }\n            return new Uint16Array(M);\n          }, N.prototype.bindArrayBuffer = function(M) {\n            this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.bindBuffer(M, this._gl.ARRAY_BUFFER);\n          }, N.prototype.bindUniformBlock = function(M, U, X) {\n            var j = M.program, ne = this._gl.getUniformBlockIndex(j, U);\n            this._gl.uniformBlockBinding(j, ne, X);\n          }, N.prototype.bindIndexBuffer = function(M) {\n            this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.bindBuffer(M, this._gl.ELEMENT_ARRAY_BUFFER);\n          }, N.prototype.bindBuffer = function(M, U) {\n            (this._vaoRecordInProgress || this._currentBoundBuffer[U] !== M) && (this._gl.bindBuffer(U, M ? M.underlyingResource : null), this._currentBoundBuffer[U] = M);\n          }, N.prototype.updateArrayBuffer = function(M) {\n            this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, M);\n          }, N.prototype._vertexAttribPointer = function(M, U, X, j, ne, te, de) {\n            var pe = this._currentBufferPointers[U];\n            if (pe) {\n              var ae = !1;\n              pe.active ? (pe.buffer !== M && (pe.buffer = M, ae = !0), pe.size !== X && (pe.size = X, ae = !0), pe.type !== j && (pe.type = j, ae = !0), pe.normalized !== ne && (pe.normalized = ne, ae = !0), pe.stride !== te && (pe.stride = te, ae = !0), pe.offset !== de && (pe.offset = de, ae = !0)) : (ae = !0, pe.active = !0, pe.index = U, pe.size = X, pe.type = j, pe.normalized = ne, pe.stride = te, pe.offset = de, pe.buffer = M), (ae || this._vaoRecordInProgress) && (this.bindArrayBuffer(M), this._gl.vertexAttribPointer(U, X, j, ne, te, de));\n            }\n          }, N.prototype._bindIndexBufferWithCache = function(M) {\n            M != null && this._cachedIndexBuffer !== M && (this._cachedIndexBuffer = M, this.bindIndexBuffer(M), this._uintIndicesCurrentlySet = M.is32Bits);\n          }, N.prototype._bindVertexBuffersAttributes = function(M, U) {\n            var X = U.getAttributesNames();\n            this._vaoRecordInProgress || this._unbindVertexArrayObject(), this.unbindAllAttributes();\n            for (var j = 0; j < X.length; j++) {\n              var ne = U.getAttributeLocation(j);\n              if (ne >= 0) {\n                var te = M[X[j]];\n                if (!te)\n                  continue;\n                this._gl.enableVertexAttribArray(ne), this._vaoRecordInProgress || (this._vertexAttribArraysEnabled[ne] = !0);\n                var de = te.getBuffer();\n                de && (this._vertexAttribPointer(de, ne, te.getSize(), te.type, te.normalized, te.byteStride, te.byteOffset), te.getIsInstanced() && (this._gl.vertexAttribDivisor(ne, te.getInstanceDivisor()), this._vaoRecordInProgress || (this._currentInstanceLocations.push(ne), this._currentInstanceBuffers.push(de))));\n              }\n            }\n          }, N.prototype.recordVertexArrayObject = function(M, U, X) {\n            var j = this._gl.createVertexArray();\n            return this._vaoRecordInProgress = !0, this._gl.bindVertexArray(j), this._mustWipeVertexAttributes = !0, this._bindVertexBuffersAttributes(M, X), this.bindIndexBuffer(U), this._vaoRecordInProgress = !1, this._gl.bindVertexArray(null), j;\n          }, N.prototype.bindVertexArrayObject = function(M, U) {\n            this._cachedVertexArrayObject !== M && (this._cachedVertexArrayObject = M, this._gl.bindVertexArray(M), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._uintIndicesCurrentlySet = U != null && U.is32Bits, this._mustWipeVertexAttributes = !0);\n          }, N.prototype.bindBuffersDirectly = function(M, U, X, j, ne) {\n            if (this._cachedVertexBuffers !== M || this._cachedEffectForVertexBuffers !== ne) {\n              this._cachedVertexBuffers = M, this._cachedEffectForVertexBuffers = ne;\n              var te = ne.getAttributesCount();\n              this._unbindVertexArrayObject(), this.unbindAllAttributes();\n              for (var de = 0, pe = 0; pe < te; pe++)\n                if (pe < X.length) {\n                  var ae = ne.getAttributeLocation(pe);\n                  ae >= 0 && (this._gl.enableVertexAttribArray(ae), this._vertexAttribArraysEnabled[ae] = !0, this._vertexAttribPointer(M, ae, X[pe], this._gl.FLOAT, !1, j, de)), de += 4 * X[pe];\n                }\n            }\n            this._bindIndexBufferWithCache(U);\n          }, N.prototype._unbindVertexArrayObject = function() {\n            this._cachedVertexArrayObject && (this._cachedVertexArrayObject = null, this._gl.bindVertexArray(null));\n          }, N.prototype.bindBuffers = function(M, U, X) {\n            this._cachedVertexBuffers === M && this._cachedEffectForVertexBuffers === X || (this._cachedVertexBuffers = M, this._cachedEffectForVertexBuffers = X, this._bindVertexBuffersAttributes(M, X)), this._bindIndexBufferWithCache(U);\n          }, N.prototype.unbindInstanceAttributes = function() {\n            for (var M, U = 0, X = this._currentInstanceLocations.length; U < X; U++) {\n              var j = this._currentInstanceBuffers[U];\n              M != j && j.references && (M = j, this.bindArrayBuffer(j));\n              var ne = this._currentInstanceLocations[U];\n              this._gl.vertexAttribDivisor(ne, 0);\n            }\n            this._currentInstanceBuffers.length = 0, this._currentInstanceLocations.length = 0;\n          }, N.prototype.releaseVertexArrayObject = function(M) {\n            this._gl.deleteVertexArray(M);\n          }, N.prototype._releaseBuffer = function(M) {\n            return M.references--, M.references === 0 && (this._deleteBuffer(M), !0);\n          }, N.prototype._deleteBuffer = function(M) {\n            this._gl.deleteBuffer(M.underlyingResource);\n          }, N.prototype.updateAndBindInstancesBuffer = function(M, U, X) {\n            if (this.bindArrayBuffer(M), U && this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, U), X[0].index !== void 0)\n              this.bindInstancesBuffer(M, X, !0);\n            else\n              for (var j = 0; j < 4; j++) {\n                var ne = X[j];\n                this._vertexAttribArraysEnabled[ne] || (this._gl.enableVertexAttribArray(ne), this._vertexAttribArraysEnabled[ne] = !0), this._vertexAttribPointer(M, ne, 4, this._gl.FLOAT, !1, 64, 16 * j), this._gl.vertexAttribDivisor(ne, 1), this._currentInstanceLocations.push(ne), this._currentInstanceBuffers.push(M);\n              }\n          }, N.prototype.bindInstancesBuffer = function(M, U, X) {\n            X === void 0 && (X = !0), this.bindArrayBuffer(M);\n            var j = 0;\n            if (X)\n              for (var ne = 0; ne < U.length; ne++)\n                j += 4 * (te = U[ne]).attributeSize;\n            for (ne = 0; ne < U.length; ne++) {\n              var te;\n              (te = U[ne]).index === void 0 && (te.index = this._currentEffect.getAttributeLocationByName(te.attributeName)), te.index < 0 || (this._vertexAttribArraysEnabled[te.index] || (this._gl.enableVertexAttribArray(te.index), this._vertexAttribArraysEnabled[te.index] = !0), this._vertexAttribPointer(M, te.index, te.attributeSize, te.attributeType || this._gl.FLOAT, te.normalized || !1, j, te.offset), this._gl.vertexAttribDivisor(te.index, te.divisor === void 0 ? 1 : te.divisor), this._currentInstanceLocations.push(te.index), this._currentInstanceBuffers.push(M));\n            }\n          }, N.prototype.disableInstanceAttributeByName = function(M) {\n            if (this._currentEffect) {\n              var U = this._currentEffect.getAttributeLocationByName(M);\n              this.disableInstanceAttribute(U);\n            }\n          }, N.prototype.disableInstanceAttribute = function(M) {\n            for (var U, X = !1; (U = this._currentInstanceLocations.indexOf(M)) !== -1; )\n              this._currentInstanceLocations.splice(U, 1), this._currentInstanceBuffers.splice(U, 1), X = !0, U = this._currentInstanceLocations.indexOf(M);\n            X && (this._gl.vertexAttribDivisor(M, 0), this.disableAttributeByIndex(M));\n          }, N.prototype.disableAttributeByIndex = function(M) {\n            this._gl.disableVertexAttribArray(M), this._vertexAttribArraysEnabled[M] = !1, this._currentBufferPointers[M].active = !1;\n          }, N.prototype.draw = function(M, U, X, j) {\n            this.drawElementsType(M ? m.a.MATERIAL_TriangleFillMode : m.a.MATERIAL_WireFrameFillMode, U, X, j);\n          }, N.prototype.drawPointClouds = function(M, U, X) {\n            this.drawArraysType(m.a.MATERIAL_PointFillMode, M, U, X);\n          }, N.prototype.drawUnIndexed = function(M, U, X, j) {\n            this.drawArraysType(M ? m.a.MATERIAL_TriangleFillMode : m.a.MATERIAL_WireFrameFillMode, U, X, j);\n          }, N.prototype.drawElementsType = function(M, U, X, j) {\n            this.applyStates(), this._reportDrawCall();\n            var ne = this._drawMode(M), te = this._uintIndicesCurrentlySet ? this._gl.UNSIGNED_INT : this._gl.UNSIGNED_SHORT, de = this._uintIndicesCurrentlySet ? 4 : 2;\n            j ? this._gl.drawElementsInstanced(ne, X, te, U * de, j) : this._gl.drawElements(ne, X, te, U * de);\n          }, N.prototype.drawArraysType = function(M, U, X, j) {\n            this.applyStates(), this._reportDrawCall();\n            var ne = this._drawMode(M);\n            j ? this._gl.drawArraysInstanced(ne, U, X, j) : this._gl.drawArrays(ne, U, X);\n          }, N.prototype._drawMode = function(M) {\n            switch (M) {\n              case m.a.MATERIAL_TriangleFillMode:\n                return this._gl.TRIANGLES;\n              case m.a.MATERIAL_PointFillMode:\n                return this._gl.POINTS;\n              case m.a.MATERIAL_WireFrameFillMode:\n                return this._gl.LINES;\n              case m.a.MATERIAL_PointListDrawMode:\n                return this._gl.POINTS;\n              case m.a.MATERIAL_LineListDrawMode:\n                return this._gl.LINES;\n              case m.a.MATERIAL_LineLoopDrawMode:\n                return this._gl.LINE_LOOP;\n              case m.a.MATERIAL_LineStripDrawMode:\n                return this._gl.LINE_STRIP;\n              case m.a.MATERIAL_TriangleStripDrawMode:\n                return this._gl.TRIANGLE_STRIP;\n              case m.a.MATERIAL_TriangleFanDrawMode:\n                return this._gl.TRIANGLE_FAN;\n              default:\n                return this._gl.TRIANGLES;\n            }\n          }, N.prototype._reportDrawCall = function() {\n          }, N.prototype._releaseEffect = function(M) {\n            this._compiledEffects[M._key] && (delete this._compiledEffects[M._key], this._deletePipelineContext(M.getPipelineContext()));\n          }, N.prototype._deletePipelineContext = function(M) {\n            var U = M;\n            U && U.program && (U.program.__SPECTOR_rebuildProgram = null, this._gl.deleteProgram(U.program));\n          }, N.prototype.createEffect = function(M, U, X, j, ne, te, de, pe, ae) {\n            var ee = (M.vertexElement || M.vertex || M.vertexToken || M.vertexSource || M) + \"+\" + (M.fragmentElement || M.fragment || M.fragmentToken || M.fragmentSource || M) + \"@\" + (ne || U.defines);\n            if (this._compiledEffects[ee]) {\n              var K = this._compiledEffects[ee];\n              return de && K.isReady() && de(K), K;\n            }\n            var $ = new _.a(M, U, X, j, this, ne, te, de, pe, ae);\n            return $._key = ee, this._compiledEffects[ee] = $, $;\n          }, N._ConcatenateShader = function(M, U, X) {\n            return X === void 0 && (X = \"\"), X + (U ? U + `\n` : \"\") + M;\n          }, N.prototype._compileShader = function(M, U, X, j) {\n            return this._compileRawShader(N._ConcatenateShader(M, X, j), U);\n          }, N.prototype._compileRawShader = function(M, U) {\n            var X = this._gl, j = X.createShader(U === \"vertex\" ? X.VERTEX_SHADER : X.FRAGMENT_SHADER);\n            if (!j)\n              throw new Error(\"Something went wrong while compile the shader.\");\n            return X.shaderSource(j, M), X.compileShader(j), j;\n          }, N.prototype._getShaderSource = function(M) {\n            return this._gl.getShaderSource(M);\n          }, N.prototype.createRawShaderProgram = function(M, U, X, j, ne) {\n            ne === void 0 && (ne = null), j = j || this._gl;\n            var te = this._compileRawShader(U, \"vertex\"), de = this._compileRawShader(X, \"fragment\");\n            return this._createShaderProgram(M, te, de, j, ne);\n          }, N.prototype.createShaderProgram = function(M, U, X, j, ne, te) {\n            te === void 0 && (te = null), ne = ne || this._gl;\n            var de = this._webGLVersion > 1 ? `#version 300 es\n#define WEBGL2 \n` : \"\", pe = this._compileShader(U, \"vertex\", j, de), ae = this._compileShader(X, \"fragment\", j, de);\n            return this._createShaderProgram(M, pe, ae, ne, te);\n          }, N.prototype.createPipelineContext = function() {\n            var M = new h.a();\n            return M.engine = this, this._caps.parallelShaderCompile && (M.isParallelCompiled = !0), M;\n          }, N.prototype._createShaderProgram = function(M, U, X, j, ne) {\n            var te = j.createProgram();\n            if (M.program = te, !te)\n              throw new Error(\"Unable to create program\");\n            return j.attachShader(te, U), j.attachShader(te, X), j.linkProgram(te), M.context = j, M.vertexShader = U, M.fragmentShader = X, M.isParallelCompiled || this._finalizePipelineContext(M), te;\n          }, N.prototype._finalizePipelineContext = function(M) {\n            var U = M.context, X = M.vertexShader, j = M.fragmentShader, ne = M.program;\n            if (!U.getProgramParameter(ne, U.LINK_STATUS)) {\n              var te, de;\n              if (!this._gl.getShaderParameter(X, this._gl.COMPILE_STATUS) && (te = this._gl.getShaderInfoLog(X)))\n                throw M.vertexCompilationError = te, new Error(\"VERTEX SHADER \" + te);\n              if (!this._gl.getShaderParameter(j, this._gl.COMPILE_STATUS) && (te = this._gl.getShaderInfoLog(j)))\n                throw M.fragmentCompilationError = te, new Error(\"FRAGMENT SHADER \" + te);\n              if (de = U.getProgramInfoLog(ne))\n                throw M.programLinkError = de, new Error(de);\n            }\n            if (this.validateShaderPrograms && (U.validateProgram(ne), !U.getProgramParameter(ne, U.VALIDATE_STATUS) && (de = U.getProgramInfoLog(ne))))\n              throw M.programValidationError = de, new Error(de);\n            U.deleteShader(X), U.deleteShader(j), M.vertexShader = void 0, M.fragmentShader = void 0, M.onCompiled && (M.onCompiled(), M.onCompiled = void 0);\n          }, N.prototype._preparePipelineContext = function(M, U, X, j, ne, te, de) {\n            var pe = M;\n            pe.program = j ? this.createRawShaderProgram(pe, U, X, void 0, de) : this.createShaderProgram(pe, U, X, te, void 0, de), pe.program.__SPECTOR_rebuildProgram = ne;\n          }, N.prototype._isRenderingStateCompiled = function(M) {\n            var U = M;\n            return !!this._gl.getProgramParameter(U.program, this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR) && (this._finalizePipelineContext(U), !0);\n          }, N.prototype._executeWhenRenderingStateIsCompiled = function(M, U) {\n            var X = M;\n            if (X.isParallelCompiled) {\n              var j = X.onCompiled;\n              X.onCompiled = j ? function() {\n                j(), U();\n              } : U;\n            } else\n              U();\n          }, N.prototype.getUniforms = function(M, U) {\n            for (var X = new Array(), j = M, ne = 0; ne < U.length; ne++)\n              X.push(this._gl.getUniformLocation(j.program, U[ne]));\n            return X;\n          }, N.prototype.getAttributes = function(M, U) {\n            for (var X = [], j = M, ne = 0; ne < U.length; ne++)\n              try {\n                X.push(this._gl.getAttribLocation(j.program, U[ne]));\n              } catch {\n                X.push(-1);\n              }\n            return X;\n          }, N.prototype.enableEffect = function(M) {\n            M && M !== this._currentEffect && (this.bindSamplers(M), this._currentEffect = M, M.onBind && M.onBind(M), M._onBindObservable && M._onBindObservable.notifyObservers(M));\n          }, N.prototype.setInt = function(M, U) {\n            return !!M && (this._gl.uniform1i(M, U), !0);\n          }, N.prototype.setIntArray = function(M, U) {\n            return !!M && (this._gl.uniform1iv(M, U), !0);\n          }, N.prototype.setIntArray2 = function(M, U) {\n            return !(!M || U.length % 2 != 0) && (this._gl.uniform2iv(M, U), !0);\n          }, N.prototype.setIntArray3 = function(M, U) {\n            return !(!M || U.length % 3 != 0) && (this._gl.uniform3iv(M, U), !0);\n          }, N.prototype.setIntArray4 = function(M, U) {\n            return !(!M || U.length % 4 != 0) && (this._gl.uniform4iv(M, U), !0);\n          }, N.prototype.setArray = function(M, U) {\n            return !!M && (this._gl.uniform1fv(M, U), !0);\n          }, N.prototype.setArray2 = function(M, U) {\n            return !(!M || U.length % 2 != 0) && (this._gl.uniform2fv(M, U), !0);\n          }, N.prototype.setArray3 = function(M, U) {\n            return !(!M || U.length % 3 != 0) && (this._gl.uniform3fv(M, U), !0);\n          }, N.prototype.setArray4 = function(M, U) {\n            return !(!M || U.length % 4 != 0) && (this._gl.uniform4fv(M, U), !0);\n          }, N.prototype.setMatrices = function(M, U) {\n            return !!M && (this._gl.uniformMatrix4fv(M, !1, U), !0);\n          }, N.prototype.setMatrix3x3 = function(M, U) {\n            return !!M && (this._gl.uniformMatrix3fv(M, !1, U), !0);\n          }, N.prototype.setMatrix2x2 = function(M, U) {\n            return !!M && (this._gl.uniformMatrix2fv(M, !1, U), !0);\n          }, N.prototype.setFloat = function(M, U) {\n            return !!M && (this._gl.uniform1f(M, U), !0);\n          }, N.prototype.setFloat2 = function(M, U, X) {\n            return !!M && (this._gl.uniform2f(M, U, X), !0);\n          }, N.prototype.setFloat3 = function(M, U, X, j) {\n            return !!M && (this._gl.uniform3f(M, U, X, j), !0);\n          }, N.prototype.setFloat4 = function(M, U, X, j, ne) {\n            return !!M && (this._gl.uniform4f(M, U, X, j, ne), !0);\n          }, N.prototype.applyStates = function() {\n            if (this._depthCullingState.apply(this._gl), this._stencilState.apply(this._gl), this._alphaState.apply(this._gl), this._colorWriteChanged) {\n              this._colorWriteChanged = !1;\n              var M = this._colorWrite;\n              this._gl.colorMask(M, M, M, M);\n            }\n          }, N.prototype.setColorWrite = function(M) {\n            M !== this._colorWrite && (this._colorWriteChanged = !0, this._colorWrite = M);\n          }, N.prototype.getColorWrite = function() {\n            return this._colorWrite;\n          }, Object.defineProperty(N.prototype, \"depthCullingState\", { get: function() {\n            return this._depthCullingState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"alphaState\", { get: function() {\n            return this._alphaState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(N.prototype, \"stencilState\", { get: function() {\n            return this._stencilState;\n          }, enumerable: !1, configurable: !0 }), N.prototype.clearInternalTexturesCache = function() {\n            this._internalTexturesCache = [];\n          }, N.prototype.wipeCaches = function(M) {\n            this.preventCacheWipeBetweenFrames && !M || (this._currentEffect = null, this._viewportCached.x = 0, this._viewportCached.y = 0, this._viewportCached.z = 0, this._viewportCached.w = 0, this._unbindVertexArrayObject(), M && (this._currentProgram = null, this.resetTextureCache(), this._stencilState.reset(), this._depthCullingState.reset(), this._depthCullingState.depthFunc = this._gl.LEQUAL, this._alphaState.reset(), this._alphaMode = m.a.ALPHA_ADD, this._alphaEquation = m.a.ALPHA_DISABLE, this._colorWrite = !0, this._colorWriteChanged = !0, this._unpackFlipYCached = null, this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, this._gl.NONE), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), this._mustWipeVertexAttributes = !0, this.unbindAllAttributes()), this._resetVertexBufferBinding(), this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null, this.bindIndexBuffer(null));\n          }, N.prototype._getSamplingParameters = function(M, U) {\n            var X = this._gl, j = X.NEAREST, ne = X.NEAREST;\n            switch (M) {\n              case m.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST:\n                j = X.LINEAR, ne = U ? X.LINEAR_MIPMAP_NEAREST : X.LINEAR;\n                break;\n              case m.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR:\n                j = X.LINEAR, ne = U ? X.LINEAR_MIPMAP_LINEAR : X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR:\n                j = X.NEAREST, ne = U ? X.NEAREST_MIPMAP_LINEAR : X.NEAREST;\n                break;\n              case m.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST:\n                j = X.NEAREST, ne = U ? X.NEAREST_MIPMAP_NEAREST : X.NEAREST;\n                break;\n              case m.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST:\n                j = X.NEAREST, ne = U ? X.LINEAR_MIPMAP_NEAREST : X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR:\n                j = X.NEAREST, ne = U ? X.LINEAR_MIPMAP_LINEAR : X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_LINEAR:\n                j = X.NEAREST, ne = X.LINEAR;\n                break;\n              case m.a.TEXTURE_NEAREST_NEAREST:\n                j = X.NEAREST, ne = X.NEAREST;\n                break;\n              case m.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST:\n                j = X.LINEAR, ne = U ? X.NEAREST_MIPMAP_NEAREST : X.NEAREST;\n                break;\n              case m.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR:\n                j = X.LINEAR, ne = U ? X.NEAREST_MIPMAP_LINEAR : X.NEAREST;\n                break;\n              case m.a.TEXTURE_LINEAR_LINEAR:\n                j = X.LINEAR, ne = X.LINEAR;\n                break;\n              case m.a.TEXTURE_LINEAR_NEAREST:\n                j = X.LINEAR, ne = X.NEAREST;\n            }\n            return { min: ne, mag: j };\n          }, N.prototype._createTexture = function() {\n            var M = this._gl.createTexture();\n            if (!M)\n              throw new Error(\"Unable to create texture\");\n            return M;\n          }, N.prototype.createTexture = function(M, U, X, j, ne, te, de, pe, ae, ee, K, $, L) {\n            var G = this;\n            ne === void 0 && (ne = m.a.TEXTURE_TRILINEAR_SAMPLINGMODE), te === void 0 && (te = null), de === void 0 && (de = null), pe === void 0 && (pe = null), ae === void 0 && (ae = null), ee === void 0 && (ee = null), K === void 0 && (K = null);\n            var Q = (M = M || \"\").substr(0, 5) === \"data:\", oe = M.substr(0, 5) === \"blob:\", re = Q && M.indexOf(\";base64,\") !== -1, Y = ae || new c.a(this, c.b.Url), k = M;\n            !this._transformTextureUrl || re || ae || pe || (M = this._transformTextureUrl(M)), k !== M && (Y._originalUrl = k);\n            var H = M.lastIndexOf(\".\"), Z = K || (H > -1 ? M.substring(H).toLowerCase() : \"\"), W = null;\n            Z.indexOf(\"?\") > -1 && (Z = Z.split(\"?\")[0]);\n            for (var q = 0, he = N._TextureLoaders; q < he.length; q++) {\n              var ge = he[q];\n              if (ge.canLoad(Z, $)) {\n                W = ge;\n                break;\n              }\n            }\n            j && j._addPendingData(Y), Y.url = M, Y.generateMipMaps = !U, Y.samplingMode = ne, Y.invertY = X, this._doNotHandleContextLost || (Y._buffer = pe);\n            var me = null;\n            te && !ae && (me = Y.onLoadedObservable.add(te)), ae || this._internalTexturesCache.push(Y);\n            var _e = function(be, Fe) {\n              j && j._removePendingData(Y), M === k ? (me && Y.onLoadedObservable.remove(me), V.a.UseFallbackTexture && G.createTexture(V.a.FallbackTexture, U, Y.invertY, j, ne, null, de, pe, Y), de && de((be || \"Unknown error\") + (V.a.UseFallbackTexture ? \" - Fallback texture was used\" : \"\"), Fe)) : (T.a.Warn(\"Failed to load \" + M + \", falling back to \" + k), G.createTexture(k, U, Y.invertY, j, ne, te, de, pe, Y, ee, K, $, L));\n            };\n            if (W) {\n              var ye = function(be) {\n                W.loadData(be, Y, function(Fe, ke, We, je, He, Qe) {\n                  Qe ? _e(\"TextureLoader failed to load data\") : G._prepareWebGLTexture(Y, j, Fe, ke, Y.invertY, !We, je, function() {\n                    return He(), !1;\n                  }, ne);\n                }, L);\n              };\n              pe ? pe instanceof ArrayBuffer ? ye(new Uint8Array(pe)) : ArrayBuffer.isView(pe) ? ye(pe) : de && de(\"Unable to load: only ArrayBuffer or ArrayBufferView is supported\", null) : this._loadFile(M, function(be) {\n                return ye(new Uint8Array(be));\n              }, void 0, j ? j.offlineProvider : void 0, !0, function(be, Fe) {\n                _e(\"Unable to load \" + (be && be.responseURL, Fe));\n              });\n            } else {\n              var Pe = function(be) {\n                oe && !G._doNotHandleContextLost && (Y._buffer = be), G._prepareWebGLTexture(Y, j, be.width, be.height, Y.invertY, U, !1, function(Fe, ke, We) {\n                  var je = G._gl, He = be.width === Fe && be.height === ke, Qe = ee ? G._getInternalFormat(ee) : Z === \".jpg\" ? je.RGB : je.RGBA;\n                  if (He)\n                    return je.texImage2D(je.TEXTURE_2D, 0, Qe, Qe, je.UNSIGNED_BYTE, be), !1;\n                  var Ge = G._caps.maxTextureSize;\n                  if (be.width > Ge || be.height > Ge || !G._supportsHardwareTextureRescaling)\n                    return G._prepareWorkingCanvas(), !(!G._workingCanvas || !G._workingContext) && (G._workingCanvas.width = Fe, G._workingCanvas.height = ke, G._workingContext.drawImage(be, 0, 0, be.width, be.height, 0, 0, Fe, ke), je.texImage2D(je.TEXTURE_2D, 0, Qe, Qe, je.UNSIGNED_BYTE, G._workingCanvas), Y.width = Fe, Y.height = ke, !1);\n                  var tt = new c.a(G, c.b.Temp);\n                  return G._bindTextureDirectly(je.TEXTURE_2D, tt, !0), je.texImage2D(je.TEXTURE_2D, 0, Qe, Qe, je.UNSIGNED_BYTE, be), G._rescaleTexture(tt, Y, j, Qe, function() {\n                    G._releaseTexture(tt), G._bindTextureDirectly(je.TEXTURE_2D, Y, !0), We();\n                  }), !0;\n                }, ne);\n              };\n              !Q || re ? pe && (pe.decoding || pe.close) ? Pe(pe) : N._FileToolsLoadImage(M, Pe, _e, j ? j.offlineProvider : null, $) : typeof pe == \"string\" || pe instanceof ArrayBuffer || ArrayBuffer.isView(pe) || pe instanceof Blob ? N._FileToolsLoadImage(pe, Pe, _e, j ? j.offlineProvider : null, $) : pe && Pe(pe);\n            }\n            return Y;\n          }, N._FileToolsLoadImage = function(M, U, X, j, ne) {\n            throw C.a.WarnImport(\"FileTools\");\n          }, N.prototype._rescaleTexture = function(M, U, X, j, ne) {\n          }, N.prototype.createRawTexture = function(M, U, X, j, ne, te, de, pe, ae) {\n            throw ae === void 0 && (ae = m.a.TEXTURETYPE_UNSIGNED_INT), C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype.createRawCubeTexture = function(M, U, X, j, ne, te, de, pe) {\n            throw C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype.createRawTexture3D = function(M, U, X, j, ne, te, de, pe, ae, ee) {\n            throw ee === void 0 && (ee = m.a.TEXTURETYPE_UNSIGNED_INT), C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype.createRawTexture2DArray = function(M, U, X, j, ne, te, de, pe, ae, ee) {\n            throw ee === void 0 && (ee = m.a.TEXTURETYPE_UNSIGNED_INT), C.a.WarnImport(\"Engine.RawTexture\");\n          }, N.prototype._unpackFlipY = function(M) {\n            this._unpackFlipYCached !== M && (this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, M ? 1 : 0), this.enableUnpackFlipYCached && (this._unpackFlipYCached = M));\n          }, N.prototype._getUnpackAlignement = function() {\n            return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT);\n          }, N.prototype._getTextureTarget = function(M) {\n            return M.isCube ? this._gl.TEXTURE_CUBE_MAP : M.is3D ? this._gl.TEXTURE_3D : M.is2DArray || M.isMultiview ? this._gl.TEXTURE_2D_ARRAY : this._gl.TEXTURE_2D;\n          }, N.prototype.updateTextureSamplingMode = function(M, U, X) {\n            X === void 0 && (X = !1);\n            var j = this._getTextureTarget(U), ne = this._getSamplingParameters(M, U.generateMipMaps || X);\n            this._setTextureParameterInteger(j, this._gl.TEXTURE_MAG_FILTER, ne.mag, U), this._setTextureParameterInteger(j, this._gl.TEXTURE_MIN_FILTER, ne.min), X && (U.generateMipMaps = !0, this._gl.generateMipmap(j)), this._bindTextureDirectly(j, null), U.samplingMode = M;\n          }, N.prototype.updateTextureWrappingMode = function(M, U, X, j) {\n            X === void 0 && (X = null), j === void 0 && (j = null);\n            var ne = this._getTextureTarget(M);\n            U !== null && (this._setTextureParameterInteger(ne, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(U), M), M._cachedWrapU = U), X !== null && (this._setTextureParameterInteger(ne, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(X), M), M._cachedWrapV = X), (M.is2DArray || M.is3D) && j !== null && (this._setTextureParameterInteger(ne, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(j), M), M._cachedWrapR = j), this._bindTextureDirectly(ne, null);\n          }, N.prototype._setupDepthStencilTexture = function(M, U, X, j, ne) {\n            var te = U.width || U, de = U.height || U, pe = U.layers || 0;\n            M.baseWidth = te, M.baseHeight = de, M.width = te, M.height = de, M.is2DArray = pe > 0, M.depth = pe, M.isReady = !0, M.samples = 1, M.generateMipMaps = !1, M._generateDepthBuffer = !0, M._generateStencilBuffer = X, M.samplingMode = j ? m.a.TEXTURE_BILINEAR_SAMPLINGMODE : m.a.TEXTURE_NEAREST_SAMPLINGMODE, M.type = m.a.TEXTURETYPE_UNSIGNED_INT, M._comparisonFunction = ne;\n            var ae = this._gl, ee = this._getTextureTarget(M), K = this._getSamplingParameters(M.samplingMode, !1);\n            ae.texParameteri(ee, ae.TEXTURE_MAG_FILTER, K.mag), ae.texParameteri(ee, ae.TEXTURE_MIN_FILTER, K.min), ae.texParameteri(ee, ae.TEXTURE_WRAP_S, ae.CLAMP_TO_EDGE), ae.texParameteri(ee, ae.TEXTURE_WRAP_T, ae.CLAMP_TO_EDGE), ne === 0 ? (ae.texParameteri(ee, ae.TEXTURE_COMPARE_FUNC, m.a.LEQUAL), ae.texParameteri(ee, ae.TEXTURE_COMPARE_MODE, ae.NONE)) : (ae.texParameteri(ee, ae.TEXTURE_COMPARE_FUNC, ne), ae.texParameteri(ee, ae.TEXTURE_COMPARE_MODE, ae.COMPARE_REF_TO_TEXTURE));\n          }, N.prototype._uploadCompressedDataToTextureDirectly = function(M, U, X, j, ne, te, de) {\n            te === void 0 && (te = 0), de === void 0 && (de = 0);\n            var pe = this._gl, ae = pe.TEXTURE_2D;\n            M.isCube && (ae = pe.TEXTURE_CUBE_MAP_POSITIVE_X + te), this._gl.compressedTexImage2D(ae, de, U, X, j, 0, ne);\n          }, N.prototype._uploadDataToTextureDirectly = function(M, U, X, j, ne, te) {\n            X === void 0 && (X = 0), j === void 0 && (j = 0), te === void 0 && (te = !1);\n            var de = this._gl, pe = this._getWebGLTextureType(M.type), ae = this._getInternalFormat(M.format), ee = ne === void 0 ? this._getRGBABufferInternalSizedFormat(M.type, M.format) : this._getInternalFormat(ne);\n            this._unpackFlipY(M.invertY);\n            var K = de.TEXTURE_2D;\n            M.isCube && (K = de.TEXTURE_CUBE_MAP_POSITIVE_X + X);\n            var $ = Math.round(Math.log(M.width) * Math.LOG2E), L = Math.round(Math.log(M.height) * Math.LOG2E), G = te ? M.width : Math.pow(2, Math.max($ - j, 0)), Q = te ? M.height : Math.pow(2, Math.max(L - j, 0));\n            de.texImage2D(K, j, ee, G, Q, 0, ae, pe, U);\n          }, N.prototype.updateTextureData = function(M, U, X, j, ne, te, de, pe) {\n            de === void 0 && (de = 0), pe === void 0 && (pe = 0);\n            var ae = this._gl, ee = this._getWebGLTextureType(M.type), K = this._getInternalFormat(M.format);\n            this._unpackFlipY(M.invertY);\n            var $ = ae.TEXTURE_2D;\n            M.isCube && ($ = ae.TEXTURE_CUBE_MAP_POSITIVE_X + de), ae.texSubImage2D($, pe, X, j, ne, te, K, ee, U);\n          }, N.prototype._uploadArrayBufferViewToTexture = function(M, U, X, j) {\n            X === void 0 && (X = 0), j === void 0 && (j = 0);\n            var ne = this._gl, te = M.isCube ? ne.TEXTURE_CUBE_MAP : ne.TEXTURE_2D;\n            this._bindTextureDirectly(te, M, !0), this._uploadDataToTextureDirectly(M, U, X, j), this._bindTextureDirectly(te, null, !0);\n          }, N.prototype._prepareWebGLTextureContinuation = function(M, U, X, j, ne) {\n            var te = this._gl;\n            if (te) {\n              var de = this._getSamplingParameters(ne, !X);\n              te.texParameteri(te.TEXTURE_2D, te.TEXTURE_MAG_FILTER, de.mag), te.texParameteri(te.TEXTURE_2D, te.TEXTURE_MIN_FILTER, de.min), X || j || te.generateMipmap(te.TEXTURE_2D), this._bindTextureDirectly(te.TEXTURE_2D, null), U && U._removePendingData(M), M.onLoadedObservable.notifyObservers(M), M.onLoadedObservable.clear();\n            }\n          }, N.prototype._prepareWebGLTexture = function(M, U, X, j, ne, te, de, pe, ae) {\n            var ee = this;\n            ae === void 0 && (ae = m.a.TEXTURE_TRILINEAR_SAMPLINGMODE);\n            var K = this.getCaps().maxTextureSize, $ = Math.min(K, this.needPOTTextures ? N.GetExponentOfTwo(X, K) : X), L = Math.min(K, this.needPOTTextures ? N.GetExponentOfTwo(j, K) : j), G = this._gl;\n            G && (M._webGLTexture ? (this._bindTextureDirectly(G.TEXTURE_2D, M, !0), this._unpackFlipY(ne === void 0 || !!ne), M.baseWidth = X, M.baseHeight = j, M.width = $, M.height = L, M.isReady = !0, pe($, L, function() {\n              ee._prepareWebGLTextureContinuation(M, U, te, de, ae);\n            }) || this._prepareWebGLTextureContinuation(M, U, te, de, ae)) : U && U._removePendingData(M));\n          }, N.prototype._setupFramebufferDepthAttachments = function(M, U, X, j, ne) {\n            ne === void 0 && (ne = 1);\n            var te = this._gl;\n            if (M && U)\n              return this._getDepthStencilBuffer(X, j, ne, te.DEPTH_STENCIL, te.DEPTH24_STENCIL8, te.DEPTH_STENCIL_ATTACHMENT);\n            if (U) {\n              var de = te.DEPTH_COMPONENT16;\n              return this._webGLVersion > 1 && (de = te.DEPTH_COMPONENT32F), this._getDepthStencilBuffer(X, j, ne, de, de, te.DEPTH_ATTACHMENT);\n            }\n            return M ? this._getDepthStencilBuffer(X, j, ne, te.STENCIL_INDEX8, te.STENCIL_INDEX8, te.STENCIL_ATTACHMENT) : null;\n          }, N.prototype._releaseFramebufferObjects = function(M) {\n            var U = this._gl;\n            M._framebuffer && (U.deleteFramebuffer(M._framebuffer), M._framebuffer = null), M._depthStencilBuffer && (U.deleteRenderbuffer(M._depthStencilBuffer), M._depthStencilBuffer = null), M._MSAAFramebuffer && (U.deleteFramebuffer(M._MSAAFramebuffer), M._MSAAFramebuffer = null), M._MSAARenderBuffer && (U.deleteRenderbuffer(M._MSAARenderBuffer), M._MSAARenderBuffer = null);\n          }, N.prototype._releaseTexture = function(M) {\n            this._releaseFramebufferObjects(M), this._deleteTexture(M._webGLTexture), this.unbindAllTextures();\n            var U = this._internalTexturesCache.indexOf(M);\n            U !== -1 && this._internalTexturesCache.splice(U, 1), M._lodTextureHigh && M._lodTextureHigh.dispose(), M._lodTextureMid && M._lodTextureMid.dispose(), M._lodTextureLow && M._lodTextureLow.dispose(), M._irradianceTexture && M._irradianceTexture.dispose();\n          }, N.prototype._deleteTexture = function(M) {\n            this._gl.deleteTexture(M);\n          }, N.prototype._setProgram = function(M) {\n            this._currentProgram !== M && (this._gl.useProgram(M), this._currentProgram = M);\n          }, N.prototype.bindSamplers = function(M) {\n            var U = M.getPipelineContext();\n            this._setProgram(U.program);\n            for (var X = M.getSamplers(), j = 0; j < X.length; j++) {\n              var ne = M.getUniform(X[j]);\n              ne && (this._boundUniforms[j] = ne);\n            }\n            this._currentEffect = null;\n          }, N.prototype._activateCurrentTexture = function() {\n            this._currentTextureChannel !== this._activeChannel && (this._gl.activeTexture(this._gl.TEXTURE0 + this._activeChannel), this._currentTextureChannel = this._activeChannel);\n          }, N.prototype._bindTextureDirectly = function(M, U, X, j) {\n            X === void 0 && (X = !1), j === void 0 && (j = !1);\n            var ne = !1, te = U && U._associatedChannel > -1;\n            return X && te && (this._activeChannel = U._associatedChannel), this._boundTexturesCache[this._activeChannel] !== U || j ? (this._activateCurrentTexture(), U && U.isMultiview ? this._gl.bindTexture(M, U ? U._colorTextureArray : null) : this._gl.bindTexture(M, U ? U._webGLTexture : null), this._boundTexturesCache[this._activeChannel] = U, U && (U._associatedChannel = this._activeChannel)) : X && (ne = !0, this._activateCurrentTexture()), te && !X && this._bindSamplerUniformToChannel(U._associatedChannel, this._activeChannel), ne;\n          }, N.prototype._bindTexture = function(M, U) {\n            if (M !== void 0) {\n              U && (U._associatedChannel = M), this._activeChannel = M;\n              var X = U ? this._getTextureTarget(U) : this._gl.TEXTURE_2D;\n              this._bindTextureDirectly(X, U);\n            }\n          }, N.prototype.unbindAllTextures = function() {\n            for (var M = 0; M < this._maxSimultaneousTextures; M++)\n              this._activeChannel = M, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), this.webGLVersion > 1 && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null));\n          }, N.prototype.setTexture = function(M, U, X) {\n            M !== void 0 && (U && (this._boundUniforms[M] = U), this._setTexture(M, X));\n          }, N.prototype._bindSamplerUniformToChannel = function(M, U) {\n            var X = this._boundUniforms[M];\n            X && X._currentState !== U && (this._gl.uniform1i(X, U), X._currentState = U);\n          }, N.prototype._getTextureWrapMode = function(M) {\n            switch (M) {\n              case m.a.TEXTURE_WRAP_ADDRESSMODE:\n                return this._gl.REPEAT;\n              case m.a.TEXTURE_CLAMP_ADDRESSMODE:\n                return this._gl.CLAMP_TO_EDGE;\n              case m.a.TEXTURE_MIRROR_ADDRESSMODE:\n                return this._gl.MIRRORED_REPEAT;\n            }\n            return this._gl.REPEAT;\n          }, N.prototype._setTexture = function(M, U, X, j) {\n            if (X === void 0 && (X = !1), j === void 0 && (j = !1), !U)\n              return this._boundTexturesCache[M] != null && (this._activeChannel = M, this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), this.webGLVersion > 1 && (this._bindTextureDirectly(this._gl.TEXTURE_3D, null), this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY, null))), !1;\n            if (U.video)\n              this._activeChannel = M, U.update();\n            else if (U.delayLoadState === m.a.DELAYLOADSTATE_NOTLOADED)\n              return U.delayLoad(), !1;\n            var ne;\n            ne = j ? U.depthStencilTexture : U.isReady() ? U.getInternalTexture() : U.isCube ? this.emptyCubeTexture : U.is3D ? this.emptyTexture3D : U.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, !X && ne && (ne._associatedChannel = M);\n            var te = !0;\n            this._boundTexturesCache[M] === ne && (X || this._bindSamplerUniformToChannel(ne._associatedChannel, M), te = !1), this._activeChannel = M;\n            var de = this._getTextureTarget(ne);\n            if (te && this._bindTextureDirectly(de, ne, X), ne && !ne.isMultiview) {\n              if (ne.isCube && ne._cachedCoordinatesMode !== U.coordinatesMode) {\n                ne._cachedCoordinatesMode = U.coordinatesMode;\n                var pe = U.coordinatesMode !== m.a.TEXTURE_CUBIC_MODE && U.coordinatesMode !== m.a.TEXTURE_SKYBOX_MODE ? m.a.TEXTURE_WRAP_ADDRESSMODE : m.a.TEXTURE_CLAMP_ADDRESSMODE;\n                U.wrapU = pe, U.wrapV = pe;\n              }\n              ne._cachedWrapU !== U.wrapU && (ne._cachedWrapU = U.wrapU, this._setTextureParameterInteger(de, this._gl.TEXTURE_WRAP_S, this._getTextureWrapMode(U.wrapU), ne)), ne._cachedWrapV !== U.wrapV && (ne._cachedWrapV = U.wrapV, this._setTextureParameterInteger(de, this._gl.TEXTURE_WRAP_T, this._getTextureWrapMode(U.wrapV), ne)), ne.is3D && ne._cachedWrapR !== U.wrapR && (ne._cachedWrapR = U.wrapR, this._setTextureParameterInteger(de, this._gl.TEXTURE_WRAP_R, this._getTextureWrapMode(U.wrapR), ne)), this._setAnisotropicLevel(de, ne, U.anisotropicFilteringLevel);\n            }\n            return !0;\n          }, N.prototype.setTextureArray = function(M, U, X) {\n            if (M !== void 0 && U) {\n              this._textureUnits && this._textureUnits.length === X.length || (this._textureUnits = new Int32Array(X.length));\n              for (var j = 0; j < X.length; j++) {\n                var ne = X[j].getInternalTexture();\n                ne ? (this._textureUnits[j] = M + j, ne._associatedChannel = M + j) : this._textureUnits[j] = -1;\n              }\n              this._gl.uniform1iv(U, this._textureUnits);\n              for (var te = 0; te < X.length; te++)\n                this._setTexture(this._textureUnits[te], X[te], !0);\n            }\n          }, N.prototype._setAnisotropicLevel = function(M, U, X) {\n            var j = this._caps.textureAnisotropicFilterExtension;\n            U.samplingMode !== m.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST && U.samplingMode !== m.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR && U.samplingMode !== m.a.TEXTURE_LINEAR_LINEAR && (X = 1), j && U._cachedAnisotropicFilteringLevel !== X && (this._setTextureParameterFloat(M, j.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(X, this._caps.maxAnisotropy), U), U._cachedAnisotropicFilteringLevel = X);\n          }, N.prototype._setTextureParameterFloat = function(M, U, X, j) {\n            this._bindTextureDirectly(M, j, !0, !0), this._gl.texParameterf(M, U, X);\n          }, N.prototype._setTextureParameterInteger = function(M, U, X, j) {\n            j && this._bindTextureDirectly(M, j, !0, !0), this._gl.texParameteri(M, U, X);\n          }, N.prototype.unbindAllAttributes = function() {\n            if (this._mustWipeVertexAttributes) {\n              this._mustWipeVertexAttributes = !1;\n              for (var M = 0; M < this._caps.maxVertexAttribs; M++)\n                this.disableAttributeByIndex(M);\n            } else {\n              M = 0;\n              for (var U = this._vertexAttribArraysEnabled.length; M < U; M++)\n                M >= this._caps.maxVertexAttribs || !this._vertexAttribArraysEnabled[M] || this.disableAttributeByIndex(M);\n            }\n          }, N.prototype.releaseEffects = function() {\n            for (var M in this._compiledEffects) {\n              var U = this._compiledEffects[M].getPipelineContext();\n              this._deletePipelineContext(U);\n            }\n            this._compiledEffects = {};\n          }, N.prototype.dispose = function() {\n            this.stopRenderLoop(), this.onBeforeTextureInitObservable && this.onBeforeTextureInitObservable.clear(), this._emptyTexture && (this._releaseTexture(this._emptyTexture), this._emptyTexture = null), this._emptyCubeTexture && (this._releaseTexture(this._emptyCubeTexture), this._emptyCubeTexture = null), this._dummyFramebuffer && this._gl.deleteFramebuffer(this._dummyFramebuffer), this.releaseEffects(), this.unbindAllAttributes(), this._boundUniforms = [], S.a.IsWindowObjectExist() && this._renderingCanvas && (this._doNotHandleContextLost || (this._renderingCanvas.removeEventListener(\"webglcontextlost\", this._onContextLost), this._renderingCanvas.removeEventListener(\"webglcontextrestored\", this._onContextRestored))), this._workingCanvas = null, this._workingContext = null, this._currentBufferPointers = [], this._renderingCanvas = null, this._currentProgram = null, this._boundRenderFunction = null, _.a.ResetCache();\n            for (var M = 0, U = this._activeRequests; M < U.length; M++)\n              U[M].abort();\n          }, N.prototype.attachContextLostEvent = function(M) {\n            this._renderingCanvas && this._renderingCanvas.addEventListener(\"webglcontextlost\", M, !1);\n          }, N.prototype.attachContextRestoredEvent = function(M) {\n            this._renderingCanvas && this._renderingCanvas.addEventListener(\"webglcontextrestored\", M, !1);\n          }, N.prototype.getError = function() {\n            return this._gl.getError();\n          }, N.prototype._canRenderToFloatFramebuffer = function() {\n            return this._webGLVersion > 1 ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(m.a.TEXTURETYPE_FLOAT);\n          }, N.prototype._canRenderToHalfFloatFramebuffer = function() {\n            return this._webGLVersion > 1 ? this._caps.colorBufferFloat : this._canRenderToFramebuffer(m.a.TEXTURETYPE_HALF_FLOAT);\n          }, N.prototype._canRenderToFramebuffer = function(M) {\n            for (var U = this._gl; U.getError() !== U.NO_ERROR; )\n              ;\n            var X = !0, j = U.createTexture();\n            U.bindTexture(U.TEXTURE_2D, j), U.texImage2D(U.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(M), 1, 1, 0, U.RGBA, this._getWebGLTextureType(M), null), U.texParameteri(U.TEXTURE_2D, U.TEXTURE_MIN_FILTER, U.NEAREST), U.texParameteri(U.TEXTURE_2D, U.TEXTURE_MAG_FILTER, U.NEAREST);\n            var ne = U.createFramebuffer();\n            U.bindFramebuffer(U.FRAMEBUFFER, ne), U.framebufferTexture2D(U.FRAMEBUFFER, U.COLOR_ATTACHMENT0, U.TEXTURE_2D, j, 0);\n            var te = U.checkFramebufferStatus(U.FRAMEBUFFER);\n            if ((X = (X = X && te === U.FRAMEBUFFER_COMPLETE) && U.getError() === U.NO_ERROR) && (U.clear(U.COLOR_BUFFER_BIT), X = X && U.getError() === U.NO_ERROR), X) {\n              U.bindFramebuffer(U.FRAMEBUFFER, null);\n              var de = U.RGBA, pe = U.UNSIGNED_BYTE, ae = new Uint8Array(4);\n              U.readPixels(0, 0, 1, 1, de, pe, ae), X = X && U.getError() === U.NO_ERROR;\n            }\n            for (U.deleteTexture(j), U.deleteFramebuffer(ne), U.bindFramebuffer(U.FRAMEBUFFER, null); !X && U.getError() !== U.NO_ERROR; )\n              ;\n            return X;\n          }, N.prototype._getWebGLTextureType = function(M) {\n            if (this._webGLVersion === 1) {\n              switch (M) {\n                case m.a.TEXTURETYPE_FLOAT:\n                  return this._gl.FLOAT;\n                case m.a.TEXTURETYPE_HALF_FLOAT:\n                  return this._gl.HALF_FLOAT_OES;\n                case m.a.TEXTURETYPE_UNSIGNED_BYTE:\n                  return this._gl.UNSIGNED_BYTE;\n                case m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n                  return this._gl.UNSIGNED_SHORT_4_4_4_4;\n                case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n                  return this._gl.UNSIGNED_SHORT_5_5_5_1;\n                case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n                  return this._gl.UNSIGNED_SHORT_5_6_5;\n              }\n              return this._gl.UNSIGNED_BYTE;\n            }\n            switch (M) {\n              case m.a.TEXTURETYPE_BYTE:\n                return this._gl.BYTE;\n              case m.a.TEXTURETYPE_UNSIGNED_BYTE:\n                return this._gl.UNSIGNED_BYTE;\n              case m.a.TEXTURETYPE_SHORT:\n                return this._gl.SHORT;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT:\n                return this._gl.UNSIGNED_SHORT;\n              case m.a.TEXTURETYPE_INT:\n                return this._gl.INT;\n              case m.a.TEXTURETYPE_UNSIGNED_INTEGER:\n                return this._gl.UNSIGNED_INT;\n              case m.a.TEXTURETYPE_FLOAT:\n                return this._gl.FLOAT;\n              case m.a.TEXTURETYPE_HALF_FLOAT:\n                return this._gl.HALF_FLOAT;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n                return this._gl.UNSIGNED_SHORT_4_4_4_4;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n                return this._gl.UNSIGNED_SHORT_5_5_5_1;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n                return this._gl.UNSIGNED_SHORT_5_6_5;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\n                return this._gl.UNSIGNED_INT_2_10_10_10_REV;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_24_8:\n                return this._gl.UNSIGNED_INT_24_8;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\n                return this._gl.UNSIGNED_INT_10F_11F_11F_REV;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\n                return this._gl.UNSIGNED_INT_5_9_9_9_REV;\n              case m.a.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV:\n                return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV;\n            }\n            return this._gl.UNSIGNED_BYTE;\n          }, N.prototype._getInternalFormat = function(M) {\n            var U = this._gl.RGBA;\n            switch (M) {\n              case m.a.TEXTUREFORMAT_ALPHA:\n                U = this._gl.ALPHA;\n                break;\n              case m.a.TEXTUREFORMAT_LUMINANCE:\n                U = this._gl.LUMINANCE;\n                break;\n              case m.a.TEXTUREFORMAT_LUMINANCE_ALPHA:\n                U = this._gl.LUMINANCE_ALPHA;\n                break;\n              case m.a.TEXTUREFORMAT_RED:\n                U = this._gl.RED;\n                break;\n              case m.a.TEXTUREFORMAT_RG:\n                U = this._gl.RG;\n                break;\n              case m.a.TEXTUREFORMAT_RGB:\n                U = this._gl.RGB;\n                break;\n              case m.a.TEXTUREFORMAT_RGBA:\n                U = this._gl.RGBA;\n            }\n            if (this._webGLVersion > 1)\n              switch (M) {\n                case m.a.TEXTUREFORMAT_RED_INTEGER:\n                  U = this._gl.RED_INTEGER;\n                  break;\n                case m.a.TEXTUREFORMAT_RG_INTEGER:\n                  U = this._gl.RG_INTEGER;\n                  break;\n                case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                  U = this._gl.RGB_INTEGER;\n                  break;\n                case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  U = this._gl.RGBA_INTEGER;\n              }\n            return U;\n          }, N.prototype._getRGBABufferInternalSizedFormat = function(M, U) {\n            if (this._webGLVersion === 1) {\n              if (U !== void 0)\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_ALPHA:\n                    return this._gl.ALPHA;\n                  case m.a.TEXTUREFORMAT_LUMINANCE:\n                    return this._gl.LUMINANCE;\n                  case m.a.TEXTUREFORMAT_LUMINANCE_ALPHA:\n                    return this._gl.LUMINANCE_ALPHA;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB;\n                }\n              return this._gl.RGBA;\n            }\n            switch (M) {\n              case m.a.TEXTURETYPE_BYTE:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R8_SNORM;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG8_SNORM;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB8_SNORM;\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R8I;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG8I;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB8I;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                    return this._gl.RGBA8I;\n                  default:\n                    return this._gl.RGBA8_SNORM;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_BYTE:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R8;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG8;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB8;\n                  case m.a.TEXTUREFORMAT_RGBA:\n                    return this._gl.RGBA8;\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R8UI;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG8UI;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB8UI;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                    return this._gl.RGBA8UI;\n                  case m.a.TEXTUREFORMAT_ALPHA:\n                    return this._gl.ALPHA;\n                  case m.a.TEXTUREFORMAT_LUMINANCE:\n                    return this._gl.LUMINANCE;\n                  case m.a.TEXTUREFORMAT_LUMINANCE_ALPHA:\n                    return this._gl.LUMINANCE_ALPHA;\n                  default:\n                    return this._gl.RGBA8;\n                }\n              case m.a.TEXTURETYPE_SHORT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R16I;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG16I;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB16I;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA16I;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R16UI;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG16UI;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB16UI;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA16UI;\n                }\n              case m.a.TEXTURETYPE_INT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R32I;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG32I;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB32I;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA32I;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_INTEGER:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED_INTEGER:\n                    return this._gl.R32UI;\n                  case m.a.TEXTUREFORMAT_RG_INTEGER:\n                    return this._gl.RG32UI;\n                  case m.a.TEXTUREFORMAT_RGB_INTEGER:\n                    return this._gl.RGB32UI;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                  default:\n                    return this._gl.RGBA32UI;\n                }\n              case m.a.TEXTURETYPE_FLOAT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R32F;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG32F;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB32F;\n                  case m.a.TEXTUREFORMAT_RGBA:\n                  default:\n                    return this._gl.RGBA32F;\n                }\n              case m.a.TEXTURETYPE_HALF_FLOAT:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RED:\n                    return this._gl.R16F;\n                  case m.a.TEXTUREFORMAT_RG:\n                    return this._gl.RG16F;\n                  case m.a.TEXTUREFORMAT_RGB:\n                    return this._gl.RGB16F;\n                  case m.a.TEXTUREFORMAT_RGBA:\n                  default:\n                    return this._gl.RGBA16F;\n                }\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5:\n                return this._gl.RGB565;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV:\n                return this._gl.R11F_G11F_B10F;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV:\n                return this._gl.RGB9_E5;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4:\n                return this._gl.RGBA4;\n              case m.a.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1:\n                return this._gl.RGB5_A1;\n              case m.a.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV:\n                switch (U) {\n                  case m.a.TEXTUREFORMAT_RGBA:\n                    return this._gl.RGB10_A2;\n                  case m.a.TEXTUREFORMAT_RGBA_INTEGER:\n                    return this._gl.RGB10_A2UI;\n                  default:\n                    return this._gl.RGB10_A2;\n                }\n            }\n            return this._gl.RGBA8;\n          }, N.prototype._getRGBAMultiSampleBufferFormat = function(M) {\n            return M === m.a.TEXTURETYPE_FLOAT ? this._gl.RGBA32F : M === m.a.TEXTURETYPE_HALF_FLOAT ? this._gl.RGBA16F : this._gl.RGBA8;\n          }, N.prototype._loadFile = function(M, U, X, j, ne, te) {\n            var de = this, pe = N._FileToolsLoadFile(M, U, X, j, ne, te);\n            return this._activeRequests.push(pe), pe.onCompleteObservable.add(function(ae) {\n              de._activeRequests.splice(de._activeRequests.indexOf(ae), 1);\n            }), pe;\n          }, N._FileToolsLoadFile = function(M, U, X, j, ne, te) {\n            throw C.a.WarnImport(\"FileTools\");\n          }, N.prototype.readPixels = function(M, U, X, j, ne) {\n            ne === void 0 && (ne = !0);\n            var te = ne ? 4 : 3, de = ne ? this._gl.RGBA : this._gl.RGB, pe = new Uint8Array(j * X * te);\n            return this._gl.readPixels(M, U, X, j, de, this._gl.UNSIGNED_BYTE, pe), pe;\n          }, Object.defineProperty(N, \"IsSupported\", { get: function() {\n            return this.isSupported();\n          }, enumerable: !1, configurable: !0 }), N.isSupported = function() {\n            if (this._HasMajorPerformanceCaveat !== null)\n              return !this._HasMajorPerformanceCaveat;\n            if (this._IsSupported === null)\n              try {\n                var M = v.a.CreateCanvas(1, 1), U = M.getContext(\"webgl\") || M.getContext(\"experimental-webgl\");\n                this._IsSupported = U != null && !!window.WebGLRenderingContext;\n              } catch {\n                this._IsSupported = !1;\n              }\n            return this._IsSupported;\n          }, Object.defineProperty(N, \"HasMajorPerformanceCaveat\", { get: function() {\n            if (this._HasMajorPerformanceCaveat === null)\n              try {\n                var M = v.a.CreateCanvas(1, 1), U = M.getContext(\"webgl\", { failIfMajorPerformanceCaveat: !0 }) || M.getContext(\"experimental-webgl\", { failIfMajorPerformanceCaveat: !0 });\n                this._HasMajorPerformanceCaveat = !U;\n              } catch {\n                this._HasMajorPerformanceCaveat = !1;\n              }\n            return this._HasMajorPerformanceCaveat;\n          }, enumerable: !1, configurable: !0 }), N.CeilingPOT = function(M) {\n            return M--, M |= M >> 1, M |= M >> 2, M |= M >> 4, M |= M >> 8, M |= M >> 16, ++M;\n          }, N.FloorPOT = function(M) {\n            return M |= M >> 1, M |= M >> 2, M |= M >> 4, M |= M >> 8, (M |= M >> 16) - (M >> 1);\n          }, N.NearestPOT = function(M) {\n            var U = N.CeilingPOT(M), X = N.FloorPOT(M);\n            return U - M > M - X ? X : U;\n          }, N.GetExponentOfTwo = function(M, U, X) {\n            var j;\n            switch (X === void 0 && (X = m.a.SCALEMODE_NEAREST), X) {\n              case m.a.SCALEMODE_FLOOR:\n                j = N.FloorPOT(M);\n                break;\n              case m.a.SCALEMODE_NEAREST:\n                j = N.NearestPOT(M);\n                break;\n              case m.a.SCALEMODE_CEILING:\n              default:\n                j = N.CeilingPOT(M);\n            }\n            return Math.min(j, U);\n          }, N.QueueNewFrame = function(M, U) {\n            return S.a.IsWindowObjectExist() ? (U || (U = window), U.requestPostAnimationFrame ? U.requestPostAnimationFrame(M) : U.requestAnimationFrame ? U.requestAnimationFrame(M) : U.msRequestAnimationFrame ? U.msRequestAnimationFrame(M) : U.webkitRequestAnimationFrame ? U.webkitRequestAnimationFrame(M) : U.mozRequestAnimationFrame ? U.mozRequestAnimationFrame(M) : U.oRequestAnimationFrame ? U.oRequestAnimationFrame(M) : window.setTimeout(M, 16)) : typeof requestAnimationFrame < \"u\" ? requestAnimationFrame(M) : setTimeout(M, 16);\n          }, N.prototype.getHostDocument = function() {\n            return this._renderingCanvas && this._renderingCanvas.ownerDocument ? this._renderingCanvas.ownerDocument : document;\n          }, N.ExceptionList = [{ key: \"Chrome/63.0\", capture: \"63\\\\.0\\\\.3239\\\\.(\\\\d+)\", captureConstraint: 108, targets: [\"uniformBuffer\"] }, { key: \"Firefox/58\", capture: null, captureConstraint: null, targets: [\"uniformBuffer\"] }, { key: \"Firefox/59\", capture: null, captureConstraint: null, targets: [\"uniformBuffer\"] }, { key: \"Chrome/72.+?Mobile\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Chrome/73.+?Mobile\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Chrome/74.+?Mobile\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Mac OS.+Chrome/71\", capture: null, captureConstraint: null, targets: [\"vao\"] }, { key: \"Mac OS.+Chrome/72\", capture: null, captureConstraint: null, targets: [\"vao\"] }], N._TextureLoaders = [], N.CollisionsEpsilon = 1e-3, N._IsSupported = null, N._HasMajorPerformanceCaveat = null, N;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return V;\n        }), f.d(A, \"a\", function() {\n          return O;\n        });\n        var V, _ = f(6), C = f(102), u = f(2), I = f(21);\n        (function(x) {\n          x[x.Unknown = 0] = \"Unknown\", x[x.Url = 1] = \"Url\", x[x.Temp = 2] = \"Temp\", x[x.Raw = 3] = \"Raw\", x[x.Dynamic = 4] = \"Dynamic\", x[x.RenderTarget = 5] = \"RenderTarget\", x[x.MultiRenderTarget = 6] = \"MultiRenderTarget\", x[x.Cube = 7] = \"Cube\", x[x.CubeRaw = 8] = \"CubeRaw\", x[x.CubePrefiltered = 9] = \"CubePrefiltered\", x[x.Raw3D = 10] = \"Raw3D\", x[x.Raw2DArray = 11] = \"Raw2DArray\", x[x.Depth = 12] = \"Depth\", x[x.CubeRawRGBD = 13] = \"CubeRawRGBD\";\n        })(V || (V = {}));\n        var O = function() {\n          function x(m, c, T) {\n            T === void 0 && (T = !1), this.isReady = !1, this.isCube = !1, this.is3D = !1, this.is2DArray = !1, this.isMultiview = !1, this.url = \"\", this.samplingMode = -1, this.generateMipMaps = !1, this.samples = 0, this.type = -1, this.format = -1, this.onLoadedObservable = new _.c(), this.width = 0, this.height = 0, this.depth = 0, this.baseWidth = 0, this.baseHeight = 0, this.baseDepth = 0, this.invertY = !1, this._invertVScale = !1, this._associatedChannel = -1, this._source = V.Unknown, this._buffer = null, this._bufferView = null, this._bufferViewArray = null, this._bufferViewArrayArray = null, this._size = 0, this._extension = \"\", this._files = null, this._workingCanvas = null, this._workingContext = null, this._framebuffer = null, this._depthStencilBuffer = null, this._MSAAFramebuffer = null, this._MSAARenderBuffer = null, this._attachments = null, this._textureArray = null, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedWrapR = null, this._cachedAnisotropicFilteringLevel = null, this._isDisabled = !1, this._compression = null, this._generateStencilBuffer = !1, this._generateDepthBuffer = !1, this._comparisonFunction = 0, this._sphericalPolynomial = null, this._lodGenerationScale = 0, this._lodGenerationOffset = 0, this._colorTextureArray = null, this._depthStencilTextureArray = null, this._lodTextureHigh = null, this._lodTextureMid = null, this._lodTextureLow = null, this._isRGBD = !1, this._linearSpecularLOD = !1, this._irradianceTexture = null, this._webGLTexture = null, this._references = 1, this._gammaSpace = null, this._engine = m, this._source = c, T || (this._webGLTexture = m._createTexture());\n          }\n          return x.prototype.getEngine = function() {\n            return this._engine;\n          }, Object.defineProperty(x.prototype, \"source\", { get: function() {\n            return this._source;\n          }, enumerable: !1, configurable: !0 }), x.prototype.incrementReferences = function() {\n            this._references++;\n          }, x.prototype.updateSize = function(m, c, T) {\n            T === void 0 && (T = 1), this.width = m, this.height = c, this.depth = T, this.baseWidth = m, this.baseHeight = c, this.baseDepth = T, this._size = m * c * T;\n          }, x.prototype._rebuild = function() {\n            var m, c, T = this;\n            switch (this.isReady = !1, this._cachedCoordinatesMode = null, this._cachedWrapU = null, this._cachedWrapV = null, this._cachedAnisotropicFilteringLevel = null, this.source) {\n              case V.Temp:\n                return;\n              case V.Url:\n                return void (c = this._engine.createTexture((m = this._originalUrl) !== null && m !== void 0 ? m : this.url, !this.generateMipMaps, this.invertY, null, this.samplingMode, function() {\n                  c._swapAndDie(T), T.isReady = !0;\n                }, null, this._buffer, void 0, this.format));\n              case V.Raw:\n                return (c = this._engine.createRawTexture(this._bufferView, this.baseWidth, this.baseHeight, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.Raw3D:\n                return (c = this._engine.createRawTexture3D(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.Raw2DArray:\n                return (c = this._engine.createRawTexture2DArray(this._bufferView, this.baseWidth, this.baseHeight, this.baseDepth, this.format, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.Dynamic:\n                return (c = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode))._swapAndDie(this), void this._engine.updateDynamicTexture(this, this._engine.getRenderingCanvas(), this.invertY, void 0, void 0, !0);\n              case V.RenderTarget:\n                var S = new C.a();\n                if (S.generateDepthBuffer = this._generateDepthBuffer, S.generateMipMaps = this.generateMipMaps, S.generateStencilBuffer = this._generateStencilBuffer, S.samplingMode = this.samplingMode, S.type = this.type, this.isCube)\n                  c = this._engine.createRenderTargetCubeTexture(this.width, S);\n                else {\n                  var E = { width: this.width, height: this.height, layers: this.is2DArray ? this.depth : void 0 };\n                  c = this._engine.createRenderTargetTexture(E, S);\n                }\n                return c._swapAndDie(this), void (this.isReady = !0);\n              case V.Depth:\n                var g = { bilinearFiltering: this.samplingMode !== u.a.TEXTURE_BILINEAR_SAMPLINGMODE, comparisonFunction: this._comparisonFunction, generateStencil: this._generateStencilBuffer, isCube: this.isCube }, l = { width: this.width, height: this.height, layers: this.is2DArray ? this.depth : void 0 };\n                return (c = this._engine.createDepthStencilTexture(l, g))._swapAndDie(this), void (this.isReady = !0);\n              case V.Cube:\n                return void (c = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, function() {\n                  c._swapAndDie(T), T.isReady = !0;\n                }, null, this.format, this._extension));\n              case V.CubeRaw:\n                return (c = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression))._swapAndDie(this), void (this.isReady = !0);\n              case V.CubeRawRGBD:\n                return c = this._engine.createRawCubeTexture(null, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression), void x._UpdateRGBDAsync(c, this._bufferViewArrayArray, this._sphericalPolynomial, this._lodGenerationScale, this._lodGenerationOffset).then(function() {\n                  c._swapAndDie(T), T.isReady = !0;\n                });\n              case V.CubePrefiltered:\n                return void ((c = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, function(h) {\n                  h && h._swapAndDie(T), T.isReady = !0;\n                }, null, this.format, this._extension))._sphericalPolynomial = this._sphericalPolynomial);\n            }\n          }, x.prototype._swapAndDie = function(m) {\n            m._webGLTexture = this._webGLTexture, m._isRGBD = this._isRGBD, this._framebuffer && (m._framebuffer = this._framebuffer), this._depthStencilBuffer && (m._depthStencilBuffer = this._depthStencilBuffer), m._depthStencilTexture = this._depthStencilTexture, this._lodTextureHigh && (m._lodTextureHigh && m._lodTextureHigh.dispose(), m._lodTextureHigh = this._lodTextureHigh), this._lodTextureMid && (m._lodTextureMid && m._lodTextureMid.dispose(), m._lodTextureMid = this._lodTextureMid), this._lodTextureLow && (m._lodTextureLow && m._lodTextureLow.dispose(), m._lodTextureLow = this._lodTextureLow), this._irradianceTexture && (m._irradianceTexture && m._irradianceTexture.dispose(), m._irradianceTexture = this._irradianceTexture);\n            var c, T = this._engine.getLoadedTexturesCache();\n            (c = T.indexOf(this)) !== -1 && T.splice(c, 1), (c = T.indexOf(m)) === -1 && T.push(m);\n          }, x.prototype.dispose = function() {\n            this._webGLTexture && (this._references--, this._references === 0 && (this._engine._releaseTexture(this), this._webGLTexture = null));\n          }, x._UpdateRGBDAsync = function(m, c, T, S, E) {\n            throw I.a.WarnImport(\"environmentTextureTools\");\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return V;\n        }), f.d(A, \"c\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = 1 / 2.2, _ = 2.2, C = 1e-3;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(1), _ = f(0), C = f(3), u = f(6), I = f(22), O = f(21), x = function() {\n          function m(c, T) {\n            T === void 0 && (T = null), this.state = \"\", this.metadata = null, this.reservedDataStore = null, this._doNotSerialize = !1, this._isDisposed = !1, this.animations = new Array(), this._ranges = {}, this.onReady = null, this._isEnabled = !0, this._isParentEnabled = !0, this._isReady = !0, this._currentRenderId = -1, this._parentUpdateId = -1, this._childUpdateId = -1, this._waitingParentId = null, this._cache = {}, this._parentNode = null, this._children = null, this._worldMatrix = _.a.Identity(), this._worldMatrixDeterminant = 0, this._worldMatrixDeterminantIsDirty = !0, this._sceneRootNodesIndex = -1, this._animationPropertiesOverride = null, this._isNode = !0, this.onDisposeObservable = new u.c(), this._onDisposeObserver = null, this._behaviors = new Array(), this.name = c, this.id = c, this._scene = T || I.a.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._initCache();\n          }\n          return m.AddNodeConstructor = function(c, T) {\n            this._NodeConstructors[c] = T;\n          }, m.Construct = function(c, T, S, E) {\n            var g = this._NodeConstructors[c];\n            return g ? g(T, S, E) : null;\n          }, Object.defineProperty(m.prototype, \"doNotSerialize\", { get: function() {\n            return !!this._doNotSerialize || !!this._parentNode && this._parentNode.doNotSerialize;\n          }, set: function(c) {\n            this._doNotSerialize = c;\n          }, enumerable: !1, configurable: !0 }), m.prototype.isDisposed = function() {\n            return this._isDisposed;\n          }, Object.defineProperty(m.prototype, \"parent\", { get: function() {\n            return this._parentNode;\n          }, set: function(c) {\n            if (this._parentNode !== c) {\n              var T = this._parentNode;\n              if (this._parentNode && this._parentNode._children !== void 0 && this._parentNode._children !== null) {\n                var S = this._parentNode._children.indexOf(this);\n                S !== -1 && this._parentNode._children.splice(S, 1), c || this._isDisposed || this._addToSceneRootNodes();\n              }\n              this._parentNode = c, this._parentNode && (this._parentNode._children !== void 0 && this._parentNode._children !== null || (this._parentNode._children = new Array()), this._parentNode._children.push(this), T || this._removeFromSceneRootNodes()), this._syncParentEnabledState();\n            }\n          }, enumerable: !1, configurable: !0 }), m.prototype._addToSceneRootNodes = function() {\n            this._sceneRootNodesIndex === -1 && (this._sceneRootNodesIndex = this._scene.rootNodes.length, this._scene.rootNodes.push(this));\n          }, m.prototype._removeFromSceneRootNodes = function() {\n            if (this._sceneRootNodesIndex !== -1) {\n              var c = this._scene.rootNodes, T = c.length - 1;\n              c[this._sceneRootNodesIndex] = c[T], c[this._sceneRootNodesIndex]._sceneRootNodesIndex = this._sceneRootNodesIndex, this._scene.rootNodes.pop(), this._sceneRootNodesIndex = -1;\n            }\n          }, Object.defineProperty(m.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;\n          }, set: function(c) {\n            this._animationPropertiesOverride = c;\n          }, enumerable: !1, configurable: !0 }), m.prototype.getClassName = function() {\n            return \"Node\";\n          }, Object.defineProperty(m.prototype, \"onDispose\", { set: function(c) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(c);\n          }, enumerable: !1, configurable: !0 }), m.prototype.getScene = function() {\n            return this._scene;\n          }, m.prototype.getEngine = function() {\n            return this._scene.getEngine();\n          }, m.prototype.addBehavior = function(c, T) {\n            var S = this;\n            return T === void 0 && (T = !1), this._behaviors.indexOf(c) !== -1 || (c.init(), this._scene.isLoading && !T ? this._scene.onDataLoadedObservable.addOnce(function() {\n              c.attach(S);\n            }) : c.attach(this), this._behaviors.push(c)), this;\n          }, m.prototype.removeBehavior = function(c) {\n            var T = this._behaviors.indexOf(c);\n            return T === -1 || (this._behaviors[T].detach(), this._behaviors.splice(T, 1)), this;\n          }, Object.defineProperty(m.prototype, \"behaviors\", { get: function() {\n            return this._behaviors;\n          }, enumerable: !1, configurable: !0 }), m.prototype.getBehaviorByName = function(c) {\n            for (var T = 0, S = this._behaviors; T < S.length; T++) {\n              var E = S[T];\n              if (E.name === c)\n                return E;\n            }\n            return null;\n          }, m.prototype.getWorldMatrix = function() {\n            return this._currentRenderId !== this._scene.getRenderId() && this.computeWorldMatrix(), this._worldMatrix;\n          }, m.prototype._getWorldMatrixDeterminant = function() {\n            return this._worldMatrixDeterminantIsDirty && (this._worldMatrixDeterminantIsDirty = !1, this._worldMatrixDeterminant = this._worldMatrix.determinant()), this._worldMatrixDeterminant;\n          }, Object.defineProperty(m.prototype, \"worldMatrixFromCache\", { get: function() {\n            return this._worldMatrix;\n          }, enumerable: !1, configurable: !0 }), m.prototype._initCache = function() {\n            this._cache = {}, this._cache.parent = void 0;\n          }, m.prototype.updateCache = function(c) {\n            !c && this.isSynchronized() || (this._cache.parent = this.parent, this._updateCache());\n          }, m.prototype._getActionManagerForTrigger = function(c, T) {\n            return this.parent ? this.parent._getActionManagerForTrigger(c, !1) : null;\n          }, m.prototype._updateCache = function(c) {\n          }, m.prototype._isSynchronized = function() {\n            return !0;\n          }, m.prototype._markSyncedWithParent = function() {\n            this._parentNode && (this._parentUpdateId = this._parentNode._childUpdateId);\n          }, m.prototype.isSynchronizedWithParent = function() {\n            return !this._parentNode || this._parentUpdateId === this._parentNode._childUpdateId && this._parentNode.isSynchronized();\n          }, m.prototype.isSynchronized = function() {\n            return this._cache.parent != this._parentNode ? (this._cache.parent = this._parentNode, !1) : !(this._parentNode && !this.isSynchronizedWithParent()) && this._isSynchronized();\n          }, m.prototype.isReady = function(c) {\n            return this._isReady;\n          }, m.prototype.isEnabled = function(c) {\n            return c === void 0 && (c = !0), c === !1 ? this._isEnabled : !!this._isEnabled && this._isParentEnabled;\n          }, m.prototype._syncParentEnabledState = function() {\n            this._isParentEnabled = !this._parentNode || this._parentNode.isEnabled(), this._children && this._children.forEach(function(c) {\n              c._syncParentEnabledState();\n            });\n          }, m.prototype.setEnabled = function(c) {\n            this._isEnabled = c, this._syncParentEnabledState();\n          }, m.prototype.isDescendantOf = function(c) {\n            return !!this.parent && (this.parent === c || this.parent.isDescendantOf(c));\n          }, m.prototype._getDescendants = function(c, T, S) {\n            if (T === void 0 && (T = !1), this._children)\n              for (var E = 0; E < this._children.length; E++) {\n                var g = this._children[E];\n                S && !S(g) || c.push(g), T || g._getDescendants(c, !1, S);\n              }\n          }, m.prototype.getDescendants = function(c, T) {\n            var S = new Array();\n            return this._getDescendants(S, c, T), S;\n          }, m.prototype.getChildMeshes = function(c, T) {\n            var S = [];\n            return this._getDescendants(S, c, function(E) {\n              return (!T || T(E)) && E.cullingStrategy !== void 0;\n            }), S;\n          }, m.prototype.getChildren = function(c, T) {\n            return T === void 0 && (T = !0), this.getDescendants(T, c);\n          }, m.prototype._setReady = function(c) {\n            c !== this._isReady && (c ? (this.onReady && this.onReady(this), this._isReady = !0) : this._isReady = !1);\n          }, m.prototype.getAnimationByName = function(c) {\n            for (var T = 0; T < this.animations.length; T++) {\n              var S = this.animations[T];\n              if (S.name === c)\n                return S;\n            }\n            return null;\n          }, m.prototype.createAnimationRange = function(c, T, S) {\n            if (!this._ranges[c]) {\n              this._ranges[c] = m._AnimationRangeFactory(c, T, S);\n              for (var E = 0, g = this.animations.length; E < g; E++)\n                this.animations[E] && this.animations[E].createRange(c, T, S);\n            }\n          }, m.prototype.deleteAnimationRange = function(c, T) {\n            T === void 0 && (T = !0);\n            for (var S = 0, E = this.animations.length; S < E; S++)\n              this.animations[S] && this.animations[S].deleteRange(c, T);\n            this._ranges[c] = null;\n          }, m.prototype.getAnimationRange = function(c) {\n            return this._ranges[c] || null;\n          }, m.prototype.getAnimationRanges = function() {\n            var c, T = [];\n            for (c in this._ranges)\n              T.push(this._ranges[c]);\n            return T;\n          }, m.prototype.beginAnimation = function(c, T, S, E) {\n            var g = this.getAnimationRange(c);\n            return g ? this._scene.beginAnimation(this, g.from, g.to, T, S, E) : null;\n          }, m.prototype.serializeAnimationRanges = function() {\n            var c = [];\n            for (var T in this._ranges) {\n              var S = this._ranges[T];\n              if (S) {\n                var E = {};\n                E.name = T, E.from = S.from, E.to = S.to, c.push(E);\n              }\n            }\n            return c;\n          }, m.prototype.computeWorldMatrix = function(c) {\n            return this._worldMatrix || (this._worldMatrix = _.a.Identity()), this._worldMatrix;\n          }, m.prototype.dispose = function(c, T) {\n            if (T === void 0 && (T = !1), this._isDisposed = !0, !c)\n              for (var S = 0, E = this.getDescendants(!0); S < E.length; S++)\n                E[S].dispose(c, T);\n            this.parent ? this.parent = null : this._removeFromSceneRootNodes(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n            for (var g = 0, l = this._behaviors; g < l.length; g++)\n              l[g].detach();\n            this._behaviors = [];\n          }, m.ParseAnimationRanges = function(c, T, S) {\n            if (T.ranges)\n              for (var E = 0; E < T.ranges.length; E++) {\n                var g = T.ranges[E];\n                c.createAnimationRange(g.name, g.from, g.to);\n              }\n          }, m.prototype.getHierarchyBoundingVectors = function(c, T) {\n            var S, E;\n            if (c === void 0 && (c = !0), T === void 0 && (T = null), this.getScene().incrementRenderId(), this.computeWorldMatrix(!0), this.getBoundingInfo && this.subMeshes) {\n              var g = this.getBoundingInfo();\n              S = g.boundingBox.minimumWorld.clone(), E = g.boundingBox.maximumWorld.clone();\n            } else\n              S = new _.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), E = new _.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n            if (c)\n              for (var l = 0, h = this.getDescendants(!1); l < h.length; l++) {\n                var v = h[l];\n                if (v.computeWorldMatrix(!0), (!T || T(v)) && v.getBoundingInfo && v.getTotalVertices() !== 0) {\n                  var b = v.getBoundingInfo().boundingBox, D = b.minimumWorld, w = b.maximumWorld;\n                  _.e.CheckExtends(D, S, E), _.e.CheckExtends(w, S, E);\n                }\n              }\n            return { min: S, max: E };\n          }, m._AnimationRangeFactory = function(c, T, S) {\n            throw O.a.WarnImport(\"AnimationRange\");\n          }, m._NodeConstructors = {}, Object(V.c)([Object(C.c)()], m.prototype, \"name\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"id\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"uniqueId\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"state\", void 0), Object(V.c)([Object(C.c)()], m.prototype, \"metadata\", void 0), m;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return de;\n        }), f.d(A, \"a\", function() {\n          return pe;\n        });\n        var V = f(1), _ = f(3), C = f(33), u = f(20), I = f(0), O = f(9), x = f(4), m = f(105), c = f(42), T = f(25), S = f(76), E = f(87), g = f(15), l = f(10), h = f(11), v = f(19), b = f(5), D = `uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION) || defined(REFLECTIONMAP_EQUIRECTANGULAR) || defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_SKYBOX)\nuniform mat4 reflectionMatrix;\n#endif\n#ifndef REFLECTIONMAP_SKYBOX\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif`;\n        b.a.IncludesShadersStore.defaultFragmentDeclaration = D;\n        var w = `layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor;\nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec3 vReflectionPosition;\nvec3 vReflectionSize;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix;\nvec2 vTangentSpaceParams;\nfloat pointSize;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nfloat visibility;\nvec4 vDiffuseColor;\nvec4 vDetailInfos;\nmat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};\n`;\n        b.a.IncludesShadersStore.defaultUboDeclaration = w, f(160), f(59), f(106), f(107), f(154), f(130), f(161), f(131), f(108), f(109), f(132), f(133), f(115), f(116), f(125), f(110), f(134), f(162), f(135), f(155), f(136);\n        var N = `#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\n#if SPECULARDIRECTUV == 1\n#define vSpecularUV vMainUV1\n#elif SPECULARDIRECTUV == 2\n#define vSpecularUV vMainUV2\n#else\nvarying vec2 vSpecularUV;\n#endif\nuniform sampler2D specularSampler;\n#endif\n#ifdef ALPHATEST\nuniform float alphaCutOff;\n#endif\n\n#include<fresnelFunction>\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<alphaCutOff)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef DETAIL\nbaseColor.rgb=baseColor.rgb*2.0*mix(0.5,detailColor.r,vDetailInfos.y);\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec4 refractionColor=vec4(0.,0.,0.,1.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0) {\nrefractionColor=textureCube(refractionCubeSampler,refractionVector);\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor.rgb=fromRGBD(refractionColor);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor.rgb=toGammaSpace(refractionColor.rgb);\n#endif\nrefractionColor.rgb*=vRefractionInfos.x;\n#endif\n\nvec4 reflectionColor=vec4(0.,0.,0.,1.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW);\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor.rgb=toGammaSpace(reflectionColor.rgb);\n#endif\nreflectionColor.rgb*=vReflectionInfos.x;\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor.rgb*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor.rgb*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor.rgb*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n#ifdef ALPHATEST\n#ifdef ALPHATEST_AFTERALLALPHACOMPUTATIONS\nif (alpha<alphaCutOff)\ndiscard;\n#endif\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor.rgb;\n#else\ncolor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor.rgb=max(color.rgb,0.);\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\n#endif\ncolor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\ngl_FragData[0]=color;\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef PREPASS_IRRADIANCE\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[PREPASS_DEPTHNORMAL_INDEX]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=specularMapColor;\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=color;\n#endif\n}\n`;\n        b.a.ShadersStore.defaultPixelShader = N;\n        var M = `\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef REFLECTION\nuniform mat4 reflectionMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n`;\n        b.a.IncludesShadersStore.defaultVertexDeclaration = M, f(78), f(79), f(163), f(164), f(117), f(137), f(93), f(94), f(100), f(80), f(81), f(165), f(156), f(111), f(157), f(138), b.a.IncludesShadersStore.pointCloudVertex = `#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif`, f(158);\n        var U = `#include<__decl__defaultVertex>\n\n#define CUSTOM_VERTEX_BEGIN\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nvarying vec2 vSpecularUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\nvPositionW=vec3(worldPos);\n#include<prePassVertex>\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n#include<pointCloudVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n        b.a.ShadersStore.defaultVertexShader = U;\n        var X = f(2), j = f(67), ne = f(92), te = { effect: null, subMesh: null }, de = function(ae) {\n          function ee() {\n            var K = ae.call(this) || this;\n            return K.MAINUV1 = !1, K.MAINUV2 = !1, K.DIFFUSE = !1, K.DIFFUSEDIRECTUV = 0, K.DETAIL = !1, K.DETAILDIRECTUV = 0, K.DETAIL_NORMALBLENDMETHOD = 0, K.AMBIENT = !1, K.AMBIENTDIRECTUV = 0, K.OPACITY = !1, K.OPACITYDIRECTUV = 0, K.OPACITYRGB = !1, K.REFLECTION = !1, K.EMISSIVE = !1, K.EMISSIVEDIRECTUV = 0, K.SPECULAR = !1, K.SPECULARDIRECTUV = 0, K.BUMP = !1, K.BUMPDIRECTUV = 0, K.PARALLAX = !1, K.PARALLAXOCCLUSION = !1, K.SPECULAROVERALPHA = !1, K.CLIPPLANE = !1, K.CLIPPLANE2 = !1, K.CLIPPLANE3 = !1, K.CLIPPLANE4 = !1, K.CLIPPLANE5 = !1, K.CLIPPLANE6 = !1, K.ALPHATEST = !1, K.DEPTHPREPASS = !1, K.ALPHAFROMDIFFUSE = !1, K.POINTSIZE = !1, K.FOG = !1, K.SPECULARTERM = !1, K.DIFFUSEFRESNEL = !1, K.OPACITYFRESNEL = !1, K.REFLECTIONFRESNEL = !1, K.REFRACTIONFRESNEL = !1, K.EMISSIVEFRESNEL = !1, K.FRESNEL = !1, K.NORMAL = !1, K.UV1 = !1, K.UV2 = !1, K.VERTEXCOLOR = !1, K.VERTEXALPHA = !1, K.NUM_BONE_INFLUENCERS = 0, K.BonesPerMesh = 0, K.BONETEXTURE = !1, K.BONES_VELOCITY_ENABLED = !1, K.INSTANCES = !1, K.THIN_INSTANCES = !1, K.GLOSSINESS = !1, K.ROUGHNESS = !1, K.EMISSIVEASILLUMINATION = !1, K.LINKEMISSIVEWITHDIFFUSE = !1, K.REFLECTIONFRESNELFROMSPECULAR = !1, K.LIGHTMAP = !1, K.LIGHTMAPDIRECTUV = 0, K.OBJECTSPACE_NORMALMAP = !1, K.USELIGHTMAPASSHADOWMAP = !1, K.REFLECTIONMAP_3D = !1, K.REFLECTIONMAP_SPHERICAL = !1, K.REFLECTIONMAP_PLANAR = !1, K.REFLECTIONMAP_CUBIC = !1, K.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, K.REFLECTIONMAP_PROJECTION = !1, K.REFLECTIONMAP_SKYBOX = !1, K.REFLECTIONMAP_EXPLICIT = !1, K.REFLECTIONMAP_EQUIRECTANGULAR = !1, K.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, K.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, K.INVERTCUBICMAP = !1, K.LOGARITHMICDEPTH = !1, K.REFRACTION = !1, K.REFRACTIONMAP_3D = !1, K.REFLECTIONOVERALPHA = !1, K.TWOSIDEDLIGHTING = !1, K.SHADOWFLOAT = !1, K.MORPHTARGETS = !1, K.MORPHTARGETS_NORMAL = !1, K.MORPHTARGETS_TANGENT = !1, K.MORPHTARGETS_UV = !1, K.NUM_MORPH_INFLUENCERS = 0, K.NONUNIFORMSCALING = !1, K.PREMULTIPLYALPHA = !1, K.ALPHATEST_AFTERALLALPHACOMPUTATIONS = !1, K.ALPHABLEND = !0, K.PREPASS = !1, K.PREPASS_IRRADIANCE = !1, K.PREPASS_IRRADIANCE_INDEX = -1, K.PREPASS_ALBEDO = !1, K.PREPASS_ALBEDO_INDEX = -1, K.PREPASS_DEPTHNORMAL = !1, K.PREPASS_DEPTHNORMAL_INDEX = -1, K.PREPASS_POSITION = !1, K.PREPASS_POSITION_INDEX = -1, K.PREPASS_VELOCITY = !1, K.PREPASS_VELOCITY_INDEX = -1, K.PREPASS_REFLECTIVITY = !1, K.PREPASS_REFLECTIVITY_INDEX = -1, K.SCENE_MRT_COUNT = 0, K.RGBDLIGHTMAP = !1, K.RGBDREFLECTION = !1, K.RGBDREFRACTION = !1, K.IMAGEPROCESSING = !1, K.VIGNETTE = !1, K.VIGNETTEBLENDMODEMULTIPLY = !1, K.VIGNETTEBLENDMODEOPAQUE = !1, K.TONEMAPPING = !1, K.TONEMAPPING_ACES = !1, K.CONTRAST = !1, K.COLORCURVES = !1, K.COLORGRADING = !1, K.COLORGRADING3D = !1, K.SAMPLER3DGREENDEPTH = !1, K.SAMPLER3DBGRMAP = !1, K.IMAGEPROCESSINGPOSTPROCESS = !1, K.MULTIVIEW = !1, K.IS_REFLECTION_LINEAR = !1, K.IS_REFRACTION_LINEAR = !1, K.EXPOSURE = !1, K.rebuild(), K;\n          }\n          return Object(V.d)(ee, ae), ee.prototype.setReflectionMode = function(K) {\n            for (var $ = 0, L = [\"REFLECTIONMAP_CUBIC\", \"REFLECTIONMAP_EXPLICIT\", \"REFLECTIONMAP_PLANAR\", \"REFLECTIONMAP_PROJECTION\", \"REFLECTIONMAP_PROJECTION\", \"REFLECTIONMAP_SKYBOX\", \"REFLECTIONMAP_SPHERICAL\", \"REFLECTIONMAP_EQUIRECTANGULAR\", \"REFLECTIONMAP_EQUIRECTANGULAR_FIXED\", \"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\"]; $ < L.length; $++) {\n              var G = L[$];\n              this[G] = G === K;\n            }\n          }, ee;\n        }(S.a), pe = function(ae) {\n          function ee(K, $) {\n            var L = ae.call(this, K, $) || this;\n            return L._diffuseTexture = null, L._ambientTexture = null, L._opacityTexture = null, L._reflectionTexture = null, L._emissiveTexture = null, L._specularTexture = null, L._bumpTexture = null, L._lightmapTexture = null, L._refractionTexture = null, L.ambientColor = new O.a(0, 0, 0), L.diffuseColor = new O.a(1, 1, 1), L.specularColor = new O.a(1, 1, 1), L.emissiveColor = new O.a(0, 0, 0), L.specularPower = 64, L._useAlphaFromDiffuseTexture = !1, L._useEmissiveAsIllumination = !1, L._linkEmissiveWithDiffuse = !1, L._useSpecularOverAlpha = !1, L._useReflectionOverAlpha = !1, L._disableLighting = !1, L._useObjectSpaceNormalMap = !1, L._useParallax = !1, L._useParallaxOcclusion = !1, L.parallaxScaleBias = 0.05, L._roughness = 0, L.indexOfRefraction = 0.98, L.invertRefractionY = !0, L.alphaCutOff = 0.4, L._useLightmapAsShadowmap = !1, L._useReflectionFresnelFromSpecular = !1, L._useGlossinessFromSpecularMapAlpha = !1, L._maxSimultaneousLights = 4, L._invertNormalMapX = !1, L._invertNormalMapY = !1, L._twoSidedLighting = !1, L.detailMap = new ne.a(L._markAllSubMeshesAsTexturesDirty.bind(L)), L._renderTargets = new C.a(16), L._worldViewProjectionMatrix = I.a.Zero(), L._globalAmbientColor = new O.a(0, 0, 0), L._rebuildInParallel = !1, L._attachImageProcessingConfiguration(null), L.prePassConfiguration = new m.a(), L.getRenderTargetTextures = function() {\n              return L._renderTargets.reset(), ee.ReflectionTextureEnabled && L._reflectionTexture && L._reflectionTexture.isRenderTarget && L._renderTargets.push(L._reflectionTexture), ee.RefractionTextureEnabled && L._refractionTexture && L._refractionTexture.isRenderTarget && L._renderTargets.push(L._refractionTexture), L._renderTargets;\n            }, L;\n          }\n          return Object(V.d)(ee, ae), Object.defineProperty(ee.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(K) {\n            this._attachImageProcessingConfiguration(K), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), ee.prototype._attachImageProcessingConfiguration = function(K) {\n            var $ = this;\n            K !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = K || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              $._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, Object.defineProperty(ee.prototype, \"cameraColorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(K) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraColorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(K) {\n            this.imageProcessingConfiguration.colorGradingEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraToneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.toneMappingEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraExposure\", { get: function() {\n            return this._imageProcessingConfiguration.exposure;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.exposure = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraContrast\", { get: function() {\n            return this._imageProcessingConfiguration.contrast;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.contrast = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraColorGradingTexture\", { get: function() {\n            return this._imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.colorGradingTexture = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"cameraColorCurves\", { get: function() {\n            return this._imageProcessingConfiguration.colorCurves;\n          }, set: function(K) {\n            this._imageProcessingConfiguration.colorCurves = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"canRenderToMRT\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !!(ee.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || !!(ee.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget);\n          }, enumerable: !1, configurable: !0 }), ee.prototype.getClassName = function() {\n            return \"StandardMaterial\";\n          }, Object.defineProperty(ee.prototype, \"useLogarithmicDepth\", { get: function() {\n            return this._useLogarithmicDepth;\n          }, set: function(K) {\n            this._useLogarithmicDepth = K && this.getScene().getEngine().getCaps().fragmentDepthSupported, this._markAllSubMeshesAsMiscDirty();\n          }, enumerable: !1, configurable: !0 }), ee.prototype.needAlphaBlending = function() {\n            return !this._disableAlphaBlending && (this.alpha < 1 || this._opacityTexture != null || this._shouldUseAlphaFromDiffuseTexture() || this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled);\n          }, ee.prototype.needAlphaTesting = function() {\n            return !!this._forceAlphaTest || this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === T.a.MATERIAL_ALPHATEST);\n          }, ee.prototype._shouldUseAlphaFromDiffuseTexture = function() {\n            return this._diffuseTexture != null && this._diffuseTexture.hasAlpha && this._useAlphaFromDiffuseTexture && this._transparencyMode !== T.a.MATERIAL_OPAQUE;\n          }, ee.prototype._hasAlphaChannel = function() {\n            return this._diffuseTexture != null && this._diffuseTexture.hasAlpha || this._opacityTexture != null;\n          }, ee.prototype.getAlphaTestTexture = function() {\n            return this._diffuseTexture;\n          }, ee.prototype.isReadyForSubMesh = function(K, $, L) {\n            if (L === void 0 && (L = !1), $.effect && this.isFrozen && $.effect._wasPreviouslyReady)\n              return !0;\n            $._materialDefines || ($._materialDefines = new de());\n            var G = this.getScene(), Q = $._materialDefines;\n            if (this._isReadyForSubMesh($))\n              return !0;\n            var oe = G.getEngine();\n            if (Q._needNormals = g.a.PrepareDefinesForLights(G, K, Q, !0, this._maxSimultaneousLights, this._disableLighting), g.a.PrepareDefinesForMultiview(G, Q), g.a.PrepareDefinesForPrePass(G, Q, this.canRenderToMRT), Q._areTexturesDirty) {\n              if (Q._needUVs = !1, Q.MAINUV1 = !1, Q.MAINUV2 = !1, G.texturesEnabled) {\n                if (this._diffuseTexture && ee.DiffuseTextureEnabled) {\n                  if (!this._diffuseTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._diffuseTexture, Q, \"DIFFUSE\");\n                } else\n                  Q.DIFFUSE = !1;\n                if (this._ambientTexture && ee.AmbientTextureEnabled) {\n                  if (!this._ambientTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._ambientTexture, Q, \"AMBIENT\");\n                } else\n                  Q.AMBIENT = !1;\n                if (this._opacityTexture && ee.OpacityTextureEnabled) {\n                  if (!this._opacityTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._opacityTexture, Q, \"OPACITY\"), Q.OPACITYRGB = this._opacityTexture.getAlphaFromRGB;\n                } else\n                  Q.OPACITY = !1;\n                if (this._reflectionTexture && ee.ReflectionTextureEnabled) {\n                  if (!this._reflectionTexture.isReadyOrNotBlocking())\n                    return !1;\n                  switch (Q._needNormals = !0, Q.REFLECTION = !0, Q.ROUGHNESS = this._roughness > 0, Q.REFLECTIONOVERALPHA = this._useReflectionOverAlpha, Q.INVERTCUBICMAP = this._reflectionTexture.coordinatesMode === l.a.INVCUBIC_MODE, Q.REFLECTIONMAP_3D = this._reflectionTexture.isCube, Q.RGBDREFLECTION = this._reflectionTexture.isRGBD, this._reflectionTexture.coordinatesMode) {\n                    case l.a.EXPLICIT_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_EXPLICIT\");\n                      break;\n                    case l.a.PLANAR_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_PLANAR\");\n                      break;\n                    case l.a.PROJECTION_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_PROJECTION\");\n                      break;\n                    case l.a.SKYBOX_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_SKYBOX\");\n                      break;\n                    case l.a.SPHERICAL_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_SPHERICAL\");\n                      break;\n                    case l.a.EQUIRECTANGULAR_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_EQUIRECTANGULAR\");\n                      break;\n                    case l.a.FIXED_EQUIRECTANGULAR_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_EQUIRECTANGULAR_FIXED\");\n                      break;\n                    case l.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:\n                      Q.setReflectionMode(\"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\");\n                      break;\n                    case l.a.CUBIC_MODE:\n                    case l.a.INVCUBIC_MODE:\n                    default:\n                      Q.setReflectionMode(\"REFLECTIONMAP_CUBIC\");\n                  }\n                  Q.USE_LOCAL_REFLECTIONMAP_CUBIC = !!this._reflectionTexture.boundingBoxSize;\n                } else\n                  Q.REFLECTION = !1;\n                if (this._emissiveTexture && ee.EmissiveTextureEnabled) {\n                  if (!this._emissiveTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._emissiveTexture, Q, \"EMISSIVE\");\n                } else\n                  Q.EMISSIVE = !1;\n                if (this._lightmapTexture && ee.LightmapTextureEnabled) {\n                  if (!this._lightmapTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._lightmapTexture, Q, \"LIGHTMAP\"), Q.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, Q.RGBDLIGHTMAP = this._lightmapTexture.isRGBD;\n                } else\n                  Q.LIGHTMAP = !1;\n                if (this._specularTexture && ee.SpecularTextureEnabled) {\n                  if (!this._specularTexture.isReadyOrNotBlocking())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._specularTexture, Q, \"SPECULAR\"), Q.GLOSSINESS = this._useGlossinessFromSpecularMapAlpha;\n                } else\n                  Q.SPECULAR = !1;\n                if (G.getEngine().getCaps().standardDerivatives && this._bumpTexture && ee.BumpTextureEnabled) {\n                  if (!this._bumpTexture.isReady())\n                    return !1;\n                  g.a.PrepareDefinesForMergedUV(this._bumpTexture, Q, \"BUMP\"), Q.PARALLAX = this._useParallax, Q.PARALLAXOCCLUSION = this._useParallaxOcclusion, Q.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;\n                } else\n                  Q.BUMP = !1;\n                if (this._refractionTexture && ee.RefractionTextureEnabled) {\n                  if (!this._refractionTexture.isReadyOrNotBlocking())\n                    return !1;\n                  Q._needUVs = !0, Q.REFRACTION = !0, Q.REFRACTIONMAP_3D = this._refractionTexture.isCube, Q.RGBDREFRACTION = this._refractionTexture.isRGBD;\n                } else\n                  Q.REFRACTION = !1;\n                Q.TWOSIDEDLIGHTING = !this._backFaceCulling && this._twoSidedLighting;\n              } else\n                Q.DIFFUSE = !1, Q.AMBIENT = !1, Q.OPACITY = !1, Q.REFLECTION = !1, Q.EMISSIVE = !1, Q.LIGHTMAP = !1, Q.BUMP = !1, Q.REFRACTION = !1;\n              Q.ALPHAFROMDIFFUSE = this._shouldUseAlphaFromDiffuseTexture(), Q.EMISSIVEASILLUMINATION = this._useEmissiveAsIllumination, Q.LINKEMISSIVEWITHDIFFUSE = this._linkEmissiveWithDiffuse, Q.SPECULAROVERALPHA = this._useSpecularOverAlpha, Q.PREMULTIPLYALPHA = this.alphaMode === X.a.ALPHA_PREMULTIPLIED || this.alphaMode === X.a.ALPHA_PREMULTIPLIED_PORTERDUFF, Q.ALPHATEST_AFTERALLALPHACOMPUTATIONS = this.transparencyMode !== null, Q.ALPHABLEND = this.transparencyMode === null || this.needAlphaBlendingForMesh(K);\n            }\n            if (!this.detailMap.isReadyForSubMesh(Q, G))\n              return !1;\n            if (Q._areImageProcessingDirty && this._imageProcessingConfiguration) {\n              if (!this._imageProcessingConfiguration.isReady())\n                return !1;\n              this._imageProcessingConfiguration.prepareDefines(Q), Q.IS_REFLECTION_LINEAR = this.reflectionTexture != null && !this.reflectionTexture.gammaSpace, Q.IS_REFRACTION_LINEAR = this.refractionTexture != null && !this.refractionTexture.gammaSpace;\n            }\n            if (Q._areFresnelDirty && (ee.FresnelEnabled ? (this._diffuseFresnelParameters || this._opacityFresnelParameters || this._emissiveFresnelParameters || this._refractionFresnelParameters || this._reflectionFresnelParameters) && (Q.DIFFUSEFRESNEL = this._diffuseFresnelParameters && this._diffuseFresnelParameters.isEnabled, Q.OPACITYFRESNEL = this._opacityFresnelParameters && this._opacityFresnelParameters.isEnabled, Q.REFLECTIONFRESNEL = this._reflectionFresnelParameters && this._reflectionFresnelParameters.isEnabled, Q.REFLECTIONFRESNELFROMSPECULAR = this._useReflectionFresnelFromSpecular, Q.REFRACTIONFRESNEL = this._refractionFresnelParameters && this._refractionFresnelParameters.isEnabled, Q.EMISSIVEFRESNEL = this._emissiveFresnelParameters && this._emissiveFresnelParameters.isEnabled, Q._needNormals = !0, Q.FRESNEL = !0) : Q.FRESNEL = !1), g.a.PrepareDefinesForMisc(K, G, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(K) || this._forceAlphaTest, Q), g.a.PrepareDefinesForAttributes(K, Q, !0, !0, !0), g.a.PrepareDefinesForFrameBoundValues(G, oe, Q, L, null, $.getRenderingMesh().hasThinInstances), this.detailMap.prepareDefines(Q, G), Q.isDirty) {\n              var re = Q._areLightsDisposed;\n              Q.markAsProcessed();\n              var Y = new j.a();\n              Q.REFLECTION && Y.addFallback(0, \"REFLECTION\"), Q.SPECULAR && Y.addFallback(0, \"SPECULAR\"), Q.BUMP && Y.addFallback(0, \"BUMP\"), Q.PARALLAX && Y.addFallback(1, \"PARALLAX\"), Q.PARALLAXOCCLUSION && Y.addFallback(0, \"PARALLAXOCCLUSION\"), Q.SPECULAROVERALPHA && Y.addFallback(0, \"SPECULAROVERALPHA\"), Q.FOG && Y.addFallback(1, \"FOG\"), Q.POINTSIZE && Y.addFallback(0, \"POINTSIZE\"), Q.LOGARITHMICDEPTH && Y.addFallback(0, \"LOGARITHMICDEPTH\"), g.a.HandleFallbacksForShadows(Q, Y, this._maxSimultaneousLights), Q.SPECULARTERM && Y.addFallback(0, \"SPECULARTERM\"), Q.DIFFUSEFRESNEL && Y.addFallback(1, \"DIFFUSEFRESNEL\"), Q.OPACITYFRESNEL && Y.addFallback(2, \"OPACITYFRESNEL\"), Q.REFLECTIONFRESNEL && Y.addFallback(3, \"REFLECTIONFRESNEL\"), Q.EMISSIVEFRESNEL && Y.addFallback(4, \"EMISSIVEFRESNEL\"), Q.FRESNEL && Y.addFallback(4, \"FRESNEL\"), Q.MULTIVIEW && Y.addFallback(0, \"MULTIVIEW\");\n              var k = [x.b.PositionKind];\n              Q.NORMAL && k.push(x.b.NormalKind), Q.UV1 && k.push(x.b.UVKind), Q.UV2 && k.push(x.b.UV2Kind), Q.VERTEXCOLOR && k.push(x.b.ColorKind), g.a.PrepareAttributesForBones(k, K, Q, Y), g.a.PrepareAttributesForInstances(k, Q), g.a.PrepareAttributesForMorphTargets(k, K, Q);\n              var H = \"default\", Z = [\"world\", \"view\", \"viewProjection\", \"vEyePosition\", \"vLightsType\", \"vAmbientColor\", \"vDiffuseColor\", \"vSpecularColor\", \"vEmissiveColor\", \"visibility\", \"vFogInfos\", \"vFogColor\", \"pointSize\", \"vDiffuseInfos\", \"vAmbientInfos\", \"vOpacityInfos\", \"vReflectionInfos\", \"vEmissiveInfos\", \"vSpecularInfos\", \"vBumpInfos\", \"vLightmapInfos\", \"vRefractionInfos\", \"mBones\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"diffuseMatrix\", \"ambientMatrix\", \"opacityMatrix\", \"reflectionMatrix\", \"emissiveMatrix\", \"specularMatrix\", \"bumpMatrix\", \"normalMatrix\", \"lightmapMatrix\", \"refractionMatrix\", \"diffuseLeftColor\", \"diffuseRightColor\", \"opacityParts\", \"reflectionLeftColor\", \"reflectionRightColor\", \"emissiveLeftColor\", \"emissiveRightColor\", \"refractionLeftColor\", \"refractionRightColor\", \"vReflectionPosition\", \"vReflectionSize\", \"logarithmicDepthConstant\", \"vTangentSpaceParams\", \"alphaCutOff\", \"boneTextureWidth\"], W = [\"diffuseSampler\", \"ambientSampler\", \"opacitySampler\", \"reflectionCubeSampler\", \"reflection2DSampler\", \"emissiveSampler\", \"specularSampler\", \"bumpSampler\", \"lightmapSampler\", \"refractionCubeSampler\", \"refraction2DSampler\", \"boneSampler\"], q = [\"Material\", \"Scene\"];\n              ne.a.AddUniforms(Z), ne.a.AddSamplers(W), m.a.AddUniforms(Z), m.a.AddSamplers(Z), c.a && (c.a.PrepareUniforms(Z, Q), c.a.PrepareSamplers(W, Q)), g.a.PrepareUniformsAndSamplersList({ uniformsNames: Z, uniformBuffersNames: q, samplers: W, defines: Q, maxSimultaneousLights: this._maxSimultaneousLights });\n              var he = {};\n              this.customShaderNameResolve && (H = this.customShaderNameResolve(H, Z, q, W, Q, k, he));\n              var ge = Q.toString(), me = $.effect, _e = G.getEngine().createEffect(H, { attributes: k, uniformsNames: Z, uniformBuffersNames: q, samplers: W, defines: ge, fallbacks: Y, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: Q.NUM_MORPH_INFLUENCERS }, processFinalCode: he.processFinalCode, multiTarget: Q.PREPASS }, oe);\n              if (_e)\n                if (this._onEffectCreatedObservable && (te.effect = _e, te.subMesh = $, this._onEffectCreatedObservable.notifyObservers(te)), this.allowShaderHotSwapping && me && !_e.isReady()) {\n                  if (_e = me, this._rebuildInParallel = !0, Q.markAsUnprocessed(), re)\n                    return Q._areLightsDisposed = !0, !1;\n                } else\n                  this._rebuildInParallel = !1, G.resetCachedMaterial(), $.setEffect(_e, Q), this.buildUniformLayout();\n            }\n            return !(!$.effect || !$.effect.isReady()) && (Q._renderId = G.getRenderId(), $.effect._wasPreviouslyReady = !0, !0);\n          }, ee.prototype.buildUniformLayout = function() {\n            var K = this._uniformBuffer;\n            K.addUniform(\"diffuseLeftColor\", 4), K.addUniform(\"diffuseRightColor\", 4), K.addUniform(\"opacityParts\", 4), K.addUniform(\"reflectionLeftColor\", 4), K.addUniform(\"reflectionRightColor\", 4), K.addUniform(\"refractionLeftColor\", 4), K.addUniform(\"refractionRightColor\", 4), K.addUniform(\"emissiveLeftColor\", 4), K.addUniform(\"emissiveRightColor\", 4), K.addUniform(\"vDiffuseInfos\", 2), K.addUniform(\"vAmbientInfos\", 2), K.addUniform(\"vOpacityInfos\", 2), K.addUniform(\"vReflectionInfos\", 2), K.addUniform(\"vReflectionPosition\", 3), K.addUniform(\"vReflectionSize\", 3), K.addUniform(\"vEmissiveInfos\", 2), K.addUniform(\"vLightmapInfos\", 2), K.addUniform(\"vSpecularInfos\", 2), K.addUniform(\"vBumpInfos\", 3), K.addUniform(\"diffuseMatrix\", 16), K.addUniform(\"ambientMatrix\", 16), K.addUniform(\"opacityMatrix\", 16), K.addUniform(\"reflectionMatrix\", 16), K.addUniform(\"emissiveMatrix\", 16), K.addUniform(\"lightmapMatrix\", 16), K.addUniform(\"specularMatrix\", 16), K.addUniform(\"bumpMatrix\", 16), K.addUniform(\"vTangentSpaceParams\", 2), K.addUniform(\"pointSize\", 1), K.addUniform(\"refractionMatrix\", 16), K.addUniform(\"vRefractionInfos\", 4), K.addUniform(\"vSpecularColor\", 4), K.addUniform(\"vEmissiveColor\", 3), K.addUniform(\"visibility\", 1), K.addUniform(\"vDiffuseColor\", 4), ne.a.PrepareUniformBuffer(K), K.create();\n          }, ee.prototype.unbind = function() {\n            if (this._activeEffect) {\n              var K = !1;\n              this._reflectionTexture && this._reflectionTexture.isRenderTarget && (this._activeEffect.setTexture(\"reflection2DSampler\", null), K = !0), this._refractionTexture && this._refractionTexture.isRenderTarget && (this._activeEffect.setTexture(\"refraction2DSampler\", null), K = !0), K && this._markAllSubMeshesAsTexturesDirty();\n            }\n            ae.prototype.unbind.call(this);\n          }, ee.prototype.bindForSubMesh = function(K, $, L) {\n            var G = this.getScene(), Q = L._materialDefines;\n            if (Q) {\n              var oe = L.effect;\n              if (oe) {\n                this._activeEffect = oe, Q.INSTANCES && !Q.THIN_INSTANCES || this.bindOnlyWorldMatrix(K), this.prePassConfiguration.bindForSubMesh(this._activeEffect, G, $, K, this.isFrozen), Q.OBJECTSPACE_NORMALMAP && (K.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));\n                var re = this._mustRebind(G, oe, $.visibility);\n                g.a.BindBonesParameters($, oe);\n                var Y = this._uniformBuffer;\n                if (re) {\n                  if (Y.bindToEffect(oe, \"Material\"), this.bindViewProjection(oe), !Y.useUbo || !this.isFrozen || !Y.isSync) {\n                    if (ee.FresnelEnabled && Q.FRESNEL && (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled && (Y.updateColor4(\"diffuseLeftColor\", this.diffuseFresnelParameters.leftColor, this.diffuseFresnelParameters.power), Y.updateColor4(\"diffuseRightColor\", this.diffuseFresnelParameters.rightColor, this.diffuseFresnelParameters.bias)), this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled && Y.updateColor4(\"opacityParts\", new O.a(this.opacityFresnelParameters.leftColor.toLuminance(), this.opacityFresnelParameters.rightColor.toLuminance(), this.opacityFresnelParameters.bias), this.opacityFresnelParameters.power), this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled && (Y.updateColor4(\"reflectionLeftColor\", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power), Y.updateColor4(\"reflectionRightColor\", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias)), this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled && (Y.updateColor4(\"refractionLeftColor\", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power), Y.updateColor4(\"refractionRightColor\", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias)), this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled && (Y.updateColor4(\"emissiveLeftColor\", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power), Y.updateColor4(\"emissiveRightColor\", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias))), G.texturesEnabled) {\n                      if (this._diffuseTexture && ee.DiffuseTextureEnabled && (Y.updateFloat2(\"vDiffuseInfos\", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), g.a.BindTextureMatrix(this._diffuseTexture, Y, \"diffuse\")), this._ambientTexture && ee.AmbientTextureEnabled && (Y.updateFloat2(\"vAmbientInfos\", this._ambientTexture.coordinatesIndex, this._ambientTexture.level), g.a.BindTextureMatrix(this._ambientTexture, Y, \"ambient\")), this._opacityTexture && ee.OpacityTextureEnabled && (Y.updateFloat2(\"vOpacityInfos\", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), g.a.BindTextureMatrix(this._opacityTexture, Y, \"opacity\")), this._hasAlphaChannel() && oe.setFloat(\"alphaCutOff\", this.alphaCutOff), this._reflectionTexture && ee.ReflectionTextureEnabled && (Y.updateFloat2(\"vReflectionInfos\", this._reflectionTexture.level, this.roughness), Y.updateMatrix(\"reflectionMatrix\", this._reflectionTexture.getReflectionTextureMatrix()), this._reflectionTexture.boundingBoxSize)) {\n                        var k = this._reflectionTexture;\n                        Y.updateVector3(\"vReflectionPosition\", k.boundingBoxPosition), Y.updateVector3(\"vReflectionSize\", k.boundingBoxSize);\n                      }\n                      if (this._emissiveTexture && ee.EmissiveTextureEnabled && (Y.updateFloat2(\"vEmissiveInfos\", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), g.a.BindTextureMatrix(this._emissiveTexture, Y, \"emissive\")), this._lightmapTexture && ee.LightmapTextureEnabled && (Y.updateFloat2(\"vLightmapInfos\", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), g.a.BindTextureMatrix(this._lightmapTexture, Y, \"lightmap\")), this._specularTexture && ee.SpecularTextureEnabled && (Y.updateFloat2(\"vSpecularInfos\", this._specularTexture.coordinatesIndex, this._specularTexture.level), g.a.BindTextureMatrix(this._specularTexture, Y, \"specular\")), this._bumpTexture && G.getEngine().getCaps().standardDerivatives && ee.BumpTextureEnabled && (Y.updateFloat3(\"vBumpInfos\", this._bumpTexture.coordinatesIndex, 1 / this._bumpTexture.level, this.parallaxScaleBias), g.a.BindTextureMatrix(this._bumpTexture, Y, \"bump\"), G._mirroredCameraPosition ? Y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : Y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1)), this._refractionTexture && ee.RefractionTextureEnabled) {\n                        var H = 1;\n                        this._refractionTexture.isCube || (Y.updateMatrix(\"refractionMatrix\", this._refractionTexture.getReflectionTextureMatrix()), this._refractionTexture.depth && (H = this._refractionTexture.depth)), Y.updateFloat4(\"vRefractionInfos\", this._refractionTexture.level, this.indexOfRefraction, H, this.invertRefractionY ? -1 : 1);\n                      }\n                    }\n                    this.pointsCloud && Y.updateFloat(\"pointSize\", this.pointSize), Q.SPECULARTERM && Y.updateColor4(\"vSpecularColor\", this.specularColor, this.specularPower), Y.updateColor3(\"vEmissiveColor\", ee.EmissiveTextureEnabled ? this.emissiveColor : O.a.BlackReadOnly), Y.updateColor4(\"vDiffuseColor\", this.diffuseColor, this.alpha);\n                  }\n                  Y.updateFloat(\"visibility\", $.visibility), G.texturesEnabled && (this._diffuseTexture && ee.DiffuseTextureEnabled && oe.setTexture(\"diffuseSampler\", this._diffuseTexture), this._ambientTexture && ee.AmbientTextureEnabled && oe.setTexture(\"ambientSampler\", this._ambientTexture), this._opacityTexture && ee.OpacityTextureEnabled && oe.setTexture(\"opacitySampler\", this._opacityTexture), this._reflectionTexture && ee.ReflectionTextureEnabled && (this._reflectionTexture.isCube ? oe.setTexture(\"reflectionCubeSampler\", this._reflectionTexture) : oe.setTexture(\"reflection2DSampler\", this._reflectionTexture)), this._emissiveTexture && ee.EmissiveTextureEnabled && oe.setTexture(\"emissiveSampler\", this._emissiveTexture), this._lightmapTexture && ee.LightmapTextureEnabled && oe.setTexture(\"lightmapSampler\", this._lightmapTexture), this._specularTexture && ee.SpecularTextureEnabled && oe.setTexture(\"specularSampler\", this._specularTexture), this._bumpTexture && G.getEngine().getCaps().standardDerivatives && ee.BumpTextureEnabled && oe.setTexture(\"bumpSampler\", this._bumpTexture), this._refractionTexture && ee.RefractionTextureEnabled) && (H = 1, this._refractionTexture.isCube ? oe.setTexture(\"refractionCubeSampler\", this._refractionTexture) : oe.setTexture(\"refraction2DSampler\", this._refractionTexture)), this.detailMap.bindForSubMesh(Y, G, this.isFrozen), g.a.BindClipPlane(oe, G), G.ambientColor.multiplyToRef(this.ambientColor, this._globalAmbientColor), g.a.BindEyePosition(oe, G), oe.setColor3(\"vAmbientColor\", this._globalAmbientColor);\n                }\n                !re && this.isFrozen || (G.lightsEnabled && !this._disableLighting && g.a.BindLights(G, $, oe, Q, this._maxSimultaneousLights, this._rebuildInParallel), (G.fogEnabled && $.applyFog && G.fogMode !== u.a.FOGMODE_NONE || this._reflectionTexture || this._refractionTexture) && this.bindView(oe), g.a.BindFogParameters(G, $, oe), Q.NUM_MORPH_INFLUENCERS && g.a.BindMorphTargetParameters($, oe), this.useLogarithmicDepth && g.a.BindLogDepth(Q, oe, G), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(this._activeEffect)), Y.update(), this._afterBind($, this._activeEffect);\n              }\n            }\n          }, ee.prototype.getAnimatables = function() {\n            var K = [];\n            return this._diffuseTexture && this._diffuseTexture.animations && this._diffuseTexture.animations.length > 0 && K.push(this._diffuseTexture), this._ambientTexture && this._ambientTexture.animations && this._ambientTexture.animations.length > 0 && K.push(this._ambientTexture), this._opacityTexture && this._opacityTexture.animations && this._opacityTexture.animations.length > 0 && K.push(this._opacityTexture), this._reflectionTexture && this._reflectionTexture.animations && this._reflectionTexture.animations.length > 0 && K.push(this._reflectionTexture), this._emissiveTexture && this._emissiveTexture.animations && this._emissiveTexture.animations.length > 0 && K.push(this._emissiveTexture), this._specularTexture && this._specularTexture.animations && this._specularTexture.animations.length > 0 && K.push(this._specularTexture), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && K.push(this._bumpTexture), this._lightmapTexture && this._lightmapTexture.animations && this._lightmapTexture.animations.length > 0 && K.push(this._lightmapTexture), this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0 && K.push(this._refractionTexture), this.detailMap.getAnimatables(K), K;\n          }, ee.prototype.getActiveTextures = function() {\n            var K = ae.prototype.getActiveTextures.call(this);\n            return this._diffuseTexture && K.push(this._diffuseTexture), this._ambientTexture && K.push(this._ambientTexture), this._opacityTexture && K.push(this._opacityTexture), this._reflectionTexture && K.push(this._reflectionTexture), this._emissiveTexture && K.push(this._emissiveTexture), this._specularTexture && K.push(this._specularTexture), this._bumpTexture && K.push(this._bumpTexture), this._lightmapTexture && K.push(this._lightmapTexture), this._refractionTexture && K.push(this._refractionTexture), this.detailMap.getActiveTextures(K), K;\n          }, ee.prototype.hasTexture = function(K) {\n            return !!ae.prototype.hasTexture.call(this, K) || this._diffuseTexture === K || this._ambientTexture === K || this._opacityTexture === K || this._reflectionTexture === K || this._emissiveTexture === K || this._specularTexture === K || this._bumpTexture === K || this._lightmapTexture === K || this._refractionTexture === K || this.detailMap.hasTexture(K);\n          }, ee.prototype.dispose = function(K, $) {\n            var L, G, Q, oe, re, Y, k, H, Z;\n            $ && ((L = this._diffuseTexture) === null || L === void 0 || L.dispose(), (G = this._ambientTexture) === null || G === void 0 || G.dispose(), (Q = this._opacityTexture) === null || Q === void 0 || Q.dispose(), (oe = this._reflectionTexture) === null || oe === void 0 || oe.dispose(), (re = this._emissiveTexture) === null || re === void 0 || re.dispose(), (Y = this._specularTexture) === null || Y === void 0 || Y.dispose(), (k = this._bumpTexture) === null || k === void 0 || k.dispose(), (H = this._lightmapTexture) === null || H === void 0 || H.dispose(), (Z = this._refractionTexture) === null || Z === void 0 || Z.dispose()), this.detailMap.dispose($), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), ae.prototype.dispose.call(this, K, $);\n          }, ee.prototype.clone = function(K) {\n            var $ = this, L = _.a.Clone(function() {\n              return new ee(K, $.getScene());\n            }, this);\n            return L.name = K, L.id = K, L;\n          }, ee.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, ee.Parse = function(K, $, L) {\n            return _.a.Parse(function() {\n              return new ee(K.name, $);\n            }, K, $, L);\n          }, Object.defineProperty(ee, \"DiffuseTextureEnabled\", { get: function() {\n            return v.a.DiffuseTextureEnabled;\n          }, set: function(K) {\n            v.a.DiffuseTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"DetailTextureEnabled\", { get: function() {\n            return v.a.DetailTextureEnabled;\n          }, set: function(K) {\n            v.a.DetailTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"AmbientTextureEnabled\", { get: function() {\n            return v.a.AmbientTextureEnabled;\n          }, set: function(K) {\n            v.a.AmbientTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"OpacityTextureEnabled\", { get: function() {\n            return v.a.OpacityTextureEnabled;\n          }, set: function(K) {\n            v.a.OpacityTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"ReflectionTextureEnabled\", { get: function() {\n            return v.a.ReflectionTextureEnabled;\n          }, set: function(K) {\n            v.a.ReflectionTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"EmissiveTextureEnabled\", { get: function() {\n            return v.a.EmissiveTextureEnabled;\n          }, set: function(K) {\n            v.a.EmissiveTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"SpecularTextureEnabled\", { get: function() {\n            return v.a.SpecularTextureEnabled;\n          }, set: function(K) {\n            v.a.SpecularTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"BumpTextureEnabled\", { get: function() {\n            return v.a.BumpTextureEnabled;\n          }, set: function(K) {\n            v.a.BumpTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"LightmapTextureEnabled\", { get: function() {\n            return v.a.LightmapTextureEnabled;\n          }, set: function(K) {\n            v.a.LightmapTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"RefractionTextureEnabled\", { get: function() {\n            return v.a.RefractionTextureEnabled;\n          }, set: function(K) {\n            v.a.RefractionTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"ColorGradingTextureEnabled\", { get: function() {\n            return v.a.ColorGradingTextureEnabled;\n          }, set: function(K) {\n            v.a.ColorGradingTextureEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(ee, \"FresnelEnabled\", { get: function() {\n            return v.a.FresnelEnabled;\n          }, set: function(K) {\n            v.a.FresnelEnabled = K;\n          }, enumerable: !1, configurable: !0 }), Object(V.c)([Object(_.m)(\"diffuseTexture\")], ee.prototype, \"_diffuseTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], ee.prototype, \"diffuseTexture\", void 0), Object(V.c)([Object(_.m)(\"ambientTexture\")], ee.prototype, \"_ambientTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"ambientTexture\", void 0), Object(V.c)([Object(_.m)(\"opacityTexture\")], ee.prototype, \"_opacityTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], ee.prototype, \"opacityTexture\", void 0), Object(V.c)([Object(_.m)(\"reflectionTexture\")], ee.prototype, \"_reflectionTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"reflectionTexture\", void 0), Object(V.c)([Object(_.m)(\"emissiveTexture\")], ee.prototype, \"_emissiveTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"emissiveTexture\", void 0), Object(V.c)([Object(_.m)(\"specularTexture\")], ee.prototype, \"_specularTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"specularTexture\", void 0), Object(V.c)([Object(_.m)(\"bumpTexture\")], ee.prototype, \"_bumpTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"bumpTexture\", void 0), Object(V.c)([Object(_.m)(\"lightmapTexture\")], ee.prototype, \"_lightmapTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"lightmapTexture\", void 0), Object(V.c)([Object(_.m)(\"refractionTexture\")], ee.prototype, \"_refractionTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"refractionTexture\", void 0), Object(V.c)([Object(_.e)(\"ambient\")], ee.prototype, \"ambientColor\", void 0), Object(V.c)([Object(_.e)(\"diffuse\")], ee.prototype, \"diffuseColor\", void 0), Object(V.c)([Object(_.e)(\"specular\")], ee.prototype, \"specularColor\", void 0), Object(V.c)([Object(_.e)(\"emissive\")], ee.prototype, \"emissiveColor\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"specularPower\", void 0), Object(V.c)([Object(_.c)(\"useAlphaFromDiffuseTexture\")], ee.prototype, \"_useAlphaFromDiffuseTexture\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], ee.prototype, \"useAlphaFromDiffuseTexture\", void 0), Object(V.c)([Object(_.c)(\"useEmissiveAsIllumination\")], ee.prototype, \"_useEmissiveAsIllumination\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useEmissiveAsIllumination\", void 0), Object(V.c)([Object(_.c)(\"linkEmissiveWithDiffuse\")], ee.prototype, \"_linkEmissiveWithDiffuse\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"linkEmissiveWithDiffuse\", void 0), Object(V.c)([Object(_.c)(\"useSpecularOverAlpha\")], ee.prototype, \"_useSpecularOverAlpha\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useSpecularOverAlpha\", void 0), Object(V.c)([Object(_.c)(\"useReflectionOverAlpha\")], ee.prototype, \"_useReflectionOverAlpha\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useReflectionOverAlpha\", void 0), Object(V.c)([Object(_.c)(\"disableLighting\")], ee.prototype, \"_disableLighting\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsLightsDirty\")], ee.prototype, \"disableLighting\", void 0), Object(V.c)([Object(_.c)(\"useObjectSpaceNormalMap\")], ee.prototype, \"_useObjectSpaceNormalMap\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useObjectSpaceNormalMap\", void 0), Object(V.c)([Object(_.c)(\"useParallax\")], ee.prototype, \"_useParallax\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useParallax\", void 0), Object(V.c)([Object(_.c)(\"useParallaxOcclusion\")], ee.prototype, \"_useParallaxOcclusion\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useParallaxOcclusion\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"parallaxScaleBias\", void 0), Object(V.c)([Object(_.c)(\"roughness\")], ee.prototype, \"_roughness\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"roughness\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"indexOfRefraction\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"invertRefractionY\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"alphaCutOff\", void 0), Object(V.c)([Object(_.c)(\"useLightmapAsShadowmap\")], ee.prototype, \"_useLightmapAsShadowmap\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useLightmapAsShadowmap\", void 0), Object(V.c)([Object(_.h)(\"diffuseFresnelParameters\")], ee.prototype, \"_diffuseFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"diffuseFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"opacityFresnelParameters\")], ee.prototype, \"_opacityFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelAndMiscDirty\")], ee.prototype, \"opacityFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"reflectionFresnelParameters\")], ee.prototype, \"_reflectionFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"reflectionFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"refractionFresnelParameters\")], ee.prototype, \"_refractionFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"refractionFresnelParameters\", void 0), Object(V.c)([Object(_.h)(\"emissiveFresnelParameters\")], ee.prototype, \"_emissiveFresnelParameters\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"emissiveFresnelParameters\", void 0), Object(V.c)([Object(_.c)(\"useReflectionFresnelFromSpecular\")], ee.prototype, \"_useReflectionFresnelFromSpecular\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsFresnelDirty\")], ee.prototype, \"useReflectionFresnelFromSpecular\", void 0), Object(V.c)([Object(_.c)(\"useGlossinessFromSpecularMapAlpha\")], ee.prototype, \"_useGlossinessFromSpecularMapAlpha\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"useGlossinessFromSpecularMapAlpha\", void 0), Object(V.c)([Object(_.c)(\"maxSimultaneousLights\")], ee.prototype, \"_maxSimultaneousLights\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsLightsDirty\")], ee.prototype, \"maxSimultaneousLights\", void 0), Object(V.c)([Object(_.c)(\"invertNormalMapX\")], ee.prototype, \"_invertNormalMapX\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"invertNormalMapX\", void 0), Object(V.c)([Object(_.c)(\"invertNormalMapY\")], ee.prototype, \"_invertNormalMapY\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"invertNormalMapY\", void 0), Object(V.c)([Object(_.c)(\"twoSidedLighting\")], ee.prototype, \"_twoSidedLighting\", void 0), Object(V.c)([Object(_.b)(\"_markAllSubMeshesAsTexturesDirty\")], ee.prototype, \"twoSidedLighting\", void 0), Object(V.c)([Object(_.c)()], ee.prototype, \"useLogarithmicDepth\", null), ee;\n        }(E.a);\n        h.a.RegisteredTypes[\"BABYLON.StandardMaterial\"] = pe, u.a.DefaultMaterialFactory = function(ae) {\n          return new pe(\"default material\", ae);\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return M;\n        });\n        var V = f(1), _ = f(12), C = f(6), u = f(0), I = f(13), O = f(4), x = f(16), m = f(46), c = f(54), T = f(43), S = f(2), E = f(147), g = f(21), l = f(101), h = f(9), v = f(28), b = f(23), D = f(11), w = function() {\n          this.facetNb = 0, this.partitioningSubdivisions = 10, this.partitioningBBoxRatio = 1.01, this.facetDataEnabled = !1, this.facetParameters = {}, this.bbSize = u.e.Zero(), this.subDiv = { max: 1, X: 1, Y: 1, Z: 1 }, this.facetDepthSort = !1, this.facetDepthSortEnabled = !1;\n        }, N = function() {\n          this._hasVertexAlpha = !1, this._useVertexColors = !0, this._numBoneInfluencers = 4, this._applyFog = !0, this._receiveShadows = !1, this._facetData = new w(), this._visibility = 1, this._skeleton = null, this._layerMask = 268435455, this._computeBonesUsingShaders = !0, this._isActive = !1, this._onlyForInstances = !1, this._isActiveIntermediate = !1, this._onlyForInstancesIntermediate = !1, this._actAsRegularMesh = !1, this._currentLOD = null, this._currentLODIsUpToDate = !1;\n        }, M = function(U) {\n          function X(j, ne) {\n            ne === void 0 && (ne = null);\n            var te = U.call(this, j, ne, !1) || this;\n            return te._internalAbstractMeshDataInfo = new N(), te.cullingStrategy = X.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, te.onCollideObservable = new C.c(), te.onCollisionPositionChangeObservable = new C.c(), te.onMaterialChangedObservable = new C.c(), te.definedFacingForward = !0, te._occlusionQuery = null, te._renderingGroup = null, te.alphaIndex = Number.MAX_VALUE, te.isVisible = !0, te.isPickable = !0, te.showSubMeshesBoundingBox = !1, te.isBlocker = !1, te.enablePointerMoveEvents = !1, te._renderingGroupId = 0, te._material = null, te.outlineColor = h.a.Red(), te.outlineWidth = 0.02, te.overlayColor = h.a.Red(), te.overlayAlpha = 0.5, te.useOctreeForRenderingSelection = !0, te.useOctreeForPicking = !0, te.useOctreeForCollisions = !0, te.alwaysSelectAsActiveMesh = !1, te.doNotSyncBoundingInfo = !1, te.actionManager = null, te._meshCollisionData = new E.a(), te.ellipsoid = new u.e(0.5, 1, 0.5), te.ellipsoidOffset = new u.e(0, 0, 0), te.edgesWidth = 1, te.edgesColor = new h.b(1, 0, 0, 1), te._edgesRenderer = null, te._masterMesh = null, te._boundingInfo = null, te._renderId = 0, te._intersectionsInProgress = new Array(), te._unIndexed = !1, te._lightSources = new Array(), te._waitingData = { lods: null, actions: null, freezeWorldMatrix: null }, te._bonesTransformMatrices = null, te._transformMatrixTexture = null, te.onRebuildObservable = new C.c(), te._onCollisionPositionChange = function(de, pe, ae) {\n              ae === void 0 && (ae = null), pe.subtractToRef(te._meshCollisionData._oldPositionForCollisions, te._meshCollisionData._diffPositionForCollisions), te._meshCollisionData._diffPositionForCollisions.length() > I.a.CollisionsEpsilon && te.position.addInPlace(te._meshCollisionData._diffPositionForCollisions), ae && te.onCollideObservable.notifyObservers(ae), te.onCollisionPositionChangeObservable.notifyObservers(te.position);\n            }, te.getScene().addMesh(te), te._resyncLightSources(), te;\n          }\n          return Object(V.d)(X, U), Object.defineProperty(X, \"BILLBOARDMODE_NONE\", { get: function() {\n            return m.a.BILLBOARDMODE_NONE;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_X\", { get: function() {\n            return m.a.BILLBOARDMODE_X;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_Y\", { get: function() {\n            return m.a.BILLBOARDMODE_Y;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_Z\", { get: function() {\n            return m.a.BILLBOARDMODE_Z;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_ALL\", { get: function() {\n            return m.a.BILLBOARDMODE_ALL;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X, \"BILLBOARDMODE_USE_POSITION\", { get: function() {\n            return m.a.BILLBOARDMODE_USE_POSITION;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"facetNb\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetNb;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"partitioningSubdivisions\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.partitioningSubdivisions = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"partitioningBBoxRatio\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.partitioningBBoxRatio = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"mustDepthSortFacets\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetDepthSort;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.facetDepthSort = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"facetDepthSortFrom\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._facetData.facetDepthSortFrom = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"isFacetDataEnabled\", { get: function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetDataEnabled;\n          }, enumerable: !1, configurable: !0 }), X.prototype._updateNonUniformScalingState = function(j) {\n            return !!U.prototype._updateNonUniformScalingState.call(this, j) && (this._markSubMeshesAsMiscDirty(), !0);\n          }, Object.defineProperty(X.prototype, \"onCollide\", { set: function(j) {\n            this._meshCollisionData._onCollideObserver && this.onCollideObservable.remove(this._meshCollisionData._onCollideObserver), this._meshCollisionData._onCollideObserver = this.onCollideObservable.add(j);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"onCollisionPositionChange\", { set: function(j) {\n            this._meshCollisionData._onCollisionPositionChangeObserver && this.onCollisionPositionChangeObservable.remove(this._meshCollisionData._onCollisionPositionChangeObserver), this._meshCollisionData._onCollisionPositionChangeObserver = this.onCollisionPositionChangeObservable.add(j);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"visibility\", { get: function() {\n            return this._internalAbstractMeshDataInfo._visibility;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._visibility !== j && (this._internalAbstractMeshDataInfo._visibility = j, this._markSubMeshesAsMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"renderingGroupId\", { get: function() {\n            return this._renderingGroupId;\n          }, set: function(j) {\n            this._renderingGroupId = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"material\", { get: function() {\n            return this._material;\n          }, set: function(j) {\n            this._material !== j && (this._material && this._material.meshMap && (this._material.meshMap[this.uniqueId] = void 0), this._material = j, j && j.meshMap && (j.meshMap[this.uniqueId] = this), this.onMaterialChangedObservable.hasObservers() && this.onMaterialChangedObservable.notifyObservers(this), this.subMeshes && this._unBindEffect());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"receiveShadows\", { get: function() {\n            return this._internalAbstractMeshDataInfo._receiveShadows;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._receiveShadows !== j && (this._internalAbstractMeshDataInfo._receiveShadows = j, this._markSubMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"hasVertexAlpha\", { get: function() {\n            return this._internalAbstractMeshDataInfo._hasVertexAlpha;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._hasVertexAlpha !== j && (this._internalAbstractMeshDataInfo._hasVertexAlpha = j, this._markSubMeshesAsAttributesDirty(), this._markSubMeshesAsMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"useVertexColors\", { get: function() {\n            return this._internalAbstractMeshDataInfo._useVertexColors;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._useVertexColors !== j && (this._internalAbstractMeshDataInfo._useVertexColors = j, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"computeBonesUsingShaders\", { get: function() {\n            return this._internalAbstractMeshDataInfo._computeBonesUsingShaders;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._computeBonesUsingShaders !== j && (this._internalAbstractMeshDataInfo._computeBonesUsingShaders = j, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"numBoneInfluencers\", { get: function() {\n            return this._internalAbstractMeshDataInfo._numBoneInfluencers;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._numBoneInfluencers !== j && (this._internalAbstractMeshDataInfo._numBoneInfluencers = j, this._markSubMeshesAsAttributesDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"applyFog\", { get: function() {\n            return this._internalAbstractMeshDataInfo._applyFog;\n          }, set: function(j) {\n            this._internalAbstractMeshDataInfo._applyFog !== j && (this._internalAbstractMeshDataInfo._applyFog = j, this._markSubMeshesAsMiscDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"layerMask\", { get: function() {\n            return this._internalAbstractMeshDataInfo._layerMask;\n          }, set: function(j) {\n            j !== this._internalAbstractMeshDataInfo._layerMask && (this._internalAbstractMeshDataInfo._layerMask = j, this._resyncLightSources());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collisionMask\", { get: function() {\n            return this._meshCollisionData._collisionMask;\n          }, set: function(j) {\n            this._meshCollisionData._collisionMask = isNaN(j) ? -1 : j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collisionResponse\", { get: function() {\n            return this._meshCollisionData._collisionResponse;\n          }, set: function(j) {\n            this._meshCollisionData._collisionResponse = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collisionGroup\", { get: function() {\n            return this._meshCollisionData._collisionGroup;\n          }, set: function(j) {\n            this._meshCollisionData._collisionGroup = isNaN(j) ? -1 : j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"surroundingMeshes\", { get: function() {\n            return this._meshCollisionData._surroundingMeshes;\n          }, set: function(j) {\n            this._meshCollisionData._surroundingMeshes = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"lightSources\", { get: function() {\n            return this._lightSources;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"_positions\", { get: function() {\n            return null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"skeleton\", { get: function() {\n            return this._internalAbstractMeshDataInfo._skeleton;\n          }, set: function(j) {\n            var ne = this._internalAbstractMeshDataInfo._skeleton;\n            ne && ne.needInitialSkinMatrix && ne._unregisterMeshWithPoseMatrix(this), j && j.needInitialSkinMatrix && j._registerMeshWithPoseMatrix(this), this._internalAbstractMeshDataInfo._skeleton = j, this._internalAbstractMeshDataInfo._skeleton || (this._bonesTransformMatrices = null), this._markSubMeshesAsAttributesDirty();\n          }, enumerable: !1, configurable: !0 }), X.prototype.getClassName = function() {\n            return \"AbstractMesh\";\n          }, X.prototype.toString = function(j) {\n            var ne = \"Name: \" + this.name + \", isInstance: \" + (this.getClassName() !== \"InstancedMesh\" ? \"YES\" : \"NO\");\n            ne += \", # of submeshes: \" + (this.subMeshes ? this.subMeshes.length : 0);\n            var te = this._internalAbstractMeshDataInfo._skeleton;\n            return te && (ne += \", skeleton: \" + te.name), j && (ne += \", billboard mode: \" + [\"NONE\", \"X\", \"Y\", null, \"Z\", null, null, \"ALL\"][this.billboardMode], ne += \", freeze wrld mat: \" + (this._isWorldMatrixFrozen || this._waitingData.freezeWorldMatrix ? \"YES\" : \"NO\")), ne;\n          }, X.prototype._getEffectiveParent = function() {\n            return this._masterMesh && this.billboardMode !== m.a.BILLBOARDMODE_NONE ? this._masterMesh : U.prototype._getEffectiveParent.call(this);\n          }, X.prototype._getActionManagerForTrigger = function(j, ne) {\n            if (ne === void 0 && (ne = !0), this.actionManager && (ne || this.actionManager.isRecursive)) {\n              if (!j)\n                return this.actionManager;\n              if (this.actionManager.hasSpecificTrigger(j))\n                return this.actionManager;\n            }\n            return this.parent ? this.parent._getActionManagerForTrigger(j, !1) : null;\n          }, X.prototype._rebuild = function() {\n            if (this.onRebuildObservable.notifyObservers(this), this._occlusionQuery && (this._occlusionQuery = null), this.subMeshes)\n              for (var j = 0, ne = this.subMeshes; j < ne.length; j++)\n                ne[j]._rebuild();\n          }, X.prototype._resyncLightSources = function() {\n            this._lightSources.length = 0;\n            for (var j = 0, ne = this.getScene().lights; j < ne.length; j++) {\n              var te = ne[j];\n              te.isEnabled() && te.canAffectMesh(this) && this._lightSources.push(te);\n            }\n            this._markSubMeshesAsLightDirty();\n          }, X.prototype._resyncLightSource = function(j) {\n            var ne = j.isEnabled() && j.canAffectMesh(this), te = this._lightSources.indexOf(j), de = !1;\n            if (te === -1) {\n              if (!ne)\n                return;\n              this._lightSources.push(j);\n            } else {\n              if (ne)\n                return;\n              de = !0, this._lightSources.splice(te, 1);\n            }\n            this._markSubMeshesAsLightDirty(de);\n          }, X.prototype._unBindEffect = function() {\n            for (var j = 0, ne = this.subMeshes; j < ne.length; j++)\n              ne[j].setEffect(null);\n          }, X.prototype._removeLightSource = function(j, ne) {\n            var te = this._lightSources.indexOf(j);\n            te !== -1 && (this._lightSources.splice(te, 1), this._markSubMeshesAsLightDirty(ne));\n          }, X.prototype._markSubMeshesAsDirty = function(j) {\n            if (this.subMeshes)\n              for (var ne = 0, te = this.subMeshes; ne < te.length; ne++) {\n                var de = te[ne];\n                de._materialDefines && j(de._materialDefines);\n              }\n          }, X.prototype._markSubMeshesAsLightDirty = function(j) {\n            j === void 0 && (j = !1), this._markSubMeshesAsDirty(function(ne) {\n              return ne.markAsLightDirty(j);\n            });\n          }, X.prototype._markSubMeshesAsAttributesDirty = function() {\n            this._markSubMeshesAsDirty(function(j) {\n              return j.markAsAttributesDirty();\n            });\n          }, X.prototype._markSubMeshesAsMiscDirty = function() {\n            this._markSubMeshesAsDirty(function(j) {\n              return j.markAsMiscDirty();\n            });\n          }, Object.defineProperty(X.prototype, \"scaling\", { get: function() {\n            return this._scaling;\n          }, set: function(j) {\n            this._scaling = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"isBlocked\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), X.prototype.getLOD = function(j) {\n            return this;\n          }, X.prototype.getTotalVertices = function() {\n            return 0;\n          }, X.prototype.getTotalIndices = function() {\n            return 0;\n          }, X.prototype.getIndices = function() {\n            return null;\n          }, X.prototype.getVerticesData = function(j) {\n            return null;\n          }, X.prototype.setVerticesData = function(j, ne, te, de) {\n            return this;\n          }, X.prototype.updateVerticesData = function(j, ne, te, de) {\n            return this;\n          }, X.prototype.setIndices = function(j, ne) {\n            return this;\n          }, X.prototype.isVerticesDataPresent = function(j) {\n            return !1;\n          }, X.prototype.getBoundingInfo = function() {\n            return this._masterMesh ? this._masterMesh.getBoundingInfo() : (this._boundingInfo || this._updateBoundingInfo(), this._boundingInfo);\n          }, X.prototype.normalizeToUnitCube = function(j, ne, te) {\n            return j === void 0 && (j = !0), ne === void 0 && (ne = !1), U.prototype.normalizeToUnitCube.call(this, j, ne, te);\n          }, X.prototype.setBoundingInfo = function(j) {\n            return this._boundingInfo = j, this;\n          }, Object.defineProperty(X.prototype, \"useBones\", { get: function() {\n            return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(O.b.MatricesIndicesKind) && this.isVerticesDataPresent(O.b.MatricesWeightsKind);\n          }, enumerable: !1, configurable: !0 }), X.prototype._preActivate = function() {\n          }, X.prototype._preActivateForIntermediateRendering = function(j) {\n          }, X.prototype._activate = function(j, ne) {\n            return this._renderId = j, !0;\n          }, X.prototype._postActivate = function() {\n          }, X.prototype._freeze = function() {\n          }, X.prototype._unFreeze = function() {\n          }, X.prototype.getWorldMatrix = function() {\n            return this._masterMesh && this.billboardMode === m.a.BILLBOARDMODE_NONE ? this._masterMesh.getWorldMatrix() : U.prototype.getWorldMatrix.call(this);\n          }, X.prototype._getWorldMatrixDeterminant = function() {\n            return this._masterMesh ? this._masterMesh._getWorldMatrixDeterminant() : U.prototype._getWorldMatrixDeterminant.call(this);\n          }, Object.defineProperty(X.prototype, \"isAnInstance\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"hasInstances\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"hasThinInstances\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), X.prototype.movePOV = function(j, ne, te) {\n            return this.position.addInPlace(this.calcMovePOV(j, ne, te)), this;\n          }, X.prototype.calcMovePOV = function(j, ne, te) {\n            var de = new u.a();\n            (this.rotationQuaternion ? this.rotationQuaternion : u.b.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z)).toRotationMatrix(de);\n            var pe = u.e.Zero(), ae = this.definedFacingForward ? -1 : 1;\n            return u.e.TransformCoordinatesFromFloatsToRef(j * ae, ne, te * ae, de, pe), pe;\n          }, X.prototype.rotatePOV = function(j, ne, te) {\n            return this.rotation.addInPlace(this.calcRotatePOV(j, ne, te)), this;\n          }, X.prototype.calcRotatePOV = function(j, ne, te) {\n            var de = this.definedFacingForward ? 1 : -1;\n            return new u.e(j * de, ne, te * de);\n          }, X.prototype.refreshBoundingInfo = function(j) {\n            return j === void 0 && (j = !1), this._boundingInfo && this._boundingInfo.isLocked || this._refreshBoundingInfo(this._getPositionData(j), null), this;\n          }, X.prototype._refreshBoundingInfo = function(j, ne) {\n            if (j) {\n              var te = Object(l.a)(j, 0, this.getTotalVertices(), ne);\n              this._boundingInfo ? this._boundingInfo.reConstruct(te.minimum, te.maximum) : this._boundingInfo = new T.a(te.minimum, te.maximum);\n            }\n            if (this.subMeshes)\n              for (var de = 0; de < this.subMeshes.length; de++)\n                this.subMeshes[de].refreshBoundingInfo(j);\n            this._updateBoundingInfo();\n          }, X.prototype._getPositionData = function(j) {\n            var ne = this.getVerticesData(O.b.PositionKind);\n            if (ne && j && this.skeleton) {\n              ne = _.b.Slice(ne), this._generatePointsArray();\n              var te = this.getVerticesData(O.b.MatricesIndicesKind), de = this.getVerticesData(O.b.MatricesWeightsKind);\n              if (de && te) {\n                var pe = this.numBoneInfluencers > 4, ae = pe ? this.getVerticesData(O.b.MatricesIndicesExtraKind) : null, ee = pe ? this.getVerticesData(O.b.MatricesWeightsExtraKind) : null;\n                this.skeleton.prepare();\n                for (var K = this.skeleton.getTransformMatrices(this), $ = u.c.Vector3[0], L = u.c.Matrix[0], G = u.c.Matrix[1], Q = 0, oe = 0; oe < ne.length; oe += 3, Q += 4) {\n                  var re, Y;\n                  for (L.reset(), re = 0; re < 4; re++)\n                    (Y = de[Q + re]) > 0 && (u.a.FromFloat32ArrayToRefScaled(K, Math.floor(16 * te[Q + re]), Y, G), L.addToSelf(G));\n                  if (pe)\n                    for (re = 0; re < 4; re++)\n                      (Y = ee[Q + re]) > 0 && (u.a.FromFloat32ArrayToRefScaled(K, Math.floor(16 * ae[Q + re]), Y, G), L.addToSelf(G));\n                  u.e.TransformCoordinatesFromFloatsToRef(ne[oe], ne[oe + 1], ne[oe + 2], L, $), $.toArray(ne, oe), this._positions && this._positions[oe / 3].copyFrom($);\n                }\n              }\n            }\n            return ne;\n          }, X.prototype._updateBoundingInfo = function() {\n            var j = this._effectiveMesh;\n            return this._boundingInfo ? this._boundingInfo.update(j.worldMatrixFromCache) : this._boundingInfo = new T.a(this.absolutePosition, this.absolutePosition, j.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(j.worldMatrixFromCache), this;\n          }, X.prototype._updateSubMeshesBoundingInfo = function(j) {\n            if (!this.subMeshes)\n              return this;\n            for (var ne = this.subMeshes.length, te = 0; te < ne; te++) {\n              var de = this.subMeshes[te];\n              (ne > 1 || !de.IsGlobal) && de.updateBoundingInfo(j);\n            }\n            return this;\n          }, X.prototype._afterComputeWorldMatrix = function() {\n            this.doNotSyncBoundingInfo || this._updateBoundingInfo();\n          }, Object.defineProperty(X.prototype, \"_effectiveMesh\", { get: function() {\n            return this.skeleton && this.skeleton.overrideMesh || this;\n          }, enumerable: !1, configurable: !0 }), X.prototype.isInFrustum = function(j) {\n            return this._boundingInfo !== null && this._boundingInfo.isInFrustum(j, this.cullingStrategy);\n          }, X.prototype.isCompletelyInFrustum = function(j) {\n            return this._boundingInfo !== null && this._boundingInfo.isCompletelyInFrustum(j);\n          }, X.prototype.intersectsMesh = function(j, ne, te) {\n            if (ne === void 0 && (ne = !1), !this._boundingInfo || !j._boundingInfo)\n              return !1;\n            if (this._boundingInfo.intersects(j._boundingInfo, ne))\n              return !0;\n            if (te) {\n              for (var de = 0, pe = this.getChildMeshes(); de < pe.length; de++)\n                if (pe[de].intersectsMesh(j, ne, !0))\n                  return !0;\n            }\n            return !1;\n          }, X.prototype.intersectsPoint = function(j) {\n            return !!this._boundingInfo && this._boundingInfo.intersectsPoint(j);\n          }, Object.defineProperty(X.prototype, \"checkCollisions\", { get: function() {\n            return this._meshCollisionData._checkCollisions;\n          }, set: function(j) {\n            this._meshCollisionData._checkCollisions = j;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(X.prototype, \"collider\", { get: function() {\n            return this._meshCollisionData._collider;\n          }, enumerable: !1, configurable: !0 }), X.prototype.moveWithCollisions = function(j) {\n            this.getAbsolutePosition().addToRef(this.ellipsoidOffset, this._meshCollisionData._oldPositionForCollisions);\n            var ne = this.getScene().collisionCoordinator;\n            return this._meshCollisionData._collider || (this._meshCollisionData._collider = ne.createCollider()), this._meshCollisionData._collider._radius = this.ellipsoid, ne.getNewPosition(this._meshCollisionData._oldPositionForCollisions, j, this._meshCollisionData._collider, 3, this, this._onCollisionPositionChange, this.uniqueId), this;\n          }, X.prototype._collideForSubMesh = function(j, ne, te) {\n            if (this._generatePointsArray(), !this._positions)\n              return this;\n            if (!j._lastColliderWorldVertices || !j._lastColliderTransformMatrix.equals(ne)) {\n              j._lastColliderTransformMatrix = ne.clone(), j._lastColliderWorldVertices = [], j._trianglePlanes = [];\n              for (var de = j.verticesStart, pe = j.verticesStart + j.verticesCount, ae = de; ae < pe; ae++)\n                j._lastColliderWorldVertices.push(u.e.TransformCoordinates(this._positions[ae], ne));\n            }\n            return te._collide(j._trianglePlanes, j._lastColliderWorldVertices, this.getIndices(), j.indexStart, j.indexStart + j.indexCount, j.verticesStart, !!j.getMaterial(), this), this;\n          }, X.prototype._processCollisionsForSubMeshes = function(j, ne) {\n            for (var te = this._scene.getCollidingSubMeshCandidates(this, j), de = te.length, pe = 0; pe < de; pe++) {\n              var ae = te.data[pe];\n              de > 1 && !ae._checkCollision(j) || this._collideForSubMesh(ae, ne, j);\n            }\n            return this;\n          }, X.prototype._checkCollision = function(j) {\n            if (!this._boundingInfo || !this._boundingInfo._checkCollision(j))\n              return this;\n            var ne = u.c.Matrix[0], te = u.c.Matrix[1];\n            return u.a.ScalingToRef(1 / j._radius.x, 1 / j._radius.y, 1 / j._radius.z, ne), this.worldMatrixFromCache.multiplyToRef(ne, te), this._processCollisionsForSubMeshes(j, te), this;\n          }, X.prototype._generatePointsArray = function() {\n            return !1;\n          }, X.prototype.intersects = function(j, ne, te, de, pe, ae) {\n            var ee;\n            de === void 0 && (de = !1), ae === void 0 && (ae = !1);\n            var K = new c.a(), $ = this.getClassName() === \"InstancedLinesMesh\" || this.getClassName() === \"LinesMesh\" ? this.intersectionThreshold : 0, L = this._boundingInfo;\n            if (!this.subMeshes || !L || !(ae || j.intersectsSphere(L.boundingSphere, $) && j.intersectsBox(L.boundingBox, $)))\n              return K;\n            if (de)\n              return K.hit = !ae, K.pickedMesh = ae ? null : this, K.distance = ae ? 0 : u.e.Distance(j.origin, L.boundingSphere.center), K.subMeshId = 0, K;\n            if (!this._generatePointsArray())\n              return K;\n            for (var G = null, Q = this._scene.getIntersectingSubMeshCandidates(this, j), oe = Q.length, re = !1, Y = 0; Y < oe; Y++) {\n              var k = (H = Q.data[Y]).getMaterial();\n              if (k && (!((ee = this.getIndices()) === null || ee === void 0) && ee.length) && (k.fillMode == S.a.MATERIAL_TriangleStripDrawMode || k.fillMode == S.a.MATERIAL_TriangleFillMode || k.fillMode == S.a.MATERIAL_WireFrameFillMode || k.fillMode == S.a.MATERIAL_PointFillMode)) {\n                re = !0;\n                break;\n              }\n            }\n            if (!re)\n              return K.hit = !0, K.pickedMesh = this, K.distance = u.e.Distance(j.origin, L.boundingSphere.center), K.subMeshId = -1, K;\n            for (Y = 0; Y < oe; Y++) {\n              var H = Q.data[Y];\n              if (!(oe > 1) || H.canIntersects(j)) {\n                var Z = H.intersects(j, this._positions, this.getIndices(), ne, te);\n                if (Z && (ne || !G || Z.distance < G.distance) && ((G = Z).subMeshId = Y, ne))\n                  break;\n              }\n            }\n            if (G) {\n              var W = pe ?? (this.skeleton && this.skeleton.overrideMesh ? this.skeleton.overrideMesh.getWorldMatrix() : this.getWorldMatrix()), q = u.c.Vector3[0], he = u.c.Vector3[1];\n              u.e.TransformCoordinatesToRef(j.origin, W, q), j.direction.scaleToRef(G.distance, he);\n              var ge = u.e.TransformNormal(he, W).addInPlace(q);\n              return K.hit = !0, K.distance = u.e.Distance(q, ge), K.pickedPoint = ge, K.pickedMesh = this, K.bu = G.bu || 0, K.bv = G.bv || 0, K.subMeshFaceId = G.faceId, K.faceId = G.faceId + Q.data[G.subMeshId].indexStart / (this.getClassName().indexOf(\"LinesMesh\") !== -1 ? 2 : 3), K.subMeshId = G.subMeshId, K;\n            }\n            return K;\n          }, X.prototype.clone = function(j, ne, te) {\n            return null;\n          }, X.prototype.releaseSubMeshes = function() {\n            if (this.subMeshes)\n              for (; this.subMeshes.length; )\n                this.subMeshes[0].dispose();\n            else\n              this.subMeshes = new Array();\n            return this;\n          }, X.prototype.dispose = function(j, ne) {\n            var te, de = this;\n            for (ne === void 0 && (ne = !1), this._scene.useMaterialMeshMap && this._material && this._material.meshMap && (this._material.meshMap[this.uniqueId] = void 0), this.getScene().freeActiveMeshes(), this.getScene().freeRenderingGroups(), this.actionManager !== void 0 && this.actionManager !== null && (this.actionManager.dispose(), this.actionManager = null), this._internalAbstractMeshDataInfo._skeleton = null, this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null), te = 0; te < this._intersectionsInProgress.length; te++) {\n              var pe = this._intersectionsInProgress[te], ae = pe._intersectionsInProgress.indexOf(this);\n              pe._intersectionsInProgress.splice(ae, 1);\n            }\n            this._intersectionsInProgress = [], this.getScene().lights.forEach(function(K) {\n              var $ = K.includedOnlyMeshes.indexOf(de);\n              $ !== -1 && K.includedOnlyMeshes.splice($, 1), ($ = K.excludedMeshes.indexOf(de)) !== -1 && K.excludedMeshes.splice($, 1);\n              var L = K.getShadowGenerator();\n              if (L) {\n                var G = L.getShadowMap();\n                G && G.renderList && ($ = G.renderList.indexOf(de)) !== -1 && G.renderList.splice($, 1);\n              }\n            }), this.getClassName() === \"InstancedMesh\" && this.getClassName() === \"InstancedLinesMesh\" || this.releaseSubMeshes();\n            var ee = this.getScene().getEngine();\n            if (this._occlusionQuery && (this.isOcclusionQueryInProgress = !1, ee.deleteQuery(this._occlusionQuery), this._occlusionQuery = null), ee.wipeCaches(), this.getScene().removeMesh(this), ne && this.material && (this.material.getClassName() === \"MultiMaterial\" ? this.material.dispose(!1, !0, !0) : this.material.dispose(!1, !0)), !j)\n              for (te = 0; te < this.getScene().particleSystems.length; te++)\n                this.getScene().particleSystems[te].emitter === this && (this.getScene().particleSystems[te].dispose(), te--);\n            this._internalAbstractMeshDataInfo._facetData.facetDataEnabled && this.disableFacetData(), this.onAfterWorldMatrixUpdateObservable.clear(), this.onCollideObservable.clear(), this.onCollisionPositionChangeObservable.clear(), this.onRebuildObservable.clear(), U.prototype.dispose.call(this, j, ne);\n          }, X.prototype.addChild = function(j) {\n            return j.setParent(this), this;\n          }, X.prototype.removeChild = function(j) {\n            return j.setParent(null), this;\n          }, X.prototype._initFacetData = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            j.facetNormals || (j.facetNormals = new Array()), j.facetPositions || (j.facetPositions = new Array()), j.facetPartitioning || (j.facetPartitioning = new Array()), j.facetNb = this.getIndices().length / 3 | 0, j.partitioningSubdivisions = j.partitioningSubdivisions ? j.partitioningSubdivisions : 10, j.partitioningBBoxRatio = j.partitioningBBoxRatio ? j.partitioningBBoxRatio : 1.01;\n            for (var ne = 0; ne < j.facetNb; ne++)\n              j.facetNormals[ne] = u.e.Zero(), j.facetPositions[ne] = u.e.Zero();\n            return j.facetDataEnabled = !0, this;\n          }, X.prototype.updateFacetData = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            j.facetDataEnabled || this._initFacetData();\n            var ne = this.getVerticesData(O.b.PositionKind), te = this.getIndices(), de = this.getVerticesData(O.b.NormalKind), pe = this.getBoundingInfo();\n            if (j.facetDepthSort && !j.facetDepthSortEnabled) {\n              if (j.facetDepthSortEnabled = !0, te instanceof Uint16Array)\n                j.depthSortedIndices = new Uint16Array(te);\n              else if (te instanceof Uint32Array)\n                j.depthSortedIndices = new Uint32Array(te);\n              else {\n                for (var ae = !1, ee = 0; ee < te.length; ee++)\n                  if (te[ee] > 65535) {\n                    ae = !0;\n                    break;\n                  }\n                j.depthSortedIndices = ae ? new Uint32Array(te) : new Uint16Array(te);\n              }\n              if (j.facetDepthSortFunction = function(re, Y) {\n                return Y.sqDistance - re.sqDistance;\n              }, !j.facetDepthSortFrom) {\n                var K = this.getScene().activeCamera;\n                j.facetDepthSortFrom = K ? K.position : u.e.Zero();\n              }\n              j.depthSortedFacets = [];\n              for (var $ = 0; $ < j.facetNb; $++) {\n                var L = { ind: 3 * $, sqDistance: 0 };\n                j.depthSortedFacets.push(L);\n              }\n              j.invertedMatrix = u.a.Identity(), j.facetDepthSortOrigin = u.e.Zero();\n            }\n            j.bbSize.x = pe.maximum.x - pe.minimum.x > v.a ? pe.maximum.x - pe.minimum.x : v.a, j.bbSize.y = pe.maximum.y - pe.minimum.y > v.a ? pe.maximum.y - pe.minimum.y : v.a, j.bbSize.z = pe.maximum.z - pe.minimum.z > v.a ? pe.maximum.z - pe.minimum.z : v.a;\n            var G = j.bbSize.x > j.bbSize.y ? j.bbSize.x : j.bbSize.y;\n            if (G = G > j.bbSize.z ? G : j.bbSize.z, j.subDiv.max = j.partitioningSubdivisions, j.subDiv.X = Math.floor(j.subDiv.max * j.bbSize.x / G), j.subDiv.Y = Math.floor(j.subDiv.max * j.bbSize.y / G), j.subDiv.Z = Math.floor(j.subDiv.max * j.bbSize.z / G), j.subDiv.X = j.subDiv.X < 1 ? 1 : j.subDiv.X, j.subDiv.Y = j.subDiv.Y < 1 ? 1 : j.subDiv.Y, j.subDiv.Z = j.subDiv.Z < 1 ? 1 : j.subDiv.Z, j.facetParameters.facetNormals = this.getFacetLocalNormals(), j.facetParameters.facetPositions = this.getFacetLocalPositions(), j.facetParameters.facetPartitioning = this.getFacetLocalPartitioning(), j.facetParameters.bInfo = pe, j.facetParameters.bbSize = j.bbSize, j.facetParameters.subDiv = j.subDiv, j.facetParameters.ratio = this.partitioningBBoxRatio, j.facetParameters.depthSort = j.facetDepthSort, j.facetDepthSort && j.facetDepthSortEnabled && (this.computeWorldMatrix(!0), this._worldMatrix.invertToRef(j.invertedMatrix), u.e.TransformCoordinatesToRef(j.facetDepthSortFrom, j.invertedMatrix, j.facetDepthSortOrigin), j.facetParameters.distanceTo = j.facetDepthSortOrigin), j.facetParameters.depthSortedFacets = j.depthSortedFacets, x.a.ComputeNormals(ne, te, de, j.facetParameters), j.facetDepthSort && j.facetDepthSortEnabled) {\n              j.depthSortedFacets.sort(j.facetDepthSortFunction);\n              var Q = j.depthSortedIndices.length / 3 | 0;\n              for ($ = 0; $ < Q; $++) {\n                var oe = j.depthSortedFacets[$].ind;\n                j.depthSortedIndices[3 * $] = te[oe], j.depthSortedIndices[3 * $ + 1] = te[oe + 1], j.depthSortedIndices[3 * $ + 2] = te[oe + 2];\n              }\n              this.updateIndices(j.depthSortedIndices, void 0, !0);\n            }\n            return this;\n          }, X.prototype.getFacetLocalNormals = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetNormals || this.updateFacetData(), j.facetNormals;\n          }, X.prototype.getFacetLocalPositions = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetPositions || this.updateFacetData(), j.facetPositions;\n          }, X.prototype.getFacetLocalPartitioning = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetPartitioning || this.updateFacetData(), j.facetPartitioning;\n          }, X.prototype.getFacetPosition = function(j) {\n            var ne = u.e.Zero();\n            return this.getFacetPositionToRef(j, ne), ne;\n          }, X.prototype.getFacetPositionToRef = function(j, ne) {\n            var te = this.getFacetLocalPositions()[j], de = this.getWorldMatrix();\n            return u.e.TransformCoordinatesToRef(te, de, ne), this;\n          }, X.prototype.getFacetNormal = function(j) {\n            var ne = u.e.Zero();\n            return this.getFacetNormalToRef(j, ne), ne;\n          }, X.prototype.getFacetNormalToRef = function(j, ne) {\n            var te = this.getFacetLocalNormals()[j];\n            return u.e.TransformNormalToRef(te, this.getWorldMatrix(), ne), this;\n          }, X.prototype.getFacetsAtLocalCoordinates = function(j, ne, te) {\n            var de = this.getBoundingInfo(), pe = this._internalAbstractMeshDataInfo._facetData, ae = Math.floor((j - de.minimum.x * pe.partitioningBBoxRatio) * pe.subDiv.X * pe.partitioningBBoxRatio / pe.bbSize.x), ee = Math.floor((ne - de.minimum.y * pe.partitioningBBoxRatio) * pe.subDiv.Y * pe.partitioningBBoxRatio / pe.bbSize.y), K = Math.floor((te - de.minimum.z * pe.partitioningBBoxRatio) * pe.subDiv.Z * pe.partitioningBBoxRatio / pe.bbSize.z);\n            return ae < 0 || ae > pe.subDiv.max || ee < 0 || ee > pe.subDiv.max || K < 0 || K > pe.subDiv.max ? null : pe.facetPartitioning[ae + pe.subDiv.max * ee + pe.subDiv.max * pe.subDiv.max * K];\n          }, X.prototype.getClosestFacetAtCoordinates = function(j, ne, te, de, pe, ae) {\n            pe === void 0 && (pe = !1), ae === void 0 && (ae = !0);\n            var ee = this.getWorldMatrix(), K = u.c.Matrix[5];\n            ee.invertToRef(K);\n            var $ = u.c.Vector3[8];\n            u.e.TransformCoordinatesFromFloatsToRef(j, ne, te, K, $);\n            var L = this.getClosestFacetAtLocalCoordinates($.x, $.y, $.z, de, pe, ae);\n            return de && u.e.TransformCoordinatesFromFloatsToRef(de.x, de.y, de.z, ee, de), L;\n          }, X.prototype.getClosestFacetAtLocalCoordinates = function(j, ne, te, de, pe, ae) {\n            pe === void 0 && (pe = !1), ae === void 0 && (ae = !0);\n            var ee = null, K = 0, $ = 0, L = 0, G = 0, Q = 0, oe = 0, re = 0, Y = 0, k = this.getFacetLocalPositions(), H = this.getFacetLocalNormals(), Z = this.getFacetsAtLocalCoordinates(j, ne, te);\n            if (!Z)\n              return null;\n            for (var W, q, he, ge = Number.MAX_VALUE, me = ge, _e = 0; _e < Z.length; _e++)\n              q = H[W = Z[_e]], G = (j - (he = k[W]).x) * q.x + (ne - he.y) * q.y + (te - he.z) * q.z, (!pe || pe && ae && G >= 0 || pe && !ae && G <= 0) && (G = q.x * he.x + q.y * he.y + q.z * he.z, Q = -(q.x * j + q.y * ne + q.z * te - G) / (q.x * q.x + q.y * q.y + q.z * q.z), (me = (K = (oe = j + q.x * Q) - j) * K + ($ = (re = ne + q.y * Q) - ne) * $ + (L = (Y = te + q.z * Q) - te) * L) < ge && (ge = me, ee = W, de && (de.x = oe, de.y = re, de.z = Y)));\n            return ee;\n          }, X.prototype.getFacetDataParameters = function() {\n            return this._internalAbstractMeshDataInfo._facetData.facetParameters;\n          }, X.prototype.disableFacetData = function() {\n            var j = this._internalAbstractMeshDataInfo._facetData;\n            return j.facetDataEnabled && (j.facetDataEnabled = !1, j.facetPositions = new Array(), j.facetNormals = new Array(), j.facetPartitioning = new Array(), j.facetParameters = null, j.depthSortedIndices = new Uint32Array(0)), this;\n          }, X.prototype.updateIndices = function(j, ne, te) {\n            return this;\n          }, X.prototype.createNormals = function(j) {\n            var ne, te = this.getVerticesData(O.b.PositionKind), de = this.getIndices();\n            return ne = this.isVerticesDataPresent(O.b.NormalKind) ? this.getVerticesData(O.b.NormalKind) : [], x.a.ComputeNormals(te, de, ne, { useRightHandedSystem: this.getScene().useRightHandedSystem }), this.setVerticesData(O.b.NormalKind, ne, j), this;\n          }, X.prototype.alignWithNormal = function(j, ne) {\n            ne || (ne = b.a.Y);\n            var te = u.c.Vector3[0], de = u.c.Vector3[1];\n            return u.e.CrossToRef(ne, j, de), u.e.CrossToRef(j, de, te), this.rotationQuaternion ? u.b.RotationQuaternionFromAxisToRef(te, j, de, this.rotationQuaternion) : u.e.RotationFromAxisToRef(te, j, de, this.rotation), this;\n          }, X.prototype._checkOcclusionQuery = function() {\n            return !1;\n          }, X.prototype.disableEdgesRendering = function() {\n            throw g.a.WarnImport(\"EdgesRenderer\");\n          }, X.prototype.enableEdgesRendering = function(j, ne, te) {\n            throw g.a.WarnImport(\"EdgesRenderer\");\n          }, X.prototype.getConnectedParticleSystems = function() {\n            var j = this;\n            return this._scene.particleSystems.filter(function(ne) {\n              return ne.emitter === j;\n            });\n          }, X.OCCLUSION_TYPE_NONE = 0, X.OCCLUSION_TYPE_OPTIMISTIC = 1, X.OCCLUSION_TYPE_STRICT = 2, X.OCCLUSION_ALGORITHM_TYPE_ACCURATE = 0, X.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE = 1, X.CULLINGSTRATEGY_STANDARD = S.a.MESHES_CULLINGSTRATEGY_STANDARD, X.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY = S.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, X.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION = S.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION, X.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY = S.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY, X;\n        }(m.a);\n        D.a.RegisteredTypes[\"BABYLON.AbstractMesh\"] = M;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(8), _ = f(44), C = f(0), u = f(31), I = f(7), O = f(50), x = f(23);\n        I.a._PhysicsImpostorParser = function(c, T, S) {\n          return new m(T, S.physicsImpostor, { mass: S.physicsMass, friction: S.physicsFriction, restitution: S.physicsRestitution }, c);\n        };\n        var m = function() {\n          function c(T, S, E, g) {\n            var l = this;\n            E === void 0 && (E = { mass: 0 }), this.object = T, this.type = S, this._options = E, this._scene = g, this._pluginData = {}, this._bodyUpdateRequired = !1, this._onBeforePhysicsStepCallbacks = new Array(), this._onAfterPhysicsStepCallbacks = new Array(), this._onPhysicsCollideCallbacks = [], this._deltaPosition = C.e.Zero(), this._isDisposed = !1, this.soft = !1, this.segments = 0, this._tmpQuat = new C.b(), this._tmpQuat2 = new C.b(), this.beforeStep = function() {\n              l._physicsEngine && (l.object.translate(l._deltaPosition, -1), l._deltaRotationConjugated && l.object.rotationQuaternion && l.object.rotationQuaternion.multiplyToRef(l._deltaRotationConjugated, l.object.rotationQuaternion), l.object.computeWorldMatrix(!1), l.object.parent && l.object.rotationQuaternion ? (l.getParentsRotation(), l._tmpQuat.multiplyToRef(l.object.rotationQuaternion, l._tmpQuat)) : l._tmpQuat.copyFrom(l.object.rotationQuaternion || new C.b()), l._options.disableBidirectionalTransformation || l.object.rotationQuaternion && l._physicsEngine.getPhysicsPlugin().setPhysicsBodyTransformation(l, l.object.getAbsolutePosition(), l._tmpQuat), l._onBeforePhysicsStepCallbacks.forEach(function(h) {\n                h(l);\n              }));\n            }, this.afterStep = function() {\n              l._physicsEngine && (l._onAfterPhysicsStepCallbacks.forEach(function(h) {\n                h(l);\n              }), l._physicsEngine.getPhysicsPlugin().setTransformationFromPhysicsBody(l), l.object.parent && l.object.rotationQuaternion && (l.getParentsRotation(), l._tmpQuat.conjugateInPlace(), l._tmpQuat.multiplyToRef(l.object.rotationQuaternion, l.object.rotationQuaternion)), l.object.setAbsolutePosition(l.object.position), l._deltaRotation && l.object.rotationQuaternion && l.object.rotationQuaternion.multiplyToRef(l._deltaRotation, l.object.rotationQuaternion), l.object.translate(l._deltaPosition, 1));\n            }, this.onCollideEvent = null, this.onCollide = function(h) {\n              if ((l._onPhysicsCollideCallbacks.length || l.onCollideEvent) && l._physicsEngine) {\n                var v = l._physicsEngine.getImpostorWithPhysicsBody(h.body);\n                v && (l.onCollideEvent && l.onCollideEvent(l, v), l._onPhysicsCollideCallbacks.filter(function(b) {\n                  return b.otherImpostors.indexOf(v) !== -1;\n                }).forEach(function(b) {\n                  b.callback(l, v, h.point);\n                }));\n              }\n            }, this.object ? (this.object.parent && E.mass !== 0 && V.a.Warn(\"A physics impostor has been created for an object which has a parent. Babylon physics currently works in local space so unexpected issues may occur.\"), !this._scene && T.getScene && (this._scene = T.getScene()), this._scene && (this.type > 100 && (this.soft = !0), this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine ? (this.object.rotationQuaternion || (this.object.rotation ? this.object.rotationQuaternion = C.b.RotationYawPitchRoll(this.object.rotation.y, this.object.rotation.x, this.object.rotation.z) : this.object.rotationQuaternion = new C.b()), this._options.mass = E.mass === void 0 ? 0 : E.mass, this._options.friction = E.friction === void 0 ? 0.2 : E.friction, this._options.restitution = E.restitution === void 0 ? 0.2 : E.restitution, this.soft && (this._options.mass = this._options.mass > 0 ? this._options.mass : 1, this._options.pressure = E.pressure === void 0 ? 200 : E.pressure, this._options.stiffness = E.stiffness === void 0 ? 1 : E.stiffness, this._options.velocityIterations = E.velocityIterations === void 0 ? 20 : E.velocityIterations, this._options.positionIterations = E.positionIterations === void 0 ? 20 : E.positionIterations, this._options.fixedPoints = E.fixedPoints === void 0 ? 0 : E.fixedPoints, this._options.margin = E.margin === void 0 ? 0 : E.margin, this._options.damping = E.damping === void 0 ? 0 : E.damping, this._options.path = E.path === void 0 ? null : E.path, this._options.shape = E.shape === void 0 ? null : E.shape), this._joints = [], !this.object.parent || this._options.ignoreParent ? this._init() : this.object.parent.physicsImpostor && V.a.Warn(\"You must affect impostors to children before affecting impostor to parent.\")) : V.a.Error(\"Physics not enabled. Please use scene.enablePhysics(...) before creating impostors.\"))) : V.a.Error(\"No object was provided. A physics object is obligatory\");\n          }\n          return Object.defineProperty(c.prototype, \"isDisposed\", { get: function() {\n            return this._isDisposed;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"mass\", { get: function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyMass(this) : 0;\n          }, set: function(T) {\n            this.setMass(T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"friction\", { get: function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyFriction(this) : 0;\n          }, set: function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyFriction(this, T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"restitution\", { get: function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getBodyRestitution(this) : 0;\n          }, set: function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyRestitution(this, T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"pressure\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.setBodyPressure ? T.getBodyPressure(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyPressure && S.setBodyPressure(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"stiffness\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.getBodyStiffness ? T.getBodyStiffness(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyStiffness && S.setBodyStiffness(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"velocityIterations\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.getBodyVelocityIterations ? T.getBodyVelocityIterations(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyVelocityIterations && S.setBodyVelocityIterations(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"positionIterations\", { get: function() {\n            if (!this._physicsEngine)\n              return 0;\n            var T = this._physicsEngine.getPhysicsPlugin();\n            return T.getBodyPositionIterations ? T.getBodyPositionIterations(this) : 0;\n          }, set: function(T) {\n            if (this._physicsEngine) {\n              var S = this._physicsEngine.getPhysicsPlugin();\n              S.setBodyPositionIterations && S.setBodyPositionIterations(this, T);\n            }\n          }, enumerable: !1, configurable: !0 }), c.prototype._init = function() {\n            this._physicsEngine && (this._physicsEngine.removeImpostor(this), this.physicsBody = null, this._parent = this._parent || this._getPhysicsParent(), this._isDisposed || this.parent && !this._options.ignoreParent || this._physicsEngine.addImpostor(this));\n          }, c.prototype._getPhysicsParent = function() {\n            return this.object.parent instanceof u.a ? this.object.parent.physicsImpostor : null;\n          }, c.prototype.isBodyInitRequired = function() {\n            return this._bodyUpdateRequired || !this._physicsBody && !this._parent;\n          }, c.prototype.setScalingUpdated = function() {\n            this.forceUpdate();\n          }, c.prototype.forceUpdate = function() {\n            this._init(), this.parent && !this._options.ignoreParent && this.parent.forceUpdate();\n          }, Object.defineProperty(c.prototype, \"physicsBody\", { get: function() {\n            return this._parent && !this._options.ignoreParent ? this._parent.physicsBody : this._physicsBody;\n          }, set: function(T) {\n            this._physicsBody && this._physicsEngine && this._physicsEngine.getPhysicsPlugin().removePhysicsBody(this), this._physicsBody = T, this.resetUpdateFlags();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"parent\", { get: function() {\n            return !this._options.ignoreParent && this._parent ? this._parent : null;\n          }, set: function(T) {\n            this._parent = T;\n          }, enumerable: !1, configurable: !0 }), c.prototype.resetUpdateFlags = function() {\n            this._bodyUpdateRequired = !1;\n          }, c.prototype.getObjectExtendSize = function() {\n            if (this.object.getBoundingInfo) {\n              var T = this.object.rotationQuaternion, S = this.object.scaling.clone();\n              this.object.rotationQuaternion = c.IDENTITY_QUATERNION;\n              var E = this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0);\n              E && E.decompose(S, void 0, void 0);\n              var g = this.object.getBoundingInfo().boundingBox.extendSize.scale(2).multiplyInPlace(S);\n              return this.object.rotationQuaternion = T, this.object.computeWorldMatrix && this.object.computeWorldMatrix(!0), g;\n            }\n            return c.DEFAULT_OBJECT_SIZE;\n          }, c.prototype.getObjectCenter = function() {\n            return this.object.getBoundingInfo ? this.object.getBoundingInfo().boundingBox.centerWorld : this.object.position;\n          }, c.prototype.getParam = function(T) {\n            return this._options[T];\n          }, c.prototype.setParam = function(T, S) {\n            this._options[T] = S, this._bodyUpdateRequired = !0;\n          }, c.prototype.setMass = function(T) {\n            this.getParam(\"mass\") !== T && this.setParam(\"mass\", T), this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setBodyMass(this, T);\n          }, c.prototype.getLinearVelocity = function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getLinearVelocity(this) : C.e.Zero();\n          }, c.prototype.setLinearVelocity = function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setLinearVelocity(this, T);\n          }, c.prototype.getAngularVelocity = function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getAngularVelocity(this) : C.e.Zero();\n          }, c.prototype.setAngularVelocity = function(T) {\n            this._physicsEngine && this._physicsEngine.getPhysicsPlugin().setAngularVelocity(this, T);\n          }, c.prototype.executeNativeFunction = function(T) {\n            this._physicsEngine && T(this._physicsEngine.getPhysicsPlugin().world, this.physicsBody);\n          }, c.prototype.registerBeforePhysicsStep = function(T) {\n            this._onBeforePhysicsStepCallbacks.push(T);\n          }, c.prototype.unregisterBeforePhysicsStep = function(T) {\n            var S = this._onBeforePhysicsStepCallbacks.indexOf(T);\n            S > -1 ? this._onBeforePhysicsStepCallbacks.splice(S, 1) : V.a.Warn(\"Function to remove was not found\");\n          }, c.prototype.registerAfterPhysicsStep = function(T) {\n            this._onAfterPhysicsStepCallbacks.push(T);\n          }, c.prototype.unregisterAfterPhysicsStep = function(T) {\n            var S = this._onAfterPhysicsStepCallbacks.indexOf(T);\n            S > -1 ? this._onAfterPhysicsStepCallbacks.splice(S, 1) : V.a.Warn(\"Function to remove was not found\");\n          }, c.prototype.registerOnPhysicsCollide = function(T, S) {\n            var E = T instanceof Array ? T : [T];\n            this._onPhysicsCollideCallbacks.push({ callback: S, otherImpostors: E });\n          }, c.prototype.unregisterOnPhysicsCollide = function(T, S) {\n            var E = T instanceof Array ? T : [T], g = -1;\n            this._onPhysicsCollideCallbacks.some(function(l, h) {\n              if (l.callback === S && l.otherImpostors.length === E.length) {\n                var v = l.otherImpostors.every(function(b) {\n                  return E.indexOf(b) > -1;\n                });\n                return v && (g = h), v;\n              }\n              return !1;\n            }) ? this._onPhysicsCollideCallbacks.splice(g, 1) : V.a.Warn(\"Function to remove was not found\");\n          }, c.prototype.getParentsRotation = function() {\n            var T = this.object.parent;\n            for (this._tmpQuat.copyFromFloats(0, 0, 0, 1); T; )\n              T.rotationQuaternion ? this._tmpQuat2.copyFrom(T.rotationQuaternion) : C.b.RotationYawPitchRollToRef(T.rotation.y, T.rotation.x, T.rotation.z, this._tmpQuat2), this._tmpQuat.multiplyToRef(this._tmpQuat2, this._tmpQuat), T = T.parent;\n            return this._tmpQuat;\n          }, c.prototype.applyForce = function(T, S) {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyForce(this, T, S), this;\n          }, c.prototype.applyImpulse = function(T, S) {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().applyImpulse(this, T, S), this;\n          }, c.prototype.createJoint = function(T, S, E) {\n            var g = new O.e(S, E);\n            return this.addJoint(T, g), this;\n          }, c.prototype.addJoint = function(T, S) {\n            return this._joints.push({ otherImpostor: T, joint: S }), this._physicsEngine && this._physicsEngine.addJoint(this, T, S), this;\n          }, c.prototype.addAnchor = function(T, S, E, g, l) {\n            if (!this._physicsEngine)\n              return this;\n            var h = this._physicsEngine.getPhysicsPlugin();\n            return h.appendAnchor ? (this._physicsEngine && h.appendAnchor(this, T, S, E, g, l), this) : this;\n          }, c.prototype.addHook = function(T, S, E, g) {\n            if (!this._physicsEngine)\n              return this;\n            var l = this._physicsEngine.getPhysicsPlugin();\n            return l.appendAnchor ? (this._physicsEngine && l.appendHook(this, T, S, E, g), this) : this;\n          }, c.prototype.sleep = function() {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().sleepBody(this), this;\n          }, c.prototype.wakeUp = function() {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().wakeUpBody(this), this;\n          }, c.prototype.clone = function(T) {\n            return T ? new c(T, this.type, this._options, this._scene) : null;\n          }, c.prototype.dispose = function() {\n            var T = this;\n            this._physicsEngine && (this._joints.forEach(function(S) {\n              T._physicsEngine && T._physicsEngine.removeJoint(T, S.otherImpostor, S.joint);\n            }), this._physicsEngine.removeImpostor(this), this.parent && this.parent.forceUpdate(), this._isDisposed = !0);\n          }, c.prototype.setDeltaPosition = function(T) {\n            this._deltaPosition.copyFrom(T);\n          }, c.prototype.setDeltaRotation = function(T) {\n            this._deltaRotation || (this._deltaRotation = new C.b()), this._deltaRotation.copyFrom(T), this._deltaRotationConjugated = this._deltaRotation.conjugate();\n          }, c.prototype.getBoxSizeToRef = function(T) {\n            return this._physicsEngine && this._physicsEngine.getPhysicsPlugin().getBoxSizeToRef(this, T), this;\n          }, c.prototype.getRadius = function() {\n            return this._physicsEngine ? this._physicsEngine.getPhysicsPlugin().getRadius(this) : 0;\n          }, c.prototype.syncBoneWithImpostor = function(T, S, E, g, l) {\n            var h = c._tmpVecs[0], v = this.object;\n            if (v.rotationQuaternion)\n              if (l) {\n                var b = c._tmpQuat;\n                v.rotationQuaternion.multiplyToRef(l, b), T.setRotationQuaternion(b, x.c.WORLD, S);\n              } else\n                T.setRotationQuaternion(v.rotationQuaternion, x.c.WORLD, S);\n            h.x = 0, h.y = 0, h.z = 0, E && (h.x = E.x, h.y = E.y, h.z = E.z, T.getDirectionToRef(h, S, h), g == null && (g = E.length()), h.x *= g, h.y *= g, h.z *= g), T.getParent() ? (h.addInPlace(v.getAbsolutePosition()), T.setAbsolutePosition(h, S)) : (S.setAbsolutePosition(v.getAbsolutePosition()), S.position.x -= h.x, S.position.y -= h.y, S.position.z -= h.z);\n          }, c.prototype.syncImpostorWithBone = function(T, S, E, g, l, h) {\n            var v = this.object;\n            if (v.rotationQuaternion)\n              if (l) {\n                var b = c._tmpQuat;\n                T.getRotationQuaternionToRef(x.c.WORLD, S, b), b.multiplyToRef(l, v.rotationQuaternion);\n              } else\n                T.getRotationQuaternionToRef(x.c.WORLD, S, v.rotationQuaternion);\n            var D = c._tmpVecs[0], w = c._tmpVecs[1];\n            h || ((h = c._tmpVecs[2]).x = 0, h.y = 1, h.z = 0), T.getDirectionToRef(h, S, w), T.getAbsolutePositionToRef(S, D), g == null && E && (g = E.length()), g != null && (D.x += w.x * g, D.y += w.y * g, D.z += w.z * g), v.setAbsolutePosition(D);\n          }, c.DEFAULT_OBJECT_SIZE = new C.e(1, 1, 1), c.IDENTITY_QUATERNION = C.b.Identity(), c._tmpVecs = _.a.BuildArray(3, C.e.Zero), c._tmpQuat = C.b.Identity(), c.NoImpostor = 0, c.SphereImpostor = 1, c.BoxImpostor = 2, c.PlaneImpostor = 3, c.MeshImpostor = 4, c.CapsuleImpostor = 6, c.CylinderImpostor = 7, c.ParticleImpostor = 8, c.HeightmapImpostor = 9, c.ConvexHullImpostor = 10, c.CustomImpostor = 100, c.RopeImpostor = 101, c.ClothImpostor = 102, c.SoftbodyImpostor = 103, c;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(1), _ = function() {\n          function u(I) {\n            this.length = 0, this.data = new Array(I), this._id = u._GlobalId++;\n          }\n          return u.prototype.push = function(I) {\n            this.data[this.length++] = I, this.length > this.data.length && (this.data.length *= 2);\n          }, u.prototype.forEach = function(I) {\n            for (var O = 0; O < this.length; O++)\n              I(this.data[O]);\n          }, u.prototype.sort = function(I) {\n            this.data.sort(I);\n          }, u.prototype.reset = function() {\n            this.length = 0;\n          }, u.prototype.dispose = function() {\n            this.reset(), this.data && (this.data.length = 0, this.data = []);\n          }, u.prototype.concat = function(I) {\n            if (I.length !== 0) {\n              this.length + I.length > this.data.length && (this.data.length = 2 * (this.length + I.length));\n              for (var O = 0; O < I.length; O++)\n                this.data[this.length++] = (I.data || I)[O];\n            }\n          }, u.prototype.indexOf = function(I) {\n            var O = this.data.indexOf(I);\n            return O >= this.length ? -1 : O;\n          }, u.prototype.contains = function(I) {\n            return this.indexOf(I) !== -1;\n          }, u._GlobalId = 0, u;\n        }(), C = function(u) {\n          function I() {\n            var O = u !== null && u.apply(this, arguments) || this;\n            return O._duplicateId = 0, O;\n          }\n          return Object(V.d)(I, u), I.prototype.push = function(O) {\n            u.prototype.push.call(this, O), O.__smartArrayFlags || (O.__smartArrayFlags = {}), O.__smartArrayFlags[this._id] = this._duplicateId;\n          }, I.prototype.pushNoDuplicate = function(O) {\n            return (!O.__smartArrayFlags || O.__smartArrayFlags[this._id] !== this._duplicateId) && (this.push(O), !0);\n          }, I.prototype.reset = function() {\n            u.prototype.reset.call(this), this._duplicateId++;\n          }, I.prototype.concatWithNoDuplicate = function(O) {\n            if (O.length !== 0) {\n              this.length + O.length > this.data.length && (this.data.length = 2 * (this.length + O.length));\n              for (var x = 0; x < O.length; x++) {\n                var m = (O.data || O)[x];\n                this.pushNoDuplicate(m);\n              }\n            }\n          }, I;\n        }(_);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.EndsWith = function(C, u) {\n            return C.indexOf(u, C.length - u.length) !== -1;\n          }, _.StartsWith = function(C, u) {\n            return !!C && C.indexOf(u) === 0;\n          }, _.Decode = function(C) {\n            if (typeof TextDecoder < \"u\")\n              return new TextDecoder().decode(C);\n            for (var u = \"\", I = 0; I < C.byteLength; I++)\n              u += String.fromCharCode(C[I]);\n            return u;\n          }, _.EncodeArrayBufferToBase64 = function(C) {\n            for (var u, I, O, x, m, c, T, S = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\", E = \"\", g = 0, l = ArrayBuffer.isView(C) ? new Uint8Array(C.buffer, C.byteOffset, C.byteLength) : new Uint8Array(C); g < l.length; )\n              x = (u = l[g++]) >> 2, m = (3 & u) << 4 | (I = g < l.length ? l[g++] : Number.NaN) >> 4, c = (15 & I) << 2 | (O = g < l.length ? l[g++] : Number.NaN) >> 6, T = 63 & O, isNaN(I) ? c = T = 64 : isNaN(O) && (T = 64), E += S.charAt(x) + S.charAt(m) + S.charAt(c) + S.charAt(T);\n            return E;\n          }, _.PadNumber = function(C, u) {\n            for (var I = String(C); I.length < u; )\n              I = \"0\" + I;\n            return I;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this.rootNodes = new Array(), this.cameras = new Array(), this.lights = new Array(), this.meshes = new Array(), this.skeletons = new Array(), this.particleSystems = new Array(), this.animations = [], this.animationGroups = new Array(), this.multiMaterials = new Array(), this.materials = new Array(), this.morphTargetManagers = new Array(), this.geometries = new Array(), this.transformNodes = new Array(), this.actionManagers = new Array(), this.textures = new Array(), this._environmentTexture = null, this.postProcesses = new Array();\n          }\n          return _.AddParser = function(C, u) {\n            this._BabylonFileParsers[C] = u;\n          }, _.GetParser = function(C) {\n            return this._BabylonFileParsers[C] ? this._BabylonFileParsers[C] : null;\n          }, _.AddIndividualParser = function(C, u) {\n            this._IndividualBabylonFileParsers[C] = u;\n          }, _.GetIndividualParser = function(C) {\n            return this._IndividualBabylonFileParsers[C] ? this._IndividualBabylonFileParsers[C] : null;\n          }, _.Parse = function(C, u, I, O) {\n            for (var x in this._BabylonFileParsers)\n              this._BabylonFileParsers.hasOwnProperty(x) && this._BabylonFileParsers[x](C, u, I, O);\n          }, Object.defineProperty(_.prototype, \"environmentTexture\", { get: function() {\n            return this._environmentTexture;\n          }, set: function(C) {\n            this._environmentTexture = C;\n          }, enumerable: !1, configurable: !0 }), _.prototype.getNodes = function() {\n            var C = new Array();\n            return C = (C = (C = (C = C.concat(this.meshes)).concat(this.lights)).concat(this.cameras)).concat(this.transformNodes), this.skeletons.forEach(function(u) {\n              return C = C.concat(u.bones);\n            }), C;\n          }, _._BabylonFileParsers = {}, _._IndividualBabylonFileParsers = {}, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(20), _ = f(6), C = f(18), u = f(22), I = f(86), O = f(0), x = f(9), m = function() {\n          function c(T, S) {\n            var E = this;\n            S === void 0 && (S = !0), this.originalScene = T, this._pointerCaptures = {}, this._lastPointerEvents = {}, this._sharedGizmoLight = null, this._renderCamera = null, this.pickUtilitySceneFirst = !0, this.shouldRender = !0, this.onlyCheckPointerDownEvents = !0, this.processAllEvents = !1, this.onPointerOutObservable = new _.c(), this.utilityLayerScene = new V.a(T.getEngine(), { virtual: !0 }), this.utilityLayerScene.useRightHandedSystem = T.useRightHandedSystem, this.utilityLayerScene._allowPostProcessClearColor = !1, this.utilityLayerScene.detachControl(), S && (this._originalPointerObserver = T.onPrePointerObservable.add(function(g, l) {\n              if (E.utilityLayerScene.activeCamera && (E.processAllEvents || g.type === C.a.POINTERMOVE || g.type === C.a.POINTERUP || g.type === C.a.POINTERDOWN || g.type === C.a.POINTERDOUBLETAP)) {\n                E.utilityLayerScene.pointerX = T.pointerX, E.utilityLayerScene.pointerY = T.pointerY;\n                var h = g.event;\n                if (T.isPointerCaptured(h.pointerId))\n                  E._pointerCaptures[h.pointerId] = !1;\n                else {\n                  var v = g.ray ? E.utilityLayerScene.pickWithRay(g.ray) : E.utilityLayerScene.pick(T.pointerX, T.pointerY);\n                  if (!g.ray && v && (g.ray = v.ray), E.utilityLayerScene.onPrePointerObservable.notifyObservers(g), E.onlyCheckPointerDownEvents && g.type != C.a.POINTERDOWN)\n                    return g.skipOnPointerObservable || E.utilityLayerScene.onPointerObservable.notifyObservers(new C.b(g.type, g.event, v), g.type), void (g.type === C.a.POINTERUP && E._pointerCaptures[h.pointerId] && (E._pointerCaptures[h.pointerId] = !1));\n                  if (E.utilityLayerScene.autoClearDepthAndStencil || E.pickUtilitySceneFirst)\n                    v && v.hit && (g.skipOnPointerObservable || E.utilityLayerScene.onPointerObservable.notifyObservers(new C.b(g.type, g.event, v), g.type), g.skipOnPointerObservable = !0);\n                  else {\n                    var b = g.ray ? T.pickWithRay(g.ray) : T.pick(T.pointerX, T.pointerY), D = g.event;\n                    b && v && (v.distance === 0 && b.pickedMesh ? E.mainSceneTrackerPredicate && E.mainSceneTrackerPredicate(b.pickedMesh) ? (E._notifyObservers(g, b, D), g.skipOnPointerObservable = !0) : g.type === C.a.POINTERDOWN ? E._pointerCaptures[D.pointerId] = !0 : E._lastPointerEvents[D.pointerId] && (E.onPointerOutObservable.notifyObservers(D.pointerId), delete E._lastPointerEvents[D.pointerId]) : !E._pointerCaptures[D.pointerId] && (v.distance < b.distance || b.distance === 0) ? (E._notifyObservers(g, v, D), g.skipOnPointerObservable || (g.skipOnPointerObservable = v.distance > 0)) : !E._pointerCaptures[D.pointerId] && v.distance > b.distance && (E.mainSceneTrackerPredicate && E.mainSceneTrackerPredicate(b.pickedMesh) ? (E._notifyObservers(g, b, D), g.skipOnPointerObservable = !0) : E._lastPointerEvents[D.pointerId] && (E.onPointerOutObservable.notifyObservers(D.pointerId), delete E._lastPointerEvents[D.pointerId])), g.type === C.a.POINTERUP && E._pointerCaptures[D.pointerId] && (E._pointerCaptures[D.pointerId] = !1));\n                  }\n                }\n              }\n            }), this._originalPointerObserver && T.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)), this.utilityLayerScene.autoClear = !1, this._afterRenderObserver = this.originalScene.onAfterCameraRenderObservable.add(function(g) {\n              E.shouldRender && g == E.getRenderCamera() && E.render();\n            }), this._sceneDisposeObserver = this.originalScene.onDisposeObservable.add(function() {\n              E.dispose();\n            }), this._updateCamera();\n          }\n          return c.prototype.getRenderCamera = function(T) {\n            if (this._renderCamera)\n              return this._renderCamera;\n            var S = void 0;\n            return S = this.originalScene.activeCameras && this.originalScene.activeCameras.length > 1 ? this.originalScene.activeCameras[this.originalScene.activeCameras.length - 1] : this.originalScene.activeCamera, T && S && S.isRigCamera ? S.rigParent : S;\n          }, c.prototype.setRenderCamera = function(T) {\n            this._renderCamera = T;\n          }, c.prototype._getSharedGizmoLight = function() {\n            return this._sharedGizmoLight || (this._sharedGizmoLight = new I.a(\"shared gizmo light\", new O.e(0, 1, 0), this.utilityLayerScene), this._sharedGizmoLight.intensity = 2, this._sharedGizmoLight.groundColor = x.a.Gray()), this._sharedGizmoLight;\n          }, Object.defineProperty(c, \"DefaultUtilityLayer\", { get: function() {\n            return c._DefaultUtilityLayer == null && (c._DefaultUtilityLayer = new c(u.a.LastCreatedScene), c._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(function() {\n              c._DefaultUtilityLayer = null;\n            })), c._DefaultUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c, \"DefaultKeepDepthUtilityLayer\", { get: function() {\n            return c._DefaultKeepDepthUtilityLayer == null && (c._DefaultKeepDepthUtilityLayer = new c(u.a.LastCreatedScene), c._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, c._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(function() {\n              c._DefaultKeepDepthUtilityLayer = null;\n            })), c._DefaultKeepDepthUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), c.prototype._notifyObservers = function(T, S, E) {\n            T.skipOnPointerObservable || (this.utilityLayerScene.onPointerObservable.notifyObservers(new C.b(T.type, T.event, S), T.type), this._lastPointerEvents[E.pointerId] = !0);\n          }, c.prototype.render = function() {\n            if (this._updateCamera(), this.utilityLayerScene.activeCamera) {\n              var T = this.utilityLayerScene.activeCamera.getScene(), S = this.utilityLayerScene.activeCamera;\n              S._scene = this.utilityLayerScene, S.leftCamera && (S.leftCamera._scene = this.utilityLayerScene), S.rightCamera && (S.rightCamera._scene = this.utilityLayerScene), this.utilityLayerScene.render(!1), S._scene = T, S.leftCamera && (S.leftCamera._scene = T), S.rightCamera && (S.rightCamera._scene = T);\n            }\n          }, c.prototype.dispose = function() {\n            this.onPointerOutObservable.clear(), this._afterRenderObserver && this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver), this._sceneDisposeObserver && this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver), this._originalPointerObserver && this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver), this.utilityLayerScene.dispose();\n          }, c.prototype._updateCamera = function() {\n            this.utilityLayerScene.cameraToUseForPointers = this.getRenderCamera(), this.utilityLayerScene.activeCamera = this.getRenderCamera();\n          }, c._DefaultUtilityLayer = null, c._DefaultKeepDepthUtilityLayer = null, c;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(139), _ = function() {\n          function C() {\n          }\n          return C.EnableFor = function(u) {\n            u._tags = u._tags || {}, u.hasTags = function() {\n              return C.HasTags(u);\n            }, u.addTags = function(I) {\n              return C.AddTagsTo(u, I);\n            }, u.removeTags = function(I) {\n              return C.RemoveTagsFrom(u, I);\n            }, u.matchesTagsQuery = function(I) {\n              return C.MatchesQuery(u, I);\n            };\n          }, C.DisableFor = function(u) {\n            delete u._tags, delete u.hasTags, delete u.addTags, delete u.removeTags, delete u.matchesTagsQuery;\n          }, C.HasTags = function(u) {\n            if (!u._tags)\n              return !1;\n            var I = u._tags;\n            for (var O in I)\n              if (I.hasOwnProperty(O))\n                return !0;\n            return !1;\n          }, C.GetTags = function(u, I) {\n            if (I === void 0 && (I = !0), !u._tags)\n              return null;\n            if (I) {\n              var O = [];\n              for (var x in u._tags)\n                u._tags.hasOwnProperty(x) && u._tags[x] === !0 && O.push(x);\n              return O.join(\" \");\n            }\n            return u._tags;\n          }, C.AddTagsTo = function(u, I) {\n            I && typeof I == \"string\" && I.split(\" \").forEach(function(O, x, m) {\n              C._AddTagTo(u, O);\n            });\n          }, C._AddTagTo = function(u, I) {\n            (I = I.trim()) !== \"\" && I !== \"true\" && I !== \"false\" && (I.match(/[\\s]/) || I.match(/^([!]|([|]|[&]){2})/) || (C.EnableFor(u), u._tags[I] = !0));\n          }, C.RemoveTagsFrom = function(u, I) {\n            if (C.HasTags(u)) {\n              var O = I.split(\" \");\n              for (var x in O)\n                C._RemoveTagFrom(u, O[x]);\n            }\n          }, C._RemoveTagFrom = function(u, I) {\n            delete u._tags[I];\n          }, C.MatchesQuery = function(u, I) {\n            return I === void 0 || (I === \"\" ? C.HasTags(u) : V.a.Eval(I, function(O) {\n              return C.HasTags(u) && u._tags[O];\n            }));\n          }, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.IsWindowObjectExist = function() {\n            return typeof window < \"u\";\n          }, _.IsNavigatorAvailable = function() {\n            return typeof navigator < \"u\";\n          }, _.IsDocumentAvailable = function() {\n            return typeof document < \"u\";\n          }, _.GetDOMTextContent = function(C) {\n            for (var u = \"\", I = C.firstChild; I; )\n              I.nodeType === 3 && (u += I.textContent), I = I.nextSibling;\n            return u;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(44), _ = f(0), C = f(54), u = f(114), I = f(20), O = f(24), x = function() {\n          function m(c, T, S) {\n            S === void 0 && (S = Number.MAX_VALUE), this.origin = c, this.direction = T, this.length = S;\n          }\n          return m.prototype.intersectsBoxMinMax = function(c, T, S) {\n            S === void 0 && (S = 0);\n            var E, g, l, h, v = m._TmpVector3[0].copyFromFloats(c.x - S, c.y - S, c.z - S), b = m._TmpVector3[1].copyFromFloats(T.x + S, T.y + S, T.z + S), D = 0, w = Number.MAX_VALUE;\n            if (Math.abs(this.direction.x) < 1e-7) {\n              if (this.origin.x < v.x || this.origin.x > b.x)\n                return !1;\n            } else if (E = 1 / this.direction.x, g = (v.x - this.origin.x) * E, (l = (b.x - this.origin.x) * E) === -1 / 0 && (l = 1 / 0), g > l && (h = g, g = l, l = h), (D = Math.max(g, D)) > (w = Math.min(l, w)))\n              return !1;\n            if (Math.abs(this.direction.y) < 1e-7) {\n              if (this.origin.y < v.y || this.origin.y > b.y)\n                return !1;\n            } else if (E = 1 / this.direction.y, g = (v.y - this.origin.y) * E, (l = (b.y - this.origin.y) * E) === -1 / 0 && (l = 1 / 0), g > l && (h = g, g = l, l = h), (D = Math.max(g, D)) > (w = Math.min(l, w)))\n              return !1;\n            if (Math.abs(this.direction.z) < 1e-7) {\n              if (this.origin.z < v.z || this.origin.z > b.z)\n                return !1;\n            } else if (E = 1 / this.direction.z, g = (v.z - this.origin.z) * E, (l = (b.z - this.origin.z) * E) === -1 / 0 && (l = 1 / 0), g > l && (h = g, g = l, l = h), (D = Math.max(g, D)) > (w = Math.min(l, w)))\n              return !1;\n            return !0;\n          }, m.prototype.intersectsBox = function(c, T) {\n            return T === void 0 && (T = 0), this.intersectsBoxMinMax(c.minimum, c.maximum, T);\n          }, m.prototype.intersectsSphere = function(c, T) {\n            T === void 0 && (T = 0);\n            var S = c.center.x - this.origin.x, E = c.center.y - this.origin.y, g = c.center.z - this.origin.z, l = S * S + E * E + g * g, h = c.radius + T, v = h * h;\n            if (l <= v)\n              return !0;\n            var b = S * this.direction.x + E * this.direction.y + g * this.direction.z;\n            return !(b < 0) && l - b * b <= v;\n          }, m.prototype.intersectsTriangle = function(c, T, S) {\n            var E = m._TmpVector3[0], g = m._TmpVector3[1], l = m._TmpVector3[2], h = m._TmpVector3[3], v = m._TmpVector3[4];\n            T.subtractToRef(c, E), S.subtractToRef(c, g), _.e.CrossToRef(this.direction, g, l);\n            var b = _.e.Dot(E, l);\n            if (b === 0)\n              return null;\n            var D = 1 / b;\n            this.origin.subtractToRef(c, h);\n            var w = _.e.Dot(h, l) * D;\n            if (w < 0 || w > 1)\n              return null;\n            _.e.CrossToRef(h, E, v);\n            var N = _.e.Dot(this.direction, v) * D;\n            if (N < 0 || w + N > 1)\n              return null;\n            var M = _.e.Dot(g, v) * D;\n            return M > this.length ? null : new u.a(1 - w - N, w, M);\n          }, m.prototype.intersectsPlane = function(c) {\n            var T, S = _.e.Dot(c.normal, this.direction);\n            if (Math.abs(S) < 999999997475243e-21)\n              return null;\n            var E = _.e.Dot(c.normal, this.origin);\n            return (T = (-c.d - E) / S) < 0 ? T < -999999997475243e-21 ? null : 0 : T;\n          }, m.prototype.intersectsAxis = function(c, T) {\n            switch (T === void 0 && (T = 0), c) {\n              case \"y\":\n                return (S = (this.origin.y - T) / this.direction.y) > 0 ? null : new _.e(this.origin.x + this.direction.x * -S, T, this.origin.z + this.direction.z * -S);\n              case \"x\":\n                return (S = (this.origin.x - T) / this.direction.x) > 0 ? null : new _.e(T, this.origin.y + this.direction.y * -S, this.origin.z + this.direction.z * -S);\n              case \"z\":\n                var S;\n                return (S = (this.origin.z - T) / this.direction.z) > 0 ? null : new _.e(this.origin.x + this.direction.x * -S, this.origin.y + this.direction.y * -S, T);\n              default:\n                return null;\n            }\n          }, m.prototype.intersectsMesh = function(c, T) {\n            var S = _.c.Matrix[0];\n            return c.getWorldMatrix().invertToRef(S), this._tmpRay ? m.TransformToRef(this, S, this._tmpRay) : this._tmpRay = m.Transform(this, S), c.intersects(this._tmpRay, T);\n          }, m.prototype.intersectsMeshes = function(c, T, S) {\n            S ? S.length = 0 : S = [];\n            for (var E = 0; E < c.length; E++) {\n              var g = this.intersectsMesh(c[E], T);\n              g.hit && S.push(g);\n            }\n            return S.sort(this._comparePickingInfo), S;\n          }, m.prototype._comparePickingInfo = function(c, T) {\n            return c.distance < T.distance ? -1 : c.distance > T.distance ? 1 : 0;\n          }, m.prototype.intersectionSegment = function(c, T, S) {\n            var E = this.origin, g = _.c.Vector3[0], l = _.c.Vector3[1], h = _.c.Vector3[2], v = _.c.Vector3[3];\n            T.subtractToRef(c, g), this.direction.scaleToRef(m.rayl, h), E.addToRef(h, l), c.subtractToRef(E, v);\n            var b, D, w, N, M = _.e.Dot(g, g), U = _.e.Dot(g, h), X = _.e.Dot(h, h), j = _.e.Dot(g, v), ne = _.e.Dot(h, v), te = M * X - U * U, de = te, pe = te;\n            te < m.smallnum ? (D = 0, de = 1, N = ne, pe = X) : (N = M * ne - U * j, (D = U * ne - X * j) < 0 ? (D = 0, N = ne, pe = X) : D > de && (D = de, N = ne + U, pe = X)), N < 0 ? (N = 0, -j < 0 ? D = 0 : -j > M ? D = de : (D = -j, de = M)) : N > pe && (N = pe, -j + U < 0 ? D = 0 : -j + U > M ? D = de : (D = -j + U, de = M)), b = Math.abs(D) < m.smallnum ? 0 : D / de, w = Math.abs(N) < m.smallnum ? 0 : N / pe;\n            var ae = _.c.Vector3[4];\n            h.scaleToRef(w, ae);\n            var ee = _.c.Vector3[5];\n            g.scaleToRef(b, ee), ee.addInPlace(v);\n            var K = _.c.Vector3[6];\n            return ee.subtractToRef(ae, K), w > 0 && w <= this.length && K.lengthSquared() < S * S ? ee.length() : -1;\n          }, m.prototype.update = function(c, T, S, E, g, l, h) {\n            return this.unprojectRayToRef(c, T, S, E, g, l, h), this;\n          }, m.Zero = function() {\n            return new m(_.e.Zero(), _.e.Zero());\n          }, m.CreateNew = function(c, T, S, E, g, l, h) {\n            return m.Zero().update(c, T, S, E, g, l, h);\n          }, m.CreateNewFromTo = function(c, T, S) {\n            S === void 0 && (S = _.a.IdentityReadOnly);\n            var E = T.subtract(c), g = Math.sqrt(E.x * E.x + E.y * E.y + E.z * E.z);\n            return E.normalize(), m.Transform(new m(c, E, g), S);\n          }, m.Transform = function(c, T) {\n            var S = new m(new _.e(0, 0, 0), new _.e(0, 0, 0));\n            return m.TransformToRef(c, T, S), S;\n          }, m.TransformToRef = function(c, T, S) {\n            _.e.TransformCoordinatesToRef(c.origin, T, S.origin), _.e.TransformNormalToRef(c.direction, T, S.direction), S.length = c.length;\n            var E = S.direction, g = E.length();\n            if (g !== 0 && g !== 1) {\n              var l = 1 / g;\n              E.x *= l, E.y *= l, E.z *= l, S.length *= g;\n            }\n          }, m.prototype.unprojectRayToRef = function(c, T, S, E, g, l, h) {\n            var v = _.c.Matrix[0];\n            g.multiplyToRef(l, v), v.multiplyToRef(h, v), v.invert();\n            var b = _.c.Vector3[0];\n            b.x = c / S * 2 - 1, b.y = -(T / E * 2 - 1), b.z = -1;\n            var D = _.c.Vector3[1].copyFromFloats(b.x, b.y, 1), w = _.c.Vector3[2], N = _.c.Vector3[3];\n            _.e._UnprojectFromInvertedMatrixToRef(b, v, w), _.e._UnprojectFromInvertedMatrixToRef(D, v, N), this.origin.copyFrom(w), N.subtractToRef(w, this.direction), this.direction.normalize();\n          }, m._TmpVector3 = V.a.BuildArray(6, _.e.Zero), m.smallnum = 1e-8, m.rayl = 1e9, m;\n        }();\n        I.a.prototype.createPickingRay = function(m, c, T, S, E) {\n          E === void 0 && (E = !1);\n          var g = x.Zero();\n          return this.createPickingRayToRef(m, c, T, g, S, E), g;\n        }, I.a.prototype.createPickingRayToRef = function(m, c, T, S, E, g) {\n          g === void 0 && (g = !1);\n          var l = this.getEngine();\n          if (!E) {\n            if (!this.activeCamera)\n              return this;\n            E = this.activeCamera;\n          }\n          var h = E.viewport.toGlobal(l.getRenderWidth(), l.getRenderHeight());\n          return m = m / l.getHardwareScalingLevel() - h.x, c = c / l.getHardwareScalingLevel() - (l.getRenderHeight() - h.y - h.height), S.update(m, c, h.width, h.height, T || _.a.IdentityReadOnly, g ? _.a.IdentityReadOnly : E.getViewMatrix(), E.getProjectionMatrix()), this;\n        }, I.a.prototype.createPickingRayInCameraSpace = function(m, c, T) {\n          var S = x.Zero();\n          return this.createPickingRayInCameraSpaceToRef(m, c, S, T), S;\n        }, I.a.prototype.createPickingRayInCameraSpaceToRef = function(m, c, T, S) {\n          if (!C.a)\n            return this;\n          var E = this.getEngine();\n          if (!S) {\n            if (!this.activeCamera)\n              throw new Error(\"Active camera not set\");\n            S = this.activeCamera;\n          }\n          var g = S.viewport.toGlobal(E.getRenderWidth(), E.getRenderHeight()), l = _.a.Identity();\n          return m = m / E.getHardwareScalingLevel() - g.x, c = c / E.getHardwareScalingLevel() - (E.getRenderHeight() - g.y - g.height), T.update(m, c, g.width, g.height, l, l, S.getProjectionMatrix()), this;\n        }, I.a.prototype._internalPickForMesh = function(m, c, T, S, E, g, l, h) {\n          var v = c(S), b = T.intersects(v, E, l, g, S, h);\n          return b && b.hit ? !E && m != null && b.distance >= m.distance ? null : b : null;\n        }, I.a.prototype._internalPick = function(m, c, T, S, E) {\n          if (!C.a)\n            return null;\n          for (var g = null, l = 0; l < this.meshes.length; l++) {\n            var h = this.meshes[l];\n            if (c) {\n              if (!c(h))\n                continue;\n            } else if (!h.isEnabled() || !h.isVisible || !h.isPickable)\n              continue;\n            var v, b = h.skeleton && h.skeleton.overrideMesh ? h.skeleton.overrideMesh.getWorldMatrix() : h.getWorldMatrix();\n            if (h.hasThinInstances && h.thinInstanceEnablePicking) {\n              if (v = this._internalPickForMesh(g, m, h, b, !0, !0, E)) {\n                if (S)\n                  return g;\n                for (var D = _.c.Matrix[1], w = h.thinInstanceGetWorldMatrices(), N = 0; N < w.length; N++) {\n                  w[N].multiplyToRef(b, D);\n                  var M = this._internalPickForMesh(g, m, h, D, T, S, E, !0);\n                  if (M && ((g = M).thinInstanceIndex = N, T))\n                    return g;\n                }\n              }\n            } else if ((v = this._internalPickForMesh(g, m, h, b, T, S, E)) && (g = v, T))\n              return g;\n          }\n          return g || new C.a();\n        }, I.a.prototype._internalMultiPick = function(m, c, T) {\n          if (!C.a)\n            return null;\n          for (var S = new Array(), E = 0; E < this.meshes.length; E++) {\n            var g = this.meshes[E];\n            if (c) {\n              if (!c(g))\n                continue;\n            } else if (!g.isEnabled() || !g.isVisible || !g.isPickable)\n              continue;\n            var l, h = g.skeleton && g.skeleton.overrideMesh ? g.skeleton.overrideMesh.getWorldMatrix() : g.getWorldMatrix();\n            if (g.hasThinInstances && g.thinInstanceEnablePicking) {\n              if (l = this._internalPickForMesh(null, m, g, h, !0, !0, T))\n                for (var v = _.c.Matrix[1], b = g.thinInstanceGetWorldMatrices(), D = 0; D < b.length; D++) {\n                  b[D].multiplyToRef(h, v);\n                  var w = this._internalPickForMesh(null, m, g, v, !1, !1, T, !0);\n                  w && (w.thinInstanceIndex = D, S.push(w));\n                }\n            } else\n              (l = this._internalPickForMesh(null, m, g, h, !1, !1, T)) && S.push(l);\n          }\n          return S;\n        }, I.a.prototype.pickWithBoundingInfo = function(m, c, T, S, E) {\n          var g = this;\n          if (!C.a)\n            return null;\n          var l = this._internalPick(function(h) {\n            return g._tempPickingRay || (g._tempPickingRay = x.Zero()), g.createPickingRayToRef(m, c, h, g._tempPickingRay, E || null), g._tempPickingRay;\n          }, T, S, !0);\n          return l && (l.ray = this.createPickingRay(m, c, _.a.Identity(), E || null)), l;\n        }, I.a.prototype.pick = function(m, c, T, S, E, g) {\n          var l = this;\n          if (!C.a)\n            return null;\n          var h = this._internalPick(function(v) {\n            return l._tempPickingRay || (l._tempPickingRay = x.Zero()), l.createPickingRayToRef(m, c, v, l._tempPickingRay, E || null), l._tempPickingRay;\n          }, T, S, !1, g);\n          return h && (h.ray = this.createPickingRay(m, c, _.a.Identity(), E || null)), h;\n        }, I.a.prototype.pickWithRay = function(m, c, T, S) {\n          var E = this, g = this._internalPick(function(l) {\n            return E._pickWithRayInverseMatrix || (E._pickWithRayInverseMatrix = _.a.Identity()), l.invertToRef(E._pickWithRayInverseMatrix), E._cachedRayForTransform || (E._cachedRayForTransform = x.Zero()), x.TransformToRef(m, E._pickWithRayInverseMatrix, E._cachedRayForTransform), E._cachedRayForTransform;\n          }, c, T, !1, S);\n          return g && (g.ray = m), g;\n        }, I.a.prototype.multiPick = function(m, c, T, S, E) {\n          var g = this;\n          return this._internalMultiPick(function(l) {\n            return g.createPickingRay(m, c, l, S || null);\n          }, T, E);\n        }, I.a.prototype.multiPickWithRay = function(m, c, T) {\n          var S = this;\n          return this._internalMultiPick(function(E) {\n            return S._pickWithRayInverseMatrix || (S._pickWithRayInverseMatrix = _.a.Identity()), E.invertToRef(S._pickWithRayInverseMatrix), S._cachedRayForTransform || (S._cachedRayForTransform = x.Zero()), x.TransformToRef(m, S._pickWithRayInverseMatrix, S._cachedRayForTransform), S._cachedRayForTransform;\n          }, c, T);\n        }, O.a.prototype.getForwardRay = function(m, c, T) {\n          return m === void 0 && (m = 100), this.getForwardRayToRef(new x(_.e.Zero(), _.e.Zero(), m), m, c, T);\n        }, O.a.prototype.getForwardRayToRef = function(m, c, T, S) {\n          return c === void 0 && (c = 100), T || (T = this.getWorldMatrix()), m.length = c, S ? m.origin.copyFrom(S) : m.origin.copyFrom(this.position), _.c.Vector3[2].set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), _.e.TransformNormalToRef(_.c.Vector3[2], T, _.c.Vector3[3]), _.e.NormalizeToRef(_.c.Vector3[3], m.direction), m;\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(0), _ = f(7), C = f(16), u = f(98), I = f(4);\n        C.a.CreateLineSystem = function(x) {\n          for (var m = [], c = [], T = x.lines, S = x.colors, E = [], g = 0, l = 0; l < T.length; l++)\n            for (var h = T[l], v = 0; v < h.length; v++) {\n              if (c.push(h[v].x, h[v].y, h[v].z), S) {\n                var b = S[l];\n                E.push(b[v].r, b[v].g, b[v].b, b[v].a);\n              }\n              v > 0 && (m.push(g - 1), m.push(g)), g++;\n            }\n          var D = new C.a();\n          return D.indices = m, D.positions = c, S && (D.colors = E), D;\n        }, C.a.CreateDashedLines = function(x) {\n          var m, c, T = x.dashSize || 3, S = x.gapSize || 1, E = x.dashNb || 200, g = x.points, l = new Array(), h = new Array(), v = V.e.Zero(), b = 0, D = 0, w = 0, N = 0, M = 0;\n          for (M = 0; M < g.length - 1; M++)\n            g[M + 1].subtractToRef(g[M], v), b += v.length();\n          for (c = T * (m = b / E) / (T + S), M = 0; M < g.length - 1; M++) {\n            g[M + 1].subtractToRef(g[M], v), D = Math.floor(v.length() / m), v.normalize();\n            for (var U = 0; U < D; U++)\n              w = m * U, l.push(g[M].x + w * v.x, g[M].y + w * v.y, g[M].z + w * v.z), l.push(g[M].x + (w + c) * v.x, g[M].y + (w + c) * v.y, g[M].z + (w + c) * v.z), h.push(N, N + 1), N += 2;\n          }\n          var X = new C.a();\n          return X.positions = l, X.indices = h, X;\n        }, _.a.CreateLines = function(x, m, c, T, S) {\n          c === void 0 && (c = null), T === void 0 && (T = !1), S === void 0 && (S = null);\n          var E = { points: m, updatable: T, instance: S };\n          return O.CreateLines(x, E, c);\n        }, _.a.CreateDashedLines = function(x, m, c, T, S, E, g, l) {\n          E === void 0 && (E = null);\n          var h = { points: m, dashSize: c, gapSize: T, dashNb: S, updatable: g, instance: l };\n          return O.CreateDashedLines(x, h, E);\n        };\n        var O = function() {\n          function x() {\n          }\n          return x.CreateLineSystem = function(m, c, T) {\n            var S = c.instance, E = c.lines, g = c.colors;\n            if (S) {\n              var l, h, v = S.getVerticesData(I.b.PositionKind);\n              g && (l = S.getVerticesData(I.b.ColorKind));\n              for (var b = 0, D = 0, w = 0; w < E.length; w++)\n                for (var N = E[w], M = 0; M < N.length; M++)\n                  v[b] = N[M].x, v[b + 1] = N[M].y, v[b + 2] = N[M].z, g && l && (h = g[w], l[D] = h[M].r, l[D + 1] = h[M].g, l[D + 2] = h[M].b, l[D + 3] = h[M].a, D += 4), b += 3;\n              return S.updateVerticesData(I.b.PositionKind, v, !1, !1), g && l && S.updateVerticesData(I.b.ColorKind, l, !1, !1), S;\n            }\n            var U = !!g, X = new u.b(m, T, null, void 0, void 0, U, c.useVertexAlpha);\n            return C.a.CreateLineSystem(c).applyToMesh(X, c.updatable), X;\n          }, x.CreateLines = function(m, c, T) {\n            T === void 0 && (T = null);\n            var S = c.colors ? [c.colors] : null;\n            return x.CreateLineSystem(m, { lines: [c.points], updatable: c.updatable, instance: c.instance, colors: S, useVertexAlpha: c.useVertexAlpha }, T);\n          }, x.CreateDashedLines = function(m, c, T) {\n            T === void 0 && (T = null);\n            var S = c.points, E = c.instance, g = c.gapSize || 1, l = c.dashSize || 3;\n            if (E)\n              return E.updateMeshPositions(function(v) {\n                var b, D, w = V.e.Zero(), N = v.length / 6, M = 0, U = 0, X = 0, j = 0, ne = 0, te = 0;\n                for (ne = 0; ne < S.length - 1; ne++)\n                  S[ne + 1].subtractToRef(S[ne], w), M += w.length();\n                b = M / N;\n                var de = E._creationDataStorage.dashSize;\n                for (D = de * b / (de + E._creationDataStorage.gapSize), ne = 0; ne < S.length - 1; ne++)\n                  for (S[ne + 1].subtractToRef(S[ne], w), U = Math.floor(w.length() / b), w.normalize(), te = 0; te < U && j < v.length; )\n                    X = b * te, v[j] = S[ne].x + X * w.x, v[j + 1] = S[ne].y + X * w.y, v[j + 2] = S[ne].z + X * w.z, v[j + 3] = S[ne].x + (X + D) * w.x, v[j + 4] = S[ne].y + (X + D) * w.y, v[j + 5] = S[ne].z + (X + D) * w.z, j += 6, te++;\n                for (; j < v.length; )\n                  v[j] = S[ne].x, v[j + 1] = S[ne].y, v[j + 2] = S[ne].z, j += 3;\n              }, !1), E;\n            var h = new u.b(m, T, null, void 0, void 0, void 0, c.useVertexAlpha);\n            return C.a.CreateDashedLines(c).applyToMesh(h, c.updatable), h._creationDataStorage = new _.b(), h._creationDataStorage.dashSize = l, h._creationDataStorage.gapSize = g, h;\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(34), _ = f(8), C = function(I, O) {\n          return I ? I.getClassName && I.getClassName() === \"Mesh\" ? null : I.getClassName && I.getClassName() === \"SubMesh\" ? I.clone(O) : I.clone ? I.clone() : null : null;\n        }, u = function() {\n          function I() {\n          }\n          return I.DeepCopy = function(O, x, m, c) {\n            for (var T = 0, S = function(b) {\n              var D = [];\n              do\n                Object.getOwnPropertyNames(b).forEach(function(w) {\n                  D.indexOf(w) === -1 && D.push(w);\n                });\n              while (b = Object.getPrototypeOf(b));\n              return D;\n            }(O); T < S.length; T++) {\n              var E = S[T];\n              if ((E[0] !== \"_\" || c && c.indexOf(E) !== -1) && !(V.a.EndsWith(E, \"Observable\") || m && m.indexOf(E) !== -1)) {\n                var g = O[E], l = typeof g;\n                if (l !== \"function\")\n                  try {\n                    if (l === \"object\")\n                      if (g instanceof Array) {\n                        if (x[E] = [], g.length > 0)\n                          if (typeof g[0] == \"object\")\n                            for (var h = 0; h < g.length; h++) {\n                              var v = C(g[h], x);\n                              x[E].indexOf(v) === -1 && x[E].push(v);\n                            }\n                          else\n                            x[E] = g.slice(0);\n                      } else\n                        x[E] = C(g, x);\n                    else\n                      x[E] = g;\n                  } catch (b) {\n                    _.a.Warn(b.message);\n                  }\n              }\n            }\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return m;\n        }), f.d(A, \"a\", function() {\n          return c;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(12), I = f(9), O = f(76), x = f(121), m = function(T) {\n          function S() {\n            var E = T.call(this) || this;\n            return E.IMAGEPROCESSING = !1, E.VIGNETTE = !1, E.VIGNETTEBLENDMODEMULTIPLY = !1, E.VIGNETTEBLENDMODEOPAQUE = !1, E.TONEMAPPING = !1, E.TONEMAPPING_ACES = !1, E.CONTRAST = !1, E.COLORCURVES = !1, E.COLORGRADING = !1, E.COLORGRADING3D = !1, E.SAMPLER3DGREENDEPTH = !1, E.SAMPLER3DBGRMAP = !1, E.IMAGEPROCESSINGPOSTPROCESS = !1, E.EXPOSURE = !1, E.rebuild(), E;\n          }\n          return Object(V.d)(S, T), S;\n        }(O.a), c = function() {\n          function T() {\n            this.colorCurves = new x.a(), this._colorCurvesEnabled = !1, this._colorGradingEnabled = !1, this._colorGradingWithGreenDepth = !0, this._colorGradingBGR = !0, this._exposure = 1, this._toneMappingEnabled = !1, this._toneMappingType = T.TONEMAPPING_STANDARD, this._contrast = 1, this.vignetteStretch = 0, this.vignetteCentreX = 0, this.vignetteCentreY = 0, this.vignetteWeight = 1.5, this.vignetteColor = new I.b(0, 0, 0, 0), this.vignetteCameraFov = 0.5, this._vignetteBlendMode = T.VIGNETTEMODE_MULTIPLY, this._vignetteEnabled = !1, this._applyByPostProcess = !1, this._isEnabled = !0, this.onUpdateParameters = new C.c();\n          }\n          return Object.defineProperty(T.prototype, \"colorCurvesEnabled\", { get: function() {\n            return this._colorCurvesEnabled;\n          }, set: function(S) {\n            this._colorCurvesEnabled !== S && (this._colorCurvesEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingTexture\", { get: function() {\n            return this._colorGradingTexture;\n          }, set: function(S) {\n            this._colorGradingTexture !== S && (this._colorGradingTexture = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingEnabled\", { get: function() {\n            return this._colorGradingEnabled;\n          }, set: function(S) {\n            this._colorGradingEnabled !== S && (this._colorGradingEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingWithGreenDepth\", { get: function() {\n            return this._colorGradingWithGreenDepth;\n          }, set: function(S) {\n            this._colorGradingWithGreenDepth !== S && (this._colorGradingWithGreenDepth = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"colorGradingBGR\", { get: function() {\n            return this._colorGradingBGR;\n          }, set: function(S) {\n            this._colorGradingBGR !== S && (this._colorGradingBGR = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"exposure\", { get: function() {\n            return this._exposure;\n          }, set: function(S) {\n            this._exposure !== S && (this._exposure = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"toneMappingEnabled\", { get: function() {\n            return this._toneMappingEnabled;\n          }, set: function(S) {\n            this._toneMappingEnabled !== S && (this._toneMappingEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"toneMappingType\", { get: function() {\n            return this._toneMappingType;\n          }, set: function(S) {\n            this._toneMappingType !== S && (this._toneMappingType = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"contrast\", { get: function() {\n            return this._contrast;\n          }, set: function(S) {\n            this._contrast !== S && (this._contrast = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"vignetteBlendMode\", { get: function() {\n            return this._vignetteBlendMode;\n          }, set: function(S) {\n            this._vignetteBlendMode !== S && (this._vignetteBlendMode = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"vignetteEnabled\", { get: function() {\n            return this._vignetteEnabled;\n          }, set: function(S) {\n            this._vignetteEnabled !== S && (this._vignetteEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"applyByPostProcess\", { get: function() {\n            return this._applyByPostProcess;\n          }, set: function(S) {\n            this._applyByPostProcess !== S && (this._applyByPostProcess = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(S) {\n            this._isEnabled !== S && (this._isEnabled = S, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), T.prototype._updateParameters = function() {\n            this.onUpdateParameters.notifyObservers(this);\n          }, T.prototype.getClassName = function() {\n            return \"ImageProcessingConfiguration\";\n          }, T.PrepareUniforms = function(S, E) {\n            E.EXPOSURE && S.push(\"exposureLinear\"), E.CONTRAST && S.push(\"contrast\"), E.COLORGRADING && S.push(\"colorTransformSettings\"), E.VIGNETTE && (S.push(\"vInverseScreenSize\"), S.push(\"vignetteSettings1\"), S.push(\"vignetteSettings2\")), E.COLORCURVES && x.a.PrepareUniforms(S);\n          }, T.PrepareSamplers = function(S, E) {\n            E.COLORGRADING && S.push(\"txColorTransform\");\n          }, T.prototype.prepareDefines = function(S, E) {\n            if (E === void 0 && (E = !1), E !== this.applyByPostProcess || !this._isEnabled)\n              return S.VIGNETTE = !1, S.TONEMAPPING = !1, S.TONEMAPPING_ACES = !1, S.CONTRAST = !1, S.EXPOSURE = !1, S.COLORCURVES = !1, S.COLORGRADING = !1, S.COLORGRADING3D = !1, S.IMAGEPROCESSING = !1, void (S.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled);\n            switch (S.VIGNETTE = this.vignetteEnabled, S.VIGNETTEBLENDMODEMULTIPLY = this.vignetteBlendMode === T._VIGNETTEMODE_MULTIPLY, S.VIGNETTEBLENDMODEOPAQUE = !S.VIGNETTEBLENDMODEMULTIPLY, S.TONEMAPPING = this.toneMappingEnabled, this._toneMappingType) {\n              case T.TONEMAPPING_ACES:\n                S.TONEMAPPING_ACES = !0;\n                break;\n              default:\n                S.TONEMAPPING_ACES = !1;\n            }\n            S.CONTRAST = this.contrast !== 1, S.EXPOSURE = this.exposure !== 1, S.COLORCURVES = this.colorCurvesEnabled && !!this.colorCurves, S.COLORGRADING = this.colorGradingEnabled && !!this.colorGradingTexture, S.COLORGRADING ? S.COLORGRADING3D = this.colorGradingTexture.is3D : S.COLORGRADING3D = !1, S.SAMPLER3DGREENDEPTH = this.colorGradingWithGreenDepth, S.SAMPLER3DBGRMAP = this.colorGradingBGR, S.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess, S.IMAGEPROCESSING = S.VIGNETTE || S.TONEMAPPING || S.CONTRAST || S.EXPOSURE || S.COLORCURVES || S.COLORGRADING;\n          }, T.prototype.isReady = function() {\n            return !this.colorGradingEnabled || !this.colorGradingTexture || this.colorGradingTexture.isReady();\n          }, T.prototype.bind = function(S, E) {\n            if (this._colorCurvesEnabled && this.colorCurves && x.a.Bind(this.colorCurves, S), this._vignetteEnabled) {\n              var g = 1 / S.getEngine().getRenderWidth(), l = 1 / S.getEngine().getRenderHeight();\n              S.setFloat2(\"vInverseScreenSize\", g, l);\n              var h = E ?? l / g, v = Math.tan(0.5 * this.vignetteCameraFov), b = v * h, D = Math.sqrt(b * v);\n              b = u.b.Mix(b, D, this.vignetteStretch), v = u.b.Mix(v, D, this.vignetteStretch), S.setFloat4(\"vignetteSettings1\", b, v, -b * this.vignetteCentreX, -v * this.vignetteCentreY);\n              var w = -2 * this.vignetteWeight;\n              S.setFloat4(\"vignetteSettings2\", this.vignetteColor.r, this.vignetteColor.g, this.vignetteColor.b, w);\n            }\n            if (S.setFloat(\"exposureLinear\", this.exposure), S.setFloat(\"contrast\", this.contrast), this.colorGradingTexture) {\n              S.setTexture(\"txColorTransform\", this.colorGradingTexture);\n              var N = this.colorGradingTexture.getSize().height;\n              S.setFloat4(\"colorTransformSettings\", (N - 1) / N, 0.5 / N, N, this.colorGradingTexture.level);\n            }\n          }, T.prototype.clone = function() {\n            return _.a.Clone(function() {\n              return new T();\n            }, this);\n          }, T.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, T.Parse = function(S) {\n            return _.a.Parse(function() {\n              return new T();\n            }, S, null, null);\n          }, Object.defineProperty(T, \"VIGNETTEMODE_MULTIPLY\", { get: function() {\n            return this._VIGNETTEMODE_MULTIPLY;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T, \"VIGNETTEMODE_OPAQUE\", { get: function() {\n            return this._VIGNETTEMODE_OPAQUE;\n          }, enumerable: !1, configurable: !0 }), T.TONEMAPPING_STANDARD = 0, T.TONEMAPPING_ACES = 1, T._VIGNETTEMODE_MULTIPLY = 0, T._VIGNETTEMODE_OPAQUE = 1, Object(V.c)([Object(_.g)()], T.prototype, \"colorCurves\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorCurvesEnabled\", void 0), Object(V.c)([Object(_.m)(\"colorGradingTexture\")], T.prototype, \"_colorGradingTexture\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorGradingEnabled\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorGradingWithGreenDepth\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_colorGradingBGR\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_exposure\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_toneMappingEnabled\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_toneMappingType\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_contrast\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteStretch\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteCentreX\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteCentreY\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteWeight\", void 0), Object(V.c)([Object(_.f)()], T.prototype, \"vignetteColor\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"vignetteCameraFov\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_vignetteBlendMode\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_vignetteEnabled\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_applyByPostProcess\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"_isEnabled\", void 0), T;\n        }();\n        _.a._ImageProcessingConfigurationParser = c.Parse;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return T;\n        });\n        var V = f(44), _ = f(0), C = f(2), u = f(103), I = f(113), O = { min: 0, max: 0 }, x = { min: 0, max: 0 }, m = function(S, E, g) {\n          var l = _.e.Dot(E.centerWorld, S), h = Math.abs(_.e.Dot(E.directions[0], S)) * E.extendSize.x + Math.abs(_.e.Dot(E.directions[1], S)) * E.extendSize.y + Math.abs(_.e.Dot(E.directions[2], S)) * E.extendSize.z;\n          g.min = l - h, g.max = l + h;\n        }, c = function(S, E, g) {\n          return m(S, E, O), m(S, g, x), !(O.min > x.max || x.min > O.max);\n        }, T = function() {\n          function S(E, g, l) {\n            this._isLocked = !1, this.boundingBox = new u.a(E, g, l), this.boundingSphere = new I.a(E, g, l);\n          }\n          return S.prototype.reConstruct = function(E, g, l) {\n            this.boundingBox.reConstruct(E, g, l), this.boundingSphere.reConstruct(E, g, l);\n          }, Object.defineProperty(S.prototype, \"minimum\", { get: function() {\n            return this.boundingBox.minimum;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"maximum\", { get: function() {\n            return this.boundingBox.maximum;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isLocked\", { get: function() {\n            return this._isLocked;\n          }, set: function(E) {\n            this._isLocked = E;\n          }, enumerable: !1, configurable: !0 }), S.prototype.update = function(E) {\n            this._isLocked || (this.boundingBox._update(E), this.boundingSphere._update(E));\n          }, S.prototype.centerOn = function(E, g) {\n            var l = S.TmpVector3[0].copyFrom(E).subtractInPlace(g), h = S.TmpVector3[1].copyFrom(E).addInPlace(g);\n            return this.boundingBox.reConstruct(l, h, this.boundingBox.getWorldMatrix()), this.boundingSphere.reConstruct(l, h, this.boundingBox.getWorldMatrix()), this;\n          }, S.prototype.scale = function(E) {\n            return this.boundingBox.scale(E), this.boundingSphere.scale(E), this;\n          }, S.prototype.isInFrustum = function(E, g) {\n            return g === void 0 && (g = C.a.MESHES_CULLINGSTRATEGY_STANDARD), !(g !== C.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION && g !== C.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY || !this.boundingSphere.isCenterInFrustum(E)) || !!this.boundingSphere.isInFrustum(E) && (!(g !== C.a.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY && g !== C.a.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY) || this.boundingBox.isInFrustum(E));\n          }, Object.defineProperty(S.prototype, \"diagonalLength\", { get: function() {\n            var E = this.boundingBox;\n            return E.maximumWorld.subtractToRef(E.minimumWorld, S.TmpVector3[0]).length();\n          }, enumerable: !1, configurable: !0 }), S.prototype.isCompletelyInFrustum = function(E) {\n            return this.boundingBox.isCompletelyInFrustum(E);\n          }, S.prototype._checkCollision = function(E) {\n            return E._canDoCollision(this.boundingSphere.centerWorld, this.boundingSphere.radiusWorld, this.boundingBox.minimumWorld, this.boundingBox.maximumWorld);\n          }, S.prototype.intersectsPoint = function(E) {\n            return !!this.boundingSphere.centerWorld && !!this.boundingSphere.intersectsPoint(E) && !!this.boundingBox.intersectsPoint(E);\n          }, S.prototype.intersects = function(E, g) {\n            if (!I.a.Intersects(this.boundingSphere, E.boundingSphere) || !u.a.Intersects(this.boundingBox, E.boundingBox))\n              return !1;\n            if (!g)\n              return !0;\n            var l = this.boundingBox, h = E.boundingBox;\n            return !!c(l.directions[0], l, h) && !!c(l.directions[1], l, h) && !!c(l.directions[2], l, h) && !!c(h.directions[0], l, h) && !!c(h.directions[1], l, h) && !!c(h.directions[2], l, h) && !!c(_.e.Cross(l.directions[0], h.directions[0]), l, h) && !!c(_.e.Cross(l.directions[0], h.directions[1]), l, h) && !!c(_.e.Cross(l.directions[0], h.directions[2]), l, h) && !!c(_.e.Cross(l.directions[1], h.directions[0]), l, h) && !!c(_.e.Cross(l.directions[1], h.directions[1]), l, h) && !!c(_.e.Cross(l.directions[1], h.directions[2]), l, h) && !!c(_.e.Cross(l.directions[2], h.directions[0]), l, h) && !!c(_.e.Cross(l.directions[2], h.directions[1]), l, h) && !!c(_.e.Cross(l.directions[2], h.directions[2]), l, h);\n          }, S.TmpVector3 = V.a.BuildArray(2, _.e.Zero), S;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.BuildArray = function(C, u) {\n            for (var I = [], O = 0; O < C; ++O)\n              I.push(u());\n            return I;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(0), _ = f(7), C = f(16);\n        C.a.CreateSphere = function(I) {\n          for (var O = I.segments || 32, x = I.diameterX || I.diameter || 1, m = I.diameterY || I.diameter || 1, c = I.diameterZ || I.diameter || 1, T = I.arc && (I.arc <= 0 || I.arc > 1) ? 1 : I.arc || 1, S = I.slice && I.slice <= 0 ? 1 : I.slice || 1, E = I.sideOrientation === 0 ? 0 : I.sideOrientation || C.a.DEFAULTSIDE, g = !!I.dedupTopBottomIndices, l = new V.e(x / 2, m / 2, c / 2), h = 2 + O, v = 2 * h, b = [], D = [], w = [], N = [], M = 0; M <= h; M++) {\n            for (var U = M / h, X = U * Math.PI * S, j = 0; j <= v; j++) {\n              var ne = j / v, te = ne * Math.PI * 2 * T, de = V.a.RotationZ(-X), pe = V.a.RotationY(te), ae = V.e.TransformCoordinates(V.e.Up(), de), ee = V.e.TransformCoordinates(ae, pe), K = ee.multiply(l), $ = ee.divide(l).normalize();\n              D.push(K.x, K.y, K.z), w.push($.x, $.y, $.z), N.push(ne, U);\n            }\n            if (M > 0)\n              for (var L = D.length / 3, G = L - 2 * (v + 1); G + v + 2 < L; G++)\n                g ? (M > 1 && (b.push(G), b.push(G + 1), b.push(G + v + 1)), (M < h || S < 1) && (b.push(G + v + 1), b.push(G + 1), b.push(G + v + 2))) : (b.push(G), b.push(G + 1), b.push(G + v + 1), b.push(G + v + 1), b.push(G + 1), b.push(G + v + 2));\n          }\n          C.a._ComputeSides(E, D, b, w, N, I.frontUVs, I.backUVs);\n          var Q = new C.a();\n          return Q.indices = b, Q.positions = D, Q.normals = w, Q.uvs = N, Q;\n        }, _.a.CreateSphere = function(I, O, x, m, c, T) {\n          var S = { segments: O, diameterX: x, diameterY: x, diameterZ: x, sideOrientation: T, updatable: c };\n          return u.CreateSphere(I, S, m);\n        };\n        var u = function() {\n          function I() {\n          }\n          return I.CreateSphere = function(O, x, m) {\n            m === void 0 && (m = null);\n            var c = new _.a(O, m);\n            return x.sideOrientation = _.a._GetDefaultSideOrientation(x.sideOrientation), c._originalBuilderSideOrientation = x.sideOrientation, C.a.CreateSphere(x).applyToMesh(c, x.updatable), c;\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(0), I = f(29), O = f(23), x = function(m) {\n          function c(T, S, E) {\n            S === void 0 && (S = null), E === void 0 && (E = !0);\n            var g = m.call(this, T, S) || this;\n            return g._forward = new u.e(0, 0, 1), g._forwardInverted = new u.e(0, 0, -1), g._up = new u.e(0, 1, 0), g._right = new u.e(1, 0, 0), g._rightInverted = new u.e(-1, 0, 0), g._position = u.e.Zero(), g._rotation = u.e.Zero(), g._rotationQuaternion = null, g._scaling = u.e.One(), g._isDirty = !1, g._transformToBoneReferal = null, g._isAbsoluteSynced = !1, g._billboardMode = c.BILLBOARDMODE_NONE, g._preserveParentRotationForBillboard = !1, g.scalingDeterminant = 1, g._infiniteDistance = !1, g.ignoreNonUniformScaling = !1, g.reIntegrateRotationIntoRotationQuaternion = !1, g._poseMatrix = null, g._localMatrix = u.a.Zero(), g._usePivotMatrix = !1, g._absolutePosition = u.e.Zero(), g._absoluteScaling = u.e.Zero(), g._absoluteRotationQuaternion = u.b.Identity(), g._pivotMatrix = u.a.Identity(), g._postMultiplyPivotMatrix = !1, g._isWorldMatrixFrozen = !1, g._indexInSceneTransformNodesArray = -1, g.onAfterWorldMatrixUpdateObservable = new C.c(), g._nonUniformScaling = !1, E && g.getScene().addTransformNode(g), g;\n          }\n          return Object(V.d)(c, m), Object.defineProperty(c.prototype, \"billboardMode\", { get: function() {\n            return this._billboardMode;\n          }, set: function(T) {\n            this._billboardMode !== T && (this._billboardMode = T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"preserveParentRotationForBillboard\", { get: function() {\n            return this._preserveParentRotationForBillboard;\n          }, set: function(T) {\n            T !== this._preserveParentRotationForBillboard && (this._preserveParentRotationForBillboard = T);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"infiniteDistance\", { get: function() {\n            return this._infiniteDistance;\n          }, set: function(T) {\n            this._infiniteDistance !== T && (this._infiniteDistance = T);\n          }, enumerable: !1, configurable: !0 }), c.prototype.getClassName = function() {\n            return \"TransformNode\";\n          }, Object.defineProperty(c.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(T) {\n            this._position = T, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"rotation\", { get: function() {\n            return this._rotation;\n          }, set: function(T) {\n            this._rotation = T, this._rotationQuaternion = null, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"scaling\", { get: function() {\n            return this._scaling;\n          }, set: function(T) {\n            this._scaling = T, this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"rotationQuaternion\", { get: function() {\n            return this._rotationQuaternion;\n          }, set: function(T) {\n            this._rotationQuaternion = T, T && this._rotation.setAll(0), this._isDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"forward\", { get: function() {\n            return u.e.Normalize(u.e.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"up\", { get: function() {\n            return u.e.Normalize(u.e.TransformNormal(this._up, this.getWorldMatrix()));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"right\", { get: function() {\n            return u.e.Normalize(u.e.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()));\n          }, enumerable: !1, configurable: !0 }), c.prototype.updatePoseMatrix = function(T) {\n            return this._poseMatrix ? (this._poseMatrix.copyFrom(T), this) : (this._poseMatrix = T.clone(), this);\n          }, c.prototype.getPoseMatrix = function() {\n            return this._poseMatrix || (this._poseMatrix = u.a.Identity()), this._poseMatrix;\n          }, c.prototype._isSynchronized = function() {\n            var T = this._cache;\n            return this.billboardMode === T.billboardMode && this.billboardMode === c.BILLBOARDMODE_NONE && !T.pivotMatrixUpdated && !this.infiniteDistance && !this.position._isDirty && !this.scaling._isDirty && !(this._rotationQuaternion && this._rotationQuaternion._isDirty || this.rotation._isDirty);\n          }, c.prototype._initCache = function() {\n            m.prototype._initCache.call(this);\n            var T = this._cache;\n            T.localMatrixUpdated = !1, T.billboardMode = -1, T.infiniteDistance = !1;\n          }, c.prototype.markAsDirty = function(T) {\n            return this._currentRenderId = Number.MAX_VALUE, this._isDirty = !0, this;\n          }, Object.defineProperty(c.prototype, \"absolutePosition\", { get: function() {\n            return this._absolutePosition;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"absoluteScaling\", { get: function() {\n            return this._syncAbsoluteScalingAndRotation(), this._absoluteScaling;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"absoluteRotationQuaternion\", { get: function() {\n            return this._syncAbsoluteScalingAndRotation(), this._absoluteRotationQuaternion;\n          }, enumerable: !1, configurable: !0 }), c.prototype.setPreTransformMatrix = function(T) {\n            return this.setPivotMatrix(T, !1);\n          }, c.prototype.setPivotMatrix = function(T, S) {\n            return S === void 0 && (S = !0), this._pivotMatrix.copyFrom(T), this._usePivotMatrix = !this._pivotMatrix.isIdentity(), this._cache.pivotMatrixUpdated = !0, this._postMultiplyPivotMatrix = S, this._postMultiplyPivotMatrix && (this._pivotMatrixInverse ? this._pivotMatrix.invertToRef(this._pivotMatrixInverse) : this._pivotMatrixInverse = u.a.Invert(this._pivotMatrix)), this;\n          }, c.prototype.getPivotMatrix = function() {\n            return this._pivotMatrix;\n          }, c.prototype.instantiateHierarchy = function(T, S, E) {\n            T === void 0 && (T = null);\n            var g = this.clone(\"Clone of \" + (this.name || this.id), T || this.parent, !0);\n            g && E && E(this, g);\n            for (var l = 0, h = this.getChildTransformNodes(!0); l < h.length; l++)\n              h[l].instantiateHierarchy(g, S, E);\n            return g;\n          }, c.prototype.freezeWorldMatrix = function(T) {\n            return T === void 0 && (T = null), T ? this._worldMatrix = T : (this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0)), this._isDirty = !1, this._isWorldMatrixFrozen = !0, this;\n          }, c.prototype.unfreezeWorldMatrix = function() {\n            return this._isWorldMatrixFrozen = !1, this.computeWorldMatrix(!0), this;\n          }, Object.defineProperty(c.prototype, \"isWorldMatrixFrozen\", { get: function() {\n            return this._isWorldMatrixFrozen;\n          }, enumerable: !1, configurable: !0 }), c.prototype.getAbsolutePosition = function() {\n            return this.computeWorldMatrix(), this._absolutePosition;\n          }, c.prototype.setAbsolutePosition = function(T) {\n            if (!T)\n              return this;\n            var S, E, g;\n            if (T.x === void 0) {\n              if (arguments.length < 3)\n                return this;\n              S = arguments[0], E = arguments[1], g = arguments[2];\n            } else\n              S = T.x, E = T.y, g = T.z;\n            if (this.parent) {\n              var l = u.c.Matrix[0];\n              this.parent.getWorldMatrix().invertToRef(l), u.e.TransformCoordinatesFromFloatsToRef(S, E, g, l, this.position);\n            } else\n              this.position.x = S, this.position.y = E, this.position.z = g;\n            return this._absolutePosition.copyFrom(T), this;\n          }, c.prototype.setPositionWithLocalVector = function(T) {\n            return this.computeWorldMatrix(), this.position = u.e.TransformNormal(T, this._localMatrix), this;\n          }, c.prototype.getPositionExpressedInLocalSpace = function() {\n            this.computeWorldMatrix();\n            var T = u.c.Matrix[0];\n            return this._localMatrix.invertToRef(T), u.e.TransformNormal(this.position, T);\n          }, c.prototype.locallyTranslate = function(T) {\n            return this.computeWorldMatrix(!0), this.position = u.e.TransformCoordinates(T, this._localMatrix), this;\n          }, c.prototype.lookAt = function(T, S, E, g, l) {\n            S === void 0 && (S = 0), E === void 0 && (E = 0), g === void 0 && (g = 0), l === void 0 && (l = O.c.LOCAL);\n            var h = c._lookAtVectorCache, v = l === O.c.LOCAL ? this.position : this.getAbsolutePosition();\n            if (T.subtractToRef(v, h), this.setDirection(h, S, E, g), l === O.c.WORLD && this.parent)\n              if (this.rotationQuaternion) {\n                var b = u.c.Matrix[0];\n                this.rotationQuaternion.toRotationMatrix(b);\n                var D = u.c.Matrix[1];\n                this.parent.getWorldMatrix().getRotationMatrixToRef(D), D.invert(), b.multiplyToRef(D, b), this.rotationQuaternion.fromRotationMatrix(b);\n              } else {\n                var w = u.c.Quaternion[0];\n                u.b.FromEulerVectorToRef(this.rotation, w), b = u.c.Matrix[0], w.toRotationMatrix(b), D = u.c.Matrix[1], this.parent.getWorldMatrix().getRotationMatrixToRef(D), D.invert(), b.multiplyToRef(D, b), w.fromRotationMatrix(b), w.toEulerAnglesToRef(this.rotation);\n              }\n            return this;\n          }, c.prototype.getDirection = function(T) {\n            var S = u.e.Zero();\n            return this.getDirectionToRef(T, S), S;\n          }, c.prototype.getDirectionToRef = function(T, S) {\n            return u.e.TransformNormalToRef(T, this.getWorldMatrix(), S), this;\n          }, c.prototype.setDirection = function(T, S, E, g) {\n            S === void 0 && (S = 0), E === void 0 && (E = 0), g === void 0 && (g = 0);\n            var l = -Math.atan2(T.z, T.x) + Math.PI / 2, h = Math.sqrt(T.x * T.x + T.z * T.z), v = -Math.atan2(T.y, h);\n            return this.rotationQuaternion ? u.b.RotationYawPitchRollToRef(l + S, v + E, g, this.rotationQuaternion) : (this.rotation.x = v + E, this.rotation.y = l + S, this.rotation.z = g), this;\n          }, c.prototype.setPivotPoint = function(T, S) {\n            S === void 0 && (S = O.c.LOCAL), this.getScene().getRenderId() == 0 && this.computeWorldMatrix(!0);\n            var E = this.getWorldMatrix();\n            if (S == O.c.WORLD) {\n              var g = u.c.Matrix[0];\n              E.invertToRef(g), T = u.e.TransformCoordinates(T, g);\n            }\n            return this.setPivotMatrix(u.a.Translation(-T.x, -T.y, -T.z), !0);\n          }, c.prototype.getPivotPoint = function() {\n            var T = u.e.Zero();\n            return this.getPivotPointToRef(T), T;\n          }, c.prototype.getPivotPointToRef = function(T) {\n            return T.x = -this._pivotMatrix.m[12], T.y = -this._pivotMatrix.m[13], T.z = -this._pivotMatrix.m[14], this;\n          }, c.prototype.getAbsolutePivotPoint = function() {\n            var T = u.e.Zero();\n            return this.getAbsolutePivotPointToRef(T), T;\n          }, c.prototype.getAbsolutePivotPointToRef = function(T) {\n            return this.getPivotPointToRef(T), u.e.TransformCoordinatesToRef(T, this.getWorldMatrix(), T), this;\n          }, c.prototype.setParent = function(T) {\n            if (!T && !this.parent)\n              return this;\n            var S = u.c.Quaternion[0], E = u.c.Vector3[0], g = u.c.Vector3[1];\n            if (T) {\n              var l = u.c.Matrix[0], h = u.c.Matrix[1];\n              this.computeWorldMatrix(!0), T.computeWorldMatrix(!0), T.getWorldMatrix().invertToRef(h), this.getWorldMatrix().multiplyToRef(h, l), l.decompose(g, S, E);\n            } else\n              this.computeWorldMatrix(!0), this.getWorldMatrix().decompose(g, S, E);\n            return this.rotationQuaternion ? this.rotationQuaternion.copyFrom(S) : S.toEulerAnglesToRef(this.rotation), this.scaling.copyFrom(g), this.position.copyFrom(E), this.parent = T, this;\n          }, Object.defineProperty(c.prototype, \"nonUniformScaling\", { get: function() {\n            return this._nonUniformScaling;\n          }, enumerable: !1, configurable: !0 }), c.prototype._updateNonUniformScalingState = function(T) {\n            return this._nonUniformScaling !== T && (this._nonUniformScaling = T, !0);\n          }, c.prototype.attachToBone = function(T, S) {\n            return this._transformToBoneReferal = S, this.parent = T, T.getSkeleton().prepare(), T.getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this;\n          }, c.prototype.detachFromBone = function() {\n            return this.parent ? (this.parent.getWorldMatrix().determinant() < 0 && (this.scalingDeterminant *= -1), this._transformToBoneReferal = null, this.parent = null, this) : this;\n          }, c.prototype.rotate = function(T, S, E) {\n            var g;\n            if (T.normalize(), this.rotationQuaternion || (this.rotationQuaternion = this.rotation.toQuaternion(), this.rotation.setAll(0)), E && E !== O.c.LOCAL) {\n              if (this.parent) {\n                var l = u.c.Matrix[0];\n                this.parent.getWorldMatrix().invertToRef(l), T = u.e.TransformNormal(T, l);\n              }\n              (g = u.b.RotationAxisToRef(T, S, c._rotationAxisCache)).multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);\n            } else\n              g = u.b.RotationAxisToRef(T, S, c._rotationAxisCache), this.rotationQuaternion.multiplyToRef(g, this.rotationQuaternion);\n            return this;\n          }, c.prototype.rotateAround = function(T, S, E) {\n            S.normalize(), this.rotationQuaternion || (this.rotationQuaternion = u.b.RotationYawPitchRoll(this.rotation.y, this.rotation.x, this.rotation.z), this.rotation.setAll(0));\n            var g = u.c.Vector3[0], l = u.c.Vector3[1], h = u.c.Vector3[2], v = u.c.Quaternion[0], b = u.c.Matrix[0], D = u.c.Matrix[1], w = u.c.Matrix[2], N = u.c.Matrix[3];\n            return T.subtractToRef(this.position, g), u.a.TranslationToRef(g.x, g.y, g.z, b), u.a.TranslationToRef(-g.x, -g.y, -g.z, D), u.a.RotationAxisToRef(S, E, w), D.multiplyToRef(w, N), N.multiplyToRef(b, N), N.decompose(l, v, h), this.position.addInPlace(h), v.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion), this;\n          }, c.prototype.translate = function(T, S, E) {\n            var g = T.scale(S);\n            if (E && E !== O.c.LOCAL)\n              this.setAbsolutePosition(this.getAbsolutePosition().add(g));\n            else {\n              var l = this.getPositionExpressedInLocalSpace().add(g);\n              this.setPositionWithLocalVector(l);\n            }\n            return this;\n          }, c.prototype.addRotation = function(T, S, E) {\n            var g;\n            this.rotationQuaternion ? g = this.rotationQuaternion : (g = u.c.Quaternion[1], u.b.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, g));\n            var l = u.c.Quaternion[0];\n            return u.b.RotationYawPitchRollToRef(S, T, E, l), g.multiplyInPlace(l), this.rotationQuaternion || g.toEulerAnglesToRef(this.rotation), this;\n          }, c.prototype._getEffectiveParent = function() {\n            return this.parent;\n          }, c.prototype.computeWorldMatrix = function(T) {\n            if (this._isWorldMatrixFrozen && !this._isDirty)\n              return this._worldMatrix;\n            var S = this.getScene().getRenderId();\n            if (!this._isDirty && !T && this.isSynchronized())\n              return this._currentRenderId = S, this._worldMatrix;\n            var E = this.getScene().activeCamera, g = (this._billboardMode & c.BILLBOARDMODE_USE_POSITION) != 0, l = this._billboardMode !== c.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;\n            l && E && g && (this.lookAt(E.position), (this.billboardMode & c.BILLBOARDMODE_X) !== c.BILLBOARDMODE_X && (this.rotation.x = 0), (this.billboardMode & c.BILLBOARDMODE_Y) !== c.BILLBOARDMODE_Y && (this.rotation.y = 0), (this.billboardMode & c.BILLBOARDMODE_Z) !== c.BILLBOARDMODE_Z && (this.rotation.z = 0)), this._updateCache();\n            var h = this._cache;\n            h.pivotMatrixUpdated = !1, h.billboardMode = this.billboardMode, h.infiniteDistance = this.infiniteDistance, this._currentRenderId = S, this._childUpdateId++, this._isDirty = !1, this._position._isDirty = !1, this._rotation._isDirty = !1, this._scaling._isDirty = !1;\n            var v, b = this._getEffectiveParent(), D = c._TmpScaling, w = this._position;\n            if (this._infiniteDistance && !this.parent && E) {\n              var N = E.getWorldMatrix(), M = new u.e(N.m[12], N.m[13], N.m[14]);\n              (w = c._TmpTranslation).copyFromFloats(this._position.x + M.x, this._position.y + M.y, this._position.z + M.z);\n            }\n            if (D.copyFromFloats(this._scaling.x * this.scalingDeterminant, this._scaling.y * this.scalingDeterminant, this._scaling.z * this.scalingDeterminant), this._rotationQuaternion ? (this._rotationQuaternion._isDirty = !1, v = this._rotationQuaternion, this.reIntegrateRotationIntoRotationQuaternion && this.rotation.lengthSquared() && (this._rotationQuaternion.multiplyInPlace(u.b.RotationYawPitchRoll(this._rotation.y, this._rotation.x, this._rotation.z)), this._rotation.copyFromFloats(0, 0, 0))) : (v = c._TmpRotation, u.b.RotationYawPitchRollToRef(this._rotation.y, this._rotation.x, this._rotation.z, v)), this._usePivotMatrix) {\n              var U = u.c.Matrix[1];\n              u.a.ScalingToRef(D.x, D.y, D.z, U);\n              var X = u.c.Matrix[0];\n              v.toRotationMatrix(X), this._pivotMatrix.multiplyToRef(U, u.c.Matrix[4]), u.c.Matrix[4].multiplyToRef(X, this._localMatrix), this._postMultiplyPivotMatrix && this._localMatrix.multiplyToRef(this._pivotMatrixInverse, this._localMatrix), this._localMatrix.addTranslationFromFloats(w.x, w.y, w.z);\n            } else\n              u.a.ComposeToRef(D, v, w, this._localMatrix);\n            if (b && b.getWorldMatrix) {\n              if (T && b.computeWorldMatrix(), l) {\n                this._transformToBoneReferal ? b.getWorldMatrix().multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), u.c.Matrix[7]) : u.c.Matrix[7].copyFrom(b.getWorldMatrix());\n                var j = u.c.Vector3[5], ne = u.c.Vector3[6];\n                u.c.Matrix[7].decompose(ne, void 0, j), u.a.ScalingToRef(ne.x, ne.y, ne.z, u.c.Matrix[7]), u.c.Matrix[7].setTranslation(j), this._localMatrix.multiplyToRef(u.c.Matrix[7], this._worldMatrix);\n              } else\n                this._transformToBoneReferal ? (this._localMatrix.multiplyToRef(b.getWorldMatrix(), u.c.Matrix[6]), u.c.Matrix[6].multiplyToRef(this._transformToBoneReferal.getWorldMatrix(), this._worldMatrix)) : this._localMatrix.multiplyToRef(b.getWorldMatrix(), this._worldMatrix);\n              this._markSyncedWithParent();\n            } else\n              this._worldMatrix.copyFrom(this._localMatrix);\n            if (l && E && this.billboardMode && !g) {\n              var te = u.c.Vector3[0];\n              if (this._worldMatrix.getTranslationToRef(te), u.c.Matrix[1].copyFrom(E.getViewMatrix()), u.c.Matrix[1].setTranslationFromFloats(0, 0, 0), u.c.Matrix[1].invertToRef(u.c.Matrix[0]), (this.billboardMode & c.BILLBOARDMODE_ALL) !== c.BILLBOARDMODE_ALL) {\n                u.c.Matrix[0].decompose(void 0, u.c.Quaternion[0], void 0);\n                var de = u.c.Vector3[1];\n                u.c.Quaternion[0].toEulerAnglesToRef(de), (this.billboardMode & c.BILLBOARDMODE_X) !== c.BILLBOARDMODE_X && (de.x = 0), (this.billboardMode & c.BILLBOARDMODE_Y) !== c.BILLBOARDMODE_Y && (de.y = 0), (this.billboardMode & c.BILLBOARDMODE_Z) !== c.BILLBOARDMODE_Z && (de.z = 0), u.a.RotationYawPitchRollToRef(de.y, de.x, de.z, u.c.Matrix[0]);\n              }\n              this._worldMatrix.setTranslationFromFloats(0, 0, 0), this._worldMatrix.multiplyToRef(u.c.Matrix[0], this._worldMatrix), this._worldMatrix.setTranslation(u.c.Vector3[0]);\n            }\n            return this.ignoreNonUniformScaling ? this._updateNonUniformScalingState(!1) : this._scaling.isNonUniformWithinEpsilon(1e-6) ? this._updateNonUniformScalingState(!0) : b && b._nonUniformScaling ? this._updateNonUniformScalingState(b._nonUniformScaling) : this._updateNonUniformScalingState(!1), this._afterComputeWorldMatrix(), this._absolutePosition.copyFromFloats(this._worldMatrix.m[12], this._worldMatrix.m[13], this._worldMatrix.m[14]), this._isAbsoluteSynced = !1, this.onAfterWorldMatrixUpdateObservable.notifyObservers(this), this._poseMatrix || (this._poseMatrix = u.a.Invert(this._worldMatrix)), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix;\n          }, c.prototype.resetLocalMatrix = function(T) {\n            if (T === void 0 && (T = !0), this.computeWorldMatrix(), T)\n              for (var S = this.getChildren(), E = 0; E < S.length; ++E) {\n                var g = S[E];\n                if (g) {\n                  g.computeWorldMatrix();\n                  var l = u.c.Matrix[0];\n                  g._localMatrix.multiplyToRef(this._localMatrix, l);\n                  var h = u.c.Quaternion[0];\n                  l.decompose(g.scaling, h, g.position), g.rotationQuaternion ? g.rotationQuaternion = h : h.toEulerAnglesToRef(g.rotation);\n                }\n              }\n            this.scaling.copyFromFloats(1, 1, 1), this.position.copyFromFloats(0, 0, 0), this.rotation.copyFromFloats(0, 0, 0), this.rotationQuaternion && (this.rotationQuaternion = u.b.Identity()), this._worldMatrix = u.a.Identity();\n          }, c.prototype._afterComputeWorldMatrix = function() {\n          }, c.prototype.registerAfterWorldMatrixUpdate = function(T) {\n            return this.onAfterWorldMatrixUpdateObservable.add(T), this;\n          }, c.prototype.unregisterAfterWorldMatrixUpdate = function(T) {\n            return this.onAfterWorldMatrixUpdateObservable.removeCallback(T), this;\n          }, c.prototype.getPositionInCameraSpace = function(T) {\n            return T === void 0 && (T = null), T || (T = this.getScene().activeCamera), u.e.TransformCoordinates(this.getAbsolutePosition(), T.getViewMatrix());\n          }, c.prototype.getDistanceToCamera = function(T) {\n            return T === void 0 && (T = null), T || (T = this.getScene().activeCamera), this.getAbsolutePosition().subtract(T.globalPosition).length();\n          }, c.prototype.clone = function(T, S, E) {\n            var g = this, l = _.a.Clone(function() {\n              return new c(T, g.getScene());\n            }, this);\n            if (l.name = T, l.id = T, S && (l.parent = S), !E)\n              for (var h = this.getDescendants(!0), v = 0; v < h.length; v++) {\n                var b = h[v];\n                b.clone && b.clone(T + \".\" + b.name, l);\n              }\n            return l;\n          }, c.prototype.serialize = function(T) {\n            var S = _.a.Serialize(this, T);\n            return S.type = this.getClassName(), this.parent && (S.parentId = this.parent.id), S.localMatrix = this.getPivotMatrix().asArray(), S.isEnabled = this.isEnabled(), this.parent && (S.parentId = this.parent.id), S;\n          }, c.Parse = function(T, S, E) {\n            var g = _.a.Parse(function() {\n              return new c(T.name, S);\n            }, T, S, E);\n            return T.localMatrix ? g.setPreTransformMatrix(u.a.FromArray(T.localMatrix)) : T.pivotMatrix && g.setPivotMatrix(u.a.FromArray(T.pivotMatrix)), g.setEnabled(T.isEnabled), T.parentId && (g._waitingParentId = T.parentId), g;\n          }, c.prototype.getChildTransformNodes = function(T, S) {\n            var E = [];\n            return this._getDescendants(E, T, function(g) {\n              return (!S || S(g)) && g instanceof c;\n            }), E;\n          }, c.prototype.dispose = function(T, S) {\n            if (S === void 0 && (S = !1), this.getScene().stopAnimation(this), this.getScene().removeTransformNode(this), this.onAfterWorldMatrixUpdateObservable.clear(), T)\n              for (var E = 0, g = this.getChildTransformNodes(!0); E < g.length; E++) {\n                var l = g[E];\n                l.parent = null, l.computeWorldMatrix(!0);\n              }\n            m.prototype.dispose.call(this, T, S);\n          }, c.prototype.normalizeToUnitCube = function(T, S, E) {\n            T === void 0 && (T = !0), S === void 0 && (S = !1);\n            var g = null, l = null;\n            S && (this.rotationQuaternion ? (l = this.rotationQuaternion.clone(), this.rotationQuaternion.copyFromFloats(0, 0, 0, 1)) : this.rotation && (g = this.rotation.clone(), this.rotation.copyFromFloats(0, 0, 0)));\n            var h = this.getHierarchyBoundingVectors(T, E), v = h.max.subtract(h.min), b = Math.max(v.x, v.y, v.z);\n            if (b === 0)\n              return this;\n            var D = 1 / b;\n            return this.scaling.scaleInPlace(D), S && (this.rotationQuaternion && l ? this.rotationQuaternion.copyFrom(l) : this.rotation && g && this.rotation.copyFrom(g)), this;\n          }, c.prototype._syncAbsoluteScalingAndRotation = function() {\n            this._isAbsoluteSynced || (this._worldMatrix.decompose(this._absoluteScaling, this._absoluteRotationQuaternion), this._isAbsoluteSynced = !0);\n          }, c.BILLBOARDMODE_NONE = 0, c.BILLBOARDMODE_X = 1, c.BILLBOARDMODE_Y = 2, c.BILLBOARDMODE_Z = 4, c.BILLBOARDMODE_ALL = 7, c.BILLBOARDMODE_USE_POSITION = 128, c._TmpRotation = u.b.Zero(), c._TmpScaling = u.e.Zero(), c._TmpTranslation = u.e.Zero(), c._lookAtVectorCache = new u.e(0, 0, 0), c._rotationAxisCache = new u.b(), Object(V.c)([Object(_.o)(\"position\")], c.prototype, \"_position\", void 0), Object(V.c)([Object(_.o)(\"rotation\")], c.prototype, \"_rotation\", void 0), Object(V.c)([Object(_.l)(\"rotationQuaternion\")], c.prototype, \"_rotationQuaternion\", void 0), Object(V.c)([Object(_.o)(\"scaling\")], c.prototype, \"_scaling\", void 0), Object(V.c)([Object(_.c)(\"billboardMode\")], c.prototype, \"_billboardMode\", void 0), Object(V.c)([Object(_.c)()], c.prototype, \"scalingDeterminant\", void 0), Object(V.c)([Object(_.c)(\"infiniteDistance\")], c.prototype, \"_infiniteDistance\", void 0), Object(V.c)([Object(_.c)()], c.prototype, \"ignoreNonUniformScaling\", void 0), Object(V.c)([Object(_.c)()], c.prototype, \"reIntegrateRotationIntoRotationQuaternion\", void 0), c;\n        }(I.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _(C, u, I, O, x, m) {\n            this.source = C, this.pointerX = u, this.pointerY = I, this.meshUnderPointer = O, this.sourceEvent = x, this.additionalData = m;\n          }\n          return _.CreateNew = function(C, u, I) {\n            var O = C.getScene();\n            return new _(C, O.pointerX, O.pointerY, O.meshUnderPointer || C, u, I);\n          }, _.CreateNewFromSprite = function(C, u, I, O) {\n            return new _(C, u.pointerX, u.pointerY, u.meshUnderPointer, I, O);\n          }, _.CreateNewFromScene = function(C, u) {\n            return new _(null, C.pointerX, C.pointerY, C.meshUnderPointer, u);\n          }, _.CreateNewFromPrimitive = function(C, u, I, O) {\n            return new _(C, u.x, u.y, null, I, O);\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(1), _ = f(3), C = f(0), u = f(9), I = f(29), O = f(85), x = f(11), m = function(c) {\n          function T(S, E) {\n            var g = c.call(this, S, E) || this;\n            return g.diffuse = new u.a(1, 1, 1), g.specular = new u.a(1, 1, 1), g.falloffType = T.FALLOFF_DEFAULT, g.intensity = 1, g._range = Number.MAX_VALUE, g._inverseSquaredRange = 0, g._photometricScale = 1, g._intensityMode = T.INTENSITYMODE_AUTOMATIC, g._radius = 1e-5, g.renderPriority = 0, g._shadowEnabled = !0, g._excludeWithLayerMask = 0, g._includeOnlyWithLayerMask = 0, g._lightmapMode = 0, g._excludedMeshesIds = new Array(), g._includedOnlyMeshesIds = new Array(), g._isLight = !0, g.getScene().addLight(g), g._uniformBuffer = new O.a(g.getScene().getEngine()), g._buildUniformLayout(), g.includedOnlyMeshes = new Array(), g.excludedMeshes = new Array(), g._resyncMeshes(), g;\n          }\n          return Object(V.d)(T, c), Object.defineProperty(T.prototype, \"range\", { get: function() {\n            return this._range;\n          }, set: function(S) {\n            this._range = S, this._inverseSquaredRange = 1 / (this.range * this.range);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"intensityMode\", { get: function() {\n            return this._intensityMode;\n          }, set: function(S) {\n            this._intensityMode = S, this._computePhotometricScale();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"radius\", { get: function() {\n            return this._radius;\n          }, set: function(S) {\n            this._radius = S, this._computePhotometricScale();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"shadowEnabled\", { get: function() {\n            return this._shadowEnabled;\n          }, set: function(S) {\n            this._shadowEnabled !== S && (this._shadowEnabled = S, this._markMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"includedOnlyMeshes\", { get: function() {\n            return this._includedOnlyMeshes;\n          }, set: function(S) {\n            this._includedOnlyMeshes = S, this._hookArrayForIncludedOnly(S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"excludedMeshes\", { get: function() {\n            return this._excludedMeshes;\n          }, set: function(S) {\n            this._excludedMeshes = S, this._hookArrayForExcluded(S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"excludeWithLayerMask\", { get: function() {\n            return this._excludeWithLayerMask;\n          }, set: function(S) {\n            this._excludeWithLayerMask = S, this._resyncMeshes();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"includeOnlyWithLayerMask\", { get: function() {\n            return this._includeOnlyWithLayerMask;\n          }, set: function(S) {\n            this._includeOnlyWithLayerMask = S, this._resyncMeshes();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"lightmapMode\", { get: function() {\n            return this._lightmapMode;\n          }, set: function(S) {\n            this._lightmapMode !== S && (this._lightmapMode = S, this._markMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), T.prototype.transferTexturesToEffect = function(S, E) {\n            return this;\n          }, T.prototype._bindLight = function(S, E, g, l, h) {\n            h === void 0 && (h = !1);\n            var v = S.toString(), b = !1;\n            if (!h || !this._uniformBuffer._alreadyBound) {\n              if (this._uniformBuffer.bindToEffect(g, \"Light\" + v), this._renderId !== E.getRenderId() || !this._uniformBuffer.useUbo) {\n                this._renderId = E.getRenderId();\n                var D = this.getScaledIntensity();\n                this.transferToEffect(g, v), this.diffuse.scaleToRef(D, u.c.Color3[0]), this._uniformBuffer.updateColor4(\"vLightDiffuse\", u.c.Color3[0], this.range, v), l && (this.specular.scaleToRef(D, u.c.Color3[1]), this._uniformBuffer.updateColor4(\"vLightSpecular\", u.c.Color3[1], this.radius, v)), b = !0;\n              }\n              if (this.transferTexturesToEffect(g, v), E.shadowsEnabled && this.shadowEnabled) {\n                var w = this.getShadowGenerator();\n                w && (w.bindShadowLight(v, g), b = !0);\n              }\n              b && this._uniformBuffer.update();\n            }\n          }, T.prototype.getClassName = function() {\n            return \"Light\";\n          }, T.prototype.toString = function(S) {\n            var E = \"Name: \" + this.name;\n            if (E += \", type: \" + [\"Point\", \"Directional\", \"Spot\", \"Hemispheric\"][this.getTypeID()], this.animations)\n              for (var g = 0; g < this.animations.length; g++)\n                E += \", animation[0]: \" + this.animations[g].toString(S);\n            return E;\n          }, T.prototype._syncParentEnabledState = function() {\n            c.prototype._syncParentEnabledState.call(this), this.isDisposed() || this._resyncMeshes();\n          }, T.prototype.setEnabled = function(S) {\n            c.prototype.setEnabled.call(this, S), this._resyncMeshes();\n          }, T.prototype.getShadowGenerator = function() {\n            return this._shadowGenerator;\n          }, T.prototype.getAbsolutePosition = function() {\n            return C.e.Zero();\n          }, T.prototype.canAffectMesh = function(S) {\n            return !S || !(this.includedOnlyMeshes && this.includedOnlyMeshes.length > 0 && this.includedOnlyMeshes.indexOf(S) === -1) && !(this.excludedMeshes && this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(S) !== -1) && (this.includeOnlyWithLayerMask === 0 || (this.includeOnlyWithLayerMask & S.layerMask) != 0) && !(this.excludeWithLayerMask !== 0 && this.excludeWithLayerMask & S.layerMask);\n          }, T.CompareLightsPriority = function(S, E) {\n            return S.shadowEnabled !== E.shadowEnabled ? (E.shadowEnabled ? 1 : 0) - (S.shadowEnabled ? 1 : 0) : E.renderPriority - S.renderPriority;\n          }, T.prototype.dispose = function(S, E) {\n            E === void 0 && (E = !1), this._shadowGenerator && (this._shadowGenerator.dispose(), this._shadowGenerator = null), this.getScene().stopAnimation(this);\n            for (var g = 0, l = this.getScene().meshes; g < l.length; g++)\n              l[g]._removeLightSource(this, !0);\n            this._uniformBuffer.dispose(), this.getScene().removeLight(this), c.prototype.dispose.call(this, S, E);\n          }, T.prototype.getTypeID = function() {\n            return 0;\n          }, T.prototype.getScaledIntensity = function() {\n            return this._photometricScale * this.intensity;\n          }, T.prototype.clone = function(S, E) {\n            E === void 0 && (E = null);\n            var g = T.GetConstructorFromName(this.getTypeID(), S, this.getScene());\n            if (!g)\n              return null;\n            var l = _.a.Clone(g, this);\n            return E && (l.parent = E), l.setEnabled(this.isEnabled()), l;\n          }, T.prototype.serialize = function() {\n            var S = _.a.Serialize(this);\n            return S.type = this.getTypeID(), this.parent && (S.parentId = this.parent.id), this.excludedMeshes.length > 0 && (S.excludedMeshesIds = [], this.excludedMeshes.forEach(function(E) {\n              S.excludedMeshesIds.push(E.id);\n            })), this.includedOnlyMeshes.length > 0 && (S.includedOnlyMeshesIds = [], this.includedOnlyMeshes.forEach(function(E) {\n              S.includedOnlyMeshesIds.push(E.id);\n            })), _.a.AppendSerializedAnimations(this, S), S.ranges = this.serializeAnimationRanges(), S;\n          }, T.GetConstructorFromName = function(S, E, g) {\n            var l = I.a.Construct(\"Light_Type_\" + S, E, g);\n            return l || null;\n          }, T.Parse = function(S, E) {\n            var g = T.GetConstructorFromName(S.type, S.name, E);\n            if (!g)\n              return null;\n            var l = _.a.Parse(g, S, E);\n            if (S.excludedMeshesIds && (l._excludedMeshesIds = S.excludedMeshesIds), S.includedOnlyMeshesIds && (l._includedOnlyMeshesIds = S.includedOnlyMeshesIds), S.parentId && (l._waitingParentId = S.parentId), S.falloffType !== void 0 && (l.falloffType = S.falloffType), S.lightmapMode !== void 0 && (l.lightmapMode = S.lightmapMode), S.animations) {\n              for (var h = 0; h < S.animations.length; h++) {\n                var v = S.animations[h], b = x.a.GetClass(\"BABYLON.Animation\");\n                b && l.animations.push(b.Parse(v));\n              }\n              I.a.ParseAnimationRanges(l, S, E);\n            }\n            return S.autoAnimate && E.beginAnimation(l, S.autoAnimateFrom, S.autoAnimateTo, S.autoAnimateLoop, S.autoAnimateSpeed || 1), l;\n          }, T.prototype._hookArrayForExcluded = function(S) {\n            var E = this, g = S.push;\n            S.push = function() {\n              for (var b = [], D = 0; D < arguments.length; D++)\n                b[D] = arguments[D];\n              for (var w = g.apply(S, b), N = 0, M = b; N < M.length; N++) {\n                var U = M[N];\n                U._resyncLightSource(E);\n              }\n              return w;\n            };\n            var l = S.splice;\n            S.splice = function(b, D) {\n              for (var w = l.apply(S, [b, D]), N = 0, M = w; N < M.length; N++)\n                M[N]._resyncLightSource(E);\n              return w;\n            };\n            for (var h = 0, v = S; h < v.length; h++)\n              v[h]._resyncLightSource(this);\n          }, T.prototype._hookArrayForIncludedOnly = function(S) {\n            var E = this, g = S.push;\n            S.push = function() {\n              for (var h = [], v = 0; v < arguments.length; v++)\n                h[v] = arguments[v];\n              var b = g.apply(S, h);\n              return E._resyncMeshes(), b;\n            };\n            var l = S.splice;\n            S.splice = function(h, v) {\n              var b = l.apply(S, [h, v]);\n              return E._resyncMeshes(), b;\n            }, this._resyncMeshes();\n          }, T.prototype._resyncMeshes = function() {\n            for (var S = 0, E = this.getScene().meshes; S < E.length; S++)\n              E[S]._resyncLightSource(this);\n          }, T.prototype._markMeshesAsLightDirty = function() {\n            for (var S = 0, E = this.getScene().meshes; S < E.length; S++) {\n              var g = E[S];\n              g.lightSources.indexOf(this) !== -1 && g._markSubMeshesAsLightDirty();\n            }\n          }, T.prototype._computePhotometricScale = function() {\n            this._photometricScale = this._getPhotometricScale(), this.getScene().resetCachedMaterial();\n          }, T.prototype._getPhotometricScale = function() {\n            var S = 0, E = this.getTypeID(), g = this.intensityMode;\n            switch (g === T.INTENSITYMODE_AUTOMATIC && (g = E === T.LIGHTTYPEID_DIRECTIONALLIGHT ? T.INTENSITYMODE_ILLUMINANCE : T.INTENSITYMODE_LUMINOUSINTENSITY), E) {\n              case T.LIGHTTYPEID_POINTLIGHT:\n              case T.LIGHTTYPEID_SPOTLIGHT:\n                switch (g) {\n                  case T.INTENSITYMODE_LUMINOUSPOWER:\n                    S = 1 / (4 * Math.PI);\n                    break;\n                  case T.INTENSITYMODE_LUMINOUSINTENSITY:\n                    S = 1;\n                    break;\n                  case T.INTENSITYMODE_LUMINANCE:\n                    S = this.radius * this.radius;\n                }\n                break;\n              case T.LIGHTTYPEID_DIRECTIONALLIGHT:\n                switch (g) {\n                  case T.INTENSITYMODE_ILLUMINANCE:\n                    S = 1;\n                    break;\n                  case T.INTENSITYMODE_LUMINANCE:\n                    var l = this.radius;\n                    l = Math.max(l, 1e-3), S = 2 * Math.PI * (1 - Math.cos(l));\n                }\n                break;\n              case T.LIGHTTYPEID_HEMISPHERICLIGHT:\n                S = 1;\n            }\n            return S;\n          }, T.prototype._reorderLightsInScene = function() {\n            var S = this.getScene();\n            this._renderPriority != 0 && (S.requireLightSorting = !0), this.getScene().sortLightsByPriority();\n          }, T.FALLOFF_DEFAULT = 0, T.FALLOFF_PHYSICAL = 1, T.FALLOFF_GLTF = 2, T.FALLOFF_STANDARD = 3, T.LIGHTMAP_DEFAULT = 0, T.LIGHTMAP_SPECULAR = 1, T.LIGHTMAP_SHADOWSONLY = 2, T.INTENSITYMODE_AUTOMATIC = 0, T.INTENSITYMODE_LUMINOUSPOWER = 1, T.INTENSITYMODE_LUMINOUSINTENSITY = 2, T.INTENSITYMODE_ILLUMINANCE = 3, T.INTENSITYMODE_LUMINANCE = 4, T.LIGHTTYPEID_POINTLIGHT = 0, T.LIGHTTYPEID_DIRECTIONALLIGHT = 1, T.LIGHTTYPEID_SPOTLIGHT = 2, T.LIGHTTYPEID_HEMISPHERICLIGHT = 3, Object(V.c)([Object(_.e)()], T.prototype, \"diffuse\", void 0), Object(V.c)([Object(_.e)()], T.prototype, \"specular\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"falloffType\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"intensity\", void 0), Object(V.c)([Object(_.c)()], T.prototype, \"range\", null), Object(V.c)([Object(_.c)()], T.prototype, \"intensityMode\", null), Object(V.c)([Object(_.c)()], T.prototype, \"radius\", null), Object(V.c)([Object(_.c)()], T.prototype, \"_renderPriority\", void 0), Object(V.c)([Object(_.b)(\"_reorderLightsInScene\")], T.prototype, \"renderPriority\", void 0), Object(V.c)([Object(_.c)(\"shadowEnabled\")], T.prototype, \"_shadowEnabled\", void 0), Object(V.c)([Object(_.c)(\"excludeWithLayerMask\")], T.prototype, \"_excludeWithLayerMask\", void 0), Object(V.c)([Object(_.c)(\"includeOnlyWithLayerMask\")], T.prototype, \"_includeOnlyWithLayerMask\", void 0), Object(V.c)([Object(_.c)(\"lightmapMode\")], T.prototype, \"_lightmapMode\", void 0), T;\n        }(I.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._xhr = typeof _native < \"u\" && _native.XMLHttpRequest ? new _native.XMLHttpRequest() : new XMLHttpRequest();\n          }\n          return _.prototype._injectCustomRequestHeaders = function() {\n            for (var C in _.CustomRequestHeaders) {\n              var u = _.CustomRequestHeaders[C];\n              u && this._xhr.setRequestHeader(C, u);\n            }\n          }, Object.defineProperty(_.prototype, \"onprogress\", { get: function() {\n            return this._xhr.onprogress;\n          }, set: function(C) {\n            this._xhr.onprogress = C;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"readyState\", { get: function() {\n            return this._xhr.readyState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"status\", { get: function() {\n            return this._xhr.status;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"statusText\", { get: function() {\n            return this._xhr.statusText;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"response\", { get: function() {\n            return this._xhr.response;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"responseURL\", { get: function() {\n            return this._xhr.responseURL;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"responseText\", { get: function() {\n            return this._xhr.responseText;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"responseType\", { get: function() {\n            return this._xhr.responseType;\n          }, set: function(C) {\n            this._xhr.responseType = C;\n          }, enumerable: !1, configurable: !0 }), _.prototype.addEventListener = function(C, u, I) {\n            this._xhr.addEventListener(C, u, I);\n          }, _.prototype.removeEventListener = function(C, u, I) {\n            this._xhr.removeEventListener(C, u, I);\n          }, _.prototype.abort = function() {\n            this._xhr.abort();\n          }, _.prototype.send = function(C) {\n            _.CustomRequestHeaders && this._injectCustomRequestHeaders(), this._xhr.send(C);\n          }, _.prototype.open = function(C, u) {\n            for (var I = 0, O = _.CustomRequestModifiers; I < O.length; I++)\n              (0, O[I])(this._xhr, u);\n            return u = (u = u.replace(\"file:http:\", \"http:\")).replace(\"file:https:\", \"https:\"), this._xhr.open(C, u, !0);\n          }, _.prototype.setRequestHeader = function(C, u) {\n            this._xhr.setRequestHeader(C, u);\n          }, _.prototype.getResponseHeader = function(C) {\n            return this._xhr.getResponseHeader(C);\n          }, _.CustomRequestHeaders = {}, _.CustomRequestModifiers = new Array(), _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"e\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        }), f.d(A, \"d\", function() {\n          return u;\n        }), f.d(A, \"c\", function() {\n          return I;\n        }), f.d(A, \"b\", function() {\n          return O;\n        });\n        var V = f(1), _ = function() {\n          function x(m, c) {\n            this.type = m, this.jointData = c, c.nativeParams = c.nativeParams || {};\n          }\n          return Object.defineProperty(x.prototype, \"physicsJoint\", { get: function() {\n            return this._physicsJoint;\n          }, set: function(m) {\n            this._physicsJoint, this._physicsJoint = m;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"physicsPlugin\", { set: function(m) {\n            this._physicsPlugin = m;\n          }, enumerable: !1, configurable: !0 }), x.prototype.executeNativeFunction = function(m) {\n            m(this._physicsPlugin.world, this._physicsJoint);\n          }, x.DistanceJoint = 0, x.HingeJoint = 1, x.BallAndSocketJoint = 2, x.WheelJoint = 3, x.SliderJoint = 4, x.PrismaticJoint = 5, x.UniversalJoint = 6, x.Hinge2Joint = x.WheelJoint, x.PointToPointJoint = 8, x.SpringJoint = 9, x.LockJoint = 10, x;\n        }(), C = function(x) {\n          function m(c) {\n            return x.call(this, _.DistanceJoint, c) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.updateDistance = function(c, T) {\n            this._physicsPlugin.updateDistanceJoint(this, c, T);\n          }, m;\n        }(_), u = function(x) {\n          function m(c, T) {\n            return x.call(this, c, T) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.setMotor = function(c, T) {\n            this._physicsPlugin.setMotor(this, c || 0, T);\n          }, m.prototype.setLimit = function(c, T) {\n            this._physicsPlugin.setLimit(this, c, T);\n          }, m;\n        }(_), I = function(x) {\n          function m(c) {\n            return x.call(this, _.HingeJoint, c) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.setMotor = function(c, T) {\n            this._physicsPlugin.setMotor(this, c || 0, T);\n          }, m.prototype.setLimit = function(c, T) {\n            this._physicsPlugin.setLimit(this, c, T);\n          }, m;\n        }(u), O = function(x) {\n          function m(c) {\n            return x.call(this, _.Hinge2Joint, c) || this;\n          }\n          return Object(V.d)(m, x), m.prototype.setMotor = function(c, T, S) {\n            S === void 0 && (S = 0), this._physicsPlugin.setMotor(this, c || 0, T, S);\n          }, m.prototype.setLimit = function(c, T, S) {\n            S === void 0 && (S = 0), this._physicsPlugin.setLimit(this, c, T, S);\n          }, m;\n        }(u);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(0), _ = f(7), C = f(36), u = f(18), I = function() {\n          function O(x) {\n            var m = this;\n            x === void 0 && (x = C.a.DefaultUtilityLayer), this.gizmoLayer = x, this._attachedMesh = null, this._attachedNode = null, this._scaleRatio = 1, this._isHovered = !1, this._customMeshSet = !1, this._updateGizmoRotationToMatchAttachedMesh = !0, this.updateGizmoPositionToMatchAttachedMesh = !0, this.updateScale = !0, this._interactionsEnabled = !0, this._tempQuaternion = new V.b(0, 0, 0, 1), this._tempVector = new V.e(), this._tempVector2 = new V.e(), this._tempMatrix1 = new V.a(), this._tempMatrix2 = new V.a(), this._rightHandtoLeftHandMatrix = V.a.RotationY(Math.PI), this._rootMesh = new _.a(\"gizmoRootNode\", x.utilityLayerScene), this._rootMesh.rotationQuaternion = V.b.Identity(), this._beforeRenderObserver = this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(function() {\n              m._update();\n            });\n          }\n          return Object.defineProperty(O.prototype, \"scaleRatio\", { get: function() {\n            return this._scaleRatio;\n          }, set: function(x) {\n            this._scaleRatio = x;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"isHovered\", { get: function() {\n            return this._isHovered;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"attachedMesh\", { get: function() {\n            return this._attachedMesh;\n          }, set: function(x) {\n            this._attachedMesh = x, x && (this._attachedNode = x), this._rootMesh.setEnabled(!!x), this._attachedNodeChanged(x);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"attachedNode\", { get: function() {\n            return this._attachedNode;\n          }, set: function(x) {\n            this._attachedNode = x, this._attachedMesh = null, this._rootMesh.setEnabled(!!x), this._attachedNodeChanged(x);\n          }, enumerable: !1, configurable: !0 }), O.prototype.setCustomMesh = function(x) {\n            if (x.getScene() != this.gizmoLayer.utilityLayerScene)\n              throw \"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)\";\n            this._rootMesh.getChildMeshes().forEach(function(m) {\n              m.dispose();\n            }), x.parent = this._rootMesh, this._customMeshSet = !0;\n          }, Object.defineProperty(O.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this._updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(x) {\n            this._updateGizmoRotationToMatchAttachedMesh = x;\n          }, enumerable: !1, configurable: !0 }), O.prototype._attachedNodeChanged = function(x) {\n          }, O.prototype._update = function() {\n            if (this.attachedNode) {\n              var x = this.attachedNode;\n              if (this.attachedMesh && (x = this.attachedMesh._effectiveMesh || this.attachedNode), this.updateGizmoPositionToMatchAttachedMesh) {\n                var m = x.getWorldMatrix().getRow(3), c = m ? m.toVector3() : new V.e(0, 0, 0);\n                this._rootMesh.position.copyFrom(c);\n              }\n              if (this.updateGizmoRotationToMatchAttachedMesh ? x.getWorldMatrix().decompose(void 0, this._rootMesh.rotationQuaternion) : this._rootMesh.rotationQuaternion.set(0, 0, 0, 1), this.updateScale) {\n                var T = this.gizmoLayer.utilityLayerScene.activeCamera, S = T.globalPosition;\n                T.devicePosition && (S = T.devicePosition), this._rootMesh.position.subtractToRef(S, this._tempVector);\n                var E = this._tempVector.length() * this.scaleRatio;\n                this._rootMesh.scaling.set(E, E, E), x._getWorldMatrixDeterminant() < 0 && (this._rootMesh.scaling.y *= -1);\n              } else\n                this._rootMesh.scaling.setAll(this.scaleRatio);\n            }\n          }, O.prototype._matrixChanged = function() {\n            if (this._attachedNode) {\n              if (this._attachedNode._isCamera) {\n                var x, m, c = this._attachedNode;\n                if (c.parent) {\n                  var T = this._tempMatrix2;\n                  c.parent._worldMatrix.invertToRef(T), this._attachedNode._worldMatrix.multiplyToRef(T, this._tempMatrix1), x = this._tempMatrix1;\n                } else\n                  x = this._attachedNode._worldMatrix;\n                if (c.getScene().useRightHandedSystem ? (this._rightHandtoLeftHandMatrix.multiplyToRef(x, this._tempMatrix2), m = this._tempMatrix2) : m = x, m.decompose(this._tempVector2, this._tempQuaternion, this._tempVector), this._attachedNode.getClassName() === \"FreeCamera\" || this._attachedNode.getClassName() === \"FlyCamera\" || this._attachedNode.getClassName() === \"ArcFollowCamera\" || this._attachedNode.getClassName() === \"TargetCamera\" || this._attachedNode.getClassName() === \"TouchCamera\" || this._attachedNode.getClassName() === \"UniversalCamera\") {\n                  var S = this._attachedNode;\n                  S.rotation = this._tempQuaternion.toEulerAngles(), S.rotationQuaternion && S.rotationQuaternion.copyFrom(this._tempQuaternion);\n                }\n                c.position.copyFrom(this._tempVector);\n              } else if (this._attachedNode._isMesh || this._attachedNode.getClassName() === \"AbstractMesh\" || this._attachedNode.getClassName() === \"TransformNode\" || this._attachedNode.getClassName() === \"InstancedMesh\") {\n                var E = this._attachedNode;\n                if (E.parent) {\n                  T = this._tempMatrix1;\n                  var g = this._tempMatrix2;\n                  E.parent.getWorldMatrix().invertToRef(T), this._attachedNode.getWorldMatrix().multiplyToRef(T, g), g.decompose(E.scaling, this._tempQuaternion, E.position);\n                } else\n                  this._attachedNode._worldMatrix.decompose(E.scaling, this._tempQuaternion, E.position);\n                E.billboardMode || (E.rotationQuaternion ? E.rotationQuaternion.copyFrom(this._tempQuaternion) : E.rotation = this._tempQuaternion.toEulerAngles());\n              } else if (this._attachedNode.getClassName() === \"Bone\") {\n                var l = this._attachedNode, h = l.getParent();\n                if (h) {\n                  var v = this._tempMatrix1, b = this._tempMatrix2;\n                  h.getWorldMatrix().invertToRef(v), l.getWorldMatrix().multiplyToRef(v, b), l.getLocalMatrix().copyFrom(b);\n                } else\n                  l.getLocalMatrix().copyFrom(l.getWorldMatrix());\n                l.markAsDirty();\n              }\n            }\n          }, O.GizmoAxisPointerObserver = function(x, m) {\n            var c = !1;\n            return x.utilityLayerScene.onPointerObservable.add(function(T) {\n              var S, E;\n              if (T.pickInfo) {\n                if (T.type === u.a.POINTERMOVE) {\n                  if (c)\n                    return;\n                  m.forEach(function(g) {\n                    var l, h;\n                    if (g.colliderMeshes && g.gizmoMeshes) {\n                      var v = ((l = g.colliderMeshes) === null || l === void 0 ? void 0 : l.indexOf((h = T == null ? void 0 : T.pickInfo) === null || h === void 0 ? void 0 : h.pickedMesh)) != -1 || g.active ? g.hoverMaterial : g.material;\n                      g.gizmoMeshes.forEach(function(b) {\n                        b.material = v, b.color && (b.color = v.diffuseColor);\n                      });\n                    }\n                  });\n                }\n                T.type === u.a.POINTERDOWN && m.has((S = T.pickInfo.pickedMesh) === null || S === void 0 ? void 0 : S.parent) && (c = !0, m.get((E = T.pickInfo.pickedMesh) === null || E === void 0 ? void 0 : E.parent).active = !0, m.forEach(function(g) {\n                  var l, h, v = ((l = g.colliderMeshes) === null || l === void 0 ? void 0 : l.indexOf((h = T == null ? void 0 : T.pickInfo) === null || h === void 0 ? void 0 : h.pickedMesh)) != -1 || g.active ? g.hoverMaterial : g.disableMaterial;\n                  g.gizmoMeshes.forEach(function(b) {\n                    b.material = v, b.color && (b.color = v.diffuseColor);\n                  });\n                })), T.type === u.a.POINTERUP && m.forEach(function(g) {\n                  g.active = !1, c = !1, g.gizmoMeshes.forEach(function(l) {\n                    l.material = g.material, l.color && (l.color = g.material.diffuseColor);\n                  });\n                });\n              }\n            });\n          }, O.prototype.dispose = function() {\n            this._rootMesh.dispose(), this._beforeRenderObserver && this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver);\n          }, O;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return c;\n        });\n        var V = f(1), _ = f(3), C = f(6), u = f(0), I = f(22), O = f(2), x = f(120), m = (f(56), f(77)), c = function(T) {\n          function S(E) {\n            var g = T.call(this, null) || this;\n            return g.metadata = null, g.reservedDataStore = null, g._hasAlpha = !1, g.getAlphaFromRGB = !1, g.level = 1, g.coordinatesIndex = 0, g._coordinatesMode = O.a.TEXTURE_EXPLICIT_MODE, g.wrapR = O.a.TEXTURE_WRAP_ADDRESSMODE, g.anisotropicFilteringLevel = S.DEFAULT_ANISOTROPIC_FILTERING_LEVEL, g._isCube = !1, g._gammaSpace = !0, g.invertZ = !1, g.lodLevelInAlpha = !1, g.isRenderTarget = !1, g._prefiltered = !1, g.animations = new Array(), g.onDisposeObservable = new C.c(), g._onDisposeObserver = null, g._scene = null, g._texture = null, g._uid = null, E ? S._isScene(E) ? g._scene = E : g._engine = E : g._scene = I.a.LastCreatedScene, g._scene && (g.uniqueId = g._scene.getUniqueId(), g._scene.addTexture(g), g._engine = g._scene.getEngine()), g._uid = null, g;\n          }\n          return Object(V.d)(S, T), Object.defineProperty(S.prototype, \"hasAlpha\", { get: function() {\n            return this._hasAlpha;\n          }, set: function(E) {\n            this._hasAlpha !== E && (this._hasAlpha = E, this._scene && this._scene.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag | O.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"coordinatesMode\", { get: function() {\n            return this._coordinatesMode;\n          }, set: function(E) {\n            this._coordinatesMode !== E && (this._coordinatesMode = E, this._scene && this._scene.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"wrapU\", { get: function() {\n            return this._wrapU;\n          }, set: function(E) {\n            this._wrapU = E;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"wrapV\", { get: function() {\n            return this._wrapV;\n          }, set: function(E) {\n            this._wrapV = E;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isCube\", { get: function() {\n            return this._texture ? this._texture.isCube : this._isCube;\n          }, set: function(E) {\n            this._texture ? this._texture.isCube = E : this._isCube = E;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"is3D\", { get: function() {\n            return !!this._texture && this._texture.is3D;\n          }, set: function(E) {\n            this._texture && (this._texture.is3D = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"is2DArray\", { get: function() {\n            return !!this._texture && this._texture.is2DArray;\n          }, set: function(E) {\n            this._texture && (this._texture.is2DArray = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"gammaSpace\", { get: function() {\n            return this._texture ? (this._texture._gammaSpace === null && (this._texture._gammaSpace = this._gammaSpace), this._texture._gammaSpace) : this._gammaSpace;\n          }, set: function(E) {\n            if (this._texture) {\n              if (this._texture._gammaSpace === E)\n                return;\n              this._texture._gammaSpace = E;\n            } else {\n              if (this._gammaSpace === E)\n                return;\n              this._gammaSpace = E;\n            }\n            this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isRGBD\", { get: function() {\n            return this._texture != null && this._texture._isRGBD;\n          }, set: function(E) {\n            this._texture && (this._texture._isRGBD = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"noMipmap\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"lodGenerationOffset\", { get: function() {\n            return this._texture ? this._texture._lodGenerationOffset : 0;\n          }, set: function(E) {\n            this._texture && (this._texture._lodGenerationOffset = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"lodGenerationScale\", { get: function() {\n            return this._texture ? this._texture._lodGenerationScale : 0;\n          }, set: function(E) {\n            this._texture && (this._texture._lodGenerationScale = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"linearSpecularLOD\", { get: function() {\n            return !!this._texture && this._texture._linearSpecularLOD;\n          }, set: function(E) {\n            this._texture && (this._texture._linearSpecularLOD = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"irradianceTexture\", { get: function() {\n            return this._texture ? this._texture._irradianceTexture : null;\n          }, set: function(E) {\n            this._texture && (this._texture._irradianceTexture = E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"uid\", { get: function() {\n            return this._uid || (this._uid = x.a.RandomId()), this._uid;\n          }, enumerable: !1, configurable: !0 }), S.prototype.toString = function() {\n            return this.name;\n          }, S.prototype.getClassName = function() {\n            return \"BaseTexture\";\n          }, Object.defineProperty(S.prototype, \"onDispose\", { set: function(E) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(E);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"isBlocking\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), S.prototype.getScene = function() {\n            return this._scene;\n          }, S.prototype._getEngine = function() {\n            return this._engine;\n          }, S.prototype.checkTransformsAreIdentical = function(E) {\n            return E !== null;\n          }, S.prototype.getTextureMatrix = function() {\n            return u.a.IdentityReadOnly;\n          }, S.prototype.getReflectionTextureMatrix = function() {\n            return u.a.IdentityReadOnly;\n          }, S.prototype.isReadyOrNotBlocking = function() {\n            return !this.isBlocking || this.isReady();\n          }, S.prototype.scale = function(E) {\n          }, Object.defineProperty(S.prototype, \"canRescale\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), S.prototype._getFromCache = function(E, g, l, h) {\n            var v = this._getEngine();\n            if (!v)\n              return null;\n            for (var b = v.getLoadedTexturesCache(), D = 0; D < b.length; D++) {\n              var w = b[D];\n              if (!(h !== void 0 && h !== w.invertY || w.url !== E || w.generateMipMaps !== !g || l && l !== w.samplingMode))\n                return w.incrementReferences(), w;\n            }\n            return null;\n          }, S.prototype._rebuild = function() {\n          }, S.prototype.clone = function() {\n            return null;\n          }, Object.defineProperty(S.prototype, \"textureType\", { get: function() {\n            return this._texture && this._texture.type !== void 0 ? this._texture.type : O.a.TEXTURETYPE_UNSIGNED_INT;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"textureFormat\", { get: function() {\n            return this._texture && this._texture.format !== void 0 ? this._texture.format : O.a.TEXTUREFORMAT_RGBA;\n          }, enumerable: !1, configurable: !0 }), S.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            var E = this.getScene();\n            E && E.markAllMaterialsAsDirty(O.a.MATERIAL_TextureDirtyFlag);\n          }, S.prototype.readPixels = function(E, g, l) {\n            if (E === void 0 && (E = 0), g === void 0 && (g = 0), l === void 0 && (l = null), !this._texture)\n              return null;\n            var h = this.getSize(), v = h.width, b = h.height, D = this._getEngine();\n            if (!D)\n              return null;\n            g != 0 && (v /= Math.pow(2, g), b /= Math.pow(2, g), v = Math.round(v), b = Math.round(b));\n            try {\n              return this._texture.isCube ? D._readTexturePixels(this._texture, v, b, E, g, l) : D._readTexturePixels(this._texture, v, b, -1, g, l);\n            } catch {\n              return null;\n            }\n          }, Object.defineProperty(S.prototype, \"_lodTextureHigh\", { get: function() {\n            return this._texture ? this._texture._lodTextureHigh : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"_lodTextureMid\", { get: function() {\n            return this._texture ? this._texture._lodTextureMid : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(S.prototype, \"_lodTextureLow\", { get: function() {\n            return this._texture ? this._texture._lodTextureLow : null;\n          }, enumerable: !1, configurable: !0 }), S.prototype.dispose = function() {\n            if (this._scene) {\n              this._scene.stopAnimation && this._scene.stopAnimation(this), this._scene._removePendingData(this);\n              var E = this._scene.textures.indexOf(this);\n              E >= 0 && this._scene.textures.splice(E, 1), this._scene.onTextureRemovedObservable.notifyObservers(this), this._scene = null;\n            }\n            this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), T.prototype.dispose.call(this);\n          }, S.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var E = _.a.Serialize(this);\n            return _.a.AppendSerializedAnimations(this, E), E;\n          }, S.WhenAllReady = function(E, g) {\n            var l = E.length;\n            if (l !== 0)\n              for (var h = 0; h < E.length; h++) {\n                var v = E[h];\n                if (v.isReady())\n                  --l == 0 && g();\n                else {\n                  var b = v.onLoadObservable;\n                  b && b.addOnce(function() {\n                    --l == 0 && g();\n                  });\n                }\n              }\n            else\n              g();\n          }, S._isScene = function(E) {\n            return E.getClassName() === \"Scene\";\n          }, S.DEFAULT_ANISOTROPIC_FILTERING_LEVEL = 4, Object(V.c)([Object(_.c)()], S.prototype, \"uniqueId\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"name\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"metadata\", void 0), Object(V.c)([Object(_.c)(\"hasAlpha\")], S.prototype, \"_hasAlpha\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"getAlphaFromRGB\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"level\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"coordinatesIndex\", void 0), Object(V.c)([Object(_.c)(\"coordinatesMode\")], S.prototype, \"_coordinatesMode\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"wrapU\", null), Object(V.c)([Object(_.c)()], S.prototype, \"wrapV\", null), Object(V.c)([Object(_.c)()], S.prototype, \"wrapR\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"anisotropicFilteringLevel\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"isCube\", null), Object(V.c)([Object(_.c)()], S.prototype, \"is3D\", null), Object(V.c)([Object(_.c)()], S.prototype, \"is2DArray\", null), Object(V.c)([Object(_.c)()], S.prototype, \"gammaSpace\", null), Object(V.c)([Object(_.c)()], S.prototype, \"invertZ\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"lodLevelInAlpha\", void 0), Object(V.c)([Object(_.c)()], S.prototype, \"lodGenerationOffset\", null), Object(V.c)([Object(_.c)()], S.prototype, \"lodGenerationScale\", null), Object(V.c)([Object(_.c)()], S.prototype, \"linearSpecularLOD\", null), Object(V.c)([Object(_.m)()], S.prototype, \"irradianceTexture\", null), Object(V.c)([Object(_.c)()], S.prototype, \"isRenderTarget\", void 0), S;\n        }(function() {\n          function T(S) {\n            this._wrapU = O.a.TEXTURE_WRAP_ADDRESSMODE, this._wrapV = O.a.TEXTURE_WRAP_ADDRESSMODE, this.wrapR = O.a.TEXTURE_WRAP_ADDRESSMODE, this.anisotropicFilteringLevel = 4, this.delayLoadState = O.a.DELAYLOADSTATE_NONE, this._texture = null, this._engine = null, this._cachedSize = m.a.Zero(), this._cachedBaseSize = m.a.Zero(), this._texture = S, this._texture && (this._engine = this._texture.getEngine());\n          }\n          return Object.defineProperty(T.prototype, \"wrapU\", { get: function() {\n            return this._wrapU;\n          }, set: function(S) {\n            this._wrapU = S;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"wrapV\", { get: function() {\n            return this._wrapV;\n          }, set: function(S) {\n            this._wrapV = S;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"coordinatesMode\", { get: function() {\n            return 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"isCube\", { get: function() {\n            return !!this._texture && this._texture.isCube;\n          }, set: function(S) {\n            this._texture && (this._texture.isCube = S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"is3D\", { get: function() {\n            return !!this._texture && this._texture.is3D;\n          }, set: function(S) {\n            this._texture && (this._texture.is3D = S);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(T.prototype, \"is2DArray\", { get: function() {\n            return !!this._texture && this._texture.is2DArray;\n          }, set: function(S) {\n            this._texture && (this._texture.is2DArray = S);\n          }, enumerable: !1, configurable: !0 }), T.prototype.getClassName = function() {\n            return \"ThinTexture\";\n          }, T.prototype.isReady = function() {\n            return this.delayLoadState === O.a.DELAYLOADSTATE_NOTLOADED ? (this.delayLoad(), !1) : !!this._texture && this._texture.isReady;\n          }, T.prototype.delayLoad = function() {\n          }, T.prototype.getInternalTexture = function() {\n            return this._texture;\n          }, T.prototype.getSize = function() {\n            if (this._texture) {\n              if (this._texture.width)\n                return this._cachedSize.width = this._texture.width, this._cachedSize.height = this._texture.height, this._cachedSize;\n              if (this._texture._size)\n                return this._cachedSize.width = this._texture._size, this._cachedSize.height = this._texture._size, this._cachedSize;\n            }\n            return this._cachedSize;\n          }, T.prototype.getBaseSize = function() {\n            return this.isReady() && this._texture ? this._texture._size ? (this._cachedBaseSize.width = this._texture._size, this._cachedBaseSize.height = this._texture._size, this._cachedBaseSize) : (this._cachedBaseSize.width = this._texture.baseWidth, this._cachedBaseSize.height = this._texture.baseHeight, this._cachedBaseSize) : (this._cachedBaseSize.width = 0, this._cachedBaseSize.height = 0, this._cachedBaseSize);\n          }, T.prototype.updateSamplingMode = function(S) {\n            this._texture && this._engine && this._engine.updateTextureSamplingMode(S, this._texture);\n          }, T.prototype.releaseInternalTexture = function() {\n            this._texture && (this._texture.dispose(), this._texture = null);\n          }, T.prototype.dispose = function() {\n            this._texture && (this.releaseInternalTexture(), this._engine = null);\n          }, T;\n        }());\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(0), _ = f(9), C = f(7), u = f(16), I = f(20), O = f(23);\n        u.a.CreateCylinder = function(m) {\n          var c = m.height || 2, T = m.diameterTop === 0 ? 0 : m.diameterTop || m.diameter || 1, S = m.diameterBottom === 0 ? 0 : m.diameterBottom || m.diameter || 1;\n          T = T || 1e-5, S = S || 1e-5;\n          var E, g = m.tessellation || 24, l = m.subdivisions || 1, h = !!m.hasRings, v = !!m.enclose, b = m.cap === 0 ? 0 : m.cap || C.a.CAP_ALL, D = m.arc && (m.arc <= 0 || m.arc > 1) ? 1 : m.arc || 1, w = m.sideOrientation === 0 ? 0 : m.sideOrientation || u.a.DEFAULTSIDE, N = m.faceUV || new Array(3), M = m.faceColors, U = 2 + (1 + (D !== 1 && v ? 2 : 0)) * (h ? l : 1);\n          for (E = 0; E < U; E++)\n            M && M[E] === void 0 && (M[E] = new _.b(1, 1, 1, 1));\n          for (E = 0; E < U; E++)\n            N && N[E] === void 0 && (N[E] = new V.f(0, 0, 1, 1));\n          var X, j, ne, te, de, pe, ae = new Array(), ee = new Array(), K = new Array(), $ = new Array(), L = new Array(), G = 2 * Math.PI * D / g, Q = (S - T) / 2 / c, oe = V.e.Zero(), re = V.e.Zero(), Y = V.e.Zero(), k = V.e.Zero(), H = V.e.Zero(), Z = O.a.Y, W = 1, q = 1, he = 0, ge = 0;\n          for (te = 0; te <= l; te++)\n            for (ne = ((j = te / l) * (T - S) + S) / 2, W = h && te !== 0 && te !== l ? 2 : 1, pe = 0; pe < W; pe++) {\n              for (h && (q += pe), v && (q += 2 * pe), de = 0; de <= g; de++)\n                X = de * G, oe.x = Math.cos(-X) * ne, oe.y = -c / 2 + j * c, oe.z = Math.sin(-X) * ne, T === 0 && te === l ? (re.x = K[K.length - 3 * (g + 1)], re.y = K[K.length - 3 * (g + 1) + 1], re.z = K[K.length - 3 * (g + 1) + 2]) : (re.x = oe.x, re.z = oe.z, re.y = Math.sqrt(re.x * re.x + re.z * re.z) * Q, re.normalize()), de === 0 && (Y.copyFrom(oe), k.copyFrom(re)), ee.push(oe.x, oe.y, oe.z), K.push(re.x, re.y, re.z), ge = h ? he !== q ? N[q].y : N[q].w : N[q].y + (N[q].w - N[q].y) * j, $.push(N[q].x + (N[q].z - N[q].x) * de / g, ge), M && L.push(M[q].r, M[q].g, M[q].b, M[q].a);\n              D !== 1 && v && (ee.push(oe.x, oe.y, oe.z), ee.push(0, oe.y, 0), ee.push(0, oe.y, 0), ee.push(Y.x, Y.y, Y.z), V.e.CrossToRef(Z, re, H), H.normalize(), K.push(H.x, H.y, H.z, H.x, H.y, H.z), V.e.CrossToRef(k, Z, H), H.normalize(), K.push(H.x, H.y, H.z, H.x, H.y, H.z), ge = h ? he !== q ? N[q + 1].y : N[q + 1].w : N[q + 1].y + (N[q + 1].w - N[q + 1].y) * j, $.push(N[q + 1].x, ge), $.push(N[q + 1].z, ge), ge = h ? he !== q ? N[q + 2].y : N[q + 2].w : N[q + 2].y + (N[q + 2].w - N[q + 2].y) * j, $.push(N[q + 2].x, ge), $.push(N[q + 2].z, ge), M && (L.push(M[q + 1].r, M[q + 1].g, M[q + 1].b, M[q + 1].a), L.push(M[q + 1].r, M[q + 1].g, M[q + 1].b, M[q + 1].a), L.push(M[q + 2].r, M[q + 2].g, M[q + 2].b, M[q + 2].a), L.push(M[q + 2].r, M[q + 2].g, M[q + 2].b, M[q + 2].a))), he !== q && (he = q);\n            }\n          var me = D !== 1 && v ? g + 4 : g;\n          for (te = 0, q = 0; q < l; q++) {\n            var _e = 0, ye = 0, Pe = 0, be = 0;\n            for (de = 0; de < g; de++)\n              _e = te * (me + 1) + de, ye = (te + 1) * (me + 1) + de, Pe = te * (me + 1) + (de + 1), be = (te + 1) * (me + 1) + (de + 1), ae.push(_e, ye, Pe), ae.push(be, Pe, ye);\n            D !== 1 && v && (ae.push(_e + 2, ye + 2, Pe + 2), ae.push(be + 2, Pe + 2, ye + 2), ae.push(_e + 4, ye + 4, Pe + 4), ae.push(be + 4, Pe + 4, ye + 4)), te = h ? te + 2 : te + 1;\n          }\n          var Fe = function(We) {\n            var je = We ? T / 2 : S / 2;\n            if (je !== 0) {\n              var He, Qe, Ge, tt = We ? N[U - 1] : N[0], Je = null;\n              M && (Je = We ? M[U - 1] : M[0]);\n              var st = ee.length / 3, at = We ? c / 2 : -c / 2, pt = new V.e(0, at, 0);\n              ee.push(pt.x, pt.y, pt.z), K.push(0, We ? 1 : -1, 0), $.push(tt.x + 0.5 * (tt.z - tt.x), tt.y + 0.5 * (tt.w - tt.y)), Je && L.push(Je.r, Je.g, Je.b, Je.a);\n              var Tt = new V.d(0.5, 0.5);\n              for (Ge = 0; Ge <= g; Ge++) {\n                He = 2 * Math.PI * Ge * D / g;\n                var Lt = Math.cos(-He), Ot = Math.sin(-He);\n                Qe = new V.e(Lt * je, at, Ot * je);\n                var St = new V.d(Lt * Tt.x + 0.5, Ot * Tt.y + 0.5);\n                ee.push(Qe.x, Qe.y, Qe.z), K.push(0, We ? 1 : -1, 0), $.push(tt.x + (tt.z - tt.x) * St.x, tt.y + (tt.w - tt.y) * St.y), Je && L.push(Je.r, Je.g, Je.b, Je.a);\n              }\n              for (Ge = 0; Ge < g; Ge++)\n                We ? (ae.push(st), ae.push(st + (Ge + 2)), ae.push(st + (Ge + 1))) : (ae.push(st), ae.push(st + (Ge + 1)), ae.push(st + (Ge + 2)));\n            }\n          };\n          b !== C.a.CAP_START && b !== C.a.CAP_ALL || Fe(!1), b !== C.a.CAP_END && b !== C.a.CAP_ALL || Fe(!0), u.a._ComputeSides(w, ee, ae, K, $, m.frontUVs, m.backUVs);\n          var ke = new u.a();\n          return ke.indices = ae, ke.positions = ee, ke.normals = K, ke.uvs = $, M && (ke.colors = L), ke;\n        }, C.a.CreateCylinder = function(m, c, T, S, E, g, l, h, v) {\n          l !== void 0 && l instanceof I.a || (l !== void 0 && (v = h || C.a.DEFAULTSIDE, h = l), l = g, g = 1);\n          var b = { height: c, diameterTop: T, diameterBottom: S, tessellation: E, subdivisions: g, sideOrientation: v, updatable: h };\n          return x.CreateCylinder(m, b, l);\n        };\n        var x = function() {\n          function m() {\n          }\n          return m.CreateCylinder = function(c, T, S) {\n            var E = new C.a(c, S);\n            return T.sideOrientation = C.a._GetDefaultSideOrientation(T.sideOrientation), E._originalBuilderSideOrientation = T.sideOrientation, u.a.CreateCylinder(T).applyToMesh(E, T.updatable), E;\n          }, m;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(0), _ = f(4), C = function() {\n          function u() {\n            this._pickingUnavailable = !1, this.hit = !1, this.distance = 0, this.pickedPoint = null, this.pickedMesh = null, this.bu = 0, this.bv = 0, this.faceId = -1, this.subMeshFaceId = -1, this.subMeshId = 0, this.pickedSprite = null, this.thinInstanceIndex = -1, this.originMesh = null, this.ray = null;\n          }\n          return u.prototype.getNormal = function(I, O) {\n            if (I === void 0 && (I = !1), O === void 0 && (O = !0), !this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(_.b.NormalKind))\n              return null;\n            var x, m = this.pickedMesh.getIndices();\n            if (!m)\n              return null;\n            if (O) {\n              var c = this.pickedMesh.getVerticesData(_.b.NormalKind), T = V.e.FromArray(c, 3 * m[3 * this.faceId]), S = V.e.FromArray(c, 3 * m[3 * this.faceId + 1]), E = V.e.FromArray(c, 3 * m[3 * this.faceId + 2]);\n              T = T.scale(this.bu), S = S.scale(this.bv), E = E.scale(1 - this.bu - this.bv), x = new V.e(T.x + S.x + E.x, T.y + S.y + E.y, T.z + S.z + E.z);\n            } else {\n              var g = this.pickedMesh.getVerticesData(_.b.PositionKind), l = V.e.FromArray(g, 3 * m[3 * this.faceId]), h = V.e.FromArray(g, 3 * m[3 * this.faceId + 1]), v = V.e.FromArray(g, 3 * m[3 * this.faceId + 2]), b = l.subtract(h), D = v.subtract(h);\n              x = V.e.Cross(b, D);\n            }\n            if (I) {\n              var w = this.pickedMesh.getWorldMatrix();\n              this.pickedMesh.nonUniformScaling && (V.c.Matrix[0].copyFrom(w), (w = V.c.Matrix[0]).setTranslationFromFloats(0, 0, 0), w.invert(), w.transposeToRef(V.c.Matrix[1]), w = V.c.Matrix[1]), x = V.e.TransformNormal(x, w);\n            }\n            return x.normalize(), x;\n          }, u.prototype.getTextureCoordinates = function() {\n            if (!this.pickedMesh || !this.pickedMesh.isVerticesDataPresent(_.b.UVKind))\n              return null;\n            var I = this.pickedMesh.getIndices();\n            if (!I)\n              return null;\n            var O = this.pickedMesh.getVerticesData(_.b.UVKind);\n            if (!O)\n              return null;\n            var x = V.d.FromArray(O, 2 * I[3 * this.faceId]), m = V.d.FromArray(O, 2 * I[3 * this.faceId + 1]), c = V.d.FromArray(O, 2 * I[3 * this.faceId + 2]);\n            return x = x.scale(this.bu), m = m.scale(this.bv), c = c.scale(1 - this.bu - this.bv), new V.d(x.x + m.x + c.x, x.y + m.y + c.y);\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(57), _ = function() {\n          function C() {\n            this._startMonitoringTime = 0, this._min = 0, this._max = 0, this._average = 0, this._lastSecAverage = 0, this._current = 0, this._totalValueCount = 0, this._totalAccumulated = 0, this._lastSecAccumulated = 0, this._lastSecTime = 0, this._lastSecValueCount = 0;\n          }\n          return Object.defineProperty(C.prototype, \"min\", { get: function() {\n            return this._min;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"max\", { get: function() {\n            return this._max;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"average\", { get: function() {\n            return this._average;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"lastSecAverage\", { get: function() {\n            return this._lastSecAverage;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"current\", { get: function() {\n            return this._current;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"total\", { get: function() {\n            return this._totalAccumulated;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"count\", { get: function() {\n            return this._totalValueCount;\n          }, enumerable: !1, configurable: !0 }), C.prototype.fetchNewFrame = function() {\n            this._totalValueCount++, this._current = 0, this._lastSecValueCount++;\n          }, C.prototype.addCount = function(u, I) {\n            C.Enabled && (this._current += u, I && this._fetchResult());\n          }, C.prototype.beginMonitoring = function() {\n            C.Enabled && (this._startMonitoringTime = V.a.Now);\n          }, C.prototype.endMonitoring = function(u) {\n            if (u === void 0 && (u = !0), C.Enabled) {\n              u && this.fetchNewFrame();\n              var I = V.a.Now;\n              this._current = I - this._startMonitoringTime, u && this._fetchResult();\n            }\n          }, C.prototype._fetchResult = function() {\n            this._totalAccumulated += this._current, this._lastSecAccumulated += this._current, this._min = Math.min(this._min, this._current), this._max = Math.max(this._max, this._current), this._average = this._totalAccumulated / this._totalValueCount;\n            var u = V.a.Now;\n            u - this._lastSecTime > 1e3 && (this._lastSecAverage = this._lastSecAccumulated / this._lastSecValueCount, this._lastSecTime = u, this._lastSecAccumulated = 0, this._lastSecValueCount = 0);\n          }, C.Enabled = !0, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return S;\n        }), f.d(A, \"d\", function() {\n          return E;\n        }), f.d(A, \"c\", function() {\n          return g;\n        }), f.d(A, \"a\", function() {\n          return l;\n        });\n        var V = f(1), _ = f(49), C = f(38), u = f(6), I = f(83), O = f(140), x = function(h) {\n          function v() {\n            return h !== null && h.apply(this, arguments) || this;\n          }\n          return Object(V.d)(v, h), v._setPrototypeOf = Object.setPrototypeOf || function(b, D) {\n            return b.__proto__ = D, b;\n          }, v;\n        }(Error), m = f(34), c = f(26), T = f(128), S = function(h) {\n          function v(b, D) {\n            var w = h.call(this, b) || this;\n            return w.name = \"LoadFileError\", x._setPrototypeOf(w, v.prototype), D instanceof _.a ? w.request = D : w.file = D, w;\n          }\n          return Object(V.d)(v, h), v;\n        }(x), E = function(h) {\n          function v(b, D) {\n            var w = h.call(this, b) || this;\n            return w.request = D, w.name = \"RequestFileError\", x._setPrototypeOf(w, v.prototype), w;\n          }\n          return Object(V.d)(v, h), v;\n        }(x), g = function(h) {\n          function v(b, D) {\n            var w = h.call(this, b) || this;\n            return w.file = D, w.name = \"ReadFileError\", x._setPrototypeOf(w, v.prototype), w;\n          }\n          return Object(V.d)(v, h), v;\n        }(x), l = function() {\n          function h() {\n          }\n          return h._CleanUrl = function(v) {\n            return v = v.replace(/#/gm, \"%23\");\n          }, h.SetCorsBehavior = function(v, b) {\n            if ((!v || v.indexOf(\"data:\") !== 0) && h.CorsBehavior)\n              if (typeof h.CorsBehavior == \"string\" || this.CorsBehavior instanceof String)\n                b.crossOrigin = h.CorsBehavior;\n              else {\n                var D = h.CorsBehavior(v);\n                D && (b.crossOrigin = D);\n              }\n          }, h.LoadImage = function(v, b, D, w, N) {\n            var M;\n            N === void 0 && (N = \"\");\n            var U = !1;\n            if (v instanceof ArrayBuffer || ArrayBuffer.isView(v) ? typeof Blob < \"u\" ? (M = URL.createObjectURL(new Blob([v], { type: N })), U = !0) : M = \"data:\" + N + \";base64,\" + m.a.EncodeArrayBufferToBase64(v) : v instanceof Blob ? (M = URL.createObjectURL(v), U = !0) : (M = h._CleanUrl(v), M = h.PreprocessUrl(v)), typeof Image > \"u\")\n              return h.LoadFile(M, function(ae) {\n                createImageBitmap(new Blob([ae], { type: N })).then(function(ee) {\n                  b(ee), U && URL.revokeObjectURL(M);\n                }).catch(function(ee) {\n                  D && D(\"Error while trying to load image: \" + v, ee);\n                });\n              }, void 0, w || void 0, !0, function(ae, ee) {\n                D && D(\"Error while trying to load image: \" + v, ee);\n              }), null;\n            var X = new Image();\n            h.SetCorsBehavior(M, X);\n            var j = function() {\n              X.removeEventListener(\"load\", j), X.removeEventListener(\"error\", ne), b(X), U && X.src && URL.revokeObjectURL(X.src);\n            }, ne = function(ae) {\n              if (X.removeEventListener(\"load\", j), X.removeEventListener(\"error\", ne), D) {\n                var ee = v.toString();\n                D(\"Error while trying to load image: \" + (ee.length < 32 ? ee : ee.slice(0, 32) + \"...\"), ae);\n              }\n              U && X.src && URL.revokeObjectURL(X.src);\n            };\n            X.addEventListener(\"load\", j), X.addEventListener(\"error\", ne);\n            var te = function() {\n              X.src = M;\n            };\n            if (M.substr(0, 5) !== \"data:\" && w && w.enableTexturesOffline)\n              w.open(function() {\n                w && w.loadImage(M, X);\n              }, te);\n            else {\n              if (M.indexOf(\"file:\") !== -1) {\n                var de = decodeURIComponent(M.substring(5).toLowerCase());\n                if (I.a.FilesToLoad[de]) {\n                  try {\n                    var pe;\n                    try {\n                      pe = URL.createObjectURL(I.a.FilesToLoad[de]);\n                    } catch {\n                      pe = URL.createObjectURL(I.a.FilesToLoad[de]);\n                    }\n                    X.src = pe, U = !0;\n                  } catch {\n                    X.src = \"\";\n                  }\n                  return X;\n                }\n              }\n              te();\n            }\n            return X;\n          }, h.ReadFile = function(v, b, D, w, N) {\n            var M = new FileReader(), U = { onCompleteObservable: new u.c(), abort: function() {\n              return M.abort();\n            } };\n            return M.onloadend = function(X) {\n              return U.onCompleteObservable.notifyObservers(U);\n            }, N && (M.onerror = function(X) {\n              N(new g(\"Unable to read \" + v.name, v));\n            }), M.onload = function(X) {\n              b(X.target.result);\n            }, D && (M.onprogress = D), w ? M.readAsArrayBuffer(v) : M.readAsText(v), U;\n          }, h.LoadFile = function(v, b, D, w, N, M) {\n            if (v.indexOf(\"file:\") !== -1) {\n              var U = decodeURIComponent(v.substring(5).toLowerCase());\n              U.indexOf(\"./\") === 0 && (U = U.substring(2));\n              var X = I.a.FilesToLoad[U];\n              if (X)\n                return h.ReadFile(X, b, D, N, M ? function(j) {\n                  return M(void 0, new S(j.message, j.file));\n                } : void 0);\n            }\n            return h.RequestFile(v, function(j, ne) {\n              b(j, ne ? ne.responseURL : void 0);\n            }, D, w, N, M ? function(j) {\n              M(j.request, new S(j.message, j.request));\n            } : void 0);\n          }, h.RequestFile = function(v, b, D, w, N, M, U) {\n            v = h._CleanUrl(v), v = h.PreprocessUrl(v);\n            var X = h.BaseUrl + v, j = !1, ne = { onCompleteObservable: new u.c(), abort: function() {\n              return j = !0;\n            } }, te = function() {\n              var pe = new _.a(), ae = null;\n              ne.abort = function() {\n                j = !0, pe.readyState !== (XMLHttpRequest.DONE || 4) && pe.abort(), ae !== null && (clearTimeout(ae), ae = null);\n              };\n              var ee = function(K) {\n                pe.open(\"GET\", X), U && U(pe), N && (pe.responseType = \"arraybuffer\"), D && pe.addEventListener(\"progress\", D);\n                var $ = function() {\n                  pe.removeEventListener(\"loadend\", $), ne.onCompleteObservable.notifyObservers(ne), ne.onCompleteObservable.clear();\n                };\n                pe.addEventListener(\"loadend\", $);\n                var L = function() {\n                  if (!j && pe.readyState === (XMLHttpRequest.DONE || 4)) {\n                    if (pe.removeEventListener(\"readystatechange\", L), pe.status >= 200 && pe.status < 300 || pe.status === 0 && (!C.a.IsWindowObjectExist() || h.IsFileURL()))\n                      return void b(N ? pe.response : pe.responseText, pe);\n                    var G = h.DefaultRetryStrategy;\n                    if (G) {\n                      var Q = G(X, pe, K);\n                      if (Q !== -1)\n                        return pe.removeEventListener(\"loadend\", $), pe = new _.a(), void (ae = setTimeout(function() {\n                          return ee(K + 1);\n                        }, Q));\n                    }\n                    var oe = new E(\"Error status: \" + pe.status + \" \" + pe.statusText + \" - Unable to load \" + X, pe);\n                    M && M(oe);\n                  }\n                };\n                pe.addEventListener(\"readystatechange\", L), pe.send();\n              };\n              ee(0);\n            };\n            if (w && w.enableSceneOffline) {\n              var de = function(pe) {\n                pe && pe.status > 400 ? M && M(pe) : te();\n              };\n              w.open(function() {\n                w && w.loadFile(h.BaseUrl + v, function(pe) {\n                  j || b(pe), ne.onCompleteObservable.notifyObservers(ne);\n                }, D ? function(pe) {\n                  j || D(pe);\n                } : void 0, de, N);\n              }, de);\n            } else\n              te();\n            return ne;\n          }, h.IsFileURL = function() {\n            return typeof location < \"u\" && location.protocol === \"file:\";\n          }, h.DefaultRetryStrategy = O.a.ExponentialBackoff(), h.BaseUrl = \"\", h.CorsBehavior = \"anonymous\", h.PreprocessUrl = function(v) {\n            return v;\n          }, h;\n        }();\n        c.a._FileToolsLoadImage = l.LoadImage.bind(l), c.a._FileToolsLoadFile = l.LoadFile.bind(l), T.a._FileToolsLoadFile = l.LoadFile.bind(l);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(38), _ = function() {\n          function C() {\n          }\n          return Object.defineProperty(C, \"Now\", { get: function() {\n            return V.a.IsWindowObjectExist() && window.performance && window.performance.now ? window.performance.now() : Date.now();\n          }, enumerable: !1, configurable: !0 }), C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _(C, u, I, O) {\n            this.x = C, this.y = u, this.width = I, this.height = O;\n          }\n          return _.prototype.toGlobal = function(C, u) {\n            return new _(this.x * C, this.y * u, this.width * C, this.height * u);\n          }, _.prototype.toGlobalToRef = function(C, u, I) {\n            return I.x = this.x * C, I.y = this.y * u, I.width = this.width * C, I.height = this.height * u, this;\n          }, _.prototype.clone = function() {\n            return new _(this.x, this.y, this.width, this.height);\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        var V = \"helperFunctions\", _ = `const float PI=3.1415926535897932384626433832795;\nconst float HALF_MIN=5.96046448e-08;\nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nconst float Epsilon=0.0000001;\n#define saturate(x) clamp(x,0.0,1.0)\n#define absEps(x) abs(x)+Epsilon\n#define maxEps(x) max(x,Epsilon)\n#define saturateEps(x) clamp(x,Epsilon,1.0)\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat toLinearSpace(float color)\n{\nreturn pow(color,LinearEncodePowerApprox);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec4 toLinearSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nvec4 toGammaSpace(vec4 color)\n{\nreturn vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);\n}\nfloat toGammaSpace(float color)\n{\nreturn pow(color,GammaEncodePowerApprox);\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat pow5(float value) {\nfloat sq=value*value;\nreturn sq*sq*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nfloat dither(vec2 seed,float varianceAmount) {\nfloat rand=getRand(seed);\nfloat dither=mix(-varianceAmount/255.0,varianceAmount/255.0,rand);\nreturn dither;\n}\n\nconst float rgbdMaxRange=255.0;\nvec4 toRGBD(vec3 color) {\nfloat maxRGB=maxEps(max(color.r,max(color.g,color.b)));\nfloat D=max(rgbdMaxRange/maxRGB,1.);\nD=clamp(floor(D)/255.0,0.,1.);\n\nvec3 rgb=color.rgb*D;\n\nrgb=toGammaSpace(rgb);\nreturn vec4(rgb,D);\n}\nvec3 fromRGBD(vec4 rgbd) {\n\nrgbd.rgb=toLinearSpace(rgbd.rgb);\n\nreturn rgbd.rgb/rgbd.a;\n}\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(0), _ = function() {\n          function C() {\n          }\n          return C._RemoveAndStorePivotPoint = function(u) {\n            u && C._PivotCached === 0 && (u.getPivotPointToRef(C._OldPivotPoint), C._PivotPostMultiplyPivotMatrix = u._postMultiplyPivotMatrix, C._OldPivotPoint.equalsToFloats(0, 0, 0) || (u.setPivotMatrix(V.a.IdentityReadOnly), C._OldPivotPoint.subtractToRef(u.getPivotPoint(), C._PivotTranslation), C._PivotTmpVector.copyFromFloats(1, 1, 1), C._PivotTmpVector.subtractInPlace(u.scaling), C._PivotTmpVector.multiplyInPlace(C._PivotTranslation), u.position.addInPlace(C._PivotTmpVector))), C._PivotCached++;\n          }, C._RestorePivotPoint = function(u) {\n            u && !C._OldPivotPoint.equalsToFloats(0, 0, 0) && C._PivotCached === 1 && (u.setPivotPoint(C._OldPivotPoint), u._postMultiplyPivotMatrix = C._PivotPostMultiplyPivotMatrix, C._PivotTmpVector.copyFromFloats(1, 1, 1), C._PivotTmpVector.subtractInPlace(u.scaling), C._PivotTmpVector.multiplyInPlace(C._PivotTranslation), u.position.subtractInPlace(C._PivotTmpVector)), this._PivotCached--;\n          }, C._PivotCached = 0, C._OldPivotPoint = new V.e(), C._PivotTranslation = new V.e(), C._PivotTmpVector = new V.e(), C._PivotPostMultiplyPivotMatrix = !1, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(4), _ = f(114), C = f(43), u = f(2), I = f(101), O = function() {\n          function x(m, c, T, S, E, g, l, h, v) {\n            h === void 0 && (h = !0), v === void 0 && (v = !0), this.materialIndex = m, this.verticesStart = c, this.verticesCount = T, this.indexStart = S, this.indexCount = E, this._materialDefines = null, this._materialEffect = null, this._effectOverride = null, this._linesIndexCount = 0, this._linesIndexBuffer = null, this._lastColliderWorldVertices = null, this._lastColliderTransformMatrix = null, this._renderId = 0, this._alphaIndex = 0, this._distanceToCamera = 0, this._currentMaterial = null, this._mesh = g, this._renderingMesh = l || g, v && g.subMeshes.push(this), this._trianglePlanes = [], this._id = g.subMeshes.length - 1, h && (this.refreshBoundingInfo(), g.computeWorldMatrix(!0));\n          }\n          return Object.defineProperty(x.prototype, \"materialDefines\", { get: function() {\n            return this._materialDefines;\n          }, set: function(m) {\n            this._materialDefines = m;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(x.prototype, \"effect\", { get: function() {\n            var m;\n            return (m = this._effectOverride) !== null && m !== void 0 ? m : this._materialEffect;\n          }, enumerable: !1, configurable: !0 }), x.prototype.setEffect = function(m, c) {\n            c === void 0 && (c = null), this._materialEffect !== m ? (this._materialDefines = c, this._materialEffect = m) : m || (this._materialDefines = null);\n          }, x.AddToMesh = function(m, c, T, S, E, g, l, h) {\n            return h === void 0 && (h = !0), new x(m, c, T, S, E, g, l, h);\n          }, Object.defineProperty(x.prototype, \"IsGlobal\", { get: function() {\n            return this.verticesStart === 0 && this.verticesCount === this._mesh.getTotalVertices();\n          }, enumerable: !1, configurable: !0 }), x.prototype.getBoundingInfo = function() {\n            return this.IsGlobal ? this._mesh.getBoundingInfo() : this._boundingInfo;\n          }, x.prototype.setBoundingInfo = function(m) {\n            return this._boundingInfo = m, this;\n          }, x.prototype.getMesh = function() {\n            return this._mesh;\n          }, x.prototype.getRenderingMesh = function() {\n            return this._renderingMesh;\n          }, x.prototype.getReplacementMesh = function() {\n            return this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;\n          }, x.prototype.getEffectiveMesh = function() {\n            var m = this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : null;\n            return m || this._renderingMesh;\n          }, x.prototype.getMaterial = function() {\n            var m = this._renderingMesh.material;\n            if (m == null)\n              return this._mesh.getScene().defaultMaterial;\n            if (this._IsMultiMaterial(m)) {\n              var c = m.getSubMaterial(this.materialIndex);\n              return this._currentMaterial !== c && (this._currentMaterial = c, this._materialDefines = null), c;\n            }\n            return m;\n          }, x.prototype._IsMultiMaterial = function(m) {\n            return m.getSubMaterial !== void 0;\n          }, x.prototype.refreshBoundingInfo = function(m) {\n            if (m === void 0 && (m = null), this._lastColliderWorldVertices = null, this.IsGlobal || !this._renderingMesh || !this._renderingMesh.geometry)\n              return this;\n            if (m || (m = this._renderingMesh.getVerticesData(V.b.PositionKind)), !m)\n              return this._boundingInfo = this._mesh.getBoundingInfo(), this;\n            var c, T = this._renderingMesh.getIndices();\n            if (this.indexStart === 0 && this.indexCount === T.length) {\n              var S = this._renderingMesh.getBoundingInfo();\n              c = { minimum: S.minimum.clone(), maximum: S.maximum.clone() };\n            } else\n              c = Object(I.b)(m, T, this.indexStart, this.indexCount, this._renderingMesh.geometry.boundingBias);\n            return this._boundingInfo ? this._boundingInfo.reConstruct(c.minimum, c.maximum) : this._boundingInfo = new C.a(c.minimum, c.maximum), this;\n          }, x.prototype._checkCollision = function(m) {\n            return this.getBoundingInfo()._checkCollision(m);\n          }, x.prototype.updateBoundingInfo = function(m) {\n            var c = this.getBoundingInfo();\n            return c || (this.refreshBoundingInfo(), c = this.getBoundingInfo()), c && c.update(m), this;\n          }, x.prototype.isInFrustum = function(m) {\n            var c = this.getBoundingInfo();\n            return !!c && c.isInFrustum(m, this._mesh.cullingStrategy);\n          }, x.prototype.isCompletelyInFrustum = function(m) {\n            var c = this.getBoundingInfo();\n            return !!c && c.isCompletelyInFrustum(m);\n          }, x.prototype.render = function(m) {\n            return this._renderingMesh.render(this, m, this._mesh._internalAbstractMeshDataInfo._actAsRegularMesh ? this._mesh : void 0), this;\n          }, x.prototype._getLinesIndexBuffer = function(m, c) {\n            if (!this._linesIndexBuffer) {\n              for (var T = [], S = this.indexStart; S < this.indexStart + this.indexCount; S += 3)\n                T.push(m[S], m[S + 1], m[S + 1], m[S + 2], m[S + 2], m[S]);\n              this._linesIndexBuffer = c.createIndexBuffer(T), this._linesIndexCount = T.length;\n            }\n            return this._linesIndexBuffer;\n          }, x.prototype.canIntersects = function(m) {\n            var c = this.getBoundingInfo();\n            return !!c && m.intersectsBox(c.boundingBox);\n          }, x.prototype.intersects = function(m, c, T, S, E) {\n            var g = this.getMaterial();\n            if (!g)\n              return null;\n            var l = 3, h = !1;\n            switch (g.fillMode) {\n              case u.a.MATERIAL_PointListDrawMode:\n              case u.a.MATERIAL_LineListDrawMode:\n              case u.a.MATERIAL_LineLoopDrawMode:\n              case u.a.MATERIAL_LineStripDrawMode:\n              case u.a.MATERIAL_TriangleFanDrawMode:\n                return null;\n              case u.a.MATERIAL_TriangleStripDrawMode:\n                l = 1, h = !0;\n            }\n            return this._mesh.getClassName() === \"InstancedLinesMesh\" || this._mesh.getClassName() === \"LinesMesh\" ? T.length ? this._intersectLines(m, c, T, this._mesh.intersectionThreshold, S) : this._intersectUnIndexedLines(m, c, T, this._mesh.intersectionThreshold, S) : !T.length && this._mesh._unIndexed ? this._intersectUnIndexedTriangles(m, c, T, S, E) : this._intersectTriangles(m, c, T, l, h, S, E);\n          }, x.prototype._intersectLines = function(m, c, T, S, E) {\n            for (var g = null, l = this.indexStart; l < this.indexStart + this.indexCount; l += 2) {\n              var h = c[T[l]], v = c[T[l + 1]], b = m.intersectionSegment(h, v, S);\n              if (!(b < 0) && (E || !g || b < g.distance) && ((g = new _.a(null, null, b)).faceId = l / 2, E))\n                break;\n            }\n            return g;\n          }, x.prototype._intersectUnIndexedLines = function(m, c, T, S, E) {\n            for (var g = null, l = this.verticesStart; l < this.verticesStart + this.verticesCount; l += 2) {\n              var h = c[l], v = c[l + 1], b = m.intersectionSegment(h, v, S);\n              if (!(b < 0) && (E || !g || b < g.distance) && ((g = new _.a(null, null, b)).faceId = l / 2, E))\n                break;\n            }\n            return g;\n          }, x.prototype._intersectTriangles = function(m, c, T, S, E, g, l) {\n            for (var h = null, v = -1, b = this.indexStart; b < this.indexStart + this.indexCount; b += S) {\n              v++;\n              var D = T[b], w = T[b + 1], N = T[b + 2];\n              if (E && N === 4294967295)\n                b += 2;\n              else {\n                var M = c[D], U = c[w], X = c[N];\n                if (!l || l(M, U, X, m)) {\n                  var j = m.intersectsTriangle(M, U, X);\n                  if (j) {\n                    if (j.distance < 0)\n                      continue;\n                    if ((g || !h || j.distance < h.distance) && ((h = j).faceId = v, g))\n                      break;\n                  }\n                }\n              }\n            }\n            return h;\n          }, x.prototype._intersectUnIndexedTriangles = function(m, c, T, S, E) {\n            for (var g = null, l = this.verticesStart; l < this.verticesStart + this.verticesCount; l += 3) {\n              var h = c[l], v = c[l + 1], b = c[l + 2];\n              if (!E || E(h, v, b, m)) {\n                var D = m.intersectsTriangle(h, v, b);\n                if (D) {\n                  if (D.distance < 0)\n                    continue;\n                  if ((S || !g || D.distance < g.distance) && ((g = D).faceId = l / 3, S))\n                    break;\n                }\n              }\n            }\n            return g;\n          }, x.prototype._rebuild = function() {\n            this._linesIndexBuffer && (this._linesIndexBuffer = null);\n          }, x.prototype.clone = function(m, c) {\n            var T = new x(this.materialIndex, this.verticesStart, this.verticesCount, this.indexStart, this.indexCount, m, c, !1);\n            if (!this.IsGlobal) {\n              var S = this.getBoundingInfo();\n              if (!S)\n                return T;\n              T._boundingInfo = new C.a(S.minimum, S.maximum);\n            }\n            return T;\n          }, x.prototype.dispose = function() {\n            this._linesIndexBuffer && (this._mesh.getScene().getEngine()._releaseBuffer(this._linesIndexBuffer), this._linesIndexBuffer = null);\n            var m = this._mesh.subMeshes.indexOf(this);\n            this._mesh.subMeshes.splice(m, 1);\n          }, x.prototype.getClassName = function() {\n            return \"SubMesh\";\n          }, x.CreateFromIndices = function(m, c, T, S, E) {\n            for (var g = Number.MAX_VALUE, l = -Number.MAX_VALUE, h = (E || S).getIndices(), v = c; v < c + T; v++) {\n              var b = h[v];\n              b < g && (g = b), b > l && (l = b);\n            }\n            return new x(m, g, l - g + 1, c, T, S, E);\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(1), _ = f(8), C = f(10), u = f(2), I = (f(126), f(70)), O = function(x) {\n          function m(c, T, S, E, g, l, h) {\n            S === void 0 && (S = null), g === void 0 && (g = u.a.TEXTURE_TRILINEAR_SAMPLINGMODE), l === void 0 && (l = u.a.TEXTUREFORMAT_RGBA);\n            var v = x.call(this, null, S, !E, h, g, void 0, void 0, void 0, void 0, l) || this;\n            v.name = c, v.wrapU = C.a.CLAMP_ADDRESSMODE, v.wrapV = C.a.CLAMP_ADDRESSMODE, v._generateMipMaps = E;\n            var b = v._getEngine();\n            if (!b)\n              return v;\n            T.getContext ? (v._canvas = T, v._texture = b.createDynamicTexture(T.width, T.height, E, g)) : (v._canvas = I.a.CreateCanvas(1, 1), T.width || T.width === 0 ? v._texture = b.createDynamicTexture(T.width, T.height, E, g) : v._texture = b.createDynamicTexture(T, T, E, g));\n            var D = v.getSize();\n            return v._canvas.width = D.width, v._canvas.height = D.height, v._context = v._canvas.getContext(\"2d\"), v;\n          }\n          return Object(V.d)(m, x), m.prototype.getClassName = function() {\n            return \"DynamicTexture\";\n          }, Object.defineProperty(m.prototype, \"canRescale\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), m.prototype._recreate = function(c) {\n            this._canvas.width = c.width, this._canvas.height = c.height, this.releaseInternalTexture(), this._texture = this._getEngine().createDynamicTexture(c.width, c.height, this._generateMipMaps, this.samplingMode);\n          }, m.prototype.scale = function(c) {\n            var T = this.getSize();\n            T.width *= c, T.height *= c, this._recreate(T);\n          }, m.prototype.scaleTo = function(c, T) {\n            var S = this.getSize();\n            S.width = c, S.height = T, this._recreate(S);\n          }, m.prototype.getContext = function() {\n            return this._context;\n          }, m.prototype.clear = function() {\n            var c = this.getSize();\n            this._context.fillRect(0, 0, c.width, c.height);\n          }, m.prototype.update = function(c, T) {\n            T === void 0 && (T = !1), this._getEngine().updateDynamicTexture(this._texture, this._canvas, c === void 0 || c, T, this._format || void 0);\n          }, m.prototype.drawText = function(c, T, S, E, g, l, h, v) {\n            v === void 0 && (v = !0);\n            var b = this.getSize();\n            if (l && (this._context.fillStyle = l, this._context.fillRect(0, 0, b.width, b.height)), this._context.font = E, T == null) {\n              var D = this._context.measureText(c);\n              T = (b.width - D.width) / 2;\n            }\n            if (S == null) {\n              var w = parseInt(E.replace(/\\D/g, \"\"));\n              S = b.height / 2 + w / 3.65;\n            }\n            this._context.fillStyle = g || \"\", this._context.fillText(c, T, S), v && this.update(h);\n          }, m.prototype.clone = function() {\n            var c = this.getScene();\n            if (!c)\n              return this;\n            var T = this.getSize(), S = new m(this.name, T, c, this._generateMipMaps);\n            return S.hasAlpha = this.hasAlpha, S.level = this.level, S.wrapU = this.wrapU, S.wrapV = this.wrapV, S;\n          }, m.prototype.serialize = function() {\n            var c = this.getScene();\n            c && !c.isReady() && _.a.Warn(\"The scene must be ready before serializing the dynamic texture\");\n            var T = x.prototype.serialize.call(this);\n            return this._IsCanvasElement(this._canvas) && (T.base64String = this._canvas.toDataURL()), T.invertY = this._invertY, T.samplingMode = this.samplingMode, T;\n          }, m.prototype._IsCanvasElement = function(c) {\n            return c.toDataURL !== void 0;\n          }, m.prototype._rebuild = function() {\n            this.update();\n          }, m;\n        }(C.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(0), _ = f(9), C = f(7), u = f(16);\n        u.a.CreateBox = function(O) {\n          var x, m = [0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23], c = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0], T = [], S = O.width || O.size || 1, E = O.height || O.size || 1, g = O.depth || O.size || 1, l = O.wrap || !1, h = O.topBaseAt === void 0 ? 1 : O.topBaseAt, v = O.bottomBaseAt === void 0 ? 0 : O.bottomBaseAt, b = [2, 0, 3, 1][h = (h + 4) % 4], D = [2, 0, 1, 3][v = (v + 4) % 4], w = [1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1];\n          if (l) {\n            m = [2, 3, 0, 2, 0, 1, 4, 5, 6, 4, 6, 7, 9, 10, 11, 9, 11, 8, 12, 14, 15, 12, 13, 14], w = [-1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1];\n            for (var N = [[1, 1, 1], [-1, 1, 1], [-1, 1, -1], [1, 1, -1]], M = [[-1, -1, 1], [1, -1, 1], [1, -1, -1], [-1, -1, -1]], U = [17, 18, 19, 16], X = [22, 23, 20, 21]; b > 0; )\n              N.unshift(N.pop()), U.unshift(U.pop()), b--;\n            for (; D > 0; )\n              M.unshift(M.pop()), X.unshift(X.pop()), D--;\n            N = N.flat(), M = M.flat(), w = w.concat(N).concat(M), m.push(U[0], U[2], U[3], U[0], U[1], U[2]), m.push(X[0], X[2], X[3], X[0], X[1], X[2]);\n          }\n          var j = [S / 2, E / 2, g / 2];\n          x = w.reduce(function(G, Q, oe) {\n            return G.concat(Q * j[oe % 3]);\n          }, []);\n          for (var ne = O.sideOrientation === 0 ? 0 : O.sideOrientation || u.a.DEFAULTSIDE, te = O.faceUV || new Array(6), de = O.faceColors, pe = [], ae = 0; ae < 6; ae++)\n            te[ae] === void 0 && (te[ae] = new V.f(0, 0, 1, 1)), de && de[ae] === void 0 && (de[ae] = new _.b(1, 1, 1, 1));\n          for (var ee = 0; ee < 6; ee++)\n            if (T.push(te[ee].z, te[ee].w), T.push(te[ee].x, te[ee].w), T.push(te[ee].x, te[ee].y), T.push(te[ee].z, te[ee].y), de)\n              for (var K = 0; K < 4; K++)\n                pe.push(de[ee].r, de[ee].g, de[ee].b, de[ee].a);\n          u.a._ComputeSides(ne, x, m, c, T, O.frontUVs, O.backUVs);\n          var $ = new u.a();\n          if ($.indices = m, $.positions = x, $.normals = c, $.uvs = T, de) {\n            var L = ne === u.a.DOUBLESIDE ? pe.concat(pe) : pe;\n            $.colors = L;\n          }\n          return $;\n        }, C.a.CreateBox = function(O, x, m, c, T) {\n          m === void 0 && (m = null);\n          var S = { size: x, sideOrientation: T, updatable: c };\n          return I.CreateBox(O, S, m);\n        };\n        var I = function() {\n          function O() {\n          }\n          return O.CreateBox = function(x, m, c) {\n            c === void 0 && (c = null);\n            var T = new C.a(x, c);\n            return m.sideOrientation = C.a._GetDefaultSideOrientation(m.sideOrientation), T._originalBuilderSideOrientation = m.sideOrientation, u.a.CreateBox(m).applyToMesh(T, m.updatable), T;\n          }, O;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(0), _ = function() {\n          function C(u, I, O, x) {\n            this.normal = new V.e(u, I, O), this.d = x;\n          }\n          return C.prototype.asArray = function() {\n            return [this.normal.x, this.normal.y, this.normal.z, this.d];\n          }, C.prototype.clone = function() {\n            return new C(this.normal.x, this.normal.y, this.normal.z, this.d);\n          }, C.prototype.getClassName = function() {\n            return \"Plane\";\n          }, C.prototype.getHashCode = function() {\n            var u = this.normal.getHashCode();\n            return u = 397 * u ^ (0 | this.d);\n          }, C.prototype.normalize = function() {\n            var u = Math.sqrt(this.normal.x * this.normal.x + this.normal.y * this.normal.y + this.normal.z * this.normal.z), I = 0;\n            return u !== 0 && (I = 1 / u), this.normal.x *= I, this.normal.y *= I, this.normal.z *= I, this.d *= I, this;\n          }, C.prototype.transform = function(u) {\n            var I = C._TmpMatrix;\n            u.invertToRef(I);\n            var O = I.m, x = this.normal.x, m = this.normal.y, c = this.normal.z, T = this.d;\n            return new C(x * O[0] + m * O[1] + c * O[2] + T * O[3], x * O[4] + m * O[5] + c * O[6] + T * O[7], x * O[8] + m * O[9] + c * O[10] + T * O[11], x * O[12] + m * O[13] + c * O[14] + T * O[15]);\n          }, C.prototype.dotCoordinate = function(u) {\n            return this.normal.x * u.x + this.normal.y * u.y + this.normal.z * u.z + this.d;\n          }, C.prototype.copyFromPoints = function(u, I, O) {\n            var x, m = I.x - u.x, c = I.y - u.y, T = I.z - u.z, S = O.x - u.x, E = O.y - u.y, g = O.z - u.z, l = c * g - T * E, h = T * S - m * g, v = m * E - c * S, b = Math.sqrt(l * l + h * h + v * v);\n            return x = b !== 0 ? 1 / b : 0, this.normal.x = l * x, this.normal.y = h * x, this.normal.z = v * x, this.d = -(this.normal.x * u.x + this.normal.y * u.y + this.normal.z * u.z), this;\n          }, C.prototype.isFrontFacingTo = function(u, I) {\n            return V.e.Dot(this.normal, u) <= I;\n          }, C.prototype.signedDistanceTo = function(u) {\n            return V.e.Dot(u, this.normal) + this.d;\n          }, C.FromArray = function(u) {\n            return new C(u[0], u[1], u[2], u[3]);\n          }, C.FromPoints = function(u, I, O) {\n            var x = new C(0, 0, 0, 0);\n            return x.copyFromPoints(u, I, O), x;\n          }, C.FromPositionAndNormal = function(u, I) {\n            var O = new C(0, 0, 0, 0);\n            return I.normalize(), O.normal = I, O.d = -(I.x * u.x + I.y * u.y + I.z * u.z), O;\n          }, C.SignedDistanceToPlaneFromPositionAndNormal = function(u, I, O) {\n            var x = -(I.x * u.x + I.y * u.y + I.z * u.z);\n            return V.e.Dot(O, I) + x;\n          }, C._TmpMatrix = V.a.Identity(), C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return m;\n        });\n        var V = f(7), _ = f(20), C = f(6), u = f(0), I = f(18), O = f(39), x = f(60), m = (f(84), function() {\n          function c(T) {\n            this._useAlternatePickedPointAboveMaxDragAngleDragSpeed = -1.1, this.maxDragAngle = 0, this._useAlternatePickedPointAboveMaxDragAngle = !1, this.currentDraggingPointerID = -1, this.dragging = !1, this.dragDeltaRatio = 0.2, this.updateDragPlane = !0, this._debugMode = !1, this._moving = !1, this.onDragObservable = new C.c(), this.onDragStartObservable = new C.c(), this.onDragEndObservable = new C.c(), this.moveAttached = !0, this.enabled = !0, this.startAndReleaseDragOnPointerEvents = !0, this.detachCameraControls = !0, this.useObjectOrientationForDragging = !0, this.validateDrag = function(E) {\n              return !0;\n            }, this._tmpVector = new u.e(0, 0, 0), this._alternatePickedPoint = new u.e(0, 0, 0), this._worldDragAxis = new u.e(0, 0, 0), this._targetPosition = new u.e(0, 0, 0), this._attachedToElement = !1, this._startDragRay = new O.a(new u.e(), new u.e()), this._lastPointerRay = {}, this._dragDelta = new u.e(), this._pointA = new u.e(0, 0, 0), this._pointC = new u.e(0, 0, 0), this._localAxis = new u.e(0, 0, 0), this._lookAt = new u.e(0, 0, 0), this._options = T || {};\n            var S = 0;\n            if (this._options.dragAxis && S++, this._options.dragPlaneNormal && S++, S > 1)\n              throw \"Multiple drag modes specified in dragBehavior options. Only one expected\";\n          }\n          return Object.defineProperty(c.prototype, \"options\", { get: function() {\n            return this._options;\n          }, set: function(T) {\n            this._options = T;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(c.prototype, \"name\", { get: function() {\n            return \"PointerDrag\";\n          }, enumerable: !1, configurable: !0 }), c.prototype.init = function() {\n          }, c.prototype.attach = function(T, S) {\n            var E = this;\n            this._scene = T.getScene(), this.attachedNode = T, c._planeScene || (this._debugMode ? c._planeScene = this._scene : (c._planeScene = new _.a(this._scene.getEngine(), { virtual: !0 }), c._planeScene.detachControl(), this._scene.onDisposeObservable.addOnce(function() {\n              c._planeScene.dispose(), c._planeScene = null;\n            }))), this._dragPlane = V.a.CreatePlane(\"pointerDragPlane\", this._debugMode ? 1 : 1e4, c._planeScene, !1, V.a.DOUBLESIDE), this.lastDragPosition = new u.e(0, 0, 0);\n            var g = S || function(l) {\n              return E.attachedNode == l || l.isDescendantOf(E.attachedNode);\n            };\n            this._pointerObserver = this._scene.onPointerObservable.add(function(l, h) {\n              if (E.enabled) {\n                if (l.type == I.a.POINTERDOWN)\n                  E.startAndReleaseDragOnPointerEvents && !E.dragging && l.pickInfo && l.pickInfo.hit && l.pickInfo.pickedMesh && l.pickInfo.pickedPoint && l.pickInfo.ray && g(l.pickInfo.pickedMesh) && E._startDrag(l.event.pointerId, l.pickInfo.ray, l.pickInfo.pickedPoint);\n                else if (l.type == I.a.POINTERUP)\n                  E.startAndReleaseDragOnPointerEvents && E.currentDraggingPointerID == l.event.pointerId && E.releaseDrag();\n                else if (l.type == I.a.POINTERMOVE) {\n                  var v = l.event.pointerId;\n                  if (E.currentDraggingPointerID === c._AnyMouseID && v !== c._AnyMouseID) {\n                    var b = l.event;\n                    (b.pointerType === \"mouse\" || !E._scene.getEngine().hostInformation.isMobile && b instanceof MouseEvent) && (E._lastPointerRay[E.currentDraggingPointerID] && (E._lastPointerRay[v] = E._lastPointerRay[E.currentDraggingPointerID], delete E._lastPointerRay[E.currentDraggingPointerID]), E.currentDraggingPointerID = v);\n                  }\n                  E._lastPointerRay[v] || (E._lastPointerRay[v] = new O.a(new u.e(), new u.e())), l.pickInfo && l.pickInfo.ray && (E._lastPointerRay[v].origin.copyFrom(l.pickInfo.ray.origin), E._lastPointerRay[v].direction.copyFrom(l.pickInfo.ray.direction), E.currentDraggingPointerID == v && E.dragging && E._moveDrag(l.pickInfo.ray));\n                }\n              }\n            }), this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function() {\n              E._moving && E.moveAttached && (x.a._RemoveAndStorePivotPoint(E.attachedNode), E._targetPosition.subtractToRef(E.attachedNode.absolutePosition, E._tmpVector), E._tmpVector.scaleInPlace(E.dragDeltaRatio), E.attachedNode.getAbsolutePosition().addToRef(E._tmpVector, E._tmpVector), E.validateDrag(E._tmpVector) && E.attachedNode.setAbsolutePosition(E._tmpVector), x.a._RestorePivotPoint(E.attachedNode));\n            });\n          }, c.prototype.releaseDrag = function() {\n            if (this.dragging && (this.dragging = !1, this.onDragEndObservable.notifyObservers({ dragPlanePoint: this.lastDragPosition, pointerId: this.currentDraggingPointerID })), this.currentDraggingPointerID = -1, this._moving = !1, this.detachCameraControls && this._attachedToElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera) {\n              if (this._scene.activeCamera.getClassName() === \"ArcRotateCamera\") {\n                var T = this._scene.activeCamera;\n                T.attachControl(!T.inputs || T.inputs.noPreventDefault, T._useCtrlForPanning, T._panningMouseButton);\n              } else\n                this._scene.activeCamera.attachControl(!this._scene.activeCamera.inputs || this._scene.activeCamera.inputs.noPreventDefault);\n              this._attachedToElement = !1;\n            }\n          }, c.prototype.startDrag = function(T, S, E) {\n            T === void 0 && (T = c._AnyMouseID), this._startDrag(T, S, E);\n            var g = this._lastPointerRay[T];\n            T === c._AnyMouseID && (g = this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]), g && this._moveDrag(g);\n          }, c.prototype._startDrag = function(T, S, E) {\n            if (this._scene.activeCamera && !this.dragging && this.attachedNode) {\n              x.a._RemoveAndStorePivotPoint(this.attachedNode), S ? (this._startDragRay.direction.copyFrom(S.direction), this._startDragRay.origin.copyFrom(S.origin)) : (this._startDragRay.origin.copyFrom(this._scene.activeCamera.position), this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector), this._tmpVector.subtractToRef(this._scene.activeCamera.position, this._startDragRay.direction)), this._updateDragPlanePosition(this._startDragRay, E || this._tmpVector);\n              var g = this._pickWithRayOnDragPlane(this._startDragRay);\n              g && (this.dragging = !0, this.currentDraggingPointerID = T, this.lastDragPosition.copyFrom(g), this.onDragStartObservable.notifyObservers({ dragPlanePoint: g, pointerId: this.currentDraggingPointerID }), this._targetPosition.copyFrom(this.attachedNode.absolutePosition), this.detachCameraControls && this._scene.activeCamera && this._scene.activeCamera.inputs && !this._scene.activeCamera.leftCamera && (this._scene.activeCamera.inputs.attachedToElement ? (this._scene.activeCamera.detachControl(), this._attachedToElement = !0) : this._attachedToElement = !1)), x.a._RestorePivotPoint(this.attachedNode);\n            }\n          }, c.prototype._moveDrag = function(T) {\n            this._moving = !0;\n            var S = this._pickWithRayOnDragPlane(T);\n            if (S) {\n              this.updateDragPlane && this._updateDragPlanePosition(T, S);\n              var E = 0;\n              this._options.dragAxis ? (this.useObjectOrientationForDragging ? u.e.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._worldDragAxis) : this._worldDragAxis.copyFrom(this._options.dragAxis), S.subtractToRef(this.lastDragPosition, this._tmpVector), E = u.e.Dot(this._tmpVector, this._worldDragAxis), this._worldDragAxis.scaleToRef(E, this._dragDelta)) : (E = this._dragDelta.length(), S.subtractToRef(this.lastDragPosition, this._dragDelta)), this._targetPosition.addInPlace(this._dragDelta), this.onDragObservable.notifyObservers({ dragDistance: E, delta: this._dragDelta, dragPlanePoint: S, dragPlaneNormal: this._dragPlane.forward, pointerId: this.currentDraggingPointerID }), this.lastDragPosition.copyFrom(S);\n            }\n          }, c.prototype._pickWithRayOnDragPlane = function(T) {\n            var S = this;\n            if (!T)\n              return null;\n            var E = Math.acos(u.e.Dot(this._dragPlane.forward, T.direction));\n            if (E > Math.PI / 2 && (E = Math.PI - E), this.maxDragAngle > 0 && E > this.maxDragAngle) {\n              if (this._useAlternatePickedPointAboveMaxDragAngle) {\n                this._tmpVector.copyFrom(T.direction), this.attachedNode.absolutePosition.subtractToRef(T.origin, this._alternatePickedPoint), this._alternatePickedPoint.normalize(), this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed * u.e.Dot(this._alternatePickedPoint, this._tmpVector)), this._tmpVector.addInPlace(this._alternatePickedPoint);\n                var g = u.e.Dot(this._dragPlane.forward, this._tmpVector);\n                return this._dragPlane.forward.scaleToRef(-g, this._alternatePickedPoint), this._alternatePickedPoint.addInPlace(this._tmpVector), this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition), this._alternatePickedPoint;\n              }\n              return null;\n            }\n            var l = c._planeScene.pickWithRay(T, function(h) {\n              return h == S._dragPlane;\n            });\n            return l && l.hit && l.pickedMesh && l.pickedPoint ? l.pickedPoint : null;\n          }, c.prototype._updateDragPlanePosition = function(T, S) {\n            this._pointA.copyFrom(S), this._options.dragAxis ? (this.useObjectOrientationForDragging ? u.e.TransformCoordinatesToRef(this._options.dragAxis, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragAxis), T.origin.subtractToRef(this._pointA, this._pointC), this._pointC.normalize(), Math.abs(u.e.Dot(this._localAxis, this._pointC)) > 0.999 ? Math.abs(u.e.Dot(u.e.UpReadOnly, this._pointC)) > 0.999 ? this._lookAt.copyFrom(u.e.Right()) : this._lookAt.copyFrom(u.e.UpReadOnly) : (u.e.CrossToRef(this._localAxis, this._pointC, this._lookAt), u.e.CrossToRef(this._localAxis, this._lookAt, this._lookAt), this._lookAt.normalize()), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._lookAt, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : this._options.dragPlaneNormal ? (this.useObjectOrientationForDragging ? u.e.TransformCoordinatesToRef(this._options.dragPlaneNormal, this.attachedNode.getWorldMatrix().getRotationMatrix(), this._localAxis) : this._localAxis.copyFrom(this._options.dragPlaneNormal), this._dragPlane.position.copyFrom(this._pointA), this._pointA.addToRef(this._localAxis, this._lookAt), this._dragPlane.lookAt(this._lookAt)) : (this._dragPlane.position.copyFrom(this._pointA), this._dragPlane.lookAt(T.origin)), this._dragPlane.position.copyFrom(this.attachedNode.absolutePosition), this._dragPlane.computeWorldMatrix(!0);\n          }, c.prototype.detach = function() {\n            this._pointerObserver && this._scene.onPointerObservable.remove(this._pointerObserver), this._beforeRenderObserver && this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver), this.releaseDrag();\n          }, c._AnyMouseID = -2, c;\n        }());\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        }), f.d(A, \"c\", function() {\n          return u;\n        });\n        var V = f(1), _ = function() {\n          function I() {\n          }\n          return I.KEYDOWN = 1, I.KEYUP = 2, I;\n        }(), C = function(I, O) {\n          this.type = I, this.event = O;\n        }, u = function(I) {\n          function O(x, m) {\n            var c = I.call(this, x, m) || this;\n            return c.type = x, c.event = m, c.skipOnPointerObservable = !1, c;\n          }\n          return Object(V.d)(O, I), O;\n        }(C);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._defines = {}, this._currentRank = 32, this._maxRank = -1, this._mesh = null;\n          }\n          return _.prototype.unBindMesh = function() {\n            this._mesh = null;\n          }, _.prototype.addFallback = function(C, u) {\n            this._defines[C] || (C < this._currentRank && (this._currentRank = C), C > this._maxRank && (this._maxRank = C), this._defines[C] = new Array()), this._defines[C].push(u);\n          }, _.prototype.addCPUSkinningFallback = function(C, u) {\n            this._mesh = u, C < this._currentRank && (this._currentRank = C), C > this._maxRank && (this._maxRank = C);\n          }, Object.defineProperty(_.prototype, \"hasMoreFallbacks\", { get: function() {\n            return this._currentRank <= this._maxRank;\n          }, enumerable: !1, configurable: !0 }), _.prototype.reduce = function(C, u) {\n            if (this._mesh && this._mesh.computeBonesUsingShaders && this._mesh.numBoneInfluencers > 0) {\n              this._mesh.computeBonesUsingShaders = !1, C = C.replace(\"#define NUM_BONE_INFLUENCERS \" + this._mesh.numBoneInfluencers, \"#define NUM_BONE_INFLUENCERS 0\"), u._bonesComputationForcedToCPU = !0;\n              for (var I = this._mesh.getScene(), O = 0; O < I.meshes.length; O++) {\n                var x = I.meshes[O];\n                if (x.material) {\n                  if (x.computeBonesUsingShaders && x.numBoneInfluencers !== 0) {\n                    if (x.material.getEffect() === u)\n                      x.computeBonesUsingShaders = !1;\n                    else if (x.subMeshes) {\n                      for (var m = 0, c = x.subMeshes; m < c.length; m++)\n                        if (c[m].effect === u) {\n                          x.computeBonesUsingShaders = !1;\n                          break;\n                        }\n                    }\n                  }\n                } else\n                  !this._mesh.material && x.computeBonesUsingShaders && x.numBoneInfluencers > 0 && (x.computeBonesUsingShaders = !1);\n              }\n            } else {\n              var T = this._defines[this._currentRank];\n              if (T)\n                for (O = 0; O < T.length; O++)\n                  C = C.replace(\"#define \" + T[O], \"\");\n              this._currentRank++;\n            }\n            return C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(1), _ = f(25), C = f(37), u = f(11), I = function(O) {\n          function x(m, c) {\n            var T = O.call(this, m, c, !0) || this;\n            return c.multiMaterials.push(T), T.subMaterials = new Array(), T._storeEffectOnSubMeshes = !0, T;\n          }\n          return Object(V.d)(x, O), Object.defineProperty(x.prototype, \"subMaterials\", { get: function() {\n            return this._subMaterials;\n          }, set: function(m) {\n            this._subMaterials = m, this._hookArray(m);\n          }, enumerable: !1, configurable: !0 }), x.prototype.getChildren = function() {\n            return this.subMaterials;\n          }, x.prototype._hookArray = function(m) {\n            var c = this, T = m.push;\n            m.push = function() {\n              for (var E = [], g = 0; g < arguments.length; g++)\n                E[g] = arguments[g];\n              var l = T.apply(m, E);\n              return c._markAllSubMeshesAsTexturesDirty(), l;\n            };\n            var S = m.splice;\n            m.splice = function(E, g) {\n              var l = S.apply(m, [E, g]);\n              return c._markAllSubMeshesAsTexturesDirty(), l;\n            };\n          }, x.prototype.getSubMaterial = function(m) {\n            return m < 0 || m >= this.subMaterials.length ? this.getScene().defaultMaterial : this.subMaterials[m];\n          }, x.prototype.getActiveTextures = function() {\n            var m;\n            return (m = O.prototype.getActiveTextures.call(this)).concat.apply(m, this.subMaterials.map(function(c) {\n              return c ? c.getActiveTextures() : [];\n            }));\n          }, x.prototype.hasTexture = function(m) {\n            var c;\n            if (O.prototype.hasTexture.call(this, m))\n              return !0;\n            for (var T = 0; T < this.subMaterials.length; T++)\n              if (!((c = this.subMaterials[T]) === null || c === void 0) && c.hasTexture(m))\n                return !0;\n            return !1;\n          }, x.prototype.getClassName = function() {\n            return \"MultiMaterial\";\n          }, x.prototype.isReadyForSubMesh = function(m, c, T) {\n            for (var S = 0; S < this.subMaterials.length; S++) {\n              var E = this.subMaterials[S];\n              if (E) {\n                if (E._storeEffectOnSubMeshes) {\n                  if (!E.isReadyForSubMesh(m, c, T))\n                    return !1;\n                  continue;\n                }\n                if (!E.isReady(m))\n                  return !1;\n              }\n            }\n            return !0;\n          }, x.prototype.clone = function(m, c) {\n            for (var T = new x(m, this.getScene()), S = 0; S < this.subMaterials.length; S++) {\n              var E = null, g = this.subMaterials[S];\n              E = c && g ? g.clone(m + \"-\" + g.name) : this.subMaterials[S], T.subMaterials.push(E);\n            }\n            return T;\n          }, x.prototype.serialize = function() {\n            var m = {};\n            m.name = this.name, m.id = this.id, C.a && (m.tags = C.a.GetTags(this)), m.materials = [];\n            for (var c = 0; c < this.subMaterials.length; c++) {\n              var T = this.subMaterials[c];\n              T ? m.materials.push(T.id) : m.materials.push(null);\n            }\n            return m;\n          }, x.prototype.dispose = function(m, c, T) {\n            var S = this.getScene();\n            if (S) {\n              if (T)\n                for (var E = 0; E < this.subMaterials.length; E++) {\n                  var g = this.subMaterials[E];\n                  g && g.dispose(m, c);\n                }\n              (E = S.multiMaterials.indexOf(this)) >= 0 && S.multiMaterials.splice(E, 1), O.prototype.dispose.call(this, m, c);\n            }\n          }, x.ParseMultiMaterial = function(m, c) {\n            var T = new x(m.name, c);\n            T.id = m.id, C.a && C.a.AddTagsTo(T, m.tags);\n            for (var S = 0; S < m.materials.length; S++) {\n              var E = m.materials[S];\n              E ? T.subMaterials.push(c.getLastMaterialByID(E)) : T.subMaterials.push(null);\n            }\n            return T;\n          }, x;\n        }(_.a);\n        u.a.RegisteredTypes[\"BABYLON.MultiMaterial\"] = I;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(2), _ = function() {\n          function C() {\n          }\n          return Object.defineProperty(C, \"ForceFullSceneLoadingForIncremental\", { get: function() {\n            return C._ForceFullSceneLoadingForIncremental;\n          }, set: function(u) {\n            C._ForceFullSceneLoadingForIncremental = u;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"ShowLoadingScreen\", { get: function() {\n            return C._ShowLoadingScreen;\n          }, set: function(u) {\n            C._ShowLoadingScreen = u;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"loggingLevel\", { get: function() {\n            return C._loggingLevel;\n          }, set: function(u) {\n            C._loggingLevel = u;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"CleanBoneMatrixWeights\", { get: function() {\n            return C._CleanBoneMatrixWeights;\n          }, set: function(u) {\n            C._CleanBoneMatrixWeights = u;\n          }, enumerable: !1, configurable: !0 }), C._ForceFullSceneLoadingForIncremental = !1, C._ShowLoadingScreen = !0, C._CleanBoneMatrixWeights = !1, C._loggingLevel = V.a.SCENELOADER_NO_LOGGING, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.CreateCanvas = function(C, u) {\n            if (typeof document > \"u\")\n              return new OffscreenCanvas(C, u);\n            var I = document.createElement(\"canvas\");\n            return I.width = C, I.height = u, I;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return E;\n        });\n        var V = f(0), _ = f(9), C = f(16), u = f(4), I = f(61), O = f(69), x = f(43), m = f(2), c = f(12), T = f(37), S = f(101), E = function() {\n          function g(l, h, v, b, D) {\n            b === void 0 && (b = !1), D === void 0 && (D = null), this.delayLoadState = m.a.DELAYLOADSTATE_NONE, this._totalVertices = 0, this._isDisposed = !1, this._indexBufferIsUpdatable = !1, this._positionsCache = [], this.useBoundingInfoFromGeometry = !1, this.id = l, this.uniqueId = h.getUniqueId(), this._engine = h.getEngine(), this._meshes = [], this._scene = h, this._vertexBuffers = {}, this._indices = [], this._updatable = b, v ? this.setAllVerticesData(v, b) : (this._totalVertices = 0, this._indices = []), this._engine.getCaps().vertexArrayObject && (this._vertexArrayObjects = {}), D && (this.applyToMesh(D), D.computeWorldMatrix(!0));\n          }\n          return Object.defineProperty(g.prototype, \"boundingBias\", { get: function() {\n            return this._boundingBias;\n          }, set: function(l) {\n            this._boundingBias ? this._boundingBias.copyFrom(l) : this._boundingBias = l.clone(), this._updateBoundingInfo(!0, null);\n          }, enumerable: !1, configurable: !0 }), g.CreateGeometryForMesh = function(l) {\n            var h = new g(g.RandomId(), l.getScene());\n            return h.applyToMesh(l), h;\n          }, Object.defineProperty(g.prototype, \"meshes\", { get: function() {\n            return this._meshes;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"extend\", { get: function() {\n            return this._extend;\n          }, enumerable: !1, configurable: !0 }), g.prototype.getScene = function() {\n            return this._scene;\n          }, g.prototype.getEngine = function() {\n            return this._engine;\n          }, g.prototype.isReady = function() {\n            return this.delayLoadState === m.a.DELAYLOADSTATE_LOADED || this.delayLoadState === m.a.DELAYLOADSTATE_NONE;\n          }, Object.defineProperty(g.prototype, \"doNotSerialize\", { get: function() {\n            for (var l = 0; l < this._meshes.length; l++)\n              if (!this._meshes[l].doNotSerialize)\n                return !1;\n            return !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype._rebuild = function() {\n            for (var l in this._vertexArrayObjects && (this._vertexArrayObjects = {}), this._meshes.length !== 0 && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices)), this._vertexBuffers)\n              this._vertexBuffers[l]._rebuild();\n          }, g.prototype.setAllVerticesData = function(l, h) {\n            l.applyToGeometry(this, h), this.notifyUpdate();\n          }, g.prototype.setVerticesData = function(l, h, v, b) {\n            v === void 0 && (v = !1), v && Array.isArray(h) && (h = new Float32Array(h));\n            var D = new u.b(this._engine, h, l, v, this._meshes.length === 0, b);\n            this.setVerticesBuffer(D);\n          }, g.prototype.removeVerticesData = function(l) {\n            this._vertexBuffers[l] && (this._vertexBuffers[l].dispose(), delete this._vertexBuffers[l]);\n          }, g.prototype.setVerticesBuffer = function(l, h) {\n            h === void 0 && (h = null);\n            var v = l.getKind();\n            if (this._vertexBuffers[v] && this._vertexBuffers[v].dispose(), this._vertexBuffers[v] = l, v === u.b.PositionKind) {\n              var b = l.getData();\n              h != null ? this._totalVertices = h : b != null && (this._totalVertices = b.length / (l.byteStride / 4)), this._updateExtend(b), this._resetPointsArrayCache();\n              for (var D = this._meshes, w = D.length, N = 0; N < w; N++) {\n                var M = D[N];\n                M._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum), M._createGlobalSubMesh(!1), M.computeWorldMatrix(!0);\n              }\n            }\n            this.notifyUpdate(v), this._vertexArrayObjects && (this._disposeVertexArrayObjects(), this._vertexArrayObjects = {});\n          }, g.prototype.updateVerticesDataDirectly = function(l, h, v, b) {\n            b === void 0 && (b = !1);\n            var D = this.getVertexBuffer(l);\n            D && (D.updateDirectly(h, v, b), this.notifyUpdate(l));\n          }, g.prototype.updateVerticesData = function(l, h, v) {\n            v === void 0 && (v = !1);\n            var b = this.getVertexBuffer(l);\n            b && (b.update(h), l === u.b.PositionKind && this._updateBoundingInfo(v, h), this.notifyUpdate(l));\n          }, g.prototype._updateBoundingInfo = function(l, h) {\n            if (l && this._updateExtend(h), this._resetPointsArrayCache(), l)\n              for (var v = 0, b = this._meshes; v < b.length; v++) {\n                var D = b[v];\n                D._boundingInfo ? D._boundingInfo.reConstruct(this._extend.minimum, this._extend.maximum) : D._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum);\n                for (var w = 0, N = D.subMeshes; w < N.length; w++)\n                  N[w].refreshBoundingInfo();\n              }\n          }, g.prototype._bind = function(l, h) {\n            if (l) {\n              h === void 0 && (h = this._indexBuffer);\n              var v = this.getVertexBuffers();\n              v && (h == this._indexBuffer && this._vertexArrayObjects ? (this._vertexArrayObjects[l.key] || (this._vertexArrayObjects[l.key] = this._engine.recordVertexArrayObject(v, h, l)), this._engine.bindVertexArrayObject(this._vertexArrayObjects[l.key], h)) : this._engine.bindBuffers(v, h, l));\n            }\n          }, g.prototype.getTotalVertices = function() {\n            return this.isReady() ? this._totalVertices : 0;\n          }, g.prototype.getVerticesData = function(l, h, v) {\n            var b = this.getVertexBuffer(l);\n            if (!b)\n              return null;\n            var D = b.getData();\n            if (!D)\n              return null;\n            var w = b.getSize() * u.b.GetTypeByteLength(b.type), N = this._totalVertices * b.getSize();\n            if (b.type !== u.b.FLOAT || b.byteStride !== w) {\n              var M = [];\n              return b.forEach(N, function(te) {\n                return M.push(te);\n              }), M;\n            }\n            if (!(D instanceof Array || D instanceof Float32Array) || b.byteOffset !== 0 || D.length !== N) {\n              if (D instanceof Array) {\n                var U = b.byteOffset / 4;\n                return c.b.Slice(D, U, U + N);\n              }\n              if (D instanceof ArrayBuffer)\n                return new Float32Array(D, b.byteOffset, N);\n              if (U = D.byteOffset + b.byteOffset, v || h && this._meshes.length !== 1) {\n                var X = new Float32Array(N), j = new Float32Array(D.buffer, U, N);\n                return X.set(j), X;\n              }\n              var ne = U % 4;\n              return ne && (U = Math.max(0, U - ne)), new Float32Array(D.buffer, U, N);\n            }\n            return v || h && this._meshes.length !== 1 ? c.b.Slice(D) : D;\n          }, g.prototype.isVertexBufferUpdatable = function(l) {\n            var h = this._vertexBuffers[l];\n            return !!h && h.isUpdatable();\n          }, g.prototype.getVertexBuffer = function(l) {\n            return this.isReady() ? this._vertexBuffers[l] : null;\n          }, g.prototype.getVertexBuffers = function() {\n            return this.isReady() ? this._vertexBuffers : null;\n          }, g.prototype.isVerticesDataPresent = function(l) {\n            return this._vertexBuffers ? this._vertexBuffers[l] !== void 0 : !!this._delayInfo && this._delayInfo.indexOf(l) !== -1;\n          }, g.prototype.getVerticesDataKinds = function() {\n            var l, h = [];\n            if (!this._vertexBuffers && this._delayInfo)\n              for (l in this._delayInfo)\n                h.push(l);\n            else\n              for (l in this._vertexBuffers)\n                h.push(l);\n            return h;\n          }, g.prototype.updateIndices = function(l, h, v) {\n            if (v === void 0 && (v = !1), this._indexBuffer)\n              if (this._indexBufferIsUpdatable) {\n                var b = l.length !== this._indices.length;\n                if (v || (this._indices = l.slice()), this._engine.updateDynamicIndexBuffer(this._indexBuffer, l, h), b)\n                  for (var D = 0, w = this._meshes; D < w.length; D++)\n                    w[D]._createGlobalSubMesh(!0);\n              } else\n                this.setIndices(l, null, !0);\n          }, g.prototype.setIndices = function(l, h, v) {\n            h === void 0 && (h = null), v === void 0 && (v = !1), this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._disposeVertexArrayObjects(), this._indices = l, this._indexBufferIsUpdatable = v, this._meshes.length !== 0 && this._indices && (this._indexBuffer = this._engine.createIndexBuffer(this._indices, v)), h != null && (this._totalVertices = h);\n            for (var b = 0, D = this._meshes; b < D.length; b++)\n              D[b]._createGlobalSubMesh(!0);\n            this.notifyUpdate();\n          }, g.prototype.getTotalIndices = function() {\n            return this.isReady() ? this._indices.length : 0;\n          }, g.prototype.getIndices = function(l, h) {\n            if (!this.isReady())\n              return null;\n            var v = this._indices;\n            if (h || l && this._meshes.length !== 1) {\n              for (var b = v.length, D = [], w = 0; w < b; w++)\n                D.push(v[w]);\n              return D;\n            }\n            return v;\n          }, g.prototype.getIndexBuffer = function() {\n            return this.isReady() ? this._indexBuffer : null;\n          }, g.prototype._releaseVertexArrayObject = function(l) {\n            l === void 0 && (l = null), l && this._vertexArrayObjects && this._vertexArrayObjects[l.key] && (this._engine.releaseVertexArrayObject(this._vertexArrayObjects[l.key]), delete this._vertexArrayObjects[l.key]);\n          }, g.prototype.releaseForMesh = function(l, h) {\n            var v = this._meshes, b = v.indexOf(l);\n            b !== -1 && (v.splice(b, 1), l._geometry = null, v.length === 0 && h && this.dispose());\n          }, g.prototype.applyToMesh = function(l) {\n            if (l._geometry !== this) {\n              var h = l._geometry;\n              h && h.releaseForMesh(l);\n              var v = this._meshes;\n              l._geometry = this, this._scene.pushGeometry(this), v.push(l), this.isReady() ? this._applyToMesh(l) : l._boundingInfo = this._boundingInfo;\n            }\n          }, g.prototype._updateExtend = function(l) {\n            l === void 0 && (l = null), this.useBoundingInfoFromGeometry && this._boundingInfo ? this._extend = { minimum: this._boundingInfo.minimum.clone(), maximum: this._boundingInfo.maximum.clone() } : (l || (l = this.getVerticesData(u.b.PositionKind)), this._extend = Object(S.a)(l, 0, this._totalVertices, this.boundingBias, 3));\n          }, g.prototype._applyToMesh = function(l) {\n            var h = this._meshes.length;\n            for (var v in this._vertexBuffers) {\n              h === 1 && this._vertexBuffers[v].create();\n              var b = this._vertexBuffers[v].getBuffer();\n              b && (b.references = h), v === u.b.PositionKind && (this._extend || this._updateExtend(), l._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum), l._createGlobalSubMesh(!1), l._updateBoundingInfo());\n            }\n            h === 1 && this._indices && this._indices.length > 0 && (this._indexBuffer = this._engine.createIndexBuffer(this._indices)), this._indexBuffer && (this._indexBuffer.references = h), l._syncGeometryWithMorphTargetManager(), l.synchronizeInstances();\n          }, g.prototype.notifyUpdate = function(l) {\n            this.onGeometryUpdated && this.onGeometryUpdated(this, l);\n            for (var h = 0, v = this._meshes; h < v.length; h++)\n              v[h]._markSubMeshesAsAttributesDirty();\n          }, g.prototype.load = function(l, h) {\n            this.delayLoadState !== m.a.DELAYLOADSTATE_LOADING && (this.isReady() ? h && h() : (this.delayLoadState = m.a.DELAYLOADSTATE_LOADING, this._queueLoad(l, h)));\n          }, g.prototype._queueLoad = function(l, h) {\n            var v = this;\n            this.delayLoadingFile && (l._addPendingData(this), l._loadFile(this.delayLoadingFile, function(b) {\n              if (v._delayLoadingFunction) {\n                v._delayLoadingFunction(JSON.parse(b), v), v.delayLoadState = m.a.DELAYLOADSTATE_LOADED, v._delayInfo = [], l._removePendingData(v);\n                for (var D = v._meshes, w = D.length, N = 0; N < w; N++)\n                  v._applyToMesh(D[N]);\n                h && h();\n              }\n            }, void 0, !0));\n          }, g.prototype.toLeftHanded = function() {\n            var l = this.getIndices(!1);\n            if (l != null && l.length > 0) {\n              for (var h = 0; h < l.length; h += 3) {\n                var v = l[h + 0];\n                l[h + 0] = l[h + 2], l[h + 2] = v;\n              }\n              this.setIndices(l);\n            }\n            var b = this.getVerticesData(u.b.PositionKind, !1);\n            if (b != null && b.length > 0) {\n              for (h = 0; h < b.length; h += 3)\n                b[h + 2] = -b[h + 2];\n              this.setVerticesData(u.b.PositionKind, b, !1);\n            }\n            var D = this.getVerticesData(u.b.NormalKind, !1);\n            if (D != null && D.length > 0) {\n              for (h = 0; h < D.length; h += 3)\n                D[h + 2] = -D[h + 2];\n              this.setVerticesData(u.b.NormalKind, D, !1);\n            }\n          }, g.prototype._resetPointsArrayCache = function() {\n            this._positions = null;\n          }, g.prototype._generatePointsArray = function() {\n            if (this._positions)\n              return !0;\n            var l = this.getVerticesData(u.b.PositionKind);\n            if (!l || l.length === 0)\n              return !1;\n            for (var h = 3 * this._positionsCache.length, v = this._positionsCache.length; h < l.length; h += 3, ++v)\n              this._positionsCache[v] = V.e.FromArray(l, h);\n            for (h = 0, v = 0; h < l.length; h += 3, ++v)\n              this._positionsCache[v].set(l[0 + h], l[1 + h], l[2 + h]);\n            return this._positionsCache.length = l.length / 3, this._positions = this._positionsCache, !0;\n          }, g.prototype.isDisposed = function() {\n            return this._isDisposed;\n          }, g.prototype._disposeVertexArrayObjects = function() {\n            if (this._vertexArrayObjects) {\n              for (var l in this._vertexArrayObjects)\n                this._engine.releaseVertexArrayObject(this._vertexArrayObjects[l]);\n              this._vertexArrayObjects = {};\n            }\n          }, g.prototype.dispose = function() {\n            var l, h = this._meshes, v = h.length;\n            for (l = 0; l < v; l++)\n              this.releaseForMesh(h[l]);\n            for (var b in this._meshes = [], this._disposeVertexArrayObjects(), this._vertexBuffers)\n              this._vertexBuffers[b].dispose();\n            this._vertexBuffers = {}, this._totalVertices = 0, this._indexBuffer && this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null, this._indices = [], this.delayLoadState = m.a.DELAYLOADSTATE_NONE, this.delayLoadingFile = null, this._delayLoadingFunction = null, this._delayInfo = [], this._boundingInfo = null, this._scene.removeGeometry(this), this._isDisposed = !0;\n          }, g.prototype.copy = function(l) {\n            var h = new C.a();\n            h.indices = [];\n            var v = this.getIndices();\n            if (v)\n              for (var b = 0; b < v.length; b++)\n                h.indices.push(v[b]);\n            var D, w = !1, N = !1;\n            for (D in this._vertexBuffers) {\n              var M = this.getVerticesData(D);\n              if (M && (M instanceof Float32Array ? h.set(new Float32Array(M), D) : h.set(M.slice(0), D), !N)) {\n                var U = this.getVertexBuffer(D);\n                U && (N = !(w = U.isUpdatable()));\n              }\n            }\n            var X = new g(l, this._scene, h, w);\n            for (D in X.delayLoadState = this.delayLoadState, X.delayLoadingFile = this.delayLoadingFile, X._delayLoadingFunction = this._delayLoadingFunction, this._delayInfo)\n              X._delayInfo = X._delayInfo || [], X._delayInfo.push(D);\n            return X._boundingInfo = new x.a(this._extend.minimum, this._extend.maximum), X;\n          }, g.prototype.serialize = function() {\n            var l = {};\n            return l.id = this.id, l.updatable = this._updatable, T.a && T.a.HasTags(this) && (l.tags = T.a.GetTags(this)), l;\n          }, g.prototype.toNumberArray = function(l) {\n            return Array.isArray(l) ? l : Array.prototype.slice.call(l);\n          }, g.prototype.serializeVerticeData = function() {\n            var l = this.serialize();\n            return this.isVerticesDataPresent(u.b.PositionKind) && (l.positions = this.toNumberArray(this.getVerticesData(u.b.PositionKind)), this.isVertexBufferUpdatable(u.b.PositionKind) && (l.positions._updatable = !0)), this.isVerticesDataPresent(u.b.NormalKind) && (l.normals = this.toNumberArray(this.getVerticesData(u.b.NormalKind)), this.isVertexBufferUpdatable(u.b.NormalKind) && (l.normals._updatable = !0)), this.isVerticesDataPresent(u.b.TangentKind) && (l.tangets = this.toNumberArray(this.getVerticesData(u.b.TangentKind)), this.isVertexBufferUpdatable(u.b.TangentKind) && (l.tangets._updatable = !0)), this.isVerticesDataPresent(u.b.UVKind) && (l.uvs = this.toNumberArray(this.getVerticesData(u.b.UVKind)), this.isVertexBufferUpdatable(u.b.UVKind) && (l.uvs._updatable = !0)), this.isVerticesDataPresent(u.b.UV2Kind) && (l.uv2s = this.toNumberArray(this.getVerticesData(u.b.UV2Kind)), this.isVertexBufferUpdatable(u.b.UV2Kind) && (l.uv2s._updatable = !0)), this.isVerticesDataPresent(u.b.UV3Kind) && (l.uv3s = this.toNumberArray(this.getVerticesData(u.b.UV3Kind)), this.isVertexBufferUpdatable(u.b.UV3Kind) && (l.uv3s._updatable = !0)), this.isVerticesDataPresent(u.b.UV4Kind) && (l.uv4s = this.toNumberArray(this.getVerticesData(u.b.UV4Kind)), this.isVertexBufferUpdatable(u.b.UV4Kind) && (l.uv4s._updatable = !0)), this.isVerticesDataPresent(u.b.UV5Kind) && (l.uv5s = this.toNumberArray(this.getVerticesData(u.b.UV5Kind)), this.isVertexBufferUpdatable(u.b.UV5Kind) && (l.uv5s._updatable = !0)), this.isVerticesDataPresent(u.b.UV6Kind) && (l.uv6s = this.toNumberArray(this.getVerticesData(u.b.UV6Kind)), this.isVertexBufferUpdatable(u.b.UV6Kind) && (l.uv6s._updatable = !0)), this.isVerticesDataPresent(u.b.ColorKind) && (l.colors = this.toNumberArray(this.getVerticesData(u.b.ColorKind)), this.isVertexBufferUpdatable(u.b.ColorKind) && (l.colors._updatable = !0)), this.isVerticesDataPresent(u.b.MatricesIndicesKind) && (l.matricesIndices = this.toNumberArray(this.getVerticesData(u.b.MatricesIndicesKind)), l.matricesIndices._isExpanded = !0, this.isVertexBufferUpdatable(u.b.MatricesIndicesKind) && (l.matricesIndices._updatable = !0)), this.isVerticesDataPresent(u.b.MatricesWeightsKind) && (l.matricesWeights = this.toNumberArray(this.getVerticesData(u.b.MatricesWeightsKind)), this.isVertexBufferUpdatable(u.b.MatricesWeightsKind) && (l.matricesWeights._updatable = !0)), l.indices = this.toNumberArray(this.getIndices()), l;\n          }, g.ExtractFromMesh = function(l, h) {\n            var v = l._geometry;\n            return v ? v.copy(h) : null;\n          }, g.RandomId = function() {\n            return c.b.RandomId();\n          }, g._ImportGeometry = function(l, h) {\n            var v = h.getScene(), b = l.geometryId;\n            if (b) {\n              var D = v.getGeometryByID(b);\n              D && D.applyToMesh(h);\n            } else if (l instanceof ArrayBuffer) {\n              var w = h._binaryInfo;\n              if (w.positionsAttrDesc && w.positionsAttrDesc.count > 0) {\n                var N = new Float32Array(l, w.positionsAttrDesc.offset, w.positionsAttrDesc.count);\n                h.setVerticesData(u.b.PositionKind, N, !1);\n              }\n              if (w.normalsAttrDesc && w.normalsAttrDesc.count > 0) {\n                var M = new Float32Array(l, w.normalsAttrDesc.offset, w.normalsAttrDesc.count);\n                h.setVerticesData(u.b.NormalKind, M, !1);\n              }\n              if (w.tangetsAttrDesc && w.tangetsAttrDesc.count > 0) {\n                var U = new Float32Array(l, w.tangetsAttrDesc.offset, w.tangetsAttrDesc.count);\n                h.setVerticesData(u.b.TangentKind, U, !1);\n              }\n              if (w.uvsAttrDesc && w.uvsAttrDesc.count > 0) {\n                var X = new Float32Array(l, w.uvsAttrDesc.offset, w.uvsAttrDesc.count);\n                h.setVerticesData(u.b.UVKind, X, !1);\n              }\n              if (w.uvs2AttrDesc && w.uvs2AttrDesc.count > 0) {\n                var j = new Float32Array(l, w.uvs2AttrDesc.offset, w.uvs2AttrDesc.count);\n                h.setVerticesData(u.b.UV2Kind, j, !1);\n              }\n              if (w.uvs3AttrDesc && w.uvs3AttrDesc.count > 0) {\n                var ne = new Float32Array(l, w.uvs3AttrDesc.offset, w.uvs3AttrDesc.count);\n                h.setVerticesData(u.b.UV3Kind, ne, !1);\n              }\n              if (w.uvs4AttrDesc && w.uvs4AttrDesc.count > 0) {\n                var te = new Float32Array(l, w.uvs4AttrDesc.offset, w.uvs4AttrDesc.count);\n                h.setVerticesData(u.b.UV4Kind, te, !1);\n              }\n              if (w.uvs5AttrDesc && w.uvs5AttrDesc.count > 0) {\n                var de = new Float32Array(l, w.uvs5AttrDesc.offset, w.uvs5AttrDesc.count);\n                h.setVerticesData(u.b.UV5Kind, de, !1);\n              }\n              if (w.uvs6AttrDesc && w.uvs6AttrDesc.count > 0) {\n                var pe = new Float32Array(l, w.uvs6AttrDesc.offset, w.uvs6AttrDesc.count);\n                h.setVerticesData(u.b.UV6Kind, pe, !1);\n              }\n              if (w.colorsAttrDesc && w.colorsAttrDesc.count > 0) {\n                var ae = new Float32Array(l, w.colorsAttrDesc.offset, w.colorsAttrDesc.count);\n                h.setVerticesData(u.b.ColorKind, ae, !1, w.colorsAttrDesc.stride);\n              }\n              if (w.matricesIndicesAttrDesc && w.matricesIndicesAttrDesc.count > 0) {\n                for (var ee = new Int32Array(l, w.matricesIndicesAttrDesc.offset, w.matricesIndicesAttrDesc.count), K = [], $ = 0; $ < ee.length; $++) {\n                  var L = ee[$];\n                  K.push(255 & L), K.push((65280 & L) >> 8), K.push((16711680 & L) >> 16), K.push(L >> 24 & 255);\n                }\n                h.setVerticesData(u.b.MatricesIndicesKind, K, !1);\n              }\n              if (w.matricesIndicesExtraAttrDesc && w.matricesIndicesExtraAttrDesc.count > 0) {\n                for (ee = new Int32Array(l, w.matricesIndicesExtraAttrDesc.offset, w.matricesIndicesExtraAttrDesc.count), K = [], $ = 0; $ < ee.length; $++)\n                  L = ee[$], K.push(255 & L), K.push((65280 & L) >> 8), K.push((16711680 & L) >> 16), K.push(L >> 24 & 255);\n                h.setVerticesData(u.b.MatricesIndicesExtraKind, K, !1);\n              }\n              if (w.matricesWeightsAttrDesc && w.matricesWeightsAttrDesc.count > 0) {\n                var G = new Float32Array(l, w.matricesWeightsAttrDesc.offset, w.matricesWeightsAttrDesc.count);\n                h.setVerticesData(u.b.MatricesWeightsKind, G, !1);\n              }\n              if (w.indicesAttrDesc && w.indicesAttrDesc.count > 0) {\n                var Q = new Int32Array(l, w.indicesAttrDesc.offset, w.indicesAttrDesc.count);\n                h.setIndices(Q, null);\n              }\n              if (w.subMeshesAttrDesc && w.subMeshesAttrDesc.count > 0) {\n                var oe = new Int32Array(l, w.subMeshesAttrDesc.offset, 5 * w.subMeshesAttrDesc.count);\n                for (h.subMeshes = [], $ = 0; $ < w.subMeshesAttrDesc.count; $++) {\n                  var re = oe[5 * $ + 0], Y = oe[5 * $ + 1], k = oe[5 * $ + 2], H = oe[5 * $ + 3], Z = oe[5 * $ + 4];\n                  I.a.AddToMesh(re, Y, k, H, Z, h);\n                }\n              }\n            } else if (l.positions && l.normals && l.indices) {\n              if (h.setVerticesData(u.b.PositionKind, l.positions, l.positions._updatable), h.setVerticesData(u.b.NormalKind, l.normals, l.normals._updatable), l.tangents && h.setVerticesData(u.b.TangentKind, l.tangents, l.tangents._updatable), l.uvs && h.setVerticesData(u.b.UVKind, l.uvs, l.uvs._updatable), l.uvs2 && h.setVerticesData(u.b.UV2Kind, l.uvs2, l.uvs2._updatable), l.uvs3 && h.setVerticesData(u.b.UV3Kind, l.uvs3, l.uvs3._updatable), l.uvs4 && h.setVerticesData(u.b.UV4Kind, l.uvs4, l.uvs4._updatable), l.uvs5 && h.setVerticesData(u.b.UV5Kind, l.uvs5, l.uvs5._updatable), l.uvs6 && h.setVerticesData(u.b.UV6Kind, l.uvs6, l.uvs6._updatable), l.colors && h.setVerticesData(u.b.ColorKind, _.b.CheckColors4(l.colors, l.positions.length / 3), l.colors._updatable), l.matricesIndices)\n                if (l.matricesIndices._isExpanded)\n                  delete l.matricesIndices._isExpanded, h.setVerticesData(u.b.MatricesIndicesKind, l.matricesIndices, l.matricesIndices._updatable);\n                else {\n                  for (K = [], $ = 0; $ < l.matricesIndices.length; $++) {\n                    var W = l.matricesIndices[$];\n                    K.push(255 & W), K.push((65280 & W) >> 8), K.push((16711680 & W) >> 16), K.push(W >> 24 & 255);\n                  }\n                  h.setVerticesData(u.b.MatricesIndicesKind, K, l.matricesIndices._updatable);\n                }\n              if (l.matricesIndicesExtra)\n                if (l.matricesIndicesExtra._isExpanded)\n                  delete l.matricesIndices._isExpanded, h.setVerticesData(u.b.MatricesIndicesExtraKind, l.matricesIndicesExtra, l.matricesIndicesExtra._updatable);\n                else {\n                  for (K = [], $ = 0; $ < l.matricesIndicesExtra.length; $++)\n                    W = l.matricesIndicesExtra[$], K.push(255 & W), K.push((65280 & W) >> 8), K.push((16711680 & W) >> 16), K.push(W >> 24 & 255);\n                  h.setVerticesData(u.b.MatricesIndicesExtraKind, K, l.matricesIndicesExtra._updatable);\n                }\n              l.matricesWeights && (g._CleanMatricesWeights(l, h), h.setVerticesData(u.b.MatricesWeightsKind, l.matricesWeights, l.matricesWeights._updatable)), l.matricesWeightsExtra && h.setVerticesData(u.b.MatricesWeightsExtraKind, l.matricesWeightsExtra, l.matricesWeights._updatable), h.setIndices(l.indices, null);\n            }\n            if (l.subMeshes) {\n              h.subMeshes = [];\n              for (var q = 0; q < l.subMeshes.length; q++) {\n                var he = l.subMeshes[q];\n                I.a.AddToMesh(he.materialIndex, he.verticesStart, he.verticesCount, he.indexStart, he.indexCount, h);\n              }\n            }\n            h._shouldGenerateFlatShading && (h.convertToFlatShadedMesh(), h._shouldGenerateFlatShading = !1), h.computeWorldMatrix(!0), v.onMeshImportedObservable.notifyObservers(h);\n          }, g._CleanMatricesWeights = function(l, h) {\n            if (O.a.CleanBoneMatrixWeights) {\n              var v = 0;\n              if (l.skeletonId > -1) {\n                var b = h.getScene().getLastSkeletonByID(l.skeletonId);\n                if (b) {\n                  v = b.bones.length;\n                  for (var D = h.getVerticesData(u.b.MatricesIndicesKind), w = h.getVerticesData(u.b.MatricesIndicesExtraKind), N = l.matricesWeights, M = l.matricesWeightsExtra, U = l.numBoneInfluencer, X = N.length, j = 0; j < X; j += 4) {\n                    for (var ne = 0, te = -1, de = 0; de < 4; de++)\n                      ne += pe = N[j + de], pe < 1e-3 && te < 0 && (te = de);\n                    if (M)\n                      for (de = 0; de < 4; de++) {\n                        var pe;\n                        ne += pe = M[j + de], pe < 1e-3 && te < 0 && (te = de + 4);\n                      }\n                    if ((te < 0 || te > U - 1) && (te = U - 1), ne > 1e-3) {\n                      var ae = 1 / ne;\n                      for (de = 0; de < 4; de++)\n                        N[j + de] *= ae;\n                      if (M)\n                        for (de = 0; de < 4; de++)\n                          M[j + de] *= ae;\n                    } else\n                      te >= 4 ? (M[j + te - 4] = 1 - ne, w[j + te - 4] = v) : (N[j + te] = 1 - ne, D[j + te] = v);\n                  }\n                  h.setVerticesData(u.b.MatricesIndicesKind, D), l.matricesWeightsExtra && h.setVerticesData(u.b.MatricesIndicesExtraKind, w);\n                }\n              }\n            }\n          }, g.Parse = function(l, h, v) {\n            if (h.getGeometryByID(l.id))\n              return null;\n            var b = new g(l.id, h, void 0, l.updatable);\n            return T.a && T.a.AddTagsTo(b, l.tags), l.delayLoadingFile ? (b.delayLoadState = m.a.DELAYLOADSTATE_NOTLOADED, b.delayLoadingFile = v + l.delayLoadingFile, b._boundingInfo = new x.a(V.e.FromArray(l.boundingBoxMinimum), V.e.FromArray(l.boundingBoxMaximum)), b._delayInfo = [], l.hasUVs && b._delayInfo.push(u.b.UVKind), l.hasUVs2 && b._delayInfo.push(u.b.UV2Kind), l.hasUVs3 && b._delayInfo.push(u.b.UV3Kind), l.hasUVs4 && b._delayInfo.push(u.b.UV4Kind), l.hasUVs5 && b._delayInfo.push(u.b.UV5Kind), l.hasUVs6 && b._delayInfo.push(u.b.UV6Kind), l.hasColors && b._delayInfo.push(u.b.ColorKind), l.hasMatricesIndices && b._delayInfo.push(u.b.MatricesIndicesKind), l.hasMatricesWeights && b._delayInfo.push(u.b.MatricesWeightsKind), b._delayLoadingFunction = C.a.ImportVertexData) : C.a.ImportVertexData(l, b), h.pushGeometry(b, !0), b;\n          }, g;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"e\", function() {\n          return V;\n        }), f.d(A, \"c\", function() {\n          return I;\n        }), f.d(A, \"a\", function() {\n          return O;\n        }), f.d(A, \"b\", function() {\n          return x;\n        }), f.d(A, \"f\", function() {\n          return m;\n        }), f.d(A, \"g\", function() {\n          return c;\n        }), f.d(A, \"d\", function() {\n          return T;\n        });\n        var V, _ = f(14), C = f(0), u = f(28);\n        (function(S) {\n          S[S.CW = 0] = \"CW\", S[S.CCW = 1] = \"CCW\";\n        })(V || (V = {}));\n        var I = function() {\n          function S() {\n          }\n          return S.Interpolate = function(E, g, l, h, v) {\n            for (var b = 1 - 3 * h + 3 * g, D = 3 * h - 6 * g, w = 3 * g, N = E, M = 0; M < 5; M++) {\n              var U = N * N;\n              N -= (b * (U * N) + D * U + w * N - E) * (1 / (3 * b * U + 2 * D * N + w)), N = Math.min(1, Math.max(0, N));\n            }\n            return 3 * Math.pow(1 - N, 2) * N * l + 3 * (1 - N) * Math.pow(N, 2) * v + Math.pow(N, 3);\n          }, S;\n        }(), O = function() {\n          function S(E) {\n            this._radians = E, this._radians < 0 && (this._radians += 2 * Math.PI);\n          }\n          return S.prototype.degrees = function() {\n            return 180 * this._radians / Math.PI;\n          }, S.prototype.radians = function() {\n            return this._radians;\n          }, S.BetweenTwoPoints = function(E, g) {\n            var l = g.subtract(E);\n            return new S(Math.atan2(l.y, l.x));\n          }, S.FromRadians = function(E) {\n            return new S(E);\n          }, S.FromDegrees = function(E) {\n            return new S(E * Math.PI / 180);\n          }, S;\n        }(), x = function(S, E, g) {\n          this.startPoint = S, this.midPoint = E, this.endPoint = g;\n          var l = Math.pow(E.x, 2) + Math.pow(E.y, 2), h = (Math.pow(S.x, 2) + Math.pow(S.y, 2) - l) / 2, v = (l - Math.pow(g.x, 2) - Math.pow(g.y, 2)) / 2, b = (S.x - E.x) * (E.y - g.y) - (E.x - g.x) * (S.y - E.y);\n          this.centerPoint = new C.d((h * (E.y - g.y) - v * (S.y - E.y)) / b, ((S.x - E.x) * v - (E.x - g.x) * h) / b), this.radius = this.centerPoint.subtract(this.startPoint).length(), this.startAngle = O.BetweenTwoPoints(this.centerPoint, this.startPoint);\n          var D = this.startAngle.degrees(), w = O.BetweenTwoPoints(this.centerPoint, this.midPoint).degrees(), N = O.BetweenTwoPoints(this.centerPoint, this.endPoint).degrees();\n          w - D > 180 && (w -= 360), w - D < -180 && (w += 360), N - w > 180 && (N -= 360), N - w < -180 && (N += 360), this.orientation = w - D < 0 ? V.CW : V.CCW, this.angle = O.FromDegrees(this.orientation === V.CW ? D - N : N - D);\n        }, m = function() {\n          function S(E, g) {\n            this._points = new Array(), this._length = 0, this.closed = !1, this._points.push(new C.d(E, g));\n          }\n          return S.prototype.addLineTo = function(E, g) {\n            if (this.closed)\n              return this;\n            var l = new C.d(E, g), h = this._points[this._points.length - 1];\n            return this._points.push(l), this._length += l.subtract(h).length(), this;\n          }, S.prototype.addArcTo = function(E, g, l, h, v) {\n            if (v === void 0 && (v = 36), this.closed)\n              return this;\n            var b = this._points[this._points.length - 1], D = new C.d(E, g), w = new C.d(l, h), N = new x(b, D, w), M = N.angle.radians() / v;\n            N.orientation === V.CW && (M *= -1);\n            for (var U = N.startAngle.radians() + M, X = 0; X < v; X++) {\n              var j = Math.cos(U) * N.radius + N.centerPoint.x, ne = Math.sin(U) * N.radius + N.centerPoint.y;\n              this.addLineTo(j, ne), U += M;\n            }\n            return this;\n          }, S.prototype.close = function() {\n            return this.closed = !0, this;\n          }, S.prototype.length = function() {\n            var E = this._length;\n            if (this.closed) {\n              var g = this._points[this._points.length - 1];\n              E += this._points[0].subtract(g).length();\n            }\n            return E;\n          }, S.prototype.getPoints = function() {\n            return this._points;\n          }, S.prototype.getPointAtLengthPosition = function(E) {\n            if (E < 0 || E > 1)\n              return C.d.Zero();\n            for (var g = E * this.length(), l = 0, h = 0; h < this._points.length; h++) {\n              var v = (h + 1) % this._points.length, b = this._points[h], D = this._points[v].subtract(b), w = D.length() + l;\n              if (g >= l && g <= w) {\n                var N = D.normalize(), M = g - l;\n                return new C.d(b.x + N.x * M, b.y + N.y * M);\n              }\n              l = w;\n            }\n            return C.d.Zero();\n          }, S.StartingAt = function(E, g) {\n            return new S(E, g);\n          }, S;\n        }(), c = function() {\n          function S(E, g, l, h) {\n            g === void 0 && (g = null), h === void 0 && (h = !1), this.path = E, this._curve = new Array(), this._distances = new Array(), this._tangents = new Array(), this._normals = new Array(), this._binormals = new Array(), this._pointAtData = { id: 0, point: C.e.Zero(), previousPointArrayIndex: 0, position: 0, subPosition: 0, interpolateReady: !1, interpolationMatrix: C.a.Identity() };\n            for (var v = 0; v < E.length; v++)\n              this._curve[v] = E[v].clone();\n            this._raw = l || !1, this._alignTangentsWithPath = h, this._compute(g, h);\n          }\n          return S.prototype.getCurve = function() {\n            return this._curve;\n          }, S.prototype.getPoints = function() {\n            return this._curve;\n          }, S.prototype.length = function() {\n            return this._distances[this._distances.length - 1];\n          }, S.prototype.getTangents = function() {\n            return this._tangents;\n          }, S.prototype.getNormals = function() {\n            return this._normals;\n          }, S.prototype.getBinormals = function() {\n            return this._binormals;\n          }, S.prototype.getDistances = function() {\n            return this._distances;\n          }, S.prototype.getPointAt = function(E) {\n            return this._updatePointAtData(E).point;\n          }, S.prototype.getTangentAt = function(E, g) {\n            return g === void 0 && (g = !1), this._updatePointAtData(E, g), g ? C.e.TransformCoordinates(C.e.Forward(), this._pointAtData.interpolationMatrix) : this._tangents[this._pointAtData.previousPointArrayIndex];\n          }, S.prototype.getNormalAt = function(E, g) {\n            return g === void 0 && (g = !1), this._updatePointAtData(E, g), g ? C.e.TransformCoordinates(C.e.Right(), this._pointAtData.interpolationMatrix) : this._normals[this._pointAtData.previousPointArrayIndex];\n          }, S.prototype.getBinormalAt = function(E, g) {\n            return g === void 0 && (g = !1), this._updatePointAtData(E, g), g ? C.e.TransformCoordinates(C.e.UpReadOnly, this._pointAtData.interpolationMatrix) : this._binormals[this._pointAtData.previousPointArrayIndex];\n          }, S.prototype.getDistanceAt = function(E) {\n            return this.length() * E;\n          }, S.prototype.getPreviousPointIndexAt = function(E) {\n            return this._updatePointAtData(E), this._pointAtData.previousPointArrayIndex;\n          }, S.prototype.getSubPositionAt = function(E) {\n            return this._updatePointAtData(E), this._pointAtData.subPosition;\n          }, S.prototype.getClosestPositionTo = function(E) {\n            for (var g = Number.MAX_VALUE, l = 0, h = 0; h < this._curve.length - 1; h++) {\n              var v = this._curve[h + 0], b = this._curve[h + 1].subtract(v).normalize(), D = this._distances[h + 1] - this._distances[h + 0], w = Math.min(Math.max(C.e.Dot(b, E.subtract(v).normalize()), 0) * C.e.Distance(v, E) / D, 1), N = C.e.Distance(v.add(b.scale(w * D)), E);\n              N < g && (g = N, l = (this._distances[h + 0] + D * w) / this.length());\n            }\n            return l;\n          }, S.prototype.slice = function(E, g) {\n            if (E === void 0 && (E = 0), g === void 0 && (g = 1), E < 0 && (E = 1 - -1 * E % 1), g < 0 && (g = 1 - -1 * g % 1), E > g) {\n              var l = E;\n              E = g, g = l;\n            }\n            var h = this.getCurve(), v = this.getPointAt(E), b = this.getPreviousPointIndexAt(E), D = this.getPointAt(g), w = this.getPreviousPointIndexAt(g) + 1, N = [];\n            return E !== 0 && (b++, N.push(v)), N.push.apply(N, h.slice(b, w)), g === 1 && E !== 1 || N.push(D), new S(N, this.getNormalAt(E), this._raw, this._alignTangentsWithPath);\n          }, S.prototype.update = function(E, g, l) {\n            g === void 0 && (g = null), l === void 0 && (l = !1);\n            for (var h = 0; h < E.length; h++)\n              this._curve[h].x = E[h].x, this._curve[h].y = E[h].y, this._curve[h].z = E[h].z;\n            return this._compute(g, l), this;\n          }, S.prototype._compute = function(E, g) {\n            g === void 0 && (g = !1);\n            var l = this._curve.length;\n            if (!(l < 2)) {\n              this._tangents[0] = this._getFirstNonNullVector(0), this._raw || this._tangents[0].normalize(), this._tangents[l - 1] = this._curve[l - 1].subtract(this._curve[l - 2]), this._raw || this._tangents[l - 1].normalize();\n              var h, v, b, D, w, N = this._tangents[0], M = this._normalVector(N, E);\n              this._normals[0] = M, this._raw || this._normals[0].normalize(), this._binormals[0] = C.e.Cross(N, this._normals[0]), this._raw || this._binormals[0].normalize(), this._distances[0] = 0;\n              for (var U = 1; U < l; U++)\n                h = this._getLastNonNullVector(U), U < l - 1 && (v = this._getFirstNonNullVector(U), this._tangents[U] = g ? v : h.add(v), this._tangents[U].normalize()), this._distances[U] = this._distances[U - 1] + this._curve[U].subtract(this._curve[U - 1]).length(), b = this._tangents[U], w = this._binormals[U - 1], this._normals[U] = C.e.Cross(w, b), this._raw || (this._normals[U].length() === 0 ? (D = this._normals[U - 1], this._normals[U] = D.clone()) : this._normals[U].normalize()), this._binormals[U] = C.e.Cross(b, this._normals[U]), this._raw || this._binormals[U].normalize();\n              this._pointAtData.id = NaN;\n            }\n          }, S.prototype._getFirstNonNullVector = function(E) {\n            for (var g = 1, l = this._curve[E + g].subtract(this._curve[E]); l.length() === 0 && E + g + 1 < this._curve.length; )\n              g++, l = this._curve[E + g].subtract(this._curve[E]);\n            return l;\n          }, S.prototype._getLastNonNullVector = function(E) {\n            for (var g = 1, l = this._curve[E].subtract(this._curve[E - g]); l.length() === 0 && E > g + 1; )\n              g++, l = this._curve[E].subtract(this._curve[E - g]);\n            return l;\n          }, S.prototype._normalVector = function(E, g) {\n            var l, h, v = E.length();\n            return v === 0 && (v = 1), g == null ? (h = _.a.WithinEpsilon(Math.abs(E.y) / v, 1, u.a) ? _.a.WithinEpsilon(Math.abs(E.x) / v, 1, u.a) ? _.a.WithinEpsilon(Math.abs(E.z) / v, 1, u.a) ? C.e.Zero() : new C.e(0, 0, 1) : new C.e(1, 0, 0) : new C.e(0, -1, 0), l = C.e.Cross(E, h)) : (l = C.e.Cross(E, g), C.e.CrossToRef(l, E, l)), l.normalize(), l;\n          }, S.prototype._updatePointAtData = function(E, g) {\n            if (g === void 0 && (g = !1), this._pointAtData.id === E)\n              return this._pointAtData.interpolateReady || this._updateInterpolationMatrix(), this._pointAtData;\n            this._pointAtData.id = E;\n            var l = this.getPoints();\n            if (E <= 0)\n              return this._setPointAtData(0, 0, l[0], 0, g);\n            if (E >= 1)\n              return this._setPointAtData(1, 1, l[l.length - 1], l.length - 1, g);\n            for (var h, v = l[0], b = 0, D = E * this.length(), w = 1; w < l.length; w++) {\n              h = l[w];\n              var N = C.e.Distance(v, h);\n              if ((b += N) === D)\n                return this._setPointAtData(E, 1, h, w, g);\n              if (b > D) {\n                var M = (b - D) / N, U = v.subtract(h), X = h.add(U.scaleInPlace(M));\n                return this._setPointAtData(E, 1 - M, X, w - 1, g);\n              }\n              v = h;\n            }\n            return this._pointAtData;\n          }, S.prototype._setPointAtData = function(E, g, l, h, v) {\n            return this._pointAtData.point = l, this._pointAtData.position = E, this._pointAtData.subPosition = g, this._pointAtData.previousPointArrayIndex = h, this._pointAtData.interpolateReady = v, v && this._updateInterpolationMatrix(), this._pointAtData;\n          }, S.prototype._updateInterpolationMatrix = function() {\n            this._pointAtData.interpolationMatrix = C.a.Identity();\n            var E = this._pointAtData.previousPointArrayIndex;\n            if (E !== this._tangents.length - 1) {\n              var g = E + 1, l = this._tangents[E].clone(), h = this._normals[E].clone(), v = this._binormals[E].clone(), b = this._tangents[g].clone(), D = this._normals[g].clone(), w = this._binormals[g].clone(), N = C.b.RotationQuaternionFromAxis(h, v, l), M = C.b.RotationQuaternionFromAxis(D, w, b);\n              C.b.Slerp(N, M, this._pointAtData.subPosition).toRotationMatrix(this._pointAtData.interpolationMatrix);\n            }\n          }, S;\n        }(), T = function() {\n          function S(E) {\n            this._length = 0, this._points = E, this._length = this._computeLength(E);\n          }\n          return S.CreateQuadraticBezier = function(E, g, l, h) {\n            h = h > 2 ? h : 3;\n            for (var v = new Array(), b = function(w, N, M, U) {\n              return (1 - w) * (1 - w) * N + 2 * w * (1 - w) * M + w * w * U;\n            }, D = 0; D <= h; D++)\n              v.push(new C.e(b(D / h, E.x, g.x, l.x), b(D / h, E.y, g.y, l.y), b(D / h, E.z, g.z, l.z)));\n            return new S(v);\n          }, S.CreateCubicBezier = function(E, g, l, h, v) {\n            v = v > 3 ? v : 4;\n            for (var b = new Array(), D = function(N, M, U, X, j) {\n              return (1 - N) * (1 - N) * (1 - N) * M + 3 * N * (1 - N) * (1 - N) * U + 3 * N * N * (1 - N) * X + N * N * N * j;\n            }, w = 0; w <= v; w++)\n              b.push(new C.e(D(w / v, E.x, g.x, l.x, h.x), D(w / v, E.y, g.y, l.y, h.y), D(w / v, E.z, g.z, l.z, h.z)));\n            return new S(b);\n          }, S.CreateHermiteSpline = function(E, g, l, h, v) {\n            for (var b = new Array(), D = 1 / v, w = 0; w <= v; w++)\n              b.push(C.e.Hermite(E, g, l, h, w * D));\n            return new S(b);\n          }, S.CreateCatmullRomSpline = function(E, g, l) {\n            var h = new Array(), v = 1 / g, b = 0;\n            if (l) {\n              for (var D = E.length, w = 0; w < D; w++) {\n                b = 0;\n                for (var N = 0; N < g; N++)\n                  h.push(C.e.CatmullRom(E[w % D], E[(w + 1) % D], E[(w + 2) % D], E[(w + 3) % D], b)), b += v;\n              }\n              h.push(h[0]);\n            } else {\n              var M = new Array();\n              for (M.push(E[0].clone()), Array.prototype.push.apply(M, E), M.push(E[E.length - 1].clone()), w = 0; w < M.length - 3; w++)\n                for (b = 0, N = 0; N < g; N++)\n                  h.push(C.e.CatmullRom(M[w], M[w + 1], M[w + 2], M[w + 3], b)), b += v;\n              w--, h.push(C.e.CatmullRom(M[w], M[w + 1], M[w + 2], M[w + 3], b));\n            }\n            return new S(h);\n          }, S.prototype.getPoints = function() {\n            return this._points;\n          }, S.prototype.length = function() {\n            return this._length;\n          }, S.prototype.continue = function(E) {\n            for (var g = this._points[this._points.length - 1], l = this._points.slice(), h = E.getPoints(), v = 1; v < h.length; v++)\n              l.push(h[v].subtract(h[0]).add(g));\n            return new S(l);\n          }, S.prototype._computeLength = function(E) {\n            for (var g = 0, l = 1; l < E.length; l++)\n              g += E[l].subtract(E[l - 1]).length();\n            return g;\n          }, S;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return l;\n        });\n        var V = f(1), _ = f(3), C = f(0), u = f(4), I = f(10), O = f(15), x = f(25), m = f(11), c = f(9), T = f(67), S = f(49), E = f(13), g = { effect: null, subMesh: null }, l = function(h) {\n          function v(b, D, w, N) {\n            N === void 0 && (N = {});\n            var M = h.call(this, b, D) || this;\n            return M._textures = {}, M._textureArrays = {}, M._floats = {}, M._ints = {}, M._floatsArrays = {}, M._colors3 = {}, M._colors3Arrays = {}, M._colors4 = {}, M._colors4Arrays = {}, M._vectors2 = {}, M._vectors3 = {}, M._vectors4 = {}, M._matrices = {}, M._matrixArrays = {}, M._matrices3x3 = {}, M._matrices2x2 = {}, M._vectors2Arrays = {}, M._vectors3Arrays = {}, M._vectors4Arrays = {}, M._cachedWorldViewMatrix = new C.a(), M._cachedWorldViewProjectionMatrix = new C.a(), M._multiview = !1, M._shaderPath = w, M._options = Object(V.a)({ needAlphaBlending: !1, needAlphaTesting: !1, attributes: [\"position\", \"normal\", \"uv\"], uniforms: [\"worldViewProjection\"], uniformBuffers: [], samplers: [], defines: [] }, N), M;\n          }\n          return Object(V.d)(v, h), Object.defineProperty(v.prototype, \"shaderPath\", { get: function() {\n            return this._shaderPath;\n          }, set: function(b) {\n            this._shaderPath = b;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"options\", { get: function() {\n            return this._options;\n          }, enumerable: !1, configurable: !0 }), v.prototype.getClassName = function() {\n            return \"ShaderMaterial\";\n          }, v.prototype.needAlphaBlending = function() {\n            return this.alpha < 1 || this._options.needAlphaBlending;\n          }, v.prototype.needAlphaTesting = function() {\n            return this._options.needAlphaTesting;\n          }, v.prototype._checkUniform = function(b) {\n            this._options.uniforms.indexOf(b) === -1 && this._options.uniforms.push(b);\n          }, v.prototype.setTexture = function(b, D) {\n            return this._options.samplers.indexOf(b) === -1 && this._options.samplers.push(b), this._textures[b] = D, this;\n          }, v.prototype.setTextureArray = function(b, D) {\n            return this._options.samplers.indexOf(b) === -1 && this._options.samplers.push(b), this._checkUniform(b), this._textureArrays[b] = D, this;\n          }, v.prototype.setFloat = function(b, D) {\n            return this._checkUniform(b), this._floats[b] = D, this;\n          }, v.prototype.setInt = function(b, D) {\n            return this._checkUniform(b), this._ints[b] = D, this;\n          }, v.prototype.setFloats = function(b, D) {\n            return this._checkUniform(b), this._floatsArrays[b] = D, this;\n          }, v.prototype.setColor3 = function(b, D) {\n            return this._checkUniform(b), this._colors3[b] = D, this;\n          }, v.prototype.setColor3Array = function(b, D) {\n            return this._checkUniform(b), this._colors3Arrays[b] = D.reduce(function(w, N) {\n              return N.toArray(w, w.length), w;\n            }, []), this;\n          }, v.prototype.setColor4 = function(b, D) {\n            return this._checkUniform(b), this._colors4[b] = D, this;\n          }, v.prototype.setColor4Array = function(b, D) {\n            return this._checkUniform(b), this._colors4Arrays[b] = D.reduce(function(w, N) {\n              return N.toArray(w, w.length), w;\n            }, []), this;\n          }, v.prototype.setVector2 = function(b, D) {\n            return this._checkUniform(b), this._vectors2[b] = D, this;\n          }, v.prototype.setVector3 = function(b, D) {\n            return this._checkUniform(b), this._vectors3[b] = D, this;\n          }, v.prototype.setVector4 = function(b, D) {\n            return this._checkUniform(b), this._vectors4[b] = D, this;\n          }, v.prototype.setMatrix = function(b, D) {\n            return this._checkUniform(b), this._matrices[b] = D, this;\n          }, v.prototype.setMatrices = function(b, D) {\n            this._checkUniform(b);\n            for (var w = new Float32Array(16 * D.length), N = 0; N < D.length; N++)\n              D[N].copyToArray(w, 16 * N);\n            return this._matrixArrays[b] = w, this;\n          }, v.prototype.setMatrix3x3 = function(b, D) {\n            return this._checkUniform(b), this._matrices3x3[b] = D, this;\n          }, v.prototype.setMatrix2x2 = function(b, D) {\n            return this._checkUniform(b), this._matrices2x2[b] = D, this;\n          }, v.prototype.setArray2 = function(b, D) {\n            return this._checkUniform(b), this._vectors2Arrays[b] = D, this;\n          }, v.prototype.setArray3 = function(b, D) {\n            return this._checkUniform(b), this._vectors3Arrays[b] = D, this;\n          }, v.prototype.setArray4 = function(b, D) {\n            return this._checkUniform(b), this._vectors4Arrays[b] = D, this;\n          }, v.prototype._checkCache = function(b, D) {\n            return !b || !this._effect || this._effect.defines.indexOf(\"#define INSTANCES\") !== -1 === D;\n          }, v.prototype.isReadyForSubMesh = function(b, D, w) {\n            return this.isReady(b, w);\n          }, v.prototype.isReady = function(b, D) {\n            var w, N;\n            if (this._effect && this.isFrozen && this._effect._wasPreviouslyReady)\n              return !0;\n            var M = this.getScene(), U = M.getEngine();\n            if (!this.checkReadyOnEveryCall && this._renderId === M.getRenderId() && this._checkCache(b, D))\n              return !0;\n            var X = [], j = [], ne = new T.a();\n            U.getCaps().multiview && M.activeCamera && M.activeCamera.outputRenderTarget && M.activeCamera.outputRenderTarget.getViewCount() > 1 && (this._multiview = !0, X.push(\"#define MULTIVIEW\"), this._options.uniforms.indexOf(\"viewProjection\") !== -1 && this._options.uniforms.push(\"viewProjectionR\") === -1 && this._options.uniforms.push(\"viewProjectionR\"));\n            for (var te = 0; te < this._options.defines.length; te++)\n              X.push(this._options.defines[te]);\n            for (te = 0; te < this._options.attributes.length; te++)\n              j.push(this._options.attributes[te]);\n            b && b.isVerticesDataPresent(u.b.ColorKind) && (j.push(u.b.ColorKind), X.push(\"#define VERTEXCOLOR\")), D && (X.push(\"#define INSTANCES\"), O.a.PushAttributesForInstances(j), b != null && b.hasThinInstances && X.push(\"#define THIN_INSTANCES\"));\n            var de = 0;\n            if (b && b.useBones && b.computeBonesUsingShaders && b.skeleton) {\n              j.push(u.b.MatricesIndicesKind), j.push(u.b.MatricesWeightsKind), b.numBoneInfluencers > 4 && (j.push(u.b.MatricesIndicesExtraKind), j.push(u.b.MatricesWeightsExtraKind));\n              var pe = b.skeleton;\n              de = b.numBoneInfluencers, X.push(\"#define NUM_BONE_INFLUENCERS \" + de), ne.addCPUSkinningFallback(0, b), pe.isUsingTextureForMatrices ? (X.push(\"#define BONETEXTURE\"), this._options.uniforms.indexOf(\"boneTextureWidth\") === -1 && this._options.uniforms.push(\"boneTextureWidth\"), this._options.samplers.indexOf(\"boneSampler\") === -1 && this._options.samplers.push(\"boneSampler\")) : (X.push(\"#define BonesPerMesh \" + (pe.bones.length + 1)), this._options.uniforms.indexOf(\"mBones\") === -1 && this._options.uniforms.push(\"mBones\"));\n            } else\n              X.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            for (var ae in this._textures)\n              if (!this._textures[ae].isReady())\n                return !1;\n            b && this._shouldTurnAlphaTestOn(b) && X.push(\"#define ALPHATEST\");\n            var ee = this._shaderPath, K = this._options.uniforms, $ = this._options.uniformBuffers, L = this._options.samplers;\n            this.customShaderNameResolve && (K = K.slice(), $ = $.slice(), L = L.slice(), ee = this.customShaderNameResolve(ee, K, $, L, X, j));\n            var G = this._effect, Q = X.join(`\n`);\n            return this._cachedDefines !== Q && (this._cachedDefines = Q, this._effect = U.createEffect(ee, { attributes: j, uniformsNames: K, uniformBuffersNames: $, samplers: L, defines: Q, fallbacks: ne, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousMorphTargets: de } }, U), this._onEffectCreatedObservable && (g.effect = this._effect, this._onEffectCreatedObservable.notifyObservers(g))), (N = !(!((w = this._effect) === null || w === void 0) && w.isReady())) !== null && N !== void 0 && !N && (G !== this._effect && M.resetCachedMaterial(), this._renderId = M.getRenderId(), this._effect._wasPreviouslyReady = !0, !0);\n          }, v.prototype.bindOnlyWorldMatrix = function(b, D) {\n            var w = this.getScene(), N = D ?? this._effect;\n            N && (this._options.uniforms.indexOf(\"world\") !== -1 && N.setMatrix(\"world\", b), this._options.uniforms.indexOf(\"worldView\") !== -1 && (b.multiplyToRef(w.getViewMatrix(), this._cachedWorldViewMatrix), N.setMatrix(\"worldView\", this._cachedWorldViewMatrix)), this._options.uniforms.indexOf(\"worldViewProjection\") !== -1 && (b.multiplyToRef(w.getTransformMatrix(), this._cachedWorldViewProjectionMatrix), N.setMatrix(\"worldViewProjection\", this._cachedWorldViewProjectionMatrix)));\n          }, v.prototype.bindForSubMesh = function(b, D, w) {\n            this.bind(b, D, w._effectOverride);\n          }, v.prototype.bind = function(b, D, w) {\n            this.bindOnlyWorldMatrix(b, w);\n            var N = w ?? this._effect;\n            if (N && this.getScene().getCachedMaterial() !== this) {\n              var M;\n              for (M in this._options.uniforms.indexOf(\"view\") !== -1 && N.setMatrix(\"view\", this.getScene().getViewMatrix()), this._options.uniforms.indexOf(\"projection\") !== -1 && N.setMatrix(\"projection\", this.getScene().getProjectionMatrix()), this._options.uniforms.indexOf(\"viewProjection\") !== -1 && (N.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix()), this._multiview && N.setMatrix(\"viewProjectionR\", this.getScene()._transformMatrixR)), this.getScene().activeCamera && this._options.uniforms.indexOf(\"cameraPosition\") !== -1 && N.setVector3(\"cameraPosition\", this.getScene().activeCamera.globalPosition), O.a.BindBonesParameters(D, N), this._textures)\n                N.setTexture(M, this._textures[M]);\n              for (M in this._textureArrays)\n                N.setTextureArray(M, this._textureArrays[M]);\n              for (M in this._ints)\n                N.setInt(M, this._ints[M]);\n              for (M in this._floats)\n                N.setFloat(M, this._floats[M]);\n              for (M in this._floatsArrays)\n                N.setArray(M, this._floatsArrays[M]);\n              for (M in this._colors3)\n                N.setColor3(M, this._colors3[M]);\n              for (M in this._colors3Arrays)\n                N.setArray3(M, this._colors3Arrays[M]);\n              for (M in this._colors4) {\n                var U = this._colors4[M];\n                N.setFloat4(M, U.r, U.g, U.b, U.a);\n              }\n              for (M in this._colors4Arrays)\n                N.setArray4(M, this._colors4Arrays[M]);\n              for (M in this._vectors2)\n                N.setVector2(M, this._vectors2[M]);\n              for (M in this._vectors3)\n                N.setVector3(M, this._vectors3[M]);\n              for (M in this._vectors4)\n                N.setVector4(M, this._vectors4[M]);\n              for (M in this._matrices)\n                N.setMatrix(M, this._matrices[M]);\n              for (M in this._matrixArrays)\n                N.setMatrices(M, this._matrixArrays[M]);\n              for (M in this._matrices3x3)\n                N.setMatrix3x3(M, this._matrices3x3[M]);\n              for (M in this._matrices2x2)\n                N.setMatrix2x2(M, this._matrices2x2[M]);\n              for (M in this._vectors2Arrays)\n                N.setArray2(M, this._vectors2Arrays[M]);\n              for (M in this._vectors3Arrays)\n                N.setArray3(M, this._vectors3Arrays[M]);\n              for (M in this._vectors4Arrays)\n                N.setArray4(M, this._vectors4Arrays[M]);\n            }\n            var X = this._effect;\n            this._effect = N, this._afterBind(D), this._effect = X;\n          }, v.prototype._afterBind = function(b) {\n            h.prototype._afterBind.call(this, b), this.getScene()._cachedEffect = this._effect;\n          }, v.prototype.getActiveTextures = function() {\n            var b = h.prototype.getActiveTextures.call(this);\n            for (var D in this._textures)\n              b.push(this._textures[D]);\n            for (var D in this._textureArrays)\n              for (var w = this._textureArrays[D], N = 0; N < w.length; N++)\n                b.push(w[N]);\n            return b;\n          }, v.prototype.hasTexture = function(b) {\n            if (h.prototype.hasTexture.call(this, b))\n              return !0;\n            for (var D in this._textures)\n              if (this._textures[D] === b)\n                return !0;\n            for (var D in this._textureArrays)\n              for (var w = this._textureArrays[D], N = 0; N < w.length; N++)\n                if (w[N] === b)\n                  return !0;\n            return !1;\n          }, v.prototype.clone = function(b) {\n            var D = this, w = _.a.Clone(function() {\n              return new v(b, D.getScene(), D._shaderPath, D._options);\n            }, this);\n            for (var N in w.name = b, w.id = b, typeof w._shaderPath == \"object\" && (w._shaderPath = Object(V.a)({}, w._shaderPath)), this._options = Object(V.a)({}, this._options), Object.keys(this._options).forEach(function(M) {\n              var U = D._options[M];\n              Array.isArray(U) && (D._options[M] = U.slice(0));\n            }), this._textures)\n              w.setTexture(N, this._textures[N]);\n            for (var N in this._floats)\n              w.setFloat(N, this._floats[N]);\n            for (var N in this._floatsArrays)\n              w.setFloats(N, this._floatsArrays[N]);\n            for (var N in this._colors3)\n              w.setColor3(N, this._colors3[N]);\n            for (var N in this._colors4)\n              w.setColor4(N, this._colors4[N]);\n            for (var N in this._vectors2)\n              w.setVector2(N, this._vectors2[N]);\n            for (var N in this._vectors3)\n              w.setVector3(N, this._vectors3[N]);\n            for (var N in this._vectors4)\n              w.setVector4(N, this._vectors4[N]);\n            for (var N in this._matrices)\n              w.setMatrix(N, this._matrices[N]);\n            for (var N in this._matrices3x3)\n              w.setMatrix3x3(N, this._matrices3x3[N]);\n            for (var N in this._matrices2x2)\n              w.setMatrix2x2(N, this._matrices2x2[N]);\n            return w;\n          }, v.prototype.dispose = function(b, D, w) {\n            if (D) {\n              var N;\n              for (N in this._textures)\n                this._textures[N].dispose();\n              for (N in this._textureArrays)\n                for (var M = this._textureArrays[N], U = 0; U < M.length; U++)\n                  M[U].dispose();\n            }\n            this._textures = {}, h.prototype.dispose.call(this, b, D, w);\n          }, v.prototype.serialize = function() {\n            var b, D = _.a.Serialize(this);\n            for (b in D.customType = \"BABYLON.ShaderMaterial\", D.options = this._options, D.shaderPath = this._shaderPath, D.textures = {}, this._textures)\n              D.textures[b] = this._textures[b].serialize();\n            for (b in D.textureArrays = {}, this._textureArrays) {\n              D.textureArrays[b] = [];\n              for (var w = this._textureArrays[b], N = 0; N < w.length; N++)\n                D.textureArrays[b].push(w[N].serialize());\n            }\n            for (b in D.floats = {}, this._floats)\n              D.floats[b] = this._floats[b];\n            for (b in D.FloatArrays = {}, this._floatsArrays)\n              D.FloatArrays[b] = this._floatsArrays[b];\n            for (b in D.colors3 = {}, this._colors3)\n              D.colors3[b] = this._colors3[b].asArray();\n            for (b in D.colors3Arrays = {}, this._colors3Arrays)\n              D.colors3Arrays[b] = this._colors3Arrays[b];\n            for (b in D.colors4 = {}, this._colors4)\n              D.colors4[b] = this._colors4[b].asArray();\n            for (b in D.colors4Arrays = {}, this._colors4Arrays)\n              D.colors4Arrays[b] = this._colors4Arrays[b];\n            for (b in D.vectors2 = {}, this._vectors2)\n              D.vectors2[b] = this._vectors2[b].asArray();\n            for (b in D.vectors3 = {}, this._vectors3)\n              D.vectors3[b] = this._vectors3[b].asArray();\n            for (b in D.vectors4 = {}, this._vectors4)\n              D.vectors4[b] = this._vectors4[b].asArray();\n            for (b in D.matrices = {}, this._matrices)\n              D.matrices[b] = this._matrices[b].asArray();\n            for (b in D.matrixArray = {}, this._matrixArrays)\n              D.matrixArray[b] = this._matrixArrays[b];\n            for (b in D.matrices3x3 = {}, this._matrices3x3)\n              D.matrices3x3[b] = this._matrices3x3[b];\n            for (b in D.matrices2x2 = {}, this._matrices2x2)\n              D.matrices2x2[b] = this._matrices2x2[b];\n            for (b in D.vectors2Arrays = {}, this._vectors2Arrays)\n              D.vectors2Arrays[b] = this._vectors2Arrays[b];\n            for (b in D.vectors3Arrays = {}, this._vectors3Arrays)\n              D.vectors3Arrays[b] = this._vectors3Arrays[b];\n            for (b in D.vectors4Arrays = {}, this._vectors4Arrays)\n              D.vectors4Arrays[b] = this._vectors4Arrays[b];\n            return D;\n          }, v.Parse = function(b, D, w) {\n            var N, M = _.a.Parse(function() {\n              return new v(b.name, D, b.shaderPath, b.options);\n            }, b, D, w);\n            for (N in b.textures)\n              M.setTexture(N, I.a.Parse(b.textures[N], D, w));\n            for (N in b.textureArrays) {\n              for (var U = b.textureArrays[N], X = new Array(), j = 0; j < U.length; j++)\n                X.push(I.a.Parse(U[j], D, w));\n              M.setTextureArray(N, X);\n            }\n            for (N in b.floats)\n              M.setFloat(N, b.floats[N]);\n            for (N in b.floatsArrays)\n              M.setFloats(N, b.floatsArrays[N]);\n            for (N in b.colors3)\n              M.setColor3(N, c.a.FromArray(b.colors3[N]));\n            for (N in b.colors3Arrays) {\n              var ne = b.colors3Arrays[N].reduce(function(te, de, pe) {\n                return pe % 3 == 0 ? te.push([de]) : te[te.length - 1].push(de), te;\n              }, []).map(function(te) {\n                return c.a.FromArray(te);\n              });\n              M.setColor3Array(N, ne);\n            }\n            for (N in b.colors4)\n              M.setColor4(N, c.b.FromArray(b.colors4[N]));\n            for (N in b.colors4Arrays)\n              ne = b.colors4Arrays[N].reduce(function(te, de, pe) {\n                return pe % 4 == 0 ? te.push([de]) : te[te.length - 1].push(de), te;\n              }, []).map(function(te) {\n                return c.b.FromArray(te);\n              }), M.setColor4Array(N, ne);\n            for (N in b.vectors2)\n              M.setVector2(N, C.d.FromArray(b.vectors2[N]));\n            for (N in b.vectors3)\n              M.setVector3(N, C.e.FromArray(b.vectors3[N]));\n            for (N in b.vectors4)\n              M.setVector4(N, C.f.FromArray(b.vectors4[N]));\n            for (N in b.matrices)\n              M.setMatrix(N, C.a.FromArray(b.matrices[N]));\n            for (N in b.matrixArray)\n              M._matrixArrays[N] = new Float32Array(b.matrixArray[N]);\n            for (N in b.matrices3x3)\n              M.setMatrix3x3(N, b.matrices3x3[N]);\n            for (N in b.matrices2x2)\n              M.setMatrix2x2(N, b.matrices2x2[N]);\n            for (N in b.vectors2Arrays)\n              M.setArray2(N, b.vectors2Arrays[N]);\n            for (N in b.vectors3Arrays)\n              M.setArray3(N, b.vectors3Arrays[N]);\n            for (N in b.vectors4Arrays)\n              M.setArray4(N, b.vectors4Arrays[N]);\n            return M;\n          }, v.ParseFromFileAsync = function(b, D, w, N) {\n            var M = this;\n            return N === void 0 && (N = \"\"), new Promise(function(U, X) {\n              var j = new S.a();\n              j.addEventListener(\"readystatechange\", function() {\n                if (j.readyState == 4)\n                  if (j.status == 200) {\n                    var ne = JSON.parse(j.responseText), te = M.Parse(ne, w || E.a.LastCreatedScene, N);\n                    b && (te.name = b), U(te);\n                  } else\n                    X(\"Unable to load the ShaderMaterial\");\n              }), j.open(\"GET\", D), j.send();\n            });\n          }, v.CreateFromSnippetAsync = function(b, D, w) {\n            var N = this;\n            return w === void 0 && (w = \"\"), new Promise(function(M, U) {\n              var X = new S.a();\n              X.addEventListener(\"readystatechange\", function() {\n                if (X.readyState == 4)\n                  if (X.status == 200) {\n                    var j = JSON.parse(JSON.parse(X.responseText).jsonPayload), ne = JSON.parse(j.shaderMaterial), te = N.Parse(ne, D || E.a.LastCreatedScene, w);\n                    te.snippetId = b, M(te);\n                  } else\n                    U(\"Unable to load the snippet \" + b);\n              }), X.open(\"GET\", N.SnippetUrl + \"/\" + b.replace(/#/g, \"/\")), X.send();\n            });\n          }, v.SnippetUrl = \"https://snippet.babylonjs.com\", v;\n        }(x.a);\n        m.a.RegisteredTypes[\"BABYLON.ShaderMaterial\"] = l;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.SetMatrixPrecision = function(C) {\n            if (_.MatrixTrackPrecisionChange = !1, C && !_.MatrixUse64Bits && _.MatrixTrackedMatrices)\n              for (var u = 0; u < _.MatrixTrackedMatrices.length; ++u) {\n                var I = _.MatrixTrackedMatrices[u], O = I._m;\n                I._m = new Array(16);\n                for (var x = 0; x < 16; ++x)\n                  I._m[x] = O[x];\n              }\n            _.MatrixUse64Bits = C, _.MatrixCurrentType = _.MatrixUse64Bits ? Array : Float32Array, _.MatrixTrackedMatrices = null;\n          }, _.MatrixUse64Bits = !1, _.MatrixTrackPrecisionChange = !0, _.MatrixCurrentType = Float32Array, _.MatrixTrackedMatrices = [], _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return E;\n        });\n        var V = f(1), _ = f(6), C = f(0), u = f(46), I = f(7), O = f(53), x = f(65), m = f(51), c = f(36), T = f(30), S = f(9), E = function(g) {\n          function l(h, v, b, D, w) {\n            var N;\n            v === void 0 && (v = S.a.Gray()), b === void 0 && (b = c.a.DefaultUtilityLayer), D === void 0 && (D = null), w === void 0 && (w = 1);\n            var M = g.call(this, b) || this;\n            M._pointerObserver = null, M.snapDistance = 0, M.onSnapObservable = new _.c(), M._isEnabled = !0, M._parent = null, M._dragging = !1, M._parent = D, M._coloredMaterial = new T.a(\"\", b.utilityLayerScene), M._coloredMaterial.diffuseColor = v, M._coloredMaterial.specularColor = v.subtract(new S.a(0.1, 0.1, 0.1)), M._hoverMaterial = new T.a(\"\", b.utilityLayerScene), M._hoverMaterial.diffuseColor = S.a.Yellow(), M._disableMaterial = new T.a(\"\", b.utilityLayerScene), M._disableMaterial.diffuseColor = S.a.Gray(), M._disableMaterial.alpha = 0.4;\n            var U = l._CreateArrow(b.utilityLayerScene, M._coloredMaterial, w), X = l._CreateArrow(b.utilityLayerScene, M._coloredMaterial, w + 4, !0);\n            M._gizmoMesh = new I.a(\"\", b.utilityLayerScene), M._gizmoMesh.addChild(U), M._gizmoMesh.addChild(X), M._gizmoMesh.lookAt(M._rootMesh.position.add(h)), M._gizmoMesh.scaling.scaleInPlace(1 / 3), M._gizmoMesh.parent = M._rootMesh;\n            var j = 0, ne = new C.e(), te = { snapDistance: 0 };\n            M.dragBehavior = new x.a({ dragAxis: h }), M.dragBehavior.moveAttached = !1, M._rootMesh.addBehavior(M.dragBehavior), M.dragBehavior.onDragObservable.add(function(ae) {\n              if (M.attachedNode) {\n                if (M.snapDistance == 0)\n                  M.attachedNode.position && M.attachedNode.position.addInPlaceFromFloats(ae.delta.x, ae.delta.y, ae.delta.z), M.attachedNode.getWorldMatrix().addTranslationFromFloats(ae.delta.x, ae.delta.y, ae.delta.z), M.attachedNode.updateCache();\n                else if (j += ae.dragDistance, Math.abs(j) > M.snapDistance) {\n                  var ee = Math.floor(Math.abs(j) / M.snapDistance);\n                  j %= M.snapDistance, ae.delta.normalizeToRef(ne), ne.scaleInPlace(M.snapDistance * ee), M.attachedNode.getWorldMatrix().addTranslationFromFloats(ne.x, ne.y, ne.z), M.attachedNode.updateCache(), te.snapDistance = M.snapDistance * ee, M.onSnapObservable.notifyObservers(te);\n                }\n                M._matrixChanged();\n              }\n            }), M.dragBehavior.onDragStartObservable.add(function() {\n              M._dragging = !0;\n            }), M.dragBehavior.onDragEndObservable.add(function() {\n              M._dragging = !1;\n            });\n            var de = b._getSharedGizmoLight();\n            de.includedOnlyMeshes = de.includedOnlyMeshes.concat(M._rootMesh.getChildMeshes(!1));\n            var pe = { gizmoMeshes: U.getChildMeshes(), colliderMeshes: X.getChildMeshes(), material: M._coloredMaterial, hoverMaterial: M._hoverMaterial, disableMaterial: M._disableMaterial, active: !1 };\n            return (N = M._parent) === null || N === void 0 || N.addToAxisCache(X, pe), M._pointerObserver = b.utilityLayerScene.onPointerObservable.add(function(ae) {\n              var ee;\n              if (!M._customMeshSet && (M._isHovered = pe.colliderMeshes.indexOf((ee = ae == null ? void 0 : ae.pickInfo) === null || ee === void 0 ? void 0 : ee.pickedMesh) != -1, !M._parent)) {\n                var K = M._isHovered || M._dragging ? M._hoverMaterial : M._coloredMaterial;\n                pe.gizmoMeshes.forEach(function($) {\n                  $.material = K, $.color && ($.color = K.diffuseColor);\n                });\n              }\n            }), M;\n          }\n          return Object(V.d)(l, g), l._CreateArrow = function(h, v, b, D) {\n            b === void 0 && (b = 1), D === void 0 && (D = !1);\n            var w = new u.a(\"arrow\", h), N = O.a.CreateCylinder(\"cylinder\", { diameterTop: 0, height: 0.075, diameterBottom: 0.0375 * (1 + (b - 1) / 4), tessellation: 96 }, h), M = O.a.CreateCylinder(\"cylinder\", { diameterTop: 5e-3 * b, height: 0.275, diameterBottom: 5e-3 * b, tessellation: 96 }, h);\n            return N.parent = w, N.material = v, N.rotation.x = Math.PI / 2, N.position.z += 0.3, M.parent = w, M.material = v, M.position.z += 0.1375, M.rotation.x = Math.PI / 2, D && (M.visibility = 0, N.visibility = 0), w;\n          }, l._CreateArrowInstance = function(h, v) {\n            for (var b = new u.a(\"arrow\", h), D = 0, w = v.getChildMeshes(); D < w.length; D++) {\n              var N = w[D];\n              N.createInstance(N.name).parent = b;\n            }\n            return b;\n          }, l.prototype._attachedNodeChanged = function(h) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!h);\n          }, Object.defineProperty(l.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(h) {\n            this._isEnabled = h, h ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);\n          }, enumerable: !1, configurable: !0 }), l.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(h) {\n              h && h.dispose();\n            }), g.prototype.dispose.call(this);\n          }, l;\n        }(m.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            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;\n          }\n          return Object.defineProperty(_.prototype, \"isDirty\", { get: function() {\n            return this._isDirty;\n          }, enumerable: !1, configurable: !0 }), _.prototype.markAsProcessed = function() {\n            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;\n          }, _.prototype.markAsUnprocessed = function() {\n            this._isDirty = !0;\n          }, _.prototype.markAllAsDirty = function() {\n            this._areTexturesDirty = !0, this._areAttributesDirty = !0, this._areLightsDirty = !0, this._areFresnelDirty = !0, this._areMiscDirty = !0, this._areImageProcessingDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsImageProcessingDirty = function() {\n            this._areImageProcessingDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsLightDirty = function(C) {\n            C === void 0 && (C = !1), this._areLightsDirty = !0, this._areLightsDisposed = this._areLightsDisposed || C, this._isDirty = !0;\n          }, _.prototype.markAsAttributesDirty = function() {\n            this._areAttributesDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsTexturesDirty = function() {\n            this._areTexturesDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsFresnelDirty = function() {\n            this._areFresnelDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsMiscDirty = function() {\n            this._areMiscDirty = !0, this._isDirty = !0;\n          }, _.prototype.markAsPrePassDirty = function() {\n            this._arePrePassDirty = !0, this._isDirty = !0;\n          }, _.prototype.rebuild = function() {\n            this._keys = [];\n            for (var C = 0, u = Object.keys(this); C < u.length; C++) {\n              var I = u[C];\n              I[0] !== \"_\" && this._keys.push(I);\n            }\n          }, _.prototype.isEqual = function(C) {\n            if (this._keys.length !== C._keys.length)\n              return !1;\n            for (var u = 0; u < this._keys.length; u++) {\n              var I = this._keys[u];\n              if (this[I] !== C[I])\n                return !1;\n            }\n            return !0;\n          }, _.prototype.cloneTo = function(C) {\n            this._keys.length !== C._keys.length && (C._keys = this._keys.slice(0));\n            for (var u = 0; u < this._keys.length; u++) {\n              var I = this._keys[u];\n              C[I] = this[I];\n            }\n          }, _.prototype.reset = function() {\n            for (var C = 0; C < this._keys.length; C++) {\n              var u = this._keys[C];\n              switch (typeof this[u]) {\n                case \"number\":\n                  this[u] = 0;\n                  break;\n                case \"string\":\n                  this[u] = \"\";\n                  break;\n                default:\n                  this[u] = !1;\n              }\n            }\n          }, _.prototype.toString = function() {\n            for (var C = \"\", u = 0; u < this._keys.length; u++) {\n              var I = this._keys[u], O = this[I];\n              switch (typeof O) {\n                case \"number\":\n                case \"string\":\n                  C += \"#define \" + I + \" \" + O + `\n`;\n                  break;\n                default:\n                  O && (C += \"#define \" + I + `\n`);\n              }\n            }\n            return C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _(C, u) {\n            this.width = C, this.height = u;\n          }\n          return _.prototype.toString = function() {\n            return \"{W: \" + this.width + \", H: \" + this.height + \"}\";\n          }, _.prototype.getClassName = function() {\n            return \"Size\";\n          }, _.prototype.getHashCode = function() {\n            var C = 0 | this.width;\n            return C = 397 * C ^ (0 | this.height);\n          }, _.prototype.copyFrom = function(C) {\n            this.width = C.width, this.height = C.height;\n          }, _.prototype.copyFromFloats = function(C, u) {\n            return this.width = C, this.height = u, this;\n          }, _.prototype.set = function(C, u) {\n            return this.copyFromFloats(C, u);\n          }, _.prototype.multiplyByFloats = function(C, u) {\n            return new _(this.width * C, this.height * u);\n          }, _.prototype.clone = function() {\n            return new _(this.width, this.height);\n          }, _.prototype.equals = function(C) {\n            return !!C && this.width === C.width && this.height === C.height;\n          }, Object.defineProperty(_.prototype, \"surface\", { get: function() {\n            return this.width * this.height;\n          }, enumerable: !1, configurable: !0 }), _.Zero = function() {\n            return new _(0, 0);\n          }, _.prototype.add = function(C) {\n            return new _(this.width + C.width, this.height + C.height);\n          }, _.prototype.subtract = function(C) {\n            return new _(this.width - C.width, this.height - C.height);\n          }, _.Lerp = function(C, u, I) {\n            return new _(C.width + (u.width - C.width) * I, C.height + (u.height - C.height) * I);\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        var V = \"bonesDeclaration\", _ = `#if NUM_BONE_INFLUENCERS>0\n#ifdef BONETEXTURE\nuniform sampler2D boneSampler;\nuniform float boneTextureWidth;\n#else\nuniform mat4 mBones[BonesPerMesh];\n#ifdef BONES_VELOCITY_ENABLED\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#ifdef BONETEXTURE\n#define inline\nmat4 readMatrixFromRawSampler(sampler2D smp,float index)\n{\nfloat offset=index*4.0;\nfloat dx=1.0/boneTextureWidth;\nvec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));\nvec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));\nvec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));\nvec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));\nreturn mat4(m0,m1,m2,m3);\n}\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"instancesDeclaration\", _ = `#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#ifdef THIN_INSTANCES\nuniform mat4 world;\n#endif\n#else\nuniform mat4 world;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"instancesVertex\", _ = `#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#ifdef THIN_INSTANCES\nfinalWorld=world*finalWorld;\n#endif\n#else\nmat4 finalWorld=world;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];\n#endif\n#else\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\n#endif\nfinalWorld=finalWorld*influence;\n#endif`;\n        f(5).a.IncludesShadersStore.bonesVertex = V;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(0), _ = f(7), C = f(4), u = f(16), I = f(43);\n        u.a.CreateRibbon = function(x) {\n          var m = x.pathArray, c = x.closeArray || !1, T = x.closePath || !1, S = x.invertUV || !1, E = Math.floor(m[0].length / 2), g = x.offset || E;\n          g = g > E ? E : Math.floor(g);\n          var l, h, v, b, D = x.sideOrientation === 0 ? 0 : x.sideOrientation || u.a.DEFAULTSIDE, w = x.uvs, N = x.colors, M = [], U = [], X = [], j = [], ne = [], te = [], de = [], pe = [], ae = [], ee = [];\n          if (m.length < 2) {\n            var K = [], $ = [];\n            for (v = 0; v < m[0].length - g; v++)\n              K.push(m[0][v]), $.push(m[0][v + g]);\n            m = [K, $];\n          }\n          var L, G, Q, oe, re, Y = 0, k = T ? 1 : 0;\n          for (l = m[0].length, h = 0; h < m.length; h++) {\n            for (de[h] = 0, ne[h] = [0], l = l < (G = (L = m[h]).length) ? l : G, b = 0; b < G; )\n              M.push(L[b].x, L[b].y, L[b].z), b > 0 && (Q = L[b].subtract(L[b - 1]).length() + de[h], ne[h].push(Q), de[h] = Q), b++;\n            T && (b--, M.push(L[0].x, L[0].y, L[0].z), Q = L[b].subtract(L[0]).length() + de[h], ne[h].push(Q), de[h] = Q), ae[h] = G + k, ee[h] = Y, Y += G + k;\n          }\n          var H, Z, W = null, q = null;\n          for (v = 0; v < l + k; v++) {\n            for (pe[v] = 0, te[v] = [0], h = 0; h < m.length - 1; h++)\n              oe = m[h], re = m[h + 1], v === l ? (W = oe[0], q = re[0]) : (W = oe[v], q = re[v]), Q = q.subtract(W).length() + pe[v], te[v].push(Q), pe[v] = Q;\n            c && q && W && (oe = m[h], re = m[0], v === l && (q = re[0]), Q = q.subtract(W).length() + pe[v], pe[v] = Q);\n          }\n          if (w)\n            for (h = 0; h < w.length; h++)\n              j.push(w[h].x, w[h].y);\n          else\n            for (h = 0; h < m.length; h++)\n              for (v = 0; v < l + k; v++)\n                H = de[h] != 0 ? ne[h][v] / de[h] : 0, Z = pe[v] != 0 ? te[v][h] / pe[v] : 0, S ? j.push(Z, H) : j.push(H, Z);\n          for (var he = 0, ge = ae[h = 0] - 1, me = ae[h + 1] - 1, _e = ge < me ? ge : me, ye = ee[1] - ee[0], Pe = c ? ae.length : ae.length - 1; he <= _e && h < Pe; )\n            U.push(he, he + ye, he + 1), U.push(he + ye + 1, he + 1, he + ye), (he += 1) === _e && (++h === ae.length - 1 ? (ye = ee[0] - ee[h], ge = ae[h] - 1, me = ae[0] - 1) : (ye = ee[h + 1] - ee[h], ge = ae[h] - 1, me = ae[h + 1] - 1), he = ee[h], _e = ge < me ? ge + he : me + he);\n          if (u.a.ComputeNormals(M, U, X), T) {\n            var be = 0, Fe = 0;\n            for (h = 0; h < m.length; h++)\n              be = 3 * ee[h], Fe = h + 1 < m.length ? 3 * (ee[h + 1] - 1) : X.length - 3, X[be] = 0.5 * (X[be] + X[Fe]), X[be + 1] = 0.5 * (X[be + 1] + X[Fe + 1]), X[be + 2] = 0.5 * (X[be + 2] + X[Fe + 2]), X[Fe] = X[be], X[Fe + 1] = X[be + 1], X[Fe + 2] = X[be + 2];\n          }\n          u.a._ComputeSides(D, M, U, X, j, x.frontUVs, x.backUVs);\n          var ke = null;\n          if (N) {\n            ke = new Float32Array(4 * N.length);\n            for (var We = 0; We < N.length; We++)\n              ke[4 * We] = N[We].r, ke[4 * We + 1] = N[We].g, ke[4 * We + 2] = N[We].b, ke[4 * We + 3] = N[We].a;\n          }\n          var je = new u.a(), He = new Float32Array(M), Qe = new Float32Array(X), Ge = new Float32Array(j);\n          return je.indices = U, je.positions = He, je.normals = Qe, je.uvs = Ge, ke && je.set(ke, C.b.ColorKind), T && (je._idx = ee), je;\n        }, _.a.CreateRibbon = function(x, m, c, T, S, E, g, l, h) {\n          return c === void 0 && (c = !1), g === void 0 && (g = !1), O.CreateRibbon(x, { pathArray: m, closeArray: c, closePath: T, offset: S, updatable: g, sideOrientation: l, instance: h }, E);\n        };\n        var O = function() {\n          function x() {\n          }\n          return x.CreateRibbon = function(m, c, T) {\n            T === void 0 && (T = null);\n            var S = c.pathArray, E = c.closeArray, g = c.closePath, l = _.a._GetDefaultSideOrientation(c.sideOrientation), h = c.instance, v = c.updatable;\n            if (h) {\n              var b = V.c.Vector3[0].setAll(Number.MAX_VALUE), D = V.c.Vector3[1].setAll(-Number.MAX_VALUE), w = h.getVerticesData(C.b.PositionKind);\n              if (function(G) {\n                for (var Q = S[0].length, oe = h, re = 0, Y = oe._originalBuilderSideOrientation === _.a.DOUBLESIDE ? 2 : 1, k = 1; k <= Y; ++k)\n                  for (var H = 0; H < S.length; ++H) {\n                    var Z = S[H], W = Z.length;\n                    Q = Q < W ? Q : W;\n                    for (var q = 0; q < Q; ++q) {\n                      var he = Z[q];\n                      G[re] = he.x, G[re + 1] = he.y, G[re + 2] = he.z, b.minimizeInPlaceFromFloats(he.x, he.y, he.z), D.maximizeInPlaceFromFloats(he.x, he.y, he.z), re += 3;\n                    }\n                    oe._creationDataStorage && oe._creationDataStorage.closePath && (he = Z[0], G[re] = he.x, G[re + 1] = he.y, G[re + 2] = he.z, re += 3);\n                  }\n              }(w), h._boundingInfo ? h._boundingInfo.reConstruct(b, D, h._worldMatrix) : h._boundingInfo = new I.a(b, D, h._worldMatrix), h.updateVerticesData(C.b.PositionKind, w, !1, !1), c.colors) {\n                for (var N = h.getVerticesData(C.b.ColorKind), M = 0, U = 0; M < c.colors.length; M++, U += 4) {\n                  var X = c.colors[M];\n                  N[U] = X.r, N[U + 1] = X.g, N[U + 2] = X.b, N[U + 3] = X.a;\n                }\n                h.updateVerticesData(C.b.ColorKind, N, !1, !1);\n              }\n              if (c.uvs) {\n                for (var j = h.getVerticesData(C.b.UVKind), ne = 0; ne < c.uvs.length; ne++)\n                  j[2 * ne] = c.uvs[ne].x, j[2 * ne + 1] = c.uvs[ne].y;\n                h.updateVerticesData(C.b.UVKind, j, !1, !1);\n              }\n              if (!h.areNormalsFrozen || h.isFacetDataEnabled) {\n                var te = h.getIndices(), de = h.getVerticesData(C.b.NormalKind), pe = h.isFacetDataEnabled ? h.getFacetDataParameters() : null;\n                if (u.a.ComputeNormals(w, te, de, pe), h._creationDataStorage && h._creationDataStorage.closePath)\n                  for (var ae = 0, ee = 0, K = 0; K < S.length; K++)\n                    ae = 3 * h._creationDataStorage.idx[K], ee = K + 1 < S.length ? 3 * (h._creationDataStorage.idx[K + 1] - 1) : de.length - 3, de[ae] = 0.5 * (de[ae] + de[ee]), de[ae + 1] = 0.5 * (de[ae + 1] + de[ee + 1]), de[ae + 2] = 0.5 * (de[ae + 2] + de[ee + 2]), de[ee] = de[ae], de[ee + 1] = de[ae + 1], de[ee + 2] = de[ae + 2];\n                h.areNormalsFrozen || h.updateVerticesData(C.b.NormalKind, de, !1, !1);\n              }\n              return h;\n            }\n            var $ = new _.a(m, T);\n            $._originalBuilderSideOrientation = l, $._creationDataStorage = new _.b();\n            var L = u.a.CreateRibbon(c);\n            return g && ($._creationDataStorage.idx = L._idx), $._creationDataStorage.closePath = g, $._creationDataStorage.closeArray = E, L.applyToMesh($, v), $;\n          }, x;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.FilesToLoad = {}, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(7), _ = f(16);\n        _.a.CreatePlane = function(u) {\n          var I = [], O = [], x = [], m = [], c = u.width || u.size || 1, T = u.height || u.size || 1, S = u.sideOrientation === 0 ? 0 : u.sideOrientation || _.a.DEFAULTSIDE, E = c / 2, g = T / 2;\n          O.push(-E, -g, 0), x.push(0, 0, -1), m.push(0, 0), O.push(E, -g, 0), x.push(0, 0, -1), m.push(1, 0), O.push(E, g, 0), x.push(0, 0, -1), m.push(1, 1), O.push(-E, g, 0), x.push(0, 0, -1), m.push(0, 1), I.push(0), I.push(1), I.push(2), I.push(0), I.push(2), I.push(3), _.a._ComputeSides(S, O, I, x, m, u.frontUVs, u.backUVs);\n          var l = new _.a();\n          return l.indices = I, l.positions = O, l.normals = x, l.uvs = m, l;\n        }, V.a.CreatePlane = function(u, I, O, x, m) {\n          var c = { size: I, width: I, height: I, sideOrientation: m, updatable: x };\n          return C.CreatePlane(u, c, O);\n        };\n        var C = function() {\n          function u() {\n          }\n          return u.CreatePlane = function(I, O, x) {\n            x === void 0 && (x = null);\n            var m = new V.a(I, x);\n            return O.sideOrientation = V.a._GetDefaultSideOrientation(O.sideOrientation), m._originalBuilderSideOrientation = O.sideOrientation, _.a.CreatePlane(O).applyToMesh(m, O.updatable), O.sourcePlane && (m.translate(O.sourcePlane.normal, -O.sourcePlane.d), m.setDirection(O.sourcePlane.normal.scale(-1))), m;\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(8), _ = (f(153), function() {\n          function C(u, I, O) {\n            this._alreadyBound = !1, this._valueCache = {}, this._engine = u, this._noUBO = !u.supportsUniformBuffers, this._dynamic = O, this._data = I || [], this._uniformLocations = {}, this._uniformSizes = {}, this._uniformLocationPointer = 0, this._needSync = !1, this._noUBO ? (this.updateMatrix3x3 = this._updateMatrix3x3ForEffect, this.updateMatrix2x2 = this._updateMatrix2x2ForEffect, this.updateFloat = this._updateFloatForEffect, this.updateFloat2 = this._updateFloat2ForEffect, this.updateFloat3 = this._updateFloat3ForEffect, this.updateFloat4 = this._updateFloat4ForEffect, this.updateMatrix = this._updateMatrixForEffect, this.updateVector3 = this._updateVector3ForEffect, this.updateVector4 = this._updateVector4ForEffect, this.updateColor3 = this._updateColor3ForEffect, this.updateColor4 = this._updateColor4ForEffect) : (this._engine._uniformBuffers.push(this), this.updateMatrix3x3 = this._updateMatrix3x3ForUniform, this.updateMatrix2x2 = this._updateMatrix2x2ForUniform, this.updateFloat = this._updateFloatForUniform, this.updateFloat2 = this._updateFloat2ForUniform, this.updateFloat3 = this._updateFloat3ForUniform, this.updateFloat4 = this._updateFloat4ForUniform, this.updateMatrix = this._updateMatrixForUniform, this.updateVector3 = this._updateVector3ForUniform, this.updateVector4 = this._updateVector4ForUniform, this.updateColor3 = this._updateColor3ForUniform, this.updateColor4 = this._updateColor4ForUniform);\n          }\n          return Object.defineProperty(C.prototype, \"useUbo\", { get: function() {\n            return !this._noUBO;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"isSync\", { get: function() {\n            return !this._needSync;\n          }, enumerable: !1, configurable: !0 }), C.prototype.isDynamic = function() {\n            return this._dynamic !== void 0;\n          }, C.prototype.getData = function() {\n            return this._bufferData;\n          }, C.prototype.getBuffer = function() {\n            return this._buffer;\n          }, C.prototype._fillAlignment = function(u) {\n            var I;\n            if (I = u <= 2 ? u : 4, this._uniformLocationPointer % I != 0) {\n              var O = this._uniformLocationPointer;\n              this._uniformLocationPointer += I - this._uniformLocationPointer % I;\n              for (var x = this._uniformLocationPointer - O, m = 0; m < x; m++)\n                this._data.push(0);\n            }\n          }, C.prototype.addUniform = function(u, I) {\n            if (!this._noUBO && this._uniformLocations[u] === void 0) {\n              var O;\n              if (I instanceof Array)\n                I = (O = I).length;\n              else {\n                I = I, O = [];\n                for (var x = 0; x < I; x++)\n                  O.push(0);\n              }\n              for (this._fillAlignment(I), this._uniformSizes[u] = I, this._uniformLocations[u] = this._uniformLocationPointer, this._uniformLocationPointer += I, x = 0; x < I; x++)\n                this._data.push(O[x]);\n              this._needSync = !0;\n            }\n          }, C.prototype.addMatrix = function(u, I) {\n            this.addUniform(u, Array.prototype.slice.call(I.toArray()));\n          }, C.prototype.addFloat2 = function(u, I, O) {\n            var x = [I, O];\n            this.addUniform(u, x);\n          }, C.prototype.addFloat3 = function(u, I, O, x) {\n            var m = [I, O, x];\n            this.addUniform(u, m);\n          }, C.prototype.addColor3 = function(u, I) {\n            var O = new Array();\n            I.toArray(O), this.addUniform(u, O);\n          }, C.prototype.addColor4 = function(u, I, O) {\n            var x = new Array();\n            I.toArray(x), x.push(O), this.addUniform(u, x);\n          }, C.prototype.addVector3 = function(u, I) {\n            var O = new Array();\n            I.toArray(O), this.addUniform(u, O);\n          }, C.prototype.addMatrix3x3 = function(u) {\n            this.addUniform(u, 12);\n          }, C.prototype.addMatrix2x2 = function(u) {\n            this.addUniform(u, 8);\n          }, C.prototype.create = function() {\n            this._noUBO || this._buffer || (this._fillAlignment(4), this._bufferData = new Float32Array(this._data), this._rebuild(), this._needSync = !0);\n          }, C.prototype._rebuild = function() {\n            !this._noUBO && this._bufferData && (this._dynamic ? this._buffer = this._engine.createDynamicUniformBuffer(this._bufferData) : this._buffer = this._engine.createUniformBuffer(this._bufferData));\n          }, C.prototype.update = function() {\n            this._buffer ? (this._dynamic || this._needSync) && (this._engine.updateUniformBuffer(this._buffer, this._bufferData), this._needSync = !1) : this.create();\n          }, C.prototype.updateUniform = function(u, I, O) {\n            var x = this._uniformLocations[u];\n            if (x === void 0) {\n              if (this._buffer)\n                return void V.a.Error(\"Cannot add an uniform after UBO has been created.\");\n              this.addUniform(u, O), x = this._uniformLocations[u];\n            }\n            if (this._buffer || this.create(), this._dynamic)\n              for (c = 0; c < O; c++)\n                this._bufferData[x + c] = I[c];\n            else {\n              for (var m = !1, c = 0; c < O; c++)\n                O !== 16 && this._bufferData[x + c] === I[c] || (m = !0, this._bufferData[x + c] = I[c]);\n              this._needSync = this._needSync || m;\n            }\n          }, C.prototype._cacheMatrix = function(u, I) {\n            var O = this._valueCache[u], x = I.updateFlag;\n            return (O === void 0 || O !== x) && (this._valueCache[u] = x, !0);\n          }, C.prototype._updateMatrix3x3ForUniform = function(u, I) {\n            for (var O = 0; O < 3; O++)\n              C._tempBuffer[4 * O] = I[3 * O], C._tempBuffer[4 * O + 1] = I[3 * O + 1], C._tempBuffer[4 * O + 2] = I[3 * O + 2], C._tempBuffer[4 * O + 3] = 0;\n            this.updateUniform(u, C._tempBuffer, 12);\n          }, C.prototype._updateMatrix3x3ForEffect = function(u, I) {\n            this._currentEffect.setMatrix3x3(u, I);\n          }, C.prototype._updateMatrix2x2ForEffect = function(u, I) {\n            this._currentEffect.setMatrix2x2(u, I);\n          }, C.prototype._updateMatrix2x2ForUniform = function(u, I) {\n            for (var O = 0; O < 2; O++)\n              C._tempBuffer[4 * O] = I[2 * O], C._tempBuffer[4 * O + 1] = I[2 * O + 1], C._tempBuffer[4 * O + 2] = 0, C._tempBuffer[4 * O + 3] = 0;\n            this.updateUniform(u, C._tempBuffer, 8);\n          }, C.prototype._updateFloatForEffect = function(u, I) {\n            this._currentEffect.setFloat(u, I);\n          }, C.prototype._updateFloatForUniform = function(u, I) {\n            C._tempBuffer[0] = I, this.updateUniform(u, C._tempBuffer, 1);\n          }, C.prototype._updateFloat2ForEffect = function(u, I, O, x) {\n            x === void 0 && (x = \"\"), this._currentEffect.setFloat2(u + x, I, O);\n          }, C.prototype._updateFloat2ForUniform = function(u, I, O) {\n            C._tempBuffer[0] = I, C._tempBuffer[1] = O, this.updateUniform(u, C._tempBuffer, 2);\n          }, C.prototype._updateFloat3ForEffect = function(u, I, O, x, m) {\n            m === void 0 && (m = \"\"), this._currentEffect.setFloat3(u + m, I, O, x);\n          }, C.prototype._updateFloat3ForUniform = function(u, I, O, x) {\n            C._tempBuffer[0] = I, C._tempBuffer[1] = O, C._tempBuffer[2] = x, this.updateUniform(u, C._tempBuffer, 3);\n          }, C.prototype._updateFloat4ForEffect = function(u, I, O, x, m, c) {\n            c === void 0 && (c = \"\"), this._currentEffect.setFloat4(u + c, I, O, x, m);\n          }, C.prototype._updateFloat4ForUniform = function(u, I, O, x, m) {\n            C._tempBuffer[0] = I, C._tempBuffer[1] = O, C._tempBuffer[2] = x, C._tempBuffer[3] = m, this.updateUniform(u, C._tempBuffer, 4);\n          }, C.prototype._updateMatrixForEffect = function(u, I) {\n            this._currentEffect.setMatrix(u, I);\n          }, C.prototype._updateMatrixForUniform = function(u, I) {\n            this._cacheMatrix(u, I) && this.updateUniform(u, I.toArray(), 16);\n          }, C.prototype._updateVector3ForEffect = function(u, I) {\n            this._currentEffect.setVector3(u, I);\n          }, C.prototype._updateVector3ForUniform = function(u, I) {\n            I.toArray(C._tempBuffer), this.updateUniform(u, C._tempBuffer, 3);\n          }, C.prototype._updateVector4ForEffect = function(u, I) {\n            this._currentEffect.setVector4(u, I);\n          }, C.prototype._updateVector4ForUniform = function(u, I) {\n            I.toArray(C._tempBuffer), this.updateUniform(u, C._tempBuffer, 4);\n          }, C.prototype._updateColor3ForEffect = function(u, I, O) {\n            O === void 0 && (O = \"\"), this._currentEffect.setColor3(u + O, I);\n          }, C.prototype._updateColor3ForUniform = function(u, I) {\n            I.toArray(C._tempBuffer), this.updateUniform(u, C._tempBuffer, 3);\n          }, C.prototype._updateColor4ForEffect = function(u, I, O, x) {\n            x === void 0 && (x = \"\"), this._currentEffect.setColor4(u + x, I, O);\n          }, C.prototype._updateColor4ForUniform = function(u, I, O) {\n            I.toArray(C._tempBuffer), C._tempBuffer[3] = O, this.updateUniform(u, C._tempBuffer, 4);\n          }, C.prototype.setTexture = function(u, I) {\n            this._currentEffect.setTexture(u, I);\n          }, C.prototype.updateUniformDirectly = function(u, I) {\n            this.updateUniform(u, I, I.length), this.update();\n          }, C.prototype.bindToEffect = function(u, I) {\n            this._currentEffect = u, !this._noUBO && this._buffer && (this._alreadyBound = !0, u.bindUniformBuffer(this._buffer, I));\n          }, C.prototype.dispose = function() {\n            if (!this._noUBO) {\n              var u = this._engine._uniformBuffers, I = u.indexOf(this);\n              I !== -1 && (u[I] = u[u.length - 1], u.pop()), this._buffer && this._engine._releaseBuffer(this._buffer) && (this._buffer = null);\n            }\n          }, C._MAX_UNIFORM_SIZE = 256, C._tempBuffer = new Float32Array(C._MAX_UNIFORM_SIZE), C;\n        }());\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return x;\n        });\n        var V = f(1), _ = f(3), C = f(0), u = f(9), I = f(29), O = f(48);\n        I.a.AddNodeConstructor(\"Light_Type_3\", function(m, c) {\n          return function() {\n            return new x(m, C.e.Zero(), c);\n          };\n        });\n        var x = function(m) {\n          function c(T, S, E) {\n            var g = m.call(this, T, E) || this;\n            return g.groundColor = new u.a(0, 0, 0), g.direction = S || C.e.Up(), g;\n          }\n          return Object(V.d)(c, m), c.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"vLightGround\", 3), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, c.prototype.getClassName = function() {\n            return \"HemisphericLight\";\n          }, c.prototype.setDirectionToTarget = function(T) {\n            return this.direction = C.e.Normalize(T.subtract(C.e.Zero())), this.direction;\n          }, c.prototype.getShadowGenerator = function() {\n            return null;\n          }, c.prototype.transferToEffect = function(T, S) {\n            var E = C.e.Normalize(this.direction);\n            return this._uniformBuffer.updateFloat4(\"vLightData\", E.x, E.y, E.z, 0, S), this._uniformBuffer.updateColor3(\"vLightGround\", this.groundColor.scale(this.intensity), S), this;\n          }, c.prototype.transferToNodeMaterialEffect = function(T, S) {\n            var E = C.e.Normalize(this.direction);\n            return T.setFloat3(S, E.x, E.y, E.z), this;\n          }, c.prototype.computeWorldMatrix = function() {\n            return this._worldMatrix || (this._worldMatrix = C.a.Identity()), this._worldMatrix;\n          }, c.prototype.getTypeID = function() {\n            return O.a.LIGHTTYPEID_HEMISPHERICLIGHT;\n          }, c.prototype.prepareLightSpecificDefines = function(T, S) {\n            T[\"HEMILIGHT\" + S] = !0;\n          }, Object(V.c)([Object(_.e)()], c.prototype, \"groundColor\", void 0), Object(V.c)([Object(_.o)()], c.prototype, \"direction\", void 0), c;\n        }(O.a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(1), _ = f(0), C = function(u) {\n          function I(O, x) {\n            var m = u.call(this, O, x) || this;\n            return m._normalMatrix = new _.a(), m._storeEffectOnSubMeshes = !0, m;\n          }\n          return Object(V.d)(I, u), I.prototype.getEffect = function() {\n            return this._activeEffect;\n          }, I.prototype.isReady = function(O, x) {\n            return !!O && (!O.subMeshes || O.subMeshes.length === 0 || this.isReadyForSubMesh(O, O.subMeshes[0], x));\n          }, I.prototype._isReadyForSubMesh = function(O) {\n            var x = O._materialDefines;\n            return !(this.checkReadyOnEveryCall || !O.effect || !x || x._renderId !== this.getScene().getRenderId());\n          }, I.prototype.bindOnlyWorldMatrix = function(O) {\n            this._activeEffect.setMatrix(\"world\", O);\n          }, I.prototype.bindOnlyNormalMatrix = function(O) {\n            this._activeEffect.setMatrix(\"normalMatrix\", O);\n          }, I.prototype.bind = function(O, x) {\n            x && this.bindForSubMesh(O, x, x.subMeshes[0]);\n          }, I.prototype._afterBind = function(O, x) {\n            x === void 0 && (x = null), u.prototype._afterBind.call(this, O), this.getScene()._cachedEffect = x;\n          }, I.prototype._mustRebind = function(O, x, m) {\n            return m === void 0 && (m = 1), O.isCachedMaterialInvalid(this, x, m);\n          }, I;\n        }(f(25).a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(1), _ = function(C) {\n          function u(I) {\n            var O = C.call(this) || this;\n            return O._buffer = I, O;\n          }\n          return Object(V.d)(u, C), Object.defineProperty(u.prototype, \"underlyingResource\", { get: function() {\n            return this._buffer;\n          }, enumerable: !1, configurable: !0 }), u;\n        }(f(89).a);\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this.references = 0, this.capacity = 0, this.is32Bits = !1;\n          }\n          return Object.defineProperty(_.prototype, \"underlyingResource\", { get: function() {\n            return null;\n          }, enumerable: !1, configurable: !0 }), _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(64), _ = function() {\n          function C() {\n          }\n          return C.GetPlanes = function(u) {\n            for (var I = [], O = 0; O < 6; O++)\n              I.push(new V.a(0, 0, 0, 0));\n            return C.GetPlanesToRef(u, I), I;\n          }, C.GetNearPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] + O[2], I.normal.y = O[7] + O[6], I.normal.z = O[11] + O[10], I.d = O[15] + O[14], I.normalize();\n          }, C.GetFarPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] - O[2], I.normal.y = O[7] - O[6], I.normal.z = O[11] - O[10], I.d = O[15] - O[14], I.normalize();\n          }, C.GetLeftPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] + O[0], I.normal.y = O[7] + O[4], I.normal.z = O[11] + O[8], I.d = O[15] + O[12], I.normalize();\n          }, C.GetRightPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] - O[0], I.normal.y = O[7] - O[4], I.normal.z = O[11] - O[8], I.d = O[15] - O[12], I.normalize();\n          }, C.GetTopPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] - O[1], I.normal.y = O[7] - O[5], I.normal.z = O[11] - O[9], I.d = O[15] - O[13], I.normalize();\n          }, C.GetBottomPlaneToRef = function(u, I) {\n            var O = u.m;\n            I.normal.x = O[3] + O[1], I.normal.y = O[7] + O[5], I.normal.z = O[11] + O[9], I.d = O[15] + O[13], I.normalize();\n          }, C.GetPlanesToRef = function(u, I) {\n            C.GetNearPlaneToRef(u, I[0]), C.GetFarPlaneToRef(u, I[1]), C.GetLeftPlaneToRef(u, I[2]), C.GetRightPlaneToRef(u, I[3]), C.GetTopPlaneToRef(u, I[4]), C.GetBottomPlaneToRef(u, I[5]);\n          }, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(2), _ = function() {\n          function C() {\n            this.hoverCursor = \"\", this.actions = new Array(), this.isRecursive = !1;\n          }\n          return Object.defineProperty(C, \"HasTriggers\", { get: function() {\n            for (var u in C.Triggers)\n              if (C.Triggers.hasOwnProperty(u))\n                return !0;\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C, \"HasPickTriggers\", { get: function() {\n            for (var u in C.Triggers)\n              if (C.Triggers.hasOwnProperty(u)) {\n                var I = parseInt(u);\n                if (I >= V.a.ACTION_OnPickTrigger && I <= V.a.ACTION_OnPickUpTrigger)\n                  return !0;\n              }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), C.HasSpecificTrigger = function(u) {\n            for (var I in C.Triggers)\n              if (C.Triggers.hasOwnProperty(I) && parseInt(I) === u)\n                return !0;\n            return !1;\n          }, C.Triggers = {}, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return O;\n        });\n        var V = f(1), _ = f(25), C = f(3), u = f(19), I = f(15), O = function() {\n          function x(m) {\n            this._texture = null, this.diffuseBlendLevel = 1, this.roughnessBlendLevel = 1, this.bumpLevel = 1, this._normalBlendMethod = _.a.MATERIAL_NORMALBLENDMETHOD_WHITEOUT, this._isEnabled = !1, this.isEnabled = !1, this._internalMarkAllSubMeshesAsTexturesDirty = m;\n          }\n          return x.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, x.prototype.isReadyForSubMesh = function(m, c) {\n            var T = c.getEngine();\n            return !(m._areTexturesDirty && c.texturesEnabled && T.getCaps().standardDerivatives && this._texture && u.a.DetailTextureEnabled && !this._texture.isReady());\n          }, x.prototype.prepareDefines = function(m, c) {\n            if (this._isEnabled) {\n              m.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod;\n              var T = c.getEngine();\n              m._areTexturesDirty && (T.getCaps().standardDerivatives && this._texture && u.a.DetailTextureEnabled && this._isEnabled ? (I.a.PrepareDefinesForMergedUV(this._texture, m, \"DETAIL\"), m.DETAIL_NORMALBLENDMETHOD = this._normalBlendMethod) : m.DETAIL = !1);\n            } else\n              m.DETAIL = !1;\n          }, x.prototype.bindForSubMesh = function(m, c, T) {\n            this._isEnabled && (m.useUbo && T && m.isSync || this._texture && u.a.DetailTextureEnabled && (m.updateFloat4(\"vDetailInfos\", this._texture.coordinatesIndex, this.diffuseBlendLevel, this.bumpLevel, this.roughnessBlendLevel), I.a.BindTextureMatrix(this._texture, m, \"detail\")), c.texturesEnabled && this._texture && u.a.DetailTextureEnabled && m.setTexture(\"detailSampler\", this._texture));\n          }, x.prototype.hasTexture = function(m) {\n            return this._texture === m;\n          }, x.prototype.getActiveTextures = function(m) {\n            this._texture && m.push(this._texture);\n          }, x.prototype.getAnimatables = function(m) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && m.push(this._texture);\n          }, x.prototype.dispose = function(m) {\n            var c;\n            m && ((c = this._texture) === null || c === void 0 || c.dispose());\n          }, x.prototype.getClassName = function() {\n            return \"DetailMap\";\n          }, x.AddUniforms = function(m) {\n            m.push(\"vDetailInfos\");\n          }, x.AddSamplers = function(m) {\n            m.push(\"detailSampler\");\n          }, x.PrepareUniformBuffer = function(m) {\n            m.addUniform(\"vDetailInfos\", 4), m.addUniform(\"detailMatrix\", 16);\n          }, x.prototype.copyTo = function(m) {\n            C.a.Clone(function() {\n              return m;\n            }, this);\n          }, x.prototype.serialize = function() {\n            return C.a.Serialize(this);\n          }, x.prototype.parse = function(m, c, T) {\n            var S = this;\n            C.a.Parse(function() {\n              return S;\n            }, m, c, T);\n          }, Object(V.c)([Object(C.m)(\"detailTexture\"), Object(C.b)(\"_markAllSubMeshesAsTexturesDirty\")], x.prototype, \"texture\", void 0), Object(V.c)([Object(C.c)()], x.prototype, \"diffuseBlendLevel\", void 0), Object(V.c)([Object(C.c)()], x.prototype, \"roughnessBlendLevel\", void 0), Object(V.c)([Object(C.c)()], x.prototype, \"bumpLevel\", void 0), Object(V.c)([Object(C.c)(), Object(C.b)(\"_markAllSubMeshesAsTexturesDirty\")], x.prototype, \"normalBlendMethod\", void 0), Object(V.c)([Object(C.c)(), Object(C.b)(\"_markAllSubMeshesAsTexturesDirty\")], x.prototype, \"isEnabled\", void 0), x;\n        }();\n      }, function(Be, A, f) {\n        var V = \"morphTargetsVertexGlobalDeclaration\", _ = `#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"morphTargetsVertexDeclaration\", _ = `#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#ifdef MORPHTARGETS_UV\nattribute vec2 uv_{X};\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(25), _ = f(4), C = f(2), u = function() {\n          function I(O) {\n            this._vertexBuffers = {}, this._scene = O;\n          }\n          return I.prototype._prepareBuffers = function() {\n            if (!this._vertexBuffers[_.b.PositionKind]) {\n              var O = [];\n              O.push(1, 1), O.push(-1, 1), O.push(-1, -1), O.push(1, -1), this._vertexBuffers[_.b.PositionKind] = new _.b(this._scene.getEngine(), O, _.b.PositionKind, !1, !1, 2), this._buildIndexBuffer();\n            }\n          }, I.prototype._buildIndexBuffer = function() {\n            var O = [];\n            O.push(0), O.push(1), O.push(2), O.push(0), O.push(2), O.push(3), this._indexBuffer = this._scene.getEngine().createIndexBuffer(O);\n          }, I.prototype._rebuild = function() {\n            var O = this._vertexBuffers[_.b.PositionKind];\n            O && (O._rebuild(), this._buildIndexBuffer());\n          }, I.prototype._prepareFrame = function(O, x) {\n            O === void 0 && (O = null), x === void 0 && (x = null);\n            var m = this._scene.activeCamera;\n            return !!m && !(!(x = x || m._postProcesses.filter(function(c) {\n              return c != null;\n            })) || x.length === 0 || !this._scene.postProcessesEnabled) && (x[0].activate(m, O, x != null), !0);\n          }, I.prototype.directRender = function(O, x, m, c, T, S) {\n            x === void 0 && (x = null), m === void 0 && (m = !1), c === void 0 && (c = 0), T === void 0 && (T = 0), S === void 0 && (S = !1);\n            for (var E = this._scene.getEngine(), g = 0; g < O.length; g++) {\n              g < O.length - 1 ? O[g + 1].activate(this._scene.activeCamera, x) : x ? E.bindFramebuffer(x, c, void 0, void 0, m, T) : S || E.restoreDefaultFramebuffer();\n              var l = O[g], h = l.apply();\n              h && (l.onBeforeRenderObservable.notifyObservers(h), this._prepareBuffers(), E.bindBuffers(this._vertexBuffers, this._indexBuffer, h), E.drawElementsType(V.a.TriangleFillMode, 0, 6), l.onAfterRenderObservable.notifyObservers(h));\n            }\n            E.setDepthBuffer(!0), E.setDepthWrite(!0);\n          }, I.prototype._finalizeFrame = function(O, x, m, c, T) {\n            T === void 0 && (T = !1);\n            var S = this._scene.activeCamera;\n            if (S && (c = c || S._postProcesses.filter(function(b) {\n              return b != null;\n            })).length !== 0 && this._scene.postProcessesEnabled) {\n              for (var E = this._scene.getEngine(), g = 0, l = c.length; g < l; g++) {\n                var h = c[g];\n                if (g < l - 1 ? h._outputTexture = c[g + 1].activate(S, x) : x ? (E.bindFramebuffer(x, m, void 0, void 0, T), h._outputTexture = x) : (E.restoreDefaultFramebuffer(), h._outputTexture = null), O)\n                  break;\n                var v = h.apply();\n                v && (h.onBeforeRenderObservable.notifyObservers(v), this._prepareBuffers(), E.bindBuffers(this._vertexBuffers, this._indexBuffer, v), E.drawElementsType(V.a.TriangleFillMode, 0, 6), h.onAfterRenderObservable.notifyObservers(v));\n              }\n              E.setDepthBuffer(!0), E.setDepthWrite(!0), E.setAlphaMode(C.a.ALPHA_DISABLE);\n            }\n          }, I.prototype.dispose = function() {\n            var O = this._vertexBuffers[_.b.PositionKind];\n            O && (O.dispose(), this._vertexBuffers[_.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null);\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(148), _ = function() {\n        }, C = function() {\n          function u(I) {\n            this._useSceneAutoClearSetup = !1, this._renderingGroups = new Array(), this._autoClearDepthStencil = {}, this._customOpaqueSortCompareFn = {}, this._customAlphaTestSortCompareFn = {}, this._customTransparentSortCompareFn = {}, this._renderingGroupInfo = new _(), this._scene = I;\n            for (var O = u.MIN_RENDERINGGROUPS; O < u.MAX_RENDERINGGROUPS; O++)\n              this._autoClearDepthStencil[O] = { autoClear: !0, depth: !0, stencil: !0 };\n          }\n          return u.prototype._clearDepthStencilBuffer = function(I, O) {\n            I === void 0 && (I = !0), O === void 0 && (O = !0), this._depthStencilBufferAlreadyCleaned || (this._scene.getEngine().clear(null, !1, I, O), this._depthStencilBufferAlreadyCleaned = !0);\n          }, u.prototype.render = function(I, O, x, m) {\n            var c = this._renderingGroupInfo;\n            if (c.scene = this._scene, c.camera = this._scene.activeCamera, this._scene.spriteManagers && m)\n              for (var T = 0; T < this._scene.spriteManagers.length; T++) {\n                var S = this._scene.spriteManagers[T];\n                this.dispatchSprites(S);\n              }\n            for (T = u.MIN_RENDERINGGROUPS; T < u.MAX_RENDERINGGROUPS; T++) {\n              this._depthStencilBufferAlreadyCleaned = T === u.MIN_RENDERINGGROUPS;\n              var E = this._renderingGroups[T];\n              if (E) {\n                var g = Math.pow(2, T);\n                if (c.renderingGroupId = T, this._scene.onBeforeRenderingGroupObservable.notifyObservers(c, g), u.AUTOCLEAR) {\n                  var l = this._useSceneAutoClearSetup ? this._scene.getAutoClearDepthStencilSetup(T) : this._autoClearDepthStencil[T];\n                  l && l.autoClear && this._clearDepthStencilBuffer(l.depth, l.stencil);\n                }\n                for (var h = 0, v = this._scene._beforeRenderingGroupDrawStage; h < v.length; h++)\n                  v[h].action(T);\n                E.render(I, m, x, O);\n                for (var b = 0, D = this._scene._afterRenderingGroupDrawStage; b < D.length; b++)\n                  D[b].action(T);\n                this._scene.onAfterRenderingGroupObservable.notifyObservers(c, g);\n              }\n            }\n          }, u.prototype.reset = function() {\n            for (var I = u.MIN_RENDERINGGROUPS; I < u.MAX_RENDERINGGROUPS; I++) {\n              var O = this._renderingGroups[I];\n              O && O.prepare();\n            }\n          }, u.prototype.dispose = function() {\n            this.freeRenderingGroups(), this._renderingGroups.length = 0, this._renderingGroupInfo = null;\n          }, u.prototype.freeRenderingGroups = function() {\n            for (var I = u.MIN_RENDERINGGROUPS; I < u.MAX_RENDERINGGROUPS; I++) {\n              var O = this._renderingGroups[I];\n              O && O.dispose();\n            }\n          }, u.prototype._prepareRenderingGroup = function(I) {\n            this._renderingGroups[I] === void 0 && (this._renderingGroups[I] = new V.a(I, this._scene, this._customOpaqueSortCompareFn[I], this._customAlphaTestSortCompareFn[I], this._customTransparentSortCompareFn[I]));\n          }, u.prototype.dispatchSprites = function(I) {\n            var O = I.renderingGroupId || 0;\n            this._prepareRenderingGroup(O), this._renderingGroups[O].dispatchSprites(I);\n          }, u.prototype.dispatchParticles = function(I) {\n            var O = I.renderingGroupId || 0;\n            this._prepareRenderingGroup(O), this._renderingGroups[O].dispatchParticles(I);\n          }, u.prototype.dispatch = function(I, O, x) {\n            O === void 0 && (O = I.getMesh());\n            var m = O.renderingGroupId || 0;\n            this._prepareRenderingGroup(m), this._renderingGroups[m].dispatch(I, O, x);\n          }, u.prototype.setRenderingOrder = function(I, O, x, m) {\n            if (O === void 0 && (O = null), x === void 0 && (x = null), m === void 0 && (m = null), this._customOpaqueSortCompareFn[I] = O, this._customAlphaTestSortCompareFn[I] = x, this._customTransparentSortCompareFn[I] = m, this._renderingGroups[I]) {\n              var c = this._renderingGroups[I];\n              c.opaqueSortCompareFn = this._customOpaqueSortCompareFn[I], c.alphaTestSortCompareFn = this._customAlphaTestSortCompareFn[I], c.transparentSortCompareFn = this._customTransparentSortCompareFn[I];\n            }\n          }, u.prototype.setRenderingAutoClearDepthStencil = function(I, O, x, m) {\n            x === void 0 && (x = !0), m === void 0 && (m = !0), this._autoClearDepthStencil[I] = { autoClear: O, depth: x, stencil: m };\n          }, u.prototype.getAutoClearDepthStencilSetup = function(I) {\n            return this._autoClearDepthStencil[I];\n          }, u.MAX_RENDERINGGROUPS = 4, u.MIN_RENDERINGGROUPS = 0, u.AUTOCLEAR = !0, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return I;\n        });\n        var V = f(0), _ = f(7), C = f(82), u = f(72);\n        _.a.ExtrudeShape = function(O, x, m, c, T, S, E, g, l, h) {\n          E === void 0 && (E = null);\n          var v = { shape: x, path: m, scale: c, rotation: T, cap: S === 0 ? 0 : S || _.a.NO_CAP, sideOrientation: l, instance: h, updatable: g };\n          return I.ExtrudeShape(O, v, E);\n        }, _.a.ExtrudeShapeCustom = function(O, x, m, c, T, S, E, g, l, h, v, b) {\n          var D = { shape: x, path: m, scaleFunction: c, rotationFunction: T, ribbonCloseArray: S, ribbonClosePath: E, cap: g === 0 ? 0 : g || _.a.NO_CAP, sideOrientation: v, instance: b, updatable: h };\n          return I.ExtrudeShapeCustom(O, D, l);\n        };\n        var I = function() {\n          function O() {\n          }\n          return O.ExtrudeShape = function(x, m, c) {\n            c === void 0 && (c = null);\n            var T = m.path, S = m.shape, E = m.scale || 1, g = m.rotation || 0, l = m.cap === 0 ? 0 : m.cap || _.a.NO_CAP, h = m.updatable, v = _.a._GetDefaultSideOrientation(m.sideOrientation), b = m.instance || null, D = m.invertUV || !1;\n            return O._ExtrudeShapeGeneric(x, S, T, E, g, null, null, !1, !1, l, !1, c, !!h, v, b, D, m.frontUVs || null, m.backUVs || null);\n          }, O.ExtrudeShapeCustom = function(x, m, c) {\n            c === void 0 && (c = null);\n            var T = m.path, S = m.shape, E = m.scaleFunction || function() {\n              return 1;\n            }, g = m.rotationFunction || function() {\n              return 0;\n            }, l = m.ribbonCloseArray || !1, h = m.ribbonClosePath || !1, v = m.cap === 0 ? 0 : m.cap || _.a.NO_CAP, b = m.updatable, D = _.a._GetDefaultSideOrientation(m.sideOrientation), w = m.instance, N = m.invertUV || !1;\n            return O._ExtrudeShapeGeneric(x, S, T, null, null, E, g, l, h, v, !0, c, !!b, D, w || null, N, m.frontUVs || null, m.backUVs || null);\n          }, O._ExtrudeShapeGeneric = function(x, m, c, T, S, E, g, l, h, v, b, D, w, N, M, U, X, j) {\n            var ne, te, de = function(ee, K, $, L, G, Q, oe, re, Y, k) {\n              for (var H = $.getTangents(), Z = $.getNormals(), W = $.getBinormals(), q = $.getDistances(), he = 0, ge = k && re ? re : function() {\n                return Q !== null ? Q : 0;\n              }, me = k && oe ? oe : function() {\n                return G !== null ? G : 1;\n              }, _e = Y === _.a.NO_CAP || Y === _.a.CAP_END ? 0 : 2, ye = V.c.Matrix[0], Pe = 0; Pe < K.length; Pe++) {\n                for (var be = new Array(), Fe = ge(Pe, q[Pe]), ke = me(Pe, q[Pe]), We = 0; We < ee.length; We++) {\n                  V.a.RotationAxisToRef(H[Pe], he, ye);\n                  var je = H[Pe].scale(ee[We].z).add(Z[Pe].scale(ee[We].x)).add(W[Pe].scale(ee[We].y)), He = be[We] ? be[We] : V.e.Zero();\n                  V.e.TransformCoordinatesToRef(je, ye, He), He.scaleInPlace(ke).addInPlace(K[Pe]), be[We] = He;\n                }\n                L[_e] = be, he += Fe, _e++;\n              }\n              var Qe = function(Ge) {\n                var tt, Je = Array(), st = V.e.Zero();\n                for (tt = 0; tt < Ge.length; tt++)\n                  st.addInPlace(Ge[tt]);\n                for (st.scaleInPlace(1 / Ge.length), tt = 0; tt < Ge.length; tt++)\n                  Je.push(st);\n                return Je;\n              };\n              switch (Y) {\n                case _.a.NO_CAP:\n                  break;\n                case _.a.CAP_START:\n                  L[0] = Qe(L[2]), L[1] = L[2];\n                  break;\n                case _.a.CAP_END:\n                  L[_e] = L[_e - 1], L[_e + 1] = Qe(L[_e - 1]);\n                  break;\n                case _.a.CAP_ALL:\n                  L[0] = Qe(L[2]), L[1] = L[2], L[_e] = L[_e - 1], L[_e + 1] = Qe(L[_e - 1]);\n              }\n              return L;\n            };\n            if (M) {\n              var pe = M._creationDataStorage;\n              return ne = pe.path3D.update(c), te = de(m, c, pe.path3D, pe.pathArray, T, S, E, g, pe.cap, b), M = _.a.CreateRibbon(\"\", te, !1, !1, 0, D || void 0, !1, 0, M);\n            }\n            te = de(m, c, ne = new u.g(c), new Array(), T, S, E, g, v = v < 0 || v > 3 ? 0 : v, b);\n            var ae = C.a.CreateRibbon(x, { pathArray: te, closeArray: l, closePath: h, updatable: w, sideOrientation: N, invertUV: U, frontUVs: X || void 0, backUVs: j || void 0 }, D);\n            return ae._creationDataStorage.pathArray = te, ae._creationDataStorage.path3D = ne, ae._creationDataStorage.cap = v, ae;\n          }, O;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return c;\n        }), f.d(A, \"a\", function() {\n          return T;\n        });\n        var V = f(1), _ = f(9), C = f(4), u = f(7), I = f(151), O = f(25), x = f(73), m = f(15), c = (f(166), f(167), function(S) {\n          function E(g, l, h, v, b, D, w) {\n            l === void 0 && (l = null), h === void 0 && (h = null), v === void 0 && (v = null);\n            var N = S.call(this, g, l, h, v, b) || this;\n            N.useVertexColor = D, N.useVertexAlpha = w, N.color = new _.a(1, 1, 1), N.alpha = 1, v && (N.color = v.color.clone(), N.alpha = v.alpha, N.useVertexColor = v.useVertexColor, N.useVertexAlpha = v.useVertexAlpha), N.intersectionThreshold = 0.1;\n            var M = { attributes: [C.b.PositionKind, \"world0\", \"world1\", \"world2\", \"world3\"], uniforms: [\"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"world\", \"viewProjection\"], needAlphaBlending: !0, defines: [] };\n            return w === !1 && (M.needAlphaBlending = !1), D ? (M.defines.push(\"#define VERTEXCOLOR\"), M.attributes.push(C.b.ColorKind)) : (M.uniforms.push(\"color\"), N.color4 = new _.b()), N._colorShader = new x.a(\"colorShader\", N.getScene(), \"color\", M), N;\n          }\n          return Object(V.d)(E, S), E.prototype._addClipPlaneDefine = function(g) {\n            var l = \"#define \" + g;\n            this._colorShader.options.defines.indexOf(l) === -1 && this._colorShader.options.defines.push(l);\n          }, E.prototype._removeClipPlaneDefine = function(g) {\n            var l = \"#define \" + g, h = this._colorShader.options.defines.indexOf(l);\n            h !== -1 && this._colorShader.options.defines.splice(h, 1);\n          }, E.prototype.isReady = function() {\n            var g = this.getScene();\n            return g.clipPlane ? this._addClipPlaneDefine(\"CLIPPLANE\") : this._removeClipPlaneDefine(\"CLIPPLANE\"), g.clipPlane2 ? this._addClipPlaneDefine(\"CLIPPLANE2\") : this._removeClipPlaneDefine(\"CLIPPLANE2\"), g.clipPlane3 ? this._addClipPlaneDefine(\"CLIPPLANE3\") : this._removeClipPlaneDefine(\"CLIPPLANE3\"), g.clipPlane4 ? this._addClipPlaneDefine(\"CLIPPLANE4\") : this._removeClipPlaneDefine(\"CLIPPLANE4\"), g.clipPlane5 ? this._addClipPlaneDefine(\"CLIPPLANE5\") : this._removeClipPlaneDefine(\"CLIPPLANE5\"), g.clipPlane6 ? this._addClipPlaneDefine(\"CLIPPLANE6\") : this._removeClipPlaneDefine(\"CLIPPLANE6\"), !!this._colorShader.isReady(this) && S.prototype.isReady.call(this);\n          }, E.prototype.getClassName = function() {\n            return \"LinesMesh\";\n          }, Object.defineProperty(E.prototype, \"material\", { get: function() {\n            return this._colorShader;\n          }, set: function(g) {\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(E.prototype, \"checkCollisions\", { get: function() {\n            return !1;\n          }, enumerable: !1, configurable: !0 }), E.prototype._bind = function(g, l, h) {\n            if (!this._geometry)\n              return this;\n            var v = this._colorShader.getEffect(), b = this.isUnIndexed ? null : this._geometry.getIndexBuffer();\n            if (this._geometry._bind(v, b), !this.useVertexColor) {\n              var D = this.color, w = D.r, N = D.g, M = D.b;\n              this.color4.set(w, N, M, this.alpha), this._colorShader.setColor4(\"color\", this.color4);\n            }\n            return m.a.BindClipPlane(v, this.getScene()), this;\n          }, E.prototype._draw = function(g, l, h) {\n            if (!this._geometry || !this._geometry.getVertexBuffers() || !this._unIndexed && !this._geometry.getIndexBuffer())\n              return this;\n            var v = this.getScene().getEngine();\n            return this._unIndexed ? v.drawArraysType(O.a.LineListDrawMode, g.verticesStart, g.verticesCount, h) : v.drawElementsType(O.a.LineListDrawMode, g.indexStart, g.indexCount, h), this;\n          }, E.prototype.dispose = function(g) {\n            this._colorShader.dispose(!1, !1, !0), S.prototype.dispose.call(this, g);\n          }, E.prototype.clone = function(g, l, h) {\n            return l === void 0 && (l = null), new E(g, this.getScene(), l, this, h);\n          }, E.prototype.createInstance = function(g) {\n            return new T(g, this);\n          }, E;\n        }(u.a)), T = function(S) {\n          function E(g, l) {\n            var h = S.call(this, g, l) || this;\n            return h.intersectionThreshold = l.intersectionThreshold, h;\n          }\n          return Object(V.d)(E, S), E.prototype.getClassName = function() {\n            return \"InstancedLinesMesh\";\n          }, E;\n        }(I.a);\n      }, function(Be, A, f) {\n        f.r(A), f.d(A, \"AxesViewer\", function() {\n          return O;\n        }), f.d(A, \"BoneAxesViewer\", function() {\n          return c;\n        }), f.d(A, \"DebugLayerTab\", function() {\n          return V;\n        }), f.d(A, \"DebugLayer\", function() {\n          return l;\n        }), f.d(A, \"PhysicsViewer\", function() {\n          return U;\n        }), f.d(A, \"RayHelper\", function() {\n          return j;\n        }), f.d(A, \"SkeletonViewer\", function() {\n          return K;\n        });\n        var V, _ = f(0), C = f(30), u = f(75), I = f(9), O = function() {\n          function $(L, G, Q, oe, re, Y) {\n            if (G === void 0 && (G = 1), Q === void 0 && (Q = 2), this._scaleLinesFactor = 4, this._instanced = !1, this.scene = null, this.scaleLines = 1, this.scaleLines = G, !oe) {\n              var k = new C.a(\"\", L);\n              k.disableLighting = !0, k.emissiveColor = I.a.Red().scale(0.5), oe = u.a._CreateArrow(L, k);\n            }\n            if (!re) {\n              var H = new C.a(\"\", L);\n              H.disableLighting = !0, H.emissiveColor = I.a.Green().scale(0.5), re = u.a._CreateArrow(L, H);\n            }\n            if (!Y) {\n              var Z = new C.a(\"\", L);\n              Z.disableLighting = !0, Z.emissiveColor = I.a.Blue().scale(0.5), Y = u.a._CreateArrow(L, Z);\n            }\n            this._xAxis = oe, this._xAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._yAxis = re, this._yAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._zAxis = Y, this._zAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), Q != null && ($._SetRenderingGroupId(this._xAxis, Q), $._SetRenderingGroupId(this._yAxis, Q), $._SetRenderingGroupId(this._zAxis, Q)), this.scene = L, this.update(new _.e(), _.e.Right(), _.e.Up(), _.e.Forward());\n          }\n          return Object.defineProperty($.prototype, \"xAxis\", { get: function() {\n            return this._xAxis;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"yAxis\", { get: function() {\n            return this._yAxis;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"zAxis\", { get: function() {\n            return this._zAxis;\n          }, enumerable: !1, configurable: !0 }), $.prototype.update = function(L, G, Q, oe) {\n            this._xAxis.position.copyFrom(L), this._xAxis.setDirection(G), this._xAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._yAxis.position.copyFrom(L), this._yAxis.setDirection(Q), this._yAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor), this._zAxis.position.copyFrom(L), this._zAxis.setDirection(oe), this._zAxis.scaling.setAll(this.scaleLines * this._scaleLinesFactor);\n          }, $.prototype.createInstance = function() {\n            var L = u.a._CreateArrowInstance(this.scene, this._xAxis), G = u.a._CreateArrowInstance(this.scene, this._yAxis), Q = u.a._CreateArrowInstance(this.scene, this._zAxis), oe = new $(this.scene, this.scaleLines, null, L, G, Q);\n            return oe._instanced = !0, oe;\n          }, $.prototype.dispose = function() {\n            this._xAxis && this._xAxis.dispose(!1, !this._instanced), this._yAxis && this._yAxis.dispose(!1, !this._instanced), this._zAxis && this._zAxis.dispose(!1, !this._instanced), this.scene = null;\n          }, $._SetRenderingGroupId = function(L, G) {\n            L.getChildMeshes().forEach(function(Q) {\n              Q.renderingGroupId = G;\n            });\n          }, $;\n        }(), x = f(1), m = f(23), c = function($) {\n          function L(G, Q, oe, re) {\n            re === void 0 && (re = 1);\n            var Y = $.call(this, G, re) || this;\n            return Y.pos = _.e.Zero(), Y.xaxis = _.e.Zero(), Y.yaxis = _.e.Zero(), Y.zaxis = _.e.Zero(), Y.mesh = oe, Y.bone = Q, Y;\n          }\n          return Object(x.d)(L, $), L.prototype.update = function() {\n            if (this.mesh && this.bone) {\n              var G = this.bone;\n              G._markAsDirtyAndCompose(), G.getAbsolutePositionToRef(this.mesh, this.pos), G.getDirectionToRef(m.a.X, this.mesh, this.xaxis), G.getDirectionToRef(m.a.Y, this.mesh, this.yaxis), G.getDirectionToRef(m.a.Z, this.mesh, this.zaxis), $.prototype.update.call(this, this.pos, this.xaxis, this.yaxis, this.zaxis);\n            }\n          }, L.prototype.dispose = function() {\n            this.mesh && (this.mesh = null, this.bone = null, $.prototype.dispose.call(this));\n          }, L;\n        }(O), T = f(12), S = f(6), E = f(20), g = f(13);\n        Object.defineProperty(E.a.prototype, \"debugLayer\", { get: function() {\n          return this._debugLayer || (this._debugLayer = new l(this)), this._debugLayer;\n        }, enumerable: !0, configurable: !0 }), function($) {\n          $[$.Properties = 0] = \"Properties\", $[$.Debug = 1] = \"Debug\", $[$.Statistics = 2] = \"Statistics\", $[$.Tools = 3] = \"Tools\", $[$.Settings = 4] = \"Settings\";\n        }(V || (V = {}));\n        var l = function() {\n          function $(L) {\n            var G = this;\n            this.BJSINSPECTOR = this._getGlobalInspector(), this._scene = L, this._scene.onDisposeObservable.add(function() {\n              G._scene._debugLayer && G._scene._debugLayer.hide();\n            });\n          }\n          return Object.defineProperty($.prototype, \"onPropertyChangedObservable\", { get: function() {\n            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector ? this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable : (this._onPropertyChangedObservable || (this._onPropertyChangedObservable = new S.c()), this._onPropertyChangedObservable);\n          }, enumerable: !1, configurable: !0 }), $.prototype._createInspector = function(L) {\n            if (!this.isVisible()) {\n              if (this._onPropertyChangedObservable) {\n                for (var G = 0, Q = this._onPropertyChangedObservable.observers; G < Q.length; G++) {\n                  var oe = Q[G];\n                  this.BJSINSPECTOR.Inspector.OnPropertyChangedObservable.add(oe);\n                }\n                this._onPropertyChangedObservable.clear(), this._onPropertyChangedObservable = void 0;\n              }\n              var re = Object(x.a)({ overlay: !1, showExplorer: !0, showInspector: !0, embedMode: !1, handleResize: !0, enablePopup: !0 }, L);\n              this.BJSINSPECTOR = this.BJSINSPECTOR || this._getGlobalInspector(), this.BJSINSPECTOR.Inspector.Show(this._scene, re);\n            }\n          }, $.prototype.select = function(L, G) {\n            this.BJSINSPECTOR && (G && (Object.prototype.toString.call(G) == \"[object String]\" ? this.BJSINSPECTOR.Inspector.MarkLineContainerTitleForHighlighting(G) : this.BJSINSPECTOR.Inspector.MarkMultipleLineContainerTitlesForHighlighting(G)), this.BJSINSPECTOR.Inspector.OnSelectionChangeObservable.notifyObservers(L));\n          }, $.prototype._getGlobalInspector = function() {\n            return typeof INSPECTOR < \"u\" ? INSPECTOR : typeof BABYLON < \"u\" && BABYLON.Inspector !== void 0 ? BABYLON : void 0;\n          }, $.prototype.isVisible = function() {\n            return this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.IsVisible;\n          }, $.prototype.hide = function() {\n            this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector.Hide();\n          }, $.prototype.setAsActiveScene = function() {\n            this.BJSINSPECTOR && this.BJSINSPECTOR.Inspector._SetNewScene(this._scene);\n          }, $.prototype.show = function(L) {\n            var G = this;\n            return new Promise(function(Q, oe) {\n              if (G.BJSINSPECTOR === void 0) {\n                var re = L && L.inspectorURL ? L.inspectorURL : $.InspectorURL;\n                T.b.LoadScript(re, function() {\n                  G._createInspector(L), Q(G);\n                });\n              } else\n                G._createInspector(L), Q(G);\n            });\n          }, $.InspectorURL = \"https://unpkg.com/babylonjs-inspector@\" + g.a.Version + \"/babylon.inspector.bundle.js\", $;\n        }(), h = f(7), v = f(63), b = f(45), D = f(22), w = f(32), N = f(36), M = f(53), U = function() {\n          function $(L) {\n            this._impostors = [], this._meshes = [], this._numMeshes = 0, this._debugMeshMeshes = new Array(), this._scene = L || D.a.LastCreatedScene;\n            var G = this._scene.getPhysicsEngine();\n            G && (this._physicsEnginePlugin = G.getPhysicsPlugin()), this._utilityLayer = new N.a(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;\n          }\n          return $.prototype._updateDebugMeshes = function() {\n            for (var L = this._physicsEnginePlugin, G = 0; G < this._numMeshes; G++) {\n              var Q = this._impostors[G];\n              if (Q)\n                if (Q.isDisposed)\n                  this.hideImpostor(this._impostors[G--]);\n                else {\n                  if (Q.type === w.a.MeshImpostor)\n                    continue;\n                  var oe = this._meshes[G];\n                  oe && L && L.syncMeshWithImpostor(oe, Q);\n                }\n            }\n          }, $.prototype.showImpostor = function(L, G) {\n            if (!this._scene)\n              return null;\n            for (var Q = 0; Q < this._numMeshes; Q++)\n              if (this._impostors[Q] == L)\n                return null;\n            var oe = this._getDebugMesh(L, G);\n            return oe && (this._impostors[this._numMeshes] = L, this._meshes[this._numMeshes] = oe, this._numMeshes === 0 && (this._renderFunction = this._updateDebugMeshes.bind(this), this._scene.registerBeforeRender(this._renderFunction)), this._numMeshes++), oe;\n          }, $.prototype.hideImpostor = function(L) {\n            if (L && this._scene && this._utilityLayer) {\n              for (var G = !1, Q = this._utilityLayer.utilityLayerScene, oe = 0; oe < this._numMeshes; oe++)\n                if (this._impostors[oe] == L) {\n                  var re = this._meshes[oe];\n                  if (!re)\n                    continue;\n                  Q.removeMesh(re), re.dispose();\n                  var Y = this._debugMeshMeshes.indexOf(re);\n                  Y > -1 && this._debugMeshMeshes.splice(Y, 1), this._numMeshes--, this._numMeshes > 0 ? (this._meshes[oe] = this._meshes[this._numMeshes], this._impostors[oe] = this._impostors[this._numMeshes], this._meshes[this._numMeshes] = null, this._impostors[this._numMeshes] = null) : (this._meshes[0] = null, this._impostors[0] = null), G = !0;\n                  break;\n                }\n              G && this._numMeshes === 0 && this._scene.unregisterBeforeRender(this._renderFunction);\n            }\n          }, $.prototype._getDebugMaterial = function(L) {\n            return this._debugMaterial || (this._debugMaterial = new C.a(\"\", L), this._debugMaterial.wireframe = !0, this._debugMaterial.emissiveColor = I.a.White(), this._debugMaterial.disableLighting = !0), this._debugMaterial;\n          }, $.prototype._getDebugBoxMesh = function(L) {\n            return this._debugBoxMesh || (this._debugBoxMesh = v.a.CreateBox(\"physicsBodyBoxViewMesh\", { size: 1 }, L), this._debugBoxMesh.rotationQuaternion = _.b.Identity(), this._debugBoxMesh.material = this._getDebugMaterial(L), this._debugBoxMesh.setEnabled(!1)), this._debugBoxMesh.createInstance(\"physicsBodyBoxViewInstance\");\n          }, $.prototype._getDebugSphereMesh = function(L) {\n            return this._debugSphereMesh || (this._debugSphereMesh = b.a.CreateSphere(\"physicsBodySphereViewMesh\", { diameter: 1 }, L), this._debugSphereMesh.rotationQuaternion = _.b.Identity(), this._debugSphereMesh.material = this._getDebugMaterial(L), this._debugSphereMesh.setEnabled(!1)), this._debugSphereMesh.createInstance(\"physicsBodyBoxViewInstance\");\n          }, $.prototype._getDebugCylinderMesh = function(L) {\n            return this._debugCylinderMesh || (this._debugCylinderMesh = M.a.CreateCylinder(\"physicsBodyCylinderViewMesh\", { diameterTop: 1, diameterBottom: 1, height: 1 }, L), this._debugCylinderMesh.rotationQuaternion = _.b.Identity(), this._debugCylinderMesh.material = this._getDebugMaterial(L), this._debugCylinderMesh.setEnabled(!1)), this._debugCylinderMesh.createInstance(\"physicsBodyBoxViewInstance\");\n          }, $.prototype._getDebugMeshMesh = function(L, G) {\n            var Q = new h.a(L.name, G, null, L);\n            return Q.position = _.e.Zero(), Q.setParent(L), Q.material = this._getDebugMaterial(G), this._debugMeshMeshes.push(Q), Q;\n          }, $.prototype._getDebugMesh = function(L, G) {\n            var Q = this;\n            if (!this._utilityLayer || G && G.parent && G.parent.physicsImpostor)\n              return null;\n            var oe = null, re = this._utilityLayer.utilityLayerScene;\n            switch (L.type) {\n              case w.a.BoxImpostor:\n                oe = this._getDebugBoxMesh(re), L.getBoxSizeToRef(oe.scaling);\n                break;\n              case w.a.SphereImpostor:\n                oe = this._getDebugSphereMesh(re);\n                var Y = L.getRadius();\n                oe.scaling.x = 2 * Y, oe.scaling.y = 2 * Y, oe.scaling.z = 2 * Y;\n                break;\n              case w.a.MeshImpostor:\n                G && (oe = this._getDebugMeshMesh(G, re));\n                break;\n              case w.a.NoImpostor:\n                G && G.getChildMeshes().filter(function(H) {\n                  return H.physicsImpostor ? 1 : 0;\n                }).forEach(function(H) {\n                  Q._getDebugBoxMesh(re).parent = H;\n                });\n                break;\n              case w.a.CylinderImpostor:\n                oe = this._getDebugCylinderMesh(re);\n                var k = L.object.getBoundingInfo();\n                oe.scaling.x = k.boundingBox.maximum.x - k.boundingBox.minimum.x, oe.scaling.y = k.boundingBox.maximum.y - k.boundingBox.minimum.y, oe.scaling.z = k.boundingBox.maximum.z - k.boundingBox.minimum.z;\n            }\n            return oe;\n          }, $.prototype.dispose = function() {\n            for (var L = this._numMeshes, G = 0; G < L; G++)\n              this.hideImpostor(this._impostors[0]);\n            this._debugBoxMesh && this._debugBoxMesh.dispose(), this._debugSphereMesh && this._debugSphereMesh.dispose(), this._debugCylinderMesh && this._debugCylinderMesh.dispose(), this._debugMaterial && this._debugMaterial.dispose(), this._impostors.length = 0, this._scene = null, this._physicsEnginePlugin = null, this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null);\n          }, $;\n        }(), X = f(40), j = function() {\n          function $(L) {\n            this.ray = L;\n          }\n          return $.CreateAndShow = function(L, G, Q) {\n            var oe = new $(L);\n            return oe.show(G, Q), oe;\n          }, $.prototype.show = function(L, G) {\n            if (!this._renderFunction && this.ray) {\n              var Q = this.ray;\n              this._renderFunction = this._render.bind(this), this._scene = L, this._renderPoints = [Q.origin, Q.origin.add(Q.direction.scale(Q.length))], this._renderLine = h.a.CreateLines(\"ray\", this._renderPoints, L, !0), this._renderLine.isPickable = !1, this._renderFunction && this._scene.registerBeforeRender(this._renderFunction);\n            }\n            G && this._renderLine && this._renderLine.color.copyFrom(G);\n          }, $.prototype.hide = function() {\n            this._renderFunction && this._scene && (this._scene.unregisterBeforeRender(this._renderFunction), this._scene = null, this._renderFunction = null, this._renderLine && (this._renderLine.dispose(), this._renderLine = null), this._renderPoints = []);\n          }, $.prototype._render = function() {\n            var L = this.ray;\n            if (L) {\n              var G = this._renderPoints[1], Q = Math.min(L.length, 1e6);\n              G.copyFrom(L.direction), G.scaleInPlace(Q), G.addInPlace(L.origin), this._renderPoints[0].copyFrom(L.origin), h.a.CreateLines(\"ray\", this._renderPoints, this._scene, !0, this._renderLine);\n            }\n          }, $.prototype.attachToMesh = function(L, G, Q, oe) {\n            var re = this;\n            this._attachedToMesh = L;\n            var Y = this.ray;\n            Y && (Y.direction || (Y.direction = _.e.Zero()), Y.origin || (Y.origin = _.e.Zero()), oe && (Y.length = oe), Q || (Q = _.e.Zero()), G || (G = new _.e(0, 0, -1)), this._scene || (this._scene = L.getScene()), this._meshSpaceDirection ? (this._meshSpaceDirection.copyFrom(G), this._meshSpaceOrigin.copyFrom(Q)) : (this._meshSpaceDirection = G.clone(), this._meshSpaceOrigin = Q.clone()), this._onAfterRenderObserver || (this._onAfterRenderObserver = this._scene.onBeforeRenderObservable.add(function() {\n              return re._updateToMesh();\n            }), this._onAfterStepObserver = this._scene.onAfterStepObservable.add(function() {\n              return re._updateToMesh();\n            })), this._attachedToMesh.computeWorldMatrix(!0), this._updateToMesh());\n          }, $.prototype.detachFromMesh = function() {\n            this._attachedToMesh && this._scene && (this._onAfterRenderObserver && (this._scene.onBeforeRenderObservable.remove(this._onAfterRenderObserver), this._scene.onAfterStepObservable.remove(this._onAfterStepObserver)), this._attachedToMesh = null, this._onAfterRenderObserver = null, this._onAfterStepObserver = null, this._scene = null);\n          }, $.prototype._updateToMesh = function() {\n            var L = this.ray;\n            this._attachedToMesh && L && (this._attachedToMesh._isDisposed ? this.detachFromMesh() : (this._attachedToMesh.getDirectionToRef(this._meshSpaceDirection, L.direction), _.e.TransformCoordinatesToRef(this._meshSpaceOrigin, this._attachedToMesh.getWorldMatrix(), L.origin)));\n          }, $.prototype.dispose = function() {\n            this.hide(), this.detachFromMesh(), this.ray = null;\n          }, $;\n        }(), ne = f(25), te = f(73), de = f(62), pe = f(4), ae = f(5), ee = f(97), K = function() {\n          function $(L, G, Q, oe, re, Y) {\n            var k, H, Z, W, q, he, ge, me, _e, ye, Pe, be, Fe, ke;\n            oe === void 0 && (oe = !0), re === void 0 && (re = 3), Y === void 0 && (Y = {}), this.skeleton = L, this.mesh = G, this.autoUpdateBonesMatrices = oe, this.renderingGroupId = re, this.options = Y, this.color = I.a.White(), this._debugLines = new Array(), this._localAxes = null, this._isEnabled = !1, this._obs = null, this._scene = Q, this._ready = !1, Y.pauseAnimations = (k = Y.pauseAnimations) === null || k === void 0 || k, Y.returnToRest = (H = Y.returnToRest) !== null && H !== void 0 && H, Y.displayMode = (Z = Y.displayMode) !== null && Z !== void 0 ? Z : $.DISPLAY_LINES, Y.displayOptions = (W = Y.displayOptions) !== null && W !== void 0 ? W : {}, Y.displayOptions.midStep = (q = Y.displayOptions.midStep) !== null && q !== void 0 ? q : 0.235, Y.displayOptions.midStepFactor = (he = Y.displayOptions.midStepFactor) !== null && he !== void 0 ? he : 0.155, Y.displayOptions.sphereBaseSize = (ge = Y.displayOptions.sphereBaseSize) !== null && ge !== void 0 ? ge : 0.15, Y.displayOptions.sphereScaleUnit = (me = Y.displayOptions.sphereScaleUnit) !== null && me !== void 0 ? me : 2, Y.displayOptions.sphereFactor = (_e = Y.displayOptions.sphereFactor) !== null && _e !== void 0 ? _e : 0.865, Y.displayOptions.spurFollowsChild = (ye = Y.displayOptions.spurFollowsChild) !== null && ye !== void 0 && ye, Y.displayOptions.showLocalAxes = (Pe = Y.displayOptions.showLocalAxes) !== null && Pe !== void 0 && Pe, Y.displayOptions.localAxesSize = (be = Y.displayOptions.localAxesSize) !== null && be !== void 0 ? be : 0.075, Y.computeBonesUsingShaders = (Fe = Y.computeBonesUsingShaders) === null || Fe === void 0 || Fe, Y.useAllBones = (ke = Y.useAllBones) === null || ke === void 0 || ke;\n            var We = G.getVerticesData(pe.b.MatricesIndicesKind), je = G.getVerticesData(pe.b.MatricesWeightsKind);\n            if (this._boneIndices = /* @__PURE__ */ new Set(), !Y.useAllBones && We && je)\n              for (var He = 0; He < We.length; ++He) {\n                var Qe = We[He];\n                je[He] !== 0 && this._boneIndices.add(Qe);\n              }\n            this._utilityLayer = new N.a(this._scene, !1), this._utilityLayer.pickUtilitySceneFirst = !1, this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = !0;\n            var Ge = this.options.displayMode || 0;\n            Ge > $.DISPLAY_SPHERE_AND_SPURS && (Ge = $.DISPLAY_LINES), this.displayMode = Ge, this.update(), this._bindObs();\n          }\n          return $.CreateBoneWeightShader = function(L, G) {\n            var Q, oe, re, Y, k, H, Z = L.skeleton, W = (Q = L.colorBase) !== null && Q !== void 0 ? Q : I.a.Black(), q = (oe = L.colorZero) !== null && oe !== void 0 ? oe : I.a.Blue(), he = (re = L.colorQuarter) !== null && re !== void 0 ? re : I.a.Green(), ge = (Y = L.colorHalf) !== null && Y !== void 0 ? Y : I.a.Yellow(), me = (k = L.colorFull) !== null && k !== void 0 ? k : I.a.Red(), _e = (H = L.targetBoneIndex) !== null && H !== void 0 ? H : 0;\n            ae.a.ShadersStore[\"boneWeights:\" + Z.name + \"VertexShader\"] = `precision highp float;\n\n        attribute vec3 position;\n        attribute vec2 uv;\n\n        uniform mat4 view;\n        uniform mat4 projection;\n        uniform mat4 worldViewProjection;\n\n        #include<bonesDeclaration>\n        #if NUM_BONE_INFLUENCERS == 0\n            attribute vec4 matricesIndices;\n            attribute vec4 matricesWeights;\n        #endif\n\n        #include<instancesDeclaration>\n\n        varying vec3 vColor;\n\n        uniform vec3 colorBase;\n        uniform vec3 colorZero;\n        uniform vec3 colorQuarter;\n        uniform vec3 colorHalf;\n        uniform vec3 colorFull;\n\n        uniform float targetBoneIndex;\n\n        void main() {\n            vec3 positionUpdated = position;\n\n            #include<instancesVertex>\n            #include<bonesVertex>\n\n            vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n            vec3 color = colorBase;\n            float totalWeight = 0.;\n            if(matricesIndices[0] == targetBoneIndex && matricesWeights[0] > 0.){\n                totalWeight += matricesWeights[0];\n            }\n            if(matricesIndices[1] == targetBoneIndex && matricesWeights[1] > 0.){\n                totalWeight += matricesWeights[1];\n            }\n            if(matricesIndices[2] == targetBoneIndex && matricesWeights[2] > 0.){\n                totalWeight += matricesWeights[2];\n            }\n            if(matricesIndices[3] == targetBoneIndex && matricesWeights[3] > 0.){\n                totalWeight += matricesWeights[3];\n            }\n\n            color = mix(color, colorZero, smoothstep(0., 0.25, totalWeight));\n            color = mix(color, colorQuarter, smoothstep(0.25, 0.5, totalWeight));\n            color = mix(color, colorHalf, smoothstep(0.5, 0.75, totalWeight));\n            color = mix(color, colorFull, smoothstep(0.75, 1.0, totalWeight));\n            vColor = color;\n\n        gl_Position = projection * view * worldPos;\n        }`, ae.a.ShadersStore[\"boneWeights:\" + Z.name + \"FragmentShader\"] = `\n            precision highp float;\n            varying vec3 vPosition;\n\n            varying vec3 vColor;\n\n            void main() {\n                vec4 color = vec4(vColor, 1.0);\n                gl_FragColor = color;\n            }\n        `;\n            var ye = new te.a(\"boneWeight:\" + Z.name, G, { vertex: \"boneWeights:\" + Z.name, fragment: \"boneWeights:\" + Z.name }, { attributes: [\"position\", \"normal\", \"matricesIndices\", \"matricesWeights\"], uniforms: [\"world\", \"worldView\", \"worldViewProjection\", \"view\", \"projection\", \"viewProjection\", \"colorBase\", \"colorZero\", \"colorQuarter\", \"colorHalf\", \"colorFull\", \"targetBoneIndex\"] });\n            return ye.setColor3(\"colorBase\", W), ye.setColor3(\"colorZero\", q), ye.setColor3(\"colorQuarter\", he), ye.setColor3(\"colorHalf\", ge), ye.setColor3(\"colorFull\", me), ye.setFloat(\"targetBoneIndex\", _e), ye.getClassName = function() {\n              return \"BoneWeightShader\";\n            }, ye.transparencyMode = ne.a.MATERIAL_OPAQUE, ye;\n          }, $.CreateSkeletonMapShader = function(L, G) {\n            var Q, oe = L.skeleton, re = (Q = L.colorMap) !== null && Q !== void 0 ? Q : [{ color: new I.a(1, 0.38, 0.18), location: 0 }, { color: new I.a(0.59, 0.18, 1), location: 0.2 }, { color: new I.a(0.59, 1, 0.18), location: 0.4 }, { color: new I.a(1, 0.87, 0.17), location: 0.6 }, { color: new I.a(1, 0.17, 0.42), location: 0.8 }, { color: new I.a(0.17, 0.68, 1), location: 1 }], Y = oe.bones.length + 1, k = $._CreateBoneMapColorBuffer(Y, re, G), H = new te.a(\"boneWeights:\" + oe.name, G, { vertexSource: `precision highp float;\n\n            attribute vec3 position;\n            attribute vec2 uv;\n\n            uniform mat4 view;\n            uniform mat4 projection;\n            uniform mat4 worldViewProjection;\n            uniform float colorMap[` + 4 * oe.bones.length + `];\n\n            #include<bonesDeclaration>\n            #if NUM_BONE_INFLUENCERS == 0\n                attribute vec4 matricesIndices;\n                attribute vec4 matricesWeights;\n            #endif\n            #include<instancesDeclaration>\n\n            varying vec3 vColor;\n\n            void main() {\n                vec3 positionUpdated = position;\n\n                #include<instancesVertex>\n                #include<bonesVertex>\n\n                vec3 color = vec3(0.);\n                bool first = true;\n\n                for (int i = 0; i < 4; i++) {\n                    int boneIdx = int(matricesIndices[i]);\n                    float boneWgt = matricesWeights[i];\n\n                    vec3 c = vec3(colorMap[boneIdx * 4 + 0], colorMap[boneIdx * 4 + 1], colorMap[boneIdx * 4 + 2]);\n\n                    if (boneWgt > 0.) {\n                        if (first) {\n                            first = false;\n                            color = c;\n                        } else {\n                            color = mix(color, c, boneWgt);\n                        }\n                    }\n                }\n\n                vColor = color;\n\n                vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\n\n                gl_Position = projection * view * worldPos;\n            }`, fragmentSource: `\n            precision highp float;\n            varying vec3 vColor;\n\n            void main() {\n                vec4 color = vec4( vColor, 1.0 );\n                gl_FragColor = color;\n            }\n            ` }, { attributes: [\"position\", \"normal\", \"matricesIndices\", \"matricesWeights\"], uniforms: [\"world\", \"worldView\", \"worldViewProjection\", \"view\", \"projection\", \"viewProjection\", \"colorMap\"] });\n            return H.setFloats(\"colorMap\", k), H.getClassName = function() {\n              return \"SkeletonMapShader\";\n            }, H.transparencyMode = ne.a.MATERIAL_OPAQUE, H;\n          }, $._CreateBoneMapColorBuffer = function(L, G, Q) {\n            var oe = new de.a(\"temp\", { width: L, height: 1 }, Q, !1), re = oe.getContext(), Y = re.createLinearGradient(0, 0, L, 0);\n            G.forEach(function(W) {\n              Y.addColorStop(W.location, W.color.toHexString());\n            }), re.fillStyle = Y, re.fillRect(0, 0, L, 1), oe.update();\n            for (var k = [], H = re.getImageData(0, 0, L, 1).data, Z = 0; Z < H.length; Z++)\n              k.push(H[Z] * (1 / 255));\n            return oe.dispose(), k;\n          }, Object.defineProperty($.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"utilityLayer\", { get: function() {\n            return this._utilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"isReady\", { get: function() {\n            return this._ready;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"ready\", { set: function(L) {\n            this._ready = L;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"debugMesh\", { get: function() {\n            return this._debugMesh;\n          }, set: function(L) {\n            this._debugMesh = L;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty($.prototype, \"displayMode\", { get: function() {\n            return this.options.displayMode || $.DISPLAY_LINES;\n          }, set: function(L) {\n            L > $.DISPLAY_SPHERE_AND_SPURS && (L = $.DISPLAY_LINES), this.options.displayMode = L;\n          }, enumerable: !1, configurable: !0 }), $.prototype._bindObs = function() {\n            var L = this;\n            switch (this.displayMode) {\n              case $.DISPLAY_LINES:\n                this._obs = this.scene.onBeforeRenderObservable.add(function() {\n                  L._displayLinesUpdate();\n                });\n            }\n          }, $.prototype.update = function() {\n            switch (this.displayMode) {\n              case $.DISPLAY_LINES:\n                this._displayLinesUpdate();\n                break;\n              case $.DISPLAY_SPHERES:\n                this._buildSpheresAndSpurs(!0);\n                break;\n              case $.DISPLAY_SPHERE_AND_SPURS:\n                this._buildSpheresAndSpurs(!1);\n            }\n            this._buildLocalAxes();\n          }, Object.defineProperty($.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(L) {\n            this.isEnabled !== L && (this._isEnabled = L, this.debugMesh && this.debugMesh.setEnabled(L), L && !this._obs ? this._bindObs() : !L && this._obs && (this.scene.onBeforeRenderObservable.remove(this._obs), this._obs = null));\n          }, enumerable: !1, configurable: !0 }), $.prototype._getBonePosition = function(L, G, Q, oe, re, Y) {\n            oe === void 0 && (oe = 0), re === void 0 && (re = 0), Y === void 0 && (Y = 0);\n            var k = _.c.Matrix[0], H = G.getParent();\n            if (k.copyFrom(G.getLocalMatrix()), oe !== 0 || re !== 0 || Y !== 0) {\n              var Z = _.c.Matrix[1];\n              _.a.IdentityToRef(Z), Z.setTranslationFromFloats(oe, re, Y), Z.multiplyToRef(k, k);\n            }\n            H && k.multiplyToRef(H.getAbsoluteTransform(), k), k.multiplyToRef(Q, k), L.x = k.m[12], L.y = k.m[13], L.z = k.m[14];\n          }, $.prototype._getLinesForBonesWithLength = function(L, G) {\n            for (var Q = L.length, oe = this.mesh._effectiveMesh.position, re = 0, Y = 0; Y < Q; Y++) {\n              var k = L[Y], H = this._debugLines[re];\n              k._index !== -1 && (this._boneIndices.has(k.getIndex()) || this.options.useAllBones) && (H || (H = [_.e.Zero(), _.e.Zero()], this._debugLines[re] = H), this._getBonePosition(H[0], k, G), this._getBonePosition(H[1], k, G, 0, k.length, 0), H[0].subtractInPlace(oe), H[1].subtractInPlace(oe), re++);\n            }\n          }, $.prototype._getLinesForBonesNoLength = function(L) {\n            for (var G = L.length, Q = 0, oe = this.mesh._effectiveMesh, re = oe.position, Y = G - 1; Y >= 0; Y--) {\n              var k = L[Y], H = k.getParent();\n              if (H && (this._boneIndices.has(k.getIndex()) || this.options.useAllBones)) {\n                var Z = this._debugLines[Q];\n                Z || (Z = [_.e.Zero(), _.e.Zero()], this._debugLines[Q] = Z), k.getAbsolutePositionToRef(oe, Z[0]), H.getAbsolutePositionToRef(oe, Z[1]), Z[0].subtractInPlace(re), Z[1].subtractInPlace(re), Q++;\n              }\n            }\n          }, $.prototype._revert = function(L) {\n            this.options.pauseAnimations && (this.scene.animationsEnabled = L, this.utilityLayer.utilityLayerScene.animationsEnabled = L);\n          }, $.prototype._getAbsoluteBindPoseToRef = function(L, G) {\n            L !== null && L._index !== -1 ? (this._getAbsoluteBindPoseToRef(L.getParent(), G), L.getBindPose().multiplyToRef(G, G)) : G.copyFrom(_.a.Identity());\n          }, $.prototype._buildSpheresAndSpurs = function(L) {\n            var G, Q;\n            L === void 0 && (L = !0), this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this._ready = !1;\n            var oe = (G = this.utilityLayer) === null || G === void 0 ? void 0 : G.utilityLayerScene, re = this.skeleton.bones, Y = [], k = [], H = this.scene.animationsEnabled;\n            try {\n              this.options.pauseAnimations && (this.scene.animationsEnabled = !1, oe.animationsEnabled = !1), this.options.returnToRest && this.skeleton.returnToRest(), this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms();\n              for (var Z = Number.NEGATIVE_INFINITY, W = this.options.displayOptions || {}, q = function(He) {\n                var Qe = re[He];\n                if (Qe._index === -1 || !he._boneIndices.has(Qe.getIndex()) && !he.options.useAllBones)\n                  return \"continue\";\n                var Ge = new _.a();\n                he._getAbsoluteBindPoseToRef(Qe, Ge);\n                var tt = new _.e();\n                Ge.decompose(void 0, void 0, tt), Qe.children.forEach(function(Ot, St) {\n                  var Ct = new _.a();\n                  Ot.getBindPose().multiplyToRef(Ge, Ct);\n                  var nn = new _.e();\n                  Ct.decompose(void 0, void 0, nn);\n                  var Qt = _.e.Distance(tt, nn);\n                  if (Qt > Z && (Z = Qt), !L) {\n                    for (var $t = nn.clone().subtract(tt.clone()), Ie = $t.length(), Sn = $t.normalize().scale(Ie), en = W.midStep || 0.165, An = W.midStepFactor || 0.215, Ue = Sn.scale(en), Pn = ee.a.ExtrudeShapeCustom(\"skeletonViewer\", { shape: [new _.e(1, -1, 0), new _.e(1, 1, 0), new _.e(-1, 1, 0), new _.e(-1, -1, 0), new _.e(1, -1, 0)], path: [_.e.Zero(), Ue, Sn], scaleFunction: function(So) {\n                      switch (So) {\n                        case 0:\n                        case 2:\n                          return 0;\n                        case 1:\n                          return Ie * An;\n                      }\n                      return 0;\n                    }, sideOrientation: h.a.DEFAULTSIDE, updatable: !1 }, oe), rr = Pn.getTotalVertices(), Xe = [], En = [], Qn = 0; Qn < rr; Qn++)\n                      Xe.push(1, 0, 0, 0), W.spurFollowsChild && Qn > 9 ? En.push(Ot.getIndex(), 0, 0, 0) : En.push(Qe.getIndex(), 0, 0, 0);\n                    Pn.position = tt.clone(), Pn.setVerticesData(pe.b.MatricesWeightsKind, Xe, !1), Pn.setVerticesData(pe.b.MatricesIndicesKind, En, !1), Pn.convertToFlatShadedMesh(), k.push(Pn);\n                  }\n                });\n                for (var Je = W.sphereBaseSize || 0.2, st = b.a.CreateSphere(\"skeletonViewer\", { segments: 6, diameter: Je, updatable: !0 }, oe), at = st.getTotalVertices(), pt = [], Tt = [], Lt = 0; Lt < at; Lt++)\n                  pt.push(1, 0, 0, 0), Tt.push(Qe.getIndex(), 0, 0, 0);\n                st.setVerticesData(pe.b.MatricesWeightsKind, pt, !1), st.setVerticesData(pe.b.MatricesIndicesKind, Tt, !1), st.position = tt.clone(), Y.push([st, Qe]);\n              }, he = this, ge = 0; ge < re.length; ge++)\n                q(ge);\n              var me = W.sphereScaleUnit || 2, _e = W.sphereFactor || 0.85, ye = [];\n              for (ge = 0; ge < Y.length; ge++) {\n                for (var Pe = Y[ge], be = Pe[0], Fe = Pe[1], ke = 1 / (me / Z), We = 0, je = Fe; je.getParent() && je.getParent().getIndex() !== -1; )\n                  We++, je = je.getParent();\n                be.scaling.scaleInPlace(ke * Math.pow(_e, We)), ye.push(be);\n              }\n              this.debugMesh = h.a.MergeMeshes(ye.concat(k), !0, !0), this.debugMesh && (this.debugMesh.renderingGroupId = this.renderingGroupId, this.debugMesh.skeleton = this.skeleton, this.debugMesh.parent = this.mesh, this.debugMesh.computeBonesUsingShaders = (Q = this.options.computeBonesUsingShaders) === null || Q === void 0 || Q, this.debugMesh.alwaysSelectAsActiveMesh = !0), this.utilityLayer._getSharedGizmoLight().intensity = 0.7, this._revert(H), this.ready = !0;\n            } catch (He) {\n              console.error(He), this._revert(H), this.dispose();\n            }\n          }, $.prototype._buildLocalAxes = function() {\n            var L;\n            this._localAxes && this._localAxes.dispose(), this._localAxes = null;\n            var G = this.options.displayOptions || {};\n            if (G.showLocalAxes) {\n              var Q = this._utilityLayer.utilityLayerScene, oe = G.localAxesSize || 0.075, re = [], Y = [], k = new I.b(1, 0, 0, 1), H = new I.b(0, 1, 0, 1), Z = new I.b(0, 0, 1, 1), W = [], q = [];\n              for (var he in this.skeleton.bones) {\n                var ge = this.skeleton.bones[he];\n                if (ge._index !== -1 && (this._boneIndices.has(ge.getIndex()) || this.options.useAllBones)) {\n                  var me = new _.a(), _e = new _.e();\n                  this._getAbsoluteBindPoseToRef(ge, me), me.decompose(void 0, void 0, _e);\n                  var ye = ge.getBindPose().getRotationMatrix(), Pe = _.e.TransformCoordinates(new _.e(0 + oe, 0, 0), ye), be = _.e.TransformCoordinates(new _.e(0, 0 + oe, 0), ye), Fe = _.e.TransformCoordinates(new _.e(0, 0, 0 + oe), ye), ke = [[_e, _e.add(Pe)], [_e, _e.add(be)], [_e, _e.add(Fe)]], We = [[k, k], [H, H], [Z, Z]];\n                  re.push.apply(re, ke), Y.push.apply(Y, We);\n                  for (var je = 0; je < 6; je++)\n                    W.push(1, 0, 0, 0), q.push(ge.getIndex(), 0, 0, 0);\n                }\n              }\n              this._localAxes = X.a.CreateLineSystem(\"localAxes\", { lines: re, colors: Y, updatable: !0 }, Q), this._localAxes.setVerticesData(pe.b.MatricesWeightsKind, W, !1), this._localAxes.setVerticesData(pe.b.MatricesIndicesKind, q, !1), this._localAxes.skeleton = this.skeleton, this._localAxes.renderingGroupId = this.renderingGroupId, this._localAxes.parent = this.mesh, this._localAxes.computeBonesUsingShaders = (L = this.options.computeBonesUsingShaders) === null || L === void 0 || L;\n            }\n          }, $.prototype._displayLinesUpdate = function() {\n            if (this._utilityLayer) {\n              this.autoUpdateBonesMatrices && this.skeleton.computeAbsoluteTransforms();\n              var L = this.mesh._effectiveMesh;\n              this.skeleton.bones[0].length === void 0 ? this._getLinesForBonesNoLength(this.skeleton.bones) : this._getLinesForBonesWithLength(this.skeleton.bones, L.getWorldMatrix());\n              var G = this._utilityLayer.utilityLayerScene;\n              G && (this._debugMesh ? X.a.CreateLineSystem(\"\", { lines: this._debugLines, updatable: !0, instance: this._debugMesh }, G) : (this._debugMesh = X.a.CreateLineSystem(\"\", { lines: this._debugLines, updatable: !0, instance: null }, G), this._debugMesh.renderingGroupId = this.renderingGroupId), this._debugMesh.position.copyFrom(this.mesh.position), this._debugMesh.color = this.color);\n            }\n          }, $.prototype.changeDisplayMode = function(L) {\n            var G = !!this.isEnabled;\n            this.displayMode !== L && (this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.displayMode = L, this.update(), this._bindObs(), this.isEnabled = G);\n          }, $.prototype.changeDisplayOptions = function(L, G) {\n            var Q = !!this.isEnabled;\n            this.options.displayOptions[L] = G, this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null, this.ready = !1), this.update(), this._bindObs(), this.isEnabled = Q;\n          }, $.prototype.dispose = function() {\n            this.isEnabled = !1, this._debugMesh && (this._debugMesh.dispose(), this._debugMesh = null), this._utilityLayer && (this._utilityLayer.dispose(), this._utilityLayer = null), this.ready = !1;\n          }, $.DISPLAY_LINES = 0, $.DISPLAY_SPHERES = 1, $.DISPLAY_SPHERE_AND_SPURS = 2, $;\n        }();\n      }, function(Be, A, f) {\n        var V = \"morphTargetsVertex\", _ = `#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_UV\nuvUpdated+=(uv_{X}-uv)*morphTargetInfluences[{X}];\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"b\", function() {\n          return _;\n        }), f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(0);\n        function _(u, I, O, x, m) {\n          m === void 0 && (m = null);\n          for (var c = new V.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), T = new V.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), S = O; S < O + x; S++) {\n            var E = 3 * I[S], g = u[E], l = u[E + 1], h = u[E + 2];\n            c.minimizeInPlaceFromFloats(g, l, h), T.maximizeInPlaceFromFloats(g, l, h);\n          }\n          return m && (c.x -= c.x * m.x + m.y, c.y -= c.y * m.x + m.y, c.z -= c.z * m.x + m.y, T.x += T.x * m.x + m.y, T.y += T.y * m.x + m.y, T.z += T.z * m.x + m.y), { minimum: c, maximum: T };\n        }\n        function C(u, I, O, x, m) {\n          x === void 0 && (x = null);\n          var c = new V.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), T = new V.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n          m || (m = 3);\n          for (var S = I, E = I * m; S < I + O; S++, E += m) {\n            var g = u[E], l = u[E + 1], h = u[E + 2];\n            c.minimizeInPlaceFromFloats(g, l, h), T.maximizeInPlaceFromFloats(g, l, h);\n          }\n          return x && (c.x -= c.x * x.x + x.y, c.y -= c.y * x.x + x.y, c.z -= c.z * x.x + x.y, T.x += T.x * x.x + x.y, T.y += T.y * x.x + x.y, T.z += T.z * x.x + x.y), { minimum: c, maximum: T };\n        }\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(44), _ = f(0), C = f(28), u = function() {\n          function I(O, x, m) {\n            this.vectors = V.a.BuildArray(8, _.e.Zero), this.center = _.e.Zero(), this.centerWorld = _.e.Zero(), this.extendSize = _.e.Zero(), this.extendSizeWorld = _.e.Zero(), this.directions = V.a.BuildArray(3, _.e.Zero), this.vectorsWorld = V.a.BuildArray(8, _.e.Zero), this.minimumWorld = _.e.Zero(), this.maximumWorld = _.e.Zero(), this.minimum = _.e.Zero(), this.maximum = _.e.Zero(), this.reConstruct(O, x, m);\n          }\n          return I.prototype.reConstruct = function(O, x, m) {\n            var c = O.x, T = O.y, S = O.z, E = x.x, g = x.y, l = x.z, h = this.vectors;\n            this.minimum.copyFromFloats(c, T, S), this.maximum.copyFromFloats(E, g, l), h[0].copyFromFloats(c, T, S), h[1].copyFromFloats(E, g, l), h[2].copyFromFloats(E, T, S), h[3].copyFromFloats(c, g, S), h[4].copyFromFloats(c, T, l), h[5].copyFromFloats(E, g, S), h[6].copyFromFloats(c, g, l), h[7].copyFromFloats(E, T, l), x.addToRef(O, this.center).scaleInPlace(0.5), x.subtractToRef(O, this.extendSize).scaleInPlace(0.5), this._worldMatrix = m || _.a.IdentityReadOnly, this._update(this._worldMatrix);\n          }, I.prototype.scale = function(O) {\n            var x = I.TmpVector3, m = this.maximum.subtractToRef(this.minimum, x[0]), c = m.length();\n            m.normalizeFromLength(c);\n            var T = c * O, S = m.scaleInPlace(0.5 * T), E = this.center.subtractToRef(S, x[1]), g = this.center.addToRef(S, x[2]);\n            return this.reConstruct(E, g, this._worldMatrix), this;\n          }, I.prototype.getWorldMatrix = function() {\n            return this._worldMatrix;\n          }, I.prototype._update = function(O) {\n            var x = this.minimumWorld, m = this.maximumWorld, c = this.directions, T = this.vectorsWorld, S = this.vectors;\n            if (O.isIdentity()) {\n              for (x.copyFrom(this.minimum), m.copyFrom(this.maximum), E = 0; E < 8; ++E)\n                T[E].copyFrom(S[E]);\n              this.extendSizeWorld.copyFrom(this.extendSize), this.centerWorld.copyFrom(this.center);\n            } else {\n              x.setAll(Number.MAX_VALUE), m.setAll(-Number.MAX_VALUE);\n              for (var E = 0; E < 8; ++E) {\n                var g = T[E];\n                _.e.TransformCoordinatesToRef(S[E], O, g), x.minimizeInPlace(g), m.maximizeInPlace(g);\n              }\n              m.subtractToRef(x, this.extendSizeWorld).scaleInPlace(0.5), m.addToRef(x, this.centerWorld).scaleInPlace(0.5);\n            }\n            _.e.FromArrayToRef(O.m, 0, c[0]), _.e.FromArrayToRef(O.m, 4, c[1]), _.e.FromArrayToRef(O.m, 8, c[2]), this._worldMatrix = O;\n          }, I.prototype.isInFrustum = function(O) {\n            return I.IsInFrustum(this.vectorsWorld, O);\n          }, I.prototype.isCompletelyInFrustum = function(O) {\n            return I.IsCompletelyInFrustum(this.vectorsWorld, O);\n          }, I.prototype.intersectsPoint = function(O) {\n            var x = this.minimumWorld, m = this.maximumWorld, c = x.x, T = x.y, S = x.z, E = m.x, g = m.y, l = m.z, h = O.x, v = O.y, b = O.z, D = -C.a;\n            return !(E - h < D || D > h - c) && !(g - v < D || D > v - T) && !(l - b < D || D > b - S);\n          }, I.prototype.intersectsSphere = function(O) {\n            return I.IntersectsSphere(this.minimumWorld, this.maximumWorld, O.centerWorld, O.radiusWorld);\n          }, I.prototype.intersectsMinMax = function(O, x) {\n            var m = this.minimumWorld, c = this.maximumWorld, T = m.x, S = m.y, E = m.z, g = c.x, l = c.y, h = c.z, v = O.x, b = O.y, D = O.z, w = x.x, N = x.y, M = x.z;\n            return !(g < v || T > w) && !(l < b || S > N) && !(h < D || E > M);\n          }, I.Intersects = function(O, x) {\n            return O.intersectsMinMax(x.minimumWorld, x.maximumWorld);\n          }, I.IntersectsSphere = function(O, x, m, c) {\n            var T = I.TmpVector3[0];\n            return _.e.ClampToRef(m, O, x, T), _.e.DistanceSquared(m, T) <= c * c;\n          }, I.IsCompletelyInFrustum = function(O, x) {\n            for (var m = 0; m < 6; ++m)\n              for (var c = x[m], T = 0; T < 8; ++T)\n                if (c.dotCoordinate(O[T]) < 0)\n                  return !1;\n            return !0;\n          }, I.IsInFrustum = function(O, x) {\n            for (var m = 0; m < 6; ++m) {\n              for (var c = !0, T = x[m], S = 0; S < 8; ++S)\n                if (T.dotCoordinate(O[S]) >= 0) {\n                  c = !1;\n                  break;\n                }\n              if (c)\n                return !1;\n            }\n            return !0;\n          }, I.TmpVector3 = V.a.BuildArray(3, _.e.Zero), I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(38), _ = function() {\n          function C() {\n          }\n          return C.SetImmediate = function(u) {\n            V.a.IsWindowObjectExist() && window.setImmediate ? window.setImmediate(u) : setTimeout(u, 1);\n          }, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(0), _ = f(2), C = function() {\n          function u() {\n            this.previousWorldMatrices = {}, this.previousBones = {};\n          }\n          return u.AddUniforms = function(I) {\n            I.push(\"previousWorld\", \"previousViewProjection\");\n          }, u.AddSamplers = function(I) {\n          }, u.prototype.bindForSubMesh = function(I, O, x, m, c) {\n            O.prePassRenderer && O.prePassRenderer.enabled && O.prePassRenderer.getIndex(_.a.PREPASS_VELOCITY_TEXTURE_TYPE) !== -1 && (this.previousWorldMatrices[x.uniqueId] || (this.previousWorldMatrices[x.uniqueId] = V.a.Identity()), this.previousViewProjection || (this.previousViewProjection = O.getTransformMatrix()), I.setMatrix(\"previousWorld\", this.previousWorldMatrices[x.uniqueId]), I.setMatrix(\"previousViewProjection\", this.previousViewProjection), this.previousWorldMatrices[x.uniqueId] = m.clone(), this.previousViewProjection = O.getTransformMatrix().clone());\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        var V = \"lightFragmentDeclaration\", _ = `#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec4 vLightSpecular{X};\n#else\nvec4 vLightSpecular{X}=vec4(0.);\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\nuniform vec4 vLightFalloff{X};\n#elif defined(POINTLIGHT{X})\nuniform vec4 vLightFalloff{X};\n#elif defined(HEMILIGHT{X})\nuniform vec3 vLightGround{X};\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"lightUboDeclaration\", _ = `#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec4 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\nvec4 vLightFalloff;\n#elif defined(POINTLIGHT{X})\nvec4 vLightFalloff;\n#elif defined(HEMILIGHT{X})\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef PROJECTEDLIGHTTEXTURE{X}\nuniform mat4 textureProjectionMatrix{X};\nuniform sampler2D projectionLightSampler{X};\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nuniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float frustumLengths{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float cascadeBlendFactor{X};\nvarying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];\nvarying vec4 vPositionFromCamera{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\nuniform highp sampler2DArray depthSampler{X};\nuniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];\nuniform float penumbraDarkness{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DArrayShadow shadowSampler{X};\n#else\nuniform highp sampler2DArray shadowSampler{X};\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nconst vec3 vCascadeColorsMultiplier{X}[8]=vec3[8]\n(\nvec3 ( 1.5,0.0,0.0 ),\nvec3 ( 0.0,1.5,0.0 ),\nvec3 ( 0.0,0.0,5.5 ),\nvec3 ( 1.5,0.0,5.5 ),\nvec3 ( 1.5,1.5,0.0 ),\nvec3 ( 1.0,1.0,1.0 ),\nvec3 ( 0.0,1.0,5.5 ),\nvec3 ( 0.5,3.5,0.75 )\n);\nvec3 shadowDebug{X};\n#endif\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nint index{X}=-1;\n#else\nint index{X}=SHADOWCSMNUM_CASCADES{X}-1;\n#endif\nfloat diff{X}=0.;\n#elif defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\n#if defined(SHADOWPCSS{X})\nuniform highp sampler2DShadow shadowSampler{X};\nuniform highp sampler2D depthSampler{X};\n#elif defined(SHADOWPCF{X})\nuniform highp sampler2DShadow shadowSampler{X};\n#else\nuniform sampler2D shadowSampler{X};\n#endif\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"imageProcessingDeclaration\", _ = `#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"imageProcessingFunctions\", _ = `#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\n#define inline\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{\nfloat sliceSize=2.0*sampler3dSetting.x;\n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;\nsliceUV.x+=sliceInteger*sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice0Color=texture2D(colorTransform,sliceUV);\nsliceUV.x+=sliceSize;\nsliceUV=saturate(sliceUV);\nvec4 slice1Color=texture2D(colorTransform,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;\n}\n#endif\n#ifdef TONEMAPPING_ACES\n\n\n\n\n\nconst mat3 ACESInputMat=mat3(\nvec3(0.59719,0.07600,0.02840),\nvec3(0.35458,0.90834,0.13383),\nvec3(0.04823,0.01566,0.83777)\n);\n\nconst mat3 ACESOutputMat=mat3(\nvec3( 1.60475,-0.10208,-0.00327),\nvec3(-0.53108,1.10813,-0.07276),\nvec3(-0.07367,-0.00605,1.07602)\n);\nvec3 RRTAndODTFit(vec3 v)\n{\nvec3 a=v*(v+0.0245786)-0.000090537;\nvec3 b=v*(0.983729*v+0.4329510)+0.238081;\nreturn a/b;\n}\nvec3 ACESFitted(vec3 color)\n{\ncolor=ACESInputMat*color;\n\ncolor=RRTAndODTFit(color);\ncolor=ACESOutputMat*color;\n\ncolor=saturate(color);\nreturn color;\n}\n#endif\nvec4 applyImageProcessing(vec4 result) {\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\n\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;\nviewportXY=viewportXY*2.0-1.0;\nvec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);\nfloat vignetteTerm=dot(vignetteXY1,vignetteXY1);\nfloat vignette=pow(vignetteTerm,vignetteSettings2.w);\n\nvec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);\nresult.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#ifdef TONEMAPPING\n#ifdef TONEMAPPING_ACES\nresult.rgb=ACESFitted(result.rgb);\n#else\nconst float tonemappingCalibration=1.590579;\nresult.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\n#endif\n\nresult.rgb=toGammaSpace(result.rgb);\nresult.rgb=saturate(result.rgb);\n#ifdef CONTRAST\n\nvec3 resultHighContrast=result.rgb*result.rgb*(3.0-2.0*result.rgb);\nif (contrast<1.0) {\n\nresult.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);\n} else {\n\nresult.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);\n}\n#endif\n\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\n\nfloat luma=getLuminance(result.rgb);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\nreturn result;\n}`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"clipPlaneFragment\", _ = `#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE2\nif (fClipDistance2>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE3\nif (fClipDistance3>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE4\nif (fClipDistance4>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE5\nif (fClipDistance5>0.0)\n{\ndiscard;\n}\n#endif\n#ifdef CLIPPLANE6\nif (fClipDistance6>0.0)\n{\ndiscard;\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"clipPlaneVertex\", _ = `#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif\n#ifdef CLIPPLANE2\nfClipDistance2=dot(worldPos,vClipPlane2);\n#endif\n#ifdef CLIPPLANE3\nfClipDistance3=dot(worldPos,vClipPlane3);\n#endif\n#ifdef CLIPPLANE4\nfClipDistance4=dot(worldPos,vClipPlane4);\n#endif\n#ifdef CLIPPLANE5\nfClipDistance5=dot(worldPos,vClipPlane5);\n#endif\n#ifdef CLIPPLANE6\nfClipDistance6=dot(worldPos,vClipPlane6);\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._count = 0, this._data = {};\n          }\n          return _.prototype.copyFrom = function(C) {\n            var u = this;\n            this.clear(), C.forEach(function(I, O) {\n              return u.add(I, O);\n            });\n          }, _.prototype.get = function(C) {\n            var u = this._data[C];\n            if (u !== void 0)\n              return u;\n          }, _.prototype.getOrAddWithFactory = function(C, u) {\n            var I = this.get(C);\n            return I !== void 0 || (I = u(C)) && this.add(C, I), I;\n          }, _.prototype.getOrAdd = function(C, u) {\n            var I = this.get(C);\n            return I !== void 0 ? I : (this.add(C, u), u);\n          }, _.prototype.contains = function(C) {\n            return this._data[C] !== void 0;\n          }, _.prototype.add = function(C, u) {\n            return this._data[C] === void 0 && (this._data[C] = u, ++this._count, !0);\n          }, _.prototype.set = function(C, u) {\n            return this._data[C] !== void 0 && (this._data[C] = u, !0);\n          }, _.prototype.getAndRemove = function(C) {\n            var u = this.get(C);\n            return u !== void 0 ? (delete this._data[C], --this._count, u) : null;\n          }, _.prototype.remove = function(C) {\n            return !!this.contains(C) && (delete this._data[C], --this._count, !0);\n          }, _.prototype.clear = function() {\n            this._data = {}, this._count = 0;\n          }, Object.defineProperty(_.prototype, \"count\", { get: function() {\n            return this._count;\n          }, enumerable: !1, configurable: !0 }), _.prototype.forEach = function(C) {\n            for (var u in this._data)\n              C(u, this._data[u]);\n          }, _.prototype.first = function(C) {\n            for (var u in this._data) {\n              var I = C(u, this._data[u]);\n              if (I)\n                return I;\n            }\n            return null;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(44), _ = f(0), C = function() {\n          function u(I, O, x) {\n            this.center = _.e.Zero(), this.centerWorld = _.e.Zero(), this.minimum = _.e.Zero(), this.maximum = _.e.Zero(), this.reConstruct(I, O, x);\n          }\n          return u.prototype.reConstruct = function(I, O, x) {\n            this.minimum.copyFrom(I), this.maximum.copyFrom(O);\n            var m = _.e.Distance(I, O);\n            O.addToRef(I, this.center).scaleInPlace(0.5), this.radius = 0.5 * m, this._update(x || _.a.IdentityReadOnly);\n          }, u.prototype.scale = function(I) {\n            var O = this.radius * I, x = u.TmpVector3, m = x[0].setAll(O), c = this.center.subtractToRef(m, x[1]), T = this.center.addToRef(m, x[2]);\n            return this.reConstruct(c, T, this._worldMatrix), this;\n          }, u.prototype.getWorldMatrix = function() {\n            return this._worldMatrix;\n          }, u.prototype._update = function(I) {\n            if (I.isIdentity())\n              this.centerWorld.copyFrom(this.center), this.radiusWorld = this.radius;\n            else {\n              _.e.TransformCoordinatesToRef(this.center, I, this.centerWorld);\n              var O = u.TmpVector3[0];\n              _.e.TransformNormalFromFloatsToRef(1, 1, 1, I, O), this.radiusWorld = Math.max(Math.abs(O.x), Math.abs(O.y), Math.abs(O.z)) * this.radius;\n            }\n          }, u.prototype.isInFrustum = function(I) {\n            for (var O = this.centerWorld, x = this.radiusWorld, m = 0; m < 6; m++)\n              if (I[m].dotCoordinate(O) <= -x)\n                return !1;\n            return !0;\n          }, u.prototype.isCenterInFrustum = function(I) {\n            for (var O = this.centerWorld, x = 0; x < 6; x++)\n              if (I[x].dotCoordinate(O) < 0)\n                return !1;\n            return !0;\n          }, u.prototype.intersectsPoint = function(I) {\n            var O = _.e.DistanceSquared(this.centerWorld, I);\n            return !(this.radiusWorld * this.radiusWorld < O);\n          }, u.Intersects = function(I, O) {\n            var x = _.e.DistanceSquared(I.centerWorld, O.centerWorld), m = I.radiusWorld + O.radiusWorld;\n            return !(m * m < x);\n          }, u.TmpVector3 = V.a.BuildArray(3, _.e.Zero), u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function(_, C, u) {\n          this.bu = _, this.bv = C, this.distance = u, this.faceId = 0, this.subMeshId = 0;\n        };\n      }, function(Be, A, f) {\n        var V = \"clipPlaneFragmentDeclaration\", _ = `#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nvarying float fClipDistance6;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"logDepthDeclaration\", _ = `#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"clipPlaneVertexDeclaration\", _ = `#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nvarying float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nvarying float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nvarying float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nvarying float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nvarying float fClipDistance6;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.prototype.attributeProcessor = function(C) {\n            return C.replace(\"attribute\", \"in\");\n          }, _.prototype.varyingProcessor = function(C, u) {\n            return C.replace(\"varying\", u ? \"in\" : \"out\");\n          }, _.prototype.postProcessor = function(C, u, I) {\n            var O = C.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;\n            if (C = (C = C.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g, \"\")).replace(/texture2D\\s*\\(/g, \"texture(\"), I)\n              C = (C = (C = (C = (C = (C = (C = C.replace(/texture2DLodEXT\\s*\\(/g, \"textureLod(\")).replace(/textureCubeLodEXT\\s*\\(/g, \"textureLod(\")).replace(/textureCube\\s*\\(/g, \"texture(\")).replace(/gl_FragDepthEXT/g, \"gl_FragDepth\")).replace(/gl_FragColor/g, \"glFragColor\")).replace(/gl_FragData/g, \"glFragData\")).replace(/void\\s+?main\\s*\\(/g, (O ? \"\" : `out vec4 glFragColor;\n`) + \"void main(\");\n            else if (u.indexOf(\"#define MULTIVIEW\") !== -1)\n              return `#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n` + C;\n            return C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.BindClipPlane = function(C, u) {\n            if (u.clipPlane) {\n              var I = u.clipPlane;\n              C.setFloat4(\"vClipPlane\", I.normal.x, I.normal.y, I.normal.z, I.d);\n            }\n            u.clipPlane2 && (I = u.clipPlane2, C.setFloat4(\"vClipPlane2\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane3 && (I = u.clipPlane3, C.setFloat4(\"vClipPlane3\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane4 && (I = u.clipPlane4, C.setFloat4(\"vClipPlane4\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane5 && (I = u.clipPlane5, C.setFloat4(\"vClipPlane5\", I.normal.x, I.normal.y, I.normal.z, I.d)), u.clipPlane6 && (I = u.clipPlane6, C.setFloat4(\"vClipPlane6\", I.normal.x, I.normal.y, I.normal.z, I.d));\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.RandomId = function() {\n            return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(C) {\n              var u = 16 * Math.random() | 0;\n              return (C === \"x\" ? u : 3 & u | 8).toString(16);\n            });\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(1), _ = f(3), C = f(9), u = function() {\n          function I() {\n            this._dirty = !0, this._tempColor = new C.b(0, 0, 0, 0), this._globalCurve = new C.b(0, 0, 0, 0), this._highlightsCurve = new C.b(0, 0, 0, 0), this._midtonesCurve = new C.b(0, 0, 0, 0), this._shadowsCurve = new C.b(0, 0, 0, 0), this._positiveCurve = new C.b(0, 0, 0, 0), this._negativeCurve = new C.b(0, 0, 0, 0), this._globalHue = 30, this._globalDensity = 0, this._globalSaturation = 0, this._globalExposure = 0, this._highlightsHue = 30, this._highlightsDensity = 0, this._highlightsSaturation = 0, this._highlightsExposure = 0, this._midtonesHue = 30, this._midtonesDensity = 0, this._midtonesSaturation = 0, this._midtonesExposure = 0, this._shadowsHue = 30, this._shadowsDensity = 0, this._shadowsSaturation = 0, this._shadowsExposure = 0;\n          }\n          return Object.defineProperty(I.prototype, \"globalHue\", { get: function() {\n            return this._globalHue;\n          }, set: function(O) {\n            this._globalHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"globalDensity\", { get: function() {\n            return this._globalDensity;\n          }, set: function(O) {\n            this._globalDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"globalSaturation\", { get: function() {\n            return this._globalSaturation;\n          }, set: function(O) {\n            this._globalSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"globalExposure\", { get: function() {\n            return this._globalExposure;\n          }, set: function(O) {\n            this._globalExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsHue\", { get: function() {\n            return this._highlightsHue;\n          }, set: function(O) {\n            this._highlightsHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsDensity\", { get: function() {\n            return this._highlightsDensity;\n          }, set: function(O) {\n            this._highlightsDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsSaturation\", { get: function() {\n            return this._highlightsSaturation;\n          }, set: function(O) {\n            this._highlightsSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"highlightsExposure\", { get: function() {\n            return this._highlightsExposure;\n          }, set: function(O) {\n            this._highlightsExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesHue\", { get: function() {\n            return this._midtonesHue;\n          }, set: function(O) {\n            this._midtonesHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesDensity\", { get: function() {\n            return this._midtonesDensity;\n          }, set: function(O) {\n            this._midtonesDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesSaturation\", { get: function() {\n            return this._midtonesSaturation;\n          }, set: function(O) {\n            this._midtonesSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"midtonesExposure\", { get: function() {\n            return this._midtonesExposure;\n          }, set: function(O) {\n            this._midtonesExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsHue\", { get: function() {\n            return this._shadowsHue;\n          }, set: function(O) {\n            this._shadowsHue = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsDensity\", { get: function() {\n            return this._shadowsDensity;\n          }, set: function(O) {\n            this._shadowsDensity = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsSaturation\", { get: function() {\n            return this._shadowsSaturation;\n          }, set: function(O) {\n            this._shadowsSaturation = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"shadowsExposure\", { get: function() {\n            return this._shadowsExposure;\n          }, set: function(O) {\n            this._shadowsExposure = O, this._dirty = !0;\n          }, enumerable: !1, configurable: !0 }), I.prototype.getClassName = function() {\n            return \"ColorCurves\";\n          }, I.Bind = function(O, x, m, c, T) {\n            m === void 0 && (m = \"vCameraColorCurvePositive\"), c === void 0 && (c = \"vCameraColorCurveNeutral\"), T === void 0 && (T = \"vCameraColorCurveNegative\"), O._dirty && (O._dirty = !1, O.getColorGradingDataToRef(O._globalHue, O._globalDensity, O._globalSaturation, O._globalExposure, O._globalCurve), O.getColorGradingDataToRef(O._highlightsHue, O._highlightsDensity, O._highlightsSaturation, O._highlightsExposure, O._tempColor), O._tempColor.multiplyToRef(O._globalCurve, O._highlightsCurve), O.getColorGradingDataToRef(O._midtonesHue, O._midtonesDensity, O._midtonesSaturation, O._midtonesExposure, O._tempColor), O._tempColor.multiplyToRef(O._globalCurve, O._midtonesCurve), O.getColorGradingDataToRef(O._shadowsHue, O._shadowsDensity, O._shadowsSaturation, O._shadowsExposure, O._tempColor), O._tempColor.multiplyToRef(O._globalCurve, O._shadowsCurve), O._highlightsCurve.subtractToRef(O._midtonesCurve, O._positiveCurve), O._midtonesCurve.subtractToRef(O._shadowsCurve, O._negativeCurve)), x && (x.setFloat4(m, O._positiveCurve.r, O._positiveCurve.g, O._positiveCurve.b, O._positiveCurve.a), x.setFloat4(c, O._midtonesCurve.r, O._midtonesCurve.g, O._midtonesCurve.b, O._midtonesCurve.a), x.setFloat4(T, O._negativeCurve.r, O._negativeCurve.g, O._negativeCurve.b, O._negativeCurve.a));\n          }, I.PrepareUniforms = function(O) {\n            O.push(\"vCameraColorCurveNeutral\", \"vCameraColorCurvePositive\", \"vCameraColorCurveNegative\");\n          }, I.prototype.getColorGradingDataToRef = function(O, x, m, c, T) {\n            O != null && (O = I.clamp(O, 0, 360), x = I.clamp(x, -100, 100), m = I.clamp(m, -100, 100), c = I.clamp(c, -100, 100), x = I.applyColorGradingSliderNonlinear(x), x *= 0.5, c = I.applyColorGradingSliderNonlinear(c), x < 0 && (x *= -1, O = (O + 180) % 360), I.fromHSBToRef(O, x, 50 + 0.25 * c, T), T.scaleToRef(2, T), T.a = 1 + 0.01 * m);\n          }, I.applyColorGradingSliderNonlinear = function(O) {\n            O /= 100;\n            var x = Math.abs(O);\n            return x = Math.pow(x, 2), O < 0 && (x *= -1), x *= 100;\n          }, I.fromHSBToRef = function(O, x, m, c) {\n            var T = I.clamp(O, 0, 360), S = I.clamp(x / 100, 0, 1), E = I.clamp(m / 100, 0, 1);\n            if (S === 0)\n              c.r = E, c.g = E, c.b = E;\n            else {\n              T /= 60;\n              var g = Math.floor(T), l = T - g, h = E * (1 - S), v = E * (1 - S * l), b = E * (1 - S * (1 - l));\n              switch (g) {\n                case 0:\n                  c.r = E, c.g = b, c.b = h;\n                  break;\n                case 1:\n                  c.r = v, c.g = E, c.b = h;\n                  break;\n                case 2:\n                  c.r = h, c.g = E, c.b = b;\n                  break;\n                case 3:\n                  c.r = h, c.g = v, c.b = E;\n                  break;\n                case 4:\n                  c.r = b, c.g = h, c.b = E;\n                  break;\n                default:\n                  c.r = E, c.g = h, c.b = v;\n              }\n            }\n            c.a = 1;\n          }, I.clamp = function(O, x, m) {\n            return Math.min(Math.max(O, x), m);\n          }, I.prototype.clone = function() {\n            return _.a.Clone(function() {\n              return new I();\n            }, this);\n          }, I.prototype.serialize = function() {\n            return _.a.Serialize(this);\n          }, I.Parse = function(O) {\n            return _.a.Parse(function() {\n              return new I();\n            }, O, null, null);\n          }, Object(V.c)([Object(_.c)()], I.prototype, \"_globalHue\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_globalDensity\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_globalSaturation\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_globalExposure\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsHue\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsDensity\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsSaturation\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_highlightsExposure\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesHue\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesDensity\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesSaturation\", void 0), Object(V.c)([Object(_.c)()], I.prototype, \"_midtonesExposure\", void 0), I;\n        }();\n        _.a._ColorCurvesParser = u.Parse;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return C;\n        });\n        var V = f(8), _ = f(11), C = function() {\n          function u() {\n          }\n          return u.Instantiate = function(I) {\n            if (this.RegisteredExternalClasses && this.RegisteredExternalClasses[I])\n              return this.RegisteredExternalClasses[I];\n            var O = _.a.GetClass(I);\n            if (O)\n              return O;\n            V.a.Warn(I + \" not found, you may have missed an import.\");\n            for (var x = I.split(\".\"), m = window || this, c = 0, T = x.length; c < T; c++)\n              m = m[x[c]];\n            return typeof m != \"function\" ? null : m;\n          }, u.RegisteredExternalClasses = {}, u;\n        }();\n      }, function(Be, A, f) {\n        var V = f(26), _ = f(2);\n        V.a.prototype.setAlphaConstants = function(C, u, I, O) {\n          this._alphaState.setAlphaBlendConstants(C, u, I, O);\n        }, V.a.prototype.setAlphaMode = function(C, u) {\n          if (u === void 0 && (u = !1), this._alphaMode !== C) {\n            switch (C) {\n              case _.a.ALPHA_DISABLE:\n                this._alphaState.alphaBlend = !1;\n                break;\n              case _.a.ALPHA_PREMULTIPLIED:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_PREMULTIPLIED_PORTERDUFF:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_COMBINE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ONEONE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ADD:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_SUBTRACT:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_MULTIPLY:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_MAXIMIZED:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_INTERPOLATE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_SCREENMODE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ONEONE_ONEONE:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ALPHATOCOLOR:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_REVERSEONEMINUS:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_SRC_DSTONEMINUSSRCALPHA:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_ONEONE_ONEZERO:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO), this._alphaState.alphaBlend = !0;\n                break;\n              case _.a.ALPHA_EXCLUSION:\n                this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE), this._alphaState.alphaBlend = !0;\n            }\n            u || (this.depthCullingState.depthMask = C === _.a.ALPHA_DISABLE), this._alphaMode = C;\n          }\n        }, V.a.prototype.getAlphaMode = function() {\n          return this._alphaMode;\n        }, V.a.prototype.setAlphaEquation = function(C) {\n          if (this._alphaEquation !== C) {\n            switch (C) {\n              case _.a.ALPHA_EQUATION_ADD:\n                this._alphaState.setAlphaEquationParameters(this._gl.FUNC_ADD, this._gl.FUNC_ADD);\n                break;\n              case _.a.ALPHA_EQUATION_SUBSTRACT:\n                this._alphaState.setAlphaEquationParameters(this._gl.FUNC_SUBTRACT, this._gl.FUNC_SUBTRACT);\n                break;\n              case _.a.ALPHA_EQUATION_REVERSE_SUBTRACT:\n                this._alphaState.setAlphaEquationParameters(this._gl.FUNC_REVERSE_SUBTRACT, this._gl.FUNC_REVERSE_SUBTRACT);\n                break;\n              case _.a.ALPHA_EQUATION_MAX:\n                this._alphaState.setAlphaEquationParameters(this._gl.MAX, this._gl.MAX);\n                break;\n              case _.a.ALPHA_EQUATION_MIN:\n                this._alphaState.setAlphaEquationParameters(this._gl.MIN, this._gl.MIN);\n                break;\n              case _.a.ALPHA_EQUATION_DARKEN:\n                this._alphaState.setAlphaEquationParameters(this._gl.MIN, this._gl.FUNC_ADD);\n            }\n            this._alphaEquation = C;\n          }\n        }, V.a.prototype.getAlphaEquation = function() {\n          return this._alphaEquation;\n        };\n      }, function(Be, A, f) {\n        var V = f(26);\n        V.a.prototype.updateDynamicIndexBuffer = function(_, C, u) {\n          var I;\n          this._currentBoundBuffer[this._gl.ELEMENT_ARRAY_BUFFER] = null, this.bindIndexBuffer(_), I = C instanceof Uint16Array || C instanceof Uint32Array ? C : _.is32Bits ? new Uint32Array(C) : new Uint16Array(C), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, I, this._gl.DYNAMIC_DRAW), this._resetIndexBufferBinding();\n        }, V.a.prototype.updateDynamicVertexBuffer = function(_, C, u, I) {\n          this.bindArrayBuffer(_), u === void 0 && (u = 0);\n          var O = C.length || C.byteLength;\n          I === void 0 || I >= O && u === 0 ? C instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, u, new Float32Array(C)) : this._gl.bufferSubData(this._gl.ARRAY_BUFFER, u, C) : C instanceof Array ? this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, new Float32Array(C).subarray(u, u + I)) : (C = C instanceof ArrayBuffer ? new Uint8Array(C, u, I) : new Uint8Array(C.buffer, C.byteOffset + u, I), this._gl.bufferSubData(this._gl.ARRAY_BUFFER, 0, C)), this._resetVertexBufferBinding();\n        };\n      }, function(Be, A, f) {\n        var V = \"fogFragmentDeclaration\", _ = `#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying vec3 vFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nfloat fogDistance=length(vFogDistance);\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = f(26), _ = f(27);\n        V.a.prototype.createDynamicTexture = function(C, u, I, O) {\n          var x = new _.a(this, _.b.Dynamic);\n          return x.baseWidth = C, x.baseHeight = u, I && (C = this.needPOTTextures ? V.a.GetExponentOfTwo(C, this._caps.maxTextureSize) : C, u = this.needPOTTextures ? V.a.GetExponentOfTwo(u, this._caps.maxTextureSize) : u), x.width = C, x.height = u, x.isReady = !1, x.generateMipMaps = I, x.samplingMode = O, this.updateTextureSamplingMode(O, x), this._internalTexturesCache.push(x), x;\n        }, V.a.prototype.updateDynamicTexture = function(C, u, I, O, x, m) {\n          if (O === void 0 && (O = !1), m === void 0 && (m = !1), C) {\n            var c = this._gl, T = c.TEXTURE_2D, S = this._bindTextureDirectly(T, C, !0, m);\n            this._unpackFlipY(I === void 0 ? C.invertY : I), O && c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);\n            var E = this._getWebGLTextureType(C.type), g = this._getInternalFormat(x || C.format), l = this._getRGBABufferInternalSizedFormat(C.type, g);\n            c.texImage2D(T, 0, l, g, E, u), C.generateMipMaps && c.generateMipmap(T), S || this._bindTextureDirectly(T, null), O && c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0), C.isReady = !0;\n          }\n        };\n      }, function(Be, A, f) {\n        f.r(A), f.d(A, \"AbstractScene\", function() {\n          return V.a;\n        }), f.d(A, \"AbstractActionManager\", function() {\n          return _.a;\n        }), f.d(A, \"Action\", function() {\n          return x;\n        }), f.d(A, \"ActionEvent\", function() {\n          return m.a;\n        }), f.d(A, \"ActionManager\", function() {\n          return pe;\n        }), f.d(A, \"Condition\", function() {\n          return T;\n        }), f.d(A, \"ValueCondition\", function() {\n          return S;\n        }), f.d(A, \"PredicateCondition\", function() {\n          return E;\n        }), f.d(A, \"StateCondition\", function() {\n          return g;\n        }), f.d(A, \"SwitchBooleanAction\", function() {\n          return v;\n        }), f.d(A, \"SetStateAction\", function() {\n          return b;\n        }), f.d(A, \"SetValueAction\", function() {\n          return D;\n        }), f.d(A, \"IncrementValueAction\", function() {\n          return w;\n        }), f.d(A, \"PlayAnimationAction\", function() {\n          return N;\n        }), f.d(A, \"StopAnimationAction\", function() {\n          return M;\n        }), f.d(A, \"DoNothingAction\", function() {\n          return U;\n        }), f.d(A, \"CombineAction\", function() {\n          return X;\n        }), f.d(A, \"ExecuteCodeAction\", function() {\n          return j;\n        }), f.d(A, \"SetParentAction\", function() {\n          return ne;\n        }), f.d(A, \"PlaySoundAction\", function() {\n          return ae;\n        }), f.d(A, \"StopSoundAction\", function() {\n          return ee;\n        }), f.d(A, \"InterpolateValueAction\", function() {\n          return H;\n        }), f.d(A, \"Animatable\", function() {\n          return ke;\n        }), f.d(A, \"_IAnimationState\", function() {\n          return Y;\n        }), f.d(A, \"Animation\", function() {\n          return k;\n        }), f.d(A, \"TargetedAnimation\", function() {\n          return We;\n        }), f.d(A, \"AnimationGroup\", function() {\n          return je;\n        }), f.d(A, \"AnimationPropertiesOverride\", function() {\n          return He;\n        }), f.d(A, \"EasingFunction\", function() {\n          return Ge;\n        }), f.d(A, \"CircleEase\", function() {\n          return tt;\n        }), f.d(A, \"BackEase\", function() {\n          return Je;\n        }), f.d(A, \"BounceEase\", function() {\n          return st;\n        }), f.d(A, \"CubicEase\", function() {\n          return at;\n        }), f.d(A, \"ElasticEase\", function() {\n          return pt;\n        }), f.d(A, \"ExponentialEase\", function() {\n          return Tt;\n        }), f.d(A, \"PowerEase\", function() {\n          return Lt;\n        }), f.d(A, \"QuadraticEase\", function() {\n          return Ot;\n        }), f.d(A, \"QuarticEase\", function() {\n          return St;\n        }), f.d(A, \"QuinticEase\", function() {\n          return Ct;\n        }), f.d(A, \"SineEase\", function() {\n          return nn;\n        }), f.d(A, \"BezierCurveEase\", function() {\n          return Qt;\n        }), f.d(A, \"RuntimeAnimation\", function() {\n          return me;\n        }), f.d(A, \"AnimationEvent\", function() {\n          return $t;\n        }), f.d(A, \"AnimationKeyInterpolation\", function() {\n          return K;\n        }), f.d(A, \"AnimationRange\", function() {\n          return G;\n        }), f.d(A, \"KeepAssets\", function() {\n          return Sn;\n        }), f.d(A, \"InstantiatedEntries\", function() {\n          return en;\n        }), f.d(A, \"AssetContainer\", function() {\n          return An;\n        }), f.d(A, \"Analyser\", function() {\n          return Pn;\n        }), f.d(A, \"AudioEngine\", function() {\n          return rr;\n        }), f.d(A, \"AudioSceneComponent\", function() {\n          return qn;\n        }), f.d(A, \"Sound\", function() {\n          return Qn;\n        }), f.d(A, \"SoundTrack\", function() {\n          return So;\n        }), f.d(A, \"WeightedSound\", function() {\n          return lf;\n        }), f.d(A, \"AutoRotationBehavior\", function() {\n          return Qc;\n        }), f.d(A, \"BouncingBehavior\", function() {\n          return qc;\n        }), f.d(A, \"FramingBehavior\", function() {\n          return Zc;\n        }), f.d(A, \"AttachToBoxBehavior\", function() {\n          return uf;\n        }), f.d(A, \"FadeInOutBehavior\", function() {\n          return hf;\n        }), f.d(A, \"MultiPointerScaleBehavior\", function() {\n          return df;\n        }), f.d(A, \"PointerDragBehavior\", function() {\n          return fi.a;\n        }), f.d(A, \"SixDofDragBehavior\", function() {\n          return Jc;\n        }), f.d(A, \"Bone\", function() {\n          return Fe;\n        }), f.d(A, \"BoneIKController\", function() {\n          return ff;\n        }), f.d(A, \"BoneLookController\", function() {\n          return pf;\n        }), f.d(A, \"Skeleton\", function() {\n          return Ao;\n        }), f.d(A, \"ArcRotateCameraGamepadInput\", function() {\n          return Da;\n        }), f.d(A, \"ArcRotateCameraKeyboardMoveInput\", function() {\n          return La;\n        }), f.d(A, \"ArcRotateCameraMouseWheelInput\", function() {\n          return Na;\n        }), f.d(A, \"ArcRotateCameraPointersInput\", function() {\n          return wa;\n        }), f.d(A, \"ArcRotateCameraVRDeviceOrientationInput\", function() {\n          return Fa;\n        }), f.d(A, \"FlyCameraKeyboardInput\", function() {\n          return Ba;\n        }), f.d(A, \"FlyCameraMouseInput\", function() {\n          return Ua;\n        }), f.d(A, \"FollowCameraKeyboardMoveInput\", function() {\n          return Va;\n        }), f.d(A, \"FollowCameraMouseWheelInput\", function() {\n          return ka;\n        }), f.d(A, \"FollowCameraPointersInput\", function() {\n          return Ga;\n        }), f.d(A, \"FreeCameraDeviceOrientationInput\", function() {\n          return Xa;\n        }), f.d(A, \"FreeCameraGamepadInput\", function() {\n          return Ya;\n        }), f.d(A, \"FreeCameraKeyboardMoveInput\", function() {\n          return za;\n        }), f.d(A, \"FreeCameraMouseInput\", function() {\n          return ja;\n        }), f.d(A, \"FreeCameraMouseWheelInput\", function() {\n          return Ha;\n        }), f.d(A, \"FreeCameraTouchInput\", function() {\n          return Wa;\n        }), f.d(A, \"FreeCameraVirtualJoystickInput\", function() {\n          return Qa;\n        }), f.d(A, \"CameraInputTypes\", function() {\n          return un;\n        }), f.d(A, \"CameraInputsManager\", function() {\n          return zr;\n        }), f.d(A, \"Camera\", function() {\n          return _t.a;\n        }), f.d(A, \"TargetCamera\", function() {\n          return xi;\n        }), f.d(A, \"FreeCamera\", function() {\n          return zn;\n        }), f.d(A, \"FreeCameraInputsManager\", function() {\n          return jr;\n        }), f.d(A, \"TouchCamera\", function() {\n          return qa;\n        }), f.d(A, \"ArcRotateCamera\", function() {\n          return Hi;\n        }), f.d(A, \"ArcRotateCameraInputsManager\", function() {\n          return Po;\n        }), f.d(A, \"DeviceOrientationCamera\", function() {\n          return xo;\n        }), f.d(A, \"FlyCamera\", function() {\n          return gf;\n        }), f.d(A, \"FlyCameraInputsManager\", function() {\n          return ol;\n        }), f.d(A, \"FollowCamera\", function() {\n          return sl;\n        }), f.d(A, \"ArcFollowCamera\", function() {\n          return cl;\n        }), f.d(A, \"FollowCameraInputsManager\", function() {\n          return al;\n        }), f.d(A, \"GamepadCamera\", function() {\n          return Co;\n        }), f.d(A, \"AnaglyphArcRotateCamera\", function() {\n          return pl;\n        }), f.d(A, \"AnaglyphFreeCamera\", function() {\n          return _l;\n        }), f.d(A, \"AnaglyphGamepadCamera\", function() {\n          return ml;\n        }), f.d(A, \"AnaglyphUniversalCamera\", function() {\n          return gl;\n        }), f.d(A, \"StereoscopicArcRotateCamera\", function() {\n          return vl;\n        }), f.d(A, \"StereoscopicFreeCamera\", function() {\n          return yl;\n        }), f.d(A, \"StereoscopicGamepadCamera\", function() {\n          return bl;\n        }), f.d(A, \"StereoscopicUniversalCamera\", function() {\n          return Tl;\n        }), f.d(A, \"UniversalCamera\", function() {\n          return sr;\n        }), f.d(A, \"VirtualJoysticksCamera\", function() {\n          return El;\n        }), f.d(A, \"VRCameraMetrics\", function() {\n          return cr;\n        }), f.d(A, \"VRDeviceOrientationArcRotateCamera\", function() {\n          return xl;\n        }), f.d(A, \"VRDeviceOrientationFreeCamera\", function() {\n          return Ro;\n        }), f.d(A, \"VRDeviceOrientationGamepadCamera\", function() {\n          return Cl;\n        }), f.d(A, \"OnAfterEnteringVRObservableEvent\", function() {\n          return Cf;\n        }), f.d(A, \"VRExperienceHelper\", function() {\n          return Il;\n        }), f.d(A, \"WebVRFreeCamera\", function() {\n          return Mo;\n        }), f.d(A, \"Collider\", function() {\n          return Dl;\n        }), f.d(A, \"DefaultCollisionCoordinator\", function() {\n          return Ll;\n        }), f.d(A, \"PickingInfo\", function() {\n          return Ki.a;\n        }), f.d(A, \"IntersectionInfo\", function() {\n          return Rf.a;\n        }), f.d(A, \"_MeshCollisionData\", function() {\n          return Of.a;\n        }), f.d(A, \"BoundingBox\", function() {\n          return os.a;\n        }), f.d(A, \"BoundingInfo\", function() {\n          return Ii.a;\n        }), f.d(A, \"BoundingSphere\", function() {\n          return Nl.a;\n        }), f.d(A, \"Octree\", function() {\n          return Wr;\n        }), f.d(A, \"OctreeBlock\", function() {\n          return wl;\n        }), f.d(A, \"OctreeSceneComponent\", function() {\n          return us;\n        }), f.d(A, \"Ray\", function() {\n          return dn.a;\n        }), f.d(A, \"AxesViewer\", function() {\n          return Qi.AxesViewer;\n        }), f.d(A, \"BoneAxesViewer\", function() {\n          return Qi.BoneAxesViewer;\n        }), f.d(A, \"DebugLayerTab\", function() {\n          return Qi.DebugLayerTab;\n        }), f.d(A, \"DebugLayer\", function() {\n          return Qi.DebugLayer;\n        }), f.d(A, \"PhysicsViewer\", function() {\n          return Qi.PhysicsViewer;\n        }), f.d(A, \"RayHelper\", function() {\n          return Qi.RayHelper;\n        }), f.d(A, \"SkeletonViewer\", function() {\n          return Qi.SkeletonViewer;\n        }), f.d(A, \"DeviceInputSystem\", function() {\n          return Fl;\n        }), f.d(A, \"DeviceType\", function() {\n          return Xt;\n        }), f.d(A, \"PointerInput\", function() {\n          return as;\n        }), f.d(A, \"DualShockInput\", function() {\n          return ss;\n        }), f.d(A, \"XboxInput\", function() {\n          return cs;\n        }), f.d(A, \"SwitchInput\", function() {\n          return ls;\n        }), f.d(A, \"DeviceSource\", function() {\n          return Bl;\n        }), f.d(A, \"DeviceSourceManager\", function() {\n          return Mf;\n        }), f.d(A, \"Constants\", function() {\n          return h.a;\n        }), f.d(A, \"ThinEngine\", function() {\n          return wt.a;\n        }), f.d(A, \"Engine\", function() {\n          return Ue.a;\n        }), f.d(A, \"EngineStore\", function() {\n          return te.a;\n        }), f.d(A, \"NullEngineOptions\", function() {\n          return Ul.b;\n        }), f.d(A, \"NullEngine\", function() {\n          return Ul.a;\n        }), f.d(A, \"_OcclusionDataStorage\", function() {\n          return kl;\n        }), f.d(A, \"_forceTransformFeedbackToBundle\", function() {\n          return If;\n        }), f.d(A, \"EngineView\", function() {\n          return Df;\n        }), f.d(A, \"WebGLPipelineContext\", function() {\n          return Nf.a;\n        }), f.d(A, \"WebGL2ShaderProcessor\", function() {\n          return Gl.a;\n        }), f.d(A, \"NativeEngine\", function() {\n          return Vf;\n        }), f.d(A, \"ShaderCodeInliner\", function() {\n          return ds;\n        }), f.d(A, \"PerformanceConfigurator\", function() {\n          return kf.a;\n        }), f.d(A, \"KeyboardEventTypes\", function() {\n          return ji.a;\n        }), f.d(A, \"KeyboardInfo\", function() {\n          return ji.b;\n        }), f.d(A, \"KeyboardInfoPre\", function() {\n          return ji.c;\n        }), f.d(A, \"PointerEventTypes\", function() {\n          return yt.a;\n        }), f.d(A, \"PointerInfoBase\", function() {\n          return yt.c;\n        }), f.d(A, \"PointerInfoPre\", function() {\n          return yt.d;\n        }), f.d(A, \"PointerInfo\", function() {\n          return yt.b;\n        }), f.d(A, \"ClipboardEventTypes\", function() {\n          return No;\n        }), f.d(A, \"ClipboardInfo\", function() {\n          return Gf;\n        }), f.d(A, \"DaydreamController\", function() {\n          return ps;\n        }), f.d(A, \"GearVRController\", function() {\n          return _s;\n        }), f.d(A, \"GenericController\", function() {\n          return wo;\n        }), f.d(A, \"OculusTouchController\", function() {\n          return ms;\n        }), f.d(A, \"PoseEnabledControllerType\", function() {\n          return Jn;\n        }), f.d(A, \"PoseEnabledControllerHelper\", function() {\n          return Ci;\n        }), f.d(A, \"PoseEnabledController\", function() {\n          return ar;\n        }), f.d(A, \"ViveController\", function() {\n          return Wl;\n        }), f.d(A, \"WebVRController\", function() {\n          return Oi;\n        }), f.d(A, \"WindowsMotionController\", function() {\n          return Fo;\n        }), f.d(A, \"XRWindowsMotionController\", function() {\n          return jf;\n        }), f.d(A, \"StickValues\", function() {\n          return _f;\n        }), f.d(A, \"Gamepad\", function() {\n          return hn;\n        }), f.d(A, \"GenericPad\", function() {\n          return nl;\n        }), f.d(A, \"GamepadManager\", function() {\n          return hl;\n        }), f.d(A, \"GamepadSystemSceneComponent\", function() {\n          return dl;\n        }), f.d(A, \"Xbox360Button\", function() {\n          return xn;\n        }), f.d(A, \"Xbox360Dpad\", function() {\n          return Wi;\n        }), f.d(A, \"Xbox360Pad\", function() {\n          return ll;\n        }), f.d(A, \"DualShockButton\", function() {\n          return Vn;\n        }), f.d(A, \"DualShockDpad\", function() {\n          return Xi;\n        }), f.d(A, \"DualShockPad\", function() {\n          return ul;\n        }), f.d(A, \"AxisDragGizmo\", function() {\n          return Bo.a;\n        }), f.d(A, \"AxisScaleGizmo\", function() {\n          return Kr;\n        }), f.d(A, \"BoundingBoxGizmo\", function() {\n          return Xl;\n        }), f.d(A, \"Gizmo\", function() {\n          return Ln.a;\n        }), f.d(A, \"GizmoManager\", function() {\n          return Hf;\n        }), f.d(A, \"PlaneRotationGizmo\", function() {\n          return Uo;\n        }), f.d(A, \"PositionGizmo\", function() {\n          return Kl;\n        }), f.d(A, \"RotationGizmo\", function() {\n          return Yl;\n        }), f.d(A, \"ScaleGizmo\", function() {\n          return Ql;\n        }), f.d(A, \"LightGizmo\", function() {\n          return Wf;\n        }), f.d(A, \"CameraGizmo\", function() {\n          return Yf;\n        }), f.d(A, \"PlaneDragGizmo\", function() {\n          return Vo;\n        }), f.d(A, \"EnvironmentHelper\", function() {\n          return Es;\n        }), f.d(A, \"PhotoDome\", function() {\n          return op;\n        }), f.d(A, \"_forceSceneHelpersToBundle\", function() {\n          return qp;\n        }), f.d(A, \"VideoDome\", function() {\n          return Zp;\n        }), f.d(A, \"EngineInstrumentation\", function() {\n          return Jp;\n        }), f.d(A, \"SceneInstrumentation\", function() {\n          return $p;\n        }), f.d(A, \"_TimeToken\", function() {\n          return Vl;\n        }), f.d(A, \"EffectLayer\", function() {\n          return no;\n        }), f.d(A, \"EffectLayerSceneComponent\", function() {\n          return du;\n        }), f.d(A, \"GlowLayer\", function() {\n          return Ko;\n        }), f.d(A, \"HighlightLayer\", function() {\n          return Ms;\n        }), f.d(A, \"Layer\", function() {\n          return s_;\n        }), f.d(A, \"LayerSceneComponent\", function() {\n          return pu;\n        }), f.d(A, \"LensFlare\", function() {\n          return _u;\n        }), f.d(A, \"LensFlareSystem\", function() {\n          return Is;\n        }), f.d(A, \"LensFlareSystemSceneComponent\", function() {\n          return mu;\n        }), f.d(A, \"Light\", function() {\n          return bi.a;\n        }), f.d(A, \"ShadowLight\", function() {\n          return ko;\n        }), f.d(A, \"ShadowGenerator\", function() {\n          return Fn;\n        }), f.d(A, \"CascadedShadowGenerator\", function() {\n          return Ds;\n        }), f.d(A, \"ShadowGeneratorSceneComponent\", function() {\n          return Su;\n        }), f.d(A, \"DirectionalLight\", function() {\n          return vs;\n        }), f.d(A, \"HemisphericLight\", function() {\n          return Oo.a;\n        }), f.d(A, \"PointLight\", function() {\n          return Ls;\n        }), f.d(A, \"SpotLight\", function() {\n          return ys;\n        }), f.d(A, \"DefaultLoadingScreen\", function() {\n          return Au;\n        }), f.d(A, \"_BabylonLoaderRegistered\", function() {\n          return x_;\n        }), f.d(A, \"BabylonFileLoaderConfiguration\", function() {\n          return $o;\n        }), f.d(A, \"SceneLoaderAnimationGroupLoadingMode\", function() {\n          return vi;\n        }), f.d(A, \"SceneLoader\", function() {\n          return Ft;\n        }), f.d(A, \"SceneLoaderFlags\", function() {\n          return yi.a;\n        }), f.d(A, \"BackgroundMaterial\", function() {\n          return qr;\n        }), f.d(A, \"ColorCurves\", function() {\n          return R_.a;\n        }), f.d(A, \"EffectFallbacks\", function() {\n          return _r.a;\n        }), f.d(A, \"Effect\", function() {\n          return ze.a;\n        }), f.d(A, \"FresnelParameters\", function() {\n          return Fu;\n        }), f.d(A, \"ImageProcessingConfigurationDefines\", function() {\n          return vn.b;\n        }), f.d(A, \"ImageProcessingConfiguration\", function() {\n          return vn.a;\n        }), f.d(A, \"Material\", function() {\n          return zt.a;\n        }), f.d(A, \"MaterialDefines\", function() {\n          return zo.a;\n        }), f.d(A, \"ThinMaterialHelper\", function() {\n          return Bu.a;\n        }), f.d(A, \"MaterialHelper\", function() {\n          return $e.a;\n        }), f.d(A, \"MultiMaterial\", function() {\n          return qi.a;\n        }), f.d(A, \"PBRMaterialDefines\", function() {\n          return As;\n        }), f.d(A, \"PBRBaseMaterial\", function() {\n          return pn;\n        }), f.d(A, \"PBRBaseSimpleMaterial\", function() {\n          return Us;\n        }), f.d(A, \"PBRMaterial\", function() {\n          return $r;\n        }), f.d(A, \"PBRMetallicRoughnessMaterial\", function() {\n          return Uu;\n        }), f.d(A, \"PBRSpecularGlossinessMaterial\", function() {\n          return Vu;\n        }), f.d(A, \"PushMaterial\", function() {\n          return jo.a;\n        }), f.d(A, \"ShaderMaterial\", function() {\n          return ea.a;\n        }), f.d(A, \"StandardMaterialDefines\", function() {\n          return Nt.b;\n        }), f.d(A, \"StandardMaterial\", function() {\n          return Nt.a;\n        }), f.d(A, \"BaseTexture\", function() {\n          return kn.a;\n        }), f.d(A, \"ColorGradingTexture\", function() {\n          return ku;\n        }), f.d(A, \"CubeTexture\", function() {\n          return ei;\n        }), f.d(A, \"DynamicTexture\", function() {\n          return pi.a;\n        }), f.d(A, \"EquiRectangularCubeTexture\", function() {\n          return Gu;\n        }), f.d(A, \"HDRFiltering\", function() {\n          return Ru;\n        }), f.d(A, \"HDRCubeTexture\", function() {\n          return qo;\n        }), f.d(A, \"HtmlElementTexture\", function() {\n          return O_;\n        }), f.d(A, \"InternalTextureSource\", function() {\n          return Pt.b;\n        }), f.d(A, \"InternalTexture\", function() {\n          return Pt.a;\n        }), f.d(A, \"_DDSTextureLoader\", function() {\n          return eu;\n        }), f.d(A, \"_ENVTextureLoader\", function() {\n          return tu;\n        }), f.d(A, \"_KTXTextureLoader\", function() {\n          return nu;\n        }), f.d(A, \"_TGATextureLoader\", function() {\n          return zu;\n        }), f.d(A, \"_BasisTextureLoader\", function() {\n          return ju;\n        }), f.d(A, \"MirrorTexture\", function() {\n          return Ts;\n        }), f.d(A, \"MultiRenderTarget\", function() {\n          return Vs;\n        }), f.d(A, \"TexturePacker\", function() {\n          return D_;\n        }), f.d(A, \"TexturePackerFrame\", function() {\n          return ks;\n        }), f.d(A, \"CustomProceduralTexture\", function() {\n          return N_;\n        }), f.d(A, \"NoiseProceduralTexture\", function() {\n          return Wu;\n        }), f.d(A, \"ProceduralTexture\", function() {\n          return oo;\n        }), f.d(A, \"ProceduralTextureSceneComponent\", function() {\n          return Hu;\n        }), f.d(A, \"RawCubeTexture\", function() {\n          return F_;\n        }), f.d(A, \"RawTexture\", function() {\n          return Zn;\n        }), f.d(A, \"RawTexture2DArray\", function() {\n          return B_;\n        }), f.d(A, \"RawTexture3D\", function() {\n          return U_;\n        }), f.d(A, \"RefractionTexture\", function() {\n          return V_;\n        }), f.d(A, \"RenderTargetTexture\", function() {\n          return on;\n        }), f.d(A, \"Texture\", function() {\n          return Ne.a;\n        }), f.d(A, \"VideoTexture\", function() {\n          return hu;\n        }), f.d(A, \"UniformBuffer\", function() {\n          return Sl.a;\n        }), f.d(A, \"MaterialFlags\", function() {\n          return lt.a;\n        }), f.d(A, \"NodeMaterialBlockTargets\", function() {\n          return Ce;\n        }), f.d(A, \"NodeMaterialBlockConnectionPointTypes\", function() {\n          return le;\n        }), f.d(A, \"NodeMaterialBlockConnectionPointMode\", function() {\n          return gn;\n        }), f.d(A, \"NodeMaterialSystemValues\", function() {\n          return gt;\n        }), f.d(A, \"NodeMaterialModes\", function() {\n          return Rn;\n        }), f.d(A, \"NodeMaterialConnectionPointCompatibilityStates\", function() {\n          return ii;\n        }), f.d(A, \"NodeMaterialConnectionPointDirection\", function() {\n          return yn;\n        }), f.d(A, \"NodeMaterialConnectionPoint\", function() {\n          return na;\n        }), f.d(A, \"NodeMaterialBlock\", function() {\n          return dt;\n        }), f.d(A, \"NodeMaterialDefines\", function() {\n          return lo;\n        }), f.d(A, \"NodeMaterial\", function() {\n          return sa;\n        }), f.d(A, \"VertexOutputBlock\", function() {\n          return ao;\n        }), f.d(A, \"BonesBlock\", function() {\n          return qu;\n        }), f.d(A, \"InstancesBlock\", function() {\n          return Zu;\n        }), f.d(A, \"MorphTargetsBlock\", function() {\n          return Ju;\n        }), f.d(A, \"LightInformationBlock\", function() {\n          return $u;\n        }), f.d(A, \"FragmentOutputBlock\", function() {\n          return Pr;\n        }), f.d(A, \"ImageProcessingBlock\", function() {\n          return eh;\n        }), f.d(A, \"PerturbNormalBlock\", function() {\n          return th;\n        }), f.d(A, \"DiscardBlock\", function() {\n          return nh;\n        }), f.d(A, \"FrontFacingBlock\", function() {\n          return ih;\n        }), f.d(A, \"DerivativeBlock\", function() {\n          return rh;\n        }), f.d(A, \"FragCoordBlock\", function() {\n          return oh;\n        }), f.d(A, \"ScreenSizeBlock\", function() {\n          return ah;\n        }), f.d(A, \"FogBlock\", function() {\n          return sh;\n        }), f.d(A, \"LightBlock\", function() {\n          return ch;\n        }), f.d(A, \"TextureBlock\", function() {\n          return lh;\n        }), f.d(A, \"ReflectionTextureBlock\", function() {\n          return uh;\n        }), f.d(A, \"CurrentScreenBlock\", function() {\n          return zs;\n        }), f.d(A, \"InputBlock\", function() {\n          return Et;\n        }), f.d(A, \"AnimatedInputBlockTypes\", function() {\n          return wi;\n        }), f.d(A, \"MultiplyBlock\", function() {\n          return ra;\n        }), f.d(A, \"AddBlock\", function() {\n          return hh;\n        }), f.d(A, \"ScaleBlock\", function() {\n          return dh;\n        }), f.d(A, \"ClampBlock\", function() {\n          return fh;\n        }), f.d(A, \"CrossBlock\", function() {\n          return ph;\n        }), f.d(A, \"DotBlock\", function() {\n          return _h;\n        }), f.d(A, \"TransformBlock\", function() {\n          return ia;\n        }), f.d(A, \"RemapBlock\", function() {\n          return Xs;\n        }), f.d(A, \"NormalizeBlock\", function() {\n          return mh;\n        }), f.d(A, \"TrigonometryBlockOperations\", function() {\n          return tn;\n        }), f.d(A, \"TrigonometryBlock\", function() {\n          return $s;\n        }), f.d(A, \"ColorMergerBlock\", function() {\n          return gh;\n        }), f.d(A, \"VectorMergerBlock\", function() {\n          return so;\n        }), f.d(A, \"ColorSplitterBlock\", function() {\n          return Js;\n        }), f.d(A, \"VectorSplitterBlock\", function() {\n          return vh;\n        }), f.d(A, \"LerpBlock\", function() {\n          return yh;\n        }), f.d(A, \"DivideBlock\", function() {\n          return bh;\n        }), f.d(A, \"SubtractBlock\", function() {\n          return Th;\n        }), f.d(A, \"StepBlock\", function() {\n          return Eh;\n        }), f.d(A, \"OneMinusBlock\", function() {\n          return nc;\n        }), f.d(A, \"ViewDirectionBlock\", function() {\n          return ic;\n        }), f.d(A, \"FresnelBlock\", function() {\n          return Sh;\n        }), f.d(A, \"MaxBlock\", function() {\n          return Ah;\n        }), f.d(A, \"MinBlock\", function() {\n          return Ph;\n        }), f.d(A, \"DistanceBlock\", function() {\n          return xh;\n        }), f.d(A, \"LengthBlock\", function() {\n          return Ch;\n        }), f.d(A, \"NegateBlock\", function() {\n          return Rh;\n        }), f.d(A, \"PowBlock\", function() {\n          return Oh;\n        }), f.d(A, \"RandomNumberBlock\", function() {\n          return Mh;\n        }), f.d(A, \"ArcTan2Block\", function() {\n          return Ih;\n        }), f.d(A, \"SmoothStepBlock\", function() {\n          return Dh;\n        }), f.d(A, \"ReciprocalBlock\", function() {\n          return Lh;\n        }), f.d(A, \"ReplaceColorBlock\", function() {\n          return Nh;\n        }), f.d(A, \"PosterizeBlock\", function() {\n          return wh;\n        }), f.d(A, \"WaveBlockKind\", function() {\n          return Zi;\n        }), f.d(A, \"WaveBlock\", function() {\n          return Fh;\n        }), f.d(A, \"GradientBlockColorStep\", function() {\n          return ca;\n        }), f.d(A, \"GradientBlock\", function() {\n          return Bh;\n        }), f.d(A, \"NLerpBlock\", function() {\n          return Uh;\n        }), f.d(A, \"WorleyNoise3DBlock\", function() {\n          return Vh;\n        }), f.d(A, \"SimplexPerlin3DBlock\", function() {\n          return kh;\n        }), f.d(A, \"NormalBlendBlock\", function() {\n          return Gh;\n        }), f.d(A, \"Rotate2dBlock\", function() {\n          return zh;\n        }), f.d(A, \"ReflectBlock\", function() {\n          return jh;\n        }), f.d(A, \"RefractBlock\", function() {\n          return Hh;\n        }), f.d(A, \"DesaturateBlock\", function() {\n          return Wh;\n        }), f.d(A, \"PBRMetallicRoughnessBlock\", function() {\n          return Xh;\n        }), f.d(A, \"SheenBlock\", function() {\n          return rc;\n        }), f.d(A, \"AnisotropyBlock\", function() {\n          return oc;\n        }), f.d(A, \"ReflectionBlock\", function() {\n          return ac;\n        }), f.d(A, \"ClearCoatBlock\", function() {\n          return la;\n        }), f.d(A, \"RefractionBlock\", function() {\n          return sc;\n        }), f.d(A, \"SubSurfaceBlock\", function() {\n          return ua;\n        }), f.d(A, \"ParticleTextureBlock\", function() {\n          return js;\n        }), f.d(A, \"ParticleRampGradientBlock\", function() {\n          return Hs;\n        }), f.d(A, \"ParticleBlendMultiplyBlock\", function() {\n          return Ws;\n        }), f.d(A, \"ModBlock\", function() {\n          return Yh;\n        }), f.d(A, \"NodeMaterialOptimizer\", function() {\n          return H_;\n        }), f.d(A, \"PropertyTypeForEdition\", function() {\n          return It;\n        }), f.d(A, \"editableInPropertyPage\", function() {\n          return Bt;\n        }), f.d(A, \"EffectRenderer\", function() {\n          return xu;\n        }), f.d(A, \"EffectWrapper\", function() {\n          return Cu;\n        }), f.d(A, \"ShadowDepthWrapper\", function() {\n          return Y_;\n        }), f.d(A, \"Scalar\", function() {\n          return $.a;\n        }), f.d(A, \"extractMinAndMaxIndexed\", function() {\n          return Kh.b;\n        }), f.d(A, \"extractMinAndMax\", function() {\n          return Kh.a;\n        }), f.d(A, \"Space\", function() {\n          return be.c;\n        }), f.d(A, \"Axis\", function() {\n          return be.a;\n        }), f.d(A, \"Coordinate\", function() {\n          return be.b;\n        }), f.d(A, \"Color3\", function() {\n          return I.a;\n        }), f.d(A, \"Color4\", function() {\n          return I.b;\n        }), f.d(A, \"TmpColors\", function() {\n          return I.c;\n        }), f.d(A, \"ToGammaSpace\", function() {\n          return Vt.b;\n        }), f.d(A, \"ToLinearSpace\", function() {\n          return Vt.c;\n        }), f.d(A, \"Epsilon\", function() {\n          return Vt.a;\n        }), f.d(A, \"Frustum\", function() {\n          return Pl.a;\n        }), f.d(A, \"Orientation\", function() {\n          return Qe.e;\n        }), f.d(A, \"BezierCurve\", function() {\n          return Qe.c;\n        }), f.d(A, \"Angle\", function() {\n          return Qe.a;\n        }), f.d(A, \"Arc2\", function() {\n          return Qe.b;\n        }), f.d(A, \"Path2\", function() {\n          return Qe.f;\n        }), f.d(A, \"Path3D\", function() {\n          return Qe.g;\n        }), f.d(A, \"Curve3\", function() {\n          return Qe.d;\n        }), f.d(A, \"Plane\", function() {\n          return ur.a;\n        }), f.d(A, \"Size\", function() {\n          return oe.a;\n        }), f.d(A, \"Vector2\", function() {\n          return u.d;\n        }), f.d(A, \"Vector3\", function() {\n          return u.e;\n        }), f.d(A, \"Vector4\", function() {\n          return u.f;\n        }), f.d(A, \"Quaternion\", function() {\n          return u.b;\n        }), f.d(A, \"Matrix\", function() {\n          return u.a;\n        }), f.d(A, \"TmpVectors\", function() {\n          return u.c;\n        }), f.d(A, \"PositionNormalVertex\", function() {\n          return bs;\n        }), f.d(A, \"PositionNormalTextureVertex\", function() {\n          return Xf;\n        }), f.d(A, \"Viewport\", function() {\n          return jn.a;\n        }), f.d(A, \"SphericalHarmonics\", function() {\n          return hs;\n        }), f.d(A, \"SphericalPolynomial\", function() {\n          return Yr;\n        }), f.d(A, \"AbstractMesh\", function() {\n          return Mt.a;\n        }), f.d(A, \"Buffer\", function() {\n          return Oe.a;\n        }), f.d(A, \"VertexBuffer\", function() {\n          return Oe.b;\n        }), f.d(A, \"DracoCompression\", function() {\n          return Q_;\n        }), f.d(A, \"CSG\", function() {\n          return J_;\n        }), f.d(A, \"Geometry\", function() {\n          return Ns.a;\n        }), f.d(A, \"GroundMesh\", function() {\n          return Do;\n        }), f.d(A, \"TrailMesh\", function() {\n          return $_;\n        }), f.d(A, \"InstancedMesh\", function() {\n          return em.a;\n        }), f.d(A, \"LinesMesh\", function() {\n          return ho.b;\n        }), f.d(A, \"InstancedLinesMesh\", function() {\n          return ho.a;\n        }), f.d(A, \"_CreationDataStorage\", function() {\n          return Ie.b;\n        }), f.d(A, \"_InstancesBatch\", function() {\n          return Ie.c;\n        }), f.d(A, \"Mesh\", function() {\n          return Ie.a;\n        }), f.d(A, \"VertexData\", function() {\n          return ht.a;\n        }), f.d(A, \"MeshBuilder\", function() {\n          return im;\n        }), f.d(A, \"SimplificationSettings\", function() {\n          return rm;\n        }), f.d(A, \"SimplificationQueue\", function() {\n          return ed;\n        }), f.d(A, \"SimplificationType\", function() {\n          return _o;\n        }), f.d(A, \"QuadraticErrorSimplification\", function() {\n          return nd;\n        }), f.d(A, \"SimplicationQueueSceneComponent\", function() {\n          return id;\n        }), f.d(A, \"Polygon\", function() {\n          return nm;\n        }), f.d(A, \"PolygonMeshBuilder\", function() {\n          return Jh;\n        }), f.d(A, \"SubMesh\", function() {\n          return uo.a;\n        }), f.d(A, \"MeshLODLevel\", function() {\n          return cm.a;\n        }), f.d(A, \"TransformNode\", function() {\n          return pr.a;\n        }), f.d(A, \"BoxBuilder\", function() {\n          return fr.a;\n        }), f.d(A, \"TiledBoxBuilder\", function() {\n          return Zh;\n        }), f.d(A, \"DiscBuilder\", function() {\n          return ha;\n        }), f.d(A, \"RibbonBuilder\", function() {\n          return fo.a;\n        }), f.d(A, \"SphereBuilder\", function() {\n          return Nn.a;\n        }), f.d(A, \"HemisphereBuilder\", function() {\n          return Go;\n        }), f.d(A, \"CylinderBuilder\", function() {\n          return ci.a;\n        }), f.d(A, \"TorusBuilder\", function() {\n          return lr;\n        }), f.d(A, \"TorusKnotBuilder\", function() {\n          return uc;\n        }), f.d(A, \"LinesBuilder\", function() {\n          return sn.a;\n        }), f.d(A, \"PolygonBuilder\", function() {\n          return po;\n        }), f.d(A, \"ShapeBuilder\", function() {\n          return Jo.a;\n        }), f.d(A, \"LatheBuilder\", function() {\n          return dc;\n        }), f.d(A, \"PlaneBuilder\", function() {\n          return gs.a;\n        }), f.d(A, \"TiledPlaneBuilder\", function() {\n          return $h;\n        }), f.d(A, \"GroundBuilder\", function() {\n          return Mi;\n        }), f.d(A, \"TubeBuilder\", function() {\n          return fc;\n        }), f.d(A, \"PolyhedronBuilder\", function() {\n          return Qr;\n        }), f.d(A, \"IcoSphereBuilder\", function() {\n          return pc;\n        }), f.d(A, \"DecalBuilder\", function() {\n          return _c;\n        }), f.d(A, \"CapsuleBuilder\", function() {\n          return mc;\n        }), f.d(A, \"DataBuffer\", function() {\n          return zl.a;\n        }), f.d(A, \"WebGLDataBuffer\", function() {\n          return lm.a;\n        }), f.d(A, \"MorphTarget\", function() {\n          return Ou;\n        }), f.d(A, \"MorphTargetManager\", function() {\n          return Zo;\n        }), f.d(A, \"RecastJSPlugin\", function() {\n          return um;\n        }), f.d(A, \"RecastJSCrowd\", function() {\n          return rd;\n        }), f.d(A, \"Node\", function() {\n          return Q.a;\n        }), f.d(A, \"Database\", function() {\n          return od;\n        }), f.d(A, \"BaseParticleSystem\", function() {\n          return co;\n        }), f.d(A, \"BoxParticleEmitter\", function() {\n          return xr;\n        }), f.d(A, \"ConeParticleEmitter\", function() {\n          return Ys;\n        }), f.d(A, \"CylinderParticleEmitter\", function() {\n          return oa;\n        }), f.d(A, \"CylinderDirectedParticleEmitter\", function() {\n          return Ks;\n        }), f.d(A, \"HemisphericParticleEmitter\", function() {\n          return Qs;\n        }), f.d(A, \"PointParticleEmitter\", function() {\n          return qs;\n        }), f.d(A, \"SphereParticleEmitter\", function() {\n          return aa;\n        }), f.d(A, \"SphereDirectedParticleEmitter\", function() {\n          return Zs;\n        }), f.d(A, \"CustomParticleEmitter\", function() {\n          return Cr;\n        }), f.d(A, \"MeshParticleEmitter\", function() {\n          return Ku;\n        }), f.d(A, \"GPUParticleSystem\", function() {\n          return Ji;\n        }), f.d(A, \"Particle\", function() {\n          return sd;\n        }), f.d(A, \"ParticleHelper\", function() {\n          return vm;\n        }), f.d(A, \"ParticleSystem\", function() {\n          return cn;\n        }), f.d(A, \"ParticleSystemSet\", function() {\n          return da;\n        }), f.d(A, \"SolidParticle\", function() {\n          return yc;\n        }), f.d(A, \"ModelShape\", function() {\n          return bc;\n        }), f.d(A, \"DepthSortedParticle\", function() {\n          return cd;\n        }), f.d(A, \"SolidParticleVertex\", function() {\n          return ld;\n        }), f.d(A, \"SolidParticleSystem\", function() {\n          return ym;\n        }), f.d(A, \"CloudPoint\", function() {\n          return ud;\n        }), f.d(A, \"PointsGroup\", function() {\n          return fa;\n        }), f.d(A, \"PointColor\", function() {\n          return bn;\n        }), f.d(A, \"PointsCloudSystem\", function() {\n          return bm;\n        }), f.d(A, \"SubEmitterType\", function() {\n          return Rr;\n        }), f.d(A, \"SubEmitter\", function() {\n          return mo;\n        }), f.d(A, \"PhysicsEngine\", function() {\n          return Sr;\n        }), f.d(A, \"PhysicsEngineSceneComponent\", function() {\n          return hd;\n        }), f.d(A, \"PhysicsHelper\", function() {\n          return Tm;\n        }), f.d(A, \"PhysicsRadialExplosionEventOptions\", function() {\n          return Mr;\n        }), f.d(A, \"PhysicsUpdraftEventOptions\", function() {\n          return Tc;\n        }), f.d(A, \"PhysicsVortexEventOptions\", function() {\n          return Ec;\n        }), f.d(A, \"PhysicsRadialImpulseFalloff\", function() {\n          return go;\n        }), f.d(A, \"PhysicsUpdraftMode\", function() {\n          return Or;\n        }), f.d(A, \"PhysicsImpostor\", function() {\n          return At.a;\n        }), f.d(A, \"PhysicsJoint\", function() {\n          return Jt.e;\n        }), f.d(A, \"DistanceJoint\", function() {\n          return Jt.a;\n        }), f.d(A, \"MotorEnabledJoint\", function() {\n          return Jt.d;\n        }), f.d(A, \"HingeJoint\", function() {\n          return Jt.c;\n        }), f.d(A, \"Hinge2Joint\", function() {\n          return Jt.b;\n        }), f.d(A, \"CannonJSPlugin\", function() {\n          return Bs;\n        }), f.d(A, \"AmmoJSPlugin\", function() {\n          return Iu;\n        }), f.d(A, \"OimoJSPlugin\", function() {\n          return Mu;\n        }), f.d(A, \"AnaglyphPostProcess\", function() {\n          return Ja;\n        }), f.d(A, \"BlackAndWhitePostProcess\", function() {\n          return fd;\n        }), f.d(A, \"BloomEffect\", function() {\n          return Pc;\n        }), f.d(A, \"BloomMergePostProcess\", function() {\n          return Ac;\n        }), f.d(A, \"BlurPostProcess\", function() {\n          return _n;\n        }), f.d(A, \"ChromaticAberrationPostProcess\", function() {\n          return xc;\n        }), f.d(A, \"CircleOfConfusionPostProcess\", function() {\n          return Cc;\n        }), f.d(A, \"ColorCorrectionPostProcess\", function() {\n          return pd;\n        }), f.d(A, \"ConvolutionPostProcess\", function() {\n          return _d;\n        }), f.d(A, \"DepthOfFieldBlurPostProcess\", function() {\n          return pa;\n        }), f.d(A, \"DepthOfFieldEffectBlurLevel\", function() {\n          return $i;\n        }), f.d(A, \"DepthOfFieldEffect\", function() {\n          return Rc;\n        }), f.d(A, \"DepthOfFieldMergePostProcessOptions\", function() {\n          return Lm;\n        }), f.d(A, \"DepthOfFieldMergePostProcess\", function() {\n          return md;\n        }), f.d(A, \"DisplayPassPostProcess\", function() {\n          return gd;\n        }), f.d(A, \"ExtractHighlightsPostProcess\", function() {\n          return Sc;\n        }), f.d(A, \"FilterPostProcess\", function() {\n          return vd;\n        }), f.d(A, \"FxaaPostProcess\", function() {\n          return vo;\n        }), f.d(A, \"GrainPostProcess\", function() {\n          return Oc;\n        }), f.d(A, \"HighlightsPostProcess\", function() {\n          return km;\n        }), f.d(A, \"ImageProcessingPostProcess\", function() {\n          return Io;\n        }), f.d(A, \"MotionBlurPostProcess\", function() {\n          return Mc;\n        }), f.d(A, \"PassPostProcess\", function() {\n          return Ri;\n        }), f.d(A, \"PassCubePostProcess\", function() {\n          return Tf;\n        }), f.d(A, \"PostProcess\", function() {\n          return ft;\n        }), f.d(A, \"PostProcessManager\", function() {\n          return es.a;\n        }), f.d(A, \"RefractionPostProcess\", function() {\n          return bd;\n        }), f.d(A, \"DefaultRenderingPipeline\", function() {\n          return Sd;\n        }), f.d(A, \"LensRenderingPipeline\", function() {\n          return Qm;\n        }), f.d(A, \"SSAO2RenderingPipeline\", function() {\n          return Ad;\n        }), f.d(A, \"SSAORenderingPipeline\", function() {\n          return eg;\n        }), f.d(A, \"StandardRenderingPipeline\", function() {\n          return Pd;\n        }), f.d(A, \"PostProcessRenderEffect\", function() {\n          return xt;\n        }), f.d(A, \"PostProcessRenderPipeline\", function() {\n          return Ir;\n        }), f.d(A, \"PostProcessRenderPipelineManager\", function() {\n          return Td;\n        }), f.d(A, \"PostProcessRenderPipelineManagerSceneComponent\", function() {\n          return Ed;\n        }), f.d(A, \"SharpenPostProcess\", function() {\n          return Ic;\n        }), f.d(A, \"StereoscopicInterlacePostProcessI\", function() {\n          return og;\n        }), f.d(A, \"StereoscopicInterlacePostProcess\", function() {\n          return ag;\n        }), f.d(A, \"TonemappingOperator\", function() {\n          return er;\n        }), f.d(A, \"TonemapPostProcess\", function() {\n          return cg;\n        }), f.d(A, \"VolumetricLightScatteringPostProcess\", function() {\n          return xd;\n        }), f.d(A, \"VRDistortionCorrectionPostProcess\", function() {\n          return $a;\n        }), f.d(A, \"VRMultiviewToSingleviewPostProcess\", function() {\n          return ts;\n        }), f.d(A, \"ScreenSpaceReflectionPostProcess\", function() {\n          return Dc;\n        }), f.d(A, \"ScreenSpaceCurvaturePostProcess\", function() {\n          return Cd;\n        }), f.d(A, \"ReflectionProbe\", function() {\n          return Du;\n        }), f.d(A, \"BoundingBoxRenderer\", function() {\n          return Rd;\n        }), f.d(A, \"DepthRenderer\", function() {\n          return Qo;\n        }), f.d(A, \"DepthRendererSceneComponent\", function() {\n          return Od;\n        }), f.d(A, \"EdgesRenderer\", function() {\n          return Lc;\n        }), f.d(A, \"LineEdgesRenderer\", function() {\n          return Md;\n        }), f.d(A, \"GeometryBufferRenderer\", function() {\n          return ri;\n        }), f.d(A, \"GeometryBufferRendererSceneComponent\", function() {\n          return yd;\n        }), f.d(A, \"PrePassRenderer\", function() {\n          return Nc;\n        }), f.d(A, \"PrePassRendererSceneComponent\", function() {\n          return Id;\n        }), f.d(A, \"SubSurfaceSceneComponent\", function() {\n          return Ld;\n        }), f.d(A, \"OutlineRenderer\", function() {\n          return Nd;\n        }), f.d(A, \"RenderingGroup\", function() {\n          return Tg.a;\n        }), f.d(A, \"RenderingGroupInfo\", function() {\n          return Hr.a;\n        }), f.d(A, \"RenderingManager\", function() {\n          return Hr.b;\n        }), f.d(A, \"UtilityLayerRenderer\", function() {\n          return Cn.a;\n        }), f.d(A, \"Scene\", function() {\n          return _e.a;\n        }), f.d(A, \"SceneComponentConstants\", function() {\n          return ot.a;\n        }), f.d(A, \"Stage\", function() {\n          return ot.b;\n        }), f.d(A, \"Sprite\", function() {\n          return wd;\n        }), f.d(A, \"SpriteManager\", function() {\n          return Bd;\n        }), f.d(A, \"SpriteMap\", function() {\n          return Cg;\n        }), f.d(A, \"SpritePackedManager\", function() {\n          return Rg;\n        }), f.d(A, \"SpriteSceneComponent\", function() {\n          return Fd;\n        }), f.d(A, \"AlphaState\", function() {\n          return Og.a;\n        }), f.d(A, \"DepthCullingState\", function() {\n          return Mg.a;\n        }), f.d(A, \"StencilState\", function() {\n          return Ig.a;\n        }), f.d(A, \"AndOrNotEvaluator\", function() {\n          return Dg.a;\n        }), f.d(A, \"AssetTaskState\", function() {\n          return ui;\n        }), f.d(A, \"AbstractAssetTask\", function() {\n          return hi;\n        }), f.d(A, \"AssetsProgressEvent\", function() {\n          return Ud;\n        }), f.d(A, \"ContainerAssetTask\", function() {\n          return Vd;\n        }), f.d(A, \"MeshAssetTask\", function() {\n          return kd;\n        }), f.d(A, \"TextFileAssetTask\", function() {\n          return Gd;\n        }), f.d(A, \"BinaryFileAssetTask\", function() {\n          return zd;\n        }), f.d(A, \"ImageAssetTask\", function() {\n          return jd;\n        }), f.d(A, \"TextureAssetTask\", function() {\n          return Hd;\n        }), f.d(A, \"CubeTextureAssetTask\", function() {\n          return Wd;\n        }), f.d(A, \"HDRCubeTextureAssetTask\", function() {\n          return Xd;\n        }), f.d(A, \"EquiRectangularCubeTextureAssetTask\", function() {\n          return Yd;\n        }), f.d(A, \"AssetsManager\", function() {\n          return Lg;\n        }), f.d(A, \"BasisTranscodeConfiguration\", function() {\n          return M_;\n        }), f.d(A, \"BasisTools\", function() {\n          return ro;\n        }), f.d(A, \"DDSTools\", function() {\n          return Li;\n        }), f.d(A, \"expandToProperty\", function() {\n          return L.b;\n        }), f.d(A, \"serialize\", function() {\n          return L.c;\n        }), f.d(A, \"serializeAsTexture\", function() {\n          return L.m;\n        }), f.d(A, \"serializeAsColor3\", function() {\n          return L.e;\n        }), f.d(A, \"serializeAsFresnelParameters\", function() {\n          return L.h;\n        }), f.d(A, \"serializeAsVector2\", function() {\n          return L.n;\n        }), f.d(A, \"serializeAsVector3\", function() {\n          return L.o;\n        }), f.d(A, \"serializeAsMeshReference\", function() {\n          return L.k;\n        }), f.d(A, \"serializeAsColorCurves\", function() {\n          return L.g;\n        }), f.d(A, \"serializeAsColor4\", function() {\n          return L.f;\n        }), f.d(A, \"serializeAsImageProcessingConfiguration\", function() {\n          return L.i;\n        }), f.d(A, \"serializeAsQuaternion\", function() {\n          return L.l;\n        }), f.d(A, \"serializeAsMatrix\", function() {\n          return L.j;\n        }), f.d(A, \"serializeAsCameraReference\", function() {\n          return L.d;\n        }), f.d(A, \"SerializationHelper\", function() {\n          return L.a;\n        }), f.d(A, \"Deferred\", function() {\n          return Ng;\n        }), f.d(A, \"EnvironmentTextureTools\", function() {\n          return gi;\n        }), f.d(A, \"MeshExploder\", function() {\n          return wg;\n        }), f.d(A, \"FilesInput\", function() {\n          return Fg;\n        }), f.d(A, \"CubeMapToSphericalPolynomialTools\", function() {\n          return Lo;\n        }), f.d(A, \"HDRTools\", function() {\n          return Pu;\n        }), f.d(A, \"PanoramaToCubeMapTools\", function() {\n          return ws;\n        }), f.d(A, \"KhronosTextureContainer\", function() {\n          return Yo;\n        }), f.d(A, \"EventState\", function() {\n          return C.a;\n        }), f.d(A, \"Observer\", function() {\n          return C.d;\n        }), f.d(A, \"MultiObserver\", function() {\n          return C.b;\n        }), f.d(A, \"Observable\", function() {\n          return C.c;\n        }), f.d(A, \"PerformanceMonitor\", function() {\n          return Kd.a;\n        }), f.d(A, \"RollingAverage\", function() {\n          return Kd.b;\n        }), f.d(A, \"PromisePolyfill\", function() {\n          return Bg.a;\n        }), f.d(A, \"SceneOptimization\", function() {\n          return di;\n        }), f.d(A, \"TextureOptimization\", function() {\n          return _a;\n        }), f.d(A, \"HardwareScalingOptimization\", function() {\n          return Fc;\n        }), f.d(A, \"ShadowsOptimization\", function() {\n          return ma;\n        }), f.d(A, \"PostProcessesOptimization\", function() {\n          return ga;\n        }), f.d(A, \"LensFlaresOptimization\", function() {\n          return va;\n        }), f.d(A, \"CustomOptimization\", function() {\n          return Qd;\n        }), f.d(A, \"ParticlesOptimization\", function() {\n          return ya;\n        }), f.d(A, \"RenderTargetsOptimization\", function() {\n          return Bc;\n        }), f.d(A, \"MergeMeshesOptimization\", function() {\n          return ba;\n        }), f.d(A, \"SceneOptimizerOptions\", function() {\n          return Uc;\n        }), f.d(A, \"SceneOptimizer\", function() {\n          return Ug;\n        }), f.d(A, \"SceneSerializer\", function() {\n          return kc;\n        }), f.d(A, \"SmartArray\", function() {\n          return si.a;\n        }), f.d(A, \"SmartArrayNoDuplicate\", function() {\n          return si.b;\n        }), f.d(A, \"StringDictionary\", function() {\n          return rl.a;\n        }), f.d(A, \"Tags\", function() {\n          return Vg.a;\n        }), f.d(A, \"TextureTools\", function() {\n          return kg;\n        }), f.d(A, \"TGATools\", function() {\n          return ta;\n        }), f.d(A, \"Tools\", function() {\n          return Xe.b;\n        }), f.d(A, \"className\", function() {\n          return Xe.c;\n        }), f.d(A, \"AsyncLoop\", function() {\n          return Xe.a;\n        }), f.d(A, \"VideoRecorder\", function() {\n          return Gg;\n        }), f.d(A, \"JoystickAxis\", function() {\n          return rn;\n        }), f.d(A, \"VirtualJoystick\", function() {\n          return Ka;\n        }), f.d(A, \"WorkerPool\", function() {\n          return xs;\n        }), f.d(A, \"Logger\", function() {\n          return l.a;\n        }), f.d(A, \"_TypeStore\", function() {\n          return O.a;\n        }), f.d(A, \"FilesInputStore\", function() {\n          return fs.a;\n        }), f.d(A, \"DeepCopier\", function() {\n          return de.a;\n        }), f.d(A, \"PivotTools\", function() {\n          return Un.a;\n        }), f.d(A, \"PrecisionDate\", function() {\n          return ye.a;\n        }), f.d(A, \"ScreenshotTools\", function() {\n          return yo;\n        }), f.d(A, \"WebRequest\", function() {\n          return re.a;\n        }), f.d(A, \"InspectableType\", function() {\n          return wc;\n        }), f.d(A, \"BRDFTextureTools\", function() {\n          return Ho;\n        }), f.d(A, \"RGBDTextureTools\", function() {\n          return ql;\n        }), f.d(A, \"ColorGradient\", function() {\n          return gc;\n        }), f.d(A, \"Color3Gradient\", function() {\n          return ad;\n        }), f.d(A, \"FactorGradient\", function() {\n          return vc;\n        }), f.d(A, \"GradientHelper\", function() {\n          return On;\n        }), f.d(A, \"PerfCounter\", function() {\n          return Gn.a;\n        }), f.d(A, \"RetryStrategy\", function() {\n          return zg.a;\n        }), f.d(A, \"CanvasGenerator\", function() {\n          return ns.a;\n        }), f.d(A, \"LoadFileError\", function() {\n          return Xr.b;\n        }), f.d(A, \"RequestFileError\", function() {\n          return Xr.d;\n        }), f.d(A, \"ReadFileError\", function() {\n          return Xr.c;\n        }), f.d(A, \"FileTools\", function() {\n          return Xr.a;\n        }), f.d(A, \"StringTools\", function() {\n          return Hn.a;\n        }), f.d(A, \"DataReader\", function() {\n          return jg;\n        }), f.d(A, \"MinMaxReducer\", function() {\n          return yu;\n        }), f.d(A, \"DepthReducer\", function() {\n          return bu;\n        }), f.d(A, \"DataStorage\", function() {\n          return Hg;\n        }), f.d(A, \"SceneRecorder\", function() {\n          return Wg;\n        }), f.d(A, \"KhronosTextureContainer2\", function() {\n          return Cs;\n        }), f.d(A, \"Trajectory\", function() {\n          return Xg;\n        }), f.d(A, \"TrajectoryClassifier\", function() {\n          return Yg;\n        }), f.d(A, \"TimerState\", function() {\n          return Ni;\n        }), f.d(A, \"setAndStartTimer\", function() {\n          return Os;\n        }), f.d(A, \"AdvancedTimer\", function() {\n          return Kp;\n        }), f.d(A, \"CopyTools\", function() {\n          return Kg.a;\n        }), f.d(A, \"WebXRCamera\", function() {\n          return iu;\n        }), f.d(A, \"WebXREnterExitUIButton\", function() {\n          return cu;\n        }), f.d(A, \"WebXREnterExitUIOptions\", function() {\n          return Yp;\n        }), f.d(A, \"WebXREnterExitUI\", function() {\n          return lu;\n        }), f.d(A, \"WebXRExperienceHelper\", function() {\n          return ru;\n        }), f.d(A, \"WebXRInput\", function() {\n          return su;\n        }), f.d(A, \"WebXRInputSource\", function() {\n          return au;\n        }), f.d(A, \"WebXRManagedOutputCanvasOptions\", function() {\n          return is;\n        }), f.d(A, \"WebXRManagedOutputCanvas\", function() {\n          return Rl;\n        }), f.d(A, \"WebXRState\", function() {\n          return fn;\n        }), f.d(A, \"WebXRTrackingState\", function() {\n          return Yi;\n        }), f.d(A, \"WebXRSessionManager\", function() {\n          return rs;\n        }), f.d(A, \"WebXRDefaultExperienceOptions\", function() {\n          return Qp;\n        }), f.d(A, \"WebXRDefaultExperience\", function() {\n          return uu;\n        }), f.d(A, \"WebXRFeatureName\", function() {\n          return ti;\n        }), f.d(A, \"WebXRFeaturesManager\", function() {\n          return Wn;\n        }), f.d(A, \"WebXRAbstractFeature\", function() {\n          return ni;\n        }), f.d(A, \"WebXRHitTestLegacy\", function() {\n          return Ea;\n        }), f.d(A, \"WebXRAnchorSystem\", function() {\n          return Sa;\n        }), f.d(A, \"WebXRPlaneDetector\", function() {\n          return Aa;\n        }), f.d(A, \"WebXRBackgroundRemover\", function() {\n          return Pa;\n        }), f.d(A, \"WebXRMotionControllerTeleportation\", function() {\n          return to;\n        }), f.d(A, \"WebXRControllerPointerSelection\", function() {\n          return eo;\n        }), f.d(A, \"IWebXRControllerPhysicsOptions\", function() {\n          return Zg;\n        }), f.d(A, \"WebXRControllerPhysics\", function() {\n          return xa;\n        }), f.d(A, \"WebXRHitTest\", function() {\n          return Ca;\n        }), f.d(A, \"WebXRFeaturePointSystem\", function() {\n          return Ra;\n        }), f.d(A, \"WebXRHand\", function() {\n          return $d;\n        }), f.d(A, \"WebXRHandTracking\", function() {\n          return Oa;\n        }), f.d(A, \"WebXRAbstractMotionController\", function() {\n          return br;\n        }), f.d(A, \"WebXRControllerComponent\", function() {\n          return yr;\n        }), f.d(A, \"WebXRGenericTriggerMotionController\", function() {\n          return Rs;\n        }), f.d(A, \"WebXRMicrosoftMixedRealityController\", function() {\n          return ef;\n        }), f.d(A, \"WebXRMotionControllerManager\", function() {\n          return wn;\n        }), f.d(A, \"WebXROculusTouchMotionController\", function() {\n          return zc;\n        }), f.d(A, \"WebXRHTCViveMotionController\", function() {\n          return tf;\n        }), f.d(A, \"WebXRProfiledMotionController\", function() {\n          return ou;\n        });\n        var V = f(35), _ = f(91), C = f(6), u = f(0), I = f(9), O = f(11), x = function() {\n          function r(t, e) {\n            this.triggerOptions = t, this.onBeforeExecuteObservable = new C.c(), t.parameter ? (this.trigger = t.trigger, this._triggerParameter = t.parameter) : t.trigger ? this.trigger = t.trigger : this.trigger = t, this._nextActiveAction = this, this._condition = e;\n          }\n          return r.prototype._prepare = function() {\n          }, r.prototype.getTriggerParameter = function() {\n            return this._triggerParameter;\n          }, r.prototype._executeCurrent = function(t) {\n            if (this._nextActiveAction._condition) {\n              var e = this._nextActiveAction._condition, n = this._actionManager.getScene().getRenderId();\n              if (e._evaluationId === n) {\n                if (!e._currentResult)\n                  return;\n              } else {\n                if (e._evaluationId = n, !e.isValid())\n                  return void (e._currentResult = !1);\n                e._currentResult = !0;\n              }\n            }\n            this.onBeforeExecuteObservable.notifyObservers(this), this._nextActiveAction.execute(t), this.skipToNextActiveAction();\n          }, r.prototype.execute = function(t) {\n          }, r.prototype.skipToNextActiveAction = function() {\n            this._nextActiveAction._child ? (this._nextActiveAction._child._actionManager || (this._nextActiveAction._child._actionManager = this._actionManager), this._nextActiveAction = this._nextActiveAction._child) : this._nextActiveAction = this;\n          }, r.prototype.then = function(t) {\n            return this._child = t, t._actionManager = this._actionManager, t._prepare(), t;\n          }, r.prototype._getProperty = function(t) {\n            return this._actionManager._getProperty(t);\n          }, r.prototype._getEffectiveTarget = function(t, e) {\n            return this._actionManager._getEffectiveTarget(t, e);\n          }, r.prototype.serialize = function(t) {\n          }, r.prototype._serialize = function(t, e) {\n            var n = { type: 1, children: [], name: t.name, properties: t.properties || [] };\n            if (this._child && this._child.serialize(n), this._condition) {\n              var i = this._condition.serialize();\n              return i.children.push(n), e && e.children.push(i), i;\n            }\n            return e && e.children.push(n), n;\n          }, r._SerializeValueAsString = function(t) {\n            return typeof t == \"number\" ? t.toString() : typeof t == \"boolean\" ? t ? \"true\" : \"false\" : t instanceof u.d ? t.x + \", \" + t.y : t instanceof u.e ? t.x + \", \" + t.y + \", \" + t.z : t instanceof I.a ? t.r + \", \" + t.g + \", \" + t.b : t instanceof I.b ? t.r + \", \" + t.g + \", \" + t.b + \", \" + t.a : t;\n          }, r._GetTargetProperty = function(t) {\n            return { name: \"target\", targetType: t._isMesh ? \"MeshProperties\" : t._isLight ? \"LightProperties\" : t._isCamera ? \"CameraProperties\" : \"SceneProperties\", value: t._isScene ? \"Scene\" : t.name };\n          }, r;\n        }();\n        O.a.RegisteredTypes[\"BABYLON.Action\"] = x;\n        var m = f(47), c = f(1), T = function() {\n          function r(t) {\n            this._actionManager = t;\n          }\n          return r.prototype.isValid = function() {\n            return !0;\n          }, r.prototype._getProperty = function(t) {\n            return this._actionManager._getProperty(t);\n          }, r.prototype._getEffectiveTarget = function(t, e) {\n            return this._actionManager._getEffectiveTarget(t, e);\n          }, r.prototype.serialize = function() {\n          }, r.prototype._serialize = function(t) {\n            return { type: 2, children: [], name: t.name, properties: t.properties };\n          }, r;\n        }(), S = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = t.IsEqual);\n            var s = r.call(this, e) || this;\n            return s.propertyPath = i, s.value = o, s.operator = a, s._target = n, s._effectiveTarget = s._getEffectiveTarget(n, s.propertyPath), s._property = s._getProperty(s.propertyPath), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t, \"IsEqual\", { get: function() {\n            return t._IsEqual;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsDifferent\", { get: function() {\n            return t._IsDifferent;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsGreater\", { get: function() {\n            return t._IsGreater;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsLesser\", { get: function() {\n            return t._IsLesser;\n          }, enumerable: !1, configurable: !0 }), t.prototype.isValid = function() {\n            switch (this.operator) {\n              case t.IsGreater:\n                return this._effectiveTarget[this._property] > this.value;\n              case t.IsLesser:\n                return this._effectiveTarget[this._property] < this.value;\n              case t.IsEqual:\n              case t.IsDifferent:\n                var e;\n                return e = this.value.equals ? this.value.equals(this._effectiveTarget[this._property]) : this.value === this._effectiveTarget[this._property], this.operator === t.IsEqual ? e : !e;\n            }\n            return !1;\n          }, t.prototype.serialize = function() {\n            return this._serialize({ name: \"ValueCondition\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }, { name: \"operator\", value: t.GetOperatorName(this.operator) }] });\n          }, t.GetOperatorName = function(e) {\n            switch (e) {\n              case t._IsEqual:\n                return \"IsEqual\";\n              case t._IsDifferent:\n                return \"IsDifferent\";\n              case t._IsGreater:\n                return \"IsGreater\";\n              case t._IsLesser:\n                return \"IsLesser\";\n              default:\n                return \"\";\n            }\n          }, t._IsEqual = 0, t._IsDifferent = 1, t._IsGreater = 2, t._IsLesser = 3, t;\n        }(T), E = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.predicate = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.isValid = function() {\n            return this.predicate();\n          }, t;\n        }(T), g = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e) || this;\n            return o.value = i, o._target = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype.isValid = function() {\n            return this._target.state === this.value;\n          }, t.prototype.serialize = function() {\n            return this._serialize({ name: \"StateCondition\", properties: [x._GetTargetProperty(this._target), { name: \"value\", value: this.value }] });\n          }, t;\n        }(T);\n        O.a.RegisteredTypes[\"BABYLON.ValueCondition\"] = S, O.a.RegisteredTypes[\"BABYLON.PredicateCondition\"] = E, O.a.RegisteredTypes[\"BABYLON.StateCondition\"] = g;\n        var l = f(8), h = f(2), v = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, o) || this;\n            return a.propertyPath = i, a._target = a._effectiveTarget = n, a;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);\n          }, t.prototype.execute = function() {\n            this._effectiveTarget[this._property] = !this._effectiveTarget[this._property];\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SwitchBooleanAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }] }, e);\n          }, t;\n        }(x), b = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, o) || this;\n            return a.value = i, a._target = n, a;\n          }\n          return Object(c.d)(t, r), t.prototype.execute = function() {\n            this._target.state = this.value;\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SetStateAction\", properties: [x._GetTargetProperty(this._target), { name: \"value\", value: this.value }] }, e);\n          }, t;\n        }(x), D = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, a) || this;\n            return s.propertyPath = i, s.value = o, s._target = s._effectiveTarget = n, s;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);\n          }, t.prototype.execute = function() {\n            this._effectiveTarget[this._property] = this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SetValueAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }] }, e);\n          }, t;\n        }(x), w = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, a) || this;\n            return s.propertyPath = i, s.value = o, s._target = s._effectiveTarget = n, s;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath), typeof this._effectiveTarget[this._property] != \"number\" && l.a.Warn(\"Warning: IncrementValueAction can only be used with number values\");\n          }, t.prototype.execute = function() {\n            this._effectiveTarget[this._property] += this.value, this._target.markAsDirty && this._target.markAsDirty(this._property);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"IncrementValueAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }] }, e);\n          }, t;\n        }(x), N = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, s) || this;\n            return d.from = i, d.to = o, d.loop = a, d._target = n, d;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._actionManager.getScene().beginAnimation(this._target, this.from, this.to, this.loop);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"PlayAnimationAction\", properties: [x._GetTargetProperty(this._target), { name: \"from\", value: String(this.from) }, { name: \"to\", value: String(this.to) }, { name: \"loop\", value: x._SerializeValueAsString(this.loop) || !1 }] }, e);\n          }, t;\n        }(x), M = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._target = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._actionManager.getScene().stopAnimation(this._target);\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"StopAnimationAction\", properties: [x._GetTargetProperty(this._target)] }, e);\n          }, t;\n        }(x), U = function(r) {\n          function t(e, n) {\n            return e === void 0 && (e = h.a.ACTION_NothingTrigger), r.call(this, e, n) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.execute = function() {\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"DoNothingAction\", properties: [] }, e);\n          }, t;\n        }(x), X = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o.children = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            for (var e = 0; e < this.children.length; e++)\n              this.children[e]._actionManager = this._actionManager, this.children[e]._prepare();\n          }, t.prototype.execute = function(e) {\n            for (var n = 0; n < this.children.length; n++)\n              this.children[n].execute(e);\n          }, t.prototype.serialize = function(e) {\n            for (var n = r.prototype._serialize.call(this, { name: \"CombineAction\", properties: [], combine: [] }, e), i = 0; i < this.children.length; i++)\n              n.combine.push(this.children[i].serialize(null));\n            return n;\n          }, t;\n        }(x), j = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o.func = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype.execute = function(e) {\n            this.func(e);\n          }, t;\n        }(x), ne = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, o) || this;\n            return a._target = n, a._parent = i, a;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            if (this._target.parent !== this._parent) {\n              var e = this._parent.getWorldMatrix().clone();\n              e.invert(), this._target.position = u.e.TransformCoordinates(this._target.position, e), this._target.parent = this._parent;\n            }\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"SetParentAction\", properties: [x._GetTargetProperty(this._target), x._GetTargetProperty(this._parent)] }, e);\n          }, t;\n        }(x);\n        O.a.RegisteredTypes[\"BABYLON.SetParentAction\"] = ne, O.a.RegisteredTypes[\"BABYLON.ExecuteCodeAction\"] = j, O.a.RegisteredTypes[\"BABYLON.DoNothingAction\"] = U, O.a.RegisteredTypes[\"BABYLON.StopAnimationAction\"] = M, O.a.RegisteredTypes[\"BABYLON.PlayAnimationAction\"] = N, O.a.RegisteredTypes[\"BABYLON.IncrementValueAction\"] = w, O.a.RegisteredTypes[\"BABYLON.SetValueAction\"] = D, O.a.RegisteredTypes[\"BABYLON.SetStateAction\"] = b, O.a.RegisteredTypes[\"BABYLON.SetParentAction\"] = ne;\n        var te = f(22), de = f(41), pe = function(r) {\n          function t(e) {\n            var n = r.call(this) || this;\n            return n._scene = e || te.a.LastCreatedScene, e.actionManagers.push(n), n;\n          }\n          return Object(c.d)(t, r), t.prototype.dispose = function() {\n            for (var e = this._scene.actionManagers.indexOf(this), n = 0; n < this.actions.length; n++) {\n              var i = this.actions[n];\n              t.Triggers[i.trigger]--, t.Triggers[i.trigger] === 0 && delete t.Triggers[i.trigger];\n            }\n            e > -1 && this._scene.actionManagers.splice(e, 1);\n          }, t.prototype.getScene = function() {\n            return this._scene;\n          }, t.prototype.hasSpecificTriggers = function(e) {\n            for (var n = 0; n < this.actions.length; n++) {\n              var i = this.actions[n];\n              if (e.indexOf(i.trigger) > -1)\n                return !0;\n            }\n            return !1;\n          }, t.prototype.hasSpecificTriggers2 = function(e, n) {\n            for (var i = 0; i < this.actions.length; i++) {\n              var o = this.actions[i];\n              if (e == o.trigger || n == o.trigger)\n                return !0;\n            }\n            return !1;\n          }, t.prototype.hasSpecificTrigger = function(e, n) {\n            for (var i = 0; i < this.actions.length; i++) {\n              var o = this.actions[i];\n              if (o.trigger === e && (!n || n(o.getTriggerParameter())))\n                return !0;\n            }\n            return !1;\n          }, Object.defineProperty(t.prototype, \"hasPointerTriggers\", { get: function() {\n            for (var e = 0; e < this.actions.length; e++) {\n              var n = this.actions[e];\n              if (n.trigger >= t.OnPickTrigger && n.trigger <= t.OnPointerOutTrigger)\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasPickTriggers\", { get: function() {\n            for (var e = 0; e < this.actions.length; e++) {\n              var n = this.actions[e];\n              if (n.trigger >= t.OnPickTrigger && n.trigger <= t.OnPickUpTrigger)\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), t.prototype.registerAction = function(e) {\n            return e.trigger === t.OnEveryFrameTrigger && this.getScene().actionManager !== this ? (l.a.Warn(\"OnEveryFrameTrigger can only be used with scene.actionManager\"), null) : (this.actions.push(e), t.Triggers[e.trigger] ? t.Triggers[e.trigger]++ : t.Triggers[e.trigger] = 1, e._actionManager = this, e._prepare(), e);\n          }, t.prototype.unregisterAction = function(e) {\n            var n = this.actions.indexOf(e);\n            return n !== -1 && (this.actions.splice(n, 1), t.Triggers[e.trigger] -= 1, t.Triggers[e.trigger] === 0 && delete t.Triggers[e.trigger], e._actionManager = null, !0);\n          }, t.prototype.processTrigger = function(e, n) {\n            for (var i = 0; i < this.actions.length; i++) {\n              var o = this.actions[i];\n              if (o.trigger === e) {\n                if (n && (e === t.OnKeyUpTrigger || e === t.OnKeyDownTrigger)) {\n                  var a = o.getTriggerParameter();\n                  if (a && a !== n.sourceEvent.keyCode) {\n                    if (!a.toLowerCase)\n                      continue;\n                    var s = a.toLowerCase();\n                    if (s !== n.sourceEvent.key) {\n                      var d = n.sourceEvent.charCode ? n.sourceEvent.charCode : n.sourceEvent.keyCode;\n                      if (String.fromCharCode(d).toLowerCase() !== s)\n                        continue;\n                    }\n                  }\n                }\n                o._executeCurrent(n);\n              }\n            }\n          }, t.prototype._getEffectiveTarget = function(e, n) {\n            for (var i = n.split(\".\"), o = 0; o < i.length - 1; o++)\n              e = e[i[o]];\n            return e;\n          }, t.prototype._getProperty = function(e) {\n            var n = e.split(\".\");\n            return n[n.length - 1];\n          }, t.prototype.serialize = function(e) {\n            for (var n = { children: new Array(), name: e, type: 3, properties: new Array() }, i = 0; i < this.actions.length; i++) {\n              var o = { type: 0, children: new Array(), name: t.GetTriggerName(this.actions[i].trigger), properties: new Array() }, a = this.actions[i].triggerOptions;\n              if (a && typeof a != \"number\")\n                if (a.parameter instanceof Node)\n                  o.properties.push(x._GetTargetProperty(a.parameter));\n                else {\n                  var s = {};\n                  de.a.DeepCopy(a.parameter, s, [\"mesh\"]), a.parameter && a.parameter.mesh && (s._meshId = a.parameter.mesh.id), o.properties.push({ name: \"parameter\", targetType: null, value: s });\n                }\n              this.actions[i].serialize(o), n.children.push(o);\n            }\n            return n;\n          }, t.Parse = function(e, n, i) {\n            var o = new t(i);\n            n === null ? i.actionManager = o : n.actionManager = o;\n            for (var a = function(F, z, J, ie) {\n              if (ie === null) {\n                var se = parseFloat(z);\n                return z === \"true\" || z === \"false\" ? z === \"true\" : isNaN(se) ? z : se;\n              }\n              for (var ce = ie.split(\".\"), ue = z.split(\",\"), fe = 0; fe < ce.length; fe++)\n                J = J[ce[fe]];\n              if (typeof J == \"boolean\")\n                return ue[0] === \"true\";\n              if (typeof J == \"string\")\n                return ue[0];\n              var ve = new Array();\n              for (fe = 0; fe < ue.length; fe++)\n                ve.push(parseFloat(ue[fe]));\n              return J instanceof u.e ? u.e.FromArray(ve) : J instanceof u.f ? u.f.FromArray(ve) : J instanceof I.a ? I.a.FromArray(ve) : J instanceof I.b ? I.b.FromArray(ve) : parseFloat(ue[0]);\n            }, s = function(F, z, J, ie, se) {\n              if (se === void 0 && (se = null), !F.detached) {\n                var ce = new Array(), ue = null, fe = null, ve = F.combine && F.combine.length > 0;\n                if (F.type === 2 ? ce.push(o) : ce.push(z), ve) {\n                  for (var Te = new Array(), Re = 0; Re < F.combine.length; Re++)\n                    s(F.combine[Re], t.NothingTrigger, J, ie, Te);\n                  ce.push(Te);\n                } else\n                  for (var Ae = 0; Ae < F.properties.length; Ae++) {\n                    var Ee = F.properties[Ae].value, Se = F.properties[Ae].name, De = F.properties[Ae].targetType;\n                    Se === \"target\" ? Ee = ue = De !== null && De === \"SceneProperties\" ? i : i.getNodeByName(Ee) : Se === \"parent\" ? Ee = i.getNodeByName(Ee) : Se === \"sound\" ? i.getSoundByName && (Ee = i.getSoundByName(Ee)) : Se !== \"propertyPath\" ? Ee = F.type === 2 && Se === \"operator\" ? S[Ee] : a(0, Ee, ue, Se === \"value\" ? fe : null) : fe = Ee, ce.push(Ee);\n                  }\n                if (se === null ? ce.push(J) : ce.push(null), F.name === \"InterpolateValueAction\") {\n                  var xe = ce[ce.length - 2];\n                  ce[ce.length - 1] = xe, ce[ce.length - 2] = J;\n                }\n                var Le = function(we, Ye) {\n                  var et = O.a.GetClass(\"BABYLON.\" + we);\n                  if (et) {\n                    var nt = Object.create(et.prototype);\n                    return nt.constructor.apply(nt, Ye), nt;\n                  }\n                }(F.name, ce);\n                if (Le instanceof T && J !== null) {\n                  var Me = new U(z, J);\n                  ie ? ie.then(Me) : o.registerAction(Me), ie = Me;\n                }\n                for (se === null ? Le instanceof T ? (J = Le, Le = ie) : (J = null, ie ? ie.then(Le) : o.registerAction(Le)) : se.push(Le), Ae = 0; Ae < F.children.length; Ae++)\n                  s(F.children[Ae], z, J, Le, null);\n              }\n            }, d = 0; d < e.children.length; d++) {\n              var p, y = e.children[d];\n              if (y.properties.length > 0) {\n                var P = y.properties[0].value, R = y.properties[0].targetType === null ? P : i.getMeshByName(P);\n                R._meshId && (R.mesh = i.getMeshByID(R._meshId)), p = { trigger: t[y.name], parameter: R };\n              } else\n                p = t[y.name];\n              for (var B = 0; B < y.children.length; B++)\n                y.detached || s(y.children[B], p, null, null);\n            }\n          }, t.GetTriggerName = function(e) {\n            switch (e) {\n              case 0:\n                return \"NothingTrigger\";\n              case 1:\n                return \"OnPickTrigger\";\n              case 2:\n                return \"OnLeftPickTrigger\";\n              case 3:\n                return \"OnRightPickTrigger\";\n              case 4:\n                return \"OnCenterPickTrigger\";\n              case 5:\n                return \"OnPickDownTrigger\";\n              case 6:\n                return \"OnPickUpTrigger\";\n              case 7:\n                return \"OnLongPressTrigger\";\n              case 8:\n                return \"OnPointerOverTrigger\";\n              case 9:\n                return \"OnPointerOutTrigger\";\n              case 10:\n                return \"OnEveryFrameTrigger\";\n              case 11:\n                return \"OnIntersectionEnterTrigger\";\n              case 12:\n                return \"OnIntersectionExitTrigger\";\n              case 13:\n                return \"OnKeyDownTrigger\";\n              case 14:\n                return \"OnKeyUpTrigger\";\n              case 15:\n                return \"OnPickOutTrigger\";\n              default:\n                return \"\";\n            }\n          }, t.NothingTrigger = h.a.ACTION_NothingTrigger, t.OnPickTrigger = h.a.ACTION_OnPickTrigger, t.OnLeftPickTrigger = h.a.ACTION_OnLeftPickTrigger, t.OnRightPickTrigger = h.a.ACTION_OnRightPickTrigger, t.OnCenterPickTrigger = h.a.ACTION_OnCenterPickTrigger, t.OnPickDownTrigger = h.a.ACTION_OnPickDownTrigger, t.OnDoublePickTrigger = h.a.ACTION_OnDoublePickTrigger, t.OnPickUpTrigger = h.a.ACTION_OnPickUpTrigger, t.OnPickOutTrigger = h.a.ACTION_OnPickOutTrigger, t.OnLongPressTrigger = h.a.ACTION_OnLongPressTrigger, t.OnPointerOverTrigger = h.a.ACTION_OnPointerOverTrigger, t.OnPointerOutTrigger = h.a.ACTION_OnPointerOutTrigger, t.OnEveryFrameTrigger = h.a.ACTION_OnEveryFrameTrigger, t.OnIntersectionEnterTrigger = h.a.ACTION_OnIntersectionEnterTrigger, t.OnIntersectionExitTrigger = h.a.ACTION_OnIntersectionExitTrigger, t.OnKeyDownTrigger = h.a.ACTION_OnKeyDownTrigger, t.OnKeyUpTrigger = 15, t;\n        }(_.a), ae = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._sound = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._sound !== void 0 && this._sound.play();\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"PlaySoundAction\", properties: [{ name: \"sound\", value: this._sound.name }] }, e);\n          }, t;\n        }(x), ee = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._sound = n, o;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n          }, t.prototype.execute = function() {\n            this._sound !== void 0 && this._sound.stop();\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"StopSoundAction\", properties: [{ name: \"sound\", value: this._sound.name }] }, e);\n          }, t;\n        }(x);\n        O.a.RegisteredTypes[\"BABYLON.PlaySoundAction\"] = ee, O.a.RegisteredTypes[\"BABYLON.StopSoundAction\"] = ee;\n        var K, $ = f(14), L = f(3);\n        (function(r) {\n          r[r.STEP = 1] = \"STEP\";\n        })(K || (K = {}));\n        var G = function() {\n          function r(t, e, n) {\n            this.name = t, this.from = e, this.to = n;\n          }\n          return r.prototype.clone = function() {\n            return new r(this.name, this.from, this.to);\n          }, r;\n        }(), Q = f(29), oe = f(77), re = f(49), Y = function() {\n        }, k = function() {\n          function r(t, e, n, i, o, a) {\n            this.name = t, this.targetProperty = e, this.framePerSecond = n, this.dataType = i, this.loopMode = o, this.enableBlending = a, this._runtimeAnimations = new Array(), this._events = new Array(), this.blendingSpeed = 0.01, this._ranges = {}, this.targetPropertyPath = e.split(\".\"), this.dataType = i, this.loopMode = o === void 0 ? r.ANIMATIONLOOPMODE_CYCLE : o;\n          }\n          return r._PrepareAnimation = function(t, e, n, i, o, a, s, d) {\n            var p = void 0;\n            if (!isNaN(parseFloat(o)) && isFinite(o) ? p = r.ANIMATIONTYPE_FLOAT : o instanceof u.b ? p = r.ANIMATIONTYPE_QUATERNION : o instanceof u.e ? p = r.ANIMATIONTYPE_VECTOR3 : o instanceof u.d ? p = r.ANIMATIONTYPE_VECTOR2 : o instanceof I.a ? p = r.ANIMATIONTYPE_COLOR3 : o instanceof I.b ? p = r.ANIMATIONTYPE_COLOR4 : o instanceof oe.a && (p = r.ANIMATIONTYPE_SIZE), p == null)\n              return null;\n            var y = new r(t, e, n, p, s), P = [{ frame: 0, value: o }, { frame: i, value: a }];\n            return y.setKeys(P), d !== void 0 && y.setEasingFunction(d), y;\n          }, r.CreateAnimation = function(t, e, n, i) {\n            var o = new r(t + \"Animation\", t, n, e, r.ANIMATIONLOOPMODE_CONSTANT);\n            return o.setEasingFunction(i), o;\n          }, r.CreateAndStartAnimation = function(t, e, n, i, o, a, s, d, p, y) {\n            var P = r._PrepareAnimation(t, n, i, o, a, s, d, p);\n            return P ? e.getScene().beginDirectAnimation(e, [P], 0, o, P.loopMode === 1, 1, y) : null;\n          }, r.CreateAndStartHierarchyAnimation = function(t, e, n, i, o, a, s, d, p, y, P) {\n            var R = r._PrepareAnimation(t, i, o, a, s, d, p, y);\n            return R ? e.getScene().beginDirectHierarchyAnimation(e, n, [R], 0, a, R.loopMode === 1, 1, P) : null;\n          }, r.CreateMergeAndStartAnimation = function(t, e, n, i, o, a, s, d, p, y) {\n            var P = r._PrepareAnimation(t, n, i, o, a, s, d, p);\n            return P ? (e.animations.push(P), e.getScene().beginAnimation(e, 0, o, P.loopMode === 1, 1, y)) : null;\n          }, r.MakeAnimationAdditive = function(t, e, n, i, o) {\n            e === void 0 && (e = 0), i === void 0 && (i = !1);\n            var a = t;\n            if (i && ((a = t.clone()).name = o || a.name), !a._keys.length)\n              return a;\n            e = e >= 0 ? e : 0;\n            var s = 0, d = a._keys[0], p = a._keys.length - 1, y = a._keys[p], P = { referenceValue: d.value, referencePosition: u.c.Vector3[0], referenceQuaternion: u.c.Quaternion[0], referenceScaling: u.c.Vector3[1], keyPosition: u.c.Vector3[2], keyQuaternion: u.c.Quaternion[1], keyScaling: u.c.Vector3[3] }, R = !1, B = d.frame, F = y.frame;\n            if (n) {\n              var z = a.getRange(n);\n              z && (B = z.from, F = z.to);\n            }\n            var J = d.frame === B, ie = y.frame === F;\n            if (a._keys.length === 1) {\n              var se = a._getKeyValue(a._keys[0]);\n              P.referenceValue = se.clone ? se.clone() : se, R = !0;\n            } else\n              e <= d.frame ? (se = a._getKeyValue(d.value), P.referenceValue = se.clone ? se.clone() : se, R = !0) : e >= y.frame && (se = a._getKeyValue(y.value), P.referenceValue = se.clone ? se.clone() : se, R = !0);\n            for (var ce = 0; !R || !J || !ie && ce < a._keys.length - 1; ) {\n              var ue = a._keys[ce], fe = a._keys[ce + 1];\n              if (!R && e >= ue.frame && e <= fe.frame) {\n                if (se = void 0, e === ue.frame)\n                  se = a._getKeyValue(ue.value);\n                else if (e === fe.frame)\n                  se = a._getKeyValue(fe.value);\n                else {\n                  var ve = { key: ce, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT };\n                  se = a._interpolate(e, ve);\n                }\n                P.referenceValue = se.clone ? se.clone() : se, R = !0;\n              }\n              if (!J && B >= ue.frame && B <= fe.frame) {\n                if (B === ue.frame)\n                  s = ce;\n                else if (B === fe.frame)\n                  s = ce + 1;\n                else {\n                  ve = { key: ce, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT };\n                  var Te = { frame: B, value: (se = a._interpolate(B, ve)).clone ? se.clone() : se };\n                  a._keys.splice(ce + 1, 0, Te), s = ce + 1;\n                }\n                J = !0;\n              }\n              !ie && F >= ue.frame && F <= fe.frame && (F === ue.frame ? p = ce : F === fe.frame ? p = ce + 1 : (ve = { key: ce, repeatCount: 0, loopMode: this.ANIMATIONLOOPMODE_CONSTANT }, Te = { frame: F, value: (se = a._interpolate(F, ve)).clone ? se.clone() : se }, a._keys.splice(ce + 1, 0, Te), p = ce + 1), ie = !0), ce++;\n            }\n            for (a.dataType === r.ANIMATIONTYPE_QUATERNION ? P.referenceValue.normalize().conjugateInPlace() : a.dataType === r.ANIMATIONTYPE_MATRIX && (P.referenceValue.decompose(P.referenceScaling, P.referenceQuaternion, P.referencePosition), P.referenceQuaternion.normalize().conjugateInPlace()), ce = s; ce <= p; ce++)\n              if (Te = a._keys[ce], !ce || a.dataType === r.ANIMATIONTYPE_FLOAT || Te.value !== d.value)\n                switch (a.dataType) {\n                  case r.ANIMATIONTYPE_MATRIX:\n                    Te.value.decompose(P.keyScaling, P.keyQuaternion, P.keyPosition), P.keyPosition.subtractInPlace(P.referencePosition), P.keyScaling.divideInPlace(P.referenceScaling), P.referenceQuaternion.multiplyToRef(P.keyQuaternion, P.keyQuaternion), u.a.ComposeToRef(P.keyScaling, P.keyQuaternion, P.keyPosition, Te.value);\n                    break;\n                  case r.ANIMATIONTYPE_QUATERNION:\n                    P.referenceValue.multiplyToRef(Te.value, Te.value);\n                    break;\n                  case r.ANIMATIONTYPE_VECTOR2:\n                  case r.ANIMATIONTYPE_VECTOR3:\n                  case r.ANIMATIONTYPE_COLOR3:\n                  case r.ANIMATIONTYPE_COLOR4:\n                    Te.value.subtractToRef(P.referenceValue, Te.value);\n                    break;\n                  case r.ANIMATIONTYPE_SIZE:\n                    Te.value.width -= P.referenceValue.width, Te.value.height -= P.referenceValue.height;\n                    break;\n                  default:\n                    Te.value -= P.referenceValue;\n                }\n            return a;\n          }, r.TransitionTo = function(t, e, n, i, o, a, s, d) {\n            if (d === void 0 && (d = null), s <= 0)\n              return n[t] = e, d && d(), null;\n            var p = o * (s / 1e3);\n            a.setKeys([{ frame: 0, value: n[t].clone ? n[t].clone() : n[t] }, { frame: p, value: e }]), n.animations || (n.animations = []), n.animations.push(a);\n            var y = i.beginAnimation(n, 0, p, !1);\n            return y.onAnimationEnd = d, y;\n          }, Object.defineProperty(r.prototype, \"runtimeAnimations\", { get: function() {\n            return this._runtimeAnimations;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasRunningRuntimeAnimations\", { get: function() {\n            for (var t = 0, e = this._runtimeAnimations; t < e.length; t++)\n              if (!e[t].isStopped)\n                return !0;\n            return !1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name + \", property: \" + this.targetProperty;\n            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) {\n              e += \", Ranges: {\";\n              var n = !0;\n              for (var i in this._ranges)\n                n && (e += \", \", n = !1), e += i;\n              e += \"}\";\n            }\n            return e;\n          }, r.prototype.addEvent = function(t) {\n            this._events.push(t), this._events.sort(function(e, n) {\n              return e.frame - n.frame;\n            });\n          }, r.prototype.removeEvents = function(t) {\n            for (var e = 0; e < this._events.length; e++)\n              this._events[e].frame === t && (this._events.splice(e, 1), e--);\n          }, r.prototype.getEvents = function() {\n            return this._events;\n          }, r.prototype.createRange = function(t, e, n) {\n            this._ranges[t] || (this._ranges[t] = new G(t, e, n));\n          }, r.prototype.deleteRange = function(t, e) {\n            e === void 0 && (e = !0);\n            var n = this._ranges[t];\n            if (n) {\n              if (e)\n                for (var i = n.from, o = n.to, a = this._keys.length - 1; a >= 0; a--)\n                  this._keys[a].frame >= i && this._keys[a].frame <= o && this._keys.splice(a, 1);\n              this._ranges[t] = null;\n            }\n          }, r.prototype.getRange = function(t) {\n            return this._ranges[t];\n          }, r.prototype.getKeys = function() {\n            return this._keys;\n          }, r.prototype.getHighestFrame = function() {\n            for (var t = 0, e = 0, n = this._keys.length; e < n; e++)\n              t < this._keys[e].frame && (t = this._keys[e].frame);\n            return t;\n          }, r.prototype.getEasingFunction = function() {\n            return this._easingFunction;\n          }, r.prototype.setEasingFunction = function(t) {\n            this._easingFunction = t;\n          }, r.prototype.floatInterpolateFunction = function(t, e, n) {\n            return $.a.Lerp(t, e, n);\n          }, r.prototype.floatInterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return $.a.Hermite(t, e, n, i, o);\n          }, r.prototype.quaternionInterpolateFunction = function(t, e, n) {\n            return u.b.Slerp(t, e, n);\n          }, r.prototype.quaternionInterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return u.b.Hermite(t, e, n, i, o).normalize();\n          }, r.prototype.vector3InterpolateFunction = function(t, e, n) {\n            return u.e.Lerp(t, e, n);\n          }, r.prototype.vector3InterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return u.e.Hermite(t, e, n, i, o);\n          }, r.prototype.vector2InterpolateFunction = function(t, e, n) {\n            return u.d.Lerp(t, e, n);\n          }, r.prototype.vector2InterpolateFunctionWithTangents = function(t, e, n, i, o) {\n            return u.d.Hermite(t, e, n, i, o);\n          }, r.prototype.sizeInterpolateFunction = function(t, e, n) {\n            return oe.a.Lerp(t, e, n);\n          }, r.prototype.color3InterpolateFunction = function(t, e, n) {\n            return I.a.Lerp(t, e, n);\n          }, r.prototype.color4InterpolateFunction = function(t, e, n) {\n            return I.b.Lerp(t, e, n);\n          }, r.prototype._getKeyValue = function(t) {\n            return typeof t == \"function\" ? t() : t;\n          }, r.prototype._interpolate = function(t, e) {\n            if (e.loopMode === r.ANIMATIONLOOPMODE_CONSTANT && e.repeatCount > 0)\n              return e.highLimitValue.clone ? e.highLimitValue.clone() : e.highLimitValue;\n            var n = this._keys;\n            if (n.length === 1)\n              return this._getKeyValue(n[0].value);\n            var i = e.key;\n            if (n[i].frame >= t)\n              for (; i - 1 >= 0 && n[i].frame >= t; )\n                i--;\n            for (var o = i; o < n.length; o++) {\n              var a = n[o + 1];\n              if (a.frame >= t) {\n                e.key = o;\n                var s = n[o], d = this._getKeyValue(s.value);\n                if (s.interpolation === K.STEP)\n                  return d;\n                var p = this._getKeyValue(a.value), y = s.outTangent !== void 0 && a.inTangent !== void 0, P = a.frame - s.frame, R = (t - s.frame) / P, B = this.getEasingFunction();\n                switch (B != null && (R = B.ease(R)), this.dataType) {\n                  case r.ANIMATIONTYPE_FLOAT:\n                    var F = y ? this.floatInterpolateFunctionWithTangents(d, s.outTangent * P, p, a.inTangent * P, R) : this.floatInterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return F;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return e.offsetValue * e.repeatCount + F;\n                    }\n                    break;\n                  case r.ANIMATIONTYPE_QUATERNION:\n                    var z = y ? this.quaternionInterpolateFunctionWithTangents(d, s.outTangent.scale(P), p, a.inTangent.scale(P), R) : this.quaternionInterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return z;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return z.addInPlace(e.offsetValue.scale(e.repeatCount));\n                    }\n                    return z;\n                  case r.ANIMATIONTYPE_VECTOR3:\n                    var J = y ? this.vector3InterpolateFunctionWithTangents(d, s.outTangent.scale(P), p, a.inTangent.scale(P), R) : this.vector3InterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return J;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return J.add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_VECTOR2:\n                    var ie = y ? this.vector2InterpolateFunctionWithTangents(d, s.outTangent.scale(P), p, a.inTangent.scale(P), R) : this.vector2InterpolateFunction(d, p, R);\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return ie;\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return ie.add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_SIZE:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return this.sizeInterpolateFunction(d, p, R);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return this.sizeInterpolateFunction(d, p, R).add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_COLOR3:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return this.color3InterpolateFunction(d, p, R);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return this.color3InterpolateFunction(d, p, R).add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_COLOR4:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        return this.color4InterpolateFunction(d, p, R);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return this.color4InterpolateFunction(d, p, R).add(e.offsetValue.scale(e.repeatCount));\n                    }\n                  case r.ANIMATIONTYPE_MATRIX:\n                    switch (e.loopMode) {\n                      case r.ANIMATIONLOOPMODE_CYCLE:\n                      case r.ANIMATIONLOOPMODE_CONSTANT:\n                        if (r.AllowMatricesInterpolation)\n                          return this.matrixInterpolateFunction(d, p, R, e.workValue);\n                      case r.ANIMATIONLOOPMODE_RELATIVE:\n                        return d;\n                    }\n                }\n                break;\n              }\n            }\n            return this._getKeyValue(n[n.length - 1].value);\n          }, r.prototype.matrixInterpolateFunction = function(t, e, n, i) {\n            return r.AllowMatrixDecomposeForInterpolation ? i ? (u.a.DecomposeLerpToRef(t, e, n, i), i) : u.a.DecomposeLerp(t, e, n) : i ? (u.a.LerpToRef(t, e, n, i), i) : u.a.Lerp(t, e, n);\n          }, r.prototype.clone = function() {\n            var t = new r(this.name, this.targetPropertyPath.join(\".\"), this.framePerSecond, this.dataType, this.loopMode);\n            if (t.enableBlending = this.enableBlending, t.blendingSpeed = this.blendingSpeed, this._keys && t.setKeys(this._keys), this._ranges)\n              for (var e in t._ranges = {}, this._ranges) {\n                var n = this._ranges[e];\n                n && (t._ranges[e] = n.clone());\n              }\n            return t;\n          }, r.prototype.setKeys = function(t) {\n            this._keys = t.slice(0);\n          }, r.prototype.serialize = function() {\n            var t = {};\n            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;\n            var e = this.dataType;\n            t.keys = [];\n            for (var n = this.getKeys(), i = 0; i < n.length; i++) {\n              var o = n[i], a = {};\n              switch (a.frame = o.frame, e) {\n                case r.ANIMATIONTYPE_FLOAT:\n                  a.values = [o.value], o.inTangent !== void 0 && a.values.push(o.inTangent), o.outTangent !== void 0 && (o.inTangent === void 0 && a.values.push(void 0), a.values.push(o.outTangent));\n                  break;\n                case r.ANIMATIONTYPE_QUATERNION:\n                case r.ANIMATIONTYPE_MATRIX:\n                case r.ANIMATIONTYPE_VECTOR3:\n                case r.ANIMATIONTYPE_COLOR3:\n                case r.ANIMATIONTYPE_COLOR4:\n                  a.values = o.value.asArray(), o.inTangent != null && a.values.push(o.inTangent.asArray()), o.outTangent != null && (o.inTangent === void 0 && a.values.push(void 0), a.values.push(o.outTangent.asArray()));\n              }\n              t.keys.push(a);\n            }\n            for (var s in t.ranges = [], this._ranges) {\n              var d = this._ranges[s];\n              if (d) {\n                var p = {};\n                p.name = s, p.from = d.from, p.to = d.to, t.ranges.push(p);\n              }\n            }\n            return t;\n          }, r._UniversalLerp = function(t, e, n) {\n            var i = t.constructor;\n            return i.Lerp ? i.Lerp(t, e, n) : i.Slerp ? i.Slerp(t, e, n) : t.toFixed ? t * (1 - n) + n * e : e;\n          }, r.Parse = function(t) {\n            var e, n, i = new r(t.name, t.property, t.framePerSecond, t.dataType, t.loopBehavior), o = t.dataType, a = [];\n            for (t.enableBlending && (i.enableBlending = t.enableBlending), t.blendingSpeed && (i.blendingSpeed = t.blendingSpeed), n = 0; n < t.keys.length; n++) {\n              var s, d, p = t.keys[n];\n              switch (o) {\n                case r.ANIMATIONTYPE_FLOAT:\n                  e = p.values[0], p.values.length >= 1 && (s = p.values[1]), p.values.length >= 2 && (d = p.values[2]);\n                  break;\n                case r.ANIMATIONTYPE_QUATERNION:\n                  if (e = u.b.FromArray(p.values), p.values.length >= 8) {\n                    var y = u.b.FromArray(p.values.slice(4, 8));\n                    y.equals(u.b.Zero()) || (s = y);\n                  }\n                  if (p.values.length >= 12) {\n                    var P = u.b.FromArray(p.values.slice(8, 12));\n                    P.equals(u.b.Zero()) || (d = P);\n                  }\n                  break;\n                case r.ANIMATIONTYPE_MATRIX:\n                  e = u.a.FromArray(p.values);\n                  break;\n                case r.ANIMATIONTYPE_COLOR3:\n                  e = I.a.FromArray(p.values);\n                  break;\n                case r.ANIMATIONTYPE_COLOR4:\n                  e = I.b.FromArray(p.values);\n                  break;\n                case r.ANIMATIONTYPE_VECTOR3:\n                default:\n                  e = u.e.FromArray(p.values);\n              }\n              var R = {};\n              R.frame = p.frame, R.value = e, s != null && (R.inTangent = s), d != null && (R.outTangent = d), a.push(R);\n            }\n            if (i.setKeys(a), t.ranges)\n              for (n = 0; n < t.ranges.length; n++)\n                e = t.ranges[n], i.createRange(e.name, e.from, e.to);\n            return i;\n          }, r.AppendSerializedAnimations = function(t, e) {\n            L.a.AppendSerializedAnimations(t, e);\n          }, r.ParseFromFileAsync = function(t, e) {\n            var n = this;\n            return new Promise(function(i, o) {\n              var a = new re.a();\n              a.addEventListener(\"readystatechange\", function() {\n                if (a.readyState == 4)\n                  if (a.status == 200) {\n                    var s = JSON.parse(a.responseText);\n                    if (s.length) {\n                      for (var d = new Array(), p = 0, y = s; p < y.length; p++) {\n                        var P = y[p];\n                        d.push(n.Parse(P));\n                      }\n                      i(d);\n                    } else\n                      d = n.Parse(s), t && (d.name = t), i(d);\n                  } else\n                    o(\"Unable to load the animation\");\n              }), a.open(\"GET\", e), a.send();\n            });\n          }, r.CreateFromSnippetAsync = function(t) {\n            var e = this;\n            return new Promise(function(n, i) {\n              var o = new re.a();\n              o.addEventListener(\"readystatechange\", function() {\n                if (o.readyState == 4)\n                  if (o.status == 200) {\n                    var a = JSON.parse(JSON.parse(o.responseText).jsonPayload);\n                    if (a.animations) {\n                      for (var s = JSON.parse(a.animations), d = new Array(), p = 0, y = s; p < y.length; p++) {\n                        var P = y[p];\n                        d.push(e.Parse(P));\n                      }\n                      n(d);\n                    } else\n                      s = JSON.parse(a.animation), (d = e.Parse(s)).snippetId = t, n(d);\n                  } else\n                    i(\"Unable to load the snippet \" + t);\n              }), o.open(\"GET\", e.SnippetUrl + \"/\" + t.replace(/#/g, \"/\")), o.send();\n            });\n          }, r.AllowMatricesInterpolation = !1, r.AllowMatrixDecomposeForInterpolation = !0, r.SnippetUrl = \"https://snippet.babylonjs.com\", r.ANIMATIONTYPE_FLOAT = 0, r.ANIMATIONTYPE_VECTOR3 = 1, r.ANIMATIONTYPE_QUATERNION = 2, r.ANIMATIONTYPE_MATRIX = 3, r.ANIMATIONTYPE_COLOR3 = 4, r.ANIMATIONTYPE_COLOR4 = 7, r.ANIMATIONTYPE_VECTOR2 = 5, r.ANIMATIONTYPE_SIZE = 6, r.ANIMATIONLOOPMODE_RELATIVE = 0, r.ANIMATIONLOOPMODE_CYCLE = 1, r.ANIMATIONLOOPMODE_CONSTANT = 2, r;\n        }();\n        O.a.RegisteredTypes[\"BABYLON.Animation\"] = k, Q.a._AnimationRangeFactory = function(r, t, e) {\n          return new G(r, t, e);\n        };\n        var H = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            a === void 0 && (a = 1e3);\n            var y = r.call(this, e, s) || this;\n            return y.duration = 1e3, y.onInterpolationDoneObservable = new C.c(), y.propertyPath = i, y.value = o, y.duration = a, y.stopOtherAnimations = d, y.onInterpolationDone = p, y._target = y._effectiveTarget = n, y;\n          }\n          return Object(c.d)(t, r), t.prototype._prepare = function() {\n            this._effectiveTarget = this._getEffectiveTarget(this._effectiveTarget, this.propertyPath), this._property = this._getProperty(this.propertyPath);\n          }, t.prototype.execute = function() {\n            var e, n = this, i = this._actionManager.getScene(), o = [{ frame: 0, value: this._effectiveTarget[this._property] }, { frame: 100, value: this.value }];\n            if (typeof this.value == \"number\")\n              e = k.ANIMATIONTYPE_FLOAT;\n            else if (this.value instanceof I.a)\n              e = k.ANIMATIONTYPE_COLOR3;\n            else if (this.value instanceof u.e)\n              e = k.ANIMATIONTYPE_VECTOR3;\n            else if (this.value instanceof u.a)\n              e = k.ANIMATIONTYPE_MATRIX;\n            else {\n              if (!(this.value instanceof u.b))\n                return void l.a.Warn(\"InterpolateValueAction: Unsupported type (\" + typeof this.value + \")\");\n              e = k.ANIMATIONTYPE_QUATERNION;\n            }\n            var a = new k(\"InterpolateValueAction\", this._property, 1e3 / this.duration * 100, e, k.ANIMATIONLOOPMODE_CONSTANT);\n            a.setKeys(o), this.stopOtherAnimations && i.stopAnimation(this._effectiveTarget), i.beginDirectAnimation(this._effectiveTarget, [a], 0, 100, !1, 1, function() {\n              n.onInterpolationDoneObservable.notifyObservers(n), n.onInterpolationDone && n.onInterpolationDone();\n            });\n          }, t.prototype.serialize = function(e) {\n            return r.prototype._serialize.call(this, { name: \"InterpolateValueAction\", properties: [x._GetTargetProperty(this._target), { name: \"propertyPath\", value: this.propertyPath }, { name: \"value\", value: x._SerializeValueAsString(this.value) }, { name: \"duration\", value: x._SerializeValueAsString(this.duration) }, { name: \"stopOtherAnimations\", value: x._SerializeValueAsString(this.stopOtherAnimations) || !1 }] }, e);\n          }, t;\n        }(x);\n        O.a.RegisteredTypes[\"BABYLON.InterpolateValueAction\"] = H;\n        var Z = Object.freeze(new u.b(0, 0, 0, 0)), W = Object.freeze(u.e.Zero()), q = Object.freeze(u.d.Zero()), he = Object.freeze(oe.a.Zero()), ge = Object.freeze(I.a.Black()), me = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            if (this._events = new Array(), this._currentFrame = 0, this._originalValue = new Array(), this._originalBlendValue = null, this._offsetsCache = {}, this._highLimitsCache = {}, this._stopped = !1, this._blendingFactor = 0, this._currentValue = null, this._currentActiveTarget = null, this._directTarget = null, this._targetPath = \"\", this._weight = 1, this._ratioOffset = 0, this._previousDelay = 0, this._previousRatio = 0, this._targetIsArray = !1, this._animation = e, this._target = t, this._scene = n, this._host = i, this._activeTargets = [], e._runtimeAnimations.push(this), this._animationState = { key: 0, repeatCount: 0, loopMode: this._getCorrectLoopMode() }, this._animation.dataType === k.ANIMATIONTYPE_MATRIX && (this._animationState.workValue = u.a.Zero()), this._keys = this._animation.getKeys(), this._minFrame = this._keys[0].frame, this._maxFrame = this._keys[this._keys.length - 1].frame, this._minValue = this._keys[0].value, this._maxValue = this._keys[this._keys.length - 1].value, this._minFrame !== 0) {\n              var a = { frame: 0, value: this._minValue };\n              this._keys.splice(0, 0, a);\n            }\n            if (this._target instanceof Array) {\n              for (var s = 0, d = 0, p = this._target; d < p.length; d++) {\n                var y = p[d];\n                this._preparePath(y, s), this._getOriginalValues(s), s++;\n              }\n              this._targetIsArray = !0;\n            } else\n              this._preparePath(this._target), this._getOriginalValues(), this._targetIsArray = !1, this._directTarget = this._activeTargets[0];\n            var P = e.getEvents();\n            P && P.length > 0 && P.forEach(function(R) {\n              o._events.push(R._clone());\n            }), this._enableBlending = t && t.animationPropertiesOverride ? t.animationPropertiesOverride.enableBlending : this._animation.enableBlending;\n          }\n          return Object.defineProperty(r.prototype, \"currentFrame\", { get: function() {\n            return this._currentFrame;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"weight\", { get: function() {\n            return this._weight;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentValue\", { get: function() {\n            return this._currentValue;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"targetPath\", { get: function() {\n            return this._targetPath;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"target\", { get: function() {\n            return this._currentActiveTarget;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isAdditive\", { get: function() {\n            return this._host && this._host.isAdditive;\n          }, enumerable: !1, configurable: !0 }), r.prototype._preparePath = function(t, e) {\n            e === void 0 && (e = 0);\n            var n = this._animation.targetPropertyPath;\n            if (n.length > 1) {\n              for (var i = t[n[0]], o = 1; o < n.length - 1; o++)\n                i = i[n[o]];\n              this._targetPath = n[n.length - 1], this._activeTargets[e] = i;\n            } else\n              this._targetPath = n[0], this._activeTargets[e] = t;\n          }, Object.defineProperty(r.prototype, \"animation\", { get: function() {\n            return this._animation;\n          }, enumerable: !1, configurable: !0 }), r.prototype.reset = function(t) {\n            if (t === void 0 && (t = !1), t)\n              if (this._target instanceof Array)\n                for (var e = 0, n = 0, i = this._target; n < i.length; n++) {\n                  var o = i[n];\n                  this._originalValue[e] !== void 0 && this._setValue(o, this._activeTargets[e], this._originalValue[e], -1, e), e++;\n                }\n              else\n                this._originalValue[0] !== void 0 && this._setValue(this._target, this._directTarget, this._originalValue[0], -1, 0);\n            for (this._offsetsCache = {}, this._highLimitsCache = {}, this._currentFrame = 0, this._blendingFactor = 0, e = 0; e < this._events.length; e++)\n              this._events[e].isDone = !1;\n          }, r.prototype.isStopped = function() {\n            return this._stopped;\n          }, r.prototype.dispose = function() {\n            var t = this._animation.runtimeAnimations.indexOf(this);\n            t > -1 && this._animation.runtimeAnimations.splice(t, 1);\n          }, r.prototype.setValue = function(t, e) {\n            if (this._targetIsArray)\n              for (var n = 0; n < this._target.length; n++) {\n                var i = this._target[n];\n                this._setValue(i, this._activeTargets[n], t, e, n);\n              }\n            else\n              this._setValue(this._target, this._directTarget, t, e, 0);\n          }, r.prototype._getOriginalValues = function(t) {\n            var e;\n            t === void 0 && (t = 0);\n            var n = this._activeTargets[t];\n            (e = n.getRestPose && this._targetPath === \"_matrix\" ? n.getRestPose() : n[this._targetPath]) && e.clone ? this._originalValue[t] = e.clone() : this._originalValue[t] = e;\n          }, r.prototype._setValue = function(t, e, n, i, o) {\n            if (this._currentActiveTarget = e, this._weight = i, this._enableBlending && this._blendingFactor <= 1) {\n              if (!this._originalBlendValue) {\n                var a = e[this._targetPath];\n                a.clone ? this._originalBlendValue = a.clone() : this._originalBlendValue = a;\n              }\n              this._originalBlendValue.m ? k.AllowMatrixDecomposeForInterpolation ? this._currentValue ? u.a.DecomposeLerpToRef(this._originalBlendValue, n, this._blendingFactor, this._currentValue) : this._currentValue = u.a.DecomposeLerp(this._originalBlendValue, n, this._blendingFactor) : this._currentValue ? u.a.LerpToRef(this._originalBlendValue, n, this._blendingFactor, this._currentValue) : this._currentValue = u.a.Lerp(this._originalBlendValue, n, this._blendingFactor) : this._currentValue = k._UniversalLerp(this._originalBlendValue, n, this._blendingFactor);\n              var s = t && t.animationPropertiesOverride ? t.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;\n              this._blendingFactor += s;\n            } else\n              this._currentValue = n;\n            i !== -1 ? this._scene._registerTargetForLateAnimationBinding(this, this._originalValue[o]) : e[this._targetPath] = this._currentValue, t.markAsDirty && t.markAsDirty(this._animation.targetProperty);\n          }, r.prototype._getCorrectLoopMode = function() {\n            return this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.loopMode : this._animation.loopMode;\n          }, r.prototype.goToFrame = function(t) {\n            var e = this._animation.getKeys();\n            t < e[0].frame ? t = e[0].frame : t > e[e.length - 1].frame && (t = e[e.length - 1].frame);\n            var n = this._events;\n            if (n.length)\n              for (var i = 0; i < n.length; i++)\n                n[i].onlyOnce || (n[i].isDone = n[i].frame < t);\n            this._currentFrame = t;\n            var o = this._animation._interpolate(t, this._animationState);\n            this.setValue(o, -1);\n          }, r.prototype._prepareForSpeedRatioChange = function(t) {\n            var e = this._previousDelay * (this._animation.framePerSecond * t) / 1e3;\n            this._ratioOffset = this._previousRatio - e;\n          }, r.prototype.animate = function(t, e, n, i, o, a) {\n            a === void 0 && (a = -1);\n            var s = this._animation, d = s.targetPropertyPath;\n            if (!d || d.length < 1)\n              return this._stopped = !0, !1;\n            var p = !0;\n            (e < this._minFrame || e > this._maxFrame) && (e = this._minFrame), (n < this._minFrame || n > this._maxFrame) && (n = this._maxFrame);\n            var y, P, R = n - e, B = t * (s.framePerSecond * o) / 1e3 + this._ratioOffset, F = 0;\n            if (this._previousDelay = t, this._previousRatio = B, !i && n >= e && B >= R)\n              p = !1, F = s._getKeyValue(this._maxValue);\n            else if (!i && e >= n && B <= R)\n              p = !1, F = s._getKeyValue(this._minValue);\n            else if (this._animationState.loopMode !== k.ANIMATIONLOOPMODE_CYCLE) {\n              var z = n.toString() + e.toString();\n              if (!this._offsetsCache[z]) {\n                this._animationState.repeatCount = 0, this._animationState.loopMode = k.ANIMATIONLOOPMODE_CYCLE;\n                var J = s._interpolate(e, this._animationState), ie = s._interpolate(n, this._animationState);\n                switch (this._animationState.loopMode = this._getCorrectLoopMode(), s.dataType) {\n                  case k.ANIMATIONTYPE_FLOAT:\n                    this._offsetsCache[z] = ie - J;\n                    break;\n                  case k.ANIMATIONTYPE_QUATERNION:\n                    this._offsetsCache[z] = ie.subtract(J);\n                    break;\n                  case k.ANIMATIONTYPE_VECTOR3:\n                    this._offsetsCache[z] = ie.subtract(J);\n                  case k.ANIMATIONTYPE_VECTOR2:\n                    this._offsetsCache[z] = ie.subtract(J);\n                  case k.ANIMATIONTYPE_SIZE:\n                    this._offsetsCache[z] = ie.subtract(J);\n                  case k.ANIMATIONTYPE_COLOR3:\n                    this._offsetsCache[z] = ie.subtract(J);\n                }\n                this._highLimitsCache[z] = ie;\n              }\n              F = this._highLimitsCache[z], y = this._offsetsCache[z];\n            }\n            if (y === void 0)\n              switch (s.dataType) {\n                case k.ANIMATIONTYPE_FLOAT:\n                  y = 0;\n                  break;\n                case k.ANIMATIONTYPE_QUATERNION:\n                  y = Z;\n                  break;\n                case k.ANIMATIONTYPE_VECTOR3:\n                  y = W;\n                  break;\n                case k.ANIMATIONTYPE_VECTOR2:\n                  y = q;\n                  break;\n                case k.ANIMATIONTYPE_SIZE:\n                  y = he;\n                  break;\n                case k.ANIMATIONTYPE_COLOR3:\n                  y = ge;\n              }\n            if (this._host && this._host.syncRoot) {\n              var se = this._host.syncRoot;\n              P = e + (n - e) * ((se.masterFrame - se.fromFrame) / (se.toFrame - se.fromFrame));\n            } else\n              P = p && R !== 0 ? e + B % R : n;\n            var ce = this._events;\n            if ((R > 0 && this.currentFrame > P || R < 0 && this.currentFrame < P) && (this._onLoop(), ce.length))\n              for (var ue = 0; ue < ce.length; ue++)\n                ce[ue].onlyOnce || (ce[ue].isDone = !1);\n            this._currentFrame = P, this._animationState.repeatCount = R === 0 ? 0 : B / R >> 0, this._animationState.highLimitValue = F, this._animationState.offsetValue = y;\n            var fe = s._interpolate(P, this._animationState);\n            if (this.setValue(fe, a), ce.length) {\n              for (ue = 0; ue < ce.length; ue++)\n                if (R > 0 && P >= ce[ue].frame && ce[ue].frame >= e || R < 0 && P <= ce[ue].frame && ce[ue].frame <= e) {\n                  var ve = ce[ue];\n                  ve.isDone || (ve.onlyOnce && (ce.splice(ue, 1), ue--), ve.isDone = !0, ve.action(P));\n                }\n            }\n            return p || (this._stopped = !0), p;\n          }, r;\n        }(), _e = f(20), ye = f(57), Pe = f(44), be = f(23), Fe = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null);\n            var p = r.call(this, e, n.getScene()) || this;\n            return p.name = e, p.children = new Array(), p.animations = new Array(), p._index = null, p._absoluteTransform = new u.a(), p._invertedAbsoluteTransform = new u.a(), p._scalingDeterminant = 1, p._worldTransform = new u.a(), p._needToDecompose = !0, p._needToCompose = !1, p._linkedTransformNode = null, p._waitingTransformNodeId = null, p._skeleton = n, p._localMatrix = o ? o.clone() : u.a.Identity(), p._restPose = a || p._localMatrix.clone(), p._bindPose = p._localMatrix.clone(), p._baseMatrix = s || p._localMatrix.clone(), p._index = d, n.bones.push(p), p.setParent(i, !1), (s || o) && p._updateDifferenceMatrix(), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"_matrix\", { get: function() {\n            return this._compose(), this._localMatrix;\n          }, set: function(e) {\n            this._localMatrix.copyFrom(e), this._needToDecompose = !0;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"Bone\";\n          }, t.prototype.getSkeleton = function() {\n            return this._skeleton;\n          }, t.prototype.getParent = function() {\n            return this._parent;\n          }, t.prototype.getChildren = function() {\n            return this.children;\n          }, t.prototype.getIndex = function() {\n            return this._index === null ? this.getSkeleton().bones.indexOf(this) : this._index;\n          }, t.prototype.setParent = function(e, n) {\n            if (n === void 0 && (n = !0), this._parent !== e) {\n              if (this._parent) {\n                var i = this._parent.children.indexOf(this);\n                i !== -1 && this._parent.children.splice(i, 1);\n              }\n              this._parent = e, this._parent && this._parent.children.push(this), n && this._updateDifferenceMatrix(), this.markAsDirty();\n            }\n          }, t.prototype.getLocalMatrix = function() {\n            return this._compose(), this._localMatrix;\n          }, t.prototype.getBaseMatrix = function() {\n            return this._baseMatrix;\n          }, t.prototype.getRestPose = function() {\n            return this._restPose;\n          }, t.prototype.setRestPose = function(e) {\n            this._restPose.copyFrom(e);\n          }, t.prototype.getBindPose = function() {\n            return this._bindPose;\n          }, t.prototype.setBindPose = function(e) {\n            this._bindPose.copyFrom(e);\n          }, t.prototype.getWorldMatrix = function() {\n            return this._worldTransform;\n          }, t.prototype.returnToRest = function() {\n            this._skeleton._numBonesWithLinkedTransformNode > 0 ? this.updateMatrix(this._restPose, !1, !1) : this.updateMatrix(this._restPose, !1, !0);\n          }, t.prototype.getInvertedAbsoluteTransform = function() {\n            return this._invertedAbsoluteTransform;\n          }, t.prototype.getAbsoluteTransform = function() {\n            return this._absoluteTransform;\n          }, t.prototype.linkTransformNode = function(e) {\n            this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode--, this._linkedTransformNode = e, this._linkedTransformNode && this._skeleton._numBonesWithLinkedTransformNode++;\n          }, t.prototype.getTransformNode = function() {\n            return this._linkedTransformNode;\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._decompose(), this._localPosition;\n          }, set: function(e) {\n            this._decompose(), this._localPosition.copyFrom(e), this._markAsDirtyAndCompose();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotation\", { get: function() {\n            return this.getRotation();\n          }, set: function(e) {\n            this.setRotation(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotationQuaternion\", { get: function() {\n            return this._decompose(), this._localRotation;\n          }, set: function(e) {\n            this.setRotationQuaternion(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaling\", { get: function() {\n            return this.getScale();\n          }, set: function(e) {\n            this.setScale(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._skeleton.animationPropertiesOverride;\n          }, enumerable: !1, configurable: !0 }), t.prototype._decompose = function() {\n            this._needToDecompose && (this._needToDecompose = !1, this._localScaling || (this._localScaling = u.e.Zero(), this._localRotation = u.b.Zero(), this._localPosition = u.e.Zero()), this._localMatrix.decompose(this._localScaling, this._localRotation, this._localPosition));\n          }, t.prototype._compose = function() {\n            this._needToCompose && (this._localScaling ? (this._needToCompose = !1, u.a.ComposeToRef(this._localScaling, this._localRotation, this._localPosition, this._localMatrix)) : this._needToCompose = !1);\n          }, t.prototype.updateMatrix = function(e, n, i) {\n            n === void 0 && (n = !0), i === void 0 && (i = !0), this._baseMatrix.copyFrom(e), n && this._updateDifferenceMatrix(), i ? (this._needToCompose = !1, this._localMatrix.copyFrom(e), this._markAsDirtyAndDecompose()) : this.markAsDirty();\n          }, t.prototype._updateDifferenceMatrix = function(e, n) {\n            if (n === void 0 && (n = !0), e || (e = this._baseMatrix), this._parent ? e.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform) : this._absoluteTransform.copyFrom(e), this._absoluteTransform.invertToRef(this._invertedAbsoluteTransform), n)\n              for (var i = 0; i < this.children.length; i++)\n                this.children[i]._updateDifferenceMatrix();\n            this._scalingDeterminant = this._absoluteTransform.determinant() < 0 ? -1 : 1;\n          }, t.prototype.markAsDirty = function() {\n            this._currentRenderId++, this._childUpdateId++, this._skeleton._markAsDirty();\n          }, t.prototype._markAsDirtyAndCompose = function() {\n            this.markAsDirty(), this._needToCompose = !0;\n          }, t.prototype._markAsDirtyAndDecompose = function() {\n            this.markAsDirty(), this._needToDecompose = !0;\n          }, t.prototype.translate = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL);\n            var o = this.getLocalMatrix();\n            if (n == be.c.LOCAL)\n              o.addAtIndex(12, e.x), o.addAtIndex(13, e.y), o.addAtIndex(14, e.z);\n            else {\n              var a = null;\n              i && (a = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n              var s = t._tmpMats[0], d = t._tmpVecs[0];\n              this._parent ? i && a ? (s.copyFrom(this._parent.getAbsoluteTransform()), s.multiplyToRef(a, s)) : s.copyFrom(this._parent.getAbsoluteTransform()) : u.a.IdentityToRef(s), s.setTranslationFromFloats(0, 0, 0), s.invert(), u.e.TransformCoordinatesToRef(e, s, d), o.addAtIndex(12, d.x), o.addAtIndex(13, d.y), o.addAtIndex(14, d.z);\n            }\n            this._markAsDirtyAndDecompose();\n          }, t.prototype.setPosition = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL);\n            var o = this.getLocalMatrix();\n            if (n == be.c.LOCAL)\n              o.setTranslationFromFloats(e.x, e.y, e.z);\n            else {\n              var a = null;\n              i && (a = i.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n              var s = t._tmpMats[0], d = t._tmpVecs[0];\n              this._parent ? (i && a ? (s.copyFrom(this._parent.getAbsoluteTransform()), s.multiplyToRef(a, s)) : s.copyFrom(this._parent.getAbsoluteTransform()), s.invert()) : u.a.IdentityToRef(s), u.e.TransformCoordinatesToRef(e, s, d), o.setTranslationFromFloats(d.x, d.y, d.z);\n            }\n            this._markAsDirtyAndDecompose();\n          }, t.prototype.setAbsolutePosition = function(e, n) {\n            this.setPosition(e, be.c.WORLD, n);\n          }, t.prototype.scale = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = this.getLocalMatrix(), s = t._tmpMats[0];\n            u.a.ScalingToRef(e, n, i, s), s.multiplyToRef(a, a), s.invert();\n            for (var d = 0, p = this.children; d < p.length; d++) {\n              var y = (B = p[d]).getLocalMatrix();\n              y.multiplyToRef(s, y), y.multiplyAtIndex(12, e), y.multiplyAtIndex(13, n), y.multiplyAtIndex(14, i), B._markAsDirtyAndDecompose();\n            }\n            if (this._markAsDirtyAndDecompose(), o)\n              for (var P = 0, R = this.children; P < R.length; P++) {\n                var B;\n                (B = R[P]).scale(e, n, i, o);\n              }\n          }, t.prototype.setScale = function(e) {\n            this._decompose(), this._localScaling.copyFrom(e), this._markAsDirtyAndCompose();\n          }, t.prototype.getScale = function() {\n            return this._decompose(), this._localScaling;\n          }, t.prototype.getScaleToRef = function(e) {\n            this._decompose(), e.copyFrom(this._localScaling);\n          }, t.prototype.setYawPitchRoll = function(e, n, i, o, a) {\n            if (o === void 0 && (o = be.c.LOCAL), o === be.c.LOCAL) {\n              var s = t._tmpQuat;\n              return u.b.RotationYawPitchRollToRef(e, n, i, s), void this.setRotationQuaternion(s, o, a);\n            }\n            var d = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(d, a)) {\n              var p = t._tmpMats[1];\n              u.a.RotationYawPitchRollToRef(e, n, i, p), d.multiplyToRef(p, p), this._rotateWithMatrix(p, o, a);\n            }\n          }, t.prototype.rotate = function(e, n, i, o) {\n            i === void 0 && (i = be.c.LOCAL);\n            var a = t._tmpMats[0];\n            a.setTranslationFromFloats(0, 0, 0), u.a.RotationAxisToRef(e, n, a), this._rotateWithMatrix(a, i, o);\n          }, t.prototype.setAxisAngle = function(e, n, i, o) {\n            if (i === void 0 && (i = be.c.LOCAL), i === be.c.LOCAL) {\n              var a = t._tmpQuat;\n              return u.b.RotationAxisToRef(e, n, a), void this.setRotationQuaternion(a, i, o);\n            }\n            var s = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(s, o)) {\n              var d = t._tmpMats[1];\n              u.a.RotationAxisToRef(e, n, d), s.multiplyToRef(d, d), this._rotateWithMatrix(d, i, o);\n            }\n          }, t.prototype.setRotation = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL), this.setYawPitchRoll(e.y, e.x, e.z, n, i);\n          }, t.prototype.setRotationQuaternion = function(e, n, i) {\n            if (n === void 0 && (n = be.c.LOCAL), n === be.c.LOCAL)\n              return this._decompose(), this._localRotation.copyFrom(e), void this._markAsDirtyAndCompose();\n            var o = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(o, i)) {\n              var a = t._tmpMats[1];\n              u.a.FromQuaternionToRef(e, a), o.multiplyToRef(a, a), this._rotateWithMatrix(a, n, i);\n            }\n          }, t.prototype.setRotationMatrix = function(e, n, i) {\n            if (n === void 0 && (n = be.c.LOCAL), n === be.c.LOCAL) {\n              var o = t._tmpQuat;\n              return u.b.FromRotationMatrixToRef(e, o), void this.setRotationQuaternion(o, n, i);\n            }\n            var a = t._tmpMats[0];\n            if (this._getNegativeRotationToRef(a, i)) {\n              var s = t._tmpMats[1];\n              s.copyFrom(e), a.multiplyToRef(e, s), this._rotateWithMatrix(s, n, i);\n            }\n          }, t.prototype._rotateWithMatrix = function(e, n, i) {\n            n === void 0 && (n = be.c.LOCAL);\n            var o = this.getLocalMatrix(), a = o.m[12], s = o.m[13], d = o.m[14], p = this.getParent(), y = t._tmpMats[3], P = t._tmpMats[4];\n            p && n == be.c.WORLD ? (i ? (y.copyFrom(i.getWorldMatrix()), p.getAbsoluteTransform().multiplyToRef(y, y)) : y.copyFrom(p.getAbsoluteTransform()), P.copyFrom(y), P.invert(), o.multiplyToRef(y, o), o.multiplyToRef(e, o), o.multiplyToRef(P, o)) : n == be.c.WORLD && i ? (y.copyFrom(i.getWorldMatrix()), P.copyFrom(y), P.invert(), o.multiplyToRef(y, o), o.multiplyToRef(e, o), o.multiplyToRef(P, o)) : o.multiplyToRef(e, o), o.setTranslationFromFloats(a, s, d), this.computeAbsoluteTransforms(), this._markAsDirtyAndDecompose();\n          }, t.prototype._getNegativeRotationToRef = function(e, n) {\n            var i = t._tmpMats[2];\n            return e.copyFrom(this.getAbsoluteTransform()), n && (e.multiplyToRef(n.getWorldMatrix(), e), u.a.ScalingToRef(n.scaling.x, n.scaling.y, n.scaling.z, i)), e.invert(), !isNaN(e.m[0]) && (i.multiplyAtIndex(0, this._scalingDeterminant), e.multiplyToRef(i, e), !0);\n          }, t.prototype.getPosition = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getPositionToRef(e, n, i), i;\n          }, t.prototype.getPositionToRef = function(e, n, i) {\n            if (e === void 0 && (e = be.c.LOCAL), e == be.c.LOCAL) {\n              var o = this.getLocalMatrix();\n              i.x = o.m[12], i.y = o.m[13], i.z = o.m[14];\n            } else {\n              var a = null;\n              n && (a = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n              var s = t._tmpMats[0];\n              n && a ? (s.copyFrom(this.getAbsoluteTransform()), s.multiplyToRef(a, s)) : s = this.getAbsoluteTransform(), i.x = s.m[12], i.y = s.m[13], i.z = s.m[14];\n            }\n          }, t.prototype.getAbsolutePosition = function(e) {\n            e === void 0 && (e = null);\n            var n = u.e.Zero();\n            return this.getPositionToRef(be.c.WORLD, e, n), n;\n          }, t.prototype.getAbsolutePositionToRef = function(e, n) {\n            this.getPositionToRef(be.c.WORLD, e, n);\n          }, t.prototype.computeAbsoluteTransforms = function() {\n            if (this._compose(), this._parent)\n              this._localMatrix.multiplyToRef(this._parent._absoluteTransform, this._absoluteTransform);\n            else {\n              this._absoluteTransform.copyFrom(this._localMatrix);\n              var e = this._skeleton.getPoseMatrix();\n              e && this._absoluteTransform.multiplyToRef(e, this._absoluteTransform);\n            }\n            for (var n = this.children, i = n.length, o = 0; o < i; o++)\n              n[o].computeAbsoluteTransforms();\n          }, t.prototype.getDirection = function(e, n) {\n            n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getDirectionToRef(e, n, i), i;\n          }, t.prototype.getDirectionToRef = function(e, n, i) {\n            n === void 0 && (n = null);\n            var o = null;\n            n && (o = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n            var a = t._tmpMats[0];\n            a.copyFrom(this.getAbsoluteTransform()), n && o && a.multiplyToRef(o, a), u.e.TransformNormalToRef(e, a, i), i.normalize();\n          }, t.prototype.getRotation = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getRotationToRef(e, n, i), i;\n          }, t.prototype.getRotationToRef = function(e, n, i) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var o = t._tmpQuat;\n            this.getRotationQuaternionToRef(e, n, o), o.toEulerAnglesToRef(i);\n          }, t.prototype.getRotationQuaternion = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null);\n            var i = u.b.Identity();\n            return this.getRotationQuaternionToRef(e, n, i), i;\n          }, t.prototype.getRotationQuaternionToRef = function(e, n, i) {\n            if (e === void 0 && (e = be.c.LOCAL), n === void 0 && (n = null), e == be.c.LOCAL)\n              this._decompose(), i.copyFrom(this._localRotation);\n            else {\n              var o = t._tmpMats[0], a = this.getAbsoluteTransform();\n              n ? a.multiplyToRef(n.getWorldMatrix(), o) : o.copyFrom(a), o.multiplyAtIndex(0, this._scalingDeterminant), o.multiplyAtIndex(1, this._scalingDeterminant), o.multiplyAtIndex(2, this._scalingDeterminant), o.decompose(void 0, i, void 0);\n            }\n          }, t.prototype.getRotationMatrix = function(e, n) {\n            e === void 0 && (e = be.c.LOCAL);\n            var i = u.a.Identity();\n            return this.getRotationMatrixToRef(e, n, i), i;\n          }, t.prototype.getRotationMatrixToRef = function(e, n, i) {\n            if (e === void 0 && (e = be.c.LOCAL), e == be.c.LOCAL)\n              this.getLocalMatrix().getRotationMatrixToRef(i);\n            else {\n              var o = t._tmpMats[0], a = this.getAbsoluteTransform();\n              n ? a.multiplyToRef(n.getWorldMatrix(), o) : o.copyFrom(a), o.multiplyAtIndex(0, this._scalingDeterminant), o.multiplyAtIndex(1, this._scalingDeterminant), o.multiplyAtIndex(2, this._scalingDeterminant), o.getRotationMatrixToRef(i);\n            }\n          }, t.prototype.getAbsolutePositionFromLocal = function(e, n) {\n            n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getAbsolutePositionFromLocalToRef(e, n, i), i;\n          }, t.prototype.getAbsolutePositionFromLocalToRef = function(e, n, i) {\n            n === void 0 && (n = null);\n            var o = null;\n            n && (o = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n            var a = t._tmpMats[0];\n            n && o ? (a.copyFrom(this.getAbsoluteTransform()), a.multiplyToRef(o, a)) : a = this.getAbsoluteTransform(), u.e.TransformCoordinatesToRef(e, a, i);\n          }, t.prototype.getLocalPositionFromAbsolute = function(e, n) {\n            n === void 0 && (n = null);\n            var i = u.e.Zero();\n            return this.getLocalPositionFromAbsoluteToRef(e, n, i), i;\n          }, t.prototype.getLocalPositionFromAbsoluteToRef = function(e, n, i) {\n            n === void 0 && (n = null);\n            var o = null;\n            n && (o = n.getWorldMatrix()), this._skeleton.computeAbsoluteTransforms();\n            var a = t._tmpMats[0];\n            a.copyFrom(this.getAbsoluteTransform()), n && o && a.multiplyToRef(o, a), a.invert(), u.e.TransformCoordinatesToRef(e, a, i);\n          }, t.prototype.setCurrentPoseAsRest = function() {\n            this.setRestPose(this.getLocalMatrix());\n          }, t._tmpVecs = Pe.a.BuildArray(2, u.e.Zero), t._tmpQuat = u.b.Identity(), t._tmpMats = Pe.a.BuildArray(5, u.a.Identity), t;\n        }(Q.a), ke = function() {\n          function r(t, e, n, i, o, a, s, d, p, y) {\n            n === void 0 && (n = 0), i === void 0 && (i = 100), o === void 0 && (o = !1), a === void 0 && (a = 1), y === void 0 && (y = !1), this.target = e, this.fromFrame = n, this.toFrame = i, this.loopAnimation = o, this.onAnimationEnd = s, this.onAnimationLoop = p, this.isAdditive = y, this._localDelayOffset = null, this._pausedDelay = null, this._runtimeAnimations = new Array(), this._paused = !1, this._speedRatio = 1, this._weight = -1, this._syncRoot = null, this.disposeOnEnd = !0, this.animationStarted = !1, this.onAnimationEndObservable = new C.c(), this.onAnimationLoopObservable = new C.c(), this._scene = t, d && this.appendAnimations(e, d), this._speedRatio = a, t._activeAnimatables.push(this);\n          }\n          return Object.defineProperty(r.prototype, \"syncRoot\", { get: function() {\n            return this._syncRoot;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"masterFrame\", { get: function() {\n            return this._runtimeAnimations.length === 0 ? 0 : this._runtimeAnimations[0].currentFrame;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"weight\", { get: function() {\n            return this._weight;\n          }, set: function(t) {\n            this._weight = t !== -1 ? Math.min(Math.max(t, 0), 1) : -1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"speedRatio\", { get: function() {\n            return this._speedRatio;\n          }, set: function(t) {\n            for (var e = 0; e < this._runtimeAnimations.length; e++)\n              this._runtimeAnimations[e]._prepareForSpeedRatioChange(t);\n            this._speedRatio = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.syncWith = function(t) {\n            if (this._syncRoot = t, t) {\n              var e = this._scene._activeAnimatables.indexOf(this);\n              e > -1 && (this._scene._activeAnimatables.splice(e, 1), this._scene._activeAnimatables.push(this));\n            }\n            return this;\n          }, r.prototype.getAnimations = function() {\n            return this._runtimeAnimations;\n          }, r.prototype.appendAnimations = function(t, e) {\n            for (var n = this, i = 0; i < e.length; i++) {\n              var o = e[i], a = new me(t, o, this._scene, this);\n              a._onLoop = function() {\n                n.onAnimationLoopObservable.notifyObservers(n), n.onAnimationLoop && n.onAnimationLoop();\n              }, this._runtimeAnimations.push(a);\n            }\n          }, r.prototype.getAnimationByTargetProperty = function(t) {\n            for (var e = this._runtimeAnimations, n = 0; n < e.length; n++)\n              if (e[n].animation.targetProperty === t)\n                return e[n].animation;\n            return null;\n          }, r.prototype.getRuntimeAnimationByTargetProperty = function(t) {\n            for (var e = this._runtimeAnimations, n = 0; n < e.length; n++)\n              if (e[n].animation.targetProperty === t)\n                return e[n];\n            return null;\n          }, r.prototype.reset = function() {\n            for (var t = this._runtimeAnimations, e = 0; e < t.length; e++)\n              t[e].reset(!0);\n            this._localDelayOffset = null, this._pausedDelay = null;\n          }, r.prototype.enableBlending = function(t) {\n            for (var e = this._runtimeAnimations, n = 0; n < e.length; n++)\n              e[n].animation.enableBlending = !0, e[n].animation.blendingSpeed = t;\n          }, r.prototype.disableBlending = function() {\n            for (var t = this._runtimeAnimations, e = 0; e < t.length; e++)\n              t[e].animation.enableBlending = !1;\n          }, r.prototype.goToFrame = function(t) {\n            var e = this._runtimeAnimations;\n            if (e[0]) {\n              var n = e[0].animation.framePerSecond, i = e[0].currentFrame, o = this.speedRatio === 0 ? 0 : (t - i) / n * 1e3 / this.speedRatio;\n              this._localDelayOffset === null && (this._localDelayOffset = 0), this._localDelayOffset -= o;\n            }\n            for (var a = 0; a < e.length; a++)\n              e[a].goToFrame(t);\n          }, r.prototype.pause = function() {\n            this._paused || (this._paused = !0);\n          }, r.prototype.restart = function() {\n            this._paused = !1;\n          }, r.prototype._raiseOnAnimationEnd = function() {\n            this.onAnimationEnd && this.onAnimationEnd(), this.onAnimationEndObservable.notifyObservers(this);\n          }, r.prototype.stop = function(t, e) {\n            if (t || e) {\n              var n = this._scene._activeAnimatables.indexOf(this);\n              if (n > -1) {\n                for (var i = (a = this._runtimeAnimations).length - 1; i >= 0; i--) {\n                  var o = a[i];\n                  t && o.animation.name != t || e && !e(o.target) || (o.dispose(), a.splice(i, 1));\n                }\n                a.length == 0 && (this._scene._activeAnimatables.splice(n, 1), this._raiseOnAnimationEnd());\n              }\n            } else if ((i = this._scene._activeAnimatables.indexOf(this)) > -1) {\n              this._scene._activeAnimatables.splice(i, 1);\n              var a = this._runtimeAnimations;\n              for (i = 0; i < a.length; i++)\n                a[i].dispose();\n              this._raiseOnAnimationEnd();\n            }\n          }, r.prototype.waitAsync = function() {\n            var t = this;\n            return new Promise(function(e, n) {\n              t.onAnimationEndObservable.add(function() {\n                e(t);\n              }, void 0, void 0, t, !0);\n            });\n          }, r.prototype._animate = function(t) {\n            if (this._paused)\n              return this.animationStarted = !1, this._pausedDelay === null && (this._pausedDelay = t), !0;\n            if (this._localDelayOffset === null ? (this._localDelayOffset = t, this._pausedDelay = null) : this._pausedDelay !== null && (this._localDelayOffset += t - this._pausedDelay, this._pausedDelay = null), this._weight === 0)\n              return !0;\n            var e, n = !1, i = this._runtimeAnimations;\n            for (e = 0; e < i.length; e++) {\n              var o = i[e].animate(t - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio, this._weight);\n              n = n || o;\n            }\n            if (this.animationStarted = n, !n) {\n              if (this.disposeOnEnd)\n                for (e = this._scene._activeAnimatables.indexOf(this), this._scene._activeAnimatables.splice(e, 1), e = 0; e < i.length; e++)\n                  i[e].dispose();\n              this._raiseOnAnimationEnd(), this.disposeOnEnd && (this.onAnimationEnd = null, this.onAnimationLoop = null, this.onAnimationLoopObservable.clear(), this.onAnimationEndObservable.clear());\n            }\n            return n;\n          }, r;\n        }();\n        _e.a.prototype._animate = function() {\n          if (this.animationsEnabled) {\n            var r = ye.a.Now;\n            if (!this._animationTimeLast) {\n              if (this._pendingData.length > 0)\n                return;\n              this._animationTimeLast = r;\n            }\n            this.deltaTime = this.useConstantAnimationDeltaTime ? 16 : (r - this._animationTimeLast) * this.animationTimeScale, this._animationTimeLast = r;\n            var t = this._activeAnimatables;\n            if (t.length !== 0) {\n              this._animationTime += this.deltaTime;\n              for (var e = this._animationTime, n = 0; n < t.length; n++) {\n                var i = t[n];\n                !i._animate(e) && i.disposeOnEnd && n--;\n              }\n              this._processLateAnimationBindings();\n            }\n          }\n        }, _e.a.prototype.beginWeightedAnimation = function(r, t, e, n, i, o, a, s, d, p, y) {\n          n === void 0 && (n = 1), o === void 0 && (o = 1), y === void 0 && (y = !1);\n          var P = this.beginAnimation(r, t, e, i, o, a, s, !1, d, p, y);\n          return P.weight = n, P;\n        }, _e.a.prototype.beginAnimation = function(r, t, e, n, i, o, a, s, d, p, y) {\n          i === void 0 && (i = 1), s === void 0 && (s = !0), y === void 0 && (y = !1), t > e && i > 0 && (i *= -1), s && this.stopAnimation(r, void 0, d), a || (a = new ke(this, r, t, e, n, i, o, void 0, p, y));\n          var P = !d || d(r);\n          if (r.animations && P && a.appendAnimations(r, r.animations), r.getAnimatables)\n            for (var R = r.getAnimatables(), B = 0; B < R.length; B++)\n              this.beginAnimation(R[B], t, e, n, i, o, a, s, d, p);\n          return a.reset(), a;\n        }, _e.a.prototype.beginHierarchyAnimation = function(r, t, e, n, i, o, a, s, d, p, y, P) {\n          o === void 0 && (o = 1), d === void 0 && (d = !0), P === void 0 && (P = !1);\n          var R = r.getDescendants(t), B = [];\n          B.push(this.beginAnimation(r, e, n, i, o, a, s, d, p, void 0, P));\n          for (var F = 0, z = R; F < z.length; F++) {\n            var J = z[F];\n            B.push(this.beginAnimation(J, e, n, i, o, a, s, d, p, void 0, P));\n          }\n          return B;\n        }, _e.a.prototype.beginDirectAnimation = function(r, t, e, n, i, o, a, s, d) {\n          return d === void 0 && (d = !1), o === void 0 && (o = 1), e > n && o > 0 && (o *= -1), new ke(this, r, e, n, i, o, a, t, s, d);\n        }, _e.a.prototype.beginDirectHierarchyAnimation = function(r, t, e, n, i, o, a, s, d, p) {\n          p === void 0 && (p = !1);\n          var y = r.getDescendants(t), P = [];\n          P.push(this.beginDirectAnimation(r, e, n, i, o, a, s, d, p));\n          for (var R = 0, B = y; R < B.length; R++) {\n            var F = B[R];\n            P.push(this.beginDirectAnimation(F, e, n, i, o, a, s, d, p));\n          }\n          return P;\n        }, _e.a.prototype.getAnimatableByTarget = function(r) {\n          for (var t = 0; t < this._activeAnimatables.length; t++)\n            if (this._activeAnimatables[t].target === r)\n              return this._activeAnimatables[t];\n          return null;\n        }, _e.a.prototype.getAllAnimatablesByTarget = function(r) {\n          for (var t = [], e = 0; e < this._activeAnimatables.length; e++)\n            this._activeAnimatables[e].target === r && t.push(this._activeAnimatables[e]);\n          return t;\n        }, _e.a.prototype.stopAnimation = function(r, t, e) {\n          for (var n = 0, i = this.getAllAnimatablesByTarget(r); n < i.length; n++)\n            i[n].stop(t, e);\n        }, _e.a.prototype.stopAllAnimations = function() {\n          if (this._activeAnimatables) {\n            for (var r = 0; r < this._activeAnimatables.length; r++)\n              this._activeAnimatables[r].stop();\n            this._activeAnimatables = [];\n          }\n          for (var t = 0, e = this.animationGroups; t < e.length; t++)\n            e[t].stop();\n        }, _e.a.prototype._registerTargetForLateAnimationBinding = function(r, t) {\n          var e = r.target;\n          this._registeredForLateAnimationBindings.pushNoDuplicate(e), e._lateAnimationHolders || (e._lateAnimationHolders = {}), e._lateAnimationHolders[r.targetPath] || (e._lateAnimationHolders[r.targetPath] = { totalWeight: 0, totalAdditiveWeight: 0, animations: [], additiveAnimations: [], originalValue: t }), r.isAdditive ? (e._lateAnimationHolders[r.targetPath].additiveAnimations.push(r), e._lateAnimationHolders[r.targetPath].totalAdditiveWeight += r.weight) : (e._lateAnimationHolders[r.targetPath].animations.push(r), e._lateAnimationHolders[r.targetPath].totalWeight += r.weight);\n        }, _e.a.prototype._processLateAnimationBindingsForMatrices = function(r) {\n          if (r.totalWeight === 0 && r.totalAdditiveWeight === 0)\n            return r.originalValue;\n          var t = 1, e = u.c.Vector3[0], n = u.c.Vector3[1], i = u.c.Quaternion[0], o = 0, a = r.animations[0], s = r.originalValue, d = 1, p = !1;\n          if (r.totalWeight < 1)\n            d = 1 - r.totalWeight, s.decompose(n, i, e);\n          else {\n            if (o = 1, t = r.totalWeight, (d = a.weight / t) == 1) {\n              if (!r.totalAdditiveWeight)\n                return a.currentValue;\n              p = !0;\n            }\n            a.currentValue.decompose(n, i, e);\n          }\n          if (!p) {\n            n.scaleInPlace(d), e.scaleInPlace(d), i.scaleInPlace(d);\n            for (var y = o; y < r.animations.length; y++)\n              if ((z = r.animations[y]).weight !== 0) {\n                d = z.weight / t;\n                var P = u.c.Vector3[2], R = u.c.Vector3[3], B = u.c.Quaternion[1];\n                z.currentValue.decompose(R, B, P), R.scaleAndAddToRef(d, n), B.scaleAndAddToRef(d, i), P.scaleAndAddToRef(d, e);\n              }\n          }\n          for (var F = 0; F < r.additiveAnimations.length; F++) {\n            var z;\n            (z = r.additiveAnimations[F]).weight !== 0 && (P = u.c.Vector3[2], R = u.c.Vector3[3], B = u.c.Quaternion[1], z.currentValue.decompose(R, B, P), R.multiplyToRef(n, R), u.e.LerpToRef(n, R, z.weight, n), i.multiplyToRef(B, B), u.b.SlerpToRef(i, B, z.weight, i), P.scaleAndAddToRef(z.weight, e));\n          }\n          var J = a ? a._animationState.workValue : u.c.Matrix[0].clone();\n          return u.a.ComposeToRef(n, i, e, J), J;\n        }, _e.a.prototype._processLateAnimationBindingsForQuaternions = function(r, t) {\n          if (r.totalWeight === 0 && r.totalAdditiveWeight === 0)\n            return t;\n          var e = r.animations[0], n = r.originalValue, i = t;\n          if (r.totalWeight === 0 && r.totalAdditiveWeight > 0)\n            i.copyFrom(n);\n          else if (r.animations.length === 1) {\n            if (u.b.SlerpToRef(n, e.currentValue, Math.min(1, r.totalWeight), i), r.totalAdditiveWeight === 0)\n              return i;\n          } else if (r.animations.length > 1) {\n            var o = 1, a = void 0, s = void 0;\n            if (r.totalWeight < 1) {\n              var d = 1 - r.totalWeight;\n              s = [], (a = []).push(n), s.push(d);\n            } else {\n              if (r.animations.length === 2 && (u.b.SlerpToRef(r.animations[0].currentValue, r.animations[1].currentValue, r.animations[1].weight / r.totalWeight, t), r.totalAdditiveWeight === 0))\n                return t;\n              a = [], s = [], o = r.totalWeight;\n            }\n            for (var p = 0; p < r.animations.length; p++) {\n              var y = r.animations[p];\n              a.push(y.currentValue), s.push(y.weight / o);\n            }\n            for (var P = 0, R = 0; R < a.length; )\n              R ? (P += s[R], u.b.SlerpToRef(i, a[R], s[R] / P, i), R++) : (u.b.SlerpToRef(a[R], a[R + 1], s[R + 1] / (s[R] + s[R + 1]), t), i = t, P = s[R] + s[R + 1], R += 2);\n          }\n          for (var B = 0; B < r.additiveAnimations.length; B++)\n            (y = r.additiveAnimations[B]).weight !== 0 && (i.multiplyToRef(y.currentValue, u.c.Quaternion[0]), u.b.SlerpToRef(i, u.c.Quaternion[0], y.weight, i));\n          return i;\n        }, _e.a.prototype._processLateAnimationBindings = function() {\n          if (this._registeredForLateAnimationBindings.length) {\n            for (var r = 0; r < this._registeredForLateAnimationBindings.length; r++) {\n              var t = this._registeredForLateAnimationBindings.data[r];\n              for (var e in t._lateAnimationHolders) {\n                var n = t._lateAnimationHolders[e], i = n.animations[0], o = n.originalValue, a = k.AllowMatrixDecomposeForInterpolation && o.m, s = t[e];\n                if (a)\n                  s = this._processLateAnimationBindingsForMatrices(n);\n                else if (o.w !== void 0)\n                  s = this._processLateAnimationBindingsForQuaternions(n, s || u.b.Identity());\n                else {\n                  var d = 0, p = 1;\n                  if (n.totalWeight < 1)\n                    s = i && o.scale ? o.scale(1 - n.totalWeight) : i ? o * (1 - n.totalWeight) : o.clone ? o.clone() : o;\n                  else if (i) {\n                    p = n.totalWeight;\n                    var y = i.weight / p;\n                    s = y !== 1 ? i.currentValue.scale ? i.currentValue.scale(y) : i.currentValue * y : i.currentValue, d = 1;\n                  }\n                  for (var P = d; P < n.animations.length; P++)\n                    (F = (B = n.animations[P]).weight / p) && (B.currentValue.scaleAndAddToRef ? B.currentValue.scaleAndAddToRef(F, s) : s += B.currentValue * F);\n                  for (var R = 0; R < n.additiveAnimations.length; R++) {\n                    var B, F;\n                    (F = (B = n.additiveAnimations[R]).weight) && (B.currentValue.scaleAndAddToRef ? B.currentValue.scaleAndAddToRef(F, s) : s += B.currentValue * F);\n                  }\n                }\n                t[e] = s;\n              }\n              t._lateAnimationHolders = {};\n            }\n            this._registeredForLateAnimationBindings.reset();\n          }\n        }, Fe.prototype.copyAnimationRange = function(r, t, e, n, i) {\n          n === void 0 && (n = !1), i === void 0 && (i = null), this.animations.length === 0 && (this.animations.push(new k(this.name, \"_matrix\", r.animations[0].framePerSecond, k.ANIMATIONTYPE_MATRIX, 0)), this.animations[0].setKeys([]));\n          var o = r.animations[0].getRange(t);\n          if (!o)\n            return !1;\n          for (var a, s, d, p = o.from, y = o.to, P = r.animations[0].getKeys(), R = r.length, B = r.getParent(), F = this.getParent(), z = n && B && R && this.length && R !== this.length, J = z && F && B ? F.length / B.length : 1, ie = n && !F && i && (i.x !== 1 || i.y !== 1 || i.z !== 1), se = this.animations[0].getKeys(), ce = 0, ue = P.length; ce < ue; ce++)\n            (a = P[ce]).frame >= p && a.frame <= y && (n ? (d = a.value.clone(), z ? (s = d.getTranslation(), d.setTranslation(s.scaleInPlace(J))) : ie && i ? (s = d.getTranslation(), d.setTranslation(s.multiplyInPlace(i))) : d = a.value) : d = a.value, se.push({ frame: a.frame + e, value: d }));\n          return this.animations[0].createRange(t, p + e, y + e), !0;\n        };\n        var We = function() {\n          function r() {\n          }\n          return r.prototype.getClassName = function() {\n            return \"TargetedAnimation\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.animation = this.animation.serialize(), t.targetId = this.target.id, t;\n          }, r;\n        }(), je = function() {\n          function r(t, e) {\n            e === void 0 && (e = null), this.name = t, this._targetedAnimations = new Array(), this._animatables = new Array(), this._from = Number.MAX_VALUE, this._to = -Number.MAX_VALUE, this._speedRatio = 1, this._loopAnimation = !1, this._isAdditive = !1, this.onAnimationEndObservable = new C.c(), this.onAnimationLoopObservable = new C.c(), this.onAnimationGroupLoopObservable = new C.c(), this.onAnimationGroupEndObservable = new C.c(), this.onAnimationGroupPauseObservable = new C.c(), this.onAnimationGroupPlayObservable = new C.c(), this._scene = e || te.a.LastCreatedScene, this.uniqueId = this._scene.getUniqueId(), this._scene.addAnimationGroup(this);\n          }\n          return Object.defineProperty(r.prototype, \"from\", { get: function() {\n            return this._from;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"to\", { get: function() {\n            return this._to;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isStarted\", { get: function() {\n            return this._isStarted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isPlaying\", { get: function() {\n            return this._isStarted && !this._isPaused;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"speedRatio\", { get: function() {\n            return this._speedRatio;\n          }, set: function(t) {\n            if (this._speedRatio !== t) {\n              this._speedRatio = t;\n              for (var e = 0; e < this._animatables.length; e++)\n                this._animatables[e].speedRatio = this._speedRatio;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"loopAnimation\", { get: function() {\n            return this._loopAnimation;\n          }, set: function(t) {\n            if (this._loopAnimation !== t) {\n              this._loopAnimation = t;\n              for (var e = 0; e < this._animatables.length; e++)\n                this._animatables[e].loopAnimation = this._loopAnimation;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isAdditive\", { get: function() {\n            return this._isAdditive;\n          }, set: function(t) {\n            if (this._isAdditive !== t) {\n              this._isAdditive = t;\n              for (var e = 0; e < this._animatables.length; e++)\n                this._animatables[e].isAdditive = this._isAdditive;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"targetedAnimations\", { get: function() {\n            return this._targetedAnimations;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animatables\", { get: function() {\n            return this._animatables;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"children\", { get: function() {\n            return this._targetedAnimations;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addTargetedAnimation = function(t, e) {\n            var n = new We();\n            n.animation = t, n.target = e;\n            var i = t.getKeys();\n            return this._from > i[0].frame && (this._from = i[0].frame), this._to < i[i.length - 1].frame && (this._to = i[i.length - 1].frame), this._targetedAnimations.push(n), n;\n          }, r.prototype.normalize = function(t, e) {\n            t === void 0 && (t = null), e === void 0 && (e = null), t == null && (t = this._from), e == null && (e = this._to);\n            for (var n = 0; n < this._targetedAnimations.length; n++) {\n              var i = this._targetedAnimations[n].animation.getKeys(), o = i[0], a = i[i.length - 1];\n              if (o.frame > t) {\n                var s = { frame: t, value: o.value, inTangent: o.inTangent, outTangent: o.outTangent, interpolation: o.interpolation };\n                i.splice(0, 0, s);\n              }\n              a.frame < e && (s = { frame: e, value: a.value, inTangent: a.inTangent, outTangent: a.outTangent, interpolation: a.interpolation }, i.push(s));\n            }\n            return this._from = t, this._to = e, this;\n          }, r.prototype._processLoop = function(t, e, n) {\n            var i = this;\n            t.onAnimationLoop = function() {\n              i.onAnimationLoopObservable.notifyObservers(e), i._animationLoopFlags[n] || (i._animationLoopFlags[n] = !0, i._animationLoopCount++, i._animationLoopCount === i._targetedAnimations.length && (i.onAnimationGroupLoopObservable.notifyObservers(i), i._animationLoopCount = 0, i._animationLoopFlags = []));\n            };\n          }, r.prototype.start = function(t, e, n, i, o) {\n            var a = this;\n            if (t === void 0 && (t = !1), e === void 0 && (e = 1), this._isStarted || this._targetedAnimations.length === 0)\n              return this;\n            this._loopAnimation = t, this._animationLoopCount = 0, this._animationLoopFlags = [];\n            for (var s = function() {\n              var P = d._targetedAnimations[p], R = d._scene.beginDirectAnimation(P.target, [P.animation], n !== void 0 ? n : d._from, i !== void 0 ? i : d._to, t, e, void 0, void 0, o !== void 0 ? o : d._isAdditive);\n              R.onAnimationEnd = function() {\n                a.onAnimationEndObservable.notifyObservers(P), a._checkAnimationGroupEnded(R);\n              }, d._processLoop(R, P, p), d._animatables.push(R);\n            }, d = this, p = 0; p < this._targetedAnimations.length; p++)\n              s();\n            if (this._speedRatio = e, n !== void 0 && i !== void 0)\n              if (n < i && this._speedRatio < 0) {\n                var y = i;\n                i = n, n = y;\n              } else\n                n > i && this._speedRatio > 0 && (this._speedRatio = -e);\n            return this._isStarted = !0, this._isPaused = !1, this.onAnimationGroupPlayObservable.notifyObservers(this), this;\n          }, r.prototype.pause = function() {\n            if (!this._isStarted)\n              return this;\n            this._isPaused = !0;\n            for (var t = 0; t < this._animatables.length; t++)\n              this._animatables[t].pause();\n            return this.onAnimationGroupPauseObservable.notifyObservers(this), this;\n          }, r.prototype.play = function(t) {\n            return this.isStarted && this._animatables.length === this._targetedAnimations.length ? (t !== void 0 && (this.loopAnimation = t), this.restart()) : (this.stop(), this.start(t, this._speedRatio)), this._isPaused = !1, this;\n          }, r.prototype.reset = function() {\n            if (!this._isStarted)\n              return this.play(), this.goToFrame(0), this.stop(), this;\n            for (var t = 0; t < this._animatables.length; t++)\n              this._animatables[t].reset();\n            return this;\n          }, r.prototype.restart = function() {\n            if (!this._isStarted)\n              return this;\n            for (var t = 0; t < this._animatables.length; t++)\n              this._animatables[t].restart();\n            return this.onAnimationGroupPlayObservable.notifyObservers(this), this;\n          }, r.prototype.stop = function() {\n            if (!this._isStarted)\n              return this;\n            for (var t = this._animatables.slice(), e = 0; e < t.length; e++)\n              t[e].stop();\n            return this._isStarted = !1, this;\n          }, r.prototype.setWeightForAllAnimatables = function(t) {\n            for (var e = 0; e < this._animatables.length; e++)\n              this._animatables[e].weight = t;\n            return this;\n          }, r.prototype.syncAllAnimationsWith = function(t) {\n            for (var e = 0; e < this._animatables.length; e++)\n              this._animatables[e].syncWith(t);\n            return this;\n          }, r.prototype.goToFrame = function(t) {\n            if (!this._isStarted)\n              return this;\n            for (var e = 0; e < this._animatables.length; e++)\n              this._animatables[e].goToFrame(t);\n            return this;\n          }, r.prototype.dispose = function() {\n            this._targetedAnimations = [], this._animatables = [];\n            var t = this._scene.animationGroups.indexOf(this);\n            t > -1 && this._scene.animationGroups.splice(t, 1), this.onAnimationEndObservable.clear(), this.onAnimationGroupEndObservable.clear(), this.onAnimationGroupPauseObservable.clear(), this.onAnimationGroupPlayObservable.clear(), this.onAnimationLoopObservable.clear(), this.onAnimationGroupLoopObservable.clear();\n          }, r.prototype._checkAnimationGroupEnded = function(t) {\n            var e = this._animatables.indexOf(t);\n            e > -1 && this._animatables.splice(e, 1), this._animatables.length === 0 && (this._isStarted = !1, this.onAnimationGroupEndObservable.notifyObservers(this));\n          }, r.prototype.clone = function(t, e) {\n            for (var n = new r(t || this.name, this._scene), i = 0, o = this._targetedAnimations; i < o.length; i++) {\n              var a = o[i];\n              n.addTargetedAnimation(a.animation.clone(), e ? e(a.target) : a.target);\n            }\n            return n;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.name = this.name, t.from = this.from, t.to = this.to, t.targetedAnimations = [];\n            for (var e = 0; e < this.targetedAnimations.length; e++) {\n              var n = this.targetedAnimations[e];\n              t.targetedAnimations[e] = n.serialize();\n            }\n            return t;\n          }, r.Parse = function(t, e) {\n            for (var n = new r(t.name, e), i = 0; i < t.targetedAnimations.length; i++) {\n              var o = t.targetedAnimations[i], a = k.Parse(o.animation), s = o.targetId;\n              if (o.animation.property === \"influence\") {\n                var d = e.getMorphTargetById(s);\n                d && n.addTargetedAnimation(a, d);\n              } else {\n                var p = e.getNodeByID(s);\n                p != null && n.addTargetedAnimation(a, p);\n              }\n            }\n            return t.from !== null && t.to !== null && n.normalize(t.from, t.to), n;\n          }, r.MakeAnimationAdditive = function(t, e, n, i, o) {\n            e === void 0 && (e = 0), i === void 0 && (i = !1);\n            var a = t;\n            i && (a = t.clone(o || a.name));\n            for (var s = a.targetedAnimations, d = 0; d < s.length; d++) {\n              var p = s[d];\n              k.MakeAnimationAdditive(p.animation, e, n);\n            }\n            return a.isAdditive = !0, a;\n          }, r.prototype.getClassName = function() {\n            return \"AnimationGroup\";\n          }, r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name;\n            return e += \", type: \" + this.getClassName(), t && (e += \", from: \" + this._from, e += \", to: \" + this._to, e += \", isStarted: \" + this._isStarted, e += \", speedRatio: \" + this._speedRatio, e += \", targetedAnimations length: \" + this._targetedAnimations.length, e += \", animatables length: \" + this._animatables), e;\n          }, r;\n        }(), He = function() {\n          this.enableBlending = !1, this.blendingSpeed = 0.01, this.loopMode = k.ANIMATIONLOOPMODE_CYCLE;\n        }, Qe = f(72), Ge = function() {\n          function r() {\n            this._easingMode = r.EASINGMODE_EASEIN;\n          }\n          return r.prototype.setEasingMode = function(t) {\n            var e = Math.min(Math.max(t, 0), 2);\n            this._easingMode = e;\n          }, r.prototype.getEasingMode = function() {\n            return this._easingMode;\n          }, r.prototype.easeInCore = function(t) {\n            throw new Error(\"You must implement this method\");\n          }, r.prototype.ease = function(t) {\n            switch (this._easingMode) {\n              case r.EASINGMODE_EASEIN:\n                return this.easeInCore(t);\n              case r.EASINGMODE_EASEOUT:\n                return 1 - this.easeInCore(1 - t);\n            }\n            return t >= 0.5 ? 0.5 * (1 - this.easeInCore(2 * (1 - t))) + 0.5 : 0.5 * this.easeInCore(2 * t);\n          }, r.EASINGMODE_EASEIN = 0, r.EASINGMODE_EASEOUT = 1, r.EASINGMODE_EASEINOUT = 2, r;\n        }(), tt = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e = Math.max(0, Math.min(1, e)), 1 - Math.sqrt(1 - e * e);\n          }, t;\n        }(Ge), Je = function(r) {\n          function t(e) {\n            e === void 0 && (e = 1);\n            var n = r.call(this) || this;\n            return n.amplitude = e, n;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.amplitude);\n            return Math.pow(e, 3) - e * n * Math.sin(3.141592653589793 * e);\n          }, t;\n        }(Ge), st = function(r) {\n          function t(e, n) {\n            e === void 0 && (e = 3), n === void 0 && (n = 2);\n            var i = r.call(this) || this;\n            return i.bounces = e, i.bounciness = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.bounces), i = this.bounciness;\n            i <= 1 && (i = 1.001);\n            var o = Math.pow(i, n), a = 1 - i, s = (1 - o) / a + 0.5 * o, d = e * s, p = Math.log(-d * (1 - i) + 1) / Math.log(i), y = Math.floor(p), P = y + 1, R = (1 - Math.pow(i, y)) / (a * s), B = 0.5 * (R + (1 - Math.pow(i, P)) / (a * s)), F = e - B, z = B - R;\n            return -Math.pow(1 / i, n - y) / (z * z) * (F - z) * (F + z);\n          }, t;\n        }(Ge), at = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e * e;\n          }, t;\n        }(Ge), pt = function(r) {\n          function t(e, n) {\n            e === void 0 && (e = 3), n === void 0 && (n = 3);\n            var i = r.call(this) || this;\n            return i.oscillations = e, i.springiness = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.oscillations), i = Math.max(0, this.springiness);\n            return (i == 0 ? e : (Math.exp(i * e) - 1) / (Math.exp(i) - 1)) * Math.sin((6.283185307179586 * n + 1.5707963267948966) * e);\n          }, t;\n        }(Ge), Tt = function(r) {\n          function t(e) {\n            e === void 0 && (e = 2);\n            var n = r.call(this) || this;\n            return n.exponent = e, n;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return this.exponent <= 0 ? e : (Math.exp(this.exponent * e) - 1) / (Math.exp(this.exponent) - 1);\n          }, t;\n        }(Ge), Lt = function(r) {\n          function t(e) {\n            e === void 0 && (e = 2);\n            var n = r.call(this) || this;\n            return n.power = e, n;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            var n = Math.max(0, this.power);\n            return Math.pow(e, n);\n          }, t;\n        }(Ge), Ot = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e;\n          }, t;\n        }(Ge), St = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e * e * e;\n          }, t;\n        }(Ge), Ct = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return e * e * e * e * e;\n          }, t;\n        }(Ge), nn = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return 1 - Math.sin(1.5707963267948966 * (1 - e));\n          }, t;\n        }(Ge), Qt = function(r) {\n          function t(e, n, i, o) {\n            e === void 0 && (e = 0), n === void 0 && (n = 0), i === void 0 && (i = 1), o === void 0 && (o = 1);\n            var a = r.call(this) || this;\n            return a.x1 = e, a.y1 = n, a.x2 = i, a.y2 = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.easeInCore = function(e) {\n            return Qe.c.Interpolate(e, this.x1, this.y1, this.x2, this.y2);\n          }, t;\n        }(Ge), $t = function() {\n          function r(t, e, n) {\n            this.frame = t, this.action = e, this.onlyOnce = n, this.isDone = !1;\n          }\n          return r.prototype._clone = function() {\n            return new r(this.frame, this.action, this.onlyOnce);\n          }, r;\n        }(), Ie = f(7), Sn = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t;\n        }(V.a), en = function() {\n          this.rootNodes = [], this.skeletons = [], this.animationGroups = [];\n        }, An = function(r) {\n          function t(e) {\n            var n = r.call(this) || this;\n            return n._wasAddedToScene = !1, n.scene = e, n.sounds = [], n.effectLayers = [], n.layers = [], n.lensFlareSystems = [], n.proceduralTextures = [], n.reflectionProbes = [], e.onDisposeObservable.add(function() {\n              n._wasAddedToScene || n.dispose();\n            }), n;\n          }\n          return Object(c.d)(t, r), t.prototype.instantiateModelsToScene = function(e, n) {\n            var i = this;\n            n === void 0 && (n = !1);\n            var o = {}, a = {}, s = new en(), d = [], p = [], y = { doNotInstantiate: !0 }, P = function(R, B) {\n              if (o[R.uniqueId] = B.uniqueId, a[B.uniqueId] = B, e && (B.name = e(R.name)), B instanceof Ie.a) {\n                var F = B;\n                if (F.morphTargetManager) {\n                  var z = R.morphTargetManager;\n                  F.morphTargetManager = z.clone();\n                  for (var J = 0; J < z.numTargets; J++) {\n                    var ie = z.getTarget(J), se = F.morphTargetManager.getTarget(J);\n                    o[ie.uniqueId] = se.uniqueId, a[se.uniqueId] = se;\n                  }\n                }\n              }\n            };\n            return this.transformNodes.forEach(function(R) {\n              if (!R.parent) {\n                var B = R.instantiateHierarchy(null, y, function(F, z) {\n                  P(F, z);\n                });\n                B && s.rootNodes.push(B);\n              }\n            }), this.meshes.forEach(function(R) {\n              if (!R.parent) {\n                var B = R.instantiateHierarchy(null, y, function(F, z) {\n                  if (P(F, z), z.material) {\n                    var J = z;\n                    if (J.material)\n                      if (n) {\n                        var ie = F.material;\n                        if (p.indexOf(ie) === -1) {\n                          var se = ie.clone(e ? e(ie.name) : \"Clone of \" + ie.name);\n                          if (p.push(ie), o[ie.uniqueId] = se.uniqueId, a[se.uniqueId] = se, ie.getClassName() === \"MultiMaterial\") {\n                            for (var ce = ie, ue = 0, fe = ce.subMaterials; ue < fe.length; ue++) {\n                              var ve = fe[ue];\n                              ve && (se = ve.clone(e ? e(ve.name) : \"Clone of \" + ve.name), p.push(ve), o[ve.uniqueId] = se.uniqueId, a[se.uniqueId] = se);\n                            }\n                            ce.subMaterials = ce.subMaterials.map(function(Te) {\n                              return Te && a[o[Te.uniqueId]];\n                            });\n                          }\n                        }\n                        J.material = a[o[ie.uniqueId]];\n                      } else\n                        J.material.getClassName() === \"MultiMaterial\" ? i.scene.multiMaterials.indexOf(J.material) === -1 && i.scene.addMultiMaterial(J.material) : i.scene.materials.indexOf(J.material) === -1 && i.scene.addMaterial(J.material);\n                  }\n                });\n                B && s.rootNodes.push(B);\n              }\n            }), this.skeletons.forEach(function(R) {\n              var B = R.clone(e ? e(R.name) : \"Clone of \" + R.name);\n              R.overrideMesh && (B.overrideMesh = a[o[R.overrideMesh.uniqueId]]);\n              for (var F = 0, z = i.meshes; F < z.length; F++) {\n                var J = z[F];\n                if (J.skeleton === R && !J.isAnInstance) {\n                  if (a[o[J.uniqueId]].skeleton = B, d.indexOf(B) !== -1)\n                    continue;\n                  d.push(B);\n                  for (var ie = 0, se = B.bones; ie < se.length; ie++) {\n                    var ce = se[ie];\n                    ce._linkedTransformNode && (ce._linkedTransformNode = a[o[ce._linkedTransformNode.uniqueId]]);\n                  }\n                }\n              }\n              s.skeletons.push(B);\n            }), this.animationGroups.forEach(function(R) {\n              var B = R.clone(R.name, function(F) {\n                return a[o[F.uniqueId]] || F;\n              });\n              s.animationGroups.push(B);\n            }), s;\n          }, t.prototype.addAllToScene = function() {\n            var e = this;\n            this._wasAddedToScene = !0, this.cameras.forEach(function(o) {\n              e.scene.addCamera(o);\n            }), this.lights.forEach(function(o) {\n              e.scene.addLight(o);\n            }), this.meshes.forEach(function(o) {\n              e.scene.addMesh(o);\n            }), this.skeletons.forEach(function(o) {\n              e.scene.addSkeleton(o);\n            }), this.animations.forEach(function(o) {\n              e.scene.addAnimation(o);\n            }), this.animationGroups.forEach(function(o) {\n              e.scene.addAnimationGroup(o);\n            }), this.multiMaterials.forEach(function(o) {\n              e.scene.addMultiMaterial(o);\n            }), this.materials.forEach(function(o) {\n              e.scene.addMaterial(o);\n            }), this.morphTargetManagers.forEach(function(o) {\n              e.scene.addMorphTargetManager(o);\n            }), this.geometries.forEach(function(o) {\n              e.scene.addGeometry(o);\n            }), this.transformNodes.forEach(function(o) {\n              e.scene.addTransformNode(o);\n            }), this.actionManagers.forEach(function(o) {\n              e.scene.addActionManager(o);\n            }), this.textures.forEach(function(o) {\n              e.scene.addTexture(o);\n            }), this.reflectionProbes.forEach(function(o) {\n              e.scene.addReflectionProbe(o);\n            }), this.environmentTexture && (this.scene.environmentTexture = this.environmentTexture);\n            for (var n = 0, i = this.scene._serializableComponents; n < i.length; n++)\n              i[n].addFromContainer(this);\n          }, t.prototype.removeAllFromScene = function() {\n            var e = this;\n            this._wasAddedToScene = !1, this.cameras.forEach(function(o) {\n              e.scene.removeCamera(o);\n            }), this.lights.forEach(function(o) {\n              e.scene.removeLight(o);\n            }), this.meshes.forEach(function(o) {\n              e.scene.removeMesh(o);\n            }), this.skeletons.forEach(function(o) {\n              e.scene.removeSkeleton(o);\n            }), this.animations.forEach(function(o) {\n              e.scene.removeAnimation(o);\n            }), this.animationGroups.forEach(function(o) {\n              e.scene.removeAnimationGroup(o);\n            }), this.multiMaterials.forEach(function(o) {\n              e.scene.removeMultiMaterial(o);\n            }), this.materials.forEach(function(o) {\n              e.scene.removeMaterial(o);\n            }), this.morphTargetManagers.forEach(function(o) {\n              e.scene.removeMorphTargetManager(o);\n            }), this.geometries.forEach(function(o) {\n              e.scene.removeGeometry(o);\n            }), this.transformNodes.forEach(function(o) {\n              e.scene.removeTransformNode(o);\n            }), this.actionManagers.forEach(function(o) {\n              e.scene.removeActionManager(o);\n            }), this.textures.forEach(function(o) {\n              e.scene.removeTexture(o);\n            }), this.reflectionProbes.forEach(function(o) {\n              e.scene.removeReflectionProbe(o);\n            }), this.environmentTexture === this.scene.environmentTexture && (this.scene.environmentTexture = null);\n            for (var n = 0, i = this.scene._serializableComponents; n < i.length; n++)\n              i[n].removeFromContainer(this);\n          }, t.prototype.dispose = function() {\n            this.cameras.forEach(function(i) {\n              i.dispose();\n            }), this.cameras = [], this.lights.forEach(function(i) {\n              i.dispose();\n            }), this.lights = [], this.meshes.forEach(function(i) {\n              i.dispose();\n            }), this.meshes = [], this.skeletons.forEach(function(i) {\n              i.dispose();\n            }), this.skeletons = [], this.animationGroups.forEach(function(i) {\n              i.dispose();\n            }), this.animationGroups = [], this.multiMaterials.forEach(function(i) {\n              i.dispose();\n            }), this.multiMaterials = [], this.materials.forEach(function(i) {\n              i.dispose();\n            }), this.materials = [], this.geometries.forEach(function(i) {\n              i.dispose();\n            }), this.geometries = [], this.transformNodes.forEach(function(i) {\n              i.dispose();\n            }), this.transformNodes = [], this.actionManagers.forEach(function(i) {\n              i.dispose();\n            }), this.actionManagers = [], this.textures.forEach(function(i) {\n              i.dispose();\n            }), this.textures = [], this.reflectionProbes.forEach(function(i) {\n              i.dispose();\n            }), this.reflectionProbes = [], this.environmentTexture && (this.environmentTexture.dispose(), this.environmentTexture = null);\n            for (var e = 0, n = this.scene._serializableComponents; e < n.length; e++)\n              n[e].removeFromContainer(this, !0);\n          }, t.prototype._moveAssets = function(e, n, i) {\n            if (e)\n              for (var o = 0, a = e; o < a.length; o++) {\n                var s = a[o], d = !0;\n                if (i) {\n                  for (var p = 0, y = i; p < y.length; p++)\n                    if (s === y[p]) {\n                      d = !1;\n                      break;\n                    }\n                }\n                d && n.push(s);\n              }\n          }, t.prototype.moveAllFromScene = function(e) {\n            for (var n in this._wasAddedToScene = !1, e === void 0 && (e = new Sn()), this)\n              this.hasOwnProperty(n) && (this[n] = this[n] || (n === \"environmentTexture\" ? null : []), this._moveAssets(this.scene[n], this[n], e[n]));\n            this.environmentTexture = this.scene.environmentTexture, this.removeAllFromScene();\n          }, t.prototype.createRootMesh = function() {\n            var e = new Ie.a(\"assetContainerRootMesh\", this.scene);\n            return this.meshes.forEach(function(n) {\n              n.parent || e.addChild(n);\n            }), this.meshes.unshift(e), e;\n          }, t.prototype.mergeAnimationsTo = function(e, n, i) {\n            if (e === void 0 && (e = te.a.LastCreatedScene), i === void 0 && (i = null), !e)\n              return l.a.Error(\"No scene available to merge animations to\"), [];\n            var o = i || function(s) {\n              var d = null, p = s.animations.length ? s.animations[0].targetProperty : \"\", y = s.name.split(\".\").join(\"\").split(\"_primitive\")[0];\n              switch (p) {\n                case \"position\":\n                case \"rotationQuaternion\":\n                  d = e.getTransformNodeByName(s.name) || e.getTransformNodeByName(y);\n                  break;\n                case \"influence\":\n                  d = e.getMorphTargetByName(s.name) || e.getMorphTargetByName(y);\n                  break;\n                default:\n                  d = e.getNodeByName(s.name) || e.getNodeByName(y);\n              }\n              return d;\n            };\n            this.getNodes().forEach(function(s) {\n              var d = o(s);\n              if (d !== null) {\n                for (var p = function(R) {\n                  for (var B = 0, F = d.animations.filter(function(ie) {\n                    return ie.targetProperty === R.targetProperty;\n                  }); B < F.length; B++) {\n                    var z = F[B], J = d.animations.indexOf(z, 0);\n                    J > -1 && d.animations.splice(J, 1);\n                  }\n                }, y = 0, P = s.animations; y < P.length; y++)\n                  p(P[y]);\n                d.animations = d.animations.concat(s.animations);\n              }\n            });\n            var a = new Array();\n            return this.animationGroups.slice().forEach(function(s) {\n              a.push(s.clone(s.name, o)), s.animatables.forEach(function(d) {\n                d.stop();\n              });\n            }), n.forEach(function(s) {\n              var d = o(s.target);\n              d && (e.beginAnimation(d, s.fromFrame, s.toFrame, s.loopAnimation, s.speedRatio, s.onAnimationEnd ? s.onAnimationEnd : void 0, void 0, !0, void 0, s.onAnimationLoop ? s.onAnimationLoop : void 0), e.stopAnimation(s.target));\n            }), a;\n          }, t;\n        }(V.a), Ue = f(13), Pn = function() {\n          function r(t) {\n            this.SMOOTHING = 0.75, this.FFT_SIZE = 512, this.BARGRAPHAMPLITUDE = 256, this.DEBUGCANVASPOS = { x: 20, y: 20 }, this.DEBUGCANVASSIZE = { width: 320, height: 200 }, this._scene = t, this._audioEngine = Ue.a.audioEngine, this._audioEngine.canUseWebAudio && this._audioEngine.audioContext && (this._webAudioAnalyser = this._audioEngine.audioContext.createAnalyser(), this._webAudioAnalyser.minDecibels = -140, this._webAudioAnalyser.maxDecibels = 0, this._byteFreqs = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._byteTime = new Uint8Array(this._webAudioAnalyser.frequencyBinCount), this._floatFreqs = new Float32Array(this._webAudioAnalyser.frequencyBinCount));\n          }\n          return r.prototype.getFrequencyBinCount = function() {\n            return this._audioEngine.canUseWebAudio ? this._webAudioAnalyser.frequencyBinCount : 0;\n          }, r.prototype.getByteFrequencyData = function() {\n            return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteFrequencyData(this._byteFreqs)), this._byteFreqs;\n          }, r.prototype.getByteTimeDomainData = function() {\n            return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getByteTimeDomainData(this._byteTime)), this._byteTime;\n          }, r.prototype.getFloatFrequencyData = function() {\n            return this._audioEngine.canUseWebAudio && (this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING, this._webAudioAnalyser.fftSize = this.FFT_SIZE, this._webAudioAnalyser.getFloatFrequencyData(this._floatFreqs)), this._floatFreqs;\n          }, r.prototype.drawDebugCanvas = function() {\n            var t = this;\n            if (this._audioEngine.canUseWebAudio && (this._debugCanvas || (this._debugCanvas = document.createElement(\"canvas\"), this._debugCanvas.width = this.DEBUGCANVASSIZE.width, this._debugCanvas.height = this.DEBUGCANVASSIZE.height, this._debugCanvas.style.position = \"absolute\", this._debugCanvas.style.top = this.DEBUGCANVASPOS.y + \"px\", this._debugCanvas.style.left = this.DEBUGCANVASPOS.x + \"px\", this._debugCanvasContext = this._debugCanvas.getContext(\"2d\"), document.body.appendChild(this._debugCanvas), this._registerFunc = function() {\n              t.drawDebugCanvas();\n            }, this._scene.registerBeforeRender(this._registerFunc)), this._registerFunc && this._debugCanvasContext)) {\n              var e = this.getByteFrequencyData();\n              this._debugCanvasContext.fillStyle = \"rgb(0, 0, 0)\", this._debugCanvasContext.fillRect(0, 0, this.DEBUGCANVASSIZE.width, this.DEBUGCANVASSIZE.height);\n              for (var n = 0; n < this.getFrequencyBinCount(); n++) {\n                var i = e[n] / this.BARGRAPHAMPLITUDE, o = this.DEBUGCANVASSIZE.height * i, a = this.DEBUGCANVASSIZE.height - o - 1, s = this.DEBUGCANVASSIZE.width / this.getFrequencyBinCount(), d = n / this.getFrequencyBinCount() * 360;\n                this._debugCanvasContext.fillStyle = \"hsl(\" + d + \", 100%, 50%)\", this._debugCanvasContext.fillRect(n * s, a, s, o);\n              }\n            }\n          }, r.prototype.stopDebugCanvas = function() {\n            this._debugCanvas && (this._registerFunc && (this._scene.unregisterBeforeRender(this._registerFunc), this._registerFunc = null), document.body.removeChild(this._debugCanvas), this._debugCanvas = null, this._debugCanvasContext = null);\n          }, r.prototype.connectAudioNodes = function(t, e) {\n            this._audioEngine.canUseWebAudio && (t.connect(this._webAudioAnalyser), this._webAudioAnalyser.connect(e));\n          }, r.prototype.dispose = function() {\n            this._audioEngine.canUseWebAudio && this._webAudioAnalyser.disconnect();\n          }, r;\n        }();\n        Ue.a.AudioEngineFactory = function(r) {\n          return new rr(r);\n        };\n        var rr = function() {\n          function r(t) {\n            var e = this;\n            t === void 0 && (t = null), this._audioContext = null, this._audioContextInitialized = !1, this._muteButton = null, this.canUseWebAudio = !1, this.WarnedWebAudioUnsupported = !1, this.isMP3supported = !1, this.isOGGsupported = !1, this.unlocked = !0, this.useCustomUnlockedButton = !1, this.onAudioUnlockedObservable = new C.c(), this.onAudioLockedObservable = new C.c(), this._tryToRun = !1, this._onResize = function() {\n              e._moveButtonToTopLeft();\n            }, window.AudioContext === void 0 && window.webkitAudioContext === void 0 || (window.AudioContext = window.AudioContext || window.webkitAudioContext, this.canUseWebAudio = !0);\n            var n = document.createElement(\"audio\");\n            this._hostElement = t;\n            try {\n              n && n.canPlayType && (n.canPlayType('audio/mpeg; codecs=\"mp3\"').replace(/^no$/, \"\") || n.canPlayType(\"audio/mp3\").replace(/^no$/, \"\")) && (this.isMP3supported = !0);\n            } catch {\n            }\n            try {\n              n && n.canPlayType && n.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/^no$/, \"\") && (this.isOGGsupported = !0);\n            } catch {\n            }\n          }\n          return Object.defineProperty(r.prototype, \"audioContext\", { get: function() {\n            return this._audioContextInitialized ? this.unlocked || this._muteButton || this._displayMuteButton() : this._initializeAudioContext(), this._audioContext;\n          }, enumerable: !1, configurable: !0 }), r.prototype.lock = function() {\n            this._triggerSuspendedState();\n          }, r.prototype.unlock = function() {\n            this._triggerRunningState();\n          }, r.prototype._resumeAudioContext = function() {\n            var t;\n            return this._audioContext.resume !== void 0 && (t = this._audioContext.resume()), t || Promise.resolve();\n          }, r.prototype._initializeAudioContext = function() {\n            try {\n              this.canUseWebAudio && (this._audioContext = new AudioContext(), this.masterGain = this._audioContext.createGain(), this.masterGain.gain.value = 1, this.masterGain.connect(this._audioContext.destination), this._audioContextInitialized = !0, this._audioContext.state === \"running\" && this._triggerRunningState());\n            } catch (t) {\n              this.canUseWebAudio = !1, l.a.Error(\"Web Audio: \" + t.message);\n            }\n          }, r.prototype._triggerRunningState = function() {\n            var t = this;\n            this._tryToRun || (this._tryToRun = !0, this._resumeAudioContext().then(function() {\n              t._tryToRun = !1, t._muteButton && t._hideMuteButton(), t.unlocked = !0, t.onAudioUnlockedObservable.notifyObservers(t);\n            }).catch(function() {\n              t._tryToRun = !1, t.unlocked = !1;\n            }));\n          }, r.prototype._triggerSuspendedState = function() {\n            this.unlocked = !1, this.onAudioLockedObservable.notifyObservers(this), this._displayMuteButton();\n          }, r.prototype._displayMuteButton = function() {\n            var t = this;\n            if (!this.useCustomUnlockedButton && !this._muteButton) {\n              this._muteButton = document.createElement(\"BUTTON\"), this._muteButton.className = \"babylonUnmuteIcon\", this._muteButton.id = \"babylonUnmuteIconBtn\", this._muteButton.title = \"Unmute\";\n              var e = \".babylonUnmuteIcon { position: absolute; left: 20px; top: 20px; height: 40px; width: 60px; background-color: rgba(51,51,51,0.7); background-image: url(\" + (window.SVGSVGElement ? \"data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E\" : \"https://cdn.babylonjs.com/Assets/audio.png\") + \");  background-size: 80%; background-repeat:no-repeat; background-position: center; background-position-y: 4px; border: none; outline: none; transition: transform 0.125s ease-out; cursor: pointer; z-index: 9999; } .babylonUnmuteIcon:hover { transform: scale(1.05) } .babylonUnmuteIcon:active { background-color: rgba(51,51,51,1) }\", n = document.createElement(\"style\");\n              n.appendChild(document.createTextNode(e)), document.getElementsByTagName(\"head\")[0].appendChild(n), document.body.appendChild(this._muteButton), this._moveButtonToTopLeft(), this._muteButton.addEventListener(\"touchend\", function() {\n                t._triggerRunningState();\n              }, !0), this._muteButton.addEventListener(\"click\", function() {\n                t._triggerRunningState();\n              }, !0), window.addEventListener(\"resize\", this._onResize);\n            }\n          }, r.prototype._moveButtonToTopLeft = function() {\n            this._hostElement && this._muteButton && (this._muteButton.style.top = this._hostElement.offsetTop + 20 + \"px\", this._muteButton.style.left = this._hostElement.offsetLeft + 20 + \"px\");\n          }, r.prototype._hideMuteButton = function() {\n            this._muteButton && (document.body.removeChild(this._muteButton), this._muteButton = null);\n          }, r.prototype.dispose = function() {\n            this.canUseWebAudio && this._audioContextInitialized && (this._connectedAnalyser && this._audioContext && (this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser.dispose(), this.masterGain.disconnect(), this.masterGain.connect(this._audioContext.destination), this._connectedAnalyser = null), this.masterGain.gain.value = 1), this.WarnedWebAudioUnsupported = !1, this._hideMuteButton(), window.removeEventListener(\"resize\", this._onResize), this.onAudioUnlockedObservable.clear(), this.onAudioLockedObservable.clear();\n          }, r.prototype.getGlobalVolume = function() {\n            return this.canUseWebAudio && this._audioContextInitialized ? this.masterGain.gain.value : -1;\n          }, r.prototype.setGlobalVolume = function(t) {\n            this.canUseWebAudio && this._audioContextInitialized && (this.masterGain.gain.value = t);\n          }, r.prototype.connectToAnalyser = function(t) {\n            this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this.canUseWebAudio && this._audioContextInitialized && this._audioContext && (this._connectedAnalyser = t, this.masterGain.disconnect(), this._connectedAnalyser.connectAudioNodes(this.masterGain, this._audioContext.destination));\n          }, r;\n        }(), Xe = f(12), En = f(21), Qn = function() {\n          function r(t, e, n, i, o) {\n            var a, s, d, p, y = this;\n            if (i === void 0 && (i = null), this.autoplay = !1, this.loop = !1, this.useCustomAttenuation = !1, this.isPlaying = !1, this.isPaused = !1, this.spatialSound = !1, this.refDistance = 1, this.rolloffFactor = 1, this.maxDistance = 100, this.distanceModel = \"linear\", this.metadata = null, this.onEndedObservable = new C.c(), this._panningModel = \"equalpower\", this._playbackRate = 1, this._streaming = !1, this._startTime = 0, this._startOffset = 0, this._position = u.e.Zero(), this._positionInEmitterSpace = !1, this._localDirection = new u.e(1, 0, 0), this._volume = 1, this._isReadyToPlay = !1, this._isDirectional = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._coneOuterGain = 0, this._isOutputConnected = !1, this._urlType = \"Unknown\", this.name = t, this._scene = n, r._SceneComponentInitialization(n), this._readyToPlayCallback = i, this._customAttenuationFunction = function(J, ie, se, ce, ue) {\n              return ie < se ? J * (1 - ie / se) : 0;\n            }, o && (this.autoplay = o.autoplay || !1, this.loop = o.loop || !1, o.volume !== void 0 && (this._volume = o.volume), this.spatialSound = (a = o.spatialSound) !== null && a !== void 0 && a, this.maxDistance = (s = o.maxDistance) !== null && s !== void 0 ? s : 100, this.useCustomAttenuation = (d = o.useCustomAttenuation) !== null && d !== void 0 && d, this.rolloffFactor = o.rolloffFactor || 1, this.refDistance = o.refDistance || 1, this.distanceModel = o.distanceModel || \"linear\", this._playbackRate = o.playbackRate || 1, this._streaming = (p = o.streaming) !== null && p !== void 0 && p, this._length = o.length, this._offset = o.offset), Ue.a.audioEngine.canUseWebAudio && Ue.a.audioEngine.audioContext) {\n              this._soundGain = Ue.a.audioEngine.audioContext.createGain(), this._soundGain.gain.value = this._volume, this._inputAudioNode = this._soundGain, this._outputAudioNode = this._soundGain, this.spatialSound && this._createSpatialParameters(), this._scene.mainSoundTrack.addSound(this);\n              var P = !0;\n              if (e)\n                try {\n                  typeof e == \"string\" ? this._urlType = \"String\" : e instanceof ArrayBuffer ? this._urlType = \"ArrayBuffer\" : e instanceof MediaStream ? this._urlType = \"MediaStream\" : Array.isArray(e) && (this._urlType = \"Array\");\n                  var R = [], B = !1;\n                  switch (this._urlType) {\n                    case \"MediaStream\":\n                      this._streaming = !0, this._isReadyToPlay = !0, this._streamingSource = Ue.a.audioEngine.audioContext.createMediaStreamSource(e), this.autoplay && this.play(0, this._offset, this._length), this._readyToPlayCallback && this._readyToPlayCallback();\n                      break;\n                    case \"ArrayBuffer\":\n                      e.byteLength > 0 && (B = !0, this._soundLoaded(e));\n                      break;\n                    case \"String\":\n                      R.push(e);\n                    case \"Array\":\n                      R.length === 0 && (R = e);\n                      for (var F = 0; F < R.length; F++) {\n                        var z = R[F];\n                        if (B = o && o.skipCodecCheck || z.indexOf(\".mp3\", z.length - 4) !== -1 && Ue.a.audioEngine.isMP3supported || z.indexOf(\".ogg\", z.length - 4) !== -1 && Ue.a.audioEngine.isOGGsupported || z.indexOf(\".wav\", z.length - 4) !== -1 || z.indexOf(\".m4a\", z.length - 4) !== -1 || z.indexOf(\"blob:\") !== -1) {\n                          this._streaming ? (this._htmlAudioElement = new Audio(z), this._htmlAudioElement.controls = !1, this._htmlAudioElement.loop = this.loop, Xe.b.SetCorsBehavior(z, this._htmlAudioElement), this._htmlAudioElement.preload = \"auto\", this._htmlAudioElement.addEventListener(\"canplaythrough\", function() {\n                            y._isReadyToPlay = !0, y.autoplay && y.play(0, y._offset, y._length), y._readyToPlayCallback && y._readyToPlayCallback();\n                          }), document.body.appendChild(this._htmlAudioElement), this._htmlAudioElement.load()) : this._scene._loadFile(z, function(J) {\n                            y._soundLoaded(J);\n                          }, void 0, !0, !0, function(J) {\n                            J && l.a.Error(\"XHR \" + J.status + \" error on: \" + z + \".\"), l.a.Error(\"Sound creation aborted.\"), y._scene.mainSoundTrack.removeSound(y);\n                          });\n                          break;\n                        }\n                      }\n                      break;\n                    default:\n                      P = !1;\n                  }\n                  P ? B || (this._isReadyToPlay = !0, this._readyToPlayCallback && window.setTimeout(function() {\n                    y._readyToPlayCallback && y._readyToPlayCallback();\n                  }, 1e3)) : l.a.Error(\"Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.\");\n                } catch {\n                  l.a.Error(\"Unexpected error. Sound creation aborted.\"), this._scene.mainSoundTrack.removeSound(this);\n                }\n            } else\n              this._scene.mainSoundTrack.addSound(this), Ue.a.audioEngine.WarnedWebAudioUnsupported || (l.a.Error(\"Web Audio is not supported by your browser.\"), Ue.a.audioEngine.WarnedWebAudioUnsupported = !0), this._readyToPlayCallback && window.setTimeout(function() {\n                y._readyToPlayCallback && y._readyToPlayCallback();\n              }, 1e3);\n          }\n          return Object.defineProperty(r.prototype, \"currentTime\", { get: function() {\n            if (this._htmlAudioElement)\n              return this._htmlAudioElement.currentTime;\n            var t = this._startOffset;\n            return this.isPlaying && Ue.a.audioEngine.audioContext && (t += Ue.a.audioEngine.audioContext.currentTime - this._startTime), t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            Ue.a.audioEngine.canUseWebAudio && (this.isPlaying && this.stop(), this._isReadyToPlay = !1, this.soundTrackId === -1 ? this._scene.mainSoundTrack.removeSound(this) : this._scene.soundTracks && this._scene.soundTracks[this.soundTrackId].removeSound(this), this._soundGain && (this._soundGain.disconnect(), this._soundGain = null), this._soundPanner && (this._soundPanner.disconnect(), this._soundPanner = null), this._soundSource && (this._soundSource.disconnect(), this._soundSource = null), this._audioBuffer = null, this._htmlAudioElement && (this._htmlAudioElement.pause(), this._htmlAudioElement.src = \"\", document.body.removeChild(this._htmlAudioElement)), this._streamingSource && this._streamingSource.disconnect(), this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._connectedTransformNode = null));\n          }, r.prototype.isReady = function() {\n            return this._isReadyToPlay;\n          }, r.prototype._soundLoaded = function(t) {\n            var e = this;\n            Ue.a.audioEngine.audioContext && Ue.a.audioEngine.audioContext.decodeAudioData(t, function(n) {\n              e._audioBuffer = n, e._isReadyToPlay = !0, e.autoplay && e.play(0, e._offset, e._length), e._readyToPlayCallback && e._readyToPlayCallback();\n            }, function(n) {\n              l.a.Error(\"Error while decoding audio data for: \" + e.name + \" / Error: \" + n);\n            });\n          }, r.prototype.setAudioBuffer = function(t) {\n            Ue.a.audioEngine.canUseWebAudio && (this._audioBuffer = t, this._isReadyToPlay = !0);\n          }, r.prototype.updateOptions = function(t) {\n            var e, n, i, o, a, s, d, p, y;\n            t && (this.loop = (e = t.loop) !== null && e !== void 0 ? e : this.loop, this.maxDistance = (n = t.maxDistance) !== null && n !== void 0 ? n : this.maxDistance, this.useCustomAttenuation = (i = t.useCustomAttenuation) !== null && i !== void 0 ? i : this.useCustomAttenuation, this.rolloffFactor = (o = t.rolloffFactor) !== null && o !== void 0 ? o : this.rolloffFactor, this.refDistance = (a = t.refDistance) !== null && a !== void 0 ? a : this.refDistance, this.distanceModel = (s = t.distanceModel) !== null && s !== void 0 ? s : this.distanceModel, this._playbackRate = (d = t.playbackRate) !== null && d !== void 0 ? d : this._playbackRate, this._length = (p = t.length) !== null && p !== void 0 ? p : void 0, this._offset = (y = t.offset) !== null && y !== void 0 ? y : void 0, this._updateSpatialParameters(), this.isPlaying && (this._streaming && this._htmlAudioElement ? (this._htmlAudioElement.playbackRate = this._playbackRate, this._htmlAudioElement.loop !== this.loop && (this._htmlAudioElement.loop = this.loop)) : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate, this._soundSource.loop !== this.loop && (this._soundSource.loop = this.loop), this._offset !== void 0 && this._soundSource.loopStart !== this._offset && (this._soundSource.loopStart = this._offset), this._length !== void 0 && this._length !== this._soundSource.loopEnd && (this._soundSource.loopEnd = (0 | this._offset) + this._length))));\n          }, r.prototype._createSpatialParameters = function() {\n            Ue.a.audioEngine.canUseWebAudio && Ue.a.audioEngine.audioContext && (this._scene.headphone && (this._panningModel = \"HRTF\"), this._soundPanner = Ue.a.audioEngine.audioContext.createPanner(), this._soundPanner && this._outputAudioNode && (this._updateSpatialParameters(), this._soundPanner.connect(this._outputAudioNode), this._inputAudioNode = this._soundPanner));\n          }, r.prototype._updateSpatialParameters = function() {\n            this.spatialSound && this._soundPanner && (this.useCustomAttenuation ? (this._soundPanner.distanceModel = \"linear\", this._soundPanner.maxDistance = Number.MAX_VALUE, this._soundPanner.refDistance = 1, this._soundPanner.rolloffFactor = 1, this._soundPanner.panningModel = this._panningModel) : (this._soundPanner.distanceModel = this.distanceModel, this._soundPanner.maxDistance = this.maxDistance, this._soundPanner.refDistance = this.refDistance, this._soundPanner.rolloffFactor = this.rolloffFactor, this._soundPanner.panningModel = this._panningModel));\n          }, r.prototype.switchPanningModelToHRTF = function() {\n            this._panningModel = \"HRTF\", this._switchPanningModel();\n          }, r.prototype.switchPanningModelToEqualPower = function() {\n            this._panningModel = \"equalpower\", this._switchPanningModel();\n          }, r.prototype._switchPanningModel = function() {\n            Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.panningModel = this._panningModel);\n          }, r.prototype.connectToSoundTrackAudioNode = function(t) {\n            Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && (this._isOutputConnected && this._outputAudioNode.disconnect(), this._outputAudioNode.connect(t), this._isOutputConnected = !0);\n          }, r.prototype.setDirectionalCone = function(t, e, n) {\n            e < t ? l.a.Error(\"setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.\") : (this._coneInnerAngle = t, this._coneOuterAngle = e, this._coneOuterGain = n, this._isDirectional = !0, this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length)));\n          }, Object.defineProperty(r.prototype, \"directionalConeInnerAngle\", { get: function() {\n            return this._coneInnerAngle;\n          }, set: function(t) {\n            if (t != this._coneInnerAngle) {\n              if (this._coneOuterAngle < t)\n                return void l.a.Error(\"directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneInnerAngle = t, Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.coneInnerAngle = this._coneInnerAngle);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"directionalConeOuterAngle\", { get: function() {\n            return this._coneOuterAngle;\n          }, set: function(t) {\n            if (t != this._coneOuterAngle) {\n              if (t < this._coneInnerAngle)\n                return void l.a.Error(\"directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneOuterAngle = t, Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && (this._soundPanner.coneOuterAngle = this._coneOuterAngle);\n            }\n          }, enumerable: !1, configurable: !0 }), r.prototype.setPosition = function(t) {\n            this._position = t, Ue.a.audioEngine.canUseWebAudio && this.spatialSound && this._soundPanner && !isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z) && this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z);\n          }, r.prototype.setLocalDirectionToMesh = function(t) {\n            this._localDirection = t, Ue.a.audioEngine.canUseWebAudio && this._connectedTransformNode && this.isPlaying && this._updateDirection();\n          }, r.prototype._updateDirection = function() {\n            if (this._connectedTransformNode && this._soundPanner) {\n              var t = this._connectedTransformNode.getWorldMatrix(), e = u.e.TransformNormal(this._localDirection, t);\n              e.normalize(), this._soundPanner.setOrientation(e.x, e.y, e.z);\n            }\n          }, r.prototype.updateDistanceFromListener = function() {\n            if (Ue.a.audioEngine.canUseWebAudio && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {\n              var t = this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);\n              this._soundGain.gain.value = this._customAttenuationFunction(this._volume, t, this.maxDistance, this.refDistance, this.rolloffFactor);\n            }\n          }, r.prototype.setAttenuationFunction = function(t) {\n            this._customAttenuationFunction = t;\n          }, r.prototype.play = function(t, e, n) {\n            var i = this;\n            if (this._isReadyToPlay && this._scene.audioEnabled && Ue.a.audioEngine.audioContext)\n              try {\n                this._startOffset < 0 && (t = -this._startOffset, this._startOffset = 0);\n                var o = t ? Ue.a.audioEngine.audioContext.currentTime + t : Ue.a.audioEngine.audioContext.currentTime;\n                if (this._soundSource && this._streamingSource || this.spatialSound && this._soundPanner && (isNaN(this._position.x) || isNaN(this._position.y) || isNaN(this._position.z) || this._soundPanner.setPosition(this._position.x, this._position.y, this._position.z), this._isDirectional && (this._soundPanner.coneInnerAngle = this._coneInnerAngle, this._soundPanner.coneOuterAngle = this._coneOuterAngle, this._soundPanner.coneOuterGain = this._coneOuterGain, this._connectedTransformNode ? this._updateDirection() : this._soundPanner.setOrientation(this._localDirection.x, this._localDirection.y, this._localDirection.z))), this._streaming)\n                  this._streamingSource || (this._streamingSource = Ue.a.audioEngine.audioContext.createMediaElementSource(this._htmlAudioElement), this._htmlAudioElement.onended = function() {\n                    i._onended();\n                  }, this._htmlAudioElement.playbackRate = this._playbackRate), this._streamingSource.disconnect(), this._inputAudioNode && this._streamingSource.connect(this._inputAudioNode), this._htmlAudioElement && (a = function() {\n                    if (Ue.a.audioEngine.unlocked) {\n                      var s = i._htmlAudioElement.play();\n                      s !== void 0 && s.catch(function(d) {\n                        Ue.a.audioEngine.lock(), (i.loop || i.autoplay) && Ue.a.audioEngine.onAudioUnlockedObservable.addOnce(function() {\n                          a();\n                        });\n                      });\n                    } else\n                      (i.loop || i.autoplay) && Ue.a.audioEngine.onAudioUnlockedObservable.addOnce(function() {\n                        a();\n                      });\n                  })();\n                else {\n                  var a = function() {\n                    if (Ue.a.audioEngine.audioContext) {\n                      if (n = n || i._length, e = e || i._offset, i._soundSource) {\n                        var s = i._soundSource;\n                        s.onended = function() {\n                          s.disconnect();\n                        };\n                      }\n                      if (i._soundSource = Ue.a.audioEngine.audioContext.createBufferSource(), i._soundSource && i._inputAudioNode) {\n                        i._soundSource.buffer = i._audioBuffer, i._soundSource.connect(i._inputAudioNode), i._soundSource.loop = i.loop, e !== void 0 && (i._soundSource.loopStart = e), n !== void 0 && (i._soundSource.loopEnd = (0 | e) + n), i._soundSource.playbackRate.value = i._playbackRate, i._soundSource.onended = function() {\n                          i._onended();\n                        }, o = t ? Ue.a.audioEngine.audioContext.currentTime + t : Ue.a.audioEngine.audioContext.currentTime;\n                        var d = i.isPaused ? i._startOffset % i._soundSource.buffer.duration : e || 0;\n                        i._soundSource.start(o, d, i.loop ? void 0 : n);\n                      }\n                    }\n                  };\n                  Ue.a.audioEngine.audioContext.state === \"suspended\" ? setTimeout(function() {\n                    Ue.a.audioEngine.audioContext.state === \"suspended\" ? (Ue.a.audioEngine.lock(), (i.loop || i.autoplay) && Ue.a.audioEngine.onAudioUnlockedObservable.addOnce(function() {\n                      a();\n                    })) : a();\n                  }, 500) : a();\n                }\n                this._startTime = o, this.isPlaying = !0, this.isPaused = !1;\n              } catch (s) {\n                l.a.Error(\"Error while trying to play audio: \" + this.name + \", \" + s.message);\n              }\n          }, r.prototype._onended = function() {\n            this.isPlaying = !1, this._startOffset = 0, this.onended && this.onended(), this.onEndedObservable.notifyObservers(this);\n          }, r.prototype.stop = function(t) {\n            var e = this;\n            if (this.isPlaying) {\n              if (this._streaming)\n                this._htmlAudioElement ? (this._htmlAudioElement.pause(), this._htmlAudioElement.currentTime > 0 && (this._htmlAudioElement.currentTime = 0)) : this._streamingSource.disconnect(), this.isPlaying = !1;\n              else if (Ue.a.audioEngine.audioContext && this._soundSource) {\n                var n = t ? Ue.a.audioEngine.audioContext.currentTime + t : Ue.a.audioEngine.audioContext.currentTime;\n                this._soundSource.stop(n), this._soundSource.onended = function() {\n                  e.isPlaying = !1;\n                }, this.isPaused || (this._startOffset = 0);\n              }\n            }\n          }, r.prototype.pause = function() {\n            this.isPlaying && (this.isPaused = !0, this._streaming ? this._htmlAudioElement ? this._htmlAudioElement.pause() : this._streamingSource.disconnect() : Ue.a.audioEngine.audioContext && (this.stop(0), this._startOffset += Ue.a.audioEngine.audioContext.currentTime - this._startTime));\n          }, r.prototype.setVolume = function(t, e) {\n            Ue.a.audioEngine.canUseWebAudio && this._soundGain && (e && Ue.a.audioEngine.audioContext ? (this._soundGain.gain.cancelScheduledValues(Ue.a.audioEngine.audioContext.currentTime), this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, Ue.a.audioEngine.audioContext.currentTime), this._soundGain.gain.linearRampToValueAtTime(t, Ue.a.audioEngine.audioContext.currentTime + e)) : this._soundGain.gain.value = t), this._volume = t;\n          }, r.prototype.setPlaybackRate = function(t) {\n            this._playbackRate = t, this.isPlaying && (this._streaming && this._htmlAudioElement ? this._htmlAudioElement.playbackRate = this._playbackRate : this._soundSource && (this._soundSource.playbackRate.value = this._playbackRate));\n          }, r.prototype.getVolume = function() {\n            return this._volume;\n          }, r.prototype.attachToMesh = function(t) {\n            var e = this;\n            this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null), this._connectedTransformNode = t, this.spatialSound || (this.spatialSound = !0, this._createSpatialParameters(), this.isPlaying && this.loop && (this.stop(), this.play(0, this._offset, this._length))), this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode), this._registerFunc = function(n) {\n              return e._onRegisterAfterWorldMatrixUpdate(n);\n            }, this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc);\n          }, r.prototype.detachFromMesh = function() {\n            this._connectedTransformNode && this._registerFunc && (this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc), this._registerFunc = null, this._connectedTransformNode = null);\n          }, r.prototype._onRegisterAfterWorldMatrixUpdate = function(t) {\n            if (this._positionInEmitterSpace)\n              t.worldMatrixFromCache.invertToRef(u.c.Matrix[0]), this.setPosition(u.c.Matrix[0].getTranslation());\n            else if (t.getBoundingInfo) {\n              var e = t.getBoundingInfo();\n              this.setPosition(e.boundingSphere.centerWorld);\n            } else\n              this.setPosition(t.absolutePosition);\n            Ue.a.audioEngine.canUseWebAudio && this._isDirectional && this.isPlaying && this._updateDirection();\n          }, r.prototype.clone = function() {\n            var t = this;\n            if (this._streaming)\n              return null;\n            var e = function() {\n              t._isReadyToPlay ? (i._audioBuffer = t.getAudioBuffer(), i._isReadyToPlay = !0, i.autoplay && i.play(0, t._offset, t._length)) : window.setTimeout(e, 300);\n            }, n = { autoplay: this.autoplay, loop: this.loop, volume: this._volume, spatialSound: this.spatialSound, maxDistance: this.maxDistance, useCustomAttenuation: this.useCustomAttenuation, rolloffFactor: this.rolloffFactor, refDistance: this.refDistance, distanceModel: this.distanceModel }, i = new r(this.name + \"_cloned\", new ArrayBuffer(0), this._scene, null, n);\n            return this.useCustomAttenuation && i.setAttenuationFunction(this._customAttenuationFunction), i.setPosition(this._position), i.setPlaybackRate(this._playbackRate), e(), i;\n          }, r.prototype.getAudioBuffer = function() {\n            return this._audioBuffer;\n          }, r.prototype.getSoundSource = function() {\n            return this._soundSource;\n          }, r.prototype.getSoundGain = function() {\n            return this._soundGain;\n          }, r.prototype.serialize = function() {\n            var t = { name: this.name, url: this.name, autoplay: this.autoplay, loop: this.loop, volume: this._volume, spatialSound: this.spatialSound, maxDistance: this.maxDistance, rolloffFactor: this.rolloffFactor, refDistance: this.refDistance, distanceModel: this.distanceModel, playbackRate: this._playbackRate, panningModel: this._panningModel, soundTrackId: this.soundTrackId, metadata: this.metadata };\n            return this.spatialSound && (this._connectedTransformNode && (t.connectedMeshId = this._connectedTransformNode.id), t.position = this._position.asArray(), t.refDistance = this.refDistance, t.distanceModel = this.distanceModel, t.isDirectional = this._isDirectional, t.localDirectionToMesh = this._localDirection.asArray(), t.coneInnerAngle = this._coneInnerAngle, t.coneOuterAngle = this._coneOuterAngle, t.coneOuterGain = this._coneOuterGain), t;\n          }, r.Parse = function(t, e, n, i) {\n            var o, a = t.name;\n            o = t.url ? n + t.url : n + a;\n            var s, d = { autoplay: t.autoplay, loop: t.loop, volume: t.volume, spatialSound: t.spatialSound, maxDistance: t.maxDistance, rolloffFactor: t.rolloffFactor, refDistance: t.refDistance, distanceModel: t.distanceModel, playbackRate: t.playbackRate };\n            if (i) {\n              var p = function() {\n                i._isReadyToPlay ? (s._audioBuffer = i.getAudioBuffer(), s._isReadyToPlay = !0, s.autoplay && s.play(0, s._offset, s._length)) : window.setTimeout(p, 300);\n              };\n              s = new r(a, new ArrayBuffer(0), e, null, d), p();\n            } else\n              s = new r(a, o, e, function() {\n                e._removePendingData(s);\n              }, d), e._addPendingData(s);\n            if (t.position) {\n              var y = u.e.FromArray(t.position);\n              s.setPosition(y);\n            }\n            if (t.isDirectional && (s.setDirectionalCone(t.coneInnerAngle || 360, t.coneOuterAngle || 360, t.coneOuterGain || 0), t.localDirectionToMesh)) {\n              var P = u.e.FromArray(t.localDirectionToMesh);\n              s.setLocalDirectionToMesh(P);\n            }\n            if (t.connectedMeshId) {\n              var R = e.getMeshByID(t.connectedMeshId);\n              R && s.attachToMesh(R);\n            }\n            return t.metadata && (s.metadata = t.metadata), s;\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"AudioSceneComponent\");\n          }, r;\n        }(), So = function() {\n          function r(t, e) {\n            e === void 0 && (e = {}), this.id = -1, this._isInitialized = !1, this._scene = t, this.soundCollection = new Array(), this._options = e, !this._options.mainTrack && this._scene.soundTracks && (this._scene.soundTracks.push(this), this.id = this._scene.soundTracks.length - 1);\n          }\n          return r.prototype._initializeSoundTrackAudioGraph = function() {\n            Ue.a.audioEngine.canUseWebAudio && Ue.a.audioEngine.audioContext && (this._outputAudioNode = Ue.a.audioEngine.audioContext.createGain(), this._outputAudioNode.connect(Ue.a.audioEngine.masterGain), this._options && this._options.volume && (this._outputAudioNode.gain.value = this._options.volume), this._isInitialized = !0);\n          }, r.prototype.dispose = function() {\n            if (Ue.a.audioEngine && Ue.a.audioEngine.canUseWebAudio) {\n              for (this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(); this.soundCollection.length; )\n                this.soundCollection[0].dispose();\n              this._outputAudioNode && this._outputAudioNode.disconnect(), this._outputAudioNode = null;\n            }\n          }, r.prototype.addSound = function(t) {\n            this._isInitialized || this._initializeSoundTrackAudioGraph(), Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && t.connectToSoundTrackAudioNode(this._outputAudioNode), t.soundTrackId && (t.soundTrackId === -1 ? this._scene.mainSoundTrack.removeSound(t) : this._scene.soundTracks && this._scene.soundTracks[t.soundTrackId].removeSound(t)), this.soundCollection.push(t), t.soundTrackId = this.id;\n          }, r.prototype.removeSound = function(t) {\n            var e = this.soundCollection.indexOf(t);\n            e !== -1 && this.soundCollection.splice(e, 1);\n          }, r.prototype.setVolume = function(t) {\n            Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.gain.value = t);\n          }, r.prototype.switchPanningModelToHRTF = function() {\n            if (Ue.a.audioEngine.canUseWebAudio)\n              for (var t = 0; t < this.soundCollection.length; t++)\n                this.soundCollection[t].switchPanningModelToHRTF();\n          }, r.prototype.switchPanningModelToEqualPower = function() {\n            if (Ue.a.audioEngine.canUseWebAudio)\n              for (var t = 0; t < this.soundCollection.length; t++)\n                this.soundCollection[t].switchPanningModelToEqualPower();\n          }, r.prototype.connectToAnalyser = function(t) {\n            this._connectedAnalyser && this._connectedAnalyser.stopDebugCanvas(), this._connectedAnalyser = t, Ue.a.audioEngine.canUseWebAudio && this._outputAudioNode && (this._outputAudioNode.disconnect(), this._connectedAnalyser.connectAudioNodes(this._outputAudioNode, Ue.a.audioEngine.masterGain));\n          }, r;\n        }(), ot = f(17);\n        V.a.AddParser(ot.a.NAME_AUDIO, function(r, t, e, n) {\n          var i, o = [];\n          if (e.sounds = e.sounds || [], r.sounds !== void 0 && r.sounds !== null)\n            for (var a = 0, s = r.sounds.length; a < s; a++) {\n              var d = r.sounds[a];\n              Ue.a.audioEngine.canUseWebAudio ? (d.url || (d.url = d.name), o[d.url] ? e.sounds.push(Qn.Parse(d, t, n, o[d.url])) : (i = Qn.Parse(d, t, n), o[d.url] = i, e.sounds.push(i))) : e.sounds.push(new Qn(d.name, null, t));\n            }\n          o = [];\n        }), Object.defineProperty(_e.a.prototype, \"mainSoundTrack\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), this._mainSoundTrack || (this._mainSoundTrack = new So(this, { mainTrack: !0 })), this._mainSoundTrack;\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.getSoundByName = function(r) {\n          var t;\n          for (t = 0; t < this.mainSoundTrack.soundCollection.length; t++)\n            if (this.mainSoundTrack.soundCollection[t].name === r)\n              return this.mainSoundTrack.soundCollection[t];\n          if (this.soundTracks) {\n            for (var e = 0; e < this.soundTracks.length; e++)\n              for (t = 0; t < this.soundTracks[e].soundCollection.length; t++)\n                if (this.soundTracks[e].soundCollection[t].name === r)\n                  return this.soundTracks[e].soundCollection[t];\n          }\n          return null;\n        }, Object.defineProperty(_e.a.prototype, \"audioEnabled\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.audioEnabled;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(this), this._addComponent(t)), r ? t.enableAudio() : t.disableAudio();\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(_e.a.prototype, \"headphone\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.headphone;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(this), this._addComponent(t)), r ? t.switchAudioModeForHeadphones() : t.switchAudioModeForNormalSpeakers();\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(_e.a.prototype, \"audioListenerPositionProvider\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.audioListenerPositionProvider;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          if (t || (t = new qn(this), this._addComponent(t)), typeof r != \"function\")\n            throw new Error(\"The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3\");\n          t.audioListenerPositionProvider = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(_e.a.prototype, \"audioPositioningRefreshRate\", { get: function() {\n          var r = this._getComponent(ot.a.NAME_AUDIO);\n          return r || (r = new qn(this), this._addComponent(r)), r.audioPositioningRefreshRate;\n        }, set: function(r) {\n          var t = this._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(this), this._addComponent(t)), t.audioPositioningRefreshRate = r;\n        }, enumerable: !0, configurable: !0 });\n        var qn = function() {\n          function r(t) {\n            this.name = ot.a.NAME_AUDIO, this._audioEnabled = !0, this._headphone = !1, this.audioPositioningRefreshRate = 500, this._audioListenerPositionProvider = null, this._cachedCameraDirection = new u.e(), this._cachedCameraPosition = new u.e(), this._lastCheck = 0, this.scene = t, t.soundTracks = new Array(), t.sounds = new Array();\n          }\n          return Object.defineProperty(r.prototype, \"audioEnabled\", { get: function() {\n            return this._audioEnabled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"headphone\", { get: function() {\n            return this._headphone;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"audioListenerPositionProvider\", { get: function() {\n            return this._audioListenerPositionProvider;\n          }, set: function(t) {\n            this._audioListenerPositionProvider = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.register = function() {\n            this.scene._afterRenderStage.registerStep(ot.a.STEP_AFTERRENDER_AUDIO, this, this._afterRender);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.serialize = function(t) {\n            if (t.sounds = [], this.scene.soundTracks)\n              for (var e = 0; e < this.scene.soundTracks.length; e++)\n                for (var n = this.scene.soundTracks[e], i = 0; i < n.soundCollection.length; i++)\n                  t.sounds.push(n.soundCollection[i].serialize());\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.sounds && t.sounds.forEach(function(n) {\n              n.play(), n.autoplay = !0, e.scene.mainSoundTrack.addSound(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            e === void 0 && (e = !1), t.sounds && t.sounds.forEach(function(i) {\n              i.stop(), i.autoplay = !1, n.scene.mainSoundTrack.removeSound(i), e && i.dispose();\n            });\n          }, r.prototype.dispose = function() {\n            var t = this.scene;\n            if (t._mainSoundTrack && t.mainSoundTrack.dispose(), t.soundTracks)\n              for (var e = 0; e < t.soundTracks.length; e++)\n                t.soundTracks[e].dispose();\n          }, r.prototype.disableAudio = function() {\n            var t, e = this.scene;\n            for (this._audioEnabled = !1, Ue.a.audioEngine && Ue.a.audioEngine.audioContext && Ue.a.audioEngine.audioContext.suspend(), t = 0; t < e.mainSoundTrack.soundCollection.length; t++)\n              e.mainSoundTrack.soundCollection[t].pause();\n            if (e.soundTracks)\n              for (t = 0; t < e.soundTracks.length; t++)\n                for (var n = 0; n < e.soundTracks[t].soundCollection.length; n++)\n                  e.soundTracks[t].soundCollection[n].pause();\n          }, r.prototype.enableAudio = function() {\n            var t, e = this.scene;\n            for (this._audioEnabled = !0, Ue.a.audioEngine && Ue.a.audioEngine.audioContext && Ue.a.audioEngine.audioContext.resume(), t = 0; t < e.mainSoundTrack.soundCollection.length; t++)\n              e.mainSoundTrack.soundCollection[t].isPaused && e.mainSoundTrack.soundCollection[t].play();\n            if (e.soundTracks)\n              for (t = 0; t < e.soundTracks.length; t++)\n                for (var n = 0; n < e.soundTracks[t].soundCollection.length; n++)\n                  e.soundTracks[t].soundCollection[n].isPaused && e.soundTracks[t].soundCollection[n].play();\n          }, r.prototype.switchAudioModeForHeadphones = function() {\n            var t = this.scene;\n            if (this._headphone = !0, t.mainSoundTrack.switchPanningModelToHRTF(), t.soundTracks)\n              for (var e = 0; e < t.soundTracks.length; e++)\n                t.soundTracks[e].switchPanningModelToHRTF();\n          }, r.prototype.switchAudioModeForNormalSpeakers = function() {\n            var t = this.scene;\n            if (this._headphone = !1, t.mainSoundTrack.switchPanningModelToEqualPower(), t.soundTracks)\n              for (var e = 0; e < t.soundTracks.length; e++)\n                t.soundTracks[e].switchPanningModelToEqualPower();\n          }, r.prototype._afterRender = function() {\n            var t = ye.a.Now;\n            if (!(this._lastCheck && t - this._lastCheck < this.audioPositioningRefreshRate)) {\n              this._lastCheck = t;\n              var e = this.scene;\n              if (this._audioEnabled && e._mainSoundTrack && e.soundTracks && (e._mainSoundTrack.soundCollection.length !== 0 || e.soundTracks.length !== 1)) {\n                var n = Ue.a.audioEngine;\n                if (n && n.audioContext) {\n                  if (this._audioListenerPositionProvider) {\n                    var i = this._audioListenerPositionProvider();\n                    i.x = i.x || 0, i.y = i.y || 0, i.z = i.z || 0, n.audioContext.listener.setPosition(i.x, i.y, i.z);\n                  } else {\n                    var o;\n                    if (o = e.activeCameras && e.activeCameras.length > 0 ? e.activeCameras[0] : e.activeCamera) {\n                      this._cachedCameraPosition.equals(o.globalPosition) || (this._cachedCameraPosition.copyFrom(o.globalPosition), n.audioContext.listener.setPosition(o.globalPosition.x, o.globalPosition.y, o.globalPosition.z)), o.rigCameras && o.rigCameras.length > 0 && (o = o.rigCameras[0]);\n                      var a = u.a.Invert(o.getViewMatrix()), s = u.e.TransformNormal(e.useRightHandedSystem ? r._CameraDirectionRH : r._CameraDirectionLH, a);\n                      s.normalize(), isNaN(s.x) || isNaN(s.y) || isNaN(s.z) || this._cachedCameraDirection.equals(s) || (this._cachedCameraDirection.copyFrom(s), n.audioContext.listener.setOrientation(s.x, s.y, s.z, 0, 1, 0));\n                    } else\n                      n.audioContext.listener.setPosition(0, 0, 0);\n                  }\n                  var d;\n                  for (d = 0; d < e.mainSoundTrack.soundCollection.length; d++) {\n                    var p = e.mainSoundTrack.soundCollection[d];\n                    p.useCustomAttenuation && p.updateDistanceFromListener();\n                  }\n                  if (e.soundTracks)\n                    for (d = 0; d < e.soundTracks.length; d++)\n                      for (var y = 0; y < e.soundTracks[d].soundCollection.length; y++)\n                        (p = e.soundTracks[d].soundCollection[y]).useCustomAttenuation && p.updateDistanceFromListener();\n                }\n              }\n            }\n          }, r._CameraDirectionLH = new u.e(0, 0, -1), r._CameraDirectionRH = new u.e(0, 0, 1), r;\n        }();\n        Qn._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_AUDIO);\n          t || (t = new qn(r), r._addComponent(t));\n        };\n        var lf = function() {\n          function r(t, e, n) {\n            var i = this;\n            if (this.loop = !1, this._coneInnerAngle = 360, this._coneOuterAngle = 360, this._volume = 1, this.isPlaying = !1, this.isPaused = !1, this._sounds = [], this._weights = [], e.length !== n.length)\n              throw new Error(\"Sounds length does not equal weights length\");\n            this.loop = t, this._weights = n;\n            for (var o = 0, a = 0, s = n; a < s.length; a++)\n              o += s[a];\n            for (var d = o > 0 ? 1 / o : 0, p = 0; p < this._weights.length; p++)\n              this._weights[p] *= d;\n            this._sounds = e;\n            for (var y = 0, P = this._sounds; y < P.length; y++)\n              P[y].onEndedObservable.add(function() {\n                i._onended();\n              });\n          }\n          return Object.defineProperty(r.prototype, \"directionalConeInnerAngle\", { get: function() {\n            return this._coneInnerAngle;\n          }, set: function(t) {\n            if (t !== this._coneInnerAngle) {\n              if (this._coneOuterAngle < t)\n                return void l.a.Error(\"directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneInnerAngle = t;\n              for (var e = 0, n = this._sounds; e < n.length; e++)\n                n[e].directionalConeInnerAngle = t;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"directionalConeOuterAngle\", { get: function() {\n            return this._coneOuterAngle;\n          }, set: function(t) {\n            if (t !== this._coneOuterAngle) {\n              if (t < this._coneInnerAngle)\n                return void l.a.Error(\"directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.\");\n              this._coneOuterAngle = t;\n              for (var e = 0, n = this._sounds; e < n.length; e++)\n                n[e].directionalConeOuterAngle = t;\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"volume\", { get: function() {\n            return this._volume;\n          }, set: function(t) {\n            if (t !== this._volume)\n              for (var e = 0, n = this._sounds; e < n.length; e++)\n                n[e].setVolume(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._onended = function() {\n            this._currentIndex !== void 0 && (this._sounds[this._currentIndex].autoplay = !1), this.loop && this.isPlaying ? this.play() : this.isPlaying = !1;\n          }, r.prototype.pause = function() {\n            this.isPaused = !0, this._currentIndex !== void 0 && this._sounds[this._currentIndex].pause();\n          }, r.prototype.stop = function() {\n            this.isPlaying = !1, this._currentIndex !== void 0 && this._sounds[this._currentIndex].stop();\n          }, r.prototype.play = function(t) {\n            if (!this.isPaused) {\n              this.stop();\n              for (var e = Math.random(), n = 0, i = 0; i < this._weights.length; i++)\n                if (e <= (n += this._weights[i])) {\n                  this._currentIndex = i;\n                  break;\n                }\n            }\n            var o = this._sounds[this._currentIndex];\n            o.isReady() ? o.play(0, this.isPaused ? void 0 : t) : o.autoplay = !0, this.isPlaying = !0, this.isPaused = !1;\n          }, r;\n        }(), yt = f(18), Qc = function() {\n          function r() {\n            this._zoomStopsAnimation = !1, this._idleRotationSpeed = 0.05, this._idleRotationWaitTime = 2e3, this._idleRotationSpinupTime = 2e3, this._isPointerDown = !1, this._lastFrameTime = null, this._lastInteractionTime = -1 / 0, this._cameraRotationSpeed = 0, this._lastFrameRadius = 0;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"AutoRotation\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"zoomStopsAnimation\", { get: function() {\n            return this._zoomStopsAnimation;\n          }, set: function(t) {\n            this._zoomStopsAnimation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"idleRotationSpeed\", { get: function() {\n            return this._idleRotationSpeed;\n          }, set: function(t) {\n            this._idleRotationSpeed = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"idleRotationWaitTime\", { get: function() {\n            return this._idleRotationWaitTime;\n          }, set: function(t) {\n            this._idleRotationWaitTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"idleRotationSpinupTime\", { get: function() {\n            return this._idleRotationSpinupTime;\n          }, set: function(t) {\n            this._idleRotationSpinupTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rotationInProgress\", { get: function() {\n            return Math.abs(this._cameraRotationSpeed) > 0;\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._attachedCamera = t;\n            var n = this._attachedCamera.getScene();\n            this._onPrePointerObservableObserver = n.onPrePointerObservable.add(function(i) {\n              i.type !== yt.a.POINTERDOWN ? i.type === yt.a.POINTERUP && (e._isPointerDown = !1) : e._isPointerDown = !0;\n            }), this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {\n              var i = ye.a.Now, o = 0;\n              e._lastFrameTime != null && (o = i - e._lastFrameTime), e._lastFrameTime = i, e._applyUserInteraction();\n              var a = i - e._lastInteractionTime - e._idleRotationWaitTime, s = Math.max(Math.min(a / e._idleRotationSpinupTime, 1), 0);\n              e._cameraRotationSpeed = e._idleRotationSpeed * s, e._attachedCamera && (e._attachedCamera.alpha -= e._cameraRotationSpeed * (o / 1e3));\n            });\n          }, r.prototype.detach = function() {\n            if (this._attachedCamera) {\n              var t = this._attachedCamera.getScene();\n              this._onPrePointerObservableObserver && t.onPrePointerObservable.remove(this._onPrePointerObservableObserver), this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._attachedCamera = null;\n            }\n          }, r.prototype._userIsZooming = function() {\n            return !!this._attachedCamera && this._attachedCamera.inertialRadiusOffset !== 0;\n          }, r.prototype._shouldAnimationStopForInteraction = function() {\n            if (!this._attachedCamera)\n              return !1;\n            var t = !1;\n            return this._lastFrameRadius === this._attachedCamera.radius && this._attachedCamera.inertialRadiusOffset !== 0 && (t = !0), this._lastFrameRadius = this._attachedCamera.radius, this._zoomStopsAnimation ? t : this._userIsZooming();\n          }, r.prototype._applyUserInteraction = function() {\n            this._userIsMoving() && !this._shouldAnimationStopForInteraction() && (this._lastInteractionTime = ye.a.Now);\n          }, r.prototype._userIsMoving = function() {\n            return !!this._attachedCamera && (this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown);\n          }, r;\n        }(), qc = function() {\n          function r() {\n            this.transitionDuration = 450, this.lowerRadiusTransitionRange = 2, this.upperRadiusTransitionRange = -2, this._autoTransitionRange = !1, this._radiusIsAnimating = !1, this._radiusBounceTransition = null, this._animatables = new Array();\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"Bouncing\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"autoTransitionRange\", { get: function() {\n            return this._autoTransitionRange;\n          }, set: function(t) {\n            var e = this;\n            if (this._autoTransitionRange !== t) {\n              this._autoTransitionRange = t;\n              var n = this._attachedCamera;\n              n && (t ? this._onMeshTargetChangedObserver = n.onMeshTargetChangedObservable.add(function(i) {\n                if (i) {\n                  i.computeWorldMatrix(!0);\n                  var o = i.getBoundingInfo().diagonalLength;\n                  e.lowerRadiusTransitionRange = 0.05 * o, e.upperRadiusTransitionRange = 0.05 * o;\n                }\n              }) : this._onMeshTargetChangedObserver && n.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver));\n            }\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._attachedCamera = t, this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {\n              e._attachedCamera && (e._isRadiusAtLimit(e._attachedCamera.lowerRadiusLimit) && e._applyBoundRadiusAnimation(e.lowerRadiusTransitionRange), e._isRadiusAtLimit(e._attachedCamera.upperRadiusLimit) && e._applyBoundRadiusAnimation(e.upperRadiusTransitionRange));\n            });\n          }, r.prototype.detach = function() {\n            this._attachedCamera && (this._onAfterCheckInputsObserver && this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver), this._onMeshTargetChangedObserver && this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver), this._attachedCamera = null);\n          }, r.prototype._isRadiusAtLimit = function(t) {\n            return !!this._attachedCamera && this._attachedCamera.radius === t && !this._radiusIsAnimating;\n          }, r.prototype._applyBoundRadiusAnimation = function(t) {\n            var e = this;\n            if (this._attachedCamera) {\n              this._radiusBounceTransition || (r.EasingFunction.setEasingMode(r.EasingMode), this._radiusBounceTransition = k.CreateAnimation(\"radius\", k.ANIMATIONTYPE_FLOAT, 60, r.EasingFunction)), this._cachedWheelPrecision = this._attachedCamera.wheelPrecision, this._attachedCamera.wheelPrecision = 1 / 0, this._attachedCamera.inertialRadiusOffset = 0, this.stopAllAnimations(), this._radiusIsAnimating = !0;\n              var n = k.TransitionTo(\"radius\", this._attachedCamera.radius + t, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusBounceTransition, this.transitionDuration, function() {\n                return e._clearAnimationLocks();\n              });\n              n && this._animatables.push(n);\n            }\n          }, r.prototype._clearAnimationLocks = function() {\n            this._radiusIsAnimating = !1, this._attachedCamera && (this._attachedCamera.wheelPrecision = this._cachedWheelPrecision);\n          }, r.prototype.stopAllAnimations = function() {\n            for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length; )\n              this._animatables[0].onAnimationEnd = null, this._animatables[0].stop(), this._animatables.shift();\n          }, r.EasingFunction = new Je(0.3), r.EasingMode = Ge.EASINGMODE_EASEOUT, r;\n        }(), Zc = function() {\n          function r() {\n            this._mode = r.FitFrustumSidesMode, this._radiusScale = 1, this._positionScale = 0.5, this._defaultElevation = 0.3, this._elevationReturnTime = 1500, this._elevationReturnWaitTime = 1e3, this._zoomStopsAnimation = !1, this._framingTime = 1500, this.autoCorrectCameraLimitsAndSensibility = !0, this._isPointerDown = !1, this._lastInteractionTime = -1 / 0, this._animatables = new Array(), this._betaIsAnimating = !1;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"Framing\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"mode\", { get: function() {\n            return this._mode;\n          }, set: function(t) {\n            this._mode = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"radiusScale\", { get: function() {\n            return this._radiusScale;\n          }, set: function(t) {\n            this._radiusScale = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"positionScale\", { get: function() {\n            return this._positionScale;\n          }, set: function(t) {\n            this._positionScale = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"defaultElevation\", { get: function() {\n            return this._defaultElevation;\n          }, set: function(t) {\n            this._defaultElevation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"elevationReturnTime\", { get: function() {\n            return this._elevationReturnTime;\n          }, set: function(t) {\n            this._elevationReturnTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"elevationReturnWaitTime\", { get: function() {\n            return this._elevationReturnWaitTime;\n          }, set: function(t) {\n            this._elevationReturnWaitTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"zoomStopsAnimation\", { get: function() {\n            return this._zoomStopsAnimation;\n          }, set: function(t) {\n            this._zoomStopsAnimation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"framingTime\", { get: function() {\n            return this._framingTime;\n          }, set: function(t) {\n            this._framingTime = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._attachedCamera = t;\n            var n = this._attachedCamera.getScene();\n            r.EasingFunction.setEasingMode(r.EasingMode), this._onPrePointerObservableObserver = n.onPrePointerObservable.add(function(i) {\n              i.type !== yt.a.POINTERDOWN ? i.type === yt.a.POINTERUP && (e._isPointerDown = !1) : e._isPointerDown = !0;\n            }), this._onMeshTargetChangedObserver = t.onMeshTargetChangedObservable.add(function(i) {\n              i && e.zoomOnMesh(i);\n            }), this._onAfterCheckInputsObserver = t.onAfterCheckInputsObservable.add(function() {\n              e._applyUserInteraction(), e._maintainCameraAboveGround();\n            });\n          }, r.prototype.detach = function() {\n            if (this._attachedCamera) {\n              var t = this._attachedCamera.getScene();\n              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;\n            }\n          }, r.prototype.zoomOnMesh = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = null), t.computeWorldMatrix(!0);\n            var i = t.getBoundingInfo().boundingBox;\n            this.zoomOnBoundingInfo(i.minimumWorld, i.maximumWorld, e, n);\n          }, r.prototype.zoomOnMeshHierarchy = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = null), t.computeWorldMatrix(!0);\n            var i = t.getHierarchyBoundingVectors(!0);\n            this.zoomOnBoundingInfo(i.min, i.max, e, n);\n          }, r.prototype.zoomOnMeshesHierarchy = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = null);\n            for (var i = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), o = new u.e(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE), a = 0; a < t.length; a++) {\n              var s = t[a].getHierarchyBoundingVectors(!0);\n              u.e.CheckExtends(s.min, i, o), u.e.CheckExtends(s.max, i, o);\n            }\n            this.zoomOnBoundingInfo(i, o, e, n);\n          }, r.prototype.zoomOnBoundingInfo = function(t, e, n, i) {\n            var o, a = this;\n            if (n === void 0 && (n = !1), i === void 0 && (i = null), this._attachedCamera) {\n              var s = t.y, d = s + (e.y - s) * this._positionScale, p = e.subtract(t).scale(0.5);\n              if (n)\n                o = new u.e(0, d, 0);\n              else {\n                var y = t.add(p);\n                o = new u.e(y.x, d, y.z);\n              }\n              this._vectorTransition || (this._vectorTransition = k.CreateAnimation(\"target\", k.ANIMATIONTYPE_VECTOR3, 60, r.EasingFunction)), this._betaIsAnimating = !0;\n              var P = k.TransitionTo(\"target\", o, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime);\n              P && this._animatables.push(P);\n              var R = 0;\n              if (this._mode === r.FitFrustumSidesMode) {\n                var B = this._calculateLowerRadiusFromModelBoundingSphere(t, e);\n                this.autoCorrectCameraLimitsAndSensibility && (this._attachedCamera.lowerRadiusLimit = p.length() + this._attachedCamera.minZ), R = B;\n              } else\n                this._mode === r.IgnoreBoundsSizeMode && (R = this._calculateLowerRadiusFromModelBoundingSphere(t, e), this.autoCorrectCameraLimitsAndSensibility && this._attachedCamera.lowerRadiusLimit === null && (this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ));\n              if (this.autoCorrectCameraLimitsAndSensibility) {\n                var F = e.subtract(t).length();\n                this._attachedCamera.panningSensibility = 5e3 / F, this._attachedCamera.wheelPrecision = 100 / R;\n              }\n              this._radiusTransition || (this._radiusTransition = k.CreateAnimation(\"radius\", k.ANIMATIONTYPE_FLOAT, 60, r.EasingFunction)), (P = k.TransitionTo(\"radius\", R, this._attachedCamera, this._attachedCamera.getScene(), 60, this._radiusTransition, this._framingTime, function() {\n                a.stopAllAnimations(), i && i(), a._attachedCamera && a._attachedCamera.useInputToRestoreState && a._attachedCamera.storeState();\n              })) && this._animatables.push(P);\n            }\n          }, r.prototype._calculateLowerRadiusFromModelBoundingSphere = function(t, e) {\n            var n = e.subtract(t).length(), i = this._getFrustumSlope(), o = 0.5 * n * this._radiusScale, a = o * Math.sqrt(1 + 1 / (i.x * i.x)), s = o * Math.sqrt(1 + 1 / (i.y * i.y)), d = Math.max(a, s), p = this._attachedCamera;\n            return p ? (p.lowerRadiusLimit && this._mode === r.IgnoreBoundsSizeMode && (d = d < p.lowerRadiusLimit ? p.lowerRadiusLimit : d), p.upperRadiusLimit && (d = d > p.upperRadiusLimit ? p.upperRadiusLimit : d), d) : 0;\n          }, r.prototype._maintainCameraAboveGround = function() {\n            var t = this;\n            if (!(this._elevationReturnTime < 0)) {\n              var e = ye.a.Now - this._lastInteractionTime, n = 0.5 * Math.PI - this._defaultElevation, i = 0.5 * Math.PI;\n              if (this._attachedCamera && !this._betaIsAnimating && this._attachedCamera.beta > i && e >= this._elevationReturnWaitTime) {\n                this._betaIsAnimating = !0, this.stopAllAnimations(), this._betaTransition || (this._betaTransition = k.CreateAnimation(\"beta\", k.ANIMATIONTYPE_FLOAT, 60, r.EasingFunction));\n                var o = k.TransitionTo(\"beta\", n, this._attachedCamera, this._attachedCamera.getScene(), 60, this._betaTransition, this._elevationReturnTime, function() {\n                  t._clearAnimationLocks(), t.stopAllAnimations();\n                });\n                o && this._animatables.push(o);\n              }\n            }\n          }, r.prototype._getFrustumSlope = function() {\n            var t = this._attachedCamera;\n            if (!t)\n              return u.d.Zero();\n            var e = t.getScene().getEngine().getAspectRatio(t), n = Math.tan(t.fov / 2), i = n * e;\n            return new u.d(i, n);\n          }, r.prototype._clearAnimationLocks = function() {\n            this._betaIsAnimating = !1;\n          }, r.prototype._applyUserInteraction = function() {\n            this.isUserIsMoving && (this._lastInteractionTime = ye.a.Now, this.stopAllAnimations(), this._clearAnimationLocks());\n          }, r.prototype.stopAllAnimations = function() {\n            for (this._attachedCamera && (this._attachedCamera.animations = []); this._animatables.length; )\n              this._animatables[0] && (this._animatables[0].onAnimationEnd = null, this._animatables[0].stop()), this._animatables.shift();\n          }, Object.defineProperty(r.prototype, \"isUserIsMoving\", { get: function() {\n            return !!this._attachedCamera && (this._attachedCamera.inertialAlphaOffset !== 0 || this._attachedCamera.inertialBetaOffset !== 0 || this._attachedCamera.inertialRadiusOffset !== 0 || this._attachedCamera.inertialPanningX !== 0 || this._attachedCamera.inertialPanningY !== 0 || this._isPointerDown);\n          }, enumerable: !1, configurable: !0 }), r.EasingFunction = new Tt(), r.EasingMode = Ge.EASINGMODE_EASEINOUT, r.IgnoreBoundsSizeMode = 0, r.FitFrustumSidesMode = 1, r;\n        }(), or = function(r, t, e, n) {\n          t === void 0 && (t = new u.e()), e === void 0 && (e = 0), n === void 0 && (n = !1), this.direction = r, this.rotatedDirection = t, this.diff = e, this.ignore = n;\n        }, uf = function() {\n          function r(t) {\n            this.ui = t, this.name = \"AttachToBoxBehavior\", this.distanceAwayFromFace = 0.15, this.distanceAwayFromBottomOfFace = 0.15, this._faceVectors = [new or(u.e.Up()), new or(u.e.Down()), new or(u.e.Left()), new or(u.e.Right()), new or(u.e.Forward()), new or(u.e.Forward().scaleInPlace(-1))], this._tmpMatrix = new u.a(), this._tmpVector = new u.e(), this._zeroVector = u.e.Zero(), this._lookAtTmpMatrix = new u.a();\n          }\n          return r.prototype.init = function() {\n          }, r.prototype._closestFace = function(t) {\n            var e = this;\n            return this._faceVectors.forEach(function(n) {\n              e._target.rotationQuaternion || (e._target.rotationQuaternion = u.b.RotationYawPitchRoll(e._target.rotation.y, e._target.rotation.x, e._target.rotation.z)), e._target.rotationQuaternion.toRotationMatrix(e._tmpMatrix), u.e.TransformCoordinatesToRef(n.direction, e._tmpMatrix, n.rotatedDirection), n.diff = u.e.GetAngleBetweenVectors(n.rotatedDirection, t, u.e.Cross(n.rotatedDirection, t));\n            }), this._faceVectors.reduce(function(n, i) {\n              return n.ignore ? i : i.ignore || n.diff < i.diff ? n : i;\n            }, this._faceVectors[0]);\n          }, r.prototype._lookAtToRef = function(t, e, n) {\n            e === void 0 && (e = new u.e(0, 1, 0)), u.a.LookAtLHToRef(this._zeroVector, t, e, this._lookAtTmpMatrix), this._lookAtTmpMatrix.invert(), u.b.FromRotationMatrixToRef(this._lookAtTmpMatrix, n);\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._target = t, this._scene = this._target.getScene(), this._onRenderObserver = this._scene.onBeforeRenderObservable.add(function() {\n              if (e._scene.activeCamera) {\n                var n = e._scene.activeCamera.position;\n                e._scene.activeCamera.devicePosition && (n = e._scene.activeCamera.devicePosition);\n                var i = e._closestFace(n.subtract(t.position));\n                e._scene.activeCamera.leftCamera ? e._scene.activeCamera.leftCamera.computeWorldMatrix().getRotationMatrixToRef(e._tmpMatrix) : e._scene.activeCamera.computeWorldMatrix().getRotationMatrixToRef(e._tmpMatrix), u.e.TransformCoordinatesToRef(u.e.Up(), e._tmpMatrix, e._tmpVector), e._faceVectors.forEach(function(a) {\n                  i.direction.x && a.direction.x && (a.ignore = !0), i.direction.y && a.direction.y && (a.ignore = !0), i.direction.z && a.direction.z && (a.ignore = !0);\n                });\n                var o = e._closestFace(e._tmpVector);\n                e._faceVectors.forEach(function(a) {\n                  a.ignore = !1;\n                }), e.ui.position.copyFrom(t.position), i.direction.x && (i.rotatedDirection.scaleToRef(t.scaling.x / 2 + e.distanceAwayFromFace, e._tmpVector), e.ui.position.addInPlace(e._tmpVector)), i.direction.y && (i.rotatedDirection.scaleToRef(t.scaling.y / 2 + e.distanceAwayFromFace, e._tmpVector), e.ui.position.addInPlace(e._tmpVector)), i.direction.z && (i.rotatedDirection.scaleToRef(t.scaling.z / 2 + e.distanceAwayFromFace, e._tmpVector), e.ui.position.addInPlace(e._tmpVector)), e.ui.rotationQuaternion || (e.ui.rotationQuaternion = u.b.RotationYawPitchRoll(e.ui.rotation.y, e.ui.rotation.x, e.ui.rotation.z)), i.rotatedDirection.scaleToRef(-1, e._tmpVector), e._lookAtToRef(e._tmpVector, o.rotatedDirection, e.ui.rotationQuaternion), o.direction.x && e.ui.up.scaleToRef(e.distanceAwayFromBottomOfFace - t.scaling.x / 2, e._tmpVector), o.direction.y && e.ui.up.scaleToRef(e.distanceAwayFromBottomOfFace - t.scaling.y / 2, e._tmpVector), o.direction.z && e.ui.up.scaleToRef(e.distanceAwayFromBottomOfFace - t.scaling.z / 2, e._tmpVector), e.ui.position.addInPlace(e._tmpVector);\n              }\n            });\n          }, r.prototype.detach = function() {\n            this._scene.onBeforeRenderObservable.remove(this._onRenderObserver);\n          }, r;\n        }(), hf = function() {\n          function r() {\n            var t = this;\n            this.delay = 0, this.fadeInTime = 300, this._millisecondsPerFrame = 1e3 / 60, this._hovered = !1, this._hoverValue = 0, this._ownerNode = null, this._update = function() {\n              if (t._ownerNode) {\n                if (t._hoverValue += t._hovered ? t._millisecondsPerFrame : -t._millisecondsPerFrame, t._setAllVisibility(t._ownerNode, (t._hoverValue - t.delay) / t.fadeInTime), t._ownerNode.visibility > 1)\n                  return t._setAllVisibility(t._ownerNode, 1), void (t._hoverValue = t.fadeInTime + t.delay);\n                if (t._ownerNode.visibility < 0 && (t._setAllVisibility(t._ownerNode, 0), t._hoverValue < 0))\n                  return void (t._hoverValue = 0);\n                setTimeout(t._update, t._millisecondsPerFrame);\n              }\n            };\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"FadeInOut\";\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype.attach = function(t) {\n            this._ownerNode = t, this._setAllVisibility(this._ownerNode, 0);\n          }, r.prototype.detach = function() {\n            this._ownerNode = null;\n          }, r.prototype.fadeIn = function(t) {\n            this._hovered = t, this._update();\n          }, r.prototype._setAllVisibility = function(t, e) {\n            var n = this;\n            t.visibility = e, t.getChildMeshes().forEach(function(i) {\n              n._setAllVisibility(i, e);\n            });\n          }, r;\n        }(), fi = f(65), df = function() {\n          function r() {\n            this._startDistance = 0, this._initialScale = new u.e(0, 0, 0), this._targetScale = new u.e(0, 0, 0), this._sceneRenderObserver = null, this._dragBehaviorA = new fi.a({}), this._dragBehaviorA.moveAttached = !1, this._dragBehaviorB = new fi.a({}), this._dragBehaviorB.moveAttached = !1;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"MultiPointerScale\";\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, r.prototype._getCurrentDistance = function() {\n            return this._dragBehaviorA.lastDragPosition.subtract(this._dragBehaviorB.lastDragPosition).length();\n          }, r.prototype.attach = function(t) {\n            var e = this;\n            this._ownerNode = t, this._dragBehaviorA.onDragStartObservable.add(function(n) {\n              e._dragBehaviorA.dragging && e._dragBehaviorB.dragging && (e._dragBehaviorA.currentDraggingPointerID == e._dragBehaviorB.currentDraggingPointerID ? e._dragBehaviorA.releaseDrag() : (e._initialScale.copyFrom(t.scaling), e._startDistance = e._getCurrentDistance()));\n            }), this._dragBehaviorB.onDragStartObservable.add(function(n) {\n              e._dragBehaviorA.dragging && e._dragBehaviorB.dragging && (e._dragBehaviorA.currentDraggingPointerID == e._dragBehaviorB.currentDraggingPointerID ? e._dragBehaviorB.releaseDrag() : (e._initialScale.copyFrom(t.scaling), e._startDistance = e._getCurrentDistance()));\n            }), [this._dragBehaviorA, this._dragBehaviorB].forEach(function(n) {\n              n.onDragObservable.add(function() {\n                if (e._dragBehaviorA.dragging && e._dragBehaviorB.dragging) {\n                  var i = e._getCurrentDistance() / e._startDistance;\n                  e._initialScale.scaleToRef(i, e._targetScale);\n                }\n              });\n            }), t.addBehavior(this._dragBehaviorA), t.addBehavior(this._dragBehaviorB), this._sceneRenderObserver = t.getScene().onBeforeRenderObservable.add(function() {\n              if (e._dragBehaviorA.dragging && e._dragBehaviorB.dragging) {\n                var n = e._targetScale.subtract(t.scaling).scaleInPlace(0.1);\n                n.length() > 0.01 && t.scaling.addInPlace(n);\n              }\n            });\n          }, r.prototype.detach = function() {\n            var t = this;\n            this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), [this._dragBehaviorA, this._dragBehaviorB].forEach(function(e) {\n              e.onDragStartObservable.clear(), e.onDragObservable.clear(), t._ownerNode.removeBehavior(e);\n            });\n          }, r;\n        }(), Mt = f(31), _t = f(24), Un = f(60), Jc = function() {\n          function r() {\n            this._sceneRenderObserver = null, this._targetPosition = new u.e(0, 0, 0), this._moving = !1, this._startingOrientation = new u.b(), this._attachedToElement = !1, this.zDragFactor = 3, this.rotateDraggedObject = !0, this.dragging = !1, this.dragDeltaRatio = 0.2, this.currentDraggingPointerID = -1, this.detachCameraControls = !0, this.onDragStartObservable = new C.c(), this.onDragObservable = new C.c(), this.onDragEndObservable = new C.c();\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return \"SixDofDrag\";\n          }, enumerable: !1, configurable: !0 }), r.prototype.init = function() {\n          }, Object.defineProperty(r.prototype, \"_pointerCamera\", { get: function() {\n            return this._scene.cameraToUseForPointers ? this._scene.cameraToUseForPointers : this._scene.activeCamera;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attach = function(t) {\n            var e = this;\n            this._ownerNode = t, this._scene = this._ownerNode.getScene(), r._virtualScene || (r._virtualScene = new _e.a(this._scene.getEngine(), { virtual: !0 }), r._virtualScene.detachControl(), this._scene.getEngine().scenes.pop());\n            var n = null, i = new u.e(0, 0, 0);\n            this._virtualOriginMesh = new Mt.a(\"\", r._virtualScene), this._virtualOriginMesh.rotationQuaternion = new u.b(), this._virtualDragMesh = new Mt.a(\"\", r._virtualScene), this._virtualDragMesh.rotationQuaternion = new u.b(), this._pointerObserver = this._scene.onPointerObservable.add(function(a, s) {\n              if (a.type == yt.a.POINTERDOWN) {\n                if (!e.dragging && a.pickInfo && a.pickInfo.hit && a.pickInfo.pickedMesh && a.pickInfo.ray && (R = a.pickInfo.pickedMesh, e._ownerNode == R || R.isDescendantOf(e._ownerNode))) {\n                  e._pointerCamera && e._pointerCamera.cameraRigMode == _t.a.RIG_MODE_NONE && a.pickInfo.ray.origin.copyFrom(e._pointerCamera.globalPosition), n = e._ownerNode, Un.a._RemoveAndStorePivotPoint(n), i.copyFrom(a.pickInfo.ray.origin), e._virtualOriginMesh.position.copyFrom(a.pickInfo.ray.origin), e._virtualOriginMesh.lookAt(a.pickInfo.ray.origin.add(a.pickInfo.ray.direction)), e._virtualOriginMesh.removeChild(e._virtualDragMesh), n.computeWorldMatrix(), e._virtualDragMesh.position.copyFrom(n.absolutePosition), n.rotationQuaternion || (n.rotationQuaternion = u.b.RotationYawPitchRoll(n.rotation.y, n.rotation.x, n.rotation.z));\n                  var d = n.parent;\n                  n.setParent(null), e._virtualDragMesh.rotationQuaternion.copyFrom(n.rotationQuaternion), n.setParent(d), e._virtualOriginMesh.addChild(e._virtualDragMesh), e._targetPosition.copyFrom(e._virtualDragMesh.absolutePosition), e.dragging = !0, e.currentDraggingPointerID = a.event.pointerId, e.detachCameraControls && e._pointerCamera && !e._pointerCamera.leftCamera && (e._pointerCamera.inputs.attachedToElement ? (e._pointerCamera.detachControl(), e._attachedToElement = !0) : e._attachedToElement = !1), Un.a._RestorePivotPoint(n), e.onDragStartObservable.notifyObservers({});\n                }\n              } else if (a.type == yt.a.POINTERUP || a.type == yt.a.POINTERDOUBLETAP)\n                e.currentDraggingPointerID == a.event.pointerId && (e.dragging = !1, e._moving = !1, e.currentDraggingPointerID = -1, n = null, e._virtualOriginMesh.removeChild(e._virtualDragMesh), e.detachCameraControls && e._attachedToElement && e._pointerCamera && !e._pointerCamera.leftCamera && (e._pointerCamera.attachControl(!0), e._attachedToElement = !1), e.onDragEndObservable.notifyObservers({}));\n              else if (a.type == yt.a.POINTERMOVE && e.currentDraggingPointerID == a.event.pointerId && e.dragging && a.pickInfo && a.pickInfo.ray && n) {\n                var p = e.zDragFactor;\n                e._pointerCamera && e._pointerCamera.cameraRigMode == _t.a.RIG_MODE_NONE && (a.pickInfo.ray.origin.copyFrom(e._pointerCamera.globalPosition), p = 0);\n                var y = a.pickInfo.ray.origin.subtract(i);\n                i.copyFrom(a.pickInfo.ray.origin);\n                var P = -u.e.Dot(y, a.pickInfo.ray.direction);\n                e._virtualOriginMesh.addChild(e._virtualDragMesh), e._virtualDragMesh.position.z -= e._virtualDragMesh.position.z < 1 ? P * e.zDragFactor : P * p * e._virtualDragMesh.position.z, e._virtualDragMesh.position.z < 0 && (e._virtualDragMesh.position.z = 0), e._virtualOriginMesh.position.copyFrom(a.pickInfo.ray.origin), e._virtualOriginMesh.lookAt(a.pickInfo.ray.origin.add(a.pickInfo.ray.direction)), e._virtualOriginMesh.removeChild(e._virtualDragMesh), e._targetPosition.copyFrom(e._virtualDragMesh.absolutePosition), n.parent && u.e.TransformCoordinatesToRef(e._targetPosition, u.a.Invert(n.parent.getWorldMatrix()), e._targetPosition), e._moving || e._startingOrientation.copyFrom(e._virtualDragMesh.rotationQuaternion), e._moving = !0;\n              }\n              var R;\n            });\n            var o = new u.b();\n            this._sceneRenderObserver = t.getScene().onBeforeRenderObservable.add(function() {\n              if (e.dragging && e._moving && n) {\n                if (Un.a._RemoveAndStorePivotPoint(n), n.position.addInPlace(e._targetPosition.subtract(n.position).scale(e.dragDeltaRatio)), e.rotateDraggedObject) {\n                  o.copyFrom(e._startingOrientation), o.x = -o.x, o.y = -o.y, o.z = -o.z, e._virtualDragMesh.rotationQuaternion.multiplyToRef(o, o), u.b.RotationYawPitchRollToRef(o.toEulerAngles(\"xyz\").y, 0, 0, o), o.multiplyToRef(e._startingOrientation, o);\n                  var a = n.parent;\n                  (!a || a.scaling && !a.scaling.isNonUniformWithinEpsilon(1e-3)) && (n.setParent(null), u.b.SlerpToRef(n.rotationQuaternion, o, e.dragDeltaRatio, n.rotationQuaternion), n.setParent(a));\n                }\n                Un.a._RestorePivotPoint(n), e.onDragObservable.notifyObservers();\n              }\n            });\n          }, r.prototype.detach = function() {\n            this._scene && (this.detachCameraControls && this._attachedToElement && this._pointerCamera && !this._pointerCamera.leftCamera && (this._pointerCamera.attachControl(!0), this._attachedToElement = !1), this._scene.onPointerObservable.remove(this._pointerObserver)), this._ownerNode && this._ownerNode.getScene().onBeforeRenderObservable.remove(this._sceneRenderObserver), this._virtualOriginMesh && this._virtualOriginMesh.dispose(), this._virtualDragMesh && this._virtualDragMesh.dispose(), this.onDragEndObservable.clear(), this.onDragObservable.clear(), this.onDragStartObservable.clear();\n          }, r;\n        }(), ff = function() {\n          function r(t, e, n) {\n            if (this.targetPosition = u.e.Zero(), this.poleTargetPosition = u.e.Zero(), this.poleTargetLocalOffset = u.e.Zero(), this.poleAngle = 0, this.slerpAmount = 1, this._bone1Quat = u.b.Identity(), this._bone1Mat = u.a.Identity(), this._bone2Ang = Math.PI, this._maxAngle = Math.PI, this._rightHandedSystem = !1, this._bendAxis = u.e.Right(), this._slerping = !1, this._adjustRoll = 0, this._bone2 = e, this._bone1 = e.getParent(), this._bone1) {\n              this.mesh = t;\n              var i = e.getPosition();\n              if (e.getAbsoluteTransform().determinant() > 0 && (this._rightHandedSystem = !0, this._bendAxis.x = 0, this._bendAxis.y = 0, this._bendAxis.z = -1, i.x > i.y && i.x > i.z && (this._adjustRoll = 0.5 * Math.PI, this._bendAxis.z = 1)), this._bone1.length) {\n                var o = this._bone1.getScale(), a = this._bone2.getScale();\n                this._bone1Length = this._bone1.length * o.y * this.mesh.scaling.y, this._bone2Length = this._bone2.length * a.y * this.mesh.scaling.y;\n              } else if (this._bone1.children[0]) {\n                t.computeWorldMatrix(!0);\n                var s = this._bone2.children[0].getAbsolutePosition(t), d = this._bone2.getAbsolutePosition(t), p = this._bone1.getAbsolutePosition(t);\n                this._bone1Length = u.e.Distance(s, d), this._bone2Length = u.e.Distance(d, p);\n              }\n              this._bone1.getRotationMatrixToRef(be.c.WORLD, t, this._bone1Mat), this.maxAngle = Math.PI, n && (n.targetMesh && (this.targetMesh = n.targetMesh, this.targetMesh.computeWorldMatrix(!0)), n.poleTargetMesh ? (this.poleTargetMesh = n.poleTargetMesh, this.poleTargetMesh.computeWorldMatrix(!0)) : n.poleTargetBone ? this.poleTargetBone = n.poleTargetBone : this._bone1.getParent() && (this.poleTargetBone = this._bone1.getParent()), n.poleTargetLocalOffset && this.poleTargetLocalOffset.copyFrom(n.poleTargetLocalOffset), n.poleAngle && (this.poleAngle = n.poleAngle), n.bendAxis && this._bendAxis.copyFrom(n.bendAxis), n.maxAngle && (this.maxAngle = n.maxAngle), n.slerpAmount && (this.slerpAmount = n.slerpAmount));\n            }\n          }\n          return Object.defineProperty(r.prototype, \"maxAngle\", { get: function() {\n            return this._maxAngle;\n          }, set: function(t) {\n            this._setMaxAngle(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._setMaxAngle = function(t) {\n            t < 0 && (t = 0), (t > Math.PI || t == null) && (t = Math.PI), this._maxAngle = t;\n            var e = this._bone1Length, n = this._bone2Length;\n            this._maxReach = Math.sqrt(e * e + n * n - 2 * e * n * Math.cos(t));\n          }, r.prototype.update = function() {\n            var t = this._bone1;\n            if (t) {\n              var e = this.targetPosition, n = this.poleTargetPosition, i = r._tmpMats[0], o = r._tmpMats[1];\n              this.targetMesh && e.copyFrom(this.targetMesh.getAbsolutePosition()), this.poleTargetBone ? this.poleTargetBone.getAbsolutePositionFromLocalToRef(this.poleTargetLocalOffset, this.mesh, n) : this.poleTargetMesh && u.e.TransformCoordinatesToRef(this.poleTargetLocalOffset, this.poleTargetMesh.getWorldMatrix(), n);\n              var a = r._tmpVecs[0], s = r._tmpVecs[1], d = r._tmpVecs[2], p = r._tmpVecs[3], y = r._tmpVecs[4], P = r._tmpQuat;\n              t.getAbsolutePositionToRef(this.mesh, a), n.subtractToRef(a, y), y.x == 0 && y.y == 0 && y.z == 0 ? y.y = 1 : y.normalize(), e.subtractToRef(a, p), p.normalize(), u.e.CrossToRef(p, y, s), s.normalize(), u.e.CrossToRef(p, s, d), d.normalize(), u.a.FromXYZAxesToRef(d, p, s, i);\n              var R = this._bone1Length, B = this._bone2Length, F = u.e.Distance(a, e);\n              this._maxReach > 0 && (F = Math.min(this._maxReach, F));\n              var z = (B * B + F * F - R * R) / (2 * B * F), J = (F * F + R * R - B * B) / (2 * F * R);\n              z > 1 && (z = 1), J > 1 && (J = 1), z < -1 && (z = -1), J < -1 && (J = -1);\n              var ie = Math.acos(z), se = Math.acos(J), ce = -ie - se;\n              if (this._rightHandedSystem)\n                u.a.RotationYawPitchRollToRef(0, 0, this._adjustRoll, o), o.multiplyToRef(i, i), u.a.RotationAxisToRef(this._bendAxis, se, o), o.multiplyToRef(i, i);\n              else {\n                var ue = r._tmpVecs[5];\n                ue.copyFrom(this._bendAxis), ue.x *= -1, u.a.RotationAxisToRef(ue, -se, o), o.multiplyToRef(i, i);\n              }\n              this.poleAngle && (u.a.RotationAxisToRef(p, this.poleAngle, o), i.multiplyToRef(o, i)), this._bone1 && (this.slerpAmount < 1 ? (this._slerping || u.b.FromRotationMatrixToRef(this._bone1Mat, this._bone1Quat), u.b.FromRotationMatrixToRef(i, P), u.b.SlerpToRef(this._bone1Quat, P, this.slerpAmount, this._bone1Quat), ce = this._bone2Ang * (1 - this.slerpAmount) + ce * this.slerpAmount, this._bone1.setRotationQuaternion(this._bone1Quat, be.c.WORLD, this.mesh), this._slerping = !0) : (this._bone1.setRotationMatrix(i, be.c.WORLD, this.mesh), this._bone1Mat.copyFrom(i), this._slerping = !1)), this._bone2.setAxisAngle(this._bendAxis, ce, be.c.LOCAL), this._bone2Ang = ce;\n            }\n          }, r._tmpVecs = [u.e.Zero(), u.e.Zero(), u.e.Zero(), u.e.Zero(), u.e.Zero(), u.e.Zero()], r._tmpQuat = u.b.Identity(), r._tmpMats = [u.a.Identity(), u.a.Identity()], r;\n        }(), pf = function() {\n          function r(t, e, n, i) {\n            if (this.upAxis = u.e.Up(), this.upAxisSpace = be.c.LOCAL, this.adjustYaw = 0, this.adjustPitch = 0, this.adjustRoll = 0, this.slerpAmount = 1, this._boneQuat = u.b.Identity(), this._slerping = !1, this._firstFrameSkipped = !1, this._fowardAxis = u.e.Forward(), this.mesh = t, this.bone = e, this.target = n, i && (i.adjustYaw && (this.adjustYaw = i.adjustYaw), i.adjustPitch && (this.adjustPitch = i.adjustPitch), i.adjustRoll && (this.adjustRoll = i.adjustRoll), i.maxYaw != null ? this.maxYaw = i.maxYaw : this.maxYaw = Math.PI, i.minYaw != null ? this.minYaw = i.minYaw : this.minYaw = -Math.PI, i.maxPitch != null ? this.maxPitch = i.maxPitch : this.maxPitch = Math.PI, i.minPitch != null ? this.minPitch = i.minPitch : this.minPitch = -Math.PI, i.slerpAmount != null && (this.slerpAmount = i.slerpAmount), i.upAxis != null && (this.upAxis = i.upAxis), i.upAxisSpace != null && (this.upAxisSpace = i.upAxisSpace), i.yawAxis != null || i.pitchAxis != null)) {\n              var o = be.a.Y, a = be.a.X;\n              i.yawAxis != null && (o = i.yawAxis.clone()).normalize(), i.pitchAxis != null && (a = i.pitchAxis.clone()).normalize();\n              var s = u.e.Cross(a, o);\n              this._transformYawPitch = u.a.Identity(), u.a.FromXYZAxesToRef(a, o, s, this._transformYawPitch), this._transformYawPitchInv = this._transformYawPitch.clone(), this._transformYawPitch.invert();\n            }\n            e.getParent() || this.upAxisSpace != be.c.BONE || (this.upAxisSpace = be.c.LOCAL);\n          }\n          return Object.defineProperty(r.prototype, \"minYaw\", { get: function() {\n            return this._minYaw;\n          }, set: function(t) {\n            this._minYaw = t, this._minYawSin = Math.sin(t), this._minYawCos = Math.cos(t), this._maxYaw != null && (this._midYawConstraint = 0.5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxYaw\", { get: function() {\n            return this._maxYaw;\n          }, set: function(t) {\n            this._maxYaw = t, this._maxYawSin = Math.sin(t), this._maxYawCos = Math.cos(t), this._minYaw != null && (this._midYawConstraint = 0.5 * this._getAngleDiff(this._minYaw, this._maxYaw) + this._minYaw, this._yawRange = this._maxYaw - this._minYaw);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"minPitch\", { get: function() {\n            return this._minPitch;\n          }, set: function(t) {\n            this._minPitch = t, this._minPitchTan = Math.tan(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxPitch\", { get: function() {\n            return this._maxPitch;\n          }, set: function(t) {\n            this._maxPitch = t, this._maxPitchTan = Math.tan(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.update = function() {\n            if (this.slerpAmount < 1 && !this._firstFrameSkipped)\n              this._firstFrameSkipped = !0;\n            else {\n              var t = this.bone, e = r._tmpVecs[0];\n              t.getAbsolutePositionToRef(this.mesh, e);\n              var n = this.target, i = r._tmpMats[0], o = r._tmpMats[1], a = this.mesh, s = t.getParent(), d = r._tmpVecs[1];\n              d.copyFrom(this.upAxis), this.upAxisSpace == be.c.BONE && s ? (this._transformYawPitch && u.e.TransformCoordinatesToRef(d, this._transformYawPitchInv, d), s.getDirectionToRef(d, this.mesh, d)) : this.upAxisSpace == be.c.LOCAL && (a.getDirectionToRef(d, d), a.scaling.x == 1 && a.scaling.y == 1 && a.scaling.z == 1 || d.normalize());\n              var p = !1, y = !1;\n              if (this._maxYaw == Math.PI && this._minYaw == -Math.PI || (p = !0), this._maxPitch == Math.PI && this._minPitch == -Math.PI || (y = !0), p || y) {\n                var P = r._tmpMats[2], R = r._tmpMats[3];\n                if (this.upAxisSpace == be.c.BONE && d.y == 1 && s)\n                  s.getRotationMatrixToRef(be.c.WORLD, this.mesh, P);\n                else if (this.upAxisSpace != be.c.LOCAL || d.y != 1 || s) {\n                  (F = r._tmpVecs[2]).copyFrom(this._fowardAxis), this._transformYawPitch && u.e.TransformCoordinatesToRef(F, this._transformYawPitchInv, F), s ? s.getDirectionToRef(F, this.mesh, F) : a.getDirectionToRef(F, F);\n                  var B = u.e.Cross(d, F);\n                  B.normalize();\n                  var F = u.e.Cross(B, d);\n                  u.a.FromXYZAxesToRef(B, d, F, P);\n                } else\n                  P.copyFrom(a.getWorldMatrix());\n                P.invertToRef(R);\n                var z = null;\n                if (y) {\n                  var J = r._tmpVecs[3];\n                  n.subtractToRef(e, J), u.e.TransformCoordinatesToRef(J, R, J), z = Math.sqrt(J.x * J.x + J.z * J.z);\n                  var ie = Math.atan2(J.y, z), se = ie;\n                  ie > this._maxPitch ? (J.y = this._maxPitchTan * z, se = this._maxPitch) : ie < this._minPitch && (J.y = this._minPitchTan * z, se = this._minPitch), ie != se && (u.e.TransformCoordinatesToRef(J, P, J), J.addInPlace(e), n = J);\n                }\n                if (p) {\n                  J = r._tmpVecs[4], n.subtractToRef(e, J), u.e.TransformCoordinatesToRef(J, R, J);\n                  var ce = Math.atan2(J.x, J.z), ue = ce;\n                  if ((ce > this._maxYaw || ce < this._minYaw) && (z == null && (z = Math.sqrt(J.x * J.x + J.z * J.z)), this._yawRange > Math.PI ? this._isAngleBetween(ce, this._maxYaw, this._midYawConstraint) ? (J.z = this._maxYawCos * z, J.x = this._maxYawSin * z, ue = this._maxYaw) : this._isAngleBetween(ce, this._midYawConstraint, this._minYaw) && (J.z = this._minYawCos * z, J.x = this._minYawSin * z, ue = this._minYaw) : ce > this._maxYaw ? (J.z = this._maxYawCos * z, J.x = this._maxYawSin * z, ue = this._maxYaw) : ce < this._minYaw && (J.z = this._minYawCos * z, J.x = this._minYawSin * z, ue = this._minYaw)), this._slerping && this._yawRange > Math.PI) {\n                    var fe = r._tmpVecs[8];\n                    fe.copyFrom(be.a.Z), this._transformYawPitch && u.e.TransformCoordinatesToRef(fe, this._transformYawPitchInv, fe);\n                    var ve = r._tmpMats[4];\n                    this._boneQuat.toRotationMatrix(ve), this.mesh.getWorldMatrix().multiplyToRef(ve, ve), u.e.TransformCoordinatesToRef(fe, ve, fe), u.e.TransformCoordinatesToRef(fe, R, fe);\n                    var Te = Math.atan2(fe.x, fe.z);\n                    if (this._getAngleBetween(Te, ce) > this._getAngleBetween(Te, this._midYawConstraint)) {\n                      z == null && (z = Math.sqrt(J.x * J.x + J.z * J.z));\n                      var Re = this._getAngleBetween(Te, this._maxYaw);\n                      this._getAngleBetween(Te, this._minYaw) < Re ? (ue = Te + 0.75 * Math.PI, J.z = Math.cos(ue) * z, J.x = Math.sin(ue) * z) : (ue = Te - 0.75 * Math.PI, J.z = Math.cos(ue) * z, J.x = Math.sin(ue) * z);\n                    }\n                  }\n                  ce != ue && (u.e.TransformCoordinatesToRef(J, P, J), J.addInPlace(e), n = J);\n                }\n              }\n              var Ae = r._tmpVecs[5], Ee = r._tmpVecs[6], Se = r._tmpVecs[7], De = r._tmpQuat;\n              n.subtractToRef(e, Ae), Ae.normalize(), u.e.CrossToRef(d, Ae, Ee), Ee.normalize(), u.e.CrossToRef(Ae, Ee, Se), Se.normalize(), u.a.FromXYZAxesToRef(Ee, Se, Ae, i), Ee.x === 0 && Ee.y === 0 && Ee.z === 0 || Se.x === 0 && Se.y === 0 && Se.z === 0 || Ae.x === 0 && Ae.y === 0 && Ae.z === 0 || ((this.adjustYaw || this.adjustPitch || this.adjustRoll) && (u.a.RotationYawPitchRollToRef(this.adjustYaw, this.adjustPitch, this.adjustRoll, o), o.multiplyToRef(i, i)), this.slerpAmount < 1 ? (this._slerping || this.bone.getRotationQuaternionToRef(be.c.WORLD, this.mesh, this._boneQuat), this._transformYawPitch && this._transformYawPitch.multiplyToRef(i, i), u.b.FromRotationMatrixToRef(i, De), u.b.SlerpToRef(this._boneQuat, De, this.slerpAmount, this._boneQuat), this.bone.setRotationQuaternion(this._boneQuat, be.c.WORLD, this.mesh), this._slerping = !0) : (this._transformYawPitch && this._transformYawPitch.multiplyToRef(i, i), this.bone.setRotationMatrix(i, be.c.WORLD, this.mesh), this._slerping = !1));\n            }\n          }, r.prototype._getAngleDiff = function(t, e) {\n            var n = e - t;\n            return (n %= 2 * Math.PI) > Math.PI ? n -= 2 * Math.PI : n < -Math.PI && (n += 2 * Math.PI), n;\n          }, r.prototype._getAngleBetween = function(t, e) {\n            var n = 0;\n            return (n = (t = (t %= 2 * Math.PI) < 0 ? t + 2 * Math.PI : t) < (e = (e %= 2 * Math.PI) < 0 ? e + 2 * Math.PI : e) ? e - t : t - e) > Math.PI && (n = 2 * Math.PI - n), n;\n          }, r.prototype._isAngleBetween = function(t, e, n) {\n            if (t = (t %= 2 * Math.PI) < 0 ? t + 2 * Math.PI : t, (e = (e %= 2 * Math.PI) < 0 ? e + 2 * Math.PI : e) < (n = (n %= 2 * Math.PI) < 0 ? n + 2 * Math.PI : n)) {\n              if (t > e && t < n)\n                return !0;\n            } else if (t > n && t < e)\n              return !0;\n            return !1;\n          }, r._tmpVecs = Pe.a.BuildArray(10, u.e.Zero), r._tmpQuat = u.b.Identity(), r._tmpMats = Pe.a.BuildArray(5, u.a.Identity), r;\n        }(), Ne = f(10), Pt = f(27), wt = f(26);\n        function $c(r, t, e, n) {\n          var i;\n          i = n === h.a.TEXTURETYPE_FLOAT ? new Float32Array(t * e * 4) : new Uint32Array(t * e * 4);\n          for (var o = 0; o < t; o++)\n            for (var a = 0; a < e; a++) {\n              var s = 3 * (a * t + o), d = 4 * (a * t + o);\n              i[d + 0] = r[s + 0], i[d + 1] = r[s + 1], i[d + 2] = r[s + 2], i[d + 3] = 1;\n            }\n          return i;\n        }\n        function el(r) {\n          return function(t, e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = null), y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var P = r ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY, R = r ? Pt.b.Raw3D : Pt.b.Raw2DArray, B = new Pt.a(this, R);\n            B.baseWidth = e, B.baseHeight = n, B.baseDepth = i, B.width = e, B.height = n, B.depth = i, B.format = o, B.type = y, B.generateMipMaps = a, B.samplingMode = d, r ? B.is3D = !0 : B.is2DArray = !0, this._doNotHandleContextLost || (B._bufferView = t), r ? this.updateRawTexture3D(B, t, o, s, p, y) : this.updateRawTexture2DArray(B, t, o, s, p, y), this._bindTextureDirectly(P, B, !0);\n            var F = this._getSamplingParameters(d, a);\n            return this._gl.texParameteri(P, this._gl.TEXTURE_MAG_FILTER, F.mag), this._gl.texParameteri(P, this._gl.TEXTURE_MIN_FILTER, F.min), a && this._gl.generateMipmap(P), this._bindTextureDirectly(P, null), this._internalTexturesCache.push(B), B;\n          };\n        }\n        function tl(r) {\n          return function(t, e, n, i, o, a) {\n            o === void 0 && (o = null), a === void 0 && (a = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var s = r ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY, d = this._getWebGLTextureType(a), p = this._getInternalFormat(n), y = this._getRGBABufferInternalSizedFormat(a, n);\n            this._bindTextureDirectly(s, t, !0), this._unpackFlipY(i === void 0 || !!i), this._doNotHandleContextLost || (t._bufferView = e, t.format = n, t.invertY = i, t._compression = o), t.width % 4 != 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), o && e ? this._gl.compressedTexImage3D(s, 0, this.getCaps().s3tc[o], t.width, t.height, t.depth, 0, e) : this._gl.texImage3D(s, 0, y, t.width, t.height, t.depth, 0, p, d, e), t.generateMipMaps && this._gl.generateMipmap(s), this._bindTextureDirectly(s, null), t.isReady = !0;\n          };\n        }\n        wt.a.prototype.updateRawTexture = function(r, t, e, n, i, o) {\n          if (i === void 0 && (i = null), o === void 0 && (o = h.a.TEXTURETYPE_UNSIGNED_INT), r) {\n            var a = this._getRGBABufferInternalSizedFormat(o, e), s = this._getInternalFormat(e), d = this._getWebGLTextureType(o);\n            this._bindTextureDirectly(this._gl.TEXTURE_2D, r, !0), this._unpackFlipY(n === void 0 || !!n), this._doNotHandleContextLost || (r._bufferView = t, r.format = e, r.type = o, r.invertY = n, r._compression = i), r.width % 4 != 0 && this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1), i && t ? this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, this.getCaps().s3tc[i], r.width, r.height, 0, t) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, a, r.width, r.height, 0, s, d, t), r.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), r.isReady = !0;\n          }\n        }, wt.a.prototype.createRawTexture = function(r, t, e, n, i, o, a, s, d) {\n          s === void 0 && (s = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n          var p = new Pt.a(this, Pt.b.Raw);\n          p.baseWidth = t, p.baseHeight = e, p.width = t, p.height = e, p.format = n, p.generateMipMaps = i, p.samplingMode = a, p.invertY = o, p._compression = s, p.type = d, this._doNotHandleContextLost || (p._bufferView = r), this.updateRawTexture(p, r, n, o, s, d), this._bindTextureDirectly(this._gl.TEXTURE_2D, p, !0);\n          var y = this._getSamplingParameters(a, i);\n          return this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, y.mag), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, y.min), i && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(this._gl.TEXTURE_2D, null), this._internalTexturesCache.push(p), p;\n        }, wt.a.prototype.createRawCubeTexture = function(r, t, e, n, i, o, a, s) {\n          s === void 0 && (s = null);\n          var d = this._gl, p = new Pt.a(this, Pt.b.CubeRaw);\n          p.isCube = !0, p.format = e, p.type = n, this._doNotHandleContextLost || (p._bufferViewArray = r);\n          var y = this._getWebGLTextureType(n), P = this._getInternalFormat(e);\n          P === d.RGB && (P = d.RGBA), y !== d.FLOAT || this._caps.textureFloatLinearFiltering ? y !== this._gl.HALF_FLOAT_OES || this._caps.textureHalfFloatLinearFiltering ? y !== d.FLOAT || this._caps.textureFloatRender ? y !== d.HALF_FLOAT || this._caps.colorBufferFloat || (i = !1, l.a.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\")) : (i = !1, l.a.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\")) : (i = !1, a = h.a.TEXTURE_NEAREST_SAMPLINGMODE, l.a.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\")) : (i = !1, a = h.a.TEXTURE_NEAREST_SAMPLINGMODE, l.a.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\"));\n          var R = t, B = R;\n          p.width = R, p.height = B, !this.needPOTTextures || Xe.b.IsExponentOfTwo(p.width) && Xe.b.IsExponentOfTwo(p.height) || (i = !1), r && this.updateRawCubeTexture(p, r, e, n, o, s), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, p, !0), r && i && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);\n          var F = this._getSamplingParameters(a, i);\n          return d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_MAG_FILTER, F.mag), d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_MIN_FILTER, F.min), d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_WRAP_S, d.CLAMP_TO_EDGE), d.texParameteri(d.TEXTURE_CUBE_MAP, d.TEXTURE_WRAP_T, d.CLAMP_TO_EDGE), this._bindTextureDirectly(d.TEXTURE_CUBE_MAP, null), p.generateMipMaps = i, p;\n        }, wt.a.prototype.updateRawCubeTexture = function(r, t, e, n, i, o, a) {\n          o === void 0 && (o = null), a === void 0 && (a = 0), r._bufferViewArray = t, r.format = e, r.type = n, r.invertY = i, r._compression = o;\n          var s = this._gl, d = this._getWebGLTextureType(n), p = this._getInternalFormat(e), y = this._getRGBABufferInternalSizedFormat(n), P = !1;\n          p === s.RGB && (p = s.RGBA, P = !0), this._bindTextureDirectly(s.TEXTURE_CUBE_MAP, r, !0), this._unpackFlipY(i === void 0 || !!i), r.width % 4 != 0 && s.pixelStorei(s.UNPACK_ALIGNMENT, 1);\n          for (var R = 0; R < 6; R++) {\n            var B = t[R];\n            o ? s.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + R, a, this.getCaps().s3tc[o], r.width, r.height, 0, B) : (P && (B = $c(B, r.width, r.height, n)), s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X + R, a, y, r.width, r.height, 0, p, d, B));\n          }\n          (!this.needPOTTextures || Xe.b.IsExponentOfTwo(r.width) && Xe.b.IsExponentOfTwo(r.height)) && r.generateMipMaps && a === 0 && this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP), this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null), r.isReady = !0;\n        }, wt.a.prototype.createRawCubeTextureFromUrl = function(r, t, e, n, i, o, a, s, d, p, y, P) {\n          var R = this;\n          d === void 0 && (d = null), p === void 0 && (p = null), y === void 0 && (y = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), P === void 0 && (P = !1);\n          var B = this._gl, F = this.createRawCubeTexture(null, e, n, i, !o, P, y, null);\n          return t == null || t._addPendingData(F), F.url = r, this._internalTexturesCache.push(F), this._loadFile(r, function(z) {\n            (function(J) {\n              var ie = F.width, se = a(J);\n              if (se) {\n                if (s) {\n                  var ce = R._getWebGLTextureType(i), ue = R._getInternalFormat(n), fe = R._getRGBABufferInternalSizedFormat(i), ve = !1;\n                  ue === B.RGB && (ue = B.RGBA, ve = !0), R._bindTextureDirectly(B.TEXTURE_CUBE_MAP, F, !0), R._unpackFlipY(!1);\n                  for (var Te = s(se), Re = 0; Re < Te.length; Re++)\n                    for (var Ae = ie >> Re, Ee = 0; Ee < 6; Ee++) {\n                      var Se = Te[Re][Ee];\n                      ve && (Se = $c(Se, Ae, Ae, i)), B.texImage2D(Ee, Re, fe, Ae, Ae, 0, ue, ce, Se);\n                    }\n                  R._bindTextureDirectly(B.TEXTURE_CUBE_MAP, null);\n                } else\n                  R.updateRawCubeTexture(F, se, n, i, P);\n                F.isReady = !0, t == null || t._removePendingData(F), d && d();\n              }\n            })(z);\n          }, void 0, t == null ? void 0 : t.offlineProvider, !0, function(z, J) {\n            t == null || t._removePendingData(F), p && z && p(z.status + \" \" + z.statusText, J);\n          }), F;\n        }, wt.a.prototype.createRawTexture2DArray = el(!1), wt.a.prototype.createRawTexture3D = el(!0), wt.a.prototype.updateRawTexture2DArray = tl(!1), wt.a.prototype.updateRawTexture3D = tl(!0);\n        var Zn = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            s === void 0 && (s = !0), d === void 0 && (d = !1), p === void 0 && (p = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var P = r.call(this, null, a, !s, d) || this;\n            return P.format = o, P._engine && (P._texture = P._engine.createRawTexture(e, n, i, o, s, d, p, null, y), P.wrapU = Ne.a.CLAMP_ADDRESSMODE, P.wrapV = Ne.a.CLAMP_ADDRESSMODE), P;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e) {\n            this._getEngine().updateRawTexture(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);\n          }, t.CreateLuminanceTexture = function(e, n, i, o, a, s, d) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), new t(e, n, i, h.a.TEXTUREFORMAT_LUMINANCE, o, a, s, d);\n          }, t.CreateLuminanceAlphaTexture = function(e, n, i, o, a, s, d) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), new t(e, n, i, h.a.TEXTUREFORMAT_LUMINANCE_ALPHA, o, a, s, d);\n          }, t.CreateAlphaTexture = function(e, n, i, o, a, s, d) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), new t(e, n, i, h.a.TEXTUREFORMAT_ALPHA, o, a, s, d);\n          }, t.CreateRGBTexture = function(e, n, i, o, a, s, d, p) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), new t(e, n, i, h.a.TEXTUREFORMAT_RGB, o, a, s, d, p);\n          }, t.CreateRGBATexture = function(e, n, i, o, a, s, d, p) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), new t(e, n, i, h.a.TEXTUREFORMAT_RGBA, o, a, s, d, p);\n          }, t.CreateRTexture = function(e, n, i, o, a, s, d, p) {\n            return a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = Ne.a.TRILINEAR_SAMPLINGMODE), p === void 0 && (p = h.a.TEXTURETYPE_FLOAT), new t(e, n, i, h.a.TEXTUREFORMAT_R, o, a, s, d, p);\n          }, t;\n        }(Ne.a), Ao = function() {\n          function r(t, e, n) {\n            this.name = t, this.id = e, this.bones = new Array(), this.needInitialSkinMatrix = !1, this.overrideMesh = null, this._isDirty = !0, this._meshesWithPoseMatrix = new Array(), this._identity = u.a.Identity(), this._ranges = {}, this._lastAbsoluteTransformsUpdateId = -1, this._canUseTextureForBones = !1, this._uniqueId = 0, this._numBonesWithLinkedTransformNode = 0, this._hasWaitingData = null, this._waitingOverrideMeshId = null, this.doNotSerialize = !1, this._useTextureToStoreBoneMatrices = !0, this._animationPropertiesOverride = null, this.onBeforeComputeObservable = new C.c(), this.bones = [], this._scene = n || te.a.LastCreatedScene, this._uniqueId = this._scene.getUniqueId(), this._scene.addSkeleton(this), this._isDirty = !0;\n            var i = this._scene.getEngine().getCaps();\n            this._canUseTextureForBones = i.textureFloat && i.maxVertexTextureImageUnits > 0;\n          }\n          return Object.defineProperty(r.prototype, \"useTextureToStoreBoneMatrices\", { get: function() {\n            return this._useTextureToStoreBoneMatrices;\n          }, set: function(t) {\n            this._useTextureToStoreBoneMatrices = t, this._markAsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationPropertiesOverride\", { get: function() {\n            return this._animationPropertiesOverride ? this._animationPropertiesOverride : this._scene.animationPropertiesOverride;\n          }, set: function(t) {\n            this._animationPropertiesOverride = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isUsingTextureForMatrices\", { get: function() {\n            return this.useTextureToStoreBoneMatrices && this._canUseTextureForBones;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"Skeleton\";\n          }, r.prototype.getChildren = function() {\n            return this.bones.filter(function(t) {\n              return !t.getParent();\n            });\n          }, r.prototype.getTransformMatrices = function(t) {\n            return this.needInitialSkinMatrix && t._bonesTransformMatrices ? t._bonesTransformMatrices : (this._transformMatrices || this.prepare(), this._transformMatrices);\n          }, r.prototype.getTransformMatrixTexture = function(t) {\n            return this.needInitialSkinMatrix && t._transformMatrixTexture ? t._transformMatrixTexture : this._transformMatrixTexture;\n          }, r.prototype.getScene = function() {\n            return this._scene;\n          }, r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name + \", nBones: \" + this.bones.length;\n            if (e += \", nAnimationRanges: \" + (this._ranges ? Object.keys(this._ranges).length : \"none\"), t) {\n              e += \", Ranges: {\";\n              var n = !0;\n              for (var i in this._ranges)\n                n && (e += \", \", n = !1), e += i;\n              e += \"}\";\n            }\n            return e;\n          }, r.prototype.getBoneIndexByName = function(t) {\n            for (var e = 0, n = this.bones.length; e < n; e++)\n              if (this.bones[e].name === t)\n                return e;\n            return -1;\n          }, r.prototype.createAnimationRange = function(t, e, n) {\n            if (!this._ranges[t]) {\n              this._ranges[t] = new G(t, e, n);\n              for (var i = 0, o = this.bones.length; i < o; i++)\n                this.bones[i].animations[0] && this.bones[i].animations[0].createRange(t, e, n);\n            }\n          }, r.prototype.deleteAnimationRange = function(t, e) {\n            e === void 0 && (e = !0);\n            for (var n = 0, i = this.bones.length; n < i; n++)\n              this.bones[n].animations[0] && this.bones[n].animations[0].deleteRange(t, e);\n            this._ranges[t] = null;\n          }, r.prototype.getAnimationRange = function(t) {\n            return this._ranges[t] || null;\n          }, r.prototype.getAnimationRanges = function() {\n            var t, e = [];\n            for (t in this._ranges)\n              e.push(this._ranges[t]);\n            return e;\n          }, r.prototype.copyAnimationRange = function(t, e, n) {\n            if (n === void 0 && (n = !1), this._ranges[e] || !t.getAnimationRange(e))\n              return !1;\n            var i, o, a = !0, s = this._getHighestAnimationFrame() + 1, d = {}, p = t.bones;\n            for (o = 0, i = p.length; o < i; o++)\n              d[p[o].name] = p[o];\n            this.bones.length !== p.length && (l.a.Warn(\"copyAnimationRange: this rig has \" + this.bones.length + \" bones, while source as \" + p.length), a = !1);\n            var y = n && this.dimensionsAtRest && t.dimensionsAtRest ? this.dimensionsAtRest.divide(t.dimensionsAtRest) : null;\n            for (o = 0, i = this.bones.length; o < i; o++) {\n              var P = this.bones[o].name, R = d[P];\n              R ? a = a && this.bones[o].copyAnimationRange(R, e, s, n, y) : (l.a.Warn(\"copyAnimationRange: not same rig, missing source bone \" + P), a = !1);\n            }\n            var B = t.getAnimationRange(e);\n            return B && (this._ranges[e] = new G(e, B.from + s, B.to + s)), a;\n          }, r.prototype.returnToRest = function() {\n            for (var t = u.c.Vector3[0], e = u.c.Quaternion[0], n = u.c.Vector3[1], i = 0; i < this.bones.length; i++) {\n              var o = this.bones[i];\n              o._index !== -1 && (o.returnToRest(), o._linkedTransformNode && (o.getRestPose().decompose(t, e, n), o._linkedTransformNode.position = n.clone(), o._linkedTransformNode.rotationQuaternion = e.clone(), o._linkedTransformNode.scaling = t.clone()));\n            }\n          }, r.prototype._getHighestAnimationFrame = function() {\n            for (var t = 0, e = 0, n = this.bones.length; e < n; e++)\n              if (this.bones[e].animations[0]) {\n                var i = this.bones[e].animations[0].getHighestFrame();\n                t < i && (t = i);\n              }\n            return t;\n          }, r.prototype.beginAnimation = function(t, e, n, i) {\n            var o = this.getAnimationRange(t);\n            return o ? this._scene.beginAnimation(this, o.from, o.to, e, n, i) : null;\n          }, r.MakeAnimationAdditive = function(t, e, n) {\n            e === void 0 && (e = 0);\n            var i = t.getAnimationRange(n);\n            if (!i)\n              return null;\n            for (var o = t._scene.getAllAnimatablesByTarget(t), a = null, s = 0; s < o.length; s++) {\n              var d = o[s];\n              if (d.fromFrame === (i == null ? void 0 : i.from) && d.toFrame === (i == null ? void 0 : i.to)) {\n                a = d;\n                break;\n              }\n            }\n            var p = t.getAnimatables();\n            for (s = 0; s < p.length; s++) {\n              var y = p[s].animations;\n              if (y)\n                for (var P = 0; P < y.length; P++)\n                  k.MakeAnimationAdditive(y[P], e, n);\n            }\n            return a && (a.isAdditive = !0), t;\n          }, r.prototype._markAsDirty = function() {\n            this._isDirty = !0;\n          }, r.prototype._registerMeshWithPoseMatrix = function(t) {\n            this._meshesWithPoseMatrix.push(t);\n          }, r.prototype._unregisterMeshWithPoseMatrix = function(t) {\n            var e = this._meshesWithPoseMatrix.indexOf(t);\n            e > -1 && this._meshesWithPoseMatrix.splice(e, 1);\n          }, r.prototype._computeTransformMatrices = function(t, e) {\n            this.onBeforeComputeObservable.notifyObservers(this);\n            for (var n = 0; n < this.bones.length; n++) {\n              var i = this.bones[n];\n              i._childUpdateId++;\n              var o = i.getParent();\n              if (o ? i.getLocalMatrix().multiplyToRef(o.getWorldMatrix(), i.getWorldMatrix()) : e ? i.getLocalMatrix().multiplyToRef(e, i.getWorldMatrix()) : i.getWorldMatrix().copyFrom(i.getLocalMatrix()), i._index !== -1) {\n                var a = i._index === null ? n : i._index;\n                i.getInvertedAbsoluteTransform().multiplyToArray(i.getWorldMatrix(), t, 16 * a);\n              }\n            }\n            this._identity.copyToArray(t, 16 * this.bones.length);\n          }, r.prototype.prepare = function() {\n            if (this._numBonesWithLinkedTransformNode > 0)\n              for (var t = 0, e = this.bones; t < e.length; t++) {\n                var n = e[t];\n                n._linkedTransformNode && (n._linkedTransformNode.computeWorldMatrix(), n._matrix = n._linkedTransformNode._localMatrix, n.markAsDirty());\n              }\n            if (this._isDirty) {\n              if (this.needInitialSkinMatrix)\n                for (var i = 0; i < this._meshesWithPoseMatrix.length; i++) {\n                  var o = this._meshesWithPoseMatrix[i], a = o.getPoseMatrix();\n                  if (o._bonesTransformMatrices && o._bonesTransformMatrices.length === 16 * (this.bones.length + 1) || (o._bonesTransformMatrices = new Float32Array(16 * (this.bones.length + 1))), this._synchronizedWithMesh !== o) {\n                    this._synchronizedWithMesh = o;\n                    for (var s = 0; s < this.bones.length; s++) {\n                      var d = this.bones[s];\n                      d.getParent() || (d.getBaseMatrix().multiplyToRef(a, u.c.Matrix[1]), d._updateDifferenceMatrix(u.c.Matrix[1]));\n                    }\n                    if (this.isUsingTextureForMatrices) {\n                      var p = 4 * (this.bones.length + 1);\n                      o._transformMatrixTexture && o._transformMatrixTexture.getSize().width === p || (o._transformMatrixTexture && o._transformMatrixTexture.dispose(), o._transformMatrixTexture = Zn.CreateRGBATexture(o._bonesTransformMatrices, 4 * (this.bones.length + 1), 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT));\n                    }\n                  }\n                  this._computeTransformMatrices(o._bonesTransformMatrices, a), this.isUsingTextureForMatrices && o._transformMatrixTexture && o._transformMatrixTexture.update(o._bonesTransformMatrices);\n                }\n              else\n                this._transformMatrices && this._transformMatrices.length === 16 * (this.bones.length + 1) || (this._transformMatrices = new Float32Array(16 * (this.bones.length + 1)), this.isUsingTextureForMatrices && (this._transformMatrixTexture && this._transformMatrixTexture.dispose(), this._transformMatrixTexture = Zn.CreateRGBATexture(this._transformMatrices, 4 * (this.bones.length + 1), 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT))), this._computeTransformMatrices(this._transformMatrices, null), this.isUsingTextureForMatrices && this._transformMatrixTexture && this._transformMatrixTexture.update(this._transformMatrices);\n              this._isDirty = !1, this._scene._activeBones.addCount(this.bones.length, !1);\n            }\n          }, r.prototype.getAnimatables = function() {\n            if (!this._animatables || this._animatables.length !== this.bones.length) {\n              this._animatables = [];\n              for (var t = 0; t < this.bones.length; t++)\n                this._animatables.push(this.bones[t]);\n            }\n            return this._animatables;\n          }, r.prototype.clone = function(t, e) {\n            var n = new r(t, e || t, this._scene);\n            n.needInitialSkinMatrix = this.needInitialSkinMatrix, n.overrideMesh = this.overrideMesh;\n            for (var i = 0; i < this.bones.length; i++) {\n              var o = this.bones[i], a = null, s = o.getParent();\n              if (s) {\n                var d = this.bones.indexOf(s);\n                a = n.bones[d];\n              }\n              var p = new Fe(o.name, n, a, o.getBaseMatrix().clone(), o.getRestPose().clone());\n              p._index = o._index, o._linkedTransformNode && p.linkTransformNode(o._linkedTransformNode), de.a.DeepCopy(o.animations, p.animations);\n            }\n            if (this._ranges)\n              for (var y in n._ranges = {}, this._ranges) {\n                var P = this._ranges[y];\n                P && (n._ranges[y] = P.clone());\n              }\n            return this._isDirty = !0, n;\n          }, r.prototype.enableBlending = function(t) {\n            t === void 0 && (t = 0.01), this.bones.forEach(function(e) {\n              e.animations.forEach(function(n) {\n                n.enableBlending = !0, n.blendingSpeed = t;\n              });\n            });\n          }, r.prototype.dispose = function() {\n            this._meshesWithPoseMatrix = [], this.getScene().stopAnimation(this), this.getScene().removeSkeleton(this), this._transformMatrixTexture && (this._transformMatrixTexture.dispose(), this._transformMatrixTexture = null);\n          }, r.prototype.serialize = function() {\n            var t, e, n = {};\n            n.name = this.name, n.id = this.id, this.dimensionsAtRest && (n.dimensionsAtRest = this.dimensionsAtRest.asArray()), n.bones = [], n.needInitialSkinMatrix = this.needInitialSkinMatrix, n.overrideMeshId = (t = this.overrideMesh) === null || t === void 0 ? void 0 : t.id;\n            for (var i = 0; i < this.bones.length; i++) {\n              var o = this.bones[i], a = o.getParent(), s = { parentBoneIndex: a ? this.bones.indexOf(a) : -1, index: o.getIndex(), name: o.name, matrix: o.getBaseMatrix().toArray(), rest: o.getRestPose().toArray(), linkedTransformNodeId: (e = o.getTransformNode()) === null || e === void 0 ? void 0 : e.id };\n              for (var d in n.bones.push(s), o.length && (s.length = o.length), o.metadata && (s.metadata = o.metadata), o.animations && o.animations.length > 0 && (s.animation = o.animations[0].serialize()), n.ranges = [], this._ranges) {\n                var p = this._ranges[d];\n                if (p) {\n                  var y = {};\n                  y.name = d, y.from = p.from, y.to = p.to, n.ranges.push(y);\n                }\n              }\n            }\n            return n;\n          }, r.Parse = function(t, e) {\n            var n, i = new r(t.name, t.id, e);\n            for (t.dimensionsAtRest && (i.dimensionsAtRest = u.e.FromArray(t.dimensionsAtRest)), i.needInitialSkinMatrix = t.needInitialSkinMatrix, t.overrideMeshId && (i._hasWaitingData = !0, i._waitingOverrideMeshId = t.overrideMeshId), n = 0; n < t.bones.length; n++) {\n              var o = t.bones[n], a = t.bones[n].index, s = null;\n              o.parentBoneIndex > -1 && (s = i.bones[o.parentBoneIndex]);\n              var d = o.rest ? u.a.FromArray(o.rest) : null, p = new Fe(o.name, i, s, u.a.FromArray(o.matrix), d, null, a);\n              o.id !== void 0 && o.id !== null && (p.id = o.id), o.length && (p.length = o.length), o.metadata && (p.metadata = o.metadata), o.animation && p.animations.push(k.Parse(o.animation)), o.linkedTransformNodeId !== void 0 && o.linkedTransformNodeId !== null && (i._hasWaitingData = !0, p._waitingTransformNodeId = o.linkedTransformNodeId);\n            }\n            if (t.ranges)\n              for (n = 0; n < t.ranges.length; n++) {\n                var y = t.ranges[n];\n                i.createAnimationRange(y.name, y.from, y.to);\n              }\n            return i;\n          }, r.prototype.computeAbsoluteTransforms = function(t) {\n            t === void 0 && (t = !1);\n            var e = this._scene.getRenderId();\n            (this._lastAbsoluteTransformsUpdateId != e || t) && (this.bones[0].computeAbsoluteTransforms(), this._lastAbsoluteTransformsUpdateId = e);\n          }, r.prototype.getPoseMatrix = function() {\n            var t = null;\n            return this._meshesWithPoseMatrix.length > 0 && (t = this._meshesWithPoseMatrix[0].getPoseMatrix()), t;\n          }, r.prototype.sortBones = function() {\n            for (var t = new Array(), e = new Array(this.bones.length), n = 0; n < this.bones.length; n++)\n              this._sortBones(n, t, e);\n            this.bones = t;\n          }, r.prototype._sortBones = function(t, e, n) {\n            if (!n[t]) {\n              n[t] = !0;\n              var i = this.bones[t];\n              i._index === void 0 && (i._index = t);\n              var o = i.getParent();\n              o && this._sortBones(this.bones.indexOf(o), e, n), e.push(i);\n            }\n          }, r.prototype.setCurrentPoseAsRest = function() {\n            this.bones.forEach(function(t) {\n              t.setCurrentPoseAsRest();\n            });\n          }, r;\n        }(), un = {}, zr = function() {\n          function r(t) {\n            this.attachedToElement = !1, this.attached = {}, this.camera = t, this.checkInputs = function() {\n            };\n          }\n          return r.prototype.add = function(t) {\n            var e = t.getSimpleName();\n            this.attached[e] ? l.a.Warn(\"camera input of type \" + e + \" already exists on camera\") : (this.attached[e] = t, t.camera = this.camera, t.checkInputs && (this.checkInputs = this._addCheckInputs(t.checkInputs.bind(t))), this.attachedToElement && t.attachControl());\n          }, r.prototype.remove = function(t) {\n            for (var e in this.attached) {\n              var n = this.attached[e];\n              n === t && (n.detachControl(), n.camera = null, delete this.attached[e], this.rebuildInputCheck());\n            }\n          }, r.prototype.removeByType = function(t) {\n            for (var e in this.attached) {\n              var n = this.attached[e];\n              n.getClassName() === t && (n.detachControl(), n.camera = null, delete this.attached[e], this.rebuildInputCheck());\n            }\n          }, r.prototype._addCheckInputs = function(t) {\n            var e = this.checkInputs;\n            return function() {\n              e(), t();\n            };\n          }, r.prototype.attachInput = function(t) {\n            this.attachedToElement && t.attachControl(this.noPreventDefault);\n          }, r.prototype.attachElement = function(t) {\n            if (t === void 0 && (t = !1), !this.attachedToElement)\n              for (var e in t = !_t.a.ForceAttachControlToAlwaysPreventDefault && t, this.attachedToElement = !0, this.noPreventDefault = t, this.attached)\n                this.attached[e].attachControl(t);\n          }, r.prototype.detachElement = function(t) {\n            for (var e in t === void 0 && (t = !1), this.attached)\n              this.attached[e].detachControl(), t && (this.attached[e].camera = null);\n            this.attachedToElement = !1;\n          }, r.prototype.rebuildInputCheck = function() {\n            for (var t in this.checkInputs = function() {\n            }, this.attached) {\n              var e = this.attached[t];\n              e.checkInputs && (this.checkInputs = this._addCheckInputs(e.checkInputs.bind(e)));\n            }\n          }, r.prototype.clear = function() {\n            this.attachedToElement && this.detachElement(!0), this.attached = {}, this.attachedToElement = !1, this.checkInputs = function() {\n            };\n          }, r.prototype.serialize = function(t) {\n            var e = {};\n            for (var n in this.attached) {\n              var i = this.attached[n], o = L.a.Serialize(i);\n              e[i.getClassName()] = o;\n            }\n            t.inputsmgr = e;\n          }, r.prototype.parse = function(t) {\n            var e = t.inputsmgr;\n            if (e) {\n              for (var n in this.clear(), e)\n                if (a = un[n]) {\n                  var i = e[n], o = L.a.Parse(function() {\n                    return new a();\n                  }, i, null);\n                  this.add(o);\n                }\n            } else\n              for (var n in this.attached) {\n                var a;\n                (a = un[this.attached[n].getClassName()]) && (o = L.a.Parse(function() {\n                  return new a();\n                }, t, null), this.remove(this.attached[n]), this.add(o));\n              }\n          }, r;\n        }(), _f = function(r, t) {\n          this.x = r, this.y = t;\n        }, hn = function() {\n          function r(t, e, n, i, o, a, s) {\n            i === void 0 && (i = 0), o === void 0 && (o = 1), a === void 0 && (a = 2), s === void 0 && (s = 3), this.id = t, this.index = e, this.browserGamepad = n, this._leftStick = { x: 0, y: 0 }, this._rightStick = { x: 0, y: 0 }, this._isConnected = !0, this._invertLeftStickY = !1, this.type = r.GAMEPAD, this._leftStickAxisX = i, this._leftStickAxisY = o, this._rightStickAxisX = a, this._rightStickAxisY = s, this.browserGamepad.axes.length >= 2 && (this._leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }), this.browserGamepad.axes.length >= 4 && (this._rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });\n          }\n          return Object.defineProperty(r.prototype, \"isConnected\", { get: function() {\n            return this._isConnected;\n          }, enumerable: !1, configurable: !0 }), r.prototype.onleftstickchanged = function(t) {\n            this._onleftstickchanged = t;\n          }, r.prototype.onrightstickchanged = function(t) {\n            this._onrightstickchanged = t;\n          }, Object.defineProperty(r.prototype, \"leftStick\", { get: function() {\n            return this._leftStick;\n          }, set: function(t) {\n            !this._onleftstickchanged || this._leftStick.x === t.x && this._leftStick.y === t.y || this._onleftstickchanged(t), this._leftStick = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightStick\", { get: function() {\n            return this._rightStick;\n          }, set: function(t) {\n            !this._onrightstickchanged || this._rightStick.x === t.x && this._rightStick.y === t.y || this._onrightstickchanged(t), this._rightStick = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.update = function() {\n            this._leftStick && (this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] }, this._invertLeftStickY && (this.leftStick.y *= -1)), this._rightStick && (this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] });\n          }, r.prototype.dispose = function() {\n          }, r.GAMEPAD = 0, r.GENERIC = 1, r.XBOX = 2, r.POSE_ENABLED = 3, r.DUALSHOCK = 4, r;\n        }(), nl = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.onButtonDownObservable = new C.c(), o.onButtonUpObservable = new C.c(), o.type = hn.GENERIC, o._buttons = new Array(i.buttons.length), o;\n          }\n          return Object(c.d)(t, r), t.prototype.onbuttondown = function(e) {\n            this._onbuttondown = e;\n          }, t.prototype.onbuttonup = function(e) {\n            this._onbuttonup = e;\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), e === 0 && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e;\n          }, t.prototype.update = function() {\n            r.prototype.update.call(this);\n            for (var e = 0; e < this._buttons.length; e++)\n              this._buttons[e] = this._setButtonValue(this.browserGamepad.buttons[e].value, this._buttons[e], e);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear();\n          }, t;\n        }(hn), Da = function() {\n          function r() {\n            this.gamepadRotationSensibility = 80, this.gamepadMoveSensibility = 40, this._yAxisScale = 1;\n          }\n          return Object.defineProperty(r.prototype, \"invertYAxis\", { get: function() {\n            return this._yAxisScale !== 1;\n          }, set: function(t) {\n            this._yAxisScale = t ? -1 : 1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachControl = function() {\n            var t = this, e = this.camera.getScene().gamepadManager;\n            this._onGamepadConnectedObserver = e.onGamepadConnectedObservable.add(function(n) {\n              n.type !== hn.POSE_ENABLED && (t.gamepad && n.type !== hn.XBOX || (t.gamepad = n));\n            }), this._onGamepadDisconnectedObserver = e.onGamepadDisconnectedObservable.add(function(n) {\n              t.gamepad === n && (t.gamepad = null);\n            }), this.gamepad = e.getGamepadByType(hn.XBOX);\n          }, r.prototype.detachControl = function(t) {\n            this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;\n          }, r.prototype.checkInputs = function() {\n            if (this.gamepad) {\n              var t = this.camera, e = this.gamepad.rightStick;\n              if (e) {\n                if (e.x != 0) {\n                  var n = e.x / this.gamepadRotationSensibility;\n                  n != 0 && Math.abs(n) > 5e-3 && (t.inertialAlphaOffset += n);\n                }\n                if (e.y != 0) {\n                  var i = e.y / this.gamepadRotationSensibility * this._yAxisScale;\n                  i != 0 && Math.abs(i) > 5e-3 && (t.inertialBetaOffset += i);\n                }\n              }\n              var o = this.gamepad.leftStick;\n              if (o && o.y != 0) {\n                var a = o.y / this.gamepadMoveSensibility;\n                a != 0 && Math.abs(a) > 5e-3 && (this.camera.inertialRadiusOffset -= a);\n              }\n            }\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraGamepadInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"gamepad\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"gamepadRotationSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"gamepadMoveSensibility\", void 0), r;\n        }();\n        un.ArcRotateCameraGamepadInput = Da;\n        var ji = f(66), La = function() {\n          function r() {\n            this.keysUp = [38], this.keysDown = [40], this.keysLeft = [37], this.keysRight = [39], this.keysReset = [220], this.panningSensibility = 50, this.zoomingSensibility = 25, this.useAltToZoom = !0, this.angularSpeed = 0.01, this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              o.metaKey || (n.type === ji.a.KEYDOWN ? (e._ctrlPressed = o.ctrlKey, e._altPressed = o.altKey, (e.keysUp.indexOf(o.keyCode) !== -1 || e.keysDown.indexOf(o.keyCode) !== -1 || e.keysLeft.indexOf(o.keyCode) !== -1 || e.keysRight.indexOf(o.keyCode) !== -1 || e.keysReset.indexOf(o.keyCode) !== -1) && ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), o.preventDefault && (t || o.preventDefault()))) : e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 && e.keysReset.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), o.preventDefault && (t || o.preventDefault())));\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.checkInputs = function() {\n            if (this._onKeyboardObserver)\n              for (var t = this.camera, e = 0; e < this._keys.length; e++) {\n                var n = this._keys[e];\n                this.keysLeft.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningX -= 1 / this.panningSensibility : t.inertialAlphaOffset -= this.angularSpeed : this.keysUp.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningY += 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? t.inertialRadiusOffset += 1 / this.zoomingSensibility : t.inertialBetaOffset -= this.angularSpeed : this.keysRight.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningX += 1 / this.panningSensibility : t.inertialAlphaOffset += this.angularSpeed : this.keysDown.indexOf(n) !== -1 ? this._ctrlPressed && this.camera._useCtrlForPanning ? t.inertialPanningY -= 1 / this.panningSensibility : this._altPressed && this.useAltToZoom ? t.inertialRadiusOffset -= 1 / this.zoomingSensibility : t.inertialBetaOffset += this.angularSpeed : this.keysReset.indexOf(n) !== -1 && t.useInputToRestoreState && t.restoreState();\n              }\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraKeyboardMoveInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysUp\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDown\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysLeft\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRight\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysReset\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"panningSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"zoomingSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"useAltToZoom\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"angularSpeed\", void 0), r;\n        }();\n        un.ArcRotateCameraKeyboardMoveInput = La;\n        var Na = function() {\n          function r() {\n            this.wheelPrecision = 3, this.wheelDeltaPercentage = 0;\n          }\n          return r.prototype.computeDeltaFromMouseWheelLegacyEvent = function(t, e) {\n            var n = 0.01 * t * this.wheelDeltaPercentage * e;\n            return t > 0 ? n / (1 + this.wheelDeltaPercentage) : n * (1 + this.wheelDeltaPercentage);\n          }, r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._wheel = function(n, i) {\n              if (n.type === yt.a.POINTERWHEEL) {\n                var o = n.event, a = 0, s = o, d = 0;\n                if (d = s.wheelDelta ? s.wheelDelta : 60 * -(o.deltaY || o.detail), e.wheelDeltaPercentage) {\n                  if ((a = e.computeDeltaFromMouseWheelLegacyEvent(d, e.camera.radius)) > 0) {\n                    for (var p = e.camera.radius, y = e.camera.inertialRadiusOffset + a, P = 0; P < 20 && Math.abs(y) > 1e-3; P++)\n                      p -= y, y *= e.camera.inertia;\n                    p = $.a.Clamp(p, 0, Number.MAX_VALUE), a = e.computeDeltaFromMouseWheelLegacyEvent(d, p);\n                  }\n                } else\n                  a = d / (40 * e.wheelPrecision);\n                a && (e.camera.inertialRadiusOffset += a), o.preventDefault && (t || o.preventDefault());\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, yt.a.POINTERWHEEL);\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null);\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraMouseWheelInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mousewheel\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecision\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelDeltaPercentage\", void 0), r;\n        }();\n        un.ArcRotateCameraMouseWheelInput = Na;\n        var il = function() {\n          function r() {\n            this.buttons = [0, 1, 2];\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments);\n            var n = this.camera.getEngine(), i = n.getInputElement(), o = 0, a = null;\n            this.pointA = null, this.pointB = null, this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0, this._pointerInput = function(d, p) {\n              var y = d.event, P = y.pointerType === \"touch\";\n              if (!n.isInVRExclusivePointerMode && (d.type === yt.a.POINTERMOVE || e.buttons.indexOf(y.button) !== -1)) {\n                var R = y.srcElement || y.target;\n                if (e._altKey = y.altKey, e._ctrlKey = y.ctrlKey, e._metaKey = y.metaKey, e._shiftKey = y.shiftKey, e._buttonsPressed = y.buttons, n.isPointerLock) {\n                  var B = y.movementX || y.mozMovementX || y.webkitMovementX || y.msMovementX || 0, F = y.movementY || y.mozMovementY || y.webkitMovementY || y.msMovementY || 0;\n                  e.onTouch(null, B, F), e.pointA = null, e.pointB = null;\n                } else if (d.type === yt.a.POINTERDOWN && R) {\n                  try {\n                    R.setPointerCapture(y.pointerId);\n                  } catch {\n                  }\n                  e.pointA === null ? e.pointA = { x: y.clientX, y: y.clientY, pointerId: y.pointerId, type: y.pointerType } : e.pointB === null && (e.pointB = { x: y.clientX, y: y.clientY, pointerId: y.pointerId, type: y.pointerType }), e.onButtonDown(y), t || (y.preventDefault(), i && i.focus());\n                } else if (d.type === yt.a.POINTERDOUBLETAP)\n                  e.onDoubleTap(y.pointerType);\n                else if (d.type === yt.a.POINTERUP && R) {\n                  try {\n                    R.releasePointerCapture(y.pointerId);\n                  } catch {\n                  }\n                  P || (e.pointB = null), n._badOS ? e.pointA = e.pointB = null : e.pointB && e.pointA && e.pointA.pointerId == y.pointerId ? (e.pointA = e.pointB, e.pointB = null) : e.pointA && e.pointB && e.pointB.pointerId == y.pointerId ? e.pointB = null : e.pointA = e.pointB = null, (o !== 0 || a) && (e.onMultiTouch(e.pointA, e.pointB, o, 0, a, null), o = 0, a = null), e.onButtonUp(y), t || y.preventDefault();\n                } else if (d.type === yt.a.POINTERMOVE) {\n                  if (t || y.preventDefault(), e.pointA && e.pointB === null)\n                    B = y.clientX - e.pointA.x, F = y.clientY - e.pointA.y, e.onTouch(e.pointA, B, F), e.pointA.x = y.clientX, e.pointA.y = y.clientY;\n                  else if (e.pointA && e.pointB) {\n                    var z = e.pointA.pointerId === y.pointerId ? e.pointA : e.pointB;\n                    z.x = y.clientX, z.y = y.clientY;\n                    var J = e.pointA.x - e.pointB.x, ie = e.pointA.y - e.pointB.y, se = J * J + ie * ie, ce = { x: (e.pointA.x + e.pointB.x) / 2, y: (e.pointA.y + e.pointB.y) / 2, pointerId: y.pointerId, type: d.type };\n                    e.onMultiTouch(e.pointA, e.pointB, o, se, a, ce), a = ce, o = se;\n                  }\n                }\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), this._onLostFocus = function() {\n              e.pointA = e.pointB = null, o = 0, a = null, e.onLostFocus();\n            }, i && i.addEventListener(\"contextmenu\", this.onContextMenu.bind(this), !1);\n            var s = this.camera.getScene().getEngine().getHostWindow();\n            s && Xe.b.RegisterTopRootEvents(s, [{ name: \"blur\", handler: this._onLostFocus }]);\n          }, r.prototype.detachControl = function(t) {\n            if (this._onLostFocus) {\n              var e = this.camera.getScene().getEngine().getHostWindow();\n              e && Xe.b.UnregisterTopRootEvents(e, [{ name: \"blur\", handler: this._onLostFocus }]);\n            }\n            if (this._observer) {\n              if (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this.onContextMenu) {\n                var n = this.camera.getScene().getEngine().getInputElement();\n                n && n.removeEventListener(\"contextmenu\", this.onContextMenu);\n              }\n              this._onLostFocus = null;\n            }\n            this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._buttonsPressed = 0;\n          }, r.prototype.getClassName = function() {\n            return \"BaseCameraPointersInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"pointers\";\n          }, r.prototype.onDoubleTap = function(t) {\n          }, r.prototype.onTouch = function(t, e, n) {\n          }, r.prototype.onMultiTouch = function(t, e, n, i, o, a) {\n          }, r.prototype.onContextMenu = function(t) {\n            t.preventDefault();\n          }, r.prototype.onButtonDown = function(t) {\n          }, r.prototype.onButtonUp = function(t) {\n          }, r.prototype.onLostFocus = function() {\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"buttons\", void 0), r;\n        }(), wa = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e.buttons = [0, 1, 2], e.angularSensibilityX = 1e3, e.angularSensibilityY = 1e3, e.pinchPrecision = 12, e.pinchDeltaPercentage = 0, e.useNaturalPinchZoom = !1, e.panningSensibility = 1e3, e.multiTouchPanning = !0, e.multiTouchPanAndZoom = !0, e.pinchInwards = !0, e._isPanClick = !1, e._twoFingerActivityCount = 0, e._isPinching = !1, e;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ArcRotateCameraPointersInput\";\n          }, t.prototype.onTouch = function(e, n, i) {\n            this.panningSensibility !== 0 && (this._ctrlKey && this.camera._useCtrlForPanning || this._isPanClick) ? (this.camera.inertialPanningX += -n / this.panningSensibility, this.camera.inertialPanningY += i / this.panningSensibility) : (this.camera.inertialAlphaOffset -= n / this.angularSensibilityX, this.camera.inertialBetaOffset -= i / this.angularSensibilityY);\n          }, t.prototype.onDoubleTap = function(e) {\n            this.camera.useInputToRestoreState && this.camera.restoreState();\n          }, t.prototype.onMultiTouch = function(e, n, i, o, a, s) {\n            if (!(i === 0 && a === null || o === 0 && s === null)) {\n              var d = this.pinchInwards ? 1 : -1;\n              if (this.multiTouchPanAndZoom) {\n                if (this.useNaturalPinchZoom ? this.camera.radius = this.camera.radius * Math.sqrt(i) / Math.sqrt(o) : this.pinchDeltaPercentage ? this.camera.inertialRadiusOffset += 1e-3 * (o - i) * this.camera.radius * this.pinchDeltaPercentage : this.camera.inertialRadiusOffset += (o - i) / (this.pinchPrecision * d * (this.angularSensibilityX + this.angularSensibilityY) / 2), this.panningSensibility !== 0 && a && s) {\n                  var p = s.x - a.x, y = s.y - a.y;\n                  this.camera.inertialPanningX += -p / this.panningSensibility, this.camera.inertialPanningY += y / this.panningSensibility;\n                }\n              } else {\n                this._twoFingerActivityCount++;\n                var P = Math.sqrt(i), R = Math.sqrt(o);\n                this._isPinching || this._twoFingerActivityCount < 20 && Math.abs(R - P) > this.camera.pinchToPanMaxDistance ? (this.pinchDeltaPercentage ? this.camera.inertialRadiusOffset += 1e-3 * (o - i) * this.camera.radius * this.pinchDeltaPercentage : this.camera.inertialRadiusOffset += (o - i) / (this.pinchPrecision * d * (this.angularSensibilityX + this.angularSensibilityY) / 2), this._isPinching = !0) : this.panningSensibility !== 0 && this.multiTouchPanning && s && a && (p = s.x - a.x, y = s.y - a.y, this.camera.inertialPanningX += -p / this.panningSensibility, this.camera.inertialPanningY += y / this.panningSensibility);\n              }\n            }\n          }, t.prototype.onButtonDown = function(e) {\n            this._isPanClick = e.button === this.camera._panningMouseButton;\n          }, t.prototype.onButtonUp = function(e) {\n            this._twoFingerActivityCount = 0, this._isPinching = !1;\n          }, t.prototype.onLostFocus = function() {\n            this._isPanClick = !1, this._twoFingerActivityCount = 0, this._isPinching = !1;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"buttons\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityX\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityY\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchPrecision\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchDeltaPercentage\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useNaturalPinchZoom\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"panningSensibility\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"multiTouchPanning\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"multiTouchPanAndZoom\", void 0), t;\n        }(il);\n        un.ArcRotateCameraPointersInput = wa;\n        var Po = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.addMouseWheel = function() {\n            return this.add(new Na()), this;\n          }, t.prototype.addPointers = function() {\n            return this.add(new wa()), this;\n          }, t.prototype.addKeyboard = function() {\n            return this.add(new La()), this;\n          }, t;\n        }(zr);\n        Po.prototype.addVRDeviceOrientation = function() {\n          return this.add(new Fa()), this;\n        };\n        var Fa = function() {\n          function r() {\n            this.alphaCorrection = 1, this.gammaCorrection = 1, this._alpha = 0, this._gamma = 0, this._dirty = !1, this._deviceOrientationHandler = this._onOrientationEvent.bind(this);\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.camera.attachControl(t);\n            var n = this.camera.getScene().getEngine().getHostWindow();\n            n && (typeof DeviceOrientationEvent < \"u\" && typeof DeviceOrientationEvent.requestPermission == \"function\" ? DeviceOrientationEvent.requestPermission().then(function(i) {\n              i === \"granted\" ? n.addEventListener(\"deviceorientation\", e._deviceOrientationHandler) : Xe.b.Warn(\"Permission not granted.\");\n            }).catch(function(i) {\n              Xe.b.Error(i);\n            }) : n.addEventListener(\"deviceorientation\", this._deviceOrientationHandler));\n          }, r.prototype._onOrientationEvent = function(t) {\n            t.alpha !== null && (this._alpha = (0 | +t.alpha) * this.alphaCorrection), t.gamma !== null && (this._gamma = (0 | +t.gamma) * this.gammaCorrection), this._dirty = !0;\n          }, r.prototype.checkInputs = function() {\n            this._dirty && (this._dirty = !1, this._gamma < 0 && (this._gamma = 180 + this._gamma), this.camera.alpha = -this._alpha / 180 * Math.PI % Math.PI * 2, this.camera.beta = this._gamma / 180 * Math.PI);\n          }, r.prototype.detachControl = function(t) {\n            window.removeEventListener(\"deviceorientation\", this._deviceOrientationHandler);\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraVRDeviceOrientationInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"VRDeviceOrientation\";\n          }, r;\n        }();\n        un.ArcRotateCameraVRDeviceOrientationInput = Fa;\n        var Ba = function() {\n          function r() {\n            this.keysForward = [87], this.keysBackward = [83], this.keysUp = [69], this.keysDown = [81], this.keysRight = [68], this.keysLeft = [65], this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              n.type === ji.a.KEYDOWN ? e.keysForward.indexOf(o.keyCode) === -1 && e.keysBackward.indexOf(o.keyCode) === -1 && e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), t || o.preventDefault()) : e.keysForward.indexOf(o.keyCode) === -1 && e.keysBackward.indexOf(o.keyCode) === -1 && e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), t || o.preventDefault());\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.getClassName = function() {\n            return \"FlyCameraKeyboardInput\";\n          }, r.prototype._onLostFocus = function(t) {\n            this._keys = [];\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, r.prototype.checkInputs = function() {\n            if (this._onKeyboardObserver)\n              for (var t = this.camera, e = 0; e < this._keys.length; e++) {\n                var n = this._keys[e], i = t._computeLocalCameraSpeed();\n                this.keysForward.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, i) : this.keysBackward.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, -i) : this.keysUp.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, i, 0) : this.keysDown.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, -i, 0) : this.keysRight.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(i, 0, 0) : this.keysLeft.indexOf(n) !== -1 && t._localDirection.copyFromFloats(-i, 0, 0), t.getScene().useRightHandedSystem && (t._localDirection.z *= -1), t.getViewMatrix().invertToRef(t._cameraTransformMatrix), u.e.TransformNormalToRef(t._localDirection, t._cameraTransformMatrix, t._transformedDirection), t.cameraDirection.addInPlace(t._transformedDirection);\n              }\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysForward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysBackward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysUp\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDown\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRight\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysLeft\", void 0), r;\n        }();\n        un.FlyCameraKeyboardInput = Ba;\n        var Ua = function() {\n          function r(t) {\n            this.buttons = [0, 1, 2], this.buttonsYaw = [-1, 0, 1], this.buttonsPitch = [-1, 0, 1], this.buttonsRoll = [2], this.activeButton = -1, this.angularSensibility = 1e3, this.previousPosition = null;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.noPreventDefault = t, this._observer = this.camera.getScene().onPointerObservable.add(function(n, i) {\n              e._pointerInput(n, i);\n            }, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), this._rollObserver = this.camera.getScene().onBeforeRenderObservable.add(function() {\n              e.camera.rollCorrect && e.camera.restoreRoll(e.camera.rollCorrect);\n            });\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver), this._observer = null, this._rollObserver = null, this.previousPosition = null, this.noPreventDefault = void 0);\n          }, r.prototype.getClassName = function() {\n            return \"FlyCameraMouseInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mouse\";\n          }, r.prototype._pointerInput = function(t, e) {\n            var n = t.event, i = this.camera.getEngine();\n            if (!i.isInVRExclusivePointerMode && (this.touchEnabled || n.pointerType !== \"touch\") && (t.type === yt.a.POINTERMOVE || this.buttons.indexOf(n.button) !== -1)) {\n              var o = n.srcElement || n.target;\n              if (t.type === yt.a.POINTERDOWN && o) {\n                try {\n                  o.setPointerCapture(n.pointerId);\n                } catch {\n                }\n                this.previousPosition = { x: n.clientX, y: n.clientY }, this.activeButton = n.button, this.noPreventDefault || (n.preventDefault(), this.element.focus()), i.isPointerLock && this._onMouseMove(t.event);\n              } else if (t.type === yt.a.POINTERUP && o) {\n                try {\n                  o.releasePointerCapture(n.pointerId);\n                } catch {\n                }\n                this.activeButton = -1, this.previousPosition = null, this.noPreventDefault || n.preventDefault();\n              } else if (t.type === yt.a.POINTERMOVE) {\n                if (!this.previousPosition)\n                  return void (i.isPointerLock && this._onMouseMove(t.event));\n                var a = n.clientX - this.previousPosition.x, s = n.clientY - this.previousPosition.y;\n                this.rotateCamera(a, s), this.previousPosition = { x: n.clientX, y: n.clientY }, this.noPreventDefault || n.preventDefault();\n              }\n            }\n          }, r.prototype._onMouseMove = function(t) {\n            var e = this.camera.getEngine();\n            if (e.isPointerLock && !e.isInVRExclusivePointerMode) {\n              var n = t.movementX || t.mozMovementX || t.webkitMovementX || t.msMovementX || 0, i = t.movementY || t.mozMovementY || t.webkitMovementY || t.msMovementY || 0;\n              this.rotateCamera(n, i), this.previousPosition = null, this.noPreventDefault || t.preventDefault();\n            }\n          }, r.prototype.rotateCamera = function(t, e) {\n            var n = this, i = this.camera;\n            this.camera.getScene().useRightHandedSystem && (t *= -1), i.parent && i.parent._getWorldMatrixDeterminant() < 0 && (t *= -1);\n            var o, a = t / this.angularSensibility, s = e / this.angularSensibility, d = u.b.RotationYawPitchRoll(i.rotation.y, i.rotation.x, i.rotation.z);\n            if (this.buttonsPitch.some(function(P) {\n              return P === n.activeButton;\n            }) && (o = u.b.RotationAxis(be.a.X, s), d.multiplyInPlace(o)), this.buttonsYaw.some(function(P) {\n              return P === n.activeButton;\n            })) {\n              o = u.b.RotationAxis(be.a.Y, a), d.multiplyInPlace(o);\n              var p = i.bankedTurnLimit + i._trackRoll;\n              if (i.bankedTurn && -p < i.rotation.z && i.rotation.z < p) {\n                var y = i.bankedTurnMultiplier * -a;\n                o = u.b.RotationAxis(be.a.Z, y), d.multiplyInPlace(o);\n              }\n            }\n            this.buttonsRoll.some(function(P) {\n              return P === n.activeButton;\n            }) && (o = u.b.RotationAxis(be.a.Z, -a), i._trackRoll -= a, d.multiplyInPlace(o)), d.toEulerAnglesToRef(i.rotation);\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"buttons\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"angularSensibility\", void 0), r;\n        }();\n        un.FlyCameraMouseInput = Ua;\n        var Va = function() {\n          function r() {\n            this.keysHeightOffsetIncr = [38], this.keysHeightOffsetDecr = [40], this.keysHeightOffsetModifierAlt = !1, this.keysHeightOffsetModifierCtrl = !1, this.keysHeightOffsetModifierShift = !1, this.keysRotationOffsetIncr = [37], this.keysRotationOffsetDecr = [39], this.keysRotationOffsetModifierAlt = !1, this.keysRotationOffsetModifierCtrl = !1, this.keysRotationOffsetModifierShift = !1, this.keysRadiusIncr = [40], this.keysRadiusDecr = [38], this.keysRadiusModifierAlt = !0, this.keysRadiusModifierCtrl = !1, this.keysRadiusModifierShift = !1, this.heightSensibility = 1, this.rotationSensibility = 1, this.radiusSensibility = 1, this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              o.metaKey || (n.type === ji.a.KEYDOWN ? (e._ctrlPressed = o.ctrlKey, e._altPressed = o.altKey, e._shiftPressed = o.shiftKey, (e.keysHeightOffsetIncr.indexOf(o.keyCode) !== -1 || e.keysHeightOffsetDecr.indexOf(o.keyCode) !== -1 || e.keysRotationOffsetIncr.indexOf(o.keyCode) !== -1 || e.keysRotationOffsetDecr.indexOf(o.keyCode) !== -1 || e.keysRadiusIncr.indexOf(o.keyCode) !== -1 || e.keysRadiusDecr.indexOf(o.keyCode) !== -1) && ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), o.preventDefault && (t || o.preventDefault()))) : e.keysHeightOffsetIncr.indexOf(o.keyCode) === -1 && e.keysHeightOffsetDecr.indexOf(o.keyCode) === -1 && e.keysRotationOffsetIncr.indexOf(o.keyCode) === -1 && e.keysRotationOffsetDecr.indexOf(o.keyCode) === -1 && e.keysRadiusIncr.indexOf(o.keyCode) === -1 && e.keysRadiusDecr.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), o.preventDefault && (t || o.preventDefault())));\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.checkInputs = function() {\n            var t = this;\n            this._onKeyboardObserver && this._keys.forEach(function(e) {\n              t.keysHeightOffsetIncr.indexOf(e) !== -1 && t._modifierHeightOffset() ? t.camera.heightOffset += t.heightSensibility : t.keysHeightOffsetDecr.indexOf(e) !== -1 && t._modifierHeightOffset() ? t.camera.heightOffset -= t.heightSensibility : t.keysRotationOffsetIncr.indexOf(e) !== -1 && t._modifierRotationOffset() ? (t.camera.rotationOffset += t.rotationSensibility, t.camera.rotationOffset %= 360) : t.keysRotationOffsetDecr.indexOf(e) !== -1 && t._modifierRotationOffset() ? (t.camera.rotationOffset -= t.rotationSensibility, t.camera.rotationOffset %= 360) : t.keysRadiusIncr.indexOf(e) !== -1 && t._modifierRadius() ? t.camera.radius += t.radiusSensibility : t.keysRadiusDecr.indexOf(e) !== -1 && t._modifierRadius() && (t.camera.radius -= t.radiusSensibility);\n            });\n          }, r.prototype.getClassName = function() {\n            return \"FollowCameraKeyboardMoveInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, r.prototype._modifierHeightOffset = function() {\n            return this.keysHeightOffsetModifierAlt === this._altPressed && this.keysHeightOffsetModifierCtrl === this._ctrlPressed && this.keysHeightOffsetModifierShift === this._shiftPressed;\n          }, r.prototype._modifierRotationOffset = function() {\n            return this.keysRotationOffsetModifierAlt === this._altPressed && this.keysRotationOffsetModifierCtrl === this._ctrlPressed && this.keysRotationOffsetModifierShift === this._shiftPressed;\n          }, r.prototype._modifierRadius = function() {\n            return this.keysRadiusModifierAlt === this._altPressed && this.keysRadiusModifierCtrl === this._ctrlPressed && this.keysRadiusModifierShift === this._shiftPressed;\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetIncr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetDecr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetModifierAlt\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetModifierCtrl\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysHeightOffsetModifierShift\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetIncr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetDecr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetModifierAlt\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetModifierCtrl\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRotationOffsetModifierShift\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusIncr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusDecr\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusModifierAlt\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusModifierCtrl\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRadiusModifierShift\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"heightSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"rotationSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"radiusSensibility\", void 0), r;\n        }();\n        un.FollowCameraKeyboardMoveInput = Va;\n        var ka = function() {\n          function r() {\n            this.axisControlRadius = !0, this.axisControlHeight = !1, this.axisControlRotation = !1, this.wheelPrecision = 3, this.wheelDeltaPercentage = 0;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._wheel = function(n, i) {\n              if (n.type === yt.a.POINTERWHEEL) {\n                var o = n.event, a = 0, s = Math.max(-1, Math.min(1, o.deltaY || o.wheelDelta || -o.detail));\n                e.wheelDeltaPercentage ? (console.assert(e.axisControlRadius + e.axisControlHeight + e.axisControlRotation <= 1, \"wheelDeltaPercentage only usable when mouse wheel controlls ONE axis. Currently enabled: axisControlRadius: \" + e.axisControlRadius + \", axisControlHeightOffset: \" + e.axisControlHeight + \", axisControlRotationOffset: \" + e.axisControlRotation), e.axisControlRadius ? a = 0.01 * s * e.wheelDeltaPercentage * e.camera.radius : e.axisControlHeight ? a = 0.01 * s * e.wheelDeltaPercentage * e.camera.heightOffset : e.axisControlRotation && (a = 0.01 * s * e.wheelDeltaPercentage * e.camera.rotationOffset)) : a = s * e.wheelPrecision, a && (e.axisControlRadius ? e.camera.radius += a : e.axisControlHeight ? e.camera.heightOffset -= a : e.axisControlRotation && (e.camera.rotationOffset -= a)), o.preventDefault && (t || o.preventDefault());\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, yt.a.POINTERWHEEL);\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null);\n          }, r.prototype.getClassName = function() {\n            return \"ArcRotateCameraMouseWheelInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mousewheel\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"axisControlRadius\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"axisControlHeight\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"axisControlRotation\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecision\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelDeltaPercentage\", void 0), r;\n        }();\n        un.FollowCameraMouseWheelInput = ka;\n        var Ga = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e.angularSensibilityX = 1, e.angularSensibilityY = 1, e.pinchPrecision = 1e4, e.pinchDeltaPercentage = 0, e.axisXControlRadius = !1, e.axisXControlHeight = !1, e.axisXControlRotation = !0, e.axisYControlRadius = !1, e.axisYControlHeight = !0, e.axisYControlRotation = !1, e.axisPinchControlRadius = !0, e.axisPinchControlHeight = !1, e.axisPinchControlRotation = !1, e.warningEnable = !0, e._warningCounter = 0, e;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FollowCameraPointersInput\";\n          }, t.prototype.onTouch = function(e, n, i) {\n            this._warning(), this.axisXControlRotation ? this.camera.rotationOffset += n / this.angularSensibilityX : this.axisYControlRotation && (this.camera.rotationOffset += i / this.angularSensibilityX), this.axisXControlHeight ? this.camera.heightOffset += n / this.angularSensibilityY : this.axisYControlHeight && (this.camera.heightOffset += i / this.angularSensibilityY), this.axisXControlRadius ? this.camera.radius -= n / this.angularSensibilityY : this.axisYControlRadius && (this.camera.radius -= i / this.angularSensibilityY);\n          }, t.prototype.onMultiTouch = function(e, n, i, o, a, s) {\n            if (!(i === 0 && a === null || o === 0 && s === null)) {\n              var d = (o - i) / (this.pinchPrecision * (this.angularSensibilityX + this.angularSensibilityY) / 2);\n              this.pinchDeltaPercentage ? (d *= 0.01 * this.pinchDeltaPercentage, this.axisPinchControlRotation && (this.camera.rotationOffset += d * this.camera.rotationOffset), this.axisPinchControlHeight && (this.camera.heightOffset += d * this.camera.heightOffset), this.axisPinchControlRadius && (this.camera.radius -= d * this.camera.radius)) : (this.axisPinchControlRotation && (this.camera.rotationOffset += d), this.axisPinchControlHeight && (this.camera.heightOffset += d), this.axisPinchControlRadius && (this.camera.radius -= d));\n            }\n          }, t.prototype._warning = function() {\n            if (this.warningEnable && this._warningCounter++ % 100 == 0) {\n              var e = \"It probably only makes sense to control ONE camera property with each pointer axis. Set 'warningEnable = false' if you are sure. Currently enabled: \";\n              console.assert(this.axisXControlRotation + this.axisXControlHeight + this.axisXControlRadius <= 1, e + \"axisXControlRotation: \" + this.axisXControlRotation + \", axisXControlHeight: \" + this.axisXControlHeight + \", axisXControlRadius: \" + this.axisXControlRadius), console.assert(this.axisYControlRotation + this.axisYControlHeight + this.axisYControlRadius <= 1, e + \"axisYControlRotation: \" + this.axisYControlRotation + \", axisYControlHeight: \" + this.axisYControlHeight + \", axisYControlRadius: \" + this.axisYControlRadius), console.assert(this.axisPinchControlRotation + this.axisPinchControlHeight + this.axisPinchControlRadius <= 1, e + \"axisPinchControlRotation: \" + this.axisPinchControlRotation + \", axisPinchControlHeight: \" + this.axisPinchControlHeight + \", axisPinchControlRadius: \" + this.axisPinchControlRadius);\n            }\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityX\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"angularSensibilityY\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchPrecision\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchDeltaPercentage\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisXControlRadius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisXControlHeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisXControlRotation\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisYControlRadius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisYControlHeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisYControlRotation\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisPinchControlRadius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisPinchControlHeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"axisPinchControlRotation\", void 0), t;\n        }(il);\n        un.FollowCameraPointersInput = Ga;\n        var za = function() {\n          function r() {\n            this.keysUp = [38], this.keysUpward = [33], this.keysDown = [40], this.keysDownward = [34], this.keysLeft = [37], this.keysRight = [39], this._keys = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._onCanvasBlurObserver || (this._scene = this.camera.getScene(), this._engine = this._scene.getEngine(), this._onCanvasBlurObserver = this._engine.onCanvasBlurObservable.add(function() {\n              e._keys = [];\n            }), this._onKeyboardObserver = this._scene.onKeyboardObservable.add(function(n) {\n              var i, o = n.event;\n              o.metaKey || (n.type === ji.a.KEYDOWN ? e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 && e.keysUpward.indexOf(o.keyCode) === -1 && e.keysDownward.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) === -1 && e._keys.push(o.keyCode), t || o.preventDefault()) : e.keysUp.indexOf(o.keyCode) === -1 && e.keysDown.indexOf(o.keyCode) === -1 && e.keysLeft.indexOf(o.keyCode) === -1 && e.keysRight.indexOf(o.keyCode) === -1 && e.keysUpward.indexOf(o.keyCode) === -1 && e.keysDownward.indexOf(o.keyCode) === -1 || ((i = e._keys.indexOf(o.keyCode)) >= 0 && e._keys.splice(i, 1), t || o.preventDefault()));\n            }));\n          }, r.prototype.detachControl = function(t) {\n            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 = [];\n          }, r.prototype.checkInputs = function() {\n            if (this._onKeyboardObserver)\n              for (var t = this.camera, e = 0; e < this._keys.length; e++) {\n                var n = this._keys[e], i = t._computeLocalCameraSpeed();\n                this.keysLeft.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(-i, 0, 0) : this.keysUp.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, i) : this.keysRight.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(i, 0, 0) : this.keysDown.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, 0, -i) : this.keysUpward.indexOf(n) !== -1 ? t._localDirection.copyFromFloats(0, i, 0) : this.keysDownward.indexOf(n) !== -1 && t._localDirection.copyFromFloats(0, -i, 0), t.getScene().useRightHandedSystem && (t._localDirection.z *= -1), t.getViewMatrix().invertToRef(t._cameraTransformMatrix), u.e.TransformNormalToRef(t._localDirection, t._cameraTransformMatrix, t._transformedDirection), t.cameraDirection.addInPlace(t._transformedDirection);\n              }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraKeyboardMoveInput\";\n          }, r.prototype._onLostFocus = function() {\n            this._keys = [];\n          }, r.prototype.getSimpleName = function() {\n            return \"keyboard\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"keysUp\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysUpward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDown\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysDownward\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysLeft\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"keysRight\", void 0), r;\n        }();\n        un.FreeCameraKeyboardMoveInput = za;\n        var ja = function() {\n          function r(t) {\n            t === void 0 && (t = !0), this.touchEnabled = t, this.buttons = [0, 1, 2], this.angularSensibility = 2e3, this.previousPosition = null, this.onPointerMovedObservable = new C.c(), this._allowCameraRotation = !0;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments);\n            var n = this.camera.getEngine(), i = n.getInputElement();\n            this._pointerInput || (this._pointerInput = function(o) {\n              var a = o.event;\n              if (!n.isInVRExclusivePointerMode && (e.touchEnabled || a.pointerType !== \"touch\") && (o.type === yt.a.POINTERMOVE || e.buttons.indexOf(a.button) !== -1)) {\n                var s = a.srcElement || a.target;\n                if (o.type === yt.a.POINTERDOWN && s) {\n                  try {\n                    s.setPointerCapture(a.pointerId);\n                  } catch {\n                  }\n                  e.previousPosition = { x: a.clientX, y: a.clientY }, t || (a.preventDefault(), i && i.focus()), n.isPointerLock && e._onMouseMove && e._onMouseMove(o.event);\n                } else if (o.type === yt.a.POINTERUP && s) {\n                  try {\n                    s.releasePointerCapture(a.pointerId);\n                  } catch {\n                  }\n                  e.previousPosition = null, t || a.preventDefault();\n                } else if (o.type === yt.a.POINTERMOVE) {\n                  if (!e.previousPosition)\n                    return void (n.isPointerLock && e._onMouseMove && e._onMouseMove(o.event));\n                  var d = a.clientX - e.previousPosition.x, p = a.clientY - e.previousPosition.y;\n                  e.camera.getScene().useRightHandedSystem && (d *= -1), e.camera.parent && e.camera.parent._getWorldMatrixDeterminant() < 0 && (d *= -1), e._allowCameraRotation && (e.camera.cameraRotation.y += d / e.angularSensibility, e.camera.cameraRotation.x += p / e.angularSensibility), e.onPointerMovedObservable.notifyObservers({ offsetX: d, offsetY: p }), e.previousPosition = { x: a.clientX, y: a.clientY }, t || a.preventDefault();\n                }\n              }\n            }), this._onMouseMove = function(o) {\n              if (n.isPointerLock && !n.isInVRExclusivePointerMode) {\n                var a = o.movementX || o.mozMovementX || o.webkitMovementX || o.msMovementX || 0;\n                e.camera.getScene().useRightHandedSystem && (a *= -1), e.camera.parent && e.camera.parent._getWorldMatrixDeterminant() < 0 && (a *= -1), e.camera.cameraRotation.y += a / e.angularSensibility;\n                var s = o.movementY || o.mozMovementY || o.webkitMovementY || o.msMovementY || 0;\n                e.camera.cameraRotation.x += s / e.angularSensibility, e.previousPosition = null, t || o.preventDefault();\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), i && i.addEventListener(\"contextmenu\", this.onContextMenu.bind(this), !1);\n          }, r.prototype.onContextMenu = function(t) {\n            t.preventDefault();\n          }, r.prototype.detachControl = function(t) {\n            if (this._observer) {\n              if (this.camera.getScene().onPointerObservable.remove(this._observer), this.onContextMenu) {\n                var e = this.camera.getEngine().getInputElement();\n                e && e.removeEventListener(\"contextmenu\", this.onContextMenu);\n              }\n              this.onPointerMovedObservable && this.onPointerMovedObservable.clear(), this._observer = null, this._onMouseMove = null, this.previousPosition = null;\n            }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraMouseInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mouse\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"buttons\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"angularSensibility\", void 0), r;\n        }();\n        un.FreeCameraMouseInput = ja;\n        var Ut, mf = function() {\n          function r() {\n            this.wheelPrecisionX = 3, this.wheelPrecisionY = 3, this.wheelPrecisionZ = 3, this.onChangedObservable = new C.c(), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0, this._ffMultiplier = 12, this._normalize = 120;\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._wheel = function(n) {\n              if (n.type === yt.a.POINTERWHEEL) {\n                var i = n.event, o = i.deltaMode === WheelEvent.DOM_DELTA_LINE ? e._ffMultiplier : 1;\n                i.deltaY !== void 0 ? (e._wheelDeltaX += e.wheelPrecisionX * o * i.deltaX / e._normalize, e._wheelDeltaY -= e.wheelPrecisionY * o * i.deltaY / e._normalize, e._wheelDeltaZ += e.wheelPrecisionZ * o * i.deltaZ / e._normalize) : i.wheelDeltaY !== void 0 ? (e._wheelDeltaX += e.wheelPrecisionX * o * i.wheelDeltaX / e._normalize, e._wheelDeltaY -= e.wheelPrecisionY * o * i.wheelDeltaY / e._normalize, e._wheelDeltaZ += e.wheelPrecisionZ * o * i.wheelDeltaZ / e._normalize) : i.wheelDelta && (e._wheelDeltaY -= e.wheelPrecisionY * i.wheelDelta / e._normalize), i.preventDefault && (t || i.preventDefault());\n              }\n            }, this._observer = this.camera.getScene().onPointerObservable.add(this._wheel, yt.a.POINTERWHEEL);\n          }, r.prototype.detachControl = function(t) {\n            this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null, this._wheel = null), this.onChangedObservable && this.onChangedObservable.clear();\n          }, r.prototype.checkInputs = function() {\n            this.onChangedObservable.notifyObservers({ wheelDeltaX: this._wheelDeltaX, wheelDeltaY: this._wheelDeltaY, wheelDeltaZ: this._wheelDeltaZ }), this._wheelDeltaX = 0, this._wheelDeltaY = 0, this._wheelDeltaZ = 0;\n          }, r.prototype.getClassName = function() {\n            return \"BaseCameraMouseWheelInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"mousewheel\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecisionX\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecisionY\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"wheelPrecisionZ\", void 0), r;\n        }();\n        (function(r) {\n          r[r.MoveRelative = 0] = \"MoveRelative\", r[r.RotateRelative = 1] = \"RotateRelative\", r[r.MoveScene = 2] = \"MoveScene\";\n        })(Ut || (Ut = {}));\n        var Ha = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e._moveRelative = u.e.Zero(), e._rotateRelative = u.e.Zero(), e._moveScene = u.e.Zero(), e._wheelXAction = Ut.MoveRelative, e._wheelXActionCoordinate = be.b.X, e._wheelYAction = Ut.MoveRelative, e._wheelYActionCoordinate = be.b.Z, e._wheelZAction = null, e._wheelZActionCoordinate = null, e;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FreeCameraMouseWheelInput\";\n          }, Object.defineProperty(t.prototype, \"wheelXMoveRelative\", { get: function() {\n            return this._wheelXAction !== Ut.MoveRelative ? null : this._wheelXActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelXAction !== Ut.MoveRelative || (this._wheelXAction = Ut.MoveRelative, this._wheelXActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelYMoveRelative\", { get: function() {\n            return this._wheelYAction !== Ut.MoveRelative ? null : this._wheelYActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelYAction !== Ut.MoveRelative || (this._wheelYAction = Ut.MoveRelative, this._wheelYActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelZMoveRelative\", { get: function() {\n            return this._wheelZAction !== Ut.MoveRelative ? null : this._wheelZActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelZAction !== Ut.MoveRelative || (this._wheelZAction = Ut.MoveRelative, this._wheelZActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelXRotateRelative\", { get: function() {\n            return this._wheelXAction !== Ut.RotateRelative ? null : this._wheelXActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelXAction !== Ut.RotateRelative || (this._wheelXAction = Ut.RotateRelative, this._wheelXActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelYRotateRelative\", { get: function() {\n            return this._wheelYAction !== Ut.RotateRelative ? null : this._wheelYActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelYAction !== Ut.RotateRelative || (this._wheelYAction = Ut.RotateRelative, this._wheelYActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelZRotateRelative\", { get: function() {\n            return this._wheelZAction !== Ut.RotateRelative ? null : this._wheelZActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelZAction !== Ut.RotateRelative || (this._wheelZAction = Ut.RotateRelative, this._wheelZActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelXMoveScene\", { get: function() {\n            return this._wheelXAction !== Ut.MoveScene ? null : this._wheelXActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelXAction !== Ut.MoveScene || (this._wheelXAction = Ut.MoveScene, this._wheelXActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelYMoveScene\", { get: function() {\n            return this._wheelYAction !== Ut.MoveScene ? null : this._wheelYActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelYAction !== Ut.MoveScene || (this._wheelYAction = Ut.MoveScene, this._wheelYActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelZMoveScene\", { get: function() {\n            return this._wheelZAction !== Ut.MoveScene ? null : this._wheelZActionCoordinate;\n          }, set: function(e) {\n            e === null && this._wheelZAction !== Ut.MoveScene || (this._wheelZAction = Ut.MoveScene, this._wheelZActionCoordinate = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.checkInputs = function() {\n            if (this._wheelDeltaX !== 0 || this._wheelDeltaY !== 0 || this._wheelDeltaZ != 0) {\n              this._moveRelative.setAll(0), this._rotateRelative.setAll(0), this._moveScene.setAll(0), this._updateCamera(), this.camera.getScene().useRightHandedSystem && (this._moveRelative.z *= -1);\n              var e = u.a.Zero();\n              this.camera.getViewMatrix().invertToRef(e);\n              var n = u.e.Zero();\n              u.e.TransformNormalToRef(this._moveRelative, e, n), this.camera.cameraRotation.x += this._rotateRelative.x / 200, this.camera.cameraRotation.y += this._rotateRelative.y / 200, this.camera.cameraDirection.addInPlace(n), this.camera.cameraDirection.addInPlace(this._moveScene), r.prototype.checkInputs.call(this);\n            }\n          }, t.prototype._updateCamera = function() {\n            var e = this._moveRelative, n = this._rotateRelative, i = this._moveScene, o = function(a, s, d) {\n              if (a !== 0 && s !== null && d !== null) {\n                var p = null;\n                switch (s) {\n                  case Ut.MoveRelative:\n                    p = e;\n                    break;\n                  case Ut.RotateRelative:\n                    p = n;\n                    break;\n                  case Ut.MoveScene:\n                    p = i;\n                }\n                switch (d) {\n                  case be.b.X:\n                    p.set(a, 0, 0);\n                    break;\n                  case be.b.Y:\n                    p.set(0, a, 0);\n                    break;\n                  case be.b.Z:\n                    p.set(0, 0, a);\n                }\n              }\n            };\n            o(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate), o(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate), o(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"wheelXMoveRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelYMoveRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelZMoveRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelXRotateRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelYRotateRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelZRotateRelative\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelXMoveScene\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelYMoveScene\", null), Object(c.c)([Object(L.c)()], t.prototype, \"wheelZMoveScene\", null), t;\n        }(mf);\n        un.FreeCameraMouseWheelInput = Ha;\n        var Wa = function() {\n          function r(t) {\n            t === void 0 && (t = !1), this.allowMouse = t, this.touchAngularSensibility = 2e5, this.touchMoveSensibility = 250, this._offsetX = null, this._offsetY = null, this._pointerPressed = new Array();\n          }\n          return r.prototype.attachControl = function(t) {\n            var e = this;\n            t = Xe.b.BackCompatCameraNoPreventDefault(arguments);\n            var n = null;\n            if (this._pointerInput === void 0 && (this._onLostFocus = function() {\n              e._offsetX = null, e._offsetY = null;\n            }, this._pointerInput = function(a) {\n              var s = a.event, d = !e.camera.getEngine().hostInformation.isMobile && s instanceof MouseEvent;\n              if (e.allowMouse || s.pointerType !== \"mouse\" && !d) {\n                if (a.type === yt.a.POINTERDOWN) {\n                  if (t || s.preventDefault(), e._pointerPressed.push(s.pointerId), e._pointerPressed.length !== 1)\n                    return;\n                  n = { x: s.clientX, y: s.clientY };\n                } else if (a.type === yt.a.POINTERUP) {\n                  if (t || s.preventDefault(), (p = e._pointerPressed.indexOf(s.pointerId)) === -1 || (e._pointerPressed.splice(p, 1), p != 0))\n                    return;\n                  n = null, e._offsetX = null, e._offsetY = null;\n                } else if (a.type === yt.a.POINTERMOVE) {\n                  if (t || s.preventDefault(), !n)\n                    return;\n                  var p;\n                  if ((p = e._pointerPressed.indexOf(s.pointerId)) != 0)\n                    return;\n                  e._offsetX = s.clientX - n.x, e._offsetY = -(s.clientY - n.y);\n                }\n              }\n            }), this._observer = this.camera.getScene().onPointerObservable.add(this._pointerInput, yt.a.POINTERDOWN | yt.a.POINTERUP | yt.a.POINTERMOVE), this._onLostFocus) {\n              var i = this.camera.getEngine(), o = i.getInputElement();\n              o && o.addEventListener(\"blur\", this._onLostFocus);\n            }\n          }, r.prototype.detachControl = function(t) {\n            if (this._pointerInput) {\n              if (this._observer && (this.camera.getScene().onPointerObservable.remove(this._observer), this._observer = null), this._onLostFocus) {\n                var e = this.camera.getEngine().getInputElement();\n                e && e.removeEventListener(\"blur\", this._onLostFocus), this._onLostFocus = null;\n              }\n              this._pointerPressed = [], this._offsetX = null, this._offsetY = null;\n            }\n          }, r.prototype.checkInputs = function() {\n            if (this._offsetX !== null && this._offsetY !== null && (this._offsetX !== 0 || this._offsetY !== 0)) {\n              var t = this.camera;\n              if (t.cameraRotation.y = this._offsetX / this.touchAngularSensibility, this._pointerPressed.length > 1)\n                t.cameraRotation.x = -this._offsetY / this.touchAngularSensibility;\n              else {\n                var e = t._computeLocalCameraSpeed(), n = new u.e(0, 0, e * this._offsetY / this.touchMoveSensibility);\n                u.a.RotationYawPitchRollToRef(t.rotation.y, t.rotation.x, 0, t._cameraRotationMatrix), t.cameraDirection.addInPlace(u.e.TransformCoordinates(n, t._cameraRotationMatrix));\n              }\n            }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraTouchInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"touch\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"touchAngularSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"touchMoveSensibility\", void 0), r;\n        }();\n        un.FreeCameraTouchInput = Wa;\n        var jr = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._mouseInput = null, n._mouseWheelInput = null, n;\n          }\n          return Object(c.d)(t, r), t.prototype.addKeyboard = function() {\n            return this.add(new za()), this;\n          }, t.prototype.addMouse = function(e) {\n            return e === void 0 && (e = !0), this._mouseInput || (this._mouseInput = new ja(e), this.add(this._mouseInput)), this;\n          }, t.prototype.removeMouse = function() {\n            return this._mouseInput && this.remove(this._mouseInput), this;\n          }, t.prototype.addMouseWheel = function() {\n            return this._mouseWheelInput || (this._mouseWheelInput = new Ha(), this.add(this._mouseWheelInput)), this;\n          }, t.prototype.removeMouseWheel = function() {\n            return this._mouseWheelInput && this.remove(this._mouseWheelInput), this;\n          }, t.prototype.addTouch = function() {\n            return this.add(new Wa()), this;\n          }, t.prototype.clear = function() {\n            r.prototype.clear.call(this), this._mouseInput = null;\n          }, t;\n        }(zr);\n        jr.prototype.addDeviceOrientation = function() {\n          return this._deviceOrientationInput || (this._deviceOrientationInput = new Xa(), this.add(this._deviceOrientationInput)), this;\n        };\n        var Xa = function() {\n          function r() {\n            var t = this;\n            this._screenOrientationAngle = 0, this._screenQuaternion = new u.b(), this._alpha = 0, this._beta = 0, this._gamma = 0, this._onDeviceOrientationChangedObservable = new C.c(), this._orientationChanged = function() {\n              t._screenOrientationAngle = window.orientation !== void 0 ? +window.orientation : window.screen.orientation && window.screen.orientation.angle ? window.screen.orientation.angle : 0, t._screenOrientationAngle = -Xe.b.ToRadians(t._screenOrientationAngle / 2), t._screenQuaternion.copyFromFloats(0, Math.sin(t._screenOrientationAngle), 0, Math.cos(t._screenOrientationAngle));\n            }, this._deviceOrientation = function(e) {\n              t._alpha = e.alpha !== null ? e.alpha : 0, t._beta = e.beta !== null ? e.beta : 0, t._gamma = e.gamma !== null ? e.gamma : 0, e.alpha !== null && t._onDeviceOrientationChangedObservable.notifyObservers();\n            }, this._constantTranform = new u.b(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)), this._orientationChanged();\n          }\n          return r.WaitForOrientationChangeAsync = function(t) {\n            return new Promise(function(e, n) {\n              var i = !1, o = function() {\n                window.removeEventListener(\"deviceorientation\", o), i = !0, e();\n              };\n              t && setTimeout(function() {\n                i || (window.removeEventListener(\"deviceorientation\", o), n(\"WaitForOrientationChangeAsync timed out\"));\n              }, t), typeof DeviceOrientationEvent < \"u\" && typeof DeviceOrientationEvent.requestPermission == \"function\" ? DeviceOrientationEvent.requestPermission().then(function(a) {\n                a == \"granted\" ? window.addEventListener(\"deviceorientation\", o) : Xe.b.Warn(\"Permission not granted.\");\n              }).catch(function(a) {\n                Xe.b.Error(a);\n              }) : window.addEventListener(\"deviceorientation\", o);\n            });\n          }, Object.defineProperty(r.prototype, \"camera\", { get: function() {\n            return this._camera;\n          }, set: function(t) {\n            var e = this;\n            this._camera = t, this._camera == null || this._camera.rotationQuaternion || (this._camera.rotationQuaternion = new u.b()), this._camera && this._camera.onDisposeObservable.add(function() {\n              e._onDeviceOrientationChangedObservable.clear();\n            });\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachControl = function() {\n            var t = this, e = this.camera.getScene().getEngine().getHostWindow();\n            if (e) {\n              var n = function() {\n                e.addEventListener(\"orientationchange\", t._orientationChanged), e.addEventListener(\"deviceorientation\", t._deviceOrientation), t._orientationChanged();\n              };\n              typeof DeviceOrientationEvent < \"u\" && typeof DeviceOrientationEvent.requestPermission == \"function\" ? DeviceOrientationEvent.requestPermission().then(function(i) {\n                i === \"granted\" ? n() : Xe.b.Warn(\"Permission not granted.\");\n              }).catch(function(i) {\n                Xe.b.Error(i);\n              }) : n();\n            }\n          }, r.prototype.detachControl = function(t) {\n            window.removeEventListener(\"orientationchange\", this._orientationChanged), window.removeEventListener(\"deviceorientation\", this._deviceOrientation), this._alpha = 0;\n          }, r.prototype.checkInputs = function() {\n            this._alpha && (u.b.RotationYawPitchRollToRef(Xe.b.ToRadians(this._alpha), Xe.b.ToRadians(this._beta), -Xe.b.ToRadians(this._gamma), this.camera.rotationQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._screenQuaternion), this._camera.rotationQuaternion.multiplyInPlace(this._constantTranform), this._camera.rotationQuaternion.z *= -1, this._camera.rotationQuaternion.w *= -1);\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraDeviceOrientationInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"deviceOrientation\";\n          }, r;\n        }();\n        un.FreeCameraDeviceOrientationInput = Xa;\n        var Ya = function() {\n          function r() {\n            this.gamepadAngularSensibility = 200, this.gamepadMoveSensibility = 40, this._yAxisScale = 1, this._cameraTransform = u.a.Identity(), this._deltaTransform = u.e.Zero(), this._vector3 = u.e.Zero(), this._vector2 = u.d.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"invertYAxis\", { get: function() {\n            return this._yAxisScale !== 1;\n          }, set: function(t) {\n            this._yAxisScale = t ? -1 : 1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachControl = function() {\n            var t = this, e = this.camera.getScene().gamepadManager;\n            this._onGamepadConnectedObserver = e.onGamepadConnectedObservable.add(function(n) {\n              n.type !== hn.POSE_ENABLED && (t.gamepad && n.type !== hn.XBOX || (t.gamepad = n));\n            }), this._onGamepadDisconnectedObserver = e.onGamepadDisconnectedObservable.add(function(n) {\n              t.gamepad === n && (t.gamepad = null);\n            }), this.gamepad = e.getGamepadByType(hn.XBOX), !this.gamepad && e.gamepads.length && (this.gamepad = e.gamepads[0]);\n          }, r.prototype.detachControl = function(t) {\n            this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), this.gamepad = null;\n          }, r.prototype.checkInputs = function() {\n            if (this.gamepad && this.gamepad.leftStick) {\n              var t = this.camera, e = this.gamepad.leftStick, n = e.x / this.gamepadMoveSensibility, i = e.y / this.gamepadMoveSensibility;\n              e.x = Math.abs(n) > 5e-3 ? 0 + n : 0, e.y = Math.abs(i) > 5e-3 ? 0 + i : 0;\n              var o = this.gamepad.rightStick;\n              if (o) {\n                var a = o.x / this.gamepadAngularSensibility, s = o.y / this.gamepadAngularSensibility * this._yAxisScale;\n                o.x = Math.abs(a) > 1e-3 ? 0 + a : 0, o.y = Math.abs(s) > 1e-3 ? 0 + s : 0;\n              } else\n                o = { x: 0, y: 0 };\n              t.rotationQuaternion ? t.rotationQuaternion.toRotationMatrix(this._cameraTransform) : u.a.RotationYawPitchRollToRef(t.rotation.y, t.rotation.x, 0, this._cameraTransform);\n              var d = 50 * t._computeLocalCameraSpeed();\n              this._vector3.copyFromFloats(e.x * d, 0, -e.y * d), u.e.TransformCoordinatesToRef(this._vector3, this._cameraTransform, this._deltaTransform), t.cameraDirection.addInPlace(this._deltaTransform), this._vector2.copyFromFloats(o.y, o.x), t.cameraRotation.addInPlace(this._vector2);\n            }\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraGamepadInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"gamepad\";\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"gamepadAngularSensibility\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"gamepadMoveSensibility\", void 0), r;\n        }();\n        un.FreeCameraGamepadInput = Ya;\n        var rn, rl = f(112);\n        (function(r) {\n          r[r.X = 0] = \"X\", r[r.Y = 1] = \"Y\", r[r.Z = 2] = \"Z\";\n        })(rn || (rn = {}));\n        var Ka = function() {\n          function r(t, e) {\n            var n = this, i = Object(c.a)(Object(c.a)({}, r._GetDefaultOptions()), e);\n            if (this._leftJoystick = !!t, r._globalJoystickIndex++, this._axisTargetedByLeftAndRight = rn.X, this._axisTargetedByUpAndDown = rn.Y, this.reverseLeftRight = !1, this.reverseUpDown = !1, this._touches = new rl.a(), this.deltaPosition = u.e.Zero(), this._joystickSensibility = 25, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3), this._onResize = function(a) {\n              r.vjCanvasWidth = window.innerWidth, r.vjCanvasHeight = window.innerHeight, r.Canvas && (r.Canvas.width = r.vjCanvasWidth, r.Canvas.height = r.vjCanvasHeight), r.halfWidth = r.vjCanvasWidth / 2;\n            }, !r.Canvas) {\n              window.addEventListener(\"resize\", this._onResize, !1), r.Canvas = document.createElement(\"canvas\"), r.vjCanvasWidth = window.innerWidth, r.vjCanvasHeight = window.innerHeight, r.Canvas.width = window.innerWidth, r.Canvas.height = window.innerHeight, r.Canvas.style.width = \"100%\", r.Canvas.style.height = \"100%\", r.Canvas.style.position = \"absolute\", r.Canvas.style.backgroundColor = \"transparent\", r.Canvas.style.top = \"0px\", r.Canvas.style.left = \"0px\", r.Canvas.style.zIndex = \"5\", r.Canvas.style.msTouchAction = \"none\", r.Canvas.style.touchAction = \"none\", r.Canvas.setAttribute(\"touch-action\", \"none\");\n              var o = r.Canvas.getContext(\"2d\");\n              if (!o)\n                throw new Error(\"Unable to create canvas for virtual joystick\");\n              r.vjCanvasContext = o, r.vjCanvasContext.strokeStyle = \"#ffffff\", r.vjCanvasContext.lineWidth = 2, document.body.appendChild(r.Canvas);\n            }\n            r.halfWidth = r.Canvas.width / 2, this.pressed = !1, this.limitToContainer = i.limitToContainer, this._joystickColor = i.color, this.containerSize = i.containerSize, this.puckSize = i.puckSize, i.position && this.setPosition(i.position.x, i.position.y), i.puckImage && this.setPuckImage(i.puckImage), i.containerImage && this.setContainerImage(i.containerImage), i.alwaysVisible && r._alwaysVisibleSticks++, this.alwaysVisible = i.alwaysVisible, this._joystickPointerID = -1, this._joystickPointerPos = new u.d(0, 0), this._joystickPreviousPointerPos = new u.d(0, 0), this._joystickPointerStartPos = new u.d(0, 0), this._deltaJoystickVector = new u.d(0, 0), this._onPointerDownHandlerRef = function(a) {\n              n._onPointerDown(a);\n            }, this._onPointerMoveHandlerRef = function(a) {\n              n._onPointerMove(a);\n            }, this._onPointerUpHandlerRef = function(a) {\n              n._onPointerUp(a);\n            }, r.Canvas.addEventListener(\"pointerdown\", this._onPointerDownHandlerRef, !1), r.Canvas.addEventListener(\"pointermove\", this._onPointerMoveHandlerRef, !1), r.Canvas.addEventListener(\"pointerup\", this._onPointerUpHandlerRef, !1), r.Canvas.addEventListener(\"pointerout\", this._onPointerUpHandlerRef, !1), r.Canvas.addEventListener(\"contextmenu\", function(a) {\n              a.preventDefault();\n            }, !1), requestAnimationFrame(function() {\n              n._drawVirtualJoystick();\n            });\n          }\n          return r._GetDefaultOptions = function() {\n            return { puckSize: 40, containerSize: 60, color: \"cyan\", puckImage: void 0, containerImage: void 0, position: void 0, alwaysVisible: !1, limitToContainer: !1 };\n          }, r.prototype.setJoystickSensibility = function(t) {\n            this._joystickSensibility = t, this._inversedSensibility = 1 / (this._joystickSensibility / 1e3);\n          }, r.prototype._onPointerDown = function(t) {\n            t.preventDefault(), (this._leftJoystick === !0 ? t.clientX < r.halfWidth : t.clientX > r.halfWidth) && this._joystickPointerID < 0 ? (this._joystickPointerID = t.pointerId, this._joystickPosition ? (this._joystickPointerStartPos = this._joystickPosition.clone(), this._joystickPointerPos = this._joystickPosition.clone(), this._joystickPreviousPointerPos = this._joystickPosition.clone(), this._onPointerMove(t)) : (this._joystickPointerStartPos.x = t.clientX, this._joystickPointerStartPos.y = t.clientY, this._joystickPointerPos = this._joystickPointerStartPos.clone(), this._joystickPreviousPointerPos = this._joystickPointerStartPos.clone()), this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this.pressed = !0, this._touches.add(t.pointerId.toString(), t)) : r._globalJoystickIndex < 2 && this._action && (this._action(), this._touches.add(t.pointerId.toString(), { x: t.clientX, y: t.clientY, prevX: t.clientX, prevY: t.clientY }));\n          }, r.prototype._onPointerMove = function(t) {\n            if (this._joystickPointerID == t.pointerId) {\n              if (this.limitToContainer) {\n                var e = new u.d(t.clientX - this._joystickPointerStartPos.x, t.clientY - this._joystickPointerStartPos.y), n = e.length();\n                n > this.containerSize && e.scaleInPlace(this.containerSize / n), this._joystickPointerPos.x = this._joystickPointerStartPos.x + e.x, this._joystickPointerPos.y = this._joystickPointerStartPos.y + e.y;\n              } else\n                this._joystickPointerPos.x = t.clientX, this._joystickPointerPos.y = t.clientY;\n              this._deltaJoystickVector = this._joystickPointerPos.clone(), this._deltaJoystickVector = this._deltaJoystickVector.subtract(this._joystickPointerStartPos), 0 < r._alwaysVisibleSticks && (this._leftJoystick ? this._joystickPointerPos.x = Math.min(r.halfWidth, this._joystickPointerPos.x) : this._joystickPointerPos.x = Math.max(r.halfWidth, this._joystickPointerPos.x));\n              var i = (this.reverseLeftRight ? -1 : 1) * this._deltaJoystickVector.x / this._inversedSensibility;\n              switch (this._axisTargetedByLeftAndRight) {\n                case rn.X:\n                  this.deltaPosition.x = Math.min(1, Math.max(-1, i));\n                  break;\n                case rn.Y:\n                  this.deltaPosition.y = Math.min(1, Math.max(-1, i));\n                  break;\n                case rn.Z:\n                  this.deltaPosition.z = Math.min(1, Math.max(-1, i));\n              }\n              var o = (this.reverseUpDown ? 1 : -1) * this._deltaJoystickVector.y / this._inversedSensibility;\n              switch (this._axisTargetedByUpAndDown) {\n                case rn.X:\n                  this.deltaPosition.x = Math.min(1, Math.max(-1, o));\n                  break;\n                case rn.Y:\n                  this.deltaPosition.y = Math.min(1, Math.max(-1, o));\n                  break;\n                case rn.Z:\n                  this.deltaPosition.z = Math.min(1, Math.max(-1, o));\n              }\n            } else {\n              var a = this._touches.get(t.pointerId.toString());\n              a && (a.x = t.clientX, a.y = t.clientY);\n            }\n          }, r.prototype._onPointerUp = function(t) {\n            if (this._joystickPointerID == t.pointerId)\n              this._clearPreviousDraw(), this._joystickPointerID = -1, this.pressed = !1;\n            else {\n              var e = this._touches.get(t.pointerId.toString());\n              e && r.vjCanvasContext.clearRect(e.prevX - 44, e.prevY - 44, 88, 88);\n            }\n            this._deltaJoystickVector.x = 0, this._deltaJoystickVector.y = 0, this._touches.remove(t.pointerId.toString());\n          }, r.prototype.setJoystickColor = function(t) {\n            this._joystickColor = t;\n          }, Object.defineProperty(r.prototype, \"containerSize\", { get: function() {\n            return this._joystickContainerSize;\n          }, set: function(t) {\n            this._joystickContainerSize = t, this._clearContainerSize = ~~(2.1 * this._joystickContainerSize), this._clearContainerSizeOffset = ~~(this._clearContainerSize / 2);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"puckSize\", { get: function() {\n            return this._joystickPuckSize;\n          }, set: function(t) {\n            this._joystickPuckSize = t, this._clearPuckSize = ~~(2.1 * this._joystickPuckSize), this._clearPuckSizeOffset = ~~(this._clearPuckSize / 2);\n          }, enumerable: !1, configurable: !0 }), r.prototype.clearPosition = function() {\n            this.alwaysVisible = !1, this._joystickPosition = null;\n          }, Object.defineProperty(r.prototype, \"alwaysVisible\", { get: function() {\n            return this._alwaysVisible;\n          }, set: function(t) {\n            this._alwaysVisible !== t && (t && this._joystickPosition ? (r._alwaysVisibleSticks++, this._alwaysVisible = !0) : (r._alwaysVisibleSticks--, this._alwaysVisible = !1));\n          }, enumerable: !1, configurable: !0 }), r.prototype.setPosition = function(t, e) {\n            this._joystickPointerStartPos && this._clearPreviousDraw(), this._joystickPosition = new u.d(t, e);\n          }, r.prototype.setActionOnTouch = function(t) {\n            this._action = t;\n          }, r.prototype.setAxisForLeftRight = function(t) {\n            switch (t) {\n              case rn.X:\n              case rn.Y:\n              case rn.Z:\n                this._axisTargetedByLeftAndRight = t;\n                break;\n              default:\n                this._axisTargetedByLeftAndRight = rn.X;\n            }\n          }, r.prototype.setAxisForUpDown = function(t) {\n            switch (t) {\n              case rn.X:\n              case rn.Y:\n              case rn.Z:\n                this._axisTargetedByUpAndDown = t;\n                break;\n              default:\n                this._axisTargetedByUpAndDown = rn.Y;\n            }\n          }, r.prototype._clearPreviousDraw = function() {\n            var t = this._joystickPosition || this._joystickPointerStartPos;\n            r.vjCanvasContext.clearRect(t.x - this._clearContainerSizeOffset, t.y - this._clearContainerSizeOffset, this._clearContainerSize, this._clearContainerSize), r.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x - this._clearPuckSizeOffset, this._joystickPreviousPointerPos.y - this._clearPuckSizeOffset, this._clearPuckSize, this._clearPuckSize);\n          }, r.prototype.setContainerImage = function(t) {\n            var e = this, n = new Image();\n            n.src = t, n.onload = function() {\n              return e._containerImage = n;\n            };\n          }, r.prototype.setPuckImage = function(t) {\n            var e = this, n = new Image();\n            n.src = t, n.onload = function() {\n              return e._puckImage = n;\n            };\n          }, r.prototype._drawContainer = function() {\n            var t = this._joystickPosition || this._joystickPointerStartPos;\n            this._clearPreviousDraw(), this._containerImage ? r.vjCanvasContext.drawImage(this._containerImage, t.x - this.containerSize, t.y - this.containerSize, 2 * this.containerSize, 2 * this.containerSize) : (r.vjCanvasContext.beginPath(), r.vjCanvasContext.strokeStyle = this._joystickColor, r.vjCanvasContext.lineWidth = 2, r.vjCanvasContext.arc(t.x, t.y, this.containerSize, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath(), r.vjCanvasContext.beginPath(), r.vjCanvasContext.lineWidth = 6, r.vjCanvasContext.strokeStyle = this._joystickColor, r.vjCanvasContext.arc(t.x, t.y, this.puckSize, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath());\n          }, r.prototype._drawPuck = function() {\n            this._puckImage ? r.vjCanvasContext.drawImage(this._puckImage, this._joystickPointerPos.x - this.puckSize, this._joystickPointerPos.y - this.puckSize, 2 * this.puckSize, 2 * this.puckSize) : (r.vjCanvasContext.beginPath(), r.vjCanvasContext.strokeStyle = this._joystickColor, r.vjCanvasContext.lineWidth = 2, r.vjCanvasContext.arc(this._joystickPointerPos.x, this._joystickPointerPos.y, this.puckSize, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath());\n          }, r.prototype._drawVirtualJoystick = function() {\n            var t = this;\n            this.alwaysVisible && this._drawContainer(), this.pressed && this._touches.forEach(function(e, n) {\n              n.pointerId === t._joystickPointerID ? (t.alwaysVisible || t._drawContainer(), t._drawPuck(), t._joystickPreviousPointerPos = t._joystickPointerPos.clone()) : (r.vjCanvasContext.clearRect(n.prevX - 44, n.prevY - 44, 88, 88), r.vjCanvasContext.beginPath(), r.vjCanvasContext.fillStyle = \"white\", r.vjCanvasContext.beginPath(), r.vjCanvasContext.strokeStyle = \"red\", r.vjCanvasContext.lineWidth = 6, r.vjCanvasContext.arc(n.x, n.y, 40, 0, 2 * Math.PI, !0), r.vjCanvasContext.stroke(), r.vjCanvasContext.closePath(), n.prevX = n.x, n.prevY = n.y);\n            }), requestAnimationFrame(function() {\n              t._drawVirtualJoystick();\n            });\n          }, r.prototype.releaseCanvas = function() {\n            r.Canvas && (r.Canvas.removeEventListener(\"pointerdown\", this._onPointerDownHandlerRef), r.Canvas.removeEventListener(\"pointermove\", this._onPointerMoveHandlerRef), r.Canvas.removeEventListener(\"pointerup\", this._onPointerUpHandlerRef), r.Canvas.removeEventListener(\"pointerout\", this._onPointerUpHandlerRef), window.removeEventListener(\"resize\", this._onResize), document.body.removeChild(r.Canvas), r.Canvas = null);\n          }, r._globalJoystickIndex = 0, r._alwaysVisibleSticks = 0, r;\n        }();\n        jr.prototype.addVirtualJoystick = function() {\n          return this.add(new Qa()), this;\n        };\n        var Qa = function() {\n          function r() {\n          }\n          return r.prototype.getLeftJoystick = function() {\n            return this._leftjoystick;\n          }, r.prototype.getRightJoystick = function() {\n            return this._rightjoystick;\n          }, r.prototype.checkInputs = function() {\n            if (this._leftjoystick) {\n              var t = this.camera, e = 50 * t._computeLocalCameraSpeed(), n = u.a.RotationYawPitchRoll(t.rotation.y, t.rotation.x, 0), i = u.e.TransformCoordinates(new u.e(this._leftjoystick.deltaPosition.x * e, this._leftjoystick.deltaPosition.y * e, this._leftjoystick.deltaPosition.z * e), n);\n              t.cameraDirection = t.cameraDirection.add(i), t.cameraRotation = t.cameraRotation.addVector3(this._rightjoystick.deltaPosition), this._leftjoystick.pressed || (this._leftjoystick.deltaPosition = this._leftjoystick.deltaPosition.scale(0.9)), this._rightjoystick.pressed || (this._rightjoystick.deltaPosition = this._rightjoystick.deltaPosition.scale(0.9));\n            }\n          }, r.prototype.attachControl = function() {\n            this._leftjoystick = new Ka(!0), this._leftjoystick.setAxisForUpDown(rn.Z), this._leftjoystick.setAxisForLeftRight(rn.X), this._leftjoystick.setJoystickSensibility(0.15), this._rightjoystick = new Ka(!1), this._rightjoystick.setAxisForUpDown(rn.X), this._rightjoystick.setAxisForLeftRight(rn.Y), this._rightjoystick.reverseUpDown = !0, this._rightjoystick.setJoystickSensibility(0.05), this._rightjoystick.setJoystickColor(\"yellow\");\n          }, r.prototype.detachControl = function(t) {\n            this._leftjoystick.releaseCanvas(), this._rightjoystick.releaseCanvas();\n          }, r.prototype.getClassName = function() {\n            return \"FreeCameraVirtualJoystickInput\";\n          }, r.prototype.getSimpleName = function() {\n            return \"virtualJoystick\";\n          }, r;\n        }();\n        un.FreeCameraVirtualJoystickInput = Qa;\n        var Vt = f(28), xi = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !0);\n            var a = r.call(this, e, n, i, o) || this;\n            return a._tmpUpVector = u.e.Zero(), a._tmpTargetVector = u.e.Zero(), a.cameraDirection = new u.e(0, 0, 0), a.cameraRotation = new u.d(0, 0), a.ignoreParentScaling = !1, a.updateUpVectorFromRotation = !1, a._tmpQuaternion = new u.b(), a.rotation = new u.e(0, 0, 0), a.speed = 2, a.noRotationConstraint = !1, a.invertRotation = !1, a.inverseRotationSpeed = 0.2, a.lockedTarget = null, a._currentTarget = u.e.Zero(), a._initialFocalDistance = 1, a._viewMatrix = u.a.Zero(), a._camMatrix = u.a.Zero(), a._cameraTransformMatrix = u.a.Zero(), a._cameraRotationMatrix = u.a.Zero(), a._referencePoint = new u.e(0, 0, 1), a._transformedReferencePoint = u.e.Zero(), a._defaultUp = u.e.Up(), a._cachedRotationZ = 0, a._cachedQuaternionRotationZ = 0, a;\n          }\n          return Object(c.d)(t, r), t.prototype.getFrontPosition = function(e) {\n            this.getWorldMatrix();\n            var n = this.getTarget().subtract(this.position);\n            return n.normalize(), n.scaleInPlace(e), this.globalPosition.add(n);\n          }, t.prototype._getLockedTargetPosition = function() {\n            return this.lockedTarget ? (this.lockedTarget.absolutePosition && this.lockedTarget.computeWorldMatrix(), this.lockedTarget.absolutePosition || this.lockedTarget) : null;\n          }, t.prototype.storeState = function() {\n            return this._storedPosition = this.position.clone(), this._storedRotation = this.rotation.clone(), this.rotationQuaternion && (this._storedRotationQuaternion = this.rotationQuaternion.clone()), r.prototype.storeState.call(this);\n          }, t.prototype._restoreStateValues = function() {\n            return !!r.prototype._restoreStateValues.call(this) && (this.position = this._storedPosition.clone(), this.rotation = this._storedRotation.clone(), this.rotationQuaternion && (this.rotationQuaternion = this._storedRotationQuaternion.clone()), this.cameraDirection.copyFromFloats(0, 0, 0), this.cameraRotation.copyFromFloats(0, 0), !0);\n          }, t.prototype._initCache = function() {\n            r.prototype._initCache.call(this), this._cache.lockedTarget = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotation = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cache.rotationQuaternion = new u.b(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n          }, t.prototype._updateCache = function(e) {\n            e || r.prototype._updateCache.call(this);\n            var n = this._getLockedTargetPosition();\n            n ? this._cache.lockedTarget ? this._cache.lockedTarget.copyFrom(n) : this._cache.lockedTarget = n.clone() : this._cache.lockedTarget = null, this._cache.rotation.copyFrom(this.rotation), this.rotationQuaternion && this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);\n          }, t.prototype._isSynchronizedViewMatrix = function() {\n            if (!r.prototype._isSynchronizedViewMatrix.call(this))\n              return !1;\n            var e = this._getLockedTargetPosition();\n            return (this._cache.lockedTarget ? this._cache.lockedTarget.equals(e) : !e) && (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation));\n          }, t.prototype._computeLocalCameraSpeed = function() {\n            var e = this.getEngine();\n            return this.speed * Math.sqrt(e.getDeltaTime() / (100 * e.getFps()));\n          }, t.prototype.setTarget = function(e) {\n            this.upVector.normalize(), this._initialFocalDistance = e.subtract(this.position).length(), this.position.z === e.z && (this.position.z += Vt.a), this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance), u.a.LookAtLHToRef(this.position, e, this._defaultUp, this._camMatrix), this._camMatrix.invert(), this.rotation.x = Math.atan(this._camMatrix.m[6] / this._camMatrix.m[10]);\n            var n = e.subtract(this.position);\n            n.x >= 0 ? this.rotation.y = -Math.atan(n.z / n.x) + Math.PI / 2 : this.rotation.y = -Math.atan(n.z / n.x) - Math.PI / 2, this.rotation.z = 0, isNaN(this.rotation.x) && (this.rotation.x = 0), isNaN(this.rotation.y) && (this.rotation.y = 0), isNaN(this.rotation.z) && (this.rotation.z = 0), this.rotationQuaternion && u.b.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion);\n          }, Object.defineProperty(t.prototype, \"target\", { get: function() {\n            return this.getTarget();\n          }, set: function(e) {\n            this.setTarget(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getTarget = function() {\n            return this._currentTarget;\n          }, t.prototype._decideIfNeedsToMove = function() {\n            return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\n          }, t.prototype._updatePosition = function() {\n            if (this.parent)\n              return this.parent.getWorldMatrix().invertToRef(u.c.Matrix[0]), u.e.TransformNormalToRef(this.cameraDirection, u.c.Matrix[0], u.c.Vector3[0]), void this.position.addInPlace(u.c.Vector3[0]);\n            this.position.addInPlace(this.cameraDirection);\n          }, t.prototype._checkInputs = function() {\n            var e = this.invertRotation ? -this.inverseRotationSpeed : 1, n = this._decideIfNeedsToMove(), i = Math.abs(this.cameraRotation.x) > 0 || Math.abs(this.cameraRotation.y) > 0;\n            n && this._updatePosition(), i && (this.rotationQuaternion && this.rotationQuaternion.toEulerAnglesToRef(this.rotation), this.rotation.x += this.cameraRotation.x * e, this.rotation.y += this.cameraRotation.y * e, !this.noRotationConstraint && (this.rotation.x > 1.570796 && (this.rotation.x = 1.570796), this.rotation.x < -1.570796 && (this.rotation.x = -1.570796)), this.rotationQuaternion && this.rotation.lengthSquared() && u.b.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this.rotationQuaternion)), n && (Math.abs(this.cameraDirection.x) < this.speed * Vt.a && (this.cameraDirection.x = 0), Math.abs(this.cameraDirection.y) < this.speed * Vt.a && (this.cameraDirection.y = 0), Math.abs(this.cameraDirection.z) < this.speed * Vt.a && (this.cameraDirection.z = 0), this.cameraDirection.scaleInPlace(this.inertia)), i && (Math.abs(this.cameraRotation.x) < this.speed * Vt.a && (this.cameraRotation.x = 0), Math.abs(this.cameraRotation.y) < this.speed * Vt.a && (this.cameraRotation.y = 0), this.cameraRotation.scaleInPlace(this.inertia)), r.prototype._checkInputs.call(this);\n          }, t.prototype._updateCameraRotationMatrix = function() {\n            this.rotationQuaternion ? this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix) : u.a.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);\n          }, t.prototype._rotateUpVectorWithCameraRotationMatrix = function() {\n            return u.e.TransformNormalToRef(this._defaultUp, this._cameraRotationMatrix, this.upVector), this;\n          }, t.prototype._getViewMatrix = function() {\n            return this.lockedTarget && this.setTarget(this._getLockedTargetPosition()), this._updateCameraRotationMatrix(), this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z ? (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedQuaternionRotationZ = this.rotationQuaternion.z) : this._cachedRotationZ != this.rotation.z && (this._rotateUpVectorWithCameraRotationMatrix(), this._cachedRotationZ = this.rotation.z), u.e.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), this.updateUpVectorFromRotation && (this.rotationQuaternion ? be.a.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector) : (u.b.FromEulerVectorToRef(this.rotation, this._tmpQuaternion), be.a.Y.rotateByQuaternionToRef(this._tmpQuaternion, this.upVector))), this._computeViewMatrix(this.position, this._currentTarget, this.upVector), this._viewMatrix;\n          }, t.prototype._computeViewMatrix = function(e, n, i) {\n            if (this.ignoreParentScaling) {\n              if (this.parent) {\n                var o = this.parent.getWorldMatrix();\n                u.e.TransformCoordinatesToRef(e, o, this._globalPosition), u.e.TransformCoordinatesToRef(n, o, this._tmpTargetVector), u.e.TransformNormalToRef(i, o, this._tmpUpVector), this._markSyncedWithParent();\n              } else\n                this._globalPosition.copyFrom(e), this._tmpTargetVector.copyFrom(n), this._tmpUpVector.copyFrom(i);\n              this.getScene().useRightHandedSystem ? u.a.LookAtRHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix) : u.a.LookAtLHToRef(this._globalPosition, this._tmpTargetVector, this._tmpUpVector, this._viewMatrix);\n            } else\n              this.getScene().useRightHandedSystem ? u.a.LookAtRHToRef(e, n, i, this._viewMatrix) : u.a.LookAtLHToRef(e, n, i, this._viewMatrix), this.parent ? (o = this.parent.getWorldMatrix(), this._viewMatrix.invert(), this._viewMatrix.multiplyToRef(o, this._viewMatrix), this._viewMatrix.getTranslationToRef(this._globalPosition), this._viewMatrix.invert(), this._markSyncedWithParent()) : this._globalPosition.copyFrom(e);\n          }, t.prototype.createRigCamera = function(e, n) {\n            if (this.cameraRigMode !== _t.a.RIG_MODE_NONE) {\n              var i = new t(e, this.position.clone(), this.getScene());\n              return i.isRigCamera = !0, i.rigParent = this, this.cameraRigMode !== _t.a.RIG_MODE_VR && this.cameraRigMode !== _t.a.RIG_MODE_WEBVR || (this.rotationQuaternion || (this.rotationQuaternion = new u.b()), i._cameraRigParams = {}, i.rotationQuaternion = new u.b()), i;\n            }\n            return null;\n          }, t.prototype._updateRigCameras = function() {\n            var e = this._rigCameras[0], n = this._rigCameras[1];\n            switch (this.computeWorldMatrix(), this.cameraRigMode) {\n              case _t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n              case _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n              case _t.a.RIG_MODE_STEREOSCOPIC_INTERLACED:\n                var i = this.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1, o = this.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;\n                this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * i, e), this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * o, n);\n                break;\n              case _t.a.RIG_MODE_VR:\n                e.rotationQuaternion ? (e.rotationQuaternion.copyFrom(this.rotationQuaternion), n.rotationQuaternion.copyFrom(this.rotationQuaternion)) : (e.rotation.copyFrom(this.rotation), n.rotation.copyFrom(this.rotation)), e.position.copyFrom(this.position), n.position.copyFrom(this.position);\n            }\n            r.prototype._updateRigCameras.call(this);\n          }, t.prototype._getRigCamPositionAndTarget = function(e, n) {\n            this.getTarget().subtractToRef(this.position, t._TargetFocalPoint), t._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);\n            var i = t._TargetFocalPoint.addInPlace(this.position);\n            u.a.TranslationToRef(-i.x, -i.y, -i.z, t._TargetTransformMatrix), t._TargetTransformMatrix.multiplyToRef(u.a.RotationAxis(n.upVector, e), t._RigCamTransformMatrix), u.a.TranslationToRef(i.x, i.y, i.z, t._TargetTransformMatrix), t._RigCamTransformMatrix.multiplyToRef(t._TargetTransformMatrix, t._RigCamTransformMatrix), u.e.TransformCoordinatesToRef(this.position, t._RigCamTransformMatrix, n.position), n.setTarget(i);\n          }, t.prototype.getClassName = function() {\n            return \"TargetCamera\";\n          }, t._RigCamTransformMatrix = new u.a(), t._TargetTransformMatrix = new u.a(), t._TargetFocalPoint = new u.e(), Object(c.c)([Object(L.o)()], t.prototype, \"rotation\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"speed\", void 0), Object(c.c)([Object(L.k)(\"lockedTargetId\")], t.prototype, \"lockedTarget\", void 0), t;\n        }(_t.a), zn = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !0);\n            var a = r.call(this, e, n, i, o) || this;\n            return a.ellipsoid = new u.e(0.5, 1, 0.5), a.ellipsoidOffset = new u.e(0, 0, 0), a.checkCollisions = !1, a.applyGravity = !1, a._needMoveForGravity = !1, a._oldPosition = u.e.Zero(), a._diffPosition = u.e.Zero(), a._newPosition = u.e.Zero(), a._collisionMask = -1, a._onCollisionPositionChange = function(s, d, p) {\n              p === void 0 && (p = null);\n              var y;\n              y = d, a._newPosition.copyFrom(y), a._newPosition.subtractToRef(a._oldPosition, a._diffPosition), a._diffPosition.length() > Ue.a.CollisionsEpsilon && (a.position.addInPlace(a._diffPosition), a.onCollide && p && a.onCollide(p));\n            }, a.inputs = new jr(a), a.inputs.addKeyboard().addMouse(), a;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"angularSensibility\", { get: function() {\n            var e = this.inputs.attached.mouse;\n            return e ? e.angularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mouse;\n            n && (n.angularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUp\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUp : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUp = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUpward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUpward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUpward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDown\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDown : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDown = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDownward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDownward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDownward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysLeft\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysLeft : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysLeft = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysRight\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysRight : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysRight = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.attachControl = function(e, n) {\n            n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(n);\n          }, t.prototype.detachControl = function(e) {\n            this.inputs.detachElement(), this.cameraDirection = new u.e(0, 0, 0), this.cameraRotation = new u.d(0, 0);\n          }, Object.defineProperty(t.prototype, \"collisionMask\", { get: function() {\n            return this._collisionMask;\n          }, set: function(e) {\n            this._collisionMask = isNaN(e) ? -1 : e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._collideWithWorld = function(e) {\n            (this.parent ? u.e.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position).subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);\n            var n = this.getScene().collisionCoordinator;\n            this._collider || (this._collider = n.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;\n            var i = e;\n            this.applyGravity && (i = e.add(this.getScene().gravity)), n.getNewPosition(this._oldPosition, i, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);\n          }, t.prototype._checkInputs = function() {\n            this._localDirection || (this._localDirection = u.e.Zero(), this._transformedDirection = u.e.Zero()), this.inputs.checkInputs(), r.prototype._checkInputs.call(this);\n          }, t.prototype._decideIfNeedsToMove = function() {\n            return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\n          }, t.prototype._updatePosition = function() {\n            this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : r.prototype._updatePosition.call(this);\n          }, t.prototype.dispose = function() {\n            this.inputs.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"FreeCamera\";\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoid\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoidOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"checkCollisions\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"applyGravity\", void 0), t;\n        }(xi);\n        Q.a.AddNodeConstructor(\"TouchCamera\", function(r, t) {\n          return function() {\n            return new qa(r, u.e.Zero(), t);\n          };\n        });\n        var qa = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.inputs.addTouch(), o._setupInputs(), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"touchAngularSensibility\", { get: function() {\n            var e = this.inputs.attached.touch;\n            return e ? e.touchAngularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.touch;\n            n && (n.touchAngularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"touchMoveSensibility\", { get: function() {\n            var e = this.inputs.attached.touch;\n            return e ? e.touchMoveSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.touch;\n            n && (n.touchMoveSensibility = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"TouchCamera\";\n          }, t.prototype._setupInputs = function() {\n            var e = this.inputs.attached.touch, n = this.inputs.attached.mouse;\n            n ? n.touchEnabled = !1 : e.allowMouse = !0;\n          }, t;\n        }(zn);\n        Q.a.AddNodeConstructor(\"ArcRotateCamera\", function(r, t) {\n          return function() {\n            return new Hi(r, 0, 0, 1, u.e.Zero(), t);\n          };\n        });\n        var Hi = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            d === void 0 && (d = !0);\n            var p = r.call(this, e, u.e.Zero(), s, d) || this;\n            return p.inertialAlphaOffset = 0, p.inertialBetaOffset = 0, p.inertialRadiusOffset = 0, p.lowerAlphaLimit = null, p.upperAlphaLimit = null, p.lowerBetaLimit = 0.01, p.upperBetaLimit = Math.PI - 0.01, p.lowerRadiusLimit = null, p.upperRadiusLimit = null, p.inertialPanningX = 0, p.inertialPanningY = 0, p.pinchToPanMaxDistance = 20, p.panningDistanceLimit = null, p.panningOriginTarget = u.e.Zero(), p.panningInertia = 0.9, p.zoomOnFactor = 1, p.targetScreenOffset = u.d.Zero(), p.allowUpsideDown = !0, p.useInputToRestoreState = !0, p._viewMatrix = new u.a(), p.panningAxis = new u.e(1, 1, 0), p.onMeshTargetChangedObservable = new C.c(), p.checkCollisions = !1, p.collisionRadius = new u.e(0.5, 0.5, 0.5), p._previousPosition = u.e.Zero(), p._collisionVelocity = u.e.Zero(), p._newPosition = u.e.Zero(), p._computationVector = u.e.Zero(), p._onCollisionPositionChange = function(y, P, R) {\n              R === void 0 && (R = null), R ? (p.setPosition(P), p.onCollide && p.onCollide(R)) : p._previousPosition.copyFrom(p._position);\n              var B = Math.cos(p.alpha), F = Math.sin(p.alpha), z = Math.cos(p.beta), J = Math.sin(p.beta);\n              J === 0 && (J = 1e-4);\n              var ie = p._getTargetPosition();\n              p._computationVector.copyFromFloats(p.radius * B * J, p.radius * z, p.radius * F * J), ie.addToRef(p._computationVector, p._newPosition), p._position.copyFrom(p._newPosition);\n              var se = p.upVector;\n              p.allowUpsideDown && p.beta < 0 && (se = (se = se.clone()).negate()), p._computeViewMatrix(p._position, ie, se), p._viewMatrix.addAtIndex(12, p.targetScreenOffset.x), p._viewMatrix.addAtIndex(13, p.targetScreenOffset.y), p._collisionTriggered = !1;\n            }, p._target = u.e.Zero(), a && p.setTarget(a), p.alpha = n, p.beta = i, p.radius = o, p.getViewMatrix(), p.inputs = new Po(p), p.inputs.addKeyboard().addMouseWheel().addPointers(), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"target\", { get: function() {\n            return this._target;\n          }, set: function(e) {\n            this.setTarget(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(e) {\n            this.setPosition(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"upVector\", { get: function() {\n            return this._upVector;\n          }, set: function(e) {\n            this._upToYMatrix || (this._YToUpMatrix = new u.a(), this._upToYMatrix = new u.a(), this._upVector = u.e.Zero()), e.normalize(), this._upVector.copyFrom(e), this.setMatUp();\n          }, enumerable: !1, configurable: !0 }), t.prototype.setMatUp = function() {\n            u.a.RotationAlignToRef(u.e.UpReadOnly, this._upVector, this._YToUpMatrix), u.a.RotationAlignToRef(this._upVector, u.e.UpReadOnly, this._upToYMatrix);\n          }, Object.defineProperty(t.prototype, \"angularSensibilityX\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.angularSensibilityX : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.angularSensibilityX = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"angularSensibilityY\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.angularSensibilityY : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.angularSensibilityY = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"pinchPrecision\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.pinchPrecision : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.pinchPrecision = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"pinchDeltaPercentage\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.pinchDeltaPercentage : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.pinchDeltaPercentage = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useNaturalPinchZoom\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return !!e && e.useNaturalPinchZoom;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.useNaturalPinchZoom = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"panningSensibility\", { get: function() {\n            var e = this.inputs.attached.pointers;\n            return e ? e.panningSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.pointers;\n            n && (n.panningSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUp\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUp : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUp = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDown\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDown : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDown = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysLeft\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysLeft : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysLeft = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysRight\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysRight : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysRight = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelPrecision\", { get: function() {\n            var e = this.inputs.attached.mousewheel;\n            return e ? e.wheelPrecision : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mousewheel;\n            n && (n.wheelPrecision = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wheelDeltaPercentage\", { get: function() {\n            var e = this.inputs.attached.mousewheel;\n            return e ? e.wheelDeltaPercentage : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mousewheel;\n            n && (n.wheelDeltaPercentage = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bouncingBehavior\", { get: function() {\n            return this._bouncingBehavior;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useBouncingBehavior\", { get: function() {\n            return this._bouncingBehavior != null;\n          }, set: function(e) {\n            e !== this.useBouncingBehavior && (e ? (this._bouncingBehavior = new qc(), this.addBehavior(this._bouncingBehavior)) : this._bouncingBehavior && (this.removeBehavior(this._bouncingBehavior), this._bouncingBehavior = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"framingBehavior\", { get: function() {\n            return this._framingBehavior;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useFramingBehavior\", { get: function() {\n            return this._framingBehavior != null;\n          }, set: function(e) {\n            e !== this.useFramingBehavior && (e ? (this._framingBehavior = new Zc(), this.addBehavior(this._framingBehavior)) : this._framingBehavior && (this.removeBehavior(this._framingBehavior), this._framingBehavior = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"autoRotationBehavior\", { get: function() {\n            return this._autoRotationBehavior;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useAutoRotationBehavior\", { get: function() {\n            return this._autoRotationBehavior != null;\n          }, set: function(e) {\n            e !== this.useAutoRotationBehavior && (e ? (this._autoRotationBehavior = new Qc(), this.addBehavior(this._autoRotationBehavior)) : this._autoRotationBehavior && (this.removeBehavior(this._autoRotationBehavior), this._autoRotationBehavior = null));\n          }, enumerable: !1, configurable: !0 }), t.prototype._initCache = function() {\n            r.prototype._initCache.call(this), this._cache._target = new u.e(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 = u.d.Zero();\n          }, t.prototype._updateCache = function(e) {\n            e || r.prototype._updateCache.call(this), 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);\n          }, t.prototype._getTargetPosition = function() {\n            if (this._targetHost && this._targetHost.getAbsolutePosition) {\n              var e = this._targetHost.absolutePosition;\n              this._targetBoundingCenter ? e.addToRef(this._targetBoundingCenter, this._target) : this._target.copyFrom(e);\n            }\n            var n = this._getLockedTargetPosition();\n            return n || this._target;\n          }, t.prototype.storeState = function() {\n            return this._storedAlpha = this.alpha, this._storedBeta = this.beta, this._storedRadius = this.radius, this._storedTarget = this._getTargetPosition().clone(), this._storedTargetScreenOffset = this.targetScreenOffset.clone(), r.prototype.storeState.call(this);\n          }, t.prototype._restoreStateValues = function() {\n            return !!r.prototype._restoreStateValues.call(this) && (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);\n          }, t.prototype._isSynchronizedViewMatrix = function() {\n            return !!r.prototype._isSynchronizedViewMatrix.call(this) && 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);\n          }, t.prototype.attachControl = function(e, n, i, o) {\n            var a = this;\n            i === void 0 && (i = !0), o === void 0 && (o = 2), n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this._useCtrlForPanning = i, this._panningMouseButton = o, typeof arguments[0] == \"boolean\" && (arguments.length > 1 && (this._useCtrlForPanning = arguments[1]), arguments.length > 2 && (this._panningMouseButton = arguments[2])), this.inputs.attachElement(n), this._reset = function() {\n              a.inertialAlphaOffset = 0, a.inertialBetaOffset = 0, a.inertialRadiusOffset = 0, a.inertialPanningX = 0, a.inertialPanningY = 0;\n            };\n          }, t.prototype.detachControl = function(e) {\n            this.inputs.detachElement(), this._reset && this._reset();\n          }, t.prototype._checkInputs = function() {\n            if (!this._collisionTriggered) {\n              if (this.inputs.checkInputs(), this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {\n                var e = this.inertialAlphaOffset;\n                this.beta <= 0 && (e *= -1), this.getScene().useRightHandedSystem && (e *= -1), this.parent && this.parent._getWorldMatrixDeterminant() < 0 && (e *= -1), this.alpha += e, this.beta += this.inertialBetaOffset, this.radius -= this.inertialRadiusOffset, this.inertialAlphaOffset *= this.inertia, this.inertialBetaOffset *= this.inertia, this.inertialRadiusOffset *= this.inertia, Math.abs(this.inertialAlphaOffset) < Vt.a && (this.inertialAlphaOffset = 0), Math.abs(this.inertialBetaOffset) < Vt.a && (this.inertialBetaOffset = 0), Math.abs(this.inertialRadiusOffset) < this.speed * Vt.a && (this.inertialRadiusOffset = 0);\n              }\n              (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) && (this._localDirection || (this._localDirection = u.e.Zero(), this._transformedDirection = u.e.Zero()), this._localDirection.copyFromFloats(this.inertialPanningX, this.inertialPanningY, this.inertialPanningY), this._localDirection.multiplyInPlace(this.panningAxis), this._viewMatrix.invertToRef(this._cameraTransformMatrix), u.e.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection), this.panningAxis.y || (this._transformedDirection.y = 0), !this._targetHost && (this.panningDistanceLimit ? (this._transformedDirection.addInPlace(this._target), u.e.DistanceSquared(this._transformedDirection, this.panningOriginTarget) <= this.panningDistanceLimit * this.panningDistanceLimit && this._target.copyFrom(this._transformedDirection)) : this._target.addInPlace(this._transformedDirection)), this.inertialPanningX *= this.panningInertia, this.inertialPanningY *= this.panningInertia, Math.abs(this.inertialPanningX) < this.speed * Vt.a && (this.inertialPanningX = 0), Math.abs(this.inertialPanningY) < this.speed * Vt.a && (this.inertialPanningY = 0)), this._checkLimits(), r.prototype._checkInputs.call(this);\n            }\n          }, t.prototype._checkLimits = function() {\n            this.lowerBetaLimit === null || this.lowerBetaLimit === void 0 ? this.allowUpsideDown && this.beta > Math.PI && (this.beta = this.beta - 2 * Math.PI) : this.beta < this.lowerBetaLimit && (this.beta = this.lowerBetaLimit), this.upperBetaLimit === null || this.upperBetaLimit === void 0 ? this.allowUpsideDown && this.beta < -Math.PI && (this.beta = this.beta + 2 * Math.PI) : this.beta > this.upperBetaLimit && (this.beta = this.upperBetaLimit), this.lowerAlphaLimit !== null && this.alpha < this.lowerAlphaLimit && (this.alpha = this.lowerAlphaLimit), this.upperAlphaLimit !== null && this.alpha > this.upperAlphaLimit && (this.alpha = this.upperAlphaLimit), this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit, this.inertialRadiusOffset = 0), this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit, this.inertialRadiusOffset = 0);\n          }, t.prototype.rebuildAnglesAndRadius = function() {\n            this._position.subtractToRef(this._getTargetPosition(), this._computationVector), this._upVector.x === 0 && this._upVector.y === 1 && this._upVector.z === 0 || u.e.TransformCoordinatesToRef(this._computationVector, this._upToYMatrix, this._computationVector), this.radius = this._computationVector.length(), this.radius === 0 && (this.radius = 1e-4);\n            var e = this.alpha;\n            this._computationVector.x === 0 && this._computationVector.z === 0 ? this.alpha = Math.PI / 2 : this.alpha = Math.acos(this._computationVector.x / Math.sqrt(Math.pow(this._computationVector.x, 2) + Math.pow(this._computationVector.z, 2))), this._computationVector.z < 0 && (this.alpha = 2 * Math.PI - this.alpha);\n            var n = Math.round((e - this.alpha) / (2 * Math.PI));\n            this.alpha += 2 * n * Math.PI, this.beta = Math.acos(this._computationVector.y / this.radius), this._checkLimits();\n          }, t.prototype.setPosition = function(e) {\n            this._position.equals(e) || (this._position.copyFrom(e), this.rebuildAnglesAndRadius());\n          }, t.prototype.setTarget = function(e, n, i) {\n            if (n === void 0 && (n = !1), i === void 0 && (i = !1), e.getBoundingInfo)\n              this._targetBoundingCenter = n ? e.getBoundingInfo().boundingBox.centerWorld.clone() : null, e.computeWorldMatrix(), this._targetHost = e, this._target = this._getTargetPosition(), this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);\n            else {\n              var o = e, a = this._getTargetPosition();\n              if (a && !i && a.equals(o))\n                return;\n              this._targetHost = null, this._target = o, this._targetBoundingCenter = null, this.onMeshTargetChangedObservable.notifyObservers(null);\n            }\n            this.rebuildAnglesAndRadius();\n          }, t.prototype._getViewMatrix = function() {\n            var e = Math.cos(this.alpha), n = Math.sin(this.alpha), i = Math.cos(this.beta), o = Math.sin(this.beta);\n            o === 0 && (o = 1e-4), this.radius === 0 && (this.radius = 1e-4);\n            var a = this._getTargetPosition();\n            if (this._computationVector.copyFromFloats(this.radius * e * o, this.radius * i, this.radius * n * o), this._upVector.x === 0 && this._upVector.y === 1 && this._upVector.z === 0 || u.e.TransformCoordinatesToRef(this._computationVector, this._YToUpMatrix, this._computationVector), a.addToRef(this._computationVector, this._newPosition), this.getScene().collisionsEnabled && this.checkCollisions) {\n              var s = this.getScene().collisionCoordinator;\n              this._collider || (this._collider = s.createCollider()), this._collider._radius = this.collisionRadius, this._newPosition.subtractToRef(this._position, this._collisionVelocity), this._collisionTriggered = !0, s.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);\n            } else {\n              this._position.copyFrom(this._newPosition);\n              var d = this.upVector;\n              this.allowUpsideDown && o < 0 && (d = d.negate()), this._computeViewMatrix(this._position, a, d), this._viewMatrix.addAtIndex(12, this.targetScreenOffset.x), this._viewMatrix.addAtIndex(13, this.targetScreenOffset.y);\n            }\n            return this._currentTarget = a, this._viewMatrix;\n          }, t.prototype.zoomOn = function(e, n) {\n            n === void 0 && (n = !1), e = e || this.getScene().meshes;\n            var i = Ie.a.MinMax(e), o = u.e.Distance(i.min, i.max);\n            this.radius = o * this.zoomOnFactor, this.focusOn({ min: i.min, max: i.max, distance: o }, n);\n          }, t.prototype.focusOn = function(e, n) {\n            var i, o;\n            if (n === void 0 && (n = !1), e.min === void 0) {\n              var a = e || this.getScene().meshes;\n              i = Ie.a.MinMax(a), o = u.e.Distance(i.min, i.max);\n            } else\n              i = e, o = e.distance;\n            this._target = Ie.a.Center(i), n || (this.maxZ = 2 * o);\n          }, t.prototype.createRigCamera = function(e, n) {\n            var i = 0;\n            switch (this.cameraRigMode) {\n              case _t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n              case _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n              case _t.a.RIG_MODE_STEREOSCOPIC_INTERLACED:\n              case _t.a.RIG_MODE_VR:\n                i = this._cameraRigParams.stereoHalfAngle * (n === 0 ? 1 : -1);\n                break;\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n                i = this._cameraRigParams.stereoHalfAngle * (n === 0 ? -1 : 1);\n            }\n            var o = new t(e, this.alpha + i, this.beta, this.radius, this._target, this.getScene());\n            return o._cameraRigParams = {}, o.isRigCamera = !0, o.rigParent = this, o.upVector = this.upVector, o;\n          }, t.prototype._updateRigCameras = function() {\n            var e = this._rigCameras[0], n = this._rigCameras[1];\n            switch (e.beta = n.beta = this.beta, this.cameraRigMode) {\n              case _t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\n              case _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER:\n              case _t.a.RIG_MODE_STEREOSCOPIC_INTERLACED:\n              case _t.a.RIG_MODE_VR:\n                e.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle, n.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle;\n                break;\n              case _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\n                e.alpha = this.alpha + this._cameraRigParams.stereoHalfAngle, n.alpha = this.alpha - this._cameraRigParams.stereoHalfAngle;\n            }\n            r.prototype._updateRigCameras.call(this);\n          }, t.prototype.dispose = function() {\n            this.inputs.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"ArcRotateCamera\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"alpha\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"beta\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.o)(\"target\")], t.prototype, \"_target\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialAlphaOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialBetaOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialRadiusOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerAlphaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperAlphaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerBetaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperBetaLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialPanningX\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"inertialPanningY\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"pinchToPanMaxDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"panningDistanceLimit\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"panningOriginTarget\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"panningInertia\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"zoomOnFactor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"targetScreenOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"allowUpsideDown\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useInputToRestoreState\", void 0), t;\n        }(xi);\n        Q.a.AddNodeConstructor(\"DeviceOrientationCamera\", function(r, t) {\n          return function() {\n            return new xo(r, u.e.Zero(), t);\n          };\n        });\n        var xo = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o._tmpDragQuaternion = new u.b(), o._disablePointerInputWhenUsingDeviceOrientation = !0, o._dragFactor = 0, o._quaternionCache = new u.b(), o.inputs.addDeviceOrientation(), o.inputs._deviceOrientationInput && o.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(function() {\n              o._disablePointerInputWhenUsingDeviceOrientation && o.inputs._mouseInput && (o.inputs._mouseInput._allowCameraRotation = !1, o.inputs._mouseInput.onPointerMovedObservable.add(function(a) {\n                o._dragFactor != 0 && (o._initialQuaternion || (o._initialQuaternion = new u.b()), u.b.FromEulerAnglesToRef(0, a.offsetX * o._dragFactor, 0, o._tmpDragQuaternion), o._initialQuaternion.multiplyToRef(o._tmpDragQuaternion, o._initialQuaternion));\n              }));\n            }), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"disablePointerInputWhenUsingDeviceOrientation\", { get: function() {\n            return this._disablePointerInputWhenUsingDeviceOrientation;\n          }, set: function(e) {\n            this._disablePointerInputWhenUsingDeviceOrientation = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.enableHorizontalDragging = function(e) {\n            e === void 0 && (e = 1 / 300), this._dragFactor = e;\n          }, t.prototype.getClassName = function() {\n            return \"DeviceOrientationCamera\";\n          }, t.prototype._checkInputs = function() {\n            r.prototype._checkInputs.call(this), this._quaternionCache.copyFrom(this.rotationQuaternion), this._initialQuaternion && this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion);\n          }, t.prototype.resetToCurrentRotation = function(e) {\n            var n = this;\n            e === void 0 && (e = be.a.Y), this.rotationQuaternion && (this._initialQuaternion || (this._initialQuaternion = new u.b()), this._initialQuaternion.copyFrom(this._quaternionCache || this.rotationQuaternion), [\"x\", \"y\", \"z\"].forEach(function(i) {\n              e[i] ? n._initialQuaternion[i] *= -1 : n._initialQuaternion[i] = 0;\n            }), this._initialQuaternion.normalize(), this._initialQuaternion.multiplyToRef(this.rotationQuaternion, this.rotationQuaternion));\n          }, t;\n        }(zn), ol = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.addKeyboard = function() {\n            return this.add(new Ba()), this;\n          }, t.prototype.addMouse = function(e) {\n            return e === void 0 && (e = !0), this.add(new Ua(e)), this;\n          }, t;\n        }(zr), gf = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !0);\n            var a = r.call(this, e, n, i, o) || this;\n            return a.ellipsoid = new u.e(1, 1, 1), a.ellipsoidOffset = new u.e(0, 0, 0), a.checkCollisions = !1, a.applyGravity = !1, a.cameraDirection = u.e.Zero(), a._trackRoll = 0, a.rollCorrect = 100, a.bankedTurn = !1, a.bankedTurnLimit = Math.PI / 2, a.bankedTurnMultiplier = 1, a._needMoveForGravity = !1, a._oldPosition = u.e.Zero(), a._diffPosition = u.e.Zero(), a._newPosition = u.e.Zero(), a._collisionMask = -1, a._onCollisionPositionChange = function(s, d, p) {\n              p === void 0 && (p = null);\n              var y;\n              y = d, a._newPosition.copyFrom(y), a._newPosition.subtractToRef(a._oldPosition, a._diffPosition), a._diffPosition.length() > Ue.a.CollisionsEpsilon && (a.position.addInPlace(a._diffPosition), a.onCollide && p && a.onCollide(p));\n            }, a.inputs = new ol(a), a.inputs.addKeyboard().addMouse(), a;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"angularSensibility\", { get: function() {\n            var e = this.inputs.attached.mouse;\n            return e ? e.angularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.mouse;\n            n && (n.angularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysForward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysForward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysForward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysBackward\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysBackward : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysBackward = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysUp\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysUp : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysUp = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysDown\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysDown : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysDown = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysLeft\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysLeft : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysLeft = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"keysRight\", { get: function() {\n            var e = this.inputs.attached.keyboard;\n            return e ? e.keysRight : [];\n          }, set: function(e) {\n            var n = this.inputs.attached.keyboard;\n            n && (n.keysRight = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.attachControl = function(e, n) {\n            n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(n);\n          }, t.prototype.detachControl = function() {\n            this.inputs.detachElement(), this.cameraDirection = new u.e(0, 0, 0);\n          }, Object.defineProperty(t.prototype, \"collisionMask\", { get: function() {\n            return this._collisionMask;\n          }, set: function(e) {\n            this._collisionMask = isNaN(e) ? -1 : e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._collideWithWorld = function(e) {\n            (this.parent ? u.e.TransformCoordinates(this.position, this.parent.getWorldMatrix()) : this.position).subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPosition), this._oldPosition.addInPlace(this.ellipsoidOffset);\n            var n = this.getScene().collisionCoordinator;\n            this._collider || (this._collider = n.createCollider()), this._collider._radius = this.ellipsoid, this._collider.collisionMask = this._collisionMask;\n            var i = e;\n            this.applyGravity && (i = e.add(this.getScene().gravity)), n.getNewPosition(this._oldPosition, i, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);\n          }, t.prototype._checkInputs = function() {\n            this._localDirection || (this._localDirection = u.e.Zero(), this._transformedDirection = u.e.Zero()), this.inputs.checkInputs(), r.prototype._checkInputs.call(this);\n          }, t.prototype._decideIfNeedsToMove = function() {\n            return this._needMoveForGravity || Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\n          }, t.prototype._updatePosition = function() {\n            this.checkCollisions && this.getScene().collisionsEnabled ? this._collideWithWorld(this.cameraDirection) : r.prototype._updatePosition.call(this);\n          }, t.prototype.restoreRoll = function(e) {\n            var n = this._trackRoll, i = n - this.rotation.z;\n            Math.abs(i) >= 1e-3 && (this.rotation.z += i / e, Math.abs(n - this.rotation.z) <= 1e-3 && (this.rotation.z = n));\n          }, t.prototype.dispose = function() {\n            this.inputs.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"FlyCamera\";\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoid\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"ellipsoidOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"checkCollisions\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"applyGravity\", void 0), t;\n        }(xi), al = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.addKeyboard = function() {\n            return this.add(new Va()), this;\n          }, t.prototype.addMouseWheel = function() {\n            return this.add(new ka()), this;\n          }, t.prototype.addPointers = function() {\n            return this.add(new Ga()), this;\n          }, t.prototype.addVRDeviceOrientation = function() {\n            return console.warn(\"DeviceOrientation support not yet implemented for FollowCamera.\"), this;\n          }, t;\n        }(zr);\n        Q.a.AddNodeConstructor(\"FollowCamera\", function(r, t) {\n          return function() {\n            return new sl(r, u.e.Zero(), t);\n          };\n        }), Q.a.AddNodeConstructor(\"ArcFollowCamera\", function(r, t) {\n          return function() {\n            return new cl(r, 0, 0, 1, null, t);\n          };\n        });\n        var Jn, sl = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = null);\n            var a = r.call(this, e, n, i) || this;\n            return a.radius = 12, a.lowerRadiusLimit = null, a.upperRadiusLimit = null, a.rotationOffset = 0, a.lowerRotationOffsetLimit = null, a.upperRotationOffsetLimit = null, a.heightOffset = 4, a.lowerHeightOffsetLimit = null, a.upperHeightOffsetLimit = null, a.cameraAcceleration = 0.05, a.maxCameraSpeed = 20, a.lockedTarget = o, a.inputs = new al(a), a.inputs.addKeyboard().addMouseWheel().addPointers(), a;\n          }\n          return Object(c.d)(t, r), t.prototype._follow = function(e) {\n            if (e) {\n              var n;\n              if (e.rotationQuaternion) {\n                var i = new u.a();\n                e.rotationQuaternion.toRotationMatrix(i), n = Math.atan2(i.m[8], i.m[10]);\n              } else\n                n = e.rotation.y;\n              var o = Xe.b.ToRadians(this.rotationOffset) + n, a = e.getAbsolutePosition(), s = a.x + Math.sin(o) * this.radius, d = a.z + Math.cos(o) * this.radius, p = s - this.position.x, y = a.y + this.heightOffset - this.position.y, P = d - this.position.z, R = p * this.cameraAcceleration * 2, B = y * this.cameraAcceleration, F = P * this.cameraAcceleration * 2;\n              (R > this.maxCameraSpeed || R < -this.maxCameraSpeed) && (R = R < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (B > this.maxCameraSpeed || B < -this.maxCameraSpeed) && (B = B < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), (F > this.maxCameraSpeed || F < -this.maxCameraSpeed) && (F = F < 1 ? -this.maxCameraSpeed : this.maxCameraSpeed), this.position = new u.e(this.position.x + R, this.position.y + B, this.position.z + F), this.setTarget(a);\n            }\n          }, t.prototype.attachControl = function(e, n) {\n            n = Xe.b.BackCompatCameraNoPreventDefault(arguments), this.inputs.attachElement(n), this._reset = function() {\n            };\n          }, t.prototype.detachControl = function(e) {\n            this.inputs.detachElement(), this._reset && this._reset();\n          }, t.prototype._checkInputs = function() {\n            this.inputs.checkInputs(), this._checkLimits(), r.prototype._checkInputs.call(this), this.lockedTarget && this._follow(this.lockedTarget);\n          }, t.prototype._checkLimits = function() {\n            this.lowerRadiusLimit !== null && this.radius < this.lowerRadiusLimit && (this.radius = this.lowerRadiusLimit), this.upperRadiusLimit !== null && this.radius > this.upperRadiusLimit && (this.radius = this.upperRadiusLimit), this.lowerHeightOffsetLimit !== null && this.heightOffset < this.lowerHeightOffsetLimit && (this.heightOffset = this.lowerHeightOffsetLimit), this.upperHeightOffsetLimit !== null && this.heightOffset > this.upperHeightOffsetLimit && (this.heightOffset = this.upperHeightOffsetLimit), this.lowerRotationOffsetLimit !== null && this.rotationOffset < this.lowerRotationOffsetLimit && (this.rotationOffset = this.lowerRotationOffsetLimit), this.upperRotationOffsetLimit !== null && this.rotationOffset > this.upperRotationOffsetLimit && (this.rotationOffset = this.upperRotationOffsetLimit);\n          }, t.prototype.getClassName = function() {\n            return \"FollowCamera\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperRadiusLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"rotationOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerRotationOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperRotationOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"heightOffset\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lowerHeightOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"upperHeightOffsetLimit\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"cameraAcceleration\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"maxCameraSpeed\", void 0), Object(c.c)([Object(L.k)(\"lockedTargetId\")], t.prototype, \"lockedTarget\", void 0), t;\n        }(xi), cl = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, u.e.Zero(), s) || this;\n            return d.alpha = n, d.beta = i, d.radius = o, d._cartesianCoordinates = u.e.Zero(), d._meshTarget = a, d._follow(), d;\n          }\n          return Object(c.d)(t, r), t.prototype._follow = function() {\n            if (this._meshTarget) {\n              this._cartesianCoordinates.x = this.radius * Math.cos(this.alpha) * Math.cos(this.beta), this._cartesianCoordinates.y = this.radius * Math.sin(this.beta), this._cartesianCoordinates.z = this.radius * Math.sin(this.alpha) * Math.cos(this.beta);\n              var e = this._meshTarget.getAbsolutePosition();\n              this.position = e.add(this._cartesianCoordinates), this.setTarget(e);\n            }\n          }, t.prototype._checkInputs = function() {\n            r.prototype._checkInputs.call(this), this._follow();\n          }, t.prototype.getClassName = function() {\n            return \"ArcFollowCamera\";\n          }, t;\n        }(xi), Za = f(38), dn = f(39);\n        (function(r) {\n          r[r.VIVE = 0] = \"VIVE\", r[r.OCULUS = 1] = \"OCULUS\", r[r.WINDOWS = 2] = \"WINDOWS\", r[r.GEAR_VR = 3] = \"GEAR_VR\", r[r.DAYDREAM = 4] = \"DAYDREAM\", r[r.GENERIC = 5] = \"GENERIC\";\n        })(Jn || (Jn = {}));\n        var xn, Wi, Ci = function() {\n          function r() {\n          }\n          return r.InitiateController = function(t) {\n            for (var e = 0, n = this._ControllerFactories; e < n.length; e++) {\n              var i = n[e];\n              if (i.canCreate(t))\n                return i.create(t);\n            }\n            if (this._DefaultControllerFactory)\n              return this._DefaultControllerFactory(t);\n            throw \"The type of gamepad you are trying to load needs to be imported first or is not supported.\";\n          }, r._ControllerFactories = [], r._DefaultControllerFactory = null, r;\n        }(), ar = function(r) {\n          function t(e) {\n            var n = r.call(this, e.id, e.index, e) || this;\n            return n.isXR = !1, n._deviceRoomPosition = u.e.Zero(), n._deviceRoomRotationQuaternion = new u.b(), n.devicePosition = u.e.Zero(), n.deviceRotationQuaternion = new u.b(), n.deviceScaleFactor = 1, n._trackPosition = !0, n._maxRotationDistFromHeadset = Math.PI / 5, n._draggedRoomRotation = 0, n._leftHandSystemQuaternion = new u.b(), n._deviceToWorld = u.a.Identity(), n._pointingPoseNode = null, n._workingMatrix = u.a.Identity(), n._meshAttachedObservable = new C.c(), n.type = hn.POSE_ENABLED, n.controllerType = Jn.GENERIC, n.position = u.e.Zero(), n.rotationQuaternion = new u.b(), n._calculatedPosition = u.e.Zero(), n._calculatedRotation = new u.b(), u.b.RotationYawPitchRollToRef(Math.PI, 0, 0, n._leftHandSystemQuaternion), n;\n          }\n          return Object(c.d)(t, r), t.prototype._disableTrackPosition = function(e) {\n            this._trackPosition && (this._calculatedPosition.copyFrom(e), this._trackPosition = !1);\n          }, t.prototype.update = function() {\n            r.prototype.update.call(this), this._updatePoseAndMesh();\n          }, t.prototype._updatePoseAndMesh = function() {\n            if (!this.isXR) {\n              var e = this.browserGamepad.pose;\n              if (this.updateFromDevice(e), !this._trackPosition && te.a.LastCreatedScene && te.a.LastCreatedScene.activeCamera && te.a.LastCreatedScene.activeCamera.devicePosition && ((n = te.a.LastCreatedScene.activeCamera)._computeDevicePosition(), this._deviceToWorld.setTranslation(n.devicePosition), n.deviceRotationQuaternion)) {\n                var n;\n                (n = n)._deviceRoomRotationQuaternion.toEulerAnglesToRef(u.c.Vector3[0]);\n                var i = Math.atan2(Math.sin(u.c.Vector3[0].y - this._draggedRoomRotation), Math.cos(u.c.Vector3[0].y - this._draggedRoomRotation));\n                if (Math.abs(i) > this._maxRotationDistFromHeadset) {\n                  var o = i - (i < 0 ? -this._maxRotationDistFromHeadset : this._maxRotationDistFromHeadset);\n                  this._draggedRoomRotation += o;\n                  var a = Math.sin(-o), s = Math.cos(-o);\n                  this._calculatedPosition.x = this._calculatedPosition.x * s - this._calculatedPosition.z * a, this._calculatedPosition.z = this._calculatedPosition.x * a + this._calculatedPosition.z * s;\n                }\n              }\n              u.e.TransformCoordinatesToRef(this._calculatedPosition, this._deviceToWorld, this.devicePosition), this._deviceToWorld.getRotationMatrixToRef(this._workingMatrix), u.b.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this.deviceRotationQuaternion.multiplyInPlace(this._calculatedRotation), this._mesh && (this._mesh.position.copyFrom(this.devicePosition), this._mesh.rotationQuaternion && this._mesh.rotationQuaternion.copyFrom(this.deviceRotationQuaternion));\n            }\n          }, t.prototype.updateFromDevice = function(e) {\n            if (!this.isXR && e) {\n              this.rawPose = e, e.position && (this._deviceRoomPosition.copyFromFloats(e.position[0], e.position[1], -e.position[2]), this._mesh && this._mesh.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1), this._trackPosition && this._deviceRoomPosition.scaleToRef(this.deviceScaleFactor, this._calculatedPosition), this._calculatedPosition.addInPlace(this.position));\n              var n = this.rawPose;\n              e.orientation && n.orientation && n.orientation.length === 4 && (this._deviceRoomRotationQuaternion.copyFromFloats(n.orientation[0], n.orientation[1], -n.orientation[2], -n.orientation[3]), this._mesh && (this._mesh.getScene().useRightHandedSystem ? (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1) : this._deviceRoomRotationQuaternion.multiplyToRef(this._leftHandSystemQuaternion, this._deviceRoomRotationQuaternion)), this._deviceRoomRotationQuaternion.multiplyToRef(this.rotationQuaternion, this._calculatedRotation));\n            }\n          }, t.prototype.attachToMesh = function(e) {\n            if (this._mesh && (this._mesh.parent = null), this._mesh = e, this._poseControlledCamera && (this._mesh.parent = this._poseControlledCamera), this._mesh.rotationQuaternion || (this._mesh.rotationQuaternion = new u.b()), !this.isXR && (this._updatePoseAndMesh(), this._pointingPoseNode)) {\n              for (var n = [], i = this._pointingPoseNode; i.parent; )\n                n.push(i.parent), i = i.parent;\n              n.reverse().forEach(function(o) {\n                o.computeWorldMatrix(!0);\n              });\n            }\n            this._meshAttachedObservable.notifyObservers(e);\n          }, t.prototype.attachToPoseControlledCamera = function(e) {\n            this._poseControlledCamera = e, this._mesh && (this._mesh.parent = this._poseControlledCamera);\n          }, t.prototype.dispose = function() {\n            this._mesh && this._mesh.dispose(), this._mesh = null, r.prototype.dispose.call(this);\n          }, Object.defineProperty(t.prototype, \"mesh\", { get: function() {\n            return this._mesh;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getForwardRay = function(e) {\n            if (e === void 0 && (e = 100), !this.mesh)\n              return new dn.a(u.e.Zero(), new u.e(0, 0, 1), e);\n            var n = this._pointingPoseNode ? this._pointingPoseNode.getWorldMatrix() : this.mesh.getWorldMatrix(), i = n.getTranslation(), o = new u.e(0, 0, -1), a = u.e.TransformNormal(o, n), s = u.e.Normalize(a);\n            return new dn.a(i, s, e);\n          }, t.POINTING_POSE = \"POINTING_POSE\", t;\n        }(hn);\n        (function(r) {\n          r[r.A = 0] = \"A\", r[r.B = 1] = \"B\", r[r.X = 2] = \"X\", r[r.Y = 3] = \"Y\", r[r.LB = 4] = \"LB\", r[r.RB = 5] = \"RB\", r[r.Back = 8] = \"Back\", r[r.Start = 9] = \"Start\", r[r.LeftStick = 10] = \"LeftStick\", r[r.RightStick = 11] = \"RightStick\";\n        })(xn || (xn = {})), function(r) {\n          r[r.Up = 12] = \"Up\", r[r.Down = 13] = \"Down\", r[r.Left = 14] = \"Left\", r[r.Right = 15] = \"Right\";\n        }(Wi || (Wi = {}));\n        var Vn, Xi, ll = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = r.call(this, e, n, i, 0, 1, 2, 3) || this;\n            return a._leftTrigger = 0, a._rightTrigger = 0, a.onButtonDownObservable = new C.c(), a.onButtonUpObservable = new C.c(), a.onPadDownObservable = new C.c(), a.onPadUpObservable = new C.c(), a._buttonA = 0, a._buttonB = 0, a._buttonX = 0, a._buttonY = 0, a._buttonBack = 0, a._buttonStart = 0, a._buttonLB = 0, a._buttonRB = 0, a._buttonLeftStick = 0, a._buttonRightStick = 0, a._dPadUp = 0, a._dPadDown = 0, a._dPadLeft = 0, a._dPadRight = 0, a._isXboxOnePad = !1, a.type = hn.XBOX, a._isXboxOnePad = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.onlefttriggerchanged = function(e) {\n            this._onlefttriggerchanged = e;\n          }, t.prototype.onrighttriggerchanged = function(e) {\n            this._onrighttriggerchanged = e;\n          }, Object.defineProperty(t.prototype, \"leftTrigger\", { get: function() {\n            return this._leftTrigger;\n          }, set: function(e) {\n            this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rightTrigger\", { get: function() {\n            return this._rightTrigger;\n          }, set: function(e) {\n            this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.onbuttondown = function(e) {\n            this._onbuttondown = e;\n          }, t.prototype.onbuttonup = function(e) {\n            this._onbuttonup = e;\n          }, t.prototype.ondpaddown = function(e) {\n            this._ondpaddown = e;\n          }, t.prototype.ondpadup = function(e) {\n            this._ondpadup = e;\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), e === 0 && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e;\n          }, t.prototype._setDPadValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._ondpaddown && this._ondpaddown(i), this.onPadDownObservable.notifyObservers(i)), e === 0 && (this._ondpadup && this._ondpadup(i), this.onPadUpObservable.notifyObservers(i))), e;\n          }, Object.defineProperty(t.prototype, \"buttonA\", { get: function() {\n            return this._buttonA;\n          }, set: function(e) {\n            this._buttonA = this._setButtonValue(e, this._buttonA, xn.A);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonB\", { get: function() {\n            return this._buttonB;\n          }, set: function(e) {\n            this._buttonB = this._setButtonValue(e, this._buttonB, xn.B);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonX\", { get: function() {\n            return this._buttonX;\n          }, set: function(e) {\n            this._buttonX = this._setButtonValue(e, this._buttonX, xn.X);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonY\", { get: function() {\n            return this._buttonY;\n          }, set: function(e) {\n            this._buttonY = this._setButtonValue(e, this._buttonY, xn.Y);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonStart\", { get: function() {\n            return this._buttonStart;\n          }, set: function(e) {\n            this._buttonStart = this._setButtonValue(e, this._buttonStart, xn.Start);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonBack\", { get: function() {\n            return this._buttonBack;\n          }, set: function(e) {\n            this._buttonBack = this._setButtonValue(e, this._buttonBack, xn.Back);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonLB\", { get: function() {\n            return this._buttonLB;\n          }, set: function(e) {\n            this._buttonLB = this._setButtonValue(e, this._buttonLB, xn.LB);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonRB\", { get: function() {\n            return this._buttonRB;\n          }, set: function(e) {\n            this._buttonRB = this._setButtonValue(e, this._buttonRB, xn.RB);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonLeftStick\", { get: function() {\n            return this._buttonLeftStick;\n          }, set: function(e) {\n            this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, xn.LeftStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonRightStick\", { get: function() {\n            return this._buttonRightStick;\n          }, set: function(e) {\n            this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, xn.RightStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadUp\", { get: function() {\n            return this._dPadUp;\n          }, set: function(e) {\n            this._dPadUp = this._setDPadValue(e, this._dPadUp, Wi.Up);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadDown\", { get: function() {\n            return this._dPadDown;\n          }, set: function(e) {\n            this._dPadDown = this._setDPadValue(e, this._dPadDown, Wi.Down);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadLeft\", { get: function() {\n            return this._dPadLeft;\n          }, set: function(e) {\n            this._dPadLeft = this._setDPadValue(e, this._dPadLeft, Wi.Left);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadRight\", { get: function() {\n            return this._dPadRight;\n          }, set: function(e) {\n            this._dPadRight = this._setDPadValue(e, this._dPadRight, Wi.Right);\n          }, enumerable: !1, configurable: !0 }), t.prototype.update = function() {\n            r.prototype.update.call(this), this._isXboxOnePad, this.buttonA = this.browserGamepad.buttons[0].value, this.buttonB = this.browserGamepad.buttons[1].value, this.buttonX = this.browserGamepad.buttons[2].value, this.buttonY = this.browserGamepad.buttons[3].value, this.buttonLB = this.browserGamepad.buttons[4].value, this.buttonRB = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonBack = this.browserGamepad.buttons[8].value, this.buttonStart = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();\n          }, t;\n        }(hn);\n        (function(r) {\n          r[r.Cross = 0] = \"Cross\", r[r.Circle = 1] = \"Circle\", r[r.Square = 2] = \"Square\", r[r.Triangle = 3] = \"Triangle\", r[r.L1 = 4] = \"L1\", r[r.R1 = 5] = \"R1\", r[r.Share = 8] = \"Share\", r[r.Options = 9] = \"Options\", r[r.LeftStick = 10] = \"LeftStick\", r[r.RightStick = 11] = \"RightStick\";\n        })(Vn || (Vn = {})), function(r) {\n          r[r.Up = 12] = \"Up\", r[r.Down = 13] = \"Down\", r[r.Left = 14] = \"Left\", r[r.Right = 15] = \"Right\";\n        }(Xi || (Xi = {}));\n        var ul = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e.replace(\"STANDARD GAMEPAD\", \"SONY PLAYSTATION DUALSHOCK\"), n, i, 0, 1, 2, 3) || this;\n            return o._leftTrigger = 0, o._rightTrigger = 0, o.onButtonDownObservable = new C.c(), o.onButtonUpObservable = new C.c(), o.onPadDownObservable = new C.c(), o.onPadUpObservable = new C.c(), o._buttonCross = 0, o._buttonCircle = 0, o._buttonSquare = 0, o._buttonTriangle = 0, o._buttonShare = 0, o._buttonOptions = 0, o._buttonL1 = 0, o._buttonR1 = 0, o._buttonLeftStick = 0, o._buttonRightStick = 0, o._dPadUp = 0, o._dPadDown = 0, o._dPadLeft = 0, o._dPadRight = 0, o.type = hn.DUALSHOCK, o;\n          }\n          return Object(c.d)(t, r), t.prototype.onlefttriggerchanged = function(e) {\n            this._onlefttriggerchanged = e;\n          }, t.prototype.onrighttriggerchanged = function(e) {\n            this._onrighttriggerchanged = e;\n          }, Object.defineProperty(t.prototype, \"leftTrigger\", { get: function() {\n            return this._leftTrigger;\n          }, set: function(e) {\n            this._onlefttriggerchanged && this._leftTrigger !== e && this._onlefttriggerchanged(e), this._leftTrigger = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rightTrigger\", { get: function() {\n            return this._rightTrigger;\n          }, set: function(e) {\n            this._onrighttriggerchanged && this._rightTrigger !== e && this._onrighttriggerchanged(e), this._rightTrigger = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.onbuttondown = function(e) {\n            this._onbuttondown = e;\n          }, t.prototype.onbuttonup = function(e) {\n            this._onbuttonup = e;\n          }, t.prototype.ondpaddown = function(e) {\n            this._ondpaddown = e;\n          }, t.prototype.ondpadup = function(e) {\n            this._ondpadup = e;\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._onbuttondown && this._onbuttondown(i), this.onButtonDownObservable.notifyObservers(i)), e === 0 && (this._onbuttonup && this._onbuttonup(i), this.onButtonUpObservable.notifyObservers(i))), e;\n          }, t.prototype._setDPadValue = function(e, n, i) {\n            return e !== n && (e === 1 && (this._ondpaddown && this._ondpaddown(i), this.onPadDownObservable.notifyObservers(i)), e === 0 && (this._ondpadup && this._ondpadup(i), this.onPadUpObservable.notifyObservers(i))), e;\n          }, Object.defineProperty(t.prototype, \"buttonCross\", { get: function() {\n            return this._buttonCross;\n          }, set: function(e) {\n            this._buttonCross = this._setButtonValue(e, this._buttonCross, Vn.Cross);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonCircle\", { get: function() {\n            return this._buttonCircle;\n          }, set: function(e) {\n            this._buttonCircle = this._setButtonValue(e, this._buttonCircle, Vn.Circle);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonSquare\", { get: function() {\n            return this._buttonSquare;\n          }, set: function(e) {\n            this._buttonSquare = this._setButtonValue(e, this._buttonSquare, Vn.Square);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonTriangle\", { get: function() {\n            return this._buttonTriangle;\n          }, set: function(e) {\n            this._buttonTriangle = this._setButtonValue(e, this._buttonTriangle, Vn.Triangle);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonOptions\", { get: function() {\n            return this._buttonOptions;\n          }, set: function(e) {\n            this._buttonOptions = this._setButtonValue(e, this._buttonOptions, Vn.Options);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonShare\", { get: function() {\n            return this._buttonShare;\n          }, set: function(e) {\n            this._buttonShare = this._setButtonValue(e, this._buttonShare, Vn.Share);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonL1\", { get: function() {\n            return this._buttonL1;\n          }, set: function(e) {\n            this._buttonL1 = this._setButtonValue(e, this._buttonL1, Vn.L1);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonR1\", { get: function() {\n            return this._buttonR1;\n          }, set: function(e) {\n            this._buttonR1 = this._setButtonValue(e, this._buttonR1, Vn.R1);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonLeftStick\", { get: function() {\n            return this._buttonLeftStick;\n          }, set: function(e) {\n            this._buttonLeftStick = this._setButtonValue(e, this._buttonLeftStick, Vn.LeftStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"buttonRightStick\", { get: function() {\n            return this._buttonRightStick;\n          }, set: function(e) {\n            this._buttonRightStick = this._setButtonValue(e, this._buttonRightStick, Vn.RightStick);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadUp\", { get: function() {\n            return this._dPadUp;\n          }, set: function(e) {\n            this._dPadUp = this._setDPadValue(e, this._dPadUp, Xi.Up);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadDown\", { get: function() {\n            return this._dPadDown;\n          }, set: function(e) {\n            this._dPadDown = this._setDPadValue(e, this._dPadDown, Xi.Down);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadLeft\", { get: function() {\n            return this._dPadLeft;\n          }, set: function(e) {\n            this._dPadLeft = this._setDPadValue(e, this._dPadLeft, Xi.Left);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dPadRight\", { get: function() {\n            return this._dPadRight;\n          }, set: function(e) {\n            this._dPadRight = this._setDPadValue(e, this._dPadRight, Xi.Right);\n          }, enumerable: !1, configurable: !0 }), t.prototype.update = function() {\n            r.prototype.update.call(this), this.buttonCross = this.browserGamepad.buttons[0].value, this.buttonCircle = this.browserGamepad.buttons[1].value, this.buttonSquare = this.browserGamepad.buttons[2].value, this.buttonTriangle = this.browserGamepad.buttons[3].value, this.buttonL1 = this.browserGamepad.buttons[4].value, this.buttonR1 = this.browserGamepad.buttons[5].value, this.leftTrigger = this.browserGamepad.buttons[6].value, this.rightTrigger = this.browserGamepad.buttons[7].value, this.buttonShare = this.browserGamepad.buttons[8].value, this.buttonOptions = this.browserGamepad.buttons[9].value, this.buttonLeftStick = this.browserGamepad.buttons[10].value, this.buttonRightStick = this.browserGamepad.buttons[11].value, this.dPadUp = this.browserGamepad.buttons[12].value, this.dPadDown = this.browserGamepad.buttons[13].value, this.dPadLeft = this.browserGamepad.buttons[14].value, this.dPadRight = this.browserGamepad.buttons[15].value;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onButtonDownObservable.clear(), this.onButtonUpObservable.clear(), this.onPadDownObservable.clear(), this.onPadUpObservable.clear();\n          }, t;\n        }(hn), hl = function() {\n          function r(t) {\n            var e = this;\n            if (this._scene = t, this._babylonGamepads = [], this._oneGamepadConnected = !1, this._isMonitoring = !1, this.onGamepadDisconnectedObservable = new C.c(), Za.a.IsWindowObjectExist() ? (this._gamepadEventSupported = \"GamepadEvent\" in window, this._gamepadSupport = navigator.getGamepads || navigator.webkitGetGamepads || navigator.msGetGamepads || navigator.webkitGamepads) : this._gamepadEventSupported = !1, this.onGamepadConnectedObservable = new C.c(function(i) {\n              for (var o in e._babylonGamepads) {\n                var a = e._babylonGamepads[o];\n                a && a._isConnected && e.onGamepadConnectedObservable.notifyObserver(i, a);\n              }\n            }), this._onGamepadConnectedEvent = function(i) {\n              var o, a = i.gamepad;\n              a.index in e._babylonGamepads && e._babylonGamepads[a.index].isConnected || (e._babylonGamepads[a.index] ? ((o = e._babylonGamepads[a.index]).browserGamepad = a, o._isConnected = !0) : o = e._addNewGamepad(a), e.onGamepadConnectedObservable.notifyObservers(o), e._startMonitoringGamepads());\n            }, this._onGamepadDisconnectedEvent = function(i) {\n              var o = i.gamepad;\n              for (var a in e._babylonGamepads)\n                if (e._babylonGamepads[a].index === o.index) {\n                  var s = e._babylonGamepads[a];\n                  s._isConnected = !1, e.onGamepadDisconnectedObservable.notifyObservers(s), s.dispose && s.dispose();\n                  break;\n                }\n            }, this._gamepadSupport)\n              if (this._updateGamepadObjects(), this._babylonGamepads.length && this._startMonitoringGamepads(), this._gamepadEventSupported) {\n                var n = this._scene ? this._scene.getEngine().getHostWindow() : window;\n                n && (n.addEventListener(\"gamepadconnected\", this._onGamepadConnectedEvent, !1), n.addEventListener(\"gamepaddisconnected\", this._onGamepadDisconnectedEvent, !1));\n              } else\n                this._startMonitoringGamepads();\n          }\n          return Object.defineProperty(r.prototype, \"gamepads\", { get: function() {\n            return this._babylonGamepads;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getGamepadByType = function(t) {\n            t === void 0 && (t = hn.XBOX);\n            for (var e = 0, n = this._babylonGamepads; e < n.length; e++) {\n              var i = n[e];\n              if (i && i.type === t)\n                return i;\n            }\n            return null;\n          }, r.prototype.dispose = function() {\n            this._gamepadEventSupported && (this._onGamepadConnectedEvent && window.removeEventListener(\"gamepadconnected\", this._onGamepadConnectedEvent), this._onGamepadDisconnectedEvent && window.removeEventListener(\"gamepaddisconnected\", this._onGamepadDisconnectedEvent), this._onGamepadConnectedEvent = null, this._onGamepadDisconnectedEvent = null), this._babylonGamepads.forEach(function(t) {\n              t.dispose();\n            }), this.onGamepadConnectedObservable.clear(), this.onGamepadDisconnectedObservable.clear(), this._oneGamepadConnected = !1, this._stopMonitoringGamepads(), this._babylonGamepads = [];\n          }, r.prototype._addNewGamepad = function(t) {\n            var e;\n            this._oneGamepadConnected || (this._oneGamepadConnected = !0);\n            var n = t.id.search(\"054c\") !== -1, i = t.id.search(\"Xbox One\") !== -1;\n            return e = i || t.id.search(\"Xbox 360\") !== -1 || t.id.search(\"xinput\") !== -1 ? new ll(t.id, t.index, t, i) : n ? new ul(t.id, t.index, t) : t.pose ? Ci.InitiateController(t) : new nl(t.id, t.index, t), this._babylonGamepads[e.index] = e, e;\n          }, r.prototype._startMonitoringGamepads = function() {\n            this._isMonitoring || (this._isMonitoring = !0, this._scene || this._checkGamepadsStatus());\n          }, r.prototype._stopMonitoringGamepads = function() {\n            this._isMonitoring = !1;\n          }, r.prototype._checkGamepadsStatus = function() {\n            var t = this;\n            for (var e in this._updateGamepadObjects(), this._babylonGamepads) {\n              var n = this._babylonGamepads[e];\n              n && n.isConnected && n.update();\n            }\n            this._isMonitoring && !this._scene && Ue.a.QueueNewFrame(function() {\n              t._checkGamepadsStatus();\n            });\n          }, r.prototype._updateGamepadObjects = function() {\n            for (var t = navigator.getGamepads ? navigator.getGamepads() : navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : [], e = 0; e < t.length; e++) {\n              var n = t[e];\n              if (n)\n                if (this._babylonGamepads[n.index])\n                  this._babylonGamepads[e].browserGamepad = n, this._babylonGamepads[e].isConnected || (this._babylonGamepads[e]._isConnected = !0, this.onGamepadConnectedObservable.notifyObservers(this._babylonGamepads[e]));\n                else {\n                  var i = this._addNewGamepad(n);\n                  this.onGamepadConnectedObservable.notifyObservers(i);\n                }\n            }\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"gamepadManager\", { get: function() {\n          if (!this._gamepadManager) {\n            this._gamepadManager = new hl(this);\n            var r = this._getComponent(ot.a.NAME_GAMEPAD);\n            r || (r = new dl(this), this._addComponent(r));\n          }\n          return this._gamepadManager;\n        }, enumerable: !0, configurable: !0 }), jr.prototype.addGamepad = function() {\n          return this.add(new Ya()), this;\n        }, Po.prototype.addGamepad = function() {\n          return this.add(new Da()), this;\n        };\n        var dl = function() {\n          function r(t) {\n            this.name = ot.a.NAME_GAMEPAD, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraUpdateStage.registerStep(ot.a.STEP_BEFORECAMERAUPDATE_GAMEPAD, this, this._beforeCameraUpdate);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            var t = this.scene._gamepadManager;\n            t && (t.dispose(), this.scene._gamepadManager = null);\n          }, r.prototype._beforeCameraUpdate = function() {\n            var t = this.scene._gamepadManager;\n            t && t._isMonitoring && t._checkGamepadsStatus();\n          }, r;\n        }();\n        Q.a.AddNodeConstructor(\"FreeCamera\", function(r, t) {\n          return function() {\n            return new sr(r, u.e.Zero(), t);\n          };\n        });\n        var sr = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.inputs.addGamepad(), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"gamepadAngularSensibility\", { get: function() {\n            var e = this.inputs.attached.gamepad;\n            return e ? e.gamepadAngularSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.gamepad;\n            n && (n.gamepadAngularSensibility = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"gamepadMoveSensibility\", { get: function() {\n            var e = this.inputs.attached.gamepad;\n            return e ? e.gamepadMoveSensibility : 0;\n          }, set: function(e) {\n            var n = this.inputs.attached.gamepad;\n            n && (n.gamepadMoveSensibility = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"UniversalCamera\";\n          }, t;\n        }(qa);\n        _t.a._createDefaultParsedCamera = function(r, t) {\n          return new sr(r, u.e.Zero(), t);\n        }, Q.a.AddNodeConstructor(\"GamepadCamera\", function(r, t) {\n          return function() {\n            return new Co(r, u.e.Zero(), t);\n          };\n        });\n        var Co = function(r) {\n          function t(e, n, i) {\n            return r.call(this, e, n, i) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"GamepadCamera\";\n          }, t;\n        }(sr), si = f(33), ze = f(5), vf = `\nattribute vec2 position;\nuniform vec2 scale;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd)*scale;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.postprocessVertexShader = vf;\n        var fl = f(102);\n        wt.a.prototype.createRenderTargetTexture = function(r, t) {\n          var e = new fl.a();\n          t !== void 0 && typeof t == \"object\" ? (e.generateMipMaps = t.generateMipMaps, e.generateDepthBuffer = !!t.generateDepthBuffer, e.generateStencilBuffer = !!t.generateStencilBuffer, e.type = t.type === void 0 ? h.a.TEXTURETYPE_UNSIGNED_INT : t.type, e.samplingMode = t.samplingMode === void 0 ? h.a.TEXTURE_TRILINEAR_SAMPLINGMODE : t.samplingMode, e.format = t.format === void 0 ? h.a.TEXTUREFORMAT_RGBA : t.format) : (e.generateMipMaps = t, e.generateDepthBuffer = !0, e.generateStencilBuffer = !1, e.type = h.a.TEXTURETYPE_UNSIGNED_INT, e.samplingMode = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, e.format = h.a.TEXTUREFORMAT_RGBA), (e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (e.type !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (e.samplingMode = h.a.TEXTURE_NEAREST_SAMPLINGMODE), e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (e.type = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\"));\n          var n = this._gl, i = new Pt.a(this, Pt.b.RenderTarget), o = r.width || r, a = r.height || r, s = r.layers || 0, d = this._getSamplingParameters(e.samplingMode, !!e.generateMipMaps), p = s !== 0 ? n.TEXTURE_2D_ARRAY : n.TEXTURE_2D, y = this._getRGBABufferInternalSizedFormat(e.type, e.format), P = this._getInternalFormat(e.format), R = this._getWebGLTextureType(e.type);\n          this._bindTextureDirectly(p, i), s !== 0 ? (i.is2DArray = !0, n.texImage3D(p, 0, y, o, a, s, 0, P, R, null)) : n.texImage2D(p, 0, y, o, a, 0, P, R, null), n.texParameteri(p, n.TEXTURE_MAG_FILTER, d.mag), n.texParameteri(p, n.TEXTURE_MIN_FILTER, d.min), n.texParameteri(p, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(p, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), e.generateMipMaps && this._gl.generateMipmap(p), this._bindTextureDirectly(p, null);\n          var B = this._currentFramebuffer, F = n.createFramebuffer();\n          return this._bindUnboundFramebuffer(F), i._depthStencilBuffer = this._setupFramebufferDepthAttachments(!!e.generateStencilBuffer, e.generateDepthBuffer, o, a), i.is2DArray || n.framebufferTexture2D(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, i._webGLTexture, 0), this._bindUnboundFramebuffer(B), i._framebuffer = F, i.baseWidth = o, i.baseHeight = a, i.width = o, i.height = a, i.depth = s, i.isReady = !0, i.samples = 1, i.generateMipMaps = !!e.generateMipMaps, i.samplingMode = e.samplingMode, i.type = e.type, i.format = e.format, i._generateDepthBuffer = e.generateDepthBuffer, i._generateStencilBuffer = !!e.generateStencilBuffer, this._internalTexturesCache.push(i), i;\n        }, wt.a.prototype.createDepthStencilTexture = function(r, t) {\n          if (t.isCube) {\n            var e = r.width || r;\n            return this._createDepthStencilCubeTexture(e, t);\n          }\n          return this._createDepthStencilTexture(r, t);\n        }, wt.a.prototype._createDepthStencilTexture = function(r, t) {\n          var e = this._gl, n = r.layers || 0, i = n !== 0 ? e.TEXTURE_2D_ARRAY : e.TEXTURE_2D, o = new Pt.a(this, Pt.b.Depth);\n          if (!this._caps.depthTextureExtension)\n            return l.a.Error(\"Depth texture is not supported by your browser or hardware.\"), o;\n          var a = Object(c.a)({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1 }, t);\n          this._bindTextureDirectly(i, o, !0), this._setupDepthStencilTexture(o, r, a.generateStencil, a.bilinearFiltering, a.comparisonFunction);\n          var s = a.generateStencil ? e.UNSIGNED_INT_24_8 : e.UNSIGNED_INT, d = a.generateStencil ? e.DEPTH_STENCIL : e.DEPTH_COMPONENT, p = d;\n          return this.webGLVersion > 1 && (p = a.generateStencil ? e.DEPTH24_STENCIL8 : e.DEPTH_COMPONENT24), o.is2DArray ? e.texImage3D(i, 0, p, o.width, o.height, n, 0, d, s, null) : e.texImage2D(i, 0, p, o.width, o.height, 0, d, s, null), this._bindTextureDirectly(i, null), o;\n        };\n        var ft = function() {\n          function r(t, e, n, i, o, a, s, d, p, y, P, R, B, F, z) {\n            s === void 0 && (s = h.a.TEXTURE_NEAREST_SAMPLINGMODE), y === void 0 && (y = null), P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT), R === void 0 && (R = \"postprocess\"), F === void 0 && (F = !1), z === void 0 && (z = h.a.TEXTUREFORMAT_RGBA), this.width = -1, this.height = -1, this.nodeMaterialSource = null, this._outputTexture = null, this.autoClear = !0, this.alphaMode = h.a.ALPHA_DISABLE, this.animations = new Array(), this.enablePixelPerfectMode = !1, this.forceFullscreenViewport = !0, this.scaleMode = h.a.SCALEMODE_FLOOR, this.alwaysForcePOT = !1, this._samples = 1, this.adaptScaleToCurrentViewport = !1, this._reusable = !1, this._textures = new si.a(2), this._currentRenderTextureInd = 0, this._scaleRatio = new u.d(1, 1), this._texelSize = u.d.Zero(), this.onActivateObservable = new C.c(), this.onSizeChangedObservable = new C.c(), this.onApplyObservable = new C.c(), this.onBeforeRenderObservable = new C.c(), this.onAfterRenderObservable = new C.c(), this.name = t, a != null ? (this._camera = a, this._scene = a.getScene(), a.attachPostProcess(this), this._engine = this._scene.getEngine(), this._scene.postProcesses.push(this), this.uniqueId = this._scene.getUniqueId()) : d && (this._engine = d, this._engine.postProcesses.push(this)), this._options = o, this.renderTargetSamplingMode = s || h.a.TEXTURE_NEAREST_SAMPLINGMODE, this._reusable = p || !1, this._textureType = P, this._textureFormat = z, this._samplers = i || [], this._samplers.push(\"textureSampler\"), this._fragmentUrl = e, this._vertexUrl = R, this._parameters = n || [], this._parameters.push(\"scale\"), this._indexParameters = B, F || this.updateEffect(y);\n          }\n          return Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(t) {\n            var e = this;\n            this._samples = Math.min(t, this._engine.getCaps().maxMSAASamples), this._textures.forEach(function(n) {\n              n.samples !== e._samples && e._engine.updateRenderTargetTextureSampleCount(n, e._samples);\n            });\n          }, enumerable: !1, configurable: !0 }), r.prototype.getEffectName = function() {\n            return this._fragmentUrl;\n          }, Object.defineProperty(r.prototype, \"onActivate\", { set: function(t) {\n            this._onActivateObserver && this.onActivateObservable.remove(this._onActivateObserver), t && (this._onActivateObserver = this.onActivateObservable.add(t));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onSizeChanged\", { set: function(t) {\n            this._onSizeChangedObserver && this.onSizeChangedObservable.remove(this._onSizeChangedObserver), this._onSizeChangedObserver = this.onSizeChangedObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onApply\", { set: function(t) {\n            this._onApplyObserver && this.onApplyObservable.remove(this._onApplyObserver), this._onApplyObserver = this.onApplyObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onBeforeRender\", { set: function(t) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onAfterRender\", { set: function(t) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"inputTexture\", { get: function() {\n            return this._textures.data[this._currentRenderTextureInd];\n          }, set: function(t) {\n            this._forcedOutputTexture = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.restoreDefaultInputTexture = function() {\n            this._forcedOutputTexture = null;\n          }, r.prototype.getCamera = function() {\n            return this._camera;\n          }, Object.defineProperty(r.prototype, \"texelSize\", { get: function() {\n            return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.texelSize : (this._forcedOutputTexture && this._texelSize.copyFromFloats(1 / this._forcedOutputTexture.width, 1 / this._forcedOutputTexture.height), this._texelSize);\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"PostProcess\";\n          }, r.prototype.getEngine = function() {\n            return this._engine;\n          }, r.prototype.getEffect = function() {\n            return this._effect;\n          }, r.prototype.shareOutputWith = function(t) {\n            return this._disposeTextures(), this._shareOutputWithPostProcess = t, this;\n          }, r.prototype.useOwnOutput = function() {\n            this._textures.length == 0 && (this._textures = new si.a(2)), this._shareOutputWithPostProcess = null;\n          }, r.prototype.updateEffect = function(t, e, n, i, o, a, s, d) {\n            t === void 0 && (t = null), e === void 0 && (e = null), n === void 0 && (n = null), this._effect = this._engine.createEffect({ vertex: s ?? this._vertexUrl, fragment: d ?? this._fragmentUrl }, [\"position\"], e || this._parameters, n || this._samplers, t !== null ? t : \"\", void 0, o, a, i || this._indexParameters);\n          }, r.prototype.isReusable = function() {\n            return this._reusable;\n          }, r.prototype.markTextureDirty = function() {\n            this.width = -1;\n          }, r.prototype.activate = function(t, e, n) {\n            var i = this;\n            e === void 0 && (e = null);\n            var o = (t = t || this._camera).getScene(), a = o.getEngine(), s = a.getCaps().maxTextureSize, d = (e ? e.width : this._engine.getRenderWidth(!0)) * this._options | 0, p = (e ? e.height : this._engine.getRenderHeight(!0)) * this._options | 0, y = t.parent;\n            !y || y.leftCamera != t && y.rightCamera != t || (d /= 2);\n            var P, R = this._options.width || d, B = this._options.height || p, F = this.renderTargetSamplingMode !== h.a.TEXTURE_NEAREST_LINEAR && this.renderTargetSamplingMode !== h.a.TEXTURE_NEAREST_NEAREST && this.renderTargetSamplingMode !== h.a.TEXTURE_LINEAR_LINEAR;\n            if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\n              if (this.adaptScaleToCurrentViewport) {\n                var z = a.currentViewport;\n                z && (R *= z.width, B *= z.height);\n              }\n              if ((F || this.alwaysForcePOT) && (this._options.width || (R = a.needPOTTextures ? Ue.a.GetExponentOfTwo(R, s, this.scaleMode) : R), this._options.height || (B = a.needPOTTextures ? Ue.a.GetExponentOfTwo(B, s, this.scaleMode) : B)), this.width !== R || this.height !== B) {\n                if (this._textures.length > 0) {\n                  for (var J = 0; J < this._textures.length; J++)\n                    this._engine._releaseTexture(this._textures.data[J]);\n                  this._textures.reset();\n                }\n                this.width = R, this.height = B;\n                var ie = { width: this.width, height: this.height }, se = { generateMipMaps: F, generateDepthBuffer: n || t._postProcesses.indexOf(this) === 0, generateStencilBuffer: (n || t._postProcesses.indexOf(this) === 0) && this._engine.isStencilEnable, samplingMode: this.renderTargetSamplingMode, type: this._textureType, format: this._textureFormat };\n                this._textures.push(this._engine.createRenderTargetTexture(ie, se)), this._reusable && this._textures.push(this._engine.createRenderTargetTexture(ie, se)), this._texelSize.copyFromFloats(1 / this.width, 1 / this.height), this.onSizeChangedObservable.notifyObservers(this);\n              }\n              this._textures.forEach(function(ce) {\n                ce.samples !== i.samples && i._engine.updateRenderTargetTextureSampleCount(ce, i.samples);\n              });\n            }\n            return this._shareOutputWithPostProcess ? P = this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? (P = this._forcedOutputTexture, this.width = this._forcedOutputTexture.width, this.height = this._forcedOutputTexture.height) : P = this.inputTexture, this.enablePixelPerfectMode ? (this._scaleRatio.copyFromFloats(d / R, p / B), this._engine.bindFramebuffer(P, 0, d, p, this.forceFullscreenViewport)) : (this._scaleRatio.copyFromFloats(1, 1), this._engine.bindFramebuffer(P, 0, void 0, void 0, this.forceFullscreenViewport)), this.onActivateObservable.notifyObservers(t), this.autoClear && this.alphaMode === h.a.ALPHA_DISABLE && this._engine.clear(this.clearColor ? this.clearColor : o.clearColor, o._allowPostProcessClearColor, !0, !0), this._reusable && (this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2), P;\n          }, Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            return this._effect.isSupported;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"aspectRatio\", { get: function() {\n            return this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.aspectRatio : this._forcedOutputTexture ? this._forcedOutputTexture.width / this._forcedOutputTexture.height : this.width / this.height;\n          }, enumerable: !1, configurable: !0 }), r.prototype.isReady = function() {\n            return this._effect && this._effect.isReady();\n          }, r.prototype.apply = function() {\n            return this._effect && this._effect.isReady() ? (this._engine.enableEffect(this._effect), this._engine.setState(!1), this._engine.setDepthBuffer(!1), this._engine.setDepthWrite(!1), this._engine.setAlphaMode(this.alphaMode), this.alphaConstants && this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a), t = this._shareOutputWithPostProcess ? this._shareOutputWithPostProcess.inputTexture : this._forcedOutputTexture ? this._forcedOutputTexture : this.inputTexture, this._effect._bindTexture(\"textureSampler\", t), this._effect.setVector2(\"scale\", this._scaleRatio), this.onApplyObservable.notifyObservers(this._effect), this._effect) : null;\n            var t;\n          }, r.prototype._disposeTextures = function() {\n            if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\n              if (this._textures.length > 0)\n                for (var t = 0; t < this._textures.length; t++)\n                  this._engine._releaseTexture(this._textures.data[t]);\n              this._textures.dispose();\n            }\n          }, r.prototype.setPrePassRenderer = function(t) {\n            return !!this._prePassEffectConfiguration && (this._prePassEffectConfiguration = t.addEffectConfiguration(this._prePassEffectConfiguration), this._prePassEffectConfiguration.enabled = !0, !0);\n          }, r.prototype.dispose = function(t) {\n            var e;\n            if (t = t || this._camera, this._disposeTextures(), this._scene && (e = this._scene.postProcesses.indexOf(this)) !== -1 && this._scene.postProcesses.splice(e, 1), (e = this._engine.postProcesses.indexOf(this)) !== -1 && this._engine.postProcesses.splice(e, 1), t) {\n              if (t.detachPostProcess(this), (e = t._postProcesses.indexOf(this)) === 0 && t._postProcesses.length > 0) {\n                var n = this._camera._getFirstPostProcess();\n                n && n.markTextureDirty();\n              }\n              this.onActivateObservable.clear(), this.onAfterRenderObservable.clear(), this.onApplyObservable.clear(), this.onBeforeRenderObservable.clear(), this.onSizeChangedObservable.clear();\n            }\n          }, r.prototype.serialize = function() {\n            var t = L.a.Serialize(this);\n            return t.customType = \"BABYLON.\" + this.getClassName(), t.cameraId = this.getCamera().id, t.reusable = this._reusable, t.options = this._options, t.textureType = this._textureType, t;\n          }, r.Parse = function(t, e, n) {\n            var i = O.a.GetClass(t.customType);\n            if (!i || !i._Parse)\n              return null;\n            var o = e.getCameraByID(t.cameraId);\n            return o ? i._Parse(t, o, e, n) : null;\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"uniqueId\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"name\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"width\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"height\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"renderTargetSamplingMode\", void 0), Object(c.c)([Object(L.f)()], r.prototype, \"clearColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"autoClear\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"alphaMode\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"alphaConstants\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"enablePixelPerfectMode\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"forceFullscreenViewport\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"scaleMode\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"alwaysForcePOT\", void 0), Object(c.c)([Object(L.c)(\"samples\")], r.prototype, \"_samples\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"adaptScaleToCurrentViewport\", void 0), r;\n        }();\n        O.a.RegisteredTypes[\"BABYLON.PostProcess\"] = ft;\n        var yf = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\n}`;\n        ze.a.ShadersStore.passPixelShader = yf;\n        var bf = `\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nvoid main(void)\n{\nvec2 uv=vUV*2.0-1.0;\n#ifdef POSITIVEX\ngl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));\n#endif\n#ifdef NEGATIVEX\ngl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));\n#endif\n#ifdef POSITIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));\n#endif\n#ifdef NEGATIVEY\ngl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));\n#endif\n#ifdef POSITIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,1.001));\n#endif\n#ifdef NEGATIVEZ\ngl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));\n#endif\n}`;\n        ze.a.ShadersStore.passCubePixelShader = bf;\n        var Ri = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            return i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1), r.call(this, e, \"pass\", null, null, n, i, o, a, s, void 0, d, void 0, null, p) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PassPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.PassPostProcess\"] = Ri;\n        var Tf = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"passCube\", null, null, n, i, o, a, s, \"#define POSITIVEX\", d, void 0, null, p) || this;\n            return y._face = 0, y;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"face\", { get: function() {\n            return this._face;\n          }, set: function(e) {\n            if (!(e < 0 || e > 5))\n              switch (this._face = e, this._face) {\n                case 0:\n                  this.updateEffect(\"#define POSITIVEX\");\n                  break;\n                case 1:\n                  this.updateEffect(\"#define NEGATIVEX\");\n                  break;\n                case 2:\n                  this.updateEffect(\"#define POSITIVEY\");\n                  break;\n                case 3:\n                  this.updateEffect(\"#define NEGATIVEY\");\n                  break;\n                case 4:\n                  this.updateEffect(\"#define POSITIVEZ\");\n                  break;\n                case 5:\n                  this.updateEffect(\"#define NEGATIVEZ\");\n              }\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PassCubePostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        Ue.a._RescalePostProcessFactory = function(r) {\n          return new Ri(\"rescale\", 1, null, h.a.TEXTURE_BILINEAR_SAMPLINGMODE, r, !1, h.a.TEXTURETYPE_UNSIGNED_INT);\n        };\n        var Ef = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D leftSampler;\nvoid main(void)\n{\nvec4 leftFrag=texture2D(leftSampler,vUV);\nleftFrag=vec4(1.0,leftFrag.g,leftFrag.b,1.0);\nvec4 rightFrag=texture2D(textureSampler,vUV);\nrightFrag=vec4(rightFrag.r,1.0,1.0,1.0);\ngl_FragColor=vec4(rightFrag.rgb*leftFrag.rgb,1.0);\n}`;\n        ze.a.ShadersStore.anaglyphPixelShader = Ef;\n        var Ja = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, \"anaglyph\", null, [\"leftSampler\"], n, i[1], o, a, s) || this;\n            return d._passedProcess = i[0]._rigPostProcess, d.onApplyObservable.add(function(p) {\n              p.setTextureFromPostProcess(\"leftSampler\", d._passedProcess);\n            }), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphPostProcess\";\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.AnaglyphPostProcess\"] = Ja, _t.a._setStereoscopicAnaglyphRigMode = function(r) {\n          r._rigCameras[0]._rigPostProcess = new Ri(r.name + \"_passthru\", 1, r._rigCameras[0]), r._rigCameras[1]._rigPostProcess = new Ja(r.name + \"_anaglyph\", 1, r._rigCameras);\n        }, Q.a.AddNodeConstructor(\"AnaglyphArcRotateCamera\", function(r, t, e) {\n          return function() {\n            return new pl(r, 0, 0, 1, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var pl = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, n, i, o, a, d) || this;\n            return p.interaxialDistance = s, p.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: s }), p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphArcRotateCamera\";\n          }, t;\n        }(Hi);\n        Q.a.AddNodeConstructor(\"AnaglyphFreeCamera\", function(r, t, e) {\n          return function() {\n            return new _l(r, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var _l = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, o) || this;\n            return a.interaxialDistance = i, a.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: i }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphFreeCamera\";\n          }, t;\n        }(zn);\n        Q.a.AddNodeConstructor(\"AnaglyphGamepadCamera\", function(r, t, e) {\n          return function() {\n            return new ml(r, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var ml = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, o) || this;\n            return a.interaxialDistance = i, a.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: i }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphGamepadCamera\";\n          }, t;\n        }(Co);\n        Q.a.AddNodeConstructor(\"AnaglyphUniversalCamera\", function(r, t, e) {\n          return function() {\n            return new gl(r, u.e.Zero(), e.interaxial_distance, t);\n          };\n        });\n        var gl = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, o) || this;\n            return a.interaxialDistance = i, a.setCameraRigMode(_t.a.RIG_MODE_STEREOSCOPIC_ANAGLYPH, { interaxialDistance: i }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AnaglyphUniversalCamera\";\n          }, t;\n        }(sr), jn = f(58);\n        _t.a._setStereoscopicRigMode = function(r) {\n          var t = r.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL || r.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED, e = r.cameraRigMode === _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;\n          r._rigCameras[e ? 1 : 0].viewport = new jn.a(0, 0, t ? 0.5 : 1, t ? 1 : 0.5), r._rigCameras[e ? 0 : 1].viewport = new jn.a(t ? 0.5 : 0, t ? 0 : 0.5, t ? 0.5 : 1, t ? 1 : 0.5);\n        }, Q.a.AddNodeConstructor(\"StereoscopicArcRotateCamera\", function(r, t, e) {\n          return function() {\n            return new vl(r, 0, 0, 1, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var vl = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            var y = r.call(this, e, n, i, o, a, p) || this;\n            return y.interaxialDistance = s, y.isStereoscopicSideBySide = d, y.setCameraRigMode(d ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: s }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicArcRotateCamera\";\n          }, t;\n        }(Hi);\n        Q.a.AddNodeConstructor(\"StereoscopicFreeCamera\", function(r, t, e) {\n          return function() {\n            return new yl(r, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var yl = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, n, a) || this;\n            return s.interaxialDistance = i, s.isStereoscopicSideBySide = o, s.setCameraRigMode(o ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: i }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicFreeCamera\";\n          }, t;\n        }(zn);\n        Q.a.AddNodeConstructor(\"StereoscopicGamepadCamera\", function(r, t, e) {\n          return function() {\n            return new bl(r, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var bl = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, n, a) || this;\n            return s.interaxialDistance = i, s.isStereoscopicSideBySide = o, s.setCameraRigMode(o ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: i }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicGamepadCamera\";\n          }, t;\n        }(Co);\n        Q.a.AddNodeConstructor(\"StereoscopicFreeCamera\", function(r, t, e) {\n          return function() {\n            return new Tl(r, u.e.Zero(), e.interaxial_distance, e.isStereoscopicSideBySide, t);\n          };\n        });\n        var Tl = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e, n, a) || this;\n            return s.interaxialDistance = i, s.isStereoscopicSideBySide = o, s.setCameraRigMode(o ? _t.a.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL : _t.a.RIG_MODE_STEREOSCOPIC_OVERUNDER, { interaxialDistance: i }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicUniversalCamera\";\n          }, t;\n        }(sr);\n        Q.a.AddNodeConstructor(\"VirtualJoysticksCamera\", function(r, t) {\n          return function() {\n            return new El(r, u.e.Zero(), t);\n          };\n        });\n        var El = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n, i) || this;\n            return o.inputs.addVirtualJoystick(), o;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VirtualJoysticksCamera\";\n          }, t;\n        }(zn), cr = function() {\n          function r() {\n            this.compensateDistortion = !0, this.multiviewEnabled = !1;\n          }\n          return Object.defineProperty(r.prototype, \"aspectRatio\", { get: function() {\n            return this.hResolution / (2 * this.vResolution);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"aspectRatioFov\", { get: function() {\n            return 2 * Math.atan(this.postProcessScaleFactor * this.vScreenSize / (2 * this.eyeToScreenDistance));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"leftHMatrix\", { get: function() {\n            var t = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;\n            return u.a.Translation(t, 0, 0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightHMatrix\", { get: function() {\n            var t = 4 * (this.hScreenSize / 4 - this.lensSeparationDistance / 2) / this.hScreenSize;\n            return u.a.Translation(-t, 0, 0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"leftPreViewMatrix\", { get: function() {\n            return u.a.Translation(0.5 * this.interpupillaryDistance, 0, 0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightPreViewMatrix\", { get: function() {\n            return u.a.Translation(-0.5 * this.interpupillaryDistance, 0, 0);\n          }, enumerable: !1, configurable: !0 }), r.GetDefault = function() {\n            var t = new r();\n            return t.hResolution = 1280, t.vResolution = 800, t.hScreenSize = 0.149759993, t.vScreenSize = 0.0935999975, t.vScreenCenter = 0.0467999987, t.eyeToScreenDistance = 0.0410000011, t.lensSeparationDistance = 0.063500002, t.interpupillaryDistance = 0.064000003, t.distortionK = [1, 0.219999999, 0.239999995, 0], t.chromaAbCorrection = [0.995999992, -0.00400000019, 1.01400006, 0], t.postProcessScaleFactor = 1.714605507808412, t.lensCenterOffset = 0.151976421, t;\n          }, r;\n        }(), Sf = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 LensCenter;\nuniform vec2 Scale;\nuniform vec2 ScaleIn;\nuniform vec4 HmdWarpParam;\nvec2 HmdWarp(vec2 in01) {\nvec2 theta=(in01-LensCenter)*ScaleIn;\nfloat rSq=theta.x*theta.x+theta.y*theta.y;\nvec2 rvector=theta*(HmdWarpParam.x+HmdWarpParam.y*rSq+HmdWarpParam.z*rSq*rSq+HmdWarpParam.w*rSq*rSq*rSq);\nreturn LensCenter+Scale*rvector;\n}\nvoid main(void)\n{\nvec2 tc=HmdWarp(vUV);\nif (tc.x <0.0 || tc.x>1.0 || tc.y<0.0 || tc.y>1.0)\ngl_FragColor=vec4(0.0,0.0,0.0,0.0);\nelse{\ngl_FragColor=texture2D(textureSampler,tc);\n}\n}`;\n        ze.a.ShadersStore.vrDistortionCorrectionPixelShader = Sf;\n        var $a = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, \"vrDistortionCorrection\", [\"LensCenter\", \"Scale\", \"ScaleIn\", \"HmdWarpParam\"], null, o.postProcessScaleFactor, n, Ne.a.BILINEAR_SAMPLINGMODE) || this;\n            return a._isRightEye = i, a._distortionFactors = o.distortionK, a._postProcessScaleFactor = o.postProcessScaleFactor, a._lensCenterOffset = o.lensCenterOffset, a.adaptScaleToCurrentViewport = !0, a.onSizeChangedObservable.add(function() {\n              a._scaleIn = new u.d(2, 2 / a.aspectRatio), a._scaleFactor = new u.d(1 / a._postProcessScaleFactor * 0.5, 1 / a._postProcessScaleFactor * 0.5 * a.aspectRatio), a._lensCenter = new u.d(a._isRightEye ? 0.5 - 0.5 * a._lensCenterOffset : 0.5 + 0.5 * a._lensCenterOffset, 0.5);\n            }), a.onApplyObservable.add(function(s) {\n              s.setFloat2(\"LensCenter\", a._lensCenter.x, a._lensCenter.y), s.setFloat2(\"Scale\", a._scaleFactor.x, a._scaleFactor.y), s.setFloat2(\"ScaleIn\", a._scaleIn.x, a._scaleIn.y), s.setFloat4(\"HmdWarpParam\", a._distortionFactors[0], a._distortionFactors[1], a._distortionFactors[2], a._distortionFactors[3]);\n            }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDistortionCorrectionPostProcess\";\n          }, t;\n        }(ft), Af = `precision mediump sampler2DArray;\nvarying vec2 vUV;\nuniform sampler2DArray multiviewSampler;\nuniform int imageIndex;\nvoid main(void)\n{\ngl_FragColor=texture(multiviewSampler,vec3(vUV,imageIndex));\n}`;\n        ze.a.ShadersStore.vrMultiviewToSingleviewPixelShader = Af;\n        var Sl = f(85), es = f(95), Hr = f(96);\n        wt.a.prototype.createRenderTargetCubeTexture = function(r, t) {\n          var e = Object(c.a)({ generateMipMaps: !0, generateDepthBuffer: !0, generateStencilBuffer: !1, type: h.a.TEXTURETYPE_UNSIGNED_INT, samplingMode: h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, format: h.a.TEXTUREFORMAT_RGBA }, t);\n          e.generateStencilBuffer = e.generateDepthBuffer && e.generateStencilBuffer, (e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (e.type !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (e.samplingMode = h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n          var n = this._gl, i = new Pt.a(this, Pt.b.RenderTarget);\n          this._bindTextureDirectly(n.TEXTURE_CUBE_MAP, i, !0);\n          var o = this._getSamplingParameters(e.samplingMode, e.generateMipMaps);\n          e.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (e.type = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Cube render target forced to TEXTURETYPE_UNESIGNED_BYTE type\")), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, o.mag), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, o.min), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE);\n          for (var a = 0; a < 6; a++)\n            n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + a, 0, this._getRGBABufferInternalSizedFormat(e.type, e.format), r, r, 0, this._getInternalFormat(e.format), this._getWebGLTextureType(e.type), null);\n          var s = n.createFramebuffer();\n          return this._bindUnboundFramebuffer(s), i._depthStencilBuffer = this._setupFramebufferDepthAttachments(e.generateStencilBuffer, e.generateDepthBuffer, r, r), e.generateMipMaps && n.generateMipmap(n.TEXTURE_CUBE_MAP), this._bindTextureDirectly(n.TEXTURE_CUBE_MAP, null), this._bindUnboundFramebuffer(null), i._framebuffer = s, i.width = r, i.height = r, i.isReady = !0, i.isCube = !0, i.samples = 1, i.generateMipMaps = e.generateMipMaps, i.samplingMode = e.samplingMode, i.type = e.type, i.format = e.format, i._generateDepthBuffer = e.generateDepthBuffer, i._generateStencilBuffer = e.generateStencilBuffer, this._internalTexturesCache.push(i), i;\n        };\n        var on = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R, B, F) {\n            a === void 0 && (a = !0), s === void 0 && (s = h.a.TEXTURETYPE_UNSIGNED_INT), d === void 0 && (d = !1), p === void 0 && (p = Ne.a.TRILINEAR_SAMPLINGMODE), y === void 0 && (y = !0), P === void 0 && (P = !1), R === void 0 && (R = !1), B === void 0 && (B = h.a.TEXTUREFORMAT_RGBA), F === void 0 && (F = !1);\n            var z = r.call(this, null, i, !o) || this;\n            return z.renderParticles = !0, z.renderSprites = !1, z.ignoreCameraViewport = !1, z.onBeforeBindObservable = new C.c(), z.onAfterUnbindObservable = new C.c(), z.onBeforeRenderObservable = new C.c(), z.onAfterRenderObservable = new C.c(), z.onClearObservable = new C.c(), z.onResizeObservable = new C.c(), z._currentRefreshId = -1, z._refreshRate = 1, z._samples = 1, z.boundingBoxPosition = u.e.Zero(), (i = z.getScene()) && (z._coordinatesMode = Ne.a.PROJECTION_MODE, z.renderList = new Array(), z.name = e, z.isRenderTarget = !0, z._initialSizeParameter = n, z._processSizeParameter(n), z._resizeObserver = z.getScene().getEngine().onResizeObservable.add(function() {\n            }), z._generateMipMaps = !!o, z._doNotChangeAspectRatio = a, z._renderingManager = new Hr.b(i), z._renderingManager._useSceneAutoClearSetup = !0, R || (z._renderTargetOptions = { generateMipMaps: o, type: s, format: B, samplingMode: p, generateDepthBuffer: y, generateStencilBuffer: P }, p === Ne.a.NEAREST_SAMPLINGMODE && (z.wrapU = Ne.a.CLAMP_ADDRESSMODE, z.wrapV = Ne.a.CLAMP_ADDRESSMODE), F || (d ? (z._texture = i.getEngine().createRenderTargetCubeTexture(z.getRenderSize(), z._renderTargetOptions), z.coordinatesMode = Ne.a.INVCUBIC_MODE, z._textureMatrix = u.a.Identity()) : z._texture = i.getEngine().createRenderTargetTexture(z._size, z._renderTargetOptions)))), z;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"renderList\", { get: function() {\n            return this._renderList;\n          }, set: function(e) {\n            this._renderList = e, this._renderList && this._hookArray(this._renderList);\n          }, enumerable: !1, configurable: !0 }), t.prototype._hookArray = function(e) {\n            var n = this, i = e.push;\n            e.push = function() {\n              for (var a = [], s = 0; s < arguments.length; s++)\n                a[s] = arguments[s];\n              var d = e.length === 0, p = i.apply(e, a);\n              return d && n.getScene() && n.getScene().meshes.forEach(function(y) {\n                y._markSubMeshesAsLightDirty();\n              }), p;\n            };\n            var o = e.splice;\n            e.splice = function(a, s) {\n              var d = o.apply(e, [a, s]);\n              return e.length === 0 && n.getScene().meshes.forEach(function(p) {\n                p._markSubMeshesAsLightDirty();\n              }), d;\n            };\n          }, Object.defineProperty(t.prototype, \"onAfterUnbind\", { set: function(e) {\n            this._onAfterUnbindObserver && this.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = this.onAfterUnbindObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onBeforeRender\", { set: function(e) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onAfterRender\", { set: function(e) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onClear\", { set: function(e) {\n            this._onClearObserver && this.onClearObservable.remove(this._onClearObserver), this._onClearObserver = this.onClearObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"renderTargetOptions\", { get: function() {\n            return this._renderTargetOptions;\n          }, enumerable: !1, configurable: !0 }), t.prototype._onRatioRescale = function() {\n            this._sizeRatio && this.resize(this._initialSizeParameter);\n          }, Object.defineProperty(t.prototype, \"boundingBoxSize\", { get: function() {\n            return this._boundingBoxSize;\n          }, set: function(e) {\n            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {\n              this._boundingBoxSize = e;\n              var n = this.getScene();\n              n && n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthStencilTexture\", { get: function() {\n            var e;\n            return ((e = this.getInternalTexture()) === null || e === void 0 ? void 0 : e._depthStencilTexture) || null;\n          }, enumerable: !1, configurable: !0 }), t.prototype.createDepthStencilTexture = function(e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = !0), i === void 0 && (i = !1);\n            var o = this.getInternalTexture();\n            if (this.getScene() && o) {\n              var a = this.getScene().getEngine();\n              o._depthStencilTexture = a.createDepthStencilTexture(this._size, { bilinearFiltering: n, comparisonFunction: e, generateStencil: i, isCube: this.isCube });\n            }\n          }, t.prototype._processSizeParameter = function(e) {\n            if (e.ratio) {\n              this._sizeRatio = e.ratio;\n              var n = this._getEngine();\n              this._size = { width: this._bestReflectionRenderTargetDimension(n.getRenderWidth(), this._sizeRatio), height: this._bestReflectionRenderTargetDimension(n.getRenderHeight(), this._sizeRatio) };\n            } else\n              this._size = e;\n          }, Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            if (this._samples !== e) {\n              var n = this.getScene();\n              n && (this._samples = n.getEngine().updateRenderTargetTextureSampleCount(this._texture, e));\n            }\n          }, enumerable: !1, configurable: !0 }), t.prototype.resetRefreshCounter = function() {\n            this._currentRefreshId = -1;\n          }, Object.defineProperty(t.prototype, \"refreshRate\", { get: function() {\n            return this._refreshRate;\n          }, set: function(e) {\n            this._refreshRate = e, this.resetRefreshCounter();\n          }, enumerable: !1, configurable: !0 }), t.prototype.addPostProcess = function(e) {\n            if (!this._postProcessManager) {\n              var n = this.getScene();\n              if (!n)\n                return;\n              this._postProcessManager = new es.a(n), this._postProcesses = new Array();\n            }\n            this._postProcesses.push(e), this._postProcesses[0].autoClear = !1;\n          }, t.prototype.clearPostProcesses = function(e) {\n            if (e === void 0 && (e = !1), this._postProcesses) {\n              if (e)\n                for (var n = 0, i = this._postProcesses; n < i.length; n++)\n                  i[n].dispose();\n              this._postProcesses = [];\n            }\n          }, t.prototype.removePostProcess = function(e) {\n            if (this._postProcesses) {\n              var n = this._postProcesses.indexOf(e);\n              n !== -1 && (this._postProcesses.splice(n, 1), this._postProcesses.length > 0 && (this._postProcesses[0].autoClear = !1));\n            }\n          }, t.prototype._shouldRender = function() {\n            return this._currentRefreshId === -1 || this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, !0) : (this._currentRefreshId++, !1);\n          }, t.prototype.getRenderSize = function() {\n            return this.getRenderWidth();\n          }, t.prototype.getRenderWidth = function() {\n            return this._size.width ? this._size.width : this._size;\n          }, t.prototype.getRenderHeight = function() {\n            return this._size.width ? this._size.height : this._size;\n          }, t.prototype.getRenderLayers = function() {\n            var e = this._size.layers;\n            return e || 0;\n          }, Object.defineProperty(t.prototype, \"canRescale\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), t.prototype.scale = function(e) {\n            var n = Math.max(1, this.getRenderSize() * e);\n            this.resize(n);\n          }, t.prototype.getReflectionTextureMatrix = function() {\n            return this.isCube ? this._textureMatrix : r.prototype.getReflectionTextureMatrix.call(this);\n          }, t.prototype.resize = function(e) {\n            var n = this.isCube;\n            this.releaseInternalTexture();\n            var i = this.getScene();\n            i && (this._processSizeParameter(e), this._texture = n ? i.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions) : i.getEngine().createRenderTargetTexture(this._size, this._renderTargetOptions), this.onResizeObservable.hasObservers() && this.onResizeObservable.notifyObservers(this));\n          }, t.prototype.render = function(e, n) {\n            if (e === void 0 && (e = !1), n === void 0 && (n = !1), p = this.getScene()) {\n              var i, o = p.getEngine();\n              if (this.useCameraPostProcesses !== void 0 && (e = this.useCameraPostProcesses), this._waitingRenderList) {\n                this.renderList = [];\n                for (var a = 0; a < this._waitingRenderList.length; a++) {\n                  var s = this._waitingRenderList[a], d = p.getMeshByID(s);\n                  d && this.renderList.push(d);\n                }\n                this._waitingRenderList = void 0;\n              }\n              if (this.renderListPredicate) {\n                var p;\n                if (this.renderList ? this.renderList.length = 0 : this.renderList = [], !(p = this.getScene()))\n                  return;\n                var y = p.meshes;\n                for (a = 0; a < y.length; a++) {\n                  var P = y[a];\n                  this.renderListPredicate(P) && this.renderList.push(P);\n                }\n              }\n              if (this.onBeforeBindObservable.notifyObservers(this), this.activeCamera ? (i = this.activeCamera, o.setViewport(this.activeCamera.viewport, this.getRenderWidth(), this.getRenderHeight()), this.activeCamera !== p.activeCamera && p.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(!0))) : (i = p.activeCamera) && o.setViewport(i.viewport, this.getRenderWidth(), this.getRenderHeight()), this._defaultRenderListPrepared = !1, this.is2DArray)\n                for (var R = 0; R < this.getRenderLayers(); R++)\n                  this.renderToTarget(0, e, n, R, i), p.incrementRenderId(), p.resetCachedMaterial();\n              else if (this.isCube)\n                for (var B = 0; B < 6; B++)\n                  this.renderToTarget(B, e, n, void 0, i), p.incrementRenderId(), p.resetCachedMaterial();\n              else\n                this.renderToTarget(0, e, n, void 0, i);\n              this.onAfterUnbindObservable.notifyObservers(this), p.activeCamera && ((p.getEngine().scenes.length > 1 || this.activeCamera && this.activeCamera !== p.activeCamera) && p.setTransformMatrix(p.activeCamera.getViewMatrix(), p.activeCamera.getProjectionMatrix(!0)), o.setViewport(p.activeCamera.viewport)), p.resetCachedMaterial();\n            }\n          }, t.prototype._bestReflectionRenderTargetDimension = function(e, n) {\n            var i = e * n, o = Ue.a.NearestPOT(i + 16384 / (128 + i));\n            return Math.min(Ue.a.FloorPOT(e), o);\n          }, t.prototype._prepareRenderingManager = function(e, n, i, o) {\n            var a = this.getScene();\n            if (a) {\n              this._renderingManager.reset();\n              for (var s = a.getRenderId(), d = 0; d < n; d++) {\n                var p = e[d];\n                if (p && !p.isBlocked) {\n                  if (this.customIsReadyFunction) {\n                    if (!this.customIsReadyFunction(p, this.refreshRate)) {\n                      this.resetRefreshCounter();\n                      continue;\n                    }\n                  } else if (!p.isReady(this.refreshRate === 0)) {\n                    this.resetRefreshCounter();\n                    continue;\n                  }\n                  if (!p._internalAbstractMeshDataInfo._currentLODIsUpToDate && a.activeCamera && (p._internalAbstractMeshDataInfo._currentLOD = a.customLODSelector ? a.customLODSelector(p, a.activeCamera) : p.getLOD(a.activeCamera), p._internalAbstractMeshDataInfo._currentLODIsUpToDate = !0), !p._internalAbstractMeshDataInfo._currentLOD)\n                    continue;\n                  var y = p._internalAbstractMeshDataInfo._currentLOD;\n                  y._preActivateForIntermediateRendering(s);\n                  var P = void 0;\n                  if (P = !(!o || !i) && (p.layerMask & i.layerMask) == 0, p.isEnabled() && p.isVisible && p.subMeshes && !P && (y !== p && y._activate(s, !0), p._activate(s, !0) && p.subMeshes.length)) {\n                    p.isAnInstance ? p._internalAbstractMeshDataInfo._actAsRegularMesh && (y = p) : y._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !1, y._internalAbstractMeshDataInfo._isActiveIntermediate = !0;\n                    for (var R = 0; R < y.subMeshes.length; R++) {\n                      var B = y.subMeshes[R];\n                      this._renderingManager.dispatch(B, y);\n                    }\n                  }\n                }\n              }\n              for (var F = 0; F < a.particleSystems.length; F++) {\n                var z = a.particleSystems[F], J = z.emitter;\n                z.isStarted() && J && J.position && J.isEnabled() && e.indexOf(J) >= 0 && this._renderingManager.dispatchParticles(z);\n              }\n            }\n          }, t.prototype._bindFrameBuffer = function(e, n) {\n            e === void 0 && (e = 0), n === void 0 && (n = 0);\n            var i = this.getScene();\n            if (i) {\n              var o = i.getEngine();\n              this._texture && o.bindFramebuffer(this._texture, this.isCube ? e : void 0, void 0, void 0, this.ignoreCameraViewport, 0, n);\n            }\n          }, t.prototype.unbindFrameBuffer = function(e, n) {\n            var i = this;\n            this._texture && e.unBindFramebuffer(this._texture, this.isCube, function() {\n              i.onAfterRenderObservable.notifyObservers(n);\n            });\n          }, t.prototype.renderToTarget = function(e, n, i, o, a) {\n            o === void 0 && (o = 0), a === void 0 && (a = null);\n            var s = this.getScene();\n            if (s) {\n              var d = s.getEngine();\n              if (this._texture) {\n                this._postProcessManager ? this._postProcessManager._prepareFrame(this._texture, this._postProcesses) : n && s.postProcessManager._prepareFrame(this._texture) || this._bindFrameBuffer(e, o), this.is2DArray ? this.onBeforeRenderObservable.notifyObservers(o) : this.onBeforeRenderObservable.notifyObservers(e);\n                var p = null, y = this.renderList ? this.renderList : s.getActiveMeshes().data, P = this.renderList ? this.renderList.length : s.getActiveMeshes().length;\n                this.getCustomRenderList && (p = this.getCustomRenderList(this.is2DArray ? o : e, y, P)), p ? this._prepareRenderingManager(p, p.length, a, !1) : (this._defaultRenderListPrepared || (this._prepareRenderingManager(y, P, a, !this.renderList), this._defaultRenderListPrepared = !0), p = y), this.onClearObservable.hasObservers() ? this.onClearObservable.notifyObservers(d) : d.clear(this.clearColor || s.clearColor, !0, !0, !0), this._doNotChangeAspectRatio || s.updateTransformMatrix(!0);\n                for (var R = 0, B = s._beforeRenderTargetDrawStage; R < B.length; R++)\n                  B[R].action(this);\n                this._renderingManager.render(this.customRenderFunction, p, this.renderParticles, this.renderSprites);\n                for (var F = 0, z = s._afterRenderTargetDrawStage; F < z.length; F++)\n                  z[F].action(this);\n                this._postProcessManager ? this._postProcessManager._finalizeFrame(!1, this._texture, e, this._postProcesses, this.ignoreCameraViewport) : n && s.postProcessManager._finalizeFrame(!1, this._texture, e), this._doNotChangeAspectRatio || s.updateTransformMatrix(!0), i && Xe.b.DumpFramebuffer(this.getRenderWidth(), this.getRenderHeight(), d), this.isCube && e !== 5 ? this.onAfterRenderObservable.notifyObservers(e) : (this.isCube && e === 5 && d.generateMipMapsForCubemap(this._texture), this.unbindFrameBuffer(d, e));\n              }\n            }\n          }, t.prototype.setRenderingOrder = function(e, n, i, o) {\n            n === void 0 && (n = null), i === void 0 && (i = null), o === void 0 && (o = null), this._renderingManager.setRenderingOrder(e, n, i, o);\n          }, t.prototype.setRenderingAutoClearDepthStencil = function(e, n) {\n            this._renderingManager.setRenderingAutoClearDepthStencil(e, n), this._renderingManager._useSceneAutoClearSetup = !1;\n          }, t.prototype.clone = function() {\n            var e = this.getSize(), n = new t(this.name, e, this.getScene(), this._renderTargetOptions.generateMipMaps, this._doNotChangeAspectRatio, this._renderTargetOptions.type, this.isCube, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer, this._renderTargetOptions.generateStencilBuffer);\n            return n.hasAlpha = this.hasAlpha, n.level = this.level, n.coordinatesMode = this.coordinatesMode, this.renderList && (n.renderList = this.renderList.slice(0)), n;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = r.prototype.serialize.call(this);\n            if (e.renderTargetSize = this.getRenderSize(), e.renderList = [], this.renderList)\n              for (var n = 0; n < this.renderList.length; n++)\n                e.renderList.push(this.renderList[n].id);\n            return e;\n          }, t.prototype.disposeFramebufferObjects = function() {\n            var e = this.getInternalTexture(), n = this.getScene();\n            e && n && n.getEngine()._releaseFramebufferObjects(e);\n          }, t.prototype.dispose = function() {\n            this.onResizeObservable.clear(), this.onClearObservable.clear(), this.onAfterRenderObservable.clear(), this.onAfterUnbindObservable.clear(), this.onBeforeBindObservable.clear(), this.onBeforeRenderObservable.clear(), this._postProcessManager && (this._postProcessManager.dispose(), this._postProcessManager = null), this.clearPostProcesses(!0), this._resizeObserver && (this.getScene().getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.renderList = null;\n            var e = this.getScene();\n            if (e) {\n              var n = e.customRenderTargets.indexOf(this);\n              n >= 0 && e.customRenderTargets.splice(n, 1);\n              for (var i = 0, o = e.cameras; i < o.length; i++) {\n                var a = o[i];\n                (n = a.customRenderTargets.indexOf(this)) >= 0 && a.customRenderTargets.splice(n, 1);\n              }\n              this.depthStencilTexture && this.getScene().getEngine()._releaseTexture(this.depthStencilTexture), r.prototype.dispose.call(this);\n            }\n          }, t.prototype._rebuild = function() {\n            this.refreshRate === t.REFRESHRATE_RENDER_ONCE && (this.refreshRate = t.REFRESHRATE_RENDER_ONCE), this._postProcessManager && this._postProcessManager._rebuild();\n          }, t.prototype.freeRenderingGroups = function() {\n            this._renderingManager && this._renderingManager.freeRenderingGroups();\n          }, t.prototype.getViewCount = function() {\n            return 1;\n          }, t.REFRESHRATE_RENDER_ONCE = 0, t.REFRESHRATE_RENDER_ONEVERYFRAME = 1, t.REFRESHRATE_RENDER_ONEVERYTWOFRAMES = 2, t;\n        }(Ne.a);\n        Ne.a._CreateRenderTargetTexture = function(r, t, e, n) {\n          return new on(r, t, e, n);\n        };\n        var Al = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = 512);\n            var i = r.call(this, \"multiview rtt\", n, e, !1, !0, Pt.b.Unknown, !1, void 0, !1, !1, !0, void 0, !0) || this, o = e.getEngine().createMultiviewRenderTargetTexture(i.getRenderWidth(), i.getRenderHeight());\n            return o.isMultiview = !0, o.format = h.a.TEXTUREFORMAT_RGBA, i._texture = o, i.samples = i._getEngine().getCaps().maxSamples || i.samples, i;\n          }\n          return Object(c.d)(t, r), t.prototype._bindFrameBuffer = function(e) {\n            this._texture && this.getScene().getEngine().bindMultiviewFramebuffer(this._texture);\n          }, t.prototype.getViewCount = function() {\n            return 2;\n          }, t;\n        }(on), Pl = f(90);\n        Ue.a.prototype.createMultiviewRenderTargetTexture = function(r, t) {\n          var e = this._gl;\n          if (!this.getCaps().multiview)\n            throw \"Multiview is not supported\";\n          var n = new Pt.a(this, Pt.b.Unknown, !0);\n          return n.width = r, n.height = t, n._framebuffer = e.createFramebuffer(), n._colorTextureArray = e.createTexture(), e.bindTexture(e.TEXTURE_2D_ARRAY, n._colorTextureArray), e.texStorage3D(e.TEXTURE_2D_ARRAY, 1, e.RGBA8, r, t, 2), n._depthStencilTextureArray = e.createTexture(), e.bindTexture(e.TEXTURE_2D_ARRAY, n._depthStencilTextureArray), e.texStorage3D(e.TEXTURE_2D_ARRAY, 1, e.DEPTH32F_STENCIL8, r, t, 2), n.isReady = !0, n;\n        }, Ue.a.prototype.bindMultiviewFramebuffer = function(r) {\n          var t = this._gl, e = this.getCaps().oculusMultiview || this.getCaps().multiview;\n          if (this.bindFramebuffer(r, void 0, void 0, void 0, !0), t.bindFramebuffer(t.DRAW_FRAMEBUFFER, r._framebuffer), !r._colorTextureArray || !r._depthStencilTextureArray)\n            throw \"Invalid multiview frame buffer\";\n          this.getCaps().oculusMultiview ? (e.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, r._colorTextureArray, 0, r.samples, 0, 2), e.framebufferTextureMultisampleMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, r._depthStencilTextureArray, 0, r.samples, 0, 2)) : (e.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.COLOR_ATTACHMENT0, r._colorTextureArray, 0, 0, 2), e.framebufferTextureMultiviewOVR(t.DRAW_FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, r._depthStencilTextureArray, 0, 0, 2));\n        }, _t.a.prototype._useMultiviewToSingleView = !1, _t.a.prototype._multiviewTexture = null, _t.a.prototype._resizeOrCreateMultiviewTexture = function(r, t) {\n          this._multiviewTexture ? this._multiviewTexture.getRenderWidth() == r && this._multiviewTexture.getRenderHeight() == t || (this._multiviewTexture.dispose(), this._multiviewTexture = new Al(this.getScene(), { width: r, height: t })) : this._multiviewTexture = new Al(this.getScene(), { width: r, height: t });\n        }, _e.a.prototype._transformMatrixR = u.a.Zero(), _e.a.prototype._multiviewSceneUbo = null, _e.a.prototype._createMultiviewUbo = function() {\n          this._multiviewSceneUbo = new Sl.a(this.getEngine(), void 0, !0), this._multiviewSceneUbo.addUniform(\"viewProjection\", 16), this._multiviewSceneUbo.addUniform(\"viewProjectionR\", 16), this._multiviewSceneUbo.addUniform(\"view\", 16);\n        }, _e.a.prototype._updateMultiviewUbo = function(r, t) {\n          r && t && r.multiplyToRef(t, this._transformMatrixR), r && t && (r.multiplyToRef(t, u.c.Matrix[0]), Pl.a.GetRightPlaneToRef(u.c.Matrix[0], this._frustumPlanes[3])), this._multiviewSceneUbo && (this._multiviewSceneUbo.updateMatrix(\"viewProjection\", this.getTransformMatrix()), this._multiviewSceneUbo.updateMatrix(\"viewProjectionR\", this._transformMatrixR), this._multiviewSceneUbo.updateMatrix(\"view\", this._viewMatrix), this._multiviewSceneUbo.update());\n        }, _e.a.prototype._renderMultiviewToSingleView = function(r) {\n          r._resizeOrCreateMultiviewTexture(r._rigPostProcess && r._rigPostProcess && r._rigPostProcess.width > 0 ? r._rigPostProcess.width : this.getEngine().getRenderWidth(!0), r._rigPostProcess && r._rigPostProcess && r._rigPostProcess.height > 0 ? r._rigPostProcess.height : this.getEngine().getRenderHeight(!0)), this._multiviewSceneUbo || this._createMultiviewUbo(), r.outputRenderTarget = r._multiviewTexture, this._renderForCamera(r), r.outputRenderTarget = null;\n          for (var t = 0; t < r._rigCameras.length; t++) {\n            var e = this.getEngine();\n            this._activeCamera = r._rigCameras[t], e.setViewport(this._activeCamera.viewport), this.postProcessManager && (this.postProcessManager._prepareFrame(), this.postProcessManager._finalizeFrame(this._activeCamera.isIntermediate));\n          }\n        };\n        var ts = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, \"vrMultiviewToSingleview\", [\"imageIndex\"], [\"multiviewSampler\"], i, n, Ne.a.BILINEAR_SAMPLINGMODE) || this;\n            return o.onSizeChangedObservable.add(function() {\n            }), o.onApplyObservable.add(function(a) {\n              n._scene.activeCamera && n._scene.activeCamera.isLeftCamera ? a.setInt(\"imageIndex\", 0) : a.setInt(\"imageIndex\", 1), a.setTexture(\"multiviewSampler\", n._multiviewTexture);\n            }), o;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRMultiviewToSingleviewPostProcess\";\n          }, t;\n        }(ft);\n        _t.a._setVRRigMode = function(r, t) {\n          var e = t.vrCameraMetrics || cr.GetDefault();\n          r._rigCameras[0]._cameraRigParams.vrMetrics = e, r._rigCameras[0].viewport = new jn.a(0, 0, 0.5, 1), r._rigCameras[0]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[0]._cameraRigParams.vrHMatrix = e.leftHMatrix, r._rigCameras[0]._cameraRigParams.vrPreViewMatrix = e.leftPreViewMatrix, r._rigCameras[0].getProjectionMatrix = r._rigCameras[0]._getVRProjectionMatrix, r._rigCameras[1]._cameraRigParams.vrMetrics = e, r._rigCameras[1].viewport = new jn.a(0.5, 0, 0.5, 1), r._rigCameras[1]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[1]._cameraRigParams.vrHMatrix = e.rightHMatrix, r._rigCameras[1]._cameraRigParams.vrPreViewMatrix = e.rightPreViewMatrix, r._rigCameras[1].getProjectionMatrix = r._rigCameras[1]._getVRProjectionMatrix, e.multiviewEnabled && (r.getScene().getEngine().getCaps().multiview ? (r._useMultiviewToSingleView = !0, r._rigPostProcess = new ts(\"VRMultiviewToSingleview\", r, e.postProcessScaleFactor)) : (l.a.Warn(\"Multiview is not supported, falling back to standard rendering\"), e.multiviewEnabled = !1)), e.compensateDistortion && (r._rigCameras[0]._rigPostProcess = new $a(\"VR_Distort_Compensation_Left\", r._rigCameras[0], !1, e), r._rigCameras[1]._rigPostProcess = new $a(\"VR_Distort_Compensation_Right\", r._rigCameras[1], !0, e));\n        }, Q.a.AddNodeConstructor(\"VRDeviceOrientationFreeCamera\", function(r, t) {\n          return function() {\n            return new xl(r, 0, 0, 1, u.e.Zero(), t);\n          };\n        });\n        var xl = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = !0), p === void 0 && (p = cr.GetDefault());\n            var y = r.call(this, e, n, i, o, a, s) || this;\n            return p.compensateDistortion = d, y.setCameraRigMode(_t.a.RIG_MODE_VR, { vrCameraMetrics: p }), y.inputs.addVRDeviceOrientation(), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDeviceOrientationArcRotateCamera\";\n          }, t;\n        }(Hi);\n        Q.a.AddNodeConstructor(\"VRDeviceOrientationFreeCamera\", function(r, t) {\n          return function() {\n            return new Ro(r, u.e.Zero(), t);\n          };\n        });\n        var Ro = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !0), a === void 0 && (a = cr.GetDefault());\n            var s = r.call(this, e, n, i) || this;\n            return a.compensateDistortion = o, s.setCameraRigMode(_t.a.RIG_MODE_VR, { vrCameraMetrics: a }), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDeviceOrientationFreeCamera\";\n          }, t;\n        }(xo);\n        Q.a.AddNodeConstructor(\"VRDeviceOrientationGamepadCamera\", function(r, t) {\n          return function() {\n            return new Cl(r, u.e.Zero(), t);\n          };\n        });\n        var Cl = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !0), a === void 0 && (a = cr.GetDefault());\n            var s = r.call(this, e, n, i, o, a) || this;\n            return s.inputs.addGamepad(), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VRDeviceOrientationGamepadCamera\";\n          }, t;\n        }(Ro), Oo = f(86);\n        _t.a._setWebVRRigMode = function(r, t) {\n          if (t.vrDisplay) {\n            var e = t.vrDisplay.getEyeParameters(\"left\"), n = t.vrDisplay.getEyeParameters(\"right\");\n            r._rigCameras[0].viewport = new jn.a(0, 0, 0.5, 1), r._rigCameras[0].setCameraRigParameter(\"left\", !0), r._rigCameras[0].setCameraRigParameter(\"specs\", t.specs), r._rigCameras[0].setCameraRigParameter(\"eyeParameters\", e), r._rigCameras[0].setCameraRigParameter(\"frameData\", t.frameData), r._rigCameras[0].setCameraRigParameter(\"parentCamera\", t.parentCamera), r._rigCameras[0]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[0].getProjectionMatrix = r._getWebVRProjectionMatrix, r._rigCameras[0].parent = r, r._rigCameras[0]._getViewMatrix = r._getWebVRViewMatrix, r._rigCameras[1].viewport = new jn.a(0.5, 0, 0.5, 1), r._rigCameras[1].setCameraRigParameter(\"eyeParameters\", n), r._rigCameras[1].setCameraRigParameter(\"specs\", t.specs), r._rigCameras[1].setCameraRigParameter(\"frameData\", t.frameData), r._rigCameras[1].setCameraRigParameter(\"parentCamera\", t.parentCamera), r._rigCameras[1]._cameraRigParams.vrWorkMatrix = new u.a(), r._rigCameras[1].getProjectionMatrix = r._getWebVRProjectionMatrix, r._rigCameras[1].parent = r, r._rigCameras[1]._getViewMatrix = r._getWebVRViewMatrix;\n          }\n        }, Object.defineProperty(Ue.a.prototype, \"isInVRExclusivePointerMode\", { get: function() {\n          return this._vrExclusivePointerMode;\n        }, enumerable: !0, configurable: !0 }), Ue.a.prototype._prepareVRComponent = function() {\n          this._vrSupported = !1, this._vrExclusivePointerMode = !1, this.onVRDisplayChangedObservable = new C.c(), this.onVRRequestPresentComplete = new C.c(), this.onVRRequestPresentStart = new C.c();\n        }, Ue.a.prototype.isVRDevicePresent = function() {\n          return !!this._vrDisplay;\n        }, Ue.a.prototype.getVRDevice = function() {\n          return this._vrDisplay;\n        }, Ue.a.prototype.initWebVR = function() {\n          return this.initWebVRAsync(), this.onVRDisplayChangedObservable;\n        }, Ue.a.prototype.initWebVRAsync = function() {\n          var r = this, t = function() {\n            var n = { vrDisplay: r._vrDisplay, vrSupported: r._vrSupported };\n            r.onVRDisplayChangedObservable.notifyObservers(n), r._webVRInitPromise = new Promise(function(i) {\n              i(n);\n            });\n          };\n          if (!this._onVrDisplayConnect) {\n            this._onVrDisplayConnect = function(n) {\n              r._vrDisplay = n.display, t();\n            }, this._onVrDisplayDisconnect = function() {\n              r._vrDisplay.cancelAnimationFrame(r._frameHandler), r._vrDisplay = void 0, r._frameHandler = Ue.a.QueueNewFrame(r._boundRenderFunction), t();\n            }, this._onVrDisplayPresentChange = function() {\n              r._vrExclusivePointerMode = r._vrDisplay && r._vrDisplay.isPresenting;\n            };\n            var e = this.getHostWindow();\n            e && (e.addEventListener(\"vrdisplayconnect\", this._onVrDisplayConnect), e.addEventListener(\"vrdisplaydisconnect\", this._onVrDisplayDisconnect), e.addEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange));\n          }\n          return this._webVRInitPromise = this._webVRInitPromise || this._getVRDisplaysAsync(), this._webVRInitPromise.then(t), this._webVRInitPromise;\n        }, Ue.a.prototype._getVRDisplaysAsync = function() {\n          var r = this;\n          return new Promise(function(t) {\n            navigator.getVRDisplays ? navigator.getVRDisplays().then(function(e) {\n              r._vrSupported = !0, r._vrDisplay = e[0], t({ vrDisplay: r._vrDisplay, vrSupported: r._vrSupported });\n            }) : (r._vrDisplay = void 0, r._vrSupported = !1, t({ vrDisplay: r._vrDisplay, vrSupported: r._vrSupported }));\n          });\n        }, Ue.a.prototype.enableVR = function(r) {\n          var t = this;\n          if (this._vrDisplay && !this._vrDisplay.isPresenting) {\n            this.onVRRequestPresentStart.notifyObservers(this);\n            var e = { highRefreshRate: !!this.vrPresentationAttributes && this.vrPresentationAttributes.highRefreshRate, foveationLevel: this.vrPresentationAttributes ? this.vrPresentationAttributes.foveationLevel : 1, multiview: (this.getCaps().multiview || this.getCaps().oculusMultiview) && r.useMultiview };\n            this._vrDisplay.requestPresent([Object(c.a)({ source: this.getRenderingCanvas(), attributes: e }, e)]).then(function() {\n              t.onVRRequestPresentComplete.notifyObservers(!0), t._onVRFullScreenTriggered();\n            }).catch(function() {\n              t.onVRRequestPresentComplete.notifyObservers(!1);\n            });\n          }\n        }, Ue.a.prototype._onVRFullScreenTriggered = function() {\n          if (this._vrDisplay && this._vrDisplay.isPresenting) {\n            this._oldSize = new oe.a(this.getRenderWidth(), this.getRenderHeight()), this._oldHardwareScaleFactor = this.getHardwareScalingLevel();\n            var r = this._vrDisplay.getEyeParameters(\"left\");\n            this.setHardwareScalingLevel(1), this.setSize(2 * r.renderWidth, r.renderHeight);\n          } else\n            this.setHardwareScalingLevel(this._oldHardwareScaleFactor), this.setSize(this._oldSize.width, this._oldSize.height);\n        }, Ue.a.prototype.disableVR = function() {\n          var r = this;\n          this._vrDisplay && this._vrDisplay.isPresenting && this._vrDisplay.exitPresent().then(function() {\n            return r._onVRFullScreenTriggered();\n          }).catch(function() {\n            return r._onVRFullScreenTriggered();\n          }), Za.a.IsWindowObjectExist() && (window.removeEventListener(\"vrdisplaypointerrestricted\", this._onVRDisplayPointerRestricted), window.removeEventListener(\"vrdisplaypointerunrestricted\", this._onVRDisplayPointerUnrestricted), this._onVrDisplayConnect && (window.removeEventListener(\"vrdisplayconnect\", this._onVrDisplayConnect), this._onVrDisplayDisconnect && window.removeEventListener(\"vrdisplaydisconnect\", this._onVrDisplayDisconnect), this._onVrDisplayPresentChange && window.removeEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), this._onVrDisplayConnect = null, this._onVrDisplayDisconnect = null));\n        }, Ue.a.prototype._connectVREvents = function(r, t) {\n          var e = this;\n          if (this._onVRDisplayPointerRestricted = function() {\n            r && r.requestPointerLock();\n          }, this._onVRDisplayPointerUnrestricted = function() {\n            if (t)\n              t.exitPointerLock && t.exitPointerLock();\n            else {\n              var i = e.getHostWindow();\n              i.document && i.document.exitPointerLock && i.document.exitPointerLock();\n            }\n          }, Za.a.IsWindowObjectExist()) {\n            var n = this.getHostWindow();\n            n.addEventListener(\"vrdisplaypointerrestricted\", this._onVRDisplayPointerRestricted, !1), n.addEventListener(\"vrdisplaypointerunrestricted\", this._onVRDisplayPointerUnrestricted, !1);\n          }\n        }, Ue.a.prototype._submitVRFrame = function() {\n          if (this._vrDisplay && this._vrDisplay.isPresenting)\n            try {\n              this._vrDisplay.submitFrame();\n            } catch (r) {\n              Xe.b.Warn(\"webVR submitFrame has had an unexpected failure: \" + r);\n            }\n        }, Ue.a.prototype.isVRPresenting = function() {\n          return this._vrDisplay && this._vrDisplay.isPresenting;\n        }, Ue.a.prototype._requestVRFrame = function() {\n          this._frameHandler = Ue.a.QueueNewFrame(this._boundRenderFunction, this._vrDisplay);\n        }, Q.a.AddNodeConstructor(\"WebVRFreeCamera\", function(r, t) {\n          return function() {\n            return new Mo(r, u.e.Zero(), t);\n          };\n        }), Q.a.AddNodeConstructor(\"WebVRGamepadCamera\", function(r, t) {\n          return function() {\n            return new Mo(r, u.e.Zero(), t);\n          };\n        });\n        var Mo = function(r) {\n          function t(e, n, i, o) {\n            o === void 0 && (o = {});\n            var a = r.call(this, e, n, i) || this;\n            a.webVROptions = o, a._vrDevice = null, a.rawPose = null, a._specsVersion = \"1.1\", a._attached = !1, a._descendants = [], a._deviceRoomPosition = u.e.Zero(), a._deviceRoomRotationQuaternion = u.b.Identity(), a._standingMatrix = null, a.devicePosition = u.e.Zero(), a.deviceRotationQuaternion = u.b.Identity(), a.deviceScaleFactor = 1, a._deviceToWorld = u.a.Identity(), a._worldToDevice = u.a.Identity(), a.controllers = [], a.onControllersAttachedObservable = new C.c(), a.onControllerMeshLoadedObservable = new C.c(), a.onPoseUpdatedFromDeviceObservable = new C.c(), a._poseSet = !1, a.rigParenting = !0, a._defaultHeight = void 0, a._detachIfAttached = function() {\n              var d = a.getEngine().getVRDevice();\n              d && !d.isPresenting && a.detachControl();\n            }, a._workingVector = u.e.Zero(), a._oneVector = u.e.One(), a._workingMatrix = u.a.Identity(), a._tmpMatrix = new u.a(), a._cache.position = u.e.Zero(), o.defaultHeight && (a._defaultHeight = o.defaultHeight, a.position.y = a._defaultHeight), a.minZ = 0.1, arguments.length === 5 && (a.webVROptions = arguments[4]), a.webVROptions.trackPosition == null && (a.webVROptions.trackPosition = !0), a.webVROptions.controllerMeshes == null && (a.webVROptions.controllerMeshes = !0), a.webVROptions.defaultLightingOnControllers == null && (a.webVROptions.defaultLightingOnControllers = !0), a.rotationQuaternion = new u.b(), a.webVROptions && a.webVROptions.positionScale && (a.deviceScaleFactor = a.webVROptions.positionScale);\n            var s = a.getEngine();\n            return a._onVREnabled = function(d) {\n              d && a.initControllers();\n            }, s.onVRRequestPresentComplete.add(a._onVREnabled), s.initWebVR().add(function(d) {\n              d.vrDisplay && a._vrDevice !== d.vrDisplay && (a._vrDevice = d.vrDisplay, a.setCameraRigMode(_t.a.RIG_MODE_WEBVR, { parentCamera: a, vrDisplay: a._vrDevice, frameData: a._frameData, specs: a._specsVersion }), a._attached && a.getEngine().enableVR(a.webVROptions));\n            }), typeof VRFrameData < \"u\" && (a._frameData = new VRFrameData()), o.useMultiview && (a.getScene().getEngine().getCaps().multiview ? (a._useMultiviewToSingleView = !0, a._rigPostProcess = new ts(\"VRMultiviewToSingleview\", a, 1)) : (l.a.Warn(\"Multiview is not supported, falling back to standard rendering\"), a._useMultiviewToSingleView = !1)), i.onBeforeCameraRenderObservable.add(function(d) {\n              d.parent === a && a.rigParenting && (a._descendants = a.getDescendants(!0, function(p) {\n                var y = a.controllers.some(function(R) {\n                  return R._mesh === p;\n                }), P = a._rigCameras.indexOf(p) !== -1;\n                return !y && !P;\n              }), a._descendants.forEach(function(p) {\n                p.parent = d;\n              }));\n            }), i.onAfterCameraRenderObservable.add(function(d) {\n              d.parent === a && a.rigParenting && a._descendants.forEach(function(p) {\n                p.parent = a;\n              });\n            }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.deviceDistanceToRoomGround = function() {\n            return this._standingMatrix ? (this._standingMatrix.getTranslationToRef(this._workingVector), this._deviceRoomPosition.y + this._workingVector.y) : this._defaultHeight || 0;\n          }, t.prototype.useStandingMatrix = function(e) {\n            var n = this;\n            e === void 0 && (e = function(i) {\n            }), this.getEngine().initWebVRAsync().then(function(i) {\n              i.vrDisplay && i.vrDisplay.stageParameters && i.vrDisplay.stageParameters.sittingToStandingTransform && n.webVROptions.trackPosition ? (n._standingMatrix = new u.a(), u.a.FromFloat32ArrayToRefScaled(i.vrDisplay.stageParameters.sittingToStandingTransform, 0, 1, n._standingMatrix), n.getScene().useRightHandedSystem || n._standingMatrix && n._standingMatrix.toggleModelMatrixHandInPlace(), e(!0)) : e(!1);\n            });\n          }, t.prototype.useStandingMatrixAsync = function() {\n            var e = this;\n            return new Promise(function(n) {\n              e.useStandingMatrix(function(i) {\n                n(i);\n              });\n            });\n          }, t.prototype.dispose = function() {\n            this._detachIfAttached(), this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled), this._updateCacheWhenTrackingDisabledObserver && this._scene.onBeforeRenderObservable.remove(this._updateCacheWhenTrackingDisabledObserver), r.prototype.dispose.call(this);\n          }, t.prototype.getControllerByName = function(e) {\n            for (var n = 0, i = this.controllers; n < i.length; n++) {\n              var o = i[n];\n              if (o.hand === e)\n                return o;\n            }\n            return null;\n          }, Object.defineProperty(t.prototype, \"leftController\", { get: function() {\n            return this._leftController || (this._leftController = this.getControllerByName(\"left\")), this._leftController;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rightController\", { get: function() {\n            return this._rightController || (this._rightController = this.getControllerByName(\"right\")), this._rightController;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getForwardRay = function(e) {\n            return e === void 0 && (e = 100), this.leftCamera ? r.prototype.getForwardRay.call(this, e, this.leftCamera.getWorldMatrix(), this.leftCamera.globalPosition) : r.prototype.getForwardRay.call(this, e);\n          }, t.prototype._checkInputs = function() {\n            this._vrDevice && this._vrDevice.isPresenting && (this._vrDevice.getFrameData(this._frameData), this.updateFromDevice(this._frameData.pose)), r.prototype._checkInputs.call(this);\n          }, t.prototype.updateFromDevice = function(e) {\n            e && e.orientation && e.orientation.length === 4 && (this.rawPose = e, this._deviceRoomRotationQuaternion.copyFromFloats(e.orientation[0], e.orientation[1], -e.orientation[2], -e.orientation[3]), this.getScene().useRightHandedSystem && (this._deviceRoomRotationQuaternion.z *= -1, this._deviceRoomRotationQuaternion.w *= -1), this.webVROptions.trackPosition && this.rawPose.position && (this._deviceRoomPosition.copyFromFloats(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2]), this.getScene().useRightHandedSystem && (this._deviceRoomPosition.z *= -1)), this._poseSet = !0);\n          }, t.prototype.attachControl = function(e) {\n            e = Xe.b.BackCompatCameraNoPreventDefault(arguments), r.prototype.attachControl.call(this, e), this._attached = !0, e = !_t.a.ForceAttachControlToAlwaysPreventDefault && e, this._vrDevice && this.getEngine().enableVR(this.webVROptions);\n            var n = this._scene.getEngine().getHostWindow();\n            n && n.addEventListener(\"vrdisplaypresentchange\", this._detachIfAttached);\n          }, t.prototype.detachControl = function(e) {\n            this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver), this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver), r.prototype.detachControl.call(this), this._attached = !1, this.getEngine().disableVR(), window.removeEventListener(\"vrdisplaypresentchange\", this._detachIfAttached);\n          }, t.prototype.getClassName = function() {\n            return \"WebVRFreeCamera\";\n          }, t.prototype.resetToCurrentRotation = function() {\n            this._vrDevice.resetPose();\n          }, t.prototype._updateRigCameras = function() {\n            var e = this._rigCameras[0], n = this._rigCameras[1];\n            e.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), n.rotationQuaternion.copyFrom(this._deviceRoomRotationQuaternion), e.position.copyFrom(this._deviceRoomPosition), n.position.copyFrom(this._deviceRoomPosition);\n          }, t.prototype._correctPositionIfNotTrackPosition = function(e, n) {\n            n === void 0 && (n = !1), this.rawPose && this.rawPose.position && !this.webVROptions.trackPosition && (u.a.TranslationToRef(this.rawPose.position[0], this.rawPose.position[1], -this.rawPose.position[2], this._tmpMatrix), n || this._tmpMatrix.invert(), this._tmpMatrix.multiplyToRef(e, e));\n          }, t.prototype._updateCache = function(e) {\n            var n = this;\n            this.rotationQuaternion.equals(this._cache.rotationQuaternion) && this.position.equals(this._cache.position) || (this.updateCacheCalled || (this.updateCacheCalled = !0, this.update()), this.rotationQuaternion.toRotationMatrix(this._workingMatrix), u.e.TransformCoordinatesToRef(this._deviceRoomPosition, this._workingMatrix, this._workingVector), this.devicePosition.subtractToRef(this._workingVector, this._workingVector), u.a.ComposeToRef(this._oneVector, this.rotationQuaternion, this._workingVector, this._deviceToWorld), this._deviceToWorld.getTranslationToRef(this._workingVector), this._workingVector.addInPlace(this.position), this._workingVector.subtractInPlace(this._cache.position), this._deviceToWorld.setTranslation(this._workingVector), this._deviceToWorld.invertToRef(this._worldToDevice), this.controllers.forEach(function(i) {\n              i._deviceToWorld.copyFrom(n._deviceToWorld), n._correctPositionIfNotTrackPosition(i._deviceToWorld), i.update();\n            })), e || r.prototype._updateCache.call(this), this.updateCacheCalled = !1;\n          }, t.prototype._computeDevicePosition = function() {\n            u.e.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition);\n          }, t.prototype.update = function() {\n            this._computeDevicePosition(), u.a.FromQuaternionToRef(this._deviceRoomRotationQuaternion, this._workingMatrix), this._workingMatrix.multiplyToRef(this._deviceToWorld, this._workingMatrix), u.b.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion), this._poseSet && this.onPoseUpdatedFromDeviceObservable.notifyObservers(null), r.prototype.update.call(this);\n          }, t.prototype._getViewMatrix = function() {\n            return u.a.Identity();\n          }, t.prototype._getWebVRViewMatrix = function() {\n            var e = this._cameraRigParams.parentCamera;\n            e._updateCache();\n            var n = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftViewMatrix : this._cameraRigParams.frameData.rightViewMatrix;\n            return u.a.FromArrayToRef(n, 0, this._webvrViewMatrix), this.getScene().useRightHandedSystem || this._webvrViewMatrix.toggleModelMatrixHandInPlace(), this._webvrViewMatrix.getRotationMatrixToRef(this._cameraRotationMatrix), u.e.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint), this.position.addToRef(this._transformedReferencePoint, this._currentTarget), e.deviceScaleFactor !== 1 && (this._webvrViewMatrix.invert(), e.deviceScaleFactor && (this._webvrViewMatrix.multiplyAtIndex(12, e.deviceScaleFactor), this._webvrViewMatrix.multiplyAtIndex(13, e.deviceScaleFactor), this._webvrViewMatrix.multiplyAtIndex(14, e.deviceScaleFactor)), this._webvrViewMatrix.invert()), e._correctPositionIfNotTrackPosition(this._webvrViewMatrix, !0), e._worldToDevice.multiplyToRef(this._webvrViewMatrix, this._webvrViewMatrix), this._workingMatrix = this._workingMatrix || u.a.Identity(), this._webvrViewMatrix.invertToRef(this._workingMatrix), this._workingMatrix.multiplyToRef(e.getWorldMatrix(), this._workingMatrix), this._workingMatrix.getTranslationToRef(this._globalPosition), this._markSyncedWithParent(), this._webvrViewMatrix;\n          }, t.prototype._getWebVRProjectionMatrix = function() {\n            var e = this.parent;\n            e._vrDevice.depthNear = e.minZ, e._vrDevice.depthFar = e.maxZ;\n            var n = this._cameraRigParams.left ? this._cameraRigParams.frameData.leftProjectionMatrix : this._cameraRigParams.frameData.rightProjectionMatrix;\n            return u.a.FromArrayToRef(n, 0, this._projectionMatrix), this.getScene().useRightHandedSystem || this._projectionMatrix.toggleProjectionMatrixHandInPlace(), this._projectionMatrix;\n          }, t.prototype.initControllers = function() {\n            var e = this;\n            this.controllers = [];\n            var n = this.getScene().gamepadManager;\n            this._onGamepadDisconnectedObserver = n.onGamepadDisconnectedObservable.add(function(i) {\n              if (i.type === hn.POSE_ENABLED) {\n                var o = i;\n                o.defaultModel && o.defaultModel.setEnabled(!1), o.hand === \"right\" && (e._rightController = null), o.hand === \"left\" && (e._leftController = null);\n                var a = e.controllers.indexOf(o);\n                a !== -1 && e.controllers.splice(a, 1);\n              }\n            }), this._onGamepadConnectedObserver = n.onGamepadConnectedObservable.add(function(i) {\n              if (i.type === hn.POSE_ENABLED) {\n                var o = i;\n                if (e.webVROptions.trackPosition || (o._disableTrackPosition(new u.e(o.hand == \"left\" ? -0.15 : 0.15, -0.5, 0.25)), e._updateCacheWhenTrackingDisabledObserver || (e._updateCacheWhenTrackingDisabledObserver = e._scene.onBeforeRenderObservable.add(function() {\n                  e._updateCache();\n                }))), o.deviceScaleFactor = e.deviceScaleFactor, o._deviceToWorld.copyFrom(e._deviceToWorld), e._correctPositionIfNotTrackPosition(o._deviceToWorld), e.webVROptions.controllerMeshes && (o.defaultModel ? o.defaultModel.setEnabled(!0) : o.initControllerMesh(e.getScene(), function(d) {\n                  if (d.scaling.scaleInPlace(e.deviceScaleFactor), e.onControllerMeshLoadedObservable.notifyObservers(o), e.webVROptions.defaultLightingOnControllers) {\n                    e._lightOnControllers || (e._lightOnControllers = new Oo.a(\"vrControllersLight\", new u.e(0, 1, 0), e.getScene()));\n                    var p = function(y, P) {\n                      var R = y.getChildren();\n                      R && R.length !== 0 && R.forEach(function(B) {\n                        P.includedOnlyMeshes.push(B), p(B, P);\n                      });\n                    };\n                    e._lightOnControllers.includedOnlyMeshes.push(d), p(d, e._lightOnControllers);\n                  }\n                })), o.attachToPoseControlledCamera(e), e.controllers.indexOf(o) === -1) {\n                  e.controllers.push(o);\n                  for (var a = !1, s = 0; s < e.controllers.length; s++)\n                    e.controllers[s].controllerType === Jn.VIVE && (a ? e.controllers[s].hand = \"right\" : (a = !0, e.controllers[s].hand = \"left\"));\n                  e.controllers.length >= 2 && e.onControllersAttachedObservable.notifyObservers(e.controllers);\n                }\n              }\n            });\n          }, t;\n        }(zn), Oi = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.onTriggerStateChangedObservable = new C.c(), n.onMainButtonStateChangedObservable = new C.c(), n.onSecondaryButtonStateChangedObservable = new C.c(), n.onPadStateChangedObservable = new C.c(), n.onPadValuesChangedObservable = new C.c(), n.pad = { x: 0, y: 0 }, n._changes = { pressChanged: !1, touchChanged: !1, valueChanged: !1, changed: !1 }, n._buttons = new Array(e.buttons.length), n.hand = e.hand, n;\n          }\n          return Object(c.d)(t, r), t.prototype.onButtonStateChange = function(e) {\n            this._onButtonStateChange = e;\n          }, Object.defineProperty(t.prototype, \"defaultModel\", { get: function() {\n            return this._defaultModel;\n          }, enumerable: !1, configurable: !0 }), t.prototype.update = function() {\n            r.prototype.update.call(this);\n            for (var e = 0; e < this._buttons.length; e++)\n              this._setButtonValue(this.browserGamepad.buttons[e], this._buttons[e], e);\n            this.leftStick.x === this.pad.x && this.leftStick.y === this.pad.y || (this.pad.x = this.leftStick.x, this.pad.y = this.leftStick.y, this.onPadValuesChangedObservable.notifyObservers(this.pad));\n          }, t.prototype._setButtonValue = function(e, n, i) {\n            e || (e = { pressed: !1, touched: !1, value: 0 }), n ? (this._checkChanges(e, n), this._changes.changed && (this._onButtonStateChange && this._onButtonStateChange(this.index, i, e), this._handleButtonChange(i, e, this._changes)), this._buttons[i].pressed = e.pressed, this._buttons[i].touched = e.touched, this._buttons[i].value = e.value < 1e-8 ? 0 : e.value) : this._buttons[i] = { pressed: e.pressed, touched: e.touched, value: e.value };\n          }, t.prototype._checkChanges = function(e, n) {\n            return this._changes.pressChanged = e.pressed !== n.pressed, this._changes.touchChanged = e.touched !== n.touched, this._changes.valueChanged = e.value !== n.value, this._changes.changed = this._changes.pressChanged || this._changes.touchChanged || this._changes.valueChanged, this._changes;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._defaultModel = null, this.onTriggerStateChangedObservable.clear(), this.onMainButtonStateChangedObservable.clear(), this.onSecondaryButtonStateChangedObservable.clear(), this.onPadStateChangedObservable.clear(), this.onPadValuesChangedObservable.clear();\n          }, t;\n        }(ar), vn = f(42), Nt = f(30), pi = f(62), Pf = (f(108), f(59), f(109), `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main(void)\n{\nvec4 result=texture2D(textureSampler,vUV);\n#ifdef IMAGEPROCESSING\n#ifndef FROMLINEARSPACE\n\nresult.rgb=toLinearSpace(result.rgb);\n#endif\nresult=applyImageProcessing(result);\n#else\n\n#ifdef FROMLINEARSPACE\nresult=applyImageProcessing(result);\n#endif\n#endif\ngl_FragColor=result;\n}`);\n        ze.a.ShadersStore.imageProcessingPixelShader = Pf;\n        var Io = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, e, \"imageProcessing\", [], [], n, i, o, a, s, null, d, \"postprocess\", null, !0) || this;\n            return y._fromLinearSpace = !0, y._defines = { IMAGEPROCESSING: !1, VIGNETTE: !1, VIGNETTEBLENDMODEMULTIPLY: !1, VIGNETTEBLENDMODEOPAQUE: !1, TONEMAPPING: !1, TONEMAPPING_ACES: !1, CONTRAST: !1, COLORCURVES: !1, COLORGRADING: !1, COLORGRADING3D: !1, FROMLINEARSPACE: !1, SAMPLER3DGREENDEPTH: !1, SAMPLER3DBGRMAP: !1, IMAGEPROCESSINGPOSTPROCESS: !1, EXPOSURE: !1 }, p ? (p.applyByPostProcess = !0, y._attachImageProcessingConfiguration(p, !0), y.fromLinearSpace = !1) : (y._attachImageProcessingConfiguration(null, !0), y.imageProcessingConfiguration.applyByPostProcess = !0), y.onApply = function(P) {\n              y.imageProcessingConfiguration.bind(P, y.aspectRatio);\n            }, y;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            e.applyByPostProcess = !0, this._attachImageProcessingConfiguration(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype._attachImageProcessingConfiguration = function(e, n) {\n            var i = this;\n            if (n === void 0 && (n = !1), e !== this._imageProcessingConfiguration) {\n              if (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), e)\n                this._imageProcessingConfiguration = e;\n              else {\n                var o = null, a = this.getEngine(), s = this.getCamera();\n                if (s)\n                  o = s.getScene();\n                else if (a && a.scenes) {\n                  var d = a.scenes;\n                  o = d[d.length - 1];\n                } else\n                  o = te.a.LastCreatedScene;\n                this._imageProcessingConfiguration = o ? o.imageProcessingConfiguration : new vn.a();\n              }\n              this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n                i._updateParameters();\n              })), n || this._updateParameters();\n            }\n          }, Object.defineProperty(t.prototype, \"isSupported\", { get: function() {\n            var e = this.getEffect();\n            return !e || e.isSupported;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorCurves\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurves;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurves = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorGradingTexture\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"colorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"exposure\", { get: function() {\n            return this.imageProcessingConfiguration.exposure;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.exposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"toneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"toneMappingType\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingType;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingType = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"contrast\", { get: function() {\n            return this.imageProcessingConfiguration.contrast;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.contrast = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteStretch\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteStretch;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteStretch = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteCentreX\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteCentreX;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteCentreX = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteCentreY\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteCentreY;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteCentreY = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteWeight\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteWeight;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteWeight = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteColor\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteColor;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteColor = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteCameraFov\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteCameraFov;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteCameraFov = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteBlendMode\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteBlendMode;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteBlendMode = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vignetteEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.vignetteEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.vignetteEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fromLinearSpace\", { get: function() {\n            return this._fromLinearSpace;\n          }, set: function(e) {\n            this._fromLinearSpace !== e && (this._fromLinearSpace = e, this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"ImageProcessingPostProcess\";\n          }, t.prototype._updateParameters = function() {\n            this._defines.FROMLINEARSPACE = this._fromLinearSpace, this.imageProcessingConfiguration.prepareDefines(this._defines, !0);\n            var e = \"\";\n            for (var n in this._defines)\n              this._defines[n] && (e += \"#define \" + n + `;\\r\n`);\n            var i = [\"textureSampler\"], o = [\"scale\"];\n            vn.a && (vn.a.PrepareSamplers(i, this._defines), vn.a.PrepareUniforms(o, this._defines)), this.updateEffect(e, o, i);\n          }, t.prototype.dispose = function(e) {\n            r.prototype.dispose.call(this, e), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration && (this.imageProcessingConfiguration.applyByPostProcess = !1);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"_fromLinearSpace\", void 0), t;\n        }(ft), ht = f(16), Oe = f(4);\n        Ie.a._GroundMeshParser = function(r, t) {\n          return Do.Parse(r, t);\n        };\n        var Do = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.generateOctree = !1, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"GroundMesh\";\n          }, Object.defineProperty(t.prototype, \"subdivisions\", { get: function() {\n            return Math.min(this._subdivisionsX, this._subdivisionsY);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subdivisionsX\", { get: function() {\n            return this._subdivisionsX;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subdivisionsY\", { get: function() {\n            return this._subdivisionsY;\n          }, enumerable: !1, configurable: !0 }), t.prototype.optimize = function(e, n) {\n            n === void 0 && (n = 32), this._subdivisionsX = e, this._subdivisionsY = e, this.subdivide(e), this.createOrUpdateSubmeshesOctree && this.createOrUpdateSubmeshesOctree(n);\n          }, t.prototype.getHeightAtCoordinates = function(e, n) {\n            var i = this.getWorldMatrix(), o = u.c.Matrix[5];\n            i.invertToRef(o);\n            var a = u.c.Vector3[8];\n            if (u.e.TransformCoordinatesFromFloatsToRef(e, 0, n, o, a), e = a.x, n = a.z, e < this._minX || e > this._maxX || n < this._minZ || n > this._maxZ)\n              return this.position.y;\n            this._heightQuads && this._heightQuads.length != 0 || (this._initHeightQuads(), this._computeHeightQuads());\n            var s = this._getFacetAt(e, n), d = -(s.x * e + s.z * n + s.w) / s.y;\n            return u.e.TransformCoordinatesFromFloatsToRef(0, d, 0, i, a), a.y;\n          }, t.prototype.getNormalAtCoordinates = function(e, n) {\n            var i = new u.e(0, 1, 0);\n            return this.getNormalAtCoordinatesToRef(e, n, i), i;\n          }, t.prototype.getNormalAtCoordinatesToRef = function(e, n, i) {\n            var o = this.getWorldMatrix(), a = u.c.Matrix[5];\n            o.invertToRef(a);\n            var s = u.c.Vector3[8];\n            if (u.e.TransformCoordinatesFromFloatsToRef(e, 0, n, a, s), e = s.x, n = s.z, e < this._minX || e > this._maxX || n < this._minZ || n > this._maxZ)\n              return this;\n            this._heightQuads && this._heightQuads.length != 0 || (this._initHeightQuads(), this._computeHeightQuads());\n            var d = this._getFacetAt(e, n);\n            return u.e.TransformNormalFromFloatsToRef(d.x, d.y, d.z, o, i), this;\n          }, t.prototype.updateCoordinateHeights = function() {\n            return this._heightQuads && this._heightQuads.length != 0 || this._initHeightQuads(), this._computeHeightQuads(), this;\n          }, t.prototype._getFacetAt = function(e, n) {\n            var i = Math.floor((e + this._maxX) * this._subdivisionsX / this._width), o = Math.floor(-(n + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY), a = this._heightQuads[o * this._subdivisionsX + i];\n            return n < a.slope.x * e + a.slope.y ? a.facet1 : a.facet2;\n          }, t.prototype._initHeightQuads = function() {\n            var e = this._subdivisionsX, n = this._subdivisionsY;\n            this._heightQuads = new Array();\n            for (var i = 0; i < n; i++)\n              for (var o = 0; o < e; o++) {\n                var a = { slope: u.d.Zero(), facet1: new u.f(0, 0, 0, 0), facet2: new u.f(0, 0, 0, 0) };\n                this._heightQuads[i * e + o] = a;\n              }\n            return this;\n          }, t.prototype._computeHeightQuads = function() {\n            var e = this.getVerticesData(Oe.b.PositionKind);\n            if (!e)\n              return this;\n            for (var n = u.c.Vector3[3], i = u.c.Vector3[2], o = u.c.Vector3[1], a = u.c.Vector3[0], s = u.c.Vector3[4], d = u.c.Vector3[5], p = u.c.Vector3[6], y = u.c.Vector3[7], P = u.c.Vector3[8], R = 0, B = 0, F = 0, z = 0, J = 0, ie = 0, se = 0, ce = this._subdivisionsX, ue = this._subdivisionsY, fe = 0; fe < ue; fe++)\n              for (var ve = 0; ve < ce; ve++) {\n                R = 3 * ve, B = fe * (ce + 1) * 3, F = (fe + 1) * (ce + 1) * 3, n.x = e[B + R], n.y = e[B + R + 1], n.z = e[B + R + 2], i.x = e[B + R + 3], i.y = e[B + R + 4], i.z = e[B + R + 5], o.x = e[F + R], o.y = e[F + R + 1], o.z = e[F + R + 2], a.x = e[F + R + 3], a.y = e[F + R + 4], a.z = e[F + R + 5], z = (a.z - n.z) / (a.x - n.x), J = n.z - z * n.x, i.subtractToRef(n, s), o.subtractToRef(n, d), a.subtractToRef(n, p), u.e.CrossToRef(p, d, y), u.e.CrossToRef(s, p, P), y.normalize(), P.normalize(), ie = -(y.x * n.x + y.y * n.y + y.z * n.z), se = -(P.x * i.x + P.y * i.y + P.z * i.z);\n                var Te = this._heightQuads[fe * ce + ve];\n                Te.slope.copyFromFloats(z, J), Te.facet1.copyFromFloats(y.x, y.y, y.z, ie), Te.facet2.copyFromFloats(P.x, P.y, P.z, se);\n              }\n            return this;\n          }, t.prototype.serialize = function(e) {\n            r.prototype.serialize.call(this, e), e.subdivisionsX = this._subdivisionsX, e.subdivisionsY = this._subdivisionsY, e.minX = this._minX, e.maxX = this._maxX, e.minZ = this._minZ, e.maxZ = this._maxZ, e.width = this._width, e.height = this._height;\n          }, t.Parse = function(e, n) {\n            var i = new t(e.name, n);\n            return i._subdivisionsX = e.subdivisionsX || 1, i._subdivisionsY = e.subdivisionsY || 1, i._minX = e.minX, i._maxX = e.maxX, i._minZ = e.minZ, i._maxZ = e.maxZ, i._width = e.width, i._height = e.height, i;\n          }, t;\n        }(Ie.a), ns = f(70);\n        ht.a.CreateGround = function(r) {\n          var t, e, n = [], i = [], o = [], a = [], s = r.width || 1, d = r.height || 1, p = r.subdivisionsX || r.subdivisions || 1, y = r.subdivisionsY || r.subdivisions || 1;\n          for (t = 0; t <= y; t++)\n            for (e = 0; e <= p; e++) {\n              var P = new u.e(e * s / p - s / 2, 0, (y - t) * d / y - d / 2), R = new u.e(0, 1, 0);\n              i.push(P.x, P.y, P.z), o.push(R.x, R.y, R.z), a.push(e / p, 1 - t / y);\n            }\n          for (t = 0; t < y; t++)\n            for (e = 0; e < p; e++)\n              n.push(e + 1 + (t + 1) * (p + 1)), n.push(e + 1 + t * (p + 1)), n.push(e + t * (p + 1)), n.push(e + (t + 1) * (p + 1)), n.push(e + 1 + (t + 1) * (p + 1)), n.push(e + t * (p + 1));\n          var B = new ht.a();\n          return B.indices = n, B.positions = i, B.normals = o, B.uvs = a, B;\n        }, ht.a.CreateTiledGround = function(r) {\n          var t, e, n, i, o = r.xmin !== void 0 && r.xmin !== null ? r.xmin : -1, a = r.zmin !== void 0 && r.zmin !== null ? r.zmin : -1, s = r.xmax !== void 0 && r.xmax !== null ? r.xmax : 1, d = r.zmax !== void 0 && r.zmax !== null ? r.zmax : 1, p = r.subdivisions || { w: 1, h: 1 }, y = r.precision || { w: 1, h: 1 }, P = new Array(), R = new Array(), B = new Array(), F = new Array();\n          p.h = p.h < 1 ? 1 : p.h, p.w = p.w < 1 ? 1 : p.w, y.w = y.w < 1 ? 1 : y.w, y.h = y.h < 1 ? 1 : y.h;\n          var z = (s - o) / p.w, J = (d - a) / p.h;\n          function ie(ce, ue, fe, ve) {\n            var Te = R.length / 3, Re = y.w + 1;\n            for (t = 0; t < y.h; t++)\n              for (e = 0; e < y.w; e++) {\n                var Ae = [Te + e + t * Re, Te + (e + 1) + t * Re, Te + (e + 1) + (t + 1) * Re, Te + e + (t + 1) * Re];\n                P.push(Ae[1]), P.push(Ae[2]), P.push(Ae[3]), P.push(Ae[0]), P.push(Ae[1]), P.push(Ae[3]);\n              }\n            var Ee = u.e.Zero(), Se = new u.e(0, 1, 0);\n            for (t = 0; t <= y.h; t++)\n              for (Ee.z = t * (ve - ue) / y.h + ue, e = 0; e <= y.w; e++)\n                Ee.x = e * (fe - ce) / y.w + ce, Ee.y = 0, R.push(Ee.x, Ee.y, Ee.z), B.push(Se.x, Se.y, Se.z), F.push(e / y.w, t / y.h);\n          }\n          for (n = 0; n < p.h; n++)\n            for (i = 0; i < p.w; i++)\n              ie(o + i * z, a + n * J, o + (i + 1) * z, a + (n + 1) * J);\n          var se = new ht.a();\n          return se.indices = P, se.positions = R, se.normals = B, se.uvs = F, se;\n        }, ht.a.CreateGroundFromHeightMap = function(r) {\n          var t, e, n = [], i = [], o = [], a = [], s = r.colorFilter || new I.a(0.3, 0.59, 0.11), d = r.alphaFilter || 0, p = !1;\n          if (r.minHeight > r.maxHeight) {\n            p = !0;\n            var y = r.maxHeight;\n            r.maxHeight = r.minHeight, r.minHeight = y;\n          }\n          for (t = 0; t <= r.subdivisions; t++)\n            for (e = 0; e <= r.subdivisions; e++) {\n              var P = new u.e(e * r.width / r.subdivisions - r.width / 2, 0, (r.subdivisions - t) * r.height / r.subdivisions - r.height / 2), R = 4 * (((P.x + r.width / 2) / r.width * (r.bufferWidth - 1) | 0) + ((1 - (P.z + r.height / 2) / r.height) * (r.bufferHeight - 1) | 0) * r.bufferWidth), B = r.buffer[R] / 255, F = r.buffer[R + 1] / 255, z = r.buffer[R + 2] / 255, J = r.buffer[R + 3] / 255;\n              p && (B = 1 - B, F = 1 - F, z = 1 - z);\n              var ie = B * s.r + F * s.g + z * s.b;\n              P.y = J >= d ? r.minHeight + (r.maxHeight - r.minHeight) * ie : r.minHeight - Vt.a, i.push(P.x, P.y, P.z), o.push(0, 0, 0), a.push(e / r.subdivisions, 1 - t / r.subdivisions);\n            }\n          for (t = 0; t < r.subdivisions; t++)\n            for (e = 0; e < r.subdivisions; e++) {\n              var se = e + 1 + (t + 1) * (r.subdivisions + 1), ce = e + 1 + t * (r.subdivisions + 1), ue = e + t * (r.subdivisions + 1), fe = e + (t + 1) * (r.subdivisions + 1), ve = i[3 * se + 1] >= r.minHeight, Te = i[3 * ce + 1] >= r.minHeight, Re = i[3 * ue + 1] >= r.minHeight;\n              ve && Te && Re && (n.push(se), n.push(ce), n.push(ue)), i[3 * fe + 1] >= r.minHeight && ve && Re && (n.push(fe), n.push(se), n.push(ue));\n            }\n          ht.a.ComputeNormals(i, n, o);\n          var Ae = new ht.a();\n          return Ae.indices = n, Ae.positions = i, Ae.normals = o, Ae.uvs = a, Ae;\n        }, Ie.a.CreateGround = function(r, t, e, n, i, o) {\n          var a = { width: t, height: e, subdivisions: n, updatable: o };\n          return Mi.CreateGround(r, a, i);\n        }, Ie.a.CreateTiledGround = function(r, t, e, n, i, o, a, s, d) {\n          var p = { xmin: t, zmin: e, xmax: n, zmax: i, subdivisions: o, precision: a, updatable: d };\n          return Mi.CreateTiledGround(r, p, s);\n        }, Ie.a.CreateGroundFromHeightMap = function(r, t, e, n, i, o, a, s, d, p, y) {\n          var P = { width: e, height: n, subdivisions: i, minHeight: o, maxHeight: a, updatable: d, onReady: p, alphaFilter: y };\n          return Mi.CreateGroundFromHeightMap(r, t, P, s);\n        };\n        var Mi = function() {\n          function r() {\n          }\n          return r.CreateGround = function(t, e, n) {\n            var i = new Do(t, n);\n            return i._setReady(!1), i._subdivisionsX = e.subdivisionsX || e.subdivisions || 1, i._subdivisionsY = e.subdivisionsY || e.subdivisions || 1, i._width = e.width || 1, i._height = e.height || 1, i._maxX = i._width / 2, i._maxZ = i._height / 2, i._minX = -i._maxX, i._minZ = -i._maxZ, ht.a.CreateGround(e).applyToMesh(i, e.updatable), i._setReady(!0), i;\n          }, r.CreateTiledGround = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return ht.a.CreateTiledGround(e).applyToMesh(i, e.updatable), i;\n          }, r.CreateGroundFromHeightMap = function(t, e, n, i) {\n            i === void 0 && (i = null);\n            var o = n.width || 10, a = n.height || 10, s = n.subdivisions || 1, d = n.minHeight || 0, p = n.maxHeight || 1, y = n.colorFilter || new I.a(0.3, 0.59, 0.11), P = n.alphaFilter || 0, R = n.updatable, B = n.onReady;\n            i = i || te.a.LastCreatedScene;\n            var F = new Do(t, i);\n            return F._subdivisionsX = s, F._subdivisionsY = s, F._width = o, F._height = a, F._maxX = F._width / 2, F._maxZ = F._height / 2, F._minX = -F._maxX, F._minZ = -F._maxZ, F._setReady(!1), Xe.b.LoadImage(e, function(z) {\n              var J = z.width, ie = z.height, se = ns.a.CreateCanvas(J, ie).getContext(\"2d\");\n              if (!se)\n                throw new Error(\"Unable to get 2d context for CreateGroundFromHeightMap\");\n              if (!i.isDisposed) {\n                se.drawImage(z, 0, 0);\n                var ce = se.getImageData(0, 0, J, ie).data;\n                ht.a.CreateGroundFromHeightMap({ width: o, height: a, subdivisions: s, minHeight: d, maxHeight: p, colorFilter: y, buffer: ce, bufferWidth: J, bufferHeight: ie, alphaFilter: P }).applyToMesh(F, R), B && B(F), F._setReady(!0);\n              }\n            }, function() {\n            }, i.offlineProvider), F;\n          }, r;\n        }();\n        ht.a.CreateTorus = function(r) {\n          for (var t = [], e = [], n = [], i = [], o = r.diameter || 1, a = r.thickness || 0.5, s = r.tessellation || 16, d = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, p = s + 1, y = 0; y <= s; y++)\n            for (var P = y / s, R = y * Math.PI * 2 / s - Math.PI / 2, B = u.a.Translation(o / 2, 0, 0).multiply(u.a.RotationY(R)), F = 0; F <= s; F++) {\n              var z = 1 - F / s, J = F * Math.PI * 2 / s + Math.PI, ie = Math.cos(J), se = Math.sin(J), ce = new u.e(ie, se, 0), ue = ce.scale(a / 2), fe = new u.d(P, z);\n              ue = u.e.TransformCoordinates(ue, B), ce = u.e.TransformNormal(ce, B), e.push(ue.x, ue.y, ue.z), n.push(ce.x, ce.y, ce.z), i.push(fe.x, fe.y);\n              var ve = (y + 1) % p, Te = (F + 1) % p;\n              t.push(y * p + F), t.push(y * p + Te), t.push(ve * p + F), t.push(y * p + Te), t.push(ve * p + Te), t.push(ve * p + F);\n            }\n          ht.a._ComputeSides(d, e, t, n, i, r.frontUVs, r.backUVs);\n          var Re = new ht.a();\n          return Re.indices = t, Re.positions = e, Re.normals = n, Re.uvs = i, Re;\n        }, Ie.a.CreateTorus = function(r, t, e, n, i, o, a) {\n          var s = { diameter: t, thickness: e, tessellation: n, sideOrientation: a, updatable: o };\n          return lr.CreateTorus(r, s, i);\n        };\n        var fn, Yi, lr = function() {\n          function r() {\n          }\n          return r.CreateTorus = function(t, e, n) {\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTorus(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }(), ci = f(53), is = function() {\n          function r() {\n          }\n          return r.GetDefaults = function(t) {\n            var e = new r();\n            return e.canvasOptions = { antialias: !0, depth: !0, stencil: !t || t.isStencilEnable, alpha: !0, multiview: !1, framebufferScaleFactor: 1 }, e.newCanvasCssStyle = \"position:absolute; bottom:0px;right:0px;z-index:10;width:90%;height:100%;background-color: #000000;\", e;\n          }, r;\n        }(), Rl = function() {\n          function r(t, e) {\n            var n = this;\n            if (e === void 0 && (e = is.GetDefaults()), this._options = e, this._canvas = null, this.xrLayer = null, this.onXRLayerInitObservable = new C.c(), this._engine = t.scene.getEngine(), e.canvasElement)\n              this._setManagedOutputCanvas(e.canvasElement);\n            else {\n              var i = document.createElement(\"canvas\");\n              i.style.cssText = this._options.newCanvasCssStyle || \"position:absolute; bottom:0px;right:0px;\", this._setManagedOutputCanvas(i);\n            }\n            t.onXRSessionInit.add(function() {\n              n._addCanvas();\n            }), t.onXRSessionEnded.add(function() {\n              n._removeCanvas();\n            });\n          }\n          return r.prototype.dispose = function() {\n            this._removeCanvas(), this._setManagedOutputCanvas(null);\n          }, r.prototype.initializeXRLayerAsync = function(t) {\n            var e = this, n = function() {\n              var i = new XRWebGLLayer(t, e.canvasContext, e._options.canvasOptions);\n              return e.onXRLayerInitObservable.notifyObservers(i), i;\n            };\n            return this.canvasContext.makeXRCompatible ? this.canvasContext.makeXRCompatible().then(function() {\n              return e.xrLayer = n(), e.xrLayer;\n            }) : (this.xrLayer = n(), Promise.resolve(this.xrLayer));\n          }, r.prototype._addCanvas = function() {\n            var t = this;\n            this._canvas && this._canvas !== this._engine.getRenderingCanvas() && document.body.appendChild(this._canvas), this.xrLayer ? this._setCanvasSize(!0) : this.onXRLayerInitObservable.addOnce(function(e) {\n              t._setCanvasSize(!0, e);\n            });\n          }, r.prototype._removeCanvas = function() {\n            this._canvas && document.body.contains(this._canvas) && this._canvas !== this._engine.getRenderingCanvas() && document.body.removeChild(this._canvas), this._setCanvasSize(!1);\n          }, r.prototype._setCanvasSize = function(t, e) {\n            t === void 0 && (t = !0), e === void 0 && (e = this.xrLayer), this._canvas && (t ? e && (this._canvas !== this._engine.getRenderingCanvas() ? (this._canvas.style.width = e.framebufferWidth + \"px\", this._canvas.style.height = e.framebufferHeight + \"px\") : this._engine.setSize(e.framebufferWidth, e.framebufferHeight)) : this._originalCanvasSize && (this._canvas !== this._engine.getRenderingCanvas() ? (this._canvas.style.width = this._originalCanvasSize.width + \"px\", this._canvas.style.height = this._originalCanvasSize.height + \"px\") : this._engine.setSize(this._originalCanvasSize.width, this._originalCanvasSize.height)));\n          }, r.prototype._setManagedOutputCanvas = function(t) {\n            this._removeCanvas(), t ? (this._originalCanvasSize = { width: t.offsetWidth, height: t.offsetHeight }, this._canvas = t, this.canvasContext = this._canvas.getContext(\"webgl2\"), this.canvasContext || (this.canvasContext = this._canvas.getContext(\"webgl\"))) : (this._canvas = null, this.canvasContext = null);\n          }, r;\n        }(), rs = function() {\n          function r(t) {\n            this.scene = t, this._sessionEnded = !1, this.baseLayer = null, this.currentTimestamp = -1, this.defaultHeightCompensation = 1.7, this.onXRFrameObservable = new C.c(), this.onXRReferenceSpaceChanged = new C.c(), this.onXRSessionEnded = new C.c(), this.onXRSessionInit = new C.c();\n          }\n          return Object.defineProperty(r.prototype, \"referenceSpace\", { get: function() {\n            return this._referenceSpace;\n          }, set: function(t) {\n            this._referenceSpace = t, this.onXRReferenceSpaceChanged.notifyObservers(this._referenceSpace);\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._sessionEnded || this.exitXRAsync(), this.onXRFrameObservable.clear(), this.onXRSessionEnded.clear(), this.onXRReferenceSpaceChanged.clear(), this.onXRSessionInit.clear();\n          }, r.prototype.exitXRAsync = function() {\n            return this.session && !this._sessionEnded ? (this._sessionEnded = !0, this.session.end().catch(function(t) {\n              l.a.Warn(\"Could not end XR session.\");\n            })) : Promise.resolve();\n          }, r.prototype.getRenderTargetTextureForEye = function(t) {\n            return this._rttProvider.getRenderTargetForEye(t);\n          }, r.prototype.getWebXRRenderTarget = function(t) {\n            var e = this.scene.getEngine();\n            return this._xrNavigator.xr.native ? this._xrNavigator.xr.getWebXRRenderTarget(e) : ((t = t || is.GetDefaults(e)).canvasElement = e.getRenderingCanvas() || void 0, new Rl(this, t));\n          }, r.prototype.initializeAsync = function() {\n            return this._xrNavigator = navigator, this._xrNavigator.xr ? Promise.resolve() : Promise.reject(\"WebXR not available\");\n          }, r.prototype.initializeSessionAsync = function(t, e) {\n            var n = this;\n            return t === void 0 && (t = \"immersive-vr\"), e === void 0 && (e = {}), this._xrNavigator.xr.requestSession(t, e).then(function(i) {\n              return n.session = i, n.onXRSessionInit.notifyObservers(i), n._sessionEnded = !1, n.session.addEventListener(\"end\", function() {\n                var o = n.scene.getEngine();\n                n._sessionEnded = !0, n._rttProvider = null, o.framebufferDimensionsObject = null, o.restoreDefaultFramebuffer(), o.customAnimationFrameRequester = null, n.onXRSessionEnded.notifyObservers(null), o._renderLoop();\n              }, { once: !0 }), n.session;\n            });\n          }, r.prototype.isSessionSupportedAsync = function(t) {\n            return r.IsSessionSupportedAsync(t);\n          }, r.prototype.resetReferenceSpace = function() {\n            this.referenceSpace = this.baseReferenceSpace;\n          }, r.prototype.runXRRenderLoop = function() {\n            var t = this, e = this.scene.getEngine();\n            if (e.customAnimationFrameRequester = { requestAnimationFrame: this.session.requestAnimationFrame.bind(this.session), renderFunction: function(i, o) {\n              t._sessionEnded || (t.currentFrame = o, t.currentTimestamp = i, o && (e.framebufferDimensionsObject = t.baseLayer, t.onXRFrameObservable.notifyObservers(o), e._renderLoop(), e.framebufferDimensionsObject = null));\n            } }, this._xrNavigator.xr.native)\n              this._rttProvider = this._xrNavigator.xr.getNativeRenderTargetProvider(this.session, this._createRenderTargetTexture.bind(this));\n            else {\n              var n = this._createRenderTargetTexture(this.baseLayer.framebufferWidth, this.baseLayer.framebufferHeight, this.baseLayer.framebuffer);\n              this._rttProvider = { getRenderTargetForEye: function() {\n                return n;\n              } }, e.framebufferDimensionsObject = this.baseLayer;\n            }\n            typeof window < \"u\" && window.cancelAnimationFrame && window.cancelAnimationFrame(e._frameHandler), e._renderLoop();\n          }, r.prototype.setReferenceSpaceTypeAsync = function(t) {\n            var e = this;\n            return t === void 0 && (t = \"local-floor\"), this.session.requestReferenceSpace(t).then(function(n) {\n              return n;\n            }, function(n) {\n              return l.a.Error(\"XR.requestReferenceSpace failed for the following reason: \"), l.a.Error(n), l.a.Log('Defaulting to universally-supported \"viewer\" reference space type.'), e.session.requestReferenceSpace(\"viewer\").then(function(i) {\n                var o = new XRRigidTransform({ x: 0, y: -e.defaultHeightCompensation, z: 0 });\n                return i.getOffsetReferenceSpace(o);\n              }, function(i) {\n                throw l.a.Error(i), 'XR initialization failed: required \"viewer\" reference space type not supported.';\n              });\n            }).then(function(n) {\n              return e.session.requestReferenceSpace(\"viewer\").then(function(i) {\n                return e.viewerReferenceSpace = i, n;\n              });\n            }).then(function(n) {\n              return e.referenceSpace = e.baseReferenceSpace = n, e.referenceSpace;\n            });\n          }, r.prototype.updateRenderStateAsync = function(t) {\n            return t.baseLayer && (this.baseLayer = t.baseLayer), this.session.updateRenderState(t);\n          }, r.IsSessionSupportedAsync = function(t) {\n            if (!navigator.xr)\n              return Promise.resolve(!1);\n            var e = navigator.xr.isSessionSupported || navigator.xr.supportsSession;\n            return e ? e.call(navigator.xr, t).then(function(n) {\n              var i = n === void 0 || n;\n              return Promise.resolve(i);\n            }).catch(function(n) {\n              return l.a.Warn(n), Promise.resolve(!1);\n            }) : Promise.resolve(!1);\n          }, r.prototype._createRenderTargetTexture = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Pt.a(this.scene.getEngine(), Pt.b.Unknown, !0);\n            i.width = t, i.height = e, i._framebuffer = n;\n            var o = new on(\"XR renderTargetTexture\", { width: t, height: e }, this.scene, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, !0);\n            return o._texture = i, o;\n          }, r;\n        }();\n        (function(r) {\n          r[r.ENTERING_XR = 0] = \"ENTERING_XR\", r[r.EXITING_XR = 1] = \"EXITING_XR\", r[r.IN_XR = 2] = \"IN_XR\", r[r.NOT_IN_XR = 3] = \"NOT_IN_XR\";\n        })(fn || (fn = {})), function(r) {\n          r[r.NOT_TRACKING = 0] = \"NOT_TRACKING\", r[r.TRACKING_LOST = 1] = \"TRACKING_LOST\", r[r.TRACKING = 2] = \"TRACKING\";\n        }(Yi || (Yi = {}));\n        var $n, Ol = function() {\n          function r(t, e) {\n            if (e === void 0 && (e = null), this.scene = t, this._pointerDownOnMeshAsked = !1, this._isActionableMesh = !1, this._teleportationRequestInitiated = !1, this._teleportationBackRequestInitiated = !1, this._rotationRightAsked = !1, this._rotationLeftAsked = !1, this._dpadPressed = !0, this._activePointer = !1, this._id = r._idCounter++, e)\n              this._gazeTracker = e.clone(\"gazeTracker\");\n            else {\n              this._gazeTracker = Ie.a.CreateTorus(\"gazeTracker\", 35e-4, 25e-4, 20, t, !1), this._gazeTracker.bakeCurrentTransformIntoVertices(), this._gazeTracker.isPickable = !1, this._gazeTracker.isVisible = !1;\n              var n = new Nt.a(\"targetMat\", t);\n              n.specularColor = I.a.Black(), n.emissiveColor = new I.a(0.7, 0.7, 0.7), n.backFaceCulling = !1, this._gazeTracker.material = n;\n            }\n          }\n          return r.prototype._getForwardRay = function(t) {\n            return new dn.a(u.e.Zero(), new u.e(0, 0, t));\n          }, r.prototype._selectionPointerDown = function() {\n            this._pointerDownOnMeshAsked = !0, this._currentHit && this.scene.simulatePointerDown(this._currentHit, { pointerId: this._id });\n          }, r.prototype._selectionPointerUp = function() {\n            this._currentHit && this.scene.simulatePointerUp(this._currentHit, { pointerId: this._id }), this._pointerDownOnMeshAsked = !1;\n          }, r.prototype._activatePointer = function() {\n            this._activePointer = !0;\n          }, r.prototype._deactivatePointer = function() {\n            this._activePointer = !1;\n          }, r.prototype._updatePointerDistance = function(t) {\n          }, r.prototype.dispose = function() {\n            this._interactionsEnabled = !1, this._teleportationEnabled = !1, this._gazeTracker && this._gazeTracker.dispose();\n          }, r._idCounter = 0, r;\n        }(), xf = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, n, i) || this;\n            o.webVRController = e, o._laserPointer = Ie.a.CreateCylinder(\"laserPointer\", 1, 4e-3, 2e-4, 20, 1, n, !1);\n            var a = new Nt.a(\"laserPointerMat\", n);\n            if (a.emissiveColor = new I.a(0.7, 0.7, 0.7), a.alpha = 0.6, o._laserPointer.material = a, o._laserPointer.rotation.x = Math.PI / 2, o._laserPointer.position.z = -0.5, o._laserPointer.isVisible = !1, o._laserPointer.isPickable = !1, !e.mesh) {\n              var s = new Ie.a(\"preloadControllerMesh\", n), d = new Ie.a(ar.POINTING_POSE, n);\n              d.rotation.x = -0.7, s.addChild(d), e.attachToMesh(s);\n            }\n            return o._setLaserPointerParent(e.mesh), o._meshAttachedObserver = e._meshAttachedObservable.add(function(p) {\n              o._setLaserPointerParent(p);\n            }), o;\n          }\n          return Object(c.d)(t, r), t.prototype._getForwardRay = function(e) {\n            return this.webVRController.getForwardRay(e);\n          }, t.prototype._activatePointer = function() {\n            r.prototype._activatePointer.call(this), this._laserPointer.isVisible = !0;\n          }, t.prototype._deactivatePointer = function() {\n            r.prototype._deactivatePointer.call(this), this._laserPointer.isVisible = !1;\n          }, t.prototype._setLaserPointerColor = function(e) {\n            this._laserPointer.material.emissiveColor = e;\n          }, t.prototype._setLaserPointerLightingDisabled = function(e) {\n            this._laserPointer.material.disableLighting = e;\n          }, t.prototype._setLaserPointerParent = function(e) {\n            var n = function(s) {\n              s.isPickable = !1, s.getChildMeshes().forEach(function(d) {\n                n(d);\n              });\n            };\n            n(e);\n            var i = e.getChildren(void 0, !1), o = e;\n            this.webVRController._pointingPoseNode = null;\n            for (var a = 0; a < i.length; a++)\n              if (i[a].name && i[a].name.indexOf(ar.POINTING_POSE) >= 0) {\n                o = i[a], this.webVRController._pointingPoseNode = o;\n                break;\n              }\n            this._laserPointer.parent = o;\n          }, t.prototype._updatePointerDistance = function(e) {\n            e === void 0 && (e = 100), this._laserPointer.scaling.y = e, this._laserPointer.position.z = -e / 2;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._laserPointer.dispose(), this._meshAttachedObserver && this.webVRController._meshAttachedObservable.remove(this._meshAttachedObserver);\n          }, t;\n        }(Ol), Ml = function(r) {\n          function t(e, n) {\n            var i = r.call(this, n) || this;\n            return i.getCamera = e, i;\n          }\n          return Object(c.d)(t, r), t.prototype._getForwardRay = function(e) {\n            var n = this.getCamera();\n            return n ? n.getForwardRay(e) : new dn.a(u.e.Zero(), u.e.Forward());\n          }, t;\n        }(Ol), Cf = function() {\n        }, Il = function() {\n          function r(t, e) {\n            var n = this;\n            if (e === void 0 && (e = {}), this.webVROptions = e, this._webVRsupported = !1, this._webVRready = !1, this._webVRrequesting = !1, this._webVRpresenting = !1, this._fullscreenVRpresenting = !1, this.enableGazeEvenWhenNoPointerLock = !1, this.exitVROnDoubleTap = !0, this.onEnteringVRObservable = new C.c(), this.onAfterEnteringVRObservable = new C.c(), this.onExitingVRObservable = new C.c(), this.onControllerMeshLoadedObservable = new C.c(), this._useCustomVRButton = !1, this._teleportationRequested = !1, this._teleportActive = !1, this._floorMeshesCollection = [], this._teleportationMode = r.TELEPORTATIONMODE_CONSTANTTIME, this._teleportationTime = 122, this._teleportationSpeed = 20, this._rotationAllowed = !0, this._teleportBackwardsVector = new u.e(0, -1, -1), this._isDefaultTeleportationTarget = !0, this._teleportationFillColor = \"#444444\", this._teleportationBorderColor = \"#FFFFFF\", this._rotationAngle = 0, this._haloCenter = new u.e(0, 0, 0), this._padSensibilityUp = 0.65, this._padSensibilityDown = 0.35, this._leftController = null, this._rightController = null, this._gazeColor = new I.a(0.7, 0.7, 0.7), this._laserColor = new I.a(0.7, 0.7, 0.7), this._pickedLaserColor = new I.a(0.2, 0.2, 1), this._pickedGazeColor = new I.a(0, 0, 1), this.onNewMeshSelected = new C.c(), this.onMeshSelectedWithController = new C.c(), this.onNewMeshPicked = new C.c(), this.onBeforeCameraTeleport = new C.c(), this.onAfterCameraTeleport = new C.c(), this.onSelectedMeshUnselected = new C.c(), this.teleportationEnabled = !0, this._teleportationInitialized = !1, this._interactionsEnabled = !1, this._interactionsRequested = !1, this._displayGaze = !0, this._displayLaserPointer = !0, this.updateGazeTrackerScale = !0, this.updateGazeTrackerColor = !0, this.updateControllerLaserColor = !0, this.requestPointerLockOnFullScreen = !0, this.xrTestDone = !1, this._onResize = function() {\n              n.moveButtonToBottomRight(), n._fullscreenVRpresenting && n._webVRready && n.exitVR();\n            }, this._onFullscreenChange = function() {\n              var o = document;\n              o.fullscreen !== void 0 ? n._fullscreenVRpresenting = document.fullscreen : o.mozFullScreen !== void 0 ? n._fullscreenVRpresenting = o.mozFullScreen : o.webkitIsFullScreen !== void 0 ? n._fullscreenVRpresenting = o.webkitIsFullScreen : o.msIsFullScreen !== void 0 ? n._fullscreenVRpresenting = o.msIsFullScreen : document.msFullscreenElement !== void 0 && (n._fullscreenVRpresenting = document.msFullscreenElement), !n._fullscreenVRpresenting && n._inputElement && (n.exitVR(), !n._useCustomVRButton && n._btnVR && (n._btnVR.style.top = n._inputElement.offsetTop + n._inputElement.offsetHeight - 70 + \"px\", n._btnVR.style.left = n._inputElement.offsetLeft + n._inputElement.offsetWidth - 100 + \"px\", n.updateButtonVisibility()));\n            }, this._cachedAngularSensibility = { angularSensibilityX: null, angularSensibilityY: null, angularSensibility: null }, this.beforeRender = function() {\n              n._leftController && n._leftController._activePointer && n._castRayAndSelectObject(n._leftController), n._rightController && n._rightController._activePointer && n._castRayAndSelectObject(n._rightController), n._noControllerIsActive && (n._scene.getEngine().isPointerLock || n.enableGazeEvenWhenNoPointerLock) ? n._castRayAndSelectObject(n._cameraGazer) : n._cameraGazer._gazeTracker.isVisible = !1;\n            }, this._onNewGamepadConnected = function(o) {\n              if (o.type !== hn.POSE_ENABLED)\n                o.leftStick && o.onleftstickchanged(function(d) {\n                  n._teleportationInitialized && n.teleportationEnabled && (!n._leftController && !n._rightController || n._leftController && !n._leftController._activePointer && n._rightController && !n._rightController._activePointer) && (n._checkTeleportWithRay(d, n._cameraGazer), n._checkTeleportBackwards(d, n._cameraGazer));\n                }), o.rightStick && o.onrightstickchanged(function(d) {\n                  n._teleportationInitialized && n._checkRotate(d, n._cameraGazer);\n                }), o.type === hn.XBOX && (o.onbuttondown(function(d) {\n                  n._interactionsEnabled && d === xn.A && n._cameraGazer._selectionPointerDown();\n                }), o.onbuttonup(function(d) {\n                  n._interactionsEnabled && d === xn.A && n._cameraGazer._selectionPointerUp();\n                }));\n              else {\n                var a = o, s = new xf(a, n._scene, n._cameraGazer._gazeTracker);\n                a.hand === \"right\" || n._leftController && n._leftController.webVRController != a ? n._rightController = s : n._leftController = s, n._tryEnableInteractionOnController(s);\n              }\n            }, this._tryEnableInteractionOnController = function(o) {\n              n._interactionsRequested && !o._interactionsEnabled && n._enableInteractionOnController(o), n._teleportationRequested && !o._teleportationEnabled && n._enableTeleportationOnController(o);\n            }, this._onNewGamepadDisconnected = function(o) {\n              o instanceof Oi && (o.hand === \"left\" && n._leftController != null && (n._leftController.dispose(), n._leftController = null), o.hand === \"right\" && n._rightController != null && (n._rightController.dispose(), n._rightController = null));\n            }, this._workingVector = u.e.Zero(), this._workingQuaternion = u.b.Identity(), this._workingMatrix = u.a.Identity(), this._scene = t, this._inputElement = t.getEngine().getInputElement(), \"getVRDisplays\" in navigator || (e.useXR = !0), e.createFallbackVRDeviceOrientationFreeCamera === void 0 && (e.createFallbackVRDeviceOrientationFreeCamera = !0), e.createDeviceOrientationCamera === void 0 && (e.createDeviceOrientationCamera = !0), e.laserToggle === void 0 && (e.laserToggle = !0), e.defaultHeight === void 0 && (e.defaultHeight = 1.7), e.useCustomVRButton && (this._useCustomVRButton = !0, e.customVRButton && (this._btnVR = e.customVRButton)), e.rayLength && (this._rayLength = e.rayLength), this._defaultHeight = e.defaultHeight, e.positionScale && (this._rayLength *= e.positionScale, this._defaultHeight *= e.positionScale), this._hasEnteredVR = !1, this._scene.activeCamera ? this._position = this._scene.activeCamera.position.clone() : this._position = new u.e(0, this._defaultHeight, 0), e.createDeviceOrientationCamera || !this._scene.activeCamera) {\n              if (this._deviceOrientationCamera = new xo(\"deviceOrientationVRHelper\", this._position.clone(), t), this._scene.activeCamera && (this._deviceOrientationCamera.minZ = this._scene.activeCamera.minZ, this._deviceOrientationCamera.maxZ = this._scene.activeCamera.maxZ, this._scene.activeCamera instanceof xi && this._scene.activeCamera.rotation)) {\n                var i = this._scene.activeCamera;\n                i.rotationQuaternion ? this._deviceOrientationCamera.rotationQuaternion.copyFrom(i.rotationQuaternion) : this._deviceOrientationCamera.rotationQuaternion.copyFrom(u.b.RotationYawPitchRoll(i.rotation.y, i.rotation.x, i.rotation.z)), this._deviceOrientationCamera.rotation = i.rotation.clone();\n              }\n              this._scene.activeCamera = this._deviceOrientationCamera, this._inputElement && this._scene.activeCamera.attachControl();\n            } else\n              this._existingCamera = this._scene.activeCamera;\n            this.webVROptions.useXR && navigator.xr ? rs.IsSessionSupportedAsync(\"immersive-vr\").then(function(o) {\n              o ? (l.a.Log(\"Using WebXR. It is recommended to use the WebXRDefaultExperience directly\"), t.createDefaultXRExperienceAsync({ floorMeshes: e.floorMeshes || [] }).then(function(a) {\n                n.xr = a, n.xrTestDone = !0, n._cameraGazer = new Ml(function() {\n                  return n.xr.baseExperience.camera;\n                }, t), n.xr.baseExperience.onStateChangedObservable.add(function(s) {\n                  switch (s) {\n                    case fn.ENTERING_XR:\n                      n.onEnteringVRObservable.notifyObservers(n), n._interactionsEnabled || n.xr.pointerSelection.detach(), n.xr.pointerSelection.displayLaserPointer = n._displayLaserPointer;\n                      break;\n                    case fn.EXITING_XR:\n                      n.onExitingVRObservable.notifyObservers(n), n._scene.getEngine().resize();\n                      break;\n                    case fn.IN_XR:\n                      n._hasEnteredVR = !0;\n                      break;\n                    case fn.NOT_IN_XR:\n                      n._hasEnteredVR = !1;\n                  }\n                });\n              })) : n.completeVRInit(t, e);\n            }) : this.completeVRInit(t, e);\n          }\n          return Object.defineProperty(r.prototype, \"onEnteringVR\", { get: function() {\n            return this.onEnteringVRObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onExitingVR\", { get: function() {\n            return this.onExitingVRObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onControllerMeshLoaded\", { get: function() {\n            return this.onControllerMeshLoadedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"teleportationTarget\", { get: function() {\n            return this._teleportationTarget;\n          }, set: function(t) {\n            t && (t.name = \"teleportationTarget\", this._isDefaultTeleportationTarget = !1, this._teleportationTarget = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"gazeTrackerMesh\", { get: function() {\n            return this._cameraGazer._gazeTracker;\n          }, set: function(t) {\n            t && (this._cameraGazer._gazeTracker && this._cameraGazer._gazeTracker.dispose(), this._leftController && this._leftController._gazeTracker && this._leftController._gazeTracker.dispose(), this._rightController && this._rightController._gazeTracker && this._rightController._gazeTracker.dispose(), this._cameraGazer._gazeTracker = t, this._cameraGazer._gazeTracker.bakeCurrentTransformIntoVertices(), this._cameraGazer._gazeTracker.isPickable = !1, this._cameraGazer._gazeTracker.isVisible = !1, this._cameraGazer._gazeTracker.name = \"gazeTracker\", this._leftController && (this._leftController._gazeTracker = this._cameraGazer._gazeTracker.clone(\"gazeTracker\")), this._rightController && (this._rightController._gazeTracker = this._cameraGazer._gazeTracker.clone(\"gazeTracker\")));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"leftControllerGazeTrackerMesh\", { get: function() {\n            return this._leftController ? this._leftController._gazeTracker : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rightControllerGazeTrackerMesh\", { get: function() {\n            return this._rightController ? this._rightController._gazeTracker : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"displayGaze\", { get: function() {\n            return this._displayGaze;\n          }, set: function(t) {\n            this._displayGaze = t, t || (this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"displayLaserPointer\", { get: function() {\n            return this._displayLaserPointer;\n          }, set: function(t) {\n            this._displayLaserPointer = t, t ? (this._rightController && this._rightController._activatePointer(), this._leftController && this._leftController._activatePointer()) : (this._rightController && (this._rightController._deactivatePointer(), this._rightController._gazeTracker.isVisible = !1), this._leftController && (this._leftController._deactivatePointer(), this._leftController._gazeTracker.isVisible = !1));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"deviceOrientationCamera\", { get: function() {\n            return this._deviceOrientationCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentVRCamera\", { get: function() {\n            return this._webVRready ? this._webVRCamera : this._scene.activeCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"webVRCamera\", { get: function() {\n            return this._webVRCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"vrDeviceOrientationCamera\", { get: function() {\n            return this._vrDeviceOrientationCamera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"vrButton\", { get: function() {\n            return this._btnVR;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"_teleportationRequestInitiated\", { get: function() {\n            return this._cameraGazer._teleportationRequestInitiated || this._leftController !== null && this._leftController._teleportationRequestInitiated || this._rightController !== null && this._rightController._teleportationRequestInitiated;\n          }, enumerable: !1, configurable: !0 }), r.prototype.completeVRInit = function(t, e) {\n            var n = this;\n            if (this.xrTestDone = !0, e.createFallbackVRDeviceOrientationFreeCamera && (e.useMultiview && (e.vrDeviceOrientationCameraMetrics || (e.vrDeviceOrientationCameraMetrics = cr.GetDefault()), e.vrDeviceOrientationCameraMetrics.multiviewEnabled = !0), this._vrDeviceOrientationCamera = new Ro(\"VRDeviceOrientationVRHelper\", this._position, this._scene, !0, e.vrDeviceOrientationCameraMetrics), this._vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._webVRCamera = new Mo(\"WebVRHelper\", this._position, this._scene, e), this._webVRCamera.useStandingMatrix(), this._cameraGazer = new Ml(function() {\n              return n.currentVRCamera;\n            }, t), !this._useCustomVRButton) {\n              this._btnVR = document.createElement(\"BUTTON\"), this._btnVR.className = \"babylonVRicon\", this._btnVR.id = \"babylonVRiconbtn\", this._btnVR.title = \"Click to switch to VR\";\n              var i = \".babylonVRicon { position: absolute; right: 20px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(\" + (window.SVGSVGElement ? \"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A\" : \"https://cdn.babylonjs.com/Assets/vrButton.png\") + \"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }\";\n              i += \".babylonVRicon.vrdisplaypresenting { display: none; }\";\n              var o = document.createElement(\"style\");\n              o.appendChild(document.createTextNode(i)), document.getElementsByTagName(\"head\")[0].appendChild(o), this.moveButtonToBottomRight();\n            }\n            this._btnVR && this._btnVR.addEventListener(\"click\", function() {\n              n.isInVRMode ? n._scene.getEngine().disableVR() : n.enterVR();\n            });\n            var a = this._scene.getEngine().getHostWindow();\n            a && (a.addEventListener(\"resize\", this._onResize), document.addEventListener(\"fullscreenchange\", this._onFullscreenChange, !1), document.addEventListener(\"mozfullscreenchange\", this._onFullscreenChange, !1), document.addEventListener(\"webkitfullscreenchange\", this._onFullscreenChange, !1), document.addEventListener(\"msfullscreenchange\", this._onFullscreenChange, !1), document.onmsfullscreenchange = this._onFullscreenChange, e.createFallbackVRDeviceOrientationFreeCamera ? this.displayVRButton() : this._scene.getEngine().onVRDisplayChangedObservable.add(function(s) {\n              s.vrDisplay && n.displayVRButton();\n            }), this._onKeyDown = function(s) {\n              s.keyCode === 27 && n.isInVRMode && n.exitVR();\n            }, document.addEventListener(\"keydown\", this._onKeyDown), this._scene.onPrePointerObservable.add(function() {\n              n._hasEnteredVR && n.exitVROnDoubleTap && (n.exitVR(), n._fullscreenVRpresenting && n._scene.getEngine().exitFullscreen());\n            }, yt.a.POINTERDOUBLETAP, !1), this._onVRDisplayChanged = function(s) {\n              return n.onVRDisplayChanged(s);\n            }, this._onVrDisplayPresentChange = function() {\n              return n.onVrDisplayPresentChange();\n            }, this._onVRRequestPresentStart = function() {\n              n._webVRrequesting = !0, n.updateButtonVisibility();\n            }, this._onVRRequestPresentComplete = function() {\n              n._webVRrequesting = !1, n.updateButtonVisibility();\n            }, t.getEngine().onVRDisplayChangedObservable.add(this._onVRDisplayChanged), t.getEngine().onVRRequestPresentStart.add(this._onVRRequestPresentStart), t.getEngine().onVRRequestPresentComplete.add(this._onVRRequestPresentComplete), a.addEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), t.onDisposeObservable.add(function() {\n              n.dispose();\n            }), this._webVRCamera.onControllerMeshLoadedObservable.add(function(s) {\n              return n._onDefaultMeshLoaded(s);\n            }), this._scene.gamepadManager.onGamepadConnectedObservable.add(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.add(this._onNewGamepadDisconnected), this.updateButtonVisibility(), this._circleEase = new tt(), this._circleEase.setEasingMode(Ge.EASINGMODE_EASEINOUT), this._teleportationEasing = this._circleEase, t.onPointerObservable.add(function(s) {\n              n._interactionsEnabled && t.activeCamera === n.vrDeviceOrientationCamera && s.event.pointerType === \"mouse\" && (s.type === yt.a.POINTERDOWN ? n._cameraGazer._selectionPointerDown() : s.type === yt.a.POINTERUP && n._cameraGazer._selectionPointerUp());\n            }), this.webVROptions.floorMeshes && this.enableTeleportation({ floorMeshes: this.webVROptions.floorMeshes }));\n          }, r.prototype._onDefaultMeshLoaded = function(t) {\n            this._leftController && this._leftController.webVRController == t && t.mesh && this._leftController._setLaserPointerParent(t.mesh), this._rightController && this._rightController.webVRController == t && t.mesh && this._rightController._setLaserPointerParent(t.mesh);\n            try {\n              this.onControllerMeshLoadedObservable.notifyObservers(t);\n            } catch (e) {\n              l.a.Warn(\"Error in your custom logic onControllerMeshLoaded: \" + e);\n            }\n          }, Object.defineProperty(r.prototype, \"isInVRMode\", { get: function() {\n            return this.xr && this.webVROptions.useXR && this.xr.baseExperience.state === fn.IN_XR || this._webVRpresenting || this._fullscreenVRpresenting;\n          }, enumerable: !1, configurable: !0 }), r.prototype.onVrDisplayPresentChange = function() {\n            var t = this._scene.getEngine().getVRDevice();\n            if (t) {\n              var e = this._webVRpresenting;\n              this._webVRpresenting = t.isPresenting, e && !this._webVRpresenting && this.exitVR();\n            } else\n              l.a.Warn(\"Detected VRDisplayPresentChange on an unknown VRDisplay. Did you can enterVR on the vrExperienceHelper?\");\n            this.updateButtonVisibility();\n          }, r.prototype.onVRDisplayChanged = function(t) {\n            this._webVRsupported = t.vrSupported, this._webVRready = !!t.vrDisplay, this._webVRpresenting = t.vrDisplay && t.vrDisplay.isPresenting, this.updateButtonVisibility();\n          }, r.prototype.moveButtonToBottomRight = function() {\n            if (this._inputElement && !this._useCustomVRButton && this._btnVR) {\n              var t = this._inputElement.getBoundingClientRect();\n              this._btnVR.style.top = t.top + t.height - 70 + \"px\", this._btnVR.style.left = t.left + t.width - 100 + \"px\";\n            }\n          }, r.prototype.displayVRButton = function() {\n            this._useCustomVRButton || this._btnVRDisplayed || !this._btnVR || (document.body.appendChild(this._btnVR), this._btnVRDisplayed = !0);\n          }, r.prototype.updateButtonVisibility = function() {\n            this._btnVR && !this._useCustomVRButton && (this._btnVR.className = \"babylonVRicon\", this.isInVRMode ? this._btnVR.className += \" vrdisplaypresenting\" : (this._webVRready && (this._btnVR.className += \" vrdisplayready\"), this._webVRsupported && (this._btnVR.className += \" vrdisplaysupported\"), this._webVRrequesting && (this._btnVR.className += \" vrdisplayrequesting\")));\n          }, r.prototype.enterVR = function() {\n            var t = this;\n            if (this.xr)\n              this.xr.baseExperience.enterXRAsync(\"immersive-vr\", \"local-floor\", this.xr.renderTarget);\n            else {\n              if (this.onEnteringVRObservable)\n                try {\n                  this.onEnteringVRObservable.notifyObservers(this);\n                } catch (o) {\n                  l.a.Warn(\"Error in your custom logic onEnteringVR: \" + o);\n                }\n              if (this._scene.activeCamera) {\n                if (this._position = this._scene.activeCamera.position.clone(), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.rotation = u.b.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles(), this.vrDeviceOrientationCamera.angularSensibility = 2e3), this.webVRCamera) {\n                  var e = this.webVRCamera.deviceRotationQuaternion.toEulerAngles().y, n = u.b.FromRotationMatrix(this._scene.activeCamera.getWorldMatrix().getRotationMatrix()).toEulerAngles().y - e, i = this.webVRCamera.rotationQuaternion.toEulerAngles().y;\n                  this.webVRCamera.rotationQuaternion = u.b.FromEulerAngles(0, i + n, 0);\n                }\n                this._existingCamera = this._scene.activeCamera, this._existingCamera.angularSensibilityX && (this._cachedAngularSensibility.angularSensibilityX = this._existingCamera.angularSensibilityX, this._existingCamera.angularSensibilityX = Number.MAX_VALUE), this._existingCamera.angularSensibilityY && (this._cachedAngularSensibility.angularSensibilityY = this._existingCamera.angularSensibilityY, this._existingCamera.angularSensibilityY = Number.MAX_VALUE), this._existingCamera.angularSensibility && (this._cachedAngularSensibility.angularSensibility = this._existingCamera.angularSensibility, this._existingCamera.angularSensibility = Number.MAX_VALUE);\n              }\n              this._webVRrequesting || (this._webVRready ? this._webVRpresenting || (this._scene.getEngine().onVRRequestPresentComplete.addOnce(function(o) {\n                t.onAfterEnteringVRObservable.notifyObservers({ success: o });\n              }), this._webVRCamera.position = this._position, this._scene.activeCamera = this._webVRCamera) : this._vrDeviceOrientationCamera && (this._vrDeviceOrientationCamera.position = this._position, this._scene.activeCamera && (this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ), this._scene.activeCamera = this._vrDeviceOrientationCamera, this._scene.getEngine().enterFullscreen(this.requestPointerLockOnFullScreen), this.updateButtonVisibility(), this._vrDeviceOrientationCamera.onViewMatrixChangedObservable.addOnce(function() {\n                t.onAfterEnteringVRObservable.notifyObservers({ success: !0 });\n              })), this._scene.activeCamera && this._inputElement && this._scene.activeCamera.attachControl(), this._interactionsEnabled && this._scene.registerBeforeRender(this.beforeRender), this._displayLaserPointer && [this._leftController, this._rightController].forEach(function(o) {\n                o && o._activatePointer();\n              }), this._hasEnteredVR = !0);\n            }\n          }, r.prototype.exitVR = function() {\n            if (this.xr)\n              this.xr.baseExperience.exitXRAsync();\n            else if (this._hasEnteredVR) {\n              if (this.onExitingVRObservable)\n                try {\n                  this.onExitingVRObservable.notifyObservers(this);\n                } catch (e) {\n                  l.a.Warn(\"Error in your custom logic onExitingVR: \" + e);\n                }\n              this._webVRpresenting && this._scene.getEngine().disableVR(), this._scene.activeCamera && (this._position = this._scene.activeCamera.position.clone()), this.vrDeviceOrientationCamera && (this.vrDeviceOrientationCamera.angularSensibility = Number.MAX_VALUE), this._deviceOrientationCamera ? (this._deviceOrientationCamera.position = this._position, this._scene.activeCamera = this._deviceOrientationCamera, this._cachedAngularSensibility.angularSensibilityX && (this._deviceOrientationCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._deviceOrientationCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._deviceOrientationCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)) : this._existingCamera && (this._existingCamera.position = this._position, this._scene.activeCamera = this._existingCamera, this._inputElement && this._scene.activeCamera.attachControl(), this._cachedAngularSensibility.angularSensibilityX && (this._existingCamera.angularSensibilityX = this._cachedAngularSensibility.angularSensibilityX, this._cachedAngularSensibility.angularSensibilityX = null), this._cachedAngularSensibility.angularSensibilityY && (this._existingCamera.angularSensibilityY = this._cachedAngularSensibility.angularSensibilityY, this._cachedAngularSensibility.angularSensibilityY = null), this._cachedAngularSensibility.angularSensibility && (this._existingCamera.angularSensibility = this._cachedAngularSensibility.angularSensibility, this._cachedAngularSensibility.angularSensibility = null)), this.updateButtonVisibility(), this._interactionsEnabled && (this._scene.unregisterBeforeRender(this.beforeRender), this._cameraGazer._gazeTracker.isVisible = !1, this._leftController && (this._leftController._gazeTracker.isVisible = !1), this._rightController && (this._rightController._gazeTracker.isVisible = !1)), this._scene.getEngine().resize(), [this._leftController, this._rightController].forEach(function(e) {\n                e && e._deactivatePointer();\n              }), this._hasEnteredVR = !1;\n              var t = this._scene.getEngine();\n              t._onVrDisplayPresentChange && t._onVrDisplayPresentChange();\n            }\n          }, Object.defineProperty(r.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(t) {\n            this._position = t, this._scene.activeCamera && (this._scene.activeCamera.position = t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.enableInteractions = function() {\n            var t = this;\n            if (!this._interactionsEnabled) {\n              if (this._interactionsRequested = !0, this.xr)\n                return void (this.xr.baseExperience.state === fn.IN_XR && this.xr.pointerSelection.attach());\n              this._leftController && this._enableInteractionOnController(this._leftController), this._rightController && this._enableInteractionOnController(this._rightController), this.raySelectionPredicate = function(e) {\n                return e.isVisible && (e.isPickable || e.name === t._floorMeshName);\n              }, this.meshSelectionPredicate = function() {\n                return !0;\n              }, this._raySelectionPredicate = function(e) {\n                return !!(t._isTeleportationFloor(e) || e.name.indexOf(\"gazeTracker\") === -1 && e.name.indexOf(\"teleportationTarget\") === -1 && e.name.indexOf(\"torusTeleportation\") === -1) && t.raySelectionPredicate(e);\n              }, this._interactionsEnabled = !0;\n            }\n          }, Object.defineProperty(r.prototype, \"_noControllerIsActive\", { get: function() {\n            return !(this._leftController && this._leftController._activePointer || this._rightController && this._rightController._activePointer);\n          }, enumerable: !1, configurable: !0 }), r.prototype._isTeleportationFloor = function(t) {\n            for (var e = 0; e < this._floorMeshesCollection.length; e++)\n              if (this._floorMeshesCollection[e].id === t.id)\n                return !0;\n            return !(!this._floorMeshName || t.name !== this._floorMeshName);\n          }, r.prototype.addFloorMesh = function(t) {\n            this._floorMeshesCollection && (this._floorMeshesCollection.indexOf(t) > -1 || this._floorMeshesCollection.push(t));\n          }, r.prototype.removeFloorMesh = function(t) {\n            if (this._floorMeshesCollection) {\n              var e = this._floorMeshesCollection.indexOf(t);\n              e !== -1 && this._floorMeshesCollection.splice(e, 1);\n            }\n          }, r.prototype.enableTeleportation = function(t) {\n            var e = this;\n            if (t === void 0 && (t = {}), !this._teleportationInitialized) {\n              if (this._teleportationRequested = !0, this.enableInteractions(), this.webVROptions.useXR && (t.floorMeshes || t.floorMeshName)) {\n                var n = t.floorMeshes || [];\n                if (!n.length) {\n                  var i = this._scene.getMeshByName(t.floorMeshName);\n                  i && n.push(i);\n                }\n                if (this.xr)\n                  return n.forEach(function(s) {\n                    e.xr.teleportation.addFloorMesh(s);\n                  }), void (this.xr.teleportation.attached || this.xr.teleportation.attach());\n                if (!this.xrTestDone) {\n                  var o = function() {\n                    e.xrTestDone && (e._scene.unregisterBeforeRender(o), e.xr ? e.xr.teleportation.attached || e.xr.teleportation.attach() : e.enableTeleportation(t));\n                  };\n                  return void this._scene.registerBeforeRender(o);\n                }\n              }\n              t.floorMeshName && (this._floorMeshName = t.floorMeshName), t.floorMeshes && (this._floorMeshesCollection = t.floorMeshes), t.teleportationMode && (this._teleportationMode = t.teleportationMode), t.teleportationTime && t.teleportationTime > 0 && (this._teleportationTime = t.teleportationTime), t.teleportationSpeed && t.teleportationSpeed > 0 && (this._teleportationSpeed = t.teleportationSpeed), t.easingFunction !== void 0 && (this._teleportationEasing = t.easingFunction), this._leftController != null && this._enableTeleportationOnController(this._leftController), this._rightController != null && this._enableTeleportationOnController(this._rightController);\n              var a = new vn.a();\n              a.vignetteColor = new I.b(0, 0, 0, 0), a.vignetteEnabled = !0, this._postProcessMove = new Io(\"postProcessMove\", 1, this._webVRCamera, void 0, void 0, void 0, void 0, a), this._webVRCamera.detachPostProcess(this._postProcessMove), this._teleportationInitialized = !0, this._isDefaultTeleportationTarget && (this._createTeleportationCircles(), this._teleportationTarget.scaling.scaleInPlace(this._webVRCamera.deviceScaleFactor));\n            }\n          }, r.prototype._enableInteractionOnController = function(t) {\n            var e = this;\n            t.webVRController.mesh && (t._interactionsEnabled = !0, this.isInVRMode && this._displayLaserPointer && t._activatePointer(), this.webVROptions.laserToggle && t.webVRController.onMainButtonStateChangedObservable.add(function(n) {\n              e._displayLaserPointer && n.value === 1 && (t._activePointer ? t._deactivatePointer() : t._activatePointer(), e.displayGaze && (t._gazeTracker.isVisible = t._activePointer));\n            }), t.webVRController.onTriggerStateChangedObservable.add(function(n) {\n              var i = t;\n              e._noControllerIsActive && (i = e._cameraGazer), i._pointerDownOnMeshAsked ? n.value < e._padSensibilityDown && i._selectionPointerUp() : n.value > e._padSensibilityUp && i._selectionPointerDown();\n            }));\n          }, r.prototype._checkTeleportWithRay = function(t, e) {\n            this._teleportationRequestInitiated && !e._teleportationRequestInitiated || (e._teleportationRequestInitiated ? Math.sqrt(t.y * t.y + t.x * t.x) < this._padSensibilityDown && (this._teleportActive && this.teleportCamera(this._haloCenter), e._teleportationRequestInitiated = !1) : t.y < -this._padSensibilityUp && e._dpadPressed && (e._activatePointer(), e._teleportationRequestInitiated = !0));\n          }, r.prototype._checkRotate = function(t, e) {\n            e._teleportationRequestInitiated || (e._rotationLeftAsked ? t.x > -this._padSensibilityDown && (e._rotationLeftAsked = !1) : t.x < -this._padSensibilityUp && e._dpadPressed && (e._rotationLeftAsked = !0, this._rotationAllowed && this._rotateCamera(!1)), e._rotationRightAsked ? t.x < this._padSensibilityDown && (e._rotationRightAsked = !1) : t.x > this._padSensibilityUp && e._dpadPressed && (e._rotationRightAsked = !0, this._rotationAllowed && this._rotateCamera(!0)));\n          }, r.prototype._checkTeleportBackwards = function(t, e) {\n            if (!e._teleportationRequestInitiated)\n              if (t.y > this._padSensibilityUp && e._dpadPressed) {\n                if (!e._teleportationBackRequestInitiated) {\n                  if (!this.currentVRCamera)\n                    return;\n                  var n = u.b.FromRotationMatrix(this.currentVRCamera.getWorldMatrix().getRotationMatrix()), i = this.currentVRCamera.position;\n                  this.currentVRCamera.devicePosition && this.currentVRCamera.deviceRotationQuaternion && (n = this.currentVRCamera.deviceRotationQuaternion, i = this.currentVRCamera.devicePosition), n.toEulerAnglesToRef(this._workingVector), this._workingVector.z = 0, this._workingVector.x = 0, u.b.RotationYawPitchRollToRef(this._workingVector.y, this._workingVector.x, this._workingVector.z, this._workingQuaternion), this._workingQuaternion.toRotationMatrix(this._workingMatrix), u.e.TransformCoordinatesToRef(this._teleportBackwardsVector, this._workingMatrix, this._workingVector);\n                  var o = new dn.a(i, this._workingVector), a = this._scene.pickWithRay(o, this._raySelectionPredicate);\n                  a && a.pickedPoint && a.pickedMesh && this._isTeleportationFloor(a.pickedMesh) && a.distance < 5 && this.teleportCamera(a.pickedPoint), e._teleportationBackRequestInitiated = !0;\n                }\n              } else\n                e._teleportationBackRequestInitiated = !1;\n          }, r.prototype._enableTeleportationOnController = function(t) {\n            var e = this;\n            t.webVRController.mesh && (t._interactionsEnabled || this._enableInteractionOnController(t), t._interactionsEnabled = !0, t._teleportationEnabled = !0, t.webVRController.controllerType === Jn.VIVE && (t._dpadPressed = !1, t.webVRController.onPadStateChangedObservable.add(function(n) {\n              t._dpadPressed = n.pressed, t._dpadPressed || (t._rotationLeftAsked = !1, t._rotationRightAsked = !1, t._teleportationBackRequestInitiated = !1);\n            })), t.webVRController.onPadValuesChangedObservable.add(function(n) {\n              e.teleportationEnabled && (e._checkTeleportBackwards(n, t), e._checkTeleportWithRay(n, t)), e._checkRotate(n, t);\n            }));\n          }, r.prototype._createTeleportationCircles = function() {\n            this._teleportationTarget = Ie.a.CreateGround(\"teleportationTarget\", 2, 2, 2, this._scene), this._teleportationTarget.isPickable = !1;\n            var t = new pi.a(\"DynamicTexture\", 512, this._scene, !0);\n            t.hasAlpha = !0;\n            var e = t.getContext();\n            e.beginPath(), e.arc(256, 256, 200, 0, 2 * Math.PI, !1), e.fillStyle = this._teleportationFillColor, e.fill(), e.lineWidth = 10, e.strokeStyle = this._teleportationBorderColor, e.stroke(), e.closePath(), t.update();\n            var n = new Nt.a(\"TextPlaneMaterial\", this._scene);\n            n.diffuseTexture = t, this._teleportationTarget.material = n;\n            var i = Ie.a.CreateTorus(\"torusTeleportation\", 0.75, 0.1, 25, this._scene, !1);\n            i.isPickable = !1, i.parent = this._teleportationTarget;\n            var o = new k(\"animationInnerCircle\", \"position.y\", 30, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CYCLE), a = [];\n            a.push({ frame: 0, value: 0 }), a.push({ frame: 30, value: 0.4 }), a.push({ frame: 60, value: 0 }), o.setKeys(a);\n            var s = new nn();\n            s.setEasingMode(Ge.EASINGMODE_EASEINOUT), o.setEasingFunction(s), i.animations = [], i.animations.push(o), this._scene.beginAnimation(i, 0, 60, !0), this._hideTeleportationTarget();\n          }, r.prototype._displayTeleportationTarget = function() {\n            this._teleportActive = !0, this._teleportationInitialized && (this._teleportationTarget.isVisible = !0, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !0));\n          }, r.prototype._hideTeleportationTarget = function() {\n            this._teleportActive = !1, this._teleportationInitialized && (this._teleportationTarget.isVisible = !1, this._isDefaultTeleportationTarget && (this._teleportationTarget.getChildren()[0].isVisible = !1));\n          }, r.prototype._rotateCamera = function(t) {\n            var e = this;\n            if (this.currentVRCamera instanceof zn) {\n              t ? this._rotationAngle++ : this._rotationAngle--, this.currentVRCamera.animations = [];\n              var n = u.b.FromRotationMatrix(u.a.RotationY(Math.PI / 4 * this._rotationAngle)), i = new k(\"animationRotation\", \"rotationQuaternion\", 90, k.ANIMATIONTYPE_QUATERNION, k.ANIMATIONLOOPMODE_CONSTANT), o = [];\n              o.push({ frame: 0, value: this.currentVRCamera.rotationQuaternion }), o.push({ frame: 6, value: n }), i.setKeys(o), i.setEasingFunction(this._circleEase), this.currentVRCamera.animations.push(i), this._postProcessMove.animations = [];\n              var a = new k(\"animationPP\", \"vignetteWeight\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), s = [];\n              s.push({ frame: 0, value: 0 }), s.push({ frame: 3, value: 4 }), s.push({ frame: 6, value: 0 }), a.setKeys(s), a.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(a);\n              var d = new k(\"animationPP2\", \"vignetteStretch\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), p = [];\n              p.push({ frame: 0, value: 0 }), p.push({ frame: 3, value: 10 }), p.push({ frame: 6, value: 0 }), d.setKeys(p), d.setEasingFunction(this._circleEase), this._postProcessMove.animations.push(d), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._postProcessMove.samples = 4, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, 6, !1, 1, function() {\n                e._webVRCamera.detachPostProcess(e._postProcessMove);\n              }), this._scene.beginAnimation(this.currentVRCamera, 0, 6, !1, 1);\n            }\n          }, r.prototype._moveTeleportationSelectorTo = function(t, e, n) {\n            if (t.pickedPoint) {\n              e._teleportationRequestInitiated && (this._displayTeleportationTarget(), this._haloCenter.copyFrom(t.pickedPoint), this._teleportationTarget.position.copyFrom(t.pickedPoint));\n              var i = this._convertNormalToDirectionOfRay(t.getNormal(!0, !1), n);\n              if (i) {\n                var o = u.e.Cross(be.a.Y, i), a = u.e.Cross(i, o);\n                u.e.RotationFromAxisToRef(a, i, o, this._teleportationTarget.rotation);\n              }\n              this._teleportationTarget.position.y += 0.1;\n            }\n          }, r.prototype.teleportCamera = function(t) {\n            var e = this;\n            if (this.currentVRCamera instanceof zn) {\n              this.webVRCamera.leftCamera ? (this._workingVector.copyFrom(this.webVRCamera.leftCamera.globalPosition), this._workingVector.subtractInPlace(this.webVRCamera.position), t.subtractToRef(this._workingVector, this._workingVector)) : this._workingVector.copyFrom(t), this.isInVRMode ? this._workingVector.y += this.webVRCamera.deviceDistanceToRoomGround() * this._webVRCamera.deviceScaleFactor : this._workingVector.y += this._defaultHeight, this.onBeforeCameraTeleport.notifyObservers(this._workingVector);\n              var n, i;\n              if (this._teleportationMode == r.TELEPORTATIONMODE_CONSTANTSPEED) {\n                i = 90;\n                var o = u.e.Distance(this.currentVRCamera.position, this._workingVector);\n                n = this._teleportationSpeed / o;\n              } else\n                i = Math.round(90 * this._teleportationTime / 1e3), n = 1;\n              this.currentVRCamera.animations = [];\n              var a = new k(\"animationCameraTeleportation\", \"position\", 90, k.ANIMATIONTYPE_VECTOR3, k.ANIMATIONLOOPMODE_CONSTANT), s = [{ frame: 0, value: this.currentVRCamera.position }, { frame: i, value: this._workingVector }];\n              a.setKeys(s), a.setEasingFunction(this._teleportationEasing), this.currentVRCamera.animations.push(a), this._postProcessMove.animations = [];\n              var d = Math.round(i / 2), p = new k(\"animationPP\", \"vignetteWeight\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), y = [];\n              y.push({ frame: 0, value: 0 }), y.push({ frame: d, value: 8 }), y.push({ frame: i, value: 0 }), p.setKeys(y), this._postProcessMove.animations.push(p);\n              var P = new k(\"animationPP2\", \"vignetteStretch\", 90, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CONSTANT), R = [];\n              R.push({ frame: 0, value: 0 }), R.push({ frame: d, value: 10 }), R.push({ frame: i, value: 0 }), P.setKeys(R), this._postProcessMove.animations.push(P), this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0, this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0, this._webVRCamera.attachPostProcess(this._postProcessMove), this._scene.beginAnimation(this._postProcessMove, 0, i, !1, n, function() {\n                e._webVRCamera.detachPostProcess(e._postProcessMove);\n              }), this._scene.beginAnimation(this.currentVRCamera, 0, i, !1, n, function() {\n                e.onAfterCameraTeleport.notifyObservers(e._workingVector);\n              }), this._hideTeleportationTarget();\n            }\n          }, r.prototype._convertNormalToDirectionOfRay = function(t, e) {\n            return t && Math.acos(u.e.Dot(t, e.direction)) < Math.PI / 2 && t.scaleInPlace(-1), t;\n          }, r.prototype._castRayAndSelectObject = function(t) {\n            if (this.currentVRCamera instanceof zn) {\n              var e = t._getForwardRay(this._rayLength), n = this._scene.pickWithRay(e, this._raySelectionPredicate);\n              if (n && (t._laserPointer && (n.originMesh = t._laserPointer.parent), this._scene.simulatePointerMove(n, { pointerId: t._id })), t._currentHit = n, n && n.pickedPoint) {\n                if (this._displayGaze) {\n                  var i = 1;\n                  t._gazeTracker.isVisible = !0, t._isActionableMesh && (i = 3), this.updateGazeTrackerScale && (t._gazeTracker.scaling.x = n.distance * i, t._gazeTracker.scaling.y = n.distance * i, t._gazeTracker.scaling.z = n.distance * i);\n                  var o = this._convertNormalToDirectionOfRay(n.getNormal(), e);\n                  if (o) {\n                    var a = u.e.Cross(be.a.Y, o), s = u.e.Cross(o, a);\n                    u.e.RotationFromAxisToRef(s, o, a, t._gazeTracker.rotation);\n                  }\n                  t._gazeTracker.position.copyFrom(n.pickedPoint), t._gazeTracker.position.x < 0 ? t._gazeTracker.position.x += 2e-3 : t._gazeTracker.position.x -= 2e-3, t._gazeTracker.position.y < 0 ? t._gazeTracker.position.y += 2e-3 : t._gazeTracker.position.y -= 2e-3, t._gazeTracker.position.z < 0 ? t._gazeTracker.position.z += 2e-3 : t._gazeTracker.position.z -= 2e-3;\n                }\n                t._updatePointerDistance(n.distance);\n              } else\n                t._updatePointerDistance(), t._gazeTracker.isVisible = !1;\n              if (n && n.pickedMesh) {\n                if (this._teleportationInitialized && this._isTeleportationFloor(n.pickedMesh) && n.pickedPoint)\n                  return t._currentMeshSelected && !this._isTeleportationFloor(t._currentMeshSelected) && this._notifySelectedMeshUnselected(t._currentMeshSelected), t._currentMeshSelected = null, void (t._teleportationRequestInitiated && this._moveTeleportationSelectorTo(n, t, e));\n                if (n.pickedMesh !== t._currentMeshSelected)\n                  if (this.meshSelectionPredicate(n.pickedMesh)) {\n                    this.onNewMeshPicked.notifyObservers(n), t._currentMeshSelected = n.pickedMesh, n.pickedMesh.isPickable && n.pickedMesh.actionManager ? (this.changeGazeColor(this._pickedGazeColor), this.changeLaserColor(this._pickedLaserColor), t._isActionableMesh = !0) : (this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor), t._isActionableMesh = !1);\n                    try {\n                      this.onNewMeshSelected.notifyObservers(n.pickedMesh);\n                      var d = t;\n                      d.webVRController && this.onMeshSelectedWithController.notifyObservers({ mesh: n.pickedMesh, controller: d.webVRController });\n                    } catch (p) {\n                      l.a.Warn(\"Error while raising onNewMeshSelected or onMeshSelectedWithController: \" + p);\n                    }\n                  } else\n                    this._notifySelectedMeshUnselected(t._currentMeshSelected), t._currentMeshSelected = null, this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor);\n              } else\n                this._notifySelectedMeshUnselected(t._currentMeshSelected), t._currentMeshSelected = null, this.changeGazeColor(this._gazeColor), this.changeLaserColor(this._laserColor);\n            }\n          }, r.prototype._notifySelectedMeshUnselected = function(t) {\n            t && this.onSelectedMeshUnselected.notifyObservers(t);\n          }, r.prototype.setLaserColor = function(t, e) {\n            e === void 0 && (e = this._pickedLaserColor), this._laserColor = t, this._pickedLaserColor = e;\n          }, r.prototype.setLaserLightingState = function(t) {\n            t === void 0 && (t = !0), this._leftController && this._leftController._setLaserPointerLightingDisabled(!t), this._rightController && this._rightController._setLaserPointerLightingDisabled(!t);\n          }, r.prototype.setGazeColor = function(t, e) {\n            e === void 0 && (e = this._pickedGazeColor), this._gazeColor = t, this._pickedGazeColor = e;\n          }, r.prototype.changeLaserColor = function(t) {\n            this.updateControllerLaserColor && (this._leftController && this._leftController._setLaserPointerColor(t), this._rightController && this._rightController._setLaserPointerColor(t));\n          }, r.prototype.changeGazeColor = function(t) {\n            this.updateGazeTrackerColor && this._cameraGazer._gazeTracker.material && (this._cameraGazer._gazeTracker.material.emissiveColor = t, this._leftController && (this._leftController._gazeTracker.material.emissiveColor = t), this._rightController && (this._rightController._gazeTracker.material.emissiveColor = t));\n          }, r.prototype.dispose = function() {\n            this.isInVRMode && this.exitVR(), this._postProcessMove && this._postProcessMove.dispose(), this._webVRCamera && this._webVRCamera.dispose(), this._vrDeviceOrientationCamera && this._vrDeviceOrientationCamera.dispose(), !this._useCustomVRButton && this._btnVR && this._btnVR.parentNode && document.body.removeChild(this._btnVR), this._deviceOrientationCamera && this._scene.activeCamera != this._deviceOrientationCamera && this._deviceOrientationCamera.dispose(), this._cameraGazer && this._cameraGazer.dispose(), this._leftController && this._leftController.dispose(), this._rightController && this._rightController.dispose(), this._teleportationTarget && this._teleportationTarget.dispose(), this.xr && this.xr.dispose(), this._floorMeshesCollection = [], document.removeEventListener(\"keydown\", this._onKeyDown), window.removeEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), window.removeEventListener(\"resize\", this._onResize), document.removeEventListener(\"fullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"mozfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"webkitfullscreenchange\", this._onFullscreenChange), document.removeEventListener(\"msfullscreenchange\", this._onFullscreenChange), document.onmsfullscreenchange = null, this._scene.getEngine().onVRDisplayChangedObservable.removeCallback(this._onVRDisplayChanged), this._scene.getEngine().onVRRequestPresentStart.removeCallback(this._onVRRequestPresentStart), this._scene.getEngine().onVRRequestPresentComplete.removeCallback(this._onVRRequestPresentComplete), window.removeEventListener(\"vrdisplaypresentchange\", this._onVrDisplayPresentChange), this._scene.gamepadManager.onGamepadConnectedObservable.removeCallback(this._onNewGamepadConnected), this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected), this._scene.unregisterBeforeRender(this.beforeRender);\n          }, r.prototype.getClassName = function() {\n            return \"VRExperienceHelper\";\n          }, r.TELEPORTATIONMODE_CONSTANTTIME = 0, r.TELEPORTATIONMODE_CONSTANTSPEED = 1, r;\n        }(), ur = f(64), hr = ($n = { root: 0, found: !1 }, function(r, t, e, n) {\n          $n.root = 0, $n.found = !1;\n          var i = t * t - 4 * r * e;\n          if (i < 0)\n            return $n;\n          var o = Math.sqrt(i), a = (-t - o) / (2 * r), s = (-t + o) / (2 * r);\n          if (a > s) {\n            var d = s;\n            s = a, a = d;\n          }\n          return a > 0 && a < n ? ($n.root = a, $n.found = !0, $n) : (s > 0 && s < n && ($n.root = s, $n.found = !0), $n);\n        }), Dl = function() {\n          function r() {\n            this._collisionPoint = u.e.Zero(), this._planeIntersectionPoint = u.e.Zero(), this._tempVector = u.e.Zero(), this._tempVector2 = u.e.Zero(), this._tempVector3 = u.e.Zero(), this._tempVector4 = u.e.Zero(), this._edge = u.e.Zero(), this._baseToVertex = u.e.Zero(), this._destinationPoint = u.e.Zero(), this._slidePlaneNormal = u.e.Zero(), this._displacementVector = u.e.Zero(), this._radius = u.e.One(), this._retry = 0, this._basePointWorld = u.e.Zero(), this._velocityWorld = u.e.Zero(), this._normalizedVelocity = u.e.Zero(), this._collisionMask = -1;\n          }\n          return Object.defineProperty(r.prototype, \"collisionMask\", { get: function() {\n            return this._collisionMask;\n          }, set: function(t) {\n            this._collisionMask = isNaN(t) ? -1 : t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"slidePlaneNormal\", { get: function() {\n            return this._slidePlaneNormal;\n          }, enumerable: !1, configurable: !0 }), r.prototype._initialize = function(t, e, n) {\n            this._velocity = e, u.e.NormalizeToRef(e, this._normalizedVelocity), this._basePoint = t, t.multiplyToRef(this._radius, this._basePointWorld), e.multiplyToRef(this._radius, this._velocityWorld), this._velocityWorldLength = this._velocityWorld.length(), this._epsilon = n, this.collisionFound = !1;\n          }, r.prototype._checkPointInTriangle = function(t, e, n, i, o) {\n            e.subtractToRef(t, this._tempVector), n.subtractToRef(t, this._tempVector2), u.e.CrossToRef(this._tempVector, this._tempVector2, this._tempVector4);\n            var a = u.e.Dot(this._tempVector4, o);\n            return !(a < 0) && (i.subtractToRef(t, this._tempVector3), u.e.CrossToRef(this._tempVector2, this._tempVector3, this._tempVector4), !((a = u.e.Dot(this._tempVector4, o)) < 0) && (u.e.CrossToRef(this._tempVector3, this._tempVector, this._tempVector4), (a = u.e.Dot(this._tempVector4, o)) >= 0));\n          }, r.prototype._canDoCollision = function(t, e, n, i) {\n            var o = u.e.Distance(this._basePointWorld, t), a = Math.max(this._radius.x, this._radius.y, this._radius.z);\n            return !(o > this._velocityWorldLength + a + e) && !!function(s, d, p, y) {\n              return !(s.x > p.x + y) && !(p.x - y > d.x) && !(s.y > p.y + y) && !(p.y - y > d.y) && !(s.z > p.z + y) && !(p.z - y > d.z);\n            }(n, i, this._basePointWorld, this._velocityWorldLength + a);\n          }, r.prototype._testTriangle = function(t, e, n, i, o, a, s) {\n            var d, p = !1;\n            e || (e = []), e[t] || (e[t] = new ur.a(0, 0, 0, 0), e[t].copyFromPoints(n, i, o));\n            var y = e[t];\n            if (a || y.isFrontFacingTo(this._normalizedVelocity, 0)) {\n              var P = y.signedDistanceTo(this._basePoint), R = u.e.Dot(y.normal, this._velocity);\n              if (R == 0) {\n                if (Math.abs(P) >= 1)\n                  return;\n                p = !0, d = 0;\n              } else {\n                var B = (1 - P) / R;\n                if ((d = (-1 - P) / R) > B) {\n                  var F = B;\n                  B = d, d = F;\n                }\n                if (d > 1 || B < 0)\n                  return;\n                d < 0 && (d = 0), d > 1 && (d = 1);\n              }\n              this._collisionPoint.copyFromFloats(0, 0, 0);\n              var z = !1, J = 1;\n              if (p || (this._basePoint.subtractToRef(y.normal, this._planeIntersectionPoint), this._velocity.scaleToRef(d, this._tempVector), this._planeIntersectionPoint.addInPlace(this._tempVector), this._checkPointInTriangle(this._planeIntersectionPoint, n, i, o, y.normal) && (z = !0, J = d, this._collisionPoint.copyFrom(this._planeIntersectionPoint))), !z) {\n                var ie = this._velocity.lengthSquared(), se = ie;\n                this._basePoint.subtractToRef(n, this._tempVector);\n                var ce = 2 * u.e.Dot(this._velocity, this._tempVector), ue = this._tempVector.lengthSquared() - 1, fe = hr(se, ce, ue, J);\n                fe.found && (J = fe.root, z = !0, this._collisionPoint.copyFrom(n)), this._basePoint.subtractToRef(i, this._tempVector), ce = 2 * u.e.Dot(this._velocity, this._tempVector), ue = this._tempVector.lengthSquared() - 1, (fe = hr(se, ce, ue, J)).found && (J = fe.root, z = !0, this._collisionPoint.copyFrom(i)), this._basePoint.subtractToRef(o, this._tempVector), ce = 2 * u.e.Dot(this._velocity, this._tempVector), ue = this._tempVector.lengthSquared() - 1, (fe = hr(se, ce, ue, J)).found && (J = fe.root, z = !0, this._collisionPoint.copyFrom(o)), i.subtractToRef(n, this._edge), n.subtractToRef(this._basePoint, this._baseToVertex);\n                var ve = this._edge.lengthSquared(), Te = u.e.Dot(this._edge, this._velocity), Re = u.e.Dot(this._edge, this._baseToVertex);\n                if (se = ve * -ie + Te * Te, ce = ve * (2 * u.e.Dot(this._velocity, this._baseToVertex)) - 2 * Te * Re, ue = ve * (1 - this._baseToVertex.lengthSquared()) + Re * Re, (fe = hr(se, ce, ue, J)).found) {\n                  var Ae = (Te * fe.root - Re) / ve;\n                  Ae >= 0 && Ae <= 1 && (J = fe.root, z = !0, this._edge.scaleInPlace(Ae), n.addToRef(this._edge, this._collisionPoint));\n                }\n                o.subtractToRef(i, this._edge), i.subtractToRef(this._basePoint, this._baseToVertex), ve = this._edge.lengthSquared(), Te = u.e.Dot(this._edge, this._velocity), Re = u.e.Dot(this._edge, this._baseToVertex), se = ve * -ie + Te * Te, ce = ve * (2 * u.e.Dot(this._velocity, this._baseToVertex)) - 2 * Te * Re, ue = ve * (1 - this._baseToVertex.lengthSquared()) + Re * Re, (fe = hr(se, ce, ue, J)).found && (Ae = (Te * fe.root - Re) / ve) >= 0 && Ae <= 1 && (J = fe.root, z = !0, this._edge.scaleInPlace(Ae), i.addToRef(this._edge, this._collisionPoint)), n.subtractToRef(o, this._edge), o.subtractToRef(this._basePoint, this._baseToVertex), ve = this._edge.lengthSquared(), Te = u.e.Dot(this._edge, this._velocity), Re = u.e.Dot(this._edge, this._baseToVertex), se = ve * -ie + Te * Te, ce = ve * (2 * u.e.Dot(this._velocity, this._baseToVertex)) - 2 * Te * Re, ue = ve * (1 - this._baseToVertex.lengthSquared()) + Re * Re, (fe = hr(se, ce, ue, J)).found && (Ae = (Te * fe.root - Re) / ve) >= 0 && Ae <= 1 && (J = fe.root, z = !0, this._edge.scaleInPlace(Ae), o.addToRef(this._edge, this._collisionPoint));\n              }\n              if (z) {\n                var Ee = J * this._velocity.length();\n                (!this.collisionFound || Ee < this._nearestDistance) && (s.collisionResponse && (this.intersectionPoint ? this.intersectionPoint.copyFrom(this._collisionPoint) : this.intersectionPoint = this._collisionPoint.clone(), this._nearestDistance = Ee, this.collisionFound = !0), this.collidedMesh = s);\n              }\n            }\n          }, r.prototype._collide = function(t, e, n, i, o, a, s, d) {\n            if (n && n.length !== 0)\n              for (p = i; p < o; p += 3)\n                y = e[n[p] - a], P = e[n[p + 1] - a], R = e[n[p + 2] - a], this._testTriangle(p, t, R, P, y, s, d);\n            else\n              for (var p = 0; p < e.length; p += 3) {\n                var y = e[p], P = e[p + 1], R = e[p + 2];\n                this._testTriangle(p, t, R, P, y, s, d);\n              }\n          }, r.prototype._getResponse = function(t, e) {\n            t.addToRef(e, this._destinationPoint), e.scaleInPlace(this._nearestDistance / e.length()), this._basePoint.addToRef(e, t), t.subtractToRef(this.intersectionPoint, this._slidePlaneNormal), this._slidePlaneNormal.normalize(), this._slidePlaneNormal.scaleToRef(this._epsilon, this._displacementVector), t.addInPlace(this._displacementVector), this.intersectionPoint.addInPlace(this._displacementVector), this._slidePlaneNormal.scaleInPlace(ur.a.SignedDistanceToPlaneFromPositionAndNormal(this.intersectionPoint, this._slidePlaneNormal, this._destinationPoint)), this._destinationPoint.subtractInPlace(this._slidePlaneNormal), this._destinationPoint.subtractToRef(this.intersectionPoint, e);\n          }, r;\n        }(), Ll = function() {\n          function r() {\n            this._scaledPosition = u.e.Zero(), this._scaledVelocity = u.e.Zero(), this._finalPosition = u.e.Zero();\n          }\n          return r.prototype.getNewPosition = function(t, e, n, i, o, a, s) {\n            t.divideToRef(n._radius, this._scaledPosition), e.divideToRef(n._radius, this._scaledVelocity), n.collidedMesh = null, n._retry = 0, n._initialVelocity = this._scaledVelocity, n._initialPosition = this._scaledPosition, this._collideWithWorld(this._scaledPosition, this._scaledVelocity, n, i, this._finalPosition, o), this._finalPosition.multiplyInPlace(n._radius), a(s, this._finalPosition, n.collidedMesh);\n          }, r.prototype.createCollider = function() {\n            return new Dl();\n          }, r.prototype.init = function(t) {\n            this._scene = t;\n          }, r.prototype._collideWithWorld = function(t, e, n, i, o, a) {\n            a === void 0 && (a = null);\n            var s = 10 * Ue.a.CollisionsEpsilon;\n            if (n._retry >= i)\n              o.copyFrom(t);\n            else {\n              var d = a ? a.collisionMask : n.collisionMask;\n              n._initialize(t, e, s);\n              for (var p = a && a.surroundingMeshes || this._scene.meshes, y = 0; y < p.length; y++) {\n                var P = p[y];\n                P.isEnabled() && P.checkCollisions && P.subMeshes && P !== a && d & P.collisionGroup && P._checkCollision(n);\n              }\n              n.collisionFound ? (e.x === 0 && e.y === 0 && e.z === 0 || n._getResponse(t, e), e.length() <= s ? o.copyFrom(t) : (n._retry++, this._collideWithWorld(t, e, n, i, o, a))) : t.addToRef(e, o);\n            }\n          }, r;\n        }();\n        _e.a.CollisionCoordinatorFactory = function() {\n          return new Ll();\n        };\n        var Ki = f(54), Rf = f(114), Of = f(147), os = f(103), Ii = f(43), Nl = f(113), wl = function() {\n          function r(t, e, n, i, o, a) {\n            this.entries = new Array(), this._boundingVectors = new Array(), this._capacity = n, this._depth = i, this._maxDepth = o, this._creationFunc = a, this._minPoint = t, this._maxPoint = e, this._boundingVectors.push(t.clone()), this._boundingVectors.push(e.clone()), this._boundingVectors.push(t.clone()), this._boundingVectors[2].x = e.x, this._boundingVectors.push(t.clone()), this._boundingVectors[3].y = e.y, this._boundingVectors.push(t.clone()), this._boundingVectors[4].z = e.z, this._boundingVectors.push(e.clone()), this._boundingVectors[5].z = t.z, this._boundingVectors.push(e.clone()), this._boundingVectors[6].x = t.x, this._boundingVectors.push(e.clone()), this._boundingVectors[7].y = t.y;\n          }\n          return Object.defineProperty(r.prototype, \"capacity\", { get: function() {\n            return this._capacity;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"minPoint\", { get: function() {\n            return this._minPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxPoint\", { get: function() {\n            return this._maxPoint;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addEntry = function(t) {\n            if (this.blocks)\n              for (var e = 0; e < this.blocks.length; e++)\n                this.blocks[e].addEntry(t);\n            else\n              this._creationFunc(t, this), this.entries.length > this.capacity && this._depth < this._maxDepth && this.createInnerBlocks();\n          }, r.prototype.removeEntry = function(t) {\n            if (this.blocks)\n              for (var e = 0; e < this.blocks.length; e++)\n                this.blocks[e].removeEntry(t);\n            else {\n              var n = this.entries.indexOf(t);\n              n > -1 && this.entries.splice(n, 1);\n            }\n          }, r.prototype.addEntries = function(t) {\n            for (var e = 0; e < t.length; e++) {\n              var n = t[e];\n              this.addEntry(n);\n            }\n          }, r.prototype.select = function(t, e, n) {\n            if (os.a.IsInFrustum(this._boundingVectors, t)) {\n              if (this.blocks) {\n                for (var i = 0; i < this.blocks.length; i++)\n                  this.blocks[i].select(t, e, n);\n                return;\n              }\n              n ? e.concat(this.entries) : e.concatWithNoDuplicate(this.entries);\n            }\n          }, r.prototype.intersects = function(t, e, n, i) {\n            if (os.a.IntersectsSphere(this._minPoint, this._maxPoint, t, e)) {\n              if (this.blocks) {\n                for (var o = 0; o < this.blocks.length; o++)\n                  this.blocks[o].intersects(t, e, n, i);\n                return;\n              }\n              i ? n.concat(this.entries) : n.concatWithNoDuplicate(this.entries);\n            }\n          }, r.prototype.intersectsRay = function(t, e) {\n            if (t.intersectsBoxMinMax(this._minPoint, this._maxPoint)) {\n              if (this.blocks) {\n                for (var n = 0; n < this.blocks.length; n++)\n                  this.blocks[n].intersectsRay(t, e);\n                return;\n              }\n              e.concatWithNoDuplicate(this.entries);\n            }\n          }, r.prototype.createInnerBlocks = function() {\n            r._CreateBlocks(this._minPoint, this._maxPoint, this.entries, this._capacity, this._depth, this._maxDepth, this, this._creationFunc);\n          }, r._CreateBlocks = function(t, e, n, i, o, a, s, d) {\n            s.blocks = new Array();\n            for (var p = new u.e((e.x - t.x) / 2, (e.y - t.y) / 2, (e.z - t.z) / 2), y = 0; y < 2; y++)\n              for (var P = 0; P < 2; P++)\n                for (var R = 0; R < 2; R++) {\n                  var B = new r(t.add(p.multiplyByFloats(y, P, R)), t.add(p.multiplyByFloats(y + 1, P + 1, R + 1)), i, o + 1, a, d);\n                  B.addEntries(n), s.blocks.push(B);\n                }\n          }, r;\n        }(), Wr = function() {\n          function r(t, e, n) {\n            n === void 0 && (n = 2), this.maxDepth = n, this.dynamicContent = new Array(), this._maxBlockCapacity = e || 64, this._selectionContent = new si.b(1024), this._creationFunc = t;\n          }\n          return r.prototype.update = function(t, e, n) {\n            wl._CreateBlocks(t, e, n, this._maxBlockCapacity, 0, this.maxDepth, this, this._creationFunc);\n          }, r.prototype.addMesh = function(t) {\n            for (var e = 0; e < this.blocks.length; e++)\n              this.blocks[e].addEntry(t);\n          }, r.prototype.removeMesh = function(t) {\n            for (var e = 0; e < this.blocks.length; e++)\n              this.blocks[e].removeEntry(t);\n          }, r.prototype.select = function(t, e) {\n            this._selectionContent.reset();\n            for (var n = 0; n < this.blocks.length; n++)\n              this.blocks[n].select(t, this._selectionContent, e);\n            return e ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;\n          }, r.prototype.intersects = function(t, e, n) {\n            this._selectionContent.reset();\n            for (var i = 0; i < this.blocks.length; i++)\n              this.blocks[i].intersects(t, e, this._selectionContent, n);\n            return n ? this._selectionContent.concat(this.dynamicContent) : this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;\n          }, r.prototype.intersectsRay = function(t) {\n            this._selectionContent.reset();\n            for (var e = 0; e < this.blocks.length; e++)\n              this.blocks[e].intersectsRay(t, this._selectionContent);\n            return this._selectionContent.concatWithNoDuplicate(this.dynamicContent), this._selectionContent;\n          }, r.CreationFuncForMeshes = function(t, e) {\n            var n = t.getBoundingInfo();\n            !t.isBlocked && n.boundingBox.intersectsMinMax(e.minPoint, e.maxPoint) && e.entries.push(t);\n          }, r.CreationFuncForSubMeshes = function(t, e) {\n            t.getBoundingInfo().boundingBox.intersectsMinMax(e.minPoint, e.maxPoint) && e.entries.push(t);\n          }, r;\n        }();\n        _e.a.prototype.createOrUpdateSelectionOctree = function(r, t) {\n          r === void 0 && (r = 64), t === void 0 && (t = 2);\n          var e = this._getComponent(ot.a.NAME_OCTREE);\n          e || (e = new us(this), this._addComponent(e)), this._selectionOctree || (this._selectionOctree = new Wr(Wr.CreationFuncForMeshes, r, t));\n          var n = this.getWorldExtends();\n          return this._selectionOctree.update(n.min, n.max, this.meshes), this._selectionOctree;\n        }, Object.defineProperty(_e.a.prototype, \"selectionOctree\", { get: function() {\n          return this._selectionOctree;\n        }, enumerable: !0, configurable: !0 }), Mt.a.prototype.createOrUpdateSubmeshesOctree = function(r, t) {\n          r === void 0 && (r = 64), t === void 0 && (t = 2);\n          var e = this.getScene(), n = e._getComponent(ot.a.NAME_OCTREE);\n          n || (n = new us(e), e._addComponent(n)), this._submeshesOctree || (this._submeshesOctree = new Wr(Wr.CreationFuncForSubMeshes, r, t)), this.computeWorldMatrix(!0);\n          var i = this.getBoundingInfo().boundingBox;\n          return this._submeshesOctree.update(i.minimumWorld, i.maximumWorld, this.subMeshes), this._submeshesOctree;\n        };\n        var Xt, as, ss, cs, ls, us = function() {\n          function r(t) {\n            this.name = ot.a.NAME_OCTREE, this.checksIsEnabled = !0, this._tempRay = new dn.a(u.e.Zero(), new u.e(1, 1, 1)), this.scene = t, this.scene.getActiveMeshCandidates = this.getActiveMeshCandidates.bind(this), this.scene.getActiveSubMeshCandidates = this.getActiveSubMeshCandidates.bind(this), this.scene.getCollidingSubMeshCandidates = this.getCollidingSubMeshCandidates.bind(this), this.scene.getIntersectingSubMeshCandidates = this.getIntersectingSubMeshCandidates.bind(this);\n          }\n          return r.prototype.register = function() {\n            var t = this;\n            this.scene.onMeshRemovedObservable.add(function(e) {\n              var n = t.scene.selectionOctree;\n              if (n != null) {\n                var i = n.dynamicContent.indexOf(e);\n                i !== -1 && n.dynamicContent.splice(i, 1);\n              }\n            }), this.scene.onMeshImportedObservable.add(function(e) {\n              var n = t.scene.selectionOctree;\n              n != null && n.addMesh(e);\n            });\n          }, r.prototype.getActiveMeshCandidates = function() {\n            return this.scene._selectionOctree ? this.scene._selectionOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultMeshCandidates();\n          }, r.prototype.getActiveSubMeshCandidates = function(t) {\n            return t._submeshesOctree && t.useOctreeForRenderingSelection ? t._submeshesOctree.select(this.scene.frustumPlanes) : this.scene._getDefaultSubMeshCandidates(t);\n          }, r.prototype.getIntersectingSubMeshCandidates = function(t, e) {\n            return t._submeshesOctree && t.useOctreeForPicking ? (dn.a.TransformToRef(e, t.getWorldMatrix(), this._tempRay), t._submeshesOctree.intersectsRay(this._tempRay)) : this.scene._getDefaultSubMeshCandidates(t);\n          }, r.prototype.getCollidingSubMeshCandidates = function(t, e) {\n            if (t._submeshesOctree && t.useOctreeForCollisions) {\n              var n = e._velocityWorldLength + Math.max(e._radius.x, e._radius.y, e._radius.z);\n              return t._submeshesOctree.intersects(e._basePointWorld, n);\n            }\n            return this.scene._getDefaultSubMeshCandidates(t);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r;\n        }(), Qi = f(99);\n        (function(r) {\n          r[r.Generic = 0] = \"Generic\", r[r.Keyboard = 1] = \"Keyboard\", r[r.Mouse = 2] = \"Mouse\", r[r.Touch = 3] = \"Touch\", r[r.DualShock = 4] = \"DualShock\", r[r.Xbox = 5] = \"Xbox\", r[r.Switch = 6] = \"Switch\";\n        })(Xt || (Xt = {})), function(r) {\n          r[r.Horizontal = 0] = \"Horizontal\", r[r.Vertical = 1] = \"Vertical\", r[r.LeftClick = 2] = \"LeftClick\", r[r.MiddleClick = 3] = \"MiddleClick\", r[r.RightClick = 4] = \"RightClick\", r[r.BrowserBack = 5] = \"BrowserBack\", r[r.BrowserForward = 6] = \"BrowserForward\";\n        }(as || (as = {})), function(r) {\n          r[r.Cross = 0] = \"Cross\", r[r.Circle = 1] = \"Circle\", r[r.Square = 2] = \"Square\", r[r.Triangle = 3] = \"Triangle\", r[r.L1 = 4] = \"L1\", r[r.R1 = 5] = \"R1\", r[r.L2 = 6] = \"L2\", r[r.R2 = 7] = \"R2\", r[r.Share = 8] = \"Share\", r[r.Options = 9] = \"Options\", r[r.L3 = 10] = \"L3\", r[r.R3 = 11] = \"R3\", r[r.DPadUp = 12] = \"DPadUp\", r[r.DPadDown = 13] = \"DPadDown\", r[r.DPadLeft = 14] = \"DPadLeft\", r[r.DPadRight = 15] = \"DPadRight\", r[r.Home = 16] = \"Home\", r[r.TouchPad = 17] = \"TouchPad\", r[r.LStickXAxis = 18] = \"LStickXAxis\", r[r.LStickYAxis = 19] = \"LStickYAxis\", r[r.RStickXAxis = 20] = \"RStickXAxis\", r[r.RStickYAxis = 21] = \"RStickYAxis\";\n        }(ss || (ss = {})), function(r) {\n          r[r.A = 0] = \"A\", r[r.B = 1] = \"B\", r[r.X = 2] = \"X\", r[r.Y = 3] = \"Y\", r[r.LB = 4] = \"LB\", r[r.RB = 5] = \"RB\", r[r.LT = 6] = \"LT\", r[r.RT = 7] = \"RT\", r[r.Back = 8] = \"Back\", r[r.Start = 9] = \"Start\", r[r.LS = 10] = \"LS\", r[r.RS = 11] = \"RS\", r[r.DPadUp = 12] = \"DPadUp\", r[r.DPadDown = 13] = \"DPadDown\", r[r.DPadLeft = 14] = \"DPadLeft\", r[r.DPadRight = 15] = \"DPadRight\", r[r.Home = 16] = \"Home\", r[r.LStickXAxis = 17] = \"LStickXAxis\", r[r.LStickYAxis = 18] = \"LStickYAxis\", r[r.RStickXAxis = 19] = \"RStickXAxis\", r[r.RStickYAxis = 20] = \"RStickYAxis\";\n        }(cs || (cs = {})), function(r) {\n          r[r.B = 0] = \"B\", r[r.A = 1] = \"A\", r[r.Y = 2] = \"Y\", r[r.X = 3] = \"X\", r[r.L = 4] = \"L\", r[r.R = 5] = \"R\", r[r.ZL = 6] = \"ZL\", r[r.ZR = 7] = \"ZR\", r[r.Minus = 8] = \"Minus\", r[r.Plus = 9] = \"Plus\", r[r.LS = 10] = \"LS\", r[r.RS = 11] = \"RS\", r[r.DPadUp = 12] = \"DPadUp\", r[r.DPadDown = 13] = \"DPadDown\", r[r.DPadLeft = 14] = \"DPadLeft\", r[r.DPadRight = 15] = \"DPadRight\", r[r.Home = 16] = \"Home\", r[r.Capture = 17] = \"Capture\", r[r.LStickXAxis = 18] = \"LStickXAxis\", r[r.LStickYAxis = 19] = \"LStickYAxis\", r[r.RStickXAxis = 20] = \"RStickXAxis\", r[r.RStickYAxis = 21] = \"RStickYAxis\";\n        }(ls || (ls = {}));\n        var Fl = function() {\n          function r(t) {\n            this.onDeviceDisconnected = function() {\n            }, this._inputs = [], this._keyboardActive = !1, this._pointerActive = !1, this._keyboardDownEvent = function(n) {\n            }, this._keyboardUpEvent = function(n) {\n            }, this._pointerMoveEvent = function(n) {\n            }, this._pointerDownEvent = function(n) {\n            }, this._pointerUpEvent = function(n) {\n            }, this._gamepadConnectedEvent = function(n) {\n            }, this._gamepadDisconnectedEvent = function(n) {\n            }, this._onDeviceConnected = function() {\n            };\n            var e = t.getInputElement();\n            e && (this._elementToAttachTo = e, this._handleKeyActions(), this._handlePointerActions(), this._handleGamepadActions(), this._checkForConnectedDevices());\n          }\n          return Object.defineProperty(r.prototype, \"onDeviceConnected\", { get: function() {\n            return this._onDeviceConnected;\n          }, set: function(t) {\n            this._onDeviceConnected = t;\n            for (var e = 0; e < this._inputs.length; e++)\n              if (this._inputs[e])\n                for (var n = 0; n < this._inputs[e].length; n++)\n                  this._inputs[e][n] && this._onDeviceConnected(e, n);\n          }, enumerable: !1, configurable: !0 }), r.Create = function(t) {\n            return typeof _native < \"u\" && _native.DeviceInputSystem ? new _native.DeviceInputSystem(t) : new r(t);\n          }, r.prototype.pollInput = function(t, e, n) {\n            var i = this._inputs[t][e];\n            if (!i)\n              throw \"Unable to find device \" + Xt[t];\n            if (this._updateDevice(t, e, n), i[n] === void 0)\n              throw \"Unable to find input \" + n + \" for device \" + Xt[t] + \" in slot \" + e;\n            return i[n];\n          }, r.prototype.dispose = function() {\n            this._keyboardActive && (window.removeEventListener(\"keydown\", this._keyboardDownEvent), window.removeEventListener(\"keyup\", this._keyboardUpEvent)), this._pointerActive && (this._elementToAttachTo.removeEventListener(\"pointermove\", this._pointerMoveEvent), this._elementToAttachTo.removeEventListener(\"pointerdown\", this._pointerDownEvent), this._elementToAttachTo.removeEventListener(\"pointerup\", this._pointerUpEvent)), window.removeEventListener(\"gamepadconnected\", this._gamepadConnectedEvent), window.removeEventListener(\"gamepaddisconnected\", this._gamepadDisconnectedEvent);\n          }, r.prototype._checkForConnectedDevices = function() {\n            for (var t = 0, e = navigator.getGamepads(); t < e.length; t++) {\n              var n = e[t];\n              n && this._addGamePad(n);\n            }\n            matchMedia(\"(pointer:fine)\").matches && this._addPointerDevice(Xt.Mouse, 0, 0, 0);\n          }, r.prototype._addGamePad = function(t) {\n            var e = this._getGamepadDeviceType(t.id), n = t.index;\n            this._registerDevice(e, n, t.buttons.length + t.axes.length), this._gamepads = this._gamepads || new Array(t.index + 1), this._gamepads[n] = e;\n          }, r.prototype._addPointerDevice = function(t, e, n, i) {\n            this._pointerActive = !0, this._registerDevice(t, e, r._MAX_POINTER_INPUTS);\n            var o = this._inputs[t][e];\n            o[0] = n, o[1] = i;\n          }, r.prototype._registerDevice = function(t, e, n) {\n            if (this._inputs[t] || (this._inputs[t] = []), !this._inputs[t][e]) {\n              for (var i = new Array(n), o = 0; o < n; o++)\n                i[o] = 0;\n              this._inputs[t][e] = i, this.onDeviceConnected(t, e);\n            }\n          }, r.prototype._unregisterDevice = function(t, e) {\n            this._inputs[t][e] && (delete this._inputs[t][e], this.onDeviceDisconnected(t, e));\n          }, r.prototype._handleKeyActions = function() {\n            var t = this;\n            this._keyboardDownEvent = function(e) {\n              t._keyboardActive || (t._keyboardActive = !0, t._registerDevice(Xt.Keyboard, 0, r._MAX_KEYCODES));\n              var n = t._inputs[Xt.Keyboard][0];\n              n && (t.onInputChanged && t.onInputChanged(Xt.Keyboard, 0, e.keyCode, n[e.keyCode], 1), n[e.keyCode] = 1);\n            }, this._keyboardUpEvent = function(e) {\n              var n = t._inputs[Xt.Keyboard][0];\n              n && (t.onInputChanged && t.onInputChanged(Xt.Keyboard, 0, e.keyCode, n[e.keyCode], 0), n[e.keyCode] = 0);\n            }, window.addEventListener(\"keydown\", this._keyboardDownEvent), window.addEventListener(\"keyup\", this._keyboardUpEvent);\n          }, r.prototype._handlePointerActions = function() {\n            var t = this;\n            this._pointerMoveEvent = function(e) {\n              var n = e.pointerType == \"mouse\" ? Xt.Mouse : Xt.Touch, i = e.pointerType == \"mouse\" ? 0 : e.pointerId;\n              t._inputs[n] || (t._inputs[n] = []), t._inputs[n][i] || t._addPointerDevice(n, i, e.clientX, e.clientY);\n              var o = t._inputs[n][i];\n              o && (t.onInputChanged && (t.onInputChanged(n, i, 0, o[0], e.clientX), t.onInputChanged(n, i, 1, o[1], e.clientY)), o[0] = e.clientX, o[1] = e.clientY);\n            }, this._pointerDownEvent = function(e) {\n              var n = e.pointerType == \"mouse\" ? Xt.Mouse : Xt.Touch, i = e.pointerType == \"mouse\" ? 0 : e.pointerId;\n              t._inputs[n] || (t._inputs[n] = []), t._inputs[n][i] || t._addPointerDevice(n, i, e.clientX, e.clientY);\n              var o = t._inputs[n][i];\n              o && (t.onInputChanged && (t.onInputChanged(n, i, 0, o[0], e.clientX), t.onInputChanged(n, i, 1, o[1], e.clientY), t.onInputChanged(n, i, e.button + 2, o[e.button + 2], 1)), o[0] = e.clientX, o[1] = e.clientY, o[e.button + 2] = 1);\n            }, this._pointerUpEvent = function(e) {\n              var n = e.pointerType == \"mouse\" ? Xt.Mouse : Xt.Touch, i = e.pointerType == \"mouse\" ? 0 : e.pointerId, o = t._inputs[n][i];\n              o && (t.onInputChanged && t.onInputChanged(n, i, e.button + 2, o[e.button + 2], 0), o[0] = e.clientX, o[1] = e.clientY, o[e.button + 2] = 0), e.pointerType != \"mouse\" && t._unregisterDevice(n, i);\n            }, this._elementToAttachTo.addEventListener(\"pointermove\", this._pointerMoveEvent), this._elementToAttachTo.addEventListener(\"pointerdown\", this._pointerDownEvent), this._elementToAttachTo.addEventListener(\"pointerup\", this._pointerUpEvent);\n          }, r.prototype._handleGamepadActions = function() {\n            var t = this;\n            this._gamepadConnectedEvent = function(e) {\n              t._addGamePad(e.gamepad);\n            }, this._gamepadDisconnectedEvent = function(e) {\n              if (t._gamepads) {\n                var n = t._getGamepadDeviceType(e.gamepad.id), i = e.gamepad.index;\n                t._unregisterDevice(n, i), delete t._gamepads[i];\n              }\n            }, window.addEventListener(\"gamepadconnected\", this._gamepadConnectedEvent), window.addEventListener(\"gamepaddisconnected\", this._gamepadDisconnectedEvent);\n          }, r.prototype._updateDevice = function(t, e, n) {\n            var i = navigator.getGamepads()[e];\n            if (i && t == this._gamepads[e]) {\n              var o = this._inputs[t][e];\n              n >= i.buttons.length ? o[n] = i.axes[n - i.buttons.length].valueOf() : o[n] = i.buttons[n].value;\n            }\n          }, r.prototype._getGamepadDeviceType = function(t) {\n            return t.indexOf(\"054c\") !== -1 ? Xt.DualShock : t.indexOf(\"Xbox One\") !== -1 || t.search(\"Xbox 360\") !== -1 || t.search(\"xinput\") !== -1 ? Xt.Xbox : t.indexOf(\"057e\") !== -1 ? Xt.Switch : Xt.Generic;\n          }, r._MAX_KEYCODES = 255, r._MAX_POINTER_INPUTS = 7, r;\n        }(), Bl = function() {\n          function r(t, e, n) {\n            n === void 0 && (n = 0), this.deviceType = e, this.deviceSlot = n, this.onInputChangedObservable = new C.c(), this._deviceInputSystem = t;\n          }\n          return r.prototype.getInput = function(t) {\n            return this._deviceInputSystem.pollInput(this.deviceType, this.deviceSlot, t);\n          }, r;\n        }(), Mf = function() {\n          function r(t) {\n            var e = this;\n            this.onDeviceConnectedObservable = new C.c(function(i) {\n              e.getDevices().forEach(function(o) {\n                e.onDeviceConnectedObservable.notifyObserver(i, o);\n              });\n            }), this.onDeviceDisconnectedObservable = new C.c();\n            var n = Object.keys(Xt).length / 2;\n            this._devices = new Array(n), this._firstDevice = new Array(n), this._deviceInputSystem = Fl.Create(t), this._deviceInputSystem.onDeviceConnected = function(i, o) {\n              e._addDevice(i, o), e.onDeviceConnectedObservable.notifyObservers(e.getDeviceSource(i, o));\n            }, this._deviceInputSystem.onDeviceDisconnected = function(i, o) {\n              var a = e.getDeviceSource(i, o);\n              e._removeDevice(i, o), e.onDeviceDisconnectedObservable.notifyObservers(a);\n            }, this._deviceInputSystem.onInputChanged || (this._deviceInputSystem.onInputChanged = function(i, o, a, s, d) {\n              var p;\n              (p = e.getDeviceSource(i, o)) === null || p === void 0 || p.onInputChangedObservable.notifyObservers({ inputIndex: a, previousState: s, currentState: d });\n            });\n          }\n          return r.prototype.getDeviceSource = function(t, e) {\n            if (e === void 0) {\n              if (this._firstDevice[t] === void 0)\n                return null;\n              e = this._firstDevice[t];\n            }\n            return this._devices[t] && this._devices[t][e] !== void 0 ? this._devices[t][e] : null;\n          }, r.prototype.getDeviceSources = function(t) {\n            return this._devices[t].filter(function(e) {\n              return !!e;\n            });\n          }, r.prototype.getDevices = function() {\n            var t = new Array();\n            return this._devices.forEach(function(e) {\n              t.push.apply(t, e);\n            }), t;\n          }, r.prototype.dispose = function() {\n            this.onDeviceConnectedObservable.clear(), this.onDeviceDisconnectedObservable.clear(), this._deviceInputSystem.dispose();\n          }, r.prototype._addDevice = function(t, e) {\n            this._devices[t] || (this._devices[t] = new Array()), this._devices[t][e] || (this._devices[t][e] = new Bl(this._deviceInputSystem, t, e), this._updateFirstDevices(t));\n          }, r.prototype._removeDevice = function(t, e) {\n            delete this._devices[t][e], this._updateFirstDevices(t);\n          }, r.prototype._updateFirstDevices = function(t) {\n            switch (t) {\n              case Xt.Keyboard:\n              case Xt.Mouse:\n                this._firstDevice[t] = 0;\n                break;\n              case Xt.Touch:\n              case Xt.DualShock:\n              case Xt.Xbox:\n              case Xt.Switch:\n              case Xt.Generic:\n                var e = this._devices[t];\n                delete this._firstDevice[t];\n                for (var n = 0; n < e.length; n++)\n                  if (e[n]) {\n                    this._firstDevice[t] = n;\n                    break;\n                  }\n            }\n          }, r;\n        }(), Ul = f(168), Vl = (f(123), function() {\n          this._timeElapsedQueryEnded = !1;\n        }), kl = function() {\n          this.occlusionInternalRetryCounter = 0, this.isOcclusionQueryInProgress = !1, this.isOccluded = !1, this.occlusionRetryCount = -1, this.occlusionType = Mt.a.OCCLUSION_TYPE_NONE, this.occlusionQueryAlgorithmType = Mt.a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;\n        };\n        Ue.a.prototype.createQuery = function() {\n          return this._gl.createQuery();\n        }, Ue.a.prototype.deleteQuery = function(r) {\n          return this._gl.deleteQuery(r), this;\n        }, Ue.a.prototype.isQueryResultAvailable = function(r) {\n          return this._gl.getQueryParameter(r, this._gl.QUERY_RESULT_AVAILABLE);\n        }, Ue.a.prototype.getQueryResult = function(r) {\n          return this._gl.getQueryParameter(r, this._gl.QUERY_RESULT);\n        }, Ue.a.prototype.beginOcclusionQuery = function(r, t) {\n          var e = this._getGlAlgorithmType(r);\n          return this._gl.beginQuery(e, t), this;\n        }, Ue.a.prototype.endOcclusionQuery = function(r) {\n          var t = this._getGlAlgorithmType(r);\n          return this._gl.endQuery(t), this;\n        }, Ue.a.prototype._createTimeQuery = function() {\n          var r = this.getCaps().timerQuery;\n          return r.createQueryEXT ? r.createQueryEXT() : this.createQuery();\n        }, Ue.a.prototype._deleteTimeQuery = function(r) {\n          var t = this.getCaps().timerQuery;\n          t.deleteQueryEXT ? t.deleteQueryEXT(r) : this.deleteQuery(r);\n        }, Ue.a.prototype._getTimeQueryResult = function(r) {\n          var t = this.getCaps().timerQuery;\n          return t.getQueryObjectEXT ? t.getQueryObjectEXT(r, t.QUERY_RESULT_EXT) : this.getQueryResult(r);\n        }, Ue.a.prototype._getTimeQueryAvailability = function(r) {\n          var t = this.getCaps().timerQuery;\n          return t.getQueryObjectEXT ? t.getQueryObjectEXT(r, t.QUERY_RESULT_AVAILABLE_EXT) : this.isQueryResultAvailable(r);\n        }, Ue.a.prototype.startTimeQuery = function() {\n          var r = this.getCaps(), t = r.timerQuery;\n          if (!t)\n            return null;\n          var e = new Vl();\n          if (this._gl.getParameter(t.GPU_DISJOINT_EXT), r.canUseTimestampForTimerQuery)\n            e._startTimeQuery = this._createTimeQuery(), t.queryCounterEXT(e._startTimeQuery, t.TIMESTAMP_EXT);\n          else {\n            if (this._currentNonTimestampToken)\n              return this._currentNonTimestampToken;\n            e._timeElapsedQuery = this._createTimeQuery(), t.beginQueryEXT ? t.beginQueryEXT(t.TIME_ELAPSED_EXT, e._timeElapsedQuery) : this._gl.beginQuery(t.TIME_ELAPSED_EXT, e._timeElapsedQuery), this._currentNonTimestampToken = e;\n          }\n          return e;\n        }, Ue.a.prototype.endTimeQuery = function(r) {\n          var t = this.getCaps(), e = t.timerQuery;\n          if (!e || !r)\n            return -1;\n          if (t.canUseTimestampForTimerQuery) {\n            if (!r._startTimeQuery)\n              return -1;\n            r._endTimeQuery || (r._endTimeQuery = this._createTimeQuery(), e.queryCounterEXT(r._endTimeQuery, e.TIMESTAMP_EXT));\n          } else if (!r._timeElapsedQueryEnded) {\n            if (!r._timeElapsedQuery)\n              return -1;\n            e.endQueryEXT ? e.endQueryEXT(e.TIME_ELAPSED_EXT) : this._gl.endQuery(e.TIME_ELAPSED_EXT), r._timeElapsedQueryEnded = !0;\n          }\n          var n = this._gl.getParameter(e.GPU_DISJOINT_EXT), i = !1;\n          if (r._endTimeQuery ? i = this._getTimeQueryAvailability(r._endTimeQuery) : r._timeElapsedQuery && (i = this._getTimeQueryAvailability(r._timeElapsedQuery)), i && !n) {\n            var o = 0;\n            if (t.canUseTimestampForTimerQuery) {\n              if (!r._startTimeQuery || !r._endTimeQuery)\n                return -1;\n              var a = this._getTimeQueryResult(r._startTimeQuery);\n              o = this._getTimeQueryResult(r._endTimeQuery) - a, this._deleteTimeQuery(r._startTimeQuery), this._deleteTimeQuery(r._endTimeQuery), r._startTimeQuery = null, r._endTimeQuery = null;\n            } else {\n              if (!r._timeElapsedQuery)\n                return -1;\n              o = this._getTimeQueryResult(r._timeElapsedQuery), this._deleteTimeQuery(r._timeElapsedQuery), r._timeElapsedQuery = null, r._timeElapsedQueryEnded = !1, this._currentNonTimestampToken = null;\n            }\n            return o;\n          }\n          return -1;\n        }, Ue.a.prototype._getGlAlgorithmType = function(r) {\n          return r === Mt.a.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE ? this._gl.ANY_SAMPLES_PASSED_CONSERVATIVE : this._gl.ANY_SAMPLES_PASSED;\n        }, Object.defineProperty(Mt.a.prototype, \"isOcclusionQueryInProgress\", { get: function() {\n          return this._occlusionDataStorage.isOcclusionQueryInProgress;\n        }, set: function(r) {\n          this._occlusionDataStorage.isOcclusionQueryInProgress = r;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"_occlusionDataStorage\", { get: function() {\n          return this.__occlusionDataStorage || (this.__occlusionDataStorage = new kl()), this.__occlusionDataStorage;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"isOccluded\", { get: function() {\n          return this._occlusionDataStorage.isOccluded;\n        }, set: function(r) {\n          this._occlusionDataStorage.isOccluded = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"occlusionQueryAlgorithmType\", { get: function() {\n          return this._occlusionDataStorage.occlusionQueryAlgorithmType;\n        }, set: function(r) {\n          this._occlusionDataStorage.occlusionQueryAlgorithmType = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"occlusionType\", { get: function() {\n          return this._occlusionDataStorage.occlusionType;\n        }, set: function(r) {\n          this._occlusionDataStorage.occlusionType = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Mt.a.prototype, \"occlusionRetryCount\", { get: function() {\n          return this._occlusionDataStorage.occlusionRetryCount;\n        }, set: function(r) {\n          this._occlusionDataStorage.occlusionRetryCount = r;\n        }, enumerable: !0, configurable: !0 }), Mt.a.prototype._checkOcclusionQuery = function() {\n          var r = this._occlusionDataStorage;\n          if (r.occlusionType === Mt.a.OCCLUSION_TYPE_NONE)\n            return r.isOccluded = !1, !1;\n          var t = this.getEngine();\n          if (t.webGLVersion < 2 || !t.isQueryResultAvailable)\n            return r.isOccluded = !1, !1;\n          if (this.isOcclusionQueryInProgress && this._occlusionQuery)\n            if (t.isQueryResultAvailable(this._occlusionQuery)) {\n              var e = t.getQueryResult(this._occlusionQuery);\n              r.isOcclusionQueryInProgress = !1, r.occlusionInternalRetryCounter = 0, r.isOccluded = e !== 1;\n            } else {\n              if (r.occlusionInternalRetryCounter++, !(r.occlusionRetryCount !== -1 && r.occlusionInternalRetryCounter > r.occlusionRetryCount))\n                return !1;\n              r.isOcclusionQueryInProgress = !1, r.occlusionInternalRetryCounter = 0, r.isOccluded = r.occlusionType !== Mt.a.OCCLUSION_TYPE_OPTIMISTIC && r.isOccluded;\n            }\n          var n = this.getScene();\n          if (n.getBoundingBoxRenderer) {\n            var i = n.getBoundingBoxRenderer();\n            this._occlusionQuery || (this._occlusionQuery = t.createQuery()), t.beginOcclusionQuery(r.occlusionQueryAlgorithmType, this._occlusionQuery), i.renderOcclusionBoundingBox(this), t.endOcclusionQuery(r.occlusionQueryAlgorithmType), this._occlusionDataStorage.isOcclusionQueryInProgress = !0;\n          }\n          return r.isOccluded;\n        };\n        var If = !0;\n        Ue.a.prototype.createTransformFeedback = function() {\n          return this._gl.createTransformFeedback();\n        }, Ue.a.prototype.deleteTransformFeedback = function(r) {\n          this._gl.deleteTransformFeedback(r);\n        }, Ue.a.prototype.bindTransformFeedback = function(r) {\n          this._gl.bindTransformFeedback(this._gl.TRANSFORM_FEEDBACK, r);\n        }, Ue.a.prototype.beginTransformFeedback = function(r) {\n          r === void 0 && (r = !0), this._gl.beginTransformFeedback(r ? this._gl.POINTS : this._gl.TRIANGLES);\n        }, Ue.a.prototype.endTransformFeedback = function() {\n          this._gl.endTransformFeedback();\n        }, Ue.a.prototype.setTranformFeedbackVaryings = function(r, t) {\n          this._gl.transformFeedbackVaryings(r, t, this._gl.INTERLEAVED_ATTRIBS);\n        }, Ue.a.prototype.bindTransformFeedbackBuffer = function(r) {\n          this._gl.bindBufferBase(this._gl.TRANSFORM_FEEDBACK_BUFFER, 0, r ? r.underlyingResource : null);\n        }, f(126), wt.a.prototype.updateVideoTexture = function(r, t, e) {\n          if (r && !r._isDisabled) {\n            var n = this._bindTextureDirectly(this._gl.TEXTURE_2D, r, !0);\n            this._unpackFlipY(!e);\n            try {\n              if (this._videoTextureSupported === void 0 && (this._gl.getError(), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t), this._gl.getError() !== 0 ? this._videoTextureSupported = !1 : this._videoTextureSupported = !0), this._videoTextureSupported)\n                this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, t);\n              else {\n                if (!r._workingCanvas) {\n                  r._workingCanvas = ns.a.CreateCanvas(r.width, r.height);\n                  var i = r._workingCanvas.getContext(\"2d\");\n                  if (!i)\n                    throw new Error(\"Unable to get 2d context\");\n                  r._workingContext = i, r._workingCanvas.width = r.width, r._workingCanvas.height = r.height;\n                }\n                r._workingContext.clearRect(0, 0, r.width, r.height), r._workingContext.drawImage(t, 0, 0, t.videoWidth, t.videoHeight, 0, 0, r.width, r.height), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, r._workingCanvas);\n              }\n              r.generateMipMaps && this._gl.generateMipmap(this._gl.TEXTURE_2D), n || this._bindTextureDirectly(this._gl.TEXTURE_2D, null), r.isReady = !0;\n            } catch {\n              r._isDisabled = !0;\n            }\n          }\n        }, wt.a.prototype.restoreSingleAttachment = function() {\n          var r = this._gl;\n          this.bindAttachments([r.BACK]);\n        }, wt.a.prototype.buildTextureLayout = function(r) {\n          for (var t = this._gl, e = [], n = 0; n < r.length; n++)\n            r[n] ? e.push(t[\"COLOR_ATTACHMENT\" + n]) : e.push(t.NONE);\n          return e;\n        }, wt.a.prototype.bindAttachments = function(r) {\n          this._gl.drawBuffers(r);\n        }, wt.a.prototype.unBindMultiColorAttachmentFramebuffer = function(r, t, e) {\n          t === void 0 && (t = !1), this._currentRenderTarget = null;\n          var n = this._gl, i = r[0]._attachments, o = i.length;\n          if (r[0]._MSAAFramebuffer) {\n            n.bindFramebuffer(n.READ_FRAMEBUFFER, r[0]._MSAAFramebuffer), n.bindFramebuffer(n.DRAW_FRAMEBUFFER, r[0]._framebuffer);\n            for (var a = 0; a < o; a++) {\n              for (var s = r[a], d = 0; d < o; d++)\n                i[d] = n.NONE;\n              i[a] = n[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + a : \"COLOR_ATTACHMENT\" + a + \"_WEBGL\"], n.readBuffer(i[a]), n.drawBuffers(i), n.blitFramebuffer(0, 0, s.width, s.height, 0, 0, s.width, s.height, n.COLOR_BUFFER_BIT, n.NEAREST);\n            }\n            for (a = 0; a < o; a++)\n              i[a] = n[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + a : \"COLOR_ATTACHMENT\" + a + \"_WEBGL\"];\n            n.drawBuffers(i);\n          }\n          for (a = 0; a < o; a++)\n            !(s = r[a]).generateMipMaps || t || s.isCube || (this._bindTextureDirectly(n.TEXTURE_2D, s, !0), n.generateMipmap(n.TEXTURE_2D), this._bindTextureDirectly(n.TEXTURE_2D, null));\n          e && (r[0]._MSAAFramebuffer && this._bindUnboundFramebuffer(r[0]._framebuffer), e()), this._bindUnboundFramebuffer(null);\n        }, wt.a.prototype.createMultipleRenderTarget = function(r, t) {\n          var e = !1, n = !0, i = !1, o = !1, a = 1, s = h.a.TEXTURETYPE_UNSIGNED_INT, d = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, p = new Array(), y = new Array();\n          t !== void 0 && (e = t.generateMipMaps !== void 0 && t.generateMipMaps, n = t.generateDepthBuffer === void 0 || t.generateDepthBuffer, i = t.generateStencilBuffer !== void 0 && t.generateStencilBuffer, o = t.generateDepthTexture !== void 0 && t.generateDepthTexture, a = t.textureCount || 1, t.types && (p = t.types), t.samplingModes && (y = t.samplingModes));\n          var P = this._gl, R = P.createFramebuffer();\n          this._bindUnboundFramebuffer(R);\n          for (var B = r.width || r, F = r.height || r, z = [], J = [], ie = this._setupFramebufferDepthAttachments(i, n, B, F), se = 0; se < a; se++) {\n            var ce = y[se] || d, ue = p[se] || s;\n            (ue !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (ue !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (ce = h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            var fe = this._getSamplingParameters(ce, e);\n            ue !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (ue = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\"));\n            var ve = new Pt.a(this, Pt.b.MultiRenderTarget), Te = P[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + se : \"COLOR_ATTACHMENT\" + se + \"_WEBGL\"];\n            z.push(ve), J.push(Te), P.activeTexture(P[\"TEXTURE\" + se]), P.bindTexture(P.TEXTURE_2D, ve._webGLTexture), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MAG_FILTER, fe.mag), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MIN_FILTER, fe.min), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_S, P.CLAMP_TO_EDGE), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_T, P.CLAMP_TO_EDGE), P.texImage2D(P.TEXTURE_2D, 0, this._getRGBABufferInternalSizedFormat(ue), B, F, 0, P.RGBA, this._getWebGLTextureType(ue), null), P.framebufferTexture2D(P.DRAW_FRAMEBUFFER, Te, P.TEXTURE_2D, ve._webGLTexture, 0), e && this._gl.generateMipmap(this._gl.TEXTURE_2D), this._bindTextureDirectly(P.TEXTURE_2D, null), ve._framebuffer = R, ve._depthStencilBuffer = ie, ve.baseWidth = B, ve.baseHeight = F, ve.width = B, ve.height = F, ve.isReady = !0, ve.samples = 1, ve.generateMipMaps = e, ve.samplingMode = ce, ve.type = ue, ve._generateDepthBuffer = n, ve._generateStencilBuffer = i, ve._attachments = J, ve._textureArray = z, this._internalTexturesCache.push(ve);\n          }\n          if (o && this._caps.depthTextureExtension) {\n            var Re = new Pt.a(this, Pt.b.MultiRenderTarget);\n            P.activeTexture(P.TEXTURE0), P.bindTexture(P.TEXTURE_2D, Re._webGLTexture), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MAG_FILTER, P.NEAREST), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_MIN_FILTER, P.NEAREST), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_S, P.CLAMP_TO_EDGE), P.texParameteri(P.TEXTURE_2D, P.TEXTURE_WRAP_T, P.CLAMP_TO_EDGE), P.texImage2D(P.TEXTURE_2D, 0, this.webGLVersion < 2 ? P.DEPTH_COMPONENT : P.DEPTH_COMPONENT16, B, F, 0, P.DEPTH_COMPONENT, P.UNSIGNED_SHORT, null), P.framebufferTexture2D(P.FRAMEBUFFER, P.DEPTH_ATTACHMENT, P.TEXTURE_2D, Re._webGLTexture, 0), Re._framebuffer = R, Re.baseWidth = B, Re.baseHeight = F, Re.width = B, Re.height = F, Re.isReady = !0, Re.samples = 1, Re.generateMipMaps = e, Re.samplingMode = P.NEAREST, Re._generateDepthBuffer = n, Re._generateStencilBuffer = i, z.push(Re), this._internalTexturesCache.push(Re);\n          }\n          return P.drawBuffers(J), this._bindUnboundFramebuffer(null), this.resetTextureCache(), z;\n        }, wt.a.prototype.updateMultipleRenderTargetTextureSampleCount = function(r, t) {\n          if (this.webGLVersion < 2 || !r)\n            return 1;\n          if (r[0].samples === t)\n            return t;\n          var e = r[0]._attachments.length;\n          if (e === 0)\n            return 1;\n          var n = this._gl;\n          t = Math.min(t, this.getCaps().maxMSAASamples), r[0]._depthStencilBuffer && (n.deleteRenderbuffer(r[0]._depthStencilBuffer), r[0]._depthStencilBuffer = null), r[0]._MSAAFramebuffer && (n.deleteFramebuffer(r[0]._MSAAFramebuffer), r[0]._MSAAFramebuffer = null);\n          for (var i = 0; i < e; i++)\n            r[i]._MSAARenderBuffer && (n.deleteRenderbuffer(r[i]._MSAARenderBuffer), r[i]._MSAARenderBuffer = null);\n          if (t > 1 && n.renderbufferStorageMultisample) {\n            var o = n.createFramebuffer();\n            if (!o)\n              throw new Error(\"Unable to create multi sampled framebuffer\");\n            this._bindUnboundFramebuffer(o);\n            var a = this._setupFramebufferDepthAttachments(r[0]._generateStencilBuffer, r[0]._generateDepthBuffer, r[0].width, r[0].height, t), s = [];\n            for (i = 0; i < e; i++) {\n              var d = r[i], p = n[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + i : \"COLOR_ATTACHMENT\" + i + \"_WEBGL\"], y = n.createRenderbuffer();\n              if (!y)\n                throw new Error(\"Unable to create multi sampled framebuffer\");\n              n.bindRenderbuffer(n.RENDERBUFFER, y), n.renderbufferStorageMultisample(n.RENDERBUFFER, t, this._getRGBAMultiSampleBufferFormat(d.type), d.width, d.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, p, n.RENDERBUFFER, y), d._MSAAFramebuffer = o, d._MSAARenderBuffer = y, d.samples = t, d._depthStencilBuffer = a, n.bindRenderbuffer(n.RENDERBUFFER, null), s.push(p);\n            }\n            n.drawBuffers(s);\n          } else\n            this._bindUnboundFramebuffer(r[0]._framebuffer);\n          return this._bindUnboundFramebuffer(null), t;\n        };\n        var Xr = f(56);\n        wt.a.prototype._createDepthStencilCubeTexture = function(r, t) {\n          var e = new Pt.a(this, Pt.b.Unknown);\n          if (e.isCube = !0, this.webGLVersion === 1)\n            return l.a.Error(\"Depth cube texture is not supported by WebGL 1.\"), e;\n          var n = Object(c.a)({ bilinearFiltering: !1, comparisonFunction: 0, generateStencil: !1 }, t), i = this._gl;\n          this._bindTextureDirectly(i.TEXTURE_CUBE_MAP, e, !0), this._setupDepthStencilTexture(e, r, n.generateStencil, n.bilinearFiltering, n.comparisonFunction);\n          for (var o = 0; o < 6; o++)\n            n.generateStencil ? i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + o, 0, i.DEPTH24_STENCIL8, r, r, 0, i.DEPTH_STENCIL, i.UNSIGNED_INT_24_8, null) : i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + o, 0, i.DEPTH_COMPONENT24, r, r, 0, i.DEPTH_COMPONENT, i.UNSIGNED_INT, null);\n          return this._bindTextureDirectly(i.TEXTURE_CUBE_MAP, null), e;\n        }, wt.a.prototype._partialLoadFile = function(r, t, e, n, i) {\n          i === void 0 && (i = null), this._loadFile(r, function(o) {\n            e[t] = o, e._internalCount++, e._internalCount === 6 && n(e);\n          }, void 0, void 0, !0, function(o, a) {\n            i && o && i(o.status + \" \" + o.statusText, a);\n          });\n        }, wt.a.prototype._cascadeLoadFiles = function(r, t, e, n) {\n          n === void 0 && (n = null);\n          var i = [];\n          i._internalCount = 0;\n          for (var o = 0; o < 6; o++)\n            this._partialLoadFile(e[o], o, i, t, n);\n        }, wt.a.prototype._cascadeLoadImgs = function(r, t, e, n, i) {\n          n === void 0 && (n = null);\n          var o = [];\n          o._internalCount = 0;\n          for (var a = 0; a < 6; a++)\n            this._partialLoadImg(e[a], a, o, r, t, n, i);\n        }, wt.a.prototype._partialLoadImg = function(r, t, e, n, i, o, a) {\n          var s;\n          o === void 0 && (o = null), s = Xr.a.LoadImage(r, function() {\n            s && (e[t] = s, e._internalCount++, n && n._removePendingData(s)), e._internalCount === 6 && i(e);\n          }, function(d, p) {\n            n && n._removePendingData(s), o && o(d, p);\n          }, n ? n.offlineProvider : null, a), n && s && n._addPendingData(s);\n        }, wt.a.prototype._setCubeMapTextureParams = function(r, t) {\n          var e = this._gl;\n          e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_MIN_FILTER, t ? e.LINEAR_MIPMAP_LINEAR : e.LINEAR), e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_CUBE_MAP, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), r.samplingMode = t ? h.a.TEXTURE_TRILINEAR_SAMPLINGMODE : h.a.TEXTURE_LINEAR_LINEAR, this._bindTextureDirectly(e.TEXTURE_CUBE_MAP, null);\n        }, wt.a.prototype.createCubeTexture = function(r, t, e, n, i, o, a, s, d, p, y, P, R) {\n          var B = this;\n          i === void 0 && (i = null), o === void 0 && (o = null), s === void 0 && (s = null), d === void 0 && (d = !1), p === void 0 && (p = 0), y === void 0 && (y = 0), P === void 0 && (P = null);\n          var F = this._gl, z = P || new Pt.a(this, Pt.b.Cube);\n          z.isCube = !0, z.url = r, z.generateMipMaps = !n, z._lodGenerationScale = p, z._lodGenerationOffset = y, this._doNotHandleContextLost || (z._extension = s, z._files = e);\n          var J = r;\n          this._transformTextureUrl && !P && (r = this._transformTextureUrl(r));\n          for (var ie = r.lastIndexOf(\".\"), se = s || (ie > -1 ? r.substring(ie).toLowerCase() : \"\"), ce = null, ue = 0, fe = wt.a._TextureLoaders; ue < fe.length; ue++) {\n            var ve = fe[ue];\n            if (ve.canLoad(se)) {\n              ce = ve;\n              break;\n            }\n          }\n          if (ce) {\n            var Te = function(Re) {\n              B._bindTextureDirectly(F.TEXTURE_CUBE_MAP, z, !0), ce.loadCubeData(Re, z, d, i, o);\n            };\n            e && e.length === 6 ? ce.supportCascades ? this._cascadeLoadFiles(t, function(Re) {\n              return Te(Re.map(function(Ae) {\n                return new Uint8Array(Ae);\n              }));\n            }, e, o) : o ? o(\"Textures type does not support cascades.\") : l.a.Warn(\"Texture loader does not support cascades.\") : this._loadFile(r, function(Re) {\n              return Te(new Uint8Array(Re));\n            }, void 0, void 0, !0, function(Re, Ae) {\n              r === J ? o && Re && o(Re.status + \" \" + Re.statusText, Ae) : (l.a.Warn(\"Failed to load \" + r + \", falling back to the \" + J), B.createCubeTexture(J, t, e, n, i, o, a, s, d, p, y, z, R));\n            });\n          } else {\n            if (!e)\n              throw new Error(\"Cannot load cubemap because files were not defined\");\n            this._cascadeLoadImgs(t, function(Re) {\n              var Ae = B.needPOTTextures ? wt.a.GetExponentOfTwo(Re[0].width, B._caps.maxCubemapTextureSize) : Re[0].width, Ee = Ae, Se = [F.TEXTURE_CUBE_MAP_POSITIVE_X, F.TEXTURE_CUBE_MAP_POSITIVE_Y, F.TEXTURE_CUBE_MAP_POSITIVE_Z, F.TEXTURE_CUBE_MAP_NEGATIVE_X, F.TEXTURE_CUBE_MAP_NEGATIVE_Y, F.TEXTURE_CUBE_MAP_NEGATIVE_Z];\n              B._bindTextureDirectly(F.TEXTURE_CUBE_MAP, z, !0), B._unpackFlipY(!1);\n              for (var De = a ? B._getInternalFormat(a) : B._gl.RGBA, xe = 0; xe < Se.length; xe++)\n                if (Re[xe].width !== Ae || Re[xe].height !== Ee) {\n                  if (B._prepareWorkingCanvas(), !B._workingCanvas || !B._workingContext)\n                    return void l.a.Warn(\"Cannot create canvas to resize texture.\");\n                  B._workingCanvas.width = Ae, B._workingCanvas.height = Ee, B._workingContext.drawImage(Re[xe], 0, 0, Re[xe].width, Re[xe].height, 0, 0, Ae, Ee), F.texImage2D(Se[xe], 0, De, De, F.UNSIGNED_BYTE, B._workingCanvas);\n                } else\n                  F.texImage2D(Se[xe], 0, De, De, F.UNSIGNED_BYTE, Re[xe]);\n              n || F.generateMipmap(F.TEXTURE_CUBE_MAP), B._setCubeMapTextureParams(z, !n), z.width = Ae, z.height = Ee, z.isReady = !0, a && (z.format = a), z.onLoadedObservable.notifyObservers(z), z.onLoadedObservable.clear(), i && i();\n            }, e, o);\n          }\n          return this._internalTexturesCache.push(z), z;\n        }, f(153), f(124);\n        var Df = function() {\n        };\n        Ue.a.prototype.getInputElement = function() {\n          return this.inputElement || this.getRenderingCanvas();\n        }, Ue.a.prototype.registerView = function(r, t) {\n          var e = this;\n          this.views || (this.views = []);\n          for (var n = 0, i = this.views; n < i.length; n++) {\n            var o = i[n];\n            if (o.target === r)\n              return o;\n          }\n          var a = this.getRenderingCanvas();\n          a && (r.width = a.width, r.height = a.height);\n          var s = { target: r, camera: t };\n          return this.views.push(s), t && t.onDisposeObservable.add(function() {\n            e.unRegisterView(r);\n          }), s;\n        }, Ue.a.prototype.unRegisterView = function(r) {\n          if (!this.views)\n            return this;\n          for (var t = 0, e = this.views; t < e.length; t++) {\n            var n = e[t];\n            if (n.target === r) {\n              var i = this.views.indexOf(n);\n              i !== -1 && this.views.splice(i, 1);\n              break;\n            }\n          }\n          return this;\n        }, Ue.a.prototype._renderViews = function() {\n          if (!this.views)\n            return !1;\n          var r = this.getRenderingCanvas();\n          if (!r)\n            return !1;\n          for (var t = 0, e = this.views; t < e.length; t++) {\n            var n = e[t], i = n.target, o = i.getContext(\"2d\");\n            if (o) {\n              var a = n.camera, s = null, d = null;\n              if (a) {\n                if ((d = a.getScene()).activeCameras && d.activeCameras.length)\n                  continue;\n                this.activeView = n, s = d.activeCamera, d.activeCamera = a;\n              }\n              var p = i.width !== i.clientWidth || i.height !== i.clientHeight;\n              if (i.clientWidth && i.clientHeight && p && (i.width = i.clientWidth, i.height = i.clientHeight, r.width = i.clientWidth, r.height = i.clientHeight, this.resize()), !r.width || !r.height)\n                return !1;\n              this._renderFrame(), o.drawImage(r, 0, 0), s && d && (d.activeCamera = s);\n            }\n          }\n          return this.activeView = null, !0;\n        }, f(129);\n        function Lf(r) {\n          if (this._excludedCompressedTextures && this._excludedCompressedTextures.some(function(i) {\n            var o = \"\\\\b\" + i + \"\\\\b\";\n            return r && (r === i || r.match(new RegExp(o, \"g\")));\n          }))\n            return r;\n          var t = r.lastIndexOf(\".\"), e = r.lastIndexOf(\"?\"), n = e > -1 ? r.substring(e, r.length) : \"\";\n          return (t > -1 ? r.substring(0, t) : r) + this._textureFormatInUse + n;\n        }\n        Object.defineProperty(Ue.a.prototype, \"texturesSupported\", { get: function() {\n          var r = new Array();\n          return this._caps.astc && r.push(\"-astc.ktx\"), this._caps.s3tc && r.push(\"-dxt.ktx\"), this._caps.pvrtc && r.push(\"-pvrtc.ktx\"), this._caps.etc2 && r.push(\"-etc2.ktx\"), this._caps.etc1 && r.push(\"-etc1.ktx\"), r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Ue.a.prototype, \"textureFormatInUse\", { get: function() {\n          return this._textureFormatInUse || null;\n        }, enumerable: !0, configurable: !0 }), Ue.a.prototype.setCompressedTextureExclusions = function(r) {\n          this._excludedCompressedTextures = r;\n        }, Ue.a.prototype.setTextureFormatToUse = function(r) {\n          for (var t = this.texturesSupported, e = 0, n = t.length; e < n; e++)\n            for (var i = 0, o = r.length; i < o; i++)\n              if (t[e] === r[i].toLowerCase())\n                return this._transformTextureUrl = Lf.bind(this), this._textureFormatInUse = t[e];\n          return this._textureFormatInUse = \"\", this._transformTextureUrl = null, null;\n        };\n        var Nf = f(144), Gl = f(118), zl = f(89), li = [Math.sqrt(1 / (4 * Math.PI)), -Math.sqrt(3 / (4 * Math.PI)), Math.sqrt(3 / (4 * Math.PI)), -Math.sqrt(3 / (4 * Math.PI)), Math.sqrt(15 / (4 * Math.PI)), -Math.sqrt(15 / (4 * Math.PI)), Math.sqrt(5 / (16 * Math.PI)), -Math.sqrt(15 / (4 * Math.PI)), Math.sqrt(15 / (16 * Math.PI))], wf = [function(r) {\n          return 1;\n        }, function(r) {\n          return r.y;\n        }, function(r) {\n          return r.z;\n        }, function(r) {\n          return r.x;\n        }, function(r) {\n          return r.x * r.y;\n        }, function(r) {\n          return r.y * r.z;\n        }, function(r) {\n          return 3 * r.z * r.z - 1;\n        }, function(r) {\n          return r.x * r.z;\n        }, function(r) {\n          return r.x * r.x - r.y * r.y;\n        }], _i = function(r, t) {\n          return li[r] * wf[r](t);\n        }, mi = [Math.PI, 2 * Math.PI / 3, 2 * Math.PI / 3, 2 * Math.PI / 3, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4, Math.PI / 4], hs = function() {\n          function r() {\n            this.preScaled = !1, this.l00 = u.e.Zero(), this.l1_1 = u.e.Zero(), this.l10 = u.e.Zero(), this.l11 = u.e.Zero(), this.l2_2 = u.e.Zero(), this.l2_1 = u.e.Zero(), this.l20 = u.e.Zero(), this.l21 = u.e.Zero(), this.l22 = u.e.Zero();\n          }\n          return r.prototype.addLight = function(t, e, n) {\n            var i = new u.e(e.r, e.g, e.b).scale(n);\n            this.l00 = this.l00.add(i.scale(_i(0, t))), this.l1_1 = this.l1_1.add(i.scale(_i(1, t))), this.l10 = this.l10.add(i.scale(_i(2, t))), this.l11 = this.l11.add(i.scale(_i(3, t))), this.l2_2 = this.l2_2.add(i.scale(_i(4, t))), this.l2_1 = this.l2_1.add(i.scale(_i(5, t))), this.l20 = this.l20.add(i.scale(_i(6, t))), this.l21 = this.l21.add(i.scale(_i(7, t))), this.l22 = this.l22.add(i.scale(_i(8, t)));\n          }, r.prototype.scaleInPlace = function(t) {\n            this.l00.scaleInPlace(t), this.l1_1.scaleInPlace(t), this.l10.scaleInPlace(t), this.l11.scaleInPlace(t), this.l2_2.scaleInPlace(t), this.l2_1.scaleInPlace(t), this.l20.scaleInPlace(t), this.l21.scaleInPlace(t), this.l22.scaleInPlace(t);\n          }, r.prototype.convertIncidentRadianceToIrradiance = function() {\n            this.l00.scaleInPlace(mi[0]), this.l1_1.scaleInPlace(mi[1]), this.l10.scaleInPlace(mi[2]), this.l11.scaleInPlace(mi[3]), this.l2_2.scaleInPlace(mi[4]), this.l2_1.scaleInPlace(mi[5]), this.l20.scaleInPlace(mi[6]), this.l21.scaleInPlace(mi[7]), this.l22.scaleInPlace(mi[8]);\n          }, r.prototype.convertIrradianceToLambertianRadiance = function() {\n            this.scaleInPlace(1 / Math.PI);\n          }, r.prototype.preScaleForRendering = function() {\n            this.preScaled = !0, this.l00.scaleInPlace(li[0]), this.l1_1.scaleInPlace(li[1]), this.l10.scaleInPlace(li[2]), this.l11.scaleInPlace(li[3]), this.l2_2.scaleInPlace(li[4]), this.l2_1.scaleInPlace(li[5]), this.l20.scaleInPlace(li[6]), this.l21.scaleInPlace(li[7]), this.l22.scaleInPlace(li[8]);\n          }, r.FromArray = function(t) {\n            var e = new r();\n            return u.e.FromArrayToRef(t[0], 0, e.l00), u.e.FromArrayToRef(t[1], 0, e.l1_1), u.e.FromArrayToRef(t[2], 0, e.l10), u.e.FromArrayToRef(t[3], 0, e.l11), u.e.FromArrayToRef(t[4], 0, e.l2_2), u.e.FromArrayToRef(t[5], 0, e.l2_1), u.e.FromArrayToRef(t[6], 0, e.l20), u.e.FromArrayToRef(t[7], 0, e.l21), u.e.FromArrayToRef(t[8], 0, e.l22), e;\n          }, r.FromPolynomial = function(t) {\n            var e = new r();\n            return e.l00 = t.xx.scale(0.376127).add(t.yy.scale(0.376127)).add(t.zz.scale(0.376126)), e.l1_1 = t.y.scale(0.977204), e.l10 = t.z.scale(0.977204), e.l11 = t.x.scale(0.977204), e.l2_2 = t.xy.scale(1.16538), e.l2_1 = t.yz.scale(1.16538), e.l20 = t.zz.scale(1.34567).subtract(t.xx.scale(0.672834)).subtract(t.yy.scale(0.672834)), e.l21 = t.zx.scale(1.16538), e.l22 = t.xx.scale(1.16538).subtract(t.yy.scale(1.16538)), e.l1_1.scaleInPlace(-1), e.l11.scaleInPlace(-1), e.l2_1.scaleInPlace(-1), e.l21.scaleInPlace(-1), e.scaleInPlace(Math.PI), e;\n          }, r;\n        }(), Yr = function() {\n          function r() {\n            this.x = u.e.Zero(), this.y = u.e.Zero(), this.z = u.e.Zero(), this.xx = u.e.Zero(), this.yy = u.e.Zero(), this.zz = u.e.Zero(), this.xy = u.e.Zero(), this.yz = u.e.Zero(), this.zx = u.e.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"preScaledHarmonics\", { get: function() {\n            return this._harmonics || (this._harmonics = hs.FromPolynomial(this)), this._harmonics.preScaled || this._harmonics.preScaleForRendering(), this._harmonics;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addAmbient = function(t) {\n            var e = new u.e(t.r, t.g, t.b);\n            this.xx = this.xx.add(e), this.yy = this.yy.add(e), this.zz = this.zz.add(e);\n          }, r.prototype.scaleInPlace = function(t) {\n            this.x.scaleInPlace(t), this.y.scaleInPlace(t), this.z.scaleInPlace(t), this.xx.scaleInPlace(t), this.yy.scaleInPlace(t), this.zz.scaleInPlace(t), this.yz.scaleInPlace(t), this.zx.scaleInPlace(t), this.xy.scaleInPlace(t);\n          }, r.FromHarmonics = function(t) {\n            var e = new r();\n            return e._harmonics = t, e.x = t.l11.scale(1.02333).scale(-1), e.y = t.l1_1.scale(1.02333).scale(-1), e.z = t.l10.scale(1.02333), e.xx = t.l00.scale(0.886277).subtract(t.l20.scale(0.247708)).add(t.l22.scale(0.429043)), e.yy = t.l00.scale(0.886277).subtract(t.l20.scale(0.247708)).subtract(t.l22.scale(0.429043)), e.zz = t.l00.scale(0.886277).add(t.l20.scale(0.495417)), e.yz = t.l2_1.scale(0.858086).scale(-1), e.zx = t.l21.scale(0.858086).scale(-1), e.xy = t.l2_2.scale(0.858086), e.scaleInPlace(1 / Math.PI), e;\n          }, r.FromArray = function(t) {\n            var e = new r();\n            return u.e.FromArrayToRef(t[0], 0, e.x), u.e.FromArrayToRef(t[1], 0, e.y), u.e.FromArrayToRef(t[2], 0, e.z), u.e.FromArrayToRef(t[3], 0, e.xx), u.e.FromArrayToRef(t[4], 0, e.yy), u.e.FromArrayToRef(t[5], 0, e.zz), u.e.FromArrayToRef(t[6], 0, e.yz), u.e.FromArrayToRef(t[7], 0, e.zx), u.e.FromArrayToRef(t[8], 0, e.xy), e;\n          }, r;\n        }(), kn = f(52), dr = function(r, t, e, n) {\n          this.name = r, this.worldAxisForNormal = t, this.worldAxisForFileX = e, this.worldAxisForFileY = n;\n        }, Lo = function() {\n          function r() {\n          }\n          return r.ConvertCubeMapTextureToSphericalPolynomial = function(t) {\n            if (!t.isCube)\n              return null;\n            var e, n, i = t.getSize().width, o = t.readPixels(0), a = t.readPixels(1);\n            t.isRenderTarget ? (e = t.readPixels(3), n = t.readPixels(2)) : (e = t.readPixels(2), n = t.readPixels(3));\n            var s = t.readPixels(4), d = t.readPixels(5), p = t.gammaSpace, y = h.a.TEXTUREFORMAT_RGBA, P = h.a.TEXTURETYPE_UNSIGNED_INT;\n            t.textureType != h.a.TEXTURETYPE_FLOAT && t.textureType != h.a.TEXTURETYPE_HALF_FLOAT || (P = h.a.TEXTURETYPE_FLOAT);\n            var R = { size: i, right: o, left: a, up: e, down: n, front: s, back: d, format: y, type: P, gammaSpace: p };\n            return this.ConvertCubeMapToSphericalPolynomial(R);\n          }, r.ConvertCubeMapToSphericalPolynomial = function(t) {\n            for (var e = new hs(), n = 0, i = 2 / t.size, o = i, a = 0.5 * i - 1, s = 0; s < 6; s++)\n              for (var d = this.FileFaces[s], p = t[d.name], y = a, P = t.format === h.a.TEXTUREFORMAT_RGBA ? 4 : 3, R = 0; R < t.size; R++) {\n                for (var B = a, F = 0; F < t.size; F++) {\n                  var z = d.worldAxisForFileX.scale(B).add(d.worldAxisForFileY.scale(y)).add(d.worldAxisForNormal);\n                  z.normalize();\n                  var J = Math.pow(1 + B * B + y * y, -1.5), ie = p[R * t.size * P + F * P + 0], se = p[R * t.size * P + F * P + 1], ce = p[R * t.size * P + F * P + 2];\n                  isNaN(ie) && (ie = 0), isNaN(se) && (se = 0), isNaN(ce) && (ce = 0), t.type === h.a.TEXTURETYPE_UNSIGNED_INT && (ie /= 255, se /= 255, ce /= 255), t.gammaSpace && (ie = Math.pow($.a.Clamp(ie), Vt.c), se = Math.pow($.a.Clamp(se), Vt.c), ce = Math.pow($.a.Clamp(ce), Vt.c)), ie = $.a.Clamp(ie, 0, 4096), se = $.a.Clamp(se, 0, 4096), ce = $.a.Clamp(ce, 0, 4096);\n                  var ue = new I.a(ie, se, ce);\n                  e.addLight(z, ue, J), n += J, B += i;\n                }\n                y += o;\n              }\n            var fe = 6 * (4 * Math.PI) / 6 / n;\n            return e.scaleInPlace(fe), e.convertIncidentRadianceToIrradiance(), e.convertIrradianceToLambertianRadiance(), Yr.FromHarmonics(e);\n          }, r.FileFaces = [new dr(\"right\", new u.e(1, 0, 0), new u.e(0, 0, -1), new u.e(0, -1, 0)), new dr(\"left\", new u.e(-1, 0, 0), new u.e(0, 0, 1), new u.e(0, -1, 0)), new dr(\"up\", new u.e(0, 1, 0), new u.e(1, 0, 0), new u.e(0, 0, 1)), new dr(\"down\", new u.e(0, -1, 0), new u.e(1, 0, 0), new u.e(0, 0, -1)), new dr(\"front\", new u.e(0, 0, 1), new u.e(1, 0, 0), new u.e(0, -1, 0)), new dr(\"back\", new u.e(0, 0, -1), new u.e(-1, 0, 0), new u.e(0, -1, 0))], r;\n        }();\n        Object.defineProperty(kn.a.prototype, \"sphericalPolynomial\", { get: function() {\n          if (this._texture) {\n            if (this._texture._sphericalPolynomial)\n              return this._texture._sphericalPolynomial;\n            if (this._texture.isReady)\n              return this._texture._sphericalPolynomial = Lo.ConvertCubeMapTextureToSphericalPolynomial(this), this._texture._sphericalPolynomial;\n          }\n          return null;\n        }, set: function(r) {\n          this._texture && (this._texture._sphericalPolynomial = r);\n        }, enumerable: !0, configurable: !0 });\n        var Ff = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=toRGBD(texture2D(textureSampler,vUV).rgb);\n}`;\n        ze.a.ShadersStore.rgbdEncodePixelShader = Ff;\n        var Bf = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#include<helperFunctions>\nvoid main(void)\n{\ngl_FragColor=vec4(fromRGBD(texture2D(textureSampler,vUV)),1.0);\n}`;\n        ze.a.ShadersStore.rgbdDecodePixelShader = Bf;\n        var gi = function() {\n          function r() {\n          }\n          return r.GetEnvInfo = function(t) {\n            for (var e = new DataView(t.buffer, t.byteOffset, t.byteLength), n = 0, i = 0; i < r._MagicBytes.length; i++)\n              if (e.getUint8(n++) !== r._MagicBytes[i])\n                return l.a.Error(\"Not a babylon environment map\"), null;\n            for (var o = \"\", a = 0; a = e.getUint8(n++); )\n              o += String.fromCharCode(a);\n            var s = JSON.parse(o);\n            return s.specular && (s.specular.specularDataPosition = n, s.specular.lodGenerationScale = s.specular.lodGenerationScale || 0.8), s;\n          }, r.CreateEnvTextureAsync = function(t) {\n            var e = this, n = t.getInternalTexture();\n            if (!n)\n              return Promise.reject(\"The cube texture is invalid.\");\n            var i = n.getEngine();\n            if (i && i.premultipliedAlpha)\n              return Promise.reject(\"Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.\");\n            if (t.textureType === h.a.TEXTURETYPE_UNSIGNED_INT)\n              return Promise.reject(\"The cube texture should allow HDR (Full Float or Half Float).\");\n            var o = i.getRenderingCanvas();\n            if (!o)\n              return Promise.reject(\"Env texture can only be created when the engine is associated to a canvas.\");\n            var a = h.a.TEXTURETYPE_FLOAT;\n            if (!i.getCaps().textureFloatRender && (a = h.a.TEXTURETYPE_HALF_FLOAT, !i.getCaps().textureHalfFloatRender))\n              return Promise.reject(\"Env texture can only be created when the browser supports half float or full float rendering.\");\n            var s = n.width, d = new _e.a(i), p = {}, y = [], P = $.a.Log2(n.width);\n            P = Math.round(P);\n            for (var R = function(F) {\n              for (var z = Math.pow(2, P - F), J = function(se) {\n                var ce = t.readPixels(se, F), ue = i.createRawTexture(ce, z, z, h.a.TEXTUREFORMAT_RGBA, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, null, a), fe = new Promise(function(ve, Te) {\n                  var Re = new ft(\"rgbdEncode\", \"rgbdEncode\", null, null, 1, null, h.a.TEXTURE_NEAREST_SAMPLINGMODE, i, !1, void 0, h.a.TEXTURETYPE_UNSIGNED_INT, void 0, null, !1);\n                  Re.getEffect().executeWhenCompiled(function() {\n                    Re.onApply = function(Se) {\n                      Se._bindTexture(\"textureSampler\", ue);\n                    };\n                    var Ae = i.getRenderWidth(), Ee = i.getRenderHeight();\n                    i.setSize(z, z), d.postProcessManager.directRender([Re], null), Xe.b.ToBlob(o, function(Se) {\n                      var De = new FileReader();\n                      De.onload = function(xe) {\n                        var Le = xe.target.result;\n                        p[6 * F + se] = Le, ve();\n                      }, De.readAsArrayBuffer(Se);\n                    }), i.setSize(Ae, Ee);\n                  });\n                });\n                y.push(fe);\n              }, ie = 0; ie < 6; ie++)\n                J(ie);\n            }, B = 0; B <= P; B++)\n              R(B);\n            return Promise.all(y).then(function() {\n              d.dispose();\n              for (var F = { version: 1, width: s, irradiance: e._CreateEnvTextureIrradiance(t), specular: { mipmaps: [], lodGenerationScale: t.lodGenerationScale } }, z = 0, J = 0; J <= P; J++)\n                for (var ie = 0; ie < 6; ie++) {\n                  var se = p[6 * J + ie].byteLength;\n                  F.specular.mipmaps.push({ length: se, position: z }), z += se;\n                }\n              for (var ce = JSON.stringify(F), ue = new ArrayBuffer(ce.length + 1), fe = new Uint8Array(ue), ve = (J = 0, ce.length); J < ve; J++)\n                fe[J] = ce.charCodeAt(J);\n              fe[ce.length] = 0;\n              var Te = r._MagicBytes.length + z + ue.byteLength, Re = new ArrayBuffer(Te), Ae = new Uint8Array(Re), Ee = new DataView(Re), Se = 0;\n              for (J = 0; J < r._MagicBytes.length; J++)\n                Ee.setUint8(Se++, r._MagicBytes[J]);\n              for (Ae.set(new Uint8Array(ue), Se), Se += ue.byteLength, J = 0; J <= P; J++)\n                for (ie = 0; ie < 6; ie++) {\n                  var De = p[6 * J + ie];\n                  Ae.set(new Uint8Array(De), Se), Se += De.byteLength;\n                }\n              return Re;\n            });\n          }, r._CreateEnvTextureIrradiance = function(t) {\n            var e = t.sphericalPolynomial;\n            return e == null ? null : { x: [e.x.x, e.x.y, e.x.z], y: [e.y.x, e.y.y, e.y.z], z: [e.z.x, e.z.y, e.z.z], xx: [e.xx.x, e.xx.y, e.xx.z], yy: [e.yy.x, e.yy.y, e.yy.z], zz: [e.zz.x, e.zz.y, e.zz.z], yz: [e.yz.x, e.yz.y, e.yz.z], zx: [e.zx.x, e.zx.y, e.zx.z], xy: [e.xy.x, e.xy.y, e.xy.z] };\n          }, r.CreateImageDataArrayBufferViews = function(t, e) {\n            if (e.version !== 1)\n              throw new Error('Unsupported babylon environment map version \"' + e.version + '\"');\n            var n = e.specular, i = $.a.Log2(e.width);\n            if (i = Math.round(i) + 1, n.mipmaps.length !== 6 * i)\n              throw new Error('Unsupported specular mipmaps number \"' + n.mipmaps.length + '\"');\n            for (var o = new Array(i), a = 0; a < i; a++) {\n              o[a] = new Array(6);\n              for (var s = 0; s < 6; s++) {\n                var d = n.mipmaps[6 * a + s];\n                o[a][s] = new Uint8Array(t.buffer, t.byteOffset + n.specularDataPosition + d.position, d.length);\n              }\n            }\n            return o;\n          }, r.UploadEnvLevelsAsync = function(t, e, n) {\n            if (n.version !== 1)\n              throw new Error('Unsupported babylon environment map version \"' + n.version + '\"');\n            var i = n.specular;\n            if (!i)\n              return Promise.resolve();\n            t._lodGenerationScale = i.lodGenerationScale;\n            var o = r.CreateImageDataArrayBufferViews(e, n);\n            return r.UploadLevelsAsync(t, o);\n          }, r._OnImageReadyAsync = function(t, e, n, i, o, a, s, d, p, y, P) {\n            return new Promise(function(R, B) {\n              if (n) {\n                var F = e.createTexture(null, !0, !0, null, h.a.TEXTURE_NEAREST_SAMPLINGMODE, null, function(J) {\n                  B(J);\n                }, t);\n                i.getEffect().executeWhenCompiled(function() {\n                  i.onApply = function(J) {\n                    J._bindTexture(\"textureSampler\", F), J.setFloat2(\"scale\", 1, 1);\n                  }, e.scenes[0].postProcessManager.directRender([i], y, !0, a, s), e.restoreDefaultFramebuffer(), F.dispose(), URL.revokeObjectURL(o), R();\n                });\n              } else {\n                if (e._uploadImageToTexture(P, t, a, s), d) {\n                  var z = p[s];\n                  z && e._uploadImageToTexture(z._texture, t, a, 0);\n                }\n                R();\n              }\n            });\n          }, r.UploadLevelsAsync = function(t, e) {\n            var n = this;\n            if (!Xe.b.IsExponentOfTwo(t.width))\n              throw new Error(\"Texture size must be a power of two\");\n            var i = Math.round($.a.Log2(t.width)) + 1, o = t.getEngine(), a = !1, s = !1, d = null, p = null, y = null, P = o.getCaps();\n            if (t.format = h.a.TEXTUREFORMAT_RGBA, t.type = h.a.TEXTURETYPE_UNSIGNED_INT, t.generateMipMaps = !0, t._cachedAnisotropicFilteringLevel = null, o.updateTextureSamplingMode(h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, t), P.textureLOD ? o.webGLVersion < 2 ? a = !1 : P.textureHalfFloatRender && P.textureHalfFloatLinearFiltering ? (a = !0, t.type = h.a.TEXTURETYPE_HALF_FLOAT) : P.textureFloatRender && P.textureFloatLinearFiltering && (a = !0, t.type = h.a.TEXTURETYPE_FLOAT) : (a = !1, s = !0, y = {}), a)\n              d = new ft(\"rgbdDecode\", \"rgbdDecode\", null, null, 1, null, h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, o, !1, void 0, t.type, void 0, null, !1), t._isRGBD = !1, t.invertY = !1, p = o.createRenderTargetCubeTexture(t.width, { generateDepthBuffer: !1, generateMipMaps: !0, generateStencilBuffer: !1, samplingMode: h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, type: t.type, format: h.a.TEXTUREFORMAT_RGBA });\n            else if (t._isRGBD = !0, t.invertY = !0, s)\n              for (var R = t._lodGenerationScale, B = t._lodGenerationOffset, F = 0; F < 3; F++) {\n                var z = (i - 1) * R + B, J = B + (z - B) * (1 - F / 2), ie = Math.round(Math.min(Math.max(J, 0), z)), se = new Pt.a(o, Pt.b.Temp);\n                se.isCube = !0, se.invertY = !0, se.generateMipMaps = !1, o.updateTextureSamplingMode(h.a.TEXTURE_LINEAR_LINEAR, se);\n                var ce = new kn.a(null);\n                switch (ce.isCube = !0, ce._texture = se, y[ie] = ce, F) {\n                  case 0:\n                    t._lodTextureLow = ce;\n                    break;\n                  case 1:\n                    t._lodTextureMid = ce;\n                    break;\n                  case 2:\n                    t._lodTextureHigh = ce;\n                }\n              }\n            var ue = [], fe = function(Ee) {\n              for (var Se = function(xe) {\n                var Le = e[Ee][xe], Me = new Blob([Le], { type: \"image/png\" }), we = URL.createObjectURL(Me), Ye = void 0;\n                if (typeof Image > \"u\")\n                  Ye = createImageBitmap(Me).then(function(nt) {\n                    return n._OnImageReadyAsync(nt, o, a, d, we, xe, Ee, s, y, p, t);\n                  });\n                else {\n                  var et = new Image();\n                  et.src = we, Ye = new Promise(function(nt, ct) {\n                    et.onload = function() {\n                      n._OnImageReadyAsync(et, o, a, d, we, xe, Ee, s, y, p, t).then(function() {\n                        return nt();\n                      }).catch(function(Ke) {\n                        ct(Ke);\n                      });\n                    }, et.onerror = function(Ke) {\n                      ct(Ke);\n                    };\n                  });\n                }\n                ue.push(Ye);\n              }, De = 0; De < 6; De++)\n                Se(De);\n            };\n            for (F = 0; F < e.length; F++)\n              fe(F);\n            if (e.length < i) {\n              var ve = void 0, Te = Math.pow(2, i - 1 - e.length), Re = Te * Te * 4;\n              switch (t.type) {\n                case h.a.TEXTURETYPE_UNSIGNED_INT:\n                  ve = new Uint8Array(Re);\n                  break;\n                case h.a.TEXTURETYPE_HALF_FLOAT:\n                  ve = new Uint16Array(Re);\n                  break;\n                case h.a.TEXTURETYPE_FLOAT:\n                  ve = new Float32Array(Re);\n              }\n              for (F = e.length; F < i; F++)\n                for (var Ae = 0; Ae < 6; Ae++)\n                  o._uploadArrayBufferViewToTexture(t, ve, Ae, F);\n            }\n            return Promise.all(ue).then(function() {\n              p && (o._releaseFramebufferObjects(p), o._releaseTexture(t), p._swapAndDie(t)), d && d.dispose(), s && (t._lodTextureHigh && t._lodTextureHigh._texture && (t._lodTextureHigh._texture.isReady = !0), t._lodTextureMid && t._lodTextureMid._texture && (t._lodTextureMid._texture.isReady = !0), t._lodTextureLow && t._lodTextureLow._texture && (t._lodTextureLow._texture.isReady = !0));\n            });\n          }, r.UploadEnvSpherical = function(t, e) {\n            e.version !== 1 && l.a.Warn('Unsupported babylon environment map version \"' + e.version + '\"');\n            var n = e.irradiance;\n            if (n) {\n              var i = new Yr();\n              u.e.FromArrayToRef(n.x, 0, i.x), u.e.FromArrayToRef(n.y, 0, i.y), u.e.FromArrayToRef(n.z, 0, i.z), u.e.FromArrayToRef(n.xx, 0, i.xx), u.e.FromArrayToRef(n.yy, 0, i.yy), u.e.FromArrayToRef(n.zz, 0, i.zz), u.e.FromArrayToRef(n.yz, 0, i.yz), u.e.FromArrayToRef(n.zx, 0, i.zx), u.e.FromArrayToRef(n.xy, 0, i.xy), t._sphericalPolynomial = i;\n            }\n          }, r._UpdateRGBDAsync = function(t, e, n, i, o) {\n            return t._source = Pt.b.CubeRawRGBD, t._bufferViewArrayArray = e, t._lodGenerationScale = i, t._lodGenerationOffset = o, t._sphericalPolynomial = n, r.UploadLevelsAsync(t, e).then(function() {\n              t.isReady = !0;\n            });\n          }, r._MagicBytes = [134, 22, 135, 150, 246, 214, 150, 54], r;\n        }();\n        Pt.a._UpdateRGBDAsync = gi._UpdateRGBDAsync;\n        var vi, ds = function() {\n          function r(t, e) {\n            e === void 0 && (e = 20), this.debug = !1, this._sourceCode = t, this._numMaxIterations = e, this._functionDescr = [], this.inlineToken = \"#define inline\";\n          }\n          return Object.defineProperty(r.prototype, \"code\", { get: function() {\n            return this._sourceCode;\n          }, enumerable: !1, configurable: !0 }), r.prototype.processCode = function() {\n            this.debug && console.log(\"Start inlining process (code size=\" + this._sourceCode.length + \")...\"), this._collectFunctions(), this._processInlining(this._numMaxIterations), this.debug && console.log(\"End of inlining process.\");\n          }, r.prototype._collectFunctions = function() {\n            for (var t = 0; t < this._sourceCode.length; ) {\n              var e = this._sourceCode.indexOf(this.inlineToken, t);\n              if (e < 0)\n                break;\n              var n = this._sourceCode.indexOf(\"(\", e + this.inlineToken.length);\n              if (n < 0)\n                this.debug && console.warn(\"Could not find the opening parenthesis after the token. startIndex=\" + t), t = e + this.inlineToken.length;\n              else {\n                var i = r._RegexpFindFunctionNameAndType.exec(this._sourceCode.substring(e + this.inlineToken.length, n));\n                if (i) {\n                  var o = [i[3], i[4]], a = o[0], s = o[1], d = this._extractBetweenMarkers(\"(\", \")\", this._sourceCode, n);\n                  if (d < 0)\n                    this.debug && console.warn(\"Could not extract the parameters the function '\" + s + \"' (type=\" + a + \"). funcParamsStartIndex=\" + n), t = e + this.inlineToken.length;\n                  else {\n                    var p = this._sourceCode.substring(n + 1, d), y = this._skipWhitespaces(this._sourceCode, d + 1);\n                    if (y !== this._sourceCode.length) {\n                      var P = this._extractBetweenMarkers(\"{\", \"}\", this._sourceCode, y);\n                      if (P < 0)\n                        this.debug && console.warn(\"Could not extract the body of the function '\" + s + \"' (type=\" + a + \"). funcBodyStartIndex=\" + y), t = e + this.inlineToken.length;\n                      else {\n                        for (var R = this._sourceCode.substring(y, P + 1), B = this._removeComments(p).split(\",\"), F = [], z = 0; z < B.length; ++z) {\n                          var J = B[z].trim(), ie = J.lastIndexOf(\" \");\n                          ie >= 0 && F.push(J.substring(ie + 1));\n                        }\n                        a !== \"void\" && F.push(\"return\"), this._functionDescr.push({ name: s, type: a, parameters: F, body: R, callIndex: 0 }), t = P + 1;\n                        var se = e > 0 ? this._sourceCode.substring(0, e) : \"\", ce = P + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(P + 1) : \"\";\n                        this._sourceCode = se + ce, t -= P + 1 - e;\n                      }\n                    } else\n                      this.debug && console.warn(\"Could not extract the body of the function '\" + s + \"' (type=\" + a + \"). funcParamsEndIndex=\" + d), t = e + this.inlineToken.length;\n                  }\n                } else\n                  this.debug && console.warn(\"Could not extract the name/type of the function from: \" + this._sourceCode.substring(e + this.inlineToken.length, n)), t = e + this.inlineToken.length;\n              }\n            }\n            this.debug && console.log(\"Collect functions: \" + this._functionDescr.length + \" functions found. functionDescr=\", this._functionDescr);\n          }, r.prototype._processInlining = function(t) {\n            for (t === void 0 && (t = 20); t-- >= 0 && this._replaceFunctionCallsByCode(); )\n              ;\n            return this.debug && console.log(\"numMaxIterations is \" + t + \" after inlining process\"), t >= 0;\n          }, r.prototype._extractBetweenMarkers = function(t, e, n, i) {\n            for (var o = i, a = 0, s = \"\"; o < n.length; ) {\n              var d = n.charAt(o);\n              if (s)\n                d === s ? s === '\"' || s === \"'\" ? n.charAt(o - 1) !== \"\\\\\" && (s = \"\") : s = \"\" : s === \"*/\" && d === \"*\" && o + 1 < n.length && (n.charAt(o + 1) === \"/\" && (s = \"\"), s === \"\" && o++);\n              else\n                switch (d) {\n                  case t:\n                    a++;\n                    break;\n                  case e:\n                    a--;\n                    break;\n                  case '\"':\n                  case \"'\":\n                  case \"`\":\n                    s = d;\n                    break;\n                  case \"/\":\n                    if (o + 1 < n.length) {\n                      var p = n.charAt(o + 1);\n                      p === \"/\" ? s = `\n` : p === \"*\" && (s = \"*/\");\n                    }\n                }\n              if (o++, a === 0)\n                break;\n            }\n            return a === 0 ? o - 1 : -1;\n          }, r.prototype._skipWhitespaces = function(t, e) {\n            for (; e < t.length; ) {\n              var n = t[e];\n              if (n !== \" \" && n !== `\n` && n !== \"\\r\" && n !== \"\t\" && n !== `\n` && n !== \" \")\n                break;\n              e++;\n            }\n            return e;\n          }, r.prototype._removeComments = function(t) {\n            for (var e = 0, n = \"\", i = !1, o = []; e < t.length; ) {\n              var a = t.charAt(e);\n              if (n)\n                a === n ? n === '\"' || n === \"'\" ? (t.charAt(e - 1) !== \"\\\\\" && (n = \"\"), o.push(a)) : (n = \"\", i = !1) : n === \"*/\" && a === \"*\" && e + 1 < t.length ? (t.charAt(e + 1) === \"/\" && (n = \"\"), n === \"\" && (i = !1, e++)) : i || o.push(a);\n              else {\n                switch (a) {\n                  case '\"':\n                  case \"'\":\n                  case \"`\":\n                    n = a;\n                    break;\n                  case \"/\":\n                    if (e + 1 < t.length) {\n                      var s = t.charAt(e + 1);\n                      s === \"/\" ? (n = `\n`, i = !0) : s === \"*\" && (n = \"*/\", i = !0);\n                    }\n                }\n                i || o.push(a);\n              }\n              e++;\n            }\n            return o.join(\"\");\n          }, r.prototype._replaceFunctionCallsByCode = function() {\n            for (var t = !1, e = 0, n = this._functionDescr; e < n.length; e++)\n              for (var i = n[e], o = i.name, a = i.type, s = i.parameters, d = i.body, p = 0; p < this._sourceCode.length; ) {\n                var y = this._sourceCode.indexOf(o, p);\n                if (y < 0)\n                  break;\n                var P = this._skipWhitespaces(this._sourceCode, y + o.length);\n                if (P !== this._sourceCode.length && this._sourceCode.charAt(P) === \"(\") {\n                  var R = this._extractBetweenMarkers(\"(\", \")\", this._sourceCode, P);\n                  if (R < 0)\n                    this.debug && console.warn(\"Could not extract the parameters of the function call. Function '\" + o + \"' (type=\" + a + \"). callParamsStartIndex=\" + P), p = y + o.length;\n                  else {\n                    for (var B = this._sourceCode.substring(P + 1, R), F = this._removeComments(B).split(\",\"), z = [], J = 0; J < F.length; ++J) {\n                      var ie = F[J].trim();\n                      z.push(ie);\n                    }\n                    var se = a !== \"void\" ? o + \"_\" + i.callIndex++ : null;\n                    if (se && z.push(se + \" =\"), z.length === s.length) {\n                      p = R + 1;\n                      var ce = this._replaceNames(d, s, z), ue = y > 0 ? this._sourceCode.substring(0, y) : \"\", fe = R + 1 < this._sourceCode.length - 1 ? this._sourceCode.substring(R + 1) : \"\";\n                      if (se) {\n                        var ve = this._findBackward(this._sourceCode, y - 1, `\n`);\n                        ue = this._sourceCode.substring(0, ve + 1);\n                        var Te = this._sourceCode.substring(ve + 1, y);\n                        this._sourceCode = ue + a + \" \" + se + `;\n` + ce + `\n` + Te + se + fe, this.debug && console.log(\"Replace function call by code. Function '\" + o + \"' (type=\" + a + \"). injectDeclarationIndex=\" + ve);\n                      } else\n                        this._sourceCode = ue + ce + fe, p += ce.length - (R + 1 - y), this.debug && console.log(\"Replace function call by code. Function '\" + o + \"' (type=\" + a + \"). functionCallIndex=\" + y);\n                      t = !0;\n                    } else\n                      this.debug && console.warn(\"Invalid function call: not the same number of parameters for the call than the number expected by the function. Function '\" + o + \"' (type=\" + a + \"). function parameters=\" + s + \", call parameters=\" + z), p = y + o.length;\n                  }\n                } else\n                  p = y + o.length;\n              }\n            return t;\n          }, r.prototype._findBackward = function(t, e, n) {\n            for (; e >= 0 && t.charAt(e) !== n; )\n              e--;\n            return e;\n          }, r.prototype._escapeRegExp = function(t) {\n            return t.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n          }, r.prototype._replaceNames = function(t, e, n) {\n            for (var i = 0; i < e.length; ++i) {\n              var o = new RegExp(this._escapeRegExp(e[i]), \"g\"), a = n[i];\n              t = t.replace(o, a);\n            }\n            return t;\n          }, r._RegexpFindFunctionNameAndType = /((\\s+?)(\\w+)\\s+(\\w+)\\s*?)$/, r;\n        }(), Uf = function() {\n          function r() {\n            this.isAsync = !1, this.isReady = !1;\n          }\n          return r.prototype._getVertexShaderCode = function() {\n            return null;\n          }, r.prototype._getFragmentShaderCode = function() {\n            return null;\n          }, r.prototype._handlesSpectorRebuildCallback = function(t) {\n            throw new Error(\"Not implemented\");\n          }, r;\n        }(), jl = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t;\n        }(zl.a), Hl = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getInternalTexture = function() {\n            return this;\n          }, t.prototype.getViewCount = function() {\n            return 1;\n          }, t;\n        }(Pt.a), Vf = function(r) {\n          function t() {\n            var e = r.call(this, null) || this;\n            return e._native = new _native.Engine(), e.INVALID_HANDLE = 65535, e._boundBuffersVertexArray = null, e._currentDepthTest = e._native.DEPTH_TEST_LEQUAL, e._webGLVersion = 2, e.disableUniformBuffers = !0, e._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: 512, maxCubemapTextureSize: 512, maxRenderTextureSize: 512, maxVertexAttribs: 16, maxVaryingVectors: 16, maxFragmentUniformVectors: 16, maxVertexUniformVectors: 16, standardDerivatives: !0, astc: null, pvrtc: null, etc1: null, etc2: null, bptc: null, maxAnisotropy: 16, uintIndices: !0, fragmentDepthSupported: !1, highPrecisionShaderSupported: !0, colorBufferFloat: !1, textureFloat: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloat: !1, textureHalfFloatLinearFiltering: !1, textureHalfFloatRender: !1, textureLOD: !0, drawBuffersExtension: !1, depthTextureExtension: !1, vertexArrayObject: !0, instancedArrays: !1, canUseTimestampForTimerQuery: !1, blendMinMax: !1, maxMSAASamples: 1 }, Xe.b.Log(\"Babylon Native (v\" + Ue.a.Version + \") launched\"), Xe.b.LoadScript = function(n, i, o, a) {\n              Xe.b.LoadFile(n, function(s) {\n                Function(s).apply(null), i && i();\n              }, void 0, void 0, !1, function(s, d) {\n                o && o(\"LoadScript Error\", d);\n              });\n            }, typeof URL > \"u\" && (window.URL = { createObjectURL: function() {\n            }, revokeObjectURL: function() {\n            } }), typeof Blob > \"u\" && (window.Blob = function() {\n            }), e._shaderProcessor = new Gl.a(), e;\n          }\n          return Object(c.d)(t, r), t.prototype.getHardwareScalingLevel = function() {\n            return 1;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._boundBuffersVertexArray && this._native.deleteVertexArray(this._boundBuffersVertexArray), this._native.dispose();\n          }, t.prototype._queueNewFrame = function(e, n) {\n            return n.requestAnimationFrame && n !== window ? n.requestAnimationFrame(e) : this._native.requestAnimationFrame(e), 0;\n          }, t.prototype._bindUnboundFramebuffer = function(e) {\n            this._currentFramebuffer !== e && (this._currentFramebuffer && this._native.unbindFramebuffer(this._currentFramebuffer), e && this._native.bindFramebuffer(e), this._currentFramebuffer = e);\n          }, t.prototype.getHostDocument = function() {\n            return null;\n          }, t.prototype.clear = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = 0;\n            n && e && (this._native.clearColor(e.r, e.g, e.b, e.a !== void 0 ? e.a : 1), a |= this._native.CLEAR_FLAG_COLOR), i && (this._native.clearDepth(1), a |= this._native.CLEAR_FLAG_DEPTH), o && (this._native.clearStencil(0), a |= this._native.CLEAR_FLAG_STENCIL), this._native.clear(a);\n          }, t.prototype.createIndexBuffer = function(e, n) {\n            var i = this._normalizeIndexData(e), o = new jl();\n            if (o.references = 1, o.is32Bits = i.BYTES_PER_ELEMENT === 4, i.length) {\n              if (o.nativeIndexBuffer = this._native.createIndexBuffer(i, n != null && n), o.nativeVertexBuffer === this.INVALID_HANDLE)\n                throw new Error(\"Could not create a native index buffer.\");\n            } else\n              o.nativeVertexBuffer = this.INVALID_HANDLE;\n            return o;\n          }, t.prototype.createVertexBuffer = function(e, n) {\n            var i = new jl();\n            if (i.references = 1, i.nativeVertexBuffer = this._native.createVertexBuffer(ArrayBuffer.isView(e) ? e : new Float32Array(e), n != null && n), i.nativeVertexBuffer === this.INVALID_HANDLE)\n              throw new Error(\"Could not create a native vertex buffer.\");\n            return i;\n          }, t.prototype._recordVertexArrayObject = function(e, n, i, o) {\n            i && this._native.recordIndexBuffer(e, i.nativeIndexBuffer);\n            for (var a = o.getAttributesNames(), s = 0; s < a.length; s++) {\n              var d = o.getAttributeLocation(s);\n              if (d >= 0) {\n                var p = n[a[s]];\n                if (p) {\n                  var y = p.getBuffer();\n                  y && this._native.recordVertexBuffer(e, y.nativeVertexBuffer, d, p.byteOffset, p.byteStride, p.getSize(), this._getNativeAttribType(p.type), p.normalized);\n                }\n              }\n            }\n          }, t.prototype.bindBuffers = function(e, n, i) {\n            this._boundBuffersVertexArray && this._native.deleteVertexArray(this._boundBuffersVertexArray), this._boundBuffersVertexArray = this._native.createVertexArray(), this._recordVertexArrayObject(this._boundBuffersVertexArray, e, n, i), this._native.bindVertexArray(this._boundBuffersVertexArray);\n          }, t.prototype.recordVertexArrayObject = function(e, n, i) {\n            var o = this._native.createVertexArray();\n            return this._recordVertexArrayObject(o, e, n, i), o;\n          }, t.prototype.bindVertexArrayObject = function(e) {\n            this._native.bindVertexArray(e);\n          }, t.prototype.releaseVertexArrayObject = function(e) {\n            this._native.deleteVertexArray(e);\n          }, t.prototype.getAttributes = function(e, n) {\n            var i = e;\n            return this._native.getAttributes(i.nativeProgram, n);\n          }, t.prototype.drawElementsType = function(e, n, i, o) {\n            this._drawCalls.addCount(1, !1), this._native.drawIndexed(e, n, i);\n          }, t.prototype.drawArraysType = function(e, n, i, o) {\n            this._drawCalls.addCount(1, !1), this._native.draw(e, n, i);\n          }, t.prototype.createPipelineContext = function() {\n            return new Uf();\n          }, t.prototype._preparePipelineContext = function(e, n, i, o, a, s, d) {\n            var p = e;\n            p.nativeProgram = o ? this.createRawShaderProgram(e, n, i, void 0, d) : this.createShaderProgram(e, n, i, s, void 0, d);\n          }, t.prototype._isRenderingStateCompiled = function(e) {\n            return !0;\n          }, t.prototype._executeWhenRenderingStateIsCompiled = function(e, n) {\n            n();\n          }, t.prototype.createRawShaderProgram = function(e, n, i, o, a) {\n            throw new Error(\"Not Supported\");\n          }, t.prototype.createShaderProgram = function(e, n, i, o, a, s) {\n            this.onBeforeShaderCompilationObservable.notifyObservers(this);\n            var d = new ds(n);\n            d.processCode(), n = d.code;\n            var p = new ds(i);\n            p.processCode(), i = p.code, n = wt.a._ConcatenateShader(n, o), i = wt.a._ConcatenateShader(i, o);\n            var y = this._native.createProgram(n, i);\n            return this.onAfterShaderCompilationObservable.notifyObservers(this), y;\n          }, t.prototype._setProgram = function(e) {\n            this._currentProgram !== e && (this._native.setProgram(e), this._currentProgram = e);\n          }, t.prototype._releaseEffect = function(e) {\n          }, t.prototype._deletePipelineContext = function(e) {\n          }, t.prototype.getUniforms = function(e, n) {\n            var i = e;\n            return this._native.getUniforms(i.nativeProgram, n);\n          }, t.prototype.bindUniformBlock = function(e, n, i) {\n            throw new Error(\"Not Implemented\");\n          }, t.prototype.bindSamplers = function(e) {\n            var n = e.getPipelineContext();\n            this._setProgram(n.nativeProgram);\n            for (var i = e.getSamplers(), o = 0; o < i.length; o++) {\n              var a = e.getUniform(i[o]);\n              a && (this._boundUniforms[o] = a);\n            }\n            this._currentEffect = null;\n          }, t.prototype.setMatrix = function(e, n) {\n            e && this._native.setMatrix(e, n.toArray());\n          }, t.prototype.getRenderWidth = function(e) {\n            return e === void 0 && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.width : this._native.getRenderWidth();\n          }, t.prototype.getRenderHeight = function(e) {\n            return e === void 0 && (e = !1), !e && this._currentRenderTarget ? this._currentRenderTarget.height : this._native.getRenderHeight();\n          }, t.prototype.setViewport = function(e, n, i) {\n            this._cachedViewport = e, this._native.setViewPort(e.x, e.y, e.width, e.height);\n          }, t.prototype.setState = function(e, n, i, o) {\n            n === void 0 && (n = 0), o === void 0 && (o = !1), this._native.setState(e, n, o);\n          }, t.prototype.setZOffset = function(e) {\n            this._native.setZOffset(e);\n          }, t.prototype.getZOffset = function() {\n            return this._native.getZOffset();\n          }, t.prototype.setDepthBuffer = function(e) {\n            this._native.setDepthTest(e ? this._currentDepthTest : this._native.DEPTH_TEST_ALWAYS);\n          }, t.prototype.getDepthWrite = function() {\n            return this._native.getDepthWrite();\n          }, t.prototype.setDepthFunctionToGreater = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_GREATER, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthFunctionToGreaterOrEqual = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_GEQUAL, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthFunctionToLess = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_LESS, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthFunctionToLessOrEqual = function() {\n            this._currentDepthTest = this._native.DEPTH_TEST_LEQUAL, this._native.setDepthTest(this._currentDepthTest);\n          }, t.prototype.setDepthWrite = function(e) {\n            this._native.setDepthWrite(e);\n          }, t.prototype.setColorWrite = function(e) {\n            this._native.setColorWrite(e), this._colorWrite = e;\n          }, t.prototype.getColorWrite = function() {\n            return this._colorWrite;\n          }, t.prototype.setAlphaConstants = function(e, n, i, o) {\n            throw new Error(\"Setting alpha blend constant color not yet implemented.\");\n          }, t.prototype.setAlphaMode = function(e, n) {\n            n === void 0 && (n = !1), this._alphaMode !== e && (e = this._getNativeAlphaMode(e), this._native.setBlendMode(e), n || this.setDepthWrite(e === h.a.ALPHA_DISABLE), this._alphaMode = e);\n          }, t.prototype.getAlphaMode = function() {\n            return this._alphaMode;\n          }, t.prototype.setInt = function(e, n) {\n            return !!e && (this._native.setInt(e, n), !0);\n          }, t.prototype.setIntArray = function(e, n) {\n            return !!e && (this._native.setIntArray(e, n), !0);\n          }, t.prototype.setIntArray2 = function(e, n) {\n            return !!e && (this._native.setIntArray2(e, n), !0);\n          }, t.prototype.setIntArray3 = function(e, n) {\n            return !!e && (this._native.setIntArray3(e, n), !0);\n          }, t.prototype.setIntArray4 = function(e, n) {\n            return !!e && (this._native.setIntArray4(e, n), !0);\n          }, t.prototype.setFloatArray = function(e, n) {\n            return !!e && (this._native.setFloatArray(e, n), !0);\n          }, t.prototype.setFloatArray2 = function(e, n) {\n            return !!e && (this._native.setFloatArray2(e, n), !0);\n          }, t.prototype.setFloatArray3 = function(e, n) {\n            return !!e && (this._native.setFloatArray3(e, n), !0);\n          }, t.prototype.setFloatArray4 = function(e, n) {\n            return !!e && (this._native.setFloatArray4(e, n), !0);\n          }, t.prototype.setArray = function(e, n) {\n            return !!e && (this._native.setFloatArray(e, n), !0);\n          }, t.prototype.setArray2 = function(e, n) {\n            return !!e && (this._native.setFloatArray2(e, n), !0);\n          }, t.prototype.setArray3 = function(e, n) {\n            return !!e && (this._native.setFloatArray3(e, n), !0);\n          }, t.prototype.setArray4 = function(e, n) {\n            return !!e && (this._native.setFloatArray4(e, n), !0);\n          }, t.prototype.setMatrices = function(e, n) {\n            return !!e && (this._native.setMatrices(e, n), !0);\n          }, t.prototype.setMatrix3x3 = function(e, n) {\n            return !!e && (this._native.setMatrix3x3(e, n), !0);\n          }, t.prototype.setMatrix2x2 = function(e, n) {\n            return !!e && (this._native.setMatrix2x2(e, n), !0);\n          }, t.prototype.setFloat = function(e, n) {\n            return !!e && (this._native.setFloat(e, n), !0);\n          }, t.prototype.setFloat2 = function(e, n, i) {\n            return !!e && (this._native.setFloat2(e, n, i), !0);\n          }, t.prototype.setFloat3 = function(e, n, i, o) {\n            return !!e && (this._native.setFloat3(e, n, i, o), !0);\n          }, t.prototype.setFloat4 = function(e, n, i, o, a) {\n            return !!e && (this._native.setFloat4(e, n, i, o, a), !0);\n          }, t.prototype.setColor3 = function(e, n) {\n            return !!e && (this._native.setFloat3(e, n.r, n.g, n.b), !0);\n          }, t.prototype.setColor4 = function(e, n, i) {\n            return !!e && (this._native.setFloat4(e, n.r, n.g, n.b, i), !0);\n          }, t.prototype.wipeCaches = function(e) {\n            this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, e && (this._currentProgram = null, this._stencilState.reset(), this._depthCullingState.reset(), this._alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);\n          }, t.prototype._createTexture = function() {\n            return this._native.createTexture();\n          }, t.prototype._deleteTexture = function(e) {\n            this._native.deleteTexture(e);\n          }, t.prototype.updateDynamicTexture = function(e, n, i, o, a) {\n            this.createTexture(\"data:my_image_name\", !0, i, null, Ne.a.BILINEAR_SAMPLINGMODE, void 0, void 0, \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYSURBVChTY/z//z8DPsAEpXGC4aCAgQEAGGMDDWwwgqsAAAAASUVORK5CYII=\", e, t.TEXTUREFORMAT_RGBA, null, void 0);\n          }, t.prototype.createTexture = function(e, n, i, o, a, s, d, p, y, P, R, B, F) {\n            var z = this;\n            a === void 0 && (a = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), s === void 0 && (s = null), d === void 0 && (d = null), p === void 0 && (p = null), y === void 0 && (y = null), P === void 0 && (P = null), R === void 0 && (R = null);\n            var J = (e = e || \"\").substr(0, 5) === \"data:\", ie = J && e.indexOf(\";base64,\") !== -1, se = y || new Pt.a(this, Pt.b.Url), ce = e;\n            !this._transformTextureUrl || ie || y || p || (e = this._transformTextureUrl(e));\n            for (var ue = e.lastIndexOf(\".\"), fe = R || (ue > -1 ? e.substring(ue).toLowerCase() : \"\"), ve = null, Te = 0, Re = Ue.a._TextureLoaders; Te < Re.length; Te++) {\n              var Ae = Re[Te];\n              if (Ae.canLoad(fe)) {\n                ve = Ae;\n                break;\n              }\n            }\n            o && o._addPendingData(se), se.url = e, se.generateMipMaps = !n, se.samplingMode = a, se.invertY = i, this.doNotHandleContextLost || (se._buffer = p);\n            var Ee = null;\n            if (s && !y && (Ee = se.onLoadedObservable.add(s)), y || this._internalTexturesCache.push(se), ve)\n              throw new Error(\"Loading textures from IInternalTextureLoader not yet implemented.\");\n            var Se = function(De) {\n              var xe = se._webGLTexture;\n              xe ? z._native.loadTexture(xe, De, !n, i, function() {\n                se.baseWidth = z._native.getTextureWidth(xe), se.baseHeight = z._native.getTextureHeight(xe), se.width = se.baseWidth, se.height = se.baseHeight, se.isReady = !0;\n                var Le = z._getNativeSamplingMode(a);\n                z._native.setTextureSampling(xe, Le), o && o._removePendingData(se), se.onLoadedObservable.notifyObservers(se), se.onLoadedObservable.clear();\n              }, function() {\n                throw new Error(\"Could not load a native texture.\");\n              }) : o && o._removePendingData(se);\n            };\n            if (J)\n              if (p instanceof ArrayBuffer)\n                Se(new Uint8Array(p));\n              else if (ArrayBuffer.isView(p))\n                Se(p);\n              else {\n                if (typeof p != \"string\")\n                  throw new Error(\"Unsupported buffer type\");\n                Se(new Uint8Array(Xe.b.DecodeBase64(p)));\n              }\n            else\n              ie ? Se(new Uint8Array(Xe.b.DecodeBase64(e))) : this._loadFile(e, function(De) {\n                return Se(new Uint8Array(De));\n              }, void 0, void 0, !0, function(De, xe) {\n                (function(Le, Me) {\n                  o && o._removePendingData(se), e === ce ? (Ee && se.onLoadedObservable.remove(Ee), te.a.UseFallbackTexture && z.createTexture(te.a.FallbackTexture, n, se.invertY, o, a, null, d, p, se), d && d((Le || \"Unknown error\") + (te.a.UseFallbackTexture ? \" - Fallback texture was used\" : \"\"), Me)) : (l.a.Warn(\"Failed to load \" + e + \", falling back to \" + ce), z.createTexture(ce, n, se.invertY, o, a, s, d, p, se, P, R, B, F));\n                })(\"Unable to load \" + (De && De.responseURL, xe));\n              });\n            return se;\n          }, t.prototype._createDepthStencilTexture = function(e, n) {\n            var i = new Hl(this, Pt.b.Depth), o = e.width || e, a = e.height || e, s = this._native.createDepthTexture(i._webGLTexture, o, a);\n            return i._framebuffer = s, i;\n          }, t.prototype._releaseFramebufferObjects = function(e) {\n          }, t.prototype.createCubeTexture = function(e, n, i, o, a, s, d, p, y, P, R, B) {\n            var F = this;\n            a === void 0 && (a = null), s === void 0 && (s = null), p === void 0 && (p = null), P === void 0 && (P = 0), R === void 0 && (R = 0), B === void 0 && (B = null);\n            var z = B || new Pt.a(this, Pt.b.Cube);\n            z.isCube = !0, z.url = e, z.generateMipMaps = !o, z._lodGenerationScale = P, z._lodGenerationOffset = R, this._doNotHandleContextLost || (z._extension = p, z._files = i);\n            var J = e.lastIndexOf(\".\");\n            if ((p || (J > -1 ? e.substring(J).toLowerCase() : \"\")) === \".env\") {\n              if (i && i.length === 6)\n                throw new Error(\"Multi-file loading not allowed on env files.\");\n              this._loadFile(e, function(se) {\n                return function(ce) {\n                  var ue = gi.GetEnvInfo(ce);\n                  if (z.width = ue.width, z.height = ue.width, gi.UploadEnvSpherical(z, ue), ue.version !== 1)\n                    throw new Error('Unsupported babylon environment map version \"' + ue.version + '\"');\n                  var fe = ue.specular;\n                  if (!fe)\n                    throw new Error(\"Nothing else parsed so far\");\n                  z._lodGenerationScale = fe.lodGenerationScale;\n                  var ve = gi.CreateImageDataArrayBufferViews(ce, ue);\n                  z.format = h.a.TEXTUREFORMAT_RGBA, z.type = h.a.TEXTURETYPE_UNSIGNED_INT, z.generateMipMaps = !0, z.getEngine().updateTextureSamplingMode(Ne.a.TRILINEAR_SAMPLINGMODE, z), z._isRGBD = !0, z.invertY = !0, F._native.loadCubeTextureWithMips(z._webGLTexture, ve, function() {\n                    z.isReady = !0, a && a();\n                  }, function() {\n                    throw new Error(\"Could not load a native cube texture.\");\n                  });\n                }(new Uint8Array(se));\n              }, void 0, void 0, !0, function(se, ce) {\n                s && se && s(se.status + \" \" + se.statusText, ce);\n              });\n            } else {\n              if (!i || i.length !== 6)\n                throw new Error(\"Cannot load cubemap because 6 files were not defined\");\n              var ie = [i[0], i[3], i[1], i[4], i[2], i[5]];\n              Promise.all(ie.map(function(se) {\n                return Xe.b.LoadFileAsync(se).then(function(ce) {\n                  return new Uint8Array(ce);\n                });\n              })).then(function(se) {\n                return new Promise(function(ce, ue) {\n                  F._native.loadCubeTexture(z._webGLTexture, se, !o, ce, ue);\n                });\n              }).then(function() {\n                z.isReady = !0, a && a();\n              }, function(se) {\n                s && s(\"Failed to load cubemap: \" + se.message, se);\n              });\n            }\n            return this._internalTexturesCache.push(z), z;\n          }, t.prototype.createRenderTargetTexture = function(e, n) {\n            var i = new fl.a();\n            n !== void 0 && typeof n == \"object\" ? (i.generateMipMaps = n.generateMipMaps, i.generateDepthBuffer = n.generateDepthBuffer === void 0 || n.generateDepthBuffer, i.generateStencilBuffer = i.generateDepthBuffer && n.generateStencilBuffer, i.type = n.type === void 0 ? h.a.TEXTURETYPE_UNSIGNED_INT : n.type, i.samplingMode = n.samplingMode === void 0 ? h.a.TEXTURE_TRILINEAR_SAMPLINGMODE : n.samplingMode, i.format = n.format === void 0 ? h.a.TEXTUREFORMAT_RGBA : n.format) : (i.generateMipMaps = n, i.generateDepthBuffer = !0, i.generateStencilBuffer = !1, i.type = h.a.TEXTURETYPE_UNSIGNED_INT, i.samplingMode = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, i.format = h.a.TEXTUREFORMAT_RGBA), (i.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloatLinearFiltering) && (i.type !== h.a.TEXTURETYPE_HALF_FLOAT || this._caps.textureHalfFloatLinearFiltering) || (i.samplingMode = h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            var o = new Hl(this, Pt.b.RenderTarget), a = e.width || e, s = e.height || e;\n            i.type !== h.a.TEXTURETYPE_FLOAT || this._caps.textureFloat || (i.type = h.a.TEXTURETYPE_UNSIGNED_INT, l.a.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\"));\n            var d = this._native.createFramebuffer(o._webGLTexture, a, s, this._getNativeTextureFormat(i.format, i.type), i.samplingMode, !!i.generateStencilBuffer, i.generateDepthBuffer, !!i.generateMipMaps);\n            return o._framebuffer = d, o.baseWidth = a, o.baseHeight = s, o.width = a, o.height = s, o.isReady = !0, o.samples = 1, o.generateMipMaps = !!i.generateMipMaps, o.samplingMode = i.samplingMode, o.type = i.type, o.format = i.format, o._generateDepthBuffer = i.generateDepthBuffer, o._generateStencilBuffer = !!i.generateStencilBuffer, this._internalTexturesCache.push(o), o;\n          }, t.prototype.updateTextureSamplingMode = function(e, n) {\n            if (n._webGLTexture) {\n              var i = this._getNativeSamplingMode(e);\n              this._native.setTextureSampling(n._webGLTexture, i);\n            }\n            n.samplingMode = e;\n          }, t.prototype.bindFramebuffer = function(e, n, i, o, a) {\n            if (n)\n              throw new Error(\"Cuboid frame buffers are not yet supported in NativeEngine.\");\n            if (i || o)\n              throw new Error(\"Required width/height for frame buffers not yet supported in NativeEngine.\");\n            e._depthStencilTexture ? this._bindUnboundFramebuffer(e._depthStencilTexture._framebuffer) : this._bindUnboundFramebuffer(e._framebuffer);\n          }, t.prototype.unBindFramebuffer = function(e, n, i) {\n            n === void 0 && (n = !1), n && l.a.Warn(\"Disabling mipmap generation not yet supported in NativeEngine. Ignoring.\"), i && i(), this._bindUnboundFramebuffer(null);\n          }, t.prototype.createDynamicVertexBuffer = function(e) {\n            return this.createVertexBuffer(e, !0);\n          }, t.prototype.updateDynamicIndexBuffer = function(e, n, i) {\n            i === void 0 && (i = 0);\n            var o = e, a = this._normalizeIndexData(n);\n            o.is32Bits = a.BYTES_PER_ELEMENT === 4, this._native.updateDynamicIndexBuffer(o.nativeIndexBuffer, a, i);\n          }, t.prototype.updateDynamicVertexBuffer = function(e, n, i, o) {\n            var a = e, s = ArrayBuffer.isView(n) ? n : new Float32Array(n);\n            this._native.updateDynamicVertexBuffer(a.nativeVertexBuffer, s, i ?? 0, o ?? s.byteLength);\n          }, t.prototype._setTexture = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a, s = this._boundUniforms[e];\n            if (!s)\n              return !1;\n            if (!n)\n              return this._boundTexturesCache[e] != null && (this._activeChannel = e, this._native.setTexture(s, null)), !1;\n            if (n.video)\n              this._activeChannel = e, n.update();\n            else if (n.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED)\n              return n.delayLoad(), !1;\n            return a = o ? n.depthStencilTexture : n.isReady() ? n.getInternalTexture() : n.isCube ? this.emptyCubeTexture : n.is3D ? this.emptyTexture3D : n.is2DArray ? this.emptyTexture2DArray : this.emptyTexture, this._activeChannel = e, !(!a || !a._webGLTexture) && (this._native.setTextureWrapMode(a._webGLTexture, this._getAddressMode(n.wrapU), this._getAddressMode(n.wrapV), this._getAddressMode(n.wrapR)), this._updateAnisotropicLevel(n), this._native.setTexture(s, a._webGLTexture), !0);\n          }, t.prototype._updateAnisotropicLevel = function(e) {\n            var n = e.getInternalTexture(), i = e.anisotropicFilteringLevel;\n            n && n._webGLTexture && n._cachedAnisotropicFilteringLevel !== i && (this._native.setTextureAnisotropicLevel(n._webGLTexture, i), n._cachedAnisotropicFilteringLevel = i);\n          }, t.prototype._getAddressMode = function(e) {\n            switch (e) {\n              case h.a.TEXTURE_WRAP_ADDRESSMODE:\n                return this._native.ADDRESS_MODE_WRAP;\n              case h.a.TEXTURE_CLAMP_ADDRESSMODE:\n                return this._native.ADDRESS_MODE_CLAMP;\n              case h.a.TEXTURE_MIRROR_ADDRESSMODE:\n                return this._native.ADDRESS_MODE_MIRROR;\n              default:\n                throw new Error(\"Unexpected wrap mode: \" + e + \".\");\n            }\n          }, t.prototype._bindTexture = function(e, n) {\n            var i = this._boundUniforms[e];\n            i && this._native.setTexture(i, n._webGLTexture);\n          }, t.prototype._deleteBuffer = function(e) {\n            e.nativeIndexBuffer && (this._native.deleteIndexBuffer(e.nativeIndexBuffer), delete e.nativeIndexBuffer), e.nativeVertexBuffer && (this._native.deleteVertexBuffer(e.nativeVertexBuffer), delete e.nativeVertexBuffer);\n          }, t.prototype.releaseEffects = function() {\n          }, t.prototype._uploadCompressedDataToTextureDirectly = function(e, n, i, o, a, s, d) {\n            throw new Error(\"_uploadCompressedDataToTextureDirectly not implemented.\");\n          }, t.prototype._uploadDataToTextureDirectly = function(e, n, i, o) {\n            throw new Error(\"_uploadDataToTextureDirectly not implemented.\");\n          }, t.prototype._uploadArrayBufferViewToTexture = function(e, n, i, o) {\n            throw new Error(\"_uploadArrayBufferViewToTexture not implemented.\");\n          }, t.prototype._uploadImageToTexture = function(e, n, i, o) {\n            throw new Error(\"_uploadArrayBufferViewToTexture not implemented.\");\n          }, t.prototype._getNativeSamplingMode = function(e) {\n            switch (e) {\n              case h.a.TEXTURE_NEAREST_NEAREST:\n                return this._native.TEXTURE_NEAREST_NEAREST;\n              case h.a.TEXTURE_LINEAR_LINEAR:\n                return this._native.TEXTURE_LINEAR_LINEAR;\n              case h.a.TEXTURE_LINEAR_LINEAR_MIPLINEAR:\n                return this._native.TEXTURE_LINEAR_LINEAR_MIPLINEAR;\n              case h.a.TEXTURE_NEAREST_NEAREST_MIPNEAREST:\n                return this._native.TEXTURE_NEAREST_NEAREST_MIPNEAREST;\n              case h.a.TEXTURE_NEAREST_LINEAR_MIPNEAREST:\n                return this._native.TEXTURE_NEAREST_LINEAR_MIPNEAREST;\n              case h.a.TEXTURE_NEAREST_LINEAR_MIPLINEAR:\n                return this._native.TEXTURE_NEAREST_LINEAR_MIPLINEAR;\n              case h.a.TEXTURE_NEAREST_LINEAR:\n                return this._native.TEXTURE_NEAREST_LINEAR;\n              case h.a.TEXTURE_NEAREST_NEAREST_MIPLINEAR:\n                return this._native.TEXTURE_NEAREST_NEAREST_MIPLINEAR;\n              case h.a.TEXTURE_LINEAR_NEAREST_MIPNEAREST:\n                return this._native.TEXTURE_LINEAR_NEAREST_MIPNEAREST;\n              case h.a.TEXTURE_LINEAR_NEAREST_MIPLINEAR:\n                return this._native.TEXTURE_LINEAR_NEAREST_MIPLINEAR;\n              case h.a.TEXTURE_LINEAR_LINEAR_MIPNEAREST:\n                return this._native.TEXTURE_LINEAR_LINEAR_MIPNEAREST;\n              case h.a.TEXTURE_LINEAR_NEAREST:\n                return this._native.TEXTURE_LINEAR_NEAREST;\n              default:\n                throw new Error(\"Unsupported sampling mode: \" + e + \".\");\n            }\n          }, t.prototype._getNativeTextureFormat = function(e, n) {\n            if (e == h.a.TEXTUREFORMAT_RGBA && n == h.a.TEXTURETYPE_UNSIGNED_INT)\n              return this._native.TEXTURE_FORMAT_RGBA8;\n            if (e == h.a.TEXTUREFORMAT_RGBA && n == h.a.TEXTURETYPE_FLOAT)\n              return this._native.TEXTURE_FORMAT_RGBA32F;\n            throw new Error(\"Unsupported texture format or type: format \" + e + \", type \" + n + \".\");\n          }, t.prototype._getNativeAlphaMode = function(e) {\n            switch (e) {\n              case h.a.ALPHA_DISABLE:\n                return this._native.ALPHA_DISABLE;\n              case h.a.ALPHA_ADD:\n                return this._native.ALPHA_ADD;\n              case h.a.ALPHA_COMBINE:\n                return this._native.ALPHA_COMBINE;\n              case h.a.ALPHA_SUBTRACT:\n                return this._native.ALPHA_SUBTRACT;\n              case h.a.ALPHA_MULTIPLY:\n                return this._native.ALPHA_MULTIPLY;\n              case h.a.ALPHA_MAXIMIZED:\n                return this._native.ALPHA_MAXIMIZED;\n              case h.a.ALPHA_ONEONE:\n                return this._native.ALPHA_ONEONE;\n              case h.a.ALPHA_PREMULTIPLIED:\n                return this._native.ALPHA_PREMULTIPLIED;\n              case h.a.ALPHA_PREMULTIPLIED_PORTERDUFF:\n                return this._native.ALPHA_PREMULTIPLIED_PORTERDUFF;\n              case h.a.ALPHA_INTERPOLATE:\n                return this._native.ALPHA_INTERPOLATE;\n              case h.a.ALPHA_SCREENMODE:\n                return this._native.ALPHA_SCREENMODE;\n              default:\n                throw new Error(\"Unsupported alpha mode: \" + e + \".\");\n            }\n          }, t.prototype._getNativeAttribType = function(e) {\n            switch (e) {\n              case Oe.b.UNSIGNED_BYTE:\n                return this._native.ATTRIB_TYPE_UINT8;\n              case Oe.b.SHORT:\n                return this._native.ATTRIB_TYPE_INT16;\n              case Oe.b.FLOAT:\n                return this._native.ATTRIB_TYPE_FLOAT;\n              default:\n                throw new Error(\"Unsupported attribute type: \" + e + \".\");\n            }\n          }, t;\n        }(Ue.a), kf = f(74), No = function() {\n          function r() {\n          }\n          return r.COPY = 1, r.CUT = 2, r.PASTE = 3, r;\n        }(), Gf = function() {\n          function r(t, e) {\n            this.type = t, this.event = e;\n          }\n          return r.GetTypeFromCharacter = function(t) {\n            switch (t) {\n              case 67:\n                return No.COPY;\n              case 86:\n                return No.PASTE;\n              case 88:\n                return No.CUT;\n              default:\n                return -1;\n            }\n          }, r;\n        }(), fs = f(83), yi = f(69);\n        (function(r) {\n          r[r.Clean = 0] = \"Clean\", r[r.Stop = 1] = \"Stop\", r[r.Sync = 2] = \"Sync\", r[r.NoSync = 3] = \"NoSync\";\n        })(vi || (vi = {}));\n        var Ft = function() {\n          function r() {\n          }\n          return Object.defineProperty(r, \"ForceFullSceneLoadingForIncremental\", { get: function() {\n            return yi.a.ForceFullSceneLoadingForIncremental;\n          }, set: function(t) {\n            yi.a.ForceFullSceneLoadingForIncremental = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r, \"ShowLoadingScreen\", { get: function() {\n            return yi.a.ShowLoadingScreen;\n          }, set: function(t) {\n            yi.a.ShowLoadingScreen = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r, \"loggingLevel\", { get: function() {\n            return yi.a.loggingLevel;\n          }, set: function(t) {\n            yi.a.loggingLevel = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r, \"CleanBoneMatrixWeights\", { get: function() {\n            return yi.a.CleanBoneMatrixWeights;\n          }, set: function(t) {\n            yi.a.CleanBoneMatrixWeights = t;\n          }, enumerable: !1, configurable: !0 }), r.GetDefaultPlugin = function() {\n            return r._registeredPlugins[\".babylon\"];\n          }, r._GetPluginForExtension = function(t) {\n            var e = r._registeredPlugins[t];\n            return e || (l.a.Warn(\"Unable to find a plugin to load \" + t + \" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/how_to/load_from_any_file_type\"), r.GetDefaultPlugin());\n          }, r._GetPluginForDirectLoad = function(t) {\n            for (var e in r._registeredPlugins) {\n              var n = r._registeredPlugins[e].plugin;\n              if (n.canDirectLoad && n.canDirectLoad(t))\n                return r._registeredPlugins[e];\n            }\n            return r.GetDefaultPlugin();\n          }, r._GetPluginForFilename = function(t) {\n            var e = t.indexOf(\"?\");\n            e !== -1 && (t = t.substring(0, e));\n            var n = t.lastIndexOf(\".\"), i = t.substring(n, t.length).toLowerCase();\n            return r._GetPluginForExtension(i);\n          }, r._GetDirectLoad = function(t) {\n            return t.substr(0, 5) === \"data:\" ? t.substr(5) : null;\n          }, r._LoadData = function(t, e, n, i, o, a, s) {\n            var d, p = r._GetDirectLoad(t.name), y = s ? r._GetPluginForExtension(s) : p ? r._GetPluginForDirectLoad(t.name) : r._GetPluginForFilename(t.name);\n            if (!(d = y.plugin.createPlugin !== void 0 ? y.plugin.createPlugin() : y.plugin))\n              throw \"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.\";\n            if (r.OnPluginActivatedObservable.notifyObservers(d), p) {\n              if (d.directLoad) {\n                var P = d.directLoad(e, p);\n                P.then ? P.then(function(Ae) {\n                  n(d, Ae);\n                }).catch(function(Ae) {\n                  o(\"Error in directLoad of _loadData: \" + Ae, Ae);\n                }) : n(d, P);\n              } else\n                n(d, p);\n              return d;\n            }\n            var R = y.isBinary, B = function(Ae, Ee) {\n              e.isDisposed ? o(\"Scene has been disposed\") : n(d, Ae, Ee);\n            }, F = null, z = !1, J = d.onDisposeObservable;\n            J && J.add(function() {\n              z = !0, F && (F.abort(), F = null), a();\n            });\n            var ie = function() {\n              if (!z) {\n                var Ae = function(Se, De) {\n                  B(Se, De ? De.responseURL : void 0);\n                }, Ee = function(Se) {\n                  o(Se.message, Se);\n                };\n                F = d.requestFile ? d.requestFile(e, t.url, Ae, i, R, Ee) : e._requestFile(t.url, Ae, i, !0, R, Ee);\n              }\n            }, se = t.file || fs.a.FilesToLoad[t.name.toLowerCase()];\n            if (t.rootUrl.indexOf(\"file:\") === -1 || t.rootUrl.indexOf(\"file:\") !== -1 && !se) {\n              var ce = e.getEngine(), ue = ce.enableOfflineSupport;\n              if (ue) {\n                for (var fe = !1, ve = 0, Te = e.disableOfflineSupportExceptionRules; ve < Te.length; ve++)\n                  if (Te[ve].test(t.url)) {\n                    fe = !0;\n                    break;\n                  }\n                ue = !fe;\n              }\n              ue && Ue.a.OfflineProviderFactory ? e.offlineProvider = Ue.a.OfflineProviderFactory(t.url, ie, ce.disableManifestCheck) : ie();\n            } else if (se) {\n              var Re = function(Ae) {\n                o(Ae.message, Ae);\n              };\n              F = d.readFile ? d.readFile(e, se, B, i, R, Re) : e._readFile(se, B, i, R, Re);\n            } else\n              o(\"Unable to find file named \" + t.name);\n            return d;\n          }, r._GetFileInfo = function(t, e) {\n            var n, i, o = null;\n            if (e)\n              if (e.name) {\n                var a = e;\n                n = t + a.name, i = a.name, o = a;\n              } else {\n                var s = e;\n                if (s.substr(0, 1) === \"/\")\n                  return Xe.b.Error(\"Wrong sceneFilename parameter\"), null;\n                n = t + s, i = s;\n              }\n            else\n              n = t, i = Xe.b.GetFilename(t), t = Xe.b.GetFolderPath(t);\n            return { url: n, rootUrl: t, name: i, file: o };\n          }, r.GetPluginForExtension = function(t) {\n            return r._GetPluginForExtension(t).plugin;\n          }, r.IsPluginForExtensionAvailable = function(t) {\n            return !!r._registeredPlugins[t];\n          }, r.RegisterPlugin = function(t) {\n            if (typeof t.extensions == \"string\") {\n              var e = t.extensions;\n              r._registeredPlugins[e.toLowerCase()] = { plugin: t, isBinary: !1 };\n            } else {\n              var n = t.extensions;\n              Object.keys(n).forEach(function(i) {\n                r._registeredPlugins[i.toLowerCase()] = { plugin: t, isBinary: n[i].isBinary };\n              });\n            }\n          }, r.ImportMesh = function(t, e, n, i, o, a, s, d) {\n            if (n === void 0 && (n = \"\"), i === void 0 && (i = te.a.LastCreatedScene), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null), !i)\n              return l.a.Error(\"No scene available to import mesh to\"), null;\n            var p = r._GetFileInfo(e, n);\n            if (!p)\n              return null;\n            var y = {};\n            i._addPendingData(y);\n            var P = function() {\n              i._removePendingData(y);\n            }, R = function(z, J) {\n              var ie = \"Unable to import meshes from \" + p.url + \": \" + z;\n              s ? s(i, ie, J) : l.a.Error(ie), P();\n            }, B = a ? function(z) {\n              try {\n                a(z);\n              } catch (J) {\n                R(\"Error in onProgress callback: \" + J, J);\n              }\n            } : void 0, F = function(z, J, ie, se, ce, ue, fe) {\n              if (i.importedMeshesFiles.push(p.url), o)\n                try {\n                  o(z, J, ie, se, ce, ue, fe);\n                } catch (ve) {\n                  R(\"Error in onSuccess callback: \" + ve, ve);\n                }\n              i._removePendingData(y);\n            };\n            return r._LoadData(p, i, function(z, J, ie) {\n              if (z.rewriteRootURL && (p.rootUrl = z.rewriteRootURL(p.rootUrl, ie)), z.importMesh) {\n                var se = z, ce = new Array(), ue = new Array(), fe = new Array();\n                if (!se.importMesh(t, i, J, p.rootUrl, ce, ue, fe, R))\n                  return;\n                i.loadingPluginName = z.name, F(ce, ue, fe, [], [], [], []);\n              } else\n                z.importMeshAsync(t, i, J, p.rootUrl, B, p.name).then(function(ve) {\n                  i.loadingPluginName = z.name, F(ve.meshes, ve.particleSystems, ve.skeletons, ve.animationGroups, ve.transformNodes, ve.geometries, ve.lights);\n                }).catch(function(ve) {\n                  R(ve.message, ve);\n                });\n            }, B, R, P, d);\n          }, r.ImportMeshAsync = function(t, e, n, i, o, a) {\n            return n === void 0 && (n = \"\"), i === void 0 && (i = te.a.LastCreatedScene), o === void 0 && (o = null), a === void 0 && (a = null), new Promise(function(s, d) {\n              r.ImportMesh(t, e, n, i, function(p, y, P, R, B, F, z) {\n                s({ meshes: p, particleSystems: y, skeletons: P, animationGroups: R, transformNodes: B, geometries: F, lights: z });\n              }, o, function(p, y, P) {\n                d(P || new Error(y));\n              }, a);\n            });\n          }, r.Load = function(t, e, n, i, o, a, s) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedEngine), i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), n ? r.Append(t, e, new _e.a(n), i, o, a, s) : (Xe.b.Error(\"No engine available\"), null);\n          }, r.LoadAsync = function(t, e, n, i, o) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedEngine), i === void 0 && (i = null), o === void 0 && (o = null), new Promise(function(a, s) {\n              r.Load(t, e, n, function(d) {\n                a(d);\n              }, i, function(d, p, y) {\n                s(y || new Error(p));\n              }, o);\n            });\n          }, r.Append = function(t, e, n, i, o, a, s) {\n            var d = this;\n            if (e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), !n)\n              return l.a.Error(\"No scene available to append to\"), null;\n            var p = r._GetFileInfo(t, e);\n            if (!p)\n              return null;\n            r.ShowLoadingScreen && !this._showingLoadingScreen && (this._showingLoadingScreen = !0, n.getEngine().displayLoadingUI(), n.executeWhenReady(function() {\n              n.getEngine().hideLoadingUI(), d._showingLoadingScreen = !1;\n            }));\n            var y = {};\n            n._addPendingData(y);\n            var P = function() {\n              n._removePendingData(y);\n            }, R = function(z, J) {\n              var ie = \"Unable to load from \" + p.url + (z ? \": \" + z : \"\");\n              a ? a(n, ie, J) : l.a.Error(ie), P();\n            }, B = o ? function(z) {\n              try {\n                o(z);\n              } catch (J) {\n                R(\"Error in onProgress callback\", J);\n              }\n            } : void 0, F = function() {\n              if (i)\n                try {\n                  i(n);\n                } catch (z) {\n                  R(\"Error in onSuccess callback\", z);\n                }\n              n._removePendingData(y);\n            };\n            return r._LoadData(p, n, function(z, J) {\n              if (z.load) {\n                if (!z.load(n, J, p.rootUrl, R))\n                  return;\n                n.loadingPluginName = z.name, F();\n              } else\n                z.loadAsync(n, J, p.rootUrl, B, p.name).then(function() {\n                  n.loadingPluginName = z.name, F();\n                }).catch(function(ie) {\n                  R(ie.message, ie);\n                });\n            }, B, R, P, s);\n          }, r.AppendAsync = function(t, e, n, i, o) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), new Promise(function(a, s) {\n              r.Append(t, e, n, function(d) {\n                a(d);\n              }, i, function(d, p, y) {\n                s(y || new Error(p));\n              }, o);\n            });\n          }, r.LoadAssetContainer = function(t, e, n, i, o, a, s) {\n            if (e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), !n)\n              return l.a.Error(\"No scene available to load asset container to\"), null;\n            var d = r._GetFileInfo(t, e);\n            if (!d)\n              return null;\n            var p = {};\n            n._addPendingData(p);\n            var y = function() {\n              n._removePendingData(p);\n            }, P = function(F, z) {\n              var J = \"Unable to load assets from \" + d.url + (F ? \": \" + F : \"\");\n              z && z.message && (J += \" (\" + z.message + \")\"), a ? a(n, J, z) : l.a.Error(J), y();\n            }, R = o ? function(F) {\n              try {\n                o(F);\n              } catch (z) {\n                P(\"Error in onProgress callback\", z);\n              }\n            } : void 0, B = function(F) {\n              if (i)\n                try {\n                  i(F);\n                } catch (z) {\n                  P(\"Error in onSuccess callback\", z);\n                }\n              n._removePendingData(p);\n            };\n            return r._LoadData(d, n, function(F, z) {\n              if (F.loadAssetContainer) {\n                var J = F.loadAssetContainer(n, z, d.rootUrl, P);\n                if (!J)\n                  return;\n                n.loadingPluginName = F.name, B(J);\n              } else\n                F.loadAssetContainerAsync ? F.loadAssetContainerAsync(n, z, d.rootUrl, R, d.name).then(function(ie) {\n                  n.loadingPluginName = F.name, B(ie);\n                }).catch(function(ie) {\n                  P(ie.message, ie);\n                }) : P(\"LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.\");\n            }, R, P, y, s);\n          }, r.LoadAssetContainerAsync = function(t, e, n, i, o) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = null), o === void 0 && (o = null), new Promise(function(a, s) {\n              r.LoadAssetContainer(t, e, n, function(d) {\n                a(d);\n              }, i, function(d, p, y) {\n                s(y || new Error(p));\n              }, o);\n            });\n          }, r.ImportAnimations = function(t, e, n, i, o, a, s, d, p, y) {\n            if (e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = !0), o === void 0 && (o = vi.Clean), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null), p === void 0 && (p = null), y === void 0 && (y = null), n) {\n              if (i) {\n                for (var P = 0, R = n.animatables; P < R.length; P++)\n                  R[P].reset();\n                n.stopAllAnimations(), n.animationGroups.slice().forEach(function(F) {\n                  F.dispose();\n                }), n.getNodes().forEach(function(F) {\n                  F.animations && (F.animations = []);\n                });\n              } else\n                switch (o) {\n                  case vi.Clean:\n                    n.animationGroups.slice().forEach(function(F) {\n                      F.dispose();\n                    });\n                    break;\n                  case vi.Stop:\n                    n.animationGroups.forEach(function(F) {\n                      F.stop();\n                    });\n                    break;\n                  case vi.Sync:\n                    n.animationGroups.forEach(function(F) {\n                      F.reset(), F.restart();\n                    });\n                    break;\n                  case vi.NoSync:\n                    break;\n                  default:\n                    return void l.a.Error(\"Unknown animation group loading mode value '\" + o + \"'\");\n                }\n              var B = n.animatables.length;\n              this.LoadAssetContainer(t, e, n, function(F) {\n                F.mergeAnimationsTo(n, n.animatables.slice(B), a), F.dispose(), n.onAnimationFileImportedObservable.notifyObservers(n), s && s(n);\n              }, d, p, y);\n            } else\n              l.a.Error(\"No scene available to load animations to\");\n          }, r.ImportAnimationsAsync = function(t, e, n, i, o, a, s, d, p, y) {\n            return e === void 0 && (e = \"\"), n === void 0 && (n = te.a.LastCreatedScene), i === void 0 && (i = !0), o === void 0 && (o = vi.Clean), a === void 0 && (a = null), d === void 0 && (d = null), y === void 0 && (y = null), new Promise(function(P, R) {\n              r.ImportAnimations(t, e, n, i, o, a, function(B) {\n                P(B);\n              }, d, function(B, F, z) {\n                R(z || new Error(F));\n              }, y);\n            });\n          }, r.NO_LOGGING = h.a.SCENELOADER_NO_LOGGING, r.MINIMAL_LOGGING = h.a.SCENELOADER_MINIMAL_LOGGING, r.SUMMARY_LOGGING = h.a.SCENELOADER_SUMMARY_LOGGING, r.DETAILED_LOGGING = h.a.SCENELOADER_DETAILED_LOGGING, r.OnPluginActivatedObservable = new C.c(), r._registeredPlugins = {}, r._showingLoadingScreen = !1, r;\n        }(), ps = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.controllerType = Jn.DAYDREAM, n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              i._defaultModel = o[1], i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            if (e === 0) {\n              var o = this.onTriggerStateChangedObservable;\n              o && o.notifyObservers(n);\n            } else\n              l.a.Warn(\"Unrecognized Daydream button index: \" + e);\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/generic/\", t.MODEL_FILENAME = \"generic.babylon\", t.GAMEPAD_ID_PREFIX = \"Daydream\", t;\n        }(Oi);\n        Ci._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.indexOf(ps.GAMEPAD_ID_PREFIX) === 0;\n        }, create: function(r) {\n          return new ps(r);\n        } });\n        var _s = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._buttonIndexToObservableNameMap = [\"onPadStateChangedObservable\", \"onTriggerStateChangedObservable\"], n.controllerType = Jn.GEAR_VR, n._calculatedPosition = new u.e(n.hand == \"left\" ? -0.15 : 0.15, -0.5, 0.25), n._disableTrackPosition(n._calculatedPosition), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              var a = new Ie.a(\"\", e);\n              o[1].parent = a, o[1].position.z = -0.15, i._defaultModel = a, i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            if (e < this._buttonIndexToObservableNameMap.length) {\n              var o = this[this._buttonIndexToObservableNameMap[e]];\n              o && o.notifyObservers(n);\n            }\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/generic/\", t.MODEL_FILENAME = \"generic.babylon\", t.GAMEPAD_ID_PREFIX = \"Gear VR\", t;\n        }(Oi);\n        Ci._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.indexOf(_s.GAMEPAD_ID_PREFIX) === 0 || r.id.indexOf(\"Oculus Go\") !== -1 || r.id.indexOf(\"Vive Focus\") !== -1;\n        }, create: function(r) {\n          return new _s(r);\n        } });\n        var wo = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              i._defaultModel = o[1], i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            console.log(\"Button id: \" + e + \"state: \"), console.dir(n);\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/generic/\", t.MODEL_FILENAME = \"generic.babylon\", t;\n        }(Oi);\n        Ci._DefaultControllerFactory = function(r) {\n          return new wo(r);\n        };\n        var ms = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.onSecondaryTriggerStateChangedObservable = new C.c(), n.onThumbRestChangedObservable = new C.c(), n.controllerType = Jn.OCULUS, n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i, o = this;\n            i = this.hand === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, Ft.ImportMesh(\"\", t._IsQuest ? t.QUEST_MODEL_BASE_URL : t.MODEL_BASE_URL, i, e, function(a) {\n              o._defaultModel = t._IsQuest ? a[0] : a[1], o.attachToMesh(o._defaultModel), n && n(o._defaultModel);\n            });\n          }, Object.defineProperty(t.prototype, \"onAButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"right\")\n              return this.onMainButtonStateChangedObservable;\n            throw new Error(\"No A button on left hand\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onBButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"right\")\n              return this.onSecondaryButtonStateChangedObservable;\n            throw new Error(\"No B button on left hand\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onXButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"left\")\n              return this.onMainButtonStateChangedObservable;\n            throw new Error(\"No X button on right hand\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onYButtonStateChangedObservable\", { get: function() {\n            if (this.hand === \"left\")\n              return this.onSecondaryButtonStateChangedObservable;\n            throw new Error(\"No Y button on right hand\");\n          }, enumerable: !1, configurable: !0 }), t.prototype._handleButtonChange = function(e, n, i) {\n            var o = n, a = this.hand === \"right\" ? -1 : 1;\n            switch (e) {\n              case 0:\n                return void this.onPadStateChangedObservable.notifyObservers(o);\n              case 1:\n                return !t._IsQuest && this._defaultModel && (this._defaultModel.getChildren()[3].rotation.x = 0.2 * -o.value, this._defaultModel.getChildren()[3].position.y = 5e-3 * -o.value, this._defaultModel.getChildren()[3].position.z = 5e-3 * -o.value), void this.onTriggerStateChangedObservable.notifyObservers(o);\n              case 2:\n                return !t._IsQuest && this._defaultModel && (this._defaultModel.getChildren()[4].position.x = a * o.value * 35e-4), void this.onSecondaryTriggerStateChangedObservable.notifyObservers(o);\n              case 3:\n                return !t._IsQuest && this._defaultModel && (o.pressed ? this._defaultModel.getChildren()[1].position.y = -1e-3 : this._defaultModel.getChildren()[1].position.y = 0), void this.onMainButtonStateChangedObservable.notifyObservers(o);\n              case 4:\n                return !t._IsQuest && this._defaultModel && (o.pressed ? this._defaultModel.getChildren()[2].position.y = -1e-3 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(o);\n              case 5:\n                return void this.onThumbRestChangedObservable.notifyObservers(o);\n            }\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculus/\", t.MODEL_LEFT_FILENAME = \"left.babylon\", t.MODEL_RIGHT_FILENAME = \"right.babylon\", t.QUEST_MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculusQuest/\", t._IsQuest = !1, t;\n        }(Oi);\n        Ci._ControllerFactories.push({ canCreate: function(r) {\n          return Ue.a.LastCreatedEngine && Ue.a.LastCreatedEngine._vrDisplay && Ue.a.LastCreatedEngine._vrDisplay.displayName === \"Oculus Quest\" && (ms._IsQuest = !0), r.id.indexOf(\"Oculus Touch\") !== -1;\n        }, create: function(r) {\n          return new ms(r);\n        } });\n        var Wl = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.controllerType = Jn.VIVE, n._invertLeftStickY = !0, n;\n          }\n          return Object(c.d)(t, r), t.prototype.initControllerMesh = function(e, n) {\n            var i = this;\n            Ft.ImportMesh(\"\", t.MODEL_BASE_URL, t.MODEL_FILENAME, e, function(o) {\n              i._defaultModel = o[1], i.attachToMesh(i._defaultModel), n && n(i._defaultModel);\n            });\n          }, Object.defineProperty(t.prototype, \"onLeftButtonStateChangedObservable\", { get: function() {\n            return this.onMainButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onRightButtonStateChangedObservable\", { get: function() {\n            return this.onMainButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onMenuButtonStateChangedObservable\", { get: function() {\n            return this.onSecondaryButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._handleButtonChange = function(e, n, i) {\n            var o = n;\n            switch (e) {\n              case 0:\n                return void this.onPadStateChangedObservable.notifyObservers(o);\n              case 1:\n                return this._defaultModel && (this._defaultModel.getChildren()[6].rotation.x = 0.15 * -o.value), void this.onTriggerStateChangedObservable.notifyObservers(o);\n              case 2:\n                return void this.onMainButtonStateChangedObservable.notifyObservers(o);\n              case 3:\n                return this._defaultModel && (o.pressed ? this._defaultModel.getChildren()[2].position.y = -1e-3 : this._defaultModel.getChildren()[2].position.y = 0), void this.onSecondaryButtonStateChangedObservable.notifyObservers(o);\n            }\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/vive/\", t.MODEL_FILENAME = \"wand.babylon\", t;\n        }(Oi);\n        Ci._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.toLowerCase().indexOf(\"openvr\") !== -1;\n        }, create: function(r) {\n          return new Wl(r);\n        } });\n        var zf = function() {\n          this.buttonMeshes = {}, this.axisMeshes = {};\n        }, Fo = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._mapping = { buttons: [\"thumbstick\", \"trigger\", \"grip\", \"menu\", \"trackpad\"], buttonMeshNames: { trigger: \"SELECT\", menu: \"MENU\", grip: \"GRASP\", thumbstick: \"THUMBSTICK_PRESS\", trackpad: \"TOUCHPAD_PRESS\" }, buttonObservableNames: { trigger: \"onTriggerStateChangedObservable\", menu: \"onSecondaryButtonStateChangedObservable\", grip: \"onMainButtonStateChangedObservable\", thumbstick: \"onPadStateChangedObservable\", trackpad: \"onTrackpadChangedObservable\" }, axisMeshNames: [\"THUMBSTICK_X\", \"THUMBSTICK_Y\", \"TOUCHPAD_TOUCH_X\", \"TOUCHPAD_TOUCH_Y\"], pointingPoseMeshName: ar.POINTING_POSE }, n.onTrackpadChangedObservable = new C.c(), n.onTrackpadValuesChangedObservable = new C.c(), n.trackpad = { x: 0, y: 0 }, n.controllerType = Jn.WINDOWS, n._loadedMeshInfo = null, n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onTriggerButtonStateChangedObservable\", { get: function() {\n            return this.onTriggerStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onMenuButtonStateChangedObservable\", { get: function() {\n            return this.onSecondaryButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onGripButtonStateChangedObservable\", { get: function() {\n            return this.onMainButtonStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onThumbstickButtonStateChangedObservable\", { get: function() {\n            return this.onPadStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onTouchpadButtonStateChangedObservable\", { get: function() {\n            return this.onTrackpadChangedObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"onTouchpadValuesChangedObservable\", { get: function() {\n            return this.onTrackpadValuesChangedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateTrackpad = function() {\n            !this.browserGamepad.axes || this.browserGamepad.axes[2] == this.trackpad.x && this.browserGamepad.axes[3] == this.trackpad.y || (this.trackpad.x = this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf(\"TOUCHPAD_TOUCH_X\")], this.trackpad.y = this.browserGamepad.axes[this._mapping.axisMeshNames.indexOf(\"TOUCHPAD_TOUCH_Y\")], this.onTrackpadValuesChangedObservable.notifyObservers(this.trackpad));\n          }, t.prototype.update = function() {\n            if (r.prototype.update.call(this), this.browserGamepad.axes && (this._updateTrackpad(), this._loadedMeshInfo))\n              for (var e = 0; e < this._mapping.axisMeshNames.length; e++)\n                this._lerpAxisTransform(e, this.browserGamepad.axes[e]);\n          }, t.prototype._handleButtonChange = function(e, n, i) {\n            var o = this._mapping.buttons[e];\n            if (o) {\n              this._updateTrackpad();\n              var a = this[this._mapping.buttonObservableNames[o]];\n              a && a.notifyObservers(n), this._lerpButtonTransform(o, n.value);\n            }\n          }, t.prototype._lerpButtonTransform = function(e, n) {\n            if (this._loadedMeshInfo) {\n              var i = this._loadedMeshInfo.buttonMeshes[e];\n              i && i.unpressed.rotationQuaternion && i.pressed.rotationQuaternion && i.value.rotationQuaternion && (u.b.SlerpToRef(i.unpressed.rotationQuaternion, i.pressed.rotationQuaternion, n, i.value.rotationQuaternion), u.e.LerpToRef(i.unpressed.position, i.pressed.position, n, i.value.position));\n            }\n          }, t.prototype._lerpAxisTransform = function(e, n) {\n            if (this._loadedMeshInfo) {\n              var i = this._loadedMeshInfo.axisMeshes[e];\n              if (i && i.min.rotationQuaternion && i.max.rotationQuaternion && i.value.rotationQuaternion) {\n                var o = 0.5 * n + 0.5;\n                u.b.SlerpToRef(i.min.rotationQuaternion, i.max.rotationQuaternion, o, i.value.rotationQuaternion), u.e.LerpToRef(i.min.position, i.max.position, o, i.value.position);\n              }\n            }\n          }, t.prototype.initControllerMesh = function(e, n, i) {\n            var o, a, s = this;\n            if (i === void 0 && (i = !1), Ft.IsPluginForExtensionAvailable(\".glb\")) {\n              var d = \"default\";\n              if (this.id && !i) {\n                var p = this.id.match(t.GAMEPAD_ID_PATTERN);\n                d = p && p[0] || d;\n              }\n              a = this.hand === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, o = t.MODEL_BASE_URL + d + \"/\";\n            } else\n              l.a.Warn(\"You need to reference GLTF loader to load Windows Motion Controllers model. Falling back to generic models\"), o = wo.MODEL_BASE_URL, a = wo.MODEL_FILENAME;\n            Ft.ImportMesh(\"\", o, a, e, function(y) {\n              s._loadedMeshInfo = s.processModel(e, y), s._loadedMeshInfo && (s._defaultModel = s._loadedMeshInfo.rootNode, s.attachToMesh(s._defaultModel), n && n(s._defaultModel));\n            }, null, function(y, P) {\n              l.a.Log(P), l.a.Warn(\"Failed to retrieve controller model from the remote server: \" + o + a), i || s.initControllerMesh(y, n, !0);\n            });\n          }, t.prototype.processModel = function(e, n) {\n            for (var i = null, o = new Ie.a(this.id + \" \" + this.hand, e), a = null, s = 0; s < n.length; s++) {\n              var d = n[s];\n              if (!d.parent) {\n                d.isPickable = !1, a = d;\n                break;\n              }\n            }\n            return a ? (a.setParent(o), i = this.createMeshInfo(o)) : l.a.Warn(\"Could not find root node in model file.\"), i;\n          }, t.prototype.createMeshInfo = function(e) {\n            var n, i = new zf();\n            for (i.rootNode = e, i.buttonMeshes = {}, i.axisMeshes = {}, n = 0; n < this._mapping.buttons.length; n++) {\n              var o = this._mapping.buttonMeshNames[this._mapping.buttons[n]];\n              if (o) {\n                var a = P(e, o);\n                if (a) {\n                  var s = { index: n, value: R(a, \"VALUE\"), pressed: R(a, \"PRESSED\"), unpressed: R(a, \"UNPRESSED\") };\n                  s.value && s.pressed && s.unpressed ? i.buttonMeshes[this._mapping.buttons[n]] = s : l.a.Warn(\"Missing button submesh under mesh with name: \" + o + \"(VALUE: \" + !!s.value + \", PRESSED: \" + !!s.pressed + \", UNPRESSED:\" + !!s.unpressed + \")\");\n                } else\n                  l.a.Warn(\"Missing button mesh with name: \" + o);\n              } else\n                l.a.Log(\"Skipping unknown button at index: \" + n + \" with mapped name: \" + this._mapping.buttons[n]);\n            }\n            for (n = 0; n < this._mapping.axisMeshNames.length; n++) {\n              var d = this._mapping.axisMeshNames[n];\n              if (d) {\n                var p = P(e, d);\n                if (p) {\n                  var y = { index: n, value: R(p, \"VALUE\"), min: R(p, \"MIN\"), max: R(p, \"MAX\") };\n                  y.value && y.min && y.max ? i.axisMeshes[n] = y : l.a.Warn(\"Missing axis submesh under mesh with name: \" + d + \"(VALUE: \" + !!y.value + \", MIN: \" + !!y.min + \", MAX:\" + !!y.max + \")\");\n                } else\n                  l.a.Warn(\"Missing axis mesh with name: \" + d);\n              } else\n                l.a.Log(\"Skipping unknown axis at index: \" + n);\n            }\n            return i.pointingPoseNode = P(e, this._mapping.pointingPoseMeshName), i.pointingPoseNode ? this._pointingPoseNode = i.pointingPoseNode : l.a.Warn(\"Missing pointing pose mesh with name: \" + this._mapping.pointingPoseMeshName), i;\n            function P(B, F) {\n              return B.getChildren(function(z) {\n                return z.name === F;\n              }, !1)[0];\n            }\n            function R(B, F) {\n              return B.getChildren(function(z) {\n                return z.name == F;\n              }, !0)[0];\n            }\n          }, t.prototype.getForwardRay = function(e) {\n            if (e === void 0 && (e = 100), !this._loadedMeshInfo || !this._loadedMeshInfo.pointingPoseNode)\n              return r.prototype.getForwardRay.call(this, e);\n            var n = this._loadedMeshInfo.pointingPoseNode.getWorldMatrix(), i = n.getTranslation(), o = new u.e(0, 0, -1), a = u.e.TransformNormal(o, n), s = u.e.Normalize(a);\n            return new dn.a(i, s, e);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onTrackpadChangedObservable.clear(), this.onTrackpadValuesChangedObservable.clear();\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/microsoft/\", t.MODEL_LEFT_FILENAME = \"left.glb\", t.MODEL_RIGHT_FILENAME = \"right.glb\", t.GAMEPAD_ID_PREFIX = \"Spatial Controller (Spatial Interaction Source) \", t.GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/, t;\n        }(Oi), jf = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._mapping = { buttons: [\"trigger\", \"grip\", \"trackpad\", \"thumbstick\", \"menu\"], buttonMeshNames: { trigger: \"SELECT\", menu: \"MENU\", grip: \"GRASP\", thumbstick: \"THUMBSTICK_PRESS\", trackpad: \"TOUCHPAD_PRESS\" }, buttonObservableNames: { trigger: \"onTriggerStateChangedObservable\", menu: \"onSecondaryButtonStateChangedObservable\", grip: \"onMainButtonStateChangedObservable\", thumbstick: \"onThumbstickStateChangedObservable\", trackpad: \"onTrackpadChangedObservable\" }, axisMeshNames: [\"TOUCHPAD_TOUCH_X\", \"TOUCHPAD_TOUCH_Y\", \"THUMBSTICK_X\", \"THUMBSTICK_Y\"], pointingPoseMeshName: ar.POINTING_POSE }, n.thumbstickValues = { x: 0, y: 0 }, n.onThumbstickStateChangedObservable = new C.c(), n.onThumbstickValuesChangedObservable = new C.c(), n.onTrackpadChangedObservable = n.onPadStateChangedObservable, n.onTrackpadValuesChangedObservable = n.onPadValuesChangedObservable, n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onThumbstickButtonStateChangedObservable\", { get: function() {\n            return this.onThumbstickStateChangedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateTrackpad = function() {\n            !this.browserGamepad.axes || this.browserGamepad.axes[2] == this.thumbstickValues.x && this.browserGamepad.axes[3] == this.thumbstickValues.y || (this.trackpad.x = this.browserGamepad.axes[2], this.trackpad.y = this.browserGamepad.axes[3], this.onThumbstickValuesChangedObservable.notifyObservers(this.trackpad));\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onThumbstickStateChangedObservable.clear(), this.onThumbstickValuesChangedObservable.clear();\n          }, t;\n        }(Fo);\n        Ci._ControllerFactories.push({ canCreate: function(r) {\n          return r.id.indexOf(Fo.GAMEPAD_ID_PREFIX) === 0;\n        }, create: function(r) {\n          return new Fo(r);\n        } });\n        var Bo = f(75), fr = f(63), Ln = f(51), Cn = f(36), Kr = function(r) {\n          function t(e, n, i, o, a) {\n            var s, d, p, y, P, R, B;\n            n === void 0 && (n = I.a.Gray()), i === void 0 && (i = Cn.a.DefaultUtilityLayer), o === void 0 && (o = null), a === void 0 && (a = 1);\n            var F = r.call(this, i) || this;\n            F._pointerObserver = null, F.snapDistance = 0, F.onSnapObservable = new C.c(), F.uniformScaling = !1, F.sensitivity = 1, F._isEnabled = !0, F._parent = null, F._dragging = !1, F._tmpVector = new u.e(), F._tmpMatrix = new u.a(), F._tmpMatrix2 = new u.a(), F._parent = o, F._coloredMaterial = new Nt.a(\"\", i.utilityLayerScene), F._coloredMaterial.diffuseColor = n, F._coloredMaterial.specularColor = n.subtract(new I.a(0.1, 0.1, 0.1)), F._hoverMaterial = new Nt.a(\"\", i.utilityLayerScene), F._hoverMaterial.diffuseColor = I.a.Yellow(), F._disableMaterial = new Nt.a(\"\", i.utilityLayerScene), F._disableMaterial.diffuseColor = I.a.Gray(), F._disableMaterial.alpha = 0.4, F._gizmoMesh = new Ie.a(\"axis\", i.utilityLayerScene);\n            var z = F._createGizmoMesh(F._gizmoMesh, a), J = z.arrowMesh, ie = z.arrowTail, se = F._createGizmoMesh(F._gizmoMesh, a + 4, !0);\n            F._gizmoMesh.lookAt(F._rootMesh.position.add(e)), F._rootMesh.addChild(F._gizmoMesh), F._gizmoMesh.scaling.scaleInPlace(1 / 3);\n            var ce = J.position.clone(), ue = ie.position.clone(), fe = ie.scaling.clone(), ve = function(xe) {\n              var Le = xe * (3 / F._rootMesh.scaling.length()) * 6;\n              J.position.z += Le / 3.5, ie.scaling.y += Le, ie.position.z = J.position.z / 2;\n            }, Te = function() {\n              J.position.set(ce.x, ce.y, ce.z), ie.position.set(ue.x, ue.y, ue.z), ie.scaling.set(fe.x, fe.y, fe.z), F._dragging = !1;\n            };\n            F.dragBehavior = new fi.a({ dragAxis: e }), F.dragBehavior.moveAttached = !1, F._rootMesh.addBehavior(F.dragBehavior);\n            var Re = 0, Ae = new u.e(), Ee = { snapDistance: 0 };\n            F.dragBehavior.onDragObservable.add(function(xe) {\n              if (F.attachedNode) {\n                var Le = F.sensitivity * xe.dragDistance * (3 * F.scaleRatio / F._rootMesh.scaling.length()), Me = !1, we = 0;\n                F.uniformScaling ? (F.attachedNode.getWorldMatrix().decompose(Ae), Ae.normalize(), Ae.y < 0 && Ae.scaleInPlace(-1)) : Ae.copyFrom(e), F.snapDistance == 0 ? Ae.scaleToRef(Le, Ae) : (Re += Le, Math.abs(Re) > F.snapDistance ? (we = Math.floor(Math.abs(Re) / F.snapDistance), Re < 0 && (we *= -1), Re %= F.snapDistance, Ae.scaleToRef(F.snapDistance * we, Ae), Me = !0) : Ae.scaleInPlace(0)), u.a.ScalingToRef(1 + Ae.x, 1 + Ae.y, 1 + Ae.z, F._tmpMatrix2), F._tmpMatrix2.multiplyToRef(F.attachedNode.getWorldMatrix(), F._tmpMatrix), F._tmpMatrix.decompose(F._tmpVector), Math.abs(F._tmpVector.x) < 1e5 && Math.abs(F._tmpVector.y) < 1e5 && Math.abs(F._tmpVector.z) < 1e5 && F.attachedNode.getWorldMatrix().copyFrom(F._tmpMatrix), Me && (Ee.snapDistance = F.snapDistance * we, F.onSnapObservable.notifyObservers(Ee)), F._matrixChanged();\n              }\n            }), F.dragBehavior.onDragStartObservable.add(function() {\n              F._dragging = !0;\n            }), F.dragBehavior.onDragObservable.add(function(xe) {\n              return ve(xe.dragDistance);\n            }), F.dragBehavior.onDragEndObservable.add(Te), (p = (d = (s = o == null ? void 0 : o.uniformScaleGizmo) === null || s === void 0 ? void 0 : s.dragBehavior) === null || d === void 0 ? void 0 : d.onDragObservable) === null || p === void 0 || p.add(function(xe) {\n              return ve(xe.delta.y);\n            }), (R = (P = (y = o == null ? void 0 : o.uniformScaleGizmo) === null || y === void 0 ? void 0 : y.dragBehavior) === null || P === void 0 ? void 0 : P.onDragEndObservable) === null || R === void 0 || R.add(Te);\n            var Se = { gizmoMeshes: [J, ie], colliderMeshes: [se.arrowMesh, se.arrowTail], material: F._coloredMaterial, hoverMaterial: F._hoverMaterial, disableMaterial: F._disableMaterial, active: !1 };\n            (B = F._parent) === null || B === void 0 || B.addToAxisCache(F._gizmoMesh, Se), F._pointerObserver = i.utilityLayerScene.onPointerObservable.add(function(xe) {\n              var Le;\n              if (!F._customMeshSet && (F._isHovered = Se.colliderMeshes.indexOf((Le = xe == null ? void 0 : xe.pickInfo) === null || Le === void 0 ? void 0 : Le.pickedMesh) != -1, !F._parent)) {\n                var Me = F._isHovered || F._dragging ? F._hoverMaterial : F._coloredMaterial;\n                Se.gizmoMeshes.forEach(function(we) {\n                  we.material = Me, we.color && (we.color = Me.diffuseColor);\n                });\n              }\n            });\n            var De = i._getSharedGizmoLight();\n            return De.includedOnlyMeshes = De.includedOnlyMeshes.concat(F._rootMesh.getChildMeshes()), F;\n          }\n          return Object(c.d)(t, r), t.prototype._createGizmoMesh = function(e, n, i) {\n            i === void 0 && (i = !1);\n            var o = fr.a.CreateBox(\"yPosMesh\", { size: 0.4 * (1 + (n - 1) / 4) }, this.gizmoLayer.utilityLayerScene), a = ci.a.CreateCylinder(\"cylinder\", { diameterTop: 5e-3 * n, height: 0.275, diameterBottom: 5e-3 * n, tessellation: 96 }, this.gizmoLayer.utilityLayerScene);\n            return o.scaling.scaleInPlace(0.1), o.material = this._coloredMaterial, o.rotation.x = Math.PI / 2, o.position.z += 0.3, a.material = this._coloredMaterial, a.position.z += 0.1375, a.rotation.x = Math.PI / 2, i && (o.visibility = 0, a.visibility = 0), e.addChild(o), e.addChild(a), { arrowMesh: o, arrowTail: a };\n          }, t.prototype._attachedNodeChanged = function(e) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!e);\n          }, Object.defineProperty(t.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(e) {\n            this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh, this.attachedNode = this._parent.attachedNode) : (this.attachedMesh = null, this.attachedNode = null);\n          }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(e) {\n              e && e.dispose();\n            }), r.prototype.dispose.call(this);\n          }, t.prototype.setCustomMesh = function(e, n) {\n            var i = this;\n            n === void 0 && (n = !1), r.prototype.setCustomMesh.call(this, e), n && (this._rootMesh.getChildMeshes().forEach(function(o) {\n              o.material = i._coloredMaterial, o.color && (o.color = i._coloredMaterial.diffuseColor);\n            }), this._customMeshSet = !1);\n          }, t;\n        }(Ln.a), Nn = f(45), sn = f(40), Xl = function(r) {\n          function t(e, n) {\n            e === void 0 && (e = I.a.Gray()), n === void 0 && (n = Cn.a.DefaultKeepDepthUtilityLayer);\n            var i = r.call(this, n) || this;\n            i._boundingDimensions = new u.e(1, 1, 1), i._renderObserver = null, i._pointerObserver = null, i._scaleDragSpeed = 0.2, i._tmpQuaternion = new u.b(), i._tmpVector = new u.e(0, 0, 0), i._tmpRotationMatrix = new u.a(), i.ignoreChildren = !1, i.includeChildPredicate = null, i.rotationSphereSize = 0.1, i.scaleBoxSize = 0.1, i.fixedDragMeshScreenSize = !1, i.fixedDragMeshBoundsSize = !1, i.fixedDragMeshScreenSizeDistanceFactor = 10, i.onDragStartObservable = new C.c(), i.onScaleBoxDragObservable = new C.c(), i.onScaleBoxDragEndObservable = new C.c(), i.onRotationSphereDragObservable = new C.c(), i.onRotationSphereDragEndObservable = new C.c(), i.scalePivot = null, i._existingMeshScale = new u.e(), i._dragMesh = null, i.pointerDragBehavior = new fi.a(), i.updateScale = !1, i._anchorMesh = new Mt.a(\"anchor\", n.utilityLayerScene), i.coloredMaterial = new Nt.a(\"\", n.utilityLayerScene), i.coloredMaterial.disableLighting = !0, i.hoverColoredMaterial = new Nt.a(\"\", n.utilityLayerScene), i.hoverColoredMaterial.disableLighting = !0, i._lineBoundingBox = new Mt.a(\"\", n.utilityLayerScene), i._lineBoundingBox.rotationQuaternion = new u.b();\n            var o = [];\n            o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, 0), new u.e(i._boundingDimensions.x, 0, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, 0), new u.e(0, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, 0), new u.e(0, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, 0, 0), new u.e(i._boundingDimensions.x, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, 0, 0), new u.e(i._boundingDimensions.x, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, i._boundingDimensions.y, 0), new u.e(i._boundingDimensions.x, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, i._boundingDimensions.y, 0), new u.e(0, i._boundingDimensions.y, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, i._boundingDimensions.z), new u.e(i._boundingDimensions.x, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(0, 0, i._boundingDimensions.z), new u.e(0, i._boundingDimensions.y, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, i._boundingDimensions.y, i._boundingDimensions.z), new u.e(0, i._boundingDimensions.y, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, i._boundingDimensions.y, i._boundingDimensions.z), new u.e(i._boundingDimensions.x, 0, i._boundingDimensions.z)] }, n.utilityLayerScene)), o.push(sn.a.CreateLines(\"lines\", { points: [new u.e(i._boundingDimensions.x, i._boundingDimensions.y, i._boundingDimensions.z), new u.e(i._boundingDimensions.x, i._boundingDimensions.y, 0)] }, n.utilityLayerScene)), o.forEach(function(J) {\n              J.color = e, J.position.addInPlace(new u.e(-i._boundingDimensions.x / 2, -i._boundingDimensions.y / 2, -i._boundingDimensions.z / 2)), J.isPickable = !1, i._lineBoundingBox.addChild(J);\n            }), i._rootMesh.addChild(i._lineBoundingBox), i.setColor(e), i._rotateSpheresParent = new Mt.a(\"\", n.utilityLayerScene), i._rotateSpheresParent.rotationQuaternion = new u.b();\n            for (var a = function(J) {\n              var ie = Nn.a.CreateSphere(\"\", { diameter: 1 }, n.utilityLayerScene);\n              ie.rotationQuaternion = new u.b(), ie.material = s.coloredMaterial, (P = new fi.a({})).moveAttached = !1, P.updateDragPlane = !1, ie.addBehavior(P);\n              var se = new u.e(1, 0, 0), ce = 0;\n              P.onDragStartObservable.add(function() {\n                se.copyFrom(ie.forward), ce = 0;\n              }), P.onDragObservable.add(function(ue) {\n                if (i.onRotationSphereDragObservable.notifyObservers({}), i.attachedMesh) {\n                  var fe = i.attachedMesh.parent;\n                  if (fe && fe.scaling && fe.scaling.isNonUniformWithinEpsilon(1e-3))\n                    return void l.a.Warn(\"BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling\");\n                  Un.a._RemoveAndStorePivotPoint(i.attachedMesh);\n                  var ve = se, Te = ue.dragPlaneNormal.scale(u.e.Dot(ue.dragPlaneNormal, ve)), Re = ve.subtract(Te).normalizeToNew(), Ae = u.e.Dot(Re, ue.delta) < 0 ? Math.abs(ue.delta.length()) : -Math.abs(ue.delta.length());\n                  Ae = Ae / i._boundingDimensions.length() * i._anchorMesh.scaling.length(), i.attachedMesh.rotationQuaternion || (i.attachedMesh.rotationQuaternion = u.b.RotationYawPitchRoll(i.attachedMesh.rotation.y, i.attachedMesh.rotation.x, i.attachedMesh.rotation.z)), i._anchorMesh.rotationQuaternion || (i._anchorMesh.rotationQuaternion = u.b.RotationYawPitchRoll(i._anchorMesh.rotation.y, i._anchorMesh.rotation.x, i._anchorMesh.rotation.z)), ce += Ae, Math.abs(ce) <= 2 * Math.PI && (J >= 8 ? u.b.RotationYawPitchRollToRef(0, 0, Ae, i._tmpQuaternion) : J >= 4 ? u.b.RotationYawPitchRollToRef(Ae, 0, 0, i._tmpQuaternion) : u.b.RotationYawPitchRollToRef(0, Ae, 0, i._tmpQuaternion), i._anchorMesh.addChild(i.attachedMesh), i._anchorMesh.rotationQuaternion.multiplyToRef(i._tmpQuaternion, i._anchorMesh.rotationQuaternion), i._anchorMesh.removeChild(i.attachedMesh), i.attachedMesh.setParent(fe)), i.updateBoundingBox(), Un.a._RestorePivotPoint(i.attachedMesh);\n                }\n                i._updateDummy();\n              }), P.onDragStartObservable.add(function() {\n                i.onDragStartObservable.notifyObservers({}), i._selectNode(ie);\n              }), P.onDragEndObservable.add(function() {\n                i.onRotationSphereDragEndObservable.notifyObservers({}), i._selectNode(null), i._updateDummy();\n              }), s._rotateSpheresParent.addChild(ie);\n            }, s = this, d = 0; d < 12; d++)\n              a(d);\n            i._rootMesh.addChild(i._rotateSpheresParent), i._scaleBoxesParent = new Mt.a(\"\", n.utilityLayerScene), i._scaleBoxesParent.rotationQuaternion = new u.b();\n            for (var p = 0; p < 3; p++)\n              for (var y = 0; y < 3; y++)\n                for (var P, R = function() {\n                  var J = (p === 1 ? 1 : 0) + (y === 1 ? 1 : 0) + (F === 1 ? 1 : 0);\n                  if (J === 1 || J === 3)\n                    return \"continue\";\n                  var ie = fr.a.CreateBox(\"\", { size: 1 }, n.utilityLayerScene);\n                  ie.material = B.coloredMaterial, ie.metadata = J === 2;\n                  var se = new u.e(p - 1, y - 1, F - 1).normalize();\n                  (P = new fi.a({ dragAxis: se })).updateDragPlane = !1, P.moveAttached = !1, ie.addBehavior(P), P.onDragObservable.add(function(ce) {\n                    if (i.onScaleBoxDragObservable.notifyObservers({}), i.attachedMesh) {\n                      var ue = i.attachedMesh.parent;\n                      if (ue && ue.scaling && ue.scaling.isNonUniformWithinEpsilon(1e-3))\n                        return void l.a.Warn(\"BoundingBoxGizmo controls are not supported on child meshes with non-uniform parent scaling\");\n                      Un.a._RemoveAndStorePivotPoint(i.attachedMesh);\n                      var fe = ce.dragDistance / i._boundingDimensions.length() * i._anchorMesh.scaling.length(), ve = new u.e(fe, fe, fe);\n                      J === 2 && (ve.x *= Math.abs(se.x), ve.y *= Math.abs(se.y), ve.z *= Math.abs(se.z)), ve.scaleInPlace(i._scaleDragSpeed), i.updateBoundingBox(), i.scalePivot ? (i.attachedMesh.getWorldMatrix().getRotationMatrixToRef(i._tmpRotationMatrix), i._boundingDimensions.scaleToRef(0.5, i._tmpVector), u.e.TransformCoordinatesToRef(i._tmpVector, i._tmpRotationMatrix, i._tmpVector), i._anchorMesh.position.subtractInPlace(i._tmpVector), i._boundingDimensions.multiplyToRef(i.scalePivot, i._tmpVector), u.e.TransformCoordinatesToRef(i._tmpVector, i._tmpRotationMatrix, i._tmpVector), i._anchorMesh.position.addInPlace(i._tmpVector)) : (ie.absolutePosition.subtractToRef(i._anchorMesh.position, i._tmpVector), i._anchorMesh.position.subtractInPlace(i._tmpVector)), i._anchorMesh.addChild(i.attachedMesh), i._anchorMesh.scaling.addInPlace(ve), (i._anchorMesh.scaling.x < 0 || i._anchorMesh.scaling.y < 0 || i._anchorMesh.scaling.z < 0) && i._anchorMesh.scaling.subtractInPlace(ve), i._anchorMesh.removeChild(i.attachedMesh), i.attachedMesh.setParent(ue), Un.a._RestorePivotPoint(i.attachedMesh);\n                    }\n                    i._updateDummy();\n                  }), P.onDragStartObservable.add(function() {\n                    i.onDragStartObservable.notifyObservers({}), i._selectNode(ie);\n                  }), P.onDragEndObservable.add(function() {\n                    i.onScaleBoxDragEndObservable.notifyObservers({}), i._selectNode(null), i._updateDummy();\n                  }), B._scaleBoxesParent.addChild(ie);\n                }, B = this, F = 0; F < 3; F++)\n                  R();\n            i._rootMesh.addChild(i._scaleBoxesParent);\n            var z = new Array();\n            return i._pointerObserver = n.utilityLayerScene.onPointerObservable.add(function(J) {\n              z[J.event.pointerId] ? J.pickInfo && J.pickInfo.pickedMesh != z[J.event.pointerId] && (z[J.event.pointerId].material = i.coloredMaterial, delete z[J.event.pointerId]) : i._rotateSpheresParent.getChildMeshes().concat(i._scaleBoxesParent.getChildMeshes()).forEach(function(ie) {\n                J.pickInfo && J.pickInfo.pickedMesh == ie && (z[J.event.pointerId] = ie, ie.material = i.hoverColoredMaterial);\n              });\n            }), i._renderObserver = i.gizmoLayer.originalScene.onBeforeRenderObservable.add(function() {\n              i.attachedMesh && !i._existingMeshScale.equals(i.attachedMesh.scaling) ? i.updateBoundingBox() : (i.fixedDragMeshScreenSize || i.fixedDragMeshBoundsSize) && (i._updateRotationSpheres(), i._updateScaleBoxes()), i._dragMesh && i.attachedMesh && i.pointerDragBehavior.dragging && (i._lineBoundingBox.position.rotateByQuaternionToRef(i._rootMesh.rotationQuaternion, i._tmpVector), i.attachedMesh.setAbsolutePosition(i._dragMesh.position.add(i._tmpVector.scale(-1))));\n            }), i.updateBoundingBox(), i;\n          }\n          return Object(c.d)(t, r), t.prototype.setColor = function(e) {\n            this.coloredMaterial.emissiveColor = e, this.hoverColoredMaterial.emissiveColor = e.clone().add(new I.a(0.3, 0.3, 0.3)), this._lineBoundingBox.getChildren().forEach(function(n) {\n              n.color && (n.color = e);\n            });\n          }, t.prototype._attachedNodeChanged = function(e) {\n            var n = this;\n            if (e) {\n              Un.a._RemoveAndStorePivotPoint(e);\n              var i = e.parent;\n              this._anchorMesh.addChild(e), this._anchorMesh.removeChild(e), e.setParent(i), Un.a._RestorePivotPoint(e), this.updateBoundingBox(), e.getChildMeshes(!1).forEach(function(o) {\n                o.markAsDirty(\"scaling\");\n              }), this.gizmoLayer.utilityLayerScene.onAfterRenderObservable.addOnce(function() {\n                n._updateDummy();\n              });\n            }\n          }, t.prototype._selectNode = function(e) {\n            this._rotateSpheresParent.getChildMeshes().concat(this._scaleBoxesParent.getChildMeshes()).forEach(function(n) {\n              n.isVisible = !e || n == e;\n            });\n          }, t.prototype.updateBoundingBox = function() {\n            if (this.attachedMesh) {\n              Un.a._RemoveAndStorePivotPoint(this.attachedMesh);\n              var e = this.attachedMesh.parent;\n              this.attachedMesh.setParent(null);\n              var n = null;\n              this.attachedMesh.skeleton && (n = this.attachedMesh.skeleton.overrideMesh, this.attachedMesh.skeleton.overrideMesh = null), this._update(), this.attachedMesh.rotationQuaternion || (this.attachedMesh.rotationQuaternion = u.b.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z)), this._anchorMesh.rotationQuaternion || (this._anchorMesh.rotationQuaternion = u.b.RotationYawPitchRoll(this._anchorMesh.rotation.y, this._anchorMesh.rotation.x, this._anchorMesh.rotation.z)), this._anchorMesh.rotationQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion), this._tmpVector.copyFrom(this.attachedMesh.position), this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1), this.attachedMesh.position.set(0, 0, 0);\n              var i = this.attachedMesh.getHierarchyBoundingVectors(!this.ignoreChildren, this.includeChildPredicate);\n              i.max.subtractToRef(i.min, this._boundingDimensions), this._lineBoundingBox.scaling.copyFrom(this._boundingDimensions), this._lineBoundingBox.position.set((i.max.x + i.min.x) / 2, (i.max.y + i.min.y) / 2, (i.max.z + i.min.z) / 2), this._rotateSpheresParent.position.copyFrom(this._lineBoundingBox.position), this._scaleBoxesParent.position.copyFrom(this._lineBoundingBox.position), this._lineBoundingBox.computeWorldMatrix(), this._anchorMesh.position.copyFrom(this._lineBoundingBox.absolutePosition), this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion), this.attachedMesh.position.copyFrom(this._tmpVector), this.attachedMesh.setParent(e), this.attachedMesh.skeleton && (this.attachedMesh.skeleton.overrideMesh = n);\n            }\n            this._updateRotationSpheres(), this._updateScaleBoxes(), this.attachedMesh && (this._existingMeshScale.copyFrom(this.attachedMesh.scaling), Un.a._RestorePivotPoint(this.attachedMesh));\n          }, t.prototype._updateRotationSpheres = function() {\n            for (var e = this._rotateSpheresParent.getChildMeshes(), n = 0; n < 3; n++)\n              for (var i = 0; i < 2; i++)\n                for (var o = 0; o < 2; o++) {\n                  var a = 4 * n + 2 * i + o;\n                  if (n == 0 && (e[a].position.set(this._boundingDimensions.x / 2, this._boundingDimensions.y * i, this._boundingDimensions.z * o), e[a].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[a].lookAt(u.e.Cross(e[a].position.normalizeToNew(), u.e.Right()).normalizeToNew().add(e[a].position))), n == 1 && (e[a].position.set(this._boundingDimensions.x * i, this._boundingDimensions.y / 2, this._boundingDimensions.z * o), e[a].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[a].lookAt(u.e.Cross(e[a].position.normalizeToNew(), u.e.Up()).normalizeToNew().add(e[a].position))), n == 2 && (e[a].position.set(this._boundingDimensions.x * i, this._boundingDimensions.y * o, this._boundingDimensions.z / 2), e[a].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), e[a].lookAt(u.e.Cross(e[a].position.normalizeToNew(), u.e.Forward()).normalizeToNew().add(e[a].position))), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {\n                    e[a].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);\n                    var s = this.rotationSphereSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;\n                    e[a].scaling.set(s, s, s);\n                  } else\n                    this.fixedDragMeshBoundsSize ? e[a].scaling.set(this.rotationSphereSize * this._boundingDimensions.x, this.rotationSphereSize * this._boundingDimensions.y, this.rotationSphereSize * this._boundingDimensions.z) : e[a].scaling.set(this.rotationSphereSize, this.rotationSphereSize, this.rotationSphereSize);\n                }\n          }, t.prototype._updateScaleBoxes = function() {\n            for (var e = this._scaleBoxesParent.getChildMeshes(), n = 0, i = 0; i < 3; i++)\n              for (var o = 0; o < 3; o++)\n                for (var a = 0; a < 3; a++) {\n                  var s = (i === 1 ? 1 : 0) + (o === 1 ? 1 : 0) + (a === 1 ? 1 : 0);\n                  if (s !== 1 && s !== 3) {\n                    if (e[n])\n                      if (e[n].position.set(this._boundingDimensions.x * (i / 2), this._boundingDimensions.y * (o / 2), this._boundingDimensions.z * (a / 2)), e[n].position.addInPlace(new u.e(-this._boundingDimensions.x / 2, -this._boundingDimensions.y / 2, -this._boundingDimensions.z / 2)), this.fixedDragMeshScreenSize && this.gizmoLayer.utilityLayerScene.activeCamera) {\n                        e[n].absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);\n                        var d = this.scaleBoxSize * this._tmpVector.length() / this.fixedDragMeshScreenSizeDistanceFactor;\n                        e[n].scaling.set(d, d, d);\n                      } else\n                        this.fixedDragMeshBoundsSize ? e[n].scaling.set(this.scaleBoxSize * this._boundingDimensions.x, this.scaleBoxSize * this._boundingDimensions.y, this.scaleBoxSize * this._boundingDimensions.z) : e[n].scaling.set(this.scaleBoxSize, this.scaleBoxSize, this.scaleBoxSize);\n                    n++;\n                  }\n                }\n          }, t.prototype.setEnabledRotationAxis = function(e) {\n            this._rotateSpheresParent.getChildMeshes().forEach(function(n, i) {\n              i < 4 ? n.setEnabled(e.indexOf(\"x\") != -1) : i < 8 ? n.setEnabled(e.indexOf(\"y\") != -1) : n.setEnabled(e.indexOf(\"z\") != -1);\n            });\n          }, t.prototype.setEnabledScaling = function(e, n) {\n            n === void 0 && (n = !1), this._scaleBoxesParent.getChildMeshes().forEach(function(i, o) {\n              var a = e;\n              n && i.metadata === !0 && (a = !1), i.setEnabled(a);\n            });\n          }, t.prototype._updateDummy = function() {\n            this._dragMesh && (this._dragMesh.position.copyFrom(this._lineBoundingBox.getAbsolutePosition()), this._dragMesh.scaling.copyFrom(this._lineBoundingBox.scaling), this._dragMesh.rotationQuaternion.copyFrom(this._rootMesh.rotationQuaternion));\n          }, t.prototype.enableDragBehavior = function() {\n            this._dragMesh = Ie.a.CreateBox(\"dummy\", 1, this.gizmoLayer.utilityLayerScene), this._dragMesh.visibility = 0, this._dragMesh.rotationQuaternion = new u.b(), this.pointerDragBehavior.useObjectOrientationForDragging = !1, this._dragMesh.addBehavior(this.pointerDragBehavior);\n          }, t.prototype.dispose = function() {\n            this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver), this._lineBoundingBox.dispose(), this._rotateSpheresParent.dispose(), this._scaleBoxesParent.dispose(), this._dragMesh && this._dragMesh.dispose(), r.prototype.dispose.call(this);\n          }, t.MakeNotPickableAndWrapInBoundingBox = function(e) {\n            var n = function(d) {\n              d.isPickable = !1, d.getChildMeshes().forEach(function(p) {\n                n(p);\n              });\n            };\n            n(e), e.rotationQuaternion || (e.rotationQuaternion = u.b.RotationYawPitchRoll(e.rotation.y, e.rotation.x, e.rotation.z));\n            var i = e.position.clone(), o = e.rotationQuaternion.clone();\n            e.rotationQuaternion.set(0, 0, 0, 1), e.position.set(0, 0, 0);\n            var a = fr.a.CreateBox(\"box\", { size: 1 }, e.getScene()), s = e.getHierarchyBoundingVectors();\n            return s.max.subtractToRef(s.min, a.scaling), a.scaling.y === 0 && (a.scaling.y = Vt.a), a.scaling.x === 0 && (a.scaling.x = Vt.a), a.scaling.z === 0 && (a.scaling.z = Vt.a), a.position.set((s.max.x + s.min.x) / 2, (s.max.y + s.min.y) / 2, (s.max.z + s.min.z) / 2), e.addChild(a), e.rotationQuaternion.copyFrom(o), e.position.copyFrom(i), e.removeChild(a), a.addChild(e), a.visibility = 0, a;\n          }, t.prototype.setCustomMesh = function(e) {\n            l.a.Error(\"Custom meshes are not supported on this gizmo\");\n          }, t;\n        }(Ln.a), Uo = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p;\n            n === void 0 && (n = I.a.Gray()), i === void 0 && (i = Cn.a.DefaultUtilityLayer), o === void 0 && (o = 32), a === void 0 && (a = null), d === void 0 && (d = 1);\n            var y = r.call(this, i) || this;\n            y._pointerObserver = null, y.snapDistance = 0, y.onSnapObservable = new C.c(), y._isEnabled = !0, y._parent = null, y._dragging = !1, y._parent = a, y._coloredMaterial = new Nt.a(\"\", i.utilityLayerScene), y._coloredMaterial.diffuseColor = n, y._coloredMaterial.specularColor = n.subtract(new I.a(0.1, 0.1, 0.1)), y._hoverMaterial = new Nt.a(\"\", i.utilityLayerScene), y._hoverMaterial.diffuseColor = I.a.Yellow(), y._disableMaterial = new Nt.a(\"\", i.utilityLayerScene), y._disableMaterial.diffuseColor = I.a.Gray(), y._disableMaterial.alpha = 0.4, y._gizmoMesh = new Ie.a(\"\", i.utilityLayerScene);\n            var P = y._createGizmoMesh(y._gizmoMesh, d, o), R = P.rotationMesh, B = P.collider, F = [];\n            y._rotationCircle = y.setupRotationCircle(F, y._gizmoMesh), y._gizmoMesh.lookAt(y._rootMesh.position.add(e)), y._rootMesh.addChild(y._gizmoMesh), y._gizmoMesh.scaling.scaleInPlace(1 / 3), y.dragBehavior = new fi.a({ dragPlaneNormal: e }), y.dragBehavior.moveAttached = !1, y.dragBehavior.maxDragAngle = 9 * Math.PI / 20, y.dragBehavior._useAlternatePickedPointAboveMaxDragAngle = !0, y._rootMesh.addBehavior(y.dragBehavior);\n            var z = 0, J = new u.e(), ie = new u.e(), se = new u.a(), ce = new u.e(), ue = new u.e();\n            y.dragBehavior.onDragStartObservable.add(function(Se) {\n              if (y.attachedNode) {\n                J.copyFrom(Se.dragPlanePoint);\n                var De = new u.e(0, 0, 1), xe = y._rotationCircle.getDirection(De);\n                xe.normalize(), y._gizmoMesh.removeChild(y._rotationCircle), J.copyFrom(Se.dragPlanePoint), ie = Se.dragPlanePoint;\n                var Le = y._rotationCircle.getAbsolutePosition().clone(), Me = y._rotationCircle.getAbsolutePosition().clone().addInPlace(xe), we = Se.dragPlanePoint, Ye = u.e.GetAngleBetweenVectors(Me.subtract(Le), we.subtract(Le), y._rotationCircle.up);\n                y._rotationCircle.addRotation(0, Ye, 0), y._dragging = !0;\n              }\n            }), y.dragBehavior.onDragEndObservable.add(function() {\n              z = 0, y.updateRotationCircle(y._rotationCircle, F, z, ie), y._gizmoMesh.addChild(y._rotationCircle), y._dragging = !1;\n            });\n            var fe = { snapDistance: 0 }, ve = 0, Te = new u.a(), Re = new u.b();\n            y.dragBehavior.onDragObservable.add(function(Se) {\n              if (y.attachedNode) {\n                var De = new u.e(1, 1, 1), xe = new u.b(0, 0, 0, 1), Le = new u.e(0, 0, 0);\n                y.attachedNode.getWorldMatrix().decompose(De, xe, Le);\n                var Me = Se.dragPlanePoint.subtract(Le).normalize(), we = J.subtract(Le).normalize(), Ye = u.e.Cross(Me, we), et = u.e.Dot(Me, we), nt = Math.atan2(Ye.length(), et);\n                ce.copyFrom(e), ue.copyFrom(e), y.updateGizmoRotationToMatchAttachedMesh && (xe.toRotationMatrix(se), ue = u.e.TransformCoordinates(ce, se));\n                var ct = !1;\n                if (i.utilityLayerScene.activeCamera) {\n                  var Ke = i.utilityLayerScene.activeCamera.position.subtract(Le);\n                  u.e.Dot(Ke, ue) > 0 && (ce.scaleInPlace(-1), ue.scaleInPlace(-1), ct = !0);\n                }\n                u.e.Dot(ue, Ye) > 0 && (nt = -nt);\n                var rt = !1;\n                if (y.snapDistance != 0)\n                  if (ve += nt, Math.abs(ve) > y.snapDistance) {\n                    var it = Math.floor(Math.abs(ve) / y.snapDistance);\n                    ve < 0 && (it *= -1), ve %= y.snapDistance, nt = y.snapDistance * it, rt = !0;\n                  } else\n                    nt = 0;\n                z += ct ? -nt : nt, y.updateRotationCircle(y._rotationCircle, F, z, ie);\n                var qe = Math.sin(nt / 2);\n                if (Re.set(ce.x * qe, ce.y * qe, ce.z * qe, Math.cos(nt / 2)), Te.determinant() > 0) {\n                  var ut = new u.e();\n                  Re.toEulerAnglesToRef(ut), u.b.RotationYawPitchRollToRef(ut.y, -ut.x, -ut.z, Re);\n                }\n                y.updateGizmoRotationToMatchAttachedMesh ? xe.multiplyToRef(Re, xe) : Re.multiplyToRef(xe, xe), y.attachedNode.getWorldMatrix().copyFrom(u.a.Compose(De, xe, Le)), J.copyFrom(Se.dragPlanePoint), rt && (fe.snapDistance = nt, y.onSnapObservable.notifyObservers(fe)), y._matrixChanged();\n              }\n            });\n            var Ae = i._getSharedGizmoLight();\n            Ae.includedOnlyMeshes = Ae.includedOnlyMeshes.concat(y._rootMesh.getChildMeshes(!1));\n            var Ee = { colliderMeshes: [B], gizmoMeshes: [R], material: y._coloredMaterial, hoverMaterial: y._hoverMaterial, disableMaterial: y._disableMaterial, active: !1 };\n            return (p = y._parent) === null || p === void 0 || p.addToAxisCache(y._gizmoMesh, Ee), y._pointerObserver = i.utilityLayerScene.onPointerObservable.add(function(Se) {\n              var De;\n              if (!y._customMeshSet && (y._isHovered = Ee.colliderMeshes.indexOf((De = Se == null ? void 0 : Se.pickInfo) === null || De === void 0 ? void 0 : De.pickedMesh) != -1, !y._parent)) {\n                var xe = y._isHovered || y._dragging ? y._hoverMaterial : y._coloredMaterial;\n                Ee.gizmoMeshes.forEach(function(Le) {\n                  Le.material = xe, Le.color && (Le.color = xe.diffuseColor);\n                });\n              }\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype._createGizmoMesh = function(e, n, i) {\n            var o = Ie.a.CreateTorus(\"ignore\", 0.6, 0.03 * n, i, this.gizmoLayer.utilityLayerScene);\n            o.visibility = 0;\n            var a = Ie.a.CreateTorus(\"\", 0.6, 5e-3 * n, i, this.gizmoLayer.utilityLayerScene);\n            return a.material = this._coloredMaterial, a.rotation.x = Math.PI / 2, o.rotation.x = Math.PI / 2, e.addChild(a), e.addChild(o), { rotationMesh: a, collider: o };\n          }, t.prototype._attachedNodeChanged = function(e) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!e);\n          }, t.prototype.setupRotationCircle = function(e, n) {\n            for (var i = t._CircleConstants.pi2 / t._CircleConstants.tessellation, o = -Math.PI / 2; o < Math.PI / 2 - 1.5; o += i / 2) {\n              for (var a = [], s = 0; s < t._CircleConstants.pi2 * t._CircleConstants.rotationCircleRange + 0.01; s += i)\n                if (s < 0) {\n                  var d = t._CircleConstants.radius * Math.sin(s) * Math.cos(o), p = t._CircleConstants.radius * Math.cos(s) * Math.cos(o);\n                  a.push(new u.e(d, 0, p));\n                } else\n                  a.push(new u.e(0, 0, 0));\n              e.push(a);\n            }\n            var y = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene);\n            y.diffuseColor = I.a.Yellow(), y.backFaceCulling = !1;\n            var P = Ie.a.CreateRibbon(\"rotationCircle\", e, !1, !1, 0, this.gizmoLayer.utilityLayerScene, !0);\n            return P.material = y, P.material.alpha = 0.25, P.rotation.x = Math.PI / 2, n.addChild(P), P;\n          }, t.prototype.updateRotationPath = function(e, n) {\n            for (var i = t._CircleConstants.pi2 / t._CircleConstants.tessellation, o = 0, a = -Math.PI / 2; a < Math.PI / 2 - 1.5; a += i / 2) {\n              var s = e[o];\n              if (s)\n                for (var d = 0, p = 0; p < t._CircleConstants.pi2 * t._CircleConstants.rotationCircleRange + 0.01; p += i) {\n                  if (s[d])\n                    if (p < Math.abs(n)) {\n                      var y = n > 0 ? p : -1 * p, P = n > 0 ? a : -1 * a;\n                      s[d].set(t._CircleConstants.radius * Math.sin(y) * Math.cos(P), 0, t._CircleConstants.radius * Math.cos(y) * Math.cos(P));\n                    } else\n                      s[d].set(0, 0, 0);\n                  d++;\n                }\n              o++;\n            }\n          }, t.prototype.updateRotationCircle = function(e, n, i, o) {\n            this.updateRotationPath(n, i), Ie.a.CreateRibbon(\"rotationCircle\", n, !1, !1, 0, this.gizmoLayer.utilityLayerScene, void 0, void 0, e.geometry ? e : void 0);\n          }, Object.defineProperty(t.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(e) {\n            this._isEnabled = e, e ? this._parent && (this.attachedMesh = this._parent.attachedMesh) : this.attachedMesh = null;\n          }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), this._gizmoMesh && this._gizmoMesh.dispose(), this._rotationCircle && this._rotationCircle.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(e) {\n              e && e.dispose();\n            }), r.prototype.dispose.call(this);\n          }, t._CircleConstants = { radius: 0.3, pi2: 2 * Math.PI, tessellation: 70, rotationCircleRange: 4 }, t;\n        }(Ln.a), Yl = function(r) {\n          function t(e, n, i, o, a) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer), n === void 0 && (n = 32), i === void 0 && (i = !1), o === void 0 && (o = 1);\n            var s = r.call(this, e) || this;\n            return s.onDragStartObservable = new C.c(), s.onDragEndObservable = new C.c(), s._observables = [], s._gizmoAxisCache = /* @__PURE__ */ new Map(), s.xGizmo = new Uo(new u.e(1, 0, 0), I.a.Red().scale(0.5), e, n, s, i, o), s.yGizmo = new Uo(new u.e(0, 1, 0), I.a.Green().scale(0.5), e, n, s, i, o), s.zGizmo = new Uo(new u.e(0, 0, 1), I.a.Blue().scale(0.5), e, n, s, i, o), [s.xGizmo, s.yGizmo, s.zGizmo].forEach(function(d) {\n              d.dragBehavior.onDragStartObservable.add(function() {\n                s.onDragStartObservable.notifyObservers({});\n              }), d.dragBehavior.onDragEndObservable.add(function() {\n                s.onDragEndObservable.notifyObservers({});\n              });\n            }), s.attachedMesh = null, s.attachedNode = null, a ? a.addToAxisCache(s._gizmoAxisCache) : Ln.a.GizmoAxisPointerObserver(e, s._gizmoAxisCache), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"attachedMesh\", { get: function() {\n            return this._meshAttached;\n          }, set: function(e) {\n            this._meshAttached = e, this._nodeAttached = e, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedMesh = e : n.attachedMesh = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"attachedNode\", { get: function() {\n            return this._nodeAttached;\n          }, set: function(e) {\n            this._meshAttached = null, this._nodeAttached = e, this._checkBillboardTransform(), [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedNode = e : n.attachedNode = null;\n            });\n          }, enumerable: !1, configurable: !0 }), t.prototype._checkBillboardTransform = function() {\n            this._nodeAttached && this._nodeAttached.billboardMode && console.log(\"Rotation Gizmo will not work with transforms in billboard mode.\");\n          }, Object.defineProperty(t.prototype, \"isHovered\", { get: function() {\n            var e = !1;\n            return [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              e = e || n.isHovered;\n            }), e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this.xGizmo.updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(e) {\n            this.xGizmo && (this.xGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.yGizmo.updateGizmoRotationToMatchAttachedMesh = e, this.zGizmo.updateGizmoRotationToMatchAttachedMesh = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapDistance\", { get: function() {\n            return this.xGizmo.snapDistance;\n          }, set: function(e) {\n            this.xGizmo && (this.xGizmo.snapDistance = e, this.yGizmo.snapDistance = e, this.zGizmo.snapDistance = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaleRatio\", { get: function() {\n            return this.xGizmo.scaleRatio;\n          }, set: function(e) {\n            this.xGizmo && (this.xGizmo.scaleRatio = e, this.yGizmo.scaleRatio = e, this.zGizmo.scaleRatio = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.addToAxisCache = function(e, n) {\n            this._gizmoAxisCache.set(e, n);\n          }, t.prototype.dispose = function() {\n            var e = this;\n            this.xGizmo.dispose(), this.yGizmo.dispose(), this.zGizmo.dispose(), this.onDragStartObservable.clear(), this.onDragEndObservable.clear(), this._observables.forEach(function(n) {\n              e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(n);\n            });\n          }, t.prototype.setCustomMesh = function(e) {\n            l.a.Error(\"Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)\");\n          }, t;\n        }(Ln.a), pr = f(46), gs = f(84), Vo = function(r) {\n          function t(e, n, i, o) {\n            var a;\n            n === void 0 && (n = I.a.Gray()), i === void 0 && (i = Cn.a.DefaultUtilityLayer), o === void 0 && (o = null);\n            var s = r.call(this, i) || this;\n            s._pointerObserver = null, s.snapDistance = 0, s.onSnapObservable = new C.c(), s._isEnabled = !1, s._parent = null, s._dragging = !1, s._parent = o, s._coloredMaterial = new Nt.a(\"\", i.utilityLayerScene), s._coloredMaterial.diffuseColor = n, s._coloredMaterial.specularColor = n.subtract(new I.a(0.1, 0.1, 0.1)), s._hoverMaterial = new Nt.a(\"\", i.utilityLayerScene), s._hoverMaterial.diffuseColor = I.a.Yellow(), s._disableMaterial = new Nt.a(\"\", i.utilityLayerScene), s._disableMaterial.diffuseColor = I.a.Gray(), s._disableMaterial.alpha = 0.4, s._gizmoMesh = t._CreatePlane(i.utilityLayerScene, s._coloredMaterial), s._gizmoMesh.lookAt(s._rootMesh.position.add(e)), s._gizmoMesh.scaling.scaleInPlace(1 / 3), s._gizmoMesh.parent = s._rootMesh;\n            var d = 0, p = new u.e(), y = { snapDistance: 0 };\n            s.dragBehavior = new fi.a({ dragPlaneNormal: e }), s.dragBehavior.moveAttached = !1, s._rootMesh.addBehavior(s.dragBehavior), s.dragBehavior.onDragObservable.add(function(B) {\n              if (s.attachedNode) {\n                if (s.snapDistance == 0)\n                  s.attachedNode.getWorldMatrix().addTranslationFromFloats(B.delta.x, B.delta.y, B.delta.z);\n                else if (d += B.dragDistance, Math.abs(d) > s.snapDistance) {\n                  var F = Math.floor(Math.abs(d) / s.snapDistance);\n                  d %= s.snapDistance, B.delta.normalizeToRef(p), p.scaleInPlace(s.snapDistance * F), s.attachedNode.getWorldMatrix().addTranslationFromFloats(p.x, p.y, p.z), y.snapDistance = s.snapDistance * F, s.onSnapObservable.notifyObservers(y);\n                }\n                s._matrixChanged();\n              }\n            }), s.dragBehavior.onDragStartObservable.add(function() {\n              s._dragging = !0;\n            }), s.dragBehavior.onDragEndObservable.add(function() {\n              s._dragging = !1;\n            });\n            var P = i._getSharedGizmoLight();\n            P.includedOnlyMeshes = P.includedOnlyMeshes.concat(s._rootMesh.getChildMeshes(!1));\n            var R = { gizmoMeshes: s._gizmoMesh.getChildMeshes(), colliderMeshes: s._gizmoMesh.getChildMeshes(), material: s._coloredMaterial, hoverMaterial: s._hoverMaterial, disableMaterial: s._disableMaterial, active: !1 };\n            return (a = s._parent) === null || a === void 0 || a.addToAxisCache(s._gizmoMesh, R), s._pointerObserver = i.utilityLayerScene.onPointerObservable.add(function(B) {\n              var F;\n              if (!s._customMeshSet && (s._isHovered = R.colliderMeshes.indexOf((F = B == null ? void 0 : B.pickInfo) === null || F === void 0 ? void 0 : F.pickedMesh) != -1, !s._parent)) {\n                var z = s._isHovered || s._dragging ? s._hoverMaterial : s._coloredMaterial;\n                R.gizmoMeshes.forEach(function(J) {\n                  J.material = z;\n                });\n              }\n            }), s;\n          }\n          return Object(c.d)(t, r), t._CreatePlane = function(e, n) {\n            var i = new pr.a(\"plane\", e), o = gs.a.CreatePlane(\"dragPlane\", { width: 0.1375, height: 0.1375, sideOrientation: 2 }, e);\n            return o.material = n, o.parent = i, i;\n          }, t.prototype._attachedNodeChanged = function(e) {\n            this.dragBehavior && (this.dragBehavior.enabled = !!e);\n          }, Object.defineProperty(t.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(e) {\n            this._isEnabled = e, e ? this._parent && (this.attachedNode = this._parent.attachedNode) : this.attachedNode = null;\n          }, enumerable: !1, configurable: !0 }), t.prototype.dispose = function() {\n            this.onSnapObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this.dragBehavior.detach(), r.prototype.dispose.call(this), this._gizmoMesh && this._gizmoMesh.dispose(), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(e) {\n              e && e.dispose();\n            });\n          }, t;\n        }(Ln.a), Kl = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer), n === void 0 && (n = 1);\n            var o = r.call(this, e) || this;\n            return o._meshAttached = null, o._nodeAttached = null, o._observables = [], o._gizmoAxisCache = /* @__PURE__ */ new Map(), o.onDragStartObservable = new C.c(), o.onDragEndObservable = new C.c(), o._planarGizmoEnabled = !1, o.xGizmo = new Bo.a(new u.e(1, 0, 0), I.a.Red().scale(0.5), e, o, n), o.yGizmo = new Bo.a(new u.e(0, 1, 0), I.a.Green().scale(0.5), e, o, n), o.zGizmo = new Bo.a(new u.e(0, 0, 1), I.a.Blue().scale(0.5), e, o, n), o.xPlaneGizmo = new Vo(new u.e(1, 0, 0), I.a.Red().scale(0.5), o.gizmoLayer, o), o.yPlaneGizmo = new Vo(new u.e(0, 1, 0), I.a.Green().scale(0.5), o.gizmoLayer, o), o.zPlaneGizmo = new Vo(new u.e(0, 0, 1), I.a.Blue().scale(0.5), o.gizmoLayer, o), [o.xGizmo, o.yGizmo, o.zGizmo, o.xPlaneGizmo, o.yPlaneGizmo, o.zPlaneGizmo].forEach(function(a) {\n              a.dragBehavior.onDragStartObservable.add(function() {\n                o.onDragStartObservable.notifyObservers({});\n              }), a.dragBehavior.onDragEndObservable.add(function() {\n                o.onDragEndObservable.notifyObservers({});\n              });\n            }), o.attachedMesh = null, i ? i.addToAxisCache(o._gizmoAxisCache) : Ln.a.GizmoAxisPointerObserver(e, o._gizmoAxisCache), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"attachedMesh\", { get: function() {\n            return this._meshAttached;\n          }, set: function(e) {\n            this._meshAttached = e, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedMesh = e : n.attachedMesh = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"attachedNode\", { get: function() {\n            return this._nodeAttached;\n          }, set: function(e) {\n            this._meshAttached = null, this._nodeAttached = null, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedNode = e : n.attachedNode = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isHovered\", { get: function() {\n            var e = !1;\n            return [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              e = e || n.isHovered;\n            }), e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"planarGizmoEnabled\", { get: function() {\n            return this._planarGizmoEnabled;\n          }, set: function(e) {\n            var n = this;\n            this._planarGizmoEnabled = e, [this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(i) {\n              i && (i.isEnabled = e, e && (i.attachedMesh ? i.attachedMesh = n.attachedMesh : i.attachedNode = n.attachedNode));\n            }, this);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this._updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(e) {\n            this._updateGizmoRotationToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && (n.updateGizmoRotationToMatchAttachedMesh = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapDistance\", { get: function() {\n            return this._snapDistance;\n          }, set: function(e) {\n            this._snapDistance = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && (n.snapDistance = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaleRatio\", { get: function() {\n            return this._scaleRatio;\n          }, set: function(e) {\n            this._scaleRatio = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && (n.scaleRatio = e);\n            });\n          }, enumerable: !1, configurable: !0 }), t.prototype.addToAxisCache = function(e, n) {\n            this._gizmoAxisCache.set(e, n);\n          }, t.prototype.dispose = function() {\n            var e = this;\n            [this.xGizmo, this.yGizmo, this.zGizmo, this.xPlaneGizmo, this.yPlaneGizmo, this.zPlaneGizmo].forEach(function(n) {\n              n && n.dispose();\n            }), this._observables.forEach(function(n) {\n              e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(n);\n            }), this.onDragStartObservable.clear(), this.onDragEndObservable.clear();\n          }, t.prototype.setCustomMesh = function(e) {\n            l.a.Error(\"Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo,gizmo.xPlaneGizmo, gizmo.yPlaneGizmo, gizmo.zPlaneGizmo)\");\n          }, t;\n        }(Ln.a);\n        ht.a.CreatePolyhedron = function(r) {\n          var t = [];\n          t[0] = { vertex: [[0, 0, 1.732051], [1.632993, 0, -0.5773503], [-0.8164966, 1.414214, -0.5773503], [-0.8164966, -1.414214, -0.5773503]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 1], [1, 3, 2]] }, t[1] = { vertex: [[0, 0, 1.414214], [1.414214, 0, 0], [0, 1.414214, 0], [-1.414214, 0, 0], [0, -1.414214, 0], [0, 0, -1.414214]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [3, 5, 4]] }, t[2] = { vertex: [[0, 0, 1.070466], [0.7136442, 0, 0.7978784], [-0.3568221, 0.618034, 0.7978784], [-0.3568221, -0.618034, 0.7978784], [0.7978784, 0.618034, 0.3568221], [0.7978784, -0.618034, 0.3568221], [-0.9341724, 0.381966, 0.3568221], [0.1362939, 1, 0.3568221], [0.1362939, -1, 0.3568221], [-0.9341724, -0.381966, 0.3568221], [0.9341724, 0.381966, -0.3568221], [0.9341724, -0.381966, -0.3568221], [-0.7978784, 0.618034, -0.3568221], [-0.1362939, 1, -0.3568221], [-0.1362939, -1, -0.3568221], [-0.7978784, -0.618034, -0.3568221], [0.3568221, 0.618034, -0.7978784], [0.3568221, -0.618034, -0.7978784], [-0.7136442, 0, -0.7978784], [0, 0, -1.070466]], face: [[0, 1, 4, 7, 2], [0, 2, 6, 9, 3], [0, 3, 8, 5, 1], [1, 5, 11, 10, 4], [2, 7, 13, 12, 6], [3, 9, 15, 14, 8], [4, 10, 16, 13, 7], [5, 8, 14, 17, 11], [6, 12, 18, 15, 9], [10, 11, 17, 19, 16], [12, 13, 16, 19, 18], [14, 15, 18, 19, 17]] }, t[3] = { vertex: [[0, 0, 1.175571], [1.051462, 0, 0.5257311], [0.3249197, 1, 0.5257311], [-0.8506508, 0.618034, 0.5257311], [-0.8506508, -0.618034, 0.5257311], [0.3249197, -1, 0.5257311], [0.8506508, 0.618034, -0.5257311], [0.8506508, -0.618034, -0.5257311], [-0.3249197, 1, -0.5257311], [-1.051462, 0, -0.5257311], [-0.3249197, -1, -0.5257311], [0, 0, -1.175571]], face: [[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 5, 7], [1, 7, 6], [1, 6, 2], [2, 6, 8], [2, 8, 3], [3, 8, 9], [3, 9, 4], [4, 9, 10], [4, 10, 5], [5, 10, 7], [6, 7, 11], [6, 11, 8], [7, 10, 11], [8, 11, 9], [9, 11, 10]] }, t[4] = { vertex: [[0, 0, 1.070722], [0.7148135, 0, 0.7971752], [-0.104682, 0.7071068, 0.7971752], [-0.6841528, 0.2071068, 0.7971752], [-0.104682, -0.7071068, 0.7971752], [0.6101315, 0.7071068, 0.5236279], [1.04156, 0.2071068, 0.1367736], [0.6101315, -0.7071068, 0.5236279], [-0.3574067, 1, 0.1367736], [-0.7888348, -0.5, 0.5236279], [-0.9368776, 0.5, 0.1367736], [-0.3574067, -1, 0.1367736], [0.3574067, 1, -0.1367736], [0.9368776, -0.5, -0.1367736], [0.7888348, 0.5, -0.5236279], [0.3574067, -1, -0.1367736], [-0.6101315, 0.7071068, -0.5236279], [-1.04156, -0.2071068, -0.1367736], [-0.6101315, -0.7071068, -0.5236279], [0.104682, 0.7071068, -0.7971752], [0.6841528, -0.2071068, -0.7971752], [0.104682, -0.7071068, -0.7971752], [-0.7148135, 0, -0.7971752], [0, 0, -1.070722]], face: [[0, 2, 3], [1, 6, 5], [4, 9, 11], [7, 15, 13], [8, 16, 10], [12, 14, 19], [17, 22, 18], [20, 21, 23], [0, 1, 5, 2], [0, 3, 9, 4], [0, 4, 7, 1], [1, 7, 13, 6], [2, 5, 12, 8], [2, 8, 10, 3], [3, 10, 17, 9], [4, 11, 15, 7], [5, 6, 14, 12], [6, 13, 20, 14], [8, 12, 19, 16], [9, 17, 18, 11], [10, 16, 22, 17], [11, 18, 21, 15], [13, 15, 21, 20], [14, 20, 23, 19], [16, 19, 23, 22], [18, 22, 23, 21]] }, t[5] = { vertex: [[0, 0, 1.322876], [1.309307, 0, 0.1889822], [-0.9819805, 0.8660254, 0.1889822], [0.1636634, -1.299038, 0.1889822], [0.3273268, 0.8660254, -0.9449112], [-0.8183171, -0.4330127, -0.9449112]], face: [[0, 3, 1], [2, 4, 5], [0, 1, 4, 2], [0, 2, 5, 3], [1, 3, 5, 4]] }, t[6] = { vertex: [[0, 0, 1.159953], [1.013464, 0, 0.5642542], [-0.3501431, 0.9510565, 0.5642542], [-0.7715208, -0.6571639, 0.5642542], [0.6633206, 0.9510565, -0.03144481], [0.8682979, -0.6571639, -0.3996071], [-1.121664, 0.2938926, -0.03144481], [-0.2348831, -1.063314, -0.3996071], [0.5181548, 0.2938926, -0.9953061], [-0.5850262, -0.112257, -0.9953061]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 9, 7], [5, 7, 9, 8], [0, 3, 7, 5, 1], [2, 4, 8, 9, 6]] }, t[7] = { vertex: [[0, 0, 1.118034], [0.8944272, 0, 0.6708204], [-0.2236068, 0.8660254, 0.6708204], [-0.7826238, -0.4330127, 0.6708204], [0.6708204, 0.8660254, 0.2236068], [1.006231, -0.4330127, -0.2236068], [-1.006231, 0.4330127, 0.2236068], [-0.6708204, -0.8660254, -0.2236068], [0.7826238, 0.4330127, -0.6708204], [0.2236068, -0.8660254, -0.6708204], [-0.8944272, 0, -0.6708204], [0, 0, -1.118034]], face: [[0, 1, 4, 2], [0, 2, 6, 3], [1, 5, 8, 4], [3, 6, 10, 7], [5, 9, 11, 8], [7, 10, 11, 9], [0, 3, 7, 9, 5, 1], [2, 4, 8, 11, 10, 6]] }, t[8] = { vertex: [[-0.729665, 0.670121, 0.319155], [-0.655235, -0.29213, -0.754096], [-0.093922, -0.607123, 0.537818], [0.702196, 0.595691, 0.485187], [0.776626, -0.36656, -0.588064]], face: [[1, 4, 2], [0, 1, 2], [3, 0, 2], [4, 3, 2], [4, 1, 0, 3]] }, t[9] = { vertex: [[-0.868849, -0.100041, 0.61257], [-0.329458, 0.976099, 0.28078], [-0.26629, -0.013796, -0.477654], [-0.13392, -1.034115, 0.229829], [0.738834, 0.707117, -0.307018], [0.859683, -0.535264, -0.338508]], face: [[3, 0, 2], [5, 3, 2], [4, 5, 2], [1, 4, 2], [0, 1, 2], [0, 3, 5, 4, 1]] }, t[10] = { vertex: [[-0.610389, 0.243975, 0.531213], [-0.187812, -0.48795, -0.664016], [-0.187812, 0.9759, -0.664016], [0.187812, -0.9759, 0.664016], [0.798201, 0.243975, 0.132803]], face: [[1, 3, 0], [3, 4, 0], [3, 1, 4], [0, 2, 1], [0, 4, 2], [2, 4, 1]] }, t[11] = { vertex: [[-1.028778, 0.392027, -0.048786], [-0.640503, -0.646161, 0.621837], [-0.125162, -0.395663, -0.540059], [4683e-6, 0.888447, -0.651988], [0.125161, 0.395663, 0.540059], [0.632925, -0.791376, 0.433102], [1.031672, 0.157063, -0.354165]], face: [[3, 2, 0], [2, 1, 0], [2, 5, 1], [0, 4, 3], [0, 1, 4], [4, 1, 5], [2, 3, 6], [3, 4, 6], [5, 2, 6], [4, 5, 6]] }, t[12] = { vertex: [[-0.669867, 0.334933, -0.529576], [-0.669867, 0.334933, 0.529577], [-0.4043, 1.212901, 0], [-0.334933, -0.669867, -0.529576], [-0.334933, -0.669867, 0.529577], [0.334933, 0.669867, -0.529576], [0.334933, 0.669867, 0.529577], [0.4043, -1.212901, 0], [0.669867, -0.334933, -0.529576], [0.669867, -0.334933, 0.529577]], face: [[8, 9, 7], [6, 5, 2], [3, 8, 7], [5, 0, 2], [4, 3, 7], [0, 1, 2], [9, 4, 7], [1, 6, 2], [9, 8, 5, 6], [8, 3, 0, 5], [3, 4, 1, 0], [4, 9, 6, 1]] }, t[13] = { vertex: [[-0.931836, 0.219976, -0.264632], [-0.636706, 0.318353, 0.692816], [-0.613483, -0.735083, -0.264632], [-0.326545, 0.979634, 0], [-0.318353, -0.636706, 0.692816], [-0.159176, 0.477529, -0.856368], [0.159176, -0.477529, -0.856368], [0.318353, 0.636706, 0.692816], [0.326545, -0.979634, 0], [0.613482, 0.735082, -0.264632], [0.636706, -0.318353, 0.692816], [0.931835, -0.219977, -0.264632]], face: [[11, 10, 8], [7, 9, 3], [6, 11, 8], [9, 5, 3], [2, 6, 8], [5, 0, 3], [4, 2, 8], [0, 1, 3], [10, 4, 8], [1, 7, 3], [10, 11, 9, 7], [11, 6, 5, 9], [6, 2, 0, 5], [2, 4, 1, 0], [4, 10, 7, 1]] }, t[14] = { vertex: [[-0.93465, 0.300459, -0.271185], [-0.838689, -0.260219, -0.516017], [-0.711319, 0.717591, 0.128359], [-0.710334, -0.156922, 0.080946], [-0.599799, 0.556003, -0.725148], [-0.503838, -4675e-6, -0.969981], [-0.487004, 0.26021, 0.48049], [-0.460089, -0.750282, -0.512622], [-0.376468, 0.973135, -0.325605], [-0.331735, -0.646985, 0.084342], [-0.254001, 0.831847, 0.530001], [-0.125239, -0.494738, -0.966586], [0.029622, 0.027949, 0.730817], [0.056536, -0.982543, -0.262295], [0.08085, 1.087391, 0.076037], [0.125583, -0.532729, 0.485984], [0.262625, 0.599586, 0.780328], [0.391387, -0.726999, -0.716259], [0.513854, -0.868287, 0.139347], [0.597475, 0.85513, 0.326364], [0.641224, 0.109523, 0.783723], [0.737185, -0.451155, 0.538891], [0.848705, -0.612742, -0.314616], [0.976075, 0.365067, 0.32976], [1.072036, -0.19561, 0.084927]], face: [[15, 18, 21], [12, 20, 16], [6, 10, 2], [3, 0, 1], [9, 7, 13], [2, 8, 4, 0], [0, 4, 5, 1], [1, 5, 11, 7], [7, 11, 17, 13], [13, 17, 22, 18], [18, 22, 24, 21], [21, 24, 23, 20], [20, 23, 19, 16], [16, 19, 14, 10], [10, 14, 8, 2], [15, 9, 13, 18], [12, 15, 21, 20], [6, 12, 16, 10], [3, 6, 2, 0], [9, 3, 1, 7], [9, 15, 12, 6, 3], [22, 17, 11, 5, 4, 8, 14, 19, 23, 24]] };\n          var e, n, i, o, a, s, d = r.type && (r.type < 0 || r.type >= t.length) ? 0 : r.type || 0, p = r.size, y = r.sizeX || p || 1, P = r.sizeY || p || 1, R = r.sizeZ || p || 1, B = r.custom || t[d], F = B.face.length, z = r.faceUV || new Array(F), J = r.faceColors, ie = r.flat === void 0 || r.flat, se = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, ce = new Array(), ue = new Array(), fe = new Array(), ve = new Array(), Te = new Array(), Re = 0, Ae = 0, Ee = new Array(), Se = 0, De = 0;\n          if (ie)\n            for (De = 0; De < F; De++)\n              J && J[De] === void 0 && (J[De] = new I.b(1, 1, 1, 1)), z && z[De] === void 0 && (z[De] = new u.f(0, 0, 1, 1));\n          if (ie)\n            for (De = 0; De < F; De++) {\n              var xe = B.face[De].length;\n              for (i = 2 * Math.PI / xe, o = 0.5 * Math.tan(i / 2), a = 0.5, Se = 0; Se < xe; Se++)\n                ce.push(B.vertex[B.face[De][Se]][0] * y, B.vertex[B.face[De][Se]][1] * P, B.vertex[B.face[De][Se]][2] * R), Ee.push(Re), Re++, e = z[De].x + (z[De].z - z[De].x) * (0.5 + o), n = z[De].y + (z[De].w - z[De].y) * (a - 0.5), ve.push(e, n), s = o * Math.cos(i) - a * Math.sin(i), a = o * Math.sin(i) + a * Math.cos(i), o = s, J && Te.push(J[De].r, J[De].g, J[De].b, J[De].a);\n              for (Se = 0; Se < xe - 2; Se++)\n                ue.push(Ee[0 + Ae], Ee[Se + 2 + Ae], Ee[Se + 1 + Ae]);\n              Ae += xe;\n            }\n          else {\n            for (Se = 0; Se < B.vertex.length; Se++)\n              ce.push(B.vertex[Se][0] * y, B.vertex[Se][1] * P, B.vertex[Se][2] * R), ve.push(0, 0);\n            for (De = 0; De < F; De++)\n              for (Se = 0; Se < B.face[De].length - 2; Se++)\n                ue.push(B.face[De][0], B.face[De][Se + 2], B.face[De][Se + 1]);\n          }\n          ht.a.ComputeNormals(ce, ue, fe), ht.a._ComputeSides(se, ce, ue, fe, ve, r.frontUVs, r.backUVs);\n          var Le = new ht.a();\n          return Le.positions = ce, Le.indices = ue, Le.normals = fe, Le.uvs = ve, J && ie && (Le.colors = Te), Le;\n        }, Ie.a.CreatePolyhedron = function(r, t, e) {\n          return Qr.CreatePolyhedron(r, t, e);\n        };\n        var Qr = function() {\n          function r() {\n          }\n          return r.CreatePolyhedron = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreatePolyhedron(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }(), Ql = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer), n === void 0 && (n = 1);\n            var o = r.call(this, e) || this;\n            return o._meshAttached = null, o._nodeAttached = null, o._sensitivity = 1, o._observables = [], o._gizmoAxisCache = /* @__PURE__ */ new Map(), o.onDragStartObservable = new C.c(), o.onDragEndObservable = new C.c(), o.uniformScaleGizmo = o._createUniformScaleMesh(), o.xGizmo = new Kr(new u.e(1, 0, 0), I.a.Red().scale(0.5), e, o, n), o.yGizmo = new Kr(new u.e(0, 1, 0), I.a.Green().scale(0.5), e, o, n), o.zGizmo = new Kr(new u.e(0, 0, 1), I.a.Blue().scale(0.5), e, o, n), [o.xGizmo, o.yGizmo, o.zGizmo, o.uniformScaleGizmo].forEach(function(a) {\n              a.dragBehavior.onDragStartObservable.add(function() {\n                o.onDragStartObservable.notifyObservers({});\n              }), a.dragBehavior.onDragEndObservable.add(function() {\n                o.onDragEndObservable.notifyObservers({});\n              });\n            }), o.attachedMesh = null, o.attachedNode = null, i ? i.addToAxisCache(o._gizmoAxisCache) : Ln.a.GizmoAxisPointerObserver(e, o._gizmoAxisCache), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"attachedMesh\", { get: function() {\n            return this._meshAttached;\n          }, set: function(e) {\n            this._meshAttached = e, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedMesh = e : n.attachedMesh = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"attachedNode\", { get: function() {\n            return this._nodeAttached;\n          }, set: function(e) {\n            this._meshAttached = null, this._nodeAttached = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n.isEnabled ? n.attachedNode = e : n.attachedNode = null;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isHovered\", { get: function() {\n            var e = !1;\n            return [this.xGizmo, this.yGizmo, this.zGizmo].forEach(function(n) {\n              e = e || n.isHovered;\n            }), e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._createUniformScaleMesh = function() {\n            this._coloredMaterial = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene), this._coloredMaterial.diffuseColor = I.a.Gray(), this._hoverMaterial = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene), this._hoverMaterial.diffuseColor = I.a.Yellow(), this._disableMaterial = new Nt.a(\"\", this.gizmoLayer.utilityLayerScene), this._disableMaterial.diffuseColor = I.a.Gray(), this._disableMaterial.alpha = 0.4;\n            var e = new Kr(new u.e(0, 1, 0), I.a.Gray().scale(0.5), this.gizmoLayer, this);\n            e.updateGizmoRotationToMatchAttachedMesh = !1, e.uniformScaling = !0, this._uniformScalingMesh = Qr.CreatePolyhedron(\"uniform\", { type: 1 }, e.gizmoLayer.utilityLayerScene), this._uniformScalingMesh.scaling.scaleInPlace(0.01), this._uniformScalingMesh.visibility = 0, this._octahedron = Qr.CreatePolyhedron(\"\", { type: 1 }, e.gizmoLayer.utilityLayerScene), this._octahedron.scaling.scaleInPlace(7e-3), this._uniformScalingMesh.addChild(this._octahedron), e.setCustomMesh(this._uniformScalingMesh, !0);\n            var n = this.gizmoLayer._getSharedGizmoLight();\n            n.includedOnlyMeshes = n.includedOnlyMeshes.concat(this._octahedron);\n            var i = { gizmoMeshes: [this._octahedron, this._uniformScalingMesh], colliderMeshes: [this._uniformScalingMesh], material: this._coloredMaterial, hoverMaterial: this._hoverMaterial, disableMaterial: this._disableMaterial, active: !1 };\n            return this.addToAxisCache(e._rootMesh, i), e;\n          }, Object.defineProperty(t.prototype, \"updateGizmoRotationToMatchAttachedMesh\", { get: function() {\n            return this._updateGizmoRotationToMatchAttachedMesh;\n          }, set: function(e) {\n            e ? (this._updateGizmoRotationToMatchAttachedMesh = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.updateGizmoRotationToMatchAttachedMesh = e);\n            })) : l.a.Warn(\"Setting updateGizmoRotationToMatchAttachedMesh = false on scaling gizmo is not supported.\");\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapDistance\", { get: function() {\n            return this._snapDistance;\n          }, set: function(e) {\n            this._snapDistance = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.snapDistance = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scaleRatio\", { get: function() {\n            return this._scaleRatio;\n          }, set: function(e) {\n            this._scaleRatio = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.scaleRatio = e);\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sensitivity\", { get: function() {\n            return this._sensitivity;\n          }, set: function(e) {\n            this._sensitivity = e, [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && (n.sensitivity = e);\n            });\n          }, enumerable: !1, configurable: !0 }), t.prototype.addToAxisCache = function(e, n) {\n            this._gizmoAxisCache.set(e, n);\n          }, t.prototype.dispose = function() {\n            var e = this;\n            [this.xGizmo, this.yGizmo, this.zGizmo, this.uniformScaleGizmo].forEach(function(n) {\n              n && n.dispose();\n            }), this._observables.forEach(function(n) {\n              e.gizmoLayer.utilityLayerScene.onPointerObservable.remove(n);\n            }), this.onDragStartObservable.clear(), this.onDragEndObservable.clear(), [this._uniformScalingMesh, this._octahedron].forEach(function(n) {\n              n && n.dispose();\n            }), [this._coloredMaterial, this._hoverMaterial, this._disableMaterial].forEach(function(n) {\n              n && n.dispose();\n            });\n          }, t;\n        }(Ln.a), Hf = function() {\n          function r(t, e, n, i) {\n            e === void 0 && (e = 1), n === void 0 && (n = Cn.a.DefaultUtilityLayer), i === void 0 && (i = Cn.a.DefaultKeepDepthUtilityLayer), this.scene = t, this.clearGizmoOnEmptyPointerEvent = !1, this.onAttachedToMeshObservable = new C.c(), this.onAttachedToNodeObservable = new C.c(), this._gizmosEnabled = { positionGizmo: !1, rotationGizmo: !1, scaleGizmo: !1, boundingBoxGizmo: !1 }, this._pointerObservers = [], this._attachedMesh = null, this._attachedNode = null, this._boundingBoxColor = I.a.FromHexString(\"#0984e3\"), this._thickness = 1, this._gizmoAxisCache = /* @__PURE__ */ new Map(), this.boundingBoxDragBehavior = new Jc(), this.attachableMeshes = null, this.attachableNodes = null, this.usePointerToAttachGizmos = !0, this._defaultUtilityLayer = n, this._defaultKeepDepthUtilityLayer = i, this._defaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = !1, this._thickness = e, this.gizmos = { positionGizmo: null, rotationGizmo: null, scaleGizmo: null, boundingBoxGizmo: null };\n            var o = this._attachToMeshPointerObserver(t), a = Ln.a.GizmoAxisPointerObserver(this._defaultUtilityLayer, this._gizmoAxisCache);\n            this._pointerObservers = [o, a];\n          }\n          return Object.defineProperty(r.prototype, \"keepDepthUtilityLayer\", { get: function() {\n            return this._defaultKeepDepthUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"utilityLayer\", { get: function() {\n            return this._defaultUtilityLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isHovered\", { get: function() {\n            var t = !1;\n            for (var e in this.gizmos) {\n              var n = this.gizmos[e];\n              if (n && n.isHovered) {\n                t = !0;\n                break;\n              }\n            }\n            return t;\n          }, enumerable: !1, configurable: !0 }), r.prototype._attachToMeshPointerObserver = function(t) {\n            var e = this;\n            return t.onPointerObservable.add(function(n) {\n              if (e.usePointerToAttachGizmos && n.type == yt.a.POINTERDOWN)\n                if (n.pickInfo && n.pickInfo.pickedMesh) {\n                  var i = n.pickInfo.pickedMesh;\n                  if (e.attachableMeshes == null)\n                    for (; i && i.parent != null; )\n                      i = i.parent;\n                  else {\n                    var o = !1;\n                    e.attachableMeshes.forEach(function(a) {\n                      i && (i == a || i.isDescendantOf(a)) && (i = a, o = !0);\n                    }), o || (i = null);\n                  }\n                  i instanceof Mt.a ? e._attachedMesh != i && e.attachToMesh(i) : e.clearGizmoOnEmptyPointerEvent && e.attachToMesh(null);\n                } else\n                  e.clearGizmoOnEmptyPointerEvent && e.attachToMesh(null);\n            });\n          }, r.prototype.attachToMesh = function(t) {\n            for (var e in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = t, this._attachedNode = null, this.gizmos) {\n              var n = this.gizmos[e];\n              n && this._gizmosEnabled[e] && (n.attachedMesh = t);\n            }\n            this.boundingBoxGizmoEnabled && this._attachedMesh && this._attachedMesh.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToMeshObservable.notifyObservers(t);\n          }, r.prototype.attachToNode = function(t) {\n            for (var e in this._attachedMesh && this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh = null, this._attachedNode = t, this.gizmos) {\n              var n = this.gizmos[e];\n              n && this._gizmosEnabled[e] && (n.attachedNode = t);\n            }\n            this.boundingBoxGizmoEnabled && this._attachedNode && this._attachedNode.addBehavior(this.boundingBoxDragBehavior), this.onAttachedToNodeObservable.notifyObservers(t);\n          }, Object.defineProperty(r.prototype, \"positionGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.positionGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.positionGizmo || (this.gizmos.positionGizmo = new Kl(this._defaultUtilityLayer, this._thickness, this)), this._attachedNode ? this.gizmos.positionGizmo.attachedNode = this._attachedNode : this.gizmos.positionGizmo.attachedMesh = this._attachedMesh) : this.gizmos.positionGizmo && (this.gizmos.positionGizmo.attachedNode = null), this._gizmosEnabled.positionGizmo = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rotationGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.rotationGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.rotationGizmo || (this.gizmos.rotationGizmo = new Yl(this._defaultUtilityLayer, 32, !1, this._thickness, this)), this._attachedNode ? this.gizmos.rotationGizmo.attachedNode = this._attachedNode : this.gizmos.rotationGizmo.attachedMesh = this._attachedMesh) : this.gizmos.rotationGizmo && (this.gizmos.rotationGizmo.attachedNode = null), this._gizmosEnabled.rotationGizmo = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"scaleGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.scaleGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.scaleGizmo = this.gizmos.scaleGizmo || new Ql(this._defaultUtilityLayer, this._thickness, this), this._attachedNode ? this.gizmos.scaleGizmo.attachedNode = this._attachedNode : this.gizmos.scaleGizmo.attachedMesh = this._attachedMesh) : this.gizmos.scaleGizmo && (this.gizmos.scaleGizmo.attachedNode = null), this._gizmosEnabled.scaleGizmo = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"boundingBoxGizmoEnabled\", { get: function() {\n            return this._gizmosEnabled.boundingBoxGizmo;\n          }, set: function(t) {\n            t ? (this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new Xl(this._boundingBoxColor, this._defaultKeepDepthUtilityLayer), this._attachedMesh ? this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh : this.gizmos.boundingBoxGizmo.attachedNode = this._attachedNode, this._attachedMesh ? (this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior), this._attachedMesh.addBehavior(this.boundingBoxDragBehavior)) : this._attachedNode && (this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this._attachedNode.addBehavior(this.boundingBoxDragBehavior))) : this.gizmos.boundingBoxGizmo && (this._attachedMesh ? this._attachedMesh.removeBehavior(this.boundingBoxDragBehavior) : this._attachedNode && this._attachedNode.removeBehavior(this.boundingBoxDragBehavior), this.gizmos.boundingBoxGizmo.attachedNode = null), this._gizmosEnabled.boundingBoxGizmo = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addToAxisCache = function(t) {\n            var e = this;\n            t.size > 0 && t.forEach(function(n, i) {\n              e._gizmoAxisCache.set(i, n);\n            });\n          }, r.prototype.dispose = function() {\n            var t = this;\n            for (var e in this._pointerObservers.forEach(function(i) {\n              t.scene.onPointerObservable.remove(i);\n            }), this.gizmos) {\n              var n = this.gizmos[e];\n              n && n.dispose();\n            }\n            this._defaultKeepDepthUtilityLayer.dispose(), this._defaultUtilityLayer.dispose(), this.boundingBoxDragBehavior.detach(), this.onAttachedToMeshObservable.clear();\n          }, r;\n        }(), bi = f(48), ko = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e._needProjectionMatrixCompute = !0, e;\n          }\n          return Object(c.d)(t, r), t.prototype._setPosition = function(e) {\n            this._position = e;\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._position;\n          }, set: function(e) {\n            this._setPosition(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype._setDirection = function(e) {\n            this._direction = e;\n          }, Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._direction;\n          }, set: function(e) {\n            this._setDirection(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowMinZ\", { get: function() {\n            return this._shadowMinZ;\n          }, set: function(e) {\n            this._shadowMinZ = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowMaxZ\", { get: function() {\n            return this._shadowMaxZ;\n          }, set: function(e) {\n            this._shadowMaxZ = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), t.prototype.computeTransformedInformation = function() {\n            return !(!this.parent || !this.parent.getWorldMatrix) && (this.transformedPosition || (this.transformedPosition = u.e.Zero()), u.e.TransformCoordinatesToRef(this.position, this.parent.getWorldMatrix(), this.transformedPosition), this.direction && (this.transformedDirection || (this.transformedDirection = u.e.Zero()), u.e.TransformNormalToRef(this.direction, this.parent.getWorldMatrix(), this.transformedDirection)), !0);\n          }, t.prototype.getDepthScale = function() {\n            return 50;\n          }, t.prototype.getShadowDirection = function(e) {\n            return this.transformedDirection ? this.transformedDirection : this.direction;\n          }, t.prototype.getAbsolutePosition = function() {\n            return this.transformedPosition ? this.transformedPosition : this.position;\n          }, t.prototype.setDirectionToTarget = function(e) {\n            return this.direction = u.e.Normalize(e.subtract(this.position)), this.direction;\n          }, t.prototype.getRotation = function() {\n            this.direction.normalize();\n            var e = u.e.Cross(this.direction, be.a.Y), n = u.e.Cross(e, this.direction);\n            return u.e.RotationFromAxis(e, n, this.direction);\n          }, t.prototype.needCube = function() {\n            return !1;\n          }, t.prototype.needProjectionMatrixCompute = function() {\n            return this._needProjectionMatrixCompute;\n          }, t.prototype.forceProjectionMatrixCompute = function() {\n            this._needProjectionMatrixCompute = !0;\n          }, t.prototype._initCache = function() {\n            r.prototype._initCache.call(this), this._cache.position = u.e.Zero();\n          }, t.prototype._isSynchronized = function() {\n            return !!this._cache.position.equals(this.position);\n          }, t.prototype.computeWorldMatrix = function(e) {\n            return !e && this.isSynchronized() ? (this._currentRenderId = this.getScene().getRenderId(), this._worldMatrix) : (this._updateCache(), this._cache.position.copyFrom(this.position), this._worldMatrix || (this._worldMatrix = u.a.Identity()), u.a.TranslationToRef(this.position.x, this.position.y, this.position.z, this._worldMatrix), this.parent && this.parent.getWorldMatrix && (this._worldMatrix.multiplyToRef(this.parent.getWorldMatrix(), this._worldMatrix), this._markSyncedWithParent()), this._worldMatrixDeterminantIsDirty = !0, this._worldMatrix);\n          }, t.prototype.getDepthMinZ = function(e) {\n            return this.shadowMinZ !== void 0 ? this.shadowMinZ : e.minZ;\n          }, t.prototype.getDepthMaxZ = function(e) {\n            return this.shadowMaxZ !== void 0 ? this.shadowMaxZ : e.maxZ;\n          }, t.prototype.setShadowProjectionMatrix = function(e, n, i) {\n            return this.customProjectionMatrixBuilder ? this.customProjectionMatrixBuilder(n, i, e) : this._setDefaultShadowProjectionMatrix(e, n, i), this;\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"position\", null), Object(c.c)([Object(L.o)()], t.prototype, \"direction\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowMinZ\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowMaxZ\", null), t;\n        }(bi.a);\n        Q.a.AddNodeConstructor(\"Light_Type_1\", function(r, t) {\n          return function() {\n            return new vs(r, u.e.Zero(), t);\n          };\n        });\n        var vs = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._shadowFrustumSize = 0, o._shadowOrthoScale = 0.1, o.autoUpdateExtends = !0, o.autoCalcShadowZBounds = !1, o._orthoLeft = Number.MAX_VALUE, o._orthoRight = Number.MIN_VALUE, o._orthoTop = Number.MIN_VALUE, o._orthoBottom = Number.MAX_VALUE, o.position = n.scale(-1), o.direction = n, o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"shadowFrustumSize\", { get: function() {\n            return this._shadowFrustumSize;\n          }, set: function(e) {\n            this._shadowFrustumSize = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowOrthoScale\", { get: function() {\n            return this._shadowOrthoScale;\n          }, set: function(e) {\n            this._shadowOrthoScale = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"DirectionalLight\";\n          }, t.prototype.getTypeID = function() {\n            return bi.a.LIGHTTYPEID_DIRECTIONALLIGHT;\n          }, t.prototype._setDefaultShadowProjectionMatrix = function(e, n, i) {\n            this.shadowFrustumSize > 0 ? this._setDefaultFixedFrustumShadowProjectionMatrix(e) : this._setDefaultAutoExtendShadowProjectionMatrix(e, n, i);\n          }, t.prototype._setDefaultFixedFrustumShadowProjectionMatrix = function(e) {\n            var n = this.getScene().activeCamera;\n            n && u.a.OrthoLHToRef(this.shadowFrustumSize, this.shadowFrustumSize, this.shadowMinZ !== void 0 ? this.shadowMinZ : n.minZ, this.shadowMaxZ !== void 0 ? this.shadowMaxZ : n.maxZ, e);\n          }, t.prototype._setDefaultAutoExtendShadowProjectionMatrix = function(e, n, i) {\n            var o = this.getScene().activeCamera;\n            if (o) {\n              if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {\n                var a = u.e.Zero();\n                this._orthoLeft = Number.MAX_VALUE, this._orthoRight = Number.MIN_VALUE, this._orthoTop = Number.MIN_VALUE, this._orthoBottom = Number.MAX_VALUE;\n                for (var s = Number.MAX_VALUE, d = Number.MIN_VALUE, p = 0; p < i.length; p++) {\n                  var y = i[p];\n                  if (y)\n                    for (var P = y.getBoundingInfo().boundingBox, R = 0; R < P.vectorsWorld.length; R++)\n                      u.e.TransformCoordinatesToRef(P.vectorsWorld[R], n, a), a.x < this._orthoLeft && (this._orthoLeft = a.x), a.y < this._orthoBottom && (this._orthoBottom = a.y), a.x > this._orthoRight && (this._orthoRight = a.x), a.y > this._orthoTop && (this._orthoTop = a.y), this.autoCalcShadowZBounds && (a.z < s && (s = a.z), a.z > d && (d = a.z));\n                }\n                this.autoCalcShadowZBounds && (this._shadowMinZ = s, this._shadowMaxZ = d);\n              }\n              var B = this._orthoRight - this._orthoLeft, F = this._orthoTop - this._orthoBottom;\n              u.a.OrthoOffCenterLHToRef(this._orthoLeft - B * this.shadowOrthoScale, this._orthoRight + B * this.shadowOrthoScale, this._orthoBottom - F * this.shadowOrthoScale, this._orthoTop + F * this.shadowOrthoScale, this.shadowMinZ !== void 0 ? this.shadowMinZ : o.minZ, this.shadowMaxZ !== void 0 ? this.shadowMaxZ : o.maxZ, e);\n            }\n          }, t.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, t.prototype.transferToEffect = function(e, n) {\n            return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, n), this) : (this._uniformBuffer.updateFloat4(\"vLightData\", this.direction.x, this.direction.y, this.direction.z, 1, n), this);\n          }, t.prototype.transferToNodeMaterialEffect = function(e, n) {\n            return this.computeTransformedInformation() ? (e.setFloat3(n, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z), this) : (e.setFloat3(n, this.direction.x, this.direction.y, this.direction.z), this);\n          }, t.prototype.getDepthMinZ = function(e) {\n            return 1;\n          }, t.prototype.getDepthMaxZ = function(e) {\n            return 1;\n          }, t.prototype.prepareLightSpecificDefines = function(e, n) {\n            e[\"DIRLIGHT\" + n] = !0;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"shadowFrustumSize\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowOrthoScale\", null), Object(c.c)([Object(L.c)()], t.prototype, \"autoUpdateExtends\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"autoCalcShadowZBounds\", void 0), t;\n        }(ko);\n        Ie.a.CreateHemisphere = function(r, t, e, n) {\n          var i = { segments: t, diameter: e };\n          return Go.CreateHemisphere(r, i, n);\n        };\n        var Go = function() {\n          function r() {\n          }\n          return r.CreateHemisphere = function(t, e, n) {\n            e.diameter || (e.diameter = 1), e.segments || (e.segments = 16);\n            var i = Nn.a.CreateSphere(\"\", { slice: 0.5, diameter: e.diameter, segments: e.segments }, n), o = Ie.a.CreateDisc(\"\", e.diameter / 2, 3 * e.segments + (4 - e.segments), n);\n            o.rotation.x = -Math.PI / 2, o.parent = i;\n            var a = Ie.a.MergeMeshes([o, i], !0);\n            return a.name = t, a;\n          }, r;\n        }();\n        Q.a.AddNodeConstructor(\"Light_Type_2\", function(r, t) {\n          return function() {\n            return new ys(r, u.e.Zero(), u.e.Zero(), 0, 0, t);\n          };\n        });\n        var ys = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, s) || this;\n            return d._innerAngle = 0, d._projectionTextureMatrix = u.a.Zero(), d._projectionTextureLightNear = 1e-6, d._projectionTextureLightFar = 1e3, d._projectionTextureUpDirection = u.e.Up(), d._projectionTextureViewLightDirty = !0, d._projectionTextureProjectionLightDirty = !0, d._projectionTextureDirty = !0, d._projectionTextureViewTargetVector = u.e.Zero(), d._projectionTextureViewLightMatrix = u.a.Zero(), d._projectionTextureProjectionLightMatrix = u.a.Zero(), d._projectionTextureScalingMatrix = u.a.FromValues(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.5, 0, 0.5, 0.5, 0.5, 1), d.position = n, d.direction = i, d.angle = o, d.exponent = a, d;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"angle\", { get: function() {\n            return this._angle;\n          }, set: function(e) {\n            this._angle = e, this._cosHalfAngle = Math.cos(0.5 * e), this._projectionTextureProjectionLightDirty = !0, this.forceProjectionMatrixCompute(), this._computeAngleValues();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"innerAngle\", { get: function() {\n            return this._innerAngle;\n          }, set: function(e) {\n            this._innerAngle = e, this._computeAngleValues();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadowAngleScale\", { get: function() {\n            return this._shadowAngleScale;\n          }, set: function(e) {\n            this._shadowAngleScale = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureMatrix\", { get: function() {\n            return this._projectionTextureMatrix;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureLightNear\", { get: function() {\n            return this._projectionTextureLightNear;\n          }, set: function(e) {\n            this._projectionTextureLightNear = e, this._projectionTextureProjectionLightDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureLightFar\", { get: function() {\n            return this._projectionTextureLightFar;\n          }, set: function(e) {\n            this._projectionTextureLightFar = e, this._projectionTextureProjectionLightDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTextureUpDirection\", { get: function() {\n            return this._projectionTextureUpDirection;\n          }, set: function(e) {\n            this._projectionTextureUpDirection = e, this._projectionTextureProjectionLightDirty = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"projectionTexture\", { get: function() {\n            return this._projectionTexture;\n          }, set: function(e) {\n            var n = this;\n            this._projectionTexture !== e && (this._projectionTexture = e, this._projectionTextureDirty = !0, this._projectionTexture && !this._projectionTexture.isReady() && (t._IsProceduralTexture(this._projectionTexture) ? this._projectionTexture.getEffect().executeWhenCompiled(function() {\n              n._markMeshesAsLightDirty();\n            }) : t._IsTexture(this._projectionTexture) && this._projectionTexture.onLoadObservable.addOnce(function() {\n              n._markMeshesAsLightDirty();\n            })));\n          }, enumerable: !1, configurable: !0 }), t._IsProceduralTexture = function(e) {\n            return e.onGeneratedObservable !== void 0;\n          }, t._IsTexture = function(e) {\n            return e.onLoadObservable !== void 0;\n          }, t.prototype.getClassName = function() {\n            return \"SpotLight\";\n          }, t.prototype.getTypeID = function() {\n            return bi.a.LIGHTTYPEID_SPOTLIGHT;\n          }, t.prototype._setDirection = function(e) {\n            r.prototype._setDirection.call(this, e), this._projectionTextureViewLightDirty = !0;\n          }, t.prototype._setPosition = function(e) {\n            r.prototype._setPosition.call(this, e), this._projectionTextureViewLightDirty = !0;\n          }, t.prototype._setDefaultShadowProjectionMatrix = function(e, n, i) {\n            var o = this.getScene().activeCamera;\n            if (o) {\n              this._shadowAngleScale = this._shadowAngleScale || 1;\n              var a = this._shadowAngleScale * this._angle;\n              u.a.PerspectiveFovLHToRef(a, 1, this.getDepthMinZ(o), this.getDepthMaxZ(o), e);\n            }\n          }, t.prototype._computeProjectionTextureViewLightMatrix = function() {\n            this._projectionTextureViewLightDirty = !1, this._projectionTextureDirty = !0, this.position.addToRef(this.direction, this._projectionTextureViewTargetVector), u.a.LookAtLHToRef(this.position, this._projectionTextureViewTargetVector, this._projectionTextureUpDirection, this._projectionTextureViewLightMatrix);\n          }, t.prototype._computeProjectionTextureProjectionLightMatrix = function() {\n            this._projectionTextureProjectionLightDirty = !1, this._projectionTextureDirty = !0;\n            var e = this.projectionTextureLightFar, n = this.projectionTextureLightNear, i = e / (e - n), o = -i * n, a = 1 / Math.tan(this._angle / 2);\n            u.a.FromValuesToRef(a / 1, 0, 0, 0, 0, a, 0, 0, 0, 0, i, 1, 0, 0, o, 0, this._projectionTextureProjectionLightMatrix);\n          }, t.prototype._computeProjectionTextureMatrix = function() {\n            if (this._projectionTextureDirty = !1, this._projectionTextureViewLightMatrix.multiplyToRef(this._projectionTextureProjectionLightMatrix, this._projectionTextureMatrix), this._projectionTexture instanceof Ne.a) {\n              var e = this._projectionTexture.uScale / 2, n = this._projectionTexture.vScale / 2;\n              u.a.FromValuesToRef(e, 0, 0, 0, 0, n, 0, 0, 0, 0, 0.5, 0, 0.5, 0.5, 0.5, 1, this._projectionTextureScalingMatrix);\n            }\n            this._projectionTextureMatrix.multiplyToRef(this._projectionTextureScalingMatrix, this._projectionTextureMatrix);\n          }, t.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"vLightDirection\", 3), this._uniformBuffer.addUniform(\"vLightFalloff\", 4), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, t.prototype._computeAngleValues = function() {\n            this._lightAngleScale = 1 / Math.max(1e-3, Math.cos(0.5 * this._innerAngle) - this._cosHalfAngle), this._lightAngleOffset = -this._cosHalfAngle * this._lightAngleScale;\n          }, t.prototype.transferTexturesToEffect = function(e, n) {\n            return this.projectionTexture && this.projectionTexture.isReady() && (this._projectionTextureViewLightDirty && this._computeProjectionTextureViewLightMatrix(), this._projectionTextureProjectionLightDirty && this._computeProjectionTextureProjectionLightMatrix(), this._projectionTextureDirty && this._computeProjectionTextureMatrix(), e.setMatrix(\"textureProjectionMatrix\" + n, this._projectionTextureMatrix), e.setTexture(\"projectionLightSampler\" + n, this.projectionTexture)), this;\n          }, t.prototype.transferToEffect = function(e, n) {\n            var i;\n            return this.computeTransformedInformation() ? (this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, this.exponent, n), i = u.e.Normalize(this.transformedDirection)) : (this._uniformBuffer.updateFloat4(\"vLightData\", this.position.x, this.position.y, this.position.z, this.exponent, n), i = u.e.Normalize(this.direction)), this._uniformBuffer.updateFloat4(\"vLightDirection\", i.x, i.y, i.z, this._cosHalfAngle, n), this._uniformBuffer.updateFloat4(\"vLightFalloff\", this.range, this._inverseSquaredRange, this._lightAngleScale, this._lightAngleOffset, n), this;\n          }, t.prototype.transferToNodeMaterialEffect = function(e, n) {\n            var i;\n            return i = this.computeTransformedInformation() ? u.e.Normalize(this.transformedDirection) : u.e.Normalize(this.direction), this.getScene().useRightHandedSystem ? e.setFloat3(n, -i.x, -i.y, -i.z) : e.setFloat3(n, i.x, i.y, i.z), this;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._projectionTexture && this._projectionTexture.dispose();\n          }, t.prototype.prepareLightSpecificDefines = function(e, n) {\n            e[\"SPOTLIGHT\" + n] = !0, e[\"PROJECTEDLIGHTTEXTURE\" + n] = !(!this.projectionTexture || !this.projectionTexture.isReady());\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"angle\", null), Object(c.c)([Object(L.c)()], t.prototype, \"innerAngle\", null), Object(c.c)([Object(L.c)()], t.prototype, \"shadowAngleScale\", null), Object(c.c)([Object(L.c)()], t.prototype, \"exponent\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"projectionTextureLightNear\", null), Object(c.c)([Object(L.c)()], t.prototype, \"projectionTextureLightFar\", null), Object(c.c)([Object(L.c)()], t.prototype, \"projectionTextureUpDirection\", null), Object(c.c)([Object(L.m)(\"projectedLightTexture\")], t.prototype, \"_projectionTexture\", void 0), t;\n        }(ko), Wf = function(r) {\n          function t(e) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer);\n            var n = r.call(this, e) || this;\n            return n._cachedPosition = new u.e(), n._cachedForward = new u.e(0, 0, 1), n._pointerObserver = null, n.onClickedObservable = new C.c(), n._light = null, n.attachedMesh = new Mt.a(\"\", n.gizmoLayer.utilityLayerScene), n._attachedMeshParent = new pr.a(\"parent\", n.gizmoLayer.utilityLayerScene), n.attachedMesh.parent = n._attachedMeshParent, n._material = new Nt.a(\"light\", n.gizmoLayer.utilityLayerScene), n._material.diffuseColor = new I.a(0.5, 0.5, 0.5), n._material.specularColor = new I.a(0.1, 0.1, 0.1), n._pointerObserver = e.utilityLayerScene.onPointerObservable.add(function(i) {\n              n._light && (n._isHovered = !(!i.pickInfo || n._rootMesh.getChildMeshes().indexOf(i.pickInfo.pickedMesh) == -1), n._isHovered && i.event.button === 0 && n.onClickedObservable.notifyObservers(n._light));\n            }, yt.a.POINTERDOWN), n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"light\", { get: function() {\n            return this._light;\n          }, set: function(e) {\n            var n = this;\n            if (this._light = e, e) {\n              this._lightMesh && this._lightMesh.dispose(), e instanceof Oo.a ? this._lightMesh = t._CreateHemisphericLightMesh(this.gizmoLayer.utilityLayerScene) : this._lightMesh = e instanceof vs ? t._CreateDirectionalLightMesh(this.gizmoLayer.utilityLayerScene) : e instanceof ys ? t._CreateSpotLightMesh(this.gizmoLayer.utilityLayerScene) : t._CreatePointLightMesh(this.gizmoLayer.utilityLayerScene), this._lightMesh.getChildMeshes(!1).forEach(function(o) {\n                o.material = n._material;\n              }), this._lightMesh.parent = this._rootMesh;\n              var i = this.gizmoLayer._getSharedGizmoLight();\n              i.includedOnlyMeshes = i.includedOnlyMeshes.concat(this._lightMesh.getChildMeshes(!1)), this._lightMesh.rotationQuaternion = new u.b(), this.attachedMesh.reservedDataStore || (this.attachedMesh.reservedDataStore = {}), this.attachedMesh.reservedDataStore.lightGizmo = this, e.parent && this._attachedMeshParent.freezeWorldMatrix(e.parent.getWorldMatrix()), e.position && (this.attachedMesh.position.copyFrom(e.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position)), e.direction && (this.attachedMesh.setDirection(e.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(this.attachedMesh.forward)), this._update();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"material\", { get: function() {\n            return this._material;\n          }, enumerable: !1, configurable: !0 }), t.prototype._update = function() {\n            r.prototype._update.call(this), this._light && (this._light.parent && this._attachedMeshParent.freezeWorldMatrix(this._light.parent.getWorldMatrix()), this._light.position && (this.attachedMesh.position.equals(this._cachedPosition) ? (this.attachedMesh.position.copyFrom(this._light.position), this.attachedMesh.computeWorldMatrix(!0), this._cachedPosition.copyFrom(this.attachedMesh.position)) : (this._light.position.copyFrom(this.attachedMesh.position), this._cachedPosition.copyFrom(this.attachedMesh.position))), this._light.direction && (u.e.DistanceSquared(this.attachedMesh.forward, this._cachedForward) > 1e-4 ? (this._light.direction.copyFrom(this.attachedMesh.forward), this._cachedForward.copyFrom(this.attachedMesh.forward)) : u.e.DistanceSquared(this.attachedMesh.forward, this._light.direction) > 1e-4 && (this.attachedMesh.setDirection(this._light.direction), this.attachedMesh.computeWorldMatrix(!0), this._cachedForward.copyFrom(this.attachedMesh.forward))));\n          }, t.prototype.dispose = function() {\n            this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._material.dispose(), r.prototype.dispose.call(this), this._attachedMeshParent.dispose();\n          }, t._CreateHemisphericLightMesh = function(e) {\n            var n = new Ie.a(\"hemisphereLight\", e), i = Go.CreateHemisphere(n.name, { segments: 10, diameter: 1 }, e);\n            i.position.z = -0.15, i.rotation.x = Math.PI / 2, i.parent = n;\n            var o = this._CreateLightLines(3, e);\n            return o.parent = n, o.position.z, n.scaling.scaleInPlace(t._Scale), n.rotation.x = Math.PI / 2, n;\n          }, t._CreatePointLightMesh = function(e) {\n            var n = new Ie.a(\"pointLight\", e), i = Nn.a.CreateSphere(n.name, { segments: 10, diameter: 1 }, e);\n            return i.rotation.x = Math.PI / 2, i.parent = n, this._CreateLightLines(5, e).parent = n, n.scaling.scaleInPlace(t._Scale), n.rotation.x = Math.PI / 2, n;\n          }, t._CreateSpotLightMesh = function(e) {\n            var n = new Ie.a(\"spotLight\", e);\n            Nn.a.CreateSphere(n.name, { segments: 10, diameter: 1 }, e).parent = n;\n            var i = Go.CreateHemisphere(n.name, { segments: 10, diameter: 2 }, e);\n            return i.parent = n, i.rotation.x = -Math.PI / 2, this._CreateLightLines(2, e).parent = n, n.scaling.scaleInPlace(t._Scale), n.rotation.x = Math.PI / 2, n;\n          }, t._CreateDirectionalLightMesh = function(e) {\n            var n = new Ie.a(\"directionalLight\", e), i = new Ie.a(n.name, e);\n            i.parent = n, Nn.a.CreateSphere(n.name, { diameter: 1.2, segments: 10 }, e).parent = i;\n            var o = Ie.a.CreateCylinder(n.name, 6, 0.3, 0.3, 6, 1, e);\n            o.parent = i, (a = o.clone(n.name)).scaling.y = 0.5, a.position.x += 1.25, (s = o.clone(n.name)).scaling.y = 0.5, s.position.x += -1.25;\n            var a, s, d = Ie.a.CreateCylinder(n.name, 1, 0, 0.6, 6, 1, e);\n            return d.position.y += 3, d.parent = i, (a = d.clone(n.name)).position.y = 1.5, a.position.x += 1.25, (s = d.clone(n.name)).position.y = 1.5, s.position.x += -1.25, i.scaling.scaleInPlace(t._Scale), i.rotation.z = Math.PI / 2, i.rotation.y = Math.PI / 2, n;\n          }, t._Scale = 7e-3, t._CreateLightLines = function(e, n) {\n            var i = new Ie.a(\"root\", n);\n            i.rotation.x = Math.PI / 2;\n            var o = new Ie.a(\"linePivot\", n);\n            o.parent = i;\n            var a = Ie.a.CreateCylinder(\"line\", 2, 0.2, 0.3, 6, 1, n);\n            if (a.position.y = a.scaling.y / 2 + 1.2, a.parent = o, e < 2)\n              return o;\n            for (var s = 0; s < 4; s++)\n              (d = o.clone(\"lineParentClone\")).rotation.z = Math.PI / 4, d.rotation.y = Math.PI / 2 + Math.PI / 2 * s, d.getChildMeshes()[0].scaling.y = 0.5, d.getChildMeshes()[0].scaling.x = d.getChildMeshes()[0].scaling.z = 0.8, d.getChildMeshes()[0].position.y = d.getChildMeshes()[0].scaling.y / 2 + 1.2;\n            if (e < 3)\n              return i;\n            for (s = 0; s < 4; s++)\n              (d = o.clone(\"linePivotClone\")).rotation.z = Math.PI / 2, d.rotation.y = Math.PI / 2 * s;\n            if (e < 4)\n              return i;\n            for (s = 0; s < 4; s++) {\n              var d;\n              (d = o.clone(\"linePivotClone\")).rotation.z = Math.PI + Math.PI / 4, d.rotation.y = Math.PI / 2 + Math.PI / 2 * s, d.getChildMeshes()[0].scaling.y = 0.5, d.getChildMeshes()[0].scaling.x = d.getChildMeshes()[0].scaling.z = 0.8, d.getChildMeshes()[0].position.y = d.getChildMeshes()[0].scaling.y / 2 + 1.2;\n            }\n            return e < 5 || ((d = o.clone(\"linePivotClone\")).rotation.z = Math.PI), i;\n          }, t;\n        }(Ln.a), bs = function() {\n          function r(t, e) {\n            t === void 0 && (t = u.e.Zero()), e === void 0 && (e = u.e.Up()), this.position = t, this.normal = e;\n          }\n          return r.prototype.clone = function() {\n            return new r(this.position.clone(), this.normal.clone());\n          }, r;\n        }(), Xf = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = u.e.Zero()), e === void 0 && (e = u.e.Up()), n === void 0 && (n = u.d.Zero()), this.position = t, this.normal = e, this.uv = n;\n          }\n          return r.prototype.clone = function() {\n            return new r(this.position.clone(), this.normal.clone(), this.uv.clone());\n          }, r;\n        }(), Yf = function(r) {\n          function t(e) {\n            e === void 0 && (e = Cn.a.DefaultUtilityLayer);\n            var n = r.call(this, e) || this;\n            return n._pointerObserver = null, n.onClickedObservable = new C.c(), n._camera = null, n._invProjection = new u.a(), n._material = new Nt.a(\"cameraGizmoMaterial\", n.gizmoLayer.utilityLayerScene), n._material.diffuseColor = new I.a(0.5, 0.5, 0.5), n._material.specularColor = new I.a(0.1, 0.1, 0.1), n._pointerObserver = e.utilityLayerScene.onPointerObservable.add(function(i) {\n              n._camera && (n._isHovered = !(!i.pickInfo || n._rootMesh.getChildMeshes().indexOf(i.pickInfo.pickedMesh) == -1), n._isHovered && i.event.button === 0 && n.onClickedObservable.notifyObservers(n._camera));\n            }, yt.a.POINTERDOWN), n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"displayFrustum\", { get: function() {\n            return this._cameraLinesMesh.isEnabled();\n          }, set: function(e) {\n            this._cameraLinesMesh.setEnabled(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"camera\", { get: function() {\n            return this._camera;\n          }, set: function(e) {\n            var n = this;\n            if (this._camera = e, this.attachedNode = e, e) {\n              this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._cameraMesh = t._CreateCameraMesh(this.gizmoLayer.utilityLayerScene), this._cameraLinesMesh = t._CreateCameraFrustum(this.gizmoLayer.utilityLayerScene), this._cameraMesh.getChildMeshes(!1).forEach(function(o) {\n                o.material = n._material;\n              }), this._cameraMesh.parent = this._rootMesh, this._cameraLinesMesh.parent = this._rootMesh, this.gizmoLayer.utilityLayerScene.activeCamera && this.gizmoLayer.utilityLayerScene.activeCamera.maxZ < 1.5 * e.maxZ && (this.gizmoLayer.utilityLayerScene.activeCamera.maxZ = 1.5 * e.maxZ), this.attachedNode.reservedDataStore || (this.attachedNode.reservedDataStore = {}), this.attachedNode.reservedDataStore.cameraGizmo = this;\n              var i = this.gizmoLayer._getSharedGizmoLight();\n              i.includedOnlyMeshes = i.includedOnlyMeshes.concat(this._cameraMesh.getChildMeshes(!1)), this._update();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"material\", { get: function() {\n            return this._material;\n          }, enumerable: !1, configurable: !0 }), t.prototype._update = function() {\n            r.prototype._update.call(this), this._camera && (this._camera.getProjectionMatrix().invertToRef(this._invProjection), this._cameraLinesMesh.setPivotMatrix(this._invProjection, !1), this._cameraLinesMesh.scaling.x = 1 / this._rootMesh.scaling.x, this._cameraLinesMesh.scaling.y = 1 / this._rootMesh.scaling.y, this._cameraLinesMesh.scaling.z = 1 / this._rootMesh.scaling.z, this._cameraMesh.parent = null, this._cameraMesh.rotation.y = 0.5 * Math.PI * (this._camera.getScene().useRightHandedSystem ? 1 : -1), this._cameraMesh.parent = this._rootMesh);\n          }, t.prototype.dispose = function() {\n            this.onClickedObservable.clear(), this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver), this._cameraMesh && this._cameraMesh.dispose(), this._cameraLinesMesh && this._cameraLinesMesh.dispose(), this._material.dispose(), r.prototype.dispose.call(this);\n          }, t._CreateCameraMesh = function(e) {\n            var n = new Ie.a(\"rootCameraGizmo\", e), i = new Ie.a(n.name, e);\n            i.parent = n, fr.a.CreateBox(n.name, { width: 1, height: 0.8, depth: 0.5 }, e).parent = i;\n            var o = ci.a.CreateCylinder(n.name, { height: 0.5, diameterTop: 0.8, diameterBottom: 0.8 }, e);\n            o.parent = i, o.position.y = 0.3, o.position.x = -0.6, o.rotation.x = 0.5 * Math.PI;\n            var a = ci.a.CreateCylinder(n.name, { height: 0.5, diameterTop: 0.6, diameterBottom: 0.6 }, e);\n            a.parent = i, a.position.y = 0.5, a.position.x = 0.4, a.rotation.x = 0.5 * Math.PI;\n            var s = ci.a.CreateCylinder(n.name, { height: 0.5, diameterTop: 0.5, diameterBottom: 0.5 }, e);\n            return s.parent = i, s.position.y = 0, s.position.x = 0.6, s.rotation.z = 0.5 * Math.PI, n.scaling.scaleInPlace(t._Scale), i.position.x = -0.9, n;\n          }, t._CreateCameraFrustum = function(e) {\n            var n = new Ie.a(\"rootCameraGizmo\", e), i = new Ie.a(n.name, e);\n            i.parent = n;\n            for (var o = 0; o < 4; o += 2)\n              for (var a = 0; a < 4; a += 2) {\n                var s;\n                (s = sn.a.CreateLines(\"lines\", { points: [new u.e(-1 + a, -1 + o, -1), new u.e(-1 + a, -1 + o, 1)] }, e)).parent = i, s.alwaysSelectAsActiveMesh = !0, s.isPickable = !1, (s = sn.a.CreateLines(\"lines\", { points: [new u.e(-1, -1 + a, -1 + o), new u.e(1, -1 + a, -1 + o)] }, e)).parent = i, s.alwaysSelectAsActiveMesh = !0, s.isPickable = !1, (s = sn.a.CreateLines(\"lines\", { points: [new u.e(-1 + a, -1, -1 + o), new u.e(-1 + a, 1, -1 + o)] }, e)).parent = i, s.alwaysSelectAsActiveMesh = !0, s.isPickable = !1;\n              }\n            return n;\n          }, t._Scale = 0.05, t;\n        }(Ln.a);\n        ze.a.IncludesShadersStore.kernelBlurVaryingDeclaration = \"varying vec2 sampleCoord{X};\";\n        var Kf = `vec4 pack(float depth)\n{\nconst vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);\nconst vec4 bit_mask=vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);\nvec4 res=fract(depth*bit_shift);\nres-=res.xxyz*bit_mask;\nreturn res;\n}\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}`;\n        ze.a.IncludesShadersStore.packingFunctions = Kf;\n        var Qf = `#ifdef DOF\nfactor=sampleCoC(sampleCoord{X});\ncomputedWeight=KERNEL_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCoord{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCoord{X})*computedWeight;\n#endif`;\n        ze.a.IncludesShadersStore.kernelBlurFragment = Qf;\n        var qf = `#ifdef DOF\nfactor=sampleCoC(sampleCenter+delta*KERNEL_DEP_OFFSET{X});\ncomputedWeight=KERNEL_DEP_WEIGHT{X}*factor;\nsumOfWeights+=computedWeight;\n#else\ncomputedWeight=KERNEL_DEP_WEIGHT{X};\n#endif\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X}))*computedWeight;\n#else\nblend+=texture2D(textureSampler,sampleCenter+delta*KERNEL_DEP_OFFSET{X})*computedWeight;\n#endif`;\n        ze.a.IncludesShadersStore.kernelBlurFragment2 = qf;\n        var Zf = `\nuniform sampler2D textureSampler;\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#ifdef DOF\nuniform sampler2D circleOfConfusionSampler;\nuniform vec2 cameraMinMaxZ;\nfloat sampleDistance(const in vec2 offset) {\nfloat depth=texture2D(circleOfConfusionSampler,offset).g;\nreturn cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth;\n}\nfloat sampleCoC(const in vec2 offset) {\nfloat coc=texture2D(circleOfConfusionSampler,offset).r;\nreturn coc;\n}\n#endif\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\n#ifdef PACKEDFLOAT\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\nfloat computedWeight=0.0;\n#ifdef PACKEDFLOAT\nfloat blend=0.;\n#else\nvec4 blend=vec4(0.);\n#endif\n#ifdef DOF\nfloat sumOfWeights=CENTER_WEIGHT;\nfloat factor=0.0;\n\n#ifdef PACKEDFLOAT\nblend+=unpack(texture2D(textureSampler,sampleCenter))*CENTER_WEIGHT;\n#else\nblend+=texture2D(textureSampler,sampleCenter)*CENTER_WEIGHT;\n#endif\n#endif\n#include<kernelBlurFragment>[0..varyingCount]\n#include<kernelBlurFragment2>[0..depCount]\n#ifdef PACKEDFLOAT\ngl_FragColor=pack(blend);\n#else\ngl_FragColor=blend;\n#endif\n#ifdef DOF\ngl_FragColor/=sumOfWeights;\n#endif\n}`;\n        ze.a.ShadersStore.kernelBlurPixelShader = Zf, ze.a.IncludesShadersStore.kernelBlurVertex = \"sampleCoord{X}=sampleCenter+delta*KERNEL_OFFSET{X};\";\n        var Jf = `\nattribute vec2 position;\n\nuniform vec2 delta;\n\nvarying vec2 sampleCenter;\n#include<kernelBlurVaryingDeclaration>[0..varyingCount]\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nsampleCenter=(position*madd+madd);\n#include<kernelBlurVertex>[0..varyingCount]\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.kernelBlurVertexShader = Jf;\n        var _n = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R) {\n            s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE), y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT), P === void 0 && (P = \"\"), R === void 0 && (R = !1);\n            var B = r.call(this, e, \"kernelBlur\", [\"delta\", \"direction\", \"cameraMinMaxZ\"], [\"circleOfConfusionSampler\"], o, a, s, d, p, null, y, \"kernelBlur\", { varyingCount: 0, depCount: 0 }, !0) || this;\n            return B.blockCompilation = R, B._packedFloat = !1, B._staticDefines = \"\", B._staticDefines = P, B.direction = n, B.onApplyObservable.add(function(F) {\n              B._outputTexture ? F.setFloat2(\"delta\", 1 / B._outputTexture.width * B.direction.x, 1 / B._outputTexture.height * B.direction.y) : F.setFloat2(\"delta\", 1 / B.width * B.direction.x, 1 / B.height * B.direction.y);\n            }), B.kernel = i, B;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"kernel\", { get: function() {\n            return this._idealKernel;\n          }, set: function(e) {\n            this._idealKernel !== e && (e = Math.max(e, 1), this._idealKernel = e, this._kernel = this._nearestBestKernel(e), this.blockCompilation || this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"packedFloat\", { get: function() {\n            return this._packedFloat;\n          }, set: function(e) {\n            this._packedFloat !== e && (this._packedFloat = e, this.blockCompilation || this._updateParameters());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"BlurPostProcess\";\n          }, t.prototype.updateEffect = function(e, n, i, o, a, s) {\n            this._updateParameters(a, s);\n          }, t.prototype._updateParameters = function(e, n) {\n            for (var i = this._kernel, o = (i - 1) / 2, a = [], s = [], d = 0, p = 0; p < i; p++) {\n              var y = p / (i - 1), P = this._gaussianWeight(2 * y - 1);\n              a[p] = p - o, s[p] = P, d += P;\n            }\n            for (p = 0; p < s.length; p++)\n              s[p] /= d;\n            var R = [], B = [], F = [];\n            for (p = 0; p <= o; p += 2) {\n              var z = Math.min(p + 1, Math.floor(o));\n              if (p === z)\n                F.push({ o: a[p], w: s[p] });\n              else {\n                var J = z === o, ie = s[p] + s[z] * (J ? 0.5 : 1), se = a[p] + 1 / (1 + s[p] / s[z]);\n                se === 0 ? (F.push({ o: a[p], w: s[p] }), F.push({ o: a[p + 1], w: s[p + 1] })) : (F.push({ o: se, w: ie }), F.push({ o: -se, w: ie }));\n              }\n            }\n            for (p = 0; p < F.length; p++)\n              B[p] = F[p].o, R[p] = F[p].w;\n            a = B, s = R;\n            var ce = this.getEngine().getCaps().maxVaryingVectors, ue = Math.max(ce, 0) - 1, fe = Math.min(a.length, ue), ve = \"\";\n            for (ve += this._staticDefines, this._staticDefines.indexOf(\"DOF\") != -1 && (ve += \"#define CENTER_WEIGHT \" + this._glslFloat(s[fe - 1]) + `\\r\n`, fe--), p = 0; p < fe; p++)\n              ve += \"#define KERNEL_OFFSET\" + p + \" \" + this._glslFloat(a[p]) + `\\r\n`, ve += \"#define KERNEL_WEIGHT\" + p + \" \" + this._glslFloat(s[p]) + `\\r\n`;\n            var Te = 0;\n            for (p = ue; p < a.length; p++)\n              ve += \"#define KERNEL_DEP_OFFSET\" + Te + \" \" + this._glslFloat(a[p]) + `\\r\n`, ve += \"#define KERNEL_DEP_WEIGHT\" + Te + \" \" + this._glslFloat(s[p]) + `\\r\n`, Te++;\n            this.packedFloat && (ve += \"#define PACKEDFLOAT 1\"), this.blockCompilation = !1, r.prototype.updateEffect.call(this, ve, null, null, { varyingCount: fe, depCount: Te }, e, n);\n          }, t.prototype._nearestBestKernel = function(e) {\n            for (var n = Math.round(e), i = 0, o = [n, n - 1, n + 1, n - 2, n + 2]; i < o.length; i++) {\n              var a = o[i];\n              if (a % 2 != 0 && Math.floor(a / 2) % 2 == 0 && a > 0)\n                return Math.max(a, 3);\n            }\n            return Math.max(n, 3);\n          }, t.prototype._gaussianWeight = function(e) {\n            var n = -e * e / 0.2222222222222222;\n            return 1 / (Math.sqrt(2 * Math.PI) * (1 / 3)) * Math.exp(n);\n          }, t.prototype._glslFloat = function(e, n) {\n            return n === void 0 && (n = 8), e.toFixed(n).replace(/0+$/, \"\");\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.direction, e.kernel, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType, void 0, !1);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)(\"kernel\")], t.prototype, \"_kernel\", void 0), Object(c.c)([Object(L.c)(\"packedFloat\")], t.prototype, \"_packedFloat\", void 0), Object(c.c)([Object(L.n)()], t.prototype, \"direction\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.BlurPostProcess\"] = _n;\n        var Ts = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            a === void 0 && (a = h.a.TEXTURETYPE_UNSIGNED_INT), s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE), d === void 0 && (d = !0);\n            var p = r.call(this, e, n, i, o, !0, a, !1, s, d) || this;\n            return p.scene = i, p.mirrorPlane = new ur.a(0, 1, 0, 1), p._transformMatrix = u.a.Zero(), p._mirrorMatrix = u.a.Zero(), p._adaptiveBlurKernel = 0, p._blurKernelX = 0, p._blurKernelY = 0, p._blurRatio = 1, p.ignoreCameraViewport = !0, p._updateGammaSpace(), p._imageProcessingConfigChangeObserver = i.imageProcessingConfiguration.onUpdateParameters.add(function() {\n              p._updateGammaSpace;\n            }), p.onBeforeRenderObservable.add(function() {\n              u.a.ReflectionToRef(p.mirrorPlane, p._mirrorMatrix), p._savedViewMatrix = i.getViewMatrix(), p._mirrorMatrix.multiplyToRef(p._savedViewMatrix, p._transformMatrix), i.setTransformMatrix(p._transformMatrix, i.getProjectionMatrix()), i.clipPlane = p.mirrorPlane, i.getEngine().cullBackFaces = !1, i._mirroredCameraPosition = u.e.TransformCoordinates(i.activeCamera.globalPosition, p._mirrorMatrix);\n            }), p.onAfterRenderObservable.add(function() {\n              i.setTransformMatrix(p._savedViewMatrix, i.getProjectionMatrix()), i.getEngine().cullBackFaces = !0, i._mirroredCameraPosition = null, i.clipPlane = null;\n            }), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"blurRatio\", { get: function() {\n            return this._blurRatio;\n          }, set: function(e) {\n            this._blurRatio !== e && (this._blurRatio = e, this._preparePostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"adaptiveBlurKernel\", { set: function(e) {\n            this._adaptiveBlurKernel = e, this._autoComputeBlurKernel();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurKernel\", { set: function(e) {\n            this.blurKernelX = e, this.blurKernelY = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurKernelX\", { get: function() {\n            return this._blurKernelX;\n          }, set: function(e) {\n            this._blurKernelX !== e && (this._blurKernelX = e, this._preparePostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurKernelY\", { get: function() {\n            return this._blurKernelY;\n          }, set: function(e) {\n            this._blurKernelY !== e && (this._blurKernelY = e, this._preparePostProcesses());\n          }, enumerable: !1, configurable: !0 }), t.prototype._autoComputeBlurKernel = function() {\n            var e = this.getScene().getEngine(), n = this.getRenderWidth() / e.getRenderWidth(), i = this.getRenderHeight() / e.getRenderHeight();\n            this.blurKernelX = this._adaptiveBlurKernel * n, this.blurKernelY = this._adaptiveBlurKernel * i;\n          }, t.prototype._onRatioRescale = function() {\n            this._sizeRatio && (this.resize(this._initialSizeParameter), this._adaptiveBlurKernel || this._preparePostProcesses()), this._adaptiveBlurKernel && this._autoComputeBlurKernel();\n          }, t.prototype._updateGammaSpace = function() {\n            this.gammaSpace = !this.scene.imageProcessingConfiguration.isEnabled || !this.scene.imageProcessingConfiguration.applyByPostProcess;\n          }, t.prototype._preparePostProcesses = function() {\n            if (this.clearPostProcesses(!0), this._blurKernelX && this._blurKernelY) {\n              var e = this.getScene().getEngine(), n = e.getCaps().textureFloatRender ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_HALF_FLOAT;\n              this._blurX = new _n(\"horizontal blur\", new u.d(1, 0), this._blurKernelX, this._blurRatio, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, n), this._blurX.autoClear = !1, this._blurRatio === 1 && this.samples < 2 && this._texture ? this._blurX.inputTexture = this._texture : this._blurX.alwaysForcePOT = !0, this._blurY = new _n(\"vertical blur\", new u.d(0, 1), this._blurKernelY, this._blurRatio, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, n), this._blurY.autoClear = !1, this._blurY.alwaysForcePOT = this._blurRatio !== 1, this.addPostProcess(this._blurX), this.addPostProcess(this._blurY);\n            } else\n              this._blurY && (this.removePostProcess(this._blurY), this._blurY.dispose(), this._blurY = null), this._blurX && (this.removePostProcess(this._blurX), this._blurX.dispose(), this._blurX = null);\n          }, t.prototype.clone = function() {\n            var e = this.getScene();\n            if (!e)\n              return this;\n            var n = this.getSize(), i = new t(this.name, n.width, e, this._renderTargetOptions.generateMipMaps, this._renderTargetOptions.type, this._renderTargetOptions.samplingMode, this._renderTargetOptions.generateDepthBuffer);\n            return i.hasAlpha = this.hasAlpha, i.level = this.level, i.mirrorPlane = this.mirrorPlane.clone(), this.renderList && (i.renderList = this.renderList.slice(0)), i;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = r.prototype.serialize.call(this);\n            return e.mirrorPlane = this.mirrorPlane.asArray(), e;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigChangeObserver);\n          }, t;\n        }(on);\n        Ne.a._CreateMirror = function(r, t, e, n) {\n          return new Ts(r, t, e, n);\n        };\n        var Hn = f(34), ei = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R, B, F, z) {\n            var J;\n            i === void 0 && (i = null), o === void 0 && (o = !1), a === void 0 && (a = null), s === void 0 && (s = null), d === void 0 && (d = null), p === void 0 && (p = h.a.TEXTUREFORMAT_RGBA), y === void 0 && (y = !1), P === void 0 && (P = null), R === void 0 && (R = !1), B === void 0 && (B = 0.8), F === void 0 && (F = 0);\n            var ie = r.call(this, n) || this;\n            if (ie.onLoadObservable = new C.c(), ie.boundingBoxPosition = u.e.Zero(), ie._rotationY = 0, ie._files = null, ie._forcedExtension = null, ie._extensions = null, ie.name = e, ie.url = e, ie._noMipmap = o, ie.hasAlpha = !1, ie._format = p, ie.isCube = !0, ie._textureMatrix = u.a.Identity(), ie._createPolynomials = R, ie.coordinatesMode = Ne.a.CUBIC_MODE, ie._extensions = i, ie._files = a, ie._forcedExtension = P, ie._loaderOptions = z, !e && !a)\n              return ie;\n            var se = e.lastIndexOf(\".\"), ce = P || (se > -1 ? e.substring(se).toLowerCase() : \"\"), ue = ce === \".dds\", fe = ce === \".env\";\n            if (fe ? (ie.gammaSpace = !1, ie._prefiltered = !1, ie.anisotropicFilteringLevel = 1) : (ie._prefiltered = y, y && (ie.gammaSpace = !1, ie.anisotropicFilteringLevel = 1)), ie._texture = ie._getFromCache(e, o), !a && (fe || ue || i || (i = [\"_px.jpg\", \"_py.jpg\", \"_pz.jpg\", \"_nx.jpg\", \"_ny.jpg\", \"_nz.jpg\"]), a = [], i))\n              for (var ve = 0; ve < i.length; ve++)\n                a.push(e + i[ve]);\n            ie._files = a;\n            var Te = function() {\n              ie.onLoadObservable.notifyObservers(ie), s && s();\n            };\n            if (ie._texture)\n              ie._texture.isReady ? Xe.b.SetImmediate(function() {\n                return Te();\n              }) : ie._texture.onLoadedObservable.add(function() {\n                return Te();\n              });\n            else {\n              var Re = ie.getScene();\n              Re != null && Re.useDelayedTextureLoading ? ie.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : (ie._texture = y ? ie._getEngine().createPrefilteredCubeTexture(e, Re, B, F, s, d, p, P, ie._createPolynomials) : ie._getEngine().createCubeTexture(e, Re, a, o, s, d, ie._format, P, !1, B, F, null, z), (J = ie._texture) === null || J === void 0 || J.onLoadedObservable.add(function() {\n                return ie.onLoadObservable.notifyObservers(ie);\n              }));\n            }\n            return ie;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"boundingBoxSize\", { get: function() {\n            return this._boundingBoxSize;\n          }, set: function(e) {\n            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {\n              this._boundingBoxSize = e;\n              var n = this.getScene();\n              n && n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotationY\", { get: function() {\n            return this._rotationY;\n          }, set: function(e) {\n            this._rotationY = e, this.setReflectionTextureMatrix(u.a.RotationY(this._rotationY));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"noMipmap\", { get: function() {\n            return this._noMipmap;\n          }, enumerable: !1, configurable: !0 }), t.CreateFromImages = function(e, n, i) {\n            var o = \"\";\n            return e.forEach(function(a) {\n              return o += a;\n            }), new t(o, n, null, i, e);\n          }, t.CreateFromPrefilteredData = function(e, n, i, o) {\n            i === void 0 && (i = null), o === void 0 && (o = !0);\n            var a = n.useDelayedTextureLoading;\n            n.useDelayedTextureLoading = !1;\n            var s = new t(e, n, null, !1, null, null, null, void 0, !0, i, o);\n            return n.useDelayedTextureLoading = a, s;\n          }, t.prototype.getClassName = function() {\n            return \"CubeTexture\";\n          }, t.prototype.updateURL = function(e, n, i, o) {\n            var a;\n            o === void 0 && (o = !1), this.url && (this.releaseInternalTexture(), (a = this.getScene()) === null || a === void 0 || a.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag)), this.name && !Hn.a.StartsWith(this.name, \"data:\") || (this.name = e), this.url = e, this.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED, this._prefiltered = o, this._prefiltered && (this.gammaSpace = !1, this.anisotropicFilteringLevel = 1), this._forcedExtension = n || null, i && (this._delayedOnLoad = i), this.delayLoad(n);\n          }, t.prototype.delayLoad = function(e) {\n            var n, i = this;\n            if (this.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = h.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap), !this._texture)) {\n              var o = this.getScene();\n              this._prefiltered ? this._texture = this._getEngine().createPrefilteredCubeTexture(this.url, o, 0.8, 0, this._delayedOnLoad, void 0, this._format, e, this._createPolynomials) : this._texture = this._getEngine().createCubeTexture(this.url, o, this._files, this._noMipmap, this._delayedOnLoad, null, this._format, e, !1, 0, 0, null, this._loaderOptions), (n = this._texture) === null || n === void 0 || n.onLoadedObservable.add(function() {\n                return i.onLoadObservable.notifyObservers(i);\n              });\n            }\n          }, t.prototype.getReflectionTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.setReflectionTextureMatrix = function(e) {\n            var n, i = this;\n            e.updateFlag !== this._textureMatrix.updateFlag && (e.isIdentity() !== this._textureMatrix.isIdentity() && ((n = this.getScene()) === null || n === void 0 || n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag, function(o) {\n              return o.getActiveTextures().indexOf(i) !== -1;\n            })), this._textureMatrix = e);\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              var p = !1;\n              return e.prefiltered && (p = e.prefiltered), new t(i + e.name, n, e.extensions, !1, e.files || null, null, null, void 0, p, e.forcedExtension);\n            }, e, n);\n            if (e.boundingBoxPosition && (o.boundingBoxPosition = u.e.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (o.boundingBoxSize = u.e.FromArray(e.boundingBoxSize)), e.animations)\n              for (var a = 0; a < e.animations.length; a++) {\n                var s = e.animations[a], d = O.a.GetClass(\"BABYLON.Animation\");\n                d && o.animations.push(d.Parse(s));\n              }\n            return o;\n          }, t.prototype.clone = function() {\n            var e = this, n = 0, i = L.a.Clone(function() {\n              var o = new t(e.url, e.getScene() || e._getEngine(), e._extensions, e._noMipmap, e._files);\n              return n = o.uniqueId, o;\n            }, this);\n            return i.uniqueId = n, i;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"url\", void 0), Object(c.c)([Object(L.c)(\"rotationY\")], t.prototype, \"rotationY\", null), Object(c.c)([Object(L.c)(\"files\")], t.prototype, \"_files\", void 0), Object(c.c)([Object(L.c)(\"forcedExtension\")], t.prototype, \"_forcedExtension\", void 0), Object(c.c)([Object(L.c)(\"extensions\")], t.prototype, \"_extensions\", void 0), Object(c.c)([Object(L.j)(\"textureMatrix\")], t.prototype, \"_textureMatrix\", void 0), t;\n        }(kn.a);\n        Ne.a._CubeTextureParser = ei.Parse, O.a.RegisteredTypes[\"BABYLON.CubeTexture\"] = ei;\n        var $e = f(15), zo = f(76), jo = f(87), lt = f(19), $f = ` uniform vec4 vPrimaryColor;\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nuniform vec4 vPrimaryColorShadow;\n#endif\nuniform float shadowLevel;\nuniform float alpha;\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#endif\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif`;\n        ze.a.IncludesShadersStore.backgroundFragmentDeclaration = $f;\n        var ep = `layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec4 vPrimaryColor;\nuniform vec4 vPrimaryColorShadow;\nuniform vec2 vDiffuseInfos;\nuniform vec2 vReflectionInfos;\nuniform mat4 diffuseMatrix;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\nuniform float pointSize;\nuniform float shadowLevel;\nuniform float alpha;\n#if defined(REFLECTIONFRESNEL) || defined(OPACITYFRESNEL)\nuniform vec3 vBackgroundCenter;\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 vReflectionControl;\n#endif\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};`;\n        ze.a.IncludesShadersStore.backgroundUboDeclaration = ep, f(131), f(106), f(107), f(154), f(130), f(115), f(125), f(110), f(135), f(136);\n        var tp = `#ifdef TEXTURELODSUPPORT\n#extension GL_EXT_shader_texture_lod : enable\n#endif\nprecision highp float;\n#include<__decl__backgroundFragment>\n#define RECIPROCAL_PI2 0.15915494\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef TEXTURELODSUPPORT\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE;\n#endif\n\n#ifndef SHADOWONLY\n#define SHADOWONLY;\n#endif\n#include<imageProcessingDeclaration>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<helperFunctions>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<imageProcessingFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\n#ifdef REFLECTIONFRESNEL\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\nvec3 fresnelSchlickEnvironmentGGX(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(0.0,1.0,0.0);\n#endif\n\nfloat shadow=1.;\nfloat globalShadow=0.;\nfloat shadowLightCount=0.;\n#include<lightFragment>[0..maxSimultaneousLights]\n#ifdef SHADOWINUSE\nglobalShadow/=shadowLightCount;\n#else\nglobalShadow=1.0;\n#endif\n#ifndef BACKMAT_SHADOWONLY\n\nvec4 reflectionColor=vec4(1.,1.,1.,1.);\n#ifdef REFLECTION\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=reflectionVector;\n#else\nvec2 reflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n#ifdef REFLECTIONBLUR\nfloat reflectionLOD=vReflectionInfos.y;\n#ifdef TEXTURELODSUPPORT\n\nreflectionLOD=reflectionLOD*log2(vReflectionMicrosurfaceInfos.x)*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\nreflectionColor=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD);\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 reflectionSpecularMid=sampleReflection(reflectionSampler,reflectionCoords);\nif(lodReflectionNormalizedDoubled<1.0){\nreflectionColor=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nreflectionSpecularMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nreflectionColor=mix(\nreflectionSpecularMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#else\nvec4 reflectionSample=sampleReflection(reflectionSampler,reflectionCoords);\nreflectionColor=reflectionSample;\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor.rgb=fromRGBD(reflectionColor);\n#endif\n#ifdef GAMMAREFLECTION\nreflectionColor.rgb=toLinearSpace(reflectionColor.rgb);\n#endif\n#ifdef REFLECTIONBGR\nreflectionColor.rgb=reflectionColor.bgr;\n#endif\n\nreflectionColor.rgb*=vReflectionInfos.x;\n#endif\n\nvec3 diffuseColor=vec3(1.,1.,1.);\nfloat finalAlpha=alpha;\n#ifdef DIFFUSE\nvec4 diffuseMap=texture2D(diffuseSampler,vDiffuseUV);\n#ifdef GAMMADIFFUSE\ndiffuseMap.rgb=toLinearSpace(diffuseMap.rgb);\n#endif\n\ndiffuseMap.rgb*=vDiffuseInfos.y;\n#ifdef DIFFUSEHASALPHA\nfinalAlpha*=diffuseMap.a;\n#endif\ndiffuseColor=diffuseMap.rgb;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 colorBase=diffuseColor;\n#else\nvec3 colorBase=reflectionColor.rgb*diffuseColor;\n#endif\ncolorBase=max(colorBase,0.0);\n\n#ifdef USERGBCOLOR\nvec3 finalColor=colorBase;\n#else\n#ifdef USEHIGHLIGHTANDSHADOWCOLORS\nvec3 mainColor=mix(vPrimaryColorShadow.rgb,vPrimaryColor.rgb,colorBase);\n#else\nvec3 mainColor=vPrimaryColor.rgb;\n#endif\nvec3 finalColor=colorBase*mainColor;\n#endif\n\n#ifdef REFLECTIONFRESNEL\nvec3 reflectionAmount=vReflectionControl.xxx;\nvec3 reflectionReflectance0=vReflectionControl.yyy;\nvec3 reflectionReflectance90=vReflectionControl.zzz;\nfloat VdotN=dot(normalize(vEyePosition),normalW);\nvec3 planarReflectionFresnel=fresnelSchlickEnvironmentGGX(saturate(VdotN),reflectionReflectance0,reflectionReflectance90,1.0);\nreflectionAmount*=planarReflectionFresnel;\n#ifdef REFLECTIONFALLOFF\nfloat reflectionDistanceFalloff=1.0-saturate(length(vPositionW.xyz-vBackgroundCenter)*vReflectionControl.w);\nreflectionDistanceFalloff*=reflectionDistanceFalloff;\nreflectionAmount*=reflectionDistanceFalloff;\n#endif\nfinalColor=mix(finalColor,reflectionColor.rgb,saturate(reflectionAmount));\n#endif\n#ifdef OPACITYFRESNEL\nfloat viewAngleToFloor=dot(normalW,normalize(vEyePosition-vBackgroundCenter));\n\nconst float startAngle=0.1;\nfloat fadeFactor=saturate(viewAngleToFloor/startAngle);\nfinalAlpha*=fadeFactor*fadeFactor;\n#endif\n\n#ifdef SHADOWINUSE\nfinalColor=mix(finalColor*shadowLevel,finalColor,globalShadow);\n#endif\n\nvec4 color=vec4(finalColor,finalAlpha);\n#else\nvec4 color=vec4(vPrimaryColor.rgb,(1.0-clamp(globalShadow,0.,1.))*alpha);\n#endif\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\ncolor.rgb=clamp(color.rgb,0.,30.0);\n#else\n\ncolor=applyImageProcessing(color);\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\n#ifdef NOISE\ncolor.rgb+=dither(vPositionW.xy,0.5);\ncolor=max(color,0.0);\n#endif\ngl_FragColor=color;\n}\n`;\n        ze.a.ShadersStore.backgroundPixelShader = tp;\n        var np = `uniform mat4 view;\nuniform mat4 viewProjection;\nuniform float shadowLevel;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float fFovMultiplier;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif`;\n        ze.a.IncludesShadersStore.backgroundVertexDeclaration = np, f(78), f(79), f(117), f(137), f(80), f(81), f(111), f(157), f(138);\n        var ip = `precision highp float;\n#include<__decl__backgroundVertex>\n#include<helperFunctions>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\nvoid main(void) {\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=position;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n} else {\ngl_Position=viewProjectionR*finalWorld*vec4(position,1.0);\n}\n#else\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#endif\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normal);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(position,0.0)));\n#ifdef EQUIRECTANGULAR_RELFECTION_FOV\nmat3 screenToWorld=inverseMat3(mat3(finalWorld*viewProjection));\nvec3 segment=mix(vDirectionW,screenToWorld*vec3(0.0,0.0,1.0),abs(fFovMultiplier-1.0));\nif (fFovMultiplier<=1.0) {\nvDirectionW=normalize(segment);\n} else {\nvDirectionW=normalize(vDirectionW+(vDirectionW-segment));\n}\n#endif\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n`;\n        ze.a.ShadersStore.backgroundVertexShader = ip;\n        var _r = f(67), rp = function(r) {\n          function t() {\n            var e = r.call(this) || this;\n            return e.DIFFUSE = !1, e.DIFFUSEDIRECTUV = 0, e.GAMMADIFFUSE = !1, e.DIFFUSEHASALPHA = !1, e.OPACITYFRESNEL = !1, e.REFLECTIONBLUR = !1, e.REFLECTIONFRESNEL = !1, e.REFLECTIONFALLOFF = !1, e.TEXTURELODSUPPORT = !1, e.PREMULTIPLYALPHA = !1, e.USERGBCOLOR = !1, e.USEHIGHLIGHTANDSHADOWCOLORS = !1, e.BACKMAT_SHADOWONLY = !1, e.NOISE = !1, e.REFLECTIONBGR = !1, e.IMAGEPROCESSING = !1, e.VIGNETTE = !1, e.VIGNETTEBLENDMODEMULTIPLY = !1, e.VIGNETTEBLENDMODEOPAQUE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = !1, e.SAMPLER3DBGRMAP = !1, e.IMAGEPROCESSINGPOSTPROCESS = !1, e.EXPOSURE = !1, e.MULTIVIEW = !1, e.REFLECTION = !1, e.REFLECTIONMAP_3D = !1, e.REFLECTIONMAP_SPHERICAL = !1, e.REFLECTIONMAP_PLANAR = !1, e.REFLECTIONMAP_CUBIC = !1, e.REFLECTIONMAP_PROJECTION = !1, e.REFLECTIONMAP_SKYBOX = !1, e.REFLECTIONMAP_EXPLICIT = !1, e.REFLECTIONMAP_EQUIRECTANGULAR = !1, e.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, e.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, e.INVERTCUBICMAP = !1, e.REFLECTIONMAP_OPPOSITEZ = !1, e.LODINREFLECTIONALPHA = !1, e.GAMMAREFLECTION = !1, e.RGBDREFLECTION = !1, e.EQUIRECTANGULAR_RELFECTION_FOV = !1, e.MAINUV1 = !1, e.MAINUV2 = !1, e.UV1 = !1, e.UV2 = !1, e.CLIPPLANE = !1, e.CLIPPLANE2 = !1, e.CLIPPLANE3 = !1, e.CLIPPLANE4 = !1, e.CLIPPLANE5 = !1, e.CLIPPLANE6 = !1, e.POINTSIZE = !1, e.FOG = !1, e.NORMAL = !1, e.NUM_BONE_INFLUENCERS = 0, e.BonesPerMesh = 0, e.INSTANCES = !1, e.SHADOWFLOAT = !1, e.rebuild(), e;\n          }\n          return Object(c.d)(t, r), t;\n        }(zo.a), qr = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.primaryColor = I.a.White(), i._primaryColorShadowLevel = 0, i._primaryColorHighlightLevel = 0, i.reflectionTexture = null, i.reflectionBlur = 0, i.diffuseTexture = null, i._shadowLights = null, i.shadowLights = null, i.shadowLevel = 0, i.sceneCenter = u.e.Zero(), i.opacityFresnel = !0, i.reflectionFresnel = !1, i.reflectionFalloffDistance = 0, i.reflectionAmount = 1, i.reflectionReflectance0 = 0.05, i.reflectionReflectance90 = 0.5, i.useRGBColor = !0, i.enableNoise = !1, i._fovMultiplier = 1, i.useEquirectangularFOV = !1, i._maxSimultaneousLights = 4, i.maxSimultaneousLights = 4, i._shadowOnly = !1, i.shadowOnly = !1, i._imageProcessingObserver = null, i.switchToBGR = !1, i._renderTargets = new si.a(16), i._reflectionControls = u.f.Zero(), i._white = I.a.White(), i._primaryShadowColor = I.a.Black(), i._primaryHighlightColor = I.a.Black(), i._attachImageProcessingConfiguration(null), i.getRenderTargetTextures = function() {\n              return i._renderTargets.reset(), i._diffuseTexture && i._diffuseTexture.isRenderTarget && i._renderTargets.push(i._diffuseTexture), i._reflectionTexture && i._reflectionTexture.isRenderTarget && i._renderTargets.push(i._reflectionTexture), i._renderTargets;\n            }, i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"_perceptualColor\", { get: function() {\n            return this.__perceptualColor;\n          }, set: function(e) {\n            this.__perceptualColor = e, this._computePrimaryColorFromPerceptualColor(), this._markAllSubMeshesAsLightsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"primaryColorShadowLevel\", { get: function() {\n            return this._primaryColorShadowLevel;\n          }, set: function(e) {\n            this._primaryColorShadowLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"primaryColorHighlightLevel\", { get: function() {\n            return this._primaryColorHighlightLevel;\n          }, set: function(e) {\n            this._primaryColorHighlightLevel = e, this._computePrimaryColors(), this._markAllSubMeshesAsLightsDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflectionStandardFresnelWeight\", { set: function(e) {\n            var n = e;\n            n < 0.5 ? (n *= 2, this.reflectionReflectance0 = t.StandardReflectance0 * n, this.reflectionReflectance90 = t.StandardReflectance90 * n) : (n = 2 * n - 1, this.reflectionReflectance0 = t.StandardReflectance0 + (1 - t.StandardReflectance0) * n, this.reflectionReflectance90 = t.StandardReflectance90 + (1 - t.StandardReflectance90) * n);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fovMultiplier\", { get: function() {\n            return this._fovMultiplier;\n          }, set: function(e) {\n            isNaN(e) && (e = 1), this._fovMultiplier = Math.max(0, Math.min(2, e));\n          }, enumerable: !1, configurable: !0 }), t.prototype._attachImageProcessingConfiguration = function(e) {\n            var n = this;\n            e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              n._computePrimaryColorFromPerceptualColor(), n._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraToneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraExposure\", { get: function() {\n            return this._imageProcessingConfiguration.exposure;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.exposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraContrast\", { get: function() {\n            return this._imageProcessingConfiguration.contrast;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.contrast = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingTexture\", { get: function() {\n            return this._imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurves\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurves;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurves = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !(!this._diffuseTexture || !this._diffuseTexture.isRenderTarget) || !(!this._reflectionTexture || !this._reflectionTexture.isRenderTarget);\n          }, enumerable: !1, configurable: !0 }), t.prototype.needAlphaTesting = function() {\n            return !0;\n          }, t.prototype.needAlphaBlending = function() {\n            return this.alpha < 1 || this._diffuseTexture != null && this._diffuseTexture.hasAlpha || this._shadowOnly;\n          }, t.prototype.isReadyForSubMesh = function(e, n, i) {\n            var o = this;\n            if (i === void 0 && (i = !1), n.effect && this.isFrozen && n.effect._wasPreviouslyReady)\n              return !0;\n            n._materialDefines || (n._materialDefines = new rp());\n            var a = this.getScene(), s = n._materialDefines;\n            if (this._isReadyForSubMesh(n))\n              return !0;\n            var d = a.getEngine();\n            if ($e.a.PrepareDefinesForLights(a, e, s, !1, this._maxSimultaneousLights), s._needNormals = !0, $e.a.PrepareDefinesForMultiview(a, s), s._areTexturesDirty) {\n              if (s._needUVs = !1, a.texturesEnabled) {\n                if (a.getEngine().getCaps().textureLOD && (s.TEXTURELODSUPPORT = !0), this._diffuseTexture && lt.a.DiffuseTextureEnabled) {\n                  if (!this._diffuseTexture.isReadyOrNotBlocking())\n                    return !1;\n                  $e.a.PrepareDefinesForMergedUV(this._diffuseTexture, s, \"DIFFUSE\"), s.DIFFUSEHASALPHA = this._diffuseTexture.hasAlpha, s.GAMMADIFFUSE = this._diffuseTexture.gammaSpace, s.OPACITYFRESNEL = this._opacityFresnel;\n                } else\n                  s.DIFFUSE = !1, s.DIFFUSEHASALPHA = !1, s.GAMMADIFFUSE = !1, s.OPACITYFRESNEL = !1;\n                var p = this._reflectionTexture;\n                if (p && lt.a.ReflectionTextureEnabled) {\n                  if (!p.isReadyOrNotBlocking())\n                    return !1;\n                  switch (s.REFLECTION = !0, s.GAMMAREFLECTION = p.gammaSpace, s.RGBDREFLECTION = p.isRGBD, s.REFLECTIONBLUR = this._reflectionBlur > 0, s.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !p.invertZ : p.invertZ, s.LODINREFLECTIONALPHA = p.lodLevelInAlpha, s.EQUIRECTANGULAR_RELFECTION_FOV = this.useEquirectangularFOV, s.REFLECTIONBGR = this.switchToBGR, p.coordinatesMode === Ne.a.INVCUBIC_MODE && (s.INVERTCUBICMAP = !0), s.REFLECTIONMAP_3D = p.isCube, p.coordinatesMode) {\n                    case Ne.a.EXPLICIT_MODE:\n                      s.REFLECTIONMAP_EXPLICIT = !0;\n                      break;\n                    case Ne.a.PLANAR_MODE:\n                      s.REFLECTIONMAP_PLANAR = !0;\n                      break;\n                    case Ne.a.PROJECTION_MODE:\n                      s.REFLECTIONMAP_PROJECTION = !0;\n                      break;\n                    case Ne.a.SKYBOX_MODE:\n                      s.REFLECTIONMAP_SKYBOX = !0;\n                      break;\n                    case Ne.a.SPHERICAL_MODE:\n                      s.REFLECTIONMAP_SPHERICAL = !0;\n                      break;\n                    case Ne.a.EQUIRECTANGULAR_MODE:\n                      s.REFLECTIONMAP_EQUIRECTANGULAR = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MODE:\n                      s.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:\n                      s.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.CUBIC_MODE:\n                    case Ne.a.INVCUBIC_MODE:\n                    default:\n                      s.REFLECTIONMAP_CUBIC = !0;\n                  }\n                  this.reflectionFresnel ? (s.REFLECTIONFRESNEL = !0, s.REFLECTIONFALLOFF = this.reflectionFalloffDistance > 0, this._reflectionControls.x = this.reflectionAmount, this._reflectionControls.y = this.reflectionReflectance0, this._reflectionControls.z = this.reflectionReflectance90, this._reflectionControls.w = 1 / this.reflectionFalloffDistance) : (s.REFLECTIONFRESNEL = !1, s.REFLECTIONFALLOFF = !1);\n                } else\n                  s.REFLECTION = !1, s.REFLECTIONFRESNEL = !1, s.REFLECTIONFALLOFF = !1, s.REFLECTIONBLUR = !1, s.REFLECTIONMAP_3D = !1, s.REFLECTIONMAP_SPHERICAL = !1, s.REFLECTIONMAP_PLANAR = !1, s.REFLECTIONMAP_CUBIC = !1, s.REFLECTIONMAP_PROJECTION = !1, s.REFLECTIONMAP_SKYBOX = !1, s.REFLECTIONMAP_EXPLICIT = !1, s.REFLECTIONMAP_EQUIRECTANGULAR = !1, s.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, s.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, s.INVERTCUBICMAP = !1, s.REFLECTIONMAP_OPPOSITEZ = !1, s.LODINREFLECTIONALPHA = !1, s.GAMMAREFLECTION = !1, s.RGBDREFLECTION = !1;\n              }\n              s.PREMULTIPLYALPHA = this.alphaMode === h.a.ALPHA_PREMULTIPLIED || this.alphaMode === h.a.ALPHA_PREMULTIPLIED_PORTERDUFF, s.USERGBCOLOR = this._useRGBColor, s.NOISE = this._enableNoise;\n            }\n            if (s._areLightsDirty && (s.USEHIGHLIGHTANDSHADOWCOLORS = !this._useRGBColor && (this._primaryColorShadowLevel !== 0 || this._primaryColorHighlightLevel !== 0), s.BACKMAT_SHADOWONLY = this._shadowOnly), s._areImageProcessingDirty && this._imageProcessingConfiguration) {\n              if (!this._imageProcessingConfiguration.isReady())\n                return !1;\n              this._imageProcessingConfiguration.prepareDefines(s);\n            }\n            if ($e.a.PrepareDefinesForMisc(e, a, !1, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e), s), $e.a.PrepareDefinesForFrameBoundValues(a, d, s, i, null, n.getRenderingMesh().hasThinInstances), $e.a.PrepareDefinesForAttributes(e, s, !1, !0, !1) && e && (a.getEngine().getCaps().standardDerivatives || e.isVerticesDataPresent(Oe.b.NormalKind) || (e.createNormals(!0), l.a.Warn(\"BackgroundMaterial: Normals have been created for the mesh: \" + e.name))), s.isDirty) {\n              s.markAsProcessed(), a.resetCachedMaterial();\n              var y = new _r.a();\n              s.FOG && y.addFallback(0, \"FOG\"), s.POINTSIZE && y.addFallback(1, \"POINTSIZE\"), s.MULTIVIEW && y.addFallback(0, \"MULTIVIEW\"), $e.a.HandleFallbacksForShadows(s, y, this._maxSimultaneousLights);\n              var P = [Oe.b.PositionKind];\n              s.NORMAL && P.push(Oe.b.NormalKind), s.UV1 && P.push(Oe.b.UVKind), s.UV2 && P.push(Oe.b.UV2Kind), $e.a.PrepareAttributesForBones(P, e, s, y), $e.a.PrepareAttributesForInstances(P, s);\n              var R = [\"world\", \"view\", \"viewProjection\", \"vEyePosition\", \"vLightsType\", \"vFogInfos\", \"vFogColor\", \"pointSize\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"mBones\", \"vPrimaryColor\", \"vPrimaryColorShadow\", \"vReflectionInfos\", \"reflectionMatrix\", \"vReflectionMicrosurfaceInfos\", \"fFovMultiplier\", \"shadowLevel\", \"alpha\", \"vBackgroundCenter\", \"vReflectionControl\", \"vDiffuseInfos\", \"diffuseMatrix\"], B = [\"diffuseSampler\", \"reflectionSampler\", \"reflectionSamplerLow\", \"reflectionSamplerHigh\"], F = [\"Material\", \"Scene\"];\n              vn.a && (vn.a.PrepareUniforms(R, s), vn.a.PrepareSamplers(B, s)), $e.a.PrepareUniformsAndSamplersList({ uniformsNames: R, uniformBuffersNames: F, samplers: B, defines: s, maxSimultaneousLights: this._maxSimultaneousLights });\n              var z = s.toString();\n              n.setEffect(a.getEngine().createEffect(\"background\", { attributes: P, uniformsNames: R, uniformBuffersNames: F, samplers: B, defines: z, fallbacks: y, onCompiled: function(J) {\n                o.onCompiled && o.onCompiled(J), o.bindSceneUniformBuffer(J, a.getSceneUniformBuffer());\n              }, onError: this.onError, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights } }, d), s), this.buildUniformLayout();\n            }\n            return !(!n.effect || !n.effect.isReady()) && (s._renderId = a.getRenderId(), n.effect._wasPreviouslyReady = !0, !0);\n          }, t.prototype._computePrimaryColorFromPerceptualColor = function() {\n            this.__perceptualColor && (this._primaryColor.copyFrom(this.__perceptualColor), this._primaryColor.toLinearSpaceToRef(this._primaryColor), this._imageProcessingConfiguration && this._primaryColor.scaleToRef(1 / this._imageProcessingConfiguration.exposure, this._primaryColor), this._computePrimaryColors());\n          }, t.prototype._computePrimaryColors = function() {\n            this._primaryColorShadowLevel === 0 && this._primaryColorHighlightLevel === 0 || (this._primaryColor.scaleToRef(this._primaryColorShadowLevel, this._primaryShadowColor), this._primaryColor.subtractToRef(this._primaryShadowColor, this._primaryShadowColor), this._white.subtractToRef(this._primaryColor, this._primaryHighlightColor), this._primaryHighlightColor.scaleToRef(this._primaryColorHighlightLevel, this._primaryHighlightColor), this._primaryColor.addToRef(this._primaryHighlightColor, this._primaryHighlightColor));\n          }, t.prototype.buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vPrimaryColor\", 4), this._uniformBuffer.addUniform(\"vPrimaryColorShadow\", 4), this._uniformBuffer.addUniform(\"vDiffuseInfos\", 2), this._uniformBuffer.addUniform(\"vReflectionInfos\", 2), this._uniformBuffer.addUniform(\"diffuseMatrix\", 16), this._uniformBuffer.addUniform(\"reflectionMatrix\", 16), this._uniformBuffer.addUniform(\"vReflectionMicrosurfaceInfos\", 3), this._uniformBuffer.addUniform(\"fFovMultiplier\", 1), this._uniformBuffer.addUniform(\"pointSize\", 1), this._uniformBuffer.addUniform(\"shadowLevel\", 1), this._uniformBuffer.addUniform(\"alpha\", 1), this._uniformBuffer.addUniform(\"vBackgroundCenter\", 3), this._uniformBuffer.addUniform(\"vReflectionControl\", 4), this._uniformBuffer.create();\n          }, t.prototype.unbind = function() {\n            this._diffuseTexture && this._diffuseTexture.isRenderTarget && this._uniformBuffer.setTexture(\"diffuseSampler\", null), this._reflectionTexture && this._reflectionTexture.isRenderTarget && this._uniformBuffer.setTexture(\"reflectionSampler\", null), r.prototype.unbind.call(this);\n          }, t.prototype.bindOnlyWorldMatrix = function(e) {\n            this._activeEffect.setMatrix(\"world\", e);\n          }, t.prototype.bindForSubMesh = function(e, n, i) {\n            var o = this.getScene(), a = i._materialDefines;\n            if (a) {\n              var s = i.effect;\n              if (s) {\n                this._activeEffect = s, this.bindOnlyWorldMatrix(e), $e.a.BindBonesParameters(n, this._activeEffect);\n                var d = this._mustRebind(o, s, n.visibility);\n                if (d) {\n                  this._uniformBuffer.bindToEffect(s, \"Material\"), this.bindViewProjection(s);\n                  var p = this._reflectionTexture;\n                  this._uniformBuffer.useUbo && this.isFrozen && this._uniformBuffer.isSync || (o.texturesEnabled && (this._diffuseTexture && lt.a.DiffuseTextureEnabled && (this._uniformBuffer.updateFloat2(\"vDiffuseInfos\", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level), $e.a.BindTextureMatrix(this._diffuseTexture, this._uniformBuffer, \"diffuse\")), p && lt.a.ReflectionTextureEnabled && (this._uniformBuffer.updateMatrix(\"reflectionMatrix\", p.getReflectionTextureMatrix()), this._uniformBuffer.updateFloat2(\"vReflectionInfos\", p.level, this._reflectionBlur), this._uniformBuffer.updateFloat3(\"vReflectionMicrosurfaceInfos\", p.getSize().width, p.lodGenerationScale, p.lodGenerationOffset))), this.shadowLevel > 0 && this._uniformBuffer.updateFloat(\"shadowLevel\", this.shadowLevel), this._uniformBuffer.updateFloat(\"alpha\", this.alpha), this.pointsCloud && this._uniformBuffer.updateFloat(\"pointSize\", this.pointSize), a.USEHIGHLIGHTANDSHADOWCOLORS ? (this._uniformBuffer.updateColor4(\"vPrimaryColor\", this._primaryHighlightColor, 1), this._uniformBuffer.updateColor4(\"vPrimaryColorShadow\", this._primaryShadowColor, 1)) : this._uniformBuffer.updateColor4(\"vPrimaryColor\", this._primaryColor, 1)), this._uniformBuffer.updateFloat(\"fFovMultiplier\", this._fovMultiplier), o.texturesEnabled && (this._diffuseTexture && lt.a.DiffuseTextureEnabled && this._uniformBuffer.setTexture(\"diffuseSampler\", this._diffuseTexture), p && lt.a.ReflectionTextureEnabled && (a.REFLECTIONBLUR && a.TEXTURELODSUPPORT ? this._uniformBuffer.setTexture(\"reflectionSampler\", p) : a.REFLECTIONBLUR ? (this._uniformBuffer.setTexture(\"reflectionSampler\", p._lodTextureMid || p), this._uniformBuffer.setTexture(\"reflectionSamplerLow\", p._lodTextureLow || p), this._uniformBuffer.setTexture(\"reflectionSamplerHigh\", p._lodTextureHigh || p)) : this._uniformBuffer.setTexture(\"reflectionSampler\", p), a.REFLECTIONFRESNEL && (this._uniformBuffer.updateFloat3(\"vBackgroundCenter\", this.sceneCenter.x, this.sceneCenter.y, this.sceneCenter.z), this._uniformBuffer.updateFloat4(\"vReflectionControl\", this._reflectionControls.x, this._reflectionControls.y, this._reflectionControls.z, this._reflectionControls.w)))), $e.a.BindClipPlane(this._activeEffect, o), $e.a.BindEyePosition(s, o);\n                }\n                !d && this.isFrozen || (o.lightsEnabled && $e.a.BindLights(o, n, this._activeEffect, a, this._maxSimultaneousLights, !1), this.bindView(s), $e.a.BindFogParameters(o, n, this._activeEffect, !0), this._imageProcessingConfiguration && this._imageProcessingConfiguration.bind(this._activeEffect)), this._uniformBuffer.update(), this._afterBind(n, this._activeEffect);\n              }\n            }\n          }, t.prototype.hasTexture = function(e) {\n            return !!r.prototype.hasTexture.call(this, e) || this._reflectionTexture === e || this._diffuseTexture === e;\n          }, t.prototype.dispose = function(e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = !1), n && (this.diffuseTexture && this.diffuseTexture.dispose(), this.reflectionTexture && this.reflectionTexture.dispose()), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), r.prototype.dispose.call(this, e);\n          }, t.prototype.clone = function(e) {\n            var n = this;\n            return L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.BackgroundMaterial\", e;\n          }, t.prototype.getClassName = function() {\n            return \"BackgroundMaterial\";\n          }, t.Parse = function(e, n, i) {\n            return L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n          }, t.StandardReflectance0 = 0.05, t.StandardReflectance90 = 0.5, Object(c.c)([Object(L.e)()], t.prototype, \"_primaryColor\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"primaryColor\", void 0), Object(c.c)([Object(L.e)()], t.prototype, \"__perceptualColor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_primaryColorShadowLevel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_primaryColorHighlightLevel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"primaryColorHighlightLevel\", null), Object(c.c)([Object(L.m)()], t.prototype, \"_reflectionTexture\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionBlur\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionBlur\", void 0), Object(c.c)([Object(L.m)()], t.prototype, \"_diffuseTexture\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"diffuseTexture\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"shadowLights\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_shadowLevel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"shadowLevel\", void 0), Object(c.c)([Object(L.o)()], t.prototype, \"_sceneCenter\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"sceneCenter\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_opacityFresnel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"opacityFresnel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionFresnel\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionFresnel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionFalloffDistance\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionFalloffDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionAmount\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionAmount\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionReflectance0\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionReflectance0\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_reflectionReflectance90\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionReflectance90\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_useRGBColor\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRGBColor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_enableNoise\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"enableNoise\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_maxSimultaneousLights\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"maxSimultaneousLights\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_shadowOnly\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"shadowOnly\", void 0), Object(c.c)([Object(L.i)()], t.prototype, \"_imageProcessingConfiguration\", void 0), t;\n        }(jo.a);\n        O.a.RegisteredTypes[\"BABYLON.BackgroundMaterial\"] = qr;\n        var Es = function() {\n          function r(t, e) {\n            var n = this;\n            this._errorHandler = function(i, o) {\n              n.onErrorObservable.notifyObservers({ message: i, exception: o });\n            }, this._options = Object(c.a)(Object(c.a)({}, r._getDefaultOptions()), t), this._scene = e, this.onErrorObservable = new C.c(), this._setupBackground(), this._setupImageProcessing();\n          }\n          return r._getDefaultOptions = function() {\n            return { createGround: !0, groundSize: 15, groundTexture: this._groundTextureCDNUrl, groundColor: new I.a(0.2, 0.2, 0.3).toLinearSpace().scale(3), groundOpacity: 0.9, enableGroundShadow: !0, groundShadowLevel: 0.5, enableGroundMirror: !1, groundMirrorSizeRatio: 0.3, groundMirrorBlurKernel: 64, groundMirrorAmount: 1, groundMirrorFresnelWeight: 1, groundMirrorFallOffDistance: 0, groundMirrorTextureType: h.a.TEXTURETYPE_UNSIGNED_INT, groundYBias: 1e-5, createSkybox: !0, skyboxSize: 20, skyboxTexture: this._skyboxTextureCDNUrl, skyboxColor: new I.a(0.2, 0.2, 0.3).toLinearSpace().scale(3), backgroundYRotation: 0, sizeAuto: !0, rootPosition: u.e.Zero(), setupImageProcessing: !0, environmentTexture: this._environmentTextureCDNUrl, cameraExposure: 0.8, cameraContrast: 1.2, toneMappingEnabled: !0 };\n          }, Object.defineProperty(r.prototype, \"rootMesh\", { get: function() {\n            return this._rootMesh;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"skybox\", { get: function() {\n            return this._skybox;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"skyboxTexture\", { get: function() {\n            return this._skyboxTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"skyboxMaterial\", { get: function() {\n            return this._skyboxMaterial;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ground\", { get: function() {\n            return this._ground;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundTexture\", { get: function() {\n            return this._groundTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundMirror\", { get: function() {\n            return this._groundMirror;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundMirrorRenderList\", { get: function() {\n            return this._groundMirror ? this._groundMirror.renderList : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"groundMaterial\", { get: function() {\n            return this._groundMaterial;\n          }, enumerable: !1, configurable: !0 }), r.prototype.updateOptions = function(t) {\n            var e = Object(c.a)(Object(c.a)({}, this._options), t);\n            this._ground && !e.createGround && (this._ground.dispose(), this._ground = null), this._groundMaterial && !e.createGround && (this._groundMaterial.dispose(), this._groundMaterial = null), this._groundTexture && this._options.groundTexture != e.groundTexture && (this._groundTexture.dispose(), this._groundTexture = null), this._skybox && !e.createSkybox && (this._skybox.dispose(), this._skybox = null), this._skyboxMaterial && !e.createSkybox && (this._skyboxMaterial.dispose(), this._skyboxMaterial = null), this._skyboxTexture && this._options.skyboxTexture != e.skyboxTexture && (this._skyboxTexture.dispose(), this._skyboxTexture = null), this._groundMirror && !e.enableGroundMirror && (this._groundMirror.dispose(), this._groundMirror = null), this._scene.environmentTexture && this._options.environmentTexture != e.environmentTexture && this._scene.environmentTexture.dispose(), this._options = e, this._setupBackground(), this._setupImageProcessing();\n          }, r.prototype.setMainColor = function(t) {\n            this.groundMaterial && (this.groundMaterial.primaryColor = t), this.skyboxMaterial && (this.skyboxMaterial.primaryColor = t), this.groundMirror && (this.groundMirror.clearColor = new I.b(t.r, t.g, t.b, 1));\n          }, r.prototype._setupImageProcessing = function() {\n            this._options.setupImageProcessing && (this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast, this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure, this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled, this._setupEnvironmentTexture());\n          }, r.prototype._setupEnvironmentTexture = function() {\n            if (!this._scene.environmentTexture)\n              if (this._options.environmentTexture instanceof kn.a)\n                this._scene.environmentTexture = this._options.environmentTexture;\n              else {\n                var t = ei.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\n                this._scene.environmentTexture = t;\n              }\n          }, r.prototype._setupBackground = function() {\n            this._rootMesh || (this._rootMesh = new Ie.a(\"BackgroundHelper\", this._scene)), this._rootMesh.rotation.y = this._options.backgroundYRotation;\n            var t = this._getSceneSize();\n            this._options.createGround && (this._setupGround(t), this._setupGroundMaterial(), this._setupGroundDiffuseTexture(), this._options.enableGroundMirror && this._setupGroundMirrorTexture(t), this._setupMirrorInGroundMaterial()), this._options.createSkybox && (this._setupSkybox(t), this._setupSkyboxMaterial(), this._setupSkyboxReflectionTexture()), this._rootMesh.position.x = t.rootPosition.x, this._rootMesh.position.z = t.rootPosition.z, this._rootMesh.position.y = t.rootPosition.y;\n          }, r.prototype._getSceneSize = function() {\n            var t = this, e = this._options.groundSize, n = this._options.skyboxSize, i = this._options.rootPosition;\n            if (!this._scene.meshes || this._scene.meshes.length === 1)\n              return { groundSize: e, skyboxSize: n, rootPosition: i };\n            var o = this._scene.getWorldExtends(function(d) {\n              return d !== t._ground && d !== t._rootMesh && d !== t._skybox;\n            }), a = o.max.subtract(o.min);\n            if (this._options.sizeAuto) {\n              this._scene.activeCamera instanceof Hi && this._scene.activeCamera.upperRadiusLimit && (n = e = 2 * this._scene.activeCamera.upperRadiusLimit);\n              var s = a.length();\n              s > e && (n = e = 2 * s), e *= 1.1, n *= 1.5, (i = o.min.add(a.scale(0.5))).y = o.min.y - this._options.groundYBias;\n            }\n            return { groundSize: e, skyboxSize: n, rootPosition: i };\n          }, r.prototype._setupGround = function(t) {\n            var e = this;\n            this._ground && !this._ground.isDisposed() || (this._ground = Ie.a.CreatePlane(\"BackgroundPlane\", t.groundSize, this._scene), this._ground.rotation.x = Math.PI / 2, this._ground.parent = this._rootMesh, this._ground.onDisposeObservable.add(function() {\n              e._ground = null;\n            })), this._ground.receiveShadows = this._options.enableGroundShadow;\n          }, r.prototype._setupGroundMaterial = function() {\n            this._groundMaterial || (this._groundMaterial = new qr(\"BackgroundPlaneMaterial\", this._scene)), this._groundMaterial.alpha = this._options.groundOpacity, this._groundMaterial.alphaMode = h.a.ALPHA_PREMULTIPLIED_PORTERDUFF, this._groundMaterial.shadowLevel = this._options.groundShadowLevel, this._groundMaterial.primaryColor = this._options.groundColor, this._groundMaterial.useRGBColor = !1, this._groundMaterial.enableNoise = !0, this._ground && (this._ground.material = this._groundMaterial);\n          }, r.prototype._setupGroundDiffuseTexture = function() {\n            this._groundMaterial && (this._groundTexture || (this._options.groundTexture instanceof kn.a ? this._groundMaterial.diffuseTexture = this._options.groundTexture : (this._groundTexture = new Ne.a(this._options.groundTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._groundTexture.gammaSpace = !1, this._groundTexture.hasAlpha = !0, this._groundMaterial.diffuseTexture = this._groundTexture)));\n          }, r.prototype._setupGroundMirrorTexture = function(t) {\n            var e = Ne.a.CLAMP_ADDRESSMODE;\n            if (!this._groundMirror && (this._groundMirror = new Ts(\"BackgroundPlaneMirrorTexture\", { ratio: this._options.groundMirrorSizeRatio }, this._scene, !1, this._options.groundMirrorTextureType, Ne.a.BILINEAR_SAMPLINGMODE, !0), this._groundMirror.mirrorPlane = new ur.a(0, -1, 0, t.rootPosition.y), this._groundMirror.anisotropicFilteringLevel = 1, this._groundMirror.wrapU = e, this._groundMirror.wrapV = e, this._groundMirror.gammaSpace = !1, this._groundMirror.renderList))\n              for (var n = 0; n < this._scene.meshes.length; n++) {\n                var i = this._scene.meshes[n];\n                i !== this._ground && i !== this._skybox && i !== this._rootMesh && this._groundMirror.renderList.push(i);\n              }\n            this._groundMirror.clearColor = new I.b(this._options.groundColor.r, this._options.groundColor.g, this._options.groundColor.b, 1), this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\n          }, r.prototype._setupMirrorInGroundMaterial = function() {\n            this._groundMaterial && (this._groundMaterial.reflectionTexture = this._groundMirror, this._groundMaterial.reflectionFresnel = !0, this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount, this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight, this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance);\n          }, r.prototype._setupSkybox = function(t) {\n            var e = this;\n            this._skybox && !this._skybox.isDisposed() || (this._skybox = Ie.a.CreateBox(\"BackgroundSkybox\", t.skyboxSize, this._scene, void 0, Ie.a.BACKSIDE), this._skybox.onDisposeObservable.add(function() {\n              e._skybox = null;\n            })), this._skybox.parent = this._rootMesh;\n          }, r.prototype._setupSkyboxMaterial = function() {\n            this._skybox && (this._skyboxMaterial || (this._skyboxMaterial = new qr(\"BackgroundSkyboxMaterial\", this._scene)), this._skyboxMaterial.useRGBColor = !1, this._skyboxMaterial.primaryColor = this._options.skyboxColor, this._skyboxMaterial.enableNoise = !0, this._skybox.material = this._skyboxMaterial);\n          }, r.prototype._setupSkyboxReflectionTexture = function() {\n            this._skyboxMaterial && (this._skyboxTexture || (this._options.skyboxTexture instanceof kn.a ? this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture : (this._skyboxTexture = new ei(this._options.skyboxTexture, this._scene, void 0, void 0, void 0, void 0, this._errorHandler), this._skyboxTexture.coordinatesMode = Ne.a.SKYBOX_MODE, this._skyboxTexture.gammaSpace = !1, this._skyboxMaterial.reflectionTexture = this._skyboxTexture)));\n          }, r.prototype.dispose = function() {\n            this._groundMaterial && this._groundMaterial.dispose(!0, !0), this._skyboxMaterial && this._skyboxMaterial.dispose(!0, !0), this._rootMesh.dispose(!1);\n          }, r._groundTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundGround.png\", r._skyboxTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundSkybox.dds\", r._environmentTextureCDNUrl = \"https://assets.babylonjs.com/environments/environmentSpecular.env\", r;\n        }(), Di = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = null);\n            var s = r.call(this, e, o) || this;\n            s.onError = a, s._halfDome = !1, s._crossEye = !1, s._useDirectMapping = !1, s._textureMode = t.MODE_MONOSCOPIC, s._onBeforeCameraRenderObserver = null, s.onLoadErrorObservable = new C.c(), o = s.getScene(), e = e || \"textureDome\", i.resolution = 0 | Math.abs(i.resolution) || 32, i.clickToPlay = !!i.clickToPlay, i.autoPlay = i.autoPlay === void 0 || !!i.autoPlay, i.loop = i.loop === void 0 || !!i.loop, i.size = Math.abs(i.size) || (o.activeCamera ? 0.48 * o.activeCamera.maxZ : 1e3), i.useDirectMapping === void 0 ? s._useDirectMapping = !0 : s._useDirectMapping = i.useDirectMapping, i.faceForward === void 0 && (i.faceForward = !0), s._setReady(!1), s._mesh = Ie.a.CreateSphere(e + \"_mesh\", i.resolution, i.size, o, !1, Ie.a.BACKSIDE);\n            var d = s._material = new qr(e + \"_material\", o);\n            d.useEquirectangularFOV = !0, d.fovMultiplier = 1, d.opacityFresnel = !1;\n            var p = s._initTexture(n, o, i);\n            if (s.texture = p, s._mesh.material = d, s._mesh.parent = s, s._halfDomeMask = Nn.a.CreateSphere(\"\", { slice: 0.5, diameter: 0.98 * i.size, segments: 2 * i.resolution, sideOrientation: Ie.a.BACKSIDE }, o), s._halfDomeMask.rotate(be.a.X, -Math.PI / 2), s._halfDomeMask.parent = s._mesh, s._halfDome = !!i.halfDomeMode, s._halfDomeMask.setEnabled(s._halfDome), s._crossEye = !!i.crossEyeMode, s._texture.anisotropicFilteringLevel = 1, s._texture.onLoadObservable.addOnce(function() {\n              s._setReady(!0);\n            }), i.faceForward && o.activeCamera) {\n              var y = o.activeCamera, P = u.e.Forward(), R = u.e.TransformNormal(P, y.getViewMatrix());\n              R.normalize(), s.rotation.y = Math.acos(u.e.Dot(P, R));\n            }\n            return s._changeTextureMode(s._textureMode), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"texture\", { get: function() {\n            return this._texture;\n          }, set: function(e) {\n            this._texture !== e && (this._texture = e, this._useDirectMapping ? (this._texture.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._texture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._material.diffuseTexture = this._texture) : (this._texture.coordinatesMode = Ne.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE, this._texture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._material.reflectionTexture = this._texture), this._changeTextureMode(this._textureMode));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"mesh\", { get: function() {\n            return this._mesh;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fovMultiplier\", { get: function() {\n            return this._material.fovMultiplier;\n          }, set: function(e) {\n            this._material.fovMultiplier = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"textureMode\", { get: function() {\n            return this._textureMode;\n          }, set: function(e) {\n            this._textureMode !== e && this._changeTextureMode(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"halfDome\", { get: function() {\n            return this._halfDome;\n          }, set: function(e) {\n            this._halfDome = e, this._halfDomeMask.setEnabled(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"crossEye\", { get: function() {\n            return this._crossEye;\n          }, set: function(e) {\n            this._crossEye = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"material\", { get: function() {\n            return this._material;\n          }, enumerable: !1, configurable: !0 }), t.prototype._changeTextureMode = function(e) {\n            var n = this;\n            switch (this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._textureMode = e, this._texture.uScale = 1, this._texture.vScale = 1, this._texture.uOffset = 0, this._texture.vOffset = 0, this._texture.vAng = 0, e) {\n              case t.MODE_MONOSCOPIC:\n                this._halfDome && (this._texture.uScale = 2, this._texture.uOffset = -1);\n                break;\n              case t.MODE_SIDEBYSIDE:\n                this._texture.uScale = this._halfDome ? 0.99999 : 0.5;\n                var i = this._halfDome ? 0 : 0.5, o = this._halfDome ? -0.5 : 0;\n                this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add(function(a) {\n                  var s = a.isRightCamera;\n                  n._crossEye && (s = !s), n._texture.uOffset = s ? i : o;\n                });\n                break;\n              case t.MODE_TOPBOTTOM:\n                this._texture.vScale = this._halfDome ? 0.99999 : 0.5, this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add(function(a) {\n                  var s = a.isRightCamera;\n                  n._crossEye && (s = !s), n._texture.vOffset = s ? 0.5 : 0;\n                });\n            }\n          }, t.prototype.dispose = function(e, n) {\n            n === void 0 && (n = !1), this._texture.dispose(), this._mesh.dispose(), this._material.dispose(), this._scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this.onLoadErrorObservable.clear(), r.prototype.dispose.call(this, e, n);\n          }, t.MODE_MONOSCOPIC = 0, t.MODE_TOPBOTTOM = 1, t.MODE_SIDEBYSIDE = 2, t;\n        }(pr.a), op = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"photoTexture\", { get: function() {\n            return this.texture;\n          }, set: function(e) {\n            this.texture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageMode\", { get: function() {\n            return this.textureMode;\n          }, set: function(e) {\n            this.textureMode = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initTexture = function(e, n, i) {\n            var o = this;\n            return new Ne.a(e, n, !i.generateMipMaps, !this._useDirectMapping, void 0, void 0, function(a, s) {\n              o.onLoadErrorObservable.notifyObservers(a || \"Unknown error occured\"), o.onError && o.onError(a, s);\n            });\n          }, t.MODE_MONOSCOPIC = Di.MODE_MONOSCOPIC, t.MODE_TOPBOTTOM = Di.MODE_TOPBOTTOM, t.MODE_SIDEBYSIDE = Di.MODE_SIDEBYSIDE, t;\n        }(Di), ql = function() {\n          function r() {\n          }\n          return r.ExpandRGBDTexture = function(t) {\n            var e = t._texture;\n            if (e && t.isRGBD) {\n              var n = e.getEngine(), i = n.getCaps(), o = !1;\n              i.textureHalfFloatRender && i.textureHalfFloatLinearFiltering ? (o = !0, e.type = h.a.TEXTURETYPE_HALF_FLOAT) : i.textureFloatRender && i.textureFloatLinearFiltering && (o = !0, e.type = h.a.TEXTURETYPE_FLOAT), o && (e.isReady = !1, e._isRGBD = !1, e.invertY = !1), t.onLoadObservable.addOnce(function() {\n                if (o) {\n                  var a = new ft(\"rgbdDecode\", \"rgbdDecode\", null, null, 1, null, h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, n, !1, void 0, e.type, void 0, null, !1), s = n.createRenderTargetTexture(e.width, { generateDepthBuffer: !1, generateMipMaps: !1, generateStencilBuffer: !1, samplingMode: e.samplingMode, type: e.type, format: h.a.TEXTUREFORMAT_RGBA });\n                  a.getEffect().executeWhenCompiled(function() {\n                    a.onApply = function(d) {\n                      d._bindTexture(\"textureSampler\", e), d.setFloat2(\"scale\", 1, 1);\n                    }, t.getScene().postProcessManager.directRender([a], s, !0), n.restoreDefaultFramebuffer(), n._releaseTexture(e), n._releaseFramebufferObjects(s), a && a.dispose(), s._swapAndDie(e), e.isReady = !0;\n                  });\n                }\n              });\n            }\n          }, r;\n        }(), Ho = function() {\n          function r() {\n          }\n          return r.GetEnvironmentBRDFTexture = function(t) {\n            if (!t.environmentBRDFTexture) {\n              var e = t.useDelayedTextureLoading;\n              t.useDelayedTextureLoading = !1;\n              var n = t._blockEntityCollection;\n              t._blockEntityCollection = !1;\n              var i = Ne.a.CreateFromBase64String(this._environmentBRDFBase64Texture, \"EnvironmentBRDFTexture\" + this._instanceNumber++, t, !0, !1, Ne.a.BILINEAR_SAMPLINGMODE);\n              t._blockEntityCollection = n;\n              var o = t.getEngine().getLoadedTexturesCache(), a = o.indexOf(i.getInternalTexture());\n              a !== -1 && o.splice(a, 1), i.isRGBD = !0, i.wrapU = Ne.a.CLAMP_ADDRESSMODE, i.wrapV = Ne.a.CLAMP_ADDRESSMODE, t.environmentBRDFTexture = i, t.useDelayedTextureLoading = e, ql.ExpandRGBDTexture(i);\n            }\n            return t.environmentBRDFTexture;\n          }, r._instanceNumber = 0, r._environmentBRDFBase64Texture = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAgAElEQVR42u29yY5tWXIlZnbuiSaTbZFUkZRKrCKhElASQA0EoQABgn6hJvoXzfUP+gP9hWb6Bg00IgRoQJaKqUxmZmTEe8/v0uB2u7Fm2T7HIyIrnz88uPvt3f2a2WrMbOvf/u3PvvzP/sUf/N6//i8vf/lv/3v5H//d//Sb//Uq/5u8yf8hV/m/5Cp/L1f5hVzlG7nKJ7mKyJuIXN/hPwqXI/g++zq6rPI5u8z+WqfLre+zy7PrVv9L8brsMiGvk8XLmM/sdfHXal4e3ad6GXPdyu2ij8u/+uv/5cuf/OSLfdtEfvUr+dnf/d0X//t3H/7bf/hP//N/928h/0Yg/4VA/kogfyGQP5Wr/IFAvhbIlwK5CGQTPP+9z5uPeePJSW+yo2+s/GtN30Rnv1E+f5zxof9R/lSXv/nr//mrr3+i+5dfyX7ZZQP07Tffys//8R/l/9TtX7790T/7r/8G8pdy+/8XAvnnAvkzgfwzgfyxQP5AIL8vkJ8K5KsmMVzu1U7p5PA5AXxOAJ8TwPf7sX/51ZeXfcemqnp9w/W77/S7X/6T/vzf/7383RWCX3/z05/9i3/13/0PX//eX/2FyP8tIv+PiPy9iPy/IvIzEfm5iPxCRH4lIt/c/393//9BRD6KyKf7f488fP74/PH544dJAF9cLl98IZfLBZtuqterXr/7Dt9982v95S9+Lv+gF/3i7Spv/8lf/vnf/vGf/dF/JfKnIvLnIvLvReQ/NEngn0TklyLy6/v/34jIt00iGJOBlxAsdvv54/PH5493SQCXy9t2ueh2ueimKorrFbjq9eNH+fDtb+TXv/ol/vHyhX4Fxfbx7euPf/Lnf/PfiPyeiPyhiPxxkwB+fk8AvxzQgJcIrGTwFsiAEXH4/PH54/PHUgLY7whgu2C7bLqpQgHB2xvePn6SDx8+6G9+84384vKF/IPu8iVU9Y/+7C/+jWxffiHytYj8VER+X0T+oEEBvxqQwCMJeIngo5EI3goIwVMIPn98/vj8ESaAbbtu2ybbvl8u2ybbdtluSECA65u8ffqIDx8+6G++/VZ/efkV/sO261dQXP7wT/7kX8vl8qXIFyLylbySwe/dE0CLAr65B/9vGn0gQwRMMqgmhM/J4fPH548eAezbZd/lsm3YtssNAYiqiogAAkCvb5/k46cP8u2HD/rrb7+R/2/b9Wu9yJe//8d/9Ney6S5yEZFdRL68/38khG/uKOCnAwoYkcCoEXwkEgGDDq7CeQfyOTl8/vhd1QCum26ybZtu2yabbrKpQvXue1yvuF6v+vbpTT5+/CDffviAX1++1V9sO77WXb/66R/+4V/dgkbllQi+aBLBV/dE8LWRALwkYCWCNyMZXElkwLTMeMkga/P4/PH547ccAVwuctkvdxSw6bbdtYDbTfSZBN7e8PHTR/3u4wf55vKd/nL7DX6mu3791U9//5+/gkNFZGuSgZUQvnKowKgLWLTAQgRtEniTuEfwaELw0MJvf3LQzynud+53uG+X6y3gN9kul+2y6XVT1U27JCDAFVc8ksAn/e7jR/nN5YP+avtWfq6Xy9f7Vz/9w1dgRYngiyYhfNkkgzYBWHTg44AEMmqQUYQKOmDaiCIa8TmsfmzB+DnZDQjgcpGLbti2y3bZHjRAdRMVvb/dcYU8kcDbPQlsH/CrbddfbF98+RPZfvLFnAQeieCRDC5DMvju/vmD4JkEvjRQgKULeGggowdHkAHTYxihg89vu88I5UeGAPSOAFTlrgPopiqbKPSmCKreUoAAkCcSePukHz590m8vH+WbD9/JP335k6/+tA86KxFchv8jMvhiogE4JQm8XhfKqOAqx5qRPyeGzx8/cgSwbXcUoLJtim27C4Oi93+4v6VxQwKAvl2v+Hj9pB8+fZJvt4/yzfbF9lPdv/wJnsE2BogmyeCRED40tGFvksIXiSbgiYSRRpDNDZ6BDI6ghM+J4fPHeyKAO+zX7cb9t4tedMMNAQju5V+f1uAtBSiu1zsduMrHy5t8ePsk3376KN98sX/xE5FPAnm7/782o0DiUINXMkCXCB7/P94/e87AWUmARQWVvgMuKej9t1RLBp+Tw+ePgwngsutFFdu26WXbbl+rSvdfbnqAiuA23QcBgCugV1zl7e1NPm5v+LC96XfbJ/1W9y++fgXjA3bDYXV+MuhRwSPwL3JLMFYC+HS/LU8HYrGwIhwyNOF12SvgM4SgztdifP85MXz+KGsA2C6X7aJ6bXSAOwrY5OYIqGy3d5uq4P5GhABXuV6veLvRAf10fZMPb2/y3b7vX7+g+9v98/WOBq7GG7RNAlYy+Dgkhhb+Xxp0sE8IAC4SGAP/TbgVJK/PoJPBnAiwPKxsXfbbnRg+i3s/JAK4Q/4b9NfLtomBAqCickMBjy7BuywAUVyv8na94tMjCVzf9KNcLl/0SeA6oAEYb1i9g+FtSALb/bKL8/+t+wxXFMyswqiHoK4ToIgKqslgpg1qUC0QoYbvJZg/B/q5v4szHmPX7YEAsD0CX25OwEUVm9xag1+agKg+nxQArnKjAtDr9U0+Xd/k4/UqH7bL5YsewrcBBiMJZPRAp6TwQgWfjM9vgRbgUYGL8AvLWH2gqhesCokeUmCSwPsnhs8fP2YNYMO2XeSmAWxy2VQaXeDmDIhApf33rD4PTUCuV+DtCn27XuXT5ir8VmCJ2G5BpBM8/r/dEcJb8/0lEQMtJHA5TAlqNuLRhJChhEpSqFabH3di+G1AGj+W1/dyAR4IYJNNnuLf6+tWC9CHHiAtFhAIFLjK2/Uqn65X+SS67aK+3QeTDoy/IG2ogQ7fb/dAtz5vBgrYGqrwNtCHsVfgIvwK07OTQBURVNCBFpKCOjqCHn5L/67TgTN+fpySAC56nwSUi256kXsSuFGAVyLoUIDo8/Pz7fdoErr/v17lk162HbgHvFpIYDfoAJJfW4sGPjkU4VNAF8ZEcLmLhdc7kljdY1y1Dq9yLiI4IiRqcLujb138KIPn80ejATwRwIbtBvn1cqv+2J78/5EI5N4cJA8qIPcmwRsKAHDF9WYP6mV7VmrgLuTpxYTcMEW0LAmoQxFsuvAI8tv/a/C5fV2ZMMiKg++FCM7RDPRu8ebWY7VG6VJi+Bzk35MI2LsAckMAgwvQ0gC5DQjd3ABg2HQLAPpEAlZ1Bu7VV7MGHDFRAbo3VKsTbAY9sPWC/uvx86gBbDK3D1eEQS8pbAeSgSwmhepnJb6uBv/o/PzHLzxWA/X7TH77De5j6AGQi6o0CUGfCOD2X7cXAlCFQABtEsGLDtxuOyQB2UTQBKZe5GUPXgkUYCUAbZJRhBDeuq8xBf+bgwbehDm+BFQi2IJksOocvA8ysIMfxluVcRsY/eB3JzH8GFDAXQO48X/dcIf9jyDHptIigDsFkEe066tBSETQUYF7ElDdYEBytN4+rk9UcBPfrKaZqFHWcw3i4J8/X4ev2//bSXqAhwTay6OEIPLD2Ipt8OtAGzxkwLw9WVFRjTc/qC6H3+YK/b1oAA0KuOizHfieCLaHHiAb5NYTIC9EMEbZrVEQt1xwhVy1UfBh8PUOquMizwaap3tQXfY5B//tea/NZdfhsvbz+PURQTDSGWB87VX/7WSd4KxjUqrIgE0IUkoKGnhIvwvawpGf6eECXJ7tv4qbA7DJgwpsKthEmmYgfaAAffYF3HLxo0vwNjJ0SwRWMG4db4eh1gPNm18vQ+us/0eGmxDemu/fnM/X4evq/8342ksGHgLY5LyT/zg0wM8lcMjgGFXwqIOVFJBQw99eCvF9oZL9Mfl3QwAvIXDsBRC9R+fz8x0FPBLB0xJEpwUobrfAkARgIAF41h3wQgP6QAmX5E/7eI43IxGwwf/moIkRyWRJQIPgt9CA9b39nzt4bYUWjAlCjWDPgv8IEjgLJfzuaAsrv9VdVG4OwOXW/fdoA35qAdL0BDwvf6AAUVHd8LIEu94A3K+Q+2YxaB84MOH62P//qoo38fCRDERE2zf0JfmDa+MieElAjcDPKz+mRKCOtdgGtXaBjgNJ4H2owSpNeAW/rRH4CaHSpMwnBYYycjgSJwfie9CR6mPu20Uv8kABF206AvXlBMiIBPSlB9wjBW1fwEuSb94296VCqgMaGCt/G1BbExi3IG+r3a3J6P48Gv/J0YmEYoiGY7V/SxwFCwGoE/xa0AJ0CEiV9QPCJb1OJ5F1VTjEY2/MO9AEJvj1BJTQpqLfTlGwjABuzT962e4IoKnyrdh3+/6mzDVJ4PHOxj0JqGKoy20+wBMN6D1gLWi9NQHfVP5MEEPzjGYy8BMAOnTAJgEr8HUIejRo5xrA5xkR5AngmiSHs+zDDAmMgWzTg55GSJEmHE8IvWPAoYTfhWak/Wn/bQ0CGLSAjv83SUEfKp5q24LXuQICpzrjrgWoza8xVE00CQCORdhMJuTUT/rjuls0gO4Iby8BIEgK6gS7BsGuTtDrScH/fR68biUHNVGBnxjeNyHEvQe/ve3LZQqgG3rof6cEclsNflG9J4KtaQ8WHcVBHS1BtHE4QP9OBMS98mpbKTeDW7dJwRsnHpMBTFJpV4I+b0kY/NqInVFSyBLANbnMSgBM8F+Fqfxq/h657/Up+GaBnwV9hRqc9bZ/vA6vu+T9E8KPJWns94UfTeCj2QXwCHS9dNL8Xf3Ho/rfewSeFODGDV69AU0y6NFAE1DP3qK++rdB7/1HRxf86gT376zOr99T/h/ioBiXWQkgQgVeIrCC/WomhDmQK+hASI2ARQZKooHMLdCJwGEBBXC3+uERwg+VOHZ9ioAt9H80AI06wGgJ3nQA3BoCut6AhxYwgcPOFnxuFnrphk+NIKIGrWPQtgz3b0i7Y6D5rs1GKqTop0nQX52vmQC4BkjA+r4a7Kx9WLENGeegkhSETBCrNXIMdi/444Rw1n6E96ry7OPuj8UfLxtQ78NA2iSBbg7gIiIbdDLsb5agPhLC3RkYKv8NDbS2YGsatNRAG2oQwf9ZIOydgy1MAzBkAw8UwEEIDzSAqdPQ6za0PkeJAMH3Z0wXniUSZoHvBXU2mcjQgv56TedIKglCpIoQfgwCIjOytd8WgN0bfxoR8Fn9Gx0Aj5Zgq0lIZbsH/ibSJoFnS+C98g9ooHEELI3gliy25yONIiE6pb0NfBlyNEYyENoodkKwgl6I6s8kARgJ4ZoEfuYWHLEJa0LhSBXm7kImGeSfVdoJ1DO2G7WXsehAptupSOoyrCSF904k+6vt98X/ZcM98Hsd4JYIXhQAIg3/f9AAUYhsLQKAtkHVBnzjCKhOoYl2ym+iBtvzDzQ2DLXJ4PUmbJHAVnBQX4jkxfvHhNDqAdHXGQJgv0aSDGItgOseHIU+K9hXnIJzkoGlEKzNHagTdJ6VWEUH4iCKH4fd2AwDPaYBm4Wgng4gQ9V/CoGiuNmD04AQtNGMGzSAAQ2I2pzfogY9LRh7BrbOh4+D30sAencljFu2CUFrwY8UAWRfWwGvVOVfbx2uIILM0pwDv082dUTw8hYs8L+uIWiHGpWgClnAa1lMPJogovvvbePPs/q3Xr++kgCsfgB5oQF9WYKPJqEn6G+OE3i5AqouF59FQOmahQC8rlPLj38kg1c2f30vw+XaoIX24/pMGIgSBoZqoH3wo0sIIGlA9PWcCPrAtpPB8eBf6x1o6cHra+2+tpIFP4PgBfxZtZUJfo4qxELT948D9ucK8Mt9+ccjIQw6QJcEbrD/1g340ATuDgDkFfx6twSf1f9xvuBECYxq/7ythQQGm+5JDx6Brw4CkMGT3wgscCUoQ4sU2t6DR2ciBjTgtcpenQoZVX9NuL4Owc+dVaDursYVkVALX+shjSBKBuvCYDUZjE5BdNkxdHAUBexyHwB6NP7Iyw7sxUDViwge1t+mz8B/LAvVx/c3PeBBCToB8IUGOgqA3iV4yUg6UAOxaUFHDx6CYS8SorMOue0CCJGAf5YfRhoAI+A1CvwxqNkAY5yAIx2EQmkFfeWOXi+nEdSQQA0ZHMEItiagJArQxDXIrj8nCfQi4HZPAttrIahso9oPQ/2/JwV5JQU8zw+7I4D7/sBn4EO6rjw0FR+i3Z9fHtahzsFvJgM0X+tmVH5vaYiNDGAigewAz+gyNLThnjCURQFR1b9d3lZvnVqmj9mEPDKIUIC4KCCjBXywS4N+otp/Hk3QVthOkwEKlV9PQwXjT7s/zwF4Qf9toAAzFdjuaEB6S7D1//U5FIQu2MevO0rQQH8ZmoXE6B/IkgE60XCjVoq8gt2iCG0S8L5GdxkM1cGsfsCMArSCAnrr7dzAZxCEEpepvB8tqHJ/q+bmJGGts/AcAXFOMMeTwC7Pw0B6CtCtA2vWgonqBQJFSwH0JQK29OB2kvgj2HHXAoyeAIsCQO0kMNECAhFMqCBf8mElAkyBbX1tJQP2RJ/ha0gpAfS9l+/5n00CkrQpq0MZbOdAuxmMvHswog62jZj7BnYQe19b14kxNq2D/ehX/p68HEcF+x3yP7z/V/A/q/5DA3i5A/dzA5pdgbKp3v3/wQF4Bb70WkCTHGRAA6+KL0bFl6FJaFw0ImZwm6igSwbbwPn9RMBWf3sN2JgA/BVh/Rg0kQBgePf6HglAHLFQwqQQOwDjbdVxNZjR4iM6Qa3WxwvNxh0JFb3g/WzFQQS8b/ttKcDWoABtUMAd8j9hf0MB2uDXhzX4CHj03L9DBU3Qjz0C0l4mLSLQPicOOwZoVCB6P6dA7nDbGkVuxcNr8PU2JQO4wX5trEqmccZaHU4q8oCDFOpzAnOwqyMIMktNNNAHouDGxO37DgArQZzlmp/14W1QlqHTMaIIx7SCx0+5yza7AKJ3IXBrNAHVDcMZAU/BT/vgv/ULPOA+XiLggAREDF2g0ci6xNDRglegd7P7TWWH5oJfayliEg7bScQRBVgI4Ookg/F6rvpLWP29swREqA3CaG8/FpKqS8DTAV4TiBqIqtxfzaQRLys5I0XEFIFrPbZRQb+16Fgi2LvJv8EFUPW1gGfQv1T/F/d/HBnccP7rAwnIIyHI4ArgWeGbU4eHy6Tx/EeTZIb5bo/BsMBjmjBE08f/RB0PHYBd9eVRAGY7cHRwiBf8WeCPHY1bgBTa9xKTELzEkQX9CPtl0gJiqsAmCT7I8xbjivh3JGFI+D2nBcSJQJ8agDX+O9iBL7UfG4bzAkcaICrbtYHz1ycSmGmAjJfL3CMgT3tQpmrfB7gxSzC1DnvdhQMieG47u75+kTouKNkM8c/+vq/Q7ZYjO/hhVvRq8F/9gGfhP8aqE9EIdR6LTwJ1h0BItyDqB8iFwuNqASscRnYioxOg9ApvnYA35f8e9Ohbfe8J4rknoFkO0lmA2gmAG0YK0DkB4ieEjiLoMD8wBzom27ANZkzIoU8EMHk/uo1mzeVoEoRWKn8L/62EYAX/lsB7D/LXg74uAMr9oGivJ0CNJCGD6i9DhZdQF+gtOp4S+NODRzsDVbhdgv4BqTMNyIL9SCKwL9/FGPp5oQKxIf8A/UX6r231H7YIqLML0Ae2GtrADOvRQH5b/MPE9dt9BGLNG8jVTAQvIaK5TtvvvWQgDvyXIClUA78S9Nfg7VtIBlO7cbsEYkQDMot+ygQ7QwmOawTHnAM2XUSnJvPIYRYMmYPS+sv3J+cfP3d04JYIXsF/EwMbBKB9Q9AY+BiSwFj9mzrSXmcJhFPVHySTbgHJCPvRQ/z7G/SVUETsg0ZF+i3CRoCjhf7y1A9mOiDD7TwdwEoEXjLwAv+avLE2B7Jnb+OqDpBoAchoQJskxKnss0vu7Q2YhcDv4ySeLOg9GsCKiUIihP7yfW7zbTsBh0TQfN0iAWn9f72Z56/Ax9P7j5OAH/Qvv3/QxKfk0DgDuP+R3USg3bzBC7bO/QT9Eeh9QvDPG7glBQzJwK740lAFFgFk8P88CqDGAa223YckWYhr+c0BPdwetl2ocnsfzePAWcVnnAIp6gDVhDLyfV4nqFEDPxHsbWD3k4BDkN+pARqKMLYBPzYEvxp9xmCHQQdgWH/9EtH2TIFpu3AH/cdGydv1j0TQbRrq+D/mLcX3ZACZ15bF378CG0My6Kq/zoGOQwhASDFwFbxyNGBuSxbCEhQ/uEPe/6gAERWQObCVVfjPpQX+rexxYhYFxIkgpgX7Y/vPs+Pvxf9vwt8kAs7i32t3QCP+3SPaTwIytQXP38u0PESm+YER+o9B3vr8mETAUfDrEkPI80ck0FZ0dXh9U+HRbhey0cAc2H7A4y4egoD6y8JfkBiigLdFP8v2W00E8deT2IeAKujZ/QAVKpAtKI20gLWksHedfgPcb+0+NEHefd9vB9rayi8h7J91gBbaw20MsnWAF5xHkyDUCOoXp+yrOwwxcKj0aL6fFppaaKDv6OpHR5sgx5BAlK/+fYhuP1D196o8e7lFBaKqv5YIMnFQpd0FGVR35RJCnCDaABaXBtgbiSwtICMtalKC+1JQ6bx/PLcDPQL91QFodQNKpwOgF/9eqcBxBBqRcKAAVk+ArQOMx1RYGgB6naDhlK+uQQwJYx4meQbxtNnYQwMjt/d4f3M9ZE4UOld1LAh99fbfzOxiEkKFCkTJIUIMUeVnJ/9sDt8/e1NEJOi9oVHDGYhgnSLss9DX2IAqw1zALUncKcDr0FB5NP+0cBQNrEezDiyiADPkt9qGpwoPdL0AGPx/NOKeyf3b9WJNdfcFv6bKd2cLMJVfJ6Y3B6wB9WFUfWWEwKMfGiQL+3bz9XGQz2EHKhF41GCtZyDi/gUCsNhYoAr3UNJ58YidHKqnMb/6AB5J4N73/4L+t7mAkeeP3P+1LNSB/l0SkMEd8DcEuUlguEw6t2AU/PCE/q++Akw6QFf1u6SBrj1ZnnhG50AfkoGIdf7gJv1KcSfgzWWkQ9U33Z3tHXYASKJ9e/YhU90rvD+q9Ej69/wxYJVs506Eg/r3DkMDzEdDBRGgcZay49XihLA30P+l8N+hf1f57/0AoxbQbwYaan/rBMirE9Dk+sBzTkC8JNDEUlv5McB8PP19Y01Gayep+hC/2zvQ/2HGLAurowsNGlA1cnqGGzeH5weiYLZm7h3QQC4O2tXdhvMMk1ZS5ebpgI8eMrPvPGkwaxayk8Yc6PMOBPEdC1XZ+2UfbfOPtxLMQQAG9BcZFoF0gp/RKjxe7+oAw9T7ZPWhgedodgz0gf5KBtrtIZhQAZpAV1Bi36w6t98qVfH7hqGI318lLCjLCUFlxRHwqYEH9a2qb4XjWvDT7kBwfbZA5P0+PNuRuW1yf4yNQH3zzwv6b70QOJ0G9OT/dhoYRUGT15uQH/71MjQLtQlxfDuiCXrtM+SkA+icQdH6sU/xz7Ze7FlubV4TpoTQ2osdpaEjtqADmEU7OkBEFoLeC3IWFFeswJXKXzkboNL+wzcFHU8hTGKIboO7CLi1/P+5F+gydQhuvRbwEgxvtACmANikhLTbj0gCYk8KdlYgmj+4Ymaod7TwahwadICuX0Cm2fE5iNHPK0x/CDV66Kyg1MnqjNFBnhBoLQCgUULfaVe5nq/6EQWY67bXCszUb+7232fVPz51iGB12owK9peyP1T4raMFF/OEYJP792mgXYfZ04GHMAhBkCSmSj+dKqRPgVFGHbpLEGMiGFeQWfSgrY52VxaeDUPSNJI0P7NoisG729HHl78z6hxfs9rV3m4JjgM/lsui2qmThjCfDFSb+I9vwUqG5wwL55U7C+6ot8B+7N2o6r3q37T9trfpjgmTvv7PSQATLLeRAOZhIJHBQfDQQJPBdUwEbVW3+L08EcEE/9G4ANrCeWcnPKRHDupbNynMx5AA9IRYLmrc/YLSiD5EaEBS/s/TgnU9ILcH19n+CpHwegLejx7Mn/d25fdN+e9U/1vgb7bqf08MOtf8EXxaoh+GY8L6gDfhvs4i6HQ7seYI2sv1GchdMsBIG3xlvxcCRzdgCPTn+6q/TW00VE8Q9FaFv+R2VlOM1vm/hhjhDCdgNflVKME5B47I9xT8z0YgPAJ8myb/LqHy36j/Mwqw9AALxuO1JVjiuQAYLcFzIhiEPe05fk8tRjGw7yWQbsfuLAT2VqOId1osnr0F49VM8INACPHDoBz4B5mqqSnUgyh3ArjXxfQH5BbgUS8gP7aU+w0zHD9GGD0CGHf+P1p/DeivlhU4BbxR9a2kYFR58YaDZCUR2P0DMmgED2eg77puegy6PgDphEB0CwlG/i9d+/Hs34pBEQrBn0W51mqGnJAk3ACCHeiqkQ1XFQA5AlKH7Lk8yJKWY3/nym14h2C3JvxeMwD9ZVMz0BPMi1n1RbKl1cYhIVblF3G0ATsRiCMUvoK9//OgcwYMoe+ZKOLlC6/Xk50br9NFz9fanqA8UIYSpCwlBO4kHc4WLLBfBHVaKwKgLQjmP4Un61Vq+3s7Bsyi0WztmLjJwJwFeE0I2vD/1Q6MVwefxfUf32skCPbCnxQqf+QMPEUDHZ7vGeyj020JgkPXXwsldA7SYR1RE3h94NvNtugswcgxXEkIcBPCGZ1rmrgDC0A4K88nm2fn/eTnpQtWyZfybRoK8Dro4zYDIMGsf7saTBzvX0SMbkAD6o9CYbsfMK38cJKD9l2FJt9/VGs0h5Gib33pxMKWNsigFUh3G2un+/N1WUglI/EEx8fq27vUNnwsiOoKecL7kQS8VnWAGCFUgn6dBtQhv40CmIYggwK0uwDHRGAuBXVdfwzHUjZzATLMAoyJ4FmBhzaWBlrHld9CCWpPHRqofBqMReMGTJ78q9rDes1Tv7/0m0v0AFHXNR6P6g30SHivin7V1BOhh3iWPwvps/yE836L2XiwnUT8x2iHgfqhnwn667QHEE8oLQjEvtEW7GYBZDrDVkwNIO4G5GiBDf9fGoFM6n+vbEtzXwP6u9AduaWnGYSLAlVdl/AU+ikrSeEIKgwdaZ4AACAASURBVKj4/wtgHcHtdO2nWKcBkPfxcvnNQvsj2Me9f02r76T8q0IBn9OLKfz1HX8yVXQYGoAB/2UeBQ5/5kCL6+H/OGGoRnLSwdd3oH8r7KkGTbgIxEwVWvnF8KOpHnyzfF9Jod5Px+IF1h8owyitDw/XEgRb5bPqbt1uvn7qBIQ16vtS/u+DP3cR7CH0WWJgd5mTJKYgNzoGjQrfvu99NDBC+bnyW1x/qhTatv2OaMKgJWPvv5kwnMgxHYGFRtJW8VMl3uP+MgoqSZyWFKr7+KIDw1d6+IiOgZI4+d5iYL3imzbgyO+tph9t2oSBxOM3ugHtPoFZ1LM0hF4kXNEBssvVgPdjdXZWK7uKvyS3q1Xb1WQwtVDqSUggq+Vw3t56JA2cz7PXOwGNW1ecwxPhfe3QEUsDsFaAz8jg0nf+iZMAHNg/XSazDuC18Iq1HBRrOsAQ8NLB+16g614jmuSgs3bROxE55D+WDDQNA4ivdMJ9M1b309UqknaDU8ObV9/PwmMPATvTMAxpABLBzugUtV9bLdhNDQA+7B9tQJ06/7QNDHGSwtgZOCIA47InIoDdROQGtt0U1HI3GaoUnCnC/rzBMQJteN17+VaAzYNA7e+PFqHQUyXPUYB7iQYa5ZFjq1Zqpx8Uqu/XT7+6BWC1Xaj0GlBIwMoHu7UzcI/6/Acb8KIq+hzmGWmAYnADrIpvKP7TZeLaf0LAeQkGgebbq9FToI44p654F47tekKkI0L5PQNZPsDwPBpy/ni+wKMN76Vav4+2cFZFf8+JwAraMt0DFB7beA/u4Zz/a+RXx0M/ct4/jwaNAS8G17eSwmta0Fhx0VRxJkHMivso+onMXr+YwdWKbgioy1jp4x4AzIKg5lEA7wvHEYCRmdx11TAuT6lDLVl4KvXkAET9P4RT8H2u+lg9EPQIpw+/NpJ7RwE8HaDv/Mu4f3OdNkq/EfAiEiOANjEALvcWL9gfFV4NZbgbQc6qPky4Pm35QZxtH1f4j+P/jXuaYPcWwIEH/fmEPBoAO4m4LGxV3txOQqDU+dXgey+UwSzuqP++uImO/u/6ogCb7wTc1n61sL+vZi87rxnrNas+giTg6QLzaUCjIp6JfhwtGI7AjBBB9JjDY4ePYVR6ZPgN4owVv6Q2N5hhVHwNeYrM+w6dN6K1sMHZm/Ce7bHe3dzKr1xw1w4JrSQMZtgnoQHlr18fzunAszD4qurNUg/TDqzx/lfCaO6t4tACMUQ6P6htWjDPC1hCoZ8kpODzJ70MUR9AODcgwyqyPhmE+wfHYB/hvSqt6qeXUShhXH+d9SR8DzrDaZZdpSp/HxqLMQuATgDU/qDPRgOIeT8cvz/h/XC6BtE7ACLOWPE0KIS4UUjmZaJ2grBphiWgT41BUVWZfP3AnEIT6OrfoF122l2rMycBoU5i/OXoUZ4/aglsXwLzHNU++FVF3qikOj5HXm2PBitT1WuvJRAB+6O//W0/PY8vQH5IrAsMs/WuVmAdHBrQgrbOxJShXwRSsu08h8JMBpo0+aDTALwV4tbswgzHrftG/dJKIAQb5h9KCssWIMeto+GYqG12/HWGjx8kzqNJaa0noMWOr2KwW01AMwJoNvhMQda2/RKQP/3ecABM3g9uD6BY68Ntz9+nDOMb5iV+hIE+dP/Zs/wwJhJ9mgBnohBuStABUXjugF3hkXF9ZZJAjefKdHZCc389LoStKvIl7QIEb1d9RyciQgFDI9Cjyccc/23Aam7/PZJBhgDgin5CtQvbCzX8ip9YgIFtOAt+w0owp/hOiCWgEGbVHuYjRigPGR/YOnEoqPDoV5z5YqB3mRq2ox5ICmSSgAP1Ne+XV2NE+/vuFbCTRADxtS70VRBCjgBk2OyDUQiUgfl77b7DwaHm2rAZ7osRSOOUoHgKfNBSLI767+oDYrfwZvqChSpGfj3pFwZFsCJg2jeIQQBUiyI4WgD68ww4qO8khuWkkIuDrxWv2nv+UTBpJYiPd0KemTA8qqFiuUF1jWS3BoG6pADJq751JqBI0wvAVPyMQvjcX1zbELltKK+zBiXRFiRxG+b7q3M9xuLdzR8g0gCGNzSM5gNYfqGO9CBT8OHct6oB3KsSDBisUnwsFuISQaRHxDSv0vptt2oeLHMERfRn/FG/Cx01EpgIQG8LP+/i37PKw53xn6sYCM4/JwSRrCnIeB1ZkLsawDhaPKv/njU3wnZ/dBdGE8+YTHSG8+ofGgIjsC19YnwdM/KAnTSsqj6ig7uGgIPw3nYFzhhIIvriAxFP9CQd4HSlnzgxONIdrE7A8ZDPx9fjib8ifgegNIliRgdx95+E1T7+3nQVNNhEzDgGA3T2rEDLduwtPpuuouPcs8swwXFjdTaMKt+jA5gUAQPcf95KJQxYU0cYxEDvsBSmYuukp7AwnqniC9Afa5z8vboI68ImT0t26CvwBzSggkj447r9IojvCn7U92J/Hw0QSdwZKNNjxPCfSxRqnATkdwpOwh88oc4J8KTSm/wdbZjrc+4iFP8YO0/5JJDCfaijK5xVXevqfg6zGRrQf83chvX4aRfAE//6vv5+6490U4ADdO7QgM/5bcHP/n4OtCQhBEFeDWSvos8DPq8/IwzLzjpa8/U6MMSkBklDm8e0mn3QIY7XG1Om8wzN48y7HwhOK3P0/ZwUQHHv4psbdoVeb9VlAjChBCdtDDpOKTh9ZfcagOYq31RFjN4/gwBYzp8lAwYNwBELhZoxECeZxMlAzWGdCRV0fQWGHo8+8Kx+AAxnCIzowAxy9KvNepWfsfp4RR9kUrD88CPVTuXRybhqqTHcnxEGndsgub1Gdug8yz9fHt3Hpl57x/mfCOC29FOSQ7/noAZR5W3Ob24UMpuPYAYiQrQgk1gnFoUIKr4vKFpV15pHUJO3Y5rfH3UFHU4bGkU+NKJ9f2hJyOMxDBDpjAgwiYqvk5TqNl9EH2Arb6fA3yaA4cBtPWewhkEcIQJBlGzYp6zRmr1v+e3Fv27xpzvyI44NGDkCIi7CGNV9Dw0M8NtHC2vUwHINumCGNG8erxOwtQINsW88Tlwdoc+F85nI559ngEDpt2F/Uu3hiXYrkN/pBFS26hYDAkFgErMK67y9mGBA3L5ore5izf8b3n805MOq/t7XU4WHv1DUF/5gugCSOAIW/59uMwl6CHWAib8bvfxWl9/rBGEMTTwDfG+ezEYG4yk6FvRPuPwE+wvc39IRjENWM+/cm5b0W4Pf4WuKUnw/vD6eDbB1ETs5vl77Dhnm/51g6wPWwQAqxnivgQaeS3gy/u/1H4hpTPrIgHAN0mSgXUX13YP5PMIuQAfBr/f70cdeE+QoCX3i8nFMLcAjInBoAIYqt1LhC1WdtvmSab28AYffaeivCB+ohdYQgfUa/WS4ToMsNLHLc9nnvPZLwn1/EefPVf+U/xvnCVSEQEkEQEnEQJO7S7RvYDxNeNYKrG7DKMhtsQ8cMmhgPKKKj+F7CiHYFR5KIIPxOmg5IVAtu3ACQSPh7CzUQOgAej5CWEkIe3vgxz0ROGO//qYfz/dnLT+ZxDr4QW0eNCJBorCFOVC312Ec2TiY5Bk0cAaQmiA1VH1MOwDHQ0kHdEDDf+2UTWhS4Z8diQMicLx8MLBfverLcP/jQzF0P8EJj5+NGK9RCz755S6F/f1+X/gxeP+Wsedv+vF8/54aSPJYFjIQd624MDz/UDLQnr8HU3ztKHRf8Qeno1vyAQJBaLcMtTV3cvgP56COCqd/QP9xLgBkH4BxO13n4hNUDtACC6G1S3zqooZ6Ba4lp/zcAFb7iERKQwQcF39IFJjdXECGADw0IE4gg674pYAnk4HoHPx54tD5daO5vxrugSkMjgiiqc7TVKAT6AT8R4ckbHEQCYR/IZBxJgA+XZjsR7vaoRpIxWqeqfXuGC2CxwudicwePEB1kNkaZCuwyF0DuKv/4sz9mzP/Qxdg3BDkBTMC8Q+loD6UGBzx0Kz6eAX/KArOQTlPHFoI4vVtf4rNuLrca9edRn4xBP7k8w+9AgZCgBfEUZWfEs8iFNZ3UO7TqmkjCO/rWdgco/yIqHcQWaC2EGTzgz5y/iXQAvyx3riyxxV/JeBriaGB9OrTA5g9/eokM+37GszqfA/UZk9iW5UnCtBqBl3XoNN6Ag/+zy6A5evPAp+TIFDn15gQw9rjrOzFX0s2JBVAxa/nP1a6AsNWYGjPNGPLTQgBsNUFvOA3Ht9o/rGDN0tWOCcxJGp+f7++kkP7PxcGv1+GjkaLt/fawpwwerQxBJNW4b+PJsYEgiAYYdEAGIlDNaAbRkIgK3ut0jKByp+8yz23X6GttmBmjwDvChgiYLP5V/zhH6/110sGcKo5CkggCngxnIPoPja0j2B+1BRkiYJiviaLJqghDI63G2nAgAxMCuDdnoD0wIQm+urMB3VuAwbBrFGgGgnhAFqg9+ujKsLxB3qGCQNEEtPinIQlAj4WgIw7/iXc9V/x/yUWFs2KH504bAh4aYWf4TrTLGTy9YbftyLeVOWNfYNyt/ji29mQnqMAltU3ioTtbX343yv/1u0YPUBz6zB702tQucnX0gWaFh6DgPdmhXaapGotw0SFz1qDiTMdd8h45HfcqCPRUhA3+NmKz1l9teCPaMd4urGaewRitNBDdahR5c3AfQmDCFT9vmtQEwqAYXX4XI2n23Z9B/Yb1FL+LWox6wHGbZSo6FR1LzyG+3hriSZvWT6jfXhl2cmQZJDrAbuYAqAHo1GA/EOgD8eGcU7A8eDvH4fQBuAhBL/Zp/vamPTrRENDGLTV/7E1WEPLDlP/PwzU4YhusIMUgfIPAr6Dhv5R4y2r8ldFwiFoYHnmr8TAHbhRQSZOctH598ZYhqt6wP7q/ouqe77RJxvzFYaji/z4vna4v5cUMDXqDAJ5ytktqtBDckyjvJg04hl16LB0xFfyMfD77PZjErGQRRjYIfSvoAXntks0ok8MsUC4KARWnYPlJBeIgLeFrUgDOHYCag0/XNAbWgRwQuLAsaQwIhC1g7+jCNKuT38JfnYSyTi+QQEwwHeT4/dWHYxJPxfOj5oAnRQqgU3YgGZSOaDyK3n/qkDYBKptzR3oD6B4fyRKjp2AzSl80YR/3P+/1vBjX18Jbu+YsrMRgbqPP8zrDLTAaupphfeZtyPs9BPztpLSBZjowF3woYRwBwOWaqbev15b7X4RWsiqYiY6ZkFEIoUwUA2OrkeEQE8HYNyD/rl3m88jCGgO/nPW3xy8x4Q/HBcM1dYg5q8N+B/SBSYhtD0EY1PRGLDoKIBHF3yLz4H/gSYQJRETgqeB2d4vC8L2NVnQn4PoVJJAcP0inahAfdXVI8CFszjRagCTtRdV7Sr895NBpRKXIT64RMFw/iw5eChhEvmmyUIH+k+Qu3cLzOAN6ILlFvgWnx3YWFDz0f38ze9GlfP6UQ3ojEY0gtqRIEbA5/WgQFhsEuIeL75uTzvqHktAWfj/OD6sQXssROcGiRgFn0QVkld7OznMDT7CJKzhMIqxW9B+LCOQdH4uyxIcE49VTSeLj0wKjzcp2oDXQA8YoDEGBLMW0BJw+eAxXejPV/IXd59/tp5rVyYXDw5BlRetSpQAcvgfOwVM8ObzBq/AQ2wX4lwkQV3vNhYFfn2LFgaoDU1ogqsfqGkJYmrj9Tr22KQwBLzbLuzDeA9yzyJjVRfwegWq0H+FThDPA6ZhZwX2M2Kh4waovCzAWJTzD/qY00c+6PM8coz08VNqglzx54LfHuTJK7z2rwX35ABLg1DzsZ7Qv7l/f2yXDlbf4C/irg0MJ0aCuD0wP74MrxfdFlX7tq+vtRdCpvt599EG9Yz3V+P+Oj/n4zLruZHcJ7oMt/MNp9eD6HEeFb6/TMfbWo85Pb79HJo8t3371/PuIAZqMvjPC34nVV6ZB4hEuA7AzA5cfU0y2n6ux89D/35/n2/vWY5Bf0qwf3tPLISO1Tap9qzFB6eap/beqI94NCCbGwgqOItY3CGl446CaQ8i2Q9g0AvmgJOnBoAA0gu17tsKtKS7D4udgCYERy2QIceCX/P7mBW+g/7D9S6Mn50CS0eAoQPDcBjopIA5+EcxEjLweRjXq0UbLIjcBxsGx2IZvlf0ATjz/6qypAmY7bhrk4ahsIis6ccXKHdueAfUgk+RWPCLh42c6zEeKyJpRTdRAOqBbl/Wq/uT+q+Fx3FoTIuCzc6+hN8j4veGjuAnhSE5gKnco3A3XwYlq2sq+lmP4yEOpqEoG0M+mGDYuYT0pKCFHgLHKt3T7T9p8GcWH+n1UwGa8X6kQt2x4CeqPexegT6o/Z4Cr313PHdgrsS2ZReLfpKIf+IMFnmVmwxQ9AhithYT73+p2s+JIVfrjwiHnpAZrSsr9CMstQXP1+1+510N/q8E/YoekMN9OMFvi5LvkRDsy9rgFCOoPdpgaQIWBZjf5KCSQszZJ1ivTvLokpen6tsJAVND0NFqb6GUGg2Im4Dyx9Pn7/0dm4pADAslJzTv+dKNrAPQ0wyySm7bj1RQgbAXsRa4R+mBJzpaQmHLmy0BLoL+Nh2ZRca8uUc6P37k97n451fvTieAE8BdZ2ItqFEK6oOJIYPsiU4woo140Oh+H/UC++gatHYcOFT+2y3AYvD1rM/fpxdUcsAi70c0OxAEP45X/hymE9XeoC0zfYhbcqfbhs09HpwnKMDR6g0mmYyKth/UcLl9ITGQ8N1S6s+gA1HvQCc2pluPvN2Br8SyZyfyxPP/VhCi1L1HWX2CQCuAE8TIq/sBYdANZmTIwqq0sb0HIzhhugBeUpBZLFyA8y+EErsBUYDZHYN9QAAooQwOws+uQlhdESSSqk5Qsh8LSYI6LDS1AbmOvLlRBqQIeITvM36+TP63VfE5hFClCTr9zEyVFwS3STQBy66DMHB+PJWIrfgGnYBx2dTboPa2X49GaBVlePA7CFx4iaGi4ns0aLVjMGvtPTDtmO4XEE8E5Kb/8qYai+NHl60LgAICcUCoJPVeiYG6Pxw/X9VFNVbFn9FNPzXoIRDTyzcpREYB5Fm1EQQn3KRi9wKApR8Tz48SwxnV3qM0q7ZhpdKvr0zfY+gO4oQf+EGPFYW/Xf5hwWsUgxiBbShGoGIx+D2eH1h2EeR3UQMH4zMaUKr4033nzkSkfQADelFbLOQCalxdxvN8mInhPas9bxtGJw29Fx3Y8429MAS0fL33Oeo7qFZeiToCC3B/VSNYuU0fgDnkhxGgMFdxiYEY7MYel+OHPH30IMeVFK1C79l+QdXVpFqHlMAXEf3EYDyfkkGdNvJ8f3RAXU0jpgM7jMNA5yCrtfzOicKG/M9bgEkEjqqPPDEcDfqVwGZv6zcO9avDfOhf4OmLFd9OLBHHdxp51HvOBlnAoQksYjASA1xnIhPsapTCPjbsGB2YevpPpgM73EYeSYIftgPgte6CWesVBB9QEgfnWYMgoeC8ql69bWoRIqYHvSIv/u26bj/jdqZ9KSGk74JRo6QS9PuTiSHm6Z62kLUGH0UO4rwWrhtRETkR4iKRdI8giJ2D2nUCMjsA0TXiVDb98NAf/rCMlajA9wesWHZrAe1dlwRyVI2jx4KkyUHSx7YDe6YD4tOC6XW01puEdAJwaEJzf1uATHi6ZlSCpBQscsh6C1xRcWEG4bCFeKcAVhVlDu54JQIkTT21hptIT/Afk0kMcS9BKfjBJozcDXCrtgbWXxbMAw3INQIxtQJPAGwXmYaBbYh4SCsuKwLOAQ5awKskCMmRg8P3xwlBfbosQaDqyZqBkyQe1CLQACoTgN4qbyHsPwkTiF2pYaj6MAXBmUosQHnUEYCsBL3MW39SNKMJ5PfoBsT33DVJCEbFnBCMOkHfvj6Xq8uw+dgRIhGgAiUqf5QgKDFyhe8nnYrlqn9sG1GoAfirubygX4H+8IM1CmQrMFAJ5ExzKIp54nPoVU2Auh6eBShDlTV4u5c4HE/fVvjFrsII0Ik6QX+Iq68jB19ziLoKC27FYe0gC+j1RSS+BgB7AvAM3m8HLdy5fV60C8RMVuhD1ieQB32MCCq0QPJuvuw5IHF/geMKwOPdpmsxBwVEfGEOgeincJqNmuSFIPhPq/xM81CWIIi+gCFBqDX3QPYd2OcCRo6GZBoA3AM+00aesAOQ7/2Pe/vBCXoguD4OBD1WfPwClzcui12AuH+gC0gEwW72KfjBCQRBr05D0IQc7N8PzOCMehPWK384MPVDJQim7yDdoiRTItzzFV/ZOX9sYFetP0fsQzb6O7wOoFjxk89YoQXv+BmSN+yYHYO+BsDRAXHhuJXsEFbdIEGZQWUkNVNzGA9NZUVBIQL7jASR0AclE4Pb7JN3BO72mG92+o8UG3nybj+mASh0FsLKn9GPxDrEcS2Au35BzHO1BksriIJdpqWjKR1wlpR4fN977rZqI+XbYjYDgVDpcYQalOYKMiuQbB3G6Pu/HlMbi9a0EMkksXtjvvXTfgMKAEZRN/i/O7yD8Da2S2Bdh3ICWfp8yuMkYl5a4df4vVWt4UF0yyqEnaT6swYyWB8/j111Y1ERS9oB0SLMtBGDEBD1PEHwtdjUEAHnqmoHU4wCDAoAS+lHwtu9eQLUAgmxVvAuMB9cELMV3m8EUtcBYYI9nkNIEEJYrQeUHfnzzRyC39j8CgSkir/E0P2odnAmAqDnDIhqrtV9BDNS2POjv/0pwKr6z1h/PMz3uf9ykFYq9TtoAXSwpz0HljdvBCVAPY6t7osv6gFhMpkX13rcfXQMIpuTsfTibkfOPRAC2meLRipI4mDPwMD5x+v3+Ey+qEfACwoUEkKQSMZxYJDz9R68PyP43yvo2aYf881rNQbZgRU/jp80QnW/hdXqJxMvCFxXQSNHpE8QiF4XI+wFfQcw7VL2Md7RRajsKgh2D+6SLAKPF356+/7yXYBTUgFy/38StUjFHweD+iiHh8/LV/i/TSvGk4L5x7F6AsIKbgb4C0YjgdGRIToGUx7cgS3JKP8pRcgak95BJGQbjaJdBYQ1qHYnYHL8F45QgHx2gLMQ2cDxBD/4SeR0LSDi5XzPQNjM4ySE/HGG6g+ugltLNSARn281BPtNO72eJLjdX4ITSEgpQvJYFEUg24f1qAYQNQdxx6Q/RcB85j9f+03zf2QV33IDPHegNgPABTfqFR8cZK9TA7/ll0EQbUUHW8Gr1d+MSadia+LRHwhunv87yWoJ3h/pRDwJAbDNQQFd2P2mH4kP/wDT/ZeN3CK3+ZjvgVpw4r20AMafb58j4N1UMknuj6iCx883PU9g2VHVH5JX2eEcPghSgRBCKPzK0Q3fknwPN0Hk0CyC0zBkz//7duEetgFjVtypASDI4CsknYJgYDhqsBxxy29+eyxrAZX75EEf8f+CkOcijMDDHx4ASYGGu8WHgPwpHJc0qOG8FgFTuVk0cRZVePFwHEIUEu8xSHoL5qWg4I7/HgOKXe2dcnu2SSdCGIDTA+AcxY1zYL6Q6AAFu+/1GvjKPSeEoJV3NiM4Dz9C6oWkEav+NWjPWXNOIkKgNTi2I8LeBgaZHJxqrC4oNXoB9pzzMws/OW3ghSyQJgjbygOVEDhoj4nHLld8HPD6UUMFVLIgKrTL7cFoBRLQgEdXIseZ2/HhFPKbk4d5tYWwwR0nIFQSD2P5gQhs6meVfB+Bkyz2fOIvX/zxqsSODuAGIOLtPNnmIPCrv6Kqvgz3q4tCwNl9lWYfnsdHj2HTgQw5IBHwULmfSu1jEV3gDFSxTBmqSEVqiYK2IkWcRiAkwV/cyW9YhqHXDw9dkNQAcO6HFNJT7oChfrPUYc3KY17zAd+evAwF2w5SCKLV4EuCEKsKfjBVWHu9Q9Arh4CoBqEMWYBsNX7YgKP/69uC3M7/mOOz232QT+ox4iCyJGEFP4oBHd+GVvXBwX35nqp7qeIbV6L6tdZub3ueJ+gBIKgC6S5gOQFxDoGr+Bv2nzqbknd7ph/EmXzO0o+kZdc/wqvQkAOUffVMzKtYgx5Vob1/+HAfCdzHSiXHenX35/2JTr3KZ9Ruj2lYiMhLIFoNyMq9hFroeYMTE0bSLbhb4l3YlFPa6hMd2jk8dmrDgdQCnC4/+ANFlYTB6ATlx2GDGXP1rvL+SnWHw+cJes5/rRWt4H2pw9GklD4uSMpwasIQiaYR92gIyFX5S8dtRZt/nCAH48VXW3hRE/HKOsGquj8EM85Q9cfeAV4XwNGAlmIFIwPYrfLKuxV476RRetzcdeAsRSZhiHizCKEIOHn3EMOWy5X4uIJnXX6sFiBFLaBm/THOQAkVJK9j6TKwiSDTBWpwHkSPQJX7U959uAkoaTUuug6oQCBz1Zlxm0OJSIoIw04M+7zCGuYiznCfHww9AN6Ir+HXA7lfn2oBSJ2FOOh8SzINfmcAyITq8JX/sOMPx6A9LeYtVfwgCBZhdu25OB9/XmWWNPUEPD5dUuJ68wd1AqD2+w1PI9KxE9BW5t3z/igdYGWiL7L+wPv9jgVY8f0ZcbCKCuLAHN+c5wa69Zpr0J9t2KnpAGzyiAIPiFalJ8/xXrrA6Y+/8NoDnWCPNwFJzf5DpVkHte8hx76P+HU1+HEytEeSEIzAsu5r6wPJGu6oLz8VrKofXLce+ywIHhNa/Dmw8LrptWXZ4NKZm4pr/QQ7Qk8ehMrPtAF7PQCD309QgRgRZMKgAbFREAfBBXNalbHA9cEHMo4IgIUuPjjBWEUFEQpYTkhVO43eRiynJw9Jjj8TOUIlJExK+0wA4gWgQvcFBHAc7P4/u78/Ff4CC5ATB3P3oUwFClYgcALcxzp/B9Ez4DUV8RjBbsCBrMH4dLNwIDaCGhA6o3pXksdBvYBsktrXDgNJKAFy1Z+ZGIy5NXgXoBT8a3ZgVSPIUAMV6DjLxhsV8wX4n4ibbONObHNyCr8Z4FinNFjg8ziiF5zSV8A99u7Zdf5OisvVaAAAG3VJREFU/kIPAJLWX3hUIFD6o7MD4WkHIMXBk4IftSrPNBJVk0OoC7ice8HGS8XBKDoz/YFBLaQi392lGpCMJfhD9xVkx5Xbj73P9V4m1j0v73x9FjDDPlYvATkgFAVWcdNvJBamliOjAwRV0EpeRymAe717kMYRyy/j5FwFBX0fP7Dyx8gq8wn2ZXi8GfGYR+lFcGJSxa3Y84WgzBHetlU4cvKY44Ps4iP9fsgsPGEhQTAcHqwwGCj61SoPexKwasXFqtxq8qhD9SixoBBYcJEDNzmIoi3J7QkoJActVHocTVpPBCDhElAvMDK1PT/Sq3DwB/ygmyB9GNhYDH4so4Foy48kkPtZfZEv1PQTxYpyX0EI3Bu+/5krcN8fgwVdwWu2JNVNWAk+PcOOPMNdGFyAZ5Aj6gicgzNfwuHZg0HrLxBWfjSRl88fVCo/apX/IBrIvf65ZxtEoK9Bec4KZIPLe76osQns46NwW0pUPCPAyMc4A/KXOwZzFLGbAqD5xhhbgBcWfoJBAlarcCSQgdQJ+Movnih4gjZQTw51rz588y/ZgxVUEAQ8soCfX8OR26JwujCLGFAMsOjnwGrlPuQw9D/PPv8BYVR7pG/eeFtQpsLzR2KFI8SwKj9KlX++HeLOPuSBKrKeHBi7L4b+Kx184+ptAp4Trcscv69oARVYzWgaK01H1X0K3zNSmARKtxXYHvwJuT+8gLGGWgpHcWOmBeljFB2Ckg6wiAYOqfxEK3GMCAj6kIiTWdCBCXhkjUKMgJcLk271N9uLSbtvvK0S69OXAvoA5z94VsFubbmZvx4QAnXgBnJxENyQjy38wef81uPhxMpPJIQzr5ckuUTKe0wZyN57iFTWga8GvCwlh5UqvYgmaNV9XSxEVWs40kkosFwA70RgNOu8mLZfR6wDiwRa35y7j08NksqPQhcfkRBK/J8R75Iz+9C8gJpqzwiIeZII3QnYOkJWbVEI5jNuA+o2BwK82ifwnpSgHwaC+GNAdmW2VXfC+vPu6wR6lBj84C9WfvivZyUhZMJlJhjSukDlFJ3g4AvGJfC1iEpQJ/CaEd7G9wds7p71+odruKrHip/C7RdsxeVjzIxhoNkFGOW/+sk/YVAGtltfzZAIfzix8gcHhZCXpcGN2u69qWqD9OlRFAy7x2fQBhHUiETB+DocqvArYt98f+AEAXApsEmEcNLC0t2uPHCqPQIXwHYDfI4/9+8LMpchqr5HK39MJSrBXwnutNqjovjHFdq+fcHLp7YLR4mGgduW5hFpAXUoL4cTTuW5HJSkB5PC0S7A+8c+837DyoM1J9iv/po/o3BunlDqPjOSO/YbLFd+FGy9sxKFeT8b+nLNPrkAyD53FtT27yUS32yqUaEGTMBiASGcZ0FmK8nWxbvjC1q6WQC4VdWdAcBY8eFoAzIrC0b7Wt8wlPcIdE1FhUWeKU1Igv8Q/0dl4k/NnYSxdlDon8diUDeuQB4c8XVzcahRgyyZmNC+LAgeCfSVALde8/t1DCYawNoePGT83wlOpFUdOZKwxn89OsMEf0X8CxJCBN/dwKbFwkSMgx0ACJJDJD4iC1JEYh6XcEqVHpx4+J4I4UiAl26r5x64sttvSlAn3LBuQCz6edU8C+J5epBrC4YP52EFDgHrCw1B0eU9bOaTgh3wmYvQV3Oqqcf53XnVNXUBELX1xtSgFrirlII5d3HFulxBCNEfZx0h7K2f34XwdHpuYQcguN189Ow/nPXclaUcqMH5leCXjKOjbv3F0a7i2ZaRHmBe5zwnhA9S736ZC8AH8LHkg/T5znYgmES1dtuzGo92qwHIquiWX+4KgVLd8utv9Ml1BQNhEJW/FOgweiTguCUoQHkEwYhjfQIgm8eAzPKzHqAG5xGiiPyxeGRRaYetUpDVpHVC1T9bHGyaknb/TQTnuG7rDYwYCUT7/cMjtILzA+Go/FPw581F/mWeTkDuBsBCAK8ki+A29nMzPn4Rzjv6QV7xWW4fzQFUxb9jQQ1qc28kMi4mDl1NBr4usIsz5ltZqNm7AeJXfuTHd7nioLEyPBISU+8/tP1AC4Il/n+YGmjg2NiBRdl6yCw//zG5ph7bqaBuz8B4VMU/TqSsNPbwCeZA1cdxyG9SgKzRZPL+GXFOiH1/SFZ9wX8M3zUgvH8a4rMBjZj/h1W9MrwTiN6MlsCKiI4gycBzgV/xUaQGjGDHwHiYi0VIzeEAasCpNuL76AC7BIEl7i4AIxnAfoMxk35eJbZ68wWEUChs8IPz/EEE9BkUoNA4RCWSLJkY1h0Y/dG9bVCtUVPe7QRhtStXG4nOECDfUxc4Uw/Ik8JkA9o9+a83IrfHH11EdFUWc4phNgVFWkPsIHBnCvCCYBSgqEN9qtoXuwHhByYoJJA7BxIkkRwpDGgAHo+vQ3ZGOwCFJCJKUAx4MBpFZWvReeLgtBBkDDQu2OJxXa7SE/P4ZiUPHABjY1DsFIhPAaygWewiXK72hHjow/k8gCL6gKES8qcDZ7A+EhYlWCPGCX1wXIwzkQEKt8cP6iqkC0FEhFj/ZYtvXCtwuBLcDT5wXN+9H6ZEIkTwV/x/s78fXFX3siWHEKrC3tw7EFZ31Ll7ttknQyEMGgAqCaVe1bGk8r8nFWCQQR0h7CY0dsU/mIeIuA1AGCo02Q0YVXxub36sG1Qgfo0CBBUXxap+ECFEycQVyViBEBFPt14TK9rZHB9EwMG7DPXOv0OVHkdtx7OSCXfb3av4CFZGTwQBwT7/hKPHE4PzpJ4L4+FM9r1n8B+B+9R9I4Fu9brYUZgCunZWNxdQgIs8mASBQ4F8hJpEiaf4GPihk8FdAxin/kybjZjTj+mAQy6ihZ9whDvHAWB6BKrBXQr+5SBfqPaINwiz12UIwoTmbPACZY/fshBBBKNlW8ZCHwH/cVKSOZMm4Mxk4OwE9JeB+EFkn1IzcPQoiSB4vGgNeJSoik1A7m0TCmE/HrggB+/1M12C1Z18ACGoIeH1pH2IhAqFWgBq+kDFEWAvA3X8tpW0cnSD5WAOriOHhnYraF1eLTkS8P/QsHUBdtMPnOrMaANJE9AZiaKWII5Ue/8PTHn/UcCSTgIF2xN4zdmAQYIAKeBFl6FiO0aKfq5jcImHfPwTxcEdRmD3LcFoAva1Hdjm9UgGggI9YOoPkOBYLsT8HlG3nucMDGkOOJ8CkNOELdSO7D5qqAeJYBb2GpABgRi2gxLITgrOQ9C937HgB+0i7MeRx3gfPWCXLtgbLJAu/gCFBPzRX8eADJqCvA3FViC/BlOQC4LZyrBq8BdQAOUKoKjqR7v7EFfVFMojPgEoSlJesNIePyLHwW9NRgq7E6HvUN8A0yj0wyWDHRZ3J2A1jHdMyu3hCGwSDwdRir7h9VP7AKLgPoMCgKziOFLtrUm8aIFHlgxYfz8WBYUU55iAXauo+evJaIK/NTgRJM9sUcZRzcCnMdNKMJc7usnAyrpxHYkTRHK+n1HxS01LheAHqRWwKIDqLvQC0+PupHZgBawfVGsiniTVHwZHRqbUI/D4Cd+ftgyLAR1ehkIiqaKFw7MJEwUIuK5zsu4svoFYCFKgBJZACBuppOId2RDkPZas8H9kULcA9a0KTCQDGtpnzT+RMJiOGseHl4BQ1C29AWUXIIf/OIwwqoNEK3SCuA7FRiBrE9B4/PcrGJ1OQNj83F4Xbol/TgVHfMiIZLAdcaVkgh8sLrd+liNQH/FqsNTfj15m1J0X+ffZuq/gTY7QnvIfJz6UzBJLs83ItQpt3RfZz5iuGfNPajpngUm0R8DoA5jDlzsOTAwZjzsC3Jjxg7H914PjlcskGdghgx9HG4OOQH34uwQyzz61/0qiYNQjXxECuWYbGM/DrjtPH/Mw/K+gBLLSA+cEfPr4MroArzcDuybbr8Zc72i2UnzeHnTgzD4Ug78SzIvCoARVOQxaFFR3TzWnkkHUVFShEuqKxZnKz4p4YYcf8ZhYhuu8wFgSHcuuwCJagI4bgchJQK/qe9c/RT6nGcg6KGREJpb+MI0EY/b0jcsni3AJBeCQNsBOFVYoApcM2Aom4VFgIRdHpeIG8D3YaxBD+qCiQ+rBOSVnci8hzkAG1t/pgHA4uwDzmu8xFKkkkIqCfkIRs204r/hiDgutoAAcowBMZ9+KS0CcXVBOHCvJw2jMQSJyeoeExF2DuTuRcuWAo9sefyUQ6/oBaIjPtiRH1KvQKvygAHb171d+vc4GRMDPoxN/kL5pwlVh1mBQ1quQJAJ5j0TgOAis+h8d3mnC8xTKE34+8sDNjyVXE6nFMN+H39TQDmocHScENvN74LoGScGU4f7g6IG3n3C3qnG6JBS+Z5tHOOzRYQx+u7MZmAl0OSsRLAS/VIKfRAWU92+12aaVPksGDBWQuCMvgNy2M2Mt8EwqbjosZAec5xLEAmXmcFTHiOWARWglpNpjdEtBQRxJJU5VL5/7F1X86XntXgUK4q+KggsUoIIK8oA+kgy4+zLaACqQGTVOX6MBWdehL6BxHn+tlyBMDGAqufd7WOX5WTJwKYDfXJJP2GXDPk7Tj5Ed7BOG7DMFaBRAJgI/+H2Ngeb2SKb0zkoGlQBHkefDr7xMA5HZeJPtKIzyApI9gmnPgf1c3mulfhe0gFekDCdNFnrOwi4Gs6eTACNjB+Uegcgojog4V25P8bctRYY6RL8AJklE9ACFAGZdBEahd4d4CmghFhbzcwaXYH5qTlS6DY+KfNH5Avzjo2JJ0poDkSCMxLn73H/eB+ifvgvyIFCWAji7BWC8hd0qj0FziMdrS70BlVbgamIgcmotGZDNPwm0L9l5iHv7WRoAFx57ScFS2r2iwot8oKu8l+TOCOg2mZ2nFdjTgOFQENzKkJ8OjEnsE8f6AzyXwT6MNF3RDRnuj0Lwo6wTlBMDIyqaz6G+RiLJMg/KUrQV/rh9uH0tWduwoxmky0kSMQ+rnXxZsGadgnxfgk1pCnsIsGYltvfdzTOBIclIsN8MLAGcz5gBwj94AE8DuC9Molip/JGwB57nRyJiyD3pyk6q5ij+3TzRLohcqyqCEQBTepF15+WVmW8SEr5jMUUkx3oMIsrH3ndwAQganKzyMpOJNxMQooGBYwcByw7axIhgPRGEr6GSGJhkAELoQ1YRg+dPeD5IIRDIqq5PA2Jh0Rq0YcS8XBi0ghGRFpCtWTdum5+yLOsQf2EuYY8AfnbQZDgCjHxBSKwTGpt8QCIDVH3/4H5OwEvldhliINwAFLsEyyIfGKV+vm3eEehVqKTdNxtDiPoLHCRiuwTJxCECxMDqDjTvZ63KaPKvRgV2i/F3ohm88V8LN8hgJcXD5pVGIPPNn9EBqSQC0I4AMxBUcQNCkarkFgSn/oCs9GCVep4eUG5BRAOcQOCWlGSc3If0IFqRfURQGRrKewPKEJ9sLnIowKCcw+f48N6UHjqYtgInaCCkBbPSj8VEkCr2g8U43wY1xX/BNkwreQrzg+oaJghOCGTU8RBxuIp6VFOGoEXgEsBLIgV6gBgxoLSI5CgiYNT+GBHsU01GthrceiMUtv9KgAYktgVNeGrBbtiOQVi9x8WjiAW7UNUnm4Vet7WtsFgDCDYEwQ/EVL1PnQf/xCDLTowTh4c4HPRDoQaiwhKIAae4B7xgCBydI/CDPOrevK0FR4p6w3VfoXgQiB3T1N8Y1PCD0X19JqcHGfzB5WkQE4p/kdeXBcEVUXEIFqSij82lMyrWq/7c+LFHA7z5/dwOHHg8s/Y8C2CmhbmALtare+4UWLfb25BmXABKABTniC8gRAP2yvDAiUAsElnrxFzITQa/sAFecAOY7zPV/8jMQHSbWAiUPGkQNABhw85xrSCv+mMSzFR8+7mjw01A8f4F8S/td4jnDHYxpT8/OEyV3gz2+GTfdAeAszswfJNGlQhEIjB0Bls0BKn4Iw7WKu9f1gmSagmvqleEwJwnZwjO7npz1HdCJ1hS/mlBcRXyF3i/M7NxqJFoeH27z7nnJaBmpUZKHsTbGUc1ALEoIGsGYl9ixS50gjAT/VhB8IzvGTrBVfWEz1MzAkRFTtecW731VdjNQPukVdhdn0Y8d/a7WYH6i/TBPBzUFwAlHwtGHOQISrgb1AMUgDETTA3+THAdeRJhg59V/Ektofa9I8wxVICkC7QQSAd2O3cftzPzdMK6aA4iZI4ILfYRbb9RgqICt2AxVnYZ4kkBvHOBxT/zN9ybHx/f5Ql2fkGCX6ANm6F8WCfqAS+Eq5AGcHJd2IFHagTMHAAj+mWBnDXuc81CjhsAi5dL2K8QCYI1aJ/PJtSSxEFXASv7C2I3ZB9/a0j/7nDn/j1pHsz9Jr8fNpxPBUAUUYD4wz5GBlmyAiORjtAIGDFwzSUwqiNZ1d1tPiB7/Q9VeI9KeJU16/knkEeQJEALjY4rkp74fCZiMDSA/PgvT/aT2gYgp5E/P29AKBQAo6TRth5T4VesQFb0i4K7RA2MZpgyFXCEQHCOixuYMPgy2L7+45ezSSKt2oUkURlpXkEMOLSiXPuDQZjk63N5bmzOSxQdLHX7AhwUEA0BAeQPJIQzkAuFlOK/GtyLdiGDKEBdllQ7YouxV2Xdwza9So4Kp5Z0yAgUhTlJgFzSFrznIHYIwKcCu2/L3LsCg6UI1b1/CA+ApIV5/32HqOIjdQusE4azip5Wc1b0q/QGIAlaWEJbXP3r/L+AEipw/+BtkQVY9fIM2i/ZhgVEgJO6DZ1ksVtlYdoQAPhVO0oKmYBmnAYco4DRCRB3TwCziptaE0auER9/VzRqKNOEYINOQg2m1l9GpGNQAhh1v6UmxNQh2M4+LmlUzll0OTjYQOaGlZAEMCrdhmBphaMBwBADrSQQc3//He8KgFETT7p6BHnjj2X9EXsDjrgBS6ihoAmcSQVYmE4JgYWFpp1waAQRoqDzxDhU+HxSnZHz/9JEY6Y5MJA+cwoWrt99+U3Mc/9g/NQTFaigAEtwB1yBzwzucZSX7RZEILhR1d5GDCsBLVUdIQvsldZfEJt5i/MHx2hGJZFkVVyK242iFeh58oBUFqIQbkfp2DV2X0CkAYgv1sU+P+I/HmBu8nErugdRnUWhfp+A/ddlbEH3uQlBsNobUEMHasK1HOYn8BEEvCUaiuigXRIKj+sGOPA4KAWz9/s7WxcgB4+a6/fI2osEwv4yOENAiPf+wQhbc/5f0gGisWuQaRFmGoIqguARWsBQgTTocDLMT5OJUQnhqdCEig+/EShKSEgTVV0MBMnz04BcshPnLk/+OaV0/dwKzB4QUt1NB6uTDfGOP+cNm9mEsBAFiM7AQh9AKVEU75vy68jeOxrUC4mDEuYO0oLqoSdHaEF2eXYYSm0V+oEOwpLmYFOF3Z4CmAeBTIGueiIw2xoKPzDBJVBXQ5g5O8/twwA+QguIjJt3+g0NQEcDfUXgO5gsqlTBLkQLdl86K3CWneitQ8sg/5oWAUJP2C3V3RoEyji5n4b9lB4t9pz2CA+cAFn1Z9I/uzYsU/ELtEBOCHYQQqGcFejV+yeuRJX31zsKV5IGjway9z6PLDxKwNEPsBuOEiqw57jGgOtZ1Y++T50AuMFl7hPIbhskiOwsATtRoc7rS7dXrpcgrMCGJca6ELJo+Y0be0BW5ZKGcFz4y8W9BduwcDnK9iO5fagsKpp9ANnvDPxeP8THNyIVFo1AMas8Qk5v2Ytm0LCCYAXqn+wQsPTBh/5Bcnne14Os3uCQt28vsK1WUESJFviBgAW//3u9PLxusXchcCR2WsNzv/ImvgZzzkUByDUAIrjTvmSHAowpJBQE4SUlxMxnARlQbIqkArVAJ6pBBvELCCKlkyCDAP45BYfEPfcUpfMch3Vn4bheYK4E66BxAxHSVd5INgEPgU/NBCDfNQ8Ho1CoINAPQAW/QT8OCIZlNFCB84XhoDChFByHGjx35v9BLgyhmojqHYb5QYXnuAecvua0hZe6BV9f7v4ibvgvamrmAc1TmaEir0LQ9h97eYAYVoM/nWA60i8Q3Ifezha9BqaaL3zvqd6IAuwwLSCCuCLuJWch4h30giPtyiAphKEBcCu9BV5wwzkMxID8rhMwdwMhcSFgrBT3RUTQboAUg3+p+Qe1IGarOioVnazmefV3lHpwA0AcLWCahUiXwePHWJsP+GH1gnp/we5KfOhJAbsj0H/BIEb04TbrTPsAyb2LLu93KwfCvn5PLAwrOXAa72eEQRo1CNdw5IprsAZ3hApy9zlcITG2vpCihsRSYxNS+J4vdBZ6B52eqRcQ/QXmSjAWSfa/5GA5qEg4iJFtm624AqXLrSA2gx8p1Mdqcghv41S0lSp/xAYs9gakQc4Ie2RTUYwYgt748mV+FU1Xgp14eW3XYZ6cdqGTNHwHICTwEeTPl0jEZwIgP9gDEaogeg5IHWCF+1eoAhvEKPB/EAeTRsM/pSAP5wjWEUMM1/NJRhwJbpJSgK7S7zF3EOsI5jBQBK9DV80Z8Y0COzvmWzJXgDl40KEC6cqvqgi4OB5cpgLFYK/1CvDiItXqC6/S87wfAUfPtxqfGNzlYaOjlf1IsHPPvffHgDAoEeEST4ZLZUd/RSo91/BjXY5ggWgQ4In3fyj4mUqPrInHOCLKO3wUwRsfyXpt1nEIRLrqcWeTuk7bigsbid1zD4iDRQtnIdQsyIXnFCn1I9D7ADgxEhOvR5AJosoUbu1FkJyYCi9OhQERoIx+4AX/YqUXQhtYEwKN4Cy1HntLMmtaAQpqfrT/UCoLSxeswjA5UWPPi0mjajUWxMTdVusNvt/ChMdmILK5IRMFu90BMEzFYHdg2GAgeYVHMMJIBTA7EFTx/5fpgTFXz9w/en0ZjD8kCDoKPNGwlB01BmoWQbh+AxR689mBponGJOr9OwmMu3dtJ/ylW1Tik4ElUPmR9RqII+pVhD9ychABMQ51gOIZg+/G+5mGIzLB1JJC5WhzYjhJ7IWmLDpA8jzsAafUPkB2WnFBF4iSxkq1ty7f25rv/+EQLOxs2oUdTSA9HIR9swdBlCcFe9owPC3XWDDC0ISVzsEVbSCF/sWdA5Fu4HJqankp2SeQCYYrImNalfmhpVxYrGkUS4LeSUjg8dD7+D7w/ybIfy7vlB9/HJ978zr7/45Qgajzj+4EjIK/ULHPRAOlKr/aG0AFcqCyu0GcW45Igh6JMJmhA49/U+cEssHNJhtXDC1MOya3j/sAiAGcrEtqtgjBD6wEzSDc7D8o6C8rIqAZyPk+NQoNLAZ1hR64Yl1FBY648smUYKnSg1Xwk/0DyRyArByMUobyByhCcPnOaPyoegREFS4jNfYAw+IHCjdC1J2WDZBke/OyN85J24WiXwDYPoJyYuCD238ulvuzwt6KgHf0shWKsqCFFGjB/w8HU8eeTED9wAAAAABJRU5ErkJggg==\", r;\n        }(), mr = function() {\n          function r(t) {\n            this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.roughness = 0, this._indexOfRefraction = r._DefaultIndexOfRefraction, this.indexOfRefraction = r._DefaultIndexOfRefraction, this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._textureRoughness = null, this.textureRoughness = null, this._remapF0OnInterfaceChange = !0, this.remapF0OnInterfaceChange = !0, this._bumpTexture = null, this.bumpTexture = null, this._isTintEnabled = !1, this.isTintEnabled = !1, this.tintColor = I.a.White(), this.tintColorAtDistance = 1, this.tintThickness = 1, this._tintTexture = null, this.tintTexture = null, this._internalMarkAllSubMeshesAsTexturesDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e, n, i) {\n            return !(t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.ClearCoatTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._textureRoughness && lt.a.ClearCoatTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking() || n.getCaps().standardDerivatives && this._bumpTexture && lt.a.ClearCoatBumpTextureEnabled && !i && !this._bumpTexture.isReady() || this._isTintEnabled && this._tintTexture && lt.a.ClearCoatTintTextureEnabled && !this._tintTexture.isReadyOrNotBlocking()));\n          }, r.prototype.prepareDefines = function(t, e) {\n            var n;\n            this._isEnabled ? (t.CLEARCOAT = !0, t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === ((n = this._textureRoughness) === null || n === void 0 ? void 0 : n._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), t.CLEARCOAT_REMAP_F0 = this._remapF0OnInterfaceChange, t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.ClearCoatTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._texture, t, \"CLEARCOAT_TEXTURE\") : t.CLEARCOAT_TEXTURE = !1, this._textureRoughness && lt.a.ClearCoatTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._textureRoughness, t, \"CLEARCOAT_TEXTURE_ROUGHNESS\") : t.CLEARCOAT_TEXTURE_ROUGHNESS = !1, this._bumpTexture && lt.a.ClearCoatBumpTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._bumpTexture, t, \"CLEARCOAT_BUMP\") : t.CLEARCOAT_BUMP = !1, t.CLEARCOAT_DEFAULTIOR = this._indexOfRefraction === r._DefaultIndexOfRefraction, this._isTintEnabled ? (t.CLEARCOAT_TINT = !0, this._tintTexture && lt.a.ClearCoatTintTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._tintTexture, t, \"CLEARCOAT_TINT_TEXTURE\") : t.CLEARCOAT_TINT_TEXTURE = !1) : (t.CLEARCOAT_TINT = !1, t.CLEARCOAT_TINT_TEXTURE = !1))) : (t.CLEARCOAT = !1, t.CLEARCOAT_TEXTURE = !1, t.CLEARCOAT_TEXTURE_ROUGHNESS = !1, t.CLEARCOAT_BUMP = !1, t.CLEARCOAT_TINT = !1, t.CLEARCOAT_TINT_TEXTURE = !1, t.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, t.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1);\n          }, r.prototype.bindForSubMesh = function(t, e, n, i, o, a, s, d) {\n            var p, y, P, R, B, F, z, J, ie = d._materialDefines, se = ie.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL;\n            if (!t.useUbo || !o || !t.isSync) {\n              se && lt.a.ClearCoatTextureEnabled ? (t.updateFloat4(\"vClearCoatInfos\", this._texture.coordinatesIndex, this._texture.level, -1, -1), $e.a.BindTextureMatrix(this._texture, t, \"clearCoat\")) : (this._texture || this._textureRoughness) && lt.a.ClearCoatTextureEnabled && (t.updateFloat4(\"vClearCoatInfos\", (y = (p = this._texture) === null || p === void 0 ? void 0 : p.coordinatesIndex) !== null && y !== void 0 ? y : 0, (R = (P = this._texture) === null || P === void 0 ? void 0 : P.level) !== null && R !== void 0 ? R : 0, (F = (B = this._textureRoughness) === null || B === void 0 ? void 0 : B.coordinatesIndex) !== null && F !== void 0 ? F : 0, (J = (z = this._textureRoughness) === null || z === void 0 ? void 0 : z.level) !== null && J !== void 0 ? J : 0), this._texture && $e.a.BindTextureMatrix(this._texture, t, \"clearCoat\"), !this._textureRoughness || se || ie.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE || $e.a.BindTextureMatrix(this._textureRoughness, t, \"clearCoatRoughness\")), this._bumpTexture && n.getCaps().standardDerivatives && lt.a.ClearCoatTextureEnabled && !i && (t.updateFloat2(\"vClearCoatBumpInfos\", this._bumpTexture.coordinatesIndex, this._bumpTexture.level), $e.a.BindTextureMatrix(this._bumpTexture, t, \"clearCoatBump\"), e._mirroredCameraPosition ? t.updateFloat2(\"vClearCoatTangentSpaceParams\", a ? 1 : -1, s ? 1 : -1) : t.updateFloat2(\"vClearCoatTangentSpaceParams\", a ? -1 : 1, s ? -1 : 1)), this._tintTexture && lt.a.ClearCoatTintTextureEnabled && (t.updateFloat2(\"vClearCoatTintInfos\", this._tintTexture.coordinatesIndex, this._tintTexture.level), $e.a.BindTextureMatrix(this._tintTexture, t, \"clearCoatTint\")), t.updateFloat2(\"vClearCoatParams\", this.intensity, this.roughness);\n              var ce = 1 - this._indexOfRefraction, ue = 1 + this._indexOfRefraction, fe = Math.pow(-ce / ue, 2), ve = 1 / this._indexOfRefraction;\n              t.updateFloat4(\"vClearCoatRefractionParams\", fe, ve, ce, ue), this._isTintEnabled && (t.updateFloat4(\"vClearCoatTintParams\", this.tintColor.r, this.tintColor.g, this.tintColor.b, Math.max(1e-5, this.tintThickness)), t.updateFloat(\"clearCoatColorAtDistance\", Math.max(1e-5, this.tintColorAtDistance)));\n            }\n            e.texturesEnabled && (this._texture && lt.a.ClearCoatTextureEnabled && t.setTexture(\"clearCoatSampler\", this._texture), this._textureRoughness && !se && !ie.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE && lt.a.ClearCoatTextureEnabled && t.setTexture(\"clearCoatRoughnessSampler\", this._textureRoughness), this._bumpTexture && n.getCaps().standardDerivatives && lt.a.ClearCoatBumpTextureEnabled && !i && t.setTexture(\"clearCoatBumpSampler\", this._bumpTexture), this._isTintEnabled && this._tintTexture && lt.a.ClearCoatTintTextureEnabled && t.setTexture(\"clearCoatTintSampler\", this._tintTexture));\n          }, r.prototype.hasTexture = function(t) {\n            return this._texture === t || this._textureRoughness === t || this._bumpTexture === t || this._tintTexture === t;\n          }, r.prototype.getActiveTextures = function(t) {\n            this._texture && t.push(this._texture), this._textureRoughness && t.push(this._textureRoughness), this._bumpTexture && t.push(this._bumpTexture), this._tintTexture && t.push(this._tintTexture);\n          }, r.prototype.getAnimatables = function(t) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && t.push(this._texture), this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0 && t.push(this._textureRoughness), this._bumpTexture && this._bumpTexture.animations && this._bumpTexture.animations.length > 0 && t.push(this._bumpTexture), this._tintTexture && this._tintTexture.animations && this._tintTexture.animations.length > 0 && t.push(this._tintTexture);\n          }, r.prototype.dispose = function(t) {\n            var e, n, i, o;\n            t && ((e = this._texture) === null || e === void 0 || e.dispose(), (n = this._textureRoughness) === null || n === void 0 || n.dispose(), (i = this._bumpTexture) === null || i === void 0 || i.dispose(), (o = this._tintTexture) === null || o === void 0 || o.dispose());\n          }, r.prototype.getClassName = function() {\n            return \"PBRClearCoatConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.CLEARCOAT_BUMP && e.addFallback(n++, \"CLEARCOAT_BUMP\"), t.CLEARCOAT_TINT && e.addFallback(n++, \"CLEARCOAT_TINT\"), t.CLEARCOAT && e.addFallback(n++, \"CLEARCOAT\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vClearCoatTangentSpaceParams\", \"vClearCoatParams\", \"vClearCoatRefractionParams\", \"vClearCoatTintParams\", \"clearCoatColorAtDistance\", \"clearCoatMatrix\", \"clearCoatRoughnessMatrix\", \"clearCoatBumpMatrix\", \"clearCoatTintMatrix\", \"vClearCoatInfos\", \"vClearCoatBumpInfos\", \"vClearCoatTintInfos\");\n          }, r.AddSamplers = function(t) {\n            t.push(\"clearCoatSampler\", \"clearCoatRoughnessSampler\", \"clearCoatBumpSampler\", \"clearCoatTintSampler\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vClearCoatParams\", 2), t.addUniform(\"vClearCoatRefractionParams\", 4), t.addUniform(\"vClearCoatInfos\", 4), t.addUniform(\"clearCoatMatrix\", 16), t.addUniform(\"clearCoatRoughnessMatrix\", 16), t.addUniform(\"vClearCoatBumpInfos\", 2), t.addUniform(\"vClearCoatTangentSpaceParams\", 2), t.addUniform(\"clearCoatBumpMatrix\", 16), t.addUniform(\"vClearCoatTintParams\", 4), t.addUniform(\"clearCoatColorAtDistance\", 1), t.addUniform(\"vClearCoatTintInfos\", 2), t.addUniform(\"clearCoatTintMatrix\", 16);\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, r._DefaultIndexOfRefraction = 1.5, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"intensity\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"roughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"indexOfRefraction\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"texture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useRoughnessFromMainTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"textureRoughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"remapF0OnInterfaceChange\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"bumpTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isTintEnabled\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"tintColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"tintColorAtDistance\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"tintThickness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"tintTexture\", void 0), r;\n        }(), gr = function() {\n          function r(t) {\n            this._isEnabled = !1, this.isEnabled = !1, this.intensity = 1, this.direction = new u.d(1, 0), this._texture = null, this.texture = null, this._internalMarkAllSubMeshesAsTexturesDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e) {\n            return !(t._areTexturesDirty && e.texturesEnabled && this._texture && lt.a.AnisotropicTextureEnabled && !this._texture.isReadyOrNotBlocking());\n          }, r.prototype.prepareDefines = function(t, e, n) {\n            this._isEnabled ? (t.ANISOTROPIC = this._isEnabled, this._isEnabled && !e.isVerticesDataPresent(Oe.b.TangentKind) && (t._needUVs = !0, t.MAINUV1 = !0), t._areTexturesDirty && n.texturesEnabled && (this._texture && lt.a.AnisotropicTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._texture, t, \"ANISOTROPIC_TEXTURE\") : t.ANISOTROPIC_TEXTURE = !1)) : (t.ANISOTROPIC = !1, t.ANISOTROPIC_TEXTURE = !1);\n          }, r.prototype.bindForSubMesh = function(t, e, n) {\n            t.useUbo && n && t.isSync || (this._texture && lt.a.AnisotropicTextureEnabled && (t.updateFloat2(\"vAnisotropyInfos\", this._texture.coordinatesIndex, this._texture.level), $e.a.BindTextureMatrix(this._texture, t, \"anisotropy\")), t.updateFloat3(\"vAnisotropy\", this.direction.x, this.direction.y, this.intensity)), e.texturesEnabled && this._texture && lt.a.AnisotropicTextureEnabled && t.setTexture(\"anisotropySampler\", this._texture);\n          }, r.prototype.hasTexture = function(t) {\n            return this._texture === t;\n          }, r.prototype.getActiveTextures = function(t) {\n            this._texture && t.push(this._texture);\n          }, r.prototype.getAnimatables = function(t) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && t.push(this._texture);\n          }, r.prototype.dispose = function(t) {\n            t && this._texture && this._texture.dispose();\n          }, r.prototype.getClassName = function() {\n            return \"PBRAnisotropicConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.ANISOTROPIC && e.addFallback(n++, \"ANISOTROPIC\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vAnisotropy\", \"vAnisotropyInfos\", \"anisotropyMatrix\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vAnisotropy\", 3), t.addUniform(\"vAnisotropyInfos\", 2), t.addUniform(\"anisotropyMatrix\", 16);\n          }, r.AddSamplers = function(t) {\n            t.push(\"anisotropySampler\");\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"intensity\", void 0), Object(c.c)([Object(L.n)()], r.prototype, \"direction\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"texture\", void 0), r;\n        }(), ap = function() {\n          function r(t) {\n            this._useEnergyConservation = r.DEFAULT_USE_ENERGY_CONSERVATION, this.useEnergyConservation = r.DEFAULT_USE_ENERGY_CONSERVATION, this._useSmithVisibilityHeightCorrelated = r.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this.useSmithVisibilityHeightCorrelated = r.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED, this._useSphericalHarmonics = r.DEFAULT_USE_SPHERICAL_HARMONICS, this.useSphericalHarmonics = r.DEFAULT_USE_SPHERICAL_HARMONICS, this._useSpecularGlossinessInputEnergyConservation = r.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this.useSpecularGlossinessInputEnergyConservation = r.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION, this._internalMarkAllSubMeshesAsMiscDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsMiscDirty = function() {\n            this._internalMarkAllSubMeshesAsMiscDirty();\n          }, r.prototype.prepareDefines = function(t) {\n            t.BRDF_V_HEIGHT_CORRELATED = this._useSmithVisibilityHeightCorrelated, t.MS_BRDF_ENERGY_CONSERVATION = this._useEnergyConservation && this._useSmithVisibilityHeightCorrelated, t.SPHERICAL_HARMONICS = this._useSphericalHarmonics, t.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = this._useSpecularGlossinessInputEnergyConservation;\n          }, r.prototype.getClassName = function() {\n            return \"PBRBRDFConfiguration\";\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, r.DEFAULT_USE_ENERGY_CONSERVATION = !0, r.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED = !0, r.DEFAULT_USE_SPHERICAL_HARMONICS = !0, r.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION = !0, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useEnergyConservation\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useSmithVisibilityHeightCorrelated\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useSphericalHarmonics\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], r.prototype, \"useSpecularGlossinessInputEnergyConservation\", void 0), r;\n        }(), Zr = function() {\n          function r(t) {\n            this._isEnabled = !1, this.isEnabled = !1, this._linkSheenWithAlbedo = !1, this.linkSheenWithAlbedo = !1, this.intensity = 1, this.color = I.a.White(), this._texture = null, this.texture = null, this._useRoughnessFromMainTexture = !0, this.useRoughnessFromMainTexture = !0, this._roughness = null, this.roughness = null, this._textureRoughness = null, this.textureRoughness = null, this._albedoScaling = !1, this.albedoScaling = !1, this._internalMarkAllSubMeshesAsTexturesDirty = t;\n          }\n          return r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e) {\n            return !(t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.SheenTextureEnabled && !this._texture.isReadyOrNotBlocking() || this._textureRoughness && lt.a.SheenTextureEnabled && !this._textureRoughness.isReadyOrNotBlocking()));\n          }, r.prototype.prepareDefines = function(t, e) {\n            var n;\n            this._isEnabled ? (t.SHEEN = this._isEnabled, t.SHEEN_LINKWITHALBEDO = this._linkSheenWithAlbedo, t.SHEEN_ROUGHNESS = this._roughness !== null, t.SHEEN_ALBEDOSCALING = this._albedoScaling, t.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = this._useRoughnessFromMainTexture, t.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = this._texture !== null && this._texture._texture === ((n = this._textureRoughness) === null || n === void 0 ? void 0 : n._texture) && this._texture.checkTransformsAreIdentical(this._textureRoughness), t._areTexturesDirty && e.texturesEnabled && (this._texture && lt.a.SheenTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._texture, t, \"SHEEN_TEXTURE\") : t.SHEEN_TEXTURE = !1, this._textureRoughness && lt.a.SheenTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._textureRoughness, t, \"SHEEN_TEXTURE_ROUGHNESS\") : t.SHEEN_TEXTURE_ROUGHNESS = !1)) : (t.SHEEN = !1, t.SHEEN_TEXTURE = !1, t.SHEEN_TEXTURE_ROUGHNESS = !1, t.SHEEN_LINKWITHALBEDO = !1, t.SHEEN_ROUGHNESS = !1, t.SHEEN_ALBEDOSCALING = !1, t.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, t.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1);\n          }, r.prototype.bindForSubMesh = function(t, e, n, i) {\n            var o, a, s, d, p, y, P, R, B = i._materialDefines, F = B.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL;\n            t.useUbo && n && t.isSync || (F && lt.a.SheenTextureEnabled ? (t.updateFloat4(\"vSheenInfos\", this._texture.coordinatesIndex, this._texture.level, -1, -1), $e.a.BindTextureMatrix(this._texture, t, \"sheen\")) : (this._texture || this._textureRoughness) && lt.a.SheenTextureEnabled && (t.updateFloat4(\"vSheenInfos\", (a = (o = this._texture) === null || o === void 0 ? void 0 : o.coordinatesIndex) !== null && a !== void 0 ? a : 0, (d = (s = this._texture) === null || s === void 0 ? void 0 : s.level) !== null && d !== void 0 ? d : 0, (y = (p = this._textureRoughness) === null || p === void 0 ? void 0 : p.coordinatesIndex) !== null && y !== void 0 ? y : 0, (R = (P = this._textureRoughness) === null || P === void 0 ? void 0 : P.level) !== null && R !== void 0 ? R : 0), this._texture && $e.a.BindTextureMatrix(this._texture, t, \"sheen\"), !this._textureRoughness || F || B.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE || $e.a.BindTextureMatrix(this._textureRoughness, t, \"sheenRoughness\")), t.updateFloat4(\"vSheenColor\", this.color.r, this.color.g, this.color.b, this.intensity), this._roughness !== null && t.updateFloat(\"vSheenRoughness\", this._roughness)), e.texturesEnabled && (this._texture && lt.a.SheenTextureEnabled && t.setTexture(\"sheenSampler\", this._texture), this._textureRoughness && !F && !B.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE && lt.a.SheenTextureEnabled && t.setTexture(\"sheenRoughnessSampler\", this._textureRoughness));\n          }, r.prototype.hasTexture = function(t) {\n            return this._texture === t || this._textureRoughness === t;\n          }, r.prototype.getActiveTextures = function(t) {\n            this._texture && t.push(this._texture), this._textureRoughness && t.push(this._textureRoughness);\n          }, r.prototype.getAnimatables = function(t) {\n            this._texture && this._texture.animations && this._texture.animations.length > 0 && t.push(this._texture), this._textureRoughness && this._textureRoughness.animations && this._textureRoughness.animations.length > 0 && t.push(this._textureRoughness);\n          }, r.prototype.dispose = function(t) {\n            var e, n;\n            t && ((e = this._texture) === null || e === void 0 || e.dispose(), (n = this._textureRoughness) === null || n === void 0 || n.dispose());\n          }, r.prototype.getClassName = function() {\n            return \"PBRSheenConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.SHEEN && e.addFallback(n++, \"SHEEN\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vSheenColor\", \"vSheenRoughness\", \"vSheenInfos\", \"sheenMatrix\", \"sheenRoughnessMatrix\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vSheenColor\", 4), t.addUniform(\"vSheenRoughness\", 1), t.addUniform(\"vSheenInfos\", 4), t.addUniform(\"sheenMatrix\", 16), t.addUniform(\"sheenRoughnessMatrix\", 16);\n          }, r.AddSamplers = function(t) {\n            t.push(\"sheenSampler\"), t.push(\"sheenRoughnessSampler\");\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"linkSheenWithAlbedo\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"intensity\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"color\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"texture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useRoughnessFromMainTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"roughness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"textureRoughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"albedoScaling\", void 0), r;\n        }(), Jr = function() {\n          function r(t, e, n) {\n            this._isRefractionEnabled = !1, this.isRefractionEnabled = !1, this._isTranslucencyEnabled = !1, this.isTranslucencyEnabled = !1, this._isScatteringEnabled = !1, this.isScatteringEnabled = !1, this._scatteringDiffusionProfileIndex = 0, this.refractionIntensity = 1, this.translucencyIntensity = 1, this.useAlbedoToTintRefraction = !1, this._thicknessTexture = null, this.thicknessTexture = null, this._refractionTexture = null, this.refractionTexture = null, this._indexOfRefraction = 1.5, this.indexOfRefraction = 1.5, this._volumeIndexOfRefraction = -1, this._invertRefractionY = !1, this.invertRefractionY = !1, this._linkRefractionWithTransparency = !1, this.linkRefractionWithTransparency = !1, this.minimumThickness = 0, this.maximumThickness = 1, this.tintColor = I.a.White(), this.tintColorAtDistance = 1, this.diffusionDistance = I.a.White(), this._useMaskFromThicknessTexture = !1, this.useMaskFromThicknessTexture = !1, this._useMaskFromThicknessTextureGltf = !1, this.useMaskFromThicknessTextureGltf = !1, this._internalMarkAllSubMeshesAsTexturesDirty = t, this._internalMarkScenePrePassDirty = e, this._scene = n;\n          }\n          return Object.defineProperty(r.prototype, \"scatteringDiffusionProfile\", { get: function() {\n            return this._scene.subSurfaceConfiguration ? this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex] : null;\n          }, set: function(t) {\n            this._scene.enableSubSurfaceForPrePass() && t && (this._scatteringDiffusionProfileIndex = this._scene.subSurfaceConfiguration.addDiffusionProfile(t));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"volumeIndexOfRefraction\", { get: function() {\n            return this._volumeIndexOfRefraction >= 1 ? this._volumeIndexOfRefraction : this._indexOfRefraction;\n          }, set: function(t) {\n            this._volumeIndexOfRefraction = t >= 1 ? t : -1;\n          }, enumerable: !1, configurable: !0 }), r.prototype._markAllSubMeshesAsTexturesDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty();\n          }, r.prototype._markScenePrePassDirty = function() {\n            this._internalMarkAllSubMeshesAsTexturesDirty(), this._internalMarkScenePrePassDirty();\n          }, r.prototype.isReadyForSubMesh = function(t, e) {\n            if (t._areTexturesDirty && e.texturesEnabled) {\n              if (this._thicknessTexture && lt.a.ThicknessTextureEnabled && !this._thicknessTexture.isReadyOrNotBlocking())\n                return !1;\n              var n = this._getRefractionTexture(e);\n              if (n && lt.a.RefractionTextureEnabled && !n.isReadyOrNotBlocking())\n                return !1;\n            }\n            return !0;\n          }, r.prototype.prepareDefines = function(t, e) {\n            if (t._areTexturesDirty && (t.SUBSURFACE = !1, t.SS_TRANSLUCENCY = this._isTranslucencyEnabled, t.SS_SCATTERING = this._isScatteringEnabled, t.SS_THICKNESSANDMASK_TEXTURE = !1, t.SS_MASK_FROM_THICKNESS_TEXTURE = !1, t.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF = !1, t.SS_REFRACTION = !1, t.SS_REFRACTIONMAP_3D = !1, t.SS_GAMMAREFRACTION = !1, t.SS_RGBDREFRACTION = !1, t.SS_LINEARSPECULARREFRACTION = !1, t.SS_REFRACTIONMAP_OPPOSITEZ = !1, t.SS_LODINREFRACTIONALPHA = !1, t.SS_LINKREFRACTIONTOTRANSPARENCY = !1, t.SS_ALBEDOFORREFRACTIONTINT = !1, (this._isRefractionEnabled || this._isTranslucencyEnabled || this._isScatteringEnabled) && (t.SUBSURFACE = !0, t._areTexturesDirty && e.texturesEnabled && this._thicknessTexture && lt.a.ThicknessTextureEnabled && $e.a.PrepareDefinesForMergedUV(this._thicknessTexture, t, \"SS_THICKNESSANDMASK_TEXTURE\"), t.SS_MASK_FROM_THICKNESS_TEXTURE = this._useMaskFromThicknessTexture, t.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF = this._useMaskFromThicknessTextureGltf), this._isRefractionEnabled && e.texturesEnabled)) {\n              var n = this._getRefractionTexture(e);\n              n && lt.a.RefractionTextureEnabled && (t.SS_REFRACTION = !0, t.SS_REFRACTIONMAP_3D = n.isCube, t.SS_GAMMAREFRACTION = n.gammaSpace, t.SS_RGBDREFRACTION = n.isRGBD, t.SS_LINEARSPECULARREFRACTION = n.linearSpecularLOD, t.SS_REFRACTIONMAP_OPPOSITEZ = n.invertZ, t.SS_LODINREFRACTIONALPHA = n.lodLevelInAlpha, t.SS_LINKREFRACTIONTOTRANSPARENCY = this._linkRefractionWithTransparency, t.SS_ALBEDOFORREFRACTIONTINT = this.useAlbedoToTintRefraction);\n            }\n          }, r.prototype.bindForSubMesh = function(t, e, n, i, o, a) {\n            var s = this._getRefractionTexture(e);\n            if (!t.useUbo || !i || !t.isSync) {\n              if (this._thicknessTexture && lt.a.ThicknessTextureEnabled && (t.updateFloat2(\"vThicknessInfos\", this._thicknessTexture.coordinatesIndex, this._thicknessTexture.level), $e.a.BindTextureMatrix(this._thicknessTexture, t, \"thickness\")), t.updateFloat2(\"vThicknessParam\", this.minimumThickness, this.maximumThickness - this.minimumThickness), s && lt.a.RefractionTextureEnabled) {\n                t.updateMatrix(\"refractionMatrix\", s.getReflectionTextureMatrix());\n                var d = 1;\n                s.isCube || s.depth && (d = s.depth);\n                var p = s.getSize().width, y = this.volumeIndexOfRefraction;\n                t.updateFloat4(\"vRefractionInfos\", s.level, 1 / y, d, this._invertRefractionY ? -1 : 1), t.updateFloat3(\"vRefractionMicrosurfaceInfos\", p, s.lodGenerationScale, s.lodGenerationOffset), a && t.updateFloat2(\"vRefractionFilteringInfo\", p, $.a.Log2(p));\n              }\n              this.isScatteringEnabled && t.updateFloat(\"scatteringDiffusionProfile\", this._scatteringDiffusionProfileIndex), t.updateColor3(\"vDiffusionDistance\", this.diffusionDistance), t.updateFloat4(\"vTintColor\", this.tintColor.r, this.tintColor.g, this.tintColor.b, this.tintColorAtDistance), t.updateFloat3(\"vSubSurfaceIntensity\", this.refractionIntensity, this.translucencyIntensity, 0);\n            }\n            e.texturesEnabled && (this._thicknessTexture && lt.a.ThicknessTextureEnabled && t.setTexture(\"thicknessSampler\", this._thicknessTexture), s && lt.a.RefractionTextureEnabled && (o ? t.setTexture(\"refractionSampler\", s) : (t.setTexture(\"refractionSampler\", s._lodTextureMid || s), t.setTexture(\"refractionSamplerLow\", s._lodTextureLow || s), t.setTexture(\"refractionSamplerHigh\", s._lodTextureHigh || s))));\n          }, r.prototype.unbind = function(t) {\n            return !(!this._refractionTexture || !this._refractionTexture.isRenderTarget) && (t.setTexture(\"refractionSampler\", null), !0);\n          }, r.prototype._getRefractionTexture = function(t) {\n            return this._refractionTexture ? this._refractionTexture : this._isRefractionEnabled ? t.environmentTexture : null;\n          }, Object.defineProperty(r.prototype, \"disableAlphaBlending\", { get: function() {\n            return this.isRefractionEnabled && this._linkRefractionWithTransparency;\n          }, enumerable: !1, configurable: !0 }), r.prototype.fillRenderTargetTextures = function(t) {\n            lt.a.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget && t.push(this._refractionTexture);\n          }, r.prototype.hasTexture = function(t) {\n            return this._thicknessTexture === t || this._refractionTexture === t;\n          }, r.prototype.hasRenderTargetTextures = function() {\n            return !!(lt.a.RefractionTextureEnabled && this._refractionTexture && this._refractionTexture.isRenderTarget);\n          }, r.prototype.getActiveTextures = function(t) {\n            this._thicknessTexture && t.push(this._thicknessTexture), this._refractionTexture && t.push(this._refractionTexture);\n          }, r.prototype.getAnimatables = function(t) {\n            this._thicknessTexture && this._thicknessTexture.animations && this._thicknessTexture.animations.length > 0 && t.push(this._thicknessTexture), this._refractionTexture && this._refractionTexture.animations && this._refractionTexture.animations.length > 0 && t.push(this._refractionTexture);\n          }, r.prototype.dispose = function(t) {\n            t && (this._thicknessTexture && this._thicknessTexture.dispose(), this._refractionTexture && this._refractionTexture.dispose());\n          }, r.prototype.getClassName = function() {\n            return \"PBRSubSurfaceConfiguration\";\n          }, r.AddFallbacks = function(t, e, n) {\n            return t.SS_SCATTERING && e.addFallback(n++, \"SS_SCATTERING\"), t.SS_TRANSLUCENCY && e.addFallback(n++, \"SS_TRANSLUCENCY\"), n;\n          }, r.AddUniforms = function(t) {\n            t.push(\"vDiffusionDistance\", \"vTintColor\", \"vSubSurfaceIntensity\", \"vRefractionMicrosurfaceInfos\", \"vRefractionFilteringInfo\", \"vRefractionInfos\", \"vThicknessInfos\", \"vThicknessParam\", \"refractionMatrix\", \"thicknessMatrix\", \"scatteringDiffusionProfile\");\n          }, r.AddSamplers = function(t) {\n            t.push(\"thicknessSampler\", \"refractionSampler\", \"refractionSamplerLow\", \"refractionSamplerHigh\");\n          }, r.PrepareUniformBuffer = function(t) {\n            t.addUniform(\"vRefractionMicrosurfaceInfos\", 3), t.addUniform(\"vRefractionFilteringInfo\", 2), t.addUniform(\"vRefractionInfos\", 4), t.addUniform(\"refractionMatrix\", 16), t.addUniform(\"vThicknessInfos\", 2), t.addUniform(\"thicknessMatrix\", 16), t.addUniform(\"vThicknessParam\", 2), t.addUniform(\"vDiffusionDistance\", 3), t.addUniform(\"vTintColor\", 4), t.addUniform(\"vSubSurfaceIntensity\", 3), t.addUniform(\"scatteringDiffusionProfile\", 1);\n          }, r.prototype.copyTo = function(t) {\n            L.a.Clone(function() {\n              return t;\n            }, this);\n          }, r.prototype.serialize = function() {\n            return L.a.Serialize(this);\n          }, r.prototype.parse = function(t, e, n) {\n            var i = this;\n            L.a.Parse(function() {\n              return i;\n            }, t, e, n);\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isRefractionEnabled\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"isTranslucencyEnabled\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markScenePrePassDirty\")], r.prototype, \"isScatteringEnabled\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"_scatteringDiffusionProfileIndex\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"refractionIntensity\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"translucencyIntensity\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"useAlbedoToTintRefraction\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"thicknessTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"refractionTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"indexOfRefraction\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"_volumeIndexOfRefraction\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"volumeIndexOfRefraction\", null), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"invertRefractionY\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"linkRefractionWithTransparency\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"minimumThickness\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"maximumThickness\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"tintColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"tintColorAtDistance\", void 0), Object(c.c)([Object(L.e)()], r.prototype, \"diffusionDistance\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useMaskFromThicknessTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], r.prototype, \"useMaskFromThicknessTextureGltf\", void 0), r;\n        }(), Ss = f(105), zt = f(25), sp = (f(160), `uniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\n\nuniform vec4 vLightingIntensity;\nuniform vec4 vReflectivityColor;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\n\n#ifdef ALBEDO\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef OPACITY\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\n#endif\n\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(SS_REFRACTION)\nuniform mat4 view;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REALTIME_FILTERING\nuniform vec2 vReflectionFilteringInfo;\n#endif\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionMicrosurfaceInfos;\n#if defined(USE_LOCAL_REFLECTIONMAP_CUBIC) && defined(REFLECTIONMAP_CUBIC)\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\n#endif\n#endif\n\n#ifdef CLEARCOAT\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n#endif\n\n#ifdef ANISOTROPIC\nuniform vec3 vAnisotropy;\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\nuniform vec4 vSheenColor;\n#ifdef SHEEN_ROUGHNESS\nuniform float vSheenRoughness;\n#endif\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#ifdef REALTIME_FILTERING\nuniform vec2 vRefractionFilteringInfo;\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\n#endif\n#ifdef PREPASS\n#ifdef PREPASS_IRRADIANCE\nuniform float scatteringDiffusionProfile;\n#endif\n#endif`);\n        ze.a.IncludesShadersStore.pbrFragmentDeclaration = sp;\n        var cp = `layout(std140,column_major) uniform;\nuniform Material\n{\nuniform vec2 vAlbedoInfos;\nuniform vec4 vAmbientInfos;\nuniform vec2 vOpacityInfos;\nuniform vec2 vEmissiveInfos;\nuniform vec2 vLightmapInfos;\nuniform vec3 vReflectivityInfos;\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform vec2 vReflectionInfos;\nuniform vec2 vReflectionFilteringInfo;\nuniform vec3 vReflectionPosition;\nuniform vec3 vReflectionSize;\nuniform vec3 vBumpInfos;\nuniform mat4 albedoMatrix;\nuniform mat4 ambientMatrix;\nuniform mat4 opacityMatrix;\nuniform mat4 emissiveMatrix;\nuniform mat4 lightmapMatrix;\nuniform mat4 reflectivityMatrix;\nuniform mat4 microSurfaceSamplerMatrix;\nuniform mat4 bumpMatrix;\nuniform vec2 vTangentSpaceParams;\nuniform mat4 reflectionMatrix;\nuniform vec3 vReflectionColor;\nuniform vec4 vAlbedoColor;\nuniform vec4 vLightingIntensity;\nuniform vec3 vReflectionMicrosurfaceInfos;\nuniform float pointSize;\nuniform vec4 vReflectivityColor;\nuniform vec3 vEmissiveColor;\nuniform float visibility;\nuniform vec4 vMetallicReflectanceFactors;\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\nuniform vec2 vClearCoatParams;\nuniform vec4 vClearCoatRefractionParams;\nuniform vec4 vClearCoatInfos;\nuniform mat4 clearCoatMatrix;\nuniform mat4 clearCoatRoughnessMatrix;\nuniform vec2 vClearCoatBumpInfos;\nuniform vec2 vClearCoatTangentSpaceParams;\nuniform mat4 clearCoatBumpMatrix;\nuniform vec4 vClearCoatTintParams;\nuniform float clearCoatColorAtDistance;\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\nuniform vec3 vAnisotropy;\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\nuniform vec4 vSheenColor;\nuniform float vSheenRoughness;\nuniform vec4 vSheenInfos;\nuniform mat4 sheenMatrix;\nuniform mat4 sheenRoughnessMatrix;\nuniform vec3 vRefractionMicrosurfaceInfos;\nuniform vec2 vRefractionFilteringInfo;\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\nuniform vec2 vThicknessParam;\nuniform vec3 vDiffusionDistance;\nuniform vec4 vTintColor;\nuniform vec3 vSubSurfaceIntensity;\nuniform float scatteringDiffusionProfile;\nuniform vec4 vDetailInfos;\nuniform mat4 detailMatrix;\n};\nuniform Scene {\nmat4 viewProjection;\n#ifdef MULTIVIEW\nmat4 viewProjectionR;\n#endif\nmat4 view;\n};`;\n        ze.a.IncludesShadersStore.pbrUboDeclaration = cp;\n        var lp = `uniform vec4 vEyePosition;\nuniform vec3 vAmbientColor;\nuniform vec4 vCameraInfos;\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nuniform vec2 vDebugMode;\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif`;\n        ze.a.IncludesShadersStore.pbrFragmentExtraDeclaration = lp;\n        var up = `#ifdef ALBEDO\n#if ALBEDODIRECTUV == 1\n#define vAlbedoUV vMainUV1\n#elif ALBEDODIRECTUV == 2\n#define vAlbedoUV vMainUV2\n#else\nvarying vec2 vAlbedoUV;\n#endif\nuniform sampler2D albedoSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY\n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFLECTIVITY\n#if REFLECTIVITYDIRECTUV == 1\n#define vReflectivityUV vMainUV1\n#elif REFLECTIVITYDIRECTUV == 2\n#define vReflectivityUV vMainUV2\n#else\nvarying vec2 vReflectivityUV;\n#endif\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef MICROSURFACEMAP\n#if MICROSURFACEMAPDIRECTUV == 1\n#define vMicroSurfaceSamplerUV vMainUV1\n#elif MICROSURFACEMAPDIRECTUV == 2\n#define vMicroSurfaceSamplerUV vMainUV2\n#else\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\nuniform sampler2D microSurfaceSampler;\n#endif\n#ifdef METALLIC_REFLECTANCE\n#if METALLIC_REFLECTANCEDIRECTUV == 1\n#define vMetallicReflectanceUV vMainUV1\n#elif METALLIC_REFLECTANCEDIRECTUV == 2\n#define vMetallicReflectanceUV vMainUV2\n#else\nvarying vec2 vMetallicReflectanceUV;\n#endif\nuniform sampler2D metallicReflectanceSampler;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE)\n#if CLEARCOAT_TEXTUREDIRECTUV == 1\n#define vClearCoatUV vMainUV1\n#elif CLEARCOAT_TEXTUREDIRECTUV == 2\n#define vClearCoatUV vMainUV2\n#else\nvarying vec2 vClearCoatUV;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS)\n#if CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 1\n#define vClearCoatRoughnessUV vMainUV1\n#elif CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 2\n#define vClearCoatRoughnessUV vMainUV2\n#else\nvarying vec2 vClearCoatRoughnessUV;\n#endif\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform sampler2D clearCoatSampler;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL)\nuniform sampler2D clearCoatRoughnessSampler;\n#endif\n#ifdef CLEARCOAT_BUMP\n#if CLEARCOAT_BUMPDIRECTUV == 1\n#define vClearCoatBumpUV vMainUV1\n#elif CLEARCOAT_BUMPDIRECTUV == 2\n#define vClearCoatBumpUV vMainUV2\n#else\nvarying vec2 vClearCoatBumpUV;\n#endif\nuniform sampler2D clearCoatBumpSampler;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\n#if CLEARCOAT_TINT_TEXTUREDIRECTUV == 1\n#define vClearCoatTintUV vMainUV1\n#elif CLEARCOAT_TINT_TEXTUREDIRECTUV == 2\n#define vClearCoatTintUV vMainUV2\n#else\nvarying vec2 vClearCoatTintUV;\n#endif\nuniform sampler2D clearCoatTintSampler;\n#endif\n#endif\n#ifdef SHEEN\n#ifdef SHEEN_TEXTURE\n#if SHEEN_TEXTUREDIRECTUV == 1\n#define vSheenUV vMainUV1\n#elif SHEEN_TEXTUREDIRECTUV == 2\n#define vSheenUV vMainUV2\n#else\nvarying vec2 vSheenUV;\n#endif\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\n#if SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 1\n#define vSheenRoughnessUV vMainUV1\n#elif SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 2\n#define vSheenRoughnessUV vMainUV2\n#else\nvarying vec2 vSheenRoughnessUV;\n#endif\n#endif\n#ifdef SHEEN_TEXTURE\nuniform sampler2D sheenSampler;\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL)\nuniform sampler2D sheenRoughnessSampler;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\n#if ANISOTROPIC_TEXTUREDIRECTUV == 1\n#define vAnisotropyUV vMainUV1\n#elif ANISOTROPIC_TEXTUREDIRECTUV == 2\n#define vAnisotropyUV vMainUV2\n#else\nvarying vec2 vAnisotropyUV;\n#endif\nuniform sampler2D anisotropySampler;\n#endif\n#endif\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\n#define sampleReflection(s,c) textureCube(s,c)\nuniform samplerCube reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube reflectionSamplerLow;\nuniform samplerCube reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform samplerCube irradianceSampler;\n#endif\n#else\n#define sampleReflection(s,c) texture2D(s,c)\nuniform sampler2D reflectionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D reflectionSamplerLow;\nuniform sampler2D reflectionSamplerHigh;\n#endif\n#ifdef USEIRRADIANCEMAP\nuniform sampler2D irradianceSampler;\n#endif\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#endif\n#ifdef ENVIRONMENTBRDF\nuniform sampler2D environmentBrdfSampler;\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\n#ifdef SS_REFRACTIONMAP_3D\n#define sampleRefraction(s,c) textureCube(s,c)\nuniform samplerCube refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) textureCubeLodEXT(s,c,l)\n#else\nuniform samplerCube refractionSamplerLow;\nuniform samplerCube refractionSamplerHigh;\n#endif\n#else\n#define sampleRefraction(s,c) texture2D(s,c)\nuniform sampler2D refractionSampler;\n#ifdef LODBASEDMICROSFURACE\n#define sampleRefractionLod(s,c,l) texture2DLodEXT(s,c,l)\n#else\nuniform sampler2D refractionSamplerLow;\nuniform sampler2D refractionSamplerHigh;\n#endif\n#endif\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\n#if SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 1\n#define vThicknessUV vMainUV1\n#elif SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 2\n#define vThicknessUV vMainUV2\n#else\nvarying vec2 vThicknessUV;\n#endif\nuniform sampler2D thicknessSampler;\n#endif\n#endif`;\n        ze.a.IncludesShadersStore.pbrFragmentSamplersDeclaration = up, f(116), ze.a.IncludesShadersStore.subSurfaceScatteringFunctions = `bool testLightingForSSS(float diffusionProfile)\n{\nreturn diffusionProfile<1.;\n}`;\n        var hp = `\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereCosSample(vec2 u) {\n\nfloat phi=2.*PI*u.x;\nfloat cosTheta2=1.-u.y;\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDggx(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\n\nfloat cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));\nfloat cosTheta=sqrt(cosTheta2);\nfloat sinTheta=sqrt(1.-cosTheta2);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) {\n\nfloat phi=2.*PI*u.x;\nfloat sinTheta=pow(u.y,a/(2.*a+1.));\nfloat cosTheta=sqrt(1.-sinTheta*sinTheta);\nreturn vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);\n}`;\n        ze.a.IncludesShadersStore.importanceSampling = hp;\n        var dp = `\n#define RECIPROCAL_PI2 0.15915494\n#define RECIPROCAL_PI 0.31830988618\n\n#define MINIMUMVARIANCE 0.0005\nfloat convertRoughnessToAverageSlope(float roughness)\n{\n\nreturn square(roughness)+MINIMUMVARIANCE;\n}\nfloat fresnelGrazingReflectance(float reflectance0) {\n\n\nfloat reflectance90=saturate(reflectance0*25.0);\nreturn reflectance90;\n}\nvec2 getAARoughnessFactors(vec3 normalVector) {\n#ifdef SPECULARAA\nvec3 nDfdx=dFdx(normalVector.xyz);\nvec3 nDfdy=dFdy(normalVector.xyz);\nfloat slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));\n\nfloat geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);\n\nfloat geometricAlphaGFactor=sqrt(slopeSquare);\n\ngeometricAlphaGFactor*=0.75;\nreturn vec2(geometricRoughnessFactor,geometricAlphaGFactor);\n#else\nreturn vec2(0.);\n#endif\n}\n#ifdef ANISOTROPIC\n\n\nvec2 getAnisotropicRoughness(float alphaG,float anisotropy) {\nfloat alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);\nfloat alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);\nreturn vec2(alphaT,alphaB);\n}\n\n\nvec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy) {\nvec3 anisotropicFrameDirection=anisotropy>=0.0 ? B : T;\nvec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);\nvec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);\nvec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));\nreturn anisotropicNormal;\n\n}\n#endif\n#if defined(CLEARCOAT) || defined(SS_REFRACTION)\n\n\n\nvec3 cocaLambert(vec3 alpha,float distance) {\nreturn exp(-alpha*distance);\n}\n\nvec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {\nreturn cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));\n}\n\nvec3 computeColorAtDistanceInMedia(vec3 color,float distance) {\nreturn -log(color)/distance;\n}\nvec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 clearCoatAbsorption=mix(vec3(1.0),\ncocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),\nclearCoatIntensity);\nreturn clearCoatAbsorption;\n}\n#endif\n\n\n\n\n#ifdef MICROSURFACEAUTOMATIC\nfloat computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)\n{\nconst float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;\nfloat reflectivityLuminance=getLuminance(reflectivityColor);\nfloat reflectivityLuma=sqrt(reflectivityLuminance);\nmicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;\nreturn microSurface;\n}\n#endif`;\n        ze.a.IncludesShadersStore.pbrHelperFunctions = dp;\n        var fp = `#ifdef USESPHERICALFROMREFLECTIONMAP\n#ifdef SPHERICAL_HARMONICS\nuniform vec3 vSphericalL00;\nuniform vec3 vSphericalL1_1;\nuniform vec3 vSphericalL10;\nuniform vec3 vSphericalL11;\nuniform vec3 vSphericalL2_2;\nuniform vec3 vSphericalL2_1;\nuniform vec3 vSphericalL20;\nuniform vec3 vSphericalL21;\nuniform vec3 vSphericalL22;\n\n\n\n\n\n\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\nreturn vSphericalL00\n+vSphericalL1_1*(normal.y)\n+vSphericalL10*(normal.z)\n+vSphericalL11*(normal.x)\n+vSphericalL2_2*(normal.y*normal.x)\n+vSphericalL2_1*(normal.y*normal.z)\n+vSphericalL20*((3.0*normal.z*normal.z)-1.0)\n+vSphericalL21*(normal.z*normal.x)\n+vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));\n}\n#else\nuniform vec3 vSphericalX;\nuniform vec3 vSphericalY;\nuniform vec3 vSphericalZ;\nuniform vec3 vSphericalXX_ZZ;\nuniform vec3 vSphericalYY_ZZ;\nuniform vec3 vSphericalZZ;\nuniform vec3 vSphericalXY;\nuniform vec3 vSphericalYZ;\nuniform vec3 vSphericalZX;\n\nvec3 computeEnvironmentIrradiance(vec3 normal) {\n\n\n\n\n\n\n\n\n\nfloat Nx=normal.x;\nfloat Ny=normal.y;\nfloat Nz=normal.z;\nvec3 C1=vSphericalZZ.rgb;\nvec3 Cx=vSphericalX.rgb;\nvec3 Cy=vSphericalY.rgb;\nvec3 Cz=vSphericalZ.rgb;\nvec3 Cxx_zz=vSphericalXX_ZZ.rgb;\nvec3 Cyy_zz=vSphericalYY_ZZ.rgb;\nvec3 Cxy=vSphericalXY.rgb;\nvec3 Cyz=vSphericalYZ.rgb;\nvec3 Czx=vSphericalZX.rgb;\nvec3 a1=Cyy_zz*Ny+Cy;\nvec3 a2=Cyz*Nz+a1;\nvec3 b1=Czx*Nz+Cx;\nvec3 b2=Cxy*Ny+b1;\nvec3 b3=Cxx_zz*Nx+b2;\nvec3 t1=Cz*Nz+C1;\nvec3 t2=a2*Ny+t1;\nvec3 t3=b3*Nx+t2;\nreturn t3;\n}\n#endif\n#endif`;\n        ze.a.IncludesShadersStore.harmonicsFunctions = fp;\n        var pp = `\nstruct preLightingInfo\n{\n\nvec3 lightOffset;\nfloat lightDistanceSquared;\nfloat lightDistance;\n\nfloat attenuation;\n\nvec3 L;\nvec3 H;\nfloat NdotV;\nfloat NdotLUnclamped;\nfloat NdotL;\nfloat VdotH;\nfloat roughness;\n};\npreLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightOffset=lightData.xyz-vPositionW;\nresult.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);\n\nresult.lightDistance=sqrt(result.lightDistanceSquared);\n\nresult.L=normalize(result.lightOffset);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\nresult.lightDistance=length(-lightData.xyz);\n\nresult.L=normalize(-lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\nresult.NdotLUnclamped=dot(N,result.L);\nresult.NdotL=saturateEps(result.NdotLUnclamped);\nreturn result;\n}\npreLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {\npreLightingInfo result;\n\n\nresult.NdotL=dot(N,lightData.xyz)*0.5+0.5;\nresult.NdotL=saturateEps(result.NdotL);\nresult.NdotLUnclamped=result.NdotL;\n#ifdef SPECULARTERM\nresult.L=normalize(lightData.xyz);\nresult.H=normalize(V+result.L);\nresult.VdotH=saturate(dot(V,result.H));\n#endif\nreturn result;\n}`;\n        ze.a.IncludesShadersStore.pbrDirectLightingSetupFunctions = pp;\n        var _p = `float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)\n{\nreturn max(0.,1.0-length(lightOffset)/range);\n}\nfloat computeDistanceLightFalloff_Physical(float lightDistanceSquared)\n{\nreturn 1.0/maxEps(lightDistanceSquared);\n}\nfloat computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)\n{\nfloat lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);\nfloat factor=lightDistanceSquared*inverseSquaredRange;\nfloat attenuation=saturate(1.0-factor*factor);\nattenuation*=attenuation;\n\nlightDistanceFalloff*=attenuation;\nreturn lightDistanceFalloff;\n}\nfloat computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDistanceLightFalloff_Physical(lightDistanceSquared);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);\n#else\nreturn computeDistanceLightFalloff_Standard(lightOffset,range);\n#endif\n}\nfloat computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)\n{\nfloat falloff=0.0;\nfloat cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));\nif (cosAngle>=cosHalfAngle)\n{\nfalloff=max(0.,pow(cosAngle,exponent));\n}\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)\n{\nconst float kMinusLog2ConeAngleIntensityRatio=6.64385618977;\n\n\n\n\n\nfloat concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);\n\n\nvec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);\nfloat falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)\n{\n\n\n\nfloat cd=dot(-lightDirection,directionToLightCenterW);\nfloat falloff=saturate(cd*lightAngleScale+lightAngleOffset);\n\nfalloff*=falloff;\nreturn falloff;\n}\nfloat computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)\n{\n#ifdef USEPHYSICALLIGHTFALLOFF\nreturn computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);\n#elif defined(USEGLTFLIGHTFALLOFF)\nreturn computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);\n#else\nreturn computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);\n#endif\n}`;\n        ze.a.IncludesShadersStore.pbrDirectLightingFalloffFunctions = _p;\n        var mp = `\n#define FRESNEL_MAXIMUM_ON_ROUGH 0.25\n\n\n\n\n#ifdef MS_BRDF_ENERGY_CONSERVATION\n\n\nvec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\nreturn 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);\n}\n#endif\n#ifdef ENVIRONMENTBRDF\nvec3 getBRDFLookup(float NdotV,float perceptualRoughness) {\n\nvec2 UV=vec2(NdotV,perceptualRoughness);\n\nvec4 brdfLookup=texture2D(environmentBrdfSampler,UV);\n#ifdef ENVIRONMENTBRDF_RGBD\nbrdfLookup.rgb=fromRGBD(brdfLookup.rgba);\n#endif\nreturn brdfLookup.rgb;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;\n\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;\n#endif\nreturn reflectance;\n}\nvec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {\n#ifdef BRDF_V_HEIGHT_CORRELATED\nvec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);\n#else\nvec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;\n#endif\nreturn reflectance;\n}\n#endif\n\n#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)\nvec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)\n{\n\nfloat weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);\nreturn reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));\n}\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\n\nvec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {\nvec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;\nreturn sheenEnvironmentReflectance;\n}\n#endif\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\nfloat fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)\n{\nreturn reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);\n}\n#ifdef CLEARCOAT\n\n\n\n\n\nvec3 getR0RemappedForClearCoat(vec3 f0) {\n#ifdef CLEARCOAT_DEFAULTIOR\n#ifdef MOBILE\nreturn saturate(f0*(f0*0.526868+0.529324)-0.0482256);\n#else\nreturn saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);\n#endif\n#else\nvec3 s=sqrt(f0);\nvec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);\nreturn t*t;\n#endif\n}\n#endif\n\n\n\n\n\n\nfloat normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)\n{\n\n\n\nfloat a2=square(alphaG);\nfloat d=NdotH*NdotH*(a2-1.0)+1.0;\nreturn a2/(PI*d*d);\n}\n#ifdef SHEEN\n\n\nfloat normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)\n{\nfloat invR=1./alphaG;\nfloat cos2h=NdotH*NdotH;\nfloat sin2h=1.-cos2h;\nreturn (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {\nfloat a2=alphaTB.x*alphaTB.y;\nvec3 v=vec3(alphaTB.y*TdotH,alphaTB.x*BdotH,a2*NdotH);\nfloat v2=dot(v,v);\nfloat w2=a2/v2;\nreturn a2*w2*w2*RECIPROCAL_PI;\n}\n#endif\n\n\n\n\n#ifdef BRDF_V_HEIGHT_CORRELATED\n\n\n\nfloat smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {\n#ifdef MOBILE\n\nfloat GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);\nfloat GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);\nreturn 0.5/(GGXV+GGXL);\n#else\nfloat a2=alphaG*alphaG;\nfloat GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);\nfloat GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);\nreturn 0.5/(GGXV+GGXL);\n#endif\n}\n#else\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfloat smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)\n{\n#ifdef MOBILE\n\nreturn 1.0/(dot+alphaG+(1.0-alphaG)*dot ));\n#else\nfloat alphaSquared=alphaG*alphaG;\nreturn 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));\n#endif\n}\nfloat smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)\n{\nfloat visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);\n\nreturn visibility;\n}\n#endif\n#ifdef ANISOTROPIC\n\n\nfloat smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {\nfloat lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));\nfloat lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));\nfloat v=0.5/(lambdaV+lambdaL);\nreturn v;\n}\n#endif\n#ifdef CLEARCOAT\nfloat visibility_Kelemen(float VdotH) {\n\n\n\nreturn 0.25/(VdotH*VdotH);\n}\n#endif\n#ifdef SHEEN\n\n\n\nfloat visibility_Ashikhmin(float NdotL,float NdotV)\n{\nreturn 1./(4.*(NdotL+NdotV-NdotL*NdotV));\n}\n\n#endif\n\n\n\n\n\n\n\nfloat diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {\n\n\nfloat diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));\nfloat diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));\nfloat diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;\nfloat fresnel =\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *\n(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);\nreturn fresnel/PI;\n}\n#ifdef SS_TRANSLUCENCY\n\n\nvec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {\nvec3 S=1./maxEps(diffusionDistance);\nvec3 temp=exp((-0.333333333*thickness)*S);\nreturn tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);\n}\n\n\nfloat computeWrappedDiffuseNdotL(float NdotL,float w) {\nfloat t=1.0+w;\nfloat invt2=1.0/square(t);\nreturn saturate((NdotL+w)*invt2);\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBRDFFunctions = mp;\n        var gp = `#ifdef NUM_SAMPLES\n#if NUM_SAMPLES>0\n#ifdef WEBGL2\n\n\nfloat radicalInverse_VdC(uint bits)\n{\nbits=(bits << 16u) | (bits >> 16u);\nbits=((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\nbits=((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\nbits=((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\nbits=((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\nreturn float(bits)*2.3283064365386963e-10;\n}\nvec2 hammersley(uint i,uint N)\n{\nreturn vec2(float(i)/float(N),radicalInverse_VdC(i));\n}\n#else\nfloat vanDerCorpus(int n,int base)\n{\nfloat invBase=1.0/float(base);\nfloat denom=1.0;\nfloat result=0.0;\nfor(int i=0; i<32; ++i)\n{\nif(n>0)\n{\ndenom=mod(float(n),2.0);\nresult+=denom*invBase;\ninvBase=invBase/2.0;\nn=int(float(n)/2.0);\n}\n}\nreturn result;\n}\nvec2 hammersley(int i,int N)\n{\nreturn vec2(float(i)/float(N),vanDerCorpus(i,2));\n}\n#endif\nfloat log4(float x) {\nreturn log2(x)/2.;\n}\nconst float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);\nconst float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;\nconst float K=4.;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#define inline\nvec3 irradiance(samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nvec3 result=vec3(0.0);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 Ls=hemisphereCosSample(Xi);\nLs=normalize(Ls);\nvec3 Ns=vec3(0.,0.,1.);\nfloat NoL=dot(Ns,Ls);\nif (NoL>0.) {\nfloat pdf_inversed=PI/NoL;\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(l,0.0,maxLevel);\nvec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c;\n}\n}\nresult=result*NUM_SAMPLES_FLOAT_INVERSED;\nreturn result;\n}\n#define inline\nvec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)\n{\nvec3 n=normalize(inputN);\nif (alphaG == 0.) {\nvec3 c=textureCube(inputTexture,n).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nreturn c;\n}\nvec3 result=vec3(0.);\nvec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);\ntangent=normalize(cross(tangent,n));\nvec3 bitangent=cross(n,tangent);\nmat3 tbn=mat3(tangent,bitangent,n);\nfloat maxLevel=filteringInfo.y;\nfloat dim0=filteringInfo.x;\nfloat omegaP=(4.*PI)/(6.*dim0*dim0);\nfloat weight=0.;\n#ifdef WEBGL2\nfor(uint i=0u; i<NUM_SAMPLES; ++i)\n#else\nfor(int i=0; i<NUM_SAMPLES; ++i)\n#endif\n{\nvec2 Xi=hammersley(i,NUM_SAMPLES);\nvec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);\nfloat NoV=1.;\nfloat NoH=H.z;\nfloat NoH2=H.z*H.z;\nfloat NoL=2.*NoH2-1.;\nvec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);\nL=normalize(L);\nif (NoL>0.) {\nfloat pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);\nfloat omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;\nfloat l=log4(omegaS)-log4(omegaP)+log4(K);\nfloat mipLevel=clamp(float(l),0.0,maxLevel);\nweight+=NoL;\nvec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;\n#ifdef GAMMA_INPUT\nc=toLinearSpace(c);\n#endif\nresult+=c*NoL;\n}\n}\nresult=result/weight;\nreturn result;\n}\n#endif\n#endif`;\n        ze.a.IncludesShadersStore.hdrFilteringFunctions = gp;\n        var vp = `#define CLEARCOATREFLECTANCE90 1.0\n\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef CLEARCOAT\n\n\nvec4 clearCoat;\n#endif\n#ifdef SHEEN\nvec3 sheen;\n#endif\n};\n\nfloat adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {\n#if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)\n\nfloat lightRoughness=lightRadius/lightDistance;\n\nfloat totalRoughness=saturate(lightRoughness+roughness);\nreturn totalRoughness;\n#else\nreturn roughness;\n#endif\n}\nvec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {\nreturn mix(groundColor,lightColor,info.NdotL);\n}\nvec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {\nfloat diffuseTerm=diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*info.attenuation*info.NdotL*lightColor;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn toLinearSpace(textureColor);\n}\n#ifdef SS_TRANSLUCENCY\nvec3 computeDiffuseAndTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {\nfloat NdotL=absEps(info.NdotLUnclamped);\n\nfloat wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);\n\nfloat trAdapt=step(0.,info.NdotLUnclamped);\nvec3 transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);\nfloat diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);\nreturn diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;\n}\n#endif\n#ifdef SPECULARTERM\nvec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);\n#ifdef BRDF_V_HEIGHT_CORRELATED\nfloat smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);\n#else\nfloat smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);\n#endif\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef ANISOTROPIC\nvec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat TdotH=dot(T,info.H);\nfloat BdotH=dot(B,info.H);\nfloat TdotV=dot(T,V);\nfloat BdotV=dot(B,V);\nfloat TdotL=dot(T,info.L);\nfloat BdotL=dot(B,info.L);\nfloat alphaG=convertRoughnessToAverageSlope(info.roughness);\nvec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);\nalphaTB=max(alphaTB,square(geometricRoughnessFactor));\nvec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);\nfloat distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);\nfloat smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);\nvec3 specTerm=fresnel*distribution*smithVisibility;\nreturn specTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n#ifdef CLEARCOAT\nvec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {\nfloat NccdotL=saturateEps(dot(Ncc,info.L));\nfloat NccdotH=saturateEps(dot(Ncc,info.H));\nfloat clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\nfloat fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnel*=clearCoatIntensity;\nfloat distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);\nfloat kelemenVisibility=visibility_Kelemen(info.VdotH);\nfloat clearCoatTerm=fresnel*distribution*kelemenVisibility;\nreturn vec4(\nclearCoatTerm*info.attenuation*NccdotL*lightColor,\n1.0-fresnel\n);\n}\nvec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {\nvec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);\nfloat NdotLRefract=saturateEps(dot(Ncc,LRefract));\nvec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);\nreturn absorption;\n}\n#endif\n#ifdef SHEEN\nvec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {\nfloat NdotH=saturateEps(dot(N,info.H));\nfloat roughness=max(info.roughness,geometricRoughnessFactor);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\n\n\nfloat fresnel=1.;\nfloat distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);\n\nfloat visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);\n\nfloat sheenTerm=fresnel*distribution*visibility;\nreturn sheenTerm*info.attenuation*info.NdotL*lightColor;\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrDirectLightingFunctions = vp;\n        var yp = `#if defined(REFLECTION) || defined(SS_REFRACTION)\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {\nfloat microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;\nfloat lod=log2(microsurfaceAverageSlopeTexels);\nreturn lod;\n}\nfloat getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {\nfloat lod=log2(cubeMapDimensionPixels)*roughness;\nreturn lod;\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)\nfloat environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {\n\n\nfloat temp=NdotVUnclamped+ambientOcclusion;\nreturn saturate(square(temp)-1.0+ambientOcclusion);\n}\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)\nfloat environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {\n\nvec3 reflection=reflect(view,normal);\nfloat temp=saturate(1.0+1.1*dot(reflection,geometricNormal));\nreturn square(temp);\n}\n#endif\n\n\n\n\n#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)\n\n\n#define UNPACK_LOD(x) (1.0-x)*255.0\nfloat getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {\nfloat microsurfaceAverageSlope=alphaG;\n\n\n\n\n\n\nmicrosurfaceAverageSlope*=sqrt(abs(NdotV));\nreturn getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);\n}\n#endif`;\n        ze.a.IncludesShadersStore.pbrIBLFunctions = yp, f(132), f(133);\n        var bp = `struct albedoOpacityOutParams\n{\nvec3 surfaceAlbedo;\nfloat alpha;\n};\n#define pbr_inline\nvoid albedoOpacityBlock(\nconst in vec4 vAlbedoColor,\n#ifdef ALBEDO\nconst in vec4 albedoTexture,\nconst in vec2 albedoInfos,\n#endif\n#ifdef OPACITY\nconst in vec4 opacityMap,\nconst in vec2 vOpacityInfos,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout albedoOpacityOutParams outParams\n)\n{\n\nvec3 surfaceAlbedo=vAlbedoColor.rgb;\nfloat alpha=vAlbedoColor.a;\n#ifdef ALBEDO\n#if defined(ALPHAFROMALBEDO) || defined(ALPHATEST)\nalpha*=albedoTexture.a;\n#endif\n#ifdef GAMMAALBEDO\nsurfaceAlbedo*=toLinearSpace(albedoTexture.rgb);\n#else\nsurfaceAlbedo*=albedoTexture.rgb;\n#endif\nsurfaceAlbedo*=albedoInfos.y;\n#endif\n#ifdef VERTEXCOLOR\nsurfaceAlbedo*=vColor.rgb;\n#endif\n#ifdef DETAIL\nfloat detailAlbedo=2.0*mix(0.5,detailColor.r,vDetailInfos.y);\nsurfaceAlbedo.rgb=surfaceAlbedo.rgb*detailAlbedo*detailAlbedo;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALBEDO\n\n#ifdef OPACITY\n#ifdef OPACITYRGB\nalpha=getLuminance(opacityMap.rgb);\n#else\nalpha*=opacityMap.a;\n#endif\nalpha*=vOpacityInfos.y;\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#if !defined(SS_LINKREFRACTIONTOTRANSPARENCY) && !defined(ALPHAFRESNEL)\n#ifdef ALPHATEST\nif (alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\nalpha=1.0;\n#endif\n#endif\n#endif\noutParams.surfaceAlbedo=surfaceAlbedo;\noutParams.alpha=alpha;\n}\n`;\n        ze.a.IncludesShadersStore.pbrBlockAlbedoOpacity = bp;\n        var Tp = `struct reflectivityOutParams\n{\nfloat microSurface;\nfloat roughness;\nvec3 surfaceReflectivityColor;\n#ifdef METALLICWORKFLOW\nvec3 surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nvec3 ambientOcclusionColor;\n#endif\n#if DEBUGMODE>0\nvec4 surfaceMetallicColorMap;\nvec4 surfaceReflectivityColorMap;\nvec2 metallicRoughness;\nvec3 metallicF0;\n#endif\n};\n#define pbr_inline\nvoid reflectivityBlock(\nconst in vec4 vReflectivityColor,\n#ifdef METALLICWORKFLOW\nconst in vec3 surfaceAlbedo,\nconst in vec4 metallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nconst in vec3 reflectivityInfos,\nconst in vec4 surfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\nconst in vec3 ambientOcclusionColorIn,\n#endif\n#ifdef MICROSURFACEMAP\nconst in vec4 microSurfaceTexel,\n#endif\n#ifdef DETAIL\nconst in vec4 detailColor,\nconst in vec4 vDetailInfos,\n#endif\nout reflectivityOutParams outParams\n)\n{\nfloat microSurface=vReflectivityColor.a;\nvec3 surfaceReflectivityColor=vReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec2 metallicRoughness=surfaceReflectivityColor.rg;\n#ifdef REFLECTIVITY\n#if DEBUGMODE>0\noutParams.surfaceMetallicColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef AOSTOREINMETALMAPRED\nvec3 aoStoreInMetalMap=vec3(surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r,surfaceMetallicOrReflectivityColorMap.r);\noutParams.ambientOcclusionColor=mix(ambientOcclusionColorIn,aoStoreInMetalMap,reflectivityInfos.z);\n#endif\n#ifdef METALLNESSSTOREINMETALMAPBLUE\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.b;\n#else\nmetallicRoughness.r*=surfaceMetallicOrReflectivityColorMap.r;\n#endif\n#ifdef ROUGHNESSSTOREINMETALMAPALPHA\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.a;\n#else\n#ifdef ROUGHNESSSTOREINMETALMAPGREEN\nmetallicRoughness.g*=surfaceMetallicOrReflectivityColorMap.g;\n#endif\n#endif\n#endif\n#ifdef DETAIL\nfloat detailRoughness=mix(0.5,detailColor.b,vDetailInfos.w);\nfloat loLerp=mix(0.,metallicRoughness.g,detailRoughness*2.);\nfloat hiLerp=mix(metallicRoughness.g,1.,(detailRoughness-0.5)*2.);\nmetallicRoughness.g=mix(loLerp,hiLerp,step(detailRoughness,0.5));\n#endif\n#ifdef MICROSURFACEMAP\nmetallicRoughness.g*=microSurfaceTexel.r;\n#endif\n#if DEBUGMODE>0\noutParams.metallicRoughness=metallicRoughness;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_METALLICROUGHNESS\n\nmicroSurface=1.0-metallicRoughness.g;\n\nvec3 baseColor=surfaceAlbedo;\n#ifdef FROSTBITE_REFLECTANCE\n\n\n\n\n\n\noutParams.surfaceAlbedo=baseColor.rgb*(1.0-metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(0.16*reflectance*reflectance,baseColor,metallicRoughness.r);\n#else\nvec3 metallicF0=metallicReflectanceFactors.rgb;\n#if DEBUGMODE>0\noutParams.metallicF0=metallicF0;\n#endif\n\noutParams.surfaceAlbedo=mix(baseColor.rgb*(1.0-metallicF0),vec3(0.,0.,0.),metallicRoughness.r);\n\nsurfaceReflectivityColor=mix(metallicF0,baseColor,metallicRoughness.r);\n#endif\n#else\n#ifdef REFLECTIVITY\nsurfaceReflectivityColor*=surfaceMetallicOrReflectivityColorMap.rgb;\n#if DEBUGMODE>0\noutParams.surfaceReflectivityColorMap=surfaceMetallicOrReflectivityColorMap;\n#endif\n#ifdef MICROSURFACEFROMREFLECTIVITYMAP\nmicroSurface*=surfaceMetallicOrReflectivityColorMap.a;\nmicroSurface*=reflectivityInfos.z;\n#else\n#ifdef MICROSURFACEAUTOMATIC\nmicroSurface*=computeDefaultMicroSurface(microSurface,surfaceReflectivityColor);\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurface*=microSurfaceTexel.r;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_MICROSURFACE\n#endif\n#endif\n#endif\n\nmicroSurface=saturate(microSurface);\n\nfloat roughness=1.-microSurface;\noutParams.microSurface=microSurface;\noutParams.roughness=roughness;\noutParams.surfaceReflectivityColor=surfaceReflectivityColor;\n}\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflectivity = Tp;\n        var Ep = `struct ambientOcclusionOutParams\n{\nvec3 ambientOcclusionColor;\n#if DEBUGMODE>0\nvec3 ambientOcclusionColorMap;\n#endif\n};\n#define pbr_inline\nvoid ambientOcclusionBlock(\n#ifdef AMBIENT\nconst in vec3 ambientOcclusionColorMap_,\nconst in vec4 vAmbientInfos,\n#endif\nout ambientOcclusionOutParams outParams\n)\n{\nvec3 ambientOcclusionColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=ambientOcclusionColorMap_*vAmbientInfos.y;\n#ifdef AMBIENTINGRAYSCALE\nambientOcclusionColorMap=vec3(ambientOcclusionColorMap.r,ambientOcclusionColorMap.r,ambientOcclusionColorMap.r);\n#endif\nambientOcclusionColor=mix(ambientOcclusionColor,ambientOcclusionColorMap,vAmbientInfos.z);\n#if DEBUGMODE>0\noutParams.ambientOcclusionColorMap=ambientOcclusionColorMap;\n#endif\n#endif\noutParams.ambientOcclusionColor=ambientOcclusionColor;\n}\n`;\n        ze.a.IncludesShadersStore.pbrBlockAmbientOcclusion = Ep;\n        var Sp = `#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nstruct alphaFresnelOutParams\n{\nfloat alpha;\n};\n#define pbr_inline\nvoid alphaFresnelBlock(\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nconst in float alpha,\nconst in float microSurface,\nout alphaFresnelOutParams outParams\n)\n{\n\n\n\nfloat opacityPerceptual=alpha;\n#ifdef LINEARALPHAFRESNEL\nfloat opacity0=opacityPerceptual;\n#else\nfloat opacity0=opacityPerceptual*opacityPerceptual;\n#endif\nfloat opacity90=fresnelGrazingReflectance(opacity0);\nvec3 normalForward=faceforward(normalW,-viewDirectionW,normalW);\n\noutParams.alpha=getReflectanceFromAnalyticalBRDFLookup_Jones(saturate(dot(viewDirectionW,normalForward)),vec3(opacity0),vec3(opacity90),sqrt(microSurface)).x;\n#ifdef ALPHATEST\nif (outParams.alpha<ALPHATESTVALUE)\ndiscard;\n#ifndef ALPHABLEND\n\noutParams.alpha=1.0;\n#endif\n#endif\n}\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockAlphaFresnel = Sp;\n        var Ap = `#ifdef ANISOTROPIC\nstruct anisotropicOutParams\n{\nfloat anisotropy;\nvec3 anisotropicTangent;\nvec3 anisotropicBitangent;\nvec3 anisotropicNormal;\n#if DEBUGMODE>0\nvec3 anisotropyMapData;\n#endif\n};\n#define pbr_inline\nvoid anisotropicBlock(\nconst in vec3 vAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nconst in vec3 anisotropyMapData,\n#endif\nconst in mat3 TBN,\nconst in vec3 normalW,\nconst in vec3 viewDirectionW,\nout anisotropicOutParams outParams\n)\n{\nfloat anisotropy=vAnisotropy.b;\nvec3 anisotropyDirection=vec3(vAnisotropy.xy,0.);\n#ifdef ANISOTROPIC_TEXTURE\nanisotropy*=anisotropyMapData.b;\nanisotropyDirection.rg*=anisotropyMapData.rg*2.0-1.0;\n#if DEBUGMODE>0\noutParams.anisotropyMapData=anisotropyMapData;\n#endif\n#endif\nmat3 anisoTBN=mat3(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));\nvec3 anisotropicTangent=normalize(anisoTBN*anisotropyDirection);\nvec3 anisotropicBitangent=normalize(cross(anisoTBN[2],anisotropicTangent));\noutParams.anisotropy=anisotropy;\noutParams.anisotropicTangent=anisotropicTangent;\noutParams.anisotropicBitangent=anisotropicBitangent;\noutParams.anisotropicNormal=getAnisotropicBentNormals(anisotropicTangent,anisotropicBitangent,normalW,viewDirectionW,anisotropy);\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockAnisotropic = Ap;\n        var Pp = `#ifdef REFLECTION\nstruct reflectionOutParams\n{\nvec4 environmentRadiance;\nvec3 environmentIrradiance;\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords;\n#else\nvec2 reflectionCoords;\n#endif\n#ifdef SS_TRANSLUCENCY\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nvec3 irradianceVector;\n#endif\n#endif\n#endif\n};\n#define pbr_inline\nvoid createReflectionCoords(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REFLECTIONMAP_3D\nout vec3 reflectionCoords\n#else\nout vec2 reflectionCoords\n#endif\n)\n{\n#ifdef ANISOTROPIC\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),anisotropicOut.anisotropicNormal);\n#else\nvec3 reflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nreflectionCoords=reflectionVector;\n#else\nreflectionCoords=reflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nreflectionCoords/=reflectionVector.z;\n#endif\nreflectionCoords.y=1.0-reflectionCoords.y;\n#endif\n}\n#define pbr_inline\n#define inline\nvoid sampleReflectionTexture(\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst vec2 reflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\nout vec4 environmentRadiance\n)\n{\n\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(LINEARSPECULARREFLECTION)\nfloat reflectionLOD=getLinearLodFromRoughness(vReflectionMicrosurfaceInfos.x,roughness);\n#else\nfloat reflectionLOD=getLodFromAlphaG(vReflectionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nreflectionLOD=reflectionLOD*vReflectionMicrosurfaceInfos.y+vReflectionMicrosurfaceInfos.z;\n#ifdef LODINREFLECTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticReflectionLOD=UNPACK_LOD(sampleReflection(reflectionSampler,reflectionCoords).a);\nfloat requestedReflectionLOD=max(automaticReflectionLOD,reflectionLOD);\n#else\nfloat requestedReflectionLOD=reflectionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRadiance=vec4(radiance(alphaG,reflectionSampler,reflectionCoords,vReflectionFilteringInfo),1.0);\n#else\nenvironmentRadiance=sampleReflectionLod(reflectionSampler,reflectionCoords,reflectionLOD);\n#endif\n#else\nfloat lodReflectionNormalized=saturate(reflectionLOD/log2(vReflectionMicrosurfaceInfos.x));\nfloat lodReflectionNormalizedDoubled=lodReflectionNormalized*2.0;\nvec4 environmentMid=sampleReflection(reflectionSampler,reflectionCoords);\nif (lodReflectionNormalizedDoubled<1.0){\nenvironmentRadiance=mix(\nsampleReflection(reflectionSamplerHigh,reflectionCoords),\nenvironmentMid,\nlodReflectionNormalizedDoubled\n);\n} else {\nenvironmentRadiance=mix(\nenvironmentMid,\nsampleReflection(reflectionSamplerLow,reflectionCoords),\nlodReflectionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef RGBDREFLECTION\nenvironmentRadiance.rgb=fromRGBD(environmentRadiance);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentRadiance.rgb=toLinearSpace(environmentRadiance.rgb);\n#endif\n\nenvironmentRadiance.rgb*=vReflectionInfos.x;\nenvironmentRadiance.rgb*=vReflectionColor.rgb;\n}\n#define pbr_inline\n#define inline\nvoid reflectionBlock(\nconst in vec3 vPositionW,\nconst in vec3 normalW,\nconst in float alphaG,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nconst in float NdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nconst in float roughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nconst in vec3 vEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in mat4 reflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\nout reflectionOutParams outParams\n)\n{\n\nvec4 environmentRadiance=vec4(0.,0.,0.,0.);\n#ifdef REFLECTIONMAP_3D\nvec3 reflectionCoords=vec3(0.);\n#else\nvec2 reflectionCoords=vec2(0.);\n#endif\ncreateReflectionCoords(\nvPositionW,\nnormalW,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\nreflectionCoords\n);\nsampleReflectionTexture(\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\n#ifdef REFLECTIONMAP_3D\nreflectionSampler,\nreflectionCoords,\n#else\nreflectionSampler,\nreflectionCoords,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentRadiance\n);\n\nvec3 environmentIrradiance=vec3(0.,0.,0.);\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nenvironmentIrradiance=vEnvironmentIrradiance;\n#else\n#ifdef ANISOTROPIC\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(anisotropicOut.anisotropicNormal,0)).xyz;\n#else\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#endif\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#if defined(REALTIME_FILTERING)\nenvironmentIrradiance=irradiance(reflectionSampler,irradianceVector,vReflectionFilteringInfo);\n#else\nenvironmentIrradiance=computeEnvironmentIrradiance(irradianceVector);\n#endif\n#ifdef SS_TRANSLUCENCY\noutParams.irradianceVector=irradianceVector;\n#endif\n#endif\n#elif defined(USEIRRADIANCEMAP)\nvec4 environmentIrradiance4=sampleReflection(irradianceSampler,reflectionCoords);\nenvironmentIrradiance=environmentIrradiance4.rgb;\n#ifdef RGBDREFLECTION\nenvironmentIrradiance.rgb=fromRGBD(environmentIrradiance4);\n#endif\n#ifdef GAMMAREFLECTION\nenvironmentIrradiance.rgb=toLinearSpace(environmentIrradiance.rgb);\n#endif\n#endif\nenvironmentIrradiance*=vReflectionColor.rgb;\noutParams.environmentRadiance=environmentRadiance;\noutParams.environmentIrradiance=environmentIrradiance;\noutParams.reflectionCoords=reflectionCoords;\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflection = Pp;\n        var xp = `#ifdef SHEEN\nstruct sheenOutParams\n{\nfloat sheenIntensity;\nvec3 sheenColor;\nfloat sheenRoughness;\n#ifdef SHEEN_LINKWITHALBEDO\nvec3 surfaceAlbedo;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfloat sheenAlbedoScaling;\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nvec3 finalSheenRadianceScaled;\n#endif\n#if DEBUGMODE>0\nvec4 sheenMapData;\nvec3 sheenEnvironmentReflectance;\n#endif\n};\n#define pbr_inline\n#define inline\nvoid sheenBlock(\nconst in vec4 vSheenColor,\n#ifdef SHEEN_ROUGHNESS\nconst in float vSheenRoughness,\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nconst in vec4 sheenMapRoughnessData,\n#endif\n#endif\nconst in float roughness,\n#ifdef SHEEN_TEXTURE\nconst in vec4 sheenMapData,\n#endif\nconst in float reflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nconst in vec3 baseColor,\nconst in vec3 surfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nconst in float NdotV,\nconst in vec3 environmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nconst in vec2 AARoughnessFactors,\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\nconst in vec3 reflectionCoords,\n#else\nconst in sampler2D reflectionSampler,\nconst in vec2 reflectionCoords,\n#endif\nconst in float NdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nconst in float seo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nconst in float eho,\n#endif\n#endif\nout sheenOutParams outParams\n)\n{\nfloat sheenIntensity=vSheenColor.a;\n#ifdef SHEEN_TEXTURE\n#if DEBUGMODE>0\noutParams.sheenMapData=sheenMapData;\n#endif\n#endif\n#ifdef SHEEN_LINKWITHALBEDO\nfloat sheenFactor=pow5(1.0-sheenIntensity);\nvec3 sheenColor=baseColor.rgb*(1.0-sheenFactor);\nfloat sheenRoughness=sheenIntensity;\noutParams.surfaceAlbedo=surfaceAlbedo*sheenFactor;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#else\nvec3 sheenColor=vSheenColor.rgb;\n#ifdef SHEEN_TEXTURE\nsheenColor.rgb*=sheenMapData.rgb;\n#endif\n#ifdef SHEEN_ROUGHNESS\nfloat sheenRoughness=vSheenRoughness;\n#ifdef SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\n#if defined(SHEEN_TEXTURE)\nsheenRoughness*=sheenMapData.a;\n#endif\n#elif defined(SHEEN_TEXTURE_ROUGHNESS)\n#ifdef SHEEN_TEXTURE_ROUGHNESS_IDENTICAL\nsheenRoughness*=sheenMapData.a;\n#else\nsheenRoughness*=sheenMapRoughnessData.a;\n#endif\n#endif\n#else\nfloat sheenRoughness=roughness;\n#ifdef SHEEN_TEXTURE\nsheenIntensity*=sheenMapData.a;\n#endif\n#endif\n\n#if !defined(SHEEN_ALBEDOSCALING)\nsheenIntensity*=(1.-reflectance);\n#endif\n\nsheenColor*=sheenIntensity;\n#endif\n\n#ifdef ENVIRONMENTBRDF\n\n#ifdef SHEEN_ROUGHNESS\nvec3 environmentSheenBrdf=getBRDFLookup(NdotV,sheenRoughness);\n#else\nvec3 environmentSheenBrdf=environmentBrdf;\n#endif\n\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nfloat sheenAlphaG=convertRoughnessToAverageSlope(sheenRoughness);\n#ifdef SPECULARAA\n\nsheenAlphaG+=AARoughnessFactors.y;\n#endif\nvec4 environmentSheenRadiance=vec4(0.,0.,0.,0.);\nsampleReflectionTexture(\nsheenAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nsheenRoughness,\n#endif\nreflectionSampler,\nreflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentSheenRadiance\n);\nvec3 sheenEnvironmentReflectance=getSheenReflectanceFromBRDFLookup(sheenColor,environmentSheenBrdf);\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nsheenEnvironmentReflectance*=seo;\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\nsheenEnvironmentReflectance*=eho;\n#endif\n#if DEBUGMODE>0\noutParams.sheenEnvironmentReflectance=sheenEnvironmentReflectance;\n#endif\noutParams.finalSheenRadianceScaled=\nenvironmentSheenRadiance.rgb *\nsheenEnvironmentReflectance *\nvLightingIntensity.z;\n\n\n\n\n\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\n\n\n\noutParams.sheenAlbedoScaling=1.0-sheenIntensity*max(max(sheenColor.r,sheenColor.g),sheenColor.b)*environmentSheenBrdf.b;\n#endif\n\noutParams.sheenIntensity=sheenIntensity;\noutParams.sheenColor=sheenColor;\noutParams.sheenRoughness=sheenRoughness;\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockSheen = xp;\n        var Cp = `struct clearcoatOutParams\n{\nvec3 specularEnvironmentR0;\nfloat conservationFactor;\nvec3 clearCoatNormalW;\nvec2 clearCoatAARoughnessFactors;\nfloat clearCoatIntensity;\nfloat clearCoatRoughness;\n#ifdef REFLECTION\nvec3 finalClearCoatRadianceScaled;\n#endif\n#ifdef CLEARCOAT_TINT\nvec3 absorption;\nfloat clearCoatNdotVRefract;\nvec3 clearCoatColor;\nfloat clearCoatThickness;\n#endif\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nvec3 energyConservationFactorClearCoat;\n#endif\n#if DEBUGMODE>0\nmat3 TBNClearCoat;\nvec2 clearCoatMapData;\nvec4 clearCoatTintMapData;\nvec4 environmentClearCoatRadiance;\nfloat clearCoatNdotV;\nvec3 clearCoatEnvironmentReflectance;\n#endif\n};\n#ifdef CLEARCOAT\n#define pbr_inline\n#define inline\nvoid clearcoatBlock(\nconst in vec3 vPositionW,\nconst in vec3 geometricNormalW,\nconst in vec3 viewDirectionW,\nconst in vec2 vClearCoatParams,\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nconst in vec4 clearCoatMapRoughnessData,\n#endif\nconst in vec3 specularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nconst in vec2 clearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nconst in vec4 vClearCoatTintParams,\nconst in float clearCoatColorAtDistance,\nconst in vec4 vClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nconst in vec4 clearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nconst in vec2 vClearCoatBumpInfos,\nconst in vec4 clearCoatBumpMapData,\nconst in vec2 vClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nconst in mat3 vTBN,\n#else\nconst in vec2 vClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nconst in mat4 normalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nconst in vec3 faceNormal,\n#endif\n#ifdef REFLECTION\nconst in vec3 vReflectionMicrosurfaceInfos,\nconst in vec2 vReflectionInfos,\nconst in vec3 vReflectionColor,\nconst in vec4 vLightingIntensity,\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSampler,\n#else\nconst in sampler2D reflectionSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube reflectionSamplerLow,\nconst in samplerCube reflectionSamplerHigh,\n#else\nconst in sampler2D reflectionSamplerLow,\nconst in sampler2D reflectionSamplerHigh,\n#endif\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nconst in float ambientMonochrome,\n#endif\n#endif\nout clearcoatOutParams outParams\n)\n{\n\nfloat clearCoatIntensity=vClearCoatParams.x;\nfloat clearCoatRoughness=vClearCoatParams.y;\n#ifdef CLEARCOAT_TEXTURE\nclearCoatIntensity*=clearCoatMapData.x;\n#ifdef CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\nclearCoatRoughness*=clearCoatMapData.y;\n#endif\n#if DEBUGMODE>0\noutParams.clearCoatMapData=clearCoatMapData;\n#endif\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL\nclearCoatRoughness*=clearCoatMapData.y;\n#else\nclearCoatRoughness*=clearCoatMapRoughnessData.y;\n#endif\n#endif\noutParams.clearCoatIntensity=clearCoatIntensity;\noutParams.clearCoatRoughness=clearCoatRoughness;\n#ifdef CLEARCOAT_TINT\nvec3 clearCoatColor=vClearCoatTintParams.rgb;\nfloat clearCoatThickness=vClearCoatTintParams.a;\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatColor*=clearCoatTintMapData.rgb;\nclearCoatThickness*=clearCoatTintMapData.a;\n#if DEBUGMODE>0\noutParams.clearCoatTintMapData=clearCoatTintMapData;\n#endif\n#endif\noutParams.clearCoatColor=computeColorAtDistanceInMedia(clearCoatColor,clearCoatColorAtDistance);\noutParams.clearCoatThickness=clearCoatThickness;\n#endif\n\n\n\n\n#ifdef CLEARCOAT_REMAP_F0\nvec3 specularEnvironmentR0Updated=getR0RemappedForClearCoat(specularEnvironmentR0);\n#else\nvec3 specularEnvironmentR0Updated=specularEnvironmentR0;\n#endif\noutParams.specularEnvironmentR0=mix(specularEnvironmentR0,specularEnvironmentR0Updated,clearCoatIntensity);\n\nvec3 clearCoatNormalW=geometricNormalW;\n#ifdef CLEARCOAT_BUMP\n#ifdef NORMALXYSCALE\nfloat clearCoatNormalScale=1.0;\n#else\nfloat clearCoatNormalScale=vClearCoatBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBNClearCoat=vTBN;\n#else\nmat3 TBNClearCoat=cotangent_frame(clearCoatNormalW*clearCoatNormalScale,vPositionW,vClearCoatBumpUV,vClearCoatTangentSpaceParams);\n#endif\n#if DEBUGMODE>0\noutParams.TBNClearCoat=TBNClearCoat;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nclearCoatNormalW=normalize(clearCoatBumpMapData.xyz*2.0-1.0);\nclearCoatNormalW=normalize(mat3(normalMatrix)*clearCoatNormalW);\n#else\nclearCoatNormalW=perturbNormal(TBNClearCoat,clearCoatBumpMapData.xyz,vClearCoatBumpInfos.y);\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nclearCoatNormalW*=sign(dot(clearCoatNormalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nclearCoatNormalW=gl_FrontFacing ? clearCoatNormalW : -clearCoatNormalW;\n#endif\noutParams.clearCoatNormalW=clearCoatNormalW;\n\noutParams.clearCoatAARoughnessFactors=getAARoughnessFactors(clearCoatNormalW.xyz);\n\nfloat clearCoatNdotVUnclamped=dot(clearCoatNormalW,viewDirectionW);\n\nfloat clearCoatNdotV=absEps(clearCoatNdotVUnclamped);\n#if DEBUGMODE>0\noutParams.clearCoatNdotV=clearCoatNdotV;\n#endif\n#ifdef CLEARCOAT_TINT\n\nvec3 clearCoatVRefract=-refract(vPositionW,clearCoatNormalW,vClearCoatRefractionParams.y);\n\noutParams.clearCoatNdotVRefract=absEps(dot(clearCoatNormalW,clearCoatVRefract));\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n\nvec3 environmentClearCoatBrdf=getBRDFLookup(clearCoatNdotV,clearCoatRoughness);\n#endif\n\n#if defined(REFLECTION)\nfloat clearCoatAlphaG=convertRoughnessToAverageSlope(clearCoatRoughness);\n#ifdef SPECULARAA\n\nclearCoatAlphaG+=outParams.clearCoatAARoughnessFactors.y;\n#endif\nvec4 environmentClearCoatRadiance=vec4(0.,0.,0.,0.);\nvec3 clearCoatReflectionVector=computeReflectionCoords(vec4(vPositionW,1.0),clearCoatNormalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nclearCoatReflectionVector.z*=-1.0;\n#endif\n\n#ifdef REFLECTIONMAP_3D\nvec3 clearCoatReflectionCoords=clearCoatReflectionVector;\n#else\nvec2 clearCoatReflectionCoords=clearCoatReflectionVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nclearCoatReflectionCoords/=clearCoatReflectionVector.z;\n#endif\nclearCoatReflectionCoords.y=1.0-clearCoatReflectionCoords.y;\n#endif\nsampleReflectionTexture(\nclearCoatAlphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nclearCoatNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nclearCoatRoughness,\n#endif\nreflectionSampler,\nclearCoatReflectionCoords,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nenvironmentClearCoatRadiance\n);\n#if DEBUGMODE>0\noutParams.environmentClearCoatRadiance=environmentClearCoatRadiance;\n#endif\n\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromBRDFLookup(vec3(vClearCoatRefractionParams.x),environmentClearCoatBrdf);\n#ifdef RADIANCEOCCLUSION\nfloat clearCoatSeo=environmentRadianceOcclusion(ambientMonochrome,clearCoatNdotVUnclamped);\nclearCoatEnvironmentReflectance*=clearCoatSeo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat clearCoatEho=environmentHorizonOcclusion(-viewDirectionW,clearCoatNormalW,geometricNormalW);\nclearCoatEnvironmentReflectance*=clearCoatEho;\n#endif\n#endif\n#endif\n#else\n\nvec3 clearCoatEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(clearCoatNdotV,vec3(1.),vec3(1.),sqrt(1.-clearCoatRoughness));\n#endif\nclearCoatEnvironmentReflectance*=clearCoatIntensity;\n#if DEBUGMODE>0\noutParams.clearCoatEnvironmentReflectance=clearCoatEnvironmentReflectance;\n#endif\noutParams.finalClearCoatRadianceScaled=\nenvironmentClearCoatRadiance.rgb *\nclearCoatEnvironmentReflectance *\nvLightingIntensity.z;\n#endif\n#if defined(CLEARCOAT_TINT)\n\noutParams.absorption=computeClearCoatAbsorption(outParams.clearCoatNdotVRefract,outParams.clearCoatNdotVRefract,outParams.clearCoatColor,clearCoatThickness,clearCoatIntensity);\n#endif\n\nfloat fresnelIBLClearCoat=fresnelSchlickGGX(clearCoatNdotV,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);\nfresnelIBLClearCoat*=clearCoatIntensity;\noutParams.conservationFactor=(1.-fresnelIBLClearCoat);\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\noutParams.energyConservationFactorClearCoat=getEnergyConservationFactor(outParams.specularEnvironmentR0,environmentClearCoatBrdf);\n#endif\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockClearcoat = Cp;\n        var Rp = `struct subSurfaceOutParams\n{\nvec3 specularEnvironmentReflectance;\n#ifdef SS_REFRACTION\nvec3 finalRefraction;\nvec3 surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nfloat alpha;\n#endif\n#ifdef REFLECTION\nfloat refractionFactorForIrradiance;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvec3 transmittance;\nfloat translucencyIntensity;\n#ifdef REFLECTION\nvec3 refractionIrradiance;\n#endif\n#endif\n#if DEBUGMODE>0\nvec4 thicknessMap;\nvec4 environmentRefraction;\nvec3 refractionTransmittance;\n#endif\n};\n#ifdef SUBSURFACE\n#define pbr_inline\n#define inline\nvoid subSurfaceBlock(\nconst in vec3 vSubSurfaceIntensity,\nconst in vec2 vThicknessParam,\nconst in vec4 vTintColor,\nconst in vec3 normalW,\nconst in vec3 specularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nconst in vec4 thicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nconst in mat4 reflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nconst in vec3 irradianceVector_,\n#endif\n#if defined(REALTIME_FILTERING)\nconst in samplerCube reflectionSampler,\nconst in vec2 vReflectionFilteringInfo,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\n#ifdef REFLECTIONMAP_3D\nconst in samplerCube irradianceSampler,\n#else\nconst in sampler2D irradianceSampler,\n#endif\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nconst in vec3 vPositionW,\nconst in vec3 viewDirectionW,\nconst in mat4 view,\nconst in vec3 surfaceAlbedo,\nconst in vec4 vRefractionInfos,\nconst in mat4 refractionMatrix,\nconst in vec3 vRefractionMicrosurfaceInfos,\nconst in vec4 vLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nconst in float alpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nconst in float NdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nconst in float roughness,\n#else\nconst in float alphaG,\n#endif\n#ifdef SS_REFRACTIONMAP_3D\nconst in samplerCube refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in samplerCube refractionSamplerLow,\nconst in samplerCube refractionSamplerHigh,\n#endif\n#else\nconst in sampler2D refractionSampler,\n#ifndef LODBASEDMICROSFURACE\nconst in sampler2D refractionSamplerLow,\nconst in sampler2D refractionSamplerHigh,\n#endif\n#endif\n#ifdef ANISOTROPIC\nconst in anisotropicOutParams anisotropicOut,\n#endif\n#ifdef REALTIME_FILTERING\nconst in vec2 vRefractionFilteringInfo,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nconst in vec3 vDiffusionDistance,\n#endif\nout subSurfaceOutParams outParams\n)\n{\noutParams.specularEnvironmentReflectance=specularEnvironmentReflectance;\n\n\n\n#ifdef SS_REFRACTION\nfloat refractionIntensity=vSubSurfaceIntensity.x;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nrefractionIntensity*=(1.0-alpha);\n\noutParams.alpha=1.0;\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nfloat translucencyIntensity=vSubSurfaceIntensity.y;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nfloat thickness=thicknessMap.r*vThicknessParam.y+vThicknessParam.x;\n#if DEBUGMODE>0\noutParams.thicknessMap=thicknessMap;\n#endif\n#ifdef SS_MASK_FROM_THICKNESS_TEXTURE\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.g;\n#endif\n#ifdef SS_TRANSLUCENCY\ntranslucencyIntensity*=thicknessMap.b;\n#endif\n#elif defined(SS_MASK_FROM_THICKNESS_TEXTURE_GLTF)\n#ifdef SS_REFRACTION\nrefractionIntensity*=thicknessMap.r;\n#elif defined(SS_TRANSLUCENCY)\ntranslucencyIntensity*=thicknessMap.r;\n#endif\nthickness=thicknessMap.g*vThicknessParam.y+vThicknessParam.x;\n#endif\n#else\nfloat thickness=vThicknessParam.y;\n#endif\n\n\n\n#ifdef SS_TRANSLUCENCY\nthickness=maxEps(thickness);\nvec3 transmittance=transmittanceBRDF_Burley(vTintColor.rgb,vDiffusionDistance,thickness);\ntransmittance*=translucencyIntensity;\noutParams.transmittance=transmittance;\noutParams.translucencyIntensity=translucencyIntensity;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec4 environmentRefraction=vec4(0.,0.,0.,0.);\n#ifdef ANISOTROPIC\nvec3 refractionVector=refract(-viewDirectionW,anisotropicOut.anisotropicNormal,vRefractionInfos.y);\n#else\nvec3 refractionVector=refract(-viewDirectionW,normalW,vRefractionInfos.y);\n#endif\n#ifdef SS_REFRACTIONMAP_OPPOSITEZ\nrefractionVector.z*=-1.0;\n#endif\n\n#ifdef SS_REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nvec3 refractionCoords=refractionVector;\nrefractionCoords=vec3(refractionMatrix*vec4(refractionCoords,0));\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG,NdotVUnclamped);\n#elif defined(SS_LINEARSPECULARREFRACTION)\nfloat refractionLOD=getLinearLodFromRoughness(vRefractionMicrosurfaceInfos.x,roughness);\n#else\nfloat refractionLOD=getLodFromAlphaG(vRefractionMicrosurfaceInfos.x,alphaG);\n#endif\n#ifdef LODBASEDMICROSFURACE\n\nrefractionLOD=refractionLOD*vRefractionMicrosurfaceInfos.y+vRefractionMicrosurfaceInfos.z;\n#ifdef SS_LODINREFRACTIONALPHA\n\n\n\n\n\n\n\n\n\nfloat automaticRefractionLOD=UNPACK_LOD(sampleRefraction(refractionSampler,refractionCoords).a);\nfloat requestedRefractionLOD=max(automaticRefractionLOD,refractionLOD);\n#else\nfloat requestedRefractionLOD=refractionLOD;\n#endif\n#ifdef REALTIME_FILTERING\nenvironmentRefraction=vec4(radiance(alphaG,refractionSampler,refractionCoords,vRefractionFilteringInfo),1.0);\n#else\nenvironmentRefraction=sampleRefractionLod(refractionSampler,refractionCoords,requestedRefractionLOD);\n#endif\n#else\nfloat lodRefractionNormalized=saturate(refractionLOD/log2(vRefractionMicrosurfaceInfos.x));\nfloat lodRefractionNormalizedDoubled=lodRefractionNormalized*2.0;\nvec4 environmentRefractionMid=sampleRefraction(refractionSampler,refractionCoords);\nif (lodRefractionNormalizedDoubled<1.0){\nenvironmentRefraction=mix(\nsampleRefraction(refractionSamplerHigh,refractionCoords),\nenvironmentRefractionMid,\nlodRefractionNormalizedDoubled\n);\n} else {\nenvironmentRefraction=mix(\nenvironmentRefractionMid,\nsampleRefraction(refractionSamplerLow,refractionCoords),\nlodRefractionNormalizedDoubled-1.0\n);\n}\n#endif\n#ifdef SS_RGBDREFRACTION\nenvironmentRefraction.rgb=fromRGBD(environmentRefraction);\n#endif\n#ifdef SS_GAMMAREFRACTION\nenvironmentRefraction.rgb=toLinearSpace(environmentRefraction.rgb);\n#endif\n\nenvironmentRefraction.rgb*=vRefractionInfos.x;\n#endif\n\n\n\n#ifdef SS_REFRACTION\nvec3 refractionTransmittance=vec3(refractionIntensity);\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\n\n\n\n\n\nrefractionTransmittance*=cocaLambert(volumeAlbedo,thickness);\n#elif defined(SS_LINKREFRACTIONTOTRANSPARENCY)\n\nfloat maxChannel=max(max(surfaceAlbedo.r,surfaceAlbedo.g),surfaceAlbedo.b);\nvec3 volumeAlbedo=saturate(maxChannel*surfaceAlbedo);\n\nenvironmentRefraction.rgb*=volumeAlbedo;\n#else\n\nvec3 volumeAlbedo=computeColorAtDistanceInMedia(vTintColor.rgb,vTintColor.w);\nrefractionTransmittance*=cocaLambert(volumeAlbedo,vThicknessParam.y);\n#endif\n#ifdef SS_ALBEDOFORREFRACTIONTINT\n\nenvironmentRefraction.rgb*=surfaceAlbedo.rgb;\n#endif\n\noutParams.surfaceAlbedo=surfaceAlbedo*(1.-refractionIntensity);\n#ifdef REFLECTION\n\noutParams.refractionFactorForIrradiance=(1.-refractionIntensity);\n\n#endif\n\nvec3 bounceSpecularEnvironmentReflectance=(2.0*specularEnvironmentReflectance)/(1.0+specularEnvironmentReflectance);\noutParams.specularEnvironmentReflectance=mix(bounceSpecularEnvironmentReflectance,specularEnvironmentReflectance,refractionIntensity);\n\nrefractionTransmittance*=1.0-outParams.specularEnvironmentReflectance;\n#if DEBUGMODE>0\noutParams.refractionTransmittance=refractionTransmittance;\n#endif\noutParams.finalRefraction=environmentRefraction.rgb*refractionTransmittance*vLightingIntensity.z;\n#if DEBUGMODE>0\noutParams.environmentRefraction=environmentRefraction;\n#endif\n#endif\n\n\n\n#if defined(REFLECTION) && defined(SS_TRANSLUCENCY)\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX) || !defined(USESPHERICALFROMREFLECTIONMAP)\nvec3 irradianceVector=vec3(reflectionMatrix*vec4(normalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nirradianceVector.z*=-1.0;\n#endif\n#ifdef INVERTCUBICMAP\nirradianceVector.y*=-1.0;\n#endif\n#else\nvec3 irradianceVector=irradianceVector_;\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP)\n#if defined(REALTIME_FILTERING)\nvec3 refractionIrradiance=irradiance(reflectionSampler,-irradianceVector,vReflectionFilteringInfo);\n#else\nvec3 refractionIrradiance=computeEnvironmentIrradiance(-irradianceVector);\n#endif\n#elif defined(USEIRRADIANCEMAP)\n#ifdef REFLECTIONMAP_3D\nvec3 irradianceCoords=irradianceVector;\n#else\nvec2 irradianceCoords=irradianceVector.xy;\n#ifdef REFLECTIONMAP_PROJECTION\nirradianceCoords/=irradianceVector.z;\n#endif\nirradianceCoords.y=1.0-irradianceCoords.y;\n#endif\nvec4 refractionIrradiance=sampleReflection(irradianceSampler,-irradianceCoords);\n#ifdef RGBDREFLECTION\nrefractionIrradiance.rgb=fromRGBD(refractionIrradiance);\n#endif\n#ifdef GAMMAREFLECTION\nrefractionIrradiance.rgb=toLinearSpace(refractionIrradiance.rgb);\n#endif\n#else\nvec4 refractionIrradiance=vec4(0.);\n#endif\nrefractionIrradiance.rgb*=transmittance;\noutParams.refractionIrradiance=refractionIrradiance.rgb;\n#endif\n}\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockSubSurface = Rp;\n        var Op = `vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#endif\nvec3 geometricNormalW=normalW;\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\ngeometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockNormalGeometric = Op, f(134);\n        var Mp = `#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nvec3 faceNormal=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;\n#if defined(TWOSIDEDLIGHTING)\nfaceNormal=gl_FrontFacing ? faceNormal : -faceNormal;\n#endif\nnormalW*=sign(dot(normalW,faceNormal));\n#endif\n#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockNormalFinal = Mp, f(162);\n        var Ip = `#ifdef LIGHTMAP\nvec4 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor.rgb=fromRGBD(lightmapColor);\n#endif\n#ifdef GAMMALIGHTMAP\nlightmapColor.rgb=toLinearSpace(lightmapColor.rgb);\n#endif\nlightmapColor.rgb*=vLightmapInfos.y;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockLightmapInit = Ip;\n        var Dp = `float NdotVUnclamped=dot(normalW,viewDirectionW);\n\nfloat NdotV=absEps(NdotVUnclamped);\nfloat alphaG=convertRoughnessToAverageSlope(roughness);\nvec2 AARoughnessFactors=getAARoughnessFactors(normalW.xyz);\n#ifdef SPECULARAA\n\nalphaG+=AARoughnessFactors.y;\n#endif\n#if defined(ENVIRONMENTBRDF)\n\nvec3 environmentBrdf=getBRDFLookup(NdotV,roughness);\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\n#ifdef AMBIENTINGRAYSCALE\nfloat ambientMonochrome=aoOut.ambientOcclusionColor.r;\n#else\nfloat ambientMonochrome=getLuminance(aoOut.ambientOcclusionColor);\n#endif\nfloat seo=environmentRadianceOcclusion(ambientMonochrome,NdotVUnclamped);\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nfloat eho=environmentHorizonOcclusion(-viewDirectionW,normalW,geometricNormalW);\n#endif\n#endif\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockGeometryInfo = Dp;\n        var Lp = `float reflectance=max(max(reflectivityOut.surfaceReflectivityColor.r,reflectivityOut.surfaceReflectivityColor.g),reflectivityOut.surfaceReflectivityColor.b);\nvec3 specularEnvironmentR0=reflectivityOut.surfaceReflectivityColor.rgb;\n#ifdef METALLICWORKFLOW\nvec3 specularEnvironmentR90=vec3(metallicReflectanceFactors.a);\n#else\nvec3 specularEnvironmentR90=vec3(1.0,1.0,1.0);\n#endif\n\n#ifdef ALPHAFRESNEL\nfloat reflectance90=fresnelGrazingReflectance(reflectance);\nspecularEnvironmentR90=specularEnvironmentR90*reflectance90;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflectance0 = Lp;\n        var Np = `#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\nvec3 specularEnvironmentReflectance=getReflectanceFromBRDFLookup(clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,environmentBrdf);\n#ifdef RADIANCEOCCLUSION\nspecularEnvironmentReflectance*=seo;\n#endif\n#ifdef HORIZONOCCLUSION\n#ifdef BUMP\n#ifdef REFLECTIONMAP_3D\nspecularEnvironmentReflectance*=eho;\n#endif\n#endif\n#endif\n#else\n\nvec3 specularEnvironmentReflectance=getReflectanceFromAnalyticalBRDFLookup_Jones(NdotV,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,sqrt(microSurface));\n#endif\n#ifdef CLEARCOAT\nspecularEnvironmentReflectance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nspecularEnvironmentReflectance*=clearcoatOut.absorption;\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockReflectance = Np;\n        var wp = `vec3 diffuseBase=vec3(0.,0.,0.);\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#ifdef CLEARCOAT\nvec3 clearCoatBase=vec3(0.,0.,0.);\n#endif\n#ifdef SHEEN\nvec3 sheenBase=vec3(0.,0.,0.);\n#endif\n\npreLightingInfo preInfo;\nlightingInfo info;\nfloat shadow=1.;\n#if defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\nvec3 absorption=vec3(0.);\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockDirectLighting = wp;\n        var Fp = `\n\n\n\n#if defined(ENVIRONMENTBRDF)\n#ifdef MS_BRDF_ENERGY_CONSERVATION\nvec3 energyConservationFactor=getEnergyConservationFactor(clearcoatOut.specularEnvironmentR0,environmentBrdf);\n#endif\n#endif\n#ifndef METALLICWORKFLOW\n#ifdef SPECULAR_GLOSSINESS_ENERGY_CONSERVATION\nsurfaceAlbedo.rgb=(1.-reflectance)*surfaceAlbedo.rgb;\n#endif\n#endif\n#if defined(SHEEN) && defined(SHEEN_ALBEDOSCALING) && defined(ENVIRONMENTBRDF)\nsurfaceAlbedo.rgb=sheenOut.sheenAlbedoScaling*surfaceAlbedo.rgb;\n#endif\n\n#ifdef REFLECTION\nvec3 finalIrradiance=reflectionOut.environmentIrradiance;\n#if defined(CLEARCOAT)\nfinalIrradiance*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nfinalIrradiance*=clearcoatOut.absorption;\n#endif\n#endif\n#if defined(SS_REFRACTION)\nfinalIrradiance*=subSurfaceOut.refractionFactorForIrradiance;\n#endif\n#if defined(SS_TRANSLUCENCY)\nfinalIrradiance*=(1.0-subSurfaceOut.translucencyIntensity);\nfinalIrradiance+=subSurfaceOut.refractionIrradiance;\n#endif\nfinalIrradiance*=surfaceAlbedo.rgb;\nfinalIrradiance*=vLightingIntensity.z;\nfinalIrradiance*=aoOut.ambientOcclusionColor;\n#endif\n\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase;\nfinalSpecular=max(finalSpecular,0.0);\nvec3 finalSpecularScaled=finalSpecular*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalSpecularScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalSpecularScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef REFLECTION\nvec3 finalRadiance=reflectionOut.environmentRadiance.rgb;\nfinalRadiance*=subSurfaceOut.specularEnvironmentReflectance;\nvec3 finalRadianceScaled=finalRadiance*vLightingIntensity.z;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalRadianceScaled*=energyConservationFactor;\n#endif\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF) && defined(SHEEN_ALBEDOSCALING)\nfinalRadianceScaled*=sheenOut.sheenAlbedoScaling;\n#endif\n#endif\n\n#ifdef SHEEN\nvec3 finalSheen=sheenBase*sheenOut.sheenColor;\nfinalSheen=max(finalSheen,0.0);\nvec3 finalSheenScaled=finalSheen*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(CLEARCOAT) && defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.conservationFactor;\n#if defined(CLEARCOAT_TINT)\nsheenOut.finalSheenRadianceScaled*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef CLEARCOAT\nvec3 finalClearCoat=clearCoatBase;\nfinalClearCoat=max(finalClearCoat,0.0);\nvec3 finalClearCoatScaled=finalClearCoat*vLightingIntensity.x*vLightingIntensity.w;\n#if defined(ENVIRONMENTBRDF) && defined(MS_BRDF_ENERGY_CONSERVATION)\nfinalClearCoatScaled*=clearcoatOut.energyConservationFactorClearCoat;\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction*=clearcoatOut.conservationFactor;\n#ifdef CLEARCOAT_TINT\nsubSurfaceOut.finalRefraction*=clearcoatOut.absorption;\n#endif\n#endif\n#endif\n\n#ifdef ALPHABLEND\nfloat luminanceOverAlpha=0.0;\n#if defined(REFLECTION) && defined(RADIANCEOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalRadianceScaled);\n#if defined(CLEARCOAT)\nluminanceOverAlpha+=getLuminance(clearcoatOut.finalClearCoatRadianceScaled);\n#endif\n#endif\n#if defined(SPECULARTERM) && defined(SPECULAROVERALPHA)\nluminanceOverAlpha+=getLuminance(finalSpecularScaled);\n#endif\n#if defined(CLEARCOAT) && defined(CLEARCOATOVERALPHA)\nluminanceOverAlpha+=getLuminance(finalClearCoatScaled);\n#endif\n#if defined(RADIANCEOVERALPHA) || defined(SPECULAROVERALPHA) || defined(CLEARCOATOVERALPHA)\nalpha=saturate(alpha+luminanceOverAlpha*luminanceOverAlpha);\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockFinalLitComponents = Fp;\n        var Bp = `\nvec3 finalDiffuse=diffuseBase;\nfinalDiffuse*=surfaceAlbedo.rgb;\nfinalDiffuse=max(finalDiffuse,0.0);\nfinalDiffuse*=vLightingIntensity.x;\n\nvec3 finalAmbient=vAmbientColor;\nfinalAmbient*=surfaceAlbedo.rgb;\n\nvec3 finalEmissive=vEmissiveColor;\n#ifdef EMISSIVE\nvec3 emissiveColorTex=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb;\nfinalEmissive*=toLinearSpace(emissiveColorTex.rgb);\nfinalEmissive*=vEmissiveInfos.y;\n#endif\nfinalEmissive*=vLightingIntensity.y;\n\n#ifdef AMBIENT\nvec3 ambientOcclusionForDirectDiffuse=mix(vec3(1.),aoOut.ambientOcclusionColor,vAmbientInfos.w);\n#else\nvec3 ambientOcclusionForDirectDiffuse=aoOut.ambientOcclusionColor;\n#endif\nfinalAmbient*=aoOut.ambientOcclusionColor;\nfinalDiffuse*=ambientOcclusionForDirectDiffuse;\n`;\n        ze.a.IncludesShadersStore.pbrBlockFinalUnlitComponents = Bp;\n        var Up = `vec4 finalColor=vec4(\nfinalAmbient +\nfinalDiffuse +\n#ifndef UNLIT\n#ifdef REFLECTION\nfinalIrradiance +\n#endif\n#ifdef SPECULARTERM\nfinalSpecularScaled +\n#endif\n#ifdef SHEEN\nfinalSheenScaled +\n#endif\n#ifdef CLEARCOAT\nfinalClearCoatScaled +\n#endif\n#ifdef REFLECTION\nfinalRadianceScaled +\n#if defined(SHEEN) && defined(ENVIRONMENTBRDF)\nsheenOut.finalSheenRadianceScaled +\n#endif\n#ifdef CLEARCOAT\nclearcoatOut.finalClearCoatRadianceScaled +\n#endif\n#endif\n#ifdef SS_REFRACTION\nsubSurfaceOut.finalRefraction +\n#endif\n#endif\nfinalEmissive,\nalpha);\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\nfinalColor.rgb*=lightmapColor.rgb;\n#else\nfinalColor.rgb+=lightmapColor.rgb;\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\n\nfinalColor=max(finalColor,0.0);\n`;\n        ze.a.IncludesShadersStore.pbrBlockFinalColorComposition = Up, f(155);\n        var Vp = `#ifdef IMAGEPROCESSINGPOSTPROCESS\n\n\nfinalColor.rgb=clamp(finalColor.rgb,0.,30.0);\n#else\n\nfinalColor=applyImageProcessing(finalColor);\n#endif\nfinalColor.a*=visibility;\n#ifdef PREMULTIPLYALPHA\n\nfinalColor.rgb*=finalColor.a;\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrBlockImageProcessing = Vp;\n        var kp = `#if DEBUGMODE>0\nif (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {\n\n#if DEBUGMODE == 1\ngl_FragColor.rgb=vPositionW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 2 && defined(NORMAL)\ngl_FragColor.rgb=vNormalW.rgb;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 3 && defined(BUMP) || DEBUGMODE == 3 && defined(PARALLAX) || DEBUGMODE == 3 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 4 && defined(BUMP) || DEBUGMODE == 4 && defined(PARALLAX) || DEBUGMODE == 4 && defined(ANISOTROPIC)\n\ngl_FragColor.rgb=TBN[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 5\n\ngl_FragColor.rgb=normalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 6 && defined(MAINUV1)\ngl_FragColor.rgb=vec3(vMainUV1,0.0);\n#elif DEBUGMODE == 7 && defined(MAINUV2)\ngl_FragColor.rgb=vec3(vMainUV2,0.0);\n#elif DEBUGMODE == 8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)\n\ngl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 10 && defined(CLEARCOAT)\n\ngl_FragColor.rgb=clearcoatOut.clearCoatNormalW;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 11 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicNormal;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 12 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicTangent;\n#define DEBUGMODE_NORMALIZE\n#elif DEBUGMODE == 13 && defined(ANISOTROPIC)\ngl_FragColor.rgb=anisotropicOut.anisotropicBitangent;\n#define DEBUGMODE_NORMALIZE\n\n#elif DEBUGMODE == 20 && defined(ALBEDO)\ngl_FragColor.rgb=albedoTexture.rgb;\n#elif DEBUGMODE == 21 && defined(AMBIENT)\ngl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;\n#elif DEBUGMODE == 22 && defined(OPACITY)\ngl_FragColor.rgb=opacityMap.rgb;\n#elif DEBUGMODE == 23 && defined(EMISSIVE)\ngl_FragColor.rgb=emissiveColorTex.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 24 && defined(LIGHTMAP)\ngl_FragColor.rgb=lightmapColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;\n#elif DEBUGMODE == 26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);\n#elif DEBUGMODE == 28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\ngl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;\n#elif DEBUGMODE == 29 && defined(SHEEN) && defined(SHEEN_TEXTURE)\ngl_FragColor.rgb=sheenOut.sheenMapData.rgb;\n#elif DEBUGMODE == 30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)\ngl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;\n#elif DEBUGMODE == 31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)\ngl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;\n\n#elif DEBUGMODE == 40 && defined(SS_REFRACTION)\n\ngl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 41 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 42 && defined(CLEARCOAT) && defined(REFLECTION)\ngl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 50\ngl_FragColor.rgb=diffuseBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 51 && defined(SPECULARTERM)\ngl_FragColor.rgb=specularBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 52 && defined(CLEARCOAT)\ngl_FragColor.rgb=clearCoatBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 53 && defined(SHEEN)\ngl_FragColor.rgb=sheenBase.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 54 && defined(REFLECTION)\ngl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;\n#define DEBUGMODE_GAMMA\n\n#elif DEBUGMODE == 60\ngl_FragColor.rgb=surfaceAlbedo.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 61\ngl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 62 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=vec3(reflectivityOut.metallicRoughness.r);\n#elif DEBUGMODE == 71 && defined(METALLICWORKFLOW)\ngl_FragColor.rgb=reflectivityOut.metallicF0;\n#elif DEBUGMODE == 63\ngl_FragColor.rgb=vec3(roughness);\n#elif DEBUGMODE == 64\ngl_FragColor.rgb=vec3(alphaG);\n#elif DEBUGMODE == 65\ngl_FragColor.rgb=vec3(NdotV);\n#elif DEBUGMODE == 66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)\ngl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 67 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);\n#elif DEBUGMODE == 68 && defined(CLEARCOAT)\ngl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);\n#elif DEBUGMODE == 69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)\ngl_FragColor.rgb=subSurfaceOut.transmittance;\n#elif DEBUGMODE == 70 && defined(SUBSURFACE) && defined(SS_REFRACTION)\ngl_FragColor.rgb=subSurfaceOut.refractionTransmittance;\n\n#elif DEBUGMODE == 80 && defined(RADIANCEOCCLUSION)\ngl_FragColor.rgb=vec3(seo);\n#elif DEBUGMODE == 81 && defined(HORIZONOCCLUSION)\ngl_FragColor.rgb=vec3(eho);\n#elif DEBUGMODE == 82 && defined(MS_BRDF_ENERGY_CONSERVATION)\ngl_FragColor.rgb=vec3(energyConservationFactor);\n#elif DEBUGMODE == 83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=specularEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\ngl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 85 && defined(SHEEN) && defined(REFLECTION)\ngl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;\n#define DEBUGMODE_GAMMA\n#elif DEBUGMODE == 86 && defined(ALPHABLEND)\ngl_FragColor.rgb=vec3(luminanceOverAlpha);\n#elif DEBUGMODE == 87\ngl_FragColor.rgb=vec3(alpha);\n#endif\ngl_FragColor.rgb*=vDebugMode.y;\n#ifdef DEBUGMODE_NORMALIZE\ngl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;\n#endif\n#ifdef DEBUGMODE_GAMMA\ngl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);\n#endif\ngl_FragColor.a=1.0;\n#ifdef PREPASS\ngl_FragData[0]=toLinearSpace(gl_FragColor);\ngl_FragData[1]=vec4(0.,0.,0.,0.);\n#endif\nreturn;\n}\n#endif`;\n        ze.a.IncludesShadersStore.pbrDebug = kp;\n        var Gp = `#if defined(BUMP) || !defined(NORMAL) || defined(FORCENORMALFORWARD) || defined(SPECULARAA) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LODBASEDMICROSFURACE\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#define CUSTOM_FRAGMENT_BEGIN\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\nprecision highp float;\n\n#ifndef FROMLINEARSPACE\n#define FROMLINEARSPACE\n#endif\n\n#include<__decl__pbrFragment>\n#include<pbrFragmentExtraDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<pbrFragmentSamplersDeclaration>\n#include<imageProcessingDeclaration>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<importanceSampling>\n#include<pbrHelperFunctions>\n#include<imageProcessingFunctions>\n#include<shadowsFragmentFunctions>\n#include<harmonicsFunctions>\n#include<pbrDirectLightingSetupFunctions>\n#include<pbrDirectLightingFalloffFunctions>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\n#include<pbrDirectLightingFunctions>\n#include<pbrIBLFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#ifdef REFLECTION\n#include<reflectionFunction>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n#include<pbrBlockAlbedoOpacity>\n#include<pbrBlockReflectivity>\n#include<pbrBlockAmbientOcclusion>\n#include<pbrBlockAlphaFresnel>\n#include<pbrBlockAnisotropic>\n#include<pbrBlockReflection>\n#include<pbrBlockSheen>\n#include<pbrBlockClearcoat>\n#include<pbrBlockSubSurface>\n\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n\n#include<pbrBlockNormalGeometric>\n#include<bumpFragment>\n#include<pbrBlockNormalFinal>\n\nalbedoOpacityOutParams albedoOpacityOut;\n#ifdef ALBEDO\nvec4 albedoTexture=texture2D(albedoSampler,vAlbedoUV+uvOffset);\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#endif\nalbedoOpacityBlock(\nvAlbedoColor,\n#ifdef ALBEDO\nalbedoTexture,\nvAlbedoInfos,\n#endif\n#ifdef OPACITY\nopacityMap,\nvOpacityInfos,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nalbedoOpacityOut\n);\nvec3 surfaceAlbedo=albedoOpacityOut.surfaceAlbedo;\nfloat alpha=albedoOpacityOut.alpha;\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\n#include<depthPrePass>\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\n\nambientOcclusionOutParams aoOut;\n#ifdef AMBIENT\nvec3 ambientOcclusionColorMap=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb;\n#endif\nambientOcclusionBlock(\n#ifdef AMBIENT\nambientOcclusionColorMap,\nvAmbientInfos,\n#endif\naoOut\n);\n#include<pbrBlockLightmapInit>\n#ifdef UNLIT\nvec3 diffuseBase=vec3(1.,1.,1.);\n#else\n\nvec3 baseColor=surfaceAlbedo;\nreflectivityOutParams reflectivityOut;\n#if defined(REFLECTIVITY)\nvec4 surfaceMetallicOrReflectivityColorMap=texture2D(reflectivitySampler,vReflectivityUV+uvOffset);\nvec4 baseReflectivity=surfaceMetallicOrReflectivityColorMap;\n#ifndef METALLICWORKFLOW\nsurfaceMetallicOrReflectivityColorMap=toLinearSpace(surfaceMetallicOrReflectivityColorMap);\nsurfaceMetallicOrReflectivityColorMap.rgb*=vReflectivityInfos.y;\n#endif\n#endif\n#if defined(MICROSURFACEMAP)\nvec4 microSurfaceTexel=texture2D(microSurfaceSampler,vMicroSurfaceSamplerUV+uvOffset)*vMicroSurfaceSamplerInfos.y;\n#endif\n#ifdef METALLICWORKFLOW\nvec4 metallicReflectanceFactors=vMetallicReflectanceFactors;\n#ifdef METALLIC_REFLECTANCE\nvec4 metallicReflectanceFactorsMap=texture2D(metallicReflectanceSampler,vMetallicReflectanceUV+uvOffset);\nmetallicReflectanceFactorsMap=toLinearSpace(metallicReflectanceFactorsMap);\nmetallicReflectanceFactors*=metallicReflectanceFactorsMap;\n#endif\n#endif\nreflectivityBlock(\nvReflectivityColor,\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo,\nmetallicReflectanceFactors,\n#endif\n#ifdef REFLECTIVITY\nvReflectivityInfos,\nsurfaceMetallicOrReflectivityColorMap,\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor,\n#endif\n#ifdef MICROSURFACEMAP\nmicroSurfaceTexel,\n#endif\n#ifdef DETAIL\ndetailColor,\nvDetailInfos,\n#endif\nreflectivityOut\n);\nfloat microSurface=reflectivityOut.microSurface;\nfloat roughness=reflectivityOut.roughness;\n#ifdef METALLICWORKFLOW\nsurfaceAlbedo=reflectivityOut.surfaceAlbedo;\n#endif\n#if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\naoOut.ambientOcclusionColor=reflectivityOut.ambientOcclusionColor;\n#endif\n\n#ifdef ALPHAFRESNEL\n#if defined(ALPHATEST) || defined(ALPHABLEND)\nalphaFresnelOutParams alphaFresnelOut;\nalphaFresnelBlock(\nnormalW,\nviewDirectionW,\nalpha,\nmicroSurface,\nalphaFresnelOut\n);\nalpha=alphaFresnelOut.alpha;\n#endif\n#endif\n\n#include<pbrBlockGeometryInfo>\n\n#ifdef ANISOTROPIC\nanisotropicOutParams anisotropicOut;\n#ifdef ANISOTROPIC_TEXTURE\nvec3 anisotropyMapData=texture2D(anisotropySampler,vAnisotropyUV+uvOffset).rgb*vAnisotropyInfos.y;\n#endif\nanisotropicBlock(\nvAnisotropy,\n#ifdef ANISOTROPIC_TEXTURE\nanisotropyMapData,\n#endif\nTBN,\nnormalW,\nviewDirectionW,\nanisotropicOut\n);\n#endif\n\n#ifdef REFLECTION\nreflectionOutParams reflectionOut;\nreflectionBlock(\nvPositionW,\nnormalW,\nalphaG,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#if defined(LODINREFLECTIONALPHA) && !defined(REFLECTIONMAP_SKYBOX)\nNdotVUnclamped,\n#endif\n#ifdef LINEARSPECULARREFLECTION\nroughness,\n#endif\nreflectionSampler,\n#if defined(NORMAL) && defined(USESPHERICALINVERTEX)\nvEnvironmentIrradiance,\n#endif\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionMatrix,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\nreflectionOut\n);\n#endif\n\n#include<pbrBlockReflectance0>\n\n#ifdef SHEEN\nsheenOutParams sheenOut;\n#ifdef SHEEN_TEXTURE\nvec4 sheenMapData=toLinearSpace(texture2D(sheenSampler,vSheenUV+uvOffset))*vSheenInfos.y;\n#endif\n#if defined(SHEEN_ROUGHNESS) && defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 sheenMapRoughnessData=texture2D(sheenRoughnessSampler,vSheenRoughnessUV+uvOffset)*vSheenInfos.w;\n#endif\nsheenBlock(\nvSheenColor,\n#ifdef SHEEN_ROUGHNESS\nvSheenRoughness,\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && !defined(SHEEN_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE)\nsheenMapRoughnessData,\n#endif\n#endif\nroughness,\n#ifdef SHEEN_TEXTURE\nsheenMapData,\n#endif\nreflectance,\n#ifdef SHEEN_LINKWITHALBEDO\nbaseColor,\nsurfaceAlbedo,\n#endif\n#ifdef ENVIRONMENTBRDF\nNdotV,\nenvironmentBrdf,\n#endif\n#if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\nAARoughnessFactors,\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\nreflectionOut.reflectionCoords,\nNdotVUnclamped,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(RADIANCEOCCLUSION)\nseo,\n#endif\n#if !defined(REFLECTIONMAP_SKYBOX) && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)\neho,\n#endif\n#endif\nsheenOut\n);\n#ifdef SHEEN_LINKWITHALBEDO\nsurfaceAlbedo=sheenOut.surfaceAlbedo;\n#endif\n#endif\n\nclearcoatOutParams clearcoatOut;\n#ifdef CLEARCOAT\n#ifdef CLEARCOAT_TEXTURE\nvec2 clearCoatMapData=texture2D(clearCoatSampler,vClearCoatUV+uvOffset).rg*vClearCoatInfos.y;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nvec4 clearCoatMapRoughnessData=texture2D(clearCoatRoughnessSampler,vClearCoatRoughnessUV+uvOffset)*vClearCoatInfos.w;\n#endif\n#if defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)\nvec4 clearCoatTintMapData=toLinearSpace(texture2D(clearCoatTintSampler,vClearCoatTintUV+uvOffset));\n#endif\n#ifdef CLEARCOAT_BUMP\nvec4 clearCoatBumpMapData=texture2D(clearCoatBumpSampler,vClearCoatBumpUV+uvOffset);\n#endif\nclearcoatBlock(\nvPositionW,\ngeometricNormalW,\nviewDirectionW,\nvClearCoatParams,\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && !defined(CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL) && !defined(CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE)\nclearCoatMapRoughnessData,\n#endif\nspecularEnvironmentR0,\n#ifdef CLEARCOAT_TEXTURE\nclearCoatMapData,\n#endif\n#ifdef CLEARCOAT_TINT\nvClearCoatTintParams,\nclearCoatColorAtDistance,\nvClearCoatRefractionParams,\n#ifdef CLEARCOAT_TINT_TEXTURE\nclearCoatTintMapData,\n#endif\n#endif\n#ifdef CLEARCOAT_BUMP\nvClearCoatBumpInfos,\nclearCoatBumpMapData,\nvClearCoatBumpUV,\n#if defined(TANGENT) && defined(NORMAL)\nvTBN,\n#else\nvClearCoatTangentSpaceParams,\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nnormalMatrix,\n#endif\n#endif\n#if defined(FORCENORMALFORWARD) && defined(NORMAL)\nfaceNormal,\n#endif\n#ifdef REFLECTION\nvReflectionMicrosurfaceInfos,\nvReflectionInfos,\nvReflectionColor,\nvLightingIntensity,\nreflectionSampler,\n#ifndef LODBASEDMICROSFURACE\nreflectionSamplerLow,\nreflectionSamplerHigh,\n#endif\n#ifdef REALTIME_FILTERING\nvReflectionFilteringInfo,\n#endif\n#endif\n#if defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)\n#ifdef RADIANCEOCCLUSION\nambientMonochrome,\n#endif\n#endif\nclearcoatOut\n);\n#else\nclearcoatOut.specularEnvironmentR0=specularEnvironmentR0;\n#endif\n\n#include<pbrBlockReflectance>\n\nsubSurfaceOutParams subSurfaceOut;\n#ifdef SUBSURFACE\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nvec4 thicknessMap=texture2D(thicknessSampler,vThicknessUV+uvOffset);\n#endif\nsubSurfaceBlock(\nvSubSurfaceIntensity,\nvThicknessParam,\nvTintColor,\nnormalW,\nspecularEnvironmentReflectance,\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nthicknessMap,\n#endif\n#ifdef REFLECTION\n#ifdef SS_TRANSLUCENCY\nreflectionMatrix,\n#ifdef USESPHERICALFROMREFLECTIONMAP\n#if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\nreflectionOut.irradianceVector,\n#endif\n#if defined(REALTIME_FILTERING)\nreflectionSampler,\nvReflectionFilteringInfo,\n#endif\n#endif\n#ifdef USEIRRADIANCEMAP\nirradianceSampler,\n#endif\n#endif\n#endif\n#ifdef SS_REFRACTION\nvPositionW,\nviewDirectionW,\nview,\nsurfaceAlbedo,\nvRefractionInfos,\nrefractionMatrix,\nvRefractionMicrosurfaceInfos,\nvLightingIntensity,\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha,\n#endif\n#ifdef SS_LODINREFRACTIONALPHA\nNdotVUnclamped,\n#endif\n#ifdef SS_LINEARSPECULARREFRACTION\nroughness,\n#else\nalphaG,\n#endif\nrefractionSampler,\n#ifndef LODBASEDMICROSFURACE\nrefractionSamplerLow,\nrefractionSamplerHigh,\n#endif\n#ifdef ANISOTROPIC\nanisotropicOut,\n#endif\n#ifdef REALTIME_FILTERING\nvRefractionFilteringInfo,\n#endif\n#endif\n#ifdef SS_TRANSLUCENCY\nvDiffusionDistance,\n#endif\nsubSurfaceOut\n);\n#ifdef SS_REFRACTION\nsurfaceAlbedo=subSurfaceOut.surfaceAlbedo;\n#ifdef SS_LINKREFRACTIONTOTRANSPARENCY\nalpha=subSurfaceOut.alpha;\n#endif\n#endif\n#else\nsubSurfaceOut.specularEnvironmentReflectance=specularEnvironmentReflectance;\n#endif\n\n#include<pbrBlockDirectLighting>\n#include<lightFragment>[0..maxSimultaneousLights]\n\n#include<pbrBlockFinalLitComponents>\n#endif\n#include<pbrBlockFinalUnlitComponents>\n#include<pbrBlockFinalColorComposition>\n#include<logDepthFragment>\n#include<fogFragment>(color,finalColor)\n#include<pbrBlockImageProcessing>\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\ngl_FragData[PREPASS_POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef PREPASS_VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[PREPASS_VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef PREPASS_IRRADIANCE\nvec3 irradiance=finalDiffuse;\n#ifndef UNLIT\n#ifdef REFLECTION\nirradiance+=finalIrradiance;\n#endif\n#endif\nvec3 sqAlbedo=sqrt(surfaceAlbedo);\n#ifdef SS_SCATTERING\ngl_FragData[0]=vec4(finalColor.rgb-irradiance,finalColor.a);\nirradiance/=sqAlbedo;\n#else\ngl_FragData[0]=finalColor;\nfloat scatteringDiffusionProfile=255.;\n#endif\ngl_FragData[PREPASS_IRRADIANCE_INDEX]=vec4(irradiance,scatteringDiffusionProfile/255.);\n#else\ngl_FragData[0]=vec4(finalColor.rgb,finalColor.a);\n#endif\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[PREPASS_DEPTHNORMAL_INDEX]=vec4(vViewPos.z,(view*vec4(normalW,0.0)).rgb);\n#endif\n#ifdef PREPASS_ALBEDO\ngl_FragData[PREPASS_ALBEDO_INDEX]=vec4(sqAlbedo,1.0);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(REFLECTIVITY)\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(baseReflectivity.rgb,1.0);\n#else\ngl_FragData[PREPASS_REFLECTIVITY_INDEX]=vec4(0.0,0.0,0.0,1.0);\n#endif\n#endif\n#endif\n#if !defined(PREPASS) || defined(WEBGL2)\ngl_FragColor=finalColor;\n#endif\n#include<pbrDebug>\n}\n`;\n        ze.a.ShadersStore.pbrPixelShader = Gp;\n        var zp = `uniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef ALBEDO\nuniform mat4 albedoMatrix;\nuniform vec2 vAlbedoInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec4 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#ifdef REFLECTIVITY\nuniform vec3 vReflectivityInfos;\nuniform mat4 reflectivityMatrix;\n#endif\n#ifdef METALLIC_REFLECTANCE\nuniform vec2 vMetallicReflectanceInfos;\nuniform mat4 metallicReflectanceMatrix;\n#endif\n#ifdef MICROSURFACEMAP\nuniform vec2 vMicroSurfaceSamplerInfos;\nuniform mat4 microSurfaceSamplerMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\nuniform mat4 reflectionMatrix;\n#endif\n\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) || defined(CLEARCOAT_TEXTURE_ROUGHNESS)\nuniform vec4 vClearCoatInfos;\n#endif\n#ifdef CLEARCOAT_TEXTURE\nuniform mat4 clearCoatMatrix;\n#endif\n#ifdef CLEARCOAT_TEXTURE_ROUGHNESS\nuniform mat4 clearCoatRoughnessMatrix;\n#endif\n#ifdef CLEARCOAT_BUMP\nuniform vec2 vClearCoatBumpInfos;\nuniform mat4 clearCoatBumpMatrix;\n#endif\n#ifdef CLEARCOAT_TINT_TEXTURE\nuniform vec2 vClearCoatTintInfos;\nuniform mat4 clearCoatTintMatrix;\n#endif\n#endif\n\n#ifdef ANISOTROPIC\n#ifdef ANISOTROPIC_TEXTURE\nuniform vec2 vAnisotropyInfos;\nuniform mat4 anisotropyMatrix;\n#endif\n#endif\n\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) || defined(SHEEN_TEXTURE_ROUGHNESS)\nuniform vec4 vSheenInfos;\n#endif\n#ifdef SHEEN_TEXTURE\nuniform mat4 sheenMatrix;\n#endif\n#ifdef SHEEN_TEXTURE_ROUGHNESS\nuniform mat4 sheenRoughnessMatrix;\n#endif\n#endif\n\n#ifdef SUBSURFACE\n#ifdef SS_REFRACTION\nuniform vec4 vRefractionInfos;\nuniform mat4 refractionMatrix;\n#endif\n#ifdef SS_THICKNESSANDMASK_TEXTURE\nuniform vec2 vThicknessInfos;\nuniform mat4 thicknessMatrix;\n#endif\n#endif\n`;\n        ze.a.IncludesShadersStore.pbrVertexDeclaration = zp, f(163), f(164), f(93), f(94), f(100), f(165), f(156), f(158);\n        var jp = `precision highp float;\n#include<__decl__pbrVertex>\n#define CUSTOM_VERTEX_BEGIN\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nvarying vec2 vAlbedoUV;\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nvarying vec2 vDetailUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nvarying vec2 vReflectivityUV;\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nvarying vec2 vMicroSurfaceSamplerUV;\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nvarying vec2 vMetallicReflectanceUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatUV;\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 0\nvarying vec2 vClearCoatRoughnessUV;\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nvarying vec2 vClearCoatBumpUV;\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nvarying vec2 vClearCoatTintUV;\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nvarying vec2 vSheenUV;\n#endif\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 0\nvarying vec2 vSheenRoughnessUV;\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nvarying vec2 vAnisotropyUV;\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nvarying vec2 vThicknessUV;\n#endif\n#endif\n\nvarying vec3 vPositionW;\n#if DEBUGMODE>0\nvarying vec4 vClipSpacePosition;\n#endif\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvarying vec3 vEnvironmentIrradiance;\n#include<harmonicsFunctions>\n#endif\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvec3 positionUpdated=position;\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#include<prePassVertex>\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));\nvNormalW=normalize(normalWorld*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\nvec3 reflectionVector=vec3(reflectionMatrix*vec4(vNormalW,0)).xyz;\n#ifdef REFLECTIONMAP_OPPOSITEZ\nreflectionVector.z*=-1.0;\n#endif\nvEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#if DEBUGMODE>0\nvClipSpacePosition=gl_Position;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uvUpdated=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uvUpdated;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(ALBEDO) && ALBEDODIRECTUV == 0\nif (vAlbedoInfos.x == 0.)\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAlbedoUV=vec2(albedoMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(DETAIL) && DETAILDIRECTUV == 0\nif (vDetailInfos.x == 0.)\n{\nvDetailUV=vec2(detailMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvDetailUV=vec2(detailMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(REFLECTIVITY) && REFLECTIVITYDIRECTUV == 0\nif (vReflectivityInfos.x == 0.)\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(MICROSURFACEMAP) && MICROSURFACEMAPDIRECTUV == 0\nif (vMicroSurfaceSamplerInfos.x == 0.)\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMicroSurfaceSamplerUV=vec2(microSurfaceSamplerMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(METALLIC_REFLECTANCE) && METALLIC_REFLECTANCEDIRECTUV == 0\nif (vMetallicReflectanceInfos.x == 0.)\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvMetallicReflectanceUV=vec2(metallicReflectanceMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#ifdef CLEARCOAT\n#if defined(CLEARCOAT_TEXTURE) && CLEARCOAT_TEXTUREDIRECTUV == 0\nif (vClearCoatInfos.x == 0.)\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatUV=vec2(clearCoatMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TEXTURE_ROUGHNESS) && CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV == 0\nif (vClearCoatInfos.z == 0.)\n{\nvClearCoatRoughnessUV=vec2(clearCoatRoughnessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatRoughnessUV=vec2(clearCoatRoughnessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_BUMP) && CLEARCOAT_BUMPDIRECTUV == 0\nif (vClearCoatBumpInfos.x == 0.)\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatBumpUV=vec2(clearCoatBumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(CLEARCOAT_TINT_TEXTURE) && CLEARCOAT_TINT_TEXTUREDIRECTUV == 0\nif (vClearCoatTintInfos.x == 0.)\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvClearCoatTintUV=vec2(clearCoatTintMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SHEEN\n#if defined(SHEEN_TEXTURE) && SHEEN_TEXTUREDIRECTUV == 0\nif (vSheenInfos.x == 0.)\n{\nvSheenUV=vec2(sheenMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenUV=vec2(sheenMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SHEEN_TEXTURE_ROUGHNESS) && SHEEN_TEXTURE_ROUGHNESSDIRECTUV == 0\nif (vSheenInfos.z == 0.)\n{\nvSheenRoughnessUV=vec2(sheenRoughnessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvSheenRoughnessUV=vec2(sheenRoughnessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef ANISOTROPIC\n#if defined(ANISOTROPIC_TEXTURE) && ANISOTROPIC_TEXTUREDIRECTUV == 0\nif (vAnisotropyInfos.x == 0.)\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvAnisotropyUV=vec2(anisotropyMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n#ifdef SUBSURFACE\n#if defined(SS_THICKNESSANDMASK_TEXTURE) && SS_THICKNESSANDMASK_TEXTUREDIRECTUV == 0\nif (vThicknessInfos.x == 0.)\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uvUpdated,1.0,0.0));\n}\nelse\n{\nvThicknessUV=vec2(thicknessMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#endif\n\n#include<bumpVertex>\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}`;\n        ze.a.ShadersStore.pbrVertexShader = jp;\n        var Wo = f(92), vr = { effect: null, subMesh: null }, As = function(r) {\n          function t() {\n            var e = r.call(this) || this;\n            return e.PBR = !0, e.NUM_SAMPLES = \"0\", e.REALTIME_FILTERING = !1, e.MAINUV1 = !1, e.MAINUV2 = !1, e.UV1 = !1, e.UV2 = !1, e.ALBEDO = !1, e.GAMMAALBEDO = !1, e.ALBEDODIRECTUV = 0, e.VERTEXCOLOR = !1, e.DETAIL = !1, e.DETAILDIRECTUV = 0, e.DETAIL_NORMALBLENDMETHOD = 0, e.AMBIENT = !1, e.AMBIENTDIRECTUV = 0, e.AMBIENTINGRAYSCALE = !1, e.OPACITY = !1, e.VERTEXALPHA = !1, e.OPACITYDIRECTUV = 0, e.OPACITYRGB = !1, e.ALPHATEST = !1, e.DEPTHPREPASS = !1, e.ALPHABLEND = !1, e.ALPHAFROMALBEDO = !1, e.ALPHATESTVALUE = \"0.5\", e.SPECULAROVERALPHA = !1, e.RADIANCEOVERALPHA = !1, e.ALPHAFRESNEL = !1, e.LINEARALPHAFRESNEL = !1, e.PREMULTIPLYALPHA = !1, e.EMISSIVE = !1, e.EMISSIVEDIRECTUV = 0, e.REFLECTIVITY = !1, e.REFLECTIVITYDIRECTUV = 0, e.SPECULARTERM = !1, e.MICROSURFACEFROMREFLECTIVITYMAP = !1, e.MICROSURFACEAUTOMATIC = !1, e.LODBASEDMICROSFURACE = !1, e.MICROSURFACEMAP = !1, e.MICROSURFACEMAPDIRECTUV = 0, e.METALLICWORKFLOW = !1, e.ROUGHNESSSTOREINMETALMAPALPHA = !1, e.ROUGHNESSSTOREINMETALMAPGREEN = !1, e.METALLNESSSTOREINMETALMAPBLUE = !1, e.AOSTOREINMETALMAPRED = !1, e.METALLIC_REFLECTANCE = !1, e.METALLIC_REFLECTANCEDIRECTUV = 0, e.ENVIRONMENTBRDF = !1, e.ENVIRONMENTBRDF_RGBD = !1, e.NORMAL = !1, e.TANGENT = !1, e.BUMP = !1, e.BUMPDIRECTUV = 0, e.OBJECTSPACE_NORMALMAP = !1, e.PARALLAX = !1, e.PARALLAXOCCLUSION = !1, e.NORMALXYSCALE = !0, e.LIGHTMAP = !1, e.LIGHTMAPDIRECTUV = 0, e.USELIGHTMAPASSHADOWMAP = !1, e.GAMMALIGHTMAP = !1, e.RGBDLIGHTMAP = !1, e.REFLECTION = !1, e.REFLECTIONMAP_3D = !1, e.REFLECTIONMAP_SPHERICAL = !1, e.REFLECTIONMAP_PLANAR = !1, e.REFLECTIONMAP_CUBIC = !1, e.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, e.REFLECTIONMAP_PROJECTION = !1, e.REFLECTIONMAP_SKYBOX = !1, e.REFLECTIONMAP_EXPLICIT = !1, e.REFLECTIONMAP_EQUIRECTANGULAR = !1, e.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, e.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, e.INVERTCUBICMAP = !1, e.USESPHERICALFROMREFLECTIONMAP = !1, e.USEIRRADIANCEMAP = !1, e.SPHERICAL_HARMONICS = !1, e.USESPHERICALINVERTEX = !1, e.REFLECTIONMAP_OPPOSITEZ = !1, e.LODINREFLECTIONALPHA = !1, e.GAMMAREFLECTION = !1, e.RGBDREFLECTION = !1, e.LINEARSPECULARREFLECTION = !1, e.RADIANCEOCCLUSION = !1, e.HORIZONOCCLUSION = !1, e.INSTANCES = !1, e.THIN_INSTANCES = !1, e.PREPASS = !1, e.PREPASS_IRRADIANCE = !1, e.PREPASS_IRRADIANCE_INDEX = -1, e.PREPASS_ALBEDO = !1, e.PREPASS_ALBEDO_INDEX = -1, e.PREPASS_DEPTHNORMAL = !1, e.PREPASS_DEPTHNORMAL_INDEX = -1, e.PREPASS_POSITION = !1, e.PREPASS_POSITION_INDEX = -1, e.PREPASS_VELOCITY = !1, e.PREPASS_VELOCITY_INDEX = -1, e.PREPASS_REFLECTIVITY = !1, e.PREPASS_REFLECTIVITY_INDEX = -1, e.SCENE_MRT_COUNT = 0, e.NUM_BONE_INFLUENCERS = 0, e.BonesPerMesh = 0, e.BONETEXTURE = !1, e.BONES_VELOCITY_ENABLED = !1, e.NONUNIFORMSCALING = !1, e.MORPHTARGETS = !1, e.MORPHTARGETS_NORMAL = !1, e.MORPHTARGETS_TANGENT = !1, e.MORPHTARGETS_UV = !1, e.NUM_MORPH_INFLUENCERS = 0, e.IMAGEPROCESSING = !1, e.VIGNETTE = !1, e.VIGNETTEBLENDMODEMULTIPLY = !1, e.VIGNETTEBLENDMODEOPAQUE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = !1, e.SAMPLER3DBGRMAP = !1, e.IMAGEPROCESSINGPOSTPROCESS = !1, e.EXPOSURE = !1, e.MULTIVIEW = !1, e.USEPHYSICALLIGHTFALLOFF = !1, e.USEGLTFLIGHTFALLOFF = !1, e.TWOSIDEDLIGHTING = !1, e.SHADOWFLOAT = !1, e.CLIPPLANE = !1, e.CLIPPLANE2 = !1, e.CLIPPLANE3 = !1, e.CLIPPLANE4 = !1, e.CLIPPLANE5 = !1, e.CLIPPLANE6 = !1, e.POINTSIZE = !1, e.FOG = !1, e.LOGARITHMICDEPTH = !1, e.FORCENORMALFORWARD = !1, e.SPECULARAA = !1, e.CLEARCOAT = !1, e.CLEARCOAT_DEFAULTIOR = !1, e.CLEARCOAT_TEXTURE = !1, e.CLEARCOAT_TEXTURE_ROUGHNESS = !1, e.CLEARCOAT_TEXTUREDIRECTUV = 0, e.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV = 0, e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, e.CLEARCOAT_TEXTURE_ROUGHNESS_IDENTICAL = !1, e.CLEARCOAT_BUMP = !1, e.CLEARCOAT_BUMPDIRECTUV = 0, e.CLEARCOAT_REMAP_F0 = !0, e.CLEARCOAT_TINT = !1, e.CLEARCOAT_TINT_TEXTURE = !1, e.CLEARCOAT_TINT_TEXTUREDIRECTUV = 0, e.ANISOTROPIC = !1, e.ANISOTROPIC_TEXTURE = !1, e.ANISOTROPIC_TEXTUREDIRECTUV = 0, e.BRDF_V_HEIGHT_CORRELATED = !1, e.MS_BRDF_ENERGY_CONSERVATION = !1, e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION = !1, e.SHEEN = !1, e.SHEEN_TEXTURE = !1, e.SHEEN_TEXTURE_ROUGHNESS = !1, e.SHEEN_TEXTUREDIRECTUV = 0, e.SHEEN_TEXTURE_ROUGHNESSDIRECTUV = 0, e.SHEEN_LINKWITHALBEDO = !1, e.SHEEN_ROUGHNESS = !1, e.SHEEN_ALBEDOSCALING = !1, e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE = !1, e.SHEEN_TEXTURE_ROUGHNESS_IDENTICAL = !1, e.SUBSURFACE = !1, e.SS_REFRACTION = !1, e.SS_TRANSLUCENCY = !1, e.SS_SCATTERING = !1, e.SS_THICKNESSANDMASK_TEXTURE = !1, e.SS_THICKNESSANDMASK_TEXTUREDIRECTUV = 0, e.SS_REFRACTIONMAP_3D = !1, e.SS_REFRACTIONMAP_OPPOSITEZ = !1, e.SS_LODINREFRACTIONALPHA = !1, e.SS_GAMMAREFRACTION = !1, e.SS_RGBDREFRACTION = !1, e.SS_LINEARSPECULARREFRACTION = !1, e.SS_LINKREFRACTIONTOTRANSPARENCY = !1, e.SS_ALBEDOFORREFRACTIONTINT = !1, e.SS_MASK_FROM_THICKNESS_TEXTURE = !1, e.SS_MASK_FROM_THICKNESS_TEXTURE_GLTF = !1, e.UNLIT = !1, e.DEBUGMODE = 0, e.rebuild(), e;\n          }\n          return Object(c.d)(t, r), t.prototype.reset = function() {\n            r.prototype.reset.call(this), this.ALPHATESTVALUE = \"0.5\", this.PBR = !0;\n          }, t;\n        }(zo.a), pn = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i._directIntensity = 1, i._emissiveIntensity = 1, i._environmentIntensity = 1, i._specularIntensity = 1, i._lightingInfos = new u.f(i._directIntensity, i._emissiveIntensity, i._environmentIntensity, i._specularIntensity), i._disableBumpMap = !1, i._albedoTexture = null, i._ambientTexture = null, i._ambientTextureStrength = 1, i._ambientTextureImpactOnAnalyticalLights = t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, i._opacityTexture = null, i._reflectionTexture = null, i._emissiveTexture = null, i._reflectivityTexture = null, i._metallicTexture = null, i._metallic = null, i._roughness = null, i._metallicF0Factor = 1, i._metallicReflectanceColor = I.a.White(), i._metallicReflectanceTexture = null, i._microSurfaceTexture = null, i._bumpTexture = null, i._lightmapTexture = null, i._ambientColor = new I.a(0, 0, 0), i._albedoColor = new I.a(1, 1, 1), i._reflectivityColor = new I.a(1, 1, 1), i._reflectionColor = new I.a(1, 1, 1), i._emissiveColor = new I.a(0, 0, 0), i._microSurface = 0.9, i._useLightmapAsShadowmap = !1, i._useHorizonOcclusion = !0, i._useRadianceOcclusion = !0, i._useAlphaFromAlbedoTexture = !1, i._useSpecularOverAlpha = !0, i._useMicroSurfaceFromReflectivityMapAlpha = !1, i._useRoughnessFromMetallicTextureAlpha = !0, i._useRoughnessFromMetallicTextureGreen = !1, i._useMetallnessFromMetallicTextureBlue = !1, i._useAmbientOcclusionFromMetallicTextureRed = !1, i._useAmbientInGrayScale = !1, i._useAutoMicroSurfaceFromReflectivityMap = !1, i._lightFalloff = t.LIGHTFALLOFF_PHYSICAL, i._useRadianceOverAlpha = !0, i._useObjectSpaceNormalMap = !1, i._useParallax = !1, i._useParallaxOcclusion = !1, i._parallaxScaleBias = 0.05, i._disableLighting = !1, i._maxSimultaneousLights = 4, i._invertNormalMapX = !1, i._invertNormalMapY = !1, i._twoSidedLighting = !1, i._alphaCutOff = 0.4, i._forceAlphaTest = !1, i._useAlphaFresnel = !1, i._useLinearAlphaFresnel = !1, i._environmentBRDFTexture = null, i._forceIrradianceInFragment = !1, i._realTimeFiltering = !1, i._realTimeFilteringQuality = h.a.TEXTURE_FILTERING_QUALITY_LOW, i._forceNormalForward = !1, i._enableSpecularAntiAliasing = !1, i._imageProcessingObserver = null, i._renderTargets = new si.a(16), i._globalAmbientColor = new I.a(0, 0, 0), i._useLogarithmicDepth = !1, i._unlit = !1, i._debugMode = 0, i.debugMode = 0, i.debugLimit = -1, i.debugFactor = 1, i.clearCoat = new mr(i._markAllSubMeshesAsTexturesDirty.bind(i)), i.anisotropy = new gr(i._markAllSubMeshesAsTexturesDirty.bind(i)), i.brdf = new ap(i._markAllSubMeshesAsMiscDirty.bind(i)), i.sheen = new Zr(i._markAllSubMeshesAsTexturesDirty.bind(i)), i.detailMap = new Wo.a(i._markAllSubMeshesAsTexturesDirty.bind(i)), i._rebuildInParallel = !1, i._attachImageProcessingConfiguration(null), i.getRenderTargetTextures = function() {\n              return i._renderTargets.reset(), lt.a.ReflectionTextureEnabled && i._reflectionTexture && i._reflectionTexture.isRenderTarget && i._renderTargets.push(i._reflectionTexture), i.subSurface.fillRenderTargetTextures(i._renderTargets), i._renderTargets;\n            }, i._environmentBRDFTexture = Ho.GetEnvironmentBRDFTexture(n), i.subSurface = new Jr(i._markAllSubMeshesAsTexturesDirty.bind(i), i._markScenePrePassDirty.bind(i), n), i.prePassConfiguration = new Ss.a(), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"realTimeFiltering\", { get: function() {\n            return this._realTimeFiltering;\n          }, set: function(e) {\n            this._realTimeFiltering = e, this.markAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"realTimeFilteringQuality\", { get: function() {\n            return this._realTimeFilteringQuality;\n          }, set: function(e) {\n            this._realTimeFilteringQuality = e, this.markAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"canRenderToMRT\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), t.prototype._attachImageProcessingConfiguration = function(e) {\n            var n = this;\n            e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              n._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, Object.defineProperty(t.prototype, \"hasRenderTargetTextures\", { get: function() {\n            return !!(lt.a.ReflectionTextureEnabled && this._reflectionTexture && this._reflectionTexture.isRenderTarget) || this.subSurface.hasRenderTargetTextures();\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PBRBaseMaterial\";\n          }, Object.defineProperty(t.prototype, \"useLogarithmicDepth\", { get: function() {\n            return this._useLogarithmicDepth;\n          }, set: function(e) {\n            this._useLogarithmicDepth = e && this.getScene().getEngine().getCaps().fragmentDepthSupported;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"_disableAlphaBlending\", { get: function() {\n            return this.subSurface.disableAlphaBlending || this._transparencyMode === t.PBRMATERIAL_OPAQUE || this._transparencyMode === t.PBRMATERIAL_ALPHATEST;\n          }, enumerable: !1, configurable: !0 }), t.prototype.needAlphaBlending = function() {\n            return !this._disableAlphaBlending && (this.alpha < 1 || this._opacityTexture != null || this._shouldUseAlphaFromAlbedoTexture());\n          }, t.prototype.needAlphaTesting = function() {\n            return !!this._forceAlphaTest || !this.subSurface.disableAlphaBlending && this._hasAlphaChannel() && (this._transparencyMode == null || this._transparencyMode === t.PBRMATERIAL_ALPHATEST);\n          }, t.prototype._shouldUseAlphaFromAlbedoTexture = function() {\n            return this._albedoTexture != null && this._albedoTexture.hasAlpha && this._useAlphaFromAlbedoTexture && this._transparencyMode !== t.PBRMATERIAL_OPAQUE;\n          }, t.prototype._hasAlphaChannel = function() {\n            return this._albedoTexture != null && this._albedoTexture.hasAlpha || this._opacityTexture != null;\n          }, t.prototype.getAlphaTestTexture = function() {\n            return this._albedoTexture;\n          }, t.prototype.isReadyForSubMesh = function(e, n, i) {\n            if (n.effect && this.isFrozen && n.effect._wasPreviouslyReady)\n              return !0;\n            n._materialDefines || (n._materialDefines = new As());\n            var o = n._materialDefines;\n            if (this._isReadyForSubMesh(n))\n              return !0;\n            var a = this.getScene(), s = a.getEngine();\n            if (o._areTexturesDirty && a.texturesEnabled) {\n              if (this._albedoTexture && lt.a.DiffuseTextureEnabled && !this._albedoTexture.isReadyOrNotBlocking() || this._ambientTexture && lt.a.AmbientTextureEnabled && !this._ambientTexture.isReadyOrNotBlocking() || this._opacityTexture && lt.a.OpacityTextureEnabled && !this._opacityTexture.isReadyOrNotBlocking())\n                return !1;\n              var d = this._getReflectionTexture();\n              if (d && lt.a.ReflectionTextureEnabled && (!d.isReadyOrNotBlocking() || d.irradianceTexture && !d.irradianceTexture.isReadyOrNotBlocking()) || this._lightmapTexture && lt.a.LightmapTextureEnabled && !this._lightmapTexture.isReadyOrNotBlocking() || this._emissiveTexture && lt.a.EmissiveTextureEnabled && !this._emissiveTexture.isReadyOrNotBlocking())\n                return !1;\n              if (lt.a.SpecularTextureEnabled) {\n                if (this._metallicTexture) {\n                  if (!this._metallicTexture.isReadyOrNotBlocking())\n                    return !1;\n                } else if (this._reflectivityTexture && !this._reflectivityTexture.isReadyOrNotBlocking())\n                  return !1;\n                if (this._metallicReflectanceTexture && !this._metallicReflectanceTexture.isReadyOrNotBlocking() || this._microSurfaceTexture && !this._microSurfaceTexture.isReadyOrNotBlocking())\n                  return !1;\n              }\n              if (s.getCaps().standardDerivatives && this._bumpTexture && lt.a.BumpTextureEnabled && !this._disableBumpMap && !this._bumpTexture.isReady() || this._environmentBRDFTexture && lt.a.ReflectionTextureEnabled && !this._environmentBRDFTexture.isReady())\n                return !1;\n            }\n            if (!(this.subSurface.isReadyForSubMesh(o, a) && this.clearCoat.isReadyForSubMesh(o, a, s, this._disableBumpMap) && this.sheen.isReadyForSubMesh(o, a) && this.anisotropy.isReadyForSubMesh(o, a) && this.detailMap.isReadyForSubMesh(o, a)) || o._areImageProcessingDirty && this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady())\n              return !1;\n            s.getCaps().standardDerivatives || e.isVerticesDataPresent(Oe.b.NormalKind) || (e.createNormals(!0), l.a.Warn(\"PBRMaterial: Normals have been created for the mesh: \" + e.name));\n            var p = n.effect, y = o._areLightsDisposed, P = this._prepareEffect(e, o, this.onCompiled, this.onError, i, null, n.getRenderingMesh().hasThinInstances);\n            if (P)\n              if (this._onEffectCreatedObservable && (vr.effect = P, vr.subMesh = n, this._onEffectCreatedObservable.notifyObservers(vr)), this.allowShaderHotSwapping && p && !P.isReady()) {\n                if (P = p, this._rebuildInParallel = !0, o.markAsUnprocessed(), y)\n                  return o._areLightsDisposed = !0, !1;\n              } else\n                this._rebuildInParallel = !1, a.resetCachedMaterial(), n.setEffect(P, o), this.buildUniformLayout();\n            return !(!n.effect || !n.effect.isReady()) && (o._renderId = a.getRenderId(), n.effect._wasPreviouslyReady = !0, !0);\n          }, t.prototype.isMetallicWorkflow = function() {\n            return !(this._metallic == null && this._roughness == null && !this._metallicTexture);\n          }, t.prototype._prepareEffect = function(e, n, i, o, a, s, d) {\n            if (i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), this._prepareDefines(e, n, a, s, d), !n.isDirty)\n              return null;\n            n.markAsProcessed();\n            var p = this.getScene().getEngine(), y = new _r.a(), P = 0;\n            n.USESPHERICALINVERTEX && y.addFallback(P++, \"USESPHERICALINVERTEX\"), n.FOG && y.addFallback(P, \"FOG\"), n.SPECULARAA && y.addFallback(P, \"SPECULARAA\"), n.POINTSIZE && y.addFallback(P, \"POINTSIZE\"), n.LOGARITHMICDEPTH && y.addFallback(P, \"LOGARITHMICDEPTH\"), n.PARALLAX && y.addFallback(P, \"PARALLAX\"), n.PARALLAXOCCLUSION && y.addFallback(P++, \"PARALLAXOCCLUSION\"), P = gr.AddFallbacks(n, y, P), P = gr.AddFallbacks(n, y, P), P = Jr.AddFallbacks(n, y, P), P = Zr.AddFallbacks(n, y, P), n.ENVIRONMENTBRDF && y.addFallback(P++, \"ENVIRONMENTBRDF\"), n.TANGENT && y.addFallback(P++, \"TANGENT\"), n.BUMP && y.addFallback(P++, \"BUMP\"), P = $e.a.HandleFallbacksForShadows(n, y, this._maxSimultaneousLights, P++), n.SPECULARTERM && y.addFallback(P++, \"SPECULARTERM\"), n.USESPHERICALFROMREFLECTIONMAP && y.addFallback(P++, \"USESPHERICALFROMREFLECTIONMAP\"), n.USEIRRADIANCEMAP && y.addFallback(P++, \"USEIRRADIANCEMAP\"), n.LIGHTMAP && y.addFallback(P++, \"LIGHTMAP\"), n.NORMAL && y.addFallback(P++, \"NORMAL\"), n.AMBIENT && y.addFallback(P++, \"AMBIENT\"), n.EMISSIVE && y.addFallback(P++, \"EMISSIVE\"), n.VERTEXCOLOR && y.addFallback(P++, \"VERTEXCOLOR\"), n.MORPHTARGETS && y.addFallback(P++, \"MORPHTARGETS\"), n.MULTIVIEW && y.addFallback(0, \"MULTIVIEW\");\n            var R = [Oe.b.PositionKind];\n            n.NORMAL && R.push(Oe.b.NormalKind), n.TANGENT && R.push(Oe.b.TangentKind), n.UV1 && R.push(Oe.b.UVKind), n.UV2 && R.push(Oe.b.UV2Kind), n.VERTEXCOLOR && R.push(Oe.b.ColorKind), $e.a.PrepareAttributesForBones(R, e, n, y), $e.a.PrepareAttributesForInstances(R, n), $e.a.PrepareAttributesForMorphTargets(R, e, n);\n            var B = \"pbr\", F = [\"world\", \"view\", \"viewProjection\", \"vEyePosition\", \"vLightsType\", \"vAmbientColor\", \"vAlbedoColor\", \"vReflectivityColor\", \"vMetallicReflectanceFactors\", \"vEmissiveColor\", \"visibility\", \"vReflectionColor\", \"vFogInfos\", \"vFogColor\", \"pointSize\", \"vAlbedoInfos\", \"vAmbientInfos\", \"vOpacityInfos\", \"vReflectionInfos\", \"vReflectionPosition\", \"vReflectionSize\", \"vEmissiveInfos\", \"vReflectivityInfos\", \"vReflectionFilteringInfo\", \"vMetallicReflectanceInfos\", \"vMicroSurfaceSamplerInfos\", \"vBumpInfos\", \"vLightmapInfos\", \"mBones\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"albedoMatrix\", \"ambientMatrix\", \"opacityMatrix\", \"reflectionMatrix\", \"emissiveMatrix\", \"reflectivityMatrix\", \"normalMatrix\", \"microSurfaceSamplerMatrix\", \"bumpMatrix\", \"lightmapMatrix\", \"metallicReflectanceMatrix\", \"vLightingIntensity\", \"logarithmicDepthConstant\", \"vSphericalX\", \"vSphericalY\", \"vSphericalZ\", \"vSphericalXX_ZZ\", \"vSphericalYY_ZZ\", \"vSphericalZZ\", \"vSphericalXY\", \"vSphericalYZ\", \"vSphericalZX\", \"vSphericalL00\", \"vSphericalL1_1\", \"vSphericalL10\", \"vSphericalL11\", \"vSphericalL2_2\", \"vSphericalL2_1\", \"vSphericalL20\", \"vSphericalL21\", \"vSphericalL22\", \"vReflectionMicrosurfaceInfos\", \"vTangentSpaceParams\", \"boneTextureWidth\", \"vDebugMode\"], z = [\"albedoSampler\", \"reflectivitySampler\", \"ambientSampler\", \"emissiveSampler\", \"bumpSampler\", \"lightmapSampler\", \"opacitySampler\", \"reflectionSampler\", \"reflectionSamplerLow\", \"reflectionSamplerHigh\", \"irradianceSampler\", \"microSurfaceSampler\", \"environmentBrdfSampler\", \"boneSampler\", \"metallicReflectanceSampler\"], J = [\"Material\", \"Scene\"];\n            Wo.a.AddUniforms(F), Wo.a.AddSamplers(z), Jr.AddUniforms(F), Jr.AddSamplers(z), mr.AddUniforms(F), mr.AddSamplers(z), gr.AddUniforms(F), gr.AddSamplers(z), Zr.AddUniforms(F), Zr.AddSamplers(z), Ss.a.AddUniforms(F), Ss.a.AddSamplers(F), vn.a && (vn.a.PrepareUniforms(F, n), vn.a.PrepareSamplers(z, n)), $e.a.PrepareUniformsAndSamplersList({ uniformsNames: F, uniformBuffersNames: J, samplers: z, defines: n, maxSimultaneousLights: this._maxSimultaneousLights });\n            var ie = {};\n            this.customShaderNameResolve && (B = this.customShaderNameResolve(B, F, J, z, n, R, ie));\n            var se = n.toString();\n            return p.createEffect(B, { attributes: R, uniformsNames: F, uniformBuffersNames: J, samplers: z, defines: se, fallbacks: y, onCompiled: i, onError: o, indexParameters: { maxSimultaneousLights: this._maxSimultaneousLights, maxSimultaneousMorphTargets: n.NUM_MORPH_INFLUENCERS }, processFinalCode: ie.processFinalCode, multiTarget: n.PREPASS }, p);\n          }, t.prototype._prepareDefines = function(e, n, i, o, a) {\n            i === void 0 && (i = null), o === void 0 && (o = null), a === void 0 && (a = !1);\n            var s = this.getScene(), d = s.getEngine();\n            if ($e.a.PrepareDefinesForLights(s, e, n, !0, this._maxSimultaneousLights, this._disableLighting), n._needNormals = !0, $e.a.PrepareDefinesForMultiview(s, n), $e.a.PrepareDefinesForPrePass(s, n, this.canRenderToMRT), n.METALLICWORKFLOW = this.isMetallicWorkflow(), n._areTexturesDirty) {\n              if (n._needUVs = !1, s.texturesEnabled) {\n                s.getEngine().getCaps().textureLOD && (n.LODBASEDMICROSFURACE = !0), this._albedoTexture && lt.a.DiffuseTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._albedoTexture, n, \"ALBEDO\"), n.GAMMAALBEDO = this._albedoTexture.gammaSpace) : n.ALBEDO = !1, this._ambientTexture && lt.a.AmbientTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._ambientTexture, n, \"AMBIENT\"), n.AMBIENTINGRAYSCALE = this._useAmbientInGrayScale) : n.AMBIENT = !1, this._opacityTexture && lt.a.OpacityTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._opacityTexture, n, \"OPACITY\"), n.OPACITYRGB = this._opacityTexture.getAlphaFromRGB) : n.OPACITY = !1;\n                var p = this._getReflectionTexture();\n                if (p && lt.a.ReflectionTextureEnabled) {\n                  switch (n.REFLECTION = !0, n.GAMMAREFLECTION = p.gammaSpace, n.RGBDREFLECTION = p.isRGBD, n.REFLECTIONMAP_OPPOSITEZ = this.getScene().useRightHandedSystem ? !p.invertZ : p.invertZ, n.LODINREFLECTIONALPHA = p.lodLevelInAlpha, n.LINEARSPECULARREFLECTION = p.linearSpecularLOD, this.realTimeFiltering && this.realTimeFilteringQuality > 0 ? (n.NUM_SAMPLES = \"\" + this.realTimeFilteringQuality, d.webGLVersion > 1 && (n.NUM_SAMPLES = n.NUM_SAMPLES + \"u\"), n.REALTIME_FILTERING = !0) : n.REALTIME_FILTERING = !1, p.coordinatesMode === Ne.a.INVCUBIC_MODE && (n.INVERTCUBICMAP = !0), n.REFLECTIONMAP_3D = p.isCube, n.REFLECTIONMAP_CUBIC = !1, n.REFLECTIONMAP_EXPLICIT = !1, n.REFLECTIONMAP_PLANAR = !1, n.REFLECTIONMAP_PROJECTION = !1, n.REFLECTIONMAP_SKYBOX = !1, n.REFLECTIONMAP_SPHERICAL = !1, n.REFLECTIONMAP_EQUIRECTANGULAR = !1, n.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, n.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, p.coordinatesMode) {\n                    case Ne.a.EXPLICIT_MODE:\n                      n.REFLECTIONMAP_EXPLICIT = !0;\n                      break;\n                    case Ne.a.PLANAR_MODE:\n                      n.REFLECTIONMAP_PLANAR = !0;\n                      break;\n                    case Ne.a.PROJECTION_MODE:\n                      n.REFLECTIONMAP_PROJECTION = !0;\n                      break;\n                    case Ne.a.SKYBOX_MODE:\n                      n.REFLECTIONMAP_SKYBOX = !0;\n                      break;\n                    case Ne.a.SPHERICAL_MODE:\n                      n.REFLECTIONMAP_SPHERICAL = !0;\n                      break;\n                    case Ne.a.EQUIRECTANGULAR_MODE:\n                      n.REFLECTIONMAP_EQUIRECTANGULAR = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MODE:\n                      n.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.FIXED_EQUIRECTANGULAR_MIRRORED_MODE:\n                      n.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !0;\n                      break;\n                    case Ne.a.CUBIC_MODE:\n                    case Ne.a.INVCUBIC_MODE:\n                    default:\n                      n.REFLECTIONMAP_CUBIC = !0, n.USE_LOCAL_REFLECTIONMAP_CUBIC = !!p.boundingBoxSize;\n                  }\n                  p.coordinatesMode !== Ne.a.SKYBOX_MODE && (p.irradianceTexture ? (n.USEIRRADIANCEMAP = !0, n.USESPHERICALFROMREFLECTIONMAP = !1) : p.isCube && (n.USESPHERICALFROMREFLECTIONMAP = !0, n.USEIRRADIANCEMAP = !1, this._forceIrradianceInFragment || this.realTimeFiltering || s.getEngine().getCaps().maxVaryingVectors <= 8 ? n.USESPHERICALINVERTEX = !1 : n.USESPHERICALINVERTEX = !0));\n                } else\n                  n.REFLECTION = !1, n.REFLECTIONMAP_3D = !1, n.REFLECTIONMAP_SPHERICAL = !1, n.REFLECTIONMAP_PLANAR = !1, n.REFLECTIONMAP_CUBIC = !1, n.USE_LOCAL_REFLECTIONMAP_CUBIC = !1, n.REFLECTIONMAP_PROJECTION = !1, n.REFLECTIONMAP_SKYBOX = !1, n.REFLECTIONMAP_EXPLICIT = !1, n.REFLECTIONMAP_EQUIRECTANGULAR = !1, n.REFLECTIONMAP_EQUIRECTANGULAR_FIXED = !1, n.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED = !1, n.INVERTCUBICMAP = !1, n.USESPHERICALFROMREFLECTIONMAP = !1, n.USEIRRADIANCEMAP = !1, n.USESPHERICALINVERTEX = !1, n.REFLECTIONMAP_OPPOSITEZ = !1, n.LODINREFLECTIONALPHA = !1, n.GAMMAREFLECTION = !1, n.RGBDREFLECTION = !1, n.LINEARSPECULARREFLECTION = !1;\n                this._lightmapTexture && lt.a.LightmapTextureEnabled ? ($e.a.PrepareDefinesForMergedUV(this._lightmapTexture, n, \"LIGHTMAP\"), n.USELIGHTMAPASSHADOWMAP = this._useLightmapAsShadowmap, n.GAMMALIGHTMAP = this._lightmapTexture.gammaSpace, n.RGBDLIGHTMAP = this._lightmapTexture.isRGBD) : n.LIGHTMAP = !1, this._emissiveTexture && lt.a.EmissiveTextureEnabled ? $e.a.PrepareDefinesForMergedUV(this._emissiveTexture, n, \"EMISSIVE\") : n.EMISSIVE = !1, lt.a.SpecularTextureEnabled ? (this._metallicTexture ? ($e.a.PrepareDefinesForMergedUV(this._metallicTexture, n, \"REFLECTIVITY\"), n.ROUGHNESSSTOREINMETALMAPALPHA = this._useRoughnessFromMetallicTextureAlpha, n.ROUGHNESSSTOREINMETALMAPGREEN = !this._useRoughnessFromMetallicTextureAlpha && this._useRoughnessFromMetallicTextureGreen, n.METALLNESSSTOREINMETALMAPBLUE = this._useMetallnessFromMetallicTextureBlue, n.AOSTOREINMETALMAPRED = this._useAmbientOcclusionFromMetallicTextureRed) : this._reflectivityTexture ? ($e.a.PrepareDefinesForMergedUV(this._reflectivityTexture, n, \"REFLECTIVITY\"), n.MICROSURFACEFROMREFLECTIVITYMAP = this._useMicroSurfaceFromReflectivityMapAlpha, n.MICROSURFACEAUTOMATIC = this._useAutoMicroSurfaceFromReflectivityMap) : n.REFLECTIVITY = !1, this._metallicReflectanceTexture ? $e.a.PrepareDefinesForMergedUV(this._metallicReflectanceTexture, n, \"METALLIC_REFLECTANCE\") : n.METALLIC_REFLECTANCE = !1, this._microSurfaceTexture ? $e.a.PrepareDefinesForMergedUV(this._microSurfaceTexture, n, \"MICROSURFACEMAP\") : n.MICROSURFACEMAP = !1) : (n.REFLECTIVITY = !1, n.MICROSURFACEMAP = !1), s.getEngine().getCaps().standardDerivatives && this._bumpTexture && lt.a.BumpTextureEnabled && !this._disableBumpMap ? ($e.a.PrepareDefinesForMergedUV(this._bumpTexture, n, \"BUMP\"), this._useParallax && this._albedoTexture && lt.a.DiffuseTextureEnabled ? (n.PARALLAX = !0, n.PARALLAXOCCLUSION = !!this._useParallaxOcclusion) : n.PARALLAX = !1, n.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap) : n.BUMP = !1, this._environmentBRDFTexture && lt.a.ReflectionTextureEnabled ? (n.ENVIRONMENTBRDF = !0, n.ENVIRONMENTBRDF_RGBD = this._environmentBRDFTexture.isRGBD) : (n.ENVIRONMENTBRDF = !1, n.ENVIRONMENTBRDF_RGBD = !1), this._shouldUseAlphaFromAlbedoTexture() ? n.ALPHAFROMALBEDO = !0 : n.ALPHAFROMALBEDO = !1;\n              }\n              n.SPECULAROVERALPHA = this._useSpecularOverAlpha, this._lightFalloff === t.LIGHTFALLOFF_STANDARD ? (n.USEPHYSICALLIGHTFALLOFF = !1, n.USEGLTFLIGHTFALLOFF = !1) : this._lightFalloff === t.LIGHTFALLOFF_GLTF ? (n.USEPHYSICALLIGHTFALLOFF = !1, n.USEGLTFLIGHTFALLOFF = !0) : (n.USEPHYSICALLIGHTFALLOFF = !0, n.USEGLTFLIGHTFALLOFF = !1), n.RADIANCEOVERALPHA = this._useRadianceOverAlpha, !this.backFaceCulling && this._twoSidedLighting ? n.TWOSIDEDLIGHTING = !0 : n.TWOSIDEDLIGHTING = !1, n.SPECULARAA = s.getEngine().getCaps().standardDerivatives && this._enableSpecularAntiAliasing;\n            }\n            (n._areTexturesDirty || n._areMiscDirty) && (n.ALPHATESTVALUE = this._alphaCutOff + (this._alphaCutOff % 1 == 0 ? \".\" : \"\"), n.PREMULTIPLYALPHA = this.alphaMode === h.a.ALPHA_PREMULTIPLIED || this.alphaMode === h.a.ALPHA_PREMULTIPLIED_PORTERDUFF, n.ALPHABLEND = this.needAlphaBlendingForMesh(e), n.ALPHAFRESNEL = this._useAlphaFresnel || this._useLinearAlphaFresnel, n.LINEARALPHAFRESNEL = this._useLinearAlphaFresnel), n._areImageProcessingDirty && this._imageProcessingConfiguration && this._imageProcessingConfiguration.prepareDefines(n), n.FORCENORMALFORWARD = this._forceNormalForward, n.RADIANCEOCCLUSION = this._useRadianceOcclusion, n.HORIZONOCCLUSION = this._useHorizonOcclusion, n._areMiscDirty && ($e.a.PrepareDefinesForMisc(e, s, this._useLogarithmicDepth, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(e) || this._forceAlphaTest, n), n.UNLIT = this._unlit || (this.pointsCloud || this.wireframe) && !e.isVerticesDataPresent(Oe.b.NormalKind), n.DEBUGMODE = this._debugMode), this.detailMap.prepareDefines(n, s), this.subSurface.prepareDefines(n, s), this.clearCoat.prepareDefines(n, s), this.anisotropy.prepareDefines(n, e, s), this.brdf.prepareDefines(n), this.sheen.prepareDefines(n, s), $e.a.PrepareDefinesForFrameBoundValues(s, d, n, !!i, o, a), $e.a.PrepareDefinesForAttributes(e, n, !0, !0, !0, this._transparencyMode !== t.PBRMATERIAL_OPAQUE);\n          }, t.prototype.forceCompilation = function(e, n, i) {\n            var o = this, a = Object(c.a)({ clipPlane: !1, useInstances: !1 }, i), s = new As(), d = this._prepareEffect(e, s, void 0, void 0, a.useInstances, a.clipPlane, e.hasThinInstances);\n            this._onEffectCreatedObservable && (vr.effect = d, vr.subMesh = null, this._onEffectCreatedObservable.notifyObservers(vr)), d.isReady() ? n && n(this) : d.onCompileObservable.add(function() {\n              n && n(o);\n            });\n          }, t.prototype.buildUniformLayout = function() {\n            var e = this._uniformBuffer;\n            e.addUniform(\"vAlbedoInfos\", 2), e.addUniform(\"vAmbientInfos\", 4), e.addUniform(\"vOpacityInfos\", 2), e.addUniform(\"vEmissiveInfos\", 2), e.addUniform(\"vLightmapInfos\", 2), e.addUniform(\"vReflectivityInfos\", 3), e.addUniform(\"vMicroSurfaceSamplerInfos\", 2), e.addUniform(\"vReflectionInfos\", 2), e.addUniform(\"vReflectionFilteringInfo\", 2), e.addUniform(\"vReflectionPosition\", 3), e.addUniform(\"vReflectionSize\", 3), e.addUniform(\"vBumpInfos\", 3), e.addUniform(\"albedoMatrix\", 16), e.addUniform(\"ambientMatrix\", 16), e.addUniform(\"opacityMatrix\", 16), e.addUniform(\"emissiveMatrix\", 16), e.addUniform(\"lightmapMatrix\", 16), e.addUniform(\"reflectivityMatrix\", 16), e.addUniform(\"microSurfaceSamplerMatrix\", 16), e.addUniform(\"bumpMatrix\", 16), e.addUniform(\"vTangentSpaceParams\", 2), e.addUniform(\"reflectionMatrix\", 16), e.addUniform(\"vReflectionColor\", 3), e.addUniform(\"vAlbedoColor\", 4), e.addUniform(\"vLightingIntensity\", 4), e.addUniform(\"vReflectionMicrosurfaceInfos\", 3), e.addUniform(\"pointSize\", 1), e.addUniform(\"vReflectivityColor\", 4), e.addUniform(\"vEmissiveColor\", 3), e.addUniform(\"visibility\", 1), e.addUniform(\"vMetallicReflectanceFactors\", 4), e.addUniform(\"vMetallicReflectanceInfos\", 2), e.addUniform(\"metallicReflectanceMatrix\", 16), mr.PrepareUniformBuffer(e), gr.PrepareUniformBuffer(e), Zr.PrepareUniformBuffer(e), Jr.PrepareUniformBuffer(e), Wo.a.PrepareUniformBuffer(e), e.create();\n          }, t.prototype.unbind = function() {\n            if (this._activeEffect) {\n              var e = !1;\n              this._reflectionTexture && this._reflectionTexture.isRenderTarget && (this._activeEffect.setTexture(\"reflection2DSampler\", null), e = !0), this.subSurface.unbind(this._activeEffect) && (e = !0), e && this._markAllSubMeshesAsTexturesDirty();\n            }\n            r.prototype.unbind.call(this);\n          }, t.prototype.bindForSubMesh = function(e, n, i) {\n            var o = this.getScene(), a = i._materialDefines;\n            if (a) {\n              var s = i.effect;\n              if (s) {\n                this._activeEffect = s, a.INSTANCES && !a.THIN_INSTANCES || this.bindOnlyWorldMatrix(e), this.prePassConfiguration.bindForSubMesh(this._activeEffect, o, n, e, this.isFrozen), a.OBJECTSPACE_NORMALMAP && (e.toNormalMatrix(this._normalMatrix), this.bindOnlyNormalMatrix(this._normalMatrix));\n                var d = this._mustRebind(o, s, n.visibility);\n                $e.a.BindBonesParameters(n, this._activeEffect, this.prePassConfiguration);\n                var p = null, y = this._uniformBuffer;\n                if (d) {\n                  var P = o.getEngine();\n                  if (y.bindToEffect(s, \"Material\"), this.bindViewProjection(s), p = this._getReflectionTexture(), !y.useUbo || !this.isFrozen || !y.isSync) {\n                    if (o.texturesEnabled) {\n                      if (this._albedoTexture && lt.a.DiffuseTextureEnabled && (y.updateFloat2(\"vAlbedoInfos\", this._albedoTexture.coordinatesIndex, this._albedoTexture.level), $e.a.BindTextureMatrix(this._albedoTexture, y, \"albedo\")), this._ambientTexture && lt.a.AmbientTextureEnabled && (y.updateFloat4(\"vAmbientInfos\", this._ambientTexture.coordinatesIndex, this._ambientTexture.level, this._ambientTextureStrength, this._ambientTextureImpactOnAnalyticalLights), $e.a.BindTextureMatrix(this._ambientTexture, y, \"ambient\")), this._opacityTexture && lt.a.OpacityTextureEnabled && (y.updateFloat2(\"vOpacityInfos\", this._opacityTexture.coordinatesIndex, this._opacityTexture.level), $e.a.BindTextureMatrix(this._opacityTexture, y, \"opacity\")), p && lt.a.ReflectionTextureEnabled) {\n                        if (y.updateMatrix(\"reflectionMatrix\", p.getReflectionTextureMatrix()), y.updateFloat2(\"vReflectionInfos\", p.level, 0), p.boundingBoxSize) {\n                          var R = p;\n                          y.updateVector3(\"vReflectionPosition\", R.boundingBoxPosition), y.updateVector3(\"vReflectionSize\", R.boundingBoxSize);\n                        }\n                        if (this.realTimeFiltering) {\n                          var B = p.getSize().width;\n                          y.updateFloat2(\"vReflectionFilteringInfo\", B, $.a.Log2(B));\n                        }\n                        if (!a.USEIRRADIANCEMAP) {\n                          var F = p.sphericalPolynomial;\n                          if (a.USESPHERICALFROMREFLECTIONMAP && F)\n                            if (a.SPHERICAL_HARMONICS) {\n                              var z = F.preScaledHarmonics;\n                              this._activeEffect.setVector3(\"vSphericalL00\", z.l00), this._activeEffect.setVector3(\"vSphericalL1_1\", z.l1_1), this._activeEffect.setVector3(\"vSphericalL10\", z.l10), this._activeEffect.setVector3(\"vSphericalL11\", z.l11), this._activeEffect.setVector3(\"vSphericalL2_2\", z.l2_2), this._activeEffect.setVector3(\"vSphericalL2_1\", z.l2_1), this._activeEffect.setVector3(\"vSphericalL20\", z.l20), this._activeEffect.setVector3(\"vSphericalL21\", z.l21), this._activeEffect.setVector3(\"vSphericalL22\", z.l22);\n                            } else\n                              this._activeEffect.setFloat3(\"vSphericalX\", F.x.x, F.x.y, F.x.z), this._activeEffect.setFloat3(\"vSphericalY\", F.y.x, F.y.y, F.y.z), this._activeEffect.setFloat3(\"vSphericalZ\", F.z.x, F.z.y, F.z.z), this._activeEffect.setFloat3(\"vSphericalXX_ZZ\", F.xx.x - F.zz.x, F.xx.y - F.zz.y, F.xx.z - F.zz.z), this._activeEffect.setFloat3(\"vSphericalYY_ZZ\", F.yy.x - F.zz.x, F.yy.y - F.zz.y, F.yy.z - F.zz.z), this._activeEffect.setFloat3(\"vSphericalZZ\", F.zz.x, F.zz.y, F.zz.z), this._activeEffect.setFloat3(\"vSphericalXY\", F.xy.x, F.xy.y, F.xy.z), this._activeEffect.setFloat3(\"vSphericalYZ\", F.yz.x, F.yz.y, F.yz.z), this._activeEffect.setFloat3(\"vSphericalZX\", F.zx.x, F.zx.y, F.zx.z);\n                        }\n                        y.updateFloat3(\"vReflectionMicrosurfaceInfos\", p.getSize().width, p.lodGenerationScale, p.lodGenerationOffset);\n                      }\n                      this._emissiveTexture && lt.a.EmissiveTextureEnabled && (y.updateFloat2(\"vEmissiveInfos\", this._emissiveTexture.coordinatesIndex, this._emissiveTexture.level), $e.a.BindTextureMatrix(this._emissiveTexture, y, \"emissive\")), this._lightmapTexture && lt.a.LightmapTextureEnabled && (y.updateFloat2(\"vLightmapInfos\", this._lightmapTexture.coordinatesIndex, this._lightmapTexture.level), $e.a.BindTextureMatrix(this._lightmapTexture, y, \"lightmap\")), lt.a.SpecularTextureEnabled && (this._metallicTexture ? (y.updateFloat3(\"vReflectivityInfos\", this._metallicTexture.coordinatesIndex, this._metallicTexture.level, this._ambientTextureStrength), $e.a.BindTextureMatrix(this._metallicTexture, y, \"reflectivity\")) : this._reflectivityTexture && (y.updateFloat3(\"vReflectivityInfos\", this._reflectivityTexture.coordinatesIndex, this._reflectivityTexture.level, 1), $e.a.BindTextureMatrix(this._reflectivityTexture, y, \"reflectivity\")), this._metallicReflectanceTexture && (y.updateFloat2(\"vMetallicReflectanceInfos\", this._metallicReflectanceTexture.coordinatesIndex, this._metallicReflectanceTexture.level), $e.a.BindTextureMatrix(this._metallicReflectanceTexture, y, \"metallicReflectance\")), this._microSurfaceTexture && (y.updateFloat2(\"vMicroSurfaceSamplerInfos\", this._microSurfaceTexture.coordinatesIndex, this._microSurfaceTexture.level), $e.a.BindTextureMatrix(this._microSurfaceTexture, y, \"microSurfaceSampler\"))), this._bumpTexture && P.getCaps().standardDerivatives && lt.a.BumpTextureEnabled && !this._disableBumpMap && (y.updateFloat3(\"vBumpInfos\", this._bumpTexture.coordinatesIndex, this._bumpTexture.level, this._parallaxScaleBias), $e.a.BindTextureMatrix(this._bumpTexture, y, \"bump\"), o._mirroredCameraPosition ? y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? 1 : -1, this._invertNormalMapY ? 1 : -1) : y.updateFloat2(\"vTangentSpaceParams\", this._invertNormalMapX ? -1 : 1, this._invertNormalMapY ? -1 : 1));\n                    }\n                    if (this.pointsCloud && y.updateFloat(\"pointSize\", this.pointSize), a.METALLICWORKFLOW) {\n                      I.c.Color3[0].r = this._metallic === void 0 || this._metallic === null ? 1 : this._metallic, I.c.Color3[0].g = this._roughness === void 0 || this._roughness === null ? 1 : this._roughness, y.updateColor4(\"vReflectivityColor\", I.c.Color3[0], 1);\n                      var J = this.subSurface.indexOfRefraction, ie = Math.pow((J - 1) / (J + 1), 2);\n                      this._metallicReflectanceColor.scaleToRef(ie * this._metallicF0Factor, I.c.Color3[0]);\n                      var se = this._metallicF0Factor;\n                      y.updateColor4(\"vMetallicReflectanceFactors\", I.c.Color3[0], se);\n                    } else\n                      y.updateColor4(\"vReflectivityColor\", this._reflectivityColor, this._microSurface);\n                    y.updateColor3(\"vEmissiveColor\", lt.a.EmissiveTextureEnabled ? this._emissiveColor : I.a.BlackReadOnly), y.updateColor3(\"vReflectionColor\", this._reflectionColor), !a.SS_REFRACTION && this.subSurface.linkRefractionWithTransparency ? y.updateColor4(\"vAlbedoColor\", this._albedoColor, 1) : y.updateColor4(\"vAlbedoColor\", this._albedoColor, this.alpha), this._lightingInfos.x = this._directIntensity, this._lightingInfos.y = this._emissiveIntensity, this._lightingInfos.z = this._environmentIntensity * o.environmentIntensity, this._lightingInfos.w = this._specularIntensity, y.updateVector4(\"vLightingIntensity\", this._lightingInfos);\n                  }\n                  y.updateFloat(\"visibility\", n.visibility), o.texturesEnabled && (this._albedoTexture && lt.a.DiffuseTextureEnabled && y.setTexture(\"albedoSampler\", this._albedoTexture), this._ambientTexture && lt.a.AmbientTextureEnabled && y.setTexture(\"ambientSampler\", this._ambientTexture), this._opacityTexture && lt.a.OpacityTextureEnabled && y.setTexture(\"opacitySampler\", this._opacityTexture), p && lt.a.ReflectionTextureEnabled && (a.LODBASEDMICROSFURACE ? y.setTexture(\"reflectionSampler\", p) : (y.setTexture(\"reflectionSampler\", p._lodTextureMid || p), y.setTexture(\"reflectionSamplerLow\", p._lodTextureLow || p), y.setTexture(\"reflectionSamplerHigh\", p._lodTextureHigh || p)), a.USEIRRADIANCEMAP && y.setTexture(\"irradianceSampler\", p.irradianceTexture)), a.ENVIRONMENTBRDF && y.setTexture(\"environmentBrdfSampler\", this._environmentBRDFTexture), this._emissiveTexture && lt.a.EmissiveTextureEnabled && y.setTexture(\"emissiveSampler\", this._emissiveTexture), this._lightmapTexture && lt.a.LightmapTextureEnabled && y.setTexture(\"lightmapSampler\", this._lightmapTexture), lt.a.SpecularTextureEnabled && (this._metallicTexture ? y.setTexture(\"reflectivitySampler\", this._metallicTexture) : this._reflectivityTexture && y.setTexture(\"reflectivitySampler\", this._reflectivityTexture), this._metallicReflectanceTexture && y.setTexture(\"metallicReflectanceSampler\", this._metallicReflectanceTexture), this._microSurfaceTexture && y.setTexture(\"microSurfaceSampler\", this._microSurfaceTexture)), this._bumpTexture && P.getCaps().standardDerivatives && lt.a.BumpTextureEnabled && !this._disableBumpMap && y.setTexture(\"bumpSampler\", this._bumpTexture)), this.detailMap.bindForSubMesh(y, o, this.isFrozen), this.subSurface.bindForSubMesh(y, o, P, this.isFrozen, a.LODBASEDMICROSFURACE, this.realTimeFiltering), this.clearCoat.bindForSubMesh(y, o, P, this._disableBumpMap, this.isFrozen, this._invertNormalMapX, this._invertNormalMapY, i), this.anisotropy.bindForSubMesh(y, o, this.isFrozen), this.sheen.bindForSubMesh(y, o, this.isFrozen, i), $e.a.BindClipPlane(this._activeEffect, o), o.ambientColor.multiplyToRef(this._ambientColor, this._globalAmbientColor);\n                  var ce = o._forcedViewPosition ? o._forcedViewPosition : o._mirroredCameraPosition ? o._mirroredCameraPosition : o.activeCamera.globalPosition, ue = o.useRightHandedSystem === (o._mirroredCameraPosition != null);\n                  s.setFloat4(\"vEyePosition\", ce.x, ce.y, ce.z, ue ? -1 : 1), s.setColor3(\"vAmbientColor\", this._globalAmbientColor), s.setFloat2(\"vDebugMode\", this.debugLimit, this.debugFactor);\n                }\n                !d && this.isFrozen || (o.lightsEnabled && !this._disableLighting && $e.a.BindLights(o, n, this._activeEffect, a, this._maxSimultaneousLights, this._rebuildInParallel), (o.fogEnabled && n.applyFog && o.fogMode !== _e.a.FOGMODE_NONE || p) && this.bindView(s), $e.a.BindFogParameters(o, n, this._activeEffect, !0), a.NUM_MORPH_INFLUENCERS && $e.a.BindMorphTargetParameters(n, this._activeEffect), this._imageProcessingConfiguration.bind(this._activeEffect), $e.a.BindLogDepth(a, this._activeEffect, o)), y.update(), this._afterBind(n, this._activeEffect);\n              }\n            }\n          }, t.prototype.getAnimatables = function() {\n            var e = [];\n            return this._albedoTexture && this._albedoTexture.animations && this._albedoTexture.animations.length > 0 && e.push(this._albedoTexture), 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._metallicTexture && this._metallicTexture.animations && this._metallicTexture.animations.length > 0 ? e.push(this._metallicTexture) : this._reflectivityTexture && this._reflectivityTexture.animations && this._reflectivityTexture.animations.length > 0 && e.push(this._reflectivityTexture), 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.detailMap.getAnimatables(e), this.subSurface.getAnimatables(e), this.clearCoat.getAnimatables(e), this.sheen.getAnimatables(e), this.anisotropy.getAnimatables(e), e;\n          }, t.prototype._getReflectionTexture = function() {\n            return this._reflectionTexture ? this._reflectionTexture : this.getScene().environmentTexture;\n          }, t.prototype.getActiveTextures = function() {\n            var e = r.prototype.getActiveTextures.call(this);\n            return this._albedoTexture && e.push(this._albedoTexture), 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._reflectivityTexture && e.push(this._reflectivityTexture), this._metallicTexture && e.push(this._metallicTexture), this._metallicReflectanceTexture && e.push(this._metallicReflectanceTexture), this._microSurfaceTexture && e.push(this._microSurfaceTexture), this._bumpTexture && e.push(this._bumpTexture), this._lightmapTexture && e.push(this._lightmapTexture), this.detailMap.getActiveTextures(e), this.subSurface.getActiveTextures(e), this.clearCoat.getActiveTextures(e), this.sheen.getActiveTextures(e), this.anisotropy.getActiveTextures(e), e;\n          }, t.prototype.hasTexture = function(e) {\n            return !!r.prototype.hasTexture.call(this, e) || this._albedoTexture === e || this._ambientTexture === e || this._opacityTexture === e || this._reflectionTexture === e || this._reflectivityTexture === e || this._metallicTexture === e || this._metallicReflectanceTexture === e || this._microSurfaceTexture === e || this._bumpTexture === e || this._lightmapTexture === e || this.detailMap.hasTexture(e) || this.subSurface.hasTexture(e) || this.clearCoat.hasTexture(e) || this.sheen.hasTexture(e) || this.anisotropy.hasTexture(e);\n          }, t.prototype.setPrePassRenderer = function(e) {\n            if (this.subSurface.isScatteringEnabled) {\n              var n = this.getScene().enableSubSurfaceForPrePass();\n              return n && (n.enabled = !0), !0;\n            }\n            return !1;\n          }, t.prototype.dispose = function(e, n) {\n            var i, o, a, s, d, p, y, P, R, B, F;\n            n && (this._environmentBRDFTexture && this.getScene().environmentBRDFTexture !== this._environmentBRDFTexture && this._environmentBRDFTexture.dispose(), (i = this._albedoTexture) === null || i === void 0 || i.dispose(), (o = this._ambientTexture) === null || o === void 0 || o.dispose(), (a = this._opacityTexture) === null || a === void 0 || a.dispose(), (s = this._reflectionTexture) === null || s === void 0 || s.dispose(), (d = this._emissiveTexture) === null || d === void 0 || d.dispose(), (p = this._metallicTexture) === null || p === void 0 || p.dispose(), (y = this._reflectivityTexture) === null || y === void 0 || y.dispose(), (P = this._bumpTexture) === null || P === void 0 || P.dispose(), (R = this._lightmapTexture) === null || R === void 0 || R.dispose(), (B = this._metallicReflectanceTexture) === null || B === void 0 || B.dispose(), (F = this._microSurfaceTexture) === null || F === void 0 || F.dispose()), this.detailMap.dispose(n), this.subSurface.dispose(n), this.clearCoat.dispose(n), this.sheen.dispose(n), this.anisotropy.dispose(n), this._renderTargets.dispose(), this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), r.prototype.dispose.call(this, e, n);\n          }, t.PBRMATERIAL_OPAQUE = zt.a.MATERIAL_OPAQUE, t.PBRMATERIAL_ALPHATEST = zt.a.MATERIAL_ALPHATEST, t.PBRMATERIAL_ALPHABLEND = zt.a.MATERIAL_ALPHABLEND, t.PBRMATERIAL_ALPHATESTANDBLEND = zt.a.MATERIAL_ALPHATESTANDBLEND, t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = 0, t.LIGHTFALLOFF_PHYSICAL = 0, t.LIGHTFALLOFF_GLTF = 1, t.LIGHTFALLOFF_STANDARD = 2, Object(c.c)([Object(L.i)()], t.prototype, \"_imageProcessingConfiguration\", void 0), Object(c.c)([Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], t.prototype, \"debugMode\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useLogarithmicDepth\", null), t;\n        }(jo.a), $r = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.directIntensity = 1, i.emissiveIntensity = 1, i.environmentIntensity = 1, i.specularIntensity = 1, i.disableBumpMap = !1, i.ambientTextureStrength = 1, i.ambientTextureImpactOnAnalyticalLights = t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, i.metallicF0Factor = 1, i.metallicReflectanceColor = I.a.White(), i.ambientColor = new I.a(0, 0, 0), i.albedoColor = new I.a(1, 1, 1), i.reflectivityColor = new I.a(1, 1, 1), i.reflectionColor = new I.a(1, 1, 1), i.emissiveColor = new I.a(0, 0, 0), i.microSurface = 1, i.useLightmapAsShadowmap = !1, i.useAlphaFromAlbedoTexture = !1, i.forceAlphaTest = !1, i.alphaCutOff = 0.4, i.useSpecularOverAlpha = !0, i.useMicroSurfaceFromReflectivityMapAlpha = !1, i.useRoughnessFromMetallicTextureAlpha = !0, i.useRoughnessFromMetallicTextureGreen = !1, i.useMetallnessFromMetallicTextureBlue = !1, i.useAmbientOcclusionFromMetallicTextureRed = !1, i.useAmbientInGrayScale = !1, i.useAutoMicroSurfaceFromReflectivityMap = !1, i.useRadianceOverAlpha = !0, i.useObjectSpaceNormalMap = !1, i.useParallax = !1, i.useParallaxOcclusion = !1, i.parallaxScaleBias = 0.05, i.disableLighting = !1, i.forceIrradianceInFragment = !1, i.maxSimultaneousLights = 4, i.invertNormalMapX = !1, i.invertNormalMapY = !1, i.twoSidedLighting = !1, i.useAlphaFresnel = !1, i.useLinearAlphaFresnel = !1, i.environmentBRDFTexture = null, i.forceNormalForward = !1, i.enableSpecularAntiAliasing = !1, i.useHorizonOcclusion = !0, i.useRadianceOcclusion = !0, i.unlit = !1, i._environmentBRDFTexture = Ho.GetEnvironmentBRDFTexture(n), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"refractionTexture\", { get: function() {\n            return this.subSurface.refractionTexture;\n          }, set: function(e) {\n            this.subSurface.refractionTexture = e, e ? this.subSurface.isRefractionEnabled = !0 : this.subSurface.linkRefractionWithTransparency || (this.subSurface.isRefractionEnabled = !1);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"indexOfRefraction\", { get: function() {\n            return this.subSurface.indexOfRefraction;\n          }, set: function(e) {\n            this.subSurface.indexOfRefraction = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"invertRefractionY\", { get: function() {\n            return this.subSurface.invertRefractionY;\n          }, set: function(e) {\n            this.subSurface.invertRefractionY = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"linkRefractionWithTransparency\", { get: function() {\n            return this.subSurface.linkRefractionWithTransparency;\n          }, set: function(e) {\n            this.subSurface.linkRefractionWithTransparency = e, e && (this.subSurface.isRefractionEnabled = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"usePhysicalLightFalloff\", { get: function() {\n            return this._lightFalloff === pn.LIGHTFALLOFF_PHYSICAL;\n          }, set: function(e) {\n            e !== this.usePhysicalLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = e ? pn.LIGHTFALLOFF_PHYSICAL : pn.LIGHTFALLOFF_STANDARD);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useGLTFLightFalloff\", { get: function() {\n            return this._lightFalloff === pn.LIGHTFALLOFF_GLTF;\n          }, set: function(e) {\n            e !== this.useGLTFLightFalloff && (this._markAllSubMeshesAsTexturesDirty(), this._lightFalloff = e ? pn.LIGHTFALLOFF_GLTF : pn.LIGHTFALLOFF_STANDARD);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurvesEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorCurvesEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorCurvesEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingEnabled\", { get: function() {\n            return this.imageProcessingConfiguration.colorGradingEnabled;\n          }, set: function(e) {\n            this.imageProcessingConfiguration.colorGradingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraToneMappingEnabled\", { get: function() {\n            return this._imageProcessingConfiguration.toneMappingEnabled;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.toneMappingEnabled = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraExposure\", { get: function() {\n            return this._imageProcessingConfiguration.exposure;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.exposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraContrast\", { get: function() {\n            return this._imageProcessingConfiguration.contrast;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.contrast = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorGradingTexture\", { get: function() {\n            return this._imageProcessingConfiguration.colorGradingTexture;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.colorGradingTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraColorCurves\", { get: function() {\n            return this._imageProcessingConfiguration.colorCurves;\n          }, set: function(e) {\n            this._imageProcessingConfiguration.colorCurves = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PBRMaterial\";\n          }, t.prototype.clone = function(e) {\n            var n = this, i = L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n            return i.id = e, i.name = e, this.clearCoat.copyTo(i.clearCoat), this.anisotropy.copyTo(i.anisotropy), this.brdf.copyTo(i.brdf), this.sheen.copyTo(i.sheen), this.subSurface.copyTo(i.subSurface), i;\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.PBRMaterial\", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return e.clearCoat && o.clearCoat.parse(e.clearCoat, n, i), e.anisotropy && o.anisotropy.parse(e.anisotropy, n, i), e.brdf && o.brdf.parse(e.brdf, n, i), e.sheen && o.sheen.parse(e.sheen, n, i), e.subSurface && o.subSurface.parse(e.subSurface, n, i), o;\n          }, t.PBRMATERIAL_OPAQUE = pn.PBRMATERIAL_OPAQUE, t.PBRMATERIAL_ALPHATEST = pn.PBRMATERIAL_ALPHATEST, t.PBRMATERIAL_ALPHABLEND = pn.PBRMATERIAL_ALPHABLEND, t.PBRMATERIAL_ALPHATESTANDBLEND = pn.PBRMATERIAL_ALPHATESTANDBLEND, t.DEFAULT_AO_ON_ANALYTICAL_LIGHTS = pn.DEFAULT_AO_ON_ANALYTICAL_LIGHTS, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"directIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"environmentIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"specularIntensity\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"disableBumpMap\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"albedoTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientTextureStrength\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientTextureImpactOnAnalyticalLights\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"opacityTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectivityTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallic\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"roughness\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicF0Factor\", void 0), Object(c.c)([Object(L.e)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicReflectanceColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallicReflectanceTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"microSurfaceTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"bumpTexture\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", null)], t.prototype, \"lightmapTexture\", void 0), Object(c.c)([Object(L.e)(\"ambient\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"ambientColor\", void 0), Object(c.c)([Object(L.e)(\"albedo\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"albedoColor\", void 0), Object(c.c)([Object(L.e)(\"reflectivity\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectivityColor\", void 0), Object(c.c)([Object(L.e)(\"reflection\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"reflectionColor\", void 0), Object(c.c)([Object(L.e)(\"emissive\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveColor\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"microSurface\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useLightmapAsShadowmap\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"useAlphaFromAlbedoTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"forceAlphaTest\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesAndMiscDirty\")], t.prototype, \"alphaCutOff\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useSpecularOverAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useMicroSurfaceFromReflectivityMapAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRoughnessFromMetallicTextureAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRoughnessFromMetallicTextureGreen\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useMetallnessFromMetallicTextureBlue\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAmbientOcclusionFromMetallicTextureRed\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAmbientInGrayScale\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAutoMicroSurfaceFromReflectivityMap\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"usePhysicalLightFalloff\", null), Object(c.c)([Object(L.c)()], t.prototype, \"useGLTFLightFalloff\", null), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRadianceOverAlpha\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useObjectSpaceNormalMap\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useParallax\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useParallaxOcclusion\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"parallaxScaleBias\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"disableLighting\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"forceIrradianceInFragment\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"maxSimultaneousLights\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapX\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapY\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"twoSidedLighting\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useAlphaFresnel\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useLinearAlphaFresnel\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"environmentBRDFTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"forceNormalForward\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"enableSpecularAntiAliasing\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useHorizonOcclusion\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useRadianceOcclusion\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsMiscDirty\")], t.prototype, \"unlit\", void 0), t;\n        }(pn);\n        O.a.RegisteredTypes[\"BABYLON.PBRMaterial\"] = $r;\n        function Xo(r) {\n          return r.charCodeAt(0) + (r.charCodeAt(1) << 8) + (r.charCodeAt(2) << 16) + (r.charCodeAt(3) << 24);\n        }\n        var Zl = Xo(\"DXT1\"), Jl = Xo(\"DXT3\"), $l = Xo(\"DXT5\"), Ps = Xo(\"DX10\"), Li = function() {\n          function r() {\n          }\n          return r.GetDDSInfo = function(t) {\n            var e = new Int32Array(t.buffer, t.byteOffset, 31), n = new Int32Array(t.buffer, t.byteOffset, 35), i = 1;\n            131072 & e[2] && (i = Math.max(1, e[7]));\n            var o = e[21], a = o === Ps ? n[32] : 0, s = h.a.TEXTURETYPE_UNSIGNED_INT;\n            switch (o) {\n              case 113:\n                s = h.a.TEXTURETYPE_HALF_FLOAT;\n                break;\n              case 116:\n                s = h.a.TEXTURETYPE_FLOAT;\n                break;\n              case Ps:\n                if (a === 10) {\n                  s = h.a.TEXTURETYPE_HALF_FLOAT;\n                  break;\n                }\n                if (a === 2) {\n                  s = h.a.TEXTURETYPE_FLOAT;\n                  break;\n                }\n            }\n            return { width: e[4], height: e[3], mipmapCount: i, isFourCC: (4 & e[20]) == 4, isRGB: (64 & e[20]) == 64, isLuminance: (131072 & e[20]) == 131072, isCube: (512 & e[28]) == 512, isCompressed: o === Zl || o === Jl || o === $l, dxgiFormat: a, textureType: s };\n          }, r._ToHalfFloat = function(t) {\n            r._FloatView || (r._FloatView = new Float32Array(1), r._Int32View = new Int32Array(r._FloatView.buffer)), r._FloatView[0] = t;\n            var e = r._Int32View[0], n = e >> 16 & 32768, i = e >> 12 & 2047, o = e >> 23 & 255;\n            return o < 103 ? n : o > 142 ? (n |= 31744, n |= (o == 255 ? 0 : 1) && 8388607 & e) : o < 113 ? n |= ((i |= 2048) >> 114 - o) + (i >> 113 - o & 1) : (n |= o - 112 << 10 | i >> 1, n += 1 & i);\n          }, r._FromHalfFloat = function(t) {\n            var e = (32768 & t) >> 15, n = (31744 & t) >> 10, i = 1023 & t;\n            return n === 0 ? (e ? -1 : 1) * Math.pow(2, -14) * (i / Math.pow(2, 10)) : n == 31 ? i ? NaN : 1 / 0 * (e ? -1 : 1) : (e ? -1 : 1) * Math.pow(2, n - 15) * (1 + i / Math.pow(2, 10));\n          }, r._GetHalfFloatAsFloatRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            for (var s = new Float32Array(i), d = new Uint16Array(o, n), p = 0, y = 0; y < e; y++)\n              for (var P = 0; P < t; P++) {\n                var R = 4 * (P + y * t);\n                s[p] = r._FromHalfFloat(d[R]), s[p + 1] = r._FromHalfFloat(d[R + 1]), s[p + 2] = r._FromHalfFloat(d[R + 2]), r.StoreLODInAlphaChannel ? s[p + 3] = a : s[p + 3] = r._FromHalfFloat(d[R + 3]), p += 4;\n              }\n            return s;\n          }, r._GetHalfFloatRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            if (r.StoreLODInAlphaChannel) {\n              for (var s = new Uint16Array(i), d = new Uint16Array(o, n), p = 0, y = 0; y < e; y++)\n                for (var P = 0; P < t; P++) {\n                  var R = 4 * (P + y * t);\n                  s[p] = d[R], s[p + 1] = d[R + 1], s[p + 2] = d[R + 2], s[p + 3] = r._ToHalfFloat(a), p += 4;\n                }\n              return s;\n            }\n            return new Uint16Array(o, n, i);\n          }, r._GetFloatRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            if (r.StoreLODInAlphaChannel) {\n              for (var s = new Float32Array(i), d = new Float32Array(o, n), p = 0, y = 0; y < e; y++)\n                for (var P = 0; P < t; P++) {\n                  var R = 4 * (P + y * t);\n                  s[p] = d[R], s[p + 1] = d[R + 1], s[p + 2] = d[R + 2], s[p + 3] = a, p += 4;\n                }\n              return s;\n            }\n            return new Float32Array(o, n, i);\n          }, r._GetFloatAsUIntRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            for (var s = new Uint8Array(i), d = new Float32Array(o, n), p = 0, y = 0; y < e; y++)\n              for (var P = 0; P < t; P++) {\n                var R = 4 * (P + y * t);\n                s[p] = 255 * $.a.Clamp(d[R]), s[p + 1] = 255 * $.a.Clamp(d[R + 1]), s[p + 2] = 255 * $.a.Clamp(d[R + 2]), r.StoreLODInAlphaChannel ? s[p + 3] = a : s[p + 3] = 255 * $.a.Clamp(d[R + 3]), p += 4;\n              }\n            return s;\n          }, r._GetHalfFloatAsUIntRGBAArrayBuffer = function(t, e, n, i, o, a) {\n            for (var s = new Uint8Array(i), d = new Uint16Array(o, n), p = 0, y = 0; y < e; y++)\n              for (var P = 0; P < t; P++) {\n                var R = 4 * (P + y * t);\n                s[p] = 255 * $.a.Clamp(r._FromHalfFloat(d[R])), s[p + 1] = 255 * $.a.Clamp(r._FromHalfFloat(d[R + 1])), s[p + 2] = 255 * $.a.Clamp(r._FromHalfFloat(d[R + 2])), r.StoreLODInAlphaChannel ? s[p + 3] = a : s[p + 3] = 255 * $.a.Clamp(r._FromHalfFloat(d[R + 3])), p += 4;\n              }\n            return s;\n          }, r._GetRGBAArrayBuffer = function(t, e, n, i, o, a, s, d, p) {\n            for (var y = new Uint8Array(i), P = new Uint8Array(o, n), R = 0, B = 0; B < e; B++)\n              for (var F = 0; F < t; F++) {\n                var z = 4 * (F + B * t);\n                y[R] = P[z + a], y[R + 1] = P[z + s], y[R + 2] = P[z + d], y[R + 3] = P[z + p], R += 4;\n              }\n            return y;\n          }, r._ExtractLongWordOrder = function(t) {\n            return t === 0 || t === 255 || t === -16777216 ? 0 : 1 + r._ExtractLongWordOrder(t >> 8);\n          }, r._GetRGBArrayBuffer = function(t, e, n, i, o, a, s, d) {\n            for (var p = new Uint8Array(i), y = new Uint8Array(o, n), P = 0, R = 0; R < e; R++)\n              for (var B = 0; B < t; B++) {\n                var F = 3 * (B + R * t);\n                p[P] = y[F + a], p[P + 1] = y[F + s], p[P + 2] = y[F + d], P += 3;\n              }\n            return p;\n          }, r._GetLuminanceArrayBuffer = function(t, e, n, i, o) {\n            for (var a = new Uint8Array(i), s = new Uint8Array(o, n), d = 0, p = 0; p < e; p++)\n              for (var y = 0; y < t; y++) {\n                var P = y + p * t;\n                a[d] = s[P], d++;\n              }\n            return a;\n          }, r.UploadDDSLevels = function(t, e, n, i, o, a, s, d) {\n            s === void 0 && (s = -1);\n            var p = null;\n            i.sphericalPolynomial && (p = new Array());\n            var y, P, R, B, F, z, J, ie = t.getCaps().s3tc, se = new Int32Array(n.buffer, n.byteOffset, 31), ce = 0, ue = 0, fe = 1;\n            if (se[0] === 542327876)\n              if (i.isFourCC || i.isRGB || i.isLuminance)\n                if (!i.isCompressed || ie) {\n                  var ve = se[22];\n                  B = se[1] + 4;\n                  var Te, Re = !1;\n                  if (i.isFourCC)\n                    switch (y = se[21]) {\n                      case Zl:\n                        fe = 8, ue = ie.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n                        break;\n                      case Jl:\n                        fe = 16, ue = ie.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n                        break;\n                      case $l:\n                        fe = 16, ue = ie.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n                        break;\n                      case 113:\n                      case 116:\n                        Re = !0;\n                        break;\n                      case Ps:\n                        B += 20;\n                        var Ae = !1;\n                        switch (i.dxgiFormat) {\n                          case 10:\n                          case 2:\n                            Re = !0, Ae = !0;\n                            break;\n                          case 88:\n                            i.isRGB = !0, i.isFourCC = !1, ve = 32, Ae = !0;\n                        }\n                        if (Ae)\n                          break;\n                      default:\n                        return void console.error(\"Unsupported FourCC code:\", (Te = y, String.fromCharCode(255 & Te, Te >> 8 & 255, Te >> 16 & 255, Te >> 24 & 255)));\n                    }\n                  var Ee = r._ExtractLongWordOrder(se[23]), Se = r._ExtractLongWordOrder(se[24]), De = r._ExtractLongWordOrder(se[25]), xe = r._ExtractLongWordOrder(se[26]);\n                  Re && (ue = t._getRGBABufferInternalSizedFormat(i.textureType)), z = 1, 131072 & se[2] && o !== !1 && (z = Math.max(1, se[7]));\n                  for (var Le = d || 0; Le < a; Le++) {\n                    for (P = se[4], R = se[3], J = 0; J < z; ++J) {\n                      if (s === -1 || s === J) {\n                        var Me = s === -1 ? J : 0;\n                        if (!i.isCompressed && i.isFourCC) {\n                          e.format = h.a.TEXTUREFORMAT_RGBA, ce = P * R * 4;\n                          var we = null;\n                          t._badOS || t._badDesktopOS || !t.getCaps().textureHalfFloat && !t.getCaps().textureFloat ? (ve === 128 ? (we = r._GetFloatAsUIntRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(r._GetFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me))) : ve === 64 && (we = r._GetHalfFloatAsUIntRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(r._GetHalfFloatAsFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me))), e.type = h.a.TEXTURETYPE_UNSIGNED_INT) : ve === 128 ? (e.type = h.a.TEXTURETYPE_FLOAT, we = r._GetFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(we)) : ve !== 64 || t.getCaps().textureHalfFloat ? (e.type = h.a.TEXTURETYPE_HALF_FLOAT, we = r._GetHalfFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(r._GetHalfFloatAsFloatRGBAArrayBuffer(P, R, B, ce, n.buffer, Me))) : (e.type = h.a.TEXTURETYPE_FLOAT, we = r._GetHalfFloatAsFloatRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Me), p && Me == 0 && p.push(we)), we && t._uploadDataToTextureDirectly(e, we, Le, Me);\n                        } else if (i.isRGB)\n                          e.type = h.a.TEXTURETYPE_UNSIGNED_INT, ve === 24 ? (e.format = h.a.TEXTUREFORMAT_RGB, ce = P * R * 3, F = r._GetRGBArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Ee, Se, De), t._uploadDataToTextureDirectly(e, F, Le, Me)) : (e.format = h.a.TEXTUREFORMAT_RGBA, ce = P * R * 4, F = r._GetRGBAArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer, Ee, Se, De, xe), t._uploadDataToTextureDirectly(e, F, Le, Me));\n                        else if (i.isLuminance) {\n                          var Ye = t._getUnpackAlignement(), et = P;\n                          ce = Math.floor((P + Ye - 1) / Ye) * Ye * (R - 1) + et, F = r._GetLuminanceArrayBuffer(P, R, n.byteOffset + B, ce, n.buffer), e.format = h.a.TEXTUREFORMAT_LUMINANCE, e.type = h.a.TEXTURETYPE_UNSIGNED_INT, t._uploadDataToTextureDirectly(e, F, Le, Me);\n                        } else\n                          ce = Math.max(4, P) / 4 * Math.max(4, R) / 4 * fe, F = new Uint8Array(n.buffer, n.byteOffset + B, ce), e.type = h.a.TEXTURETYPE_UNSIGNED_INT, t._uploadCompressedDataToTextureDirectly(e, ue, P, R, F, Le, Me);\n                      }\n                      B += ve ? P * R * (ve / 8) : ce, P *= 0.5, R *= 0.5, P = Math.max(1, P), R = Math.max(1, R);\n                    }\n                    if (d !== void 0)\n                      break;\n                  }\n                  p && p.length > 0 ? i.sphericalPolynomial = Lo.ConvertCubeMapToSphericalPolynomial({ size: se[4], right: p[0], left: p[1], up: p[2], down: p[3], front: p[4], back: p[5], format: h.a.TEXTUREFORMAT_RGBA, type: h.a.TEXTURETYPE_FLOAT, gammaSpace: !1 }) : i.sphericalPolynomial = void 0;\n                } else\n                  l.a.Error(\"Compressed textures are not supported on this platform.\");\n              else\n                l.a.Error(\"Unsupported format, must contain a FourCC, RGB or LUMINANCE code\");\n            else\n              l.a.Error(\"Invalid magic number in DDS header\");\n          }, r.StoreLODInAlphaChannel = !1, r;\n        }();\n        wt.a.prototype.createPrefilteredCubeTexture = function(r, t, e, n, i, o, a, s, d) {\n          var p = this;\n          return i === void 0 && (i = null), o === void 0 && (o = null), s === void 0 && (s = null), d === void 0 && (d = !0), this.createCubeTexture(r, t, null, !1, function(y) {\n            if (y) {\n              var P = y.texture;\n              if (d ? y.info.sphericalPolynomial && (P._sphericalPolynomial = y.info.sphericalPolynomial) : P._sphericalPolynomial = new Yr(), P._source = Pt.b.CubePrefiltered, p.getCaps().textureLOD)\n                i && i(P);\n              else {\n                var R = p._gl, B = y.width;\n                if (B) {\n                  for (var F = [], z = 0; z < 3; z++) {\n                    var J = 1 - z / 2, ie = n, se = $.a.Log2(B) * e + n, ce = ie + (se - ie) * J, ue = Math.round(Math.min(Math.max(ce, 0), se)), fe = new Pt.a(p, Pt.b.Temp);\n                    if (fe.type = P.type, fe.format = P.format, fe.width = Math.pow(2, Math.max($.a.Log2(B) - ue, 0)), fe.height = fe.width, fe.isCube = !0, p._bindTextureDirectly(R.TEXTURE_CUBE_MAP, fe, !0), fe.samplingMode = h.a.TEXTURE_LINEAR_LINEAR, R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_MAG_FILTER, R.LINEAR), R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_MIN_FILTER, R.LINEAR), R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_WRAP_S, R.CLAMP_TO_EDGE), R.texParameteri(R.TEXTURE_CUBE_MAP, R.TEXTURE_WRAP_T, R.CLAMP_TO_EDGE), y.isDDS) {\n                      var ve = y.info, Te = y.data;\n                      p._unpackFlipY(ve.isCompressed), Li.UploadDDSLevels(p, fe, Te, ve, !0, 6, ue);\n                    } else\n                      l.a.Warn(\"DDS is the only prefiltered cube map supported so far.\");\n                    p._bindTextureDirectly(R.TEXTURE_CUBE_MAP, null);\n                    var Re = new kn.a(t);\n                    Re.isCube = !0, Re._texture = fe, fe.isReady = !0, F.push(Re);\n                  }\n                  P._lodTextureHigh = F[2], P._lodTextureMid = F[1], P._lodTextureLow = F[0], i && i(P);\n                }\n              }\n            } else\n              i && i(null);\n          }, o, a, s, d, e, n);\n        };\n        var eu = function() {\n          function r() {\n            this.supportCascades = !0;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".dds\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            var a, s = e.getEngine(), d = !1;\n            if (Array.isArray(t))\n              for (var p = 0; p < t.length; p++) {\n                var y = t[p];\n                a = Li.GetDDSInfo(y), e.width = a.width, e.height = a.height, d = (a.isRGB || a.isLuminance || a.mipmapCount > 1) && e.generateMipMaps, s._unpackFlipY(a.isCompressed), Li.UploadDDSLevels(s, e, y, a, d, 6, -1, p), a.isFourCC || a.mipmapCount !== 1 || s.generateMipMapsForCubemap(e);\n              }\n            else {\n              var P = t;\n              a = Li.GetDDSInfo(P), e.width = a.width, e.height = a.height, n && (a.sphericalPolynomial = new Yr()), d = (a.isRGB || a.isLuminance || a.mipmapCount > 1) && e.generateMipMaps, s._unpackFlipY(a.isCompressed), Li.UploadDDSLevels(s, e, P, a, d, 6), a.isFourCC || a.mipmapCount !== 1 || s.generateMipMapsForCubemap(e, !1);\n            }\n            s._setCubeMapTextureParams(e, d), e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i({ isDDS: !0, width: e.width, info: a, data: t, texture: e });\n          }, r.prototype.loadData = function(t, e, n) {\n            var i = Li.GetDDSInfo(t), o = (i.isRGB || i.isLuminance || i.mipmapCount > 1) && e.generateMipMaps && i.width >> i.mipmapCount - 1 == 1;\n            n(i.width, i.height, o, i.isFourCC, function() {\n              Li.UploadDDSLevels(e.getEngine(), e, t, i, o, 1);\n            });\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new eu());\n        var tu = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".env\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            if (!Array.isArray(t)) {\n              var a = gi.GetEnvInfo(t);\n              a ? (e.width = a.width, e.height = a.width, gi.UploadEnvSpherical(e, a), gi.UploadEnvLevelsAsync(e, t, a).then(function() {\n                e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i();\n              })) : o && o(\"Can not parse the environment file\", null);\n            }\n          }, r.prototype.loadData = function(t, e, n) {\n            throw \".env not supported in 2d.\";\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new tu());\n        var Yo = function() {\n          function r(t, e, n, i) {\n            if (this.data = t, this.isInvalid = !1, !r.IsValid(t))\n              return this.isInvalid = !0, void l.a.Error(\"texture missing KTX identifier\");\n            var o = Uint32Array.BYTES_PER_ELEMENT, a = new DataView(this.data.buffer, this.data.byteOffset + 12, 13 * o), s = a.getUint32(0, !0) === 67305985;\n            this.glType = a.getUint32(1 * o, s), this.glTypeSize = a.getUint32(2 * o, s), this.glFormat = a.getUint32(3 * o, s), this.glInternalFormat = a.getUint32(4 * o, s), this.glBaseInternalFormat = a.getUint32(5 * o, s), this.pixelWidth = a.getUint32(6 * o, s), this.pixelHeight = a.getUint32(7 * o, s), this.pixelDepth = a.getUint32(8 * o, s), this.numberOfArrayElements = a.getUint32(9 * o, s), this.numberOfFaces = a.getUint32(10 * o, s), this.numberOfMipmapLevels = a.getUint32(11 * o, s), this.bytesOfKeyValueData = a.getUint32(12 * o, s), this.glType === 0 ? (this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels), this.pixelHeight !== 0 && this.pixelDepth === 0 ? this.numberOfArrayElements === 0 ? this.numberOfFaces === e ? this.loadType = r.COMPRESSED_2D : l.a.Error(\"number of faces expected\" + e + \", but found \" + this.numberOfFaces) : l.a.Error(\"texture arrays not currently supported\") : l.a.Error(\"only 2D textures currently supported\")) : l.a.Error(\"only compressed formats currently supported\");\n          }\n          return r.prototype.uploadLevels = function(t, e) {\n            switch (this.loadType) {\n              case r.COMPRESSED_2D:\n                this._upload2DCompressedLevels(t, e);\n                break;\n              case r.TEX_2D:\n              case r.COMPRESSED_3D:\n              case r.TEX_3D:\n            }\n          }, r.prototype._upload2DCompressedLevels = function(t, e) {\n            for (var n = r.HEADER_LEN + this.bytesOfKeyValueData, i = this.pixelWidth, o = this.pixelHeight, a = e ? this.numberOfMipmapLevels : 1, s = 0; s < a; s++) {\n              var d = new Int32Array(this.data.buffer, this.data.byteOffset + n, 1)[0];\n              n += 4;\n              for (var p = 0; p < this.numberOfFaces; p++) {\n                var y = new Uint8Array(this.data.buffer, this.data.byteOffset + n, d);\n                t.getEngine()._uploadCompressedDataToTextureDirectly(t, this.glInternalFormat, i, o, y, p, s), n += d, n += 3 - (d + 3) % 4;\n              }\n              i = Math.max(1, 0.5 * i), o = Math.max(1, 0.5 * o);\n            }\n          }, r.IsValid = function(t) {\n            if (t.byteLength >= 12) {\n              var e = new Uint8Array(t.buffer, t.byteOffset, 12);\n              if (e[0] === 171 && e[1] === 75 && e[2] === 84 && e[3] === 88 && e[4] === 32 && e[5] === 49 && e[6] === 49 && e[7] === 187 && e[8] === 13 && e[9] === 10 && e[10] === 26 && e[11] === 10)\n                return !0;\n            }\n            return !1;\n          }, r.HEADER_LEN = 64, r.COMPRESSED_2D = 0, r.COMPRESSED_3D = 1, r.TEX_2D = 2, r.TEX_3D = 3, r;\n        }(), xs = function() {\n          function r(t) {\n            this._pendingActions = new Array(), this._workerInfos = t.map(function(e) {\n              return { worker: e, active: !1 };\n            });\n          }\n          return r.prototype.dispose = function() {\n            for (var t = 0, e = this._workerInfos; t < e.length; t++)\n              e[t].worker.terminate();\n            this._workerInfos = [], this._pendingActions = [];\n          }, r.prototype.push = function(t) {\n            for (var e = 0, n = this._workerInfos; e < n.length; e++) {\n              var i = n[e];\n              if (!i.active)\n                return void this._execute(i, t);\n            }\n            this._pendingActions.push(t);\n          }, r.prototype._execute = function(t, e) {\n            var n = this;\n            t.active = !0, e(t.worker, function() {\n              t.active = !1;\n              var i = n._pendingActions.shift();\n              i && n._execute(t, i);\n            });\n          }, r;\n        }(), Cs = function() {\n          function r(t, e) {\n            e === void 0 && (e = r.DefaultNumWorkers), this._engine = t, r._Initialized || r._CreateWorkerPool(e);\n          }\n          return r.GetDefaultNumWorkers = function() {\n            return typeof navigator == \"object\" && navigator.hardwareConcurrency ? Math.min(Math.floor(0.5 * navigator.hardwareConcurrency), 4) : 1;\n          }, r._CreateWorkerPool = function(t) {\n            this._Initialized = !0, t && typeof Worker == \"function\" ? r._WorkerPoolPromise = new Promise(function(e) {\n              for (var n = \"(\" + Hp + \")()\", i = URL.createObjectURL(new Blob([n], { type: \"application/javascript\" })), o = new Array(t), a = 0; a < o.length; a++)\n                o[a] = new Promise(function(s, d) {\n                  var p = new Worker(i), y = function(R) {\n                    p.removeEventListener(\"error\", y), p.removeEventListener(\"message\", P), d(R);\n                  }, P = function(R) {\n                    R.data.action === \"init\" && (p.removeEventListener(\"error\", y), p.removeEventListener(\"message\", P), s(p));\n                  };\n                  p.addEventListener(\"error\", y), p.addEventListener(\"message\", P), p.postMessage({ action: \"init\", urls: r.URLConfig });\n                });\n              Promise.all(o).then(function(s) {\n                e(new xs(s));\n              });\n            }) : (KTX2DECODER.MSCTranscoder.UseFromWorkerThread = !1, KTX2DECODER.WASMMemoryManager.LoadBinariesFromCurrentThread = !0);\n          }, r.prototype.uploadAsync = function(t, e, n) {\n            var i = this, o = this._engine.getCaps(), a = { astc: !!o.astc, bptc: !!o.bptc, s3tc: !!o.s3tc, pvrtc: !!o.pvrtc, etc2: !!o.etc2, etc1: !!o.etc1 };\n            return r._WorkerPoolPromise ? r._WorkerPoolPromise.then(function(s) {\n              return new Promise(function(d, p) {\n                s.push(function(y, P) {\n                  var R = function(F) {\n                    y.removeEventListener(\"error\", R), y.removeEventListener(\"message\", B), p(F), P();\n                  }, B = function(F) {\n                    if (F.data.action === \"decoded\") {\n                      if (y.removeEventListener(\"error\", R), y.removeEventListener(\"message\", B), F.data.success)\n                        try {\n                          i._createTexture(F.data.decodedData, e, n), d();\n                        } catch (z) {\n                          p({ message: z });\n                        }\n                      else\n                        p({ message: F.data.msg });\n                      P();\n                    }\n                  };\n                  y.addEventListener(\"error\", R), y.addEventListener(\"message\", B), y.postMessage({ action: \"decode\", data: t, caps: a, options: n });\n                });\n              });\n            }) : new Promise(function(s, d) {\n              r._Ktx2Decoder || (r._Ktx2Decoder = new KTX2DECODER.KTX2Decoder()), r._Ktx2Decoder.decode(t, o).then(function(p) {\n                i._createTexture(p, e), s();\n              }).catch(function(p) {\n                d({ message: p });\n              });\n            });\n          }, r.prototype.dispose = function() {\n            r._WorkerPoolPromise && r._WorkerPoolPromise.then(function(t) {\n              t.dispose();\n            }), delete r._WorkerPoolPromise;\n          }, r.prototype._createTexture = function(t, e, n) {\n            if (this._engine._bindTextureDirectly(this._engine._gl.TEXTURE_2D, e), n && (n.transcodedFormat = t.transcodedFormat, n.isInGammaSpace = t.isInGammaSpace, n.transcoderName = t.transcoderName), t.transcodedFormat === 32856 ? (e.type = h.a.TEXTURETYPE_UNSIGNED_BYTE, e.format = h.a.TEXTUREFORMAT_RGBA) : e.format = t.transcodedFormat, e._gammaSpace = t.isInGammaSpace, t.errors)\n              throw new Error(\"KTX2 container - could not transcode the data. \" + t.errors);\n            for (var i = 0; i < t.mipmaps.length; ++i) {\n              var o = t.mipmaps[i];\n              if (!o || !o.data)\n                throw new Error(\"KTX2 container - could not transcode one of the image\");\n              t.transcodedFormat === 32856 ? (e.width = o.width, e.height = o.height, this._engine._uploadDataToTextureDirectly(e, o.data, 0, i, void 0, !0)) : this._engine._uploadCompressedDataToTextureDirectly(e, t.transcodedFormat, o.width, o.height, o.data, 0, i);\n            }\n            e.width = t.mipmaps[0].width, e.height = t.mipmaps[0].height, e.generateMipMaps = t.mipmaps.length > 1, e.isReady = !0, this._engine._bindTextureDirectly(this._engine._gl.TEXTURE_2D, null);\n          }, r.IsValid = function(t) {\n            if (t.byteLength >= 12) {\n              var e = new Uint8Array(t.buffer, t.byteOffset, 12);\n              if (e[0] === 171 && e[1] === 75 && e[2] === 84 && e[3] === 88 && e[4] === 32 && e[5] === 50 && e[6] === 48 && e[7] === 187 && e[8] === 13 && e[9] === 10 && e[10] === 26 && e[11] === 10)\n                return !0;\n            }\n            return !1;\n          }, r.URLConfig = { jsDecoderModule: \"https://preview.babylonjs.com/babylon.ktx2Decoder.js\", wasmUASTCToASTC: null, wasmUASTCToBC7: null, wasmUASTCToRGBA_UNORM: null, wasmUASTCToRGBA_SRGB: null, jsMSCTranscoder: null, wasmMSCTranscoder: null }, r.DefaultNumWorkers = r.GetDefaultNumWorkers(), r;\n        }();\n        function Hp() {\n          var r;\n          onmessage = function(t) {\n            switch (t.data.action) {\n              case \"init\":\n                var e = t.data.urls;\n                importScripts(e.jsDecoderModule), e.wasmUASTCToASTC !== null && (KTX2DECODER.LiteTranscoder_UASTC_ASTC.WasmModuleURL = e.wasmUASTCToASTC), e.wasmUASTCToBC7 !== null && (KTX2DECODER.LiteTranscoder_UASTC_BC7.WasmModuleURL = e.wasmUASTCToBC7), e.wasmUASTCToRGBA_UNORM !== null && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_UNORM.WasmModuleURL = e.wasmUASTCToRGBA_UNORM), e.wasmUASTCToRGBA_SRGB !== null && (KTX2DECODER.LiteTranscoder_UASTC_RGBA_SRGB.WasmModuleURL = e.wasmUASTCToRGBA_SRGB), e.jsMSCTranscoder !== null && (KTX2DECODER.MSCTranscoder.JSModuleURL = e.jsMSCTranscoder), e.wasmMSCTranscoder !== null && (KTX2DECODER.MSCTranscoder.WasmModuleURL = e.wasmMSCTranscoder), r = new KTX2DECODER.KTX2Decoder(), postMessage({ action: \"init\" });\n                break;\n              case \"decode\":\n                r.decode(t.data.data, t.data.caps, t.data.options).then(function(n) {\n                  for (var i = [], o = 0; o < n.mipmaps.length; ++o) {\n                    var a = n.mipmaps[o];\n                    a && a.data && i.push(a.data.buffer);\n                  }\n                  postMessage({ action: \"decoded\", success: !0, decodedData: n }, i);\n                }).catch(function(n) {\n                  postMessage({ action: \"decoded\", success: !1, msg: n });\n                });\n            }\n          };\n        }\n        var nu = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t, e) {\n            return Hn.a.EndsWith(t, \".ktx\") || Hn.a.EndsWith(t, \".ktx2\") || e === \"image/ktx\" || e === \"image/ktx2\";\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            if (!Array.isArray(t)) {\n              e._invertVScale = !e.invertY;\n              var a = e.getEngine(), s = new Yo(t, 6), d = s.numberOfMipmapLevels > 1 && e.generateMipMaps;\n              a._unpackFlipY(!0), s.uploadLevels(e, e.generateMipMaps), e.width = s.pixelWidth, e.height = s.pixelHeight, a._setCubeMapTextureParams(e, d), e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i();\n            }\n          }, r.prototype.loadData = function(t, e, n, i) {\n            if (Yo.IsValid(t)) {\n              e._invertVScale = !e.invertY;\n              var o = new Yo(t, 1);\n              n(o.pixelWidth, o.pixelHeight, e.generateMipMaps, !0, function() {\n                o.uploadLevels(e, e.generateMipMaps);\n              }, o.isInvalid);\n            } else\n              Cs.IsValid(t) ? new Cs(e.getEngine()).uploadAsync(t, e, i).then(function() {\n                n(e.width, e.height, e.generateMipMaps, !0, function() {\n                }, !1);\n              }, function(a) {\n                l.a.Warn(\"Failed to load KTX2 texture data: \" + a.message), n(0, 0, !1, !1, function() {\n                }, !0);\n              }) : (l.a.Error(\"texture missing KTX identifier\"), n(0, 0, !1, !1, function() {\n              }, !0));\n          }, r;\n        }();\n        Ue.a._TextureLoaders.unshift(new nu());\n        var iu = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, u.e.Zero(), n) || this;\n            return o._xrSessionManager = i, o._firstFrame = !1, o._referenceQuaternion = u.b.Identity(), o._referencedPosition = new u.e(), o._xrInvPositionCache = new u.e(), o._xrInvQuaternionCache = u.b.Identity(), o._trackingState = Yi.NOT_TRACKING, o.onBeforeCameraTeleport = new C.c(), o.onAfterCameraTeleport = new C.c(), o.onTrackingStateChanged = new C.c(), o.compensateOnFirstFrame = !0, o._rotate180 = new u.b(0, 1, 0, 0), o.minZ = 0.1, o.rotationQuaternion = new u.b(), o.cameraRigMode = _t.a.RIG_MODE_CUSTOM, o.updateUpVectorFromRotation = !0, o._updateNumberOfRigCameras(1), o.freezeProjectionMatrix(), o._xrSessionManager.onXRSessionInit.add(function() {\n              o._referencedPosition.copyFromFloats(0, 0, 0), o._referenceQuaternion.copyFromFloats(0, 0, 0, 1), o._firstFrame = o.compensateOnFirstFrame;\n            }), o._xrSessionManager.onXRFrameObservable.add(function(a) {\n              o._firstFrame && o._updateFromXRSession(), o._updateReferenceSpace(), o._updateFromXRSession();\n            }, void 0, !0), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"trackingState\", { get: function() {\n            return this._trackingState;\n          }, enumerable: !1, configurable: !0 }), t.prototype._setTrackingState = function(e) {\n            this._trackingState !== e && (this._trackingState = e, this.onTrackingStateChanged.notifyObservers(e));\n          }, Object.defineProperty(t.prototype, \"realWorldHeight\", { get: function() {\n            var e = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.baseReferenceSpace);\n            return e && e.transform ? e.transform.position.y : 0;\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateForDualEyeDebugging = function() {\n            this._updateNumberOfRigCameras(2), this.rigCameras[0].viewport = new jn.a(0, 0, 0.5, 1), this.rigCameras[0].outputRenderTarget = null, this.rigCameras[1].viewport = new jn.a(0.5, 0, 0.5, 1), this.rigCameras[1].outputRenderTarget = null;\n          }, t.prototype.setTransformationFromNonVRCamera = function(e, n) {\n            e === void 0 && (e = this.getScene().activeCamera), n === void 0 && (n = !0), e && e !== this && (e.computeWorldMatrix().decompose(void 0, this.rotationQuaternion, this.position), this.position.y = 0, u.b.FromEulerAnglesToRef(0, this.rotationQuaternion.toEulerAngles().y, 0, this.rotationQuaternion), this._firstFrame = !0, n && this._xrSessionManager.resetReferenceSpace());\n          }, t.prototype.getClassName = function() {\n            return \"WebXRCamera\";\n          }, t.prototype._updateFromXRSession = function() {\n            var e = this, n = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(this._xrSessionManager.referenceSpace);\n            if (n) {\n              var i = n.emulatedPosition ? Yi.TRACKING_LOST : Yi.TRACKING;\n              if (this._setTrackingState(i), n.transform) {\n                var o = n.transform.position;\n                this._referencedPosition.set(o.x, o.y, o.z);\n                var a = n.transform.orientation;\n                this._referenceQuaternion.set(a.x, a.y, a.z, a.w), this._scene.useRightHandedSystem || (this._referencedPosition.z *= -1, this._referenceQuaternion.z *= -1, this._referenceQuaternion.w *= -1), this._firstFrame ? (this._firstFrame = !1, this.position.y += this._referencedPosition.y, this._referenceQuaternion.copyFromFloats(0, 0, 0, 1)) : (this.rotationQuaternion.copyFrom(this._referenceQuaternion), this.position.copyFrom(this._referencedPosition));\n              }\n              this.rigCameras.length !== n.views.length && this._updateNumberOfRigCameras(n.views.length), n.views.forEach(function(s, d) {\n                var p = e.rigCameras[d];\n                p.isLeftCamera || p.isRightCamera || (s.eye === \"right\" ? p._isRightCamera = !0 : s.eye === \"left\" && (p._isLeftCamera = !0));\n                var y = s.transform.position, P = s.transform.orientation;\n                if (p.position.set(y.x, y.y, y.z), p.rotationQuaternion.set(P.x, P.y, P.z, P.w), e._scene.useRightHandedSystem ? p.rotationQuaternion.multiplyInPlace(e._rotate180) : (p.position.z *= -1, p.rotationQuaternion.z *= -1, p.rotationQuaternion.w *= -1), u.a.FromFloat32ArrayToRefScaled(s.projectionMatrix, 0, 1, p._projectionMatrix), e._scene.useRightHandedSystem || p._projectionMatrix.toggleProjectionMatrixHandInPlace(), d === 0 && e._projectionMatrix.copyFrom(p._projectionMatrix), e._xrSessionManager.session.renderState.baseLayer) {\n                  var R = e._xrSessionManager.session.renderState.baseLayer.getViewport(s), B = e._xrSessionManager.session.renderState.baseLayer.framebufferWidth, F = e._xrSessionManager.session.renderState.baseLayer.framebufferHeight;\n                  p.viewport.width = R.width / B, p.viewport.height = R.height / F, p.viewport.x = R.x / B, p.viewport.y = R.y / F;\n                }\n                p.outputRenderTarget = e._xrSessionManager.getRenderTargetTextureForEye(s.eye);\n              });\n            } else\n              this._setTrackingState(Yi.NOT_TRACKING);\n          }, t.prototype._updateNumberOfRigCameras = function(e) {\n            for (e === void 0 && (e = 1); this.rigCameras.length < e; ) {\n              var n = new xi(\"XR-RigCamera: \" + this.rigCameras.length, u.e.Zero(), this.getScene());\n              n.minZ = 0.1, n.rotationQuaternion = new u.b(), n.updateUpVectorFromRotation = !0, n.isRigCamera = !0, n.rigParent = this, n.freezeProjectionMatrix(), this.rigCameras.push(n);\n            }\n            for (; this.rigCameras.length > e; ) {\n              var i = this.rigCameras.pop();\n              i && i.dispose();\n            }\n          }, t.prototype._updateReferenceSpace = function() {\n            this.position.equals(this._referencedPosition) && this.rotationQuaternion.equals(this._referenceQuaternion) || (this.position.subtractToRef(this._referencedPosition, this._referencedPosition), this._referenceQuaternion.conjugateInPlace(), this._referenceQuaternion.multiplyToRef(this.rotationQuaternion, this._referenceQuaternion), this._updateReferenceSpaceOffset(this._referencedPosition, this._referenceQuaternion.normalize()));\n          }, t.prototype._updateReferenceSpaceOffset = function(e, n, i) {\n            if (i === void 0 && (i = !1), this._xrSessionManager.referenceSpace && this._xrSessionManager.currentFrame) {\n              this._xrInvPositionCache.copyFrom(e), n ? this._xrInvQuaternionCache.copyFrom(n) : this._xrInvQuaternionCache.copyFromFloats(0, 0, 0, 1), this._scene.useRightHandedSystem || (this._xrInvPositionCache.z *= -1, this._xrInvQuaternionCache.z *= -1, this._xrInvQuaternionCache.w *= -1), this._xrInvPositionCache.negateInPlace(), this._xrInvQuaternionCache.conjugateInPlace(), this._xrInvPositionCache.rotateByQuaternionToRef(this._xrInvQuaternionCache, this._xrInvPositionCache), i && (this._xrInvPositionCache.y = 0);\n              var o = new XRRigidTransform({ x: this._xrInvPositionCache.x, y: this._xrInvPositionCache.y, z: this._xrInvPositionCache.z }, { x: this._xrInvQuaternionCache.x, y: this._xrInvQuaternionCache.y, z: this._xrInvQuaternionCache.z, w: this._xrInvQuaternionCache.w }), a = this._xrSessionManager.referenceSpace.getOffsetReferenceSpace(o), s = this._xrSessionManager.currentFrame && this._xrSessionManager.currentFrame.getViewerPose(a);\n              if (s) {\n                var d = new u.e(s.transform.position.x, s.transform.position.y, s.transform.position.z);\n                this._scene.useRightHandedSystem || (d.z *= -1), this.position.subtractToRef(d, d), this._scene.useRightHandedSystem || (d.z *= -1), d.negateInPlace();\n                var p = new XRRigidTransform({ x: d.x, y: d.y, z: d.z });\n                this._xrSessionManager.referenceSpace = a.getOffsetReferenceSpace(p);\n              }\n            }\n          }, t;\n        }(zn), ti = function() {\n          function r() {\n          }\n          return r.ANCHOR_SYSTEM = \"xr-anchor-system\", r.BACKGROUND_REMOVER = \"xr-background-remover\", r.HIT_TEST = \"xr-hit-test\", r.PHYSICS_CONTROLLERS = \"xr-physics-controller\", r.PLANE_DETECTION = \"xr-plane-detection\", r.POINTER_SELECTION = \"xr-controller-pointer-selection\", r.TELEPORTATION = \"xr-controller-teleportation\", r.FEATURE_POINTS = \"xr-feature-points\", r.HAND_TRACKING = \"xr-hand-tracking\", r;\n        }(), Wn = function() {\n          function r(t) {\n            var e = this;\n            this._xrSessionManager = t, this._features = {}, this._xrSessionManager.onXRSessionInit.add(function() {\n              e.getEnabledFeatures().forEach(function(n) {\n                var i = e._features[n];\n                !i.enabled || i.featureImplementation.attached || i.featureImplementation.disableAutoAttach || e.attachFeature(n);\n              });\n            }), this._xrSessionManager.onXRSessionEnded.add(function() {\n              e.getEnabledFeatures().forEach(function(n) {\n                var i = e._features[n];\n                i.enabled && i.featureImplementation.attached && e.detachFeature(n);\n              });\n            });\n          }\n          return r.AddWebXRFeature = function(t, e, n, i) {\n            n === void 0 && (n = 1), i === void 0 && (i = !1), this._AvailableFeatures[t] = this._AvailableFeatures[t] || { latest: n }, n > this._AvailableFeatures[t].latest && (this._AvailableFeatures[t].latest = n), i && (this._AvailableFeatures[t].stable = n), this._AvailableFeatures[t][n] = e;\n          }, r.ConstructFeature = function(t, e, n, i) {\n            e === void 0 && (e = 1);\n            var o = this._AvailableFeatures[t][e];\n            if (!o)\n              throw new Error(\"feature not found\");\n            return o(n, i);\n          }, r.GetAvailableFeatures = function() {\n            return Object.keys(this._AvailableFeatures);\n          }, r.GetAvailableVersions = function(t) {\n            return Object.keys(this._AvailableFeatures[t]);\n          }, r.GetLatestVersionOfFeature = function(t) {\n            return this._AvailableFeatures[t] && this._AvailableFeatures[t].latest || -1;\n          }, r.GetStableVersionOfFeature = function(t) {\n            return this._AvailableFeatures[t] && this._AvailableFeatures[t].stable || -1;\n          }, r.prototype.attachFeature = function(t) {\n            var e = this._features[t];\n            e && e.enabled && !e.featureImplementation.attached && e.featureImplementation.attach();\n          }, r.prototype.detachFeature = function(t) {\n            var e = this._features[t];\n            e && e.featureImplementation.attached && e.featureImplementation.detach();\n          }, r.prototype.disableFeature = function(t) {\n            var e = typeof t == \"string\" ? t : t.Name, n = this._features[e];\n            return !(!n || !n.enabled) && (n.enabled = !1, this.detachFeature(e), n.featureImplementation.dispose(), !0);\n          }, r.prototype.dispose = function() {\n            var t = this;\n            this.getEnabledFeatures().forEach(function(e) {\n              t.disableFeature(e), t._features[e].featureImplementation.dispose();\n            });\n          }, r.prototype.enableFeature = function(t, e, n, i, o) {\n            var a = this;\n            e === void 0 && (e = \"latest\"), n === void 0 && (n = {}), i === void 0 && (i = !0), o === void 0 && (o = !0);\n            var s = typeof t == \"string\" ? t : t.Name, d = 0;\n            if (typeof e == \"string\") {\n              if (!e)\n                throw new Error(\"Error in provided version - \" + s + \" (\" + e + \")\");\n              if ((d = e === \"stable\" ? r.GetStableVersionOfFeature(s) : e === \"latest\" ? r.GetLatestVersionOfFeature(s) : +e) === -1 || isNaN(d))\n                throw new Error(\"feature not found - \" + s + \" (\" + e + \")\");\n            } else\n              d = e;\n            var p = this._features[s], y = r.ConstructFeature(s, d, this._xrSessionManager, n);\n            if (!y)\n              throw new Error(\"feature not found - \" + s);\n            p && this.disableFeature(s);\n            var P = y();\n            if (P.dependsOn && !P.dependsOn.every(function(R) {\n              return !!a._features[R];\n            }))\n              throw new Error(\"Dependant features missing. Make sure the following features are enabled - \" + P.dependsOn.join(\", \"));\n            if (P.isCompatible())\n              return this._features[s] = { featureImplementation: P, enabled: !0, version: d, required: o }, i ? this._xrSessionManager.session && !this._features[s].featureImplementation.attached && this.attachFeature(s) : this._features[s].featureImplementation.disableAutoAttach = !0, this._features[s].featureImplementation;\n            if (o)\n              throw new Error(\"required feature not compatible\");\n            return Xe.b.Warn(\"Feature \" + s + \" not compatible with the current environment/browser and was not enabled.\"), P;\n          }, r.prototype.getEnabledFeature = function(t) {\n            return this._features[t] && this._features[t].featureImplementation;\n          }, r.prototype.getEnabledFeatures = function() {\n            return Object.keys(this._features);\n          }, r.prototype.extendXRSessionInitObject = function(t) {\n            var e = this;\n            return this.getEnabledFeatures().forEach(function(n) {\n              var i = e._features[n], o = i.featureImplementation.xrNativeFeatureName;\n              o && (i.required ? (t.requiredFeatures = t.requiredFeatures || [], t.requiredFeatures.indexOf(o) === -1 && t.requiredFeatures.push(o)) : (t.optionalFeatures = t.optionalFeatures || [], t.optionalFeatures.indexOf(o) === -1 && t.optionalFeatures.push(o)));\n            }), t;\n          }, r._AvailableFeatures = {}, r;\n        }(), ru = function() {\n          function r(t) {\n            var e = this;\n            this.scene = t, this._nonVRCamera = null, this._originalSceneAutoClear = !0, this._supported = !1, this.onInitialXRPoseSetObservable = new C.c(), this.onStateChangedObservable = new C.c(), this.state = fn.NOT_IN_XR, this.sessionManager = new rs(t), this.camera = new iu(\"\", t, this.sessionManager), this.featuresManager = new Wn(this.sessionManager), t.onDisposeObservable.add(function() {\n              e.exitXRAsync();\n            });\n          }\n          return r.CreateAsync = function(t) {\n            var e = new r(t);\n            return e.sessionManager.initializeAsync().then(function() {\n              return e._supported = !0, e;\n            }).catch(function(n) {\n              throw e._setState(fn.NOT_IN_XR), e.dispose(), n;\n            });\n          }, r.prototype.dispose = function() {\n            this.camera.dispose(), this.onStateChangedObservable.clear(), this.onInitialXRPoseSetObservable.clear(), this.sessionManager.dispose(), this._nonVRCamera && (this.scene.activeCamera = this._nonVRCamera);\n          }, r.prototype.enterXRAsync = function(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = this.sessionManager.getWebXRRenderTarget()), i === void 0 && (i = {}), !this._supported)\n              throw \"WebXR not supported in this browser or environment\";\n            return this._setState(fn.ENTERING_XR), e !== \"viewer\" && e !== \"local\" && (i.optionalFeatures = i.optionalFeatures || [], i.optionalFeatures.push(e)), this.featuresManager.extendXRSessionInitObject(i), t === \"immersive-ar\" && e !== \"unbounded\" && l.a.Warn(\"We recommend using 'unbounded' reference space type when using 'immersive-ar' session mode\"), this.sessionManager.initializeSessionAsync(t, i).then(function() {\n              return o.sessionManager.setReferenceSpaceTypeAsync(e);\n            }).then(function() {\n              return n.initializeXRLayerAsync(o.sessionManager.session);\n            }).then(function() {\n              return o.sessionManager.updateRenderStateAsync({ depthFar: o.camera.maxZ, depthNear: o.camera.minZ, baseLayer: n.xrLayer });\n            }).then(function() {\n              return o.sessionManager.runXRRenderLoop(), o._originalSceneAutoClear = o.scene.autoClear, o._nonVRCamera = o.scene.activeCamera, o.scene.activeCamera = o.camera, t !== \"immersive-ar\" ? o._nonXRToXRCamera() : (o.scene.autoClear = !1, o.camera.compensateOnFirstFrame = !1), o.sessionManager.onXRSessionEnded.addOnce(function() {\n                o.camera.rigCameras.forEach(function(a) {\n                  a.outputRenderTarget = null;\n                }), o.scene.autoClear = o._originalSceneAutoClear, o.scene.activeCamera = o._nonVRCamera, t !== \"immersive-ar\" && o.camera.compensateOnFirstFrame && (o._nonVRCamera.setPosition ? o._nonVRCamera.setPosition(o.camera.position) : o._nonVRCamera.position.copyFrom(o.camera.position)), o._setState(fn.NOT_IN_XR);\n              }), o.sessionManager.onXRFrameObservable.addOnce(function() {\n                o._setState(fn.IN_XR);\n              }), o.sessionManager;\n            }).catch(function(a) {\n              throw console.log(a), console.log(a.message), o._setState(fn.NOT_IN_XR), a;\n            });\n          }, r.prototype.exitXRAsync = function() {\n            return this.state !== fn.IN_XR ? Promise.resolve() : (this._setState(fn.EXITING_XR), this.sessionManager.exitXRAsync());\n          }, r.prototype._nonXRToXRCamera = function() {\n            this.camera.setTransformationFromNonVRCamera(this._nonVRCamera), this.onInitialXRPoseSetObservable.notifyObservers(this.camera);\n          }, r.prototype._setState = function(t) {\n            this.state !== t && (this.state = t, this.onStateChangedObservable.notifyObservers(this.state));\n          }, r;\n        }(), yr = function() {\n          function r(t, e, n, i) {\n            n === void 0 && (n = -1), i === void 0 && (i = []), this.id = t, this.type = e, this._buttonIndex = n, this._axesIndices = i, this._axes = { x: 0, y: 0 }, this._changes = {}, this._currentValue = 0, this._hasChanges = !1, this._pressed = !1, this._touched = !1, this.onAxisValueChangedObservable = new C.c(), this.onButtonStateChangedObservable = new C.c();\n          }\n          return Object.defineProperty(r.prototype, \"axes\", { get: function() {\n            return this._axes;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"changes\", { get: function() {\n            return this._changes;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasChanges\", { get: function() {\n            return this._hasChanges;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"pressed\", { get: function() {\n            return this._pressed;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"touched\", { get: function() {\n            return this._touched;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"value\", { get: function() {\n            return this._currentValue;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.onAxisValueChangedObservable.clear(), this.onButtonStateChangedObservable.clear();\n          }, r.prototype.isAxes = function() {\n            return this._axesIndices.length !== 0;\n          }, r.prototype.isButton = function() {\n            return this._buttonIndex !== -1;\n          }, r.prototype.update = function(t) {\n            var e = !1, n = !1;\n            if (this._hasChanges = !1, this._changes = {}, this.isButton()) {\n              var i = t.buttons[this._buttonIndex];\n              if (!i)\n                return;\n              this._currentValue !== i.value && (this.changes.value = { current: i.value, previous: this._currentValue }, e = !0, this._currentValue = i.value), this._touched !== i.touched && (this.changes.touched = { current: i.touched, previous: this._touched }, e = !0, this._touched = i.touched), this._pressed !== i.pressed && (this.changes.pressed = { current: i.pressed, previous: this._pressed }, e = !0, this._pressed = i.pressed);\n            }\n            this.isAxes() && (this._axes.x !== t.axes[this._axesIndices[0]] && (this.changes.axes = { current: { x: t.axes[this._axesIndices[0]], y: this._axes.y }, previous: { x: this._axes.x, y: this._axes.y } }, this._axes.x = t.axes[this._axesIndices[0]], n = !0), this._axes.y !== t.axes[this._axesIndices[1]] && (this.changes.axes ? this.changes.axes.current.y = t.axes[this._axesIndices[1]] : this.changes.axes = { current: { x: this._axes.x, y: t.axes[this._axesIndices[1]] }, previous: { x: this._axes.x, y: this._axes.y } }, this._axes.y = t.axes[this._axesIndices[1]], n = !0)), e && (this._hasChanges = !0, this.onButtonStateChangedObservable.notifyObservers(this)), n && (this._hasChanges = !0, this.onAxisValueChangedObservable.notifyObservers(this._axes));\n          }, r.BUTTON_TYPE = \"button\", r.SQUEEZE_TYPE = \"squeeze\", r.THUMBSTICK_TYPE = \"thumbstick\", r.TOUCHPAD_TYPE = \"touchpad\", r.TRIGGER_TYPE = \"trigger\", r;\n        }(), br = function() {\n          function r(t, e, n, i, o) {\n            var a = this;\n            this.scene = t, this.layout = e, this.gamepadObject = n, this.handedness = i, this._initComponent = function(s) {\n              if (s) {\n                var d = a.layout.components[s], p = d.type, y = d.gamepadIndices.button, P = [];\n                d.gamepadIndices.xAxis !== void 0 && d.gamepadIndices.yAxis !== void 0 && P.push(d.gamepadIndices.xAxis, d.gamepadIndices.yAxis), a.components[s] = new yr(s, p, y, P);\n              }\n            }, this._modelReady = !1, this.components = {}, this.disableAnimation = !1, this.onModelLoadedObservable = new C.c(), e.components && Object.keys(e.components).forEach(this._initComponent);\n          }\n          return r.prototype.dispose = function() {\n            var t = this;\n            this.getComponentIds().forEach(function(e) {\n              return t.getComponent(e).dispose();\n            }), this.rootMesh && this.rootMesh.dispose();\n          }, r.prototype.getAllComponentsOfType = function(t) {\n            var e = this;\n            return this.getComponentIds().map(function(n) {\n              return e.components[n];\n            }).filter(function(n) {\n              return n.type === t;\n            });\n          }, r.prototype.getComponent = function(t) {\n            return this.components[t];\n          }, r.prototype.getComponentIds = function() {\n            return Object.keys(this.components);\n          }, r.prototype.getComponentOfType = function(t) {\n            return this.getAllComponentsOfType(t)[0] || null;\n          }, r.prototype.getMainComponent = function() {\n            return this.getComponent(this.layout.selectComponentId);\n          }, r.prototype.loadModel = function() {\n            return Object(c.b)(this, void 0, void 0, function() {\n              var t, e, n = this;\n              return Object(c.e)(this, function(i) {\n                return t = !this._getModelLoadingConstraints(), e = this._getGenericFilenameAndPath(), t ? l.a.Warn(\"Falling back to generic models\") : e = this._getFilenameAndPath(), [2, new Promise(function(o, a) {\n                  Ft.ImportMesh(\"\", e.path, e.filename, n.scene, function(s) {\n                    t ? n._getGenericParentMesh(s) : n._setRootMesh(s), n._processLoadedModel(s), n._modelReady = !0, n.onModelLoadedObservable.notifyObservers(n), o(!0);\n                  }, null, function(s, d) {\n                    l.a.Log(d), l.a.Warn(\"Failed to retrieve controller model of type \" + n.profileId + \" from the remote server: \" + e.path + e.filename), a(d);\n                  });\n                })];\n              });\n            });\n          }, r.prototype.updateFromXRFrame = function(t) {\n            var e = this;\n            this.getComponentIds().forEach(function(n) {\n              return e.getComponent(n).update(e.gamepadObject);\n            }), this.updateModel(t);\n          }, Object.defineProperty(r.prototype, \"handness\", { get: function() {\n            return this.handedness;\n          }, enumerable: !1, configurable: !0 }), r.prototype.pulse = function(t, e, n) {\n            return n === void 0 && (n = 0), this.gamepadObject.hapticActuators && this.gamepadObject.hapticActuators[n] ? this.gamepadObject.hapticActuators[n].pulse(t, e) : Promise.resolve(!1);\n          }, r.prototype._getChildByName = function(t, e) {\n            return t.getChildren(function(n) {\n              return n.name === e;\n            }, !1)[0];\n          }, r.prototype._getImmediateChildByName = function(t, e) {\n            return t.getChildren(function(n) {\n              return n.name == e;\n            }, !0)[0];\n          }, r.prototype._lerpTransform = function(t, e, n) {\n            if (t.minMesh && t.maxMesh && t.valueMesh && t.minMesh.rotationQuaternion && t.maxMesh.rotationQuaternion && t.valueMesh.rotationQuaternion) {\n              var i = n ? 0.5 * e + 0.5 : e;\n              u.b.SlerpToRef(t.minMesh.rotationQuaternion, t.maxMesh.rotationQuaternion, i, t.valueMesh.rotationQuaternion), u.e.LerpToRef(t.minMesh.position, t.maxMesh.position, i, t.valueMesh.position);\n            }\n          }, r.prototype.updateModel = function(t) {\n            this._modelReady && this._updateModel(t);\n          }, r.prototype._getGenericFilenameAndPath = function() {\n            return { filename: \"generic.babylon\", path: \"https://controllers.babylonjs.com/generic/\" };\n          }, r.prototype._getGenericParentMesh = function(t) {\n            var e = this;\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), t.forEach(function(n) {\n              n.parent || (n.isPickable = !1, n.setParent(e.rootMesh));\n            }), this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0);\n          }, r;\n        }(), Rs = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, Wp[i], n, i) || this;\n            return o.profileId = t.ProfileId, o;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: \"generic.babylon\", path: \"https://controllers.babylonjs.com/generic/\" };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            return !0;\n          }, t.prototype._processLoadedModel = function(e) {\n          }, t.prototype._setRootMesh = function(e) {\n            var n = this;\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), e.forEach(function(i) {\n              i.isPickable = !1, i.parent || i.setParent(n.rootMesh);\n            }), this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0);\n          }, t.prototype._updateModel = function() {\n          }, t.ProfileId = \"generic-trigger\", t;\n        }(br), Wp = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"generic-trigger-left\", assetPath: \"left.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"generic-trigger-right\", assetPath: \"right.glb\" }, none: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"generic-trigger-none\", assetPath: \"none.glb\" } }, ou = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, i.layouts[n.handedness || \"none\"], n.gamepad, n.handedness) || this;\n            return a._repositoryUrl = o, a._buttonMeshMapping = {}, a._touchDots = {}, a.profileId = i.profileId, a;\n          }\n          return Object(c.d)(t, r), t.prototype.dispose = function() {\n            var e = this;\n            r.prototype.dispose.call(this), Object.keys(this._touchDots).forEach(function(n) {\n              e._touchDots[n].dispose();\n            });\n          }, t.prototype._getFilenameAndPath = function() {\n            return { filename: this.layout.assetPath, path: this._repositoryUrl + \"/profiles/\" + this.profileId + \"/\" };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            var e = Ft.IsPluginForExtensionAvailable(\".glb\");\n            return e || l.a.Warn(\"glTF / glb loaded was not registered, using generic controller instead\"), e;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this;\n            this.getComponentIds().forEach(function(i) {\n              var o = n.layout.components[i];\n              n._buttonMeshMapping[i] = { mainMesh: n._getChildByName(n.rootMesh, o.rootNodeName), states: {} }, Object.keys(o.visualResponses).forEach(function(a) {\n                var s = o.visualResponses[a];\n                if (s.valueNodeProperty === \"transform\")\n                  n._buttonMeshMapping[i].states[a] = { valueMesh: n._getChildByName(n.rootMesh, s.valueNodeName), minMesh: n._getChildByName(n.rootMesh, s.minNodeName), maxMesh: n._getChildByName(n.rootMesh, s.maxNodeName) };\n                else {\n                  var d = o.type === yr.TOUCHPAD_TYPE && o.touchPointNodeName ? o.touchPointNodeName : s.valueNodeName;\n                  if (n._buttonMeshMapping[i].states[a] = { valueMesh: n._getChildByName(n.rootMesh, d) }, o.type === yr.TOUCHPAD_TYPE && !n._touchDots[a]) {\n                    var p = Nn.a.CreateSphere(a + \"dot\", { diameter: 15e-4, segments: 8 }, n.scene);\n                    p.material = new Nt.a(a + \"mat\", n.scene), p.material.diffuseColor = I.a.Red(), p.parent = n._buttonMeshMapping[i].states[a].valueMesh || null, p.isVisible = !1, n._touchDots[a] = p;\n                  }\n                }\n              });\n            });\n          }, t.prototype._setRootMesh = function(e) {\n            var n;\n            this.rootMesh = new Ie.a(this.profileId + \"-\" + this.handedness, this.scene), this.rootMesh.isPickable = !1;\n            for (var i = 0; i < e.length; i++) {\n              var o = e[i];\n              o.isPickable = !1, o.parent || (n = o);\n            }\n            n && n.setParent(this.rootMesh), this.scene.useRightHandedSystem || this.rootMesh.rotate(be.a.Y, Math.PI, be.c.WORLD);\n          }, t.prototype._updateModel = function(e) {\n            var n = this;\n            this.disableAnimation || this.getComponentIds().forEach(function(i) {\n              var o = n.getComponent(i);\n              if (o.hasChanges) {\n                var a = n._buttonMeshMapping[i], s = n.layout.components[i];\n                Object.keys(s.visualResponses).forEach(function(d) {\n                  var p = s.visualResponses[d], y = o.value;\n                  if (p.componentProperty === \"xAxis\" ? y = o.axes.x : p.componentProperty === \"yAxis\" && (y = o.axes.y), p.valueNodeProperty === \"transform\")\n                    n._lerpTransform(a.states[d], y, p.componentProperty !== \"button\");\n                  else {\n                    var P = a.states[d].valueMesh;\n                    P && (P.isVisible = o.touched || o.pressed), n._touchDots[d] && (n._touchDots[d].isVisible = o.touched || o.pressed);\n                  }\n                });\n              }\n            });\n          }, t;\n        }(br), wn = function() {\n          function r() {\n          }\n          return r.ClearProfilesCache = function() {\n            this._ProfilesList = null, this._ProfileLoadingPromises = {};\n          }, r.DefaultFallbacks = function() {\n            this.RegisterFallbacksForProfileId(\"google-daydream\", [\"generic-touchpad\"]), this.RegisterFallbacksForProfileId(\"htc-vive-focus\", [\"generic-trigger-touchpad\"]), this.RegisterFallbacksForProfileId(\"htc-vive\", [\"generic-trigger-squeeze-touchpad\"]), this.RegisterFallbacksForProfileId(\"magicleap-one\", [\"generic-trigger-squeeze-touchpad\"]), this.RegisterFallbacksForProfileId(\"windows-mixed-reality\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]), this.RegisterFallbacksForProfileId(\"microsoft-mixed-reality\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]), this.RegisterFallbacksForProfileId(\"oculus-go\", [\"generic-trigger-touchpad\"]), this.RegisterFallbacksForProfileId(\"oculus-touch-v2\", [\"oculus-touch\", \"generic-trigger-squeeze-thumbstick\"]), this.RegisterFallbacksForProfileId(\"oculus-touch\", [\"generic-trigger-squeeze-thumbstick\"]), this.RegisterFallbacksForProfileId(\"samsung-gearvr\", [\"windows-mixed-reality\", \"generic-trigger-squeeze-touchpad-thumbstick\"]), this.RegisterFallbacksForProfileId(\"samsung-odyssey\", [\"generic-touchpad\"]), this.RegisterFallbacksForProfileId(\"valve-index\", [\"generic-trigger-squeeze-touchpad-thumbstick\"]);\n          }, r.FindFallbackWithProfileId = function(t) {\n            var e = this._Fallbacks[t] || [];\n            return e.unshift(t), e;\n          }, r.GetMotionControllerWithXRInput = function(t, e, n) {\n            var i = this, o = [];\n            if (n && o.push(n), o.push.apply(o, t.profiles || []), o.length && !o[0] && o.pop(), t.gamepad && t.gamepad.id)\n              switch (t.gamepad.id) {\n                case (t.gamepad.id.match(/oculus touch/gi) ? t.gamepad.id : void 0):\n                  o.push(\"oculus-touch-v2\");\n              }\n            var a = o.indexOf(\"windows-mixed-reality\");\n            if (a !== -1 && o.splice(a, 0, \"microsoft-mixed-reality\"), o.length || o.push(\"generic-trigger\"), this.UseOnlineRepository) {\n              var s = this.PrioritizeOnlineRepository ? this._LoadProfileFromRepository : this._LoadProfilesFromAvailableControllers, d = this.PrioritizeOnlineRepository ? this._LoadProfilesFromAvailableControllers : this._LoadProfileFromRepository;\n              return s.call(this, o, t, e).catch(function() {\n                return d.call(i, o, t, e);\n              });\n            }\n            return this._LoadProfilesFromAvailableControllers(o, t, e);\n          }, r.RegisterController = function(t, e) {\n            this._AvailableControllers[t] = e;\n          }, r.RegisterFallbacksForProfileId = function(t, e) {\n            var n;\n            this._Fallbacks[t] ? (n = this._Fallbacks[t]).push.apply(n, e) : this._Fallbacks[t] = e;\n          }, r.UpdateProfilesList = function() {\n            return this._ProfilesList = Xe.b.LoadFileAsync(this.BaseRepositoryUrl + \"/profiles/profilesList.json\", !1).then(function(t) {\n              return JSON.parse(t.toString());\n            }), this._ProfilesList;\n          }, r._LoadProfileFromRepository = function(t, e, n) {\n            var i = this;\n            return Promise.resolve().then(function() {\n              return i._ProfilesList ? i._ProfilesList : i.UpdateProfilesList();\n            }).then(function(o) {\n              for (var a = 0; a < t.length; ++a)\n                if (t[a] && o[t[a]])\n                  return t[a];\n              throw new Error(\"neither controller \" + t[0] + \" nor all fallbacks were found in the repository,\");\n            }).then(function(o) {\n              return i._ProfileLoadingPromises[o] || (i._ProfileLoadingPromises[o] = Xe.b.LoadFileAsync(i.BaseRepositoryUrl + \"/profiles/\" + o + \"/profile.json\", !1).then(function(a) {\n                return JSON.parse(a);\n              })), i._ProfileLoadingPromises[o];\n            }).then(function(o) {\n              return new ou(n, e, o, i.BaseRepositoryUrl);\n            });\n          }, r._LoadProfilesFromAvailableControllers = function(t, e, n) {\n            for (var i = 0; i < t.length; ++i)\n              if (t[i])\n                for (var o = this.FindFallbackWithProfileId(t[i]), a = 0; a < o.length; ++a) {\n                  var s = this._AvailableControllers[o[a]];\n                  if (s)\n                    return Promise.resolve(s(e, n));\n                }\n            throw new Error(\"no controller requested was found in the available controllers list\");\n          }, r._AvailableControllers = {}, r._Fallbacks = {}, r._ProfileLoadingPromises = {}, r.BaseRepositoryUrl = \"https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist\", r.PrioritizeOnlineRepository = !0, r.UseOnlineRepository = !0, r;\n        }();\n        wn.RegisterController(Rs.ProfileId, function(r, t) {\n          return new Rs(t, r.gamepad, r.handedness);\n        }), wn.DefaultFallbacks();\n        var Xp = 0, au = function() {\n          function r(t, e, n) {\n            var i = this;\n            n === void 0 && (n = {}), this._scene = t, this.inputSource = e, this._options = n, this._tmpVector = new u.e(), this._disposed = !1, this.onDisposeObservable = new C.c(), this.onMeshLoadedObservable = new C.c(), this.onMotionControllerInitObservable = new C.c(), this._uniqueId = \"controller-\" + Xp++ + \"-\" + e.targetRayMode + \"-\" + e.handedness, this.pointer = new Mt.a(this._uniqueId + \"-pointer\", t), this.pointer.rotationQuaternion = new u.b(), this.inputSource.gripSpace && (this.grip = new Mt.a(this._uniqueId + \"-grip\", this._scene), this.grip.rotationQuaternion = new u.b()), this._tmpVector.set(0, 0, this._scene.useRightHandedSystem ? -1 : 1), this.inputSource.gamepad && wn.GetMotionControllerWithXRInput(e, t, this._options.forceControllerProfile).then(function(o) {\n              i.motionController = o, i.onMotionControllerInitObservable.notifyObservers(o), i._options.doNotLoadControllerMesh || i.motionController.loadModel().then(function(a) {\n                var s;\n                a && i.motionController && i.motionController.rootMesh && (i._options.renderingGroupId && (i.motionController.rootMesh.renderingGroupId = i._options.renderingGroupId, i.motionController.rootMesh.getChildMeshes(!1).forEach(function(d) {\n                  return d.renderingGroupId = i._options.renderingGroupId;\n                })), i.onMeshLoadedObservable.notifyObservers(i.motionController.rootMesh), i.motionController.rootMesh.parent = i.grip || i.pointer, i.motionController.disableAnimation = !!i._options.disableMotionControllerAnimation), i._disposed && ((s = i.motionController) === null || s === void 0 || s.dispose());\n              });\n            }, function() {\n              Xe.b.Warn(\"Could not find a matching motion controller for the registered input source\");\n            });\n          }\n          return Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.grip && this.grip.dispose(), this.motionController && this.motionController.dispose(), this.pointer.dispose(), this.onMotionControllerInitObservable.clear(), this.onMeshLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this._disposed = !0;\n          }, r.prototype.getWorldPointerRayToRef = function(t, e) {\n            e === void 0 && (e = !1);\n            var n = e && this.grip ? this.grip : this.pointer;\n            u.e.TransformNormalToRef(this._tmpVector, n.getWorldMatrix(), t.direction), t.direction.normalize(), t.origin.copyFrom(n.absolutePosition), t.length = 1e3;\n          }, r.prototype.updateFromXRFrame = function(t, e) {\n            var n = t.getPose(this.inputSource.targetRaySpace, e);\n            if (n) {\n              var i = n.transform.position;\n              this.pointer.position.set(i.x, i.y, i.z);\n              var o = n.transform.orientation;\n              this.pointer.rotationQuaternion.set(o.x, o.y, o.z, o.w), this._scene.useRightHandedSystem || (this.pointer.position.z *= -1, this.pointer.rotationQuaternion.z *= -1, this.pointer.rotationQuaternion.w *= -1);\n            }\n            if (this.inputSource.gripSpace && this.grip) {\n              var a = t.getPose(this.inputSource.gripSpace, e);\n              if (a) {\n                i = a.transform.position;\n                var s = a.transform.orientation;\n                this.grip.position.set(i.x, i.y, i.z), this.grip.rotationQuaternion.set(s.x, s.y, s.z, s.w), this._scene.useRightHandedSystem || (this.grip.position.z *= -1, this.grip.rotationQuaternion.z *= -1, this.grip.rotationQuaternion.w *= -1);\n              }\n            }\n            this.motionController && this.motionController.updateFromXRFrame(t);\n          }, r;\n        }(), su = function() {\n          function r(t, e, n) {\n            var i = this;\n            if (n === void 0 && (n = {}), this.xrSessionManager = t, this.xrCamera = e, this.options = n, this.controllers = [], this.onControllerAddedObservable = new C.c(), this.onControllerRemovedObservable = new C.c(), this._onInputSourcesChange = function(o) {\n              i._addAndRemoveControllers(o.added, o.removed);\n            }, this._sessionEndedObserver = this.xrSessionManager.onXRSessionEnded.add(function() {\n              i._addAndRemoveControllers([], i.controllers.map(function(o) {\n                return o.inputSource;\n              }));\n            }), this._sessionInitObserver = this.xrSessionManager.onXRSessionInit.add(function(o) {\n              o.addEventListener(\"inputsourceschange\", i._onInputSourcesChange);\n            }), this._frameObserver = this.xrSessionManager.onXRFrameObservable.add(function(o) {\n              i.controllers.forEach(function(a) {\n                a.updateFromXRFrame(o, i.xrSessionManager.referenceSpace);\n              });\n            }), this.options.customControllersRepositoryURL && (wn.BaseRepositoryUrl = this.options.customControllersRepositoryURL), wn.UseOnlineRepository = !this.options.disableOnlineControllerRepository, wn.UseOnlineRepository)\n              try {\n                wn.UpdateProfilesList().catch(function() {\n                  wn.UseOnlineRepository = !1;\n                });\n              } catch {\n                wn.UseOnlineRepository = !1;\n              }\n          }\n          return r.prototype._addAndRemoveControllers = function(t, e) {\n            for (var n = this, i = this.controllers.map(function(P) {\n              return P.inputSource;\n            }), o = 0, a = t; o < a.length; o++) {\n              var s = a[o];\n              if (i.indexOf(s) === -1) {\n                var d = new au(this.xrSessionManager.scene, s, Object(c.a)(Object(c.a)({}, this.options.controllerOptions || {}), { forceControllerProfile: this.options.forceInputProfile, doNotLoadControllerMesh: this.options.doNotLoadControllerMeshes, disableMotionControllerAnimation: this.options.disableControllerAnimation }));\n                this.controllers.push(d), this.onControllerAddedObservable.notifyObservers(d);\n              }\n            }\n            var p = [], y = [];\n            this.controllers.forEach(function(P) {\n              e.indexOf(P.inputSource) === -1 ? p.push(P) : y.push(P);\n            }), this.controllers = p, y.forEach(function(P) {\n              n.onControllerRemovedObservable.notifyObservers(P), P.dispose();\n            });\n          }, r.prototype.dispose = function() {\n            this.controllers.forEach(function(t) {\n              t.dispose();\n            }), this.xrSessionManager.onXRFrameObservable.remove(this._frameObserver), this.xrSessionManager.onXRSessionInit.remove(this._sessionInitObserver), this.xrSessionManager.onXRSessionEnded.remove(this._sessionEndedObserver), this.onControllerAddedObservable.clear(), this.onControllerRemovedObservable.clear();\n          }, r;\n        }(), ni = function() {\n          function r(t) {\n            this._xrSessionManager = t, this._attached = !1, this._removeOnDetach = [], this.isDisposed = !1, this.disableAutoAttach = !1, this.xrNativeFeatureName = \"\";\n          }\n          return Object.defineProperty(r.prototype, \"attached\", { get: function() {\n            return this._attached;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attach = function(t) {\n            var e = this;\n            if (this.isDisposed)\n              return !1;\n            if (t)\n              this.attached && this.detach();\n            else if (this.attached)\n              return !1;\n            return this._attached = !0, this._addNewAttachObserver(this._xrSessionManager.onXRFrameObservable, function(n) {\n              return e._onXRFrame(n);\n            }), !0;\n          }, r.prototype.detach = function() {\n            return this._attached ? (this._attached = !1, this._removeOnDetach.forEach(function(t) {\n              t.observable.remove(t.observer);\n            }), !0) : (this.disableAutoAttach = !0, !1);\n          }, r.prototype.dispose = function() {\n            this.detach(), this.isDisposed = !0;\n          }, r.prototype.isCompatible = function() {\n            return !0;\n          }, r.prototype._addNewAttachObserver = function(t, e) {\n            this._removeOnDetach.push({ observable: t, observer: t.add(e) });\n          }, r;\n        }(), eo = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i._options = n, i._attachController = function(o) {\n              if (!i._controllers[o.uniqueId]) {\n                var a = i._generateNewMeshPair(o.pointer), s = a.laserPointer, d = a.selectionMesh;\n                switch (i._controllers[o.uniqueId] = { xrController: o, laserPointer: s, selectionMesh: d, meshUnderPointer: null, pick: null, tmpRay: new dn.a(new u.e(), new u.e()), id: t._idCounter++ }, i._attachedController ? !i._options.enablePointerSelectionOnAllControllers && i._options.preferredHandedness && o.inputSource.handedness === i._options.preferredHandedness && (i._attachedController = o.uniqueId) : i._options.enablePointerSelectionOnAllControllers || (i._attachedController = o.uniqueId), o.inputSource.targetRayMode) {\n                  case \"tracked-pointer\":\n                    return i._attachTrackedPointerRayMode(o);\n                  case \"gaze\":\n                    return i._attachGazeMode(o);\n                  case \"screen\":\n                    return i._attachScreenRayMode(o);\n                }\n              }\n            }, i._controllers = {}, i._tmpVectorForPickCompare = new u.e(), i.disablePointerLighting = !0, i.disableSelectionMeshLighting = !0, i.displayLaserPointer = !0, i.displaySelectionMesh = !0, i.laserPointerPickedColor = new I.a(0.9, 0.9, 0.9), i.laserPointerDefaultColor = new I.a(0.7, 0.7, 0.7), i.selectionMeshDefaultColor = new I.a(0.8, 0.8, 0.8), i.selectionMeshPickedColor = new I.a(0.3, 0.3, 1), i._identityMatrix = u.a.Identity(), i._screenCoordinatesRef = u.e.Zero(), i._viewportRef = new jn.a(0, 0, 0, 0), i._scene = i._xrSessionManager.scene, i;\n          }\n          return Object(c.d)(t, r), t.prototype.attach = function() {\n            var e = this;\n            if (!r.prototype.attach.call(this))\n              return !1;\n            if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, function(s) {\n              e._detachController(s.uniqueId);\n            }), this._scene.constantlyUpdateMeshUnderPointer = !0, this._options.gazeCamera) {\n              var n = this._options.gazeCamera, i = this._generateNewMeshPair(n), o = i.laserPointer, a = i.selectionMesh;\n              this._controllers.camera = { webXRCamera: n, laserPointer: o, selectionMesh: a, meshUnderPointer: null, pick: null, tmpRay: new dn.a(new u.e(), new u.e()), id: t._idCounter++ }, this._attachGazeMode();\n            }\n            return !0;\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._controllers).forEach(function(n) {\n              e._detachController(n);\n            }), !0);\n          }, t.prototype.getMeshUnderPointer = function(e) {\n            return this._controllers[e] ? this._controllers[e].meshUnderPointer : null;\n          }, t.prototype.getXRControllerByPointerId = function(e) {\n            for (var n = Object.keys(this._controllers), i = 0; i < n.length; ++i)\n              if (this._controllers[n[i]].id === e)\n                return this._controllers[n[i]].xrController || null;\n            return null;\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            Object.keys(this._controllers).forEach(function(i) {\n              var o, a = n._controllers[i];\n              if (!n._options.enablePointerSelectionOnAllControllers && i !== n._attachedController)\n                return a.selectionMesh.isVisible = !1, a.laserPointer.isVisible = !1, void (a.pick = null);\n              if (a.laserPointer.isVisible = n.displayLaserPointer, a.xrController)\n                o = a.xrController.pointer.position, a.xrController.getWorldPointerRayToRef(a.tmpRay);\n              else {\n                if (!a.webXRCamera)\n                  return;\n                o = a.webXRCamera.position, a.webXRCamera.getForwardRayToRef(a.tmpRay);\n              }\n              if (n._options.maxPointerDistance && (a.tmpRay.length = n._options.maxPointerDistance), !n._options.disableScenePointerVectorUpdate && o) {\n                var s = n._xrSessionManager.scene, d = n._options.xrInput.xrCamera;\n                d && (d.viewport.toGlobalToRef(s.getEngine().getRenderWidth(), s.getEngine().getRenderHeight(), n._viewportRef), u.e.ProjectToRef(o, n._identityMatrix, s.getTransformMatrix(), n._viewportRef, n._screenCoordinatesRef), s.pointerX = n._screenCoordinatesRef.x, s.pointerY = n._screenCoordinatesRef.y);\n              }\n              a.pick = n._scene.pickWithRay(a.tmpRay, n._scene.pointerMovePredicate || n.raySelectionPredicate);\n              var p = a.pick;\n              if (p && p.pickedPoint && p.hit) {\n                n._updatePointerDistance(a.laserPointer, p.distance), a.selectionMesh.position.copyFrom(p.pickedPoint), a.selectionMesh.scaling.x = Math.sqrt(p.distance), a.selectionMesh.scaling.y = Math.sqrt(p.distance), a.selectionMesh.scaling.z = Math.sqrt(p.distance);\n                var y = n._convertNormalToDirectionOfRay(p.getNormal(!0), a.tmpRay);\n                if (a.selectionMesh.position.copyFrom(p.pickedPoint), y) {\n                  var P = u.e.Cross(be.a.Y, y), R = u.e.Cross(y, P);\n                  u.e.RotationFromAxisToRef(R, y, P, a.selectionMesh.rotation), a.selectionMesh.position.addInPlace(y.scale(1e-3));\n                }\n                a.selectionMesh.isVisible = n.displaySelectionMesh, a.meshUnderPointer = p.pickedMesh;\n              } else\n                a.selectionMesh.isVisible = !1, n._updatePointerDistance(a.laserPointer, 1), a.meshUnderPointer = null;\n            });\n          }, t.prototype._attachGazeMode = function(e) {\n            var n = this, i = this._controllers[e && e.uniqueId || \"camera\"], o = this._options.timeToSelect || 3e3, a = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Cn.a.DefaultUtilityLayer.utilityLayerScene : this._scene, s = new Ki.a(), d = lr.CreateTorus(\"selection\", { diameter: 0.0525, thickness: 0.015, tessellation: 20 }, a);\n            d.isVisible = !1, d.isPickable = !1, d.parent = i.selectionMesh;\n            var p = 0, y = !1;\n            i.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function() {\n              if (i.pick) {\n                if (i.laserPointer.material.alpha = 0, d.isVisible = !1, i.pick.hit)\n                  if (n._pickingMoved(s, i.pick))\n                    y && (n._options.disablePointerUpOnTouchOut || n._scene.simulatePointerUp(i.pick, { pointerId: i.id })), y = !1, p = 0;\n                  else if (p > o / 10 && (d.isVisible = !0), (p += n._scene.getEngine().getDeltaTime()) >= o)\n                    n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), y = !0, n._options.disablePointerUpOnTouchOut && n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), d.isVisible = !1;\n                  else {\n                    var P = 1 - p / o;\n                    d.scaling.set(P, P, P);\n                  }\n                else\n                  y = !1, p = 0;\n                n._scene.simulatePointerMove(i.pick, { pointerId: i.id }), s = i.pick;\n              }\n            }), this._options.renderingGroupId !== void 0 && (d.renderingGroupId = this._options.renderingGroupId), e && e.onDisposeObservable.addOnce(function() {\n              i.pick && !n._options.disablePointerUpOnTouchOut && y && n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), d.dispose();\n            });\n          }, t.prototype._attachScreenRayMode = function(e) {\n            var n = this, i = this._controllers[e.uniqueId], o = !1;\n            i.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function() {\n              !i.pick || n._options.disablePointerUpOnTouchOut && o || (o ? n._scene.simulatePointerMove(i.pick, { pointerId: i.id }) : (n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), o = !0, n._options.disablePointerUpOnTouchOut && n._scene.simulatePointerUp(i.pick, { pointerId: i.id })));\n            }), e.onDisposeObservable.addOnce(function() {\n              i.pick && o && !n._options.disablePointerUpOnTouchOut && n._scene.simulatePointerUp(i.pick, { pointerId: i.id });\n            });\n          }, t.prototype._attachTrackedPointerRayMode = function(e) {\n            var n = this, i = this._controllers[e.uniqueId];\n            if (this._options.forceGazeMode)\n              return this._attachGazeMode(e);\n            if (i.onFrameObserver = this._xrSessionManager.onXRFrameObservable.add(function() {\n              i.laserPointer.material.disableLighting = n.disablePointerLighting, i.selectionMesh.material.disableLighting = n.disableSelectionMeshLighting, i.pick && n._scene.simulatePointerMove(i.pick, { pointerId: i.id });\n            }), e.inputSource.gamepad) {\n              var o = function(d) {\n                n._options.overrideButtonId && (i.selectionComponent = d.getComponent(n._options.overrideButtonId)), i.selectionComponent || (i.selectionComponent = d.getMainComponent()), i.onButtonChangedObserver = i.selectionComponent.onButtonStateChangedObservable.add(function(p) {\n                  if (p.changes.pressed) {\n                    var y = p.changes.pressed.current;\n                    i.pick ? (n._options.enablePointerSelectionOnAllControllers || e.uniqueId === n._attachedController) && (y ? (n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshPickedColor, i.laserPointer.material.emissiveColor = n.laserPointerPickedColor) : (n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshDefaultColor, i.laserPointer.material.emissiveColor = n.laserPointerDefaultColor)) : !y || n._options.enablePointerSelectionOnAllControllers || n._options.disableSwitchOnClick || (n._attachedController = e.uniqueId);\n                  }\n                });\n              };\n              e.motionController ? o(e.motionController) : e.onMotionControllerInitObservable.add(o);\n            } else {\n              var a = function(d) {\n                i.xrController && d.inputSource === i.xrController.inputSource && i.pick && (n._scene.simulatePointerDown(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshPickedColor, i.laserPointer.material.emissiveColor = n.laserPointerPickedColor);\n              }, s = function(d) {\n                i.xrController && d.inputSource === i.xrController.inputSource && i.pick && (n._scene.simulatePointerUp(i.pick, { pointerId: i.id }), i.selectionMesh.material.emissiveColor = n.selectionMeshDefaultColor, i.laserPointer.material.emissiveColor = n.laserPointerDefaultColor);\n              };\n              i.eventListeners = { selectend: s, selectstart: a }, this._xrSessionManager.session.addEventListener(\"selectstart\", a), this._xrSessionManager.session.addEventListener(\"selectend\", s);\n            }\n          }, t.prototype._convertNormalToDirectionOfRay = function(e, n) {\n            return e && Math.acos(u.e.Dot(e, n.direction)) < Math.PI / 2 && e.scaleInPlace(-1), e;\n          }, t.prototype._detachController = function(e) {\n            var n = this, i = this._controllers[e];\n            if (i && (i.selectionComponent && i.onButtonChangedObserver && i.selectionComponent.onButtonStateChangedObservable.remove(i.onButtonChangedObserver), i.onFrameObserver && this._xrSessionManager.onXRFrameObservable.remove(i.onFrameObserver), i.eventListeners && Object.keys(i.eventListeners).forEach(function(a) {\n              var s = i.eventListeners && i.eventListeners[a];\n              s && n._xrSessionManager.session.removeEventListener(a, s);\n            }), i.selectionMesh.dispose(), i.laserPointer.dispose(), delete this._controllers[e], this._attachedController === e)) {\n              var o = Object.keys(this._controllers);\n              o.length ? this._attachedController = o[0] : this._attachedController = \"\";\n            }\n          }, t.prototype._generateNewMeshPair = function(e) {\n            var n = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Cn.a.DefaultUtilityLayer.utilityLayerScene : this._scene, i = ci.a.CreateCylinder(\"laserPointer\", { height: 1, diameterTop: 2e-4, diameterBottom: 4e-3, tessellation: 20, subdivisions: 1 }, n);\n            i.parent = e;\n            var o = new Nt.a(\"laserPointerMat\", n);\n            o.emissiveColor = this.laserPointerDefaultColor, o.alpha = 0.7, i.material = o, i.rotation.x = Math.PI / 2, this._updatePointerDistance(i, 1), i.isPickable = !1;\n            var a = lr.CreateTorus(\"gazeTracker\", { diameter: 0.0105, thickness: 75e-4, tessellation: 20 }, n);\n            a.bakeCurrentTransformIntoVertices(), a.isPickable = !1, a.isVisible = !1;\n            var s = new Nt.a(\"targetMat\", n);\n            return s.specularColor = I.a.Black(), s.emissiveColor = this.selectionMeshDefaultColor, s.backFaceCulling = !1, a.material = s, this._options.renderingGroupId !== void 0 && (i.renderingGroupId = this._options.renderingGroupId, a.renderingGroupId = this._options.renderingGroupId), { laserPointer: i, selectionMesh: a };\n          }, t.prototype._pickingMoved = function(e, n) {\n            var i;\n            if (!e.hit || !n.hit || !(e.pickedMesh && e.pickedPoint && n.pickedMesh && n.pickedPoint) || e.pickedMesh !== n.pickedMesh)\n              return !0;\n            (i = e.pickedPoint) === null || i === void 0 || i.subtractToRef(n.pickedPoint, this._tmpVectorForPickCompare), this._tmpVectorForPickCompare.set(Math.abs(this._tmpVectorForPickCompare.x), Math.abs(this._tmpVectorForPickCompare.y), Math.abs(this._tmpVectorForPickCompare.z));\n            var o = 0.01 * (this._options.gazeModePointerMovedFactor || 1) * n.distance;\n            return this._tmpVectorForPickCompare.length() > o;\n          }, t.prototype._updatePointerDistance = function(e, n) {\n            n === void 0 && (n = 100), e.scaling.y = n, this._scene.useRightHandedSystem && (n *= -1), e.position.z = n / 2 + 0.05;\n          }, Object.defineProperty(t.prototype, \"lasterPointerDefaultColor\", { get: function() {\n            return this.laserPointerDefaultColor;\n          }, enumerable: !1, configurable: !0 }), t._idCounter = 200, t.Name = ti.POINTER_SELECTION, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(eo.Name, function(r, t) {\n          return function() {\n            return new eo(r, t);\n          };\n        }, eo.Version, !0);\n        var Ni, cu = function() {\n          function r(t, e, n) {\n            this.element = t, this.sessionMode = e, this.referenceSpaceType = n;\n          }\n          return r.prototype.update = function(t) {\n          }, r;\n        }(), Yp = function() {\n        }, lu = function() {\n          function r(t, e) {\n            var n = this;\n            if (this.scene = t, this.options = e, this._activeButton = null, this._buttons = [], this.activeButtonChangedObservable = new C.c(), this.overlay = document.createElement(\"div\"), this.overlay.classList.add(\"xr-button-overlay\"), this.overlay.style.cssText = \"z-index:11;position: absolute; right: 20px;bottom: 50px;\", typeof window < \"u\" && window.location && window.location.protocol === \"http:\" && Xe.b.Warn(\"WebXR can only be served over HTTPS\"), e.customButtons)\n              this._buttons = e.customButtons;\n            else {\n              var i = e.sessionMode || \"immersive-vr\", o = e.referenceSpaceType || \"local-floor\", a = \".babylonVRicon { color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-image: url(\" + (typeof SVGSVGElement > \"u\" ? \"https://cdn.babylonjs.com/Assets/vrButton.png\" : \"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%222048%22%20height%3D%221152%22%20viewBox%3D%220%200%202048%201152%22%20version%3D%221.1%22%3E%3Cpath%20transform%3D%22rotate%28180%201024%2C576.0000000000001%29%22%20d%3D%22m1109%2C896q17%2C0%2030%2C-12t13%2C-30t-12.5%2C-30.5t-30.5%2C-12.5l-170%2C0q-18%2C0%20-30.5%2C12.5t-12.5%2C30.5t13%2C30t30%2C12l170%2C0zm-85%2C256q59%2C0%20132.5%2C-1.5t154.5%2C-5.5t164.5%2C-11.5t163%2C-20t150%2C-30t124.5%2C-41.5q23%2C-11%2042%2C-24t38%2C-30q27%2C-25%2041%2C-61.5t14%2C-72.5l0%2C-257q0%2C-123%20-47%2C-232t-128%2C-190t-190%2C-128t-232%2C-47l-81%2C0q-37%2C0%20-68.5%2C14t-60.5%2C34.5t-55.5%2C45t-53%2C45t-53%2C34.5t-55.5%2C14t-55.5%2C-14t-53%2C-34.5t-53%2C-45t-55.5%2C-45t-60.5%2C-34.5t-68.5%2C-14l-81%2C0q-123%2C0%20-232%2C47t-190%2C128t-128%2C190t-47%2C232l0%2C257q0%2C68%2038%2C115t97%2C73q54%2C24%20124.5%2C41.5t150%2C30t163%2C20t164.5%2C11.5t154.5%2C5.5t132.5%2C1.5zm939%2C-298q0%2C39%20-24.5%2C67t-58.5%2C42q-54%2C23%20-122%2C39.5t-143.5%2C28t-155.5%2C19t-157%2C11t-148.5%2C5t-129.5%2C1.5q-59%2C0%20-130%2C-1.5t-148%2C-5t-157%2C-11t-155.5%2C-19t-143.5%2C-28t-122%2C-39.5q-34%2C-14%20-58.5%2C-42t-24.5%2C-67l0%2C-257q0%2C-106%2040.5%2C-199t110%2C-162.5t162.5%2C-109.5t199%2C-40l81%2C0q27%2C0%2052%2C14t50%2C34.5t51%2C44.5t55.5%2C44.5t63.5%2C34.5t74%2C14t74%2C-14t63.5%2C-34.5t55.5%2C-44.5t51%2C-44.5t50%2C-34.5t52%2C-14l14%2C0q37%2C0%2070%2C0.5t64.5%2C4.5t63.5%2C12t68%2C23q71%2C30%20128.5%2C78.5t98.5%2C110t63.5%2C133.5t22.5%2C149l0%2C257z%22%20fill%3D%22white%22%20/%3E%3C/svg%3E%0A\") + \"); background-size: 80%; background-repeat:no-repeat; background-position: center; border: none; outline: none; transition: transform 0.125s ease-out } .babylonVRicon:hover { transform: scale(1.05) } .babylonVRicon:active {background-color: rgba(51,51,51,1) } .babylonVRicon:focus {background-color: rgba(51,51,51,1) }\";\n              a += '.babylonVRicon.vrdisplaypresenting { background-image: none;} .vrdisplaypresenting::after { content: \"EXIT\"} .xr-error::after { content: \"ERROR\"}';\n              var s = document.createElement(\"style\");\n              s.appendChild(document.createTextNode(a)), document.getElementsByTagName(\"head\")[0].appendChild(s);\n              var d = document.createElement(\"button\");\n              d.className = \"babylonVRicon\", d.title = i + \" - \" + o, this._buttons.push(new cu(d, i, o)), this._buttons[this._buttons.length - 1].update = function(y) {\n                this.element.style.display = y === null || y === this ? \"\" : \"none\", d.className = \"babylonVRicon\" + (y === this ? \" vrdisplaypresenting\" : \"\");\n              }, this._updateButtons(null);\n            }\n            var p = t.getEngine().getInputElement();\n            p && p.parentNode && (p.parentNode.appendChild(this.overlay), t.onDisposeObservable.addOnce(function() {\n              n.dispose();\n            }));\n          }\n          return r.CreateAsync = function(t, e, n) {\n            var i = this, o = new r(t, n), a = o._buttons.map(function(s) {\n              return e.sessionManager.isSessionSupportedAsync(s.sessionMode);\n            });\n            return e.onStateChangedObservable.add(function(s) {\n              s == fn.NOT_IN_XR && o._updateButtons(null);\n            }), Promise.all(a).then(function(s) {\n              return s.forEach(function(d, p) {\n                d ? (o.overlay.appendChild(o._buttons[p].element), o._buttons[p].element.onclick = function() {\n                  return Object(c.b)(i, void 0, void 0, function() {\n                    var y, P, R;\n                    return Object(c.e)(this, function(B) {\n                      switch (B.label) {\n                        case 0:\n                          return e.state != fn.IN_XR ? [3, 2] : [4, e.exitXRAsync()];\n                        case 1:\n                          return B.sent(), o._updateButtons(null), [3, 6];\n                        case 2:\n                          if (e.state != fn.NOT_IN_XR)\n                            return [3, 6];\n                          if (!n.renderTarget)\n                            return [3, 6];\n                          B.label = 3;\n                        case 3:\n                          return B.trys.push([3, 5, , 6]), [4, e.enterXRAsync(o._buttons[p].sessionMode, o._buttons[p].referenceSpaceType, n.renderTarget, { optionalFeatures: n.optionalFeatures, requiredFeatures: n.requiredFeatures })];\n                        case 4:\n                          return B.sent(), o._updateButtons(o._buttons[p]), [3, 6];\n                        case 5:\n                          return y = B.sent(), o._updateButtons(null), P = o._buttons[p].element, R = P.title, P.title = \"Error entering XR session : \" + R, P.classList.add(\"xr-error\"), n.onError && n.onError(y), [3, 6];\n                        case 6:\n                          return [2];\n                      }\n                    });\n                  });\n                }) : Xe.b.Warn('Session mode \"' + o._buttons[p].sessionMode + '\" not supported in browser');\n              }), o;\n            });\n          }, r.prototype.dispose = function() {\n            var t = this.scene.getEngine().getInputElement();\n            t && t.parentNode && t.parentNode.contains(this.overlay) && t.parentNode.removeChild(this.overlay), this.activeButtonChangedObservable.clear();\n          }, r.prototype._updateButtons = function(t) {\n            var e = this;\n            this._activeButton = t, this._buttons.forEach(function(n) {\n              n.update(e._activeButton);\n            }), this.activeButtonChangedObservable.notifyObservers(this._activeButton);\n          }, r;\n        }();\n        function Os(r) {\n          var t, e = 0, n = Date.now();\n          r.observableParameters = (t = r.observableParameters) !== null && t !== void 0 ? t : {};\n          var i = r.contextObservable.add(function(o) {\n            var a = Date.now(), s = { startTime: n, currentTime: a, deltaTime: e = a - n, completeRate: e / r.timeout, payload: o };\n            r.onTick && r.onTick(s), r.breakCondition && r.breakCondition() && (r.contextObservable.remove(i), r.onAborted && r.onAborted(s)), e >= r.timeout && (r.contextObservable.remove(i), r.onEnded && r.onEnded(s));\n          }, r.observableParameters.mask, r.observableParameters.insertFirst, r.observableParameters.scope);\n          return i;\n        }\n        (function(r) {\n          r[r.INIT = 0] = \"INIT\", r[r.STARTED = 1] = \"STARTED\", r[r.ENDED = 2] = \"ENDED\";\n        })(Ni || (Ni = {}));\n        var Kp = function() {\n          function r(t) {\n            var e, n, i = this;\n            this.onEachCountObservable = new C.c(), this.onTimerAbortedObservable = new C.c(), this.onTimerEndedObservable = new C.c(), this.onStateChangedObservable = new C.c(), this._observer = null, this._breakOnNextTick = !1, this._tick = function(o) {\n              var a = Date.now();\n              i._timer = a - i._startTime;\n              var s = { startTime: i._startTime, currentTime: a, deltaTime: i._timer, completeRate: i._timer / i._timeToEnd, payload: o }, d = i._breakOnNextTick || i._breakCondition(s);\n              d || i._timer >= i._timeToEnd ? i._stop(s, d) : i.onEachCountObservable.notifyObservers(s);\n            }, this._setState(Ni.INIT), this._contextObservable = t.contextObservable, this._observableParameters = (e = t.observableParameters) !== null && e !== void 0 ? e : {}, this._breakCondition = (n = t.breakCondition) !== null && n !== void 0 ? n : function() {\n              return !1;\n            }, t.onEnded && this.onTimerEndedObservable.add(t.onEnded), t.onTick && this.onEachCountObservable.add(t.onTick), t.onAborted && this.onTimerAbortedObservable.add(t.onAborted);\n          }\n          return Object.defineProperty(r.prototype, \"breakCondition\", { set: function(t) {\n            this._breakCondition = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.clearObservables = function() {\n            this.onEachCountObservable.clear(), this.onTimerAbortedObservable.clear(), this.onTimerEndedObservable.clear(), this.onStateChangedObservable.clear();\n          }, r.prototype.start = function(t) {\n            if (t === void 0 && (t = this._timeToEnd), this._state === Ni.STARTED)\n              throw new Error(\"Timer already started. Please stop it before starting again\");\n            this._timeToEnd = t, this._startTime = Date.now(), this._timer = 0, this._observer = this._contextObservable.add(this._tick, this._observableParameters.mask, this._observableParameters.insertFirst, this._observableParameters.scope), this._setState(Ni.STARTED);\n          }, r.prototype.stop = function() {\n            this._state === Ni.STARTED && (this._breakOnNextTick = !0);\n          }, r.prototype.dispose = function() {\n            this._observer && this._contextObservable.remove(this._observer), this.clearObservables();\n          }, r.prototype._setState = function(t) {\n            this._state = t, this.onStateChangedObservable.notifyObservers(this._state);\n          }, r.prototype._stop = function(t, e) {\n            e === void 0 && (e = !1), this._contextObservable.remove(this._observer), this._setState(Ni.ENDED), e ? this.onTimerAbortedObservable.notifyObservers(t) : this.onTimerEndedObservable.notifyObservers(t);\n          }, r;\n        }(), to = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i._options = n, i._controllers = {}, i._snappedToPoint = !1, i._tmpRay = new dn.a(new u.e(), new u.e()), i._tmpVector = new u.e(), i._tmpQuaternion = new u.b(), i.backwardsMovementEnabled = !0, i.backwardsTeleportationDistance = 0.7, i.parabolicCheckRadius = 5, i.parabolicRayEnabled = !0, i.straightRayEnabled = !0, i.rotationAngle = Math.PI / 8, i._rotationEnabled = !0, i._attachController = function(o) {\n              if (!(i._controllers[o.uniqueId] || i._options.forceHandedness && o.inputSource.handedness !== i._options.forceHandedness)) {\n                i._controllers[o.uniqueId] = { xrController: o, teleportationState: { forward: !1, backwards: !1, rotating: !1, currentRotation: 0, baseRotation: 0 } };\n                var a = i._controllers[o.uniqueId];\n                if (a.xrController.inputSource.targetRayMode === \"tracked-pointer\" && a.xrController.inputSource.gamepad) {\n                  var s = function() {\n                    if (o.motionController) {\n                      var d = o.motionController.getComponentOfType(yr.THUMBSTICK_TYPE) || o.motionController.getComponentOfType(yr.TOUCHPAD_TYPE);\n                      if (!d || i._options.useMainComponentOnly) {\n                        var p = o.motionController.getMainComponent();\n                        if (!p)\n                          return;\n                        a.teleportationComponent = p, a.onButtonChangedObserver = p.onButtonStateChangedObservable.add(function() {\n                          p.changes.pressed && (p.changes.pressed.current ? (a.teleportationState.forward = !0, i._currentTeleportationControllerId = a.xrController.uniqueId, a.teleportationState.baseRotation = i._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, a.teleportationState.currentRotation = 0, Os({ timeout: i._options.timeToTeleport || 3e3, contextObservable: i._xrSessionManager.onXRFrameObservable, breakCondition: function() {\n                            return !p.pressed;\n                          }, onEnded: function() {\n                            i._currentTeleportationControllerId === a.xrController.uniqueId && a.teleportationState.forward && i._teleportForward(o.uniqueId);\n                          } })) : (a.teleportationState.forward = !1, i._currentTeleportationControllerId = \"\"));\n                        });\n                      } else\n                        a.teleportationComponent = d, a.onAxisChangedObserver = d.onAxisValueChangedObservable.add(function(y) {\n                          if (y.y <= 0.7 && a.teleportationState.backwards && (a.teleportationState.backwards = !1), y.y > 0.7 && !a.teleportationState.forward && i.backwardsMovementEnabled && !i.snapPointsOnly && !a.teleportationState.backwards) {\n                            a.teleportationState.backwards = !0, i._tmpQuaternion.copyFrom(i._options.xrInput.xrCamera.rotationQuaternion), i._tmpQuaternion.toEulerAnglesToRef(i._tmpVector), i._tmpVector.x = 0, i._tmpVector.z = 0, u.b.FromEulerVectorToRef(i._tmpVector, i._tmpQuaternion), i._tmpVector.set(0, 0, i.backwardsTeleportationDistance * (i._xrSessionManager.scene.useRightHandedSystem ? 1 : -1)), i._tmpVector.rotateByQuaternionToRef(i._tmpQuaternion, i._tmpVector), i._tmpVector.addInPlace(i._options.xrInput.xrCamera.position), i._tmpRay.origin.copyFrom(i._tmpVector), i._tmpRay.length = i._options.xrInput.xrCamera.realWorldHeight + 0.1, i._tmpRay.direction.set(0, -1, 0);\n                            var P = i._xrSessionManager.scene.pickWithRay(i._tmpRay, function(B) {\n                              return i._floorMeshes.indexOf(B) !== -1;\n                            });\n                            P && P.pickedPoint && (i._options.xrInput.xrCamera.position.x = P.pickedPoint.x, i._options.xrInput.xrCamera.position.z = P.pickedPoint.z);\n                          }\n                          if (y.y < -0.7 && !i._currentTeleportationControllerId && !a.teleportationState.rotating && (a.teleportationState.forward = !0, i._currentTeleportationControllerId = a.xrController.uniqueId, a.teleportationState.baseRotation = i._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y), y.x) {\n                            if (a.teleportationState.forward)\n                              i._currentTeleportationControllerId === a.xrController.uniqueId && (i.rotationEnabled ? setTimeout(function() {\n                                a.teleportationState.currentRotation = Math.atan2(y.x, y.y * (i._xrSessionManager.scene.useRightHandedSystem ? 1 : -1));\n                              }) : a.teleportationState.currentRotation = 0);\n                            else if (!a.teleportationState.rotating && Math.abs(y.x) > 0.7) {\n                              a.teleportationState.rotating = !0;\n                              var R = i.rotationAngle * (y.x > 0 ? 1 : -1) * (i._xrSessionManager.scene.useRightHandedSystem ? -1 : 1);\n                              i._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(u.b.FromEulerAngles(0, R, 0));\n                            }\n                          } else\n                            a.teleportationState.rotating = !1;\n                          y.x === 0 && y.y === 0 && a.teleportationState.forward && i._teleportForward(o.uniqueId);\n                        });\n                    }\n                  };\n                  o.motionController ? s() : o.onMotionControllerInitObservable.addOnce(function() {\n                    s();\n                  });\n                } else\n                  i._xrSessionManager.scene.onPointerObservable.add(function(d) {\n                    d.type === yt.a.POINTERDOWN ? (a.teleportationState.forward = !0, i._currentTeleportationControllerId = a.xrController.uniqueId, a.teleportationState.baseRotation = i._options.xrInput.xrCamera.rotationQuaternion.toEulerAngles().y, a.teleportationState.currentRotation = 0, Os({ timeout: i._options.timeToTeleport || 3e3, contextObservable: i._xrSessionManager.onXRFrameObservable, onEnded: function() {\n                      i._currentTeleportationControllerId === a.xrController.uniqueId && a.teleportationState.forward && i._teleportForward(o.uniqueId);\n                    } })) : d.type === yt.a.POINTERUP && (a.teleportationState.forward = !1, i._currentTeleportationControllerId = \"\");\n                  });\n              }\n            }, i._options.teleportationTargetMesh || i._createDefaultTargetMesh(), i._floorMeshes = i._options.floorMeshes || [], i._snapToPositions = i._options.snapPositions || [], i._setTargetMeshVisibility(!1), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"rotationEnabled\", { get: function() {\n            return this._rotationEnabled;\n          }, set: function(e) {\n            if (this._rotationEnabled = e, this._options.teleportationTargetMesh) {\n              var n = this._options.teleportationTargetMesh.getChildMeshes(!1, function(i) {\n                return i.name === \"rotationCone\";\n              });\n              n[0] && n[0].setEnabled(e);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"teleportationTargetMesh\", { get: function() {\n            return this._options.teleportationTargetMesh || null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"snapPointsOnly\", { get: function() {\n            return !!this._options.snapPointsOnly;\n          }, set: function(e) {\n            this._options.snapPointsOnly = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.addFloorMesh = function(e) {\n            this._floorMeshes.push(e);\n          }, t.prototype.addSnapPoint = function(e) {\n            this._snapToPositions.push(e);\n          }, t.prototype.attach = function() {\n            var e = this;\n            return !!r.prototype.attach.call(this) && (this._currentTeleportationControllerId = \"\", this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, function(n) {\n              e._detachController(n.uniqueId);\n            }), !0);\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._controllers).forEach(function(n) {\n              e._detachController(n);\n            }), this._setTargetMeshVisibility(!1), this._currentTeleportationControllerId = \"\", this._controllers = {}, !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.dispose(!1, !0);\n          }, t.prototype.removeFloorMesh = function(e) {\n            var n = this._floorMeshes.indexOf(e);\n            n !== -1 && this._floorMeshes.splice(n, 1);\n          }, t.prototype.removeFloorMeshByName = function(e) {\n            var n = this._xrSessionManager.scene.getMeshByName(e);\n            n && this.removeFloorMesh(n);\n          }, t.prototype.removeSnapPoint = function(e) {\n            var n = this._snapToPositions.indexOf(e);\n            if (n === -1) {\n              for (var i = 0; i < this._snapToPositions.length; ++i)\n                if (this._snapToPositions[i].equals(e)) {\n                  n = i;\n                  break;\n                }\n            }\n            return n !== -1 && (this._snapToPositions.splice(n, 1), !0);\n          }, t.prototype.setSelectionFeature = function(e) {\n            this._selectionFeature = e;\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this, i = this._xrSessionManager.currentFrame, o = this._xrSessionManager.scene;\n            if (this.attach && i) {\n              var a = this._options.teleportationTargetMesh;\n              if (this._currentTeleportationControllerId) {\n                if (!a)\n                  return;\n                a.rotationQuaternion = a.rotationQuaternion || new u.b();\n                var s = this._controllers[this._currentTeleportationControllerId];\n                if (s && s.teleportationState.forward) {\n                  u.b.RotationYawPitchRollToRef(s.teleportationState.currentRotation + s.teleportationState.baseRotation, 0, 0, a.rotationQuaternion);\n                  var d = !1;\n                  if (s.xrController.getWorldPointerRayToRef(this._tmpRay), this.straightRayEnabled) {\n                    if ((p = o.pickWithRay(this._tmpRay, function(B) {\n                      if (n._options.pickBlockerMeshes && n._options.pickBlockerMeshes.indexOf(B) !== -1)\n                        return !0;\n                      var F = n._floorMeshes.indexOf(B);\n                      return F !== -1 && n._floorMeshes[F].absolutePosition.y < n._options.xrInput.xrCamera.position.y;\n                    })) && p.pickedMesh && this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(p.pickedMesh) !== -1)\n                      return;\n                    p && p.pickedPoint && (d = !0, this._setTargetMeshPosition(p.pickedPoint), this._setTargetMeshVisibility(!0), this._showParabolicPath(p));\n                  }\n                  if (this.parabolicRayEnabled && !d) {\n                    var p, y = s.xrController.pointer.rotationQuaternion.toEulerAngles().x, P = Math.PI / 2 - Math.abs(y) + 1, R = this.parabolicCheckRadius * P;\n                    if (this._tmpRay.origin.addToRef(this._tmpRay.direction.scale(2 * R), this._tmpVector), this._tmpVector.y = this._tmpRay.origin.y, this._tmpRay.origin.addInPlace(this._tmpRay.direction.scale(R)), this._tmpVector.subtractToRef(this._tmpRay.origin, this._tmpRay.direction), this._tmpRay.direction.normalize(), (p = o.pickWithRay(this._tmpRay, function(B) {\n                      return !(!n._options.pickBlockerMeshes || n._options.pickBlockerMeshes.indexOf(B) === -1) || n._floorMeshes.indexOf(B) !== -1;\n                    })) && p.pickedMesh && this._options.pickBlockerMeshes && this._options.pickBlockerMeshes.indexOf(p.pickedMesh) !== -1)\n                      return;\n                    p && p.pickedPoint && (d = !0, this._setTargetMeshPosition(p.pickedPoint), this._setTargetMeshVisibility(!0), this._showParabolicPath(p));\n                  }\n                  this._setTargetMeshVisibility(d);\n                } else\n                  this._setTargetMeshVisibility(!1);\n              } else\n                this._setTargetMeshVisibility(!1);\n            }\n          }, t.prototype._createDefaultTargetMesh = function() {\n            this._options.defaultTargetMeshOptions = this._options.defaultTargetMeshOptions || {};\n            var e = this._options.useUtilityLayer ? this._options.customUtilityLayerScene || Cn.a.DefaultUtilityLayer.utilityLayerScene : this._xrSessionManager.scene, n = Mi.CreateGround(\"teleportationTarget\", { width: 2, height: 2, subdivisions: 2 }, e);\n            n.isPickable = !1;\n            var i = new pi.a(\"teleportationPlaneDynamicTexture\", 512, e, !0);\n            i.hasAlpha = !0;\n            var o = i.getContext();\n            o.beginPath(), o.arc(256, 256, 200, 0, 2 * Math.PI, !1), o.fillStyle = this._options.defaultTargetMeshOptions.teleportationFillColor || \"#444444\", o.fill(), o.lineWidth = 10, o.strokeStyle = this._options.defaultTargetMeshOptions.teleportationBorderColor || \"#FFFFFF\", o.stroke(), o.closePath(), i.update();\n            var a = new Nt.a(\"teleportationPlaneMaterial\", e);\n            a.diffuseTexture = i, n.material = a;\n            var s = lr.CreateTorus(\"torusTeleportation\", { diameter: 0.75, thickness: 0.1, tessellation: 20 }, e);\n            if (s.isPickable = !1, s.parent = n, !this._options.defaultTargetMeshOptions.disableAnimation) {\n              var d = new k(\"animationInnerCircle\", \"position.y\", 30, k.ANIMATIONTYPE_FLOAT, k.ANIMATIONLOOPMODE_CYCLE), p = [];\n              p.push({ frame: 0, value: 0 }), p.push({ frame: 30, value: 0.4 }), p.push({ frame: 60, value: 0 }), d.setKeys(p);\n              var y = new nn();\n              y.setEasingMode(Ge.EASINGMODE_EASEINOUT), d.setEasingFunction(y), s.animations = [], s.animations.push(d), e.beginAnimation(s, 0, 60, !0);\n            }\n            var P = ci.a.CreateCylinder(\"rotationCone\", { diameterTop: 0, tessellation: 4 }, e);\n            if (P.isPickable = !1, P.scaling.set(0.5, 0.12, 0.2), P.rotate(be.a.X, Math.PI / 2), P.position.z = 0.6, P.parent = s, this._options.defaultTargetMeshOptions.torusArrowMaterial)\n              s.material = this._options.defaultTargetMeshOptions.torusArrowMaterial, P.material = this._options.defaultTargetMeshOptions.torusArrowMaterial;\n            else {\n              var R = new Nt.a(\"torusConsMat\", e);\n              R.disableLighting = !!this._options.defaultTargetMeshOptions.disableLighting, R.disableLighting ? R.emissiveColor = new I.a(0.3, 0.3, 1) : R.diffuseColor = new I.a(0.3, 0.3, 1), R.alpha = 0.9, s.material = R, P.material = R, this._teleportationRingMaterial = R;\n            }\n            this._options.renderingGroupId !== void 0 && (n.renderingGroupId = this._options.renderingGroupId, s.renderingGroupId = this._options.renderingGroupId, P.renderingGroupId = this._options.renderingGroupId), this._options.teleportationTargetMesh = n;\n          }, t.prototype._detachController = function(e) {\n            var n = this._controllers[e];\n            n && (n.teleportationComponent && (n.onAxisChangedObserver && n.teleportationComponent.onAxisValueChangedObservable.remove(n.onAxisChangedObserver), n.onButtonChangedObserver && n.teleportationComponent.onButtonStateChangedObservable.remove(n.onButtonChangedObserver)), delete this._controllers[e]);\n          }, t.prototype._findClosestSnapPointWithRadius = function(e, n) {\n            n === void 0 && (n = this._options.snapToPositionRadius || 0.8);\n            var i = null, o = Number.MAX_VALUE;\n            if (this._snapToPositions.length) {\n              var a = n * n;\n              this._snapToPositions.forEach(function(s) {\n                var d = u.e.DistanceSquared(s, e);\n                d <= a && d < o && (o = d, i = s);\n              });\n            }\n            return i;\n          }, t.prototype._setTargetMeshPosition = function(e) {\n            if (this._options.teleportationTargetMesh) {\n              var n = this._findClosestSnapPointWithRadius(e);\n              this._snappedToPoint = !!n, this.snapPointsOnly && !this._snappedToPoint && this._teleportationRingMaterial ? this._teleportationRingMaterial.diffuseColor.set(1, 0.3, 0.3) : this.snapPointsOnly && this._snappedToPoint && this._teleportationRingMaterial && this._teleportationRingMaterial.diffuseColor.set(0.3, 0.3, 1), this._options.teleportationTargetMesh.position.copyFrom(n || e), this._options.teleportationTargetMesh.position.y += 0.01;\n            }\n          }, t.prototype._setTargetMeshVisibility = function(e) {\n            this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible !== e && (this._options.teleportationTargetMesh.isVisible = e, this._options.teleportationTargetMesh.getChildren(void 0, !1).forEach(function(n) {\n              n.isVisible = e;\n            }), e ? this._selectionFeature && this._selectionFeature.detach() : (this._quadraticBezierCurve && (this._quadraticBezierCurve.dispose(), this._quadraticBezierCurve = null), this._selectionFeature && this._selectionFeature.attach()));\n          }, t.prototype._showParabolicPath = function(e) {\n            if (e.pickedPoint) {\n              var n = this._controllers[this._currentTeleportationControllerId], i = Qe.d.CreateQuadraticBezier(n.xrController.pointer.absolutePosition, e.ray.origin, e.pickedPoint, 25);\n              this._options.generateRayPathMesh ? this._quadraticBezierCurve = this._options.generateRayPathMesh(i.getPoints()) : this._quadraticBezierCurve = sn.a.CreateLines(\"teleportation path line\", { points: i.getPoints(), instance: this._quadraticBezierCurve, updatable: !0 }), this._quadraticBezierCurve.isPickable = !1;\n            }\n          }, t.prototype._teleportForward = function(e) {\n            var n = this._controllers[e];\n            if (n && n.teleportationState.forward && (n.teleportationState.forward = !1, this._currentTeleportationControllerId = \"\", (!this.snapPointsOnly || this._snappedToPoint) && this._options.teleportationTargetMesh && this._options.teleportationTargetMesh.isVisible)) {\n              var i = this._options.xrInput.xrCamera.realWorldHeight;\n              this._options.xrInput.xrCamera.onBeforeCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position), this._options.xrInput.xrCamera.position.copyFrom(this._options.teleportationTargetMesh.position), this._options.xrInput.xrCamera.position.y += i, this._options.xrInput.xrCamera.rotationQuaternion.multiplyInPlace(u.b.FromEulerAngles(0, n.teleportationState.currentRotation - (this._xrSessionManager.scene.useRightHandedSystem ? Math.PI : 0), 0)), this._options.xrInput.xrCamera.onAfterCameraTeleport.notifyObservers(this._options.xrInput.xrCamera.position);\n            }\n          }, t.Name = ti.TELEPORTATION, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(to.Name, function(r, t) {\n          return function() {\n            return new to(r, t);\n          };\n        }, to.Version, !0);\n        var Qp = function() {\n        }, uu = function() {\n          function r() {\n          }\n          return r.CreateAsync = function(t, e) {\n            e === void 0 && (e = {});\n            var n = new r();\n            return ru.CreateAsync(t).then(function(i) {\n              if (n.baseExperience = i, e.ignoreNativeCameraTransformation && (n.baseExperience.camera.compensateOnFirstFrame = !1), n.input = new su(i.sessionManager, i.camera, Object(c.a)({ controllerOptions: { renderingGroupId: e.renderingGroupId } }, e.inputOptions || {})), n.pointerSelection = n.baseExperience.featuresManager.enableFeature(eo.Name, e.useStablePlugins ? \"stable\" : \"latest\", { xrInput: n.input, renderingGroupId: e.renderingGroupId }), e.disableTeleportation || (n.teleportation = n.baseExperience.featuresManager.enableFeature(to.Name, e.useStablePlugins ? \"stable\" : \"latest\", { floorMeshes: e.floorMeshes, xrInput: n.input, renderingGroupId: e.renderingGroupId }), n.teleportation.setSelectionFeature(n.pointerSelection)), n.renderTarget = n.baseExperience.sessionManager.getWebXRRenderTarget(e.outputCanvasOptions), !e.disableDefaultUI) {\n                var o = Object(c.a)({ renderTarget: n.renderTarget }, e.uiOptions || {});\n                return e.optionalFeatures && (typeof e.optionalFeatures == \"boolean\" ? o.optionalFeatures = [\"hit-test\", \"anchors\", \"plane-detection\", \"hand-tracking\"] : o.optionalFeatures = e.optionalFeatures), lu.CreateAsync(t, n.baseExperience, o).then(function(a) {\n                  n.enterExitUI = a;\n                });\n              }\n            }).then(function() {\n              return n;\n            }).catch(function(i) {\n              return l.a.Error(\"Error initializing XR\"), l.a.Error(i), n;\n            });\n          }, r.prototype.dispose = function() {\n            this.baseExperience && this.baseExperience.dispose(), this.input && this.input.dispose(), this.enterExitUI && this.enterExitUI.dispose(), this.renderTarget && this.renderTarget.dispose();\n          }, r;\n        }(), qp = !0;\n        _e.a.prototype.createDefaultLight = function(r) {\n          if (r === void 0 && (r = !1), r && this.lights)\n            for (var t = 0; t < this.lights.length; t++)\n              this.lights[t].dispose();\n          this.lights.length === 0 && new Oo.a(\"default light\", u.e.Up(), this);\n        }, _e.a.prototype.createDefaultCamera = function(r, t, e) {\n          if (r === void 0 && (r = !1), t === void 0 && (t = !1), e === void 0 && (e = !1), t && this.activeCamera && (this.activeCamera.dispose(), this.activeCamera = null), !this.activeCamera) {\n            var n, i = this.getWorldExtends(function(P) {\n              return P.isVisible && P.isEnabled();\n            }), o = i.max.subtract(i.min), a = i.min.add(o.scale(0.5)), s = 1.5 * o.length();\n            if (isFinite(s) || (s = 1, a.copyFromFloats(0, 0, 0)), r) {\n              var d = new Hi(\"default camera\", -Math.PI / 2, Math.PI / 2, s, a, this);\n              d.lowerRadiusLimit = 0.01 * s, d.wheelPrecision = 100 / s, n = d;\n            } else {\n              var p = new zn(\"default camera\", new u.e(a.x, a.y, -s), this);\n              p.setTarget(a), n = p;\n            }\n            n.minZ = 0.01 * s, n.maxZ = 1e3 * s, n.speed = 0.2 * s, this.activeCamera = n;\n            var y = this.getEngine().getInputElement();\n            e && y && n.attachControl();\n          }\n        }, _e.a.prototype.createDefaultCameraOrLight = function(r, t, e) {\n          r === void 0 && (r = !1), t === void 0 && (t = !1), e === void 0 && (e = !1), this.createDefaultLight(t), this.createDefaultCamera(r, t, e);\n        }, _e.a.prototype.createDefaultSkybox = function(r, t, e, n, i) {\n          if (t === void 0 && (t = !1), e === void 0 && (e = 1e3), n === void 0 && (n = 0), i === void 0 && (i = !0), !r)\n            return l.a.Warn(\"Can not create default skybox without environment texture.\"), null;\n          i && r && (this.environmentTexture = r);\n          var o = Ie.a.CreateBox(\"hdrSkyBox\", e, this);\n          if (t) {\n            var a = new $r(\"skyBox\", this);\n            a.backFaceCulling = !1, a.reflectionTexture = r.clone(), a.reflectionTexture && (a.reflectionTexture.coordinatesMode = Ne.a.SKYBOX_MODE), a.microSurface = 1 - n, a.disableLighting = !0, a.twoSidedLighting = !0, o.infiniteDistance = !0, o.material = a;\n          } else {\n            var s = new Nt.a(\"skyBox\", this);\n            s.backFaceCulling = !1, s.reflectionTexture = r.clone(), s.reflectionTexture && (s.reflectionTexture.coordinatesMode = Ne.a.SKYBOX_MODE), s.disableLighting = !0, o.infiniteDistance = !0, o.material = s;\n          }\n          return o.isPickable = !1, o;\n        }, _e.a.prototype.createDefaultEnvironment = function(r) {\n          return Es ? new Es(r, this) : null;\n        }, _e.a.prototype.createDefaultVRExperience = function(r) {\n          return r === void 0 && (r = {}), new Il(this, r);\n        }, _e.a.prototype.createDefaultXRExperienceAsync = function(r) {\n          return r === void 0 && (r = {}), uu.CreateAsync(this, r).then(function(t) {\n            return t;\n          });\n        };\n        var hu = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            o === void 0 && (o = !1), a === void 0 && (a = !1), s === void 0 && (s = Ne.a.TRILINEAR_SAMPLINGMODE), d === void 0 && (d = { autoPlay: !0, loop: !0, autoUpdateTexture: !0 });\n            var p = r.call(this, null, i, !o, a) || this;\n            p._onUserActionRequestedObservable = null, p._stillImageCaptured = !1, p._displayingPosterTexture = !1, p._frameId = -1, p._currentSrc = null, p._createInternalTexture = function() {\n              if (p._texture != null) {\n                if (!p._displayingPosterTexture)\n                  return;\n                p._texture.dispose(), p._displayingPosterTexture = !1;\n              }\n              if (!p._getEngine().needPOTTextures || Xe.b.IsExponentOfTwo(p.video.videoWidth) && Xe.b.IsExponentOfTwo(p.video.videoHeight) ? (p.wrapU = Ne.a.WRAP_ADDRESSMODE, p.wrapV = Ne.a.WRAP_ADDRESSMODE) : (p.wrapU = Ne.a.CLAMP_ADDRESSMODE, p.wrapV = Ne.a.CLAMP_ADDRESSMODE, p._generateMipMaps = !1), p._texture = p._getEngine().createDynamicTexture(p.video.videoWidth, p.video.videoHeight, p._generateMipMaps, p.samplingMode), p.video.autoplay || p._settings.poster)\n                p._texture.isReady = !0, p._updateInternalTexture(), p.onLoadObservable.hasObservers() && p.onLoadObservable.notifyObservers(p);\n              else {\n                var P = p.video.onplaying, R = !1, B = p.video.muted;\n                p.video.muted = !0, p.video.onplaying = function() {\n                  p.video.muted = B, p.video.onplaying = P, p._texture.isReady = !0, p._updateInternalTexture(), R || p.video.pause(), p.onLoadObservable.hasObservers() && p.onLoadObservable.notifyObservers(p);\n                };\n                var F = p.video.play();\n                F ? F.then(function() {\n                }).catch(function() {\n                  R = !0, p._onUserActionRequestedObservable && p._onUserActionRequestedObservable.hasObservers() && p._onUserActionRequestedObservable.notifyObservers(p);\n                }) : (p.video.onplaying = P, p._texture.isReady = !0, p._updateInternalTexture(), p.onLoadObservable.hasObservers() && p.onLoadObservable.notifyObservers(p));\n              }\n            }, p.reset = function() {\n              p._texture != null && (p._displayingPosterTexture || (p._texture.dispose(), p._texture = null));\n            }, p._updateInternalTexture = function() {\n              if (p._texture != null && p._texture.isReady && !(p.video.readyState < p.video.HAVE_CURRENT_DATA || p._displayingPosterTexture)) {\n                var P = p.getScene().getFrameId();\n                p._frameId !== P && (p._frameId = P, p._getEngine().updateVideoTexture(p._texture, p.video, p._invertY));\n              }\n            }, p._generateMipMaps = o, p._initialSamplingMode = s, p.autoUpdateTexture = d.autoUpdateTexture, p._currentSrc = n, p.name = e || p._getName(n), p.video = p._getVideo(n), p._settings = d, d.poster && (p.video.poster = d.poster), d.autoPlay !== void 0 && (p.video.autoplay = d.autoPlay), d.loop !== void 0 && (p.video.loop = d.loop), d.muted !== void 0 && (p.video.muted = d.muted), p.video.setAttribute(\"playsinline\", \"\"), p.video.addEventListener(\"paused\", p._updateInternalTexture), p.video.addEventListener(\"seeked\", p._updateInternalTexture), p.video.addEventListener(\"emptied\", p.reset), p._createInternalTextureOnEvent = d.poster && !d.autoPlay ? \"play\" : \"canplay\", p.video.addEventListener(p._createInternalTextureOnEvent, p._createInternalTexture), d.autoPlay && p.video.play();\n            var y = p.video.readyState >= p.video.HAVE_CURRENT_DATA;\n            return !d.poster || d.autoPlay && y ? y && p._createInternalTexture() : (p._texture = p._getEngine().createTexture(d.poster, !1, !p.invertY, i), p._displayingPosterTexture = !0), p;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onUserActionRequestedObservable\", { get: function() {\n            return this._onUserActionRequestedObservable || (this._onUserActionRequestedObservable = new C.c()), this._onUserActionRequestedObservable;\n          }, enumerable: !1, configurable: !0 }), t.prototype._getName = function(e) {\n            return e instanceof HTMLVideoElement ? e.currentSrc : typeof e == \"object\" ? e.toString() : e;\n          }, t.prototype._getVideo = function(e) {\n            if (e instanceof HTMLVideoElement)\n              return Xe.b.SetCorsBehavior(e.currentSrc, e), e;\n            var n = document.createElement(\"video\");\n            return typeof e == \"string\" ? (Xe.b.SetCorsBehavior(e, n), n.src = e) : (Xe.b.SetCorsBehavior(e[0], n), e.forEach(function(i) {\n              var o = document.createElement(\"source\");\n              o.src = i, n.appendChild(o);\n            })), n;\n          }, t.prototype._rebuild = function() {\n            this.update();\n          }, t.prototype.update = function() {\n            this.autoUpdateTexture && this.updateTexture(!0);\n          }, t.prototype.updateTexture = function(e) {\n            e && (this.video.paused && this._stillImageCaptured || (this._stillImageCaptured = !0, this._updateInternalTexture()));\n          }, t.prototype.updateURL = function(e) {\n            this.video.src = e, this._currentSrc = e;\n          }, t.prototype.clone = function() {\n            return new t(this.name, this._currentSrc, this.getScene(), this._generateMipMaps, this.invertY, this.samplingMode, this._settings);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._currentSrc = null, this._onUserActionRequestedObservable && (this._onUserActionRequestedObservable.clear(), this._onUserActionRequestedObservable = null), this.video.removeEventListener(this._createInternalTextureOnEvent, this._createInternalTexture), this.video.removeEventListener(\"paused\", this._updateInternalTexture), this.video.removeEventListener(\"seeked\", this._updateInternalTexture), this.video.removeEventListener(\"emptied\", this.reset), this.video.pause();\n          }, t.CreateFromStreamAsync = function(e, n) {\n            var i = document.createElement(\"video\");\n            return e.getEngine()._badOS && (document.body.appendChild(i), i.style.transform = \"scale(0.0001, 0.0001)\", i.style.opacity = \"0\", i.style.position = \"fixed\", i.style.bottom = \"0px\", i.style.right = \"0px\"), i.setAttribute(\"autoplay\", \"\"), i.setAttribute(\"muted\", \"true\"), i.setAttribute(\"playsinline\", \"\"), i.muted = !0, i.mozSrcObject !== void 0 ? i.mozSrcObject = n : typeof i.srcObject == \"object\" ? i.srcObject = n : (window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL, i.src = window.URL && window.URL.createObjectURL(n)), new Promise(function(o) {\n              var a = function() {\n                o(new t(\"video\", i, e, !0, !0)), i.removeEventListener(\"playing\", a);\n              };\n              i.addEventListener(\"playing\", a), i.play();\n            });\n          }, t.CreateFromWebCamAsync = function(e, n, i) {\n            var o, a = this;\n            return i === void 0 && (i = !1), n && n.deviceId && (o = { exact: n.deviceId }), navigator.mediaDevices ? navigator.mediaDevices.getUserMedia({ video: n, audio: i }).then(function(s) {\n              return a.CreateFromStreamAsync(e, s);\n            }) : (navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia, navigator.getUserMedia && navigator.getUserMedia({ video: { deviceId: o, width: { min: n && n.minWidth || 256, max: n && n.maxWidth || 640 }, height: { min: n && n.minHeight || 256, max: n && n.maxHeight || 480 } }, audio: i }, function(s) {\n              return a.CreateFromStreamAsync(e, s);\n            }, function(s) {\n              l.a.Error(s.name);\n            }), Promise.reject(\"No support for userMedia on this device\"));\n          }, t.CreateFromWebCam = function(e, n, i, o) {\n            o === void 0 && (o = !1), this.CreateFromWebCamAsync(e, i, o).then(function(a) {\n              n && n(a);\n            }).catch(function(a) {\n              l.a.Error(a.name);\n            });\n          }, t;\n        }(Ne.a), Zp = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"videoTexture\", { get: function() {\n            return this._texture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"videoMode\", { get: function() {\n            return this.textureMode;\n          }, set: function(e) {\n            this.textureMode = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initTexture = function(e, n, i) {\n            var o = this, a = { loop: i.loop, autoPlay: i.autoPlay, autoUpdateTexture: !0, poster: i.poster }, s = new hu((this.name || \"videoDome\") + \"_texture\", e, n, i.generateMipMaps, this._useDirectMapping, Ne.a.TRILINEAR_SAMPLINGMODE, a);\n            return i.clickToPlay && (n.onPointerUp = function() {\n              o._texture.video.play();\n            }), s;\n          }, t.MODE_MONOSCOPIC = Di.MODE_MONOSCOPIC, t.MODE_TOPBOTTOM = Di.MODE_TOPBOTTOM, t.MODE_SIDEBYSIDE = Di.MODE_SIDEBYSIDE, t;\n        }(Di), Gn = f(55), Jp = function() {\n          function r(t) {\n            this.engine = t, this._captureGPUFrameTime = !1, this._gpuFrameTime = new Gn.a(), this._captureShaderCompilationTime = !1, this._shaderCompilationTime = new Gn.a(), this._onBeginFrameObserver = null, this._onEndFrameObserver = null, this._onBeforeShaderCompilationObserver = null, this._onAfterShaderCompilationObserver = null;\n          }\n          return Object.defineProperty(r.prototype, \"gpuFrameTimeCounter\", { get: function() {\n            return this._gpuFrameTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureGPUFrameTime\", { get: function() {\n            return this._captureGPUFrameTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureGPUFrameTime && (this._captureGPUFrameTime = t, t ? (this._onBeginFrameObserver = this.engine.onBeginFrameObservable.add(function() {\n              e._gpuFrameTimeToken || (e._gpuFrameTimeToken = e.engine.startTimeQuery());\n            }), this._onEndFrameObserver = this.engine.onEndFrameObservable.add(function() {\n              if (e._gpuFrameTimeToken) {\n                var n = e.engine.endTimeQuery(e._gpuFrameTimeToken);\n                n > -1 && (e._gpuFrameTimeToken = null, e._gpuFrameTime.fetchNewFrame(), e._gpuFrameTime.addCount(n, !0));\n              }\n            })) : (this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"shaderCompilationTimeCounter\", { get: function() {\n            return this._shaderCompilationTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureShaderCompilationTime\", { get: function() {\n            return this._captureShaderCompilationTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureShaderCompilationTime && (this._captureShaderCompilationTime = t, t ? (this._onBeforeShaderCompilationObserver = this.engine.onBeforeShaderCompilationObservable.add(function() {\n              e._shaderCompilationTime.fetchNewFrame(), e._shaderCompilationTime.beginMonitoring();\n            }), this._onAfterShaderCompilationObserver = this.engine.onAfterShaderCompilationObservable.add(function() {\n              e._shaderCompilationTime.endMonitoring();\n            })) : (this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null));\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.engine.onBeginFrameObservable.remove(this._onBeginFrameObserver), this._onBeginFrameObserver = null, this.engine.onEndFrameObservable.remove(this._onEndFrameObserver), this._onEndFrameObserver = null, this.engine.onBeforeShaderCompilationObservable.remove(this._onBeforeShaderCompilationObserver), this._onBeforeShaderCompilationObserver = null, this.engine.onAfterShaderCompilationObservable.remove(this._onAfterShaderCompilationObserver), this._onAfterShaderCompilationObserver = null, this.engine = null;\n          }, r;\n        }(), $p = function() {\n          function r(t) {\n            var e = this;\n            this.scene = t, this._captureActiveMeshesEvaluationTime = !1, this._activeMeshesEvaluationTime = new Gn.a(), this._captureRenderTargetsRenderTime = !1, this._renderTargetsRenderTime = new Gn.a(), this._captureFrameTime = !1, this._frameTime = new Gn.a(), this._captureRenderTime = !1, this._renderTime = new Gn.a(), this._captureInterFrameTime = !1, this._interFrameTime = new Gn.a(), this._captureParticlesRenderTime = !1, this._particlesRenderTime = new Gn.a(), this._captureSpritesRenderTime = !1, this._spritesRenderTime = new Gn.a(), this._capturePhysicsTime = !1, this._physicsTime = new Gn.a(), this._captureAnimationsTime = !1, this._animationsTime = new Gn.a(), this._captureCameraRenderTime = !1, this._cameraRenderTime = new Gn.a(), this._onBeforeActiveMeshesEvaluationObserver = null, this._onAfterActiveMeshesEvaluationObserver = null, this._onBeforeRenderTargetsRenderObserver = null, this._onAfterRenderTargetsRenderObserver = null, this._onAfterRenderObserver = null, this._onBeforeDrawPhaseObserver = null, this._onAfterDrawPhaseObserver = null, this._onBeforeAnimationsObserver = null, this._onBeforeParticlesRenderingObserver = null, this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver = null, this._onAfterSpritesRenderingObserver = null, this._onBeforePhysicsObserver = null, this._onAfterPhysicsObserver = null, this._onAfterAnimationsObserver = null, this._onBeforeCameraRenderObserver = null, this._onAfterCameraRenderObserver = null, this._onBeforeAnimationsObserver = t.onBeforeAnimationsObservable.add(function() {\n              e._captureActiveMeshesEvaluationTime && e._activeMeshesEvaluationTime.fetchNewFrame(), e._captureRenderTargetsRenderTime && e._renderTargetsRenderTime.fetchNewFrame(), e._captureFrameTime && (Xe.b.StartPerformanceCounter(\"Scene rendering\"), e._frameTime.beginMonitoring()), e._captureInterFrameTime && e._interFrameTime.endMonitoring(), e._captureParticlesRenderTime && e._particlesRenderTime.fetchNewFrame(), e._captureSpritesRenderTime && e._spritesRenderTime.fetchNewFrame(), e._captureAnimationsTime && e._animationsTime.beginMonitoring(), e.scene.getEngine()._drawCalls.fetchNewFrame();\n            }), this._onAfterRenderObserver = t.onAfterRenderObservable.add(function() {\n              e._captureFrameTime && (Xe.b.EndPerformanceCounter(\"Scene rendering\"), e._frameTime.endMonitoring()), e._captureRenderTime && e._renderTime.endMonitoring(!1), e._captureInterFrameTime && e._interFrameTime.beginMonitoring();\n            });\n          }\n          return Object.defineProperty(r.prototype, \"activeMeshesEvaluationTimeCounter\", { get: function() {\n            return this._activeMeshesEvaluationTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureActiveMeshesEvaluationTime\", { get: function() {\n            return this._captureActiveMeshesEvaluationTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureActiveMeshesEvaluationTime && (this._captureActiveMeshesEvaluationTime = t, t ? (this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Active meshes evaluation\"), e._activeMeshesEvaluationTime.beginMonitoring();\n            }), this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Active meshes evaluation\"), e._activeMeshesEvaluationTime.endMonitoring();\n            })) : (this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderTargetsRenderTimeCounter\", { get: function() {\n            return this._renderTargetsRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureRenderTargetsRenderTime\", { get: function() {\n            return this._captureRenderTargetsRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureRenderTargetsRenderTime && (this._captureRenderTargetsRenderTime = t, t ? (this._onBeforeRenderTargetsRenderObserver = this.scene.onBeforeRenderTargetsRenderObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Render targets rendering\"), e._renderTargetsRenderTime.beginMonitoring();\n            }), this._onAfterRenderTargetsRenderObserver = this.scene.onAfterRenderTargetsRenderObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Render targets rendering\"), e._renderTargetsRenderTime.endMonitoring(!1);\n            })) : (this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"particlesRenderTimeCounter\", { get: function() {\n            return this._particlesRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureParticlesRenderTime\", { get: function() {\n            return this._captureParticlesRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureParticlesRenderTime && (this._captureParticlesRenderTime = t, t ? (this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Particles\"), e._particlesRenderTime.beginMonitoring();\n            }), this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Particles\"), e._particlesRenderTime.endMonitoring(!1);\n            })) : (this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"spritesRenderTimeCounter\", { get: function() {\n            return this._spritesRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureSpritesRenderTime\", { get: function() {\n            return this._captureSpritesRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureSpritesRenderTime && (this._captureSpritesRenderTime = t, this.scene.spriteManagers && (t ? (this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Sprites\"), e._spritesRenderTime.beginMonitoring();\n            }), this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Sprites\"), e._spritesRenderTime.endMonitoring(!1);\n            })) : (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null, this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null)));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"physicsTimeCounter\", { get: function() {\n            return this._physicsTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"capturePhysicsTime\", { get: function() {\n            return this._capturePhysicsTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._capturePhysicsTime && this.scene.onBeforePhysicsObservable && (this._capturePhysicsTime = t, t ? (this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(function() {\n              Xe.b.StartPerformanceCounter(\"Physics\"), e._physicsTime.beginMonitoring();\n            }), this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(function() {\n              Xe.b.EndPerformanceCounter(\"Physics\"), e._physicsTime.endMonitoring();\n            })) : (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null, this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationsTimeCounter\", { get: function() {\n            return this._animationsTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureAnimationsTime\", { get: function() {\n            return this._captureAnimationsTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureAnimationsTime && (this._captureAnimationsTime = t, t ? this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(function() {\n              e._animationsTime.endMonitoring();\n            }) : (this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"frameTimeCounter\", { get: function() {\n            return this._frameTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureFrameTime\", { get: function() {\n            return this._captureFrameTime;\n          }, set: function(t) {\n            this._captureFrameTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"interFrameTimeCounter\", { get: function() {\n            return this._interFrameTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureInterFrameTime\", { get: function() {\n            return this._captureInterFrameTime;\n          }, set: function(t) {\n            this._captureInterFrameTime = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderTimeCounter\", { get: function() {\n            return this._renderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureRenderTime\", { get: function() {\n            return this._captureRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureRenderTime && (this._captureRenderTime = t, t ? (this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(function() {\n              e._renderTime.beginMonitoring(), Xe.b.StartPerformanceCounter(\"Main render\");\n            }), this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(function() {\n              e._renderTime.endMonitoring(!1), Xe.b.EndPerformanceCounter(\"Main render\");\n            })) : (this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cameraRenderTimeCounter\", { get: function() {\n            return this._cameraRenderTime;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"captureCameraRenderTime\", { get: function() {\n            return this._captureCameraRenderTime;\n          }, set: function(t) {\n            var e = this;\n            t !== this._captureCameraRenderTime && (this._captureCameraRenderTime = t, t ? (this._onBeforeCameraRenderObserver = this.scene.onBeforeCameraRenderObservable.add(function(n) {\n              e._cameraRenderTime.beginMonitoring(), Xe.b.StartPerformanceCounter(\"Rendering camera \" + n.name);\n            }), this._onAfterCameraRenderObserver = this.scene.onAfterCameraRenderObservable.add(function(n) {\n              e._cameraRenderTime.endMonitoring(!1), Xe.b.EndPerformanceCounter(\"Rendering camera \" + n.name);\n            })) : (this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"drawCallsCounter\", { get: function() {\n            return this.scene.getEngine()._drawCalls;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this.scene.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = null, this.scene.onBeforeActiveMeshesEvaluationObservable.remove(this._onBeforeActiveMeshesEvaluationObserver), this._onBeforeActiveMeshesEvaluationObserver = null, this.scene.onAfterActiveMeshesEvaluationObservable.remove(this._onAfterActiveMeshesEvaluationObserver), this._onAfterActiveMeshesEvaluationObserver = null, this.scene.onBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver), this._onBeforeRenderTargetsRenderObserver = null, this.scene.onAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver), this._onAfterRenderTargetsRenderObserver = null, this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null, this.scene.onBeforeParticlesRenderingObservable.remove(this._onBeforeParticlesRenderingObserver), this._onBeforeParticlesRenderingObserver = null, this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver), this._onAfterParticlesRenderingObserver = null, this._onBeforeSpritesRenderingObserver && (this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver), this._onBeforeSpritesRenderingObserver = null), this._onAfterSpritesRenderingObserver && (this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver), this._onAfterSpritesRenderingObserver = null), this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver), this._onBeforeDrawPhaseObserver = null, this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver), this._onAfterDrawPhaseObserver = null, this._onBeforePhysicsObserver && (this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver), this._onBeforePhysicsObserver = null), this._onAfterPhysicsObserver && (this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver), this._onAfterPhysicsObserver = null), this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver), this._onAfterAnimationsObserver = null, this.scene.onBeforeCameraRenderObservable.remove(this._onBeforeCameraRenderObserver), this._onBeforeCameraRenderObserver = null, this.scene.onAfterCameraRenderObservable.remove(this._onAfterCameraRenderObserver), this._onAfterCameraRenderObserver = null, this.scene = null;\n          }, r;\n        }(), e_ = `#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform sampler2D opacitySampler;\nuniform float opacityIntensity;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef VERTEXALPHA\nvarying vec4 vColor;\n#endif\nuniform vec4 glowColor;\nvoid main(void)\n{\nvec4 finalColor=glowColor;\n\n#ifdef DIFFUSE\nvec4 albedoTexture=texture2D(diffuseSampler,vUVDiffuse);\n#ifdef GLOW\n\nfinalColor.a*=albedoTexture.a;\n#endif\n#ifdef HIGHLIGHT\n\nfinalColor.a=albedoTexture.a;\n#endif\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vUVOpacity);\n#ifdef OPACITYRGB\nfinalColor.a*=getLuminance(opacityMap.rgb);\n#else\nfinalColor.a*=opacityMap.a;\n#endif\nfinalColor.a*=opacityIntensity;\n#endif\n#ifdef VERTEXALPHA\nfinalColor.a*=vColor.a;\n#endif\n#ifdef ALPHATEST\nif (finalColor.a<ALPHATESTVALUE)\ndiscard;\n#endif\n#ifdef EMISSIVE\ngl_FragColor=texture2D(emissiveSampler,vUVEmissive)*finalColor;\n#else\ngl_FragColor=finalColor;\n#endif\n#ifdef HIGHLIGHT\n\ngl_FragColor.a=glowColor.a;\n#endif\n}`;\n        ze.a.ShadersStore.glowMapGenerationPixelShader = e_;\n        var t_ = `\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nvarying vec4 vPosition;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef DIFFUSE\nvarying vec2 vUVDiffuse;\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef OPACITY\nvarying vec2 vUVOpacity;\nuniform mat4 opacityMatrix;\n#endif\n#ifdef EMISSIVE\nvarying vec2 vUVEmissive;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef VERTEXALPHA\nattribute vec4 color;\nvarying vec4 vColor;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\n#ifdef CUBEMAP\nvPosition=finalWorld*vec4(positionUpdated,1.0);\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\n#else\nvPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\ngl_Position=vPosition;\n#endif\n#ifdef DIFFUSE\n#ifdef DIFFUSEUV1\nvUVDiffuse=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef DIFFUSEUV2\nvUVDiffuse=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef OPACITY\n#ifdef OPACITYUV1\nvUVOpacity=vec2(opacityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef OPACITYUV2\nvUVOpacity=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef EMISSIVE\n#ifdef EMISSIVEUV1\nvUVEmissive=vec2(emissiveMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef EMISSIVEUV2\nvUVEmissive=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#ifdef VERTEXALPHA\nvColor=color;\n#endif\n}`;\n        ze.a.ShadersStore.glowMapGenerationVertexShader = t_;\n        var no = function() {\n          function r(t, e) {\n            this._vertexBuffers = {}, this._maxSize = 0, this._mainTextureDesiredSize = { width: 0, height: 0 }, this._shouldRender = !0, this._postProcesses = [], this._textures = [], this._emissiveTextureAndColor = { texture: null, color: new I.b() }, this.neutralColor = new I.b(), this.isEnabled = !0, this.disableBoundingBoxesFromEffectLayer = !1, this.onDisposeObservable = new C.c(), this.onBeforeRenderMainTextureObservable = new C.c(), this.onBeforeComposeObservable = new C.c(), this.onBeforeRenderMeshToEffect = new C.c(), this.onAfterRenderMeshToEffect = new C.c(), this.onAfterComposeObservable = new C.c(), this.onSizeChangedObservable = new C.c(), this.name = t, this._scene = e || te.a.LastCreatedScene, r._SceneComponentInitialization(this._scene), this._engine = this._scene.getEngine(), this._maxSize = this._engine.getCaps().maxTextureSize, this._scene.effectLayers.push(this), this._generateIndexBuffer(), this._generateVertexBuffer();\n          }\n          return Object.defineProperty(r.prototype, \"camera\", { get: function() {\n            return this._effectLayerOptions.camera;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderingGroupId\", { get: function() {\n            return this._effectLayerOptions.renderingGroupId;\n          }, set: function(t) {\n            this._effectLayerOptions.renderingGroupId = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype._init = function(t) {\n            this._effectLayerOptions = Object(c.a)({ mainTextureRatio: 0.5, alphaBlendingMode: h.a.ALPHA_COMBINE, camera: null, renderingGroupId: -1 }, t), this._setMainTextureSize(), this._createMainTexture(), this._createTextureAndPostProcesses(), this._mergeEffect = this._createMergeEffect();\n          }, r.prototype._generateIndexBuffer = function() {\n            var t = [];\n            t.push(0), t.push(1), t.push(2), t.push(0), t.push(2), t.push(3), this._indexBuffer = this._engine.createIndexBuffer(t);\n          }, r.prototype._generateVertexBuffer = function() {\n            var t = [];\n            t.push(1, 1), t.push(-1, 1), t.push(-1, -1), t.push(1, -1);\n            var e = new Oe.b(this._engine, t, Oe.b.PositionKind, !1, !1, 2);\n            this._vertexBuffers[Oe.b.PositionKind] = e;\n          }, r.prototype._setMainTextureSize = function() {\n            this._effectLayerOptions.mainTextureFixedSize ? (this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize, this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize) : (this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio, this._mainTextureDesiredSize.width = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize) : this._mainTextureDesiredSize.width, this._mainTextureDesiredSize.height = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize) : this._mainTextureDesiredSize.height), this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width), this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);\n          }, r.prototype._createMainTexture = function() {\n            var t = this;\n            this._mainTexture = new on(\"HighlightLayerMainRTT\", { width: this._mainTextureDesiredSize.width, height: this._mainTextureDesiredSize.height }, this._scene, !1, !0, h.a.TEXTURETYPE_UNSIGNED_INT), this._mainTexture.activeCamera = this._effectLayerOptions.camera, this._mainTexture.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._mainTexture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._mainTexture.anisotropicFilteringLevel = 1, this._mainTexture.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._mainTexture.renderParticles = !1, this._mainTexture.renderList = null, this._mainTexture.ignoreCameraViewport = !0, this._mainTexture.customRenderFunction = function(n, i, o, a) {\n              var s;\n              t.onBeforeRenderMainTextureObservable.notifyObservers(t);\n              var d = t._scene.getEngine();\n              if (a.length) {\n                for (d.setColorWrite(!1), s = 0; s < a.length; s++)\n                  t._renderSubMesh(a.data[s]);\n                d.setColorWrite(!0);\n              }\n              for (s = 0; s < n.length; s++)\n                t._renderSubMesh(n.data[s]);\n              for (s = 0; s < i.length; s++)\n                t._renderSubMesh(i.data[s]);\n              var p = d.getAlphaMode();\n              for (s = 0; s < o.length; s++)\n                t._renderSubMesh(o.data[s], !0);\n              d.setAlphaMode(p);\n            }, this._mainTexture.onClearObservable.add(function(n) {\n              n.clear(t.neutralColor, !0, !0, !0);\n            });\n            var e = this._scene.getBoundingBoxRenderer().enabled;\n            this._mainTexture.onBeforeBindObservable.add(function() {\n              t._scene.getBoundingBoxRenderer().enabled = !t.disableBoundingBoxesFromEffectLayer && e;\n            }), this._mainTexture.onAfterUnbindObservable.add(function() {\n              t._scene.getBoundingBoxRenderer().enabled = e;\n            });\n          }, r.prototype._addCustomEffectDefines = function(t) {\n          }, r.prototype._isReady = function(t, e, n) {\n            var i = t.getMaterial();\n            if (!i || !i.isReadyForSubMesh(t.getMesh(), t, e))\n              return !1;\n            var o = [], a = [Oe.b.PositionKind], s = t.getMesh(), d = !1, p = !1;\n            if (i) {\n              var y = i.needAlphaTesting(), P = i.getAlphaTestTexture(), R = P && P.hasAlpha && (i.useAlphaFromDiffuseTexture || i._useAlphaFromAlbedoTexture);\n              P && (y || R) && (o.push(\"#define DIFFUSE\"), s.isVerticesDataPresent(Oe.b.UV2Kind) && P.coordinatesIndex === 1 ? (o.push(\"#define DIFFUSEUV2\"), p = !0) : s.isVerticesDataPresent(Oe.b.UVKind) && (o.push(\"#define DIFFUSEUV1\"), d = !0), y && (o.push(\"#define ALPHATEST\"), o.push(\"#define ALPHATESTVALUE 0.4\")));\n              var B = i.opacityTexture;\n              B && (o.push(\"#define OPACITY\"), s.isVerticesDataPresent(Oe.b.UV2Kind) && B.coordinatesIndex === 1 ? (o.push(\"#define OPACITYUV2\"), p = !0) : s.isVerticesDataPresent(Oe.b.UVKind) && (o.push(\"#define OPACITYUV1\"), d = !0));\n            }\n            n && (o.push(\"#define EMISSIVE\"), s.isVerticesDataPresent(Oe.b.UV2Kind) && n.coordinatesIndex === 1 ? (o.push(\"#define EMISSIVEUV2\"), p = !0) : s.isVerticesDataPresent(Oe.b.UVKind) && (o.push(\"#define EMISSIVEUV1\"), d = !0)), s.isVerticesDataPresent(Oe.b.ColorKind) && s.hasVertexAlpha && (a.push(Oe.b.ColorKind), o.push(\"#define VERTEXALPHA\")), d && (a.push(Oe.b.UVKind), o.push(\"#define UV1\")), p && (a.push(Oe.b.UV2Kind), o.push(\"#define UV2\"));\n            var F = new _r.a();\n            if (s.useBones && s.computeBonesUsingShaders) {\n              a.push(Oe.b.MatricesIndicesKind), a.push(Oe.b.MatricesWeightsKind), s.numBoneInfluencers > 4 && (a.push(Oe.b.MatricesIndicesExtraKind), a.push(Oe.b.MatricesWeightsExtraKind)), o.push(\"#define NUM_BONE_INFLUENCERS \" + s.numBoneInfluencers);\n              var z = s.skeleton;\n              z && z.isUsingTextureForMatrices ? o.push(\"#define BONETEXTURE\") : o.push(\"#define BonesPerMesh \" + (z ? z.bones.length + 1 : 0)), s.numBoneInfluencers > 0 && F.addCPUSkinningFallback(0, s);\n            } else\n              o.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var J = s.morphTargetManager, ie = 0;\n            J && J.numInfluencers > 0 && (o.push(\"#define MORPHTARGETS\"), ie = J.numInfluencers, o.push(\"#define NUM_MORPH_INFLUENCERS \" + ie), $e.a.PrepareAttributesForMorphTargetsInfluencers(a, s, ie)), e && (o.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(a), t.getRenderingMesh().hasThinInstances && o.push(\"#define THIN_INSTANCES\")), this._addCustomEffectDefines(o);\n            var se = o.join(`\n`);\n            return this._cachedDefines !== se && (this._cachedDefines = se, this._effectLayerMapGenerationEffect = this._scene.getEngine().createEffect(\"glowMapGeneration\", a, [\"world\", \"mBones\", \"viewProjection\", \"glowColor\", \"morphTargetInfluences\", \"boneTextureWidth\", \"diffuseMatrix\", \"emissiveMatrix\", \"opacityMatrix\", \"opacityIntensity\"], [\"diffuseSampler\", \"emissiveSampler\", \"opacitySampler\", \"boneSampler\"], se, F, void 0, void 0, { maxSimultaneousMorphTargets: ie })), this._effectLayerMapGenerationEffect.isReady();\n          }, r.prototype.render = function() {\n            var t = this._mergeEffect;\n            if (t.isReady()) {\n              for (var e = 0; e < this._postProcesses.length; e++)\n                if (!this._postProcesses[e].isReady())\n                  return;\n              var n = this._scene.getEngine();\n              this.onBeforeComposeObservable.notifyObservers(this), n.enableEffect(t), n.setState(!1), n.bindBuffers(this._vertexBuffers, this._indexBuffer, t);\n              var i = n.getAlphaMode();\n              n.setAlphaMode(this._effectLayerOptions.alphaBlendingMode), this._internalRender(t), n.setAlphaMode(i), this.onAfterComposeObservable.notifyObservers(this);\n              var o = this._mainTexture.getSize();\n              this._setMainTextureSize(), o.width === this._mainTextureDesiredSize.width && o.height === this._mainTextureDesiredSize.height || (this.onSizeChangedObservable.notifyObservers(this), this._disposeTextureAndPostProcesses(), this._createMainTexture(), this._createTextureAndPostProcesses());\n            }\n          }, r.prototype.hasMesh = function(t) {\n            return this.renderingGroupId === -1 || t.renderingGroupId === this.renderingGroupId;\n          }, r.prototype.shouldRender = function() {\n            return this.isEnabled && this._shouldRender;\n          }, r.prototype._shouldRenderMesh = function(t) {\n            return !0;\n          }, r.prototype._canRenderMesh = function(t, e) {\n            return !e.needAlphaBlendingForMesh(t);\n          }, r.prototype._shouldRenderEmissiveTextureForMesh = function() {\n            return !0;\n          }, r.prototype._renderSubMesh = function(t, e) {\n            var n, i = this;\n            if (e === void 0 && (e = !1), this.shouldRender()) {\n              var o = t.getMaterial(), a = t.getMesh(), s = t.getReplacementMesh(), d = t.getRenderingMesh(), p = t.getEffectiveMesh(), y = this._scene, P = y.getEngine();\n              if (p._internalAbstractMeshDataInfo._isActiveIntermediate = !1, o && this._canRenderMesh(d, o)) {\n                var R = (n = d.overrideMaterialSideOrientation) !== null && n !== void 0 ? n : o.sideOrientation;\n                d._getWorldMatrixDeterminant() < 0 && (R = R === zt.a.ClockWiseSideOrientation ? zt.a.CounterClockWiseSideOrientation : zt.a.ClockWiseSideOrientation);\n                var B = R === zt.a.ClockWiseSideOrientation;\n                P.setState(o.backFaceCulling, o.zOffset, void 0, B);\n                var F = d._getInstancesRenderList(t._id, !!s);\n                if (!F.mustReturn && this._shouldRenderMesh(d)) {\n                  var z = F.hardwareInstancedRendering[t._id] || d.hasThinInstances;\n                  if (this._setEmissiveTextureAndColor(d, t, o), this.onBeforeRenderMeshToEffect.notifyObservers(a), this._useMeshMaterial(d))\n                    d.render(t, z, s || void 0);\n                  else if (this._isReady(t, z, this._emissiveTextureAndColor.texture)) {\n                    P.enableEffect(this._effectLayerMapGenerationEffect), d._bind(t, this._effectLayerMapGenerationEffect, zt.a.TriangleFillMode), this._effectLayerMapGenerationEffect.setMatrix(\"viewProjection\", y.getTransformMatrix()), this._effectLayerMapGenerationEffect.setMatrix(\"world\", p.getWorldMatrix()), this._effectLayerMapGenerationEffect.setFloat4(\"glowColor\", this._emissiveTextureAndColor.color.r, this._emissiveTextureAndColor.color.g, this._emissiveTextureAndColor.color.b, this._emissiveTextureAndColor.color.a);\n                    var J = o.needAlphaTesting(), ie = o.getAlphaTestTexture(), se = ie && ie.hasAlpha && (o.useAlphaFromDiffuseTexture || o._useAlphaFromAlbedoTexture);\n                    ie && (J || se) && (this._effectLayerMapGenerationEffect.setTexture(\"diffuseSampler\", ie), (ce = ie.getTextureMatrix()) && this._effectLayerMapGenerationEffect.setMatrix(\"diffuseMatrix\", ce));\n                    var ce, ue = o.opacityTexture;\n                    if (ue && (this._effectLayerMapGenerationEffect.setTexture(\"opacitySampler\", ue), this._effectLayerMapGenerationEffect.setFloat(\"opacityIntensity\", ue.level), (ce = ue.getTextureMatrix()) && this._effectLayerMapGenerationEffect.setMatrix(\"opacityMatrix\", ce)), this._emissiveTextureAndColor.texture && (this._effectLayerMapGenerationEffect.setTexture(\"emissiveSampler\", this._emissiveTextureAndColor.texture), this._effectLayerMapGenerationEffect.setMatrix(\"emissiveMatrix\", this._emissiveTextureAndColor.texture.getTextureMatrix())), d.useBones && d.computeBonesUsingShaders && d.skeleton) {\n                      var fe = d.skeleton;\n                      if (fe.isUsingTextureForMatrices) {\n                        var ve = fe.getTransformMatrixTexture(d);\n                        if (!ve)\n                          return;\n                        this._effectLayerMapGenerationEffect.setTexture(\"boneSampler\", ve), this._effectLayerMapGenerationEffect.setFloat(\"boneTextureWidth\", 4 * (fe.bones.length + 1));\n                      } else\n                        this._effectLayerMapGenerationEffect.setMatrices(\"mBones\", fe.getTransformMatrices(d));\n                    }\n                    $e.a.BindMorphTargetParameters(d, this._effectLayerMapGenerationEffect), e && P.setAlphaMode(o.alphaMode), d._processRendering(p, t, this._effectLayerMapGenerationEffect, o.fillMode, F, z, function(Te, Re) {\n                      return i._effectLayerMapGenerationEffect.setMatrix(\"world\", Re);\n                    });\n                  } else\n                    this._mainTexture.resetRefreshCounter();\n                  this.onAfterRenderMeshToEffect.notifyObservers(a);\n                }\n              }\n            }\n          }, r.prototype._useMeshMaterial = function(t) {\n            return !1;\n          }, r.prototype._rebuild = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && t._rebuild(), this._generateIndexBuffer();\n          }, r.prototype._disposeTextureAndPostProcesses = function() {\n            this._mainTexture.dispose();\n            for (var t = 0; t < this._postProcesses.length; t++)\n              this._postProcesses[t] && this._postProcesses[t].dispose();\n            for (this._postProcesses = [], t = 0; t < this._textures.length; t++)\n              this._textures[t] && this._textures[t].dispose();\n            this._textures = [];\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._disposeTextureAndPostProcesses();\n            var e = this._scene.effectLayers.indexOf(this, 0);\n            e > -1 && this._scene.effectLayers.splice(e, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onBeforeRenderMainTextureObservable.clear(), this.onBeforeComposeObservable.clear(), this.onBeforeRenderMeshToEffect.clear(), this.onAfterRenderMeshToEffect.clear(), this.onAfterComposeObservable.clear(), this.onSizeChangedObservable.clear();\n          }, r.prototype.getClassName = function() {\n            return \"EffectLayer\";\n          }, r.Parse = function(t, e, n) {\n            return Xe.b.Instantiate(t.customType).Parse(t, e, n);\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"EffectLayerSceneComponent\");\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"name\", void 0), Object(c.c)([Object(L.f)()], r.prototype, \"neutralColor\", void 0), Object(c.c)([Object(L.c)()], r.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.d)()], r.prototype, \"camera\", null), Object(c.c)([Object(L.c)()], r.prototype, \"renderingGroupId\", null), Object(c.c)([Object(L.c)()], r.prototype, \"disableBoundingBoxesFromEffectLayer\", void 0), r;\n        }();\n        V.a.AddParser(ot.a.NAME_EFFECTLAYER, function(r, t, e, n) {\n          if (r.effectLayers) {\n            e.effectLayers || (e.effectLayers = new Array());\n            for (var i = 0; i < r.effectLayers.length; i++) {\n              var o = no.Parse(r.effectLayers[i], t, n);\n              e.effectLayers.push(o);\n            }\n          }\n        }), V.a.prototype.removeEffectLayer = function(r) {\n          var t = this.effectLayers.indexOf(r);\n          return t !== -1 && this.effectLayers.splice(t, 1), t;\n        }, V.a.prototype.addEffectLayer = function(r) {\n          this.effectLayers.push(r);\n        };\n        var du = function() {\n          function r(t) {\n            this.name = ot.a.NAME_EFFECTLAYER, this._renderEffects = !1, this._needStencil = !1, this._previousStencilState = !1, this.scene = t, this._engine = t.getEngine(), t.effectLayers = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._isReadyForMeshStage.registerStep(ot.a.STEP_ISREADYFORMESH_EFFECTLAYER, this, this._isReadyForMesh), this.scene._cameraDrawRenderTargetStage.registerStep(ot.a.STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER, this, this._renderMainTexture), this.scene._beforeCameraDrawStage.registerStep(ot.a.STEP_BEFORECAMERADRAW_EFFECTLAYER, this, this._setStencil), this.scene._afterRenderingGroupDrawStage.registerStep(ot.a.STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW, this, this._drawRenderingGroup), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_EFFECTLAYER, this, this._setStencilBack), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW, this, this._drawCamera);\n          }, r.prototype.rebuild = function() {\n            for (var t = 0, e = this.scene.effectLayers; t < e.length; t++)\n              e[t]._rebuild();\n          }, r.prototype.serialize = function(t) {\n            t.effectLayers = [];\n            for (var e = 0, n = this.scene.effectLayers; e < n.length; e++) {\n              var i = n[e];\n              i.serialize && t.effectLayers.push(i.serialize());\n            }\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.effectLayers && t.effectLayers.forEach(function(n) {\n              e.scene.addEffectLayer(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            t.effectLayers && t.effectLayers.forEach(function(i) {\n              n.scene.removeEffectLayer(i), e && i.dispose();\n            });\n          }, r.prototype.dispose = function() {\n            for (var t = this.scene.effectLayers; t.length; )\n              t[0].dispose();\n          }, r.prototype._isReadyForMesh = function(t, e) {\n            for (var n = 0, i = this.scene.effectLayers; n < i.length; n++) {\n              var o = i[n];\n              if (o.hasMesh(t))\n                for (var a = 0, s = t.subMeshes; a < s.length; a++) {\n                  var d = s[a];\n                  if (!o.isReady(d, e))\n                    return !1;\n                }\n            }\n            return !0;\n          }, r.prototype._renderMainTexture = function(t) {\n            this._renderEffects = !1, this._needStencil = !1;\n            var e = !1, n = this.scene.effectLayers;\n            if (n && n.length > 0) {\n              this._previousStencilState = this._engine.getStencilBuffer();\n              for (var i = 0, o = n; i < o.length; i++) {\n                var a = o[i];\n                if (a.shouldRender() && (!a.camera || a.camera.cameraRigMode === _t.a.RIG_MODE_NONE && t === a.camera || a.camera.cameraRigMode !== _t.a.RIG_MODE_NONE && a.camera._rigCameras.indexOf(t) > -1)) {\n                  this._renderEffects = !0, this._needStencil = this._needStencil || a.needStencil();\n                  var s = a._mainTexture;\n                  s._shouldRender() && (this.scene.incrementRenderId(), s.render(!1, !1), e = !0);\n                }\n              }\n              this.scene.incrementRenderId();\n            }\n            return e;\n          }, r.prototype._setStencil = function() {\n            this._needStencil && this._engine.setStencilBuffer(!0);\n          }, r.prototype._setStencilBack = function() {\n            this._needStencil && this._engine.setStencilBuffer(this._previousStencilState);\n          }, r.prototype._draw = function(t) {\n            if (this._renderEffects) {\n              this._engine.setDepthBuffer(!1);\n              for (var e = this.scene.effectLayers, n = 0; n < e.length; n++) {\n                var i = e[n];\n                i.renderingGroupId === t && i.shouldRender() && i.render();\n              }\n              this._engine.setDepthBuffer(!0);\n            }\n          }, r.prototype._drawCamera = function() {\n            this._renderEffects && this._draw(-1);\n          }, r.prototype._drawRenderingGroup = function(t) {\n            !this.scene._isInIntermediateRendering() && this._renderEffects && this._draw(t);\n          }, r;\n        }();\n        no._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_EFFECTLAYER);\n          t || (t = new du(r), r._addComponent(t));\n        };\n        var n_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n#ifdef EMISSIVE\nuniform sampler2D textureSampler2;\n#endif\n\nuniform float offset;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef EMISSIVE\nbaseColor+=texture2D(textureSampler2,vUV);\nbaseColor*=offset;\n#else\nbaseColor.a=abs(offset-baseColor.a);\n#ifdef STROKE\nfloat alpha=smoothstep(.0,.1,baseColor.a);\nbaseColor.a=alpha;\nbaseColor.rgb=baseColor.rgb*alpha;\n#endif\n#endif\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.glowMapMergePixelShader = n_;\n        var i_ = `\nattribute vec2 position;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.glowMapMergeVertexShader = i_, V.a.prototype.getGlowLayerByName = function(r) {\n          for (var t = 0; t < this.effectLayers.length; t++)\n            if (this.effectLayers[t].name === r && this.effectLayers[t].getEffectName() === Ko.EffectName)\n              return this.effectLayers[t];\n          return null;\n        };\n        var Ko = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n) || this;\n            return o._intensity = 1, o._includedOnlyMeshes = [], o._excludedMeshes = [], o._meshesUsingTheirOwnMaterials = [], o.neutralColor = new I.b(0, 0, 0, 1), o._options = Object(c.a)({ mainTextureRatio: t.DefaultTextureRatio, blurKernelSize: 32, mainTextureFixedSize: void 0, camera: null, mainTextureSamples: 1, renderingGroupId: -1 }, i), o._init({ alphaBlendingMode: h.a.ALPHA_ADD, camera: o._options.camera, mainTextureFixedSize: o._options.mainTextureFixedSize, mainTextureRatio: o._options.mainTextureRatio, renderingGroupId: o._options.renderingGroupId }), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"blurKernelSize\", { get: function() {\n            return this._horizontalBlurPostprocess1.kernel;\n          }, set: function(e) {\n            this._horizontalBlurPostprocess1.kernel = e, this._verticalBlurPostprocess1.kernel = e, this._horizontalBlurPostprocess2.kernel = e, this._verticalBlurPostprocess2.kernel = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._intensity;\n          }, set: function(e) {\n            this._intensity = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getEffectName = function() {\n            return t.EffectName;\n          }, t.prototype._createMergeEffect = function() {\n            return this._engine.createEffect(\"glowMapMerge\", [Oe.b.PositionKind], [\"offset\"], [\"textureSampler\", \"textureSampler2\"], `#define EMISSIVE \n`);\n          }, t.prototype._createTextureAndPostProcesses = function() {\n            var e = this, n = this._mainTextureDesiredSize.width, i = this._mainTextureDesiredSize.height;\n            n = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(n, this._maxSize) : n, i = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(i, this._maxSize) : i;\n            var o = 0;\n            o = this._engine.getCaps().textureHalfFloatRender ? h.a.TEXTURETYPE_HALF_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INT, this._blurTexture1 = new on(\"GlowLayerBlurRTT\", { width: n, height: i }, this._scene, !1, !0, o), this._blurTexture1.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture1.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture1.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._blurTexture1.renderParticles = !1, this._blurTexture1.ignoreCameraViewport = !0;\n            var a = Math.floor(n / 2), s = Math.floor(i / 2);\n            this._blurTexture2 = new on(\"GlowLayerBlurRTT2\", { width: a, height: s }, this._scene, !1, !0, o), this._blurTexture2.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture2.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture2.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._blurTexture2.renderParticles = !1, this._blurTexture2.ignoreCameraViewport = !0, this._textures = [this._blurTexture1, this._blurTexture2], this._horizontalBlurPostprocess1 = new _n(\"GlowLayerHBP1\", new u.d(1, 0), this._options.blurKernelSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess1.width = n, this._horizontalBlurPostprocess1.height = i, this._horizontalBlurPostprocess1.onApplyObservable.add(function(d) {\n              d.setTexture(\"textureSampler\", e._mainTexture);\n            }), this._verticalBlurPostprocess1 = new _n(\"GlowLayerVBP1\", new u.d(0, 1), this._options.blurKernelSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess2 = new _n(\"GlowLayerHBP2\", new u.d(1, 0), this._options.blurKernelSize / 2, { width: a, height: s }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess2.width = a, this._horizontalBlurPostprocess2.height = s, this._horizontalBlurPostprocess2.onApplyObservable.add(function(d) {\n              d.setTexture(\"textureSampler\", e._blurTexture1);\n            }), this._verticalBlurPostprocess2 = new _n(\"GlowLayerVBP2\", new u.d(0, 1), this._options.blurKernelSize / 2, { width: a, height: s }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1], this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2], this._mainTexture.samples = this._options.mainTextureSamples, this._mainTexture.onAfterUnbindObservable.add(function() {\n              var d = e._blurTexture1.getInternalTexture();\n              if (d) {\n                e._scene.postProcessManager.directRender(e._postProcesses1, d, !0);\n                var p = e._blurTexture2.getInternalTexture();\n                p && e._scene.postProcessManager.directRender(e._postProcesses2, p, !0), e._engine.unBindFramebuffer(p ?? d, !0);\n              }\n            }), this._postProcesses.map(function(d) {\n              d.autoClear = !1;\n            });\n          }, t.prototype.isReady = function(e, n) {\n            var i = e.getMaterial(), o = e.getRenderingMesh();\n            if (!i || !o)\n              return !1;\n            var a = i.emissiveTexture;\n            return r.prototype._isReady.call(this, e, n, a);\n          }, t.prototype.needStencil = function() {\n            return !1;\n          }, t.prototype._canRenderMesh = function(e, n) {\n            return !0;\n          }, t.prototype._internalRender = function(e) {\n            e.setTexture(\"textureSampler\", this._blurTexture1), e.setTexture(\"textureSampler2\", this._blurTexture2), e.setFloat(\"offset\", this._intensity);\n            var n = this._engine, i = n.getStencilBuffer();\n            n.setStencilBuffer(!1), n.drawElementsType(zt.a.TriangleFillMode, 0, 6), n.setStencilBuffer(i);\n          }, t.prototype._setEmissiveTextureAndColor = function(e, n, i) {\n            var o = 1;\n            this.customEmissiveTextureSelector ? this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(e, n, i) : i ? (this._emissiveTextureAndColor.texture = i.emissiveTexture, this._emissiveTextureAndColor.texture && (o = this._emissiveTextureAndColor.texture.level)) : this._emissiveTextureAndColor.texture = null, this.customEmissiveColorSelector ? this.customEmissiveColorSelector(e, n, i, this._emissiveTextureAndColor.color) : i.emissiveColor ? this._emissiveTextureAndColor.color.set(i.emissiveColor.r * o, i.emissiveColor.g * o, i.emissiveColor.b * o, i.alpha) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);\n          }, t.prototype._shouldRenderMesh = function(e) {\n            return this.hasMesh(e);\n          }, t.prototype._addCustomEffectDefines = function(e) {\n            e.push(\"#define GLOW\");\n          }, t.prototype.addExcludedMesh = function(e) {\n            this._excludedMeshes.indexOf(e.uniqueId) === -1 && this._excludedMeshes.push(e.uniqueId);\n          }, t.prototype.removeExcludedMesh = function(e) {\n            var n = this._excludedMeshes.indexOf(e.uniqueId);\n            n !== -1 && this._excludedMeshes.splice(n, 1);\n          }, t.prototype.addIncludedOnlyMesh = function(e) {\n            this._includedOnlyMeshes.indexOf(e.uniqueId) === -1 && this._includedOnlyMeshes.push(e.uniqueId);\n          }, t.prototype.removeIncludedOnlyMesh = function(e) {\n            var n = this._includedOnlyMeshes.indexOf(e.uniqueId);\n            n !== -1 && this._includedOnlyMeshes.splice(n, 1);\n          }, t.prototype.hasMesh = function(e) {\n            return !!r.prototype.hasMesh.call(this, e) && (this._includedOnlyMeshes.length ? this._includedOnlyMeshes.indexOf(e.uniqueId) !== -1 : !this._excludedMeshes.length || this._excludedMeshes.indexOf(e.uniqueId) === -1);\n          }, t.prototype._useMeshMaterial = function(e) {\n            return this._meshesUsingTheirOwnMaterials.length != 0 && this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId) > -1;\n          }, t.prototype.referenceMeshToUseItsOwnMaterial = function(e) {\n            this._meshesUsingTheirOwnMaterials.push(e.uniqueId);\n          }, t.prototype.unReferenceMeshFromUsingItsOwnMaterial = function(e) {\n            for (var n = this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId); n >= 0; )\n              this._meshesUsingTheirOwnMaterials.splice(n, 1), n = this._meshesUsingTheirOwnMaterials.indexOf(e.uniqueId);\n          }, t.prototype._disposeMesh = function(e) {\n            this.removeIncludedOnlyMesh(e), this.removeExcludedMesh(e);\n          }, t.prototype.getClassName = function() {\n            return \"GlowLayer\";\n          }, t.prototype.serialize = function() {\n            var e, n = L.a.Serialize(this);\n            if (n.customType = \"BABYLON.GlowLayer\", n.includedMeshes = [], this._includedOnlyMeshes.length)\n              for (e = 0; e < this._includedOnlyMeshes.length; e++)\n                (i = this._scene.getMeshByUniqueID(this._includedOnlyMeshes[e])) && n.includedMeshes.push(i.id);\n            if (n.excludedMeshes = [], this._excludedMeshes.length)\n              for (e = 0; e < this._excludedMeshes.length; e++) {\n                var i;\n                (i = this._scene.getMeshByUniqueID(this._excludedMeshes[e])) && n.excludedMeshes.push(i.id);\n              }\n            return n;\n          }, t.Parse = function(e, n, i) {\n            var o, a = L.a.Parse(function() {\n              return new t(e.name, n, e.options);\n            }, e, n, i);\n            for (o = 0; o < e.excludedMeshes.length; o++)\n              (s = n.getMeshByID(e.excludedMeshes[o])) && a.addExcludedMesh(s);\n            for (o = 0; o < e.includedMeshes.length; o++) {\n              var s;\n              (s = n.getMeshByID(e.includedMeshes[o])) && a.addIncludedOnlyMesh(s);\n            }\n            return a;\n          }, t.EffectName = \"GlowLayer\", t.DefaultBlurKernelSize = 32, t.DefaultTextureRatio = 0.5, Object(c.c)([Object(L.c)()], t.prototype, \"blurKernelSize\", null), Object(c.c)([Object(L.c)()], t.prototype, \"intensity\", null), Object(c.c)([Object(L.c)(\"options\")], t.prototype, \"_options\", void 0), t;\n        }(no);\n        O.a.RegisteredTypes[\"BABYLON.GlowLayer\"] = Ko;\n        var r_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nuniform vec2 direction;\nuniform float blurWidth;\n\nfloat getLuminance(vec3 color)\n{\nreturn dot(color,vec3(0.2126,0.7152,0.0722));\n}\nvoid main(void)\n{\nfloat weights[7];\nweights[0]=0.05;\nweights[1]=0.1;\nweights[2]=0.2;\nweights[3]=0.3;\nweights[4]=0.2;\nweights[5]=0.1;\nweights[6]=0.05;\nvec2 texelSize=vec2(1.0/screenSize.x,1.0/screenSize.y);\nvec2 texelStep=texelSize*direction*blurWidth;\nvec2 start=vUV-3.0*texelStep;\nvec4 baseColor=vec4(0.,0.,0.,0.);\nvec2 texelOffset=vec2(0.,0.);\nfor (int i=0; i<7; i++)\n{\n\nvec4 texel=texture2D(textureSampler,start+texelOffset);\nbaseColor.a+=texel.a*weights[i];\n\nfloat luminance=getLuminance(baseColor.rgb);\nfloat luminanceTexel=getLuminance(texel.rgb);\nfloat choice=step(luminanceTexel,luminance);\nbaseColor.rgb=choice*baseColor.rgb+(1.0-choice)*texel.rgb;\ntexelOffset+=texelStep;\n}\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.glowBlurPostProcessPixelShader = r_, V.a.prototype.getHighlightLayerByName = function(r) {\n          for (var t = 0; t < this.effectLayers.length; t++)\n            if (this.effectLayers[t].name === r && this.effectLayers[t].getEffectName() === Ms.EffectName)\n              return this.effectLayers[t];\n          return null;\n        };\n        var fu = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE);\n            var y = r.call(this, e, \"glowBlurPostProcess\", [\"screenSize\", \"direction\", \"blurWidth\"], null, o, a, s, d, p) || this;\n            return y.direction = n, y.kernel = i, y.onApplyObservable.add(function(P) {\n              P.setFloat2(\"screenSize\", y.width, y.height), P.setVector2(\"direction\", y.direction), P.setFloat(\"blurWidth\", y.kernel);\n            }), y;\n          }\n          return Object(c.d)(t, r), t;\n        }(ft), Ms = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, n) || this;\n            return o.name = e, o.innerGlow = !0, o.outerGlow = !0, o.onBeforeBlurObservable = new C.c(), o.onAfterBlurObservable = new C.c(), o._instanceGlowingMeshStencilReference = t.GlowingMeshStencilReference++, o._meshes = {}, o._excludedMeshes = {}, o.neutralColor = t.NeutralColor, o._engine.isStencilEnable || l.a.Warn(\"Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }\"), o._options = Object(c.a)({ mainTextureRatio: 0.5, blurTextureSizeRatio: 0.5, blurHorizontalSize: 1, blurVerticalSize: 1, alphaBlendingMode: h.a.ALPHA_COMBINE, camera: null, renderingGroupId: -1 }, i), o._init({ alphaBlendingMode: o._options.alphaBlendingMode, camera: o._options.camera, mainTextureFixedSize: o._options.mainTextureFixedSize, mainTextureRatio: o._options.mainTextureRatio, renderingGroupId: o._options.renderingGroupId }), o._shouldRender = !1, o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"blurHorizontalSize\", { get: function() {\n            return this._horizontalBlurPostprocess.kernel;\n          }, set: function(e) {\n            this._horizontalBlurPostprocess.kernel = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurVerticalSize\", { get: function() {\n            return this._verticalBlurPostprocess.kernel;\n          }, set: function(e) {\n            this._verticalBlurPostprocess.kernel = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getEffectName = function() {\n            return t.EffectName;\n          }, t.prototype._createMergeEffect = function() {\n            return this._engine.createEffect(\"glowMapMerge\", [Oe.b.PositionKind], [\"offset\"], [\"textureSampler\"], this._options.isStroke ? `#define STROKE \n` : void 0);\n          }, t.prototype._createTextureAndPostProcesses = function() {\n            var e = this, n = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio, i = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;\n            n = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(n, this._maxSize) : n, i = this._engine.needPOTTextures ? Ue.a.GetExponentOfTwo(i, this._maxSize) : i;\n            var o = 0;\n            o = this._engine.getCaps().textureHalfFloatRender ? h.a.TEXTURETYPE_HALF_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INT, this._blurTexture = new on(\"HighlightLayerBlurRTT\", { width: n, height: i }, this._scene, !1, !0, o), this._blurTexture.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._blurTexture.anisotropicFilteringLevel = 16, this._blurTexture.updateSamplingMode(Ne.a.TRILINEAR_SAMPLINGMODE), this._blurTexture.renderParticles = !1, this._blurTexture.ignoreCameraViewport = !0, this._textures = [this._blurTexture], this._options.alphaBlendingMode === h.a.ALPHA_COMBINE ? (this._downSamplePostprocess = new Ri(\"HighlightLayerPPP\", this._options.blurTextureSizeRatio, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._downSamplePostprocess.onApplyObservable.add(function(a) {\n              a.setTexture(\"textureSampler\", e._mainTexture);\n            }), this._horizontalBlurPostprocess = new fu(\"HighlightLayerHBP\", new u.d(1, 0), this._options.blurHorizontalSize, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._horizontalBlurPostprocess.onApplyObservable.add(function(a) {\n              a.setFloat2(\"screenSize\", n, i);\n            }), this._verticalBlurPostprocess = new fu(\"HighlightLayerVBP\", new u.d(0, 1), this._options.blurVerticalSize, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine()), this._verticalBlurPostprocess.onApplyObservable.add(function(a) {\n              a.setFloat2(\"screenSize\", n, i);\n            }), this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess]) : (this._horizontalBlurPostprocess = new _n(\"HighlightLayerHBP\", new u.d(1, 0), this._options.blurHorizontalSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._horizontalBlurPostprocess.width = n, this._horizontalBlurPostprocess.height = i, this._horizontalBlurPostprocess.onApplyObservable.add(function(a) {\n              a.setTexture(\"textureSampler\", e._mainTexture);\n            }), this._verticalBlurPostprocess = new _n(\"HighlightLayerVBP\", new u.d(0, 1), this._options.blurVerticalSize / 2, { width: n, height: i }, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess]), this._mainTexture.onAfterUnbindObservable.add(function() {\n              e.onBeforeBlurObservable.notifyObservers(e);\n              var a = e._blurTexture.getInternalTexture();\n              a && (e._scene.postProcessManager.directRender(e._postProcesses, a, !0), e._engine.unBindFramebuffer(a, !0)), e.onAfterBlurObservable.notifyObservers(e);\n            }), this._postProcesses.map(function(a) {\n              a.autoClear = !1;\n            });\n          }, t.prototype.needStencil = function() {\n            return !0;\n          }, t.prototype.isReady = function(e, n) {\n            var i = e.getMaterial(), o = e.getRenderingMesh();\n            if (!i || !o || !this._meshes)\n              return !1;\n            var a = null, s = this._meshes[o.uniqueId];\n            return s && s.glowEmissiveOnly && i && (a = i.emissiveTexture), r.prototype._isReady.call(this, e, n, a);\n          }, t.prototype._internalRender = function(e) {\n            e.setTexture(\"textureSampler\", this._blurTexture);\n            var n = this._engine;\n            n.cacheStencilState(), n.setStencilOperationPass(h.a.REPLACE), n.setStencilOperationFail(h.a.KEEP), n.setStencilOperationDepthFail(h.a.KEEP), n.setStencilMask(0), n.setStencilBuffer(!0), n.setStencilFunctionReference(this._instanceGlowingMeshStencilReference), this.outerGlow && (e.setFloat(\"offset\", 0), n.setStencilFunction(h.a.NOTEQUAL), n.drawElementsType(zt.a.TriangleFillMode, 0, 6)), this.innerGlow && (e.setFloat(\"offset\", 1), n.setStencilFunction(h.a.EQUAL), n.drawElementsType(zt.a.TriangleFillMode, 0, 6)), n.restoreStencilState();\n          }, t.prototype.shouldRender = function() {\n            return !!r.prototype.shouldRender.call(this) && !!this._meshes;\n          }, t.prototype._shouldRenderMesh = function(e) {\n            return (!this._excludedMeshes || !this._excludedMeshes[e.uniqueId]) && !!r.prototype.hasMesh.call(this, e);\n          }, t.prototype._canRenderMesh = function(e, n) {\n            return !0;\n          }, t.prototype._addCustomEffectDefines = function(e) {\n            e.push(\"#define HIGHLIGHT\");\n          }, t.prototype._setEmissiveTextureAndColor = function(e, n, i) {\n            var o = this._meshes[e.uniqueId];\n            o ? this._emissiveTextureAndColor.color.set(o.color.r, o.color.g, o.color.b, 1) : this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a), o && o.glowEmissiveOnly && i ? (this._emissiveTextureAndColor.texture = i.emissiveTexture, this._emissiveTextureAndColor.color.set(1, 1, 1, 1)) : this._emissiveTextureAndColor.texture = null;\n          }, t.prototype.addExcludedMesh = function(e) {\n            this._excludedMeshes && (this._excludedMeshes[e.uniqueId] || (this._excludedMeshes[e.uniqueId] = { mesh: e, beforeBind: e.onBeforeBindObservable.add(function(n) {\n              n.getEngine().setStencilBuffer(!1);\n            }), afterRender: e.onAfterRenderObservable.add(function(n) {\n              n.getEngine().setStencilBuffer(!0);\n            }) }));\n          }, t.prototype.removeExcludedMesh = function(e) {\n            if (this._excludedMeshes) {\n              var n = this._excludedMeshes[e.uniqueId];\n              n && (n.beforeBind && e.onBeforeBindObservable.remove(n.beforeBind), n.afterRender && e.onAfterRenderObservable.remove(n.afterRender)), this._excludedMeshes[e.uniqueId] = null;\n            }\n          }, t.prototype.hasMesh = function(e) {\n            return !!this._meshes && !!r.prototype.hasMesh.call(this, e) && this._meshes[e.uniqueId] !== void 0 && this._meshes[e.uniqueId] !== null;\n          }, t.prototype.addMesh = function(e, n, i) {\n            var o = this;\n            if (i === void 0 && (i = !1), this._meshes) {\n              var a = this._meshes[e.uniqueId];\n              a ? a.color = n : (this._meshes[e.uniqueId] = { mesh: e, color: n, observerHighlight: e.onBeforeBindObservable.add(function(s) {\n                o.isEnabled && (o._excludedMeshes && o._excludedMeshes[s.uniqueId] ? o._defaultStencilReference(s) : s.getScene().getEngine().setStencilFunctionReference(o._instanceGlowingMeshStencilReference));\n              }), observerDefault: e.onAfterRenderObservable.add(function(s) {\n                o.isEnabled && o._defaultStencilReference(s);\n              }), glowEmissiveOnly: i }, e.onDisposeObservable.add(function() {\n                o._disposeMesh(e);\n              })), this._shouldRender = !0;\n            }\n          }, t.prototype.removeMesh = function(e) {\n            if (this._meshes) {\n              var n = this._meshes[e.uniqueId];\n              for (var i in n && (n.observerHighlight && e.onBeforeBindObservable.remove(n.observerHighlight), n.observerDefault && e.onAfterRenderObservable.remove(n.observerDefault), delete this._meshes[e.uniqueId]), this._shouldRender = !1, this._meshes)\n                if (this._meshes[i]) {\n                  this._shouldRender = !0;\n                  break;\n                }\n            }\n          }, t.prototype.removeAllMeshes = function() {\n            if (this._meshes) {\n              for (var e in this._meshes)\n                if (this._meshes.hasOwnProperty(e)) {\n                  var n = this._meshes[e];\n                  n && this.removeMesh(n.mesh);\n                }\n            }\n          }, t.prototype._defaultStencilReference = function(e) {\n            e.getScene().getEngine().setStencilFunctionReference(t.NormalMeshStencilReference);\n          }, t.prototype._disposeMesh = function(e) {\n            this.removeMesh(e), this.removeExcludedMesh(e);\n          }, t.prototype.dispose = function() {\n            if (this._meshes) {\n              for (var e in this._meshes)\n                (n = this._meshes[e]) && n.mesh && (n.observerHighlight && n.mesh.onBeforeBindObservable.remove(n.observerHighlight), n.observerDefault && n.mesh.onAfterRenderObservable.remove(n.observerDefault));\n              this._meshes = null;\n            }\n            if (this._excludedMeshes) {\n              for (var e in this._excludedMeshes) {\n                var n;\n                (n = this._excludedMeshes[e]) && (n.beforeBind && n.mesh.onBeforeBindObservable.remove(n.beforeBind), n.afterRender && n.mesh.onAfterRenderObservable.remove(n.afterRender));\n              }\n              this._excludedMeshes = null;\n            }\n            r.prototype.dispose.call(this);\n          }, t.prototype.getClassName = function() {\n            return \"HighlightLayer\";\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            if (e.customType = \"BABYLON.HighlightLayer\", e.meshes = [], this._meshes)\n              for (var n in this._meshes) {\n                var i = this._meshes[n];\n                i && e.meshes.push({ glowEmissiveOnly: i.glowEmissiveOnly, color: i.color.asArray(), meshId: i.mesh.id });\n              }\n            if (e.excludedMeshes = [], this._excludedMeshes)\n              for (var o in this._excludedMeshes) {\n                var a = this._excludedMeshes[o];\n                a && e.excludedMeshes.push(a.mesh.id);\n              }\n            return e;\n          }, t.Parse = function(e, n, i) {\n            var o, a = L.a.Parse(function() {\n              return new t(e.name, n, e.options);\n            }, e, n, i);\n            for (o = 0; o < e.excludedMeshes.length; o++)\n              (s = n.getMeshByID(e.excludedMeshes[o])) && a.addExcludedMesh(s);\n            for (o = 0; o < e.meshes.length; o++) {\n              var s, d = e.meshes[o];\n              (s = n.getMeshByID(d.meshId)) && a.addMesh(s, I.a.FromArray(d.color), d.glowEmissiveOnly);\n            }\n            return a;\n          }, t.EffectName = \"HighlightLayer\", t.NeutralColor = new I.b(0, 0, 0, 0), t.GlowingMeshStencilReference = 2, t.NormalMeshStencilReference = 1, Object(c.c)([Object(L.c)()], t.prototype, \"innerGlow\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"outerGlow\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"blurHorizontalSize\", null), Object(c.c)([Object(L.c)()], t.prototype, \"blurVerticalSize\", null), Object(c.c)([Object(L.c)(\"options\")], t.prototype, \"_options\", void 0), t;\n        }(no);\n        O.a.RegisteredTypes[\"BABYLON.HighlightLayer\"] = Ms;\n        var pu = function() {\n          function r(t) {\n            this.name = ot.a.NAME_LAYER, this.scene = t, this._engine = t.getEngine(), t.layers = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraDrawStage.registerStep(ot.a.STEP_BEFORECAMERADRAW_LAYER, this, this._drawCameraBackground), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_LAYER, this, this._drawCameraForeground), this.scene._beforeRenderTargetDrawStage.registerStep(ot.a.STEP_BEFORERENDERTARGETDRAW_LAYER, this, this._drawRenderTargetBackground), this.scene._afterRenderTargetDrawStage.registerStep(ot.a.STEP_AFTERRENDERTARGETDRAW_LAYER, this, this._drawRenderTargetForeground);\n          }, r.prototype.rebuild = function() {\n            for (var t = 0, e = this.scene.layers; t < e.length; t++)\n              e[t]._rebuild();\n          }, r.prototype.dispose = function() {\n            for (var t = this.scene.layers; t.length; )\n              t[0].dispose();\n          }, r.prototype._draw = function(t) {\n            var e = this.scene.layers;\n            if (e.length) {\n              this._engine.setDepthBuffer(!1);\n              for (var n = 0, i = e; n < i.length; n++) {\n                var o = i[n];\n                t(o) && o.render();\n              }\n              this._engine.setDepthBuffer(!0);\n            }\n          }, r.prototype._drawCameraPredicate = function(t, e, n) {\n            return !t.renderOnlyInRenderTargetTextures && t.isBackground === e && (t.layerMask & n) != 0;\n          }, r.prototype._drawCameraBackground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawCameraPredicate(n, !0, t.layerMask);\n            });\n          }, r.prototype._drawCameraForeground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawCameraPredicate(n, !1, t.layerMask);\n            });\n          }, r.prototype._drawRenderTargetPredicate = function(t, e, n, i) {\n            return t.renderTargetTextures.length > 0 && t.isBackground === e && t.renderTargetTextures.indexOf(i) > -1 && (t.layerMask & n) != 0;\n          }, r.prototype._drawRenderTargetBackground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawRenderTargetPredicate(n, !0, e.scene.activeCamera.layerMask, t);\n            });\n          }, r.prototype._drawRenderTargetForeground = function(t) {\n            var e = this;\n            this._draw(function(n) {\n              return e._drawRenderTargetPredicate(n, !1, e.scene.activeCamera.layerMask, t);\n            });\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.layers && t.layers.forEach(function(n) {\n              e.scene.layers.push(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            e === void 0 && (e = !1), t.layers && t.layers.forEach(function(i) {\n              var o = n.scene.layers.indexOf(i);\n              o !== -1 && n.scene.layers.splice(o, 1), e && i.dispose();\n            });\n          }, r;\n        }(), o_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\n\n#include<helperFunctions>\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\n#ifdef LINEAR\nbaseColor.rgb=toGammaSpace(baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=baseColor*color;\n}`;\n        ze.a.ShadersStore.layerPixelShader = o_;\n        var a_ = `\nattribute vec2 position;\n\nuniform vec2 scale;\nuniform vec2 offset;\nuniform mat4 textureMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvec2 shiftedPosition=position*scale+offset;\nvUV=vec2(textureMatrix*vec4(shiftedPosition*madd+madd,1.0,0.0));\ngl_Position=vec4(shiftedPosition,0.0,1.0);\n}`;\n        ze.a.ShadersStore.layerVertexShader = a_;\n        var s_ = function() {\n          function r(t, e, n, i, o) {\n            this.name = t, this.scale = new u.d(1, 1), this.offset = new u.d(0, 0), this.alphaBlendingMode = h.a.ALPHA_COMBINE, this.layerMask = 268435455, this.renderTargetTextures = [], this.renderOnlyInRenderTargetTextures = !1, this._vertexBuffers = {}, this.onDisposeObservable = new C.c(), this.onBeforeRenderObservable = new C.c(), this.onAfterRenderObservable = new C.c(), this.texture = e ? new Ne.a(e, n, !0) : null, this.isBackground = i === void 0 || i, this.color = o === void 0 ? new I.b(1, 1, 1, 1) : o, this._scene = n || te.a.LastCreatedScene;\n            var a = this._scene._getComponent(ot.a.NAME_LAYER);\n            a || (a = new pu(this._scene), this._scene._addComponent(a)), this._scene.layers.push(this);\n            var s = this._scene.getEngine(), d = [];\n            d.push(1, 1), d.push(-1, 1), d.push(-1, -1), d.push(1, -1);\n            var p = new Oe.b(s, d, Oe.b.PositionKind, !1, !1, 2);\n            this._vertexBuffers[Oe.b.PositionKind] = p, this._createIndexBuffer();\n          }\n          return Object.defineProperty(r.prototype, \"onDispose\", { set: function(t) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onBeforeRender\", { set: function(t) {\n            this._onBeforeRenderObserver && this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver), this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"onAfterRender\", { set: function(t) {\n            this._onAfterRenderObserver && this.onAfterRenderObservable.remove(this._onAfterRenderObserver), this._onAfterRenderObserver = this.onAfterRenderObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._createIndexBuffer = function() {\n            var t = this._scene.getEngine(), e = [];\n            e.push(0), e.push(1), e.push(2), e.push(0), e.push(2), e.push(3), this._indexBuffer = t.createIndexBuffer(e);\n          }, r.prototype._rebuild = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && t._rebuild(), this._createIndexBuffer();\n          }, r.prototype.render = function() {\n            var t = this._scene.getEngine(), e = \"\";\n            this.alphaTest && (e = \"#define ALPHATEST\"), this.texture && !this.texture.gammaSpace && (e += `\\r\n#define LINEAR`), this._previousDefines !== e && (this._previousDefines = e, this._effect = t.createEffect(\"layer\", [Oe.b.PositionKind], [\"textureMatrix\", \"color\", \"scale\", \"offset\"], [\"textureSampler\"], e));\n            var n = this._effect;\n            n && n.isReady() && this.texture && this.texture.isReady() && (t = this._scene.getEngine(), this.onBeforeRenderObservable.notifyObservers(this), t.enableEffect(n), t.setState(!1), n.setTexture(\"textureSampler\", this.texture), n.setMatrix(\"textureMatrix\", this.texture.getTextureMatrix()), n.setFloat4(\"color\", this.color.r, this.color.g, this.color.b, this.color.a), n.setVector2(\"offset\", this.offset), n.setVector2(\"scale\", this.scale), t.bindBuffers(this._vertexBuffers, this._indexBuffer, n), this.alphaTest ? t.drawElementsType(zt.a.TriangleFillMode, 0, 6) : (t.setAlphaMode(this.alphaBlendingMode), t.drawElementsType(zt.a.TriangleFillMode, 0, 6), t.setAlphaMode(h.a.ALPHA_DISABLE)), this.onAfterRenderObservable.notifyObservers(this));\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this.texture && (this.texture.dispose(), this.texture = null), this.renderTargetTextures = [];\n            var e = this._scene.layers.indexOf(this);\n            this._scene.layers.splice(e, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onAfterRenderObservable.clear(), this.onBeforeRenderObservable.clear();\n          }, r;\n        }(), _u = function() {\n          function r(t, e, n, i, o) {\n            this.size = t, this.position = e, this.alphaMode = h.a.ALPHA_ONEONE, this.color = n || new I.a(1, 1, 1), this.texture = i ? new Ne.a(i, o.getScene(), !0) : null, this._system = o, o.lensFlares.push(this);\n          }\n          return r.AddFlare = function(t, e, n, i, o) {\n            return new r(t, e, n, i, o);\n          }, r.prototype.dispose = function() {\n            this.texture && this.texture.dispose();\n            var t = this._system.lensFlares.indexOf(this);\n            this._system.lensFlares.splice(t, 1);\n          }, r;\n        }(), c_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec4 color;\nvoid main(void) {\nvec4 baseColor=texture2D(textureSampler,vUV);\ngl_FragColor=baseColor*color;\n}`;\n        ze.a.ShadersStore.lensFlarePixelShader = c_;\n        var l_ = `\nattribute vec2 position;\n\nuniform mat4 viewportMatrix;\n\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=position*madd+madd;\ngl_Position=viewportMatrix*vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.lensFlareVertexShader = l_;\n        var Is = function() {\n          function r(t, e, n) {\n            this.name = t, this.lensFlares = new Array(), this.borderLimit = 300, this.viewportBorder = 0, this.layerMask = 268435455, this._vertexBuffers = {}, this._isEnabled = !0, this._scene = n || te.a.LastCreatedScene, r._SceneComponentInitialization(this._scene), this._emitter = e, this.id = t, n.lensFlareSystems.push(this), this.meshesSelectionPredicate = function(s) {\n              return n.activeCamera && s.material && s.isVisible && s.isEnabled() && s.isBlocker && (s.layerMask & n.activeCamera.layerMask) != 0;\n            };\n            var i = n.getEngine(), o = [];\n            o.push(1, 1), o.push(-1, 1), o.push(-1, -1), o.push(1, -1), this._vertexBuffers[Oe.b.PositionKind] = new Oe.b(i, o, Oe.b.PositionKind, !1, !1, 2);\n            var a = [];\n            a.push(0), a.push(1), a.push(2), a.push(0), a.push(2), a.push(3), this._indexBuffer = i.createIndexBuffer(a), this._effect = i.createEffect(\"lensFlare\", [Oe.b.PositionKind], [\"color\", \"viewportMatrix\"], [\"textureSampler\"], \"\");\n          }\n          return Object.defineProperty(r.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(t) {\n            this._isEnabled = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getScene = function() {\n            return this._scene;\n          }, r.prototype.getEmitter = function() {\n            return this._emitter;\n          }, r.prototype.setEmitter = function(t) {\n            this._emitter = t;\n          }, r.prototype.getEmitterPosition = function() {\n            return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;\n          }, r.prototype.computeEffectivePosition = function(t) {\n            var e = this.getEmitterPosition();\n            return e = u.e.Project(e, u.a.Identity(), this._scene.getTransformMatrix(), t), this._positionX = e.x, this._positionY = e.y, e = u.e.TransformCoordinates(this.getEmitterPosition(), this._scene.getViewMatrix()), this.viewportBorder > 0 && (t.x -= this.viewportBorder, t.y -= this.viewportBorder, t.width += 2 * this.viewportBorder, t.height += 2 * this.viewportBorder, e.x += this.viewportBorder, e.y += this.viewportBorder, this._positionX += this.viewportBorder, this._positionY += this.viewportBorder), e.z > 0 && (this._positionX > t.x && this._positionX < t.x + t.width && this._positionY > t.y && (this._positionY, t.y, t.height), !0);\n          }, r.prototype._isVisible = function() {\n            if (!this._isEnabled || !this._scene.activeCamera)\n              return !1;\n            var t = this.getEmitterPosition().subtract(this._scene.activeCamera.globalPosition), e = t.length();\n            t.normalize();\n            var n = new dn.a(this._scene.activeCamera.globalPosition, t), i = this._scene.pickWithRay(n, this.meshesSelectionPredicate, !0);\n            return !i || !i.hit || i.distance > e;\n          }, r.prototype.render = function() {\n            if (!this._effect.isReady() || !this._scene.activeCamera)\n              return !1;\n            var t, e, n = this._scene.getEngine(), i = this._scene.activeCamera.viewport.toGlobal(n.getRenderWidth(!0), n.getRenderHeight(!0));\n            if (!this.computeEffectivePosition(i) || !this._isVisible())\n              return !1;\n            var o = (t = this._positionX < this.borderLimit + i.x ? this.borderLimit + i.x - this._positionX : this._positionX > i.x + i.width - this.borderLimit ? this._positionX - i.x - i.width + this.borderLimit : 0) > (e = this._positionY < this.borderLimit + i.y ? this.borderLimit + i.y - this._positionY : this._positionY > i.y + i.height - this.borderLimit ? this._positionY - i.y - i.height + this.borderLimit : 0) ? t : e;\n            (o -= this.viewportBorder) > this.borderLimit && (o = this.borderLimit);\n            var a = 1 - $.a.Clamp(o / this.borderLimit, 0, 1);\n            if (a < 0)\n              return !1;\n            a > 1 && (a = 1), this.viewportBorder > 0 && (i.x += this.viewportBorder, i.y += this.viewportBorder, i.width -= 2 * this.viewportBorder, i.height -= 2 * this.viewportBorder, this._positionX -= this.viewportBorder, this._positionY -= this.viewportBorder);\n            var s = i.x + i.width / 2, d = i.y + i.height / 2, p = s - this._positionX, y = d - this._positionY;\n            n.enableEffect(this._effect), n.setState(!1), n.setDepthBuffer(!1), n.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect);\n            for (var P = 0; P < this.lensFlares.length; P++) {\n              var R = this.lensFlares[P];\n              if (!R.texture || R.texture.isReady()) {\n                n.setAlphaMode(R.alphaMode);\n                var B = s - p * R.position, F = d - y * R.position, z = R.size, J = R.size * n.getAspectRatio(this._scene.activeCamera, !0), ie = B / (i.width + 2 * i.x) * 2 - 1, se = 1 - F / (i.height + 2 * i.y) * 2, ce = u.a.FromValues(z / 2, 0, 0, 0, 0, J / 2, 0, 0, 0, 0, 1, 0, ie, se, 0, 1);\n                this._effect.setMatrix(\"viewportMatrix\", ce), this._effect.setTexture(\"textureSampler\", R.texture), this._effect.setFloat4(\"color\", R.color.r * a, R.color.g * a, R.color.b * a, 1), n.drawElementsType(zt.a.TriangleFillMode, 0, 6);\n              }\n            }\n            return n.setDepthBuffer(!0), n.setAlphaMode(h.a.ALPHA_DISABLE), !0;\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            for (t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && (this._scene.getEngine()._releaseBuffer(this._indexBuffer), this._indexBuffer = null); this.lensFlares.length; )\n              this.lensFlares[0].dispose();\n            var e = this._scene.lensFlareSystems.indexOf(this);\n            this._scene.lensFlareSystems.splice(e, 1);\n          }, r.Parse = function(t, e, n) {\n            var i = e.getLastEntryByID(t.emitterId), o = t.name || \"lensFlareSystem#\" + t.emitterId, a = new r(o, i, e);\n            a.id = t.id || o, a.borderLimit = t.borderLimit;\n            for (var s = 0; s < t.flares.length; s++) {\n              var d = t.flares[s];\n              _u.AddFlare(d.size, d.position, I.a.FromArray(d.color), d.textureName ? n + d.textureName : \"\", a);\n            }\n            return a;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.id = this.id, t.name = this.name, t.emitterId = this.getEmitter().id, t.borderLimit = this.borderLimit, t.flares = [];\n            for (var e = 0; e < this.lensFlares.length; e++) {\n              var n = this.lensFlares[e];\n              t.flares.push({ size: n.size, position: n.position, color: n.color.asArray(), textureName: Xe.b.GetFilename(n.texture ? n.texture.name : \"\") });\n            }\n            return t;\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"LensFlareSystemSceneComponent\");\n          }, r;\n        }();\n        V.a.AddParser(ot.a.NAME_LENSFLARESYSTEM, function(r, t, e, n) {\n          if (r.lensFlareSystems !== void 0 && r.lensFlareSystems !== null) {\n            e.lensFlareSystems || (e.lensFlareSystems = new Array());\n            for (var i = 0, o = r.lensFlareSystems.length; i < o; i++) {\n              var a = r.lensFlareSystems[i], s = Is.Parse(a, t, n);\n              e.lensFlareSystems.push(s);\n            }\n          }\n        }), V.a.prototype.getLensFlareSystemByName = function(r) {\n          for (var t = 0; t < this.lensFlareSystems.length; t++)\n            if (this.lensFlareSystems[t].name === r)\n              return this.lensFlareSystems[t];\n          return null;\n        }, V.a.prototype.getLensFlareSystemByID = function(r) {\n          for (var t = 0; t < this.lensFlareSystems.length; t++)\n            if (this.lensFlareSystems[t].id === r)\n              return this.lensFlareSystems[t];\n          return null;\n        }, V.a.prototype.removeLensFlareSystem = function(r) {\n          var t = this.lensFlareSystems.indexOf(r);\n          return t !== -1 && this.lensFlareSystems.splice(t, 1), t;\n        }, V.a.prototype.addLensFlareSystem = function(r) {\n          this.lensFlareSystems.push(r);\n        };\n        var mu = function() {\n          function r(t) {\n            this.name = ot.a.NAME_LENSFLARESYSTEM, this.scene = t, t.lensFlareSystems = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_LENSFLARESYSTEM, this, this._draw);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.addFromContainer = function(t) {\n            var e = this;\n            t.lensFlareSystems && t.lensFlareSystems.forEach(function(n) {\n              e.scene.addLensFlareSystem(n);\n            });\n          }, r.prototype.removeFromContainer = function(t, e) {\n            var n = this;\n            t.lensFlareSystems && t.lensFlareSystems.forEach(function(i) {\n              n.scene.removeLensFlareSystem(i), e && i.dispose();\n            });\n          }, r.prototype.serialize = function(t) {\n            t.lensFlareSystems = [];\n            for (var e = 0, n = this.scene.lensFlareSystems; e < n.length; e++) {\n              var i = n[e];\n              t.lensFlareSystems.push(i.serialize());\n            }\n          }, r.prototype.dispose = function() {\n            for (var t = this.scene.lensFlareSystems; t.length; )\n              t[0].dispose();\n          }, r.prototype._draw = function(t) {\n            if (this.scene.lensFlaresEnabled) {\n              var e = this.scene.lensFlareSystems;\n              Xe.b.StartPerformanceCounter(\"Lens flares\", e.length > 0);\n              for (var n = 0, i = e; n < i.length; n++) {\n                var o = i[n];\n                t.layerMask & o.layerMask && o.render();\n              }\n              Xe.b.EndPerformanceCounter(\"Lens flares\", e.length > 0);\n            }\n          }, r;\n        }();\n        Is._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_LENSFLARESYSTEM);\n          t || (t = new mu(r), r._addComponent(t));\n        };\n        var u_ = `\n\n\n\n\nfloat bayerDither2(vec2 _P) {\nreturn mod(2.0*_P.y+_P.x+1.0,4.0);\n}\n\n\nfloat bayerDither4(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nreturn 4.0*bayerDither2(P1)+bayerDither2(P2);\n}\n\nfloat bayerDither8(vec2 _P) {\nvec2 P1=mod(_P,2.0);\nvec2 P2=floor(0.5*mod(_P,4.0));\nvec2 P4=floor(0.25*mod(_P,8.0));\nreturn 4.0*(4.0*bayerDither2(P1)+bayerDither2(P2))+bayerDither2(P4);\n}\n`;\n        ze.a.IncludesShadersStore.bayerDitherFunctions = u_;\n        var h_ = `#if SM_FLOAT == 0\n#include<packingFunctions>\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#include<bayerDitherFunctions>\nuniform float softTransparentShadowSM;\n#endif\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nuniform vec3 lightDataSM;\nvarying vec3 vPositionWSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapFragmentDeclaration = h_;\n        var d_ = ` float depthSM=vDepthMetricSM;\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\n#if SM_USEDISTANCE == 1\ndepthSM=clamp(((length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#else\ndepthSM=clamp(((zSM+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x,0.0,1.0);\n#endif\ngl_FragDepth=depthSM;\n#elif SM_USEDISTANCE == 1\ndepthSM=(length(vPositionWSM-lightDataSM)+depthValuesSM.x)/(depthValuesSM.y)+biasAndScaleSM.x;\n#endif\n#if SM_ESM == 1\ndepthSM=clamp(exp(-min(87.,biasAndScaleSM.z*depthSM)),0.,1.);\n#endif\n#if SM_FLOAT == 1\ngl_FragColor=vec4(depthSM,1.0,1.0,1.0);\n#else\ngl_FragColor=pack(depthSM);\n#endif\nreturn;`;\n        ze.a.IncludesShadersStore.shadowMapFragment = d_;\n        var f_ = `#include<shadowMapFragmentDeclaration>\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void)\n{\n#include<clipPlaneFragment>\n#ifdef ALPHATEST\nfloat alphaFromAlphaTexture=texture2D(diffuseSampler,vUV).a;\nif (alphaFromAlphaTexture<0.4)\ndiscard;\n#endif\n#if SM_SOFTTRANSPARENTSHADOW == 1\n#ifdef ALPHATEST\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alphaFromAlphaTexture) discard;\n#else\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM) discard;\n#endif\n#endif\n#include<shadowMapFragment>\n}`;\n        ze.a.ShadersStore.shadowMapPixelShader = f_;\n        var p_ = `#if SM_NORMALBIAS == 1\nuniform vec3 lightDataSM;\n#endif\nuniform vec3 biasAndScaleSM;\nuniform vec2 depthValuesSM;\nvarying float vDepthMetricSM;\n#if SM_USEDISTANCE == 1\nvarying vec3 vPositionWSM;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nvarying float zSM;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapVertexDeclaration = p_;\n        var __ = `\n#if SM_NORMALBIAS == 1\n#if SM_DIRECTIONINLIGHTDATA == 1\nvec3 worldLightDirSM=normalize(-lightDataSM.xyz);\n#else\nvec3 directionToLightSM=lightDataSM.xyz-worldPos.xyz;\nvec3 worldLightDirSM=normalize(directionToLightSM);\n#endif\nfloat ndlSM=dot(vNormalW,worldLightDirSM);\nfloat sinNLSM=sqrt(1.0-ndlSM*ndlSM);\nfloat normalBiasSM=biasAndScaleSM.y*sinNLSM;\nworldPos.xyz-=vNormalW*normalBiasSM;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapVertexNormalBias = __;\n        var m_ = `#if SM_USEDISTANCE == 1\nvPositionWSM=worldPos.xyz;\n#endif\n#if SM_DEPTHTEXTURE == 1\n\ngl_Position.z+=biasAndScaleSM.x*gl_Position.w;\n#endif\n#if defined(SM_DEPTHCLAMP) && SM_DEPTHCLAMP == 1\nzSM=gl_Position.z;\ngl_Position.z=0.0;\n#elif SM_USEDISTANCE == 0\n\nvDepthMetricSM=((gl_Position.z+depthValuesSM.x)/(depthValuesSM.y))+biasAndScaleSM.x;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapVertexMetric = m_;\n        var g_ = `\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\n#include<helperFunctions>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<shadowMapVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#ifdef NORMAL\nvec3 normalUpdated=normal;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\n#ifdef NORMAL\nmat3 normWorldSM=mat3(finalWorld);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));\nvNormalW=normalize(normWorldSM*vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormWorldSM=transposeMat3(inverseMat3(normWorldSM));\n#endif\nvec3 vNormalW=normalize(normWorldSM*normalUpdated);\n#endif\n#endif\n#include<shadowMapVertexNormalBias>\n\ngl_Position=viewProjection*worldPos;\n#include<shadowMapVertexMetric>\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<clipPlaneVertex>\n}`;\n        ze.a.ShadersStore.shadowMapVertexShader = g_;\n        var v_ = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform vec2 screenSize;\nvoid main(void)\n{\nvec4 colorDepth=vec4(0.0);\nfor (int x=-OFFSET; x<=OFFSET; x++)\nfor (int y=-OFFSET; y<=OFFSET; y++)\ncolorDepth+=texture2D(textureSampler,vUV+vec2(x,y)/screenSize);\ngl_FragColor=(colorDepth/float((OFFSET*2+1)*(OFFSET*2+1)));\n}`;\n        ze.a.ShadersStore.depthBoxBlurPixelShader = v_;\n        var y_ = `#if SM_SOFTTRANSPARENTSHADOW == 1\nif ((bayerDither8(floor(mod(gl_FragCoord.xy,8.0))))/64.0>=softTransparentShadowSM*alpha) discard;\n#endif\n`;\n        ze.a.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow = y_;\n        var gu = new u.a(), vu = new u.a(), Fn = function() {\n          function r(t, e, n) {\n            this.onBeforeShadowMapRenderObservable = new C.c(), this.onAfterShadowMapRenderObservable = new C.c(), this.onBeforeShadowMapRenderMeshObservable = new C.c(), this.onAfterShadowMapRenderMeshObservable = new C.c(), this._bias = 5e-5, this._normalBias = 0, this._blurBoxOffset = 1, this._blurScale = 2, this._blurKernel = 1, this._useKernelBlur = !1, this._filter = r.FILTER_NONE, this._filteringQuality = r.QUALITY_HIGH, this._contactHardeningLightSizeUVRatio = 0.1, this._darkness = 0, this._transparencyShadow = !1, this.enableSoftTransparentShadow = !1, this.frustumEdgeFalloff = 0, this.forceBackFacesOnly = !1, this._lightDirection = u.e.Zero(), this._viewMatrix = u.a.Zero(), this._projectionMatrix = u.a.Zero(), this._transformMatrix = u.a.Zero(), this._cachedPosition = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cachedDirection = new u.e(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._currentFaceIndex = 0, this._currentFaceIndexCache = 0, this._defaultTextureMatrix = u.a.Identity(), this._mapSize = t, this._light = e, this._scene = e.getScene(), e._shadowGenerator = this, this.id = e.id, r._SceneComponentInitialization(this._scene);\n            var i = this._scene.getEngine().getCaps();\n            n ? i.textureFloatRender && i.textureFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_FLOAT : i.textureHalfFloatRender && i.textureHalfFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_HALF_FLOAT : this._textureType = h.a.TEXTURETYPE_UNSIGNED_INT : i.textureHalfFloatRender && i.textureHalfFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_HALF_FLOAT : i.textureFloatRender && i.textureFloatLinearFiltering ? this._textureType = h.a.TEXTURETYPE_FLOAT : this._textureType = h.a.TEXTURETYPE_UNSIGNED_INT, this._initializeGenerator(), this._applyFilterValues();\n          }\n          return Object.defineProperty(r.prototype, \"bias\", { get: function() {\n            return this._bias;\n          }, set: function(t) {\n            this._bias = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"normalBias\", { get: function() {\n            return this._normalBias;\n          }, set: function(t) {\n            this._normalBias = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blurBoxOffset\", { get: function() {\n            return this._blurBoxOffset;\n          }, set: function(t) {\n            this._blurBoxOffset !== t && (this._blurBoxOffset = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blurScale\", { get: function() {\n            return this._blurScale;\n          }, set: function(t) {\n            this._blurScale !== t && (this._blurScale = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blurKernel\", { get: function() {\n            return this._blurKernel;\n          }, set: function(t) {\n            this._blurKernel !== t && (this._blurKernel = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useKernelBlur\", { get: function() {\n            return this._useKernelBlur;\n          }, set: function(t) {\n            this._useKernelBlur !== t && (this._useKernelBlur = t, this._disposeBlurPostProcesses());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"depthScale\", { get: function() {\n            return this._depthScale !== void 0 ? this._depthScale : this._light.getDepthScale();\n          }, set: function(t) {\n            this._depthScale = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype._validateFilter = function(t) {\n            return t;\n          }, Object.defineProperty(r.prototype, \"filter\", { get: function() {\n            return this._filter;\n          }, set: function(t) {\n            if (t = this._validateFilter(t), this._light.needCube()) {\n              if (t === r.FILTER_BLUREXPONENTIALSHADOWMAP)\n                return void (this.useExponentialShadowMap = !0);\n              if (t === r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)\n                return void (this.useCloseExponentialShadowMap = !0);\n              if (t === r.FILTER_PCF || t === r.FILTER_PCSS)\n                return void (this.usePoissonSampling = !0);\n            }\n            t !== r.FILTER_PCF && t !== r.FILTER_PCSS || this._scene.getEngine().webGLVersion !== 1 ? this._filter !== t && (this._filter = t, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty()) : this.usePoissonSampling = !0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"usePoissonSampling\", { get: function() {\n            return this.filter === r.FILTER_POISSONSAMPLING;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_POISSONSAMPLING);\n            (t || this.filter === r.FILTER_POISSONSAMPLING) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_EXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_EXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_EXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useBlurExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_BLUREXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_BLUREXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_BLUREXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useCloseExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_CLOSEEXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_CLOSEEXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_CLOSEEXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useBlurCloseExponentialShadowMap\", { get: function() {\n            return this.filter === r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP);\n            (t || this.filter === r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"usePercentageCloserFiltering\", { get: function() {\n            return this.filter === r.FILTER_PCF;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_PCF);\n            (t || this.filter === r.FILTER_PCF) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"filteringQuality\", { get: function() {\n            return this._filteringQuality;\n          }, set: function(t) {\n            this._filteringQuality !== t && (this._filteringQuality = t, this._disposeBlurPostProcesses(), this._applyFilterValues(), this._light._markMeshesAsLightDirty());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useContactHardeningShadow\", { get: function() {\n            return this.filter === r.FILTER_PCSS;\n          }, set: function(t) {\n            var e = this._validateFilter(r.FILTER_PCSS);\n            (t || this.filter === r.FILTER_PCSS) && (this.filter = t ? e : r.FILTER_NONE);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"contactHardeningLightSizeUVRatio\", { get: function() {\n            return this._contactHardeningLightSizeUVRatio;\n          }, set: function(t) {\n            this._contactHardeningLightSizeUVRatio = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"darkness\", { get: function() {\n            return this._darkness;\n          }, set: function(t) {\n            this.setDarkness(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.getDarkness = function() {\n            return this._darkness;\n          }, r.prototype.setDarkness = function(t) {\n            return this._darkness = t >= 1 ? 1 : t <= 0 ? 0 : t, this;\n          }, Object.defineProperty(r.prototype, \"transparencyShadow\", { get: function() {\n            return this._transparencyShadow;\n          }, set: function(t) {\n            this.setTransparencyShadow(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype.setTransparencyShadow = function(t) {\n            return this._transparencyShadow = t, this;\n          }, r.prototype.getShadowMap = function() {\n            return this._shadowMap;\n          }, r.prototype.getShadowMapForRendering = function() {\n            return this._shadowMap2 ? this._shadowMap2 : this._shadowMap;\n          }, r.prototype.getClassName = function() {\n            return r.CLASSNAME;\n          }, r.prototype.addShadowCaster = function(t, e) {\n            var n;\n            return e === void 0 && (e = !0), this._shadowMap ? (this._shadowMap.renderList || (this._shadowMap.renderList = []), this._shadowMap.renderList.push(t), e && (n = this._shadowMap.renderList).push.apply(n, t.getChildMeshes()), this) : this;\n          }, r.prototype.removeShadowCaster = function(t, e) {\n            if (e === void 0 && (e = !0), !this._shadowMap || !this._shadowMap.renderList)\n              return this;\n            var n = this._shadowMap.renderList.indexOf(t);\n            if (n !== -1 && this._shadowMap.renderList.splice(n, 1), e)\n              for (var i = 0, o = t.getChildren(); i < o.length; i++) {\n                var a = o[i];\n                this.removeShadowCaster(a);\n              }\n            return this;\n          }, r.prototype.getLight = function() {\n            return this._light;\n          }, Object.defineProperty(r.prototype, \"mapSize\", { get: function() {\n            return this._mapSize;\n          }, set: function(t) {\n            this._mapSize = t, this._light._markMeshesAsLightDirty(), this.recreateShadowMap();\n          }, enumerable: !1, configurable: !0 }), r.prototype._initializeGenerator = function() {\n            this._light._markMeshesAsLightDirty(), this._initializeShadowMap();\n          }, r.prototype._createTargetRenderTexture = function() {\n            this._scene.getEngine().webGLVersion > 1 ? (this._shadowMap = new on(this._light.name + \"_shadowMap\", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube(), void 0, !1, !1), this._shadowMap.createDepthStencilTexture(h.a.LESS, !0)) : this._shadowMap = new on(this._light.name + \"_shadowMap\", this._mapSize, this._scene, !1, !0, this._textureType, this._light.needCube());\n          }, r.prototype._initializeShadowMap = function() {\n            var t = this;\n            if (this._createTargetRenderTexture(), this._shadowMap !== null) {\n              this._shadowMap.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap.anisotropicFilteringLevel = 1, this._shadowMap.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE), this._shadowMap.renderParticles = !1, this._shadowMap.ignoreCameraViewport = !0, this._storedUniqueId && (this._shadowMap.uniqueId = this._storedUniqueId), this._shadowMap.customRenderFunction = this._renderForShadowMap.bind(this), this._shadowMap.customIsReadyFunction = function(a, s) {\n                return !0;\n              };\n              var e = this._scene.getEngine();\n              this._shadowMap.onBeforeRenderObservable.add(function(a) {\n                if (t._currentFaceIndex = a, t._filter === r.FILTER_PCF && e.setColorWrite(!1), t._scene.getSceneUniformBuffer().useUbo) {\n                  var s = t._scene.getSceneUniformBuffer();\n                  s.updateMatrix(\"viewProjection\", t.getTransformMatrix()), s.updateMatrix(\"view\", t._viewMatrix), s.update();\n                }\n              }), this._shadowMap.onAfterUnbindObservable.add(function() {\n                if (t._scene.getSceneUniformBuffer().useUbo) {\n                  var a = t._scene.getSceneUniformBuffer();\n                  a.updateMatrix(\"viewProjection\", t._scene.getTransformMatrix()), a.updateMatrix(\"view\", t._scene.getViewMatrix()), a.update();\n                }\n                if (t._filter === r.FILTER_PCF && e.setColorWrite(!0), t.useBlurExponentialShadowMap || t.useBlurCloseExponentialShadowMap) {\n                  var s = t.getShadowMapForRendering();\n                  if (s) {\n                    var d = s.getInternalTexture();\n                    t._scene.postProcessManager.directRender(t._blurPostProcesses, d, !0), e.unBindFramebuffer(d, !0);\n                  }\n                }\n              });\n              var n = new I.b(0, 0, 0, 0), i = new I.b(1, 1, 1, 1);\n              this._shadowMap.onClearObservable.add(function(a) {\n                t._filter === r.FILTER_PCF ? a.clear(i, !1, !0, !1) : t.useExponentialShadowMap || t.useBlurExponentialShadowMap ? a.clear(n, !0, !0, !1) : a.clear(i, !0, !0, !1);\n              }), this._shadowMap.onResizeObservable.add(function(a) {\n                t._storedUniqueId = t._shadowMap.uniqueId, t._mapSize = a.getRenderSize(), t._light._markMeshesAsLightDirty(), t.recreateShadowMap();\n              });\n              for (var o = Hr.b.MIN_RENDERINGGROUPS; o < Hr.b.MAX_RENDERINGGROUPS; o++)\n                this._shadowMap.setRenderingAutoClearDepthStencil(o, !1);\n            }\n          }, r.prototype._initializeBlurRTTAndPostProcesses = function() {\n            var t = this, e = this._scene.getEngine(), n = this._mapSize / this.blurScale;\n            this.useKernelBlur && this.blurScale === 1 || (this._shadowMap2 = new on(this._light.name + \"_shadowMap2\", n, this._scene, !1, !0, this._textureType), this._shadowMap2.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap2.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._shadowMap2.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE)), this.useKernelBlur ? (this._kernelBlurXPostprocess = new _n(this._light.name + \"KernelBlurX\", new u.d(1, 0), this.blurKernel, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, this._textureType), this._kernelBlurXPostprocess.width = n, this._kernelBlurXPostprocess.height = n, this._kernelBlurXPostprocess.onApplyObservable.add(function(i) {\n              i.setTexture(\"textureSampler\", t._shadowMap);\n            }), this._kernelBlurYPostprocess = new _n(this._light.name + \"KernelBlurY\", new u.d(0, 1), this.blurKernel, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, this._textureType), this._kernelBlurXPostprocess.autoClear = !1, this._kernelBlurYPostprocess.autoClear = !1, this._textureType === h.a.TEXTURETYPE_UNSIGNED_INT && (this._kernelBlurXPostprocess.packedFloat = !0, this._kernelBlurYPostprocess.packedFloat = !0), this._blurPostProcesses = [this._kernelBlurXPostprocess, this._kernelBlurYPostprocess]) : (this._boxBlurPostprocess = new ft(this._light.name + \"DepthBoxBlur\", \"depthBoxBlur\", [\"screenSize\", \"boxOffset\"], [], 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e, !1, \"#define OFFSET \" + this._blurBoxOffset, this._textureType), this._boxBlurPostprocess.onApplyObservable.add(function(i) {\n              i.setFloat2(\"screenSize\", n, n), i.setTexture(\"textureSampler\", t._shadowMap);\n            }), this._boxBlurPostprocess.autoClear = !1, this._blurPostProcesses = [this._boxBlurPostprocess]);\n          }, r.prototype._renderForShadowMap = function(t, e, n, i) {\n            var o, a = this._scene.getEngine(), s = a.getColorWrite();\n            if (i.length) {\n              for (a.setColorWrite(!1), o = 0; o < i.length; o++)\n                this._renderSubMeshForShadowMap(i.data[o]);\n              a.setColorWrite(s);\n            }\n            for (o = 0; o < t.length; o++)\n              this._renderSubMeshForShadowMap(t.data[o]);\n            for (o = 0; o < e.length; o++)\n              this._renderSubMeshForShadowMap(e.data[o]);\n            if (this._transparencyShadow)\n              for (o = 0; o < n.length; o++)\n                this._renderSubMeshForShadowMap(n.data[o], !0);\n            else\n              for (o = 0; o < n.length; o++)\n                n.data[o].getEffectiveMesh()._internalAbstractMeshDataInfo._isActiveIntermediate = !1;\n          }, r.prototype._bindCustomEffectForRenderSubMeshForShadowMap = function(t, e, n, i) {\n            var o, a, s, d, p, y;\n            e.setMatrix((o = n == null ? void 0 : n.viewProjection) !== null && o !== void 0 ? o : \"viewProjection\", this.getTransformMatrix()), e.setMatrix((a = n == null ? void 0 : n.view) !== null && a !== void 0 ? a : \"view\", this._viewMatrix), e.setMatrix((s = n == null ? void 0 : n.projection) !== null && s !== void 0 ? s : \"projection\", this._projectionMatrix);\n            var P = i.getWorldMatrix();\n            e.setMatrix((d = n == null ? void 0 : n.world) !== null && d !== void 0 ? d : \"world\", P), P.multiplyToRef(this.getTransformMatrix(), gu), e.setMatrix((p = n == null ? void 0 : n.worldViewProjection) !== null && p !== void 0 ? p : \"worldViewProjection\", gu), P.multiplyToRef(this._viewMatrix, vu), e.setMatrix((y = n == null ? void 0 : n.worldView) !== null && y !== void 0 ? y : \"worldView\", vu);\n          }, r.prototype._renderSubMeshForShadowMap = function(t, e) {\n            var n, i;\n            e === void 0 && (e = !1);\n            var o = t.getRenderingMesh(), a = t.getEffectiveMesh(), s = this._scene, d = s.getEngine(), p = t.getMaterial();\n            if (a._internalAbstractMeshDataInfo._isActiveIntermediate = !1, p && t.verticesCount !== 0 && t._renderId !== s.getRenderId()) {\n              d.setState(p.backFaceCulling);\n              var y = o._getInstancesRenderList(t._id, !!t.getReplacementMesh());\n              if (!y.mustReturn) {\n                var P = d.getCaps().instancedArrays && (y.visibleInstances[t._id] !== null && y.visibleInstances[t._id] !== void 0 || o.hasThinInstances);\n                if (!this.customAllowRendering || this.customAllowRendering(t))\n                  if (this.isReady(t, P, e)) {\n                    t._renderId = s.getRenderId();\n                    var R = (n = o.material) === null || n === void 0 ? void 0 : n.shadowDepthWrapper, B = (i = R == null ? void 0 : R.getEffect(t, this)) !== null && i !== void 0 ? i : this._effect;\n                    if (d.enableEffect(B), o._bind(t, B, p.fillMode), this.getTransformMatrix(), B.setFloat3(\"biasAndScaleSM\", this.bias, this.normalBias, this.depthScale), this.getLight().getTypeID() === bi.a.LIGHTTYPEID_DIRECTIONALLIGHT ? B.setVector3(\"lightDataSM\", this._cachedDirection) : B.setVector3(\"lightDataSM\", this._cachedPosition), s.activeCamera && B.setFloat2(\"depthValuesSM\", this.getLight().getDepthMinZ(s.activeCamera), this.getLight().getDepthMinZ(s.activeCamera) + this.getLight().getDepthMaxZ(s.activeCamera)), e && this.enableSoftTransparentShadow && B.setFloat(\"softTransparentShadowSM\", a.visibility), R)\n                      t._effectOverride = B, R.standalone ? R.baseMaterial.bindForSubMesh(a.getWorldMatrix(), o, t) : p.bindForSubMesh(a.getWorldMatrix(), o, t), t._effectOverride = null;\n                    else {\n                      if (B.setMatrix(\"viewProjection\", this.getTransformMatrix()), p && p.needAlphaTesting()) {\n                        var F = p.getAlphaTestTexture();\n                        F && (B.setTexture(\"diffuseSampler\", F), B.setMatrix(\"diffuseMatrix\", F.getTextureMatrix() || this._defaultTextureMatrix));\n                      }\n                      if (o.useBones && o.computeBonesUsingShaders && o.skeleton) {\n                        var z = o.skeleton;\n                        if (z.isUsingTextureForMatrices) {\n                          var J = z.getTransformMatrixTexture(o);\n                          if (!J)\n                            return;\n                          B.setTexture(\"boneSampler\", J), B.setFloat(\"boneTextureWidth\", 4 * (z.bones.length + 1));\n                        } else\n                          B.setMatrices(\"mBones\", z.getTransformMatrices(o));\n                      }\n                      $e.a.BindMorphTargetParameters(o, B), $e.a.BindClipPlane(B, s);\n                    }\n                    this._bindCustomEffectForRenderSubMeshForShadowMap(t, B, R == null ? void 0 : R._matriceNames, a), this.forceBackFacesOnly && d.setState(!0, 0, !1, !0), this.onBeforeShadowMapRenderMeshObservable.notifyObservers(o), this.onBeforeShadowMapRenderObservable.notifyObservers(B), o._processRendering(a, t, B, p.fillMode, y, P, function(ie, se) {\n                      return B.setMatrix(\"world\", se);\n                    }), this.forceBackFacesOnly && d.setState(!0, 0, !1, !1), this.onAfterShadowMapRenderObservable.notifyObservers(B), this.onAfterShadowMapRenderMeshObservable.notifyObservers(o);\n                  } else\n                    this._shadowMap && this._shadowMap.resetRefreshCounter();\n              }\n            }\n          }, r.prototype._applyFilterValues = function() {\n            this._shadowMap && (this.filter === r.FILTER_NONE || this.filter === r.FILTER_PCSS ? this._shadowMap.updateSamplingMode(Ne.a.NEAREST_SAMPLINGMODE) : this._shadowMap.updateSamplingMode(Ne.a.BILINEAR_SAMPLINGMODE));\n          }, r.prototype.forceCompilation = function(t, e) {\n            var n = this, i = Object(c.a)({ useInstances: !1 }, e), o = this.getShadowMap();\n            if (o) {\n              var a = o.renderList;\n              if (a) {\n                for (var s = new Array(), d = 0, p = a; d < p.length; d++) {\n                  var y = p[d];\n                  s.push.apply(s, y.subMeshes);\n                }\n                if (s.length !== 0) {\n                  var P = 0, R = function() {\n                    var B, F;\n                    if (n._scene && n._scene.getEngine()) {\n                      for (; n.isReady(s[P], i.useInstances, (F = (B = s[P].getMaterial()) === null || B === void 0 ? void 0 : B.needAlphaBlendingForMesh(s[P].getMesh())) !== null && F !== void 0 && F); )\n                        if (++P >= s.length)\n                          return void (t && t(n));\n                      setTimeout(R, 16);\n                    }\n                  };\n                  R();\n                } else\n                  t && t(this);\n              } else\n                t && t(this);\n            } else\n              t && t(this);\n          }, r.prototype.forceCompilationAsync = function(t) {\n            var e = this;\n            return new Promise(function(n) {\n              e.forceCompilation(function() {\n                n();\n              }, t);\n            });\n          }, r.prototype._isReadyCustomDefines = function(t, e, n) {\n          }, r.prototype._prepareShadowDefines = function(t, e, n, i) {\n            n.push(\"#define SM_FLOAT \" + (this._textureType !== h.a.TEXTURETYPE_UNSIGNED_INT ? \"1\" : \"0\")), n.push(\"#define SM_ESM \" + (this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? \"1\" : \"0\")), n.push(\"#define SM_DEPTHTEXTURE \" + (this.usePercentageCloserFiltering || this.useContactHardeningShadow ? \"1\" : \"0\"));\n            var o = t.getMesh();\n            return n.push(\"#define SM_NORMALBIAS \" + (this.normalBias && o.isVerticesDataPresent(Oe.b.NormalKind) ? \"1\" : \"0\")), n.push(\"#define SM_DIRECTIONINLIGHTDATA \" + (this.getLight().getTypeID() === bi.a.LIGHTTYPEID_DIRECTIONALLIGHT ? \"1\" : \"0\")), n.push(\"#define SM_USEDISTANCE \" + (this._light.needCube() ? \"1\" : \"0\")), n.push(\"#define SM_SOFTTRANSPARENTSHADOW \" + (this.enableSoftTransparentShadow && i ? \"1\" : \"0\")), this._isReadyCustomDefines(n, t, e), n;\n          }, r.prototype.isReady = function(t, e, n) {\n            var i = t.getMaterial(), o = i == null ? void 0 : i.shadowDepthWrapper, a = [];\n            if (this._prepareShadowDefines(t, e, a, n), o) {\n              if (!o.isReadyForSubMesh(t, a, this, e))\n                return !1;\n            } else {\n              var s = [Oe.b.PositionKind], d = t.getMesh();\n              if (this.normalBias && d.isVerticesDataPresent(Oe.b.NormalKind) && (s.push(Oe.b.NormalKind), a.push(\"#define NORMAL\"), d.nonUniformScaling && a.push(\"#define NONUNIFORMSCALING\")), i && i.needAlphaTesting()) {\n                var p = i.getAlphaTestTexture();\n                if (p) {\n                  if (!p.isReady())\n                    return !1;\n                  a.push(\"#define ALPHATEST\"), d.isVerticesDataPresent(Oe.b.UVKind) && (s.push(Oe.b.UVKind), a.push(\"#define UV1\")), d.isVerticesDataPresent(Oe.b.UV2Kind) && p.coordinatesIndex === 1 && (s.push(Oe.b.UV2Kind), a.push(\"#define UV2\"));\n                }\n              }\n              var y = new _r.a();\n              if (d.useBones && d.computeBonesUsingShaders && d.skeleton) {\n                s.push(Oe.b.MatricesIndicesKind), s.push(Oe.b.MatricesWeightsKind), d.numBoneInfluencers > 4 && (s.push(Oe.b.MatricesIndicesExtraKind), s.push(Oe.b.MatricesWeightsExtraKind));\n                var P = d.skeleton;\n                a.push(\"#define NUM_BONE_INFLUENCERS \" + d.numBoneInfluencers), d.numBoneInfluencers > 0 && y.addCPUSkinningFallback(0, d), P.isUsingTextureForMatrices ? a.push(\"#define BONETEXTURE\") : a.push(\"#define BonesPerMesh \" + (P.bones.length + 1));\n              } else\n                a.push(\"#define NUM_BONE_INFLUENCERS 0\");\n              var R = d.morphTargetManager, B = 0;\n              R && R.numInfluencers > 0 && (a.push(\"#define MORPHTARGETS\"), B = R.numInfluencers, a.push(\"#define NUM_MORPH_INFLUENCERS \" + B), $e.a.PrepareAttributesForMorphTargetsInfluencers(s, d, B));\n              var F = this._scene;\n              if (F.clipPlane && a.push(\"#define CLIPPLANE\"), F.clipPlane2 && a.push(\"#define CLIPPLANE2\"), F.clipPlane3 && a.push(\"#define CLIPPLANE3\"), F.clipPlane4 && a.push(\"#define CLIPPLANE4\"), F.clipPlane5 && a.push(\"#define CLIPPLANE5\"), F.clipPlane6 && a.push(\"#define CLIPPLANE6\"), e && (a.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(s), t.getRenderingMesh().hasThinInstances && a.push(\"#define THIN_INSTANCES\")), this.customShaderOptions && this.customShaderOptions.defines)\n                for (var z = 0, J = this.customShaderOptions.defines; z < J.length; z++) {\n                  var ie = J[z];\n                  a.indexOf(ie) === -1 && a.push(ie);\n                }\n              var se = a.join(`\n`);\n              if (this._cachedDefines !== se) {\n                this._cachedDefines = se;\n                var ce = \"shadowMap\", ue = [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"lightDataSM\", \"depthValuesSM\", \"biasAndScaleSM\", \"morphTargetInfluences\", \"boneTextureWidth\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"softTransparentShadowSM\"], fe = [\"diffuseSampler\", \"boneSampler\"];\n                if (this.customShaderOptions) {\n                  if (ce = this.customShaderOptions.shaderName, this.customShaderOptions.attributes)\n                    for (var ve = 0, Te = this.customShaderOptions.attributes; ve < Te.length; ve++) {\n                      var Re = Te[ve];\n                      s.indexOf(Re) === -1 && s.push(Re);\n                    }\n                  if (this.customShaderOptions.uniforms)\n                    for (var Ae = 0, Ee = this.customShaderOptions.uniforms; Ae < Ee.length; Ae++) {\n                      var Se = Ee[Ae];\n                      ue.indexOf(Se) === -1 && ue.push(Se);\n                    }\n                  if (this.customShaderOptions.samplers)\n                    for (var De = 0, xe = this.customShaderOptions.samplers; De < xe.length; De++) {\n                      var Le = xe[De];\n                      fe.indexOf(Le) === -1 && fe.push(Le);\n                    }\n                }\n                this._effect = this._scene.getEngine().createEffect(ce, s, ue, fe, se, y, void 0, void 0, { maxSimultaneousMorphTargets: B });\n              }\n              if (!this._effect.isReady())\n                return !1;\n            }\n            return (this.useBlurExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (this._blurPostProcesses && this._blurPostProcesses.length || this._initializeBlurRTTAndPostProcesses()), !(this._kernelBlurXPostprocess && !this._kernelBlurXPostprocess.isReady()) && !(this._kernelBlurYPostprocess && !this._kernelBlurYPostprocess.isReady()) && !(this._boxBlurPostprocess && !this._boxBlurPostprocess.isReady());\n          }, r.prototype.prepareDefines = function(t, e) {\n            var n = this._scene, i = this._light;\n            n.shadowsEnabled && i.shadowEnabled && (t[\"SHADOW\" + e] = !0, this.useContactHardeningShadow ? (t[\"SHADOWPCSS\" + e] = !0, this._filteringQuality === r.QUALITY_LOW ? t[\"SHADOWLOWQUALITY\" + e] = !0 : this._filteringQuality === r.QUALITY_MEDIUM && (t[\"SHADOWMEDIUMQUALITY\" + e] = !0)) : this.usePercentageCloserFiltering ? (t[\"SHADOWPCF\" + e] = !0, this._filteringQuality === r.QUALITY_LOW ? t[\"SHADOWLOWQUALITY\" + e] = !0 : this._filteringQuality === r.QUALITY_MEDIUM && (t[\"SHADOWMEDIUMQUALITY\" + e] = !0)) : this.usePoissonSampling ? t[\"SHADOWPOISSON\" + e] = !0 : this.useExponentialShadowMap || this.useBlurExponentialShadowMap ? t[\"SHADOWESM\" + e] = !0 : (this.useCloseExponentialShadowMap || this.useBlurCloseExponentialShadowMap) && (t[\"SHADOWCLOSEESM\" + e] = !0), i.needCube() && (t[\"SHADOWCUBE\" + e] = !0));\n          }, r.prototype.bindShadowLight = function(t, e) {\n            var n = this._light, i = this._scene;\n            if (i.shadowsEnabled && n.shadowEnabled) {\n              var o = i.activeCamera;\n              if (o) {\n                var a = this.getShadowMap();\n                a && (n.needCube() || e.setMatrix(\"lightMatrix\" + t, this.getTransformMatrix()), this._filter === r.FILTER_PCF ? (e.setDepthStencilTexture(\"shadowSampler\" + t, this.getShadowMapForRendering()), n._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), a.getSize().width, 1 / a.getSize().width, this.frustumEdgeFalloff, t)) : this._filter === r.FILTER_PCSS ? (e.setDepthStencilTexture(\"shadowSampler\" + t, this.getShadowMapForRendering()), e.setTexture(\"depthSampler\" + t, this.getShadowMapForRendering()), n._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), 1 / a.getSize().width, this._contactHardeningLightSizeUVRatio * a.getSize().width, this.frustumEdgeFalloff, t)) : (e.setTexture(\"shadowSampler\" + t, this.getShadowMapForRendering()), n._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), this.blurScale / a.getSize().width, this.depthScale, this.frustumEdgeFalloff, t)), n._uniformBuffer.updateFloat2(\"depthValues\", this.getLight().getDepthMinZ(o), this.getLight().getDepthMinZ(o) + this.getLight().getDepthMaxZ(o), t));\n              }\n            }\n          }, r.prototype.getTransformMatrix = function() {\n            var t = this._scene;\n            if (this._currentRenderID === t.getRenderId() && this._currentFaceIndexCache === this._currentFaceIndex)\n              return this._transformMatrix;\n            this._currentRenderID = t.getRenderId(), this._currentFaceIndexCache = this._currentFaceIndex;\n            var e = this._light.position;\n            if (this._light.computeTransformedInformation() && (e = this._light.transformedPosition), u.e.NormalizeToRef(this._light.getShadowDirection(this._currentFaceIndex), this._lightDirection), Math.abs(u.e.Dot(this._lightDirection, u.e.Up())) === 1 && (this._lightDirection.z = 1e-13), this._light.needProjectionMatrixCompute() || !this._cachedPosition || !this._cachedDirection || !e.equals(this._cachedPosition) || !this._lightDirection.equals(this._cachedDirection)) {\n              this._cachedPosition.copyFrom(e), this._cachedDirection.copyFrom(this._lightDirection), u.a.LookAtLHToRef(e, e.add(this._lightDirection), u.e.Up(), this._viewMatrix);\n              var n = this.getShadowMap();\n              if (n) {\n                var i = n.renderList;\n                i && this._light.setShadowProjectionMatrix(this._projectionMatrix, this._viewMatrix, i);\n              }\n              this._viewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\n            }\n            return this._transformMatrix;\n          }, r.prototype.recreateShadowMap = function() {\n            var t = this._shadowMap;\n            if (t) {\n              var e = t.renderList;\n              this._disposeRTTandPostProcesses(), this._initializeGenerator(), this.filter = this.filter, this._applyFilterValues(), this._shadowMap.renderList = e;\n            }\n          }, r.prototype._disposeBlurPostProcesses = function() {\n            this._shadowMap2 && (this._shadowMap2.dispose(), this._shadowMap2 = null), this._boxBlurPostprocess && (this._boxBlurPostprocess.dispose(), this._boxBlurPostprocess = null), this._kernelBlurXPostprocess && (this._kernelBlurXPostprocess.dispose(), this._kernelBlurXPostprocess = null), this._kernelBlurYPostprocess && (this._kernelBlurYPostprocess.dispose(), this._kernelBlurYPostprocess = null), this._blurPostProcesses = [];\n          }, r.prototype._disposeRTTandPostProcesses = function() {\n            this._shadowMap && (this._shadowMap.dispose(), this._shadowMap = null), this._disposeBlurPostProcesses();\n          }, r.prototype.dispose = function() {\n            this._disposeRTTandPostProcesses(), this._light && (this._light._shadowGenerator = null, this._light._markMeshesAsLightDirty()), this.onBeforeShadowMapRenderMeshObservable.clear(), this.onBeforeShadowMapRenderObservable.clear(), this.onAfterShadowMapRenderMeshObservable.clear(), this.onAfterShadowMapRenderObservable.clear();\n          }, r.prototype.serialize = function() {\n            var t = {}, e = this.getShadowMap();\n            if (!e)\n              return t;\n            if (t.className = this.getClassName(), t.lightId = this._light.id, t.id = this._light.id, t.mapSize = e.getRenderSize(), t.forceBackFacesOnly = this.forceBackFacesOnly, t.darkness = this.getDarkness(), t.transparencyShadow = this._transparencyShadow, t.frustumEdgeFalloff = this.frustumEdgeFalloff, t.bias = this.bias, t.normalBias = this.normalBias, t.usePercentageCloserFiltering = this.usePercentageCloserFiltering, t.useContactHardeningShadow = this.useContactHardeningShadow, t.contactHardeningLightSizeUVRatio = this.contactHardeningLightSizeUVRatio, t.filteringQuality = this.filteringQuality, t.useExponentialShadowMap = this.useExponentialShadowMap, t.useBlurExponentialShadowMap = this.useBlurExponentialShadowMap, t.useCloseExponentialShadowMap = this.useBlurExponentialShadowMap, t.useBlurCloseExponentialShadowMap = this.useBlurExponentialShadowMap, t.usePoissonSampling = this.usePoissonSampling, t.depthScale = this.depthScale, t.blurBoxOffset = this.blurBoxOffset, t.blurKernel = this.blurKernel, t.blurScale = this.blurScale, t.useKernelBlur = this.useKernelBlur, t.renderList = [], e.renderList)\n              for (var n = 0; n < e.renderList.length; n++) {\n                var i = e.renderList[n];\n                t.renderList.push(i.id);\n              }\n            return t;\n          }, r.Parse = function(t, e, n) {\n            for (var i = e.getLightByID(t.lightId), o = n ? n(t.mapSize, i) : new r(t.mapSize, i), a = o.getShadowMap(), s = 0; s < t.renderList.length; s++)\n              e.getMeshesByID(t.renderList[s]).forEach(function(d) {\n                a && (a.renderList || (a.renderList = []), a.renderList.push(d));\n              });\n            return t.id !== void 0 && (o.id = t.id), o.forceBackFacesOnly = !!t.forceBackFacesOnly, t.darkness !== void 0 && o.setDarkness(t.darkness), t.transparencyShadow && o.setTransparencyShadow(!0), t.frustumEdgeFalloff !== void 0 && (o.frustumEdgeFalloff = t.frustumEdgeFalloff), t.bias !== void 0 && (o.bias = t.bias), t.normalBias !== void 0 && (o.normalBias = t.normalBias), t.usePercentageCloserFiltering ? o.usePercentageCloserFiltering = !0 : t.useContactHardeningShadow ? o.useContactHardeningShadow = !0 : t.usePoissonSampling ? o.usePoissonSampling = !0 : t.useExponentialShadowMap ? o.useExponentialShadowMap = !0 : t.useBlurExponentialShadowMap ? o.useBlurExponentialShadowMap = !0 : t.useCloseExponentialShadowMap ? o.useCloseExponentialShadowMap = !0 : t.useBlurCloseExponentialShadowMap ? o.useBlurCloseExponentialShadowMap = !0 : t.useVarianceShadowMap ? o.useExponentialShadowMap = !0 : t.useBlurVarianceShadowMap && (o.useBlurExponentialShadowMap = !0), t.contactHardeningLightSizeUVRatio !== void 0 && (o.contactHardeningLightSizeUVRatio = t.contactHardeningLightSizeUVRatio), t.filteringQuality !== void 0 && (o.filteringQuality = t.filteringQuality), t.depthScale && (o.depthScale = t.depthScale), t.blurScale && (o.blurScale = t.blurScale), t.blurBoxOffset && (o.blurBoxOffset = t.blurBoxOffset), t.useKernelBlur && (o.useKernelBlur = t.useKernelBlur), t.blurKernel && (o.blurKernel = t.blurKernel), o;\n          }, r.CLASSNAME = \"ShadowGenerator\", r.FILTER_NONE = 0, r.FILTER_EXPONENTIALSHADOWMAP = 1, r.FILTER_POISSONSAMPLING = 2, r.FILTER_BLUREXPONENTIALSHADOWMAP = 3, r.FILTER_CLOSEEXPONENTIALSHADOWMAP = 4, r.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5, r.FILTER_PCF = 6, r.FILTER_PCSS = 7, r.QUALITY_HIGH = 0, r.QUALITY_MEDIUM = 1, r.QUALITY_LOW = 2, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"ShadowGeneratorSceneComponent\");\n          }, r;\n        }(), b_ = `#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\nvarying float vDepthMetric;\n#ifdef PACKED\n#include<packingFunctions>\n#endif\nvoid main(void)\n{\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#ifdef NONLINEARDEPTH\n#ifdef PACKED\ngl_FragColor=pack(gl_FragCoord.z);\n#else\ngl_FragColor=vec4(gl_FragCoord.z,0.0,0.0,0.0);\n#endif\n#else\n#ifdef PACKED\ngl_FragColor=pack(vDepthMetric);\n#else\ngl_FragColor=vec4(vDepthMetric,0.0,0.0,1.0);\n#endif\n#endif\n}`;\n        ze.a.ShadersStore.depthPixelShader = b_;\n        var T_ = `\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvarying float vDepthMetric;\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n`;\n        ze.a.ShadersStore.depthVertexShader = T_;\n        var Qo = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            e === void 0 && (e = h.a.TEXTURETYPE_FLOAT), n === void 0 && (n = null), i === void 0 && (i = !1), this.enabled = !0, this.useOnlyInActiveCamera = !1, this._scene = t, this._storeNonLinearDepth = i, this.isPacked = e === h.a.TEXTURETYPE_UNSIGNED_BYTE, this.isPacked ? this._clearColor = new I.b(1, 1, 1, 1) : this._clearColor = new I.b(1, 0, 0, 1), r._SceneComponentInitialization(this._scene), this._camera = n;\n            var a = t.getEngine(), s = this.isPacked || a.webGLVersion === 1 ? h.a.TEXTUREFORMAT_RGBA : h.a.TEXTUREFORMAT_R;\n            this._depthMap = new on(\"depthMap\", { width: a.getRenderWidth(), height: a.getRenderHeight() }, this._scene, !1, !0, e, !1, void 0, void 0, void 0, void 0, s), this._depthMap.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._depthMap.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._depthMap.refreshRate = 1, this._depthMap.renderParticles = !1, this._depthMap.renderList = null, this._depthMap.activeCamera = this._camera, this._depthMap.ignoreCameraViewport = !0, this._depthMap.useCameraPostProcesses = !1, this._depthMap.onClearObservable.add(function(p) {\n              p.clear(o._clearColor, !0, !0, !0);\n            });\n            var d = function(p) {\n              var y = p.getRenderingMesh(), P = p.getEffectiveMesh(), R = o._scene, B = R.getEngine(), F = p.getMaterial();\n              if (P._internalAbstractMeshDataInfo._isActiveIntermediate = !1, F && p.verticesCount !== 0 && p._renderId !== R.getRenderId()) {\n                B.setState(F.backFaceCulling, 0, !1, R.useRightHandedSystem);\n                var z = y._getInstancesRenderList(p._id, !!p.getReplacementMesh());\n                if (!z.mustReturn) {\n                  var J = B.getCaps().instancedArrays && (z.visibleInstances[p._id] !== null && z.visibleInstances[p._id] !== void 0 || y.hasThinInstances), ie = o._camera || R.activeCamera;\n                  if (o.isReady(p, J) && ie) {\n                    if (p._renderId = R.getRenderId(), B.enableEffect(o._effect), y._bind(p, o._effect, F.fillMode), o._effect.setMatrix(\"viewProjection\", R.getTransformMatrix()), o._effect.setFloat2(\"depthValues\", ie.minZ, ie.minZ + ie.maxZ), F && F.needAlphaTesting()) {\n                      var se = F.getAlphaTestTexture();\n                      se && (o._effect.setTexture(\"diffuseSampler\", se), o._effect.setMatrix(\"diffuseMatrix\", se.getTextureMatrix()));\n                    }\n                    y.useBones && y.computeBonesUsingShaders && y.skeleton && o._effect.setMatrices(\"mBones\", y.skeleton.getTransformMatrices(y)), $e.a.BindMorphTargetParameters(y, o._effect), y._processRendering(P, p, o._effect, F.fillMode, z, J, function(ce, ue) {\n                      return o._effect.setMatrix(\"world\", ue);\n                    });\n                  }\n                }\n              }\n            };\n            this._depthMap.customRenderFunction = function(p, y, P, R) {\n              var B;\n              if (R.length) {\n                for (a.setColorWrite(!1), B = 0; B < R.length; B++)\n                  d(R.data[B]);\n                a.setColorWrite(!0);\n              }\n              for (B = 0; B < p.length; B++)\n                d(p.data[B]);\n              for (B = 0; B < y.length; B++)\n                d(y.data[B]);\n            };\n          }\n          return r.prototype.isReady = function(t, e) {\n            var n = t.getMaterial();\n            if (n.disableDepthWrite)\n              return !1;\n            var i = [], o = [Oe.b.PositionKind], a = t.getMesh();\n            n && n.needAlphaTesting() && n.getAlphaTestTexture() && (i.push(\"#define ALPHATEST\"), a.isVerticesDataPresent(Oe.b.UVKind) && (o.push(Oe.b.UVKind), i.push(\"#define UV1\")), a.isVerticesDataPresent(Oe.b.UV2Kind) && (o.push(Oe.b.UV2Kind), i.push(\"#define UV2\"))), a.useBones && a.computeBonesUsingShaders ? (o.push(Oe.b.MatricesIndicesKind), o.push(Oe.b.MatricesWeightsKind), a.numBoneInfluencers > 4 && (o.push(Oe.b.MatricesIndicesExtraKind), o.push(Oe.b.MatricesWeightsExtraKind)), i.push(\"#define NUM_BONE_INFLUENCERS \" + a.numBoneInfluencers), i.push(\"#define BonesPerMesh \" + (a.skeleton ? a.skeleton.bones.length + 1 : 0))) : i.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var s = a.morphTargetManager, d = 0;\n            s && s.numInfluencers > 0 && (d = s.numInfluencers, i.push(\"#define MORPHTARGETS\"), i.push(\"#define NUM_MORPH_INFLUENCERS \" + d), $e.a.PrepareAttributesForMorphTargetsInfluencers(o, a, d)), e && (i.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(o), t.getRenderingMesh().hasThinInstances && i.push(\"#define THIN_INSTANCES\")), this._storeNonLinearDepth && i.push(\"#define NONLINEARDEPTH\"), this.isPacked && i.push(\"#define PACKED\");\n            var p = i.join(`\n`);\n            return this._cachedDefines !== p && (this._cachedDefines = p, this._effect = this._scene.getEngine().createEffect(\"depth\", o, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"depthValues\", \"morphTargetInfluences\"], [\"diffuseSampler\"], p, void 0, void 0, void 0, { maxSimultaneousMorphTargets: d })), this._effect.isReady();\n          }, r.prototype.getDepthMap = function() {\n            return this._depthMap;\n          }, r.prototype.dispose = function() {\n            this._depthMap.dispose();\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"DepthRendererSceneComponent\");\n          }, r;\n        }(), E_ = `attribute vec2 vUV;\nuniform sampler2D textureSampler;\n#if defined(INITIAL)\nuniform sampler2D sourceTexture;\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nfloat f1=texelFetch(sourceTexture,coord,0).r;\nfloat f2=texelFetch(sourceTexture,coord+ivec2(1,0),0).r;\nfloat f3=texelFetch(sourceTexture,coord+ivec2(1,1),0).r;\nfloat f4=texelFetch(sourceTexture,coord+ivec2(0,1),0).r;\nfloat minz=min(min(min(f1,f2),f3),f4);\n#ifdef DEPTH_REDUX\nfloat maxz=max(max(max(sign(1.0-f1)*f1,sign(1.0-f2)*f2),sign(1.0-f3)*f3),sign(1.0-f4)*f4);\n#else\nfloat maxz=max(max(max(f1,f2),f3),f4);\n#endif\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(MAIN)\nuniform vec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*(texSize-1.0));\nvec2 f1=texelFetch(textureSampler,coord,0).rg;\nvec2 f2=texelFetch(textureSampler,coord+ivec2(1,0),0).rg;\nvec2 f3=texelFetch(textureSampler,coord+ivec2(1,1),0).rg;\nvec2 f4=texelFetch(textureSampler,coord+ivec2(0,1),0).rg;\nfloat minz=min(min(min(f1.x,f2.x),f3.x),f4.x);\nfloat maxz=max(max(max(f1.y,f2.y),f3.y),f4.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(ONEBEFORELAST)\nuniform ivec2 texSize;\nvoid main(void)\n{\nivec2 coord=ivec2(vUV*vec2(texSize-1));\nvec2 f1=texelFetch(textureSampler,coord % texSize,0).rg;\nvec2 f2=texelFetch(textureSampler,(coord+ivec2(1,0)) % texSize,0).rg;\nvec2 f3=texelFetch(textureSampler,(coord+ivec2(1,1)) % texSize,0).rg;\nvec2 f4=texelFetch(textureSampler,(coord+ivec2(0,1)) % texSize,0).rg;\nfloat minz=min(f1.x,f2.x);\nfloat maxz=max(f1.y,f2.y);\nglFragColor=vec4(minz,maxz,0.,0.);\n}\n#elif defined(LAST)\nvoid main(void)\n{\ndiscard;\nglFragColor=vec4(0.);\n}\n#endif\n`;\n        ze.a.ShadersStore.minmaxReduxPixelShader = E_;\n        var yu = function() {\n          function r(t) {\n            this.onAfterReductionPerformed = new C.c(), this._forceFullscreenViewport = !0, this._activated = !1, this._camera = t, this._postProcessManager = new es.a(t.getScene());\n          }\n          return Object.defineProperty(r.prototype, \"sourceTexture\", { get: function() {\n            return this._sourceTexture;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setSourceTexture = function(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = h.a.TEXTURETYPE_HALF_FLOAT), i === void 0 && (i = !0), t !== this._sourceTexture) {\n              this.dispose(!1), this._sourceTexture = t, this._reductionSteps = [], this._forceFullscreenViewport = i;\n              var a = this._camera.getScene(), s = new ft(\"Initial reduction phase\", \"minmaxRedux\", [\"texSize\"], [\"sourceTexture\"], 1, null, h.a.TEXTURE_NEAREST_NEAREST, a.getEngine(), !1, \"#define INITIAL\" + (e ? `\n#define DEPTH_REDUX` : \"\"), n, void 0, void 0, void 0, h.a.TEXTUREFORMAT_RG);\n              s.autoClear = !1, s.forceFullscreenViewport = i;\n              var d = this._sourceTexture.getRenderWidth(), p = this._sourceTexture.getRenderHeight();\n              s.onApply = function(R, B) {\n                return function(F) {\n                  F.setTexture(\"sourceTexture\", o._sourceTexture), F.setFloatArray2(\"texSize\", new Float32Array([R, B]));\n                };\n              }(d, p), this._reductionSteps.push(s);\n              for (var y = 1; d > 1 || p > 1; ) {\n                d = Math.max(Math.round(d / 2), 1), p = Math.max(Math.round(p / 2), 1);\n                var P = new ft(\"Reduction phase \" + y, \"minmaxRedux\", [\"texSize\"], null, { width: d, height: p }, null, h.a.TEXTURE_NEAREST_NEAREST, a.getEngine(), !1, \"#define \" + (d == 1 && p == 1 ? \"LAST\" : d == 1 || p == 1 ? \"ONEBEFORELAST\" : \"MAIN\"), n, void 0, void 0, void 0, h.a.TEXTUREFORMAT_RG);\n                P.autoClear = !1, P.forceFullscreenViewport = i, P.onApply = function(R, B) {\n                  return function(F) {\n                    R == 1 || B == 1 ? F.setIntArray2(\"texSize\", new Int32Array([R, B])) : F.setFloatArray2(\"texSize\", new Float32Array([R, B]));\n                  };\n                }(d, p), this._reductionSteps.push(P), y++, d == 1 && p == 1 && P.onAfterRenderObservable.add(function(R, B, F) {\n                  var z = new Float32Array(4 * R * B), J = { min: 0, max: 0 };\n                  return function() {\n                    a.getEngine()._readTexturePixels(F.inputTexture, R, B, -1, 0, z), J.min = z[0], J.max = z[1], o.onAfterReductionPerformed.notifyObservers(J);\n                  };\n                }(d, p, P));\n              }\n            }\n          }, Object.defineProperty(r.prototype, \"refreshRate\", { get: function() {\n            return this._sourceTexture ? this._sourceTexture.refreshRate : -1;\n          }, set: function(t) {\n            this._sourceTexture && (this._sourceTexture.refreshRate = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"activated\", { get: function() {\n            return this._activated;\n          }, enumerable: !1, configurable: !0 }), r.prototype.activate = function() {\n            var t = this;\n            !this._onAfterUnbindObserver && this._sourceTexture && (this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(function() {\n              t._reductionSteps[0].activate(t._camera), t._postProcessManager.directRender(t._reductionSteps, t._reductionSteps[0].inputTexture, t._forceFullscreenViewport), t._camera.getScene().getEngine().unBindFramebuffer(t._reductionSteps[0].inputTexture, !1);\n            }), this._activated = !0);\n          }, r.prototype.deactivate = function() {\n            this._onAfterUnbindObserver && this._sourceTexture && (this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver), this._onAfterUnbindObserver = null, this._activated = !1);\n          }, r.prototype.dispose = function(t) {\n            if (t === void 0 && (t = !0), t && this.onAfterReductionPerformed.clear(), this.deactivate(), this._reductionSteps) {\n              for (var e = 0; e < this._reductionSteps.length; ++e)\n                this._reductionSteps[e].dispose();\n              this._reductionSteps = null;\n            }\n            this._postProcessManager && t && this._postProcessManager.dispose(), this._sourceTexture = null;\n          }, r;\n        }(), bu = function(r) {\n          function t(e) {\n            return r.call(this, e) || this;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"depthRenderer\", { get: function() {\n            return this._depthRenderer;\n          }, enumerable: !1, configurable: !0 }), t.prototype.setDepthRenderer = function(e, n, i) {\n            e === void 0 && (e = null), n === void 0 && (n = h.a.TEXTURETYPE_HALF_FLOAT), i === void 0 && (i = !0);\n            var o = this._camera.getScene();\n            this._depthRenderer && (delete o._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null), e === null && (o._depthRenderer || (o._depthRenderer = {}), (e = this._depthRenderer = new Qo(o, n, this._camera, !1)).enabled = !1, this._depthRendererId = \"minmax\" + this._camera.id, o._depthRenderer[this._depthRendererId] = e), r.prototype.setSourceTexture.call(this, e.getDepthMap(), !0, n, i);\n          }, t.prototype.setSourceTexture = function(e, n, i, o) {\n            i === void 0 && (i = h.a.TEXTURETYPE_HALF_FLOAT), o === void 0 && (o = !0), r.prototype.setSourceTexture.call(this, e, n, i, o);\n          }, t.prototype.activate = function() {\n            this._depthRenderer && (this._depthRenderer.enabled = !0), r.prototype.activate.call(this);\n          }, t.prototype.deactivate = function() {\n            r.prototype.deactivate.call(this), this._depthRenderer && (this._depthRenderer.enabled = !1);\n          }, t.prototype.dispose = function(e) {\n            if (e === void 0 && (e = !0), r.prototype.dispose.call(this, e), this._depthRenderer && e) {\n              var n = this._depthRenderer.getDepthMap().getScene();\n              n && delete n._depthRenderer[this._depthRendererId], this._depthRenderer.dispose(), this._depthRenderer = null;\n            }\n          }, t;\n        }(yu), Tu = u.e.Up(), S_ = u.e.Zero(), mn = new u.e(), Tr = new u.e(), Er = new u.a(), Eu = new u.a(), Ds = function(r) {\n          function t(e, n, i) {\n            var o = this;\n            if (t.IsSupported)\n              return (o = r.call(this, e, n, i) || this).usePercentageCloserFiltering = !0, o;\n            l.a.Error(\"CascadedShadowMap needs WebGL 2 support.\");\n          }\n          return Object(c.d)(t, r), t.prototype._validateFilter = function(e) {\n            return e === Fn.FILTER_NONE || e === Fn.FILTER_PCF || e === Fn.FILTER_PCSS ? e : (console.error('Unsupported filter \"' + e + '\"!'), Fn.FILTER_NONE);\n          }, Object.defineProperty(t.prototype, \"numCascades\", { get: function() {\n            return this._numCascades;\n          }, set: function(e) {\n            (e = Math.min(Math.max(e, t.MIN_CASCADES_COUNT), t.MAX_CASCADES_COUNT)) !== this._numCascades && (this._numCascades = e, this.recreateShadowMap());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"freezeShadowCastersBoundingInfo\", { get: function() {\n            return this._freezeShadowCastersBoundingInfo;\n          }, set: function(e) {\n            this._freezeShadowCastersBoundingInfoObservable && e && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._freezeShadowCastersBoundingInfoObservable || e || (this._freezeShadowCastersBoundingInfoObservable = this._scene.onBeforeRenderObservable.add(this._computeShadowCastersBoundingInfo.bind(this))), this._freezeShadowCastersBoundingInfo = e, e && this._computeShadowCastersBoundingInfo();\n          }, enumerable: !1, configurable: !0 }), t.prototype._computeShadowCastersBoundingInfo = function() {\n            if (this._scbiMin.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._scbiMax.copyFromFloats(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE), this._shadowMap && this._shadowMap.renderList) {\n              for (var e = this._shadowMap.renderList, n = 0; n < e.length; n++)\n                if (a = e[n]) {\n                  var i = a.getBoundingInfo().boundingBox;\n                  this._scbiMin.minimizeInPlace(i.minimumWorld), this._scbiMax.maximizeInPlace(i.maximumWorld);\n                }\n              var o = this._scene.meshes;\n              for (n = 0; n < o.length; n++) {\n                var a;\n                (a = o[n]) && a.isVisible && a.isEnabled && a.receiveShadows && (i = a.getBoundingInfo().boundingBox, this._scbiMin.minimizeInPlace(i.minimumWorld), this._scbiMax.maximizeInPlace(i.maximumWorld));\n              }\n            }\n            this._shadowCastersBoundingInfo.reConstruct(this._scbiMin, this._scbiMax);\n          }, Object.defineProperty(t.prototype, \"shadowCastersBoundingInfo\", { get: function() {\n            return this._shadowCastersBoundingInfo;\n          }, set: function(e) {\n            this._shadowCastersBoundingInfo = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.setMinMaxDistance = function(e, n) {\n            this._minDistance === e && this._maxDistance === n || (e > n && (e = 0, n = 1), e < 0 && (e = 0), n > 1 && (n = 1), this._minDistance = e, this._maxDistance = n, this._breaksAreDirty = !0);\n          }, Object.defineProperty(t.prototype, \"minDistance\", { get: function() {\n            return this._minDistance;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"maxDistance\", { get: function() {\n            return this._maxDistance;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return t.CLASSNAME;\n          }, t.prototype.getCascadeMinExtents = function(e) {\n            return e >= 0 && e < this._numCascades ? this._cascadeMinExtents[e] : null;\n          }, t.prototype.getCascadeMaxExtents = function(e) {\n            return e >= 0 && e < this._numCascades ? this._cascadeMaxExtents[e] : null;\n          }, Object.defineProperty(t.prototype, \"shadowMaxZ\", { get: function() {\n            return this._scene && this._scene.activeCamera ? this._shadowMaxZ : 0;\n          }, set: function(e) {\n            this._scene && this._scene.activeCamera ? this._shadowMaxZ === e || e < this._scene.activeCamera.minZ || e > this._scene.activeCamera.maxZ || (this._shadowMaxZ = e, this._light._markMeshesAsLightDirty(), this._breaksAreDirty = !0) : this._shadowMaxZ = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"debug\", { get: function() {\n            return this._debug;\n          }, set: function(e) {\n            this._debug = e, this._light._markMeshesAsLightDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthClamp\", { get: function() {\n            return this._depthClamp;\n          }, set: function(e) {\n            this._depthClamp = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cascadeBlendPercentage\", { get: function() {\n            return this._cascadeBlendPercentage;\n          }, set: function(e) {\n            this._cascadeBlendPercentage = e, this._light._markMeshesAsLightDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"lambda\", { get: function() {\n            return this._lambda;\n          }, set: function(e) {\n            var n = Math.min(Math.max(e, 0), 1);\n            this._lambda != n && (this._lambda = n, this._breaksAreDirty = !0);\n          }, enumerable: !1, configurable: !0 }), t.prototype.getCascadeViewMatrix = function(e) {\n            return e >= 0 && e < this._numCascades ? this._viewMatrices[e] : null;\n          }, t.prototype.getCascadeProjectionMatrix = function(e) {\n            return e >= 0 && e < this._numCascades ? this._projectionMatrices[e] : null;\n          }, t.prototype.getCascadeTransformMatrix = function(e) {\n            return e >= 0 && e < this._numCascades ? this._transformMatrices[e] : null;\n          }, t.prototype.setDepthRenderer = function(e) {\n            this._depthRenderer = e, this._depthReducer && this._depthReducer.setDepthRenderer(this._depthRenderer);\n          }, Object.defineProperty(t.prototype, \"autoCalcDepthBounds\", { get: function() {\n            return this._autoCalcDepthBounds;\n          }, set: function(e) {\n            var n = this, i = this._scene.activeCamera;\n            if (i) {\n              if (this._autoCalcDepthBounds = e, !e)\n                return this._depthReducer && this._depthReducer.deactivate(), void this.setMinMaxDistance(0, 1);\n              this._depthReducer || (this._depthReducer = new bu(i), this._depthReducer.onAfterReductionPerformed.add(function(o) {\n                var a = o.min, s = o.max;\n                a >= s && (a = 0, s = 1), a == n._minDistance && s == n._maxDistance || n.setMinMaxDistance(a, s);\n              }), this._depthReducer.setDepthRenderer(this._depthRenderer)), this._depthReducer.activate();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"autoCalcDepthBoundsRefreshRate\", { get: function() {\n            var e, n, i;\n            return (i = (n = (e = this._depthReducer) === null || e === void 0 ? void 0 : e.depthRenderer) === null || n === void 0 ? void 0 : n.getDepthMap().refreshRate) !== null && i !== void 0 ? i : -1;\n          }, set: function(e) {\n            var n;\n            !((n = this._depthReducer) === null || n === void 0) && n.depthRenderer && (this._depthReducer.depthRenderer.getDepthMap().refreshRate = e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.splitFrustum = function() {\n            this._breaksAreDirty = !0;\n          }, t.prototype._splitFrustum = function() {\n            var e = this._scene.activeCamera;\n            if (e) {\n              for (var n = e.minZ, i = e.maxZ, o = i - n, a = this._minDistance, s = n + a * o, d = n + (this._shadowMaxZ < i && this._shadowMaxZ >= n ? Math.min((this._shadowMaxZ - n) / (i - n), this._maxDistance) : this._maxDistance) * o, p = d - s, y = d / s, P = 0; P < this._cascades.length; ++P) {\n                var R = (P + 1) / this._numCascades, B = s * Math.pow(y, R), F = s + p * R, z = this._lambda * (B - F) + F;\n                this._cascades[P].prevBreakDistance = P === 0 ? a : this._cascades[P - 1].breakDistance, this._cascades[P].breakDistance = (z - n) / o, this._viewSpaceFrustumsZ[P] = n + this._cascades[P].breakDistance * o, this._frustumLengths[P] = (this._cascades[P].breakDistance - this._cascades[P].prevBreakDistance) * o;\n              }\n              this._breaksAreDirty = !1;\n            }\n          }, t.prototype._computeMatrices = function() {\n            if (this._scene.activeCamera) {\n              u.e.NormalizeToRef(this._light.getShadowDirection(0), this._lightDirection), Math.abs(u.e.Dot(this._lightDirection, u.e.Up())) === 1 && (this._lightDirection.z = 1e-13), this._cachedDirection.copyFrom(this._lightDirection);\n              for (var e = 0; e < this._numCascades; ++e) {\n                this._computeFrustumInWorldSpace(e), this._computeCascadeFrustum(e), this._cascadeMaxExtents[e].subtractToRef(this._cascadeMinExtents[e], mn), this._frustumCenter[e].addToRef(this._lightDirection.scale(this._cascadeMinExtents[e].z), this._shadowCameraPos[e]), u.a.LookAtLHToRef(this._shadowCameraPos[e], this._frustumCenter[e], Tu, this._viewMatrices[e]);\n                var n = 0, i = mn.z, o = this._shadowCastersBoundingInfo;\n                o.update(this._viewMatrices[e]), i = Math.min(i, o.boundingBox.maximumWorld.z), n = this._depthClamp && this.filter !== Fn.FILTER_PCSS ? Math.max(n, o.boundingBox.minimumWorld.z) : Math.min(n, o.boundingBox.minimumWorld.z), u.a.OrthoOffCenterLHToRef(this._cascadeMinExtents[e].x, this._cascadeMaxExtents[e].x, this._cascadeMinExtents[e].y, this._cascadeMaxExtents[e].y, n, i, this._projectionMatrices[e]), this._cascadeMinExtents[e].z = n, this._cascadeMaxExtents[e].z = i, this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e], this._transformMatrices[e]), u.e.TransformCoordinatesToRef(S_, this._transformMatrices[e], mn), mn.scaleInPlace(this._mapSize / 2), Tr.copyFromFloats(Math.round(mn.x), Math.round(mn.y), Math.round(mn.z)), Tr.subtractInPlace(mn).scaleInPlace(2 / this._mapSize), u.a.TranslationToRef(Tr.x, Tr.y, 0, Er), this._projectionMatrices[e].multiplyToRef(Er, this._projectionMatrices[e]), this._viewMatrices[e].multiplyToRef(this._projectionMatrices[e], this._transformMatrices[e]), this._transformMatrices[e].copyToArray(this._transformMatricesAsArray, 16 * e);\n              }\n            }\n          }, t.prototype._computeFrustumInWorldSpace = function(e) {\n            if (this._scene.activeCamera) {\n              var n = this._cascades[e].prevBreakDistance, i = this._cascades[e].breakDistance;\n              this._scene.activeCamera.getViewMatrix();\n              for (var o = u.a.Invert(this._scene.activeCamera.getTransformationMatrix()), a = 0; a < t.frustumCornersNDCSpace.length; ++a)\n                u.e.TransformCoordinatesToRef(t.frustumCornersNDCSpace[a], o, this._frustumCornersWorldSpace[e][a]);\n              for (a = 0; a < t.frustumCornersNDCSpace.length / 2; ++a)\n                mn.copyFrom(this._frustumCornersWorldSpace[e][a + 4]).subtractInPlace(this._frustumCornersWorldSpace[e][a]), Tr.copyFrom(mn).scaleInPlace(n), mn.scaleInPlace(i), mn.addInPlace(this._frustumCornersWorldSpace[e][a]), this._frustumCornersWorldSpace[e][a + 4].copyFrom(mn), this._frustumCornersWorldSpace[e][a].addInPlace(Tr);\n            }\n          }, t.prototype._computeCascadeFrustum = function(e) {\n            if (this._cascadeMinExtents[e].copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE), this._cascadeMaxExtents[e].copyFromFloats(Number.MIN_VALUE, Number.MIN_VALUE, Number.MIN_VALUE), this._frustumCenter[e].copyFromFloats(0, 0, 0), this._scene.activeCamera) {\n              for (var n = 0; n < this._frustumCornersWorldSpace[e].length; ++n)\n                this._frustumCenter[e].addInPlace(this._frustumCornersWorldSpace[e][n]);\n              if (this._frustumCenter[e].scaleInPlace(1 / this._frustumCornersWorldSpace[e].length), this.stabilizeCascades) {\n                var i = 0;\n                for (n = 0; n < this._frustumCornersWorldSpace[e].length; ++n) {\n                  var o = this._frustumCornersWorldSpace[e][n].subtractToRef(this._frustumCenter[e], mn).length();\n                  i = Math.max(i, o);\n                }\n                i = Math.ceil(16 * i) / 16, this._cascadeMaxExtents[e].copyFromFloats(i, i, i), this._cascadeMinExtents[e].copyFromFloats(-i, -i, -i);\n              } else {\n                var a = this._frustumCenter[e];\n                for (this._frustumCenter[e].addToRef(this._lightDirection, mn), u.a.LookAtLHToRef(a, mn, Tu, Er), n = 0; n < this._frustumCornersWorldSpace[e].length; ++n)\n                  u.e.TransformCoordinatesToRef(this._frustumCornersWorldSpace[e][n], Er, mn), this._cascadeMinExtents[e].minimizeInPlace(mn), this._cascadeMaxExtents[e].maximizeInPlace(mn);\n              }\n            }\n          }, Object.defineProperty(t, \"IsSupported\", { get: function() {\n            var e = te.a.LastCreatedEngine;\n            return !!e && e.webGLVersion != 1;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initializeGenerator = function() {\n            var e, n, i, o, a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe;\n            this.penumbraDarkness = (e = this.penumbraDarkness) !== null && e !== void 0 ? e : 1, this._numCascades = (n = this._numCascades) !== null && n !== void 0 ? n : t.DEFAULT_CASCADES_COUNT, this.stabilizeCascades = (i = this.stabilizeCascades) !== null && i !== void 0 && i, this._freezeShadowCastersBoundingInfoObservable = (o = this._freezeShadowCastersBoundingInfoObservable) !== null && o !== void 0 ? o : null, this.freezeShadowCastersBoundingInfo = (a = this.freezeShadowCastersBoundingInfo) !== null && a !== void 0 && a, this._scbiMin = (s = this._scbiMin) !== null && s !== void 0 ? s : new u.e(0, 0, 0), this._scbiMax = (d = this._scbiMax) !== null && d !== void 0 ? d : new u.e(0, 0, 0), this._shadowCastersBoundingInfo = (p = this._shadowCastersBoundingInfo) !== null && p !== void 0 ? p : new Ii.a(new u.e(0, 0, 0), new u.e(0, 0, 0)), this._breaksAreDirty = (y = this._breaksAreDirty) === null || y === void 0 || y, this._minDistance = (P = this._minDistance) !== null && P !== void 0 ? P : 0, this._maxDistance = (R = this._maxDistance) !== null && R !== void 0 ? R : 1, this._currentLayer = (B = this._currentLayer) !== null && B !== void 0 ? B : 0, this._shadowMaxZ = (J = (F = this._shadowMaxZ) !== null && F !== void 0 ? F : (z = this._scene.activeCamera) === null || z === void 0 ? void 0 : z.maxZ) !== null && J !== void 0 ? J : 1e4, this._debug = (ie = this._debug) !== null && ie !== void 0 && ie, this._depthClamp = (se = this._depthClamp) === null || se === void 0 || se, this._cascadeBlendPercentage = (ce = this._cascadeBlendPercentage) !== null && ce !== void 0 ? ce : 0.1, this._lambda = (ue = this._lambda) !== null && ue !== void 0 ? ue : 0.5, this._autoCalcDepthBounds = (fe = this._autoCalcDepthBounds) !== null && fe !== void 0 && fe, r.prototype._initializeGenerator.call(this);\n          }, t.prototype._createTargetRenderTexture = function() {\n            var e = { width: this._mapSize, height: this._mapSize, layers: this.numCascades };\n            this._shadowMap = new on(this._light.name + \"_shadowMap\", e, this._scene, !1, !0, this._textureType, !1, void 0, !1, !1, void 0), this._shadowMap.createDepthStencilTexture(h.a.LESS, !0);\n          }, t.prototype._initializeShadowMap = function() {\n            var e = this;\n            if (r.prototype._initializeShadowMap.call(this), this._shadowMap !== null) {\n              this._transformMatricesAsArray = new Float32Array(16 * this._numCascades), this._viewSpaceFrustumsZ = new Array(this._numCascades), this._frustumLengths = new Array(this._numCascades), this._lightSizeUVCorrection = new Array(2 * this._numCascades), this._depthCorrection = new Array(this._numCascades), this._cascades = [], this._viewMatrices = [], this._projectionMatrices = [], this._transformMatrices = [], this._cascadeMinExtents = [], this._cascadeMaxExtents = [], this._frustumCenter = [], this._shadowCameraPos = [], this._frustumCornersWorldSpace = [];\n              for (var n = 0; n < this._numCascades; ++n) {\n                this._cascades[n] = { prevBreakDistance: 0, breakDistance: 0 }, this._viewMatrices[n] = u.a.Zero(), this._projectionMatrices[n] = u.a.Zero(), this._transformMatrices[n] = u.a.Zero(), this._cascadeMinExtents[n] = new u.e(), this._cascadeMaxExtents[n] = new u.e(), this._frustumCenter[n] = new u.e(), this._shadowCameraPos[n] = new u.e(), this._frustumCornersWorldSpace[n] = new Array(t.frustumCornersNDCSpace.length);\n                for (var i = 0; i < t.frustumCornersNDCSpace.length; ++i)\n                  this._frustumCornersWorldSpace[n][i] = new u.e();\n              }\n              this._shadowMap.onBeforeRenderObservable.add(function(o) {\n                if (e._currentLayer = o, e._scene.getSceneUniformBuffer().useUbo) {\n                  var a = e._scene.getSceneUniformBuffer();\n                  a.updateMatrix(\"viewProjection\", e.getCascadeTransformMatrix(o)), a.updateMatrix(\"view\", e.getCascadeViewMatrix(o)), a.update();\n                }\n              }), this._shadowMap.onBeforeBindObservable.add(function() {\n                e._breaksAreDirty && e._splitFrustum(), e._computeMatrices();\n              }), this._splitFrustum();\n            }\n          }, t.prototype._bindCustomEffectForRenderSubMeshForShadowMap = function(e, n, i, o) {\n            var a, s, d, p, y, P;\n            n.setMatrix((a = i == null ? void 0 : i.viewProjection) !== null && a !== void 0 ? a : \"viewProjection\", this.getCascadeTransformMatrix(this._currentLayer)), n.setMatrix((s = i == null ? void 0 : i.view) !== null && s !== void 0 ? s : \"view\", this.getCascadeViewMatrix(this._currentLayer)), n.setMatrix((d = i == null ? void 0 : i.projection) !== null && d !== void 0 ? d : \"projection\", this.getCascadeProjectionMatrix(this._currentLayer));\n            var R = o.getWorldMatrix();\n            n.setMatrix((p = i == null ? void 0 : i.world) !== null && p !== void 0 ? p : \"world\", R), R.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer), Er), n.setMatrix((y = i == null ? void 0 : i.worldViewProjection) !== null && y !== void 0 ? y : \"worldViewProjection\", Er), R.multiplyToRef(this.getCascadeViewMatrix(this._currentLayer), Eu), n.setMatrix((P = i == null ? void 0 : i.worldView) !== null && P !== void 0 ? P : \"worldView\", Eu);\n          }, t.prototype._isReadyCustomDefines = function(e, n, i) {\n            e.push(\"#define SM_DEPTHCLAMP \" + (this._depthClamp && this._filter !== Fn.FILTER_PCSS ? \"1\" : \"0\"));\n          }, t.prototype.prepareDefines = function(e, n) {\n            r.prototype.prepareDefines.call(this, e, n);\n            var i = this._scene, o = this._light;\n            if (i.shadowsEnabled && o.shadowEnabled) {\n              e[\"SHADOWCSM\" + n] = !0, e[\"SHADOWCSMDEBUG\" + n] = this.debug, e[\"SHADOWCSMNUM_CASCADES\" + n] = this.numCascades, e[\"SHADOWCSM_RIGHTHANDED\" + n] = i.useRightHandedSystem;\n              var a = i.activeCamera;\n              a && this._shadowMaxZ < a.maxZ && (e[\"SHADOWCSMUSESHADOWMAXZ\" + n] = !0), this.cascadeBlendPercentage === 0 && (e[\"SHADOWCSMNOBLEND\" + n] = !0);\n            }\n          }, t.prototype.bindShadowLight = function(e, n) {\n            var i = this._light, o = this._scene;\n            if (o.shadowsEnabled && i.shadowEnabled) {\n              var a = o.activeCamera;\n              if (a) {\n                var s = this.getShadowMap();\n                if (s) {\n                  var d = s.getSize().width;\n                  if (n.setMatrices(\"lightMatrix\" + e, this._transformMatricesAsArray), n.setArray(\"viewFrustumZ\" + e, this._viewSpaceFrustumsZ), n.setFloat(\"cascadeBlendFactor\" + e, this.cascadeBlendPercentage === 0 ? 1e4 : 1 / this.cascadeBlendPercentage), n.setArray(\"frustumLengths\" + e, this._frustumLengths), this._filter === Fn.FILTER_PCF)\n                    n.setDepthStencilTexture(\"shadowSampler\" + e, s), i._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), d, 1 / d, this.frustumEdgeFalloff, e);\n                  else if (this._filter === Fn.FILTER_PCSS) {\n                    for (var p = 0; p < this._numCascades; ++p)\n                      this._lightSizeUVCorrection[2 * p + 0] = p === 0 ? 1 : (this._cascadeMaxExtents[0].x - this._cascadeMinExtents[0].x) / (this._cascadeMaxExtents[p].x - this._cascadeMinExtents[p].x), this._lightSizeUVCorrection[2 * p + 1] = p === 0 ? 1 : (this._cascadeMaxExtents[0].y - this._cascadeMinExtents[0].y) / (this._cascadeMaxExtents[p].y - this._cascadeMinExtents[p].y), this._depthCorrection[p] = p === 0 ? 1 : (this._cascadeMaxExtents[p].z - this._cascadeMinExtents[p].z) / (this._cascadeMaxExtents[0].z - this._cascadeMinExtents[0].z);\n                    n.setDepthStencilTexture(\"shadowSampler\" + e, s), n.setTexture(\"depthSampler\" + e, s), n.setArray2(\"lightSizeUVCorrection\" + e, this._lightSizeUVCorrection), n.setArray(\"depthCorrection\" + e, this._depthCorrection), n.setFloat(\"penumbraDarkness\" + e, this.penumbraDarkness), i._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), 1 / d, this._contactHardeningLightSizeUVRatio * d, this.frustumEdgeFalloff, e);\n                  } else\n                    n.setTexture(\"shadowSampler\" + e, s), i._uniformBuffer.updateFloat4(\"shadowsInfo\", this.getDarkness(), d, 1 / d, this.frustumEdgeFalloff, e);\n                  i._uniformBuffer.updateFloat2(\"depthValues\", this.getLight().getDepthMinZ(a), this.getLight().getDepthMinZ(a) + this.getLight().getDepthMaxZ(a), e);\n                }\n              }\n            }\n          }, t.prototype.getTransformMatrix = function() {\n            return this.getCascadeTransformMatrix(0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._freezeShadowCastersBoundingInfoObservable && (this._scene.onBeforeRenderObservable.remove(this._freezeShadowCastersBoundingInfoObservable), this._freezeShadowCastersBoundingInfoObservable = null), this._depthReducer && (this._depthReducer.dispose(), this._depthReducer = null);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this), n = this.getShadowMap();\n            if (!n)\n              return e;\n            if (e.numCascades = this._numCascades, e.debug = this._debug, e.stabilizeCascades = this.stabilizeCascades, e.lambda = this._lambda, e.cascadeBlendPercentage = this.cascadeBlendPercentage, e.depthClamp = this._depthClamp, e.autoCalcDepthBounds = this.autoCalcDepthBounds, e.shadowMaxZ = this._shadowMaxZ, e.penumbraDarkness = this.penumbraDarkness, e.freezeShadowCastersBoundingInfo = this._freezeShadowCastersBoundingInfo, e.minDistance = this.minDistance, e.maxDistance = this.maxDistance, e.renderList = [], n.renderList)\n              for (var i = 0; i < n.renderList.length; i++) {\n                var o = n.renderList[i];\n                e.renderList.push(o.id);\n              }\n            return e;\n          }, t.Parse = function(e, n) {\n            var i = Fn.Parse(e, n, function(o, a) {\n              return new t(o, a);\n            });\n            return e.numCascades !== void 0 && (i.numCascades = e.numCascades), e.debug !== void 0 && (i.debug = e.debug), e.stabilizeCascades !== void 0 && (i.stabilizeCascades = e.stabilizeCascades), e.lambda !== void 0 && (i.lambda = e.lambda), e.cascadeBlendPercentage !== void 0 && (i.cascadeBlendPercentage = e.cascadeBlendPercentage), e.depthClamp !== void 0 && (i.depthClamp = e.depthClamp), e.autoCalcDepthBounds !== void 0 && (i.autoCalcDepthBounds = e.autoCalcDepthBounds), e.shadowMaxZ !== void 0 && (i.shadowMaxZ = e.shadowMaxZ), e.penumbraDarkness !== void 0 && (i.penumbraDarkness = e.penumbraDarkness), e.freezeShadowCastersBoundingInfo !== void 0 && (i.freezeShadowCastersBoundingInfo = e.freezeShadowCastersBoundingInfo), e.minDistance !== void 0 && e.maxDistance !== void 0 && i.setMinMaxDistance(e.minDistance, e.maxDistance), i;\n          }, t.frustumCornersNDCSpace = [new u.e(-1, 1, -1), new u.e(1, 1, -1), new u.e(1, -1, -1), new u.e(-1, -1, -1), new u.e(-1, 1, 1), new u.e(1, 1, 1), new u.e(1, -1, 1), new u.e(-1, -1, 1)], t.CLASSNAME = \"CascadedShadowGenerator\", t.DEFAULT_CASCADES_COUNT = 4, t.MIN_CASCADES_COUNT = 2, t.MAX_CASCADES_COUNT = 4, t._SceneComponentInitialization = function(e) {\n            throw En.a.WarnImport(\"ShadowGeneratorSceneComponent\");\n          }, t;\n        }(Fn);\n        V.a.AddParser(ot.a.NAME_SHADOWGENERATOR, function(r, t) {\n          if (r.shadowGenerators !== void 0 && r.shadowGenerators !== null)\n            for (var e = 0, n = r.shadowGenerators.length; e < n; e++) {\n              var i = r.shadowGenerators[e];\n              i.className === Ds.CLASSNAME ? Ds.Parse(i, t) : Fn.Parse(i, t);\n            }\n        });\n        var Su = function() {\n          function r(t) {\n            this.name = ot.a.NAME_SHADOWGENERATOR, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_SHADOWGENERATOR, this, this._gatherRenderTargets);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.serialize = function(t) {\n            t.shadowGenerators = [];\n            for (var e = 0, n = this.scene.lights; e < n.length; e++) {\n              var i = n[e].getShadowGenerator();\n              i && t.shadowGenerators.push(i.serialize());\n            }\n          }, r.prototype.addFromContainer = function(t) {\n          }, r.prototype.removeFromContainer = function(t, e) {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._gatherRenderTargets = function(t) {\n            var e = this.scene;\n            if (this.scene.shadowsEnabled)\n              for (var n = 0; n < e.lights.length; n++) {\n                var i = e.lights[n], o = i.getShadowGenerator();\n                if (i.isEnabled() && i.shadowEnabled && o) {\n                  var a = o.getShadowMap();\n                  e.textures.indexOf(a) !== -1 && t.push(a);\n                }\n              }\n          }, r;\n        }();\n        Fn._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_SHADOWGENERATOR);\n          t || (t = new Su(r), r._addComponent(t));\n        }, Q.a.AddNodeConstructor(\"Light_Type_0\", function(r, t) {\n          return function() {\n            return new Ls(r, u.e.Zero(), t);\n          };\n        });\n        var Ls = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, i) || this;\n            return o._shadowAngle = Math.PI / 2, o.position = n, o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"shadowAngle\", { get: function() {\n            return this._shadowAngle;\n          }, set: function(e) {\n            this._shadowAngle = e, this.forceProjectionMatrixCompute();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._direction;\n          }, set: function(e) {\n            var n = this.needCube();\n            this._direction = e, this.needCube() !== n && this._shadowGenerator && this._shadowGenerator.recreateShadowMap();\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PointLight\";\n          }, t.prototype.getTypeID = function() {\n            return bi.a.LIGHTTYPEID_POINTLIGHT;\n          }, t.prototype.needCube = function() {\n            return !this.direction;\n          }, t.prototype.getShadowDirection = function(e) {\n            if (this.direction)\n              return r.prototype.getShadowDirection.call(this, e);\n            switch (e) {\n              case 0:\n                return new u.e(1, 0, 0);\n              case 1:\n                return new u.e(-1, 0, 0);\n              case 2:\n                return new u.e(0, -1, 0);\n              case 3:\n                return new u.e(0, 1, 0);\n              case 4:\n                return new u.e(0, 0, 1);\n              case 5:\n                return new u.e(0, 0, -1);\n            }\n            return u.e.Zero();\n          }, t.prototype._setDefaultShadowProjectionMatrix = function(e, n, i) {\n            var o = this.getScene().activeCamera;\n            o && u.a.PerspectiveFovLHToRef(this.shadowAngle, 1, this.getDepthMinZ(o), this.getDepthMaxZ(o), e);\n          }, t.prototype._buildUniformLayout = function() {\n            this._uniformBuffer.addUniform(\"vLightData\", 4), this._uniformBuffer.addUniform(\"vLightDiffuse\", 4), this._uniformBuffer.addUniform(\"vLightSpecular\", 4), this._uniformBuffer.addUniform(\"vLightFalloff\", 4), this._uniformBuffer.addUniform(\"shadowsInfo\", 3), this._uniformBuffer.addUniform(\"depthValues\", 2), this._uniformBuffer.create();\n          }, t.prototype.transferToEffect = function(e, n) {\n            return this.computeTransformedInformation() ? this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z, 0, n) : this._uniformBuffer.updateFloat4(\"vLightData\", this.position.x, this.position.y, this.position.z, 0, n), this._uniformBuffer.updateFloat4(\"vLightFalloff\", this.range, this._inverseSquaredRange, 0, 0, n), this;\n          }, t.prototype.transferToNodeMaterialEffect = function(e, n) {\n            return this.computeTransformedInformation() ? e.setFloat3(n, this.transformedPosition.x, this.transformedPosition.y, this.transformedPosition.z) : e.setFloat3(n, this.position.x, this.position.y, this.position.z), this;\n          }, t.prototype.prepareLightSpecificDefines = function(e, n) {\n            e[\"POINTLIGHT\" + n] = !0;\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"shadowAngle\", null), t;\n        }(ko), Au = function() {\n          function r(t, e, n) {\n            var i = this;\n            e === void 0 && (e = \"\"), n === void 0 && (n = \"black\"), this._renderingCanvas = t, this._loadingText = e, this._loadingDivBackgroundColor = n, this._resizeLoadingUI = function() {\n              var o = i._renderingCanvas.getBoundingClientRect(), a = window.getComputedStyle(i._renderingCanvas).position;\n              i._loadingDiv && (i._loadingDiv.style.position = a === \"fixed\" ? \"fixed\" : \"absolute\", i._loadingDiv.style.left = o.left + \"px\", i._loadingDiv.style.top = o.top + \"px\", i._loadingDiv.style.width = o.width + \"px\", i._loadingDiv.style.height = o.height + \"px\");\n            };\n          }\n          return r.prototype.displayLoadingUI = function() {\n            if (!this._loadingDiv) {\n              this._loadingDiv = document.createElement(\"div\"), this._loadingDiv.id = \"babylonjsLoadingDiv\", this._loadingDiv.style.opacity = \"0\", this._loadingDiv.style.transition = \"opacity 1.5s ease\", this._loadingDiv.style.pointerEvents = \"none\", this._loadingDiv.style.display = \"grid\", this._loadingDiv.style.gridTemplateRows = \"100%\", this._loadingDiv.style.gridTemplateColumns = \"100%\", this._loadingDiv.style.justifyItems = \"center\", this._loadingDiv.style.alignItems = \"center\", this._loadingTextDiv = document.createElement(\"div\"), this._loadingTextDiv.style.position = \"absolute\", this._loadingTextDiv.style.left = \"0\", this._loadingTextDiv.style.top = \"50%\", this._loadingTextDiv.style.marginTop = \"80px\", this._loadingTextDiv.style.width = \"100%\", this._loadingTextDiv.style.height = \"20px\", this._loadingTextDiv.style.fontFamily = \"Arial\", this._loadingTextDiv.style.fontSize = \"14px\", this._loadingTextDiv.style.color = \"white\", this._loadingTextDiv.style.textAlign = \"center\", this._loadingTextDiv.style.zIndex = \"1\", this._loadingTextDiv.innerHTML = \"Loading\", this._loadingDiv.appendChild(this._loadingTextDiv), this._loadingTextDiv.innerHTML = this._loadingText;\n              var t = document.createElement(\"style\");\n              t.type = \"text/css\", t.innerHTML = `@-webkit-keyframes spin1 {                    0% { -webkit-transform: rotate(0deg);}\n                    100% { -webkit-transform: rotate(360deg);}\n                }                @keyframes spin1 {                    0% { transform: rotate(0deg);}\n                    100% { transform: rotate(360deg);}\n                }`, document.getElementsByTagName(\"head\")[0].appendChild(t);\n              var e = !!window.SVGSVGElement, n = new Image();\n              r.DefaultLogoUrl ? n.src = r.DefaultLogoUrl : n.src = e ? \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODAuMTcgMjA4LjA0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6I2UwNjg0Yjt9LmNscy0ze2ZpbGw6I2JiNDY0Yjt9LmNscy00e2ZpbGw6I2UwZGVkODt9LmNscy01e2ZpbGw6I2Q1ZDJjYTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPkJhYnlsb25Mb2dvPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iUGFnZV9FbGVtZW50cyIgZGF0YS1uYW1lPSJQYWdlIEVsZW1lbnRzIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik05MC4wOSwwLDAsNTJWMTU2bDkwLjA5LDUyLDkwLjA4LTUyVjUyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxODAuMTcgNTIuMDEgMTUxLjk3IDM1LjczIDEyNC44NSA1MS4zOSAxNTMuMDUgNjcuNjcgMTgwLjE3IDUyLjAxIi8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjI3LjEyIDY3LjY3IDExNy4yMSAxNS42NiA5MC4wOCAwIDAgNTIuMDEgMjcuMTIgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iNjEuODkgMTIwLjMgOTAuMDggMTM2LjU4IDExOC4yOCAxMjAuMyA5MC4wOCAxMDQuMDIgNjEuODkgMTIwLjMiLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDE1My4wNSAxNDAuMzcgOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyAwIDUyLjAxIDAgMTU2LjAzIDkwLjA4IDIwOC4wNCAxODAuMTcgMTU2LjAzIDE4MC4xNyA1Mi4wMSAxNTMuMDUgNjcuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTMiIHBvaW50cz0iOTAuMDggNzEuNDYgNjEuODkgODcuNzQgNjEuODkgMTIwLjMgOTAuMDggMTA0LjAyIDExOC4yOCAxMjAuMyAxMTguMjggODcuNzQgOTAuMDggNzEuNDYiLz48cG9seWdvbiBjbGFzcz0iY2xzLTQiIHBvaW50cz0iMTUzLjA1IDY3LjY3IDExOC4yOCA4Ny43NCAxMTguMjggMTIwLjMgOTAuMDggMTM2LjU4IDkwLjA4IDE3Ni43MiAxNTMuMDUgMTQwLjM3IDE1My4wNSA2Ny42NyIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNSIgcG9pbnRzPSIyNy4xMiA2Ny42NyA2MS44OSA4Ny43NCA2MS44OSAxMjAuMyA5MC4wOCAxMzYuNTggOTAuMDggMTc2LjcyIDI3LjEyIDE0MC4zNyAyNy4xMiA2Ny42NyIvPjwvZz48L2c+PC9zdmc+\" : \"https://cdn.babylonjs.com/Assets/babylonLogo.png\", n.style.width = \"150px\", n.style.gridColumn = \"1\", n.style.gridRow = \"1\", n.style.top = \"50%\", n.style.left = \"50%\", n.style.transform = \"translate(-50%, -50%)\", n.style.position = \"absolute\";\n              var i = document.createElement(\"div\");\n              i.style.width = \"300px\", i.style.gridColumn = \"1\", i.style.gridRow = \"1\", i.style.top = \"50%\", i.style.left = \"50%\", i.style.transform = \"translate(-50%, -50%)\", i.style.position = \"absolute\";\n              var o = new Image();\n              if (r.DefaultSpinnerUrl ? o.src = r.DefaultSpinnerUrl : o.src = e ? \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOTIgMzkyIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2UwNjg0Yjt9LmNscy0ye2ZpbGw6bm9uZTt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPlNwaW5uZXJJY29uPC90aXRsZT48ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIj48ZyBpZD0iU3Bpbm5lciI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNDAuMjEsMTI2LjQzYzMuNy03LjMxLDcuNjctMTQuNDQsMTItMjEuMzJsMy4zNi01LjEsMy41Mi01YzEuMjMtMS42MywyLjQxLTMuMjksMy42NS00LjkxczIuNTMtMy4yMSwzLjgyLTQuNzlBMTg1LjIsMTg1LjIsMCwwLDEsODMuNCw2Ny40M2EyMDgsMjA4LDAsMCwxLDE5LTE1LjY2YzMuMzUtMi40MSw2Ljc0LTQuNzgsMTAuMjUtN3M3LjExLTQuMjgsMTAuNzUtNi4zMmM3LjI5LTQsMTQuNzMtOCwyMi41My0xMS40OSwzLjktMS43Miw3Ljg4LTMuMywxMi00LjY0YTEwNC4yMiwxMDQuMjIsMCwwLDEsMTIuNDQtMy4yMyw2Mi40NCw2Mi40NCwwLDAsMSwxMi43OC0xLjM5QTI1LjkyLDI1LjkyLDAsMCwxLDE5NiwyMS40NGE2LjU1LDYuNTUsMCwwLDEsMi4wNSw5LDYuNjYsNi42NiwwLDAsMS0xLjY0LDEuNzhsLS40MS4yOWEyMi4wNywyMi4wNywwLDAsMS01Ljc4LDMsMzAuNDIsMzAuNDIsMCwwLDEtNS42NywxLjYyLDM3LjgyLDM3LjgyLDAsMCwxLTUuNjkuNzFjLTEsMC0xLjkuMTgtMi44NS4yNmwtMi44NS4yNHEtNS43Mi41MS0xMS40OCwxLjFjLTMuODQuNC03LjcxLjgyLTExLjU4LDEuNGExMTIuMzQsMTEyLjM0LDAsMCwwLTIyLjk0LDUuNjFjLTMuNzIsMS4zNS03LjM0LDMtMTAuOTQsNC42NHMtNy4xNCwzLjUxLTEwLjYsNS41MUExNTEuNiwxNTEuNiwwLDAsMCw2OC41Niw4N0M2Ny4yMyw4OC40OCw2Niw5MCw2NC42NCw5MS41NnMtMi41MSwzLjE1LTMuNzUsNC43M2wtMy41NCw0LjljLTEuMTMsMS42Ni0yLjIzLDMuMzUtMy4zMyw1YTEyNywxMjcsMCwwLDAtMTAuOTMsMjEuNDksMS41OCwxLjU4LDAsMSwxLTMtMS4xNVM0MC4xOSwxMjYuNDcsNDAuMjEsMTI2LjQzWiIvPjxyZWN0IGNsYXNzPSJjbHMtMiIgd2lkdGg9IjM5MiIgaGVpZ2h0PSIzOTIiLz48L2c+PC9nPjwvc3ZnPg==\" : \"https://cdn.babylonjs.com/Assets/loadingIcon.png\", o.style.animation = \"spin1 0.75s infinite linear\", o.style.webkitAnimation = \"spin1 0.75s infinite linear\", o.style.transformOrigin = \"50% 50%\", o.style.webkitTransformOrigin = \"50% 50%\", !e) {\n                var a = { w: 16, h: 18.5 }, s = { w: 30, h: 30 };\n                n.style.width = a.w + \"vh\", n.style.height = a.h + \"vh\", n.style.left = \"calc(50% - \" + a.w / 2 + \"vh)\", n.style.top = \"calc(50% - \" + a.h / 2 + \"vh)\", o.style.width = s.w + \"vh\", o.style.height = s.h + \"vh\", o.style.left = \"calc(50% - \" + s.w / 2 + \"vh)\", o.style.top = \"calc(50% - \" + s.h / 2 + \"vh)\";\n              }\n              i.appendChild(o), this._loadingDiv.appendChild(n), this._loadingDiv.appendChild(i), this._resizeLoadingUI(), window.addEventListener(\"resize\", this._resizeLoadingUI), this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor, document.body.appendChild(this._loadingDiv), this._loadingDiv.style.opacity = \"1\";\n            }\n          }, r.prototype.hideLoadingUI = function() {\n            var t = this;\n            this._loadingDiv && (this._loadingDiv.style.opacity = \"0\", this._loadingDiv.addEventListener(\"transitionend\", function() {\n              t._loadingDiv && (t._loadingDiv.parentElement && t._loadingDiv.parentElement.removeChild(t._loadingDiv), window.removeEventListener(\"resize\", t._resizeLoadingUI), t._loadingDiv = null);\n            }));\n          }, Object.defineProperty(r.prototype, \"loadingUIText\", { get: function() {\n            return this._loadingText;\n          }, set: function(t) {\n            this._loadingText = t, this._loadingTextDiv && (this._loadingTextDiv.innerHTML = this._loadingText);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"loadingUIBackgroundColor\", { get: function() {\n            return this._loadingDivBackgroundColor;\n          }, set: function(t) {\n            this._loadingDivBackgroundColor = t, this._loadingDiv && (this._loadingDiv.style.backgroundColor = this._loadingDivBackgroundColor);\n          }, enumerable: !1, configurable: !0 }), r.DefaultLogoUrl = \"\", r.DefaultSpinnerUrl = \"\", r;\n        }();\n        Ue.a.DefaultLoadingScreenFactory = function(r) {\n          return new Au(r);\n        };\n        var Ns = f(71), qi = f(68), ws = function() {\n          function r() {\n          }\n          return r.ConvertPanoramaToCubemap = function(t, e, n, i) {\n            if (!t)\n              throw \"ConvertPanoramaToCubemap: input cannot be null\";\n            if (t.length != e * n * 3)\n              throw \"ConvertPanoramaToCubemap: input size is wrong\";\n            return { front: this.CreateCubemapTexture(i, this.FACE_FRONT, t, e, n), back: this.CreateCubemapTexture(i, this.FACE_BACK, t, e, n), left: this.CreateCubemapTexture(i, this.FACE_LEFT, t, e, n), right: this.CreateCubemapTexture(i, this.FACE_RIGHT, t, e, n), up: this.CreateCubemapTexture(i, this.FACE_UP, t, e, n), down: this.CreateCubemapTexture(i, this.FACE_DOWN, t, e, n), size: i, type: h.a.TEXTURETYPE_FLOAT, format: h.a.TEXTUREFORMAT_RGB, gammaSpace: !1 };\n          }, r.CreateCubemapTexture = function(t, e, n, i, o) {\n            for (var a = new ArrayBuffer(t * t * 4 * 3), s = new Float32Array(a), d = e[1].subtract(e[0]).scale(1 / t), p = e[3].subtract(e[2]).scale(1 / t), y = 1 / t, P = 0, R = 0; R < t; R++) {\n              for (var B = e[0], F = e[2], z = 0; z < t; z++) {\n                var J = F.subtract(B).scale(P).add(B);\n                J.normalize();\n                var ie = this.CalcProjectionSpherical(J, n, i, o);\n                s[R * t * 3 + 3 * z + 0] = ie.r, s[R * t * 3 + 3 * z + 1] = ie.g, s[R * t * 3 + 3 * z + 2] = ie.b, B = B.add(d), F = F.add(p);\n              }\n              P += y;\n            }\n            return s;\n          }, r.CalcProjectionSpherical = function(t, e, n, i) {\n            for (var o = Math.atan2(t.z, t.x), a = Math.acos(t.y); o < -Math.PI; )\n              o += 2 * Math.PI;\n            for (; o > Math.PI; )\n              o -= 2 * Math.PI;\n            var s = o / Math.PI, d = a / Math.PI;\n            s = 0.5 * s + 0.5;\n            var p = Math.round(s * n);\n            p < 0 ? p = 0 : p >= n && (p = n - 1);\n            var y = Math.round(d * i);\n            y < 0 ? y = 0 : y >= i && (y = i - 1);\n            var P = i - y - 1;\n            return { r: e[P * n * 3 + 3 * p + 0], g: e[P * n * 3 + 3 * p + 1], b: e[P * n * 3 + 3 * p + 2] };\n          }, r.FACE_LEFT = [new u.e(-1, -1, -1), new u.e(1, -1, -1), new u.e(-1, 1, -1), new u.e(1, 1, -1)], r.FACE_RIGHT = [new u.e(1, -1, 1), new u.e(-1, -1, 1), new u.e(1, 1, 1), new u.e(-1, 1, 1)], r.FACE_FRONT = [new u.e(1, -1, -1), new u.e(1, -1, 1), new u.e(1, 1, -1), new u.e(1, 1, 1)], r.FACE_BACK = [new u.e(-1, -1, 1), new u.e(-1, -1, -1), new u.e(-1, 1, 1), new u.e(-1, 1, -1)], r.FACE_DOWN = [new u.e(1, 1, -1), new u.e(1, 1, 1), new u.e(-1, 1, -1), new u.e(-1, 1, 1)], r.FACE_UP = [new u.e(-1, -1, -1), new u.e(-1, -1, 1), new u.e(1, -1, -1), new u.e(1, -1, 1)], r;\n        }(), Pu = function() {\n          function r() {\n          }\n          return r.Ldexp = function(t, e) {\n            return e > 1023 ? t * Math.pow(2, 1023) * Math.pow(2, e - 1023) : e < -1074 ? t * Math.pow(2, -1074) * Math.pow(2, e + 1074) : t * Math.pow(2, e);\n          }, r.Rgbe2float = function(t, e, n, i, o, a) {\n            o > 0 ? (o = this.Ldexp(1, o - 136), t[a + 0] = e * o, t[a + 1] = n * o, t[a + 2] = i * o) : (t[a + 0] = 0, t[a + 1] = 0, t[a + 2] = 0);\n          }, r.readStringLine = function(t, e) {\n            for (var n = \"\", i = \"\", o = e; o < t.length - e && (i = String.fromCharCode(t[o])) != `\n`; o++)\n              n += i;\n            return n;\n          }, r.RGBE_ReadHeader = function(t) {\n            var e, n, i = this.readStringLine(t, 0);\n            if (i[0] != \"#\" || i[1] != \"?\")\n              throw \"Bad HDR Format.\";\n            var o = !1, a = !1, s = 0;\n            do\n              s += i.length + 1, (i = this.readStringLine(t, s)) == \"FORMAT=32-bit_rle_rgbe\" ? a = !0 : i.length == 0 && (o = !0);\n            while (!o);\n            if (!a)\n              throw \"HDR Bad header format, unsupported FORMAT\";\n            s += i.length + 1, i = this.readStringLine(t, s);\n            var d = /^\\-Y (.*) \\+X (.*)$/g.exec(i);\n            if (!d || d.length < 3)\n              throw \"HDR Bad header format, no size\";\n            if (n = parseInt(d[2]), e = parseInt(d[1]), n < 8 || n > 32767)\n              throw \"HDR Bad header format, unsupported size\";\n            return { height: e, width: n, dataPosition: s += i.length + 1 };\n          }, r.GetCubeMapTextureData = function(t, e) {\n            var n = new Uint8Array(t), i = this.RGBE_ReadHeader(n), o = this.RGBE_ReadPixels(n, i);\n            return ws.ConvertPanoramaToCubemap(o, i.width, i.height, e);\n          }, r.RGBE_ReadPixels = function(t, e) {\n            return this.RGBE_ReadPixels_RLE(t, e);\n          }, r.RGBE_ReadPixels_RLE = function(t, e) {\n            for (var n, i, o, a, s, d = e.height, p = e.width, y = e.dataPosition, P = 0, R = 0, B = 0, F = new ArrayBuffer(4 * p), z = new Uint8Array(F), J = new ArrayBuffer(e.width * e.height * 4 * 3), ie = new Float32Array(J); d > 0; ) {\n              if (n = t[y++], i = t[y++], o = t[y++], a = t[y++], n != 2 || i != 2 || 128 & o || e.width < 8 || e.width > 32767)\n                return this.RGBE_ReadPixels_NOT_RLE(t, e);\n              if ((o << 8 | a) != p)\n                throw \"HDR Bad header format, wrong scan line width\";\n              for (P = 0, B = 0; B < 4; B++)\n                for (R = (B + 1) * p; P < R; )\n                  if (n = t[y++], i = t[y++], n > 128) {\n                    if ((s = n - 128) == 0 || s > R - P)\n                      throw \"HDR Bad Format, bad scanline data (run)\";\n                    for (; s-- > 0; )\n                      z[P++] = i;\n                  } else {\n                    if ((s = n) == 0 || s > R - P)\n                      throw \"HDR Bad Format, bad scanline data (non-run)\";\n                    if (z[P++] = i, --s > 0)\n                      for (var se = 0; se < s; se++)\n                        z[P++] = t[y++];\n                  }\n              for (B = 0; B < p; B++)\n                n = z[B], i = z[B + p], o = z[B + 2 * p], a = z[B + 3 * p], this.Rgbe2float(ie, n, i, o, a, (e.height - d) * p * 3 + 3 * B);\n              d--;\n            }\n            return ie;\n          }, r.RGBE_ReadPixels_NOT_RLE = function(t, e) {\n            for (var n, i, o, a, s, d = e.height, p = e.width, y = e.dataPosition, P = new ArrayBuffer(e.width * e.height * 4 * 3), R = new Float32Array(P); d > 0; ) {\n              for (s = 0; s < e.width; s++)\n                n = t[y++], i = t[y++], o = t[y++], a = t[y++], this.Rgbe2float(R, n, i, o, a, (e.height - d) * p * 3 + 3 * s);\n              d--;\n            }\n            return R;\n          }, r;\n        }(), xu = function() {\n          function r(t, e) {\n            var n;\n            e === void 0 && (e = r._DefaultOptions), this.engine = t, this._fullscreenViewport = new jn.a(0, 0, 1, 1), e = Object(c.a)(Object(c.a)({}, r._DefaultOptions), e), this._vertexBuffers = ((n = {})[Oe.b.PositionKind] = new Oe.b(t, e.positions, Oe.b.PositionKind, !1, !1, 2), n), this._indexBuffer = t.createIndexBuffer(e.indices);\n          }\n          return r.prototype.setViewport = function(t) {\n            t === void 0 && (t = this._fullscreenViewport), this.engine.setViewport(t);\n          }, r.prototype.bindBuffers = function(t) {\n            this.engine.bindBuffers(this._vertexBuffers, this._indexBuffer, t);\n          }, r.prototype.applyEffectWrapper = function(t) {\n            this.engine.depthCullingState.depthTest = !1, this.engine.stencilState.stencilTest = !1, this.engine.enableEffect(t.effect), this.bindBuffers(t.effect), t.onApplyObservable.notifyObservers({});\n          }, r.prototype.restoreStates = function() {\n            this.engine.depthCullingState.depthTest = !0, this.engine.stencilState.stencilTest = !0;\n          }, r.prototype.draw = function() {\n            this.engine.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, 6);\n          }, r.prototype.isRenderTargetTexture = function(t) {\n            return t.renderList !== void 0;\n          }, r.prototype.render = function(t, e) {\n            if (e === void 0 && (e = null), t.effect.isReady()) {\n              this.setViewport();\n              var n = e === null ? null : this.isRenderTargetTexture(e) ? e.getInternalTexture() : e;\n              n && this.engine.bindFramebuffer(n), this.applyEffectWrapper(t), this.draw(), n && this.engine.unBindFramebuffer(n), this.restoreStates();\n            }\n          }, r.prototype.dispose = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && (t.dispose(), delete this._vertexBuffers[Oe.b.PositionKind]), this._indexBuffer && this.engine._releaseBuffer(this._indexBuffer);\n          }, r._DefaultOptions = { positions: [1, 1, -1, 1, -1, -1, 1, -1], indices: [0, 1, 2, 0, 2, 3] }, r;\n        }(), Cu = function() {\n          function r(t) {\n            var e, n = this;\n            this.onApplyObservable = new C.c();\n            var i = t.uniformNames || [];\n            t.vertexShader ? e = { fragmentSource: t.fragmentShader, vertexSource: t.vertexShader, spectorName: t.name || \"effectWrapper\" } : (i.push(\"scale\"), e = { fragmentSource: t.fragmentShader, vertex: \"postprocess\", spectorName: t.name || \"effectWrapper\" }, this.onApplyObservable.add(function() {\n              n.effect.setFloat2(\"scale\", 1, 1);\n            }));\n            var o = t.defines ? t.defines.join(`\n`) : \"\";\n            t.useShaderStore ? (e.fragment = e.fragmentSource, e.vertex || (e.vertex = e.vertexSource), delete e.fragmentSource, delete e.vertexSource, this.effect = t.engine.createEffect(e.spectorName, t.attributeNames || [\"position\"], i, t.samplerNames, o, void 0, t.onCompiled)) : this.effect = new ze.a(e, t.attributeNames || [\"position\"], i, t.samplerNames, t.engine, o, void 0, t.onCompiled);\n          }\n          return r.prototype.dispose = function() {\n            this.effect.dispose();\n          }, r;\n        }(), A_ = `\nattribute vec2 position;\n\nvarying vec3 direction;\n\nuniform vec3 up;\nuniform vec3 right;\nuniform vec3 front;\nvoid main(void) {\nmat3 view=mat3(up,right,front);\ndirection=view*vec3(position,1.0);\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.hdrFilteringVertexShader = A_;\n        var P_ = `#include<helperFunctions>\n#include<importanceSampling>\n#include<pbrBRDFFunctions>\n#include<hdrFilteringFunctions>\nuniform float alphaG;\nuniform samplerCube inputTexture;\nuniform vec2 vFilteringInfo;\nuniform float hdrScale;\nvarying vec3 direction;\nvoid main() {\nvec3 color=radiance(alphaG,inputTexture,direction,vFilteringInfo);\ngl_FragColor=vec4(color*hdrScale,1.0);\n}`;\n        ze.a.ShadersStore.hdrFilteringPixelShader = P_;\n        var Ru = function() {\n          function r(t, e) {\n            e === void 0 && (e = {}), this._lodGenerationOffset = 0, this._lodGenerationScale = 0.8, this.quality = h.a.TEXTURE_FILTERING_QUALITY_OFFLINE, this.hdrScale = 1, this._engine = t, this.hdrScale = e.hdrScale || this.hdrScale, this.quality = e.hdrScale || this.quality;\n          }\n          return r.prototype._createRenderTarget = function(t) {\n            var e = h.a.TEXTURETYPE_UNSIGNED_BYTE;\n            this._engine.getCaps().textureHalfFloatRender ? e = h.a.TEXTURETYPE_HALF_FLOAT : this._engine.getCaps().textureFloatRender && (e = h.a.TEXTURETYPE_FLOAT);\n            var n = this._engine.createRenderTargetCubeTexture(t, { format: h.a.TEXTUREFORMAT_RGBA, type: e, generateMipMaps: !1, generateDepthBuffer: !1, generateStencilBuffer: !1, samplingMode: h.a.TEXTURE_NEAREST_SAMPLINGMODE });\n            return this._engine.updateTextureWrappingMode(n, h.a.TEXTURE_CLAMP_ADDRESSMODE, h.a.TEXTURE_CLAMP_ADDRESSMODE, h.a.TEXTURE_CLAMP_ADDRESSMODE), this._engine.updateTextureSamplingMode(h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, n, !0), n;\n          }, r.prototype._prefilterInternal = function(t) {\n            var e = t.getSize().width, n = Math.round($.a.Log2(e)) + 1, i = this._effectWrapper.effect, o = this._createRenderTarget(e);\n            this._effectRenderer.setViewport();\n            var a = t.getInternalTexture();\n            a && this._engine.updateTextureSamplingMode(h.a.TEXTURE_TRILINEAR_SAMPLINGMODE, a, !0), this._effectRenderer.applyEffectWrapper(this._effectWrapper);\n            var s = [[new u.e(0, 0, -1), new u.e(0, -1, 0), new u.e(1, 0, 0)], [new u.e(0, 0, 1), new u.e(0, -1, 0), new u.e(-1, 0, 0)], [new u.e(1, 0, 0), new u.e(0, 0, 1), new u.e(0, 1, 0)], [new u.e(1, 0, 0), new u.e(0, 0, -1), new u.e(0, -1, 0)], [new u.e(1, 0, 0), new u.e(0, -1, 0), new u.e(0, 0, 1)], [new u.e(-1, 0, 0), new u.e(0, -1, 0), new u.e(0, 0, -1)]];\n            i.setFloat(\"hdrScale\", this.hdrScale), i.setFloat2(\"vFilteringInfo\", t.getSize().width, n), i.setTexture(\"inputTexture\", t);\n            for (var d = 0; d < 6; d++) {\n              i.setVector3(\"up\", s[d][0]), i.setVector3(\"right\", s[d][1]), i.setVector3(\"front\", s[d][2]);\n              for (var p = 0; p < n; p++) {\n                this._engine.bindFramebuffer(o, d, void 0, void 0, !0, p), this._effectRenderer.applyEffectWrapper(this._effectWrapper);\n                var y = Math.pow(2, (p - this._lodGenerationOffset) / this._lodGenerationScale) / e;\n                p === 0 && (y = 0), i.setFloat(\"alphaG\", y), this._effectRenderer.draw();\n              }\n            }\n            return this._effectRenderer.restoreStates(), this._engine.restoreDefaultFramebuffer(), this._engine._releaseFramebufferObjects(o), this._engine._releaseTexture(t._texture), o._swapAndDie(t._texture), t._prefiltered = !0, t;\n          }, r.prototype._createEffect = function(t, e) {\n            var n = [];\n            return t.gammaSpace && n.push(\"#define GAMMA_INPUT\"), n.push(\"#define NUM_SAMPLES \" + this.quality + \"u\"), new Cu({ engine: this._engine, name: \"hdrFiltering\", vertexShader: \"hdrFiltering\", fragmentShader: \"hdrFiltering\", samplerNames: [\"inputTexture\"], uniformNames: [\"vSampleDirections\", \"vWeights\", \"up\", \"right\", \"front\", \"vFilteringInfo\", \"hdrScale\", \"alphaG\"], useShaderStore: !0, defines: n, onCompiled: e });\n          }, r.prototype.isReady = function(t) {\n            return t.isReady() && this._effectWrapper.effect.isReady();\n          }, r.prototype.prefilter = function(t, e) {\n            var n = this;\n            if (e === void 0 && (e = null), this._engine.webGLVersion !== 1)\n              return new Promise(function(i) {\n                n._effectRenderer = new xu(n._engine), n._effectWrapper = n._createEffect(t), n._effectWrapper.effect.executeWhenCompiled(function() {\n                  n._prefilterInternal(t), n._effectRenderer.dispose(), n._effectWrapper.dispose(), i(), e && e();\n                });\n              });\n            l.a.Warn(\"HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.\");\n          }, r;\n        }(), qo = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            var P;\n            o === void 0 && (o = !1), a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = !1), p === void 0 && (p = null), y === void 0 && (y = null);\n            var R = r.call(this, n) || this;\n            return R._generateHarmonics = !0, R._onLoad = null, R._onError = null, R._isBlocking = !0, R._rotationY = 0, R.boundingBoxPosition = u.e.Zero(), e && (R._coordinatesMode = Ne.a.CUBIC_MODE, R.name = e, R.url = e, R.hasAlpha = !1, R.isCube = !0, R._textureMatrix = u.a.Identity(), R._prefilterOnLoad = d, R._onLoad = p, R._onError = y, R.gammaSpace = s, R._noMipmap = o, R._size = i, R._generateHarmonics = a, R._texture = R._getFromCache(e, R._noMipmap), R._texture ? p && (R._texture.isReady ? Xe.b.SetImmediate(function() {\n              return p();\n            }) : R._texture.onLoadedObservable.add(p)) : !((P = R.getScene()) === null || P === void 0) && P.useDelayedTextureLoading ? R.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : R.loadTexture()), R;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"isBlocking\", { get: function() {\n            return this._isBlocking;\n          }, set: function(e) {\n            this._isBlocking = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rotationY\", { get: function() {\n            return this._rotationY;\n          }, set: function(e) {\n            this._rotationY = e, this.setReflectionTextureMatrix(u.a.RotationY(this._rotationY));\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"boundingBoxSize\", { get: function() {\n            return this._boundingBoxSize;\n          }, set: function(e) {\n            if (!this._boundingBoxSize || !this._boundingBoxSize.equals(e)) {\n              this._boundingBoxSize = e;\n              var n = this.getScene();\n              n && n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag);\n            }\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"HDRCubeTexture\";\n          }, t.prototype.loadTexture = function() {\n            var e = this, n = this._getEngine();\n            if (this._getEngine().webGLVersion >= 2 && this._prefilterOnLoad) {\n              var i = this._onLoad, o = new Ru(n);\n              this._onLoad = function() {\n                o.prefilter(e, i);\n              };\n            }\n            this._texture = n.createRawCubeTextureFromUrl(this.url, this.getScene(), this._size, h.a.TEXTUREFORMAT_RGB, n.getCaps().textureFloat ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INT, this._noMipmap, function(a) {\n              e.lodGenerationOffset = 0, e.lodGenerationScale = 0.8;\n              var s = Pu.GetCubeMapTextureData(a, e._size);\n              if (e._generateHarmonics) {\n                var d = Lo.ConvertCubeMapToSphericalPolynomial(s);\n                e.sphericalPolynomial = d;\n              }\n              for (var p = [], y = null, P = 0; P < 6; P++) {\n                if (!n.getCaps().textureFloat) {\n                  var R = new ArrayBuffer(e._size * e._size * 3);\n                  y = new Uint8Array(R);\n                }\n                var B = s[t._facesMapping[P]];\n                if (e.gammaSpace || y) {\n                  for (var F = 0; F < e._size * e._size; F++)\n                    if (e.gammaSpace && (B[3 * F + 0] = Math.pow(B[3 * F + 0], Vt.b), B[3 * F + 1] = Math.pow(B[3 * F + 1], Vt.b), B[3 * F + 2] = Math.pow(B[3 * F + 2], Vt.b)), y) {\n                      var z = Math.max(255 * B[3 * F + 0], 0), J = Math.max(255 * B[3 * F + 1], 0), ie = Math.max(255 * B[3 * F + 2], 0), se = Math.max(Math.max(z, J), ie);\n                      if (se > 255) {\n                        var ce = 255 / se;\n                        z *= ce, J *= ce, ie *= ce;\n                      }\n                      y[3 * F + 0] = z, y[3 * F + 1] = J, y[3 * F + 2] = ie;\n                    }\n                }\n                y ? p.push(y) : p.push(B);\n              }\n              return p;\n            }, null, this._onLoad, this._onError);\n          }, t.prototype.clone = function() {\n            var e = new t(this.url, this.getScene() || this._getEngine(), this._size, this._noMipmap, this._generateHarmonics, this.gammaSpace);\n            return e.level = this.level, e.wrapU = this.wrapU, e.wrapV = this.wrapV, e.coordinatesIndex = this.coordinatesIndex, e.coordinatesMode = this.coordinatesMode, e;\n          }, t.prototype.delayLoad = function() {\n            this.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = h.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, this._noMipmap), this._texture || this.loadTexture());\n          }, t.prototype.getReflectionTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.setReflectionTextureMatrix = function(e) {\n            var n, i = this;\n            this._textureMatrix = e, e.updateFlag !== this._textureMatrix.updateFlag && e.isIdentity() !== this._textureMatrix.isIdentity() && ((n = this.getScene()) === null || n === void 0 || n.markAllMaterialsAsDirty(h.a.MATERIAL_TextureDirtyFlag, function(o) {\n              return o.getActiveTextures().indexOf(i) !== -1;\n            }));\n          }, t.Parse = function(e, n, i) {\n            var o = null;\n            return e.name && !e.isRenderTarget && ((o = new t(i + e.name, n, e.size, e.noMipmap, e.generateHarmonics, e.useInGammaSpace)).name = e.name, o.hasAlpha = e.hasAlpha, o.level = e.level, o.coordinatesMode = e.coordinatesMode, o.isBlocking = e.isBlocking), o && (e.boundingBoxPosition && (o.boundingBoxPosition = u.e.FromArray(e.boundingBoxPosition)), e.boundingBoxSize && (o.boundingBoxSize = u.e.FromArray(e.boundingBoxSize)), e.rotationY && (o.rotationY = e.rotationY)), o;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = {};\n            return e.name = this.name, e.hasAlpha = this.hasAlpha, e.isCube = !0, e.level = this.level, e.size = this._size, e.coordinatesMode = this.coordinatesMode, e.useInGammaSpace = this.gammaSpace, e.generateHarmonics = this._generateHarmonics, e.customType = \"BABYLON.HDRCubeTexture\", e.noMipmap = this._noMipmap, e.isBlocking = this._isBlocking, e.rotationY = this._rotationY, e;\n          }, t._facesMapping = [\"right\", \"left\", \"up\", \"down\", \"front\", \"back\"], t;\n        }(kn.a);\n        O.a.RegisteredTypes[\"BABYLON.HDRCubeTexture\"] = qo;\n        var Ou = function() {\n          function r(t, e, n) {\n            e === void 0 && (e = 0), n === void 0 && (n = null), this.name = t, this.animations = new Array(), this._positions = null, this._normals = null, this._tangents = null, this._uvs = null, this._uniqueId = 0, this.onInfluenceChanged = new C.c(), this._onDataLayoutChanged = new C.c(), this._animationPropertiesOverride = null, this._scene = n || te.a.LastCreatedScene, this.influence = e, this._scene && (this._uniqueId = this._scene.getUniqueId());\n          }\n          return Object.defineProperty(r.prototype, \"influence\", { get: function() {\n            return this._influence;\n          }, set: function(t) {\n            if (this._influence !== t) {\n              var e = this._influence;\n              this._influence = t, this.onInfluenceChanged.hasObservers() && this.onInfluenceChanged.notifyObservers(e === 0 || t === 0);\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationPropertiesOverride\", { get: function() {\n            return !this._animationPropertiesOverride && this._scene ? this._scene.animationPropertiesOverride : this._animationPropertiesOverride;\n          }, set: function(t) {\n            this._animationPropertiesOverride = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasPositions\", { get: function() {\n            return !!this._positions;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasNormals\", { get: function() {\n            return !!this._normals;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasTangents\", { get: function() {\n            return !!this._tangents;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasUVs\", { get: function() {\n            return !!this._uvs;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setPositions = function(t) {\n            var e = this.hasPositions;\n            this._positions = t, e !== this.hasPositions && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getPositions = function() {\n            return this._positions;\n          }, r.prototype.setNormals = function(t) {\n            var e = this.hasNormals;\n            this._normals = t, e !== this.hasNormals && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getNormals = function() {\n            return this._normals;\n          }, r.prototype.setTangents = function(t) {\n            var e = this.hasTangents;\n            this._tangents = t, e !== this.hasTangents && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getTangents = function() {\n            return this._tangents;\n          }, r.prototype.setUVs = function(t) {\n            var e = this.hasUVs;\n            this._uvs = t, e !== this.hasUVs && this._onDataLayoutChanged.notifyObservers(void 0);\n          }, r.prototype.getUVs = function() {\n            return this._uvs;\n          }, r.prototype.clone = function() {\n            var t = this, e = L.a.Clone(function() {\n              return new r(t.name, t.influence, t._scene);\n            }, this);\n            return e._positions = this._positions, e._normals = this._normals, e._tangents = this._tangents, e._uvs = this._uvs, e;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.name = this.name, t.influence = this.influence, t.positions = Array.prototype.slice.call(this.getPositions()), this.id != null && (t.id = this.id), this.hasNormals && (t.normals = Array.prototype.slice.call(this.getNormals())), this.hasTangents && (t.tangents = Array.prototype.slice.call(this.getTangents())), this.hasUVs && (t.uvs = Array.prototype.slice.call(this.getUVs())), L.a.AppendSerializedAnimations(this, t), t;\n          }, r.prototype.getClassName = function() {\n            return \"MorphTarget\";\n          }, r.Parse = function(t) {\n            var e = new r(t.name, t.influence);\n            if (e.setPositions(t.positions), t.id != null && (e.id = t.id), t.normals && e.setNormals(t.normals), t.tangents && e.setTangents(t.tangents), t.uvs && e.setUVs(t.uvs), t.animations)\n              for (var n = 0; n < t.animations.length; n++) {\n                var i = t.animations[n], o = O.a.GetClass(\"BABYLON.Animation\");\n                o && e.animations.push(o.Parse(i));\n              }\n            return e;\n          }, r.FromMesh = function(t, e, n) {\n            e || (e = t.name);\n            var i = new r(e, n, t.getScene());\n            return i.setPositions(t.getVerticesData(Oe.b.PositionKind)), t.isVerticesDataPresent(Oe.b.NormalKind) && i.setNormals(t.getVerticesData(Oe.b.NormalKind)), t.isVerticesDataPresent(Oe.b.TangentKind) && i.setTangents(t.getVerticesData(Oe.b.TangentKind)), t.isVerticesDataPresent(Oe.b.UVKind) && i.setUVs(t.getVerticesData(Oe.b.UVKind)), i;\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"id\", void 0), r;\n        }(), Zo = function() {\n          function r(t) {\n            t === void 0 && (t = null), this._targets = new Array(), this._targetInfluenceChangedObservers = new Array(), this._targetDataLayoutChangedObservers = new Array(), this._activeTargets = new si.a(16), this._supportsNormals = !1, this._supportsTangents = !1, this._supportsUVs = !1, this._vertexCount = 0, this._uniqueId = 0, this._tempInfluences = new Array(), this.enableNormalMorphing = !0, this.enableTangentMorphing = !0, this.enableUVMorphing = !0, t || (t = te.a.LastCreatedScene), this._scene = t, this._scene && (this._scene.morphTargetManagers.push(this), this._uniqueId = this._scene.getUniqueId());\n          }\n          return Object.defineProperty(r.prototype, \"uniqueId\", { get: function() {\n            return this._uniqueId;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"vertexCount\", { get: function() {\n            return this._vertexCount;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"supportsNormals\", { get: function() {\n            return this._supportsNormals && this.enableNormalMorphing;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"supportsTangents\", { get: function() {\n            return this._supportsTangents && this.enableTangentMorphing;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"supportsUVs\", { get: function() {\n            return this._supportsUVs && this.enableUVMorphing;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"numTargets\", { get: function() {\n            return this._targets.length;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"numInfluencers\", { get: function() {\n            return this._activeTargets.length;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"influences\", { get: function() {\n            return this._influences;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getActiveTarget = function(t) {\n            return this._activeTargets.data[t];\n          }, r.prototype.getTarget = function(t) {\n            return this._targets[t];\n          }, r.prototype.addTarget = function(t) {\n            var e = this;\n            this._targets.push(t), this._targetInfluenceChangedObservers.push(t.onInfluenceChanged.add(function(n) {\n              e._syncActiveTargets(n);\n            })), this._targetDataLayoutChangedObservers.push(t._onDataLayoutChanged.add(function() {\n              e._syncActiveTargets(!0);\n            })), this._syncActiveTargets(!0);\n          }, r.prototype.removeTarget = function(t) {\n            var e = this._targets.indexOf(t);\n            e >= 0 && (this._targets.splice(e, 1), t.onInfluenceChanged.remove(this._targetInfluenceChangedObservers.splice(e, 1)[0]), t._onDataLayoutChanged.remove(this._targetDataLayoutChangedObservers.splice(e, 1)[0]), this._syncActiveTargets(!0));\n          }, r.prototype.clone = function() {\n            for (var t = new r(this._scene), e = 0, n = this._targets; e < n.length; e++) {\n              var i = n[e];\n              t.addTarget(i.clone());\n            }\n            return t.enableNormalMorphing = this.enableNormalMorphing, t.enableTangentMorphing = this.enableTangentMorphing, t.enableUVMorphing = this.enableUVMorphing, t;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.id = this.uniqueId, t.targets = [];\n            for (var e = 0, n = this._targets; e < n.length; e++) {\n              var i = n[e];\n              t.targets.push(i.serialize());\n            }\n            return t;\n          }, r.prototype._syncActiveTargets = function(t) {\n            var e = 0;\n            this._activeTargets.reset(), this._supportsNormals = !0, this._supportsTangents = !0, this._supportsUVs = !0, this._vertexCount = 0;\n            for (var n = 0, i = this._targets; n < i.length; n++) {\n              var o = i[n];\n              if (o.influence !== 0) {\n                this._activeTargets.push(o), this._tempInfluences[e++] = o.influence, this._supportsNormals = this._supportsNormals && o.hasNormals, this._supportsTangents = this._supportsTangents && o.hasTangents, this._supportsUVs = this._supportsUVs && o.hasUVs;\n                var a = o.getPositions();\n                if (a) {\n                  var s = a.length / 3;\n                  if (this._vertexCount === 0)\n                    this._vertexCount = s;\n                  else if (this._vertexCount !== s)\n                    return void l.a.Error(\"Incompatible target. Targets must all have the same vertices count.\");\n                }\n              }\n            }\n            this._influences && this._influences.length === e || (this._influences = new Float32Array(e));\n            for (var d = 0; d < e; d++)\n              this._influences[d] = this._tempInfluences[d];\n            t && this.synchronize();\n          }, r.prototype.synchronize = function() {\n            if (this._scene)\n              for (var t = 0, e = this._scene.meshes; t < e.length; t++) {\n                var n = e[t];\n                n.morphTargetManager === this && n._syncGeometryWithMorphTargetManager();\n              }\n          }, r.Parse = function(t, e) {\n            var n = new r(e);\n            n._uniqueId = t.id;\n            for (var i = 0, o = t.targets; i < o.length; i++) {\n              var a = o[i];\n              n.addTarget(Ou.Parse(a));\n            }\n            return n;\n          }, r;\n        }(), At = f(32), Jt = f(50), Sr = function() {\n          function r(t, e) {\n            if (e === void 0 && (e = r.DefaultPluginFactory()), this._physicsPlugin = e, this._impostors = [], this._joints = [], this._subTimeStep = 0, !this._physicsPlugin.isSupported())\n              throw new Error(\"Physics Engine \" + this._physicsPlugin.name + \" cannot be found. Please make sure it is included.\");\n            t = t || new u.e(0, -9.807, 0), this.setGravity(t), this.setTimeStep();\n          }\n          return r.DefaultPluginFactory = function() {\n            throw En.a.WarnImport(\"CannonJSPlugin\");\n          }, r.prototype.setGravity = function(t) {\n            this.gravity = t, this._physicsPlugin.setGravity(this.gravity);\n          }, r.prototype.setTimeStep = function(t) {\n            t === void 0 && (t = 1 / 60), this._physicsPlugin.setTimeStep(t);\n          }, r.prototype.getTimeStep = function() {\n            return this._physicsPlugin.getTimeStep();\n          }, r.prototype.setSubTimeStep = function(t) {\n            t === void 0 && (t = 0), this._subTimeStep = t;\n          }, r.prototype.getSubTimeStep = function() {\n            return this._subTimeStep;\n          }, r.prototype.dispose = function() {\n            this._impostors.forEach(function(t) {\n              t.dispose();\n            }), this._physicsPlugin.dispose();\n          }, r.prototype.getPhysicsPluginName = function() {\n            return this._physicsPlugin.name;\n          }, r.prototype.addImpostor = function(t) {\n            t.uniqueId = this._impostors.push(t), t.parent || this._physicsPlugin.generatePhysicsBody(t);\n          }, r.prototype.removeImpostor = function(t) {\n            var e = this._impostors.indexOf(t);\n            e > -1 && this._impostors.splice(e, 1).length && this.getPhysicsPlugin().removePhysicsBody(t);\n          }, r.prototype.addJoint = function(t, e, n) {\n            var i = { mainImpostor: t, connectedImpostor: e, joint: n };\n            n.physicsPlugin = this._physicsPlugin, this._joints.push(i), this._physicsPlugin.generateJoint(i);\n          }, r.prototype.removeJoint = function(t, e, n) {\n            var i = this._joints.filter(function(o) {\n              return o.connectedImpostor === e && o.joint === n && o.mainImpostor === t;\n            });\n            i.length && this._physicsPlugin.removeJoint(i[0]);\n          }, r.prototype._step = function(t) {\n            var e = this;\n            this._impostors.forEach(function(n) {\n              n.isBodyInitRequired() && e._physicsPlugin.generatePhysicsBody(n);\n            }), t > 0.1 ? t = 0.1 : t <= 0 && (t = 1 / 60), this._physicsPlugin.executeStep(t, this._impostors);\n          }, r.prototype.getPhysicsPlugin = function() {\n            return this._physicsPlugin;\n          }, r.prototype.getImpostors = function() {\n            return this._impostors;\n          }, r.prototype.getImpostorForPhysicsObject = function(t) {\n            for (var e = 0; e < this._impostors.length; ++e)\n              if (this._impostors[e].object === t)\n                return this._impostors[e];\n            return null;\n          }, r.prototype.getImpostorWithPhysicsBody = function(t) {\n            for (var e = 0; e < this._impostors.length; ++e)\n              if (this._impostors[e].physicsBody === t)\n                return this._impostors[e];\n            return null;\n          }, r.prototype.raycast = function(t, e) {\n            return this._physicsPlugin.raycast(t, e);\n          }, r.Epsilon = 1e-3, r;\n        }(), Fs = function() {\n          function r() {\n            this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = u.e.Zero(), this._hitPointWorld = u.e.Zero(), this._rayFromWorld = u.e.Zero(), this._rayToWorld = u.e.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"hasHit\", { get: function() {\n            return this._hasHit;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hitDistance\", { get: function() {\n            return this._hitDistance;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hitNormalWorld\", { get: function() {\n            return this._hitNormalWorld;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hitPointWorld\", { get: function() {\n            return this._hitPointWorld;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rayFromWorld\", { get: function() {\n            return this._rayFromWorld;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rayToWorld\", { get: function() {\n            return this._rayToWorld;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setHitData = function(t, e) {\n            this._hasHit = !0, this._hitNormalWorld = new u.e(t.x, t.y, t.z), this._hitPointWorld = new u.e(e.x, e.y, e.z);\n          }, r.prototype.setHitDistance = function(t) {\n            this._hitDistance = t;\n          }, r.prototype.calculateHitDistance = function() {\n            this._hitDistance = u.e.Distance(this._rayFromWorld, this._hitPointWorld);\n          }, r.prototype.reset = function(t, e) {\n            t === void 0 && (t = u.e.Zero()), e === void 0 && (e = u.e.Zero()), this._rayFromWorld = t, this._rayToWorld = e, this._hasHit = !1, this._hitDistance = 0, this._hitNormalWorld = u.e.Zero(), this._hitPointWorld = u.e.Zero();\n          }, r;\n        }(), Bs = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = !0), e === void 0 && (e = 10), n === void 0 && (n = CANNON), this._useDeltaForWorldStep = t, this.name = \"CannonJSPlugin\", this._physicsMaterials = new Array(), this._fixedTimeStep = 1 / 60, this._physicsBodysToRemoveAfterStep = new Array(), this._firstFrame = !0, this._minus90X = new u.b(-0.7071067811865475, 0, 0, 0.7071067811865475), this._plus90X = new u.b(0.7071067811865475, 0, 0, 0.7071067811865475), this._tmpPosition = u.e.Zero(), this._tmpDeltaPosition = u.e.Zero(), this._tmpUnityRotation = new u.b(), this.BJSCANNON = n, this.isSupported() ? (this._extendNamespace(), this.world = new this.BJSCANNON.World(), this.world.broadphase = new this.BJSCANNON.NaiveBroadphase(), this.world.solver.iterations = e, this._cannonRaycastResult = new this.BJSCANNON.RaycastResult(), this._raycastResult = new Fs()) : l.a.Error(\"CannonJS is not available. Please make sure you included the js file.\");\n          }\n          return r.prototype.setGravity = function(t) {\n            var e = t;\n            this.world.gravity.set(e.x, e.y, e.z);\n          }, r.prototype.setTimeStep = function(t) {\n            this._fixedTimeStep = t;\n          }, r.prototype.getTimeStep = function() {\n            return this._fixedTimeStep;\n          }, r.prototype.executeStep = function(t, e) {\n            if (this._firstFrame) {\n              this._firstFrame = !1;\n              for (var n = 0, i = e; n < i.length; n++) {\n                var o = i[n];\n                o.type != At.a.HeightmapImpostor && o.type !== At.a.PlaneImpostor && o.beforeStep();\n              }\n            }\n            this.world.step(this._useDeltaForWorldStep ? t : this._fixedTimeStep), this._removeMarkedPhysicsBodiesFromWorld();\n          }, r.prototype._removeMarkedPhysicsBodiesFromWorld = function() {\n            var t = this;\n            this._physicsBodysToRemoveAfterStep.length > 0 && (this._physicsBodysToRemoveAfterStep.forEach(function(e) {\n              t.world.remove(e);\n            }), this._physicsBodysToRemoveAfterStep = []);\n          }, r.prototype.applyImpulse = function(t, e, n) {\n            var i = new this.BJSCANNON.Vec3(n.x, n.y, n.z), o = new this.BJSCANNON.Vec3(e.x, e.y, e.z);\n            t.physicsBody.applyImpulse(o, i);\n          }, r.prototype.applyForce = function(t, e, n) {\n            var i = new this.BJSCANNON.Vec3(n.x, n.y, n.z), o = new this.BJSCANNON.Vec3(e.x, e.y, e.z);\n            t.physicsBody.applyForce(o, i);\n          }, r.prototype.generatePhysicsBody = function(t) {\n            if (this._removeMarkedPhysicsBodiesFromWorld(), t.parent)\n              t.physicsBody && (this.removePhysicsBody(t), t.forceUpdate());\n            else {\n              if (t.isBodyInitRequired()) {\n                var e = this._createShape(t), n = t.physicsBody;\n                n && this.removePhysicsBody(t);\n                var i = this._addMaterial(\"mat-\" + t.uniqueId, t.getParam(\"friction\"), t.getParam(\"restitution\")), o = { mass: t.getParam(\"mass\"), material: i }, a = t.getParam(\"nativeOptions\");\n                for (var s in a)\n                  a.hasOwnProperty(s) && (o[s] = a[s]);\n                t.physicsBody = new this.BJSCANNON.Body(o), t.physicsBody.addEventListener(\"collide\", t.onCollide), this.world.addEventListener(\"preStep\", t.beforeStep), this.world.addEventListener(\"postStep\", t.afterStep), t.physicsBody.addShape(e), this.world.add(t.physicsBody), n && [\"force\", \"torque\", \"velocity\", \"angularVelocity\"].forEach(function(d) {\n                  var p = n[d];\n                  t.physicsBody[d].set(p.x, p.y, p.z);\n                }), this._processChildMeshes(t);\n              }\n              this._updatePhysicsBodyTransformation(t);\n            }\n          }, r.prototype._processChildMeshes = function(t) {\n            var e = this, n = t.object.getChildMeshes ? t.object.getChildMeshes(!0) : [], i = t.object.rotationQuaternion;\n            if (n.length) {\n              var o = function(a) {\n                if (i && a.rotationQuaternion) {\n                  var s = a.getPhysicsImpostor();\n                  if (s && s.parent !== t) {\n                    var d = a.getAbsolutePosition().subtract(a.parent.getAbsolutePosition()), p = a.rotationQuaternion;\n                    s.physicsBody && (e.removePhysicsBody(s), s.physicsBody = null), s.parent = t, s.resetUpdateFlags(), t.physicsBody.addShape(e._createShape(s), new e.BJSCANNON.Vec3(d.x, d.y, d.z), new e.BJSCANNON.Quaternion(p.x, p.y, p.z, p.w)), t.physicsBody.mass += s.getParam(\"mass\");\n                  }\n                  i.multiplyInPlace(a.rotationQuaternion), a.getChildMeshes(!0).filter(function(y) {\n                    return !!y.physicsImpostor;\n                  }).forEach(o);\n                }\n              };\n              n.filter(function(a) {\n                return !!a.physicsImpostor;\n              }).forEach(o);\n            }\n          }, r.prototype.removePhysicsBody = function(t) {\n            t.physicsBody.removeEventListener(\"collide\", t.onCollide), this.world.removeEventListener(\"preStep\", t.beforeStep), this.world.removeEventListener(\"postStep\", t.afterStep), this._physicsBodysToRemoveAfterStep.indexOf(t.physicsBody) === -1 && this._physicsBodysToRemoveAfterStep.push(t.physicsBody);\n          }, r.prototype.generateJoint = function(t) {\n            var e = t.mainImpostor.physicsBody, n = t.connectedImpostor.physicsBody;\n            if (e && n) {\n              var i, o = t.joint.jointData, a = { pivotA: o.mainPivot ? new this.BJSCANNON.Vec3().set(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z) : null, pivotB: o.connectedPivot ? new this.BJSCANNON.Vec3().set(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z) : null, axisA: o.mainAxis ? new this.BJSCANNON.Vec3().set(o.mainAxis.x, o.mainAxis.y, o.mainAxis.z) : null, axisB: o.connectedAxis ? new this.BJSCANNON.Vec3().set(o.connectedAxis.x, o.connectedAxis.y, o.connectedAxis.z) : null, maxForce: o.nativeParams.maxForce, collideConnected: !!o.collision };\n              switch (t.joint.type) {\n                case Jt.e.HingeJoint:\n                case Jt.e.Hinge2Joint:\n                  i = new this.BJSCANNON.HingeConstraint(e, n, a);\n                  break;\n                case Jt.e.DistanceJoint:\n                  i = new this.BJSCANNON.DistanceConstraint(e, n, o.maxDistance || 2);\n                  break;\n                case Jt.e.SpringJoint:\n                  var s = o;\n                  i = new this.BJSCANNON.Spring(e, n, { restLength: s.length, stiffness: s.stiffness, damping: s.damping, localAnchorA: a.pivotA, localAnchorB: a.pivotB });\n                  break;\n                case Jt.e.LockJoint:\n                  i = new this.BJSCANNON.LockConstraint(e, n, a);\n                  break;\n                case Jt.e.PointToPointJoint:\n                case Jt.e.BallAndSocketJoint:\n                default:\n                  i = new this.BJSCANNON.PointToPointConstraint(e, a.pivotA, n, a.pivotB, a.maxForce);\n              }\n              i.collideConnected = !!o.collision, t.joint.physicsJoint = i, t.joint.type !== Jt.e.SpringJoint ? this.world.addConstraint(i) : (t.joint.jointData.forceApplicationCallback = t.joint.jointData.forceApplicationCallback || function() {\n                i.applyForce();\n              }, t.mainImpostor.registerAfterPhysicsStep(t.joint.jointData.forceApplicationCallback));\n            }\n          }, r.prototype.removeJoint = function(t) {\n            t.joint.type !== Jt.e.SpringJoint ? this.world.removeConstraint(t.joint.physicsJoint) : t.mainImpostor.unregisterAfterPhysicsStep(t.joint.jointData.forceApplicationCallback);\n          }, r.prototype._addMaterial = function(t, e, n) {\n            var i, o;\n            for (i = 0; i < this._physicsMaterials.length; i++)\n              if ((o = this._physicsMaterials[i]).friction === e && o.restitution === n)\n                return o;\n            var a = new this.BJSCANNON.Material(t);\n            return a.friction = e, a.restitution = n, this._physicsMaterials.push(a), a;\n          }, r.prototype._checkWithEpsilon = function(t) {\n            return t < Sr.Epsilon ? Sr.Epsilon : t;\n          }, r.prototype._createShape = function(t) {\n            var e, n = t.object, i = t.getObjectExtendSize();\n            switch (t.type) {\n              case At.a.SphereImpostor:\n                var o = i.x, a = i.y, s = i.z;\n                e = new this.BJSCANNON.Sphere(Math.max(this._checkWithEpsilon(o), this._checkWithEpsilon(a), this._checkWithEpsilon(s)) / 2);\n                break;\n              case At.a.CylinderImpostor:\n                var d = t.getParam(\"nativeOptions\");\n                d || (d = {});\n                var p = d.radiusTop !== void 0 ? d.radiusTop : this._checkWithEpsilon(i.x) / 2, y = d.radiusBottom !== void 0 ? d.radiusBottom : this._checkWithEpsilon(i.x) / 2, P = d.height !== void 0 ? d.height : this._checkWithEpsilon(i.y), R = d.numSegments !== void 0 ? d.numSegments : 16;\n                e = new this.BJSCANNON.Cylinder(p, y, P, R);\n                var B = new this.BJSCANNON.Quaternion();\n                B.setFromAxisAngle(new this.BJSCANNON.Vec3(1, 0, 0), -Math.PI / 2);\n                var F = new this.BJSCANNON.Vec3(0, 0, 0);\n                e.transformAllPoints(F, B);\n                break;\n              case At.a.BoxImpostor:\n                var z = i.scale(0.5);\n                e = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(this._checkWithEpsilon(z.x), this._checkWithEpsilon(z.y), this._checkWithEpsilon(z.z)));\n                break;\n              case At.a.PlaneImpostor:\n                l.a.Warn(\"Attention, PlaneImposter might not behave as you expect. Consider using BoxImposter instead\"), e = new this.BJSCANNON.Plane();\n                break;\n              case At.a.MeshImpostor:\n                var J = n.getVerticesData ? n.getVerticesData(Oe.b.PositionKind) : [], ie = n.getIndices ? n.getIndices() : [];\n                if (!J)\n                  return;\n                var se = n.position.clone(), ce = n.rotation && n.rotation.clone(), ue = n.rotationQuaternion && n.rotationQuaternion.clone();\n                n.position.copyFromFloats(0, 0, 0), n.rotation && n.rotation.copyFromFloats(0, 0, 0), n.rotationQuaternion && n.rotationQuaternion.copyFrom(t.getParentsRotation()), n.rotationQuaternion && n.parent && n.rotationQuaternion.conjugateInPlace();\n                var fe, ve = n.computeWorldMatrix(!0), Te = new Array();\n                for (fe = 0; fe < J.length; fe += 3)\n                  u.e.TransformCoordinates(u.e.FromArray(J, fe), ve).toArray(Te, fe);\n                l.a.Warn(\"MeshImpostor only collides against spheres.\"), e = new this.BJSCANNON.Trimesh(Te, ie), n.position.copyFrom(se), ce && n.rotation && n.rotation.copyFrom(ce), ue && n.rotationQuaternion && n.rotationQuaternion.copyFrom(ue);\n                break;\n              case At.a.HeightmapImpostor:\n                var Re = n.position.clone(), Ae = n.rotation && n.rotation.clone(), Ee = n.rotationQuaternion && n.rotationQuaternion.clone();\n                n.position.copyFromFloats(0, 0, 0), n.rotation && n.rotation.copyFromFloats(0, 0, 0), n.rotationQuaternion && n.rotationQuaternion.copyFrom(t.getParentsRotation()), n.rotationQuaternion && n.parent && n.rotationQuaternion.conjugateInPlace(), n.rotationQuaternion && n.rotationQuaternion.multiplyInPlace(this._minus90X), e = this._createHeightmap(n), n.position.copyFrom(Re), Ae && n.rotation && n.rotation.copyFrom(Ae), Ee && n.rotationQuaternion && n.rotationQuaternion.copyFrom(Ee), n.computeWorldMatrix(!0);\n                break;\n              case At.a.ParticleImpostor:\n                e = new this.BJSCANNON.Particle();\n                break;\n              case At.a.NoImpostor:\n                e = new this.BJSCANNON.Box(new this.BJSCANNON.Vec3(0, 0, 0));\n            }\n            return e;\n          }, r.prototype._createHeightmap = function(t, e) {\n            var n, i = t.getVerticesData(Oe.b.PositionKind), o = t.computeWorldMatrix(!0), a = new Array();\n            for (n = 0; n < i.length; n += 3)\n              u.e.TransformCoordinates(u.e.FromArray(i, n), o).toArray(a, n);\n            i = a;\n            for (var s = new Array(), d = e || ~~(Math.sqrt(i.length / 3) - 1), p = t.getBoundingInfo(), y = Math.min(p.boundingBox.extendSizeWorld.x, p.boundingBox.extendSizeWorld.y), P = p.boundingBox.extendSizeWorld.z, R = 2 * y / d, B = 0; B < i.length; B += 3) {\n              var F = Math.round(i[B + 0] / R + d / 2), z = Math.round(-1 * (i[B + 1] / R - d / 2)), J = -i[B + 2] + P;\n              s[F] || (s[F] = []), s[F][z] || (s[F][z] = J), s[F][z] = Math.max(J, s[F][z]);\n            }\n            for (F = 0; F <= d; ++F) {\n              if (!s[F]) {\n                for (var ie = 1; !s[(F + ie) % d]; )\n                  ie++;\n                s[F] = s[(F + ie) % d].slice();\n              }\n              for (z = 0; z <= d; ++z)\n                if (!s[F][z]) {\n                  var se;\n                  for (ie = 1; se === void 0; )\n                    se = s[F][(z + ie++) % d];\n                  s[F][z] = se;\n                }\n            }\n            var ce = new this.BJSCANNON.Heightfield(s, { elementSize: R });\n            return ce.minY = P, ce;\n          }, r.prototype._updatePhysicsBodyTransformation = function(t) {\n            var e = t.object;\n            if (e.computeWorldMatrix && e.computeWorldMatrix(!0), e.getBoundingInfo()) {\n              var n = t.getObjectCenter();\n              this._tmpDeltaPosition.copyFrom(e.getAbsolutePivotPoint().subtract(n)), this._tmpDeltaPosition.divideInPlace(t.object.scaling), this._tmpPosition.copyFrom(n);\n              var i = e.rotationQuaternion;\n              if (i) {\n                if (t.type !== At.a.PlaneImpostor && t.type !== At.a.HeightmapImpostor || (i = i.multiply(this._minus90X), t.setDeltaRotation(this._plus90X)), t.type === At.a.HeightmapImpostor) {\n                  var o = e, a = o.getBoundingInfo(), s = o.rotationQuaternion;\n                  o.rotationQuaternion = this._tmpUnityRotation, o.computeWorldMatrix(!0);\n                  var d = n.clone(), p = o.getPivotMatrix();\n                  p = p ? p.clone() : u.a.Identity();\n                  var y = u.a.Translation(a.boundingBox.extendSizeWorld.x, 0, -a.boundingBox.extendSizeWorld.z);\n                  o.setPreTransformMatrix(y), o.computeWorldMatrix(!0);\n                  var P = a.boundingBox.centerWorld.subtract(n).subtract(o.position).negate();\n                  this._tmpPosition.copyFromFloats(P.x, P.y - a.boundingBox.extendSizeWorld.y, P.z), this._tmpDeltaPosition.copyFrom(a.boundingBox.centerWorld.subtract(d)), this._tmpDeltaPosition.y += a.boundingBox.extendSizeWorld.y, o.rotationQuaternion = s, o.setPreTransformMatrix(p), o.computeWorldMatrix(!0);\n                } else\n                  t.type === At.a.MeshImpostor && this._tmpDeltaPosition.copyFromFloats(0, 0, 0);\n                t.setDeltaPosition(this._tmpDeltaPosition), t.physicsBody.position.set(this._tmpPosition.x, this._tmpPosition.y, this._tmpPosition.z), t.physicsBody.quaternion.set(i.x, i.y, i.z, i.w);\n              }\n            }\n          }, r.prototype.setTransformationFromPhysicsBody = function(t) {\n            if (t.object.position.set(t.physicsBody.position.x, t.physicsBody.position.y, t.physicsBody.position.z), t.object.rotationQuaternion) {\n              var e = t.physicsBody.quaternion;\n              t.object.rotationQuaternion.set(e.x, e.y, e.z, e.w);\n            }\n          }, r.prototype.setPhysicsBodyTransformation = function(t, e, n) {\n            t.physicsBody.position.set(e.x, e.y, e.z), t.physicsBody.quaternion.set(n.x, n.y, n.z, n.w);\n          }, r.prototype.isSupported = function() {\n            return this.BJSCANNON !== void 0;\n          }, r.prototype.setLinearVelocity = function(t, e) {\n            t.physicsBody.velocity.set(e.x, e.y, e.z);\n          }, r.prototype.setAngularVelocity = function(t, e) {\n            t.physicsBody.angularVelocity.set(e.x, e.y, e.z);\n          }, r.prototype.getLinearVelocity = function(t) {\n            var e = t.physicsBody.velocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.getAngularVelocity = function(t) {\n            var e = t.physicsBody.angularVelocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.setBodyMass = function(t, e) {\n            t.physicsBody.mass = e, t.physicsBody.updateMassProperties();\n          }, r.prototype.getBodyMass = function(t) {\n            return t.physicsBody.mass;\n          }, r.prototype.getBodyFriction = function(t) {\n            return t.physicsBody.material.friction;\n          }, r.prototype.setBodyFriction = function(t, e) {\n            t.physicsBody.material.friction = e;\n          }, r.prototype.getBodyRestitution = function(t) {\n            return t.physicsBody.material.restitution;\n          }, r.prototype.setBodyRestitution = function(t, e) {\n            t.physicsBody.material.restitution = e;\n          }, r.prototype.sleepBody = function(t) {\n            t.physicsBody.sleep();\n          }, r.prototype.wakeUpBody = function(t) {\n            t.physicsBody.wakeUp();\n          }, r.prototype.updateDistanceJoint = function(t, e) {\n            t.physicsJoint.distance = e;\n          }, r.prototype.setMotor = function(t, e, n, i) {\n            i || (t.physicsJoint.enableMotor(), t.physicsJoint.setMotorSpeed(e), n && this.setLimit(t, n));\n          }, r.prototype.setLimit = function(t, e, n) {\n            t.physicsJoint.motorEquation.maxForce = e, t.physicsJoint.motorEquation.minForce = n === void 0 ? -e : n;\n          }, r.prototype.syncMeshWithImpostor = function(t, e) {\n            var n = e.physicsBody;\n            t.position.x = n.position.x, t.position.y = n.position.y, t.position.z = n.position.z, t.rotationQuaternion && (t.rotationQuaternion.x = n.quaternion.x, t.rotationQuaternion.y = n.quaternion.y, t.rotationQuaternion.z = n.quaternion.z, t.rotationQuaternion.w = n.quaternion.w);\n          }, r.prototype.getRadius = function(t) {\n            return t.physicsBody.shapes[0].boundingSphereRadius;\n          }, r.prototype.getBoxSizeToRef = function(t, e) {\n            var n = t.physicsBody.shapes[0];\n            e.x = 2 * n.halfExtents.x, e.y = 2 * n.halfExtents.y, e.z = 2 * n.halfExtents.z;\n          }, r.prototype.dispose = function() {\n          }, r.prototype._extendNamespace = function() {\n            var t = new this.BJSCANNON.Vec3(), e = this.BJSCANNON;\n            this.BJSCANNON.World.prototype.step = function(n, i, o) {\n              if (o = o || 10, (i = i || 0) === 0)\n                this.internalStep(n), this.time += n;\n              else {\n                var a = Math.floor((this.time + i) / n) - Math.floor(this.time / n);\n                a = Math.min(a, o) || 1;\n                for (var s = performance.now(), d = 0; d !== a && (this.internalStep(n), !(performance.now() - s > 1e3 * n)); d++)\n                  ;\n                this.time += i;\n                for (var p = this.time % n / n, y = t, P = this.bodies, R = 0; R !== P.length; R++) {\n                  var B = P[R];\n                  B.type !== e.Body.STATIC && B.sleepState !== e.Body.SLEEPING ? (B.position.vsub(B.previousPosition, y), y.scale(p, y), B.position.vadd(y, B.interpolatedPosition)) : (B.interpolatedPosition.set(B.position.x, B.position.y, B.position.z), B.interpolatedQuaternion.set(B.quaternion.x, B.quaternion.y, B.quaternion.z, B.quaternion.w));\n                }\n              }\n            };\n          }, r.prototype.raycast = function(t, e) {\n            return this._cannonRaycastResult.reset(), this.world.raycastClosest(t, e, {}, this._cannonRaycastResult), this._raycastResult.reset(t, e), this._cannonRaycastResult.hasHit && (this._raycastResult.setHitData({ x: this._cannonRaycastResult.hitNormalWorld.x, y: this._cannonRaycastResult.hitNormalWorld.y, z: this._cannonRaycastResult.hitNormalWorld.z }, { x: this._cannonRaycastResult.hitPointWorld.x, y: this._cannonRaycastResult.hitPointWorld.y, z: this._cannonRaycastResult.hitPointWorld.z }), this._raycastResult.setHitDistance(this._cannonRaycastResult.distance)), this._raycastResult;\n          }, r;\n        }();\n        Sr.DefaultPluginFactory = function() {\n          return new Bs();\n        };\n        var Mu = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = !0), n === void 0 && (n = OIMO), this._useDeltaForWorldStep = t, this.name = \"OimoJSPlugin\", this._fixedTimeStep = 1 / 60, this._tmpImpostorsArray = [], this._tmpPositionVector = u.e.Zero(), this.BJSOIMO = n, this.world = new this.BJSOIMO.World({ iterations: e }), this.world.clear(), this._raycastResult = new Fs();\n          }\n          return r.prototype.setGravity = function(t) {\n            this.world.gravity.set(t.x, t.y, t.z);\n          }, r.prototype.setTimeStep = function(t) {\n            this.world.timeStep = t;\n          }, r.prototype.getTimeStep = function() {\n            return this.world.timeStep;\n          }, r.prototype.executeStep = function(t, e) {\n            var n = this;\n            e.forEach(function(s) {\n              s.beforeStep();\n            }), this.world.timeStep = this._useDeltaForWorldStep ? t : this._fixedTimeStep, this.world.step(), e.forEach(function(s) {\n              s.afterStep(), n._tmpImpostorsArray[s.uniqueId] = s;\n            });\n            for (var i = this.world.contacts; i !== null; )\n              if (!i.touching || i.body1.sleeping || i.body2.sleeping) {\n                var o = this._tmpImpostorsArray[+i.body1.name], a = this._tmpImpostorsArray[+i.body2.name];\n                o && a && (o.onCollide({ body: a.physicsBody, point: null }), a.onCollide({ body: o.physicsBody, point: null })), i = i.next;\n              } else\n                i = i.next;\n          }, r.prototype.applyImpulse = function(t, e, n) {\n            var i = t.physicsBody.mass;\n            t.physicsBody.applyImpulse(n.scale(this.world.invScale), e.scale(this.world.invScale * i));\n          }, r.prototype.applyForce = function(t, e, n) {\n            l.a.Warn(\"Oimo doesn't support applying force. Using impule instead.\"), this.applyImpulse(t, e, n);\n          }, r.prototype.generatePhysicsBody = function(t) {\n            var e = this;\n            if (t.parent)\n              t.physicsBody && (this.removePhysicsBody(t), t.forceUpdate());\n            else {\n              if (t.isBodyInitRequired()) {\n                var n = { name: t.uniqueId, config: [t.getParam(\"mass\") || 1e-3, t.getParam(\"friction\"), t.getParam(\"restitution\")], size: [], type: [], pos: [], posShape: [], rot: [], rotShape: [], move: t.getParam(\"mass\") !== 0, density: t.getParam(\"mass\"), friction: t.getParam(\"friction\"), restitution: t.getParam(\"restitution\"), world: this.world }, i = [t];\n                (s = t.object).getChildMeshes && s.getChildMeshes().forEach(function(d) {\n                  d.physicsImpostor && i.push(d.physicsImpostor);\n                });\n                var o = function(d) {\n                  return Math.max(d, Sr.Epsilon);\n                }, a = new u.b();\n                i.forEach(function(d) {\n                  if (d.object.rotationQuaternion) {\n                    var p = d.object.rotationQuaternion;\n                    a.copyFrom(p), d.object.rotationQuaternion.set(0, 0, 0, 1), d.object.computeWorldMatrix(!0);\n                    var y = a.toEulerAngles(), P = d.getObjectExtendSize();\n                    if (d === t) {\n                      var R = t.getObjectCenter();\n                      t.object.getAbsolutePivotPoint().subtractToRef(R, e._tmpPositionVector), e._tmpPositionVector.divideInPlace(t.object.scaling), n.pos.push(R.x), n.pos.push(R.y), n.pos.push(R.z), n.posShape.push(0, 0, 0), n.rotShape.push(0, 0, 0);\n                    } else {\n                      var B = d.object.position.clone();\n                      n.posShape.push(B.x), n.posShape.push(B.y), n.posShape.push(B.z), n.rotShape.push(57.29577951308232 * y.x, 57.29577951308232 * y.y, 57.29577951308232 * y.z);\n                    }\n                    switch (d.object.rotationQuaternion.copyFrom(a), d.type) {\n                      case At.a.ParticleImpostor:\n                        l.a.Warn(\"No Particle support in OIMO.js. using SphereImpostor instead\");\n                      case At.a.SphereImpostor:\n                        var F = P.x, z = P.y, J = P.z, ie = Math.max(o(F), o(z), o(J)) / 2;\n                        n.type.push(\"sphere\"), n.size.push(ie), n.size.push(ie), n.size.push(ie);\n                        break;\n                      case At.a.CylinderImpostor:\n                        var se = o(P.x) / 2, ce = o(P.y);\n                        n.type.push(\"cylinder\"), n.size.push(se), n.size.push(ce), n.size.push(ce);\n                        break;\n                      case At.a.PlaneImpostor:\n                      case At.a.BoxImpostor:\n                      default:\n                        se = o(P.x), ce = o(P.y);\n                        var ue = o(P.z);\n                        n.type.push(\"box\"), n.size.push(se), n.size.push(ce), n.size.push(ue);\n                    }\n                    d.object.rotationQuaternion = p;\n                  }\n                }), t.physicsBody = this.world.add(n), t.physicsBody.resetQuaternion(a), t.physicsBody.updatePosition(0);\n              } else\n                this._tmpPositionVector.copyFromFloats(0, 0, 0);\n              var s;\n              t.setDeltaPosition(this._tmpPositionVector);\n            }\n          }, r.prototype.removePhysicsBody = function(t) {\n            this.world.removeRigidBody(t.physicsBody);\n          }, r.prototype.generateJoint = function(t) {\n            var e = t.mainImpostor.physicsBody, n = t.connectedImpostor.physicsBody;\n            if (e && n) {\n              var i, o = t.joint.jointData, a = o.nativeParams || {}, s = { body1: e, body2: n, axe1: a.axe1 || (o.mainAxis ? o.mainAxis.asArray() : null), axe2: a.axe2 || (o.connectedAxis ? o.connectedAxis.asArray() : null), pos1: a.pos1 || (o.mainPivot ? o.mainPivot.asArray() : null), pos2: a.pos2 || (o.connectedPivot ? o.connectedPivot.asArray() : null), min: a.min, max: a.max, collision: a.collision || o.collision, spring: a.spring, world: this.world };\n              switch (t.joint.type) {\n                case Jt.e.BallAndSocketJoint:\n                  i = \"jointBall\";\n                  break;\n                case Jt.e.SpringJoint:\n                  l.a.Warn(\"OIMO.js doesn't support Spring Constraint. Simulating using DistanceJoint instead\");\n                  var d = o;\n                  s.min = d.length || s.min, s.max = Math.max(s.min, s.max);\n                case Jt.e.DistanceJoint:\n                  i = \"jointDistance\", s.max = o.maxDistance;\n                  break;\n                case Jt.e.PrismaticJoint:\n                  i = \"jointPrisme\";\n                  break;\n                case Jt.e.SliderJoint:\n                  i = \"jointSlide\";\n                  break;\n                case Jt.e.WheelJoint:\n                  i = \"jointWheel\";\n                  break;\n                case Jt.e.HingeJoint:\n                default:\n                  i = \"jointHinge\";\n              }\n              s.type = i, t.joint.physicsJoint = this.world.add(s);\n            }\n          }, r.prototype.removeJoint = function(t) {\n            try {\n              this.world.removeJoint(t.joint.physicsJoint);\n            } catch (e) {\n              l.a.Warn(e);\n            }\n          }, r.prototype.isSupported = function() {\n            return this.BJSOIMO !== void 0;\n          }, r.prototype.setTransformationFromPhysicsBody = function(t) {\n            if (!t.physicsBody.sleeping) {\n              if (t.physicsBody.shapes.next) {\n                for (var e = t.physicsBody.shapes; e.next; )\n                  e = e.next;\n                t.object.position.set(e.position.x, e.position.y, e.position.z);\n              } else {\n                var n = t.physicsBody.getPosition();\n                t.object.position.set(n.x, n.y, n.z);\n              }\n              if (t.object.rotationQuaternion) {\n                var i = t.physicsBody.getQuaternion();\n                t.object.rotationQuaternion.set(i.x, i.y, i.z, i.w);\n              }\n            }\n          }, r.prototype.setPhysicsBodyTransformation = function(t, e, n) {\n            var i = t.physicsBody;\n            t.physicsBody.shapes.next || (i.position.set(e.x, e.y, e.z), i.orientation.set(n.x, n.y, n.z, n.w), i.syncShapes(), i.awake());\n          }, r.prototype.setLinearVelocity = function(t, e) {\n            t.physicsBody.linearVelocity.set(e.x, e.y, e.z);\n          }, r.prototype.setAngularVelocity = function(t, e) {\n            t.physicsBody.angularVelocity.set(e.x, e.y, e.z);\n          }, r.prototype.getLinearVelocity = function(t) {\n            var e = t.physicsBody.linearVelocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.getAngularVelocity = function(t) {\n            var e = t.physicsBody.angularVelocity;\n            return e ? new u.e(e.x, e.y, e.z) : null;\n          }, r.prototype.setBodyMass = function(t, e) {\n            var n = e === 0;\n            t.physicsBody.shapes.density = n ? 1 : e, t.physicsBody.setupMass(n ? 2 : 1);\n          }, r.prototype.getBodyMass = function(t) {\n            return t.physicsBody.shapes.density;\n          }, r.prototype.getBodyFriction = function(t) {\n            return t.physicsBody.shapes.friction;\n          }, r.prototype.setBodyFriction = function(t, e) {\n            t.physicsBody.shapes.friction = e;\n          }, r.prototype.getBodyRestitution = function(t) {\n            return t.physicsBody.shapes.restitution;\n          }, r.prototype.setBodyRestitution = function(t, e) {\n            t.physicsBody.shapes.restitution = e;\n          }, r.prototype.sleepBody = function(t) {\n            t.physicsBody.sleep();\n          }, r.prototype.wakeUpBody = function(t) {\n            t.physicsBody.awake();\n          }, r.prototype.updateDistanceJoint = function(t, e, n) {\n            t.physicsJoint.limitMotor.upperLimit = e, n !== void 0 && (t.physicsJoint.limitMotor.lowerLimit = n);\n          }, r.prototype.setMotor = function(t, e, n, i) {\n            n !== void 0 ? l.a.Warn(\"OimoJS plugin currently has unexpected behavior when using setMotor with force parameter\") : n = 1e6, e *= -1;\n            var o = i ? t.physicsJoint.rotationalLimitMotor2 : t.physicsJoint.rotationalLimitMotor1 || t.physicsJoint.rotationalLimitMotor || t.physicsJoint.limitMotor;\n            o && o.setMotor(e, n);\n          }, r.prototype.setLimit = function(t, e, n, i) {\n            var o = i ? t.physicsJoint.rotationalLimitMotor2 : t.physicsJoint.rotationalLimitMotor1 || t.physicsJoint.rotationalLimitMotor || t.physicsJoint.limitMotor;\n            o && o.setLimit(e, n === void 0 ? -e : n);\n          }, r.prototype.syncMeshWithImpostor = function(t, e) {\n            var n = e.physicsBody;\n            t.position.x = n.position.x, t.position.y = n.position.y, t.position.z = n.position.z, t.rotationQuaternion && (t.rotationQuaternion.x = n.orientation.x, t.rotationQuaternion.y = n.orientation.y, t.rotationQuaternion.z = n.orientation.z, t.rotationQuaternion.w = n.orientation.s);\n          }, r.prototype.getRadius = function(t) {\n            return t.physicsBody.shapes.radius;\n          }, r.prototype.getBoxSizeToRef = function(t, e) {\n            var n = t.physicsBody.shapes;\n            e.x = 2 * n.halfWidth, e.y = 2 * n.halfHeight, e.z = 2 * n.halfDepth;\n          }, r.prototype.dispose = function() {\n            this.world.clear();\n          }, r.prototype.raycast = function(t, e) {\n            return l.a.Warn(\"raycast is not currently supported by the Oimo physics plugin\"), this._raycastResult.reset(t, e), this._raycastResult;\n          }, r;\n        }(), Jo = f(97), Iu = function() {\n          function r(t, e, n) {\n            var i = this;\n            t === void 0 && (t = !0), e === void 0 && (e = Ammo), n === void 0 && (n = null), this._useDeltaForWorldStep = t, this.bjsAMMO = {}, this.name = \"AmmoJSPlugin\", this._timeStep = 1 / 60, this._fixedTimeStep = 1 / 60, this._maxSteps = 5, this._tmpQuaternion = new u.b(), this._tmpContactCallbackResult = !1, this._tmpContactPoint = new u.e(), this._tmpMatrix = new u.a(), typeof e == \"function\" ? e(this.bjsAMMO) : this.bjsAMMO = e, this.isSupported() ? (this._collisionConfiguration = new this.bjsAMMO.btSoftBodyRigidBodyCollisionConfiguration(), this._dispatcher = new this.bjsAMMO.btCollisionDispatcher(this._collisionConfiguration), this._overlappingPairCache = n || new this.bjsAMMO.btDbvtBroadphase(), this._solver = new this.bjsAMMO.btSequentialImpulseConstraintSolver(), this._softBodySolver = new this.bjsAMMO.btDefaultSoftBodySolver(), this.world = new this.bjsAMMO.btSoftRigidDynamicsWorld(this._dispatcher, this._overlappingPairCache, this._solver, this._collisionConfiguration, this._softBodySolver), this._tmpAmmoConcreteContactResultCallback = new this.bjsAMMO.ConcreteContactResultCallback(), this._tmpAmmoConcreteContactResultCallback.addSingleResult = function(o, a, s, d) {\n              var p = (o = i.bjsAMMO.wrapPointer(o, Ammo.btManifoldPoint)).getPositionWorldOnA();\n              i._tmpContactPoint.x = p.x(), i._tmpContactPoint.y = p.y(), i._tmpContactPoint.z = p.z(), i._tmpContactCallbackResult = !0;\n            }, this._raycastResult = new Fs(), this._tmpAmmoTransform = new this.bjsAMMO.btTransform(), this._tmpAmmoTransform.setIdentity(), this._tmpAmmoQuaternion = new this.bjsAMMO.btQuaternion(0, 0, 0, 1), this._tmpAmmoVectorA = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorB = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorC = new this.bjsAMMO.btVector3(0, 0, 0), this._tmpAmmoVectorD = new this.bjsAMMO.btVector3(0, 0, 0)) : l.a.Error(\"AmmoJS is not available. Please make sure you included the js file.\");\n          }\n          return r.prototype.setGravity = function(t) {\n            this._tmpAmmoVectorA.setValue(t.x, t.y, t.z), this.world.setGravity(this._tmpAmmoVectorA), this.world.getWorldInfo().set_m_gravity(this._tmpAmmoVectorA);\n          }, r.prototype.setTimeStep = function(t) {\n            this._timeStep = t;\n          }, r.prototype.setFixedTimeStep = function(t) {\n            this._fixedTimeStep = t;\n          }, r.prototype.setMaxSteps = function(t) {\n            this._maxSteps = t;\n          }, r.prototype.getTimeStep = function() {\n            return this._timeStep;\n          }, r.prototype._isImpostorInContact = function(t) {\n            return this._tmpContactCallbackResult = !1, this.world.contactTest(t.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;\n          }, r.prototype._isImpostorPairInContact = function(t, e) {\n            return this._tmpContactCallbackResult = !1, this.world.contactPairTest(t.physicsBody, e.physicsBody, this._tmpAmmoConcreteContactResultCallback), this._tmpContactCallbackResult;\n          }, r.prototype._stepSimulation = function(t, e, n) {\n            if (t === void 0 && (t = 1 / 60), e === void 0 && (e = 10), n === void 0 && (n = 1 / 60), e == 0)\n              this.world.stepSimulation(t, 0);\n            else\n              for (; e > 0 && t > 0; )\n                t - n < n ? (this.world.stepSimulation(t, 0), t = 0) : (t -= n, this.world.stepSimulation(n, 0)), e--;\n          }, r.prototype.executeStep = function(t, e) {\n            for (var n = 0, i = e; n < i.length; n++) {\n              var o = i[n];\n              o.soft || o.beforeStep();\n            }\n            this._stepSimulation(this._useDeltaForWorldStep ? t : this._timeStep, this._maxSteps, this._fixedTimeStep);\n            for (var a = 0, s = e; a < s.length; a++) {\n              var d = s[a];\n              if (d.soft ? this._afterSoftStep(d) : d.afterStep(), d._onPhysicsCollideCallbacks.length > 0 && this._isImpostorInContact(d))\n                for (var p = 0, y = d._onPhysicsCollideCallbacks; p < y.length; p++)\n                  for (var P = 0, R = y[p].otherImpostors; P < R.length; P++) {\n                    var B = R[P];\n                    (d.physicsBody.isActive() || B.physicsBody.isActive()) && this._isImpostorPairInContact(d, B) && (d.onCollide({ body: B.physicsBody, point: this._tmpContactPoint }), B.onCollide({ body: d.physicsBody, point: this._tmpContactPoint }));\n                  }\n            }\n          }, r.prototype._afterSoftStep = function(t) {\n            t.type === At.a.RopeImpostor ? this._ropeStep(t) : this._softbodyOrClothStep(t);\n          }, r.prototype._ropeStep = function(t) {\n            for (var e, n, i, o, a = t.physicsBody.get_m_nodes(), s = a.size(), d = new Array(), p = 0; p < s; p++)\n              n = (e = a.at(p).get_m_x()).x(), i = e.y(), o = e.z(), d.push(new u.e(n, i, o));\n            var y = t.object, P = t.getParam(\"shape\");\n            t._isFromLine ? t.object = sn.a.CreateLines(\"lines\", { points: d, instance: y }) : t.object = Jo.a.ExtrudeShape(\"ext\", { shape: P, path: d, instance: y });\n          }, r.prototype._softbodyOrClothStep = function(t) {\n            var e = t.type === At.a.ClothImpostor ? 1 : -1, n = t.object, i = n.getVerticesData(Oe.b.PositionKind);\n            i || (i = []);\n            var o = n.getVerticesData(Oe.b.NormalKind);\n            o || (o = []);\n            for (var a, s, d, p, y, P, R, B, F = i.length / 3, z = t.physicsBody.get_m_nodes(), J = 0; J < F; J++) {\n              var ie;\n              d = (s = (a = z.at(J)).get_m_x()).x(), p = s.y(), y = s.z() * e, P = (ie = a.get_m_n()).x(), R = ie.y(), B = ie.z() * e, i[3 * J] = d, i[3 * J + 1] = p, i[3 * J + 2] = y, o[3 * J] = P, o[3 * J + 1] = R, o[3 * J + 2] = B;\n            }\n            var se = new ht.a();\n            se.positions = i, se.normals = o, se.uvs = n.getVerticesData(Oe.b.UVKind), se.colors = n.getVerticesData(Oe.b.ColorKind), n && n.getIndices && (se.indices = n.getIndices()), se.applyToMesh(n);\n          }, r.prototype.applyImpulse = function(t, e, n) {\n            if (t.soft)\n              l.a.Warn(\"Cannot be applied to a soft body\");\n            else {\n              t.physicsBody.activate();\n              var i = this._tmpAmmoVectorA, o = this._tmpAmmoVectorB;\n              t.object && t.object.getWorldMatrix && n.subtractInPlace(t.object.getWorldMatrix().getTranslation()), i.setValue(n.x, n.y, n.z), o.setValue(e.x, e.y, e.z), t.physicsBody.applyImpulse(o, i);\n            }\n          }, r.prototype.applyForce = function(t, e, n) {\n            if (t.soft)\n              l.a.Warn(\"Cannot be applied to a soft body\");\n            else {\n              t.physicsBody.activate();\n              var i = this._tmpAmmoVectorA, o = this._tmpAmmoVectorB;\n              t.object && t.object.getWorldMatrix && n.subtractInPlace(t.object.getWorldMatrix().getTranslation()), i.setValue(n.x, n.y, n.z), o.setValue(e.x, e.y, e.z), t.physicsBody.applyForce(o, i);\n            }\n          }, r.prototype.generatePhysicsBody = function(t) {\n            if (t._pluginData.toDispose = [], t.parent)\n              t.physicsBody && (this.removePhysicsBody(t), t.forceUpdate());\n            else if (t.isBodyInitRequired()) {\n              var e = this._createShape(t), n = t.getParam(\"mass\");\n              if (t._pluginData.mass = n, t.soft)\n                e.get_m_cfg().set_collisions(17), e.get_m_cfg().set_kDP(t.getParam(\"damping\")), this.bjsAMMO.castObject(e, this.bjsAMMO.btCollisionObject).getCollisionShape().setMargin(t.getParam(\"margin\")), e.setActivationState(r.DISABLE_DEACTIVATION_FLAG), this.world.addSoftBody(e, 1, -1), t.physicsBody = e, t._pluginData.toDispose.push(e), this.setBodyPressure(t, 0), t.type === At.a.SoftbodyImpostor && this.setBodyPressure(t, t.getParam(\"pressure\")), this.setBodyStiffness(t, t.getParam(\"stiffness\")), this.setBodyVelocityIterations(t, t.getParam(\"velocityIterations\")), this.setBodyPositionIterations(t, t.getParam(\"positionIterations\"));\n              else {\n                var i = new this.bjsAMMO.btVector3(0, 0, 0), o = new this.bjsAMMO.btTransform();\n                o.setIdentity(), n !== 0 && e.calculateLocalInertia(n, i), this._tmpAmmoVectorA.setValue(t.object.position.x, t.object.position.y, t.object.position.z), this._tmpAmmoQuaternion.setValue(t.object.rotationQuaternion.x, t.object.rotationQuaternion.y, t.object.rotationQuaternion.z, t.object.rotationQuaternion.w), o.setOrigin(this._tmpAmmoVectorA), o.setRotation(this._tmpAmmoQuaternion);\n                var a = new this.bjsAMMO.btDefaultMotionState(o), s = new this.bjsAMMO.btRigidBodyConstructionInfo(n, a, e, i), d = new this.bjsAMMO.btRigidBody(s);\n                n === 0 && (d.setCollisionFlags(d.getCollisionFlags() | r.KINEMATIC_FLAG), d.setActivationState(r.DISABLE_DEACTIVATION_FLAG)), t.type != At.a.NoImpostor || e.getChildShape || d.setCollisionFlags(d.getCollisionFlags() | r.DISABLE_COLLISION_FLAG);\n                var p = t.getParam(\"group\"), y = t.getParam(\"mask\");\n                p && y ? this.world.addRigidBody(d, p, y) : this.world.addRigidBody(d), t.physicsBody = d, t._pluginData.toDispose = t._pluginData.toDispose.concat([d, s, a, o, i, e]);\n              }\n              this.setBodyRestitution(t, t.getParam(\"restitution\")), this.setBodyFriction(t, t.getParam(\"friction\"));\n            }\n          }, r.prototype.removePhysicsBody = function(t) {\n            var e = this;\n            this.world && (t.soft ? this.world.removeSoftBody(t.physicsBody) : this.world.removeRigidBody(t.physicsBody), t._pluginData && (t._pluginData.toDispose.forEach(function(n) {\n              e.bjsAMMO.destroy(n);\n            }), t._pluginData.toDispose = []));\n          }, r.prototype.generateJoint = function(t) {\n            var e = t.mainImpostor.physicsBody, n = t.connectedImpostor.physicsBody;\n            if (e && n) {\n              var i, o = t.joint.jointData;\n              switch (o.mainPivot || (o.mainPivot = new u.e(0, 0, 0)), o.connectedPivot || (o.connectedPivot = new u.e(0, 0, 0)), t.joint.type) {\n                case Jt.e.DistanceJoint:\n                  var a = o.maxDistance;\n                  a && (o.mainPivot = new u.e(0, -a / 2, 0), o.connectedPivot = new u.e(0, a / 2, 0)), i = new this.bjsAMMO.btPoint2PointConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z));\n                  break;\n                case Jt.e.HingeJoint:\n                  o.mainAxis || (o.mainAxis = new u.e(0, 0, 0)), o.connectedAxis || (o.connectedAxis = new u.e(0, 0, 0));\n                  var s = new this.bjsAMMO.btVector3(o.mainAxis.x, o.mainAxis.y, o.mainAxis.z), d = new this.bjsAMMO.btVector3(o.connectedAxis.x, o.connectedAxis.y, o.connectedAxis.z);\n                  i = new this.bjsAMMO.btHingeConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z), s, d);\n                  break;\n                case Jt.e.BallAndSocketJoint:\n                  i = new this.bjsAMMO.btPoint2PointConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z));\n                  break;\n                default:\n                  l.a.Warn(\"JointType not currently supported by the Ammo plugin, falling back to PhysicsJoint.BallAndSocketJoint\"), i = new this.bjsAMMO.btPoint2PointConstraint(e, n, new this.bjsAMMO.btVector3(o.mainPivot.x, o.mainPivot.y, o.mainPivot.z), new this.bjsAMMO.btVector3(o.connectedPivot.x, o.connectedPivot.y, o.connectedPivot.z));\n              }\n              this.world.addConstraint(i, !t.joint.jointData.collision), t.joint.physicsJoint = i;\n            }\n          }, r.prototype.removeJoint = function(t) {\n            this.world && this.world.removeConstraint(t.joint.physicsJoint);\n          }, r.prototype._addMeshVerts = function(t, e, n) {\n            var i = this, o = 0;\n            if (n && n.getIndices && n.getWorldMatrix && n.getChildMeshes) {\n              var a = n.getIndices();\n              a || (a = []);\n              var s = n.getVerticesData(Oe.b.PositionKind);\n              s || (s = []), n.computeWorldMatrix(!1);\n              for (var d = a.length / 3, p = 0; p < d; p++) {\n                for (var y = [], P = 0; P < 3; P++) {\n                  var R, B = new u.e(s[3 * a[3 * p + P] + 0], s[3 * a[3 * p + P] + 1], s[3 * a[3 * p + P] + 2]);\n                  u.a.ScalingToRef(n.scaling.x, n.scaling.y, n.scaling.z, this._tmpMatrix), B = u.e.TransformCoordinates(B, this._tmpMatrix), (R = P == 0 ? this._tmpAmmoVectorA : P == 1 ? this._tmpAmmoVectorB : this._tmpAmmoVectorC).setValue(B.x, B.y, B.z), y.push(R);\n                }\n                t.addTriangle(y[0], y[1], y[2]), o++;\n              }\n              n.getChildMeshes().forEach(function(F) {\n                o += i._addMeshVerts(t, e, F);\n              });\n            }\n            return o;\n          }, r.prototype._softVertexData = function(t) {\n            var e = t.object;\n            if (e && e.getIndices && e.getWorldMatrix && e.getChildMeshes) {\n              e.getIndices();\n              var n = e.getVerticesData(Oe.b.PositionKind);\n              n || (n = []);\n              var i = e.getVerticesData(Oe.b.NormalKind);\n              i || (i = []), e.computeWorldMatrix(!1);\n              for (var o = [], a = [], s = 0; s < n.length; s += 3) {\n                var d = new u.e(n[s], n[s + 1], n[s + 2]), p = new u.e(i[s], i[s + 1], i[s + 2]);\n                d = u.e.TransformCoordinates(d, e.getWorldMatrix()), p = u.e.TransformNormal(p, e.getWorldMatrix()), o.push(d.x, d.y, d.z), a.push(p.x, p.y, p.z);\n              }\n              var y = new ht.a();\n              return y.positions = o, y.normals = a, y.uvs = e.getVerticesData(Oe.b.UVKind), y.colors = e.getVerticesData(Oe.b.ColorKind), e && e.getIndices && (y.indices = e.getIndices()), y.applyToMesh(e), e.position = u.e.Zero(), e.rotationQuaternion = null, e.rotation = u.e.Zero(), e.computeWorldMatrix(!0), y;\n            }\n            return ht.a.ExtractFromMesh(e);\n          }, r.prototype._createSoftbody = function(t) {\n            var e = t.object;\n            if (e && e.getIndices) {\n              var n = e.getIndices();\n              n || (n = []);\n              var i = this._softVertexData(t), o = i.positions, a = i.normals;\n              if (o === null || a === null)\n                return new this.bjsAMMO.btCompoundShape();\n              for (var s = [], d = [], p = 0; p < o.length; p += 3) {\n                var y = new u.e(o[p], o[p + 1], o[p + 2]), P = new u.e(a[p], a[p + 1], a[p + 2]);\n                s.push(y.x, y.y, -y.z), d.push(P.x, P.y, -P.z);\n              }\n              var R = new this.bjsAMMO.btSoftBodyHelpers().CreateFromTriMesh(this.world.getWorldInfo(), s, e.getIndices(), n.length / 3, !0), B = o.length / 3, F = R.get_m_nodes();\n              for (p = 0; p < B; p++) {\n                var z;\n                (z = F.at(p).get_m_n()).setX(d[3 * p]), z.setY(d[3 * p + 1]), z.setZ(d[3 * p + 2]);\n              }\n              return R;\n            }\n          }, r.prototype._createCloth = function(t) {\n            var e = t.object;\n            if (e && e.getIndices) {\n              e.getIndices();\n              var n = this._softVertexData(t), i = n.positions, o = n.normals;\n              if (i === null || o === null)\n                return new this.bjsAMMO.btCompoundShape();\n              var a = i.length, s = Math.sqrt(a / 3);\n              t.segments = s;\n              var d = s - 1;\n              return this._tmpAmmoVectorA.setValue(i[0], i[1], i[2]), this._tmpAmmoVectorB.setValue(i[3 * d], i[3 * d + 1], i[3 * d + 2]), this._tmpAmmoVectorD.setValue(i[a - 3], i[a - 2], i[a - 1]), this._tmpAmmoVectorC.setValue(i[a - 3 - 3 * d], i[a - 2 - 3 * d], i[a - 1 - 3 * d]), new this.bjsAMMO.btSoftBodyHelpers().CreatePatch(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, this._tmpAmmoVectorC, this._tmpAmmoVectorD, s, s, t.getParam(\"fixedPoints\"), !0);\n            }\n          }, r.prototype._createRope = function(t) {\n            var e, n, i = this._softVertexData(t), o = i.positions, a = i.normals;\n            if (o === null || a === null)\n              return new this.bjsAMMO.btCompoundShape();\n            if (i.applyToMesh(t.object, !0), t._isFromLine = !0, a.map(function(y) {\n              return y * y;\n            }).reduce(function(y, P) {\n              return y + P;\n            }) === 0)\n              n = (e = o.length) / 3 - 1, this._tmpAmmoVectorA.setValue(o[0], o[1], o[2]), this._tmpAmmoVectorB.setValue(o[e - 3], o[e - 2], o[e - 1]);\n            else {\n              t._isFromLine = !1;\n              var s = t.getParam(\"path\");\n              if (t.getParam(\"shape\") === null)\n                return l.a.Warn(\"No shape available for extruded mesh\"), new this.bjsAMMO.btCompoundShape();\n              if (o.length % (3 * s.length) != 0)\n                return l.a.Warn(\"Path does not match extrusion\"), new this.bjsAMMO.btCompoundShape();\n              n = (e = s.length) - 1, this._tmpAmmoVectorA.setValue(s[0].x, s[0].y, s[0].z), this._tmpAmmoVectorB.setValue(s[e - 1].x, s[e - 1].y, s[e - 1].z);\n            }\n            t.segments = n;\n            var d = t.getParam(\"fixedPoints\");\n            d = d > 3 ? 3 : d;\n            var p = new this.bjsAMMO.btSoftBodyHelpers().CreateRope(this.world.getWorldInfo(), this._tmpAmmoVectorA, this._tmpAmmoVectorB, n - 1, d);\n            return p.get_m_cfg().set_collisions(17), p;\n          }, r.prototype._createCustom = function(t) {\n            var e = null;\n            return this.onCreateCustomShape && (e = this.onCreateCustomShape(t)), e == null && (e = new this.bjsAMMO.btCompoundShape()), e;\n          }, r.prototype._addHullVerts = function(t, e, n) {\n            var i = this, o = 0;\n            if (n && n.getIndices && n.getWorldMatrix && n.getChildMeshes) {\n              var a = n.getIndices();\n              a || (a = []);\n              var s = n.getVerticesData(Oe.b.PositionKind);\n              s || (s = []), n.computeWorldMatrix(!1);\n              for (var d = a.length / 3, p = 0; p < d; p++) {\n                for (var y = [], P = 0; P < 3; P++) {\n                  var R, B = new u.e(s[3 * a[3 * p + P] + 0], s[3 * a[3 * p + P] + 1], s[3 * a[3 * p + P] + 2]);\n                  u.a.ScalingToRef(n.scaling.x, n.scaling.y, n.scaling.z, this._tmpMatrix), B = u.e.TransformCoordinates(B, this._tmpMatrix), (R = P == 0 ? this._tmpAmmoVectorA : P == 1 ? this._tmpAmmoVectorB : this._tmpAmmoVectorC).setValue(B.x, B.y, B.z), y.push(R);\n                }\n                t.addPoint(y[0], !0), t.addPoint(y[1], !0), t.addPoint(y[2], !0), o++;\n              }\n              n.getChildMeshes().forEach(function(F) {\n                o += i._addHullVerts(t, e, F);\n              });\n            }\n            return o;\n          }, r.prototype._createShape = function(t, e) {\n            var n = this;\n            e === void 0 && (e = !1);\n            var i, o = t.object, a = t.getObjectExtendSize();\n            if (!e) {\n              var s = t.object.getChildMeshes ? t.object.getChildMeshes(!0) : [];\n              i = new this.bjsAMMO.btCompoundShape();\n              var d = 0;\n              if (s.forEach(function(F) {\n                var z = F.getPhysicsImpostor();\n                if (z) {\n                  if (z.type == At.a.MeshImpostor)\n                    throw \"A child MeshImpostor is not supported. Only primitive impostors are supported as children (eg. box or sphere)\";\n                  var J = n._createShape(z), ie = F.parent.getWorldMatrix().clone(), se = new u.e();\n                  ie.decompose(se), n._tmpAmmoTransform.getOrigin().setValue(F.position.x * se.x, F.position.y * se.y, F.position.z * se.z), n._tmpAmmoQuaternion.setValue(F.rotationQuaternion.x, F.rotationQuaternion.y, F.rotationQuaternion.z, F.rotationQuaternion.w), n._tmpAmmoTransform.setRotation(n._tmpAmmoQuaternion), i.addChildShape(n._tmpAmmoTransform, J), z.dispose(), d++;\n                }\n              }), d > 0) {\n                if (t.type != At.a.NoImpostor) {\n                  var p = this._createShape(t, !0);\n                  p && (this._tmpAmmoTransform.getOrigin().setValue(0, 0, 0), this._tmpAmmoQuaternion.setValue(0, 0, 0, 1), this._tmpAmmoTransform.setRotation(this._tmpAmmoQuaternion), i.addChildShape(this._tmpAmmoTransform, p));\n                }\n                return i;\n              }\n              this.bjsAMMO.destroy(i), i = null;\n            }\n            switch (t.type) {\n              case At.a.SphereImpostor:\n                if ($.a.WithinEpsilon(a.x, a.y, 1e-4) && $.a.WithinEpsilon(a.x, a.z, 1e-4))\n                  i = new this.bjsAMMO.btSphereShape(a.x / 2);\n                else {\n                  var y = [new this.bjsAMMO.btVector3(0, 0, 0)];\n                  (i = new this.bjsAMMO.btMultiSphereShape(y, [1], 1)).setLocalScaling(new this.bjsAMMO.btVector3(a.x / 2, a.y / 2, a.z / 2));\n                }\n                break;\n              case At.a.CapsuleImpostor:\n                i = new this.bjsAMMO.btCapsuleShape(a.x / 2, a.y / 2);\n                break;\n              case At.a.CylinderImpostor:\n                this._tmpAmmoVectorA.setValue(a.x / 2, a.y / 2, a.z / 2), i = new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);\n                break;\n              case At.a.PlaneImpostor:\n              case At.a.BoxImpostor:\n                this._tmpAmmoVectorA.setValue(a.x / 2, a.y / 2, a.z / 2), i = new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);\n                break;\n              case At.a.MeshImpostor:\n                if (t.getParam(\"mass\") == 0) {\n                  var P = new this.bjsAMMO.btTriangleMesh();\n                  t._pluginData.toDispose.push(P);\n                  var R = this._addMeshVerts(P, o, o);\n                  i = R == 0 ? new this.bjsAMMO.btCompoundShape() : new this.bjsAMMO.btBvhTriangleMeshShape(P);\n                  break;\n                }\n              case At.a.ConvexHullImpostor:\n                var B = new this.bjsAMMO.btConvexHullShape();\n                (R = this._addHullVerts(B, o, o)) == 0 ? (t._pluginData.toDispose.push(B), i = new this.bjsAMMO.btCompoundShape()) : i = B;\n                break;\n              case At.a.NoImpostor:\n                i = new this.bjsAMMO.btSphereShape(a.x / 2);\n                break;\n              case At.a.CustomImpostor:\n                i = this._createCustom(t);\n                break;\n              case At.a.SoftbodyImpostor:\n                i = this._createSoftbody(t);\n                break;\n              case At.a.ClothImpostor:\n                i = this._createCloth(t);\n                break;\n              case At.a.RopeImpostor:\n                i = this._createRope(t);\n                break;\n              default:\n                l.a.Warn(\"The impostor type is not currently supported by the ammo plugin.\");\n            }\n            return i;\n          }, r.prototype.setTransformationFromPhysicsBody = function(t) {\n            t.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), t.object.position.set(this._tmpAmmoTransform.getOrigin().x(), this._tmpAmmoTransform.getOrigin().y(), this._tmpAmmoTransform.getOrigin().z()), t.object.rotationQuaternion ? t.object.rotationQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()) : t.object.rotation && (this._tmpQuaternion.set(this._tmpAmmoTransform.getRotation().x(), this._tmpAmmoTransform.getRotation().y(), this._tmpAmmoTransform.getRotation().z(), this._tmpAmmoTransform.getRotation().w()), this._tmpQuaternion.toEulerAnglesToRef(t.object.rotation));\n          }, r.prototype.setPhysicsBodyTransformation = function(t, e, n) {\n            var i = t.physicsBody.getWorldTransform();\n            if (Math.abs(i.getOrigin().x() - e.x) > Vt.a || Math.abs(i.getOrigin().y() - e.y) > Vt.a || Math.abs(i.getOrigin().z() - e.z) > Vt.a || Math.abs(i.getRotation().x() - n.x) > Vt.a || Math.abs(i.getRotation().y() - n.y) > Vt.a || Math.abs(i.getRotation().z() - n.z) > Vt.a || Math.abs(i.getRotation().w() - n.w) > Vt.a)\n              if (this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), i.setOrigin(this._tmpAmmoVectorA), this._tmpAmmoQuaternion.setValue(n.x, n.y, n.z, n.w), i.setRotation(this._tmpAmmoQuaternion), t.physicsBody.setWorldTransform(i), t.mass == 0) {\n                var o = t.physicsBody.getMotionState();\n                o && o.setWorldTransform(i);\n              } else\n                t.physicsBody.activate();\n          }, r.prototype.isSupported = function() {\n            return this.bjsAMMO !== void 0;\n          }, r.prototype.setLinearVelocity = function(t, e) {\n            this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), t.soft ? t.physicsBody.linearVelocity(this._tmpAmmoVectorA) : t.physicsBody.setLinearVelocity(this._tmpAmmoVectorA);\n          }, r.prototype.setAngularVelocity = function(t, e) {\n            this._tmpAmmoVectorA.setValue(e.x, e.y, e.z), t.soft ? t.physicsBody.angularVelocity(this._tmpAmmoVectorA) : t.physicsBody.setAngularVelocity(this._tmpAmmoVectorA);\n          }, r.prototype.getLinearVelocity = function(t) {\n            if (t.soft)\n              var e = t.physicsBody.linearVelocity();\n            else\n              e = t.physicsBody.getLinearVelocity();\n            if (!e)\n              return null;\n            var n = new u.e(e.x(), e.y(), e.z());\n            return this.bjsAMMO.destroy(e), n;\n          }, r.prototype.getAngularVelocity = function(t) {\n            if (t.soft)\n              var e = t.physicsBody.angularVelocity();\n            else\n              e = t.physicsBody.getAngularVelocity();\n            if (!e)\n              return null;\n            var n = new u.e(e.x(), e.y(), e.z());\n            return this.bjsAMMO.destroy(e), n;\n          }, r.prototype.setBodyMass = function(t, e) {\n            t.soft ? t.physicsBody.setTotalMass(e, !1) : t.physicsBody.setMassProps(e), t._pluginData.mass = e;\n          }, r.prototype.getBodyMass = function(t) {\n            return t._pluginData.mass || 0;\n          }, r.prototype.getBodyFriction = function(t) {\n            return t._pluginData.friction || 0;\n          }, r.prototype.setBodyFriction = function(t, e) {\n            t.soft ? t.physicsBody.get_m_cfg().set_kDF(e) : t.physicsBody.setFriction(e), t._pluginData.friction = e;\n          }, r.prototype.getBodyRestitution = function(t) {\n            return t._pluginData.restitution || 0;\n          }, r.prototype.setBodyRestitution = function(t, e) {\n            t.physicsBody.setRestitution(e), t._pluginData.restitution = e;\n          }, r.prototype.getBodyPressure = function(t) {\n            return t.soft ? t._pluginData.pressure || 0 : (l.a.Warn(\"Pressure is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyPressure = function(t, e) {\n            t.soft ? t.type === At.a.SoftbodyImpostor ? (t.physicsBody.get_m_cfg().set_kPR(e), t._pluginData.pressure = e) : (t.physicsBody.get_m_cfg().set_kPR(0), t._pluginData.pressure = 0) : l.a.Warn(\"Pressure can only be applied to a softbody\");\n          }, r.prototype.getBodyStiffness = function(t) {\n            return t.soft ? t._pluginData.stiffness || 0 : (l.a.Warn(\"Stiffness is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyStiffness = function(t, e) {\n            t.soft ? (e = (e = e < 0 ? 0 : e) > 1 ? 1 : e, t.physicsBody.get_m_materials().at(0).set_m_kLST(e), t._pluginData.stiffness = e) : l.a.Warn(\"Stiffness cannot be applied to a rigid body\");\n          }, r.prototype.getBodyVelocityIterations = function(t) {\n            return t.soft ? t._pluginData.velocityIterations || 0 : (l.a.Warn(\"Velocity iterations is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyVelocityIterations = function(t, e) {\n            t.soft ? (e = e < 0 ? 0 : e, t.physicsBody.get_m_cfg().set_viterations(e), t._pluginData.velocityIterations = e) : l.a.Warn(\"Velocity iterations cannot be applied to a rigid body\");\n          }, r.prototype.getBodyPositionIterations = function(t) {\n            return t.soft ? t._pluginData.positionIterations || 0 : (l.a.Warn(\"Position iterations is not a property of a rigid body\"), 0);\n          }, r.prototype.setBodyPositionIterations = function(t, e) {\n            t.soft ? (e = e < 0 ? 0 : e, t.physicsBody.get_m_cfg().set_piterations(e), t._pluginData.positionIterations = e) : l.a.Warn(\"Position iterations cannot be applied to a rigid body\");\n          }, r.prototype.appendAnchor = function(t, e, n, i, o, a) {\n            o === void 0 && (o = 1), a === void 0 && (a = !1);\n            var s = t.segments, d = Math.round((s - 1) * n) + s * (s - 1 - Math.round((s - 1) * i));\n            t.physicsBody.appendAnchor(d, e.physicsBody, a, o);\n          }, r.prototype.appendHook = function(t, e, n, i, o) {\n            i === void 0 && (i = 1), o === void 0 && (o = !1);\n            var a = Math.round(t.segments * n);\n            t.physicsBody.appendAnchor(a, e.physicsBody, o, i);\n          }, r.prototype.sleepBody = function(t) {\n            l.a.Warn(\"sleepBody is not currently supported by the Ammo physics plugin\");\n          }, r.prototype.wakeUpBody = function(t) {\n            t.physicsBody.activate();\n          }, r.prototype.updateDistanceJoint = function(t, e, n) {\n            l.a.Warn(\"updateDistanceJoint is not currently supported by the Ammo physics plugin\");\n          }, r.prototype.setMotor = function(t, e, n, i) {\n            t.physicsJoint.enableAngularMotor(!0, e, n);\n          }, r.prototype.setLimit = function(t, e, n) {\n            l.a.Warn(\"setLimit is not currently supported by the Ammo physics plugin\");\n          }, r.prototype.syncMeshWithImpostor = function(t, e) {\n            e.physicsBody.getMotionState().getWorldTransform(this._tmpAmmoTransform), t.position.x = this._tmpAmmoTransform.getOrigin().x(), t.position.y = this._tmpAmmoTransform.getOrigin().y(), t.position.z = this._tmpAmmoTransform.getOrigin().z(), t.rotationQuaternion && (t.rotationQuaternion.x = this._tmpAmmoTransform.getRotation().x(), t.rotationQuaternion.y = this._tmpAmmoTransform.getRotation().y(), t.rotationQuaternion.z = this._tmpAmmoTransform.getRotation().z(), t.rotationQuaternion.w = this._tmpAmmoTransform.getRotation().w());\n          }, r.prototype.getRadius = function(t) {\n            return t.getObjectExtendSize().x / 2;\n          }, r.prototype.getBoxSizeToRef = function(t, e) {\n            var n = t.getObjectExtendSize();\n            e.x = n.x, e.y = n.y, e.z = n.z;\n          }, r.prototype.dispose = function() {\n            this.bjsAMMO.destroy(this.world), this.bjsAMMO.destroy(this._solver), this.bjsAMMO.destroy(this._overlappingPairCache), this.bjsAMMO.destroy(this._dispatcher), this.bjsAMMO.destroy(this._collisionConfiguration), this.bjsAMMO.destroy(this._tmpAmmoVectorA), this.bjsAMMO.destroy(this._tmpAmmoVectorB), this.bjsAMMO.destroy(this._tmpAmmoVectorC), this.bjsAMMO.destroy(this._tmpAmmoTransform), this.bjsAMMO.destroy(this._tmpAmmoQuaternion), this.bjsAMMO.destroy(this._tmpAmmoConcreteContactResultCallback), this.world = null;\n          }, r.prototype.raycast = function(t, e) {\n            this._tmpAmmoVectorRCA = new this.bjsAMMO.btVector3(t.x, t.y, t.z), this._tmpAmmoVectorRCB = new this.bjsAMMO.btVector3(e.x, e.y, e.z);\n            var n = new this.bjsAMMO.ClosestRayResultCallback(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB);\n            return this.world.rayTest(this._tmpAmmoVectorRCA, this._tmpAmmoVectorRCB, n), this._raycastResult.reset(t, e), n.hasHit() && (this._raycastResult.setHitData({ x: n.get_m_hitNormalWorld().x(), y: n.get_m_hitNormalWorld().y(), z: n.get_m_hitNormalWorld().z() }, { x: n.get_m_hitPointWorld().x(), y: n.get_m_hitPointWorld().y(), z: n.get_m_hitPointWorld().z() }), this._raycastResult.calculateHitDistance()), this.bjsAMMO.destroy(n), this.bjsAMMO.destroy(this._tmpAmmoVectorRCA), this.bjsAMMO.destroy(this._tmpAmmoVectorRCB), this._raycastResult;\n          }, r.DISABLE_COLLISION_FLAG = 4, r.KINEMATIC_FLAG = 2, r.DISABLE_DEACTIVATION_FLAG = 4, r;\n        }();\n        V.a.prototype.removeReflectionProbe = function(r) {\n          if (!this.reflectionProbes)\n            return -1;\n          var t = this.reflectionProbes.indexOf(r);\n          return t !== -1 && this.reflectionProbes.splice(t, 1), t;\n        }, V.a.prototype.addReflectionProbe = function(r) {\n          this.reflectionProbes || (this.reflectionProbes = []), this.reflectionProbes.push(r);\n        };\n        var Du = function() {\n          function r(t, e, n, i, o) {\n            var a = this;\n            i === void 0 && (i = !0), o === void 0 && (o = !1), this.name = t, this._viewMatrix = u.a.Identity(), this._target = u.e.Zero(), this._add = u.e.Zero(), this._invertYAxis = !1, this.position = u.e.Zero(), this._scene = n, this._scene.reflectionProbes || (this._scene.reflectionProbes = new Array()), this._scene.reflectionProbes.push(this);\n            var s = h.a.TEXTURETYPE_UNSIGNED_BYTE;\n            if (o) {\n              var d = this._scene.getEngine().getCaps();\n              d.textureHalfFloatRender ? s = h.a.TEXTURETYPE_HALF_FLOAT : d.textureFloatRender && (s = h.a.TEXTURETYPE_FLOAT);\n            }\n            this._renderTargetTexture = new on(t, e, n, i, !0, s, !0), this._renderTargetTexture.onBeforeRenderObservable.add(function(p) {\n              switch (p) {\n                case 0:\n                  a._add.copyFromFloats(1, 0, 0);\n                  break;\n                case 1:\n                  a._add.copyFromFloats(-1, 0, 0);\n                  break;\n                case 2:\n                  a._add.copyFromFloats(0, a._invertYAxis ? 1 : -1, 0);\n                  break;\n                case 3:\n                  a._add.copyFromFloats(0, a._invertYAxis ? -1 : 1, 0);\n                  break;\n                case 4:\n                  a._add.copyFromFloats(0, 0, 1);\n                  break;\n                case 5:\n                  a._add.copyFromFloats(0, 0, -1);\n              }\n              a._attachedMesh && a.position.copyFrom(a._attachedMesh.getAbsolutePosition()), a.position.addToRef(a._add, a._target), u.a.LookAtLHToRef(a.position, a._target, u.e.Up(), a._viewMatrix), n.activeCamera && (a._projectionMatrix = u.a.PerspectiveFovLH(Math.PI / 2, 1, n.activeCamera.minZ, n.activeCamera.maxZ), n.setTransformMatrix(a._viewMatrix, a._projectionMatrix)), n._forcedViewPosition = a.position;\n            }), this._renderTargetTexture.onAfterUnbindObservable.add(function() {\n              n._forcedViewPosition = null, n.updateTransformMatrix(!0);\n            });\n          }\n          return Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this._renderTargetTexture.samples;\n          }, set: function(t) {\n            this._renderTargetTexture.samples = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"refreshRate\", { get: function() {\n            return this._renderTargetTexture.refreshRate;\n          }, set: function(t) {\n            this._renderTargetTexture.refreshRate = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getScene = function() {\n            return this._scene;\n          }, Object.defineProperty(r.prototype, \"cubeTexture\", { get: function() {\n            return this._renderTargetTexture;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"renderList\", { get: function() {\n            return this._renderTargetTexture.renderList;\n          }, enumerable: !1, configurable: !0 }), r.prototype.attachToMesh = function(t) {\n            this._attachedMesh = t;\n          }, r.prototype.setRenderingAutoClearDepthStencil = function(t, e) {\n            this._renderTargetTexture.setRenderingAutoClearDepthStencil(t, e);\n          }, r.prototype.dispose = function() {\n            var t = this._scene.reflectionProbes.indexOf(this);\n            t !== -1 && this._scene.reflectionProbes.splice(t, 1), this._renderTargetTexture && (this._renderTargetTexture.dispose(), this._renderTargetTexture = null);\n          }, r.prototype.toString = function(t) {\n            var e = \"Name: \" + this.name;\n            return t && (e += \", position: \" + this.position.toString(), this._attachedMesh && (e += \", attached mesh: \" + this._attachedMesh.name)), e;\n          }, r.prototype.getClassName = function() {\n            return \"ReflectionProbe\";\n          }, r.prototype.serialize = function() {\n            var t = L.a.Serialize(this, this._renderTargetTexture.serialize());\n            return t.isReflectionProbe = !0, t;\n          }, r.Parse = function(t, e, n) {\n            var i = null;\n            if (e.reflectionProbes)\n              for (var o = 0; o < e.reflectionProbes.length; o++) {\n                var a = e.reflectionProbes[o];\n                if (a.name === t.name) {\n                  i = a;\n                  break;\n                }\n              }\n            return (i = L.a.Parse(function() {\n              return i || new r(t.name, t.renderTargetSize, e, t._generateMipMaps);\n            }, t, e, n)).cubeTexture._waitingRenderList = t.renderList, t._attachedMesh && i.attachToMesh(e.getMeshByID(t._attachedMesh)), i;\n          }, Object(c.c)([Object(L.k)()], r.prototype, \"_attachedMesh\", void 0), Object(c.c)([Object(L.o)()], r.prototype, \"position\", void 0), r;\n        }(), x_ = !0, $o = function() {\n          function r() {\n          }\n          return r.LoaderInjectedPhysicsEngine = void 0, r;\n        }(), Lu = function(r, t, e, n) {\n          for (var i = 0, o = t.materials.length; i < o; i++) {\n            var a = t.materials[i];\n            if (a.id === r)\n              return zt.a.Parse(a, e, n);\n          }\n          return null;\n        }, C_ = function(r, t, e) {\n          for (var n in t)\n            if (r.name === t[n])\n              return e.push(r.id), !0;\n          return !(!r.parentId || e.indexOf(r.parentId) === -1) && (e.push(r.id), !0);\n        }, Ar = function(r, t) {\n          return r + \" of \" + (t ? t.file + \" from \" + t.name + \" version: \" + t.version + \", exporter version: \" + t.exporter_version : \"unknown\");\n        }, Nu = function(r, t) {\n          var e = t;\n          if (t._waitingData.lods) {\n            if (t._waitingData.lods.ids && t._waitingData.lods.ids.length > 0) {\n              var n = t._waitingData.lods.ids, i = e.isEnabled(!1);\n              if (t._waitingData.lods.distances) {\n                var o = t._waitingData.lods.distances;\n                if (o.length >= n.length) {\n                  var a = o.length > n.length ? o[o.length - 1] : 0;\n                  e.setEnabled(!1);\n                  for (var s = 0; s < n.length; s++) {\n                    var d = n[s], p = r.getMeshByID(d);\n                    p != null && e.addLODLevel(o[s], p);\n                  }\n                  a > 0 && e.addLODLevel(a, null), i === !0 && e.setEnabled(!0);\n                } else\n                  Xe.b.Warn(\"Invalid level of detail distances for \" + t.name);\n              }\n            }\n            t._waitingData.lods = null;\n          }\n        }, wu = function(r, t, e, n, i) {\n          i === void 0 && (i = !1);\n          var o = new An(r), a = \"importScene has failed JSON parse\";\n          try {\n            var s = JSON.parse(t);\n            a = \"\";\n            var d, p, y = Ft.loggingLevel === Ft.DETAILED_LOGGING;\n            if (s.environmentTexture !== void 0 && s.environmentTexture !== null) {\n              var P = s.isPBR === void 0 || s.isPBR;\n              if (s.environmentTextureType && s.environmentTextureType === \"BABYLON.HDRCubeTexture\") {\n                var R = s.environmentTextureSize ? s.environmentTextureSize : 128, B = new qo((s.environmentTexture.match(/https?:\\/\\//g) ? \"\" : e) + s.environmentTexture, r, R, !0, !P);\n                s.environmentTextureRotationY && (B.rotationY = s.environmentTextureRotationY), r.environmentTexture = B;\n              } else if (Hn.a.EndsWith(s.environmentTexture, \".env\")) {\n                var F = new ei((s.environmentTexture.match(/https?:\\/\\//g) ? \"\" : e) + s.environmentTexture, r);\n                s.environmentTextureRotationY && (F.rotationY = s.environmentTextureRotationY), r.environmentTexture = F;\n              } else {\n                var z = ei.CreateFromPrefilteredData((s.environmentTexture.match(/https?:\\/\\//g) ? \"\" : e) + s.environmentTexture, r);\n                s.environmentTextureRotationY && (z.rotationY = s.environmentTextureRotationY), r.environmentTexture = z;\n              }\n              if (s.createDefaultSkybox === !0) {\n                var J = r.activeCamera !== void 0 && r.activeCamera !== null ? (r.activeCamera.maxZ - r.activeCamera.minZ) / 2 : 1e3, ie = s.skyboxBlurLevel || 0;\n                r.createDefaultSkybox(r.environmentTexture, P, J, ie);\n              }\n              o.environmentTexture = r.environmentTexture;\n            }\n            if (s.environmentIntensity !== void 0 && s.environmentIntensity !== null && (r.environmentIntensity = s.environmentIntensity), s.lights !== void 0 && s.lights !== null)\n              for (d = 0, p = s.lights.length; d < p; d++) {\n                var se = s.lights[d], ce = bi.a.Parse(se, r);\n                ce && (o.lights.push(ce), a += d === 0 ? `\n\tLights:` : \"\", a += `\n\t\t` + ce.toString(y));\n              }\n            if (s.reflectionProbes !== void 0 && s.reflectionProbes !== null)\n              for (d = 0, p = s.reflectionProbes.length; d < p; d++) {\n                var ue = s.reflectionProbes[d], fe = Du.Parse(ue, r, e);\n                fe && (o.reflectionProbes.push(fe), a += d === 0 ? `\n\tReflection Probes:` : \"\", a += `\n\t\t` + fe.toString(y));\n              }\n            if (s.animations !== void 0 && s.animations !== null)\n              for (d = 0, p = s.animations.length; d < p; d++) {\n                var ve = s.animations[d], Te = O.a.GetClass(\"BABYLON.Animation\");\n                if (Te) {\n                  var Re = Te.Parse(ve);\n                  r.animations.push(Re), o.animations.push(Re), a += d === 0 ? `\n\tAnimations:` : \"\", a += `\n\t\t` + Re.toString(y);\n                }\n              }\n            if (s.materials !== void 0 && s.materials !== null)\n              for (d = 0, p = s.materials.length; d < p; d++) {\n                var Ae = s.materials[d], Ee = zt.a.Parse(Ae, r, e);\n                Ee && (o.materials.push(Ee), a += d === 0 ? `\n\tMaterials:` : \"\", a += `\n\t\t` + Ee.toString(y), Ee.getActiveTextures().forEach(function(Kt) {\n                  o.textures.indexOf(Kt) == -1 && o.textures.push(Kt);\n                }));\n              }\n            if (s.multiMaterials !== void 0 && s.multiMaterials !== null)\n              for (d = 0, p = s.multiMaterials.length; d < p; d++) {\n                var Se = s.multiMaterials[d], De = qi.a.ParseMultiMaterial(Se, r);\n                o.multiMaterials.push(De), a += d === 0 ? `\n\tMultiMaterials:` : \"\", a += `\n\t\t` + De.toString(y), De.getActiveTextures().forEach(function(Kt) {\n                  o.textures.indexOf(Kt) == -1 && o.textures.push(Kt);\n                });\n              }\n            if (s.morphTargetManagers !== void 0 && s.morphTargetManagers !== null)\n              for (var xe = 0, Le = s.morphTargetManagers; xe < Le.length; xe++) {\n                var Me = Le[xe];\n                o.morphTargetManagers.push(Zo.Parse(Me, r));\n              }\n            if (s.skeletons !== void 0 && s.skeletons !== null)\n              for (d = 0, p = s.skeletons.length; d < p; d++) {\n                var we = s.skeletons[d], Ye = Ao.Parse(we, r);\n                o.skeletons.push(Ye), a += d === 0 ? `\n\tSkeletons:` : \"\", a += `\n\t\t` + Ye.toString(y);\n              }\n            var et = s.geometries;\n            if (et != null) {\n              var nt = new Array(), ct = et.vertexData;\n              if (ct != null)\n                for (d = 0, p = ct.length; d < p; d++) {\n                  var Ke = ct[d];\n                  nt.push(Ns.a.Parse(Ke, r, e));\n                }\n              nt.forEach(function(Kt) {\n                Kt && o.geometries.push(Kt);\n              });\n            }\n            if (s.transformNodes !== void 0 && s.transformNodes !== null)\n              for (d = 0, p = s.transformNodes.length; d < p; d++) {\n                var rt = s.transformNodes[d], it = pr.a.Parse(rt, r, e);\n                o.transformNodes.push(it);\n              }\n            if (s.meshes !== void 0 && s.meshes !== null)\n              for (d = 0, p = s.meshes.length; d < p; d++) {\n                var qe = s.meshes[d], ut = Ie.a.Parse(qe, r, e);\n                if (o.meshes.push(ut), ut.hasInstances)\n                  for (var Ve = 0, Ze = ut.instances; Ve < Ze.length; Ve++) {\n                    var vt = Ze[Ve];\n                    o.meshes.push(vt);\n                  }\n                a += d === 0 ? `\n\tMeshes:` : \"\", a += `\n\t\t` + ut.toString(y);\n              }\n            if (s.cameras !== void 0 && s.cameras !== null)\n              for (d = 0, p = s.cameras.length; d < p; d++) {\n                var jt = s.cameras[d], Dt = _t.a.Parse(jt, r);\n                o.cameras.push(Dt), a += d === 0 ? `\n\tCameras:` : \"\", a += `\n\t\t` + Dt.toString(y);\n              }\n            if (s.postProcesses !== void 0 && s.postProcesses !== null)\n              for (d = 0, p = s.postProcesses.length; d < p; d++) {\n                var Yt = s.postProcesses[d], mt = ft.Parse(Yt, r, e);\n                mt && (o.postProcesses.push(mt), a += d === 0 ? `\nPostprocesses:` : \"\", a += `\n\t\t` + mt.toString());\n              }\n            if (s.animationGroups !== void 0 && s.animationGroups !== null)\n              for (d = 0, p = s.animationGroups.length; d < p; d++) {\n                var qt = s.animationGroups[d], Ht = je.Parse(qt, r);\n                o.animationGroups.push(Ht), a += d === 0 ? `\n\tAnimationGroups:` : \"\", a += `\n\t\t` + Ht.toString(y);\n              }\n            for (d = 0, p = r.cameras.length; d < p; d++)\n              (Dt = r.cameras[d])._waitingParentId && (Dt.parent = r.getLastEntryByID(Dt._waitingParentId), Dt._waitingParentId = null);\n            for (d = 0, p = r.lights.length; d < p; d++) {\n              var kt = r.lights[d];\n              kt && kt._waitingParentId && (kt.parent = r.getLastEntryByID(kt._waitingParentId), kt._waitingParentId = null);\n            }\n            for (d = 0, p = r.transformNodes.length; d < p; d++) {\n              var Wt = r.transformNodes[d];\n              Wt._waitingParentId && (Wt.parent = r.getLastEntryByID(Wt._waitingParentId), Wt._waitingParentId = null);\n            }\n            for (d = 0, p = r.meshes.length; d < p; d++)\n              (ut = r.meshes[d])._waitingParentId && (ut.parent = r.getLastEntryByID(ut._waitingParentId), ut._waitingParentId = null), ut._waitingData.lods && Nu(r, ut);\n            for (d = 0, p = r.skeletons.length; d < p; d++)\n              (Ye = r.skeletons[d])._hasWaitingData && (Ye.bones != null && Ye.bones.forEach(function(Kt) {\n                if (Kt._waitingTransformNodeId) {\n                  var oi = r.getLastEntryByID(Kt._waitingTransformNodeId);\n                  oi && Kt.linkTransformNode(oi), Kt._waitingTransformNodeId = null;\n                }\n              }), Ye._waitingOverrideMeshId && (Ye.overrideMesh = r.getMeshByID(Ye._waitingOverrideMeshId), Ye._waitingOverrideMeshId = null), Ye._hasWaitingData = null);\n            for (d = 0, p = r.meshes.length; d < p; d++) {\n              var bt = r.meshes[d];\n              bt._waitingData.freezeWorldMatrix ? (bt.freezeWorldMatrix(), bt._waitingData.freezeWorldMatrix = null) : bt.computeWorldMatrix(!0);\n            }\n            for (d = 0, p = r.lights.length; d < p; d++) {\n              var Rt = r.lights[d];\n              if (Rt._excludedMeshesIds.length > 0) {\n                for (var Zt = 0; Zt < Rt._excludedMeshesIds.length; Zt++) {\n                  var Mn = r.getMeshByID(Rt._excludedMeshesIds[Zt]);\n                  Mn && Rt.excludedMeshes.push(Mn);\n                }\n                Rt._excludedMeshesIds = [];\n              }\n              if (Rt._includedOnlyMeshesIds.length > 0) {\n                for (var Bn = 0; Bn < Rt._includedOnlyMeshesIds.length; Bn++) {\n                  var Kn = r.getMeshByID(Rt._includedOnlyMeshesIds[Bn]);\n                  Kn && Rt.includedOnlyMeshes.push(Kn);\n                }\n                Rt._includedOnlyMeshesIds = [];\n              }\n            }\n            for (V.a.Parse(s, r, o, e), d = 0, p = r.meshes.length; d < p; d++)\n              (ut = r.meshes[d])._waitingData.actions && (pe.Parse(ut._waitingData.actions, ut, r), ut._waitingData.actions = null);\n            s.actions !== void 0 && s.actions !== null && pe.Parse(s.actions, null, r);\n          } catch (Kt) {\n            var In = Ar(\"loadAssets\", s ? s.producer : \"Unknown\") + a;\n            if (!n)\n              throw l.a.Log(In), Kt;\n            n(In, Kt);\n          } finally {\n            i || o.removeAllFromScene(), a !== null && Ft.loggingLevel !== Ft.NO_LOGGING && l.a.Log(Ar(\"loadAssets\", s ? s.producer : \"Unknown\") + (Ft.loggingLevel !== Ft.MINIMAL_LOGGING ? a : \"\"));\n          }\n          return o;\n        };\n        Ft.RegisterPlugin({ name: \"babylon.js\", extensions: \".babylon\", canDirectLoad: function(r) {\n          return r.indexOf(\"babylon\") !== -1;\n        }, importMesh: function(r, t, e, n, i, o, a, s) {\n          var d = \"importMesh has failed JSON parse\";\n          try {\n            var p = JSON.parse(e);\n            d = \"\";\n            var y = Ft.loggingLevel === Ft.DETAILED_LOGGING;\n            r ? Array.isArray(r) || (r = [r]) : r = null;\n            var P = new Array();\n            if (p.meshes !== void 0 && p.meshes !== null) {\n              var R, B, F, z = [], J = [];\n              for (R = 0, B = p.meshes.length; R < B; R++) {\n                var ie = p.meshes[R];\n                if (r === null || C_(ie, r, P)) {\n                  if (r !== null && delete r[r.indexOf(ie.name)], ie.geometryId !== void 0 && ie.geometryId !== null && p.geometries !== void 0 && p.geometries !== null) {\n                    var se = !1;\n                    [\"boxes\", \"spheres\", \"cylinders\", \"toruses\", \"grounds\", \"planes\", \"torusKnots\", \"vertexData\"].forEach(function(it) {\n                      se !== !0 && p.geometries[it] && Array.isArray(p.geometries[it]) && p.geometries[it].forEach(function(qe) {\n                        if (qe.id === ie.geometryId) {\n                          switch (it) {\n                            case \"vertexData\":\n                              Ns.a.Parse(qe, t, n);\n                          }\n                          se = !0;\n                        }\n                      });\n                    }), se === !1 && l.a.Warn(\"Geometry not found for mesh \" + ie.id);\n                  }\n                  if (ie.materialId) {\n                    var ce = J.indexOf(ie.materialId) !== -1;\n                    if (ce === !1 && p.multiMaterials !== void 0 && p.multiMaterials !== null)\n                      for (var ue = 0, fe = p.multiMaterials.length; ue < fe; ue++) {\n                        var ve = p.multiMaterials[ue];\n                        if (ve.id === ie.materialId) {\n                          for (var Te = 0, Re = ve.materials.length; Te < Re; Te++) {\n                            var Ae, Ee = ve.materials[Te];\n                            J.push(Ee), (Ae = Lu(Ee, p, t, n)) && (d += `\n\tMaterial ` + Ae.toString(y));\n                          }\n                          J.push(ve.id);\n                          var Se = qi.a.ParseMultiMaterial(ve, t);\n                          Se && (ce = !0, d += `\n\tMulti-Material ` + Se.toString(y));\n                          break;\n                        }\n                      }\n                    ce === !1 && (J.push(ie.materialId), (Ae = Lu(ie.materialId, p, t, n)) ? d += `\n\tMaterial ` + Ae.toString(y) : l.a.Warn(\"Material not found for mesh \" + ie.id));\n                  }\n                  if (ie.skeletonId > -1 && p.skeletons !== void 0 && p.skeletons !== null && !(z.indexOf(ie.skeletonId) > -1))\n                    for (var De = 0, xe = p.skeletons.length; De < xe; De++) {\n                      var Le = p.skeletons[De];\n                      if (Le.id === ie.skeletonId) {\n                        var Me = Ao.Parse(Le, t);\n                        a.push(Me), z.push(Le.id), d += `\n\tSkeleton ` + Me.toString(y);\n                      }\n                    }\n                  if (p.morphTargetManagers !== void 0 && p.morphTargetManagers !== null)\n                    for (var we = 0, Ye = p.morphTargetManagers; we < Ye.length; we++) {\n                      var et = Ye[we];\n                      Zo.Parse(et, t);\n                    }\n                  var nt = Ie.a.Parse(ie, t, n);\n                  i.push(nt), d += `\n\tMesh ` + nt.toString(y);\n                }\n              }\n              for (R = 0, B = t.meshes.length; R < B; R++)\n                (F = t.meshes[R])._waitingParentId && (F.parent = t.getLastEntryByID(F._waitingParentId), F._waitingParentId = null), F._waitingData.lods && Nu(t, F);\n              for (R = 0, B = t.skeletons.length; R < B; R++)\n                (Me = t.skeletons[R])._hasWaitingData && (Me.bones != null && Me.bones.forEach(function(it) {\n                  if (it._waitingTransformNodeId) {\n                    var qe = t.getLastEntryByID(it._waitingTransformNodeId);\n                    qe && it.linkTransformNode(qe), it._waitingTransformNodeId = null;\n                  }\n                }), Me._waitingOverrideMeshId && (Me.overrideMesh = t.getMeshByID(Me._waitingOverrideMeshId), Me._waitingOverrideMeshId = null), Me._hasWaitingData = null);\n              for (R = 0, B = t.meshes.length; R < B; R++)\n                (F = t.meshes[R])._waitingData.freezeWorldMatrix ? (F.freezeWorldMatrix(), F._waitingData.freezeWorldMatrix = null) : F.computeWorldMatrix(!0);\n            }\n            if (p.particleSystems !== void 0 && p.particleSystems !== null) {\n              var ct = V.a.GetIndividualParser(ot.a.NAME_PARTICLESYSTEM);\n              if (ct)\n                for (R = 0, B = p.particleSystems.length; R < B; R++) {\n                  var Ke = p.particleSystems[R];\n                  P.indexOf(Ke.emitterId) !== -1 && o.push(ct(Ke, t, n));\n                }\n            }\n            return !0;\n          } catch (it) {\n            var rt = Ar(\"importMesh\", p ? p.producer : \"Unknown\") + d;\n            if (!s)\n              throw l.a.Log(rt), it;\n            s(rt, it);\n          } finally {\n            d !== null && Ft.loggingLevel !== Ft.NO_LOGGING && l.a.Log(Ar(\"importMesh\", p ? p.producer : \"Unknown\") + (Ft.loggingLevel !== Ft.MINIMAL_LOGGING ? d : \"\"));\n          }\n          return !1;\n        }, load: function(r, t, e, n) {\n          var i = \"importScene has failed JSON parse\";\n          try {\n            var o = JSON.parse(t);\n            if (i = \"\", o.useDelayedTextureLoading !== void 0 && o.useDelayedTextureLoading !== null && (r.useDelayedTextureLoading = o.useDelayedTextureLoading && !Ft.ForceFullSceneLoadingForIncremental), o.autoClear !== void 0 && o.autoClear !== null && (r.autoClear = o.autoClear), o.clearColor !== void 0 && o.clearColor !== null && (r.clearColor = I.b.FromArray(o.clearColor)), o.ambientColor !== void 0 && o.ambientColor !== null && (r.ambientColor = I.a.FromArray(o.ambientColor)), o.gravity !== void 0 && o.gravity !== null && (r.gravity = u.e.FromArray(o.gravity)), o.fogMode && o.fogMode !== 0)\n              switch (r.fogMode = o.fogMode, r.fogColor = I.a.FromArray(o.fogColor), r.fogStart = o.fogStart, r.fogEnd = o.fogEnd, r.fogDensity = o.fogDensity, i += \"\tFog mode for scene:  \", r.fogMode) {\n                case 1:\n                  i += `exp\n`;\n                  break;\n                case 2:\n                  i += `exp2\n`;\n                  break;\n                case 3:\n                  i += `linear\n`;\n              }\n            if (o.physicsEnabled) {\n              var a;\n              o.physicsEngine === \"cannon\" ? a = new Bs(void 0, void 0, $o.LoaderInjectedPhysicsEngine) : o.physicsEngine === \"oimo\" ? a = new Mu(void 0, $o.LoaderInjectedPhysicsEngine) : o.physicsEngine === \"ammo\" && (a = new Iu(void 0, $o.LoaderInjectedPhysicsEngine, void 0)), i = \"\tPhysics engine \" + (o.physicsEngine ? o.physicsEngine : \"oimo\") + ` enabled\n`;\n              var s = o.physicsGravity ? u.e.FromArray(o.physicsGravity) : null;\n              r.enablePhysics(s, a);\n            }\n            return o.metadata !== void 0 && o.metadata !== null && (r.metadata = o.metadata), o.collisionsEnabled !== void 0 && o.collisionsEnabled !== null && (r.collisionsEnabled = o.collisionsEnabled), !!wu(r, t, e, n, !0) && (o.autoAnimate && r.beginAnimation(r, o.autoAnimateFrom, o.autoAnimateTo, o.autoAnimateLoop, o.autoAnimateSpeed || 1), o.activeCameraID !== void 0 && o.activeCameraID !== null && r.setActiveCameraByID(o.activeCameraID), !0);\n          } catch (p) {\n            var d = Ar(\"importScene\", o ? o.producer : \"Unknown\") + i;\n            if (!n)\n              throw l.a.Log(d), p;\n            n(d, p);\n          } finally {\n            i !== null && Ft.loggingLevel !== Ft.NO_LOGGING && l.a.Log(Ar(\"importScene\", o ? o.producer : \"Unknown\") + (Ft.loggingLevel !== Ft.MINIMAL_LOGGING ? i : \"\"));\n          }\n          return !1;\n        }, loadAssetContainer: function(r, t, e, n) {\n          return wu(r, t, e, n);\n        } });\n        var R_ = f(121), Fu = function() {\n          function r(t) {\n            t === void 0 && (t = {}), this._isEnabled = !0, this.bias = t.bias === void 0 ? 0 : t.bias, this.power = t.power === void 0 ? 1 : t.power, this.leftColor = t.leftColor || I.a.White(), this.rightColor = t.rightColor || I.a.Black(), t.isEnabled === !1 && (this.isEnabled = !1);\n          }\n          return Object.defineProperty(r.prototype, \"isEnabled\", { get: function() {\n            return this._isEnabled;\n          }, set: function(t) {\n            this._isEnabled !== t && (this._isEnabled = t, Ue.a.MarkAllMaterialsAsDirty(h.a.MATERIAL_FresnelDirtyFlag | h.a.MATERIAL_MiscDirtyFlag));\n          }, enumerable: !1, configurable: !0 }), r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.equals = function(t) {\n            return t && this.bias === t.bias && this.power === t.power && this.leftColor.equals(t.leftColor) && this.rightColor.equals(t.rightColor) && this.isEnabled === t.isEnabled;\n          }, r.prototype.serialize = function() {\n            return { isEnabled: this.isEnabled, leftColor: this.leftColor.asArray(), rightColor: this.rightColor.asArray(), bias: this.bias, power: this.power };\n          }, r.Parse = function(t) {\n            return new r({ isEnabled: t.isEnabled, leftColor: I.a.FromArray(t.leftColor), rightColor: I.a.FromArray(t.rightColor), bias: t.bias, power: t.power || 1 });\n          }, r;\n        }();\n        L.a._FresnelParametersParser = Fu.Parse;\n        var Bu = f(119), Us = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i.maxSimultaneousLights = 4, i.disableLighting = !1, i.invertNormalMapX = !1, i.invertNormalMapY = !1, i.emissiveColor = new I.a(0, 0, 0), i.occlusionStrength = 1, i.useLightmapAsShadowmap = !1, i._useAlphaFromAlbedoTexture = !0, i._useAmbientInGrayScale = !0, i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"doubleSided\", { get: function() {\n            return this._twoSidedLighting;\n          }, set: function(e) {\n            this._twoSidedLighting !== e && (this._twoSidedLighting = e, this.backFaceCulling = !e, this._markAllSubMeshesAsTexturesDirty());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"PBRBaseSimpleMaterial\";\n          }, Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"maxSimultaneousLights\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsLightsDirty\")], t.prototype, \"disableLighting\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectionTexture\")], t.prototype, \"environmentTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapX\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"invertNormalMapY\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_bumpTexture\")], t.prototype, \"normalTexture\", void 0), Object(c.c)([Object(L.e)(\"emissive\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"emissiveTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTextureStrength\")], t.prototype, \"occlusionStrength\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_ambientTexture\")], t.prototype, \"occlusionTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_alphaCutOff\")], t.prototype, \"alphaCutOff\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"doubleSided\", null), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", null)], t.prototype, \"lightmapTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"useLightmapAsShadowmap\", void 0), t;\n        }(pn), Uu = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i._useRoughnessFromMetallicTextureAlpha = !1, i._useRoughnessFromMetallicTextureGreen = !0, i._useMetallnessFromMetallicTextureBlue = !0, i.metallic = 1, i.roughness = 1, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PBRMetallicRoughnessMaterial\";\n          }, t.prototype.clone = function(e) {\n            var n = this, i = L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n            return i.id = e, i.name = e, this.clearCoat.copyTo(i.clearCoat), this.anisotropy.copyTo(i.anisotropy), this.brdf.copyTo(i.brdf), this.sheen.copyTo(i.sheen), this.subSurface.copyTo(i.subSurface), i;\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.PBRMetallicRoughnessMaterial\", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return e.clearCoat && o.clearCoat.parse(e.clearCoat, n, i), e.anisotropy && o.anisotropy.parse(e.anisotropy, n, i), e.brdf && o.brdf.parse(e.brdf, n, i), e.sheen && o.sheen.parse(e.sheen, n, i), e.subSurface && o.subSurface.parse(e.subSurface, n, i), o;\n          }, Object(c.c)([Object(L.e)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoColor\")], t.prototype, \"baseColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoTexture\")], t.prototype, \"baseTexture\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"metallic\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\")], t.prototype, \"roughness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_metallicTexture\")], t.prototype, \"metallicRoughnessTexture\", void 0), t;\n        }(Us);\n        O.a.RegisteredTypes[\"BABYLON.PBRMetallicRoughnessMaterial\"] = Uu;\n        var Vu = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e, n) || this;\n            return i._useMicroSurfaceFromReflectivityMapAlpha = !0, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PBRSpecularGlossinessMaterial\";\n          }, t.prototype.clone = function(e) {\n            var n = this, i = L.a.Clone(function() {\n              return new t(e, n.getScene());\n            }, this);\n            return i.id = e, i.name = e, this.clearCoat.copyTo(i.clearCoat), this.anisotropy.copyTo(i.anisotropy), this.brdf.copyTo(i.brdf), this.sheen.copyTo(i.sheen), this.subSurface.copyTo(i.subSurface), i;\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"BABYLON.PBRSpecularGlossinessMaterial\", e.clearCoat = this.clearCoat.serialize(), e.anisotropy = this.anisotropy.serialize(), e.brdf = this.brdf.serialize(), e.sheen = this.sheen.serialize(), e.subSurface = this.subSurface.serialize(), e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return e.clearCoat && o.clearCoat.parse(e.clearCoat, n, i), e.anisotropy && o.anisotropy.parse(e.anisotropy, n, i), e.brdf && o.brdf.parse(e.brdf, n, i), e.sheen && o.sheen.parse(e.sheen, n, i), e.subSurface && o.subSurface.parse(e.subSurface, n, i), o;\n          }, Object(c.c)([Object(L.e)(\"diffuse\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoColor\")], t.prototype, \"diffuseColor\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_albedoTexture\")], t.prototype, \"diffuseTexture\", void 0), Object(c.c)([Object(L.e)(\"specular\"), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectivityColor\")], t.prototype, \"specularColor\", void 0), Object(c.c)([Object(L.c)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_microSurface\")], t.prototype, \"glossiness\", void 0), Object(c.c)([Object(L.m)(), Object(L.b)(\"_markAllSubMeshesAsTexturesDirty\", \"_reflectivityTexture\")], t.prototype, \"specularGlossinessTexture\", void 0), t;\n        }(Us);\n        O.a.RegisteredTypes[\"BABYLON.PBRSpecularGlossinessMaterial\"] = Vu;\n        var ea = f(73), ku = function(r) {\n          function t(e, n, i) {\n            i === void 0 && (i = null);\n            var o = r.call(this, n) || this;\n            if (!e)\n              return o;\n            if (o._textureMatrix = u.a.Identity(), o.name = e, o.url = e, o._onLoad = i, o._texture = o._getFromCache(e, !0), o._texture)\n              o._triggerOnLoad();\n            else {\n              var a = o.getScene();\n              a && a.useDelayedTextureLoading ? o.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : o.loadTexture();\n            }\n            return o;\n          }\n          return Object(c.d)(t, r), t.prototype._triggerOnLoad = function() {\n            this._onLoad && this._onLoad();\n          }, t.prototype.getTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.load3dlTexture = function() {\n            var e, n = this, i = this._getEngine();\n            e = i.webGLVersion === 1 ? i.createRawTexture(null, 1, 1, h.a.TEXTUREFORMAT_RGBA, !1, !1, h.a.TEXTURE_BILINEAR_SAMPLINGMODE, null, h.a.TEXTURETYPE_UNSIGNED_INT) : i.createRawTexture3D(null, 1, 1, 1, h.a.TEXTUREFORMAT_RGBA, !1, !1, h.a.TEXTURE_BILINEAR_SAMPLINGMODE, null, h.a.TEXTURETYPE_UNSIGNED_INT), this._texture = e, this._texture.isReady = !1, this.isCube = !1, this.is3D = i.webGLVersion > 1, this.wrapU = h.a.TEXTURE_CLAMP_ADDRESSMODE, this.wrapV = h.a.TEXTURE_CLAMP_ADDRESSMODE, this.wrapR = h.a.TEXTURE_CLAMP_ADDRESSMODE, this.anisotropicFilteringLevel = 1;\n            var o = function(s) {\n              if (typeof s == \"string\") {\n                for (var d, p = null, y = null, P = s.split(`\n`), R = 0, B = 0, F = 0, z = 0, J = 0, ie = 0; ie < P.length; ie++)\n                  if (d = P[ie], t._noneEmptyLineRegex.test(d) && d.indexOf(\"#\") !== 0) {\n                    var se = d.split(\" \");\n                    if (R !== 0) {\n                      if (R != 0) {\n                        var ce = Math.max(parseInt(se[0]), 0), ue = Math.max(parseInt(se[1]), 0), fe = Math.max(parseInt(se[2]), 0);\n                        J = Math.max(ce, J), J = Math.max(ue, J), J = Math.max(fe, J);\n                        var ve = 4 * (B + z * R + F * R * R);\n                        y && (y[ve + 0] = ce, y[ve + 1] = ue, y[ve + 2] = fe), ++F % R == 0 && (F = 0, ++z % R == 0 && (B++, z = 0));\n                      }\n                    } else\n                      R = se.length, p = new Uint8Array(R * R * R * 4), y = new Float32Array(R * R * R * 4);\n                  }\n                if (y && p)\n                  for (ie = 0; ie < y.length; ie++)\n                    if (ie > 0 && (ie + 1) % 4 == 0)\n                      p[ie] = 255;\n                    else {\n                      var Te = y[ie];\n                      p[ie] = Te / J * 255;\n                    }\n                e.is3D ? (e.updateSize(R, R, R), i.updateRawTexture3D(e, p, h.a.TEXTUREFORMAT_RGBA, !1)) : (e.updateSize(R * R, R), i.updateRawTexture(e, p, h.a.TEXTUREFORMAT_RGBA, !1)), e.isReady = !0, n._triggerOnLoad();\n              }\n            }, a = this.getScene();\n            return a ? a._loadFile(this.url, o) : i._loadFile(this.url, o), this._texture;\n          }, t.prototype.loadTexture = function() {\n            this.url && this.url.toLocaleLowerCase().indexOf(\".3dl\") == this.url.length - 4 && this.load3dlTexture();\n          }, t.prototype.clone = function() {\n            var e = new t(this.url, this.getScene() || this._getEngine());\n            return e.level = this.level, e;\n          }, t.prototype.delayLoad = function() {\n            this.delayLoadState === h.a.DELAYLOADSTATE_NOTLOADED && (this.delayLoadState = h.a.DELAYLOADSTATE_LOADED, this._texture = this._getFromCache(this.url, !0), this._texture || this.loadTexture());\n          }, t.Parse = function(e, n) {\n            var i = null;\n            return e.name && !e.isRenderTarget && ((i = new t(e.name, n)).name = e.name, i.level = e.level), i;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = {};\n            return e.name = this.name, e.level = this.level, e.customType = \"BABYLON.ColorGradingTexture\", e;\n          }, t._noneEmptyLineRegex = /\\S+/, t;\n        }(kn.a);\n        O.a.RegisteredTypes[\"BABYLON.ColorGradingTexture\"] = ku;\n        var Gu = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            o === void 0 && (o = !1), a === void 0 && (a = !0), s === void 0 && (s = null), d === void 0 && (d = null);\n            var p = r.call(this, n) || this;\n            if (p._onLoad = null, p._onError = null, !e)\n              throw new Error(\"Image url is not set\");\n            return p._coordinatesMode = Ne.a.CUBIC_MODE, p.name = e, p.url = e, p._size = i, p._noMipmap = o, p.gammaSpace = a, p._onLoad = s, p._onError = d, p.hasAlpha = !1, p.isCube = !0, p._texture = p._getFromCache(e, p._noMipmap), p._texture ? s && (p._texture.isReady ? Xe.b.SetImmediate(function() {\n              return s();\n            }) : p._texture.onLoadedObservable.add(s)) : n.useDelayedTextureLoading ? p.delayLoadState = h.a.DELAYLOADSTATE_NOTLOADED : p.loadImage(p.loadTexture.bind(p), p._onError), p;\n          }\n          return Object(c.d)(t, r), t.prototype.loadImage = function(e, n) {\n            var i = this, o = document.createElement(\"canvas\"), a = new Image();\n            a.addEventListener(\"load\", function() {\n              i._width = a.width, i._height = a.height, o.width = i._width, o.height = i._height;\n              var s = o.getContext(\"2d\");\n              s.drawImage(a, 0, 0);\n              var d = s.getImageData(0, 0, a.width, a.height);\n              i._buffer = d.data.buffer, o.remove(), e();\n            }), a.addEventListener(\"error\", function(s) {\n              n && n(i.getClassName() + \" could not be loaded\", s);\n            }), a.src = this.url;\n          }, t.prototype.loadTexture = function() {\n            var e = this, n = this.getScene();\n            n && (this._texture = n.getEngine().createRawCubeTextureFromUrl(this.url, n, this._size, h.a.TEXTUREFORMAT_RGB, n.getEngine().getCaps().textureFloat ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_UNSIGNED_INTEGER, this._noMipmap, function() {\n              for (var i = e.getFloat32ArrayFromArrayBuffer(e._buffer), o = ws.ConvertPanoramaToCubemap(i, e._width, e._height, e._size), a = [], s = 0; s < 6; s++) {\n                var d = o[t._FacesMapping[s]];\n                a.push(d);\n              }\n              return a;\n            }, null, this._onLoad, this._onError));\n          }, t.prototype.getFloat32ArrayFromArrayBuffer = function(e) {\n            for (var n = new DataView(e), i = new Float32Array(3 * e.byteLength / 4), o = 0, a = 0; a < e.byteLength; a++)\n              (a + 1) % 4 != 0 && (i[o++] = n.getUint8(a) / 255);\n            return i;\n          }, t.prototype.getClassName = function() {\n            return \"EquiRectangularCubeTexture\";\n          }, t.prototype.clone = function() {\n            var e = this.getScene();\n            if (!e)\n              return this;\n            var n = new t(this.url, e, this._size, this._noMipmap, this.gammaSpace);\n            return n.level = this.level, n.wrapU = this.wrapU, n.wrapV = this.wrapV, n.coordinatesIndex = this.coordinatesIndex, n.coordinatesMode = this.coordinatesMode, n;\n          }, t._FacesMapping = [\"right\", \"left\", \"up\", \"down\", \"front\", \"back\"], t;\n        }(kn.a), O_ = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, i.scene || i.engine) || this;\n            return n && (i.engine || i.scene) && (i = Object(c.a)(Object(c.a)({}, t.DefaultOptions), i), o._generateMipMaps = i.generateMipMaps, o._samplingMode = i.samplingMode, o._textureMatrix = u.a.Identity(), o.name = e, o.element = n, o._isVideo = n instanceof HTMLVideoElement, o.anisotropicFilteringLevel = 1, o._createInternalTexture()), o;\n          }\n          return Object(c.d)(t, r), t.prototype._createInternalTexture = function() {\n            var e = 0, n = 0;\n            this._isVideo ? (e = this.element.videoWidth, n = this.element.videoHeight) : (e = this.element.width, n = this.element.height);\n            var i = this._getEngine();\n            i && (this._texture = i.createDynamicTexture(e, n, this._generateMipMaps, this._samplingMode)), this.update();\n          }, t.prototype.getTextureMatrix = function() {\n            return this._textureMatrix;\n          }, t.prototype.update = function(e) {\n            e === void 0 && (e = null);\n            var n = this._getEngine();\n            if (this._texture != null && n != null)\n              if (this._isVideo) {\n                var i = this.element;\n                if (i.readyState < i.HAVE_CURRENT_DATA)\n                  return;\n                n.updateVideoTexture(this._texture, i, e === null || e);\n              } else {\n                var o = this.element;\n                n.updateDynamicTexture(this._texture, o, e === null || e, !1);\n              }\n          }, t.DefaultOptions = { generateMipMaps: !1, samplingMode: h.a.TEXTURE_BILINEAR_SAMPLINGMODE, engine: null, scene: null }, t;\n        }(kn.a), ta = function() {\n          function r() {\n          }\n          return r.GetTGAHeader = function(t) {\n            var e = 0;\n            return { id_length: t[e++], colormap_type: t[e++], image_type: t[e++], colormap_index: t[e++] | t[e++] << 8, colormap_length: t[e++] | t[e++] << 8, colormap_size: t[e++], origin: [t[e++] | t[e++] << 8, t[e++] | t[e++] << 8], width: t[e++] | t[e++] << 8, height: t[e++] | t[e++] << 8, pixel_size: t[e++], flags: t[e++] };\n          }, r.UploadContent = function(t, e) {\n            if (e.length < 19)\n              l.a.Error(\"Unable to load TGA file - Not enough data to contain header\");\n            else {\n              var n = 18, i = r.GetTGAHeader(e);\n              if (i.id_length + n > e.length)\n                l.a.Error(\"Unable to load TGA file - Not enough data\");\n              else {\n                n += i.id_length;\n                var o, a = !1, s = !1, d = !1;\n                switch (i.image_type) {\n                  case r._TYPE_RLE_INDEXED:\n                    a = !0;\n                  case r._TYPE_INDEXED:\n                    s = !0;\n                    break;\n                  case r._TYPE_RLE_RGB:\n                    a = !0;\n                  case r._TYPE_RGB:\n                    break;\n                  case r._TYPE_RLE_GREY:\n                    a = !0;\n                  case r._TYPE_GREY:\n                    d = !0;\n                }\n                var p, y, P, R, B, F, z, J = i.pixel_size >> 3, ie = i.width * i.height * J;\n                if (s && (p = e.subarray(n, n += i.colormap_length * (i.colormap_size >> 3))), a) {\n                  var se, ce, ue;\n                  o = new Uint8Array(ie);\n                  for (var fe = 0, ve = new Uint8Array(J); n < ie && fe < ie; )\n                    if (ce = 1 + (127 & (se = e[n++])), 128 & se) {\n                      for (ue = 0; ue < J; ++ue)\n                        ve[ue] = e[n++];\n                      for (ue = 0; ue < ce; ++ue)\n                        o.set(ve, fe + ue * J);\n                      fe += J * ce;\n                    } else {\n                      for (ce *= J, ue = 0; ue < ce; ++ue)\n                        o[fe + ue] = e[n++];\n                      fe += ce;\n                    }\n                } else\n                  o = e.subarray(n, n += s ? i.width * i.height : ie);\n                switch ((i.flags & r._ORIGIN_MASK) >> r._ORIGIN_SHIFT) {\n                  default:\n                  case r._ORIGIN_UL:\n                    y = 0, R = 1, z = i.width, P = 0, B = 1, F = i.height;\n                    break;\n                  case r._ORIGIN_BL:\n                    y = 0, R = 1, z = i.width, P = i.height - 1, B = -1, F = -1;\n                    break;\n                  case r._ORIGIN_UR:\n                    y = i.width - 1, R = -1, z = -1, P = 0, B = 1, F = i.height;\n                    break;\n                  case r._ORIGIN_BR:\n                    y = i.width - 1, R = -1, z = -1, P = i.height - 1, B = -1, F = -1;\n                }\n                var Te = r[\"_getImageData\" + (d ? \"Grey\" : \"\") + i.pixel_size + \"bits\"](i, p, o, P, B, F, y, R, z);\n                t.getEngine()._uploadDataToTextureDirectly(t, Te);\n              }\n            }\n          }, r._getImageData8bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R, B = n, F = e, z = t.width, J = t.height, ie = 0, se = new Uint8Array(z * J * 4);\n            for (R = i; R !== a; R += o)\n              for (P = s; P !== p; P += d, ie++)\n                y = B[ie], se[4 * (P + z * R) + 3] = 255, se[4 * (P + z * R) + 2] = F[3 * y + 0], se[4 * (P + z * R) + 1] = F[3 * y + 1], se[4 * (P + z * R) + 0] = F[3 * y + 2];\n            return se;\n          }, r._getImageData16bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R, B = n, F = t.width, z = t.height, J = 0, ie = new Uint8Array(F * z * 4);\n            for (R = i; R !== a; R += o)\n              for (P = s; P !== p; P += d, J += 2) {\n                var se = 255 * ((31744 & (y = B[J + 0] + (B[J + 1] << 8))) >> 10) / 31 | 0, ce = 255 * ((992 & y) >> 5) / 31 | 0, ue = 255 * (31 & y) / 31 | 0;\n                ie[4 * (P + F * R) + 0] = se, ie[4 * (P + F * R) + 1] = ce, ie[4 * (P + F * R) + 2] = ue, ie[4 * (P + F * R) + 3] = 32768 & y ? 0 : 255;\n              }\n            return ie;\n          }, r._getImageData24bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R = n, B = t.width, F = t.height, z = 0, J = new Uint8Array(B * F * 4);\n            for (P = i; P !== a; P += o)\n              for (y = s; y !== p; y += d, z += 3)\n                J[4 * (y + B * P) + 3] = 255, J[4 * (y + B * P) + 2] = R[z + 0], J[4 * (y + B * P) + 1] = R[z + 1], J[4 * (y + B * P) + 0] = R[z + 2];\n            return J;\n          }, r._getImageData32bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R = n, B = t.width, F = t.height, z = 0, J = new Uint8Array(B * F * 4);\n            for (P = i; P !== a; P += o)\n              for (y = s; y !== p; y += d, z += 4)\n                J[4 * (y + B * P) + 2] = R[z + 0], J[4 * (y + B * P) + 1] = R[z + 1], J[4 * (y + B * P) + 0] = R[z + 2], J[4 * (y + B * P) + 3] = R[z + 3];\n            return J;\n          }, r._getImageDataGrey8bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R, B = n, F = t.width, z = t.height, J = 0, ie = new Uint8Array(F * z * 4);\n            for (R = i; R !== a; R += o)\n              for (P = s; P !== p; P += d, J++)\n                y = B[J], ie[4 * (P + F * R) + 0] = y, ie[4 * (P + F * R) + 1] = y, ie[4 * (P + F * R) + 2] = y, ie[4 * (P + F * R) + 3] = 255;\n            return ie;\n          }, r._getImageDataGrey16bits = function(t, e, n, i, o, a, s, d, p) {\n            var y, P, R = n, B = t.width, F = t.height, z = 0, J = new Uint8Array(B * F * 4);\n            for (P = i; P !== a; P += o)\n              for (y = s; y !== p; y += d, z += 2)\n                J[4 * (y + B * P) + 0] = R[z + 0], J[4 * (y + B * P) + 1] = R[z + 0], J[4 * (y + B * P) + 2] = R[z + 0], J[4 * (y + B * P) + 3] = R[z + 1];\n            return J;\n          }, r._TYPE_INDEXED = 1, r._TYPE_RGB = 2, r._TYPE_GREY = 3, r._TYPE_RLE_INDEXED = 9, r._TYPE_RLE_RGB = 10, r._TYPE_RLE_GREY = 11, r._ORIGIN_MASK = 48, r._ORIGIN_SHIFT = 4, r._ORIGIN_BL = 0, r._ORIGIN_BR = 1, r._ORIGIN_UL = 2, r._ORIGIN_UR = 3, r;\n        }(), zu = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".tga\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            throw \".env not supported in Cube.\";\n          }, r.prototype.loadData = function(t, e, n) {\n            var i = new Uint8Array(t.buffer, t.byteOffset, t.byteLength), o = ta.GetTGAHeader(i);\n            n(o.width, o.height, e.generateMipMaps, !1, function() {\n              ta.UploadContent(e, i);\n            });\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new zu());\n        var io, M_ = function() {\n        };\n        (function(r) {\n          r[r.cTFETC1 = 0] = \"cTFETC1\", r[r.cTFBC1 = 1] = \"cTFBC1\", r[r.cTFBC4 = 2] = \"cTFBC4\", r[r.cTFPVRTC1_4_OPAQUE_ONLY = 3] = \"cTFPVRTC1_4_OPAQUE_ONLY\", r[r.cTFBC7_M6_OPAQUE_ONLY = 4] = \"cTFBC7_M6_OPAQUE_ONLY\", r[r.cTFETC2 = 5] = \"cTFETC2\", r[r.cTFBC3 = 6] = \"cTFBC3\", r[r.cTFBC5 = 7] = \"cTFBC5\";\n        })(io || (io = {}));\n        var ro = function() {\n          function r() {\n          }\n          return r.GetInternalFormatFromBasisFormat = function(t) {\n            if (t === io.cTFETC1)\n              return 36196;\n            if (t === io.cTFBC1)\n              return 33776;\n            if (t === io.cTFBC3)\n              return 33779;\n            throw \"The chosen Basis transcoder format is not currently supported\";\n          }, r._CreateWorkerAsync = function() {\n            var t = this;\n            return this._WorkerPromise || (this._WorkerPromise = new Promise(function(e) {\n              t._Worker ? e(t._Worker) : Xe.b.LoadFileAsync(r.WasmModuleURL).then(function(n) {\n                var i = URL.createObjectURL(new Blob([\"(\" + I_ + \")()\"], { type: \"application/javascript\" }));\n                t._Worker = new Worker(i);\n                var o = function(a) {\n                  a.data.action === \"init\" && (t._Worker.removeEventListener(\"message\", o), e(t._Worker));\n                };\n                t._Worker.addEventListener(\"message\", o), t._Worker.postMessage({ action: \"init\", url: r.JSModuleURL, wasmBinary: n });\n              });\n            })), this._WorkerPromise;\n          }, r.TranscodeAsync = function(t, e) {\n            var n = this, i = t instanceof ArrayBuffer ? new Uint8Array(t) : t;\n            return new Promise(function(o, a) {\n              n._CreateWorkerAsync().then(function() {\n                var s = n._actionId++, d = function(y) {\n                  y.data.action === \"transcode\" && y.data.id === s && (n._Worker.removeEventListener(\"message\", d), y.data.success ? o(y.data) : a(\"Transcode is not supported on this device\"));\n                };\n                n._Worker.addEventListener(\"message\", d);\n                var p = new Uint8Array(i.byteLength);\n                p.set(new Uint8Array(i.buffer, i.byteOffset, i.byteLength)), n._Worker.postMessage({ action: \"transcode\", id: s, imageData: p, config: e, ignoreSupportedFormats: n._IgnoreSupportedFormats }, [p.buffer]);\n              });\n            });\n          }, r.LoadTextureFromTranscodeResult = function(t, e) {\n            for (var n, i = t.getEngine(), o = function() {\n              if (n = e.fileInfo.images[a].levels[0], t._invertVScale = t.invertY, e.format === -1)\n                if (t.type = h.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5, t.format = h.a.TEXTUREFORMAT_RGB, i.webGLVersion < 2 && ($.a.Log2(n.width) % 1 != 0 || $.a.Log2(n.height) % 1 != 0)) {\n                  var s = new Pt.a(i, Pt.b.Temp);\n                  t._invertVScale = t.invertY, s.type = h.a.TEXTURETYPE_UNSIGNED_SHORT_5_6_5, s.format = h.a.TEXTUREFORMAT_RGB, s.width = n.width + 3 & -4, s.height = n.height + 3 & -4, i._bindTextureDirectly(i._gl.TEXTURE_2D, s, !0), i._uploadDataToTextureDirectly(s, n.transcodedPixels, a, 0, h.a.TEXTUREFORMAT_RGB, !0), i._rescaleTexture(s, t, i.scenes[0], i._getInternalFormat(h.a.TEXTUREFORMAT_RGB), function() {\n                    i._releaseTexture(s), i._bindTextureDirectly(i._gl.TEXTURE_2D, t, !0);\n                  });\n                } else\n                  t._invertVScale = !t.invertY, t.width = n.width + 3 & -4, t.height = n.height + 3 & -4, i._uploadDataToTextureDirectly(t, n.transcodedPixels, a, 0, h.a.TEXTUREFORMAT_RGB, !0);\n              else\n                t.width = n.width, t.height = n.height, e.fileInfo.images[a].levels.forEach(function(d, p) {\n                  i._uploadCompressedDataToTextureDirectly(t, r.GetInternalFormatFromBasisFormat(e.format), d.width, d.height, d.transcodedPixels, a, p);\n                }), i.webGLVersion < 2 && ($.a.Log2(t.width) % 1 != 0 || $.a.Log2(t.height) % 1 != 0) && (Xe.b.Warn(\"Loaded .basis texture width and height are not a power of two. Texture wrapping will be set to Texture.CLAMP_ADDRESSMODE as other modes are not supported with non power of two dimensions in webGL 1.\"), t._cachedWrapU = Ne.a.CLAMP_ADDRESSMODE, t._cachedWrapV = Ne.a.CLAMP_ADDRESSMODE);\n            }, a = 0; a < e.fileInfo.images.length; a++)\n              o();\n          }, r._IgnoreSupportedFormats = !1, r.JSModuleURL = \"https://preview.babylonjs.com/basisTranscoder/basis_transcoder.js\", r.WasmModuleURL = \"https://preview.babylonjs.com/basisTranscoder/basis_transcoder.wasm\", r._WorkerPromise = null, r._Worker = null, r._actionId = 0, r;\n        }();\n        function I_() {\n          var r = 0, t = 1, e = 5, n = 6, i = null;\n          function o(a, s, d, p, y) {\n            var P = a.getImageTranscodedSizeInBytes(s, d, p), R = new Uint8Array(P);\n            return a.transcodeImage(R, s, d, p, 1, 0) ? (y && (R = function(B, F, z, J) {\n              for (var ie = new Uint16Array(4), se = new Uint16Array(z * J), ce = z / 4, ue = J / 4, fe = 0; fe < ue; fe++)\n                for (var ve = 0; ve < ce; ve++) {\n                  var Te = F + 8 * (fe * ce + ve);\n                  ie[0] = B[Te] | B[Te + 1] << 8, ie[1] = B[Te + 2] | B[Te + 3] << 8, ie[2] = (2 * (31 & ie[0]) + 1 * (31 & ie[1])) / 3 | (2 * (2016 & ie[0]) + 1 * (2016 & ie[1])) / 3 & 2016 | (2 * (63488 & ie[0]) + 1 * (63488 & ie[1])) / 3 & 63488, ie[3] = (2 * (31 & ie[1]) + 1 * (31 & ie[0])) / 3 | (2 * (2016 & ie[1]) + 1 * (2016 & ie[0])) / 3 & 2016 | (2 * (63488 & ie[1]) + 1 * (63488 & ie[0])) / 3 & 63488;\n                  for (var Re = 0; Re < 4; Re++) {\n                    var Ae = B[Te + 4 + Re], Ee = (4 * fe + Re) * z + 4 * ve;\n                    se[Ee++] = ie[3 & Ae], se[Ee++] = ie[Ae >> 2 & 3], se[Ee++] = ie[Ae >> 4 & 3], se[Ee++] = ie[Ae >> 6 & 3];\n                  }\n                }\n              return se;\n            }(R, 0, a.getImageWidth(s, d) + 3 & -4, a.getImageHeight(s, d) + 3 & -4)), R) : null;\n          }\n          onmessage = function(a) {\n            if (a.data.action === \"init\")\n              i || (Module = { wasmBinary: a.data.wasmBinary }, importScripts(a.data.url), i = new Promise(function(fe) {\n                Module.onRuntimeInitialized = function() {\n                  Module.initializeBasis(), fe();\n                };\n              })), i.then(function() {\n                postMessage({ action: \"init\" });\n              });\n            else if (a.data.action === \"transcode\") {\n              var s = a.data.config, d = a.data.imageData, p = new Module.BasisFile(d), y = function(fe) {\n                for (var ve = fe.getHasAlpha(), Te = fe.getNumImages(), Re = [], Ae = 0; Ae < Te; Ae++) {\n                  for (var Ee = { levels: [] }, Se = fe.getNumLevels(Ae), De = 0; De < Se; De++) {\n                    var xe = { width: fe.getImageWidth(Ae, De), height: fe.getImageHeight(Ae, De) };\n                    Ee.levels.push(xe);\n                  }\n                  Re.push(Ee);\n                }\n                return { hasAlpha: ve, images: Re };\n              }(p), P = a.data.ignoreSupportedFormats ? null : function(fe, ve) {\n                var Te = null;\n                return fe.supportedCompressionFormats && (fe.supportedCompressionFormats.etc1 ? Te = r : fe.supportedCompressionFormats.s3tc ? Te = ve.hasAlpha ? n : t : fe.supportedCompressionFormats.pvrtc || fe.supportedCompressionFormats.etc2 && (Te = e)), Te;\n              }(a.data.config, y), R = !1;\n              P === null && (R = !0, P = y.hasAlpha ? n : t);\n              var B = !0;\n              p.startTranscoding() || (B = !1);\n              for (var F = [], z = 0; z < y.images.length && B; z++) {\n                var J = y.images[z];\n                if (s.loadSingleImage === void 0 || s.loadSingleImage === z) {\n                  var ie = J.levels.length;\n                  s.loadMipmapLevels === !1 && (ie = 1);\n                  for (var se = 0; se < ie; se++) {\n                    var ce = J.levels[se], ue = o(p, z, se, P, R);\n                    if (!ue) {\n                      B = !1;\n                      break;\n                    }\n                    ce.transcodedPixels = ue, F.push(ce.transcodedPixels.buffer);\n                  }\n                }\n              }\n              p.close(), p.delete(), R && (P = -1), B ? postMessage({ action: \"transcode\", success: B, id: a.data.id, fileInfo: y, format: P }, F) : postMessage({ action: \"transcode\", success: B, id: a.data.id });\n            }\n          };\n        }\n        var ju = function() {\n          function r() {\n            this.supportCascades = !1;\n          }\n          return r.prototype.canLoad = function(t) {\n            return Hn.a.EndsWith(t, \".basis\");\n          }, r.prototype.loadCubeData = function(t, e, n, i, o) {\n            if (!Array.isArray(t)) {\n              var a = e.getEngine().getCaps(), s = { supportedCompressionFormats: { etc1: !!a.etc1, s3tc: !!a.s3tc, pvrtc: !!a.pvrtc, etc2: !!a.etc2 } };\n              ro.TranscodeAsync(t, s).then(function(d) {\n                var p = d.fileInfo.images[0].levels.length > 1 && e.generateMipMaps;\n                ro.LoadTextureFromTranscodeResult(e, d), e.getEngine()._setCubeMapTextureParams(e, p), e.isReady = !0, e.onLoadedObservable.notifyObservers(e), e.onLoadedObservable.clear(), i && i();\n              }).catch(function(d) {\n                Xe.b.Warn(\"Failed to transcode Basis file, transcoding may not be supported on this device\"), e.isReady = !0;\n              });\n            }\n          }, r.prototype.loadData = function(t, e, n) {\n            var i = e.getEngine().getCaps(), o = { supportedCompressionFormats: { etc1: !!i.etc1, s3tc: !!i.s3tc, pvrtc: !!i.pvrtc, etc2: !!i.etc2 } };\n            ro.TranscodeAsync(t, o).then(function(a) {\n              var s = a.fileInfo.images[0].levels[0], d = a.fileInfo.images[0].levels.length > 1 && e.generateMipMaps;\n              n(s.width, s.height, d, a.format !== -1, function() {\n                ro.LoadTextureFromTranscodeResult(e, a);\n              });\n            }).catch(function(a) {\n              Xe.b.Warn(\"Failed to transcode Basis file, transcoding may not be supported on this device\"), n(0, 0, !1, !1, function() {\n              });\n            });\n          }, r;\n        }();\n        Ue.a._TextureLoaders.push(new ju());\n        var Vs = function(r) {\n          function t(e, n, i, o, a) {\n            var s = this, d = !(!a || !a.generateMipMaps) && a.generateMipMaps, p = !(!a || !a.generateDepthTexture) && a.generateDepthTexture, y = !a || a.doNotChangeAspectRatio === void 0 || a.doNotChangeAspectRatio;\n            if ((s = r.call(this, e, n, o, d, y) || this).isSupported) {\n              var P = [], R = [];\n              s._initTypes(i, P, R, a);\n              var B = !a || a.generateDepthBuffer === void 0 || a.generateDepthBuffer, F = !(!a || a.generateStencilBuffer === void 0) && a.generateStencilBuffer;\n              return s._size = n, s._multiRenderTargetOptions = { samplingModes: R, generateMipMaps: d, generateDepthBuffer: B, generateStencilBuffer: F, generateDepthTexture: p, types: P, textureCount: i }, s._count = i, s._createInternalTextures(), s._createTextures(), s;\n            }\n            s.dispose();\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"isSupported\", { get: function() {\n            return this._getEngine().webGLVersion > 1 || this._getEngine().getCaps().drawBuffersExtension;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"textures\", { get: function() {\n            return this._textures;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"count\", { get: function() {\n            return this._count;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthTexture\", { get: function() {\n            return this._textures[this._textures.length - 1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wrapU\", { set: function(e) {\n            if (this._textures)\n              for (var n = 0; n < this._textures.length; n++)\n                this._textures[n].wrapU = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"wrapV\", { set: function(e) {\n            if (this._textures)\n              for (var n = 0; n < this._textures.length; n++)\n                this._textures[n].wrapV = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._initTypes = function(e, n, i, o) {\n            for (var a = 0; a < e; a++)\n              o && o.types && o.types[a] !== void 0 ? n.push(o.types[a]) : n.push(o && o.defaultType ? o.defaultType : h.a.TEXTURETYPE_UNSIGNED_INT), o && o.samplingModes && o.samplingModes[a] !== void 0 ? i.push(o.samplingModes[a]) : i.push(Ne.a.BILINEAR_SAMPLINGMODE);\n          }, t.prototype._rebuild = function(e) {\n            e === void 0 && (e = !1), this.releaseInternalTextures(), this._createInternalTextures(), e && this._createTextures();\n            for (var n = 0; n < this._internalTextures.length; n++)\n              this._textures[n]._texture = this._internalTextures[n];\n            this._texture = this._internalTextures[0], this.samples !== 1 && this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures, this.samples);\n          }, t.prototype._createInternalTextures = function() {\n            this._internalTextures = this._getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions);\n          }, t.prototype._createTextures = function() {\n            this._textures = [];\n            for (var e = 0; e < this._internalTextures.length; e++) {\n              var n = new Ne.a(null, this.getScene());\n              n._texture = this._internalTextures[e], this._textures.push(n);\n            }\n            this._texture = this._internalTextures[0];\n          }, t.prototype.replaceTexture = function(e, n) {\n            e._texture && (this._textures[n] = e, this._internalTextures[n] = e._texture);\n          }, Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples !== e && (this._samples = this._getEngine().updateMultipleRenderTargetTextureSampleCount(this._internalTextures, e));\n          }, enumerable: !1, configurable: !0 }), t.prototype.resize = function(e) {\n            this._size = e, this._rebuild();\n          }, t.prototype.updateCount = function(e, n) {\n            this._multiRenderTargetOptions.textureCount = e, this._count = e;\n            var i = [], o = [];\n            this._initTypes(e, i, o, n), this._multiRenderTargetOptions.types = i, this._multiRenderTargetOptions.samplingModes = o, this._rebuild(!0);\n          }, t.prototype.unbindFrameBuffer = function(e, n) {\n            var i = this;\n            e.unBindMultiColorAttachmentFramebuffer(this._internalTextures, this.isCube, function() {\n              i.onAfterRenderObservable.notifyObservers(n);\n            });\n          }, t.prototype.dispose = function() {\n            this.releaseInternalTextures(), r.prototype.dispose.call(this);\n          }, t.prototype.releaseInternalTextures = function() {\n            if (this._internalTextures)\n              for (var e = this._internalTextures.length - 1; e >= 0; e--)\n                this._internalTextures[e] !== void 0 && (this._internalTextures[e].dispose(), this._internalTextures.splice(e, 1));\n          }, t;\n        }(on), ks = function(r, t, e) {\n          this.id = r, this.scale = t, this.offset = e;\n        }, D_ = function() {\n          function r(t, e, n, i) {\n            var o, a, s, d, p, y, P, R, B, F, z, J, ie;\n            return this.name = t, this.meshes = e, this.scene = i, this.options = n, this.options.map = (o = this.options.map) !== null && o !== void 0 ? o : [\"ambientTexture\", \"bumpTexture\", \"diffuseTexture\", \"emissiveTexture\", \"lightmapTexture\", \"opacityTexture\", \"reflectionTexture\", \"refractionTexture\", \"specularTexture\"], this.options.uvsIn = (a = this.options.uvsIn) !== null && a !== void 0 ? a : Oe.b.UVKind, this.options.uvsOut = (s = this.options.uvsOut) !== null && s !== void 0 ? s : Oe.b.UVKind, this.options.layout = (d = this.options.layout) !== null && d !== void 0 ? d : r.LAYOUT_STRIP, this.options.layout === r.LAYOUT_COLNUM && (this.options.colnum = (p = this.options.colnum) !== null && p !== void 0 ? p : 8), this.options.updateInputMeshes = (y = this.options.updateInputMeshes) === null || y === void 0 || y, this.options.disposeSources = (P = this.options.disposeSources) === null || P === void 0 || P, this._expecting = 0, this.options.fillBlanks = (R = this.options.fillBlanks) === null || R === void 0 || R, this.options.fillBlanks === !0 && (this.options.customFillColor = (B = this.options.customFillColor) !== null && B !== void 0 ? B : \"black\"), this.options.frameSize = (F = this.options.frameSize) !== null && F !== void 0 ? F : 256, this.options.paddingRatio = (z = this.options.paddingRatio) !== null && z !== void 0 ? z : 0.0115, this._paddingValue = Math.ceil(this.options.frameSize * this.options.paddingRatio), this._paddingValue % 2 != 0 && this._paddingValue++, this.options.paddingMode = (J = this.options.paddingMode) !== null && J !== void 0 ? J : r.SUBUV_WRAP, this.options.paddingMode === r.SUBUV_COLOR && (this.options.paddingColor = (ie = this.options.paddingColor) !== null && ie !== void 0 ? ie : new I.b(0, 0, 0, 1)), this.sets = {}, this.frames = [], this;\n          }\n          return r.prototype._createFrames = function(t) {\n            for (var e = this, n = this._calculateSize(), i = new u.d(1, 1).divide(n), o = 0, a = this._expecting, s = this.meshes.length, d = Object.keys(this.sets), p = 0; p < d.length; p++) {\n              var y = d[p], P = new pi.a(this.name + \".TexturePack.\" + y + \"Set\", { width: n.x, height: n.y }, this.scene, !0, Ne.a.TRILINEAR_SAMPLINGMODE, Ue.a.TEXTUREFORMAT_RGBA), R = P.getContext();\n              R.fillStyle = \"rgba(0,0,0,0)\", R.fillRect(0, 0, n.x, n.y), P.update(!1), this.sets[y] = P;\n            }\n            var B = this.options.frameSize || 256, F = this._paddingValue, z = B + 2 * F;\n            for (p = 0; p < s; p++)\n              for (var J = this.meshes[p].material, ie = function(ue) {\n                var fe = new pi.a(\"temp\", z, se.scene, !0), ve = fe.getContext(), Te = se._getFrameOffset(p), Re = function() {\n                  o++, fe.update(!1);\n                  var De = ve.getImageData(0, 0, z, z), xe = e.sets[Ae];\n                  if (xe.getContext().putImageData(De, n.x * Te.x, n.y * Te.y), fe.dispose(), xe.update(!1), o == a)\n                    return e._calculateMeshUVFrames(B, F, n, i, e.options.updateInputMeshes || !1), void t();\n                }, Ae = d[ue] || \"_blank\";\n                if (J && J[Ae] !== null) {\n                  var Ee = J[Ae], Se = new Image();\n                  Ee instanceof pi.a ? Se.src = Ee.getContext().canvas.toDataURL(\"image/png\") : Se.src = Ee.url, Xe.b.SetCorsBehavior(Se.src, Se), Se.onload = function() {\n                    ve.fillStyle = \"rgba(0,0,0,0)\", ve.fillRect(0, 0, z, z), fe.update(!1), ve.setTransform(1, 0, 0, -1, 0, 0);\n                    var De = [0, 0, 1, 0, 1, 1, 0, 1, -1, 1, -1, 0, -2, 0, -1, 1, -1];\n                    switch (e.options.paddingMode) {\n                      case 0:\n                        for (var xe = 0; xe < 9; xe++)\n                          ve.drawImage(Se, 0, 0, Se.width, Se.height, F + B * De[xe], F + B * De[xe + 1] - z, B, B);\n                        break;\n                      case 1:\n                        for (var Le = 0; Le < F; Le++)\n                          ve.drawImage(Se, 0, 0, Se.width, Se.height, Le + B * De[0], F - z, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, 2 * F - Le, F - z, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, F, Le - z, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, F, 2 * F - Le - z, B, B);\n                        ve.drawImage(Se, 0, 0, Se.width, Se.height, F + B * De[0], F + B * De[1] - z, B, B);\n                        break;\n                      case 2:\n                        ve.fillStyle = (e.options.paddingColor || I.a.Black()).toHexString(), ve.fillRect(0, 0, z, -z), ve.clearRect(F, F, B, B), ve.drawImage(Se, 0, 0, Se.width, Se.height, F + B * De[0], F + B * De[1] - z, B, B);\n                    }\n                    ve.setTransform(1, 0, 0, 1, 0, 0), Re();\n                  };\n                } else\n                  ve.fillStyle = \"rgba(0,0,0,0)\", se.options.fillBlanks && (ve.fillStyle = se.options.customFillColor), ve.fillRect(0, 0, z, z), Re();\n              }, se = this, ce = 0; ce < d.length; ce++)\n                ie(ce);\n          }, r.prototype._calculateSize = function() {\n            var t = this.meshes.length || 0, e = this.options.frameSize || 0, n = this._paddingValue || 0;\n            switch (this.options.layout) {\n              case 0:\n                return new u.d(e * t + 2 * n * t, e + 2 * n);\n              case 1:\n                var i = Math.max(2, Math.ceil(Math.sqrt(t))), o = e * i + 2 * n * i;\n                return new u.d(o, o);\n              case 2:\n                var a = this.options.colnum || 1, s = Math.max(1, Math.ceil(t / a));\n                return new u.d(e * a + 2 * n * a, e * s + 2 * n * s);\n            }\n            return u.d.Zero();\n          }, r.prototype._calculateMeshUVFrames = function(t, e, n, i, o) {\n            for (var a = this.meshes.length, s = 0; s < a; s++) {\n              var d = this.meshes[s], p = new u.d(t / n.x, t / n.y), y = i.clone().scale(e), P = this._getFrameOffset(s).add(y), R = new ks(s, p, P);\n              this.frames.push(R), o && (this._updateMeshUV(d, s), this._updateTextureReferences(d));\n            }\n          }, r.prototype._getFrameOffset = function(t) {\n            var e, n, i, o = this.meshes.length;\n            switch (this.options.layout) {\n              case 0:\n                return e = 1 / o, new u.d(t * e, 0);\n              case 1:\n                var a = Math.max(2, Math.ceil(Math.sqrt(o)));\n                return i = t - (n = Math.floor(t / a)) * a, e = 1 / a, new u.d(i * e, n * e);\n              case 2:\n                var s = this.options.colnum || 1, d = Math.max(1, Math.ceil(o / s));\n                return n = t - (i = Math.floor(t / d)) * d, e = new u.d(1 / s, 1 / d), new u.d(i * e.x, n * e.y);\n            }\n            return u.d.Zero();\n          }, r.prototype._updateMeshUV = function(t, e) {\n            var n = this.frames[e], i = t.getVerticesData(this.options.uvsIn || Oe.b.UVKind), o = [], a = 0;\n            i.length && (a = i.length || 0);\n            for (var s = 0; s < a; s += 2)\n              o.push(i[s] * n.scale.x + n.offset.x, i[s + 1] * n.scale.y + n.offset.y);\n            t.setVerticesData(this.options.uvsOut || Oe.b.UVKind, o);\n          }, r.prototype._updateTextureReferences = function(t, e) {\n            e === void 0 && (e = !1);\n            for (var n = t.material, i = Object.keys(this.sets), o = function(d) {\n              d.dispose && d.dispose();\n            }, a = 0; a < i.length; a++) {\n              var s = i[a];\n              if (e)\n                n[s] !== null && o(n[s]), n[s] = this.sets[s];\n              else {\n                if (!n)\n                  return;\n                n[s] !== null && (o(n[s]), n[s] = this.sets[s]);\n              }\n            }\n          }, r.prototype.setMeshToFrame = function(t, e, n) {\n            n === void 0 && (n = !1), this._updateMeshUV(t, e), n && this._updateTextureReferences(t, !0);\n          }, r.prototype.processAsync = function() {\n            var t = this;\n            return new Promise(function(e, n) {\n              try {\n                if (t.meshes.length === 0)\n                  return void e();\n                for (var i = 0, o = function(d) {\n                  var p = t.meshes[d], y = p.material;\n                  if (!y)\n                    return ++i === t.meshes.length ? { value: t._createFrames(e) } : \"continue\";\n                  y.forceCompilationAsync(p).then(function() {\n                    (function(P) {\n                      if (i++, t.options.map) {\n                        for (var R = 0; R < t.options.map.length; R++)\n                          P[t.options.map[R]] !== null && (t.sets[t.options.map[R]] || (t.sets[t.options.map[R]] = !0), t._expecting++);\n                        i === t.meshes.length && t._createFrames(e);\n                      }\n                    })(y);\n                  });\n                }, a = 0; a < t.meshes.length; a++) {\n                  var s = o(a);\n                  if (typeof s == \"object\")\n                    return s.value;\n                }\n              } catch (d) {\n                return n(d);\n              }\n            });\n          }, r.prototype.dispose = function() {\n            for (var t = Object.keys(this.sets), e = 0; e < t.length; e++) {\n              var n = t[e];\n              this.sets[n].dispose();\n            }\n          }, r.prototype.download = function(t, e) {\n            var n = this;\n            t === void 0 && (t = \"png\"), e === void 0 && (e = 1), setTimeout(function() {\n              var i = { name: n.name, sets: {}, options: {}, frames: [] }, o = Object.keys(n.sets), a = Object.keys(n.options);\n              try {\n                for (var s = 0; s < o.length; s++) {\n                  var d = o[s], p = n.sets[d];\n                  i.sets[d] = p.getContext().canvas.toDataURL(\"image/\" + t, e);\n                }\n                for (s = 0; s < a.length; s++) {\n                  var y = a[s];\n                  i.options[y] = n.options[y];\n                }\n                for (s = 0; s < n.frames.length; s++) {\n                  var P = n.frames[s];\n                  i.frames.push(P.scale.x, P.scale.y, P.offset.x, P.offset.y);\n                }\n              } catch (F) {\n                return void l.a.Warn(\"Unable to download: \" + F);\n              }\n              var R = \"data:text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(i, null, 4)), B = document.createElement(\"a\");\n              B.setAttribute(\"href\", R), B.setAttribute(\"download\", n.name + \"_texurePackage.json\"), document.body.appendChild(B), B.click(), B.remove();\n            }, 0);\n          }, r.prototype.updateFromJSON = function(t) {\n            try {\n              var e = JSON.parse(t);\n              this.name = e.name;\n              for (var n = Object.keys(e.options), i = 0; i < n.length; i++)\n                this.options[n[i]] = e.options[n[i]];\n              for (i = 0; i < e.frames.length; i += 4) {\n                var o = new ks(i / 4, new u.d(e.frames[i], e.frames[i + 1]), new u.d(e.frames[i + 2], e.frames[i + 3]));\n                this.frames.push(o);\n              }\n              var a = Object.keys(e.sets);\n              for (i = 0; i < a.length; i++) {\n                var s = new Ne.a(e.sets[a[i]], this.scene, !1, !1);\n                this.sets[a[i]] = s;\n              }\n            } catch (d) {\n              l.a.Warn(\"Unable to update from JSON: \" + d);\n            }\n          }, r.LAYOUT_STRIP = 0, r.LAYOUT_POWER2 = 1, r.LAYOUT_COLNUM = 2, r.SUBUV_WRAP = 0, r.SUBUV_EXTEND = 1, r.SUBUV_COLOR = 2, r;\n        }(), Hu = function() {\n          function r(t) {\n            this.name = ot.a.NAME_PROCEDURALTEXTURE, this.scene = t, this.scene.proceduralTextures = new Array();\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeClearStage.registerStep(ot.a.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._beforeClear = function() {\n            if (this.scene.proceduralTexturesEnabled) {\n              Xe.b.StartPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n              for (var t = 0; t < this.scene.proceduralTextures.length; t++) {\n                var e = this.scene.proceduralTextures[t];\n                e._shouldRender() && e.render();\n              }\n              Xe.b.EndPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n            }\n          }, r;\n        }(), L_ = `\nattribute vec2 position;\n\nvarying vec2 vPosition;\nvarying vec2 vUV;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvPosition=position;\nvUV=position*madd+madd;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.proceduralVertexShader = L_;\n        var oo = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            a === void 0 && (a = null), s === void 0 && (s = !0), d === void 0 && (d = !1), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, null, o, !s) || this;\n            y.isEnabled = !0, y.autoClear = !0, y.onGeneratedObservable = new C.c(), y.onBeforeGenerationObservable = new C.c(), y.nodeMaterialSource = null, y._textures = {}, y._currentRefreshId = -1, y._frameId = -1, y._refreshRate = 1, y._vertexBuffers = {}, y._uniforms = new Array(), y._samplers = new Array(), y._floats = {}, y._ints = {}, y._floatsArrays = {}, y._colors3 = {}, y._colors4 = {}, y._vectors2 = {}, y._vectors3 = {}, y._matrices = {}, y._fallbackTextureUsed = !1, y._cachedDefines = \"\", y._contentUpdateId = -1;\n            var P = (o = y.getScene() || te.a.LastCreatedScene)._getComponent(ot.a.NAME_PROCEDURALTEXTURE);\n            P || (P = new Hu(o), o._addComponent(P)), o.proceduralTextures.push(y), y._fullEngine = o.getEngine(), y.name = e, y.isRenderTarget = !0, y._size = n, y._generateMipMaps = s, y.setFragment(i), y._fallbackTexture = a, d ? (y._texture = y._fullEngine.createRenderTargetCubeTexture(n, { generateMipMaps: s, generateDepthBuffer: !1, generateStencilBuffer: !1, type: p }), y.setFloat(\"face\", 0)) : y._texture = y._fullEngine.createRenderTargetTexture(n, { generateMipMaps: s, generateDepthBuffer: !1, generateStencilBuffer: !1, type: p });\n            var R = [];\n            return R.push(1, 1), R.push(-1, 1), R.push(-1, -1), R.push(1, -1), y._vertexBuffers[Oe.b.PositionKind] = new Oe.b(y._fullEngine, R, Oe.b.PositionKind, !1, !1, 2), y._createIndexBuffer(), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getEffect = function() {\n            return this._effect;\n          }, t.prototype.getContent = function() {\n            return this._contentData && this._frameId === this._contentUpdateId || (this._contentData = this.readPixels(0, 0, this._contentData), this._contentUpdateId = this._frameId), this._contentData;\n          }, t.prototype._createIndexBuffer = function() {\n            var e = this._fullEngine, n = [];\n            n.push(0), n.push(1), n.push(2), n.push(0), n.push(2), n.push(3), this._indexBuffer = e.createIndexBuffer(n);\n          }, t.prototype._rebuild = function() {\n            var e = this._vertexBuffers[Oe.b.PositionKind];\n            e && e._rebuild(), this._createIndexBuffer(), this.refreshRate === on.REFRESHRATE_RENDER_ONCE && (this.refreshRate = on.REFRESHRATE_RENDER_ONCE);\n          }, t.prototype.reset = function() {\n            this._effect !== void 0 && this._effect.dispose();\n          }, t.prototype._getDefines = function() {\n            return \"\";\n          }, t.prototype.isReady = function() {\n            var e, n = this, i = this._fullEngine;\n            if (this.nodeMaterialSource)\n              return this._effect.isReady();\n            if (!this._fragment)\n              return !1;\n            if (this._fallbackTextureUsed)\n              return !0;\n            var o = this._getDefines();\n            return !(!this._effect || o !== this._cachedDefines || !this._effect.isReady()) || (e = this._fragment.fragmentElement !== void 0 ? { vertex: \"procedural\", fragmentElement: this._fragment.fragmentElement } : { vertex: \"procedural\", fragment: this._fragment }, this._cachedDefines = o, this._effect = i.createEffect(e, [Oe.b.PositionKind], this._uniforms, this._samplers, o, void 0, void 0, function() {\n              n.releaseInternalTexture(), n._fallbackTexture && (n._texture = n._fallbackTexture._texture, n._texture && n._texture.incrementReferences()), n._fallbackTextureUsed = !0;\n            }), this._effect.isReady());\n          }, t.prototype.resetRefreshCounter = function() {\n            this._currentRefreshId = -1;\n          }, t.prototype.setFragment = function(e) {\n            this._fragment = e;\n          }, Object.defineProperty(t.prototype, \"refreshRate\", { get: function() {\n            return this._refreshRate;\n          }, set: function(e) {\n            this._refreshRate = e, this.resetRefreshCounter();\n          }, enumerable: !1, configurable: !0 }), t.prototype._shouldRender = function() {\n            return this.isEnabled && this.isReady() && this._texture ? !this._fallbackTextureUsed && (this._currentRefreshId === -1 || this.refreshRate === this._currentRefreshId ? (this._currentRefreshId = 1, this._frameId++, !0) : (this._currentRefreshId++, !1)) : (this._texture && (this._texture.isReady = !1), !1);\n          }, t.prototype.getRenderSize = function() {\n            return this._size;\n          }, t.prototype.resize = function(e, n) {\n            this._fallbackTextureUsed || (this.releaseInternalTexture(), this._texture = this._fullEngine.createRenderTargetTexture(e, n), this._size = e, this._generateMipMaps = n);\n          }, t.prototype._checkUniform = function(e) {\n            this._uniforms.indexOf(e) === -1 && this._uniforms.push(e);\n          }, t.prototype.setTexture = function(e, n) {\n            return this._samplers.indexOf(e) === -1 && this._samplers.push(e), this._textures[e] = n, this;\n          }, t.prototype.setFloat = function(e, n) {\n            return this._checkUniform(e), this._floats[e] = n, this;\n          }, t.prototype.setInt = function(e, n) {\n            return this._checkUniform(e), this._ints[e] = n, this;\n          }, t.prototype.setFloats = function(e, n) {\n            return this._checkUniform(e), this._floatsArrays[e] = n, this;\n          }, t.prototype.setColor3 = function(e, n) {\n            return this._checkUniform(e), this._colors3[e] = n, this;\n          }, t.prototype.setColor4 = function(e, n) {\n            return this._checkUniform(e), this._colors4[e] = n, this;\n          }, t.prototype.setVector2 = function(e, n) {\n            return this._checkUniform(e), this._vectors2[e] = n, this;\n          }, t.prototype.setVector3 = function(e, n) {\n            return this._checkUniform(e), this._vectors3[e] = n, this;\n          }, t.prototype.setMatrix = function(e, n) {\n            return this._checkUniform(e), this._matrices[e] = n, this;\n          }, t.prototype.render = function(e) {\n            var n = this.getScene();\n            if (n) {\n              var i = this._fullEngine;\n              if (i.enableEffect(this._effect), this.onBeforeGenerationObservable.notifyObservers(this), i.setState(!1), !this.nodeMaterialSource) {\n                for (var o in this._textures)\n                  this._effect.setTexture(o, this._textures[o]);\n                for (o in this._ints)\n                  this._effect.setInt(o, this._ints[o]);\n                for (o in this._floats)\n                  this._effect.setFloat(o, this._floats[o]);\n                for (o in this._floatsArrays)\n                  this._effect.setArray(o, this._floatsArrays[o]);\n                for (o in this._colors3)\n                  this._effect.setColor3(o, this._colors3[o]);\n                for (o in this._colors4) {\n                  var a = this._colors4[o];\n                  this._effect.setFloat4(o, a.r, a.g, a.b, a.a);\n                }\n                for (o in this._vectors2)\n                  this._effect.setVector2(o, this._vectors2[o]);\n                for (o in this._vectors3)\n                  this._effect.setVector3(o, this._vectors3[o]);\n                for (o in this._matrices)\n                  this._effect.setMatrix(o, this._matrices[o]);\n              }\n              if (this._texture) {\n                if (this.isCube)\n                  for (var s = 0; s < 6; s++)\n                    i.bindFramebuffer(this._texture, s, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect), this._effect.setFloat(\"face\", s), this.autoClear && i.clear(n.clearColor, !0, !1, !1), i.drawElementsType(zt.a.TriangleFillMode, 0, 6), s === 5 && i.generateMipMapsForCubemap(this._texture);\n                else\n                  i.bindFramebuffer(this._texture, 0, void 0, void 0, !0), i.bindBuffers(this._vertexBuffers, this._indexBuffer, this._effect), this.autoClear && i.clear(n.clearColor, !0, !1, !1), i.drawElementsType(zt.a.TriangleFillMode, 0, 6);\n                i.unBindFramebuffer(this._texture, this.isCube), this.onGenerated && this.onGenerated(), this.onGeneratedObservable.notifyObservers(this);\n              }\n            }\n          }, t.prototype.clone = function() {\n            var e = this.getSize(), n = new t(this.name, e.width, this._fragment, this.getScene(), this._fallbackTexture, this._generateMipMaps);\n            return n.hasAlpha = this.hasAlpha, n.level = this.level, n.coordinatesMode = this.coordinatesMode, n;\n          }, t.prototype.dispose = function() {\n            var e = this.getScene();\n            if (e) {\n              var n = e.proceduralTextures.indexOf(this);\n              n >= 0 && e.proceduralTextures.splice(n, 1);\n              var i = this._vertexBuffers[Oe.b.PositionKind];\n              i && (i.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this._indexBuffer && this._fullEngine._releaseBuffer(this._indexBuffer) && (this._indexBuffer = null), this.onGeneratedObservable.clear(), this.onBeforeGenerationObservable.clear(), r.prototype.dispose.call(this);\n            }\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"isEnabled\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"autoClear\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_generateMipMaps\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_size\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"refreshRate\", null), t;\n        }(Ne.a);\n        O.a.RegisteredTypes[\"BABYLON.ProceduralTexture\"] = oo;\n        var N_ = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, i, null, o, a, s) || this;\n            return d._animate = !0, d._time = 0, d._texturePath = n, d._loadJson(n), d.refreshRate = 1, d;\n          }\n          return Object(c.d)(t, r), t.prototype._loadJson = function(e) {\n            var n = this, i = function() {\n              try {\n                n.setFragment(n._texturePath);\n              } catch {\n                l.a.Error(\"No json or ShaderStore or DOM element found for CustomProceduralTexture\");\n              }\n            }, o = e + \"/config.json\", a = new re.a();\n            a.open(\"GET\", o), a.addEventListener(\"load\", function() {\n              if (a.status === 200 || a.responseText && a.responseText.length > 0)\n                try {\n                  n._config = JSON.parse(a.response), n.updateShaderUniforms(), n.updateTextures(), n.setFragment(n._texturePath + \"/custom\"), n._animate = n._config.animate, n.refreshRate = n._config.refreshrate;\n                } catch {\n                  i();\n                }\n              else\n                i();\n            }, !1), a.addEventListener(\"error\", function() {\n              i();\n            }, !1);\n            try {\n              a.send();\n            } catch {\n              l.a.Error(\"CustomProceduralTexture: Error on XHR send request.\");\n            }\n          }, t.prototype.isReady = function() {\n            if (!r.prototype.isReady.call(this))\n              return !1;\n            for (var e in this._textures)\n              if (!this._textures[e].isReady())\n                return !1;\n            return !0;\n          }, t.prototype.render = function(e) {\n            var n = this.getScene();\n            this._animate && n && (this._time += 0.03 * n.getAnimationRatio(), this.updateShaderUniforms()), r.prototype.render.call(this, e);\n          }, t.prototype.updateTextures = function() {\n            for (var e = 0; e < this._config.sampler2Ds.length; e++)\n              this.setTexture(this._config.sampler2Ds[e].sample2Dname, new Ne.a(this._texturePath + \"/\" + this._config.sampler2Ds[e].textureRelativeUrl, this.getScene()));\n          }, t.prototype.updateShaderUniforms = function() {\n            if (this._config)\n              for (var e = 0; e < this._config.uniforms.length; e++) {\n                var n = this._config.uniforms[e];\n                switch (n.type) {\n                  case \"float\":\n                    this.setFloat(n.name, n.value);\n                    break;\n                  case \"color3\":\n                    this.setColor3(n.name, new I.a(n.r, n.g, n.b));\n                    break;\n                  case \"color4\":\n                    this.setColor4(n.name, new I.b(n.r, n.g, n.b, n.a));\n                    break;\n                  case \"vector2\":\n                    this.setVector2(n.name, new u.d(n.x, n.y));\n                    break;\n                  case \"vector3\":\n                    this.setVector3(n.name, new u.e(n.x, n.y, n.z));\n                }\n              }\n            this.setFloat(\"time\", this._time);\n          }, Object.defineProperty(t.prototype, \"animate\", { get: function() {\n            return this._animate;\n          }, set: function(e) {\n            this._animate = e;\n          }, enumerable: !1, configurable: !0 }), t;\n        }(oo), w_ = `\n\nuniform float brightness;\nuniform float persistence;\nuniform float timeScale;\n\nvarying vec2 vUV;\n\nvec2 hash22(vec2 p)\n{\np=p*mat2(127.1,311.7,269.5,183.3);\np=-1.0+2.0*fract(sin(p)*43758.5453123);\nreturn sin(p*6.283+timeScale);\n}\nfloat interpolationNoise(vec2 p)\n{\nvec2 pi=floor(p);\nvec2 pf=p-pi;\nvec2 w=pf*pf*(3.-2.*pf);\nfloat f00=dot(hash22(pi+vec2(.0,.0)),pf-vec2(.0,.0));\nfloat f01=dot(hash22(pi+vec2(.0,1.)),pf-vec2(.0,1.));\nfloat f10=dot(hash22(pi+vec2(1.0,0.)),pf-vec2(1.0,0.));\nfloat f11=dot(hash22(pi+vec2(1.0,1.)),pf-vec2(1.0,1.));\nfloat xm1=mix(f00,f10,w.x);\nfloat xm2=mix(f01,f11,w.x);\nfloat ym=mix(xm1,xm2,w.y);\nreturn ym;\n}\nfloat perlinNoise2D(float x,float y)\n{\nfloat sum=0.0;\nfloat frequency=0.0;\nfloat amplitude=0.0;\nfor(int i=0; i<OCTAVES; i++)\n{\nfrequency=pow(2.0,float(i));\namplitude=pow(persistence,float(i));\nsum=sum+interpolationNoise(vec2(x*frequency,y*frequency))*amplitude;\n}\nreturn sum;\n}\n\nvoid main(void)\n{\nfloat x=abs(vUV.x);\nfloat y=abs(vUV.y);\nfloat noise=brightness+(1.0-brightness)*perlinNoise2D(x,y);\ngl_FragColor=vec4(noise,noise,noise,1.0);\n}\n`;\n        ze.a.ShadersStore.noisePixelShader = w_;\n        var Wu = function(r) {\n          function t(e, n, i, o, a) {\n            n === void 0 && (n = 256), i === void 0 && (i = te.a.LastCreatedScene);\n            var s = r.call(this, e, n, \"noise\", i, o, a) || this;\n            return s.time = 0, s.brightness = 0.2, s.octaves = 3, s.persistence = 0.8, s.animationSpeedFactor = 1, s.autoClear = !1, s._updateShaderUniforms(), s;\n          }\n          return Object(c.d)(t, r), t.prototype._updateShaderUniforms = function() {\n            var e = this.getScene();\n            e && (this.time += e.getAnimationRatio() * this.animationSpeedFactor * 0.01, this.setFloat(\"brightness\", this.brightness), this.setFloat(\"persistence\", this.persistence), this.setFloat(\"timeScale\", this.time));\n          }, t.prototype._getDefines = function() {\n            return \"#define OCTAVES \" + (0 | this.octaves);\n          }, t.prototype.render = function(e) {\n            this._updateShaderUniforms(), r.prototype.render.call(this, e);\n          }, t.prototype.serialize = function() {\n            var e = { customType: \"BABYLON.NoiseProceduralTexture\" };\n            return e.brightness = this.brightness, e.octaves = this.octaves, e.persistence = this.persistence, e.animationSpeedFactor = this.animationSpeedFactor, e.size = this.getSize().width, e.generateMipMaps = this._generateMipMaps, e.time = this.time, e;\n          }, t.prototype.clone = function() {\n            var e = this.getSize(), n = new t(this.name, e.width, this.getScene(), this._fallbackTexture ? this._fallbackTexture : void 0, this._generateMipMaps);\n            return n.hasAlpha = this.hasAlpha, n.level = this.level, n.coordinatesMode = this.coordinatesMode, n.brightness = this.brightness, n.octaves = this.octaves, n.persistence = this.persistence, n.animationSpeedFactor = this.animationSpeedFactor, n.time = this.time, n;\n          }, t.Parse = function(e, n) {\n            var i, o = new t(e.name, e.size, n, void 0, e.generateMipMaps);\n            return o.brightness = e.brightness, o.octaves = e.octaves, o.persistence = e.persistence, o.animationSpeedFactor = e.animationSpeedFactor, o.time = (i = e.time) !== null && i !== void 0 ? i : 0, o;\n          }, t;\n        }(oo);\n        O.a.RegisteredTypes[\"BABYLON.NoiseProceduralTexture\"] = Wu;\n        var Ce, le, gn, gt, Rn, ii, yn, F_ = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            o === void 0 && (o = h.a.TEXTUREFORMAT_RGBA), a === void 0 && (a = h.a.TEXTURETYPE_UNSIGNED_INT), s === void 0 && (s = !1), d === void 0 && (d = !1), p === void 0 && (p = h.a.TEXTURE_TRILINEAR_SAMPLINGMODE), y === void 0 && (y = null);\n            var P = r.call(this, \"\", e) || this;\n            return P._texture = e.getEngine().createRawCubeTexture(n, i, o, a, s, d, p, y), P;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e, n, i, o, a) {\n            a === void 0 && (a = null), this._texture.getEngine().updateRawCubeTexture(this._texture, e, n, i, o, a);\n          }, t.prototype.updateRGBDAsync = function(e, n, i, o) {\n            return n === void 0 && (n = null), i === void 0 && (i = 0.8), o === void 0 && (o = 0), t._UpdateRGBDAsync(this._texture, e, n, i, o);\n          }, t.prototype.clone = function() {\n            var e = this;\n            return L.a.Clone(function() {\n              var n = e.getScene(), i = e._texture, o = new t(n, i._bufferViewArray, i.width, i.format, i.type, i.generateMipMaps, i.invertY, i.samplingMode, i._compression);\n              return i.source === Pt.b.CubeRawRGBD && o.updateRGBDAsync(i._bufferViewArrayArray, i._sphericalPolynomial, i._lodGenerationScale, i._lodGenerationOffset), o;\n            }, this);\n          }, t._UpdateRGBDAsync = function(e, n, i, o, a) {\n            return e._source = Pt.b.CubeRawRGBD, e._bufferViewArrayArray = n, e._lodGenerationScale = o, e._lodGenerationOffset = a, e._sphericalPolynomial = i, gi.UploadLevelsAsync(e, n).then(function() {\n              e.isReady = !0;\n            });\n          }, t;\n        }(ei), B_ = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            d === void 0 && (d = !0), p === void 0 && (p = !1), y === void 0 && (y = Ne.a.TRILINEAR_SAMPLINGMODE), P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var R = r.call(this, null, s, !d, p) || this;\n            return R.format = a, R._texture = s.getEngine().createRawTexture2DArray(e, n, i, o, a, d, p, y, null, P), R.is2DArray = !0, R;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e) {\n            this._texture && this._getEngine().updateRawTexture2DArray(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);\n          }, t;\n        }(Ne.a), U_ = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            d === void 0 && (d = !0), p === void 0 && (p = !1), y === void 0 && (y = Ne.a.TRILINEAR_SAMPLINGMODE), P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var R = r.call(this, null, s, !d, p) || this;\n            return R.format = a, R._texture = s.getEngine().createRawTexture3D(e, n, i, o, a, d, p, y, null, P), R.is3D = !0, R;\n          }\n          return Object(c.d)(t, r), t.prototype.update = function(e) {\n            this._texture && this._getEngine().updateRawTexture3D(this._texture, e, this._texture.format, this._texture.invertY, null, this._texture.type);\n          }, t;\n        }(Ne.a), V_ = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e, n, i, o, !0) || this;\n            return a.refractionPlane = new ur.a(0, 1, 0, 1), a.depth = 2, a.onBeforeRenderObservable.add(function() {\n              i.clipPlane = a.refractionPlane;\n            }), a.onAfterRenderObservable.add(function() {\n              i.clipPlane = null;\n            }), a;\n          }\n          return Object(c.d)(t, r), t.prototype.clone = function() {\n            var e = this.getScene();\n            if (!e)\n              return this;\n            var n = this.getSize(), i = new t(this.name, n.width, e, this._generateMipMaps);\n            return i.hasAlpha = this.hasAlpha, i.level = this.level, i.refractionPlane = this.refractionPlane.clone(), this.renderList && (i.renderList = this.renderList.slice(0)), i.depth = this.depth, i;\n          }, t.prototype.serialize = function() {\n            if (!this.name)\n              return null;\n            var e = r.prototype.serialize.call(this);\n            return e.mirrorPlane = this.refractionPlane.asArray(), e.depth = this.depth, e;\n          }, t;\n        }(on);\n        (function(r) {\n          r[r.Vertex = 1] = \"Vertex\", r[r.Fragment = 2] = \"Fragment\", r[r.Neutral = 4] = \"Neutral\", r[r.VertexAndFragment = 3] = \"VertexAndFragment\";\n        })(Ce || (Ce = {})), function(r) {\n          r[r.Float = 1] = \"Float\", r[r.Int = 2] = \"Int\", r[r.Vector2 = 4] = \"Vector2\", r[r.Vector3 = 8] = \"Vector3\", r[r.Vector4 = 16] = \"Vector4\", r[r.Color3 = 32] = \"Color3\", r[r.Color4 = 64] = \"Color4\", r[r.Matrix = 128] = \"Matrix\", r[r.Object = 256] = \"Object\", r[r.AutoDetect = 1024] = \"AutoDetect\", r[r.BasedOnInput = 2048] = \"BasedOnInput\";\n        }(le || (le = {})), function(r) {\n          r[r.Uniform = 0] = \"Uniform\", r[r.Attribute = 1] = \"Attribute\", r[r.Varying = 2] = \"Varying\", r[r.Undefined = 3] = \"Undefined\";\n        }(gn || (gn = {})), function(r) {\n          r[r.World = 1] = \"World\", r[r.View = 2] = \"View\", r[r.Projection = 3] = \"Projection\", r[r.ViewProjection = 4] = \"ViewProjection\", r[r.WorldView = 5] = \"WorldView\", r[r.WorldViewProjection = 6] = \"WorldViewProjection\", r[r.CameraPosition = 7] = \"CameraPosition\", r[r.FogColor = 8] = \"FogColor\", r[r.DeltaTime = 9] = \"DeltaTime\";\n        }(gt || (gt = {})), function(r) {\n          r[r.Material = 0] = \"Material\", r[r.PostProcess = 1] = \"PostProcess\", r[r.Particle = 2] = \"Particle\", r[r.ProceduralTexture = 3] = \"ProceduralTexture\";\n        }(Rn || (Rn = {})), function(r) {\n          r[r.Compatible = 0] = \"Compatible\", r[r.TypeIncompatible = 1] = \"TypeIncompatible\", r[r.TargetIncompatible = 2] = \"TargetIncompatible\";\n        }(ii || (ii = {})), function(r) {\n          r[r.Input = 0] = \"Input\", r[r.Output = 1] = \"Output\";\n        }(yn || (yn = {}));\n        var na = function() {\n          function r(t, e, n) {\n            this._connectedPoint = null, this._endpoints = new Array(), this._typeConnectionSource = null, this._linkedConnectionSource = null, this._acceptedConnectionPointType = null, this._type = le.Float, this._enforceAssociatedVariableName = !1, this.needDualDirectionValidation = !1, this.acceptedConnectionPointTypes = new Array(), this.excludedConnectionPointTypes = new Array(), this.onConnectionObservable = new C.c(), this.isExposedOnFrame = !1, this.exposedPortPosition = -1, this._prioritizeVertex = !1, this._target = Ce.VertexAndFragment, this._ownerBlock = e, this.name = t, this._direction = n;\n          }\n          return r.AreEquivalentTypes = function(t, e) {\n            switch (t) {\n              case le.Vector3:\n                if (e === le.Color3)\n                  return !0;\n                break;\n              case le.Vector4:\n                if (e === le.Color4)\n                  return !0;\n                break;\n              case le.Color3:\n                if (e === le.Vector3)\n                  return !0;\n                break;\n              case le.Color4:\n                if (e === le.Vector4)\n                  return !0;\n            }\n            return !1;\n          }, Object.defineProperty(r.prototype, \"direction\", { get: function() {\n            return this._direction;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"associatedVariableName\", { get: function() {\n            return this._ownerBlock.isInput ? this._ownerBlock.associatedVariableName : this._enforceAssociatedVariableName && this._associatedVariableName || !this._connectedPoint ? this._associatedVariableName : this._connectedPoint.associatedVariableName;\n          }, set: function(t) {\n            this._associatedVariableName = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"innerType\", { get: function() {\n            return this._linkedConnectionSource && this._linkedConnectionSource.isConnected ? this.type : this._type;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"type\", { get: function() {\n            if (this._type === le.AutoDetect) {\n              if (this._ownerBlock.isInput)\n                return this._ownerBlock.type;\n              if (this._connectedPoint)\n                return this._connectedPoint.type;\n              if (this._linkedConnectionSource && this._linkedConnectionSource.isConnected)\n                return this._linkedConnectionSource.type;\n            }\n            return this._type === le.BasedOnInput && this._typeConnectionSource ? this._typeConnectionSource.type : this._type;\n          }, set: function(t) {\n            this._type = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"target\", { get: function() {\n            return this._prioritizeVertex && this._ownerBlock ? this._target !== Ce.VertexAndFragment ? this._target : this._ownerBlock.target === Ce.Fragment ? Ce.Fragment : Ce.Vertex : this._target;\n          }, set: function(t) {\n            this._target = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnected\", { get: function() {\n            return this.connectedPoint !== null || this.hasEndpoints;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnectedToInputBlock\", { get: function() {\n            return this.connectedPoint !== null && this.connectedPoint.ownerBlock.isInput;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"connectInputBlock\", { get: function() {\n            return this.isConnectedToInputBlock ? this.connectedPoint.ownerBlock : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"connectedPoint\", { get: function() {\n            return this._connectedPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ownerBlock\", { get: function() {\n            return this._ownerBlock;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"sourceBlock\", { get: function() {\n            return this._connectedPoint ? this._connectedPoint.ownerBlock : null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"connectedBlocks\", { get: function() {\n            return this._endpoints.length === 0 ? [] : this._endpoints.map(function(t) {\n              return t.ownerBlock;\n            });\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"endpoints\", { get: function() {\n            return this._endpoints;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"hasEndpoints\", { get: function() {\n            return this._endpoints && this._endpoints.length > 0;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnectedInVertexShader\", { get: function() {\n            if (this.target === Ce.Vertex)\n              return !0;\n            if (!this.hasEndpoints)\n              return !1;\n            for (var t = 0, e = this._endpoints; t < e.length; t++) {\n              var n = e[t];\n              if (n.ownerBlock.target === Ce.Vertex || n.target === Ce.Vertex || (n.ownerBlock.target === Ce.Neutral || n.ownerBlock.target === Ce.VertexAndFragment) && n.ownerBlock.outputs.some(function(i) {\n                return i.isConnectedInVertexShader;\n              }))\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isConnectedInFragmentShader\", { get: function() {\n            if (this.target === Ce.Fragment)\n              return !0;\n            if (!this.hasEndpoints)\n              return !1;\n            for (var t = 0, e = this._endpoints; t < e.length; t++) {\n              var n = e[t];\n              if (n.ownerBlock.target === Ce.Fragment || (n.ownerBlock.target === Ce.Neutral || n.ownerBlock.target === Ce.VertexAndFragment) && n.ownerBlock.outputs.some(function(i) {\n                return i.isConnectedInFragmentShader;\n              }))\n                return !0;\n            }\n            return !1;\n          }, enumerable: !1, configurable: !0 }), r.prototype.createCustomInputBlock = function() {\n            return null;\n          }, r.prototype.getClassName = function() {\n            return \"NodeMaterialConnectionPoint\";\n          }, r.prototype.canConnectTo = function(t) {\n            return this.checkCompatibilityState(t) === ii.Compatible;\n          }, r.prototype.checkCompatibilityState = function(t) {\n            if (this._ownerBlock.target === Ce.Fragment) {\n              var e = t.ownerBlock;\n              if (e.target === Ce.Vertex)\n                return ii.TargetIncompatible;\n              for (var n = 0, i = e.outputs; n < i.length; n++)\n                if (i[n].isConnectedInVertexShader)\n                  return ii.TargetIncompatible;\n            }\n            return this.type !== t.type && t.innerType !== le.AutoDetect ? r.AreEquivalentTypes(this.type, t.type) || t.acceptedConnectionPointTypes && t.acceptedConnectionPointTypes.indexOf(this.type) !== -1 || t._acceptedConnectionPointType && r.AreEquivalentTypes(t._acceptedConnectionPointType.type, this.type) ? ii.Compatible : ii.TypeIncompatible : t.excludedConnectionPointTypes && t.excludedConnectionPointTypes.indexOf(this.type) !== -1 ? 1 : ii.Compatible;\n          }, r.prototype.connectTo = function(t, e) {\n            if (e === void 0 && (e = !1), !e && !this.canConnectTo(t))\n              throw \"Cannot connect these two connectors.\";\n            return this._endpoints.push(t), t._connectedPoint = this, this._enforceAssociatedVariableName = !1, this.onConnectionObservable.notifyObservers(t), t.onConnectionObservable.notifyObservers(this), this;\n          }, r.prototype.disconnectFrom = function(t) {\n            var e = this._endpoints.indexOf(t);\n            return e === -1 || (this._endpoints.splice(e, 1), t._connectedPoint = null, this._enforceAssociatedVariableName = !1, t._enforceAssociatedVariableName = !1), this;\n          }, r.prototype.serialize = function(t) {\n            t === void 0 && (t = !0);\n            var e = {};\n            return e.name = this.name, e.displayName = this.displayName, t && this.connectedPoint && (e.inputName = this.name, e.targetBlockId = this.connectedPoint.ownerBlock.uniqueId, e.targetConnectionName = this.connectedPoint.name, e.isExposedOnFrame = !0, e.exposedPortPosition = this.exposedPortPosition), (this.isExposedOnFrame || this.exposedPortPosition >= 0) && (e.isExposedOnFrame = !0, e.exposedPortPosition = this.exposedPortPosition), e;\n          }, r.prototype.dispose = function() {\n            this.onConnectionObservable.clear();\n          }, r;\n        }(), k_ = f(152), dt = function() {\n          function r(t, e, n, i) {\n            e === void 0 && (e = Ce.Vertex), n === void 0 && (n = !1), i === void 0 && (i = !1), this._isFinalMerger = !1, this._isInput = !1, this._name = \"\", this._isUnique = !1, this.inputsAreExclusive = !1, this._codeVariableName = \"\", this._inputs = new Array(), this._outputs = new Array(), this.comments = \"\", this.visibleInInspector = !1, this._target = e, this._isFinalMerger = n, this._isInput = i, this._name = t, this.uniqueId = k_.a.UniqueId;\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return this._name;\n          }, set: function(t) {\n            this.validateBlockName(t) && (this._name = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isUnique\", { get: function() {\n            return this._isUnique;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isFinalMerger\", { get: function() {\n            return this._isFinalMerger;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isInput\", { get: function() {\n            return this._isInput;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"buildId\", { get: function() {\n            return this._buildId;\n          }, set: function(t) {\n            this._buildId = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"target\", { get: function() {\n            return this._target;\n          }, set: function(t) {\n            !(this._target & t) && (this._target = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"inputs\", { get: function() {\n            return this._inputs;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"outputs\", { get: function() {\n            return this._outputs;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getInputByName = function(t) {\n            var e = this._inputs.filter(function(n) {\n              return n.name === t;\n            });\n            return e.length ? e[0] : null;\n          }, r.prototype.getOutputByName = function(t) {\n            var e = this._outputs.filter(function(n) {\n              return n.name === t;\n            });\n            return e.length ? e[0] : null;\n          }, r.prototype.initialize = function(t) {\n          }, r.prototype.bind = function(t, e, n, i) {\n          }, r.prototype._declareOutput = function(t, e) {\n            return e._getGLType(t.type) + \" \" + t.associatedVariableName;\n          }, r.prototype._writeVariable = function(t) {\n            return t.connectedPoint ? \"\" + t.associatedVariableName : \"0.\";\n          }, r.prototype._writeFloat = function(t) {\n            var e = t.toString();\n            return e.indexOf(\".\") === -1 && (e += \".0\"), \"\" + e;\n          }, r.prototype.getClassName = function() {\n            return \"NodeMaterialBlock\";\n          }, r.prototype.registerInput = function(t, e, n, i, o) {\n            return n === void 0 && (n = !1), (o = o ?? new na(t, this, yn.Input)).type = e, o.isOptional = n, i && (o.target = i), this._inputs.push(o), this;\n          }, r.prototype.registerOutput = function(t, e, n, i) {\n            return (i = i ?? new na(t, this, yn.Output)).type = e, n && (i.target = n), this._outputs.push(i), this;\n          }, r.prototype.getFirstAvailableInput = function(t) {\n            t === void 0 && (t = null);\n            for (var e = 0, n = this._inputs; e < n.length; e++) {\n              var i = n[e];\n              if (!(i.connectedPoint || t && t.type !== i.type && i.type !== le.AutoDetect))\n                return i;\n            }\n            return null;\n          }, r.prototype.getFirstAvailableOutput = function(t) {\n            t === void 0 && (t = null);\n            for (var e = 0, n = this._outputs; e < n.length; e++) {\n              var i = n[e];\n              if (!t || !t.target || t.target === Ce.Neutral || t.target & i.target)\n                return i;\n            }\n            return null;\n          }, r.prototype.getSiblingOutput = function(t) {\n            var e = this._outputs.indexOf(t);\n            return e === -1 || e >= this._outputs.length ? null : this._outputs[e + 1];\n          }, r.prototype.connectTo = function(t, e) {\n            if (this._outputs.length !== 0) {\n              for (var n = e && e.output ? this.getOutputByName(e.output) : this.getFirstAvailableOutput(t), i = !0; i; ) {\n                var o = e && e.input ? t.getInputByName(e.input) : t.getFirstAvailableInput(n);\n                if (n && o && n.canConnectTo(o))\n                  n.connectTo(o), i = !1;\n                else {\n                  if (!n)\n                    throw \"Unable to find a compatible match\";\n                  n = this.getSiblingOutput(n);\n                }\n              }\n              return this;\n            }\n          }, r.prototype._buildBlock = function(t) {\n          }, r.prototype.updateUniformsAndSamples = function(t, e, n, i) {\n          }, r.prototype.provideFallbacks = function(t, e) {\n          }, r.prototype.initializeDefines = function(t, e, n, i) {\n          }, r.prototype.prepareDefines = function(t, e, n, i, o) {\n          }, r.prototype.autoConfigure = function(t) {\n          }, r.prototype.replaceRepeatableContent = function(t, e, n, i) {\n          }, r.prototype.isReady = function(t, e, n, i) {\n            return !0;\n          }, r.prototype._linkConnectionTypes = function(t, e, n) {\n            n === void 0 && (n = !1), n ? this._inputs[e]._acceptedConnectionPointType = this._inputs[t] : this._inputs[t]._linkedConnectionSource = this._inputs[e], this._inputs[e]._linkedConnectionSource = this._inputs[t];\n          }, r.prototype._processBuild = function(t, e, n, i) {\n            t.build(e, i);\n            var o = e._vertexState != null, a = t._buildTarget === Ce.Vertex && t.target !== Ce.VertexAndFragment;\n            if (o && (!(t.target & t._buildTarget) || !(t.target & n.target) || this.target !== Ce.VertexAndFragment && a) && (!t.isInput && e.target !== t._buildTarget || t.isInput && t.isAttribute && !t._noContextSwitch)) {\n              var s = n.connectedPoint;\n              e._vertexState._emitVaryingFromString(\"v_\" + s.associatedVariableName, e._getGLType(s.type)) && (e._vertexState.compilationString += \"v_\" + s.associatedVariableName + \" = \" + s.associatedVariableName + `;\\r\n`), n.associatedVariableName = \"v_\" + s.associatedVariableName, n._enforceAssociatedVariableName = !0;\n            }\n          }, r.prototype.validateBlockName = function(t) {\n            for (var e = 0, n = [\"position\", \"normal\", \"tangent\", \"particle_positionw\", \"uv\", \"uv2\", \"position2d\", \"particle_uv\", \"matricesIndices\", \"matricesWeights\", \"world0\", \"world1\", \"world2\", \"world3\", \"particle_color\", \"particle_texturemask\"]; e < n.length; e++)\n              if (t === n[e])\n                return !1;\n            return !0;\n          }, r.prototype.build = function(t, e) {\n            if (this._buildId === t.sharedData.buildId)\n              return !0;\n            if (!this.isInput)\n              for (var n = 0, i = this._outputs; n < i.length; n++)\n                (y = i[n]).associatedVariableName || (y.associatedVariableName = t._getFreeVariableName(y.name));\n            for (var o = 0, a = this._inputs; o < a.length; o++) {\n              var s = a[o];\n              if (s.connectedPoint) {\n                if (this.target !== Ce.Neutral && (!(s.target & this.target) || !(s.target & t.target)))\n                  continue;\n                (B = s.connectedPoint.ownerBlock) && B !== this && this._processBuild(B, t, s, e);\n              } else\n                s.isOptional || t.sharedData.checks.notConnectedNonOptionalInputs.push(s);\n            }\n            if (this._buildId === t.sharedData.buildId)\n              return !0;\n            if (t.sharedData.verbose && console.log((t.target === Ce.Vertex ? \"Vertex shader\" : \"Fragment shader\") + \": Building \" + this.name + \" [\" + this.getClassName() + \"]\"), this.isFinalMerger)\n              switch (t.target) {\n                case Ce.Vertex:\n                  t.sharedData.checks.emitVertex = !0;\n                  break;\n                case Ce.Fragment:\n                  t.sharedData.checks.emitFragment = !0;\n              }\n            !this.isInput && t.sharedData.emitComments && (t.compilationString += `\\r\n//` + this.name + `\\r\n`), this._buildBlock(t), this._buildId = t.sharedData.buildId, this._buildTarget = t.target;\n            for (var d = 0, p = this._outputs; d < p.length; d++) {\n              var y;\n              if ((y = p[d]).target & t.target)\n                for (var P = 0, R = y.endpoints; P < R.length; P++) {\n                  var B, F = R[P];\n                  (B = F.ownerBlock) && B.target & t.target && e.indexOf(B) !== -1 && this._processBuild(B, t, F, e);\n                }\n            }\n            return !1;\n          }, r.prototype._inputRename = function(t) {\n            return t;\n          }, r.prototype._outputRename = function(t) {\n            return t;\n          }, r.prototype._dumpPropertiesCode = function() {\n            return this._codeVariableName + \".visibleInInspector = \" + this.visibleInInspector + `;\\r\n`;\n          }, r.prototype._dumpCode = function(t, e) {\n            var n;\n            e.push(this);\n            var i = this.name.replace(/[^A-Za-z_]+/g, \"\");\n            if (this._codeVariableName = i || this.getClassName() + \"_\" + this.uniqueId, t.indexOf(this._codeVariableName) !== -1) {\n              var o = 0;\n              do\n                o++, this._codeVariableName = i + o;\n              while (t.indexOf(this._codeVariableName) !== -1);\n            }\n            t.push(this._codeVariableName), n = `\\r\n// ` + this.getClassName() + `\\r\n`, this.comments && (n += \"// \" + this.comments + `\\r\n`), n += \"var \" + this._codeVariableName + \" = new BABYLON.\" + this.getClassName() + '(\"' + this.name + `\");\\r\n`, n += this._dumpPropertiesCode();\n            for (var a = 0, s = this.inputs; a < s.length; a++) {\n              var d = s[a];\n              if (d.isConnected) {\n                var p = d.connectedPoint.ownerBlock;\n                e.indexOf(p) === -1 && (n += p._dumpCode(t, e));\n              }\n            }\n            for (var y = 0, P = this.outputs; y < P.length; y++) {\n              var R = P[y];\n              if (R.hasEndpoints)\n                for (var B = 0, F = R.endpoints; B < F.length; B++)\n                  (p = F[B].ownerBlock) && e.indexOf(p) === -1 && (n += p._dumpCode(t, e));\n            }\n            return n;\n          }, r.prototype._dumpCodeForOutputConnections = function(t) {\n            var e = \"\";\n            if (t.indexOf(this) !== -1)\n              return e;\n            t.push(this);\n            for (var n = 0, i = this.inputs; n < i.length; n++) {\n              var o = i[n];\n              if (o.isConnected) {\n                var a = o.connectedPoint, s = a.ownerBlock;\n                e += s._dumpCodeForOutputConnections(t), e += s._codeVariableName + \".\" + s._outputRename(a.name) + \".connectTo(\" + this._codeVariableName + \".\" + this._inputRename(o.name) + `);\\r\n`;\n              }\n            }\n            return e;\n          }, r.prototype.clone = function(t, e) {\n            e === void 0 && (e = \"\");\n            var n = this.serialize(), i = O.a.GetClass(n.customType);\n            if (i) {\n              var o = new i();\n              return o._deserialize(n, t, e), o;\n            }\n            return null;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            t.customType = \"BABYLON.\" + this.getClassName(), t.id = this.uniqueId, t.name = this.name, t.comments = this.comments, t.visibleInInspector = this.visibleInInspector, t.inputs = [], t.outputs = [];\n            for (var e = 0, n = this.inputs; e < n.length; e++) {\n              var i = n[e];\n              t.inputs.push(i.serialize());\n            }\n            for (var o = 0, a = this.outputs; o < a.length; o++) {\n              var s = a[o];\n              t.outputs.push(s.serialize(!1));\n            }\n            return t;\n          }, r.prototype._deserialize = function(t, e, n) {\n            this.name = t.name, this.comments = t.comments, this.visibleInInspector = !!t.visibleInInspector, this._deserializePortDisplayNamesAndExposedOnFrame(t);\n          }, r.prototype._deserializePortDisplayNamesAndExposedOnFrame = function(t) {\n            var e = this, n = t.inputs, i = t.outputs;\n            n && n.forEach(function(o, a) {\n              o.displayName && (e.inputs[a].displayName = o.displayName), o.isExposedOnFrame && (e.inputs[a].isExposedOnFrame = o.isExposedOnFrame, e.inputs[a].exposedPortPosition = o.exposedPortPosition);\n            }), i && i.forEach(function(o, a) {\n              o.displayName && (e.outputs[a].displayName = o.displayName), o.isExposedOnFrame && (e.outputs[a].isExposedOnFrame = o.isExposedOnFrame, e.outputs[a].exposedPortPosition = o.exposedPortPosition);\n            });\n          }, r.prototype.dispose = function() {\n            for (var t = 0, e = this.inputs; t < e.length; t++)\n              e[t].dispose();\n            for (var n = 0, i = this.outputs; n < i.length; n++)\n              i[n].dispose();\n          }, r;\n        }(), Xu = function() {\n          function r() {\n            this.supportUniformBuffers = !1, this.attributes = new Array(), this.uniforms = new Array(), this.constants = new Array(), this.samplers = new Array(), this.functions = {}, this.extensions = {}, this.counters = {}, this._attributeDeclaration = \"\", this._uniformDeclaration = \"\", this._constantDeclaration = \"\", this._samplerDeclaration = \"\", this._varyingTransfer = \"\", this._injectAtEnd = \"\", this._repeatableContentAnchorIndex = 0, this._builtCompilationString = \"\", this.compilationString = \"\";\n          }\n          return r.prototype.finalize = function(t) {\n            var e = t.sharedData.emitComments, n = this.target === Ce.Fragment;\n            this.compilationString = `\\r\n` + (e ? `//Entry point\\r\n` : \"\") + `void main(void) {\\r\n` + this.compilationString, this._constantDeclaration && (this.compilationString = `\\r\n` + (e ? `//Constants\\r\n` : \"\") + this._constantDeclaration + `\\r\n` + this.compilationString);\n            var i = \"\";\n            for (var o in this.functions)\n              i += this.functions[o] + `\\r\n`;\n            for (var a in this.compilationString = `\\r\n` + i + `\\r\n` + this.compilationString, !n && this._varyingTransfer && (this.compilationString = this.compilationString + `\\r\n` + this._varyingTransfer), this._injectAtEnd && (this.compilationString = this.compilationString + `\\r\n` + this._injectAtEnd), this.compilationString = this.compilationString + `\\r\n}`, this.sharedData.varyingDeclaration && (this.compilationString = `\\r\n` + (e ? `//Varyings\\r\n` : \"\") + this.sharedData.varyingDeclaration + `\\r\n` + this.compilationString), this._samplerDeclaration && (this.compilationString = `\\r\n` + (e ? `//Samplers\\r\n` : \"\") + this._samplerDeclaration + `\\r\n` + this.compilationString), this._uniformDeclaration && (this.compilationString = `\\r\n` + (e ? `//Uniforms\\r\n` : \"\") + this._uniformDeclaration + `\\r\n` + this.compilationString), this._attributeDeclaration && !n && (this.compilationString = `\\r\n` + (e ? `//Attributes\\r\n` : \"\") + this._attributeDeclaration + `\\r\n` + this.compilationString), this.compilationString = `precision highp float;\\r\n` + this.compilationString, this.extensions) {\n              var s = this.extensions[a];\n              this.compilationString = `\\r\n` + s + `\\r\n` + this.compilationString;\n            }\n            this._builtCompilationString = this.compilationString;\n          }, Object.defineProperty(r.prototype, \"_repeatableContentAnchor\", { get: function() {\n            return \"###___ANCHOR\" + this._repeatableContentAnchorIndex++ + \"___###\";\n          }, enumerable: !1, configurable: !0 }), r.prototype._getFreeVariableName = function(t) {\n            return t = t.replace(/[^a-zA-Z_]+/g, \"\"), this.sharedData.variableNames[t] === void 0 ? (this.sharedData.variableNames[t] = 0, t === \"output\" || t === \"texture\" ? t + this.sharedData.variableNames[t] : t) : (this.sharedData.variableNames[t]++, t + this.sharedData.variableNames[t]);\n          }, r.prototype._getFreeDefineName = function(t) {\n            return this.sharedData.defineNames[t] === void 0 ? this.sharedData.defineNames[t] = 0 : this.sharedData.defineNames[t]++, t + this.sharedData.defineNames[t];\n          }, r.prototype._excludeVariableName = function(t) {\n            this.sharedData.variableNames[t] = 0;\n          }, r.prototype._emit2DSampler = function(t) {\n            this.samplers.indexOf(t) < 0 && (this._samplerDeclaration += \"uniform sampler2D \" + t + `;\\r\n`, this.samplers.push(t));\n          }, r.prototype._getGLType = function(t) {\n            switch (t) {\n              case le.Float:\n                return \"float\";\n              case le.Int:\n                return \"int\";\n              case le.Vector2:\n                return \"vec2\";\n              case le.Color3:\n              case le.Vector3:\n                return \"vec3\";\n              case le.Color4:\n              case le.Vector4:\n                return \"vec4\";\n              case le.Matrix:\n                return \"mat4\";\n            }\n            return \"\";\n          }, r.prototype._emitExtension = function(t, e, n) {\n            n === void 0 && (n = \"\"), this.extensions[t] || (n && (e = \"#if \" + n + `\\r\n` + e + `\\r\n#endif`), this.extensions[t] = e);\n          }, r.prototype._emitFunction = function(t, e, n) {\n            this.functions[t] || (this.sharedData.emitComments && (e = n + `\\r\n` + e), this.functions[t] = e);\n          }, r.prototype._emitCodeFromInclude = function(t, e, n) {\n            if (n && n.repeatKey)\n              return \"#include<\" + t + \">[0..\" + n.repeatKey + `]\\r\n`;\n            var i = ze.a.IncludesShadersStore[t] + `\\r\n`;\n            if (this.sharedData.emitComments && (i = e + `\\r\n` + i), !n)\n              return i;\n            if (n.replaceStrings)\n              for (var o = 0; o < n.replaceStrings.length; o++) {\n                var a = n.replaceStrings[o];\n                i = i.replace(a.search, a.replace);\n              }\n            return i;\n          }, r.prototype._emitFunctionFromInclude = function(t, e, n, i) {\n            i === void 0 && (i = \"\");\n            var o = t + i;\n            if (!this.functions[o]) {\n              if (!(n && (n.removeAttributes || n.removeUniforms || n.removeVaryings || n.removeIfDef || n.replaceStrings)))\n                return n && n.repeatKey ? this.functions[o] = \"#include<\" + t + \">[0..\" + n.repeatKey + `]\\r\n` : this.functions[o] = \"#include<\" + t + `>\\r\n`, void (this.sharedData.emitComments && (this.functions[o] = e + `\\r\n` + this.functions[o]));\n              if (this.functions[o] = ze.a.IncludesShadersStore[t], this.sharedData.emitComments && (this.functions[o] = e + `\\r\n` + this.functions[o]), n.removeIfDef && (this.functions[o] = this.functions[o].replace(/^\\s*?#ifdef.+$/gm, \"\"), this.functions[o] = this.functions[o].replace(/^\\s*?#endif.*$/gm, \"\"), this.functions[o] = this.functions[o].replace(/^\\s*?#else.*$/gm, \"\"), this.functions[o] = this.functions[o].replace(/^\\s*?#elif.*$/gm, \"\")), n.removeAttributes && (this.functions[o] = this.functions[o].replace(/^\\s*?attribute.+$/gm, \"\")), n.removeUniforms && (this.functions[o] = this.functions[o].replace(/^\\s*?uniform.+$/gm, \"\")), n.removeVaryings && (this.functions[o] = this.functions[o].replace(/^\\s*?varying.+$/gm, \"\")), n.replaceStrings)\n                for (var a = 0; a < n.replaceStrings.length; a++) {\n                  var s = n.replaceStrings[a];\n                  this.functions[o] = this.functions[o].replace(s.search, s.replace);\n                }\n            }\n          }, r.prototype._registerTempVariable = function(t) {\n            return this.sharedData.temps.indexOf(t) === -1 && (this.sharedData.temps.push(t), !0);\n          }, r.prototype._emitVaryingFromString = function(t, e, n, i) {\n            return n === void 0 && (n = \"\"), i === void 0 && (i = !1), this.sharedData.varyings.indexOf(t) === -1 && (this.sharedData.varyings.push(t), n && (Hn.a.StartsWith(n, \"defined(\") ? this.sharedData.varyingDeclaration += \"#if \" + n + `\\r\n` : this.sharedData.varyingDeclaration += (i ? \"#ifndef\" : \"#ifdef\") + \" \" + n + `\\r\n`), this.sharedData.varyingDeclaration += \"varying \" + e + \" \" + t + `;\\r\n`, n && (this.sharedData.varyingDeclaration += `#endif\\r\n`), !0);\n          }, r.prototype._emitUniformFromString = function(t, e, n, i) {\n            n === void 0 && (n = \"\"), i === void 0 && (i = !1), this.uniforms.indexOf(t) === -1 && (this.uniforms.push(t), n && (Hn.a.StartsWith(n, \"defined(\") ? this._uniformDeclaration += \"#if \" + n + `\\r\n` : this._uniformDeclaration += (i ? \"#ifndef\" : \"#ifdef\") + \" \" + n + `\\r\n`), this._uniformDeclaration += \"uniform \" + e + \" \" + t + `;\\r\n`, n && (this._uniformDeclaration += `#endif\\r\n`));\n          }, r.prototype._emitFloat = function(t) {\n            return t.toString() === t.toFixed(0) ? t + \".0\" : t.toString();\n          }, r;\n        }(), G_ = function() {\n          function r() {\n            this.temps = new Array(), this.varyings = new Array(), this.varyingDeclaration = \"\", this.inputBlocks = new Array(), this.textureBlocks = new Array(), this.bindableBlocks = new Array(), this.blocksWithFallbacks = new Array(), this.blocksWithDefines = new Array(), this.repeatableContentBlocks = new Array(), this.dynamicUniformBlocks = new Array(), this.blockingBlocks = new Array(), this.animatedInputs = new Array(), this.variableNames = {}, this.defineNames = {}, this.hints = { needWorldViewMatrix: !1, needWorldViewProjectionMatrix: !1, needAlphaBlending: !1, needAlphaTesting: !1 }, this.checks = { emitVertex: !1, emitFragment: !1, notConnectedNonOptionalInputs: new Array() }, this.allowEmptyVertexProgram = !1, this.variableNames.position = 0, this.variableNames.normal = 0, this.variableNames.tangent = 0, this.variableNames.uv = 0, this.variableNames.uv2 = 0, this.variableNames.uv3 = 0, this.variableNames.uv4 = 0, this.variableNames.uv4 = 0, this.variableNames.uv5 = 0, this.variableNames.uv6 = 0, this.variableNames.color = 0, this.variableNames.matricesIndices = 0, this.variableNames.matricesWeights = 0, this.variableNames.matricesIndicesExtra = 0, this.variableNames.matricesWeightsExtra = 0, this.variableNames.diffuseBase = 0, this.variableNames.specularBase = 0, this.variableNames.worldPos = 0, this.variableNames.shadow = 0, this.variableNames.view = 0, this.variableNames.vTBN = 0, this.defineNames.MAINUV0 = 0, this.defineNames.MAINUV1 = 0, this.defineNames.MAINUV2 = 0, this.defineNames.MAINUV3 = 0, this.defineNames.MAINUV4 = 0, this.defineNames.MAINUV5 = 0, this.defineNames.MAINUV6 = 0, this.defineNames.MAINUV7 = 0;\n          }\n          return r.prototype.emitErrors = function() {\n            var t = \"\";\n            this.checks.emitVertex || this.allowEmptyVertexProgram || (t += `NodeMaterial does not have a vertex output. You need to at least add a block that generates a glPosition value.\\r\n`), this.checks.emitFragment || (t += `NodeMaterial does not have a fragment output. You need to at least add a block that generates a glFragColor value.\\r\n`);\n            for (var e = 0, n = this.checks.notConnectedNonOptionalInputs; e < n.length; e++) {\n              var i = n[e];\n              t += \"input \" + i.name + \" from block \" + i.ownerBlock.name + \"[\" + i.ownerBlock.getClassName() + `] is not connected and is not optional.\\r\n`;\n            }\n            if (t)\n              throw `Build of NodeMaterial failed:\\r\n` + t;\n          }, r;\n        }(), ia = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.complementW = 1, n.complementZ = 0, n.registerInput(\"vector\", le.AutoDetect), n.registerInput(\"transform\", le.Matrix), n.registerOutput(\"output\", le.Vector4), n.registerOutput(\"xyz\", le.Vector3), n._inputs[0].onConnectionObservable.add(function(i) {\n              if (i.ownerBlock.isInput) {\n                var o = i.ownerBlock;\n                o.name !== \"normal\" && o.name !== \"tangent\" || (n.complementW = 0);\n              }\n            }), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TransformBlock\";\n          }, Object.defineProperty(t.prototype, \"vector\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyz\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"transform\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.vector, i = this.transform;\n            if (n.connectedPoint) {\n              if (this.complementW === 0) {\n                var o = \"//\" + this.name;\n                e._emitFunctionFromInclude(\"helperFunctions\", o), e.sharedData.blocksWithDefines.push(this);\n                var a = e._getFreeVariableName(i.associatedVariableName + \"_NUS\");\n                switch (e.compilationString += \"mat3 \" + a + \" = mat3(\" + i.associatedVariableName + `);\\r\n`, e.compilationString += `#ifdef NONUNIFORMSCALING\\r\n`, e.compilationString += a + \" = transposeMat3(inverseMat3(\" + a + `));\\r\n`, e.compilationString += `#endif\\r\n`, n.connectedPoint.type) {\n                  case le.Vector2:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = vec4(\" + a + \" * vec3(\" + n.associatedVariableName + \", \" + this._writeFloat(this.complementZ) + \"), \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  case le.Vector3:\n                  case le.Color3:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = vec4(\" + a + \" * \" + n.associatedVariableName + \", \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  default:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = vec4(\" + a + \" * \" + n.associatedVariableName + \".xyz, \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                }\n              } else\n                switch (a = i.associatedVariableName, n.connectedPoint.type) {\n                  case le.Vector2:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = \" + a + \" * vec4(\" + n.associatedVariableName + \", \" + this._writeFloat(this.complementZ) + \", \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  case le.Vector3:\n                  case le.Color3:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = \" + a + \" * vec4(\" + n.associatedVariableName + \", \" + this._writeFloat(this.complementW) + `);\\r\n`;\n                    break;\n                  default:\n                    e.compilationString += this._declareOutput(this.output, e) + \" = \" + a + \" * \" + n.associatedVariableName + `;\\r\n`;\n                }\n              this.xyz.hasEndpoints && (e.compilationString += this._declareOutput(this.xyz, e) + \" = \" + this.output.associatedVariableName + `.xyz;\\r\n`);\n            }\n            return this;\n          }, t.prototype.prepareDefines = function(e, n, i, o, a) {\n            e.nonUniformScaling && i.setValue(\"NONUNIFORMSCALING\", !0);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.complementZ = this.complementZ, e.complementW = this.complementW, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.complementZ = e.complementZ !== void 0 ? e.complementZ : 0, this.complementW = e.complementW !== void 0 ? e.complementW : 1;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".complementZ = \" + this.complementZ + `;\\r\n`;\n            return e += this._codeVariableName + \".complementW = \" + this.complementW + `;\\r\n`;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.TransformBlock\"] = ia;\n        var ao = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex, !0) || this;\n            return n.registerInput(\"vector\", le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VertexOutputBlock\";\n          }, Object.defineProperty(t.prototype, \"vector\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.vector;\n            return e.compilationString += \"gl_Position = \" + n.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.VertexOutputBlock\"] = ao;\n        var wi, Pr = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment, !0) || this;\n            return n.registerInput(\"rgba\", le.Color4, !0), n.registerInput(\"rgb\", le.Color3, !0), n.registerInput(\"a\", le.Float, !0), n.rgb.acceptedConnectionPointTypes.push(le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FragmentOutputBlock\";\n          }, Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.rgba, i = this.rgb, o = this.a;\n            if (e.sharedData.hints.needAlphaBlending = n.isConnected || o.isConnected, n.connectedPoint)\n              o.isConnected ? e.compilationString += \"gl_FragColor = vec4(\" + n.associatedVariableName + \".rgb, \" + o.associatedVariableName + `);\\r\n` : e.compilationString += \"gl_FragColor = \" + n.associatedVariableName + `;\\r\n`;\n            else if (i.connectedPoint) {\n              var a = \"1.0\";\n              o.connectedPoint && (a = o.associatedVariableName), i.connectedPoint.type === le.Float ? e.compilationString += \"gl_FragColor = vec4(\" + i.associatedVariableName + \", \" + i.associatedVariableName + \", \" + i.associatedVariableName + \", \" + a + `);\\r\n` : e.compilationString += \"gl_FragColor = vec4(\" + i.associatedVariableName + \", \" + a + `);\\r\n`;\n            } else\n              e.sharedData.checks.notConnectedNonOptionalInputs.push(n);\n            return this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FragmentOutputBlock\"] = Pr, function(r) {\n          r[r.None = 0] = \"None\", r[r.Time = 1] = \"Time\";\n        }(wi || (wi = {}));\n        var z_ = { position2d: \"position\", particle_uv: \"vUV\", particle_color: \"vColor\", particle_texturemask: \"textureMask\", particle_positionw: \"vPositionW\" }, Gs = { particle_uv: !0, particle_color: !0, particle_texturemask: !0, particle_positionw: !0 }, Yu = { particle_texturemask: !0 }, Et = function(r) {\n          function t(e, n, i) {\n            n === void 0 && (n = Ce.Vertex), i === void 0 && (i = le.AutoDetect);\n            var o = r.call(this, e, n, !1, !0) || this;\n            return o._mode = gn.Undefined, o._animationType = wi.None, o.min = 0, o.max = 0, o.isBoolean = !1, o.matrixMode = 0, o._systemValue = null, o.isConstant = !1, o.groupInInspector = \"\", o.onValueChangedObservable = new C.c(), o.convertToGammaSpace = !1, o.convertToLinearSpace = !1, o._type = i, o.setDefaultValue(), o.registerOutput(\"output\", i), o;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"type\", { get: function() {\n            if (this._type === le.AutoDetect) {\n              if (this.isUniform && this.value != null) {\n                if (!isNaN(this.value))\n                  return this._type = le.Float, this._type;\n                switch (this.value.getClassName()) {\n                  case \"Vector2\":\n                    return this._type = le.Vector2, this._type;\n                  case \"Vector3\":\n                    return this._type = le.Vector3, this._type;\n                  case \"Vector4\":\n                    return this._type = le.Vector4, this._type;\n                  case \"Color3\":\n                    return this._type = le.Color3, this._type;\n                  case \"Color4\":\n                    return this._type = le.Color4, this._type;\n                  case \"Matrix\":\n                    return this._type = le.Matrix, this._type;\n                }\n              }\n              if (this.isAttribute)\n                switch (this.name) {\n                  case \"position\":\n                  case \"normal\":\n                  case \"tangent\":\n                  case \"particle_positionw\":\n                    return this._type = le.Vector3, this._type;\n                  case \"uv\":\n                  case \"uv2\":\n                  case \"position2d\":\n                  case \"particle_uv\":\n                    return this._type = le.Vector2, this._type;\n                  case \"matricesIndices\":\n                  case \"matricesWeights\":\n                  case \"world0\":\n                  case \"world1\":\n                  case \"world2\":\n                  case \"world3\":\n                    return this._type = le.Vector4, this._type;\n                  case \"color\":\n                  case \"particle_color\":\n                  case \"particle_texturemask\":\n                    return this._type = le.Color4, this._type;\n                }\n              if (this.isSystemValue)\n                switch (this._systemValue) {\n                  case gt.World:\n                  case gt.WorldView:\n                  case gt.WorldViewProjection:\n                  case gt.View:\n                  case gt.ViewProjection:\n                  case gt.Projection:\n                    return this._type = le.Matrix, this._type;\n                  case gt.CameraPosition:\n                    return this._type = le.Vector3, this._type;\n                  case gt.FogColor:\n                    return this._type = le.Color3, this._type;\n                  case gt.DeltaTime:\n                    return this._type = le.Float, this._type;\n                }\n            }\n            return this._type;\n          }, enumerable: !1, configurable: !0 }), t.prototype.validateBlockName = function(e) {\n            return !!this.isAttribute || r.prototype.validateBlockName.call(this, e);\n          }, Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.setAsAttribute = function(e) {\n            return this._mode = gn.Attribute, e && (this.name = e), this;\n          }, t.prototype.setAsSystemValue = function(e) {\n            return this.systemValue = e, this;\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._storedValue;\n          }, set: function(e) {\n            this.type === le.Float && (this.isBoolean ? e = e ? 1 : 0 : this.min !== this.max && (e = Math.max(this.min, e), e = Math.min(this.max, e))), this._storedValue = e, this._mode = gn.Uniform, this.onValueChangedObservable.notifyObservers(this);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"valueCallback\", { get: function() {\n            return this._valueCallback;\n          }, set: function(e) {\n            this._valueCallback = e, this._mode = gn.Uniform;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"associatedVariableName\", { get: function() {\n            return this._associatedVariableName;\n          }, set: function(e) {\n            this._associatedVariableName = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"animationType\", { get: function() {\n            return this._animationType;\n          }, set: function(e) {\n            this._animationType = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isUndefined\", { get: function() {\n            return this._mode === gn.Undefined;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isUniform\", { get: function() {\n            return this._mode === gn.Uniform;\n          }, set: function(e) {\n            this._mode = e ? gn.Uniform : gn.Undefined, this.associatedVariableName = \"\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isAttribute\", { get: function() {\n            return this._mode === gn.Attribute;\n          }, set: function(e) {\n            this._mode = e ? gn.Attribute : gn.Undefined, this.associatedVariableName = \"\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isVarying\", { get: function() {\n            return this._mode === gn.Varying;\n          }, set: function(e) {\n            this._mode = e ? gn.Varying : gn.Undefined, this.associatedVariableName = \"\";\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isSystemValue\", { get: function() {\n            return this._systemValue != null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"systemValue\", { get: function() {\n            return this._systemValue;\n          }, set: function(e) {\n            this._mode = gn.Uniform, this.associatedVariableName = \"\", this._systemValue = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"InputBlock\";\n          }, t.prototype.animate = function(e) {\n            switch (this._animationType) {\n              case wi.Time:\n                this.type === le.Float && (this.value += 0.01 * e.getAnimationRatio());\n            }\n          }, t.prototype._emitDefine = function(e) {\n            return e[0] === \"!\" ? \"#ifndef \" + e.substring(1) + `\\r\n` : \"#ifdef \" + e + `\\r\n`;\n          }, t.prototype.initialize = function(e) {\n            this.associatedVariableName = \"\";\n          }, t.prototype.setDefaultValue = function() {\n            switch (this.type) {\n              case le.Float:\n                this.value = 0;\n                break;\n              case le.Vector2:\n                this.value = u.d.Zero();\n                break;\n              case le.Vector3:\n                this.value = u.e.Zero();\n                break;\n              case le.Vector4:\n                this.value = u.f.Zero();\n                break;\n              case le.Color3:\n                this.value = I.a.White();\n                break;\n              case le.Color4:\n                this.value = new I.b(1, 1, 1, 1);\n                break;\n              case le.Matrix:\n                this.value = u.a.Identity();\n            }\n          }, t.prototype._emitConstant = function(e) {\n            switch (this.type) {\n              case le.Float:\n                return \"\" + e._emitFloat(this.value);\n              case le.Vector2:\n                return \"vec2(\" + this.value.x + \", \" + this.value.y + \")\";\n              case le.Vector3:\n                return \"vec3(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \")\";\n              case le.Vector4:\n                return \"vec4(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \", \" + this.value.w + \")\";\n              case le.Color3:\n                return I.c.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && I.c.Color3[0].toGammaSpaceToRef(I.c.Color3[0]), this.convertToLinearSpace && I.c.Color3[0].toLinearSpaceToRef(I.c.Color3[0]), \"vec3(\" + I.c.Color3[0].r + \", \" + I.c.Color3[0].g + \", \" + I.c.Color3[0].b + \")\";\n              case le.Color4:\n                return I.c.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && I.c.Color4[0].toGammaSpaceToRef(I.c.Color4[0]), this.convertToLinearSpace && I.c.Color4[0].toLinearSpaceToRef(I.c.Color4[0]), \"vec4(\" + I.c.Color4[0].r + \", \" + I.c.Color4[0].g + \", \" + I.c.Color4[0].b + \", \" + I.c.Color4[0].a + \")\";\n            }\n            return \"\";\n          }, Object.defineProperty(t.prototype, \"_noContextSwitch\", { get: function() {\n            return Gs[this.name];\n          }, enumerable: !1, configurable: !0 }), t.prototype._emit = function(e, n) {\n            var i;\n            if (this.isUniform) {\n              if (this.associatedVariableName || (this.associatedVariableName = e._getFreeVariableName(\"u_\" + this.name)), this.isConstant)\n                return e.constants.indexOf(this.associatedVariableName) !== -1 ? void 0 : (e.constants.push(this.associatedVariableName), void (e._constantDeclaration += this._declareOutput(this.output, e) + \" = \" + this._emitConstant(e) + `;\\r\n`));\n              if (e.uniforms.indexOf(this.associatedVariableName) !== -1)\n                return;\n              e.uniforms.push(this.associatedVariableName), n && (e._uniformDeclaration += this._emitDefine(n)), e._uniformDeclaration += \"uniform \" + e._getGLType(this.type) + \" \" + this.associatedVariableName + `;\\r\n`, n && (e._uniformDeclaration += `#endif\\r\n`);\n              var o = e.sharedData.hints;\n              if (this._systemValue !== null && this._systemValue !== void 0)\n                switch (this._systemValue) {\n                  case gt.WorldView:\n                    o.needWorldViewMatrix = !0;\n                    break;\n                  case gt.WorldViewProjection:\n                    o.needWorldViewProjectionMatrix = !0;\n                }\n              else\n                this._animationType !== wi.None && e.sharedData.animatedInputs.push(this);\n            } else if (this.isAttribute) {\n              if (this.associatedVariableName = (i = z_[this.name]) !== null && i !== void 0 ? i : this.name, this.target === Ce.Vertex && e._vertexState)\n                return void (Gs[this.name] ? Yu[this.name] ? e._emitUniformFromString(this.associatedVariableName, e._getGLType(this.type), n) : e._emitVaryingFromString(this.associatedVariableName, e._getGLType(this.type), n) : this._emit(e._vertexState, n));\n              if (e.attributes.indexOf(this.associatedVariableName) !== -1)\n                return;\n              e.attributes.push(this.associatedVariableName), Gs[this.name] ? Yu[this.name] ? e._emitUniformFromString(this.associatedVariableName, e._getGLType(this.type), n) : e._emitVaryingFromString(this.associatedVariableName, e._getGLType(this.type), n) : (n && (e._attributeDeclaration += this._emitDefine(n)), e._attributeDeclaration += \"attribute \" + e._getGLType(this.type) + \" \" + this.associatedVariableName + `;\\r\n`, n && (e._attributeDeclaration += `#endif\\r\n`));\n            }\n          }, t.prototype._transmitWorld = function(e, n, i, o) {\n            if (this._systemValue) {\n              var a = this.associatedVariableName;\n              switch (this._systemValue) {\n                case gt.World:\n                  e.setMatrix(a, n);\n                  break;\n                case gt.WorldView:\n                  e.setMatrix(a, i);\n                  break;\n                case gt.WorldViewProjection:\n                  e.setMatrix(a, o);\n              }\n            }\n          }, t.prototype._transmit = function(e, n) {\n            if (!this.isAttribute) {\n              var i = this.associatedVariableName;\n              if (this._systemValue)\n                switch (this._systemValue) {\n                  case gt.World:\n                  case gt.WorldView:\n                  case gt.WorldViewProjection:\n                    return;\n                  case gt.View:\n                    e.setMatrix(i, n.getViewMatrix());\n                    break;\n                  case gt.Projection:\n                    e.setMatrix(i, n.getProjectionMatrix());\n                    break;\n                  case gt.ViewProjection:\n                    e.setMatrix(i, n.getTransformMatrix());\n                    break;\n                  case gt.CameraPosition:\n                    $e.a.BindEyePosition(e, n, i);\n                    break;\n                  case gt.FogColor:\n                    e.setColor3(i, n.fogColor);\n                    break;\n                  case gt.DeltaTime:\n                    e.setFloat(i, n.deltaTime / 1e3);\n                }\n              else {\n                var o = this._valueCallback ? this._valueCallback() : this._storedValue;\n                if (o !== null)\n                  switch (this.type) {\n                    case le.Float:\n                      e.setFloat(i, o);\n                      break;\n                    case le.Int:\n                      e.setInt(i, o);\n                      break;\n                    case le.Color3:\n                      I.c.Color3[0].set(this.value.r, this.value.g, this.value.b), this.convertToGammaSpace && I.c.Color3[0].toGammaSpaceToRef(I.c.Color3[0]), this.convertToLinearSpace && I.c.Color3[0].toLinearSpaceToRef(I.c.Color3[0]), e.setColor3(i, I.c.Color3[0]);\n                      break;\n                    case le.Color4:\n                      I.c.Color4[0].set(this.value.r, this.value.g, this.value.b, this.value.a), this.convertToGammaSpace && I.c.Color4[0].toGammaSpaceToRef(I.c.Color4[0]), this.convertToLinearSpace && I.c.Color4[0].toLinearSpaceToRef(I.c.Color4[0]), e.setDirectColor4(i, I.c.Color4[0]);\n                      break;\n                    case le.Vector2:\n                      e.setVector2(i, o);\n                      break;\n                    case le.Vector3:\n                      e.setVector3(i, o);\n                      break;\n                    case le.Vector4:\n                      e.setVector4(i, o);\n                      break;\n                    case le.Matrix:\n                      e.setMatrix(i, o);\n                  }\n              }\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), (this.isUniform || this.isSystemValue) && e.sharedData.inputBlocks.push(this), this._emit(e);\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName;\n            if (this.isAttribute)\n              return e + '.setAsAttribute(\"' + this.name + `\");\\r\n`;\n            if (this.isSystemValue)\n              return e + \".setAsSystemValue(BABYLON.NodeMaterialSystemValues.\" + gt[this._systemValue] + `);\\r\n`;\n            if (this.isUniform) {\n              var n = [], i = \"\";\n              switch (this.type) {\n                case le.Float:\n                  i = \"\" + this.value;\n                  break;\n                case le.Vector2:\n                  i = \"new BABYLON.Vector2(\" + this.value.x + \", \" + this.value.y + \")\";\n                  break;\n                case le.Vector3:\n                  i = \"new BABYLON.Vector3(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \")\";\n                  break;\n                case le.Vector4:\n                  i = \"new BABYLON.Vector4(\" + this.value.x + \", \" + this.value.y + \", \" + this.value.z + \", \" + this.value.w + \")\";\n                  break;\n                case le.Color3:\n                  i = \"new BABYLON.Color3(\" + this.value.r + \", \" + this.value.g + \", \" + this.value.b + \")\", this.convertToGammaSpace && (i += \".toGammaSpace()\"), this.convertToLinearSpace && (i += \".toLinearSpace()\");\n                  break;\n                case le.Color4:\n                  i = \"new BABYLON.Color4(\" + this.value.r + \", \" + this.value.g + \", \" + this.value.b + \", \" + this.value.a + \")\", this.convertToGammaSpace && (i += \".toGammaSpace()\"), this.convertToLinearSpace && (i += \".toLinearSpace()\");\n                  break;\n                case le.Matrix:\n                  i = \"BABYLON.Matrix.FromArray([\" + this.value.m + \"])\";\n              }\n              return n.push(e + \".value = \" + i), this.type === le.Float && n.push(e + \".min = \" + this.min, e + \".max = \" + this.max, e + \".isBoolean = \" + this.isBoolean, e + \".matrixMode = \" + this.matrixMode, e + \".animationType = BABYLON.AnimatedInputBlockTypes.\" + wi[this.animationType]), n.push(e + \".isConstant = \" + this.isConstant), n.push(\"\"), n.join(`;\\r\n`);\n            }\n            return \"\";\n          }, t.prototype.dispose = function() {\n            this.onValueChangedObservable.clear(), r.prototype.dispose.call(this);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.type = this.type, e.mode = this._mode, e.systemValue = this._systemValue, e.animationType = this._animationType, e.min = this.min, e.max = this.max, e.isBoolean = this.isBoolean, e.matrixMode = this.matrixMode, e.isConstant = this.isConstant, e.groupInInspector = this.groupInInspector, e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this._storedValue != null && this._mode === gn.Uniform && (this._storedValue.asArray ? (e.valueType = \"BABYLON.\" + this._storedValue.getClassName(), e.value = this._storedValue.asArray()) : (e.valueType = \"number\", e.value = this._storedValue)), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            if (this._mode = e.mode, r.prototype._deserialize.call(this, e, n, i), this._type = e.type, this._systemValue = e.systemValue || e.wellKnownValue, this._animationType = e.animationType, this.min = e.min || 0, this.max = e.max || 0, this.isBoolean = !!e.isBoolean, this.matrixMode = e.matrixMode || 0, this.isConstant = !!e.isConstant, this.groupInInspector = e.groupInInspector || \"\", this.convertToGammaSpace = !!e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.valueType)\n              if (e.valueType === \"number\")\n                this._storedValue = e.value;\n              else {\n                var o = O.a.GetClass(e.valueType);\n                o && (this._storedValue = o.FromArray(e.value));\n              }\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.InputBlock\"] = Et;\n        var zs = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment) || this;\n            return n._samplerName = \"textureSampler\", n.convertToGammaSpace = !1, n.convertToLinearSpace = !1, n._isUnique = !1, n.registerInput(\"uv\", le.Vector2, !1, Ce.VertexAndFragment), n.registerOutput(\"rgba\", le.Color4, Ce.Neutral), n.registerOutput(\"rgb\", le.Color3, Ce.Neutral), n.registerOutput(\"r\", le.Float, Ce.Neutral), n.registerOutput(\"g\", le.Float, Ce.Neutral), n.registerOutput(\"b\", le.Float, Ce.Neutral), n.registerOutput(\"a\", le.Float, Ce.Neutral), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0]._prioritizeVertex = !1, n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"CurrentScreenBlock\";\n          }, Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"textureSampler\");\n          }, Object.defineProperty(t.prototype, \"target\", { get: function() {\n            return this.uv.isConnected ? this.uv.sourceBlock.isInput ? Ce.VertexAndFragment : Ce.Fragment : Ce.VertexAndFragment;\n          }, enumerable: !1, configurable: !0 }), t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(this._linearDefineName, this.convertToGammaSpace, !0), i.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);\n          }, t.prototype.isReady = function() {\n            return !(this.texture && !this.texture.isReadyOrNotBlocking());\n          }, t.prototype._injectVertexCode = function(e) {\n            var n = this.uv;\n            if (n.connectedPoint.ownerBlock.isInput && (n.connectedPoint.ownerBlock.isAttribute || e._emitUniformFromString(n.associatedVariableName, \"vec2\")), this._mainUVName = \"vMain\" + n.associatedVariableName, e._emitVaryingFromString(this._mainUVName, \"vec2\"), e.compilationString += this._mainUVName + \" = \" + n.associatedVariableName + `.xy;\\r\n`, this._outputs.some(function(s) {\n              return s.isConnectedInVertexShader;\n            })) {\n              this._writeTextureRead(e, !0);\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name, !0);\n              }\n            }\n          }, t.prototype._writeTextureRead = function(e, n) {\n            n === void 0 && (n = !1);\n            var i = this.uv;\n            if (n) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n            } else\n              this.uv.ownerBlock.target !== Ce.Fragment ? e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this._mainUVName + `);\\r\n` : e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n          }, t.prototype._writeOutput = function(e, n, i, o) {\n            if (o === void 0 && (o = !1), o) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n            } else\n              this.uv.ownerBlock.target !== Ce.Fragment ? (e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`, e.compilationString += \"#ifdef \" + this._linearDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toGammaSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += \"#ifdef \" + this._gammaDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toLinearSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`) : e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this._tempTextureRead = e._getFreeVariableName(\"tempTextureRead\"), e.sharedData.blockingBlocks.indexOf(this) < 0 && e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.indexOf(this) < 0 && e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.indexOf(this) < 0 && e.sharedData.blocksWithDefines.push(this), e.target !== Ce.Fragment)\n              return e._emit2DSampler(this._samplerName), void this._injectVertexCode(e);\n            if (this._outputs.some(function(s) {\n              return s.isConnectedInFragmentShader;\n            })) {\n              e._emit2DSampler(this._samplerName), this._linearDefineName = e._getFreeDefineName(\"ISLINEAR\"), this._gammaDefineName = e._getFreeDefineName(\"ISGAMMA\");\n              var n = \"//\" + this.name;\n              e._emitFunctionFromInclude(\"helperFunctions\", n), this._writeTextureRead(e);\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name);\n              }\n              return this;\n            }\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this.texture && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.CurrentScreenBlock\"] = zs;\n        var js = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._samplerName = \"diffuseSampler\", n.convertToGammaSpace = !1, n.convertToLinearSpace = !1, n._isUnique = !1, n.registerInput(\"uv\", le.Vector2, !1, Ce.VertexAndFragment), n.registerOutput(\"rgba\", le.Color4, Ce.Neutral), n.registerOutput(\"rgb\", le.Color3, Ce.Neutral), n.registerOutput(\"r\", le.Float, Ce.Neutral), n.registerOutput(\"g\", le.Float, Ce.Neutral), n.registerOutput(\"b\", le.Float, Ce.Neutral), n.registerOutput(\"a\", le.Float, Ce.Neutral), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ParticleTextureBlock\";\n          }, Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"diffuseSampler\");\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.uv.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.isAttribute && i.name === \"particle_uv\";\n              });\n              n || (n = new Et(\"uv\")).setAsAttribute(\"particle_uv\"), n.output.connectTo(this.uv);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(this._linearDefineName, this.convertToGammaSpace, !0), i.setValue(this._gammaDefineName, this.convertToLinearSpace, !0);\n          }, t.prototype.isReady = function() {\n            return !(this.texture && !this.texture.isReadyOrNotBlocking());\n          }, t.prototype._writeOutput = function(e, n, i) {\n            e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`, e.compilationString += \"#ifdef \" + this._linearDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toGammaSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += \"#ifdef \" + this._gammaDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toLinearSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target !== Ce.Vertex) {\n              this._tempTextureRead = e._getFreeVariableName(\"tempTextureRead\"), e._emit2DSampler(this._samplerName), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), this._linearDefineName = e._getFreeDefineName(\"ISLINEAR\"), this._gammaDefineName = e._getFreeDefineName(\"ISGAMMA\");\n              var n = \"//\" + this.name;\n              e._emitFunctionFromInclude(\"helperFunctions\", n), e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this.uv.associatedVariableName + `);\\r\n`;\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name);\n              }\n              return this;\n            }\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, this.texture && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ParticleTextureBlock\"] = js;\n        var Hs = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"color\", le.Color4, !1, Ce.Fragment), n.registerOutput(\"rampColor\", le.Color4, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ParticleRampGradientBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rampColor\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"remapRanges\"), e._excludeVariableName(\"rampSampler\"), e._excludeVariableName(\"baseColor\"), e._excludeVariableName(\"alpha\"), e._excludeVariableName(\"remappedColorIndex\"), e._excludeVariableName(\"rampColor\"), e._excludeVariableName(\"finalAlpha\");\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target !== Ce.Vertex)\n              return e._emit2DSampler(\"rampSampler\"), e._emitVaryingFromString(\"remapRanges\", \"vec4\", \"RAMPGRADIENT\"), e.compilationString += `\n            #ifdef RAMPGRADIENT\n                vec4 baseColor = ` + this.color.associatedVariableName + `;\n                float alpha = ` + this.color.associatedVariableName + `.a;\n\n                float remappedColorIndex = clamp((alpha - remapRanges.x) / remapRanges.y, 0.0, 1.0);\n\n                vec4 rampColor = texture2D(rampSampler, vec2(1.0 - remappedColorIndex, 0.));\n                baseColor.rgb *= rampColor.rgb;\n\n                // Remapped alpha\n                float finalAlpha = baseColor.a;\n                baseColor.a = clamp((alpha * rampColor.a - remapRanges.z) / remapRanges.w, 0.0, 1.0);\n\n                ` + this._declareOutput(this.rampColor, e) + ` = baseColor;\n            #else\n                ` + this._declareOutput(this.rampColor, e) + \" = \" + this.color.associatedVariableName + `;\n            #endif\n        `, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ParticleRampGradientBlock\"] = Hs;\n        var Ws = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"color\", le.Color4, !1, Ce.Fragment), n.registerInput(\"alphaTexture\", le.Float, !1, Ce.Fragment), n.registerInput(\"alphaColor\", le.Float, !1, Ce.Fragment), n.registerOutput(\"blendColor\", le.Color4, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ParticleBlendMultiplyBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"alphaTexture\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"alphaColor\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blendColor\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"sourceAlpha\");\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target !== Ce.Vertex)\n              return e.compilationString += `\n            #ifdef BLENDMULTIPLYMODE\n                ` + this._declareOutput(this.blendColor, e) + `;\n                float sourceAlpha = ` + this.alphaColor.associatedVariableName + \" * \" + this.alphaTexture.associatedVariableName + `;\n                ` + this.blendColor.associatedVariableName + \".rgb = \" + this.color.associatedVariableName + `.rgb * sourceAlpha + vec3(1.0) * (1.0 - sourceAlpha);\n                ` + this.blendColor.associatedVariableName + \".a = \" + this.color.associatedVariableName + `.a;\n            #else\n                ` + this._declareOutput(this.blendColor, e) + \" = \" + this.color.associatedVariableName + `;\n            #endif\n        `, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ParticleBlendMultiplyBlock\"] = Ws;\n        var It, so = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"xyz \", le.Vector3, !0), n.registerInput(\"xy \", le.Vector2, !0), n.registerInput(\"x\", le.Float, !0), n.registerInput(\"y\", le.Float, !0), n.registerInput(\"z\", le.Float, !0), n.registerInput(\"w\", le.Float, !0), n.registerOutput(\"xyzw\", le.Vector4), n.registerOutput(\"xyz\", le.Vector3), n.registerOutput(\"xy\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VectorMergerBlock\";\n          }, Object.defineProperty(t.prototype, \"xyzIn\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyIn\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"z\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"w\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzw\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzOut\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyOut\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xy\", { get: function() {\n            return this.xyOut;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyz\", { get: function() {\n            return this.xyzOut;\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.x, i = this.y, o = this.z, a = this.w, s = this.xyIn, d = this.xyzIn, p = this._outputs[0], y = this._outputs[1], P = this._outputs[2];\n            return d.isConnected ? p.hasEndpoints ? e.compilationString += this._declareOutput(p, e) + \" = vec4(\" + d.associatedVariableName + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : y.hasEndpoints ? e.compilationString += this._declareOutput(y, e) + \" = \" + d.associatedVariableName + `;\\r\n` : P.hasEndpoints && (e.compilationString += this._declareOutput(P, e) + \" = \" + d.associatedVariableName + `.xy;\\r\n`) : s.isConnected ? p.hasEndpoints ? e.compilationString += this._declareOutput(p, e) + \" = vec4(\" + s.associatedVariableName + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : y.hasEndpoints ? e.compilationString += this._declareOutput(y, e) + \" = vec3(\" + s.associatedVariableName + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + `);\\r\n` : P.hasEndpoints && (e.compilationString += this._declareOutput(P, e) + \" = \" + s.associatedVariableName + `;\\r\n`) : p.hasEndpoints ? e.compilationString += this._declareOutput(p, e) + \" = vec4(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : y.hasEndpoints ? e.compilationString += this._declareOutput(y, e) + \" = vec3(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + `);\\r\n` : P.hasEndpoints && (e.compilationString += this._declareOutput(P, e) + \" = vec2(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + `);\\r\n`), this;\n          }, t;\n        }(dt);\n        function Bt(r, t, e, n) {\n          return t === void 0 && (t = It.Boolean), e === void 0 && (e = \"PROPERTIES\"), function(i, o) {\n            var a = i._propStore;\n            a || (a = [], i._propStore = a), a.push({ propertyName: o, displayName: r, type: t, groupName: e, options: n ?? {} });\n          };\n        }\n        O.a.RegisteredTypes[\"BABYLON.VectorMergerBlock\"] = so, function(r) {\n          r[r.Boolean = 0] = \"Boolean\", r[r.Float = 1] = \"Float\", r[r.Vector2 = 2] = \"Vector2\", r[r.List = 3] = \"List\";\n        }(It || (It = {}));\n        var Xs = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.sourceRange = new u.d(-1, 1), n.targetRange = new u.d(0, 1), n.registerInput(\"input\", le.AutoDetect), n.registerInput(\"sourceMin\", le.Float, !0), n.registerInput(\"sourceMax\", le.Float, !0), n.registerInput(\"targetMin\", le.Float, !0), n.registerInput(\"targetMax\", le.Float, !0), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RemapBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sourceMin\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sourceMax\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"targetMin\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"targetMax\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this.sourceMin.isConnected ? this.sourceMin.associatedVariableName : this._writeFloat(this.sourceRange.x), o = this.sourceMax.isConnected ? this.sourceMax.associatedVariableName : this._writeFloat(this.sourceRange.y), a = this.targetMin.isConnected ? this.targetMin.associatedVariableName : this._writeFloat(this.targetRange.x), s = this.targetMax.isConnected ? this.targetMax.associatedVariableName : this._writeFloat(this.targetRange.y);\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + a + \" + (\" + this._inputs[0].associatedVariableName + \" - \" + i + \") * (\" + s + \" - \" + a + \") / (\" + o + \" - \" + i + `);\\r\n`, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".sourceRange = new BABYLON.Vector2(\" + this.sourceRange.x + \", \" + this.sourceRange.y + `);\\r\n`;\n            return e += this._codeVariableName + \".targetRange = new BABYLON.Vector2(\" + this.targetRange.x + \", \" + this.targetRange.y + `);\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.sourceRange = this.sourceRange.asArray(), e.targetRange = this.targetRange.asArray(), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.sourceRange = u.d.FromArray(e.sourceRange), this.targetRange = u.d.FromArray(e.targetRange);\n          }, Object(c.c)([Bt(\"From\", It.Vector2)], t.prototype, \"sourceRange\", void 0), Object(c.c)([Bt(\"To\", It.Vector2)], t.prototype, \"targetRange\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RemapBlock\"] = Xs;\n        var ra = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MultiplyBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" * \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MultiplyBlock\"] = ra;\n        var xr = function() {\n          function r() {\n            this.direction1 = new u.e(0, 1, 0), this.direction2 = new u.e(0, 1, 0), this.minEmitBox = new u.e(-0.5, -0.5, -0.5), this.maxEmitBox = new u.e(0.5, 0.5, 0.5);\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            if (i)\n              return e.x = o, e.y = a, void (e.z = s);\n            u.e.TransformNormalFromFloatsToRef(o, a, s, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(this.minEmitBox.x, this.maxEmitBox.x), a = $.a.RandomRange(this.minEmitBox.y, this.maxEmitBox.y), s = $.a.RandomRange(this.minEmitBox.z, this.maxEmitBox.z);\n            if (i)\n              return e.x = o, e.y = a, void (e.z = s);\n            u.e.TransformCoordinatesFromFloatsToRef(o, a, s, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setVector3(\"direction1\", this.direction1), t.setVector3(\"direction2\", this.direction2), t.setVector3(\"minEmitBox\", this.minEmitBox), t.setVector3(\"maxEmitBox\", this.maxEmitBox);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define BOXEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"BoxParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t.minEmitBox = this.minEmitBox.asArray(), t.maxEmitBox = this.maxEmitBox.asArray(), t;\n          }, r.prototype.parse = function(t) {\n            u.e.FromArrayToRef(t.direction1, 0, this.direction1), u.e.FromArrayToRef(t.direction2, 0, this.direction2), u.e.FromArrayToRef(t.minEmitBox, 0, this.minEmitBox), u.e.FromArrayToRef(t.maxEmitBox, 0, this.maxEmitBox);\n          }, r;\n        }(), Ys = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = Math.PI), n === void 0 && (n = 0), this.directionRandomizer = n, this.radiusRange = 1, this.heightRange = 1, this.emitFromSpawnPointOnly = !1, this.angle = e, this.radius = t;\n          }\n          return Object.defineProperty(r.prototype, \"radius\", { get: function() {\n            return this._radius;\n          }, set: function(t) {\n            this._radius = t, this._buildHeight();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"angle\", { get: function() {\n            return this._angle;\n          }, set: function(t) {\n            this._angle = t, this._buildHeight();\n          }, enumerable: !1, configurable: !0 }), r.prototype._buildHeight = function() {\n            this._angle !== 0 ? this._height = this._radius / Math.tan(this._angle / 2) : this._height = 1;\n          }, r.prototype.startDirectionFunction = function(t, e, n, i) {\n            i ? u.c.Vector3[0].copyFrom(n._localPosition).normalize() : n.position.subtractToRef(t.getTranslation(), u.c.Vector3[0]).normalize();\n            var o = $.a.RandomRange(0, this.directionRandomizer), a = $.a.RandomRange(0, this.directionRandomizer), s = $.a.RandomRange(0, this.directionRandomizer);\n            e.x = u.c.Vector3[0].x + o, e.y = u.c.Vector3[0].y + a, e.z = u.c.Vector3[0].z + s, e.normalize();\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o, a = $.a.RandomRange(0, 2 * Math.PI);\n            o = this.emitFromSpawnPointOnly ? 1e-4 : 1 - (o = $.a.RandomRange(0, this.heightRange)) * o;\n            var s = this._radius - $.a.RandomRange(0, this._radius * this.radiusRange), d = (s *= o) * Math.sin(a), p = s * Math.cos(a), y = o * this._height;\n            if (i)\n              return e.x = d, e.y = y, void (e.z = p);\n            u.e.TransformCoordinatesFromFloatsToRef(d, y, p, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this._radius, this._angle, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat2(\"radius\", this._radius, this.radiusRange), t.setFloat(\"coneAngle\", this._angle), t.setFloat2(\"height\", this._height, this.heightRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            var t = \"#define CONEEMITTER\";\n            return this.emitFromSpawnPointOnly && (t += `\n#define CONEEMITTERSPAWNPOINT`), t;\n          }, r.prototype.getClassName = function() {\n            return \"ConeParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this._radius, t.angle = this._angle, t.directionRandomizer = this.directionRandomizer, t.radiusRange = this.radiusRange, t.heightRange = this.heightRange, t.emitFromSpawnPointOnly = this.emitFromSpawnPointOnly, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.angle = t.angle, this.directionRandomizer = t.directionRandomizer, this.radiusRange = t.radiusRange !== void 0 ? t.radiusRange : 1, this.heightRange = t.radiusRange !== void 0 ? t.heightRange : 1, this.emitFromSpawnPointOnly = t.emitFromSpawnPointOnly !== void 0 && t.emitFromSpawnPointOnly;\n          }, r;\n        }(), oa = function() {\n          function r(t, e, n, i) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = 0), this.radius = t, this.height = e, this.radiusRange = n, this.directionRandomizer = i;\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = n.position.subtract(t.getTranslation()).normalize(), a = $.a.RandomRange(-this.directionRandomizer / 2, this.directionRandomizer / 2), s = Math.atan2(o.x, o.z);\n            s += $.a.RandomRange(-Math.PI / 2, Math.PI / 2) * this.directionRandomizer, o.y = a, o.x = Math.sin(s), o.z = Math.cos(s), o.normalize(), i ? e.copyFrom(o) : u.e.TransformNormalFromFloatsToRef(o.x, o.y, o.z, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(-this.height / 2, this.height / 2), a = $.a.RandomRange(0, 2 * Math.PI), s = $.a.RandomRange((1 - this.radiusRange) * (1 - this.radiusRange), 1), d = Math.sqrt(s) * this.radius, p = d * Math.cos(a), y = d * Math.sin(a);\n            i ? e.copyFromFloats(p, o, y) : u.e.TransformCoordinatesFromFloatsToRef(p, o, y, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this.radius, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat(\"radius\", this.radius), t.setFloat(\"height\", this.height), t.setFloat(\"radiusRange\", this.radiusRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define CYLINDEREMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"CylinderParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this.radius, t.height = this.height, t.radiusRange = this.radiusRange, t.directionRandomizer = this.directionRandomizer, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.height = t.height, this.radiusRange = t.radiusRange, this.directionRandomizer = t.directionRandomizer;\n          }, r;\n        }(), Ks = function(r) {\n          function t(e, n, i, o, a) {\n            e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = 1), o === void 0 && (o = new u.e(0, 1, 0)), a === void 0 && (a = new u.e(0, 1, 0));\n            var s = r.call(this, e, n, i) || this;\n            return s.direction1 = o, s.direction2 = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.startDirectionFunction = function(e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            u.e.TransformNormalFromFloatsToRef(o, a, s, e, n);\n          }, t.prototype.clone = function() {\n            var e = new t(this.radius, this.height, this.radiusRange, this.direction1, this.direction2);\n            return de.a.DeepCopy(this, e), e;\n          }, t.prototype.applyToShader = function(e) {\n            e.setFloat(\"radius\", this.radius), e.setFloat(\"height\", this.height), e.setFloat(\"radiusRange\", this.radiusRange), e.setVector3(\"direction1\", this.direction1), e.setVector3(\"direction2\", this.direction2);\n          }, t.prototype.getEffectDefines = function() {\n            return `#define CYLINDEREMITTER\n#define DIRECTEDCYLINDEREMITTER`;\n          }, t.prototype.getClassName = function() {\n            return \"CylinderDirectedParticleEmitter\";\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;\n          }, t.prototype.parse = function(e) {\n            r.prototype.parse.call(this, e), this.direction1.copyFrom(e.direction1), this.direction2.copyFrom(e.direction2);\n          }, t;\n        }(oa), Qs = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 0), this.radius = t, this.radiusRange = e, this.directionRandomizer = n;\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = n.position.subtract(t.getTranslation()).normalize(), a = $.a.RandomRange(0, this.directionRandomizer), s = $.a.RandomRange(0, this.directionRandomizer), d = $.a.RandomRange(0, this.directionRandomizer);\n            o.x += a, o.y += s, o.z += d, o.normalize(), i ? e.copyFrom(o) : u.e.TransformNormalFromFloatsToRef(o.x, o.y, o.z, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = this.radius - $.a.RandomRange(0, this.radius * this.radiusRange), a = $.a.RandomRange(0, 1), s = $.a.RandomRange(0, 2 * Math.PI), d = Math.acos(2 * a - 1), p = o * Math.cos(s) * Math.sin(d), y = o * Math.cos(d), P = o * Math.sin(s) * Math.sin(d);\n            i ? e.copyFromFloats(p, Math.abs(y), P) : u.e.TransformCoordinatesFromFloatsToRef(p, Math.abs(y), P, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this.radius, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat(\"radius\", this.radius), t.setFloat(\"radiusRange\", this.radiusRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define HEMISPHERICEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"HemisphericParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this.radius, t.radiusRange = this.radiusRange, t.directionRandomizer = this.directionRandomizer, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.radiusRange = t.radiusRange, this.directionRandomizer = t.directionRandomizer;\n          }, r;\n        }(), qs = function() {\n          function r() {\n            this.direction1 = new u.e(0, 1, 0), this.direction2 = new u.e(0, 1, 0);\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            i ? e.copyFromFloats(o, a, s) : u.e.TransformNormalFromFloatsToRef(o, a, s, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            i ? e.copyFromFloats(0, 0, 0) : u.e.TransformCoordinatesFromFloatsToRef(0, 0, 0, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setVector3(\"direction1\", this.direction1), t.setVector3(\"direction2\", this.direction2);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define POINTEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"PointParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.direction1 = this.direction1.asArray(), t.direction2 = this.direction2.asArray(), t;\n          }, r.prototype.parse = function(t) {\n            u.e.FromArrayToRef(t.direction1, 0, this.direction1), u.e.FromArrayToRef(t.direction2, 0, this.direction2);\n          }, r;\n        }(), aa = function() {\n          function r(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 0), this.radius = t, this.radiusRange = e, this.directionRandomizer = n;\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = n.position.subtract(t.getTranslation()).normalize(), a = $.a.RandomRange(0, this.directionRandomizer), s = $.a.RandomRange(0, this.directionRandomizer), d = $.a.RandomRange(0, this.directionRandomizer);\n            o.x += a, o.y += s, o.z += d, o.normalize(), i ? e.copyFrom(o) : u.e.TransformNormalFromFloatsToRef(o.x, o.y, o.z, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = this.radius - $.a.RandomRange(0, this.radius * this.radiusRange), a = $.a.RandomRange(0, 1), s = $.a.RandomRange(0, 2 * Math.PI), d = Math.acos(2 * a - 1), p = o * Math.cos(s) * Math.sin(d), y = o * Math.cos(d), P = o * Math.sin(s) * Math.sin(d);\n            i ? e.copyFromFloats(p, y, P) : u.e.TransformCoordinatesFromFloatsToRef(p, y, P, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r(this.radius, this.directionRandomizer);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setFloat(\"radius\", this.radius), t.setFloat(\"radiusRange\", this.radiusRange), t.setFloat(\"directionRandomizer\", this.directionRandomizer);\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define SPHEREEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"SphereParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t.radius = this.radius, t.radiusRange = this.radiusRange, t.directionRandomizer = this.directionRandomizer, t;\n          }, r.prototype.parse = function(t) {\n            this.radius = t.radius, this.radiusRange = t.radiusRange, this.directionRandomizer = t.directionRandomizer;\n          }, r;\n        }(), Zs = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = 1), n === void 0 && (n = new u.e(0, 1, 0)), i === void 0 && (i = new u.e(0, 1, 0));\n            var o = r.call(this, e) || this;\n            return o.direction1 = n, o.direction2 = i, o;\n          }\n          return Object(c.d)(t, r), t.prototype.startDirectionFunction = function(e, n, i) {\n            var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n            u.e.TransformNormalFromFloatsToRef(o, a, s, e, n);\n          }, t.prototype.clone = function() {\n            var e = new t(this.radius, this.direction1, this.direction2);\n            return de.a.DeepCopy(this, e), e;\n          }, t.prototype.applyToShader = function(e) {\n            e.setFloat(\"radius\", this.radius), e.setFloat(\"radiusRange\", this.radiusRange), e.setVector3(\"direction1\", this.direction1), e.setVector3(\"direction2\", this.direction2);\n          }, t.prototype.getEffectDefines = function() {\n            return `#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER`;\n          }, t.prototype.getClassName = function() {\n            return \"SphereDirectedParticleEmitter\";\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e;\n          }, t.prototype.parse = function(e) {\n            r.prototype.parse.call(this, e), this.direction1.copyFrom(e.direction1), this.direction2.copyFrom(e.direction2);\n          }, t;\n        }(aa), Cr = function() {\n          function r() {\n            this.particlePositionGenerator = function() {\n            }, this.particleDestinationGenerator = function() {\n            };\n          }\n          return r.prototype.startDirectionFunction = function(t, e, n, i) {\n            var o = u.c.Vector3[0];\n            if (this.particleDestinationGenerator) {\n              this.particleDestinationGenerator(-1, n, o);\n              var a = u.c.Vector3[1];\n              o.subtractToRef(n.position, a), a.scaleToRef(1 / n.lifeTime, o);\n            } else\n              o.set(0, 0, 0);\n            i ? e.copyFrom(o) : u.e.TransformNormalToRef(o, t, e);\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            var o = u.c.Vector3[0];\n            this.particlePositionGenerator ? this.particlePositionGenerator(-1, n, o) : o.set(0, 0, 0), i ? e.copyFrom(o) : u.e.TransformCoordinatesToRef(o, t, e);\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n          }, r.prototype.getEffectDefines = function() {\n            return \"#define CUSTOMEMITTER\";\n          }, r.prototype.getClassName = function() {\n            return \"CustomParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.getClassName(), t;\n          }, r.prototype.parse = function(t) {\n          }, r;\n        }(), Ku = function() {\n          function r(t) {\n            t === void 0 && (t = null), this._indices = null, this._positions = null, this._normals = null, this._storedNormal = u.e.Zero(), this._mesh = null, this.direction1 = new u.e(0, 1, 0), this.direction2 = new u.e(0, 1, 0), this.useMeshNormalsForDirection = !0, this.mesh = t;\n          }\n          return Object.defineProperty(r.prototype, \"mesh\", { get: function() {\n            return this._mesh;\n          }, set: function(t) {\n            this._mesh !== t && (this._mesh = t, t ? (this._indices = t.getIndices(), this._positions = t.getVerticesData(Oe.b.PositionKind), this._normals = t.getVerticesData(Oe.b.NormalKind)) : (this._indices = null, this._positions = null, this._normals = null));\n          }, enumerable: !1, configurable: !0 }), r.prototype.startDirectionFunction = function(t, e, n, i) {\n            if (this.useMeshNormalsForDirection && this._normals)\n              u.e.TransformNormalToRef(this._storedNormal, t, e);\n            else {\n              var o = $.a.RandomRange(this.direction1.x, this.direction2.x), a = $.a.RandomRange(this.direction1.y, this.direction2.y), s = $.a.RandomRange(this.direction1.z, this.direction2.z);\n              i ? e.copyFromFloats(o, a, s) : u.e.TransformNormalFromFloatsToRef(o, a, s, t, e);\n            }\n          }, r.prototype.startPositionFunction = function(t, e, n, i) {\n            if (this._indices && this._positions) {\n              var o = 3 * Math.random() * (this._indices.length / 3) | 0, a = Math.random(), s = Math.random() * (1 - a), d = 1 - a - s, p = this._indices[o], y = this._indices[o + 1], P = this._indices[o + 2], R = u.c.Vector3[0], B = u.c.Vector3[1], F = u.c.Vector3[2], z = u.c.Vector3[3];\n              u.e.FromArrayToRef(this._positions, 3 * p, R), u.e.FromArrayToRef(this._positions, 3 * y, B), u.e.FromArrayToRef(this._positions, 3 * P, F), z.x = a * R.x + s * B.x + d * F.x, z.y = a * R.y + s * B.y + d * F.y, z.z = a * R.z + s * B.z + d * F.z, i ? e.copyFromFloats(z.x, z.y, z.z) : u.e.TransformCoordinatesFromFloatsToRef(z.x, z.y, z.z, t, e), this.useMeshNormalsForDirection && this._normals && (u.e.FromArrayToRef(this._normals, 3 * p, R), u.e.FromArrayToRef(this._normals, 3 * y, B), u.e.FromArrayToRef(this._normals, 3 * P, F), this._storedNormal.x = a * R.x + s * B.x + d * F.x, this._storedNormal.y = a * R.y + s * B.y + d * F.y, this._storedNormal.z = a * R.z + s * B.z + d * F.z);\n            }\n          }, r.prototype.clone = function() {\n            var t = new r(this.mesh);\n            return de.a.DeepCopy(this, t), t;\n          }, r.prototype.applyToShader = function(t) {\n            t.setVector3(\"direction1\", this.direction1), t.setVector3(\"direction2\", this.direction2);\n          }, r.prototype.getEffectDefines = function() {\n            return \"\";\n          }, r.prototype.getClassName = function() {\n            return \"MeshParticleEmitter\";\n          }, r.prototype.serialize = function() {\n            var t, e = {};\n            return e.type = this.getClassName(), e.direction1 = this.direction1.asArray(), e.direction2 = this.direction2.asArray(), e.meshId = (t = this.mesh) === null || t === void 0 ? void 0 : t.id, e.useMeshNormalsForDirection = this.useMeshNormalsForDirection, e;\n          }, r.prototype.parse = function(t, e) {\n            u.e.FromArrayToRef(t.direction1, 0, this.direction1), u.e.FromArrayToRef(t.direction2, 0, this.direction2), t.meshId && e && (this.mesh = e.getLastMeshByID(t.meshId)), this.useMeshNormalsForDirection = t.useMeshNormalsForDirection;\n          }, r;\n        }(), co = function() {\n          function r(t) {\n            this.animations = [], this.renderingGroupId = 0, this.emitter = u.e.Zero(), this.emitRate = 10, this.manualEmitCount = -1, this.updateSpeed = 0.01, this.targetStopDuration = 0, this.disposeOnStop = !1, this.minEmitPower = 1, this.maxEmitPower = 1, this.minLifeTime = 1, this.maxLifeTime = 1, this.minSize = 1, this.maxSize = 1, this.minScaleX = 1, this.maxScaleX = 1, this.minScaleY = 1, this.maxScaleY = 1, this.minInitialRotation = 0, this.maxInitialRotation = 0, this.minAngularSpeed = 0, this.maxAngularSpeed = 0, this.layerMask = 268435455, this.customShader = null, this.preventAutoStart = !1, this.noiseStrength = new u.e(10, 10, 10), this.onAnimationEnd = null, this.blendMode = r.BLENDMODE_ONEONE, this.forceDepthWrite = !1, this.preWarmCycles = 0, this.preWarmStepOffset = 1, this.spriteCellChangeSpeed = 1, this.startSpriteCellID = 0, this.endSpriteCellID = 0, this.spriteCellWidth = 0, this.spriteCellHeight = 0, this.spriteRandomStartCell = !1, this.translationPivot = new u.d(0, 0), this.beginAnimationOnStart = !1, this.beginAnimationFrom = 0, this.beginAnimationTo = 60, this.beginAnimationLoop = !1, this.worldOffset = new u.e(0, 0, 0), this.gravity = u.e.Zero(), this._colorGradients = null, this._sizeGradients = null, this._lifeTimeGradients = null, this._angularSpeedGradients = null, this._velocityGradients = null, this._limitVelocityGradients = null, this._dragGradients = null, this._emitRateGradients = null, this._startSizeGradients = null, this._rampGradients = null, this._colorRemapGradients = null, this._alphaRemapGradients = null, this.startDelay = 0, this.limitVelocityDamping = 0.4, this.color1 = new I.b(1, 1, 1, 1), this.color2 = new I.b(1, 1, 1, 1), this.colorDead = new I.b(0, 0, 0, 1), this.textureMask = new I.b(1, 1, 1, 1), this._isSubEmitter = !1, this.billboardMode = h.a.PARTICLES_BILLBOARDMODE_ALL, this._isBillboardBased = !0, this._imageProcessingConfigurationDefines = new vn.b(), this.id = t, this.name = t;\n          }\n          return Object.defineProperty(r.prototype, \"noiseTexture\", { get: function() {\n            return this._noiseTexture;\n          }, set: function(t) {\n            this._noiseTexture !== t && (this._noiseTexture = t, this._reset());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isAnimationSheetEnabled\", { get: function() {\n            return this._isAnimationSheetEnabled;\n          }, set: function(t) {\n            this._isAnimationSheetEnabled != t && (this._isAnimationSheetEnabled = t, this._reset());\n          }, enumerable: !1, configurable: !0 }), r.prototype.getScene = function() {\n            return this._scene;\n          }, r.prototype._hasTargetStopDurationDependantGradient = function() {\n            return this._startSizeGradients && this._startSizeGradients.length > 0 || this._emitRateGradients && this._emitRateGradients.length > 0 || this._lifeTimeGradients && this._lifeTimeGradients.length > 0;\n          }, r.prototype.getDragGradients = function() {\n            return this._dragGradients;\n          }, r.prototype.getLimitVelocityGradients = function() {\n            return this._limitVelocityGradients;\n          }, r.prototype.getColorGradients = function() {\n            return this._colorGradients;\n          }, r.prototype.getSizeGradients = function() {\n            return this._sizeGradients;\n          }, r.prototype.getColorRemapGradients = function() {\n            return this._colorRemapGradients;\n          }, r.prototype.getAlphaRemapGradients = function() {\n            return this._alphaRemapGradients;\n          }, r.prototype.getLifeTimeGradients = function() {\n            return this._lifeTimeGradients;\n          }, r.prototype.getAngularSpeedGradients = function() {\n            return this._angularSpeedGradients;\n          }, r.prototype.getVelocityGradients = function() {\n            return this._velocityGradients;\n          }, r.prototype.getStartSizeGradients = function() {\n            return this._startSizeGradients;\n          }, r.prototype.getEmitRateGradients = function() {\n            return this._emitRateGradients;\n          }, Object.defineProperty(r.prototype, \"direction1\", { get: function() {\n            return this.particleEmitterType.direction1 ? this.particleEmitterType.direction1 : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.direction1 && (this.particleEmitterType.direction1 = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"direction2\", { get: function() {\n            return this.particleEmitterType.direction2 ? this.particleEmitterType.direction2 : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.direction2 && (this.particleEmitterType.direction2 = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"minEmitBox\", { get: function() {\n            return this.particleEmitterType.minEmitBox ? this.particleEmitterType.minEmitBox : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.minEmitBox && (this.particleEmitterType.minEmitBox = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"maxEmitBox\", { get: function() {\n            return this.particleEmitterType.maxEmitBox ? this.particleEmitterType.maxEmitBox : u.e.Zero();\n          }, set: function(t) {\n            this.particleEmitterType.maxEmitBox && (this.particleEmitterType.maxEmitBox = t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isBillboardBased\", { get: function() {\n            return this._isBillboardBased;\n          }, set: function(t) {\n            this._isBillboardBased !== t && (this._isBillboardBased = t, this._reset());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(t) {\n            this._attachImageProcessingConfiguration(t);\n          }, enumerable: !1, configurable: !0 }), r.prototype._attachImageProcessingConfiguration = function(t) {\n            t !== this._imageProcessingConfiguration && (!t && this._scene ? this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration : this._imageProcessingConfiguration = t);\n          }, r.prototype._reset = function() {\n          }, r.prototype._removeGradientAndTexture = function(t, e, n) {\n            if (!e)\n              return this;\n            for (var i = 0, o = 0, a = e; o < a.length; o++) {\n              if (a[o].gradient === t) {\n                e.splice(i, 1);\n                break;\n              }\n              i++;\n            }\n            return n && n.dispose(), this;\n          }, r.prototype.createPointEmitter = function(t, e) {\n            var n = new qs();\n            return n.direction1 = t, n.direction2 = e, this.particleEmitterType = n, n;\n          }, r.prototype.createHemisphericEmitter = function(t, e) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1);\n            var n = new Qs(t, e);\n            return this.particleEmitterType = n, n;\n          }, r.prototype.createSphereEmitter = function(t, e) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1);\n            var n = new aa(t, e);\n            return this.particleEmitterType = n, n;\n          }, r.prototype.createDirectedSphereEmitter = function(t, e, n) {\n            t === void 0 && (t = 1), e === void 0 && (e = new u.e(0, 1, 0)), n === void 0 && (n = new u.e(0, 1, 0));\n            var i = new Zs(t, e, n);\n            return this.particleEmitterType = i, i;\n          }, r.prototype.createCylinderEmitter = function(t, e, n, i) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = 0);\n            var o = new oa(t, e, n, i);\n            return this.particleEmitterType = o, o;\n          }, r.prototype.createDirectedCylinderEmitter = function(t, e, n, i, o) {\n            t === void 0 && (t = 1), e === void 0 && (e = 1), n === void 0 && (n = 1), i === void 0 && (i = new u.e(0, 1, 0)), o === void 0 && (o = new u.e(0, 1, 0));\n            var a = new Ks(t, e, n, i, o);\n            return this.particleEmitterType = a, a;\n          }, r.prototype.createConeEmitter = function(t, e) {\n            t === void 0 && (t = 1), e === void 0 && (e = Math.PI / 4);\n            var n = new Ys(t, e);\n            return this.particleEmitterType = n, n;\n          }, r.prototype.createBoxEmitter = function(t, e, n, i) {\n            var o = new xr();\n            return this.particleEmitterType = o, this.direction1 = t, this.direction2 = e, this.minEmitBox = n, this.maxEmitBox = i, o;\n          }, r.BLENDMODE_ONEONE = 0, r.BLENDMODE_STANDARD = 1, r.BLENDMODE_ADD = 2, r.BLENDMODE_MULTIPLY = 3, r.BLENDMODE_MULTIPLYADD = 4, r;\n        }(), Js = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"rgba\", le.Color4, !0), n.registerInput(\"rgb \", le.Color3, !0), n.registerOutput(\"rgb\", le.Color3), n.registerOutput(\"r\", le.Float), n.registerOutput(\"g\", le.Float), n.registerOutput(\"b\", le.Float), n.registerOutput(\"a\", le.Float), n.inputsAreExclusive = !0, n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ColorSplitterBlock\";\n          }, Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgbIn\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgbOut\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), t.prototype._inputRename = function(e) {\n            return e === \"rgb \" ? \"rgbIn\" : e;\n          }, t.prototype._outputRename = function(e) {\n            return e === \"rgb\" ? \"rgbOut\" : e;\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.rgba.isConnected ? this.rgba : this.rgbIn;\n            if (n.isConnected) {\n              var i = this._outputs[0], o = this._outputs[1], a = this._outputs[2], s = this._outputs[3], d = this._outputs[4];\n              return i.hasEndpoints && (e.compilationString += this._declareOutput(i, e) + \" = \" + n.associatedVariableName + `.rgb;\\r\n`), o.hasEndpoints && (e.compilationString += this._declareOutput(o, e) + \" = \" + n.associatedVariableName + `.r;\\r\n`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + \" = \" + n.associatedVariableName + `.g;\\r\n`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + \" = \" + n.associatedVariableName + `.b;\\r\n`), d.hasEndpoints && (e.compilationString += this._declareOutput(d, e) + \" = \" + n.associatedVariableName + `.a;\\r\n`), this;\n            }\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ColorSplitterBlock\"] = Js;\n        var tn, Qu = f(104);\n        (function(r) {\n          r[r.Cos = 0] = \"Cos\", r[r.Sin = 1] = \"Sin\", r[r.Abs = 2] = \"Abs\", r[r.Exp = 3] = \"Exp\", r[r.Exp2 = 4] = \"Exp2\", r[r.Round = 5] = \"Round\", r[r.Floor = 6] = \"Floor\", r[r.Ceiling = 7] = \"Ceiling\", r[r.Sqrt = 8] = \"Sqrt\", r[r.Log = 9] = \"Log\", r[r.Tan = 10] = \"Tan\", r[r.ArcTan = 11] = \"ArcTan\", r[r.ArcCos = 12] = \"ArcCos\", r[r.ArcSin = 13] = \"ArcSin\", r[r.Fract = 14] = \"Fract\", r[r.Sign = 15] = \"Sign\", r[r.Radians = 16] = \"Radians\", r[r.Degrees = 17] = \"Degrees\";\n        })(tn || (tn = {}));\n        var $s = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.operation = tn.Cos, n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TrigonometryBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = \"\";\n            switch (this.operation) {\n              case tn.Cos:\n                i = \"cos\";\n                break;\n              case tn.Sin:\n                i = \"sin\";\n                break;\n              case tn.Abs:\n                i = \"abs\";\n                break;\n              case tn.Exp:\n                i = \"exp\";\n                break;\n              case tn.Exp2:\n                i = \"exp2\";\n                break;\n              case tn.Round:\n                i = \"round\";\n                break;\n              case tn.Floor:\n                i = \"floor\";\n                break;\n              case tn.Ceiling:\n                i = \"ceil\";\n                break;\n              case tn.Sqrt:\n                i = \"sqrt\";\n                break;\n              case tn.Log:\n                i = \"log\";\n                break;\n              case tn.Tan:\n                i = \"tan\";\n                break;\n              case tn.ArcTan:\n                i = \"atan\";\n                break;\n              case tn.ArcCos:\n                i = \"acos\";\n                break;\n              case tn.ArcSin:\n                i = \"asin\";\n                break;\n              case tn.Fract:\n                i = \"fract\";\n                break;\n              case tn.Sign:\n                i = \"sign\";\n                break;\n              case tn.Radians:\n                i = \"radians\";\n                break;\n              case tn.Degrees:\n                i = \"degrees\";\n            }\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + i + \"(\" + this.input.associatedVariableName + `);\\r\n`, this;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.operation = this.operation, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.operation = e.operation;\n          }, t.prototype._dumpPropertiesCode = function() {\n            return this._codeVariableName + \".operation = BABYLON.TrigonometryBlockOperations.\" + tn[this.operation] + `;\\r\n`;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.TrigonometryBlock\"] = $s;\n        var ec = { effect: null, subMesh: null }, lo = function(r) {\n          function t() {\n            var e = r.call(this) || this;\n            return e.NORMAL = !1, e.TANGENT = !1, e.UV1 = !1, e.NUM_BONE_INFLUENCERS = 0, e.BonesPerMesh = 0, e.BONETEXTURE = !1, e.MORPHTARGETS = !1, e.MORPHTARGETS_NORMAL = !1, e.MORPHTARGETS_TANGENT = !1, e.MORPHTARGETS_UV = !1, e.NUM_MORPH_INFLUENCERS = 0, e.IMAGEPROCESSING = !1, e.VIGNETTE = !1, e.VIGNETTEBLENDMODEMULTIPLY = !1, e.VIGNETTEBLENDMODEOPAQUE = !1, e.TONEMAPPING = !1, e.TONEMAPPING_ACES = !1, e.CONTRAST = !1, e.EXPOSURE = !1, e.COLORCURVES = !1, e.COLORGRADING = !1, e.COLORGRADING3D = !1, e.SAMPLER3DGREENDEPTH = !1, e.SAMPLER3DBGRMAP = !1, e.IMAGEPROCESSINGPOSTPROCESS = !1, e.BUMPDIRECTUV = 0, e.rebuild(), e;\n          }\n          return Object(c.d)(t, r), t.prototype.setValue = function(e, n, i) {\n            i === void 0 && (i = !1), this[e] === void 0 && this._keys.push(e), i && this[e] !== n && this.markAsUnprocessed(), this[e] = n;\n          }, t;\n        }(zo.a), sa = function(r) {\n          function t(e, n, i) {\n            i === void 0 && (i = {});\n            var o = r.call(this, e, n || Ue.a.LastCreatedScene) || this;\n            return o._buildId = t._BuildIdGenerator++, o._buildWasSuccessful = !1, o._cachedWorldViewMatrix = new u.a(), o._cachedWorldViewProjectionMatrix = new u.a(), o._optimizers = new Array(), o._animationFrame = -1, o.BJSNODEMATERIALEDITOR = o._getGlobalNodeMaterialEditor(), o.editorData = null, o.ignoreAlpha = !1, o.maxSimultaneousLights = 4, o.onBuildObservable = new C.c(), o._vertexOutputNodes = new Array(), o._fragmentOutputNodes = new Array(), o.attachedBlocks = new Array(), o._mode = Rn.Material, o._options = Object(c.a)({ emitComments: !1 }, i), o._attachImageProcessingConfiguration(null), o;\n          }\n          return Object(c.d)(t, r), t.prototype._getGlobalNodeMaterialEditor = function() {\n            return typeof NODEEDITOR < \"u\" ? NODEEDITOR : typeof BABYLON < \"u\" && BABYLON.NodeEditor !== void 0 ? BABYLON : void 0;\n          }, Object.defineProperty(t.prototype, \"options\", { get: function() {\n            return this._options;\n          }, set: function(e) {\n            this._options = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageProcessingConfiguration\", { get: function() {\n            return this._imageProcessingConfiguration;\n          }, set: function(e) {\n            this._attachImageProcessingConfiguration(e), this._markAllSubMeshesAsTexturesDirty();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"mode\", { get: function() {\n            return this._mode;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"NodeMaterial\";\n          }, t.prototype._attachImageProcessingConfiguration = function(e) {\n            var n = this;\n            e !== this._imageProcessingConfiguration && (this._imageProcessingConfiguration && this._imageProcessingObserver && this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver), this._imageProcessingConfiguration = e || this.getScene().imageProcessingConfiguration, this._imageProcessingConfiguration && (this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(function() {\n              n._markAllSubMeshesAsImageProcessingDirty();\n            })));\n          }, t.prototype.getBlockByName = function(e) {\n            for (var n = null, i = 0, o = this.attachedBlocks; i < o.length; i++) {\n              var a = o[i];\n              if (a.name === e) {\n                if (n)\n                  return Xe.b.Warn(\"More than one block was found with the name `\" + e + \"`\"), n;\n                n = a;\n              }\n            }\n            return n;\n          }, t.prototype.getBlockByPredicate = function(e) {\n            for (var n = 0, i = this.attachedBlocks; n < i.length; n++) {\n              var o = i[n];\n              if (e(o))\n                return o;\n            }\n            return null;\n          }, t.prototype.getInputBlockByPredicate = function(e) {\n            for (var n = 0, i = this.attachedBlocks; n < i.length; n++) {\n              var o = i[n];\n              if (o.isInput && e(o))\n                return o;\n            }\n            return null;\n          }, t.prototype.getInputBlocks = function() {\n            for (var e = [], n = 0, i = this.attachedBlocks; n < i.length; n++) {\n              var o = i[n];\n              o.isInput && e.push(o);\n            }\n            return e;\n          }, t.prototype.registerOptimizer = function(e) {\n            if (!(this._optimizers.indexOf(e) > -1))\n              return this._optimizers.push(e), this;\n          }, t.prototype.unregisterOptimizer = function(e) {\n            var n = this._optimizers.indexOf(e);\n            if (n !== -1)\n              return this._optimizers.splice(n, 1), this;\n          }, t.prototype.addOutputNode = function(e) {\n            if (e.target === null)\n              throw \"This node is not meant to be an output node. You may want to explicitly set its target value.\";\n            return e.target & Ce.Vertex && this._addVertexOutputNode(e), e.target & Ce.Fragment && this._addFragmentOutputNode(e), this;\n          }, t.prototype.removeOutputNode = function(e) {\n            return e.target === null || (e.target & Ce.Vertex && this._removeVertexOutputNode(e), e.target & Ce.Fragment && this._removeFragmentOutputNode(e)), this;\n          }, t.prototype._addVertexOutputNode = function(e) {\n            if (this._vertexOutputNodes.indexOf(e) === -1)\n              return e.target = Ce.Vertex, this._vertexOutputNodes.push(e), this;\n          }, t.prototype._removeVertexOutputNode = function(e) {\n            var n = this._vertexOutputNodes.indexOf(e);\n            if (n !== -1)\n              return this._vertexOutputNodes.splice(n, 1), this;\n          }, t.prototype._addFragmentOutputNode = function(e) {\n            if (this._fragmentOutputNodes.indexOf(e) === -1)\n              return e.target = Ce.Fragment, this._fragmentOutputNodes.push(e), this;\n          }, t.prototype._removeFragmentOutputNode = function(e) {\n            var n = this._fragmentOutputNodes.indexOf(e);\n            if (n !== -1)\n              return this._fragmentOutputNodes.splice(n, 1), this;\n          }, t.prototype.needAlphaBlending = function() {\n            return !this.ignoreAlpha && (this.alpha < 1 || this._sharedData && this._sharedData.hints.needAlphaBlending);\n          }, t.prototype.needAlphaTesting = function() {\n            return this._sharedData && this._sharedData.hints.needAlphaTesting;\n          }, t.prototype._initializeBlock = function(e, n, i) {\n            if (e.initialize(n), e.autoConfigure(this), e._preparationId = this._buildId, this.attachedBlocks.indexOf(e) === -1) {\n              if (e.isUnique) {\n                for (var o = e.getClassName(), a = 0, s = this.attachedBlocks; a < s.length; a++)\n                  if (s[a].getClassName() === o)\n                    throw \"Cannot have multiple blocks of type \" + o + \" in the same NodeMaterial\";\n              }\n              this.attachedBlocks.push(e);\n            }\n            for (var d = 0, p = e.inputs; d < p.length; d++) {\n              var y = p[d];\n              y.associatedVariableName = \"\";\n              var P = y.connectedPoint;\n              if (P) {\n                var R = P.ownerBlock;\n                R !== e && ((R.target === Ce.VertexAndFragment || n.target === Ce.Fragment && R.target === Ce.Vertex && R._preparationId !== this._buildId) && i.push(R), this._initializeBlock(R, n, i));\n              }\n            }\n            for (var B = 0, F = e.outputs; B < F.length; B++)\n              F[B].associatedVariableName = \"\";\n          }, t.prototype._resetDualBlocks = function(e, n) {\n            e.target === Ce.VertexAndFragment && (e.buildId = n);\n            for (var i = 0, o = e.inputs; i < o.length; i++) {\n              var a = o[i].connectedPoint;\n              if (a) {\n                var s = a.ownerBlock;\n                s !== e && this._resetDualBlocks(s, n);\n              }\n            }\n          }, t.prototype.removeBlock = function(e) {\n            var n = this.attachedBlocks.indexOf(e);\n            n > -1 && this.attachedBlocks.splice(n, 1), e.isFinalMerger && this.removeOutputNode(e);\n          }, t.prototype.build = function(e) {\n            e === void 0 && (e = !1), this._buildWasSuccessful = !1;\n            var n = this.getScene().getEngine(), i = this._mode === Rn.Particle;\n            if (this._vertexOutputNodes.length === 0 && !i)\n              throw \"You must define at least one vertexOutputNode\";\n            if (this._fragmentOutputNodes.length === 0)\n              throw \"You must define at least one fragmentOutputNode\";\n            this._vertexCompilationState = new Xu(), this._vertexCompilationState.supportUniformBuffers = n.supportsUniformBuffers, this._vertexCompilationState.target = Ce.Vertex, this._fragmentCompilationState = new Xu(), this._fragmentCompilationState.supportUniformBuffers = n.supportsUniformBuffers, this._fragmentCompilationState.target = Ce.Fragment, this._sharedData = new G_(), this._vertexCompilationState.sharedData = this._sharedData, this._fragmentCompilationState.sharedData = this._sharedData, this._sharedData.buildId = this._buildId, this._sharedData.emitComments = this._options.emitComments, this._sharedData.verbose = e, this._sharedData.scene = this.getScene(), this._sharedData.allowEmptyVertexProgram = i;\n            for (var o = [], a = [], s = 0, d = this._vertexOutputNodes; s < d.length; s++) {\n              var p = d[s];\n              o.push(p), this._initializeBlock(p, this._vertexCompilationState, a);\n            }\n            for (var y = 0, P = this._fragmentOutputNodes; y < P.length; y++) {\n              var R = P[y];\n              a.push(R), this._initializeBlock(R, this._fragmentCompilationState, o);\n            }\n            this.optimize();\n            for (var B = 0, F = o; B < F.length; B++)\n              (p = F[B]).build(this._vertexCompilationState, o);\n            this._fragmentCompilationState.uniforms = this._vertexCompilationState.uniforms.slice(0), this._fragmentCompilationState._uniformDeclaration = this._vertexCompilationState._uniformDeclaration, this._fragmentCompilationState._constantDeclaration = this._vertexCompilationState._constantDeclaration, this._fragmentCompilationState._vertexState = this._vertexCompilationState;\n            for (var z = 0, J = a; z < J.length; z++)\n              R = J[z], this._resetDualBlocks(R, this._buildId - 1);\n            for (var ie = 0, se = a; ie < se.length; ie++)\n              (R = se[ie]).build(this._fragmentCompilationState, a);\n            this._vertexCompilationState.finalize(this._vertexCompilationState), this._fragmentCompilationState.finalize(this._fragmentCompilationState), this._buildId = t._BuildIdGenerator++, this._sharedData.emitErrors(), e && (console.log(\"Vertex shader:\"), console.log(this._vertexCompilationState.compilationString), console.log(\"Fragment shader:\"), console.log(this._fragmentCompilationState.compilationString)), this._buildWasSuccessful = !0, this.onBuildObservable.notifyObservers(this);\n            for (var ce = 0, ue = this.getScene().meshes; ce < ue.length; ce++) {\n              var fe = ue[ce];\n              if (fe.subMeshes)\n                for (var ve = 0, Te = fe.subMeshes; ve < Te.length; ve++) {\n                  var Re = Te[ve];\n                  if (Re.getMaterial() === this && Re._materialDefines) {\n                    var Ae = Re._materialDefines;\n                    Ae.markAllAsDirty(), Ae.reset();\n                  }\n                }\n            }\n          }, t.prototype.optimize = function() {\n            for (var e = 0, n = this._optimizers; e < n.length; e++)\n              n[e].optimize(this._vertexOutputNodes, this._fragmentOutputNodes);\n          }, t.prototype._prepareDefinesForAttributes = function(e, n) {\n            var i = n.NORMAL, o = n.TANGENT, a = n.UV1;\n            n.NORMAL = e.isVerticesDataPresent(Oe.b.NormalKind), n.TANGENT = e.isVerticesDataPresent(Oe.b.TangentKind), n.UV1 = e.isVerticesDataPresent(Oe.b.UVKind), i === n.NORMAL && o === n.TANGENT && a === n.UV1 || n.markAsAttributesDirty();\n          }, t.prototype.createPostProcess = function(e, n, i, o, a, s, d) {\n            return n === void 0 && (n = 1), i === void 0 && (i = h.a.TEXTURE_NEAREST_SAMPLINGMODE), s === void 0 && (s = h.a.TEXTURETYPE_UNSIGNED_INT), d === void 0 && (d = h.a.TEXTUREFORMAT_RGBA), this.mode !== Rn.PostProcess ? (console.log(\"Incompatible material mode\"), null) : this._createEffectForPostProcess(null, e, n, i, o, a, s, d);\n          }, t.prototype.createEffectForPostProcess = function(e) {\n            this._createEffectForPostProcess(e);\n          }, t.prototype._createEffectForPostProcess = function(e, n, i, o, a, s, d, p) {\n            var y = this;\n            i === void 0 && (i = 1), o === void 0 && (o = h.a.TEXTURE_NEAREST_SAMPLINGMODE), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = h.a.TEXTUREFORMAT_RGBA);\n            var P = this.name + this._buildId, R = new lo(), B = new Mt.a(P + \"PostProcess\", this.getScene()), F = this._buildId;\n            return this._processDefines(B, R), ze.a.RegisterShader(P, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString), e ? e.updateEffect(R.toString(), this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, { maxSimultaneousLights: this.maxSimultaneousLights }, void 0, void 0, P, P) : e = new ft(this.name + \"PostProcess\", P, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, i, n, o, a, s, R.toString(), d, P, { maxSimultaneousLights: this.maxSimultaneousLights }, !1, p), e.nodeMaterialSource = this, e.onApplyObservable.add(function(z) {\n              F !== y._buildId && (delete ze.a.ShadersStore[P + \"VertexShader\"], delete ze.a.ShadersStore[P + \"PixelShader\"], P = y.name + y._buildId, R.markAsUnprocessed(), F = y._buildId), y._processDefines(B, R) && (ze.a.RegisterShader(P, y._fragmentCompilationState._builtCompilationString, y._vertexCompilationState._builtCompilationString), Qu.a.SetImmediate(function() {\n                return e.updateEffect(R.toString(), y._fragmentCompilationState.uniforms, y._fragmentCompilationState.samplers, { maxSimultaneousLights: y.maxSimultaneousLights }, void 0, void 0, P, P);\n              })), y._checkInternals(z);\n            }), e;\n          }, t.prototype.createProceduralTexture = function(e, n) {\n            var i = this;\n            if (this.mode !== Rn.ProceduralTexture)\n              return console.log(\"Incompatible material mode\"), null;\n            var o = this.name + this._buildId, a = new oo(o, e, null, n), s = new Mt.a(o + \"Procedural\", this.getScene());\n            s.reservedDataStore = { hidden: !0 };\n            var d = new lo(), p = this._processDefines(s, d);\n            ze.a.RegisterShader(o, this._fragmentCompilationState._builtCompilationString, this._vertexCompilationState._builtCompilationString);\n            var y = this.getScene().getEngine().createEffect({ vertexElement: o, fragmentElement: o }, [Oe.b.PositionKind], this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, d.toString(), p == null ? void 0 : p.fallbacks, void 0);\n            a.nodeMaterialSource = this, a._effect = y;\n            var P = this._buildId;\n            return a.onBeforeGenerationObservable.add(function() {\n              P !== i._buildId && (delete ze.a.ShadersStore[o + \"VertexShader\"], delete ze.a.ShadersStore[o + \"PixelShader\"], o = i.name + i._buildId, d.markAsUnprocessed(), P = i._buildId);\n              var R = i._processDefines(s, d);\n              R && (ze.a.RegisterShader(o, i._fragmentCompilationState._builtCompilationString, i._vertexCompilationState._builtCompilationString), Qu.a.SetImmediate(function() {\n                y = i.getScene().getEngine().createEffect({ vertexElement: o, fragmentElement: o }, [Oe.b.PositionKind], i._fragmentCompilationState.uniforms, i._fragmentCompilationState.samplers, d.toString(), R == null ? void 0 : R.fallbacks, void 0), a._effect = y;\n              })), i._checkInternals(y);\n            }), a;\n          }, t.prototype._createEffectForParticles = function(e, n, i, o, a, s, d, p) {\n            var y = this;\n            p === void 0 && (p = \"\");\n            var P = this.name + this._buildId + \"_\" + n;\n            s || (s = new lo()), d || (d = this.getScene().getMeshByName(this.name + \"Particle\")) || ((d = new Mt.a(this.name + \"Particle\", this.getScene())).reservedDataStore = { hidden: !0 });\n            var R = this._buildId, B = [], F = p;\n            if (!a) {\n              var z = this._processDefines(d, s);\n              ze.a.RegisterShader(P, this._fragmentCompilationState._builtCompilationString), e.fillDefines(B, n), F = B.join(`\n`), a = this.getScene().getEngine().createEffectForParticles(P, this._fragmentCompilationState.uniforms, this._fragmentCompilationState.samplers, s.toString() + `\n` + F, z == null ? void 0 : z.fallbacks, i, o, e), e.setCustomEffect(a, n);\n            }\n            a.onBindObservable.add(function(J) {\n              R !== y._buildId && (delete ze.a.ShadersStore[P + \"PixelShader\"], P = y.name + y._buildId + \"_\" + n, s.markAsUnprocessed(), R = y._buildId), B.length = 0, e.fillDefines(B, n);\n              var ie = B.join(`\n`);\n              ie !== F && (s.markAsUnprocessed(), F = ie);\n              var se = y._processDefines(d, s);\n              if (se)\n                return ze.a.RegisterShader(P, y._fragmentCompilationState._builtCompilationString), J = y.getScene().getEngine().createEffectForParticles(P, y._fragmentCompilationState.uniforms, y._fragmentCompilationState.samplers, s.toString() + `\n` + F, se == null ? void 0 : se.fallbacks, i, o, e), e.setCustomEffect(J, n), void y._createEffectForParticles(e, n, i, o, J, s, d, F);\n              y._checkInternals(J);\n            });\n          }, t.prototype._checkInternals = function(e) {\n            if (this._sharedData.animatedInputs) {\n              var n = this.getScene(), i = n.getFrameId();\n              if (this._animationFrame !== i) {\n                for (var o = 0, a = this._sharedData.animatedInputs; o < a.length; o++)\n                  a[o].animate(n);\n                this._animationFrame = i;\n              }\n            }\n            for (var s = 0, d = this._sharedData.bindableBlocks; s < d.length; s++)\n              d[s].bind(e, this);\n            for (var p = 0, y = this._sharedData.inputBlocks; p < y.length; p++)\n              y[p]._transmit(e, this.getScene());\n          }, t.prototype.createEffectForParticles = function(e, n, i) {\n            this.mode === Rn.Particle ? (this._createEffectForParticles(e, co.BLENDMODE_ONEONE, n, i), this._createEffectForParticles(e, co.BLENDMODE_MULTIPLY, n, i)) : console.log(\"Incompatible material mode\");\n          }, t.prototype._processDefines = function(e, n, i, o) {\n            var a = this;\n            i === void 0 && (i = !1);\n            var s = null;\n            if (this._sharedData.blocksWithDefines.forEach(function(B) {\n              B.initializeDefines(e, a, n, i);\n            }), this._sharedData.blocksWithDefines.forEach(function(B) {\n              B.prepareDefines(e, a, n, i, o);\n            }), n.isDirty) {\n              var d = n._areLightsDisposed;\n              n.markAsProcessed(), this._vertexCompilationState.compilationString = this._vertexCompilationState._builtCompilationString, this._fragmentCompilationState.compilationString = this._fragmentCompilationState._builtCompilationString, this._sharedData.repeatableContentBlocks.forEach(function(B) {\n                B.replaceRepeatableContent(a._vertexCompilationState, a._fragmentCompilationState, e, n);\n              });\n              var p = [];\n              this._sharedData.dynamicUniformBlocks.forEach(function(B) {\n                B.updateUniformsAndSamples(a._vertexCompilationState, a, n, p);\n              });\n              var y = this._vertexCompilationState.uniforms;\n              this._fragmentCompilationState.uniforms.forEach(function(B) {\n                y.indexOf(B) === -1 && y.push(B);\n              });\n              var P = this._vertexCompilationState.samplers;\n              this._fragmentCompilationState.samplers.forEach(function(B) {\n                P.indexOf(B) === -1 && P.push(B);\n              });\n              var R = new _r.a();\n              this._sharedData.blocksWithFallbacks.forEach(function(B) {\n                B.provideFallbacks(e, R);\n              }), s = { lightDisposed: d, uniformBuffers: p, mergedUniforms: y, mergedSamplers: P, fallbacks: R };\n            }\n            return s;\n          }, t.prototype.isReadyForSubMesh = function(e, n, i) {\n            var o = this;\n            if (i === void 0 && (i = !1), !this._buildWasSuccessful)\n              return !1;\n            var a = this.getScene();\n            if (this._sharedData.animatedInputs) {\n              var s = a.getFrameId();\n              if (this._animationFrame !== s) {\n                for (var d = 0, p = this._sharedData.animatedInputs; d < p.length; d++)\n                  p[d].animate(a);\n                this._animationFrame = s;\n              }\n            }\n            if (n.effect && this.isFrozen && n.effect._wasPreviouslyReady)\n              return !0;\n            n._materialDefines || (n._materialDefines = new lo());\n            var y = n._materialDefines;\n            if (this._isReadyForSubMesh(n))\n              return !0;\n            var P = a.getEngine();\n            if (this._prepareDefinesForAttributes(e, y), this._sharedData.blockingBlocks.some(function(J) {\n              return !J.isReady(e, o, y, i);\n            }))\n              return !1;\n            var R = this._processDefines(e, y, i, n);\n            if (R) {\n              var B = n.effect, F = y.toString(), z = P.createEffect({ vertex: \"nodeMaterial\" + this._buildId, fragment: \"nodeMaterial\" + this._buildId, vertexSource: this._vertexCompilationState.compilationString, fragmentSource: this._fragmentCompilationState.compilationString }, { attributes: this._vertexCompilationState.attributes, uniformsNames: R.mergedUniforms, uniformBuffersNames: R.uniformBuffers, samplers: R.mergedSamplers, defines: F, fallbacks: R.fallbacks, onCompiled: this.onCompiled, onError: this.onError, indexParameters: { maxSimultaneousLights: this.maxSimultaneousLights, maxSimultaneousMorphTargets: y.NUM_MORPH_INFLUENCERS } }, P);\n              if (z)\n                if (this._onEffectCreatedObservable && (ec.effect = z, ec.subMesh = n, this._onEffectCreatedObservable.notifyObservers(ec)), this.allowShaderHotSwapping && B && !z.isReady()) {\n                  if (z = B, y.markAsUnprocessed(), R.lightDisposed)\n                    return y._areLightsDisposed = !0, !1;\n                } else\n                  a.resetCachedMaterial(), n.setEffect(z, y);\n            }\n            return !(!n.effect || !n.effect.isReady()) && (y._renderId = a.getRenderId(), n.effect._wasPreviouslyReady = !0, !0);\n          }, Object.defineProperty(t.prototype, \"compiledShaders\", { get: function() {\n            return `// Vertex shader\\r\n` + this._vertexCompilationState.compilationString + `\\r\n\\r\n// Fragment shader\\r\n` + this._fragmentCompilationState.compilationString;\n          }, enumerable: !1, configurable: !0 }), t.prototype.bindOnlyWorldMatrix = function(e) {\n            var n = this.getScene();\n            if (this._activeEffect) {\n              var i = this._sharedData.hints;\n              i.needWorldViewMatrix && e.multiplyToRef(n.getViewMatrix(), this._cachedWorldViewMatrix), i.needWorldViewProjectionMatrix && e.multiplyToRef(n.getTransformMatrix(), this._cachedWorldViewProjectionMatrix);\n              for (var o = 0, a = this._sharedData.inputBlocks; o < a.length; o++)\n                a[o]._transmitWorld(this._activeEffect, e, this._cachedWorldViewMatrix, this._cachedWorldViewProjectionMatrix);\n            }\n          }, t.prototype.bindForSubMesh = function(e, n, i) {\n            var o = this.getScene(), a = i.effect;\n            if (a) {\n              if (this._activeEffect = a, this.bindOnlyWorldMatrix(e), this._mustRebind(o, a, n.visibility)) {\n                var s = this._sharedData;\n                if (a && o.getCachedEffect() !== a) {\n                  for (var d = 0, p = s.bindableBlocks; d < p.length; d++)\n                    p[d].bind(a, this, n, i);\n                  for (var y = 0, P = s.inputBlocks; y < P.length; y++)\n                    P[y]._transmit(a, o);\n                }\n              }\n              this._afterBind(n, this._activeEffect);\n            }\n          }, t.prototype.getActiveTextures = function() {\n            var e = r.prototype.getActiveTextures.call(this);\n            return this._sharedData && e.push.apply(e, this._sharedData.textureBlocks.filter(function(n) {\n              return n.texture;\n            }).map(function(n) {\n              return n.texture;\n            })), e;\n          }, t.prototype.getTextureBlocks = function() {\n            return this._sharedData ? this._sharedData.textureBlocks : [];\n          }, t.prototype.hasTexture = function(e) {\n            if (r.prototype.hasTexture.call(this, e))\n              return !0;\n            if (!this._sharedData)\n              return !1;\n            for (var n = 0, i = this._sharedData.textureBlocks; n < i.length; n++)\n              if (i[n].texture === e)\n                return !0;\n            return !1;\n          }, t.prototype.dispose = function(e, n, i) {\n            if (n)\n              for (var o = 0, a = this._sharedData.textureBlocks.filter(function(p) {\n                return p.texture;\n              }).map(function(p) {\n                return p.texture;\n              }); o < a.length; o++)\n                a[o].dispose();\n            for (var s = 0, d = this.attachedBlocks; s < d.length; s++)\n              d[s].dispose();\n            this.onBuildObservable.clear(), r.prototype.dispose.call(this, e, n, i);\n          }, t.prototype._createNodeEditor = function() {\n            this.BJSNODEMATERIALEDITOR = this.BJSNODEMATERIALEDITOR || this._getGlobalNodeMaterialEditor(), this.BJSNODEMATERIALEDITOR.NodeEditor.Show({ nodeMaterial: this });\n          }, t.prototype.edit = function(e) {\n            var n = this;\n            return new Promise(function(i, o) {\n              if (n.BJSNODEMATERIALEDITOR === void 0) {\n                var a = e && e.editorURL ? e.editorURL : t.EditorURL;\n                Xe.b.LoadScript(a, function() {\n                  n._createNodeEditor(), i();\n                });\n              } else\n                n._createNodeEditor(), i();\n            });\n          }, t.prototype.clear = function() {\n            this._vertexOutputNodes = [], this._fragmentOutputNodes = [], this.attachedBlocks = [];\n          }, t.prototype.setToDefault = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"Position\");\n            e.setAsAttribute(\"position\");\n            var n = new Et(\"World\");\n            n.setAsSystemValue(BABYLON.NodeMaterialSystemValues.World);\n            var i = new ia(\"WorldPos\");\n            e.connectTo(i), n.connectTo(i);\n            var o = new Et(\"ViewProjection\");\n            o.setAsSystemValue(BABYLON.NodeMaterialSystemValues.ViewProjection);\n            var a = new ia(\"WorldPos * ViewProjectionTransform\");\n            i.connectTo(a), o.connectTo(a);\n            var s = new ao(\"VertexOutput\");\n            a.connectTo(s);\n            var d = new Et(\"color\");\n            d.value = new I.b(0.8, 0.8, 0.8, 1);\n            var p = new Pr(\"FragmentOutput\");\n            d.connectTo(p), this.addOutputNode(s), this.addOutputNode(p), this._mode = Rn.Material;\n          }, t.prototype.setToDefaultPostProcess = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"Position\");\n            e.setAsAttribute(\"position2d\");\n            var n = new Et(\"Constant1\");\n            n.isConstant = !0, n.value = 1;\n            var i = new so(\"Position3D\");\n            e.connectTo(i), n.connectTo(i, { input: \"w\" });\n            var o = new ao(\"VertexOutput\");\n            i.connectTo(o);\n            var a = new Et(\"Scale\");\n            a.visibleInInspector = !0, a.value = new u.d(1, 1);\n            var s = new Xs(\"uv0\");\n            e.connectTo(s);\n            var d = new ra(\"UV scale\");\n            s.connectTo(d), a.connectTo(d);\n            var p = new zs(\"CurrentScreen\");\n            d.connectTo(p), p.texture = new Ne.a(\"https://assets.babylonjs.com/nme/currentScreenPostProcess.png\", this.getScene());\n            var y = new Pr(\"FragmentOutput\");\n            p.connectTo(y, { output: \"rgba\" }), this.addOutputNode(o), this.addOutputNode(y), this._mode = Rn.PostProcess;\n          }, t.prototype.setToDefaultProceduralTexture = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"Position\");\n            e.setAsAttribute(\"position2d\");\n            var n = new Et(\"Constant1\");\n            n.isConstant = !0, n.value = 1;\n            var i = new so(\"Position3D\");\n            e.connectTo(i), n.connectTo(i, { input: \"w\" });\n            var o = new ao(\"VertexOutput\");\n            i.connectTo(o);\n            var a = new Et(\"Time\");\n            a.value = 0, a.min = 0, a.max = 0, a.isBoolean = !1, a.matrixMode = 0, a.animationType = wi.Time, a.isConstant = !1;\n            var s = new Et(\"Color3\");\n            s.value = new I.a(1, 1, 1), s.isConstant = !1;\n            var d = new Pr(\"FragmentOutput\"), p = new so(\"VectorMerger\");\n            p.visibleInInspector = !1;\n            var y = new $s(\"Cos\");\n            y.operation = tn.Cos, e.connectTo(p), a.output.connectTo(y.input), y.output.connectTo(p.z), p.xyzOut.connectTo(d.rgb), this.addOutputNode(o), this.addOutputNode(d), this._mode = Rn.ProceduralTexture;\n          }, t.prototype.setToDefaultParticle = function() {\n            this.clear(), this.editorData = null;\n            var e = new Et(\"uv\");\n            e.setAsAttribute(\"particle_uv\");\n            var n = new js(\"ParticleTexture\");\n            e.connectTo(n);\n            var i = new Et(\"Color\");\n            i.setAsAttribute(\"particle_color\");\n            var o = new ra(\"Texture * Color\");\n            n.connectTo(o), i.connectTo(o);\n            var a = new Hs(\"ParticleRampGradient\");\n            o.connectTo(a);\n            var s = new Js(\"ColorSplitter\");\n            i.connectTo(s);\n            var d = new Ws(\"ParticleBlendMultiply\");\n            a.connectTo(d), n.connectTo(d, { output: \"a\" }), s.connectTo(d, { output: \"a\" });\n            var p = new Pr(\"FragmentOutput\");\n            d.connectTo(p), this.addOutputNode(p), this._mode = Rn.Particle;\n          }, t.prototype.loadAsync = function(e) {\n            var n = this;\n            return this.getScene()._loadFileAsync(e).then(function(i) {\n              var o = JSON.parse(i);\n              n.loadFromSerialization(o, \"\");\n            });\n          }, t.prototype._gatherBlocks = function(e, n) {\n            if (n.indexOf(e) === -1) {\n              n.push(e);\n              for (var i = 0, o = e.inputs; i < o.length; i++) {\n                var a = o[i].connectedPoint;\n                if (a) {\n                  var s = a.ownerBlock;\n                  s !== e && this._gatherBlocks(s, n);\n                }\n              }\n            }\n          }, t.prototype.generateCode = function() {\n            for (var e = [], n = [], i = [], o = 0, a = this._vertexOutputNodes; o < a.length; o++) {\n              var s = a[o];\n              this._gatherBlocks(s, n);\n            }\n            for (var d = [], p = 0, y = this._fragmentOutputNodes; p < y.length; p++)\n              s = y[p], this._gatherBlocks(s, d);\n            for (var P = 'var nodeMaterial = new BABYLON.NodeMaterial(\"' + (this.name || \"node material\") + `\");\\r\n`, R = 0, B = n; R < B.length; R++)\n              (Re = B[R]).isInput && e.indexOf(Re) === -1 && (P += Re._dumpCode(i, e));\n            for (var F = 0, z = d; F < z.length; F++)\n              (Re = z[F]).isInput && e.indexOf(Re) === -1 && (P += Re._dumpCode(i, e));\n            e = [], P += `\\r\n// Connections\\r\n`;\n            for (var J = 0, ie = this._vertexOutputNodes; J < ie.length; J++)\n              P += (Re = ie[J])._dumpCodeForOutputConnections(e);\n            for (var se = 0, ce = this._fragmentOutputNodes; se < ce.length; se++)\n              P += (Re = ce[se])._dumpCodeForOutputConnections(e);\n            P += `\\r\n// Output nodes\\r\n`;\n            for (var ue = 0, fe = this._vertexOutputNodes; ue < fe.length; ue++)\n              P += \"nodeMaterial.addOutputNode(\" + (Re = fe[ue])._codeVariableName + `);\\r\n`;\n            for (var ve = 0, Te = this._fragmentOutputNodes; ve < Te.length; ve++) {\n              var Re;\n              P += \"nodeMaterial.addOutputNode(\" + (Re = Te[ve])._codeVariableName + `);\\r\n`;\n            }\n            return P += `nodeMaterial.build();\\r\n`;\n          }, t.prototype.serialize = function(e) {\n            var n = e ? {} : L.a.Serialize(this);\n            n.editorData = JSON.parse(JSON.stringify(this.editorData));\n            var i = [];\n            if (e)\n              i = e;\n            else {\n              n.customType = \"BABYLON.NodeMaterial\", n.outputNodes = [];\n              for (var o = 0, a = this._vertexOutputNodes; o < a.length; o++) {\n                var s = a[o];\n                this._gatherBlocks(s, i), n.outputNodes.push(s.uniqueId);\n              }\n              for (var d = 0, p = this._fragmentOutputNodes; d < p.length; d++)\n                s = p[d], this._gatherBlocks(s, i), n.outputNodes.indexOf(s.uniqueId) === -1 && n.outputNodes.push(s.uniqueId);\n            }\n            n.blocks = [];\n            for (var y = 0, P = i; y < P.length; y++) {\n              var R = P[y];\n              n.blocks.push(R.serialize());\n            }\n            if (!e)\n              for (var B = 0, F = this.attachedBlocks; B < F.length; B++)\n                R = F[B], i.indexOf(R) === -1 && n.blocks.push(R.serialize());\n            return n;\n          }, t.prototype._restoreConnections = function(e, n, i) {\n            for (var o = 0, a = e.outputs; o < a.length; o++)\n              for (var s = a[o], d = 0, p = n.blocks; d < p.length; d++) {\n                var y = p[d], P = i[y.id];\n                if (P)\n                  for (var R = 0, B = y.inputs; R < B.length; R++) {\n                    var F = B[R];\n                    if (!(i[F.targetBlockId] !== e || F.targetConnectionName !== s.name)) {\n                      var z = P.getInputByName(F.inputName);\n                      if (!z || z.isConnected)\n                        continue;\n                      s.connectTo(z, !0), this._restoreConnections(P, n, i);\n                    }\n                  }\n              }\n          }, t.prototype.loadFromSerialization = function(e, n, i) {\n            var o;\n            n === void 0 && (n = \"\"), i === void 0 && (i = !1), i || this.clear();\n            for (var a = {}, s = 0, d = e.blocks; s < d.length; s++) {\n              var p = d[s], y = O.a.GetClass(p.customType);\n              y && ((R = new y())._deserialize(p, this.getScene(), n), a[p.id] = R, this.attachedBlocks.push(R));\n            }\n            for (var P = 0; P < e.blocks.length; P++) {\n              var R;\n              (R = a[e.blocks[P].id]) && (R.inputs.length && !i || this._restoreConnections(R, e, a));\n            }\n            if (e.outputNodes)\n              for (var B = 0, F = e.outputNodes; B < F.length; B++) {\n                var z = F[B];\n                this.addOutputNode(a[z]);\n              }\n            if (e.locations || e.editorData && e.editorData.locations) {\n              for (var J = e.locations || e.editorData.locations, ie = 0, se = J; ie < se.length; ie++) {\n                var ce = se[ie];\n                a[ce.blockId] && (ce.blockId = a[ce.blockId].uniqueId);\n              }\n              i && this.editorData && this.editorData.locations && J.concat(this.editorData.locations), e.locations ? this.editorData = { locations: J } : (this.editorData = e.editorData, this.editorData.locations = J);\n              var ue = [];\n              for (var fe in a)\n                ue[fe] = a[fe].uniqueId;\n              this.editorData.map = ue;\n            }\n            this.comment = e.comment, i || (this._mode = (o = e.mode) !== null && o !== void 0 ? o : Rn.Material);\n          }, t.prototype.clone = function(e) {\n            var n = this, i = this.serialize(), o = L.a.Clone(function() {\n              return new t(e, n.getScene(), n.options);\n            }, this);\n            return o.id = e, o.name = e, o.loadFromSerialization(i), o.build(), o;\n          }, t.Parse = function(e, n, i) {\n            i === void 0 && (i = \"\");\n            var o = L.a.Parse(function() {\n              return new t(e.name, n);\n            }, e, n, i);\n            return o.loadFromSerialization(e, i), o.build(), o;\n          }, t.ParseFromFileAsync = function(e, n, i) {\n            var o = new t(e, i);\n            return new Promise(function(a, s) {\n              return o.loadAsync(n).then(function() {\n                o.build(), a(o);\n              }).catch(s);\n            });\n          }, t.ParseFromSnippetAsync = function(e, n, i, o) {\n            var a = this;\n            return i === void 0 && (i = \"\"), e === \"_BLANK\" ? Promise.resolve(this.CreateDefault(\"blank\", n)) : new Promise(function(s, d) {\n              var p = new re.a();\n              p.addEventListener(\"readystatechange\", function() {\n                if (p.readyState == 4)\n                  if (p.status == 200) {\n                    var y = JSON.parse(JSON.parse(p.responseText).jsonPayload), P = JSON.parse(y.nodeMaterial);\n                    o || ((o = L.a.Parse(function() {\n                      return new t(e, n);\n                    }, P, n, i)).uniqueId = n.getUniqueId()), o.loadFromSerialization(P), o.snippetId = e;\n                    try {\n                      o.build(), s(o);\n                    } catch (R) {\n                      d(R);\n                    }\n                  } else\n                    d(\"Unable to load the snippet \" + e);\n              }), p.open(\"GET\", a.SnippetUrl + \"/\" + e.replace(/#/g, \"/\")), p.send();\n            });\n          }, t.CreateDefault = function(e, n) {\n            var i = new t(e, n);\n            return i.setToDefault(), i.build(), i;\n          }, t._BuildIdGenerator = 0, t.EditorURL = \"https://unpkg.com/babylonjs-node-editor@\" + Ue.a.Version + \"/babylon.nodeEditor.js\", t.SnippetUrl = \"https://snippet.babylonjs.com\", t.IgnoreTexturesAtLoadTime = !1, Object(c.c)([Object(L.c)(\"mode\")], t.prototype, \"_mode\", void 0), Object(c.c)([Object(L.c)(\"comment\")], t.prototype, \"comment\", void 0), t;\n        }(jo.a);\n        O.a.RegisteredTypes[\"BABYLON.NodeMaterial\"] = sa;\n        var qu = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"matricesIndices\", le.Vector4), n.registerInput(\"matricesWeights\", le.Vector4), n.registerInput(\"matricesIndicesExtra\", le.Vector4, !0), n.registerInput(\"matricesWeightsExtra\", le.Vector4, !0), n.registerInput(\"world\", le.Matrix), n.registerOutput(\"output\", le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"boneSampler\"), e._excludeVariableName(\"boneTextureWidth\"), e._excludeVariableName(\"mBones\"), e._excludeVariableName(\"BonesPerMesh\");\n          }, t.prototype.getClassName = function() {\n            return \"BonesBlock\";\n          }, Object.defineProperty(t.prototype, \"matricesIndices\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"matricesWeights\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"matricesIndicesExtra\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"matricesWeightsExtra\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.matricesIndices.isConnected) {\n              var n = e.getInputBlockByPredicate(function(a) {\n                return a.isAttribute && a.name === \"matricesIndices\";\n              });\n              n || (n = new Et(\"matricesIndices\")).setAsAttribute(\"matricesIndices\"), n.output.connectTo(this.matricesIndices);\n            }\n            if (!this.matricesWeights.isConnected) {\n              var i = e.getInputBlockByPredicate(function(a) {\n                return a.isAttribute && a.name === \"matricesWeights\";\n              });\n              i || (i = new Et(\"matricesWeights\")).setAsAttribute(\"matricesWeights\"), i.output.connectTo(this.matricesWeights);\n            }\n            if (!this.world.isConnected) {\n              var o = e.getInputBlockByPredicate(function(a) {\n                return a.systemValue === gt.World;\n              });\n              o || (o = new Et(\"world\")).setAsSystemValue(gt.World), o.output.connectTo(this.world);\n            }\n          }, t.prototype.provideFallbacks = function(e, n) {\n            e && e.useBones && e.computeBonesUsingShaders && e.skeleton && n.addCPUSkinningFallback(0, e);\n          }, t.prototype.bind = function(e, n, i) {\n            $e.a.BindBonesParameters(i, e);\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i._areAttributesDirty && $e.a.PrepareDefinesForBones(e, i);\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithFallbacks.push(this), e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.uniforms.push(\"boneTextureWidth\"), e.uniforms.push(\"mBones\"), e.samplers.push(\"boneSampler\");\n            var n = \"//\" + this.name;\n            e._emitFunctionFromInclude(\"bonesDeclaration\", n, { removeAttributes: !0, removeUniforms: !1, removeVaryings: !0, removeIfDef: !1 });\n            var i = e._getFreeVariableName(\"influence\");\n            e.compilationString += e._emitCodeFromInclude(\"bonesVertex\", n, { replaceStrings: [{ search: /finalWorld=finalWorld\\*influence;/, replace: \"\" }, { search: /influence/gm, replace: i }] });\n            var o = this._outputs[0], a = this.world;\n            return e.compilationString += `#if NUM_BONE_INFLUENCERS>0\\r\n`, e.compilationString += this._declareOutput(o, e) + \" = \" + a.associatedVariableName + \" * \" + i + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(o, e) + \" = \" + a.associatedVariableName + `;\\r\n`, e.compilationString += `#endif\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.BonesBlock\"] = qu;\n        var Zu = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"world0\", le.Vector4), n.registerInput(\"world1\", le.Vector4), n.registerInput(\"world2\", le.Vector4), n.registerInput(\"world3\", le.Vector4), n.registerInput(\"world\", le.Matrix, !0), n.registerOutput(\"output\", le.Matrix), n.registerOutput(\"instanceID\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"InstancesBlock\";\n          }, Object.defineProperty(t.prototype, \"world0\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world1\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world2\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world3\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"instanceID\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.world0.connectedPoint) {\n              var n = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world0\";\n              });\n              n || (n = new Et(\"world0\")).setAsAttribute(\"world0\"), n.output.connectTo(this.world0);\n            }\n            if (!this.world1.connectedPoint) {\n              var i = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world1\";\n              });\n              i || (i = new Et(\"world1\")).setAsAttribute(\"world1\"), i.output.connectTo(this.world1);\n            }\n            if (!this.world2.connectedPoint) {\n              var o = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world2\";\n              });\n              o || (o = new Et(\"world2\")).setAsAttribute(\"world2\"), o.output.connectTo(this.world2);\n            }\n            if (!this.world3.connectedPoint) {\n              var a = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world3\";\n              });\n              a || (a = new Et(\"world3\")).setAsAttribute(\"world3\"), a.output.connectTo(this.world3);\n            }\n            if (!this.world.connectedPoint) {\n              var s = e.getInputBlockByPredicate(function(d) {\n                return d.isAttribute && d.name === \"world\";\n              });\n              s || (s = new Et(\"world\")).setAsSystemValue(gt.World), s.output.connectTo(this.world);\n            }\n            this.world.define = \"!INSTANCES || THIN_INSTANCES\";\n          }, t.prototype.prepareDefines = function(e, n, i, o, a) {\n            o === void 0 && (o = !1);\n            var s = !1;\n            i.INSTANCES !== o && (i.setValue(\"INSTANCES\", o), s = !0), a && i.THIN_INSTANCES !== !!(a != null && a.getRenderingMesh().hasThinInstances) && (i.setValue(\"THIN_INSTANCES\", !!(a != null && a.getRenderingMesh().hasThinInstances)), s = !0), s && i.markAsUnprocessed();\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithDefines.push(this);\n            var n = this._outputs[0], i = this._outputs[1], o = this.world0, a = this.world1, s = this.world2, d = this.world3;\n            return e.compilationString += `#ifdef INSTANCES\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = mat4(\" + o.associatedVariableName + \", \" + a.associatedVariableName + \", \" + s.associatedVariableName + \", \" + d.associatedVariableName + `);\\r\n`, e.compilationString += `#ifdef THIN_INSTANCES\\r\n`, e.compilationString += n.associatedVariableName + \" = \" + this.world.associatedVariableName + \" * \" + n.associatedVariableName + `;\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += this._declareOutput(i, e) + ` = float(gl_InstanceID);\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = \" + this.world.associatedVariableName + `;\\r\n`, e.compilationString += this._declareOutput(i, e) + ` = 0.0;\\r\n`, e.compilationString += `#endif\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.InstancesBlock\"] = Zu;\n        var Ju = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"position\", le.Vector3), n.registerInput(\"normal\", le.Vector3), n.registerInput(\"tangent\", le.Vector3), n.registerInput(\"uv\", le.Vector2), n.registerOutput(\"positionOutput\", le.Vector3), n.registerOutput(\"normalOutput\", le.Vector3), n.registerOutput(\"tangentOutput\", le.Vector3), n.registerOutput(\"uvOutput\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MorphTargetsBlock\";\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tangent\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"positionOutput\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalOutput\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tangentOutput\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uvOutput\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"morphTargetInfluences\");\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.position.isConnected) {\n              var n = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"position\";\n              });\n              n || (n = new Et(\"position\")).setAsAttribute(), n.output.connectTo(this.position);\n            }\n            if (!this.normal.isConnected) {\n              var i = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"normal\";\n              });\n              i || (i = new Et(\"normal\")).setAsAttribute(\"normal\"), i.output.connectTo(this.normal);\n            }\n            if (!this.tangent.isConnected) {\n              var o = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"tangent\";\n              });\n              o || (o = new Et(\"tangent\")).setAsAttribute(\"tangent\"), o.output.connectTo(this.tangent);\n            }\n            if (!this.uv.isConnected) {\n              var a = e.getInputBlockByPredicate(function(s) {\n                return s.isAttribute && s.name === \"uv\";\n              });\n              a || (a = new Et(\"uv\")).setAsAttribute(\"uv\"), a.output.connectTo(this.uv);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i._areAttributesDirty && $e.a.PrepareDefinesForMorphTargets(e, i);\n          }, t.prototype.bind = function(e, n, i) {\n            i && i.morphTargetManager && i.morphTargetManager.numInfluencers > 0 && $e.a.BindMorphTargetParameters(i, e);\n          }, t.prototype.replaceRepeatableContent = function(e, n, i, o) {\n            for (var a = this.position, s = this.normal, d = this.tangent, p = this.uv, y = this.positionOutput, P = this.normalOutput, R = this.tangentOutput, B = this.uvOutput, F = e, z = o.NUM_MORPH_INFLUENCERS, J = i.morphTargetManager, ie = J && J.supportsNormals && o.NORMAL, se = J && J.supportsTangents && o.TANGENT, ce = J && J.supportsUVs && o.UV1, ue = \"\", fe = 0; fe < z; fe++)\n              ue += `#ifdef MORPHTARGETS\\r\n`, ue += y.associatedVariableName + \" += (position\" + fe + \" - \" + a.associatedVariableName + \") * morphTargetInfluences[\" + fe + `];\\r\n`, ie && (ue += `#ifdef MORPHTARGETS_NORMAL\\r\n`, ue += P.associatedVariableName + \" += (normal\" + fe + \" - \" + s.associatedVariableName + \") * morphTargetInfluences[\" + fe + `];\\r\n`, ue += `#endif\\r\n`), se && (ue += `#ifdef MORPHTARGETS_TANGENT\\r\n`, ue += R.associatedVariableName + \".xyz += (tangent\" + fe + \" - \" + d.associatedVariableName + \".xyz) * morphTargetInfluences[\" + fe + `];\\r\n`, ue += `#endif\\r\n`), ce && (ue += `#ifdef MORPHTARGETS_UV\\r\n`, ue += B.associatedVariableName + \".xy += (uv_\" + fe + \" - \" + p.associatedVariableName + \".xy) * morphTargetInfluences[\" + fe + `];\\r\n`, ue += `#endif\\r\n`), ue += `#endif\\r\n`;\n            if (F.compilationString = F.compilationString.replace(this._repeatableContentAnchor, ue), z > 0)\n              for (fe = 0; fe < z; fe++)\n                F.attributes.push(Oe.b.PositionKind + fe), ie && F.attributes.push(Oe.b.NormalKind + fe), se && F.attributes.push(Oe.b.TangentKind + fe), ce && F.attributes.push(Oe.b.UVKind + \"_\" + fe);\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), e.sharedData.repeatableContentBlocks.push(this);\n            var n = this.position, i = this.normal, o = this.tangent, a = this.uv, s = this.positionOutput, d = this.normalOutput, p = this.tangentOutput, y = this.uvOutput, P = \"//\" + this.name;\n            return e.uniforms.push(\"morphTargetInfluences\"), e._emitFunctionFromInclude(\"morphTargetsVertexGlobalDeclaration\", P), e._emitFunctionFromInclude(\"morphTargetsVertexDeclaration\", P, { repeatKey: \"maxSimultaneousMorphTargets\" }), e.compilationString += this._declareOutput(s, e) + \" = \" + n.associatedVariableName + `;\\r\n`, e.compilationString += `#ifdef NORMAL\\r\n`, e.compilationString += this._declareOutput(d, e) + \" = \" + i.associatedVariableName + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(d, e) + ` = vec3(0., 0., 0.);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += `#ifdef TANGENT\\r\n`, e.compilationString += this._declareOutput(p, e) + \" = \" + o.associatedVariableName + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(p, e) + ` = vec3(0., 0., 0.);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += `#ifdef UV1\\r\n`, e.compilationString += this._declareOutput(y, e) + \" = \" + a.associatedVariableName + `;\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(y, e) + ` = vec2(0., 0.);\\r\n`, e.compilationString += `#endif\\r\n`, this._repeatableContentAnchor = e._repeatableContentAnchor, e.compilationString += this._repeatableContentAnchor, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MorphTargetsBlock\"] = Ju;\n        var $u = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Vertex) || this;\n            return n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerOutput(\"direction\", le.Vector3), n.registerOutput(\"color\", le.Color3), n.registerOutput(\"intensity\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LightInformationBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype.bind = function(e, n, i) {\n            if (i) {\n              this.light && this.light.isDisposed && (this.light = null);\n              var o = this.light, a = n.getScene();\n              if (!o && a.lights.length && (o = a.lights[0]), !o || !o.isEnabled)\n                return e.setFloat3(this._lightDataUniformName, 0, 0, 0), void e.setFloat4(this._lightColorUniformName, 0, 0, 0, 0);\n              o.transferToNodeMaterialEffect(e, this._lightDataUniformName), e.setColor4(this._lightColorUniformName, o.diffuse, o.intensity);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areLightsDirty) {\n              var o = this.light;\n              i.setValue(this._lightTypeDefineName, !!(o && o instanceof Ls));\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);\n            var n = this.direction, i = this.color, o = this.intensity;\n            return this._lightDataUniformName = e._getFreeVariableName(\"lightData\"), this._lightColorUniformName = e._getFreeVariableName(\"lightColor\"), this._lightTypeDefineName = e._getFreeDefineName(\"LIGHTPOINTTYPE\"), e._emitUniformFromString(this._lightDataUniformName, \"vec3\"), e._emitUniformFromString(this._lightColorUniformName, \"vec4\"), e.compilationString += \"#ifdef \" + this._lightTypeDefineName + `\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = normalize(\" + this.worldPosition.associatedVariableName + \".xyz - \" + this._lightDataUniformName + `);\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = \" + this._lightDataUniformName + `;\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += this._declareOutput(i, e) + \" = \" + this._lightColorUniformName + `.rgb;\\r\n`, e.compilationString += this._declareOutput(o, e) + \" = \" + this._lightColorUniformName + `.a;\\r\n`, this;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.light && (e.lightId = this.light.id), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.lightId && (this.light = n.getLightByID(e.lightId));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LightInformationBlock\"] = $u;\n        var eh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerInput(\"color\", le.Color4), n.registerOutput(\"output\", le.Color4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ImageProcessingBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"exposureLinear\"), e._excludeVariableName(\"contrast\"), e._excludeVariableName(\"vInverseScreenSize\"), e._excludeVariableName(\"vignetteSettings1\"), e._excludeVariableName(\"vignetteSettings2\"), e._excludeVariableName(\"vCameraColorCurveNegative\"), e._excludeVariableName(\"vCameraColorCurveNeutral\"), e._excludeVariableName(\"vCameraColorCurvePositive\"), e._excludeVariableName(\"txColorTransform\"), e._excludeVariableName(\"colorTransformSettings\");\n          }, t.prototype.isReady = function(e, n, i) {\n            return !(i._areImageProcessingDirty && n.imageProcessingConfiguration && !n.imageProcessingConfiguration.isReady());\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i._areImageProcessingDirty && n.imageProcessingConfiguration && n.imageProcessingConfiguration.prepareDefines(i);\n          }, t.prototype.bind = function(e, n, i) {\n            i && n.imageProcessingConfiguration && n.imageProcessingConfiguration.bind(e);\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e), e.sharedData.blocksWithDefines.push(this), e.sharedData.blockingBlocks.push(this), e.sharedData.bindableBlocks.push(this), e.uniforms.push(\"exposureLinear\"), e.uniforms.push(\"contrast\"), e.uniforms.push(\"vInverseScreenSize\"), e.uniforms.push(\"vignetteSettings1\"), e.uniforms.push(\"vignetteSettings2\"), e.uniforms.push(\"vCameraColorCurveNegative\"), e.uniforms.push(\"vCameraColorCurveNeutral\"), e.uniforms.push(\"vCameraColorCurvePositive\"), e.uniforms.push(\"txColorTransform\"), e.uniforms.push(\"colorTransformSettings\");\n            var n = this.color, i = this._outputs[0], o = \"//\" + this.name;\n            return e._emitFunctionFromInclude(\"helperFunctions\", o), e._emitFunctionFromInclude(\"imageProcessingDeclaration\", o), e._emitFunctionFromInclude(\"imageProcessingFunctions\", o), n.connectedPoint.type === le.Color4 || n.connectedPoint.type === le.Vector4 ? e.compilationString += this._declareOutput(i, e) + \" = \" + n.associatedVariableName + `;\\r\n` : e.compilationString += this._declareOutput(i, e) + \" = vec4(\" + n.associatedVariableName + `, 1.0);\\r\n`, e.compilationString += `#ifdef IMAGEPROCESSINGPOSTPROCESS\\r\n`, e.compilationString += i.associatedVariableName + \".rgb = toLinearSpace(\" + n.associatedVariableName + `.rgb);\\r\n`, e.compilationString += `#else\\r\n`, e.compilationString += `#ifdef IMAGEPROCESSING\\r\n`, e.compilationString += i.associatedVariableName + \".rgb = toLinearSpace(\" + n.associatedVariableName + `.rgb);\\r\n`, e.compilationString += i.associatedVariableName + \" = applyImageProcessing(\" + i.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += `#endif\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ImageProcessingBlock\"] = eh;\n        var th = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._tangentSpaceParameterName = \"\", n.invertX = !1, n.invertY = !1, n.registerInput(\"worldPosition\", le.Vector4, !1), n.registerInput(\"worldNormal\", le.Vector4, !1), n.registerInput(\"worldTangent\", le.Vector4, !0), n.registerInput(\"uv\", le.Vector2, !1), n.registerInput(\"normalMapColor\", le.Color3, !1), n.registerInput(\"strength\", le.Float, !1), n.registerOutput(\"output\", le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PerturbNormalBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldTangent\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalMapColor\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"strength\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(\"BUMP\", !0);\n          }, t.prototype.bind = function(e, n, i) {\n            n.getScene()._mirroredCameraPosition ? e.setFloat2(this._tangentSpaceParameterName, this.invertX ? 1 : -1, this.invertY ? 1 : -1) : e.setFloat2(this._tangentSpaceParameterName, this.invertX ? -1 : 1, this.invertY ? -1 : 1);\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.uv.isConnected) {\n              var n = e.getInputBlockByPredicate(function(o) {\n                return o.isAttribute && o.name === \"uv\";\n              });\n              n || (n = new Et(\"uv\")).setAsAttribute(), n.output.connectTo(this.uv);\n            }\n            if (!this.strength.isConnected) {\n              var i = new Et(\"strength\");\n              i.value = 1, i.output.connectTo(this.strength);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = \"//\" + this.name, i = this.uv, o = this.worldPosition, a = this.worldNormal, s = this.worldTangent;\n            e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._tangentSpaceParameterName = e._getFreeDefineName(\"tangentSpaceParameter\"), e._emitUniformFromString(this._tangentSpaceParameterName, \"vec2\");\n            var d = this.strength.isConnectedToInputBlock && this.strength.connectInputBlock.isConstant ? \"\" + e._emitFloat(1 / this.strength.connectInputBlock.value) : \"1.0 / \" + this.strength.associatedVariableName;\n            e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\n            var p = { search: /defined\\(TANGENT\\)/g, replace: s.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\n            return s.isConnected && (e.compilationString += \"vec3 tbnNormal = normalize(\" + a.associatedVariableName + `.xyz);\\r\n`, e.compilationString += \"vec3 tbnTangent = normalize(\" + s.associatedVariableName + `.xyz);\\r\n`, e.compilationString += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\n`, e.compilationString += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\n`), e._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", n, { replaceStrings: [p] }), e._emitFunctionFromInclude(\"bumpFragmentFunctions\", n, { replaceStrings: [{ search: /vBumpInfos.y/g, replace: d }, { search: /vTangentSpaceParams/g, replace: this._tangentSpaceParameterName }, { search: /vPositionW/g, replace: o.associatedVariableName + \".xyz\" }] }), e.compilationString += this._declareOutput(this.output, e) + ` = vec4(0.);\\r\n`, e.compilationString += e._emitCodeFromInclude(\"bumpFragment\", n, { replaceStrings: [{ search: /perturbNormal\\(TBN,vBumpUV\\+uvOffset\\)/g, replace: \"perturbNormal(TBN, \" + this.normalMapColor.associatedVariableName + \")\" }, { search: /vBumpInfos.y/g, replace: d }, { search: /vBumpUV/g, replace: i.associatedVariableName }, { search: /vPositionW/g, replace: o.associatedVariableName + \".xyz\" }, { search: /normalW=/g, replace: this.output.associatedVariableName + \".xyz = \" }, { search: /mat3\\(normalMatrix\\)\\*normalW/g, replace: \"mat3(normalMatrix) * \" + this.output.associatedVariableName + \".xyz\" }, { search: /normalW/g, replace: a.associatedVariableName + \".xyz\" }, p] }), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".invertX = \" + this.invertX + `;\\r\n`;\n            return e += this._codeVariableName + \".invertY = \" + this.invertY + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.invertX = this.invertX, e.invertY = this.invertY, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.invertX = e.invertX, this.invertY = e.invertY;\n          }, Object(c.c)([Bt(\"Invert X axis\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !1 } })], t.prototype, \"invertX\", void 0), Object(c.c)([Bt(\"Invert Y axis\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !1 } })], t.prototype, \"invertY\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PerturbNormalBlock\"] = th;\n        var nh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment, !0) || this;\n            return n.registerInput(\"value\", le.Float, !0), n.registerInput(\"cutoff\", le.Float, !0), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DiscardBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cutoff\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.sharedData.hints.needAlphaTesting = !0, this.cutoff.isConnected && this.value.isConnected)\n              return e.compilationString += \"if (\" + this.value.associatedVariableName + \" < \" + this.cutoff.associatedVariableName + `) discard;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DiscardBlock\"] = nh;\n        var ih = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerOutput(\"output\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FrontFacingBlock\";\n          }, Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Vertex)\n              throw \"FrontFacingBlock must only be used in a fragment shader\";\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + ` = gl_FrontFacing ? 1.0 : 0.0;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FrontFacingBlock\"] = ih;\n        var rh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerInput(\"input\", le.AutoDetect, !1), n.registerOutput(\"dx\", le.BasedOnInput), n.registerOutput(\"dy\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._outputs[1]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DerivativeBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dx\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dy\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this._outputs[1];\n            return e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\"), n.hasEndpoints && (e.compilationString += this._declareOutput(n, e) + \" = dFdx(\" + this.input.associatedVariableName + `);\\r\n`), i.hasEndpoints && (e.compilationString += this._declareOutput(i, e) + \" = dFdy(\" + this.input.associatedVariableName + `);\\r\n`), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DerivativeBlock\"] = rh;\n        var oh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerOutput(\"xy\", le.Vector2, Ce.Fragment), n.registerOutput(\"xyz\", le.Vector3, Ce.Fragment), n.registerOutput(\"xyzw\", le.Vector4, Ce.Fragment), n.registerOutput(\"x\", le.Float, Ce.Fragment), n.registerOutput(\"y\", le.Float, Ce.Fragment), n.registerOutput(\"z\", le.Float, Ce.Fragment), n.registerOutput(\"w\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FragCoordBlock\";\n          }, Object.defineProperty(t.prototype, \"xy\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyz\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzw\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"z\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[6];\n          }, enumerable: !1, configurable: !0 }), t.prototype.writeOutputs = function(e) {\n            for (var n = \"\", i = 0, o = this._outputs; i < o.length; i++) {\n              var a = o[i];\n              a.hasEndpoints && (n += this._declareOutput(a, e) + \" = gl_FragCoord.\" + a.name + `;\\r\n`);\n            }\n            return n;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Vertex)\n              throw \"FragCoordBlock must only be used in a fragment shader\";\n            return e.compilationString += this.writeOutputs(e), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FragCoordBlock\"] = oh;\n        var ah = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.registerOutput(\"xy\", le.Vector2, Ce.Fragment), n.registerOutput(\"x\", le.Float, Ce.Fragment), n.registerOutput(\"y\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScreenSizeBlock\";\n          }, Object.defineProperty(t.prototype, \"xy\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype.bind = function(e, n, i) {\n            var o = this._scene.getEngine();\n            e.setFloat2(this._varName, o.getRenderWidth(), o.getRenderWidth());\n          }, t.prototype.writeOutputs = function(e, n) {\n            for (var i = \"\", o = 0, a = this._outputs; o < a.length; o++) {\n              var s = a[o];\n              s.hasEndpoints && (i += this._declareOutput(s, e) + \" = \" + n + \".\" + s.name + `;\\r\n`);\n            }\n            return i;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this._scene = e.sharedData.scene, e.target === Ce.Vertex)\n              throw \"ScreenSizeBlock must only be used in a fragment shader\";\n            return e.sharedData.bindableBlocks.push(this), this._varName = e._getFreeVariableName(\"screenSize\"), e._emitUniformFromString(this._varName, \"vec2\"), e.compilationString += this.writeOutputs(e, this._varName), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ScreenSizeBlock\"] = ah;\n        var sh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment, !0) || this;\n            return n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"view\", le.Matrix, !1, Ce.Vertex), n.registerInput(\"input\", le.Color3, !1, Ce.Fragment), n.registerInput(\"fogColor\", le.Color3, !1, Ce.Fragment), n.registerOutput(\"output\", le.Color3, Ce.Fragment), n.input.acceptedConnectionPointTypes.push(le.Color4), n.fogColor.acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FogBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fogColor\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.view.isConnected) {\n              var n = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.View;\n              });\n              n || (n = new Et(\"view\")).setAsSystemValue(gt.View), n.output.connectTo(this.view);\n            }\n            if (!this.fogColor.isConnected) {\n              var i = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.FogColor;\n              });\n              i || (i = new Et(\"fogColor\", void 0, le.Color3)).setAsSystemValue(gt.FogColor), i.output.connectTo(this.fogColor);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            var o = e.getScene();\n            i.setValue(\"FOG\", n.fogEnabled && $e.a.GetFogState(e, o));\n          }, t.prototype.bind = function(e, n, i) {\n            if (i) {\n              var o = i.getScene();\n              e.setFloat4(this._fogParameters, o.fogMode, o.fogStart, o.fogEnd, o.fogDensity);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Fragment) {\n              e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), e._emitFunctionFromInclude(\"fogFragmentDeclaration\", \"//\" + this.name, { removeUniforms: !0, removeVaryings: !0, removeIfDef: !1, replaceStrings: [{ search: /float CalcFogFactor\\(\\)/, replace: \"float CalcFogFactor(vec3 vFogDistance, vec4 vFogInfos)\" }] });\n              var n = e._getFreeVariableName(\"fog\"), i = this.input, o = this.fogColor;\n              this._fogParameters = e._getFreeVariableName(\"fogParameters\");\n              var a = this._outputs[0];\n              e._emitUniformFromString(this._fogParameters, \"vec4\"), e.compilationString += `#ifdef FOG\\r\n`, e.compilationString += \"float \" + n + \" = CalcFogFactor(\" + this._fogDistanceName + \", \" + this._fogParameters + `);\\r\n`, e.compilationString += this._declareOutput(a, e) + \" = \" + n + \" * \" + i.associatedVariableName + \".rgb + (1.0 - \" + n + \") * \" + o.associatedVariableName + `.rgb;\\r\n`, e.compilationString += `#else\\r\n` + this._declareOutput(a, e) + \" =  \" + i.associatedVariableName + `.rgb;\\r\n`, e.compilationString += `#endif\\r\n`;\n            } else {\n              var s = this.worldPosition, d = this.view;\n              this._fogDistanceName = e._getFreeVariableName(\"vFogDistance\"), e._emitVaryingFromString(this._fogDistanceName, \"vec3\"), e.compilationString += this._fogDistanceName + \" = (\" + d.associatedVariableName + \" * \" + s.associatedVariableName + `).xyz;\\r\n`;\n            }\n            return this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FogBlock\"] = sh;\n        var ch = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment) || this;\n            return n._isUnique = !0, n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"worldNormal\", le.Vector4, !1, Ce.Fragment), n.registerInput(\"cameraPosition\", le.Vector3, !1, Ce.Fragment), n.registerInput(\"glossiness\", le.Float, !0, Ce.Fragment), n.registerInput(\"glossPower\", le.Float, !0, Ce.Fragment), n.registerInput(\"diffuseColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"specularColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"view\", le.Matrix, !0), n.registerOutput(\"diffuseOutput\", le.Color3, Ce.Fragment), n.registerOutput(\"specularOutput\", le.Color3, Ce.Fragment), n.registerOutput(\"shadow\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LightBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glossiness\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glossPower\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseColor\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularColor\", { get: function() {\n            return this._inputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseOutput\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularOutput\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadow\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areLightsDirty) {\n              var o = e.getScene();\n              if (this.light) {\n                var a = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };\n                $e.a.PrepareDefinesForLight(o, e, this.light, this._lightId, i, !0, a), a.needRebuild && i.rebuild();\n              } else\n                $e.a.PrepareDefinesForLights(o, e, i, !0, n.maxSimultaneousLights);\n            }\n          }, t.prototype.updateUniformsAndSamples = function(e, n, i, o) {\n            for (var a = 0; a < n.maxSimultaneousLights && i[\"LIGHT\" + a]; a++) {\n              var s = e.uniforms.indexOf(\"vLightData\" + a) >= 0;\n              $e.a.PrepareUniformsAndSamplersForLight(a, e.uniforms, e.samplers, i[\"PROJECTEDLIGHTTEXTURE\" + a], o, s);\n            }\n          }, t.prototype.bind = function(e, n, i) {\n            if (i) {\n              var o = i.getScene();\n              this.light ? $e.a.BindLight(this.light, this._lightId, o, e, !0) : $e.a.BindLights(o, i, e, !0, n.maxSimultaneousLights);\n            }\n          }, t.prototype._injectVertexCode = function(e) {\n            var n = this.worldPosition, i = \"//\" + this.name;\n            this.light ? (this._lightId = (e.counters.lightCounter !== void 0 ? e.counters.lightCounter : -1) + 1, e.counters.lightCounter = this._lightId, e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", i, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString())) : (e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", i, { repeatKey: \"maxSimultaneousLights\" }), this._lightId = 0, e.sharedData.dynamicUniformBlocks.push(this));\n            var o = \"v_\" + n.associatedVariableName;\n            e._emitVaryingFromString(o, \"vec4\") && (e.compilationString += o + \" = \" + n.associatedVariableName + `;\\r\n`), this.light ? e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", i, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, { search: /worldPos/g, replace: n.associatedVariableName }] }) : (e.compilationString += \"vec4 worldPos = \" + n.associatedVariableName + `;\\r\n`, this.view.isConnected && (e.compilationString += \"mat4 view = \" + this.view.associatedVariableName + `;\\r\n`), e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", i, { repeatKey: \"maxSimultaneousLights\" }));\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), e.target === Ce.Fragment) {\n              e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);\n              var n = \"//\" + this.name, i = this.worldPosition;\n              e._emitFunctionFromInclude(\"helperFunctions\", n), e._emitFunctionFromInclude(\"lightsFragmentFunctions\", n, { replaceStrings: [{ search: /vPositionW/g, replace: \"v_\" + i.associatedVariableName + \".xyz\" }] }), e._emitFunctionFromInclude(\"shadowsFragmentFunctions\", n, { replaceStrings: [{ search: /vPositionW/g, replace: \"v_\" + i.associatedVariableName + \".xyz\" }] }), this.light ? e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", n, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString()) : e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", n, { repeatKey: \"maxSimultaneousLights\" }), this._lightId === 0 && (e._registerTempVariable(\"viewDirectionW\") && (e.compilationString += \"vec3 viewDirectionW = normalize(\" + this.cameraPosition.associatedVariableName + \" - v_\" + i.associatedVariableName + `.xyz);\\r\n`), e.compilationString += `lightingInfo info;\\r\n`, e.compilationString += `float shadow = 1.;\\r\n`, e.compilationString += \"float glossiness = \" + (this.glossiness.isConnected ? this.glossiness.associatedVariableName : \"1.0\") + \" * \" + (this.glossPower.isConnected ? this.glossPower.associatedVariableName : \"1024.0\") + `;\\r\n`, e.compilationString += `vec3 diffuseBase = vec3(0., 0., 0.);\\r\n`, e.compilationString += `vec3 specularBase = vec3(0., 0., 0.);\\r\n`, e.compilationString += \"vec3 normalW = \" + this.worldNormal.associatedVariableName + `.xyz;\\r\n`), this.light ? e.compilationString += e._emitCodeFromInclude(\"lightFragment\", n, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }) : e.compilationString += e._emitCodeFromInclude(\"lightFragment\", n, { repeatKey: \"maxSimultaneousLights\" });\n              var o = this.diffuseOutput, a = this.specularOutput;\n              return e.compilationString += this._declareOutput(o, e) + \" = diffuseBase\" + (this.diffuseColor.isConnected ? \" * \" + this.diffuseColor.associatedVariableName : \"\") + `;\\r\n`, a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + \" = specularBase\" + (this.specularColor.isConnected ? \" * \" + this.specularColor.associatedVariableName : \"\") + `;\\r\n`), this.shadow.hasEndpoints && (e.compilationString += this._declareOutput(this.shadow, e) + ` = shadow;\\r\n`), this;\n            }\n            this._injectVertexCode(e);\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.light && (e.lightId = this.light.id), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.lightId && (this.light = n.getLightByID(e.lightId));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LightBlock\"] = ch;\n        var lh = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = !1);\n            var i = r.call(this, e, n ? Ce.Fragment : Ce.VertexAndFragment) || this;\n            return i.convertToGammaSpace = !1, i.convertToLinearSpace = !1, i._fragmentOnly = n, i.registerInput(\"uv\", le.Vector2, !1, Ce.VertexAndFragment), i.registerOutput(\"rgba\", le.Color4, Ce.Neutral), i.registerOutput(\"rgb\", le.Color3, Ce.Neutral), i.registerOutput(\"r\", le.Float, Ce.Neutral), i.registerOutput(\"g\", le.Float, Ce.Neutral), i.registerOutput(\"b\", le.Float, Ce.Neutral), i.registerOutput(\"a\", le.Float, Ce.Neutral), i._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), i._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), i._inputs[0]._prioritizeVertex = !n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TextureBlock\";\n          }, Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"target\", { get: function() {\n            if (this._fragmentOnly)\n              return Ce.Fragment;\n            if (!this.uv.isConnected || this.uv.sourceBlock.isInput)\n              return Ce.VertexAndFragment;\n            for (var e = this.uv.connectedPoint; e; ) {\n              if (e.target === Ce.Fragment)\n                return Ce.Fragment;\n              if (e.target === Ce.Vertex)\n                return Ce.VertexAndFragment;\n              if (e.target === Ce.Neutral || e.target === Ce.VertexAndFragment) {\n                var n = e.ownerBlock;\n                e = null;\n                for (var i = 0, o = n.inputs; i < o.length; i++) {\n                  var a = o[i];\n                  if (a.connectedPoint) {\n                    e = a.connectedPoint;\n                    break;\n                  }\n                }\n              }\n            }\n            return Ce.VertexAndFragment;\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.uv.isConnected)\n              if (e.mode === Rn.PostProcess)\n                (n = e.getBlockByPredicate(function(o) {\n                  return o.name === \"uv\";\n                })) && n.connectTo(this);\n              else {\n                var n, i = e.mode === Rn.Particle ? \"particle_uv\" : \"uv\";\n                (n = e.getInputBlockByPredicate(function(o) {\n                  return o.isAttribute && o.name === i;\n                })) || (n = new Et(\"uv\")).setAsAttribute(i), n.output.connectTo(this.uv);\n              }\n          }, t.prototype.initializeDefines = function(e, n, i, o) {\n            i._areTexturesDirty && i.setValue(this._mainUVDefineName, !1);\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areTexturesDirty) {\n              if (!this.texture || !this.texture.getTextureMatrix)\n                return i.setValue(this._defineName, !1), void i.setValue(this._mainUVDefineName, !0);\n              i.setValue(this._linearDefineName, this.convertToGammaSpace), i.setValue(this._gammaDefineName, this.convertToLinearSpace), this._isMixed && (this.texture.getTextureMatrix().isIdentityAs3x2() ? (i.setValue(this._defineName, !1), i.setValue(this._mainUVDefineName, !0)) : i.setValue(this._defineName, !0));\n            }\n          }, t.prototype.isReady = function() {\n            return !(this.texture && !this.texture.isReadyOrNotBlocking());\n          }, t.prototype.bind = function(e, n, i) {\n            this.texture && (this._isMixed && (e.setFloat(this._textureInfoName, this.texture.level), e.setMatrix(this._textureTransformName, this.texture.getTextureMatrix())), e.setTexture(this._samplerName, this.texture));\n          }, Object.defineProperty(t.prototype, \"_isMixed\", { get: function() {\n            return this.target !== Ce.Fragment;\n          }, enumerable: !1, configurable: !0 }), t.prototype._injectVertexCode = function(e) {\n            var n = this.uv;\n            if (this._defineName = e._getFreeDefineName(\"UVTRANSFORM\"), this._mainUVDefineName = \"VMAIN\" + n.associatedVariableName.toUpperCase(), n.connectedPoint.ownerBlock.isInput && (n.connectedPoint.ownerBlock.isAttribute || e._emitUniformFromString(n.associatedVariableName, \"vec2\")), this._mainUVName = \"vMain\" + n.associatedVariableName, this._transformedUVName = e._getFreeVariableName(\"transformedUV\"), this._textureTransformName = e._getFreeVariableName(\"textureTransform\"), this._textureInfoName = e._getFreeVariableName(\"textureInfoName\"), e._emitVaryingFromString(this._transformedUVName, \"vec2\", this._defineName), e._emitVaryingFromString(this._mainUVName, \"vec2\", this._mainUVDefineName), e._emitUniformFromString(this._textureTransformName, \"mat4\", this._defineName), e.compilationString += \"#ifdef \" + this._defineName + `\\r\n`, e.compilationString += this._transformedUVName + \" = vec2(\" + this._textureTransformName + \" * vec4(\" + n.associatedVariableName + `.xy, 1.0, 0.0));\\r\n`, e.compilationString += \"#elif defined(\" + this._mainUVDefineName + `)\\r\n`, e.compilationString += this._mainUVName + \" = \" + n.associatedVariableName + `.xy;\\r\n`, e.compilationString += `#endif\\r\n`, this._outputs.some(function(s) {\n              return s.isConnectedInVertexShader;\n            })) {\n              this._writeTextureRead(e, !0);\n              for (var i = 0, o = this._outputs; i < o.length; i++) {\n                var a = o[i];\n                a.hasEndpoints && this._writeOutput(e, a, a.name, !0);\n              }\n            }\n          }, t.prototype._writeTextureRead = function(e, n) {\n            n === void 0 && (n = !1);\n            var i = this.uv;\n            if (n) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n            } else\n              this.uv.ownerBlock.target !== Ce.Fragment ? (e.compilationString += \"#ifdef \" + this._defineName + `\\r\n`, e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this._transformedUVName + `);\\r\n`, e.compilationString += \"#elif defined(\" + this._mainUVDefineName + `)\\r\n`, e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + this._mainUVName + `);\\r\n`, e.compilationString += `#endif\\r\n`) : e.compilationString += \"vec4 \" + this._tempTextureRead + \" = texture2D(\" + this._samplerName + \", \" + i.associatedVariableName + `);\\r\n`;\n          }, t.prototype._writeOutput = function(e, n, i, o) {\n            if (o === void 0 && (o = !1), o) {\n              if (e.target === Ce.Fragment)\n                return;\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n            } else if (this.uv.ownerBlock.target !== Ce.Fragment) {\n              var a = \" * \" + this._textureInfoName;\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + a + `;\\r\n`, i !== \"a\" && (e.compilationString += \"#ifdef \" + this._linearDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toGammaSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`, e.compilationString += \"#ifdef \" + this._gammaDefineName + `\\r\n`, e.compilationString += n.associatedVariableName + \" = toLinearSpace(\" + n.associatedVariableName + `);\\r\n`, e.compilationString += `#endif\\r\n`);\n            } else\n              e.compilationString += this._declareOutput(n, e) + \" = \" + this._tempTextureRead + \".\" + i + `;\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), (e.target === Ce.Vertex || this._fragmentOnly) && (this._tempTextureRead = e._getFreeVariableName(\"tempTextureRead\")), (!this._isMixed && e.target === Ce.Fragment || this._isMixed && e.target === Ce.Vertex) && (this._samplerName = e._getFreeVariableName(this.name + \"Sampler\"), e._emit2DSampler(this._samplerName), e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this)), e.target === Ce.Fragment) {\n              if (this._outputs.some(function(s) {\n                return s.isConnectedInFragmentShader;\n              })) {\n                this._isMixed && e._emit2DSampler(this._samplerName), this._linearDefineName = e._getFreeDefineName(\"ISLINEAR\"), this._gammaDefineName = e._getFreeDefineName(\"ISGAMMA\");\n                var n = \"//\" + this.name;\n                e._emitFunctionFromInclude(\"helperFunctions\", n), this._isMixed && e._emitUniformFromString(this._textureInfoName, \"float\"), this._writeTextureRead(e);\n                for (var i = 0, o = this._outputs; i < o.length; i++) {\n                  var a = o[i];\n                  a.hasEndpoints && this._writeOutput(e, a, a.name);\n                }\n                return this;\n              }\n            } else\n              this._injectVertexCode(e);\n          }, t.prototype._dumpPropertiesCode = function() {\n            if (!this.texture)\n              return \"\";\n            var e = this._codeVariableName + '.texture = new BABYLON.Texture(\"' + this.texture.name + `\", null);\\r\n`;\n            return e += this._codeVariableName + \".texture.wrapU = \" + this.texture.wrapU + `;\\r\n`, e += this._codeVariableName + \".texture.wrapV = \" + this.texture.wrapV + `;\\r\n`, e += this._codeVariableName + \".texture.uAng = \" + this.texture.uAng + `;\\r\n`, e += this._codeVariableName + \".texture.vAng = \" + this.texture.vAng + `;\\r\n`, e += this._codeVariableName + \".texture.wAng = \" + this.texture.wAng + `;\\r\n`, e += this._codeVariableName + \".texture.uOffset = \" + this.texture.uOffset + `;\\r\n`, e += this._codeVariableName + \".texture.vOffset = \" + this.texture.vOffset + `;\\r\n`, e += this._codeVariableName + \".texture.uScale = \" + this.texture.uScale + `;\\r\n`, e += this._codeVariableName + \".texture.vScale = \" + this.texture.vScale + `;\\r\n`, e += this._codeVariableName + \".convertToGammaSpace = \" + this.convertToGammaSpace + `;\\r\n`, e += this._codeVariableName + \".convertToLinearSpace = \" + this.convertToLinearSpace + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.convertToGammaSpace = this.convertToGammaSpace, e.convertToLinearSpace = this.convertToLinearSpace, e.fragmentOnly = this._fragmentOnly, this.texture && !this.texture.isRenderTarget && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.convertToGammaSpace = e.convertToGammaSpace, this.convertToLinearSpace = !!e.convertToLinearSpace, this._fragmentOnly = !!e.fragmentOnly, e.texture && !sa.IgnoreTexturesAtLoadTime && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.TextureBlock\"] = lh;\n        var tc = function(r) {\n          function t(e) {\n            return r.call(this, e, Ce.VertexAndFragment) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectionTextureBaseBlock\";\n          }, t.prototype._getTexture = function() {\n            return this.texture;\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.position.isConnected) {\n              var n = e.getInputBlockByPredicate(function(a) {\n                return a.isAttribute && a.name === \"position\";\n              });\n              n || (n = new Et(\"position\")).setAsAttribute(), n.output.connectTo(this.position);\n            }\n            if (!this.world.isConnected) {\n              var i = e.getInputBlockByPredicate(function(a) {\n                return a.systemValue === gt.World;\n              });\n              i || (i = new Et(\"world\")).setAsSystemValue(gt.World), i.output.connectTo(this.world);\n            }\n            if (this.view && !this.view.isConnected) {\n              var o = e.getInputBlockByPredicate(function(a) {\n                return a.systemValue === gt.View;\n              });\n              o || (o = new Et(\"view\")).setAsSystemValue(gt.View), o.output.connectTo(this.view);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            if (i._areTexturesDirty) {\n              var o = this._getTexture();\n              o && o.getTextureMatrix && (i.setValue(this._define3DName, o.isCube, !0), i.setValue(this._defineLocalCubicName, !!o.boundingBoxSize, !0), i.setValue(this._defineExplicitName, o.coordinatesMode === h.a.TEXTURE_EXPLICIT_MODE, !0), i.setValue(this._defineSkyboxName, o.coordinatesMode === h.a.TEXTURE_SKYBOX_MODE, !0), i.setValue(this._defineCubicName, o.coordinatesMode === h.a.TEXTURE_CUBIC_MODE || o.coordinatesMode === h.a.TEXTURE_INVCUBIC_MODE, !0), i.setValue(\"INVERTCUBICMAP\", o.coordinatesMode === h.a.TEXTURE_INVCUBIC_MODE, !0), i.setValue(this._defineSphericalName, o.coordinatesMode === h.a.TEXTURE_SPHERICAL_MODE, !0), i.setValue(this._definePlanarName, o.coordinatesMode === h.a.TEXTURE_PLANAR_MODE, !0), i.setValue(this._defineProjectionName, o.coordinatesMode === h.a.TEXTURE_PROJECTION_MODE, !0), i.setValue(this._defineEquirectangularName, o.coordinatesMode === h.a.TEXTURE_EQUIRECTANGULAR_MODE, !0), i.setValue(this._defineEquirectangularFixedName, o.coordinatesMode === h.a.TEXTURE_FIXED_EQUIRECTANGULAR_MODE, !0), i.setValue(this._defineMirroredEquirectangularFixedName, o.coordinatesMode === h.a.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE, !0));\n            }\n          }, t.prototype.isReady = function() {\n            var e = this._getTexture();\n            return !(e && !e.isReadyOrNotBlocking());\n          }, t.prototype.bind = function(e, n, i) {\n            var o = this._getTexture();\n            i && o && (e.setMatrix(this._reflectionMatrixName, o.getReflectionTextureMatrix()), o.isCube ? e.setTexture(this._cubeSamplerName, o) : e.setTexture(this._2DSamplerName, o));\n          }, t.prototype.handleVertexSide = function(e) {\n            this._define3DName = e._getFreeDefineName(\"REFLECTIONMAP_3D\"), this._defineCubicName = e._getFreeDefineName(\"REFLECTIONMAP_CUBIC\"), this._defineSphericalName = e._getFreeDefineName(\"REFLECTIONMAP_SPHERICAL\"), this._definePlanarName = e._getFreeDefineName(\"REFLECTIONMAP_PLANAR\"), this._defineProjectionName = e._getFreeDefineName(\"REFLECTIONMAP_PROJECTION\"), this._defineExplicitName = e._getFreeDefineName(\"REFLECTIONMAP_EXPLICIT\"), this._defineEquirectangularName = e._getFreeDefineName(\"REFLECTIONMAP_EQUIRECTANGULAR\"), this._defineLocalCubicName = e._getFreeDefineName(\"USE_LOCAL_REFLECTIONMAP_CUBIC\"), this._defineMirroredEquirectangularFixedName = e._getFreeDefineName(\"REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\"), this._defineEquirectangularFixedName = e._getFreeDefineName(\"REFLECTIONMAP_EQUIRECTANGULAR_FIXED\"), this._defineSkyboxName = e._getFreeDefineName(\"REFLECTIONMAP_SKYBOX\"), this._defineOppositeZ = e._getFreeDefineName(\"REFLECTIONMAP_OPPOSITEZ\"), this._reflectionMatrixName = e._getFreeVariableName(\"reflectionMatrix\"), e._emitUniformFromString(this._reflectionMatrixName, \"mat4\");\n            var n = \"\", i = \"v_\" + this.worldPosition.associatedVariableName;\n            return e._emitVaryingFromString(i, \"vec4\") && (n += i + \" = \" + this.worldPosition.associatedVariableName + `;\\r\n`), this._positionUVWName = e._getFreeVariableName(\"positionUVW\"), this._directionWName = e._getFreeVariableName(\"directionW\"), e._emitVaryingFromString(this._positionUVWName, \"vec3\", this._defineSkyboxName) && (n += \"#ifdef \" + this._defineSkyboxName + `\\r\n`, n += this._positionUVWName + \" = \" + this.position.associatedVariableName + `.xyz;\\r\n`, n += `#endif\\r\n`), e._emitVaryingFromString(this._directionWName, \"vec3\", \"defined(\" + this._defineEquirectangularFixedName + \") || defined(\" + this._defineMirroredEquirectangularFixedName + \")\") && (n += \"#if defined(\" + this._defineEquirectangularFixedName + \") || defined(\" + this._defineMirroredEquirectangularFixedName + `)\\r\n`, n += this._directionWName + \" = normalize(vec3(\" + this.world.associatedVariableName + \" * vec4(\" + this.position.associatedVariableName + `.xyz, 0.0)));\\r\n`, n += `#endif\\r\n`), n;\n          }, t.prototype.handleFragmentSideInits = function(e) {\n            e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), this._cubeSamplerName = e._getFreeVariableName(this.name + \"CubeSampler\"), e.samplers.push(this._cubeSamplerName), this._2DSamplerName = e._getFreeVariableName(this.name + \"2DSampler\"), e.samplers.push(this._2DSamplerName), e._samplerDeclaration += \"#ifdef \" + this._define3DName + `\\r\n`, e._samplerDeclaration += \"uniform samplerCube \" + this._cubeSamplerName + `;\\r\n`, e._samplerDeclaration += `#else\\r\n`, e._samplerDeclaration += \"uniform sampler2D \" + this._2DSamplerName + `;\\r\n`, e._samplerDeclaration += `#endif\\r\n`, e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this);\n            var n = \"//\" + this.name;\n            e._emitFunction(\"ReciprocalPI\", \"#define RECIPROCAL_PI2 0.15915494\", \"\"), e._emitFunctionFromInclude(\"reflectionFunction\", n, { replaceStrings: [{ search: /vec3 computeReflectionCoords/g, replace: \"void DUMMYFUNC\" }] }), this._reflectionColorName = e._getFreeVariableName(\"reflectionColor\"), this._reflectionVectorName = e._getFreeVariableName(\"reflectionUVW\"), this._reflectionCoordsName = e._getFreeVariableName(\"reflectionCoords\");\n          }, t.prototype.handleFragmentSideCodeReflectionCoords = function(e, n, i) {\n            i === void 0 && (i = !1), n || (n = \"v_\" + this.worldPosition.associatedVariableName);\n            var o = this._reflectionMatrixName, a = \"normalize(\" + this._directionWName + \")\", s = \"\" + this._positionUVWName, d = \"\" + this.cameraPosition.associatedVariableName, p = \"\" + this.view.associatedVariableName;\n            e += \".xyz\";\n            var y = `\n            #ifdef ` + this._defineMirroredEquirectangularFixedName + `\n                vec3 ` + this._reflectionVectorName + \" = computeMirroredFixedEquirectangularCoords(\" + n + \", \" + e + \", \" + a + `);\n            #endif\n\n            #ifdef ` + this._defineEquirectangularFixedName + `\n                vec3 ` + this._reflectionVectorName + \" = computeFixedEquirectangularCoords(\" + n + \", \" + e + \", \" + a + `);\n            #endif\n\n            #ifdef ` + this._defineEquirectangularName + `\n                vec3 ` + this._reflectionVectorName + \" = computeEquirectangularCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineSphericalName + `\n                vec3 ` + this._reflectionVectorName + \" = computeSphericalCoords(\" + n + \", \" + e + \", \" + p + \", \" + o + `);\n            #endif\n\n            #ifdef ` + this._definePlanarName + `\n                vec3 ` + this._reflectionVectorName + \" = computePlanarCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineCubicName + `\n                #ifdef ` + this._defineLocalCubicName + `\n                    vec3 ` + this._reflectionVectorName + \" = computeCubicLocalCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `, vReflectionSize, vReflectionPosition);\n                #else\n                vec3 ` + this._reflectionVectorName + \" = computeCubicCoords(\" + n + \", \" + e + \", \" + d + \".xyz, \" + o + `);\n                #endif\n            #endif\n\n            #ifdef ` + this._defineProjectionName + `\n                vec3 ` + this._reflectionVectorName + \" = computeProjectionCoords(\" + n + \", \" + p + \", \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineSkyboxName + `\n                vec3 ` + this._reflectionVectorName + \" = computeSkyBoxCoords(\" + s + \", \" + o + `);\n            #endif\n\n            #ifdef ` + this._defineExplicitName + `\n                vec3 ` + this._reflectionVectorName + ` = vec3(0, 0, 0);\n            #endif\n\n            #ifdef ` + this._defineOppositeZ + `\n                ` + this._reflectionVectorName + `.z *= -1.0;\n            #endif\\r\n`;\n            return i || (y += `\n                #ifdef ` + this._define3DName + `\n                    vec3 ` + this._reflectionCoordsName + \" = \" + this._reflectionVectorName + `;\n                #else\n                    vec2 ` + this._reflectionCoordsName + \" = \" + this._reflectionVectorName + `.xy;\n                    #ifdef ` + this._defineProjectionName + `\n                        ` + this._reflectionCoordsName + \" /= \" + this._reflectionVectorName + `.z;\n                    #endif\n                    ` + this._reflectionCoordsName + \".y = 1.0 - \" + this._reflectionCoordsName + `.y;\n                #endif\\r\n`), y;\n          }, t.prototype.handleFragmentSideCodeReflectionColor = function(e, n) {\n            n === void 0 && (n = \".rgb\");\n            var i = \"vec\" + (n.length === 0 ? \"4\" : n.length - 1) + \" \" + this._reflectionColorName + `;\n            #ifdef ` + this._define3DName + `\\r\n`;\n            return i += e ? this._reflectionColorName + \" = textureCubeLodEXT(\" + this._cubeSamplerName + \", \" + this._reflectionVectorName + \", \" + e + \")\" + n + `;\\r\n` : this._reflectionColorName + \" = textureCube(\" + this._cubeSamplerName + \", \" + this._reflectionVectorName + \")\" + n + `;\\r\n`, i += `\n            #else\\r\n`, i += e ? this._reflectionColorName + \" = texture2DLodEXT(\" + this._2DSamplerName + \", \" + this._reflectionCoordsName + \", \" + e + \")\" + n + `;\\r\n` : this._reflectionColorName + \" = texture2D(\" + this._2DSamplerName + \", \" + this._reflectionCoordsName + \")\" + n + `;\\r\n`, i += `#endif\\r\n`;\n          }, t.prototype.writeOutputs = function(e, n) {\n            var i = \"\";\n            if (e.target === Ce.Fragment)\n              for (var o = 0, a = this._outputs; o < a.length; o++) {\n                var s = a[o];\n                s.hasEndpoints && (i += this._declareOutput(s, e) + \" = \" + n + \".\" + s.name + `;\\r\n`);\n              }\n            return i;\n          }, t.prototype._buildBlock = function(e) {\n            return r.prototype._buildBlock.call(this, e), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            return this.texture ? (e = this.texture.isCube ? this._codeVariableName + '.texture = new BABYLON.CubeTexture(\"' + this.texture.name + `\");\\r\n` : this._codeVariableName + '.texture = new BABYLON.Texture(\"' + this.texture.name + `\");\\r\n`, e += this._codeVariableName + \".texture.coordinatesMode = \" + this.texture.coordinatesMode + `;\\r\n`) : \"\";\n            var e;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.texture && (e.texture = this.texture.serialize()), e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, e.texture.isCube ? this.texture = ei.Parse(e.texture, n, i) : this.texture = Ne.a.Parse(e.texture, n, i));\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReflectionTextureBaseBlock\"] = tc;\n        var uh = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.registerInput(\"position\", le.Vector3, !1, Ce.Vertex), n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"worldNormal\", le.Vector4, !1, Ce.Fragment), n.registerInput(\"world\", le.Matrix, !1, Ce.Vertex), n.registerInput(\"cameraPosition\", le.Vector3, !1, Ce.Fragment), n.registerInput(\"view\", le.Matrix, !1, Ce.Fragment), n.registerOutput(\"rgb\", le.Color3, Ce.Fragment), n.registerOutput(\"rgba\", le.Color4, Ce.Fragment), n.registerOutput(\"r\", le.Float, Ce.Fragment), n.registerOutput(\"g\", le.Float, Ce.Fragment), n.registerOutput(\"b\", le.Float, Ce.Fragment), n.registerOutput(\"a\", le.Float, Ce.Fragment), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectionTextureBlock\";\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (r.prototype.autoConfigure.call(this, e), !this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), !this.texture)\n              return e.compilationString += this.writeOutputs(e, \"vec3(0.)\"), this;\n            if (e.target !== Ce.Fragment)\n              return e.compilationString += this.handleVertexSide(e), this;\n            this.handleFragmentSideInits(e);\n            var n = e._getFreeVariableName(\"normalWUnit\");\n            return e.compilationString += \"vec4 \" + n + \" = normalize(\" + this.worldNormal.associatedVariableName + `);\\r\n`, e.compilationString += this.handleFragmentSideCodeReflectionCoords(n), e.compilationString += this.handleFragmentSideCodeReflectionColor(void 0, \"\"), e.compilationString += this.writeOutputs(e, this._reflectionColorName), this;\n          }, t;\n        }(tc);\n        O.a.RegisteredTypes[\"BABYLON.ReflectionTextureBlock\"] = uh;\n        var hh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"AddBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" + \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.AddBlock\"] = hh;\n        var dh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerInput(\"factor\", le.Float), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScaleBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"factor\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.input.associatedVariableName + \" * \" + this.factor.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ScaleBlock\"] = dh;\n        var fh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.minimum = 0, n.maximum = 1, n.registerInput(\"value\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ClampBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = clamp(\" + this.value.associatedVariableName + \", \" + this._writeFloat(this.minimum) + \", \" + this._writeFloat(this.maximum) + `);\\r\n`, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = this._codeVariableName + \".minimum = \" + this.minimum + `;\\r\n`;\n            return e += this._codeVariableName + \".maximum = \" + this.maximum + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.minimum = this.minimum, e.maximum = this.maximum, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.minimum = e.minimum, this.maximum = e.maximum;\n          }, Object(c.c)([Bt(\"Minimum\", It.Float)], t.prototype, \"minimum\", void 0), Object(c.c)([Bt(\"Maximum\", It.Float)], t.prototype, \"maximum\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ClampBlock\"] = fh;\n        var ph = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.Vector3), n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[0].excludedConnectionPointTypes.push(le.Vector2), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"CrossBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = cross(\" + this.left.associatedVariableName + \".xyz, \" + this.right.associatedVariableName + `.xyz);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.CrossBlock\"] = ph;\n        var _h = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.Float), n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DotBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = dot(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DotBlock\"] = _h;\n        var mh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NormalizeBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this._inputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = normalize(\" + i.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NormalizeBlock\"] = mh;\n        var gh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"rgb \", le.Color3, !0), n.registerInput(\"r\", le.Float, !0), n.registerInput(\"g\", le.Float, !0), n.registerInput(\"b\", le.Float, !0), n.registerInput(\"a\", le.Float, !0), n.registerOutput(\"rgba\", le.Color4), n.registerOutput(\"rgb\", le.Color3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ColorMergerBlock\";\n          }, Object.defineProperty(t.prototype, \"rgbIn\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"r\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"g\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"b\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"a\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgba\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgbOut\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"rgb\", { get: function() {\n            return this.rgbOut;\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.r, i = this.g, o = this.b, a = this.a, s = this.rgbIn, d = this._outputs[0], p = this._outputs[1];\n            return s.isConnected ? d.hasEndpoints ? e.compilationString += this._declareOutput(d, e) + \" = vec4(\" + s.associatedVariableName + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : p.hasEndpoints && (e.compilationString += this._declareOutput(p, e) + \" = \" + s.associatedVariableName + `;\\r\n`) : d.hasEndpoints ? e.compilationString += this._declareOutput(d, e) + \" = vec4(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + \", \" + (a.isConnected ? this._writeVariable(a) : \"0.0\") + `);\\r\n` : p.hasEndpoints && (e.compilationString += this._declareOutput(p, e) + \" = vec3(\" + (n.isConnected ? this._writeVariable(n) : \"0.0\") + \", \" + (i.isConnected ? this._writeVariable(i) : \"0.0\") + \", \" + (o.isConnected ? this._writeVariable(o) : \"0.0\") + `);\\r\n`), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ColorMergerBlock\"] = gh;\n        var vh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"xyzw\", le.Vector4, !0), n.registerInput(\"xyz \", le.Vector3, !0), n.registerInput(\"xy \", le.Vector2, !0), n.registerOutput(\"xyz\", le.Vector3), n.registerOutput(\"xy\", le.Vector2), n.registerOutput(\"x\", le.Float), n.registerOutput(\"y\", le.Float), n.registerOutput(\"z\", le.Float), n.registerOutput(\"w\", le.Float), n.inputsAreExclusive = !0, n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"VectorSplitterBlock\";\n          }, Object.defineProperty(t.prototype, \"xyzw\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzIn\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyIn\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyzOut\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"xyOut\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"z\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"w\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), t.prototype._inputRename = function(e) {\n            switch (e) {\n              case \"xy \":\n                return \"xyIn\";\n              case \"xyz \":\n                return \"xyzIn\";\n              default:\n                return e;\n            }\n          }, t.prototype._outputRename = function(e) {\n            switch (e) {\n              case \"xy\":\n                return \"xyOut\";\n              case \"xyz\":\n                return \"xyzOut\";\n              default:\n                return e;\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn, i = this._outputs[0], o = this._outputs[1], a = this._outputs[2], s = this._outputs[3], d = this._outputs[4], p = this._outputs[5];\n            return i.hasEndpoints && (n === this.xyIn ? e.compilationString += this._declareOutput(i, e) + \" = vec3(\" + n.associatedVariableName + `, 0.0);\\r\n` : e.compilationString += this._declareOutput(i, e) + \" = \" + n.associatedVariableName + `.xyz;\\r\n`), o.hasEndpoints && (e.compilationString += this._declareOutput(o, e) + \" = \" + n.associatedVariableName + `.xy;\\r\n`), a.hasEndpoints && (e.compilationString += this._declareOutput(a, e) + \" = \" + n.associatedVariableName + `.x;\\r\n`), s.hasEndpoints && (e.compilationString += this._declareOutput(s, e) + \" = \" + n.associatedVariableName + `.y;\\r\n`), d.hasEndpoints && (e.compilationString += this._declareOutput(d, e) + \" = \" + n.associatedVariableName + `.z;\\r\n`), p.hasEndpoints && (e.compilationString += this._declareOutput(p, e) + \" = \" + n.associatedVariableName + `.w;\\r\n`), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.VectorSplitterBlock\"] = vh;\n        var yh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerInput(\"gradient\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._linkConnectionTypes(1, 2, !0), n._inputs[2].acceptedConnectionPointTypes.push(le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LerpBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"gradient\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = mix(\" + this.left.associatedVariableName + \" , \" + this.right.associatedVariableName + \", \" + this.gradient.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LerpBlock\"] = yh;\n        var bh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DivideBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" / \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DivideBlock\"] = bh;\n        var Th = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SubtractBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = \" + this.left.associatedVariableName + \" - \" + this.right.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SubtractBlock\"] = Th;\n        var Eh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.Float), n.registerInput(\"edge\", le.Float), n.registerOutput(\"output\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StepBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edge\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = step(\" + this.edge.associatedVariableName + \", \" + this.value.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.StepBlock\"] = Eh;\n        var nc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._outputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"OneMinusBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = 1. - \" + this.input.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.OneMinusBlock\"] = nc, O.a.RegisteredTypes[\"BABYLON.OppositeBlock\"] = nc;\n        var ic = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"worldPosition\", le.Vector4), n.registerInput(\"cameraPosition\", le.Vector3), n.registerOutput(\"output\", le.Vector3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ViewDirectionBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(i) {\n                return i.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = normalize(\" + this.cameraPosition.associatedVariableName + \" - \" + this.worldPosition.associatedVariableName + `.xyz);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ViewDirectionBlock\"] = ic, f(161);\n        var Sh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"worldNormal\", le.Vector4), n.registerInput(\"viewDirection\", le.Vector3), n.registerInput(\"bias\", le.Float), n.registerInput(\"power\", le.Float), n.registerOutput(\"fresnel\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FresnelBlock\";\n          }, Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"viewDirection\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bias\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"power\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fresnel\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.viewDirection.isConnected) {\n              var n = new ic(\"View direction\");\n              n.output.connectTo(this.viewDirection), n.autoConfigure(e);\n            }\n            if (!this.bias.isConnected) {\n              var i = new Et(\"bias\");\n              i.value = 0, i.output.connectTo(this.bias);\n            }\n            if (!this.power.isConnected) {\n              var o = new Et(\"power\");\n              o.value = 1, o.output.connectTo(this.power);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = \"//\" + this.name;\n            return e._emitFunctionFromInclude(\"fresnelFunction\", n, { removeIfDef: !0 }), e.compilationString += this._declareOutput(this.fresnel, e) + \" = computeFresnelTerm(\" + this.viewDirection.associatedVariableName + \".xyz, \" + this.worldNormal.associatedVariableName + \".xyz, \" + this.bias.associatedVariableName + \", \" + this.power.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.FresnelBlock\"] = Sh;\n        var Ah = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MaxBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = max(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MaxBlock\"] = Ah;\n        var Ph = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"MinBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = min(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.MinBlock\"] = Ph;\n        var xh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.Float), n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DistanceBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = length(\" + this.left.associatedVariableName + \" - \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DistanceBlock\"] = xh;\n        var Ch = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerOutput(\"output\", le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LengthBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = length(\" + this.value.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.LengthBlock\"] = Ch;\n        var Rh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NegateBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = -1.0 * \" + this.value.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NegateBlock\"] = Rh;\n        var Oh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"power\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PowBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"power\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = pow(\" + this.value.associatedVariableName + \", \" + this.power.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PowBlock\"] = Oh;\n        var Mh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"seed\", le.Vector2), n.registerOutput(\"output\", le.Float), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RandomNumberBlock\";\n          }, Object.defineProperty(t.prototype, \"seed\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = \"//\" + this.name;\n            return e._emitFunctionFromInclude(\"helperFunctions\", i), e.compilationString += this._declareOutput(n, e) + \" = getRand(\" + this.seed.associatedVariableName + `.xy);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RandomNumberBlock\"] = Mh;\n        var Ih = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"x\", le.Float), n.registerInput(\"y\", le.Float), n.registerOutput(\"output\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ArcTan2Block\";\n          }, Object.defineProperty(t.prototype, \"x\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"y\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = atan(\" + this.x.associatedVariableName + \", \" + this.y.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ArcTan2Block\"] = Ih;\n        var Dh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"edge0\", le.Float), n.registerInput(\"edge1\", le.Float), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SmoothStepBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edge0\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edge1\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = smoothstep(\" + this.edge0.associatedVariableName + \", \" + this.edge1.associatedVariableName + \", \" + this.value.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SmoothStepBlock\"] = Dh;\n        var Lh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._outputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReciprocalBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = 1. / \" + this.input.associatedVariableName + `;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReciprocalBlock\"] = Lh;\n        var Nh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"reference\", le.AutoDetect), n.registerInput(\"distance\", le.Float), n.registerInput(\"replacement\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._linkConnectionTypes(0, 3), n._inputs[0].excludedConnectionPointTypes.push(le.Float), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Float), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n._inputs[3].excludedConnectionPointTypes.push(le.Float), n._inputs[3].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReplaceColorBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reference\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"distance\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"replacement\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + `;\\r\n`, e.compilationString += \"if (length(\" + this.value.associatedVariableName + \" - \" + this.reference.associatedVariableName + \") < \" + this.distance.associatedVariableName + `) {\\r\n`, e.compilationString += n.associatedVariableName + \" = \" + this.replacement.associatedVariableName + `;\\r\n`, e.compilationString += `} else {\\r\n`, e.compilationString += n.associatedVariableName + \" = \" + this.value.associatedVariableName + `;\\r\n`, e.compilationString += `}\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReplaceColorBlock\"] = Nh;\n        var Zi, wh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"value\", le.AutoDetect), n.registerInput(\"steps\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n._inputs[1].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"PosterizeBlock\";\n          }, Object.defineProperty(t.prototype, \"value\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"steps\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = floor(\" + this.value.associatedVariableName + \" / (1.0 / \" + this.steps.associatedVariableName + \")) * (1.0 / \" + this.steps.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PosterizeBlock\"] = wh, function(r) {\n          r[r.SawTooth = 0] = \"SawTooth\", r[r.Square = 1] = \"Square\", r[r.Triangle = 2] = \"Triangle\";\n        }(Zi || (Zi = {}));\n        var Fh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.kind = Zi.SawTooth, n.registerInput(\"input\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._inputs[0].excludedConnectionPointTypes.push(le.Matrix), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"WaveBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            switch (this.kind) {\n              case Zi.SawTooth:\n                e.compilationString += this._declareOutput(n, e) + \" = \" + this.input.associatedVariableName + \" - floor(0.5 + \" + this.input.associatedVariableName + `);\\r\n`;\n                break;\n              case Zi.Square:\n                e.compilationString += this._declareOutput(n, e) + \" = 1.0 - 2.0 * round(fract(\" + this.input.associatedVariableName + `));\\r\n`;\n                break;\n              case Zi.Triangle:\n                e.compilationString += this._declareOutput(n, e) + \" = 2.0 * abs(2.0 * (\" + this.input.associatedVariableName + \" - floor(0.5 + \" + this.input.associatedVariableName + `))) - 1.0;\\r\n`;\n            }\n            return this;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.kind = this.kind, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.kind = e.kind;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.WaveBlock\"] = Fh;\n        var ca = function() {\n          function r(t, e) {\n            this.step = t, this.color = e;\n          }\n          return Object.defineProperty(r.prototype, \"step\", { get: function() {\n            return this._step;\n          }, set: function(t) {\n            this._step = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"color\", { get: function() {\n            return this._color;\n          }, set: function(t) {\n            this._color = t;\n          }, enumerable: !1, configurable: !0 }), r;\n        }(), Bh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.colorSteps = [new ca(0, I.a.Black()), new ca(1, I.a.White())], n.onValueChangedObservable = new C.c(), n.registerInput(\"gradient\", le.Float), n.registerOutput(\"output\", le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector2), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.colorStepsUpdated = function() {\n            this.onValueChangedObservable.notifyObservers(this);\n          }, t.prototype.getClassName = function() {\n            return \"GradientBlock\";\n          }, Object.defineProperty(t.prototype, \"gradient\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._writeColorConstant = function(e) {\n            var n = this.colorSteps[e];\n            return \"vec3(\" + n.color.r + \", \" + n.color.g + \", \" + n.color.b + \")\";\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            if (this.colorSteps.length && this.gradient.connectedPoint) {\n              var i = e._getFreeVariableName(\"gradientTempColor\"), o = e._getFreeVariableName(\"gradientTempPosition\");\n              e.compilationString += \"vec3 \" + i + \" = \" + this._writeColorConstant(0) + `;\\r\n`, e.compilationString += \"float \" + o + `;\\r\n`;\n              var a = this.gradient.associatedVariableName;\n              this.gradient.connectedPoint.type !== le.Float && (a += \".x\");\n              for (var s = 1; s < this.colorSteps.length; s++) {\n                var d = this.colorSteps[s], p = this.colorSteps[s - 1];\n                e.compilationString += o + \" = clamp((\" + a + \" - \" + e._emitFloat(p.step) + \") / (\" + e._emitFloat(d.step) + \" -  \" + e._emitFloat(p.step) + \"), 0.0, 1.0) * step(\" + e._emitFloat(s) + \", \" + e._emitFloat(this.colorSteps.length - 1) + `);\\r\n`, e.compilationString += i + \" = mix(\" + i + \", \" + this._writeColorConstant(s) + \", \" + o + `);\\r\n`;\n              }\n              return e.compilationString += this._declareOutput(n, e) + \" = \" + i + `;\\r\n`, this;\n            }\n            e.compilationString += this._declareOutput(n, e) + ` = vec3(0., 0., 0.);\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            e.colorSteps = [];\n            for (var n = 0, i = this.colorSteps; n < i.length; n++) {\n              var o = i[n];\n              e.colorSteps.push({ step: o.step, color: { r: o.color.r, g: o.color.g, b: o.color.b } });\n            }\n            return e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.colorSteps = [];\n            for (var o = 0, a = e.colorSteps; o < a.length; o++) {\n              var s = a[o];\n              this.colorSteps.push(new ca(s.step, new I.a(s.color.r, s.color.g, s.color.b)));\n            }\n          }, t.prototype._dumpPropertiesCode = function() {\n            for (var e = \"\", n = 0, i = this.colorSteps; n < i.length; n++) {\n              var o = i[n];\n              e += this._codeVariableName + \".colorSteps.push(new BABYLON.GradientBlockColorStep(\" + o.step + \", new BABYLON.Color3(\" + o.color.r + \", \" + o.color.g + \", \" + o.color.b + `)));\\r\n`;\n            }\n            return e;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.GradientBlock\"] = Bh;\n        var Uh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerInput(\"gradient\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n._linkConnectionTypes(1, 2, !0), n._inputs[2].acceptedConnectionPointTypes.push(le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NLerpBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"gradient\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = normalize(mix(\" + this.left.associatedVariableName + \" , \" + this.right.associatedVariableName + \", \" + this.gradient.associatedVariableName + `));\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NLerpBlock\"] = Uh;\n        var Vh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.manhattanDistance = !1, n.registerInput(\"seed\", le.Vector3), n.registerInput(\"jitter\", le.Float), n.registerOutput(\"output\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"WorleyNoise3DBlock\";\n          }, Object.defineProperty(t.prototype, \"seed\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"jitter\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this.seed.isConnected && this._outputs[0].hasEndpoints)\n              return e._emitFunction(\"worley3D\", `vec3 permute(vec3 x){\\r\n    return mod((34.0 * x + 1.0) * x, 289.0);\\r\n}\\r\n\\r\nvec3 dist(vec3 x, vec3 y, vec3 z,  bool manhattanDistance){\\r\n    return manhattanDistance ?  abs(x) + abs(y) + abs(z) :  (x * x + y * y + z * z);\\r\n}\\r\n\\r\nvec2 worley(vec3 P, float jitter, bool manhattanDistance){\\r\n    float K = 0.142857142857; // 1/7\\r\n    float Ko = 0.428571428571; // 1/2-K/2\\r\n    float  K2 = 0.020408163265306; // 1/(7*7)\\r\n    float Kz = 0.166666666667; // 1/6\\r\n    float Kzo = 0.416666666667; // 1/2-1/6*2\\r\n\\r\n    vec3 Pi = mod(floor(P), 289.0);\\r\n    vec3 Pf = fract(P) - 0.5;\\r\n\\r\n    vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0);\\r\n    vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0);\\r\n    vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0);\\r\n\\r\n    vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0));\\r\n    vec3 p1 = permute(p + Pi.y - 1.0);\\r\n    vec3 p2 = permute(p + Pi.y);\\r\n    vec3 p3 = permute(p + Pi.y + 1.0);\\r\n\\r\n    vec3 p11 = permute(p1 + Pi.z - 1.0);\\r\n    vec3 p12 = permute(p1 + Pi.z);\\r\n    vec3 p13 = permute(p1 + Pi.z + 1.0);\\r\n\\r\n    vec3 p21 = permute(p2 + Pi.z - 1.0);\\r\n    vec3 p22 = permute(p2 + Pi.z);\\r\n    vec3 p23 = permute(p2 + Pi.z + 1.0);\\r\n\\r\n    vec3 p31 = permute(p3 + Pi.z - 1.0);\\r\n    vec3 p32 = permute(p3 + Pi.z);\\r\n    vec3 p33 = permute(p3 + Pi.z + 1.0);\\r\n\\r\n    vec3 ox11 = fract(p11*K) - Ko;\\r\n    vec3 oy11 = mod(floor(p11*K), 7.0)*K - Ko;\\r\n    vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed\\r\n\\r\n    vec3 ox12 = fract(p12*K) - Ko;\\r\n    vec3 oy12 = mod(floor(p12*K), 7.0)*K - Ko;\\r\n    vec3 oz12 = floor(p12*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox13 = fract(p13*K) - Ko;\\r\n    vec3 oy13 = mod(floor(p13*K), 7.0)*K - Ko;\\r\n    vec3 oz13 = floor(p13*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox21 = fract(p21*K) - Ko;\\r\n    vec3 oy21 = mod(floor(p21*K), 7.0)*K - Ko;\\r\n    vec3 oz21 = floor(p21*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox22 = fract(p22*K) - Ko;\\r\n    vec3 oy22 = mod(floor(p22*K), 7.0)*K - Ko;\\r\n    vec3 oz22 = floor(p22*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox23 = fract(p23*K) - Ko;\\r\n    vec3 oy23 = mod(floor(p23*K), 7.0)*K - Ko;\\r\n    vec3 oz23 = floor(p23*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox31 = fract(p31*K) - Ko;\\r\n    vec3 oy31 = mod(floor(p31*K), 7.0)*K - Ko;\\r\n    vec3 oz31 = floor(p31*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox32 = fract(p32*K) - Ko;\\r\n    vec3 oy32 = mod(floor(p32*K), 7.0)*K - Ko;\\r\n    vec3 oz32 = floor(p32*K2)*Kz - Kzo;\\r\n\\r\n    vec3 ox33 = fract(p33*K) - Ko;\\r\n    vec3 oy33 = mod(floor(p33*K), 7.0)*K - Ko;\\r\n    vec3 oz33 = floor(p33*K2)*Kz - Kzo;\\r\n\\r\n    vec3 dx11 = Pfx + jitter*ox11;\\r\n    vec3 dy11 = Pfy.x + jitter*oy11;\\r\n    vec3 dz11 = Pfz.x + jitter*oz11;\\r\n\\r\n    vec3 dx12 = Pfx + jitter*ox12;\\r\n    vec3 dy12 = Pfy.x + jitter*oy12;\\r\n    vec3 dz12 = Pfz.y + jitter*oz12;\\r\n\\r\n    vec3 dx13 = Pfx + jitter*ox13;\\r\n    vec3 dy13 = Pfy.x + jitter*oy13;\\r\n    vec3 dz13 = Pfz.z + jitter*oz13;\\r\n\\r\n    vec3 dx21 = Pfx + jitter*ox21;\\r\n    vec3 dy21 = Pfy.y + jitter*oy21;\\r\n    vec3 dz21 = Pfz.x + jitter*oz21;\\r\n\\r\n    vec3 dx22 = Pfx + jitter*ox22;\\r\n    vec3 dy22 = Pfy.y + jitter*oy22;\\r\n    vec3 dz22 = Pfz.y + jitter*oz22;\\r\n\\r\n    vec3 dx23 = Pfx + jitter*ox23;\\r\n    vec3 dy23 = Pfy.y + jitter*oy23;\\r\n    vec3 dz23 = Pfz.z + jitter*oz23;\\r\n\\r\n    vec3 dx31 = Pfx + jitter*ox31;\\r\n    vec3 dy31 = Pfy.z + jitter*oy31;\\r\n    vec3 dz31 = Pfz.x + jitter*oz31;\\r\n\\r\n    vec3 dx32 = Pfx + jitter*ox32;\\r\n    vec3 dy32 = Pfy.z + jitter*oy32;\\r\n    vec3 dz32 = Pfz.y + jitter*oz32;\\r\n\\r\n    vec3 dx33 = Pfx + jitter*ox33;\\r\n    vec3 dy33 = Pfy.z + jitter*oy33;\\r\n    vec3 dz33 = Pfz.z + jitter*oz33;\\r\n\\r\n    vec3 d11 = dist(dx11, dy11, dz11, manhattanDistance);\\r\n    vec3 d12 =dist(dx12, dy12, dz12, manhattanDistance);\\r\n    vec3 d13 = dist(dx13, dy13, dz13, manhattanDistance);\\r\n    vec3 d21 = dist(dx21, dy21, dz21, manhattanDistance);\\r\n    vec3 d22 = dist(dx22, dy22, dz22, manhattanDistance);\\r\n    vec3 d23 = dist(dx23, dy23, dz23, manhattanDistance);\\r\n    vec3 d31 = dist(dx31, dy31, dz31, manhattanDistance);\\r\n    vec3 d32 = dist(dx32, dy32, dz32, manhattanDistance);\\r\n    vec3 d33 = dist(dx33, dy33, dz33, manhattanDistance);\\r\n\\r\n    vec3 d1a = min(d11, d12);\\r\n    d12 = max(d11, d12);\\r\n    d11 = min(d1a, d13); // Smallest now not in d12 or d13\\r\n    d13 = max(d1a, d13);\\r\n    d12 = min(d12, d13); // 2nd smallest now not in d13\\r\n    vec3 d2a = min(d21, d22);\\r\n    d22 = max(d21, d22);\\r\n    d21 = min(d2a, d23); // Smallest now not in d22 or d23\\r\n    d23 = max(d2a, d23);\\r\n    d22 = min(d22, d23); // 2nd smallest now not in d23\\r\n    vec3 d3a = min(d31, d32);\\r\n    d32 = max(d31, d32);\\r\n    d31 = min(d3a, d33); // Smallest now not in d32 or d33\\r\n    d33 = max(d3a, d33);\\r\n    d32 = min(d32, d33); // 2nd smallest now not in d33\\r\n    vec3 da = min(d11, d21);\\r\n    d21 = max(d11, d21);\\r\n    d11 = min(da, d31); // Smallest now in d11\\r\n    d31 = max(da, d31); // 2nd smallest now not in d31\\r\n    d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx;\\r\n    d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest\\r\n    d12 = min(d12, d21); // 2nd smallest now not in d21\\r\n    d12 = min(d12, d22); // nor in d22\\r\n    d12 = min(d12, d31); // nor in d31\\r\n    d12 = min(d12, d32); // nor in d32\\r\n    d11.yz = min(d11.yz,d12.xy); // nor in d12.yz\\r\n    d11.y = min(d11.y,d12.z); // Only two more to go\\r\n    d11.y = min(d11.y,d11.z); // Done! (Phew!)\\r\n    return sqrt(d11.xy); // F1, F2\\r\n}\\r\n\\r\n`, \"// Worley3D\"), e.compilationString += this._declareOutput(this._outputs[0], e) + \" = worley(\" + this.seed.associatedVariableName + \", \" + this.jitter.associatedVariableName + \", \" + this.manhattanDistance + `);\\r\n`, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            return this._codeVariableName + \".manhattanDistance = \" + this.manhattanDistance + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.manhattanDistance = this.manhattanDistance, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.manhattanDistance = e.manhattanDistance;\n          }, Object(c.c)([Bt(\"Use Manhattan Distance\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !1 } })], t.prototype, \"manhattanDistance\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.WorleyNoise3DBlock\"] = Vh;\n        var kh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"seed\", le.Vector3), n.registerOutput(\"output\", le.Float), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SimplexPerlin3DBlock\";\n          }, Object.defineProperty(t.prototype, \"seed\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            if (r.prototype._buildBlock.call(this, e), this.seed.isConnected && this._outputs[0].hasEndpoints)\n              return e._emitFunction(\"SimplexPerlin3D\", `const float SKEWFACTOR = 1.0/3.0;\\r\nconst float UNSKEWFACTOR = 1.0/6.0;\\r\nconst float SIMPLEX_CORNER_POS = 0.5;\\r\nconst float SIMPLEX_TETRAHADRON_HEIGHT = 0.70710678118654752440084436210485;\\r\nfloat SimplexPerlin3D( vec3 P ){\\r\n    P *= SIMPLEX_TETRAHADRON_HEIGHT;\\r\n    vec3 Pi = floor( P + dot( P, vec3( SKEWFACTOR) ) );    vec3 x0 = P - Pi + dot(Pi, vec3( UNSKEWFACTOR ) );\\r\n    vec3 g = step(x0.yzx, x0.xyz);\\r\n    vec3 l = 1.0 - g;\\r\n    vec3 Pi_1 = min( g.xyz, l.zxy );\\r\n    vec3 Pi_2 = max( g.xyz, l.zxy );\\r\n    vec3 x1 = x0 - Pi_1 + UNSKEWFACTOR;\\r\n    vec3 x2 = x0 - Pi_2 + SKEWFACTOR;\\r\n    vec3 x3 = x0 - SIMPLEX_CORNER_POS;\\r\n    vec4 v1234_x = vec4( x0.x, x1.x, x2.x, x3.x );\\r\n    vec4 v1234_y = vec4( x0.y, x1.y, x2.y, x3.y );\\r\n    vec4 v1234_z = vec4( x0.z, x1.z, x2.z, x3.z );\\r\n    Pi.xyz = Pi.xyz - floor(Pi.xyz * ( 1.0 / 69.0 )) * 69.0;\\r\n    vec3 Pi_inc1 = step( Pi, vec3( 69.0 - 1.5 ) ) * ( Pi + 1.0 );\\r\n    vec4 Pt = vec4( Pi.xy, Pi_inc1.xy ) + vec2( 50.0, 161.0 ).xyxy;\\r\n    Pt *= Pt;\\r\n    vec4 V1xy_V2xy = mix( Pt.xyxy, Pt.zwzw, vec4( Pi_1.xy, Pi_2.xy ) );\\r\n    Pt = vec4( Pt.x, V1xy_V2xy.xz, Pt.z ) * vec4( Pt.y, V1xy_V2xy.yw, Pt.w );\\r\n    const vec3 SOMELARGEFLOATS = vec3( 635.298681, 682.357502, 668.926525 );\\r\n    const vec3 ZINC = vec3( 48.500388, 65.294118, 63.934599 );\\r\n    vec3 lowz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi.zzz * ZINC.xyz ) );\\r\n    vec3 highz_mods = vec3( 1.0 / ( SOMELARGEFLOATS.xyz + Pi_inc1.zzz * ZINC.xyz ) );\\r\n    Pi_1 = ( Pi_1.z < 0.5 ) ? lowz_mods : highz_mods;\\r\n    Pi_2 = ( Pi_2.z < 0.5 ) ? lowz_mods : highz_mods;\\r\n    vec4 hash_0 = fract( Pt * vec4( lowz_mods.x, Pi_1.x, Pi_2.x, highz_mods.x ) ) - 0.49999;\\r\n    vec4 hash_1 = fract( Pt * vec4( lowz_mods.y, Pi_1.y, Pi_2.y, highz_mods.y ) ) - 0.49999;\\r\n    vec4 hash_2 = fract( Pt * vec4( lowz_mods.z, Pi_1.z, Pi_2.z, highz_mods.z ) ) - 0.49999;\\r\n    vec4 grad_results = inversesqrt( hash_0 * hash_0 + hash_1 * hash_1 + hash_2 * hash_2 ) * ( hash_0 * v1234_x + hash_1 * v1234_y + hash_2 * v1234_z );\\r\n    const float FINAL_NORMALIZATION = 37.837227241611314102871574478976;\\r\n    vec4 kernel_weights = v1234_x * v1234_x + v1234_y * v1234_y + v1234_z * v1234_z;\\r\n    kernel_weights = max(0.5 - kernel_weights, 0.0);\\r\n    kernel_weights = kernel_weights*kernel_weights*kernel_weights;\\r\n    return dot( kernel_weights, grad_results ) * FINAL_NORMALIZATION;\\r\n}\\r\n`, \"// SimplexPerlin3D\"), e.compilationString += this._declareOutput(this._outputs[0], e) + \" = SimplexPerlin3D(\" + this.seed.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SimplexPerlin3DBlock\"] = kh;\n        var Gh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"normalMap0\", le.Vector3), n.registerInput(\"normalMap1\", le.Vector3), n.registerOutput(\"output\", le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[1].acceptedConnectionPointTypes.push(le.Color3), n._inputs[1].acceptedConnectionPointTypes.push(le.Color4), n._inputs[1].acceptedConnectionPointTypes.push(le.Vector4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"NormalBlendBlock\";\n          }, Object.defineProperty(t.prototype, \"normalMap0\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalMap1\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this._inputs[0], o = this._inputs[1], a = e._getFreeVariableName(\"stepR\"), s = e._getFreeVariableName(\"stepG\");\n            return e.compilationString += \"float \" + a + \" = step(0.5, \" + i.associatedVariableName + `.r);\\r\n`, e.compilationString += \"float \" + s + \" = step(0.5, \" + i.associatedVariableName + `.g);\\r\n`, e.compilationString += this._declareOutput(n, e) + `;\\r\n`, e.compilationString += n.associatedVariableName + \".r = (1.0 - \" + a + \") * \" + i.associatedVariableName + \".r * \" + o.associatedVariableName + \".r * 2.0 + \" + a + \" * (1.0 - \" + i.associatedVariableName + \".r) * (1.0 - \" + o.associatedVariableName + `.r) * 2.0;\\r\n`, e.compilationString += n.associatedVariableName + \".g = (1.0 - \" + s + \") * \" + i.associatedVariableName + \".g * \" + o.associatedVariableName + \".g * 2.0 + \" + s + \" * (1.0 - \" + i.associatedVariableName + \".g) * (1.0 - \" + o.associatedVariableName + `.g) * 2.0;\\r\n`, e.compilationString += n.associatedVariableName + \".b = \" + i.associatedVariableName + \".b * \" + o.associatedVariableName + `.b;\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.NormalBlendBlock\"] = Gh;\n        var zh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"input\", le.Vector2), n.registerInput(\"angle\", le.Float), n.registerOutput(\"output\", le.Vector2), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"Rotate2dBlock\";\n          }, Object.defineProperty(t.prototype, \"input\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"angle\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.angle.isConnected) {\n              var n = new Et(\"angle\");\n              n.value = 0, n.output.connectTo(this.angle);\n            }\n          }, t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this.angle, o = this.input;\n            return e.compilationString += this._declareOutput(n, e) + \" = vec2(cos(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + \".x - sin(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + \".y, sin(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + \".x + cos(\" + i.associatedVariableName + \") * \" + o.associatedVariableName + `.y);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.Rotate2dBlock\"] = zh;\n        var jh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"incident\", le.Vector3), n.registerInput(\"normal\", le.Vector3), n.registerOutput(\"output\", le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n._inputs[1].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[1].acceptedConnectionPointTypes.push(le.Color3), n._inputs[1].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectBlock\";\n          }, Object.defineProperty(t.prototype, \"incident\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = reflect(\" + this.incident.associatedVariableName + \".xyz, \" + this.normal.associatedVariableName + `.xyz);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ReflectBlock\"] = jh;\n        var Hh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"incident\", le.Vector3), n.registerInput(\"normal\", le.Vector3), n.registerInput(\"ior\", le.Float), n.registerOutput(\"output\", le.Vector3), n._inputs[0].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[0].acceptedConnectionPointTypes.push(le.Color3), n._inputs[0].acceptedConnectionPointTypes.push(le.Color4), n._inputs[1].acceptedConnectionPointTypes.push(le.Vector4), n._inputs[1].acceptedConnectionPointTypes.push(le.Color3), n._inputs[1].acceptedConnectionPointTypes.push(le.Color4), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RefractBlock\";\n          }, Object.defineProperty(t.prototype, \"incident\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ior\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = refract(\" + this.incident.associatedVariableName + \".xyz, \" + this.normal.associatedVariableName + \".xyz, \" + this.ior.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RefractBlock\"] = Hh;\n        var Wh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"color\", le.Color3), n.registerInput(\"level\", le.Float), n.registerOutput(\"output\", le.Color3), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DesaturateBlock\";\n          }, Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"level\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0], i = this.color.associatedVariableName, o = e._getFreeVariableName(\"colorMin\"), a = e._getFreeVariableName(\"colorMax\"), s = e._getFreeVariableName(\"colorMerge\");\n            return e.compilationString += \"float \" + o + \" = min(min(\" + i + \".x, \" + i + \".y), \" + i + `.z);\\r\n`, e.compilationString += \"float \" + a + \" = max(max(\" + i + \".x, \" + i + \".y), \" + i + `.z);\\r\n`, e.compilationString += \"float \" + s + \" = 0.5 * (\" + o + \" + \" + a + `);\\r\n`, e.compilationString += this._declareOutput(n, e) + \" = mix(\" + i + \", vec3(\" + s + \", \" + s + \", \" + s + \"), \" + this.level.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.DesaturateBlock\"] = Wh;\n        var Xn = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, n, i) || this;\n            return d._blockType = o, d._blockName = a, d._nameForCheking = s, d._nameForCheking || (d._nameForCheking = e), d.needDualDirectionValidation = !0, d;\n          }\n          return Object(c.d)(t, r), t.prototype.checkCompatibilityState = function(e) {\n            return e instanceof t && e.name === this._nameForCheking ? ii.Compatible : ii.TypeIncompatible;\n          }, t.prototype.createCustomInputBlock = function() {\n            return [new this._blockType(this._blockName), this.name];\n          }, t;\n        }(na), rc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.albedoScaling = !1, n.linkSheenWithAlbedo = !1, n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !0, Ce.Fragment), n.registerInput(\"color\", le.Color3, !0, Ce.Fragment), n.registerInput(\"roughness\", le.Float, !0, Ce.Fragment), n.registerOutput(\"sheen\", le.Object, Ce.Fragment, new Xn(\"sheen\", n, yn.Output, t, \"SheenBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"sheenOut\"), e._excludeVariableName(\"sheenMapData\"), e._excludeVariableName(\"vSheenColor\"), e._excludeVariableName(\"vSheenRoughness\");\n          }, t.prototype.getClassName = function() {\n            return \"SheenBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"roughness\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheen\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i), i.setValue(\"SHEEN\", !0), i.setValue(\"SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE\", !0, !0), i.setValue(\"SHEEN_LINKWITHALBEDO\", this.linkSheenWithAlbedo, !0), i.setValue(\"SHEEN_ROUGHNESS\", this.roughness.isConnected, !0), i.setValue(\"SHEEN_ALBEDOSCALING\", this.albedoScaling, !0);\n          }, t.prototype.getCode = function(e) {\n            return `#ifdef SHEEN\n            sheenOutParams sheenOut;\n\n            vec4 vSheenColor = vec4(` + (this.color.isConnected ? this.color.associatedVariableName : \"vec3(1.)\") + \", \" + (this.intensity.isConnected ? this.intensity.associatedVariableName : \"1.\") + `);\n\n            sheenBlock(\n                vSheenColor,\n            #ifdef SHEEN_ROUGHNESS\n                ` + (this.roughness.isConnected ? this.roughness.associatedVariableName : \"0.\") + `,\n            #endif\n                roughness,\n            #ifdef SHEEN_TEXTURE\n                vec4(0.),\n            #endif\n                reflectance,\n            #ifdef SHEEN_LINKWITHALBEDO\n                baseColor,\n                surfaceAlbedo,\n            #endif\n            #ifdef ENVIRONMENTBRDF\n                NdotV,\n                environmentBrdf,\n            #endif\n            #if defined(REFLECTION) && defined(ENVIRONMENTBRDF)\n                AARoughnessFactors,\n                ` + (e == null ? void 0 : e._vReflectionMicrosurfaceInfosName) + `,\n                ` + (e == null ? void 0 : e._vReflectionInfosName) + `,\n                ` + (e == null ? void 0 : e.reflectionColor) + `,\n                vLightingIntensity,\n                #ifdef ` + (e == null ? void 0 : e._define3DName) + `\n                    ` + (e == null ? void 0 : e._cubeSamplerName) + `,\n                #else\n                    ` + (e == null ? void 0 : e._2DSamplerName) + `,\n                #endif\n                reflectionOut.reflectionCoords,\n                NdotVUnclamped,\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef ` + (e == null ? void 0 : e._define3DName) + `\n                        ` + (e == null ? void 0 : e._cubeSamplerName) + `,\n                        ` + (e == null ? void 0 : e._cubeSamplerName) + `,\n                    #else\n                        ` + (e == null ? void 0 : e._2DSamplerName) + `,\n                        ` + (e == null ? void 0 : e._2DSamplerName) + `,\n                    #endif\n                #endif\n                #if !defined(` + (e == null ? void 0 : e._defineSkyboxName) + `) && defined(RADIANCEOCCLUSION)\n                    seo,\n                #endif\n                #if !defined(` + (e == null ? void 0 : e._defineSkyboxName) + \") && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(\" + (e == null ? void 0 : e._define3DName) + `)\n                    eho,\n                #endif\n            #endif\n                sheenOut\n            );\n\n            #ifdef SHEEN_LINKWITHALBEDO\n                surfaceAlbedo = sheenOut.surfaceAlbedo;\n            #endif\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return e.target === Ce.Fragment && e.sharedData.blocksWithDefines.push(this), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = r.prototype._dumpPropertiesCode.call(this);\n            return e += this._codeVariableName + \".albedoScaling = \" + this.albedoScaling + `;\\r\n`, e += this._codeVariableName + \".linkSheenWithAlbedo = \" + this.linkSheenWithAlbedo + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.albedoScaling = this.albedoScaling, e.linkSheenWithAlbedo = this.linkSheenWithAlbedo, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.albedoScaling = e.albedoScaling, this.linkSheenWithAlbedo = e.linkSheenWithAlbedo;\n          }, Object(c.c)([Bt(\"Albedo scaling\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !0 } })], t.prototype, \"albedoScaling\", void 0), Object(c.c)([Bt(\"Link sheen with albedo\", It.Boolean, \"PROPERTIES\", { notifiers: { update: !0 } })], t.prototype, \"linkSheenWithAlbedo\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SheenBlock\"] = rc;\n        var oc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !0, Ce.Fragment), n.registerInput(\"direction\", le.Vector2, !0, Ce.Fragment), n.registerInput(\"uv\", le.Vector2, !0), n.registerInput(\"worldTangent\", le.Vector4, !0), n.registerOutput(\"anisotropy\", le.Object, Ce.Fragment, new Xn(\"anisotropy\", n, yn.Output, t, \"AnisotropyBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"anisotropicOut\"), e._excludeVariableName(\"TBN\");\n          }, t.prototype.getClassName = function() {\n            return \"AnisotropyBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"direction\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldTangent\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"anisotropy\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._generateTBNSpace = function(e) {\n            var n = \"\", i = \"//\" + this.name, o = this.uv, a = this.worldPositionConnectionPoint, s = this.worldNormalConnectionPoint, d = this.worldTangent;\n            o.isConnected || console.error(\"You must connect the 'uv' input of the Anisotropy block!\"), e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\n            var p = { search: /defined\\(TANGENT\\)/g, replace: d.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\n            return d.isConnected && (n += \"vec3 tbnNormal = normalize(\" + s.associatedVariableName + `.xyz);\\r\n`, n += \"vec3 tbnTangent = normalize(\" + d.associatedVariableName + `.xyz);\\r\n`, n += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\n`, n += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\n`), n += `\n            #if defined(` + (d.isConnected ? \"TANGENT\" : \"IGNORE\") + `) && defined(NORMAL)\n                mat3 TBN = vTBN;\n            #else\n                mat3 TBN = cotangent_frame(` + s.associatedVariableName + \".xyz, v_\" + a.associatedVariableName + \".xyz, \" + (o.isConnected ? o.associatedVariableName : \"vec2(0.)\") + `, vec2(1., 1.));\n            #endif\\r\n`, e._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", i, { replaceStrings: [p] }), n;\n          }, t.prototype.getCode = function(e, n) {\n            n === void 0 && (n = !1);\n            var i = \"\";\n            n && (i += this._generateTBNSpace(e));\n            var o = this.intensity.isConnected ? this.intensity.associatedVariableName : \"1.0\";\n            return i += `anisotropicOutParams anisotropicOut;\n            anisotropicBlock(\n                vec3(` + (this.direction.isConnected ? this.direction.associatedVariableName : \"vec2(1., 0.)\") + \", \" + o + `),\n            #ifdef ANISOTROPIC_TEXTURE\n                vec3(0.),\n            #endif\n                TBN,\n                normalW,\n                viewDirectionW,\n                anisotropicOut\n            );\\r\n`;\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i), i.setValue(\"ANISOTROPIC\", !0), i.setValue(\"ANISOTROPIC_TEXTURE\", !1, !0);\n          }, t.prototype._buildBlock = function(e) {\n            return e.target === Ce.Fragment && e.sharedData.blocksWithDefines.push(this), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.AnisotropyBlock\"] = oc;\n        var ac = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n.useSphericalHarmonics = !0, n.forceIrradianceInFragment = !1, n._isUnique = !0, n.registerInput(\"position\", le.Vector3, !1, Ce.Vertex), n.registerInput(\"world\", le.Matrix, !1, Ce.Vertex), n.registerInput(\"color\", le.Color3, !0, Ce.Fragment), n.registerOutput(\"reflection\", le.Object, Ce.Fragment, new Xn(\"reflection\", n, yn.Output, t, \"ReflectionBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ReflectionBlock\";\n          }, Object.defineProperty(t.prototype, \"position\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this.worldPositionConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this.worldNormalConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"world\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this.cameraPositionConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this.viewConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"color\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflection\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasTexture\", { get: function() {\n            return !!this._getTexture();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflectionColor\", { get: function() {\n            return this.color.isConnected ? this.color.associatedVariableName : \"vec3(1., 1., 1.)\";\n          }, enumerable: !1, configurable: !0 }), t.prototype._getTexture = function() {\n            return this.texture ? this.texture : this._scene.environmentTexture;\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i);\n            var o = this._getTexture(), a = o && o.getTextureMatrix;\n            i.setValue(\"REFLECTION\", a, !0), a && (i.setValue(this._defineLODReflectionAlpha, o.lodLevelInAlpha, !0), i.setValue(this._defineLinearSpecularReflection, o.linearSpecularLOD, !0), i.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !o.invertZ : o.invertZ, !0), i.setValue(\"SPHERICAL_HARMONICS\", this.useSphericalHarmonics, !0), i.setValue(\"GAMMAREFLECTION\", o.gammaSpace, !0), i.setValue(\"RGBDREFLECTION\", o.isRGBD, !0), o && o.coordinatesMode !== Ne.a.SKYBOX_MODE && o.isCube && (i.setValue(\"USESPHERICALFROMREFLECTIONMAP\", !0), i.setValue(\"USEIRRADIANCEMAP\", !1), this.forceIrradianceInFragment || this._scene.getEngine().getCaps().maxVaryingVectors <= 8 ? i.setValue(\"USESPHERICALINVERTEX\", !1) : i.setValue(\"USESPHERICALINVERTEX\", !0)));\n          }, t.prototype.bind = function(e, n, i, o) {\n            r.prototype.bind.call(this, e, n, i);\n            var a = this._getTexture();\n            if (a && o) {\n              a.isCube ? e.setTexture(this._cubeSamplerName, a) : e.setTexture(this._2DSamplerName, a);\n              var s = a.getSize().width;\n              e.setFloat3(this._vReflectionMicrosurfaceInfosName, s, a.lodGenerationScale, a.lodGenerationOffset), e.setFloat2(this._vReflectionFilteringInfoName, s, $.a.Log2(s));\n              var d = o._materialDefines, p = a.sphericalPolynomial;\n              if (d.USESPHERICALFROMREFLECTIONMAP && p)\n                if (d.SPHERICAL_HARMONICS) {\n                  var y = p.preScaledHarmonics;\n                  e.setVector3(\"vSphericalL00\", y.l00), e.setVector3(\"vSphericalL1_1\", y.l1_1), e.setVector3(\"vSphericalL10\", y.l10), e.setVector3(\"vSphericalL11\", y.l11), e.setVector3(\"vSphericalL2_2\", y.l2_2), e.setVector3(\"vSphericalL2_1\", y.l2_1), e.setVector3(\"vSphericalL20\", y.l20), e.setVector3(\"vSphericalL21\", y.l21), e.setVector3(\"vSphericalL22\", y.l22);\n                } else\n                  e.setFloat3(\"vSphericalX\", p.x.x, p.x.y, p.x.z), e.setFloat3(\"vSphericalY\", p.y.x, p.y.y, p.y.z), e.setFloat3(\"vSphericalZ\", p.z.x, p.z.y, p.z.z), e.setFloat3(\"vSphericalXX_ZZ\", p.xx.x - p.zz.x, p.xx.y - p.zz.y, p.xx.z - p.zz.z), e.setFloat3(\"vSphericalYY_ZZ\", p.yy.x - p.zz.x, p.yy.y - p.zz.y, p.yy.z - p.zz.z), e.setFloat3(\"vSphericalZZ\", p.zz.x, p.zz.y, p.zz.z), e.setFloat3(\"vSphericalXY\", p.xy.x, p.xy.y, p.xy.z), e.setFloat3(\"vSphericalYZ\", p.yz.x, p.yz.y, p.yz.z), e.setFloat3(\"vSphericalZX\", p.zx.x, p.zx.y, p.zx.z);\n            }\n          }, t.prototype.handleVertexSide = function(e) {\n            var n = r.prototype.handleVertexSide.call(this, e);\n            e._emitFunctionFromInclude(\"harmonicsFunctions\", \"//\" + this.name, { replaceStrings: [{ search: /uniform vec3 vSphericalL00;[\\s\\S]*?uniform vec3 vSphericalL22;/g, replace: \"\" }, { search: /uniform vec3 vSphericalX;[\\s\\S]*?uniform vec3 vSphericalZX;/g, replace: \"\" }] });\n            var i = e._getFreeVariableName(\"reflectionVector\");\n            return this._vEnvironmentIrradianceName = e._getFreeVariableName(\"vEnvironmentIrradiance\"), e._emitVaryingFromString(this._vEnvironmentIrradianceName, \"vec3\", \"defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\"), e._emitUniformFromString(\"vSphericalL00\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL1_1\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL10\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL11\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL2_2\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL2_1\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL20\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL21\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalL22\", \"vec3\", \"SPHERICAL_HARMONICS\"), e._emitUniformFromString(\"vSphericalX\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalY\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalXX_ZZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalYY_ZZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalZZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalXY\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalYZ\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), e._emitUniformFromString(\"vSphericalZX\", \"vec3\", \"SPHERICAL_HARMONICS\", !0), n += `#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)\n                vec3 ` + i + \" = vec3(\" + this._reflectionMatrixName + \" * vec4(normalize(\" + this.worldNormal.associatedVariableName + `).xyz, 0)).xyz;\n                #ifdef ` + this._defineOppositeZ + `\n                    ` + i + `.z *= -1.0;\n                #endif\n                ` + this._vEnvironmentIrradianceName + \" = computeEnvironmentIrradiance(\" + i + `);\n            #endif\\r\n`;\n          }, t.prototype.getCode = function(e, n) {\n            var i = \"\";\n            this.handleFragmentSideInits(e), e._emitFunctionFromInclude(\"harmonicsFunctions\", \"//\" + this.name, { replaceStrings: [{ search: /uniform vec3 vSphericalL00;[\\s\\S]*?uniform vec3 vSphericalL22;/g, replace: \"\" }, { search: /uniform vec3 vSphericalX;[\\s\\S]*?uniform vec3 vSphericalZX;/g, replace: \"\" }] }), e._emitFunction(\"sampleReflection\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleReflection(s, c) textureCube(s, c)\n            #else\n                #define sampleReflection(s, c) texture2D(s, c)\n            #endif\\r\n`, \"//\" + this.name), e._emitFunction(\"sampleReflectionLod\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleReflectionLod(s, c, l) textureCubeLodEXT(s, c, l)\n            #else\n                #define sampleReflectionLod(s, c, l) texture2DLodEXT(s, c, l)\n            #endif\\r\n`, \"//\" + this.name);\n            var o = `\n            vec3 computeReflectionCoordsPBR(vec4 worldPos, vec3 worldNormal) {\n                ` + this.handleFragmentSideCodeReflectionCoords(\"worldNormal\", \"worldPos\", !0) + `\n                return ` + this._reflectionVectorName + `;\n            }\\r\n`;\n            return e._emitFunction(\"computeReflectionCoordsPBR\", o, \"//\" + this.name), this._vReflectionMicrosurfaceInfosName = e._getFreeVariableName(\"vReflectionMicrosurfaceInfos\"), e._emitUniformFromString(this._vReflectionMicrosurfaceInfosName, \"vec3\"), this._vReflectionInfosName = e._getFreeVariableName(\"vReflectionInfos\"), this._vReflectionFilteringInfoName = e._getFreeVariableName(\"vReflectionFilteringInfo\"), e._emitUniformFromString(this._vReflectionFilteringInfoName, \"vec2\"), i += `#ifdef REFLECTION\n            vec2 ` + this._vReflectionInfosName + ` = vec2(1., 0.);\n\n            reflectionOutParams reflectionOut;\n\n            reflectionBlock(\n                v_` + this.worldPosition.associatedVariableName + `.xyz,\n                ` + n + `,\n                alphaG,\n                ` + this._vReflectionMicrosurfaceInfosName + `,\n                ` + this._vReflectionInfosName + `,\n                ` + this.reflectionColor + `,\n            #ifdef ANISOTROPIC\n                anisotropicOut,\n            #endif\n            #if defined(` + this._defineLODReflectionAlpha + \") && !defined(\" + this._defineSkyboxName + `)\n                NdotVUnclamped,\n            #endif\n            #ifdef ` + this._defineLinearSpecularReflection + `\n                roughness,\n            #endif\n            #ifdef ` + this._define3DName + `\n                ` + this._cubeSamplerName + `,\n            #else\n                ` + this._2DSamplerName + `,\n            #endif\n            #if defined(NORMAL) && defined(USESPHERICALINVERTEX)\n                ` + this._vEnvironmentIrradianceName + `,\n            #endif\n            #ifdef USESPHERICALFROMREFLECTIONMAP\n                #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n                    ` + this._reflectionMatrixName + `,\n                #endif\n            #endif\n            #ifdef USEIRRADIANCEMAP\n                irradianceSampler, // ** not handled **\n            #endif\n            #ifndef LODBASEDMICROSFURACE\n                #ifdef ` + this._define3DName + `\n                    ` + this._cubeSamplerName + `,\n                    ` + this._cubeSamplerName + `,\n                #else\n                    ` + this._2DSamplerName + `,\n                    ` + this._2DSamplerName + `,\n                #endif\n            #endif\n            #ifdef REALTIME_FILTERING\n                ` + this._vReflectionFilteringInfoName + `,\n            #endif\n                reflectionOut\n            );\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return this._scene = e.sharedData.scene, e.target !== Ce.Fragment && (this._defineLODReflectionAlpha = e._getFreeDefineName(\"LODINREFLECTIONALPHA\"), this._defineLinearSpecularReflection = e._getFreeDefineName(\"LINEARSPECULARREFLECTION\")), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = r.prototype._dumpPropertiesCode.call(this);\n            return this.texture && (e += this._codeVariableName + \".texture.gammaSpace = \" + this.texture.gammaSpace + `);\\r\n`), e += this._codeVariableName + \".useSphericalHarmonics = \" + this.useSphericalHarmonics + `;\\r\n`, e += this._codeVariableName + \".forceIrradianceInFragment = \" + this.forceIrradianceInFragment + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e, n, i = r.prototype.serialize.call(this);\n            return i.useSphericalHarmonics = this.useSphericalHarmonics, i.forceIrradianceInFragment = this.forceIrradianceInFragment, i.gammaSpace = (n = (e = this.texture) === null || e === void 0 ? void 0 : e.gammaSpace) === null || n === void 0 || n, i;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), this.useSphericalHarmonics = e.useSphericalHarmonics, this.forceIrradianceInFragment = e.forceIrradianceInFragment, this.texture && (this.texture.gammaSpace = e.gammaSpace);\n          }, Object(c.c)([Bt(\"Spherical Harmonics\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useSphericalHarmonics\", void 0), Object(c.c)([Bt(\"Force irradiance in fragment\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"forceIrradianceInFragment\", void 0), t;\n        }(tc);\n        O.a.RegisteredTypes[\"BABYLON.ReflectionBlock\"] = ac;\n        var la = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.remapF0OnInterfaceChange = !0, n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !1, Ce.Fragment), n.registerInput(\"roughness\", le.Float, !0, Ce.Fragment), n.registerInput(\"indexOfRefraction\", le.Float, !0, Ce.Fragment), n.registerInput(\"normalMapColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"uv\", le.Vector2, !0, Ce.Fragment), n.registerInput(\"tintColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"tintAtDistance\", le.Float, !0, Ce.Fragment), n.registerInput(\"tintThickness\", le.Float, !0, Ce.Fragment), n.registerInput(\"worldTangent\", le.Vector4, !0), n.registerOutput(\"clearcoat\", le.Object, Ce.Fragment, new Xn(\"clearcoat\", n, yn.Output, t, \"ClearCoatBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"clearcoatOut\"), e._excludeVariableName(\"vClearCoatParams\"), e._excludeVariableName(\"vClearCoatTintParams\"), e._excludeVariableName(\"vClearCoatRefractionParams\"), e._excludeVariableName(\"vClearCoatTangentSpaceParams\");\n          }, t.prototype.getClassName = function() {\n            return \"ClearCoatBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"roughness\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"indexOfRefraction\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"normalMapColor\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"uv\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintColor\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintAtDistance\", { get: function() {\n            return this._inputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintThickness\", { get: function() {\n            return this._inputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldTangent\", { get: function() {\n            return this._inputs[8];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoat\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.intensity.isConnected) {\n              var n = new Et(\"ClearCoat intensity\", Ce.Fragment, le.Float);\n              n.value = 1, n.output.connectTo(this.intensity);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i), i.setValue(\"CLEARCOAT\", !0), i.setValue(\"CLEARCOAT_TEXTURE\", !1, !0), i.setValue(\"CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE\", !0, !0), i.setValue(\"CLEARCOAT_TINT\", this.tintColor.isConnected || this.tintThickness.isConnected || this.tintAtDistance.isConnected, !0), i.setValue(\"CLEARCOAT_BUMP\", this.normalMapColor.isConnected, !0), i.setValue(\"CLEARCOAT_DEFAULTIOR\", !this.indexOfRefraction.isConnected || this.indexOfRefraction.connectInputBlock.value === mr._DefaultIndexOfRefraction, !0), i.setValue(\"CLEARCOAT_REMAP_F0\", this.remapF0OnInterfaceChange, !0);\n          }, t.prototype.bind = function(e, n, i, o) {\n            var a, s;\n            r.prototype.bind.call(this, e, n, i);\n            var d = (s = (a = this.indexOfRefraction.connectInputBlock) === null || a === void 0 ? void 0 : a.value) !== null && s !== void 0 ? s : mr._DefaultIndexOfRefraction, p = 1 - d, y = 1 + d, P = Math.pow(-p / y, 2), R = 1 / d;\n            e.setFloat4(\"vClearCoatRefractionParams\", P, R, p, y);\n            var B = this.clearcoat.hasEndpoints ? this.clearcoat.endpoints[0].ownerBlock : null, F = B != null && B.perturbedNormal.isConnected ? B.perturbedNormal.connectedPoint.ownerBlock : null;\n            this._scene._mirroredCameraPosition ? e.setFloat2(\"vClearCoatTangentSpaceParams\", F != null && F.invertX ? 1 : -1, F != null && F.invertY ? 1 : -1) : e.setFloat2(\"vClearCoatTangentSpaceParams\", F != null && F.invertX ? -1 : 1, F != null && F.invertY ? -1 : 1);\n          }, t.prototype._generateTBNSpace = function(e, n, i) {\n            var o = \"\", a = \"//\" + this.name, s = this.worldTangent;\n            e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\");\n            var d = { search: /defined\\(TANGENT\\)/g, replace: s.isConnected ? \"defined(TANGENT)\" : \"defined(IGNORE)\" };\n            return s.isConnected && (o += \"vec3 tbnNormal = normalize(\" + i + `.xyz);\\r\n`, o += \"vec3 tbnTangent = normalize(\" + s.associatedVariableName + `.xyz);\\r\n`, o += `vec3 tbnBitangent = cross(tbnNormal, tbnTangent);\\r\n`, o += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\\r\n`), e._emitFunctionFromInclude(\"bumpFragmentMainFunctions\", a, { replaceStrings: [d] }), o;\n          }, t.GetCode = function(e, n, i, o, a, s, d) {\n            var p = \"\", y = n != null && n.intensity.isConnected ? n.intensity.associatedVariableName : \"1.\", P = n != null && n.roughness.isConnected ? n.roughness.associatedVariableName : \"0.\", R = n != null && n.normalMapColor.isConnected ? n.normalMapColor.associatedVariableName : \"vec3(0.)\", B = n != null && n.uv.isConnected ? n.uv.associatedVariableName : \"vec2(0.)\", F = n != null && n.tintColor.isConnected ? n.tintColor.associatedVariableName : \"vec3(1.)\", z = n != null && n.tintThickness.isConnected ? n.tintThickness.associatedVariableName : \"1.\", J = n != null && n.tintAtDistance.isConnected ? n.tintAtDistance.associatedVariableName : \"1.\";\n            return n && (e._emitUniformFromString(\"vClearCoatRefractionParams\", \"vec4\"), e._emitUniformFromString(\"vClearCoatTangentSpaceParams\", \"vec2\")), a && n && (p += n._generateTBNSpace(e, o, d), s = n.worldTangent.isConnected), p += `clearcoatOutParams clearcoatOut;\n\n        #ifdef CLEARCOAT\n            vec2 vClearCoatParams = vec2(` + y + \", \" + P + `);\n            vec4 vClearCoatTintParams = vec4(` + F + \", \" + z + `);\n\n            clearcoatBlock(\n                ` + o + `.xyz,\n                geometricNormalW,\n                viewDirectionW,\n                vClearCoatParams,\n                specularEnvironmentR0,\n            #ifdef CLEARCOAT_TEXTURE\n                vec2(0.),\n            #endif\n            #ifdef CLEARCOAT_TINT\n                vClearCoatTintParams,\n                ` + J + `,\n                vClearCoatRefractionParams,\n                #ifdef CLEARCOAT_TINT_TEXTURE\n                    vec4(0.),\n                #endif\n            #endif\n            #ifdef CLEARCOAT_BUMP\n                vec2(0., 1.),\n                vec4(` + R + `, 0.),\n                ` + B + `,\n                #if defined(` + (s ? \"TANGENT\" : \"IGNORE\") + `) && defined(NORMAL)\n                    vTBN,\n                #else\n                    vClearCoatTangentSpaceParams,\n                #endif\n                #ifdef OBJECTSPACE_NORMALMAP\n                    normalMatrix,\n                #endif\n            #endif\n            #if defined(FORCENORMALFORWARD) && defined(NORMAL)\n                faceNormal,\n            #endif\n            #ifdef REFLECTION\n                ` + (i == null ? void 0 : i._vReflectionMicrosurfaceInfosName) + `,\n                ` + (i == null ? void 0 : i._vReflectionInfosName) + `,\n                ` + (i == null ? void 0 : i.reflectionColor) + `,\n                vLightingIntensity,\n                #ifdef ` + (i == null ? void 0 : i._define3DName) + `\n                    ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                #else\n                    ` + (i == null ? void 0 : i._2DSamplerName) + `,\n                #endif\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef ` + (i == null ? void 0 : i._define3DName) + `\n                        ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                        ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                    #else\n                        ` + (i == null ? void 0 : i._2DSamplerName) + `,\n                        ` + (i == null ? void 0 : i._2DSamplerName) + `,\n                    #endif\n                #endif\n            #endif\n            #if defined(ENVIRONMENTBRDF) && !defined(` + (i == null ? void 0 : i._defineSkyboxName) + `)\n                #ifdef RADIANCEOCCLUSION\n                    ambientMonochrome,\n                #endif\n            #endif\n                clearcoatOut\n            );\n        #else\n            clearcoatOut.specularEnvironmentR0 = specularEnvironmentR0;\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return this._scene = e.sharedData.scene, e.target === Ce.Fragment && (e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this)), this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = \"\";\n            return e += this._codeVariableName + \".remapF0OnInterfaceChange = \" + this.remapF0OnInterfaceChange + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return e.remapF0OnInterfaceChange = this.remapF0OnInterfaceChange, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            var o;\n            r.prototype._deserialize.call(this, e, n, i), this.remapF0OnInterfaceChange = (o = e.remapF0OnInterfaceChange) === null || o === void 0 || o;\n          }, Object(c.c)([Bt(\"Remap F0 on interface change\", It.Boolean, \"ADVANCED\")], t.prototype, \"remapF0OnInterfaceChange\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ClearCoatBlock\"] = la;\n        var sc = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n.linkRefractionWithTransparency = !1, n.invertRefractionY = !1, n._isUnique = !0, n.registerInput(\"intensity\", le.Float, !1, Ce.Fragment), n.registerInput(\"tintAtDistance\", le.Float, !0, Ce.Fragment), n.registerOutput(\"refraction\", le.Object, Ce.Fragment, new Xn(\"refraction\", n, yn.Output, t, \"RefractionBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"RefractionBlock\";\n          }, Object.defineProperty(t.prototype, \"intensity\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintAtDistance\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this.viewConnectionPoint;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"refraction\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hasTexture\", { get: function() {\n            return !!this._getTexture();\n          }, enumerable: !1, configurable: !0 }), t.prototype._getTexture = function() {\n            return this.texture ? this.texture : this._scene.environmentTexture;\n          }, t.prototype.autoConfigure = function(e) {\n            if (!this.intensity.isConnected) {\n              var n = new Et(\"Refraction intensity\", Ce.Fragment, le.Float);\n              n.value = 1, n.output.connectTo(this.intensity);\n            }\n            if (this.view && !this.view.isConnected) {\n              var i = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.View;\n              });\n              i || (i = new Et(\"view\")).setAsSystemValue(gt.View), i.output.connectTo(this.view);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i);\n            var o = this._getTexture(), a = o && o.getTextureMatrix;\n            i.setValue(\"SS_REFRACTION\", a, !0), a && (i.setValue(this._define3DName, o.isCube, !0), i.setValue(this._defineLODRefractionAlpha, o.lodLevelInAlpha, !0), i.setValue(this._defineLinearSpecularRefraction, o.linearSpecularLOD, !0), i.setValue(this._defineOppositeZ, this._scene.useRightHandedSystem ? !o.invertZ : o.invertZ, !0), i.setValue(\"SS_LINKREFRACTIONTOTRANSPARENCY\", this.linkRefractionWithTransparency, !0), i.setValue(\"SS_GAMMAREFRACTION\", o.gammaSpace, !0), i.setValue(\"SS_RGBDREFRACTION\", o.isRGBD, !0));\n          }, t.prototype.isReady = function() {\n            var e = this._getTexture();\n            return !(e && !e.isReadyOrNotBlocking());\n          }, t.prototype.bind = function(e, n, i, o) {\n            var a, s;\n            r.prototype.bind.call(this, e, n, i);\n            var d = this._getTexture();\n            if (d) {\n              d.isCube ? e.setTexture(this._cubeSamplerName, d) : e.setTexture(this._2DSamplerName, d), e.setMatrix(this._refractionMatrixName, d.getReflectionTextureMatrix());\n              var p = 1;\n              d.isCube || d.depth && (p = d.depth);\n              var y = (s = (a = this.indexOfRefractionConnectionPoint.connectInputBlock) === null || a === void 0 ? void 0 : a.value) !== null && s !== void 0 ? s : 1.5;\n              e.setFloat4(this._vRefractionInfosName, d.level, 1 / y, p, this.invertRefractionY ? -1 : 1), e.setFloat3(this._vRefractionMicrosurfaceInfosName, d.getSize().width, d.lodGenerationScale, d.lodGenerationOffset);\n              var P = d.getSize().width;\n              e.setFloat2(this._vRefractionFilteringInfoName, P, $.a.Log2(P));\n            }\n          }, t.prototype.getCode = function(e) {\n            return e.sharedData.blockingBlocks.push(this), e.sharedData.textureBlocks.push(this), this._cubeSamplerName = e._getFreeVariableName(this.name + \"CubeSampler\"), e.samplers.push(this._cubeSamplerName), this._2DSamplerName = e._getFreeVariableName(this.name + \"2DSampler\"), e.samplers.push(this._2DSamplerName), this._define3DName = e._getFreeDefineName(\"SS_REFRACTIONMAP_3D\"), e._samplerDeclaration += \"#ifdef \" + this._define3DName + `\\r\n`, e._samplerDeclaration += \"uniform samplerCube \" + this._cubeSamplerName + `;\\r\n`, e._samplerDeclaration += `#else\\r\n`, e._samplerDeclaration += \"uniform sampler2D \" + this._2DSamplerName + `;\\r\n`, e._samplerDeclaration += `#endif\\r\n`, e.sharedData.blocksWithDefines.push(this), e.sharedData.bindableBlocks.push(this), this._defineLODRefractionAlpha = e._getFreeDefineName(\"SS_LODINREFRACTIONALPHA\"), this._defineLinearSpecularRefraction = e._getFreeDefineName(\"SS_LINEARSPECULARREFRACTION\"), this._defineOppositeZ = e._getFreeDefineName(\"SS_REFRACTIONMAP_OPPOSITEZ\"), this._refractionMatrixName = e._getFreeVariableName(\"refractionMatrix\"), e._emitUniformFromString(this._refractionMatrixName, \"mat4\"), e._emitFunction(\"sampleRefraction\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleRefraction(s, c) textureCube(s, c)\n            #else\n                #define sampleRefraction(s, c) texture2D(s, c)\n            #endif\\r\n`, \"//\" + this.name), e._emitFunction(\"sampleRefractionLod\", `\n            #ifdef ` + this._define3DName + `\n                #define sampleRefractionLod(s, c, l) textureCubeLodEXT(s, c, l)\n            #else\n                #define sampleRefractionLod(s, c, l) texture2DLodEXT(s, c, l)\n            #endif\\r\n`, \"//\" + this.name), this._vRefractionMicrosurfaceInfosName = e._getFreeVariableName(\"vRefractionMicrosurfaceInfos\"), e._emitUniformFromString(this._vRefractionMicrosurfaceInfosName, \"vec3\"), this._vRefractionInfosName = e._getFreeVariableName(\"vRefractionInfos\"), e._emitUniformFromString(this._vRefractionInfosName, \"vec4\"), this._vRefractionFilteringInfoName = e._getFreeVariableName(\"vRefractionFilteringInfo\"), e._emitUniformFromString(this._vRefractionFilteringInfoName, \"vec2\"), \"\";\n          }, t.prototype._buildBlock = function(e) {\n            return this._scene = e.sharedData.scene, this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = r.prototype._dumpPropertiesCode.call(this);\n            return this.texture && (e = this.texture.isCube ? this._codeVariableName + '.texture = new BABYLON.CubeTexture(\"' + this.texture.name + `\");\\r\n` : this._codeVariableName + '.texture = new BABYLON.Texture(\"' + this.texture.name + `\");\\r\n`, e += this._codeVariableName + \".texture.coordinatesMode = \" + this.texture.coordinatesMode + `;\\r\n`), e += this._codeVariableName + \".linkRefractionWithTransparency = \" + this.linkRefractionWithTransparency + `;\\r\n`, e += this._codeVariableName + \".invertRefractionY = \" + this.invertRefractionY + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.texture && (e.texture = this.texture.serialize()), e.linkRefractionWithTransparency = this.linkRefractionWithTransparency, e.invertRefractionY = this.invertRefractionY, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            r.prototype._deserialize.call(this, e, n, i), e.texture && (i = e.texture.url.indexOf(\"data:\") === 0 ? \"\" : i, e.texture.isCube ? this.texture = ei.Parse(e.texture, n, i) : this.texture = Ne.a.Parse(e.texture, n, i)), this.linkRefractionWithTransparency = e.linkRefractionWithTransparency, this.invertRefractionY = e.invertRefractionY;\n          }, Object(c.c)([Bt(\"Link refraction to transparency\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"linkRefractionWithTransparency\", void 0), Object(c.c)([Bt(\"Invert refraction Y\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"invertRefractionY\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.RefractionBlock\"] = sc;\n        var ua = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Fragment) || this;\n            return n._isUnique = !0, n.registerInput(\"thickness\", le.Float, !1, Ce.Fragment), n.registerInput(\"tintColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"translucencyIntensity\", le.Float, !0, Ce.Fragment), n.registerInput(\"translucencyDiffusionDist\", le.Color3, !0, Ce.Fragment), n.registerInput(\"refraction\", le.Object, !0, Ce.Fragment, new Xn(\"refraction\", n, yn.Input, sc, \"RefractionBlock\")), n.registerOutput(\"subsurface\", le.Object, Ce.Fragment, new Xn(\"subsurface\", n, yn.Output, t, \"SubSurfaceBlock\")), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"subSurfaceOut\"), e._excludeVariableName(\"vThicknessParam\"), e._excludeVariableName(\"vTintColor\"), e._excludeVariableName(\"vSubSurfaceIntensity\");\n          }, t.prototype.getClassName = function() {\n            return \"SubSurfaceBlock\";\n          }, Object.defineProperty(t.prototype, \"thickness\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"tintColor\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"translucencyIntensity\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"translucencyDiffusionDist\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"refraction\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subsurface\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.thickness.isConnected) {\n              var n = new Et(\"SubSurface thickness\", Ce.Fragment, le.Float);\n              n.value = 0, n.output.connectTo(this.thickness);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            r.prototype.prepareDefines.call(this, e, n, i);\n            var o = this.translucencyDiffusionDist.isConnected || this.translucencyIntensity.isConnected;\n            i.setValue(\"SUBSURFACE\", o || this.refraction.isConnected, !0), i.setValue(\"SS_TRANSLUCENCY\", o, !0), i.setValue(\"SS_THICKNESSANDMASK_TEXTURE\", !1, !0), i.setValue(\"SS_MASK_FROM_THICKNESS_TEXTURE\", !1, !0), i.setValue(\"SS_MASK_FROM_THICKNESS_TEXTURE_GLTF\", !1, !0);\n          }, t.GetCode = function(e, n, i, o) {\n            var a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe, ve = \"\", Te = n != null && n.thickness.isConnected ? n.thickness.associatedVariableName : \"0.\", Re = n != null && n.tintColor.isConnected ? n.tintColor.associatedVariableName : \"vec3(1.)\", Ae = n != null && n.translucencyIntensity.isConnected ? n == null ? void 0 : n.translucencyIntensity.associatedVariableName : \"1.\", Ee = n != null && n.translucencyDiffusionDist.isConnected ? n == null ? void 0 : n.translucencyDiffusionDist.associatedVariableName : \"vec3(1.)\", Se = n != null && n.refraction.isConnected ? (a = n == null ? void 0 : n.refraction.connectedPoint) === null || a === void 0 ? void 0 : a.ownerBlock : null, De = Se != null && Se.tintAtDistance.isConnected ? Se.tintAtDistance.associatedVariableName : \"1.\", xe = Se != null && Se.intensity.isConnected ? Se.intensity.associatedVariableName : \"1.\", Le = Se != null && Se.view.isConnected ? Se.view.associatedVariableName : \"\";\n            return ve += (s = Se == null ? void 0 : Se.getCode(e)) !== null && s !== void 0 ? s : \"\", ve += `subSurfaceOutParams subSurfaceOut;\n\n        #ifdef SUBSURFACE\n            vec2 vThicknessParam = vec2(0., ` + Te + `);\n            vec4 vTintColor = vec4(` + Re + \", \" + De + `);\n            vec3 vSubSurfaceIntensity = vec3(` + xe + \", \" + Ae + `, 0.);\n\n            subSurfaceBlock(\n                vSubSurfaceIntensity,\n                vThicknessParam,\n                vTintColor,\n                normalW,\n                specularEnvironmentReflectance,\n            #ifdef SS_THICKNESSANDMASK_TEXTURE\n                vec4(0.),\n            #endif\n            #ifdef REFLECTION\n                #ifdef SS_TRANSLUCENCY\n                    ` + (i == null ? void 0 : i._reflectionMatrixName) + `,\n                    #ifdef USESPHERICALFROMREFLECTIONMAP\n                        #if !defined(NORMAL) || !defined(USESPHERICALINVERTEX)\n                            reflectionOut.irradianceVector,\n                        #endif\n                        #if defined(REALTIME_FILTERING)\n                            ` + (i == null ? void 0 : i._cubeSamplerName) + `,\n                            ` + (i == null ? void 0 : i._vReflectionFilteringInfoName) + `,\n                        #endif\n                        #endif\n                    #ifdef USEIRRADIANCEMAP\n                        irradianceSampler,\n                    #endif\n                #endif\n            #endif\n            #ifdef SS_REFRACTION\n                ` + o + `.xyz,\n                viewDirectionW,\n                ` + Le + `,\n                surfaceAlbedo,\n                ` + ((d = Se == null ? void 0 : Se._vRefractionInfosName) !== null && d !== void 0 ? d : \"\") + `,\n                ` + ((p = Se == null ? void 0 : Se._refractionMatrixName) !== null && p !== void 0 ? p : \"\") + `,\n                ` + ((y = Se == null ? void 0 : Se._vRefractionMicrosurfaceInfosName) !== null && y !== void 0 ? y : \"\") + `,\n                vLightingIntensity,\n                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n                    alpha,\n                #endif\n                #ifdef ` + ((P = Se == null ? void 0 : Se._defineLODRefractionAlpha) !== null && P !== void 0 ? P : \"IGNORE\") + `\n                    NdotVUnclamped,\n                #endif\n                #ifdef ` + ((R = Se == null ? void 0 : Se._defineLinearSpecularRefraction) !== null && R !== void 0 ? R : \"IGNORE\") + `\n                    roughness,\n                #else\n                    alphaG,\n                #endif\n                #ifdef ` + ((B = Se == null ? void 0 : Se._define3DName) !== null && B !== void 0 ? B : \"IGNORE\") + `\n                    ` + ((F = Se == null ? void 0 : Se._cubeSamplerName) !== null && F !== void 0 ? F : \"\") + `,\n                #else\n                    ` + ((z = Se == null ? void 0 : Se._2DSamplerName) !== null && z !== void 0 ? z : \"\") + `,\n                #endif\n                #ifndef LODBASEDMICROSFURACE\n                    #ifdef ` + ((J = Se == null ? void 0 : Se._define3DName) !== null && J !== void 0 ? J : \"IGNORE\") + `\n                        ` + ((ie = Se == null ? void 0 : Se._cubeSamplerName) !== null && ie !== void 0 ? ie : \"\") + `,\n                        ` + ((se = Se == null ? void 0 : Se._cubeSamplerName) !== null && se !== void 0 ? se : \"\") + `,\n                    #else\n                        ` + ((ce = Se == null ? void 0 : Se._2DSamplerName) !== null && ce !== void 0 ? ce : \"\") + `,\n                        ` + ((ue = Se == null ? void 0 : Se._2DSamplerName) !== null && ue !== void 0 ? ue : \"\") + `,\n                    #endif\n                #endif\n                #ifdef ANISOTROPIC\n                    anisotropicOut,\n                #endif\n                #ifdef REALTIME_FILTERING\n                    ` + ((fe = Se == null ? void 0 : Se._vRefractionFilteringInfoName) !== null && fe !== void 0 ? fe : \"\") + `,\n                #endif\n            #endif\n            #ifdef SS_TRANSLUCENCY\n                ` + Ee + `,\n            #endif\n                subSurfaceOut\n            );\n\n            #ifdef SS_REFRACTION\n                surfaceAlbedo = subSurfaceOut.surfaceAlbedo;\n                #ifdef SS_LINKREFRACTIONTOTRANSPARENCY\n                    alpha = subSurfaceOut.alpha;\n                #endif\n            #endif\n        #else\n            subSurfaceOut.specularEnvironmentReflectance = specularEnvironmentReflectance;\n        #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            return e.target === Ce.Fragment && e.sharedData.blocksWithDefines.push(this), this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.SubSurfaceBlock\"] = ua;\n        var j_ = { ambientClr: [\"finalAmbient\", \"\"], diffuseDir: [\"finalDiffuse\", \"\"], specularDir: [\"finalSpecularScaled\", \"!defined(UNLIT) && defined(SPECULARTERM)\"], clearcoatDir: [\"finalClearCoatScaled\", \"!defined(UNLIT) && defined(CLEARCOAT)\"], sheenDir: [\"finalSheenScaled\", \"!defined(UNLIT) && defined(SHEEN)\"], diffuseInd: [\"finalIrradiance\", \"!defined(UNLIT) && defined(REFLECTION)\"], specularInd: [\"finalRadianceScaled\", \"!defined(UNLIT) && defined(REFLECTION)\"], clearcoatInd: [\"clearcoatOut.finalClearCoatRadianceScaled\", \"!defined(UNLIT) && defined(REFLECTION) && defined(CLEARCOAT)\"], sheenInd: [\"sheenOut.finalSheenRadianceScaled\", \"!defined(UNLIT) && defined(REFLECTION) && defined(SHEEN) && defined(ENVIRONMENTBRDF)\"], refraction: [\"subSurfaceOut.finalRefraction\", \"!defined(UNLIT) && defined(SS_REFRACTION)\"], lighting: [\"finalColor.rgb\", \"\"], shadow: [\"shadow\", \"\"], alpha: [\"alpha\", \"\"] }, Xh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.VertexAndFragment) || this;\n            return n._environmentBRDFTexture = null, n._metallicReflectanceColor = I.a.White(), n._metallicF0Factor = 1, n.directIntensity = 1, n.environmentIntensity = 1, n.specularIntensity = 1, n.lightFalloff = 0, n.useAlphaTest = !1, n.alphaTestCutoff = 0.5, n.useAlphaBlending = !1, n.useRadianceOverAlpha = !0, n.useSpecularOverAlpha = !0, n.enableSpecularAntiAliasing = !1, n.realTimeFiltering = !1, n.realTimeFilteringQuality = h.a.TEXTURE_FILTERING_QUALITY_LOW, n.useEnergyConservation = !0, n.useRadianceOcclusion = !0, n.useHorizonOcclusion = !0, n.unlit = !1, n.forceNormalForward = !1, n.debugMode = 0, n.debugLimit = 0, n.debugFactor = 1, n._isUnique = !0, n.registerInput(\"worldPosition\", le.Vector4, !1, Ce.Vertex), n.registerInput(\"worldNormal\", le.Vector4, !1, Ce.Fragment), n.registerInput(\"view\", le.Matrix, !1), n.registerInput(\"cameraPosition\", le.Vector3, !1, Ce.Fragment), n.registerInput(\"perturbedNormal\", le.Vector4, !0, Ce.Fragment), n.registerInput(\"baseColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"metallic\", le.Float, !1, Ce.Fragment), n.registerInput(\"roughness\", le.Float, !1, Ce.Fragment), n.registerInput(\"ambientOcc\", le.Float, !0, Ce.Fragment), n.registerInput(\"opacity\", le.Float, !0, Ce.Fragment), n.registerInput(\"indexOfRefraction\", le.Float, !0, Ce.Fragment), n.registerInput(\"ambientColor\", le.Color3, !0, Ce.Fragment), n.registerInput(\"reflection\", le.Object, !0, Ce.Fragment, new Xn(\"reflection\", n, yn.Input, ac, \"ReflectionBlock\")), n.registerInput(\"clearcoat\", le.Object, !0, Ce.Fragment, new Xn(\"clearcoat\", n, yn.Input, la, \"ClearCoatBlock\")), n.registerInput(\"sheen\", le.Object, !0, Ce.Fragment, new Xn(\"sheen\", n, yn.Input, rc, \"SheenBlock\")), n.registerInput(\"subsurface\", le.Object, !0, Ce.Fragment, new Xn(\"subsurface\", n, yn.Input, ua, \"SubSurfaceBlock\")), n.registerInput(\"anisotropy\", le.Object, !0, Ce.Fragment, new Xn(\"anisotropy\", n, yn.Input, oc, \"AnisotropyBlock\")), n.registerOutput(\"ambientClr\", le.Color3, Ce.Fragment), n.registerOutput(\"diffuseDir\", le.Color3, Ce.Fragment), n.registerOutput(\"specularDir\", le.Color3, Ce.Fragment), n.registerOutput(\"clearcoatDir\", le.Color3, Ce.Fragment), n.registerOutput(\"sheenDir\", le.Color3, Ce.Fragment), n.registerOutput(\"diffuseInd\", le.Color3, Ce.Fragment), n.registerOutput(\"specularInd\", le.Color3, Ce.Fragment), n.registerOutput(\"clearcoatInd\", le.Color3, Ce.Fragment), n.registerOutput(\"sheenInd\", le.Color3, Ce.Fragment), n.registerOutput(\"refraction\", le.Color3, Ce.Fragment), n.registerOutput(\"lighting\", le.Color3, Ce.Fragment), n.registerOutput(\"shadow\", le.Float, Ce.Fragment), n.registerOutput(\"alpha\", le.Float, Ce.Fragment), n;\n          }\n          return Object(c.d)(t, r), t.prototype.initialize = function(e) {\n            e._excludeVariableName(\"vLightingIntensity\"), e._excludeVariableName(\"geometricNormalW\"), e._excludeVariableName(\"normalW\"), e._excludeVariableName(\"faceNormal\"), e._excludeVariableName(\"albedoOpacityOut\"), e._excludeVariableName(\"surfaceAlbedo\"), e._excludeVariableName(\"alpha\"), e._excludeVariableName(\"aoOut\"), e._excludeVariableName(\"baseColor\"), e._excludeVariableName(\"reflectivityOut\"), e._excludeVariableName(\"microSurface\"), e._excludeVariableName(\"roughness\"), e._excludeVariableName(\"NdotVUnclamped\"), e._excludeVariableName(\"NdotV\"), e._excludeVariableName(\"alphaG\"), e._excludeVariableName(\"AARoughnessFactors\"), e._excludeVariableName(\"environmentBrdf\"), e._excludeVariableName(\"ambientMonochrome\"), e._excludeVariableName(\"seo\"), e._excludeVariableName(\"eho\"), e._excludeVariableName(\"environmentRadiance\"), e._excludeVariableName(\"irradianceVector\"), e._excludeVariableName(\"environmentIrradiance\"), e._excludeVariableName(\"diffuseBase\"), e._excludeVariableName(\"specularBase\"), e._excludeVariableName(\"preInfo\"), e._excludeVariableName(\"info\"), e._excludeVariableName(\"shadow\"), e._excludeVariableName(\"finalDiffuse\"), e._excludeVariableName(\"finalAmbient\"), e._excludeVariableName(\"ambientOcclusionForDirectDiffuse\"), e._excludeVariableName(\"finalColor\"), e._excludeVariableName(\"vClipSpacePosition\"), e._excludeVariableName(\"vDebugMode\");\n          }, t.prototype.getClassName = function() {\n            return \"PBRMetallicRoughnessBlock\";\n          }, Object.defineProperty(t.prototype, \"worldPosition\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"worldNormal\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"view\", { get: function() {\n            return this._inputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"cameraPosition\", { get: function() {\n            return this._inputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"perturbedNormal\", { get: function() {\n            return this._inputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"baseColor\", { get: function() {\n            return this._inputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"metallic\", { get: function() {\n            return this._inputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"roughness\", { get: function() {\n            return this._inputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ambientOcc\", { get: function() {\n            return this._inputs[8];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"opacity\", { get: function() {\n            return this._inputs[9];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"indexOfRefraction\", { get: function() {\n            return this._inputs[10];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ambientColor\", { get: function() {\n            return this._inputs[11];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflection\", { get: function() {\n            return this._inputs[12];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoat\", { get: function() {\n            return this._inputs[13];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheen\", { get: function() {\n            return this._inputs[14];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"subsurface\", { get: function() {\n            return this._inputs[15];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"anisotropy\", { get: function() {\n            return this._inputs[16];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"ambientClr\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseDir\", { get: function() {\n            return this._outputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularDir\", { get: function() {\n            return this._outputs[2];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoatDir\", { get: function() {\n            return this._outputs[3];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheenDir\", { get: function() {\n            return this._outputs[4];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"diffuseIndirect\", { get: function() {\n            return this._outputs[5];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"specularIndirect\", { get: function() {\n            return this._outputs[6];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"clearcoatIndirect\", { get: function() {\n            return this._outputs[7];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sheenIndirect\", { get: function() {\n            return this._outputs[8];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"refraction\", { get: function() {\n            return this._outputs[9];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"lighting\", { get: function() {\n            return this._outputs[10];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"shadow\", { get: function() {\n            return this._outputs[11];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"alpha\", { get: function() {\n            return this._outputs[12];\n          }, enumerable: !1, configurable: !0 }), t.prototype.autoConfigure = function(e) {\n            if (!this.cameraPosition.isConnected) {\n              var n = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.CameraPosition;\n              });\n              n || (n = new Et(\"cameraPosition\")).setAsSystemValue(gt.CameraPosition), n.output.connectTo(this.cameraPosition);\n            }\n            if (!this.view.isConnected) {\n              var i = e.getInputBlockByPredicate(function(o) {\n                return o.systemValue === gt.View;\n              });\n              i || (i = new Et(\"view\")).setAsSystemValue(gt.View), i.output.connectTo(this.view);\n            }\n          }, t.prototype.prepareDefines = function(e, n, i) {\n            i.setValue(\"PBR\", !0), i.setValue(\"METALLICWORKFLOW\", !0), i.setValue(\"DEBUGMODE\", this.debugMode, !0), i.setValue(\"NORMALXYSCALE\", !0), i.setValue(\"BUMP\", this.perturbedNormal.isConnected, !0), i.setValue(\"LODBASEDMICROSFURACE\", this._scene.getEngine().getCaps().textureLOD), i.setValue(\"ALBEDO\", !1, !0), i.setValue(\"OPACITY\", this.opacity.isConnected, !0), i.setValue(\"AMBIENT\", !0, !0), i.setValue(\"AMBIENTINGRAYSCALE\", !1, !0), i.setValue(\"REFLECTIVITY\", !1, !0), i.setValue(\"AOSTOREINMETALMAPRED\", !1, !0), i.setValue(\"METALLNESSSTOREINMETALMAPBLUE\", !1, !0), i.setValue(\"ROUGHNESSSTOREINMETALMAPALPHA\", !1, !0), i.setValue(\"ROUGHNESSSTOREINMETALMAPGREEN\", !1, !0), this.lightFalloff === pn.LIGHTFALLOFF_STANDARD ? (i.setValue(\"USEPHYSICALLIGHTFALLOFF\", !1), i.setValue(\"USEGLTFLIGHTFALLOFF\", !1)) : this.lightFalloff === pn.LIGHTFALLOFF_GLTF ? (i.setValue(\"USEPHYSICALLIGHTFALLOFF\", !1), i.setValue(\"USEGLTFLIGHTFALLOFF\", !0)) : (i.setValue(\"USEPHYSICALLIGHTFALLOFF\", !0), i.setValue(\"USEGLTFLIGHTFALLOFF\", !1));\n            var o = this.alphaTestCutoff.toString();\n            if (i.setValue(\"ALPHABLEND\", this.useAlphaBlending, !0), i.setValue(\"ALPHAFROMALBEDO\", !1, !0), i.setValue(\"ALPHATEST\", this.useAlphaTest, !0), i.setValue(\"ALPHATESTVALUE\", o.indexOf(\".\") < 0 ? o + \".\" : o, !0), i.setValue(\"OPACITYRGB\", !1, !0), i.setValue(\"RADIANCEOVERALPHA\", this.useRadianceOverAlpha, !0), i.setValue(\"SPECULAROVERALPHA\", this.useSpecularOverAlpha, !0), i.setValue(\"SPECULARAA\", this._scene.getEngine().getCaps().standardDerivatives && this.enableSpecularAntiAliasing, !0), i.setValue(\"REALTIME_FILTERING\", this.realTimeFiltering, !0), this._scene.getEngine().webGLVersion > 1 ? i.setValue(\"NUM_SAMPLES\", this.realTimeFilteringQuality + \"u\", !0) : i.setValue(\"NUM_SAMPLES\", \"\" + this.realTimeFilteringQuality, !0), i.setValue(\"BRDF_V_HEIGHT_CORRELATED\", !0), i.setValue(\"MS_BRDF_ENERGY_CONSERVATION\", this.useEnergyConservation, !0), i.setValue(\"RADIANCEOCCLUSION\", this.useRadianceOcclusion, !0), i.setValue(\"HORIZONOCCLUSION\", this.useHorizonOcclusion, !0), i.setValue(\"UNLIT\", this.unlit, !0), i.setValue(\"FORCENORMALFORWARD\", this.forceNormalForward, !0), this._environmentBRDFTexture && lt.a.ReflectionTextureEnabled ? (i.setValue(\"ENVIRONMENTBRDF\", !0), i.setValue(\"ENVIRONMENTBRDF_RGBD\", this._environmentBRDFTexture.isRGBD, !0)) : (i.setValue(\"ENVIRONMENTBRDF\", !1), i.setValue(\"ENVIRONMENTBRDF_RGBD\", !1)), i._areLightsDirty) {\n              var a = e.getScene();\n              if (this.light) {\n                var s = { needNormals: !1, needRebuild: !1, lightmapMode: !1, shadowEnabled: !1, specularEnabled: !1 };\n                $e.a.PrepareDefinesForLight(a, e, this.light, this._lightId, i, !0, s), s.needRebuild && i.rebuild();\n              } else\n                $e.a.PrepareDefinesForLights(a, e, i, !0, n.maxSimultaneousLights), i._needNormals = !0, $e.a.PrepareDefinesForMultiview(a, i);\n            }\n          }, t.prototype.updateUniformsAndSamples = function(e, n, i, o) {\n            for (var a = 0; a < n.maxSimultaneousLights && i[\"LIGHT\" + a]; a++) {\n              var s = e.uniforms.indexOf(\"vLightData\" + a) >= 0;\n              $e.a.PrepareUniformsAndSamplersForLight(a, e.uniforms, e.samplers, i[\"PROJECTEDLIGHTTEXTURE\" + a], o, s);\n            }\n          }, t.prototype.bind = function(e, n, i) {\n            var o, a;\n            if (i) {\n              var s = i.getScene();\n              this.light ? $e.a.BindLight(this.light, this._lightId, s, e, !0) : $e.a.BindLights(s, i, e, !0, n.maxSimultaneousLights), e.setTexture(this._environmentBrdfSamplerName, this._environmentBRDFTexture), e.setFloat2(\"vDebugMode\", this.debugLimit, this.debugFactor);\n              var d = this._scene.ambientColor;\n              d && e.setColor3(\"ambientFromScene\", d);\n              var p = s.useRightHandedSystem === (s._mirroredCameraPosition != null);\n              e.setFloat(this._invertNormalName, p ? -1 : 1), e.setFloat4(\"vLightingIntensity\", this.directIntensity, 1, this.environmentIntensity * this._scene.environmentIntensity, this.specularIntensity);\n              var y = (a = (o = this.indexOfRefraction.connectInputBlock) === null || o === void 0 ? void 0 : o.value) !== null && a !== void 0 ? a : 1.5, P = Math.pow((y - 1) / (y + 1), 2);\n              this._metallicReflectanceColor.scaleToRef(P * this._metallicF0Factor, I.c.Color3[0]);\n              var R = this._metallicF0Factor;\n              e.setColor4(this._vMetallicReflectanceFactorsName, I.c.Color3[0], R);\n            }\n          }, t.prototype._injectVertexCode = function(e) {\n            var n, i, o = this.worldPosition, a = \"//\" + this.name;\n            this.light ? (this._lightId = (e.counters.lightCounter !== void 0 ? e.counters.lightCounter : -1) + 1, e.counters.lightCounter = this._lightId, e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", a, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString())) : (e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", a, { repeatKey: \"maxSimultaneousLights\" }), this._lightId = 0, e.sharedData.dynamicUniformBlocks.push(this));\n            var s = \"v_\" + o.associatedVariableName;\n            e._emitVaryingFromString(s, \"vec4\") && (e.compilationString += s + \" = \" + o.associatedVariableName + `;\\r\n`);\n            var d = this.reflection.isConnected ? (n = this.reflection.connectedPoint) === null || n === void 0 ? void 0 : n.ownerBlock : null;\n            d && (d.viewConnectionPoint = this.view), e.compilationString += (i = d == null ? void 0 : d.handleVertexSide(e)) !== null && i !== void 0 ? i : \"\", e._emitUniformFromString(\"vDebugMode\", \"vec2\", \"defined(IGNORE) || DEBUGMODE > 0\"), e._emitUniformFromString(\"ambientFromScene\", \"vec3\"), e._emitVaryingFromString(\"vClipSpacePosition\", \"vec4\", \"defined(IGNORE) || DEBUGMODE > 0\") && (e._injectAtEnd += `#if DEBUGMODE > 0\\r\n`, e._injectAtEnd += `vClipSpacePosition = gl_Position;\\r\n`, e._injectAtEnd += `#endif\\r\n`), this.light ? e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", a, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }, { search: /worldPos/g, replace: o.associatedVariableName }] }) : (e.compilationString += \"vec4 worldPos = \" + o.associatedVariableName + `;\\r\n`, this.view.isConnected && (e.compilationString += \"mat4 view = \" + this.view.associatedVariableName + `;\\r\n`), e.compilationString += e._emitCodeFromInclude(\"shadowsVertex\", a, { repeatKey: \"maxSimultaneousLights\" }));\n          }, t.prototype._getAlbedoOpacityCode = function() {\n            var e = `albedoOpacityOutParams albedoOpacityOut;\\r\n`;\n            return e += `albedoOpacityBlock(\n                vec4(` + (this.baseColor.isConnected ? this.baseColor.associatedVariableName : \"vec3(1.)\") + `, 1.),\n            #ifdef ALBEDO\n                vec4(1.),\n                vec2(1., 1.),\n            #endif\n            #ifdef OPACITY\n                vec4(` + (this.opacity.isConnected ? this.opacity.associatedVariableName : \"1.\") + `),\n                vec2(1., 1.),\n            #endif\n                albedoOpacityOut\n            );\n\n            vec3 surfaceAlbedo = albedoOpacityOut.surfaceAlbedo;\n            float alpha = albedoOpacityOut.alpha;\\r\n`;\n          }, t.prototype._getAmbientOcclusionCode = function() {\n            var e = `ambientOcclusionOutParams aoOut;\\r\n`;\n            return e += `ambientOcclusionBlock(\n            #ifdef AMBIENT\n                vec3(` + (this.ambientOcc.isConnected ? this.ambientOcc.associatedVariableName : \"1.\") + `),\n                vec4(0., 1.0, 1.0, 0.),\n            #endif\n                aoOut\n            );\\r\n`;\n          }, t.prototype._getReflectivityCode = function(e) {\n            var n = `reflectivityOutParams reflectivityOut;\\r\n`;\n            return this._vMetallicReflectanceFactorsName = e._getFreeVariableName(\"vMetallicReflectanceFactors\"), e._emitUniformFromString(this._vMetallicReflectanceFactorsName, \"vec4\"), n += `vec3 baseColor = surfaceAlbedo;\n\n            reflectivityBlock(\n                vec4(` + this.metallic.associatedVariableName + \", \" + this.roughness.associatedVariableName + `, 0., 0.),\n            #ifdef METALLICWORKFLOW\n                surfaceAlbedo,\n                ` + this._vMetallicReflectanceFactorsName + `,\n            #endif\n            #ifdef REFLECTIVITY\n                vec3(0., 0., 1.),\n                vec4(1.),\n            #endif\n            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY)  && defined(AOSTOREINMETALMAPRED)\n                aoOut.ambientOcclusionColor,\n            #endif\n            #ifdef MICROSURFACEMAP\n                microSurfaceTexel, <== not handled!\n            #endif\n                reflectivityOut\n            );\n\n            float microSurface = reflectivityOut.microSurface;\n            float roughness = reflectivityOut.roughness;\n\n            #ifdef METALLICWORKFLOW\n                surfaceAlbedo = reflectivityOut.surfaceAlbedo;\n            #endif\n            #if defined(METALLICWORKFLOW) && defined(REFLECTIVITY) && defined(AOSTOREINMETALMAPRED)\n                aoOut.ambientOcclusionColor = reflectivityOut.ambientOcclusionColor;\n            #endif\\r\n`;\n          }, t.prototype._buildBlock = function(e) {\n            var n, i, o, a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe, ve, Te, Re, Ae, Ee, Se, De, xe, Le, Me, we, Ye, et, nt, ct, Ke, rt, it, qe, ut;\n            r.prototype._buildBlock.call(this, e), this._scene = e.sharedData.scene, this._environmentBRDFTexture || (this._environmentBRDFTexture = Ho.GetEnvironmentBRDFTexture(this._scene));\n            var Ve = this.reflection.isConnected ? (n = this.reflection.connectedPoint) === null || n === void 0 ? void 0 : n.ownerBlock : null;\n            if (Ve && (Ve.worldPositionConnectionPoint = this.worldPosition, Ve.cameraPositionConnectionPoint = this.cameraPosition, Ve.worldNormalConnectionPoint = this.worldNormal), e.target !== Ce.Fragment)\n              return this._injectVertexCode(e), this;\n            e.sharedData.bindableBlocks.push(this), e.sharedData.blocksWithDefines.push(this);\n            var Ze = \"//\" + this.name, vt = \"v_\" + this.worldPosition.associatedVariableName, jt = this.perturbedNormal;\n            this._environmentBrdfSamplerName = e._getFreeVariableName(\"environmentBrdfSampler\"), e._emit2DSampler(this._environmentBrdfSamplerName), e.sharedData.hints.needAlphaBlending = e.sharedData.hints.needAlphaBlending || this.useAlphaBlending, e.sharedData.hints.needAlphaTesting = e.sharedData.hints.needAlphaTesting || this.useAlphaTest, e._emitExtension(\"lod\", \"#extension GL_EXT_shader_texture_lod : enable\", \"defined(LODBASEDMICROSFURACE)\"), e._emitExtension(\"derivatives\", \"#extension GL_OES_standard_derivatives : enable\"), this.light ? e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", Ze, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }, this._lightId.toString()) : e._emitFunctionFromInclude(e.supportUniformBuffers ? \"lightUboDeclaration\" : \"lightFragmentDeclaration\", Ze, { repeatKey: \"maxSimultaneousLights\" }), e._emitFunctionFromInclude(\"helperFunctions\", Ze), e._emitFunctionFromInclude(\"importanceSampling\", Ze), e._emitFunctionFromInclude(\"pbrHelperFunctions\", Ze), e._emitFunctionFromInclude(\"imageProcessingFunctions\", Ze), e._emitFunctionFromInclude(\"shadowsFragmentFunctions\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }] }), e._emitFunctionFromInclude(\"pbrDirectLightingSetupFunctions\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }] }), e._emitFunctionFromInclude(\"pbrDirectLightingFalloffFunctions\", Ze), e._emitFunctionFromInclude(\"pbrBRDFFunctions\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (i = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && i !== void 0 ? i : \"REFLECTIONMAP_SKYBOX\" }] }), e._emitFunctionFromInclude(\"hdrFilteringFunctions\", Ze), e._emitFunctionFromInclude(\"pbrDirectLightingFunctions\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }] }), e._emitFunctionFromInclude(\"pbrIBLFunctions\", Ze), e._emitFunctionFromInclude(\"pbrBlockAlbedoOpacity\", Ze), e._emitFunctionFromInclude(\"pbrBlockReflectivity\", Ze), e._emitFunctionFromInclude(\"pbrBlockAmbientOcclusion\", Ze), e._emitFunctionFromInclude(\"pbrBlockAlphaFresnel\", Ze), e._emitFunctionFromInclude(\"pbrBlockAnisotropic\", Ze), e._emitUniformFromString(\"vLightingIntensity\", \"vec4\"), this._vNormalWName = e._getFreeVariableName(\"vNormalW\"), e.compilationString += \"vec4 \" + this._vNormalWName + \" = normalize(\" + this.worldNormal.associatedVariableName + `);\\r\n`, e._registerTempVariable(\"viewDirectionW\") && (e.compilationString += \"vec3 viewDirectionW = normalize(\" + this.cameraPosition.associatedVariableName + \" - \" + vt + `.xyz);\\r\n`), e.compilationString += \"vec3 geometricNormalW = \" + this._vNormalWName + `.xyz;\\r\n`, e.compilationString += \"vec3 normalW = \" + (jt.isConnected ? \"normalize(\" + jt.associatedVariableName + \".xyz)\" : \"geometricNormalW\") + `;\\r\n`, this._invertNormalName = e._getFreeVariableName(\"invertNormal\"), e._emitUniformFromString(this._invertNormalName, \"float\"), e.compilationString += e._emitCodeFromInclude(\"pbrBlockNormalFinal\", Ze, { replaceStrings: [{ search: /vPositionW/g, replace: vt + \".xyz\" }, { search: /vEyePosition.w/g, replace: this._invertNormalName }] }), e.compilationString += this._getAlbedoOpacityCode(), e.compilationString += e._emitCodeFromInclude(\"depthPrePass\", Ze), e.compilationString += this._getAmbientOcclusionCode(), e.compilationString += e._emitCodeFromInclude(\"pbrBlockLightmapInit\", Ze), e.compilationString += `#ifdef UNLIT\n                vec3 diffuseBase = vec3(1., 1., 1.);\n            #else\\r\n`, e.compilationString += this._getReflectivityCode(e), e.compilationString += e._emitCodeFromInclude(\"pbrBlockGeometryInfo\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (o = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && o !== void 0 ? o : \"REFLECTIONMAP_SKYBOX\" }, { search: /REFLECTIONMAP_3D/g, replace: (a = Ve == null ? void 0 : Ve._define3DName) !== null && a !== void 0 ? a : \"REFLECTIONMAP_3D\" }] });\n            var Dt = this.anisotropy.isConnected ? (s = this.anisotropy.connectedPoint) === null || s === void 0 ? void 0 : s.ownerBlock : null;\n            Dt && (Dt.worldPositionConnectionPoint = this.worldPosition, Dt.worldNormalConnectionPoint = this.worldNormal, e.compilationString += Dt.getCode(e, !this.perturbedNormal.isConnected)), Ve && Ve.hasTexture && (e.compilationString += Ve.getCode(e, Dt ? \"anisotropicOut.anisotropicNormal\" : \"normalW\")), e._emitFunctionFromInclude(\"pbrBlockReflection\", Ze, { replaceStrings: [{ search: /computeReflectionCoords/g, replace: \"computeReflectionCoordsPBR\" }, { search: /REFLECTIONMAP_3D/g, replace: (d = Ve == null ? void 0 : Ve._define3DName) !== null && d !== void 0 ? d : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (p = Ve == null ? void 0 : Ve._defineOppositeZ) !== null && p !== void 0 ? p : \"REFLECTIONMAP_OPPOSITEZ\" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: (y = Ve == null ? void 0 : Ve._defineProjectionName) !== null && y !== void 0 ? y : \"REFLECTIONMAP_PROJECTION\" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: (P = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && P !== void 0 ? P : \"REFLECTIONMAP_SKYBOX\" }, { search: /LODINREFLECTIONALPHA/g, replace: (R = Ve == null ? void 0 : Ve._defineLODReflectionAlpha) !== null && R !== void 0 ? R : \"LODINREFLECTIONALPHA\" }, { search: /LINEARSPECULARREFLECTION/g, replace: (B = Ve == null ? void 0 : Ve._defineLinearSpecularReflection) !== null && B !== void 0 ? B : \"LINEARSPECULARREFLECTION\" }, { search: /vReflectionFilteringInfo/g, replace: (F = Ve == null ? void 0 : Ve._vReflectionFilteringInfoName) !== null && F !== void 0 ? F : \"vReflectionFilteringInfo\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockReflectance0\", Ze, { replaceStrings: [{ search: /metallicReflectanceFactors/g, replace: this._vMetallicReflectanceFactorsName }] });\n            var Yt = this.sheen.isConnected ? (z = this.sheen.connectedPoint) === null || z === void 0 ? void 0 : z.ownerBlock : null;\n            Yt && (e.compilationString += Yt.getCode(Ve)), e._emitFunctionFromInclude(\"pbrBlockSheen\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_3D/g, replace: (J = Ve == null ? void 0 : Ve._define3DName) !== null && J !== void 0 ? J : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: (ie = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && ie !== void 0 ? ie : \"REFLECTIONMAP_SKYBOX\" }, { search: /LODINREFLECTIONALPHA/g, replace: (se = Ve == null ? void 0 : Ve._defineLODReflectionAlpha) !== null && se !== void 0 ? se : \"LODINREFLECTIONALPHA\" }, { search: /LINEARSPECULARREFLECTION/g, replace: (ce = Ve == null ? void 0 : Ve._defineLinearSpecularReflection) !== null && ce !== void 0 ? ce : \"LINEARSPECULARREFLECTION\" }] });\n            var mt = this.clearcoat.isConnected ? (ue = this.clearcoat.connectedPoint) === null || ue === void 0 ? void 0 : ue.ownerBlock : null, qt = !this.perturbedNormal.isConnected && !this.anisotropy.isConnected, Ht = this.perturbedNormal.isConnected && ((fe = this.perturbedNormal.connectedPoint) === null || fe === void 0 ? void 0 : fe.ownerBlock).worldTangent.isConnected, kt = this.anisotropy.isConnected && ((ve = this.anisotropy.connectedPoint) === null || ve === void 0 ? void 0 : ve.ownerBlock).worldTangent.isConnected, Wt = Ht || !this.perturbedNormal.isConnected && kt;\n            e.compilationString += la.GetCode(e, mt, Ve, vt, qt, Wt, this.worldNormal.associatedVariableName), qt && (Wt = (Te = mt == null ? void 0 : mt.worldTangent.isConnected) !== null && Te !== void 0 && Te), e._emitFunctionFromInclude(\"pbrBlockClearcoat\", Ze, { replaceStrings: [{ search: /computeReflectionCoords/g, replace: \"computeReflectionCoordsPBR\" }, { search: /REFLECTIONMAP_3D/g, replace: (Re = Ve == null ? void 0 : Ve._define3DName) !== null && Re !== void 0 ? Re : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (Ae = Ve == null ? void 0 : Ve._defineOppositeZ) !== null && Ae !== void 0 ? Ae : \"REFLECTIONMAP_OPPOSITEZ\" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: (Ee = Ve == null ? void 0 : Ve._defineProjectionName) !== null && Ee !== void 0 ? Ee : \"REFLECTIONMAP_PROJECTION\" }, { search: /REFLECTIONMAP_SKYBOX/g, replace: (Se = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && Se !== void 0 ? Se : \"REFLECTIONMAP_SKYBOX\" }, { search: /LODINREFLECTIONALPHA/g, replace: (De = Ve == null ? void 0 : Ve._defineLODReflectionAlpha) !== null && De !== void 0 ? De : \"LODINREFLECTIONALPHA\" }, { search: /LINEARSPECULARREFLECTION/g, replace: (xe = Ve == null ? void 0 : Ve._defineLinearSpecularReflection) !== null && xe !== void 0 ? xe : \"LINEARSPECULARREFLECTION\" }, { search: /defined\\(TANGENT\\)/g, replace: Wt ? \"defined(TANGENT)\" : \"defined(IGNORE)\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockReflectance\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_SKYBOX/g, replace: (Le = Ve == null ? void 0 : Ve._defineSkyboxName) !== null && Le !== void 0 ? Le : \"REFLECTIONMAP_SKYBOX\" }, { search: /REFLECTIONMAP_3D/g, replace: (Me = Ve == null ? void 0 : Ve._define3DName) !== null && Me !== void 0 ? Me : \"REFLECTIONMAP_3D\" }] });\n            var bt = this.subsurface.isConnected ? (we = this.subsurface.connectedPoint) === null || we === void 0 ? void 0 : we.ownerBlock : null, Rt = this.subsurface.isConnected ? (et = ((Ye = this.subsurface.connectedPoint) === null || Ye === void 0 ? void 0 : Ye.ownerBlock).refraction.connectedPoint) === null || et === void 0 ? void 0 : et.ownerBlock : null;\n            Rt && (Rt.viewConnectionPoint = this.view, Rt.indexOfRefractionConnectionPoint = this.indexOfRefraction), e.compilationString += ua.GetCode(e, bt, Ve, vt), e._emitFunctionFromInclude(\"pbrBlockSubSurface\", Ze, { replaceStrings: [{ search: /REFLECTIONMAP_3D/g, replace: (nt = Ve == null ? void 0 : Ve._define3DName) !== null && nt !== void 0 ? nt : \"REFLECTIONMAP_3D\" }, { search: /REFLECTIONMAP_OPPOSITEZ/g, replace: (ct = Ve == null ? void 0 : Ve._defineOppositeZ) !== null && ct !== void 0 ? ct : \"REFLECTIONMAP_OPPOSITEZ\" }, { search: /REFLECTIONMAP_PROJECTION/g, replace: (Ke = Ve == null ? void 0 : Ve._defineProjectionName) !== null && Ke !== void 0 ? Ke : \"REFLECTIONMAP_PROJECTION\" }, { search: /SS_REFRACTIONMAP_3D/g, replace: (rt = Rt == null ? void 0 : Rt._define3DName) !== null && rt !== void 0 ? rt : \"SS_REFRACTIONMAP_3D\" }, { search: /SS_LODINREFRACTIONALPHA/g, replace: (it = Rt == null ? void 0 : Rt._defineLODRefractionAlpha) !== null && it !== void 0 ? it : \"SS_LODINREFRACTIONALPHA\" }, { search: /SS_LINEARSPECULARREFRACTION/g, replace: (qe = Rt == null ? void 0 : Rt._defineLinearSpecularRefraction) !== null && qe !== void 0 ? qe : \"SS_LINEARSPECULARREFRACTION\" }, { search: /SS_REFRACTIONMAP_OPPOSITEZ/g, replace: (ut = Rt == null ? void 0 : Rt._defineOppositeZ) !== null && ut !== void 0 ? ut : \"SS_REFRACTIONMAP_OPPOSITEZ\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockDirectLighting\", Ze), this.light ? e.compilationString += e._emitCodeFromInclude(\"lightFragment\", Ze, { replaceStrings: [{ search: /{X}/g, replace: this._lightId.toString() }] }) : e.compilationString += e._emitCodeFromInclude(\"lightFragment\", Ze, { repeatKey: \"maxSimultaneousLights\" }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockFinalLitComponents\", Ze), e.compilationString += `#endif\\r\n`;\n            var Zt = this.ambientColor.isConnected ? this.ambientColor.associatedVariableName : \"vec3(0., 0., 0.)\", Mn = pn.DEFAULT_AO_ON_ANALYTICAL_LIGHTS.toString();\n            Mn.indexOf(\".\") === -1 && (Mn += \".\"), e.compilationString += e._emitCodeFromInclude(\"pbrBlockFinalUnlitComponents\", Ze, { replaceStrings: [{ search: /vec3 finalEmissive[\\s\\S]*?finalEmissive\\*=vLightingIntensity\\.y;/g, replace: \"\" }, { search: /vAmbientColor/g, replace: Zt + \" * ambientFromScene\" }, { search: /vAmbientInfos\\.w/g, replace: Mn }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockFinalColorComposition\", Ze, { replaceStrings: [{ search: /finalEmissive/g, replace: \"vec3(0.)\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrBlockImageProcessing\", Ze, { replaceStrings: [{ search: /visibility/g, replace: \"1.\" }] }), e.compilationString += e._emitCodeFromInclude(\"pbrDebug\", Ze, { replaceStrings: [{ search: /vNormalW/g, replace: this._vNormalWName }, { search: /vPositionW/g, replace: vt }, { search: /albedoTexture\\.rgb;/g, replace: `vec3(1.);\\r\ngl_FragColor.rgb = toGammaSpace(gl_FragColor.rgb);\\r\n` }] });\n            for (var Bn = 0, Kn = this._outputs; Bn < Kn.length; Bn++) {\n              var In = Kn[Bn];\n              if (In.hasEndpoints) {\n                var Kt = j_[In.name];\n                if (Kt) {\n                  var oi = Kt[0], Ti = Kt[1];\n                  Ti && (e.compilationString += \"#if \" + Ti + `\\r\n`), e.compilationString += this._declareOutput(In, e) + \" = \" + oi + `;\\r\n`, Ti && (e.compilationString += `#else\\r\n`, e.compilationString += this._declareOutput(In, e) + ` = vec3(0.);\\r\n`, e.compilationString += `#endif\\r\n`);\n                } else\n                  console.error(\"There's no remapping for the \" + In.name + \" end point! No code generated\");\n              }\n            }\n            return this;\n          }, t.prototype._dumpPropertiesCode = function() {\n            var e = \"\";\n            return e += this._codeVariableName + \".lightFalloff = \" + this.lightFalloff + `;\\r\n`, e += this._codeVariableName + \".useAlphaTest = \" + this.useAlphaTest + `;\\r\n`, e += this._codeVariableName + \".alphaTestCutoff = \" + this.alphaTestCutoff + `;\\r\n`, e += this._codeVariableName + \".useAlphaBlending = \" + this.useAlphaBlending + `;\\r\n`, e += this._codeVariableName + \".useRadianceOverAlpha = \" + this.useRadianceOverAlpha + `;\\r\n`, e += this._codeVariableName + \".useSpecularOverAlpha = \" + this.useSpecularOverAlpha + `;\\r\n`, e += this._codeVariableName + \".enableSpecularAntiAliasing = \" + this.enableSpecularAntiAliasing + `;\\r\n`, e += this._codeVariableName + \".realTimeFiltering = \" + this.realTimeFiltering + `;\\r\n`, e += this._codeVariableName + \".realTimeFilteringQuality = \" + this.realTimeFilteringQuality + `;\\r\n`, e += this._codeVariableName + \".useEnergyConservation = \" + this.useEnergyConservation + `;\\r\n`, e += this._codeVariableName + \".useRadianceOcclusion = \" + this.useRadianceOcclusion + `;\\r\n`, e += this._codeVariableName + \".useHorizonOcclusion = \" + this.useHorizonOcclusion + `;\\r\n`, e += this._codeVariableName + \".unlit = \" + this.unlit + `;\\r\n`, e += this._codeVariableName + \".forceNormalForward = \" + this.forceNormalForward + `;\\r\n`, e += this._codeVariableName + \".debugMode = \" + this.debugMode + `;\\r\n`, e += this._codeVariableName + \".debugLimit = \" + this.debugLimit + `;\\r\n`, e += this._codeVariableName + \".debugFactor = \" + this.debugFactor + `;\\r\n`;\n          }, t.prototype.serialize = function() {\n            var e = r.prototype.serialize.call(this);\n            return this.light && (e.lightId = this.light.id), e.lightFalloff = this.lightFalloff, e.useAlphaTest = this.useAlphaTest, e.alphaTestCutoff = this.alphaTestCutoff, e.useAlphaBlending = this.useAlphaBlending, e.useRadianceOverAlpha = this.useRadianceOverAlpha, e.useSpecularOverAlpha = this.useSpecularOverAlpha, e.enableSpecularAntiAliasing = this.enableSpecularAntiAliasing, e.realTimeFiltering = this.realTimeFiltering, e.realTimeFilteringQuality = this.realTimeFilteringQuality, e.useEnergyConservation = this.useEnergyConservation, e.useRadianceOcclusion = this.useRadianceOcclusion, e.useHorizonOcclusion = this.useHorizonOcclusion, e.unlit = this.unlit, e.forceNormalForward = this.forceNormalForward, e.debugMode = this.debugMode, e.debugLimit = this.debugLimit, e.debugFactor = this.debugFactor, e;\n          }, t.prototype._deserialize = function(e, n, i) {\n            var o, a;\n            r.prototype._deserialize.call(this, e, n, i), e.lightId && (this.light = n.getLightByID(e.lightId)), this.lightFalloff = (o = e.lightFalloff) !== null && o !== void 0 ? o : 0, this.useAlphaTest = e.useAlphaTest, this.alphaTestCutoff = e.alphaTestCutoff, this.useAlphaBlending = e.useAlphaBlending, this.useRadianceOverAlpha = e.useRadianceOverAlpha, this.useSpecularOverAlpha = e.useSpecularOverAlpha, this.enableSpecularAntiAliasing = e.enableSpecularAntiAliasing, this.realTimeFiltering = !!e.realTimeFiltering, this.realTimeFilteringQuality = (a = e.realTimeFilteringQuality) !== null && a !== void 0 ? a : h.a.TEXTURE_FILTERING_QUALITY_LOW, this.useEnergyConservation = e.useEnergyConservation, this.useRadianceOcclusion = e.useRadianceOcclusion, this.useHorizonOcclusion = e.useHorizonOcclusion, this.unlit = e.unlit, this.forceNormalForward = !!e.forceNormalForward, this.debugMode = e.debugMode, this.debugLimit = e.debugLimit, this.debugFactor = e.debugFactor;\n          }, Object(c.c)([Bt(\"Direct lights\", It.Float, \"INTENSITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"directIntensity\", void 0), Object(c.c)([Bt(\"Environment lights\", It.Float, \"INTENSITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"environmentIntensity\", void 0), Object(c.c)([Bt(\"Specular highlights\", It.Float, \"INTENSITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"specularIntensity\", void 0), Object(c.c)([Bt(\"Light falloff\", It.List, \"LIGHTING & COLORS\", { notifiers: { update: !0 }, options: [{ label: \"Physical\", value: pn.LIGHTFALLOFF_PHYSICAL }, { label: \"GLTF\", value: pn.LIGHTFALLOFF_GLTF }, { label: \"Standard\", value: pn.LIGHTFALLOFF_STANDARD }] })], t.prototype, \"lightFalloff\", void 0), Object(c.c)([Bt(\"Alpha Testing\", It.Boolean, \"OPACITY\")], t.prototype, \"useAlphaTest\", void 0), Object(c.c)([Bt(\"Alpha CutOff\", It.Float, \"OPACITY\", { min: 0, max: 1, notifiers: { update: !0 } })], t.prototype, \"alphaTestCutoff\", void 0), Object(c.c)([Bt(\"Alpha blending\", It.Boolean, \"OPACITY\")], t.prototype, \"useAlphaBlending\", void 0), Object(c.c)([Bt(\"Radiance over alpha\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"useRadianceOverAlpha\", void 0), Object(c.c)([Bt(\"Specular over alpha\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"useSpecularOverAlpha\", void 0), Object(c.c)([Bt(\"Specular anti-aliasing\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"enableSpecularAntiAliasing\", void 0), Object(c.c)([Bt(\"Realtime filtering\", It.Boolean, \"RENDERING\", { notifiers: { update: !0 } })], t.prototype, \"realTimeFiltering\", void 0), Object(c.c)([Bt(\"Realtime filtering quality\", It.List, \"RENDERING\", { notifiers: { update: !0 }, options: [{ label: \"Low\", value: h.a.TEXTURE_FILTERING_QUALITY_LOW }, { label: \"Medium\", value: h.a.TEXTURE_FILTERING_QUALITY_MEDIUM }, { label: \"High\", value: h.a.TEXTURE_FILTERING_QUALITY_HIGH }] })], t.prototype, \"realTimeFilteringQuality\", void 0), Object(c.c)([Bt(\"Energy Conservation\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useEnergyConservation\", void 0), Object(c.c)([Bt(\"Radiance occlusion\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useRadianceOcclusion\", void 0), Object(c.c)([Bt(\"Horizon occlusion\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"useHorizonOcclusion\", void 0), Object(c.c)([Bt(\"Unlit\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"unlit\", void 0), Object(c.c)([Bt(\"Force normal forward\", It.Boolean, \"ADVANCED\", { notifiers: { update: !0 } })], t.prototype, \"forceNormalForward\", void 0), Object(c.c)([Bt(\"Debug mode\", It.List, \"DEBUG\", { notifiers: { update: !0 }, options: [{ label: \"None\", value: 0 }, { label: \"Normalized position\", value: 1 }, { label: \"Normals\", value: 2 }, { label: \"Tangents\", value: 3 }, { label: \"Bitangents\", value: 4 }, { label: \"Bump Normals\", value: 5 }, { label: \"ClearCoat Normals\", value: 8 }, { label: \"ClearCoat Tangents\", value: 9 }, { label: \"ClearCoat Bitangents\", value: 10 }, { label: \"Anisotropic Normals\", value: 11 }, { label: \"Anisotropic Tangents\", value: 12 }, { label: \"Anisotropic Bitangents\", value: 13 }, { label: \"Env Refraction\", value: 40 }, { label: \"Env Reflection\", value: 41 }, { label: \"Env Clear Coat\", value: 42 }, { label: \"Direct Diffuse\", value: 50 }, { label: \"Direct Specular\", value: 51 }, { label: \"Direct Clear Coat\", value: 52 }, { label: \"Direct Sheen\", value: 53 }, { label: \"Env Irradiance\", value: 54 }, { label: \"Surface Albedo\", value: 60 }, { label: \"Reflectance 0\", value: 61 }, { label: \"Metallic\", value: 62 }, { label: \"Metallic F0\", value: 71 }, { label: \"Roughness\", value: 63 }, { label: \"AlphaG\", value: 64 }, { label: \"NdotV\", value: 65 }, { label: \"ClearCoat Color\", value: 66 }, { label: \"ClearCoat Roughness\", value: 67 }, { label: \"ClearCoat NdotV\", value: 68 }, { label: \"Transmittance\", value: 69 }, { label: \"Refraction Transmittance\", value: 70 }, { label: \"SEO\", value: 80 }, { label: \"EHO\", value: 81 }, { label: \"Energy Factor\", value: 82 }, { label: \"Specular Reflectance\", value: 83 }, { label: \"Clear Coat Reflectance\", value: 84 }, { label: \"Sheen Reflectance\", value: 85 }, { label: \"Luminance Over Alpha\", value: 86 }, { label: \"Alpha\", value: 87 }] })], t.prototype, \"debugMode\", void 0), Object(c.c)([Bt(\"Split position\", It.Float, \"DEBUG\", { min: -1, max: 1, notifiers: { update: !0 } })], t.prototype, \"debugLimit\", void 0), Object(c.c)([Bt(\"Output factor\", It.Float, \"DEBUG\", { min: 0, max: 5, notifiers: { update: !0 } })], t.prototype, \"debugFactor\", void 0), t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.PBRMetallicRoughnessBlock\"] = Xh;\n        var Yh = function(r) {\n          function t(e) {\n            var n = r.call(this, e, Ce.Neutral) || this;\n            return n.registerInput(\"left\", le.AutoDetect), n.registerInput(\"right\", le.AutoDetect), n.registerOutput(\"output\", le.BasedOnInput), n._outputs[0]._typeConnectionSource = n._inputs[0], n._linkConnectionTypes(0, 1), n;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ModBlock\";\n          }, Object.defineProperty(t.prototype, \"left\", { get: function() {\n            return this._inputs[0];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"right\", { get: function() {\n            return this._inputs[1];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"output\", { get: function() {\n            return this._outputs[0];\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildBlock = function(e) {\n            r.prototype._buildBlock.call(this, e);\n            var n = this._outputs[0];\n            return e.compilationString += this._declareOutput(n, e) + \" = mod(\" + this.left.associatedVariableName + \", \" + this.right.associatedVariableName + `);\\r\n`, this;\n          }, t;\n        }(dt);\n        O.a.RegisteredTypes[\"BABYLON.ModBlock\"] = Yh;\n        var H_ = function() {\n          function r() {\n          }\n          return r.prototype.optimize = function(t, e) {\n          }, r;\n        }(), W_ = f(120), X_ = function() {\n          function r() {\n            this.mm = /* @__PURE__ */ new Map();\n          }\n          return r.prototype.get = function(t, e) {\n            var n = this.mm.get(t);\n            if (n !== void 0)\n              return n.get(e);\n          }, r.prototype.set = function(t, e, n) {\n            var i = this.mm.get(t);\n            i === void 0 && this.mm.set(t, i = /* @__PURE__ */ new Map()), i.set(e, n);\n          }, r;\n        }(), Y_ = function() {\n          function r(t, e, n) {\n            var i = this;\n            this._baseMaterial = t, this._scene = e, this._options = n, this._subMeshToEffect = /* @__PURE__ */ new Map(), this._subMeshToDepthEffect = new X_(), this._meshes = /* @__PURE__ */ new Map();\n            var o = t.getClassName() === \"NodeMaterial\" ? \"u_\" : \"\";\n            if (o) {\n              this._matriceNames = { world: o + \"World\", view: o + \"View\", projection: o + \"Projection\", viewProjection: o + \"ViewProjection\", worldView: o + \"WorldxView\", worldViewProjection: o + \"WorldxViewxProjection\" };\n              for (var a = t.getInputBlocks(), s = 0; s < a.length; ++s)\n                switch (a[s]._systemValue) {\n                  case gt.World:\n                    this._matriceNames.world = a[s].associatedVariableName;\n                    break;\n                  case gt.View:\n                    this._matriceNames.view = a[s].associatedVariableName;\n                    break;\n                  case gt.Projection:\n                    this._matriceNames.projection = a[s].associatedVariableName;\n                    break;\n                  case gt.ViewProjection:\n                    this._matriceNames.viewProjection = a[s].associatedVariableName;\n                    break;\n                  case gt.WorldView:\n                    this._matriceNames.worldView = a[s].associatedVariableName;\n                    break;\n                  case gt.WorldViewProjection:\n                    this._matriceNames.worldViewProjection = a[s].associatedVariableName;\n                }\n            } else\n              this._matriceNames = { world: o + \"world\", view: o + \"view\", projection: o + \"projection\", viewProjection: o + \"viewProjection\", worldView: o + \"worldView\", worldViewProjection: o + \"worldViewProjection\" };\n            this._onEffectCreatedObserver = this._baseMaterial.onEffectCreatedObservable.add(function(d) {\n              var p, y = (p = d.subMesh) === null || p === void 0 ? void 0 : p.getMesh();\n              y && !i._meshes.has(y) && i._meshes.set(y, y.onDisposeObservable.add(function(P) {\n                for (var R = i._subMeshToEffect.keys(), B = R.next(); B.done !== !0; B = R.next()) {\n                  var F = B.value;\n                  (F == null ? void 0 : F.getMesh()) === P && (i._subMeshToEffect.delete(F), i._subMeshToDepthEffect.mm.delete(F));\n                }\n              })), i._subMeshToEffect.set(d.subMesh, d.effect), i._subMeshToDepthEffect.mm.delete(d.subMesh);\n            });\n          }\n          return Object.defineProperty(r.prototype, \"standalone\", { get: function() {\n            var t, e;\n            return (e = (t = this._options) === null || t === void 0 ? void 0 : t.standalone) !== null && e !== void 0 && e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"baseMaterial\", { get: function() {\n            return this._baseMaterial;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getEffect = function(t, e) {\n            var n, i, o, a, s, d;\n            return (d = (o = (i = (n = this._subMeshToDepthEffect.mm.get(t)) === null || n === void 0 ? void 0 : n.get(e)) === null || i === void 0 ? void 0 : i.depthEffect) !== null && o !== void 0 ? o : (s = (a = this._subMeshToDepthEffect.mm.get(null)) === null || a === void 0 ? void 0 : a.get(e)) === null || s === void 0 ? void 0 : s.depthEffect) !== null && d !== void 0 ? d : null;\n          }, r.prototype.isReadyForSubMesh = function(t, e, n, i) {\n            var o, a;\n            return this.standalone && this._baseMaterial.isReadyForSubMesh(t.getMesh(), t, i), (a = (o = this._makeEffect(t, e, n)) === null || o === void 0 ? void 0 : o.isReady()) !== null && a !== void 0 && a;\n          }, r.prototype.dispose = function() {\n            this._baseMaterial.onEffectCreatedObservable.remove(this._onEffectCreatedObserver), this._onEffectCreatedObserver = null;\n            for (var t = this._meshes.entries(), e = t.next(); e.done !== !0; e = t.next()) {\n              var n = e.value, i = n[0], o = n[1];\n              i.onDisposeObservable.remove(o);\n            }\n          }, r.prototype._makeEffect = function(t, e, n) {\n            var i, o = (i = this._subMeshToEffect.get(t)) !== null && i !== void 0 ? i : this._subMeshToEffect.get(null);\n            if (!o)\n              return null;\n            var a = this._subMeshToDepthEffect.get(t, n);\n            a || (a = { depthEffect: null, depthDefines: \"\", token: W_.a.RandomId() }, this._subMeshToDepthEffect.set(t, n, a));\n            var s = e.join(`\n`);\n            if (a.depthEffect && s === a.depthDefines)\n              return a.depthEffect;\n            a.depthDefines = s;\n            var d = o.rawVertexSourceCode, p = o.rawFragmentSourceCode, y = this._options && this._options.remappedVariables ? \"#include<shadowMapVertexNormalBias>(\" + this._options.remappedVariables.join(\",\") + \")\" : ze.a.IncludesShadersStore.shadowMapVertexNormalBias, P = this._options && this._options.remappedVariables ? \"#include<shadowMapVertexMetric>(\" + this._options.remappedVariables.join(\",\") + \")\" : ze.a.IncludesShadersStore.shadowMapVertexMetric, R = this._options && this._options.remappedVariables ? \"#include<shadowMapFragmentSoftTransparentShadow>(\" + this._options.remappedVariables.join(\",\") + \")\" : ze.a.IncludesShadersStore.shadowMapFragmentSoftTransparentShadow, B = ze.a.IncludesShadersStore.shadowMapFragment;\n            d = (d = (d = (d = d.replace(/void\\s+?main/g, ze.a.IncludesShadersStore.shadowMapVertexDeclaration + `\\r\nvoid main`)).replace(/#define SHADOWDEPTH_NORMALBIAS|#define CUSTOM_VERTEX_UPDATE_WORLDPOS/g, y)).indexOf(\"#define SHADOWDEPTH_METRIC\") !== -1 ? d.replace(/#define SHADOWDEPTH_METRIC/g, P) : d.replace(/}\\s*$/g, P + `\\r\n}`)).replace(/#define SHADER_NAME.*?\\n|out vec4 glFragColor;\\n/g, \"\");\n            var F = p.indexOf(\"#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW\") >= 0 || p.indexOf(\"#define CUSTOM_FRAGMENT_BEFORE_FOG\") >= 0, z = p.indexOf(\"#define SHADOWDEPTH_FRAGMENT\") !== -1, J = \"\";\n            F ? p = p.replace(/#define SHADOWDEPTH_SOFTTRANSPARENTSHADOW|#define CUSTOM_FRAGMENT_BEFORE_FOG/g, R) : J = R + `\\r\n`, p = p.replace(/void\\s+?main/g, ze.a.IncludesShadersStore.shadowMapFragmentDeclaration + `\\r\nvoid main`), z ? p = p.replace(/#define SHADOWDEPTH_FRAGMENT/g, B) : J += B + `\\r\n`, J && (p = p.replace(/}\\s*$/g, J + \"}\")), p = p.replace(/#define SHADER_NAME.*?\\n|out vec4 glFragColor;\\n/g, \"\");\n            var ie = o.getUniformNames().slice();\n            return ie.push(\"biasAndScaleSM\", \"depthValuesSM\", \"lightDataSM\", \"softTransparentShadowSM\"), a.depthEffect = this._scene.getEngine().createEffect({ vertexSource: d, fragmentSource: p, vertexToken: a.token, fragmentToken: a.token }, { attributes: o.getAttributesNames(), uniformsNames: ie, uniformBuffersNames: o.getUniformBuffersNames(), samplers: o.getSamplers(), defines: s + `\n` + o.defines.replace(\"#define SHADOWS\", \"\").replace(/#define SHADOW\\d/g, \"\"), indexParameters: o.getIndexParameters() }, this._scene.getEngine()), a.depthEffect;\n          }, r;\n        }(), Kh = f(101);\n        function cc(r, t, e, n, i) {\n          var o = new r.DecoderBuffer();\n          o.Init(t, t.byteLength);\n          var a, s, d = new r.Decoder();\n          try {\n            var p = d.GetEncodedGeometryType(o);\n            switch (p) {\n              case r.TRIANGULAR_MESH:\n                a = new r.Mesh(), s = d.DecodeBufferToMesh(o, a);\n                break;\n              case r.POINT_CLOUD:\n                a = new r.PointCloud(), s = d.DecodeBufferToPointCloud(o, a);\n                break;\n              default:\n                throw new Error(\"Invalid geometry type \" + p);\n            }\n            if (!s.ok() || !a.ptr)\n              throw new Error(s.error_msg());\n            if (p === r.TRIANGULAR_MESH) {\n              var y = 3 * a.num_faces(), P = 4 * y, R = r._malloc(P);\n              try {\n                d.GetTrianglesUInt32Array(a, P, R);\n                var B = new Uint32Array(y);\n                B.set(new Uint32Array(r.HEAPF32.buffer, R, y)), n(B);\n              } finally {\n                r._free(R);\n              }\n            }\n            var F = function(se, ce) {\n              var ue = ce.num_components(), fe = a.num_points(), ve = fe * ue, Te = ve * Float32Array.BYTES_PER_ELEMENT, Re = r._malloc(Te);\n              try {\n                d.GetAttributeDataArrayForAllPoints(a, ce, r.DT_FLOAT32, Te, Re);\n                var Ae = new Float32Array(r.HEAPF32.buffer, Re, ve);\n                if (se === \"color\" && ue === 3) {\n                  for (var Ee = new Float32Array(4 * fe), Se = 0, De = 0; Se < Ee.length; Se += 4, De += ue)\n                    Ee[Se + 0] = Ae[De + 0], Ee[Se + 1] = Ae[De + 1], Ee[Se + 2] = Ae[De + 2], Ee[Se + 3] = 1;\n                  i(se, Ee);\n                } else\n                  (Ee = new Float32Array(ve)).set(new Float32Array(r.HEAPF32.buffer, Re, ve)), i(se, Ee);\n              } finally {\n                r._free(Re);\n              }\n            };\n            if (e)\n              for (var z in e) {\n                var J = e[z];\n                F(z, d.GetAttributeByUniqueId(a, J));\n              }\n            else {\n              var ie = { position: \"POSITION\", normal: \"NORMAL\", color: \"COLOR\", uv: \"TEX_COORD\" };\n              for (var z in ie)\n                (J = d.GetAttributeId(a, r[ie[z]])) !== -1 && F(z, d.GetAttribute(a, J));\n            }\n          } finally {\n            a && r.destroy(a), r.destroy(d), r.destroy(o);\n          }\n        }\n        function K_() {\n          var r;\n          onmessage = function(t) {\n            var e = t.data;\n            switch (e.id) {\n              case \"init\":\n                var n = e.decoder;\n                n.url && (importScripts(n.url), r = DracoDecoderModule({ wasmBinary: n.wasmBinary })), postMessage(\"done\");\n                break;\n              case \"decodeMesh\":\n                if (!r)\n                  throw new Error(\"Draco decoder module is not available\");\n                r.then(function(i) {\n                  cc(i, e.dataView, e.attributes, function(o) {\n                    postMessage({ id: \"indices\", value: o }, [o.buffer]);\n                  }, function(o, a) {\n                    postMessage({ id: o, value: a }, [a.buffer]);\n                  }), postMessage(\"done\");\n                });\n            }\n          };\n        }\n        function Qh(r) {\n          return typeof document != \"object\" || typeof r != \"string\" ? r : Xe.b.GetAbsoluteUrl(r);\n        }\n        var Q_ = function() {\n          function r(t) {\n            t === void 0 && (t = r.DefaultNumWorkers);\n            var e = r.Configuration.decoder, n = e.wasmUrl && e.wasmBinaryUrl && typeof WebAssembly == \"object\" ? { url: e.wasmUrl, wasmBinaryPromise: Xe.b.LoadFileAsync(Qh(e.wasmBinaryUrl)) } : { url: e.fallbackUrl, wasmBinaryPromise: Promise.resolve(void 0) };\n            t && typeof Worker == \"function\" ? this._workerPoolPromise = n.wasmBinaryPromise.then(function(i) {\n              for (var o = cc + \"(\" + K_ + \")()\", a = URL.createObjectURL(new Blob([o], { type: \"application/javascript\" })), s = new Array(t), d = 0; d < s.length; d++)\n                s[d] = new Promise(function(p, y) {\n                  var P = new Worker(a), R = function(F) {\n                    P.removeEventListener(\"error\", R), P.removeEventListener(\"message\", B), y(F);\n                  }, B = function(F) {\n                    F.data === \"done\" && (P.removeEventListener(\"error\", R), P.removeEventListener(\"message\", B), p(P));\n                  };\n                  P.addEventListener(\"error\", R), P.addEventListener(\"message\", B), P.postMessage({ id: \"init\", decoder: { url: Qh(n.url), wasmBinary: i } });\n                });\n              return Promise.all(s).then(function(p) {\n                return new xs(p);\n              });\n            }) : this._decoderModulePromise = n.wasmBinaryPromise.then(function(i) {\n              if (!n.url)\n                throw new Error(\"Draco decoder module is not available\");\n              return Xe.b.LoadScriptAsync(n.url).then(function() {\n                return o = i, new Promise(function(a) {\n                  DracoDecoderModule({ wasmBinary: o }).then(function(s) {\n                    a({ module: s });\n                  });\n                });\n                var o;\n              });\n            });\n          }\n          return Object.defineProperty(r, \"DecoderAvailable\", { get: function() {\n            var t = r.Configuration.decoder;\n            return !!(t.wasmUrl && t.wasmBinaryUrl && typeof WebAssembly == \"object\" || t.fallbackUrl);\n          }, enumerable: !1, configurable: !0 }), r.GetDefaultNumWorkers = function() {\n            return typeof navigator == \"object\" && navigator.hardwareConcurrency ? Math.min(Math.floor(0.5 * navigator.hardwareConcurrency), 4) : 1;\n          }, Object.defineProperty(r, \"Default\", { get: function() {\n            return r._Default || (r._Default = new r()), r._Default;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._workerPoolPromise && this._workerPoolPromise.then(function(t) {\n              t.dispose();\n            }), delete this._workerPoolPromise, delete this._decoderModulePromise;\n          }, r.prototype.whenReadyAsync = function() {\n            return this._workerPoolPromise ? this._workerPoolPromise.then(function() {\n            }) : this._decoderModulePromise ? this._decoderModulePromise.then(function() {\n            }) : Promise.resolve();\n          }, r.prototype.decodeMeshAsync = function(t, e) {\n            var n = t instanceof ArrayBuffer ? new Uint8Array(t) : t;\n            if (this._workerPoolPromise)\n              return this._workerPoolPromise.then(function(i) {\n                return new Promise(function(o, a) {\n                  i.push(function(s, d) {\n                    var p = new ht.a(), y = function(B) {\n                      s.removeEventListener(\"error\", y), s.removeEventListener(\"message\", P), a(B), d();\n                    }, P = function(B) {\n                      B.data === \"done\" ? (s.removeEventListener(\"error\", y), s.removeEventListener(\"message\", P), o(p), d()) : B.data.id === \"indices\" ? p.indices = B.data.value : p.set(B.data.value, B.data.id);\n                    };\n                    s.addEventListener(\"error\", y), s.addEventListener(\"message\", P);\n                    var R = new Uint8Array(n.byteLength);\n                    R.set(new Uint8Array(n.buffer, n.byteOffset, n.byteLength)), s.postMessage({ id: \"decodeMesh\", dataView: R, attributes: e }, [R.buffer]);\n                  });\n                });\n              });\n            if (this._decoderModulePromise)\n              return this._decoderModulePromise.then(function(i) {\n                var o = new ht.a();\n                return cc(i.module, n, e, function(a) {\n                  o.indices = a;\n                }, function(a, s) {\n                  o.set(s, a);\n                }), o;\n              });\n            throw new Error(\"Draco decoder module is not available\");\n          }, r.Configuration = { decoder: { wasmUrl: \"https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js\", wasmBinaryUrl: \"https://preview.babylonjs.com/draco_decoder_gltf.wasm\", fallbackUrl: \"https://preview.babylonjs.com/draco_decoder_gltf.js\" } }, r.DefaultNumWorkers = r.GetDefaultNumWorkers(), r._Default = null, r;\n        }(), uo = f(61), qh = 0, q_ = function() {\n          function r(t, e, n, i) {\n            this.pos = t, this.normal = e, this.uv = n, this.vertColor = i;\n          }\n          return r.prototype.clone = function() {\n            var t, e;\n            return new r(this.pos.clone(), this.normal.clone(), (t = this.uv) === null || t === void 0 ? void 0 : t.clone(), (e = this.vertColor) === null || e === void 0 ? void 0 : e.clone());\n          }, r.prototype.flip = function() {\n            this.normal = this.normal.scale(-1);\n          }, r.prototype.interpolate = function(t, e) {\n            return new r(u.e.Lerp(this.pos, t.pos, e), u.e.Lerp(this.normal, t.normal, e), this.uv && t.uv ? u.d.Lerp(this.uv, t.uv, e) : void 0, this.vertColor && t.vertColor ? I.b.Lerp(this.vertColor, t.vertColor, e) : void 0);\n          }, r;\n        }(), Z_ = function() {\n          function r(t, e) {\n            this.normal = t, this.w = e;\n          }\n          return r.FromPoints = function(t, e, n) {\n            var i = n.subtract(t), o = e.subtract(t);\n            if (i.lengthSquared() === 0 || o.lengthSquared() === 0)\n              return null;\n            var a = u.e.Normalize(u.e.Cross(i, o));\n            return new r(a, u.e.Dot(a, t));\n          }, r.prototype.clone = function() {\n            return new r(this.normal.clone(), this.w);\n          }, r.prototype.flip = function() {\n            this.normal.scaleInPlace(-1), this.w = -this.w;\n          }, r.prototype.splitPolygon = function(t, e, n, i, o) {\n            var a, s, d = 0, p = [];\n            for (a = 0; a < t.vertices.length; a++) {\n              var y = (s = u.e.Dot(this.normal, t.vertices[a].pos) - this.w) < -r.EPSILON ? 2 : s > r.EPSILON ? 1 : 0;\n              d |= y, p.push(y);\n            }\n            switch (d) {\n              case 0:\n                (u.e.Dot(this.normal, t.plane.normal) > 0 ? e : n).push(t);\n                break;\n              case 1:\n                i.push(t);\n                break;\n              case 2:\n                o.push(t);\n                break;\n              case 3:\n                var P, R = [], B = [];\n                for (a = 0; a < t.vertices.length; a++) {\n                  var F = (a + 1) % t.vertices.length, z = p[a], J = p[F], ie = t.vertices[a], se = t.vertices[F];\n                  if (z !== 2 && R.push(ie), z !== 1 && B.push(z !== 2 ? ie.clone() : ie), (z | J) == 3) {\n                    s = (this.w - u.e.Dot(this.normal, ie.pos)) / u.e.Dot(this.normal, se.pos.subtract(ie.pos));\n                    var ce = ie.interpolate(se, s);\n                    R.push(ce), B.push(ce.clone());\n                  }\n                }\n                R.length >= 3 && (P = new lc(R, t.shared)).plane && i.push(P), B.length >= 3 && (P = new lc(B, t.shared)).plane && o.push(P);\n            }\n          }, r.EPSILON = 1e-5, r;\n        }(), lc = function() {\n          function r(t, e) {\n            this.vertices = t, this.shared = e, this.plane = Z_.FromPoints(t[0].pos, t[1].pos, t[2].pos);\n          }\n          return r.prototype.clone = function() {\n            return new r(this.vertices.map(function(t) {\n              return t.clone();\n            }), this.shared);\n          }, r.prototype.flip = function() {\n            this.vertices.reverse().map(function(t) {\n              t.flip();\n            }), this.plane.flip();\n          }, r;\n        }(), Yn = function() {\n          function r(t) {\n            this.plane = null, this.front = null, this.back = null, this.polygons = new Array(), t && this.build(t);\n          }\n          return r.prototype.clone = function() {\n            var t = new r();\n            return t.plane = this.plane && this.plane.clone(), t.front = this.front && this.front.clone(), t.back = this.back && this.back.clone(), t.polygons = this.polygons.map(function(e) {\n              return e.clone();\n            }), t;\n          }, r.prototype.invert = function() {\n            for (var t = 0; t < this.polygons.length; t++)\n              this.polygons[t].flip();\n            this.plane && this.plane.flip(), this.front && this.front.invert(), this.back && this.back.invert();\n            var e = this.front;\n            this.front = this.back, this.back = e;\n          }, r.prototype.clipPolygons = function(t) {\n            if (!this.plane)\n              return t.slice();\n            for (var e = new Array(), n = new Array(), i = 0; i < t.length; i++)\n              this.plane.splitPolygon(t[i], e, n, e, n);\n            return this.front && (e = this.front.clipPolygons(e)), n = this.back ? this.back.clipPolygons(n) : [], e.concat(n);\n          }, r.prototype.clipTo = function(t) {\n            this.polygons = t.clipPolygons(this.polygons), this.front && this.front.clipTo(t), this.back && this.back.clipTo(t);\n          }, r.prototype.allPolygons = function() {\n            var t = this.polygons.slice();\n            return this.front && (t = t.concat(this.front.allPolygons())), this.back && (t = t.concat(this.back.allPolygons())), t;\n          }, r.prototype.build = function(t) {\n            if (t.length) {\n              this.plane || (this.plane = t[0].plane.clone());\n              for (var e = new Array(), n = new Array(), i = 0; i < t.length; i++)\n                this.plane.splitPolygon(t[i], this.polygons, this.polygons, e, n);\n              e.length && (this.front || (this.front = new r()), this.front.build(e)), n.length && (this.back || (this.back = new r()), this.back.build(n));\n            }\n          }, r;\n        }(), J_ = function() {\n          function r() {\n            this.polygons = new Array();\n          }\n          return r.FromMesh = function(t) {\n            var e, n, i, o, a, s, d, p, y, P = void 0, R = void 0, B = new Array(), F = null;\n            if (!(t instanceof Ie.a))\n              throw \"BABYLON.CSG: Wrong Mesh type, must be BABYLON.Mesh\";\n            t.computeWorldMatrix(!0), s = t.getWorldMatrix(), d = t.position.clone(), p = t.rotation.clone(), t.rotationQuaternion && (F = t.rotationQuaternion.clone()), y = t.scaling.clone();\n            for (var z = t.getIndices(), J = t.getVerticesData(Oe.b.PositionKind), ie = t.getVerticesData(Oe.b.NormalKind), se = t.getVerticesData(Oe.b.UVKind), ce = t.getVerticesData(Oe.b.ColorKind), ue = t.subMeshes, fe = 0, ve = ue.length; fe < ve; fe++)\n              for (var Te = ue[fe].indexStart, Re = ue[fe].indexCount + ue[fe].indexStart; Te < Re; Te += 3) {\n                a = [];\n                for (var Ae = 0; Ae < 3; Ae++) {\n                  var Ee = new u.e(ie[3 * z[Te + Ae]], ie[3 * z[Te + Ae] + 1], ie[3 * z[Te + Ae] + 2]);\n                  se && (P = new u.d(se[2 * z[Te + Ae]], se[2 * z[Te + Ae] + 1])), ce && (R = new I.b(ce[4 * z[Te + Ae]], ce[4 * z[Te + Ae] + 1], ce[4 * z[Te + Ae] + 2], ce[4 * z[Te + Ae] + 3]));\n                  var Se = new u.e(J[3 * z[Te + Ae]], J[3 * z[Te + Ae] + 1], J[3 * z[Te + Ae] + 2]);\n                  i = u.e.TransformCoordinates(Se, s), n = u.e.TransformNormal(Ee, s), e = new q_(i, n, P, R), a.push(e);\n                }\n                (o = new lc(a, { subMeshId: fe, meshId: qh, materialIndex: ue[fe].materialIndex })).plane && B.push(o);\n              }\n            var De = r.FromPolygons(B);\n            return De.matrix = s, De.position = d, De.rotation = p, De.scaling = y, De.rotationQuaternion = F, qh++, De;\n          }, r.FromPolygons = function(t) {\n            var e = new r();\n            return e.polygons = t, e;\n          }, r.prototype.clone = function() {\n            var t = new r();\n            return t.polygons = this.polygons.map(function(e) {\n              return e.clone();\n            }), t.copyTransformAttributes(this), t;\n          }, r.prototype.union = function(t) {\n            var e = new Yn(this.clone().polygons), n = new Yn(t.clone().polygons);\n            return e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), r.FromPolygons(e.allPolygons()).copyTransformAttributes(this);\n          }, r.prototype.unionInPlace = function(t) {\n            var e = new Yn(this.polygons), n = new Yn(t.polygons);\n            e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), this.polygons = e.allPolygons();\n          }, r.prototype.subtract = function(t) {\n            var e = new Yn(this.clone().polygons), n = new Yn(t.clone().polygons);\n            return e.invert(), e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), e.invert(), r.FromPolygons(e.allPolygons()).copyTransformAttributes(this);\n          }, r.prototype.subtractInPlace = function(t) {\n            var e = new Yn(this.polygons), n = new Yn(t.polygons);\n            e.invert(), e.clipTo(n), n.clipTo(e), n.invert(), n.clipTo(e), n.invert(), e.build(n.allPolygons()), e.invert(), this.polygons = e.allPolygons();\n          }, r.prototype.intersect = function(t) {\n            var e = new Yn(this.clone().polygons), n = new Yn(t.clone().polygons);\n            return e.invert(), n.clipTo(e), n.invert(), e.clipTo(n), n.clipTo(e), e.build(n.allPolygons()), e.invert(), r.FromPolygons(e.allPolygons()).copyTransformAttributes(this);\n          }, r.prototype.intersectInPlace = function(t) {\n            var e = new Yn(this.polygons), n = new Yn(t.polygons);\n            e.invert(), n.clipTo(e), n.invert(), e.clipTo(n), n.clipTo(e), e.build(n.allPolygons()), e.invert(), this.polygons = e.allPolygons();\n          }, r.prototype.inverse = function() {\n            var t = this.clone();\n            return t.inverseInPlace(), t;\n          }, r.prototype.inverseInPlace = function() {\n            this.polygons.map(function(t) {\n              t.flip();\n            });\n          }, r.prototype.copyTransformAttributes = function(t) {\n            return this.matrix = t.matrix, this.position = t.position, this.rotation = t.rotation, this.scaling = t.scaling, this.rotationQuaternion = t.rotationQuaternion, this;\n          }, r.prototype.buildMeshGeometry = function(t, e, n) {\n            var i = this.matrix.clone();\n            i.invert();\n            var o, a, s, d = new Ie.a(t, e), p = [], y = [], P = [], R = null, B = null, F = u.e.Zero(), z = u.e.Zero(), J = u.d.Zero(), ie = new I.b(0, 0, 0, 0), se = this.polygons, ce = [0, 0, 0], ue = {}, fe = 0, ve = {};\n            n && se.sort(function(ct, Ke) {\n              return ct.shared.meshId === Ke.shared.meshId ? ct.shared.subMeshId - Ke.shared.subMeshId : ct.shared.meshId - Ke.shared.meshId;\n            });\n            for (var Te = 0, Re = se.length; Te < Re; Te++) {\n              ve[(o = se[Te]).shared.meshId] || (ve[o.shared.meshId] = {}), ve[o.shared.meshId][o.shared.subMeshId] || (ve[o.shared.meshId][o.shared.subMeshId] = { indexStart: 1 / 0, indexEnd: -1 / 0, materialIndex: o.shared.materialIndex }), s = ve[o.shared.meshId][o.shared.subMeshId];\n              for (var Ae = 2, Ee = o.vertices.length; Ae < Ee; Ae++) {\n                ce[0] = 0, ce[1] = Ae - 1, ce[2] = Ae;\n                for (var Se = 0; Se < 3; Se++) {\n                  F.copyFrom(o.vertices[ce[Se]].pos), z.copyFrom(o.vertices[ce[Se]].normal), o.vertices[ce[Se]].uv && (R || (R = []), J.copyFrom(o.vertices[ce[Se]].uv)), o.vertices[ce[Se]].vertColor && (B || (B = []), ie.copyFrom(o.vertices[ce[Se]].vertColor));\n                  var De = u.e.TransformCoordinates(F, i), xe = u.e.TransformNormal(z, i);\n                  a = ue[De.x + \",\" + De.y + \",\" + De.z];\n                  var Le = !1;\n                  R && R[2 * a] !== J.x && R[2 * a + 1] !== J.y && (Le = !0);\n                  var Me = !1;\n                  B && B[4 * a] !== ie.r && B[4 * a + 1] !== ie.g && B[4 * a + 2] !== ie.b && B[4 * a + 3] !== ie.a && (Me = !0), (a === void 0 || P[3 * a] !== xe.x || P[3 * a + 1] !== xe.y || P[3 * a + 2] !== xe.z || Le || Me) && (p.push(De.x, De.y, De.z), R && R.push(J.x, J.y), P.push(z.x, z.y, z.z), B && B.push(ie.r, ie.g, ie.b, ie.a), a = ue[De.x + \",\" + De.y + \",\" + De.z] = p.length / 3 - 1), y.push(a), s.indexStart = Math.min(fe, s.indexStart), s.indexEnd = Math.max(fe, s.indexEnd), fe++;\n                }\n              }\n            }\n            if (d.setVerticesData(Oe.b.PositionKind, p), d.setVerticesData(Oe.b.NormalKind, P), R && d.setVerticesData(Oe.b.UVKind, R), B && d.setVerticesData(Oe.b.ColorKind, B), d.setIndices(y, null), n) {\n              var we, Ye = 0;\n              for (var et in d.subMeshes = new Array(), ve) {\n                for (var nt in we = -1, ve[et])\n                  s = ve[et][nt], uo.a.CreateFromIndices(s.materialIndex + Ye, s.indexStart, s.indexEnd - s.indexStart + 1, d), we = Math.max(s.materialIndex, we);\n                Ye += ++we;\n              }\n            }\n            return d;\n          }, r.prototype.toMesh = function(t, e, n, i) {\n            e === void 0 && (e = null);\n            var o = this.buildMeshGeometry(t, n, i);\n            return o.material = e, o.position.copyFrom(this.position), o.rotation.copyFrom(this.rotation), this.rotationQuaternion && (o.rotationQuaternion = this.rotationQuaternion.clone()), o.scaling.copyFrom(this.scaling), o.computeWorldMatrix(!0), o;\n          }, r;\n        }(), $_ = function(r) {\n          function t(e, n, i, o, a, s) {\n            o === void 0 && (o = 1), a === void 0 && (a = 60), s === void 0 && (s = !0);\n            var d = r.call(this, e, i) || this;\n            d._sectionPolygonPointsCount = 4, d._running = !1, d._autoStart = s, d._generator = n, d._diameter = o, d._length = a, d._sectionVectors = [], d._sectionNormalVectors = [];\n            for (var p = 0; p < d._sectionPolygonPointsCount; p++)\n              d._sectionVectors[p] = u.e.Zero(), d._sectionNormalVectors[p] = u.e.Zero();\n            return d._createMesh(), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TrailMesh\";\n          }, t.prototype._createMesh = function() {\n            var e = new ht.a(), n = [], i = [], o = [], a = u.e.Zero();\n            a = this._generator instanceof Mt.a && this._generator._boundingInfo ? this._generator._boundingInfo.boundingBox.centerWorld : this._generator.position;\n            for (var s = 2 * Math.PI / this._sectionPolygonPointsCount, d = 0; d < this._sectionPolygonPointsCount; d++)\n              n.push(a.x + Math.cos(d * s) * this._diameter, a.y + Math.sin(d * s) * this._diameter, a.z);\n            for (d = 1; d <= this._length; d++) {\n              for (var p = 0; p < this._sectionPolygonPointsCount; p++)\n                n.push(a.x + Math.cos(p * s) * this._diameter, a.y + Math.sin(p * s) * this._diameter, a.z);\n              var y = n.length / 3 - 2 * this._sectionPolygonPointsCount;\n              for (p = 0; p < this._sectionPolygonPointsCount - 1; p++)\n                o.push(y + p, y + p + this._sectionPolygonPointsCount, y + p + this._sectionPolygonPointsCount + 1), o.push(y + p, y + p + this._sectionPolygonPointsCount + 1, y + p + 1);\n              o.push(y + this._sectionPolygonPointsCount - 1, y + this._sectionPolygonPointsCount - 1 + this._sectionPolygonPointsCount, y + this._sectionPolygonPointsCount), o.push(y + this._sectionPolygonPointsCount - 1, y + this._sectionPolygonPointsCount, y);\n            }\n            ht.a.ComputeNormals(n, o, i), e.positions = n, e.normals = i, e.indices = o, e.applyToMesh(this, !0), this._autoStart && this.start();\n          }, t.prototype.start = function() {\n            var e = this;\n            this._running || (this._running = !0, this._beforeRenderObserver = this.getScene().onBeforeRenderObservable.add(function() {\n              e.update();\n            }));\n          }, t.prototype.stop = function() {\n            this._beforeRenderObserver && this._running && (this._running = !1, this.getScene().onBeforeRenderObservable.remove(this._beforeRenderObserver));\n          }, t.prototype.update = function() {\n            var e = this.getVerticesData(Oe.b.PositionKind), n = this.getVerticesData(Oe.b.NormalKind), i = this._generator.getWorldMatrix();\n            if (e && n) {\n              for (var o = 3 * this._sectionPolygonPointsCount; o < e.length; o++)\n                e[o - 3 * this._sectionPolygonPointsCount] = e[o] - n[o] / this._length * this._diameter;\n              for (o = 3 * this._sectionPolygonPointsCount; o < n.length; o++)\n                n[o - 3 * this._sectionPolygonPointsCount] = n[o];\n              var a = e.length - 3 * this._sectionPolygonPointsCount, s = 2 * Math.PI / this._sectionPolygonPointsCount;\n              for (o = 0; o < this._sectionPolygonPointsCount; o++)\n                this._sectionVectors[o].copyFromFloats(Math.cos(o * s) * this._diameter, Math.sin(o * s) * this._diameter, 0), this._sectionNormalVectors[o].copyFromFloats(Math.cos(o * s), Math.sin(o * s), 0), u.e.TransformCoordinatesToRef(this._sectionVectors[o], i, this._sectionVectors[o]), u.e.TransformNormalToRef(this._sectionNormalVectors[o], i, this._sectionNormalVectors[o]);\n              for (o = 0; o < this._sectionPolygonPointsCount; o++)\n                e[a + 3 * o] = this._sectionVectors[o].x, e[a + 3 * o + 1] = this._sectionVectors[o].y, e[a + 3 * o + 2] = this._sectionVectors[o].z, n[a + 3 * o] = this._sectionNormalVectors[o].x, n[a + 3 * o + 1] = this._sectionNormalVectors[o].y, n[a + 3 * o + 2] = this._sectionNormalVectors[o].z;\n              this.updateVerticesData(Oe.b.PositionKind, e, !0, !1), this.updateVerticesData(Oe.b.NormalKind, n, !0, !1);\n            }\n          }, t.prototype.clone = function(e, n) {\n            return e === void 0 && (e = \"\"), new t(e, n === void 0 ? this._generator : n, this.getScene(), this._diameter, this._length, this._autoStart);\n          }, t.prototype.serialize = function(e) {\n            r.prototype.serialize.call(this, e);\n          }, t.Parse = function(e, n) {\n            return new t(e.name, e._generator, n, e._diameter, e._length, e._autoStart);\n          }, t;\n        }(Ie.a), em = f(151), ho = f(98), fo = f(82);\n        ht.a.CreateDisc = function(r) {\n          var t = new Array(), e = new Array(), n = new Array(), i = new Array(), o = r.radius || 0.5, a = r.tessellation || 64, s = r.arc && (r.arc <= 0 || r.arc > 1) ? 1 : r.arc || 1, d = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE;\n          t.push(0, 0, 0), i.push(0.5, 0.5);\n          for (var p = 2 * Math.PI * s, y = s === 1 ? p / a : p / (a - 1), P = 0, R = 0; R < a; R++) {\n            var B = Math.cos(P), F = Math.sin(P), z = (B + 1) / 2, J = (1 - F) / 2;\n            t.push(o * B, o * F, 0), i.push(z, J), P += y;\n          }\n          s === 1 && (t.push(t[3], t[4], t[5]), i.push(i[2], i[3]));\n          for (var ie = t.length / 3, se = 1; se < ie - 1; se++)\n            e.push(se + 1, 0, se);\n          ht.a.ComputeNormals(t, e, n), ht.a._ComputeSides(d, t, e, n, i, r.frontUVs, r.backUVs);\n          var ce = new ht.a();\n          return ce.indices = e, ce.positions = t, ce.normals = n, ce.uvs = i, ce;\n        }, Ie.a.CreateDisc = function(r, t, e, n, i, o) {\n          n === void 0 && (n = null);\n          var a = { radius: t, tessellation: e, sideOrientation: o, updatable: i };\n          return ha.CreateDisc(r, a, n);\n        };\n        var ha = function() {\n          function r() {\n          }\n          return r.CreateDisc = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateDisc(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        ht.a.CreateTiledBox = function(r) {\n          for (var t = r.faceUV || new Array(6), e = r.faceColors, n = r.pattern || Ie.a.NO_FLIP, i = r.width || r.size || 1, o = r.height || r.size || 1, a = r.depth || r.size || 1, s = r.tileWidth || r.tileSize || 1, d = r.tileHeight || r.tileSize || 1, p = r.alignHorizontal || 0, y = r.alignVertical || 0, P = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, R = 0; R < 6; R++)\n            t[R] === void 0 && (t[R] = new u.f(0, 0, 1, 1)), e && e[R] === void 0 && (e[R] = new I.b(1, 1, 1, 1));\n          var B = i / 2, F = o / 2, z = a / 2, J = [];\n          for (R = 0; R < 2; R++)\n            J[R] = ht.a.CreateTiledPlane({ pattern: n, tileWidth: s, tileHeight: d, width: i, height: o, alignVertical: y, alignHorizontal: p, sideOrientation: P });\n          for (R = 2; R < 4; R++)\n            J[R] = ht.a.CreateTiledPlane({ pattern: n, tileWidth: s, tileHeight: d, width: a, height: o, alignVertical: y, alignHorizontal: p, sideOrientation: P });\n          var ie = y;\n          for (y === Ie.a.BOTTOM ? ie = Ie.a.TOP : y === Ie.a.TOP && (ie = Ie.a.BOTTOM), R = 4; R < 6; R++)\n            J[R] = ht.a.CreateTiledPlane({ pattern: n, tileWidth: s, tileHeight: d, width: i, height: a, alignVertical: ie, alignHorizontal: p, sideOrientation: P });\n          var se = [], ce = [], ue = [], fe = [], ve = [], Te = [], Re = [], Ae = [], Ee = 0, Se = 0, De = 0;\n          for (R = 0; R < 6; R++) {\n            Ee = J[R].positions.length, Te[R] = [], Re[R] = [];\n            for (var xe = 0; xe < Ee / 3; xe++)\n              Te[R].push(new u.e(J[R].positions[3 * xe], J[R].positions[3 * xe + 1], J[R].positions[3 * xe + 2])), Re[R].push(new u.e(J[R].normals[3 * xe], J[R].normals[3 * xe + 1], J[R].normals[3 * xe + 2]));\n            Se = J[R].uvs.length, Ae[R] = [];\n            for (var Le = 0; Le < Se; Le += 2)\n              Ae[R][Le] = t[R].x + (t[R].z - t[R].x) * J[R].uvs[Le], Ae[R][Le + 1] = t[R].y + (t[R].w - t[R].y) * J[R].uvs[Le + 1];\n            if (ue = ue.concat(Ae[R]), fe = fe.concat(J[R].indices.map(function(Ve) {\n              return Ve + De;\n            })), De += Te[R].length, e)\n              for (var Me = 0; Me < 4; Me++)\n                ve.push(e[R].r, e[R].g, e[R].b, e[R].a);\n          }\n          var we = new u.e(0, 0, z), Ye = u.a.RotationY(Math.PI);\n          se = Te[0].map(function(Ve) {\n            return u.e.TransformNormal(Ve, Ye).add(we);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []), ce = Re[0].map(function(Ve) {\n            return u.e.TransformNormal(Ve, Ye);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []), se = se.concat(Te[1].map(function(Ve) {\n            return Ve.subtract(we);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[1].map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var et = new u.e(B, 0, 0), nt = u.a.RotationY(-Math.PI / 2);\n          se = se.concat(Te[2].map(function(Ve) {\n            return u.e.TransformNormal(Ve, nt).add(et);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[2].map(function(Ve) {\n            return u.e.TransformNormal(Ve, nt);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var ct = u.a.RotationY(Math.PI / 2);\n          se = se.concat(Te[3].map(function(Ve) {\n            return u.e.TransformNormal(Ve, ct).subtract(et);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[3].map(function(Ve) {\n            return u.e.TransformNormal(Ve, ct);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var Ke = new u.e(0, F, 0), rt = u.a.RotationX(Math.PI / 2);\n          se = se.concat(Te[4].map(function(Ve) {\n            return u.e.TransformNormal(Ve, rt).add(Ke);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[4].map(function(Ve) {\n            return u.e.TransformNormal(Ve, rt);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, []));\n          var it = u.a.RotationX(-Math.PI / 2);\n          se = se.concat(Te[5].map(function(Ve) {\n            return u.e.TransformNormal(Ve, it).subtract(Ke);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ce = ce.concat(Re[5].map(function(Ve) {\n            return u.e.TransformNormal(Ve, it);\n          }).map(function(Ve) {\n            return [Ve.x, Ve.y, Ve.z];\n          }).reduce(function(Ve, Ze) {\n            return Ve.concat(Ze);\n          }, [])), ht.a._ComputeSides(P, se, fe, ce, ue);\n          var qe = new ht.a();\n          if (qe.indices = fe, qe.positions = se, qe.normals = ce, qe.uvs = ue, e) {\n            var ut = P === ht.a.DOUBLESIDE ? ve.concat(ve) : ve;\n            qe.colors = ut;\n          }\n          return qe;\n        };\n        var Zh = function() {\n          function r() {\n          }\n          return r.CreateTiledBox = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTiledBox(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        ht.a.CreateTorusKnot = function(r) {\n          var t, e, n = new Array(), i = new Array(), o = new Array(), a = new Array(), s = r.radius || 2, d = r.tube || 0.5, p = r.radialSegments || 32, y = r.tubularSegments || 32, P = r.p || 2, R = r.q || 3, B = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE, F = function(Le) {\n            var Me = Math.cos(Le), we = Math.sin(Le), Ye = R / P * Le, et = Math.cos(Ye), nt = s * (2 + et) * 0.5 * Me, ct = s * (2 + et) * we * 0.5, Ke = s * Math.sin(Ye) * 0.5;\n            return new u.e(nt, ct, Ke);\n          };\n          for (t = 0; t <= p; t++) {\n            var z = t % p / p * 2 * P * Math.PI, J = F(z), ie = F(z + 0.01), se = ie.subtract(J), ce = ie.add(J), ue = u.e.Cross(se, ce);\n            for (ce = u.e.Cross(ue, se), ue.normalize(), ce.normalize(), e = 0; e < y; e++) {\n              var fe = e % y / y * 2 * Math.PI, ve = -d * Math.cos(fe), Te = d * Math.sin(fe);\n              i.push(J.x + ve * ce.x + Te * ue.x), i.push(J.y + ve * ce.y + Te * ue.y), i.push(J.z + ve * ce.z + Te * ue.z), a.push(t / p), a.push(e / y);\n            }\n          }\n          for (t = 0; t < p; t++)\n            for (e = 0; e < y; e++) {\n              var Re = (e + 1) % y, Ae = t * y + e, Ee = (t + 1) * y + e, Se = (t + 1) * y + Re, De = t * y + Re;\n              n.push(De), n.push(Ee), n.push(Ae), n.push(De), n.push(Se), n.push(Ee);\n            }\n          ht.a.ComputeNormals(i, n, o), ht.a._ComputeSides(B, i, n, o, a, r.frontUVs, r.backUVs);\n          var xe = new ht.a();\n          return xe.indices = n, xe.positions = i, xe.normals = o, xe.uvs = a, xe;\n        }, Ie.a.CreateTorusKnot = function(r, t, e, n, i, o, a, s, d, p) {\n          var y = { radius: t, tube: e, radialSegments: n, tubularSegments: i, p: o, q: a, sideOrientation: p, updatable: d };\n          return uc.CreateTorusKnot(r, y, s);\n        };\n        var uc = function() {\n          function r() {\n          }\n          return r.CreateTorusKnot = function(t, e, n) {\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTorusKnot(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }(), tm = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e.x, e.y) || this;\n            return i.index = n, i;\n          }\n          return Object(c.d)(t, r), t;\n        }(u.d), hc = function() {\n          function r() {\n            this.elements = new Array();\n          }\n          return r.prototype.add = function(t) {\n            var e = this, n = new Array();\n            return t.forEach(function(i) {\n              var o = new tm(i, e.elements.length);\n              n.push(o), e.elements.push(o);\n            }), n;\n          }, r.prototype.computeBounds = function() {\n            var t = new u.d(this.elements[0].x, this.elements[0].y), e = new u.d(this.elements[0].x, this.elements[0].y);\n            return this.elements.forEach(function(n) {\n              n.x < t.x ? t.x = n.x : n.x > e.x && (e.x = n.x), n.y < t.y ? t.y = n.y : n.y > e.y && (e.y = n.y);\n            }), { min: t, max: e, width: e.x - t.x, height: e.y - t.y };\n          }, r;\n        }(), nm = function() {\n          function r() {\n          }\n          return r.Rectangle = function(t, e, n, i) {\n            return [new u.d(t, e), new u.d(n, e), new u.d(n, i), new u.d(t, i)];\n          }, r.Circle = function(t, e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = 0), i === void 0 && (i = 32);\n            for (var o = new Array(), a = 0, s = 2 * Math.PI / i, d = 0; d < i; d++)\n              o.push(new u.d(e + Math.cos(a) * t, n + Math.sin(a) * t)), a -= s;\n            return o;\n          }, r.Parse = function(t) {\n            var e, n = t.split(/[^-+eE\\.\\d]+/).map(parseFloat).filter(function(o) {\n              return !isNaN(o);\n            }), i = [];\n            for (e = 0; e < (2147483646 & n.length); e += 2)\n              i.push(new u.d(n[e], n[e + 1]));\n            return i;\n          }, r.StartingAt = function(t, e) {\n            return Qe.f.StartingAt(t, e);\n          }, r;\n        }(), Jh = function() {\n          function r(t, e, n, i) {\n            var o;\n            i === void 0 && (i = earcut), this._points = new hc(), this._outlinepoints = new hc(), this._holes = new Array(), this._epoints = new Array(), this._eholes = new Array(), this.bjsEarcut = i, this._name = t, this._scene = n || Ue.a.LastCreatedScene, o = e instanceof Qe.f ? e.getPoints() : e, this._addToepoint(o), this._points.add(o), this._outlinepoints.add(o), this.bjsEarcut === void 0 && l.a.Warn(\"Earcut was not found, the polygon will not be built.\");\n          }\n          return r.prototype._addToepoint = function(t) {\n            for (var e = 0, n = t; e < n.length; e++) {\n              var i = n[e];\n              this._epoints.push(i.x, i.y);\n            }\n          }, r.prototype.addHole = function(t) {\n            this._points.add(t);\n            var e = new hc();\n            return e.add(t), this._holes.push(e), this._eholes.push(this._epoints.length / 2), this._addToepoint(t), this;\n          }, r.prototype.build = function(t, e) {\n            t === void 0 && (t = !1), e === void 0 && (e = 0);\n            var n = new Ie.a(this._name, this._scene), i = this.buildVertexData(e);\n            return n.setVerticesData(Oe.b.PositionKind, i.positions, t), n.setVerticesData(Oe.b.NormalKind, i.normals, t), n.setVerticesData(Oe.b.UVKind, i.uvs, t), n.setIndices(i.indices), n;\n          }, r.prototype.buildVertexData = function(t) {\n            var e = this;\n            t === void 0 && (t = 0);\n            var n = new ht.a(), i = new Array(), o = new Array(), a = new Array(), s = this._points.computeBounds();\n            this._points.elements.forEach(function(J) {\n              i.push(0, 1, 0), o.push(J.x, 0, J.y), a.push((J.x - s.min.x) / s.width, (J.y - s.min.y) / s.height);\n            });\n            for (var d = new Array(), p = this.bjsEarcut(this._epoints, this._eholes, 2), y = 0; y < p.length; y++)\n              d.push(p[y]);\n            if (t > 0) {\n              var P = o.length / 3;\n              this._points.elements.forEach(function(J) {\n                i.push(0, -1, 0), o.push(J.x, -t, J.y), a.push(1 - (J.x - s.min.x) / s.width, 1 - (J.y - s.min.y) / s.height);\n              });\n              var R = d.length;\n              for (y = 0; y < R; y += 3) {\n                var B = d[y + 0], F = d[y + 1], z = d[y + 2];\n                d.push(z + P), d.push(F + P), d.push(B + P);\n              }\n              this.addSide(o, i, a, d, s, this._outlinepoints, t, !1), this._holes.forEach(function(J) {\n                e.addSide(o, i, a, d, s, J, t, !0);\n              });\n            }\n            return n.indices = d, n.positions = o, n.normals = i, n.uvs = a, n;\n          }, r.prototype.addSide = function(t, e, n, i, o, a, s, d) {\n            for (var p = t.length / 3, y = 0, P = 0; P < a.elements.length; P++) {\n              var R, B = a.elements[P];\n              R = P + 1 > a.elements.length - 1 ? a.elements[0] : a.elements[P + 1], t.push(B.x, 0, B.y), t.push(B.x, -s, B.y), t.push(R.x, 0, R.y), t.push(R.x, -s, R.y);\n              var F = new u.e(B.x, 0, B.y), z = new u.e(R.x, 0, R.y).subtract(F), J = new u.e(0, 1, 0), ie = u.e.Cross(z, J);\n              ie = ie.normalize(), n.push(y / o.width, 0), n.push(y / o.width, 1), y += z.length(), n.push(y / o.width, 0), n.push(y / o.width, 1), d ? (e.push(ie.x, ie.y, ie.z), e.push(ie.x, ie.y, ie.z), e.push(ie.x, ie.y, ie.z), e.push(ie.x, ie.y, ie.z), i.push(p), i.push(p + 2), i.push(p + 1), i.push(p + 1), i.push(p + 2), i.push(p + 3)) : (e.push(-ie.x, -ie.y, -ie.z), e.push(-ie.x, -ie.y, -ie.z), e.push(-ie.x, -ie.y, -ie.z), e.push(-ie.x, -ie.y, -ie.z), i.push(p), i.push(p + 1), i.push(p + 2), i.push(p + 1), i.push(p + 3), i.push(p + 2)), p += 4;\n            }\n          }, r;\n        }();\n        ht.a.CreatePolygon = function(r, t, e, n, i, o, a) {\n          for (var s = e || new Array(3), d = n, p = [], y = a || !1, P = 0; P < 3; P++)\n            s[P] === void 0 && (s[P] = new u.f(0, 0, 1, 1)), d && d[P] === void 0 && (d[P] = new I.b(1, 1, 1, 1));\n          var R = r.getVerticesData(Oe.b.PositionKind), B = r.getVerticesData(Oe.b.NormalKind), F = r.getVerticesData(Oe.b.UVKind), z = r.getIndices(), J = R.length / 9, ie = 0, se = 0, ce = 0, ue = 0, fe = [0];\n          if (y)\n            for (var ve = J; ve < R.length / 3; ve += 4)\n              se = R[3 * (ve + 2)] - R[3 * ve], ce = R[3 * (ve + 2) + 2] - R[3 * ve + 2], ue += Math.sqrt(se * se + ce * ce), fe.push(ue);\n          ve = 0;\n          for (var Te = 0, Re = 0; Re < B.length; Re += 3)\n            Math.abs(B[Re + 1]) < 1e-3 && (Te = 1), Math.abs(B[Re + 1] - 1) < 1e-3 && (Te = 0), Math.abs(B[Re + 1] + 1) < 1e-3 && (Te = 2), ve = Re / 3, Te === 1 ? (ie = ve - J, F[2 * ve] = ie % 4 < 1.5 ? y ? s[Te].x + (s[Te].z - s[Te].x) * fe[Math.floor(ie / 4)] / ue : s[Te].x : y ? s[Te].x + (s[Te].z - s[Te].x) * fe[Math.floor(ie / 4) + 1] / ue : s[Te].z, F[2 * ve + 1] = ie % 2 == 0 ? s[Te].w : s[Te].y) : (F[2 * ve] = (1 - F[2 * ve]) * s[Te].x + F[2 * ve] * s[Te].z, F[2 * ve + 1] = (1 - F[2 * ve + 1]) * s[Te].y + F[2 * ve + 1] * s[Te].w), d && p.push(d[Te].r, d[Te].g, d[Te].b, d[Te].a);\n          ht.a._ComputeSides(t, R, z, B, F, i, o);\n          var Ae = new ht.a();\n          if (Ae.indices = z, Ae.positions = R, Ae.normals = B, Ae.uvs = F, d) {\n            var Ee = t === ht.a.DOUBLESIDE ? p.concat(p) : p;\n            Ae.colors = Ee;\n          }\n          return Ae;\n        }, Ie.a.CreatePolygon = function(r, t, e, n, i, o, a) {\n          a === void 0 && (a = earcut);\n          var s = { shape: t, holes: n, updatable: i, sideOrientation: o };\n          return po.CreatePolygon(r, s, e, a);\n        }, Ie.a.ExtrudePolygon = function(r, t, e, n, i, o, a, s) {\n          s === void 0 && (s = earcut);\n          var d = { shape: t, holes: i, depth: e, updatable: o, sideOrientation: a };\n          return po.ExtrudePolygon(r, d, n, s);\n        };\n        var po = function() {\n          function r() {\n          }\n          return r.CreatePolygon = function(t, e, n, i) {\n            n === void 0 && (n = null), i === void 0 && (i = earcut), e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation);\n            for (var o = e.shape, a = e.holes || [], s = e.depth || 0, d = [], p = [], y = 0; y < o.length; y++)\n              d[y] = new u.d(o[y].x, o[y].z);\n            d[0].equalsWithEpsilon(d[d.length - 1], 1e-8) && d.pop();\n            for (var P = new Jh(t, d, n || te.a.LastCreatedScene, i), R = 0; R < a.length; R++) {\n              p = [];\n              for (var B = 0; B < a[R].length; B++)\n                p.push(new u.d(a[R][B].x, a[R][B].z));\n              P.addHole(p);\n            }\n            var F = P.build(e.updatable, s);\n            return F._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreatePolygon(F, e.sideOrientation, e.faceUV, e.faceColors, e.frontUVs, e.backUVs, e.wrap).applyToMesh(F, e.updatable), F;\n          }, r.ExtrudePolygon = function(t, e, n, i) {\n            return n === void 0 && (n = null), i === void 0 && (i = earcut), r.CreatePolygon(t, e, n, i);\n          }, r;\n        }();\n        Ie.a.CreateLathe = function(r, t, e, n, i, o, a) {\n          var s = { shape: t, radius: e, tessellation: n, sideOrientation: a, updatable: o };\n          return dc.CreateLathe(r, s, i);\n        };\n        var dc = function() {\n          function r() {\n          }\n          return r.CreateLathe = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i, o = e.arc ? e.arc <= 0 || e.arc > 1 ? 1 : e.arc : 1, a = e.closed === void 0 || e.closed, s = e.shape, d = e.radius || 1, p = e.tessellation || 64, y = e.clip || 0, P = e.updatable, R = Ie.a._GetDefaultSideOrientation(e.sideOrientation), B = e.cap || Ie.a.NO_CAP, F = 2 * Math.PI, z = new Array(), J = e.invertUV || !1, ie = 0, se = 0, ce = F / p * o, ue = new Array();\n            for (ie = 0; ie <= p - y; ie++) {\n              for (ue = [], B != Ie.a.CAP_START && B != Ie.a.CAP_ALL || (ue.push(new u.e(0, s[0].y, 0)), ue.push(new u.e(Math.cos(ie * ce) * s[0].x * d, s[0].y, Math.sin(ie * ce) * s[0].x * d))), se = 0; se < s.length; se++)\n                i = new u.e(Math.cos(ie * ce) * s[se].x * d, s[se].y, Math.sin(ie * ce) * s[se].x * d), ue.push(i);\n              B != Ie.a.CAP_END && B != Ie.a.CAP_ALL || (ue.push(new u.e(Math.cos(ie * ce) * s[s.length - 1].x * d, s[s.length - 1].y, Math.sin(ie * ce) * s[s.length - 1].x * d)), ue.push(new u.e(0, s[s.length - 1].y, 0))), z.push(ue);\n            }\n            return fo.a.CreateRibbon(t, { pathArray: z, closeArray: a, sideOrientation: R, updatable: P, invertUV: J, frontUVs: e.frontUVs, backUVs: e.backUVs }, n);\n          }, r;\n        }();\n        ht.a.CreateTiledPlane = function(r) {\n          var t = r.pattern || Ie.a.NO_FLIP, e = r.tileWidth || r.tileSize || 1, n = r.tileHeight || r.tileSize || 1, i = r.alignHorizontal || 0, o = r.alignVertical || 0, a = r.width || r.size || 1, s = Math.floor(a / e), d = a - s * e, p = r.height || r.size || 1, y = Math.floor(p / n), P = p - y * n, R = e * s / 2, B = n * y / 2, F = 0, z = 0, J = 0, ie = 0, se = 0, ce = 0;\n          if (d > 0 || P > 0) {\n            switch (J = -R, ie = -B, se = R, ce = B, i) {\n              case Ie.a.CENTER:\n                J -= d /= 2, se += d;\n                break;\n              case Ie.a.LEFT:\n                se += d, F = -d / 2;\n                break;\n              case Ie.a.RIGHT:\n                J -= d, F = d / 2;\n            }\n            switch (o) {\n              case Ie.a.CENTER:\n                ie -= P /= 2, ce += P;\n                break;\n              case Ie.a.BOTTOM:\n                ce += P, z = -P / 2;\n                break;\n              case Ie.a.TOP:\n                ie -= P, z = P / 2;\n            }\n          }\n          var ue = [], fe = [], ve = [];\n          ve[0] = [0, 0, 1, 0, 1, 1, 0, 1], ve[1] = [0, 0, 1, 0, 1, 1, 0, 1], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (ve[1] = [1, 1, 0, 1, 0, 0, 1, 0]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (ve[1] = [1, 0, 0, 0, 0, 1, 1, 1]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (ve[1] = [0, 1, 1, 1, 1, 0, 0, 0]);\n          for (var Te = [], Re = [], Ae = [], Ee = 0, Se = 0; Se < y; Se++)\n            for (var De = 0; De < s; De++)\n              ue.push(De * e - R + F, Se * n - B + z, 0), ue.push((De + 1) * e - R + F, Se * n - B + z, 0), ue.push((De + 1) * e - R + F, (Se + 1) * n - B + z, 0), ue.push(De * e - R + F, (Se + 1) * n - B + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(ve[(De % 2 + Se % 2) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(ve[Se % 2]) : Te.concat(ve[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1), Ee += 4;\n          if (d > 0 || P > 0) {\n            var xe, Le, Me, we, Ye = P > 0 && (o === Ie.a.CENTER || o === Ie.a.TOP), et = P > 0 && (o === Ie.a.CENTER || o === Ie.a.BOTTOM), nt = d > 0 && (i === Ie.a.CENTER || i === Ie.a.RIGHT), ct = d > 0 && (i === Ie.a.CENTER || i === Ie.a.LEFT), Ke = [];\n            if (Ye && nt && (ue.push(J + F, ie + z, 0), ue.push(-R + F, ie + z, 0), ue.push(-R + F, ie + P + z, 0), ue.push(J + F, ie + P + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 1 - d / e, Le = 1 - P / n, Me = 1, Le, Me, we = 1, xe, we], t === Ie.a.ROTATE_ROW && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t === Ie.a.FLIP_ROW && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t === Ie.a.FLIP_N_ROTATE_ROW && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), Ye && ct && (ue.push(R + F, ie + z, 0), ue.push(se + F, ie + z, 0), ue.push(se + F, ie + P + z, 0), ue.push(R + F, ie + P + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 0, Le = 1 - P / n, Me = d / e, Le, Me, we = 1, xe, we], (t === Ie.a.ROTATE_ROW || t === Ie.a.ROTATE_TILE && s % 2 == 0) && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), (t === Ie.a.FLIP_ROW || t === Ie.a.FLIP_TILE && s % 2 == 0) && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), (t === Ie.a.FLIP_N_ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_TILE && s % 2 == 0) && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), et && nt && (ue.push(J + F, B + z, 0), ue.push(-R + F, B + z, 0), ue.push(-R + F, ce + z, 0), ue.push(J + F, ce + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 1 - d / e, Le = 0, Me = 1, Le, Me, we = P / n, xe, we], (t === Ie.a.ROTATE_ROW && y % 2 == 1 || t === Ie.a.ROTATE_TILE && y % 1 == 0) && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), (t === Ie.a.FLIP_ROW && y % 2 == 1 || t === Ie.a.FLIP_TILE && y % 2 == 0) && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), (t === Ie.a.FLIP_N_ROTATE_ROW && y % 2 == 1 || t === Ie.a.FLIP_N_ROTATE_TILE && y % 2 == 0) && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), et && ct && (ue.push(R + F, B + z, 0), ue.push(se + F, B + z, 0), ue.push(se + F, ce + z, 0), ue.push(R + F, ce + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Ke = [xe = 0, Le = 0, Me = d / e, Le, Me, we = P / n, xe, we], (t === Ie.a.ROTATE_ROW && y % 2 == 1 || t === Ie.a.ROTATE_TILE && (y + s) % 2 == 1) && (Ke = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), (t === Ie.a.FLIP_ROW && y % 2 == 1 || t === Ie.a.FLIP_TILE && (y + s) % 2 == 1) && (Ke = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), (t === Ie.a.FLIP_N_ROTATE_ROW && y % 2 == 1 || t === Ie.a.FLIP_N_ROTATE_TILE && (y + s) % 2 == 1) && (Ke = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Te = Te.concat(Ke), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1)), Ye) {\n              var rt = [];\n              for (xe = 0, Le = 1 - P / n, Me = 1, we = 1, rt[0] = [xe, Le, Me, Le, Me, we, xe, we], rt[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (rt[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (rt[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (rt[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), De = 0; De < s; De++)\n                ue.push(De * e - R + F, ie + z, 0), ue.push((De + 1) * e - R + F, ie + z, 0), ue.push((De + 1) * e - R + F, ie + P + z, 0), ue.push(De * e - R + F, ie + P + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(rt[(De + 1) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(rt[1]) : Te.concat(rt[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n            if (et) {\n              var it = [];\n              for (xe = 0, Le = 0, Me = 1, we = P / n, it[0] = [xe, Le, Me, Le, Me, we, xe, we], it[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (it[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (it[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (it[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), De = 0; De < s; De++)\n                ue.push(De * e - R + F, ce - P + z, 0), ue.push((De + 1) * e - R + F, ce - P + z, 0), ue.push((De + 1) * e - R + F, ce + z, 0), ue.push(De * e - R + F, ce + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(it[(De + y) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(it[y % 2]) : Te.concat(it[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n            if (nt) {\n              var qe = [];\n              for (xe = 1 - d / e, Le = 0, Me = 1, we = 1, qe[0] = [xe, Le, Me, Le, Me, we, xe, we], qe[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (qe[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (qe[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (qe[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Se = 0; Se < y; Se++)\n                ue.push(J + F, Se * n - B + z, 0), ue.push(J + d + F, Se * n - B + z, 0), ue.push(J + d + F, (Se + 1) * n - B + z, 0), ue.push(J + F, (Se + 1) * n - B + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(qe[(Se + 1) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(qe[Se % 2]) : Te.concat(qe[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n            if (ct) {\n              var ut = [];\n              for (xe = 0, Le = 0, Me = d / n, we = 1, ut[0] = [xe, Le, Me, Le, Me, we, xe, we], ut[1] = [xe, Le, Me, Le, Me, we, xe, we], t !== Ie.a.ROTATE_TILE && t !== Ie.a.ROTATE_ROW || (ut[1] = [1 - xe, 1 - Le, 1 - Me, 1 - Le, 1 - Me, 1 - we, 1 - xe, 1 - we]), t !== Ie.a.FLIP_TILE && t !== Ie.a.FLIP_ROW || (ut[1] = [1 - xe, Le, 1 - Me, Le, 1 - Me, we, 1 - xe, we]), t !== Ie.a.FLIP_N_ROTATE_TILE && t !== Ie.a.FLIP_N_ROTATE_ROW || (ut[1] = [xe, 1 - Le, Me, 1 - Le, Me, 1 - we, xe, 1 - we]), Se = 0; Se < y; Se++)\n                ue.push(se - d + F, Se * n - B + z, 0), ue.push(se + F, Se * n - B + z, 0), ue.push(se + F, (Se + 1) * n - B + z, 0), ue.push(se - d + F, (Se + 1) * n - B + z, 0), Ae.push(Ee, Ee + 1, Ee + 3, Ee + 1, Ee + 2, Ee + 3), Ee += 4, Te = t === Ie.a.FLIP_TILE || t === Ie.a.ROTATE_TILE || t === Ie.a.FLIP_N_ROTATE_TILE ? Te.concat(ut[(Se + s) % 2]) : t === Ie.a.FLIP_ROW || t === Ie.a.ROTATE_ROW || t === Ie.a.FLIP_N_ROTATE_ROW ? Te.concat(ut[Se % 2]) : Te.concat(ut[0]), Re.push(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), fe.push(0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1);\n            }\n          }\n          var Ve = r.sideOrientation === 0 ? 0 : r.sideOrientation || ht.a.DEFAULTSIDE;\n          ht.a._ComputeSides(Ve, ue, Ae, fe, Te, r.frontUVs, r.backUVs);\n          var Ze = new ht.a();\n          Ze.indices = Ae, Ze.positions = ue, Ze.normals = fe, Ze.uvs = Te;\n          var vt = Ve === ht.a.DOUBLESIDE ? Re.concat(Re) : Re;\n          return Ze.colors = vt, Ze;\n        };\n        var $h = function() {\n          function r() {\n          }\n          return r.CreateTiledPlane = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateTiledPlane(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        Ie.a.CreateTube = function(r, t, e, n, i, o, a, s, d, p) {\n          var y = { path: t, radius: e, tessellation: n, radiusFunction: i, arc: 1, cap: o, updatable: s, sideOrientation: d, instance: p };\n          return fc.CreateTube(r, y, a);\n        };\n        var fc = function() {\n          function r() {\n          }\n          return r.CreateTube = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = e.path, o = e.instance, a = 1;\n            e.radius !== void 0 ? a = e.radius : o && (a = o._creationDataStorage.radius);\n            var s = e.tessellation || 64, d = e.radiusFunction || null, p = e.cap || Ie.a.NO_CAP, y = e.invertUV || !1, P = e.updatable, R = Ie.a._GetDefaultSideOrientation(e.sideOrientation);\n            e.arc = e.arc && (e.arc <= 0 || e.arc > 1) ? 1 : e.arc || 1;\n            var B, F, z = function(ce, ue, fe, ve, Te, Re, Ae, Ee) {\n              for (var Se, De, xe, Le, Me = ue.getTangents(), we = ue.getNormals(), Ye = ue.getDistances(), et = 2 * Math.PI / Te * Ee, nt = Re || function() {\n                return ve;\n              }, ct = u.c.Matrix[0], Ke = Ae === Ie.a.NO_CAP || Ae === Ie.a.CAP_END ? 0 : 2, rt = 0; rt < ce.length; rt++) {\n                De = nt(rt, Ye[rt]), Se = Array(), xe = we[rt];\n                for (var it = 0; it < Te; it++)\n                  u.a.RotationAxisToRef(Me[rt], et * it, ct), Le = Se[it] ? Se[it] : u.e.Zero(), u.e.TransformCoordinatesToRef(xe, ct, Le), Le.scaleInPlace(De).addInPlace(ce[rt]), Se[it] = Le;\n                fe[Ke] = Se, Ke++;\n              }\n              var qe = function(ut, Ve) {\n                for (var Ze = Array(), vt = 0; vt < ut; vt++)\n                  Ze.push(ce[Ve]);\n                return Ze;\n              };\n              switch (Ae) {\n                case Ie.a.NO_CAP:\n                  break;\n                case Ie.a.CAP_START:\n                  fe[0] = qe(Te, 0), fe[1] = fe[2].slice(0);\n                  break;\n                case Ie.a.CAP_END:\n                  fe[Ke] = fe[Ke - 1].slice(0), fe[Ke + 1] = qe(Te, ce.length - 1);\n                  break;\n                case Ie.a.CAP_ALL:\n                  fe[0] = qe(Te, 0), fe[1] = fe[2].slice(0), fe[Ke] = fe[Ke - 1].slice(0), fe[Ke + 1] = qe(Te, ce.length - 1);\n              }\n              return fe;\n            };\n            if (o) {\n              var J = o._creationDataStorage, ie = e.arc || J.arc;\n              return F = z(i, B = J.path3D.update(i), J.pathArray, a, J.tessellation, d, J.cap, ie), o = fo.a.CreateRibbon(\"\", { pathArray: F, instance: o }), J.path3D = B, J.pathArray = F, J.arc = ie, J.radius = a, o;\n            }\n            F = z(i, B = new Qe.g(i), new Array(), a, s, d, p = p < 0 || p > 3 ? 0 : p, e.arc);\n            var se = fo.a.CreateRibbon(t, { pathArray: F, closePath: !0, closeArray: !1, updatable: P, sideOrientation: R, invertUV: y, frontUVs: e.frontUVs, backUVs: e.backUVs }, n);\n            return se._creationDataStorage.pathArray = F, se._creationDataStorage.path3D = B, se._creationDataStorage.tessellation = s, se._creationDataStorage.cap = p, se._creationDataStorage.arc = e.arc, se._creationDataStorage.radius = a, se;\n          }, r;\n        }();\n        ht.a.CreateIcoSphere = function(r) {\n          var t, e = r.sideOrientation || ht.a.DEFAULTSIDE, n = r.radius || 1, i = r.flat === void 0 || r.flat, o = r.subdivisions || 4, a = r.radiusX || n, s = r.radiusY || n, d = r.radiusZ || n, p = (1 + Math.sqrt(5)) / 2, y = [-1, p, -0, 1, p, 0, -1, -p, 0, 1, -p, 0, 0, -1, -p, 0, 1, -p, 0, -1, p, 0, 1, p, p, 0, 1, p, 0, -1, -p, 0, 1, -p, 0, -1], P = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17, 23, 6, 13, 22, 19, 6, 18, 9, 8, 1], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 2, 3, 3, 3, 4, 7, 8, 9, 9, 10, 11], B = [5, 1, 3, 1, 6, 4, 0, 0, 5, 3, 4, 2, 2, 2, 4, 0, 2, 0, 1, 1, 6, 0, 6, 2, 0, 4, 3, 3, 4, 4, 3, 1, 4, 2, 4, 4, 0, 2, 1, 1, 2, 2, 3, 3, 1, 3, 2, 4], F = [0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0], z = new Array(), J = new Array(), ie = new Array(), se = new Array(), ce = 0, ue = new Array(3), fe = new Array(3);\n          for (t = 0; t < 3; t++)\n            ue[t] = u.e.Zero(), fe[t] = u.d.Zero();\n          for (var ve = 0; ve < 20; ve++) {\n            for (t = 0; t < 3; t++) {\n              var Te = P[3 * ve + t];\n              ue[t].copyFromFloats(y[3 * R[Te]], y[3 * R[Te] + 1], y[3 * R[Te] + 2]), ue[t].normalize().scaleInPlace(n), fe[t].copyFromFloats(B[2 * Te] * (138 / 1024) + 60 / 1024 + F[ve] * (-40 / 1024), B[2 * Te + 1] * (239 / 1024) + 26 / 1024 + F[ve] * (20 / 1024));\n            }\n            for (var Re = function(De, xe, Le, Me) {\n              var we, Ye = u.e.Lerp(ue[0], ue[2], xe / o), et = u.e.Lerp(ue[1], ue[2], xe / o), nt = o === xe ? ue[2] : u.e.Lerp(Ye, et, De / (o - xe));\n              if (nt.normalize(), i) {\n                var ct = u.e.Lerp(ue[0], ue[2], Me / o), Ke = u.e.Lerp(ue[1], ue[2], Me / o);\n                we = u.e.Lerp(ct, Ke, Le / (o - Me));\n              } else\n                we = new u.e(nt.x, nt.y, nt.z);\n              we.x /= a, we.y /= s, we.z /= d, we.normalize();\n              var rt = u.d.Lerp(fe[0], fe[2], xe / o), it = u.d.Lerp(fe[1], fe[2], xe / o), qe = o === xe ? fe[2] : u.d.Lerp(rt, it, De / (o - xe));\n              J.push(nt.x * a, nt.y * s, nt.z * d), ie.push(we.x, we.y, we.z), se.push(qe.x, qe.y), z.push(ce), ce++;\n            }, Ae = 0; Ae < o; Ae++)\n              for (var Ee = 0; Ee + Ae < o; Ee++)\n                Re(Ee, Ae, Ee + 1 / 3, Ae + 1 / 3), Re(Ee + 1, Ae, Ee + 1 / 3, Ae + 1 / 3), Re(Ee, Ae + 1, Ee + 1 / 3, Ae + 1 / 3), Ee + Ae + 1 < o && (Re(Ee + 1, Ae, Ee + 2 / 3, Ae + 2 / 3), Re(Ee + 1, Ae + 1, Ee + 2 / 3, Ae + 2 / 3), Re(Ee, Ae + 1, Ee + 2 / 3, Ae + 2 / 3));\n          }\n          ht.a._ComputeSides(e, J, z, ie, se, r.frontUVs, r.backUVs);\n          var Se = new ht.a();\n          return Se.indices = z, Se.positions = J, Se.normals = ie, Se.uvs = se, Se;\n        }, Ie.a.CreateIcoSphere = function(r, t, e) {\n          return pc.CreateIcoSphere(r, t, e);\n        };\n        var pc = function() {\n          function r() {\n          }\n          return r.CreateIcoSphere = function(t, e, n) {\n            n === void 0 && (n = null);\n            var i = new Ie.a(t, n);\n            return e.sideOrientation = Ie.a._GetDefaultSideOrientation(e.sideOrientation), i._originalBuilderSideOrientation = e.sideOrientation, ht.a.CreateIcoSphere(e).applyToMesh(i, e.updatable), i;\n          }, r;\n        }();\n        Ie.a.CreateDecal = function(r, t, e, n, i, o) {\n          var a = { position: e, normal: n, size: i, angle: o };\n          return _c.CreateDecal(r, t, a);\n        };\n        var _c = function() {\n          function r() {\n          }\n          return r.CreateDecal = function(t, e, n) {\n            var i = e.getIndices(), o = e.getVerticesData(Oe.b.PositionKind), a = e.getVerticesData(Oe.b.NormalKind), s = n.position || u.e.Zero(), d = n.normal || u.e.Up(), p = n.size || u.e.One(), y = n.angle || 0;\n            if (!d) {\n              var P = new u.e(0, 0, 1), R = e.getScene().activeCamera, B = u.e.TransformCoordinates(P, R.getWorldMatrix());\n              d = R.globalPosition.subtract(B);\n            }\n            var F = -Math.atan2(d.z, d.x) - Math.PI / 2, z = Math.sqrt(d.x * d.x + d.z * d.z), J = Math.atan2(d.y, z), ie = u.a.RotationYawPitchRoll(F, J, y).multiply(u.a.Translation(s.x, s.y, s.z)), se = u.a.Invert(ie), ce = e.getWorldMatrix().multiply(se), ue = new ht.a();\n            ue.indices = [], ue.positions = [], ue.normals = [], ue.uvs = [];\n            for (var fe = 0, ve = function(xe) {\n              var Le = new bs();\n              if (!i || !o || !a)\n                return Le;\n              var Me = i[xe];\n              return Le.position = new u.e(o[3 * Me], o[3 * Me + 1], o[3 * Me + 2]), Le.position = u.e.TransformCoordinates(Le.position, ce), Le.normal = new u.e(a[3 * Me], a[3 * Me + 1], a[3 * Me + 2]), Le.normal = u.e.TransformNormal(Le.normal, ce), Le;\n            }, Te = function(xe, Le) {\n              if (xe.length === 0)\n                return xe;\n              for (var Me = 0.5 * Math.abs(u.e.Dot(p, Le)), we = function(Ve, Ze) {\n                var vt = u.e.GetClipFactor(Ve.position, Ze.position, Le, Me);\n                return new bs(u.e.Lerp(Ve.position, Ze.position, vt), u.e.Lerp(Ve.normal, Ze.normal, vt));\n              }, Ye = new Array(), et = 0; et < xe.length; et += 3) {\n                var nt, ct, Ke, rt = null, it = null, qe = null, ut = null;\n                switch (((nt = u.e.Dot(xe[et].position, Le) - Me > 0) ? 1 : 0) + ((ct = u.e.Dot(xe[et + 1].position, Le) - Me > 0) ? 1 : 0) + ((Ke = u.e.Dot(xe[et + 2].position, Le) - Me > 0) ? 1 : 0)) {\n                  case 0:\n                    Ye.push(xe[et]), Ye.push(xe[et + 1]), Ye.push(xe[et + 2]);\n                    break;\n                  case 1:\n                    if (nt && (rt = xe[et + 1], it = xe[et + 2], qe = we(xe[et], rt), ut = we(xe[et], it)), ct) {\n                      rt = xe[et], it = xe[et + 2], qe = we(xe[et + 1], rt), ut = we(xe[et + 1], it), Ye.push(qe), Ye.push(it.clone()), Ye.push(rt.clone()), Ye.push(it.clone()), Ye.push(qe.clone()), Ye.push(ut);\n                      break;\n                    }\n                    Ke && (rt = xe[et], it = xe[et + 1], qe = we(xe[et + 2], rt), ut = we(xe[et + 2], it)), rt && it && qe && ut && (Ye.push(rt.clone()), Ye.push(it.clone()), Ye.push(qe), Ye.push(ut), Ye.push(qe.clone()), Ye.push(it.clone()));\n                    break;\n                  case 2:\n                    nt || (it = we(rt = xe[et].clone(), xe[et + 1]), qe = we(rt, xe[et + 2]), Ye.push(rt), Ye.push(it), Ye.push(qe)), ct || (it = we(rt = xe[et + 1].clone(), xe[et + 2]), qe = we(rt, xe[et]), Ye.push(rt), Ye.push(it), Ye.push(qe)), Ke || (it = we(rt = xe[et + 2].clone(), xe[et]), qe = we(rt, xe[et + 1]), Ye.push(rt), Ye.push(it), Ye.push(qe));\n                }\n              }\n              return Ye;\n            }, Re = 0; Re < i.length; Re += 3) {\n              var Ae = new Array();\n              if (Ae.push(ve(Re)), Ae.push(ve(Re + 1)), Ae.push(ve(Re + 2)), Ae = Te(Ae, new u.e(1, 0, 0)), Ae = Te(Ae, new u.e(-1, 0, 0)), Ae = Te(Ae, new u.e(0, 1, 0)), Ae = Te(Ae, new u.e(0, -1, 0)), Ae = Te(Ae, new u.e(0, 0, 1)), (Ae = Te(Ae, new u.e(0, 0, -1))).length !== 0)\n                for (var Ee = 0; Ee < Ae.length; Ee++) {\n                  var Se = Ae[Ee];\n                  ue.indices.push(fe), Se.position.toArray(ue.positions, 3 * fe), Se.normal.toArray(ue.normals, 3 * fe), ue.uvs.push(0.5 + Se.position.x / p.x), ue.uvs.push(0.5 + Se.position.y / p.y), fe++;\n                }\n            }\n            var De = new Ie.a(t, e.getScene());\n            return ue.applyToMesh(De), De.position = s.clone(), De.rotation = new u.e(J, F, y), De;\n          }, r;\n        }();\n        ht.a.CreateCapsule = function(r) {\n          r === void 0 && (r = { subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 });\n          var t, e, n = Math.max(r.subdivisions ? r.subdivisions : 2, 1), i = Math.max(r.tessellation ? r.tessellation : 16, 3), o = Math.max(r.height ? r.height : 1, 0), a = Math.max(r.radius ? r.radius : 0.25, 0), s = Math.max(r.capSubdivisions ? r.capSubdivisions : 6, 1), d = i, p = n, y = Math.max(r.radiusTop ? r.radiusTop : a, 0), P = Math.max(r.radiusBottom ? r.radiusBottom : a, 0), R = o - (y + P), B = 2 * Math.PI, F = Math.max(r.topCapSubdivisions ? r.topCapSubdivisions : s, 1), z = Math.max(r.bottomCapSubdivisions ? r.bottomCapSubdivisions : s, 1), J = Math.acos((P - y) / o), ie = [], se = [], ce = [], ue = [], fe = 0, ve = [], Te = 0.5 * R, Re = 0.5 * Math.PI, Ae = u.e.Zero(), Ee = u.e.Zero(), Se = Math.cos(J), De = Math.sin(J), xe = new u.d(y * De, Te + y * Se).subtract(new u.d(P * De, P * Se - Te)).length(), Le = y * J + xe + P * (Re - J), Me = 0;\n          for (e = 0; e <= F; e++) {\n            var we = [], Ye = Re - J * (e / F);\n            Me += y * J / F;\n            var et = Math.cos(Ye), nt = Math.sin(Ye), ct = et * y;\n            for (t = 0; t <= d; t++) {\n              var Ke = (Ve = t / d) * B + 0, rt = Math.sin(Ke), it = Math.cos(Ke);\n              Ee.x = ct * rt, Ee.y = Te + nt * y, Ee.z = ct * it, se.push(Ee.x, Ee.y, Ee.z), Ae.set(et * rt, nt, et * it), ce.push(Ae.x, Ae.y, Ae.z), ue.push(Ve, 1 - Me / Le), we.push(fe), fe++;\n            }\n            ve.push(we);\n          }\n          var qe = o - y - P + Se * y - Se * P, ut = De * (P - y) / qe;\n          for (e = 1; e <= p; e++) {\n            for (we = [], Me += xe / p, ct = De * (e * (P - y) / p + y), t = 0; t <= d; t++)\n              Ke = (Ve = t / d) * B + 0, rt = Math.sin(Ke), it = Math.cos(Ke), Ee.x = ct * rt, Ee.y = Te + Se * y - e * qe / p, Ee.z = ct * it, se.push(Ee.x, Ee.y, Ee.z), Ae.set(rt, ut, it).normalize(), ce.push(Ae.x, Ae.y, Ae.z), ue.push(Ve, 1 - Me / Le), we.push(fe), fe++;\n            ve.push(we);\n          }\n          for (e = 1; e <= z; e++) {\n            for (we = [], Ye = Re - J - (Math.PI - J) * (e / z), Me += P * J / z, et = Math.cos(Ye), nt = Math.sin(Ye), ct = et * P, t = 0; t <= d; t++) {\n              var Ve;\n              Ke = (Ve = t / d) * B + 0, rt = Math.sin(Ke), it = Math.cos(Ke), Ee.x = ct * rt, Ee.y = nt * P - Te, Ee.z = ct * it, se.push(Ee.x, Ee.y, Ee.z), Ae.set(et * rt, nt, et * it), ce.push(Ae.x, Ae.y, Ae.z), ue.push(Ve, 1 - Me / Le), we.push(fe), fe++;\n            }\n            ve.push(we);\n          }\n          for (t = 0; t < d; t++)\n            for (e = 0; e < F + p + z; e++) {\n              var Ze = ve[e][t], vt = ve[e + 1][t], jt = ve[e + 1][t + 1], Dt = ve[e][t + 1];\n              ie.push(Ze), ie.push(vt), ie.push(Dt), ie.push(vt), ie.push(jt), ie.push(Dt);\n            }\n          if (ie = ie.reverse(), r.orientation && !r.orientation.equals(u.e.Up())) {\n            var Yt = new u.a();\n            r.orientation.clone().scale(0.5 * Math.PI).cross(u.e.Up()).toQuaternion().toRotationMatrix(Yt);\n            for (var mt = u.e.Zero(), qt = 0; qt < se.length; qt += 3)\n              mt.set(se[qt], se[qt + 1], se[qt + 2]), u.e.TransformCoordinatesToRef(mt.clone(), Yt, mt), se[qt] = mt.x, se[qt + 1] = mt.y, se[qt + 2] = mt.z;\n          }\n          var Ht = new ht.a();\n          return Ht.positions = se, Ht.normals = ce, Ht.uvs = ue, Ht.indices = ie, Ht;\n        }, Ie.a.CreateCapsule = function(r, t, e) {\n          return mc.CreateCapsule(r, t, e);\n        };\n        var _o, mc = function() {\n          function r() {\n          }\n          return r.CreateCapsule = function(t, e, n) {\n            e === void 0 && (e = { orientation: u.e.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 });\n            var i = new Ie.a(t, n);\n            return ht.a.CreateCapsule(e).applyToMesh(i), i;\n          }, r;\n        }(), im = function() {\n          function r() {\n          }\n          return r.CreateBox = function(t, e, n) {\n            return n === void 0 && (n = null), fr.a.CreateBox(t, e, n);\n          }, r.CreateTiledBox = function(t, e, n) {\n            return n === void 0 && (n = null), Zh.CreateTiledBox(t, e, n);\n          }, r.CreateSphere = function(t, e, n) {\n            return n === void 0 && (n = null), Nn.a.CreateSphere(t, e, n);\n          }, r.CreateDisc = function(t, e, n) {\n            return n === void 0 && (n = null), ha.CreateDisc(t, e, n);\n          }, r.CreateIcoSphere = function(t, e, n) {\n            return n === void 0 && (n = null), pc.CreateIcoSphere(t, e, n);\n          }, r.CreateRibbon = function(t, e, n) {\n            return n === void 0 && (n = null), fo.a.CreateRibbon(t, e, n);\n          }, r.CreateCylinder = function(t, e, n) {\n            return n === void 0 && (n = null), ci.a.CreateCylinder(t, e, n);\n          }, r.CreateTorus = function(t, e, n) {\n            return n === void 0 && (n = null), lr.CreateTorus(t, e, n);\n          }, r.CreateTorusKnot = function(t, e, n) {\n            return n === void 0 && (n = null), uc.CreateTorusKnot(t, e, n);\n          }, r.CreateLineSystem = function(t, e, n) {\n            return sn.a.CreateLineSystem(t, e, n);\n          }, r.CreateLines = function(t, e, n) {\n            return n === void 0 && (n = null), sn.a.CreateLines(t, e, n);\n          }, r.CreateDashedLines = function(t, e, n) {\n            return n === void 0 && (n = null), sn.a.CreateDashedLines(t, e, n);\n          }, r.ExtrudeShape = function(t, e, n) {\n            return n === void 0 && (n = null), Jo.a.ExtrudeShape(t, e, n);\n          }, r.ExtrudeShapeCustom = function(t, e, n) {\n            return n === void 0 && (n = null), Jo.a.ExtrudeShapeCustom(t, e, n);\n          }, r.CreateLathe = function(t, e, n) {\n            return n === void 0 && (n = null), dc.CreateLathe(t, e, n);\n          }, r.CreateTiledPlane = function(t, e, n) {\n            return n === void 0 && (n = null), $h.CreateTiledPlane(t, e, n);\n          }, r.CreatePlane = function(t, e, n) {\n            return n === void 0 && (n = null), gs.a.CreatePlane(t, e, n);\n          }, r.CreateGround = function(t, e, n) {\n            return n === void 0 && (n = null), Mi.CreateGround(t, e, n);\n          }, r.CreateTiledGround = function(t, e, n) {\n            return n === void 0 && (n = null), Mi.CreateTiledGround(t, e, n);\n          }, r.CreateGroundFromHeightMap = function(t, e, n, i) {\n            return i === void 0 && (i = null), Mi.CreateGroundFromHeightMap(t, e, n, i);\n          }, r.CreatePolygon = function(t, e, n, i) {\n            return n === void 0 && (n = null), i === void 0 && (i = earcut), po.CreatePolygon(t, e, n, i);\n          }, r.ExtrudePolygon = function(t, e, n, i) {\n            return n === void 0 && (n = null), i === void 0 && (i = earcut), po.ExtrudePolygon(t, e, n, i);\n          }, r.CreateTube = function(t, e, n) {\n            return n === void 0 && (n = null), fc.CreateTube(t, e, n);\n          }, r.CreatePolyhedron = function(t, e, n) {\n            return n === void 0 && (n = null), Qr.CreatePolyhedron(t, e, n);\n          }, r.CreateDecal = function(t, e, n) {\n            return _c.CreateDecal(t, e, n);\n          }, r.CreateCapsule = function(t, e, n) {\n            return e === void 0 && (e = { orientation: u.e.Up(), subdivisions: 2, tessellation: 16, height: 1, radius: 0.25, capSubdivisions: 6 }), n === void 0 && (n = null), mc.CreateCapsule(t, e, n);\n          }, r;\n        }(), rm = function(r, t, e) {\n          this.quality = r, this.distance = t, this.optimizeMesh = e;\n        }, ed = function() {\n          function r() {\n            this.running = !1, this._simplificationArray = [];\n          }\n          return r.prototype.addTask = function(t) {\n            this._simplificationArray.push(t);\n          }, r.prototype.executeNext = function() {\n            var t = this._simplificationArray.pop();\n            t ? (this.running = !0, this.runSimplification(t)) : this.running = !1;\n          }, r.prototype.runSimplification = function(t) {\n            var e = this;\n            if (t.parallelProcessing)\n              t.settings.forEach(function(i) {\n                e.getSimplifier(t).simplify(i, function(o) {\n                  i.distance !== void 0 && t.mesh.addLODLevel(i.distance, o), o.isVisible = !0, i.quality === t.settings[t.settings.length - 1].quality && t.successCallback && t.successCallback(), e.executeNext();\n                });\n              });\n            else {\n              var n = this.getSimplifier(t);\n              Xe.a.Run(t.settings.length, function(i) {\n                var o, a;\n                o = t.settings[i.index], a = function() {\n                  i.executeNext();\n                }, n.simplify(o, function(s) {\n                  o.distance !== void 0 && t.mesh.addLODLevel(o.distance, s), s.isVisible = !0, a();\n                });\n              }, function() {\n                t.successCallback && t.successCallback(), e.executeNext();\n              });\n            }\n          }, r.prototype.getSimplifier = function(t) {\n            switch (t.simplificationType) {\n              case _o.QUADRATIC:\n              default:\n                return new nd(t.mesh);\n            }\n          }, r;\n        }();\n        (function(r) {\n          r[r.QUADRATIC = 0] = \"QUADRATIC\";\n        })(_o || (_o = {}));\n        var om = function(r) {\n          this.vertices = r, this.error = new Array(4), this.deleted = !1, this.isDirty = !1, this.deletePending = !1, this.borderFactor = 0;\n        }, am = function() {\n          function r(t, e) {\n            this.position = t, this.id = e, this.isBorder = !0, this.q = new td(), this.triangleCount = 0, this.triangleStart = 0, this.originalOffsets = [];\n          }\n          return r.prototype.updatePosition = function(t) {\n            this.position.copyFrom(t);\n          }, r;\n        }(), td = function() {\n          function r(t) {\n            this.data = new Array(10);\n            for (var e = 0; e < 10; ++e)\n              t && t[e] ? this.data[e] = t[e] : this.data[e] = 0;\n          }\n          return r.prototype.det = function(t, e, n, i, o, a, s, d, p) {\n            return this.data[t] * this.data[o] * this.data[p] + this.data[n] * this.data[i] * this.data[d] + this.data[e] * this.data[a] * this.data[s] - this.data[n] * this.data[o] * this.data[s] - this.data[t] * this.data[a] * this.data[d] - this.data[e] * this.data[i] * this.data[p];\n          }, r.prototype.addInPlace = function(t) {\n            for (var e = 0; e < 10; ++e)\n              this.data[e] += t.data[e];\n          }, r.prototype.addArrayInPlace = function(t) {\n            for (var e = 0; e < 10; ++e)\n              this.data[e] += t[e];\n          }, r.prototype.add = function(t) {\n            for (var e = new r(), n = 0; n < 10; ++n)\n              e.data[n] = this.data[n] + t.data[n];\n            return e;\n          }, r.FromData = function(t, e, n, i) {\n            return new r(r.DataFromNumbers(t, e, n, i));\n          }, r.DataFromNumbers = function(t, e, n, i) {\n            return [t * t, t * e, t * n, t * i, e * e, e * n, e * i, n * n, n * i, i * i];\n          }, r;\n        }(), sm = function(r, t) {\n          this.vertexId = r, this.triangleId = t;\n        }, nd = function() {\n          function r(t) {\n            this._mesh = t, this.syncIterations = 5e3, this.aggressiveness = 7, this.decimationIterations = 100, this.boundingBoxEpsilon = Vt.a;\n          }\n          return r.prototype.simplify = function(t, e) {\n            var n = this;\n            this.initDecimatedMesh(), Xe.a.Run(this._mesh.subMeshes.length, function(i) {\n              n.initWithMesh(i.index, function() {\n                n.runDecimation(t, i.index, function() {\n                  i.executeNext();\n                });\n              }, t.optimizeMesh);\n            }, function() {\n              setTimeout(function() {\n                e(n._reconstructedMesh);\n              }, 0);\n            });\n          }, r.prototype.runDecimation = function(t, e, n) {\n            var i = this, o = ~~(this.triangles.length * t.quality), a = 0, s = this.triangles.length;\n            Xe.a.Run(this.decimationIterations, function(d) {\n              var p, y;\n              s - a <= o ? d.breakLoop() : (p = d.index, y = function() {\n                d.executeNext();\n              }, setTimeout(function() {\n                p % 5 == 0 && i.updateMesh(p === 0);\n                for (var P = 0; P < i.triangles.length; ++P)\n                  i.triangles[P].isDirty = !1;\n                var R = 1e-9 * Math.pow(p + 3, i.aggressiveness);\n                Xe.a.SyncAsyncForLoop(i.triangles.length, i.syncIterations, function(B) {\n                  var F = ~~((i.triangles.length / 2 + B) % i.triangles.length), z = i.triangles[F];\n                  if (z && !(z.error[3] > R || z.deleted || z.isDirty)) {\n                    for (var J = 0; J < 3; ++J)\n                      if (z.error[J] < R) {\n                        var ie = [], se = [], ce = z.vertices[J], ue = z.vertices[(J + 1) % 3];\n                        if (ce.isBorder || ue.isBorder)\n                          continue;\n                        var fe = u.e.Zero();\n                        i.calculateError(ce, ue, fe);\n                        var ve = new Array();\n                        if (i.isFlipped(ce, ue, fe, ie, ve) || i.isFlipped(ue, ce, fe, se, ve) || ie.indexOf(!0) < 0 || se.indexOf(!0) < 0)\n                          continue;\n                        var Te = new Array();\n                        if (ve.forEach(function(Se) {\n                          Te.indexOf(Se) === -1 && (Se.deletePending = !0, Te.push(Se));\n                        }), Te.length % 2 != 0)\n                          continue;\n                        ce.q = ue.q.add(ce.q), ce.updatePosition(fe);\n                        var Re = i.references.length;\n                        a = i.updateTriangles(ce, ce, ie, a), a = i.updateTriangles(ce, ue, se, a);\n                        var Ae = i.references.length - Re;\n                        if (Ae <= ce.triangleCount) {\n                          if (Ae)\n                            for (var Ee = 0; Ee < Ae; Ee++)\n                              i.references[ce.triangleStart + Ee] = i.references[Re + Ee];\n                        } else\n                          ce.triangleStart = Re;\n                        ce.triangleCount = Ae;\n                        break;\n                      }\n                  }\n                }, y, function() {\n                  return s - a <= o;\n                });\n              }, 0));\n            }, function() {\n              setTimeout(function() {\n                i.reconstructMesh(e), n();\n              }, 0);\n            });\n          }, r.prototype.initWithMesh = function(t, e, n) {\n            var i = this;\n            this.vertices = [], this.triangles = [];\n            var o = this._mesh.getVerticesData(Oe.b.PositionKind), a = this._mesh.getIndices(), s = this._mesh.subMeshes[t], d = [], p = s.verticesCount;\n            Xe.a.SyncAsyncForLoop(p, this.syncIterations / 4 >> 0, function(y) {\n              if (o) {\n                var P = y + s.verticesStart, R = u.e.FromArray(o, 3 * P), B = function(F) {\n                  if (n) {\n                    for (var z = 0; z < i.vertices.length; ++z)\n                      if (i.vertices[z].position.equalsWithEpsilon(F, 1e-4))\n                        return i.vertices[z];\n                  }\n                  return null;\n                }(R) || new am(R, i.vertices.length);\n                B.originalOffsets.push(P), B.id === i.vertices.length && i.vertices.push(B), d.push(B.id);\n              }\n            }, function() {\n              Xe.a.SyncAsyncForLoop(s.indexCount / 3, i.syncIterations, function(y) {\n                if (a) {\n                  var P = 3 * (s.indexStart / 3 + y), R = a[P + 0], B = a[P + 1], F = a[P + 2], z = i.vertices[d[R - s.verticesStart]], J = i.vertices[d[B - s.verticesStart]], ie = i.vertices[d[F - s.verticesStart]], se = new om([z, J, ie]);\n                  se.originalOffset = P, i.triangles.push(se);\n                }\n              }, function() {\n                i.init(e);\n              });\n            });\n          }, r.prototype.init = function(t) {\n            var e = this;\n            Xe.a.SyncAsyncForLoop(this.triangles.length, this.syncIterations, function(n) {\n              var i = e.triangles[n];\n              i.normal = u.e.Cross(i.vertices[1].position.subtract(i.vertices[0].position), i.vertices[2].position.subtract(i.vertices[0].position)).normalize();\n              for (var o = 0; o < 3; o++)\n                i.vertices[o].q.addArrayInPlace(td.DataFromNumbers(i.normal.x, i.normal.y, i.normal.z, -u.e.Dot(i.normal, i.vertices[0].position)));\n            }, function() {\n              Xe.a.SyncAsyncForLoop(e.triangles.length, e.syncIterations, function(n) {\n                for (var i = e.triangles[n], o = 0; o < 3; ++o)\n                  i.error[o] = e.calculateError(i.vertices[o], i.vertices[(o + 1) % 3]);\n                i.error[3] = Math.min(i.error[0], i.error[1], i.error[2]);\n              }, function() {\n                t();\n              });\n            });\n          }, r.prototype.reconstructMesh = function(t) {\n            var e, n, i, o = [];\n            for (e = 0; e < this.vertices.length; ++e)\n              this.vertices[e].triangleCount = 0;\n            for (e = 0; e < this.triangles.length; ++e)\n              if (!this.triangles[e].deleted) {\n                for (n = this.triangles[e], i = 0; i < 3; ++i)\n                  n.vertices[i].triangleCount = 1;\n                o.push(n);\n              }\n            var a = this._reconstructedMesh.getVerticesData(Oe.b.PositionKind) || [], s = this._reconstructedMesh.getVerticesData(Oe.b.NormalKind) || [], d = this._reconstructedMesh.getVerticesData(Oe.b.UVKind) || [], p = this._reconstructedMesh.getVerticesData(Oe.b.ColorKind) || [], y = this._mesh.getVerticesData(Oe.b.NormalKind), P = this._mesh.getVerticesData(Oe.b.UVKind), R = this._mesh.getVerticesData(Oe.b.ColorKind), B = 0;\n            for (e = 0; e < this.vertices.length; ++e) {\n              var F = this.vertices[e];\n              F.id = B, F.triangleCount && F.originalOffsets.forEach(function(fe) {\n                a.push(F.position.x), a.push(F.position.y), a.push(F.position.z), y && y.length && (s.push(y[3 * fe]), s.push(y[3 * fe + 1]), s.push(y[3 * fe + 2])), P && P.length && (d.push(P[2 * fe]), d.push(P[2 * fe + 1])), R && R.length && (p.push(R[4 * fe]), p.push(R[4 * fe + 1]), p.push(R[4 * fe + 2]), p.push(R[4 * fe + 3])), ++B;\n              });\n            }\n            var z = this._reconstructedMesh.getTotalIndices(), J = this._reconstructedMesh.getTotalVertices(), ie = this._reconstructedMesh.subMeshes;\n            this._reconstructedMesh.subMeshes = [];\n            var se = this._reconstructedMesh.getIndices(), ce = this._mesh.getIndices();\n            for (e = 0; e < o.length; ++e)\n              n = o[e], [0, 1, 2].forEach(function(fe) {\n                var ve = ce[n.originalOffset + fe], Te = n.vertices[fe].originalOffsets.indexOf(ve);\n                Te < 0 && (Te = 0), se.push(n.vertices[fe].id + Te + J);\n              });\n            this._reconstructedMesh.setIndices(se), this._reconstructedMesh.setVerticesData(Oe.b.PositionKind, a), s.length > 0 && this._reconstructedMesh.setVerticesData(Oe.b.NormalKind, s), d.length > 0 && this._reconstructedMesh.setVerticesData(Oe.b.UVKind, d), p.length > 0 && this._reconstructedMesh.setVerticesData(Oe.b.ColorKind, p);\n            var ue = this._mesh.subMeshes[t];\n            t > 0 && (this._reconstructedMesh.subMeshes = [], ie.forEach(function(fe) {\n              uo.a.AddToMesh(fe.materialIndex, fe.verticesStart, fe.verticesCount, fe.indexStart, fe.indexCount, fe.getMesh());\n            }), uo.a.AddToMesh(ue.materialIndex, J, B, z, 3 * o.length, this._reconstructedMesh));\n          }, r.prototype.initDecimatedMesh = function() {\n            this._reconstructedMesh = new Ie.a(this._mesh.name + \"Decimated\", this._mesh.getScene()), this._reconstructedMesh.material = this._mesh.material, this._reconstructedMesh.parent = this._mesh.parent, this._reconstructedMesh.isVisible = !1, this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId;\n          }, r.prototype.isFlipped = function(t, e, n, i, o) {\n            for (var a = 0; a < t.triangleCount; ++a) {\n              var s = this.triangles[this.references[t.triangleStart + a].triangleId];\n              if (!s.deleted) {\n                var d = this.references[t.triangleStart + a].vertexId, p = s.vertices[(d + 1) % 3], y = s.vertices[(d + 2) % 3];\n                if (p !== e && y !== e) {\n                  var P = p.position.subtract(n);\n                  P = P.normalize();\n                  var R = y.position.subtract(n);\n                  if (R = R.normalize(), Math.abs(u.e.Dot(P, R)) > 0.999)\n                    return !0;\n                  var B = u.e.Cross(P, R).normalize();\n                  if (i[a] = !1, u.e.Dot(B, s.normal) < 0.2)\n                    return !0;\n                } else\n                  i[a] = !0, o.push(s);\n              }\n            }\n            return !1;\n          }, r.prototype.updateTriangles = function(t, e, n, i) {\n            for (var o = i, a = 0; a < e.triangleCount; ++a) {\n              var s = this.references[e.triangleStart + a], d = this.triangles[s.triangleId];\n              d.deleted || (n[a] && d.deletePending ? (d.deleted = !0, o++) : (d.vertices[s.vertexId] = t, d.isDirty = !0, d.error[0] = this.calculateError(d.vertices[0], d.vertices[1]) + d.borderFactor / 2, d.error[1] = this.calculateError(d.vertices[1], d.vertices[2]) + d.borderFactor / 2, d.error[2] = this.calculateError(d.vertices[2], d.vertices[0]) + d.borderFactor / 2, d.error[3] = Math.min(d.error[0], d.error[1], d.error[2]), this.references.push(s)));\n            }\n            return o;\n          }, r.prototype.identifyBorder = function() {\n            for (var t = 0; t < this.vertices.length; ++t) {\n              var e, n = [], i = [], o = this.vertices[t];\n              for (e = 0; e < o.triangleCount; ++e)\n                for (var a = this.triangles[this.references[o.triangleStart + e].triangleId], s = 0; s < 3; s++) {\n                  for (var d = 0, p = a.vertices[s]; d < n.length && i[d] !== p.id; )\n                    ++d;\n                  d === n.length ? (n.push(1), i.push(p.id)) : n[d]++;\n                }\n              for (e = 0; e < n.length; ++e)\n                n[e] === 1 ? this.vertices[i[e]].isBorder = !0 : this.vertices[i[e]].isBorder = !1;\n            }\n          }, r.prototype.updateMesh = function(t) {\n            var e, n, i, o;\n            if (t === void 0 && (t = !1), !t) {\n              var a = [];\n              for (e = 0; e < this.triangles.length; ++e)\n                this.triangles[e].deleted || a.push(this.triangles[e]);\n              this.triangles = a;\n            }\n            for (e = 0; e < this.vertices.length; ++e)\n              this.vertices[e].triangleCount = 0, this.vertices[e].triangleStart = 0;\n            for (e = 0; e < this.triangles.length; ++e)\n              for (n = this.triangles[e], i = 0; i < 3; ++i)\n                (o = n.vertices[i]).triangleCount++;\n            var s = 0;\n            for (e = 0; e < this.vertices.length; ++e)\n              this.vertices[e].triangleStart = s, s += this.vertices[e].triangleCount, this.vertices[e].triangleCount = 0;\n            var d = new Array(3 * this.triangles.length);\n            for (e = 0; e < this.triangles.length; ++e)\n              for (n = this.triangles[e], i = 0; i < 3; ++i)\n                d[(o = n.vertices[i]).triangleStart + o.triangleCount] = new sm(i, e), o.triangleCount++;\n            this.references = d, t && this.identifyBorder();\n          }, r.prototype.vertexError = function(t, e) {\n            var n = e.x, i = e.y, o = e.z;\n            return t.data[0] * n * n + 2 * t.data[1] * n * i + 2 * t.data[2] * n * o + 2 * t.data[3] * n + t.data[4] * i * i + 2 * t.data[5] * i * o + 2 * t.data[6] * i + t.data[7] * o * o + 2 * t.data[8] * o + t.data[9];\n          }, r.prototype.calculateError = function(t, e, n) {\n            var i = t.q.add(e.q), o = t.isBorder && e.isBorder, a = 0, s = i.det(0, 1, 2, 1, 4, 5, 2, 5, 7);\n            if (s === 0 || o) {\n              var d = t.position.add(e.position).divide(new u.e(2, 2, 2)), p = this.vertexError(i, t.position), y = this.vertexError(i, e.position), P = this.vertexError(i, d);\n              (a = Math.min(p, y, P)) === p ? n && n.copyFrom(t.position) : a === y ? n && n.copyFrom(e.position) : n && n.copyFrom(d);\n            } else\n              n || (n = u.e.Zero()), n.x = -1 / s * i.det(1, 2, 3, 4, 5, 6, 5, 7, 8), n.y = 1 / s * i.det(0, 2, 3, 1, 5, 6, 2, 7, 8), n.z = -1 / s * i.det(0, 1, 3, 1, 4, 6, 2, 5, 8), a = this.vertexError(i, n);\n            return a;\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"simplificationQueue\", { get: function() {\n          if (!this._simplificationQueue) {\n            this._simplificationQueue = new ed();\n            var r = this._getComponent(ot.a.NAME_SIMPLIFICATIONQUEUE);\n            r || (r = new id(this), this._addComponent(r));\n          }\n          return this._simplificationQueue;\n        }, set: function(r) {\n          this._simplificationQueue = r;\n        }, enumerable: !0, configurable: !0 }), Ie.a.prototype.simplify = function(r, t, e, n) {\n          return t === void 0 && (t = !0), e === void 0 && (e = _o.QUADRATIC), this.getScene().simplificationQueue.addTask({ settings: r, parallelProcessing: t, mesh: this, simplificationType: e, successCallback: n }), this;\n        };\n        var id = function() {\n          function r(t) {\n            this.name = ot.a.NAME_SIMPLIFICATIONQUEUE, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraUpdateStage.registerStep(ot.a.STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE, this, this._beforeCameraUpdate);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._beforeCameraUpdate = function() {\n            this.scene._simplificationQueue && !this.scene._simplificationQueue.running && this.scene._simplificationQueue.executeNext();\n          }, r;\n        }(), cm = f(149), lm = f(88);\n        Ie.a.prototype.thinInstanceAdd = function(r, t) {\n          t === void 0 && (t = !0), this._thinInstanceUpdateBufferSize(\"matrix\", Array.isArray(r) ? r.length : 1);\n          var e = this._thinInstanceDataStorage.instancesCount;\n          if (Array.isArray(r))\n            for (var n = 0; n < r.length; ++n)\n              this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, r[n], n === r.length - 1 && t);\n          else\n            this.thinInstanceSetMatrixAt(this._thinInstanceDataStorage.instancesCount++, r, t);\n          return e;\n        }, Ie.a.prototype.thinInstanceAddSelf = function(r) {\n          return r === void 0 && (r = !0), this.thinInstanceAdd(u.a.IdentityReadOnly, r);\n        }, Ie.a.prototype.thinInstanceRegisterAttribute = function(r, t) {\n          this.removeVerticesData(r), this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.strides[r] = t, this._userThinInstanceBuffersStorage.sizes[r] = t * Math.max(32, this._thinInstanceDataStorage.instancesCount), this._userThinInstanceBuffersStorage.data[r] = new Float32Array(this._userThinInstanceBuffersStorage.sizes[r]), this._userThinInstanceBuffersStorage.vertexBuffers[r] = new Oe.b(this.getEngine(), this._userThinInstanceBuffersStorage.data[r], r, !0, !1, t, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[r]);\n        }, Ie.a.prototype.thinInstanceSetMatrixAt = function(r, t, e) {\n          if (e === void 0 && (e = !0), !this._thinInstanceDataStorage.matrixData || r >= this._thinInstanceDataStorage.instancesCount)\n            return !1;\n          var n = this._thinInstanceDataStorage.matrixData;\n          return t.copyToArray(n, 16 * r), this._thinInstanceDataStorage.worldMatrices && (this._thinInstanceDataStorage.worldMatrices[r] = t), e && (this.thinInstanceBufferUpdated(\"matrix\"), this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1)), !0;\n        }, Ie.a.prototype.thinInstanceSetAttributeAt = function(r, t, e, n) {\n          return n === void 0 && (n = !0), !(!this._userThinInstanceBuffersStorage || !this._userThinInstanceBuffersStorage.data[r] || t >= this._thinInstanceDataStorage.instancesCount) && (this._thinInstanceUpdateBufferSize(r, 0), this._userThinInstanceBuffersStorage.data[r].set(e, t * this._userThinInstanceBuffersStorage.strides[r]), n && this.thinInstanceBufferUpdated(r), !0);\n        }, Object.defineProperty(Ie.a.prototype, \"thinInstanceCount\", { get: function() {\n          return this._thinInstanceDataStorage.instancesCount;\n        }, set: function(r) {\n          var t, e;\n          r <= ((e = (t = this._thinInstanceDataStorage.matrixData) === null || t === void 0 ? void 0 : t.length) !== null && e !== void 0 ? e : 0) / 16 && (this._thinInstanceDataStorage.instancesCount = r);\n        }, enumerable: !0, configurable: !0 }), Ie.a.prototype.thinInstanceSetBuffer = function(r, t, e, n) {\n          var i, o;\n          if (e === void 0 && (e = 0), n === void 0 && (n = !1), e = e || 16, r === \"matrix\")\n            if ((i = this._thinInstanceDataStorage.matrixBuffer) === null || i === void 0 || i.dispose(), this._thinInstanceDataStorage.matrixBuffer = null, this._thinInstanceDataStorage.matrixBufferSize = t ? t.length : 32 * e, this._thinInstanceDataStorage.matrixData = t, this._thinInstanceDataStorage.worldMatrices = null, t !== null) {\n              this._thinInstanceDataStorage.instancesCount = t.length / e;\n              var a = new Oe.a(this.getEngine(), t, !n, e, !1, !0);\n              this._thinInstanceDataStorage.matrixBuffer = a, this.setVerticesBuffer(a.createVertexBuffer(\"world0\", 0, 4)), this.setVerticesBuffer(a.createVertexBuffer(\"world1\", 4, 4)), this.setVerticesBuffer(a.createVertexBuffer(\"world2\", 8, 4)), this.setVerticesBuffer(a.createVertexBuffer(\"world3\", 12, 4)), this.doNotSyncBoundingInfo || this.thinInstanceRefreshBoundingInfo(!1);\n            } else\n              this._thinInstanceDataStorage.instancesCount = 0, this.doNotSyncBoundingInfo || this.refreshBoundingInfo(!0);\n          else\n            t === null ? !((o = this._userThinInstanceBuffersStorage) === null || o === void 0) && o.data[r] && (this.removeVerticesData(r), delete this._userThinInstanceBuffersStorage.data[r], delete this._userThinInstanceBuffersStorage.strides[r], delete this._userThinInstanceBuffersStorage.sizes[r], delete this._userThinInstanceBuffersStorage.vertexBuffers[r]) : (this._thinInstanceInitializeUserStorage(), this._userThinInstanceBuffersStorage.data[r] = t, this._userThinInstanceBuffersStorage.strides[r] = e, this._userThinInstanceBuffersStorage.sizes[r] = t.length, this._userThinInstanceBuffersStorage.vertexBuffers[r] = new Oe.b(this.getEngine(), t, r, !n, !1, e, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[r]));\n        }, Ie.a.prototype.thinInstanceBufferUpdated = function(r) {\n          var t;\n          r === \"matrix\" ? this._thinInstanceDataStorage.matrixBuffer && this._thinInstanceDataStorage.matrixBuffer.updateDirectly(this._thinInstanceDataStorage.matrixData, 0, this._thinInstanceDataStorage.instancesCount) : !((t = this._userThinInstanceBuffersStorage) === null || t === void 0) && t.vertexBuffers[r] && this._userThinInstanceBuffersStorage.vertexBuffers[r].updateDirectly(this._userThinInstanceBuffersStorage.data[r], 0);\n        }, Ie.a.prototype.thinInstancePartialBufferUpdate = function(r, t, e) {\n          var n;\n          r === \"matrix\" ? this._thinInstanceDataStorage.matrixBuffer && this._thinInstanceDataStorage.matrixBuffer.updateDirectly(t, e) : !((n = this._userThinInstanceBuffersStorage) === null || n === void 0) && n.vertexBuffers[r] && this._userThinInstanceBuffersStorage.vertexBuffers[r].updateDirectly(t, e);\n        }, Ie.a.prototype.thinInstanceGetWorldMatrices = function() {\n          if (!this._thinInstanceDataStorage.matrixData || !this._thinInstanceDataStorage.matrixBuffer)\n            return [];\n          var r = this._thinInstanceDataStorage.matrixData;\n          if (!this._thinInstanceDataStorage.worldMatrices) {\n            this._thinInstanceDataStorage.worldMatrices = new Array();\n            for (var t = 0; t < this._thinInstanceDataStorage.instancesCount; ++t)\n              this._thinInstanceDataStorage.worldMatrices[t] = u.a.FromArray(r, 16 * t);\n          }\n          return this._thinInstanceDataStorage.worldMatrices;\n        }, Ie.a.prototype.thinInstanceRefreshBoundingInfo = function(r) {\n          if (r === void 0 && (r = !1), this._thinInstanceDataStorage.matrixData && this._thinInstanceDataStorage.matrixBuffer) {\n            var t = this._thinInstanceDataStorage.boundingVectors;\n            r && (t.length = 0, this.refreshBoundingInfo(!0));\n            var e = this.getBoundingInfo(), n = this._thinInstanceDataStorage.matrixData;\n            if (t.length === 0)\n              for (var i = 0; i < e.boundingBox.vectors.length; ++i)\n                t.push(e.boundingBox.vectors[i].clone());\n            u.c.Vector3[0].setAll(Number.POSITIVE_INFINITY), u.c.Vector3[1].setAll(Number.NEGATIVE_INFINITY);\n            for (var o = 0; o < this._thinInstanceDataStorage.instancesCount; ++o)\n              for (u.a.FromArrayToRef(n, 16 * o, u.c.Matrix[0]), i = 0; i < t.length; ++i)\n                u.e.TransformCoordinatesToRef(t[i], u.c.Matrix[0], u.c.Vector3[2]), u.c.Vector3[0].minimizeInPlace(u.c.Vector3[2]), u.c.Vector3[1].maximizeInPlace(u.c.Vector3[2]);\n            e.reConstruct(u.c.Vector3[0], u.c.Vector3[1]), this._updateBoundingInfo();\n          }\n        }, Ie.a.prototype._thinInstanceUpdateBufferSize = function(r, t) {\n          var e, n;\n          t === void 0 && (t = 1);\n          var i = r === \"matrix\";\n          if (i || this._userThinInstanceBuffersStorage && this._userThinInstanceBuffersStorage.strides[r]) {\n            for (var o = i ? 16 : this._userThinInstanceBuffersStorage.strides[r], a = i ? this._thinInstanceDataStorage.matrixBufferSize : this._userThinInstanceBuffersStorage.sizes[r], s = i ? this._thinInstanceDataStorage.matrixData : this._userThinInstanceBuffersStorage.data[r], d = (this._thinInstanceDataStorage.instancesCount + t) * o, p = a; p < d; )\n              p *= 2;\n            if (!s || a != p) {\n              if (s) {\n                var y = new Float32Array(p);\n                y.set(s, 0), s = y;\n              } else\n                s = new Float32Array(p);\n              if (i) {\n                (e = this._thinInstanceDataStorage.matrixBuffer) === null || e === void 0 || e.dispose();\n                var P = new Oe.a(this.getEngine(), s, !0, o, !1, !0);\n                this._thinInstanceDataStorage.matrixBuffer = P, this._thinInstanceDataStorage.matrixData = s, this._thinInstanceDataStorage.matrixBufferSize = p, this.setVerticesBuffer(P.createVertexBuffer(\"world0\", 0, 4)), this.setVerticesBuffer(P.createVertexBuffer(\"world1\", 4, 4)), this.setVerticesBuffer(P.createVertexBuffer(\"world2\", 8, 4)), this.setVerticesBuffer(P.createVertexBuffer(\"world3\", 12, 4));\n              } else\n                (n = this._userThinInstanceBuffersStorage.vertexBuffers[r]) === null || n === void 0 || n.dispose(), this._userThinInstanceBuffersStorage.data[r] = s, this._userThinInstanceBuffersStorage.sizes[r] = p, this._userThinInstanceBuffersStorage.vertexBuffers[r] = new Oe.b(this.getEngine(), s, r, !0, !1, o, !0), this.setVerticesBuffer(this._userThinInstanceBuffersStorage.vertexBuffers[r]);\n            }\n          }\n        }, Ie.a.prototype._thinInstanceInitializeUserStorage = function() {\n          this._userThinInstanceBuffersStorage || (this._userThinInstanceBuffersStorage = { data: {}, sizes: {}, vertexBuffers: {}, strides: {} });\n        }, Ie.a.prototype._disposeThinInstanceSpecificData = function() {\n          var r;\n          !((r = this._thinInstanceDataStorage) === null || r === void 0) && r.matrixBuffer && (this._thinInstanceDataStorage.matrixBuffer.dispose(), this._thinInstanceDataStorage.matrixBuffer = null);\n        };\n        var um = function() {\n          function r(t) {\n            t === void 0 && (t = Recast), this.bjsRECAST = {}, this.name = \"RecastJSPlugin\", this._maximumSubStepCount = 10, this._timeStep = 1 / 60, typeof t == \"function\" ? t(this.bjsRECAST) : this.bjsRECAST = t, this.isSupported() ? this.setTimeStep() : l.a.Error(\"RecastJS is not available. Please make sure you included the js file.\");\n          }\n          return r.prototype.setTimeStep = function(t) {\n            t === void 0 && (t = 1 / 60), this._timeStep = t;\n          }, r.prototype.getTimeStep = function() {\n            return this._timeStep;\n          }, r.prototype.setMaximumSubStepCount = function(t) {\n            t === void 0 && (t = 10), this._maximumSubStepCount = t;\n          }, r.prototype.getMaximumSubStepCount = function() {\n            return this._maximumSubStepCount;\n          }, r.prototype.createNavMesh = function(t, e) {\n            var n, i, o, a = new this.bjsRECAST.rcConfig();\n            a.cs = e.cs, a.ch = e.ch, a.borderSize = 0, a.tileSize = 0, a.walkableSlopeAngle = e.walkableSlopeAngle, a.walkableHeight = e.walkableHeight, a.walkableClimb = e.walkableClimb, a.walkableRadius = e.walkableRadius, a.maxEdgeLen = e.maxEdgeLen, a.maxSimplificationError = e.maxSimplificationError, a.minRegionArea = e.minRegionArea, a.mergeRegionArea = e.mergeRegionArea, a.maxVertsPerPoly = e.maxVertsPerPoly, a.detailSampleDist = e.detailSampleDist, a.detailSampleMaxError = e.detailSampleMaxError, this.navMesh = new this.bjsRECAST.NavMesh();\n            var s = [], d = [], p = 0;\n            for (n = 0; n < t.length; n++)\n              if (t[n]) {\n                var y = t[n], P = y.getIndices();\n                if (!P)\n                  continue;\n                var R = y.getVerticesData(Oe.b.PositionKind, !1, !1);\n                if (!R)\n                  continue;\n                var B = y.computeWorldMatrix(!0);\n                for (i = 0; i < P.length; i++)\n                  s.push(P[i] + p);\n                var F = u.e.Zero(), z = u.e.Zero();\n                for (o = 0; o < R.length; o += 3)\n                  u.e.FromArrayToRef(R, o, z), u.e.TransformCoordinatesToRef(z, B, F), d.push(F.x, F.y, F.z);\n                p += R.length / 3;\n              }\n            this.navMesh.build(d, p, s, s.length, a);\n          }, r.prototype.createDebugNavMesh = function(t) {\n            var e, n, i = this.navMesh.getDebugNavMesh(), o = i.getTriangleCount(), a = [], s = [];\n            for (e = 0; e < 3 * o; e++)\n              a.push(e);\n            for (e = 0; e < o; e++)\n              for (n = 0; n < 3; n++) {\n                var d = i.getTriangle(e).getPoint(n);\n                s.push(d.x, d.y, d.z);\n              }\n            var p = new Ie.a(\"NavMeshDebug\", t), y = new ht.a();\n            return y.indices = a, y.positions = s, y.applyToMesh(p, !1), p;\n          }, r.prototype.getClosestPoint = function(t) {\n            var e = new this.bjsRECAST.Vec3(t.x, t.y, t.z), n = this.navMesh.getClosestPoint(e);\n            return new u.e(n.x, n.y, n.z);\n          }, r.prototype.getClosestPointToRef = function(t, e) {\n            var n = new this.bjsRECAST.Vec3(t.x, t.y, t.z), i = this.navMesh.getClosestPoint(n);\n            e.set(i.x, i.y, i.z);\n          }, r.prototype.getRandomPointAround = function(t, e) {\n            var n = new this.bjsRECAST.Vec3(t.x, t.y, t.z), i = this.navMesh.getRandomPointAround(n, e);\n            return new u.e(i.x, i.y, i.z);\n          }, r.prototype.getRandomPointAroundToRef = function(t, e, n) {\n            var i = new this.bjsRECAST.Vec3(t.x, t.y, t.z), o = this.navMesh.getRandomPointAround(i, e);\n            n.set(o.x, o.y, o.z);\n          }, r.prototype.moveAlong = function(t, e) {\n            var n = new this.bjsRECAST.Vec3(t.x, t.y, t.z), i = new this.bjsRECAST.Vec3(e.x, e.y, e.z), o = this.navMesh.moveAlong(n, i);\n            return new u.e(o.x, o.y, o.z);\n          }, r.prototype.moveAlongToRef = function(t, e, n) {\n            var i = new this.bjsRECAST.Vec3(t.x, t.y, t.z), o = new this.bjsRECAST.Vec3(e.x, e.y, e.z), a = this.navMesh.moveAlong(i, o);\n            n.set(a.x, a.y, a.z);\n          }, r.prototype.computePath = function(t, e) {\n            var n, i = new this.bjsRECAST.Vec3(t.x, t.y, t.z), o = new this.bjsRECAST.Vec3(e.x, e.y, e.z), a = this.navMesh.computePath(i, o), s = a.getPointCount(), d = [];\n            for (n = 0; n < s; n++) {\n              var p = a.getPoint(n);\n              d.push(new u.e(p.x, p.y, p.z));\n            }\n            return d;\n          }, r.prototype.createCrowd = function(t, e, n) {\n            return new rd(this, t, e, n);\n          }, r.prototype.setDefaultQueryExtent = function(t) {\n            var e = new this.bjsRECAST.Vec3(t.x, t.y, t.z);\n            this.navMesh.setDefaultQueryExtent(e);\n          }, r.prototype.getDefaultQueryExtent = function() {\n            var t = this.navMesh.getDefaultQueryExtent();\n            return new u.e(t.x, t.y, t.z);\n          }, r.prototype.buildFromNavmeshData = function(t) {\n            var e = t.length * t.BYTES_PER_ELEMENT, n = this.bjsRECAST._malloc(e), i = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, n, e);\n            i.set(t);\n            var o = new this.bjsRECAST.NavmeshData();\n            o.dataPointer = i.byteOffset, o.size = t.length, this.navMesh = new this.bjsRECAST.NavMesh(), this.navMesh.buildFromNavmeshData(o), this.bjsRECAST._free(i.byteOffset);\n          }, r.prototype.getNavmeshData = function() {\n            var t = this.navMesh.getNavmeshData(), e = new Uint8Array(this.bjsRECAST.HEAPU8.buffer, t.dataPointer, t.size), n = new Uint8Array(t.size);\n            return n.set(e), this.navMesh.freeNavmeshData(t), n;\n          }, r.prototype.getDefaultQueryExtentToRef = function(t) {\n            var e = this.navMesh.getDefaultQueryExtent();\n            t.set(e.x, e.y, e.z);\n          }, r.prototype.dispose = function() {\n          }, r.prototype.isSupported = function() {\n            return this.bjsRECAST !== void 0;\n          }, r;\n        }(), rd = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            this.recastCrowd = {}, this.transforms = new Array(), this.agents = new Array(), this._onBeforeAnimationsObserver = null, this.bjsRECASTPlugin = t, this.recastCrowd = new this.bjsRECASTPlugin.bjsRECAST.Crowd(e, n, this.bjsRECASTPlugin.navMesh.getNavMesh()), this._scene = i, this._onBeforeAnimationsObserver = i.onBeforeAnimationsObservable.add(function() {\n              o.update(1e-3 * i.getEngine().getDeltaTime());\n            });\n          }\n          return r.prototype.addAgent = function(t, e, n) {\n            var i = new this.bjsRECASTPlugin.bjsRECAST.dtCrowdAgentParams();\n            i.radius = e.radius, i.height = e.height, i.maxAcceleration = e.maxAcceleration, i.maxSpeed = e.maxSpeed, i.collisionQueryRange = e.collisionQueryRange, i.pathOptimizationRange = e.pathOptimizationRange, i.separationWeight = e.separationWeight, i.updateFlags = 7, i.obstacleAvoidanceType = 0, i.queryFilterType = 0, i.userData = 0;\n            var o = this.recastCrowd.addAgent(new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x, t.y, t.z), i);\n            return this.transforms.push(n), this.agents.push(o), o;\n          }, r.prototype.getAgentPosition = function(t) {\n            var e = this.recastCrowd.getAgentPosition(t);\n            return new u.e(e.x, e.y, e.z);\n          }, r.prototype.getAgentPositionToRef = function(t, e) {\n            var n = this.recastCrowd.getAgentPosition(t);\n            e.set(n.x, n.y, n.z);\n          }, r.prototype.getAgentVelocity = function(t) {\n            var e = this.recastCrowd.getAgentVelocity(t);\n            return new u.e(e.x, e.y, e.z);\n          }, r.prototype.getAgentVelocityToRef = function(t, e) {\n            var n = this.recastCrowd.getAgentVelocity(t);\n            e.set(n.x, n.y, n.z);\n          }, r.prototype.getAgentNextTargetPath = function(t) {\n            var e = this.recastCrowd.getAgentNextTargetPath(t);\n            return new u.e(e.x, e.y, e.z);\n          }, r.prototype.getAgentNextTargetPathToRef = function(t, e) {\n            var n = this.recastCrowd.getAgentNextTargetPath(t);\n            e.set(n.x, n.y, n.z);\n          }, r.prototype.getAgentState = function(t) {\n            return this.recastCrowd.getAgentState(t);\n          }, r.prototype.overOffmeshConnection = function(t) {\n            return this.recastCrowd.overOffmeshConnection(t);\n          }, r.prototype.agentGoto = function(t, e) {\n            this.recastCrowd.agentGoto(t, new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x, e.y, e.z));\n          }, r.prototype.agentTeleport = function(t, e) {\n            this.recastCrowd.agentTeleport(t, new this.bjsRECASTPlugin.bjsRECAST.Vec3(e.x, e.y, e.z));\n          }, r.prototype.updateAgentParameters = function(t, e) {\n            var n = this.recastCrowd.getAgentParameters(t);\n            e.radius !== void 0 && (n.radius = e.radius), e.height !== void 0 && (n.height = e.height), e.maxAcceleration !== void 0 && (n.maxAcceleration = e.maxAcceleration), e.maxSpeed !== void 0 && (n.maxSpeed = e.maxSpeed), e.collisionQueryRange !== void 0 && (n.collisionQueryRange = e.collisionQueryRange), e.pathOptimizationRange !== void 0 && (n.pathOptimizationRange = e.pathOptimizationRange), e.separationWeight !== void 0 && (n.separationWeight = e.separationWeight), this.recastCrowd.setAgentParameters(t, n);\n          }, r.prototype.removeAgent = function(t) {\n            this.recastCrowd.removeAgent(t);\n            var e = this.agents.indexOf(t);\n            e > -1 && (this.agents.splice(e, 1), this.transforms.splice(e, 1));\n          }, r.prototype.getAgents = function() {\n            return this.agents;\n          }, r.prototype.update = function(t) {\n            var e = this.bjsRECASTPlugin.getTimeStep(), n = this.bjsRECASTPlugin.getMaximumSubStepCount();\n            if (e <= Vt.a)\n              this.recastCrowd.update(t);\n            else {\n              var i = t / e;\n              n && i > n && (i = n), i < 1 && (i = 1);\n              for (var o = 0; o < i; o++)\n                this.recastCrowd.update(e);\n            }\n            for (var a = 0; a < this.agents.length; a++)\n              this.transforms[a].position = this.getAgentPosition(this.agents[a]);\n          }, r.prototype.setDefaultQueryExtent = function(t) {\n            var e = new this.bjsRECASTPlugin.bjsRECAST.Vec3(t.x, t.y, t.z);\n            this.recastCrowd.setDefaultQueryExtent(e);\n          }, r.prototype.getDefaultQueryExtent = function() {\n            var t = this.recastCrowd.getDefaultQueryExtent();\n            return new u.e(t.x, t.y, t.z);\n          }, r.prototype.getDefaultQueryExtentToRef = function(t) {\n            var e = this.recastCrowd.getDefaultQueryExtent();\n            t.set(e.x, e.y, e.z);\n          }, r.prototype.dispose = function() {\n            this.recastCrowd.destroy(), this._scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver), this._onBeforeAnimationsObserver = null;\n          }, r;\n        }();\n        Ue.a.OfflineProviderFactory = function(r, t, e) {\n          return e === void 0 && (e = !1), new od(r, t, e);\n        };\n        var Rr, od = function() {\n          function r(t, e, n) {\n            var i = this;\n            n === void 0 && (n = !1), this._idbFactory = typeof window < \"u\" ? window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB : indexedDB, this._callbackManifestChecked = e, this._currentSceneUrl = r._ReturnFullUrlLocation(t), this._db = null, this._enableSceneOffline = !1, this._enableTexturesOffline = !1, this._manifestVersionFound = 0, this._mustUpdateRessources = !1, this._hasReachedQuota = !1, r.IDBStorageEnabled ? n ? (this._enableSceneOffline = !0, this._enableTexturesOffline = !0, this._manifestVersionFound = 1, Xe.b.SetImmediate(function() {\n              i._callbackManifestChecked(!0);\n            })) : this._checkManifestFile() : this._callbackManifestChecked(!0);\n          }\n          return Object.defineProperty(r.prototype, \"enableSceneOffline\", { get: function() {\n            return this._enableSceneOffline;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"enableTexturesOffline\", { get: function() {\n            return this._enableTexturesOffline;\n          }, enumerable: !1, configurable: !0 }), r.prototype._checkManifestFile = function() {\n            var t = this, e = function() {\n              t._enableSceneOffline = !1, t._enableTexturesOffline = !1, t._callbackManifestChecked(!1);\n            }, n = !1, i = this._currentSceneUrl + \".manifest\", o = new re.a();\n            navigator.onLine && (n = !0, i = i + (i.match(/\\?/) == null ? \"?\" : \"&\") + Date.now()), o.open(\"GET\", i), o.addEventListener(\"load\", function() {\n              if (o.status === 200 || r._ValidateXHRData(o, 1))\n                try {\n                  var a = JSON.parse(o.response);\n                  t._enableSceneOffline = a.enableSceneOffline, t._enableTexturesOffline = a.enableTexturesOffline && r.IsUASupportingBlobStorage, a.version && !isNaN(parseInt(a.version)) && (t._manifestVersionFound = a.version), t._callbackManifestChecked && t._callbackManifestChecked(!0);\n                } catch {\n                  e();\n                }\n              else\n                e();\n            }, !1), o.addEventListener(\"error\", function() {\n              if (n) {\n                n = !1;\n                var a = t._currentSceneUrl + \".manifest\";\n                o.open(\"GET\", a), o.send();\n              } else\n                e();\n            }, !1);\n            try {\n              o.send();\n            } catch {\n              l.a.Error(\"Error on XHR send request.\"), this._callbackManifestChecked(!1);\n            }\n          }, r.prototype.open = function(t, e) {\n            var n = this, i = function() {\n              n._isSupported = !1, e && e();\n            };\n            if (this._idbFactory && (this._enableSceneOffline || this._enableTexturesOffline))\n              if (this._db)\n                t && t();\n              else {\n                this._hasReachedQuota = !1, this._isSupported = !0;\n                var o = this._idbFactory.open(\"babylonjs\", 1);\n                o.onerror = function() {\n                  i();\n                }, o.onblocked = function() {\n                  l.a.Error(\"IDB request blocked. Please reload the page.\"), i();\n                }, o.onsuccess = function() {\n                  n._db = o.result, t();\n                }, o.onupgradeneeded = function(a) {\n                  if (n._db = a.target.result, n._db)\n                    try {\n                      n._db.createObjectStore(\"scenes\", { keyPath: \"sceneUrl\" }), n._db.createObjectStore(\"versions\", { keyPath: \"sceneUrl\" }), n._db.createObjectStore(\"textures\", { keyPath: \"textureUrl\" });\n                    } catch (s) {\n                      l.a.Error(\"Error while creating object stores. Exception: \" + s.message), i();\n                    }\n                };\n              }\n            else\n              this._isSupported = !1, e && e();\n          }, r.prototype.loadImage = function(t, e) {\n            var n = this, i = r._ReturnFullUrlLocation(t), o = function() {\n              n._hasReachedQuota || n._db === null ? e.src = t : n._saveImageIntoDBAsync(i, e);\n            };\n            this._mustUpdateRessources ? o() : this._loadImageFromDBAsync(i, e, o);\n          }, r.prototype._loadImageFromDBAsync = function(t, e, n) {\n            if (this._isSupported && this._db !== null) {\n              var i, o = this._db.transaction([\"textures\"]);\n              o.onabort = function() {\n                e.src = t;\n              }, o.oncomplete = function() {\n                var s;\n                if (i) {\n                  var d = window.URL || window.webkitURL;\n                  s = d.createObjectURL(i.data), e.onerror = function() {\n                    l.a.Error(\"Error loading image from blob URL: \" + s + \" switching back to web url: \" + t), e.src = t;\n                  }, e.src = s;\n                } else\n                  n();\n              };\n              var a = o.objectStore(\"textures\").get(t);\n              a.onsuccess = function(s) {\n                i = s.target.result;\n              }, a.onerror = function() {\n                l.a.Error(\"Error loading texture \" + t + \" from DB.\"), e.src = t;\n              };\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\"), e.src = t;\n          }, r.prototype._saveImageIntoDBAsync = function(t, e) {\n            var n = this;\n            if (this._isSupported) {\n              var i = function() {\n                var s;\n                if (o) {\n                  var d = window.URL || window.webkitURL;\n                  try {\n                    s = d.createObjectURL(o);\n                  } catch {\n                    s = d.createObjectURL(o);\n                  }\n                }\n                s && (e.src = s);\n              };\n              if (r.IsUASupportingBlobStorage) {\n                var o, a = new re.a();\n                a.open(\"GET\", t), a.responseType = \"blob\", a.addEventListener(\"load\", function() {\n                  if (a.status === 200 && n._db) {\n                    o = a.response;\n                    var s = n._db.transaction([\"textures\"], \"readwrite\");\n                    s.onabort = function(y) {\n                      try {\n                        var P = (y.srcElement || y.target).error;\n                        P && P.name === \"QuotaExceededError\" && (n._hasReachedQuota = !0);\n                      } catch {\n                      }\n                      i();\n                    }, s.oncomplete = function() {\n                      i();\n                    };\n                    var d = { textureUrl: t, data: o };\n                    try {\n                      var p = s.objectStore(\"textures\").put(d);\n                      p.onsuccess = function() {\n                      }, p.onerror = function() {\n                        i();\n                      };\n                    } catch (y) {\n                      y.code === 25 && (r.IsUASupportingBlobStorage = !1, n._enableTexturesOffline = !1), e.src = t;\n                    }\n                  } else\n                    e.src = t;\n                }, !1), a.addEventListener(\"error\", function() {\n                  l.a.Error(\"Error in XHR request in BABYLON.Database.\"), e.src = t;\n                }, !1), a.send();\n              } else\n                e.src = t;\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\"), e.src = t;\n          }, r.prototype._checkVersionFromDB = function(t, e) {\n            var n = this;\n            this._loadVersionFromDBAsync(t, e, function() {\n              n._saveVersionIntoDBAsync(t, e);\n            });\n          }, r.prototype._loadVersionFromDBAsync = function(t, e, n) {\n            var i, o = this;\n            if (this._isSupported && this._db)\n              try {\n                var a = this._db.transaction([\"versions\"]);\n                a.oncomplete = function() {\n                  i ? o._manifestVersionFound !== i.data ? (o._mustUpdateRessources = !0, n()) : e(i.data) : (o._mustUpdateRessources = !0, n());\n                }, a.onabort = function() {\n                  e(-1);\n                };\n                var s = a.objectStore(\"versions\").get(t);\n                s.onsuccess = function(d) {\n                  i = d.target.result;\n                }, s.onerror = function() {\n                  l.a.Error(\"Error loading version for scene \" + t + \" from DB.\"), e(-1);\n                };\n              } catch (d) {\n                l.a.Error(\"Error while accessing 'versions' object store (READ OP). Exception: \" + d.message), e(-1);\n              }\n            else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\"), e(-1);\n          }, r.prototype._saveVersionIntoDBAsync = function(t, e) {\n            var n = this;\n            if (this._isSupported && !this._hasReachedQuota && this._db)\n              try {\n                var i = this._db.transaction([\"versions\"], \"readwrite\");\n                i.onabort = function(s) {\n                  try {\n                    var d = s.srcElement.error;\n                    d && d.name === \"QuotaExceededError\" && (n._hasReachedQuota = !0);\n                  } catch {\n                  }\n                  e(-1);\n                }, i.oncomplete = function() {\n                  e(n._manifestVersionFound);\n                };\n                var o = { sceneUrl: t, data: this._manifestVersionFound }, a = i.objectStore(\"versions\").put(o);\n                a.onsuccess = function() {\n                }, a.onerror = function() {\n                  l.a.Error(\"Error in DB add version request in BABYLON.Database.\");\n                };\n              } catch (s) {\n                l.a.Error(\"Error while accessing 'versions' object store (WRITE OP). Exception: \" + s.message), e(-1);\n              }\n            else\n              e(-1);\n          }, r.prototype.loadFile = function(t, e, n, i, o) {\n            var a = this, s = r._ReturnFullUrlLocation(t), d = function() {\n              a._saveFileAsync(s, e, n, o, i);\n            };\n            this._checkVersionFromDB(s, function(p) {\n              p !== -1 ? a._mustUpdateRessources ? a._saveFileAsync(s, e, n, o, i) : a._loadFileAsync(s, e, d) : i && i();\n            });\n          }, r.prototype._loadFileAsync = function(t, e, n) {\n            if (this._isSupported && this._db) {\n              var i, o;\n              i = t.indexOf(\".babylon\") !== -1 ? \"scenes\" : \"textures\";\n              var a = this._db.transaction([i]);\n              a.oncomplete = function() {\n                o ? e(o.data) : n();\n              }, a.onabort = function() {\n                n();\n              };\n              var s = a.objectStore(i).get(t);\n              s.onsuccess = function(d) {\n                o = d.target.result;\n              }, s.onerror = function() {\n                l.a.Error(\"Error loading file \" + t + \" from DB.\"), n();\n              };\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\"), e();\n          }, r.prototype._saveFileAsync = function(t, e, n, i, o) {\n            var a = this;\n            if (this._isSupported) {\n              var s;\n              s = t.indexOf(\".babylon\") !== -1 ? \"scenes\" : \"textures\";\n              var d, p = new re.a();\n              p.open(\"GET\", t + \"?\" + Date.now()), i && (p.responseType = \"arraybuffer\"), n && (p.onprogress = n), p.addEventListener(\"load\", function() {\n                if (p.status === 200 || p.status < 400 && r._ValidateXHRData(p, i ? 6 : 1))\n                  if (d = i ? p.response : p.responseText, !a._hasReachedQuota && a._db) {\n                    var y, P = a._db.transaction([s], \"readwrite\");\n                    P.onabort = function(B) {\n                      try {\n                        var F = B.srcElement.error;\n                        F && F.name === \"QuotaExceededError\" && (a._hasReachedQuota = !0);\n                      } catch {\n                      }\n                      e(d);\n                    }, P.oncomplete = function() {\n                      e(d);\n                    }, y = s === \"scenes\" ? { sceneUrl: t, data: d, version: a._manifestVersionFound } : { textureUrl: t, data: d };\n                    try {\n                      var R = P.objectStore(s).put(y);\n                      R.onsuccess = function() {\n                      }, R.onerror = function() {\n                        l.a.Error(\"Error in DB add file request in BABYLON.Database.\");\n                      };\n                    } catch {\n                      e(d);\n                    }\n                  } else\n                    e(d);\n                else\n                  p.status >= 400 && o ? o(p) : e();\n              }, !1), p.addEventListener(\"error\", function() {\n                l.a.Error(\"error on XHR request.\"), e();\n              }, !1), p.send();\n            } else\n              l.a.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\"), e();\n          }, r._ValidateXHRData = function(t, e) {\n            e === void 0 && (e = 7);\n            try {\n              if (1 & e) {\n                if (t.responseText && t.responseText.length > 0)\n                  return !0;\n                if (e === 1)\n                  return !1;\n              }\n              if (2 & e) {\n                var n = ta.GetTGAHeader(t.response);\n                if (n.width && n.height && n.width > 0 && n.height > 0)\n                  return !0;\n                if (e === 2)\n                  return !1;\n              }\n              if (4 & e) {\n                var i = new Uint8Array(t.response, 0, 3);\n                return i[0] === 68 && i[1] === 68 && i[2] === 83;\n              }\n            } catch {\n            }\n            return !1;\n          }, r.IsUASupportingBlobStorage = !0, r.IDBStorageEnabled = !1, r._ParseURL = function(t) {\n            document.createElement(\"a\").href = t;\n            var e = t.substring(0, t.lastIndexOf(\"#\")), n = t.substring(e.lastIndexOf(\"/\") + 1, t.length);\n            return t.substring(0, t.indexOf(n, 0));\n          }, r._ReturnFullUrlLocation = function(t) {\n            return t.indexOf(\"http:/\") === -1 && t.indexOf(\"https:/\") === -1 && typeof window < \"u\" ? r._ParseURL(window.location.href) + t : t;\n          }, r;\n        }(), gc = function() {\n          function r(t, e, n) {\n            this.gradient = t, this.color1 = e, this.color2 = n;\n          }\n          return r.prototype.getColorToRef = function(t) {\n            this.color2 ? I.b.LerpToRef(this.color1, this.color2, Math.random(), t) : t.copyFrom(this.color1);\n          }, r;\n        }(), ad = function(r, t) {\n          this.gradient = r, this.color = t;\n        }, vc = function() {\n          function r(t, e, n) {\n            this.gradient = t, this.factor1 = e, this.factor2 = n;\n          }\n          return r.prototype.getFactor = function() {\n            return this.factor2 === void 0 || this.factor2 === this.factor1 ? this.factor1 : this.factor1 + (this.factor2 - this.factor1) * Math.random();\n          }, r;\n        }(), On = function() {\n          function r() {\n          }\n          return r.GetCurrentGradient = function(t, e, n) {\n            if (e[0].gradient > t)\n              n(e[0], e[0], 1);\n            else {\n              for (var i = 0; i < e.length - 1; i++) {\n                var o = e[i], a = e[i + 1];\n                if (t >= o.gradient && t <= a.gradient)\n                  return void n(o, a, (t - o.gradient) / (a.gradient - o.gradient));\n              }\n              var s = e.length - 1;\n              n(e[s], e[s], 1);\n            }\n          }, r;\n        }(), sd = function() {\n          function r(t) {\n            this.particleSystem = t, this.position = u.e.Zero(), this.direction = u.e.Zero(), this.color = new I.b(0, 0, 0, 0), this.colorStep = new I.b(0, 0, 0, 0), this.lifeTime = 1, this.age = 0, this.size = 0, this.scale = new u.d(1, 1), this.angle = 0, this.angularSpeed = 0, this.cellIndex = 0, this._attachedSubEmitters = null, this._currentColor1 = new I.b(0, 0, 0, 0), this._currentColor2 = new I.b(0, 0, 0, 0), this._currentSize1 = 0, this._currentSize2 = 0, this._currentAngularSpeed1 = 0, this._currentAngularSpeed2 = 0, this._currentVelocity1 = 0, this._currentVelocity2 = 0, this._currentLimitVelocity1 = 0, this._currentLimitVelocity2 = 0, this._currentDrag1 = 0, this._currentDrag2 = 0, this.id = r._Count++, this.particleSystem.isAnimationSheetEnabled && this.updateCellInfoFromSystem();\n          }\n          return r.prototype.updateCellInfoFromSystem = function() {\n            this.cellIndex = this.particleSystem.startSpriteCellID;\n          }, r.prototype.updateCellIndex = function() {\n            var t = this.age, e = this.particleSystem.spriteCellChangeSpeed;\n            this.particleSystem.spriteRandomStartCell && (this._randomCellOffset === void 0 && (this._randomCellOffset = Math.random() * this.lifeTime), e === 0 ? (e = 1, t = this._randomCellOffset) : t += this._randomCellOffset);\n            var n = this._initialEndSpriteCellID - this._initialStartSpriteCellID, i = $.a.Clamp(t * e % this.lifeTime / this.lifeTime);\n            this.cellIndex = this._initialStartSpriteCellID + i * n | 0;\n          }, r.prototype._inheritParticleInfoToSubEmitter = function(t) {\n            if (t.particleSystem.emitter.position) {\n              var e = t.particleSystem.emitter;\n              if (e.position.copyFrom(this.position), t.inheritDirection) {\n                var n = u.c.Vector3[0];\n                this.direction.normalizeToRef(n), e.setDirection(n, 0, Math.PI / 2);\n              }\n            } else\n              t.particleSystem.emitter.copyFrom(this.position);\n            this.direction.scaleToRef(t.inheritedVelocityAmount / 2, u.c.Vector3[0]), t.particleSystem._inheritedVelocityOffset.copyFrom(u.c.Vector3[0]);\n          }, r.prototype._inheritParticleInfoToSubEmitters = function() {\n            var t = this;\n            this._attachedSubEmitters && this._attachedSubEmitters.length > 0 && this._attachedSubEmitters.forEach(function(e) {\n              t._inheritParticleInfoToSubEmitter(e);\n            });\n          }, r.prototype._reset = function() {\n            this.age = 0, this.id = r._Count++, this._currentColorGradient = null, this._currentSizeGradient = null, this._currentAngularSpeedGradient = null, this._currentVelocityGradient = null, this._currentLimitVelocityGradient = null, this._currentDragGradient = null, this.cellIndex = this.particleSystem.startSpriteCellID, this._randomCellOffset = void 0;\n          }, r.prototype.copyTo = function(t) {\n            t.position.copyFrom(this.position), this._initialDirection ? t._initialDirection ? t._initialDirection.copyFrom(this._initialDirection) : t._initialDirection = this._initialDirection.clone() : t._initialDirection = null, t.direction.copyFrom(this.direction), this._localPosition && (t._localPosition ? t._localPosition.copyFrom(this._localPosition) : t._localPosition = this._localPosition.clone()), t.color.copyFrom(this.color), t.colorStep.copyFrom(this.colorStep), t.lifeTime = this.lifeTime, t.age = this.age, t._randomCellOffset = this._randomCellOffset, t.size = this.size, t.scale.copyFrom(this.scale), t.angle = this.angle, t.angularSpeed = this.angularSpeed, t.particleSystem = this.particleSystem, t.cellIndex = this.cellIndex, t.id = this.id, t._attachedSubEmitters = this._attachedSubEmitters, this._currentColorGradient && (t._currentColorGradient = this._currentColorGradient, t._currentColor1.copyFrom(this._currentColor1), t._currentColor2.copyFrom(this._currentColor2)), this._currentSizeGradient && (t._currentSizeGradient = this._currentSizeGradient, t._currentSize1 = this._currentSize1, t._currentSize2 = this._currentSize2), this._currentAngularSpeedGradient && (t._currentAngularSpeedGradient = this._currentAngularSpeedGradient, t._currentAngularSpeed1 = this._currentAngularSpeed1, t._currentAngularSpeed2 = this._currentAngularSpeed2), this._currentVelocityGradient && (t._currentVelocityGradient = this._currentVelocityGradient, t._currentVelocity1 = this._currentVelocity1, t._currentVelocity2 = this._currentVelocity2), this._currentLimitVelocityGradient && (t._currentLimitVelocityGradient = this._currentLimitVelocityGradient, t._currentLimitVelocity1 = this._currentLimitVelocity1, t._currentLimitVelocity2 = this._currentLimitVelocity2), this._currentDragGradient && (t._currentDragGradient = this._currentDragGradient, t._currentDrag1 = this._currentDrag1, t._currentDrag2 = this._currentDrag2), this.particleSystem.isAnimationSheetEnabled && (t._initialStartSpriteCellID = this._initialStartSpriteCellID, t._initialEndSpriteCellID = this._initialEndSpriteCellID), this.particleSystem.useRampGradients && (t.remapData && this.remapData ? t.remapData.copyFrom(this.remapData) : t.remapData = new u.f(0, 0, 0, 0)), this._randomNoiseCoordinates1 && (t._randomNoiseCoordinates1 ? (t._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1), t._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2)) : (t._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone(), t._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone()));\n          }, r._Count = 0, r;\n        }();\n        (function(r) {\n          r[r.ATTACHED = 0] = \"ATTACHED\", r[r.END = 1] = \"END\";\n        })(Rr || (Rr = {}));\n        var mo = function() {\n          function r(t) {\n            if (this.particleSystem = t, this.type = Rr.END, this.inheritDirection = !1, this.inheritedVelocityAmount = 0, !t.emitter || !t.emitter.dispose) {\n              var e = O.a.GetClass(\"BABYLON.AbstractMesh\");\n              t.emitter = new e(\"SubemitterSystemEmitter\", t.getScene());\n            }\n            t.onDisposeObservable.add(function() {\n              t.emitter && t.emitter.dispose && t.emitter.dispose();\n            });\n          }\n          return r.prototype.clone = function() {\n            var t = this.particleSystem.emitter;\n            t ? t instanceof u.e ? t = t.clone() : t.getClassName().indexOf(\"Mesh\") !== -1 && ((t = new (O.a.GetClass(\"BABYLON.Mesh\"))(\"\", t.getScene())).isVisible = !1) : t = new u.e();\n            var e = new r(this.particleSystem.clone(\"\", t));\n            return e.particleSystem.name += \"Clone\", e.type = this.type, e.inheritDirection = this.inheritDirection, e.inheritedVelocityAmount = this.inheritedVelocityAmount, e.particleSystem._disposeEmitterOnDispose = !0, e.particleSystem.disposeOnStop = !0, e;\n          }, r.prototype.serialize = function() {\n            var t = {};\n            return t.type = this.type, t.inheritDirection = this.inheritDirection, t.inheritedVelocityAmount = this.inheritedVelocityAmount, t.particleSystem = this.particleSystem.serialize(), t;\n          }, r._ParseParticleSystem = function(t, e, n) {\n            throw En.a.WarnImport(\"ParseParticle\");\n          }, r.Parse = function(t, e, n) {\n            var i = t.particleSystem, o = new r(r._ParseParticleSystem(i, e, n));\n            return o.type = t.type, o.inheritDirection = t.inheritDirection, o.inheritedVelocityAmount = t.inheritedVelocityAmount, o.particleSystem._isSubEmitter = !0, o;\n          }, r.prototype.dispose = function() {\n            this.particleSystem.dispose();\n          }, r;\n        }(), hm = `\nvarying vec2 vUV;\nvarying vec4 vColor;\nuniform vec4 textureMask;\nuniform sampler2D diffuseSampler;\n#include<clipPlaneFragmentDeclaration>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\nuniform sampler2D rampSampler;\n#endif\nvoid main(void) {\n#include<clipPlaneFragment>\nvec4 textureColor=texture2D(diffuseSampler,vUV);\nvec4 baseColor=(textureColor*textureMask+(vec4(1.,1.,1.,1.)-textureMask))*vColor;\n#ifdef RAMPGRADIENT\nfloat alpha=baseColor.a;\nfloat remappedColorIndex=clamp((alpha-remapRanges.x)/remapRanges.y,0.0,1.0);\nvec4 rampColor=texture2D(rampSampler,vec2(1.0-remappedColorIndex,0.));\nbaseColor.rgb*=rampColor.rgb;\n\nfloat finalAlpha=baseColor.a;\nbaseColor.a=clamp((alpha*rampColor.a-remapRanges.z)/remapRanges.w,0.0,1.0);\n#endif\n#ifdef BLENDMULTIPLYMODE\nfloat sourceAlpha=vColor.a*textureColor.a;\nbaseColor.rgb=baseColor.rgb*sourceAlpha+vec3(1.0)*(1.0-sourceAlpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\nbaseColor.rgb=toLinearSpace(baseColor.rgb);\nbaseColor=applyImageProcessing(baseColor);\n#endif\n#endif\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.particlesPixelShader = hm;\n        var dm = `\nattribute vec3 position;\nattribute vec4 color;\nattribute float angle;\nattribute vec2 size;\n#ifdef ANIMATESHEET\nattribute float cellIndex;\n#endif\n#ifndef BILLBOARD\nattribute vec3 direction;\n#endif\n#ifdef BILLBOARDSTRETCHED\nattribute vec3 direction;\n#endif\n#ifdef RAMPGRADIENT\nattribute vec4 remapData;\n#endif\nattribute vec2 offset;\n\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\n#ifdef ANIMATESHEET\nuniform vec3 particlesInfos;\n#endif\n\nvarying vec2 vUV;\nvarying vec4 vColor;\nvarying vec3 vPositionW;\n#ifdef RAMPGRADIENT\nvarying vec4 remapRanges;\n#endif\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration>\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\nreturn position+alignedCorner;\n}\n#endif\nvoid main(void) {\nvec2 cornerPos;\ncornerPos=(vec2(offset.x-0.5,offset.y-0.5)-translationPivot)*size+translationPivot;\n#ifdef BILLBOARD\n\nvec3 rotatedCorner;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=position-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=position-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner);\nvec3 viewPos=(view*vec4(vPositionW,1.0)).xyz;\n#else\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 viewPos=(view*vec4(position,1.0)).xyz+rotatedCorner;\nvPositionW=(invView*vec4(viewPos,1)).xyz;\n#endif\n#ifdef RAMPGRADIENT\nremapRanges=remapData;\n#endif\n\ngl_Position=projection*vec4(viewPos,1.0);\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=normalize(direction);\nvPositionW=rotate(yaxis,rotatedCorner);\ngl_Position=projection*view*vec4(vPositionW,1.0);\n#endif\nvColor=color;\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex*particlesInfos.z);\nfloat columnOffset=cellIndex-rowOffset/particlesInfos.z;\nvec2 uvScale=particlesInfos.xy;\nvec2 uvOffset=vec2(offset.x ,1.0-offset.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=offset;\n#endif\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}`;\n        ze.a.ShadersStore.particlesVertexShader = dm;\n        var cn = function(r) {\n          function t(e, n, i, o, a, s) {\n            o === void 0 && (o = null), a === void 0 && (a = !1), s === void 0 && (s = 0.01);\n            var d = r.call(this, e) || this;\n            return d._inheritedVelocityOffset = new u.e(), d.onDisposeObservable = new C.c(), d.onStoppedObservable = new C.c(), d._particles = new Array(), d._stockParticles = new Array(), d._newPartsExcess = 0, d._vertexBuffers = {}, d._scaledColorStep = new I.b(0, 0, 0, 0), d._colorDiff = new I.b(0, 0, 0, 0), d._scaledDirection = u.e.Zero(), d._scaledGravity = u.e.Zero(), d._currentRenderId = -1, d._useInstancing = !1, d._started = !1, d._stopped = !1, d._actualFrame = 0, d._currentEmitRate1 = 0, d._currentEmitRate2 = 0, d._currentStartSize1 = 0, d._currentStartSize2 = 0, d._rawTextureWidth = 256, d._useRampGradients = !1, d._disposeEmitterOnDispose = !1, d.isLocal = !1, d._onBeforeDrawParticlesObservable = null, d.recycleParticle = function(p) {\n              var y = d._particles.pop();\n              y !== p && y.copyTo(p), d._stockParticles.push(y);\n            }, d._createParticle = function() {\n              var p;\n              if (d._stockParticles.length !== 0 ? (p = d._stockParticles.pop())._reset() : p = new sd(d), d._subEmitters && d._subEmitters.length > 0) {\n                var y = d._subEmitters[Math.floor(Math.random() * d._subEmitters.length)];\n                p._attachedSubEmitters = [], y.forEach(function(P) {\n                  if (P.type === Rr.ATTACHED) {\n                    var R = P.clone();\n                    p._attachedSubEmitters.push(R), R.particleSystem.start();\n                  }\n                });\n              }\n              return p;\n            }, d._emitFromParticle = function(p) {\n              if (d._subEmitters && d._subEmitters.length !== 0) {\n                var y = Math.floor(Math.random() * d._subEmitters.length);\n                d._subEmitters[y].forEach(function(P) {\n                  if (P.type === Rr.END) {\n                    var R = P.clone();\n                    p._inheritParticleInfoToSubEmitter(R), R.particleSystem._rootParticleSystem = d, d.activeSubSystems.push(R.particleSystem), R.particleSystem.start();\n                  }\n                });\n              }\n            }, d._capacity = n, d._epsilon = s, d._isAnimationSheetEnabled = a, i && i.getClassName() !== \"Scene\" ? (d._engine = i, d.defaultProjectionMatrix = u.a.PerspectiveFovLH(0.8, 1, 0.1, 100)) : (d._scene = i || te.a.LastCreatedScene, d._engine = d._scene.getEngine(), d.uniqueId = d._scene.getUniqueId(), d._scene.particleSystems.push(d)), d._engine.getCaps().vertexArrayObject && (d._vertexArrayObject = null), d._attachImageProcessingConfiguration(null), d._customEffect = { 0: o }, d._useInstancing = d._engine.getCaps().instancedArrays, d._createIndexBuffer(), d._createVertexBuffers(), d.particleEmitterType = new xr(), d.updateFunction = function(p) {\n              var y = null, P = null;\n              d.noiseTexture && (y = d.noiseTexture.getSize(), P = d.noiseTexture.getContent());\n              for (var R, B = function() {\n                R = p[F];\n                var z = d._scaledUpdateSpeed, J = R.age;\n                if (R.age += z, R.age > R.lifeTime) {\n                  var ie = R.age - J;\n                  z = (R.lifeTime - J) * z / ie, R.age = R.lifeTime;\n                }\n                var se = R.age / R.lifeTime;\n                d._colorGradients && d._colorGradients.length > 0 ? On.GetCurrentGradient(se, d._colorGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentColorGradient && (R._currentColor1.copyFrom(R._currentColor2), Ee.getColorToRef(R._currentColor2), R._currentColorGradient = Ae), I.b.LerpToRef(R._currentColor1, R._currentColor2, Se, R.color);\n                }) : (R.colorStep.scaleToRef(z, d._scaledColorStep), R.color.addInPlace(d._scaledColorStep), R.color.a < 0 && (R.color.a = 0)), d._angularSpeedGradients && d._angularSpeedGradients.length > 0 && On.GetCurrentGradient(se, d._angularSpeedGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentAngularSpeedGradient && (R._currentAngularSpeed1 = R._currentAngularSpeed2, R._currentAngularSpeed2 = Ee.getFactor(), R._currentAngularSpeedGradient = Ae), R.angularSpeed = $.a.Lerp(R._currentAngularSpeed1, R._currentAngularSpeed2, Se);\n                }), R.angle += R.angularSpeed * z;\n                var ce = z;\n                if (d._velocityGradients && d._velocityGradients.length > 0 && On.GetCurrentGradient(se, d._velocityGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentVelocityGradient && (R._currentVelocity1 = R._currentVelocity2, R._currentVelocity2 = Ee.getFactor(), R._currentVelocityGradient = Ae), ce *= $.a.Lerp(R._currentVelocity1, R._currentVelocity2, Se);\n                }), R.direction.scaleToRef(ce, d._scaledDirection), d._limitVelocityGradients && d._limitVelocityGradients.length > 0 && On.GetCurrentGradient(se, d._limitVelocityGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentLimitVelocityGradient && (R._currentLimitVelocity1 = R._currentLimitVelocity2, R._currentLimitVelocity2 = Ee.getFactor(), R._currentLimitVelocityGradient = Ae);\n                  var De = $.a.Lerp(R._currentLimitVelocity1, R._currentLimitVelocity2, Se);\n                  R.direction.length() > De && R.direction.scaleInPlace(d.limitVelocityDamping);\n                }), d._dragGradients && d._dragGradients.length > 0 && On.GetCurrentGradient(se, d._dragGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentDragGradient && (R._currentDrag1 = R._currentDrag2, R._currentDrag2 = Ee.getFactor(), R._currentDragGradient = Ae);\n                  var De = $.a.Lerp(R._currentDrag1, R._currentDrag2, Se);\n                  d._scaledDirection.scaleInPlace(1 - De);\n                }), d.isLocal && R._localPosition ? (R._localPosition.addInPlace(d._scaledDirection), u.e.TransformCoordinatesToRef(R._localPosition, d._emitterWorldMatrix, R.position)) : R.position.addInPlace(d._scaledDirection), P && y && R._randomNoiseCoordinates1) {\n                  var ue = d._fetchR(R._randomNoiseCoordinates1.x, R._randomNoiseCoordinates1.y, y.width, y.height, P), fe = d._fetchR(R._randomNoiseCoordinates1.z, R._randomNoiseCoordinates2.x, y.width, y.height, P), ve = d._fetchR(R._randomNoiseCoordinates2.y, R._randomNoiseCoordinates2.z, y.width, y.height, P), Te = u.c.Vector3[0], Re = u.c.Vector3[1];\n                  Te.copyFromFloats((2 * ue - 1) * d.noiseStrength.x, (2 * fe - 1) * d.noiseStrength.y, (2 * ve - 1) * d.noiseStrength.z), Te.scaleToRef(z, Re), R.direction.addInPlace(Re);\n                }\n                if (d.gravity.scaleToRef(z, d._scaledGravity), R.direction.addInPlace(d._scaledGravity), d._sizeGradients && d._sizeGradients.length > 0 && On.GetCurrentGradient(se, d._sizeGradients, function(Ae, Ee, Se) {\n                  Ae !== R._currentSizeGradient && (R._currentSize1 = R._currentSize2, R._currentSize2 = Ee.getFactor(), R._currentSizeGradient = Ae), R.size = $.a.Lerp(R._currentSize1, R._currentSize2, Se);\n                }), d._useRampGradients && (d._colorRemapGradients && d._colorRemapGradients.length > 0 && On.GetCurrentGradient(se, d._colorRemapGradients, function(Ae, Ee, Se) {\n                  var De = $.a.Lerp(Ae.factor1, Ee.factor1, Se), xe = $.a.Lerp(Ae.factor2, Ee.factor2, Se);\n                  R.remapData.x = De, R.remapData.y = xe - De;\n                }), d._alphaRemapGradients && d._alphaRemapGradients.length > 0 && On.GetCurrentGradient(se, d._alphaRemapGradients, function(Ae, Ee, Se) {\n                  var De = $.a.Lerp(Ae.factor1, Ee.factor1, Se), xe = $.a.Lerp(Ae.factor2, Ee.factor2, Se);\n                  R.remapData.z = De, R.remapData.w = xe - De;\n                })), d._isAnimationSheetEnabled && R.updateCellIndex(), R._inheritParticleInfoToSubEmitters(), R.age >= R.lifeTime)\n                  return d._emitFromParticle(R), R._attachedSubEmitters && (R._attachedSubEmitters.forEach(function(Ae) {\n                    Ae.particleSystem.disposeOnStop = !0, Ae.particleSystem.stop();\n                  }), R._attachedSubEmitters = null), d.recycleParticle(R), F--, \"continue\";\n              }, F = 0; F < p.length; F++)\n                B();\n            }, d;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"onDispose\", { set: function(e) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"useRampGradients\", { get: function() {\n            return this._useRampGradients;\n          }, set: function(e) {\n            this._useRampGradients !== e && (this._useRampGradients = e, this._resetEffect());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"particles\", { get: function() {\n            return this._particles;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getActiveCount = function() {\n            return this._particles.length;\n          }, t.prototype.getClassName = function() {\n            return \"ParticleSystem\";\n          }, t.prototype.isStopping = function() {\n            return this._stopped && this.isAlive();\n          }, t.prototype.getCustomEffect = function(e) {\n            var n;\n            return e === void 0 && (e = 0), (n = this._customEffect[e]) !== null && n !== void 0 ? n : this._customEffect[0];\n          }, t.prototype.setCustomEffect = function(e, n) {\n            n === void 0 && (n = 0), this._customEffect[n] = e;\n          }, Object.defineProperty(t.prototype, \"onBeforeDrawParticlesObservable\", { get: function() {\n            return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new C.c()), this._onBeforeDrawParticlesObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vertexShaderName\", { get: function() {\n            return \"particles\";\n          }, enumerable: !1, configurable: !0 }), t.prototype._addFactorGradient = function(e, n, i, o) {\n            var a = new vc(n, i, o);\n            e.push(a), e.sort(function(s, d) {\n              return s.gradient < d.gradient ? -1 : s.gradient > d.gradient ? 1 : 0;\n            });\n          }, t.prototype._removeFactorGradient = function(e, n) {\n            if (e)\n              for (var i = 0, o = 0, a = e; o < a.length; o++) {\n                if (a[o].gradient === n) {\n                  e.splice(i, 1);\n                  break;\n                }\n                i++;\n              }\n          }, t.prototype.addLifeTimeGradient = function(e, n, i) {\n            return this._lifeTimeGradients || (this._lifeTimeGradients = []), this._addFactorGradient(this._lifeTimeGradients, e, n, i), this;\n          }, t.prototype.removeLifeTimeGradient = function(e) {\n            return this._removeFactorGradient(this._lifeTimeGradients, e), this;\n          }, t.prototype.addSizeGradient = function(e, n, i) {\n            return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, n, i), this;\n          }, t.prototype.removeSizeGradient = function(e) {\n            return this._removeFactorGradient(this._sizeGradients, e), this;\n          }, t.prototype.addColorRemapGradient = function(e, n, i) {\n            return this._colorRemapGradients || (this._colorRemapGradients = []), this._addFactorGradient(this._colorRemapGradients, e, n, i), this;\n          }, t.prototype.removeColorRemapGradient = function(e) {\n            return this._removeFactorGradient(this._colorRemapGradients, e), this;\n          }, t.prototype.addAlphaRemapGradient = function(e, n, i) {\n            return this._alphaRemapGradients || (this._alphaRemapGradients = []), this._addFactorGradient(this._alphaRemapGradients, e, n, i), this;\n          }, t.prototype.removeAlphaRemapGradient = function(e) {\n            return this._removeFactorGradient(this._alphaRemapGradients, e), this;\n          }, t.prototype.addAngularSpeedGradient = function(e, n, i) {\n            return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, n, i), this;\n          }, t.prototype.removeAngularSpeedGradient = function(e) {\n            return this._removeFactorGradient(this._angularSpeedGradients, e), this;\n          }, t.prototype.addVelocityGradient = function(e, n, i) {\n            return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, n, i), this;\n          }, t.prototype.removeVelocityGradient = function(e) {\n            return this._removeFactorGradient(this._velocityGradients, e), this;\n          }, t.prototype.addLimitVelocityGradient = function(e, n, i) {\n            return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, n, i), this;\n          }, t.prototype.removeLimitVelocityGradient = function(e) {\n            return this._removeFactorGradient(this._limitVelocityGradients, e), this;\n          }, t.prototype.addDragGradient = function(e, n, i) {\n            return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, n, i), this;\n          }, t.prototype.removeDragGradient = function(e) {\n            return this._removeFactorGradient(this._dragGradients, e), this;\n          }, t.prototype.addEmitRateGradient = function(e, n, i) {\n            return this._emitRateGradients || (this._emitRateGradients = []), this._addFactorGradient(this._emitRateGradients, e, n, i), this;\n          }, t.prototype.removeEmitRateGradient = function(e) {\n            return this._removeFactorGradient(this._emitRateGradients, e), this;\n          }, t.prototype.addStartSizeGradient = function(e, n, i) {\n            return this._startSizeGradients || (this._startSizeGradients = []), this._addFactorGradient(this._startSizeGradients, e, n, i), this;\n          }, t.prototype.removeStartSizeGradient = function(e) {\n            return this._removeFactorGradient(this._startSizeGradients, e), this;\n          }, t.prototype._createRampGradientTexture = function() {\n            if (this._rampGradients && this._rampGradients.length && !this._rampGradientsTexture && this._scene) {\n              for (var e = new Uint8Array(4 * this._rawTextureWidth), n = I.c.Color3[0], i = 0; i < this._rawTextureWidth; i++) {\n                var o = i / this._rawTextureWidth;\n                On.GetCurrentGradient(o, this._rampGradients, function(a, s, d) {\n                  I.a.LerpToRef(a.color, s.color, d, n), e[4 * i] = 255 * n.r, e[4 * i + 1] = 255 * n.g, e[4 * i + 2] = 255 * n.b, e[4 * i + 3] = 255;\n                });\n              }\n              this._rampGradientsTexture = Zn.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n          }, t.prototype.getRampGradients = function() {\n            return this._rampGradients;\n          }, t.prototype.forceRefreshGradients = function() {\n            this._syncRampGradientTexture();\n          }, t.prototype._syncRampGradientTexture = function() {\n            this._rampGradients && (this._rampGradients.sort(function(e, n) {\n              return e.gradient < n.gradient ? -1 : e.gradient > n.gradient ? 1 : 0;\n            }), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._createRampGradientTexture());\n          }, t.prototype.addRampGradient = function(e, n) {\n            this._rampGradients || (this._rampGradients = []);\n            var i = new ad(e, n);\n            return this._rampGradients.push(i), this._syncRampGradientTexture(), this;\n          }, t.prototype.removeRampGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._rampGradients, this._rampGradientsTexture), this._rampGradientsTexture = null, this._rampGradients && this._rampGradients.length > 0 && this._createRampGradientTexture(), this;\n          }, t.prototype.addColorGradient = function(e, n, i) {\n            this._colorGradients || (this._colorGradients = []);\n            var o = new gc(e, n, i);\n            return this._colorGradients.push(o), this._colorGradients.sort(function(a, s) {\n              return a.gradient < s.gradient ? -1 : a.gradient > s.gradient ? 1 : 0;\n            }), this;\n          }, t.prototype.removeColorGradient = function(e) {\n            if (!this._colorGradients)\n              return this;\n            for (var n = 0, i = 0, o = this._colorGradients; i < o.length; i++) {\n              if (o[i].gradient === e) {\n                this._colorGradients.splice(n, 1);\n                break;\n              }\n              n++;\n            }\n            return this;\n          }, t.prototype._fetchR = function(e, n, i, o, a) {\n            return a[4 * (((e = 0.5 * Math.abs(e) + 0.5) * i % i | 0) + ((n = 0.5 * Math.abs(n) + 0.5) * o % o | 0) * i)] / 255;\n          }, t.prototype._reset = function() {\n            this._resetEffect();\n          }, t.prototype._resetEffect = function() {\n            this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this._createVertexBuffers();\n          }, t.prototype._createVertexBuffers = function() {\n            this._vertexBufferSize = this._useInstancing ? 10 : 12, this._isAnimationSheetEnabled && (this._vertexBufferSize += 1), this._isBillboardBased && this.billboardMode !== t.BILLBOARDMODE_STRETCHED || (this._vertexBufferSize += 3), this._useRampGradients && (this._vertexBufferSize += 4);\n            var e = this._engine;\n            this._vertexData = new Float32Array(this._capacity * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._vertexBuffer = new Oe.a(e, this._vertexData, !0, this._vertexBufferSize);\n            var n = 0, i = this._vertexBuffer.createVertexBuffer(Oe.b.PositionKind, n, 3, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers[Oe.b.PositionKind] = i, n += 3;\n            var o = this._vertexBuffer.createVertexBuffer(Oe.b.ColorKind, n, 4, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers[Oe.b.ColorKind] = o, n += 4;\n            var a = this._vertexBuffer.createVertexBuffer(\"angle\", n, 1, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers.angle = a, n += 1;\n            var s, d = this._vertexBuffer.createVertexBuffer(\"size\", n, 2, this._vertexBufferSize, this._useInstancing);\n            if (this._vertexBuffers.size = d, n += 2, this._isAnimationSheetEnabled) {\n              var p = this._vertexBuffer.createVertexBuffer(\"cellIndex\", n, 1, this._vertexBufferSize, this._useInstancing);\n              this._vertexBuffers.cellIndex = p, n += 1;\n            }\n            if (!this._isBillboardBased || this.billboardMode === t.BILLBOARDMODE_STRETCHED) {\n              var y = this._vertexBuffer.createVertexBuffer(\"direction\", n, 3, this._vertexBufferSize, this._useInstancing);\n              this._vertexBuffers.direction = y, n += 3;\n            }\n            if (this._useRampGradients) {\n              var P = this._vertexBuffer.createVertexBuffer(\"remapData\", n, 4, this._vertexBufferSize, this._useInstancing);\n              this._vertexBuffers.remapData = P, n += 4;\n            }\n            if (this._useInstancing) {\n              var R = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n              this._spriteBuffer = new Oe.a(e, R, !1, 2), s = this._spriteBuffer.createVertexBuffer(\"offset\", 0, 2);\n            } else\n              s = this._vertexBuffer.createVertexBuffer(\"offset\", n, 2, this._vertexBufferSize, this._useInstancing), n += 2;\n            this._vertexBuffers.offset = s;\n          }, t.prototype._createIndexBuffer = function() {\n            if (!this._useInstancing) {\n              for (var e = [], n = 0, i = 0; i < this._capacity; i++)\n                e.push(n), e.push(n + 1), e.push(n + 2), e.push(n), e.push(n + 2), e.push(n + 3), n += 4;\n              this._indexBuffer = this._engine.createIndexBuffer(e);\n            }\n          }, t.prototype.getCapacity = function() {\n            return this._capacity;\n          }, t.prototype.isAlive = function() {\n            return this._alive;\n          }, t.prototype.isStarted = function() {\n            return this._started;\n          }, t.prototype._prepareSubEmitterInternalArray = function() {\n            var e = this;\n            this._subEmitters = new Array(), this.subEmitters && this.subEmitters.forEach(function(n) {\n              n instanceof t ? e._subEmitters.push([new mo(n)]) : n instanceof mo ? e._subEmitters.push([n]) : n instanceof Array && e._subEmitters.push(n);\n            });\n          }, t.prototype.start = function(e) {\n            var n, i = this;\n            if (e === void 0 && (e = this.startDelay), !this.targetStopDuration && this._hasTargetStopDurationDependantGradient())\n              throw \"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set\";\n            if (e)\n              setTimeout(function() {\n                i.start(0);\n              }, e);\n            else {\n              if (this._prepareSubEmitterInternalArray(), this._started = !0, this._stopped = !1, this._actualFrame = 0, this._subEmitters && this._subEmitters.length != 0 && (this.activeSubSystems = new Array()), this._emitRateGradients && (this._emitRateGradients.length > 0 && (this._currentEmitRateGradient = this._emitRateGradients[0], this._currentEmitRate1 = this._currentEmitRateGradient.getFactor(), this._currentEmitRate2 = this._currentEmitRate1), this._emitRateGradients.length > 1 && (this._currentEmitRate2 = this._emitRateGradients[1].getFactor())), this._startSizeGradients && (this._startSizeGradients.length > 0 && (this._currentStartSizeGradient = this._startSizeGradients[0], this._currentStartSize1 = this._currentStartSizeGradient.getFactor(), this._currentStartSize2 = this._currentStartSize1), this._startSizeGradients.length > 1 && (this._currentStartSize2 = this._startSizeGradients[1].getFactor())), this.preWarmCycles) {\n                ((n = this.emitter) === null || n === void 0 ? void 0 : n.getClassName().indexOf(\"Mesh\")) !== -1 && this.emitter.computeWorldMatrix(!0);\n                var o = this.noiseTexture;\n                if (o && o.onGeneratedObservable)\n                  o.onGeneratedObservable.addOnce(function() {\n                    setTimeout(function() {\n                      for (var s = 0; s < i.preWarmCycles; s++)\n                        i.animate(!0), o.render();\n                    });\n                  });\n                else\n                  for (var a = 0; a < this.preWarmCycles; a++)\n                    this.animate(!0);\n              }\n              this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop);\n            }\n          }, t.prototype.stop = function(e) {\n            e === void 0 && (e = !0), this._stopped || (this.onStoppedObservable.notifyObservers(this), this._stopped = !0, e && this._stopSubEmitters());\n          }, t.prototype.reset = function() {\n            this._stockParticles = [], this._particles = [];\n          }, t.prototype._appendParticleVertex = function(e, n, i, o) {\n            var a = e * this._vertexBufferSize;\n            if (this._vertexData[a++] = n.position.x + this.worldOffset.x, this._vertexData[a++] = n.position.y + this.worldOffset.y, this._vertexData[a++] = n.position.z + this.worldOffset.z, this._vertexData[a++] = n.color.r, this._vertexData[a++] = n.color.g, this._vertexData[a++] = n.color.b, this._vertexData[a++] = n.color.a, this._vertexData[a++] = n.angle, this._vertexData[a++] = n.scale.x * n.size, this._vertexData[a++] = n.scale.y * n.size, this._isAnimationSheetEnabled && (this._vertexData[a++] = n.cellIndex), this._isBillboardBased)\n              this.billboardMode === t.BILLBOARDMODE_STRETCHED && (this._vertexData[a++] = n.direction.x, this._vertexData[a++] = n.direction.y, this._vertexData[a++] = n.direction.z);\n            else if (n._initialDirection) {\n              var s = n._initialDirection;\n              this.isLocal && (u.e.TransformNormalToRef(s, this._emitterWorldMatrix, u.c.Vector3[0]), s = u.c.Vector3[0]), s.x === 0 && s.z === 0 && (s.x = 1e-3), this._vertexData[a++] = s.x, this._vertexData[a++] = s.y, this._vertexData[a++] = s.z;\n            } else {\n              var d = n.direction;\n              this.isLocal && (u.e.TransformNormalToRef(d, this._emitterWorldMatrix, u.c.Vector3[0]), d = u.c.Vector3[0]), d.x === 0 && d.z === 0 && (d.x = 1e-3), this._vertexData[a++] = d.x, this._vertexData[a++] = d.y, this._vertexData[a++] = d.z;\n            }\n            this._useRampGradients && n.remapData && (this._vertexData[a++] = n.remapData.x, this._vertexData[a++] = n.remapData.y, this._vertexData[a++] = n.remapData.z, this._vertexData[a++] = n.remapData.w), this._useInstancing || (this._isAnimationSheetEnabled && (i === 0 ? i = this._epsilon : i === 1 && (i = 1 - this._epsilon), o === 0 ? o = this._epsilon : o === 1 && (o = 1 - this._epsilon)), this._vertexData[a++] = i, this._vertexData[a++] = o);\n          }, t.prototype._stopSubEmitters = function() {\n            this.activeSubSystems && (this.activeSubSystems.forEach(function(e) {\n              e.stop(!0);\n            }), this.activeSubSystems = new Array());\n          }, t.prototype._removeFromRoot = function() {\n            if (this._rootParticleSystem) {\n              var e = this._rootParticleSystem.activeSubSystems.indexOf(this);\n              e !== -1 && this._rootParticleSystem.activeSubSystems.splice(e, 1), this._rootParticleSystem = null;\n            }\n          }, t.prototype._update = function(e) {\n            var n, i = this;\n            if (this._alive = this._particles.length > 0, this.emitter.position) {\n              var o = this.emitter;\n              this._emitterWorldMatrix = o.getWorldMatrix();\n            } else {\n              var a = this.emitter;\n              this._emitterWorldMatrix = u.a.Translation(a.x, a.y, a.z);\n            }\n            this.updateFunction(this._particles);\n            for (var s, d = function() {\n              if (p._particles.length === p._capacity)\n                return \"break\";\n              if (n = p._createParticle(), p._particles.push(n), p.targetStopDuration && p._lifeTimeGradients && p._lifeTimeGradients.length > 0) {\n                var P = $.a.Clamp(p._actualFrame / p.targetStopDuration);\n                On.GetCurrentGradient(P, p._lifeTimeGradients, function(F, z) {\n                  var J = F, ie = z, se = J.getFactor(), ce = ie.getFactor(), ue = (P - J.gradient) / (ie.gradient - J.gradient);\n                  n.lifeTime = $.a.Lerp(se, ce, ue);\n                });\n              } else\n                n.lifeTime = $.a.RandomRange(p.minLifeTime, p.maxLifeTime);\n              var R = $.a.RandomRange(p.minEmitPower, p.maxEmitPower);\n              if (p.startPositionFunction ? p.startPositionFunction(p._emitterWorldMatrix, n.position, n, p.isLocal) : p.particleEmitterType.startPositionFunction(p._emitterWorldMatrix, n.position, n, p.isLocal), p.isLocal && (n._localPosition ? n._localPosition.copyFrom(n.position) : n._localPosition = n.position.clone(), u.e.TransformCoordinatesToRef(n._localPosition, p._emitterWorldMatrix, n.position)), p.startDirectionFunction ? p.startDirectionFunction(p._emitterWorldMatrix, n.direction, n, p.isLocal) : p.particleEmitterType.startDirectionFunction(p._emitterWorldMatrix, n.direction, n, p.isLocal), R === 0 ? n._initialDirection ? n._initialDirection.copyFrom(n.direction) : n._initialDirection = n.direction.clone() : n._initialDirection = null, n.direction.scaleInPlace(R), p._sizeGradients && p._sizeGradients.length !== 0 ? (n._currentSizeGradient = p._sizeGradients[0], n._currentSize1 = n._currentSizeGradient.getFactor(), n.size = n._currentSize1, p._sizeGradients.length > 1 ? n._currentSize2 = p._sizeGradients[1].getFactor() : n._currentSize2 = n._currentSize1) : n.size = $.a.RandomRange(p.minSize, p.maxSize), n.scale.copyFromFloats($.a.RandomRange(p.minScaleX, p.maxScaleX), $.a.RandomRange(p.minScaleY, p.maxScaleY)), p._startSizeGradients && p._startSizeGradients[0] && p.targetStopDuration) {\n                var B = p._actualFrame / p.targetStopDuration;\n                On.GetCurrentGradient(B, p._startSizeGradients, function(F, z, J) {\n                  F !== i._currentStartSizeGradient && (i._currentStartSize1 = i._currentStartSize2, i._currentStartSize2 = z.getFactor(), i._currentStartSizeGradient = F);\n                  var ie = $.a.Lerp(i._currentStartSize1, i._currentStartSize2, J);\n                  n.scale.scaleInPlace(ie);\n                });\n              }\n              p._angularSpeedGradients && p._angularSpeedGradients.length !== 0 ? (n._currentAngularSpeedGradient = p._angularSpeedGradients[0], n.angularSpeed = n._currentAngularSpeedGradient.getFactor(), n._currentAngularSpeed1 = n.angularSpeed, p._angularSpeedGradients.length > 1 ? n._currentAngularSpeed2 = p._angularSpeedGradients[1].getFactor() : n._currentAngularSpeed2 = n._currentAngularSpeed1) : n.angularSpeed = $.a.RandomRange(p.minAngularSpeed, p.maxAngularSpeed), n.angle = $.a.RandomRange(p.minInitialRotation, p.maxInitialRotation), p._velocityGradients && p._velocityGradients.length > 0 && (n._currentVelocityGradient = p._velocityGradients[0], n._currentVelocity1 = n._currentVelocityGradient.getFactor(), p._velocityGradients.length > 1 ? n._currentVelocity2 = p._velocityGradients[1].getFactor() : n._currentVelocity2 = n._currentVelocity1), p._limitVelocityGradients && p._limitVelocityGradients.length > 0 && (n._currentLimitVelocityGradient = p._limitVelocityGradients[0], n._currentLimitVelocity1 = n._currentLimitVelocityGradient.getFactor(), p._limitVelocityGradients.length > 1 ? n._currentLimitVelocity2 = p._limitVelocityGradients[1].getFactor() : n._currentLimitVelocity2 = n._currentLimitVelocity1), p._dragGradients && p._dragGradients.length > 0 && (n._currentDragGradient = p._dragGradients[0], n._currentDrag1 = n._currentDragGradient.getFactor(), p._dragGradients.length > 1 ? n._currentDrag2 = p._dragGradients[1].getFactor() : n._currentDrag2 = n._currentDrag1), p._colorGradients && p._colorGradients.length !== 0 ? (n._currentColorGradient = p._colorGradients[0], n._currentColorGradient.getColorToRef(n.color), n._currentColor1.copyFrom(n.color), p._colorGradients.length > 1 ? p._colorGradients[1].getColorToRef(n._currentColor2) : n._currentColor2.copyFrom(n.color)) : (s = $.a.RandomRange(0, 1), I.b.LerpToRef(p.color1, p.color2, s, n.color), p.colorDead.subtractToRef(n.color, p._colorDiff), p._colorDiff.scaleToRef(1 / n.lifeTime, n.colorStep)), p._isAnimationSheetEnabled && (n._initialStartSpriteCellID = p.startSpriteCellID, n._initialEndSpriteCellID = p.endSpriteCellID), n.direction.addInPlace(p._inheritedVelocityOffset), p._useRampGradients && (n.remapData = new u.f(0, 1, 0, 1)), p.noiseTexture && (n._randomNoiseCoordinates1 ? (n._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random()), n._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random())) : (n._randomNoiseCoordinates1 = new u.e(Math.random(), Math.random(), Math.random()), n._randomNoiseCoordinates2 = new u.e(Math.random(), Math.random(), Math.random()))), n._inheritParticleInfoToSubEmitters();\n            }, p = this, y = 0; y < e && d() !== \"break\"; y++)\n              ;\n          }, t._GetAttributeNamesOrOptions = function(e, n, i) {\n            e === void 0 && (e = !1), n === void 0 && (n = !1), i === void 0 && (i = !1);\n            var o = [Oe.b.PositionKind, Oe.b.ColorKind, \"angle\", \"offset\", \"size\"];\n            return e && o.push(\"cellIndex\"), n || o.push(\"direction\"), i && o.push(\"remapData\"), o;\n          }, t._GetEffectCreationOptions = function(e) {\n            e === void 0 && (e = !1);\n            var n = [\"invView\", \"view\", \"projection\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"textureMask\", \"translationPivot\", \"eyePosition\"];\n            return e && n.push(\"particlesInfos\"), n;\n          }, t.prototype.fillDefines = function(e, n) {\n            if (this._scene && (this._scene.clipPlane && e.push(\"#define CLIPPLANE\"), this._scene.clipPlane2 && e.push(\"#define CLIPPLANE2\"), this._scene.clipPlane3 && e.push(\"#define CLIPPLANE3\"), this._scene.clipPlane4 && e.push(\"#define CLIPPLANE4\"), this._scene.clipPlane5 && e.push(\"#define CLIPPLANE5\"), this._scene.clipPlane6 && e.push(\"#define CLIPPLANE6\")), this._isAnimationSheetEnabled && e.push(\"#define ANIMATESHEET\"), n === t.BLENDMODE_MULTIPLY && e.push(\"#define BLENDMULTIPLYMODE\"), this._useRampGradients && e.push(\"#define RAMPGRADIENT\"), this._isBillboardBased)\n              switch (e.push(\"#define BILLBOARD\"), this.billboardMode) {\n                case t.BILLBOARDMODE_Y:\n                  e.push(\"#define BILLBOARDY\");\n                  break;\n                case t.BILLBOARDMODE_STRETCHED:\n                  e.push(\"#define BILLBOARDSTRETCHED\");\n                  break;\n                case t.BILLBOARDMODE_ALL:\n                  e.push(\"#define BILLBOARDMODE_ALL\");\n              }\n            this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e.push(this._imageProcessingConfigurationDefines.toString()));\n          }, t.prototype.fillUniformsAttributesAndSamplerNames = function(e, n, i) {\n            n.push.apply(n, t._GetAttributeNamesOrOptions(this._isAnimationSheetEnabled, this._isBillboardBased && this.billboardMode !== t.BILLBOARDMODE_STRETCHED, this._useRampGradients)), e.push.apply(e, t._GetEffectCreationOptions(this._isAnimationSheetEnabled)), i.push(\"diffuseSampler\", \"rampSampler\"), this._imageProcessingConfiguration && (vn.a.PrepareUniforms(e, this._imageProcessingConfigurationDefines), vn.a.PrepareSamplers(i, this._imageProcessingConfigurationDefines));\n          }, t.prototype._getEffect = function(e) {\n            var n = this.getCustomEffect(e);\n            if (n)\n              return n;\n            var i = [];\n            this.fillDefines(i, e);\n            var o = i.join(`\n`);\n            if (this._cachedDefines !== o) {\n              this._cachedDefines = o;\n              var a = [], s = [], d = [];\n              this.fillUniformsAttributesAndSamplerNames(s, a, d), this._effect = this._engine.createEffect(\"particles\", a, s, d, o);\n            }\n            return this._effect;\n          }, t.prototype.animate = function(e) {\n            var n, i = this;\n            if (e === void 0 && (e = !1), this._started) {\n              if (!e && this._scene) {\n                if (!this.isReady() || this._currentRenderId === this._scene.getFrameId())\n                  return;\n                this._currentRenderId = this._scene.getFrameId();\n              }\n              var o;\n              if (this._scaledUpdateSpeed = this.updateSpeed * (e ? this.preWarmStepOffset : ((n = this._scene) === null || n === void 0 ? void 0 : n.getAnimationRatio()) || 1), this.manualEmitCount > -1)\n                o = this.manualEmitCount, this._newPartsExcess = 0, this.manualEmitCount = 0;\n              else {\n                var a = this.emitRate;\n                if (this._emitRateGradients && this._emitRateGradients.length > 0 && this.targetStopDuration) {\n                  var s = this._actualFrame / this.targetStopDuration;\n                  On.GetCurrentGradient(s, this._emitRateGradients, function(P, R, B) {\n                    P !== i._currentEmitRateGradient && (i._currentEmitRate1 = i._currentEmitRate2, i._currentEmitRate2 = R.getFactor(), i._currentEmitRateGradient = P), a = $.a.Lerp(i._currentEmitRate1, i._currentEmitRate2, B);\n                  });\n                }\n                o = a * this._scaledUpdateSpeed >> 0, this._newPartsExcess += a * this._scaledUpdateSpeed - o;\n              }\n              if (this._newPartsExcess > 1 && (o += this._newPartsExcess >> 0, this._newPartsExcess -= this._newPartsExcess >> 0), this._alive = !1, this._stopped ? o = 0 : (this._actualFrame += this._scaledUpdateSpeed, this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop()), this._update(o), this._stopped && (this._alive || (this._started = !1, this.onAnimationEnd && this.onAnimationEnd(), this.disposeOnStop && this._scene && this._scene._toBeDisposed.push(this))), !e) {\n                for (var d = 0, p = 0; p < this._particles.length; p++) {\n                  var y = this._particles[p];\n                  this._appendParticleVertices(d, y), d += this._useInstancing ? 1 : 4;\n                }\n                this._vertexBuffer && this._vertexBuffer.update(this._vertexData);\n              }\n              this.manualEmitCount === 0 && this.disposeOnStop && this.stop();\n            }\n          }, t.prototype._appendParticleVertices = function(e, n) {\n            this._appendParticleVertex(e++, n, 0, 0), this._useInstancing || (this._appendParticleVertex(e++, n, 1, 0), this._appendParticleVertex(e++, n, 1, 1), this._appendParticleVertex(e++, n, 0, 1));\n          }, t.prototype.rebuild = function() {\n            for (var e in this._createIndexBuffer(), this._vertexBuffer && this._vertexBuffer._rebuild(), this._vertexBuffers)\n              this._vertexBuffers[e]._rebuild();\n          }, t.prototype.isReady = function() {\n            if (!this.emitter || this._imageProcessingConfiguration && !this._imageProcessingConfiguration.isReady() || !this.particleTexture || !this.particleTexture.isReady())\n              return !1;\n            if (this.blendMode !== t.BLENDMODE_MULTIPLYADD) {\n              if (!this._getEffect(this.blendMode).isReady())\n                return !1;\n            } else if (!this._getEffect(t.BLENDMODE_MULTIPLY).isReady() || !this._getEffect(t.BLENDMODE_ADD).isReady())\n              return !1;\n            return !0;\n          }, t.prototype._render = function(e) {\n            var n, i, o = this._getEffect(e), a = this._engine;\n            a.enableEffect(o);\n            var s = (n = this.defaultViewMatrix) !== null && n !== void 0 ? n : this._scene.getViewMatrix();\n            if (o.setTexture(\"diffuseSampler\", this.particleTexture), o.setMatrix(\"view\", s), o.setMatrix(\"projection\", (i = this.defaultProjectionMatrix) !== null && i !== void 0 ? i : this._scene.getProjectionMatrix()), this._isAnimationSheetEnabled && this.particleTexture) {\n              var d = this.particleTexture.getBaseSize();\n              o.setFloat3(\"particlesInfos\", this.spriteCellWidth / d.width, this.spriteCellHeight / d.height, this.spriteCellWidth / d.width);\n            }\n            if (o.setVector2(\"translationPivot\", this.translationPivot), o.setFloat4(\"textureMask\", this.textureMask.r, this.textureMask.g, this.textureMask.b, this.textureMask.a), this._isBillboardBased && this._scene) {\n              var p = this._scene.activeCamera;\n              o.setVector3(\"eyePosition\", p.globalPosition);\n            }\n            this._rampGradientsTexture && (this._rampGradients && this._rampGradients.length || (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), o.setTexture(\"rampSampler\", this._rampGradientsTexture));\n            var y = o.defines;\n            switch (this._scene && (this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4 || this._scene.clipPlane5 || this._scene.clipPlane6) && Bu.a.BindClipPlane(o, this._scene), y.indexOf(\"#define BILLBOARDMODE_ALL\") >= 0 && (s.invertToRef(u.c.Matrix[0]), o.setMatrix(\"invView\", u.c.Matrix[0])), this._vertexArrayObject !== void 0 ? (this._vertexArrayObject || (this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, o)), this._engine.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)) : a.bindBuffers(this._vertexBuffers, this._indexBuffer, o), this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(o), e) {\n              case t.BLENDMODE_ADD:\n                a.setAlphaMode(h.a.ALPHA_ADD);\n                break;\n              case t.BLENDMODE_ONEONE:\n                a.setAlphaMode(h.a.ALPHA_ONEONE);\n                break;\n              case t.BLENDMODE_STANDARD:\n                a.setAlphaMode(h.a.ALPHA_COMBINE);\n                break;\n              case t.BLENDMODE_MULTIPLY:\n                a.setAlphaMode(h.a.ALPHA_MULTIPLY);\n            }\n            return this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(o), this._useInstancing ? a.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, this._particles.length) : a.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, 6 * this._particles.length), this._particles.length;\n          }, t.prototype.render = function() {\n            if (!this.isReady() || !this._particles.length)\n              return 0;\n            var e = this._engine;\n            e.setState && (e.setState(!1), this.forceDepthWrite && e.setDepthWrite(!0));\n            var n = 0;\n            return n = this.blendMode === t.BLENDMODE_MULTIPLYADD ? this._render(t.BLENDMODE_MULTIPLY) + this._render(t.BLENDMODE_ADD) : this._render(this.blendMode), this._engine.unbindInstanceAttributes(), this._engine.setAlphaMode(h.a.ALPHA_DISABLE), n;\n          }, t.prototype.dispose = function(e) {\n            if (e === void 0 && (e = !0), this._vertexBuffer && (this._vertexBuffer.dispose(), this._vertexBuffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this._rampGradientsTexture && (this._rampGradientsTexture.dispose(), this._rampGradientsTexture = null), this._removeFromRoot(), this._subEmitters && this._subEmitters.length) {\n              for (var n = 0; n < this._subEmitters.length; n++)\n                for (var i = 0, o = this._subEmitters[n]; i < o.length; i++)\n                  o[i].dispose();\n              this._subEmitters = [], this.subEmitters = [];\n            }\n            this._disposeEmitterOnDispose && this.emitter && this.emitter.dispose && this.emitter.dispose(!0), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.clear(), this._scene && ((n = this._scene.particleSystems.indexOf(this)) > -1 && this._scene.particleSystems.splice(n, 1), this._scene._activeParticleSystems.dispose()), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear(), this.onStoppedObservable.clear(), this.reset();\n          }, t.prototype.clone = function(e, n) {\n            var i = Object(c.a)({}, this._customEffect), o = null, a = this._engine;\n            if (a.createEffectForParticles && this.customShader != null) {\n              var s = (o = this.customShader).shaderOptions.defines.length > 0 ? o.shaderOptions.defines.join(`\n`) : \"\";\n              i[0] = a.createEffectForParticles(o.shaderPath.fragmentElement, o.shaderOptions.uniforms, o.shaderOptions.samplers, s);\n            }\n            var d = this.serialize(), p = t.Parse(d, this._scene || this._engine, \"\");\n            return p.name = e, p.customShader = o, p._customEffect = i, n === void 0 && (n = this.emitter), this.noiseTexture && (p.noiseTexture = this.noiseTexture.clone()), p.emitter = n, this.preventAutoStart || p.start(), p;\n          }, t.prototype.serialize = function(e) {\n            e === void 0 && (e = !1);\n            var n = {};\n            if (t._Serialize(n, this, e), n.textureMask = this.textureMask.asArray(), n.customShader = this.customShader, n.preventAutoStart = this.preventAutoStart, this.subEmitters) {\n              n.subEmitters = [], this._subEmitters || this._prepareSubEmitterInternalArray();\n              for (var i = 0, o = this._subEmitters; i < o.length; i++) {\n                for (var a = [], s = 0, d = o[i]; s < d.length; s++) {\n                  var p = d[s];\n                  a.push(p.serialize());\n                }\n                n.subEmitters.push(a);\n              }\n            }\n            return n;\n          }, t._Serialize = function(e, n, i) {\n            if (e.name = n.name, e.id = n.id, e.capacity = n.getCapacity(), n.emitter.position) {\n              var o = n.emitter;\n              e.emitterId = o.id;\n            } else {\n              var a = n.emitter;\n              e.emitter = a.asArray();\n            }\n            n.particleEmitterType && (e.particleEmitterType = n.particleEmitterType.serialize()), n.particleTexture && (i ? e.texture = n.particleTexture.serialize() : (e.textureName = n.particleTexture.name, e.invertY = !!n.particleTexture._invertY)), e.isLocal = n.isLocal, L.a.AppendSerializedAnimations(n, e), e.beginAnimationOnStart = n.beginAnimationOnStart, e.beginAnimationFrom = n.beginAnimationFrom, e.beginAnimationTo = n.beginAnimationTo, e.beginAnimationLoop = n.beginAnimationLoop, e.startDelay = n.startDelay, e.renderingGroupId = n.renderingGroupId, e.isBillboardBased = n.isBillboardBased, e.billboardMode = n.billboardMode, e.minAngularSpeed = n.minAngularSpeed, e.maxAngularSpeed = n.maxAngularSpeed, e.minSize = n.minSize, e.maxSize = n.maxSize, e.minScaleX = n.minScaleX, e.maxScaleX = n.maxScaleX, e.minScaleY = n.minScaleY, e.maxScaleY = n.maxScaleY, e.minEmitPower = n.minEmitPower, e.maxEmitPower = n.maxEmitPower, e.minLifeTime = n.minLifeTime, e.maxLifeTime = n.maxLifeTime, e.emitRate = n.emitRate, e.gravity = n.gravity.asArray(), e.noiseStrength = n.noiseStrength.asArray(), e.color1 = n.color1.asArray(), e.color2 = n.color2.asArray(), e.colorDead = n.colorDead.asArray(), e.updateSpeed = n.updateSpeed, e.targetStopDuration = n.targetStopDuration, e.blendMode = n.blendMode, e.preWarmCycles = n.preWarmCycles, e.preWarmStepOffset = n.preWarmStepOffset, e.minInitialRotation = n.minInitialRotation, e.maxInitialRotation = n.maxInitialRotation, e.startSpriteCellID = n.startSpriteCellID, e.endSpriteCellID = n.endSpriteCellID, e.spriteCellChangeSpeed = n.spriteCellChangeSpeed, e.spriteCellWidth = n.spriteCellWidth, e.spriteCellHeight = n.spriteCellHeight, e.spriteRandomStartCell = n.spriteRandomStartCell, e.isAnimationSheetEnabled = n.isAnimationSheetEnabled;\n            var s = n.getColorGradients();\n            if (s) {\n              e.colorGradients = [];\n              for (var d = 0, p = s; d < p.length; d++) {\n                var y = p[d], P = { gradient: y.gradient, color1: y.color1.asArray() };\n                y.color2 ? P.color2 = y.color2.asArray() : P.color2 = y.color1.asArray(), e.colorGradients.push(P);\n              }\n            }\n            var R = n.getRampGradients();\n            if (R) {\n              e.rampGradients = [];\n              for (var B = 0, F = R; B < F.length; B++) {\n                var z = F[B];\n                P = { gradient: z.gradient, color: z.color.asArray() }, e.rampGradients.push(P);\n              }\n              e.useRampGradients = n.useRampGradients;\n            }\n            var J = n.getColorRemapGradients();\n            if (J) {\n              e.colorRemapGradients = [];\n              for (var ie = 0, se = J; ie < se.length; ie++) {\n                var ce = se[ie];\n                P = { gradient: ce.gradient, factor1: ce.factor1 }, ce.factor2 !== void 0 ? P.factor2 = ce.factor2 : P.factor2 = ce.factor1, e.colorRemapGradients.push(P);\n              }\n            }\n            var ue = n.getAlphaRemapGradients();\n            if (ue) {\n              e.alphaRemapGradients = [];\n              for (var fe = 0, ve = ue; fe < ve.length; fe++) {\n                var Te = ve[fe];\n                P = { gradient: Te.gradient, factor1: Te.factor1 }, Te.factor2 !== void 0 ? P.factor2 = Te.factor2 : P.factor2 = Te.factor1, e.alphaRemapGradients.push(P);\n              }\n            }\n            var Re = n.getSizeGradients();\n            if (Re) {\n              e.sizeGradients = [];\n              for (var Ae = 0, Ee = Re; Ae < Ee.length; Ae++) {\n                var Se = Ee[Ae];\n                P = { gradient: Se.gradient, factor1: Se.factor1 }, Se.factor2 !== void 0 ? P.factor2 = Se.factor2 : P.factor2 = Se.factor1, e.sizeGradients.push(P);\n              }\n            }\n            var De = n.getAngularSpeedGradients();\n            if (De) {\n              e.angularSpeedGradients = [];\n              for (var xe = 0, Le = De; xe < Le.length; xe++) {\n                var Me = Le[xe];\n                P = { gradient: Me.gradient, factor1: Me.factor1 }, Me.factor2 !== void 0 ? P.factor2 = Me.factor2 : P.factor2 = Me.factor1, e.angularSpeedGradients.push(P);\n              }\n            }\n            var we = n.getVelocityGradients();\n            if (we) {\n              e.velocityGradients = [];\n              for (var Ye = 0, et = we; Ye < et.length; Ye++) {\n                var nt = et[Ye];\n                P = { gradient: nt.gradient, factor1: nt.factor1 }, nt.factor2 !== void 0 ? P.factor2 = nt.factor2 : P.factor2 = nt.factor1, e.velocityGradients.push(P);\n              }\n            }\n            var ct = n.getDragGradients();\n            if (ct) {\n              e.dragGradients = [];\n              for (var Ke = 0, rt = ct; Ke < rt.length; Ke++) {\n                var it = rt[Ke];\n                P = { gradient: it.gradient, factor1: it.factor1 }, it.factor2 !== void 0 ? P.factor2 = it.factor2 : P.factor2 = it.factor1, e.dragGradients.push(P);\n              }\n            }\n            var qe = n.getEmitRateGradients();\n            if (qe) {\n              e.emitRateGradients = [];\n              for (var ut = 0, Ve = qe; ut < Ve.length; ut++) {\n                var Ze = Ve[ut];\n                P = { gradient: Ze.gradient, factor1: Ze.factor1 }, Ze.factor2 !== void 0 ? P.factor2 = Ze.factor2 : P.factor2 = Ze.factor1, e.emitRateGradients.push(P);\n              }\n            }\n            var vt = n.getStartSizeGradients();\n            if (vt) {\n              e.startSizeGradients = [];\n              for (var jt = 0, Dt = vt; jt < Dt.length; jt++) {\n                var Yt = Dt[jt];\n                P = { gradient: Yt.gradient, factor1: Yt.factor1 }, Yt.factor2 !== void 0 ? P.factor2 = Yt.factor2 : P.factor2 = Yt.factor1, e.startSizeGradients.push(P);\n              }\n            }\n            var mt = n.getLifeTimeGradients();\n            if (mt) {\n              e.lifeTimeGradients = [];\n              for (var qt = 0, Ht = mt; qt < Ht.length; qt++) {\n                var kt = Ht[qt];\n                P = { gradient: kt.gradient, factor1: kt.factor1 }, kt.factor2 !== void 0 ? P.factor2 = kt.factor2 : P.factor2 = kt.factor1, e.lifeTimeGradients.push(P);\n              }\n            }\n            var Wt = n.getLimitVelocityGradients();\n            if (Wt) {\n              e.limitVelocityGradients = [];\n              for (var bt = 0, Rt = Wt; bt < Rt.length; bt++) {\n                var Zt = Rt[bt];\n                P = { gradient: Zt.gradient, factor1: Zt.factor1 }, Zt.factor2 !== void 0 ? P.factor2 = Zt.factor2 : P.factor2 = Zt.factor1, e.limitVelocityGradients.push(P);\n              }\n              e.limitVelocityDamping = n.limitVelocityDamping;\n            }\n            n.noiseTexture && (e.noiseTexture = n.noiseTexture.serialize());\n          }, t._Parse = function(e, n, i, o) {\n            var a;\n            a = i instanceof wt.a ? null : i;\n            var s, d = O.a.GetClass(\"BABYLON.Texture\");\n            if (d && a && (e.texture ? n.particleTexture = d.Parse(e.texture, a, o) : e.textureName && (n.particleTexture = new d(o + e.textureName, a, !1, e.invertY === void 0 || e.invertY), n.particleTexture.name = e.textureName)), e.emitterId || e.emitterId === 0 || e.emitter !== void 0 ? e.emitterId && a ? n.emitter = a.getLastMeshByID(e.emitterId) : n.emitter = u.e.FromArray(e.emitter) : n.emitter = u.e.Zero(), n.isLocal = !!e.isLocal, e.renderingGroupId !== void 0 && (n.renderingGroupId = e.renderingGroupId), e.isBillboardBased !== void 0 && (n.isBillboardBased = e.isBillboardBased), e.billboardMode !== void 0 && (n.billboardMode = e.billboardMode), e.animations) {\n              for (var p = 0; p < e.animations.length; p++) {\n                var y = e.animations[p], P = O.a.GetClass(\"BABYLON.Animation\");\n                P && n.animations.push(P.Parse(y));\n              }\n              n.beginAnimationOnStart = e.beginAnimationOnStart, n.beginAnimationFrom = e.beginAnimationFrom, n.beginAnimationTo = e.beginAnimationTo, n.beginAnimationLoop = e.beginAnimationLoop;\n            }\n            if (e.autoAnimate && a && a.beginAnimation(n, e.autoAnimateFrom, e.autoAnimateTo, e.autoAnimateLoop, e.autoAnimateSpeed || 1), n.startDelay = 0 | e.startDelay, n.minAngularSpeed = e.minAngularSpeed, n.maxAngularSpeed = e.maxAngularSpeed, n.minSize = e.minSize, n.maxSize = e.maxSize, e.minScaleX && (n.minScaleX = e.minScaleX, n.maxScaleX = e.maxScaleX, n.minScaleY = e.minScaleY, n.maxScaleY = e.maxScaleY), e.preWarmCycles !== void 0 && (n.preWarmCycles = e.preWarmCycles, n.preWarmStepOffset = e.preWarmStepOffset), e.minInitialRotation !== void 0 && (n.minInitialRotation = e.minInitialRotation, n.maxInitialRotation = e.maxInitialRotation), n.minLifeTime = e.minLifeTime, n.maxLifeTime = e.maxLifeTime, n.minEmitPower = e.minEmitPower, n.maxEmitPower = e.maxEmitPower, n.emitRate = e.emitRate, n.gravity = u.e.FromArray(e.gravity), e.noiseStrength && (n.noiseStrength = u.e.FromArray(e.noiseStrength)), n.color1 = I.b.FromArray(e.color1), n.color2 = I.b.FromArray(e.color2), n.colorDead = I.b.FromArray(e.colorDead), n.updateSpeed = e.updateSpeed, n.targetStopDuration = e.targetStopDuration, n.blendMode = e.blendMode, e.colorGradients)\n              for (var R = 0, B = e.colorGradients; R < B.length; R++) {\n                var F = B[R];\n                n.addColorGradient(F.gradient, I.b.FromArray(F.color1), F.color2 ? I.b.FromArray(F.color2) : void 0);\n              }\n            if (e.rampGradients) {\n              for (var z = 0, J = e.rampGradients; z < J.length; z++) {\n                var ie = J[z];\n                n.addRampGradient(ie.gradient, I.a.FromArray(ie.color));\n              }\n              n.useRampGradients = e.useRampGradients;\n            }\n            if (e.colorRemapGradients)\n              for (var se = 0, ce = e.colorRemapGradients; se < ce.length; se++) {\n                var ue = ce[se];\n                n.addColorRemapGradient(ue.gradient, ue.factor1 !== void 0 ? ue.factor1 : ue.factor, ue.factor2);\n              }\n            if (e.alphaRemapGradients)\n              for (var fe = 0, ve = e.alphaRemapGradients; fe < ve.length; fe++) {\n                var Te = ve[fe];\n                n.addAlphaRemapGradient(Te.gradient, Te.factor1 !== void 0 ? Te.factor1 : Te.factor, Te.factor2);\n              }\n            if (e.sizeGradients)\n              for (var Re = 0, Ae = e.sizeGradients; Re < Ae.length; Re++) {\n                var Ee = Ae[Re];\n                n.addSizeGradient(Ee.gradient, Ee.factor1 !== void 0 ? Ee.factor1 : Ee.factor, Ee.factor2);\n              }\n            if (e.angularSpeedGradients)\n              for (var Se = 0, De = e.angularSpeedGradients; Se < De.length; Se++) {\n                var xe = De[Se];\n                n.addAngularSpeedGradient(xe.gradient, xe.factor1 !== void 0 ? xe.factor1 : xe.factor, xe.factor2);\n              }\n            if (e.velocityGradients)\n              for (var Le = 0, Me = e.velocityGradients; Le < Me.length; Le++) {\n                var we = Me[Le];\n                n.addVelocityGradient(we.gradient, we.factor1 !== void 0 ? we.factor1 : we.factor, we.factor2);\n              }\n            if (e.dragGradients)\n              for (var Ye = 0, et = e.dragGradients; Ye < et.length; Ye++) {\n                var nt = et[Ye];\n                n.addDragGradient(nt.gradient, nt.factor1 !== void 0 ? nt.factor1 : nt.factor, nt.factor2);\n              }\n            if (e.emitRateGradients)\n              for (var ct = 0, Ke = e.emitRateGradients; ct < Ke.length; ct++) {\n                var rt = Ke[ct];\n                n.addEmitRateGradient(rt.gradient, rt.factor1 !== void 0 ? rt.factor1 : rt.factor, rt.factor2);\n              }\n            if (e.startSizeGradients)\n              for (var it = 0, qe = e.startSizeGradients; it < qe.length; it++) {\n                var ut = qe[it];\n                n.addStartSizeGradient(ut.gradient, ut.factor1 !== void 0 ? ut.factor1 : ut.factor, ut.factor2);\n              }\n            if (e.lifeTimeGradients)\n              for (var Ve = 0, Ze = e.lifeTimeGradients; Ve < Ze.length; Ve++) {\n                var vt = Ze[Ve];\n                n.addLifeTimeGradient(vt.gradient, vt.factor1 !== void 0 ? vt.factor1 : vt.factor, vt.factor2);\n              }\n            if (e.limitVelocityGradients) {\n              for (var jt = 0, Dt = e.limitVelocityGradients; jt < Dt.length; jt++) {\n                var Yt = Dt[jt];\n                n.addLimitVelocityGradient(Yt.gradient, Yt.factor1 !== void 0 ? Yt.factor1 : Yt.factor, Yt.factor2);\n              }\n              n.limitVelocityDamping = e.limitVelocityDamping;\n            }\n            if (e.noiseTexture && a) {\n              var mt = O.a.GetClass(\"BABYLON.ProceduralTexture\");\n              n.noiseTexture = mt.Parse(e.noiseTexture, a, o);\n            }\n            if (e.particleEmitterType) {\n              switch (e.particleEmitterType.type) {\n                case \"SphereParticleEmitter\":\n                  s = new aa();\n                  break;\n                case \"SphereDirectedParticleEmitter\":\n                  s = new Zs();\n                  break;\n                case \"ConeEmitter\":\n                case \"ConeParticleEmitter\":\n                  s = new Ys();\n                  break;\n                case \"CylinderParticleEmitter\":\n                  s = new oa();\n                  break;\n                case \"CylinderDirectedParticleEmitter\":\n                  s = new Ks();\n                  break;\n                case \"HemisphericParticleEmitter\":\n                  s = new Qs();\n                  break;\n                case \"PointParticleEmitter\":\n                  s = new qs();\n                  break;\n                case \"MeshParticleEmitter\":\n                  s = new Ku();\n                  break;\n                case \"BoxEmitter\":\n                case \"BoxParticleEmitter\":\n                default:\n                  s = new xr();\n              }\n              s.parse(e.particleEmitterType, a);\n            } else\n              (s = new xr()).parse(e, a);\n            n.particleEmitterType = s, n.startSpriteCellID = e.startSpriteCellID, n.endSpriteCellID = e.endSpriteCellID, n.spriteCellWidth = e.spriteCellWidth, n.spriteCellHeight = e.spriteCellHeight, n.spriteCellChangeSpeed = e.spriteCellChangeSpeed, n.spriteRandomStartCell = e.spriteRandomStartCell;\n          }, t.Parse = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a, s = e.name, d = null, p = null;\n            if (a = n instanceof wt.a ? n : n.getEngine(), e.customShader && a.createEffectForParticles) {\n              var y = (p = e.customShader).shaderOptions.defines.length > 0 ? p.shaderOptions.defines.join(`\n`) : \"\";\n              d = a.createEffectForParticles(p.shaderPath.fragmentElement, p.shaderOptions.uniforms, p.shaderOptions.samplers, y);\n            }\n            var P = new t(s, e.capacity, n, d, e.isAnimationSheetEnabled);\n            if (P.customShader = p, e.id && (P.id = e.id), e.subEmitters) {\n              P.subEmitters = [];\n              for (var R = 0, B = e.subEmitters; R < B.length; R++) {\n                for (var F = [], z = 0, J = B[R]; z < J.length; z++) {\n                  var ie = J[z];\n                  F.push(mo.Parse(ie, n, i));\n                }\n                P.subEmitters.push(F);\n              }\n            }\n            return t._Parse(e, P, n, i), e.textureMask && (P.textureMask = I.b.FromArray(e.textureMask)), e.preventAutoStart && (P.preventAutoStart = e.preventAutoStart), o || P.preventAutoStart || P.start(), P;\n          }, t.BILLBOARDMODE_Y = h.a.PARTICLES_BILLBOARDMODE_Y, t.BILLBOARDMODE_ALL = h.a.PARTICLES_BILLBOARDMODE_ALL, t.BILLBOARDMODE_STRETCHED = h.a.PARTICLES_BILLBOARDMODE_STRETCHED, t;\n        }(co);\n        mo._ParseParticleSystem = cn.Parse, ze.a.ShadersStore.gpuUpdateParticlesPixelShader = `#version 300 es\nvoid main() {\ndiscard;\n}\n`;\n        var fm = `#version 300 es\n#define PI 3.14159\nuniform float currentCount;\nuniform float timeDelta;\nuniform float stopFactor;\n#ifndef LOCAL\nuniform mat4 emitterWM;\n#endif\nuniform vec2 lifeTime;\nuniform vec2 emitPower;\nuniform vec2 sizeRange;\nuniform vec4 scaleRange;\n#ifndef COLORGRADIENTS\nuniform vec4 color1;\nuniform vec4 color2;\n#endif\nuniform vec3 gravity;\nuniform sampler2D randomSampler;\nuniform sampler2D randomSampler2;\nuniform vec4 angleRange;\n#ifdef BOXEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\nuniform vec3 minEmitBox;\nuniform vec3 maxEmitBox;\n#endif\n#ifdef POINTEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#endif\n#ifdef HEMISPHERICEMITTER\nuniform float radius;\nuniform float radiusRange;\nuniform float directionRandomizer;\n#endif\n#ifdef SPHEREEMITTER\nuniform float radius;\nuniform float radiusRange;\n#ifdef DIRECTEDSPHEREEMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nuniform float radius;\nuniform float height;\nuniform float radiusRange;\n#ifdef DIRECTEDCYLINDEREMITTER\nuniform vec3 direction1;\nuniform vec3 direction2;\n#else\nuniform float directionRandomizer;\n#endif\n#endif\n#ifdef CONEEMITTER\nuniform vec2 radius;\nuniform float coneAngle;\nuniform vec2 height;\nuniform float directionRandomizer;\n#endif\n\nin vec3 position;\n#ifdef CUSTOMEMITTER\nin vec3 initialPosition;\n#endif\nin float age;\nin float life;\nin vec4 seed;\nin vec3 size;\n#ifndef COLORGRADIENTS\nin vec4 color;\n#endif\nin vec3 direction;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nin float angle;\n#else\nin vec2 angle;\n#endif\n#ifdef ANIMATESHEET\nin float cellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nin float cellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nin vec3 noiseCoordinates1;\nin vec3 noiseCoordinates2;\n#endif\n\nout vec3 outPosition;\n#ifdef CUSTOMEMITTER\nout vec3 outInitialPosition;\n#endif\nout float outAge;\nout float outLife;\nout vec4 outSeed;\nout vec3 outSize;\n#ifndef COLORGRADIENTS\nout vec4 outColor;\n#endif\nout vec3 outDirection;\n#ifndef BILLBOARD\nout vec3 outInitialDirection;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nout float outAngle;\n#else\nout vec2 outAngle;\n#endif\n#ifdef ANIMATESHEET\nout float outCellIndex;\n#ifdef ANIMATESHEETRANDOMSTART\nout float outCellStartOffset;\n#endif\n#endif\n#ifdef NOISE\nout vec3 outNoiseCoordinates1;\nout vec3 outNoiseCoordinates2;\n#endif\n#ifdef SIZEGRADIENTS\nuniform sampler2D sizeGradientSampler;\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nuniform sampler2D angularSpeedGradientSampler;\n#endif\n#ifdef VELOCITYGRADIENTS\nuniform sampler2D velocityGradientSampler;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nuniform sampler2D limitVelocityGradientSampler;\nuniform float limitVelocityDamping;\n#endif\n#ifdef DRAGGRADIENTS\nuniform sampler2D dragGradientSampler;\n#endif\n#ifdef NOISE\nuniform vec3 noiseStrength;\nuniform sampler2D noiseSampler;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 cellInfos;\n#endif\nvec3 getRandomVec3(float offset) {\nreturn texture(randomSampler2,vec2(float(gl_VertexID)*offset/currentCount,0)).rgb;\n}\nvec4 getRandomVec4(float offset) {\nreturn texture(randomSampler,vec2(float(gl_VertexID)*offset/currentCount,0));\n}\nvoid main() {\nfloat newAge=age+timeDelta;\n\nif (newAge>=life && stopFactor != 0.) {\nvec3 newPosition;\nvec3 newDirection;\n\nvec4 randoms=getRandomVec4(seed.x);\n\noutLife=lifeTime.x+(lifeTime.y-lifeTime.x)*randoms.r;\noutAge=newAge-life;\n\noutSeed=seed;\n\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(0,0)).r;\n#else\noutSize.x=sizeRange.x+(sizeRange.y-sizeRange.x)*randoms.g;\n#endif\noutSize.y=scaleRange.x+(scaleRange.y-scaleRange.x)*randoms.b;\noutSize.z=scaleRange.z+(scaleRange.w-scaleRange.z)*randoms.a;\n#ifndef COLORGRADIENTS\n\noutColor=color1+(color2-color1)*randoms.b;\n#endif\n\n#ifndef ANGULARSPEEDGRADIENTS\noutAngle.y=angleRange.x+(angleRange.y-angleRange.x)*randoms.a;\noutAngle.x=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#else\noutAngle=angleRange.z+(angleRange.w-angleRange.z)*randoms.r;\n#endif\n\n#ifdef POINTEMITTER\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=vec3(0,0,0);\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(BOXEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\nnewPosition=minEmitBox+(maxEmitBox-minEmitBox)*randoms2;\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#elif defined(HEMISPHERICEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,abs(randY),randZ);\nnewDirection=newPosition+directionRandomizer*randoms3;\n#elif defined(SPHEREEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat phi=2.0*PI*randoms2.x;\nfloat theta=acos(2.0*randoms2.y-1.0);\nfloat randX=cos(phi)*sin(theta);\nfloat randY=cos(theta);\nfloat randZ=sin(phi)*sin(theta);\nnewPosition=(radius-(radius*radiusRange*randoms2.z))*vec3(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nnewDirection=newPosition+directionRandomizer*randoms3;\n#endif\n#elif defined(CYLINDEREMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nvec3 randoms3=getRandomVec3(seed.z);\n\nfloat yPos=(randoms2.x-0.5)*height;\nfloat angle=randoms2.y*PI*2.;\nfloat inverseRadiusRangeSquared=((1.-radiusRange)*(1.-radiusRange));\nfloat positionRadius=radius*sqrt(inverseRadiusRangeSquared+(randoms2.z*(1.-inverseRadiusRangeSquared)));\nfloat xPos=positionRadius*cos(angle);\nfloat zPos=positionRadius*sin(angle);\nnewPosition=vec3(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=direction1+(direction2-direction1)*randoms3;\n#else\n\nangle=angle+((randoms3.x-0.5)*PI);\nnewDirection=vec3(cos(angle),randoms3.y-0.5,sin(angle));\nnewDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nvec3 randoms2=getRandomVec3(seed.y);\nfloat s=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nfloat h=0.0001;\n#else\nfloat h=randoms2.y*height.y;\n\nh=1.-h*h;\n#endif\nfloat lRadius=radius.x-radius.x*randoms2.z*radius.y;\nlRadius=lRadius*h;\nfloat randX=lRadius*sin(s);\nfloat randZ=lRadius*cos(s);\nfloat randY=h*height.x;\nnewPosition=vec3(randX,randY,randZ);\n\nif (abs(cos(coneAngle)) == 1.0) {\nnewDirection=vec3(0.,1.0,0.);\n} else {\nvec3 randoms3=getRandomVec3(seed.z);\nnewDirection=normalize(newPosition+directionRandomizer*randoms3);\n}\n#elif defined(CUSTOMEMITTER)\nnewPosition=initialPosition;\noutInitialPosition=initialPosition;\n#else\n\nnewPosition=vec3(0.,0.,0.);\n\nnewDirection=2.0*(getRandomVec3(seed.w)-vec3(0.5,0.5,0.5));\n#endif\nfloat power=emitPower.x+(emitPower.y-emitPower.x)*randoms.a;\n#ifdef LOCAL\noutPosition=newPosition;\n#else\noutPosition=(emitterWM*vec4(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#ifndef BILLBOARD\noutInitialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nvec3 initial=newDirection;\n#else\nvec3 initial=(emitterWM*vec4(newDirection,0.)).xyz;\n#endif\noutDirection=initial*power;\n#ifndef BILLBOARD\noutInitialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET\noutCellIndex=cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=randoms.a*outLife;\n#endif\n#endif\n#ifdef NOISE\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n} else {\nfloat directionScale=timeDelta;\noutAge=newAge;\nfloat ageGradient=newAge/life;\n#ifdef VELOCITYGRADIENTS\ndirectionScale*=texture(velocityGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#ifdef DRAGGRADIENTS\ndirectionScale*=1.0-texture(dragGradientSampler,vec2(ageGradient,0)).r;\n#endif\n#if defined(CUSTOMEMITTER)\noutPosition=position+(direction-position)*ageGradient;\noutInitialPosition=initialPosition;\n#else\noutPosition=position+direction*directionScale;\n#endif\noutLife=life;\noutSeed=seed;\n#ifndef COLORGRADIENTS\noutColor=color;\n#endif\n#ifdef SIZEGRADIENTS\noutSize.x=texture(sizeGradientSampler,vec2(ageGradient,0)).r;\noutSize.yz=size.yz;\n#else\noutSize=size;\n#endif\n#ifndef BILLBOARD\noutInitialDirection=initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\noutDirection=direction;\n#else\nvec3 updatedDirection=direction+gravity*timeDelta;\n#ifdef LIMITVELOCITYGRADIENTS\nfloat limitVelocity=texture(limitVelocityGradientSampler,vec2(ageGradient,0)).r;\nfloat currentVelocity=length(updatedDirection);\nif (currentVelocity>limitVelocity) {\nupdatedDirection=updatedDirection*limitVelocityDamping;\n}\n#endif\noutDirection=updatedDirection;\n#ifdef NOISE\nfloat fetchedR=texture(noiseSampler,vec2(noiseCoordinates1.x,noiseCoordinates1.y)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedG=texture(noiseSampler,vec2(noiseCoordinates1.z,noiseCoordinates2.x)*vec2(0.5)+vec2(0.5)).r;\nfloat fetchedB=texture(noiseSampler,vec2(noiseCoordinates2.y,noiseCoordinates2.z)*vec2(0.5)+vec2(0.5)).r;\nvec3 force=vec3(2.*fetchedR-1.,2.*fetchedG-1.,2.*fetchedB-1.)*noiseStrength;\noutDirection=outDirection+force*timeDelta;\noutNoiseCoordinates1=noiseCoordinates1;\noutNoiseCoordinates2=noiseCoordinates2;\n#endif\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nfloat angularSpeed=texture(angularSpeedGradientSampler,vec2(ageGradient,0)).r;\noutAngle=angle+angularSpeed*timeDelta;\n#else\noutAngle=vec2(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET\nfloat offsetAge=outAge;\nfloat dist=cellInfos.y-cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\noutCellStartOffset=cellStartOffset;\noffsetAge+=cellStartOffset;\n#else\nfloat cellStartOffset=0.;\n#endif\nfloat ratio=clamp(mod(cellStartOffset+cellInfos.z*offsetAge,life)/life,0.,1.0);\noutCellIndex=float(int(cellInfos.x+ratio*dist));\n#endif\n}\n}`;\n        ze.a.ShadersStore.gpuUpdateParticlesVertexShader = fm;\n        var pm = `#ifdef CLIPPLANE\nin float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nin float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nin float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nin float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nin float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nin float fClipDistance6;\n#endif`;\n        ze.a.IncludesShadersStore.clipPlaneFragmentDeclaration2 = pm;\n        var _m = `#version 300 es\nuniform sampler2D diffuseSampler;\nin vec2 vUV;\nin vec4 vColor;\nout vec4 outFragColor;\n#include<clipPlaneFragmentDeclaration2>\n#include<imageProcessingDeclaration>\n#include<helperFunctions>\n#include<imageProcessingFunctions>\nvoid main() {\n#include<clipPlaneFragment>\nvec4 textureColor=texture(diffuseSampler,vUV);\noutFragColor=textureColor*vColor;\n#ifdef BLENDMULTIPLYMODE\nfloat alpha=vColor.a*textureColor.a;\noutFragColor.rgb=outFragColor.rgb*alpha+vec3(1.0)*(1.0-alpha);\n#endif\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\n#else\n#ifdef IMAGEPROCESSING\noutFragColor.rgb=toLinearSpace(outFragColor.rgb);\noutFragColor=applyImageProcessing(outFragColor);\n#endif\n#endif\n}\n`;\n        ze.a.ShadersStore.gpuRenderParticlesPixelShader = _m;\n        var mm = `#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nout float fClipDistance;\n#endif\n#ifdef CLIPPLANE2\nuniform vec4 vClipPlane2;\nout float fClipDistance2;\n#endif\n#ifdef CLIPPLANE3\nuniform vec4 vClipPlane3;\nout float fClipDistance3;\n#endif\n#ifdef CLIPPLANE4\nuniform vec4 vClipPlane4;\nout float fClipDistance4;\n#endif\n#ifdef CLIPPLANE5\nuniform vec4 vClipPlane5;\nout float fClipDistance5;\n#endif\n#ifdef CLIPPLANE6\nuniform vec4 vClipPlane6;\nout float fClipDistance6;\n#endif`;\n        ze.a.IncludesShadersStore.clipPlaneVertexDeclaration2 = mm;\n        var gm = `#version 300 es\nuniform mat4 view;\nuniform mat4 projection;\nuniform vec2 translationPivot;\nuniform vec3 worldOffset;\n#ifdef LOCAL\nuniform mat4 emitterWM;\n#endif\n\nin vec3 position;\nin float age;\nin float life;\nin vec3 size;\n#ifndef BILLBOARD\nin vec3 initialDirection;\n#endif\n#ifdef BILLBOARDSTRETCHED\nin vec3 direction;\n#endif\nin float angle;\n#ifdef ANIMATESHEET\nin float cellIndex;\n#endif\nin vec2 offset;\nin vec2 uv;\nout vec2 vUV;\nout vec4 vColor;\nout vec3 vPositionW;\n#if defined(BILLBOARD) && !defined(BILLBOARDY) && !defined(BILLBOARDSTRETCHED)\nuniform mat4 invView;\n#endif\n#include<clipPlaneVertexDeclaration2>\n#ifdef COLORGRADIENTS\nuniform sampler2D colorGradientSampler;\n#else\nuniform vec4 colorDead;\nin vec4 color;\n#endif\n#ifdef ANIMATESHEET\nuniform vec3 sheetInfos;\n#endif\n#ifdef BILLBOARD\nuniform vec3 eyePosition;\n#endif\nvec3 rotate(vec3 yaxis,vec3 rotatedCorner) {\nvec3 xaxis=normalize(cross(vec3(0.,1.0,0.),yaxis));\nvec3 zaxis=normalize(cross(yaxis,xaxis));\nvec3 row0=vec3(xaxis.x,xaxis.y,xaxis.z);\nvec3 row1=vec3(yaxis.x,yaxis.y,yaxis.z);\nvec3 row2=vec3(zaxis.x,zaxis.y,zaxis.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#ifdef BILLBOARDSTRETCHED\nvec3 rotateAlign(vec3 toCamera,vec3 rotatedCorner) {\nvec3 normalizedToCamera=normalize(toCamera);\nvec3 normalizedCrossDirToCamera=normalize(cross(normalize(direction),normalizedToCamera));\nvec3 crossProduct=normalize(cross(normalizedToCamera,normalizedCrossDirToCamera));\nvec3 row0=vec3(normalizedCrossDirToCamera.x,normalizedCrossDirToCamera.y,normalizedCrossDirToCamera.z);\nvec3 row1=vec3(crossProduct.x,crossProduct.y,crossProduct.z);\nvec3 row2=vec3(normalizedToCamera.x,normalizedToCamera.y,normalizedToCamera.z);\nmat3 rotMatrix=mat3(row0,row1,row2);\nvec3 alignedCorner=rotMatrix*rotatedCorner;\n#ifdef LOCAL\nreturn ((emitterWM*vec4(position,1.0)).xyz+worldOffset)+alignedCorner;\n#else\nreturn (position+worldOffset)+alignedCorner;\n#endif\n}\n#endif\nvoid main() {\n#ifdef ANIMATESHEET\nfloat rowOffset=floor(cellIndex/sheetInfos.z);\nfloat columnOffset=cellIndex-rowOffset*sheetInfos.z;\nvec2 uvScale=sheetInfos.xy;\nvec2 uvOffset=vec2(uv.x ,1.0-uv.y);\nvUV=(uvOffset+vec2(columnOffset,rowOffset))*uvScale;\n#else\nvUV=uv;\n#endif\nfloat ratio=age/life;\n#ifdef COLORGRADIENTS\nvColor=texture(colorGradientSampler,vec2(ratio,0));\n#else\nvColor=color*vec4(1.0-ratio)+colorDead*vec4(ratio);\n#endif\nvec2 cornerPos=(offset-translationPivot)*size.yz*size.x+translationPivot;\n#ifdef BILLBOARD\nvec4 rotatedCorner;\nrotatedCorner.w=0.;\n#ifdef BILLBOARDY\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.y=0.;\nvec3 yaxis=(position+worldOffset)-eyePosition;\nyaxis.y=0.;\nvPositionW=rotate(normalize(yaxis),rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#elif defined(BILLBOARDSTRETCHED)\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\nvec3 toCamera=(position+worldOffset)-eyePosition;\nvPositionW=rotateAlign(toCamera,rotatedCorner.xyz);\nvec4 viewPosition=(view*vec4(vPositionW,1.0));\n#else\n\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\n#ifdef LOCAL\nvec4 viewPosition=view*vec4(((emitterWM*vec4(position,1.0)).xyz+worldOffset),1.0)+rotatedCorner;\n#else\nvec4 viewPosition=view*vec4((position+worldOffset),1.0)+rotatedCorner;\n#endif\nvPositionW=(invView*viewPosition).xyz;\n#endif\n#else\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=0.;\nrotatedCorner.z=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nvec3 yaxis=normalize(initialDirection);\nvPositionW=rotate(yaxis,rotatedCorner);\n\nvec4 viewPosition=view*vec4(vPositionW,1.0);\n#endif\ngl_Position=projection*viewPosition;\n\n#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)\nvec4 worldPos=vec4(vPositionW,1.0);\n#endif\n#include<clipPlaneVertex>\n}`;\n        ze.a.ShadersStore.gpuRenderParticlesVertexShader = gm;\n        var Ji = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !1), a === void 0 && (a = null);\n            var s = r.call(this, e) || this;\n            s.layerMask = 268435455, s._accumulatedCount = 0, s._targetIndex = 0, s._currentRenderId = -1, s._started = !1, s._stopped = !1, s._timeDelta = 0, s._actualFrame = 0, s._rawTextureWidth = 256, s.onDisposeObservable = new C.c(), s.onStoppedObservable = new C.c(), s.forceDepthWrite = !1, s._preWarmDone = !1, s.isLocal = !1, s._onBeforeDrawParticlesObservable = null, i && i.getClassName() !== \"Scene\" ? (s._engine = i, s.defaultProjectionMatrix = u.a.PerspectiveFovLH(0.8, 1, 0.1, 100)) : (s._scene = i || te.a.LastCreatedScene, s._engine = s._scene.getEngine(), s.uniqueId = s._scene.getUniqueId(), s._scene.particleSystems.push(s)), s._customEffect = { 0: a }, s._attachImageProcessingConfiguration(null), n.randomTextureSize || delete n.randomTextureSize;\n            var d = Object(c.a)({ capacity: 5e4, randomTextureSize: s._engine.getCaps().maxTextureSize }, n), p = n;\n            isFinite(p) && (d.capacity = p), s._capacity = d.capacity, s._activeCount = d.capacity, s._currentActiveCount = 0, s._isAnimationSheetEnabled = o, s._updateEffectOptions = { attributes: [\"position\", \"initialPosition\", \"age\", \"life\", \"seed\", \"size\", \"color\", \"direction\", \"initialDirection\", \"angle\", \"cellIndex\", \"cellStartOffset\", \"noiseCoordinates1\", \"noiseCoordinates2\"], uniformsNames: [\"currentCount\", \"timeDelta\", \"emitterWM\", \"lifeTime\", \"color1\", \"color2\", \"sizeRange\", \"scaleRange\", \"gravity\", \"emitPower\", \"direction1\", \"direction2\", \"minEmitBox\", \"maxEmitBox\", \"radius\", \"directionRandomizer\", \"height\", \"coneAngle\", \"stopFactor\", \"angleRange\", \"radiusRange\", \"cellInfos\", \"noiseStrength\", \"limitVelocityDamping\"], uniformBuffersNames: [], samplers: [\"randomSampler\", \"randomSampler2\", \"sizeGradientSampler\", \"angularSpeedGradientSampler\", \"velocityGradientSampler\", \"limitVelocityGradientSampler\", \"noiseSampler\", \"dragGradientSampler\"], defines: \"\", fallbacks: null, onCompiled: null, onError: null, indexParameters: null, maxSimultaneousLights: 0, transformFeedbackVaryings: [] }, s.particleEmitterType = new xr();\n            for (var y = Math.min(s._engine.getCaps().maxTextureSize, d.randomTextureSize), P = [], R = 0; R < y; ++R)\n              P.push(Math.random()), P.push(Math.random()), P.push(Math.random()), P.push(Math.random());\n            for (s._randomTexture = new Zn(new Float32Array(P), y, 1, h.a.TEXTUREFORMAT_RGBA, i, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT), s._randomTexture.wrapU = h.a.TEXTURE_WRAP_ADDRESSMODE, s._randomTexture.wrapV = h.a.TEXTURE_WRAP_ADDRESSMODE, P = [], R = 0; R < y; ++R)\n              P.push(Math.random()), P.push(Math.random()), P.push(Math.random()), P.push(Math.random());\n            return s._randomTexture2 = new Zn(new Float32Array(P), y, 1, h.a.TEXTUREFORMAT_RGBA, i, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE, h.a.TEXTURETYPE_FLOAT), s._randomTexture2.wrapU = h.a.TEXTURE_WRAP_ADDRESSMODE, s._randomTexture2.wrapV = h.a.TEXTURE_WRAP_ADDRESSMODE, s._randomTextureSize = y, s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t, \"IsSupported\", { get: function() {\n            return !!te.a.LastCreatedEngine && te.a.LastCreatedEngine.webGLVersion > 1;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getCapacity = function() {\n            return this._capacity;\n          }, Object.defineProperty(t.prototype, \"activeParticleCount\", { get: function() {\n            return this._activeCount;\n          }, set: function(e) {\n            this._activeCount = Math.min(e, this._capacity);\n          }, enumerable: !1, configurable: !0 }), t.prototype.isReady = function() {\n            return this._updateEffect ? !!(this.emitter && this._updateEffect.isReady() && (!this._imageProcessingConfiguration || this._imageProcessingConfiguration.isReady()) && this._getEffect().isReady() && this.particleTexture && this.particleTexture.isReady()) : (this._recreateUpdateEffect(), this._recreateRenderEffect(), !1);\n          }, t.prototype.isStarted = function() {\n            return this._started;\n          }, t.prototype.isStopped = function() {\n            return this._stopped;\n          }, t.prototype.isStopping = function() {\n            return !1;\n          }, t.prototype.getActiveCount = function() {\n            return this._currentActiveCount;\n          }, t.prototype.start = function(e) {\n            var n = this;\n            if (e === void 0 && (e = this.startDelay), !this.targetStopDuration && this._hasTargetStopDurationDependantGradient())\n              throw \"Particle system started with a targetStopDuration dependant gradient (eg. startSizeGradients) but no targetStopDuration set\";\n            e ? setTimeout(function() {\n              n.start(0);\n            }, e) : (this._started = !0, this._stopped = !1, this._preWarmDone = !1, this.beginAnimationOnStart && this.animations && this.animations.length > 0 && this._scene && this._scene.beginAnimation(this, this.beginAnimationFrom, this.beginAnimationTo, this.beginAnimationLoop));\n          }, t.prototype.stop = function() {\n            this._stopped || (this._stopped = !0);\n          }, t.prototype.reset = function() {\n            this._releaseBuffers(), this._releaseVAOs(), this._currentActiveCount = 0, this._targetIndex = 0;\n          }, t.prototype.getClassName = function() {\n            return \"GPUParticleSystem\";\n          }, t.prototype.getCustomEffect = function(e) {\n            var n;\n            return e === void 0 && (e = 0), (n = this._customEffect[e]) !== null && n !== void 0 ? n : this._customEffect[0];\n          }, t.prototype.setCustomEffect = function(e, n) {\n            n === void 0 && (n = 0), this._customEffect[n] = e;\n          }, Object.defineProperty(t.prototype, \"onBeforeDrawParticlesObservable\", { get: function() {\n            return this._onBeforeDrawParticlesObservable || (this._onBeforeDrawParticlesObservable = new C.c()), this._onBeforeDrawParticlesObservable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"vertexShaderName\", { get: function() {\n            return \"gpuRenderParticles\";\n          }, enumerable: !1, configurable: !0 }), t.prototype._removeGradientAndTexture = function(e, n, i) {\n            return r.prototype._removeGradientAndTexture.call(this, e, n, i), this._releaseBuffers(), this;\n          }, t.prototype.addColorGradient = function(e, n, i) {\n            this._colorGradients || (this._colorGradients = []);\n            var o = new gc(e, n);\n            return this._colorGradients.push(o), this._refreshColorGradient(!0), this._releaseBuffers(), this;\n          }, t.prototype._refreshColorGradient = function(e) {\n            e === void 0 && (e = !1), this._colorGradients && (e && this._colorGradients.sort(function(n, i) {\n              return n.gradient < i.gradient ? -1 : n.gradient > i.gradient ? 1 : 0;\n            }), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null));\n          }, t.prototype.forceRefreshGradients = function() {\n            this._refreshColorGradient(), this._refreshFactorGradient(this._sizeGradients, \"_sizeGradientsTexture\"), this._refreshFactorGradient(this._angularSpeedGradients, \"_angularSpeedGradientsTexture\"), this._refreshFactorGradient(this._velocityGradients, \"_velocityGradientsTexture\"), this._refreshFactorGradient(this._limitVelocityGradients, \"_limitVelocityGradientsTexture\"), this._refreshFactorGradient(this._dragGradients, \"_dragGradientsTexture\"), this.reset();\n          }, t.prototype.removeColorGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._colorGradients, this._colorGradientsTexture), this._colorGradientsTexture = null, this;\n          }, t.prototype._addFactorGradient = function(e, n, i) {\n            var o = new vc(n, i);\n            e.push(o), this._releaseBuffers();\n          }, t.prototype.addSizeGradient = function(e, n) {\n            return this._sizeGradients || (this._sizeGradients = []), this._addFactorGradient(this._sizeGradients, e, n), this._refreshFactorGradient(this._sizeGradients, \"_sizeGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeSizeGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._sizeGradients, this._sizeGradientsTexture), this._sizeGradientsTexture = null, this;\n          }, t.prototype._refreshFactorGradient = function(e, n, i) {\n            i === void 0 && (i = !1), e && (i && e.sort(function(o, a) {\n              return o.gradient < a.gradient ? -1 : o.gradient > a.gradient ? 1 : 0;\n            }), this[n] && (this[n].dispose(), this[n] = null));\n          }, t.prototype.addAngularSpeedGradient = function(e, n) {\n            return this._angularSpeedGradients || (this._angularSpeedGradients = []), this._addFactorGradient(this._angularSpeedGradients, e, n), this._refreshFactorGradient(this._angularSpeedGradients, \"_angularSpeedGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeAngularSpeedGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._angularSpeedGradients, this._angularSpeedGradientsTexture), this._angularSpeedGradientsTexture = null, this;\n          }, t.prototype.addVelocityGradient = function(e, n) {\n            return this._velocityGradients || (this._velocityGradients = []), this._addFactorGradient(this._velocityGradients, e, n), this._refreshFactorGradient(this._velocityGradients, \"_velocityGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeVelocityGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._velocityGradients, this._velocityGradientsTexture), this._velocityGradientsTexture = null, this;\n          }, t.prototype.addLimitVelocityGradient = function(e, n) {\n            return this._limitVelocityGradients || (this._limitVelocityGradients = []), this._addFactorGradient(this._limitVelocityGradients, e, n), this._refreshFactorGradient(this._limitVelocityGradients, \"_limitVelocityGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeLimitVelocityGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._limitVelocityGradients, this._limitVelocityGradientsTexture), this._limitVelocityGradientsTexture = null, this;\n          }, t.prototype.addDragGradient = function(e, n) {\n            return this._dragGradients || (this._dragGradients = []), this._addFactorGradient(this._dragGradients, e, n), this._refreshFactorGradient(this._dragGradients, \"_dragGradientsTexture\", !0), this._releaseBuffers(), this;\n          }, t.prototype.removeDragGradient = function(e) {\n            return this._removeGradientAndTexture(e, this._dragGradients, this._dragGradientsTexture), this._dragGradientsTexture = null, this;\n          }, t.prototype.addEmitRateGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeEmitRateGradient = function(e) {\n            return this;\n          }, t.prototype.addStartSizeGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeStartSizeGradient = function(e) {\n            return this;\n          }, t.prototype.addColorRemapGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeColorRemapGradient = function() {\n            return this;\n          }, t.prototype.addAlphaRemapGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeAlphaRemapGradient = function() {\n            return this;\n          }, t.prototype.addRampGradient = function(e, n) {\n            return this;\n          }, t.prototype.removeRampGradient = function() {\n            return this;\n          }, t.prototype.getRampGradients = function() {\n            return null;\n          }, Object.defineProperty(t.prototype, \"useRampGradients\", { get: function() {\n            return !1;\n          }, set: function(e) {\n          }, enumerable: !1, configurable: !0 }), t.prototype.addLifeTimeGradient = function(e, n, i) {\n            return this;\n          }, t.prototype.removeLifeTimeGradient = function(e) {\n            return this;\n          }, t.prototype._reset = function() {\n            this._releaseBuffers();\n          }, t.prototype._createUpdateVAO = function(e) {\n            var n = {};\n            n.position = e.createVertexBuffer(\"position\", 0, 3);\n            var i = 3;\n            this.particleEmitterType instanceof Cr && (n.initialPosition = e.createVertexBuffer(\"initialPosition\", i, 3), i += 3), n.age = e.createVertexBuffer(\"age\", i, 1), i += 1, n.life = e.createVertexBuffer(\"life\", i, 1), i += 1, n.seed = e.createVertexBuffer(\"seed\", i, 4), i += 4, n.size = e.createVertexBuffer(\"size\", i, 3), i += 3, this._colorGradientsTexture || (n.color = e.createVertexBuffer(\"color\", i, 4), i += 4), n.direction = e.createVertexBuffer(\"direction\", i, 3), i += 3, this._isBillboardBased || (n.initialDirection = e.createVertexBuffer(\"initialDirection\", i, 3), i += 3), this._angularSpeedGradientsTexture ? (n.angle = e.createVertexBuffer(\"angle\", i, 1), i += 1) : (n.angle = e.createVertexBuffer(\"angle\", i, 2), i += 2), this._isAnimationSheetEnabled && (n.cellIndex = e.createVertexBuffer(\"cellIndex\", i, 1), i += 1, this.spriteRandomStartCell && (n.cellStartOffset = e.createVertexBuffer(\"cellStartOffset\", i, 1), i += 1)), this.noiseTexture && (n.noiseCoordinates1 = e.createVertexBuffer(\"noiseCoordinates1\", i, 3), i += 3, n.noiseCoordinates2 = e.createVertexBuffer(\"noiseCoordinates2\", i, 3), i += 3);\n            var o = this._engine.recordVertexArrayObject(n, null, this._updateEffect);\n            return this._engine.bindArrayBuffer(null), o;\n          }, t.prototype._createRenderVAO = function(e, n) {\n            var i = {};\n            i.position = e.createVertexBuffer(\"position\", 0, 3, this._attributesStrideSize, !0);\n            var o = 3;\n            this.particleEmitterType instanceof Cr && (o += 3), i.age = e.createVertexBuffer(\"age\", o, 1, this._attributesStrideSize, !0), o += 1, i.life = e.createVertexBuffer(\"life\", o, 1, this._attributesStrideSize, !0), o += 5, i.size = e.createVertexBuffer(\"size\", o, 3, this._attributesStrideSize, !0), o += 3, this._colorGradientsTexture || (i.color = e.createVertexBuffer(\"color\", o, 4, this._attributesStrideSize, !0), o += 4), this.billboardMode === cn.BILLBOARDMODE_STRETCHED && (i.direction = e.createVertexBuffer(\"direction\", o, 3, this._attributesStrideSize, !0)), o += 3, this._isBillboardBased || (i.initialDirection = e.createVertexBuffer(\"initialDirection\", o, 3, this._attributesStrideSize, !0), o += 3), i.angle = e.createVertexBuffer(\"angle\", o, 1, this._attributesStrideSize, !0), this._angularSpeedGradientsTexture ? o++ : o += 2, this._isAnimationSheetEnabled && (i.cellIndex = e.createVertexBuffer(\"cellIndex\", o, 1, this._attributesStrideSize, !0), o += 1, this.spriteRandomStartCell && (i.cellStartOffset = e.createVertexBuffer(\"cellStartOffset\", o, 1, this._attributesStrideSize, !0), o += 1)), this.noiseTexture && (i.noiseCoordinates1 = e.createVertexBuffer(\"noiseCoordinates1\", o, 3, this._attributesStrideSize, !0), o += 3, i.noiseCoordinates2 = e.createVertexBuffer(\"noiseCoordinates2\", o, 3, this._attributesStrideSize, !0), o += 3), i.offset = n.createVertexBuffer(\"offset\", 0, 2), i.uv = n.createVertexBuffer(\"uv\", 2, 2);\n            var a = this._engine.recordVertexArrayObject(i, null, this._getEffect());\n            return this._engine.bindArrayBuffer(null), a;\n          }, t.prototype._initialize = function(e) {\n            if (e === void 0 && (e = !1), !this._buffer0 || e) {\n              var n = this._engine, i = new Array();\n              this._attributesStrideSize = 21, this._targetIndex = 0, this.particleEmitterType instanceof Cr && (this._attributesStrideSize += 3), this.isBillboardBased || (this._attributesStrideSize += 3), this._colorGradientsTexture && (this._attributesStrideSize -= 4), this._angularSpeedGradientsTexture && (this._attributesStrideSize -= 1), this._isAnimationSheetEnabled && (this._attributesStrideSize += 1, this.spriteRandomStartCell && (this._attributesStrideSize += 1)), this.noiseTexture && (this._attributesStrideSize += 6);\n              for (var o = this.particleEmitterType instanceof Cr, a = u.c.Vector3[0], s = 0; s < this._capacity; s++)\n                i.push(0), i.push(0), i.push(0), o && (this.particleEmitterType.particlePositionGenerator(s, null, a), i.push(a.x), i.push(a.y), i.push(a.z)), i.push(0), i.push(0), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(0), i.push(0), i.push(0), this._colorGradientsTexture || (i.push(0), i.push(0), i.push(0), i.push(0)), o ? (this.particleEmitterType.particleDestinationGenerator(s, null, a), i.push(a.x), i.push(a.y), i.push(a.z)) : (i.push(0), i.push(0), i.push(0)), this.isBillboardBased || (i.push(0), i.push(0), i.push(0)), i.push(0), this._angularSpeedGradientsTexture || i.push(0), this._isAnimationSheetEnabled && (i.push(0), this.spriteRandomStartCell && i.push(0)), this.noiseTexture && (i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()), i.push(Math.random()));\n              var d = new Float32Array([0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1, -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0]);\n              this._buffer0 = new Oe.a(n, i, !1, this._attributesStrideSize), this._buffer1 = new Oe.a(n, i, !1, this._attributesStrideSize), this._spriteBuffer = new Oe.a(n, d, !1, 4), this._updateVAO = [], this._updateVAO.push(this._createUpdateVAO(this._buffer0)), this._updateVAO.push(this._createUpdateVAO(this._buffer1)), this._renderVAO = [], this._renderVAO.push(this._createRenderVAO(this._buffer1, this._spriteBuffer)), this._renderVAO.push(this._createRenderVAO(this._buffer0, this._spriteBuffer)), this._sourceBuffer = this._buffer0, this._targetBuffer = this._buffer1;\n            }\n          }, t.prototype._recreateUpdateEffect = function() {\n            var e = this.particleEmitterType ? this.particleEmitterType.getEffectDefines() : \"\";\n            this._isBillboardBased && (e += `\n#define BILLBOARD`), this._colorGradientsTexture && (e += `\n#define COLORGRADIENTS`), this._sizeGradientsTexture && (e += `\n#define SIZEGRADIENTS`), this._angularSpeedGradientsTexture && (e += `\n#define ANGULARSPEEDGRADIENTS`), this._velocityGradientsTexture && (e += `\n#define VELOCITYGRADIENTS`), this._limitVelocityGradientsTexture && (e += `\n#define LIMITVELOCITYGRADIENTS`), this._dragGradientsTexture && (e += `\n#define DRAGGRADIENTS`), this.isAnimationSheetEnabled && (e += `\n#define ANIMATESHEET`, this.spriteRandomStartCell && (e += `\n#define ANIMATESHEETRANDOMSTART`)), this.noiseTexture && (e += `\n#define NOISE`), this.isLocal && (e += `\n#define LOCAL`), this._updateEffect && this._updateEffectOptions.defines === e || (this._updateEffectOptions.transformFeedbackVaryings = [\"outPosition\"], this.particleEmitterType instanceof Cr && this._updateEffectOptions.transformFeedbackVaryings.push(\"outInitialPosition\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outAge\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outLife\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outSeed\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outSize\"), this._colorGradientsTexture || this._updateEffectOptions.transformFeedbackVaryings.push(\"outColor\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outDirection\"), this._isBillboardBased || this._updateEffectOptions.transformFeedbackVaryings.push(\"outInitialDirection\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outAngle\"), this.isAnimationSheetEnabled && (this._updateEffectOptions.transformFeedbackVaryings.push(\"outCellIndex\"), this.spriteRandomStartCell && this._updateEffectOptions.transformFeedbackVaryings.push(\"outCellStartOffset\")), this.noiseTexture && (this._updateEffectOptions.transformFeedbackVaryings.push(\"outNoiseCoordinates1\"), this._updateEffectOptions.transformFeedbackVaryings.push(\"outNoiseCoordinates2\")), this._updateEffectOptions.defines = e, this._updateEffect = new ze.a(\"gpuUpdateParticles\", this._updateEffectOptions, this._engine));\n          }, t.prototype._getEffect = function() {\n            var e;\n            return (e = this.getCustomEffect()) !== null && e !== void 0 ? e : this._renderEffect;\n          }, t.prototype.fillDefines = function(e, n) {\n            if (this._scene && (this._scene.clipPlane && e.push(\"#define CLIPPLANE\"), this._scene.clipPlane2 && e.push(\"#define CLIPPLANE2\"), this._scene.clipPlane3 && e.push(\"#define CLIPPLANE3\"), this._scene.clipPlane4 && e.push(\"#define CLIPPLANE4\"), this._scene.clipPlane5 && e.push(\"#define CLIPPLANE5\"), this._scene.clipPlane6 && e.push(\"#define CLIPPLANE6\")), this.blendMode === cn.BLENDMODE_MULTIPLY && e.push(\"#define BLENDMULTIPLYMODE\"), this.isLocal && e.push(\"#define LOCAL\"), this._isBillboardBased)\n              switch (e.push(\"#define BILLBOARD\"), this.billboardMode) {\n                case cn.BILLBOARDMODE_Y:\n                  e.push(\"#define BILLBOARDY\");\n                  break;\n                case cn.BILLBOARDMODE_STRETCHED:\n                  e.push(\"#define BILLBOARDSTRETCHED\");\n                  break;\n                case cn.BILLBOARDMODE_ALL:\n                  e.push(\"#define BILLBOARDMODE_ALL\");\n              }\n            this._colorGradientsTexture && e.push(\"#define COLORGRADIENTS\"), this.isAnimationSheetEnabled && e.push(\"#define ANIMATESHEET\"), this._imageProcessingConfiguration && (this._imageProcessingConfiguration.prepareDefines(this._imageProcessingConfigurationDefines), e.push(\"\" + this._imageProcessingConfigurationDefines.toString()));\n          }, t.prototype.fillUniformsAttributesAndSamplerNames = function(e, n, i) {\n            n.push(\"position\", \"age\", \"life\", \"size\", \"color\", \"offset\", \"uv\", \"direction\", \"initialDirection\", \"angle\", \"cellIndex\"), e.push(\"emitterWM\", \"worldOffset\", \"view\", \"projection\", \"colorDead\", \"invView\", \"vClipPlane\", \"vClipPlane2\", \"vClipPlane3\", \"vClipPlane4\", \"vClipPlane5\", \"vClipPlane6\", \"sheetInfos\", \"translationPivot\", \"eyePosition\"), i.push(\"diffuseSampler\", \"colorGradientSampler\"), this._imageProcessingConfiguration && (vn.a.PrepareUniforms(e, this._imageProcessingConfigurationDefines), vn.a.PrepareSamplers(i, this._imageProcessingConfigurationDefines));\n          }, t.prototype._recreateRenderEffect = function() {\n            var e = this.getCustomEffect();\n            if (e)\n              return e;\n            var n = [];\n            this.fillDefines(n);\n            var i = n.join(`\n`);\n            if (this._renderEffect && this._renderEffect.defines === i)\n              return this._renderEffect;\n            var o = [], a = [], s = [];\n            return this.fillUniformsAttributesAndSamplerNames(a, o, s), this._renderEffect = new ze.a(\"gpuRenderParticles\", o, a, s, this._engine, i), this._renderEffect;\n          }, t.prototype.animate = function(e) {\n            var n;\n            e === void 0 && (e = !1), this._timeDelta = this.updateSpeed * (e ? this.preWarmStepOffset : ((n = this._scene) === null || n === void 0 ? void 0 : n.getAnimationRatio()) || 1), this._actualFrame += this._timeDelta, this._stopped || this.targetStopDuration && this._actualFrame >= this.targetStopDuration && this.stop();\n          }, t.prototype._createFactorGradientTexture = function(e, n) {\n            var i = this[n];\n            if (e && e.length && !i) {\n              for (var o = new Float32Array(this._rawTextureWidth), a = 0; a < this._rawTextureWidth; a++) {\n                var s = a / this._rawTextureWidth;\n                On.GetCurrentGradient(s, e, function(d, p, y) {\n                  o[a] = $.a.Lerp(d.factor1, p.factor1, y);\n                });\n              }\n              this[n] = Zn.CreateRTexture(o, this._rawTextureWidth, 1, this._scene || this._engine, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n          }, t.prototype._createSizeGradientTexture = function() {\n            this._createFactorGradientTexture(this._sizeGradients, \"_sizeGradientsTexture\");\n          }, t.prototype._createAngularSpeedGradientTexture = function() {\n            this._createFactorGradientTexture(this._angularSpeedGradients, \"_angularSpeedGradientsTexture\");\n          }, t.prototype._createVelocityGradientTexture = function() {\n            this._createFactorGradientTexture(this._velocityGradients, \"_velocityGradientsTexture\");\n          }, t.prototype._createLimitVelocityGradientTexture = function() {\n            this._createFactorGradientTexture(this._limitVelocityGradients, \"_limitVelocityGradientsTexture\");\n          }, t.prototype._createDragGradientTexture = function() {\n            this._createFactorGradientTexture(this._dragGradients, \"_dragGradientsTexture\");\n          }, t.prototype._createColorGradientTexture = function() {\n            if (this._colorGradients && this._colorGradients.length && !this._colorGradientsTexture) {\n              for (var e = new Uint8Array(4 * this._rawTextureWidth), n = I.c.Color4[0], i = 0; i < this._rawTextureWidth; i++) {\n                var o = i / this._rawTextureWidth;\n                On.GetCurrentGradient(o, this._colorGradients, function(a, s, d) {\n                  I.b.LerpToRef(a.color1, s.color1, d, n), e[4 * i] = 255 * n.r, e[4 * i + 1] = 255 * n.g, e[4 * i + 2] = 255 * n.b, e[4 * i + 3] = 255 * n.a;\n                });\n              }\n              this._colorGradientsTexture = Zn.CreateRGBATexture(e, this._rawTextureWidth, 1, this._scene, !1, !1, h.a.TEXTURE_NEAREST_SAMPLINGMODE);\n            }\n          }, t.prototype.render = function(e) {\n            var n, i;\n            if (e === void 0 && (e = !1), !this._started || (this._createColorGradientTexture(), this._createSizeGradientTexture(), this._createAngularSpeedGradientTexture(), this._createVelocityGradientTexture(), this._createLimitVelocityGradientTexture(), this._createDragGradientTexture(), this._recreateUpdateEffect(), this._recreateRenderEffect(), !this.isReady()))\n              return 0;\n            if (!e && this._scene) {\n              if (!this._preWarmDone && this.preWarmCycles) {\n                for (var o = 0; o < this.preWarmCycles; o++)\n                  this.animate(!0), this.render(!0);\n                this._preWarmDone = !0;\n              }\n              if (this._currentRenderId === this._scene.getFrameId())\n                return 0;\n              this._currentRenderId = this._scene.getFrameId();\n            }\n            if (this._initialize(), this._accumulatedCount += this.emitRate * this._timeDelta, this._accumulatedCount > 1) {\n              var a = 0 | this._accumulatedCount;\n              this._accumulatedCount -= a, this._currentActiveCount = Math.min(this._activeCount, this._currentActiveCount + a);\n            }\n            if (!this._currentActiveCount)\n              return 0;\n            this._engine.enableEffect(this._updateEffect);\n            var s, d = this._engine;\n            if (!d.setState)\n              throw new Error(\"GPU particles cannot work with a full Engine. ThinEngine is not supported\");\n            if (this._updateEffect.setFloat(\"currentCount\", this._currentActiveCount), this._updateEffect.setFloat(\"timeDelta\", this._timeDelta), this._updateEffect.setFloat(\"stopFactor\", this._stopped ? 0 : 1), this._updateEffect.setTexture(\"randomSampler\", this._randomTexture), this._updateEffect.setTexture(\"randomSampler2\", this._randomTexture2), this._updateEffect.setFloat2(\"lifeTime\", this.minLifeTime, this.maxLifeTime), this._updateEffect.setFloat2(\"emitPower\", this.minEmitPower, this.maxEmitPower), this._colorGradientsTexture || (this._updateEffect.setDirectColor4(\"color1\", this.color1), this._updateEffect.setDirectColor4(\"color2\", this.color2)), this._updateEffect.setFloat2(\"sizeRange\", this.minSize, this.maxSize), this._updateEffect.setFloat4(\"scaleRange\", this.minScaleX, this.maxScaleX, this.minScaleY, this.maxScaleY), this._updateEffect.setFloat4(\"angleRange\", this.minAngularSpeed, this.maxAngularSpeed, this.minInitialRotation, this.maxInitialRotation), this._updateEffect.setVector3(\"gravity\", this.gravity), this._sizeGradientsTexture && this._updateEffect.setTexture(\"sizeGradientSampler\", this._sizeGradientsTexture), this._angularSpeedGradientsTexture && this._updateEffect.setTexture(\"angularSpeedGradientSampler\", this._angularSpeedGradientsTexture), this._velocityGradientsTexture && this._updateEffect.setTexture(\"velocityGradientSampler\", this._velocityGradientsTexture), this._limitVelocityGradientsTexture && (this._updateEffect.setTexture(\"limitVelocityGradientSampler\", this._limitVelocityGradientsTexture), this._updateEffect.setFloat(\"limitVelocityDamping\", this.limitVelocityDamping)), this._dragGradientsTexture && this._updateEffect.setTexture(\"dragGradientSampler\", this._dragGradientsTexture), this.particleEmitterType && this.particleEmitterType.applyToShader(this._updateEffect), this._isAnimationSheetEnabled && this._updateEffect.setFloat3(\"cellInfos\", this.startSpriteCellID, this.endSpriteCellID, this.spriteCellChangeSpeed), this.noiseTexture && (this._updateEffect.setTexture(\"noiseSampler\", this.noiseTexture), this._updateEffect.setVector3(\"noiseStrength\", this.noiseStrength)), this.emitter.position)\n              s = this.emitter.getWorldMatrix();\n            else {\n              var p = this.emitter;\n              s = u.a.Translation(p.x, p.y, p.z);\n            }\n            if (this.isLocal || this._updateEffect.setMatrix(\"emitterWM\", s), this._engine.bindVertexArrayObject(this._updateVAO[this._targetIndex], null), d.bindTransformFeedbackBuffer(this._targetBuffer.getBuffer()), d.setRasterizerState(!1), d.beginTransformFeedback(!0), d.drawArraysType(h.a.MATERIAL_PointListDrawMode, 0, this._currentActiveCount), d.endTransformFeedback(), d.setRasterizerState(!0), d.bindTransformFeedbackBuffer(null), !e) {\n              var y = this._getEffect();\n              this._engine.enableEffect(y);\n              var P = ((n = this._scene) === null || n === void 0 ? void 0 : n.getViewMatrix()) || u.a.IdentityReadOnly;\n              if (y.setMatrix(\"view\", P), y.setMatrix(\"projection\", (i = this.defaultProjectionMatrix) !== null && i !== void 0 ? i : this._scene.getProjectionMatrix()), y.setTexture(\"diffuseSampler\", this.particleTexture), y.setVector2(\"translationPivot\", this.translationPivot), y.setVector3(\"worldOffset\", this.worldOffset), this.isLocal && y.setMatrix(\"emitterWM\", s), this._colorGradientsTexture ? y.setTexture(\"colorGradientSampler\", this._colorGradientsTexture) : y.setDirectColor4(\"colorDead\", this.colorDead), this._isAnimationSheetEnabled && this.particleTexture) {\n                var R = this.particleTexture.getBaseSize();\n                y.setFloat3(\"sheetInfos\", this.spriteCellWidth / R.width, this.spriteCellHeight / R.height, R.width / this.spriteCellWidth);\n              }\n              if (this._isBillboardBased && this._scene) {\n                var B = this._scene.activeCamera;\n                y.setVector3(\"eyePosition\", B.globalPosition);\n              }\n              var F = y.defines;\n              if (this._scene && (this._scene.clipPlane || this._scene.clipPlane2 || this._scene.clipPlane3 || this._scene.clipPlane4 || this._scene.clipPlane5 || this._scene.clipPlane6) && $e.a.BindClipPlane(y, this._scene), F.indexOf(\"#define BILLBOARDMODE_ALL\") >= 0) {\n                var z = P.clone();\n                z.invert(), y.setMatrix(\"invView\", z);\n              }\n              switch (this._imageProcessingConfiguration && !this._imageProcessingConfiguration.applyByPostProcess && this._imageProcessingConfiguration.bind(y), this.blendMode) {\n                case cn.BLENDMODE_ADD:\n                  this._engine.setAlphaMode(h.a.ALPHA_ADD);\n                  break;\n                case cn.BLENDMODE_ONEONE:\n                  this._engine.setAlphaMode(h.a.ALPHA_ONEONE);\n                  break;\n                case cn.BLENDMODE_STANDARD:\n                  this._engine.setAlphaMode(h.a.ALPHA_COMBINE);\n                  break;\n                case cn.BLENDMODE_MULTIPLY:\n                  this._engine.setAlphaMode(h.a.ALPHA_MULTIPLY);\n              }\n              this.forceDepthWrite && d.setDepthWrite(!0), this._engine.bindVertexArrayObject(this._renderVAO[this._targetIndex], null), this._onBeforeDrawParticlesObservable && this._onBeforeDrawParticlesObservable.notifyObservers(y), this._engine.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, this._currentActiveCount), this._engine.setAlphaMode(h.a.ALPHA_DISABLE);\n            }\n            this._targetIndex++, this._targetIndex === 2 && (this._targetIndex = 0);\n            var J = this._sourceBuffer;\n            return this._sourceBuffer = this._targetBuffer, this._targetBuffer = J, this._currentActiveCount;\n          }, t.prototype.rebuild = function() {\n            this._initialize(!0);\n          }, t.prototype._releaseBuffers = function() {\n            this._buffer0 && (this._buffer0.dispose(), this._buffer0 = null), this._buffer1 && (this._buffer1.dispose(), this._buffer1 = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null);\n          }, t.prototype._releaseVAOs = function() {\n            if (this._updateVAO) {\n              for (var e = 0; e < this._updateVAO.length; e++)\n                this._engine.releaseVertexArrayObject(this._updateVAO[e]);\n              for (this._updateVAO = [], e = 0; e < this._renderVAO.length; e++)\n                this._engine.releaseVertexArrayObject(this._renderVAO[e]);\n              this._renderVAO = [];\n            }\n          }, t.prototype.dispose = function(e) {\n            if (e === void 0 && (e = !0), this._scene) {\n              var n = this._scene.particleSystems.indexOf(this);\n              n > -1 && this._scene.particleSystems.splice(n, 1);\n            }\n            this._releaseBuffers(), this._releaseVAOs(), this._colorGradientsTexture && (this._colorGradientsTexture.dispose(), this._colorGradientsTexture = null), this._sizeGradientsTexture && (this._sizeGradientsTexture.dispose(), this._sizeGradientsTexture = null), this._angularSpeedGradientsTexture && (this._angularSpeedGradientsTexture.dispose(), this._angularSpeedGradientsTexture = null), this._velocityGradientsTexture && (this._velocityGradientsTexture.dispose(), this._velocityGradientsTexture = null), this._limitVelocityGradientsTexture && (this._limitVelocityGradientsTexture.dispose(), this._limitVelocityGradientsTexture = null), this._dragGradientsTexture && (this._dragGradientsTexture.dispose(), this._dragGradientsTexture = null), this._randomTexture && (this._randomTexture.dispose(), this._randomTexture = null), this._randomTexture2 && (this._randomTexture2.dispose(), this._randomTexture2 = null), e && this.particleTexture && (this.particleTexture.dispose(), this.particleTexture = null), e && this.noiseTexture && (this.noiseTexture.dispose(), this.noiseTexture = null), this.onStoppedObservable.clear(), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n          }, t.prototype.clone = function(e, n) {\n            var i = this.serialize(), o = t.Parse(i, this._scene || this._engine, \"\"), a = Object(c.a)({}, this._customEffect);\n            return o.name = e, o._customEffect = a, n === void 0 && (n = this.emitter), o.emitter = n, o.noiseTexture = this.noiseTexture, o;\n          }, t.prototype.serialize = function(e) {\n            e === void 0 && (e = !1);\n            var n = {};\n            return cn._Serialize(n, this, e), n.activeParticleCount = this.activeParticleCount, n.randomTextureSize = this._randomTextureSize, n;\n          }, t.Parse = function(e, n, i, o) {\n            o === void 0 && (o = !1);\n            var a = new t(e.name, { capacity: e.capacity, randomTextureSize: e.randomTextureSize }, n);\n            return e.activeParticleCount && (a.activeParticleCount = e.activeParticleCount), cn._Parse(e, a, n, i), e.preventAutoStart && (a.preventAutoStart = e.preventAutoStart), o || a.preventAutoStart || a.start(), a;\n          }, t;\n        }(co), da = function() {\n          function r() {\n            this.systems = new Array();\n          }\n          return Object.defineProperty(r.prototype, \"emitterNode\", { get: function() {\n            return this._emitterNode;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setEmitterAsSphere = function(t, e, n) {\n            this._emitterNode && this._emitterNode.dispose(), this._emitterCreationOptions = { kind: \"Sphere\", options: t, renderingGroupId: e };\n            var i = Nn.a.CreateSphere(\"emitterSphere\", { diameter: t.diameter, segments: t.segments }, n);\n            i.renderingGroupId = e;\n            var o = new Nt.a(\"emitterSphereMaterial\", n);\n            o.emissiveColor = t.color, i.material = o;\n            for (var a = 0, s = this.systems; a < s.length; a++)\n              s[a].emitter = i;\n            this._emitterNode = i;\n          }, r.prototype.start = function(t) {\n            for (var e = 0, n = this.systems; e < n.length; e++) {\n              var i = n[e];\n              t && (i.emitter = t), i.start();\n            }\n          }, r.prototype.dispose = function() {\n            for (var t = 0, e = this.systems; t < e.length; t++)\n              e[t].dispose();\n            this.systems = [], this._emitterNode && (this._emitterNode.dispose(), this._emitterNode = null);\n          }, r.prototype.serialize = function(t) {\n            t === void 0 && (t = !1);\n            for (var e = { systems: [] }, n = 0, i = this.systems; n < i.length; n++) {\n              var o = i[n];\n              e.systems.push(o.serialize(t));\n            }\n            return this._emitterNode && (e.emitter = this._emitterCreationOptions), e;\n          }, r.Parse = function(t, e, n) {\n            n === void 0 && (n = !1);\n            var i = new r(), o = this.BaseAssetsUrl + \"/textures/\";\n            e = e || te.a.LastCreatedScene;\n            for (var a = 0, s = t.systems; a < s.length; a++) {\n              var d = s[a];\n              i.systems.push(n ? Ji.Parse(d, e, o, !0) : cn.Parse(d, e, o, !0));\n            }\n            if (t.emitter) {\n              var p = t.emitter.options;\n              switch (t.emitter.kind) {\n                case \"Sphere\":\n                  i.setEmitterAsSphere({ diameter: p.diameter, segments: p.segments, color: I.a.FromArray(p.color) }, t.emitter.renderingGroupId, e);\n              }\n            }\n            return i;\n          }, r.BaseAssetsUrl = \"https://assets.babylonjs.com/particles\", r;\n        }(), vm = function() {\n          function r() {\n          }\n          return r.CreateDefault = function(t, e, n, i) {\n            var o;\n            return e === void 0 && (e = 500), i === void 0 && (i = !1), (o = i ? new Ji(\"default system\", { capacity: e }, n) : new cn(\"default system\", e, n)).emitter = t, o.particleTexture = new Ne.a(\"https://www.babylonjs.com/assets/Flare.png\", o.getScene()), o.createConeEmitter(0.1, Math.PI / 4), o.color1 = new I.b(1, 1, 1, 1), o.color2 = new I.b(1, 1, 1, 1), o.colorDead = new I.b(1, 1, 1, 0), o.minSize = 0.1, o.maxSize = 0.1, o.minEmitPower = 2, o.maxEmitPower = 2, o.updateSpeed = 1 / 60, o.emitRate = 30, o;\n          }, r.CreateAsync = function(t, e, n) {\n            n === void 0 && (n = !1), e || (e = te.a.LastCreatedScene);\n            var i = {};\n            return e._addPendingData(i), new Promise(function(o, a) {\n              if (n && !Ji.IsSupported)\n                return e._removePendingData(i), a(\"Particle system with GPU is not supported.\");\n              Xe.b.LoadFile(r.BaseAssetsUrl + \"/systems/\" + t + \".json\", function(s) {\n                e._removePendingData(i);\n                var d = JSON.parse(s.toString());\n                return o(da.Parse(d, e, n));\n              }, void 0, void 0, void 0, function() {\n                return e._removePendingData(i), a(\"An error occured while the creation of your particle system. Check if your type '\" + t + \"' exists.\");\n              });\n            });\n          }, r.ExportSet = function(t) {\n            for (var e = new da(), n = 0, i = t; n < i.length; n++) {\n              var o = i[n];\n              e.systems.push(o);\n            }\n            return e;\n          }, r.ParseFromFileAsync = function(t, e, n, i, o) {\n            return i === void 0 && (i = !1), o === void 0 && (o = \"\"), new Promise(function(a, s) {\n              var d = new re.a();\n              d.addEventListener(\"readystatechange\", function() {\n                if (d.readyState == 4)\n                  if (d.status == 200) {\n                    var p = JSON.parse(d.responseText), y = void 0;\n                    y = i ? Ji.Parse(p, n, o) : cn.Parse(p, n, o), t && (y.name = t), a(y);\n                  } else\n                    s(\"Unable to load the particle system\");\n              }), d.open(\"GET\", e), d.send();\n            });\n          }, r.CreateFromSnippetAsync = function(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = !1), i === void 0 && (i = \"\"), t === \"_BLANK\") {\n              var a = this.CreateDefault(null);\n              return a.start(), Promise.resolve(a);\n            }\n            return new Promise(function(s, d) {\n              var p = new re.a();\n              p.addEventListener(\"readystatechange\", function() {\n                if (p.readyState == 4)\n                  if (p.status == 200) {\n                    var y = JSON.parse(JSON.parse(p.responseText).jsonPayload), P = JSON.parse(y.particleSystem), R = void 0;\n                    (R = n ? Ji.Parse(P, e, i) : cn.Parse(P, e, i)).snippetId = t, s(R);\n                  } else\n                    d(\"Unable to load the snippet \" + t);\n              }), p.open(\"GET\", o.SnippetUrl + \"/\" + t.replace(/#/g, \"/\")), p.send();\n            });\n          }, r.BaseAssetsUrl = da.BaseAssetsUrl, r.SnippetUrl = \"https://snippet.babylonjs.com\", r;\n        }();\n        V.a.AddParser(ot.a.NAME_PARTICLESYSTEM, function(r, t, e, n) {\n          var i = V.a.GetIndividualParser(ot.a.NAME_PARTICLESYSTEM);\n          if (i && r.particleSystems !== void 0 && r.particleSystems !== null)\n            for (var o = 0, a = r.particleSystems.length; o < a; o++) {\n              var s = r.particleSystems[o];\n              e.particleSystems.push(i(s, t, n));\n            }\n        }), V.a.AddIndividualParser(ot.a.NAME_PARTICLESYSTEM, function(r, t, e) {\n          return r.activeParticleCount ? Ji.Parse(r, t, e) : cn.Parse(r, t, e);\n        }), Ue.a.prototype.createEffectForParticles = function(r, t, e, n, i, o, a, s) {\n          var d;\n          t === void 0 && (t = []), e === void 0 && (e = []), n === void 0 && (n = \"\");\n          var p = [], y = [], P = [];\n          return s ? s.fillUniformsAttributesAndSamplerNames(y, p, P) : (p = cn._GetAttributeNamesOrOptions(), y = cn._GetEffectCreationOptions()), n.indexOf(\" BILLBOARD\") === -1 && (n += `\n#define BILLBOARD\n`), e.indexOf(\"diffuseSampler\") === -1 && e.push(\"diffuseSampler\"), this.createEffect({ vertex: (d = s == null ? void 0 : s.vertexShaderName) !== null && d !== void 0 ? d : \"particles\", fragmentElement: r }, p, y.concat(t), P.concat(e), n, i, o, a);\n        }, Ie.a.prototype.getEmittedParticleSystems = function() {\n          for (var r = new Array(), t = 0; t < this.getScene().particleSystems.length; t++) {\n            var e = this.getScene().particleSystems[t];\n            e.emitter === this && r.push(e);\n          }\n          return r;\n        }, Ie.a.prototype.getHierarchyEmittedParticleSystems = function() {\n          var r = new Array(), t = this.getDescendants();\n          t.push(this);\n          for (var e = 0; e < this.getScene().particleSystems.length; e++) {\n            var n = this.getScene().particleSystems[e], i = n.emitter;\n            i.position && t.indexOf(i) !== -1 && r.push(n);\n          }\n          return r;\n        };\n        var bn, yc = function() {\n          function r(t, e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = null), y === void 0 && (y = null), this.idx = 0, this.id = 0, this.color = new I.b(1, 1, 1, 1), this.position = u.e.Zero(), this.rotation = u.e.Zero(), this.scaling = u.e.One(), this.uvs = new u.f(0, 0, 1, 1), this.velocity = u.e.Zero(), this.pivot = u.e.Zero(), this.translateFromPivot = !1, this.alive = !0, this.isVisible = !0, this._pos = 0, this._ind = 0, this.shapeId = 0, this.idxInShape = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this.materialIndex = null, this.props = null, this.cullingStrategy = Mt.a.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY, this._globalPosition = u.e.Zero(), this.idx = t, this.id = e, this._pos = n, this._ind = i, this._model = o, this.shapeId = a, this.idxInShape = s, this._sps = d, p && (this._modelBoundingInfo = p, this._boundingInfo = new Ii.a(p.minimum, p.maximum)), y !== null && (this.materialIndex = y);\n          }\n          return r.prototype.copyToRef = function(t) {\n            return t.position.copyFrom(this.position), t.rotation.copyFrom(this.rotation), this.rotationQuaternion && (t.rotationQuaternion ? t.rotationQuaternion.copyFrom(this.rotationQuaternion) : t.rotationQuaternion = this.rotationQuaternion.clone()), t.scaling.copyFrom(this.scaling), this.color && (t.color ? t.color.copyFrom(this.color) : t.color = this.color.clone()), t.uvs.copyFrom(this.uvs), t.velocity.copyFrom(this.velocity), t.pivot.copyFrom(this.pivot), t.translateFromPivot = this.translateFromPivot, t.alive = this.alive, t.isVisible = this.isVisible, t.parentId = this.parentId, t.cullingStrategy = this.cullingStrategy, this.materialIndex !== null && (t.materialIndex = this.materialIndex), this;\n          }, Object.defineProperty(r.prototype, \"scale\", { get: function() {\n            return this.scaling;\n          }, set: function(t) {\n            this.scaling = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"quaternion\", { get: function() {\n            return this.rotationQuaternion;\n          }, set: function(t) {\n            this.rotationQuaternion = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.intersectsMesh = function(t) {\n            return !(!this._boundingInfo || !t._boundingInfo) && (this._sps._bSphereOnly ? Nl.a.Intersects(this._boundingInfo.boundingSphere, t._boundingInfo.boundingSphere) : this._boundingInfo.intersects(t._boundingInfo, !1));\n          }, r.prototype.isInFrustum = function(t) {\n            return this._boundingInfo !== null && this._boundingInfo.isInFrustum(t, this.cullingStrategy);\n          }, r.prototype.getRotationMatrix = function(t) {\n            var e;\n            if (this.rotationQuaternion)\n              e = this.rotationQuaternion;\n            else {\n              e = u.c.Quaternion[0];\n              var n = this.rotation;\n              u.b.RotationYawPitchRollToRef(n.y, n.x, n.z, e);\n            }\n            e.toRotationMatrix(t);\n          }, r;\n        }(), bc = function(r, t, e, n, i, o, a, s, d) {\n          this._indicesLength = 0, this.shapeID = r, this._shape = t, this._indices = e, this._indicesLength = e.length, this._shapeUV = o, this._shapeColors = i, this._normals = n, this._positionFunction = a, this._vertexFunction = s, this._material = d;\n        }, cd = function(r, t, e, n) {\n          this.idx = 0, this.ind = 0, this.indicesLength = 0, this.sqDistance = 0, this.materialIndex = 0, this.idx = r, this.ind = t, this.indicesLength = e, this.materialIndex = n;\n        }, ld = function() {\n          function r() {\n            this.position = u.e.Zero(), this.color = new I.b(1, 1, 1, 1), this.uv = u.d.Zero();\n          }\n          return Object.defineProperty(r.prototype, \"x\", { get: function() {\n            return this.position.x;\n          }, set: function(t) {\n            this.position.x = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"y\", { get: function() {\n            return this.position.y;\n          }, set: function(t) {\n            this.position.y = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"z\", { get: function() {\n            return this.position.z;\n          }, set: function(t) {\n            this.position.z = t;\n          }, enumerable: !1, configurable: !0 }), r;\n        }(), ym = function() {\n          function r(t, e, n) {\n            this.particles = new Array(), this.nbParticles = 0, this.billboard = !1, this.recomputeNormals = !1, this.counter = 0, this.vars = {}, this._bSphereOnly = !1, this._bSphereRadiusFactor = 1, this._positions = new Array(), this._indices = new Array(), this._normals = new Array(), this._colors = new Array(), this._uvs = new Array(), this._index = 0, this._updatable = !0, this._pickable = !1, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._depthSort = !1, this._expandable = !1, this._shapeCounter = 0, this._copy = new yc(0, 0, 0, 0, null, 0, 0, this), this._color = new I.b(0, 0, 0, 0), this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeParticleVertex = !1, this._computeBoundingBox = !1, this._depthSortParticles = !0, this._mustUnrotateFixedNormals = !1, this._particlesIntersect = !1, this._needs32Bits = !1, this._isNotBuilt = !0, this._lastParticleId = 0, this._idxOfId = [], this._multimaterialEnabled = !1, this._useModelMaterial = !1, this._depthSortFunction = function(i, o) {\n              return o.sqDistance - i.sqDistance;\n            }, this._materialSortFunction = function(i, o) {\n              return i.materialIndex - o.materialIndex;\n            }, this._autoUpdateSubMeshes = !1, this.name = t, this._scene = e || te.a.LastCreatedScene, this._camera = e.activeCamera, this._pickable = !!n && n.isPickable, this._depthSort = !!n && n.enableDepthSort, this._multimaterialEnabled = !!n && n.enableMultiMaterial, this._useModelMaterial = !!n && n.useModelMaterial, this._multimaterialEnabled = !!this._useModelMaterial || this._multimaterialEnabled, this._expandable = !!n && n.expandable, this._particlesIntersect = !!n && n.particleIntersection, this._bSphereOnly = !!n && n.boundingSphereOnly, this._bSphereRadiusFactor = n && n.bSphereRadiusFactor ? n.bSphereRadiusFactor : 1, n && n.updatable !== void 0 ? this._updatable = n.updatable : this._updatable = !0, this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]), (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []), this._multimaterialEnabled && (this._multimaterial = new qi.a(this.name + \"MultiMaterial\", this._scene), this._materials = [], this._materialIndexesById = {}), this._tmpVertex = new ld();\n          }\n          return r.prototype.buildMesh = function() {\n            if (!this._isNotBuilt && this.mesh)\n              return this.mesh;\n            if (this.nbParticles === 0 && !this.mesh) {\n              var t = ha.CreateDisc(\"\", { radius: 1, tessellation: 3 }, this._scene);\n              this.addShape(t, 1), t.dispose();\n            }\n            if (this._indices32 = this._needs32Bits ? new Uint32Array(this._indices) : new Uint16Array(this._indices), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors), !this.mesh) {\n              var e = new Ie.a(this.name, this._scene);\n              this.mesh = e;\n            }\n            !this._updatable && this._multimaterialEnabled && this._sortParticlesByMaterial(), this.recomputeNormals && ht.a.ComputeNormals(this._positions32, this._indices32, this._normals), this._normals32 = new Float32Array(this._normals), this._fixedNormal32 = new Float32Array(this._normals), this._mustUnrotateFixedNormals && this._unrotateFixedNormals();\n            var n = new ht.a();\n            if (n.indices = this._depthSort ? this._indices : this._indices32, n.set(this._positions32, Oe.b.PositionKind), n.set(this._normals32, Oe.b.NormalKind), this._uvs32.length > 0 && n.set(this._uvs32, Oe.b.UVKind), this._colors32.length > 0 && n.set(this._colors32, Oe.b.ColorKind), n.applyToMesh(this.mesh, this._updatable), this.mesh.isPickable = this._pickable, this._pickable) {\n              for (var i = 0, o = 0; o < this.nbParticles; o++)\n                for (var a = this.particles[o], s = a._model._indicesLength, d = 0; d < s; d++)\n                  if (d % 3 == 0) {\n                    var p = { idx: a.idx, faceId: i };\n                    this.pickedParticles[i] = p, i++;\n                  }\n            }\n            return this._multimaterialEnabled && this.setMultiMaterial(this._materials), this._expandable || (this._depthSort || this._multimaterialEnabled || (this._indices = null), this._positions = null, this._normals = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0)), this._isNotBuilt = !1, this.recomputeNormals = !1, this.mesh;\n          }, r.prototype.digest = function(t, e) {\n            var n = e && e.facetNb || 1, i = e && e.number || 0, o = e && e.delta || 0, a = t.getVerticesData(Oe.b.PositionKind), s = t.getIndices(), d = t.getVerticesData(Oe.b.UVKind), p = t.getVerticesData(Oe.b.ColorKind), y = t.getVerticesData(Oe.b.NormalKind), P = e && e.storage ? e.storage : null, R = 0, B = s.length / 3;\n            i ? (i = i > B ? B : i, n = Math.round(B / i), o = 0) : n = n > B ? B : n;\n            for (var F = [], z = [], J = [], ie = [], se = [], ce = u.e.Zero(), ue = n; R < B; ) {\n              R > B - (n = ue + Math.floor((1 + o) * Math.random())) && (n = B - R), F.length = 0, z.length = 0, J.length = 0, ie.length = 0, se.length = 0;\n              for (var fe = 0, ve = 3 * R; ve < 3 * (R + n); ve++) {\n                J.push(fe);\n                var Te = s[ve], Re = 3 * Te;\n                if (F.push(a[Re], a[Re + 1], a[Re + 2]), z.push(y[Re], y[Re + 1], y[Re + 2]), d) {\n                  var Ae = 2 * Te;\n                  ie.push(d[Ae], d[Ae + 1]);\n                }\n                if (p) {\n                  var Ee = 4 * Te;\n                  se.push(p[Ee], p[Ee + 1], p[Ee + 2], p[Ee + 3]);\n                }\n                fe++;\n              }\n              var Se, De = this.nbParticles, xe = this._posToShape(F), Le = this._uvsToShapeUV(ie), Me = Xe.b.Slice(J), we = Xe.b.Slice(se), Ye = Xe.b.Slice(z);\n              for (ce.copyFromFloats(0, 0, 0), Se = 0; Se < xe.length; Se++)\n                ce.addInPlace(xe[Se]);\n              ce.scaleInPlace(1 / xe.length);\n              var et, nt = new u.e(1 / 0, 1 / 0, 1 / 0), ct = new u.e(-1 / 0, -1 / 0, -1 / 0);\n              for (Se = 0; Se < xe.length; Se++)\n                xe[Se].subtractInPlace(ce), nt.minimizeInPlaceFromFloats(xe[Se].x, xe[Se].y, xe[Se].z), ct.maximizeInPlaceFromFloats(xe[Se].x, xe[Se].y, xe[Se].z);\n              this._particlesIntersect && (et = new Ii.a(nt, ct));\n              var Ke = null;\n              this._useModelMaterial && (Ke = t.material ? t.material : this._setDefaultMaterial());\n              var rt = new bc(this._shapeCounter, xe, Me, Ye, we, Le, null, null, Ke), it = this._positions.length, qe = this._indices.length;\n              this._meshBuilder(this._index, qe, xe, this._positions, Me, this._indices, ie, this._uvs, we, this._colors, Ye, this._normals, De, 0, null, rt), this._addParticle(De, this._lastParticleId, it, qe, rt, this._shapeCounter, 0, et, P), this.particles[this.nbParticles].position.addInPlace(ce), P || (this._index += xe.length, De++, this.nbParticles++, this._lastParticleId++), this._shapeCounter++, R += n;\n            }\n            return this._isNotBuilt = !0, this;\n          }, r.prototype._unrotateFixedNormals = function() {\n            for (var t = 0, e = 0, n = u.c.Vector3[0], i = u.c.Quaternion[0], o = u.c.Matrix[0], a = 0; a < this.particles.length; a++) {\n              var s = this.particles[a], d = s._model._shape;\n              if (s.rotationQuaternion)\n                s.rotationQuaternion.conjugateToRef(i);\n              else {\n                var p = s.rotation;\n                u.b.RotationYawPitchRollToRef(p.y, p.x, p.z, i), i.conjugateInPlace();\n              }\n              i.toRotationMatrix(o);\n              for (var y = 0; y < d.length; y++)\n                e = t + 3 * y, u.e.TransformNormalFromFloatsToRef(this._normals32[e], this._normals32[e + 1], this._normals32[e + 2], o, n), n.toArray(this._fixedNormal32, e);\n              t = e + 3;\n            }\n          }, r.prototype._resetCopy = function() {\n            var t = this._copy;\n            t.position.setAll(0), t.rotation.setAll(0), t.rotationQuaternion = null, t.scaling.setAll(1), t.uvs.copyFromFloats(0, 0, 1, 1), t.color = null, t.translateFromPivot = !1, t.shapeId = 0, t.materialIndex = null;\n          }, r.prototype._meshBuilder = function(t, e, n, i, o, a, s, d, p, y, P, R, B, F, z, J) {\n            var ie, se = 0, ce = 0, ue = 0;\n            this._resetCopy();\n            var fe = this._copy, ve = !(!z || !z.storage);\n            if (fe.idx = B, fe.idxInShape = F, fe.shapeId = J.shapeID, this._useModelMaterial) {\n              var Te = J._material.uniqueId, Re = this._materialIndexesById;\n              Re.hasOwnProperty(Te) || (Re[Te] = this._materials.length, this._materials.push(J._material));\n              var Ae = Re[Te];\n              fe.materialIndex = Ae;\n            }\n            if (z && z.positionFunction && (z.positionFunction(fe, B, F), this._mustUnrotateFixedNormals = !0), ve)\n              return fe;\n            var Ee = u.c.Matrix[0], Se = this._tmpVertex, De = Se.position, xe = Se.color, Le = Se.uv, Me = u.c.Vector3[1], we = u.c.Vector3[2], Ye = u.c.Vector3[3];\n            u.a.IdentityToRef(Ee), fe.getRotationMatrix(Ee), fe.pivot.multiplyToRef(fe.scaling, Ye), fe.translateFromPivot ? we.setAll(0) : we.copyFrom(Ye);\n            var et = z && z.vertexFunction;\n            for (ie = 0; ie < n.length; ie++) {\n              if (De.copyFrom(n[ie]), fe.color && xe.copyFrom(fe.color), s && Le.copyFromFloats(s[se], s[se + 1]), et && z.vertexFunction(fe, Se, ie), De.multiplyInPlace(fe.scaling).subtractInPlace(Ye), u.e.TransformCoordinatesToRef(De, Ee, Me), Me.addInPlace(we).addInPlace(fe.position), i.push(Me.x, Me.y, Me.z), s) {\n                var nt = fe.uvs;\n                d.push((nt.z - nt.x) * Le.x + nt.x, (nt.w - nt.y) * Le.y + nt.y), se += 2;\n              }\n              if (fe.color)\n                this._color.copyFrom(xe);\n              else {\n                var ct = this._color;\n                p && p[ce] !== void 0 ? (ct.r = p[ce], ct.g = p[ce + 1], ct.b = p[ce + 2], ct.a = p[ce + 3]) : (ct.r = 1, ct.g = 1, ct.b = 1, ct.a = 1);\n              }\n              y.push(this._color.r, this._color.g, this._color.b, this._color.a), ce += 4, !this.recomputeNormals && P && (u.e.TransformNormalFromFloatsToRef(P[ue], P[ue + 1], P[ue + 2], Ee, De), R.push(De.x, De.y, De.z), ue += 3);\n            }\n            for (ie = 0; ie < o.length; ie++) {\n              var Ke = t + o[ie];\n              a.push(Ke), Ke > 65535 && (this._needs32Bits = !0);\n            }\n            if (this._depthSort || this._multimaterialEnabled) {\n              var rt = fe.materialIndex !== null ? fe.materialIndex : 0;\n              this.depthSortedParticles.push(new cd(B, e, o.length, rt));\n            }\n            return fe;\n          }, r.prototype._posToShape = function(t) {\n            for (var e = [], n = 0; n < t.length; n += 3)\n              e.push(u.e.FromArray(t, n));\n            return e;\n          }, r.prototype._uvsToShapeUV = function(t) {\n            var e = [];\n            if (t)\n              for (var n = 0; n < t.length; n++)\n                e.push(t[n]);\n            return e;\n          }, r.prototype._addParticle = function(t, e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = null), p === void 0 && (p = null);\n            var y = new yc(t, e, n, i, o, a, s, this, d);\n            return (p || this.particles).push(y), y;\n          }, r.prototype.addShape = function(t, e, n) {\n            var i = t.getVerticesData(Oe.b.PositionKind), o = t.getIndices(), a = t.getVerticesData(Oe.b.UVKind), s = t.getVerticesData(Oe.b.ColorKind), d = t.getVerticesData(Oe.b.NormalKind);\n            this.recomputeNormals = !d;\n            var p = Xe.b.SliceToArray(o), y = Xe.b.SliceToArray(d), P = s ? Xe.b.SliceToArray(s) : [], R = n && n.storage ? n.storage : null, B = null;\n            this._particlesIntersect && (B = t.getBoundingInfo());\n            var F = this._posToShape(i), z = this._uvsToShapeUV(a), J = n ? n.positionFunction : null, ie = n ? n.vertexFunction : null, se = null;\n            this._useModelMaterial && (se = t.material ? t.material : this._setDefaultMaterial());\n            for (var ce = new bc(this._shapeCounter, F, p, y, P, z, J, ie, se), ue = 0; ue < e; ue++)\n              this._insertNewParticle(this.nbParticles, ue, ce, F, o, a, s, d, B, R, n);\n            return this._shapeCounter++, this._isNotBuilt = !0, this._shapeCounter - 1;\n          }, r.prototype._rebuildParticle = function(t, e) {\n            e === void 0 && (e = !1), this._resetCopy();\n            var n = this._copy;\n            t._model._positionFunction && t._model._positionFunction(n, t.idx, t.idxInShape);\n            var i = u.c.Matrix[0], o = u.c.Vector3[0], a = u.c.Vector3[1], s = u.c.Vector3[2], d = u.c.Vector3[3];\n            n.getRotationMatrix(i), t.pivot.multiplyToRef(t.scaling, d), n.translateFromPivot ? s.copyFromFloats(0, 0, 0) : s.copyFrom(d);\n            for (var p = t._model._shape, y = 0; y < p.length; y++)\n              o.copyFrom(p[y]), t._model._vertexFunction && t._model._vertexFunction(n, o, y), o.multiplyInPlace(n.scaling).subtractInPlace(d), u.e.TransformCoordinatesToRef(o, i, a), a.addInPlace(s).addInPlace(n.position).toArray(this._positions32, t._pos + 3 * y);\n            e && (t.position.setAll(0), t.rotation.setAll(0), t.rotationQuaternion = null, t.scaling.setAll(1), t.uvs.setAll(0), t.pivot.setAll(0), t.translateFromPivot = !1, t.parentId = null);\n          }, r.prototype.rebuildMesh = function(t) {\n            t === void 0 && (t = !1);\n            for (var e = 0; e < this.particles.length; e++)\n              this._rebuildParticle(this.particles[e], t);\n            return this.mesh.updateVerticesData(Oe.b.PositionKind, this._positions32, !1, !1), this;\n          }, r.prototype.removeParticles = function(t, e) {\n            var n = e - t + 1;\n            if (!this._expandable || n <= 0 || n >= this.nbParticles || !this._updatable)\n              return [];\n            var i = this.particles, o = this.nbParticles;\n            if (e < o - 1)\n              for (var a = e + 1, s = i[a]._pos - i[t]._pos, d = i[a]._ind - i[t]._ind, p = a; p < o; p++) {\n                var y = i[p];\n                y._pos -= s, y._ind -= d;\n              }\n            var P = i.splice(t, n);\n            this._positions.length = 0, this._indices.length = 0, this._colors.length = 0, this._uvs.length = 0, this._normals.length = 0, this._index = 0, this._idxOfId.length = 0, (this._depthSort || this._multimaterialEnabled) && (this.depthSortedParticles = []);\n            for (var R = 0, B = i.length, F = 0; F < B; F++) {\n              var z = i[F], J = z._model, ie = J._shape, se = J._indices, ce = J._normals, ue = J._shapeColors, fe = J._shapeUV;\n              z.idx = F, this._idxOfId[z.id] = F, this._meshBuilder(this._index, R, ie, this._positions, se, this._indices, fe, this._uvs, ue, this._colors, ce, this._normals, z.idx, z.idxInShape, null, J), this._index += ie.length, R += se.length;\n            }\n            return this.nbParticles -= n, this._isNotBuilt = !0, P;\n          }, r.prototype.insertParticlesFromArray = function(t) {\n            if (!this._expandable)\n              return this;\n            for (var e = 0, n = t[0].shapeId, i = t.length, o = 0; o < i; o++) {\n              var a = t[o], s = a._model, d = s._shape, p = s._indices, y = s._shapeUV, P = s._shapeColors, R = s._normals, B = !R;\n              this.recomputeNormals = B || this.recomputeNormals;\n              var F = a._boundingInfo, z = this._insertNewParticle(this.nbParticles, e, s, d, p, y, P, R, F, null, null);\n              a.copyToRef(z), e++, n != a.shapeId && (n = a.shapeId, e = 0);\n            }\n            return this._isNotBuilt = !0, this;\n          }, r.prototype._insertNewParticle = function(t, e, n, i, o, a, s, d, p, y, P) {\n            var R = this._positions.length, B = this._indices.length, F = this._meshBuilder(this._index, B, i, this._positions, o, this._indices, a, this._uvs, s, this._colors, d, this._normals, t, e, P, n), z = null;\n            return this._updatable && ((z = this._addParticle(this.nbParticles, this._lastParticleId, R, B, n, this._shapeCounter, e, p, y)).position.copyFrom(F.position), z.rotation.copyFrom(F.rotation), F.rotationQuaternion && (z.rotationQuaternion ? z.rotationQuaternion.copyFrom(F.rotationQuaternion) : z.rotationQuaternion = F.rotationQuaternion.clone()), F.color && (z.color ? z.color.copyFrom(F.color) : z.color = F.color.clone()), z.scaling.copyFrom(F.scaling), z.uvs.copyFrom(F.uvs), F.materialIndex !== null && (z.materialIndex = F.materialIndex), this.expandable && (this._idxOfId[z.id] = z.idx)), y || (this._index += i.length, this.nbParticles++, this._lastParticleId++), z;\n          }, r.prototype.setParticles = function(t, e, n) {\n            if (t === void 0 && (t = 0), e === void 0 && (e = this.nbParticles - 1), n === void 0 && (n = !0), !this._updatable || this._isNotBuilt)\n              return this;\n            this.beforeUpdateParticles(t, e, n);\n            var i = u.c.Matrix[0], o = u.c.Matrix[1], a = this.mesh, s = this._colors32, d = this._positions32, p = this._normals32, y = this._uvs32, P = this._indices32, R = this._indices, B = this._fixedNormal32, F = u.c.Vector3, z = F[5].copyFromFloats(1, 0, 0), J = F[6].copyFromFloats(0, 1, 0), ie = F[7].copyFromFloats(0, 0, 1), se = F[8].setAll(Number.MAX_VALUE), ce = F[9].setAll(-Number.MAX_VALUE), ue = F[10].setAll(0), fe = this._tmpVertex, ve = fe.position, Te = fe.color, Re = fe.uv;\n            if ((this.billboard || this._depthSort) && (this.mesh.computeWorldMatrix(!0), this.mesh._worldMatrix.invertToRef(o)), this.billboard) {\n              var Ae = F[0];\n              this._camera.getDirectionToRef(be.a.Z, Ae), u.e.TransformNormalToRef(Ae, o, ie), ie.normalize();\n              var Ee = this._camera.getViewMatrix(!0);\n              u.e.TransformNormalFromFloatsToRef(Ee.m[1], Ee.m[5], Ee.m[9], o, J), u.e.CrossToRef(J, ie, z), J.normalize(), z.normalize();\n            }\n            this._depthSort && u.e.TransformCoordinatesToRef(this._camera.globalPosition, o, ue), u.a.IdentityToRef(i);\n            var Se = 0, De = 0, xe = 0, Le = 0, Me = 0, we = 0, Ye = 0;\n            if (this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), e = e >= this.nbParticles ? this.nbParticles - 1 : e, this._computeBoundingBox && (t != 0 || e != this.nbParticles - 1)) {\n              var et = this.mesh._boundingInfo;\n              et && (se.copyFrom(et.minimum), ce.copyFrom(et.maximum));\n            }\n            var nt = (De = this.particles[t]._pos) / 3 | 0;\n            Le = 4 * nt, we = 2 * nt;\n            for (var ct = t; ct <= e; ct++) {\n              var Ke = this.particles[ct];\n              this.updateParticle(Ke);\n              var rt = Ke._model._shape, it = Ke._model._shapeUV, qe = Ke._rotationMatrix, ut = Ke.position, Ve = Ke.rotation, Ze = Ke.scaling, vt = Ke._globalPosition;\n              if (this._depthSort && this._depthSortParticles) {\n                var jt = this.depthSortedParticles[ct];\n                jt.idx = Ke.idx, jt.ind = Ke._ind, jt.indicesLength = Ke._model._indicesLength, jt.sqDistance = u.e.DistanceSquared(Ke.position, ue);\n              }\n              if (!Ke.alive || Ke._stillInvisible && !Ke.isVisible)\n                De += 3 * (Ye = rt.length), Le += 4 * Ye, we += 2 * Ye;\n              else {\n                if (Ke.isVisible) {\n                  Ke._stillInvisible = !1;\n                  var Dt = F[12];\n                  if (Ke.pivot.multiplyToRef(Ze, Dt), this.billboard && (Ve.x = 0, Ve.y = 0), (this._computeParticleRotation || this.billboard) && Ke.getRotationMatrix(i), Ke.parentId !== null) {\n                    var Yt = this.getParticleById(Ke.parentId);\n                    if (Yt) {\n                      var mt = Yt._rotationMatrix, qt = Yt._globalPosition, Ht = ut.x * mt[1] + ut.y * mt[4] + ut.z * mt[7], kt = ut.x * mt[0] + ut.y * mt[3] + ut.z * mt[6], Wt = ut.x * mt[2] + ut.y * mt[5] + ut.z * mt[8];\n                      if (vt.x = qt.x + kt, vt.y = qt.y + Ht, vt.z = qt.z + Wt, this._computeParticleRotation || this.billboard) {\n                        var bt = i.m;\n                        qe[0] = bt[0] * mt[0] + bt[1] * mt[3] + bt[2] * mt[6], qe[1] = bt[0] * mt[1] + bt[1] * mt[4] + bt[2] * mt[7], qe[2] = bt[0] * mt[2] + bt[1] * mt[5] + bt[2] * mt[8], qe[3] = bt[4] * mt[0] + bt[5] * mt[3] + bt[6] * mt[6], qe[4] = bt[4] * mt[1] + bt[5] * mt[4] + bt[6] * mt[7], qe[5] = bt[4] * mt[2] + bt[5] * mt[5] + bt[6] * mt[8], qe[6] = bt[8] * mt[0] + bt[9] * mt[3] + bt[10] * mt[6], qe[7] = bt[8] * mt[1] + bt[9] * mt[4] + bt[10] * mt[7], qe[8] = bt[8] * mt[2] + bt[9] * mt[5] + bt[10] * mt[8];\n                      }\n                    } else\n                      Ke.parentId = null;\n                  } else\n                    vt.x = ut.x, vt.y = ut.y, vt.z = ut.z, (this._computeParticleRotation || this.billboard) && (bt = i.m, qe[0] = bt[0], qe[1] = bt[1], qe[2] = bt[2], qe[3] = bt[4], qe[4] = bt[5], qe[5] = bt[6], qe[6] = bt[8], qe[7] = bt[9], qe[8] = bt[10]);\n                  var Rt = F[11];\n                  for (Ke.translateFromPivot ? Rt.setAll(0) : Rt.copyFrom(Dt), Ye = 0; Ye < rt.length; Ye++) {\n                    Se = De + 3 * Ye, xe = Le + 4 * Ye, Me = we + 2 * Ye;\n                    var Zt = 2 * Ye, Mn = Zt + 1;\n                    ve.copyFrom(rt[Ye]), this._computeParticleColor && Ke.color && Te.copyFrom(Ke.color), this._computeParticleTexture && Re.copyFromFloats(it[Zt], it[Mn]), this._computeParticleVertex && this.updateParticleVertex(Ke, fe, Ye);\n                    var Bn = ve.x * Ze.x - Dt.x, Kn = ve.y * Ze.y - Dt.y, In = ve.z * Ze.z - Dt.z;\n                    kt = Bn * qe[0] + Kn * qe[3] + In * qe[6], Ht = Bn * qe[1] + Kn * qe[4] + In * qe[7], Wt = Bn * qe[2] + Kn * qe[5] + In * qe[8], kt += Rt.x, Ht += Rt.y, Wt += Rt.z;\n                    var Kt = d[Se] = vt.x + z.x * kt + J.x * Ht + ie.x * Wt, oi = d[Se + 1] = vt.y + z.y * kt + J.y * Ht + ie.y * Wt, Ti = d[Se + 2] = vt.z + z.z * kt + J.z * Ht + ie.z * Wt;\n                    if (this._computeBoundingBox && (se.minimizeInPlaceFromFloats(Kt, oi, Ti), ce.maximizeInPlaceFromFloats(Kt, oi, Ti)), !this._computeParticleVertex) {\n                      var Lr = B[Se], Nr = B[Se + 1], ai = B[Se + 2], Fi = Lr * qe[0] + Nr * qe[3] + ai * qe[6], wr = Lr * qe[1] + Nr * qe[4] + ai * qe[7], Gt = Lr * qe[2] + Nr * qe[5] + ai * qe[8];\n                      p[Se] = z.x * Fi + J.x * wr + ie.x * Gt, p[Se + 1] = z.y * Fi + J.y * wr + ie.y * Gt, p[Se + 2] = z.z * Fi + J.z * wr + ie.z * Gt;\n                    }\n                    if (this._computeParticleColor && Ke.color) {\n                      var Bi = this._colors32;\n                      Bi[xe] = Te.r, Bi[xe + 1] = Te.g, Bi[xe + 2] = Te.b, Bi[xe + 3] = Te.a;\n                    }\n                    if (this._computeParticleTexture) {\n                      var Tn = Ke.uvs;\n                      y[Me] = Re.x * (Tn.z - Tn.x) + Tn.x, y[Me + 1] = Re.y * (Tn.w - Tn.y) + Tn.y;\n                    }\n                  }\n                } else\n                  for (Ke._stillInvisible = !0, Ye = 0; Ye < rt.length; Ye++) {\n                    if (xe = Le + 4 * Ye, Me = we + 2 * Ye, d[Se = De + 3 * Ye] = d[Se + 1] = d[Se + 2] = 0, p[Se] = p[Se + 1] = p[Se + 2] = 0, this._computeParticleColor && Ke.color) {\n                      var tr = Ke.color;\n                      s[xe] = tr.r, s[xe + 1] = tr.g, s[xe + 2] = tr.b, s[xe + 3] = tr.a;\n                    }\n                    this._computeParticleTexture && (Tn = Ke.uvs, y[Me] = it[2 * Ye] * (Tn.z - Tn.x) + Tn.x, y[Me + 1] = it[2 * Ye + 1] * (Tn.w - Tn.y) + Tn.y);\n                  }\n                if (this._particlesIntersect) {\n                  var Ei = Ke._boundingInfo, Ma = Ei.boundingBox, Ia = Ei.boundingSphere, Fr = Ke._modelBoundingInfo;\n                  if (!this._bSphereOnly) {\n                    var Ui = Fr.boundingBox.vectors, Vi = F[1], nr = F[2];\n                    Vi.setAll(Number.MAX_VALUE), nr.setAll(-Number.MAX_VALUE);\n                    for (var ki = 0; ki < 8; ki++) {\n                      var Br = Ui[ki].x * Ze.x, Ur = Ui[ki].y * Ze.y, Vr = Ui[ki].z * Ze.z, Gi = (kt = Br * qe[0] + Ur * qe[3] + Vr * qe[6], Ht = Br * qe[1] + Ur * qe[4] + Vr * qe[7], Wt = Br * qe[2] + Ur * qe[5] + Vr * qe[8], ut.x + z.x * kt + J.x * Ht + ie.x * Wt), zi = ut.y + z.y * kt + J.y * Ht + ie.y * Wt, kr = ut.z + z.z * kt + J.z * Ht + ie.z * Wt;\n                      Vi.minimizeInPlaceFromFloats(Gi, zi, kr), nr.maximizeInPlaceFromFloats(Gi, zi, kr);\n                    }\n                    Ma.reConstruct(Vi, nr, a._worldMatrix);\n                  }\n                  var Si = Fr.minimum.multiplyToRef(Ze, F[1]), Dn = Fr.maximum.multiplyToRef(Ze, F[2]), bo = Dn.addToRef(Si, F[3]).scaleInPlace(0.5).addInPlace(vt), ir = Dn.subtractToRef(Si, F[4]).scaleInPlace(0.5 * this._bSphereRadiusFactor), To = bo.subtractToRef(ir, F[1]), tv = bo.addToRef(ir, F[2]);\n                  Ia.reConstruct(To, tv, a._worldMatrix);\n                }\n                De = Se + 3, Le = xe + 4, we = Me + 2;\n              }\n            }\n            if (n) {\n              if (this._computeParticleColor && a.updateVerticesData(Oe.b.ColorKind, s, !1, !1), this._computeParticleTexture && a.updateVerticesData(Oe.b.UVKind, y, !1, !1), a.updateVerticesData(Oe.b.PositionKind, d, !1, !1), !a.areNormalsFrozen || a.isFacetDataEnabled) {\n                if (this._computeParticleVertex || a.isFacetDataEnabled) {\n                  var nv = a.isFacetDataEnabled ? a.getFacetDataParameters() : null;\n                  ht.a.ComputeNormals(d, P, p, nv);\n                  for (var Ai = 0; Ai < p.length; Ai++)\n                    B[Ai] = p[Ai];\n                }\n                a.areNormalsFrozen || a.updateVerticesData(Oe.b.NormalKind, p, !1, !1);\n              }\n              if (this._depthSort && this._depthSortParticles) {\n                var jc = this.depthSortedParticles;\n                jc.sort(this._depthSortFunction);\n                for (var iv = jc.length, nf = 0, Hc = 0, Wc = 0; Wc < iv; Wc++) {\n                  var Xc = jc[Wc], rv = Xc.indicesLength, ov = Xc.ind;\n                  for (Ai = 0; Ai < rv; Ai++)\n                    if (P[nf] = R[ov + Ai], nf++, this._pickable && Ai % 3 == 0) {\n                      var rf = this.pickedParticles[Hc];\n                      rf.idx = Xc.idx, rf.faceId = Hc, Hc++;\n                    }\n                }\n                a.updateIndices(P);\n              }\n            }\n            return this._computeBoundingBox && (a._boundingInfo ? a._boundingInfo.reConstruct(se, ce, a._worldMatrix) : a._boundingInfo = new Ii.a(se, ce, a._worldMatrix)), this._autoUpdateSubMeshes && this.computeSubMeshes(), this.afterUpdateParticles(t, e, n), this;\n          }, r.prototype.dispose = function() {\n            this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._normals32 = null, this._fixedNormal32 = null, this._uvs32 = null, this._colors32 = null, this.pickedParticles = null, this.pickedBySubMesh = null, this._materials = null, this._materialIndexes = null, this._indicesByMaterial = null, this._idxOfId = null;\n          }, r.prototype.pickedParticle = function(t) {\n            if (t.hit) {\n              var e = t.subMeshId, n = t.faceId, i = this.pickedBySubMesh;\n              if (i[e] && i[e][n])\n                return i[e][n];\n            }\n            return null;\n          }, r.prototype.getParticleById = function(t) {\n            var e = this.particles[t];\n            if (e && e.id == t)\n              return e;\n            var n = this.particles, i = this._idxOfId[t];\n            if (i !== void 0)\n              return n[i];\n            for (var o = 0, a = this.nbParticles; o < a; ) {\n              var s = n[o];\n              if (s.id == t)\n                return s;\n              o++;\n            }\n            return null;\n          }, r.prototype.getParticlesByShapeId = function(t) {\n            var e = [];\n            return this.getParticlesByShapeIdToRef(t, e), e;\n          }, r.prototype.getParticlesByShapeIdToRef = function(t, e) {\n            e.length = 0;\n            for (var n = 0; n < this.nbParticles; n++) {\n              var i = this.particles[n];\n              i.shapeId == t && e.push(i);\n            }\n            return this;\n          }, r.prototype.computeSubMeshes = function() {\n            if (!this.mesh || !this._multimaterialEnabled)\n              return this;\n            var t = this.depthSortedParticles;\n            if (this.particles.length > 0)\n              for (var e = 0; e < this.particles.length; e++) {\n                var n = this.particles[e];\n                n.materialIndex || (n.materialIndex = 0);\n                var i = t[e];\n                i.materialIndex = n.materialIndex, i.ind = n._ind, i.indicesLength = n._model._indicesLength, i.idx = n.idx;\n              }\n            this._sortParticlesByMaterial();\n            var o = this._indicesByMaterial, a = this._materialIndexes, s = this.mesh;\n            s.subMeshes = [];\n            for (var d = s.getTotalVertices(), p = 0; p < a.length; p++) {\n              var y = o[p], P = o[p + 1] - y, R = a[p];\n              new uo.a(R, 0, d, y, P, s);\n            }\n            return this;\n          }, r.prototype._sortParticlesByMaterial = function() {\n            var t = [0];\n            this._indicesByMaterial = t;\n            var e = [];\n            this._materialIndexes = e;\n            var n = this.depthSortedParticles;\n            n.sort(this._materialSortFunction);\n            var i = n.length, o = this._indices32, a = this._indices, s = 0, d = 0, p = 0, y = n[0].materialIndex;\n            e.push(y), this._pickable && (this.pickedBySubMesh = [[]], this.pickedParticles = this.pickedBySubMesh[0]);\n            for (var P = 0; P < i; P++) {\n              var R = n[P], B = R.indicesLength, F = R.ind;\n              R.materialIndex !== y && (y = R.materialIndex, t.push(p), e.push(y), this._pickable && (s++, this.pickedBySubMesh[s] = [], d = 0));\n              for (var z = 0, J = 0; J < B; J++) {\n                if (o[p] = a[F + J], this._pickable && J % 3 == 0) {\n                  var ie = this.pickedBySubMesh[s][d];\n                  ie ? (ie.idx = R.idx, ie.faceId = z) : this.pickedBySubMesh[s][d] = { idx: R.idx, faceId: z }, d++, z++;\n                }\n                p++;\n              }\n            }\n            return t.push(o.length), this._updatable && this.mesh.updateIndices(o), this;\n          }, r.prototype._setMaterialIndexesById = function() {\n            this._materialIndexesById = {};\n            for (var t = 0; t < this._materials.length; t++) {\n              var e = this._materials[t].uniqueId;\n              this._materialIndexesById[e] = t;\n            }\n          }, r.prototype._filterUniqueMaterialId = function(t) {\n            return t.filter(function(e, n, i) {\n              return i.indexOf(e) === n;\n            });\n          }, r.prototype._setDefaultMaterial = function() {\n            return this._defaultMaterial || (this._defaultMaterial = new Nt.a(this.name + \"DefaultMaterial\", this._scene)), this._defaultMaterial;\n          }, r.prototype.refreshVisibleSize = function() {\n            return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this;\n          }, r.prototype.setVisibilityBox = function(t) {\n            var e = t / 2;\n            this.mesh._boundingInfo = new Ii.a(new u.e(-e, -e, -e), new u.e(e, e, e));\n          }, Object.defineProperty(r.prototype, \"isAlwaysVisible\", { get: function() {\n            return this._alwaysVisible;\n          }, set: function(t) {\n            this._alwaysVisible = t, this.mesh.alwaysSelectAsActiveMesh = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isVisibilityBoxLocked\", { get: function() {\n            return this._isVisibilityBoxLocked;\n          }, set: function(t) {\n            this._isVisibilityBoxLocked = t, this.mesh.getBoundingInfo().isLocked = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleRotation\", { get: function() {\n            return this._computeParticleRotation;\n          }, set: function(t) {\n            this._computeParticleRotation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleColor\", { get: function() {\n            return this._computeParticleColor;\n          }, set: function(t) {\n            this._computeParticleColor = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleTexture\", { get: function() {\n            return this._computeParticleTexture;\n          }, set: function(t) {\n            this._computeParticleTexture = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleVertex\", { get: function() {\n            return this._computeParticleVertex;\n          }, set: function(t) {\n            this._computeParticleVertex = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeBoundingBox\", { get: function() {\n            return this._computeBoundingBox;\n          }, set: function(t) {\n            this._computeBoundingBox = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"depthSortParticles\", { get: function() {\n            return this._depthSortParticles;\n          }, set: function(t) {\n            this._depthSortParticles = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"expandable\", { get: function() {\n            return this._expandable;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"multimaterialEnabled\", { get: function() {\n            return this._multimaterialEnabled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useModelMaterial\", { get: function() {\n            return this._useModelMaterial;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"materials\", { get: function() {\n            return this._materials;\n          }, enumerable: !1, configurable: !0 }), r.prototype.setMultiMaterial = function(t) {\n            this._materials = this._filterUniqueMaterialId(t), this._setMaterialIndexesById(), this._multimaterial && this._multimaterial.dispose(), this._multimaterial = new qi.a(this.name + \"MultiMaterial\", this._scene);\n            for (var e = 0; e < this._materials.length; e++)\n              this._multimaterial.subMaterials.push(this._materials[e]);\n            this.computeSubMeshes(), this.mesh.material = this._multimaterial;\n          }, Object.defineProperty(r.prototype, \"multimaterial\", { get: function() {\n            return this._multimaterial;\n          }, set: function(t) {\n            this._multimaterial = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"autoUpdateSubMeshes\", { get: function() {\n            return this._autoUpdateSubMeshes;\n          }, set: function(t) {\n            this._autoUpdateSubMeshes = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.initParticles = function() {\n          }, r.prototype.recycleParticle = function(t) {\n            return t;\n          }, r.prototype.updateParticle = function(t) {\n            return t;\n          }, r.prototype.updateParticleVertex = function(t, e, n) {\n            return this;\n          }, r.prototype.beforeUpdateParticles = function(t, e, n) {\n          }, r.prototype.afterUpdateParticles = function(t, e, n) {\n          }, r;\n        }(), ud = function() {\n          function r(t, e, n, i, o) {\n            this.idx = 0, this.color = new I.b(1, 1, 1, 1), this.position = u.e.Zero(), this.rotation = u.e.Zero(), this.uv = new u.d(0, 0), this.velocity = u.e.Zero(), this.pivot = u.e.Zero(), this.translateFromPivot = !1, this._pos = 0, this._ind = 0, this.groupId = 0, this.idxInGroup = 0, this._stillInvisible = !1, this._rotationMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1], this.parentId = null, this._globalPosition = u.e.Zero(), this.idx = t, this._group = e, this.groupId = n, this.idxInGroup = i, this._pcs = o;\n          }\n          return Object.defineProperty(r.prototype, \"size\", { get: function() {\n            return this.size;\n          }, set: function(t) {\n            this.size = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"quaternion\", { get: function() {\n            return this.rotationQuaternion;\n          }, set: function(t) {\n            this.rotationQuaternion = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.intersectsMesh = function(t, e) {\n            if (!t._boundingInfo)\n              return !1;\n            if (e = e || !1)\n              return t.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));\n            var n, i, o, a, s, d;\n            n = t.getBoundingInfo().boundingBox.maximumWorld.x, i = t.getBoundingInfo().boundingBox.minimumWorld.x, o = t.getBoundingInfo().boundingBox.maximumWorld.y, a = t.getBoundingInfo().boundingBox.minimumWorld.y, s = t.getBoundingInfo().boundingBox.maximumWorld.z, d = t.getBoundingInfo().boundingBox.minimumWorld.z;\n            var p = this.position.x + this._pcs.mesh.position.x, y = this.position.y + this._pcs.mesh.position.y, P = this.position.z + this._pcs.mesh.position.z;\n            return i <= p && p <= n && a <= y && y <= o && d <= P && P <= s;\n          }, r.prototype.getRotationMatrix = function(t) {\n            var e;\n            if (this.rotationQuaternion)\n              e = this.rotationQuaternion;\n            else {\n              e = u.c.Quaternion[0];\n              var n = this.rotation;\n              u.b.RotationYawPitchRollToRef(n.y, n.x, n.z, e);\n            }\n            e.toRotationMatrix(t);\n          }, r;\n        }(), fa = function(r, t) {\n          this.groupID = r, this._positionFunction = t;\n        };\n        (function(r) {\n          r[r.Color = 2] = \"Color\", r[r.UV = 1] = \"UV\", r[r.Random = 0] = \"Random\", r[r.Stated = 3] = \"Stated\";\n        })(bn || (bn = {}));\n        var bm = function() {\n          function r(t, e, n, i) {\n            this.particles = new Array(), this.nbParticles = 0, this.counter = 0, this.vars = {}, this._promises = [], this._positions = new Array(), this._indices = new Array(), this._normals = new Array(), this._colors = new Array(), this._uvs = new Array(), this._updatable = !0, this._isVisibilityBoxLocked = !1, this._alwaysVisible = !1, this._groups = new Array(), this._groupCounter = 0, this._computeParticleColor = !0, this._computeParticleTexture = !0, this._computeParticleRotation = !0, this._computeBoundingBox = !1, this._isReady = !1, this.name = t, this._size = e, this._scene = n || te.a.LastCreatedScene, i && i.updatable !== void 0 ? this._updatable = i.updatable : this._updatable = !0;\n          }\n          return r.prototype.buildMeshAsync = function() {\n            var t = this;\n            return Promise.all(this._promises).then(function() {\n              return t._isReady = !0, t._buildMesh();\n            });\n          }, r.prototype._buildMesh = function() {\n            this.nbParticles === 0 && this.addPoints(1), this._positions32 = new Float32Array(this._positions), this._uvs32 = new Float32Array(this._uvs), this._colors32 = new Float32Array(this._colors);\n            var t = new ht.a();\n            t.set(this._positions32, Oe.b.PositionKind), this._uvs32.length > 0 && t.set(this._uvs32, Oe.b.UVKind);\n            var e = 0;\n            this._colors32.length > 0 && (e = 1, t.set(this._colors32, Oe.b.ColorKind));\n            var n = new Ie.a(this.name, this._scene);\n            t.applyToMesh(n, this._updatable), this.mesh = n, this._positions = null, this._uvs = null, this._colors = null, this._updatable || (this.particles.length = 0);\n            var i = new Nt.a(\"point cloud material\", this._scene);\n            return i.emissiveColor = new I.a(e, e, e), i.disableLighting = !0, i.pointsCloud = !0, i.pointSize = this._size, n.material = i, new Promise(function(o) {\n              return o(n);\n            });\n          }, r.prototype._addParticle = function(t, e, n, i) {\n            var o = new ud(t, e, n, i, this);\n            return this.particles.push(o), o;\n          }, r.prototype._randomUnitVector = function(t) {\n            t.position = new u.e(Math.random(), Math.random(), Math.random()), t.color = new I.b(1, 1, 1, 1);\n          }, r.prototype._getColorIndicesForCoord = function(t, e, n, i) {\n            var o = t._groupImageData, a = n * (4 * i) + 4 * e, s = [a, a + 1, a + 2, a + 3], d = s[1], p = s[2], y = s[3], P = o[s[0]], R = o[d], B = o[p], F = o[y];\n            return new I.b(P / 255, R / 255, B / 255, F);\n          }, r.prototype._setPointsColorOrUV = function(t, e, n, i, o, a, s) {\n            n && t.updateFacetData();\n            var d = 2 * t.getBoundingInfo().boundingSphere.radius, p = t.getVerticesData(Oe.b.PositionKind), y = t.getIndices(), P = t.getVerticesData(Oe.b.UVKind), R = t.getVerticesData(Oe.b.ColorKind), B = u.e.Zero();\n            t.computeWorldMatrix();\n            var F = t.getWorldMatrix();\n            if (!F.isIdentity())\n              for (var z = 0; z < p.length / 3; z++)\n                u.e.TransformCoordinatesFromFloatsToRef(p[3 * z], p[3 * z + 1], p[3 * z + 2], F, B), p[3 * z] = B.x, p[3 * z + 1] = B.y, p[3 * z + 2] = B.z;\n            var J, ie, se = 0, ce = 0, ue = 0, fe = 0, ve = 0, Te = 0, Re = 0, Ae = 0, Ee = 0, Se = 0, De = 0, xe = 0, Le = 0, Me = 0, we = u.e.Zero(), Ye = u.e.Zero(), et = u.e.Zero(), nt = u.e.Zero(), ct = u.e.Zero(), Ke = 0, rt = 0, it = 0, qe = 0, ut = 0, Ve = 0, Ze = u.d.Zero(), vt = u.d.Zero(), jt = u.d.Zero(), Dt = u.d.Zero(), Yt = u.d.Zero(), mt = 0, qt = 0, Ht = 0, kt = 0, Wt = 0, bt = 0, Rt = 0, Zt = 0, Mn = 0, Bn = 0, Kn = 0, In = 0, Kt = u.f.Zero(), oi = u.f.Zero(), Ti = u.f.Zero(), Lr = u.f.Zero(), Nr = u.f.Zero(), ai = 0, Fi = 0;\n            s = s || 0;\n            var wr, Gt = new u.f(0, 0, 0, 0), Bi = u.e.Zero(), Tn = u.e.Zero(), tr = u.e.Zero(), Ei = 0, Ma = u.e.Zero(), Ia = 0, Fr = 0, Ui = new dn.a(u.e.Zero(), new u.e(1, 0, 0)), Vi = u.e.Zero();\n            for (ce = 0; ce < y.length / 3; ce++) {\n              var nr, ki, Br, Ur, Vr, Gi, zi, kr;\n              ue = y[3 * ce], fe = y[3 * ce + 1], ve = y[3 * ce + 2], Te = p[3 * ue], Re = p[3 * ue + 1], Ae = p[3 * ue + 2], Ee = p[3 * fe], Se = p[3 * fe + 1], De = p[3 * fe + 2], xe = p[3 * ve], Le = p[3 * ve + 1], Me = p[3 * ve + 2], we.set(Te, Re, Ae), Ye.set(Ee, Se, De), et.set(xe, Le, Me), Ye.subtractToRef(we, nt), et.subtractToRef(Ye, ct), P && (Ke = P[2 * ue], rt = P[2 * ue + 1], it = P[2 * fe], qe = P[2 * fe + 1], ut = P[2 * ve], Ve = P[2 * ve + 1], Ze.set(Ke, rt), vt.set(it, qe), jt.set(ut, Ve), vt.subtractToRef(Ze, Dt), jt.subtractToRef(vt, Yt)), R && i && (mt = R[4 * ue], qt = R[4 * ue + 1], Ht = R[4 * ue + 2], kt = R[4 * ue + 3], Wt = R[4 * fe], bt = R[4 * fe + 1], Rt = R[4 * fe + 2], Zt = R[4 * fe + 3], Mn = R[4 * ve], Bn = R[4 * ve + 1], Kn = R[4 * ve + 2], In = R[4 * ve + 3], Kt.set(mt, qt, Ht, kt), oi.set(Wt, bt, Rt, Zt), Ti.set(Mn, Bn, Kn, In), oi.subtractToRef(Kt, Lr), Ti.subtractToRef(oi, Nr));\n              for (var Si, Dn, bo = new I.a(0, 0, 0), ir = new I.a(0, 0, 0), To = 0; To < e._groupDensity[ce]; To++)\n                se = this.particles.length, this._addParticle(se, e, this._groupCounter, ce + To), Dn = this.particles[se], ai = $.a.RandomRange(0, 1), Fi = $.a.RandomRange(0, 1), J = we.add(nt.scale(ai)).add(ct.scale(ai * Fi)), n && (Bi = t.getFacetNormal(ce).normalize().scale(-1), Tn = nt.clone().normalize(), tr = u.e.Cross(Bi, Tn), Ei = $.a.RandomRange(0, 2 * Math.PI), Ma = Tn.scale(Math.cos(Ei)).add(tr.scale(Math.sin(Ei))), Ei = $.a.RandomRange(0.1, Math.PI / 2), Vi = Ma.scale(Math.cos(Ei)).add(Bi.scale(Math.sin(Ei))), Ui.origin = J.add(Vi.scale(1e-5)), Ui.direction = Vi, Ui.length = d, (wr = Ui.intersectsMesh(t)).hit && (Fr = wr.pickedPoint.subtract(J).length(), Ia = $.a.RandomRange(0, 1) * Fr, J.addInPlace(Vi.scale(Ia)))), Dn.position = J.clone(), this._positions.push(Dn.position.x, Dn.position.y, Dn.position.z), i !== void 0 ? P && (ie = Ze.add(Dt.scale(ai)).add(Yt.scale(ai * Fi)), i ? o && e._groupImageData !== null ? (nr = e._groupImgWidth, ki = e._groupImgHeight, Si = this._getColorIndicesForCoord(e, Math.round(ie.x * nr), Math.round(ie.y * ki), nr), Dn.color = Si, this._colors.push(Si.r, Si.g, Si.b, Si.a)) : R ? (Gt = Kt.add(Lr.scale(ai)).add(Nr.scale(ai * Fi)), Dn.color = new I.b(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w)) : (Gt = Kt.set(Math.random(), Math.random(), Math.random(), 1), Dn.color = new I.b(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w)) : (Dn.uv = ie.clone(), this._uvs.push(Dn.uv.x, Dn.uv.y))) : (a ? (bo.set(a.r, a.g, a.b), Br = $.a.RandomRange(-s, s), Ur = $.a.RandomRange(-s, s), Vr = (kr = bo.toHSV()).r, (Gi = kr.g + Br) < 0 && (Gi = 0), Gi > 1 && (Gi = 1), (zi = kr.b + Ur) < 0 && (zi = 0), zi > 1 && (zi = 1), I.a.HSVtoRGBToRef(Vr, Gi, zi, ir), Gt.set(ir.r, ir.g, ir.b, 1)) : Gt = Kt.set(Math.random(), Math.random(), Math.random(), 1), Dn.color = new I.b(Gt.x, Gt.y, Gt.z, Gt.w), this._colors.push(Gt.x, Gt.y, Gt.z, Gt.w));\n            }\n          }, r.prototype._colorFromTexture = function(t, e, n) {\n            var i = this;\n            if (t.material === null)\n              return l.a.Warn(t.name + \"has no material.\"), e._groupImageData = null, void this._setPointsColorOrUV(t, e, n, !0, !1);\n            var o = t.material.getActiveTextures();\n            if (o.length === 0)\n              return l.a.Warn(t.name + \"has no useable texture.\"), e._groupImageData = null, void this._setPointsColorOrUV(t, e, n, !0, !1);\n            var a = t.clone();\n            a.setEnabled(!1), this._promises.push(new Promise(function(s) {\n              kn.a.WhenAllReady(o, function() {\n                var d = e._textureNb;\n                return d < 0 && (d = 0), d > o.length - 1 && (d = o.length - 1), e._groupImageData = o[d].readPixels(), e._groupImgWidth = o[d].getSize().width, e._groupImgHeight = o[d].getSize().height, i._setPointsColorOrUV(a, e, n, !0, !0), a.dispose(), s();\n              });\n            }));\n          }, r.prototype._calculateDensity = function(t, e, n) {\n            for (var i, o, a, s, d, p, y, P, R, B, F, z, J, ie, se, ce, ue, fe = new Array(), ve = u.e.Zero(), Te = u.e.Zero(), Re = u.e.Zero(), Ae = u.e.Zero(), Ee = u.e.Zero(), Se = u.e.Zero(), De = new Array(), xe = 0, Le = n.length / 3, Me = 0; Me < Le; Me++)\n              i = n[3 * Me], o = n[3 * Me + 1], a = n[3 * Me + 2], s = e[3 * i], d = e[3 * i + 1], p = e[3 * i + 2], y = e[3 * o], P = e[3 * o + 1], R = e[3 * o + 2], B = e[3 * a], F = e[3 * a + 1], z = e[3 * a + 2], ve.set(s, d, p), Te.set(y, P, R), Re.set(B, F, z), Te.subtractToRef(ve, Ae), Re.subtractToRef(Te, Ee), Re.subtractToRef(ve, Se), ce = ((J = Ae.length()) + (ie = Ee.length()) + (se = Se.length())) / 2, xe += ue = Math.sqrt(ce * (ce - J) * (ce - ie) * (ce - se)), De[Me] = ue;\n            var we = 0;\n            for (Me = 0; Me < Le; Me++)\n              fe[Me] = Math.floor(t * De[Me] / xe), we += fe[Me];\n            var Ye = t - we, et = Math.floor(Ye / Le), nt = Ye % Le;\n            for (et > 0 && (fe = fe.map(function(ct) {\n              return ct + et;\n            })), Me = 0; Me < nt; Me++)\n              fe[Me] += 1;\n            return fe;\n          }, r.prototype.addPoints = function(t, e) {\n            e === void 0 && (e = this._randomUnitVector);\n            for (var n, i = new fa(this._groupCounter, e), o = this.nbParticles, a = 0; a < t; a++)\n              n = this._addParticle(o, i, this._groupCounter, a), i && i._positionFunction && i._positionFunction(n, o, a), this._positions.push(n.position.x, n.position.y, n.position.z), n.color && this._colors.push(n.color.r, n.color.g, n.color.b, n.color.a), n.uv && this._uvs.push(n.uv.x, n.uv.y), o++;\n            return this.nbParticles += t, this._groupCounter++, this._groupCounter;\n          }, r.prototype.addSurfacePoints = function(t, e, n, i, o) {\n            var a = n || bn.Random;\n            (isNaN(a) || a < 0 || a > 3) && (a = bn.Random);\n            var s = t.getVerticesData(Oe.b.PositionKind), d = t.getIndices();\n            this._groups.push(this._groupCounter);\n            var p = new fa(this._groupCounter, null);\n            switch (p._groupDensity = this._calculateDensity(e, s, d), a === bn.Color ? p._textureNb = i || 0 : i = i || new I.b(1, 1, 1, 1), a) {\n              case bn.Color:\n                this._colorFromTexture(t, p, !1);\n                break;\n              case bn.UV:\n                this._setPointsColorOrUV(t, p, !1, !1, !1);\n                break;\n              case bn.Random:\n                this._setPointsColorOrUV(t, p, !1);\n                break;\n              case bn.Stated:\n                this._setPointsColorOrUV(t, p, !1, void 0, void 0, i, o);\n            }\n            return this.nbParticles += e, this._groupCounter++, this._groupCounter - 1;\n          }, r.prototype.addVolumePoints = function(t, e, n, i, o) {\n            var a = n || bn.Random;\n            (isNaN(a) || a < 0 || a > 3) && (a = bn.Random);\n            var s = t.getVerticesData(Oe.b.PositionKind), d = t.getIndices();\n            this._groups.push(this._groupCounter);\n            var p = new fa(this._groupCounter, null);\n            switch (p._groupDensity = this._calculateDensity(e, s, d), a === bn.Color ? p._textureNb = i || 0 : i = i || new I.b(1, 1, 1, 1), a) {\n              case bn.Color:\n                this._colorFromTexture(t, p, !0);\n                break;\n              case bn.UV:\n                this._setPointsColorOrUV(t, p, !0, !1, !1);\n                break;\n              case bn.Random:\n                this._setPointsColorOrUV(t, p, !0);\n                break;\n              case bn.Stated:\n                this._setPointsColorOrUV(t, p, !0, void 0, void 0, i, o);\n            }\n            return this.nbParticles += e, this._groupCounter++, this._groupCounter - 1;\n          }, r.prototype.setParticles = function(t, e, n) {\n            if (t === void 0 && (t = 0), e === void 0 && (e = this.nbParticles - 1), n === void 0 && (n = !0), !this._updatable || !this._isReady)\n              return this;\n            this.beforeUpdateParticles(t, e, n);\n            var i = u.c.Matrix[0], o = this.mesh, a = this._colors32, s = this._positions32, d = this._uvs32, p = u.c.Vector3, y = p[5].copyFromFloats(1, 0, 0), P = p[6].copyFromFloats(0, 1, 0), R = p[7].copyFromFloats(0, 0, 1), B = p[8].setAll(Number.MAX_VALUE), F = p[9].setAll(-Number.MAX_VALUE);\n            u.a.IdentityToRef(i);\n            var z = 0;\n            if (this.mesh.isFacetDataEnabled && (this._computeBoundingBox = !0), e = e >= this.nbParticles ? this.nbParticles - 1 : e, this._computeBoundingBox && (t != 0 || e != this.nbParticles - 1)) {\n              var J = this.mesh._boundingInfo;\n              J && (B.copyFrom(J.minimum), F.copyFrom(J.maximum));\n            }\n            z = 0;\n            for (var ie = 0, se = 0, ce = 0, ue = t; ue <= e; ue++) {\n              var fe = this.particles[ue];\n              ie = 3 * (z = fe.idx), se = 4 * z, ce = 2 * z, this.updateParticle(fe);\n              var ve = fe._rotationMatrix, Te = fe.position, Re = fe._globalPosition;\n              if (this._computeParticleRotation && fe.getRotationMatrix(i), fe.parentId !== null) {\n                var Ae = this.particles[fe.parentId], Ee = Ae._rotationMatrix, Se = Ae._globalPosition, De = Te.x * Ee[1] + Te.y * Ee[4] + Te.z * Ee[7], xe = Te.x * Ee[0] + Te.y * Ee[3] + Te.z * Ee[6], Le = Te.x * Ee[2] + Te.y * Ee[5] + Te.z * Ee[8];\n                if (Re.x = Se.x + xe, Re.y = Se.y + De, Re.z = Se.z + Le, this._computeParticleRotation) {\n                  var Me = i.m;\n                  ve[0] = Me[0] * Ee[0] + Me[1] * Ee[3] + Me[2] * Ee[6], ve[1] = Me[0] * Ee[1] + Me[1] * Ee[4] + Me[2] * Ee[7], ve[2] = Me[0] * Ee[2] + Me[1] * Ee[5] + Me[2] * Ee[8], ve[3] = Me[4] * Ee[0] + Me[5] * Ee[3] + Me[6] * Ee[6], ve[4] = Me[4] * Ee[1] + Me[5] * Ee[4] + Me[6] * Ee[7], ve[5] = Me[4] * Ee[2] + Me[5] * Ee[5] + Me[6] * Ee[8], ve[6] = Me[8] * Ee[0] + Me[9] * Ee[3] + Me[10] * Ee[6], ve[7] = Me[8] * Ee[1] + Me[9] * Ee[4] + Me[10] * Ee[7], ve[8] = Me[8] * Ee[2] + Me[9] * Ee[5] + Me[10] * Ee[8];\n                }\n              } else\n                Re.x = 0, Re.y = 0, Re.z = 0, this._computeParticleRotation && (Me = i.m, ve[0] = Me[0], ve[1] = Me[1], ve[2] = Me[2], ve[3] = Me[4], ve[4] = Me[5], ve[5] = Me[6], ve[6] = Me[8], ve[7] = Me[9], ve[8] = Me[10]);\n              var we = p[11];\n              fe.translateFromPivot ? we.setAll(0) : we.copyFrom(fe.pivot);\n              var Ye = p[0];\n              Ye.copyFrom(fe.position);\n              var et = Ye.x - fe.pivot.x, nt = Ye.y - fe.pivot.y, ct = Ye.z - fe.pivot.z, Ke = et * ve[0] + nt * ve[3] + ct * ve[6], rt = et * ve[1] + nt * ve[4] + ct * ve[7], it = et * ve[2] + nt * ve[5] + ct * ve[8];\n              Ke += we.x, rt += we.y, it += we.z;\n              var qe = s[ie] = Re.x + y.x * Ke + P.x * rt + R.x * it, ut = s[ie + 1] = Re.y + y.y * Ke + P.y * rt + R.y * it, Ve = s[ie + 2] = Re.z + y.z * Ke + P.z * rt + R.z * it;\n              if (this._computeBoundingBox && (B.minimizeInPlaceFromFloats(qe, ut, Ve), F.maximizeInPlaceFromFloats(qe, ut, Ve)), this._computeParticleColor && fe.color) {\n                var Ze = fe.color, vt = this._colors32;\n                vt[se] = Ze.r, vt[se + 1] = Ze.g, vt[se + 2] = Ze.b, vt[se + 3] = Ze.a;\n              }\n              if (this._computeParticleTexture && fe.uv) {\n                var jt = fe.uv, Dt = this._uvs32;\n                Dt[ce] = jt.x, Dt[ce + 1] = jt.y;\n              }\n            }\n            return n && (this._computeParticleColor && o.updateVerticesData(Oe.b.ColorKind, a, !1, !1), this._computeParticleTexture && o.updateVerticesData(Oe.b.UVKind, d, !1, !1), o.updateVerticesData(Oe.b.PositionKind, s, !1, !1)), this._computeBoundingBox && (o._boundingInfo ? o._boundingInfo.reConstruct(B, F, o._worldMatrix) : o._boundingInfo = new Ii.a(B, F, o._worldMatrix)), this.afterUpdateParticles(t, e, n), this;\n          }, r.prototype.dispose = function() {\n            this.mesh.dispose(), this.vars = null, this._positions = null, this._indices = null, this._normals = null, this._uvs = null, this._colors = null, this._indices32 = null, this._positions32 = null, this._uvs32 = null, this._colors32 = null;\n          }, r.prototype.refreshVisibleSize = function() {\n            return this._isVisibilityBoxLocked || this.mesh.refreshBoundingInfo(), this;\n          }, r.prototype.setVisibilityBox = function(t) {\n            var e = t / 2;\n            this.mesh._boundingInfo = new Ii.a(new u.e(-e, -e, -e), new u.e(e, e, e));\n          }, Object.defineProperty(r.prototype, \"isAlwaysVisible\", { get: function() {\n            return this._alwaysVisible;\n          }, set: function(t) {\n            this._alwaysVisible = t, this.mesh.alwaysSelectAsActiveMesh = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleRotation\", { set: function(t) {\n            this._computeParticleRotation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleColor\", { get: function() {\n            return this._computeParticleColor;\n          }, set: function(t) {\n            this._computeParticleColor = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeParticleTexture\", { get: function() {\n            return this._computeParticleTexture;\n          }, set: function(t) {\n            this._computeParticleTexture = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"computeBoundingBox\", { get: function() {\n            return this._computeBoundingBox;\n          }, set: function(t) {\n            this._computeBoundingBox = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.initParticles = function() {\n          }, r.prototype.recycleParticle = function(t) {\n            return t;\n          }, r.prototype.updateParticle = function(t) {\n            return t;\n          }, r.prototype.beforeUpdateParticles = function(t, e, n) {\n          }, r.prototype.afterUpdateParticles = function(t, e, n) {\n          }, r;\n        }();\n        _e.a.prototype.getPhysicsEngine = function() {\n          return this._physicsEngine;\n        }, _e.a.prototype.enablePhysics = function(r, t) {\n          if (r === void 0 && (r = null), this._physicsEngine)\n            return !0;\n          var e = this._getComponent(ot.a.NAME_PHYSICSENGINE);\n          e || (e = new hd(this), this._addComponent(e));\n          try {\n            return this._physicsEngine = new Sr(r, t), this._physicsTimeAccumulator = 0, !0;\n          } catch (n) {\n            return l.a.Error(n.message), !1;\n          }\n        }, _e.a.prototype.disablePhysicsEngine = function() {\n          this._physicsEngine && (this._physicsEngine.dispose(), this._physicsEngine = null);\n        }, _e.a.prototype.isPhysicsEnabled = function() {\n          return this._physicsEngine !== void 0;\n        }, _e.a.prototype.deleteCompoundImpostor = function(r) {\n          var t = r.parts[0].mesh;\n          t.physicsImpostor && (t.physicsImpostor.dispose(), t.physicsImpostor = null);\n        }, _e.a.prototype._advancePhysicsEngineStep = function(r) {\n          if (this._physicsEngine) {\n            var t = this._physicsEngine.getSubTimeStep();\n            if (t > 0)\n              for (this._physicsTimeAccumulator += r; this._physicsTimeAccumulator > t; )\n                this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(t / 1e3), this.onAfterPhysicsObservable.notifyObservers(this), this._physicsTimeAccumulator -= t;\n            else\n              this.onBeforePhysicsObservable.notifyObservers(this), this._physicsEngine._step(r / 1e3), this.onAfterPhysicsObservable.notifyObservers(this);\n          }\n        }, Object.defineProperty(Mt.a.prototype, \"physicsImpostor\", { get: function() {\n          return this._physicsImpostor;\n        }, set: function(r) {\n          var t = this;\n          this._physicsImpostor !== r && (this._disposePhysicsObserver && this.onDisposeObservable.remove(this._disposePhysicsObserver), this._physicsImpostor = r, r && (this._disposePhysicsObserver = this.onDisposeObservable.add(function() {\n            t.physicsImpostor && (t.physicsImpostor.dispose(), t.physicsImpostor = null);\n          })));\n        }, enumerable: !0, configurable: !0 }), Mt.a.prototype.getPhysicsImpostor = function() {\n          return this.physicsImpostor;\n        }, Mt.a.prototype.applyImpulse = function(r, t) {\n          return this.physicsImpostor ? (this.physicsImpostor.applyImpulse(r, t), this) : this;\n        }, Mt.a.prototype.setPhysicsLinkWith = function(r, t, e, n) {\n          return this.physicsImpostor && r.physicsImpostor ? (this.physicsImpostor.createJoint(r.physicsImpostor, Jt.e.HingeJoint, { mainPivot: t, connectedPivot: e, nativeParams: n }), this) : this;\n        };\n        var go, Or, hd = function() {\n          function r(t) {\n            var e = this;\n            this.name = ot.a.NAME_PHYSICSENGINE, this.scene = t, this.scene.onBeforePhysicsObservable = new C.c(), this.scene.onAfterPhysicsObservable = new C.c(), this.scene.getDeterministicFrameTime = function() {\n              return e.scene._physicsEngine ? 1e3 * e.scene._physicsEngine.getTimeStep() : 1e3 / 60;\n            };\n          }\n          return r.prototype.register = function() {\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            this.scene.onBeforePhysicsObservable.clear(), this.scene.onAfterPhysicsObservable.clear(), this.scene._physicsEngine && this.scene.disablePhysicsEngine();\n          }, r;\n        }(), Tm = function() {\n          function r(t) {\n            this._scene = t, this._physicsEngine = this._scene.getPhysicsEngine(), this._physicsEngine || l.a.Warn(\"Physics engine not enabled. Please enable the physics before you can use the methods.\");\n          }\n          return r.prototype.applyRadialExplosionImpulse = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call this method.\"), null;\n            var o = this._physicsEngine.getImpostors();\n            if (o.length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Mr()).radius = e, e.strength = n || e.strength, e.falloff = i || e.falloff);\n            var a = new dd(this._scene, e), s = Array();\n            return o.forEach(function(d) {\n              var p = a.getImpostorHitData(d, t);\n              p && (d.applyImpulse(p.force, p.contactPoint), s.push({ impostor: d, hitData: p }));\n            }), a.triggerAffectedImpostorsCallback(s), a.dispose(!1), a;\n          }, r.prototype.applyRadialExplosionForce = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            var o = this._physicsEngine.getImpostors();\n            if (o.length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Mr()).radius = e, e.strength = n || e.strength, e.falloff = i || e.falloff);\n            var a = new dd(this._scene, e), s = Array();\n            return o.forEach(function(d) {\n              var p = a.getImpostorHitData(d, t);\n              p && (d.applyForce(p.force, p.contactPoint), s.push({ impostor: d, hitData: p }));\n            }), a.triggerAffectedImpostorsCallback(s), a.dispose(!1), a;\n          }, r.prototype.gravitationalField = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            if (this._physicsEngine.getImpostors().length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Mr()).radius = e, e.strength = n || e.strength, e.falloff = i || e.falloff);\n            var o = new Em(this, this._scene, t, e);\n            return o.dispose(!1), o;\n          }, r.prototype.updraft = function(t, e, n, i, o) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            if (this._physicsEngine.getImpostors().length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Tc()).radius = e, e.strength = n || e.strength, e.height = i || e.height, e.updraftMode = o || e.updraftMode);\n            var a = new Sm(this._scene, t, e);\n            return a.dispose(!1), a;\n          }, r.prototype.vortex = function(t, e, n, i) {\n            if (!this._physicsEngine)\n              return l.a.Warn(\"Physics engine not enabled. Please enable the physics before you call the PhysicsHelper.\"), null;\n            if (this._physicsEngine.getImpostors().length === 0)\n              return null;\n            typeof e == \"number\" && ((e = new Ec()).radius = e, e.strength = n || e.strength, e.height = i || e.height);\n            var o = new Am(this._scene, t, e);\n            return o.dispose(!1), o;\n          }, r;\n        }(), dd = function() {\n          function r(t, e) {\n            this._scene = t, this._options = e, this._dataFetched = !1, this._options = Object(c.a)(Object(c.a)({}, new Mr()), this._options);\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { sphere: this._sphere };\n          }, r.prototype.getImpostorHitData = function(t, e) {\n            if (t.mass === 0 || !this._intersectsWithSphere(t, e, this._options.radius) || t.object.getClassName() !== \"Mesh\" && t.object.getClassName() !== \"InstancedMesh\")\n              return null;\n            var n = t.getObjectCenter().subtract(e), i = new dn.a(e, n, this._options.radius).intersectsMesh(t.object).pickedPoint;\n            if (!i)\n              return null;\n            var o = u.e.Distance(e, i);\n            if (o > this._options.radius)\n              return null;\n            var a = this._options.falloff === go.Constant ? this._options.strength : this._options.strength * (1 - o / this._options.radius);\n            return { force: n.multiplyByFloats(a, a, a), contactPoint: i, distanceFromOrigin: o };\n          }, r.prototype.triggerAffectedImpostorsCallback = function(t) {\n            this._options.affectedImpostorsCallback && this._options.affectedImpostorsCallback(t);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), t ? this._sphere.dispose() : setTimeout(function() {\n              e._dataFetched || e._sphere.dispose();\n            }, 0);\n          }, r.prototype._prepareSphere = function() {\n            this._sphere || (this._sphere = Nn.a.CreateSphere(\"radialExplosionEventSphere\", this._options.sphere, this._scene), this._sphere.isVisible = !1);\n          }, r.prototype._intersectsWithSphere = function(t, e, n) {\n            var i = t.object;\n            return this._prepareSphere(), this._sphere.position = e, this._sphere.scaling = new u.e(2 * n, 2 * n, 2 * n), this._sphere._updateBoundingInfo(), this._sphere.computeWorldMatrix(!0), this._sphere.intersectsMesh(i, !0);\n          }, r;\n        }(), Em = function() {\n          function r(t, e, n, i) {\n            this._physicsHelper = t, this._scene = e, this._origin = n, this._options = i, this._dataFetched = !1, this._options = Object(c.a)(Object(c.a)({}, new Mr()), this._options), this._tickCallback = this._tick.bind(this), this._options.strength = -1 * this._options.strength;\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { sphere: this._sphere };\n          }, r.prototype.enable = function() {\n            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);\n          }, r.prototype.disable = function() {\n            this._scene.unregisterBeforeRender(this._tickCallback);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), t ? this._sphere.dispose() : setTimeout(function() {\n              e._dataFetched || e._sphere.dispose();\n            }, 0);\n          }, r.prototype._tick = function() {\n            if (this._sphere)\n              this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);\n            else {\n              var t = this._physicsHelper.applyRadialExplosionForce(this._origin, this._options);\n              t && (this._sphere = t.getData().sphere.clone(\"radialExplosionEventSphereClone\"));\n            }\n          }, r;\n        }(), Sm = function() {\n          function r(t, e, n) {\n            this._scene = t, this._origin = e, this._options = n, this._originTop = u.e.Zero(), this._originDirection = u.e.Zero(), this._cylinderPosition = u.e.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = Object(c.a)(Object(c.a)({}, new Tc()), this._options), this._origin.addToRef(new u.e(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new u.e(0, this._options.height, 0), this._originTop), this._options.updraftMode === Or.Perpendicular && (this._originDirection = this._origin.subtract(this._originTop).normalize()), this._tickCallback = this._tick.bind(this), this._prepareCylinder();\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { cylinder: this._cylinder };\n          }, r.prototype.enable = function() {\n            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);\n          }, r.prototype.disable = function() {\n            this._scene.unregisterBeforeRender(this._tickCallback);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), this._cylinder && (t ? this._cylinder.dispose() : setTimeout(function() {\n              e._dataFetched || e._cylinder.dispose();\n            }, 0));\n          }, r.prototype.getImpostorHitData = function(t) {\n            if (t.mass === 0 || !this._intersectsWithCylinder(t))\n              return null;\n            var e = t.getObjectCenter();\n            if (this._options.updraftMode === Or.Perpendicular)\n              var n = this._originDirection;\n            else\n              n = e.subtract(this._originTop);\n            var i = u.e.Distance(this._origin, e), o = -1 * this._options.strength;\n            return { force: n.multiplyByFloats(o, o, o), contactPoint: e, distanceFromOrigin: i };\n          }, r.prototype._tick = function() {\n            var t = this;\n            this._physicsEngine.getImpostors().forEach(function(e) {\n              var n = t.getImpostorHitData(e);\n              n && e.applyForce(n.force, n.contactPoint);\n            });\n          }, r.prototype._prepareCylinder = function() {\n            this._cylinder || (this._cylinder = ci.a.CreateCylinder(\"updraftEventCylinder\", { height: this._options.height, diameter: 2 * this._options.radius }, this._scene), this._cylinder.isVisible = !1);\n          }, r.prototype._intersectsWithCylinder = function(t) {\n            var e = t.object;\n            return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(e, !0);\n          }, r;\n        }(), Am = function() {\n          function r(t, e, n) {\n            this._scene = t, this._origin = e, this._options = n, this._originTop = u.e.Zero(), this._cylinderPosition = u.e.Zero(), this._dataFetched = !1, this._physicsEngine = this._scene.getPhysicsEngine(), this._options = Object(c.a)(Object(c.a)({}, new Ec()), this._options), this._origin.addToRef(new u.e(0, this._options.height / 2, 0), this._cylinderPosition), this._origin.addToRef(new u.e(0, this._options.height, 0), this._originTop), this._tickCallback = this._tick.bind(this), this._prepareCylinder();\n          }\n          return r.prototype.getData = function() {\n            return this._dataFetched = !0, { cylinder: this._cylinder };\n          }, r.prototype.enable = function() {\n            this._tickCallback.call(this), this._scene.registerBeforeRender(this._tickCallback);\n          }, r.prototype.disable = function() {\n            this._scene.unregisterBeforeRender(this._tickCallback);\n          }, r.prototype.dispose = function(t) {\n            var e = this;\n            t === void 0 && (t = !0), t ? this._cylinder.dispose() : setTimeout(function() {\n              e._dataFetched || e._cylinder.dispose();\n            }, 0);\n          }, r.prototype.getImpostorHitData = function(t) {\n            if (t.mass === 0 || !this._intersectsWithCylinder(t) || t.object.getClassName() !== \"Mesh\" && t.object.getClassName() !== \"InstancedMesh\")\n              return null;\n            var e = t.getObjectCenter(), n = new u.e(this._origin.x, e.y, this._origin.z), i = e.subtract(n), o = new dn.a(n, i, this._options.radius).intersectsMesh(t.object), a = o.pickedPoint;\n            if (!a)\n              return null;\n            var s = o.distance / this._options.radius, d = a.normalize();\n            if (s > this._options.centripetalForceThreshold && (d = d.negate()), s > this._options.centripetalForceThreshold)\n              var p = d.x * this._options.centripetalForceMultiplier, y = d.y * this._options.updraftForceMultiplier, P = d.z * this._options.centripetalForceMultiplier;\n            else {\n              var R = u.e.Cross(n, e).normalize();\n              p = (R.x + d.x) * this._options.centrifugalForceMultiplier, y = this._originTop.y * this._options.updraftForceMultiplier, P = (R.z + d.z) * this._options.centrifugalForceMultiplier;\n            }\n            var B = new u.e(p, y, P);\n            return { force: B = B.multiplyByFloats(this._options.strength, this._options.strength, this._options.strength), contactPoint: e, distanceFromOrigin: s };\n          }, r.prototype._tick = function() {\n            var t = this;\n            this._physicsEngine.getImpostors().forEach(function(e) {\n              var n = t.getImpostorHitData(e);\n              n && e.applyForce(n.force, n.contactPoint);\n            });\n          }, r.prototype._prepareCylinder = function() {\n            this._cylinder || (this._cylinder = ci.a.CreateCylinder(\"vortexEventCylinder\", { height: this._options.height, diameter: 2 * this._options.radius }, this._scene), this._cylinder.isVisible = !1);\n          }, r.prototype._intersectsWithCylinder = function(t) {\n            var e = t.object;\n            return this._cylinder.position = this._cylinderPosition, this._cylinder.intersectsMesh(e, !0);\n          }, r;\n        }(), Mr = function() {\n          this.radius = 5, this.strength = 10, this.falloff = go.Constant, this.sphere = { segments: 32, diameter: 1 };\n        }, Tc = function() {\n          this.radius = 5, this.strength = 10, this.height = 10, this.updraftMode = Or.Center;\n        }, Ec = function() {\n          this.radius = 5, this.strength = 10, this.height = 10, this.centripetalForceThreshold = 0.7, this.centripetalForceMultiplier = 5, this.centrifugalForceMultiplier = 0.5, this.updraftForceMultiplier = 0.02;\n        };\n        (function(r) {\n          r[r.Constant = 0] = \"Constant\", r[r.Linear = 1] = \"Linear\";\n        })(go || (go = {})), function(r) {\n          r[r.Center = 0] = \"Center\", r[r.Perpendicular = 1] = \"Perpendicular\";\n        }(Or || (Or = {}));\n        var Pm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float degree;\nvoid main(void)\n{\nvec3 color=texture2D(textureSampler,vUV).rgb;\nfloat luminance=dot(color,vec3(0.3,0.59,0.11));\nvec3 blackAndWhite=vec3(luminance,luminance,luminance);\ngl_FragColor=vec4(color-((color-blackAndWhite)*degree),1.0);\n}`;\n        ze.a.ShadersStore.blackAndWhitePixelShader = Pm;\n        var fd = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, \"blackAndWhite\", [\"degree\"], null, n, i, o, a, s) || this;\n            return d.degree = 1, d.onApplyObservable.add(function(p) {\n              p.setFloat(\"degree\", d.degree);\n            }), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"BlackAndWhitePostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"degree\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.BlackAndWhitePostProcess\"] = fd;\n        var xt = function() {\n          function r(t, e, n, i) {\n            this._name = e, this._singleInstance = i || !0, this._getPostProcesses = n, this._cameras = {}, this._indicesForCamera = {}, this._postProcesses = {};\n          }\n          return Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            for (var t in this._postProcesses)\n              if (this._postProcesses.hasOwnProperty(t)) {\n                for (var e = this._postProcesses[t], n = 0; n < e.length; n++)\n                  if (!e[n].isSupported)\n                    return !1;\n              }\n            return !0;\n          }, enumerable: !1, configurable: !0 }), r.prototype._update = function() {\n          }, r.prototype._attachCameras = function(t) {\n            var e, n = this, i = Xe.b.MakeArray(t || this._cameras);\n            if (i)\n              for (var o = 0; o < i.length; o++) {\n                var a = i[o];\n                if (a) {\n                  var s = a.name;\n                  if (e = this._singleInstance ? 0 : s, !this._postProcesses[e]) {\n                    var d = this._getPostProcesses();\n                    d && (this._postProcesses[e] = Array.isArray(d) ? d : [d]);\n                  }\n                  this._indicesForCamera[s] || (this._indicesForCamera[s] = []), this._postProcesses[e].forEach(function(p) {\n                    var y = a.attachPostProcess(p);\n                    n._indicesForCamera[s].push(y);\n                  }), this._cameras[s] || (this._cameras[s] = a);\n                }\n              }\n          }, r.prototype._detachCameras = function(t) {\n            var e = Xe.b.MakeArray(t || this._cameras);\n            if (e)\n              for (var n = 0; n < e.length; n++) {\n                var i = e[n], o = i.name, a = this._postProcesses[this._singleInstance ? 0 : o];\n                a && a.forEach(function(s) {\n                  i.detachPostProcess(s);\n                }), this._cameras[o] && (this._cameras[o] = null);\n              }\n          }, r.prototype._enable = function(t) {\n            var e = this, n = Xe.b.MakeArray(t || this._cameras);\n            if (n)\n              for (var i = 0; i < n.length; i++)\n                for (var o = n[i], a = o.name, s = 0; s < this._indicesForCamera[a].length; s++)\n                  o._postProcesses[this._indicesForCamera[a][s]] !== void 0 && o._postProcesses[this._indicesForCamera[a][s]] !== null || this._postProcesses[this._singleInstance ? 0 : a].forEach(function(d) {\n                    n[i].attachPostProcess(d, e._indicesForCamera[a][s]);\n                  });\n          }, r.prototype._disable = function(t) {\n            var e = Xe.b.MakeArray(t || this._cameras);\n            if (e)\n              for (var n = 0; n < e.length; n++) {\n                var i = e[n], o = i.name;\n                this._postProcesses[this._singleInstance ? 0 : o].forEach(function(a) {\n                  i.detachPostProcess(a);\n                });\n              }\n          }, r.prototype.getPostProcesses = function(t) {\n            return this._singleInstance ? this._postProcesses[0] : t ? this._postProcesses[t.name] : null;\n          }, r;\n        }(), xm = `#include<helperFunctions>\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float threshold;\nuniform float exposure;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nfloat luma=getLuminance(gl_FragColor.rgb*exposure);\ngl_FragColor.rgb=step(threshold,luma)*gl_FragColor.rgb;\n}`;\n        ze.a.ShadersStore.extractHighlightsPixelShader = xm;\n        var Sc = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"extractHighlights\", [\"threshold\", \"exposure\"], null, n, i, o, a, s, null, d, void 0, null, p) || this;\n            return y.threshold = 0.9, y._exposure = 1, y._inputPostProcess = null, y.onApplyObservable.add(function(P) {\n              y._inputPostProcess && P.setTextureFromPostProcess(\"textureSampler\", y._inputPostProcess), P.setFloat(\"threshold\", Math.pow(y.threshold, Vt.b)), P.setFloat(\"exposure\", y._exposure);\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ExtractHighlightsPostProcess\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"threshold\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ExtractHighlightsPostProcess\"] = Sc;\n        var Cm = `uniform sampler2D textureSampler;\nuniform sampler2D bloomBlur;\nvarying vec2 vUV;\nuniform float bloomWeight;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec3 blurred=texture2D(bloomBlur,vUV).rgb;\ngl_FragColor.rgb=gl_FragColor.rgb+(blurred.rgb*bloomWeight);\n}\n`;\n        ze.a.ShadersStore.bloomMergePixelShader = Cm;\n        var Ac = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R) {\n            P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT), R === void 0 && (R = !1);\n            var B = r.call(this, e, \"bloomMerge\", [\"bloomWeight\"], [\"circleOfConfusionSampler\", \"blurStep0\", \"blurStep1\", \"blurStep2\", \"bloomBlur\"], a, s, d, p, y, null, P, void 0, null, !0) || this;\n            return B.weight = 1, B.weight = o, B.onApplyObservable.add(function(F) {\n              F.setTextureFromPostProcess(\"textureSampler\", n), F.setTextureFromPostProcessOutput(\"bloomBlur\", i), F.setFloat(\"bloomWeight\", B.weight);\n            }), R || B.updateEffect(), B;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"BloomMergePostProcess\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"weight\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.BloomMergePostProcess\"] = Ac;\n        var Pc = function(r) {\n          function t(e, n, i, o, a, s) {\n            a === void 0 && (a = 0), s === void 0 && (s = !1);\n            var d = r.call(this, e.getEngine(), \"bloom\", function() {\n              return d._effects;\n            }, !0) || this;\n            return d.bloomScale = n, d._effects = [], d._downscale = new Sc(\"highlights\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, s), d._blurX = new _n(\"horizontal blur\", new u.d(1, 0), 10, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, void 0, s), d._blurX.alwaysForcePOT = !0, d._blurX.autoClear = !1, d._blurY = new _n(\"vertical blur\", new u.d(0, 1), 10, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, void 0, s), d._blurY.alwaysForcePOT = !0, d._blurY.autoClear = !1, d.kernel = o, d._effects = [d._downscale, d._blurX, d._blurY], d._merge = new Ac(\"bloomMerge\", d._downscale, d._blurY, i, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, a, s), d._merge.autoClear = !1, d._effects.push(d._merge), d;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"threshold\", { get: function() {\n            return this._downscale.threshold;\n          }, set: function(e) {\n            this._downscale.threshold = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"weight\", { get: function() {\n            return this._merge.weight;\n          }, set: function(e) {\n            this._merge.weight = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"kernel\", { get: function() {\n            return this._blurX.kernel / this.bloomScale;\n          }, set: function(e) {\n            this._blurX.kernel = e * this.bloomScale, this._blurY.kernel = e * this.bloomScale;\n          }, enumerable: !1, configurable: !0 }), t.prototype.disposeEffects = function(e) {\n            for (var n = 0; n < this._effects.length; n++)\n              this._effects[n].dispose(e);\n          }, t.prototype._updateEffects = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              this._effects[e].updateEffect();\n          }, t.prototype._isReady = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              if (!this._effects[e].isReady())\n                return !1;\n            return !0;\n          }, t;\n        }(xt), Rm = `\nuniform sampler2D textureSampler;\n\nuniform float chromatic_aberration;\nuniform float radialIntensity;\nuniform vec2 direction;\nuniform vec2 centerPosition;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\nvoid main(void)\n{\nvec2 centered_screen_pos=vec2(vUV.x-centerPosition.x,vUV.y-centerPosition.y);\nvec2 directionOfEffect=direction;\nif(directionOfEffect.x == 0. && directionOfEffect.y == 0.){\ndirectionOfEffect=normalize(centered_screen_pos);\n}\nfloat radius2=centered_screen_pos.x*centered_screen_pos.x\n+centered_screen_pos.y*centered_screen_pos.y;\nfloat radius=sqrt(radius2);\nvec4 original=texture2D(textureSampler,vUV);\n\nvec3 ref_indices=vec3(-0.3,0.0,0.3);\nfloat ref_shiftX=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.x/screen_width;\nfloat ref_shiftY=chromatic_aberration*pow(radius,radialIntensity)*directionOfEffect.y/screen_height;\n\nvec2 ref_coords_r=vec2(vUV.x+ref_indices.r*ref_shiftX,vUV.y+ref_indices.r*ref_shiftY*0.5);\nvec2 ref_coords_g=vec2(vUV.x+ref_indices.g*ref_shiftX,vUV.y+ref_indices.g*ref_shiftY*0.5);\nvec2 ref_coords_b=vec2(vUV.x+ref_indices.b*ref_shiftX,vUV.y+ref_indices.b*ref_shiftY*0.5);\noriginal.r=texture2D(textureSampler,ref_coords_r).r;\noriginal.g=texture2D(textureSampler,ref_coords_g).g;\noriginal.b=texture2D(textureSampler,ref_coords_b).b;\noriginal.a=clamp(texture2D(textureSampler,ref_coords_r).a+texture2D(textureSampler,ref_coords_g).a+texture2D(textureSampler,ref_coords_b).a,0.,1.);\ngl_FragColor=original;\n}`;\n        ze.a.ShadersStore.chromaticAberrationPixelShader = Rm;\n        var xc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            y === void 0 && (y = h.a.TEXTURETYPE_UNSIGNED_INT), P === void 0 && (P = !1);\n            var R = r.call(this, e, \"chromaticAberration\", [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"], [], o, a, s, d, p, null, y, void 0, null, P) || this;\n            return R.aberrationAmount = 30, R.radialIntensity = 0, R.direction = new u.d(0.707, 0.707), R.centerPosition = new u.d(0.5, 0.5), R.screenWidth = n, R.screenHeight = i, R.onApplyObservable.add(function(B) {\n              B.setFloat(\"chromatic_aberration\", R.aberrationAmount), B.setFloat(\"screen_width\", n), B.setFloat(\"screen_height\", i), B.setFloat(\"radialIntensity\", R.radialIntensity), B.setFloat2(\"direction\", R.direction.x, R.direction.y), B.setFloat2(\"centerPosition\", R.centerPosition.x, R.centerPosition.y);\n            }), R;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ChromaticAberrationPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.screenWidth, e.screenHeight, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType, !1);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"aberrationAmount\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radialIntensity\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"direction\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"centerPosition\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"screenWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"screenHeight\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ChromaticAberrationPostProcess\"] = xc;\n        var Om = `\nuniform sampler2D depthSampler;\n\nvarying vec2 vUV;\n\nuniform vec2 cameraMinMaxZ;\n\nuniform float focusDistance;\nuniform float cocPrecalculation;\nvoid main(void)\n{\nfloat depth=texture2D(depthSampler,vUV).r;\nfloat pixelDistance=(cameraMinMaxZ.x+(cameraMinMaxZ.y-cameraMinMaxZ.x)*depth)*1000.0;\nfloat coc=abs(cocPrecalculation* ((focusDistance-pixelDistance)/pixelDistance));\ncoc=clamp(coc,0.0,1.0);\ngl_FragColor=vec4(coc,depth,coc,1.0);\n}\n`;\n        ze.a.ShadersStore.circleOfConfusionPixelShader = Om;\n        var Cc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1);\n            var P = r.call(this, e, \"circleOfConfusion\", [\"cameraMinMaxZ\", \"focusDistance\", \"cocPrecalculation\"], [\"depthSampler\"], i, o, a, s, d, null, p, void 0, null, y) || this;\n            return P.lensSize = 50, P.fStop = 1.4, P.focusDistance = 2e3, P.focalLength = 50, P._depthTexture = null, P._depthTexture = n, P.onApplyObservable.add(function(R) {\n              if (P._depthTexture) {\n                R.setTexture(\"depthSampler\", P._depthTexture);\n                var B = P.lensSize / P.fStop * P.focalLength / (P.focusDistance - P.focalLength);\n                R.setFloat(\"focusDistance\", P.focusDistance), R.setFloat(\"cocPrecalculation\", B), R.setFloat2(\"cameraMinMaxZ\", P._depthTexture.activeCamera.minZ, P._depthTexture.activeCamera.maxZ);\n              } else\n                l.a.Warn(\"No depth texture set on CircleOfConfusionPostProcess\");\n            }), P;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"CircleOfConfusionPostProcess\";\n          }, Object.defineProperty(t.prototype, \"depthTexture\", { set: function(e) {\n            this._depthTexture = e;\n          }, enumerable: !1, configurable: !0 }), Object(c.c)([Object(L.c)()], t.prototype, \"lensSize\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"fStop\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"focusDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"focalLength\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.CircleOfConfusionPostProcess\"] = Cc;\n        var Mm = `\nuniform sampler2D textureSampler;\nuniform sampler2D colorTable;\n\nvarying vec2 vUV;\n\nconst float SLICE_COUNT=16.0;\n\nvec4 sampleAs3DTexture(sampler2D textureSampler,vec3 uv,float width) {\nfloat sliceSize=1.0/width;\nfloat slicePixelSize=sliceSize/width;\nfloat sliceInnerSize=slicePixelSize*(width-1.0);\nfloat zSlice0=min(floor(uv.z*width),width-1.0);\nfloat zSlice1=min(zSlice0+1.0,width-1.0);\nfloat xOffset=slicePixelSize*0.5+uv.x*sliceInnerSize;\nfloat s0=xOffset+(zSlice0*sliceSize);\nfloat s1=xOffset+(zSlice1*sliceSize);\nvec4 slice0Color=texture2D(textureSampler,vec2(s0,uv.y));\nvec4 slice1Color=texture2D(textureSampler,vec2(s1,uv.y));\nfloat zOffset=mod(uv.z*width,1.0);\nvec4 result=mix(slice0Color,slice1Color,zOffset);\nreturn result;\n}\nvoid main(void)\n{\nvec4 screen_color=texture2D(textureSampler,vUV);\ngl_FragColor=sampleAs3DTexture(colorTable,screen_color.rgb,SLICE_COUNT);\n}`;\n        ze.a.ShadersStore.colorCorrectionPixelShader = Mm;\n        var pd = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, \"colorCorrection\", null, [\"colorTable\"], i, o, a, s, d) || this;\n            return p._colorTableTexture = new Ne.a(n, o.getScene(), !0, !1, Ne.a.TRILINEAR_SAMPLINGMODE), p._colorTableTexture.anisotropicFilteringLevel = 1, p._colorTableTexture.wrapU = Ne.a.CLAMP_ADDRESSMODE, p._colorTableTexture.wrapV = Ne.a.CLAMP_ADDRESSMODE, p.colorTableUrl = n, p.onApply = function(y) {\n              y.setTexture(\"colorTable\", p._colorTableTexture);\n            }, p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ColorCorrectionPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.colorTableUrl, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"colorTableUrl\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ColorCorrectionPostProcess\"] = pd;\n        var Im = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform float kernel[9];\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 colorSum =\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,-1))*kernel[0] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,-1))*kernel[1] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,-1))*kernel[2] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0))*kernel[3] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,0))*kernel[4] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0))*kernel[5] +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,1))*kernel[6] +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1))*kernel[7] +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,1))*kernel[8];\nfloat kernelWeight =\nkernel[0] +\nkernel[1] +\nkernel[2] +\nkernel[3] +\nkernel[4] +\nkernel[5] +\nkernel[6] +\nkernel[7] +\nkernel[8];\nif (kernelWeight<=0.0) {\nkernelWeight=1.0;\n}\ngl_FragColor=vec4((colorSum/kernelWeight).rgb,1);\n}`;\n        ze.a.ShadersStore.convolutionPixelShader = Im;\n        var _d = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, e, \"convolution\", [\"kernel\", \"screenSize\"], null, i, o, a, s, d, null, p) || this;\n            return y.kernel = n, y.onApply = function(P) {\n              P.setFloat2(\"screenSize\", y.width, y.height), P.setArray(\"kernel\", y.kernel);\n            }, y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ConvolutionPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.kernel, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType);\n            }, e, i, o);\n          }, t.EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1], t.EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0], t.EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1], t.SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0], t.EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2], t.GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0], Object(c.c)([Object(L.c)()], t.prototype, \"kernel\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ConvolutionPostProcess\"] = _d;\n        var pa = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R, B, F) {\n            p === void 0 && (p = null), y === void 0 && (y = Ne.a.BILINEAR_SAMPLINGMODE), B === void 0 && (B = h.a.TEXTURETYPE_UNSIGNED_INT), F === void 0 && (F = !1);\n            var z = r.call(this, e, i, o, a, s, y = h.a.TEXTURE_BILINEAR_SAMPLINGMODE, P, R, B = h.a.TEXTURETYPE_UNSIGNED_INT, `#define DOF 1\\r\n`, F) || this;\n            return z.direction = i, z.onApplyObservable.add(function(J) {\n              p != null && J.setTextureFromPostProcess(\"textureSampler\", p), J.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", d), n.activeCamera && J.setFloat2(\"cameraMinMaxZ\", n.activeCamera.minZ, n.activeCamera.maxZ);\n            }), z;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DepthOfFieldBlurPostProcess\";\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"direction\", void 0), t;\n        }(_n);\n        O.a.RegisteredTypes[\"BABYLON.DepthOfFieldBlurPostProcess\"] = pa;\n        var Dm = `uniform sampler2D textureSampler;\nvarying vec2 vUV;\nuniform sampler2D circleOfConfusionSampler;\nuniform sampler2D blurStep0;\n#if BLUR_LEVEL>0\nuniform sampler2D blurStep1;\n#endif\n#if BLUR_LEVEL>1\nuniform sampler2D blurStep2;\n#endif\nvoid main(void)\n{\nfloat coc=texture2D(circleOfConfusionSampler,vUV).r;\n#if BLUR_LEVEL == 0\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred0=texture2D(blurStep0,vUV);\ngl_FragColor=mix(original,blurred0,coc);\n#endif\n#if BLUR_LEVEL == 1\nif(coc<0.5){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(original,blurred1,coc/0.5);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.5)/0.5);\n}\n#endif\n#if BLUR_LEVEL == 2\nif(coc<0.33){\nvec4 original=texture2D(textureSampler,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(original,blurred2,coc/0.33);\n}else if(coc<0.66){\nvec4 blurred1=texture2D(blurStep1,vUV);\nvec4 blurred2=texture2D(blurStep2,vUV);\ngl_FragColor=mix(blurred2,blurred1,(coc-0.33)/0.33);\n}else{\nvec4 blurred0=texture2D(blurStep0,vUV);\nvec4 blurred1=texture2D(blurStep1,vUV);\ngl_FragColor=mix(blurred1,blurred0,(coc-0.66)/0.34);\n}\n#endif\n}\n`;\n        ze.a.ShadersStore.depthOfFieldMergePixelShader = Dm;\n        var $i, Lm = function() {\n        }, md = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P, R) {\n            P === void 0 && (P = h.a.TEXTURETYPE_UNSIGNED_INT), R === void 0 && (R = !1);\n            var B = r.call(this, e, \"depthOfFieldMerge\", [], [\"circleOfConfusionSampler\", \"blurStep0\", \"blurStep1\", \"blurStep2\"], a, s, d, p, y, null, P, void 0, null, !0) || this;\n            return B.blurSteps = o, B.onApplyObservable.add(function(F) {\n              F.setTextureFromPostProcess(\"textureSampler\", n), F.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", i), o.forEach(function(z, J) {\n                F.setTextureFromPostProcessOutput(\"blurStep\" + (o.length - J - 1), z);\n              });\n            }), R || B.updateEffect(), B;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DepthOfFieldMergePostProcess\";\n          }, t.prototype.updateEffect = function(e, n, i, o, a, s) {\n            e === void 0 && (e = null), n === void 0 && (n = null), i === void 0 && (i = null), e || (e = \"\", e += \"#define BLUR_LEVEL \" + (this.blurSteps.length - 1) + `\n`), r.prototype.updateEffect.call(this, e, n, i, o, a, s);\n          }, t;\n        }(ft);\n        (function(r) {\n          r[r.Low = 0] = \"Low\", r[r.Medium = 1] = \"Medium\", r[r.High = 2] = \"High\";\n        })($i || ($i = {}));\n        var Rc = function(r) {\n          function t(e, n, i, o, a) {\n            i === void 0 && (i = $i.Low), o === void 0 && (o = 0), a === void 0 && (a = !1);\n            var s = r.call(this, e.getEngine(), \"depth of field\", function() {\n              return s._effects;\n            }, !0) || this;\n            s._effects = [], s._circleOfConfusion = new Cc(\"circleOfConfusion\", n, 1, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a), s._depthOfFieldBlurY = [], s._depthOfFieldBlurX = [];\n            var d = 1, p = 15;\n            switch (i) {\n              case $i.High:\n                d = 3, p = 51;\n                break;\n              case $i.Medium:\n                d = 2, p = 31;\n                break;\n              default:\n                p = 15, d = 1;\n            }\n            for (var y = p / Math.pow(2, d - 1), P = 1, R = 0; R < d; R++) {\n              var B = new pa(\"verticle blur\", e, new u.d(0, 1), y, P, null, s._circleOfConfusion, R == 0 ? s._circleOfConfusion : null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a);\n              B.autoClear = !1, P = 0.75 / Math.pow(2, R);\n              var F = new pa(\"horizontal blur\", e, new u.d(1, 0), y, P, null, s._circleOfConfusion, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a);\n              F.autoClear = !1, s._depthOfFieldBlurY.push(B), s._depthOfFieldBlurX.push(F);\n            }\n            for (s._effects = [s._circleOfConfusion], R = 0; R < s._depthOfFieldBlurX.length; R++)\n              s._effects.push(s._depthOfFieldBlurY[R]), s._effects.push(s._depthOfFieldBlurX[R]);\n            return s._dofMerge = new md(\"dofMerge\", s._circleOfConfusion, s._circleOfConfusion, s._depthOfFieldBlurX, P, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o, a), s._dofMerge.autoClear = !1, s._effects.push(s._dofMerge), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"focalLength\", { get: function() {\n            return this._circleOfConfusion.focalLength;\n          }, set: function(e) {\n            this._circleOfConfusion.focalLength = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fStop\", { get: function() {\n            return this._circleOfConfusion.fStop;\n          }, set: function(e) {\n            this._circleOfConfusion.fStop = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"focusDistance\", { get: function() {\n            return this._circleOfConfusion.focusDistance;\n          }, set: function(e) {\n            this._circleOfConfusion.focusDistance = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"lensSize\", { get: function() {\n            return this._circleOfConfusion.lensSize;\n          }, set: function(e) {\n            this._circleOfConfusion.lensSize = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"DepthOfFieldEffect\";\n          }, Object.defineProperty(t.prototype, \"depthTexture\", { set: function(e) {\n            this._circleOfConfusion.depthTexture = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.disposeEffects = function(e) {\n            for (var n = 0; n < this._effects.length; n++)\n              this._effects[n].dispose(e);\n          }, t.prototype._updateEffects = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              this._effects[e].updateEffect();\n          }, t.prototype._isReady = function() {\n            for (var e = 0; e < this._effects.length; e++)\n              if (!this._effects[e].isReady())\n                return !1;\n            return !0;\n          }, t;\n        }(xt), Nm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D passSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(passSampler,vUV);\n}`;\n        ze.a.ShadersStore.displayPassPixelShader = Nm;\n        var gd = function(r) {\n          function t(e, n, i, o, a, s) {\n            return r.call(this, e, \"displayPass\", [\"passSampler\"], [\"passSampler\"], n, i, o, a, s) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"DisplayPassPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.DisplayPassPostProcess\"] = gd;\n        var wm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform mat4 kernelMatrix;\nvoid main(void)\n{\nvec3 baseColor=texture2D(textureSampler,vUV).rgb;\nvec3 updatedColor=(kernelMatrix*vec4(baseColor,1.0)).rgb;\ngl_FragColor=vec4(updatedColor,1.0);\n}`;\n        ze.a.ShadersStore.filterPixelShader = wm;\n        var vd = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, \"filter\", [\"kernelMatrix\"], null, i, o, a, s, d) || this;\n            return p.kernelMatrix = n, p.onApply = function(y) {\n              y.setMatrix(\"kernelMatrix\", p.kernelMatrix);\n            }, p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FilterPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.kernelMatrix, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.j)()], t.prototype, \"kernelMatrix\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.FilterPostProcess\"] = vd;\n        var Fm = `uniform sampler2D textureSampler;\nuniform vec2 texelSize;\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst float fxaaQualitySubpix=1.0;\nconst float fxaaQualityEdgeThreshold=0.166;\nconst float fxaaQualityEdgeThresholdMin=0.0833;\nconst vec3 kLumaCoefficients=vec3(0.2126,0.7152,0.0722);\n#define FxaaLuma(rgba) dot(rgba.rgb,kLumaCoefficients)\nvoid main(){\nvec2 posM;\nposM.x=vUV.x;\nposM.y=vUV.y;\nvec4 rgbyM=texture2D(textureSampler,vUV,0.0);\nfloat lumaM=FxaaLuma(rgbyM);\nfloat lumaS=FxaaLuma(texture2D(textureSampler,sampleCoordS,0.0));\nfloat lumaE=FxaaLuma(texture2D(textureSampler,sampleCoordE,0.0));\nfloat lumaN=FxaaLuma(texture2D(textureSampler,sampleCoordN,0.0));\nfloat lumaW=FxaaLuma(texture2D(textureSampler,sampleCoordW,0.0));\nfloat maxSM=max(lumaS,lumaM);\nfloat minSM=min(lumaS,lumaM);\nfloat maxESM=max(lumaE,maxSM);\nfloat minESM=min(lumaE,minSM);\nfloat maxWN=max(lumaN,lumaW);\nfloat minWN=min(lumaN,lumaW);\nfloat rangeMax=max(maxWN,maxESM);\nfloat rangeMin=min(minWN,minESM);\nfloat rangeMaxScaled=rangeMax*fxaaQualityEdgeThreshold;\nfloat range=rangeMax-rangeMin;\nfloat rangeMaxClamped=max(fxaaQualityEdgeThresholdMin,rangeMaxScaled);\n#ifndef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\nreturn;\n}\n#endif\nfloat lumaNW=FxaaLuma(texture2D(textureSampler,sampleCoordNW,0.0));\nfloat lumaSE=FxaaLuma(texture2D(textureSampler,sampleCoordSE,0.0));\nfloat lumaNE=FxaaLuma(texture2D(textureSampler,sampleCoordNE,0.0));\nfloat lumaSW=FxaaLuma(texture2D(textureSampler,sampleCoordSW,0.0));\nfloat lumaNS=lumaN+lumaS;\nfloat lumaWE=lumaW+lumaE;\nfloat subpixRcpRange=1.0/range;\nfloat subpixNSWE=lumaNS+lumaWE;\nfloat edgeHorz1=(-2.0*lumaM)+lumaNS;\nfloat edgeVert1=(-2.0*lumaM)+lumaWE;\nfloat lumaNESE=lumaNE+lumaSE;\nfloat lumaNWNE=lumaNW+lumaNE;\nfloat edgeHorz2=(-2.0*lumaE)+lumaNESE;\nfloat edgeVert2=(-2.0*lumaN)+lumaNWNE;\nfloat lumaNWSW=lumaNW+lumaSW;\nfloat lumaSWSE=lumaSW+lumaSE;\nfloat edgeHorz4=(abs(edgeHorz1)*2.0)+abs(edgeHorz2);\nfloat edgeVert4=(abs(edgeVert1)*2.0)+abs(edgeVert2);\nfloat edgeHorz3=(-2.0*lumaW)+lumaNWSW;\nfloat edgeVert3=(-2.0*lumaS)+lumaSWSE;\nfloat edgeHorz=abs(edgeHorz3)+edgeHorz4;\nfloat edgeVert=abs(edgeVert3)+edgeVert4;\nfloat subpixNWSWNESE=lumaNWSW+lumaNESE;\nfloat lengthSign=texelSize.x;\nbool horzSpan=edgeHorz>=edgeVert;\nfloat subpixA=subpixNSWE*2.0+subpixNWSWNESE;\nif (!horzSpan)\n{\nlumaN=lumaW;\n}\nif (!horzSpan)\n{\nlumaS=lumaE;\n}\nif (horzSpan)\n{\nlengthSign=texelSize.y;\n}\nfloat subpixB=(subpixA*(1.0/12.0))-lumaM;\nfloat gradientN=lumaN-lumaM;\nfloat gradientS=lumaS-lumaM;\nfloat lumaNN=lumaN+lumaM;\nfloat lumaSS=lumaS+lumaM;\nbool pairN=abs(gradientN)>=abs(gradientS);\nfloat gradient=max(abs(gradientN),abs(gradientS));\nif (pairN)\n{\nlengthSign=-lengthSign;\n}\nfloat subpixC=clamp(abs(subpixB)*subpixRcpRange,0.0,1.0);\nvec2 posB;\nposB.x=posM.x;\nposB.y=posM.y;\nvec2 offNP;\noffNP.x=(!horzSpan) ? 0.0 : texelSize.x;\noffNP.y=(horzSpan) ? 0.0 : texelSize.y;\nif (!horzSpan)\n{\nposB.x+=lengthSign*0.5;\n}\nif (horzSpan)\n{\nposB.y+=lengthSign*0.5;\n}\nvec2 posN;\nposN.x=posB.x-offNP.x*1.5;\nposN.y=posB.y-offNP.y*1.5;\nvec2 posP;\nposP.x=posB.x+offNP.x*1.5;\nposP.y=posB.y+offNP.y*1.5;\nfloat subpixD=((-2.0)*subpixC)+3.0;\nfloat lumaEndN=FxaaLuma(texture2D(textureSampler,posN,0.0));\nfloat subpixE=subpixC*subpixC;\nfloat lumaEndP=FxaaLuma(texture2D(textureSampler,posP,0.0));\nif (!pairN)\n{\nlumaNN=lumaSS;\n}\nfloat gradientScaled=gradient*1.0/4.0;\nfloat lumaMM=lumaM-lumaNN*0.5;\nfloat subpixF=subpixD*subpixE;\nbool lumaMLTZero=lumaMM<0.0;\nlumaEndN-=lumaNN*0.5;\nlumaEndP-=lumaNN*0.5;\nbool doneN=abs(lumaEndN)>=gradientScaled;\nbool doneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN)\n{\nposN.x-=offNP.x*3.0;\n}\nif (!doneN)\n{\nposN.y-=offNP.y*3.0;\n}\nbool doneNP=(!doneN) || (!doneP);\nif (!doneP)\n{\nposP.x+=offNP.x*3.0;\n}\nif (!doneP)\n{\nposP.y+=offNP.y*3.0;\n}\nif (doneNP)\n{\nif (!doneN) lumaEndN=FxaaLuma(texture2D(textureSampler,posN.xy,0.0));\nif (!doneP) lumaEndP=FxaaLuma(texture2D(textureSampler,posP.xy,0.0));\nif (!doneN) lumaEndN=lumaEndN-lumaNN*0.5;\nif (!doneP) lumaEndP=lumaEndP-lumaNN*0.5;\ndoneN=abs(lumaEndN)>=gradientScaled;\ndoneP=abs(lumaEndP)>=gradientScaled;\nif (!doneN) posN.x-=offNP.x*12.0;\nif (!doneN) posN.y-=offNP.y*12.0;\ndoneNP=(!doneN) || (!doneP);\nif (!doneP) posP.x+=offNP.x*12.0;\nif (!doneP) posP.y+=offNP.y*12.0;\n}\nfloat dstN=posM.x-posN.x;\nfloat dstP=posP.x-posM.x;\nif (!horzSpan)\n{\ndstN=posM.y-posN.y;\n}\nif (!horzSpan)\n{\ndstP=posP.y-posM.y;\n}\nbool goodSpanN=(lumaEndN<0.0) != lumaMLTZero;\nfloat spanLength=(dstP+dstN);\nbool goodSpanP=(lumaEndP<0.0) != lumaMLTZero;\nfloat spanLengthRcp=1.0/spanLength;\nbool directionN=dstN<dstP;\nfloat dst=min(dstN,dstP);\nbool goodSpan=directionN ? goodSpanN : goodSpanP;\nfloat subpixG=subpixF*subpixF;\nfloat pixelOffset=(dst*(-spanLengthRcp))+0.5;\nfloat subpixH=subpixG*fxaaQualitySubpix;\nfloat pixelOffsetGood=goodSpan ? pixelOffset : 0.0;\nfloat pixelOffsetSubpix=max(pixelOffsetGood,subpixH);\nif (!horzSpan)\n{\nposM.x+=pixelOffsetSubpix*lengthSign;\n}\nif (horzSpan)\n{\nposM.y+=pixelOffsetSubpix*lengthSign;\n}\n#ifdef MALI\nif(range<rangeMaxClamped)\n{\ngl_FragColor=rgbyM;\n}\nelse\n{\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n}\n#else\ngl_FragColor=texture2D(textureSampler,posM,0.0);\n#endif\n}`;\n        ze.a.ShadersStore.fxaaPixelShader = Fm;\n        var Bm = `\nattribute vec2 position;\nuniform vec2 texelSize;\n\nvarying vec2 vUV;\nvarying vec2 sampleCoordS;\nvarying vec2 sampleCoordE;\nvarying vec2 sampleCoordN;\nvarying vec2 sampleCoordW;\nvarying vec2 sampleCoordNW;\nvarying vec2 sampleCoordSE;\nvarying vec2 sampleCoordNE;\nvarying vec2 sampleCoordSW;\nconst vec2 madd=vec2(0.5,0.5);\nvoid main(void) {\nvUV=(position*madd+madd);\nsampleCoordS=vUV+vec2( 0.0,1.0)*texelSize;\nsampleCoordE=vUV+vec2( 1.0,0.0)*texelSize;\nsampleCoordN=vUV+vec2( 0.0,-1.0)*texelSize;\nsampleCoordW=vUV+vec2(-1.0,0.0)*texelSize;\nsampleCoordNW=vUV+vec2(-1.0,-1.0)*texelSize;\nsampleCoordSE=vUV+vec2( 1.0,1.0)*texelSize;\nsampleCoordNE=vUV+vec2( 1.0,-1.0)*texelSize;\nsampleCoordSW=vUV+vec2(-1.0,1.0)*texelSize;\ngl_Position=vec4(position,0.0,1.0);\n}`;\n        ze.a.ShadersStore.fxaaVertexShader = Bm;\n        var vo = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            i === void 0 && (i = null), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var p = r.call(this, e, \"fxaa\", [\"texelSize\"], null, n, i, o || Ne.a.BILINEAR_SAMPLINGMODE, a, s, null, d, \"fxaa\", void 0, !0) || this, y = p._getDefines();\n            return p.updateEffect(y), p.onApplyObservable.add(function(P) {\n              var R = p.texelSize;\n              P.setFloat2(\"texelSize\", R.x, R.y);\n            }), p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"FxaaPostProcess\";\n          }, t.prototype._getDefines = function() {\n            var e = this.getEngine();\n            if (!e)\n              return null;\n            var n = e.getGlInfo();\n            return n && n.renderer && n.renderer.toLowerCase().indexOf(\"mali\") > -1 ? `#define MALI 1\n` : null;\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.FxaaPostProcess\"] = vo;\n        var Um = `#include<helperFunctions>\n\nuniform sampler2D textureSampler;\n\nuniform float intensity;\nuniform float animatedSeed;\n\nvarying vec2 vUV;\nvoid main(void)\n{\ngl_FragColor=texture2D(textureSampler,vUV);\nvec2 seed=vUV*(animatedSeed);\nfloat grain=dither(seed,intensity);\n\nfloat lum=getLuminance(gl_FragColor.rgb);\nfloat grainAmount=(cos(-PI+(lum*PI*2.))+1.)/2.;\ngl_FragColor.rgb+=grain*grainAmount;\ngl_FragColor.rgb=max(gl_FragColor.rgb,0.0);\n}`;\n        ze.a.ShadersStore.grainPixelShader = Um;\n        var Oc = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"grain\", [\"intensity\", \"animatedSeed\"], [], n, i, o, a, s, null, d, void 0, null, p) || this;\n            return y.intensity = 30, y.animated = !1, y.onApplyObservable.add(function(P) {\n              P.setFloat(\"intensity\", y.intensity), P.setFloat(\"animatedSeed\", y.animated ? Math.random() + 1 : 1);\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"GrainPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"intensity\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"animated\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.GrainPostProcess\"] = Oc;\n        var Vm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nconst vec3 RGBLuminanceCoefficients=vec3(0.2126,0.7152,0.0722);\nvoid main(void)\n{\nvec4 tex=texture2D(textureSampler,vUV);\nvec3 c=tex.rgb;\nfloat luma=dot(c.rgb,RGBLuminanceCoefficients);\n\n\ngl_FragColor=vec4(pow(c,vec3(25.0-luma*15.0)),tex.a);\n}`;\n        ze.a.ShadersStore.highlightsPixelShader = Vm;\n        var km = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            return d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), r.call(this, e, \"highlights\", null, null, n, i, o, a, s, null, d) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"HighlightsPostProcess\";\n          }, t;\n        }(ft);\n        ze.a.IncludesShadersStore.mrtFragmentDeclaration = `#if __VERSION__>=200\nlayout(location=0) out vec4 glFragData[{X}];\n#endif\n`;\n        var Gm = `#extension GL_EXT_draw_buffers : require\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\nprecision highp float;\nprecision highp int;\n#ifdef BUMP\nvarying mat4 vWorldView;\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#ifdef NEED_UV\nvarying vec2 vUV;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#ifdef REFLECTIVITY\nvarying vec2 vReflectivityUV;\nuniform sampler2D reflectivitySampler;\n#endif\n#ifdef ALPHATEST\nuniform sampler2D diffuseSampler;\n#endif\n#include<mrtFragmentDeclaration>[RENDER_TARGET_COUNT]\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\nvoid main() {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\nvec3 normalOutput;\n#ifdef BUMP\nvec3 normalW=normalize(vNormalW);\n#include<bumpFragment>\nnormalOutput=normalize(vec3(vWorldView*vec4(normalW,0.0)));\n#else\nnormalOutput=normalize(vNormalV);\n#endif\n#ifdef PREPASS\n#ifdef PREPASS_DEPTHNORMAL\ngl_FragData[DEPTHNORMAL_INDEX]=vec4(vViewPos.z/vViewPos.w,normalOutput);\n#endif\n#else\ngl_FragData[0]=vec4(vViewPos.z/vViewPos.w,0.0,0.0,1.0);\ngl_FragData[1]=vec4(normalOutput,1.0);\n#endif\n#ifdef POSITION\ngl_FragData[POSITION_INDEX]=vec4(vPositionW,1.0);\n#endif\n#ifdef VELOCITY\nvec2 a=(vCurrentPosition.xy/vCurrentPosition.w)*0.5+0.5;\nvec2 b=(vPreviousPosition.xy/vPreviousPosition.w)*0.5+0.5;\nvec2 velocity=abs(a-b);\nvelocity=vec2(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;\ngl_FragData[VELOCITY_INDEX]=vec4(velocity,0.0,1.0);\n#endif\n#ifdef REFLECTIVITY\n#ifdef HAS_SPECULAR\n\nvec4 reflectivity=texture2D(reflectivitySampler,vReflectivityUV);\n#elif HAS_REFLECTIVITY\n\nvec4 reflectivity=vec4(texture2D(reflectivitySampler,vReflectivityUV).rgb,1.0);\n#else\nvec4 reflectivity=vec4(0.0,0.0,0.0,1.0);\n#endif\ngl_FragData[REFLECTIVITY_INDEX]=reflectivity;\n#endif\n}`;\n        ze.a.ShadersStore.geometryPixelShader = Gm;\n        var zm = `precision highp float;\nprecision highp int;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#include<instancesDeclaration>\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef NEED_UV\nvarying vec2 vUV;\n#ifdef ALPHATEST\nuniform mat4 diffuseMatrix;\n#endif\n#ifdef BUMP\nuniform mat4 bumpMatrix;\nvarying vec2 vBumpUV;\n#endif\n#ifdef REFLECTIVITY\nuniform mat4 reflectivityMatrix;\nvarying vec2 vReflectivityUV;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef BUMP\nvarying mat4 vWorldView;\n#endif\n#ifdef BUMP\nvarying vec3 vNormalW;\n#else\nvarying vec3 vNormalV;\n#endif\nvarying vec4 vViewPos;\n#if defined(POSITION) || defined(BUMP)\nvarying vec3 vPositionW;\n#endif\n#ifdef VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\n#ifdef BONES_VELOCITY_ENABLED\n#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mPreviousBones[BonesPerMesh];\n#endif\n#endif\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#if defined(VELOCITY) && !defined(BONES_VELOCITY_ENABLED)\n\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#include<bonesVertex>\nvec4 pos=vec4(finalWorld*vec4(positionUpdated,1.0));\n#ifdef BUMP\nvWorldView=view*finalWorld;\nvNormalW=normalUpdated;\n#else\nvNormalV=normalize(vec3((view*finalWorld)*vec4(normalUpdated,0.0)));\n#endif\nvViewPos=view*pos;\n#if defined(VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif\n#if defined(POSITION) || defined(BUMP)\nvPositionW=pos.xyz/pos.w;\n#endif\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#ifdef NEED_UV\n#ifdef UV1\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#else\nvUV=uv;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#endif\n#ifdef UV2\n#ifdef ALPHATEST\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#else\nvUV=uv2;\n#endif\n#ifdef BUMP\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n#endif\n#ifdef REFLECTIVITY\nvReflectivityUV=vec2(reflectivityMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#endif\n#include<bumpVertex>\n}\n`;\n        ze.a.ShadersStore.geometryVertexShader = zm;\n        var ri = function() {\n          function r(t, e) {\n            e === void 0 && (e = 1), this._previousTransformationMatrices = {}, this._previousBonesTransformationMatrices = {}, this.excludedSkinnedMeshesFromVelocity = [], this.renderTransparentMeshes = !0, this._resizeObserver = null, this._enablePosition = !1, this._enableVelocity = !1, this._enableReflectivity = !1, this._positionIndex = -1, this._velocityIndex = -1, this._reflectivityIndex = -1, this._depthNormalIndex = -1, this._linkedWithPrePass = !1, this._scene = t, this._ratio = e, r._SceneComponentInitialization(this._scene), this._createRenderTargets();\n          }\n          return r.prototype._linkPrePassRenderer = function(t) {\n            this._linkedWithPrePass = !0, this._prePassRenderer = t, this._multiRenderTarget && (this._multiRenderTarget.onClearObservable.clear(), this._multiRenderTarget.onClearObservable.add(function(e) {\n            }));\n          }, r.prototype._unlinkPrePassRenderer = function() {\n            this._linkedWithPrePass = !1, this._createRenderTargets();\n          }, r.prototype._resetLayout = function() {\n            this._enablePosition = !1, this._enableReflectivity = !1, this._enableVelocity = !1, this._attachments = [];\n          }, r.prototype._forceTextureType = function(t, e) {\n            t === r.POSITION_TEXTURE_TYPE ? (this._positionIndex = e, this._enablePosition = !0) : t === r.VELOCITY_TEXTURE_TYPE ? (this._velocityIndex = e, this._enableVelocity = !0) : t === r.REFLECTIVITY_TEXTURE_TYPE ? (this._reflectivityIndex = e, this._enableReflectivity = !0) : t === r.DEPTHNORMAL_TEXTURE_TYPE && (this._depthNormalIndex = e);\n          }, r.prototype._setAttachments = function(t) {\n            this._attachments = t;\n          }, r.prototype._linkInternalTexture = function(t) {\n            this._multiRenderTarget._texture = t;\n          }, Object.defineProperty(r.prototype, \"renderList\", { get: function() {\n            return this._multiRenderTarget.renderList;\n          }, set: function(t) {\n            this._multiRenderTarget.renderList = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            return this._multiRenderTarget.isSupported;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getTextureIndex = function(t) {\n            switch (t) {\n              case r.POSITION_TEXTURE_TYPE:\n                return this._positionIndex;\n              case r.VELOCITY_TEXTURE_TYPE:\n                return this._velocityIndex;\n              case r.REFLECTIVITY_TEXTURE_TYPE:\n                return this._reflectivityIndex;\n              default:\n                return -1;\n            }\n          }, Object.defineProperty(r.prototype, \"enablePosition\", { get: function() {\n            return this._enablePosition;\n          }, set: function(t) {\n            this._enablePosition = t, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"enableVelocity\", { get: function() {\n            return this._enableVelocity;\n          }, set: function(t) {\n            this._enableVelocity = t, t || (this._previousTransformationMatrices = {}), this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"enableReflectivity\", { get: function() {\n            return this._enableReflectivity;\n          }, set: function(t) {\n            this._enableReflectivity = t, this._linkedWithPrePass || (this.dispose(), this._createRenderTargets());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ratio\", { get: function() {\n            return this._ratio;\n          }, enumerable: !1, configurable: !0 }), r.prototype.isReady = function(t, e) {\n            var n = t.getMaterial();\n            if (n && n.disableDepthWrite)\n              return !1;\n            var i = [], o = [Oe.b.PositionKind, Oe.b.NormalKind], a = t.getMesh();\n            if (n) {\n              var s = !1;\n              n.needAlphaTesting() && (i.push(\"#define ALPHATEST\"), s = !0), n.bumpTexture && Nt.a.BumpTextureEnabled && (i.push(\"#define BUMP\"), i.push(\"#define BUMPDIRECTUV 0\"), s = !0), this._enableReflectivity && (n instanceof Nt.a && n.specularTexture ? (i.push(\"#define HAS_SPECULAR\"), s = !0) : n instanceof $r && n.reflectivityTexture && (i.push(\"#define HAS_REFLECTIVITY\"), s = !0)), s && (i.push(\"#define NEED_UV\"), a.isVerticesDataPresent(Oe.b.UVKind) && (o.push(Oe.b.UVKind), i.push(\"#define UV1\")), a.isVerticesDataPresent(Oe.b.UV2Kind) && (o.push(Oe.b.UV2Kind), i.push(\"#define UV2\")));\n            }\n            this._linkedWithPrePass && (i.push(\"#define PREPASS\"), this._depthNormalIndex !== -1 && (i.push(\"#define DEPTHNORMAL_INDEX \" + this._depthNormalIndex), i.push(\"#define PREPASS_DEPTHNORMAL\"))), this._enablePosition && (i.push(\"#define POSITION\"), i.push(\"#define POSITION_INDEX \" + this._positionIndex)), this._enableVelocity && (i.push(\"#define VELOCITY\"), i.push(\"#define VELOCITY_INDEX \" + this._velocityIndex), this.excludedSkinnedMeshesFromVelocity.indexOf(a) === -1 && i.push(\"#define BONES_VELOCITY_ENABLED\")), this._enableReflectivity && (i.push(\"#define REFLECTIVITY\"), i.push(\"#define REFLECTIVITY_INDEX \" + this._reflectivityIndex)), a.useBones && a.computeBonesUsingShaders ? (o.push(Oe.b.MatricesIndicesKind), o.push(Oe.b.MatricesWeightsKind), a.numBoneInfluencers > 4 && (o.push(Oe.b.MatricesIndicesExtraKind), o.push(Oe.b.MatricesWeightsExtraKind)), i.push(\"#define NUM_BONE_INFLUENCERS \" + a.numBoneInfluencers), i.push(\"#define BonesPerMesh \" + (a.skeleton ? a.skeleton.bones.length + 1 : 0))) : i.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var d = a.morphTargetManager, p = 0;\n            d && d.numInfluencers > 0 && (p = d.numInfluencers, i.push(\"#define MORPHTARGETS\"), i.push(\"#define NUM_MORPH_INFLUENCERS \" + p), $e.a.PrepareAttributesForMorphTargetsInfluencers(o, a, p)), e && (i.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(o), t.getRenderingMesh().hasThinInstances && i.push(\"#define THIN_INSTANCES\")), this._linkedWithPrePass ? i.push(\"#define RENDER_TARGET_COUNT \" + this._attachments.length) : i.push(\"#define RENDER_TARGET_COUNT \" + this._multiRenderTarget.textures.length);\n            var y = i.join(`\n`);\n            return this._cachedDefines !== y && (this._cachedDefines = y, this._effect = this._scene.getEngine().createEffect(\"geometry\", o, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"view\", \"previousWorld\", \"previousViewProjection\", \"mPreviousBones\", \"morphTargetInfluences\", \"bumpMatrix\", \"reflectivityMatrix\", \"vTangentSpaceParams\", \"vBumpInfos\"], [\"diffuseSampler\", \"bumpSampler\", \"reflectivitySampler\"], y, void 0, void 0, void 0, { buffersCount: this._multiRenderTarget.textures.length - 1, maxSimultaneousMorphTargets: p })), this._effect.isReady();\n          }, r.prototype.getGBuffer = function() {\n            return this._multiRenderTarget;\n          }, Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this._multiRenderTarget.samples;\n          }, set: function(t) {\n            this._multiRenderTarget.samples = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this.getGBuffer().dispose();\n          }, r.prototype._assignRenderTargetIndices = function() {\n            var t = 2;\n            return this._enablePosition && (this._positionIndex = t, t++), this._enableVelocity && (this._velocityIndex = t, t++), this._enableReflectivity && (this._reflectivityIndex = t, t++), t;\n          }, r.prototype._createRenderTargets = function() {\n            var t = this, e = this._scene.getEngine(), n = this._assignRenderTargetIndices();\n            if (this._multiRenderTarget = new Vs(\"gBuffer\", { width: e.getRenderWidth() * this._ratio, height: e.getRenderHeight() * this._ratio }, n, this._scene, { generateMipMaps: !1, generateDepthTexture: !0, defaultType: h.a.TEXTURETYPE_FLOAT }), this.isSupported) {\n              this._multiRenderTarget.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._multiRenderTarget.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._multiRenderTarget.refreshRate = 1, this._multiRenderTarget.renderParticles = !1, this._multiRenderTarget.renderList = null, this._multiRenderTarget.onClearObservable.add(function(o) {\n                o.clear(new I.b(0, 0, 0, 1), !0, !0, !0);\n              }), this._resizeObserver = e.onResizeObservable.add(function() {\n                t._multiRenderTarget && t._multiRenderTarget.resize({ width: e.getRenderWidth() * t._ratio, height: e.getRenderHeight() * t._ratio });\n              });\n              var i = function(o) {\n                var a = o.getRenderingMesh(), s = o.getEffectiveMesh(), d = t._scene, p = d.getEngine(), y = o.getMaterial();\n                if (y) {\n                  if (s._internalAbstractMeshDataInfo._isActiveIntermediate = !1, t._enableVelocity && !t._previousTransformationMatrices[s.uniqueId] && (t._previousTransformationMatrices[s.uniqueId] = { world: u.a.Identity(), viewProjection: d.getTransformMatrix() }, a.skeleton)) {\n                    var P = a.skeleton.getTransformMatrices(a);\n                    t._previousBonesTransformationMatrices[a.uniqueId] = t._copyBonesTransformationMatrices(P, new Float32Array(P.length));\n                  }\n                  var R = a._getInstancesRenderList(o._id, !!o.getReplacementMesh());\n                  if (!R.mustReturn) {\n                    var B = p.getCaps().instancedArrays && (R.visibleInstances[o._id] !== null || a.hasThinInstances), F = s.getWorldMatrix();\n                    if (t.isReady(o, B)) {\n                      if (p.enableEffect(t._effect), a._bind(o, t._effect, y.fillMode), t._effect.setMatrix(\"viewProjection\", d.getTransformMatrix()), t._effect.setMatrix(\"view\", d.getViewMatrix()), y) {\n                        var z, J = s._instanceDataStorage;\n                        if (J.isFrozen || !y.backFaceCulling && y.overrideMaterialSideOrientation === null)\n                          z = J.sideOrientation;\n                        else {\n                          var ie = s._getWorldMatrixDeterminant();\n                          (z = y.overrideMaterialSideOrientation) == null && (z = y.sideOrientation), ie < 0 && (z = z === zt.a.ClockWiseSideOrientation ? zt.a.CounterClockWiseSideOrientation : zt.a.ClockWiseSideOrientation);\n                        }\n                        if (y._preBind(t._effect, z), y.needAlphaTesting()) {\n                          var se = y.getAlphaTestTexture();\n                          se && (t._effect.setTexture(\"diffuseSampler\", se), t._effect.setMatrix(\"diffuseMatrix\", se.getTextureMatrix()));\n                        }\n                        y.bumpTexture && d.getEngine().getCaps().standardDerivatives && Nt.a.BumpTextureEnabled && (t._effect.setFloat3(\"vBumpInfos\", y.bumpTexture.coordinatesIndex, 1 / y.bumpTexture.level, y.parallaxScaleBias), t._effect.setMatrix(\"bumpMatrix\", y.bumpTexture.getTextureMatrix()), t._effect.setTexture(\"bumpSampler\", y.bumpTexture), t._effect.setFloat2(\"vTangentSpaceParams\", y.invertNormalMapX ? -1 : 1, y.invertNormalMapY ? -1 : 1)), t._enableReflectivity && (y instanceof Nt.a && y.specularTexture ? (t._effect.setMatrix(\"reflectivityMatrix\", y.specularTexture.getTextureMatrix()), t._effect.setTexture(\"reflectivitySampler\", y.specularTexture)) : y instanceof $r && y.reflectivityTexture && (t._effect.setMatrix(\"reflectivityMatrix\", y.reflectivityTexture.getTextureMatrix()), t._effect.setTexture(\"reflectivitySampler\", y.reflectivityTexture)));\n                      }\n                      a.useBones && a.computeBonesUsingShaders && a.skeleton && (t._effect.setMatrices(\"mBones\", a.skeleton.getTransformMatrices(a)), t._enableVelocity && t._effect.setMatrices(\"mPreviousBones\", t._previousBonesTransformationMatrices[a.uniqueId])), $e.a.BindMorphTargetParameters(a, t._effect), t._enableVelocity && (t._effect.setMatrix(\"previousWorld\", t._previousTransformationMatrices[s.uniqueId].world), t._effect.setMatrix(\"previousViewProjection\", t._previousTransformationMatrices[s.uniqueId].viewProjection)), a._processRendering(s, o, t._effect, y.fillMode, R, B, function(ce, ue) {\n                        return t._effect.setMatrix(\"world\", ue);\n                      });\n                    }\n                    t._enableVelocity && (t._previousTransformationMatrices[s.uniqueId].world = F.clone(), t._previousTransformationMatrices[s.uniqueId].viewProjection = t._scene.getTransformMatrix().clone(), a.skeleton && t._copyBonesTransformationMatrices(a.skeleton.getTransformMatrices(a), t._previousBonesTransformationMatrices[s.uniqueId]));\n                  }\n                }\n              };\n              this._multiRenderTarget.customRenderFunction = function(o, a, s, d) {\n                var p;\n                if (t._linkedWithPrePass) {\n                  if (!t._prePassRenderer.enabled)\n                    return;\n                  t._scene.getEngine().bindAttachments(t._attachments);\n                }\n                if (d.length) {\n                  for (e.setColorWrite(!1), p = 0; p < d.length; p++)\n                    i(d.data[p]);\n                  e.setColorWrite(!0);\n                }\n                for (p = 0; p < o.length; p++)\n                  i(o.data[p]);\n                for (p = 0; p < a.length; p++)\n                  i(a.data[p]);\n                if (t.renderTransparentMeshes)\n                  for (p = 0; p < s.length; p++)\n                    i(s.data[p]);\n              };\n            }\n          }, r.prototype._copyBonesTransformationMatrices = function(t, e) {\n            for (var n = 0; n < t.length; n++)\n              e[n] = t[n];\n            return e;\n          }, r.DEPTHNORMAL_TEXTURE_TYPE = 0, r.POSITION_TEXTURE_TYPE = 1, r.VELOCITY_TEXTURE_TYPE = 2, r.REFLECTIVITY_TEXTURE_TYPE = 3, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"GeometryBufferRendererSceneComponent\");\n          }, r;\n        }(), jm = function() {\n          this.enabled = !1, this.name = \"motionBlur\", this.texturesRequired = [h.a.PREPASS_VELOCITY_TEXTURE_TYPE];\n        };\n        Object.defineProperty(_e.a.prototype, \"geometryBufferRenderer\", { get: function() {\n          this._geometryBufferRenderer;\n        }, set: function(r) {\n          r && r.isSupported && (this._geometryBufferRenderer = r);\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.enableGeometryBufferRenderer = function(r) {\n          return r === void 0 && (r = 1), this._geometryBufferRenderer || (this._geometryBufferRenderer = new ri(this, r), this._geometryBufferRenderer.isSupported || (this._geometryBufferRenderer = null)), this._geometryBufferRenderer;\n        }, _e.a.prototype.disableGeometryBufferRenderer = function() {\n          this._geometryBufferRenderer && (this._geometryBufferRenderer.dispose(), this._geometryBufferRenderer = null);\n        };\n        var yd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_GEOMETRYBUFFERRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER, this, this._gatherRenderTargets);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype._gatherRenderTargets = function(t) {\n            this.scene._geometryBufferRenderer && t.push(this.scene._geometryBufferRenderer.getGBuffer());\n          }, r;\n        }();\n        ri._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_GEOMETRYBUFFERRENDERER);\n          t || (t = new yd(r), r._addComponent(t));\n        };\n        var Hm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float motionStrength;\nuniform float motionScale;\nuniform vec2 screenSize;\n#ifdef OBJECT_BASED\nuniform sampler2D velocitySampler;\n#else\nuniform sampler2D depthSampler;\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\n#endif\nvoid main(void)\n{\n#ifdef GEOMETRY_SUPPORTED\n#ifdef OBJECT_BASED\nvec2 texelSize=1.0/screenSize;\nvec2 velocityColor=texture2D(velocitySampler,vUV).rg*2.0-1.0;\nvec2 velocity=vec2(pow(velocityColor.r,3.0),pow(velocityColor.g,3.0));\nvelocity*=motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint samplesCount=int(clamp(speed,1.0,SAMPLES));\nvelocity=normalize(velocity)*texelSize;\nfloat hlim=float(-samplesCount)*0.5+0.5;\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i)\n{\nif (i>=samplesCount)\nbreak;\nvec2 offset=vUV+velocity*(hlim+float(i));\nresult+=texture2D(textureSampler,offset);\n}\ngl_FragColor=result/float(samplesCount);\ngl_FragColor.a=1.0;\n#else\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n#endif\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n`;\n        ze.a.ShadersStore.motionBlurPixelShader = Hm;\n        var Mc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1), P === void 0 && (P = !0);\n            var R = r.call(this, e, \"motionBlur\", [\"motionStrength\", \"motionScale\", \"screenSize\", \"inverseViewProjection\", \"prevViewProjection\"], [\"velocitySampler\"], i, o, a, s, d, `#define GEOMETRY_SUPPORTED\n#define SAMPLES 64.0\n#define OBJECT_BASED`, p, void 0, null, y) || this;\n            return R.motionStrength = 1, R._motionBlurSamples = 32, R._isObjectBased = !0, R._forceGeometryBuffer = !1, R._geometryBufferRenderer = null, R._prePassRenderer = null, R._invViewProjection = null, R._previousViewProjection = null, R._forceGeometryBuffer = P, R._forceGeometryBuffer ? (R._geometryBufferRenderer = n.enableGeometryBufferRenderer(), R._geometryBufferRenderer && (R._geometryBufferRenderer.enableVelocity = !0)) : (R._prePassRenderer = n.enablePrePassRenderer(), R._prePassRenderer && (R._prePassRenderer.markAsDirty(), R._prePassEffectConfiguration = new jm())), R._applyMode(), R;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"motionBlurSamples\", { get: function() {\n            return this._motionBlurSamples;\n          }, set: function(e) {\n            this._motionBlurSamples = e, this._updateEffect();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"isObjectBased\", { get: function() {\n            return this._isObjectBased;\n          }, set: function(e) {\n            this._isObjectBased !== e && (this._isObjectBased = e, this._applyMode());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"MotionBlurPostProcess\";\n          }, t.prototype.excludeSkinnedMesh = function(e) {\n            if (e.skeleton) {\n              var n = void 0;\n              if (this._geometryBufferRenderer)\n                n = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\n              else {\n                if (!this._prePassRenderer)\n                  return;\n                n = this._prePassRenderer.excludedSkinnedMesh;\n              }\n              n.push(e);\n            }\n          }, t.prototype.removeExcludedSkinnedMesh = function(e) {\n            if (e.skeleton) {\n              var n = void 0;\n              if (this._geometryBufferRenderer)\n                n = this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity;\n              else {\n                if (!this._prePassRenderer)\n                  return;\n                n = this._prePassRenderer.excludedSkinnedMesh;\n              }\n              var i = n.indexOf(e);\n              i !== -1 && n.splice(i, 1);\n            }\n          }, t.prototype.dispose = function(e) {\n            this._geometryBufferRenderer && (this._geometryBufferRenderer._previousTransformationMatrices = {}, this._geometryBufferRenderer._previousBonesTransformationMatrices = {}, this._geometryBufferRenderer.excludedSkinnedMeshesFromVelocity = []), r.prototype.dispose.call(this, e);\n          }, t.prototype._applyMode = function() {\n            var e = this;\n            if (!this._geometryBufferRenderer && !this._prePassRenderer)\n              return l.a.Warn(\"Multiple Render Target support needed to compute object based motion blur\"), this.updateEffect();\n            this._updateEffect(), this._invViewProjection = null, this._previousViewProjection = null, this.isObjectBased ? (this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = h.a.PREPASS_VELOCITY_TEXTURE_TYPE), this.onApply = function(n) {\n              return e._onApplyObjectBased(n);\n            }) : (this._invViewProjection = u.a.Identity(), this._previousViewProjection = u.a.Identity(), this._prePassRenderer && this._prePassEffectConfiguration && (this._prePassEffectConfiguration.texturesRequired[0] = h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE), this.onApply = function(n) {\n              return e._onApplyScreenBased(n);\n            });\n          }, t.prototype._onApplyObjectBased = function(e) {\n            if (e.setVector2(\"screenSize\", new u.d(this.width, this.height)), e.setFloat(\"motionScale\", this._scene.getAnimationRatio()), e.setFloat(\"motionStrength\", this.motionStrength), this._geometryBufferRenderer) {\n              var n = this._geometryBufferRenderer.getTextureIndex(ri.VELOCITY_TEXTURE_TYPE);\n              e.setTexture(\"velocitySampler\", this._geometryBufferRenderer.getGBuffer().textures[n]);\n            } else\n              this._prePassRenderer && (n = this._prePassRenderer.getIndex(h.a.PREPASS_VELOCITY_TEXTURE_TYPE), e.setTexture(\"velocitySampler\", this._prePassRenderer.prePassRT.textures[n]));\n          }, t.prototype._onApplyScreenBased = function(e) {\n            var n = this._scene.getProjectionMatrix().multiply(this._scene.getViewMatrix());\n            if (n.invertToRef(this._invViewProjection), e.setMatrix(\"inverseViewProjection\", this._invViewProjection), e.setMatrix(\"prevViewProjection\", this._previousViewProjection), this._previousViewProjection = n, e.setVector2(\"screenSize\", new u.d(this.width, this.height)), e.setFloat(\"motionScale\", this._scene.getAnimationRatio()), e.setFloat(\"motionStrength\", this.motionStrength), this._geometryBufferRenderer) {\n              var i = this._geometryBufferRenderer.getTextureIndex(ri.DEPTHNORMAL_TEXTURE_TYPE);\n              e.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[i]);\n            } else\n              this._prePassRenderer && (i = this._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE), e.setTexture(\"depthSampler\", this._prePassRenderer.prePassRT.textures[i]));\n          }, t.prototype._updateEffect = function() {\n            if (this._geometryBufferRenderer || this._prePassRenderer) {\n              var e = [\"#define GEOMETRY_SUPPORTED\", \"#define SAMPLES \" + this._motionBlurSamples.toFixed(1), this._isObjectBased ? \"#define OBJECT_BASED\" : \"#define SCREEN_BASED\"];\n              this.updateEffect(e.join(`\n`));\n            }\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, i, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable, e.textureType, !1);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"motionStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"motionBlurSamples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"isObjectBased\", null), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.MotionBlurPostProcess\"] = Mc;\n        var Wm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D refractionSampler;\n\nuniform vec3 baseColor;\nuniform float depth;\nuniform float colorLevel;\nvoid main() {\nfloat ref=1.0-texture2D(refractionSampler,vUV).r;\nvec2 uv=vUV-vec2(0.5);\nvec2 offset=uv*depth*ref;\nvec3 sourceColor=texture2D(textureSampler,vUV-offset).rgb;\ngl_FragColor=vec4(sourceColor+sourceColor*ref*colorLevel,1.0);\n}`;\n        ze.a.ShadersStore.refractionPixelShader = Wm;\n        var bd = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            var R = r.call(this, e, \"refraction\", [\"baseColor\", \"depth\", \"colorLevel\"], [\"refractionSampler\"], s, d, p, y, P) || this;\n            return R._ownRefractionTexture = !0, R.color = i, R.depth = o, R.colorLevel = a, R.refractionTextureUrl = n, R.onActivateObservable.add(function(B) {\n              R._refTexture = R._refTexture || new Ne.a(n, B.getScene());\n            }), R.onApplyObservable.add(function(B) {\n              B.setColor3(\"baseColor\", R.color), B.setFloat(\"depth\", R.depth), B.setFloat(\"colorLevel\", R.colorLevel), B.setTexture(\"refractionSampler\", R._refTexture);\n            }), R;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"refractionTexture\", { get: function() {\n            return this._refTexture;\n          }, set: function(e) {\n            this._refTexture && this._ownRefractionTexture && this._refTexture.dispose(), this._refTexture = e, this._ownRefractionTexture = !1;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"RefractionPostProcess\";\n          }, t.prototype.dispose = function(e) {\n            this._refTexture && this._ownRefractionTexture && (this._refTexture.dispose(), this._refTexture = null), r.prototype.dispose.call(this, e);\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.refractionTextureUrl, e.color, e.depth, e.colorLevel, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"color\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"depth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"colorLevel\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"refractionTextureUrl\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.RefractionPostProcess\"] = bd;\n        var Xm = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform vec2 screenSize;\nuniform vec2 sharpnessAmounts;\nvoid main(void)\n{\nvec2 onePixel=vec2(1.0,1.0)/screenSize;\nvec4 color=texture2D(textureSampler,vUV);\nvec4 edgeDetection=texture2D(textureSampler,vUV+onePixel*vec2(0,-1)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(-1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(1,0)) +\ntexture2D(textureSampler,vUV+onePixel*vec2(0,1)) -\ncolor*4.0;\ngl_FragColor=max(vec4(color.rgb*sharpnessAmounts.y,color.a)-(sharpnessAmounts.x*vec4(edgeDetection.rgb,0)),0.);\n}`;\n        ze.a.ShadersStore.sharpenPixelShader = Xm;\n        var Ic = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT), p === void 0 && (p = !1);\n            var y = r.call(this, e, \"sharpen\", [\"sharpnessAmounts\", \"screenSize\"], null, n, i, o, a, s, null, d, void 0, null, p) || this;\n            return y.colorAmount = 1, y.edgeAmount = 0.3, y.onApply = function(P) {\n              P.setFloat2(\"screenSize\", y.width, y.height), P.setFloat2(\"sharpnessAmounts\", y.edgeAmount, y.colorAmount);\n            }, y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SharpenPostProcess\";\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.textureType, e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"colorAmount\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"edgeAmount\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.SharpenPostProcess\"] = Ic;\n        var Ir = function() {\n          function r(t, e) {\n            this.engine = t, this._name = e, this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array(), this._cameras = [];\n          }\n          return Object.defineProperty(r.prototype, \"name\", { get: function() {\n            return this._name;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cameras\", { get: function() {\n            return this._cameras;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"PostProcessRenderPipeline\";\n          }, Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            for (var t in this._renderEffects)\n              if (this._renderEffects.hasOwnProperty(t) && !this._renderEffects[t].isSupported)\n                return !1;\n            return !0;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addEffect = function(t) {\n            this._renderEffects[t._name] = t;\n          }, r.prototype._rebuild = function() {\n          }, r.prototype._enableEffect = function(t, e) {\n            var n = this._renderEffects[t];\n            n && n._enable(Xe.b.MakeArray(e || this._cameras));\n          }, r.prototype._disableEffect = function(t, e) {\n            var n = this._renderEffects[t];\n            n && n._disable(Xe.b.MakeArray(e || this._cameras));\n          }, r.prototype._attachCameras = function(t, e) {\n            var n = Xe.b.MakeArray(t || this._cameras);\n            if (n) {\n              var i, o = [];\n              for (i = 0; i < n.length; i++) {\n                var a = n[i];\n                if (a) {\n                  var s = a.name;\n                  this._cameras.indexOf(a) === -1 ? this._cameras[s] = a : e && o.push(i);\n                }\n              }\n              for (i = 0; i < o.length; i++)\n                t.splice(o[i], 1);\n              for (var d in this._renderEffects)\n                this._renderEffects.hasOwnProperty(d) && this._renderEffects[d]._attachCameras(n);\n            }\n          }, r.prototype._detachCameras = function(t) {\n            var e = Xe.b.MakeArray(t || this._cameras);\n            if (e) {\n              for (var n in this._renderEffects)\n                this._renderEffects.hasOwnProperty(n) && this._renderEffects[n]._detachCameras(e);\n              for (var i = 0; i < e.length; i++)\n                this._cameras.splice(this._cameras.indexOf(e[i]), 1);\n            }\n          }, r.prototype._update = function() {\n            for (var t in this._renderEffects)\n              this._renderEffects.hasOwnProperty(t) && this._renderEffects[t]._update();\n            for (var e = 0; e < this._cameras.length; e++)\n              if (this._cameras[e]) {\n                var n = this._cameras[e].name;\n                this._renderEffectsForIsolatedPass[n] && this._renderEffectsForIsolatedPass[n]._update();\n              }\n          }, r.prototype._reset = function() {\n            this._renderEffects = {}, this._renderEffectsForIsolatedPass = new Array();\n          }, r.prototype._enableMSAAOnFirstPostProcess = function(t) {\n            if (this.engine.webGLVersion === 1)\n              return !1;\n            var e = Object.keys(this._renderEffects);\n            if (e.length > 0) {\n              var n = this._renderEffects[e[0]].getPostProcesses();\n              n && (n[0].samples = t);\n            }\n            return !0;\n          }, r.prototype.setPrePassRenderer = function(t) {\n            return !1;\n          }, r.prototype.dispose = function() {\n          }, Object(c.c)([Object(L.c)()], r.prototype, \"_name\", void 0), r;\n        }(), Td = function() {\n          function r() {\n            this._renderPipelines = {};\n          }\n          return Object.defineProperty(r.prototype, \"supportedPipelines\", { get: function() {\n            var t = [];\n            for (var e in this._renderPipelines)\n              if (this._renderPipelines.hasOwnProperty(e)) {\n                var n = this._renderPipelines[e];\n                n.isSupported && t.push(n);\n              }\n            return t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addPipeline = function(t) {\n            this._renderPipelines[t._name] = t;\n          }, r.prototype.attachCamerasToRenderPipeline = function(t, e, n) {\n            n === void 0 && (n = !1);\n            var i = this._renderPipelines[t];\n            i && i._attachCameras(e, n);\n          }, r.prototype.detachCamerasFromRenderPipeline = function(t, e) {\n            var n = this._renderPipelines[t];\n            n && n._detachCameras(e);\n          }, r.prototype.enableEffectInPipeline = function(t, e, n) {\n            var i = this._renderPipelines[t];\n            i && i._enableEffect(e, n);\n          }, r.prototype.disableEffectInPipeline = function(t, e, n) {\n            var i = this._renderPipelines[t];\n            i && i._disableEffect(e, n);\n          }, r.prototype.update = function() {\n            for (var t in this._renderPipelines)\n              if (this._renderPipelines.hasOwnProperty(t)) {\n                var e = this._renderPipelines[t];\n                e.isSupported ? e._update() : (e.dispose(), delete this._renderPipelines[t]);\n              }\n          }, r.prototype._rebuild = function() {\n            for (var t in this._renderPipelines)\n              this._renderPipelines.hasOwnProperty(t) && this._renderPipelines[t]._rebuild();\n          }, r.prototype.dispose = function() {\n            for (var t in this._renderPipelines)\n              this._renderPipelines.hasOwnProperty(t) && this._renderPipelines[t].dispose();\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"postProcessRenderPipelineManager\", { get: function() {\n          if (!this._postProcessRenderPipelineManager) {\n            var r = this._getComponent(ot.a.NAME_POSTPROCESSRENDERPIPELINEMANAGER);\n            r || (r = new Ed(this), this._addComponent(r)), this._postProcessRenderPipelineManager = new Td();\n          }\n          return this._postProcessRenderPipelineManager;\n        }, enumerable: !0, configurable: !0 });\n        var Ed = function() {\n          function r(t) {\n            this.name = ot.a.NAME_POSTPROCESSRENDERPIPELINEMANAGER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER, this, this._gatherRenderTargets);\n          }, r.prototype.rebuild = function() {\n            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager._rebuild();\n          }, r.prototype.dispose = function() {\n            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.dispose();\n          }, r.prototype._gatherRenderTargets = function() {\n            this.scene._postProcessRenderPipelineManager && this.scene._postProcessRenderPipelineManager.update();\n          }, r;\n        }(), Sd = function(r) {\n          function t(e, n, i, o, a) {\n            e === void 0 && (e = \"\"), n === void 0 && (n = !0), i === void 0 && (i = te.a.LastCreatedScene), a === void 0 && (a = !0);\n            var s = r.call(this, i.getEngine(), e) || this;\n            s._camerasToBeAttached = [], s.SharpenPostProcessId = \"SharpenPostProcessEffect\", s.ImageProcessingPostProcessId = \"ImageProcessingPostProcessEffect\", s.FxaaPostProcessId = \"FxaaPostProcessEffect\", s.ChromaticAberrationPostProcessId = \"ChromaticAberrationPostProcessEffect\", s.GrainPostProcessId = \"GrainPostProcessEffect\", s._glowLayer = null, s.animations = [], s._imageProcessingConfigurationObserver = null, s._sharpenEnabled = !1, s._bloomEnabled = !1, s._depthOfFieldEnabled = !1, s._depthOfFieldBlurLevel = $i.Low, s._fxaaEnabled = !1, s._imageProcessingEnabled = !0, s._bloomScale = 0.5, s._chromaticAberrationEnabled = !1, s._grainEnabled = !1, s._buildAllowed = !0, s.onBuildObservable = new C.c(), s._resizeObserver = null, s._hardwareScaleLevel = 1, s._bloomKernel = 64, s._bloomWeight = 0.15, s._bloomThreshold = 0.9, s._samples = 1, s._hasCleared = !1, s._prevPostProcess = null, s._prevPrevPostProcess = null, s._depthOfFieldSceneObserver = null, s._cameras = o || i.cameras, s._cameras = s._cameras.slice(), s._camerasToBeAttached = s._cameras.slice(), s._buildAllowed = a, s._scene = i;\n            var d = s._scene.getEngine().getCaps();\n            s._hdr = n && (d.textureHalfFloatRender || d.textureFloatRender), s._hdr ? d.textureHalfFloatRender ? s._defaultPipelineTextureType = h.a.TEXTURETYPE_HALF_FLOAT : d.textureFloatRender && (s._defaultPipelineTextureType = h.a.TEXTURETYPE_FLOAT) : s._defaultPipelineTextureType = h.a.TEXTURETYPE_UNSIGNED_INT, i.postProcessRenderPipelineManager.addPipeline(s);\n            var p = s._scene.getEngine();\n            return s.sharpen = new Ic(\"sharpen\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, p, !1, s._defaultPipelineTextureType, !0), s._sharpenEffect = new xt(p, s.SharpenPostProcessId, function() {\n              return s.sharpen;\n            }, !0), s.depthOfField = new Rc(s._scene, null, s._depthOfFieldBlurLevel, s._defaultPipelineTextureType, !0), s.bloom = new Pc(s._scene, s._bloomScale, s._bloomWeight, s.bloomKernel, s._defaultPipelineTextureType, !0), s.chromaticAberration = new xc(\"ChromaticAberration\", p.getRenderWidth(), p.getRenderHeight(), 1, null, Ne.a.BILINEAR_SAMPLINGMODE, p, !1, s._defaultPipelineTextureType, !0), s._chromaticAberrationEffect = new xt(p, s.ChromaticAberrationPostProcessId, function() {\n              return s.chromaticAberration;\n            }, !0), s.grain = new Oc(\"Grain\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, p, !1, s._defaultPipelineTextureType, !0), s._grainEffect = new xt(p, s.GrainPostProcessId, function() {\n              return s.grain;\n            }, !0), s._resizeObserver = p.onResizeObservable.add(function() {\n              s._hardwareScaleLevel = p.getHardwareScalingLevel(), s.bloomKernel = s.bloomKernel;\n            }), s._imageProcessingConfigurationObserver = s._scene.imageProcessingConfiguration.onUpdateParameters.add(function() {\n              s.bloom._downscale._exposure = s._scene.imageProcessingConfiguration.exposure, s.imageProcessingEnabled !== s._scene.imageProcessingConfiguration.isEnabled && (s._imageProcessingEnabled = s._scene.imageProcessingConfiguration.isEnabled, s._buildPipeline());\n            }), s._buildPipeline(), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"sharpenEnabled\", { get: function() {\n            return this._sharpenEnabled;\n          }, set: function(e) {\n            this._sharpenEnabled !== e && (this._sharpenEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomKernel\", { get: function() {\n            return this._bloomKernel;\n          }, set: function(e) {\n            this._bloomKernel = e, this.bloom.kernel = e / this._hardwareScaleLevel;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomWeight\", { get: function() {\n            return this._bloomWeight;\n          }, set: function(e) {\n            this._bloomWeight !== e && (this.bloom.weight = e, this._bloomWeight = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomThreshold\", { get: function() {\n            return this._bloomThreshold;\n          }, set: function(e) {\n            this._bloomThreshold !== e && (this.bloom.threshold = e, this._bloomThreshold = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomScale\", { get: function() {\n            return this._bloomScale;\n          }, set: function(e) {\n            this._bloomScale !== e && (this._bloomScale = e, this._rebuildBloom(), this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"bloomEnabled\", { get: function() {\n            return this._bloomEnabled;\n          }, set: function(e) {\n            this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), t.prototype._rebuildBloom = function() {\n            var e = this.bloom;\n            this.bloom = new Pc(this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel, this._defaultPipelineTextureType, !1), this.bloom.threshold = e.threshold;\n            for (var n = 0; n < this._cameras.length; n++)\n              e.disposeEffects(this._cameras[n]);\n          }, Object.defineProperty(t.prototype, \"depthOfFieldEnabled\", { get: function() {\n            return this._depthOfFieldEnabled;\n          }, set: function(e) {\n            this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"depthOfFieldBlurLevel\", { get: function() {\n            return this._depthOfFieldBlurLevel;\n          }, set: function(e) {\n            if (this._depthOfFieldBlurLevel !== e) {\n              this._depthOfFieldBlurLevel = e;\n              var n = this.depthOfField;\n              this.depthOfField = new Rc(this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, !1), this.depthOfField.focalLength = n.focalLength, this.depthOfField.focusDistance = n.focusDistance, this.depthOfField.fStop = n.fStop, this.depthOfField.lensSize = n.lensSize;\n              for (var i = 0; i < this._cameras.length; i++)\n                n.disposeEffects(this._cameras[i]);\n              this._buildPipeline();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fxaaEnabled\", { get: function() {\n            return this._fxaaEnabled;\n          }, set: function(e) {\n            this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples !== e && (this._samples = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"imageProcessingEnabled\", { get: function() {\n            return this._imageProcessingEnabled;\n          }, set: function(e) {\n            this._imageProcessingEnabled !== e && (this._scene.imageProcessingConfiguration.isEnabled = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glowLayerEnabled\", { get: function() {\n            return this._glowLayer != null;\n          }, set: function(e) {\n            e && !this._glowLayer ? this._glowLayer = new Ko(\"\", this._scene) : !e && this._glowLayer && (this._glowLayer.dispose(), this._glowLayer = null);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"glowLayer\", { get: function() {\n            return this._glowLayer;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"chromaticAberrationEnabled\", { get: function() {\n            return this._chromaticAberrationEnabled;\n          }, set: function(e) {\n            this._chromaticAberrationEnabled !== e && (this._chromaticAberrationEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"grainEnabled\", { get: function() {\n            return this._grainEnabled;\n          }, set: function(e) {\n            this._grainEnabled !== e && (this._grainEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"DefaultRenderingPipeline\";\n          }, t.prototype.prepare = function() {\n            var e = this._buildAllowed;\n            this._buildAllowed = !0, this._buildPipeline(), this._buildAllowed = e;\n          }, t.prototype._setAutoClearAndTextureSharing = function(e, n) {\n            n === void 0 && (n = !1), this._hasCleared ? e.autoClear = !1 : (e.autoClear = !0, this._scene.autoClear = !1, this._hasCleared = !0), n || (this._prevPrevPostProcess ? e.shareOutputWith(this._prevPrevPostProcess) : e.useOwnOutput(), this._prevPostProcess && (this._prevPrevPostProcess = this._prevPostProcess), this._prevPostProcess = e);\n          }, t.prototype._buildPipeline = function() {\n            var e = this;\n            if (this._buildAllowed) {\n              this._scene.autoClear = !0;\n              var n = this._scene.getEngine();\n              if (this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._prevPostProcess = null, this._prevPrevPostProcess = null, this._hasCleared = !1, this.depthOfFieldEnabled) {\n                if (this._cameras.length > 1) {\n                  for (var i = 0, o = this._cameras; i < o.length; i++) {\n                    var a = o[i];\n                    (s = this._scene.enableDepthRenderer(a)).useOnlyInActiveCamera = !0;\n                  }\n                  this._depthOfFieldSceneObserver = this._scene.onAfterRenderTargetsRenderObservable.add(function(d) {\n                    e._cameras.indexOf(d.activeCamera) > -1 && (e.depthOfField.depthTexture = d.enableDepthRenderer(d.activeCamera).getDepthMap());\n                  });\n                } else {\n                  this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);\n                  var s = this._scene.enableDepthRenderer(this._cameras[0]);\n                  this.depthOfField.depthTexture = s.getDepthMap();\n                }\n                this.depthOfField._isReady() || this.depthOfField._updateEffects(), this.addEffect(this.depthOfField), this._setAutoClearAndTextureSharing(this.depthOfField._effects[0], !0);\n              } else\n                this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver);\n              this.bloomEnabled && (this.bloom._isReady() || this.bloom._updateEffects(), this.addEffect(this.bloom), this._setAutoClearAndTextureSharing(this.bloom._effects[0], !0)), this._imageProcessingEnabled && (this.imageProcessing = new Io(\"imageProcessing\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, n, !1, this._defaultPipelineTextureType), this._hdr ? (this.addEffect(new xt(n, this.ImageProcessingPostProcessId, function() {\n                return e.imageProcessing;\n              }, !0)), this._setAutoClearAndTextureSharing(this.imageProcessing)) : this._scene.imageProcessingConfiguration.applyByPostProcess = !1, this.cameras && this.cameras.length !== 0 || (this._scene.imageProcessingConfiguration.applyByPostProcess = !1), this.imageProcessing.getEffect() || this.imageProcessing._updateParameters()), this.sharpenEnabled && (this.sharpen.isReady() || this.sharpen.updateEffect(), this.addEffect(this._sharpenEffect), this._setAutoClearAndTextureSharing(this.sharpen)), this.grainEnabled && (this.grain.isReady() || this.grain.updateEffect(), this.addEffect(this._grainEffect), this._setAutoClearAndTextureSharing(this.grain)), this.chromaticAberrationEnabled && (this.chromaticAberration.isReady() || this.chromaticAberration.updateEffect(), this.addEffect(this._chromaticAberrationEffect), this._setAutoClearAndTextureSharing(this.chromaticAberration)), this.fxaaEnabled && (this.fxaa = new vo(\"fxaa\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, n, !1, this._defaultPipelineTextureType), this.addEffect(new xt(n, this.FxaaPostProcessId, function() {\n                return e.fxaa;\n              }, !0)), this._setAutoClearAndTextureSharing(this.fxaa, !0)), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), this._scene.activeCameras && this._scene.activeCameras.length > 1 && (this._scene.autoClear = !0), !this._enableMSAAOnFirstPostProcess(this.samples) && this.samples > 1 && l.a.Warn(\"MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0\"), this.onBuildObservable.notifyObservers(this);\n            }\n          }, t.prototype._disposePostProcesses = function(e) {\n            e === void 0 && (e = !1);\n            for (var n = 0; n < this._cameras.length; n++) {\n              var i = this._cameras[n];\n              this.imageProcessing && this.imageProcessing.dispose(i), this.fxaa && this.fxaa.dispose(i), e && (this.sharpen && this.sharpen.dispose(i), this.depthOfField && (this._scene.onAfterRenderTargetsRenderObservable.remove(this._depthOfFieldSceneObserver), this.depthOfField.disposeEffects(i)), this.bloom && this.bloom.disposeEffects(i), this.chromaticAberration && this.chromaticAberration.dispose(i), this.grain && this.grain.dispose(i), this._glowLayer && this._glowLayer.dispose());\n            }\n            this.imageProcessing = null, this.fxaa = null, e && (this.sharpen = null, this._sharpenEffect = null, this.depthOfField = null, this.bloom = null, this.chromaticAberration = null, this._chromaticAberrationEffect = null, this.grain = null, this._grainEffect = null, this._glowLayer = null);\n          }, t.prototype.addCamera = function(e) {\n            this._camerasToBeAttached.push(e), this._buildPipeline();\n          }, t.prototype.removeCamera = function(e) {\n            var n = this._camerasToBeAttached.indexOf(e);\n            this._camerasToBeAttached.splice(n, 1), this._buildPipeline();\n          }, t.prototype.dispose = function() {\n            this.onBuildObservable.clear(), this._disposePostProcesses(!0), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._scene.autoClear = !0, this._resizeObserver && (this._scene.getEngine().onResizeObservable.remove(this._resizeObserver), this._resizeObserver = null), this._scene.imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingConfigurationObserver), r.prototype.dispose.call(this);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"DefaultRenderingPipeline\", e;\n          }, t.Parse = function(e, n, i) {\n            return L.a.Parse(function() {\n              return new t(e._name, e._name._hdr, n);\n            }, e, n, i);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"sharpenEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomKernel\", null), Object(c.c)([Object(L.c)()], t.prototype, \"_bloomWeight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_bloomThreshold\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_hdr\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"bloomWeight\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomThreshold\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomScale\", null), Object(c.c)([Object(L.c)()], t.prototype, \"bloomEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldBlurLevel\", null), Object(c.c)([Object(L.c)()], t.prototype, \"fxaaEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"samples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"imageProcessingEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"glowLayerEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"chromaticAberrationEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"grainEnabled\", null), t;\n        }(Ir);\n        O.a.RegisteredTypes[\"BABYLON.DefaultRenderingPipeline\"] = Sd;\n        var Ym = `\nuniform sampler2D textureSampler;\n\nuniform float gain;\nuniform float threshold;\nuniform float screen_width;\nuniform float screen_height;\n\nvarying vec2 vUV;\n\nvec4 highlightColor(vec4 color) {\nvec4 highlight=color;\nfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\nfloat lum_threshold;\nif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\n\nif (gain == -1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\n\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n\n}`;\n        ze.a.ShadersStore.lensHighlightsPixelShader = Ym;\n        var Km = `\n\n\n\n\nuniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\n\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\n\nuniform float screen_distance;\nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\n\nuniform float near;\nuniform float far;\n\nvarying vec2 vUV;\n\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1\n\nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\n\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\n\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion == 0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\n\nfloat sampleScreen(inout vec4 color,const in vec2 offset,const in float weight) {\n\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\n\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\n\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nif (size == 0.0) { return col; }\n\n\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight;\n\nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\n\n\n\n\nreturn col;\n}\nvoid main(void)\n{\n\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV);\nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height);\nfloat depth=texture2D(depthSampler,distorted_coords).r;\nfloat distance=near+(far-near)*depth;\nvec4 color=texture2D(textureSampler,vUV);\n\n\nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\n\nif (dof_enabled == false || coc<0.07) { coc=0.0; }\n\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\n\nfloat blur_amount=max(edge_blur_amount,coc);\n\nif (blur_amount == 0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\n\ngl_FragColor=getBlurColor(blur_amount*1.7);\n\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\n\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\n\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n`;\n        ze.a.ShadersStore.depthOfFieldPixelShader = Km;\n        var Qm = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = 1);\n            var s = r.call(this, i.getEngine(), e) || this;\n            return s.LensChromaticAberrationEffect = \"LensChromaticAberrationEffect\", s.HighlightsEnhancingEffect = \"HighlightsEnhancingEffect\", s.LensDepthOfFieldEffect = \"LensDepthOfFieldEffect\", s._pentagonBokehIsEnabled = !1, s._scene = i, s._depthTexture = i.enableDepthRenderer().getDepthMap(), n.grain_texture ? s._grainTexture = n.grain_texture : s._createGrainTexture(), s._edgeBlur = n.edge_blur ? n.edge_blur : 0, s._grainAmount = n.grain_amount ? n.grain_amount : 0, s._chromaticAberration = n.chromatic_aberration ? n.chromatic_aberration : 0, s._distortion = n.distortion ? n.distortion : 0, s._highlightsGain = n.dof_gain !== void 0 ? n.dof_gain : -1, s._highlightsThreshold = n.dof_threshold ? n.dof_threshold : 1, s._dofDistance = n.dof_focus_distance !== void 0 ? n.dof_focus_distance : -1, s._dofAperture = n.dof_aperture ? n.dof_aperture : 1, s._dofDarken = n.dof_darken ? n.dof_darken : 0, s._dofPentagon = n.dof_pentagon === void 0 || n.dof_pentagon, s._blurNoise = n.blur_noise === void 0 || n.blur_noise, s._createChromaticAberrationPostProcess(o), s._createHighlightsPostProcess(o), s._createDepthOfFieldPostProcess(o / 4), s.addEffect(new xt(i.getEngine(), s.LensChromaticAberrationEffect, function() {\n              return s._chromaticAberrationPostProcess;\n            }, !0)), s.addEffect(new xt(i.getEngine(), s.HighlightsEnhancingEffect, function() {\n              return s._highlightsPostProcess;\n            }, !0)), s.addEffect(new xt(i.getEngine(), s.LensDepthOfFieldEffect, function() {\n              return s._depthOfFieldPostProcess;\n            }, !0)), s._highlightsGain === -1 && s._disableEffect(s.HighlightsEnhancingEffect, null), i.postProcessRenderPipelineManager.addPipeline(s), a && i.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, a), s;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"LensRenderingPipeline\";\n          }, Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edgeBlur\", { get: function() {\n            return this._edgeBlur;\n          }, set: function(e) {\n            this.setEdgeBlur(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"grainAmount\", { get: function() {\n            return this._grainAmount;\n          }, set: function(e) {\n            this.setGrainAmount(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"chromaticAberration\", { get: function() {\n            return this._chromaticAberration;\n          }, set: function(e) {\n            this.setChromaticAberration(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dofAperture\", { get: function() {\n            return this._dofAperture;\n          }, set: function(e) {\n            this.setAperture(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"edgeDistortion\", { get: function() {\n            return this._distortion;\n          }, set: function(e) {\n            this.setEdgeDistortion(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"dofDistortion\", { get: function() {\n            return this._dofDistance;\n          }, set: function(e) {\n            this.setFocusDistance(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"darkenOutOfFocus\", { get: function() {\n            return this._dofDarken;\n          }, set: function(e) {\n            this.setDarkenOutOfFocus(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"blurNoise\", { get: function() {\n            return this._blurNoise;\n          }, set: function(e) {\n            this._blurNoise = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"pentagonBokeh\", { get: function() {\n            return this._pentagonBokehIsEnabled;\n          }, set: function(e) {\n            e ? this.enablePentagonBokeh() : this.disablePentagonBokeh();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"highlightsGain\", { get: function() {\n            return this._highlightsGain;\n          }, set: function(e) {\n            this.setHighlightsGain(e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"highlightsThreshold\", { get: function() {\n            return this._highlightsThreshold;\n          }, set: function(e) {\n            this.setHighlightsThreshold(e);\n          }, enumerable: !1, configurable: !0 }), t.prototype.setEdgeBlur = function(e) {\n            this._edgeBlur = e;\n          }, t.prototype.disableEdgeBlur = function() {\n            this._edgeBlur = 0;\n          }, t.prototype.setGrainAmount = function(e) {\n            this._grainAmount = e;\n          }, t.prototype.disableGrain = function() {\n            this._grainAmount = 0;\n          }, t.prototype.setChromaticAberration = function(e) {\n            this._chromaticAberration = e;\n          }, t.prototype.disableChromaticAberration = function() {\n            this._chromaticAberration = 0;\n          }, t.prototype.setEdgeDistortion = function(e) {\n            this._distortion = e;\n          }, t.prototype.disableEdgeDistortion = function() {\n            this._distortion = 0;\n          }, t.prototype.setFocusDistance = function(e) {\n            this._dofDistance = e;\n          }, t.prototype.disableDepthOfField = function() {\n            this._dofDistance = -1;\n          }, t.prototype.setAperture = function(e) {\n            this._dofAperture = e;\n          }, t.prototype.setDarkenOutOfFocus = function(e) {\n            this._dofDarken = e;\n          }, t.prototype.enablePentagonBokeh = function() {\n            this._highlightsPostProcess.updateEffect(`#define PENTAGON\n`), this._pentagonBokehIsEnabled = !0;\n          }, t.prototype.disablePentagonBokeh = function() {\n            this._pentagonBokehIsEnabled = !1, this._highlightsPostProcess.updateEffect();\n          }, t.prototype.enableNoiseBlur = function() {\n            this._blurNoise = !0;\n          }, t.prototype.disableNoiseBlur = function() {\n            this._blurNoise = !1;\n          }, t.prototype.setHighlightsGain = function(e) {\n            this._highlightsGain = e;\n          }, t.prototype.setHighlightsThreshold = function(e) {\n            this._highlightsGain === -1 && (this._highlightsGain = 1), this._highlightsThreshold = e;\n          }, t.prototype.disableHighlights = function() {\n            this._highlightsGain = -1;\n          }, t.prototype.dispose = function(e) {\n            e === void 0 && (e = !1), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), this._chromaticAberrationPostProcess = null, this._highlightsPostProcess = null, this._depthOfFieldPostProcess = null, this._grainTexture.dispose(), e && this._scene.disableDepthRenderer();\n          }, t.prototype._createChromaticAberrationPostProcess = function(e) {\n            var n = this;\n            this._chromaticAberrationPostProcess = new ft(\"LensChromaticAberration\", \"chromaticAberration\", [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"], [], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._chromaticAberrationPostProcess.onApply = function(i) {\n              i.setFloat(\"chromatic_aberration\", n._chromaticAberration), i.setFloat(\"screen_width\", n._scene.getEngine().getRenderWidth()), i.setFloat(\"screen_height\", n._scene.getEngine().getRenderHeight()), i.setFloat(\"radialIntensity\", 1), i.setFloat2(\"direction\", 17, 17), i.setFloat2(\"centerPosition\", 0.5, 0.5);\n            };\n          }, t.prototype._createHighlightsPostProcess = function(e) {\n            var n = this;\n            this._highlightsPostProcess = new ft(\"LensHighlights\", \"lensHighlights\", [\"gain\", \"threshold\", \"screen_width\", \"screen_height\"], [], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, this._dofPentagon ? `#define PENTAGON\n` : \"\"), this._highlightsPostProcess.onApply = function(i) {\n              i.setFloat(\"gain\", n._highlightsGain), i.setFloat(\"threshold\", n._highlightsThreshold), i.setTextureFromPostProcess(\"textureSampler\", n._chromaticAberrationPostProcess), i.setFloat(\"screen_width\", n._scene.getEngine().getRenderWidth()), i.setFloat(\"screen_height\", n._scene.getEngine().getRenderHeight());\n            };\n          }, t.prototype._createDepthOfFieldPostProcess = function(e) {\n            var n = this;\n            this._depthOfFieldPostProcess = new ft(\"LensDepthOfField\", \"depthOfField\", [\"grain_amount\", \"blur_noise\", \"screen_width\", \"screen_height\", \"distortion\", \"dof_enabled\", \"screen_distance\", \"aperture\", \"darken\", \"edge_blur\", \"highlights\", \"near\", \"far\"], [\"depthSampler\", \"grainSampler\", \"highlightsSampler\"], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._depthOfFieldPostProcess.onApply = function(i) {\n              i.setTexture(\"depthSampler\", n._depthTexture), i.setTexture(\"grainSampler\", n._grainTexture), i.setTextureFromPostProcess(\"textureSampler\", n._highlightsPostProcess), i.setTextureFromPostProcess(\"highlightsSampler\", n._depthOfFieldPostProcess), i.setFloat(\"grain_amount\", n._grainAmount), i.setBool(\"blur_noise\", n._blurNoise), i.setFloat(\"screen_width\", n._scene.getEngine().getRenderWidth()), i.setFloat(\"screen_height\", n._scene.getEngine().getRenderHeight()), i.setFloat(\"distortion\", n._distortion), i.setBool(\"dof_enabled\", n._dofDistance !== -1), i.setFloat(\"screen_distance\", 1 / (0.1 - 1 / n._dofDistance)), i.setFloat(\"aperture\", n._dofAperture), i.setFloat(\"darken\", n._dofDarken), i.setFloat(\"edge_blur\", n._edgeBlur), i.setBool(\"highlights\", n._highlightsGain !== -1), n._scene.activeCamera && (i.setFloat(\"near\", n._scene.activeCamera.minZ), i.setFloat(\"far\", n._scene.activeCamera.maxZ));\n            };\n          }, t.prototype._createGrainTexture = function() {\n            this._grainTexture = new pi.a(\"LensNoiseTexture\", 512, this._scene, !1, Ne.a.BILINEAR_SAMPLINGMODE), this._grainTexture.wrapU = Ne.a.WRAP_ADDRESSMODE, this._grainTexture.wrapV = Ne.a.WRAP_ADDRESSMODE;\n            for (var e, n, i, o = this._grainTexture.getContext(), a = 0; a < 512; a++)\n              for (var s = 0; s < 512; s++)\n                e = Math.floor(255 * (n = 0.42, i = 0.58, Math.random() * (i - n) + n)), o.fillStyle = \"rgb(\" + e + \", \" + e + \", \" + e + \")\", o.fillRect(a, s, 1, 1);\n            this._grainTexture.update(!1);\n          }, t;\n        }(Ir), qm = function() {\n          this.enabled = !1, this.name = \"ssao2\", this.texturesRequired = [h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE];\n        }, Zm = `\nprecision highp float;\nuniform sampler2D textureSampler;\nuniform float near;\nuniform float far;\nuniform float radius;\nfloat scales[16]=float[16](\n0.1,\n0.11406250000000001,\n0.131640625,\n0.15625,\n0.187890625,\n0.2265625,\n0.272265625,\n0.325,\n0.384765625,\n0.4515625,\n0.525390625,\n0.60625,\n0.694140625,\n0.7890625,\n0.891015625,\n1.0\n);\nvarying vec2 vUV;\nfloat perspectiveDepthToViewZ( const in float invClipZ,const in float near,const in float far ) {\nreturn ( near*far )/( ( far-near )*invClipZ-far );\n}\nfloat viewZToPerspectiveDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( near*far/viewZ+far)/( far-near );\n}\nfloat viewZToOrthographicDepth( const in float viewZ,const in float near,const in float far ) {\nreturn ( viewZ+near )/( near-far );\n}\n#ifdef SSAO\nuniform sampler2D randomSampler;\n#ifndef GEOMETRYBUFFER\nuniform sampler2D depthNormalSampler;\n#else\nuniform sampler2D depthSampler;\nuniform sampler2D normalSampler;\n#endif\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float base;\nuniform float xViewport;\nuniform float yViewport;\nuniform float maxZ;\nuniform float minZAspect;\nuniform vec2 texelSize;\nuniform mat4 projection;\nvoid main()\n{\nvec3 random=texture2D(randomSampler,vUV*randTextureTiles).rgb;\n#ifndef GEOMETRYBUFFER\nfloat depth=texture2D(depthNormalSampler,vUV).r;\n#else\nfloat depth=texture2D(depthSampler,vUV).r;\n#endif\nfloat depthSign=depth/abs(depth);\ndepth=depth*depthSign;\n#ifndef GEOMETRYBUFFER\nvec3 normal=texture2D(depthNormalSampler,vUV).gba;\n#else\nvec3 normal=texture2D(normalSampler,vUV).rgb;\n#endif\nfloat occlusion=0.0;\nfloat correctedRadius=min(radius,minZAspect*depth/near);\nvec3 vViewRay=vec3((vUV.x*2.0-1.0)*xViewport,(vUV.y*2.0-1.0)*yViewport,depthSign);\nvec3 origin=vViewRay*depth;\nvec3 rvec=random*2.0-1.0;\nrvec.z=0.0;\n\nfloat dotProduct=dot(rvec,normal);\nrvec=1.0-abs(dotProduct)>1e-2 ? rvec : vec3(-rvec.y,0.0,rvec.x);\nvec3 tangent=normalize(rvec-normal*dot(rvec,normal));\nvec3 bitangent=cross(normal,tangent);\nmat3 tbn=mat3(tangent,bitangent,normal);\nfloat difference;\nfor (int i=0; i<SAMPLES; ++i) {\n\nvec3 samplePosition=scales[(i+int(random.x*16.0)) % 16]*tbn*sampleSphere[(i+int(random.y*16.0)) % 16];\nsamplePosition=samplePosition*correctedRadius+origin;\n\nvec4 offset=vec4(samplePosition,1.0);\noffset=projection*offset;\noffset.xyz/=offset.w;\noffset.xy=offset.xy*0.5+0.5;\nif (offset.x<0.0 || offset.y<0.0 || offset.x>1.0 || offset.y>1.0) {\ncontinue;\n}\n\n#ifndef GEOMETRYBUFFER\nfloat sampleDepth=abs(texture2D(depthNormalSampler,offset.xy).r);\n#else\nfloat sampleDepth=abs(texture2D(depthSampler,offset.xy).r);\n#endif\n\ndifference=depthSign*samplePosition.z-sampleDepth;\nfloat rangeCheck=1.0-smoothstep(correctedRadius*0.5,correctedRadius,difference);\nocclusion+=(difference>=0.0 ? 1.0 : 0.0)*rangeCheck;\n}\nocclusion=occlusion*(1.0-smoothstep(maxZ*0.75,maxZ,depth));\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor=vec4(vec3(result),1.0);\n}\n#endif\n#ifdef BILATERAL_BLUR\nuniform sampler2D depthNormalSampler;\nuniform float outSize;\nuniform float samplerOffsets[SAMPLES];\nvec4 blur9(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.3846153846)*direction;\nvec2 off2=vec2(3.2307692308)*direction;\ncolor+=texture2D(image,uv)*0.2270270270;\ncolor+=texture2D(image,uv+(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv-(off1/resolution))*0.3162162162;\ncolor+=texture2D(image,uv+(off2/resolution))*0.0702702703;\ncolor+=texture2D(image,uv-(off2/resolution))*0.0702702703;\nreturn color;\n}\nvec4 blur13(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\ncolor+=texture2D(image,uv)*0.1964825501511404;\ncolor+=texture2D(image,uv+(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv-(off1/resolution))*0.2969069646728344;\ncolor+=texture2D(image,uv+(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv-(off2/resolution))*0.09447039785044732;\ncolor+=texture2D(image,uv+(off3/resolution))*0.010381362401148057;\ncolor+=texture2D(image,uv-(off3/resolution))*0.010381362401148057;\nreturn color;\n}\nvec4 blur13Bilateral(sampler2D image,vec2 uv,float resolution,vec2 direction) {\nvec4 color=vec4(0.0);\nvec2 off1=vec2(1.411764705882353)*direction;\nvec2 off2=vec2(3.2941176470588234)*direction;\nvec2 off3=vec2(5.176470588235294)*direction;\nfloat compareDepth=abs(texture2D(depthNormalSampler,uv).r);\nfloat sampleDepth;\nfloat weight;\nfloat weightSum=30.0;\ncolor+=texture2D(image,uv)*30.0;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off1/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off1/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off2/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off2/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv+(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv+(off3/resolution))*weight;\nsampleDepth=abs(texture2D(depthNormalSampler,uv-(off3/resolution)).r);\nweight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30.0);\nweightSum+=weight;\ncolor+=texture2D(image,uv-(off3/resolution))*weight;\nreturn color/weightSum;\n}\nvoid main()\n{\n#if EXPENSIVE\nfloat compareDepth=abs(texture2D(depthNormalSampler,vUV).r);\nfloat texelsize=1.0/outSize;\nfloat result=0.0;\nfloat weightSum=0.0;\nfor (int i=0; i<SAMPLES; ++i)\n{\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\nvec2 sampleOffset=vec2(texelsize*samplerOffsets[i],0.0);\n#else\nvec2 direction=vec2(0.0,1.0);\nvec2 sampleOffset=vec2(0.0,texelsize*samplerOffsets[i]);\n#endif\nvec2 samplePos=vUV+sampleOffset;\nfloat sampleDepth=abs(texture2D(depthNormalSampler,samplePos).r);\nfloat weight=clamp(1.0/( 0.003+abs(compareDepth-sampleDepth)),0.0,30000.0);\nresult+=texture2D(textureSampler,samplePos).r*weight;\nweightSum+=weight;\n}\nresult/=weightSum;\ngl_FragColor.rgb=vec3(result);\ngl_FragColor.a=1.0;\n#else\nvec4 color;\n#ifdef BILATERAL_BLUR_H\nvec2 direction=vec2(1.0,0.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#else\nvec2 direction=vec2(0.0,1.0);\ncolor=blur13Bilateral(textureSampler,vUV,outSize,direction);\n#endif\ngl_FragColor.rgb=vec3(color.r);\ngl_FragColor.a=1.0;\n#endif\n}\n#endif\n`;\n        ze.a.ShadersStore.ssao2PixelShader = Zm;\n        var Jm = `uniform sampler2D textureSampler;\nuniform sampler2D originalColor;\nuniform vec4 viewport;\nvarying vec2 vUV;\nvoid main(void) {\nvec4 ssaoColor=texture2D(textureSampler,viewport.xy+vUV*viewport.zw);\nvec4 sceneColor=texture2D(originalColor,vUV);\ngl_FragColor=sceneColor*ssaoColor;\n}\n`;\n        ze.a.ShadersStore.ssaoCombinePixelShader = Jm;\n        var Ad = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = !0);\n            var s = r.call(this, n.getEngine(), e) || this;\n            if (s.SSAOOriginalSceneColorEffect = \"SSAOOriginalSceneColorEffect\", s.SSAORenderEffect = \"SSAORenderEffect\", s.SSAOBlurHRenderEffect = \"SSAOBlurHRenderEffect\", s.SSAOBlurVRenderEffect = \"SSAOBlurVRenderEffect\", s.SSAOCombineRenderEffect = \"SSAOCombineRenderEffect\", s.totalStrength = 1, s.maxZ = 100, s.minZAspect = 0.2, s._samples = 8, s._textureSamples = 1, s._forceGeometryBuffer = !1, s._expensiveBlur = !0, s.radius = 2, s.base = 0, s._bits = new Uint32Array(1), s._scene = n, s._ratio = i, s._forceGeometryBuffer = a, !s.isSupported)\n              return l.a.Error(\"SSAO 2 needs WebGL 2 support.\"), s;\n            var d = s._ratio.ssaoRatio || i, p = s._ratio.blurRatio || i;\n            return s._forceGeometryBuffer ? n.enableGeometryBufferRenderer() : s._prePassRenderer = n.enablePrePassRenderer(), s._createRandomTexture(), s._originalColorPostProcess = new Ri(\"SSAOOriginalSceneColor\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, n.getEngine(), !1), s._originalColorPostProcess.samples = s.textureSamples, s._createSSAOPostProcess(1), s._createBlurPostProcess(d, p), s._createSSAOCombinePostProcess(p), s.addEffect(new xt(n.getEngine(), s.SSAOOriginalSceneColorEffect, function() {\n              return s._originalColorPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAORenderEffect, function() {\n              return s._ssaoPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAOBlurHRenderEffect, function() {\n              return s._blurHPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAOBlurVRenderEffect, function() {\n              return s._blurVPostProcess;\n            }, !0)), s.addEffect(new xt(n.getEngine(), s.SSAOCombineRenderEffect, function() {\n              return s._ssaoCombinePostProcess;\n            }, !0)), n.postProcessRenderPipelineManager.addPipeline(s), o && n.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, o), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples = e, this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO()), this._sampleSphere = this._generateHemisphere();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"textureSamples\", { get: function() {\n            return this._textureSamples;\n          }, set: function(e) {\n            this._textureSamples = e, this._originalColorPostProcess.samples = e, this._blurHPostProcess.samples = e, this._blurVPostProcess.samples = e, this._ssaoPostProcess.samples = e, this._ssaoCombinePostProcess.samples = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"expensiveBlur\", { get: function() {\n            return this._expensiveBlur;\n          }, set: function(e) {\n            this._blurHPostProcess.updateEffect(`#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE ` + (e ? \"1\" : \"0\") + `\n`, null, [\"textureSampler\", \"depthNormalSampler\"]), this._blurVPostProcess.updateEffect(`#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE ` + (e ? \"1\" : \"0\") + `\n`, null, [\"textureSampler\", \"depthNormalSampler\"]), this._expensiveBlur = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t, \"IsSupported\", { get: function() {\n            var e = te.a.LastCreatedEngine;\n            return !!e && e.webGLVersion >= 2;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"SSAO2RenderingPipeline\";\n          }, t.prototype.dispose = function(e) {\n            e === void 0 && (e = !1);\n            for (var n = 0; n < this._scene.cameras.length; n++) {\n              var i = this._scene.cameras[n];\n              this._originalColorPostProcess.dispose(i), this._ssaoPostProcess.dispose(i), this._blurHPostProcess.dispose(i), this._blurVPostProcess.dispose(i), this._ssaoCombinePostProcess.dispose(i);\n            }\n            this._randomTexture.dispose(), e && this._scene.disableGeometryBufferRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), r.prototype.dispose.call(this);\n          }, t.prototype._createBlurPostProcess = function(e, n) {\n            var i = this;\n            this._samplerOffsets = [];\n            for (var o = this.expensiveBlur, a = -8; a < 8; a++)\n              this._samplerOffsets.push(2 * a + 0.5);\n            this._blurHPostProcess = new ft(\"BlurH\", \"ssao2\", [\"outSize\", \"samplerOffsets\", \"near\", \"far\", \"radius\"], [\"depthNormalSampler\"], e, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE ` + (o ? \"1\" : \"0\") + `\n`), this._blurHPostProcess.onApply = function(s) {\n              i._scene.activeCamera && (s.setFloat(\"outSize\", i._ssaoCombinePostProcess.width > 0 ? i._ssaoCombinePostProcess.width : i._originalColorPostProcess.width), s.setFloat(\"near\", i._scene.activeCamera.minZ), s.setFloat(\"far\", i._scene.activeCamera.maxZ), s.setFloat(\"radius\", i.radius), i._forceGeometryBuffer ? s.setTexture(\"depthNormalSampler\", i._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]) : s.setTexture(\"depthNormalSampler\", i._prePassRenderer.prePassRT.textures[i._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), s.setArray(\"samplerOffsets\", i._samplerOffsets));\n            }, this._blurVPostProcess = new ft(\"BlurV\", \"ssao2\", [\"outSize\", \"samplerOffsets\", \"near\", \"far\", \"radius\"], [\"depthNormalSampler\"], n, null, Ne.a.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define BILATERAL_BLUR\n#define BILATERAL_BLUR_V\n#define SAMPLES 16\n#define EXPENSIVE ` + (o ? \"1\" : \"0\") + `\n`), this._blurVPostProcess.onApply = function(s) {\n              i._scene.activeCamera && (s.setFloat(\"outSize\", i._ssaoCombinePostProcess.height > 0 ? i._ssaoCombinePostProcess.height : i._originalColorPostProcess.height), s.setFloat(\"near\", i._scene.activeCamera.minZ), s.setFloat(\"far\", i._scene.activeCamera.maxZ), s.setFloat(\"radius\", i.radius), i._forceGeometryBuffer ? s.setTexture(\"depthNormalSampler\", i._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]) : s.setTexture(\"depthNormalSampler\", i._prePassRenderer.prePassRT.textures[i._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), s.setArray(\"samplerOffsets\", i._samplerOffsets));\n            }, this._blurHPostProcess.samples = this.textureSamples, this._blurVPostProcess.samples = this.textureSamples;\n          }, t.prototype._rebuild = function() {\n            r.prototype._rebuild.call(this);\n          }, t.prototype._radicalInverse_VdC = function(e) {\n            return this._bits[0] = e, this._bits[0] = (this._bits[0] << 16 | this._bits[0] >> 16) >>> 0, this._bits[0] = (1431655765 & this._bits[0]) << 1 | (2863311530 & this._bits[0]) >>> 1 >>> 0, this._bits[0] = (858993459 & this._bits[0]) << 2 | (3435973836 & this._bits[0]) >>> 2 >>> 0, this._bits[0] = (252645135 & this._bits[0]) << 4 | (4042322160 & this._bits[0]) >>> 4 >>> 0, this._bits[0] = (16711935 & this._bits[0]) << 8 | (4278255360 & this._bits[0]) >>> 8 >>> 0, 23283064365386963e-26 * this._bits[0];\n          }, t.prototype._hammersley = function(e, n) {\n            return [e / n, this._radicalInverse_VdC(e)];\n          }, t.prototype._hemisphereSample_uniform = function(e, n) {\n            var i = 2 * n * Math.PI, o = 1 - (0.85 * e + 0.15), a = Math.sqrt(1 - o * o);\n            return new u.e(Math.cos(i) * a, Math.sin(i) * a, o);\n          }, t.prototype._generateHemisphere = function() {\n            for (var e, n = this.samples, i = [], o = 0; o < n; ) {\n              if (n < 16)\n                e = this._hemisphereSample_uniform(Math.random(), Math.random());\n              else {\n                var a = this._hammersley(o, n);\n                e = this._hemisphereSample_uniform(a[0], a[1]);\n              }\n              i.push(e.x, e.y, e.z), o++;\n            }\n            return i;\n          }, t.prototype._getDefinesForSSAO = function() {\n            var e = \"#define SAMPLES \" + this.samples + `\n#define SSAO`;\n            return this._forceGeometryBuffer && (e += `\n#define GEOMETRYBUFFER`), e;\n          }, t.prototype._createSSAOPostProcess = function(e) {\n            var n = this;\n            this._sampleSphere = this._generateHemisphere();\n            var i, o = this._getDefinesForSSAO();\n            i = this._forceGeometryBuffer ? [\"randomSampler\", \"depthSampler\", \"normalSampler\"] : [\"randomSampler\", \"depthNormalSampler\"], this._ssaoPostProcess = new ft(\"ssao2\", \"ssao2\", [\"sampleSphere\", \"samplesFactor\", \"randTextureTiles\", \"totalStrength\", \"radius\", \"base\", \"range\", \"projection\", \"near\", \"far\", \"texelSize\", \"xViewport\", \"yViewport\", \"maxZ\", \"minZAspect\"], i, e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, o), this._ssaoPostProcess.onApply = function(a) {\n              n._scene.activeCamera && (a.setArray3(\"sampleSphere\", n._sampleSphere), a.setFloat(\"randTextureTiles\", 32), a.setFloat(\"samplesFactor\", 1 / n.samples), a.setFloat(\"totalStrength\", n.totalStrength), a.setFloat2(\"texelSize\", 1 / n._ssaoPostProcess.width, 1 / n._ssaoPostProcess.height), a.setFloat(\"radius\", n.radius), a.setFloat(\"maxZ\", n.maxZ), a.setFloat(\"minZAspect\", n.minZAspect), a.setFloat(\"base\", n.base), a.setFloat(\"near\", n._scene.activeCamera.minZ), a.setFloat(\"far\", n._scene.activeCamera.maxZ), a.setFloat(\"xViewport\", Math.tan(n._scene.activeCamera.fov / 2) * n._scene.getEngine().getAspectRatio(n._scene.activeCamera, !0)), a.setFloat(\"yViewport\", Math.tan(n._scene.activeCamera.fov / 2)), a.setMatrix(\"projection\", n._scene.getProjectionMatrix()), n._forceGeometryBuffer ? (a.setTexture(\"depthSampler\", n._scene.enableGeometryBufferRenderer().getGBuffer().textures[0]), a.setTexture(\"normalSampler\", n._scene.enableGeometryBufferRenderer().getGBuffer().textures[1])) : a.setTexture(\"depthNormalSampler\", n._prePassRenderer.prePassRT.textures[n._prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), a.setTexture(\"randomSampler\", n._randomTexture));\n            }, this._ssaoPostProcess.samples = this.textureSamples;\n          }, t.prototype._createSSAOCombinePostProcess = function(e) {\n            var n = this;\n            this._ssaoCombinePostProcess = new ft(\"ssaoCombine\", \"ssaoCombine\", [], [\"originalColor\", \"viewport\"], e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = function(i) {\n              var o = n._scene.activeCamera.viewport;\n              i.setVector4(\"viewport\", u.c.Vector4[0].copyFromFloats(o.x, o.y, o.width, o.height)), i.setTextureFromPostProcessOutput(\"originalColor\", n._originalColorPostProcess);\n            }, this._ssaoCombinePostProcess.samples = this.textureSamples, this._forceGeometryBuffer || (this._ssaoCombinePostProcess._prePassEffectConfiguration = new qm());\n          }, t.prototype._createRandomTexture = function() {\n            this._randomTexture = new pi.a(\"SSAORandomTexture\", 128, this._scene, !1, Ne.a.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = Ne.a.WRAP_ADDRESSMODE, this._randomTexture.wrapV = Ne.a.WRAP_ADDRESSMODE;\n            for (var e = this._randomTexture.getContext(), n = function(s, d) {\n              return Math.random() * (d - s) + s;\n            }, i = u.e.Zero(), o = 0; o < 128; o++)\n              for (var a = 0; a < 128; a++)\n                i.x = n(0, 1), i.y = n(0, 1), i.z = 0, i.normalize(), i.scaleInPlace(255), i.x = Math.floor(i.x), i.y = Math.floor(i.y), e.fillStyle = \"rgb(\" + i.x + \", \" + i.y + \", \" + i.z + \")\", e.fillRect(o, a, 1, 1);\n            this._randomTexture.update(!1);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return e.customType = \"SSAO2RenderingPipeline\", e;\n          }, t.Parse = function(e, n, i) {\n            return L.a.Parse(function() {\n              return new t(e._name, n, e._ratio);\n            }, e, n, i);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"totalStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"maxZ\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"minZAspect\", void 0), Object(c.c)([Object(L.c)(\"samples\")], t.prototype, \"_samples\", void 0), Object(c.c)([Object(L.c)(\"textureSamples\")], t.prototype, \"_textureSamples\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"_ratio\", void 0), Object(c.c)([Object(L.c)(\"expensiveBlur\")], t.prototype, \"_expensiveBlur\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"base\", void 0), t;\n        }(Ir);\n        O.a.RegisteredTypes[\"BABYLON.SSAO2RenderingPipeline\"] = Ad;\n        var $m = `\nuniform sampler2D textureSampler;\nvarying vec2 vUV;\n#ifdef SSAO\nuniform sampler2D randomSampler;\nuniform float randTextureTiles;\nuniform float samplesFactor;\nuniform vec3 sampleSphere[SAMPLES];\nuniform float totalStrength;\nuniform float radius;\nuniform float area;\nuniform float fallOff;\nuniform float base;\nvec3 normalFromDepth(float depth,vec2 coords)\n{\nvec2 offset1=vec2(0.0,radius);\nvec2 offset2=vec2(radius,0.0);\nfloat depth1=texture2D(textureSampler,coords+offset1).r;\nfloat depth2=texture2D(textureSampler,coords+offset2).r;\nvec3 p1=vec3(offset1,depth1-depth);\nvec3 p2=vec3(offset2,depth2-depth);\nvec3 normal=cross(p1,p2);\nnormal.z=-normal.z;\nreturn normalize(normal);\n}\nvoid main()\n{\nvec3 random=normalize(texture2D(randomSampler,vUV*randTextureTiles).rgb);\nfloat depth=texture2D(textureSampler,vUV).r;\nvec3 position=vec3(vUV,depth);\nvec3 normal=normalFromDepth(depth,vUV);\nfloat radiusDepth=radius/depth;\nfloat occlusion=0.0;\nvec3 ray;\nvec3 hemiRay;\nfloat occlusionDepth;\nfloat difference;\nfor (int i=0; i<SAMPLES; i++)\n{\nray=radiusDepth*reflect(sampleSphere[i],random);\nhemiRay=position+sign(dot(ray,normal))*ray;\nocclusionDepth=texture2D(textureSampler,clamp(hemiRay.xy,vec2(0.001,0.001),vec2(0.999,0.999))).r;\ndifference=depth-occlusionDepth;\nocclusion+=step(fallOff,difference)*(1.0-smoothstep(fallOff,area,difference));\n}\nfloat ao=1.0-totalStrength*occlusion*samplesFactor;\nfloat result=clamp(ao+base,0.0,1.0);\ngl_FragColor.r=result;\ngl_FragColor.g=result;\ngl_FragColor.b=result;\ngl_FragColor.a=1.0;\n}\n#endif\n`;\n        ze.a.ShadersStore.ssaoPixelShader = $m;\n        var eg = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, n.getEngine(), e) || this;\n            a.SSAOOriginalSceneColorEffect = \"SSAOOriginalSceneColorEffect\", a.SSAORenderEffect = \"SSAORenderEffect\", a.SSAOBlurHRenderEffect = \"SSAOBlurHRenderEffect\", a.SSAOBlurVRenderEffect = \"SSAOBlurVRenderEffect\", a.SSAOCombineRenderEffect = \"SSAOCombineRenderEffect\", a.totalStrength = 1, a.radius = 1e-4, a.area = 75e-4, a.fallOff = 1e-6, a.base = 0.5, a._firstUpdate = !0, a._scene = n, a._createRandomTexture(), a._depthTexture = n.enableDepthRenderer().getDepthMap();\n            var s = i.ssaoRatio || i, d = i.combineRatio || i;\n            return a._originalColorPostProcess = new Ri(\"SSAOOriginalSceneColor\", d, null, Ne.a.BILINEAR_SAMPLINGMODE, n.getEngine(), !1), a._createSSAOPostProcess(s), a._createBlurPostProcess(s), a._createSSAOCombinePostProcess(d), a.addEffect(new xt(n.getEngine(), a.SSAOOriginalSceneColorEffect, function() {\n              return a._originalColorPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAORenderEffect, function() {\n              return a._ssaoPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAOBlurHRenderEffect, function() {\n              return a._blurHPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAOBlurVRenderEffect, function() {\n              return a._blurVPostProcess;\n            }, !0)), a.addEffect(new xt(n.getEngine(), a.SSAOCombineRenderEffect, function() {\n              return a._ssaoCombinePostProcess;\n            }, !0)), n.postProcessRenderPipelineManager.addPipeline(a), o && n.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e, o), a;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"SSAORenderingPipeline\";\n          }, t.prototype.dispose = function(e) {\n            e === void 0 && (e = !1);\n            for (var n = 0; n < this._scene.cameras.length; n++) {\n              var i = this._scene.cameras[n];\n              this._originalColorPostProcess.dispose(i), this._ssaoPostProcess.dispose(i), this._blurHPostProcess.dispose(i), this._blurVPostProcess.dispose(i), this._ssaoCombinePostProcess.dispose(i);\n            }\n            this._randomTexture.dispose(), e && this._scene.disableDepthRenderer(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras), r.prototype.dispose.call(this);\n          }, t.prototype._createBlurPostProcess = function(e) {\n            var n = this;\n            this._blurHPostProcess = new _n(\"BlurH\", new u.d(1, 0), 16, e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT), this._blurVPostProcess = new _n(\"BlurV\", new u.d(0, 1), 16, e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT), this._blurHPostProcess.onActivateObservable.add(function() {\n              var i = n._blurHPostProcess.width / n._scene.getEngine().getRenderWidth();\n              n._blurHPostProcess.kernel = 16 * i;\n            }), this._blurVPostProcess.onActivateObservable.add(function() {\n              var i = n._blurVPostProcess.height / n._scene.getEngine().getRenderHeight();\n              n._blurVPostProcess.kernel = 16 * i;\n            });\n          }, t.prototype._rebuild = function() {\n            this._firstUpdate = !0, r.prototype._rebuild.call(this);\n          }, t.prototype._createSSAOPostProcess = function(e) {\n            var n = this, i = [0.5381, 0.1856, -0.4319, 0.1379, 0.2486, 0.443, 0.3371, 0.5679, -57e-4, -0.6999, -0.0451, -19e-4, 0.0689, -0.1598, -0.8547, 0.056, 69e-4, -0.1843, -0.0146, 0.1402, 0.0762, 0.01, -0.1924, -0.0344, -0.3577, -0.5301, -0.4358, -0.3169, 0.1063, 0.0158, 0.0103, -0.5869, 46e-4, -0.0897, -0.494, 0.3287, 0.7119, -0.0154, -0.0918, -0.0533, 0.0596, -0.5411, 0.0352, -0.0631, 0.546, -0.4776, 0.2847, -0.0271];\n            this._ssaoPostProcess = new ft(\"ssao\", \"ssao\", [\"sampleSphere\", \"samplesFactor\", \"randTextureTiles\", \"totalStrength\", \"radius\", \"area\", \"fallOff\", \"base\", \"range\", \"viewport\"], [\"randomSampler\"], e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1, `#define SAMPLES 16\n#define SSAO`), this._ssaoPostProcess.onApply = function(o) {\n              n._firstUpdate && (o.setArray3(\"sampleSphere\", i), o.setFloat(\"samplesFactor\", 1 / 16), o.setFloat(\"randTextureTiles\", 4)), o.setFloat(\"totalStrength\", n.totalStrength), o.setFloat(\"radius\", n.radius), o.setFloat(\"area\", n.area), o.setFloat(\"fallOff\", n.fallOff), o.setFloat(\"base\", n.base), o.setTexture(\"textureSampler\", n._depthTexture), o.setTexture(\"randomSampler\", n._randomTexture);\n            };\n          }, t.prototype._createSSAOCombinePostProcess = function(e) {\n            var n = this;\n            this._ssaoCombinePostProcess = new ft(\"ssaoCombine\", \"ssaoCombine\", [], [\"originalColor\", \"viewport\"], e, null, Ne.a.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), !1), this._ssaoCombinePostProcess.onApply = function(i) {\n              i.setVector4(\"viewport\", u.c.Vector4[0].copyFromFloats(0, 0, 1, 1)), i.setTextureFromPostProcess(\"originalColor\", n._originalColorPostProcess);\n            };\n          }, t.prototype._createRandomTexture = function() {\n            this._randomTexture = new pi.a(\"SSAORandomTexture\", 512, this._scene, !1, Ne.a.TRILINEAR_SAMPLINGMODE), this._randomTexture.wrapU = Ne.a.WRAP_ADDRESSMODE, this._randomTexture.wrapV = Ne.a.WRAP_ADDRESSMODE;\n            for (var e = this._randomTexture.getContext(), n = function(s, d) {\n              return Math.random() * (d - s) + s;\n            }, i = u.e.Zero(), o = 0; o < 512; o++)\n              for (var a = 0; a < 512; a++)\n                i.x = Math.floor(255 * n(-1, 1)), i.y = Math.floor(255 * n(-1, 1)), i.z = Math.floor(255 * n(-1, 1)), e.fillStyle = \"rgb(\" + i.x + \", \" + i.y + \", \" + i.z + \")\", e.fillRect(o, a, 1, 1);\n            this._randomTexture.update(!1);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"totalStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"radius\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"area\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"fallOff\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"base\", void 0), t;\n        }(Ir), tg = function() {\n          this.enabled = !1, this.name = \"screenSpaceReflections\", this.texturesRequired = [h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, h.a.PREPASS_POSITION_TEXTURE_TYPE];\n        }, ng = `\n\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform sampler2D positionSampler;\nuniform sampler2D reflectivitySampler;\nuniform mat4 view;\nuniform mat4 projection;\nuniform float step;\nuniform float strength;\nuniform float threshold;\nuniform float roughnessFactor;\nuniform float reflectionSpecularFalloffExponent;\n\nvarying vec2 vUV;\n\nstruct ReflectionInfo {\nvec3 color;\nvec4 coords;\n};\n\nvec3 fresnelSchlick(float cosTheta,vec3 F0)\n{\nreturn F0+(1.0-F0)*pow(1.0-cosTheta,5.0);\n}\n\nReflectionInfo smoothReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\ninfo.color=vec3(0.0);\nvec4 projectedCoord;\nfloat sampledDepth;\nfor(int i=0; i<SMOOTH_STEPS; i++)\n{\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\ndir*=0.5;\nif(depth>0.0)\nhitCoord-=dir;\nelse\nhitCoord+=dir;\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\n}\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\n\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,1.0);\ninfo.color+=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.color/=float(SMOOTH_STEPS+1);\nreturn info;\n}\n\nReflectionInfo getReflectionInfo(vec3 dir,vec3 hitCoord)\n{\nReflectionInfo info;\nvec4 projectedCoord;\nfloat sampledDepth;\ndir*=step;\nfor(int i=0; i<REFLECTION_SAMPLES; i++)\n{\nhitCoord+=dir;\nprojectedCoord=projection*vec4(hitCoord,1.0);\nprojectedCoord.xy/=projectedCoord.w;\nprojectedCoord.xy=0.5*projectedCoord.xy+vec2(0.5);\nsampledDepth=(view*texture2D(positionSampler,projectedCoord.xy)).z;\nfloat depth=sampledDepth-hitCoord.z;\nif(((depth-dir.z)<threshold) && depth<=0.0)\n{\n#ifdef ENABLE_SMOOTH_REFLECTIONS\nreturn smoothReflectionInfo(dir,hitCoord);\n#else\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n#endif\n}\n}\ninfo.color=texture2D(textureSampler,projectedCoord.xy).rgb;\ninfo.coords=vec4(projectedCoord.xy,sampledDepth,0.0);\nreturn info;\n}\nvec3 hash(vec3 a)\n{\na=fract(a*0.8);\na+=dot(a,a.yxz+19.19);\nreturn fract((a.xxy+a.yxx)*a.zyx);\n}\nvoid main()\n{\n#ifdef SSR_SUPPORTED\n\nvec4 albedoFull=texture2D(textureSampler,vUV);\nvec3 albedo=albedoFull.rgb;\nfloat spec=texture2D(reflectivitySampler,vUV).r;\nif (spec == 0.0) {\ngl_FragColor=albedoFull;\nreturn;\n}\n\n#ifdef PREPASS_LAYOUT\nvec3 normal=(texture2D(normalSampler,vUV)).gba;\n#else\nvec3 normal=(texture2D(normalSampler,vUV)).xyz;\n#endif\nvec3 position=(view*texture2D(positionSampler,vUV)).xyz;\nvec3 reflected=normalize(reflect(normalize(position),normalize(normal)));\nfloat roughness=1.0-texture2D(reflectivitySampler,vUV).a;\nvec3 jitt=mix(vec3(0.0),hash(position),roughness)*roughnessFactor;\nReflectionInfo info=getReflectionInfo(jitt+reflected,position);\n\nvec2 dCoords=smoothstep(0.2,0.6,abs(vec2(0.5,0.5)-info.coords.xy));\nfloat screenEdgefactor=clamp(1.0-(dCoords.x+dCoords.y),0.0,1.0);\n\nvec3 F0=vec3(0.04);\nF0=mix(F0,albedo,spec);\nvec3 fresnel=fresnelSchlick(max(dot(normalize(normal),normalize(position)),0.0),F0);\n\nfloat reflectionMultiplier=clamp(pow(spec*strength,reflectionSpecularFalloffExponent)*screenEdgefactor*reflected.z,0.0,0.9);\nfloat albedoMultiplier=1.0-reflectionMultiplier;\nvec3 SSR=info.color*fresnel;\ngl_FragColor=vec4((albedo*albedoMultiplier)+(SSR*reflectionMultiplier),albedoFull.a);\n#else\ngl_FragColor=texture2D(textureSampler,vUV);\n#endif\n}\n`;\n        ze.a.ShadersStore.screenSpaceReflectionPixelShader = ng;\n        var Dc = function(r) {\n          function t(e, n, i, o, a, s, d, p, y, P) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1), P === void 0 && (P = !0);\n            var R = r.call(this, e, \"screenSpaceReflection\", [\"projection\", \"view\", \"threshold\", \"reflectionSpecularFalloffExponent\", \"strength\", \"step\", \"roughnessFactor\"], [\"textureSampler\", \"normalSampler\", \"positionSampler\", \"reflectivitySampler\"], i, o, a, s, d, `#define SSR_SUPPORTED\n#define REFLECTION_SAMPLES 64\n#define SMOOTH_STEPS 5\n`, p, void 0, null, y) || this;\n            if (R.threshold = 1.2, R.strength = 1, R.reflectionSpecularFalloffExponent = 3, R.step = 1, R.roughnessFactor = 0.2, R._forceGeometryBuffer = !1, R._enableSmoothReflections = !1, R._reflectionSamples = 64, R._smoothSteps = 5, R._forceGeometryBuffer = P, R._forceGeometryBuffer) {\n              var B = n.enableGeometryBufferRenderer();\n              B && B.isSupported && (B.enablePosition = !0, B.enableReflectivity = !0, R._geometryBufferRenderer = B);\n            } else\n              R._prePassRenderer = n.enablePrePassRenderer(), R._prePassRenderer.markAsDirty(), R._prePassEffectConfiguration = new tg();\n            return R._updateEffectDefines(), R.onApply = function(F) {\n              var z = R._geometryBufferRenderer, J = R._prePassRenderer;\n              if (J || z) {\n                if (z) {\n                  var ie = z.getTextureIndex(ri.POSITION_TEXTURE_TYPE), se = z.getTextureIndex(ri.REFLECTIVITY_TEXTURE_TYPE);\n                  F.setTexture(\"normalSampler\", z.getGBuffer().textures[1]), F.setTexture(\"positionSampler\", z.getGBuffer().textures[ie]), F.setTexture(\"reflectivitySampler\", z.getGBuffer().textures[se]);\n                } else {\n                  ie = J.getIndex(h.a.PREPASS_POSITION_TEXTURE_TYPE), se = J.getIndex(h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE);\n                  var ce = J.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE);\n                  F.setTexture(\"normalSampler\", J.prePassRT.textures[ce]), F.setTexture(\"positionSampler\", J.prePassRT.textures[ie]), F.setTexture(\"reflectivitySampler\", J.prePassRT.textures[se]);\n                }\n                var ue = n.activeCamera;\n                if (ue) {\n                  var fe = ue.getViewMatrix(), ve = ue.getProjectionMatrix();\n                  F.setMatrix(\"projection\", ve), F.setMatrix(\"view\", fe), F.setFloat(\"threshold\", R.threshold), F.setFloat(\"reflectionSpecularFalloffExponent\", R.reflectionSpecularFalloffExponent), F.setFloat(\"strength\", R.strength), F.setFloat(\"step\", R.step), F.setFloat(\"roughnessFactor\", R.roughnessFactor);\n                }\n              }\n            }, R;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScreenSpaceReflectionPostProcess\";\n          }, Object.defineProperty(t.prototype, \"enableSmoothReflections\", { get: function() {\n            return this._enableSmoothReflections;\n          }, set: function(e) {\n            e !== this._enableSmoothReflections && (this._enableSmoothReflections = e, this._updateEffectDefines());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"reflectionSamples\", { get: function() {\n            return this._reflectionSamples;\n          }, set: function(e) {\n            e !== this._reflectionSamples && (this._reflectionSamples = e, this._updateEffectDefines());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"smoothSteps\", { get: function() {\n            return this._smoothSteps;\n          }, set: function(e) {\n            e !== this._smoothSteps && (this._smoothSteps = e, this._updateEffectDefines());\n          }, enumerable: !1, configurable: !0 }), t.prototype._updateEffectDefines = function() {\n            var e = [];\n            (this._geometryBufferRenderer || this._prePassRenderer) && (e.push(\"#define SSR_SUPPORTED\"), this._prePassRenderer && e.push(\"#define PREPASS_LAYOUT\")), this._enableSmoothReflections && e.push(\"#define ENABLE_SMOOTH_REFLECTIONS\"), e.push(\"#define REFLECTION_SAMPLES \" + (this._reflectionSamples >> 0)), e.push(\"#define SMOOTH_STEPS \" + (this._smoothSteps >> 0)), this.updateEffect(e.join(`\n`));\n          }, t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, i, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.textureType, e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"threshold\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"strength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"reflectionSpecularFalloffExponent\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"step\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"roughnessFactor\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"enableSmoothReflections\", null), Object(c.c)([Object(L.c)()], t.prototype, \"reflectionSamples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"smoothSteps\", null), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ScreenSpaceReflectionPostProcess\"] = Dc;\n        var ig = `uniform sampler2D textureSampler;\nvarying vec2 vUV;\n#if defined(PASS_POST_PROCESS)\nvoid main(void)\n{\nvec4 color=texture2D(textureSampler,vUV);\ngl_FragColor=color;\n}\n#endif\n#if defined(DOWN_SAMPLE_X4)\nuniform vec2 dsOffsets[16];\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+dsOffsets[0]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[1]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[2]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[3]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[4]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[5]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[6]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[7]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[8]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[9]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[10]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[11]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[12]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[13]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[14]);\naverage+=texture2D(textureSampler,vUV+dsOffsets[15]);\naverage/=16.0;\ngl_FragColor=average;\n}\n#endif\n#if defined(BRIGHT_PASS)\nuniform vec2 dsOffsets[4];\nuniform float brightThreshold;\nvoid main(void)\n{\nvec4 average=vec4(0.0,0.0,0.0,0.0);\naverage=texture2D(textureSampler,vUV+vec2(dsOffsets[0].x,dsOffsets[0].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[1].x,dsOffsets[1].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[2].x,dsOffsets[2].y));\naverage+=texture2D(textureSampler,vUV+vec2(dsOffsets[3].x,dsOffsets[3].y));\naverage*=0.25;\nfloat luminance=length(average.rgb);\nif (luminance<brightThreshold) {\naverage=vec4(0.0,0.0,0.0,1.0);\n}\ngl_FragColor=average;\n}\n#endif\n#if defined(TEXTURE_ADDER)\nuniform sampler2D otherSampler;\nuniform sampler2D lensSampler;\nuniform float exposure;\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\ncolour*=exposure;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\ncolour+=colour*texture2D(lensSampler,vUV).rgb;\nvec4 finalColor=vec4(colour.rgb,1.0)+texture2D(otherSampler,vUV);\ngl_FragColor=finalColor;\n}\n#endif\n#if defined(VLS)\n#define PI 3.1415926535897932384626433832795\nuniform mat4 shadowViewProjection;\nuniform mat4 lightWorld;\nuniform vec3 cameraPosition;\nuniform vec3 sunDirection;\nuniform vec3 sunColor;\nuniform vec2 depthValues;\nuniform float scatteringCoefficient;\nuniform float scatteringPower;\nuniform sampler2D shadowMapSampler;\nuniform sampler2D positionSampler;\nfloat computeScattering(float lightDotView)\n{\nfloat result=1.0-scatteringCoefficient*scatteringCoefficient;\nresult/=(4.0*PI*pow(1.0+scatteringCoefficient*scatteringCoefficient-(2.0*scatteringCoefficient)*lightDotView,1.5));\nreturn result;\n}\nvoid main(void)\n{\n\nvec3 worldPos=texture2D(positionSampler,vUV).rgb;\nvec3 startPosition=cameraPosition;\nvec3 rayVector=worldPos-startPosition;\nfloat rayLength=length(rayVector);\nvec3 rayDirection=rayVector/rayLength;\nfloat stepLength=rayLength/NB_STEPS;\nvec3 stepL=rayDirection*stepLength;\nvec3 currentPosition=startPosition;\nvec3 accumFog=vec3(0.0);\nfor (int i=0; i<int(NB_STEPS); i++)\n{\nvec4 worldInShadowCameraSpace=shadowViewProjection*vec4(currentPosition,1.0);\nfloat depthMetric=(worldInShadowCameraSpace.z+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depthMetric,0.0,1.0);\nworldInShadowCameraSpace.xyz/=worldInShadowCameraSpace.w;\nworldInShadowCameraSpace.xyz=0.5*worldInShadowCameraSpace.xyz+vec3(0.5);\nfloat shadowMapValue=texture2D(shadowMapSampler,worldInShadowCameraSpace.xy).r;\nif (shadowMapValue>shadowPixelDepth)\naccumFog+=sunColor*computeScattering(dot(rayDirection,sunDirection));\ncurrentPosition+=stepL;\n}\naccumFog/=NB_STEPS;\nvec3 color=accumFog*scatteringPower;\ngl_FragColor=vec4(color*exp(color) ,1.0);\n}\n#endif\n#if defined(VLSMERGE)\nuniform sampler2D originalSampler;\nvoid main(void)\n{\ngl_FragColor=texture2D(originalSampler,vUV)+texture2D(textureSampler,vUV);\n}\n#endif\n#if defined(LUMINANCE)\nuniform vec2 lumOffsets[4];\nvoid main()\n{\nfloat average=0.0;\nvec4 color=vec4(0.0);\nfloat maximum=-1e20;\nvec3 weight=vec3(0.299,0.587,0.114);\nfor (int i=0; i<4; i++)\n{\ncolor=texture2D(textureSampler,vUV+ lumOffsets[i]);\n\nfloat GreyValue=dot(color.rgb,vec3(0.33,0.33,0.33));\n\n#ifdef WEIGHTED_AVERAGE\nfloat GreyValue=dot(color.rgb,weight);\n#endif\n#ifdef BRIGHTNESS\nfloat GreyValue=max(color.r,max(color.g,color.b));\n#endif\n#ifdef HSL_COMPONENT\nfloat GreyValue=0.5*(max(color.r,max(color.g,color.b))+min(color.r,min(color.g,color.b)));\n#endif\n#ifdef MAGNITUDE\nfloat GreyValue=length(color.rgb);\n#endif\nmaximum=max(maximum,GreyValue);\naverage+=(0.25*log(1e-5+GreyValue));\n}\naverage=exp(average);\ngl_FragColor=vec4(average,maximum,0.0,1.0);\n}\n#endif\n#if defined(LUMINANCE_DOWN_SAMPLE)\nuniform vec2 dsOffsets[9];\nuniform float halfDestPixelSize;\n#ifdef FINAL_DOWN_SAMPLER\n#include<packingFunctions>\n#endif\nvoid main()\n{\nvec4 color=vec4(0.0);\nfloat average=0.0;\nfor (int i=0; i<9; i++)\n{\ncolor=texture2D(textureSampler,vUV+vec2(halfDestPixelSize,halfDestPixelSize)+dsOffsets[i]);\naverage+=color.r;\n}\naverage/=9.0;\n#ifdef FINAL_DOWN_SAMPLER\ngl_FragColor=pack(average);\n#else\ngl_FragColor=vec4(average,average,0.0,1.0);\n#endif\n}\n#endif\n#if defined(HDR)\nuniform sampler2D textureAdderSampler;\nuniform float averageLuminance;\nvoid main()\n{\nvec4 color=texture2D(textureAdderSampler,vUV);\n#ifndef AUTO_EXPOSURE\nvec4 adjustedColor=color/averageLuminance;\ncolor=adjustedColor;\ncolor.a=1.0;\n#endif\ngl_FragColor=color;\n}\n#endif\n#if defined(LENS_FLARE)\n#define GHOSTS 3\nuniform sampler2D lensColorSampler;\nuniform float strength;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform vec2 resolution;\nuniform float distortionStrength;\nfloat hash(vec2 p)\n{\nfloat h=dot(p,vec2(127.1,311.7));\nreturn -1.0+2.0*fract(sin(h)*43758.5453123);\n}\nfloat noise(in vec2 p)\n{\nvec2 i=floor(p);\nvec2 f=fract(p);\nvec2 u=f*f*(3.0-2.0*f);\nreturn mix(mix(hash(i+vec2(0.0,0.0)),\nhash(i+vec2(1.0,0.0)),u.x),\nmix(hash(i+vec2(0.0,1.0)),\nhash(i+vec2(1.0,1.0)),u.x),u.y);\n}\nfloat fbm(vec2 p)\n{\nfloat f=0.0;\nf+=0.5000*noise(p); p*=2.02;\nf+=0.2500*noise(p); p*=2.03;\nf+=0.1250*noise(p); p*=2.01;\nf+=0.0625*noise(p); p*=2.04;\nf/=0.9375;\nreturn f;\n}\nvec3 pattern(vec2 uv)\n{\nvec2 p=-1.0+2.0*uv;\nfloat p2=dot(p,p);\nfloat f=fbm(vec2(15.0*p2))/2.0;\nfloat r=0.2+0.6*sin(12.5*length(uv-vec2(0.5)));\nfloat g=0.2+0.6*sin(20.5*length(uv-vec2(0.5)));\nfloat b=0.2+0.6*sin(17.2*length(uv-vec2(0.5)));\nreturn (1.0-f)*vec3(r,g,b);\n}\nfloat luminance(vec3 color)\n{\nreturn dot(color.rgb,vec3(0.2126,0.7152,0.0722));\n}\nvec4 textureDistorted(sampler2D tex,vec2 texcoord,vec2 direction,vec3 distortion)\n{\nreturn vec4(\ntexture2D(tex,texcoord+direction*distortion.r).r,\ntexture2D(tex,texcoord+direction*distortion.g).g,\ntexture2D(tex,texcoord+direction*distortion.b).b,\n1.0\n);\n}\nvoid main(void)\n{\nvec2 uv=-vUV+vec2(1.0);\nvec2 ghostDir=(vec2(0.5)-uv)*ghostDispersal;\nvec2 texelSize=1.0/resolution;\nvec3 distortion=vec3(-texelSize.x*distortionStrength,0.0,texelSize.x*distortionStrength);\nvec4 result=vec4(0.0);\nfloat ghostIndice=1.0;\nfor (int i=0; i<GHOSTS; ++i)\n{\nvec2 offset=fract(uv+ghostDir*ghostIndice);\nfloat weight=length(vec2(0.5)-offset)/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,offset,normalize(ghostDir),distortion)*weight*strength;\nghostIndice+=1.0;\n}\nvec2 haloVec=normalize(ghostDir)*haloWidth;\nfloat weight=length(vec2(0.5)-fract(uv+haloVec))/length(vec2(0.5));\nweight=pow(1.0-weight,10.0);\nresult+=textureDistorted(textureSampler,fract(uv+haloVec),normalize(ghostDir),distortion)*weight*strength;\nresult*=texture2D(lensColorSampler,vec2(length(vec2(0.5)-uv)/length(vec2(0.5))));\ngl_FragColor=result;\n}\n#endif\n#if defined(LENS_FLARE_COMPOSE)\nuniform sampler2D otherSampler;\nuniform sampler2D lensDirtSampler;\nuniform sampler2D lensStarSampler;\nuniform mat4 lensStarMatrix;\nvoid main(void)\n{\nvec2 lensFlareCoords=(lensStarMatrix*vec4(vUV,1.0,1.0)).xy;\nvec4 lensMod=texture2D(lensDirtSampler,vUV);\nlensMod+=texture2D(lensStarSampler,vUV);\nvec4 result=texture2D(textureSampler,vUV)*lensMod;\ngl_FragColor=texture2D(otherSampler,vUV)+result;\n}\n#endif\n#if defined(DEPTH_OF_FIELD)\nuniform sampler2D otherSampler;\nuniform sampler2D depthSampler;\nuniform float distance;\nvoid main(void)\n{\nvec4 sharp=texture2D(otherSampler,vUV);\nvec4 blur=texture2D(textureSampler,vUV);\nfloat dist=clamp(texture2D(depthSampler,vUV).r*distance,0.0,1.0);\nfloat factor=0.0;\nif (dist<0.05)\nfactor=1.0;\nelse if (dist<0.1)\nfactor=20.0*(0.1-dist);\nelse if (dist<0.5)\nfactor=0.0;\nelse\nfactor=2.0*(dist-0.5);\nfactor=clamp(factor,0.0,0.90);\ngl_FragColor=mix(sharp,blur,factor);\n}\n#endif\n#if defined(MOTION_BLUR)\nuniform mat4 inverseViewProjection;\nuniform mat4 prevViewProjection;\nuniform vec2 screenSize;\nuniform float motionScale;\nuniform float motionStrength;\nuniform sampler2D depthSampler;\nvoid main(void)\n{\nvec2 texelSize=1.0/screenSize;\nfloat depth=texture2D(depthSampler,vUV).r;\nvec4 cpos=vec4(vUV*2.0-1.0,depth,1.0);\ncpos=cpos*inverseViewProjection;\nvec4 ppos=cpos*prevViewProjection;\nppos.xyz/=ppos.w;\nppos.xy=ppos.xy*0.5+0.5;\nvec2 velocity=(ppos.xy-vUV)*motionScale*motionStrength;\nfloat speed=length(velocity/texelSize);\nint nSamples=int(clamp(speed,1.0,MAX_MOTION_SAMPLES));\nvec4 result=texture2D(textureSampler,vUV);\nfor (int i=1; i<int(MAX_MOTION_SAMPLES); ++i) {\nif (i>=nSamples)\nbreak;\nvec2 offset1=vUV+velocity*(float(i)/float(nSamples-1)-0.5);\nresult+=texture2D(textureSampler,offset1);\n}\ngl_FragColor=result/float(nSamples);\n}\n#endif\n`;\n        ze.a.ShadersStore.standardPixelShader = ig;\n        var Pd = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = null);\n            var s = r.call(this, n.getEngine(), e) || this;\n            return s.downSampleX4PostProcess = null, s.brightPassPostProcess = null, s.blurHPostProcesses = [], s.blurVPostProcesses = [], s.textureAdderPostProcess = null, s.volumetricLightPostProcess = null, s.volumetricLightSmoothXPostProcess = null, s.volumetricLightSmoothYPostProcess = null, s.volumetricLightMergePostProces = null, s.volumetricLightFinalPostProcess = null, s.luminancePostProcess = null, s.luminanceDownSamplePostProcesses = [], s.hdrPostProcess = null, s.textureAdderFinalPostProcess = null, s.lensFlareFinalPostProcess = null, s.hdrFinalPostProcess = null, s.lensFlarePostProcess = null, s.lensFlareComposePostProcess = null, s.motionBlurPostProcess = null, s.depthOfFieldPostProcess = null, s.fxaaPostProcess = null, s.screenSpaceReflectionPostProcess = null, s.brightThreshold = 1, s.blurWidth = 512, s.horizontalBlur = !1, s.lensTexture = null, s.volumetricLightCoefficient = 0.2, s.volumetricLightPower = 4, s.volumetricLightBlurScale = 64, s.sourceLight = null, s.hdrMinimumLuminance = 1, s.hdrDecreaseRate = 0.5, s.hdrIncreaseRate = 0.5, s.lensColorTexture = null, s.lensFlareStrength = 20, s.lensFlareGhostDispersal = 1.4, s.lensFlareHaloWidth = 0.7, s.lensFlareDistortionStrength = 16, s.lensFlareBlurWidth = 512, s.lensStarTexture = null, s.lensFlareDirtTexture = null, s.depthOfFieldDistance = 10, s.depthOfFieldBlurWidth = 64, s.animations = [], s._currentDepthOfFieldSource = null, s._fixedExposure = 1, s._currentExposure = 1, s._hdrAutoExposure = !1, s._hdrCurrentLuminance = 1, s._motionStrength = 1, s._isObjectBasedMotionBlur = !1, s._camerasToBeAttached = [], s._bloomEnabled = !1, s._depthOfFieldEnabled = !1, s._vlsEnabled = !1, s._lensFlareEnabled = !1, s._hdrEnabled = !1, s._motionBlurEnabled = !1, s._fxaaEnabled = !1, s._screenSpaceReflectionsEnabled = !1, s._motionBlurSamples = 64, s._volumetricLightStepsCount = 50, s._samples = 1, s._cameras = a || n.cameras, s._cameras = s._cameras.slice(), s._camerasToBeAttached = s._cameras.slice(), s._scene = n, s._basePostProcess = o, s._ratio = i, s._floatTextureType = n.getEngine().getCaps().textureFloatRender ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_HALF_FLOAT, n.postProcessRenderPipelineManager.addPipeline(s), s._buildPipeline(), s;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"exposure\", { get: function() {\n            return this._fixedExposure;\n          }, set: function(e) {\n            this._fixedExposure = e, this._currentExposure = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"hdrAutoExposure\", { get: function() {\n            return this._hdrAutoExposure;\n          }, set: function(e) {\n            if (this._hdrAutoExposure = e, this.hdrPostProcess) {\n              var n = [\"#define HDR\"];\n              e && n.push(\"#define AUTO_EXPOSURE\"), this.hdrPostProcess.updateEffect(n.join(`\n`));\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"motionStrength\", { get: function() {\n            return this._motionStrength;\n          }, set: function(e) {\n            this._motionStrength = e, this._isObjectBasedMotionBlur && this.motionBlurPostProcess && (this.motionBlurPostProcess.motionStrength = e);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"objectBasedMotionBlur\", { get: function() {\n            return this._isObjectBasedMotionBlur;\n          }, set: function(e) {\n            var n = this._isObjectBasedMotionBlur !== e;\n            this._isObjectBasedMotionBlur = e, n && this._buildPipeline();\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"BloomEnabled\", { get: function() {\n            return this._bloomEnabled;\n          }, set: function(e) {\n            this._bloomEnabled !== e && (this._bloomEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"DepthOfFieldEnabled\", { get: function() {\n            return this._depthOfFieldEnabled;\n          }, set: function(e) {\n            this._depthOfFieldEnabled !== e && (this._depthOfFieldEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"LensFlareEnabled\", { get: function() {\n            return this._lensFlareEnabled;\n          }, set: function(e) {\n            this._lensFlareEnabled !== e && (this._lensFlareEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"HDREnabled\", { get: function() {\n            return this._hdrEnabled;\n          }, set: function(e) {\n            this._hdrEnabled !== e && (this._hdrEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"VLSEnabled\", { get: function() {\n            return this._vlsEnabled;\n          }, set: function(e) {\n            if (this._vlsEnabled !== e) {\n              if (e && !this._scene.enableGeometryBufferRenderer())\n                return void l.a.Warn(\"Geometry renderer is not supported, cannot create volumetric lights in Standard Rendering Pipeline\");\n              this._vlsEnabled = e, this._buildPipeline();\n            }\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"MotionBlurEnabled\", { get: function() {\n            return this._motionBlurEnabled;\n          }, set: function(e) {\n            this._motionBlurEnabled !== e && (this._motionBlurEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"fxaaEnabled\", { get: function() {\n            return this._fxaaEnabled;\n          }, set: function(e) {\n            this._fxaaEnabled !== e && (this._fxaaEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"screenSpaceReflectionsEnabled\", { get: function() {\n            return this._screenSpaceReflectionsEnabled;\n          }, set: function(e) {\n            this._screenSpaceReflectionsEnabled !== e && (this._screenSpaceReflectionsEnabled = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"volumetricLightStepsCount\", { get: function() {\n            return this._volumetricLightStepsCount;\n          }, set: function(e) {\n            this.volumetricLightPostProcess && this.volumetricLightPostProcess.updateEffect(`#define VLS\n#define NB_STEPS ` + e.toFixed(1)), this._volumetricLightStepsCount = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"motionBlurSamples\", { get: function() {\n            return this._motionBlurSamples;\n          }, set: function(e) {\n            this.motionBlurPostProcess && (this._isObjectBasedMotionBlur ? this.motionBlurPostProcess.motionBlurSamples = e : this.motionBlurPostProcess.updateEffect(`#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES ` + e.toFixed(1))), this._motionBlurSamples = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"samples\", { get: function() {\n            return this._samples;\n          }, set: function(e) {\n            this._samples !== e && (this._samples = e, this._buildPipeline());\n          }, enumerable: !1, configurable: !0 }), t.prototype._buildPipeline = function() {\n            var e = this, n = this._ratio, i = this._scene;\n            this._disposePostProcesses(), this._cameras !== null && (this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), this._cameras = this._camerasToBeAttached.slice()), this._reset(), this._screenSpaceReflectionsEnabled && (this.screenSpaceReflectionPostProcess = new Dc(\"HDRPass\", i, n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, this._floatTextureType), this.screenSpaceReflectionPostProcess.onApplyObservable.add(function() {\n              e._currentDepthOfFieldSource = e.screenSpaceReflectionPostProcess;\n            }), this.addEffect(new xt(i.getEngine(), \"HDRScreenSpaceReflections\", function() {\n              return e.screenSpaceReflectionPostProcess;\n            }, !0))), this._basePostProcess ? this.originalPostProcess = this._basePostProcess : this.originalPostProcess = new ft(\"HDRPass\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", this._floatTextureType), this.originalPostProcess.autoClear = !this.screenSpaceReflectionPostProcess, this.originalPostProcess.onApplyObservable.add(function() {\n              e._currentDepthOfFieldSource = e.originalPostProcess;\n            }), this.addEffect(new xt(i.getEngine(), \"HDRPassPostProcess\", function() {\n              return e.originalPostProcess;\n            }, !0)), this._bloomEnabled && (this._createDownSampleX4PostProcess(i, n / 4), this._createBrightPassPostProcess(i, n / 4), this._createBlurPostProcesses(i, n / 4, 1), this._createTextureAdderPostProcess(i, n), this.textureAdderFinalPostProcess = new ft(\"HDRDepthOfFieldSource\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRBaseDepthOfFieldSource\", function() {\n              return e.textureAdderFinalPostProcess;\n            }, !0))), this._vlsEnabled && (this._createVolumetricLightPostProcess(i, n), this.volumetricLightFinalPostProcess = new ft(\"HDRVLSFinal\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRVLSFinal\", function() {\n              return e.volumetricLightFinalPostProcess;\n            }, !0))), this._lensFlareEnabled && (this._createLensFlarePostProcess(i, n), this.lensFlareFinalPostProcess = new ft(\"HDRPostLensFlareDepthOfFieldSource\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRPostLensFlareDepthOfFieldSource\", function() {\n              return e.lensFlareFinalPostProcess;\n            }, !0))), this._hdrEnabled && (this._createLuminancePostProcesses(i, this._floatTextureType), this._createHdrPostProcess(i, n), this.hdrFinalPostProcess = new ft(\"HDRPostHDReDepthOfFieldSource\", \"standard\", [], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, \"#define PASS_POST_PROCESS\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRPostHDReDepthOfFieldSource\", function() {\n              return e.hdrFinalPostProcess;\n            }, !0))), this._depthOfFieldEnabled && (this._createBlurPostProcesses(i, n / 2, 3, \"depthOfFieldBlurWidth\"), this._createDepthOfFieldPostProcess(i, n)), this._motionBlurEnabled && this._createMotionBlurPostProcess(i, n), this._fxaaEnabled && (this.fxaaPostProcess = new vo(\"fxaa\", 1, null, Ne.a.BILINEAR_SAMPLINGMODE, i.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(i.getEngine(), \"HDRFxaa\", function() {\n              return e.fxaaPostProcess;\n            }, !0))), this._cameras !== null && this._scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(this._name, this._cameras), !this._enableMSAAOnFirstPostProcess(this._samples) && this._samples > 1 && l.a.Warn(\"MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0\");\n          }, t.prototype._createDownSampleX4PostProcess = function(e, n) {\n            var i = this, o = new Array(32);\n            this.downSampleX4PostProcess = new ft(\"HDRDownSampleX4\", \"standard\", [\"dsOffsets\"], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define DOWN_SAMPLE_X4\", this._floatTextureType), this.downSampleX4PostProcess.onApply = function(a) {\n              for (var s = 0, d = i.downSampleX4PostProcess.width, p = i.downSampleX4PostProcess.height, y = -2; y < 2; y++)\n                for (var P = -2; P < 2; P++)\n                  o[s] = (y + 0.5) * (1 / d), o[s + 1] = (P + 0.5) * (1 / p), s += 2;\n              a.setArray2(\"dsOffsets\", o);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRDownSampleX4\", function() {\n              return i.downSampleX4PostProcess;\n            }, !0));\n          }, t.prototype._createBrightPassPostProcess = function(e, n) {\n            var i = this, o = new Array(8);\n            this.brightPassPostProcess = new ft(\"HDRBrightPass\", \"standard\", [\"dsOffsets\", \"brightThreshold\"], [], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define BRIGHT_PASS\", this._floatTextureType), this.brightPassPostProcess.onApply = function(a) {\n              var s = 1 / i.brightPassPostProcess.width, d = 1 / i.brightPassPostProcess.height;\n              o[0] = -0.5 * s, o[1] = 0.5 * d, o[2] = 0.5 * s, o[3] = 0.5 * d, o[4] = -0.5 * s, o[5] = -0.5 * d, o[6] = 0.5 * s, o[7] = -0.5 * d, a.setArray2(\"dsOffsets\", o), a.setFloat(\"brightThreshold\", i.brightThreshold);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRBrightPass\", function() {\n              return i.brightPassPostProcess;\n            }, !0));\n          }, t.prototype._createBlurPostProcesses = function(e, n, i, o) {\n            var a = this;\n            o === void 0 && (o = \"blurWidth\");\n            var s = e.getEngine(), d = new _n(\"HDRBlurH_\" + i, new u.d(1, 0), this[o], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, this._floatTextureType), p = new _n(\"HDRBlurV_\" + i, new u.d(0, 1), this[o], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, this._floatTextureType);\n            d.onActivateObservable.add(function() {\n              var y = d.width / s.getRenderWidth();\n              d.kernel = a[o] * y;\n            }), p.onActivateObservable.add(function() {\n              var y = p.height / s.getRenderHeight();\n              p.kernel = a.horizontalBlur ? 64 * y : a[o] * y;\n            }), this.addEffect(new xt(e.getEngine(), \"HDRBlurH\" + i, function() {\n              return d;\n            }, !0)), this.addEffect(new xt(e.getEngine(), \"HDRBlurV\" + i, function() {\n              return p;\n            }, !0)), this.blurHPostProcesses.push(d), this.blurVPostProcesses.push(p);\n          }, t.prototype._createTextureAdderPostProcess = function(e, n) {\n            var i = this;\n            this.textureAdderPostProcess = new ft(\"HDRTextureAdder\", \"standard\", [\"exposure\"], [\"otherSampler\", \"lensSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define TEXTURE_ADDER\", this._floatTextureType), this.textureAdderPostProcess.onApply = function(o) {\n              o.setTextureFromPostProcess(\"otherSampler\", i._vlsEnabled ? i._currentDepthOfFieldSource : i.originalPostProcess), o.setTexture(\"lensSampler\", i.lensTexture), o.setFloat(\"exposure\", i._currentExposure), i._currentDepthOfFieldSource = i.textureAdderFinalPostProcess;\n            }, this.addEffect(new xt(e.getEngine(), \"HDRTextureAdder\", function() {\n              return i.textureAdderPostProcess;\n            }, !0));\n          }, t.prototype._createVolumetricLightPostProcess = function(e, n) {\n            var i = this, o = e.enableGeometryBufferRenderer();\n            o.enablePosition = !0;\n            var a = o.getGBuffer();\n            this.volumetricLightPostProcess = new ft(\"HDRVLS\", \"standard\", [\"shadowViewProjection\", \"cameraPosition\", \"sunDirection\", \"sunColor\", \"scatteringCoefficient\", \"scatteringPower\", \"depthValues\"], [\"shadowMapSampler\", \"positionSampler\"], n / 8, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, `#define VLS\n#define NB_STEPS ` + this._volumetricLightStepsCount.toFixed(1));\n            var s = u.d.Zero();\n            this.volumetricLightPostProcess.onApply = function(d) {\n              if (i.sourceLight && i.sourceLight.getShadowGenerator() && i._scene.activeCamera) {\n                var p = i.sourceLight.getShadowGenerator();\n                d.setTexture(\"shadowMapSampler\", p.getShadowMap()), d.setTexture(\"positionSampler\", a.textures[2]), d.setColor3(\"sunColor\", i.sourceLight.diffuse), d.setVector3(\"sunDirection\", i.sourceLight.getShadowDirection()), d.setVector3(\"cameraPosition\", i._scene.activeCamera.globalPosition), d.setMatrix(\"shadowViewProjection\", p.getTransformMatrix()), d.setFloat(\"scatteringCoefficient\", i.volumetricLightCoefficient), d.setFloat(\"scatteringPower\", i.volumetricLightPower), s.x = i.sourceLight.getDepthMinZ(i._scene.activeCamera), s.y = i.sourceLight.getDepthMaxZ(i._scene.activeCamera), d.setVector2(\"depthValues\", s);\n              }\n            }, this.addEffect(new xt(e.getEngine(), \"HDRVLS\", function() {\n              return i.volumetricLightPostProcess;\n            }, !0)), this._createBlurPostProcesses(e, n / 4, 0, \"volumetricLightBlurScale\"), this.volumetricLightMergePostProces = new ft(\"HDRVLSMerge\", \"standard\", [], [\"originalSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define VLSMERGE\"), this.volumetricLightMergePostProces.onApply = function(d) {\n              d.setTextureFromPostProcess(\"originalSampler\", i._bloomEnabled ? i.textureAdderFinalPostProcess : i.originalPostProcess), i._currentDepthOfFieldSource = i.volumetricLightFinalPostProcess;\n            }, this.addEffect(new xt(e.getEngine(), \"HDRVLSMerge\", function() {\n              return i.volumetricLightMergePostProces;\n            }, !0));\n          }, t.prototype._createLuminancePostProcesses = function(e, n) {\n            var i = this, o = Math.pow(3, t.LuminanceSteps);\n            this.luminancePostProcess = new ft(\"HDRLuminance\", \"standard\", [\"lumOffsets\"], [], { width: o, height: o }, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define LUMINANCE\", n);\n            var a = [];\n            this.luminancePostProcess.onApply = function(P) {\n              var R = 1 / i.luminancePostProcess.width, B = 1 / i.luminancePostProcess.height;\n              a[0] = -0.5 * R, a[1] = 0.5 * B, a[2] = 0.5 * R, a[3] = 0.5 * B, a[4] = -0.5 * R, a[5] = -0.5 * B, a[6] = 0.5 * R, a[7] = -0.5 * B, P.setArray2(\"lumOffsets\", a);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRLuminance\", function() {\n              return i.luminancePostProcess;\n            }, !0));\n            for (var s = t.LuminanceSteps - 1; s >= 0; s--) {\n              o = Math.pow(3, s);\n              var d = `#define LUMINANCE_DOWN_SAMPLE\n`;\n              s === 0 && (d += \"#define FINAL_DOWN_SAMPLER\");\n              var p = new ft(\"HDRLuminanceDownSample\" + s, \"standard\", [\"dsOffsets\", \"halfDestPixelSize\"], [], { width: o, height: o }, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, d, n);\n              this.luminanceDownSamplePostProcesses.push(p);\n            }\n            var y = this.luminancePostProcess;\n            this.luminanceDownSamplePostProcesses.forEach(function(P, R) {\n              var B = new Array(18);\n              P.onApply = function(F) {\n                if (y) {\n                  for (var z = 0, J = -1; J < 2; J++)\n                    for (var ie = -1; ie < 2; ie++)\n                      B[z] = J / y.width, B[z + 1] = ie / y.height, z += 2;\n                  F.setArray2(\"dsOffsets\", B), F.setFloat(\"halfDestPixelSize\", 0.5 / y.width), y = R === i.luminanceDownSamplePostProcesses.length - 1 ? i.luminancePostProcess : P;\n                }\n              }, R === i.luminanceDownSamplePostProcesses.length - 1 && (P.onAfterRender = function() {\n                var F = e.getEngine().readPixels(0, 0, 1, 1), z = new u.f(1 / 16581375, 1 / 65025, 1 / 255, 1);\n                i._hdrCurrentLuminance = (F[0] * z.x + F[1] * z.y + F[2] * z.z + F[3] * z.w) / 100;\n              }), i.addEffect(new xt(e.getEngine(), \"HDRLuminanceDownSample\" + R, function() {\n                return P;\n              }, !0));\n            });\n          }, t.prototype._createHdrPostProcess = function(e, n) {\n            var i = this, o = [\"#define HDR\"];\n            this._hdrAutoExposure && o.push(\"#define AUTO_EXPOSURE\"), this.hdrPostProcess = new ft(\"HDR\", \"standard\", [\"averageLuminance\"], [\"textureAdderSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, o.join(`\n`), h.a.TEXTURETYPE_UNSIGNED_INT);\n            var a = 1, s = 0, d = 0;\n            this.hdrPostProcess.onApply = function(p) {\n              if (p.setTextureFromPostProcess(\"textureAdderSampler\", i._currentDepthOfFieldSource), s += e.getEngine().getDeltaTime(), a < 0)\n                a = i._hdrCurrentLuminance;\n              else {\n                var y = (d - s) / 1e3;\n                i._hdrCurrentLuminance < a + i.hdrDecreaseRate * y ? a += i.hdrDecreaseRate * y : i._hdrCurrentLuminance > a - i.hdrIncreaseRate * y ? a -= i.hdrIncreaseRate * y : a = i._hdrCurrentLuminance;\n              }\n              i.hdrAutoExposure ? i._currentExposure = i._fixedExposure / a : (a = $.a.Clamp(a, i.hdrMinimumLuminance, 1e20), p.setFloat(\"averageLuminance\", a)), d = s, i._currentDepthOfFieldSource = i.hdrFinalPostProcess;\n            }, this.addEffect(new xt(e.getEngine(), \"HDR\", function() {\n              return i.hdrPostProcess;\n            }, !0));\n          }, t.prototype._createLensFlarePostProcess = function(e, n) {\n            var i = this;\n            this.lensFlarePostProcess = new ft(\"HDRLensFlare\", \"standard\", [\"strength\", \"ghostDispersal\", \"haloWidth\", \"resolution\", \"distortionStrength\"], [\"lensColorSampler\"], n / 2, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define LENS_FLARE\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(e.getEngine(), \"HDRLensFlare\", function() {\n              return i.lensFlarePostProcess;\n            }, !0)), this._createBlurPostProcesses(e, n / 4, 2, \"lensFlareBlurWidth\"), this.lensFlareComposePostProcess = new ft(\"HDRLensFlareCompose\", \"standard\", [\"lensStarMatrix\"], [\"otherSampler\", \"lensDirtSampler\", \"lensStarSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define LENS_FLARE_COMPOSE\", h.a.TEXTURETYPE_UNSIGNED_INT), this.addEffect(new xt(e.getEngine(), \"HDRLensFlareCompose\", function() {\n              return i.lensFlareComposePostProcess;\n            }, !0));\n            var o = new u.d(0, 0);\n            this.lensFlarePostProcess.onApply = function(d) {\n              d.setTextureFromPostProcess(\"textureSampler\", i._bloomEnabled ? i.blurHPostProcesses[0] : i.originalPostProcess), d.setTexture(\"lensColorSampler\", i.lensColorTexture), d.setFloat(\"strength\", i.lensFlareStrength), d.setFloat(\"ghostDispersal\", i.lensFlareGhostDispersal), d.setFloat(\"haloWidth\", i.lensFlareHaloWidth), o.x = i.lensFlarePostProcess.width, o.y = i.lensFlarePostProcess.height, d.setVector2(\"resolution\", o), d.setFloat(\"distortionStrength\", i.lensFlareDistortionStrength);\n            };\n            var a = u.a.FromValues(2, 0, -1, 0, 0, 2, -1, 0, 0, 0, 1, 0, 0, 0, 0, 1), s = u.a.FromValues(0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n            this.lensFlareComposePostProcess.onApply = function(d) {\n              if (i._scene.activeCamera) {\n                d.setTextureFromPostProcess(\"otherSampler\", i.lensFlarePostProcess), d.setTexture(\"lensDirtSampler\", i.lensFlareDirtTexture), d.setTexture(\"lensStarSampler\", i.lensStarTexture);\n                var p = i._scene.activeCamera.getViewMatrix().getRow(0), y = i._scene.activeCamera.getViewMatrix().getRow(2), P = u.e.Dot(p.toVector3(), new u.e(1, 0, 0)) + u.e.Dot(y.toVector3(), new u.e(0, 0, 1));\n                P *= 4;\n                var R = u.a.FromValues(0.5 * Math.cos(P), -Math.sin(P), 0, 0, Math.sin(P), 0.5 * Math.cos(P), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), B = s.multiply(R).multiply(a);\n                d.setMatrix(\"lensStarMatrix\", B), i._currentDepthOfFieldSource = i.lensFlareFinalPostProcess;\n              }\n            };\n          }, t.prototype._createDepthOfFieldPostProcess = function(e, n) {\n            var i = this;\n            this.depthOfFieldPostProcess = new ft(\"HDRDepthOfField\", \"standard\", [\"distance\"], [\"otherSampler\", \"depthSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, \"#define DEPTH_OF_FIELD\", h.a.TEXTURETYPE_UNSIGNED_INT), this.depthOfFieldPostProcess.onApply = function(o) {\n              o.setTextureFromPostProcess(\"otherSampler\", i._currentDepthOfFieldSource), o.setTexture(\"depthSampler\", i._getDepthTexture()), o.setFloat(\"distance\", i.depthOfFieldDistance);\n            }, this.addEffect(new xt(e.getEngine(), \"HDRDepthOfField\", function() {\n              return i.depthOfFieldPostProcess;\n            }, !0));\n          }, t.prototype._createMotionBlurPostProcess = function(e, n) {\n            var i = this;\n            if (this._isObjectBasedMotionBlur) {\n              var o = new Mc(\"HDRMotionBlur\", e, n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, h.a.TEXTURETYPE_UNSIGNED_INT);\n              o.motionStrength = this.motionStrength, o.motionBlurSamples = this.motionBlurSamples, this.motionBlurPostProcess = o;\n            } else {\n              this.motionBlurPostProcess = new ft(\"HDRMotionBlur\", \"standard\", [\"inverseViewProjection\", \"prevViewProjection\", \"screenSize\", \"motionScale\", \"motionStrength\"], [\"depthSampler\"], n, null, Ne.a.BILINEAR_SAMPLINGMODE, e.getEngine(), !1, `#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES ` + this.motionBlurSamples.toFixed(1), h.a.TEXTURETYPE_UNSIGNED_INT);\n              var a = 0, s = u.a.Identity(), d = u.a.Identity(), p = u.a.Identity(), y = u.d.Zero();\n              this.motionBlurPostProcess.onApply = function(P) {\n                (p = e.getProjectionMatrix().multiply(e.getViewMatrix())).invertToRef(d), P.setMatrix(\"inverseViewProjection\", d), P.setMatrix(\"prevViewProjection\", s), s = p, y.x = i.motionBlurPostProcess.width, y.y = i.motionBlurPostProcess.height, P.setVector2(\"screenSize\", y), a = e.getEngine().getFps() / 60, P.setFloat(\"motionScale\", a), P.setFloat(\"motionStrength\", i.motionStrength), P.setTexture(\"depthSampler\", i._getDepthTexture());\n              };\n            }\n            this.addEffect(new xt(e.getEngine(), \"HDRMotionBlur\", function() {\n              return i.motionBlurPostProcess;\n            }, !0));\n          }, t.prototype._getDepthTexture = function() {\n            return this._scene.getEngine().getCaps().drawBuffersExtension ? this._scene.enableGeometryBufferRenderer().getGBuffer().textures[0] : this._scene.enableDepthRenderer().getDepthMap();\n          }, t.prototype._disposePostProcesses = function() {\n            for (var e = 0; e < this._cameras.length; e++) {\n              var n = this._cameras[e];\n              this.originalPostProcess && this.originalPostProcess.dispose(n), this.screenSpaceReflectionPostProcess && this.screenSpaceReflectionPostProcess.dispose(n), this.downSampleX4PostProcess && this.downSampleX4PostProcess.dispose(n), this.brightPassPostProcess && this.brightPassPostProcess.dispose(n), this.textureAdderPostProcess && this.textureAdderPostProcess.dispose(n), this.volumetricLightPostProcess && this.volumetricLightPostProcess.dispose(n), this.volumetricLightSmoothXPostProcess && this.volumetricLightSmoothXPostProcess.dispose(n), this.volumetricLightSmoothYPostProcess && this.volumetricLightSmoothYPostProcess.dispose(n), this.volumetricLightMergePostProces && this.volumetricLightMergePostProces.dispose(n), this.volumetricLightFinalPostProcess && this.volumetricLightFinalPostProcess.dispose(n), this.lensFlarePostProcess && this.lensFlarePostProcess.dispose(n), this.lensFlareComposePostProcess && this.lensFlareComposePostProcess.dispose(n);\n              for (var i = 0; i < this.luminanceDownSamplePostProcesses.length; i++)\n                this.luminanceDownSamplePostProcesses[i].dispose(n);\n              for (this.luminancePostProcess && this.luminancePostProcess.dispose(n), this.hdrPostProcess && this.hdrPostProcess.dispose(n), this.hdrFinalPostProcess && this.hdrFinalPostProcess.dispose(n), this.depthOfFieldPostProcess && this.depthOfFieldPostProcess.dispose(n), this.motionBlurPostProcess && this.motionBlurPostProcess.dispose(n), this.fxaaPostProcess && this.fxaaPostProcess.dispose(n), i = 0; i < this.blurHPostProcesses.length; i++)\n                this.blurHPostProcesses[i].dispose(n);\n              for (i = 0; i < this.blurVPostProcesses.length; i++)\n                this.blurVPostProcesses[i].dispose(n);\n            }\n            this.originalPostProcess = null, this.downSampleX4PostProcess = null, this.brightPassPostProcess = null, this.textureAdderPostProcess = null, this.textureAdderFinalPostProcess = null, this.volumetricLightPostProcess = null, this.volumetricLightSmoothXPostProcess = null, this.volumetricLightSmoothYPostProcess = null, this.volumetricLightMergePostProces = null, this.volumetricLightFinalPostProcess = null, this.lensFlarePostProcess = null, this.lensFlareComposePostProcess = null, this.luminancePostProcess = null, this.hdrPostProcess = null, this.hdrFinalPostProcess = null, this.depthOfFieldPostProcess = null, this.motionBlurPostProcess = null, this.fxaaPostProcess = null, this.screenSpaceReflectionPostProcess = null, this.luminanceDownSamplePostProcesses = [], this.blurHPostProcesses = [], this.blurVPostProcesses = [];\n          }, t.prototype.dispose = function() {\n            this._disposePostProcesses(), this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras), r.prototype.dispose.call(this);\n          }, t.prototype.serialize = function() {\n            var e = L.a.Serialize(this);\n            return this.sourceLight && (e.sourceLightId = this.sourceLight.id), this.screenSpaceReflectionPostProcess && (e.screenSpaceReflectionPostProcess = L.a.Serialize(this.screenSpaceReflectionPostProcess)), e.customType = \"StandardRenderingPipeline\", e;\n          }, t.Parse = function(e, n, i) {\n            var o = L.a.Parse(function() {\n              return new t(e._name, n, e._ratio);\n            }, e, n, i);\n            return e.sourceLightId && (o.sourceLight = n.getLightByID(e.sourceLightId)), e.screenSpaceReflectionPostProcess && L.a.Parse(function() {\n              return o.screenSpaceReflectionPostProcess;\n            }, e.screenSpaceReflectionPostProcess, n, i), o;\n          }, t.LuminanceSteps = 6, Object(c.c)([Object(L.c)()], t.prototype, \"brightThreshold\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"blurWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"horizontalBlur\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"exposure\", null), Object(c.c)([Object(L.m)(\"lensTexture\")], t.prototype, \"lensTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightCoefficient\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightPower\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightBlurScale\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrMinimumLuminance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrDecreaseRate\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrIncreaseRate\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"hdrAutoExposure\", null), Object(c.c)([Object(L.m)(\"lensColorTexture\")], t.prototype, \"lensColorTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareGhostDispersal\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareHaloWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareDistortionStrength\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"lensFlareBlurWidth\", void 0), Object(c.c)([Object(L.m)(\"lensStarTexture\")], t.prototype, \"lensStarTexture\", void 0), Object(c.c)([Object(L.m)(\"lensFlareDirtTexture\")], t.prototype, \"lensFlareDirtTexture\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldDistance\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"depthOfFieldBlurWidth\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"motionStrength\", null), Object(c.c)([Object(L.c)()], t.prototype, \"objectBasedMotionBlur\", null), Object(c.c)([Object(L.c)()], t.prototype, \"_ratio\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"BloomEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"DepthOfFieldEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"LensFlareEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"HDREnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"VLSEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"MotionBlurEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"fxaaEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"screenSpaceReflectionsEnabled\", null), Object(c.c)([Object(L.c)()], t.prototype, \"volumetricLightStepsCount\", null), Object(c.c)([Object(L.c)()], t.prototype, \"motionBlurSamples\", null), Object(c.c)([Object(L.c)()], t.prototype, \"samples\", null), t;\n        }(Ir);\n        O.a.RegisteredTypes[\"BABYLON.StandardRenderingPipeline\"] = Pd;\n        var rg = `const vec3 TWO=vec3(2.0,2.0,2.0);\nvarying vec2 vUV;\nuniform sampler2D camASampler;\nuniform sampler2D textureSampler;\nuniform vec2 stepSize;\nvoid main(void)\n{\nbool useCamA;\nbool useCamB;\nvec2 texCoord1;\nvec2 texCoord2;\nvec3 frag1;\nvec3 frag2;\n#ifdef IS_STEREOSCOPIC_HORIZ\nuseCamB=vUV.x>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(useCamB ? (vUV.x-0.5)*2.0 : vUV.x*2.0,vUV.y);\ntexCoord2=vec2(texCoord1.x+stepSize.x,vUV.y);\n#else\n#ifdef IS_STEREOSCOPIC_INTERLACED\nfloat rowNum=floor(vUV.y/stepSize.y);\nuseCamA=mod(rowNum,2.0) == 1.0;\nuseCamB=mod(rowNum,2.0) == 0.0;\ntexCoord1=vec2(vUV.x,vUV.y);\ntexCoord2=vec2(vUV.x,vUV.y);\n#else\nuseCamB=vUV.y>0.5;\nuseCamA=!useCamB;\ntexCoord1=vec2(vUV.x,useCamB ? (vUV.y-0.5)*2.0 : vUV.y*2.0);\ntexCoord2=vec2(vUV.x,texCoord1.y+stepSize.y);\n#endif\n#endif\n\nif (useCamB){\nfrag1=texture2D(textureSampler,texCoord1).rgb;\nfrag2=texture2D(textureSampler,texCoord2).rgb;\n}else if (useCamA){\nfrag1=texture2D(camASampler ,texCoord1).rgb;\nfrag2=texture2D(camASampler ,texCoord2).rgb;\n}else {\ndiscard;\n}\ngl_FragColor=vec4((frag1+frag2)/TWO,1.0);\n}\n`;\n        ze.a.ShadersStore.stereoscopicInterlacePixelShader = rg;\n        var og = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            var p = r.call(this, e, \"stereoscopicInterlace\", [\"stepSize\"], [\"camASampler\"], 1, n[1], a, s, d, o ? \"#define IS_STEREOSCOPIC_INTERLACED 1\" : i ? \"#define IS_STEREOSCOPIC_HORIZ 1\" : void 0) || this;\n            return p._passedProcess = n[0]._rigPostProcess, p._stepSize = new u.d(1 / p.width, 1 / p.height), p.onSizeChangedObservable.add(function() {\n              p._stepSize = new u.d(1 / p.width, 1 / p.height);\n            }), p.onApplyObservable.add(function(y) {\n              y.setTextureFromPostProcess(\"camASampler\", p._passedProcess), y.setFloat2(\"stepSize\", p._stepSize.x, p._stepSize.y);\n            }), p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicInterlacePostProcessI\";\n          }, t;\n        }(ft), ag = function(r) {\n          function t(e, n, i, o, a, s) {\n            var d = r.call(this, e, \"stereoscopicInterlace\", [\"stepSize\"], [\"camASampler\"], 1, n[1], o, a, s, i ? \"#define IS_STEREOSCOPIC_HORIZ 1\" : void 0) || this;\n            return d._passedProcess = n[0]._rigPostProcess, d._stepSize = new u.d(1 / d.width, 1 / d.height), d.onSizeChangedObservable.add(function() {\n              d._stepSize = new u.d(1 / d.width, 1 / d.height);\n            }), d.onApplyObservable.add(function(p) {\n              p.setTextureFromPostProcess(\"camASampler\", d._passedProcess), p.setFloat2(\"stepSize\", d._stepSize.x, d._stepSize.y);\n            }), d;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"StereoscopicInterlacePostProcess\";\n          }, t;\n        }(ft), sg = `\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\n\nuniform float _ExposureAdjustment;\n#if defined(HABLE_TONEMAPPING)\nconst float A=0.15;\nconst float B=0.50;\nconst float C=0.10;\nconst float D=0.20;\nconst float E=0.02;\nconst float F=0.30;\nconst float W=11.2;\n#endif\nfloat Luminance(vec3 c)\n{\nreturn dot(c,vec3(0.22,0.707,0.071));\n}\nvoid main(void)\n{\nvec3 colour=texture2D(textureSampler,vUV).rgb;\n#if defined(REINHARD_TONEMAPPING)\nfloat lum=Luminance(colour.rgb);\nfloat lumTm=lum*_ExposureAdjustment;\nfloat scale=lumTm/(1.0+lumTm);\ncolour*=scale/lum;\n#elif defined(HABLE_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nconst float ExposureBias=2.0;\nvec3 x=ExposureBias*colour;\nvec3 curr=((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;\nx=vec3(W,W,W);\nvec3 whiteScale=1.0/(((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F);\ncolour=curr*whiteScale;\n#elif defined(OPTIMIZED_HEJIDAWSON_TONEMAPPING)\ncolour*=_ExposureAdjustment;\nvec3 X=max(vec3(0.0,0.0,0.0),colour-0.004);\nvec3 retColor=(X*(6.2*X+0.5))/(X*(6.2*X+1.7)+0.06);\ncolour=retColor*retColor;\n#elif defined(PHOTOGRAPHIC_TONEMAPPING)\ncolour=vec3(1.0,1.0,1.0)-exp2(-_ExposureAdjustment*colour);\n#endif\ngl_FragColor=vec4(colour.rgb,1.0);\n}`;\n        ze.a.ShadersStore.tonemapPixelShader = sg;\n        var er;\n        (function(r) {\n          r[r.Hable = 0] = \"Hable\", r[r.Reinhard = 1] = \"Reinhard\", r[r.HejiDawson = 2] = \"HejiDawson\", r[r.Photographic = 3] = \"Photographic\";\n        })(er || (er = {}));\n        var cg = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            a === void 0 && (a = h.a.TEXTURE_BILINEAR_SAMPLINGMODE), d === void 0 && (d = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var p = r.call(this, e, \"tonemap\", [\"_ExposureAdjustment\"], null, 1, o, a, s, !0, null, d) || this;\n            p._operator = n, p.exposureAdjustment = i;\n            var y = \"#define \";\n            return p._operator === er.Hable ? y += \"HABLE_TONEMAPPING\" : p._operator === er.Reinhard ? y += \"REINHARD_TONEMAPPING\" : p._operator === er.HejiDawson ? y += \"OPTIMIZED_HEJIDAWSON_TONEMAPPING\" : p._operator === er.Photographic && (y += \"PHOTOGRAPHIC_TONEMAPPING\"), p.updateEffect(y), p.onApply = function(P) {\n              P.setFloat(\"_ExposureAdjustment\", p.exposureAdjustment);\n            }, p;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"TonemapPostProcess\";\n          }, t;\n        }(ft), lg = `uniform sampler2D textureSampler;\nuniform sampler2D lightScatteringSampler;\nuniform float decay;\nuniform float exposure;\nuniform float weight;\nuniform float density;\nuniform vec2 meshPositionOnScreen;\nvarying vec2 vUV;\nvoid main(void) {\nvec2 tc=vUV;\nvec2 deltaTexCoord=(tc-meshPositionOnScreen.xy);\ndeltaTexCoord*=1.0/float(NUM_SAMPLES)*density;\nfloat illuminationDecay=1.0;\nvec4 color=texture2D(lightScatteringSampler,tc)*0.4;\nfor(int i=0; i<NUM_SAMPLES; i++) {\ntc-=deltaTexCoord;\nvec4 dataSample=texture2D(lightScatteringSampler,tc)*0.4;\ndataSample*=illuminationDecay*weight;\ncolor+=dataSample;\nilluminationDecay*=decay;\n}\nvec4 realColor=texture2D(textureSampler,vUV);\ngl_FragColor=((vec4((vec3(color.r,color.g,color.b)*exposure),1))+(realColor*(1.5-0.4)));\n}\n`;\n        ze.a.ShadersStore.volumetricLightScatteringPixelShader = lg;\n        var ug = `\nattribute vec3 position;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\nuniform vec2 depthValues;\n#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\nvoid main(void)\n{\nvec3 positionUpdated=position;\n#if (defined(ALPHATEST) || defined(NEED_UV)) && defined(UV1)\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\n#if defined(ALPHATEST) || defined(BASIC_RENDER)\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n}\n`;\n        ze.a.ShadersStore.volumetricLightScatteringPassVertexShader = ug;\n        var hg = `#if defined(ALPHATEST) || defined(NEED_UV)\nvarying vec2 vUV;\n#endif\n#if defined(ALPHATEST)\nuniform sampler2D diffuseSampler;\n#endif\nvoid main(void)\n{\n#if defined(ALPHATEST)\nvec4 diffuseColor=texture2D(diffuseSampler,vUV);\nif (diffuseColor.a<0.4)\ndiscard;\n#endif\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\n}\n`;\n        ze.a.ShadersStore.volumetricLightScatteringPassPixelShader = hg;\n        var xd = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            a === void 0 && (a = 100), s === void 0 && (s = Ne.a.BILINEAR_SAMPLINGMODE);\n            var P = r.call(this, e, \"volumetricLightScattering\", [\"decay\", \"exposure\", \"weight\", \"meshPositionOnScreen\", \"density\"], [\"lightScatteringSampler\"], n.postProcessRatio || n, i, s, d, p, \"#define NUM_SAMPLES \" + a) || this;\n            return P._screenCoordinates = u.d.Zero(), P.customMeshPosition = u.e.Zero(), P.useCustomMeshPosition = !1, P.invert = !0, P.excludedMeshes = new Array(), P.exposure = 0.3, P.decay = 0.96815, P.weight = 0.58767, P.density = 0.926, d = (y = i === null ? y : i.getScene()).getEngine(), P._viewPort = new jn.a(0, 0, 1, 1).toGlobal(d.getRenderWidth(), d.getRenderHeight()), P.mesh = o !== null ? o : t.CreateDefaultMesh(\"VolumetricLightScatteringMesh\", y), P._createPass(y, n.passRatio || n), P.onActivate = function(R) {\n              P.isSupported || P.dispose(R), P.onActivate = null;\n            }, P.onApplyObservable.add(function(R) {\n              P._updateMeshScreenCoordinates(y), R.setTexture(\"lightScatteringSampler\", P._volumetricLightScatteringRTT), R.setFloat(\"exposure\", P.exposure), R.setFloat(\"decay\", P.decay), R.setFloat(\"weight\", P.weight), R.setFloat(\"density\", P.density), R.setVector2(\"meshPositionOnScreen\", P._screenCoordinates);\n            }), P;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"useDiffuseColor\", { get: function() {\n            return l.a.Warn(\"VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead\"), !1;\n          }, set: function(e) {\n            l.a.Warn(\"VolumetricLightScatteringPostProcess.useDiffuseColor is no longer used, use the mesh material directly instead\");\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"VolumetricLightScatteringPostProcess\";\n          }, t.prototype._isReady = function(e, n) {\n            var i = e.getMesh();\n            if (i === this.mesh && i.material)\n              return i.material.isReady(i);\n            var o = [], a = [Oe.b.PositionKind], s = e.getMaterial();\n            s && (s.needAlphaTesting() && o.push(\"#define ALPHATEST\"), i.isVerticesDataPresent(Oe.b.UVKind) && (a.push(Oe.b.UVKind), o.push(\"#define UV1\")), i.isVerticesDataPresent(Oe.b.UV2Kind) && (a.push(Oe.b.UV2Kind), o.push(\"#define UV2\"))), i.useBones && i.computeBonesUsingShaders ? (a.push(Oe.b.MatricesIndicesKind), a.push(Oe.b.MatricesWeightsKind), o.push(\"#define NUM_BONE_INFLUENCERS \" + i.numBoneInfluencers), o.push(\"#define BonesPerMesh \" + (i.skeleton ? i.skeleton.bones.length + 1 : 0))) : o.push(\"#define NUM_BONE_INFLUENCERS 0\"), n && (o.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(a), e.getRenderingMesh().hasThinInstances && o.push(\"#define THIN_INSTANCES\"));\n            var d = o.join(`\n`);\n            return this._cachedDefines !== d && (this._cachedDefines = d, this._volumetricLightScatteringPass = i.getScene().getEngine().createEffect(\"volumetricLightScatteringPass\", a, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\"], [\"diffuseSampler\"], d, void 0, void 0, void 0, { maxSimultaneousMorphTargets: i.numBoneInfluencers })), this._volumetricLightScatteringPass.isReady();\n          }, t.prototype.setCustomMeshPosition = function(e) {\n            this.customMeshPosition = e;\n          }, t.prototype.getCustomMeshPosition = function() {\n            return this.customMeshPosition;\n          }, t.prototype.dispose = function(e) {\n            var n = e.getScene().customRenderTargets.indexOf(this._volumetricLightScatteringRTT);\n            n !== -1 && e.getScene().customRenderTargets.splice(n, 1), this._volumetricLightScatteringRTT.dispose(), r.prototype.dispose.call(this, e);\n          }, t.prototype.getPass = function() {\n            return this._volumetricLightScatteringRTT;\n          }, t.prototype._meshExcluded = function(e) {\n            return this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(e) !== -1;\n          }, t.prototype._createPass = function(e, n) {\n            var i = this, o = e.getEngine();\n            this._volumetricLightScatteringRTT = new on(\"volumetricLightScatteringMap\", { width: o.getRenderWidth() * n, height: o.getRenderHeight() * n }, e, !1, !0, h.a.TEXTURETYPE_UNSIGNED_INT), this._volumetricLightScatteringRTT.wrapU = Ne.a.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._volumetricLightScatteringRTT.renderList = null, this._volumetricLightScatteringRTT.renderParticles = !1, this._volumetricLightScatteringRTT.ignoreCameraViewport = !0;\n            var a = this.getCamera();\n            a ? a.customRenderTargets.push(this._volumetricLightScatteringRTT) : e.customRenderTargets.push(this._volumetricLightScatteringRTT);\n            var s, d = function(y) {\n              var P = y.getRenderingMesh(), R = y.getEffectiveMesh();\n              if (!i._meshExcluded(P)) {\n                R._internalAbstractMeshDataInfo._isActiveIntermediate = !1;\n                var B = y.getMaterial();\n                if (B) {\n                  var F = P.getScene(), z = F.getEngine();\n                  z.setState(B.backFaceCulling);\n                  var J = P._getInstancesRenderList(y._id, !!y.getReplacementMesh());\n                  if (!J.mustReturn) {\n                    var ie = z.getCaps().instancedArrays && (J.visibleInstances[y._id] !== null || P.hasThinInstances);\n                    if (i._isReady(y, ie)) {\n                      var se = i._volumetricLightScatteringPass;\n                      if (P === i.mesh && (se = y.effect ? y.effect : B.getEffect()), z.enableEffect(se), P._bind(y, se, B.fillMode), P === i.mesh)\n                        B.bind(R.getWorldMatrix(), P);\n                      else {\n                        if (i._volumetricLightScatteringPass.setMatrix(\"viewProjection\", F.getTransformMatrix()), B && B.needAlphaTesting()) {\n                          var ce = B.getAlphaTestTexture();\n                          i._volumetricLightScatteringPass.setTexture(\"diffuseSampler\", ce), ce && i._volumetricLightScatteringPass.setMatrix(\"diffuseMatrix\", ce.getTextureMatrix());\n                        }\n                        P.useBones && P.computeBonesUsingShaders && P.skeleton && i._volumetricLightScatteringPass.setMatrices(\"mBones\", P.skeleton.getTransformMatrices(P));\n                      }\n                      P._processRendering(R, y, i._volumetricLightScatteringPass, zt.a.TriangleFillMode, J, ie, function(ue, fe) {\n                        return se.setMatrix(\"world\", fe);\n                      });\n                    }\n                  }\n                }\n              }\n            }, p = new I.b(0, 0, 0, 1);\n            this._volumetricLightScatteringRTT.onBeforeRenderObservable.add(function() {\n              s = e.clearColor, e.clearColor = p;\n            }), this._volumetricLightScatteringRTT.onAfterRenderObservable.add(function() {\n              e.clearColor = s;\n            }), this._volumetricLightScatteringRTT.customRenderFunction = function(y, P, R, B) {\n              var F, z = e.getEngine();\n              if (B.length) {\n                for (z.setColorWrite(!1), F = 0; F < B.length; F++)\n                  d(B.data[F]);\n                z.setColorWrite(!0);\n              }\n              for (F = 0; F < y.length; F++)\n                d(y.data[F]);\n              for (F = 0; F < P.length; F++)\n                d(P.data[F]);\n              if (R.length) {\n                for (F = 0; F < R.length; F++) {\n                  var J = R.data[F], ie = J.getBoundingInfo();\n                  ie && e.activeCamera && (J._alphaIndex = J.getMesh().alphaIndex, J._distanceToCamera = ie.boundingSphere.centerWorld.subtract(e.activeCamera.position).length());\n                }\n                var se = R.data.slice(0, R.length);\n                for (se.sort(function(ce, ue) {\n                  return ce._alphaIndex > ue._alphaIndex ? 1 : ce._alphaIndex < ue._alphaIndex ? -1 : ce._distanceToCamera < ue._distanceToCamera ? 1 : ce._distanceToCamera > ue._distanceToCamera ? -1 : 0;\n                }), z.setAlphaMode(h.a.ALPHA_COMBINE), F = 0; F < se.length; F++)\n                  d(se[F]);\n                z.setAlphaMode(h.a.ALPHA_DISABLE);\n              }\n            };\n          }, t.prototype._updateMeshScreenCoordinates = function(e) {\n            var n, i = e.getTransformMatrix();\n            n = this.useCustomMeshPosition ? this.customMeshPosition : this.attachedNode ? this.attachedNode.position : this.mesh.parent ? this.mesh.getAbsolutePosition() : this.mesh.position;\n            var o = u.e.Project(n, u.a.Identity(), i, this._viewPort);\n            this._screenCoordinates.x = o.x / this._viewPort.width, this._screenCoordinates.y = o.y / this._viewPort.height, this.invert && (this._screenCoordinates.y = 1 - this._screenCoordinates.y);\n          }, t.CreateDefaultMesh = function(e, n) {\n            var i = Ie.a.CreatePlane(e, 1, n);\n            i.billboardMode = Mt.a.BILLBOARDMODE_ALL;\n            var o = new Nt.a(e + \"Material\", n);\n            return o.emissiveColor = new I.a(1, 1, 1), i.material = o, i;\n          }, Object(c.c)([Object(L.o)()], t.prototype, \"customMeshPosition\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"useCustomMeshPosition\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"invert\", void 0), Object(c.c)([Object(L.k)()], t.prototype, \"mesh\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"excludedMeshes\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"exposure\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"decay\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"weight\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"density\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.VolumetricLightScatteringPostProcess\"] = xd;\n        var dg = `\n\nprecision highp float;\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform sampler2D normalSampler;\nuniform float curvature_ridge;\nuniform float curvature_valley;\n#ifndef CURVATURE_OFFSET\n#define CURVATURE_OFFSET 1\n#endif\nfloat curvature_soft_clamp(float curvature,float control)\n{\nif (curvature<0.5/control)\nreturn curvature*(1.0-curvature*control);\nreturn 0.25/control;\n}\nfloat calculate_curvature(ivec2 texel,float ridge,float valley)\n{\nvec2 normal_up=texelFetchOffset(normalSampler,texel,0,ivec2(0,CURVATURE_OFFSET)).rb;\nvec2 normal_down=texelFetchOffset(normalSampler,texel,0,ivec2(0,-CURVATURE_OFFSET)).rb;\nvec2 normal_left=texelFetchOffset(normalSampler,texel,0,ivec2(-CURVATURE_OFFSET,0)).rb;\nvec2 normal_right=texelFetchOffset(normalSampler,texel,0,ivec2( CURVATURE_OFFSET,0)).rb;\nfloat normal_diff=((normal_up.g-normal_down.g)+(normal_right.r-normal_left.r));\nif (normal_diff<0.0)\nreturn -2.0*curvature_soft_clamp(-normal_diff,valley);\nreturn 2.0*curvature_soft_clamp(normal_diff,ridge);\n}\nvoid main(void)\n{\nivec2 texel=ivec2(gl_FragCoord.xy);\nvec4 baseColor=texture2D(textureSampler,vUV);\nfloat curvature=calculate_curvature(texel,curvature_ridge,curvature_valley);\nbaseColor.rgb*=curvature+1.0;\ngl_FragColor=baseColor;\n}`;\n        ze.a.ShadersStore.screenSpaceCurvaturePixelShader = dg;\n        var Cd = function(r) {\n          function t(e, n, i, o, a, s, d, p, y) {\n            p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT), y === void 0 && (y = !1);\n            var P = r.call(this, e, \"screenSpaceCurvature\", [\"curvature_ridge\", \"curvature_valley\"], [\"textureSampler\", \"normalSampler\"], i, o, a, s, d, void 0, p, void 0, null, y) || this;\n            return P.ridge = 1, P.valley = 1, P._geometryBufferRenderer = n.enableGeometryBufferRenderer(), P._geometryBufferRenderer ? P.onApply = function(R) {\n              R.setFloat(\"curvature_ridge\", 0.5 / Math.max(P.ridge * P.ridge, 1e-4)), R.setFloat(\"curvature_valley\", 0.7 / Math.max(P.valley * P.valley, 1e-4));\n              var B = P._geometryBufferRenderer.getGBuffer().textures[1];\n              R.setTexture(\"normalSampler\", B);\n            } : l.a.Error(\"Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.\"), P;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"ScreenSpaceCurvaturePostProcess\";\n          }, Object.defineProperty(t, \"IsSupported\", { get: function() {\n            var e = te.a.LastCreatedEngine;\n            return !!e && (e.webGLVersion > 1 || e.getCaps().drawBuffersExtension);\n          }, enumerable: !1, configurable: !0 }), t._Parse = function(e, n, i, o) {\n            return L.a.Parse(function() {\n              return new t(e.name, i, e.options, n, e.renderTargetSamplingMode, i.getEngine(), e.textureType, e.reusable);\n            }, e, i, o);\n          }, Object(c.c)([Object(L.c)()], t.prototype, \"ridge\", void 0), Object(c.c)([Object(L.c)()], t.prototype, \"valley\", void 0), t;\n        }(ft);\n        O.a.RegisteredTypes[\"BABYLON.ScreenSpaceCurvaturePostProcess\"] = Cd, f(166), f(167), Object.defineProperty(_e.a.prototype, \"forceShowBoundingBoxes\", { get: function() {\n          return this._forceShowBoundingBoxes || !1;\n        }, set: function(r) {\n          this._forceShowBoundingBoxes = r, r && this.getBoundingBoxRenderer();\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.getBoundingBoxRenderer = function() {\n          return this._boundingBoxRenderer || (this._boundingBoxRenderer = new Rd(this)), this._boundingBoxRenderer;\n        }, Object.defineProperty(Mt.a.prototype, \"showBoundingBox\", { get: function() {\n          return this._showBoundingBox || !1;\n        }, set: function(r) {\n          this._showBoundingBox = r, r && this.getScene().getBoundingBoxRenderer();\n        }, enumerable: !0, configurable: !0 });\n        var Rd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_BOUNDINGBOXRENDERER, this.frontColor = new I.a(1, 1, 1), this.backColor = new I.a(0.1, 0.1, 0.1), this.showBackLines = !0, this.onBeforeBoxRenderingObservable = new C.c(), this.onAfterBoxRenderingObservable = new C.c(), this.onResourcesReadyObservable = new C.c(), this.enabled = !0, this.renderList = new si.a(32), this._vertexBuffers = {}, this._fillIndexBuffer = null, this._fillIndexData = null, this.scene = t, t._addComponent(this);\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeEvaluateActiveMeshStage.registerStep(ot.a.STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER, this, this.reset), this.scene._preActiveMeshStage.registerStep(ot.a.STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER, this, this._preActiveMesh), this.scene._evaluateSubMeshStage.registerStep(ot.a.STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER, this, this._evaluateSubMesh), this.scene._afterRenderingGroupDrawStage.registerStep(ot.a.STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER, this, this.render);\n          }, r.prototype._evaluateSubMesh = function(t, e) {\n            if (t.showSubMeshesBoundingBox) {\n              var n = e.getBoundingInfo();\n              n != null && (n.boundingBox._tag = t.renderingGroupId, this.renderList.push(n.boundingBox));\n            }\n          }, r.prototype._preActiveMesh = function(t) {\n            if (t.showBoundingBox || this.scene.forceShowBoundingBoxes) {\n              var e = t.getBoundingInfo();\n              e.boundingBox._tag = t.renderingGroupId, this.renderList.push(e.boundingBox);\n            }\n          }, r.prototype._prepareResources = function() {\n            if (!this._colorShader) {\n              this._colorShader = new ea.a(\"colorShader\", this.scene, \"color\", { attributes: [Oe.b.PositionKind], uniforms: [\"world\", \"viewProjection\", \"color\"] }), this._colorShader.reservedDataStore = { hidden: !0 };\n              var t = this.scene.getEngine(), e = ht.a.CreateBox({ size: 1 });\n              this._vertexBuffers[Oe.b.PositionKind] = new Oe.b(t, e.positions, Oe.b.PositionKind, !1), this._createIndexBuffer(), this._fillIndexData = e.indices, this.onResourcesReadyObservable.notifyObservers(this);\n            }\n          }, r.prototype._createIndexBuffer = function() {\n            var t = this.scene.getEngine();\n            this._indexBuffer = t.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);\n          }, r.prototype.rebuild = function() {\n            var t = this._vertexBuffers[Oe.b.PositionKind];\n            t && t._rebuild(), this._createIndexBuffer();\n          }, r.prototype.reset = function() {\n            this.renderList.reset();\n          }, r.prototype.render = function(t) {\n            if (this.renderList.length !== 0 && this.enabled && (this._prepareResources(), this._colorShader.isReady())) {\n              var e = this.scene.getEngine();\n              e.setDepthWrite(!1), this._colorShader._preBind();\n              for (var n = 0; n < this.renderList.length; n++) {\n                var i = this.renderList.data[n];\n                if (i._tag === t) {\n                  this.onBeforeBoxRenderingObservable.notifyObservers(i);\n                  var o = i.minimum, a = i.maximum.subtract(o), s = o.add(a.scale(0.5)), d = u.a.Scaling(a.x, a.y, a.z).multiply(u.a.Translation(s.x, s.y, s.z)).multiply(i.getWorldMatrix());\n                  e.bindBuffers(this._vertexBuffers, this._indexBuffer, this._colorShader.getEffect()), this.showBackLines && (e.setDepthFunctionToGreaterOrEqual(), this.scene.resetCachedMaterial(), this._colorShader.setColor4(\"color\", this.backColor.toColor4()), this._colorShader.bind(d), e.drawElementsType(zt.a.LineListDrawMode, 0, 24)), e.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._colorShader.setColor4(\"color\", this.frontColor.toColor4()), this._colorShader.bind(d), e.drawElementsType(zt.a.LineListDrawMode, 0, 24), this.onAfterBoxRenderingObservable.notifyObservers(i);\n                }\n              }\n              this._colorShader.unbind(), e.setDepthFunctionToLessOrEqual(), e.setDepthWrite(!0);\n            }\n          }, r.prototype.renderOcclusionBoundingBox = function(t) {\n            if (this._prepareResources(), this._colorShader.isReady() && t._boundingInfo) {\n              var e = this.scene.getEngine();\n              this._fillIndexBuffer || (this._fillIndexBuffer = e.createIndexBuffer(this._fillIndexData)), e.setDepthWrite(!1), e.setColorWrite(!1), this._colorShader._preBind();\n              var n = t._boundingInfo.boundingBox, i = n.minimum, o = n.maximum.subtract(i), a = i.add(o.scale(0.5)), s = u.a.Scaling(o.x, o.y, o.z).multiply(u.a.Translation(a.x, a.y, a.z)).multiply(n.getWorldMatrix());\n              e.bindBuffers(this._vertexBuffers, this._fillIndexBuffer, this._colorShader.getEffect()), e.setDepthFunctionToLess(), this.scene.resetCachedMaterial(), this._colorShader.bind(s), e.drawElementsType(zt.a.TriangleFillMode, 0, 36), this._colorShader.unbind(), e.setDepthFunctionToLessOrEqual(), e.setDepthWrite(!0), e.setColorWrite(!0);\n            }\n          }, r.prototype.dispose = function() {\n            if (this._colorShader) {\n              this.onBeforeBoxRenderingObservable.clear(), this.onAfterBoxRenderingObservable.clear(), this.onResourcesReadyObservable.clear(), this.renderList.dispose(), this._colorShader.dispose();\n              var t = this._vertexBuffers[Oe.b.PositionKind];\n              t && (t.dispose(), this._vertexBuffers[Oe.b.PositionKind] = null), this.scene.getEngine()._releaseBuffer(this._indexBuffer), this._fillIndexBuffer && (this.scene.getEngine()._releaseBuffer(this._fillIndexBuffer), this._fillIndexBuffer = null);\n            }\n          }, r;\n        }();\n        _e.a.prototype.enableDepthRenderer = function(r, t, e) {\n          if (t === void 0 && (t = !1), e === void 0 && (e = !1), !(r = r || this.activeCamera))\n            throw \"No camera available to enable depth renderer\";\n          if (this._depthRenderer || (this._depthRenderer = {}), !this._depthRenderer[r.id]) {\n            var n = !!this.getEngine().getCaps().textureFloatRender, i = 0;\n            i = !this.getEngine().getCaps().textureHalfFloatRender || e && n ? n ? h.a.TEXTURETYPE_FLOAT : h.a.TEXTURETYPE_UNSIGNED_BYTE : h.a.TEXTURETYPE_HALF_FLOAT, this._depthRenderer[r.id] = new Qo(this, i, r, t);\n          }\n          return this._depthRenderer[r.id];\n        }, _e.a.prototype.disableDepthRenderer = function(r) {\n          (r = r || this.activeCamera) && this._depthRenderer && this._depthRenderer[r.id] && (this._depthRenderer[r.id].dispose(), delete this._depthRenderer[r.id]);\n        };\n        var Od = function() {\n          function r(t) {\n            this.name = ot.a.NAME_DEPTHRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._gatherRenderTargetsStage.registerStep(ot.a.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets), this.scene._gatherActiveCameraRenderTargetsStage.registerStep(ot.a.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            for (var t in this.scene._depthRenderer)\n              this.scene._depthRenderer[t].dispose();\n          }, r.prototype._gatherRenderTargets = function(t) {\n            if (this.scene._depthRenderer)\n              for (var e in this.scene._depthRenderer) {\n                var n = this.scene._depthRenderer[e];\n                n.enabled && !n.useOnlyInActiveCamera && t.push(n.getDepthMap());\n              }\n          }, r.prototype._gatherActiveCameraRenderTargets = function(t) {\n            if (this.scene._depthRenderer)\n              for (var e in this.scene._depthRenderer) {\n                var n = this.scene._depthRenderer[e];\n                n.enabled && n.useOnlyInActiveCamera && this.scene.activeCamera.id === e && t.push(n.getDepthMap());\n              }\n          }, r;\n        }();\n        Qo._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_DEPTHRENDERER);\n          t || (t = new Od(r), r._addComponent(t));\n        }, ze.a.ShadersStore.linePixelShader = `uniform vec4 color;\nvoid main(void) {\ngl_FragColor=color;\n}`;\n        var fg = `#include<instancesDeclaration>\n\nattribute vec3 position;\nattribute vec4 normal;\n\nuniform mat4 viewProjection;\nuniform float width;\nuniform float aspectRatio;\nvoid main(void) {\n#include<instancesVertex>\nmat4 worldViewProjection=viewProjection*finalWorld;\nvec4 viewPosition=worldViewProjection*vec4(position,1.0);\nvec4 viewPositionNext=worldViewProjection*vec4(normal.xyz,1.0);\nvec2 currentScreen=viewPosition.xy/viewPosition.w;\nvec2 nextScreen=viewPositionNext.xy/viewPositionNext.w;\ncurrentScreen.x*=aspectRatio;\nnextScreen.x*=aspectRatio;\nvec2 dir=normalize(nextScreen-currentScreen);\nvec2 normalDir=vec2(-dir.y,dir.x);\nnormalDir*=width/2.0;\nnormalDir.x/=aspectRatio;\nvec4 offset=vec4(normalDir*normal.w,0.0,0.0);\ngl_Position=viewPosition+offset;\n}`;\n        ze.a.ShadersStore.lineVertexShader = fg, Mt.a.prototype.disableEdgesRendering = function() {\n          return this._edgesRenderer && (this._edgesRenderer.dispose(), this._edgesRenderer = null), this;\n        }, Mt.a.prototype.enableEdgesRendering = function(r, t, e) {\n          return r === void 0 && (r = 0.95), t === void 0 && (t = !1), this.disableEdgesRendering(), this._edgesRenderer = new Lc(this, r, t, !0, e), this;\n        }, Object.defineProperty(Mt.a.prototype, \"edgesRenderer\", { get: function() {\n          return this._edgesRenderer;\n        }, enumerable: !0, configurable: !0 }), ho.b.prototype.enableEdgesRendering = function(r, t) {\n          return r === void 0 && (r = 0.95), t === void 0 && (t = !1), this.disableEdgesRendering(), this._edgesRenderer = new Md(this, r, t), this;\n        }, ho.a.prototype.enableEdgesRendering = function(r, t) {\n          return r === void 0 && (r = 0.95), t === void 0 && (t = !1), ho.b.prototype.enableEdgesRendering.apply(this, arguments), this;\n        };\n        var pg = function() {\n          this.edges = new Array(), this.edgesConnectedCount = 0;\n        }, Lc = function() {\n          function r(t, e, n, i, o) {\n            var a, s = this;\n            e === void 0 && (e = 0.95), n === void 0 && (n = !1), i === void 0 && (i = !0), this.edgesWidthScalerForOrthographic = 1e3, this.edgesWidthScalerForPerspective = 50, this._linesPositions = new Array(), this._linesNormals = new Array(), this._linesIndices = new Array(), this._buffers = {}, this._buffersForInstances = {}, this._checkVerticesInsteadOfIndices = !1, this.isEnabled = !0, this.customInstances = new si.a(32), this._source = t, this._checkVerticesInsteadOfIndices = n, this._options = o ?? null, this._epsilon = e, this._prepareRessources(), i && ((a = o == null ? void 0 : o.useAlternateEdgeFinder) === null || a === void 0 || a ? this._generateEdgesLinesAlternate() : this._generateEdgesLines()), this._meshRebuildObserver = this._source.onRebuildObservable.add(function() {\n              s._rebuild();\n            }), this._meshDisposeObserver = this._source.onDisposeObservable.add(function() {\n              s.dispose();\n            });\n          }\n          return Object.defineProperty(r.prototype, \"linesPositions\", { get: function() {\n            return this._linesPositions;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"linesNormals\", { get: function() {\n            return this._linesNormals;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"linesIndices\", { get: function() {\n            return this._linesIndices;\n          }, enumerable: !1, configurable: !0 }), r.GetShader = function(t) {\n            if (!t._edgeRenderLineShader) {\n              var e = new ea.a(\"lineShader\", t, \"line\", { attributes: [\"position\", \"normal\"], uniforms: [\"world\", \"viewProjection\", \"color\", \"width\", \"aspectRatio\"] });\n              e.disableDepthWrite = !0, e.backFaceCulling = !1, t._edgeRenderLineShader = e;\n            }\n            return t._edgeRenderLineShader;\n          }, r.prototype._prepareRessources = function() {\n            this._lineShader || (this._lineShader = r.GetShader(this._source.getScene()));\n          }, r.prototype._rebuild = function() {\n            var t = this._buffers[Oe.b.PositionKind];\n            t && t._rebuild(), (t = this._buffers[Oe.b.NormalKind]) && t._rebuild();\n            var e = this._source.getScene().getEngine();\n            this._ib = e.createIndexBuffer(this._linesIndices);\n          }, r.prototype.dispose = function() {\n            this._source.onRebuildObservable.remove(this._meshRebuildObserver), this._source.onDisposeObservable.remove(this._meshDisposeObserver);\n            var t = this._buffers[Oe.b.PositionKind];\n            t && (t.dispose(), this._buffers[Oe.b.PositionKind] = null), (t = this._buffers[Oe.b.NormalKind]) && (t.dispose(), this._buffers[Oe.b.NormalKind] = null), this._ib && this._source.getScene().getEngine()._releaseBuffer(this._ib), this._lineShader.dispose();\n          }, r.prototype._processEdgeForAdjacencies = function(t, e, n, i, o) {\n            return t === n && e === i || t === i && e === n ? 0 : t === i && e === o || t === o && e === i ? 1 : t === o && e === n || t === n && e === o ? 2 : -1;\n          }, r.prototype._processEdgeForAdjacenciesWithVertices = function(t, e, n, i, o) {\n            var a = 1e-10;\n            return t.equalsWithEpsilon(n, a) && e.equalsWithEpsilon(i, a) || t.equalsWithEpsilon(i, a) && e.equalsWithEpsilon(n, a) ? 0 : t.equalsWithEpsilon(i, a) && e.equalsWithEpsilon(o, a) || t.equalsWithEpsilon(o, a) && e.equalsWithEpsilon(i, a) ? 1 : t.equalsWithEpsilon(o, a) && e.equalsWithEpsilon(n, a) || t.equalsWithEpsilon(n, a) && e.equalsWithEpsilon(o, a) ? 2 : -1;\n          }, r.prototype._checkEdge = function(t, e, n, i, o) {\n            var a;\n            e === void 0 ? a = !0 : a = u.e.Dot(n[t], n[e]) < this._epsilon, a && this.createLine(i, o, this._linesPositions.length / 3);\n          }, r.prototype.createLine = function(t, e, n) {\n            this._linesPositions.push(t.x, t.y, t.z, t.x, t.y, t.z, e.x, e.y, e.z, e.x, e.y, e.z), this._linesNormals.push(e.x, e.y, e.z, -1, e.x, e.y, e.z, 1, t.x, t.y, t.z, -1, t.x, t.y, t.z, 1), this._linesIndices.push(n, n + 1, n + 2, n, n + 2, n + 3);\n          }, r.prototype._tessellateTriangle = function(t, e, n, i) {\n            var o = function(Ae, Ee, Se) {\n              Se >= 0 && Ee.push(Se);\n              for (var De = 0; De < Ae.length; ++De)\n                Ee.push(Ae[De][0]);\n            }, a = 0;\n            t[1].length >= t[0].length && t[1].length >= t[2].length ? a = 1 : t[2].length >= t[0].length && t[2].length >= t[1].length && (a = 2);\n            for (var s = 0; s < 3; ++s)\n              s === a ? t[s].sort(function(Ae, Ee) {\n                return Ae[1] < Ee[1] ? -1 : Ae[1] > Ee[1] ? 1 : 0;\n              }) : t[s].sort(function(Ae, Ee) {\n                return Ae[1] > Ee[1] ? -1 : Ae[1] < Ee[1] ? 1 : 0;\n              });\n            var d = [], p = [];\n            o(t[a], d, -1);\n            for (var y = d.length, P = a + 2; P >= a + 1; --P)\n              o(t[P % 3], p, P !== a + 2 ? i[n[e + (P + 1) % 3]] : -1);\n            var R = p.length;\n            n.push(i[n[e + a]], d[0], p[0]), n.push(i[n[e + (a + 1) % 3]], p[R - 1], d[y - 1]);\n            for (var B = y <= R, F = B ? y : R, z = B ? R : y, J = B ? y - 1 : R - 1, ie = B ? 0 : 1, se = y + R - 2, ce = 0, ue = 0, fe = B ? d : p, ve = B ? p : d, Te = 0; se-- > 0; ) {\n              ie ? n.push(fe[ce], ve[ue]) : n.push(ve[ue], fe[ce]);\n              var Re = void 0;\n              (Te += F) >= z && ce < J ? (Re = fe[++ce], Te -= z) : Re = ve[++ue], n.push(Re);\n            }\n            n[e + 0] = n[n.length - 3], n[e + 1] = n[n.length - 2], n[e + 2] = n[n.length - 1], n.length = n.length - 3;\n          }, r.prototype._generateEdgesLinesAlternate = function() {\n            var t, e, n, i, o, a, s, d, p, y = this._source.getVerticesData(Oe.b.PositionKind), P = this._source.getIndices();\n            if (P && y) {\n              Array.isArray(P) || (P = Xe.b.SliceToArray(P));\n              var R = (e = (t = this._options) === null || t === void 0 ? void 0 : t.useFastVertexMerger) === null || e === void 0 || e, B = R ? Math.round(-Math.log((i = (n = this._options) === null || n === void 0 ? void 0 : n.epsilonVertexMerge) !== null && i !== void 0 ? i : 1e-6) / Math.log(10)) : (a = (o = this._options) === null || o === void 0 ? void 0 : o.epsilonVertexMerge) !== null && a !== void 0 ? a : 1e-6, F = [], z = [];\n              if (R)\n                for (var J = {}, ie = 0; ie < y.length; ie += 3) {\n                  var se = y[ie + 0], ce = y[ie + 1], ue = y[ie + 2];\n                  if (J[Rt = se.toFixed(B) + \"|\" + ce.toFixed(B) + \"|\" + ue.toFixed(B)] !== void 0)\n                    F.push(J[Rt]);\n                  else {\n                    var fe = ie / 3;\n                    J[Rt] = fe, F.push(fe), z.push(fe);\n                  }\n                }\n              else\n                for (ie = 0; ie < y.length; ie += 3) {\n                  se = y[ie + 0], ce = y[ie + 1], ue = y[ie + 2];\n                  for (var ve = !1, Te = 0; Te < ie && !ve; Te += 3) {\n                    var Re = y[Te + 0], Ae = y[Te + 1], Ee = y[Te + 2];\n                    if (Math.abs(se - Re) < B && Math.abs(ce - Ae) < B && Math.abs(ue - Ee) < B) {\n                      F.push(Te / 3), ve = !0;\n                      break;\n                    }\n                  }\n                  ve || (F.push(ie / 3), z.push(ie / 3));\n                }\n              if (!((s = this._options) === null || s === void 0) && s.applyTessellation) {\n                for (var Se = (p = (d = this._options) === null || d === void 0 ? void 0 : d.epsilonVertexAligned) !== null && p !== void 0 ? p : 1e-6, De = [], xe = 0; xe < P.length; xe += 3)\n                  for (var Le = void 0, Me = 0; Me < 3; ++Me) {\n                    var we = F[P[xe + Me]], Ye = F[P[xe + (Me + 1) % 3]], et = F[P[xe + (Me + 2) % 3]];\n                    if (we !== Ye)\n                      for (var nt = y[3 * we + 0], ct = y[3 * we + 1], Ke = y[3 * we + 2], rt = y[3 * Ye + 0], it = y[3 * Ye + 1], qe = y[3 * Ye + 2], ut = Math.sqrt((rt - nt) * (rt - nt) + (it - ct) * (it - ct) + (qe - Ke) * (qe - Ke)), Ve = 0; Ve < z.length - 1; Ve++) {\n                        var Ze = z[Ve];\n                        if (Ze !== we && Ze !== Ye && Ze !== et) {\n                          var vt = y[3 * Ze + 0], jt = y[3 * Ze + 1], Dt = y[3 * Ze + 2], Yt = Math.sqrt((vt - nt) * (vt - nt) + (jt - ct) * (jt - ct) + (Dt - Ke) * (Dt - Ke)), mt = Math.sqrt((vt - rt) * (vt - rt) + (jt - it) * (jt - it) + (Dt - qe) * (Dt - qe));\n                          Math.abs(Yt + mt - ut) < Se && (Le || (Le = { index: xe, edgesPoints: [[], [], []] }, De.push(Le)), Le.edgesPoints[Me].push([Ze, Yt]));\n                        }\n                      }\n                  }\n                for (var qt = 0; qt < De.length; ++qt) {\n                  var Ht = De[qt];\n                  this._tessellateTriangle(Ht.edgesPoints, Ht.index, P, F);\n                }\n                De = null;\n              }\n              var kt = {};\n              for (xe = 0; xe < P.length; xe += 3) {\n                var Wt = void 0;\n                for (Me = 0; Me < 3; ++Me)\n                  if (we = F[P[xe + Me]], Ye = F[P[xe + (Me + 1) % 3]], et = F[P[xe + (Me + 2) % 3]], we !== Ye) {\n                    if (u.c.Vector3[0].copyFromFloats(y[3 * we + 0], y[3 * we + 1], y[3 * we + 2]), u.c.Vector3[1].copyFromFloats(y[3 * Ye + 0], y[3 * Ye + 1], y[3 * Ye + 2]), u.c.Vector3[2].copyFromFloats(y[3 * et + 0], y[3 * et + 1], y[3 * et + 2]), Wt || (u.c.Vector3[1].subtractToRef(u.c.Vector3[0], u.c.Vector3[3]), u.c.Vector3[2].subtractToRef(u.c.Vector3[1], u.c.Vector3[4]), (Wt = u.e.Cross(u.c.Vector3[3], u.c.Vector3[4])).normalize()), we > Ye) {\n                      var bt = we;\n                      we = Ye, Ye = bt;\n                    }\n                    (Zt = kt[Rt = we + \"_\" + Ye]) ? Zt.done || (u.e.Dot(Wt, Zt.normal) < this._epsilon && this.createLine(u.c.Vector3[0], u.c.Vector3[1], this._linesPositions.length / 3), Zt.done = !0) : kt[Rt] = { normal: Wt, done: !1, index: xe, i: Me };\n                  }\n              }\n              for (var Rt in kt) {\n                var Zt;\n                (Zt = kt[Rt]).done || (we = F[P[Zt.index + Zt.i]], Ye = F[P[Zt.index + (Zt.i + 1) % 3]], u.c.Vector3[0].copyFromFloats(y[3 * we + 0], y[3 * we + 1], y[3 * we + 2]), u.c.Vector3[1].copyFromFloats(y[3 * Ye + 0], y[3 * Ye + 1], y[3 * Ye + 2]), this.createLine(u.c.Vector3[0], u.c.Vector3[1], this._linesPositions.length / 3));\n              }\n              var Mn = this._source.getScene().getEngine();\n              this._buffers[Oe.b.PositionKind] = new Oe.b(Mn, this._linesPositions, Oe.b.PositionKind, !1), this._buffers[Oe.b.NormalKind] = new Oe.b(Mn, this._linesNormals, Oe.b.NormalKind, !1, !1, 4), this._buffersForInstances[Oe.b.PositionKind] = this._buffers[Oe.b.PositionKind], this._buffersForInstances[Oe.b.NormalKind] = this._buffers[Oe.b.NormalKind], this._ib = Mn.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;\n            }\n          }, r.prototype._generateEdgesLines = function() {\n            var t = this._source.getVerticesData(Oe.b.PositionKind), e = this._source.getIndices();\n            if (e && t) {\n              var n, i, o = new Array(), a = new Array();\n              for (n = 0; n < e.length; n += 3) {\n                i = new pg();\n                var s = e[n], d = e[n + 1], p = e[n + 2];\n                i.p0 = new u.e(t[3 * s], t[3 * s + 1], t[3 * s + 2]), i.p1 = new u.e(t[3 * d], t[3 * d + 1], t[3 * d + 2]), i.p2 = new u.e(t[3 * p], t[3 * p + 1], t[3 * p + 2]);\n                var y = u.e.Cross(i.p1.subtract(i.p0), i.p2.subtract(i.p1));\n                y.normalize(), a.push(y), o.push(i);\n              }\n              for (n = 0; n < o.length; n++) {\n                i = o[n];\n                for (var P = n + 1; P < o.length; P++) {\n                  var R = o[P];\n                  if (i.edgesConnectedCount === 3)\n                    break;\n                  if (R.edgesConnectedCount !== 3)\n                    for (var B = e[3 * P], F = e[3 * P + 1], z = e[3 * P + 2], J = 0; J < 3; J++) {\n                      var ie = 0;\n                      if (i.edges[J] === void 0) {\n                        switch (J) {\n                          case 0:\n                            ie = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(i.p0, i.p1, R.p0, R.p1, R.p2) : this._processEdgeForAdjacencies(e[3 * n], e[3 * n + 1], B, F, z);\n                            break;\n                          case 1:\n                            ie = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(i.p1, i.p2, R.p0, R.p1, R.p2) : this._processEdgeForAdjacencies(e[3 * n + 1], e[3 * n + 2], B, F, z);\n                            break;\n                          case 2:\n                            ie = this._checkVerticesInsteadOfIndices ? this._processEdgeForAdjacenciesWithVertices(i.p2, i.p0, R.p0, R.p1, R.p2) : this._processEdgeForAdjacencies(e[3 * n + 2], e[3 * n], B, F, z);\n                        }\n                        if (ie !== -1 && (i.edges[J] = P, R.edges[ie] = n, i.edgesConnectedCount++, R.edgesConnectedCount++, i.edgesConnectedCount === 3))\n                          break;\n                      }\n                    }\n                }\n              }\n              for (n = 0; n < o.length; n++) {\n                var se = o[n];\n                this._checkEdge(n, se.edges[0], a, se.p0, se.p1), this._checkEdge(n, se.edges[1], a, se.p1, se.p2), this._checkEdge(n, se.edges[2], a, se.p2, se.p0);\n              }\n              var ce = this._source.getScene().getEngine();\n              this._buffers[Oe.b.PositionKind] = new Oe.b(ce, this._linesPositions, Oe.b.PositionKind, !1), this._buffers[Oe.b.NormalKind] = new Oe.b(ce, this._linesNormals, Oe.b.NormalKind, !1, !1, 4), this._buffersForInstances[Oe.b.PositionKind] = this._buffers[Oe.b.PositionKind], this._buffersForInstances[Oe.b.NormalKind] = this._buffers[Oe.b.NormalKind], this._ib = ce.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;\n            }\n          }, r.prototype.isReady = function() {\n            return this._lineShader.isReady(this._source, this._source.hasInstances && this.customInstances.length > 0 || this._source.hasThinInstances);\n          }, r.prototype.render = function() {\n            var t = this._source.getScene();\n            if (this.isReady() && t.activeCamera) {\n              var e = t.getEngine();\n              this._lineShader._preBind(), this._source.edgesColor.a !== 1 ? e.setAlphaMode(h.a.ALPHA_COMBINE) : e.setAlphaMode(h.a.ALPHA_DISABLE);\n              var n = this._source.hasInstances && this.customInstances.length > 0, i = n || this._source.hasThinInstances, o = 0;\n              if (i)\n                if (this._buffersForInstances.world0 = this._source.getVertexBuffer(\"world0\"), this._buffersForInstances.world1 = this._source.getVertexBuffer(\"world1\"), this._buffersForInstances.world2 = this._source.getVertexBuffer(\"world2\"), this._buffersForInstances.world3 = this._source.getVertexBuffer(\"world3\"), n) {\n                  var a = this._source._instanceDataStorage;\n                  if (o = this.customInstances.length, !a.isFrozen) {\n                    for (var s = 0, d = 0; d < o; ++d)\n                      this.customInstances.data[d].copyToArray(a.instancesData, s), s += 16;\n                    a.instancesBuffer.updateDirectly(a.instancesData, 0, o);\n                  }\n                } else\n                  o = this._source.thinInstanceCount;\n              e.bindBuffers(i ? this._buffersForInstances : this._buffers, this._ib, this._lineShader.getEffect()), t.resetCachedMaterial(), this._lineShader.setColor4(\"color\", this._source.edgesColor), t.activeCamera.mode === _t.a.ORTHOGRAPHIC_CAMERA ? this._lineShader.setFloat(\"width\", this._source.edgesWidth / this.edgesWidthScalerForOrthographic) : this._lineShader.setFloat(\"width\", this._source.edgesWidth / this.edgesWidthScalerForPerspective), this._lineShader.setFloat(\"aspectRatio\", e.getAspectRatio(t.activeCamera)), this._lineShader.bind(this._source.getWorldMatrix()), e.drawElementsType(zt.a.TriangleFillMode, 0, this._indicesCount, o), this._lineShader.unbind(), i && e.unbindInstanceAttributes(), this._source.getScene()._activeMeshesFrozen || this.customInstances.reset();\n            }\n          }, r;\n        }(), Md = function(r) {\n          function t(e, n, i) {\n            n === void 0 && (n = 0.95), i === void 0 && (i = !1);\n            var o = r.call(this, e, n, i, !1) || this;\n            return o._generateEdgesLines(), o;\n          }\n          return Object(c.d)(t, r), t.prototype._generateEdgesLines = function() {\n            var e = this._source.getVerticesData(Oe.b.PositionKind), n = this._source.getIndices();\n            if (n && e) {\n              for (var i = u.c.Vector3[0], o = u.c.Vector3[1], a = n.length - 1, s = 0, d = 0; s < a; s += 2, d += 4)\n                u.e.FromArrayToRef(e, 3 * n[s], i), u.e.FromArrayToRef(e, 3 * n[s + 1], o), this.createLine(i, o, d);\n              var p = this._source.getScene().getEngine();\n              this._buffers[Oe.b.PositionKind] = new Oe.b(p, this._linesPositions, Oe.b.PositionKind, !1), this._buffers[Oe.b.NormalKind] = new Oe.b(p, this._linesNormals, Oe.b.NormalKind, !1, !1, 4), this._ib = p.createIndexBuffer(this._linesIndices), this._indicesCount = this._linesIndices.length;\n            }\n          }, t;\n        }(Lc), Nc = function() {\n          function r(t) {\n            this._textureFormats = [{ type: h.a.PREPASS_IRRADIANCE_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_POSITION_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_VELOCITY_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, format: h.a.TEXTURETYPE_UNSIGNED_INT }, { type: h.a.PREPASS_COLOR_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, format: h.a.TEXTURETYPE_HALF_FLOAT }, { type: h.a.PREPASS_ALBEDO_TEXTURE_TYPE, format: h.a.TEXTURETYPE_UNSIGNED_INT }], this.excludedSkinnedMesh = [], this.excludedMaterials = [], this._textureIndices = [], this._isDirty = !1, this.mrtCount = 0, this._postProcesses = [], this._clearColor = new I.b(0, 0, 0, 0), this._effectConfigurations = [], this._mrtFormats = [], this._enabled = !1, this._useGeometryBufferFallback = !1, this.disableGammaTransform = !1, this._scene = t, this._engine = t.getEngine(), r._SceneComponentInitialization(this._scene), this._resetLayout();\n          }\n          return Object.defineProperty(r.prototype, \"enabled\", { get: function() {\n            return this._enabled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"samples\", { get: function() {\n            return this.prePassRT.samples;\n          }, set: function(t) {\n            this.imageProcessingPostProcess || this._createCompositionEffect(), this.prePassRT.samples = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"useGeometryBufferFallback\", { get: function() {\n            return this._useGeometryBufferFallback;\n          }, set: function(t) {\n            if (this._useGeometryBufferFallback = t, t) {\n              if (this._geometryBuffer = this._scene.enableGeometryBufferRenderer(), !this._geometryBuffer)\n                return void (this._useGeometryBufferFallback = !1);\n              this._geometryBuffer.renderList = [], this._geometryBuffer._linkPrePassRenderer(this), this._updateGeometryBufferLayout();\n            } else\n              this._geometryBuffer && this._geometryBuffer._unlinkPrePassRenderer(), this._geometryBuffer = null, this._scene.disableGeometryBufferRenderer();\n          }, enumerable: !1, configurable: !0 }), r.prototype._initializeAttachments = function() {\n            for (var t = [], e = [!1], n = [!0], i = 0; i < this.mrtCount; i++)\n              t.push(!0), i > 0 && (e.push(!0), n.push(!1));\n            this._multiRenderAttachments = this._engine.buildTextureLayout(t), this._clearAttachments = this._engine.buildTextureLayout(e), this._defaultAttachments = this._engine.buildTextureLayout(n);\n          }, r.prototype._createCompositionEffect = function() {\n            this.prePassRT = new Vs(\"sceneprePassRT\", { width: this._engine.getRenderWidth(), height: this._engine.getRenderHeight() }, this.mrtCount, this._scene, { generateMipMaps: !1, generateDepthTexture: !0, defaultType: h.a.TEXTURETYPE_UNSIGNED_INT, types: this._mrtFormats }), this.prePassRT.samples = 1, this._initializeAttachments(), this._useGeometryBufferFallback && !this._geometryBuffer && (this.useGeometryBufferFallback = !0), this.imageProcessingPostProcess = new Io(\"sceneCompositionPass\", 1, null, void 0, this._engine), this.imageProcessingPostProcess.autoClear = !1;\n          }, Object.defineProperty(r.prototype, \"isSupported\", { get: function() {\n            return this._engine.webGLVersion > 1 || this._scene.getEngine().getCaps().drawBuffersExtension;\n          }, enumerable: !1, configurable: !0 }), r.prototype.bindAttachmentsForEffect = function(t, e) {\n            if (this.enabled) {\n              if (t._multiTarget)\n                this._engine.bindAttachments(this._multiRenderAttachments);\n              else if (this._engine.bindAttachments(this._defaultAttachments), this._geometryBuffer) {\n                var n = e.getMaterial();\n                n && this.excludedMaterials.indexOf(n) === -1 && this._geometryBuffer.renderList.push(e.getRenderingMesh());\n              }\n            }\n          }, r.prototype.restoreAttachments = function() {\n            this.enabled && this._defaultAttachments && this._engine.bindAttachments(this._defaultAttachments);\n          }, r.prototype._beforeCameraDraw = function() {\n            this._isDirty && this._update(), this._geometryBuffer && (this._geometryBuffer.renderList.length = 0), this._bindFrameBuffer();\n          }, r.prototype._afterCameraDraw = function() {\n            if (this._enabled) {\n              var t = this._scene.activeCamera && this._scene.activeCamera._getFirstPostProcess();\n              t && this._postProcesses.length && this._scene.postProcessManager._prepareFrame(), this._scene.postProcessManager.directRender(this._postProcesses, t ? t.inputTexture : null);\n            }\n          }, r.prototype._checkRTSize = function() {\n            var t = this._engine.getRenderWidth(!0), e = this._engine.getRenderHeight(!0), n = this.prePassRT.getRenderWidth(), i = this.prePassRT.getRenderHeight();\n            n === t && i === e || (this.prePassRT.resize({ width: t, height: e }), this._updateGeometryBufferLayout(), this._bindPostProcessChain());\n          }, r.prototype._bindFrameBuffer = function() {\n            if (this._enabled) {\n              this._checkRTSize();\n              var t = this.prePassRT.getInternalTexture();\n              t && this._engine.bindFramebuffer(t);\n            }\n          }, r.prototype.clear = function() {\n            this._enabled && (this._bindFrameBuffer(), this._engine.clear(this._scene.clearColor, this._scene.autoClear || this._scene.forceWireframe || this._scene.forcePointsCloud, this._scene.autoClearDepthAndStencil, this._scene.autoClearDepthAndStencil), this._engine.bindAttachments(this._clearAttachments), this._engine.clear(this._clearColor, !0, !1, !1), this._engine.bindAttachments(this._defaultAttachments));\n          }, r.prototype._setState = function(t) {\n            this._enabled = t, this._scene.prePass = t, this.imageProcessingPostProcess && (this.imageProcessingPostProcess.imageProcessingConfiguration.applyByPostProcess = t);\n          }, r.prototype._updateGeometryBufferLayout = function() {\n            if (this._geometryBuffer) {\n              this._geometryBuffer._resetLayout();\n              for (var t = [], e = 0; e < this._mrtLayout.length; e++)\n                t.push(!1);\n              this._geometryBuffer._linkInternalTexture(this.prePassRT.getInternalTexture());\n              var n = [{ prePassConstant: h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, geometryBufferConstant: ri.DEPTHNORMAL_TEXTURE_TYPE }, { prePassConstant: h.a.PREPASS_POSITION_TEXTURE_TYPE, geometryBufferConstant: ri.POSITION_TEXTURE_TYPE }, { prePassConstant: h.a.PREPASS_REFLECTIVITY_TEXTURE_TYPE, geometryBufferConstant: ri.REFLECTIVITY_TEXTURE_TYPE }, { prePassConstant: h.a.PREPASS_VELOCITY_TEXTURE_TYPE, geometryBufferConstant: ri.VELOCITY_TEXTURE_TYPE }];\n              for (e = 0; e < n.length; e++) {\n                var i = this._mrtLayout.indexOf(n[e].prePassConstant);\n                i !== -1 && (this._geometryBuffer._forceTextureType(n[e].geometryBufferConstant, i), t[i] = !0);\n              }\n              this._geometryBuffer._setAttachments(this._engine.buildTextureLayout(t));\n            }\n          }, r.prototype.addEffectConfiguration = function(t) {\n            for (var e = 0; e < this._effectConfigurations.length; e++)\n              if (this._effectConfigurations[e].name === t.name)\n                return this._effectConfigurations[e];\n            return this._effectConfigurations.push(t), t;\n          }, r.prototype.getIndex = function(t) {\n            return this._textureIndices[t];\n          }, r.prototype._enable = function() {\n            for (var t, e, n = this.mrtCount, i = 0; i < this._effectConfigurations.length; i++)\n              this._effectConfigurations[i].enabled && this._enableTextures(this._effectConfigurations[i].texturesRequired);\n            for (this.prePassRT && this.mrtCount !== n && this.prePassRT.updateCount(this.mrtCount, { types: this._mrtFormats }), this._updateGeometryBufferLayout(), this._resetPostProcessChain(), i = 0; i < this._effectConfigurations.length; i++)\n              this._effectConfigurations[i].enabled && (!this._effectConfigurations[i].postProcess && this._effectConfigurations[i].createPostProcess && this._effectConfigurations[i].createPostProcess(), this._effectConfigurations[i].postProcess && this._postProcesses.push(this._effectConfigurations[i].postProcess));\n            this._initializeAttachments(), this.imageProcessingPostProcess || this._createCompositionEffect();\n            var o = !1;\n            if (!((t = this._scene.activeCamera) === null || t === void 0) && t._postProcesses)\n              for (i = 0; i < this._scene.activeCamera._postProcesses.length; i++)\n                ((e = this._scene.activeCamera._postProcesses[i]) === null || e === void 0 ? void 0 : e.getClassName()) === \"ImageProcessingPostProcess\" && (o = !0);\n            o || this.disableGammaTransform || this._postProcesses.push(this.imageProcessingPostProcess), this._bindPostProcessChain(), this._setState(!0);\n          }, r.prototype._disable = function() {\n            this._setState(!1), this._resetLayout();\n            for (var t = 0; t < this._effectConfigurations.length; t++)\n              this._effectConfigurations[t].enabled = !1;\n          }, r.prototype._resetLayout = function() {\n            for (var t = 0; t < this._textureFormats.length; t++)\n              this._textureIndices[this._textureFormats[t].type] = -1;\n            this._textureIndices[h.a.PREPASS_COLOR_TEXTURE_TYPE] = 0, this._mrtLayout = [h.a.PREPASS_COLOR_TEXTURE_TYPE], this._mrtFormats = [h.a.TEXTURETYPE_HALF_FLOAT], this.mrtCount = 1;\n          }, r.prototype._resetPostProcessChain = function() {\n            this._postProcesses = [], this.imageProcessingPostProcess && this.imageProcessingPostProcess.restoreDefaultInputTexture();\n            for (var t = 0; t < this._effectConfigurations.length; t++)\n              this._effectConfigurations[t].postProcess && this._effectConfigurations[t].postProcess.restoreDefaultInputTexture();\n          }, r.prototype._bindPostProcessChain = function() {\n            var t;\n            if (this._postProcesses.length)\n              this._postProcesses[0].inputTexture = this.prePassRT.getInternalTexture();\n            else {\n              var e = (t = this._scene.activeCamera) === null || t === void 0 ? void 0 : t._getFirstPostProcess();\n              e && (e.inputTexture = this.prePassRT.getInternalTexture());\n            }\n          }, r.prototype.markAsDirty = function() {\n            this._isDirty = !0;\n          }, r.prototype._enableTextures = function(t) {\n            for (var e = 0; e < t.length; e++) {\n              var n = t[e];\n              this._textureIndices[n] === -1 && (this._textureIndices[n] = this._mrtLayout.length, this._mrtLayout.push(n), this._mrtFormats.push(this._textureFormats[n].format), this.mrtCount++);\n            }\n          }, r.prototype._update = function() {\n            this._disable();\n            for (var t = !1, e = 0; e < this._scene.materials.length; e++)\n              this._scene.materials[e].setPrePassRenderer(this) && (t = !0);\n            var n = this._scene.activeCamera;\n            if (n) {\n              var i = n._postProcesses.filter(function(o) {\n                return o != null;\n              });\n              if (i)\n                for (e = 0; e < i.length; e++)\n                  i[e].setPrePassRenderer(this) && (t = !0);\n              this._markAllMaterialsAsPrePassDirty(), this._isDirty = !1, t && this._enable(), this.enabled || (this._engine.restoreDefaultFramebuffer(), this._engine.restoreSingleAttachment());\n            }\n          }, r.prototype._markAllMaterialsAsPrePassDirty = function() {\n            for (var t = this._scene.materials, e = 0; e < t.length; e++)\n              t[e].markAsDirty(zt.a.PrePassDirtyFlag);\n          }, r.prototype.dispose = function() {\n            for (var t = 0; t < this._effectConfigurations.length; t++)\n              this._effectConfigurations[t].dispose && this._effectConfigurations[t].dispose();\n            this.imageProcessingPostProcess.dispose(), this.prePassRT.dispose();\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"PrePassRendererSceneComponent\");\n          }, r;\n        }();\n        Object.defineProperty(_e.a.prototype, \"prePassRenderer\", { get: function() {\n          return this._prePassRenderer;\n        }, set: function(r) {\n          r && r.isSupported && (this._prePassRenderer = r);\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.enablePrePassRenderer = function() {\n          return this._prePassRenderer || (this._prePassRenderer = new Nc(this), this._prePassRenderer.isSupported || (this._prePassRenderer = null, l.a.Error(`PrePassRenderer needs WebGL 2 support.\nMaybe you tried to use the following features that need the PrePassRenderer :\n + Subsurface Scattering`))), this._prePassRenderer;\n        }, _e.a.prototype.disablePrePassRenderer = function() {\n          this._prePassRenderer && (this._prePassRenderer.dispose(), this._prePassRenderer = null);\n        };\n        var Id = function() {\n          function r(t) {\n            this.name = ot.a.NAME_PREPASSRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeCameraDrawStage.registerStep(ot.a.STEP_BEFORECAMERADRAW_PREPASS, this, this._beforeCameraDraw), this.scene._afterCameraDrawStage.registerStep(ot.a.STEP_AFTERCAMERADRAW_PREPASS, this, this._afterCameraDraw), this.scene._beforeClearStage.registerStep(ot.a.STEP_BEFORECLEARSTAGE_PREPASS, this, this._beforeClearStage), this.scene._beforeRenderingMeshStage.registerStep(ot.a.STEP_BEFORERENDERINGMESH_PREPASS, this, this._beforeRenderingMeshStage), this.scene._afterRenderingMeshStage.registerStep(ot.a.STEP_AFTERRENDERINGMESH_PREPASS, this, this._afterRenderingMeshStage);\n          }, r.prototype._beforeCameraDraw = function() {\n            this.scene.prePassRenderer && this.scene.prePassRenderer._beforeCameraDraw();\n          }, r.prototype._afterCameraDraw = function() {\n            this.scene.prePassRenderer && this.scene.prePassRenderer._afterCameraDraw();\n          }, r.prototype._beforeClearStage = function() {\n            this.scene.prePassRenderer && this.scene.prePassRenderer.clear();\n          }, r.prototype._beforeRenderingMeshStage = function(t, e, n, i) {\n            if (i) {\n              var o = t.getScene();\n              o.prePassRenderer && o.prePassRenderer.bindAttachmentsForEffect(i, e);\n            }\n          }, r.prototype._afterRenderingMeshStage = function(t) {\n            var e = t.getScene();\n            e.prePassRenderer && e.prePassRenderer.restoreAttachments();\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r;\n        }();\n        Nc._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_PREPASSRENDERER);\n          t || (t = new Id(r), r._addComponent(t));\n        };\n        var _g = `#define rcp(x) 1./x\n#define GOLDEN_RATIO 1.618033988749895\n#define TWO_PI 6.2831855\n\n\nvec2 Golden2dSeq(int i,float n)\n{\n\n\nreturn vec2(float(i)/n+(0.5/n),fract(float(i)*rcp(GOLDEN_RATIO)));\n}\nvec2 SampleDiskGolden(int i,int sampleCount)\n{\nvec2 f=Golden2dSeq(i,float(sampleCount));\nreturn vec2(sqrt(f.x),TWO_PI*f.y);\n}`;\n        ze.a.IncludesShadersStore.fibonacci = _g;\n        var mg = `uniform vec3 diffusionS[5];\nuniform float diffusionD[5];\nuniform float filterRadii[5];`;\n        ze.a.IncludesShadersStore.diffusionProfile = mg;\n        var gg = `\n#include<fibonacci>\n#include<helperFunctions>\n#include<subSurfaceScatteringFunctions>\n#include<diffusionProfile>\nvarying vec2 vUV;\nuniform vec2 texelSize;\nuniform sampler2D textureSampler;\nuniform sampler2D irradianceSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D albedoSampler;\nuniform vec2 viewportSize;\nuniform float metersPerUnit;\nconst float LOG2_E=1.4426950408889634;\nconst float SSS_PIXELS_PER_SAMPLE=4.;\nconst int _SssSampleBudget=40;\n#define rcp(x) 1./x\n#define Sq(x) x*x\n#define SSS_BILATERAL_FILTER true\n\n\nvec3 EvalBurleyDiffusionProfile(float r,vec3 S)\n{\nvec3 exp_13=exp2(((LOG2_E*(-1.0/3.0))*r)*S);\nvec3 expSum=exp_13*(1.+exp_13*exp_13);\nreturn (S*rcp(8.*PI))*expSum;\n}\n\n\n\n\n\n\nvec2 SampleBurleyDiffusionProfile(float u,float rcpS)\n{\nu=1.-u;\nfloat g=1.+(4.*u)*(2.*u+sqrt(1.+(4.*u)*u));\nfloat n=exp2(log2(g)*(-1.0/3.0));\nfloat p=(g*n)*n;\nfloat c=1.+p+n;\nfloat d=(3./LOG2_E*2.)+(3./LOG2_E)*log2(u);\nfloat x=(3./LOG2_E)*log2(c)-d;\n\n\n\n\n\n\nfloat rcpExp=((c*c)*c)*rcp((4.*u)*((c*c)+(4.*u)*(4.*u)));\nfloat r=x*rcpS;\nfloat rcpPdf=(8.*PI*rcpS)*rcpExp;\nreturn vec2(r,rcpPdf);\n}\n\n\nvec3 ComputeBilateralWeight(float xy2,float z,float mmPerUnit,vec3 S,float rcpPdf)\n{\n#ifndef SSS_BILATERAL_FILTER\nz=0.;\n#endif\n\n\n\nfloat r=sqrt(xy2+(z*mmPerUnit)*(z*mmPerUnit));\nfloat area=rcpPdf;\n#if SSS_CLAMP_ARTIFACT\nreturn clamp(EvalBurleyDiffusionProfile(r,S)*area,0.0,1.0);\n#else\nreturn EvalBurleyDiffusionProfile(r,S)*area;\n#endif\n}\nvoid EvaluateSample(int i,int n,vec3 S,float d,vec3 centerPosVS,float mmPerUnit,float pixelsPerMm,\nfloat phase,inout vec3 totalIrradiance,inout vec3 totalWeight)\n{\n\nfloat scale=rcp(float(n));\nfloat offset=rcp(float(n))*0.5;\n\nfloat sinPhase,cosPhase;\nsinPhase=sin(phase);\ncosPhase=cos(phase);\nvec2 bdp=SampleBurleyDiffusionProfile(float(i)*scale+offset,d);\nfloat r=bdp.x;\nfloat rcpPdf=bdp.y;\nfloat phi=SampleDiskGolden(i,n).y;\nfloat sinPhi,cosPhi;\nsinPhi=sin(phi);\ncosPhi=cos(phi);\nfloat sinPsi=cosPhase*sinPhi+sinPhase*cosPhi;\nfloat cosPsi=cosPhase*cosPhi-sinPhase*sinPhi;\nvec2 vec=r*vec2(cosPsi,sinPsi);\n\nvec2 position;\nfloat xy2;\nposition=vUV+round((pixelsPerMm*r)*vec2(cosPsi,sinPsi))*texelSize;\nxy2=r*r;\nvec4 textureSample=texture2D(irradianceSampler,position);\nfloat viewZ=texture2D(depthSampler,position).r;\nvec3 irradiance=textureSample.rgb;\nif (testLightingForSSS(textureSample.a))\n{\n\nfloat relZ=viewZ-centerPosVS.z;\nvec3 weight=ComputeBilateralWeight(xy2,relZ,mmPerUnit,S,rcpPdf);\ntotalIrradiance+=weight*irradiance;\ntotalWeight+=weight;\n}\nelse\n{\n\n\n\n\n\n\n}\n}\nvoid main(void)\n{\nvec4 irradianceAndDiffusionProfile=texture2D(irradianceSampler,vUV);\nvec3 centerIrradiance=irradianceAndDiffusionProfile.rgb;\nint diffusionProfileIndex=int(round(irradianceAndDiffusionProfile.a*255.));\nfloat centerDepth=0.;\nvec4 inputColor=texture2D(textureSampler,vUV);\nbool passedStencilTest=testLightingForSSS(irradianceAndDiffusionProfile.a);\nif (passedStencilTest)\n{\ncenterDepth=texture2D(depthSampler,vUV).r;\n}\nif (!passedStencilTest) {\ngl_FragColor=inputColor;\nreturn;\n}\nfloat distScale=1.;\nvec3 S=diffusionS[diffusionProfileIndex];\nfloat d=diffusionD[diffusionProfileIndex];\nfloat filterRadius=filterRadii[diffusionProfileIndex];\n\nvec2 centerPosNDC=vUV;\nvec2 cornerPosNDC=vUV+0.5*texelSize;\nvec3 centerPosVS=vec3(centerPosNDC*viewportSize,1.0)*centerDepth;\nvec3 cornerPosVS=vec3(cornerPosNDC*viewportSize,1.0)*centerDepth;\n\nfloat mmPerUnit=1000.*(metersPerUnit*rcp(distScale));\nfloat unitsPerMm=rcp(mmPerUnit);\n\n\nfloat unitsPerPixel=2.*abs(cornerPosVS.x-centerPosVS.x);\nfloat pixelsPerMm=rcp(unitsPerPixel)*unitsPerMm;\n\nfloat filterArea=PI*Sq(filterRadius*pixelsPerMm);\nint sampleCount=int(filterArea*rcp(SSS_PIXELS_PER_SAMPLE));\nint sampleBudget=_SssSampleBudget;\nint texturingMode=0;\nvec3 albedo=texture2D(albedoSampler,vUV).rgb;\nif (distScale == 0. || sampleCount<1)\n{\n#ifdef DEBUG_SSS_SAMPLES\nvec3 green=vec3(0.,1.,0.);\ngl_FragColor=vec4(green,1.0);\nreturn;\n#endif\ngl_FragColor=vec4(inputColor.rgb+albedo*centerIrradiance,1.0);\nreturn;\n}\n#ifdef DEBUG_SSS_SAMPLES\nvec3 red=vec3(1.,0.,0.);\nvec3 blue=vec3(0.,0.,1.);\ngl_FragColor=vec4(mix(blue,red,clamp(float(sampleCount)/float(sampleBudget),0.0,1.0)),1.0);\nreturn;\n#endif\n\nfloat phase=0.;\nint n=min(sampleCount,sampleBudget);\n\nvec3 centerWeight=vec3(0.);\nvec3 totalIrradiance=vec3(0.);\nvec3 totalWeight=vec3(0.);\nfor (int i=0; i<n; i++)\n{\n\nEvaluateSample(i,n,S,d,centerPosVS,mmPerUnit,pixelsPerMm,\nphase,totalIrradiance,totalWeight);\n}\n\ntotalWeight=max(totalWeight,HALF_MIN);\ngl_FragColor=vec4(inputColor.rgb+albedo*max(totalIrradiance/totalWeight,vec3(0.0)),1.);\n}`;\n        ze.a.ShadersStore.subSurfaceScatteringPixelShader = gg;\n        var vg = function(r) {\n          function t(e, n, i, o, a, s, d, p) {\n            o === void 0 && (o = null), p === void 0 && (p = h.a.TEXTURETYPE_UNSIGNED_INT);\n            var y = r.call(this, e, \"subSurfaceScattering\", [\"texelSize\", \"viewportSize\", \"metersPerUnit\"], [\"diffusionS\", \"diffusionD\", \"filterRadii\", \"irradianceSampler\", \"depthSampler\", \"albedoSampler\"], i, o, a || Ne.a.BILINEAR_SAMPLINGMODE, s, d, null, p, \"postprocess\", void 0, !0) || this;\n            return y._scene = n, y.updateEffect(), y.onApplyObservable.add(function(P) {\n              if (n.prePassRenderer && n.subSurfaceConfiguration) {\n                var R = y.texelSize;\n                P.setFloat(\"metersPerUnit\", n.subSurfaceConfiguration.metersPerUnit), P.setFloat2(\"texelSize\", R.x, R.y), P.setTexture(\"irradianceSampler\", n.prePassRenderer.prePassRT.textures[n.prePassRenderer.getIndex(h.a.PREPASS_IRRADIANCE_TEXTURE_TYPE)]), P.setTexture(\"depthSampler\", n.prePassRenderer.prePassRT.textures[n.prePassRenderer.getIndex(h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE)]), P.setTexture(\"albedoSampler\", n.prePassRenderer.prePassRT.textures[n.prePassRenderer.getIndex(h.a.PREPASS_ALBEDO_TEXTURE_TYPE)]), P.setFloat2(\"viewportSize\", Math.tan(n.activeCamera.fov / 2) * n.getEngine().getAspectRatio(n.activeCamera, !0), Math.tan(n.activeCamera.fov / 2)), P.setArray3(\"diffusionS\", n.subSurfaceConfiguration.ssDiffusionS), P.setArray(\"diffusionD\", n.subSurfaceConfiguration.ssDiffusionD), P.setArray(\"filterRadii\", n.subSurfaceConfiguration.ssFilterRadii);\n              } else\n                l.a.Error(\"PrePass and subsurface configuration needs to be enabled for subsurface scattering.\");\n            }), y;\n          }\n          return Object(c.d)(t, r), t.prototype.getClassName = function() {\n            return \"SubSurfaceScatteringPostProcess\";\n          }, t;\n        }(ft), Dd = function() {\n          function r(t) {\n            this._ssDiffusionS = [], this._ssFilterRadii = [], this._ssDiffusionD = [], this.enabled = !1, this.name = ot.a.NAME_SUBSURFACE, this.ssDiffusionProfileColors = [], this.metersPerUnit = 1, this.texturesRequired = [h.a.PREPASS_DEPTHNORMAL_TEXTURE_TYPE, h.a.PREPASS_ALBEDO_TEXTURE_TYPE, h.a.PREPASS_COLOR_TEXTURE_TYPE, h.a.PREPASS_IRRADIANCE_TEXTURE_TYPE], this.addDiffusionProfile(new I.a(1, 1, 1)), this._scene = t, r._SceneComponentInitialization(this._scene);\n          }\n          return Object.defineProperty(r.prototype, \"ssDiffusionS\", { get: function() {\n            return this._ssDiffusionS;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ssDiffusionD\", { get: function() {\n            return this._ssDiffusionD;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"ssFilterRadii\", { get: function() {\n            return this._ssFilterRadii;\n          }, enumerable: !1, configurable: !0 }), r.prototype.addDiffusionProfile = function(t) {\n            if (this.ssDiffusionD.length >= 5)\n              return l.a.Error(\"You already reached the maximum number of diffusion profiles.\"), 0;\n            for (var e = 0; e < this._ssDiffusionS.length / 3; e++)\n              if (this._ssDiffusionS[3 * e] === t.r && this._ssDiffusionS[3 * e + 1] === t.g && this._ssDiffusionS[3 * e + 2] === t.b)\n                return e;\n            return this._ssDiffusionS.push(t.r, t.b, t.g), this._ssDiffusionD.push(Math.max(Math.max(t.r, t.b), t.g)), this._ssFilterRadii.push(this.getDiffusionProfileParameters(t)), this.ssDiffusionProfileColors.push(t), this._ssDiffusionD.length - 1;\n          }, r.prototype.createPostProcess = function() {\n            return this.postProcess = new vg(\"subSurfaceScattering\", this._scene, 1, null, void 0, this._scene.getEngine()), this.postProcess.autoClear = !1, this.postProcess;\n          }, r.prototype.clearAllDiffusionProfiles = function() {\n            this._ssDiffusionD = [], this._ssDiffusionS = [], this._ssFilterRadii = [], this.ssDiffusionProfileColors = [];\n          }, r.prototype.dispose = function() {\n            this.clearAllDiffusionProfiles(), this.postProcess.dispose();\n          }, r.prototype.getDiffusionProfileParameters = function(t) {\n            var e = Math.max(t.r, t.g, t.b);\n            return this._sampleBurleyDiffusionProfile(0.997, e);\n          }, r.prototype._sampleBurleyDiffusionProfile = function(t, e) {\n            var n = 1 + 4 * (t = 1 - t) * (2 * t + Math.sqrt(1 + 4 * t * t)), i = Math.pow(n, -1 / 3), o = 1 + n * i * i + i;\n            return 3 * Math.log(o / (4 * t)) * e;\n          }, r._SceneComponentInitialization = function(t) {\n            throw En.a.WarnImport(\"PrePassRendererSceneComponent\");\n          }, r;\n        }();\n        V.a.AddParser(ot.a.NAME_SUBSURFACE, function(r, t) {\n          if (r.ssDiffusionProfileColors !== void 0 && r.ssDiffusionProfileColors !== null && (t.enableSubSurfaceForPrePass(), t.subSurfaceConfiguration))\n            for (var e = 0, n = r.ssDiffusionProfileColors.length; e < n; e++) {\n              var i = r.ssDiffusionProfileColors[e];\n              t.subSurfaceConfiguration.addDiffusionProfile(new I.a(i.r, i.g, i.b));\n            }\n        }), Object.defineProperty(_e.a.prototype, \"subSurfaceConfiguration\", { get: function() {\n          return this._subSurfaceConfiguration;\n        }, set: function(r) {\n          r && this.enablePrePassRenderer() && (this._subSurfaceConfiguration = r);\n        }, enumerable: !0, configurable: !0 }), _e.a.prototype.enableSubSurfaceForPrePass = function() {\n          if (this._subSurfaceConfiguration)\n            return this._subSurfaceConfiguration;\n          var r = this.enablePrePassRenderer();\n          return r ? (this._subSurfaceConfiguration = new Dd(this), r.addEffectConfiguration(this._subSurfaceConfiguration), this._subSurfaceConfiguration) : null;\n        }, _e.a.prototype.disableSubSurfaceForPrePass = function() {\n          this._subSurfaceConfiguration && (this._subSurfaceConfiguration.dispose(), this._subSurfaceConfiguration = null);\n        };\n        var Ld = function() {\n          function r(t) {\n            this.name = ot.a.NAME_PREPASSRENDERER, this.scene = t;\n          }\n          return r.prototype.register = function() {\n          }, r.prototype.serialize = function(t) {\n            if (this.scene.subSurfaceConfiguration) {\n              var e = this.scene.subSurfaceConfiguration.ssDiffusionProfileColors;\n              t.ssDiffusionProfileColors = [];\n              for (var n = 0; n < e.length; n++)\n                t.ssDiffusionProfileColors.push({ r: e[n].r, g: e[n].g, b: e[n].b });\n            }\n          }, r.prototype.addFromContainer = function(t) {\n          }, r.prototype.removeFromContainer = function(t, e) {\n            this.scene.prePassRenderer && this.scene.subSurfaceConfiguration && this.scene.subSurfaceConfiguration.clearAllDiffusionProfiles();\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r;\n        }();\n        Dd._SceneComponentInitialization = function(r) {\n          var t = r._getComponent(ot.a.NAME_SUBSURFACE);\n          t || (t = new Ld(r), r._addComponent(t));\n        };\n        var yg = `#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 color;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\n#ifdef ALPHATEST\nif (texture2D(diffuseSampler,vUV).a<0.4)\ndiscard;\n#endif\n#include<logDepthFragment>\ngl_FragColor=color;\n}`;\n        ze.a.ShadersStore.outlinePixelShader = yg;\n        var bg = `\nattribute vec3 position;\nattribute vec3 normal;\n#include<bonesDeclaration>\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n\nuniform float offset;\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef ALPHATEST\nvarying vec2 vUV;\nuniform mat4 diffuseMatrix;\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#endif\n#include<logDepthDeclaration>\nvoid main(void)\n{\nvec3 positionUpdated=position;\nvec3 normalUpdated=normal;\n#ifdef UV1\nvec2 uvUpdated=uv;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\nvec3 offsetPosition=positionUpdated+(normalUpdated*offset);\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(offsetPosition,1.0);\n#ifdef ALPHATEST\n#ifdef UV1\nvUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));\n#endif\n#ifdef UV2\nvUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n#endif\n#endif\n#include<logDepthVertex>\n}\n`;\n        ze.a.ShadersStore.outlineVertexShader = bg, _e.a.prototype.getOutlineRenderer = function() {\n          return this._outlineRenderer || (this._outlineRenderer = new Nd(this)), this._outlineRenderer;\n        }, Object.defineProperty(Ie.a.prototype, \"renderOutline\", { get: function() {\n          return this._renderOutline;\n        }, set: function(r) {\n          r && this.getScene().getOutlineRenderer(), this._renderOutline = r;\n        }, enumerable: !0, configurable: !0 }), Object.defineProperty(Ie.a.prototype, \"renderOverlay\", { get: function() {\n          return this._renderOverlay;\n        }, set: function(r) {\n          r && this.getScene().getOutlineRenderer(), this._renderOverlay = r;\n        }, enumerable: !0, configurable: !0 });\n        var Nd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_OUTLINERENDERER, this.zOffset = 1, this.scene = t, this._engine = t.getEngine(), this.scene._addComponent(this);\n          }\n          return r.prototype.register = function() {\n            this.scene._beforeRenderingMeshStage.registerStep(ot.a.STEP_BEFORERENDERINGMESH_OUTLINE, this, this._beforeRenderingMesh), this.scene._afterRenderingMeshStage.registerStep(ot.a.STEP_AFTERRENDERINGMESH_OUTLINE, this, this._afterRenderingMesh);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n          }, r.prototype.render = function(t, e, n) {\n            var i = this;\n            n === void 0 && (n = !1);\n            var o = this.scene, a = o.getEngine(), s = a.getCaps().instancedArrays && (e.visibleInstances[t._id] !== null && e.visibleInstances[t._id] !== void 0 || t.getRenderingMesh().hasThinInstances);\n            if (this.isReady(t, s)) {\n              var d = t.getMesh(), p = d._internalAbstractMeshDataInfo._actAsRegularMesh ? d : null, y = t.getRenderingMesh(), P = p || y, R = t.getMaterial();\n              if (R && o.activeCamera) {\n                if (a.enableEffect(this._effect), R.useLogarithmicDepth && this._effect.setFloat(\"logarithmicDepthConstant\", 2 / (Math.log(o.activeCamera.maxZ + 1) / Math.LN2)), this._effect.setFloat(\"offset\", n ? 0 : y.outlineWidth), this._effect.setColor4(\"color\", n ? y.overlayColor : y.outlineColor, n ? y.overlayAlpha : R.alpha), this._effect.setMatrix(\"viewProjection\", o.getTransformMatrix()), this._effect.setMatrix(\"world\", P.getWorldMatrix()), y.useBones && y.computeBonesUsingShaders && y.skeleton && this._effect.setMatrices(\"mBones\", y.skeleton.getTransformMatrices(y)), $e.a.BindMorphTargetParameters(y, this._effect), y._bind(t, this._effect, R.fillMode), R && R.needAlphaTesting()) {\n                  var B = R.getAlphaTestTexture();\n                  B && (this._effect.setTexture(\"diffuseSampler\", B), this._effect.setMatrix(\"diffuseMatrix\", B.getTextureMatrix()));\n                }\n                a.setZOffset(-this.zOffset), y._processRendering(P, t, this._effect, R.fillMode, e, s, function(F, z) {\n                  i._effect.setMatrix(\"world\", z);\n                }), a.setZOffset(0);\n              }\n            }\n          }, r.prototype.isReady = function(t, e) {\n            var n = [], i = [Oe.b.PositionKind, Oe.b.NormalKind], o = t.getMesh(), a = t.getMaterial();\n            a && (a.needAlphaTesting() && (n.push(\"#define ALPHATEST\"), o.isVerticesDataPresent(Oe.b.UVKind) && (i.push(Oe.b.UVKind), n.push(\"#define UV1\")), o.isVerticesDataPresent(Oe.b.UV2Kind) && (i.push(Oe.b.UV2Kind), n.push(\"#define UV2\"))), a.useLogarithmicDepth && n.push(\"#define LOGARITHMICDEPTH\")), o.useBones && o.computeBonesUsingShaders ? (i.push(Oe.b.MatricesIndicesKind), i.push(Oe.b.MatricesWeightsKind), o.numBoneInfluencers > 4 && (i.push(Oe.b.MatricesIndicesExtraKind), i.push(Oe.b.MatricesWeightsExtraKind)), n.push(\"#define NUM_BONE_INFLUENCERS \" + o.numBoneInfluencers), n.push(\"#define BonesPerMesh \" + (o.skeleton ? o.skeleton.bones.length + 1 : 0))) : n.push(\"#define NUM_BONE_INFLUENCERS 0\");\n            var s = o.morphTargetManager, d = 0;\n            s && s.numInfluencers > 0 && (d = s.numInfluencers, n.push(\"#define MORPHTARGETS\"), n.push(\"#define NUM_MORPH_INFLUENCERS \" + d), $e.a.PrepareAttributesForMorphTargetsInfluencers(i, o, d)), e && (n.push(\"#define INSTANCES\"), $e.a.PushAttributesForInstances(i), t.getRenderingMesh().hasThinInstances && n.push(\"#define THIN_INSTANCES\"));\n            var p = n.join(`\n`);\n            return this._cachedDefines !== p && (this._cachedDefines = p, this._effect = this.scene.getEngine().createEffect(\"outline\", i, [\"world\", \"mBones\", \"viewProjection\", \"diffuseMatrix\", \"offset\", \"color\", \"logarithmicDepthConstant\", \"morphTargetInfluences\"], [\"diffuseSampler\"], p, void 0, void 0, void 0, { maxSimultaneousMorphTargets: d })), this._effect.isReady();\n          }, r.prototype._beforeRenderingMesh = function(t, e, n) {\n            if (this._savedDepthWrite = this._engine.getDepthWrite(), t.renderOutline) {\n              var i = e.getMaterial();\n              i && i.needAlphaBlendingForMesh(t) && (this._engine.cacheStencilState(), this._engine.setDepthWrite(!1), this._engine.setColorWrite(!1), this._engine.setStencilBuffer(!0), this._engine.setStencilOperationPass(h.a.REPLACE), this._engine.setStencilFunction(h.a.ALWAYS), this._engine.setStencilMask(r._StencilReference), this._engine.setStencilFunctionReference(r._StencilReference), this.render(e, n, !0), this._engine.setColorWrite(!0), this._engine.setStencilFunction(h.a.NOTEQUAL)), this._engine.setDepthWrite(!1), this.render(e, n), this._engine.setDepthWrite(this._savedDepthWrite), i && i.needAlphaBlendingForMesh(t) && this._engine.restoreStencilState();\n            }\n          }, r.prototype._afterRenderingMesh = function(t, e, n) {\n            if (t.renderOverlay) {\n              var i = this._engine.getAlphaMode(), o = this._engine.alphaState.alphaBlend;\n              this._engine.setAlphaMode(h.a.ALPHA_COMBINE), this.render(e, n, !0), this._engine.setAlphaMode(i), this._engine.setDepthWrite(this._savedDepthWrite), this._engine.alphaState.alphaBlend = o;\n            }\n            t.renderOutline && this._savedDepthWrite && (this._engine.setDepthWrite(!0), this._engine.setColorWrite(!1), this.render(e, n), this._engine.setColorWrite(!0));\n          }, r._StencilReference = 4, r;\n        }(), Tg = f(148), wd = function(r) {\n          function t(e, n) {\n            var i = r.call(this) || this;\n            return i.name = e, i.animations = new Array(), i.isPickable = !1, i.useAlphaForPicking = !1, i.onDisposeObservable = new C.c(), i._onAnimationEnd = null, i._endAnimation = function() {\n              i._onAnimationEnd && i._onAnimationEnd(), i.disposeWhenFinishedAnimating && i.dispose();\n            }, i.color = new I.b(1, 1, 1, 1), i.position = u.e.Zero(), i._manager = n, i._manager.sprites.push(i), i.uniqueId = i._manager.scene.getUniqueId(), i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"size\", { get: function() {\n            return this.width;\n          }, set: function(e) {\n            this.width = e, this.height = e;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"manager\", { get: function() {\n            return this._manager;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getClassName = function() {\n            return \"Sprite\";\n          }, Object.defineProperty(t.prototype, \"fromIndex\", { get: function() {\n            return this._fromIndex;\n          }, set: function(e) {\n            this.playAnimation(e, this._toIndex, this._loopAnimation, this._delay, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"toIndex\", { get: function() {\n            return this._toIndex;\n          }, set: function(e) {\n            this.playAnimation(this._fromIndex, e, this._loopAnimation, this._delay, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"loopAnimation\", { get: function() {\n            return this._loopAnimation;\n          }, set: function(e) {\n            this.playAnimation(this._fromIndex, this._toIndex, e, this._delay, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, \"delay\", { get: function() {\n            return Math.max(this._delay, 1);\n          }, set: function(e) {\n            this.playAnimation(this._fromIndex, this._toIndex, this._loopAnimation, e, this._onAnimationEnd);\n          }, enumerable: !1, configurable: !0 }), t.prototype.playAnimation = function(e, n, i, o, a) {\n            a === void 0 && (a = null), this._onAnimationEnd = a, r.prototype.playAnimation.call(this, e, n, i, o, this._endAnimation);\n          }, t.prototype.dispose = function() {\n            for (var e = 0; e < this._manager.sprites.length; e++)\n              this._manager.sprites[e] == this && this._manager.sprites.splice(e, 1);\n            this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n          }, t.prototype.serialize = function() {\n            var e = {};\n            return e.name = this.name, e.position = this.position.asArray(), e.color = this.color.asArray(), e.width = this.width, e.height = this.height, e.angle = this.angle, e.cellIndex = this.cellIndex, e.cellRef = this.cellRef, e.invertU = this.invertU, e.invertV = this.invertV, e.disposeWhenFinishedAnimating = this.disposeWhenFinishedAnimating, e.isPickable = this.isPickable, e.isVisible = this.isVisible, e.useAlphaForPicking = this.useAlphaForPicking, e.animationStarted = this.animationStarted, e.fromIndex = this.fromIndex, e.toIndex = this.toIndex, e.loopAnimation = this.loopAnimation, e.delay = this.delay, e;\n          }, t.Parse = function(e, n) {\n            var i = new t(e.name, n);\n            return i.position = u.e.FromArray(e.position), i.color = I.b.FromArray(e.color), i.width = e.width, i.height = e.height, i.angle = e.angle, i.cellIndex = e.cellIndex, i.cellRef = e.cellRef, i.invertU = e.invertU, i.invertV = e.invertV, i.disposeWhenFinishedAnimating = e.disposeWhenFinishedAnimating, i.isPickable = e.isPickable, i.isVisible = e.isVisible, i.useAlphaForPicking = e.useAlphaForPicking, i.fromIndex = e.fromIndex, i.toIndex = e.toIndex, i.loopAnimation = e.loopAnimation, i.delay = e.delay, e.animationStarted && i.playAnimation(i.fromIndex, i.toIndex, i.loopAnimation, i.delay), i;\n          }, t;\n        }(function() {\n          function r() {\n            this.width = 1, this.height = 1, this.angle = 0, this.invertU = !1, this.invertV = !1, this.isVisible = !0, this._animationStarted = !1, this._loopAnimation = !1, this._fromIndex = 0, this._toIndex = 0, this._delay = 0, this._direction = 1, this._time = 0, this._onBaseAnimationEnd = null, this.position = { x: 1, y: 1, z: 1 }, this.color = { r: 1, g: 1, b: 1, a: 1 };\n          }\n          return Object.defineProperty(r.prototype, \"animationStarted\", { get: function() {\n            return this._animationStarted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"fromIndex\", { get: function() {\n            return this._fromIndex;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"toIndex\", { get: function() {\n            return this._toIndex;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"loopAnimation\", { get: function() {\n            return this._loopAnimation;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"delay\", { get: function() {\n            return Math.max(this._delay, 1);\n          }, enumerable: !1, configurable: !0 }), r.prototype.playAnimation = function(t, e, n, i, o) {\n            this._fromIndex = t, this._toIndex = e, this._loopAnimation = n, this._delay = i || 1, this._animationStarted = !0, this._onBaseAnimationEnd = o, t < e ? this._direction = 1 : (this._direction = -1, this._toIndex = t, this._fromIndex = e), this.cellIndex = t, this._time = 0;\n          }, r.prototype.stopAnimation = function() {\n            this._animationStarted = !1;\n          }, r.prototype._animate = function(t) {\n            this._animationStarted && (this._time += t, this._time > this._delay && (this._time = this._time % this._delay, this.cellIndex += this._direction, (this._direction > 0 && this.cellIndex > this._toIndex || this._direction < 0 && this.cellIndex < this._fromIndex) && (this._loopAnimation ? this.cellIndex = this._direction > 0 ? this._fromIndex : this._toIndex : (this.cellIndex = this._toIndex, this._animationStarted = !1, this._onBaseAnimationEnd && this._onBaseAnimationEnd()))));\n          }, r;\n        }());\n        _e.a.prototype._internalPickSprites = function(r, t, e, n) {\n          if (!Ki.a)\n            return null;\n          var i = null;\n          if (!n) {\n            if (!this.activeCamera)\n              return null;\n            n = this.activeCamera;\n          }\n          if (this.spriteManagers.length > 0)\n            for (var o = 0; o < this.spriteManagers.length; o++) {\n              var a = this.spriteManagers[o];\n              if (a.isPickable) {\n                var s = a.intersects(r, n, t, e);\n                if (s && s.hit && (e || i == null || !(s.distance >= i.distance)) && (i = s, e))\n                  break;\n              }\n            }\n          return i || new Ki.a();\n        }, _e.a.prototype._internalMultiPickSprites = function(r, t, e) {\n          if (!Ki.a)\n            return null;\n          var n = new Array();\n          if (!e) {\n            if (!this.activeCamera)\n              return null;\n            e = this.activeCamera;\n          }\n          if (this.spriteManagers.length > 0)\n            for (var i = 0; i < this.spriteManagers.length; i++) {\n              var o = this.spriteManagers[i];\n              if (o.isPickable) {\n                var a = o.multiIntersects(r, e, t);\n                a !== null && (n = n.concat(a));\n              }\n            }\n          return n;\n        }, _e.a.prototype.pickSprite = function(r, t, e, n, i) {\n          return this._tempSpritePickingRay ? (this.createPickingRayInCameraSpaceToRef(r, t, this._tempSpritePickingRay, i), this._internalPickSprites(this._tempSpritePickingRay, e, n, i)) : null;\n        }, _e.a.prototype.pickSpriteWithRay = function(r, t, e, n) {\n          if (!this._tempSpritePickingRay)\n            return null;\n          if (!n) {\n            if (!this.activeCamera)\n              return null;\n            n = this.activeCamera;\n          }\n          return dn.a.TransformToRef(r, n.getViewMatrix(), this._tempSpritePickingRay), this._internalPickSprites(this._tempSpritePickingRay, t, e, n);\n        }, _e.a.prototype.multiPickSprite = function(r, t, e, n) {\n          return this.createPickingRayInCameraSpaceToRef(r, t, this._tempSpritePickingRay, n), this._internalMultiPickSprites(this._tempSpritePickingRay, e, n);\n        }, _e.a.prototype.multiPickSpriteWithRay = function(r, t, e) {\n          if (!this._tempSpritePickingRay)\n            return null;\n          if (!e) {\n            if (!this.activeCamera)\n              return null;\n            e = this.activeCamera;\n          }\n          return dn.a.TransformToRef(r, e.getViewMatrix(), this._tempSpritePickingRay), this._internalMultiPickSprites(this._tempSpritePickingRay, t, e);\n        }, _e.a.prototype.setPointerOverSprite = function(r) {\n          this._pointerOverSprite !== r && (this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(h.a.ACTION_OnPointerOutTrigger, m.a.CreateNewFromSprite(this._pointerOverSprite, this)), this._pointerOverSprite = r, this._pointerOverSprite && this._pointerOverSprite.actionManager && this._pointerOverSprite.actionManager.processTrigger(h.a.ACTION_OnPointerOverTrigger, m.a.CreateNewFromSprite(this._pointerOverSprite, this)));\n        }, _e.a.prototype.getPointerOverSprite = function() {\n          return this._pointerOverSprite;\n        };\n        var Fd = function() {\n          function r(t) {\n            this.name = ot.a.NAME_SPRITE, this.scene = t, this.scene.spriteManagers = new Array(), this.scene._tempSpritePickingRay = dn.a ? dn.a.Zero() : null, this.scene.onBeforeSpritesRenderingObservable = new C.c(), this.scene.onAfterSpritesRenderingObservable = new C.c(), this._spritePredicate = function(e) {\n              return !!e.actionManager && e.isPickable && e.actionManager.hasPointerTriggers;\n            };\n          }\n          return r.prototype.register = function() {\n            this.scene._pointerMoveStage.registerStep(ot.a.STEP_POINTERMOVE_SPRITE, this, this._pointerMove), this.scene._pointerDownStage.registerStep(ot.a.STEP_POINTERDOWN_SPRITE, this, this._pointerDown), this.scene._pointerUpStage.registerStep(ot.a.STEP_POINTERUP_SPRITE, this, this._pointerUp);\n          }, r.prototype.rebuild = function() {\n          }, r.prototype.dispose = function() {\n            this.scene.onBeforeSpritesRenderingObservable.clear(), this.scene.onAfterSpritesRenderingObservable.clear();\n            for (var t = this.scene.spriteManagers; t.length; )\n              t[0].dispose();\n          }, r.prototype._pickSpriteButKeepRay = function(t, e, n, i, o) {\n            var a = this.scene.pickSprite(e, n, this._spritePredicate, i, o);\n            return a && (a.ray = t ? t.ray : null), a;\n          }, r.prototype._pointerMove = function(t, e, n, i, o) {\n            var a = this.scene;\n            return i ? a.setPointerOverSprite(null) : (n = this._pickSpriteButKeepRay(n, t, e, !1, a.cameraToUseForPointers || void 0)) && n.hit && n.pickedSprite ? (a.setPointerOverSprite(n.pickedSprite), a.doNotHandleCursors || (a._pointerOverSprite && a._pointerOverSprite.actionManager && a._pointerOverSprite.actionManager.hoverCursor ? o.style.cursor = a._pointerOverSprite.actionManager.hoverCursor : o.style.cursor = a.hoverCursor)) : a.setPointerOverSprite(null), n;\n          }, r.prototype._pointerDown = function(t, e, n, i) {\n            var o = this.scene;\n            if (o._pickedDownSprite = null, o.spriteManagers.length > 0 && (n = o.pickSprite(t, e, this._spritePredicate, !1, o.cameraToUseForPointers || void 0)) && n.hit && n.pickedSprite && n.pickedSprite.actionManager) {\n              switch (o._pickedDownSprite = n.pickedSprite, i.button) {\n                case 0:\n                  n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnLeftPickTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n                  break;\n                case 1:\n                  n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnCenterPickTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n                  break;\n                case 2:\n                  n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnRightPickTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n              }\n              n.pickedSprite.actionManager && n.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnPickDownTrigger, m.a.CreateNewFromSprite(n.pickedSprite, o, i));\n            }\n            return n;\n          }, r.prototype._pointerUp = function(t, e, n, i) {\n            var o = this.scene;\n            if (o.spriteManagers.length > 0) {\n              var a = o.pickSprite(t, e, this._spritePredicate, !1, o.cameraToUseForPointers || void 0);\n              a && (a.hit && a.pickedSprite && a.pickedSprite.actionManager && (a.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnPickUpTrigger, m.a.CreateNewFromSprite(a.pickedSprite, o, i)), a.pickedSprite.actionManager && (this.scene._inputManager._isPointerSwiping() || a.pickedSprite.actionManager.processTrigger(h.a.ACTION_OnPickTrigger, m.a.CreateNewFromSprite(a.pickedSprite, o, i)))), o._pickedDownSprite && o._pickedDownSprite.actionManager && o._pickedDownSprite !== a.pickedSprite && o._pickedDownSprite.actionManager.processTrigger(h.a.ACTION_OnPickOutTrigger, m.a.CreateNewFromSprite(o._pickedDownSprite, o, i)));\n            }\n            return n;\n          }, r;\n        }();\n        ze.a.IncludesShadersStore.imageProcessingCompatibility = `#ifdef IMAGEPROCESSINGPOSTPROCESS\ngl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(2.2));\n#endif`;\n        var Eg = `uniform bool alphaTest;\nvarying vec4 vColor;\n\nvarying vec2 vUV;\nuniform sampler2D diffuseSampler;\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\nvec4 color=texture2D(diffuseSampler,vUV);\nif (alphaTest)\n{\nif (color.a<0.95)\ndiscard;\n}\ncolor*=vColor;\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n}`;\n        ze.a.ShadersStore.spritesPixelShader = Eg;\n        var Sg = `\nattribute vec4 position;\nattribute vec2 options;\nattribute vec2 offsets;\nattribute vec2 inverts;\nattribute vec4 cellInfo;\nattribute vec4 color;\n\nuniform mat4 view;\nuniform mat4 projection;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\n#include<fogVertexDeclaration>\nvoid main(void) {\nvec3 viewPos=(view*vec4(position.xyz,1.0)).xyz;\nvec2 cornerPos;\nfloat angle=position.w;\nvec2 size=vec2(options.x,options.y);\nvec2 offset=offsets.xy;\ncornerPos=vec2(offset.x-0.5,offset.y-0.5)*size;\n\nvec3 rotatedCorner;\nrotatedCorner.x=cornerPos.x*cos(angle)-cornerPos.y*sin(angle);\nrotatedCorner.y=cornerPos.x*sin(angle)+cornerPos.y*cos(angle);\nrotatedCorner.z=0.;\n\nviewPos+=rotatedCorner;\ngl_Position=projection*vec4(viewPos,1.0);\n\nvColor=color;\n\nvec2 uvOffset=vec2(abs(offset.x-inverts.x),abs(1.0-offset.y-inverts.y));\nvec2 uvPlace=cellInfo.xy;\nvec2 uvSize=cellInfo.zw;\nvUV.x=uvPlace.x+uvSize.x*uvOffset.x;\nvUV.y=uvPlace.y+uvSize.y*uvOffset.y;\n\n#ifdef FOG\nvFogDistance=viewPos;\n#endif\n}`;\n        ze.a.ShadersStore.spritesVertexShader = Sg;\n        var Ag = function() {\n          function r(t, e, n, i) {\n            if (n === void 0 && (n = 0.01), i === void 0 && (i = null), this.blendMode = h.a.ALPHA_COMBINE, this.autoResetAlpha = !0, this.disableDepthWrite = !1, this.fogEnabled = !0, this._useVAO = !1, this._useInstancing = !1, this._vertexBuffers = {}, this._capacity = e, this._epsilon = n, this._engine = t, this._useInstancing = t.getCaps().instancedArrays, this._useVAO = t.getCaps().vertexArrayObject && !t.disableVertexArrayObjects, this._scene = i, !this._useInstancing) {\n              for (var o = [], a = 0, s = 0; s < e; s++)\n                o.push(a), o.push(a + 1), o.push(a + 2), o.push(a), o.push(a + 2), o.push(a + 3), a += 4;\n              this._indexBuffer = t.createIndexBuffer(o);\n            }\n            this._vertexBufferSize = this._useInstancing ? 16 : 18, this._vertexData = new Float32Array(e * this._vertexBufferSize * (this._useInstancing ? 1 : 4)), this._buffer = new Oe.a(t, this._vertexData, !0, this._vertexBufferSize);\n            var d, p = this._buffer.createVertexBuffer(Oe.b.PositionKind, 0, 4, this._vertexBufferSize, this._useInstancing), y = this._buffer.createVertexBuffer(\"options\", 4, 2, this._vertexBufferSize, this._useInstancing), P = 6;\n            if (this._useInstancing) {\n              var R = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);\n              this._spriteBuffer = new Oe.a(t, R, !1, 2), d = this._spriteBuffer.createVertexBuffer(\"offsets\", 0, 2);\n            } else\n              d = this._buffer.createVertexBuffer(\"offsets\", P, 2, this._vertexBufferSize, this._useInstancing), P += 2;\n            var B = this._buffer.createVertexBuffer(\"inverts\", P, 2, this._vertexBufferSize, this._useInstancing), F = this._buffer.createVertexBuffer(\"cellInfo\", P + 2, 4, this._vertexBufferSize, this._useInstancing), z = this._buffer.createVertexBuffer(Oe.b.ColorKind, P + 6, 4, this._vertexBufferSize, this._useInstancing);\n            this._vertexBuffers[Oe.b.PositionKind] = p, this._vertexBuffers.options = y, this._vertexBuffers.offsets = d, this._vertexBuffers.inverts = B, this._vertexBuffers.cellInfo = F, this._vertexBuffers[Oe.b.ColorKind] = z, this._effectBase = this._engine.createEffect(\"sprites\", [Oe.b.PositionKind, \"options\", \"offsets\", \"inverts\", \"cellInfo\", Oe.b.ColorKind], [\"view\", \"projection\", \"textureInfos\", \"alphaTest\"], [\"diffuseSampler\"], \"\"), this._scene && (this._effectFog = this._scene.getEngine().createEffect(\"sprites\", [Oe.b.PositionKind, \"options\", \"offsets\", \"inverts\", \"cellInfo\", Oe.b.ColorKind], [\"view\", \"projection\", \"textureInfos\", \"alphaTest\", \"vFogInfos\", \"vFogColor\"], [\"diffuseSampler\"], \"#define FOG\"));\n          }\n          return Object.defineProperty(r.prototype, \"capacity\", { get: function() {\n            return this._capacity;\n          }, enumerable: !1, configurable: !0 }), r.prototype.render = function(t, e, n, i, o) {\n            if (o === void 0 && (o = null), this.texture && this.texture.isReady() && t.length) {\n              var a = this._effectBase, s = !1;\n              if (this.fogEnabled && this._scene && this._scene.fogEnabled && this._scene.fogMode !== 0 && (a = this._effectFog, s = !0), a.isReady()) {\n                for (var d = this._engine, p = !(!this._scene || !this._scene.useRightHandedSystem), y = this.texture.getBaseSize(), P = Math.min(this._capacity, t.length), R = 0, B = !0, F = 0; F < P; F++) {\n                  var z = t[F];\n                  z && z.isVisible && (B = !1, z._animate(e), this._appendSpriteVertex(R++, z, 0, 0, y, p, o), this._useInstancing || (this._appendSpriteVertex(R++, z, 1, 0, y, p, o), this._appendSpriteVertex(R++, z, 1, 1, y, p, o), this._appendSpriteVertex(R++, z, 0, 1, y, p, o)));\n                }\n                if (!B) {\n                  this._buffer.update(this._vertexData);\n                  var J = d.depthCullingState.cull || !0, ie = d.depthCullingState.zOffset;\n                  if (p && this._scene.getEngine().setState(J, ie, !1, !1), d.enableEffect(a), a.setTexture(\"diffuseSampler\", this.texture), a.setMatrix(\"view\", n), a.setMatrix(\"projection\", i), s) {\n                    var se = this._scene;\n                    a.setFloat4(\"vFogInfos\", se.fogMode, se.fogStart, se.fogEnd, se.fogDensity), a.setColor3(\"vFogColor\", se.fogColor);\n                  }\n                  this._useVAO ? (this._vertexArrayObject || (this._vertexArrayObject = d.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, a)), d.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer)) : d.bindBuffers(this._vertexBuffers, this._indexBuffer, a), d.depthCullingState.depthFunc = h.a.LEQUAL, this.disableDepthWrite || (a.setBool(\"alphaTest\", !0), d.setColorWrite(!1), this._useInstancing ? d.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, R) : d.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, R / 4 * 6), d.setColorWrite(!0), a.setBool(\"alphaTest\", !1)), d.setAlphaMode(this.blendMode), this._useInstancing ? d.drawArraysType(h.a.MATERIAL_TriangleFanDrawMode, 0, 4, R) : d.drawElementsType(h.a.MATERIAL_TriangleFillMode, 0, R / 4 * 6), this.autoResetAlpha && d.setAlphaMode(h.a.ALPHA_DISABLE), p && this._scene.getEngine().setState(J, ie, !1, !0), d.unbindInstanceAttributes();\n                }\n              }\n            }\n          }, r.prototype._appendSpriteVertex = function(t, e, n, i, o, a, s) {\n            var d = t * this._vertexBufferSize;\n            if (n === 0 ? n = this._epsilon : n === 1 && (n = 1 - this._epsilon), i === 0 ? i = this._epsilon : i === 1 && (i = 1 - this._epsilon), s)\n              s(e, o);\n            else {\n              e.cellIndex || (e.cellIndex = 0);\n              var p = o.width / this.cellWidth, y = e.cellIndex / p >> 0;\n              e._xOffset = (e.cellIndex - y * p) * this.cellWidth / o.width, e._yOffset = y * this.cellHeight / o.height, e._xSize = this.cellWidth, e._ySize = this.cellHeight;\n            }\n            this._vertexData[d] = e.position.x, this._vertexData[d + 1] = e.position.y, this._vertexData[d + 2] = e.position.z, this._vertexData[d + 3] = e.angle, this._vertexData[d + 4] = e.width, this._vertexData[d + 5] = e.height, this._useInstancing ? d -= 2 : (this._vertexData[d + 6] = n, this._vertexData[d + 7] = i), this._vertexData[d + 8] = a ? e.invertU ? 0 : 1 : e.invertU ? 1 : 0, this._vertexData[d + 9] = e.invertV ? 1 : 0, this._vertexData[d + 10] = e._xOffset, this._vertexData[d + 11] = e._yOffset, this._vertexData[d + 12] = e._xSize / o.width, this._vertexData[d + 13] = e._ySize / o.height, this._vertexData[d + 14] = e.color.r, this._vertexData[d + 15] = e.color.g, this._vertexData[d + 16] = e.color.b, this._vertexData[d + 17] = e.color.a;\n          }, r.prototype.dispose = function() {\n            this._buffer && (this._buffer.dispose(), this._buffer = null), this._spriteBuffer && (this._spriteBuffer.dispose(), this._spriteBuffer = null), this._indexBuffer && (this._engine._releaseBuffer(this._indexBuffer), this._indexBuffer = null), this._vertexArrayObject && (this._engine.releaseVertexArrayObject(this._vertexArrayObject), this._vertexArrayObject = null), this.texture && (this.texture.dispose(), this.texture = null);\n          }, r;\n        }(), Bd = function() {\n          function r(t, e, n, i, o, a, s, d, p) {\n            var y = this;\n            a === void 0 && (a = 0.01), s === void 0 && (s = Ne.a.TRILINEAR_SAMPLINGMODE), d === void 0 && (d = !1), p === void 0 && (p = null), this.name = t, this.sprites = new Array(), this.renderingGroupId = 0, this.layerMask = 268435455, this.isPickable = !1, this.onDisposeObservable = new C.c(), this.disableDepthWrite = !1, this._packedAndReady = !1, this._customUpdate = function(R, B) {\n              R.cellRef || (R.cellIndex = 0);\n              var F = R.cellIndex;\n              typeof F == \"number\" && isFinite(F) && Math.floor(F) === F && (R.cellRef = y._spriteMap[R.cellIndex]), R._xOffset = y._cellData[R.cellRef].frame.x / B.width, R._yOffset = y._cellData[R.cellRef].frame.y / B.height, R._xSize = y._cellData[R.cellRef].frame.w, R._ySize = y._cellData[R.cellRef].frame.h;\n            }, o || (o = Ue.a.LastCreatedScene), o._getComponent(ot.a.NAME_SPRITE) || o._addComponent(new Fd(o)), this._fromPacked = d, this._scene = o;\n            var P = this._scene.getEngine();\n            if (this._spriteRenderer = new Ag(P, n, a, o), i.width && i.height)\n              this.cellWidth = i.width, this.cellHeight = i.height;\n            else {\n              if (i === void 0)\n                return void (this._spriteRenderer = null);\n              this.cellWidth = i, this.cellHeight = i;\n            }\n            this._scene.spriteManagers.push(this), this.uniqueId = this.scene.getUniqueId(), e && (this.texture = new Ne.a(e, o, !0, !1, s)), this._fromPacked && this._makePacked(e, p);\n          }\n          return Object.defineProperty(r.prototype, \"onDispose\", { set: function(t) {\n            this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(t);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"children\", { get: function() {\n            return this.sprites;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"scene\", { get: function() {\n            return this._scene;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"capacity\", { get: function() {\n            return this._spriteRenderer.capacity;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"texture\", { get: function() {\n            return this._spriteRenderer.texture;\n          }, set: function(t) {\n            t.wrapU = Ne.a.CLAMP_ADDRESSMODE, t.wrapV = Ne.a.CLAMP_ADDRESSMODE, this._spriteRenderer.texture = t, this._textureContent = null;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cellWidth\", { get: function() {\n            return this._spriteRenderer.cellWidth;\n          }, set: function(t) {\n            this._spriteRenderer.cellWidth = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"cellHeight\", { get: function() {\n            return this._spriteRenderer.cellHeight;\n          }, set: function(t) {\n            this._spriteRenderer.cellHeight = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"fogEnabled\", { get: function() {\n            return this._spriteRenderer.fogEnabled;\n          }, set: function(t) {\n            this._spriteRenderer.fogEnabled = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"blendMode\", { get: function() {\n            return this._spriteRenderer.blendMode;\n          }, set: function(t) {\n            this._spriteRenderer.blendMode = t;\n          }, enumerable: !1, configurable: !0 }), r.prototype.getClassName = function() {\n            return \"SpriteManager\";\n          }, r.prototype._makePacked = function(t, e) {\n            var n = this;\n            if (e !== null)\n              try {\n                var i = void 0;\n                if ((i = typeof e == \"string\" ? JSON.parse(e) : e).frames.length) {\n                  for (var o = {}, a = 0; a < i.frames.length; a++) {\n                    var s = i.frames[a];\n                    if (typeof Object.keys(s)[0] != \"string\")\n                      throw new Error(\"Invalid JSON Format.  Check the frame values and make sure the name is the first parameter.\");\n                    o[s[Object.keys(s)[0]]] = s;\n                  }\n                  i.frames = o;\n                }\n                var d = Reflect.ownKeys(i.frames);\n                this._spriteMap = d, this._packedAndReady = !0, this._cellData = i.frames;\n              } catch {\n                throw this._fromPacked = !1, this._packedAndReady = !1, new Error(\"Invalid JSON from string. Spritesheet managed with constant cell size.\");\n              }\n            else {\n              var p = /\\./g, y = void 0;\n              do\n                y = p.lastIndex, p.test(t);\n              while (p.lastIndex > 0);\n              var P = t.substring(0, y - 1) + \".json\", R = new XMLHttpRequest();\n              R.open(\"GET\", P, !0), R.onerror = function() {\n                l.a.Error(\"JSON ERROR: Unable to load JSON file.\"), n._fromPacked = !1, n._packedAndReady = !1;\n              }, R.onload = function() {\n                try {\n                  var B = JSON.parse(R.response), F = Reflect.ownKeys(B.frames);\n                  n._spriteMap = F, n._packedAndReady = !0, n._cellData = B.frames;\n                } catch {\n                  throw n._fromPacked = !1, n._packedAndReady = !1, new Error(\"Invalid JSON format. Please check documentation for format specifications.\");\n                }\n              }, R.send();\n            }\n          }, r.prototype._checkTextureAlpha = function(t, e, n, i, o) {\n            if (!t.useAlphaForPicking || !this.texture)\n              return !0;\n            var a = this.texture.getSize();\n            this._textureContent || (this._textureContent = new Uint8Array(a.width * a.height * 4), this.texture.readPixels(0, 0, this._textureContent));\n            var s = u.c.Vector3[0];\n            s.copyFrom(e.direction), s.normalize(), s.scaleInPlace(n), s.addInPlace(e.origin);\n            var d = (s.x - i.x) / (o.x - i.x) - 0.5, p = 1 - (s.y - i.y) / (o.y - i.y) - 0.5, y = t.angle, P = d * Math.cos(y) - p * Math.sin(y) + 0.5, R = d * Math.sin(y) + p * Math.cos(y) + 0.5, B = t._xOffset * a.width + P * t._xSize | 0, F = t._yOffset * a.height + R * t._ySize | 0;\n            return this._textureContent[4 * (B + F * a.width) + 3] > 0.5;\n          }, r.prototype.intersects = function(t, e, n, i) {\n            for (var o = Math.min(this.capacity, this.sprites.length), a = u.e.Zero(), s = u.e.Zero(), d = Number.MAX_VALUE, p = null, y = u.c.Vector3[0], P = u.c.Vector3[1], R = e.getViewMatrix(), B = 0; B < o; B++) {\n              var F = this.sprites[B];\n              if (F) {\n                if (n) {\n                  if (!n(F))\n                    continue;\n                } else if (!F.isPickable)\n                  continue;\n                if (u.e.TransformCoordinatesToRef(F.position, R, P), a.copyFromFloats(P.x - F.width / 2, P.y - F.height / 2, P.z), s.copyFromFloats(P.x + F.width / 2, P.y + F.height / 2, P.z), t.intersectsBoxMinMax(a, s)) {\n                  var z = u.e.Distance(P, t.origin);\n                  if (d > z) {\n                    if (!this._checkTextureAlpha(F, t, z, a, s))\n                      continue;\n                    if (d = z, p = F, i)\n                      break;\n                  }\n                }\n              }\n            }\n            if (p) {\n              var J = new Ki.a();\n              R.invertToRef(u.c.Matrix[0]), J.hit = !0, J.pickedSprite = p, J.distance = d;\n              var ie = u.c.Vector3[2];\n              return ie.copyFrom(t.direction), ie.normalize(), ie.scaleInPlace(d), t.origin.addToRef(ie, y), J.pickedPoint = u.e.TransformCoordinates(y, u.c.Matrix[0]), J;\n            }\n            return null;\n          }, r.prototype.multiIntersects = function(t, e, n) {\n            for (var i, o = Math.min(this.capacity, this.sprites.length), a = u.e.Zero(), s = u.e.Zero(), d = [], p = u.c.Vector3[0].copyFromFloats(0, 0, 0), y = u.c.Vector3[1].copyFromFloats(0, 0, 0), P = e.getViewMatrix(), R = 0; R < o; R++) {\n              var B = this.sprites[R];\n              if (B) {\n                if (n) {\n                  if (!n(B))\n                    continue;\n                } else if (!B.isPickable)\n                  continue;\n                if (u.e.TransformCoordinatesToRef(B.position, P, y), a.copyFromFloats(y.x - B.width / 2, y.y - B.height / 2, y.z), s.copyFromFloats(y.x + B.width / 2, y.y + B.height / 2, y.z), t.intersectsBoxMinMax(a, s)) {\n                  if (i = u.e.Distance(y, t.origin), !this._checkTextureAlpha(B, t, i, a, s))\n                    continue;\n                  var F = new Ki.a();\n                  d.push(F), P.invertToRef(u.c.Matrix[0]), F.hit = !0, F.pickedSprite = B, F.distance = i;\n                  var z = u.c.Vector3[2];\n                  z.copyFrom(t.direction), z.normalize(), z.scaleInPlace(i), t.origin.addToRef(z, p), F.pickedPoint = u.e.TransformCoordinates(p, u.c.Matrix[0]);\n                }\n              }\n            }\n            return d;\n          }, r.prototype.render = function() {\n            if (!this._fromPacked || this._packedAndReady && this._spriteMap && this._cellData) {\n              var t = this._scene.getEngine().getDeltaTime();\n              this._packedAndReady ? this._spriteRenderer.render(this.sprites, t, this._scene.getViewMatrix(), this._scene.getProjectionMatrix(), this._customUpdate) : this._spriteRenderer.render(this.sprites, t, this._scene.getViewMatrix(), this._scene.getProjectionMatrix());\n            }\n          }, r.prototype.dispose = function() {\n            this._spriteRenderer && (this._spriteRenderer.dispose(), this._spriteRenderer = null), this._textureContent = null;\n            var t = this._scene.spriteManagers.indexOf(this);\n            this._scene.spriteManagers.splice(t, 1), this.onDisposeObservable.notifyObservers(this), this.onDisposeObservable.clear();\n          }, r.prototype.serialize = function(t) {\n            t === void 0 && (t = !1);\n            var e = {};\n            e.name = this.name, e.capacity = this.capacity, e.cellWidth = this.cellWidth, e.cellHeight = this.cellHeight, this.texture && (t ? e.texture = this.texture.serialize() : (e.textureUrl = this.texture.name, e.invertY = this.texture._invertY)), e.sprites = [];\n            for (var n = 0, i = this.sprites; n < i.length; n++) {\n              var o = i[n];\n              e.sprites.push(o.serialize());\n            }\n            return e;\n          }, r.Parse = function(t, e, n) {\n            var i = new r(t.name, \"\", t.capacity, { width: t.cellWidth, height: t.cellHeight }, e);\n            t.texture ? i.texture = Ne.a.Parse(t.texture, e, n) : t.textureName && (i.texture = new Ne.a(n + t.textureUrl, e, !1, t.invertY === void 0 || t.invertY));\n            for (var o = 0, a = t.sprites; o < a.length; o++) {\n              var s = a[o];\n              wd.Parse(s, i);\n            }\n            return i;\n          }, r.ParseFromFileAsync = function(t, e, n, i) {\n            return i === void 0 && (i = \"\"), new Promise(function(o, a) {\n              var s = new re.a();\n              s.addEventListener(\"readystatechange\", function() {\n                if (s.readyState == 4)\n                  if (s.status == 200) {\n                    var d = JSON.parse(s.responseText), p = r.Parse(d, n || Ue.a.LastCreatedScene, i);\n                    t && (p.name = t), o(p);\n                  } else\n                    a(\"Unable to load the sprite manager\");\n              }), s.open(\"GET\", e), s.send();\n            });\n          }, r.CreateFromSnippetAsync = function(t, e, n) {\n            var i = this;\n            return n === void 0 && (n = \"\"), t === \"_BLANK\" ? Promise.resolve(new r(\"Default sprite manager\", \"//playground.babylonjs.com/textures/player.png\", 500, 64, e)) : new Promise(function(o, a) {\n              var s = new re.a();\n              s.addEventListener(\"readystatechange\", function() {\n                if (s.readyState == 4)\n                  if (s.status == 200) {\n                    var d = JSON.parse(JSON.parse(s.responseText).jsonPayload), p = JSON.parse(d.spriteManager), y = r.Parse(p, e || Ue.a.LastCreatedScene, n);\n                    y.snippetId = t, o(y);\n                  } else\n                    a(\"Unable to load the snippet \" + t);\n              }), s.open(\"GET\", i.SnippetUrl + \"/\" + t.replace(/#/g, \"/\")), s.send();\n            });\n          }, r.SnippetUrl = \"https://snippet.babylonjs.com\", r;\n        }(), Pg = `precision highp float;\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nuniform float time;\nuniform float spriteCount;\nuniform sampler2D spriteSheet;\nuniform vec2 spriteMapSize;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform sampler2D frameMap;\nuniform sampler2D tileMaps[LAYERS];\nuniform sampler2D animationMap;\nuniform vec3 colorMul;\nfloat mt;\nconst float fdStep=1./4.;\nconst float aFrameSteps=1./MAX_ANIMATION_FRAMES;\nmat4 getFrameData(float frameID){\nfloat fX=frameID/spriteCount;\nreturn mat4(\ntexture2D(frameMap,vec2(fX,0.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*1.),0.),\ntexture2D(frameMap,vec2(fX,fdStep*2.),0.),\nvec4(0.)\n);\n}\nvoid main(){\nvec4 color=vec4(0.);\nvec2 tileUV=fract(tUV);\n#ifdef FLIPU\ntileUV.y=1.0-tileUV.y;\n#endif\nvec2 tileID=floor(tUV);\nvec2 sheetUnits=1./spriteMapSize;\nfloat spriteUnits=1./spriteCount;\nvec2 stageUnits=1./stageSize;\nfor(int i=0; i<LAYERS; i++) {\nfloat frameID;\n#define LAYER_ID_SWITCH\nvec4 animationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,0.),0.);\nif(animationData.y>0.) {\nmt=mod(time*animationData.z,1.0);\nfor(float f=0.; f<MAX_ANIMATION_FRAMES; f++){\nif(animationData.y>mt){\nframeID=animationData.x;\nbreak;\n}\nanimationData=texture2D(animationMap,vec2((frameID+0.5)/spriteCount,aFrameSteps*f),0.);\n}\n}\n\nmat4 frameData=getFrameData(frameID+0.5);\nvec2 frameSize=(frameData[0].wz)/spriteMapSize;\nvec2 offset=frameData[0].xy*sheetUnits;\nvec2 ratio=frameData[2].xy/frameData[0].wz;\n\nif (frameData[2].z == 1.){\ntileUV.xy=tileUV.yx;\n}\nif (i == 0){\ncolor=texture2D(spriteSheet,tileUV*frameSize+offset);\n} else {\nvec4 nc=texture2D(spriteSheet,tileUV*frameSize+offset);\nfloat alpha=min(color.a+nc.a,1.0);\nvec3 mixed=mix(color.xyz,nc.xyz,nc.a);\ncolor=vec4(mixed,alpha);\n}\n}\ncolor.xyz*=colorMul;\ngl_FragColor=color;\n}`;\n        ze.a.ShadersStore.spriteMapPixelShader = Pg;\n        var xg = `precision highp float;\n\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n\nvarying vec3 vPosition;\nvarying vec2 vUV;\nvarying vec2 tUV;\nvarying vec2 stageUnits;\nvarying vec2 levelUnits;\nvarying vec2 tileID;\n\nuniform float time;\nuniform mat4 worldViewProjection;\nuniform vec2 outputSize;\nuniform vec2 stageSize;\nuniform vec2 spriteMapSize;\nuniform float stageScale;\nvoid main() {\nvec4 p=vec4( position,1. );\nvPosition=p.xyz;\nvUV=uv;\ntUV=uv*stageSize;\ngl_Position=worldViewProjection*p;\n}`;\n        ze.a.ShadersStore.spriteMapVertexShader = xg;\n        var ui, Cg = function() {\n          function r(t, e, n, i, o) {\n            var a = this;\n            this.name = t, this.sprites = [], this.atlasJSON = e, this.sprites = this.atlasJSON.frames, this.spriteSheet = n, this.options = i, i.stageSize = i.stageSize || new u.d(1, 1), i.outputSize = i.outputSize || i.stageSize, i.outputPosition = i.outputPosition || u.e.Zero(), i.outputRotation = i.outputRotation || u.e.Zero(), i.layerCount = i.layerCount || 1, i.maxAnimationFrames = i.maxAnimationFrames || 0, i.baseTile = i.baseTile || 0, i.flipU = i.flipU || !1, i.colorMultiply = i.colorMultiply || new u.e(1, 1, 1), this._scene = o, this._frameMap = this._createFrameBuffer(), this._tileMaps = new Array();\n            for (var s = 0; s < i.layerCount; s++)\n              this._tileMaps.push(this._createTileBuffer(null, s));\n            this._animationMap = this._createTileAnimationBuffer(null);\n            var d = [];\n            d.push(\"#define LAYERS \" + i.layerCount), i.flipU && d.push(\"#define FLIPU\"), d.push(\"#define MAX_ANIMATION_FRAMES \" + i.maxAnimationFrames + \".0\");\n            var p, y = ze.a.ShadersStore.spriteMapPixelShader;\n            if (this._scene.getEngine().webGLVersion === 1)\n              for (p = \"\", s = 0; s < i.layerCount; s++)\n                p += \"if (\" + s + \" == i) { frameID = texture2D(tileMaps[\" + s + \"], (tileID + 0.5) / stageSize, 0.).x; }\";\n            else {\n              for (p = \"switch(i) {\", s = 0; s < i.layerCount; s++)\n                p += \"case \" + s + \" : frameID = texture(tileMaps[\" + s + \"], (tileID + 0.5) / stageSize, 0.).x;\", p += \"break;\";\n              p += \"}\";\n            }\n            ze.a.ShadersStore[\"spriteMap\" + this.name + \"PixelShader\"] = y.replace(\"#define LAYER_ID_SWITCH\", p), this._material = new ea.a(\"spriteMap:\" + this.name, this._scene, { vertex: \"spriteMap\", fragment: \"spriteMap\" + this.name }, { defines: d, attributes: [\"position\", \"normal\", \"uv\"], uniforms: [\"worldViewProjection\", \"time\", \"stageSize\", \"outputSize\", \"spriteMapSize\", \"spriteCount\", \"time\", \"colorMul\", \"mousePosition\", \"curTile\", \"flipU\"], samplers: [\"spriteSheet\", \"frameMap\", \"tileMaps\", \"animationMap\"], needAlphaBlending: !0 }), this._time = 0, this._material.setFloat(\"spriteCount\", this.spriteCount), this._material.setVector2(\"stageSize\", i.stageSize), this._material.setVector2(\"outputSize\", i.outputSize), this._material.setTexture(\"spriteSheet\", this.spriteSheet), this._material.setVector2(\"spriteMapSize\", new u.d(1, 1)), this._material.setVector3(\"colorMul\", i.colorMultiply);\n            var P = 0, R = function() {\n              a.spriteSheet && a.spriteSheet.isReady() && a.spriteSheet._texture ? a._material.setVector2(\"spriteMapSize\", new u.d(a.spriteSheet._texture.baseWidth || 1, a.spriteSheet._texture.baseHeight || 1)) : P < 100 && setTimeout(function() {\n                P++, R();\n              }, 100);\n            };\n            R(), this._material.setVector3(\"colorMul\", i.colorMultiply), this._material.setTexture(\"frameMap\", this._frameMap), this._material.setTextureArray(\"tileMaps\", this._tileMaps), this._material.setTexture(\"animationMap\", this._animationMap), this._material.setFloat(\"time\", this._time), this._output = Ie.a.CreatePlane(t + \":output\", 1, o, !0), this._output.scaling.x = i.outputSize.x, this._output.scaling.y = i.outputSize.y, this.position = i.outputPosition, this.rotation = i.outputRotation, this._scene.onBeforeRenderObservable.add(function() {\n              a._time += a._scene.getEngine().getDeltaTime(), a._material.setFloat(\"time\", a._time);\n            }), this._output.material = this._material;\n          }\n          return Object.defineProperty(r.prototype, \"spriteCount\", { get: function() {\n            return this.sprites.length;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"position\", { get: function() {\n            return this._output.position;\n          }, set: function(t) {\n            this._output.position = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"rotation\", { get: function() {\n            return this._output.rotation;\n          }, set: function(t) {\n            this._output.rotation = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"animationMap\", { get: function() {\n            return this._animationMap;\n          }, set: function(t) {\n            var e = t._texture._bufferView, n = this._createTileAnimationBuffer(e);\n            this._animationMap.dispose(), this._animationMap = n, this._material.setTexture(\"animationMap\", this._animationMap);\n          }, enumerable: !1, configurable: !0 }), r.prototype.getTileID = function() {\n            var t = this.getMousePosition();\n            return t.multiplyInPlace(this.options.stageSize || u.d.Zero()), t.x = Math.floor(t.x), t.y = Math.floor(t.y), t;\n          }, r.prototype.getMousePosition = function() {\n            var t = this._output, e = this._scene.pick(this._scene.pointerX, this._scene.pointerY, function(i) {\n              return i === t;\n            });\n            if (!e || !e.hit || !e.getTextureCoordinates)\n              return new u.d(-1, -1);\n            var n = e.getTextureCoordinates();\n            return n || new u.d(-1, -1);\n          }, r.prototype._createFrameBuffer = function() {\n            for (var t = new Array(), e = 0; e < this.spriteCount; e++)\n              t.push(0, 0, 0, 0), t.push(0, 0, 0, 0), t.push(0, 0, 0, 0), t.push(0, 0, 0, 0);\n            for (e = 0; e < this.spriteCount; e++) {\n              var n = this.sprites[e].frame, i = this.sprites[e].spriteSourceSize, o = this.sprites[e].sourceSize, a = this.sprites[e].rotated ? 1 : 0, s = this.sprites[e].trimmed ? 1 : 0;\n              t[4 * e] = n.x, t[4 * e + 1] = n.y, t[4 * e + 2] = n.w, t[4 * e + 3] = n.h, t[4 * e + 4 * this.spriteCount] = i.x, t[4 * e + 1 + 4 * this.spriteCount] = i.y, t[4 * e + 3 + 4 * this.spriteCount] = i.h, t[4 * e + 8 * this.spriteCount] = o.w, t[4 * e + 1 + 8 * this.spriteCount] = o.h, t[4 * e + 2 + 8 * this.spriteCount] = a, t[4 * e + 3 + 8 * this.spriteCount] = s;\n            }\n            var d = new Float32Array(t);\n            return Zn.CreateRGBATexture(d, this.spriteCount, 4, this._scene, !1, !1, Ne.a.NEAREST_NEAREST, Ue.a.TEXTURETYPE_FLOAT);\n          }, r.prototype._createTileBuffer = function(t, e) {\n            e === void 0 && (e = 0);\n            var n = new Array(), i = this.options.stageSize.y || 0, o = this.options.stageSize.x || 0;\n            if (t)\n              n = t;\n            else {\n              var a = this.options.baseTile;\n              e != 0 && (a = 0);\n              for (var s = 0; s < i; s++)\n                for (var d = 0; d < 4 * o; d += 4)\n                  n.push(a, 0, 0, 0);\n            }\n            var p = new Float32Array(n);\n            return Zn.CreateRGBATexture(p, o, i, this._scene, !1, !1, Ne.a.NEAREST_NEAREST, Ue.a.TEXTURETYPE_FLOAT);\n          }, r.prototype.changeTiles = function(t, e, n) {\n            var i;\n            if (t === void 0 && (t = 0), n === void 0 && (n = 0), (i = this._tileMaps[t]._texture._bufferView) !== null) {\n              var o = new Array();\n              e instanceof u.d ? o.push(e) : o = e;\n              for (var a = this.options.stageSize.x || 0, s = 0; s < o.length; s++) {\n                var d = o[s];\n                d.x = Math.floor(d.x), d.y = Math.floor(d.y), i[4 * d.x + d.y * (4 * a)] = n;\n              }\n              var p = this._createTileBuffer(i);\n              this._tileMaps[t].dispose(), this._tileMaps[t] = p, this._material.setTextureArray(\"tileMap\", this._tileMaps);\n            }\n          }, r.prototype._createTileAnimationBuffer = function(t) {\n            var e, n = new Array();\n            if (t)\n              e = t;\n            else {\n              for (var i = 0; i < this.spriteCount; i++) {\n                n.push(0, 0, 0, 0);\n                for (var o = 1; o < (this.options.maxAnimationFrames || 4); )\n                  n.push(0, 0, 0, 0), o++;\n              }\n              e = new Float32Array(n);\n            }\n            return Zn.CreateRGBATexture(e, this.spriteCount, this.options.maxAnimationFrames || 4, this._scene, !1, !1, Ne.a.NEAREST_NEAREST, Ue.a.TEXTURETYPE_FLOAT);\n          }, r.prototype.addAnimationToTile = function(t, e, n, i, o) {\n            t === void 0 && (t = 0), e === void 0 && (e = 0), n === void 0 && (n = 0), i === void 0 && (i = 0), o === void 0 && (o = 1);\n            var a = this._animationMap._texture._bufferView, s = 4 * t + 4 * this.spriteCount * e;\n            if (a) {\n              a[s] = n, a[s + 1] = i, a[s + 2] = o;\n              var d = this._createTileAnimationBuffer(a);\n              this._animationMap.dispose(), this._animationMap = d, this._material.setTexture(\"animationMap\", this._animationMap);\n            }\n          }, r.prototype.saveTileMaps = function() {\n            for (var t = \"\", e = 0; e < this._tileMaps.length; e++)\n              e > 0 && (t += `\n\\r`), t += this._tileMaps[e]._texture._bufferView.toString();\n            var n = document.createElement(\"a\");\n            n.href = \"data:octet/stream;charset=utf-8,\" + encodeURI(t), n.target = \"_blank\", n.download = this.name + \".tilemaps\", n.click(), n.remove();\n          }, r.prototype.loadTileMaps = function(t) {\n            var e = this, n = new XMLHttpRequest();\n            n.open(\"GET\", t);\n            var i = this.options.layerCount || 0;\n            n.onload = function() {\n              for (var o = n.response.split(`\n\\r`), a = 0; a < i; a++) {\n                var s = o[a].split(\",\").map(Number), d = e._createTileBuffer(s);\n                e._tileMaps[a].dispose(), e._tileMaps[a] = d;\n              }\n              e._material.setTextureArray(\"tileMap\", e._tileMaps);\n            }, n.send();\n          }, r.prototype.dispose = function() {\n            this._output.dispose(), this._material.dispose(), this._animationMap.dispose(), this._tileMaps.forEach(function(t) {\n              t.dispose();\n            }), this._frameMap.dispose();\n          }, r;\n        }(), Rg = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            a === void 0 && (a = null), s === void 0 && (s = 0.01), d === void 0 && (d = Ne.a.TRILINEAR_SAMPLINGMODE);\n            var p = r.call(this, e, n, i, 64, o, s, d, !0, a) || this;\n            return p.name = e, p;\n          }\n          return Object(c.d)(t, r), t;\n        }(Bd), Og = f(143), Mg = f(141), Ig = f(142), Dg = f(139);\n        (function(r) {\n          r[r.INIT = 0] = \"INIT\", r[r.RUNNING = 1] = \"RUNNING\", r[r.DONE = 2] = \"DONE\", r[r.ERROR = 3] = \"ERROR\";\n        })(ui || (ui = {}));\n        var wc, hi = function() {\n          function r(t) {\n            this.name = t, this._isCompleted = !1, this._taskState = ui.INIT;\n          }\n          return Object.defineProperty(r.prototype, \"isCompleted\", { get: function() {\n            return this._isCompleted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"taskState\", { get: function() {\n            return this._taskState;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"errorObject\", { get: function() {\n            return this._errorObject;\n          }, enumerable: !1, configurable: !0 }), r.prototype._setErrorObject = function(t, e) {\n            this._errorObject || (this._errorObject = { message: t, exception: e });\n          }, r.prototype.run = function(t, e, n) {\n            var i = this;\n            this._taskState = ui.RUNNING, this.runTask(t, function() {\n              i.onDoneCallback(e, n);\n            }, function(o, a) {\n              i.onErrorCallback(n, o, a);\n            });\n          }, r.prototype.runTask = function(t, e, n) {\n            throw new Error(\"runTask is not implemented\");\n          }, r.prototype.reset = function() {\n            this._taskState = ui.INIT;\n          }, r.prototype.onErrorCallback = function(t, e, n) {\n            this._taskState = ui.ERROR, this._errorObject = { message: e, exception: n }, this.onError && this.onError(this, e, n), t();\n          }, r.prototype.onDoneCallback = function(t, e) {\n            try {\n              this._taskState = ui.DONE, this._isCompleted = !0, this.onSuccess && this.onSuccess(this), t();\n            } catch (n) {\n              this.onErrorCallback(e, \"Task is done, error executing success callback(s)\", n);\n            }\n          }, r;\n        }(), Ud = function(r, t, e) {\n          this.remainingCount = r, this.totalCount = t, this.task = e;\n        }, Vd = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e) || this;\n            return a.name = e, a.meshesNames = n, a.rootUrl = i, a.sceneFilename = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            Ft.LoadAssetContainer(this.rootUrl, this.sceneFilename, e, function(a) {\n              o.loadedContainer = a, o.loadedMeshes = a.meshes, o.loadedParticleSystems = a.particleSystems, o.loadedSkeletons = a.skeletons, o.loadedAnimationGroups = a.animationGroups, n();\n            }, null, function(a, s, d) {\n              i(s, d);\n            });\n          }, t;\n        }(hi), kd = function(r) {\n          function t(e, n, i, o) {\n            var a = r.call(this, e) || this;\n            return a.name = e, a.meshesNames = n, a.rootUrl = i, a.sceneFilename = o, a;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            Ft.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, e, function(a, s, d, p) {\n              o.loadedMeshes = a, o.loadedParticleSystems = s, o.loadedSkeletons = d, o.loadedAnimationGroups = p, n();\n            }, null, function(a, s, d) {\n              i(s, d);\n            });\n          }, t;\n        }(hi), Gd = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.name = e, i.url = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            e._loadFile(this.url, function(a) {\n              o.text = a, n();\n            }, void 0, !1, !1, function(a, s) {\n              a && i(a.status + \" \" + a.statusText, s);\n            });\n          }, t;\n        }(hi), zd = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.name = e, i.url = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this;\n            e._loadFile(this.url, function(a) {\n              o.data = a, n();\n            }, void 0, !0, !0, function(a, s) {\n              a && i(a.status + \" \" + a.statusText, s);\n            });\n          }, t;\n        }(hi), jd = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.name = e, i.url = n, i;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            var o = this, a = new Image();\n            Xe.b.SetCorsBehavior(this.url, a), a.onload = function() {\n              o.image = a, n();\n            }, a.onerror = function(s) {\n              i(\"Error loading image\", s);\n            }, a.src = this.url;\n          }, t;\n        }(hi), Hd = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !0), a === void 0 && (a = Ne.a.TRILINEAR_SAMPLINGMODE);\n            var s = r.call(this, e) || this;\n            return s.name = e, s.url = n, s.noMipmap = i, s.invertY = o, s.samplingMode = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new Ne.a(this.url, e, this.noMipmap, this.invertY, this.samplingMode, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Wd = function(r) {\n          function t(e, n, i, o, a) {\n            var s = r.call(this, e) || this;\n            return s.name = e, s.url = n, s.extensions = i, s.noMipmap = o, s.files = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new ei(this.url, e, this.extensions, this.noMipmap, this.files, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Xd = function(r) {\n          function t(e, n, i, o, a, s, d) {\n            o === void 0 && (o = !1), a === void 0 && (a = !0), s === void 0 && (s = !1), d === void 0 && (d = !1);\n            var p = r.call(this, e) || this;\n            return p.name = e, p.url = n, p.size = i, p.noMipmap = o, p.generateHarmonics = a, p.gammaSpace = s, p.reserved = d, p;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new qo(this.url, e, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Yd = function(r) {\n          function t(e, n, i, o, a) {\n            o === void 0 && (o = !1), a === void 0 && (a = !0);\n            var s = r.call(this, e) || this;\n            return s.name = e, s.url = n, s.size = i, s.noMipmap = o, s.gammaSpace = a, s;\n          }\n          return Object(c.d)(t, r), t.prototype.runTask = function(e, n, i) {\n            this.texture = new Gu(this.url, e, this.size, this.noMipmap, this.gammaSpace, function() {\n              n();\n            }, function(o, a) {\n              i(o, a);\n            });\n          }, t;\n        }(hi), Lg = function() {\n          function r(t) {\n            this._isLoading = !1, this._tasks = new Array(), this._waitingTasksCount = 0, this._totalTasksCount = 0, this.onTaskSuccessObservable = new C.c(), this.onTaskErrorObservable = new C.c(), this.onTasksDoneObservable = new C.c(), this.onProgressObservable = new C.c(), this.useDefaultLoadingScreen = !0, this.autoHideLoadingUI = !0, this._scene = t;\n          }\n          return r.prototype.addContainerTask = function(t, e, n, i) {\n            var o = new Vd(t, e, n, i);\n            return this._tasks.push(o), o;\n          }, r.prototype.addMeshTask = function(t, e, n, i) {\n            var o = new kd(t, e, n, i);\n            return this._tasks.push(o), o;\n          }, r.prototype.addTextFileTask = function(t, e) {\n            var n = new Gd(t, e);\n            return this._tasks.push(n), n;\n          }, r.prototype.addBinaryFileTask = function(t, e) {\n            var n = new zd(t, e);\n            return this._tasks.push(n), n;\n          }, r.prototype.addImageTask = function(t, e) {\n            var n = new jd(t, e);\n            return this._tasks.push(n), n;\n          }, r.prototype.addTextureTask = function(t, e, n, i, o) {\n            o === void 0 && (o = Ne.a.TRILINEAR_SAMPLINGMODE);\n            var a = new Hd(t, e, n, i, o);\n            return this._tasks.push(a), a;\n          }, r.prototype.addCubeTextureTask = function(t, e, n, i, o) {\n            var a = new Wd(t, e, n, i, o);\n            return this._tasks.push(a), a;\n          }, r.prototype.addHDRCubeTextureTask = function(t, e, n, i, o, a, s) {\n            i === void 0 && (i = !1), o === void 0 && (o = !0), a === void 0 && (a = !1), s === void 0 && (s = !1);\n            var d = new Xd(t, e, n, i, o, a, s);\n            return this._tasks.push(d), d;\n          }, r.prototype.addEquiRectangularCubeTextureAssetTask = function(t, e, n, i, o) {\n            i === void 0 && (i = !1), o === void 0 && (o = !0);\n            var a = new Yd(t, e, n, i, o);\n            return this._tasks.push(a), a;\n          }, r.prototype.removeTask = function(t) {\n            var e = this._tasks.indexOf(t);\n            e > -1 && this._tasks.splice(e, 1);\n          }, r.prototype._decreaseWaitingTasksCount = function(t) {\n            this._waitingTasksCount--;\n            try {\n              this.onProgress && this.onProgress(this._waitingTasksCount, this._totalTasksCount, t), this.onProgressObservable.notifyObservers(new Ud(this._waitingTasksCount, this._totalTasksCount, t));\n            } catch (a) {\n              l.a.Error(\"Error running progress callbacks.\"), console.log(a);\n            }\n            if (this._waitingTasksCount === 0) {\n              try {\n                var e = this._tasks.slice();\n                this.onFinish && this.onFinish(e);\n                for (var n = 0, i = e; n < i.length; n++)\n                  if ((t = i[n]).taskState === ui.DONE) {\n                    var o = this._tasks.indexOf(t);\n                    o > -1 && this._tasks.splice(o, 1);\n                  }\n                this.onTasksDoneObservable.notifyObservers(this._tasks);\n              } catch (a) {\n                l.a.Error(\"Error running tasks-done callbacks.\"), console.log(a);\n              }\n              this._isLoading = !1, this.autoHideLoadingUI && this._scene.getEngine().hideLoadingUI();\n            }\n          }, r.prototype._runTask = function(t) {\n            var e = this, n = function(i, o) {\n              t._setErrorObject(i, o), e.onTaskError && e.onTaskError(t), e.onTaskErrorObservable.notifyObservers(t), e._decreaseWaitingTasksCount(t);\n            };\n            t.run(this._scene, function() {\n              try {\n                e.onTaskSuccess && e.onTaskSuccess(t), e.onTaskSuccessObservable.notifyObservers(t), e._decreaseWaitingTasksCount(t);\n              } catch (i) {\n                n(\"Error executing task success callbacks\", i);\n              }\n            }, n);\n          }, r.prototype.reset = function() {\n            return this._isLoading = !1, this._tasks = new Array(), this;\n          }, r.prototype.load = function() {\n            if (this._isLoading)\n              return this;\n            if (this._isLoading = !0, this._waitingTasksCount = this._tasks.length, this._totalTasksCount = this._tasks.length, this._waitingTasksCount === 0)\n              return this._isLoading = !1, this.onFinish && this.onFinish(this._tasks), this.onTasksDoneObservable.notifyObservers(this._tasks), this;\n            this.useDefaultLoadingScreen && this._scene.getEngine().displayLoadingUI();\n            for (var t = 0; t < this._tasks.length; t++) {\n              var e = this._tasks[t];\n              e.taskState === ui.INIT && this._runTask(e);\n            }\n            return this;\n          }, r.prototype.loadAsync = function() {\n            var t = this;\n            return new Promise(function(e, n) {\n              t._isLoading ? e() : (t.onTasksDoneObservable.addOnce(function(i) {\n                i && i.length ? n(i) : e();\n              }), t.load());\n            });\n          }, r;\n        }(), Ng = function() {\n          function r() {\n            var t = this;\n            this.promise = new Promise(function(e, n) {\n              t._resolve = e, t._reject = n;\n            });\n          }\n          return Object.defineProperty(r.prototype, \"resolve\", { get: function() {\n            return this._resolve;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"reject\", { get: function() {\n            return this._reject;\n          }, enumerable: !1, configurable: !0 }), r;\n        }(), wg = function() {\n          function r(t, e) {\n            this._meshesOrigins = [], this._toCenterVectors = [], this._scaledDirection = u.e.Zero(), this._newPosition = u.e.Zero(), this._centerPosition = u.e.Zero(), this._meshes = t.slice(), e ? this._centerMesh = e : this._setCenterMesh();\n            var n = this._meshes.indexOf(this._centerMesh);\n            n >= 0 && this._meshes.splice(n, 1), this._centerPosition = this._centerMesh.getAbsolutePosition().clone();\n            for (var i = 0; i < this._meshes.length; i++)\n              if (this._meshes[i]) {\n                var o = this._meshes[i];\n                this._meshesOrigins[i] = o.getAbsolutePosition().clone(), this._toCenterVectors[i] = u.e.Zero(), o._boundingInfo && this._centerMesh._boundingInfo && o._boundingInfo.boundingBox.centerWorld.subtractToRef(this._centerMesh._boundingInfo.boundingBox.centerWorld, this._toCenterVectors[i]);\n              }\n          }\n          return r.prototype._setCenterMesh = function() {\n            for (var t = u.e.Zero(), e = u.e.Zero(), n = Number.MAX_VALUE, i = 0; i < this._meshes.length; i++)\n              this._meshes[i] && (a = (o = this._meshes[i]).getBoundingInfo()) && e.addInPlace(a.boundingBox.centerWorld);\n            for (t = e.scale(1 / this._meshes.length), i = 0; i < this._meshes.length; i++) {\n              var o, a;\n              if (this._meshes[i] && (a = (o = this._meshes[i]).getBoundingInfo())) {\n                var s = a.boundingBox.centerWorld.subtract(t).lengthSquared();\n                s < n && (this._centerMesh = o, n = s);\n              }\n            }\n          }, r.prototype.getClassName = function() {\n            return \"MeshExploder\";\n          }, r.prototype.getMeshes = function() {\n            var t = this._meshes.slice();\n            return t.unshift(this._centerMesh), t;\n          }, r.prototype.explode = function(t) {\n            t === void 0 && (t = 1);\n            for (var e = 0; e < this._meshes.length; e++)\n              this._meshes[e] && this._meshesOrigins[e] && this._toCenterVectors[e] && (this._toCenterVectors[e].scaleToRef(t, this._scaledDirection), this._meshesOrigins[e].addToRef(this._scaledDirection, this._newPosition), this._meshes[e].setAbsolutePosition(this._newPosition));\n            this._centerMesh.setAbsolutePosition(this._centerPosition);\n          }, r;\n        }(), Fg = function() {\n          function r(t, e, n, i, o, a, s, d, p) {\n            this.onProcessFileCallback = function() {\n              return !0;\n            }, this._engine = t, this._currentScene = e, this._sceneLoadedCallback = n, this._progressCallback = i, this._additionalRenderLoopLogicCallback = o, this._textureLoadingCallback = a, this._startingProcessingFilesCallback = s, this._onReloadCallback = d, this._errorCallback = p;\n          }\n          return Object.defineProperty(r, \"FilesToLoad\", { get: function() {\n            return fs.a.FilesToLoad;\n          }, enumerable: !1, configurable: !0 }), r.prototype.monitorElementForDragNDrop = function(t) {\n            var e = this;\n            t && (this._elementToMonitor = t, this._dragEnterHandler = function(n) {\n              e.drag(n);\n            }, this._dragOverHandler = function(n) {\n              e.drag(n);\n            }, this._dropHandler = function(n) {\n              e.drop(n);\n            }, this._elementToMonitor.addEventListener(\"dragenter\", this._dragEnterHandler, !1), this._elementToMonitor.addEventListener(\"dragover\", this._dragOverHandler, !1), this._elementToMonitor.addEventListener(\"drop\", this._dropHandler, !1));\n          }, Object.defineProperty(r.prototype, \"filesToLoad\", { get: function() {\n            return this._filesToLoad;\n          }, enumerable: !1, configurable: !0 }), r.prototype.dispose = function() {\n            this._elementToMonitor && (this._elementToMonitor.removeEventListener(\"dragenter\", this._dragEnterHandler), this._elementToMonitor.removeEventListener(\"dragover\", this._dragOverHandler), this._elementToMonitor.removeEventListener(\"drop\", this._dropHandler));\n          }, r.prototype.renderFunction = function() {\n            if (this._additionalRenderLoopLogicCallback && this._additionalRenderLoopLogicCallback(), this._currentScene) {\n              if (this._textureLoadingCallback) {\n                var t = this._currentScene.getWaitingItemsCount();\n                t > 0 && this._textureLoadingCallback(t);\n              }\n              this._currentScene.render();\n            }\n          }, r.prototype.drag = function(t) {\n            t.stopPropagation(), t.preventDefault();\n          }, r.prototype.drop = function(t) {\n            t.stopPropagation(), t.preventDefault(), this.loadFiles(t);\n          }, r.prototype._traverseFolder = function(t, e, n, i) {\n            var o = this, a = t.createReader(), s = t.fullPath.replace(/^\\//, \"\").replace(/(.+?)\\/?$/, \"$1/\");\n            a.readEntries(function(d) {\n              n.count += d.length;\n              for (var p = 0, y = d; p < y.length; p++) {\n                var P = y[p];\n                P.isFile ? P.file(function(R) {\n                  R.correctName = s + R.name, e.push(R), --n.count == 0 && i();\n                }) : P.isDirectory && o._traverseFolder(P, e, n, i);\n              }\n              --n.count == 0 && i();\n            });\n          }, r.prototype._processFiles = function(t) {\n            for (var e = 0; e < t.length; e++) {\n              var n = t[e].correctName.toLowerCase(), i = n.split(\".\").pop();\n              this.onProcessFileCallback(t[e], n, i) && (Ft.IsPluginForExtensionAvailable(\".\" + i) && (this._sceneFileToLoad = t[e]), r.FilesToLoad[n] = t[e]);\n            }\n          }, r.prototype.loadFiles = function(t) {\n            var e = this;\n            if (t && t.dataTransfer && t.dataTransfer.files && (this._filesToLoad = t.dataTransfer.files), t && t.target && t.target.files && (this._filesToLoad = t.target.files), this._filesToLoad && this._filesToLoad.length !== 0 && (this._startingProcessingFilesCallback && this._startingProcessingFilesCallback(this._filesToLoad), this._filesToLoad && this._filesToLoad.length > 0)) {\n              for (var n = new Array(), i = [], o = t.dataTransfer ? t.dataTransfer.items : null, a = 0; a < this._filesToLoad.length; a++) {\n                var s = this._filesToLoad[a], d = s.name.toLowerCase(), p = void 0;\n                if (s.correctName = d, o) {\n                  var y = o[a];\n                  y.getAsEntry ? p = y.getAsEntry() : y.webkitGetAsEntry && (p = y.webkitGetAsEntry());\n                }\n                p && p.isDirectory ? i.push(p) : n.push(s);\n              }\n              if (i.length === 0)\n                this._processFiles(n), this._processReload();\n              else\n                for (var P = { count: i.length }, R = 0, B = i; R < B.length; R++) {\n                  var F = B[R];\n                  this._traverseFolder(F, n, P, function() {\n                    e._processFiles(n), P.count === 0 && e._processReload();\n                  });\n                }\n            }\n          }, r.prototype._processReload = function() {\n            this._onReloadCallback ? this._onReloadCallback(this._sceneFileToLoad) : this.reload();\n          }, r.prototype.reload = function() {\n            var t = this;\n            this._sceneFileToLoad ? (this._currentScene && (l.a.errorsCount > 0 && l.a.ClearLogCache(), this._engine.stopRenderLoop()), Ft.ShowLoadingScreen = !1, this._engine.displayLoadingUI(), Ft.LoadAsync(\"file:\", this._sceneFileToLoad, this._engine, function(e) {\n              t._progressCallback && t._progressCallback(e);\n            }).then(function(e) {\n              t._currentScene && t._currentScene.dispose(), t._currentScene = e, t._sceneLoadedCallback && t._sceneLoadedCallback(t._sceneFileToLoad, t._currentScene), t._currentScene.executeWhenReady(function() {\n                t._engine.hideLoadingUI(), t._engine.runRenderLoop(function() {\n                  t.renderFunction();\n                });\n              });\n            }).catch(function(e) {\n              t._engine.hideLoadingUI(), t._errorCallback && t._errorCallback(t._sceneFileToLoad, t._currentScene, e.message);\n            })) : l.a.Error(\"Please provide a valid .babylon file.\");\n          }, r;\n        }(), Kd = f(146), Bg = f(145), di = function() {\n          function r(t) {\n            t === void 0 && (t = 0), this.priority = t;\n          }\n          return r.prototype.getDescription = function() {\n            return \"\";\n          }, r.prototype.apply = function(t, e) {\n            return !0;\n          }, r;\n        }(), _a = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = 1024), i === void 0 && (i = 0.5);\n            var o = r.call(this, e) || this;\n            return o.priority = e, o.maximumSize = n, o.step = i, o;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Reducing render target texture size to \" + this.maximumSize;\n          }, t.prototype.apply = function(e, n) {\n            for (var i = !0, o = 0; o < e.textures.length; o++) {\n              var a = e.textures[o];\n              if (a.canRescale && !a.getContext) {\n                var s = a.getSize();\n                Math.max(s.width, s.height) > this.maximumSize && (a.scale(this.step), i = !1);\n              }\n            }\n            return i;\n          }, t;\n        }(di), Fc = function(r) {\n          function t(e, n, i) {\n            e === void 0 && (e = 0), n === void 0 && (n = 2), i === void 0 && (i = 0.25);\n            var o = r.call(this, e) || this;\n            return o.priority = e, o.maximumScale = n, o.step = i, o._currentScale = -1, o._directionOffset = 1, o;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Setting hardware scaling level to \" + this._currentScale;\n          }, t.prototype.apply = function(e, n) {\n            return this._currentScale === -1 && (this._currentScale = e.getEngine().getHardwareScalingLevel(), this._currentScale > this.maximumScale && (this._directionOffset = -1)), this._currentScale += this._directionOffset * this.step, e.getEngine().setHardwareScalingLevel(this._currentScale), this._directionOffset === 1 ? this._currentScale >= this.maximumScale : this._currentScale <= this.maximumScale;\n          }, t;\n        }(di), ma = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning shadows on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.shadowsEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), ga = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning post-processes on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.postProcessesEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), va = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning lens flares on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.lensFlaresEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), Qd = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return this.onGetDescription ? this.onGetDescription() : \"Running user defined callback\";\n          }, t.prototype.apply = function(e, n) {\n            return !this.onApply || this.onApply(e, n);\n          }, t;\n        }(di), ya = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning particles on/off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.particlesEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), Bc = function(r) {\n          function t() {\n            return r !== null && r.apply(this, arguments) || this;\n          }\n          return Object(c.d)(t, r), t.prototype.getDescription = function() {\n            return \"Turning render targets off\";\n          }, t.prototype.apply = function(e, n) {\n            return e.renderTargetsEnabled = n.isInImprovementMode, !0;\n          }, t;\n        }(di), ba = function(r) {\n          function t() {\n            var e = r !== null && r.apply(this, arguments) || this;\n            return e._canBeMerged = function(n) {\n              if (!(n instanceof Ie.a))\n                return !1;\n              var i = n;\n              return !i.isDisposed() && !(!i.isVisible || !i.isEnabled()) && !(i.instances.length > 0) && !i.skeleton && !i.hasLODLevels;\n            }, e;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t, \"UpdateSelectionTree\", { get: function() {\n            return t._UpdateSelectionTree;\n          }, set: function(e) {\n            t._UpdateSelectionTree = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype.getDescription = function() {\n            return \"Merging similar meshes together\";\n          }, t.prototype.apply = function(e, n, i) {\n            for (var o = e.meshes.slice(0), a = o.length, s = 0; s < a; s++) {\n              var d = new Array(), p = o[s];\n              if (this._canBeMerged(p)) {\n                d.push(p);\n                for (var y = s + 1; y < a; y++) {\n                  var P = o[y];\n                  this._canBeMerged(P) && P.material === p.material && P.checkCollisions === p.checkCollisions && (d.push(P), a--, o.splice(y, 1), y--);\n                }\n                d.length < 2 || Ie.a.MergeMeshes(d, void 0, !0);\n              }\n            }\n            var R = e;\n            return R.createOrUpdateSelectionOctree && (i != null ? i && R.createOrUpdateSelectionOctree() : t.UpdateSelectionTree && R.createOrUpdateSelectionOctree()), !0;\n          }, t._UpdateSelectionTree = !1, t;\n        }(di), Uc = function() {\n          function r(t, e) {\n            t === void 0 && (t = 60), e === void 0 && (e = 2e3), this.targetFrameRate = t, this.trackerDuration = e, this.optimizations = new Array();\n          }\n          return r.prototype.addOptimization = function(t) {\n            return this.optimizations.push(t), this;\n          }, r.prototype.addCustomOptimization = function(t, e, n) {\n            n === void 0 && (n = 0);\n            var i = new Qd(n);\n            return i.onApply = t, i.onGetDescription = e, this.optimizations.push(i), this;\n          }, r.LowDegradationAllowed = function(t) {\n            var e = new r(t), n = 0;\n            return e.addOptimization(new ba(n)), e.addOptimization(new ma(n)), e.addOptimization(new va(n)), n++, e.addOptimization(new ga(n)), e.addOptimization(new ya(n)), n++, e.addOptimization(new _a(n, 1024)), e;\n          }, r.ModerateDegradationAllowed = function(t) {\n            var e = new r(t), n = 0;\n            return e.addOptimization(new ba(n)), e.addOptimization(new ma(n)), e.addOptimization(new va(n)), n++, e.addOptimization(new ga(n)), e.addOptimization(new ya(n)), n++, e.addOptimization(new _a(n, 512)), n++, e.addOptimization(new Bc(n)), n++, e.addOptimization(new Fc(n, 2)), e;\n          }, r.HighDegradationAllowed = function(t) {\n            var e = new r(t), n = 0;\n            return e.addOptimization(new ba(n)), e.addOptimization(new ma(n)), e.addOptimization(new va(n)), n++, e.addOptimization(new ga(n)), e.addOptimization(new ya(n)), n++, e.addOptimization(new _a(n, 256)), n++, e.addOptimization(new Bc(n)), n++, e.addOptimization(new Fc(n, 4)), e;\n          }, r;\n        }(), Ug = function() {\n          function r(t, e, n, i) {\n            var o = this;\n            if (n === void 0 && (n = !0), i === void 0 && (i = !1), this._isRunning = !1, this._currentPriorityLevel = 0, this._targetFrameRate = 60, this._trackerDuration = 2e3, this._currentFrameRate = 0, this._improvementMode = !1, this.onSuccessObservable = new C.c(), this.onNewOptimizationAppliedObservable = new C.c(), this.onFailureObservable = new C.c(), this._options = e || new Uc(), this._options.targetFrameRate && (this._targetFrameRate = this._options.targetFrameRate), this._options.trackerDuration && (this._trackerDuration = this._options.trackerDuration), n)\n              for (var a = 0, s = 0, d = this._options.optimizations; s < d.length; s++)\n                d[s].priority = a++;\n            this._improvementMode = i, this._scene = t || te.a.LastCreatedScene, this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function() {\n              o._sceneDisposeObserver = null, o.dispose();\n            });\n          }\n          return Object.defineProperty(r.prototype, \"isInImprovementMode\", { get: function() {\n            return this._improvementMode;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentPriorityLevel\", { get: function() {\n            return this._currentPriorityLevel;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"currentFrameRate\", { get: function() {\n            return this._currentFrameRate;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"targetFrameRate\", { get: function() {\n            return this._targetFrameRate;\n          }, set: function(t) {\n            this._targetFrameRate = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"trackerDuration\", { get: function() {\n            return this._trackerDuration;\n          }, set: function(t) {\n            this._trackerDuration = t;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(r.prototype, \"optimizations\", { get: function() {\n            return this._options.optimizations;\n          }, enumerable: !1, configurable: !0 }), r.prototype.stop = function() {\n            this._isRunning = !1;\n          }, r.prototype.reset = function() {\n            this._currentPriorityLevel = 0;\n          }, r.prototype.start = function() {\n            var t = this;\n            this._isRunning || (this._isRunning = !0, this._scene.executeWhenReady(function() {\n              setTimeout(function() {\n                t._checkCurrentState();\n              }, t._trackerDuration);\n            }));\n          }, r.prototype._checkCurrentState = function() {\n            var t = this;\n            if (this._isRunning) {\n              var e = this._scene, n = this._options;\n              if (this._currentFrameRate = Math.round(e.getEngine().getFps()), this._improvementMode && this._currentFrameRate <= this._targetFrameRate || !this._improvementMode && this._currentFrameRate >= this._targetFrameRate)\n                return this._isRunning = !1, void this.onSuccessObservable.notifyObservers(this);\n              for (var i = !0, o = !0, a = 0; a < n.optimizations.length; a++) {\n                var s = n.optimizations[a];\n                s.priority === this._currentPriorityLevel && (o = !1, i = i && s.apply(e, this), this.onNewOptimizationAppliedObservable.notifyObservers(s));\n              }\n              if (o)\n                return this._isRunning = !1, void this.onFailureObservable.notifyObservers(this);\n              i && this._currentPriorityLevel++, e.executeWhenReady(function() {\n                setTimeout(function() {\n                  t._checkCurrentState();\n                }, t._trackerDuration);\n              });\n            }\n          }, r.prototype.dispose = function() {\n            this.stop(), this.onSuccessObservable.clear(), this.onFailureObservable.clear(), this.onNewOptimizationAppliedObservable.clear(), this._sceneDisposeObserver && this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);\n          }, r.OptimizeAsync = function(t, e, n, i) {\n            var o = new r(t, e || Uc.ModerateDegradationAllowed(), !1);\n            return n && o.onSuccessObservable.add(function() {\n              n();\n            }), i && o.onFailureObservable.add(function() {\n              i();\n            }), o.start(), o;\n          }, r;\n        }(), Ta = [], Vc = function(r, t) {\n          Ta[r.id] || r.doNotSerialize || (t.vertexData.push(r.serializeVerticeData()), Ta[r.id] = !0);\n        }, qd = function(r, t) {\n          var e = {}, n = r._geometry;\n          return n && (r.getScene().getGeometryByID(n.id) || Vc(n, t.geometries)), r.serialize && r.serialize(e), e;\n        }, kc = function() {\n          function r() {\n          }\n          return r.ClearCache = function() {\n            Ta = [];\n          }, r.Serialize = function(t) {\n            var e, n, i, o = {};\n            if (r.ClearCache(), o.useDelayedTextureLoading = t.useDelayedTextureLoading, o.autoClear = t.autoClear, o.clearColor = t.clearColor.asArray(), o.ambientColor = t.ambientColor.asArray(), o.gravity = t.gravity.asArray(), o.collisionsEnabled = t.collisionsEnabled, t.fogMode && t.fogMode !== 0 && (o.fogMode = t.fogMode, o.fogColor = t.fogColor.asArray(), o.fogStart = t.fogStart, o.fogEnd = t.fogEnd, o.fogDensity = t.fogDensity), t.isPhysicsEnabled()) {\n              var a = t.getPhysicsEngine();\n              a && (o.physicsEnabled = !0, o.physicsGravity = a.gravity.asArray(), o.physicsEngine = a.getPhysicsPluginName());\n            }\n            t.metadata && (o.metadata = t.metadata), o.morphTargetManagers = [];\n            for (var s = 0, d = t.meshes; s < d.length; s++) {\n              var p = (se = d[s]).morphTargetManager;\n              p && o.morphTargetManagers.push(p.serialize());\n            }\n            for (o.lights = [], e = 0; e < t.lights.length; e++)\n              (n = t.lights[e]).doNotSerialize || o.lights.push(n.serialize());\n            for (o.cameras = [], e = 0; e < t.cameras.length; e++) {\n              var y = t.cameras[e];\n              y.doNotSerialize || o.cameras.push(y.serialize());\n            }\n            if (t.activeCamera && (o.activeCameraID = t.activeCamera.id), L.a.AppendSerializedAnimations(t, o), t.animationGroups && t.animationGroups.length > 0) {\n              o.animationGroups = [];\n              for (var P = 0; P < t.animationGroups.length; P++) {\n                var R = t.animationGroups[P];\n                o.animationGroups.push(R.serialize());\n              }\n            }\n            if (t.reflectionProbes && t.reflectionProbes.length > 0)\n              for (o.reflectionProbes = [], e = 0; e < t.reflectionProbes.length; e++) {\n                var B = t.reflectionProbes[e];\n                o.reflectionProbes.push(B.serialize());\n              }\n            for (o.materials = [], o.multiMaterials = [], e = 0; e < t.materials.length; e++)\n              (i = t.materials[e]).doNotSerialize || o.materials.push(i.serialize());\n            for (o.multiMaterials = [], e = 0; e < t.multiMaterials.length; e++) {\n              var F = t.multiMaterials[e];\n              o.multiMaterials.push(F.serialize());\n            }\n            for (t.environmentTexture && (o.environmentTexture = t.environmentTexture.name), o.environmentIntensity = t.environmentIntensity, o.skeletons = [], e = 0; e < t.skeletons.length; e++) {\n              var z = t.skeletons[e];\n              z.doNotSerialize || o.skeletons.push(z.serialize());\n            }\n            for (o.transformNodes = [], e = 0; e < t.transformNodes.length; e++)\n              t.transformNodes[e].doNotSerialize || o.transformNodes.push(t.transformNodes[e].serialize());\n            o.geometries = {}, o.geometries.boxes = [], o.geometries.spheres = [], o.geometries.cylinders = [], o.geometries.toruses = [], o.geometries.grounds = [], o.geometries.planes = [], o.geometries.torusKnots = [], o.geometries.vertexData = [], Ta = [];\n            var J = t.getGeometries();\n            for (e = 0; e < J.length; e++) {\n              var ie = J[e];\n              ie.isReady() && Vc(ie, o.geometries);\n            }\n            for (o.meshes = [], e = 0; e < t.meshes.length; e++) {\n              var se;\n              if ((se = t.meshes[e]) instanceof Ie.a) {\n                var ce = se;\n                ce.doNotSerialize || ce.delayLoadState !== h.a.DELAYLOADSTATE_LOADED && ce.delayLoadState !== h.a.DELAYLOADSTATE_NONE || o.meshes.push(qd(ce, o));\n              }\n            }\n            for (o.particleSystems = [], e = 0; e < t.particleSystems.length; e++)\n              o.particleSystems.push(t.particleSystems[e].serialize(!1));\n            for (o.postProcesses = [], e = 0; e < t.postProcesses.length; e++)\n              o.postProcesses.push(t.postProcesses[e].serialize());\n            t.actionManager && (o.actions = t.actionManager.serialize(\"scene\"));\n            for (var ue = 0, fe = t._serializableComponents; ue < fe.length; ue++)\n              fe[ue].serialize(o);\n            return o;\n          }, r.SerializeMesh = function(t, e, n) {\n            e === void 0 && (e = !1), n === void 0 && (n = !1);\n            var i = {};\n            if (r.ClearCache(), t = t instanceof Array ? t : [t], e || n)\n              for (var o = 0; o < t.length; ++o)\n                n && t[o].getDescendants().forEach(function(a) {\n                  a instanceof Ie.a && t.indexOf(a) < 0 && !a.doNotSerialize && t.push(a);\n                }), e && t[o].parent && t.indexOf(t[o].parent) < 0 && !t[o].parent.doNotSerialize && t.push(t[o].parent);\n            return t.forEach(function(a) {\n              (function(s, d) {\n                if (s.delayLoadState === h.a.DELAYLOADSTATE_LOADED || s.delayLoadState === h.a.DELAYLOADSTATE_NONE) {\n                  if (s.material && !s.material.doNotSerialize)\n                    if (s.material instanceof qi.a) {\n                      if (d.multiMaterials = d.multiMaterials || [], d.materials = d.materials || [], !d.multiMaterials.some(function(B) {\n                        return B.id === s.material.id;\n                      })) {\n                        d.multiMaterials.push(s.material.serialize());\n                        for (var p = function(B) {\n                          B && (d.materials.some(function(F) {\n                            return F.id === B.id;\n                          }) || d.materials.push(B.serialize()));\n                        }, y = 0, P = s.material.subMaterials; y < P.length; y++)\n                          p(P[y]);\n                      }\n                    } else\n                      d.materials = d.materials || [], d.materials.some(function(B) {\n                        return B.id === s.material.id;\n                      }) || d.materials.push(s.material.serialize());\n                  var R = s._geometry;\n                  R && (d.geometries || (d.geometries = {}, d.geometries.boxes = [], d.geometries.spheres = [], d.geometries.cylinders = [], d.geometries.toruses = [], d.geometries.grounds = [], d.geometries.planes = [], d.geometries.torusKnots = [], d.geometries.vertexData = []), Vc(R, d.geometries)), s.skeleton && !s.skeleton.doNotSerialize && (d.skeletons = d.skeletons || [], d.skeletons.push(s.skeleton.serialize())), d.meshes = d.meshes || [], d.meshes.push(qd(s, d));\n                }\n              })(a, i);\n            }), i;\n          }, r;\n        }(), Vg = f(37), kg = function() {\n          function r() {\n          }\n          return r.CreateResizedCopy = function(t, e, n, i) {\n            i === void 0 && (i = !0);\n            var o = t.getScene(), a = o.getEngine(), s = new on(\"resized\" + t.name, { width: e, height: n }, o, !t.noMipmap, !0, t._texture.type, !1, t.samplingMode, !1);\n            s.wrapU = t.wrapU, s.wrapV = t.wrapV, s.uOffset = t.uOffset, s.vOffset = t.vOffset, s.uScale = t.uScale, s.vScale = t.vScale, s.uAng = t.uAng, s.vAng = t.vAng, s.wAng = t.wAng, s.coordinatesIndex = t.coordinatesIndex, s.level = t.level, s.anisotropicFilteringLevel = t.anisotropicFilteringLevel, s._texture.isReady = !1, t.wrapU = Ne.a.CLAMP_ADDRESSMODE, t.wrapV = Ne.a.CLAMP_ADDRESSMODE;\n            var d = new Ri(\"pass\", 1, null, i ? Ne.a.BILINEAR_SAMPLINGMODE : Ne.a.NEAREST_SAMPLINGMODE, a, !1, h.a.TEXTURETYPE_UNSIGNED_INT);\n            return d.getEffect().executeWhenCompiled(function() {\n              d.onApply = function(y) {\n                y.setTexture(\"textureSampler\", t);\n              };\n              var p = s.getInternalTexture();\n              p && (o.postProcessManager.directRender([d], p), a.unBindFramebuffer(p), s.disposeFramebufferObjects(), d.dispose(), p.isReady = !0);\n            }), s;\n          }, r;\n        }(), Gg = function() {\n          function r(t, e) {\n            if (e === void 0 && (e = null), !r.IsSupported(t))\n              throw \"Your browser does not support recording so far.\";\n            var n = t.getRenderingCanvas();\n            if (!n)\n              throw \"The babylon engine must have a canvas to be recorded\";\n            this._canvas = n, this._canvas.isRecording = !1, this._options = Object(c.a)(Object(c.a)({}, r._defaultOptions), e);\n            var i = this._canvas.captureStream(this._options.fps);\n            if (this._options.audioTracks)\n              for (var o = 0, a = this._options.audioTracks; o < a.length; o++) {\n                var s = a[o];\n                i.addTrack(s);\n              }\n            this._mediaRecorder = new MediaRecorder(i, { mimeType: this._options.mimeType }), this._mediaRecorder.ondataavailable = this._handleDataAvailable.bind(this), this._mediaRecorder.onerror = this._handleError.bind(this), this._mediaRecorder.onstop = this._handleStop.bind(this);\n          }\n          return r.IsSupported = function(t) {\n            var e = t.getRenderingCanvas();\n            return !!e && typeof e.captureStream == \"function\";\n          }, Object.defineProperty(r.prototype, \"isRecording\", { get: function() {\n            return !!this._canvas && this._canvas.isRecording;\n          }, enumerable: !1, configurable: !0 }), r.prototype.stopRecording = function() {\n            this._canvas && this._mediaRecorder && this.isRecording && (this._canvas.isRecording = !1, this._mediaRecorder.stop());\n          }, r.prototype.startRecording = function(t, e) {\n            var n = this;\n            if (t === void 0 && (t = \"babylonjs.webm\"), e === void 0 && (e = 7), !this._canvas || !this._mediaRecorder)\n              throw \"Recorder has already been disposed\";\n            if (this.isRecording)\n              throw \"Recording already in progress\";\n            return e > 0 && setTimeout(function() {\n              n.stopRecording();\n            }, 1e3 * e), this._fileName = t, this._recordedChunks = [], this._resolve = null, this._reject = null, this._canvas.isRecording = !0, this._mediaRecorder.start(this._options.recordChunckSize), new Promise(function(i, o) {\n              n._resolve = i, n._reject = o;\n            });\n          }, r.prototype.dispose = function() {\n            this._canvas = null, this._mediaRecorder = null, this._recordedChunks = [], this._fileName = null, this._resolve = null, this._reject = null;\n          }, r.prototype._handleDataAvailable = function(t) {\n            t.data.size > 0 && this._recordedChunks.push(t.data);\n          }, r.prototype._handleError = function(t) {\n            if (this.stopRecording(), !this._reject)\n              throw new t.error();\n            this._reject(t.error);\n          }, r.prototype._handleStop = function() {\n            this.stopRecording();\n            var t = new Blob(this._recordedChunks);\n            this._resolve && this._resolve(t), window.URL.createObjectURL(t), this._fileName && Xe.b.Download(t, this._fileName);\n          }, r._defaultOptions = { mimeType: \"video/webm\", fps: 25, recordChunckSize: 3e3 }, r;\n        }(), yo = function() {\n          function r() {\n          }\n          return r.CreateScreenshot = function(t, e, n, i, o) {\n            o === void 0 && (o = \"image/png\");\n            var a = r._getScreenshotSize(t, e, n), s = a.height, d = a.width;\n            if (s && d) {\n              Xe.b._ScreenshotCanvas || (Xe.b._ScreenshotCanvas = document.createElement(\"canvas\")), Xe.b._ScreenshotCanvas.width = d, Xe.b._ScreenshotCanvas.height = s;\n              var p = Xe.b._ScreenshotCanvas.getContext(\"2d\"), y = t.getRenderWidth() / t.getRenderHeight(), P = d, R = P / y;\n              R > s && (P = (R = s) * y);\n              var B = Math.max(0, d - P) / 2, F = Math.max(0, s - R) / 2, z = t.getRenderingCanvas();\n              p && z && p.drawImage(z, B, F, P, R), Xe.b.EncodeScreenshotCanvasData(i, o);\n            } else\n              l.a.Error(\"Invalid 'size' parameter !\");\n          }, r.CreateScreenshotAsync = function(t, e, n, i) {\n            return i === void 0 && (i = \"image/png\"), new Promise(function(o, a) {\n              r.CreateScreenshot(t, e, n, function(s) {\n                s !== void 0 ? o(s) : a(new Error(\"Data is undefined\"));\n              }, i);\n            });\n          }, r.CreateScreenshotUsingRenderTarget = function(t, e, n, i, o, a, s, d, p, y) {\n            o === void 0 && (o = \"image/png\"), a === void 0 && (a = 1), s === void 0 && (s = !1), p === void 0 && (p = !1), y === void 0 && (y = !1);\n            var P = r._getScreenshotSize(t, e, n), R = P.height, B = P.width, F = { width: B, height: R };\n            if (R && B) {\n              var z = t.getRenderingCanvas();\n              if (z) {\n                var J = { width: z.width, height: z.height };\n                t.setSize(B, R);\n                var ie = e.getScene(), se = null, ce = ie.activeCameras;\n                (ie.activeCamera !== e || ie.activeCameras && ie.activeCameras.length) && (se = ie.activeCamera, ie.activeCamera = e), ie.render();\n                var ue = new on(\"screenShot\", F, ie, !1, !1, h.a.TEXTURETYPE_UNSIGNED_INT, !1, Ne.a.NEAREST_SAMPLINGMODE, void 0, y);\n                ue.renderList = null, ue.samples = a, ue.renderSprites = p, ue.onAfterRenderObservable.add(function() {\n                  Xe.b.DumpFramebuffer(B, R, t, i, o, d);\n                });\n                var fe = function() {\n                  ie.incrementRenderId(), ie.resetCachedMaterial(), ue.render(!0), ue.dispose(), se && (ie.activeCamera = se), ie.activeCameras = ce, t.setSize(J.width, J.height), e.getProjectionMatrix(!0);\n                };\n                if (s) {\n                  var ve = new vo(\"antialiasing\", 1, ie.activeCamera);\n                  ue.addPostProcess(ve), ve.getEffect().isReady() ? fe() : ve.getEffect().onCompiled = function() {\n                    fe();\n                  };\n                } else\n                  fe();\n              } else\n                l.a.Error(\"No rendering canvas found !\");\n            } else\n              l.a.Error(\"Invalid 'size' parameter !\");\n          }, r.CreateScreenshotUsingRenderTargetAsync = function(t, e, n, i, o, a, s, d) {\n            return i === void 0 && (i = \"image/png\"), o === void 0 && (o = 1), a === void 0 && (a = !1), d === void 0 && (d = !1), new Promise(function(p, y) {\n              r.CreateScreenshotUsingRenderTarget(t, e, n, function(P) {\n                P !== void 0 ? p(P) : y(new Error(\"Data is undefined\"));\n              }, i, o, a, s, d);\n            });\n          }, r._getScreenshotSize = function(t, e, n) {\n            var i = 0, o = 0;\n            if (typeof n == \"object\") {\n              var a = n.precision ? Math.abs(n.precision) : 1;\n              n.width && n.height ? (i = n.height * a, o = n.width * a) : n.width && !n.height ? (o = n.width * a, i = Math.round(o / t.getAspectRatio(e))) : n.height && !n.width ? (i = n.height * a, o = Math.round(i * t.getAspectRatio(e))) : (o = Math.round(t.getRenderWidth() * a), i = Math.round(o / t.getAspectRatio(e)));\n            } else\n              isNaN(n) || (i = n, o = n);\n            return o && (o = Math.floor(o)), i && (i = Math.floor(i)), { height: 0 | i, width: 0 | o };\n          }, r;\n        }();\n        Xe.b.CreateScreenshot = yo.CreateScreenshot, Xe.b.CreateScreenshotAsync = yo.CreateScreenshotAsync, Xe.b.CreateScreenshotUsingRenderTarget = yo.CreateScreenshotUsingRenderTarget, Xe.b.CreateScreenshotUsingRenderTargetAsync = yo.CreateScreenshotUsingRenderTargetAsync, function(r) {\n          r[r.Checkbox = 0] = \"Checkbox\", r[r.Slider = 1] = \"Slider\", r[r.Vector3 = 2] = \"Vector3\", r[r.Quaternion = 3] = \"Quaternion\", r[r.Color3 = 4] = \"Color3\", r[r.String = 5] = \"String\";\n        }(wc || (wc = {}));\n        var Dr, zg = f(140), jg = function() {\n          function r(t) {\n            this.byteOffset = 0, this.buffer = t;\n          }\n          return r.prototype.loadAsync = function(t) {\n            var e = this;\n            return this.buffer.readAsync(this.byteOffset, t).then(function(n) {\n              e._dataView = new DataView(n.buffer, n.byteOffset, n.byteLength), e._dataByteOffset = 0;\n            });\n          }, r.prototype.readUint32 = function() {\n            var t = this._dataView.getUint32(this._dataByteOffset, !0);\n            return this._dataByteOffset += 4, this.byteOffset += 4, t;\n          }, r.prototype.readUint8Array = function(t) {\n            var e = new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + this._dataByteOffset, t);\n            return this._dataByteOffset += t, this.byteOffset += t, e;\n          }, r.prototype.readString = function(t) {\n            return Hn.a.Decode(this.readUint8Array(t));\n          }, r.prototype.skipBytes = function(t) {\n            this._dataByteOffset += t, this.byteOffset += t;\n          }, r;\n        }(), Hg = function() {\n          function r() {\n          }\n          return r._GetStorage = function() {\n            try {\n              return localStorage.setItem(\"test\", \"\"), localStorage.removeItem(\"test\"), localStorage;\n            } catch {\n              var t = {};\n              return { getItem: function(n) {\n                var i = t[n];\n                return i === void 0 ? null : i;\n              }, setItem: function(n, i) {\n                t[n] = i;\n              } };\n            }\n          }, r.ReadString = function(t, e) {\n            var n = this._Storage.getItem(t);\n            return n !== null ? n : e;\n          }, r.WriteString = function(t, e) {\n            this._Storage.setItem(t, e);\n          }, r.ReadBoolean = function(t, e) {\n            var n = this._Storage.getItem(t);\n            return n !== null ? n === \"true\" : e;\n          }, r.WriteBoolean = function(t, e) {\n            this._Storage.setItem(t, e ? \"true\" : \"false\");\n          }, r.ReadNumber = function(t, e) {\n            var n = this._Storage.getItem(t);\n            return n !== null ? parseFloat(n) : e;\n          }, r.WriteNumber = function(t, e) {\n            this._Storage.setItem(t, e.toString());\n          }, r._Storage = r._GetStorage(), r;\n        }(), Wg = function() {\n          function r() {\n            this._trackedScene = null;\n          }\n          return r.prototype.track = function(t) {\n            this._trackedScene = t, this._savedJSON = kc.Serialize(t);\n          }, r.prototype.getDelta = function() {\n            if (!this._trackedScene)\n              return null;\n            var t = kc.Serialize(this._trackedScene), e = {};\n            for (var n in t)\n              this._compareCollections(n, this._savedJSON[n], t[n], e);\n            return e;\n          }, r.prototype._compareArray = function(t, e, n, i) {\n            if (e.length === 0 && n.length === 0)\n              return !0;\n            if (e.length && !isNaN(e[0]) || n.length && !isNaN(n[0])) {\n              if (e.length !== n.length)\n                return !1;\n              if (e.length === 0)\n                return !0;\n              for (var o = 0; o < e.length; o++)\n                if (e[o] !== n[o])\n                  return i[t] = n, !1;\n              return !0;\n            }\n            var a = [], s = function() {\n              var P = e[o], R = P.uniqueId;\n              a.push(R);\n              var B = n.filter(function(J) {\n                return J.uniqueId === R;\n              });\n              if (B.length) {\n                var F = B[0], z = {};\n                d._compareObjects(P, F, z) || (i[t] || (i[t] = []), z.__state = { id: F.id || F.name }, i[t].push(z));\n              } else\n                z = { __state: { deleteId: P.id || P.name } }, i[t].push(z);\n            }, d = this;\n            for (o = 0; o < e.length; o++)\n              s();\n            for (o = 0; o < n.length; o++) {\n              var p = n[o], y = p.uniqueId;\n              a.indexOf(y) === -1 && (i[t] || (i[t] = []), i[t].push(p));\n            }\n            return !0;\n          }, r.prototype._compareObjects = function(t, e, n) {\n            var i = !1;\n            for (var o in t)\n              if (t.hasOwnProperty(o)) {\n                var a = t[o], s = e[o], d = !1;\n                Array.isArray(a) ? d = JSON.stringify(a) !== JSON.stringify(s) : isNaN(a) && Object.prototype.toString.call(a) != \"[object String]\" || (d = a !== s), d && (i = !0, n[o] = s);\n              }\n            return !i;\n          }, r.prototype._compareCollections = function(t, e, n, i) {\n            if (e !== n && e && n) {\n              if (Array.isArray(e) && Array.isArray(n)) {\n                if (this._compareArray(t, e, n, i))\n                  return;\n              } else if (typeof e == \"object\" && typeof n == \"object\") {\n                var o = {};\n                return void (this._compareObjects(e, n, o) || (i[t] = o));\n              }\n            }\n          }, r.GetShadowGeneratorById = function(t, e) {\n            for (var n = 0, i = t.lights.map(function(a) {\n              return a.getShadowGenerator();\n            }); n < i.length; n++) {\n              var o = i[n];\n              if (o && o.id === e)\n                return o;\n            }\n            return null;\n          }, r.ApplyDelta = function(t, e) {\n            var n = this;\n            typeof t == \"string\" && (t = JSON.parse(t));\n            var i = e;\n            for (var o in t) {\n              var a = t[o], s = i[o];\n              if (Array.isArray(s) || o === \"shadowGenerators\")\n                switch (o) {\n                  case \"cameras\":\n                    this._ApplyDeltaForEntity(a, e, e.getCameraByID.bind(e), function(d) {\n                      return _t.a.Parse(d, e);\n                    });\n                    break;\n                  case \"lights\":\n                    this._ApplyDeltaForEntity(a, e, e.getLightByID.bind(e), function(d) {\n                      return bi.a.Parse(d, e);\n                    });\n                    break;\n                  case \"shadowGenerators\":\n                    this._ApplyDeltaForEntity(a, e, function(d) {\n                      return n.GetShadowGeneratorById(e, d);\n                    }, function(d) {\n                      return Fn.Parse(d, e);\n                    });\n                    break;\n                  case \"meshes\":\n                    this._ApplyDeltaForEntity(a, e, e.getMeshByID.bind(e), function(d) {\n                      return Ie.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"skeletons\":\n                    this._ApplyDeltaForEntity(a, e, e.getSkeletonById.bind(e), function(d) {\n                      return Ao.Parse(d, e);\n                    });\n                    break;\n                  case \"materials\":\n                    this._ApplyDeltaForEntity(a, e, e.getMaterialByID.bind(e), function(d) {\n                      return zt.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"multiMaterials\":\n                    this._ApplyDeltaForEntity(a, e, e.getMaterialByID.bind(e), function(d) {\n                      return qi.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"transformNodes\":\n                    this._ApplyDeltaForEntity(a, e, e.getTransformNodeByID.bind(e), function(d) {\n                      return pr.a.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"particleSystems\":\n                    this._ApplyDeltaForEntity(a, e, e.getParticleSystemByID.bind(e), function(d) {\n                      return cn.Parse(d, e, \"\");\n                    });\n                    break;\n                  case \"morphTargetManagers\":\n                    this._ApplyDeltaForEntity(a, e, e.getMorphTargetById.bind(e), function(d) {\n                      return Zo.Parse(d, e);\n                    });\n                    break;\n                  case \"postProcesses\":\n                    this._ApplyDeltaForEntity(a, e, e.getPostProcessByName.bind(e), function(d) {\n                      return ft.Parse(d, e, \"\");\n                    });\n                }\n              else\n                isNaN(s) ? s.fromArray && s.fromArray(a) : i[o] = a;\n            }\n          }, r._ApplyPropertiesToEntity = function(t, e) {\n            for (var n in t) {\n              var i = t[n], o = e[n];\n              o !== void 0 && (!isNaN(o) || Array.isArray(o) ? e[n] = i : o.fromArray && o.fromArray(i));\n            }\n          }, r._ApplyDeltaForEntity = function(t, e, n, i) {\n            for (var o = 0, a = t; o < a.length; o++) {\n              var s = a[o];\n              if (s.__state && s.__state.id !== void 0) {\n                var d = n(s.__state.id);\n                d && this._ApplyPropertiesToEntity(s, d);\n              } else if (s.__state && s.__state.deleteId !== void 0) {\n                var p = n(s.__state.deleteId);\n                p == null || p.dispose();\n              } else\n                i(s);\n            }\n          }, r;\n        }();\n        (function(r) {\n          var t = function() {\n            function n(i, o, a, s) {\n              var d;\n              o === void 0 && (o = null), a === void 0 && (a = null), s === void 0 && (s = null), o = o ?? function() {\n                return 1;\n              }, a = a ?? function() {\n                return 1;\n              }, s = s ?? function(P, R) {\n                return P === R ? 0 : 1;\n              }, this._characterToIdx = /* @__PURE__ */ new Map(), this._insertionCosts = new Array(i.length), this._deletionCosts = new Array(i.length), this._substitutionCosts = new Array(i.length);\n              for (var p = 0; p < i.length; ++p) {\n                d = i[p], this._characterToIdx.set(d, p), this._insertionCosts[p] = o(d), this._deletionCosts[p] = a(d), this._substitutionCosts[p] = new Array(i.length);\n                for (var y = p; y < i.length; ++y)\n                  this._substitutionCosts[p][y] = s(d, i[y]);\n              }\n            }\n            return n.prototype.serialize = function() {\n              var i = {}, o = new Array(this._characterToIdx.size);\n              return this._characterToIdx.forEach(function(a, s) {\n                o[a] = s;\n              }), i.characters = o, i.insertionCosts = this._insertionCosts, i.deletionCosts = this._deletionCosts, i.substitutionCosts = this._substitutionCosts, JSON.stringify(i);\n            }, n.Deserialize = function(i) {\n              var o = JSON.parse(i), a = new n(o.characters);\n              return a._insertionCosts = o.insertionCosts, a._deletionCosts = o.deletionCosts, a._substitutionCosts = o.substitutionCosts, a;\n            }, n.prototype.getCharacterIdx = function(i) {\n              return this._characterToIdx.get(i);\n            }, n.prototype.getInsertionCost = function(i) {\n              return this._insertionCosts[i];\n            }, n.prototype.getDeletionCost = function(i) {\n              return this._deletionCosts[i];\n            }, n.prototype.getSubstitutionCost = function(i, o) {\n              var a = Math.min(i, o), s = Math.max(i, o);\n              return this._substitutionCosts[a][s];\n            }, n;\n          }();\n          r.Alphabet = t;\n          var e = function() {\n            function n(i, o) {\n              var a = this;\n              if (i.length > n.MAX_SEQUENCE_LENGTH)\n                throw new Error(\"Sequences longer than \" + n.MAX_SEQUENCE_LENGTH + \" not supported.\");\n              this._alphabet = o, this._characters = i.map(function(s) {\n                return a._alphabet.getCharacterIdx(s);\n              });\n            }\n            return n.prototype.serialize = function() {\n              return JSON.stringify(this._characters);\n            }, n.Deserialize = function(i, o) {\n              var a = new n([], o);\n              return a._characters = JSON.parse(i), a;\n            }, n.prototype.distance = function(i) {\n              return n._distance(this, i);\n            }, n._distance = function(i, o) {\n              var a = i._alphabet;\n              if (a !== o._alphabet)\n                throw new Error(\"Cannot Levenshtein compare Sequences built from different alphabets.\");\n              var s = i._characters, d = o._characters, p = s.length, y = d.length, P = n._costMatrix;\n              P[0][0] = 0;\n              for (var R = 0; R < p; ++R)\n                P[R + 1][0] = P[R][0] + a.getInsertionCost(s[R]);\n              for (R = 0; R < y; ++R)\n                P[0][R + 1] = P[0][R] + a.getInsertionCost(d[R]);\n              for (var B = 0; B < p; ++B)\n                for (var F = 0; F < y; ++F)\n                  n._insertionCost = P[B + 1][F] + a.getInsertionCost(d[F]), n._deletionCost = P[B][F + 1] + a.getDeletionCost(s[B]), n._substitutionCost = P[B][F] + a.getSubstitutionCost(s[B], d[F]), P[B + 1][F + 1] = Math.min(n._insertionCost, n._deletionCost, n._substitutionCost);\n              return P[p][y];\n            }, n.MAX_SEQUENCE_LENGTH = 256, n._costMatrix = Object(c.f)(Array(n.MAX_SEQUENCE_LENGTH + 1)).map(function(i) {\n              return new Array(n.MAX_SEQUENCE_LENGTH + 1);\n            }), n;\n          }();\n          r.Sequence = e;\n        })(Dr || (Dr = {}));\n        var Xg = function() {\n          function r(t) {\n            t === void 0 && (t = 0.01), this._points = [], this._segmentLength = t;\n          }\n          return r.prototype.serialize = function() {\n            return JSON.stringify(this);\n          }, r.Deserialize = function(t) {\n            var e = JSON.parse(t), n = new r(e._segmentLength);\n            return n._points = e._points.map(function(i) {\n              return new u.e(i._x, i._y, i._z);\n            }), n;\n          }, r.prototype.getLength = function() {\n            return this._points.length * this._segmentLength;\n          }, r.prototype.add = function(t) {\n            var e = this, n = this._points.length;\n            if (n === 0)\n              this._points.push(t.clone());\n            else\n              for (var i = function() {\n                return e._segmentLength / u.e.Distance(e._points[n - 1], t);\n              }, o = i(); o <= 1; o = i()) {\n                var a = this._points[n - 1].scale(1 - o);\n                t.scaleAndAddToRef(o, a), this._points.push(a), ++n;\n              }\n          }, r.prototype.resampleAtTargetResolution = function(t) {\n            var e = new r(this.getLength() / t);\n            return this._points.forEach(function(n) {\n              e.add(n);\n            }), e;\n          }, r.prototype.tokenize = function(t) {\n            for (var e = [], n = new u.e(), i = 2; i < this._points.length; ++i)\n              r._transformSegmentDirToRef(this._points[i - 2], this._points[i - 1], this._points[i], n) && e.push(r._tokenizeSegment(n, t));\n            return e;\n          }, r._transformSegmentDirToRef = function(t, e, n, i) {\n            return e.subtractToRef(t, r._forwardDir), r._forwardDir.normalize(), e.scaleToRef(-1, r._inverseFromVec), r._inverseFromVec.normalize(), !(Math.abs(u.e.Dot(r._forwardDir, r._inverseFromVec)) > 0.98) && (u.e.CrossToRef(r._forwardDir, r._inverseFromVec, r._upDir), r._upDir.normalize(), u.a.LookAtLHToRef(t, e, r._upDir, r._lookMatrix), n.subtractToRef(e, r._fromToVec), r._fromToVec.normalize(), u.e.TransformNormalToRef(r._fromToVec, r._lookMatrix, i), !0);\n          }, r._tokenizeSegment = function(t, e) {\n            r._bestMatch = 0, r._score = u.e.Dot(t, e[0]), r._bestScore = r._score;\n            for (var n = 1; n < e.length; ++n)\n              r._score = u.e.Dot(t, e[n]), r._score > r._bestScore && (r._bestMatch = n, r._bestScore = r._score);\n            return r._bestMatch;\n          }, r._forwardDir = new u.e(), r._inverseFromVec = new u.e(), r._upDir = new u.e(), r._fromToVec = new u.e(), r._lookMatrix = new u.a(), r;\n        }(), Zd = function() {\n          function r(t) {\n            this.chars = new Array(t);\n          }\n          return r.Generate = function(t, e, n, i, o) {\n            t === void 0 && (t = 64), e === void 0 && (e = 256), n === void 0 && (n = 0.1), i === void 0 && (i = 1e-3), o === void 0 && (o = []);\n            for (var a, s, d = new r(t), p = 0; p < t; ++p)\n              d.chars[p] = new u.e(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5), d.chars[p].normalize();\n            for (p = 0; p < o.length; ++p)\n              d.chars[p].copyFrom(o[p]);\n            for (var y, P = new u.e(), R = new u.e(), B = 0; B < e; ++B) {\n              a = (1 - (y = B / (e - 1))) * n + y * i;\n              var F = function(z) {\n                P.copyFromFloats(0, 0, 0), d.chars.forEach(function(J) {\n                  d.chars[z].subtractToRef(J, R), (s = R.lengthSquared()) > 1e-6 && R.scaleAndAddToRef(1 / (R.lengthSquared() * s), P);\n                }), P.scaleInPlace(a), d.chars[z].addInPlace(P), d.chars[z].normalize();\n              };\n              for (p = o.length; p < d.chars.length; ++p)\n                F(p);\n            }\n            return d;\n          }, r.prototype.serialize = function() {\n            return JSON.stringify(this.chars);\n          }, r.Deserialize = function(t) {\n            for (var e = JSON.parse(t), n = new r(e.length), i = 0; i < e.length; ++i)\n              n.chars[i] = new u.e(e[i]._x, e[i]._y, e[i]._z);\n            return n;\n          }, r;\n        }(), Gc = function() {\n          function r() {\n            this._sequences = [];\n          }\n          return r.prototype.serialize = function() {\n            return JSON.stringify(this._sequences.map(function(t) {\n              return t.serialize();\n            }));\n          }, r.Deserialize = function(t, e) {\n            var n = new r();\n            return n._sequences = JSON.parse(t).map(function(i) {\n              return Dr.Sequence.Deserialize(i, e);\n            }), n;\n          }, r.CreateFromTrajectory = function(t, e, n) {\n            return r.CreateFromTokenizationPyramid(r._getTokenizationPyramid(t, e), n);\n          }, r.CreateFromTokenizationPyramid = function(t, e) {\n            var n = new r();\n            return n._sequences = t.map(function(i) {\n              return new Dr.Sequence(i, e);\n            }), n;\n          }, r._getTokenizationPyramid = function(t, e, n) {\n            n === void 0 && (n = r.FINEST_DESCRIPTOR_RESOLUTION);\n            for (var i = [], o = n; o > 4; o = Math.floor(o / 2))\n              i.push(t.resampleAtTargetResolution(o).tokenize(e.chars));\n            return i;\n          }, r.prototype.distance = function(t) {\n            for (var e = 0, n = 0; n < this._sequences.length; ++n)\n              e += Math.pow(2, n) * this._sequences[n].distance(t._sequences[n]);\n            return e;\n          }, r.FINEST_DESCRIPTOR_RESOLUTION = 32, r;\n        }(), Jd = function() {\n          function r(t) {\n            t === void 0 && (t = []), this._descriptors = t, this._centroidIdx = -1, this._averageDistance = 0, this._refreshDescription();\n          }\n          return r.prototype.serialize = function() {\n            var t = {};\n            return t.descriptors = this._descriptors.map(function(e) {\n              return e.serialize();\n            }), t.centroidIdx = this._centroidIdx, t.averageDistance = this._averageDistance, JSON.stringify(t);\n          }, r.Deserialize = function(t, e) {\n            var n = JSON.parse(t), i = new r();\n            return i._descriptors = n.descriptors.map(function(o) {\n              return Gc.Deserialize(o, e);\n            }), i._centroidIdx = n.centroidIdx, i._averageDistance = n.averageDistance, i;\n          }, r.prototype.add = function(t) {\n            this._descriptors.push(t), this._refreshDescription();\n          }, r.prototype.getMatchCost = function(t) {\n            return t.distance(this._descriptors[this._centroidIdx]) / this._averageDistance;\n          }, r.prototype.getMatchMinimumDistance = function(t) {\n            return Math.min.apply(Math, this._descriptors.map(function(e) {\n              return e.distance(t);\n            }));\n          }, r.prototype._refreshDescription = function() {\n            var t, e = this;\n            this._centroidIdx = -1;\n            for (var n = this._descriptors.map(function(o) {\n              return t = 0, e._descriptors.forEach(function(a) {\n                t += o.distance(a);\n              }), t;\n            }), i = 0; i < n.length; ++i)\n              (this._centroidIdx < 0 || n[i] < n[this._centroidIdx]) && (this._centroidIdx = i);\n            this._averageDistance = 0, this._descriptors.forEach(function(o) {\n              e._averageDistance += o.distance(e._descriptors[e._centroidIdx]);\n            }), this._descriptors.length > 0 && (this._averageDistance = Math.max(this._averageDistance / this._descriptors.length, r.MIN_AVERAGE_DISTANCE));\n          }, r.MIN_AVERAGE_DISTANCE = 1, r;\n        }(), Yg = function() {\n          function r() {\n            this._maximumAllowableMatchCost = 4, this._nameToDescribedTrajectory = /* @__PURE__ */ new Map();\n          }\n          return r.prototype.serialize = function() {\n            var t = {};\n            return t.maximumAllowableMatchCost = this._maximumAllowableMatchCost, t.vector3Alphabet = this._vector3Alphabet.serialize(), t.levenshteinAlphabet = this._levenshteinAlphabet.serialize(), t.nameToDescribedTrajectory = [], this._nameToDescribedTrajectory.forEach(function(e, n) {\n              t.nameToDescribedTrajectory.push(n), t.nameToDescribedTrajectory.push(e.serialize());\n            }), JSON.stringify(t);\n          }, r.Deserialize = function(t) {\n            var e = JSON.parse(t), n = new r();\n            n._maximumAllowableMatchCost = e.maximumAllowableMatchCost, n._vector3Alphabet = Zd.Deserialize(e.vector3Alphabet), n._levenshteinAlphabet = Dr.Alphabet.Deserialize(e.levenshteinAlphabet);\n            for (var i = 0; i < e.nameToDescribedTrajectory.length; i += 2)\n              n._nameToDescribedTrajectory.set(e.nameToDescribedTrajectory[i], Jd.Deserialize(e.nameToDescribedTrajectory[i + 1], n._levenshteinAlphabet));\n            return n;\n          }, r.Generate = function() {\n            for (var t = Zd.Generate(64, 256, 0.1, 1e-3, [u.e.Forward()]), e = new Array(t.chars.length), n = 0; n < e.length; ++n)\n              e[n] = n;\n            var i = new Dr.Alphabet(e, function(a) {\n              return a === 0 ? 0 : 1;\n            }, function(a) {\n              return a === 0 ? 0 : 1;\n            }, function(a, s) {\n              return Math.min(1 - u.e.Dot(t.chars[a], t.chars[s]), 1);\n            }), o = new r();\n            return o._vector3Alphabet = t, o._levenshteinAlphabet = i, o;\n          }, r.prototype.addTrajectoryToClassification = function(t, e) {\n            this._nameToDescribedTrajectory.has(e) || this._nameToDescribedTrajectory.set(e, new Jd()), this._nameToDescribedTrajectory.get(e).add(Gc.CreateFromTrajectory(t, this._vector3Alphabet, this._levenshteinAlphabet));\n          }, r.prototype.deleteClassification = function(t) {\n            return this._nameToDescribedTrajectory.delete(t);\n          }, r.prototype.classifyTrajectory = function(t) {\n            var e = this, n = Gc.CreateFromTrajectory(t, this._vector3Alphabet, this._levenshteinAlphabet), i = [];\n            if (this._nameToDescribedTrajectory.forEach(function(p, y) {\n              p.getMatchCost(n) < e._maximumAllowableMatchCost && i.push(y);\n            }), i.length === 0)\n              return null;\n            for (var o, a = 0, s = this._nameToDescribedTrajectory.get(i[a]).getMatchMinimumDistance(n), d = 0; d < i.length; ++d)\n              (o = this._nameToDescribedTrajectory.get(i[d]).getMatchMinimumDistance(n)) < s && (s = o, a = d);\n            return i[a];\n          }, r;\n        }(), Kg = f(150), Ea = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i.options = n, i._direction = new u.e(0, 0, -1), i._mat = new u.a(), i._onSelectEnabled = !1, i._origin = new u.e(0, 0, 0), i.lastNativeXRHitResults = [], i.onHitTestResultObservable = new C.c(), i._onHitTestResults = function(o) {\n              var a = o.map(function(s) {\n                var d = u.a.FromArray(s.hitMatrix);\n                return i._xrSessionManager.scene.useRightHandedSystem || d.toggleModelMatrixHandInPlace(), i.options.worldParentNode && d.multiplyToRef(i.options.worldParentNode.getWorldMatrix(), d), { xrHitResult: s, transformationMatrix: d };\n              });\n              i.lastNativeXRHitResults = o, i.onHitTestResultObservable.notifyObservers(a);\n            }, i._onSelect = function(o) {\n              i._onSelectEnabled && t.XRHitTestWithSelectEvent(o, i._xrSessionManager.referenceSpace);\n            }, i.xrNativeFeatureName = \"hit-test\", Xe.b.Warn(\"A newer version of this plugin is available\"), i;\n          }\n          return Object(c.d)(t, r), t.XRHitTestWithRay = function(e, n, i, o) {\n            return e.requestHitTest(n, i).then(function(a) {\n              var s = o || function(d) {\n                return !!d.hitMatrix;\n              };\n              return a.filter(s);\n            });\n          }, t.XRHitTestWithSelectEvent = function(e, n) {\n            var i = e.frame.getPose(e.inputSource.targetRaySpace, n);\n            if (!i)\n              return Promise.resolve([]);\n            var o = new XRRay(i.transform);\n            return this.XRHitTestWithRay(e.frame.session, o, n);\n          }, t.prototype.attach = function() {\n            return !!r.prototype.attach.call(this) && (this.options.testOnPointerDownOnly && this._xrSessionManager.session.addEventListener(\"select\", this._onSelect, !1), !0);\n          }, t.prototype.detach = function() {\n            return !!r.prototype.detach.call(this) && (this._onSelectEnabled = !1, this._xrSessionManager.session.removeEventListener(\"select\", this._onSelect), !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onHitTestResultObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            if (this.attached && !this.options.testOnPointerDownOnly) {\n              var n = e.getViewerPose(this._xrSessionManager.referenceSpace);\n              if (n) {\n                u.a.FromArrayToRef(n.transform.matrix, 0, this._mat), u.e.TransformCoordinatesFromFloatsToRef(0, 0, 0, this._mat, this._origin), u.e.TransformCoordinatesFromFloatsToRef(0, 0, -1, this._mat, this._direction), this._direction.subtractInPlace(this._origin), this._direction.normalize();\n                var i = new XRRay({ x: this._origin.x, y: this._origin.y, z: this._origin.z, w: 0 }, { x: this._direction.x, y: this._direction.y, z: this._direction.z, w: 0 });\n                t.XRHitTestWithRay(this._xrSessionManager.session, i, this._xrSessionManager.referenceSpace).then(this._onHitTestResults);\n              }\n            }\n          }, t.Name = ti.HIT_TEST, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Ea.Name, function(r, t) {\n          return function() {\n            return new Ea(r, t);\n          };\n        }, Ea.Version, !1);\n        var Qg = 0, Sa = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i._options = n, i._lastFrameDetected = /* @__PURE__ */ new Set(), i._trackedAnchors = [], i._futureAnchors = [], i.onAnchorAddedObservable = new C.c(), i.onAnchorRemovedObservable = new C.c(), i.onAnchorUpdatedObservable = new C.c(), i._tmpVector = new u.e(), i._tmpQuaternion = new u.b(), i.xrNativeFeatureName = \"anchors\", i;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"referenceSpaceForFrameAnchors\", { set: function(e) {\n            this._referenceSpaceForFrameAnchors = e;\n          }, enumerable: !1, configurable: !0 }), t.prototype._populateTmpTransformation = function(e, n) {\n            return this._tmpVector.copyFrom(e), this._tmpQuaternion.copyFrom(n), this._xrSessionManager.scene.useRightHandedSystem || (this._tmpVector.z *= -1, this._tmpQuaternion.z *= -1, this._tmpQuaternion.w *= -1), { position: this._tmpVector, rotationQuaternion: this._tmpQuaternion };\n          }, t.prototype.addAnchorPointUsingHitTestResultAsync = function(e, n, i) {\n            return n === void 0 && (n = new u.e()), i === void 0 && (i = new u.b()), Object(c.b)(this, void 0, void 0, function() {\n              var o, a, s, d = this;\n              return Object(c.e)(this, function(p) {\n                switch (p.label) {\n                  case 0:\n                    if (this._populateTmpTransformation(n, i), o = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w }), e.xrHitResult.createAnchor)\n                      return [3, 1];\n                    throw this.detach(), new Error(\"Anchors not enabled in this environment/browser\");\n                  case 1:\n                    return p.trys.push([1, 3, , 4]), [4, e.xrHitResult.createAnchor(o)];\n                  case 2:\n                    return a = p.sent(), [2, new Promise(function(y, P) {\n                      d._futureAnchors.push({ nativeAnchor: a, resolved: !1, submitted: !0, xrTransformation: o, resolve: y, reject: P });\n                    })];\n                  case 3:\n                    throw s = p.sent(), new Error(s);\n                  case 4:\n                    return [2];\n                }\n              });\n            });\n          }, t.prototype.addAnchorAtPositionAndRotationAsync = function(e, n, i) {\n            return n === void 0 && (n = new u.b()), i === void 0 && (i = !1), Object(c.b)(this, void 0, void 0, function() {\n              var o, a, s, d = this;\n              return Object(c.e)(this, function(p) {\n                switch (p.label) {\n                  case 0:\n                    return this._populateTmpTransformation(e, n), o = new XRRigidTransform({ x: this._tmpVector.x, y: this._tmpVector.y, z: this._tmpVector.z }, { x: this._tmpQuaternion.x, y: this._tmpQuaternion.y, z: this._tmpQuaternion.z, w: this._tmpQuaternion.w }), i && this.attached && this._xrSessionManager.currentFrame ? [4, this._createAnchorAtTransformation(o, this._xrSessionManager.currentFrame)] : [3, 2];\n                  case 1:\n                    return s = p.sent(), [3, 3];\n                  case 2:\n                    s = void 0, p.label = 3;\n                  case 3:\n                    return a = s, [2, new Promise(function(y, P) {\n                      d._futureAnchors.push({ nativeAnchor: a, resolved: !1, submitted: !1, xrTransformation: o, resolve: y, reject: P });\n                    })];\n                }\n              });\n            });\n          }, Object.defineProperty(t.prototype, \"anchors\", { get: function() {\n            return this._trackedAnchors;\n          }, enumerable: !1, configurable: !0 }), t.prototype.detach = function() {\n            if (!r.prototype.detach.call(this))\n              return !1;\n            if (!this._options.doNotRemoveAnchorsOnSessionEnded)\n              for (; this._trackedAnchors.length; ) {\n                var e = this._trackedAnchors.pop();\n                if (e) {\n                  try {\n                    e.remove();\n                  } catch {\n                  }\n                  this.onAnchorRemovedObservable.notifyObservers(e);\n                }\n              }\n            return !0;\n          }, t.prototype.dispose = function() {\n            this._futureAnchors.length = 0, r.prototype.dispose.call(this), this.onAnchorAddedObservable.clear(), this.onAnchorRemovedObservable.clear(), this.onAnchorUpdatedObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            if (this.attached && e) {\n              var i = e.trackedAnchors;\n              if (i) {\n                var o = this._trackedAnchors.filter(function(s) {\n                  return !i.has(s.xrAnchor);\n                }).map(function(s) {\n                  return n._trackedAnchors.indexOf(s);\n                }), a = 0;\n                o.forEach(function(s) {\n                  var d = n._trackedAnchors.splice(s - a, 1)[0];\n                  n.onAnchorRemovedObservable.notifyObservers(d), a++;\n                }), i.forEach(function(s) {\n                  if (n._lastFrameDetected.has(s)) {\n                    var d = n._findIndexInAnchorArray(s);\n                    y = n._trackedAnchors[d];\n                    try {\n                      n._updateAnchorWithXRFrame(s, y, e), y.attachedNode && (y.attachedNode.rotationQuaternion = y.attachedNode.rotationQuaternion || new u.b(), y.transformationMatrix.decompose(y.attachedNode.scaling, y.attachedNode.rotationQuaternion, y.attachedNode.position)), n.onAnchorUpdatedObservable.notifyObservers(y);\n                    } catch {\n                      Xe.b.Warn(\"Anchor could not be updated\");\n                    }\n                  } else {\n                    var p = { id: Qg++, xrAnchor: s, remove: s.delete }, y = n._updateAnchorWithXRFrame(s, p, e);\n                    n._trackedAnchors.push(y), n.onAnchorAddedObservable.notifyObservers(y);\n                    var P = n._futureAnchors.filter(function(R) {\n                      return R.nativeAnchor === s;\n                    })[0];\n                    P && (P.resolve(y), P.resolved = !0);\n                  }\n                }), this._lastFrameDetected = i;\n              }\n              this._futureAnchors.forEach(function(s) {\n                s.resolved || s.submitted || (n._createAnchorAtTransformation(s.xrTransformation, e).then(function(d) {\n                  s.nativeAnchor = d;\n                }, function(d) {\n                  s.resolved = !0, s.reject(d);\n                }), s.submitted = !0);\n              });\n            }\n          }, t.prototype._findIndexInAnchorArray = function(e) {\n            for (var n = 0; n < this._trackedAnchors.length; ++n)\n              if (this._trackedAnchors[n].xrAnchor === e)\n                return n;\n            return -1;\n          }, t.prototype._updateAnchorWithXRFrame = function(e, n, i) {\n            var o = i.getPose(e.anchorSpace, this._xrSessionManager.referenceSpace);\n            if (o) {\n              var a = n.transformationMatrix || new u.a();\n              u.a.FromArrayToRef(o.transform.matrix, 0, a), this._xrSessionManager.scene.useRightHandedSystem || a.toggleModelMatrixHandInPlace(), n.transformationMatrix = a, this._options.worldParentNode && a.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), a);\n            }\n            return n;\n          }, t.prototype._createAnchorAtTransformation = function(e, n) {\n            var i;\n            return Object(c.b)(this, void 0, void 0, function() {\n              return Object(c.e)(this, function(o) {\n                if (!n.createAnchor)\n                  throw this.detach(), new Error(\"Anchors are not enabled in your browser\");\n                try {\n                  return [2, n.createAnchor(e, (i = this._referenceSpaceForFrameAnchors) !== null && i !== void 0 ? i : this._xrSessionManager.referenceSpace)];\n                } catch (a) {\n                  throw new Error(a);\n                }\n                return [2];\n              });\n            });\n          }, t.Name = ti.ANCHOR_SYSTEM, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Sa.Name, function(r, t) {\n          return function() {\n            return new Sa(r, t);\n          };\n        }, Sa.Version);\n        var qg = 0, Aa = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i._options = n, i._detectedPlanes = [], i._enabled = !1, i._lastFrameDetected = /* @__PURE__ */ new Set(), i.onPlaneAddedObservable = new C.c(), i.onPlaneRemovedObservable = new C.c(), i.onPlaneUpdatedObservable = new C.c(), i.xrNativeFeatureName = \"plane-detection\", i._xrSessionManager.session ? i._init() : i._xrSessionManager.onXRSessionInit.addOnce(function() {\n              i._init();\n            }), i;\n          }\n          return Object(c.d)(t, r), t.prototype.detach = function() {\n            if (!r.prototype.detach.call(this))\n              return !1;\n            if (!this._options.doNotRemovePlanesOnSessionEnded)\n              for (; this._detectedPlanes.length; ) {\n                var e = this._detectedPlanes.pop();\n                e && this.onPlaneRemovedObservable.notifyObservers(e);\n              }\n            return !0;\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onPlaneAddedObservable.clear(), this.onPlaneRemovedObservable.clear(), this.onPlaneUpdatedObservable.clear();\n          }, t.prototype.isCompatible = function() {\n            return typeof XRPlane < \"u\";\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            if (this.attached && this._enabled && e) {\n              var i = e.worldInformation.detectedPlanes;\n              if (i) {\n                var o = this._detectedPlanes.filter(function(s) {\n                  return !i.has(s.xrPlane);\n                }).map(function(s) {\n                  return n._detectedPlanes.indexOf(s);\n                }), a = 0;\n                o.forEach(function(s) {\n                  var d = n._detectedPlanes.splice(s - a, 1)[0];\n                  n.onPlaneRemovedObservable.notifyObservers(d), a++;\n                }), i.forEach(function(s) {\n                  if (n._lastFrameDetected.has(s)) {\n                    if (s.lastChangedTime === n._xrSessionManager.currentTimestamp) {\n                      var d = n.findIndexInPlaneArray(s);\n                      y = n._detectedPlanes[d], n._updatePlaneWithXRPlane(s, y, e), n.onPlaneUpdatedObservable.notifyObservers(y);\n                    }\n                  } else {\n                    var p = { id: qg++, xrPlane: s, polygonDefinition: [] }, y = n._updatePlaneWithXRPlane(s, p, e);\n                    n._detectedPlanes.push(y), n.onPlaneAddedObservable.notifyObservers(y);\n                  }\n                }), this._lastFrameDetected = i;\n              }\n            }\n          }, t.prototype._init = function() {\n            var e, n, i = this, o = function() {\n              i._enabled = !0, i._detectedPlanes.length && (i._detectedPlanes.length = 0);\n            };\n            this._xrSessionManager.session.updateWorldTrackingState ? (this._xrSessionManager.session.updateWorldTrackingState({ planeDetectionState: { enabled: !0 } }), o()) : !((n = (e = this._xrSessionManager.session.worldTrackingState) === null || e === void 0 ? void 0 : e.planeDetectionState) === null || n === void 0) && n.enabled && o();\n          }, t.prototype._updatePlaneWithXRPlane = function(e, n, i) {\n            var o = this;\n            n.polygonDefinition = e.polygon.map(function(d) {\n              var p = o._xrSessionManager.scene.useRightHandedSystem ? 1 : -1;\n              return new u.e(d.x, d.y, d.z * p);\n            });\n            var a = i.getPose(e.planeSpace, this._xrSessionManager.referenceSpace);\n            if (a) {\n              var s = n.transformationMatrix || new u.a();\n              u.a.FromArrayToRef(a.transform.matrix, 0, s), this._xrSessionManager.scene.useRightHandedSystem || s.toggleModelMatrixHandInPlace(), n.transformationMatrix = s, this._options.worldParentNode && s.multiplyToRef(this._options.worldParentNode.getWorldMatrix(), s);\n            }\n            return n;\n          }, t.prototype.findIndexInPlaneArray = function(e) {\n            for (var n = 0; n < this._detectedPlanes.length; ++n)\n              if (this._detectedPlanes[n].xrPlane === e)\n                return n;\n            return -1;\n          }, t.Name = ti.PLANE_DETECTION, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Aa.Name, function(r, t) {\n          return function() {\n            return new Aa(r, t);\n          };\n        }, Aa.Version);\n        var Pa = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i.options = n, i.onBackgroundStateChangedObservable = new C.c(), i;\n          }\n          return Object(c.d)(t, r), t.prototype.attach = function() {\n            return this._setBackgroundState(!1), r.prototype.attach.call(this);\n          }, t.prototype.detach = function() {\n            return this._setBackgroundState(!0), r.prototype.detach.call(this);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onBackgroundStateChangedObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n          }, t.prototype._setBackgroundState = function(e) {\n            var n = this._xrSessionManager.scene;\n            if (!this.options.ignoreEnvironmentHelper)\n              if (this.options.environmentHelperRemovalFlags) {\n                if (this.options.environmentHelperRemovalFlags.skyBox) {\n                  var i = n.getMeshByName(\"BackgroundSkybox\");\n                  i && i.setEnabled(e);\n                }\n                if (this.options.environmentHelperRemovalFlags.ground) {\n                  var o = n.getMeshByName(\"BackgroundPlane\");\n                  o && o.setEnabled(e);\n                }\n              } else {\n                var a = n.getMeshByName(\"BackgroundHelper\");\n                a && a.setEnabled(e);\n              }\n            this.options.backgroundMeshes && this.options.backgroundMeshes.forEach(function(s) {\n              return s.setEnabled(e);\n            }), this.onBackgroundStateChangedObservable.notifyObservers(e);\n          }, t.Name = ti.BACKGROUND_REMOVER, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Pa.Name, function(r, t) {\n          return function() {\n            return new Pa(r, t);\n          };\n        }, Pa.Version, !0);\n        var Zg = function() {\n        }, xa = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i._options = n, i._attachController = function(o) {\n              if (!i._controllers[o.uniqueId])\n                if (i._xrSessionManager.scene.isPhysicsEnabled() || l.a.Warn(\"physics engine not enabled, skipped. Please add this controller manually.\"), i._options.physicsProperties.useControllerMesh && o.inputSource.gamepad)\n                  o.onMotionControllerInitObservable.addOnce(function(P) {\n                    P.onModelLoadedObservable.addOnce(function() {\n                      var R = new At.a(P.rootMesh, At.a.MeshImpostor, Object(c.a)({ mass: 0 }, i._options.physicsProperties)), B = o.grip || o.pointer;\n                      i._controllers[o.uniqueId] = { xrController: o, impostor: R, oldPos: B.position.clone(), oldRotation: B.rotationQuaternion.clone() };\n                    });\n                  });\n                else {\n                  var a = i._options.physicsProperties.impostorType || At.a.SphereImpostor, s = i._options.physicsProperties.impostorSize || 0.1, d = Nn.a.CreateSphere(\"impostor-mesh-\" + o.uniqueId, { diameterX: typeof s == \"number\" ? s : s.width, diameterY: typeof s == \"number\" ? s : s.height, diameterZ: typeof s == \"number\" ? s : s.depth });\n                  d.isVisible = i._debugMode, d.isPickable = !1, d.rotationQuaternion = new u.b();\n                  var p = o.grip || o.pointer;\n                  d.position.copyFrom(p.position), d.rotationQuaternion.copyFrom(p.rotationQuaternion);\n                  var y = new At.a(d, a, Object(c.a)({ mass: 0 }, i._options.physicsProperties));\n                  i._controllers[o.uniqueId] = { xrController: o, impostor: y, impostorMesh: d };\n                }\n            }, i._controllers = {}, i._debugMode = !1, i._delta = 0, i._lastTimestamp = 0, i._tmpQuaternion = new u.b(), i._tmpVector = new u.e(), i._options.physicsProperties || (i._options.physicsProperties = {}), i;\n          }\n          return Object(c.d)(t, r), t.prototype._enablePhysicsDebug = function() {\n            var e = this;\n            this._debugMode = !0, Object.keys(this._controllers).forEach(function(n) {\n              var i = e._controllers[n];\n              i.impostorMesh && (i.impostorMesh.isVisible = !0);\n            });\n          }, t.prototype.addController = function(e) {\n            this._attachController(e);\n          }, t.prototype.attach = function() {\n            var e = this;\n            if (!r.prototype.attach.call(this))\n              return !1;\n            if (!this._options.xrInput)\n              return !0;\n            if (this._options.xrInput.controllers.forEach(this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerAddedObservable, this._attachController), this._addNewAttachObserver(this._options.xrInput.onControllerRemovedObservable, function(o) {\n              e._detachController(o.uniqueId);\n            }), this._options.enableHeadsetImpostor) {\n              var n = this._options.headsetImpostorParams || { impostorType: At.a.SphereImpostor, restitution: 0.8, impostorSize: 0.3 }, i = n.impostorSize || 0.3;\n              this._headsetMesh = Nn.a.CreateSphere(\"headset-mesh\", { diameterX: typeof i == \"number\" ? i : i.width, diameterY: typeof i == \"number\" ? i : i.height, diameterZ: typeof i == \"number\" ? i : i.depth }), this._headsetMesh.rotationQuaternion = new u.b(), this._headsetMesh.isVisible = !1, this._headsetImpostor = new At.a(this._headsetMesh, n.impostorType, Object(c.a)({ mass: 0 }, n));\n            }\n            return !0;\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._controllers).forEach(function(n) {\n              e._detachController(n);\n            }), this._headsetMesh && this._headsetMesh.dispose(), !0);\n          }, t.prototype.getHeadsetImpostor = function() {\n            return this._headsetImpostor;\n          }, t.prototype.getImpostorForController = function(e) {\n            var n = typeof e == \"string\" ? e : e.uniqueId;\n            return this._controllers[n] ? this._controllers[n].impostor : null;\n          }, t.prototype.setPhysicsProperties = function(e) {\n            this._options.physicsProperties = Object(c.a)(Object(c.a)({}, this._options.physicsProperties), e);\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            this._delta = this._xrSessionManager.currentTimestamp - this._lastTimestamp, this._lastTimestamp = this._xrSessionManager.currentTimestamp, this._headsetMesh && (this._headsetMesh.position.copyFrom(this._options.xrInput.xrCamera.position), this._headsetMesh.rotationQuaternion.copyFrom(this._options.xrInput.xrCamera.rotationQuaternion)), Object.keys(this._controllers).forEach(function(i) {\n              var o = n._controllers[i], a = o.xrController.grip || o.xrController.pointer, s = o.oldPos || o.impostorMesh.position, d = o.oldRotation || o.impostorMesh.rotationQuaternion;\n              if (a.position.subtractToRef(s, n._tmpVector), n._tmpVector.scaleInPlace(1e3 / n._delta), o.impostor.setLinearVelocity(n._tmpVector), n._debugMode && console.log(n._tmpVector, \"linear\"), !d.equalsWithEpsilon(a.rotationQuaternion)) {\n                d.conjugateInPlace().multiplyToRef(a.rotationQuaternion, n._tmpQuaternion);\n                var p = Math.sqrt(n._tmpQuaternion.x * n._tmpQuaternion.x + n._tmpQuaternion.y * n._tmpQuaternion.y + n._tmpQuaternion.z * n._tmpQuaternion.z);\n                if (n._tmpVector.set(n._tmpQuaternion.x, n._tmpQuaternion.y, n._tmpQuaternion.z), p < 1e-3)\n                  n._tmpVector.scaleInPlace(2);\n                else {\n                  var y = 2 * Math.atan2(p, n._tmpQuaternion.w);\n                  n._tmpVector.scaleInPlace(y / (p * (n._delta / 1e3)));\n                }\n                o.impostor.setAngularVelocity(n._tmpVector), n._debugMode && console.log(n._tmpVector, n._tmpQuaternion, \"angular\");\n              }\n              s.copyFrom(a.position), d.copyFrom(a.rotationQuaternion);\n            });\n          }, t.prototype._detachController = function(e) {\n            var n = this._controllers[e];\n            n && (n.impostorMesh && n.impostorMesh.dispose(), delete this._controllers[e]);\n          }, t.Name = ti.PHYSICS_CONTROLLERS, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(xa.Name, function(r, t) {\n          return function() {\n            return new xa(r, t);\n          };\n        }, xa.Version, !0);\n        var Ca = function(r) {\n          function t(e, n) {\n            n === void 0 && (n = {});\n            var i = r.call(this, e) || this;\n            return i.options = n, i._tmpMat = new u.a(), i._tmpPos = new u.e(), i._tmpQuat = new u.b(), i.initHitTestSource = function(o) {\n              if (o) {\n                var a = new XRRay(i.options.offsetRay || {}), s = { space: i.options.useReferenceSpace ? o : i._xrSessionManager.viewerReferenceSpace, offsetRay: a };\n                i.options.entityTypes && (s.entityTypes = i.options.entityTypes), s.space ? i._xrSessionManager.session.requestHitTestSource(s).then(function(d) {\n                  i._xrHitTestSource && i._xrHitTestSource.cancel(), i._xrHitTestSource = d;\n                }) : Xe.b.Warn(\"waiting for viewer reference space to initialize\");\n              }\n            }, i.autoCloneTransformation = !1, i.onHitTestResultObservable = new C.c(), i.paused = !1, i.xrNativeFeatureName = \"hit-test\", Xe.b.Warn(\"Hit test is an experimental and unstable feature.\"), i;\n          }\n          return Object(c.d)(t, r), t.prototype.attach = function() {\n            var e = this;\n            if (!r.prototype.attach.call(this) || !this._xrSessionManager.session.requestHitTestSource)\n              return !1;\n            if (this.options.disablePermanentHitTest || (this._xrSessionManager.referenceSpace && this.initHitTestSource(this._xrSessionManager.referenceSpace), this._xrSessionManager.onXRReferenceSpaceChanged.add(this.initHitTestSource)), this.options.enableTransientHitTest) {\n              var n = new XRRay(this.options.transientOffsetRay || {});\n              this._xrSessionManager.session.requestHitTestSourceForTransientInput({ profile: \"generic-touchscreen\", offsetRay: n, entityTypes: this.options.entityTypes }).then(function(i) {\n                e._transientXrHitTestSource = i;\n              });\n            }\n            return !0;\n          }, t.prototype.detach = function() {\n            return !!r.prototype.detach.call(this) && (this._xrHitTestSource && (this._xrHitTestSource.cancel(), this._xrHitTestSource = null), this._xrSessionManager.onXRReferenceSpaceChanged.removeCallback(this.initHitTestSource), this._transientXrHitTestSource && (this._transientXrHitTestSource.cancel(), this._transientXrHitTestSource = null), !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onHitTestResultObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            if (this.attached && !this.paused) {\n              if (this._xrHitTestSource) {\n                var i = e.getHitTestResults(this._xrHitTestSource);\n                this._processWebXRHitTestResult(i);\n              }\n              this._transientXrHitTestSource && e.getHitTestResultsForTransientInput(this._transientXrHitTestSource).forEach(function(o) {\n                n._processWebXRHitTestResult(o.results, o.inputSource);\n              });\n            }\n          }, t.prototype._processWebXRHitTestResult = function(e, n) {\n            var i = this, o = [];\n            e.forEach(function(a) {\n              var s = a.getPose(i._xrSessionManager.referenceSpace);\n              if (s) {\n                var d = s.transform.position, p = s.transform.orientation;\n                i._tmpPos.set(d.x, d.y, d.z), i._tmpQuat.set(p.x, p.y, p.z, p.w), u.a.FromFloat32ArrayToRefScaled(s.transform.matrix, 0, 1, i._tmpMat), i._xrSessionManager.scene.useRightHandedSystem || (i._tmpPos.z *= -1, i._tmpQuat.z *= -1, i._tmpQuat.w *= -1, i._tmpMat.toggleModelMatrixHandInPlace());\n                var y = { position: i.autoCloneTransformation ? i._tmpPos.clone() : i._tmpPos, rotationQuaternion: i.autoCloneTransformation ? i._tmpQuat.clone() : i._tmpQuat, transformationMatrix: i.autoCloneTransformation ? i._tmpMat.clone() : i._tmpMat, inputSource: n, isTransient: !!n, xrHitResult: a };\n                o.push(y);\n              }\n            }), this.onHitTestResultObservable.notifyObservers(o);\n          }, t.Name = ti.HIT_TEST, t.Version = 2, t;\n        }(ni);\n        Wn.AddWebXRFeature(Ca.Name, function(r, t) {\n          return function() {\n            return new Ca(r, t);\n          };\n        }, Ca.Version, !1);\n        var Ra = function(r) {\n          function t(e) {\n            var n = r.call(this, e) || this;\n            return n._enabled = !1, n._featurePointCloud = [], n.onFeaturePointsAddedObservable = new C.c(), n.onFeaturePointsUpdatedObservable = new C.c(), n.xrNativeFeatureName = \"bjsfeature-points\", n._xrSessionManager.session ? n._init() : n._xrSessionManager.onXRSessionInit.addOnce(function() {\n              n._init();\n            }), n;\n          }\n          return Object(c.d)(t, r), Object.defineProperty(t.prototype, \"featurePointCloud\", { get: function() {\n            return this._featurePointCloud;\n          }, enumerable: !1, configurable: !0 }), t.prototype.detach = function() {\n            return !!r.prototype.detach.call(this) && (this.featurePointCloud.length = 0, !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this._featurePointCloud.length = 0, this.onFeaturePointsUpdatedObservable.clear(), this.onFeaturePointsAddedObservable.clear();\n          }, t.prototype._onXRFrame = function(e) {\n            if (this.attached && this._enabled && e) {\n              var n = e.featurePointCloud;\n              if (n && n.length !== 0) {\n                if (n.length % 5 != 0)\n                  throw new Error(\"Received malformed feature point cloud of length: \" + n.length);\n                for (var i = n.length / 5, o = new Array(), a = new Array(), s = 0; s < i; s++) {\n                  var d = 5 * s, p = n[d + 4];\n                  this._featurePointCloud[p] ? o.push(p) : (this._featurePointCloud[p] = { position: new u.e(), confidenceValue: 0 }, a.push(p)), this._featurePointCloud[p].position.x = n[d], this._featurePointCloud[p].position.y = n[d + 1], this._featurePointCloud[p].position.z = n[d + 2], this._featurePointCloud[p].confidenceValue = n[d + 3];\n                }\n                a.length > 0 && this.onFeaturePointsAddedObservable.notifyObservers(a), o.length > 0 && this.onFeaturePointsUpdatedObservable.notifyObservers(o);\n              }\n            }\n          }, t.prototype._init = function() {\n            this._xrSessionManager.session.trySetFeaturePointCloudEnabled && this._xrSessionManager.session.trySetFeaturePointCloudEnabled(!0) && (this._enabled = !0);\n          }, t.Name = ti.FEATURE_POINTS, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Ra.Name, function(r) {\n          return function() {\n            return new Ra(r);\n          };\n        }, Ra.Version);\n        var $d = function() {\n          function r(t, e, n, i, o) {\n            this.xrController = t, this.trackedMeshes = e, this._handMesh = n, this._rigMapping = i, this._defaultHandMesh = !1, this._transformNodeMapping = [], this.handPartsDefinition = this.generateHandPartsDefinition(t.inputSource.hand), this._scene = e[0].getScene(), this._handMesh && this._rigMapping ? this._defaultHandMesh = !1 : o || this._generateDefaultHandMesh(), this.xrController.motionController && (this.xrController.motionController.rootMesh ? this.xrController.motionController.rootMesh.setEnabled(!1) : this.xrController.motionController.onModelLoadedObservable.add(function(a) {\n              a.rootMesh && a.rootMesh.setEnabled(!1);\n            })), this.xrController.onMotionControllerInitObservable.add(function(a) {\n              a.onModelLoadedObservable.add(function(s) {\n                s.rootMesh && s.rootMesh.setEnabled(!1);\n              }), a.rootMesh && a.rootMesh.setEnabled(!1);\n            });\n          }\n          return r.prototype.generateHandPartsDefinition = function(t) {\n            var e;\n            return (e = {}).wrist = [t.WRIST], e.thumb = [t.THUMB_METACARPAL, t.THUMB_PHALANX_PROXIMAL, t.THUMB_PHALANX_DISTAL, t.THUMB_PHALANX_TIP], e.index = [t.INDEX_METACARPAL, t.INDEX_PHALANX_PROXIMAL, t.INDEX_PHALANX_INTERMEDIATE, t.INDEX_PHALANX_DISTAL, t.INDEX_PHALANX_TIP], e.middle = [t.MIDDLE_METACARPAL, t.MIDDLE_PHALANX_PROXIMAL, t.MIDDLE_PHALANX_INTERMEDIATE, t.MIDDLE_PHALANX_DISTAL, t.MIDDLE_PHALANX_TIP], e.ring = [t.RING_METACARPAL, t.RING_PHALANX_PROXIMAL, t.RING_PHALANX_INTERMEDIATE, t.RING_PHALANX_DISTAL, t.RING_PHALANX_TIP], e.little = [t.LITTLE_METACARPAL, t.LITTLE_PHALANX_PROXIMAL, t.LITTLE_PHALANX_INTERMEDIATE, t.LITTLE_PHALANX_DISTAL, t.LITTLE_PHALANX_TIP], e;\n          }, r.prototype.updateFromXRFrame = function(t, e, n) {\n            var i = this;\n            n === void 0 && (n = 2);\n            var o = this.xrController.inputSource.hand;\n            o && this.trackedMeshes.forEach(function(a, s) {\n              var d = o[s];\n              if (d) {\n                var p = t.getJointPose(d, e);\n                if (!p || !p.transform)\n                  return;\n                var y = p.transform.position, P = p.transform.orientation;\n                a.position.set(y.x, y.y, y.z), a.rotationQuaternion.set(P.x, P.y, P.z, P.w);\n                var R = (p.radius || 8e-3) * n;\n                a.scaling.set(R, R, R), i._handMesh && i._rigMapping && i._rigMapping[s] && (i._transformNodeMapping[s] = i._transformNodeMapping[s] || i._scene.getTransformNodeByName(i._rigMapping[s]), i._transformNodeMapping[s] && (i._transformNodeMapping[s].position.copyFrom(a.position), i._transformNodeMapping[s].rotationQuaternion.copyFrom(a.rotationQuaternion), a.isVisible = !1)), a.getScene().useRightHandedSystem || (a.position.z *= -1, a.rotationQuaternion.z *= -1, a.rotationQuaternion.w *= -1);\n              }\n            });\n          }, r.prototype.getHandPartMeshes = function(t) {\n            var e = this;\n            return this.handPartsDefinition[t].map(function(n) {\n              return e.trackedMeshes[n];\n            });\n          }, r.prototype.dispose = function() {\n            this.trackedMeshes.forEach(function(t) {\n              return t.dispose();\n            }), this._defaultHandMesh && this._handMesh && this._handMesh.dispose();\n          }, r.prototype._generateDefaultHandMesh = function() {\n            return Object(c.b)(this, void 0, void 0, function() {\n              var t, e, n, i, o, a, s, d;\n              return Object(c.e)(this, function(p) {\n                switch (p.label) {\n                  case 0:\n                    return p.trys.push([0, 3, , 4]), t = this.xrController.inputSource.handedness === \"right\" ? \"right\" : \"left\", e = (t === \"right\" ? \"r\" : \"l\") + \"_hand_\" + (this._scene.useRightHandedSystem ? \"r\" : \"l\") + \"hs.glb\", [4, Ft.ImportMeshAsync(\"\", \"https://assets.babylonjs.com/meshes/HandMeshes/\", e, this._scene)];\n                  case 1:\n                    return n = p.sent(), i = { base: I.a.FromInts(116, 63, 203), fresnel: I.a.FromInts(149, 102, 229), fingerColor: I.a.FromInts(177, 130, 255), tipFresnel: I.a.FromInts(220, 200, 255) }, [4, (o = new sa(\"leftHandShader\", this._scene, { emitComments: !1 })).loadAsync(\"https://patrickryanms.github.io/BabylonJStextures/Demos/xrHandMesh/handsShader.json\")];\n                  case 2:\n                    if (p.sent(), o.build(!1), o.needDepthPrePass = !0, o.transparencyMode = zt.a.MATERIAL_ALPHABLEND, o.alphaMode = Ue.a.ALPHA_COMBINE, (a = { base: o.getBlockByName(\"baseColor\"), fresnel: o.getBlockByName(\"fresnelColor\"), fingerColor: o.getBlockByName(\"fingerColor\"), tipFresnel: o.getBlockByName(\"tipFresnelColor\") }).base.value = i.base, a.fresnel.value = i.fresnel, a.fingerColor.value = i.fingerColor, a.tipFresnel.value = i.tipFresnel, n.meshes[1].material = o, this._defaultHandMesh = !0, this._handMesh = n.meshes[0], this._rigMapping = [\"wrist_\", \"thumb_metacarpal_\", \"thumb_proxPhalanx_\", \"thumb_distPhalanx_\", \"thumb_tip_\", \"index_metacarpal_\", \"index_proxPhalanx_\", \"index_intPhalanx_\", \"index_distPhalanx_\", \"index_tip_\", \"middle_metacarpal_\", \"middle_proxPhalanx_\", \"middle_intPhalanx_\", \"middle_distPhalanx_\", \"middle_tip_\", \"ring_metacarpal_\", \"ring_proxPhalanx_\", \"ring_intPhalanx_\", \"ring_distPhalanx_\", \"ring_tip_\", \"little_metacarpal_\", \"little_proxPhalanx_\", \"little_intPhalanx_\", \"little_distPhalanx_\", \"little_tip_\"].map(function(y) {\n                      return y + (t === \"right\" ? \"R\" : \"L\");\n                    }), !(s = this._scene.getTransformNodeByName(this._rigMapping[0])))\n                      throw new Error(\"could not find the wrist node\");\n                    return s.parent && s.parent.rotate(be.a.Y, Math.PI), [3, 4];\n                  case 3:\n                    return d = p.sent(), Xe.b.Error(\"error loading hand mesh\"), console.log(d), [3, 4];\n                  case 4:\n                    return [2];\n                }\n              });\n            });\n          }, r;\n        }(), Oa = function(r) {\n          function t(e, n) {\n            var i = r.call(this, e) || this;\n            return i.options = n, i.onHandAddedObservable = new C.c(), i.onHandRemovedObservable = new C.c(), i._hands = {}, i._attachHand = function(o) {\n              var a, s, d, p, y, P, R, B, F, z;\n              if (o.inputSource.hand && !i._hands[o.uniqueId]) {\n                var J = o.inputSource.hand, ie = [], se = ((a = i.options.jointMeshes) === null || a === void 0 ? void 0 : a.sourceMesh) || Nn.a.CreateSphere(\"jointParent\", { diameter: 1 });\n                se.isVisible = !!(!((s = i.options.jointMeshes) === null || s === void 0) && s.keepOriginalVisible);\n                for (var ce = 0; ce < J.length; ++ce) {\n                  var ue = se.createInstance(o.uniqueId + \"-handJoint-\" + ce);\n                  if (!((d = i.options.jointMeshes) === null || d === void 0) && d.onHandJointMeshGenerated) {\n                    var fe = i.options.jointMeshes.onHandJointMeshGenerated(ue, ce, o.uniqueId);\n                    fe && fe !== ue && (ue.dispose(), ue = fe);\n                  }\n                  if (ue.isPickable = !1, (p = i.options.jointMeshes) === null || p === void 0 ? void 0 : p.enablePhysics) {\n                    var ve = i.options.jointMeshes.physicsProps || {}, Te = ve.impostorType !== void 0 ? ve.impostorType : At.a.SphereImpostor;\n                    ue.physicsImpostor = new At.a(ue, Te, Object(c.a)({ mass: 0 }, ve));\n                  }\n                  ue.rotationQuaternion = new u.b(), !((y = i.options.jointMeshes) === null || y === void 0) && y.invisible && (ue.isVisible = !1), ie.push(ue);\n                }\n                var Re = o.inputSource.handedness === \"right\" ? \"right\" : \"left\", Ae = ((P = i.options.jointMeshes) === null || P === void 0 ? void 0 : P.handMeshes) && ((R = i.options.jointMeshes) === null || R === void 0 ? void 0 : R.handMeshes[Re]), Ee = ((B = i.options.jointMeshes) === null || B === void 0 ? void 0 : B.rigMapping) && ((F = i.options.jointMeshes) === null || F === void 0 ? void 0 : F.rigMapping[Re]), Se = new $d(o, ie, Ae, Ee, (z = i.options.jointMeshes) === null || z === void 0 ? void 0 : z.disableDefaultHandMesh);\n                i._hands[o.uniqueId] = { handObject: Se, id: t._idCounter++ }, i.onHandAddedObservable.notifyObservers(Se);\n              }\n            }, i.xrNativeFeatureName = \"hand-tracking\", i;\n          }\n          return Object(c.d)(t, r), t.prototype.isCompatible = function() {\n            return typeof XRHand < \"u\";\n          }, t.prototype.attach = function() {\n            var e = this;\n            return !!r.prototype.attach.call(this) && (this.options.xrInput.controllers.forEach(this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerAddedObservable, this._attachHand), this._addNewAttachObserver(this.options.xrInput.onControllerRemovedObservable, function(n) {\n              e._detachHand(n.uniqueId);\n            }), !0);\n          }, t.prototype.detach = function() {\n            var e = this;\n            return !!r.prototype.detach.call(this) && (Object.keys(this._hands).forEach(function(n) {\n              e._detachHand(n);\n            }), !0);\n          }, t.prototype.dispose = function() {\n            r.prototype.dispose.call(this), this.onHandAddedObservable.clear();\n          }, t.prototype.getHandByControllerId = function(e) {\n            var n;\n            return ((n = this._hands[e]) === null || n === void 0 ? void 0 : n.handObject) || null;\n          }, t.prototype.getHandByHandedness = function(e) {\n            var n = this, i = Object.keys(this._hands).map(function(o) {\n              return n._hands[o].handObject.xrController.inputSource.handedness;\n            }).indexOf(e);\n            return i !== -1 ? this._hands[i].handObject : null;\n          }, t.prototype._onXRFrame = function(e) {\n            var n = this;\n            Object.keys(this._hands).forEach(function(i) {\n              var o;\n              n._hands[i].handObject.updateFromXRFrame(e, n._xrSessionManager.referenceSpace, (o = n.options.jointMeshes) === null || o === void 0 ? void 0 : o.scaleFactor);\n            });\n          }, t.prototype._detachHand = function(e) {\n            this._hands[e] && (this.onHandRemovedObservable.notifyObservers(this._hands[e].handObject), this._hands[e].handObject.dispose());\n          }, t._idCounter = 0, t.Name = ti.HAND_TRACKING, t.Version = 1, t;\n        }(ni);\n        Wn.AddWebXRFeature(Oa.Name, function(r, t) {\n          return function() {\n            return new Oa(r, t);\n          };\n        }, Oa.Version, !1);\n        var ef = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, Jg[\"left-right\"], n, i) || this;\n            return o._mapping = { defaultButton: { valueNodeName: \"VALUE\", unpressedNodeName: \"UNPRESSED\", pressedNodeName: \"PRESSED\" }, defaultAxis: { valueNodeName: \"VALUE\", minNodeName: \"MIN\", maxNodeName: \"MAX\" }, buttons: { \"xr-standard-trigger\": { rootNodeName: \"SELECT\", componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"] }, \"xr-standard-squeeze\": { rootNodeName: \"GRASP\", componentProperty: \"state\", states: [\"pressed\"] }, \"xr-standard-touchpad\": { rootNodeName: \"TOUCHPAD_PRESS\", labelAnchorNodeName: \"squeeze-label\", touchPointNodeName: \"TOUCH\" }, \"xr-standard-thumbstick\": { rootNodeName: \"THUMBSTICK_PRESS\", componentProperty: \"state\", states: [\"pressed\"] } }, axes: { \"xr-standard-touchpad\": { \"x-axis\": { rootNodeName: \"TOUCHPAD_TOUCH_X\" }, \"y-axis\": { rootNodeName: \"TOUCHPAD_TOUCH_Y\" } }, \"xr-standard-thumbstick\": { \"x-axis\": { rootNodeName: \"THUMBSTICK_X\" }, \"y-axis\": { rootNodeName: \"THUMBSTICK_Y\" } } } }, o.profileId = \"microsoft-mixed-reality\", o;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: this.handedness === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, path: t.MODEL_BASE_URL + \"default/\" };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            var e = Ft.IsPluginForExtensionAvailable(\".glb\");\n            return e || l.a.Warn(\"glTF / glb loaded was not registered, using generic controller instead\"), e;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this;\n            this.rootMesh && (this.getComponentIds().forEach(function(i, o) {\n              if (!n.disableAnimation && i && n.rootMesh) {\n                var a = n._mapping.buttons[i], s = a.rootNodeName;\n                if (!s)\n                  return void l.a.Log(\"Skipping unknown button at index: \" + o + \" with mapped name: \" + i);\n                var d = n._getChildByName(n.rootMesh, s);\n                if (!d)\n                  return void l.a.Warn(\"Missing button mesh with name: \" + s);\n                if (a.valueMesh = n._getImmediateChildByName(d, n._mapping.defaultButton.valueNodeName), a.pressedMesh = n._getImmediateChildByName(d, n._mapping.defaultButton.pressedNodeName), a.unpressedMesh = n._getImmediateChildByName(d, n._mapping.defaultButton.unpressedNodeName), a.valueMesh && a.pressedMesh && a.unpressedMesh) {\n                  var p = n.getComponent(i);\n                  p && p.onButtonStateChangedObservable.add(function(y) {\n                    n._lerpTransform(a, y.value);\n                  }, void 0, !0);\n                } else\n                  l.a.Warn(\"Missing button submesh under mesh with name: \" + s);\n              }\n            }), this.getComponentIds().forEach(function(i, o) {\n              var a = n.getComponent(i);\n              a.isAxes() && [\"x-axis\", \"y-axis\"].forEach(function(s) {\n                if (n.rootMesh) {\n                  var d = n._mapping.axes[i][s], p = n._getChildByName(n.rootMesh, d.rootNodeName);\n                  p ? (d.valueMesh = n._getImmediateChildByName(p, n._mapping.defaultAxis.valueNodeName), d.minMesh = n._getImmediateChildByName(p, n._mapping.defaultAxis.minNodeName), d.maxMesh = n._getImmediateChildByName(p, n._mapping.defaultAxis.maxNodeName), d.valueMesh && d.minMesh && d.maxMesh ? a && a.onAxisValueChangedObservable.add(function(y) {\n                    var P = s === \"x-axis\" ? y.x : y.y;\n                    n._lerpTransform(d, P, !0);\n                  }, void 0, !0) : l.a.Warn(\"Missing axis submesh under mesh with name: \" + d.rootNodeName)) : l.a.Warn(\"Missing axis mesh with name: \" + d.rootNodeName);\n                }\n              });\n            }));\n          }, t.prototype._setRootMesh = function(e) {\n            var n;\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), this.rootMesh.isPickable = !1;\n            for (var i = 0; i < e.length; i++) {\n              var o = e[i];\n              o.isPickable = !1, o.parent || (n = o);\n            }\n            n && n.setParent(this.rootMesh), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0));\n          }, t.prototype._updateModel = function() {\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/microsoft/\", t.MODEL_LEFT_FILENAME = \"left.glb\", t.MODEL_RIGHT_FILENAME = \"right.glb\", t;\n        }(br);\n        wn.RegisterController(\"windows-mixed-reality\", function(r, t) {\n          return new ef(t, r.gamepad, r.handedness);\n        });\n        var Jg = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: { xr_standard_trigger_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_trigger_pressed_value\", minNodeName: \"xr_standard_trigger_pressed_min\", maxNodeName: \"xr_standard_trigger_pressed_max\" } } }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: { xr_standard_squeeze_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_squeeze_pressed_value\", minNodeName: \"xr_standard_squeeze_pressed_min\", maxNodeName: \"xr_standard_squeeze_pressed_max\" } } }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: { xr_standard_touchpad_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_pressed_value\", minNodeName: \"xr_standard_touchpad_pressed_min\", maxNodeName: \"xr_standard_touchpad_pressed_max\" }, xr_standard_touchpad_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_xaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_xaxis_pressed_max\" }, xr_standard_touchpad_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_yaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_yaxis_pressed_max\" }, xr_standard_touchpad_xaxis_touched: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_touched_value\", minNodeName: \"xr_standard_touchpad_xaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_xaxis_touched_max\" }, xr_standard_touchpad_yaxis_touched: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_touched_value\", minNodeName: \"xr_standard_touchpad_yaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_yaxis_touched_max\" }, xr_standard_touchpad_axes_touched: { componentProperty: \"state\", states: [\"touched\", \"pressed\"], valueNodeProperty: \"visibility\", valueNodeName: \"xr_standard_touchpad_axes_touched_value\" } }, touchPointNodeName: \"xr_standard_touchpad_axes_touched_value\" }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: { xr_standard_thumbstick_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_pressed_value\", minNodeName: \"xr_standard_thumbstick_pressed_min\", maxNodeName: \"xr_standard_thumbstick_pressed_max\" }, xr_standard_thumbstick_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_xaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_xaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_xaxis_pressed_max\" }, xr_standard_thumbstick_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_yaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_yaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_yaxis_pressed_max\" } } } }, gamepadMapping: \"xr-standard\", rootNodeName: \"microsoft-mixed-reality-left\", assetPath: \"left.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: { xr_standard_trigger_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_trigger_pressed_value\", minNodeName: \"xr_standard_trigger_pressed_min\", maxNodeName: \"xr_standard_trigger_pressed_max\" } } }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: { xr_standard_squeeze_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_squeeze_pressed_value\", minNodeName: \"xr_standard_squeeze_pressed_min\", maxNodeName: \"xr_standard_squeeze_pressed_max\" } } }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: { xr_standard_touchpad_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_pressed_value\", minNodeName: \"xr_standard_touchpad_pressed_min\", maxNodeName: \"xr_standard_touchpad_pressed_max\" }, xr_standard_touchpad_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_xaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_xaxis_pressed_max\" }, xr_standard_touchpad_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_pressed_value\", minNodeName: \"xr_standard_touchpad_yaxis_pressed_min\", maxNodeName: \"xr_standard_touchpad_yaxis_pressed_max\" }, xr_standard_touchpad_xaxis_touched: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_xaxis_touched_value\", minNodeName: \"xr_standard_touchpad_xaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_xaxis_touched_max\" }, xr_standard_touchpad_yaxis_touched: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_touchpad_yaxis_touched_value\", minNodeName: \"xr_standard_touchpad_yaxis_touched_min\", maxNodeName: \"xr_standard_touchpad_yaxis_touched_max\" }, xr_standard_touchpad_axes_touched: { componentProperty: \"state\", states: [\"touched\", \"pressed\"], valueNodeProperty: \"visibility\", valueNodeName: \"xr_standard_touchpad_axes_touched_value\" } }, touchPointNodeName: \"xr_standard_touchpad_axes_touched_value\" }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: { xr_standard_thumbstick_pressed: { componentProperty: \"button\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_pressed_value\", minNodeName: \"xr_standard_thumbstick_pressed_min\", maxNodeName: \"xr_standard_thumbstick_pressed_max\" }, xr_standard_thumbstick_xaxis_pressed: { componentProperty: \"xAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_xaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_xaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_xaxis_pressed_max\" }, xr_standard_thumbstick_yaxis_pressed: { componentProperty: \"yAxis\", states: [\"default\", \"touched\", \"pressed\"], valueNodeProperty: \"transform\", valueNodeName: \"xr_standard_thumbstick_yaxis_pressed_value\", minNodeName: \"xr_standard_thumbstick_yaxis_pressed_min\", maxNodeName: \"xr_standard_thumbstick_yaxis_pressed_max\" } } } }, gamepadMapping: \"xr-standard\", rootNodeName: \"microsoft-mixed-reality-right\", assetPath: \"right.glb\" } }, zc = function(r) {\n          function t(e, n, i, o, a) {\n            a === void 0 && (a = !1);\n            var s = r.call(this, e, $g[i], n, i) || this;\n            return s._forceLegacyControllers = a, s.profileId = \"oculus-touch\", s;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: this.handedness === \"left\" ? t.MODEL_LEFT_FILENAME : t.MODEL_RIGHT_FILENAME, path: this._isQuest() ? t.QUEST_MODEL_BASE_URL : t.MODEL_BASE_URL };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            return !0;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this, i = this._isQuest(), o = this.handedness === \"right\" ? -1 : 1;\n            this.getComponentIds().forEach(function(a) {\n              var s = a && n.getComponent(a);\n              s && s.onButtonStateChangedObservable.add(function(d) {\n                if (n.rootMesh && !n.disableAnimation)\n                  switch (a) {\n                    case \"xr-standard-trigger\":\n                      return void (i || (n._modelRootNode.getChildren()[3].rotation.x = 0.2 * -d.value, n._modelRootNode.getChildren()[3].position.y = 5e-3 * -d.value, n._modelRootNode.getChildren()[3].position.z = 5e-3 * -d.value));\n                    case \"xr-standard-squeeze\":\n                      return void (i || (n._modelRootNode.getChildren()[4].position.x = o * d.value * 35e-4));\n                    case \"xr-standard-thumbstick\":\n                      return;\n                    case \"a-button\":\n                    case \"x-button\":\n                      return void (i || (d.pressed ? n._modelRootNode.getChildren()[1].position.y = -1e-3 : n._modelRootNode.getChildren()[1].position.y = 0));\n                    case \"b-button\":\n                    case \"y-button\":\n                      return void (i || (d.pressed ? n._modelRootNode.getChildren()[2].position.y = -1e-3 : n._modelRootNode.getChildren()[2].position.y = 0));\n                  }\n              }, void 0, !0);\n            });\n          }, t.prototype._setRootMesh = function(e) {\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0)), e.forEach(function(n) {\n              n.isPickable = !1;\n            }), this._isQuest() ? this._modelRootNode = e[0] : (this._modelRootNode = e[1], this.rootMesh.position.y = 0.034, this.rootMesh.position.z = 0.052), this._modelRootNode.parent = this.rootMesh;\n          }, t.prototype._updateModel = function() {\n          }, t.prototype._isQuest = function() {\n            return !!navigator.userAgent.match(/Quest/gi) && !this._forceLegacyControllers;\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculus/\", t.MODEL_LEFT_FILENAME = \"left.babylon\", t.MODEL_RIGHT_FILENAME = \"right.babylon\", t.QUEST_MODEL_BASE_URL = \"https://controllers.babylonjs.com/oculusQuest/\", t;\n        }(br);\n        wn.RegisterController(\"oculus-touch\", function(r, t) {\n          return new zc(t, r.gamepad, r.handedness);\n        }), wn.RegisterController(\"oculus-touch-legacy\", function(r, t) {\n          return new zc(t, r.gamepad, r.handedness, !0);\n        });\n        var $g = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: {} }, \"x-button\": { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"x_button\", visualResponses: {} }, \"y-button\": { type: \"button\", gamepadIndices: { button: 5 }, rootNodeName: \"y_button\", visualResponses: {} }, thumbrest: { type: \"button\", gamepadIndices: { button: 6 }, rootNodeName: \"thumbrest\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"oculus-touch-v2-left\", assetPath: \"left.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-thumbstick\": { type: \"thumbstick\", gamepadIndices: { button: 3, xAxis: 2, yAxis: 3 }, rootNodeName: \"xr_standard_thumbstick\", visualResponses: {} }, \"a-button\": { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"a_button\", visualResponses: {} }, \"b-button\": { type: \"button\", gamepadIndices: { button: 5 }, rootNodeName: \"b_button\", visualResponses: {} }, thumbrest: { type: \"button\", gamepadIndices: { button: 6 }, rootNodeName: \"thumbrest\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"oculus-touch-v2-right\", assetPath: \"right.glb\" } }, tf = function(r) {\n          function t(e, n, i) {\n            var o = r.call(this, e, ev[i], n, i) || this;\n            return o.profileId = \"htc-vive\", o;\n          }\n          return Object(c.d)(t, r), t.prototype._getFilenameAndPath = function() {\n            return { filename: t.MODEL_FILENAME, path: t.MODEL_BASE_URL };\n          }, t.prototype._getModelLoadingConstraints = function() {\n            return !0;\n          }, t.prototype._processLoadedModel = function(e) {\n            var n = this;\n            this.getComponentIds().forEach(function(i) {\n              var o = i && n.getComponent(i);\n              o && o.onButtonStateChangedObservable.add(function(a) {\n                if (n.rootMesh && !n.disableAnimation)\n                  switch (i) {\n                    case \"xr-standard-trigger\":\n                      return void (n._modelRootNode.getChildren()[6].rotation.x = 0.15 * -a.value);\n                    case \"xr-standard-touchpad\":\n                    case \"xr-standard-squeeze\":\n                      return;\n                  }\n              }, void 0, !0);\n            });\n          }, t.prototype._setRootMesh = function(e) {\n            this.rootMesh = new Ie.a(this.profileId + \" \" + this.handedness, this.scene), e.forEach(function(n) {\n              n.isPickable = !1;\n            }), this._modelRootNode = e[1], this._modelRootNode.parent = this.rootMesh, this.scene.useRightHandedSystem || (this.rootMesh.rotationQuaternion = u.b.FromEulerAngles(0, Math.PI, 0));\n          }, t.prototype._updateModel = function() {\n          }, t.MODEL_BASE_URL = \"https://controllers.babylonjs.com/vive/\", t.MODEL_FILENAME = \"wand.babylon\", t;\n        }(br);\n        wn.RegisterController(\"htc-vive\", function(r, t) {\n          return new tf(t, r.gamepad, r.handedness);\n        });\n        var ev = { left: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: {} }, menu: { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"menu\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"htc_vive_none\", assetPath: \"none.glb\" }, right: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: {} }, menu: { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"menu\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"htc_vive_none\", assetPath: \"none.glb\" }, none: { selectComponentId: \"xr-standard-trigger\", components: { \"xr-standard-trigger\": { type: \"trigger\", gamepadIndices: { button: 0 }, rootNodeName: \"xr_standard_trigger\", visualResponses: {} }, \"xr-standard-squeeze\": { type: \"squeeze\", gamepadIndices: { button: 1 }, rootNodeName: \"xr_standard_squeeze\", visualResponses: {} }, \"xr-standard-touchpad\": { type: \"touchpad\", gamepadIndices: { button: 2, xAxis: 0, yAxis: 1 }, rootNodeName: \"xr_standard_touchpad\", visualResponses: {} }, menu: { type: \"button\", gamepadIndices: { button: 4 }, rootNodeName: \"menu\", visualResponses: {} } }, gamepadMapping: \"xr-standard\", rootNodeName: \"htc-vive-none\", assetPath: \"none.glb\" } };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return h;\n        });\n        var V = f(34), _ = function() {\n          function v() {\n            this.children = [];\n          }\n          return v.prototype.isValid = function(b) {\n            return !0;\n          }, v.prototype.process = function(b, D) {\n            var w = \"\";\n            if (this.line) {\n              var N = this.line, M = D.processor;\n              M && (M.lineProcessor && (N = M.lineProcessor(N, D.isFragment)), M.attributeProcessor && V.a.StartsWith(this.line, \"attribute\") ? N = M.attributeProcessor(this.line) : M.varyingProcessor && V.a.StartsWith(this.line, \"varying\") ? N = M.varyingProcessor(this.line, D.isFragment) : (M.uniformProcessor || M.uniformBufferProcessor) && V.a.StartsWith(this.line, \"uniform\") && (/uniform (.+) (.+)/.test(this.line) ? M.uniformProcessor && (N = M.uniformProcessor(this.line, D.isFragment)) : M.uniformBufferProcessor && (N = M.uniformBufferProcessor(this.line, D.isFragment), D.lookForClosingBracketForUniformBuffer = !0)), M.endOfUniformBufferProcessor && D.lookForClosingBracketForUniformBuffer && this.line.indexOf(\"}\") !== -1 && (D.lookForClosingBracketForUniformBuffer = !1, N = M.endOfUniformBufferProcessor(this.line, D.isFragment))), w += N + `\\r\n`;\n            }\n            return this.children.forEach(function(U) {\n              w += U.process(b, D);\n            }), this.additionalDefineKey && (b[this.additionalDefineKey] = this.additionalDefineValue || \"true\"), w;\n          }, v;\n        }(), C = function() {\n          function v() {\n          }\n          return Object.defineProperty(v.prototype, \"currentLine\", { get: function() {\n            return this._lines[this.lineIndex];\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"canRead\", { get: function() {\n            return this.lineIndex < this._lines.length - 1;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(v.prototype, \"lines\", { set: function(b) {\n            this._lines = [];\n            for (var D = 0, w = b; D < w.length; D++) {\n              var N = w[D];\n              if (N[0] !== \"#\")\n                for (var M = N.split(\";\"), U = 0; U < M.length; U++) {\n                  var X = M[U];\n                  (X = X.trim()) && this._lines.push(X + (U !== M.length - 1 ? \";\" : \"\"));\n                }\n              else\n                this._lines.push(N);\n            }\n          }, enumerable: !1, configurable: !0 }), v;\n        }(), u = f(1), I = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.process = function(D, w) {\n            for (var N = 0; N < this.children.length; N++) {\n              var M = this.children[N];\n              if (M.isValid(D))\n                return M.process(D, w);\n            }\n            return \"\";\n          }, b;\n        }(_), O = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.isValid = function(D) {\n            return this.testExpression.isTrue(D);\n          }, b;\n        }(_), x = function() {\n          function v() {\n          }\n          return v.prototype.isTrue = function(b) {\n            return !0;\n          }, v.postfixToInfix = function(b) {\n            for (var D = [], w = 0, N = b; w < N.length; w++) {\n              var M = N[w];\n              if (v._OperatorPriority[M] === void 0)\n                D.push(M);\n              else {\n                var U = D[D.length - 1], X = D[D.length - 2];\n                D.length -= 2, D.push(\"(\" + X + M + U + \")\");\n              }\n            }\n            return D[D.length - 1];\n          }, v.infixToPostfix = function(b) {\n            for (var D = [], w = -1, N = function() {\n              (ne = ne.trim()) !== \"\" && (D.push(ne), ne = \"\");\n            }, M = function(pe) {\n              w < v._Stack.length - 1 && (v._Stack[++w] = pe);\n            }, U = function() {\n              return v._Stack[w];\n            }, X = function() {\n              return w === -1 ? \"!!INVALID EXPRESSION!!\" : v._Stack[w--];\n            }, j = 0, ne = \"\"; j < b.length; ) {\n              var te = b.charAt(j), de = j < b.length - 1 ? b.substr(j, 2) : \"\";\n              if (te === \"(\")\n                ne = \"\", M(te);\n              else if (te === \")\") {\n                for (N(); w !== -1 && U() !== \"(\"; )\n                  D.push(X());\n                X();\n              } else if (v._OperatorPriority[de] > 1) {\n                for (N(); w !== -1 && v._OperatorPriority[U()] >= v._OperatorPriority[de]; )\n                  D.push(X());\n                M(de), j++;\n              } else\n                ne += te;\n              j++;\n            }\n            for (N(); w !== -1; )\n              U() === \"(\" ? X() : D.push(X());\n            return D;\n          }, v._OperatorPriority = { \")\": 0, \"(\": 1, \"||\": 2, \"&&\": 3 }, v._Stack = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"], v;\n        }(), m = function(v) {\n          function b(D, w) {\n            w === void 0 && (w = !1);\n            var N = v.call(this) || this;\n            return N.define = D, N.not = w, N;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            var w = D[this.define] !== void 0;\n            return this.not && (w = !w), w;\n          }, b;\n        }(x), c = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            return this.leftOperand.isTrue(D) || this.rightOperand.isTrue(D);\n          }, b;\n        }(x), T = function(v) {\n          function b() {\n            return v !== null && v.apply(this, arguments) || this;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            return this.leftOperand.isTrue(D) && this.rightOperand.isTrue(D);\n          }, b;\n        }(x), S = function(v) {\n          function b(D, w, N) {\n            var M = v.call(this) || this;\n            return M.define = D, M.operand = w, M.testValue = N, M;\n          }\n          return Object(u.d)(b, v), b.prototype.isTrue = function(D) {\n            var w = D[this.define];\n            w === void 0 && (w = this.define);\n            var N = !1, M = parseInt(w), U = parseInt(this.testValue);\n            switch (this.operand) {\n              case \">\":\n                N = M > U;\n                break;\n              case \"<\":\n                N = M < U;\n                break;\n              case \"<=\":\n                N = M <= U;\n                break;\n              case \">=\":\n                N = M >= U;\n                break;\n              case \"==\":\n                N = M === U;\n            }\n            return N;\n          }, b;\n        }(x), E = f(21), g = /defined\\s*?\\((.+?)\\)/g, l = /defined\\s*?\\[(.+?)\\]/g, h = function() {\n          function v() {\n          }\n          return v.Process = function(b, D, w, N) {\n            var M = this;\n            this._ProcessIncludes(b, D, function(U) {\n              var X = M._ProcessShaderConversion(U, D, N);\n              w(X);\n            });\n          }, v._ProcessPrecision = function(b, D) {\n            var w = D.shouldUseHighPrecisionShader;\n            return b.indexOf(\"precision highp float\") === -1 ? b = w ? `precision highp float;\n` + b : `precision mediump float;\n` + b : w || (b = b.replace(\"precision highp float\", \"precision mediump float\")), b;\n          }, v._ExtractOperation = function(b) {\n            var D = /defined\\((.+)\\)/.exec(b);\n            if (D && D.length)\n              return new m(D[1].trim(), b[0] === \"!\");\n            for (var w = \"\", N = 0, M = 0, U = [\"==\", \">=\", \"<=\", \"<\", \">\"]; M < U.length && (w = U[M], !((N = b.indexOf(w)) > -1)); M++)\n              ;\n            if (N === -1)\n              return new m(b);\n            var X = b.substring(0, N).trim(), j = b.substring(N + w.length).trim();\n            return new S(X, w, j);\n          }, v._BuildSubExpression = function(b) {\n            b = b.replace(g, \"defined[$1]\");\n            for (var D = [], w = 0, N = x.infixToPostfix(b); w < N.length; w++) {\n              var M = N[w];\n              if (M !== \"||\" && M !== \"&&\")\n                D.push(M);\n              else if (D.length >= 2) {\n                var U = D[D.length - 1], X = D[D.length - 2];\n                D.length -= 2;\n                var j = M == \"&&\" ? new T() : new c();\n                typeof U == \"string\" && (U = U.replace(l, \"defined($1)\")), typeof X == \"string\" && (X = X.replace(l, \"defined($1)\")), j.leftOperand = typeof X == \"string\" ? this._ExtractOperation(X) : X, j.rightOperand = typeof U == \"string\" ? this._ExtractOperation(U) : U, D.push(j);\n              }\n            }\n            var ne = D[D.length - 1];\n            return typeof ne == \"string\" && (ne = ne.replace(l, \"defined($1)\")), typeof ne == \"string\" ? this._ExtractOperation(ne) : ne;\n          }, v._BuildExpression = function(b, D) {\n            var w = new O(), N = b.substring(0, D), M = b.substring(D);\n            return M = M.substring(0, (M.indexOf(\"//\") + 1 || M.length + 1) - 1).trim(), w.testExpression = N === \"#ifdef\" ? new m(M) : N === \"#ifndef\" ? new m(M, !0) : this._BuildSubExpression(M), w;\n          }, v._MoveCursorWithinIf = function(b, D, w) {\n            for (var N = b.currentLine; this._MoveCursor(b, w); ) {\n              var M = (N = b.currentLine).substring(0, 5).toLowerCase();\n              if (M === \"#else\") {\n                var U = new _();\n                return D.children.push(U), void this._MoveCursor(b, U);\n              }\n              if (M === \"#elif\") {\n                var X = this._BuildExpression(N, 5);\n                D.children.push(X), w = X;\n              }\n            }\n          }, v._MoveCursor = function(b, D) {\n            for (; b.canRead; ) {\n              b.lineIndex++;\n              var w = b.currentLine, N = /(#ifdef)|(#else)|(#elif)|(#endif)|(#ifndef)|(#if)/.exec(w);\n              if (N && N.length)\n                switch (N[0]) {\n                  case \"#ifdef\":\n                    var M = new I();\n                    D.children.push(M);\n                    var U = this._BuildExpression(w, 6);\n                    M.children.push(U), this._MoveCursorWithinIf(b, M, U);\n                    break;\n                  case \"#else\":\n                  case \"#elif\":\n                    return !0;\n                  case \"#endif\":\n                    return !1;\n                  case \"#ifndef\":\n                    M = new I(), D.children.push(M), U = this._BuildExpression(w, 7), M.children.push(U), this._MoveCursorWithinIf(b, M, U);\n                    break;\n                  case \"#if\":\n                    M = new I(), U = this._BuildExpression(w, 3), D.children.push(M), M.children.push(U), this._MoveCursorWithinIf(b, M, U);\n                }\n              else {\n                var X = new _();\n                if (X.line = w, D.children.push(X), w[0] === \"#\" && w[1] === \"d\") {\n                  var j = w.replace(\";\", \"\").split(\" \");\n                  X.additionalDefineKey = j[1], j.length === 3 && (X.additionalDefineValue = j[2]);\n                }\n              }\n            }\n            return !1;\n          }, v._EvaluatePreProcessors = function(b, D, w) {\n            var N = new _(), M = new C();\n            return M.lineIndex = -1, M.lines = b.split(`\n`), this._MoveCursor(M, N), N.process(D, w);\n          }, v._PreparePreProcessors = function(b) {\n            for (var D = {}, w = 0, N = b.defines; w < N.length; w++) {\n              var M = N[w].replace(\"#define\", \"\").replace(\";\", \"\").trim().split(\" \");\n              D[M[0]] = M.length > 1 ? M[1] : \"\";\n            }\n            return D.GL_ES = \"true\", D.__VERSION__ = b.version, D[b.platformName] = \"true\", D;\n          }, v._ProcessShaderConversion = function(b, D, w) {\n            var N = this._ProcessPrecision(b, D);\n            if (!D.processor)\n              return N;\n            if (N.indexOf(\"#version 3\") !== -1)\n              return N.replace(\"#version 300 es\", \"\");\n            var M = D.defines, U = this._PreparePreProcessors(D);\n            return D.processor.preProcessor && (N = D.processor.preProcessor(N, M, D.isFragment)), N = this._EvaluatePreProcessors(N, U, D), D.processor.postProcessor && (N = D.processor.postProcessor(N, M, D.isFragment, w)), N;\n          }, v._ProcessIncludes = function(b, D, w) {\n            for (var N = this, M = /#include<(.+)>(\\((.*)\\))*(\\[(.*)\\])*/g, U = M.exec(b), X = new String(b), j = !1; U != null; ) {\n              var ne = U[1];\n              if (ne.indexOf(\"__decl__\") !== -1 && (ne = ne.replace(/__decl__/, \"\"), D.supportsUniformBuffers && (ne = (ne = ne.replace(/Vertex/, \"Ubo\")).replace(/Fragment/, \"Ubo\")), ne += \"Declaration\"), !D.includesShadersStore[ne]) {\n                var te = D.shadersRepository + \"ShadersInclude/\" + ne + \".fx\";\n                return void v._FileToolsLoadFile(te, function(Y) {\n                  D.includesShadersStore[ne] = Y, N._ProcessIncludes(X, D, w);\n                });\n              }\n              var de = D.includesShadersStore[ne];\n              if (U[2])\n                for (var pe = U[3].split(\",\"), ae = 0; ae < pe.length; ae += 2) {\n                  var ee = new RegExp(pe[ae], \"g\"), K = pe[ae + 1];\n                  de = de.replace(ee, K);\n                }\n              if (U[4]) {\n                var $ = U[5];\n                if ($.indexOf(\"..\") !== -1) {\n                  var L = $.split(\"..\"), G = parseInt(L[0]), Q = parseInt(L[1]), oe = de.slice(0);\n                  de = \"\", isNaN(Q) && (Q = D.indexParameters[L[1]]);\n                  for (var re = G; re < Q; re++)\n                    D.supportsUniformBuffers || (oe = oe.replace(/light\\{X\\}.(\\w*)/g, function(Y, k) {\n                      return k + \"{X}\";\n                    })), de += oe.replace(/\\{X\\}/g, re.toString()) + `\n`;\n                } else\n                  D.supportsUniformBuffers || (de = de.replace(/light\\{X\\}.(\\w*)/g, function(Y, k) {\n                    return k + \"{X}\";\n                  })), de = de.replace(/\\{X\\}/g, $);\n              }\n              X = X.replace(U[0], de), j = j || de.indexOf(\"#include<\") >= 0, U = M.exec(b);\n            }\n            j ? this._ProcessIncludes(X.toString(), D, w) : w(X);\n          }, v._FileToolsLoadFile = function(b, D, w, N, M, U) {\n            throw E.a.WarnImport(\"FileTools\");\n          }, v;\n        }();\n      }, function(Be, A, f) {\n        f(26).a.prototype._readTexturePixels = function(V, _, C, u, I, O) {\n          u === void 0 && (u = -1), I === void 0 && (I = 0), O === void 0 && (O = null);\n          var x = this._gl;\n          if (!x)\n            throw new Error(\"Engine does not have gl rendering context.\");\n          if (!this._dummyFramebuffer) {\n            var m = x.createFramebuffer();\n            if (!m)\n              throw new Error(\"Unable to create dummy framebuffer\");\n            this._dummyFramebuffer = m;\n          }\n          x.bindFramebuffer(x.FRAMEBUFFER, this._dummyFramebuffer), u > -1 ? x.framebufferTexture2D(x.FRAMEBUFFER, x.COLOR_ATTACHMENT0, x.TEXTURE_CUBE_MAP_POSITIVE_X + u, V._webGLTexture, I) : x.framebufferTexture2D(x.FRAMEBUFFER, x.COLOR_ATTACHMENT0, x.TEXTURE_2D, V._webGLTexture, I);\n          var c = V.type !== void 0 ? this._getWebGLTextureType(V.type) : x.UNSIGNED_BYTE;\n          switch (c) {\n            case x.UNSIGNED_BYTE:\n              O || (O = new Uint8Array(4 * _ * C)), c = x.UNSIGNED_BYTE;\n              break;\n            default:\n              O || (O = new Float32Array(4 * _ * C)), c = x.FLOAT;\n          }\n          return x.readPixels(0, 0, _, C, x.RGBA, c, O), x.bindFramebuffer(x.FRAMEBUFFER, this._currentFramebuffer), O;\n        };\n      }, function(Be, A, f) {\n        var V = \"shadowsFragmentFunctions\", _ = `#ifdef SHADOWS\n#ifndef SHADOWFLOAT\n\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\n#define inline\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nreturn depth>shadow ? darkness : 1.0;\n}\n#define inline\nfloat computeShadowWithPoissonSamplingCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);\n}\n#define inline\nfloat computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn esm;\n}\n#define inline\nfloat computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn esm;\n}\n#ifdef WEBGL2\n#define inline\nfloat computeShadowCSM(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nvec3 uvLayer=vec3(uv.x,uv.y,layer);\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uvLayer));\n#else\nfloat shadow=texture2D(shadowSampler,uvLayer).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n#endif\n#define inline\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadow=texture2D(shadowSampler,uv).x;\n#endif\nreturn shadowPixelDepth>shadow ? computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff) : 1.;\n}\n}\n#define inline\nfloat computeShadowWithPoissonSampling(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\n#ifndef SHADOWFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[1]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[2]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[3]*mapSize))<shadowPixelDepth) visibility-=0.25;\n#else\nif (texture2D(shadowSampler,uv+poissonDisk[0]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[1]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[2]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[3]*mapSize).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#define inline\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nelse\n{\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n#ifdef WEBGL2\n#define GREATEST_LESS_THAN_ONE 0.99999994\n\n#define inline\nfloat computeShadowWithCSMPCF1(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat shadow=texture(shadowSampler,uvDepthLayer);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF3(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n\n\n#define inline\nfloat computeShadowWithCSMPCF5(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArrayShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[0]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[0]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[0]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[1]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[1]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[1]),layer,uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[0],v[2]),layer,uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[1],v[2]),layer,uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec4(base_uv.xy+vec2(u[2],v[2]),layer,uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n\n#define inline\nfloat computeShadowWithPCF1(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat shadow=texture2D(shadowSampler,uvDepth);\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF3(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\n\n\nvec2 uvw0=3.-2.*st;\nvec2 uvw1=1.+2.*st;\nvec2 u=vec2((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;\nvec2 v=vec2((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow=shadow/16.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n#define inline\nfloat computeShadowWithPCF5(vec4 vPositionFromLight,float depthMetric,highp sampler2DShadow shadowSampler,vec2 shadowMapSizeAndInverse,float darkness,float frustumEdgeFalloff)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nvec2 uv=uvDepth.xy*shadowMapSizeAndInverse.x;\nuv+=0.5;\nvec2 st=fract(uv);\nvec2 base_uv=floor(uv)-0.5;\nbase_uv*=shadowMapSizeAndInverse.y;\n\n\nvec2 uvw0=4.-3.*st;\nvec2 uvw1=vec2(7.);\nvec2 uvw2=1.+3.*st;\nvec3 u=vec3((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;\nvec3 v=vec3((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;\nfloat shadow=0.;\nshadow+=uvw0.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[0]),uvDepth.z));\nshadow+=uvw1.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[0]),uvDepth.z));\nshadow+=uvw2.x*uvw0.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[0]),uvDepth.z));\nshadow+=uvw0.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[1]),uvDepth.z));\nshadow+=uvw1.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[1]),uvDepth.z));\nshadow+=uvw2.x*uvw1.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[1]),uvDepth.z));\nshadow+=uvw0.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[0],v[2]),uvDepth.z));\nshadow+=uvw1.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[1],v[2]),uvDepth.z));\nshadow+=uvw2.x*uvw2.y*texture2D(shadowSampler,vec3(base_uv.xy+vec2(u[2],v[2]),uvDepth.z));\nshadow=shadow/144.;\nshadow=mix(darkness,1.,shadow);\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\nconst vec3 PoissonSamplers32[64]=vec3[64](\nvec3(0.06407013,0.05409927,0.),\nvec3(0.7366577,0.5789394,0.),\nvec3(-0.6270542,-0.5320278,0.),\nvec3(-0.4096107,0.8411095,0.),\nvec3(0.6849564,-0.4990818,0.),\nvec3(-0.874181,-0.04579735,0.),\nvec3(0.9989998,0.0009880066,0.),\nvec3(-0.004920578,-0.9151649,0.),\nvec3(0.1805763,0.9747483,0.),\nvec3(-0.2138451,0.2635818,0.),\nvec3(0.109845,0.3884785,0.),\nvec3(0.06876755,-0.3581074,0.),\nvec3(0.374073,-0.7661266,0.),\nvec3(0.3079132,-0.1216763,0.),\nvec3(-0.3794335,-0.8271583,0.),\nvec3(-0.203878,-0.07715034,0.),\nvec3(0.5912697,0.1469799,0.),\nvec3(-0.88069,0.3031784,0.),\nvec3(0.5040108,0.8283722,0.),\nvec3(-0.5844124,0.5494877,0.),\nvec3(0.6017799,-0.1726654,0.),\nvec3(-0.5554981,0.1559997,0.),\nvec3(-0.3016369,-0.3900928,0.),\nvec3(-0.5550632,-0.1723762,0.),\nvec3(0.925029,0.2995041,0.),\nvec3(-0.2473137,0.5538505,0.),\nvec3(0.9183037,-0.2862392,0.),\nvec3(0.2469421,0.6718712,0.),\nvec3(0.3916397,-0.4328209,0.),\nvec3(-0.03576927,-0.6220032,0.),\nvec3(-0.04661255,0.7995201,0.),\nvec3(0.4402924,0.3640312,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.),\nvec3(0.,0.,0.)\n);\nconst vec3 PoissonSamplers64[64]=vec3[64](\nvec3(-0.613392,0.617481,0.),\nvec3(0.170019,-0.040254,0.),\nvec3(-0.299417,0.791925,0.),\nvec3(0.645680,0.493210,0.),\nvec3(-0.651784,0.717887,0.),\nvec3(0.421003,0.027070,0.),\nvec3(-0.817194,-0.271096,0.),\nvec3(-0.705374,-0.668203,0.),\nvec3(0.977050,-0.108615,0.),\nvec3(0.063326,0.142369,0.),\nvec3(0.203528,0.214331,0.),\nvec3(-0.667531,0.326090,0.),\nvec3(-0.098422,-0.295755,0.),\nvec3(-0.885922,0.215369,0.),\nvec3(0.566637,0.605213,0.),\nvec3(0.039766,-0.396100,0.),\nvec3(0.751946,0.453352,0.),\nvec3(0.078707,-0.715323,0.),\nvec3(-0.075838,-0.529344,0.),\nvec3(0.724479,-0.580798,0.),\nvec3(0.222999,-0.215125,0.),\nvec3(-0.467574,-0.405438,0.),\nvec3(-0.248268,-0.814753,0.),\nvec3(0.354411,-0.887570,0.),\nvec3(0.175817,0.382366,0.),\nvec3(0.487472,-0.063082,0.),\nvec3(-0.084078,0.898312,0.),\nvec3(0.488876,-0.783441,0.),\nvec3(0.470016,0.217933,0.),\nvec3(-0.696890,-0.549791,0.),\nvec3(-0.149693,0.605762,0.),\nvec3(0.034211,0.979980,0.),\nvec3(0.503098,-0.308878,0.),\nvec3(-0.016205,-0.872921,0.),\nvec3(0.385784,-0.393902,0.),\nvec3(-0.146886,-0.859249,0.),\nvec3(0.643361,0.164098,0.),\nvec3(0.634388,-0.049471,0.),\nvec3(-0.688894,0.007843,0.),\nvec3(0.464034,-0.188818,0.),\nvec3(-0.440840,0.137486,0.),\nvec3(0.364483,0.511704,0.),\nvec3(0.034028,0.325968,0.),\nvec3(0.099094,-0.308023,0.),\nvec3(0.693960,-0.366253,0.),\nvec3(0.678884,-0.204688,0.),\nvec3(0.001801,0.780328,0.),\nvec3(0.145177,-0.898984,0.),\nvec3(0.062655,-0.611866,0.),\nvec3(0.315226,-0.604297,0.),\nvec3(-0.780145,0.486251,0.),\nvec3(-0.371868,0.882138,0.),\nvec3(0.200476,0.494430,0.),\nvec3(-0.494552,-0.711051,0.),\nvec3(0.612476,0.705252,0.),\nvec3(-0.578845,-0.768792,0.),\nvec3(-0.772454,-0.090976,0.),\nvec3(0.504440,0.372295,0.),\nvec3(0.155736,0.065157,0.),\nvec3(0.391522,0.849605,0.),\nvec3(-0.620106,-0.328104,0.),\nvec3(0.789239,-0.419965,0.),\nvec3(-0.545396,0.538133,0.),\nvec3(-0.178564,-0.596057,0.)\n);\n\n\n\n\n\n#define inline\nfloat computeShadowWithCSMPCSS(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nuvDepth.z=clamp(uvDepth.z,0.,GREATEST_LESS_THAN_ONE);\nvec4 uvDepthLayer=vec4(uvDepth.x,uvDepth.y,layer,uvDepth.z);\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,vec3(uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);\nvec4 filterRadius=vec4(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec4 offset=vec4(poissonSamplers[i],0.);\n\noffset=vec4(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);\nshadow+=texture2D(shadowSampler,uvDepthLayer+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n\n\n\n\n\n#define inline\nfloat computeShadowWithPCSS(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,int searchTapCount,int pcfTapCount,vec3[64] poissonSamplers)\n{\nif (depthMetric>1.0 || depthMetric<0.0) {\nreturn 1.0;\n}\nelse\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec3 uvDepth=vec3(0.5*clipSpace.xyz+vec3(0.5));\nfloat blockerDepth=0.0;\nfloat sumBlockerDepth=0.0;\nfloat numBlocker=0.0;\nfor (int i=0; i<searchTapCount; i ++) {\nblockerDepth=texture(depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy)).r;\nif (blockerDepth<depthMetric) {\nsumBlockerDepth+=blockerDepth;\nnumBlocker++;\n}\n}\nif (numBlocker<1.0) {\nreturn 1.0;\n}\nelse\n{\nfloat avgBlockerDepth=sumBlockerDepth/numBlocker;\n\nfloat AAOffset=shadowMapSizeInverse*10.;\n\n\nfloat penumbraRatio=((depthMetric-avgBlockerDepth)+AAOffset);\nfloat filterRadius=penumbraRatio*lightSizeUV*shadowMapSizeInverse;\nfloat random=getRand(vPositionFromLight.xy);\nfloat rotationAngle=random*3.1415926;\nvec2 rotationVector=vec2(cos(rotationAngle),sin(rotationAngle));\nfloat shadow=0.;\nfor (int i=0; i<pcfTapCount; i++) {\nvec3 offset=poissonSamplers[i];\n\noffset=vec3(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);\nshadow+=texture2D(shadowSampler,uvDepth+offset*filterRadius);\n}\nshadow/=float(pcfTapCount);\n\nshadow=mix(shadow,1.,depthMetric-avgBlockerDepth);\n\nshadow=mix(darkness,1.,shadow);\n\nreturn computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);\n}\n}\n}\n#define inline\nfloat computeShadowWithPCSS16(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS32(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);\n}\n#define inline\nfloat computeShadowWithPCSS64(vec4 vPositionFromLight,float depthMetric,sampler2D depthSampler,highp sampler2DShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff)\n{\nreturn computeShadowWithPCSS(vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);\n}\n#define inline\nfloat computeShadowWithCSMPCSS16(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS32(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#define inline\nfloat computeShadowWithCSMPCSS64(float layer,vec4 vPositionFromLight,float depthMetric,highp sampler2DArray depthSampler,highp sampler2DArrayShadow shadowSampler,float shadowMapSizeInverse,float lightSizeUV,float darkness,float frustumEdgeFalloff,vec2 lightSizeUVCorrection,float depthCorrection,float penumbraDarkness)\n{\nreturn computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthSampler,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);\n}\n#endif\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"reflectionFunction\", _ = `vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {\n\nvec3 invOrigVec=vec3(1.0,1.0,1.0)/origVec;\nvec3 halfSize=cubeSize*0.5;\nvec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;\nvec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;\n\nvec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);\n\nfloat distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);\n\nvec3 intersectPositionWS=vertexPos+origVec*distance;\n\nreturn intersectPositionWS-cubePos;\n}\nvec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)\n{\nfloat lon=atan(direction.z,direction.x);\nfloat lat=acos(direction.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(1.0-s,t,0);\n}\nvec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);\nvec3 r=normalize(reflect(cameraToVertex,worldNormal));\nr=vec3(reflectionMatrix*vec4(r,0));\nfloat lon=atan(r.z,r.x);\nfloat lat=acos(r.y);\nvec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;\nfloat s=sphereCoords.x*0.5+0.5;\nfloat t=sphereCoords.y;\nreturn vec3(s,t,0);\n}\nvec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr=vec3(reflectionMatrix*vec4(r,0));\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n}\nvec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=worldPos.xyz-eyePosition;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n}\nvec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)\n{\nvec3 viewDir=normalize(worldPos.xyz-eyePosition);\n\nvec3 coords=reflect(viewDir,worldNormal);\ncoords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);\ncoords=vec3(reflectionMatrix*vec4(coords,0));\n#ifdef INVERTCUBICMAP\ncoords.y*=-1.0;\n#endif\nreturn coords;\n}\nvec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*(view*worldPos));\n}\nvec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)\n{\nreturn vec3(reflectionMatrix*vec4(positionW,1.));\n}\n#ifdef REFLECTION\nvec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED\nvec3 direction=normalize(vDirectionW);\nreturn computeFixedEquirectangularCoords(worldPos,worldNormal,direction);\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nreturn computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nreturn computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nreturn computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_CUBIC\n#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC\nreturn computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);\n#else\nreturn computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);\n#endif\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn computeProjectionCoords(worldPos,view,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn computeSkyBoxCoords(vPositionUVW,reflectionMatrix);\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"bumpFragmentMainFunctions\", _ = `#if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\nuniform mat4 normalMatrix;\n#endif\nvec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)\n{\n#ifdef NORMALXYSCALE\nnormal=normalize(normal*vec3(scale,scale,1.0));\n#endif\nreturn normalize(cotangentFrame*normal);\n}\nvec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)\n{\nreturn perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)\n{\n\nuv=gl_FrontFacing ? uv : -uv;\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;\n\ntangent*=tangentSpaceParams.x;\nbitangent*=tangentSpaceParams.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(bitangent,bitangent)));\nreturn mat3(tangent*invmax,bitangent*invmax,normal);\n}\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"bumpFragmentFunctions\", _ = `#if defined(BUMP)\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nreturn perturbNormal(cotangentFrame,texture2D(bumpSampler,uv).xyz,vBumpInfos.y);\n}\n#endif\n#if defined(DETAIL)\n#if DETAILDIRECTUV == 1\n#define vDetailUV vMainUV1\n#elif DETAILDIRECTUV == 2\n#define vDetailUV vMainUV2\n#else\nvarying vec2 vDetailUV;\n#endif\nuniform sampler2D detailSampler;\n#endif\n#if defined(BUMP)\nvec3 perturbNormal(mat3 cotangentFrame,vec3 color)\n{\nreturn perturbNormal(cotangentFrame,color,vBumpInfos.y);\n}\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\nreturn cotangent_frame(normal,p,uv,vTangentSpaceParams);\n}\n#endif\n#if defined(BUMP) && defined(PARALLAX)\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; i<iMaxSamples; i++)\n{\ncurrSampledHeight=texture2D(bumpSampler,vBumpUV+vCurrOffset).w;\n\nif (currSampledHeight>currRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#elif defined(BUMP)\nfloat normalScale=vBumpInfos.y;\n#else\nfloat normalScale=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#elif defined(BUMP)\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vDetailUV,vec2(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW,vPositionW,vMainUV1,vec2(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);\nvec2 detailNormalRG=detailColor.wy*2.0-1.0;\nfloat detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));\nvec3 detailNormal=vec3(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\nnormalW=normalize(texture2D(bumpSampler,vBumpUV).xyz*2.0-1.0);\nnormalW=normalize(mat3(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#else\nvec3 bumpNormal=texture2D(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n\n#if DETAIL_NORMALBLENDMETHOD == 0\ndetailNormal.xy*=vDetailInfos.z;\nvec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD == 1\ndetailNormal.xy*=vDetailInfos.z;\nbumpNormal+=vec3(0.0,0.0,1.0);\ndetailNormal*=vec3(-1.0,-1.0,1.0);\nvec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;\nnormalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif`;\n        f(5).a.IncludesShadersStore.bumpFragment = V;\n      }, function(Be, A, f) {\n        var V = \"lightFragment\", _ = `#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})\n\n#else\n#ifdef PBR\n\n#ifdef SPOTLIGHT{X}\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(POINTLIGHT{X})\npreInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(HEMILIGHT{X})\npreInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#elif defined(DIRLIGHT{X})\npreInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);\n#endif\npreInfo.NdotV=NdotV;\n\n#ifdef SPOTLIGHT{X}\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\npreInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\npreInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\npreInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);\n#endif\n#elif defined(POINTLIGHT{X})\n#ifdef LIGHT_FALLOFF_GLTF{X}\npreInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);\n#elif defined(LIGHT_FALLOFF_PHYSICAL{X})\npreInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);\n#elif defined(LIGHT_FALLOFF_STANDARD{X})\npreInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);\n#else\npreInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);\n#endif\n#else\npreInfo.attenuation=1.0;\n#endif\n\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=roughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n\n#ifdef HEMILIGHT{X}\ninfo.diffuse=computeHemisphericDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb,light{X}.vLightGround);\n#elif defined(SS_TRANSLUCENCY)\ninfo.diffuse=computeDiffuseAndTransmittedLighting(preInfo,light{X}.vLightDiffuse.rgb,subSurfaceOut.transmittance);\n#else\ninfo.diffuse=computeDiffuseLighting(preInfo,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef SPECULARTERM\n#ifdef ANISOTROPIC\ninfo.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#else\ninfo.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n#endif\n\n#ifdef SHEEN\n#ifdef SHEEN_LINKWITHALBEDO\n\npreInfo.roughness=sheenOut.sheenIntensity;\n#else\n#ifdef HEMILIGHT{X}\npreInfo.roughness=sheenOut.sheenRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\n#endif\ninfo.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,light{X}.vLightDiffuse.rgb);\n#endif\n\n#ifdef CLEARCOAT\n\n#ifdef HEMILIGHT{X}\npreInfo.roughness=clearcoatOut.clearCoatRoughness;\n#else\npreInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);\n#endif\ninfo.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light{X}.vLightDiffuse.rgb);\n#ifdef CLEARCOAT_TINT\n\nabsorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);\ninfo.diffuse*=absorption;\n#ifdef SPECULARTERM\ninfo.specular*=absorption;\n#endif\n#endif\n\ninfo.diffuse*=info.clearCoat.w;\n#ifdef SPECULARTERM\ninfo.specular*=info.clearCoat.w;\n#endif\n#ifdef SHEEN\ninfo.sheen*=info.clearCoat.w;\n#endif\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#elif defined(HEMILIGHT{X})\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);\n#elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#ifdef PROJECTEDLIGHTTEXTURE{X}\ninfo.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightSampler{X},textureProjectionMatrix{X});\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCSM{X}\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)\n{\n#ifdef SHADOWCSM_RIGHTHANDED{X}\ndiff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;\n#else\ndiff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;\n#endif\nif (diff{X}>=0.) {\nindex{X}=i;\nbreak;\n}\n}\n#ifdef SHADOWCSMUSESHADOWMAXZ{X}\nif (index{X}>=0)\n#endif\n{\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nshadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nshadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];\n#endif\n#ifndef SHADOWCSMNOBLEND{X}\nfloat frustumLength=frustumLengths{X}[index{X}];\nfloat diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};\nif (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)\n{\nindex{X}+=1;\nfloat nextShadow=0.;\n#if defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nnextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#elif defined(SHADOWMEDIUMQUALITY{X})\nnextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#else\nnextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});\n#endif\n#else\nnextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\nshadow=mix(nextShadow,shadow,diffRatio);\n#ifdef SHADOWCSMDEBUG{X}\nshadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);\n#endif\n}\n#endif\n}\n#elif defined(SHADOWCLOSEESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWESM{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPOISSON{X})\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPoissonSamplingCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCF{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#elif defined(SHADOWPCSS{X})\n#if defined(SHADOWLOWQUALITY{X})\nshadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#elif defined(SHADOWMEDIUMQUALITY{X})\nshadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#else\nshadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthSampler{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor.rgb*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef CLEARCOAT\n#ifndef LIGHTMAPNOSPECULAR{X}\nclearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;\n#endif\n#endif\n#ifdef SHEEN\n#ifndef LIGHTMAPNOSPECULAR{X}\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#else\n#ifdef SHADOWCSMDEBUG{X}\ndiffuseBase+=info.diffuse*shadowDebug{X};\n#else\ndiffuseBase+=info.diffuse*shadow;\n#endif\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#ifdef CLEARCOAT\nclearCoatBase+=info.clearCoat.rgb*shadow;\n#endif\n#ifdef SHEEN\nsheenBase+=info.sheen.rgb*shadow;\n#endif\n#endif\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif`;\n        f(5).a.IncludesShadersStore.fogFragment = V;\n      }, function(Be, A, f) {\n        var V = \"fogVertexDeclaration\", _ = `#ifdef FOG\nvarying vec3 vFogDistance;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"shadowsVertex\", _ = `#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\nvPositionFromCamera{X}=view*worldPos;\nfor (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++) {\nvPositionFromLight{X}[i]=lightMatrix{X}[i]*worldPos;\nvDepthMetric{X}[i]=((vPositionFromLight{X}[i].z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n}\n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\nvDepthMetric{X}=((vPositionFromLight{X}.z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.Eval = function(C, u) {\n            return (C = C.match(/\\([^\\(\\)]*\\)/g) ? C.replace(/\\([^\\(\\)]*\\)/g, function(I) {\n              return I = I.slice(1, I.length - 1), _._HandleParenthesisContent(I, u);\n            }) : _._HandleParenthesisContent(C, u)) === \"true\" || C !== \"false\" && _.Eval(C, u);\n          }, _._HandleParenthesisContent = function(C, u) {\n            var I;\n            u = u || function(E) {\n              return E === \"true\";\n            };\n            var O = C.split(\"||\");\n            for (var x in O)\n              if (O.hasOwnProperty(x)) {\n                var m = _._SimplifyNegation(O[x].trim()), c = m.split(\"&&\");\n                if (c.length > 1)\n                  for (var T = 0; T < c.length; ++T) {\n                    var S = _._SimplifyNegation(c[T].trim());\n                    if (!(I = S !== \"true\" && S !== \"false\" ? S[0] === \"!\" ? !u(S.substring(1)) : u(S) : S === \"true\")) {\n                      m = \"false\";\n                      break;\n                    }\n                  }\n                if (I || m === \"true\") {\n                  I = !0;\n                  break;\n                }\n                I = m !== \"true\" && m !== \"false\" ? m[0] === \"!\" ? !u(m.substring(1)) : u(m) : m === \"true\";\n              }\n            return I ? \"true\" : \"false\";\n          }, _._SimplifyNegation = function(C) {\n            return (C = (C = C.replace(/^[\\s!]+/, function(u) {\n              return (u = u.replace(/[\\s]/g, function() {\n                return \"\";\n              })).length % 2 ? \"!\" : \"\";\n            })).trim()) === \"!true\" ? C = \"false\" : C === \"!false\" && (C = \"true\"), C;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.ExponentialBackoff = function(C, u) {\n            return C === void 0 && (C = 3), u === void 0 && (u = 500), function(I, O, x) {\n              return O.status !== 0 || x >= C || I.indexOf(\"file:\") !== -1 ? -1 : Math.pow(2, x) * u;\n            };\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._isDepthTestDirty = !1, this._isDepthMaskDirty = !1, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1, this.reset();\n          }\n          return Object.defineProperty(_.prototype, \"isDirty\", { get: function() {\n            return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"zOffset\", { get: function() {\n            return this._zOffset;\n          }, set: function(C) {\n            this._zOffset !== C && (this._zOffset = C, this._isZOffsetDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"cullFace\", { get: function() {\n            return this._cullFace;\n          }, set: function(C) {\n            this._cullFace !== C && (this._cullFace = C, this._isCullFaceDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"cull\", { get: function() {\n            return this._cull;\n          }, set: function(C) {\n            this._cull !== C && (this._cull = C, this._isCullDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"depthFunc\", { get: function() {\n            return this._depthFunc;\n          }, set: function(C) {\n            this._depthFunc !== C && (this._depthFunc = C, this._isDepthFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"depthMask\", { get: function() {\n            return this._depthMask;\n          }, set: function(C) {\n            this._depthMask !== C && (this._depthMask = C, this._isDepthMaskDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"depthTest\", { get: function() {\n            return this._depthTest;\n          }, set: function(C) {\n            this._depthTest !== C && (this._depthTest = C, this._isDepthTestDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"frontFace\", { get: function() {\n            return this._frontFace;\n          }, set: function(C) {\n            this._frontFace !== C && (this._frontFace = C, this._isFrontFaceDirty = !0);\n          }, enumerable: !1, configurable: !0 }), _.prototype.reset = function() {\n            this._depthMask = !0, this._depthTest = !0, this._depthFunc = null, this._cullFace = null, this._cull = null, this._zOffset = 0, this._frontFace = null, this._isDepthTestDirty = !0, this._isDepthMaskDirty = !0, this._isDepthFuncDirty = !1, this._isCullFaceDirty = !1, this._isCullDirty = !1, this._isZOffsetDirty = !1, this._isFrontFaceDirty = !1;\n          }, _.prototype.apply = function(C) {\n            this.isDirty && (this._isCullDirty && (this.cull ? C.enable(C.CULL_FACE) : C.disable(C.CULL_FACE), this._isCullDirty = !1), this._isCullFaceDirty && (C.cullFace(this.cullFace), this._isCullFaceDirty = !1), this._isDepthMaskDirty && (C.depthMask(this.depthMask), this._isDepthMaskDirty = !1), this._isDepthTestDirty && (this.depthTest ? C.enable(C.DEPTH_TEST) : C.disable(C.DEPTH_TEST), this._isDepthTestDirty = !1), this._isDepthFuncDirty && (C.depthFunc(this.depthFunc), this._isDepthFuncDirty = !1), this._isZOffsetDirty && (this.zOffset ? (C.enable(C.POLYGON_OFFSET_FILL), C.polygonOffset(this.zOffset, 0)) : C.disable(C.POLYGON_OFFSET_FILL), this._isZOffsetDirty = !1), this._isFrontFaceDirty && (C.frontFace(this.frontFace), this._isFrontFaceDirty = !1));\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(2), _ = function() {\n          function C() {\n            this._isStencilTestDirty = !1, this._isStencilMaskDirty = !1, this._isStencilFuncDirty = !1, this._isStencilOpDirty = !1, this.reset();\n          }\n          return Object.defineProperty(C.prototype, \"isDirty\", { get: function() {\n            return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilFunc\", { get: function() {\n            return this._stencilFunc;\n          }, set: function(u) {\n            this._stencilFunc !== u && (this._stencilFunc = u, this._isStencilFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilFuncRef\", { get: function() {\n            return this._stencilFuncRef;\n          }, set: function(u) {\n            this._stencilFuncRef !== u && (this._stencilFuncRef = u, this._isStencilFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilFuncMask\", { get: function() {\n            return this._stencilFuncMask;\n          }, set: function(u) {\n            this._stencilFuncMask !== u && (this._stencilFuncMask = u, this._isStencilFuncDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilOpStencilFail\", { get: function() {\n            return this._stencilOpStencilFail;\n          }, set: function(u) {\n            this._stencilOpStencilFail !== u && (this._stencilOpStencilFail = u, this._isStencilOpDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilOpDepthFail\", { get: function() {\n            return this._stencilOpDepthFail;\n          }, set: function(u) {\n            this._stencilOpDepthFail !== u && (this._stencilOpDepthFail = u, this._isStencilOpDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilOpStencilDepthPass\", { get: function() {\n            return this._stencilOpStencilDepthPass;\n          }, set: function(u) {\n            this._stencilOpStencilDepthPass !== u && (this._stencilOpStencilDepthPass = u, this._isStencilOpDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilMask\", { get: function() {\n            return this._stencilMask;\n          }, set: function(u) {\n            this._stencilMask !== u && (this._stencilMask = u, this._isStencilMaskDirty = !0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(C.prototype, \"stencilTest\", { get: function() {\n            return this._stencilTest;\n          }, set: function(u) {\n            this._stencilTest !== u && (this._stencilTest = u, this._isStencilTestDirty = !0);\n          }, enumerable: !1, configurable: !0 }), C.prototype.reset = function() {\n            this._stencilTest = !1, this._stencilMask = 255, this._stencilFunc = C.ALWAYS, this._stencilFuncRef = 1, this._stencilFuncMask = 255, this._stencilOpStencilFail = C.KEEP, this._stencilOpDepthFail = C.KEEP, this._stencilOpStencilDepthPass = C.REPLACE, this._isStencilTestDirty = !0, this._isStencilMaskDirty = !0, this._isStencilFuncDirty = !0, this._isStencilOpDirty = !0;\n          }, C.prototype.apply = function(u) {\n            this.isDirty && (this._isStencilTestDirty && (this.stencilTest ? u.enable(u.STENCIL_TEST) : u.disable(u.STENCIL_TEST), this._isStencilTestDirty = !1), this._isStencilMaskDirty && (u.stencilMask(this.stencilMask), this._isStencilMaskDirty = !1), this._isStencilFuncDirty && (u.stencilFunc(this.stencilFunc, this.stencilFuncRef, this.stencilFuncMask), this._isStencilFuncDirty = !1), this._isStencilOpDirty && (u.stencilOp(this.stencilOpStencilFail, this.stencilOpDepthFail, this.stencilOpStencilDepthPass), this._isStencilOpDirty = !1));\n          }, C.ALWAYS = V.a.ALWAYS, C.KEEP = V.a.KEEP, C.REPLACE = V.a.REPLACE, C;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this._isAlphaBlendDirty = !1, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1, this._alphaBlend = !1, this._blendFunctionParameters = new Array(4), this._blendEquationParameters = new Array(2), this._blendConstants = new Array(4), this.reset();\n          }\n          return Object.defineProperty(_.prototype, \"isDirty\", { get: function() {\n            return this._isAlphaBlendDirty || this._isBlendFunctionParametersDirty;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"alphaBlend\", { get: function() {\n            return this._alphaBlend;\n          }, set: function(C) {\n            this._alphaBlend !== C && (this._alphaBlend = C, this._isAlphaBlendDirty = !0);\n          }, enumerable: !1, configurable: !0 }), _.prototype.setAlphaBlendConstants = function(C, u, I, O) {\n            this._blendConstants[0] === C && this._blendConstants[1] === u && this._blendConstants[2] === I && this._blendConstants[3] === O || (this._blendConstants[0] = C, this._blendConstants[1] = u, this._blendConstants[2] = I, this._blendConstants[3] = O, this._isBlendConstantsDirty = !0);\n          }, _.prototype.setAlphaBlendFunctionParameters = function(C, u, I, O) {\n            this._blendFunctionParameters[0] === C && this._blendFunctionParameters[1] === u && this._blendFunctionParameters[2] === I && this._blendFunctionParameters[3] === O || (this._blendFunctionParameters[0] = C, this._blendFunctionParameters[1] = u, this._blendFunctionParameters[2] = I, this._blendFunctionParameters[3] = O, this._isBlendFunctionParametersDirty = !0);\n          }, _.prototype.setAlphaEquationParameters = function(C, u) {\n            this._blendEquationParameters[0] === C && this._blendEquationParameters[1] === u || (this._blendEquationParameters[0] = C, this._blendEquationParameters[1] = u, this._isBlendEquationParametersDirty = !0);\n          }, _.prototype.reset = function() {\n            this._alphaBlend = !1, this._blendFunctionParameters[0] = null, this._blendFunctionParameters[1] = null, this._blendFunctionParameters[2] = null, this._blendFunctionParameters[3] = null, this._blendEquationParameters[0] = null, this._blendEquationParameters[1] = null, this._blendConstants[0] = null, this._blendConstants[1] = null, this._blendConstants[2] = null, this._blendConstants[3] = null, this._isAlphaBlendDirty = !0, this._isBlendFunctionParametersDirty = !1, this._isBlendEquationParametersDirty = !1, this._isBlendConstantsDirty = !1;\n          }, _.prototype.apply = function(C) {\n            this.isDirty && (this._isAlphaBlendDirty && (this._alphaBlend ? C.enable(C.BLEND) : C.disable(C.BLEND), this._isAlphaBlendDirty = !1), this._isBlendFunctionParametersDirty && (C.blendFuncSeparate(this._blendFunctionParameters[0], this._blendFunctionParameters[1], this._blendFunctionParameters[2], this._blendFunctionParameters[3]), this._isBlendFunctionParametersDirty = !1), this._isBlendEquationParametersDirty && (C.blendEquationSeparate(this._blendEquationParameters[0], this._blendEquationParameters[1]), this._isBlendEquationParametersDirty = !1), this._isBlendConstantsDirty && (C.blendColor(this._blendConstants[0], this._blendConstants[1], this._blendConstants[2], this._blendConstants[3]), this._isBlendConstantsDirty = !1));\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n            this.vertexCompilationError = null, this.fragmentCompilationError = null, this.programLinkError = null, this.programValidationError = null;\n          }\n          return Object.defineProperty(_.prototype, \"isAsync\", { get: function() {\n            return this.isParallelCompiled;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(_.prototype, \"isReady\", { get: function() {\n            return !!this.program && (!this.isParallelCompiled || this.engine._isRenderingStateCompiled(this));\n          }, enumerable: !1, configurable: !0 }), _.prototype._handlesSpectorRebuildCallback = function(C) {\n            C && this.program && C(this.program);\n          }, _.prototype._getVertexShaderCode = function() {\n            return this.vertexShader ? this.engine._getShaderSource(this.vertexShader) : null;\n          }, _.prototype._getFragmentShaderCode = function() {\n            return this.fragmentShader ? this.engine._getShaderSource(this.fragmentShader) : null;\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        var V;\n        f.d(A, \"a\", function() {\n          return u;\n        }), function(I) {\n          I[I.Pending = 0] = \"Pending\", I[I.Fulfilled = 1] = \"Fulfilled\", I[I.Rejected = 2] = \"Rejected\";\n        }(V || (V = {}));\n        var _ = function() {\n          this.count = 0, this.target = 0, this.results = [];\n        }, C = function() {\n          function I(O) {\n            var x = this;\n            if (this._state = V.Pending, this._children = new Array(), this._rejectWasConsumed = !1, O)\n              try {\n                O(function(m) {\n                  x._resolve(m);\n                }, function(m) {\n                  x._reject(m);\n                });\n              } catch (m) {\n                this._reject(m);\n              }\n          }\n          return Object.defineProperty(I.prototype, \"_result\", { get: function() {\n            return this._resultValue;\n          }, set: function(O) {\n            this._resultValue = O, this._parent && this._parent._result === void 0 && (this._parent._result = O);\n          }, enumerable: !1, configurable: !0 }), I.prototype.catch = function(O) {\n            return this.then(void 0, O);\n          }, I.prototype.then = function(O, x) {\n            var m = this, c = new I();\n            return c._onFulfilled = O, c._onRejected = x, this._children.push(c), c._parent = this, this._state !== V.Pending && setTimeout(function() {\n              if (m._state === V.Fulfilled || m._rejectWasConsumed) {\n                var T = c._resolve(m._result);\n                if (T != null)\n                  if (T._state !== void 0) {\n                    var S = T;\n                    c._children.push(S), S._parent = c, c = S;\n                  } else\n                    c._result = T;\n              } else\n                c._reject(m._reason);\n            }), c;\n          }, I.prototype._moveChildren = function(O) {\n            var x, m = this;\n            if ((x = this._children).push.apply(x, O.splice(0, O.length)), this._children.forEach(function(g) {\n              g._parent = m;\n            }), this._state === V.Fulfilled)\n              for (var c = 0, T = this._children; c < T.length; c++)\n                T[c]._resolve(this._result);\n            else if (this._state === V.Rejected)\n              for (var S = 0, E = this._children; S < E.length; S++)\n                E[S]._reject(this._reason);\n          }, I.prototype._resolve = function(O) {\n            try {\n              this._state = V.Fulfilled;\n              var x = null;\n              if (this._onFulfilled && (x = this._onFulfilled(O)), x != null)\n                if (x._state !== void 0) {\n                  var m = x;\n                  m._parent = this, m._moveChildren(this._children), O = m._result;\n                } else\n                  O = x;\n              this._result = O;\n              for (var c = 0, T = this._children; c < T.length; c++)\n                T[c]._resolve(O);\n              this._children.length = 0, delete this._onFulfilled, delete this._onRejected;\n            } catch (S) {\n              this._reject(S, !0);\n            }\n          }, I.prototype._reject = function(O, x) {\n            if (x === void 0 && (x = !1), this._state = V.Rejected, this._reason = O, this._onRejected && !x)\n              try {\n                this._onRejected(O), this._rejectWasConsumed = !0;\n              } catch (S) {\n                O = S;\n              }\n            for (var m = 0, c = this._children; m < c.length; m++) {\n              var T = c[m];\n              this._rejectWasConsumed ? T._resolve(null) : T._reject(O);\n            }\n            this._children.length = 0, delete this._onFulfilled, delete this._onRejected;\n          }, I.resolve = function(O) {\n            var x = new I();\n            return x._resolve(O), x;\n          }, I._RegisterForFulfillment = function(O, x, m) {\n            O.then(function(c) {\n              return x.results[m] = c, x.count++, x.count === x.target && x.rootPromise._resolve(x.results), null;\n            }, function(c) {\n              x.rootPromise._state !== V.Rejected && x.rootPromise._reject(c);\n            });\n          }, I.all = function(O) {\n            var x = new I(), m = new _();\n            if (m.target = O.length, m.rootPromise = x, O.length)\n              for (var c = 0; c < O.length; c++)\n                I._RegisterForFulfillment(O[c], m, c);\n            else\n              x._resolve([]);\n            return x;\n          }, I.race = function(O) {\n            var x = new I();\n            if (O.length)\n              for (var m = 0, c = O; m < c.length; m++)\n                c[m].then(function(T) {\n                  return x && (x._resolve(T), x = null), null;\n                }, function(T) {\n                  x && (x._reject(T), x = null);\n                });\n            return x;\n          }, I;\n        }(), u = function() {\n          function I() {\n          }\n          return I.Apply = function(O) {\n            O === void 0 && (O = !1), (O || typeof Promise > \"u\") && (window.Promise = C);\n          }, I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        }), f.d(A, \"b\", function() {\n          return C;\n        });\n        var V = f(57), _ = function() {\n          function u(I) {\n            I === void 0 && (I = 30), this._enabled = !0, this._rollingFrameTime = new C(I);\n          }\n          return u.prototype.sampleFrame = function(I) {\n            if (I === void 0 && (I = V.a.Now), this._enabled) {\n              if (this._lastFrameTimeMs != null) {\n                var O = I - this._lastFrameTimeMs;\n                this._rollingFrameTime.add(O);\n              }\n              this._lastFrameTimeMs = I;\n            }\n          }, Object.defineProperty(u.prototype, \"averageFrameTime\", { get: function() {\n            return this._rollingFrameTime.average;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"averageFrameTimeVariance\", { get: function() {\n            return this._rollingFrameTime.variance;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"instantaneousFrameTime\", { get: function() {\n            return this._rollingFrameTime.history(0);\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"averageFPS\", { get: function() {\n            return 1e3 / this._rollingFrameTime.average;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"instantaneousFPS\", { get: function() {\n            var I = this._rollingFrameTime.history(0);\n            return I === 0 ? 0 : 1e3 / I;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(u.prototype, \"isSaturated\", { get: function() {\n            return this._rollingFrameTime.isSaturated();\n          }, enumerable: !1, configurable: !0 }), u.prototype.enable = function() {\n            this._enabled = !0;\n          }, u.prototype.disable = function() {\n            this._enabled = !1, this._lastFrameTimeMs = null;\n          }, Object.defineProperty(u.prototype, \"isEnabled\", { get: function() {\n            return this._enabled;\n          }, enumerable: !1, configurable: !0 }), u.prototype.reset = function() {\n            this._lastFrameTimeMs = null, this._rollingFrameTime.reset();\n          }, u;\n        }(), C = function() {\n          function u(I) {\n            this._samples = new Array(I), this.reset();\n          }\n          return u.prototype.add = function(I) {\n            var O;\n            if (this.isSaturated()) {\n              var x = this._samples[this._pos];\n              O = x - this.average, this.average -= O / (this._sampleCount - 1), this._m2 -= O * (x - this.average);\n            } else\n              this._sampleCount++;\n            O = I - this.average, this.average += O / this._sampleCount, this._m2 += O * (I - this.average), this.variance = this._m2 / (this._sampleCount - 1), this._samples[this._pos] = I, this._pos++, this._pos %= this._samples.length;\n          }, u.prototype.history = function(I) {\n            if (I >= this._sampleCount || I >= this._samples.length)\n              return 0;\n            var O = this._wrapPosition(this._pos - 1);\n            return this._samples[this._wrapPosition(O - I)];\n          }, u.prototype.isSaturated = function() {\n            return this._sampleCount >= this._samples.length;\n          }, u.prototype.reset = function() {\n            this.average = 0, this.variance = 0, this._sampleCount = 0, this._pos = 0, this._m2 = 0;\n          }, u.prototype._wrapPosition = function(I) {\n            var O = this._samples.length;\n            return (I % O + O) % O;\n          }, u;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return _;\n        });\n        var V = f(0), _ = function() {\n          this._checkCollisions = !1, this._collisionMask = -1, this._collisionGroup = -1, this._surroundingMeshes = null, this._collider = null, this._oldPositionForCollisions = new V.e(0, 0, 0), this._diffPositionForCollisions = new V.e(0, 0, 0), this._collisionResponse = !0;\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return u;\n        });\n        var V = f(33), _ = f(0), C = f(2), u = function() {\n          function I(O, x, m, c, T) {\n            m === void 0 && (m = null), c === void 0 && (c = null), T === void 0 && (T = null), this.index = O, this._opaqueSubMeshes = new V.a(256), this._transparentSubMeshes = new V.a(256), this._alphaTestSubMeshes = new V.a(256), this._depthOnlySubMeshes = new V.a(256), this._particleSystems = new V.a(256), this._spriteManagers = new V.a(256), this._edgesRenderers = new V.b(16), this._scene = x, this.opaqueSortCompareFn = m, this.alphaTestSortCompareFn = c, this.transparentSortCompareFn = T;\n          }\n          return Object.defineProperty(I.prototype, \"opaqueSortCompareFn\", { set: function(O) {\n            this._opaqueSortCompareFn = O, this._renderOpaque = O ? this.renderOpaqueSorted : I.renderUnsorted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"alphaTestSortCompareFn\", { set: function(O) {\n            this._alphaTestSortCompareFn = O, this._renderAlphaTest = O ? this.renderAlphaTestSorted : I.renderUnsorted;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(I.prototype, \"transparentSortCompareFn\", { set: function(O) {\n            this._transparentSortCompareFn = O || I.defaultTransparentSortCompare, this._renderTransparent = this.renderTransparentSorted;\n          }, enumerable: !1, configurable: !0 }), I.prototype.render = function(O, x, m, c) {\n            if (O)\n              O(this._opaqueSubMeshes, this._alphaTestSubMeshes, this._transparentSubMeshes, this._depthOnlySubMeshes);\n            else {\n              var T = this._scene.getEngine();\n              this._depthOnlySubMeshes.length !== 0 && (T.setColorWrite(!1), this._renderAlphaTest(this._depthOnlySubMeshes), T.setColorWrite(!0)), this._opaqueSubMeshes.length !== 0 && this._renderOpaque(this._opaqueSubMeshes), this._alphaTestSubMeshes.length !== 0 && this._renderAlphaTest(this._alphaTestSubMeshes);\n              var S = T.getStencilBuffer();\n              if (T.setStencilBuffer(!1), x && this._renderSprites(), m && this._renderParticles(c), this.onBeforeTransparentRendering && this.onBeforeTransparentRendering(), this._transparentSubMeshes.length !== 0 && (T.setStencilBuffer(S), this._renderTransparent(this._transparentSubMeshes), T.setAlphaMode(C.a.ALPHA_DISABLE)), T.setStencilBuffer(!1), this._edgesRenderers.length) {\n                for (var E = 0; E < this._edgesRenderers.length; E++)\n                  this._edgesRenderers.data[E].render();\n                T.setAlphaMode(C.a.ALPHA_DISABLE);\n              }\n              T.setStencilBuffer(S);\n            }\n          }, I.prototype.renderOpaqueSorted = function(O) {\n            return I.renderSorted(O, this._opaqueSortCompareFn, this._scene.activeCamera, !1);\n          }, I.prototype.renderAlphaTestSorted = function(O) {\n            return I.renderSorted(O, this._alphaTestSortCompareFn, this._scene.activeCamera, !1);\n          }, I.prototype.renderTransparentSorted = function(O) {\n            return I.renderSorted(O, this._transparentSortCompareFn, this._scene.activeCamera, !0);\n          }, I.renderSorted = function(O, x, m, c) {\n            for (var T, S = 0, E = m ? m.globalPosition : I._zeroVector; S < O.length; S++)\n              (T = O.data[S])._alphaIndex = T.getMesh().alphaIndex, T._distanceToCamera = _.e.Distance(T.getBoundingInfo().boundingSphere.centerWorld, E);\n            var g = O.data.slice(0, O.length);\n            for (x && g.sort(x), S = 0; S < g.length; S++) {\n              if (T = g[S], c) {\n                var l = T.getMaterial();\n                if (l && l.needDepthPrePass) {\n                  var h = l.getScene().getEngine();\n                  h.setColorWrite(!1), h.setAlphaMode(C.a.ALPHA_DISABLE), T.render(!1), h.setColorWrite(!0);\n                }\n              }\n              T.render(c);\n            }\n          }, I.renderUnsorted = function(O) {\n            for (var x = 0; x < O.length; x++)\n              O.data[x].render(!1);\n          }, I.defaultTransparentSortCompare = function(O, x) {\n            return O._alphaIndex > x._alphaIndex ? 1 : O._alphaIndex < x._alphaIndex ? -1 : I.backToFrontSortCompare(O, x);\n          }, I.backToFrontSortCompare = function(O, x) {\n            return O._distanceToCamera < x._distanceToCamera ? 1 : O._distanceToCamera > x._distanceToCamera ? -1 : 0;\n          }, I.frontToBackSortCompare = function(O, x) {\n            return O._distanceToCamera < x._distanceToCamera ? -1 : O._distanceToCamera > x._distanceToCamera ? 1 : 0;\n          }, I.prototype.prepare = function() {\n            this._opaqueSubMeshes.reset(), this._transparentSubMeshes.reset(), this._alphaTestSubMeshes.reset(), this._depthOnlySubMeshes.reset(), this._particleSystems.reset(), this._spriteManagers.reset(), this._edgesRenderers.reset();\n          }, I.prototype.dispose = function() {\n            this._opaqueSubMeshes.dispose(), this._transparentSubMeshes.dispose(), this._alphaTestSubMeshes.dispose(), this._depthOnlySubMeshes.dispose(), this._particleSystems.dispose(), this._spriteManagers.dispose(), this._edgesRenderers.dispose();\n          }, I.prototype.dispatch = function(O, x, m) {\n            x === void 0 && (x = O.getMesh()), m === void 0 && (m = O.getMaterial()), m != null && (m.needAlphaBlendingForMesh(x) ? this._transparentSubMeshes.push(O) : m.needAlphaTesting() ? (m.needDepthPrePass && this._depthOnlySubMeshes.push(O), this._alphaTestSubMeshes.push(O)) : (m.needDepthPrePass && this._depthOnlySubMeshes.push(O), this._opaqueSubMeshes.push(O)), x._renderingGroup = this, x._edgesRenderer && x._edgesRenderer.isEnabled && this._edgesRenderers.pushNoDuplicate(x._edgesRenderer));\n          }, I.prototype.dispatchSprites = function(O) {\n            this._spriteManagers.push(O);\n          }, I.prototype.dispatchParticles = function(O) {\n            this._particleSystems.push(O);\n          }, I.prototype._renderParticles = function(O) {\n            if (this._particleSystems.length !== 0) {\n              var x = this._scene.activeCamera;\n              this._scene.onBeforeParticlesRenderingObservable.notifyObservers(this._scene);\n              for (var m = 0; m < this._particleSystems.length; m++) {\n                var c = this._particleSystems.data[m];\n                if ((x && x.layerMask & c.layerMask) !== 0) {\n                  var T = c.emitter;\n                  T.position && O && O.indexOf(T) === -1 || this._scene._activeParticles.addCount(c.render(), !1);\n                }\n              }\n              this._scene.onAfterParticlesRenderingObservable.notifyObservers(this._scene);\n            }\n          }, I.prototype._renderSprites = function() {\n            if (this._scene.spritesEnabled && this._spriteManagers.length !== 0) {\n              var O = this._scene.activeCamera;\n              this._scene.onBeforeSpritesRenderingObservable.notifyObservers(this._scene);\n              for (var x = 0; x < this._spriteManagers.length; x++) {\n                var m = this._spriteManagers.data[x];\n                (O && O.layerMask & m.layerMask) !== 0 && m.render();\n              }\n              this._scene.onAfterSpritesRenderingObservable.notifyObservers(this._scene);\n            }\n          }, I._zeroVector = _.e.Zero(), I;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function(_, C) {\n          this.distance = _, this.mesh = C;\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return _.GenerateBase64StringFromTexture = function(C, u, I) {\n            u === void 0 && (u = 0), I === void 0 && (I = 0);\n            var O = C.getInternalTexture();\n            if (!O)\n              return null;\n            var x = C.readPixels(u, I);\n            if (!x)\n              return null;\n            var m = C.getSize(), c = m.width, T = m.height;\n            if (x instanceof Float32Array) {\n              for (var S = x.byteLength / x.BYTES_PER_ELEMENT, E = new Uint8Array(S); --S >= 0; ) {\n                var g = x[S];\n                g < 0 ? g = 0 : g > 1 && (g = 1), E[S] = 255 * g;\n              }\n              x = E;\n            }\n            var l = document.createElement(\"canvas\");\n            l.width = c, l.height = T;\n            var h = l.getContext(\"2d\");\n            if (!h)\n              return null;\n            var v = h.createImageData(c, T);\n            if (v.data.set(x), h.putImageData(v, 0, 0), O.invertY) {\n              var b = document.createElement(\"canvas\");\n              b.width = c, b.height = T;\n              var D = b.getContext(\"2d\");\n              return D ? (D.translate(0, T), D.scale(1, -1), D.drawImage(l, 0, 0), b.toDataURL(\"image/png\")) : null;\n            }\n            return l.toDataURL(\"image/png\");\n          }, _;\n        }();\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return S;\n        });\n        var V = f(1), _ = f(0), C = f(8), u = f(31), I = f(7), O = f(41), x = f(46), m = f(4), c = f(43), T = f(12);\n        I.a._instancedMeshFactory = function(E, g) {\n          var l = new S(E, g);\n          if (g.instancedBuffers)\n            for (var h in l.instancedBuffers = {}, g.instancedBuffers)\n              l.instancedBuffers[h] = g.instancedBuffers[h];\n          return l;\n        };\n        var S = function(E) {\n          function g(l, h) {\n            var v = E.call(this, l, h.getScene()) || this;\n            v._indexInSourceMeshInstanceArray = -1, h.addInstance(v), v._sourceMesh = h, v._unIndexed = h._unIndexed, v.position.copyFrom(h.position), v.rotation.copyFrom(h.rotation), v.scaling.copyFrom(h.scaling), h.rotationQuaternion && (v.rotationQuaternion = h.rotationQuaternion.clone()), v.animations = T.b.Slice(h.animations);\n            for (var b = 0, D = h.getAnimationRanges(); b < D.length; b++) {\n              var w = D[b];\n              w != null && v.createAnimationRange(w.name, w.from, w.to);\n            }\n            return v.infiniteDistance = h.infiniteDistance, v.setPivotMatrix(h.getPivotMatrix()), v.refreshBoundingInfo(), v._syncSubMeshes(), v;\n          }\n          return Object(V.d)(g, E), g.prototype.getClassName = function() {\n            return \"InstancedMesh\";\n          }, Object.defineProperty(g.prototype, \"lightSources\", { get: function() {\n            return this._sourceMesh._lightSources;\n          }, enumerable: !1, configurable: !0 }), g.prototype._resyncLightSources = function() {\n          }, g.prototype._resyncLightSource = function(l) {\n          }, g.prototype._removeLightSource = function(l, h) {\n          }, Object.defineProperty(g.prototype, \"receiveShadows\", { get: function() {\n            return this._sourceMesh.receiveShadows;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"material\", { get: function() {\n            return this._sourceMesh.material;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"visibility\", { get: function() {\n            return this._sourceMesh.visibility;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"skeleton\", { get: function() {\n            return this._sourceMesh.skeleton;\n          }, enumerable: !1, configurable: !0 }), Object.defineProperty(g.prototype, \"renderingGroupId\", { get: function() {\n            return this._sourceMesh.renderingGroupId;\n          }, set: function(l) {\n            this._sourceMesh && l !== this._sourceMesh.renderingGroupId && C.a.Warn(\"Note - setting renderingGroupId of an instanced mesh has no effect on the scene\");\n          }, enumerable: !1, configurable: !0 }), g.prototype.getTotalVertices = function() {\n            return this._sourceMesh ? this._sourceMesh.getTotalVertices() : 0;\n          }, g.prototype.getTotalIndices = function() {\n            return this._sourceMesh.getTotalIndices();\n          }, Object.defineProperty(g.prototype, \"sourceMesh\", { get: function() {\n            return this._sourceMesh;\n          }, enumerable: !1, configurable: !0 }), g.prototype.createInstance = function(l) {\n            return this._sourceMesh.createInstance(l);\n          }, g.prototype.isReady = function(l) {\n            return l === void 0 && (l = !1), this._sourceMesh.isReady(l, !0);\n          }, g.prototype.getVerticesData = function(l, h) {\n            return this._sourceMesh.getVerticesData(l, h);\n          }, g.prototype.setVerticesData = function(l, h, v, b) {\n            return this.sourceMesh && this.sourceMesh.setVerticesData(l, h, v, b), this.sourceMesh;\n          }, g.prototype.updateVerticesData = function(l, h, v, b) {\n            return this.sourceMesh && this.sourceMesh.updateVerticesData(l, h, v, b), this.sourceMesh;\n          }, g.prototype.setIndices = function(l, h) {\n            return h === void 0 && (h = null), this.sourceMesh && this.sourceMesh.setIndices(l, h), this.sourceMesh;\n          }, g.prototype.isVerticesDataPresent = function(l) {\n            return this._sourceMesh.isVerticesDataPresent(l);\n          }, g.prototype.getIndices = function() {\n            return this._sourceMesh.getIndices();\n          }, Object.defineProperty(g.prototype, \"_positions\", { get: function() {\n            return this._sourceMesh._positions;\n          }, enumerable: !1, configurable: !0 }), g.prototype.refreshBoundingInfo = function(l) {\n            if (l === void 0 && (l = !1), this._boundingInfo && this._boundingInfo.isLocked)\n              return this;\n            var h = this._sourceMesh.geometry ? this._sourceMesh.geometry.boundingBias : null;\n            return this._refreshBoundingInfo(this._sourceMesh._getPositionData(l), h), this;\n          }, g.prototype._preActivate = function() {\n            return this._currentLOD && this._currentLOD._preActivate(), this;\n          }, g.prototype._activate = function(l, h) {\n            if (this._sourceMesh.subMeshes || C.a.Warn(\"Instances should only be created for meshes with geometry.\"), this._currentLOD) {\n              if (this._currentLOD._getWorldMatrixDeterminant() > 0 != this._getWorldMatrixDeterminant() > 0)\n                return this._internalAbstractMeshDataInfo._actAsRegularMesh = !0, !0;\n              if (this._internalAbstractMeshDataInfo._actAsRegularMesh = !1, this._currentLOD._registerInstanceForRenderId(this, l), h) {\n                if (!this._currentLOD._internalAbstractMeshDataInfo._isActiveIntermediate)\n                  return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstancesIntermediate = !0, !0;\n              } else if (!this._currentLOD._internalAbstractMeshDataInfo._isActive)\n                return this._currentLOD._internalAbstractMeshDataInfo._onlyForInstances = !0, !0;\n            }\n            return !1;\n          }, g.prototype._postActivate = function() {\n            this._sourceMesh.edgesShareWithInstances && this._sourceMesh._edgesRenderer && this._sourceMesh._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup ? (this._sourceMesh._renderingGroup._edgesRenderers.pushNoDuplicate(this._sourceMesh._edgesRenderer), this._sourceMesh._edgesRenderer.customInstances.push(this.getWorldMatrix())) : this._edgesRenderer && this._edgesRenderer.isEnabled && this._sourceMesh._renderingGroup && this._sourceMesh._renderingGroup._edgesRenderers.push(this._edgesRenderer);\n          }, g.prototype.getWorldMatrix = function() {\n            if (this._currentLOD && this._currentLOD.billboardMode !== x.a.BILLBOARDMODE_NONE && this._currentLOD._masterMesh !== this) {\n              var l = this._currentLOD._masterMesh;\n              return this._currentLOD._masterMesh = this, _.c.Vector3[7].copyFrom(this._currentLOD.position), this._currentLOD.position.set(0, 0, 0), _.c.Matrix[0].copyFrom(this._currentLOD.computeWorldMatrix(!0)), this._currentLOD.position.copyFrom(_.c.Vector3[7]), this._currentLOD._masterMesh = l, _.c.Matrix[0];\n            }\n            return E.prototype.getWorldMatrix.call(this);\n          }, Object.defineProperty(g.prototype, \"isAnInstance\", { get: function() {\n            return !0;\n          }, enumerable: !1, configurable: !0 }), g.prototype.getLOD = function(l) {\n            if (!l)\n              return this;\n            var h = this.getBoundingInfo();\n            return this._currentLOD = this.sourceMesh.getLOD(l, h.boundingSphere), this._currentLOD === this.sourceMesh ? this.sourceMesh : this._currentLOD;\n          }, g.prototype._preActivateForIntermediateRendering = function(l) {\n            return this.sourceMesh._preActivateForIntermediateRendering(l);\n          }, g.prototype._syncSubMeshes = function() {\n            if (this.releaseSubMeshes(), this._sourceMesh.subMeshes)\n              for (var l = 0; l < this._sourceMesh.subMeshes.length; l++)\n                this._sourceMesh.subMeshes[l].clone(this, this._sourceMesh);\n            return this;\n          }, g.prototype._generatePointsArray = function() {\n            return this._sourceMesh._generatePointsArray();\n          }, g.prototype._updateBoundingInfo = function() {\n            return this._boundingInfo ? this._boundingInfo.update(this.worldMatrixFromCache) : this._boundingInfo = new c.a(this.absolutePosition, this.absolutePosition, this.worldMatrixFromCache), this._updateSubMeshesBoundingInfo(this.worldMatrixFromCache), this;\n          }, g.prototype.clone = function(l, h, v) {\n            h === void 0 && (h = null);\n            var b = this._sourceMesh.createInstance(l);\n            if (O.a.DeepCopy(this, b, [\"name\", \"subMeshes\", \"uniqueId\", \"parent\", \"lightSources\", \"receiveShadows\", \"material\", \"visibility\", \"skeleton\", \"sourceMesh\", \"isAnInstance\", \"facetNb\", \"isFacetDataEnabled\", \"isBlocked\", \"useBones\", \"hasInstances\", \"collider\", \"edgesRenderer\", \"forward\", \"up\", \"right\", \"absolutePosition\", \"absoluteScaling\", \"absoluteRotationQuaternion\", \"isWorldMatrixFrozen\", \"nonUniformScaling\", \"behaviors\", \"worldMatrixFromCache\", \"hasThinInstances\"], []), this.refreshBoundingInfo(), h && (b.parent = h), !v)\n              for (var D = 0; D < this.getScene().meshes.length; D++) {\n                var w = this.getScene().meshes[D];\n                w.parent === this && w.clone(w.name, b);\n              }\n            return b.computeWorldMatrix(!0), b;\n          }, g.prototype.dispose = function(l, h) {\n            h === void 0 && (h = !1), this._sourceMesh.removeInstance(this), E.prototype.dispose.call(this, l, h);\n          }, g;\n        }(u.a);\n        I.a.prototype.edgesShareWithInstances = !1, I.a.prototype.registerInstancedBuffer = function(E, g) {\n          if (this.removeVerticesData(E), !this.instancedBuffers) {\n            this.instancedBuffers = {};\n            for (var l = 0, h = this.instances; l < h.length; l++)\n              h[l].instancedBuffers = {};\n            this._userInstancedBuffersStorage = { data: {}, vertexBuffers: {}, strides: {}, sizes: {} };\n          }\n          this.instancedBuffers[E] = null, this._userInstancedBuffersStorage.strides[E] = g, this._userInstancedBuffersStorage.sizes[E] = 32 * g, this._userInstancedBuffersStorage.data[E] = new Float32Array(this._userInstancedBuffersStorage.sizes[E]), this._userInstancedBuffersStorage.vertexBuffers[E] = new m.b(this.getEngine(), this._userInstancedBuffersStorage.data[E], E, !0, !1, g, !0), this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[E]);\n          for (var v = 0, b = this.instances; v < b.length; v++)\n            b[v].instancedBuffers[E] = null;\n        }, I.a.prototype._processInstancedBuffers = function(E, g) {\n          var l = E.length;\n          for (var h in this.instancedBuffers) {\n            for (var v = this._userInstancedBuffersStorage.sizes[h], b = this._userInstancedBuffersStorage.strides[h], D = (l + 1) * b; v < D; )\n              v *= 2;\n            this._userInstancedBuffersStorage.data[h].length != v && (this._userInstancedBuffersStorage.data[h] = new Float32Array(v), this._userInstancedBuffersStorage.sizes[h] = v, this._userInstancedBuffersStorage.vertexBuffers[h] && (this._userInstancedBuffersStorage.vertexBuffers[h].dispose(), this._userInstancedBuffersStorage.vertexBuffers[h] = null));\n            var w = this._userInstancedBuffersStorage.data[h], N = 0;\n            g && ((U = this.instancedBuffers[h]).toArray ? U.toArray(w, N) : U.copyToArray(w, N), N += b);\n            for (var M = 0; M < l; M++) {\n              var U;\n              (U = E[M].instancedBuffers[h]).toArray ? U.toArray(w, N) : U.copyToArray(w, N), N += b;\n            }\n            this._userInstancedBuffersStorage.vertexBuffers[h] ? this._userInstancedBuffersStorage.vertexBuffers[h].updateDirectly(w, 0) : (this._userInstancedBuffersStorage.vertexBuffers[h] = new m.b(this.getEngine(), this._userInstancedBuffersStorage.data[h], h, !0, !1, b, !0), this.setVerticesBuffer(this._userInstancedBuffersStorage.vertexBuffers[h]));\n          }\n        }, I.a.prototype._disposeInstanceSpecificData = function() {\n          for (this._instanceDataStorage.instancesBuffer && (this._instanceDataStorage.instancesBuffer.dispose(), this._instanceDataStorage.instancesBuffer = null); this.instances.length; )\n            this.instances[0].dispose();\n          for (var E in this.instancedBuffers)\n            this._userInstancedBuffersStorage.vertexBuffers[E] && this._userInstancedBuffersStorage.vertexBuffers[E].dispose();\n          this.instancedBuffers = {};\n        };\n      }, function(Be, A, f) {\n        f.d(A, \"a\", function() {\n          return V;\n        });\n        var V = function() {\n          function _() {\n          }\n          return Object.defineProperty(_, \"UniqueId\", { get: function() {\n            var C = this._UniqueIdCounter;\n            return this._UniqueIdCounter++, C;\n          }, enumerable: !1, configurable: !0 }), _._UniqueIdCounter = 0, _;\n        }();\n      }, function(Be, A, f) {\n        var V = f(26), _ = f(88);\n        V.a.prototype.createUniformBuffer = function(C) {\n          var u = this._gl.createBuffer();\n          if (!u)\n            throw new Error(\"Unable to create uniform buffer\");\n          var I = new _.a(u);\n          return this.bindUniformBuffer(I), C instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, C, this._gl.STATIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(C), this._gl.STATIC_DRAW), this.bindUniformBuffer(null), I.references = 1, I;\n        }, V.a.prototype.createDynamicUniformBuffer = function(C) {\n          var u = this._gl.createBuffer();\n          if (!u)\n            throw new Error(\"Unable to create dynamic uniform buffer\");\n          var I = new _.a(u);\n          return this.bindUniformBuffer(I), C instanceof Float32Array ? this._gl.bufferData(this._gl.UNIFORM_BUFFER, C, this._gl.DYNAMIC_DRAW) : this._gl.bufferData(this._gl.UNIFORM_BUFFER, new Float32Array(C), this._gl.DYNAMIC_DRAW), this.bindUniformBuffer(null), I.references = 1, I;\n        }, V.a.prototype.updateUniformBuffer = function(C, u, I, O) {\n          this.bindUniformBuffer(C), I === void 0 && (I = 0), O === void 0 ? u instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, I, u) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, I, new Float32Array(u)) : u instanceof Float32Array ? this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, u.subarray(I, I + O)) : this._gl.bufferSubData(this._gl.UNIFORM_BUFFER, 0, new Float32Array(u).subarray(I, I + O)), this.bindUniformBuffer(null);\n        }, V.a.prototype.bindUniformBuffer = function(C) {\n          this._gl.bindBuffer(this._gl.UNIFORM_BUFFER, C ? C.underlyingResource : null);\n        }, V.a.prototype.bindUniformBufferBase = function(C, u) {\n          this._gl.bindBufferBase(this._gl.UNIFORM_BUFFER, u, C ? C.underlyingResource : null);\n        }, V.a.prototype.bindUniformBlock = function(C, u, I) {\n          var O = C.program, x = this._gl.getUniformBlockIndex(O, u);\n          this._gl.uniformBlockBinding(O, x, I);\n        };\n      }, function(Be, A, f) {\n        var V = \"lightsFragmentFunctions\", _ = `\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n#define inline\nvec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix){\nvec4 strq=textureProjectionMatrix*vec4(vPositionW,1.0);\nstrq/=strq.w;\nvec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;\nreturn textureColor;\n}`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"logDepthFragment\", _ = `#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);\nvec3 tbnTangent=normalize(tangentUpdated.xyz);\nvec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;\nvTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore.bumpVertex = V;\n      }, function(Be, A, f) {\n        var V = `#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif`;\n        f(5).a.IncludesShadersStore.fogVertex = V;\n      }, function(Be, A, f) {\n        var V = \"logDepthVertex\", _ = `#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A) {\n        var f;\n        f = function() {\n          return this;\n        }();\n        try {\n          f = f || new Function(\"return this\")();\n        } catch {\n          typeof window == \"object\" && (f = window);\n        }\n        Be.exports = f;\n      }, function(Be, A, f) {\n        var V = \"prePassDeclaration\", _ = `#ifdef PREPASS\n#extension GL_EXT_draw_buffers : require\n#ifdef WEBGL2\nlayout(location=0) out highp vec4 glFragData[{X}];\nhighp vec4 gl_FragColor;\n#endif\n#ifdef PREPASS_DEPTHNORMAL\nvarying highp vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nvarying highp vec4 vCurrentPosition;\nvarying highp vec4 vPreviousPosition;\n#endif\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"fresnelFunction\", _ = `#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = `#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif`;\n        f(5).a.IncludesShadersStore.depthPrePass = V;\n      }, function(Be, A, f) {\n        var V = \"prePassVertexDeclaration\", _ = `#ifdef PREPASS\n#ifdef PREPASS_DEPTHNORMAL\nvarying vec3 vViewPos;\n#endif\n#ifdef PREPASS_VELOCITY\nuniform mat4 previousWorld;\nuniform mat4 previousViewProjection;\nvarying vec4 vCurrentPosition;\nvarying vec4 vPreviousPosition;\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"bumpVertexDeclaration\", _ = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvarying mat3 vTBN;\n#endif\n#endif\n`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = \"prePassVertex\", _ = `#ifdef PREPASS_DEPTHNORMAL\nvViewPos=(view*worldPos).rgb;\n#endif\n#if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED)\nvCurrentPosition=viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nmat4 previousInfluence;\npreviousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif\nvPreviousPosition=previousViewProjection*previousWorld*previousInfluence*vec4(positionUpdated,1.0);\n#else\nvPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);\n#endif\n#endif`;\n        f(5).a.IncludesShadersStore[V] = _;\n      }, function(Be, A, f) {\n        var V = f(5), _ = (f(115), f(110), \"colorPixelShader\"), C = `#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#else\nuniform vec4 color;\n#endif\n#include<clipPlaneFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\n#ifdef VERTEXCOLOR\ngl_FragColor=vColor;\n#else\ngl_FragColor=color;\n#endif\n}`;\n        V.a.ShadersStore[_] = C;\n      }, function(Be, A, f) {\n        var V = f(5), _ = (f(78), f(117), f(79), f(80), f(81), f(111), \"colorVertexShader\"), C = `\nattribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<clipPlaneVertexDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 viewProjection;\n#ifdef MULTIVIEW\nuniform mat4 viewProjectionR;\n#endif\n\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\nvec4 worldPos=finalWorld*vec4(position,1.0);\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR == 0u) {\ngl_Position=viewProjection*worldPos;\n} else {\ngl_Position=viewProjectionR*worldPos;\n}\n#else\ngl_Position=viewProjection*worldPos;\n#endif\n#include<clipPlaneVertex>\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n}`;\n        V.a.ShadersStore[_] = C;\n      }, function(Be, A, f) {\n        (function(V) {\n          f.d(A, \"b\", function() {\n            return T;\n          }), f.d(A, \"a\", function() {\n            return S;\n          });\n          var _ = f(1), C = f(8), u = f(13), I = f(102), O = f(27), x = f(2), m = f(89), c = f(74), T = function() {\n            this.renderWidth = 512, this.renderHeight = 256, this.textureSize = 512, this.deterministicLockstep = !1, this.lockstepMaxSteps = 4;\n          }, S = function(E) {\n            function g(l) {\n              l === void 0 && (l = new T());\n              var h = E.call(this, null) || this;\n              u.a.Instances.push(h), l.deterministicLockstep === void 0 && (l.deterministicLockstep = !1), l.lockstepMaxSteps === void 0 && (l.lockstepMaxSteps = 4), h._options = l, c.a.SetMatrixPrecision(!!l.useHighPrecisionMatrix), h._caps = { maxTexturesImageUnits: 16, maxVertexTextureImageUnits: 16, maxCombinedTexturesImageUnits: 32, maxTextureSize: 512, maxCubemapTextureSize: 512, maxRenderTextureSize: 512, maxVertexAttribs: 16, maxVaryingVectors: 16, maxFragmentUniformVectors: 16, maxVertexUniformVectors: 16, standardDerivatives: !1, astc: null, pvrtc: null, etc1: null, etc2: null, bptc: null, maxAnisotropy: 0, uintIndices: !1, fragmentDepthSupported: !1, highPrecisionShaderSupported: !0, colorBufferFloat: !1, textureFloat: !1, textureFloatLinearFiltering: !1, textureFloatRender: !1, textureHalfFloat: !1, textureHalfFloatLinearFiltering: !1, textureHalfFloatRender: !1, textureLOD: !1, drawBuffersExtension: !1, depthTextureExtension: !1, vertexArrayObject: !1, instancedArrays: !1, canUseTimestampForTimerQuery: !1, maxMSAASamples: 1, blendMinMax: !1 }, C.a.Log(\"Babylon.js v\" + u.a.Version + \" - Null engine\");\n              var v = typeof self < \"u\" ? self : V !== void 0 ? V : window;\n              return typeof URL > \"u\" && (v.URL = { createObjectURL: function() {\n              }, revokeObjectURL: function() {\n              } }), typeof Blob > \"u\" && (v.Blob = function() {\n              }), h;\n            }\n            return Object(_.d)(g, E), g.prototype.isDeterministicLockStep = function() {\n              return this._options.deterministicLockstep;\n            }, g.prototype.getLockstepMaxSteps = function() {\n              return this._options.lockstepMaxSteps;\n            }, g.prototype.getHardwareScalingLevel = function() {\n              return 1;\n            }, g.prototype.createVertexBuffer = function(l) {\n              var h = new m.a();\n              return h.references = 1, h;\n            }, g.prototype.createIndexBuffer = function(l) {\n              var h = new m.a();\n              return h.references = 1, h;\n            }, g.prototype.clear = function(l, h, v, b) {\n            }, g.prototype.getRenderWidth = function(l) {\n              return l === void 0 && (l = !1), !l && this._currentRenderTarget ? this._currentRenderTarget.width : this._options.renderWidth;\n            }, g.prototype.getRenderHeight = function(l) {\n              return l === void 0 && (l = !1), !l && this._currentRenderTarget ? this._currentRenderTarget.height : this._options.renderHeight;\n            }, g.prototype.setViewport = function(l, h, v) {\n              this._cachedViewport = l;\n            }, g.prototype.createShaderProgram = function(l, h, v, b, D) {\n              return { __SPECTOR_rebuildProgram: null };\n            }, g.prototype.getUniforms = function(l, h) {\n              return [];\n            }, g.prototype.getAttributes = function(l, h) {\n              return [];\n            }, g.prototype.bindSamplers = function(l) {\n              this._currentEffect = null;\n            }, g.prototype.enableEffect = function(l) {\n              this._currentEffect = l, l.onBind && l.onBind(l), l._onBindObservable && l._onBindObservable.notifyObservers(l);\n            }, g.prototype.setState = function(l, h, v, b) {\n            }, g.prototype.setIntArray = function(l, h) {\n              return !0;\n            }, g.prototype.setIntArray2 = function(l, h) {\n              return !0;\n            }, g.prototype.setIntArray3 = function(l, h) {\n              return !0;\n            }, g.prototype.setIntArray4 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray2 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray3 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloatArray4 = function(l, h) {\n              return !0;\n            }, g.prototype.setArray = function(l, h) {\n              return !0;\n            }, g.prototype.setArray2 = function(l, h) {\n              return !0;\n            }, g.prototype.setArray3 = function(l, h) {\n              return !0;\n            }, g.prototype.setArray4 = function(l, h) {\n              return !0;\n            }, g.prototype.setMatrices = function(l, h) {\n              return !0;\n            }, g.prototype.setMatrix3x3 = function(l, h) {\n              return !0;\n            }, g.prototype.setMatrix2x2 = function(l, h) {\n              return !0;\n            }, g.prototype.setFloat = function(l, h) {\n              return !0;\n            }, g.prototype.setFloat2 = function(l, h, v) {\n              return !0;\n            }, g.prototype.setFloat3 = function(l, h, v, b) {\n              return !0;\n            }, g.prototype.setBool = function(l, h) {\n              return !0;\n            }, g.prototype.setFloat4 = function(l, h, v, b, D) {\n              return !0;\n            }, g.prototype.setAlphaMode = function(l, h) {\n              h === void 0 && (h = !1), this._alphaMode !== l && (this.alphaState.alphaBlend = l !== x.a.ALPHA_DISABLE, h || this.setDepthWrite(l === x.a.ALPHA_DISABLE), this._alphaMode = l);\n            }, g.prototype.bindBuffers = function(l, h, v) {\n            }, g.prototype.wipeCaches = function(l) {\n              this.preventCacheWipeBetweenFrames || (this.resetTextureCache(), this._currentEffect = null, l && (this._currentProgram = null, this.stencilState.reset(), this.depthCullingState.reset(), this.alphaState.reset()), this._cachedVertexBuffers = null, this._cachedIndexBuffer = null, this._cachedEffectForVertexBuffers = null);\n            }, g.prototype.draw = function(l, h, v, b) {\n            }, g.prototype.drawElementsType = function(l, h, v, b) {\n            }, g.prototype.drawArraysType = function(l, h, v, b) {\n            }, g.prototype._createTexture = function() {\n              return {};\n            }, g.prototype._releaseTexture = function(l) {\n            }, g.prototype.createTexture = function(l, h, v, b, D, w, N, M, U, X, j, ne) {\n              D === void 0 && (D = x.a.TEXTURE_TRILINEAR_SAMPLINGMODE), w === void 0 && (w = null), X === void 0 && (X = null);\n              var te = new O.a(this, O.b.Url), de = String(l);\n              return te.url = de, te.generateMipMaps = !h, te.samplingMode = D, te.invertY = v, te.baseWidth = this._options.textureSize, te.baseHeight = this._options.textureSize, te.width = this._options.textureSize, te.height = this._options.textureSize, X && (te.format = X), te.isReady = !0, w && w(), this._internalTexturesCache.push(te), te;\n            }, g.prototype.createRenderTargetTexture = function(l, h) {\n              var v = new I.a();\n              h !== void 0 && typeof h == \"object\" ? (v.generateMipMaps = h.generateMipMaps, v.generateDepthBuffer = h.generateDepthBuffer === void 0 || h.generateDepthBuffer, v.generateStencilBuffer = v.generateDepthBuffer && h.generateStencilBuffer, v.type = h.type === void 0 ? x.a.TEXTURETYPE_UNSIGNED_INT : h.type, v.samplingMode = h.samplingMode === void 0 ? x.a.TEXTURE_TRILINEAR_SAMPLINGMODE : h.samplingMode) : (v.generateMipMaps = h, v.generateDepthBuffer = !0, v.generateStencilBuffer = !1, v.type = x.a.TEXTURETYPE_UNSIGNED_INT, v.samplingMode = x.a.TEXTURE_TRILINEAR_SAMPLINGMODE);\n              var b = new O.a(this, O.b.RenderTarget), D = l.width || l, w = l.height || l;\n              return b._depthStencilBuffer = {}, b._framebuffer = {}, b.baseWidth = D, b.baseHeight = w, b.width = D, b.height = w, b.isReady = !0, b.samples = 1, b.generateMipMaps = !!v.generateMipMaps, b.samplingMode = v.samplingMode, b.type = v.type, b._generateDepthBuffer = v.generateDepthBuffer, b._generateStencilBuffer = !!v.generateStencilBuffer, this._internalTexturesCache.push(b), b;\n            }, g.prototype.updateTextureSamplingMode = function(l, h) {\n              h.samplingMode = l;\n            }, g.prototype.bindFramebuffer = function(l, h, v, b, D) {\n              this._currentRenderTarget && this.unBindFramebuffer(this._currentRenderTarget), this._currentRenderTarget = l, this._currentFramebuffer = l._MSAAFramebuffer ? l._MSAAFramebuffer : l._framebuffer, this._cachedViewport && !D && this.setViewport(this._cachedViewport, v, b);\n            }, g.prototype.unBindFramebuffer = function(l, h, v) {\n              this._currentRenderTarget = null, v && (l._MSAAFramebuffer && (this._currentFramebuffer = l._framebuffer), v()), this._currentFramebuffer = null;\n            }, g.prototype.createDynamicVertexBuffer = function(l) {\n              var h = new m.a();\n              return h.references = 1, h.capacity = 1, h;\n            }, g.prototype.updateDynamicTexture = function(l, h, v, b, D) {\n            }, g.prototype.areAllEffectsReady = function() {\n              return !0;\n            }, g.prototype.getError = function() {\n              return 0;\n            }, g.prototype._getUnpackAlignement = function() {\n              return 1;\n            }, g.prototype._unpackFlipY = function(l) {\n            }, g.prototype.updateDynamicIndexBuffer = function(l, h, v) {\n            }, g.prototype.updateDynamicVertexBuffer = function(l, h, v, b) {\n            }, g.prototype._bindTextureDirectly = function(l, h) {\n              return this._boundTexturesCache[this._activeChannel] !== h && (this._boundTexturesCache[this._activeChannel] = h, !0);\n            }, g.prototype._bindTexture = function(l, h) {\n              l < 0 || this._bindTextureDirectly(0, h);\n            }, g.prototype._deleteBuffer = function(l) {\n            }, g.prototype.releaseEffects = function() {\n            }, g.prototype.displayLoadingUI = function() {\n            }, g.prototype.hideLoadingUI = function() {\n            }, g.prototype._uploadCompressedDataToTextureDirectly = function(l, h, v, b, D, w, N) {\n            }, g.prototype._uploadDataToTextureDirectly = function(l, h, v, b) {\n            }, g.prototype._uploadArrayBufferViewToTexture = function(l, h, v, b) {\n            }, g.prototype._uploadImageToTexture = function(l, h, v, b) {\n            }, g;\n          }(u.a);\n        }).call(this, f(159));\n      }, function(Be, A, f) {\n        f.r(A), (function(V) {\n          f.d(A, \"Debug\", function() {\n            return m;\n          });\n          var _ = f(127), C = f(99);\n          f.d(A, \"AbstractScene\", function() {\n            return _.AbstractScene;\n          }), f.d(A, \"AbstractActionManager\", function() {\n            return _.AbstractActionManager;\n          }), f.d(A, \"Action\", function() {\n            return _.Action;\n          }), f.d(A, \"ActionEvent\", function() {\n            return _.ActionEvent;\n          }), f.d(A, \"ActionManager\", function() {\n            return _.ActionManager;\n          }), f.d(A, \"Condition\", function() {\n            return _.Condition;\n          }), f.d(A, \"ValueCondition\", function() {\n            return _.ValueCondition;\n          }), f.d(A, \"PredicateCondition\", function() {\n            return _.PredicateCondition;\n          }), f.d(A, \"StateCondition\", function() {\n            return _.StateCondition;\n          }), f.d(A, \"SwitchBooleanAction\", function() {\n            return _.SwitchBooleanAction;\n          }), f.d(A, \"SetStateAction\", function() {\n            return _.SetStateAction;\n          }), f.d(A, \"SetValueAction\", function() {\n            return _.SetValueAction;\n          }), f.d(A, \"IncrementValueAction\", function() {\n            return _.IncrementValueAction;\n          }), f.d(A, \"PlayAnimationAction\", function() {\n            return _.PlayAnimationAction;\n          }), f.d(A, \"StopAnimationAction\", function() {\n            return _.StopAnimationAction;\n          }), f.d(A, \"DoNothingAction\", function() {\n            return _.DoNothingAction;\n          }), f.d(A, \"CombineAction\", function() {\n            return _.CombineAction;\n          }), f.d(A, \"ExecuteCodeAction\", function() {\n            return _.ExecuteCodeAction;\n          }), f.d(A, \"SetParentAction\", function() {\n            return _.SetParentAction;\n          }), f.d(A, \"PlaySoundAction\", function() {\n            return _.PlaySoundAction;\n          }), f.d(A, \"StopSoundAction\", function() {\n            return _.StopSoundAction;\n          }), f.d(A, \"InterpolateValueAction\", function() {\n            return _.InterpolateValueAction;\n          }), f.d(A, \"Animatable\", function() {\n            return _.Animatable;\n          }), f.d(A, \"_IAnimationState\", function() {\n            return _._IAnimationState;\n          }), f.d(A, \"Animation\", function() {\n            return _.Animation;\n          }), f.d(A, \"TargetedAnimation\", function() {\n            return _.TargetedAnimation;\n          }), f.d(A, \"AnimationGroup\", function() {\n            return _.AnimationGroup;\n          }), f.d(A, \"AnimationPropertiesOverride\", function() {\n            return _.AnimationPropertiesOverride;\n          }), f.d(A, \"EasingFunction\", function() {\n            return _.EasingFunction;\n          }), f.d(A, \"CircleEase\", function() {\n            return _.CircleEase;\n          }), f.d(A, \"BackEase\", function() {\n            return _.BackEase;\n          }), f.d(A, \"BounceEase\", function() {\n            return _.BounceEase;\n          }), f.d(A, \"CubicEase\", function() {\n            return _.CubicEase;\n          }), f.d(A, \"ElasticEase\", function() {\n            return _.ElasticEase;\n          }), f.d(A, \"ExponentialEase\", function() {\n            return _.ExponentialEase;\n          }), f.d(A, \"PowerEase\", function() {\n            return _.PowerEase;\n          }), f.d(A, \"QuadraticEase\", function() {\n            return _.QuadraticEase;\n          }), f.d(A, \"QuarticEase\", function() {\n            return _.QuarticEase;\n          }), f.d(A, \"QuinticEase\", function() {\n            return _.QuinticEase;\n          }), f.d(A, \"SineEase\", function() {\n            return _.SineEase;\n          }), f.d(A, \"BezierCurveEase\", function() {\n            return _.BezierCurveEase;\n          }), f.d(A, \"RuntimeAnimation\", function() {\n            return _.RuntimeAnimation;\n          }), f.d(A, \"AnimationEvent\", function() {\n            return _.AnimationEvent;\n          }), f.d(A, \"AnimationKeyInterpolation\", function() {\n            return _.AnimationKeyInterpolation;\n          }), f.d(A, \"AnimationRange\", function() {\n            return _.AnimationRange;\n          }), f.d(A, \"KeepAssets\", function() {\n            return _.KeepAssets;\n          }), f.d(A, \"InstantiatedEntries\", function() {\n            return _.InstantiatedEntries;\n          }), f.d(A, \"AssetContainer\", function() {\n            return _.AssetContainer;\n          }), f.d(A, \"Analyser\", function() {\n            return _.Analyser;\n          }), f.d(A, \"AudioEngine\", function() {\n            return _.AudioEngine;\n          }), f.d(A, \"AudioSceneComponent\", function() {\n            return _.AudioSceneComponent;\n          }), f.d(A, \"Sound\", function() {\n            return _.Sound;\n          }), f.d(A, \"SoundTrack\", function() {\n            return _.SoundTrack;\n          }), f.d(A, \"WeightedSound\", function() {\n            return _.WeightedSound;\n          }), f.d(A, \"AutoRotationBehavior\", function() {\n            return _.AutoRotationBehavior;\n          }), f.d(A, \"BouncingBehavior\", function() {\n            return _.BouncingBehavior;\n          }), f.d(A, \"FramingBehavior\", function() {\n            return _.FramingBehavior;\n          }), f.d(A, \"AttachToBoxBehavior\", function() {\n            return _.AttachToBoxBehavior;\n          }), f.d(A, \"FadeInOutBehavior\", function() {\n            return _.FadeInOutBehavior;\n          }), f.d(A, \"MultiPointerScaleBehavior\", function() {\n            return _.MultiPointerScaleBehavior;\n          }), f.d(A, \"PointerDragBehavior\", function() {\n            return _.PointerDragBehavior;\n          }), f.d(A, \"SixDofDragBehavior\", function() {\n            return _.SixDofDragBehavior;\n          }), f.d(A, \"Bone\", function() {\n            return _.Bone;\n          }), f.d(A, \"BoneIKController\", function() {\n            return _.BoneIKController;\n          }), f.d(A, \"BoneLookController\", function() {\n            return _.BoneLookController;\n          }), f.d(A, \"Skeleton\", function() {\n            return _.Skeleton;\n          }), f.d(A, \"ArcRotateCameraGamepadInput\", function() {\n            return _.ArcRotateCameraGamepadInput;\n          }), f.d(A, \"ArcRotateCameraKeyboardMoveInput\", function() {\n            return _.ArcRotateCameraKeyboardMoveInput;\n          }), f.d(A, \"ArcRotateCameraMouseWheelInput\", function() {\n            return _.ArcRotateCameraMouseWheelInput;\n          }), f.d(A, \"ArcRotateCameraPointersInput\", function() {\n            return _.ArcRotateCameraPointersInput;\n          }), f.d(A, \"ArcRotateCameraVRDeviceOrientationInput\", function() {\n            return _.ArcRotateCameraVRDeviceOrientationInput;\n          }), f.d(A, \"FlyCameraKeyboardInput\", function() {\n            return _.FlyCameraKeyboardInput;\n          }), f.d(A, \"FlyCameraMouseInput\", function() {\n            return _.FlyCameraMouseInput;\n          }), f.d(A, \"FollowCameraKeyboardMoveInput\", function() {\n            return _.FollowCameraKeyboardMoveInput;\n          }), f.d(A, \"FollowCameraMouseWheelInput\", function() {\n            return _.FollowCameraMouseWheelInput;\n          }), f.d(A, \"FollowCameraPointersInput\", function() {\n            return _.FollowCameraPointersInput;\n          }), f.d(A, \"FreeCameraDeviceOrientationInput\", function() {\n            return _.FreeCameraDeviceOrientationInput;\n          }), f.d(A, \"FreeCameraGamepadInput\", function() {\n            return _.FreeCameraGamepadInput;\n          }), f.d(A, \"FreeCameraKeyboardMoveInput\", function() {\n            return _.FreeCameraKeyboardMoveInput;\n          }), f.d(A, \"FreeCameraMouseInput\", function() {\n            return _.FreeCameraMouseInput;\n          }), f.d(A, \"FreeCameraMouseWheelInput\", function() {\n            return _.FreeCameraMouseWheelInput;\n          }), f.d(A, \"FreeCameraTouchInput\", function() {\n            return _.FreeCameraTouchInput;\n          }), f.d(A, \"FreeCameraVirtualJoystickInput\", function() {\n            return _.FreeCameraVirtualJoystickInput;\n          }), f.d(A, \"CameraInputTypes\", function() {\n            return _.CameraInputTypes;\n          }), f.d(A, \"CameraInputsManager\", function() {\n            return _.CameraInputsManager;\n          }), f.d(A, \"Camera\", function() {\n            return _.Camera;\n          }), f.d(A, \"TargetCamera\", function() {\n            return _.TargetCamera;\n          }), f.d(A, \"FreeCamera\", function() {\n            return _.FreeCamera;\n          }), f.d(A, \"FreeCameraInputsManager\", function() {\n            return _.FreeCameraInputsManager;\n          }), f.d(A, \"TouchCamera\", function() {\n            return _.TouchCamera;\n          }), f.d(A, \"ArcRotateCamera\", function() {\n            return _.ArcRotateCamera;\n          }), f.d(A, \"ArcRotateCameraInputsManager\", function() {\n            return _.ArcRotateCameraInputsManager;\n          }), f.d(A, \"DeviceOrientationCamera\", function() {\n            return _.DeviceOrientationCamera;\n          }), f.d(A, \"FlyCamera\", function() {\n            return _.FlyCamera;\n          }), f.d(A, \"FlyCameraInputsManager\", function() {\n            return _.FlyCameraInputsManager;\n          }), f.d(A, \"FollowCamera\", function() {\n            return _.FollowCamera;\n          }), f.d(A, \"ArcFollowCamera\", function() {\n            return _.ArcFollowCamera;\n          }), f.d(A, \"FollowCameraInputsManager\", function() {\n            return _.FollowCameraInputsManager;\n          }), f.d(A, \"GamepadCamera\", function() {\n            return _.GamepadCamera;\n          }), f.d(A, \"AnaglyphArcRotateCamera\", function() {\n            return _.AnaglyphArcRotateCamera;\n          }), f.d(A, \"AnaglyphFreeCamera\", function() {\n            return _.AnaglyphFreeCamera;\n          }), f.d(A, \"AnaglyphGamepadCamera\", function() {\n            return _.AnaglyphGamepadCamera;\n          }), f.d(A, \"AnaglyphUniversalCamera\", function() {\n            return _.AnaglyphUniversalCamera;\n          }), f.d(A, \"StereoscopicArcRotateCamera\", function() {\n            return _.StereoscopicArcRotateCamera;\n          }), f.d(A, \"StereoscopicFreeCamera\", function() {\n            return _.StereoscopicFreeCamera;\n          }), f.d(A, \"StereoscopicGamepadCamera\", function() {\n            return _.StereoscopicGamepadCamera;\n          }), f.d(A, \"StereoscopicUniversalCamera\", function() {\n            return _.StereoscopicUniversalCamera;\n          }), f.d(A, \"UniversalCamera\", function() {\n            return _.UniversalCamera;\n          }), f.d(A, \"VirtualJoysticksCamera\", function() {\n            return _.VirtualJoysticksCamera;\n          }), f.d(A, \"VRCameraMetrics\", function() {\n            return _.VRCameraMetrics;\n          }), f.d(A, \"VRDeviceOrientationArcRotateCamera\", function() {\n            return _.VRDeviceOrientationArcRotateCamera;\n          }), f.d(A, \"VRDeviceOrientationFreeCamera\", function() {\n            return _.VRDeviceOrientationFreeCamera;\n          }), f.d(A, \"VRDeviceOrientationGamepadCamera\", function() {\n            return _.VRDeviceOrientationGamepadCamera;\n          }), f.d(A, \"OnAfterEnteringVRObservableEvent\", function() {\n            return _.OnAfterEnteringVRObservableEvent;\n          }), f.d(A, \"VRExperienceHelper\", function() {\n            return _.VRExperienceHelper;\n          }), f.d(A, \"WebVRFreeCamera\", function() {\n            return _.WebVRFreeCamera;\n          }), f.d(A, \"Collider\", function() {\n            return _.Collider;\n          }), f.d(A, \"DefaultCollisionCoordinator\", function() {\n            return _.DefaultCollisionCoordinator;\n          }), f.d(A, \"PickingInfo\", function() {\n            return _.PickingInfo;\n          }), f.d(A, \"IntersectionInfo\", function() {\n            return _.IntersectionInfo;\n          }), f.d(A, \"_MeshCollisionData\", function() {\n            return _._MeshCollisionData;\n          }), f.d(A, \"BoundingBox\", function() {\n            return _.BoundingBox;\n          }), f.d(A, \"BoundingInfo\", function() {\n            return _.BoundingInfo;\n          }), f.d(A, \"BoundingSphere\", function() {\n            return _.BoundingSphere;\n          }), f.d(A, \"Octree\", function() {\n            return _.Octree;\n          }), f.d(A, \"OctreeBlock\", function() {\n            return _.OctreeBlock;\n          }), f.d(A, \"OctreeSceneComponent\", function() {\n            return _.OctreeSceneComponent;\n          }), f.d(A, \"Ray\", function() {\n            return _.Ray;\n          }), f.d(A, \"AxesViewer\", function() {\n            return _.AxesViewer;\n          }), f.d(A, \"BoneAxesViewer\", function() {\n            return _.BoneAxesViewer;\n          }), f.d(A, \"DebugLayerTab\", function() {\n            return _.DebugLayerTab;\n          }), f.d(A, \"DebugLayer\", function() {\n            return _.DebugLayer;\n          }), f.d(A, \"PhysicsViewer\", function() {\n            return _.PhysicsViewer;\n          }), f.d(A, \"RayHelper\", function() {\n            return _.RayHelper;\n          }), f.d(A, \"SkeletonViewer\", function() {\n            return _.SkeletonViewer;\n          }), f.d(A, \"DeviceInputSystem\", function() {\n            return _.DeviceInputSystem;\n          }), f.d(A, \"DeviceType\", function() {\n            return _.DeviceType;\n          }), f.d(A, \"PointerInput\", function() {\n            return _.PointerInput;\n          }), f.d(A, \"DualShockInput\", function() {\n            return _.DualShockInput;\n          }), f.d(A, \"XboxInput\", function() {\n            return _.XboxInput;\n          }), f.d(A, \"SwitchInput\", function() {\n            return _.SwitchInput;\n          }), f.d(A, \"DeviceSource\", function() {\n            return _.DeviceSource;\n          }), f.d(A, \"DeviceSourceManager\", function() {\n            return _.DeviceSourceManager;\n          }), f.d(A, \"Constants\", function() {\n            return _.Constants;\n          }), f.d(A, \"ThinEngine\", function() {\n            return _.ThinEngine;\n          }), f.d(A, \"Engine\", function() {\n            return _.Engine;\n          }), f.d(A, \"EngineStore\", function() {\n            return _.EngineStore;\n          }), f.d(A, \"NullEngineOptions\", function() {\n            return _.NullEngineOptions;\n          }), f.d(A, \"NullEngine\", function() {\n            return _.NullEngine;\n          }), f.d(A, \"_OcclusionDataStorage\", function() {\n            return _._OcclusionDataStorage;\n          }), f.d(A, \"_forceTransformFeedbackToBundle\", function() {\n            return _._forceTransformFeedbackToBundle;\n          }), f.d(A, \"EngineView\", function() {\n            return _.EngineView;\n          }), f.d(A, \"WebGLPipelineContext\", function() {\n            return _.WebGLPipelineContext;\n          }), f.d(A, \"WebGL2ShaderProcessor\", function() {\n            return _.WebGL2ShaderProcessor;\n          }), f.d(A, \"NativeEngine\", function() {\n            return _.NativeEngine;\n          }), f.d(A, \"ShaderCodeInliner\", function() {\n            return _.ShaderCodeInliner;\n          }), f.d(A, \"PerformanceConfigurator\", function() {\n            return _.PerformanceConfigurator;\n          }), f.d(A, \"KeyboardEventTypes\", function() {\n            return _.KeyboardEventTypes;\n          }), f.d(A, \"KeyboardInfo\", function() {\n            return _.KeyboardInfo;\n          }), f.d(A, \"KeyboardInfoPre\", function() {\n            return _.KeyboardInfoPre;\n          }), f.d(A, \"PointerEventTypes\", function() {\n            return _.PointerEventTypes;\n          }), f.d(A, \"PointerInfoBase\", function() {\n            return _.PointerInfoBase;\n          }), f.d(A, \"PointerInfoPre\", function() {\n            return _.PointerInfoPre;\n          }), f.d(A, \"PointerInfo\", function() {\n            return _.PointerInfo;\n          }), f.d(A, \"ClipboardEventTypes\", function() {\n            return _.ClipboardEventTypes;\n          }), f.d(A, \"ClipboardInfo\", function() {\n            return _.ClipboardInfo;\n          }), f.d(A, \"DaydreamController\", function() {\n            return _.DaydreamController;\n          }), f.d(A, \"GearVRController\", function() {\n            return _.GearVRController;\n          }), f.d(A, \"GenericController\", function() {\n            return _.GenericController;\n          }), f.d(A, \"OculusTouchController\", function() {\n            return _.OculusTouchController;\n          }), f.d(A, \"PoseEnabledControllerType\", function() {\n            return _.PoseEnabledControllerType;\n          }), f.d(A, \"PoseEnabledControllerHelper\", function() {\n            return _.PoseEnabledControllerHelper;\n          }), f.d(A, \"PoseEnabledController\", function() {\n            return _.PoseEnabledController;\n          }), f.d(A, \"ViveController\", function() {\n            return _.ViveController;\n          }), f.d(A, \"WebVRController\", function() {\n            return _.WebVRController;\n          }), f.d(A, \"WindowsMotionController\", function() {\n            return _.WindowsMotionController;\n          }), f.d(A, \"XRWindowsMotionController\", function() {\n            return _.XRWindowsMotionController;\n          }), f.d(A, \"StickValues\", function() {\n            return _.StickValues;\n          }), f.d(A, \"Gamepad\", function() {\n            return _.Gamepad;\n          }), f.d(A, \"GenericPad\", function() {\n            return _.GenericPad;\n          }), f.d(A, \"GamepadManager\", function() {\n            return _.GamepadManager;\n          }), f.d(A, \"GamepadSystemSceneComponent\", function() {\n            return _.GamepadSystemSceneComponent;\n          }), f.d(A, \"Xbox360Button\", function() {\n            return _.Xbox360Button;\n          }), f.d(A, \"Xbox360Dpad\", function() {\n            return _.Xbox360Dpad;\n          }), f.d(A, \"Xbox360Pad\", function() {\n            return _.Xbox360Pad;\n          }), f.d(A, \"DualShockButton\", function() {\n            return _.DualShockButton;\n          }), f.d(A, \"DualShockDpad\", function() {\n            return _.DualShockDpad;\n          }), f.d(A, \"DualShockPad\", function() {\n            return _.DualShockPad;\n          }), f.d(A, \"AxisDragGizmo\", function() {\n            return _.AxisDragGizmo;\n          }), f.d(A, \"AxisScaleGizmo\", function() {\n            return _.AxisScaleGizmo;\n          }), f.d(A, \"BoundingBoxGizmo\", function() {\n            return _.BoundingBoxGizmo;\n          }), f.d(A, \"Gizmo\", function() {\n            return _.Gizmo;\n          }), f.d(A, \"GizmoManager\", function() {\n            return _.GizmoManager;\n          }), f.d(A, \"PlaneRotationGizmo\", function() {\n            return _.PlaneRotationGizmo;\n          }), f.d(A, \"PositionGizmo\", function() {\n            return _.PositionGizmo;\n          }), f.d(A, \"RotationGizmo\", function() {\n            return _.RotationGizmo;\n          }), f.d(A, \"ScaleGizmo\", function() {\n            return _.ScaleGizmo;\n          }), f.d(A, \"LightGizmo\", function() {\n            return _.LightGizmo;\n          }), f.d(A, \"CameraGizmo\", function() {\n            return _.CameraGizmo;\n          }), f.d(A, \"PlaneDragGizmo\", function() {\n            return _.PlaneDragGizmo;\n          }), f.d(A, \"EnvironmentHelper\", function() {\n            return _.EnvironmentHelper;\n          }), f.d(A, \"PhotoDome\", function() {\n            return _.PhotoDome;\n          }), f.d(A, \"_forceSceneHelpersToBundle\", function() {\n            return _._forceSceneHelpersToBundle;\n          }), f.d(A, \"VideoDome\", function() {\n            return _.VideoDome;\n          }), f.d(A, \"EngineInstrumentation\", function() {\n            return _.EngineInstrumentation;\n          }), f.d(A, \"SceneInstrumentation\", function() {\n            return _.SceneInstrumentation;\n          }), f.d(A, \"_TimeToken\", function() {\n            return _._TimeToken;\n          }), f.d(A, \"EffectLayer\", function() {\n            return _.EffectLayer;\n          }), f.d(A, \"EffectLayerSceneComponent\", function() {\n            return _.EffectLayerSceneComponent;\n          }), f.d(A, \"GlowLayer\", function() {\n            return _.GlowLayer;\n          }), f.d(A, \"HighlightLayer\", function() {\n            return _.HighlightLayer;\n          }), f.d(A, \"Layer\", function() {\n            return _.Layer;\n          }), f.d(A, \"LayerSceneComponent\", function() {\n            return _.LayerSceneComponent;\n          }), f.d(A, \"LensFlare\", function() {\n            return _.LensFlare;\n          }), f.d(A, \"LensFlareSystem\", function() {\n            return _.LensFlareSystem;\n          }), f.d(A, \"LensFlareSystemSceneComponent\", function() {\n            return _.LensFlareSystemSceneComponent;\n          }), f.d(A, \"Light\", function() {\n            return _.Light;\n          }), f.d(A, \"ShadowLight\", function() {\n            return _.ShadowLight;\n          }), f.d(A, \"ShadowGenerator\", function() {\n            return _.ShadowGenerator;\n          }), f.d(A, \"CascadedShadowGenerator\", function() {\n            return _.CascadedShadowGenerator;\n          }), f.d(A, \"ShadowGeneratorSceneComponent\", function() {\n            return _.ShadowGeneratorSceneComponent;\n          }), f.d(A, \"DirectionalLight\", function() {\n            return _.DirectionalLight;\n          }), f.d(A, \"HemisphericLight\", function() {\n            return _.HemisphericLight;\n          }), f.d(A, \"PointLight\", function() {\n            return _.PointLight;\n          }), f.d(A, \"SpotLight\", function() {\n            return _.SpotLight;\n          }), f.d(A, \"DefaultLoadingScreen\", function() {\n            return _.DefaultLoadingScreen;\n          }), f.d(A, \"_BabylonLoaderRegistered\", function() {\n            return _._BabylonLoaderRegistered;\n          }), f.d(A, \"BabylonFileLoaderConfiguration\", function() {\n            return _.BabylonFileLoaderConfiguration;\n          }), f.d(A, \"SceneLoaderAnimationGroupLoadingMode\", function() {\n            return _.SceneLoaderAnimationGroupLoadingMode;\n          }), f.d(A, \"SceneLoader\", function() {\n            return _.SceneLoader;\n          }), f.d(A, \"SceneLoaderFlags\", function() {\n            return _.SceneLoaderFlags;\n          }), f.d(A, \"BackgroundMaterial\", function() {\n            return _.BackgroundMaterial;\n          }), f.d(A, \"ColorCurves\", function() {\n            return _.ColorCurves;\n          }), f.d(A, \"EffectFallbacks\", function() {\n            return _.EffectFallbacks;\n          }), f.d(A, \"Effect\", function() {\n            return _.Effect;\n          }), f.d(A, \"FresnelParameters\", function() {\n            return _.FresnelParameters;\n          }), f.d(A, \"ImageProcessingConfigurationDefines\", function() {\n            return _.ImageProcessingConfigurationDefines;\n          }), f.d(A, \"ImageProcessingConfiguration\", function() {\n            return _.ImageProcessingConfiguration;\n          }), f.d(A, \"Material\", function() {\n            return _.Material;\n          }), f.d(A, \"MaterialDefines\", function() {\n            return _.MaterialDefines;\n          }), f.d(A, \"ThinMaterialHelper\", function() {\n            return _.ThinMaterialHelper;\n          }), f.d(A, \"MaterialHelper\", function() {\n            return _.MaterialHelper;\n          }), f.d(A, \"MultiMaterial\", function() {\n            return _.MultiMaterial;\n          }), f.d(A, \"PBRMaterialDefines\", function() {\n            return _.PBRMaterialDefines;\n          }), f.d(A, \"PBRBaseMaterial\", function() {\n            return _.PBRBaseMaterial;\n          }), f.d(A, \"PBRBaseSimpleMaterial\", function() {\n            return _.PBRBaseSimpleMaterial;\n          }), f.d(A, \"PBRMaterial\", function() {\n            return _.PBRMaterial;\n          }), f.d(A, \"PBRMetallicRoughnessMaterial\", function() {\n            return _.PBRMetallicRoughnessMaterial;\n          }), f.d(A, \"PBRSpecularGlossinessMaterial\", function() {\n            return _.PBRSpecularGlossinessMaterial;\n          }), f.d(A, \"PushMaterial\", function() {\n            return _.PushMaterial;\n          }), f.d(A, \"ShaderMaterial\", function() {\n            return _.ShaderMaterial;\n          }), f.d(A, \"StandardMaterialDefines\", function() {\n            return _.StandardMaterialDefines;\n          }), f.d(A, \"StandardMaterial\", function() {\n            return _.StandardMaterial;\n          }), f.d(A, \"BaseTexture\", function() {\n            return _.BaseTexture;\n          }), f.d(A, \"ColorGradingTexture\", function() {\n            return _.ColorGradingTexture;\n          }), f.d(A, \"CubeTexture\", function() {\n            return _.CubeTexture;\n          }), f.d(A, \"DynamicTexture\", function() {\n            return _.DynamicTexture;\n          }), f.d(A, \"EquiRectangularCubeTexture\", function() {\n            return _.EquiRectangularCubeTexture;\n          }), f.d(A, \"HDRFiltering\", function() {\n            return _.HDRFiltering;\n          }), f.d(A, \"HDRCubeTexture\", function() {\n            return _.HDRCubeTexture;\n          }), f.d(A, \"HtmlElementTexture\", function() {\n            return _.HtmlElementTexture;\n          }), f.d(A, \"InternalTextureSource\", function() {\n            return _.InternalTextureSource;\n          }), f.d(A, \"InternalTexture\", function() {\n            return _.InternalTexture;\n          }), f.d(A, \"_DDSTextureLoader\", function() {\n            return _._DDSTextureLoader;\n          }), f.d(A, \"_ENVTextureLoader\", function() {\n            return _._ENVTextureLoader;\n          }), f.d(A, \"_KTXTextureLoader\", function() {\n            return _._KTXTextureLoader;\n          }), f.d(A, \"_TGATextureLoader\", function() {\n            return _._TGATextureLoader;\n          }), f.d(A, \"_BasisTextureLoader\", function() {\n            return _._BasisTextureLoader;\n          }), f.d(A, \"MirrorTexture\", function() {\n            return _.MirrorTexture;\n          }), f.d(A, \"MultiRenderTarget\", function() {\n            return _.MultiRenderTarget;\n          }), f.d(A, \"TexturePacker\", function() {\n            return _.TexturePacker;\n          }), f.d(A, \"TexturePackerFrame\", function() {\n            return _.TexturePackerFrame;\n          }), f.d(A, \"CustomProceduralTexture\", function() {\n            return _.CustomProceduralTexture;\n          }), f.d(A, \"NoiseProceduralTexture\", function() {\n            return _.NoiseProceduralTexture;\n          }), f.d(A, \"ProceduralTexture\", function() {\n            return _.ProceduralTexture;\n          }), f.d(A, \"ProceduralTextureSceneComponent\", function() {\n            return _.ProceduralTextureSceneComponent;\n          }), f.d(A, \"RawCubeTexture\", function() {\n            return _.RawCubeTexture;\n          }), f.d(A, \"RawTexture\", function() {\n            return _.RawTexture;\n          }), f.d(A, \"RawTexture2DArray\", function() {\n            return _.RawTexture2DArray;\n          }), f.d(A, \"RawTexture3D\", function() {\n            return _.RawTexture3D;\n          }), f.d(A, \"RefractionTexture\", function() {\n            return _.RefractionTexture;\n          }), f.d(A, \"RenderTargetTexture\", function() {\n            return _.RenderTargetTexture;\n          }), f.d(A, \"Texture\", function() {\n            return _.Texture;\n          }), f.d(A, \"VideoTexture\", function() {\n            return _.VideoTexture;\n          }), f.d(A, \"UniformBuffer\", function() {\n            return _.UniformBuffer;\n          }), f.d(A, \"MaterialFlags\", function() {\n            return _.MaterialFlags;\n          }), f.d(A, \"NodeMaterialBlockTargets\", function() {\n            return _.NodeMaterialBlockTargets;\n          }), f.d(A, \"NodeMaterialBlockConnectionPointTypes\", function() {\n            return _.NodeMaterialBlockConnectionPointTypes;\n          }), f.d(A, \"NodeMaterialBlockConnectionPointMode\", function() {\n            return _.NodeMaterialBlockConnectionPointMode;\n          }), f.d(A, \"NodeMaterialSystemValues\", function() {\n            return _.NodeMaterialSystemValues;\n          }), f.d(A, \"NodeMaterialModes\", function() {\n            return _.NodeMaterialModes;\n          }), f.d(A, \"NodeMaterialConnectionPointCompatibilityStates\", function() {\n            return _.NodeMaterialConnectionPointCompatibilityStates;\n          }), f.d(A, \"NodeMaterialConnectionPointDirection\", function() {\n            return _.NodeMaterialConnectionPointDirection;\n          }), f.d(A, \"NodeMaterialConnectionPoint\", function() {\n            return _.NodeMaterialConnectionPoint;\n          }), f.d(A, \"NodeMaterialBlock\", function() {\n            return _.NodeMaterialBlock;\n          }), f.d(A, \"NodeMaterialDefines\", function() {\n            return _.NodeMaterialDefines;\n          }), f.d(A, \"NodeMaterial\", function() {\n            return _.NodeMaterial;\n          }), f.d(A, \"VertexOutputBlock\", function() {\n            return _.VertexOutputBlock;\n          }), f.d(A, \"BonesBlock\", function() {\n            return _.BonesBlock;\n          }), f.d(A, \"InstancesBlock\", function() {\n            return _.InstancesBlock;\n          }), f.d(A, \"MorphTargetsBlock\", function() {\n            return _.MorphTargetsBlock;\n          }), f.d(A, \"LightInformationBlock\", function() {\n            return _.LightInformationBlock;\n          }), f.d(A, \"FragmentOutputBlock\", function() {\n            return _.FragmentOutputBlock;\n          }), f.d(A, \"ImageProcessingBlock\", function() {\n            return _.ImageProcessingBlock;\n          }), f.d(A, \"PerturbNormalBlock\", function() {\n            return _.PerturbNormalBlock;\n          }), f.d(A, \"DiscardBlock\", function() {\n            return _.DiscardBlock;\n          }), f.d(A, \"FrontFacingBlock\", function() {\n            return _.FrontFacingBlock;\n          }), f.d(A, \"DerivativeBlock\", function() {\n            return _.DerivativeBlock;\n          }), f.d(A, \"FragCoordBlock\", function() {\n            return _.FragCoordBlock;\n          }), f.d(A, \"ScreenSizeBlock\", function() {\n            return _.ScreenSizeBlock;\n          }), f.d(A, \"FogBlock\", function() {\n            return _.FogBlock;\n          }), f.d(A, \"LightBlock\", function() {\n            return _.LightBlock;\n          }), f.d(A, \"TextureBlock\", function() {\n            return _.TextureBlock;\n          }), f.d(A, \"ReflectionTextureBlock\", function() {\n            return _.ReflectionTextureBlock;\n          }), f.d(A, \"CurrentScreenBlock\", function() {\n            return _.CurrentScreenBlock;\n          }), f.d(A, \"InputBlock\", function() {\n            return _.InputBlock;\n          }), f.d(A, \"AnimatedInputBlockTypes\", function() {\n            return _.AnimatedInputBlockTypes;\n          }), f.d(A, \"MultiplyBlock\", function() {\n            return _.MultiplyBlock;\n          }), f.d(A, \"AddBlock\", function() {\n            return _.AddBlock;\n          }), f.d(A, \"ScaleBlock\", function() {\n            return _.ScaleBlock;\n          }), f.d(A, \"ClampBlock\", function() {\n            return _.ClampBlock;\n          }), f.d(A, \"CrossBlock\", function() {\n            return _.CrossBlock;\n          }), f.d(A, \"DotBlock\", function() {\n            return _.DotBlock;\n          }), f.d(A, \"TransformBlock\", function() {\n            return _.TransformBlock;\n          }), f.d(A, \"RemapBlock\", function() {\n            return _.RemapBlock;\n          }), f.d(A, \"NormalizeBlock\", function() {\n            return _.NormalizeBlock;\n          }), f.d(A, \"TrigonometryBlockOperations\", function() {\n            return _.TrigonometryBlockOperations;\n          }), f.d(A, \"TrigonometryBlock\", function() {\n            return _.TrigonometryBlock;\n          }), f.d(A, \"ColorMergerBlock\", function() {\n            return _.ColorMergerBlock;\n          }), f.d(A, \"VectorMergerBlock\", function() {\n            return _.VectorMergerBlock;\n          }), f.d(A, \"ColorSplitterBlock\", function() {\n            return _.ColorSplitterBlock;\n          }), f.d(A, \"VectorSplitterBlock\", function() {\n            return _.VectorSplitterBlock;\n          }), f.d(A, \"LerpBlock\", function() {\n            return _.LerpBlock;\n          }), f.d(A, \"DivideBlock\", function() {\n            return _.DivideBlock;\n          }), f.d(A, \"SubtractBlock\", function() {\n            return _.SubtractBlock;\n          }), f.d(A, \"StepBlock\", function() {\n            return _.StepBlock;\n          }), f.d(A, \"OneMinusBlock\", function() {\n            return _.OneMinusBlock;\n          }), f.d(A, \"ViewDirectionBlock\", function() {\n            return _.ViewDirectionBlock;\n          }), f.d(A, \"FresnelBlock\", function() {\n            return _.FresnelBlock;\n          }), f.d(A, \"MaxBlock\", function() {\n            return _.MaxBlock;\n          }), f.d(A, \"MinBlock\", function() {\n            return _.MinBlock;\n          }), f.d(A, \"DistanceBlock\", function() {\n            return _.DistanceBlock;\n          }), f.d(A, \"LengthBlock\", function() {\n            return _.LengthBlock;\n          }), f.d(A, \"NegateBlock\", function() {\n            return _.NegateBlock;\n          }), f.d(A, \"PowBlock\", function() {\n            return _.PowBlock;\n          }), f.d(A, \"RandomNumberBlock\", function() {\n            return _.RandomNumberBlock;\n          }), f.d(A, \"ArcTan2Block\", function() {\n            return _.ArcTan2Block;\n          }), f.d(A, \"SmoothStepBlock\", function() {\n            return _.SmoothStepBlock;\n          }), f.d(A, \"ReciprocalBlock\", function() {\n            return _.ReciprocalBlock;\n          }), f.d(A, \"ReplaceColorBlock\", function() {\n            return _.ReplaceColorBlock;\n          }), f.d(A, \"PosterizeBlock\", function() {\n            return _.PosterizeBlock;\n          }), f.d(A, \"WaveBlockKind\", function() {\n            return _.WaveBlockKind;\n          }), f.d(A, \"WaveBlock\", function() {\n            return _.WaveBlock;\n          }), f.d(A, \"GradientBlockColorStep\", function() {\n            return _.GradientBlockColorStep;\n          }), f.d(A, \"GradientBlock\", function() {\n            return _.GradientBlock;\n          }), f.d(A, \"NLerpBlock\", function() {\n            return _.NLerpBlock;\n          }), f.d(A, \"WorleyNoise3DBlock\", function() {\n            return _.WorleyNoise3DBlock;\n          }), f.d(A, \"SimplexPerlin3DBlock\", function() {\n            return _.SimplexPerlin3DBlock;\n          }), f.d(A, \"NormalBlendBlock\", function() {\n            return _.NormalBlendBlock;\n          }), f.d(A, \"Rotate2dBlock\", function() {\n            return _.Rotate2dBlock;\n          }), f.d(A, \"ReflectBlock\", function() {\n            return _.ReflectBlock;\n          }), f.d(A, \"RefractBlock\", function() {\n            return _.RefractBlock;\n          }), f.d(A, \"DesaturateBlock\", function() {\n            return _.DesaturateBlock;\n          }), f.d(A, \"PBRMetallicRoughnessBlock\", function() {\n            return _.PBRMetallicRoughnessBlock;\n          }), f.d(A, \"SheenBlock\", function() {\n            return _.SheenBlock;\n          }), f.d(A, \"AnisotropyBlock\", function() {\n            return _.AnisotropyBlock;\n          }), f.d(A, \"ReflectionBlock\", function() {\n            return _.ReflectionBlock;\n          }), f.d(A, \"ClearCoatBlock\", function() {\n            return _.ClearCoatBlock;\n          }), f.d(A, \"RefractionBlock\", function() {\n            return _.RefractionBlock;\n          }), f.d(A, \"SubSurfaceBlock\", function() {\n            return _.SubSurfaceBlock;\n          }), f.d(A, \"ParticleTextureBlock\", function() {\n            return _.ParticleTextureBlock;\n          }), f.d(A, \"ParticleRampGradientBlock\", function() {\n            return _.ParticleRampGradientBlock;\n          }), f.d(A, \"ParticleBlendMultiplyBlock\", function() {\n            return _.ParticleBlendMultiplyBlock;\n          }), f.d(A, \"ModBlock\", function() {\n            return _.ModBlock;\n          }), f.d(A, \"NodeMaterialOptimizer\", function() {\n            return _.NodeMaterialOptimizer;\n          }), f.d(A, \"PropertyTypeForEdition\", function() {\n            return _.PropertyTypeForEdition;\n          }), f.d(A, \"editableInPropertyPage\", function() {\n            return _.editableInPropertyPage;\n          }), f.d(A, \"EffectRenderer\", function() {\n            return _.EffectRenderer;\n          }), f.d(A, \"EffectWrapper\", function() {\n            return _.EffectWrapper;\n          }), f.d(A, \"ShadowDepthWrapper\", function() {\n            return _.ShadowDepthWrapper;\n          }), f.d(A, \"Scalar\", function() {\n            return _.Scalar;\n          }), f.d(A, \"extractMinAndMaxIndexed\", function() {\n            return _.extractMinAndMaxIndexed;\n          }), f.d(A, \"extractMinAndMax\", function() {\n            return _.extractMinAndMax;\n          }), f.d(A, \"Space\", function() {\n            return _.Space;\n          }), f.d(A, \"Axis\", function() {\n            return _.Axis;\n          }), f.d(A, \"Coordinate\", function() {\n            return _.Coordinate;\n          }), f.d(A, \"Color3\", function() {\n            return _.Color3;\n          }), f.d(A, \"Color4\", function() {\n            return _.Color4;\n          }), f.d(A, \"TmpColors\", function() {\n            return _.TmpColors;\n          }), f.d(A, \"ToGammaSpace\", function() {\n            return _.ToGammaSpace;\n          }), f.d(A, \"ToLinearSpace\", function() {\n            return _.ToLinearSpace;\n          }), f.d(A, \"Epsilon\", function() {\n            return _.Epsilon;\n          }), f.d(A, \"Frustum\", function() {\n            return _.Frustum;\n          }), f.d(A, \"Orientation\", function() {\n            return _.Orientation;\n          }), f.d(A, \"BezierCurve\", function() {\n            return _.BezierCurve;\n          }), f.d(A, \"Angle\", function() {\n            return _.Angle;\n          }), f.d(A, \"Arc2\", function() {\n            return _.Arc2;\n          }), f.d(A, \"Path2\", function() {\n            return _.Path2;\n          }), f.d(A, \"Path3D\", function() {\n            return _.Path3D;\n          }), f.d(A, \"Curve3\", function() {\n            return _.Curve3;\n          }), f.d(A, \"Plane\", function() {\n            return _.Plane;\n          }), f.d(A, \"Size\", function() {\n            return _.Size;\n          }), f.d(A, \"Vector2\", function() {\n            return _.Vector2;\n          }), f.d(A, \"Vector3\", function() {\n            return _.Vector3;\n          }), f.d(A, \"Vector4\", function() {\n            return _.Vector4;\n          }), f.d(A, \"Quaternion\", function() {\n            return _.Quaternion;\n          }), f.d(A, \"Matrix\", function() {\n            return _.Matrix;\n          }), f.d(A, \"TmpVectors\", function() {\n            return _.TmpVectors;\n          }), f.d(A, \"PositionNormalVertex\", function() {\n            return _.PositionNormalVertex;\n          }), f.d(A, \"PositionNormalTextureVertex\", function() {\n            return _.PositionNormalTextureVertex;\n          }), f.d(A, \"Viewport\", function() {\n            return _.Viewport;\n          }), f.d(A, \"SphericalHarmonics\", function() {\n            return _.SphericalHarmonics;\n          }), f.d(A, \"SphericalPolynomial\", function() {\n            return _.SphericalPolynomial;\n          }), f.d(A, \"AbstractMesh\", function() {\n            return _.AbstractMesh;\n          }), f.d(A, \"Buffer\", function() {\n            return _.Buffer;\n          }), f.d(A, \"VertexBuffer\", function() {\n            return _.VertexBuffer;\n          }), f.d(A, \"DracoCompression\", function() {\n            return _.DracoCompression;\n          }), f.d(A, \"CSG\", function() {\n            return _.CSG;\n          }), f.d(A, \"Geometry\", function() {\n            return _.Geometry;\n          }), f.d(A, \"GroundMesh\", function() {\n            return _.GroundMesh;\n          }), f.d(A, \"TrailMesh\", function() {\n            return _.TrailMesh;\n          }), f.d(A, \"InstancedMesh\", function() {\n            return _.InstancedMesh;\n          }), f.d(A, \"LinesMesh\", function() {\n            return _.LinesMesh;\n          }), f.d(A, \"InstancedLinesMesh\", function() {\n            return _.InstancedLinesMesh;\n          }), f.d(A, \"_CreationDataStorage\", function() {\n            return _._CreationDataStorage;\n          }), f.d(A, \"_InstancesBatch\", function() {\n            return _._InstancesBatch;\n          }), f.d(A, \"Mesh\", function() {\n            return _.Mesh;\n          }), f.d(A, \"VertexData\", function() {\n            return _.VertexData;\n          }), f.d(A, \"MeshBuilder\", function() {\n            return _.MeshBuilder;\n          }), f.d(A, \"SimplificationSettings\", function() {\n            return _.SimplificationSettings;\n          }), f.d(A, \"SimplificationQueue\", function() {\n            return _.SimplificationQueue;\n          }), f.d(A, \"SimplificationType\", function() {\n            return _.SimplificationType;\n          }), f.d(A, \"QuadraticErrorSimplification\", function() {\n            return _.QuadraticErrorSimplification;\n          }), f.d(A, \"SimplicationQueueSceneComponent\", function() {\n            return _.SimplicationQueueSceneComponent;\n          }), f.d(A, \"Polygon\", function() {\n            return _.Polygon;\n          }), f.d(A, \"PolygonMeshBuilder\", function() {\n            return _.PolygonMeshBuilder;\n          }), f.d(A, \"SubMesh\", function() {\n            return _.SubMesh;\n          }), f.d(A, \"MeshLODLevel\", function() {\n            return _.MeshLODLevel;\n          }), f.d(A, \"TransformNode\", function() {\n            return _.TransformNode;\n          }), f.d(A, \"BoxBuilder\", function() {\n            return _.BoxBuilder;\n          }), f.d(A, \"TiledBoxBuilder\", function() {\n            return _.TiledBoxBuilder;\n          }), f.d(A, \"DiscBuilder\", function() {\n            return _.DiscBuilder;\n          }), f.d(A, \"RibbonBuilder\", function() {\n            return _.RibbonBuilder;\n          }), f.d(A, \"SphereBuilder\", function() {\n            return _.SphereBuilder;\n          }), f.d(A, \"HemisphereBuilder\", function() {\n            return _.HemisphereBuilder;\n          }), f.d(A, \"CylinderBuilder\", function() {\n            return _.CylinderBuilder;\n          }), f.d(A, \"TorusBuilder\", function() {\n            return _.TorusBuilder;\n          }), f.d(A, \"TorusKnotBuilder\", function() {\n            return _.TorusKnotBuilder;\n          }), f.d(A, \"LinesBuilder\", function() {\n            return _.LinesBuilder;\n          }), f.d(A, \"PolygonBuilder\", function() {\n            return _.PolygonBuilder;\n          }), f.d(A, \"ShapeBuilder\", function() {\n            return _.ShapeBuilder;\n          }), f.d(A, \"LatheBuilder\", function() {\n            return _.LatheBuilder;\n          }), f.d(A, \"PlaneBuilder\", function() {\n            return _.PlaneBuilder;\n          }), f.d(A, \"TiledPlaneBuilder\", function() {\n            return _.TiledPlaneBuilder;\n          }), f.d(A, \"GroundBuilder\", function() {\n            return _.GroundBuilder;\n          }), f.d(A, \"TubeBuilder\", function() {\n            return _.TubeBuilder;\n          }), f.d(A, \"PolyhedronBuilder\", function() {\n            return _.PolyhedronBuilder;\n          }), f.d(A, \"IcoSphereBuilder\", function() {\n            return _.IcoSphereBuilder;\n          }), f.d(A, \"DecalBuilder\", function() {\n            return _.DecalBuilder;\n          }), f.d(A, \"CapsuleBuilder\", function() {\n            return _.CapsuleBuilder;\n          }), f.d(A, \"DataBuffer\", function() {\n            return _.DataBuffer;\n          }), f.d(A, \"WebGLDataBuffer\", function() {\n            return _.WebGLDataBuffer;\n          }), f.d(A, \"MorphTarget\", function() {\n            return _.MorphTarget;\n          }), f.d(A, \"MorphTargetManager\", function() {\n            return _.MorphTargetManager;\n          }), f.d(A, \"RecastJSPlugin\", function() {\n            return _.RecastJSPlugin;\n          }), f.d(A, \"RecastJSCrowd\", function() {\n            return _.RecastJSCrowd;\n          }), f.d(A, \"Node\", function() {\n            return _.Node;\n          }), f.d(A, \"Database\", function() {\n            return _.Database;\n          }), f.d(A, \"BaseParticleSystem\", function() {\n            return _.BaseParticleSystem;\n          }), f.d(A, \"BoxParticleEmitter\", function() {\n            return _.BoxParticleEmitter;\n          }), f.d(A, \"ConeParticleEmitter\", function() {\n            return _.ConeParticleEmitter;\n          }), f.d(A, \"CylinderParticleEmitter\", function() {\n            return _.CylinderParticleEmitter;\n          }), f.d(A, \"CylinderDirectedParticleEmitter\", function() {\n            return _.CylinderDirectedParticleEmitter;\n          }), f.d(A, \"HemisphericParticleEmitter\", function() {\n            return _.HemisphericParticleEmitter;\n          }), f.d(A, \"PointParticleEmitter\", function() {\n            return _.PointParticleEmitter;\n          }), f.d(A, \"SphereParticleEmitter\", function() {\n            return _.SphereParticleEmitter;\n          }), f.d(A, \"SphereDirectedParticleEmitter\", function() {\n            return _.SphereDirectedParticleEmitter;\n          }), f.d(A, \"CustomParticleEmitter\", function() {\n            return _.CustomParticleEmitter;\n          }), f.d(A, \"MeshParticleEmitter\", function() {\n            return _.MeshParticleEmitter;\n          }), f.d(A, \"GPUParticleSystem\", function() {\n            return _.GPUParticleSystem;\n          }), f.d(A, \"Particle\", function() {\n            return _.Particle;\n          }), f.d(A, \"ParticleHelper\", function() {\n            return _.ParticleHelper;\n          }), f.d(A, \"ParticleSystem\", function() {\n            return _.ParticleSystem;\n          }), f.d(A, \"ParticleSystemSet\", function() {\n            return _.ParticleSystemSet;\n          }), f.d(A, \"SolidParticle\", function() {\n            return _.SolidParticle;\n          }), f.d(A, \"ModelShape\", function() {\n            return _.ModelShape;\n          }), f.d(A, \"DepthSortedParticle\", function() {\n            return _.DepthSortedParticle;\n          }), f.d(A, \"SolidParticleVertex\", function() {\n            return _.SolidParticleVertex;\n          }), f.d(A, \"SolidParticleSystem\", function() {\n            return _.SolidParticleSystem;\n          }), f.d(A, \"CloudPoint\", function() {\n            return _.CloudPoint;\n          }), f.d(A, \"PointsGroup\", function() {\n            return _.PointsGroup;\n          }), f.d(A, \"PointColor\", function() {\n            return _.PointColor;\n          }), f.d(A, \"PointsCloudSystem\", function() {\n            return _.PointsCloudSystem;\n          }), f.d(A, \"SubEmitterType\", function() {\n            return _.SubEmitterType;\n          }), f.d(A, \"SubEmitter\", function() {\n            return _.SubEmitter;\n          }), f.d(A, \"PhysicsEngine\", function() {\n            return _.PhysicsEngine;\n          }), f.d(A, \"PhysicsEngineSceneComponent\", function() {\n            return _.PhysicsEngineSceneComponent;\n          }), f.d(A, \"PhysicsHelper\", function() {\n            return _.PhysicsHelper;\n          }), f.d(A, \"PhysicsRadialExplosionEventOptions\", function() {\n            return _.PhysicsRadialExplosionEventOptions;\n          }), f.d(A, \"PhysicsUpdraftEventOptions\", function() {\n            return _.PhysicsUpdraftEventOptions;\n          }), f.d(A, \"PhysicsVortexEventOptions\", function() {\n            return _.PhysicsVortexEventOptions;\n          }), f.d(A, \"PhysicsRadialImpulseFalloff\", function() {\n            return _.PhysicsRadialImpulseFalloff;\n          }), f.d(A, \"PhysicsUpdraftMode\", function() {\n            return _.PhysicsUpdraftMode;\n          }), f.d(A, \"PhysicsImpostor\", function() {\n            return _.PhysicsImpostor;\n          }), f.d(A, \"PhysicsJoint\", function() {\n            return _.PhysicsJoint;\n          }), f.d(A, \"DistanceJoint\", function() {\n            return _.DistanceJoint;\n          }), f.d(A, \"MotorEnabledJoint\", function() {\n            return _.MotorEnabledJoint;\n          }), f.d(A, \"HingeJoint\", function() {\n            return _.HingeJoint;\n          }), f.d(A, \"Hinge2Joint\", function() {\n            return _.Hinge2Joint;\n          }), f.d(A, \"CannonJSPlugin\", function() {\n            return _.CannonJSPlugin;\n          }), f.d(A, \"AmmoJSPlugin\", function() {\n            return _.AmmoJSPlugin;\n          }), f.d(A, \"OimoJSPlugin\", function() {\n            return _.OimoJSPlugin;\n          }), f.d(A, \"AnaglyphPostProcess\", function() {\n            return _.AnaglyphPostProcess;\n          }), f.d(A, \"BlackAndWhitePostProcess\", function() {\n            return _.BlackAndWhitePostProcess;\n          }), f.d(A, \"BloomEffect\", function() {\n            return _.BloomEffect;\n          }), f.d(A, \"BloomMergePostProcess\", function() {\n            return _.BloomMergePostProcess;\n          }), f.d(A, \"BlurPostProcess\", function() {\n            return _.BlurPostProcess;\n          }), f.d(A, \"ChromaticAberrationPostProcess\", function() {\n            return _.ChromaticAberrationPostProcess;\n          }), f.d(A, \"CircleOfConfusionPostProcess\", function() {\n            return _.CircleOfConfusionPostProcess;\n          }), f.d(A, \"ColorCorrectionPostProcess\", function() {\n            return _.ColorCorrectionPostProcess;\n          }), f.d(A, \"ConvolutionPostProcess\", function() {\n            return _.ConvolutionPostProcess;\n          }), f.d(A, \"DepthOfFieldBlurPostProcess\", function() {\n            return _.DepthOfFieldBlurPostProcess;\n          }), f.d(A, \"DepthOfFieldEffectBlurLevel\", function() {\n            return _.DepthOfFieldEffectBlurLevel;\n          }), f.d(A, \"DepthOfFieldEffect\", function() {\n            return _.DepthOfFieldEffect;\n          }), f.d(A, \"DepthOfFieldMergePostProcessOptions\", function() {\n            return _.DepthOfFieldMergePostProcessOptions;\n          }), f.d(A, \"DepthOfFieldMergePostProcess\", function() {\n            return _.DepthOfFieldMergePostProcess;\n          }), f.d(A, \"DisplayPassPostProcess\", function() {\n            return _.DisplayPassPostProcess;\n          }), f.d(A, \"ExtractHighlightsPostProcess\", function() {\n            return _.ExtractHighlightsPostProcess;\n          }), f.d(A, \"FilterPostProcess\", function() {\n            return _.FilterPostProcess;\n          }), f.d(A, \"FxaaPostProcess\", function() {\n            return _.FxaaPostProcess;\n          }), f.d(A, \"GrainPostProcess\", function() {\n            return _.GrainPostProcess;\n          }), f.d(A, \"HighlightsPostProcess\", function() {\n            return _.HighlightsPostProcess;\n          }), f.d(A, \"ImageProcessingPostProcess\", function() {\n            return _.ImageProcessingPostProcess;\n          }), f.d(A, \"MotionBlurPostProcess\", function() {\n            return _.MotionBlurPostProcess;\n          }), f.d(A, \"PassPostProcess\", function() {\n            return _.PassPostProcess;\n          }), f.d(A, \"PassCubePostProcess\", function() {\n            return _.PassCubePostProcess;\n          }), f.d(A, \"PostProcess\", function() {\n            return _.PostProcess;\n          }), f.d(A, \"PostProcessManager\", function() {\n            return _.PostProcessManager;\n          }), f.d(A, \"RefractionPostProcess\", function() {\n            return _.RefractionPostProcess;\n          }), f.d(A, \"DefaultRenderingPipeline\", function() {\n            return _.DefaultRenderingPipeline;\n          }), f.d(A, \"LensRenderingPipeline\", function() {\n            return _.LensRenderingPipeline;\n          }), f.d(A, \"SSAO2RenderingPipeline\", function() {\n            return _.SSAO2RenderingPipeline;\n          }), f.d(A, \"SSAORenderingPipeline\", function() {\n            return _.SSAORenderingPipeline;\n          }), f.d(A, \"StandardRenderingPipeline\", function() {\n            return _.StandardRenderingPipeline;\n          }), f.d(A, \"PostProcessRenderEffect\", function() {\n            return _.PostProcessRenderEffect;\n          }), f.d(A, \"PostProcessRenderPipeline\", function() {\n            return _.PostProcessRenderPipeline;\n          }), f.d(A, \"PostProcessRenderPipelineManager\", function() {\n            return _.PostProcessRenderPipelineManager;\n          }), f.d(A, \"PostProcessRenderPipelineManagerSceneComponent\", function() {\n            return _.PostProcessRenderPipelineManagerSceneComponent;\n          }), f.d(A, \"SharpenPostProcess\", function() {\n            return _.SharpenPostProcess;\n          }), f.d(A, \"StereoscopicInterlacePostProcessI\", function() {\n            return _.StereoscopicInterlacePostProcessI;\n          }), f.d(A, \"StereoscopicInterlacePostProcess\", function() {\n            return _.StereoscopicInterlacePostProcess;\n          }), f.d(A, \"TonemappingOperator\", function() {\n            return _.TonemappingOperator;\n          }), f.d(A, \"TonemapPostProcess\", function() {\n            return _.TonemapPostProcess;\n          }), f.d(A, \"VolumetricLightScatteringPostProcess\", function() {\n            return _.VolumetricLightScatteringPostProcess;\n          }), f.d(A, \"VRDistortionCorrectionPostProcess\", function() {\n            return _.VRDistortionCorrectionPostProcess;\n          }), f.d(A, \"VRMultiviewToSingleviewPostProcess\", function() {\n            return _.VRMultiviewToSingleviewPostProcess;\n          }), f.d(A, \"ScreenSpaceReflectionPostProcess\", function() {\n            return _.ScreenSpaceReflectionPostProcess;\n          }), f.d(A, \"ScreenSpaceCurvaturePostProcess\", function() {\n            return _.ScreenSpaceCurvaturePostProcess;\n          }), f.d(A, \"ReflectionProbe\", function() {\n            return _.ReflectionProbe;\n          }), f.d(A, \"BoundingBoxRenderer\", function() {\n            return _.BoundingBoxRenderer;\n          }), f.d(A, \"DepthRenderer\", function() {\n            return _.DepthRenderer;\n          }), f.d(A, \"DepthRendererSceneComponent\", function() {\n            return _.DepthRendererSceneComponent;\n          }), f.d(A, \"EdgesRenderer\", function() {\n            return _.EdgesRenderer;\n          }), f.d(A, \"LineEdgesRenderer\", function() {\n            return _.LineEdgesRenderer;\n          }), f.d(A, \"GeometryBufferRenderer\", function() {\n            return _.GeometryBufferRenderer;\n          }), f.d(A, \"GeometryBufferRendererSceneComponent\", function() {\n            return _.GeometryBufferRendererSceneComponent;\n          }), f.d(A, \"PrePassRenderer\", function() {\n            return _.PrePassRenderer;\n          }), f.d(A, \"PrePassRendererSceneComponent\", function() {\n            return _.PrePassRendererSceneComponent;\n          }), f.d(A, \"SubSurfaceSceneComponent\", function() {\n            return _.SubSurfaceSceneComponent;\n          }), f.d(A, \"OutlineRenderer\", function() {\n            return _.OutlineRenderer;\n          }), f.d(A, \"RenderingGroup\", function() {\n            return _.RenderingGroup;\n          }), f.d(A, \"RenderingGroupInfo\", function() {\n            return _.RenderingGroupInfo;\n          }), f.d(A, \"RenderingManager\", function() {\n            return _.RenderingManager;\n          }), f.d(A, \"UtilityLayerRenderer\", function() {\n            return _.UtilityLayerRenderer;\n          }), f.d(A, \"Scene\", function() {\n            return _.Scene;\n          }), f.d(A, \"SceneComponentConstants\", function() {\n            return _.SceneComponentConstants;\n          }), f.d(A, \"Stage\", function() {\n            return _.Stage;\n          }), f.d(A, \"Sprite\", function() {\n            return _.Sprite;\n          }), f.d(A, \"SpriteManager\", function() {\n            return _.SpriteManager;\n          }), f.d(A, \"SpriteMap\", function() {\n            return _.SpriteMap;\n          }), f.d(A, \"SpritePackedManager\", function() {\n            return _.SpritePackedManager;\n          }), f.d(A, \"SpriteSceneComponent\", function() {\n            return _.SpriteSceneComponent;\n          }), f.d(A, \"AlphaState\", function() {\n            return _.AlphaState;\n          }), f.d(A, \"DepthCullingState\", function() {\n            return _.DepthCullingState;\n          }), f.d(A, \"StencilState\", function() {\n            return _.StencilState;\n          }), f.d(A, \"AndOrNotEvaluator\", function() {\n            return _.AndOrNotEvaluator;\n          }), f.d(A, \"AssetTaskState\", function() {\n            return _.AssetTaskState;\n          }), f.d(A, \"AbstractAssetTask\", function() {\n            return _.AbstractAssetTask;\n          }), f.d(A, \"AssetsProgressEvent\", function() {\n            return _.AssetsProgressEvent;\n          }), f.d(A, \"ContainerAssetTask\", function() {\n            return _.ContainerAssetTask;\n          }), f.d(A, \"MeshAssetTask\", function() {\n            return _.MeshAssetTask;\n          }), f.d(A, \"TextFileAssetTask\", function() {\n            return _.TextFileAssetTask;\n          }), f.d(A, \"BinaryFileAssetTask\", function() {\n            return _.BinaryFileAssetTask;\n          }), f.d(A, \"ImageAssetTask\", function() {\n            return _.ImageAssetTask;\n          }), f.d(A, \"TextureAssetTask\", function() {\n            return _.TextureAssetTask;\n          }), f.d(A, \"CubeTextureAssetTask\", function() {\n            return _.CubeTextureAssetTask;\n          }), f.d(A, \"HDRCubeTextureAssetTask\", function() {\n            return _.HDRCubeTextureAssetTask;\n          }), f.d(A, \"EquiRectangularCubeTextureAssetTask\", function() {\n            return _.EquiRectangularCubeTextureAssetTask;\n          }), f.d(A, \"AssetsManager\", function() {\n            return _.AssetsManager;\n          }), f.d(A, \"BasisTranscodeConfiguration\", function() {\n            return _.BasisTranscodeConfiguration;\n          }), f.d(A, \"BasisTools\", function() {\n            return _.BasisTools;\n          }), f.d(A, \"DDSTools\", function() {\n            return _.DDSTools;\n          }), f.d(A, \"expandToProperty\", function() {\n            return _.expandToProperty;\n          }), f.d(A, \"serialize\", function() {\n            return _.serialize;\n          }), f.d(A, \"serializeAsTexture\", function() {\n            return _.serializeAsTexture;\n          }), f.d(A, \"serializeAsColor3\", function() {\n            return _.serializeAsColor3;\n          }), f.d(A, \"serializeAsFresnelParameters\", function() {\n            return _.serializeAsFresnelParameters;\n          }), f.d(A, \"serializeAsVector2\", function() {\n            return _.serializeAsVector2;\n          }), f.d(A, \"serializeAsVector3\", function() {\n            return _.serializeAsVector3;\n          }), f.d(A, \"serializeAsMeshReference\", function() {\n            return _.serializeAsMeshReference;\n          }), f.d(A, \"serializeAsColorCurves\", function() {\n            return _.serializeAsColorCurves;\n          }), f.d(A, \"serializeAsColor4\", function() {\n            return _.serializeAsColor4;\n          }), f.d(A, \"serializeAsImageProcessingConfiguration\", function() {\n            return _.serializeAsImageProcessingConfiguration;\n          }), f.d(A, \"serializeAsQuaternion\", function() {\n            return _.serializeAsQuaternion;\n          }), f.d(A, \"serializeAsMatrix\", function() {\n            return _.serializeAsMatrix;\n          }), f.d(A, \"serializeAsCameraReference\", function() {\n            return _.serializeAsCameraReference;\n          }), f.d(A, \"SerializationHelper\", function() {\n            return _.SerializationHelper;\n          }), f.d(A, \"Deferred\", function() {\n            return _.Deferred;\n          }), f.d(A, \"EnvironmentTextureTools\", function() {\n            return _.EnvironmentTextureTools;\n          }), f.d(A, \"MeshExploder\", function() {\n            return _.MeshExploder;\n          }), f.d(A, \"FilesInput\", function() {\n            return _.FilesInput;\n          }), f.d(A, \"CubeMapToSphericalPolynomialTools\", function() {\n            return _.CubeMapToSphericalPolynomialTools;\n          }), f.d(A, \"HDRTools\", function() {\n            return _.HDRTools;\n          }), f.d(A, \"PanoramaToCubeMapTools\", function() {\n            return _.PanoramaToCubeMapTools;\n          }), f.d(A, \"KhronosTextureContainer\", function() {\n            return _.KhronosTextureContainer;\n          }), f.d(A, \"EventState\", function() {\n            return _.EventState;\n          }), f.d(A, \"Observer\", function() {\n            return _.Observer;\n          }), f.d(A, \"MultiObserver\", function() {\n            return _.MultiObserver;\n          }), f.d(A, \"Observable\", function() {\n            return _.Observable;\n          }), f.d(A, \"PerformanceMonitor\", function() {\n            return _.PerformanceMonitor;\n          }), f.d(A, \"RollingAverage\", function() {\n            return _.RollingAverage;\n          }), f.d(A, \"PromisePolyfill\", function() {\n            return _.PromisePolyfill;\n          }), f.d(A, \"SceneOptimization\", function() {\n            return _.SceneOptimization;\n          }), f.d(A, \"TextureOptimization\", function() {\n            return _.TextureOptimization;\n          }), f.d(A, \"HardwareScalingOptimization\", function() {\n            return _.HardwareScalingOptimization;\n          }), f.d(A, \"ShadowsOptimization\", function() {\n            return _.ShadowsOptimization;\n          }), f.d(A, \"PostProcessesOptimization\", function() {\n            return _.PostProcessesOptimization;\n          }), f.d(A, \"LensFlaresOptimization\", function() {\n            return _.LensFlaresOptimization;\n          }), f.d(A, \"CustomOptimization\", function() {\n            return _.CustomOptimization;\n          }), f.d(A, \"ParticlesOptimization\", function() {\n            return _.ParticlesOptimization;\n          }), f.d(A, \"RenderTargetsOptimization\", function() {\n            return _.RenderTargetsOptimization;\n          }), f.d(A, \"MergeMeshesOptimization\", function() {\n            return _.MergeMeshesOptimization;\n          }), f.d(A, \"SceneOptimizerOptions\", function() {\n            return _.SceneOptimizerOptions;\n          }), f.d(A, \"SceneOptimizer\", function() {\n            return _.SceneOptimizer;\n          }), f.d(A, \"SceneSerializer\", function() {\n            return _.SceneSerializer;\n          }), f.d(A, \"SmartArray\", function() {\n            return _.SmartArray;\n          }), f.d(A, \"SmartArrayNoDuplicate\", function() {\n            return _.SmartArrayNoDuplicate;\n          }), f.d(A, \"StringDictionary\", function() {\n            return _.StringDictionary;\n          }), f.d(A, \"Tags\", function() {\n            return _.Tags;\n          }), f.d(A, \"TextureTools\", function() {\n            return _.TextureTools;\n          }), f.d(A, \"TGATools\", function() {\n            return _.TGATools;\n          }), f.d(A, \"Tools\", function() {\n            return _.Tools;\n          }), f.d(A, \"className\", function() {\n            return _.className;\n          }), f.d(A, \"AsyncLoop\", function() {\n            return _.AsyncLoop;\n          }), f.d(A, \"VideoRecorder\", function() {\n            return _.VideoRecorder;\n          }), f.d(A, \"JoystickAxis\", function() {\n            return _.JoystickAxis;\n          }), f.d(A, \"VirtualJoystick\", function() {\n            return _.VirtualJoystick;\n          }), f.d(A, \"WorkerPool\", function() {\n            return _.WorkerPool;\n          }), f.d(A, \"Logger\", function() {\n            return _.Logger;\n          }), f.d(A, \"_TypeStore\", function() {\n            return _._TypeStore;\n          }), f.d(A, \"FilesInputStore\", function() {\n            return _.FilesInputStore;\n          }), f.d(A, \"DeepCopier\", function() {\n            return _.DeepCopier;\n          }), f.d(A, \"PivotTools\", function() {\n            return _.PivotTools;\n          }), f.d(A, \"PrecisionDate\", function() {\n            return _.PrecisionDate;\n          }), f.d(A, \"ScreenshotTools\", function() {\n            return _.ScreenshotTools;\n          }), f.d(A, \"WebRequest\", function() {\n            return _.WebRequest;\n          }), f.d(A, \"InspectableType\", function() {\n            return _.InspectableType;\n          }), f.d(A, \"BRDFTextureTools\", function() {\n            return _.BRDFTextureTools;\n          }), f.d(A, \"RGBDTextureTools\", function() {\n            return _.RGBDTextureTools;\n          }), f.d(A, \"ColorGradient\", function() {\n            return _.ColorGradient;\n          }), f.d(A, \"Color3Gradient\", function() {\n            return _.Color3Gradient;\n          }), f.d(A, \"FactorGradient\", function() {\n            return _.FactorGradient;\n          }), f.d(A, \"GradientHelper\", function() {\n            return _.GradientHelper;\n          }), f.d(A, \"PerfCounter\", function() {\n            return _.PerfCounter;\n          }), f.d(A, \"RetryStrategy\", function() {\n            return _.RetryStrategy;\n          }), f.d(A, \"CanvasGenerator\", function() {\n            return _.CanvasGenerator;\n          }), f.d(A, \"LoadFileError\", function() {\n            return _.LoadFileError;\n          }), f.d(A, \"RequestFileError\", function() {\n            return _.RequestFileError;\n          }), f.d(A, \"ReadFileError\", function() {\n            return _.ReadFileError;\n          }), f.d(A, \"FileTools\", function() {\n            return _.FileTools;\n          }), f.d(A, \"StringTools\", function() {\n            return _.StringTools;\n          }), f.d(A, \"DataReader\", function() {\n            return _.DataReader;\n          }), f.d(A, \"MinMaxReducer\", function() {\n            return _.MinMaxReducer;\n          }), f.d(A, \"DepthReducer\", function() {\n            return _.DepthReducer;\n          }), f.d(A, \"DataStorage\", function() {\n            return _.DataStorage;\n          }), f.d(A, \"SceneRecorder\", function() {\n            return _.SceneRecorder;\n          }), f.d(A, \"KhronosTextureContainer2\", function() {\n            return _.KhronosTextureContainer2;\n          }), f.d(A, \"Trajectory\", function() {\n            return _.Trajectory;\n          }), f.d(A, \"TrajectoryClassifier\", function() {\n            return _.TrajectoryClassifier;\n          }), f.d(A, \"TimerState\", function() {\n            return _.TimerState;\n          }), f.d(A, \"setAndStartTimer\", function() {\n            return _.setAndStartTimer;\n          }), f.d(A, \"AdvancedTimer\", function() {\n            return _.AdvancedTimer;\n          }), f.d(A, \"CopyTools\", function() {\n            return _.CopyTools;\n          }), f.d(A, \"WebXRCamera\", function() {\n            return _.WebXRCamera;\n          }), f.d(A, \"WebXREnterExitUIButton\", function() {\n            return _.WebXREnterExitUIButton;\n          }), f.d(A, \"WebXREnterExitUIOptions\", function() {\n            return _.WebXREnterExitUIOptions;\n          }), f.d(A, \"WebXREnterExitUI\", function() {\n            return _.WebXREnterExitUI;\n          }), f.d(A, \"WebXRExperienceHelper\", function() {\n            return _.WebXRExperienceHelper;\n          }), f.d(A, \"WebXRInput\", function() {\n            return _.WebXRInput;\n          }), f.d(A, \"WebXRInputSource\", function() {\n            return _.WebXRInputSource;\n          }), f.d(A, \"WebXRManagedOutputCanvasOptions\", function() {\n            return _.WebXRManagedOutputCanvasOptions;\n          }), f.d(A, \"WebXRManagedOutputCanvas\", function() {\n            return _.WebXRManagedOutputCanvas;\n          }), f.d(A, \"WebXRState\", function() {\n            return _.WebXRState;\n          }), f.d(A, \"WebXRTrackingState\", function() {\n            return _.WebXRTrackingState;\n          }), f.d(A, \"WebXRSessionManager\", function() {\n            return _.WebXRSessionManager;\n          }), f.d(A, \"WebXRDefaultExperienceOptions\", function() {\n            return _.WebXRDefaultExperienceOptions;\n          }), f.d(A, \"WebXRDefaultExperience\", function() {\n            return _.WebXRDefaultExperience;\n          }), f.d(A, \"WebXRFeatureName\", function() {\n            return _.WebXRFeatureName;\n          }), f.d(A, \"WebXRFeaturesManager\", function() {\n            return _.WebXRFeaturesManager;\n          }), f.d(A, \"WebXRAbstractFeature\", function() {\n            return _.WebXRAbstractFeature;\n          }), f.d(A, \"WebXRHitTestLegacy\", function() {\n            return _.WebXRHitTestLegacy;\n          }), f.d(A, \"WebXRAnchorSystem\", function() {\n            return _.WebXRAnchorSystem;\n          }), f.d(A, \"WebXRPlaneDetector\", function() {\n            return _.WebXRPlaneDetector;\n          }), f.d(A, \"WebXRBackgroundRemover\", function() {\n            return _.WebXRBackgroundRemover;\n          }), f.d(A, \"WebXRMotionControllerTeleportation\", function() {\n            return _.WebXRMotionControllerTeleportation;\n          }), f.d(A, \"WebXRControllerPointerSelection\", function() {\n            return _.WebXRControllerPointerSelection;\n          }), f.d(A, \"IWebXRControllerPhysicsOptions\", function() {\n            return _.IWebXRControllerPhysicsOptions;\n          }), f.d(A, \"WebXRControllerPhysics\", function() {\n            return _.WebXRControllerPhysics;\n          }), f.d(A, \"WebXRHitTest\", function() {\n            return _.WebXRHitTest;\n          }), f.d(A, \"WebXRFeaturePointSystem\", function() {\n            return _.WebXRFeaturePointSystem;\n          }), f.d(A, \"WebXRHand\", function() {\n            return _.WebXRHand;\n          }), f.d(A, \"WebXRHandTracking\", function() {\n            return _.WebXRHandTracking;\n          }), f.d(A, \"WebXRAbstractMotionController\", function() {\n            return _.WebXRAbstractMotionController;\n          }), f.d(A, \"WebXRControllerComponent\", function() {\n            return _.WebXRControllerComponent;\n          }), f.d(A, \"WebXRGenericTriggerMotionController\", function() {\n            return _.WebXRGenericTriggerMotionController;\n          }), f.d(A, \"WebXRMicrosoftMixedRealityController\", function() {\n            return _.WebXRMicrosoftMixedRealityController;\n          }), f.d(A, \"WebXRMotionControllerManager\", function() {\n            return _.WebXRMotionControllerManager;\n          }), f.d(A, \"WebXROculusTouchMotionController\", function() {\n            return _.WebXROculusTouchMotionController;\n          }), f.d(A, \"WebXRHTCViveMotionController\", function() {\n            return _.WebXRHTCViveMotionController;\n          }), f.d(A, \"WebXRProfiledMotionController\", function() {\n            return _.WebXRProfiledMotionController;\n          });\n          var u = V !== void 0 ? V : typeof window < \"u\" ? window : void 0;\n          if (u !== void 0) {\n            u.BABYLON = I, u.BABYLON = u.BABYLON || {};\n            var I = u.BABYLON;\n            I.Debug = I.Debug || {};\n            var O = [];\n            for (var x in C)\n              I.Debug[x] = C[x], O.push(x);\n            for (var x in _)\n              I[x] = _[x];\n          }\n          var m = { AxesViewer: C.AxesViewer, BoneAxesViewer: C.BoneAxesViewer, PhysicsViewer: C.PhysicsViewer, SkeletonViewer: C.SkeletonViewer };\n        }).call(this, f(159));\n      }]);\n    });\n  }(Yc)), Yc.exports;\n}\nvar Pi = sf(), cf = { exports: {} };\n(function(an, ln) {\n  (function(Be, A) {\n    an.exports = A(sf());\n  })(typeof self < \"u\" ? self : typeof Gr < \"u\" ? Gr : Gr, function(Be) {\n    return function(A) {\n      var f = {};\n      function V(_) {\n        if (f[_])\n          return f[_].exports;\n        var C = f[_] = { i: _, l: !1, exports: {} };\n        return A[_].call(C.exports, C, C.exports, V), C.l = !0, C.exports;\n      }\n      return V.m = A, V.c = f, V.d = function(_, C, u) {\n        V.o(_, C) || Object.defineProperty(_, C, { enumerable: !0, get: u });\n      }, V.r = function(_) {\n        typeof Symbol < \"u\" && Symbol.toStringTag && Object.defineProperty(_, Symbol.toStringTag, { value: \"Module\" }), Object.defineProperty(_, \"__esModule\", { value: !0 });\n      }, V.t = function(_, C) {\n        if (1 & C && (_ = V(_)), 8 & C || 4 & C && typeof _ == \"object\" && _ && _.__esModule)\n          return _;\n        var u = /* @__PURE__ */ Object.create(null);\n        if (V.r(u), Object.defineProperty(u, \"default\", { enumerable: !0, value: _ }), 2 & C && typeof _ != \"string\")\n          for (var I in _)\n            V.d(u, I, (function(O) {\n              return _[O];\n            }).bind(null, I));\n        return u;\n      }, V.n = function(_) {\n        var C = _ && _.__esModule ? function() {\n          return _.default;\n        } : function() {\n          return _;\n        };\n        return V.d(C, \"a\", C), C;\n      }, V.o = function(_, C) {\n        return Object.prototype.hasOwnProperty.call(_, C);\n      }, V.p = \"\", V(V.s = 20);\n    }([function(A, f) {\n      A.exports = Be;\n    }, function(A, f, V) {\n      V.d(f, \"a\", function() {\n        return u;\n      }), V.d(f, \"b\", function() {\n        return I;\n      });\n      var _ = V(0), C = V(2), u = function() {\n        function O() {\n        }\n        return O.Get = function(x, m, c) {\n          if (!m || c == null || !m[c])\n            throw new Error(x + \": Failed to find index (\" + c + \")\");\n          return m[c];\n        }, O.Assign = function(x) {\n          if (x)\n            for (var m = 0; m < x.length; m++)\n              x[m].index = m;\n        }, O;\n      }(), I = function() {\n        function O(x) {\n          this._completePromises = new Array(), this._forAssetContainer = !1, this._babylonLights = [], this._disableInstancedMesh = 0, this._disposed = !1, this._state = null, this._extensions = new Array(), this._defaultBabylonMaterialData = {}, this._parent = x;\n        }\n        return O.RegisterExtension = function(x, m) {\n          O.UnregisterExtension(x) && _.Logger.Warn(\"Extension with the name '\" + x + \"' already exists\"), O._RegisteredExtensions[x] = { factory: m };\n        }, O.UnregisterExtension = function(x) {\n          return !!O._RegisteredExtensions[x] && (delete O._RegisteredExtensions[x], !0);\n        }, Object.defineProperty(O.prototype, \"state\", { get: function() {\n          return this._state;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"gltf\", { get: function() {\n          return this._gltf;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"bin\", { get: function() {\n          return this._bin;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"parent\", { get: function() {\n          return this._parent;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"babylonScene\", { get: function() {\n          return this._babylonScene;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(O.prototype, \"rootBabylonMesh\", { get: function() {\n          return this._rootBabylonMesh;\n        }, enumerable: !1, configurable: !0 }), O.prototype.dispose = function() {\n          if (!this._disposed) {\n            for (var x in this._disposed = !0, this._completePromises.length = 0, this._extensions) {\n              var m = this._extensions[x];\n              m.dispose && m.dispose(), delete this._extensions[x];\n            }\n            this._gltf = null, this._babylonScene = null, this._rootBabylonMesh = null, this._parent.dispose();\n          }\n        }, O.prototype.importMeshAsync = function(x, m, c, T, S, E, g) {\n          var l = this;\n          return Promise.resolve().then(function() {\n            l._babylonScene = m, l._rootUrl = S, l._fileName = g || \"scene\", l._forAssetContainer = c, l._loadData(T);\n            var h = null;\n            if (x) {\n              var v = {};\n              if (l._gltf.nodes)\n                for (var b = 0, D = l._gltf.nodes; b < D.length; b++) {\n                  var w = D[b];\n                  w.name && (v[w.name] = w.index);\n                }\n              h = (x instanceof Array ? x : [x]).map(function(N) {\n                var M = v[N];\n                if (M === void 0)\n                  throw new Error(\"Failed to find node '\" + N + \"'\");\n                return M;\n              });\n            }\n            return l._loadAsync(h, function() {\n              return { meshes: l._getMeshes(), particleSystems: [], skeletons: l._getSkeletons(), animationGroups: l._getAnimationGroups(), lights: l._babylonLights, transformNodes: l._getTransformNodes(), geometries: l._getGeometries() };\n            });\n          });\n        }, O.prototype.loadAsync = function(x, m, c, T, S) {\n          var E = this;\n          return Promise.resolve().then(function() {\n            return E._babylonScene = x, E._rootUrl = c, E._fileName = S || \"scene\", E._loadData(m), E._loadAsync(null, function() {\n            });\n          });\n        }, O.prototype._loadAsync = function(x, m) {\n          var c = this;\n          return Promise.resolve().then(function() {\n            c._uniqueRootUrl = c._rootUrl.indexOf(\"file:\") === -1 && c._fileName ? c._rootUrl : \"\" + c._rootUrl + Date.now() + \"/\", c._loadExtensions(), c._checkExtensions();\n            var T = C.GLTFLoaderState[C.GLTFLoaderState.LOADING] + \" => \" + C.GLTFLoaderState[C.GLTFLoaderState.READY], S = C.GLTFLoaderState[C.GLTFLoaderState.LOADING] + \" => \" + C.GLTFLoaderState[C.GLTFLoaderState.COMPLETE];\n            c._parent._startPerformanceCounter(T), c._parent._startPerformanceCounter(S), c._setState(C.GLTFLoaderState.LOADING), c._extensionsOnLoading();\n            var E = new Array(), g = c._babylonScene.blockMaterialDirtyMechanism;\n            if (c._babylonScene.blockMaterialDirtyMechanism = !0, x)\n              E.push(c.loadSceneAsync(\"/nodes\", { nodes: x, index: -1 }));\n            else if (c._gltf.scene != null || c._gltf.scenes && c._gltf.scenes[0]) {\n              var l = u.Get(\"/scene\", c._gltf.scenes, c._gltf.scene || 0);\n              E.push(c.loadSceneAsync(\"/scenes/\" + l.index, l));\n            }\n            if (c.parent.loadAllMaterials && c._gltf.materials)\n              for (var h = 0; h < c._gltf.materials.length; ++h) {\n                var v = c._gltf.materials[h], b = \"/materials/\" + h, D = _.Material.TriangleFillMode;\n                E.push(c._loadMaterialAsync(b, v, null, D, function(N) {\n                }));\n              }\n            c._babylonScene.blockMaterialDirtyMechanism = g, c._parent.compileMaterials && E.push(c._compileMaterialsAsync()), c._parent.compileShadowGenerators && E.push(c._compileShadowGeneratorsAsync());\n            var w = Promise.all(E).then(function() {\n              return c._rootBabylonMesh && c._rootBabylonMesh.setEnabled(!0), c._extensionsOnReady(), c._setState(C.GLTFLoaderState.READY), c._startAnimations(), m();\n            });\n            return w.then(function() {\n              c._parent._endPerformanceCounter(T), _.Tools.SetImmediate(function() {\n                c._disposed || Promise.all(c._completePromises).then(function() {\n                  c._parent._endPerformanceCounter(S), c._setState(C.GLTFLoaderState.COMPLETE), c._parent.onCompleteObservable.notifyObservers(void 0), c._parent.onCompleteObservable.clear(), c.dispose();\n                }, function(N) {\n                  c._parent.onErrorObservable.notifyObservers(N), c._parent.onErrorObservable.clear(), c.dispose();\n                });\n              });\n            }), w;\n          }).catch(function(T) {\n            throw c._disposed || (c._parent.onErrorObservable.notifyObservers(T), c._parent.onErrorObservable.clear(), c.dispose()), T;\n          });\n        }, O.prototype._loadData = function(x) {\n          if (this._gltf = x.json, this._setupData(), x.bin) {\n            var m = this._gltf.buffers;\n            if (m && m[0] && !m[0].uri) {\n              var c = m[0];\n              (c.byteLength < x.bin.byteLength - 3 || c.byteLength > x.bin.byteLength) && _.Logger.Warn(\"Binary buffer length (\" + c.byteLength + \") from JSON does not match chunk length (\" + x.bin.byteLength + \")\"), this._bin = x.bin;\n            } else\n              _.Logger.Warn(\"Unexpected BIN chunk\");\n          }\n        }, O.prototype._setupData = function() {\n          if (u.Assign(this._gltf.accessors), u.Assign(this._gltf.animations), u.Assign(this._gltf.buffers), u.Assign(this._gltf.bufferViews), u.Assign(this._gltf.cameras), u.Assign(this._gltf.images), u.Assign(this._gltf.materials), u.Assign(this._gltf.meshes), u.Assign(this._gltf.nodes), u.Assign(this._gltf.samplers), u.Assign(this._gltf.scenes), u.Assign(this._gltf.skins), u.Assign(this._gltf.textures), this._gltf.nodes) {\n            for (var x = {}, m = 0, c = this._gltf.nodes; m < c.length; m++)\n              if ((h = c[m]).children)\n                for (var T = 0, S = h.children; T < S.length; T++)\n                  x[S[T]] = h.index;\n            for (var E = this._createRootNode(), g = 0, l = this._gltf.nodes; g < l.length; g++) {\n              var h, v = x[(h = l[g]).index];\n              h.parent = v === void 0 ? E : this._gltf.nodes[v];\n            }\n          }\n        }, O.prototype._loadExtensions = function() {\n          for (var x in O._RegisteredExtensions) {\n            var m = O._RegisteredExtensions[x].factory(this);\n            m.name !== x && _.Logger.Warn(\"The name of the glTF loader extension instance does not match the registered name: \" + m.name + \" !== \" + x), this._extensions.push(m), this._parent.onExtensionLoadedObservable.notifyObservers(m);\n          }\n          this._extensions.sort(function(c, T) {\n            return (c.order || Number.MAX_VALUE) - (T.order || Number.MAX_VALUE);\n          }), this._parent.onExtensionLoadedObservable.clear();\n        }, O.prototype._checkExtensions = function() {\n          if (this._gltf.extensionsRequired)\n            for (var x = function(S) {\n              if (!m._extensions.some(function(E) {\n                return E.name === S && E.enabled;\n              }))\n                throw new Error(\"Require extension \" + S + \" is not available\");\n            }, m = this, c = 0, T = this._gltf.extensionsRequired; c < T.length; c++)\n              x(T[c]);\n        }, O.prototype._setState = function(x) {\n          this._state = x, this.log(C.GLTFLoaderState[this._state]);\n        }, O.prototype._createRootNode = function() {\n          this._babylonScene._blockEntityCollection = this._forAssetContainer, this._rootBabylonMesh = new _.Mesh(\"__root__\", this._babylonScene), this._babylonScene._blockEntityCollection = !1, this._rootBabylonMesh.setEnabled(!1);\n          var x = { _babylonTransformNode: this._rootBabylonMesh, index: -1 };\n          switch (this._parent.coordinateSystemMode) {\n            case C.GLTFLoaderCoordinateSystemMode.AUTO:\n              this._babylonScene.useRightHandedSystem || (x.rotation = [0, 1, 0, 0], x.scale = [1, 1, -1], O._LoadTransform(x, this._rootBabylonMesh));\n              break;\n            case C.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:\n              this._babylonScene.useRightHandedSystem = !0;\n              break;\n            default:\n              throw new Error(\"Invalid coordinate system mode (\" + this._parent.coordinateSystemMode + \")\");\n          }\n          return this._parent.onMeshLoadedObservable.notifyObservers(this._rootBabylonMesh), x;\n        }, O.prototype.loadSceneAsync = function(x, m) {\n          var c = this, T = this._extensionsLoadSceneAsync(x, m);\n          if (T)\n            return T;\n          var S = new Array();\n          if (this.logOpen(x + \" \" + (m.name || \"\")), m.nodes)\n            for (var E = 0, g = m.nodes; E < g.length; E++) {\n              var l = g[E], h = u.Get(x + \"/nodes/\" + l, this._gltf.nodes, l);\n              S.push(this.loadNodeAsync(\"/nodes/\" + h.index, h, function(N) {\n                N.parent = c._rootBabylonMesh;\n              }));\n            }\n          if (this._gltf.nodes) {\n            for (var v = 0, b = this._gltf.nodes; v < b.length; v++)\n              if ((h = b[v])._babylonTransformNode && h._babylonBones)\n                for (var D = 0, w = h._babylonBones; D < w.length; D++)\n                  w[D].linkTransformNode(h._babylonTransformNode);\n          }\n          return S.push(this._loadAnimationsAsync()), this.logClose(), Promise.all(S).then(function() {\n          });\n        }, O.prototype._forEachPrimitive = function(x, m) {\n          if (x._primitiveBabylonMeshes)\n            for (var c = 0, T = x._primitiveBabylonMeshes; c < T.length; c++)\n              m(T[c]);\n        }, O.prototype._getGeometries = function() {\n          var x = new Array(), m = this._gltf.nodes;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              this._forEachPrimitive(S, function(E) {\n                var g = E.geometry;\n                g && x.indexOf(g) === -1 && x.push(g);\n              });\n            }\n          return x;\n        }, O.prototype._getMeshes = function() {\n          var x = new Array();\n          x.push(this._rootBabylonMesh);\n          var m = this._gltf.nodes;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              this._forEachPrimitive(S, function(E) {\n                x.push(E);\n              });\n            }\n          return x;\n        }, O.prototype._getTransformNodes = function() {\n          var x = new Array(), m = this._gltf.nodes;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              S._babylonTransformNode && S._babylonTransformNode.getClassName() === \"TransformNode\" && x.push(S._babylonTransformNode);\n            }\n          return x;\n        }, O.prototype._getSkeletons = function() {\n          var x = new Array(), m = this._gltf.skins;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              S._data && x.push(S._data.babylonSkeleton);\n            }\n          return x;\n        }, O.prototype._getAnimationGroups = function() {\n          var x = new Array(), m = this._gltf.animations;\n          if (m)\n            for (var c = 0, T = m; c < T.length; c++) {\n              var S = T[c];\n              S._babylonAnimationGroup && x.push(S._babylonAnimationGroup);\n            }\n          return x;\n        }, O.prototype._startAnimations = function() {\n          switch (this._parent.animationStartMode) {\n            case C.GLTFLoaderAnimationStartMode.NONE:\n              break;\n            case C.GLTFLoaderAnimationStartMode.FIRST:\n              (x = this._getAnimationGroups()).length !== 0 && x[0].start(!0);\n              break;\n            case C.GLTFLoaderAnimationStartMode.ALL:\n              for (var x, m = 0, c = x = this._getAnimationGroups(); m < c.length; m++)\n                c[m].start(!0);\n              break;\n            default:\n              return void _.Logger.Error(\"Invalid animation start mode (\" + this._parent.animationStartMode + \")\");\n          }\n        }, O.prototype.loadNodeAsync = function(x, m, c) {\n          var T = this;\n          c === void 0 && (c = function() {\n          });\n          var S = this._extensionsLoadNodeAsync(x, m, c);\n          if (S)\n            return S;\n          if (m._babylonTransformNode)\n            throw new Error(x + \": Invalid recursive node hierarchy\");\n          var E = new Array();\n          this.logOpen(x + \" \" + (m.name || \"\"));\n          var g = function(v) {\n            if (O.AddPointerMetadata(v, x), O._LoadTransform(m, v), m.camera != null) {\n              var b = u.Get(x + \"/camera\", T._gltf.cameras, m.camera);\n              E.push(T.loadCameraAsync(\"/cameras/\" + b.index, b, function(U) {\n                U.parent = v;\n              }));\n            }\n            if (m.children)\n              for (var D = 0, w = m.children; D < w.length; D++) {\n                var N = w[D], M = u.Get(x + \"/children/\" + N, T._gltf.nodes, N);\n                E.push(T.loadNodeAsync(\"/nodes/\" + M.index, M, function(U) {\n                  U.parent = v;\n                }));\n              }\n            c(v);\n          };\n          if (m.mesh == null) {\n            var l = m.name || \"node\" + m.index;\n            this._babylonScene._blockEntityCollection = this._forAssetContainer, m._babylonTransformNode = new _.TransformNode(l, this._babylonScene), this._babylonScene._blockEntityCollection = !1, g(m._babylonTransformNode);\n          } else {\n            var h = u.Get(x + \"/mesh\", this._gltf.meshes, m.mesh);\n            E.push(this._loadMeshAsync(\"/meshes/\" + h.index, m, h, g));\n          }\n          return this.logClose(), Promise.all(E).then(function() {\n            return T._forEachPrimitive(m, function(v) {\n              v.geometry && v.geometry.useBoundingInfoFromGeometry ? v._updateBoundingInfo() : v.refreshBoundingInfo(!0);\n            }), m._babylonTransformNode;\n          });\n        }, O.prototype._loadMeshAsync = function(x, m, c, T) {\n          var S = c.primitives;\n          if (!S || !S.length)\n            throw new Error(x + \": Primitives are missing\");\n          S[0].index == null && u.Assign(S);\n          var E = new Array();\n          this.logOpen(x + \" \" + (c.name || \"\"));\n          var g = m.name || \"node\" + m.index;\n          if (S.length === 1) {\n            var l = c.primitives[0];\n            E.push(this._loadMeshPrimitiveAsync(x + \"/primitives/\" + l.index, g, m, c, l, function(D) {\n              m._babylonTransformNode = D, m._primitiveBabylonMeshes = [D];\n            }));\n          } else {\n            this._babylonScene._blockEntityCollection = this._forAssetContainer, m._babylonTransformNode = new _.TransformNode(g, this._babylonScene), this._babylonScene._blockEntityCollection = !1, m._primitiveBabylonMeshes = [];\n            for (var h = 0, v = S; h < v.length; h++)\n              l = v[h], E.push(this._loadMeshPrimitiveAsync(x + \"/primitives/\" + l.index, g + \"_primitive\" + l.index, m, c, l, function(D) {\n                D.parent = m._babylonTransformNode, m._primitiveBabylonMeshes.push(D);\n              }));\n          }\n          if (m.skin != null) {\n            var b = u.Get(x + \"/skin\", this._gltf.skins, m.skin);\n            E.push(this._loadSkinAsync(\"/skins/\" + b.index, m, b));\n          }\n          return T(m._babylonTransformNode), this.logClose(), Promise.all(E).then(function() {\n            return m._babylonTransformNode;\n          });\n        }, O.prototype._loadMeshPrimitiveAsync = function(x, m, c, T, S, E) {\n          var g = this, l = this._extensionsLoadMeshPrimitiveAsync(x, m, c, T, S, E);\n          if (l)\n            return l;\n          this.logOpen(\"\" + x);\n          var h, v, b = this._disableInstancedMesh === 0 && this._parent.createInstances && c.skin == null && !T.primitives[0].targets;\n          if (b && S._instanceData)\n            h = S._instanceData.babylonSourceMesh.createInstance(m), v = S._instanceData.promise;\n          else {\n            var D = new Array();\n            this._babylonScene._blockEntityCollection = this._forAssetContainer;\n            var w = new _.Mesh(m, this._babylonScene);\n            this._babylonScene._blockEntityCollection = !1, w.overrideMaterialSideOrientation = this._babylonScene.useRightHandedSystem ? _.Material.CounterClockWiseSideOrientation : _.Material.ClockWiseSideOrientation, this._createMorphTargets(x, c, T, S, w), D.push(this._loadVertexDataAsync(x, S, w).then(function(X) {\n              return g._loadMorphTargetsAsync(x, S, w, X).then(function() {\n                g._babylonScene._blockEntityCollection = g._forAssetContainer, X.applyToMesh(w), g._babylonScene._blockEntityCollection = !1;\n              });\n            }));\n            var N = O._GetDrawMode(x, S.mode);\n            if (S.material == null) {\n              var M = this._defaultBabylonMaterialData[N];\n              M || (M = this._createDefaultMaterial(\"__GLTFLoader._default\", N), this._parent.onMaterialLoadedObservable.notifyObservers(M), this._defaultBabylonMaterialData[N] = M), w.material = M;\n            } else {\n              var U = u.Get(x + \"/material\", this._gltf.materials, S.material);\n              D.push(this._loadMaterialAsync(\"/materials/\" + U.index, U, w, N, function(X) {\n                w.material = X;\n              }));\n            }\n            v = Promise.all(D), b && (S._instanceData = { babylonSourceMesh: w, promise: v }), h = w;\n          }\n          return O.AddPointerMetadata(h, x), this._parent.onMeshLoadedObservable.notifyObservers(h), E(h), this.logClose(), v.then(function() {\n            return h;\n          });\n        }, O.prototype._loadVertexDataAsync = function(x, m, c) {\n          var T = this, S = this._extensionsLoadVertexDataAsync(x, m, c);\n          if (S)\n            return S;\n          var E = m.attributes;\n          if (!E)\n            throw new Error(x + \": Attributes are missing\");\n          var g = new Array(), l = new _.Geometry(c.name, this._babylonScene);\n          if (m.indices == null)\n            c.isUnIndexed = !0;\n          else {\n            var h = u.Get(x + \"/indices\", this._gltf.accessors, m.indices);\n            g.push(this._loadIndicesAccessorAsync(\"/accessors/\" + h.index, h).then(function(b) {\n              l.setIndices(b);\n            }));\n          }\n          var v = function(b, D, w) {\n            if (E[b] != null) {\n              c._delayInfo = c._delayInfo || [], c._delayInfo.indexOf(D) === -1 && c._delayInfo.push(D);\n              var N = u.Get(x + \"/attributes/\" + b, T._gltf.accessors, E[b]);\n              g.push(T._loadVertexAccessorAsync(\"/accessors/\" + N.index, N, D).then(function(M) {\n                if (M.getKind() === _.VertexBuffer.PositionKind && !T.parent.alwaysComputeBoundingBox && !c.skeleton) {\n                  var U = N.min, X = N.max;\n                  if (U !== void 0 && X !== void 0) {\n                    var j = _.TmpVectors.Vector3[0], ne = _.TmpVectors.Vector3[1];\n                    j.copyFromFloats.apply(j, U), ne.copyFromFloats.apply(ne, X), l._boundingInfo = new _.BoundingInfo(j, ne), l.useBoundingInfoFromGeometry = !0;\n                  }\n                }\n                l.setVerticesBuffer(M, N.count);\n              })), D == _.VertexBuffer.MatricesIndicesExtraKind && (c.numBoneInfluencers = 8), w && w(N);\n            }\n          };\n          return v(\"POSITION\", _.VertexBuffer.PositionKind), v(\"NORMAL\", _.VertexBuffer.NormalKind), v(\"TANGENT\", _.VertexBuffer.TangentKind), v(\"TEXCOORD_0\", _.VertexBuffer.UVKind), v(\"TEXCOORD_1\", _.VertexBuffer.UV2Kind), v(\"JOINTS_0\", _.VertexBuffer.MatricesIndicesKind), v(\"WEIGHTS_0\", _.VertexBuffer.MatricesWeightsKind), v(\"JOINTS_1\", _.VertexBuffer.MatricesIndicesExtraKind), v(\"WEIGHTS_1\", _.VertexBuffer.MatricesWeightsExtraKind), v(\"COLOR_0\", _.VertexBuffer.ColorKind, function(b) {\n            b.type === \"VEC4\" && (c.hasVertexAlpha = !0);\n          }), Promise.all(g).then(function() {\n            return l;\n          });\n        }, O.prototype._createMorphTargets = function(x, m, c, T, S) {\n          if (T.targets) {\n            if (m._numMorphTargets == null)\n              m._numMorphTargets = T.targets.length;\n            else if (T.targets.length !== m._numMorphTargets)\n              throw new Error(x + \": Primitives do not have the same number of targets\");\n            var E = c.extras ? c.extras.targetNames : null;\n            S.morphTargetManager = new _.MorphTargetManager(S.getScene());\n            for (var g = 0; g < T.targets.length; g++) {\n              var l = m.weights ? m.weights[g] : c.weights ? c.weights[g] : 0, h = E ? E[g] : \"morphTarget\" + g;\n              S.morphTargetManager.addTarget(new _.MorphTarget(h, l, S.getScene()));\n            }\n          }\n        }, O.prototype._loadMorphTargetsAsync = function(x, m, c, T) {\n          if (!m.targets)\n            return Promise.resolve();\n          for (var S = new Array(), E = c.morphTargetManager, g = 0; g < E.numTargets; g++) {\n            var l = E.getTarget(g);\n            S.push(this._loadMorphTargetVertexDataAsync(x + \"/targets/\" + g, T, m.targets[g], l));\n          }\n          return Promise.all(S).then(function() {\n          });\n        }, O.prototype._loadMorphTargetVertexDataAsync = function(x, m, c, T) {\n          var S = this, E = new Array(), g = function(l, h, v) {\n            if (c[l] != null) {\n              var b = m.getVertexBuffer(h);\n              if (b) {\n                var D = u.Get(x + \"/\" + l, S._gltf.accessors, c[l]);\n                E.push(S._loadFloatAccessorAsync(\"/accessors/\" + D.index, D).then(function(w) {\n                  v(b, w);\n                }));\n              }\n            }\n          };\n          return g(\"POSITION\", _.VertexBuffer.PositionKind, function(l, h) {\n            var v = new Float32Array(h.length);\n            l.forEach(h.length, function(b, D) {\n              v[D] = h[D] + b;\n            }), T.setPositions(v);\n          }), g(\"NORMAL\", _.VertexBuffer.NormalKind, function(l, h) {\n            var v = new Float32Array(h.length);\n            l.forEach(v.length, function(b, D) {\n              v[D] = h[D] + b;\n            }), T.setNormals(v);\n          }), g(\"TANGENT\", _.VertexBuffer.TangentKind, function(l, h) {\n            var v = new Float32Array(h.length / 3 * 4), b = 0;\n            l.forEach(h.length / 3 * 4, function(D, w) {\n              (w + 1) % 4 != 0 && (v[b] = h[b] + D, b++);\n            }), T.setTangents(v);\n          }), Promise.all(E).then(function() {\n          });\n        }, O._LoadTransform = function(x, m) {\n          if (x.skin == null) {\n            var c = _.Vector3.Zero(), T = _.Quaternion.Identity(), S = _.Vector3.One();\n            x.matrix ? _.Matrix.FromArray(x.matrix).decompose(S, T, c) : (x.translation && (c = _.Vector3.FromArray(x.translation)), x.rotation && (T = _.Quaternion.FromArray(x.rotation)), x.scale && (S = _.Vector3.FromArray(x.scale))), m.position = c, m.rotationQuaternion = T, m.scaling = S;\n          }\n        }, O.prototype._loadSkinAsync = function(x, m, c) {\n          var T = this, S = this._extensionsLoadSkinAsync(x, m, c);\n          if (S)\n            return S;\n          var E = function(v) {\n            T._forEachPrimitive(m, function(b) {\n              b.skeleton = v;\n            });\n          };\n          if (c._data)\n            return E(c._data.babylonSkeleton), c._data.promise;\n          var g = \"skeleton\" + c.index;\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var l = new _.Skeleton(c.name || g, g, this._babylonScene);\n          this._babylonScene._blockEntityCollection = !1, l.overrideMesh = this._rootBabylonMesh, this._loadBones(x, c, l), E(l);\n          var h = this._loadSkinInverseBindMatricesDataAsync(x, c).then(function(v) {\n            T._updateBoneMatrices(l, v);\n          });\n          return c._data = { babylonSkeleton: l, promise: h }, h;\n        }, O.prototype._loadBones = function(x, m, c) {\n          for (var T = {}, S = 0, E = m.joints; S < E.length; S++) {\n            var g = E[S], l = u.Get(x + \"/joints/\" + g, this._gltf.nodes, g);\n            this._loadBone(l, m, c, T);\n          }\n        }, O.prototype._loadBone = function(x, m, c, T) {\n          var S = T[x.index];\n          if (S)\n            return S;\n          var E = null;\n          x.parent && x.parent._babylonTransformNode !== this._rootBabylonMesh && (E = this._loadBone(x.parent, m, c, T));\n          var g = m.joints.indexOf(x.index);\n          return S = new _.Bone(x.name || \"joint\" + x.index, c, E, this._getNodeMatrix(x), null, null, g), T[x.index] = S, x._babylonBones = x._babylonBones || [], x._babylonBones.push(S), S;\n        }, O.prototype._loadSkinInverseBindMatricesDataAsync = function(x, m) {\n          if (m.inverseBindMatrices == null)\n            return Promise.resolve(null);\n          var c = u.Get(x + \"/inverseBindMatrices\", this._gltf.accessors, m.inverseBindMatrices);\n          return this._loadFloatAccessorAsync(\"/accessors/\" + c.index, c);\n        }, O.prototype._updateBoneMatrices = function(x, m) {\n          for (var c = 0, T = x.bones; c < T.length; c++) {\n            var S = T[c], E = _.Matrix.Identity(), g = S._index;\n            m && g !== -1 && (_.Matrix.FromArrayToRef(m, 16 * g, E), E.invertToRef(E));\n            var l = S.getParent();\n            l && E.multiplyToRef(l.getInvertedAbsoluteTransform(), E), S.setBindPose(E), S.updateMatrix(E, !1, !1), S._updateDifferenceMatrix(void 0, !1);\n          }\n        }, O.prototype._getNodeMatrix = function(x) {\n          return x.matrix ? _.Matrix.FromArray(x.matrix) : _.Matrix.Compose(x.scale ? _.Vector3.FromArray(x.scale) : _.Vector3.One(), x.rotation ? _.Quaternion.FromArray(x.rotation) : _.Quaternion.Identity(), x.translation ? _.Vector3.FromArray(x.translation) : _.Vector3.Zero());\n        }, O.prototype.loadCameraAsync = function(x, m, c) {\n          c === void 0 && (c = function() {\n          });\n          var T = this._extensionsLoadCameraAsync(x, m, c);\n          if (T)\n            return T;\n          var S = new Array();\n          this.logOpen(x + \" \" + (m.name || \"\")), this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var E = new _.FreeCamera(m.name || \"camera\" + m.index, _.Vector3.Zero(), this._babylonScene, !1);\n          switch (this._babylonScene._blockEntityCollection = !1, E.ignoreParentScaling = !0, E.rotation = new _.Vector3(0, Math.PI, 0), m.type) {\n            case \"perspective\":\n              var g = m.perspective;\n              if (!g)\n                throw new Error(x + \": Camera perspective properties are missing\");\n              E.fov = g.yfov, E.minZ = g.znear, E.maxZ = g.zfar || Number.MAX_VALUE;\n              break;\n            case \"orthographic\":\n              if (!m.orthographic)\n                throw new Error(x + \": Camera orthographic properties are missing\");\n              E.mode = _.Camera.ORTHOGRAPHIC_CAMERA, E.orthoLeft = -m.orthographic.xmag, E.orthoRight = m.orthographic.xmag, E.orthoBottom = -m.orthographic.ymag, E.orthoTop = m.orthographic.ymag, E.minZ = m.orthographic.znear, E.maxZ = m.orthographic.zfar;\n              break;\n            default:\n              throw new Error(x + \": Invalid camera type (\" + m.type + \")\");\n          }\n          return O.AddPointerMetadata(E, x), this._parent.onCameraLoadedObservable.notifyObservers(E), c(E), this.logClose(), Promise.all(S).then(function() {\n            return E;\n          });\n        }, O.prototype._loadAnimationsAsync = function() {\n          var x = this._gltf.animations;\n          if (!x)\n            return Promise.resolve();\n          for (var m = new Array(), c = 0; c < x.length; c++) {\n            var T = x[c];\n            m.push(this.loadAnimationAsync(\"/animations/\" + T.index, T));\n          }\n          return Promise.all(m).then(function() {\n          });\n        }, O.prototype.loadAnimationAsync = function(x, m) {\n          var c = this._extensionsLoadAnimationAsync(x, m);\n          if (c)\n            return c;\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var T = new _.AnimationGroup(m.name || \"animation\" + m.index, this._babylonScene);\n          this._babylonScene._blockEntityCollection = !1, m._babylonAnimationGroup = T;\n          var S = new Array();\n          u.Assign(m.channels), u.Assign(m.samplers);\n          for (var E = 0, g = m.channels; E < g.length; E++) {\n            var l = g[E];\n            S.push(this._loadAnimationChannelAsync(x + \"/channels/\" + l.index, x, m, l, T));\n          }\n          return Promise.all(S).then(function() {\n            return T.normalize(0), T;\n          });\n        }, O.prototype._loadAnimationChannelAsync = function(x, m, c, T, S, E) {\n          var g = this;\n          if (E === void 0 && (E = null), T.target.node == null)\n            return Promise.resolve();\n          var l = u.Get(x + \"/target/node\", this._gltf.nodes, T.target.node);\n          if (T.target.path === \"weights\" && !l._numMorphTargets || T.target.path !== \"weights\" && !l._babylonTransformNode)\n            return Promise.resolve();\n          var h = u.Get(x + \"/sampler\", c.samplers, T.sampler);\n          return this._loadAnimationSamplerAsync(m + \"/samplers/\" + T.sampler, h).then(function(v) {\n            var b, D;\n            switch (T.target.path) {\n              case \"translation\":\n                b = \"position\", D = _.Animation.ANIMATIONTYPE_VECTOR3;\n                break;\n              case \"rotation\":\n                b = \"rotationQuaternion\", D = _.Animation.ANIMATIONTYPE_QUATERNION;\n                break;\n              case \"scale\":\n                b = \"scaling\", D = _.Animation.ANIMATIONTYPE_VECTOR3;\n                break;\n              case \"weights\":\n                b = \"influence\", D = _.Animation.ANIMATIONTYPE_FLOAT;\n                break;\n              default:\n                throw new Error(x + \"/target/path: Invalid value (\" + T.target.path + \")\");\n            }\n            var w, N, M = 0;\n            switch (b) {\n              case \"position\":\n                w = function() {\n                  var pe = _.Vector3.FromArray(v.output, M);\n                  return M += 3, pe;\n                };\n                break;\n              case \"rotationQuaternion\":\n                w = function() {\n                  var pe = _.Quaternion.FromArray(v.output, M);\n                  return M += 4, pe;\n                };\n                break;\n              case \"scaling\":\n                w = function() {\n                  var pe = _.Vector3.FromArray(v.output, M);\n                  return M += 3, pe;\n                };\n                break;\n              case \"influence\":\n                w = function() {\n                  for (var pe = new Array(l._numMorphTargets), ae = 0; ae < l._numMorphTargets; ae++)\n                    pe[ae] = v.output[M++];\n                  return pe;\n                };\n            }\n            switch (v.interpolation) {\n              case \"STEP\":\n                N = function(pe) {\n                  return { frame: v.input[pe], value: w(), interpolation: _.AnimationKeyInterpolation.STEP };\n                };\n                break;\n              case \"LINEAR\":\n                N = function(pe) {\n                  return { frame: v.input[pe], value: w() };\n                };\n                break;\n              case \"CUBICSPLINE\":\n                N = function(pe) {\n                  return { frame: v.input[pe], inTangent: w(), value: w(), outTangent: w() };\n                };\n            }\n            for (var U = new Array(v.input.length), X = 0; X < v.input.length; X++)\n              U[X] = N(X);\n            if (b === \"influence\")\n              for (var j = function(pe) {\n                var ae = S.name + \"_channel\" + S.targetedAnimations.length, ee = new _.Animation(ae, b, 1, D);\n                ee.setKeys(U.map(function(K) {\n                  return { frame: K.frame, inTangent: K.inTangent ? K.inTangent[pe] : void 0, value: K.value[pe], outTangent: K.outTangent ? K.outTangent[pe] : void 0 };\n                })), g._forEachPrimitive(l, function(K) {\n                  var $ = K.morphTargetManager.getTarget(pe), L = ee.clone();\n                  $.animations.push(L), S.addTargetedAnimation(L, $);\n                });\n              }, ne = 0; ne < l._numMorphTargets; ne++)\n                j(ne);\n            else {\n              var te = S.name + \"_channel\" + S.targetedAnimations.length, de = new _.Animation(te, b, 1, D);\n              de.setKeys(U), E != null && E.animations != null ? (E.animations.push(de), S.addTargetedAnimation(de, E)) : (l._babylonTransformNode.animations.push(de), S.addTargetedAnimation(de, l._babylonTransformNode));\n            }\n          });\n        }, O.prototype._loadAnimationSamplerAsync = function(x, m) {\n          if (m._data)\n            return m._data;\n          var c = m.interpolation || \"LINEAR\";\n          switch (c) {\n            case \"STEP\":\n            case \"LINEAR\":\n            case \"CUBICSPLINE\":\n              break;\n            default:\n              throw new Error(x + \"/interpolation: Invalid value (\" + m.interpolation + \")\");\n          }\n          var T = u.Get(x + \"/input\", this._gltf.accessors, m.input), S = u.Get(x + \"/output\", this._gltf.accessors, m.output);\n          return m._data = Promise.all([this._loadFloatAccessorAsync(\"/accessors/\" + T.index, T), this._loadFloatAccessorAsync(\"/accessors/\" + S.index, S)]).then(function(E) {\n            var g = E[0], l = E[1];\n            return { input: g, interpolation: c, output: l };\n          }), m._data;\n        }, O.prototype._loadBufferAsync = function(x, m, c, T) {\n          var S = this._extensionsLoadBufferAsync(x, m, c, T);\n          if (S)\n            return S;\n          if (!m._data)\n            if (m.uri)\n              m._data = this.loadUriAsync(x + \"/uri\", m, m.uri);\n            else {\n              if (!this._bin)\n                throw new Error(x + \": Uri is missing or the binary glTF is missing its binary chunk\");\n              m._data = this._bin.readAsync(0, m.byteLength);\n            }\n          return m._data.then(function(E) {\n            try {\n              return new Uint8Array(E.buffer, E.byteOffset + c, T);\n            } catch (g) {\n              throw new Error(x + \": \" + g.message);\n            }\n          });\n        }, O.prototype.loadBufferViewAsync = function(x, m) {\n          var c = this._extensionsLoadBufferViewAsync(x, m);\n          if (c)\n            return c;\n          if (m._data)\n            return m._data;\n          var T = u.Get(x + \"/buffer\", this._gltf.buffers, m.buffer);\n          return m._data = this._loadBufferAsync(\"/buffers/\" + T.index, T, m.byteOffset || 0, m.byteLength), m._data;\n        }, O.prototype._loadAccessorAsync = function(x, m, c) {\n          var T = this;\n          if (m._data)\n            return m._data;\n          var S = O._GetNumComponents(x, m.type), E = S * _.VertexBuffer.GetTypeByteLength(m.componentType), g = S * m.count;\n          if (m.bufferView == null)\n            m._data = Promise.resolve(new c(g));\n          else {\n            var l = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n            m._data = this.loadBufferViewAsync(\"/bufferViews/\" + l.index, l).then(function(v) {\n              if (m.componentType !== 5126 || m.normalized || l.byteStride && l.byteStride !== E) {\n                var b = new c(g);\n                return _.VertexBuffer.ForEach(v, m.byteOffset || 0, l.byteStride || E, S, m.componentType, b.length, m.normalized || !1, function(D, w) {\n                  b[w] = D;\n                }), b;\n              }\n              return O._GetTypedArray(x, m.componentType, v, m.byteOffset, g);\n            });\n          }\n          if (m.sparse) {\n            var h = m.sparse;\n            m._data = m._data.then(function(v) {\n              var b = v, D = u.Get(x + \"/sparse/indices/bufferView\", T._gltf.bufferViews, h.indices.bufferView), w = u.Get(x + \"/sparse/values/bufferView\", T._gltf.bufferViews, h.values.bufferView);\n              return Promise.all([T.loadBufferViewAsync(\"/bufferViews/\" + D.index, D), T.loadBufferViewAsync(\"/bufferViews/\" + w.index, w)]).then(function(N) {\n                var M, U = N[0], X = N[1], j = O._GetTypedArray(x + \"/sparse/indices\", h.indices.componentType, U, h.indices.byteOffset, h.count), ne = S * h.count;\n                if (m.componentType !== 5126 || m.normalized) {\n                  var te = O._GetTypedArray(x + \"/sparse/values\", m.componentType, X, h.values.byteOffset, ne);\n                  M = new c(ne), _.VertexBuffer.ForEach(te, 0, E, S, m.componentType, M.length, m.normalized || !1, function(K, $) {\n                    M[$] = K;\n                  });\n                } else\n                  M = O._GetTypedArray(x + \"/sparse/values\", m.componentType, X, h.values.byteOffset, ne);\n                for (var de = 0, pe = 0; pe < j.length; pe++)\n                  for (var ae = j[pe] * S, ee = 0; ee < S; ee++)\n                    b[ae++] = M[de++];\n                return b;\n              });\n            });\n          }\n          return m._data;\n        }, O.prototype._loadFloatAccessorAsync = function(x, m) {\n          return this._loadAccessorAsync(x, m, Float32Array);\n        }, O.prototype._loadIndicesAccessorAsync = function(x, m) {\n          if (m.type !== \"SCALAR\")\n            throw new Error(x + \"/type: Invalid value \" + m.type);\n          if (m.componentType !== 5121 && m.componentType !== 5123 && m.componentType !== 5125)\n            throw new Error(x + \"/componentType: Invalid value \" + m.componentType);\n          if (m._data)\n            return m._data;\n          if (m.sparse) {\n            var c = O._GetTypedArrayConstructor(x + \"/componentType\", m.componentType);\n            m._data = this._loadAccessorAsync(x, m, c);\n          } else {\n            var T = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n            m._data = this.loadBufferViewAsync(\"/bufferViews/\" + T.index, T).then(function(S) {\n              return O._GetTypedArray(x, m.componentType, S, m.byteOffset, m.count);\n            });\n          }\n          return m._data;\n        }, O.prototype._loadVertexBufferViewAsync = function(x, m) {\n          var c = this;\n          return x._babylonBuffer || (x._babylonBuffer = this.loadBufferViewAsync(\"/bufferViews/\" + x.index, x).then(function(T) {\n            return new _.Buffer(c._babylonScene.getEngine(), T, !1);\n          })), x._babylonBuffer;\n        }, O.prototype._loadVertexAccessorAsync = function(x, m, c) {\n          var T = this;\n          if (m._babylonVertexBuffer)\n            return m._babylonVertexBuffer;\n          if (m.sparse)\n            m._babylonVertexBuffer = this._loadFloatAccessorAsync(\"/accessors/\" + m.index, m).then(function(E) {\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1);\n            });\n          else if (m.byteOffset && m.byteOffset % _.VertexBuffer.GetTypeByteLength(m.componentType) != 0)\n            _.Logger.Warn(\"Accessor byte offset is not a multiple of component type byte length\"), m._babylonVertexBuffer = this._loadFloatAccessorAsync(\"/accessors/\" + m.index, m).then(function(E) {\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1);\n            });\n          else if (c === _.VertexBuffer.MatricesIndicesKind || c === _.VertexBuffer.MatricesIndicesExtraKind)\n            m._babylonVertexBuffer = this._loadFloatAccessorAsync(\"/accessors/\" + m.index, m).then(function(E) {\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1);\n            });\n          else {\n            var S = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n            m._babylonVertexBuffer = this._loadVertexBufferViewAsync(S, c).then(function(E) {\n              var g = O._GetNumComponents(x, m.type);\n              return new _.VertexBuffer(T._babylonScene.getEngine(), E, c, !1, !1, S.byteStride, !1, m.byteOffset, g, m.componentType, m.normalized, !0, 1, !0);\n            });\n          }\n          return m._babylonVertexBuffer;\n        }, O.prototype._loadMaterialMetallicRoughnessPropertiesAsync = function(x, m, c) {\n          if (!(c instanceof _.PBRMaterial))\n            throw new Error(x + \": Material type not supported\");\n          var T = new Array();\n          return m && (m.baseColorFactor ? (c.albedoColor = _.Color3.FromArray(m.baseColorFactor), c.alpha = m.baseColorFactor[3]) : c.albedoColor = _.Color3.White(), c.metallic = m.metallicFactor == null ? 1 : m.metallicFactor, c.roughness = m.roughnessFactor == null ? 1 : m.roughnessFactor, m.baseColorTexture && T.push(this.loadTextureInfoAsync(x + \"/baseColorTexture\", m.baseColorTexture, function(S) {\n            S.name = c.name + \" (Base Color)\", c.albedoTexture = S;\n          })), m.metallicRoughnessTexture && (m.metallicRoughnessTexture.nonColorData = !0, T.push(this.loadTextureInfoAsync(x + \"/metallicRoughnessTexture\", m.metallicRoughnessTexture, function(S) {\n            S.name = c.name + \" (Metallic Roughness)\", c.metallicTexture = S;\n          })), c.useMetallnessFromMetallicTextureBlue = !0, c.useRoughnessFromMetallicTextureGreen = !0, c.useRoughnessFromMetallicTextureAlpha = !1)), Promise.all(T).then(function() {\n          });\n        }, O.prototype._loadMaterialAsync = function(x, m, c, T, S) {\n          S === void 0 && (S = function() {\n          });\n          var E = this._extensionsLoadMaterialAsync(x, m, c, T, S);\n          if (E)\n            return E;\n          m._data = m._data || {};\n          var g = m._data[T];\n          if (!g) {\n            this.logOpen(x + \" \" + (m.name || \"\"));\n            var l = this.createMaterial(x, m, T);\n            g = { babylonMaterial: l, babylonMeshes: [], promise: this.loadMaterialPropertiesAsync(x, m, l) }, m._data[T] = g, O.AddPointerMetadata(l, x), this._parent.onMaterialLoadedObservable.notifyObservers(l), this.logClose();\n          }\n          return c && (g.babylonMeshes.push(c), c.onDisposeObservable.addOnce(function() {\n            var h = g.babylonMeshes.indexOf(c);\n            h !== -1 && g.babylonMeshes.splice(h, 1);\n          })), S(g.babylonMaterial), g.promise.then(function() {\n            return g.babylonMaterial;\n          });\n        }, O.prototype._createDefaultMaterial = function(x, m) {\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var c = new _.PBRMaterial(x, this._babylonScene);\n          return this._babylonScene._blockEntityCollection = !1, c.fillMode = m, c.enableSpecularAntiAliasing = !0, c.useRadianceOverAlpha = !this._parent.transparencyAsCoverage, c.useSpecularOverAlpha = !this._parent.transparencyAsCoverage, c.transparencyMode = _.PBRMaterial.PBRMATERIAL_OPAQUE, c.metallic = 1, c.roughness = 1, c;\n        }, O.prototype.createMaterial = function(x, m, c) {\n          var T = this._extensionsCreateMaterial(x, m, c);\n          if (T)\n            return T;\n          var S = m.name || \"material\" + m.index;\n          return this._createDefaultMaterial(S, c);\n        }, O.prototype.loadMaterialPropertiesAsync = function(x, m, c) {\n          var T = this._extensionsLoadMaterialPropertiesAsync(x, m, c);\n          if (T)\n            return T;\n          var S = new Array();\n          return S.push(this.loadMaterialBasePropertiesAsync(x, m, c)), m.pbrMetallicRoughness && S.push(this._loadMaterialMetallicRoughnessPropertiesAsync(x + \"/pbrMetallicRoughness\", m.pbrMetallicRoughness, c)), this.loadMaterialAlphaProperties(x, m, c), Promise.all(S).then(function() {\n          });\n        }, O.prototype.loadMaterialBasePropertiesAsync = function(x, m, c) {\n          if (!(c instanceof _.PBRMaterial))\n            throw new Error(x + \": Material type not supported\");\n          var T = new Array();\n          return c.emissiveColor = m.emissiveFactor ? _.Color3.FromArray(m.emissiveFactor) : new _.Color3(0, 0, 0), m.doubleSided && (c.backFaceCulling = !1, c.twoSidedLighting = !0), m.normalTexture && (m.normalTexture.nonColorData = !0, T.push(this.loadTextureInfoAsync(x + \"/normalTexture\", m.normalTexture, function(S) {\n            S.name = c.name + \" (Normal)\", c.bumpTexture = S;\n          })), c.invertNormalMapX = !this._babylonScene.useRightHandedSystem, c.invertNormalMapY = this._babylonScene.useRightHandedSystem, m.normalTexture.scale != null && (c.bumpTexture.level = m.normalTexture.scale), c.forceIrradianceInFragment = !0), m.occlusionTexture && (m.occlusionTexture.nonColorData = !0, T.push(this.loadTextureInfoAsync(x + \"/occlusionTexture\", m.occlusionTexture, function(S) {\n            S.name = c.name + \" (Occlusion)\", c.ambientTexture = S;\n          })), c.useAmbientInGrayScale = !0, m.occlusionTexture.strength != null && (c.ambientTextureStrength = m.occlusionTexture.strength)), m.emissiveTexture && T.push(this.loadTextureInfoAsync(x + \"/emissiveTexture\", m.emissiveTexture, function(S) {\n            S.name = c.name + \" (Emissive)\", c.emissiveTexture = S;\n          })), Promise.all(T).then(function() {\n          });\n        }, O.prototype.loadMaterialAlphaProperties = function(x, m, c) {\n          if (!(c instanceof _.PBRMaterial))\n            throw new Error(x + \": Material type not supported\");\n          switch (m.alphaMode || \"OPAQUE\") {\n            case \"OPAQUE\":\n              c.transparencyMode = _.PBRMaterial.PBRMATERIAL_OPAQUE;\n              break;\n            case \"MASK\":\n              c.transparencyMode = _.PBRMaterial.PBRMATERIAL_ALPHATEST, c.alphaCutOff = m.alphaCutoff == null ? 0.5 : m.alphaCutoff, c.albedoTexture && (c.albedoTexture.hasAlpha = !0);\n              break;\n            case \"BLEND\":\n              c.transparencyMode = _.PBRMaterial.PBRMATERIAL_ALPHABLEND, c.albedoTexture && (c.albedoTexture.hasAlpha = !0, c.useAlphaFromAlbedoTexture = !0);\n              break;\n            default:\n              throw new Error(x + \"/alphaMode: Invalid value (\" + m.alphaMode + \")\");\n          }\n        }, O.prototype.loadTextureInfoAsync = function(x, m, c) {\n          var T = this;\n          c === void 0 && (c = function() {\n          });\n          var S = this._extensionsLoadTextureInfoAsync(x, m, c);\n          if (S)\n            return S;\n          if (this.logOpen(\"\" + x), m.texCoord >= 2)\n            throw new Error(x + \"/texCoord: Invalid value (\" + m.texCoord + \")\");\n          var E = u.Get(x + \"/index\", this._gltf.textures, m.index);\n          E._textureInfo = m;\n          var g = this._loadTextureAsync(\"/textures/\" + m.index, E, function(l) {\n            l.coordinatesIndex = m.texCoord || 0, O.AddPointerMetadata(l, x), T._parent.onTextureLoadedObservable.notifyObservers(l), c(l);\n          });\n          return this.logClose(), g;\n        }, O.prototype._loadTextureAsync = function(x, m, c) {\n          c === void 0 && (c = function() {\n          });\n          var T = this._extensionsLoadTextureAsync(x, m, c);\n          if (T)\n            return T;\n          this.logOpen(x + \" \" + (m.name || \"\"));\n          var S = m.sampler == null ? O.DefaultSampler : u.Get(x + \"/sampler\", this._gltf.samplers, m.sampler), E = u.Get(x + \"/source\", this._gltf.images, m.source), g = this._createTextureAsync(x, S, E, c);\n          return this.logClose(), g;\n        }, O.prototype._createTextureAsync = function(x, m, c, T, S) {\n          var E = this;\n          T === void 0 && (T = function() {\n          });\n          var g = this._loadSampler(\"/samplers/\" + m.index, m), l = new Array(), h = new _.Deferred();\n          this._babylonScene._blockEntityCollection = this._forAssetContainer;\n          var v = new _.Texture(null, this._babylonScene, g.noMipMaps, !1, g.samplingMode, function() {\n            E._disposed || h.resolve();\n          }, function(b, D) {\n            E._disposed || h.reject(new Error(x + \": \" + (D && D.message ? D.message : b || \"Failed to load texture\")));\n          }, void 0, void 0, void 0, c.mimeType, S);\n          return this._babylonScene._blockEntityCollection = !1, l.push(h.promise), l.push(this.loadImageAsync(\"/images/\" + c.index, c).then(function(b) {\n            var D = c.uri || E._fileName + \"#image\" + c.index, w = \"data:\" + E._uniqueRootUrl + D;\n            v.updateURL(w, b);\n          })), v.wrapU = g.wrapU, v.wrapV = g.wrapV, T(v), Promise.all(l).then(function() {\n            return v;\n          });\n        }, O.prototype._loadSampler = function(x, m) {\n          return m._data || (m._data = { noMipMaps: m.minFilter === 9728 || m.minFilter === 9729, samplingMode: O._GetTextureSamplingMode(x, m), wrapU: O._GetTextureWrapMode(x + \"/wrapS\", m.wrapS), wrapV: O._GetTextureWrapMode(x + \"/wrapT\", m.wrapT) }), m._data;\n        }, O.prototype.loadImageAsync = function(x, m) {\n          if (!m._data) {\n            if (this.logOpen(x + \" \" + (m.name || \"\")), m.uri)\n              m._data = this.loadUriAsync(x + \"/uri\", m, m.uri);\n            else {\n              var c = u.Get(x + \"/bufferView\", this._gltf.bufferViews, m.bufferView);\n              m._data = this.loadBufferViewAsync(\"/bufferViews/\" + c.index, c);\n            }\n            this.logClose();\n          }\n          return m._data;\n        }, O.prototype.loadUriAsync = function(x, m, c) {\n          var T = this, S = this._extensionsLoadUriAsync(x, m, c);\n          if (S)\n            return S;\n          if (!O._ValidateUri(c))\n            throw new Error(x + \": '\" + c + \"' is invalid\");\n          if (_.Tools.IsBase64(c)) {\n            var E = new Uint8Array(_.Tools.DecodeBase64(c));\n            return this.log(\"Decoded \" + c.substr(0, 64) + \"... (\" + E.length + \" bytes)\"), Promise.resolve(E);\n          }\n          return this.log(\"Loading \" + c), this._parent.preprocessUrlAsync(this._rootUrl + c).then(function(g) {\n            return new Promise(function(l, h) {\n              T._parent._loadFile(g, T._babylonScene, function(v) {\n                T._disposed || (T.log(\"Loaded \" + c + \" (\" + v.byteLength + \" bytes)\"), l(new Uint8Array(v)));\n              }, !0, function(v) {\n                h(new _.LoadFileError(x + \": Failed to load '\" + c + \"'\" + (v ? \": \" + v.status + \" \" + v.statusText : \"\"), v));\n              });\n            });\n          });\n        }, O.AddPointerMetadata = function(x, m) {\n          var c = x.metadata = x.metadata || {}, T = c.gltf = c.gltf || {};\n          (T.pointers = T.pointers || []).push(m);\n        }, O._GetTextureWrapMode = function(x, m) {\n          switch (m = m ?? 10497) {\n            case 33071:\n              return _.Texture.CLAMP_ADDRESSMODE;\n            case 33648:\n              return _.Texture.MIRROR_ADDRESSMODE;\n            case 10497:\n              return _.Texture.WRAP_ADDRESSMODE;\n            default:\n              return _.Logger.Warn(x + \": Invalid value (\" + m + \")\"), _.Texture.WRAP_ADDRESSMODE;\n          }\n        }, O._GetTextureSamplingMode = function(x, m) {\n          var c = m.magFilter == null ? 9729 : m.magFilter, T = m.minFilter == null ? 9987 : m.minFilter;\n          if (c === 9729)\n            switch (T) {\n              case 9728:\n                return _.Texture.LINEAR_NEAREST;\n              case 9729:\n                return _.Texture.LINEAR_LINEAR;\n              case 9984:\n                return _.Texture.LINEAR_NEAREST_MIPNEAREST;\n              case 9985:\n                return _.Texture.LINEAR_LINEAR_MIPNEAREST;\n              case 9986:\n                return _.Texture.LINEAR_NEAREST_MIPLINEAR;\n              case 9987:\n                return _.Texture.LINEAR_LINEAR_MIPLINEAR;\n              default:\n                return _.Logger.Warn(x + \"/minFilter: Invalid value (\" + T + \")\"), _.Texture.LINEAR_LINEAR_MIPLINEAR;\n            }\n          else\n            switch (c !== 9728 && _.Logger.Warn(x + \"/magFilter: Invalid value (\" + c + \")\"), T) {\n              case 9728:\n                return _.Texture.NEAREST_NEAREST;\n              case 9729:\n                return _.Texture.NEAREST_LINEAR;\n              case 9984:\n                return _.Texture.NEAREST_NEAREST_MIPNEAREST;\n              case 9985:\n                return _.Texture.NEAREST_LINEAR_MIPNEAREST;\n              case 9986:\n                return _.Texture.NEAREST_NEAREST_MIPLINEAR;\n              case 9987:\n                return _.Texture.NEAREST_LINEAR_MIPLINEAR;\n              default:\n                return _.Logger.Warn(x + \"/minFilter: Invalid value (\" + T + \")\"), _.Texture.NEAREST_NEAREST_MIPNEAREST;\n            }\n        }, O._GetTypedArrayConstructor = function(x, m) {\n          switch (m) {\n            case 5120:\n              return Int8Array;\n            case 5121:\n              return Uint8Array;\n            case 5122:\n              return Int16Array;\n            case 5123:\n              return Uint16Array;\n            case 5125:\n              return Uint32Array;\n            case 5126:\n              return Float32Array;\n            default:\n              throw new Error(x + \": Invalid component type \" + m);\n          }\n        }, O._GetTypedArray = function(x, m, c, T, S) {\n          var E = c.buffer;\n          T = c.byteOffset + (T || 0);\n          var g = O._GetTypedArrayConstructor(x + \"/componentType\", m);\n          try {\n            return new g(E, T, S);\n          } catch (l) {\n            throw new Error(x + \": \" + l);\n          }\n        }, O._GetNumComponents = function(x, m) {\n          switch (m) {\n            case \"SCALAR\":\n              return 1;\n            case \"VEC2\":\n              return 2;\n            case \"VEC3\":\n              return 3;\n            case \"VEC4\":\n            case \"MAT2\":\n              return 4;\n            case \"MAT3\":\n              return 9;\n            case \"MAT4\":\n              return 16;\n          }\n          throw new Error(x + \": Invalid type (\" + m + \")\");\n        }, O._ValidateUri = function(x) {\n          return _.Tools.IsBase64(x) || x.indexOf(\"..\") === -1;\n        }, O._GetDrawMode = function(x, m) {\n          switch (m == null && (m = 4), m) {\n            case 0:\n              return _.Material.PointListDrawMode;\n            case 1:\n              return _.Material.LineListDrawMode;\n            case 2:\n              return _.Material.LineLoopDrawMode;\n            case 3:\n              return _.Material.LineStripDrawMode;\n            case 4:\n              return _.Material.TriangleFillMode;\n            case 5:\n              return _.Material.TriangleStripDrawMode;\n            case 6:\n              return _.Material.TriangleFanDrawMode;\n          }\n          throw new Error(x + \": Invalid mesh primitive mode (\" + m + \")\");\n        }, O.prototype._compileMaterialsAsync = function() {\n          var x = this;\n          this._parent._startPerformanceCounter(\"Compile materials\");\n          var m = new Array();\n          if (this._gltf.materials)\n            for (var c = 0, T = this._gltf.materials; c < T.length; c++) {\n              var S = T[c];\n              if (S._data)\n                for (var E in S._data)\n                  for (var g = S._data[E], l = 0, h = g.babylonMeshes; l < h.length; l++) {\n                    var v = h[l];\n                    v.computeWorldMatrix(!0);\n                    var b = g.babylonMaterial;\n                    m.push(b.forceCompilationAsync(v)), m.push(b.forceCompilationAsync(v, { useInstances: !0 })), this._parent.useClipPlane && (m.push(b.forceCompilationAsync(v, { clipPlane: !0 })), m.push(b.forceCompilationAsync(v, { clipPlane: !0, useInstances: !0 })));\n                  }\n            }\n          return Promise.all(m).then(function() {\n            x._parent._endPerformanceCounter(\"Compile materials\");\n          });\n        }, O.prototype._compileShadowGeneratorsAsync = function() {\n          var x = this;\n          this._parent._startPerformanceCounter(\"Compile shadow generators\");\n          for (var m = new Array(), c = 0, T = this._babylonScene.lights; c < T.length; c++) {\n            var S = T[c].getShadowGenerator();\n            S && m.push(S.forceCompilationAsync());\n          }\n          return Promise.all(m).then(function() {\n            x._parent._endPerformanceCounter(\"Compile shadow generators\");\n          });\n        }, O.prototype._forEachExtensions = function(x) {\n          for (var m = 0, c = this._extensions; m < c.length; m++) {\n            var T = c[m];\n            T.enabled && x(T);\n          }\n        }, O.prototype._applyExtensions = function(x, m, c) {\n          for (var T = 0, S = this._extensions; T < S.length; T++) {\n            var E = S[T];\n            if (E.enabled) {\n              var g = E.name + \".\" + m, l = x;\n              l._activeLoaderExtensionFunctions = l._activeLoaderExtensionFunctions || {};\n              var h = l._activeLoaderExtensionFunctions;\n              if (!h[g]) {\n                h[g] = !0;\n                try {\n                  var v = c(E);\n                  if (v)\n                    return v;\n                } finally {\n                  delete h[g];\n                }\n              }\n            }\n          }\n          return null;\n        }, O.prototype._extensionsOnLoading = function() {\n          this._forEachExtensions(function(x) {\n            return x.onLoading && x.onLoading();\n          });\n        }, O.prototype._extensionsOnReady = function() {\n          this._forEachExtensions(function(x) {\n            return x.onReady && x.onReady();\n          });\n        }, O.prototype._extensionsLoadSceneAsync = function(x, m) {\n          return this._applyExtensions(m, \"loadScene\", function(c) {\n            return c.loadSceneAsync && c.loadSceneAsync(x, m);\n          });\n        }, O.prototype._extensionsLoadNodeAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadNode\", function(T) {\n            return T.loadNodeAsync && T.loadNodeAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadCameraAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadCamera\", function(T) {\n            return T.loadCameraAsync && T.loadCameraAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadVertexDataAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadVertexData\", function(T) {\n            return T._loadVertexDataAsync && T._loadVertexDataAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadMeshPrimitiveAsync = function(x, m, c, T, S, E) {\n          return this._applyExtensions(S, \"loadMeshPrimitive\", function(g) {\n            return g._loadMeshPrimitiveAsync && g._loadMeshPrimitiveAsync(x, m, c, T, S, E);\n          });\n        }, O.prototype._extensionsLoadMaterialAsync = function(x, m, c, T, S) {\n          return this._applyExtensions(m, \"loadMaterial\", function(E) {\n            return E._loadMaterialAsync && E._loadMaterialAsync(x, m, c, T, S);\n          });\n        }, O.prototype._extensionsCreateMaterial = function(x, m, c) {\n          return this._applyExtensions(m, \"createMaterial\", function(T) {\n            return T.createMaterial && T.createMaterial(x, m, c);\n          });\n        }, O.prototype._extensionsLoadMaterialPropertiesAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadMaterialProperties\", function(T) {\n            return T.loadMaterialPropertiesAsync && T.loadMaterialPropertiesAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadTextureInfoAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadTextureInfo\", function(T) {\n            return T.loadTextureInfoAsync && T.loadTextureInfoAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadTextureAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadTexture\", function(T) {\n            return T._loadTextureAsync && T._loadTextureAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadAnimationAsync = function(x, m) {\n          return this._applyExtensions(m, \"loadAnimation\", function(c) {\n            return c.loadAnimationAsync && c.loadAnimationAsync(x, m);\n          });\n        }, O.prototype._extensionsLoadSkinAsync = function(x, m, c) {\n          return this._applyExtensions(c, \"loadSkin\", function(T) {\n            return T._loadSkinAsync && T._loadSkinAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadUriAsync = function(x, m, c) {\n          return this._applyExtensions(m, \"loadUri\", function(T) {\n            return T._loadUriAsync && T._loadUriAsync(x, m, c);\n          });\n        }, O.prototype._extensionsLoadBufferViewAsync = function(x, m) {\n          return this._applyExtensions(m, \"loadBufferView\", function(c) {\n            return c.loadBufferViewAsync && c.loadBufferViewAsync(x, m);\n          });\n        }, O.prototype._extensionsLoadBufferAsync = function(x, m, c, T) {\n          return this._applyExtensions(m, \"loadBuffer\", function(S) {\n            return S.loadBufferAsync && S.loadBufferAsync(x, m, c, T);\n          });\n        }, O.LoadExtensionAsync = function(x, m, c, T) {\n          if (!m.extensions)\n            return null;\n          var S = m.extensions[c];\n          return S ? T(x + \"/extensions/\" + c, S) : null;\n        }, O.LoadExtraAsync = function(x, m, c, T) {\n          if (!m.extras)\n            return null;\n          var S = m.extras[c];\n          return S ? T(x + \"/extras/\" + c, S) : null;\n        }, O.prototype.isExtensionUsed = function(x) {\n          return !!this._gltf.extensionsUsed && this._gltf.extensionsUsed.indexOf(x) !== -1;\n        }, O.prototype.logOpen = function(x) {\n          this._parent._logOpen(x);\n        }, O.prototype.logClose = function() {\n          this._parent._logClose();\n        }, O.prototype.log = function(x) {\n          this._parent._log(x);\n        }, O.prototype.startPerformanceCounter = function(x) {\n          this._parent._startPerformanceCounter(x);\n        }, O.prototype.endPerformanceCounter = function(x) {\n          this._parent._endPerformanceCounter(x);\n        }, O._RegisteredExtensions = {}, O.DefaultSampler = { index: -1 }, O;\n      }();\n      C.GLTFFileLoader._CreateGLTF2Loader = function(O) {\n        return new I(O);\n      };\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFLoaderCoordinateSystemMode\", function() {\n        return _;\n      }), V.d(f, \"GLTFLoaderAnimationStartMode\", function() {\n        return C;\n      }), V.d(f, \"GLTFLoaderState\", function() {\n        return u;\n      }), V.d(f, \"GLTFFileLoader\", function() {\n        return x;\n      });\n      var _, C, u, I = V(0), O = V(3);\n      (function(m) {\n        m[m.AUTO = 0] = \"AUTO\", m[m.FORCE_RIGHT_HANDED = 1] = \"FORCE_RIGHT_HANDED\";\n      })(_ || (_ = {})), function(m) {\n        m[m.NONE = 0] = \"NONE\", m[m.FIRST = 1] = \"FIRST\", m[m.ALL = 2] = \"ALL\";\n      }(C || (C = {})), function(m) {\n        m[m.LOADING = 0] = \"LOADING\", m[m.READY = 1] = \"READY\", m[m.COMPLETE = 2] = \"COMPLETE\";\n      }(u || (u = {}));\n      var x = function() {\n        function m() {\n          this.onParsedObservable = new I.Observable(), this.coordinateSystemMode = _.AUTO, this.animationStartMode = C.FIRST, this.compileMaterials = !1, this.useClipPlane = !1, this.compileShadowGenerators = !1, this.transparencyAsCoverage = !1, this.useRangeRequests = !1, this.createInstances = !0, this.alwaysComputeBoundingBox = !1, this.loadAllMaterials = !1, this.preprocessUrlAsync = function(c) {\n            return Promise.resolve(c);\n          }, this.onMeshLoadedObservable = new I.Observable(), this.onTextureLoadedObservable = new I.Observable(), this.onMaterialLoadedObservable = new I.Observable(), this.onCameraLoadedObservable = new I.Observable(), this.onCompleteObservable = new I.Observable(), this.onErrorObservable = new I.Observable(), this.onDisposeObservable = new I.Observable(), this.onExtensionLoadedObservable = new I.Observable(), this.validate = !1, this.onValidatedObservable = new I.Observable(), this._loader = null, this._requests = new Array(), this.name = \"gltf\", this.extensions = { \".gltf\": { isBinary: !1 }, \".glb\": { isBinary: !0 } }, this._logIndentLevel = 0, this._loggingEnabled = !1, this._log = this._logDisabled, this._capturePerformanceCounters = !1, this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled;\n        }\n        return Object.defineProperty(m.prototype, \"onParsed\", { set: function(c) {\n          this._onParsedObserver && this.onParsedObservable.remove(this._onParsedObserver), this._onParsedObserver = this.onParsedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onMeshLoaded\", { set: function(c) {\n          this._onMeshLoadedObserver && this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver), this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onTextureLoaded\", { set: function(c) {\n          this._onTextureLoadedObserver && this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver), this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onMaterialLoaded\", { set: function(c) {\n          this._onMaterialLoadedObserver && this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver), this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onCameraLoaded\", { set: function(c) {\n          this._onCameraLoadedObserver && this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver), this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onComplete\", { set: function(c) {\n          this._onCompleteObserver && this.onCompleteObservable.remove(this._onCompleteObserver), this._onCompleteObserver = this.onCompleteObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onError\", { set: function(c) {\n          this._onErrorObserver && this.onErrorObservable.remove(this._onErrorObserver), this._onErrorObserver = this.onErrorObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onDispose\", { set: function(c) {\n          this._onDisposeObserver && this.onDisposeObservable.remove(this._onDisposeObserver), this._onDisposeObserver = this.onDisposeObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onExtensionLoaded\", { set: function(c) {\n          this._onExtensionLoadedObserver && this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver), this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"loggingEnabled\", { get: function() {\n          return this._loggingEnabled;\n        }, set: function(c) {\n          this._loggingEnabled !== c && (this._loggingEnabled = c, this._loggingEnabled ? this._log = this._logEnabled : this._log = this._logDisabled);\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"capturePerformanceCounters\", { get: function() {\n          return this._capturePerformanceCounters;\n        }, set: function(c) {\n          this._capturePerformanceCounters !== c && (this._capturePerformanceCounters = c, this._capturePerformanceCounters ? (this._startPerformanceCounter = this._startPerformanceCounterEnabled, this._endPerformanceCounter = this._endPerformanceCounterEnabled) : (this._startPerformanceCounter = this._startPerformanceCounterDisabled, this._endPerformanceCounter = this._endPerformanceCounterDisabled));\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(m.prototype, \"onValidated\", { set: function(c) {\n          this._onValidatedObserver && this.onValidatedObservable.remove(this._onValidatedObserver), this._onValidatedObserver = this.onValidatedObservable.add(c);\n        }, enumerable: !1, configurable: !0 }), m.prototype.dispose = function() {\n          this._loader && (this._loader.dispose(), this._loader = null);\n          for (var c = 0, T = this._requests; c < T.length; c++)\n            T[c].abort();\n          this._requests.length = 0, delete this._progressCallback, this.preprocessUrlAsync = function(S) {\n            return Promise.resolve(S);\n          }, this.onMeshLoadedObservable.clear(), this.onTextureLoadedObservable.clear(), this.onMaterialLoadedObservable.clear(), this.onCameraLoadedObservable.clear(), this.onCompleteObservable.clear(), this.onExtensionLoadedObservable.clear(), this.onDisposeObservable.notifyObservers(void 0), this.onDisposeObservable.clear();\n        }, m.prototype.requestFile = function(c, T, S, E, g, l) {\n          var h = this;\n          if (this._progressCallback = E, g) {\n            if (this.useRangeRequests) {\n              this.validate && I.Logger.Warn(\"glTF validation is not supported when range requests are enabled\");\n              var v = { abort: function() {\n              }, onCompleteObservable: new I.Observable() }, b = { readAsync: function(D, w) {\n                return new Promise(function(N, M) {\n                  h._requestFile(T, c, function(U) {\n                    N(new Uint8Array(U));\n                  }, !0, function(U) {\n                    M(U);\n                  }, function(U) {\n                    U.setRequestHeader(\"Range\", \"bytes=\" + D + \"-\" + (D + w - 1));\n                  });\n                });\n              }, byteLength: 0 };\n              return this._unpackBinaryAsync(new I.DataReader(b)).then(function(D) {\n                v.onCompleteObservable.notifyObservers(v), S(D);\n              }, l), v;\n            }\n            return this._requestFile(T, c, function(D, w) {\n              var N = D;\n              h._unpackBinaryAsync(new I.DataReader({ readAsync: function(M, U) {\n                return Promise.resolve(new Uint8Array(N, M, U));\n              }, byteLength: N.byteLength })).then(function(M) {\n                S(M, w);\n              }, l);\n            }, !0, l);\n          }\n          return this._requestFile(T, c, function(D, w) {\n            h._validate(c, D, I.Tools.GetFolderPath(T), I.Tools.GetFilename(T)), S({ json: h._parseJson(D) }, w);\n          }, g, l);\n        }, m.prototype.readFile = function(c, T, S, E, g, l) {\n          var h = this;\n          return c._readFile(T, function(v) {\n            if (h._validate(c, v, \"file:\", T.name), g) {\n              var b = v;\n              h._unpackBinaryAsync(new I.DataReader({ readAsync: function(D, w) {\n                return Promise.resolve(new Uint8Array(b, D, w));\n              }, byteLength: b.byteLength })).then(S, l);\n            } else\n              S({ json: h._parseJson(v) });\n          }, E, g, l);\n        }, m.prototype.importMeshAsync = function(c, T, S, E, g, l) {\n          var h = this;\n          return Promise.resolve().then(function() {\n            return h.onParsedObservable.notifyObservers(S), h.onParsedObservable.clear(), h._log(\"Loading \" + (l || \"\")), h._loader = h._getLoader(S), h._loader.importMeshAsync(c, T, !1, S, E, g, l);\n          });\n        }, m.prototype.loadAsync = function(c, T, S, E, g) {\n          var l = this;\n          return Promise.resolve().then(function() {\n            return l.onParsedObservable.notifyObservers(T), l.onParsedObservable.clear(), l._log(\"Loading \" + (g || \"\")), l._loader = l._getLoader(T), l._loader.loadAsync(c, T, S, E, g);\n          });\n        }, m.prototype.loadAssetContainerAsync = function(c, T, S, E, g) {\n          var l = this;\n          return Promise.resolve().then(function() {\n            l.onParsedObservable.notifyObservers(T), l.onParsedObservable.clear(), l._log(\"Loading \" + (g || \"\")), l._loader = l._getLoader(T);\n            var h = new I.AssetContainer(c), v = [];\n            l.onMaterialLoadedObservable.add(function(w) {\n              v.push(w), w.onDisposeObservable.addOnce(function() {\n                var N = h.materials.indexOf(w);\n                N > -1 && h.materials.splice(N, 1), (N = v.indexOf(w)) > -1 && v.splice(N, 1);\n              });\n            });\n            var b = [];\n            l.onTextureLoadedObservable.add(function(w) {\n              b.push(w), w.onDisposeObservable.addOnce(function() {\n                var N = h.textures.indexOf(w);\n                N > -1 && h.textures.splice(N, 1), (N = b.indexOf(w)) > -1 && b.splice(N, 1);\n              });\n            });\n            var D = [];\n            return l.onCameraLoadedObservable.add(function(w) {\n              D.push(w);\n            }), l._loader.importMeshAsync(null, c, !0, T, S, E, g).then(function(w) {\n              return Array.prototype.push.apply(h.geometries, w.geometries), Array.prototype.push.apply(h.meshes, w.meshes), Array.prototype.push.apply(h.particleSystems, w.particleSystems), Array.prototype.push.apply(h.skeletons, w.skeletons), Array.prototype.push.apply(h.animationGroups, w.animationGroups), Array.prototype.push.apply(h.materials, v), Array.prototype.push.apply(h.textures, b), Array.prototype.push.apply(h.lights, w.lights), Array.prototype.push.apply(h.transformNodes, w.transformNodes), Array.prototype.push.apply(h.cameras, D), h;\n            });\n          });\n        }, m.prototype.canDirectLoad = function(c) {\n          return c.indexOf(\"asset\") !== -1 && c.indexOf(\"version\") !== -1 || I.StringTools.StartsWith(c, \"data:base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(c, \"data:application/octet-stream;base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(c, \"data:model/gltf-binary;base64,\" + m.magicBase64Encoded);\n        }, m.prototype.directLoad = function(c, T) {\n          if (I.StringTools.StartsWith(T, \"base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(T, \"application/octet-stream;base64,\" + m.magicBase64Encoded) || I.StringTools.StartsWith(T, \"model/gltf-binary;base64,\" + m.magicBase64Encoded)) {\n            var S = I.Tools.DecodeBase64(T);\n            return this._validate(c, S), this._unpackBinaryAsync(new I.DataReader({ readAsync: function(E, g) {\n              return Promise.resolve(new Uint8Array(S, E, g));\n            }, byteLength: S.byteLength }));\n          }\n          return this._validate(c, T), Promise.resolve({ json: this._parseJson(T) });\n        }, m.prototype.createPlugin = function() {\n          return new m();\n        }, Object.defineProperty(m.prototype, \"loaderState\", { get: function() {\n          return this._loader ? this._loader.state : null;\n        }, enumerable: !1, configurable: !0 }), m.prototype.whenCompleteAsync = function() {\n          var c = this;\n          return new Promise(function(T, S) {\n            c.onCompleteObservable.addOnce(function() {\n              T();\n            }), c.onErrorObservable.addOnce(function(E) {\n              S(E);\n            });\n          });\n        }, m.prototype._loadFile = function(c, T, S, E, g) {\n          var l = this, h = T._loadFile(c, S, function(v) {\n            l._onProgress(v, h);\n          }, void 0, E, g);\n          return h.onCompleteObservable.add(function(v) {\n            l._requests.splice(l._requests.indexOf(v), 1);\n          }), this._requests.push(h), h;\n        }, m.prototype._requestFile = function(c, T, S, E, g, l) {\n          var h = this, v = T._requestFile(c, S, function(b) {\n            h._onProgress(b, v);\n          }, void 0, E, g, l);\n          return v.onCompleteObservable.add(function(b) {\n            h._requests.splice(h._requests.indexOf(b), 1);\n          }), this._requests.push(v), v;\n        }, m.prototype._onProgress = function(c, T) {\n          if (this._progressCallback) {\n            T._lengthComputable = c.lengthComputable, T._loaded = c.loaded, T._total = c.total;\n            for (var S = !0, E = 0, g = 0, l = 0, h = this._requests; l < h.length; l++) {\n              var v = h[l];\n              if (v._lengthComputable === void 0 || v._loaded === void 0 || v._total === void 0)\n                return;\n              S = S && v._lengthComputable, E += v._loaded, g += v._total;\n            }\n            this._progressCallback({ lengthComputable: S, loaded: E, total: S ? g : 0 });\n          }\n        }, m.prototype._validate = function(c, T, S, E) {\n          var g = this;\n          S === void 0 && (S = \"\"), E === void 0 && (E = \"\"), this.validate && (this._startPerformanceCounter(\"Validate JSON\"), O.GLTFValidation.ValidateAsync(T, S, E, function(l) {\n            return g.preprocessUrlAsync(S + l).then(function(h) {\n              return c._loadFileAsync(h, void 0, !0, !0);\n            });\n          }).then(function(l) {\n            g._endPerformanceCounter(\"Validate JSON\"), g.onValidatedObservable.notifyObservers(l), g.onValidatedObservable.clear();\n          }, function(l) {\n            g._endPerformanceCounter(\"Validate JSON\"), I.Tools.Warn(\"Failed to validate: \" + l.message), g.onValidatedObservable.clear();\n          }));\n        }, m.prototype._getLoader = function(c) {\n          var T = c.json.asset || {};\n          this._log(\"Asset version: \" + T.version), T.minVersion && this._log(\"Asset minimum version: \" + T.minVersion), T.generator && this._log(\"Asset generator: \" + T.generator);\n          var S = m._parseVersion(T.version);\n          if (!S)\n            throw new Error(\"Invalid version: \" + T.version);\n          if (T.minVersion !== void 0) {\n            var E = m._parseVersion(T.minVersion);\n            if (!E)\n              throw new Error(\"Invalid minimum version: \" + T.minVersion);\n            if (m._compareVersion(E, { major: 2, minor: 0 }) > 0)\n              throw new Error(\"Incompatible minimum version: \" + T.minVersion);\n          }\n          var g = { 1: m._CreateGLTF1Loader, 2: m._CreateGLTF2Loader }[S.major];\n          if (!g)\n            throw new Error(\"Unsupported version: \" + T.version);\n          return g(this);\n        }, m.prototype._parseJson = function(c) {\n          this._startPerformanceCounter(\"Parse JSON\"), this._log(\"JSON length: \" + c.length);\n          var T = JSON.parse(c);\n          return this._endPerformanceCounter(\"Parse JSON\"), T;\n        }, m.prototype._unpackBinaryAsync = function(c) {\n          var T = this;\n          return this._startPerformanceCounter(\"Unpack Binary\"), c.loadAsync(20).then(function() {\n            var S = c.readUint32();\n            if (S !== 1179937895)\n              throw new Error(\"Unexpected magic: \" + S);\n            var E = c.readUint32();\n            T.loggingEnabled && T._log(\"Binary version: \" + E);\n            var g, l = c.readUint32();\n            if (c.buffer.byteLength !== 0 && l !== c.buffer.byteLength)\n              throw new Error(\"Length in header does not match actual data length: \" + l + \" != \" + c.buffer.byteLength);\n            switch (E) {\n              case 1:\n                g = T._unpackBinaryV1Async(c, l);\n                break;\n              case 2:\n                g = T._unpackBinaryV2Async(c, l);\n                break;\n              default:\n                throw new Error(\"Unsupported version: \" + E);\n            }\n            return T._endPerformanceCounter(\"Unpack Binary\"), g;\n          });\n        }, m.prototype._unpackBinaryV1Async = function(c, T) {\n          var S = c.readUint32(), E = c.readUint32();\n          if (E !== 0)\n            throw new Error(\"Unexpected content format: \" + E);\n          var g = T - c.byteOffset, l = { json: this._parseJson(c.readString(S)), bin: null };\n          if (g !== 0) {\n            var h = c.byteOffset;\n            l.bin = { readAsync: function(v, b) {\n              return c.buffer.readAsync(h + v, b);\n            }, byteLength: g };\n          }\n          return Promise.resolve(l);\n        }, m.prototype._unpackBinaryV2Async = function(c, T) {\n          var S = this, E = 1313821514, g = 5130562, l = c.readUint32();\n          if (c.readUint32() !== E)\n            throw new Error(\"First chunk format is not JSON\");\n          return c.byteOffset + l === T ? c.loadAsync(l).then(function() {\n            return { json: S._parseJson(c.readString(l)), bin: null };\n          }) : c.loadAsync(l + 8).then(function() {\n            var h = { json: S._parseJson(c.readString(l)), bin: null }, v = function() {\n              var b = c.readUint32();\n              switch (c.readUint32()) {\n                case E:\n                  throw new Error(\"Unexpected JSON chunk\");\n                case g:\n                  var D = c.byteOffset;\n                  h.bin = { readAsync: function(w, N) {\n                    return c.buffer.readAsync(D + w, N);\n                  }, byteLength: b }, c.skipBytes(b);\n                  break;\n                default:\n                  c.skipBytes(b);\n              }\n              return c.byteOffset !== T ? c.loadAsync(8).then(v) : Promise.resolve(h);\n            };\n            return v();\n          });\n        }, m._parseVersion = function(c) {\n          if (c === \"1.0\" || c === \"1.0.1\")\n            return { major: 1, minor: 0 };\n          var T = (c + \"\").match(/^(\\d+)\\.(\\d+)/);\n          return T ? { major: parseInt(T[1]), minor: parseInt(T[2]) } : null;\n        }, m._compareVersion = function(c, T) {\n          return c.major > T.major ? 1 : c.major < T.major ? -1 : c.minor > T.minor ? 1 : c.minor < T.minor ? -1 : 0;\n        }, m.prototype._logOpen = function(c) {\n          this._log(c), this._logIndentLevel++;\n        }, m.prototype._logClose = function() {\n          --this._logIndentLevel;\n        }, m.prototype._logEnabled = function(c) {\n          var T = m._logSpaces.substr(0, 2 * this._logIndentLevel);\n          I.Logger.Log(\"\" + T + c);\n        }, m.prototype._logDisabled = function(c) {\n        }, m.prototype._startPerformanceCounterEnabled = function(c) {\n          I.Tools.StartPerformanceCounter(c);\n        }, m.prototype._startPerformanceCounterDisabled = function(c) {\n        }, m.prototype._endPerformanceCounterEnabled = function(c) {\n          I.Tools.EndPerformanceCounter(c);\n        }, m.prototype._endPerformanceCounterDisabled = function(c) {\n        }, m.IncrementalLoading = !0, m.HomogeneousCoordinates = !1, m.magicBase64Encoded = \"Z2xURg\", m._logSpaces = \"                                \", m;\n      }();\n      I.SceneLoader && I.SceneLoader.RegisterPlugin(new x());\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFValidation\", function() {\n        return I;\n      });\n      var _ = V(0);\n      function C(O, x, m, c) {\n        var T = { externalResourceFunction: function(S) {\n          return c(S).then(function(E) {\n            return new Uint8Array(E);\n          });\n        } };\n        return m && (T.uri = x === \"file:\" ? m : x + m), O instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(O), T) : GLTFValidator.validateString(O, T);\n      }\n      function u() {\n        var O = [];\n        onmessage = function(x) {\n          var m = x.data;\n          switch (m.id) {\n            case \"init\":\n              importScripts(m.url);\n              break;\n            case \"validate\":\n              C(m.data, m.rootUrl, m.fileName, function(c) {\n                return new Promise(function(T, S) {\n                  var E = O.length;\n                  O.push({ resolve: T, reject: S }), postMessage({ id: \"getExternalResource\", index: E, uri: c });\n                });\n              }).then(function(c) {\n                postMessage({ id: \"validate.resolve\", value: c });\n              }, function(c) {\n                postMessage({ id: \"validate.reject\", reason: c });\n              });\n              break;\n            case \"getExternalResource.resolve\":\n              O[m.index].resolve(m.value);\n              break;\n            case \"getExternalResource.reject\":\n              O[m.index].reject(m.reason);\n          }\n        };\n      }\n      var I = function() {\n        function O() {\n        }\n        return O.ValidateAsync = function(x, m, c, T) {\n          var S = this;\n          return typeof Worker == \"function\" ? new Promise(function(E, g) {\n            var l = C + \"(\" + u + \")()\", h = URL.createObjectURL(new Blob([l], { type: \"application/javascript\" })), v = new Worker(h), b = function(w) {\n              v.removeEventListener(\"error\", b), v.removeEventListener(\"message\", D), g(w);\n            }, D = function(w) {\n              var N = w.data;\n              switch (N.id) {\n                case \"getExternalResource\":\n                  T(N.uri).then(function(M) {\n                    v.postMessage({ id: \"getExternalResource.resolve\", index: N.index, value: M }, [M]);\n                  }, function(M) {\n                    v.postMessage({ id: \"getExternalResource.reject\", index: N.index, reason: M });\n                  });\n                  break;\n                case \"validate.resolve\":\n                  v.removeEventListener(\"error\", b), v.removeEventListener(\"message\", D), E(N.value);\n                  break;\n                case \"validate.reject\":\n                  v.removeEventListener(\"error\", b), v.removeEventListener(\"message\", D), g(N.reason);\n              }\n            };\n            v.addEventListener(\"error\", b), v.addEventListener(\"message\", D), v.postMessage({ id: \"init\", url: _.Tools.GetAbsoluteUrl(S.Configuration.url) }), v.postMessage({ id: \"validate\", data: x, rootUrl: m, fileName: c });\n          }) : (this._LoadScriptPromise || (this._LoadScriptPromise = _.Tools.LoadScriptAsync(this.Configuration.url)), this._LoadScriptPromise.then(function() {\n            return C(x, m, c, T);\n          }));\n        }, O.Configuration = { url: \"https://preview.babylonjs.com/gltf_validator.js\" }, O;\n      }();\n    }, function(A, f, V) {\n      V.d(f, \"b\", function() {\n        return C;\n      }), V.d(f, \"a\", function() {\n        return u;\n      });\n      /*! *****************************************************************************\n      \tCopyright (c) Microsoft Corporation.\n      \n      \tPermission to use, copy, modify, and/or distribute this software for any\n      \tpurpose with or without fee is hereby granted.\n      \n      \tTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n      \tREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n      \tAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n      \tINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n      \tLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n      \tOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n      \tPERFORMANCE OF THIS SOFTWARE.\n      \t***************************************************************************** */\n      var _ = function(I, O) {\n        return (_ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(x, m) {\n          x.__proto__ = m;\n        } || function(x, m) {\n          for (var c in m)\n            Object.prototype.hasOwnProperty.call(m, c) && (x[c] = m[c]);\n        })(I, O);\n      };\n      function C(I, O) {\n        if (typeof O != \"function\" && O !== null)\n          throw new TypeError(\"Class extends value \" + String(O) + \" is not a constructor or null\");\n        function x() {\n          this.constructor = I;\n        }\n        _(I, O), I.prototype = O === null ? Object.create(O) : (x.prototype = O.prototype, new x());\n      }\n      var u = function() {\n        return (u = Object.assign || function(I) {\n          for (var O, x = 1, m = arguments.length; x < m; x++)\n            for (var c in O = arguments[x])\n              Object.prototype.hasOwnProperty.call(O, c) && (I[c] = O[c]);\n          return I;\n        }).apply(this, arguments);\n      };\n    }, function(A, f) {\n      var V;\n      V = function() {\n        return this;\n      }();\n      try {\n        V = V || new Function(\"return this\")();\n      } catch {\n        typeof window == \"object\" && (V = window);\n      }\n      A.exports = V;\n    }, function(A, f, V) {\n      V.r(f);\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"EXT_lights_image_based\", function() {\n        return I;\n      }), V.d(f, \"EXT_mesh_gpu_instancing\", function() {\n        return O;\n      }), V.d(f, \"EXT_texture_webp\", function() {\n        return x;\n      }), V.d(f, \"KHR_draco_mesh_compression\", function() {\n        return m;\n      }), V.d(f, \"KHR_lights\", function() {\n        return c;\n      }), V.d(f, \"KHR_materials_pbrSpecularGlossiness\", function() {\n        return T;\n      }), V.d(f, \"KHR_materials_unlit\", function() {\n        return S;\n      }), V.d(f, \"KHR_materials_clearcoat\", function() {\n        return E;\n      }), V.d(f, \"KHR_materials_sheen\", function() {\n        return g;\n      }), V.d(f, \"KHR_materials_specular\", function() {\n        return l;\n      }), V.d(f, \"KHR_materials_ior\", function() {\n        return h;\n      }), V.d(f, \"KHR_materials_variants\", function() {\n        return v;\n      }), V.d(f, \"KHR_materials_transmission\", function() {\n        return w;\n      }), V.d(f, \"KHR_materials_translucency\", function() {\n        return N;\n      }), V.d(f, \"KHR_mesh_quantization\", function() {\n        return M;\n      }), V.d(f, \"KHR_texture_basisu\", function() {\n        return U;\n      }), V.d(f, \"KHR_texture_transform\", function() {\n        return X;\n      }), V.d(f, \"MSFT_audio_emitter\", function() {\n        return j;\n      }), V.d(f, \"MSFT_lod\", function() {\n        return ne;\n      }), V.d(f, \"MSFT_minecraftMesh\", function() {\n        return te;\n      }), V.d(f, \"MSFT_sRGBFactors\", function() {\n        return de;\n      }), V.d(f, \"ExtrasAsMetadata\", function() {\n        return pe;\n      });\n      var _ = V(0), C = V(1), u = \"EXT_lights_image_based\", I = function() {\n        function ae(ee) {\n          this.name = u, this._loader = ee, this.enabled = this._loader.isExtensionUsed(u);\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, delete this._lights;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._lights = K.lights;\n          }\n        }, ae.prototype.loadSceneAsync = function(ee, K) {\n          var $ = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(L, G) {\n            var Q = new Array();\n            Q.push($._loader.loadSceneAsync(ee, K)), $._loader.logOpen(\"\" + L);\n            var oe = C.a.Get(L + \"/light\", $._lights, G.light);\n            return Q.push($._loadLightAsync(\"/extensions/\" + $.name + \"/lights/\" + G.light, oe).then(function(re) {\n              $._loader.babylonScene.environmentTexture = re;\n            })), $._loader.logClose(), Promise.all(Q).then(function() {\n            });\n          });\n        }, ae.prototype._loadLightAsync = function(ee, K) {\n          var $ = this;\n          if (!K._loaded) {\n            var L = new Array();\n            this._loader.logOpen(\"\" + ee);\n            for (var G = new Array(K.specularImages.length), Q = function(Y) {\n              var k = K.specularImages[Y];\n              G[Y] = new Array(k.length);\n              for (var H = function(W) {\n                var q = ee + \"/specularImages/\" + Y + \"/\" + W;\n                oe._loader.logOpen(\"\" + q);\n                var he = k[W], ge = C.a.Get(q, oe._loader.gltf.images, he);\n                L.push(oe._loader.loadImageAsync(\"/images/\" + he, ge).then(function(me) {\n                  G[Y][W] = me;\n                })), oe._loader.logClose();\n              }, Z = 0; Z < k.length; Z++)\n                H(Z);\n            }, oe = this, re = 0; re < K.specularImages.length; re++)\n              Q(re);\n            this._loader.logClose(), K._loaded = Promise.all(L).then(function() {\n              var Y = new _.RawCubeTexture($._loader.babylonScene, null, K.specularImageSize);\n              if (Y.name = K.name || \"environment\", K._babylonTexture = Y, K.intensity != null && (Y.level = K.intensity), K.rotation) {\n                var k = _.Quaternion.FromArray(K.rotation);\n                $._loader.babylonScene.useRightHandedSystem || (k = _.Quaternion.Inverse(k)), _.Matrix.FromQuaternionToRef(k, Y.getReflectionTextureMatrix());\n              }\n              var H = _.SphericalHarmonics.FromArray(K.irradianceCoefficients);\n              H.scaleInPlace(K.intensity), H.convertIrradianceToLambertianRadiance();\n              var Z = _.SphericalPolynomial.FromHarmonics(H), W = (G.length - 1) / _.Scalar.Log2(K.specularImageSize);\n              return Y.updateRGBDAsync(G, Z, W);\n            });\n          }\n          return K._loaded.then(function() {\n            return K._babylonTexture;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(u, function(ae) {\n        return new I(ae);\n      });\n      var O = function() {\n        function ae(ee) {\n          this.name = \"EXT_mesh_gpu_instancing\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"EXT_mesh_gpu_instancing\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            L._loader._disableInstancedMesh++;\n            var oe = L._loader.loadNodeAsync(\"/nodes/\" + K.index, K, $);\n            if (L._loader._disableInstancedMesh--, !K._primitiveBabylonMeshes)\n              return oe;\n            var re = new Array(), Y = 0, k = function(H) {\n              if (Q.attributes[H] != null) {\n                var Z = C.a.Get(G + \"/attributes/\" + H, L._loader.gltf.accessors, Q.attributes[H]);\n                if (re.push(L._loader._loadFloatAccessorAsync(\"/accessors/\" + Z.bufferView, Z)), Y === 0)\n                  Y = Z.count;\n                else if (Y !== Z.count)\n                  throw new Error(G + \"/attributes: Instance buffer accessors do not have the same count.\");\n              } else\n                re.push(Promise.resolve(null));\n            };\n            return k(\"TRANSLATION\"), k(\"ROTATION\"), k(\"SCALE\"), oe.then(function(H) {\n              return Promise.all(re).then(function(Z) {\n                var W = Z[0], q = Z[1], he = Z[2], ge = new Float32Array(16 * Y);\n                _.TmpVectors.Vector3[0].copyFromFloats(0, 0, 0), _.TmpVectors.Quaternion[0].copyFromFloats(0, 0, 0, 1), _.TmpVectors.Vector3[1].copyFromFloats(1, 1, 1);\n                for (var me = 0; me < Y; ++me)\n                  W && _.Vector3.FromArrayToRef(W, 3 * me, _.TmpVectors.Vector3[0]), q && _.Quaternion.FromArrayToRef(q, 4 * me, _.TmpVectors.Quaternion[0]), he && _.Vector3.FromArrayToRef(he, 3 * me, _.TmpVectors.Vector3[1]), _.Matrix.ComposeToRef(_.TmpVectors.Vector3[1], _.TmpVectors.Quaternion[0], _.TmpVectors.Vector3[0], _.TmpVectors.Matrix[0]), _.TmpVectors.Matrix[0].copyToArray(ge, 16 * me);\n                for (var _e = 0, ye = K._primitiveBabylonMeshes; _e < ye.length; _e++)\n                  ye[_e].thinInstanceSetBuffer(\"matrix\", ge, 16, !0);\n                return H;\n              });\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"EXT_mesh_gpu_instancing\", function(ae) {\n        return new O(ae);\n      });\n      var x = function() {\n        function ae(ee) {\n          this.name = \"EXT_texture_webp\", this._loader = ee, this.enabled = ee.isExtensionUsed(\"EXT_texture_webp\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype._loadTextureAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = K.sampler == null ? C.b.DefaultSampler : C.a.Get(ee + \"/sampler\", L._loader.gltf.samplers, K.sampler), re = C.a.Get(G + \"/source\", L._loader.gltf.images, Q.source);\n            return L._loader._createTextureAsync(ee, oe, re, function(Y) {\n              $(Y);\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"EXT_texture_webp\", function(ae) {\n        return new x(ae);\n      });\n      var m = function() {\n        function ae(ee) {\n          this.name = \"KHR_draco_mesh_compression\", this._loader = ee, this.enabled = _.DracoCompression.DecoderAvailable && this._loader.isExtensionUsed(\"KHR_draco_mesh_compression\");\n        }\n        return ae.prototype.dispose = function() {\n          delete this.dracoCompression, this._loader = null;\n        }, ae.prototype._loadVertexDataAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            if (K.mode != null) {\n              if (K.mode !== 5 && K.mode !== 4)\n                throw new Error(ee + \": Unsupported mode \" + K.mode);\n              if (K.mode === 5)\n                throw new Error(ee + \": Mode \" + K.mode + \" is not currently supported\");\n            }\n            var oe = {}, re = function(k, H) {\n              var Z = Q.attributes[k];\n              Z != null && ($._delayInfo = $._delayInfo || [], $._delayInfo.indexOf(H) === -1 && $._delayInfo.push(H), oe[H] = Z);\n            };\n            re(\"POSITION\", _.VertexBuffer.PositionKind), re(\"NORMAL\", _.VertexBuffer.NormalKind), re(\"TANGENT\", _.VertexBuffer.TangentKind), re(\"TEXCOORD_0\", _.VertexBuffer.UVKind), re(\"TEXCOORD_1\", _.VertexBuffer.UV2Kind), re(\"JOINTS_0\", _.VertexBuffer.MatricesIndicesKind), re(\"WEIGHTS_0\", _.VertexBuffer.MatricesWeightsKind), re(\"COLOR_0\", _.VertexBuffer.ColorKind);\n            var Y = C.a.Get(G, L._loader.gltf.bufferViews, Q.bufferView);\n            return Y._dracoBabylonGeometry || (Y._dracoBabylonGeometry = L._loader.loadBufferViewAsync(\"/bufferViews/\" + Y.index, Y).then(function(k) {\n              return (L.dracoCompression || _.DracoCompression.Default).decodeMeshAsync(k, oe).then(function(H) {\n                var Z = new _.Geometry($.name, L._loader.babylonScene);\n                return H.applyToGeometry(Z), Z;\n              }).catch(function(H) {\n                throw new Error(ee + \": \" + H.message);\n              });\n            })), Y._dracoBabylonGeometry;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_draco_mesh_compression\", function(ae) {\n        return new m(ae);\n      });\n      var c = function() {\n        function ae(ee) {\n          this.name = \"KHR_lights_punctual\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_lights_punctual\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, delete this._lights;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._lights = K.lights;\n          }\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            return L._loader.loadNodeAsync(ee, K, function(oe) {\n              var re, Y = C.a.Get(G, L._lights, Q.light), k = Y.name || oe.name;\n              switch (L._loader.babylonScene._blockEntityCollection = L._loader._forAssetContainer, Y.type) {\n                case \"directional\":\n                  re = new _.DirectionalLight(k, _.Vector3.Backward(), L._loader.babylonScene);\n                  break;\n                case \"point\":\n                  re = new _.PointLight(k, _.Vector3.Zero(), L._loader.babylonScene);\n                  break;\n                case \"spot\":\n                  var H = new _.SpotLight(k, _.Vector3.Zero(), _.Vector3.Backward(), 0, 1, L._loader.babylonScene);\n                  H.angle = 2 * (Y.spot && Y.spot.outerConeAngle || Math.PI / 4), H.innerAngle = 2 * (Y.spot && Y.spot.innerConeAngle || 0), re = H;\n                  break;\n                default:\n                  throw L._loader.babylonScene._blockEntityCollection = !1, new Error(G + \": Invalid light type (\" + Y.type + \")\");\n              }\n              L._loader.babylonScene._blockEntityCollection = !1, re.falloffType = _.Light.FALLOFF_GLTF, re.diffuse = Y.color ? _.Color3.FromArray(Y.color) : _.Color3.White(), re.intensity = Y.intensity == null ? 1 : Y.intensity, re.range = Y.range == null ? Number.MAX_VALUE : Y.range, re.parent = oe, L._loader._babylonLights.push(re), C.b.AddPointerMetadata(re, G), $(oe);\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_lights_punctual\", function(ae) {\n        return new c(ae);\n      });\n      var T = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_pbrSpecularGlossiness\", this.order = 200, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_pbrSpecularGlossiness\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialBasePropertiesAsync(ee, K, $)), oe.push(L._loadSpecularGlossinessPropertiesAsync(G, K, Q, $)), L._loader.loadMaterialAlphaProperties(ee, K, $), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadSpecularGlossinessPropertiesAsync = function(ee, K, $, L) {\n          if (!(L instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var G = new Array();\n          return L.metallic = null, L.roughness = null, $.diffuseFactor ? (L.albedoColor = _.Color3.FromArray($.diffuseFactor), L.alpha = $.diffuseFactor[3]) : L.albedoColor = _.Color3.White(), L.reflectivityColor = $.specularFactor ? _.Color3.FromArray($.specularFactor) : _.Color3.White(), L.microSurface = $.glossinessFactor == null ? 1 : $.glossinessFactor, $.diffuseTexture && G.push(this._loader.loadTextureInfoAsync(ee + \"/diffuseTexture\", $.diffuseTexture, function(Q) {\n            Q.name = L.name + \" (Diffuse)\", L.albedoTexture = Q;\n          })), $.specularGlossinessTexture && ($.specularGlossinessTexture.nonColorData = !0, G.push(this._loader.loadTextureInfoAsync(ee + \"/specularGlossinessTexture\", $.specularGlossinessTexture, function(Q) {\n            Q.name = L.name + \" (Specular Glossiness)\", L.reflectivityTexture = Q;\n          })), L.reflectivityTexture.hasAlpha = !0, L.useMicroSurfaceFromReflectivityMapAlpha = !0), Promise.all(G).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_pbrSpecularGlossiness\", function(ae) {\n        return new T(ae);\n      });\n      var S = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_unlit\", this.order = 210, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_unlit\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function() {\n            return L._loadUnlitPropertiesAsync(ee, K, $);\n          });\n        }, ae.prototype._loadUnlitPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          $.unlit = !0;\n          var G = K.pbrMetallicRoughness;\n          return G && (G.baseColorFactor ? ($.albedoColor = _.Color3.FromArray(G.baseColorFactor), $.alpha = G.baseColorFactor[3]) : $.albedoColor = _.Color3.White(), G.baseColorTexture && L.push(this._loader.loadTextureInfoAsync(ee + \"/baseColorTexture\", G.baseColorTexture, function(Q) {\n            Q.name = $.name + \" (Base Color)\", $.albedoTexture = Q;\n          }))), K.doubleSided && ($.backFaceCulling = !1, $.twoSidedLighting = !0), this._loader.loadMaterialAlphaProperties(ee, K, $), Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_unlit\", function(ae) {\n        return new S(ae);\n      });\n      var E = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_clearcoat\", this.order = 190, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_clearcoat\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadClearCoatPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadClearCoatPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          return $.clearCoat.isEnabled = !0, $.clearCoat.useRoughnessFromMainTexture = !1, $.clearCoat.remapF0OnInterfaceChange = !1, K.clearcoatFactor != null ? $.clearCoat.intensity = K.clearcoatFactor : $.clearCoat.intensity = 0, K.clearcoatTexture && L.push(this._loader.loadTextureInfoAsync(ee + \"/clearcoatTexture\", K.clearcoatTexture, function(G) {\n            G.name = $.name + \" (ClearCoat Intensity)\", $.clearCoat.texture = G;\n          })), K.clearcoatRoughnessFactor != null ? $.clearCoat.roughness = K.clearcoatRoughnessFactor : $.clearCoat.roughness = 0, K.clearcoatRoughnessTexture && (K.clearcoatRoughnessTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/clearcoatRoughnessTexture\", K.clearcoatRoughnessTexture, function(G) {\n            G.name = $.name + \" (ClearCoat Roughness)\", $.clearCoat.textureRoughness = G;\n          }))), K.clearcoatNormalTexture && (K.clearcoatNormalTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/clearcoatNormalTexture\", K.clearcoatNormalTexture, function(G) {\n            G.name = $.name + \" (ClearCoat Normal)\", $.clearCoat.bumpTexture = G;\n          })), $.invertNormalMapX = !$.getScene().useRightHandedSystem, $.invertNormalMapY = $.getScene().useRightHandedSystem, K.clearcoatNormalTexture.scale != null && ($.clearCoat.bumpTexture.level = K.clearcoatNormalTexture.scale)), Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_clearcoat\", function(ae) {\n        return new E(ae);\n      });\n      var g = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_sheen\", this.order = 190, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_sheen\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadSheenPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadSheenPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          return $.sheen.isEnabled = !0, $.sheen.intensity = 1, K.sheenColorFactor != null ? $.sheen.color = _.Color3.FromArray(K.sheenColorFactor) : $.sheen.color = _.Color3.Black(), K.sheenColorTexture && L.push(this._loader.loadTextureInfoAsync(ee + \"/sheenColorTexture\", K.sheenColorTexture, function(G) {\n            G.name = $.name + \" (Sheen Color)\", $.sheen.texture = G;\n          })), K.sheenRoughnessFactor !== void 0 ? $.sheen.roughness = K.sheenRoughnessFactor : $.sheen.roughness = 0, K.sheenRoughnessTexture && (K.sheenRoughnessTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/sheenRoughnessTexture\", K.sheenRoughnessTexture, function(G) {\n            G.name = $.name + \" (Sheen Roughness)\", $.sheen.textureRoughness = G;\n          }))), $.sheen.albedoScaling = !0, $.sheen.useRoughnessFromMainTexture = !1, Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_sheen\", function(ae) {\n        return new g(ae);\n      });\n      var l = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_specular\", this.order = 190, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_specular\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadSpecularPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadSpecularPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var L = new Array();\n          return K.specularFactor !== void 0 && ($.metallicF0Factor = K.specularFactor), K.specularColorFactor !== void 0 && ($.metallicReflectanceColor = _.Color3.FromArray(K.specularColorFactor)), K.specularTexture && (K.specularTexture.nonColorData = !0, L.push(this._loader.loadTextureInfoAsync(ee + \"/specularTexture\", K.specularTexture, function(G) {\n            G.name = $.name + \" (Specular F0 Color)\", $.metallicReflectanceTexture = G;\n          }))), Promise.all(L).then(function() {\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_specular\", function(ae) {\n        return new l(ae);\n      });\n      var h = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_ior\", this.order = 180, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_ior\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadIorPropertiesAsync(G, Q, $)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadIorPropertiesAsync = function(ee, K, $) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          return K.ior !== void 0 ? $.indexOfRefraction = K.ior : $.indexOfRefraction = ae._DEFAULT_IOR, Promise.resolve();\n        }, ae._DEFAULT_IOR = 1.5, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_ior\", function(ae) {\n        return new h(ae);\n      });\n      var v = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_variants\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_variants\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.GetAvailableVariants = function(ee) {\n          var K = this._GetExtensionMetadata(ee);\n          return K ? Object.keys(K.variants) : [];\n        }, ae.prototype.getAvailableVariants = function(ee) {\n          return ae.GetAvailableVariants(ee);\n        }, ae.SelectVariant = function(ee, K) {\n          var $ = this._GetExtensionMetadata(ee);\n          if (!$)\n            throw new Error(\"Cannot select variant on a glTF mesh that does not have the KHR_materials_variants extension\");\n          var L = function(oe) {\n            var re = $.variants[oe];\n            if (re)\n              for (var Y = 0, k = re; Y < k.length; Y++) {\n                var H = k[Y];\n                H.mesh.material = H.material;\n              }\n          };\n          if (K instanceof Array)\n            for (var G = 0, Q = K; G < Q.length; G++)\n              L(Q[G]);\n          else\n            L(K);\n          $.lastSelected = K;\n        }, ae.prototype.selectVariant = function(ee, K) {\n          return ae.SelectVariant(ee, K);\n        }, ae.Reset = function(ee) {\n          var K = this._GetExtensionMetadata(ee);\n          if (!K)\n            throw new Error(\"Cannot reset on a glTF mesh that does not have the KHR_materials_variants extension\");\n          for (var $ = 0, L = K.original; $ < L.length; $++) {\n            var G = L[$];\n            G.mesh.material = G.material;\n          }\n          K.lastSelected = null;\n        }, ae.prototype.reset = function(ee) {\n          return ae.Reset(ee);\n        }, ae.GetLastSelectedVariant = function(ee) {\n          var K = this._GetExtensionMetadata(ee);\n          if (!K)\n            throw new Error(\"Cannot get the last selected variant on a glTF mesh that does not have the KHR_materials_variants extension\");\n          return K.lastSelected;\n        }, ae.prototype.getLastSelectedVariant = function(ee) {\n          return ae.GetLastSelectedVariant(ee);\n        }, ae._GetExtensionMetadata = function(ee) {\n          var K, $;\n          return (($ = (K = ee == null ? void 0 : ee.metadata) === null || K === void 0 ? void 0 : K.gltf) === null || $ === void 0 ? void 0 : $.KHR_materials_variants) || null;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._variants = K.variants;\n          }\n        }, ae.prototype._loadMeshPrimitiveAsync = function(ee, K, $, L, G, Q) {\n          var oe = this;\n          return C.b.LoadExtensionAsync(ee, G, this.name, function(re, Y) {\n            var k = new Array();\n            return k.push(oe._loader._loadMeshPrimitiveAsync(ee, K, $, L, G, function(H) {\n              if (Q(H), H instanceof _.Mesh) {\n                var Z = C.b._GetDrawMode(ee, G.mode), W = oe._loader.rootBabylonMesh, q = W.metadata = W.metadata || {}, he = q.gltf = q.gltf || {}, ge = he.KHR_materials_variants = he.KHR_materials_variants || { lastSelected: null, original: [], variants: {} };\n                ge.original.push({ mesh: H, material: H.material });\n                for (var me = ge.variants, _e = 0, ye = Y.mappings; _e < ye.length; _e++)\n                  for (var Pe = ye[_e], be = function(We) {\n                    var je = C.a.Get(re + \"/mapping/\" + We, oe._variants, We), He = C.a.Get(\"#/materials/\", oe._loader.gltf.materials, Pe.material);\n                    k.push(oe._loader._loadMaterialAsync(\"#/materials/\" + Pe.material, He, H, Z, function(Qe) {\n                      me[je.name] = me[je.name] || [], me[je.name].push({ mesh: H, material: Qe });\n                    }));\n                  }, Fe = 0, ke = Pe.variants; Fe < ke.length; Fe++)\n                    be(ke[Fe]);\n              }\n            })), Promise.all(k).then(function(H) {\n              return H[0];\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_variants\", function(ae) {\n        return new v(ae);\n      });\n      var b = V(4), D = function() {\n        function ae(ee, K) {\n          var $ = this;\n          this._opaqueRenderTarget = null, this._opaqueMeshesCache = [], this._transparentMeshesCache = [], this._options = Object(b.a)(Object(b.a)({}, ae._getDefaultOptions()), ee), this._scene = K, this._scene._transmissionHelper = this, this.onErrorObservable = new _.Observable(), this._scene.onDisposeObservable.addOnce(function(L) {\n            $.dispose();\n          }), this._parseScene(), this._setupRenderTargets();\n        }\n        return ae._getDefaultOptions = function() {\n          return { renderSize: 512 };\n        }, ae.prototype.updateOptions = function(ee) {\n          var K = this;\n          if (Object.keys(ee).filter(function(G) {\n            return K._options[G] !== ee[G];\n          }).length) {\n            var $ = Object(b.a)(Object(b.a)({}, this._options), ee), L = this._options;\n            this._options = $, $.renderSize !== L.renderSize && this._setupRenderTargets();\n          }\n        }, ae.prototype.getOpaqueTarget = function() {\n          return this._opaqueRenderTarget;\n        }, ae.prototype.shouldRenderAsTransmission = function(ee) {\n          return !!ee && !!(ee instanceof _.PBRMaterial && ee.subSurface.isRefractionEnabled);\n        }, ae.prototype._addMesh = function(ee) {\n          ee instanceof _.Mesh && (ee.onMaterialChangedObservable.add(this.onMeshMaterialChanged.bind(this)), this.shouldRenderAsTransmission(ee.material) ? this._transparentMeshesCache.push(ee) : this._opaqueMeshesCache.push(ee));\n        }, ae.prototype._removeMesh = function(ee) {\n          if (ee instanceof _.Mesh) {\n            ee.onMaterialChangedObservable.remove(this.onMeshMaterialChanged.bind(this));\n            var K = this._transparentMeshesCache.indexOf(ee);\n            K !== -1 && this._transparentMeshesCache.splice(K, 1), (K = this._opaqueMeshesCache.indexOf(ee)) !== -1 && this._opaqueMeshesCache.splice(K, 1);\n          }\n        }, ae.prototype._parseScene = function() {\n          this._scene.meshes.forEach(this._addMesh.bind(this)), this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)), this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this));\n        }, ae.prototype.onMeshMaterialChanged = function(ee) {\n          if (ee instanceof _.Mesh) {\n            var K = this._transparentMeshesCache.indexOf(ee), $ = this._opaqueMeshesCache.indexOf(ee);\n            this.shouldRenderAsTransmission(ee.material) ? (ee.material instanceof _.PBRMaterial && (ee.material.subSurface.refractionTexture = this._opaqueRenderTarget), $ !== -1 ? (this._opaqueMeshesCache.splice($, 1), this._transparentMeshesCache.push(ee)) : K === -1 && this._transparentMeshesCache.push(ee)) : K !== -1 ? (this._transparentMeshesCache.splice(K, 1), this._opaqueMeshesCache.push(ee)) : $ === -1 && this._opaqueMeshesCache.push(ee);\n          }\n        }, ae.prototype._setupRenderTargets = function() {\n          var ee = this, K = -1;\n          if (this._scene.layers && this._opaqueRenderTarget)\n            for (var $ = 0, L = this._scene.layers; $ < L.length; $++) {\n              var G = (re = L[$]).renderTargetTextures.indexOf(this._opaqueRenderTarget);\n              G >= 0 && re.renderTargetTextures.splice(G, 1);\n            }\n          if (this._opaqueRenderTarget && (K = this._scene.customRenderTargets.indexOf(this._opaqueRenderTarget), this._opaqueRenderTarget.dispose()), this._opaqueRenderTarget = new _.RenderTargetTexture(\"opaqueSceneTexture\", this._options.renderSize, this._scene, !0), this._opaqueRenderTarget.renderList = this._opaqueMeshesCache, this._opaqueRenderTarget.gammaSpace = !0, this._opaqueRenderTarget.lodGenerationScale = 1, this._opaqueRenderTarget.lodGenerationOffset = -4, K >= 0 ? this._scene.customRenderTargets.splice(K, 0, this._opaqueRenderTarget) : (K = this._scene.customRenderTargets.length, this._scene.customRenderTargets.push(this._opaqueRenderTarget)), this._scene.layers && this._opaqueRenderTarget)\n            for (var Q = 0, oe = this._scene.layers; Q < oe.length; Q++) {\n              var re;\n              (re = oe[Q]).renderTargetTextures.push(this._opaqueRenderTarget);\n            }\n          this._transparentMeshesCache.forEach(function(Y) {\n            ee.shouldRenderAsTransmission(Y.material) && Y.material instanceof _.PBRMaterial && (Y.material.refractionTexture = ee._opaqueRenderTarget);\n          });\n        }, ae.prototype.dispose = function() {\n          this._scene._transmissionHelper = void 0, this._opaqueRenderTarget && (this._opaqueRenderTarget.dispose(), this._opaqueRenderTarget = null), this._transparentMeshesCache = [], this._opaqueMeshesCache = [];\n        }, ae;\n      }(), w = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_transmission\", this.order = 175, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_transmission\"), this.enabled && (ee.parent.transparencyAsCoverage = !0);\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialBasePropertiesAsync(ee, K, $)), oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadTransparentPropertiesAsync(G, K, $, Q)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadTransparentPropertiesAsync = function(ee, K, $, L) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var G = $;\n          if (G.subSurface.isRefractionEnabled = !0, G.subSurface.volumeIndexOfRefraction = 1, G.subSurface.useAlbedoToTintRefraction = !0, L.transmissionFactor === void 0)\n            return G.subSurface.refractionIntensity = 0, G.subSurface.isRefractionEnabled = !1, Promise.resolve();\n          G.subSurface.refractionIntensity = L.transmissionFactor;\n          var Q = G.getScene();\n          return G.subSurface.refractionIntensity && !Q._transmissionHelper && new D({}, G.getScene()), L.transmissionTexture ? (L.transmissionTexture.nonColorData = !0, this._loader.loadTextureInfoAsync(ee + \"/transmissionTexture\", L.transmissionTexture, void 0).then(function(oe) {\n            G.subSurface.thicknessTexture = oe, G.subSurface.useMaskFromThicknessTextureGltf = !0;\n          })) : Promise.resolve();\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_transmission\", function(ae) {\n        return new w(ae);\n      });\n      var N = function() {\n        function ae(ee) {\n          this.name = \"KHR_materials_translucency\", this.order = 175, this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_materials_translucency\"), this.enabled && (ee.parent.transparencyAsCoverage = !0);\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return oe.push(L._loader.loadMaterialBasePropertiesAsync(ee, K, $)), oe.push(L._loader.loadMaterialPropertiesAsync(ee, K, $)), oe.push(L._loadTranslucentPropertiesAsync(G, K, $, Q)), Promise.all(oe).then(function() {\n            });\n          });\n        }, ae.prototype._loadTranslucentPropertiesAsync = function(ee, K, $, L) {\n          if (!($ instanceof _.PBRMaterial))\n            throw new Error(ee + \": Material type not supported\");\n          var G = $;\n          return G.subSurface.isTranslucencyEnabled = !0, G.subSurface.volumeIndexOfRefraction = 1, G.subSurface.minimumThickness = 0, G.subSurface.maximumThickness = 0, G.subSurface.useAlbedoToTintRefraction = !0, L.translucencyFactor === void 0 ? (G.subSurface.translucencyIntensity = 0, G.subSurface.isTranslucencyEnabled = !1, Promise.resolve()) : (G.subSurface.translucencyIntensity = L.translucencyFactor, L.translucencyTexture ? this._loader.loadTextureInfoAsync(ee + \"/translucencyTexture\", L.translucencyTexture).then(function(Q) {\n            G.subSurface.thicknessTexture = Q, G.subSurface.useMaskFromThicknessTextureGltf = !0;\n          }) : Promise.resolve());\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_materials_translucency\", function(ae) {\n        return new N(ae);\n      });\n      var M = function() {\n        function ae(ee) {\n          this.name = \"KHR_mesh_quantization\", this.enabled = ee.isExtensionUsed(\"KHR_mesh_quantization\");\n        }\n        return ae.prototype.dispose = function() {\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_mesh_quantization\", function(ae) {\n        return new M(ae);\n      });\n      var U = function() {\n        function ae(ee) {\n          this.name = \"KHR_texture_basisu\", this._loader = ee, this.enabled = ee.isExtensionUsed(\"KHR_texture_basisu\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype._loadTextureAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = K.sampler == null ? C.b.DefaultSampler : C.a.Get(ee + \"/sampler\", L._loader.gltf.samplers, K.sampler), re = C.a.Get(G + \"/source\", L._loader.gltf.images, Q.source);\n            return L._loader._createTextureAsync(ee, oe, re, function(Y) {\n              $(Y);\n            }, K._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: !0 } : void 0);\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_texture_basisu\", function(ae) {\n        return new U(ae);\n      });\n      var X = function() {\n        function ae(ee) {\n          this.name = \"KHR_texture_transform\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"KHR_texture_transform\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadTextureInfoAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            return L._loader.loadTextureInfoAsync(ee, K, function(oe) {\n              if (!(oe instanceof _.Texture))\n                throw new Error(G + \": Texture type not supported\");\n              Q.offset && (oe.uOffset = Q.offset[0], oe.vOffset = Q.offset[1]), oe.uRotationCenter = 0, oe.vRotationCenter = 0, Q.rotation && (oe.wAng = -Q.rotation), Q.scale && (oe.uScale = Q.scale[0], oe.vScale = Q.scale[1]), Q.texCoord != null && (oe.coordinatesIndex = Q.texCoord), $(oe);\n            });\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"KHR_texture_transform\", function(ae) {\n        return new X(ae);\n      });\n      var j = function() {\n        function ae(ee) {\n          this.name = \"MSFT_audio_emitter\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_audio_emitter\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, this._clips = null, this._emitters = null;\n        }, ae.prototype.onLoading = function() {\n          var ee = this._loader.gltf.extensions;\n          if (ee && ee[this.name]) {\n            var K = ee[this.name];\n            this._clips = K.clips, this._emitters = K.emitters, C.a.Assign(this._clips), C.a.Assign(this._emitters);\n          }\n        }, ae.prototype.loadSceneAsync = function(ee, K) {\n          var $ = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(L, G) {\n            var Q = new Array();\n            Q.push($._loader.loadSceneAsync(ee, K));\n            for (var oe = 0, re = G.emitters; oe < re.length; oe++) {\n              var Y = re[oe], k = C.a.Get(L + \"/emitters\", $._emitters, Y);\n              if (k.refDistance != null || k.maxDistance != null || k.rolloffFactor != null || k.distanceModel != null || k.innerAngle != null || k.outerAngle != null)\n                throw new Error(L + \": Direction or Distance properties are not allowed on emitters attached to a scene\");\n              Q.push($._loadEmitterAsync(L + \"/emitters/\" + k.index, k));\n            }\n            return Promise.all(Q).then(function() {\n            });\n          });\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe = new Array();\n            return L._loader.loadNodeAsync(G, K, function(re) {\n              for (var Y = function(Z) {\n                var W = C.a.Get(G + \"/emitters\", L._emitters, Z);\n                oe.push(L._loadEmitterAsync(G + \"/emitters/\" + W.index, W).then(function() {\n                  for (var q = 0, he = W._babylonSounds; q < he.length; q++) {\n                    var ge = he[q];\n                    ge.attachToMesh(re), W.innerAngle == null && W.outerAngle == null || (ge.setLocalDirectionToMesh(_.Vector3.Forward()), ge.setDirectionalCone(2 * _.Tools.ToDegrees(W.innerAngle == null ? Math.PI : W.innerAngle), 2 * _.Tools.ToDegrees(W.outerAngle == null ? Math.PI : W.outerAngle), 0));\n                  }\n                }));\n              }, k = 0, H = Q.emitters; k < H.length; k++)\n                Y(H[k]);\n              $(re);\n            }).then(function(re) {\n              return Promise.all(oe).then(function() {\n                return re;\n              });\n            });\n          });\n        }, ae.prototype.loadAnimationAsync = function(ee, K) {\n          var $ = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(L, G) {\n            return $._loader.loadAnimationAsync(ee, K).then(function(Q) {\n              var oe = new Array();\n              C.a.Assign(G.events);\n              for (var re = 0, Y = G.events; re < Y.length; re++) {\n                var k = Y[re];\n                oe.push($._loadAnimationEventAsync(L + \"/events/\" + k.index, ee, K, k, Q));\n              }\n              return Promise.all(oe).then(function() {\n                return Q;\n              });\n            });\n          });\n        }, ae.prototype._loadClipAsync = function(ee, K) {\n          if (K._objectURL)\n            return K._objectURL;\n          var $;\n          if (K.uri)\n            $ = this._loader.loadUriAsync(ee, K, K.uri);\n          else {\n            var L = C.a.Get(ee + \"/bufferView\", this._loader.gltf.bufferViews, K.bufferView);\n            $ = this._loader.loadBufferViewAsync(\"/bufferViews/\" + L.index, L);\n          }\n          return K._objectURL = $.then(function(G) {\n            return URL.createObjectURL(new Blob([G], { type: K.mimeType }));\n          }), K._objectURL;\n        }, ae.prototype._loadEmitterAsync = function(ee, K) {\n          var $ = this;\n          if (K._babylonSounds = K._babylonSounds || [], !K._babylonData) {\n            for (var L = new Array(), G = K.name || \"emitter\" + K.index, Q = { loop: !1, autoplay: !1, volume: K.volume == null ? 1 : K.volume }, oe = function(H) {\n              var Z = \"/extensions/\" + re.name + \"/clips\", W = C.a.Get(Z, re._clips, K.clips[H].clip);\n              L.push(re._loadClipAsync(Z + \"/\" + K.clips[H].clip, W).then(function(q) {\n                var he = K._babylonSounds[H] = new _.Sound(G, q, $._loader.babylonScene, null, Q);\n                he.refDistance = K.refDistance || 1, he.maxDistance = K.maxDistance || 256, he.rolloffFactor = K.rolloffFactor || 1, he.distanceModel = K.distanceModel || \"exponential\", he._positionInEmitterSpace = !0;\n              }));\n            }, re = this, Y = 0; Y < K.clips.length; Y++)\n              oe(Y);\n            var k = Promise.all(L).then(function() {\n              var H = K.clips.map(function(W) {\n                return W.weight || 1;\n              }), Z = new _.WeightedSound(K.loop || !1, K._babylonSounds, H);\n              K.innerAngle && (Z.directionalConeInnerAngle = 2 * _.Tools.ToDegrees(K.innerAngle)), K.outerAngle && (Z.directionalConeOuterAngle = 2 * _.Tools.ToDegrees(K.outerAngle)), K.volume && (Z.volume = K.volume), K._babylonData.sound = Z;\n            });\n            K._babylonData = { loaded: k };\n          }\n          return K._babylonData.loaded;\n        }, ae.prototype._getEventAction = function(ee, K, $, L, G) {\n          switch ($) {\n            case \"play\":\n              return function(Q) {\n                var oe = (G || 0) + (Q - L);\n                K.play(oe);\n              };\n            case \"stop\":\n              return function(Q) {\n                K.stop();\n              };\n            case \"pause\":\n              return function(Q) {\n                K.pause();\n              };\n            default:\n              throw new Error(ee + \": Unsupported action \" + $);\n          }\n        }, ae.prototype._loadAnimationEventAsync = function(ee, K, $, L, G) {\n          var Q = this;\n          if (G.targetedAnimations.length == 0)\n            return Promise.resolve();\n          var oe = G.targetedAnimations[0], re = L.emitter, Y = C.a.Get(\"/extensions/\" + this.name + \"/emitters\", this._emitters, re);\n          return this._loadEmitterAsync(ee, Y).then(function() {\n            var k = Y._babylonData.sound;\n            if (k) {\n              var H = new _.AnimationEvent(L.time, Q._getEventAction(ee, k, L.action, L.time, L.startOffset));\n              oe.animation.addEvent(H), G.onAnimationGroupEndObservable.add(function() {\n                k.stop();\n              }), G.onAnimationGroupPauseObservable.add(function() {\n                k.pause();\n              });\n            }\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_audio_emitter\", function(ae) {\n        return new j(ae);\n      });\n      var ne = function() {\n        function ae(ee) {\n          this.name = \"MSFT_lod\", this.order = 100, this.maxLODsToLoad = 10, this.onNodeLODsLoadedObservable = new _.Observable(), this.onMaterialLODsLoadedObservable = new _.Observable(), this._bufferLODs = new Array(), this._nodeIndexLOD = null, this._nodeSignalLODs = new Array(), this._nodePromiseLODs = new Array(), this._nodeBufferLODs = new Array(), this._materialIndexLOD = null, this._materialSignalLODs = new Array(), this._materialPromiseLODs = new Array(), this._materialBufferLODs = new Array(), this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_lod\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null, this._nodeIndexLOD = null, this._nodeSignalLODs.length = 0, this._nodePromiseLODs.length = 0, this._nodeBufferLODs.length = 0, this._materialIndexLOD = null, this._materialSignalLODs.length = 0, this._materialPromiseLODs.length = 0, this._materialBufferLODs.length = 0, this.onMaterialLODsLoadedObservable.clear(), this.onNodeLODsLoadedObservable.clear();\n        }, ae.prototype.onReady = function() {\n          for (var ee = this, K = function(oe) {\n            var re = Promise.all($._nodePromiseLODs[oe]).then(function() {\n              oe !== 0 && (ee._loader.endPerformanceCounter(\"Node LOD \" + oe), ee._loader.log(\"Loaded node LOD \" + oe)), ee.onNodeLODsLoadedObservable.notifyObservers(oe), oe !== ee._nodePromiseLODs.length - 1 && (ee._loader.startPerformanceCounter(\"Node LOD \" + (oe + 1)), ee._loadBufferLOD(ee._nodeBufferLODs, oe + 1), ee._nodeSignalLODs[oe] && ee._nodeSignalLODs[oe].resolve());\n            });\n            $._loader._completePromises.push(re);\n          }, $ = this, L = 0; L < this._nodePromiseLODs.length; L++)\n            K(L);\n          var G = function(oe) {\n            var re = Promise.all(Q._materialPromiseLODs[oe]).then(function() {\n              oe !== 0 && (ee._loader.endPerformanceCounter(\"Material LOD \" + oe), ee._loader.log(\"Loaded material LOD \" + oe)), ee.onMaterialLODsLoadedObservable.notifyObservers(oe), oe !== ee._materialPromiseLODs.length - 1 && (ee._loader.startPerformanceCounter(\"Material LOD \" + (oe + 1)), ee._loadBufferLOD(ee._materialBufferLODs, oe + 1), ee._materialSignalLODs[oe] && ee._materialSignalLODs[oe].resolve());\n            });\n            Q._loader._completePromises.push(re);\n          }, Q = this;\n          for (L = 0; L < this._materialPromiseLODs.length; L++)\n            G(L);\n        }, ae.prototype.loadSceneAsync = function(ee, K) {\n          var $ = this._loader.loadSceneAsync(ee, K);\n          return this._loadBufferLOD(this._bufferLODs, 0), $;\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtensionAsync(ee, K, this.name, function(G, Q) {\n            var oe, re = L._getLODs(G, K, L._loader.gltf.nodes, Q.ids);\n            L._loader.logOpen(\"\" + G);\n            for (var Y = function(H) {\n              var Z = re[H];\n              H !== 0 && (L._nodeIndexLOD = H, L._nodeSignalLODs[H] = L._nodeSignalLODs[H] || new _.Deferred());\n              var W = L._loader.loadNodeAsync(\"/nodes/\" + Z.index, Z, function(q) {\n                q.setEnabled(!1);\n              }).then(function(q) {\n                if (H !== 0) {\n                  var he = re[H - 1];\n                  he._babylonTransformNode && (L._disposeTransformNode(he._babylonTransformNode), delete he._babylonTransformNode);\n                }\n                return q.setEnabled(!0), q;\n              });\n              L._nodePromiseLODs[H] = L._nodePromiseLODs[H] || [], H === 0 ? oe = W : (L._nodeIndexLOD = null, L._nodePromiseLODs[H].push(W));\n            }, k = 0; k < re.length; k++)\n              Y(k);\n            return L._loader.logClose(), oe;\n          });\n        }, ae.prototype._loadMaterialAsync = function(ee, K, $, L, G) {\n          var Q = this;\n          return this._nodeIndexLOD ? null : C.b.LoadExtensionAsync(ee, K, this.name, function(oe, re) {\n            var Y, k = Q._getLODs(oe, K, Q._loader.gltf.materials, re.ids);\n            Q._loader.logOpen(\"\" + oe);\n            for (var H = function(W) {\n              var q = k[W];\n              W !== 0 && (Q._materialIndexLOD = W);\n              var he = Q._loader._loadMaterialAsync(\"/materials/\" + q.index, q, $, L, function(ge) {\n                W === 0 && G(ge);\n              }).then(function(ge) {\n                if (W !== 0) {\n                  G(ge);\n                  var me = k[W - 1]._data;\n                  me[L] && (Q._disposeMaterials([me[L].babylonMaterial]), delete me[L]);\n                }\n                return ge;\n              });\n              Q._materialPromiseLODs[W] = Q._materialPromiseLODs[W] || [], W === 0 ? Y = he : (Q._materialIndexLOD = null, Q._materialPromiseLODs[W].push(he));\n            }, Z = 0; Z < k.length; Z++)\n              H(Z);\n            return Q._loader.logClose(), Y;\n          });\n        }, ae.prototype._loadUriAsync = function(ee, K, $) {\n          var L = this;\n          if (this._nodeIndexLOD !== null) {\n            this._loader.log(\"deferred\");\n            var G = this._nodeIndexLOD - 1;\n            return this._nodeSignalLODs[G] = this._nodeSignalLODs[G] || new _.Deferred(), this._nodeSignalLODs[this._nodeIndexLOD - 1].promise.then(function() {\n              return L._loader.loadUriAsync(ee, K, $);\n            });\n          }\n          return this._materialIndexLOD !== null ? (this._loader.log(\"deferred\"), G = this._materialIndexLOD - 1, this._materialSignalLODs[G] = this._materialSignalLODs[G] || new _.Deferred(), this._materialSignalLODs[G].promise.then(function() {\n            return L._loader.loadUriAsync(ee, K, $);\n          })) : null;\n        }, ae.prototype.loadBufferAsync = function(ee, K, $, L) {\n          if (this._loader.parent.useRangeRequests && !K.uri) {\n            if (!this._loader.bin)\n              throw new Error(ee + \": Uri is missing or the binary glTF is missing its binary chunk\");\n            var G = function(Q, oe) {\n              var re = $, Y = re + L - 1, k = Q[oe];\n              return k ? (k.start = Math.min(k.start, re), k.end = Math.max(k.end, Y)) : (k = { start: re, end: Y, loaded: new _.Deferred() }, Q[oe] = k), k.loaded.promise.then(function(H) {\n                return new Uint8Array(H.buffer, H.byteOffset + $ - k.start, L);\n              });\n            };\n            return this._loader.log(\"deferred\"), this._nodeIndexLOD !== null ? G(this._nodeBufferLODs, this._nodeIndexLOD) : this._materialIndexLOD !== null ? G(this._materialBufferLODs, this._materialIndexLOD) : G(this._bufferLODs, 0);\n          }\n          return null;\n        }, ae.prototype._loadBufferLOD = function(ee, K) {\n          var $ = ee[K];\n          $ && (this._loader.log(\"Loading buffer range [\" + $.start + \"-\" + $.end + \"]\"), this._loader.bin.readAsync($.start, $.end - $.start + 1).then(function(L) {\n            $.loaded.resolve(L);\n          }, function(L) {\n            $.loaded.reject(L);\n          }));\n        }, ae.prototype._getLODs = function(ee, K, $, L) {\n          if (this.maxLODsToLoad <= 0)\n            throw new Error(\"maxLODsToLoad must be greater than zero\");\n          for (var G = new Array(), Q = L.length - 1; Q >= 0; Q--)\n            if (G.push(C.a.Get(ee + \"/ids/\" + L[Q], $, L[Q])), G.length === this.maxLODsToLoad)\n              return G;\n          return G.push(K), G;\n        }, ae.prototype._disposeTransformNode = function(ee) {\n          var K = this, $ = new Array(), L = ee.material;\n          L && $.push(L);\n          for (var G = 0, Q = ee.getChildMeshes(); G < Q.length; G++) {\n            var oe = Q[G];\n            oe.material && $.push(oe.material);\n          }\n          ee.dispose();\n          var re = $.filter(function(Y) {\n            return K._loader.babylonScene.meshes.every(function(k) {\n              return k.material != Y;\n            });\n          });\n          this._disposeMaterials(re);\n        }, ae.prototype._disposeMaterials = function(ee) {\n          for (var K = {}, $ = 0, L = ee; $ < L.length; $++) {\n            for (var G = 0, Q = (H = L[$]).getActiveTextures(); G < Q.length; G++) {\n              var oe = Q[G];\n              K[oe.uniqueId] = oe;\n            }\n            H.dispose();\n          }\n          for (var re in K)\n            for (var Y = 0, k = this._loader.babylonScene.materials; Y < k.length; Y++) {\n              var H;\n              (H = k[Y]).hasTexture(K[re]) && delete K[re];\n            }\n          for (var re in K)\n            K[re].dispose();\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_lod\", function(ae) {\n        return new ne(ae);\n      });\n      var te = function() {\n        function ae(ee) {\n          this.name = \"MSFT_minecraftMesh\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_minecraftMesh\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtraAsync(ee, K, this.name, function(G, Q) {\n            if (Q) {\n              if (!($ instanceof _.PBRMaterial))\n                throw new Error(G + \": Material type not supported\");\n              var oe = L._loader.loadMaterialPropertiesAsync(ee, K, $);\n              return $.needAlphaBlending() && ($.forceDepthWrite = !0, $.separateCullingPass = !0), $.backFaceCulling = $.forceDepthWrite, $.twoSidedLighting = !0, oe;\n            }\n            return null;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_minecraftMesh\", function(ae) {\n        return new te(ae);\n      });\n      var de = function() {\n        function ae(ee) {\n          this.name = \"MSFT_sRGBFactors\", this._loader = ee, this.enabled = this._loader.isExtensionUsed(\"MSFT_sRGBFactors\");\n        }\n        return ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadMaterialPropertiesAsync = function(ee, K, $) {\n          var L = this;\n          return C.b.LoadExtraAsync(ee, K, this.name, function(G, Q) {\n            if (Q) {\n              if (!($ instanceof _.PBRMaterial))\n                throw new Error(G + \": Material type not supported\");\n              var oe = L._loader.loadMaterialPropertiesAsync(ee, K, $);\n              return $.albedoTexture || $.albedoColor.toLinearSpaceToRef($.albedoColor), $.reflectivityTexture || $.reflectivityColor.toLinearSpaceToRef($.reflectivityColor), oe;\n            }\n            return null;\n          });\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"MSFT_sRGBFactors\", function(ae) {\n        return new de(ae);\n      });\n      var pe = function() {\n        function ae(ee) {\n          this.name = \"ExtrasAsMetadata\", this.enabled = !0, this._loader = ee;\n        }\n        return ae.prototype._assignExtras = function(ee, K) {\n          if (K.extras && Object.keys(K.extras).length > 0) {\n            var $ = ee.metadata = ee.metadata || {};\n            ($.gltf = $.gltf || {}).extras = K.extras;\n          }\n        }, ae.prototype.dispose = function() {\n          this._loader = null;\n        }, ae.prototype.loadNodeAsync = function(ee, K, $) {\n          var L = this;\n          return this._loader.loadNodeAsync(ee, K, function(G) {\n            L._assignExtras(G, K), $(G);\n          });\n        }, ae.prototype.loadCameraAsync = function(ee, K, $) {\n          var L = this;\n          return this._loader.loadCameraAsync(ee, K, function(G) {\n            L._assignExtras(G, K), $(G);\n          });\n        }, ae.prototype.createMaterial = function(ee, K, $) {\n          var L = this._loader.createMaterial(ee, K, $);\n          return this._assignExtras(L, K), L;\n        }, ae;\n      }();\n      C.b.RegisterExtension(\"ExtrasAsMetadata\", function(ae) {\n        return new pe(ae);\n      });\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFBinaryExtension\", function() {\n        return H;\n      }), V.d(f, \"GLTFLoaderBase\", function() {\n        return re;\n      }), V.d(f, \"GLTFLoader\", function() {\n        return Y;\n      }), V.d(f, \"GLTFLoaderExtension\", function() {\n        return k;\n      }), V.d(f, \"EComponentType\", function() {\n        return _;\n      }), V.d(f, \"EShaderType\", function() {\n        return C;\n      }), V.d(f, \"EParameterType\", function() {\n        return u;\n      }), V.d(f, \"ETextureWrapMode\", function() {\n        return I;\n      }), V.d(f, \"ETextureFilterType\", function() {\n        return O;\n      }), V.d(f, \"ETextureFormat\", function() {\n        return x;\n      }), V.d(f, \"ECullingType\", function() {\n        return m;\n      }), V.d(f, \"EBlendingFunction\", function() {\n        return c;\n      }), V.d(f, \"GLTFUtils\", function() {\n        return g;\n      }), V.d(f, \"GLTFMaterialsCommonExtension\", function() {\n        return Z;\n      });\n      var _, C, u, I, O, x, m, c, T = V(4);\n      (function(W) {\n        W[W.BYTE = 5120] = \"BYTE\", W[W.UNSIGNED_BYTE = 5121] = \"UNSIGNED_BYTE\", W[W.SHORT = 5122] = \"SHORT\", W[W.UNSIGNED_SHORT = 5123] = \"UNSIGNED_SHORT\", W[W.FLOAT = 5126] = \"FLOAT\";\n      })(_ || (_ = {})), function(W) {\n        W[W.FRAGMENT = 35632] = \"FRAGMENT\", W[W.VERTEX = 35633] = \"VERTEX\";\n      }(C || (C = {})), function(W) {\n        W[W.BYTE = 5120] = \"BYTE\", W[W.UNSIGNED_BYTE = 5121] = \"UNSIGNED_BYTE\", W[W.SHORT = 5122] = \"SHORT\", W[W.UNSIGNED_SHORT = 5123] = \"UNSIGNED_SHORT\", W[W.INT = 5124] = \"INT\", W[W.UNSIGNED_INT = 5125] = \"UNSIGNED_INT\", W[W.FLOAT = 5126] = \"FLOAT\", W[W.FLOAT_VEC2 = 35664] = \"FLOAT_VEC2\", W[W.FLOAT_VEC3 = 35665] = \"FLOAT_VEC3\", W[W.FLOAT_VEC4 = 35666] = \"FLOAT_VEC4\", W[W.INT_VEC2 = 35667] = \"INT_VEC2\", W[W.INT_VEC3 = 35668] = \"INT_VEC3\", W[W.INT_VEC4 = 35669] = \"INT_VEC4\", W[W.BOOL = 35670] = \"BOOL\", W[W.BOOL_VEC2 = 35671] = \"BOOL_VEC2\", W[W.BOOL_VEC3 = 35672] = \"BOOL_VEC3\", W[W.BOOL_VEC4 = 35673] = \"BOOL_VEC4\", W[W.FLOAT_MAT2 = 35674] = \"FLOAT_MAT2\", W[W.FLOAT_MAT3 = 35675] = \"FLOAT_MAT3\", W[W.FLOAT_MAT4 = 35676] = \"FLOAT_MAT4\", W[W.SAMPLER_2D = 35678] = \"SAMPLER_2D\";\n      }(u || (u = {})), function(W) {\n        W[W.CLAMP_TO_EDGE = 33071] = \"CLAMP_TO_EDGE\", W[W.MIRRORED_REPEAT = 33648] = \"MIRRORED_REPEAT\", W[W.REPEAT = 10497] = \"REPEAT\";\n      }(I || (I = {})), function(W) {\n        W[W.NEAREST = 9728] = \"NEAREST\", W[W.LINEAR = 9728] = \"LINEAR\", W[W.NEAREST_MIPMAP_NEAREST = 9984] = \"NEAREST_MIPMAP_NEAREST\", W[W.LINEAR_MIPMAP_NEAREST = 9985] = \"LINEAR_MIPMAP_NEAREST\", W[W.NEAREST_MIPMAP_LINEAR = 9986] = \"NEAREST_MIPMAP_LINEAR\", W[W.LINEAR_MIPMAP_LINEAR = 9987] = \"LINEAR_MIPMAP_LINEAR\";\n      }(O || (O = {})), function(W) {\n        W[W.ALPHA = 6406] = \"ALPHA\", W[W.RGB = 6407] = \"RGB\", W[W.RGBA = 6408] = \"RGBA\", W[W.LUMINANCE = 6409] = \"LUMINANCE\", W[W.LUMINANCE_ALPHA = 6410] = \"LUMINANCE_ALPHA\";\n      }(x || (x = {})), function(W) {\n        W[W.FRONT = 1028] = \"FRONT\", W[W.BACK = 1029] = \"BACK\", W[W.FRONT_AND_BACK = 1032] = \"FRONT_AND_BACK\";\n      }(m || (m = {})), function(W) {\n        W[W.ZERO = 0] = \"ZERO\", W[W.ONE = 1] = \"ONE\", W[W.SRC_COLOR = 768] = \"SRC_COLOR\", W[W.ONE_MINUS_SRC_COLOR = 769] = \"ONE_MINUS_SRC_COLOR\", W[W.DST_COLOR = 774] = \"DST_COLOR\", W[W.ONE_MINUS_DST_COLOR = 775] = \"ONE_MINUS_DST_COLOR\", W[W.SRC_ALPHA = 770] = \"SRC_ALPHA\", W[W.ONE_MINUS_SRC_ALPHA = 771] = \"ONE_MINUS_SRC_ALPHA\", W[W.DST_ALPHA = 772] = \"DST_ALPHA\", W[W.ONE_MINUS_DST_ALPHA = 773] = \"ONE_MINUS_DST_ALPHA\", W[W.CONSTANT_COLOR = 32769] = \"CONSTANT_COLOR\", W[W.ONE_MINUS_CONSTANT_COLOR = 32770] = \"ONE_MINUS_CONSTANT_COLOR\", W[W.CONSTANT_ALPHA = 32771] = \"CONSTANT_ALPHA\", W[W.ONE_MINUS_CONSTANT_ALPHA = 32772] = \"ONE_MINUS_CONSTANT_ALPHA\", W[W.SRC_ALPHA_SATURATE = 776] = \"SRC_ALPHA_SATURATE\";\n      }(c || (c = {}));\n      var S, E = V(0), g = function() {\n        function W() {\n        }\n        return W.SetMatrix = function(q, he, ge, me, _e) {\n          var ye = null;\n          if (ge.semantic === \"MODEL\" ? ye = he.getWorldMatrix() : ge.semantic === \"PROJECTION\" ? ye = q.getProjectionMatrix() : ge.semantic === \"VIEW\" ? ye = q.getViewMatrix() : ge.semantic === \"MODELVIEWINVERSETRANSPOSE\" ? ye = E.Matrix.Transpose(he.getWorldMatrix().multiply(q.getViewMatrix()).invert()) : ge.semantic === \"MODELVIEW\" ? ye = he.getWorldMatrix().multiply(q.getViewMatrix()) : ge.semantic === \"MODELVIEWPROJECTION\" ? ye = he.getWorldMatrix().multiply(q.getTransformMatrix()) : ge.semantic === \"MODELINVERSE\" ? ye = he.getWorldMatrix().invert() : ge.semantic === \"VIEWINVERSE\" ? ye = q.getViewMatrix().invert() : ge.semantic === \"PROJECTIONINVERSE\" ? ye = q.getProjectionMatrix().invert() : ge.semantic === \"MODELVIEWINVERSE\" ? ye = he.getWorldMatrix().multiply(q.getViewMatrix()).invert() : ge.semantic === \"MODELVIEWPROJECTIONINVERSE\" ? ye = he.getWorldMatrix().multiply(q.getTransformMatrix()).invert() : ge.semantic === \"MODELINVERSETRANSPOSE\" && (ye = E.Matrix.Transpose(he.getWorldMatrix().invert())), ye)\n            switch (ge.type) {\n              case u.FLOAT_MAT2:\n                _e.setMatrix2x2(me, E.Matrix.GetAsMatrix2x2(ye));\n                break;\n              case u.FLOAT_MAT3:\n                _e.setMatrix3x3(me, E.Matrix.GetAsMatrix3x3(ye));\n                break;\n              case u.FLOAT_MAT4:\n                _e.setMatrix(me, ye);\n            }\n        }, W.SetUniform = function(q, he, ge, me) {\n          switch (me) {\n            case u.FLOAT:\n              return q.setFloat(he, ge), !0;\n            case u.FLOAT_VEC2:\n              return q.setVector2(he, E.Vector2.FromArray(ge)), !0;\n            case u.FLOAT_VEC3:\n              return q.setVector3(he, E.Vector3.FromArray(ge)), !0;\n            case u.FLOAT_VEC4:\n              return q.setVector4(he, E.Vector4.FromArray(ge)), !0;\n            default:\n              return !1;\n          }\n        }, W.GetWrapMode = function(q) {\n          switch (q) {\n            case I.CLAMP_TO_EDGE:\n              return E.Texture.CLAMP_ADDRESSMODE;\n            case I.MIRRORED_REPEAT:\n              return E.Texture.MIRROR_ADDRESSMODE;\n            case I.REPEAT:\n            default:\n              return E.Texture.WRAP_ADDRESSMODE;\n          }\n        }, W.GetByteStrideFromType = function(q) {\n          switch (q.type) {\n            case \"VEC2\":\n              return 2;\n            case \"VEC3\":\n              return 3;\n            case \"VEC4\":\n            case \"MAT2\":\n              return 4;\n            case \"MAT3\":\n              return 9;\n            case \"MAT4\":\n              return 16;\n            default:\n              return 1;\n          }\n        }, W.GetTextureFilterMode = function(q) {\n          switch (q) {\n            case O.LINEAR:\n            case O.LINEAR_MIPMAP_NEAREST:\n            case O.LINEAR_MIPMAP_LINEAR:\n              return E.Texture.TRILINEAR_SAMPLINGMODE;\n            case O.NEAREST:\n            case O.NEAREST_MIPMAP_NEAREST:\n              return E.Texture.NEAREST_SAMPLINGMODE;\n            default:\n              return E.Texture.BILINEAR_SAMPLINGMODE;\n          }\n        }, W.GetBufferFromBufferView = function(q, he, ge, me, _e) {\n          ge = he.byteOffset + ge;\n          var ye = q.loadedBufferViews[he.buffer];\n          if (ge + me > ye.byteLength)\n            throw new Error(\"Buffer access is out of range\");\n          var Pe = ye.buffer;\n          switch (ge += ye.byteOffset, _e) {\n            case _.BYTE:\n              return new Int8Array(Pe, ge, me);\n            case _.UNSIGNED_BYTE:\n              return new Uint8Array(Pe, ge, me);\n            case _.SHORT:\n              return new Int16Array(Pe, ge, me);\n            case _.UNSIGNED_SHORT:\n              return new Uint16Array(Pe, ge, me);\n            default:\n              return new Float32Array(Pe, ge, me);\n          }\n        }, W.GetBufferFromAccessor = function(q, he) {\n          var ge = q.bufferViews[he.bufferView], me = he.count * W.GetByteStrideFromType(he);\n          return W.GetBufferFromBufferView(q, ge, he.byteOffset, me, he.componentType);\n        }, W.DecodeBufferToText = function(q) {\n          for (var he = \"\", ge = q.byteLength, me = 0; me < ge; ++me)\n            he += String.fromCharCode(q[me]);\n          return he;\n        }, W.GetDefaultMaterial = function(q) {\n          if (!W._DefaultMaterial) {\n            E.Effect.ShadersStore.GLTFDefaultMaterialVertexShader = [\"precision highp float;\", \"\", \"uniform mat4 worldView;\", \"uniform mat4 projection;\", \"\", \"attribute vec3 position;\", \"\", \"void main(void)\", \"{\", \"    gl_Position = projection * worldView * vec4(position, 1.0);\", \"}\"].join(`\n`), E.Effect.ShadersStore.GLTFDefaultMaterialPixelShader = [\"precision highp float;\", \"\", \"uniform vec4 u_emission;\", \"\", \"void main(void)\", \"{\", \"    gl_FragColor = u_emission;\", \"}\"].join(`\n`);\n            var he = { attributes: [\"position\"], uniforms: [\"worldView\", \"projection\", \"u_emission\"], samplers: new Array(), needAlphaBlending: !1 };\n            W._DefaultMaterial = new E.ShaderMaterial(\"GLTFDefaultMaterial\", q, { vertex: \"GLTFDefaultMaterial\", fragment: \"GLTFDefaultMaterial\" }, he), W._DefaultMaterial.setColor4(\"u_emission\", new E.Color4(0.5, 0.5, 0.5, 1));\n          }\n          return W._DefaultMaterial;\n        }, W._DefaultMaterial = null, W;\n      }(), l = V(2);\n      (function(W) {\n        W[W.IDENTIFIER = 1] = \"IDENTIFIER\", W[W.UNKNOWN = 2] = \"UNKNOWN\", W[W.END_OF_INPUT = 3] = \"END_OF_INPUT\";\n      })(S || (S = {}));\n      var h = function() {\n        function W(q) {\n          this._pos = 0, this.currentToken = S.UNKNOWN, this.currentIdentifier = \"\", this.currentString = \"\", this.isLetterOrDigitPattern = /^[a-zA-Z0-9]+$/, this._toParse = q, this._maxPos = q.length;\n        }\n        return W.prototype.getNextToken = function() {\n          if (this.isEnd())\n            return S.END_OF_INPUT;\n          if (this.currentString = this.read(), this.currentToken = S.UNKNOWN, this.currentString === \"_\" || this.isLetterOrDigitPattern.test(this.currentString))\n            for (this.currentToken = S.IDENTIFIER, this.currentIdentifier = this.currentString; !this.isEnd() && (this.isLetterOrDigitPattern.test(this.currentString = this.peek()) || this.currentString === \"_\"); )\n              this.currentIdentifier += this.currentString, this.forward();\n          return this.currentToken;\n        }, W.prototype.peek = function() {\n          return this._toParse[this._pos];\n        }, W.prototype.read = function() {\n          return this._toParse[this._pos++];\n        }, W.prototype.forward = function() {\n          this._pos++;\n        }, W.prototype.isEnd = function() {\n          return this._pos >= this._maxPos;\n        }, W;\n      }(), v = [\"MODEL\", \"VIEW\", \"PROJECTION\", \"MODELVIEW\", \"MODELVIEWPROJECTION\", \"JOINTMATRIX\"], b = [\"world\", \"view\", \"projection\", \"worldView\", \"worldViewProjection\", \"mBones\"], D = [\"translation\", \"rotation\", \"scale\"], w = [\"position\", \"rotationQuaternion\", \"scaling\"], N = function(W, q, he) {\n        for (var ge in W) {\n          var me = W[ge];\n          he[q][ge] = me;\n        }\n      }, M = function(W) {\n        if (W)\n          for (var q = 0; q < W.length / 2; q++)\n            W[2 * q + 1] = 1 - W[2 * q + 1];\n      }, U = function(W) {\n        if (W.semantic === \"NORMAL\")\n          return \"normal\";\n        if (W.semantic === \"POSITION\")\n          return \"position\";\n        if (W.semantic === \"JOINT\")\n          return \"matricesIndices\";\n        if (W.semantic === \"WEIGHT\")\n          return \"matricesWeights\";\n        if (W.semantic === \"COLOR\")\n          return \"color\";\n        if (W.semantic && W.semantic.indexOf(\"TEXCOORD_\") !== -1) {\n          var q = Number(W.semantic.split(\"_\")[1]);\n          return \"uv\" + (q === 0 ? \"\" : q + 1);\n        }\n        return null;\n      }, X = function(W) {\n        var q = null;\n        if (W.translation || W.rotation || W.scale) {\n          var he = E.Vector3.FromArray(W.scale || [1, 1, 1]), ge = E.Quaternion.FromArray(W.rotation || [0, 0, 0, 1]), me = E.Vector3.FromArray(W.translation || [0, 0, 0]);\n          q = E.Matrix.Compose(he, ge, me);\n        } else\n          q = E.Matrix.FromArray(W.matrix);\n        return q;\n      }, j = function(W, q, he, ge) {\n        for (var me = 0; me < ge.bones.length; me++)\n          if (ge.bones[me].name === he)\n            return ge.bones[me];\n        var _e = W.nodes;\n        for (var ye in _e) {\n          var Pe = _e[ye];\n          if (Pe.jointName) {\n            var be = Pe.children;\n            for (me = 0; me < be.length; me++) {\n              var Fe = W.nodes[be[me]];\n              if (Fe.jointName && Fe.jointName === he) {\n                var ke = X(Pe), We = new E.Bone(Pe.name || \"\", ge, j(W, q, Pe.jointName, ge), ke);\n                return We.id = ye, We;\n              }\n            }\n          }\n        }\n        return null;\n      }, ne = function(W, q) {\n        for (var he = 0; he < W.length; he++)\n          for (var ge = W[he], me = 0; me < ge.node.children.length; me++)\n            if (ge.node.children[me] === q)\n              return ge.bone;\n        return null;\n      }, te = function(W, q) {\n        var he = W.nodes, ge = he[q];\n        if (ge)\n          return { node: ge, id: q };\n        for (var me in he)\n          if ((ge = he[me]).jointName === q)\n            return { node: ge, id: me };\n        return null;\n      }, de = function(W, q) {\n        for (var he = 0; he < W.jointNames.length; he++)\n          if (W.jointNames[he] === q)\n            return !0;\n        return !1;\n      }, pe = function(W, q, he, ge, me) {\n        if (ge || (ge = new E.Skeleton(q.name || \"\", \"\", W.scene)), !q.babylonSkeleton)\n          return ge;\n        var _e = [], ye = [];\n        (function(pt, Tt, Lt, Ot) {\n          for (var St in pt.nodes) {\n            var Ct = pt.nodes[St], nn = St;\n            if (Ct.jointName && !de(Lt, Ct.jointName)) {\n              var Qt = X(Ct), $t = new E.Bone(Ct.name || \"\", Tt, null, Qt);\n              $t.id = nn, Ot.push({ bone: $t, node: Ct, id: nn });\n            }\n          }\n          for (var Ie = 0; Ie < Ot.length; Ie++)\n            for (var Sn = Ot[Ie], en = Sn.node.children, An = 0; An < en.length; An++) {\n              for (var Ue = null, Pn = 0; Pn < Ot.length; Pn++)\n                if (Ot[Pn].id === en[An]) {\n                  Ue = Ot[Pn];\n                  break;\n                }\n              Ue && (Ue.bone._parent = Sn.bone, Sn.bone.children.push(Ue.bone));\n            }\n        })(W, ge, q, _e), ge.bones = [];\n        for (var Pe = 0; Pe < q.jointNames.length; Pe++)\n          if (at = te(W, q.jointNames[Pe])) {\n            var be = at.node;\n            if (be) {\n              me = at.id;\n              var Fe = W.scene.getBoneByID(me);\n              if (Fe)\n                ge.bones.push(Fe);\n              else {\n                for (var ke = !1, We = null, je = 0; je < Pe; je++) {\n                  var He = te(W, q.jointNames[je]);\n                  if (He) {\n                    var Qe = He.node;\n                    if (Qe) {\n                      var Ge = Qe.children;\n                      if (Ge) {\n                        ke = !1;\n                        for (var tt = 0; tt < Ge.length; tt++)\n                          if (Ge[tt] === me) {\n                            We = j(W, q, q.jointNames[je], ge), ke = !0;\n                            break;\n                          }\n                        if (ke)\n                          break;\n                      }\n                    } else\n                      E.Tools.Warn(\"Joint named \" + q.jointNames[je] + \" does not exist when looking for parent\");\n                  }\n                }\n                var Je = X(be);\n                !We && _e.length > 0 && (We = ne(_e, me)) && ye.indexOf(We) === -1 && ye.push(We), new E.Bone(be.jointName || \"\", ge, We, Je).id = me;\n              }\n            } else\n              E.Tools.Warn(\"Joint named \" + q.jointNames[Pe] + \" does not exist\");\n          }\n        var st = ge.bones;\n        for (ge.bones = [], Pe = 0; Pe < q.jointNames.length; Pe++) {\n          var at;\n          if (at = te(W, q.jointNames[Pe])) {\n            for (je = 0; je < st.length; je++)\n              if (st[je].id === at.id) {\n                ge.bones.push(st[je]);\n                break;\n              }\n          }\n        }\n        for (ge.prepare(), Pe = 0; Pe < ye.length; Pe++)\n          ge.bones.push(ye[Pe]);\n        return ge;\n      }, ae = function(W, q, he, ge, me) {\n        if (me || (W.scene._blockEntityCollection = W.forAssetContainer, me = new E.Mesh(q.name || \"\", W.scene), W.scene._blockEntityCollection = !1, me.id = ge), !q.babylonNode)\n          return me;\n        for (var _e, ye = [], Pe = null, be = new Array(), Fe = new Array(), ke = new Array(), We = new Array(), je = 0; je < he.length; je++) {\n          var He = he[je];\n          if ($t = W.meshes[He])\n            for (var Qe = 0; Qe < $t.primitives.length; Qe++) {\n              var Ge = new E.VertexData(), tt = $t.primitives[Qe];\n              tt.mode;\n              var Je = tt.attributes, st = null, at = null;\n              for (var pt in Je)\n                if (st = W.accessors[Je[pt]], at = g.GetBufferFromAccessor(W, st), pt === \"NORMAL\")\n                  Ge.normals = new Float32Array(at.length), Ge.normals.set(at);\n                else if (pt === \"POSITION\") {\n                  if (l.GLTFFileLoader.HomogeneousCoordinates) {\n                    Ge.positions = new Float32Array(at.length - at.length / 4);\n                    for (var Tt = 0; Tt < at.length; Tt += 4)\n                      Ge.positions[Tt] = at[Tt], Ge.positions[Tt + 1] = at[Tt + 1], Ge.positions[Tt + 2] = at[Tt + 2];\n                  } else\n                    Ge.positions = new Float32Array(at.length), Ge.positions.set(at);\n                  Fe.push(Ge.positions.length);\n                } else if (pt.indexOf(\"TEXCOORD_\") !== -1) {\n                  var Lt = Number(pt.split(\"_\")[1]), Ot = E.VertexBuffer.UVKind + (Lt === 0 ? \"\" : Lt + 1), St = new Float32Array(at.length);\n                  St.set(at), M(St), Ge.set(St, Ot);\n                } else\n                  pt === \"JOINT\" ? (Ge.matricesIndices = new Float32Array(at.length), Ge.matricesIndices.set(at)) : pt === \"WEIGHT\" ? (Ge.matricesWeights = new Float32Array(at.length), Ge.matricesWeights.set(at)) : pt === \"COLOR\" && (Ge.colors = new Float32Array(at.length), Ge.colors.set(at));\n              if (st = W.accessors[tt.indices])\n                at = g.GetBufferFromAccessor(W, st), Ge.indices = new Int32Array(at.length), Ge.indices.set(at), We.push(Ge.indices.length);\n              else {\n                var Ct = [];\n                for (Tt = 0; Tt < Ge.positions.length / 3; Tt++)\n                  Ct.push(Tt);\n                Ge.indices = new Int32Array(Ct), We.push(Ge.indices.length);\n              }\n              Pe ? Pe.merge(Ge) : Pe = Ge;\n              var nn = W.scene.getMaterialByID(tt.material);\n              ye.push(nn === null ? g.GetDefaultMaterial(W.scene) : nn), be.push(be.length === 0 ? 0 : be[be.length - 1] + Fe[Fe.length - 2]), ke.push(ke.length === 0 ? 0 : ke[ke.length - 1] + We[We.length - 2]);\n            }\n        }\n        W.scene._blockEntityCollection = W.forAssetContainer, ye.length > 1 ? (_e = new E.MultiMaterial(\"multimat\" + ge, W.scene)).subMaterials = ye : _e = new E.StandardMaterial(\"multimat\" + ge, W.scene), ye.length === 1 && (_e = ye[0]), me.material || (me.material = _e), new E.Geometry(ge, W.scene, Pe, !1, me), me.computeWorldMatrix(!0), W.scene._blockEntityCollection = !1, me.subMeshes = [];\n        var Qt = 0;\n        for (je = 0; je < he.length; je++) {\n          var $t;\n          if (He = he[je], $t = W.meshes[He])\n            for (Qe = 0; Qe < $t.primitives.length; Qe++)\n              $t.primitives[Qe].mode, E.SubMesh.AddToMesh(Qt, be[Qt], Fe[Qt], ke[Qt], We[Qt], me, me, !0), Qt++;\n        }\n        return me;\n      }, ee = function(W, q, he, ge) {\n        W.position && (W.position = q), (W.rotationQuaternion || W.rotation) && (W.rotationQuaternion = he), W.scaling && (W.scaling = ge);\n      }, K = function(W, q, he, ge) {\n        var me = null;\n        if (W.importOnlyMeshes && (q.skin || q.meshes) && W.importMeshesNames && W.importMeshesNames.length > 0 && W.importMeshesNames.indexOf(q.name || \"\") === -1)\n          return null;\n        if (q.skin) {\n          if (q.meshes) {\n            var _e = W.skins[q.skin];\n            (ye = ae(W, q, q.meshes, he, q.babylonNode)).skeleton = W.scene.getLastSkeletonByID(q.skin), ye.skeleton === null && (ye.skeleton = pe(W, _e, 0, _e.babylonSkeleton, q.skin), _e.babylonSkeleton || (_e.babylonSkeleton = ye.skeleton)), me = ye;\n          }\n        } else if (q.meshes) {\n          var ye;\n          me = ye = ae(W, q, q.mesh ? [q.mesh] : q.meshes, he, q.babylonNode);\n        } else if (!q.light || q.babylonNode || W.importOnlyMeshes) {\n          if (q.camera && !q.babylonNode && !W.importOnlyMeshes) {\n            var Pe = W.cameras[q.camera];\n            if (Pe) {\n              if (W.scene._blockEntityCollection = W.forAssetContainer, Pe.type === \"orthographic\") {\n                var be = new E.FreeCamera(q.camera, E.Vector3.Zero(), W.scene, !1);\n                be.name = q.name || \"\", be.mode = E.Camera.ORTHOGRAPHIC_CAMERA, be.attachControl(), me = be;\n              } else if (Pe.type === \"perspective\") {\n                var Fe = Pe[Pe.type], ke = new E.FreeCamera(q.camera, E.Vector3.Zero(), W.scene, !1);\n                ke.name = q.name || \"\", ke.attachControl(), Fe.aspectRatio || (Fe.aspectRatio = W.scene.getEngine().getRenderWidth() / W.scene.getEngine().getRenderHeight()), Fe.znear && Fe.zfar && (ke.maxZ = Fe.zfar, ke.minZ = Fe.znear), me = ke;\n              }\n              W.scene._blockEntityCollection = !1;\n            }\n          }\n        } else {\n          var We = W.lights[q.light];\n          if (We) {\n            if (We.type === \"ambient\") {\n              var je = We[We.type], He = new E.HemisphericLight(q.light, E.Vector3.Zero(), W.scene);\n              He.name = q.name || \"\", je.color && (He.diffuse = E.Color3.FromArray(je.color)), me = He;\n            } else if (We.type === \"directional\") {\n              var Qe = We[We.type], Ge = new E.DirectionalLight(q.light, E.Vector3.Zero(), W.scene);\n              Ge.name = q.name || \"\", Qe.color && (Ge.diffuse = E.Color3.FromArray(Qe.color)), me = Ge;\n            } else if (We.type === \"point\") {\n              var tt = We[We.type], Je = new E.PointLight(q.light, E.Vector3.Zero(), W.scene);\n              Je.name = q.name || \"\", tt.color && (Je.diffuse = E.Color3.FromArray(tt.color)), me = Je;\n            } else if (We.type === \"spot\") {\n              var st = We[We.type], at = new E.SpotLight(q.light, E.Vector3.Zero(), E.Vector3.Zero(), 0, 0, W.scene);\n              at.name = q.name || \"\", st.color && (at.diffuse = E.Color3.FromArray(st.color)), st.fallOfAngle && (at.angle = st.fallOfAngle), st.fallOffExponent && (at.exponent = st.fallOffExponent), me = at;\n            }\n          }\n        }\n        if (!q.jointName) {\n          if (q.babylonNode)\n            return q.babylonNode;\n          if (me === null) {\n            W.scene._blockEntityCollection = W.forAssetContainer;\n            var pt = new E.Mesh(q.name || \"\", W.scene);\n            W.scene._blockEntityCollection = !1, q.babylonNode = pt, me = pt;\n          }\n        }\n        if (me !== null) {\n          if (q.matrix && me instanceof E.Mesh)\n            (function(St, Ct, nn) {\n              if (Ct.matrix) {\n                var Qt = new E.Vector3(0, 0, 0), $t = new E.Quaternion(), Ie = new E.Vector3(0, 0, 0);\n                E.Matrix.FromArray(Ct.matrix).decompose(Ie, $t, Qt), ee(St, Qt, $t, Ie);\n              } else\n                Ct.translation && Ct.rotation && Ct.scale && ee(St, E.Vector3.FromArray(Ct.translation), E.Quaternion.FromArray(Ct.rotation), E.Vector3.FromArray(Ct.scale));\n              St.computeWorldMatrix(!0);\n            })(me, q);\n          else {\n            var Tt = q.translation || [0, 0, 0], Lt = q.rotation || [0, 0, 0, 1], Ot = q.scale || [1, 1, 1];\n            ee(me, E.Vector3.FromArray(Tt), E.Quaternion.FromArray(Lt), E.Vector3.FromArray(Ot));\n          }\n          me.updateCache(!0), q.babylonNode = me;\n        }\n        return me;\n      }, $ = function(W, q, he, ge) {\n        ge === void 0 && (ge = !1);\n        var me = W.nodes[q], _e = null;\n        if (ge = !(W.importOnlyMeshes && !ge && W.importMeshesNames) || W.importMeshesNames.indexOf(me.name || \"\") !== -1 || W.importMeshesNames.length === 0, !me.jointName && ge && (_e = K(W, me, q)) !== null && (_e.id = q, _e.parent = he), me.children)\n          for (var ye = 0; ye < me.children.length; ye++)\n            $(W, me.children[ye], _e, ge);\n      }, L = function(W) {\n        var q = W.currentScene;\n        if (q)\n          for (var he = 0; he < q.nodes.length; he++)\n            $(W, q.nodes[he], null);\n        else\n          for (var ge in W.scenes)\n            for (q = W.scenes[ge], he = 0; he < q.nodes.length; he++)\n              $(W, q.nodes[he], null);\n        for (function(_e) {\n          for (var ye in _e.animations) {\n            var Pe = _e.animations[ye];\n            if (Pe.channels && Pe.samplers)\n              for (var be = null, Fe = 0; Fe < Pe.channels.length; Fe++) {\n                var ke = Pe.channels[Fe], We = Pe.samplers[ke.sampler];\n                if (We) {\n                  var je = null, He = null;\n                  Pe.parameters ? (je = Pe.parameters[We.input], He = Pe.parameters[We.output]) : (je = We.input, He = We.output);\n                  var Qe = g.GetBufferFromAccessor(_e, _e.accessors[je]), Ge = g.GetBufferFromAccessor(_e, _e.accessors[He]), tt = ke.target.id, Je = _e.scene.getNodeByID(tt);\n                  if (Je === null && (Je = _e.scene.getNodeByName(tt)), Je !== null) {\n                    var st = Je instanceof E.Bone, at = ke.target.path, pt = D.indexOf(at);\n                    pt !== -1 && (at = w[pt]);\n                    var Tt = E.Animation.ANIMATIONTYPE_MATRIX;\n                    st || (at === \"rotationQuaternion\" ? (Tt = E.Animation.ANIMATIONTYPE_QUATERNION, Je.rotationQuaternion = new E.Quaternion()) : Tt = E.Animation.ANIMATIONTYPE_VECTOR3);\n                    var Lt = null, Ot = [], St = 0, Ct = !1;\n                    st && be && be.getKeys().length === Qe.length && (Lt = be, Ct = !0), Ct || (_e.scene._blockEntityCollection = _e.forAssetContainer, Lt = new E.Animation(ye, st ? \"_matrix\" : at, 1, Tt, E.Animation.ANIMATIONLOOPMODE_CYCLE), _e.scene._blockEntityCollection = !1);\n                    for (var nn = 0; nn < Qe.length; nn++) {\n                      var Qt = null;\n                      if (at === \"rotationQuaternion\" ? (Qt = E.Quaternion.FromArray([Ge[St], Ge[St + 1], Ge[St + 2], Ge[St + 3]]), St += 4) : (Qt = E.Vector3.FromArray([Ge[St], Ge[St + 1], Ge[St + 2]]), St += 3), st) {\n                        var $t = Je, Ie = E.Vector3.Zero(), Sn = new E.Quaternion(), en = E.Vector3.Zero(), An = $t.getBaseMatrix();\n                        Ct && be && (An = be.getKeys()[nn].value), An.decompose(en, Sn, Ie), at === \"position\" ? Ie = Qt : at === \"rotationQuaternion\" ? Sn = Qt : en = Qt, Qt = E.Matrix.Compose(en, Sn, Ie);\n                      }\n                      Ct ? be && (be.getKeys()[nn].value = Qt) : Ot.push({ frame: Qe[nn], value: Qt });\n                    }\n                    !Ct && Lt && (Lt.setKeys(Ot), Je.animations.push(Lt)), be = Lt, _e.scene.stopAnimation(Je), _e.scene.beginAnimation(Je, 0, Qe[Qe.length - 1], !0, 1);\n                  } else\n                    E.Tools.Warn(\"Creating animation named \" + ye + \". But cannot find node named \" + tt + \" to attach to\");\n                }\n              }\n          }\n        }(W), he = 0; he < W.scene.skeletons.length; he++) {\n          var me = W.scene.skeletons[he];\n          W.scene.beginAnimation(me, 0, Number.MAX_VALUE, !0, 1);\n        }\n      }, G = function(W, q, he, ge, me, _e) {\n        return function(ye) {\n          (function(Pe, be, Fe, ke, We) {\n            var je = ke.values || Fe.parameters, He = Fe.uniforms;\n            for (var Qe in We) {\n              var Ge = We[Qe], tt = Ge.type, Je = je[He[Qe]];\n              if (Je === void 0 && (Je = Ge.value), Je) {\n                var st = function(at) {\n                  return function(pt) {\n                    Ge.value && at && (be.setTexture(at, pt), delete We[at]);\n                  };\n                };\n                tt === u.SAMPLER_2D ? k.LoadTextureAsync(Pe, ke.values ? Je : Ge.value, st(Qe), function() {\n                  return st(null);\n                }) : Ge.value && g.SetUniform(be, Qe, ke.values ? Je : Ge.value, tt) && delete We[Qe];\n              }\n            }\n          })(W, q, he, ge, me), q.onBind = function(Pe) {\n            (function(be, Fe, ke, We, je, He, Qe) {\n              var Ge = He.values || je.parameters;\n              for (var tt in ke) {\n                var Je = ke[tt], st = Je.type;\n                if (st === u.FLOAT_MAT2 || st === u.FLOAT_MAT3 || st === u.FLOAT_MAT4)\n                  if (!Je.semantic || Je.source || Je.node) {\n                    if (Je.semantic && (Je.source || Je.node)) {\n                      var at = Fe.scene.getNodeByName(Je.source || Je.node || \"\");\n                      if (at === null && (at = Fe.scene.getNodeByID(Je.source || Je.node || \"\")), at === null)\n                        continue;\n                      g.SetMatrix(Fe.scene, at, Je, tt, We.getEffect());\n                    }\n                  } else\n                    g.SetMatrix(Fe.scene, be, Je, tt, We.getEffect());\n                else {\n                  var pt = Ge[je.uniforms[tt]];\n                  if (!pt)\n                    continue;\n                  if (st === u.SAMPLER_2D) {\n                    var Tt = Fe.textures[He.values ? pt : Je.value].babylonTexture;\n                    if (Tt == null)\n                      continue;\n                    We.getEffect().setTexture(tt, Tt);\n                  } else\n                    g.SetUniform(We.getEffect(), tt, pt, st);\n                }\n              }\n              Qe(We);\n            })(Pe, W, me, q, he, ge, _e);\n          };\n        };\n      }, Q = function(W, q, he) {\n        for (var ge in q.uniforms) {\n          var me = q.uniforms[ge], _e = q.parameters[me];\n          if (W.currentIdentifier === ge && _e.semantic && !_e.source && !_e.node) {\n            var ye = v.indexOf(_e.semantic);\n            if (ye !== -1)\n              return delete he[ge], b[ye];\n          }\n        }\n        return W.currentIdentifier;\n      }, oe = function(W) {\n        for (var q in W.materials)\n          k.LoadMaterialAsync(W, q, function(he) {\n          }, function() {\n          });\n      }, re = function() {\n        function W() {\n        }\n        return W.CreateRuntime = function(q, he, ge) {\n          var me = { extensions: {}, accessors: {}, buffers: {}, bufferViews: {}, meshes: {}, lights: {}, cameras: {}, nodes: {}, images: {}, textures: {}, shaders: {}, programs: {}, samplers: {}, techniques: {}, materials: {}, animations: {}, skins: {}, extensionsUsed: [], scenes: {}, buffersCount: 0, shaderscount: 0, scene: he, rootUrl: ge, loadedBufferCount: 0, loadedBufferViews: {}, loadedShaderCount: 0, importOnlyMeshes: !1, dummyNodes: [], forAssetContainer: !1 };\n          return q.extensions && N(q.extensions, \"extensions\", me), q.extensionsUsed && N(q.extensionsUsed, \"extensionsUsed\", me), q.buffers && function(_e, ye) {\n            for (var Pe in _e) {\n              var be = _e[Pe];\n              ye.buffers[Pe] = be, ye.buffersCount++;\n            }\n          }(q.buffers, me), q.bufferViews && N(q.bufferViews, \"bufferViews\", me), q.accessors && N(q.accessors, \"accessors\", me), q.meshes && N(q.meshes, \"meshes\", me), q.lights && N(q.lights, \"lights\", me), q.cameras && N(q.cameras, \"cameras\", me), q.nodes && N(q.nodes, \"nodes\", me), q.images && N(q.images, \"images\", me), q.textures && N(q.textures, \"textures\", me), q.shaders && function(_e, ye) {\n            for (var Pe in _e) {\n              var be = _e[Pe];\n              ye.shaders[Pe] = be, ye.shaderscount++;\n            }\n          }(q.shaders, me), q.programs && N(q.programs, \"programs\", me), q.samplers && N(q.samplers, \"samplers\", me), q.techniques && N(q.techniques, \"techniques\", me), q.materials && N(q.materials, \"materials\", me), q.animations && N(q.animations, \"animations\", me), q.skins && N(q.skins, \"skins\", me), q.scenes && (me.scenes = q.scenes), q.scene && q.scenes && (me.currentScene = q.scenes[q.scene]), me;\n        }, W.LoadBufferAsync = function(q, he, ge, me, _e) {\n          var ye = q.buffers[he];\n          E.Tools.IsBase64(ye.uri) ? setTimeout(function() {\n            return ge(new Uint8Array(E.Tools.DecodeBase64(ye.uri)));\n          }) : E.Tools.LoadFile(q.rootUrl + ye.uri, function(Pe) {\n            return ge(new Uint8Array(Pe));\n          }, _e, void 0, !0, function(Pe) {\n            Pe && me(Pe.status + \" \" + Pe.statusText);\n          });\n        }, W.LoadTextureBufferAsync = function(q, he, ge, me) {\n          var _e = q.textures[he];\n          if (_e && _e.source)\n            if (_e.babylonTexture)\n              ge(null);\n            else {\n              var ye = q.images[_e.source];\n              E.Tools.IsBase64(ye.uri) ? setTimeout(function() {\n                return ge(new Uint8Array(E.Tools.DecodeBase64(ye.uri)));\n              }) : E.Tools.LoadFile(q.rootUrl + ye.uri, function(Pe) {\n                return ge(new Uint8Array(Pe));\n              }, void 0, void 0, !0, function(Pe) {\n                Pe && me(Pe.status + \" \" + Pe.statusText);\n              });\n            }\n          else\n            me(\"\");\n        }, W.CreateTextureAsync = function(q, he, ge, me, _e) {\n          var ye = q.textures[he];\n          if (ye.babylonTexture)\n            me(ye.babylonTexture);\n          else {\n            var Pe = q.samplers[ye.sampler], be = Pe.minFilter === O.NEAREST_MIPMAP_NEAREST || Pe.minFilter === O.NEAREST_MIPMAP_LINEAR || Pe.minFilter === O.LINEAR_MIPMAP_NEAREST || Pe.minFilter === O.LINEAR_MIPMAP_LINEAR, Fe = E.Texture.BILINEAR_SAMPLINGMODE, ke = ge == null ? new Blob() : new Blob([ge]), We = URL.createObjectURL(ke), je = function() {\n              return URL.revokeObjectURL(We);\n            }, He = new E.Texture(We, q.scene, !be, !0, Fe, je, je);\n            Pe.wrapS !== void 0 && (He.wrapU = g.GetWrapMode(Pe.wrapS)), Pe.wrapT !== void 0 && (He.wrapV = g.GetWrapMode(Pe.wrapT)), He.name = he, ye.babylonTexture = He, me(He);\n          }\n        }, W.LoadShaderStringAsync = function(q, he, ge, me) {\n          var _e = q.shaders[he];\n          if (E.Tools.IsBase64(_e.uri)) {\n            var ye = atob(_e.uri.split(\",\")[1]);\n            ge && ge(ye);\n          } else\n            E.Tools.LoadFile(q.rootUrl + _e.uri, ge, void 0, void 0, !1, function(Pe) {\n              Pe && me && me(Pe.status + \" \" + Pe.statusText);\n            });\n        }, W.LoadMaterialAsync = function(q, he, ge, me) {\n          var _e = q.materials[he];\n          if (_e.technique) {\n            var ye = q.techniques[_e.technique];\n            if (!ye) {\n              q.scene._blockEntityCollection = q.forAssetContainer;\n              var Pe = new E.StandardMaterial(he, q.scene);\n              return q.scene._blockEntityCollection = !1, Pe.diffuseColor = new E.Color3(0.5, 0.5, 0.5), Pe.sideOrientation = E.Material.CounterClockWiseSideOrientation, void ge(Pe);\n            }\n            var be = q.programs[ye.program], Fe = ye.states, ke = E.Effect.ShadersStore[be.vertexShader + \"VertexShader\"], We = E.Effect.ShadersStore[be.fragmentShader + \"PixelShader\"], je = \"\", He = \"\", Qe = new h(ke), Ge = new h(We), tt = {}, Je = [], st = [], at = [];\n            for (var pt in ye.uniforms) {\n              var Tt = ye.uniforms[pt], Lt = ye.parameters[Tt];\n              if (tt[pt] = Lt, !Lt.semantic || Lt.node || Lt.source)\n                Lt.type === u.SAMPLER_2D ? at.push(pt) : Je.push(pt);\n              else {\n                var Ot = v.indexOf(Lt.semantic);\n                Ot !== -1 ? (Je.push(b[Ot]), delete tt[pt]) : Je.push(pt);\n              }\n            }\n            for (var St in ye.attributes) {\n              var Ct = ye.attributes[St];\n              if (($t = ye.parameters[Ct]).semantic) {\n                var nn = U($t);\n                nn && st.push(nn);\n              }\n            }\n            for (; !Qe.isEnd() && Qe.getNextToken(); )\n              if (Qe.currentToken === S.IDENTIFIER) {\n                var Qt = !1;\n                for (var St in ye.attributes) {\n                  Ct = ye.attributes[St];\n                  var $t = ye.parameters[Ct];\n                  if (Qe.currentIdentifier === St && $t.semantic) {\n                    je += U($t), Qt = !0;\n                    break;\n                  }\n                }\n                Qt || (je += Q(Qe, ye, tt));\n              } else\n                je += Qe.currentString;\n            for (; !Ge.isEnd() && Ge.getNextToken(); )\n              Ge.currentToken === S.IDENTIFIER ? He += Q(Ge, ye, tt) : He += Ge.currentString;\n            var Ie = { vertex: be.vertexShader + he, fragment: be.fragmentShader + he }, Sn = { attributes: st, uniforms: Je, samplers: at, needAlphaBlending: Fe && Fe.enable && Fe.enable.indexOf(3042) !== -1 };\n            E.Effect.ShadersStore[be.vertexShader + he + \"VertexShader\"] = je, E.Effect.ShadersStore[be.fragmentShader + he + \"PixelShader\"] = He;\n            var en = new E.ShaderMaterial(he, q.scene, Ie, Sn);\n            if (en.onError = function(Pn, rr, Xe) {\n              return function(En, Qn) {\n                rr.dispose(!0), Xe(\"Cannot compile program named \" + Pn.name + \". Error: \" + Qn + \". Default material will be applied\");\n              };\n            }(be, en, me), en.onCompiled = G(q, en, ye, _e, tt, ge), en.sideOrientation = E.Material.CounterClockWiseSideOrientation, Fe && Fe.functions) {\n              var An = Fe.functions;\n              An.cullFace && An.cullFace[0] !== m.BACK && (en.backFaceCulling = !1);\n              var Ue = An.blendFuncSeparate;\n              Ue && (Ue[0] === c.SRC_ALPHA && Ue[1] === c.ONE_MINUS_SRC_ALPHA && Ue[2] === c.ONE && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_COMBINE : Ue[0] === c.ONE && Ue[1] === c.ONE && Ue[2] === c.ZERO && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_ONEONE : Ue[0] === c.SRC_ALPHA && Ue[1] === c.ONE && Ue[2] === c.ZERO && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_ADD : Ue[0] === c.ZERO && Ue[1] === c.ONE_MINUS_SRC_COLOR && Ue[2] === c.ONE && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_SUBTRACT : Ue[0] === c.DST_COLOR && Ue[1] === c.ZERO && Ue[2] === c.ONE && Ue[3] === c.ONE ? en.alphaMode = E.Constants.ALPHA_MULTIPLY : Ue[0] === c.SRC_ALPHA && Ue[1] === c.ONE_MINUS_SRC_COLOR && Ue[2] === c.ONE && Ue[3] === c.ONE && (en.alphaMode = E.Constants.ALPHA_MAXIMIZED));\n            }\n          } else\n            me && me(\"No technique found.\");\n        }, W;\n      }(), Y = function() {\n        function W() {\n          this.state = null;\n        }\n        return W.RegisterExtension = function(q) {\n          W.Extensions[q.name] ? E.Tools.Error('Tool with the same name \"' + q.name + '\" already exists') : W.Extensions[q.name] = q;\n        }, W.prototype.dispose = function() {\n        }, W.prototype._importMeshAsync = function(q, he, ge, me, _e, ye, Pe, be) {\n          var Fe = this;\n          return he.useRightHandedSystem = !0, k.LoadRuntimeAsync(he, ge, me, function(ke) {\n            ke.forAssetContainer = _e, ke.importOnlyMeshes = !0, q === \"\" ? ke.importMeshesNames = [] : typeof q == \"string\" ? ke.importMeshesNames = [q] : !q || q instanceof Array ? (ke.importMeshesNames = [], E.Tools.Warn(\"Argument meshesNames must be of type string or string[]\")) : ke.importMeshesNames = [q], Fe._createNodes(ke);\n            var We = new Array(), je = new Array();\n            for (var He in ke.nodes) {\n              var Qe = ke.nodes[He];\n              Qe.babylonNode instanceof E.AbstractMesh && We.push(Qe.babylonNode);\n            }\n            for (var Ge in ke.skins) {\n              var tt = ke.skins[Ge];\n              tt.babylonSkeleton instanceof E.Skeleton && je.push(tt.babylonSkeleton);\n            }\n            Fe._loadBuffersAsync(ke, function() {\n              Fe._loadShadersAsync(ke, function() {\n                oe(ke), L(ke), !l.GLTFFileLoader.IncrementalLoading && ye && ye(We, je);\n              });\n            }, Pe), l.GLTFFileLoader.IncrementalLoading && ye && ye(We, je);\n          }, be), !0;\n        }, W.prototype.importMeshAsync = function(q, he, ge, me, _e, ye) {\n          var Pe = this;\n          return new Promise(function(be, Fe) {\n            Pe._importMeshAsync(q, he, me, _e, ge, function(ke, We) {\n              be({ meshes: ke, particleSystems: [], skeletons: We, animationGroups: [], lights: [], transformNodes: [], geometries: [] });\n            }, ye, function(ke) {\n              Fe(new Error(ke));\n            });\n          });\n        }, W.prototype._loadAsync = function(q, he, ge, me, _e, ye, Pe) {\n          var be = this;\n          q.useRightHandedSystem = !0, k.LoadRuntimeAsync(q, he, ge, function(Fe) {\n            k.LoadRuntimeExtensionsAsync(Fe, function() {\n              be._createNodes(Fe), be._loadBuffersAsync(Fe, function() {\n                be._loadShadersAsync(Fe, function() {\n                  oe(Fe), L(Fe), l.GLTFFileLoader.IncrementalLoading || _e();\n                });\n              }), l.GLTFFileLoader.IncrementalLoading && _e();\n            }, Pe);\n          }, Pe);\n        }, W.prototype.loadAsync = function(q, he, ge, me) {\n          var _e = this;\n          return new Promise(function(ye, Pe) {\n            _e._loadAsync(q, he, ge, !1, function() {\n              ye();\n            }, me, function(be) {\n              Pe(new Error(be));\n            });\n          });\n        }, W.prototype._loadShadersAsync = function(q, he) {\n          var ge = !1, me = function(Pe, be) {\n            k.LoadShaderStringAsync(q, Pe, function(Fe) {\n              Fe instanceof ArrayBuffer || (q.loadedShaderCount++, Fe && (E.Effect.ShadersStore[Pe + (be.type === C.VERTEX ? \"VertexShader\" : \"PixelShader\")] = Fe), q.loadedShaderCount === q.shaderscount && he());\n            }, function() {\n              E.Tools.Error(\"Error when loading shader program named \" + Pe + \" located at \" + be.uri);\n            });\n          };\n          for (var _e in q.shaders) {\n            ge = !0;\n            var ye = q.shaders[_e];\n            ye ? me.bind(this, _e, ye)() : E.Tools.Error(\"No shader named: \" + _e);\n          }\n          ge || he();\n        }, W.prototype._loadBuffersAsync = function(q, he, ge) {\n          var me = !1, _e = function(be, Fe) {\n            k.LoadBufferAsync(q, be, function(ke) {\n              q.loadedBufferCount++, ke && (ke.byteLength != q.buffers[be].byteLength && E.Tools.Error(\"Buffer named \" + be + \" is length \" + ke.byteLength + \". Expected: \" + Fe.byteLength), q.loadedBufferViews[be] = ke), q.loadedBufferCount === q.buffersCount && he();\n            }, function() {\n              E.Tools.Error(\"Error when loading buffer named \" + be + \" located at \" + Fe.uri);\n            });\n          };\n          for (var ye in q.buffers) {\n            me = !0;\n            var Pe = q.buffers[ye];\n            Pe ? _e.bind(this, ye, Pe)() : E.Tools.Error(\"No buffer named: \" + ye);\n          }\n          me || he();\n        }, W.prototype._createNodes = function(q) {\n          var he = q.currentScene;\n          if (he)\n            for (var ge = 0; ge < he.nodes.length; ge++)\n              $(q, he.nodes[ge], null);\n          else\n            for (var me in q.scenes)\n              for (he = q.scenes[me], ge = 0; ge < he.nodes.length; ge++)\n                $(q, he.nodes[ge], null);\n        }, W.Extensions = {}, W;\n      }(), k = function() {\n        function W(q) {\n          this._name = q;\n        }\n        return Object.defineProperty(W.prototype, \"name\", { get: function() {\n          return this._name;\n        }, enumerable: !1, configurable: !0 }), W.prototype.loadRuntimeAsync = function(q, he, ge, me, _e) {\n          return !1;\n        }, W.prototype.loadRuntimeExtensionsAsync = function(q, he, ge) {\n          return !1;\n        }, W.prototype.loadBufferAsync = function(q, he, ge, me, _e) {\n          return !1;\n        }, W.prototype.loadTextureBufferAsync = function(q, he, ge, me) {\n          return !1;\n        }, W.prototype.createTextureAsync = function(q, he, ge, me, _e) {\n          return !1;\n        }, W.prototype.loadShaderStringAsync = function(q, he, ge, me) {\n          return !1;\n        }, W.prototype.loadMaterialAsync = function(q, he, ge, me) {\n          return !1;\n        }, W.LoadRuntimeAsync = function(q, he, ge, me, _e) {\n          W.ApplyExtensions(function(ye) {\n            return ye.loadRuntimeAsync(q, he, ge, me, _e);\n          }, function() {\n            setTimeout(function() {\n              me && me(re.CreateRuntime(he.json, q, ge));\n            });\n          });\n        }, W.LoadRuntimeExtensionsAsync = function(q, he, ge) {\n          W.ApplyExtensions(function(me) {\n            return me.loadRuntimeExtensionsAsync(q, he, ge);\n          }, function() {\n            setTimeout(function() {\n              he();\n            });\n          });\n        }, W.LoadBufferAsync = function(q, he, ge, me, _e) {\n          W.ApplyExtensions(function(ye) {\n            return ye.loadBufferAsync(q, he, ge, me, _e);\n          }, function() {\n            re.LoadBufferAsync(q, he, ge, me, _e);\n          });\n        }, W.LoadTextureAsync = function(q, he, ge, me) {\n          W.LoadTextureBufferAsync(q, he, function(_e) {\n            _e && W.CreateTextureAsync(q, he, _e, ge, me);\n          }, me);\n        }, W.LoadShaderStringAsync = function(q, he, ge, me) {\n          W.ApplyExtensions(function(_e) {\n            return _e.loadShaderStringAsync(q, he, ge, me);\n          }, function() {\n            re.LoadShaderStringAsync(q, he, ge, me);\n          });\n        }, W.LoadMaterialAsync = function(q, he, ge, me) {\n          W.ApplyExtensions(function(_e) {\n            return _e.loadMaterialAsync(q, he, ge, me);\n          }, function() {\n            re.LoadMaterialAsync(q, he, ge, me);\n          });\n        }, W.LoadTextureBufferAsync = function(q, he, ge, me) {\n          W.ApplyExtensions(function(_e) {\n            return _e.loadTextureBufferAsync(q, he, ge, me);\n          }, function() {\n            re.LoadTextureBufferAsync(q, he, ge, me);\n          });\n        }, W.CreateTextureAsync = function(q, he, ge, me, _e) {\n          W.ApplyExtensions(function(ye) {\n            return ye.createTextureAsync(q, he, ge, me, _e);\n          }, function() {\n            re.CreateTextureAsync(q, he, ge, me, _e);\n          });\n        }, W.ApplyExtensions = function(q, he) {\n          for (var ge in Y.Extensions)\n            if (q(Y.Extensions[ge]))\n              return;\n          he();\n        }, W;\n      }();\n      l.GLTFFileLoader._CreateGLTF1Loader = function() {\n        return new Y();\n      };\n      var H = function(W) {\n        function q() {\n          return W.call(this, \"KHR_binary_glTF\") || this;\n        }\n        return Object(T.b)(q, W), q.prototype.loadRuntimeAsync = function(he, ge, me, _e, ye) {\n          var Pe = ge.json.extensionsUsed;\n          return !(!Pe || Pe.indexOf(this.name) === -1 || !ge.bin) && (this._bin = ge.bin, _e(re.CreateRuntime(ge.json, he, me)), !0);\n        }, q.prototype.loadBufferAsync = function(he, ge, me, _e) {\n          return he.extensionsUsed.indexOf(this.name) !== -1 && ge === \"binary_glTF\" && (this._bin.readAsync(0, this._bin.byteLength).then(me, function(ye) {\n            return _e(ye.message);\n          }), !0);\n        }, q.prototype.loadTextureBufferAsync = function(he, ge, me, _e) {\n          var ye = he.textures[ge], Pe = he.images[ye.source];\n          if (!Pe.extensions || !(this.name in Pe.extensions))\n            return !1;\n          var be = Pe.extensions[this.name], Fe = he.bufferViews[be.bufferView];\n          return me(g.GetBufferFromBufferView(he, Fe, 0, Fe.byteLength, _.UNSIGNED_BYTE)), !0;\n        }, q.prototype.loadShaderStringAsync = function(he, ge, me, _e) {\n          var ye = he.shaders[ge];\n          if (!ye.extensions || !(this.name in ye.extensions))\n            return !1;\n          var Pe = ye.extensions[this.name], be = he.bufferViews[Pe.bufferView], Fe = g.GetBufferFromBufferView(he, be, 0, be.byteLength, _.UNSIGNED_BYTE);\n          return setTimeout(function() {\n            var ke = g.DecodeBufferToText(Fe);\n            me(ke);\n          }), !0;\n        }, q;\n      }(k);\n      Y.RegisterExtension(new H());\n      var Z = function(W) {\n        function q() {\n          return W.call(this, \"KHR_materials_common\") || this;\n        }\n        return Object(T.b)(q, W), q.prototype.loadRuntimeExtensionsAsync = function(he, ge, me) {\n          if (!he.extensions)\n            return !1;\n          var _e = he.extensions[this.name];\n          if (!_e)\n            return !1;\n          var ye = _e.lights;\n          if (ye)\n            for (var Pe in ye) {\n              var be = ye[Pe];\n              switch (be.type) {\n                case \"ambient\":\n                  var Fe = new E.HemisphericLight(be.name, new E.Vector3(0, 1, 0), he.scene), ke = be.ambient;\n                  ke && (Fe.diffuse = E.Color3.FromArray(ke.color || [1, 1, 1]));\n                  break;\n                case \"point\":\n                  var We = new E.PointLight(be.name, new E.Vector3(10, 10, 10), he.scene), je = be.point;\n                  je && (We.diffuse = E.Color3.FromArray(je.color || [1, 1, 1]));\n                  break;\n                case \"directional\":\n                  var He = new E.DirectionalLight(be.name, new E.Vector3(0, -1, 0), he.scene), Qe = be.directional;\n                  Qe && (He.diffuse = E.Color3.FromArray(Qe.color || [1, 1, 1]));\n                  break;\n                case \"spot\":\n                  var Ge = be.spot;\n                  Ge && (new E.SpotLight(be.name, new E.Vector3(0, 10, 0), new E.Vector3(0, -1, 0), Ge.fallOffAngle || Math.PI, Ge.fallOffExponent || 0, he.scene).diffuse = E.Color3.FromArray(Ge.color || [1, 1, 1]));\n                  break;\n                default:\n                  E.Tools.Warn('GLTF Material Common extension: light type \"' + be.type + \"” not supported\");\n              }\n            }\n          return !1;\n        }, q.prototype.loadMaterialAsync = function(he, ge, me, _e) {\n          var ye = he.materials[ge];\n          if (!ye || !ye.extensions)\n            return !1;\n          var Pe = ye.extensions[this.name];\n          if (!Pe)\n            return !1;\n          var be = new E.StandardMaterial(ge, he.scene);\n          return be.sideOrientation = E.Material.CounterClockWiseSideOrientation, Pe.technique === \"CONSTANT\" && (be.disableLighting = !0), be.backFaceCulling = Pe.doubleSided !== void 0 && !Pe.doubleSided, be.alpha = Pe.values.transparency === void 0 ? 1 : Pe.values.transparency, be.specularPower = Pe.values.shininess === void 0 ? 0 : Pe.values.shininess, typeof Pe.values.ambient == \"string\" ? this._loadTexture(he, Pe.values.ambient, be, \"ambientTexture\", _e) : be.ambientColor = E.Color3.FromArray(Pe.values.ambient || [0, 0, 0]), typeof Pe.values.diffuse == \"string\" ? this._loadTexture(he, Pe.values.diffuse, be, \"diffuseTexture\", _e) : be.diffuseColor = E.Color3.FromArray(Pe.values.diffuse || [0, 0, 0]), typeof Pe.values.emission == \"string\" ? this._loadTexture(he, Pe.values.emission, be, \"emissiveTexture\", _e) : be.emissiveColor = E.Color3.FromArray(Pe.values.emission || [0, 0, 0]), typeof Pe.values.specular == \"string\" ? this._loadTexture(he, Pe.values.specular, be, \"specularTexture\", _e) : be.specularColor = E.Color3.FromArray(Pe.values.specular || [0, 0, 0]), !0;\n        }, q.prototype._loadTexture = function(he, ge, me, _e, ye) {\n          re.LoadTextureBufferAsync(he, ge, function(Pe) {\n            re.CreateTextureAsync(he, ge, Pe, function(be) {\n              return me[_e] = be;\n            }, ye);\n          }, ye);\n        }, q;\n      }(k);\n      Y.RegisterExtension(new Z());\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"ArrayItem\", function() {\n        return _.a;\n      }), V.d(f, \"GLTFLoader\", function() {\n        return _.b;\n      }), V.d(f, \"EXT_lights_image_based\", function() {\n        return C.EXT_lights_image_based;\n      }), V.d(f, \"EXT_mesh_gpu_instancing\", function() {\n        return C.EXT_mesh_gpu_instancing;\n      }), V.d(f, \"EXT_texture_webp\", function() {\n        return C.EXT_texture_webp;\n      }), V.d(f, \"KHR_draco_mesh_compression\", function() {\n        return C.KHR_draco_mesh_compression;\n      }), V.d(f, \"KHR_lights\", function() {\n        return C.KHR_lights;\n      }), V.d(f, \"KHR_materials_pbrSpecularGlossiness\", function() {\n        return C.KHR_materials_pbrSpecularGlossiness;\n      }), V.d(f, \"KHR_materials_unlit\", function() {\n        return C.KHR_materials_unlit;\n      }), V.d(f, \"KHR_materials_clearcoat\", function() {\n        return C.KHR_materials_clearcoat;\n      }), V.d(f, \"KHR_materials_sheen\", function() {\n        return C.KHR_materials_sheen;\n      }), V.d(f, \"KHR_materials_specular\", function() {\n        return C.KHR_materials_specular;\n      }), V.d(f, \"KHR_materials_ior\", function() {\n        return C.KHR_materials_ior;\n      }), V.d(f, \"KHR_materials_variants\", function() {\n        return C.KHR_materials_variants;\n      }), V.d(f, \"KHR_materials_transmission\", function() {\n        return C.KHR_materials_transmission;\n      }), V.d(f, \"KHR_materials_translucency\", function() {\n        return C.KHR_materials_translucency;\n      }), V.d(f, \"KHR_mesh_quantization\", function() {\n        return C.KHR_mesh_quantization;\n      }), V.d(f, \"KHR_texture_basisu\", function() {\n        return C.KHR_texture_basisu;\n      }), V.d(f, \"KHR_texture_transform\", function() {\n        return C.KHR_texture_transform;\n      }), V.d(f, \"MSFT_audio_emitter\", function() {\n        return C.MSFT_audio_emitter;\n      }), V.d(f, \"MSFT_lod\", function() {\n        return C.MSFT_lod;\n      }), V.d(f, \"MSFT_minecraftMesh\", function() {\n        return C.MSFT_minecraftMesh;\n      }), V.d(f, \"MSFT_sRGBFactors\", function() {\n        return C.MSFT_sRGBFactors;\n      }), V.d(f, \"ExtrasAsMetadata\", function() {\n        return C.ExtrasAsMetadata;\n      });\n      var _ = V(1), C = (V(6), V(7));\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"MTLFileLoader\", function() {\n        return C;\n      }), V.d(f, \"OBJFileLoader\", function() {\n        return u;\n      });\n      var _ = V(0), C = function() {\n        function I() {\n          this.materials = [];\n        }\n        return I.prototype.parseMTL = function(O, x, m, c) {\n          if (!(x instanceof ArrayBuffer)) {\n            for (var T, S = x.split(`\n`), E = /\\s+/, g = null, l = 0; l < S.length; l++) {\n              var h = S[l].trim();\n              if (h.length !== 0 && h.charAt(0) !== \"#\") {\n                var v = h.indexOf(\" \"), b = v >= 0 ? h.substring(0, v) : h;\n                b = b.toLowerCase();\n                var D = v >= 0 ? h.substring(v + 1).trim() : \"\";\n                b === \"newmtl\" ? (g && this.materials.push(g), O._blockEntityCollection = c, g = new _.StandardMaterial(D, O), O._blockEntityCollection = !1) : b === \"kd\" && g ? (T = D.split(E, 3).map(parseFloat), g.diffuseColor = _.Color3.FromArray(T)) : b === \"ka\" && g ? (T = D.split(E, 3).map(parseFloat), g.ambientColor = _.Color3.FromArray(T)) : b === \"ks\" && g ? (T = D.split(E, 3).map(parseFloat), g.specularColor = _.Color3.FromArray(T)) : b === \"ke\" && g ? (T = D.split(E, 3).map(parseFloat), g.emissiveColor = _.Color3.FromArray(T)) : b === \"ns\" && g ? g.specularPower = parseFloat(D) : b === \"d\" && g ? g.alpha = parseFloat(D) : b === \"map_ka\" && g ? g.ambientTexture = I._getTexture(m, D, O) : b === \"map_kd\" && g ? g.diffuseTexture = I._getTexture(m, D, O) : b === \"map_ks\" && g ? g.specularTexture = I._getTexture(m, D, O) : b === \"map_ns\" || (b === \"map_bump\" && g ? g.bumpTexture = I._getTexture(m, D, O) : b === \"map_d\" && g && (g.opacityTexture = I._getTexture(m, D, O)));\n              }\n            }\n            g && this.materials.push(g);\n          }\n        }, I._getTexture = function(O, x, m) {\n          if (!x)\n            return null;\n          var c = O;\n          if (O === \"file:\") {\n            var T = x.lastIndexOf(\"\\\\\");\n            T === -1 && (T = x.lastIndexOf(\"/\")), c += T > -1 ? x.substr(T + 1) : x;\n          } else\n            c += x;\n          return new _.Texture(c, m, !1, I.INVERT_TEXTURE_Y);\n        }, I.INVERT_TEXTURE_Y = !0, I;\n      }(), u = function() {\n        function I(O) {\n          this.name = \"obj\", this.extensions = \".obj\", this.obj = /^o/, this.group = /^g/, this.mtllib = /^mtllib /, this.usemtl = /^usemtl /, this.smooth = /^s /, this.vertexPattern = /v(\\s+[\\d|\\.|\\+|\\-|e|E]+){3,7}/, this.normalPattern = /vn(\\s+[\\d|\\.|\\+|\\-|e|E]+)( +[\\d|\\.|\\+|\\-|e|E]+)( +[\\d|\\.|\\+|\\-|e|E]+)/, this.uvPattern = /vt(\\s+[\\d|\\.|\\+|\\-|e|E]+)( +[\\d|\\.|\\+|\\-|e|E]+)/, this.facePattern1 = /f\\s+(([\\d]{1,}[\\s]?){3,})+/, this.facePattern2 = /f\\s+((([\\d]{1,}\\/[\\d]{1,}[\\s]?){3,})+)/, this.facePattern3 = /f\\s+((([\\d]{1,}\\/[\\d]{1,}\\/[\\d]{1,}[\\s]?){3,})+)/, this.facePattern4 = /f\\s+((([\\d]{1,}\\/\\/[\\d]{1,}[\\s]?){3,})+)/, this.facePattern5 = /f\\s+(((-[\\d]{1,}\\/-[\\d]{1,}\\/-[\\d]{1,}[\\s]?){3,})+)/, this._forAssetContainer = !1, this._meshLoadOptions = O || I.currentMeshLoadOptions;\n        }\n        return Object.defineProperty(I, \"INVERT_TEXTURE_Y\", { get: function() {\n          return C.INVERT_TEXTURE_Y;\n        }, set: function(O) {\n          C.INVERT_TEXTURE_Y = O;\n        }, enumerable: !1, configurable: !0 }), Object.defineProperty(I, \"currentMeshLoadOptions\", { get: function() {\n          return { ComputeNormals: I.COMPUTE_NORMALS, ImportVertexColors: I.IMPORT_VERTEX_COLORS, InvertY: I.INVERT_Y, InvertTextureY: I.INVERT_TEXTURE_Y, UVScaling: I.UV_SCALING, MaterialLoadingFailsSilently: I.MATERIAL_LOADING_FAILS_SILENTLY, OptimizeWithUV: I.OPTIMIZE_WITH_UV, SkipMaterials: I.SKIP_MATERIALS };\n        }, enumerable: !1, configurable: !0 }), I.prototype._loadMTL = function(O, x, m, c) {\n          var T = _.Tools.BaseUrl + x + O;\n          _.Tools.LoadFile(T, m, void 0, void 0, !1, function(S, E) {\n            c(T, E);\n          });\n        }, I.prototype.createPlugin = function() {\n          return new I(I.currentMeshLoadOptions);\n        }, I.prototype.canDirectLoad = function(O) {\n          return !1;\n        }, I.prototype.importMeshAsync = function(O, x, m, c, T, S) {\n          return this._parseSolid(O, x, m, c).then(function(E) {\n            return { meshes: E, particleSystems: [], skeletons: [], animationGroups: [], transformNodes: [], geometries: [], lights: [] };\n          });\n        }, I.prototype.loadAsync = function(O, x, m, c, T) {\n          return this.importMeshAsync(null, O, x, m, c).then(function() {\n          });\n        }, I.prototype.loadAssetContainerAsync = function(O, x, m, c, T) {\n          var S = this;\n          return this._forAssetContainer = !0, this.importMeshAsync(null, O, x, m).then(function(E) {\n            var g = new _.AssetContainer(O);\n            return E.meshes.forEach(function(l) {\n              return g.meshes.push(l);\n            }), E.meshes.forEach(function(l) {\n              var h = l.material;\n              h && g.materials.indexOf(h) == -1 && (g.materials.push(h), h.getActiveTextures().forEach(function(v) {\n                g.textures.indexOf(v) == -1 && g.textures.push(v);\n              }));\n            }), S._forAssetContainer = !1, g;\n          }).catch(function(E) {\n            throw S._forAssetContainer = !1, E;\n          });\n        }, I.prototype._parseSolid = function(O, x, m, c) {\n          for (var T, S = this, E = [], g = [], l = [], h = [], v = [], b = [], D = [], w = [], N = [], M = [], U = [], X = 0, j = !1, ne = [], te = [], de = [], pe = [], ae = [], ee = \"\", K = \"\", $ = new C(), L = 1, G = !0, Q = new _.Color4(0.5, 0.5, 0.5, 1), oe = function(Ge, tt, Je, st, at, pt, Tt) {\n            var Lt;\n            (Lt = S._meshLoadOptions.OptimizeWithUV ? function(Ot, St) {\n              Ot[St[0]] || (Ot[St[0]] = { normals: [], idx: [], uv: [] });\n              var Ct = Ot[St[0]].normals.indexOf(St[1]);\n              return Ct != 1 && St[2] === Ot[St[0]].uv[Ct] ? Ot[St[0]].idx[Ct] : -1;\n            }(U, [Ge, Je, tt]) : function(Ot, St) {\n              Ot[St[0]] || (Ot[St[0]] = { normals: [], idx: [] });\n              var Ct = Ot[St[0]].normals.indexOf(St[1]);\n              return Ct === -1 ? -1 : Ot[St[0]].idx[Ct];\n            }(U, [Ge, Je])) === -1 ? (b.push(D.length), D.push(st), w.push(at), M.push(pt), Tt !== void 0 && N.push(Tt), U[Ge].normals.push(Je), U[Ge].idx.push(X++), S._meshLoadOptions.OptimizeWithUV && U[Ge].uv.push(tt)) : b.push(Lt);\n          }, re = function() {\n            for (var Ge = 0; Ge < D.length; Ge++)\n              ne.push(D[Ge].x, D[Ge].y, D[Ge].z), de.push(M[Ge].x, M[Ge].y, M[Ge].z), pe.push(w[Ge].x, w[Ge].y), S._meshLoadOptions.ImportVertexColors === !0 && te.push(N[Ge].r, N[Ge].g, N[Ge].b, N[Ge].a);\n            D = [], M = [], w = [], N = [], U = [], X = 0;\n          }, Y = function(Ge, tt) {\n            for (var Je = tt; Je < Ge.length - 1; Je++)\n              ae.push(Ge[0], Ge[Je], Ge[Je + 1]);\n          }, k = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = parseInt(ae[Je]) - 1;\n              oe(st, 0, 0, E[st], _.Vector2.Zero(), _.Vector3.Up(), S._meshLoadOptions.ImportVertexColors === !0 ? h[st] : void 0);\n            }\n            ae = [];\n          }, H = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"/\"), at = parseInt(st[0]) - 1, pt = parseInt(st[1]) - 1;\n              oe(at, pt, 0, E[at], l[pt], _.Vector3.Up(), S._meshLoadOptions.ImportVertexColors === !0 ? h[at] : void 0);\n            }\n            ae = [];\n          }, Z = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"/\"), at = parseInt(st[0]) - 1, pt = parseInt(st[1]) - 1, Tt = parseInt(st[2]) - 1;\n              oe(at, pt, Tt, E[at], l[pt], g[Tt]);\n            }\n            ae = [];\n          }, W = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"//\"), at = parseInt(st[0]) - 1, pt = parseInt(st[1]) - 1;\n              oe(at, 1, pt, E[at], _.Vector2.Zero(), g[pt], S._meshLoadOptions.ImportVertexColors === !0 ? h[at] : void 0);\n            }\n            ae = [];\n          }, q = function(Ge, tt) {\n            Y(Ge, tt);\n            for (var Je = 0; Je < ae.length; Je++) {\n              var st = ae[Je].split(\"/\"), at = E.length + parseInt(st[0]), pt = l.length + parseInt(st[1]), Tt = g.length + parseInt(st[2]);\n              oe(at, pt, Tt, E[at], l[pt], g[Tt], S._meshLoadOptions.ImportVertexColors === !0 ? h[at] : void 0);\n            }\n            ae = [];\n          }, he = function() {\n            v.length > 0 && (T = v[v.length - 1], re(), b.reverse(), T.indices = b.slice(), T.positions = ne.slice(), T.normals = de.slice(), T.uvs = pe.slice(), S._meshLoadOptions.ImportVertexColors === !0 && (T.colors = te.slice()), b = [], ne = [], te = [], de = [], pe = []);\n          }, ge = m.split(`\n`), me = 0; me < ge.length; me++) {\n            var _e, ye = ge[me].trim().replace(/\\s\\s/g, \" \");\n            if (ye.length !== 0 && ye.charAt(0) !== \"#\")\n              if (this.vertexPattern.test(ye))\n                _e = ye.match(/[^ ]+/g), E.push(new _.Vector3(parseFloat(_e[1]), parseFloat(_e[2]), parseFloat(_e[3]))), this._meshLoadOptions.ImportVertexColors === !0 && (_e.length >= 7 ? h.push(new _.Color4(parseFloat(_e[4]), parseFloat(_e[5]), parseFloat(_e[6]), _e.length === 7 || _e[7] === void 0 ? 1 : parseFloat(_e[7]))) : h.push(Q));\n              else if ((_e = this.normalPattern.exec(ye)) !== null)\n                g.push(new _.Vector3(parseFloat(_e[1]), parseFloat(_e[2]), parseFloat(_e[3])));\n              else if ((_e = this.uvPattern.exec(ye)) !== null)\n                l.push(new _.Vector2(parseFloat(_e[1]) * I.UV_SCALING.x, parseFloat(_e[2]) * I.UV_SCALING.y));\n              else if ((_e = this.facePattern3.exec(ye)) !== null)\n                Z(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern4.exec(ye)) !== null)\n                W(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern5.exec(ye)) !== null)\n                q(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern2.exec(ye)) !== null)\n                H(_e[1].trim().split(\" \"), 1);\n              else if ((_e = this.facePattern1.exec(ye)) !== null)\n                k(_e[1].trim().split(\" \"), 1);\n              else if (this.group.test(ye) || this.obj.test(ye)) {\n                var Pe = { name: ye.substring(2).trim(), indices: void 0, positions: void 0, normals: void 0, uvs: void 0, colors: void 0, materialName: \"\" };\n                he(), v.push(Pe), j = !0, G = !0, L = 1;\n              } else\n                this.usemtl.test(ye) ? (ee = ye.substring(7).trim(), (!G || !j) && (he(), Pe = { name: \"mesh_mm\" + L.toString(), indices: void 0, positions: void 0, normals: void 0, uvs: void 0, colors: void 0, materialName: ee }, L++, v.push(Pe), j = !0), j && G && (v[v.length - 1].materialName = ee, G = !1)) : this.mtllib.test(ye) ? K = ye.substring(7).trim() : this.smooth.test(ye) || console.log(\"Unhandled expression at line : \" + ye);\n          }\n          j && (T = v[v.length - 1], b.reverse(), re(), T.indices = b, T.positions = ne, T.normals = de, T.uvs = pe, this._meshLoadOptions.ImportVertexColors === !0 && (T.colors = te)), j || (b.reverse(), re(), v.push({ name: _.Geometry.RandomId(), indices: b, positions: ne, colors: te, normals: de, uvs: pe, materialName: ee }));\n          for (var be = [], Fe = new Array(), ke = 0; ke < v.length; ke++) {\n            if (O && v[ke].name) {\n              if (O instanceof Array) {\n                if (O.indexOf(v[ke].name) === -1)\n                  continue;\n              } else if (v[ke].name !== O)\n                continue;\n            }\n            T = v[ke], x._blockEntityCollection = this._forAssetContainer;\n            var We = new _.Mesh(v[ke].name, x);\n            x._blockEntityCollection = !1, Fe.push(v[ke].materialName);\n            var je = new _.VertexData();\n            if (je.uvs = T.uvs, je.indices = T.indices, je.positions = T.positions, this._meshLoadOptions.ComputeNormals === !0) {\n              var He = new Array();\n              _.VertexData.ComputeNormals(T.positions, T.indices, He), je.normals = He;\n            } else\n              je.normals = T.normals;\n            this._meshLoadOptions.ImportVertexColors === !0 && (je.colors = T.colors), je.applyToMesh(We), this._meshLoadOptions.InvertY && (We.scaling.y *= -1), be.push(We);\n          }\n          var Qe = [];\n          return K !== \"\" && this._meshLoadOptions.SkipMaterials === !1 && Qe.push(new Promise(function(Ge, tt) {\n            S._loadMTL(K, c, function(Je) {\n              try {\n                $.parseMTL(x, Je, c, S._forAssetContainer);\n                for (var st = 0; st < $.materials.length; st++) {\n                  for (var at, pt = 0, Tt = []; (at = Fe.indexOf($.materials[st].name, pt)) > -1; )\n                    Tt.push(at), pt = at + 1;\n                  if (at === -1 && Tt.length === 0)\n                    $.materials[st].dispose();\n                  else\n                    for (var Lt = 0; Lt < Tt.length; Lt++)\n                      be[Tt[Lt]].material = $.materials[st];\n                }\n                Ge();\n              } catch (Ot) {\n                _.Tools.Warn(\"Error processing MTL file: '\" + K + \"'\"), S._meshLoadOptions.MaterialLoadingFailsSilently ? Ge() : tt(Ot);\n              }\n            }, function(Je, st) {\n              _.Tools.Warn(\"Error downloading MTL file: '\" + K + \"'\"), S._meshLoadOptions.MaterialLoadingFailsSilently ? Ge() : tt(st);\n            });\n          })), Promise.all(Qe).then(function() {\n            return be;\n          });\n        }, I.OPTIMIZE_WITH_UV = !0, I.INVERT_Y = !1, I.IMPORT_VERTEX_COLORS = !1, I.COMPUTE_NORMALS = !1, I.UV_SCALING = new _.Vector2(1, 1), I.SKIP_MATERIALS = !1, I.MATERIAL_LOADING_FAILS_SILENTLY = !0, I;\n      }();\n      _.SceneLoader && _.SceneLoader.RegisterPlugin(new u());\n    }, function(A, f, V) {\n      V.r(f), V.d(f, \"STLFileLoader\", function() {\n        return C;\n      });\n      var _ = V(0), C = function() {\n        function u() {\n          this.solidPattern = /solid (\\S*)([\\S\\s]*?)endsolid[ ]*(\\S*)/g, this.facetsPattern = /facet([\\s\\S]*?)endfacet/g, this.normalPattern = /normal[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g, this.vertexPattern = /vertex[\\s]+([\\-+]?[0-9]+\\.?[0-9]*([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+[\\s]+([\\-+]?[0-9]*\\.?[0-9]+([eE][\\-+]?[0-9]+)?)+/g, this.name = \"stl\", this.extensions = { \".stl\": { isBinary: !0 } };\n        }\n        return u.prototype.importMesh = function(I, O, x, m, c, T, S) {\n          var E;\n          if (typeof x != \"string\") {\n            if (this._isBinary(x)) {\n              var g = new _.Mesh(\"stlmesh\", O);\n              return this._parseBinary(g, x), c && c.push(g), !0;\n            }\n            for (var l = new Uint8Array(x), h = \"\", v = 0; v < x.byteLength; v++)\n              h += String.fromCharCode(l[v]);\n            x = h;\n          }\n          for (; E = this.solidPattern.exec(x); ) {\n            var b = E[1];\n            if (b != E[3])\n              return _.Tools.Error(\"Error in STL, solid name != endsolid name\"), !1;\n            if (I && b) {\n              if (I instanceof Array) {\n                if (!I.indexOf(b))\n                  continue;\n              } else if (b !== I)\n                continue;\n            }\n            b = b || \"stlmesh\", g = new _.Mesh(b, O), this._parseASCII(g, E[2]), c && c.push(g);\n          }\n          return !0;\n        }, u.prototype.load = function(I, O, x) {\n          return this.importMesh(null, I, O, x, null, null, null);\n        }, u.prototype.loadAssetContainer = function(I, O, x, m) {\n          var c = new _.AssetContainer(I);\n          return I._blockEntityCollection = !0, this.importMesh(null, I, O, x, c.meshes, null, null), I._blockEntityCollection = !1, c;\n        }, u.prototype._isBinary = function(I) {\n          var O;\n          if (84 + 50 * (O = new DataView(I)).getUint32(80, !0) === O.byteLength)\n            return !0;\n          for (var x = O.byteLength, m = 0; m < x; m++)\n            if (O.getUint8(m) > 127)\n              return !0;\n          return !1;\n        }, u.prototype._parseBinary = function(I, O) {\n          for (var x = new DataView(O), m = x.getUint32(80, !0), c = 0, T = new Float32Array(3 * m * 3), S = new Float32Array(3 * m * 3), E = new Uint32Array(3 * m), g = 0, l = 0; l < m; l++) {\n            for (var h = 84 + 50 * l, v = x.getFloat32(h, !0), b = x.getFloat32(h + 4, !0), D = x.getFloat32(h + 8, !0), w = 1; w <= 3; w++) {\n              var N = h + 12 * w;\n              T[c] = x.getFloat32(N, !0), T[c + 2] = x.getFloat32(N + 4, !0), T[c + 1] = x.getFloat32(N + 8, !0), S[c] = v, S[c + 2] = b, S[c + 1] = D, c += 3;\n            }\n            E[g] = g++, E[g] = g++, E[g] = g++;\n          }\n          I.setVerticesData(_.VertexBuffer.PositionKind, T), I.setVerticesData(_.VertexBuffer.NormalKind, S), I.setIndices(E), I.computeWorldMatrix(!0);\n        }, u.prototype._parseASCII = function(I, O) {\n          for (var x, m = [], c = [], T = [], S = 0; x = this.facetsPattern.exec(O); ) {\n            var E = x[1], g = this.normalPattern.exec(E);\n            if (this.normalPattern.lastIndex = 0, g) {\n              for (var l, h = [Number(g[1]), Number(g[5]), Number(g[3])]; l = this.vertexPattern.exec(E); )\n                m.push(Number(l[1]), Number(l[5]), Number(l[3])), c.push(h[0], h[1], h[2]);\n              T.push(S++, S++, S++), this.vertexPattern.lastIndex = 0;\n            }\n          }\n          this.facetsPattern.lastIndex = 0, I.setVerticesData(_.VertexBuffer.PositionKind, m), I.setVerticesData(_.VertexBuffer.NormalKind, c), I.setIndices(T), I.computeWorldMatrix(!0);\n        }, u;\n      }();\n      _.SceneLoader && _.SceneLoader.RegisterPlugin(new C());\n    }, function(A, f, V) {\n      (function(_) {\n        var C = V(2), u = V(3);\n        V.d(f, \"a\", function() {\n          return C.GLTFFileLoader;\n        }), V.d(f, \"b\", function() {\n          return C.GLTFLoaderAnimationStartMode;\n        }), V.d(f, \"c\", function() {\n          return C.GLTFLoaderCoordinateSystemMode;\n        }), V.d(f, \"d\", function() {\n          return C.GLTFLoaderState;\n        }), V.d(f, \"e\", function() {\n          return u.GLTFValidation;\n        });\n        var I = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (I !== void 0) {\n          for (var O in I.BABYLON = I.BABYLON || {}, C)\n            I.BABYLON[O] = C[O];\n          for (var O in u)\n            I.BABYLON[O] = u[O];\n        }\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      (function(_) {\n        var C = V(8);\n        V.d(f, \"a\", function() {\n          return C;\n        });\n        var u = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (u !== void 0)\n          for (var I in u.BABYLON = u.BABYLON || {}, u.BABYLON.GLTF1 = u.BABYLON.GLTF1 || {}, C)\n            u.BABYLON.GLTF1[I] = C[I];\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      (function(_) {\n        var C = V(7), u = V(6), I = V(9);\n        V.d(f, \"a\", function() {\n          return I;\n        });\n        var O = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (O !== void 0) {\n          O.BABYLON = O.BABYLON || {};\n          var x = O.BABYLON;\n          x.GLTF2 = x.GLTF2 || {}, x.GLTF2.Loader = x.GLTF2.Loader || {}, x.GLTF2.Loader.Extensions = x.GLTF2.Loader.Extensions || {};\n          var m = [];\n          for (var c in C)\n            x.GLTF2.Loader.Extensions[c] = C[c], m.push(c);\n          for (var c in u)\n            x.GLTF2.Loader[c] = u[c], m.push(c);\n          for (var c in I)\n            m.indexOf(c) > -1 || (x.GLTF2[c] = I[c]);\n        }\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      V.r(f), (function(_) {\n        var C = V(10);\n        V.d(f, \"MTLFileLoader\", function() {\n          return C.MTLFileLoader;\n        }), V.d(f, \"OBJFileLoader\", function() {\n          return C.OBJFileLoader;\n        });\n        var u = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (u !== void 0)\n          for (var I in C)\n            u.BABYLON[I] = C[I];\n      }).call(this, V(5));\n    }, function(A, f, V) {\n      V.r(f), (function(_) {\n        var C = V(11);\n        V.d(f, \"STLFileLoader\", function() {\n          return C.STLFileLoader;\n        });\n        var u = _ !== void 0 ? _ : typeof window < \"u\" ? window : void 0;\n        if (u !== void 0)\n          for (var I in C)\n            u.BABYLON[I] = C[I];\n      }).call(this, V(5));\n    }, , , , function(A, f, V) {\n      V.r(f), V.d(f, \"GLTFLoaderCoordinateSystemMode\", function() {\n        return _.c;\n      }), V.d(f, \"GLTFLoaderAnimationStartMode\", function() {\n        return _.b;\n      }), V.d(f, \"GLTFLoaderState\", function() {\n        return _.d;\n      }), V.d(f, \"GLTFFileLoader\", function() {\n        return _.a;\n      }), V.d(f, \"GLTFValidation\", function() {\n        return _.e;\n      }), V.d(f, \"GLTF1\", function() {\n        return C.a;\n      }), V.d(f, \"GLTF2\", function() {\n        return u.a;\n      }), V.d(f, \"MTLFileLoader\", function() {\n        return I.MTLFileLoader;\n      }), V.d(f, \"OBJFileLoader\", function() {\n        return I.OBJFileLoader;\n      }), V.d(f, \"STLFileLoader\", function() {\n        return O.STLFileLoader;\n      }), V(2), V(3), V(8), V(9), V(10), V(11);\n      var _ = V(12), C = V(13), u = V(14), I = V(15), O = V(16);\n    }]);\n  });\n})(cf);\nvar Eo = cf.exports;\nconst lv = /* @__PURE__ */ av(Eo), af = /* @__PURE__ */ cv({\n  __proto__: null,\n  default: lv\n}, [Eo]), {\n  SvelteComponent: uv,\n  binding_callbacks: hv,\n  detach: dv,\n  element: fv,\n  init: pv,\n  insert: _v,\n  noop: Kc,\n  safe_not_equal: mv\n} = window.__gradio__svelte__internal, { onMount: gv } = window.__gradio__svelte__internal;\nfunction vv(an) {\n  let ln;\n  return {\n    c() {\n      ln = fv(\"canvas\");\n    },\n    m(Be, A) {\n      _v(Be, ln, A), an[12](ln);\n    },\n    p: Kc,\n    i: Kc,\n    o: Kc,\n    d(Be) {\n      Be && dv(ln), an[12](null);\n    }\n  };\n}\nfunction yv(an, ln) {\n  return an ?? ln();\n}\nfunction bv(an, ln, Be) {\n  let A, { value: f } = ln, { clear_color: V } = ln, { camera_position: _ } = ln, { zoom_speed: C } = ln, { pan_speed: u } = ln, { resolved_url: I = void 0 } = ln, O, x, m, c, T = !1;\n  gv(() => {\n    c = new Pi.Engine(x, !0), m = new Pi.Scene(c), m.createDefaultCameraOrLight(), m.clearColor = m.clearColor = new Pi.Color4(...V), c.runRenderLoop(() => {\n      m.render();\n    });\n    function h() {\n      c.resize();\n    }\n    return window.addEventListener(\"resize\", h), Be(10, T = !0), () => {\n      m.dispose(), c.dispose(), window.removeEventListener(\"resize\", h);\n    };\n  });\n  function S(h) {\n    m && (m.meshes.forEach((v) => {\n      v.dispose();\n    }), h && (Pi.SceneLoader.ShowLoadingScreen = !1, Pi.SceneLoader.Append(h, \"\", m, () => E(m, _, C, u), void 0, void 0, \".\" + f.path.split(\".\").pop())), m.executeWhenReady(function() {\n      m.materials.forEach((v) => {\n        v.albedoTexture !== null && (v.metallicF0Factor = 0, v.emissiveTexture = v.albedoTexture, v.albedoTexture = null, v.emissiveColor = new Pi.Color3(1, 1, 1), v.albedoColor = new Pi.Color3(0, 0, 0));\n      });\n    }));\n  }\n  function E(h, v, b, D) {\n    h.createDefaultCamera(!0, !0, !0);\n    var w = h.activeCamera;\n    v[0] !== null && (w.alpha = Pi.Tools.ToRadians(v[0])), v[1] !== null && (w.beta = Pi.Tools.ToRadians(v[1])), v[2] !== null && (w.radius = v[2]), w.lowerRadiusLimit = 0.1;\n    const N = () => {\n      w.wheelPrecision = 250 / (w.radius * b), w.panningSensibility = 1e4 * D / w.radius;\n    };\n    N(), w.attachControl(!0), w.onAfterCheckInputsObservable.add(N);\n  }\n  function g(h, v, b) {\n    m && (m.removeCamera(m.activeCamera), E(m, h, v, b));\n  }\n  function l(h) {\n    hv[h ? \"unshift\" : \"push\"](() => {\n      x = h, Be(0, x);\n    });\n  }\n  return an.$$set = (h) => {\n    \"value\" in h && Be(2, f = h.value), \"clear_color\" in h && Be(3, V = h.clear_color), \"camera_position\" in h && Be(4, _ = h.camera_position), \"zoom_speed\" in h && Be(5, C = h.zoom_speed), \"pan_speed\" in h && Be(6, u = h.pan_speed), \"resolved_url\" in h && Be(1, I = h.resolved_url);\n  }, an.$$.update = () => {\n    if (an.$$.dirty & /*BABYLON_LOADERS*/\n    256 && Eo.OBJFileLoader != null && !Eo.OBJFileLoader.IMPORT_VERTEX_COLORS && Be(8, Eo.OBJFileLoader.IMPORT_VERTEX_COLORS = !0, af), an.$$.dirty & /*value*/\n    4 && Be(11, A = f.url), an.$$.dirty & /*url, latest_url*/\n    2560 && (Be(1, I = A), A)) {\n      Be(9, O = A);\n      const h = A;\n      sv(A).then((v) => {\n        O === h ? Be(1, I = yv(v, () => {\n        })) : v && URL.revokeObjectURL(v);\n      });\n    }\n    an.$$.dirty & /*mounted, resolved_url*/\n    1026 && T && S(I);\n  }, [\n    x,\n    I,\n    f,\n    V,\n    _,\n    C,\n    u,\n    g,\n    af,\n    O,\n    T,\n    A,\n    l\n  ];\n}\nclass Ev extends uv {\n  constructor(ln) {\n    super(), pv(this, ln, bv, vv, mv, {\n      value: 2,\n      clear_color: 3,\n      camera_position: 4,\n      zoom_speed: 5,\n      pan_speed: 6,\n      resolved_url: 1,\n      reset_camera_position: 7\n    });\n  }\n  get reset_camera_position() {\n    return this.$$.ctx[7];\n  }\n}\nexport {\n  Ev as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/Canvas3DGS-f5539f54.js",
    "content": "import { r as KU } from \"./Index-0bb1de05.js\";\nclass S {\n  constructor(U = 0, l = 0, F = 0) {\n    this.x = U, this.y = l, this.z = F;\n  }\n  equals(U) {\n    return this.x === U.x && this.y === U.y && this.z === U.z;\n  }\n  add(U) {\n    return typeof U == \"number\" ? new S(this.x + U, this.y + U, this.z + U) : new S(this.x + U.x, this.y + U.y, this.z + U.z);\n  }\n  subtract(U) {\n    return typeof U == \"number\" ? new S(this.x - U, this.y - U, this.z - U) : new S(this.x - U.x, this.y - U.y, this.z - U.z);\n  }\n  multiply(U) {\n    return typeof U == \"number\" ? new S(this.x * U, this.y * U, this.z * U) : U instanceof S ? new S(this.x * U.x, this.y * U.y, this.z * U.z) : new S(this.x * U.buffer[0] + this.y * U.buffer[4] + this.z * U.buffer[8] + U.buffer[12], this.x * U.buffer[1] + this.y * U.buffer[5] + this.z * U.buffer[9] + U.buffer[13], this.x * U.buffer[2] + this.y * U.buffer[6] + this.z * U.buffer[10] + U.buffer[14]);\n  }\n  cross(U) {\n    const l = this.y * U.z - this.z * U.y, F = this.z * U.x - this.x * U.z, Q = this.x * U.y - this.y * U.x;\n    return new S(l, F, Q);\n  }\n  dot(U) {\n    return this.x * U.x + this.y * U.y + this.z * U.z;\n  }\n  lerp(U, l) {\n    return new S(this.x + (U.x - this.x) * l, this.y + (U.y - this.y) * l, this.z + (U.z - this.z) * l);\n  }\n  magnitude() {\n    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n  }\n  distanceTo(U) {\n    return Math.sqrt((this.x - U.x) ** 2 + (this.y - U.y) ** 2 + (this.z - U.z) ** 2);\n  }\n  normalize() {\n    const U = this.magnitude();\n    return new S(this.x / U, this.y / U, this.z / U);\n  }\n  flat() {\n    return [this.x, this.y, this.z];\n  }\n  clone() {\n    return new S(this.x, this.y, this.z);\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n  static One(U = 1) {\n    return new S(U, U, U);\n  }\n}\nclass K {\n  constructor(U = 0, l = 0, F = 0, Q = 1) {\n    this.x = U, this.y = l, this.z = F, this.w = Q;\n  }\n  equals(U) {\n    return this.x === U.x && this.y === U.y && this.z === U.z && this.w === U.w;\n  }\n  normalize() {\n    const U = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n    return new K(this.x / U, this.y / U, this.z / U, this.w / U);\n  }\n  multiply(U) {\n    const l = this.w, F = this.x, Q = this.y, Z = this.z, d = U.w, V = U.x, B = U.y, t = U.z;\n    return new K(l * V + F * d + Q * t - Z * B, l * B - F * t + Q * d + Z * V, l * t + F * B - Q * V + Z * d, l * d - F * V - Q * B - Z * t);\n  }\n  inverse() {\n    const U = this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n    return new K(-this.x / U, -this.y / U, -this.z / U, this.w / U);\n  }\n  apply(U) {\n    const l = new K(U.x, U.y, U.z, 0), F = new K(-this.x, -this.y, -this.z, this.w), Q = this.multiply(l).multiply(F);\n    return new S(Q.x, Q.y, Q.z);\n  }\n  flat() {\n    return [this.x, this.y, this.z, this.w];\n  }\n  clone() {\n    return new K(this.x, this.y, this.z, this.w);\n  }\n  static FromEuler(U) {\n    const l = U.x / 2, F = U.y / 2, Q = U.z / 2, Z = Math.cos(F), d = Math.sin(F), V = Math.cos(l), B = Math.sin(l), t = Math.cos(Q), R = Math.sin(Q);\n    return new K(Z * B * t + d * V * R, d * V * t - Z * B * R, Z * V * R - d * B * t, Z * V * t + d * B * R);\n  }\n  toEuler() {\n    const U = 2 * (this.w * this.x + this.y * this.z), l = 1 - 2 * (this.x * this.x + this.y * this.y), F = Math.atan2(U, l);\n    let Q;\n    const Z = 2 * (this.w * this.y - this.z * this.x);\n    Q = Math.abs(Z) >= 1 ? Math.sign(Z) * Math.PI / 2 : Math.asin(Z);\n    const d = 2 * (this.w * this.z + this.x * this.y), V = 1 - 2 * (this.y * this.y + this.z * this.z), B = Math.atan2(d, V);\n    return new S(F, Q, B);\n  }\n  static FromMatrix3(U) {\n    const l = U.buffer, F = l[0] + l[4] + l[8];\n    let Q, Z, d, V;\n    if (F > 0) {\n      const B = 0.5 / Math.sqrt(F + 1);\n      V = 0.25 / B, Q = (l[7] - l[5]) * B, Z = (l[2] - l[6]) * B, d = (l[3] - l[1]) * B;\n    } else if (l[0] > l[4] && l[0] > l[8]) {\n      const B = 2 * Math.sqrt(1 + l[0] - l[4] - l[8]);\n      V = (l[7] - l[5]) / B, Q = 0.25 * B, Z = (l[1] + l[3]) / B, d = (l[2] + l[6]) / B;\n    } else if (l[4] > l[8]) {\n      const B = 2 * Math.sqrt(1 + l[4] - l[0] - l[8]);\n      V = (l[2] - l[6]) / B, Q = (l[1] + l[3]) / B, Z = 0.25 * B, d = (l[5] + l[7]) / B;\n    } else {\n      const B = 2 * Math.sqrt(1 + l[8] - l[0] - l[4]);\n      V = (l[3] - l[1]) / B, Q = (l[2] + l[6]) / B, Z = (l[5] + l[7]) / B, d = 0.25 * B;\n    }\n    return new K(Q, Z, d, V);\n  }\n  static FromAxisAngle(U, l) {\n    const F = l / 2, Q = Math.sin(F), Z = Math.cos(F);\n    return new K(U.x * Q, U.y * Q, U.z * Q, Z);\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n}\nclass gU {\n  constructor() {\n    const U = /* @__PURE__ */ new Map();\n    this.addEventListener = (l, F) => {\n      U.has(l) || U.set(l, /* @__PURE__ */ new Set()), U.get(l).add(F);\n    }, this.removeEventListener = (l, F) => {\n      U.has(l) && U.get(l).delete(F);\n    }, this.hasEventListener = (l, F) => !!U.has(l) && U.get(l).has(F), this.dispatchEvent = (l) => {\n      if (U.has(l.type))\n        for (const F of U.get(l.type))\n          F(l);\n    };\n  }\n}\nclass BU {\n  constructor(U = 1, l = 0, F = 0, Q = 0, Z = 0, d = 1, V = 0, B = 0, t = 0, R = 0, i = 1, s = 0, J = 0, c = 0, N = 0, o = 1) {\n    this.buffer = [U, l, F, Q, Z, d, V, B, t, R, i, s, J, c, N, o];\n  }\n  equals(U) {\n    if (this.buffer.length !== U.buffer.length)\n      return !1;\n    if (this.buffer === U.buffer)\n      return !0;\n    for (let l = 0; l < this.buffer.length; l++)\n      if (this.buffer[l] !== U.buffer[l])\n        return !1;\n    return !0;\n  }\n  multiply(U) {\n    const l = this.buffer, F = U.buffer;\n    return new BU(F[0] * l[0] + F[1] * l[4] + F[2] * l[8] + F[3] * l[12], F[0] * l[1] + F[1] * l[5] + F[2] * l[9] + F[3] * l[13], F[0] * l[2] + F[1] * l[6] + F[2] * l[10] + F[3] * l[14], F[0] * l[3] + F[1] * l[7] + F[2] * l[11] + F[3] * l[15], F[4] * l[0] + F[5] * l[4] + F[6] * l[8] + F[7] * l[12], F[4] * l[1] + F[5] * l[5] + F[6] * l[9] + F[7] * l[13], F[4] * l[2] + F[5] * l[6] + F[6] * l[10] + F[7] * l[14], F[4] * l[3] + F[5] * l[7] + F[6] * l[11] + F[7] * l[15], F[8] * l[0] + F[9] * l[4] + F[10] * l[8] + F[11] * l[12], F[8] * l[1] + F[9] * l[5] + F[10] * l[9] + F[11] * l[13], F[8] * l[2] + F[9] * l[6] + F[10] * l[10] + F[11] * l[14], F[8] * l[3] + F[9] * l[7] + F[10] * l[11] + F[11] * l[15], F[12] * l[0] + F[13] * l[4] + F[14] * l[8] + F[15] * l[12], F[12] * l[1] + F[13] * l[5] + F[14] * l[9] + F[15] * l[13], F[12] * l[2] + F[13] * l[6] + F[14] * l[10] + F[15] * l[14], F[12] * l[3] + F[13] * l[7] + F[14] * l[11] + F[15] * l[15]);\n  }\n  clone() {\n    const U = this.buffer;\n    return new BU(U[0], U[1], U[2], U[3], U[4], U[5], U[6], U[7], U[8], U[9], U[10], U[11], U[12], U[13], U[14], U[15]);\n  }\n  determinant() {\n    const U = this.buffer;\n    return U[12] * U[9] * U[6] * U[3] - U[8] * U[13] * U[6] * U[3] - U[12] * U[5] * U[10] * U[3] + U[4] * U[13] * U[10] * U[3] + U[8] * U[5] * U[14] * U[3] - U[4] * U[9] * U[14] * U[3] - U[12] * U[9] * U[2] * U[7] + U[8] * U[13] * U[2] * U[7] + U[12] * U[1] * U[10] * U[7] - U[0] * U[13] * U[10] * U[7] - U[8] * U[1] * U[14] * U[7] + U[0] * U[9] * U[14] * U[7] + U[12] * U[5] * U[2] * U[11] - U[4] * U[13] * U[2] * U[11] - U[12] * U[1] * U[6] * U[11] + U[0] * U[13] * U[6] * U[11] + U[4] * U[1] * U[14] * U[11] - U[0] * U[5] * U[14] * U[11] - U[8] * U[5] * U[2] * U[15] + U[4] * U[9] * U[2] * U[15] + U[8] * U[1] * U[6] * U[15] - U[0] * U[9] * U[6] * U[15] - U[4] * U[1] * U[10] * U[15] + U[0] * U[5] * U[10] * U[15];\n  }\n  invert() {\n    const U = this.buffer, l = this.determinant();\n    if (l === 0)\n      throw new Error(\"Matrix is not invertible.\");\n    const F = 1 / l;\n    return new BU(F * (U[5] * U[10] * U[15] - U[5] * U[11] * U[14] - U[9] * U[6] * U[15] + U[9] * U[7] * U[14] + U[13] * U[6] * U[11] - U[13] * U[7] * U[10]), F * (-U[1] * U[10] * U[15] + U[1] * U[11] * U[14] + U[9] * U[2] * U[15] - U[9] * U[3] * U[14] - U[13] * U[2] * U[11] + U[13] * U[3] * U[10]), F * (U[1] * U[6] * U[15] - U[1] * U[7] * U[14] - U[5] * U[2] * U[15] + U[5] * U[3] * U[14] + U[13] * U[2] * U[7] - U[13] * U[3] * U[6]), F * (-U[1] * U[6] * U[11] + U[1] * U[7] * U[10] + U[5] * U[2] * U[11] - U[5] * U[3] * U[10] - U[9] * U[2] * U[7] + U[9] * U[3] * U[6]), F * (-U[4] * U[10] * U[15] + U[4] * U[11] * U[14] + U[8] * U[6] * U[15] - U[8] * U[7] * U[14] - U[12] * U[6] * U[11] + U[12] * U[7] * U[10]), F * (U[0] * U[10] * U[15] - U[0] * U[11] * U[14] - U[8] * U[2] * U[15] + U[8] * U[3] * U[14] + U[12] * U[2] * U[11] - U[12] * U[3] * U[10]), F * (-U[0] * U[6] * U[15] + U[0] * U[7] * U[14] + U[4] * U[2] * U[15] - U[4] * U[3] * U[14] - U[12] * U[2] * U[7] + U[12] * U[3] * U[6]), F * (U[0] * U[6] * U[11] - U[0] * U[7] * U[10] - U[4] * U[2] * U[11] + U[4] * U[3] * U[10] + U[8] * U[2] * U[7] - U[8] * U[3] * U[6]), F * (U[4] * U[9] * U[15] - U[4] * U[11] * U[13] - U[8] * U[5] * U[15] + U[8] * U[7] * U[13] + U[12] * U[5] * U[11] - U[12] * U[7] * U[9]), F * (-U[0] * U[9] * U[15] + U[0] * U[11] * U[13] + U[8] * U[1] * U[15] - U[8] * U[3] * U[13] - U[12] * U[1] * U[11] + U[12] * U[3] * U[9]), F * (U[0] * U[5] * U[15] - U[0] * U[7] * U[13] - U[4] * U[1] * U[15] + U[4] * U[3] * U[13] + U[12] * U[1] * U[7] - U[12] * U[3] * U[5]), F * (-U[0] * U[5] * U[11] + U[0] * U[7] * U[9] + U[4] * U[1] * U[11] - U[4] * U[3] * U[9] - U[8] * U[1] * U[7] + U[8] * U[3] * U[5]), F * (-U[4] * U[9] * U[14] + U[4] * U[10] * U[13] + U[8] * U[5] * U[14] - U[8] * U[6] * U[13] - U[12] * U[5] * U[10] + U[12] * U[6] * U[9]), F * (U[0] * U[9] * U[14] - U[0] * U[10] * U[13] - U[8] * U[1] * U[14] + U[8] * U[2] * U[13] + U[12] * U[1] * U[10] - U[12] * U[2] * U[9]), F * (-U[0] * U[5] * U[14] + U[0] * U[6] * U[13] + U[4] * U[1] * U[14] - U[4] * U[2] * U[13] - U[12] * U[1] * U[6] + U[12] * U[2] * U[5]), F * (U[0] * U[5] * U[10] - U[0] * U[6] * U[9] - U[4] * U[1] * U[10] + U[4] * U[2] * U[9] + U[8] * U[1] * U[6] - U[8] * U[2] * U[5]));\n  }\n  static Compose(U, l, F) {\n    const Q = l.x, Z = l.y, d = l.z, V = l.w, B = Q + Q, t = Z + Z, R = d + d, i = Q * B, s = Q * t, J = Q * R, c = Z * t, N = Z * R, o = d * R, X = V * B, G = V * t, E = V * R, Y = F.x, x = F.y, v = F.z;\n    return new BU((1 - (c + o)) * Y, (s + E) * Y, (J - G) * Y, 0, (s - E) * x, (1 - (i + o)) * x, (N + X) * x, 0, (J + G) * v, (N - X) * v, (1 - (i + c)) * v, 0, U.x, U.y, U.z, 1);\n  }\n  toString() {\n    return `[${this.buffer.join(\", \")}]`;\n  }\n}\nclass jU extends Event {\n  constructor(U) {\n    super(\"objectAdded\"), this.object = U;\n  }\n}\nclass OU extends Event {\n  constructor(U) {\n    super(\"objectRemoved\"), this.object = U;\n  }\n}\nclass LU extends Event {\n  constructor(U) {\n    super(\"objectChanged\"), this.object = U;\n  }\n}\nclass rU extends gU {\n  constructor() {\n    super(), this.positionChanged = !1, this.rotationChanged = !1, this.scaleChanged = !1, this._position = new S(), this._rotation = new K(), this._scale = new S(1, 1, 1), this._transform = new BU(), this._changeEvent = new LU(this), this.update = () => {\n    }, this.applyPosition = () => {\n      this.position = new S();\n    }, this.applyRotation = () => {\n      this.rotation = new K();\n    }, this.applyScale = () => {\n      this.scale = new S(1, 1, 1);\n    };\n  }\n  _updateMatrix() {\n    this._transform = BU.Compose(this._position, this._rotation, this._scale);\n  }\n  get position() {\n    return this._position;\n  }\n  set position(U) {\n    this._position.equals(U) || (this._position = U, this.positionChanged = !0, this._updateMatrix(), this.dispatchEvent(this._changeEvent));\n  }\n  get rotation() {\n    return this._rotation;\n  }\n  set rotation(U) {\n    this._rotation.equals(U) || (this._rotation = U, this.rotationChanged = !0, this._updateMatrix(), this.dispatchEvent(this._changeEvent));\n  }\n  get scale() {\n    return this._scale;\n  }\n  set scale(U) {\n    this._scale.equals(U) || (this._scale = U, this.scaleChanged = !0, this._updateMatrix(), this.dispatchEvent(this._changeEvent));\n  }\n  get forward() {\n    let U = new S(0, 0, 1);\n    return U = this.rotation.apply(U), U;\n  }\n  get transform() {\n    return this._transform;\n  }\n}\nclass dU {\n  constructor(U = 1, l = 0, F = 0, Q = 0, Z = 1, d = 0, V = 0, B = 0, t = 1) {\n    this.buffer = [U, l, F, Q, Z, d, V, B, t];\n  }\n  equals(U) {\n    if (this.buffer.length !== U.buffer.length)\n      return !1;\n    if (this.buffer === U.buffer)\n      return !0;\n    for (let l = 0; l < this.buffer.length; l++)\n      if (this.buffer[l] !== U.buffer[l])\n        return !1;\n    return !0;\n  }\n  multiply(U) {\n    const l = this.buffer, F = U.buffer;\n    return new dU(F[0] * l[0] + F[3] * l[1] + F[6] * l[2], F[1] * l[0] + F[4] * l[1] + F[7] * l[2], F[2] * l[0] + F[5] * l[1] + F[8] * l[2], F[0] * l[3] + F[3] * l[4] + F[6] * l[5], F[1] * l[3] + F[4] * l[4] + F[7] * l[5], F[2] * l[3] + F[5] * l[4] + F[8] * l[5], F[0] * l[6] + F[3] * l[7] + F[6] * l[8], F[1] * l[6] + F[4] * l[7] + F[7] * l[8], F[2] * l[6] + F[5] * l[7] + F[8] * l[8]);\n  }\n  clone() {\n    const U = this.buffer;\n    return new dU(U[0], U[1], U[2], U[3], U[4], U[5], U[6], U[7], U[8]);\n  }\n  static Eye(U = 1) {\n    return new dU(U, 0, 0, 0, U, 0, 0, 0, U);\n  }\n  static Diagonal(U) {\n    return new dU(U.x, 0, 0, 0, U.y, 0, 0, 0, U.z);\n  }\n  static RotationFromQuaternion(U) {\n    return new dU(1 - 2 * U.y * U.y - 2 * U.z * U.z, 2 * U.x * U.y - 2 * U.z * U.w, 2 * U.x * U.z + 2 * U.y * U.w, 2 * U.x * U.y + 2 * U.z * U.w, 1 - 2 * U.x * U.x - 2 * U.z * U.z, 2 * U.y * U.z - 2 * U.x * U.w, 2 * U.x * U.z - 2 * U.y * U.w, 2 * U.y * U.z + 2 * U.x * U.w, 1 - 2 * U.x * U.x - 2 * U.y * U.y);\n  }\n  static RotationFromEuler(U) {\n    const l = Math.cos(U.x), F = Math.sin(U.x), Q = Math.cos(U.y), Z = Math.sin(U.y), d = Math.cos(U.z), V = Math.sin(U.z);\n    return new dU(Q * d + Z * F * V, -Q * V + Z * F * d, Z * l, l * V, l * d, -F, -Z * d + Q * F * V, Z * V + Q * F * d, Q * l);\n  }\n  toString() {\n    return `[${this.buffer.join(\", \")}]`;\n  }\n}\nclass _ {\n  constructor(U = 0, l = null, F = null, Q = null, Z = null) {\n    this.changed = !1, this.detached = !1, this._vertexCount = U, this._positions = l || new Float32Array(0), this._rotations = F || new Float32Array(0), this._scales = Q || new Float32Array(0), this._colors = Z || new Uint8Array(0), this._selection = new Uint8Array(this.vertexCount), this.translate = (d) => {\n      for (let V = 0; V < this.vertexCount; V++)\n        this.positions[3 * V + 0] += d.x, this.positions[3 * V + 1] += d.y, this.positions[3 * V + 2] += d.z;\n      this.changed = !0;\n    }, this.rotate = (d) => {\n      const V = dU.RotationFromQuaternion(d).buffer;\n      for (let B = 0; B < this.vertexCount; B++) {\n        const t = this.positions[3 * B + 0], R = this.positions[3 * B + 1], i = this.positions[3 * B + 2];\n        this.positions[3 * B + 0] = V[0] * t + V[1] * R + V[2] * i, this.positions[3 * B + 1] = V[3] * t + V[4] * R + V[5] * i, this.positions[3 * B + 2] = V[6] * t + V[7] * R + V[8] * i;\n        const s = new K(this.rotations[4 * B + 1], this.rotations[4 * B + 2], this.rotations[4 * B + 3], this.rotations[4 * B + 0]), J = d.multiply(s);\n        this.rotations[4 * B + 1] = J.x, this.rotations[4 * B + 2] = J.y, this.rotations[4 * B + 3] = J.z, this.rotations[4 * B + 0] = J.w;\n      }\n      this.changed = !0;\n    }, this.scale = (d) => {\n      for (let V = 0; V < this.vertexCount; V++)\n        this.positions[3 * V + 0] *= d.x, this.positions[3 * V + 1] *= d.y, this.positions[3 * V + 2] *= d.z, this.scales[3 * V + 0] *= d.x, this.scales[3 * V + 1] *= d.y, this.scales[3 * V + 2] *= d.z;\n      this.changed = !0;\n    }, this.serialize = () => {\n      const d = new Uint8Array(this.vertexCount * _.RowLength), V = new Float32Array(d.buffer), B = new Uint8Array(d.buffer);\n      for (let t = 0; t < this.vertexCount; t++)\n        V[8 * t + 0] = this.positions[3 * t + 0], V[8 * t + 1] = this.positions[3 * t + 1], V[8 * t + 2] = this.positions[3 * t + 2], B[32 * t + 24 + 0] = this.colors[4 * t + 0], B[32 * t + 24 + 1] = this.colors[4 * t + 1], B[32 * t + 24 + 2] = this.colors[4 * t + 2], B[32 * t + 24 + 3] = this.colors[4 * t + 3], V[8 * t + 3 + 0] = this.scales[3 * t + 0], V[8 * t + 3 + 1] = this.scales[3 * t + 1], V[8 * t + 3 + 2] = this.scales[3 * t + 2], B[32 * t + 28 + 0] = 128 * this.rotations[4 * t + 0] + 128 & 255, B[32 * t + 28 + 1] = 128 * this.rotations[4 * t + 1] + 128 & 255, B[32 * t + 28 + 2] = 128 * this.rotations[4 * t + 2] + 128 & 255, B[32 * t + 28 + 3] = 128 * this.rotations[4 * t + 3] + 128 & 255;\n      return d;\n    }, this.reattach = (d, V, B, t, R) => {\n      console.assert(d.byteLength === 3 * this.vertexCount * 4, `Expected ${3 * this.vertexCount * 4} bytes, got ${d.byteLength} bytes`), this._positions = new Float32Array(d), this._rotations = new Float32Array(V), this._scales = new Float32Array(B), this._colors = new Uint8Array(t), this._selection = new Uint8Array(R), this.detached = !1;\n    };\n  }\n  static Deserialize(U) {\n    const l = U.length / _.RowLength, F = new Float32Array(3 * l), Q = new Float32Array(4 * l), Z = new Float32Array(3 * l), d = new Uint8Array(4 * l), V = new Float32Array(U.buffer), B = new Uint8Array(U.buffer);\n    for (let t = 0; t < l; t++)\n      F[3 * t + 0] = V[8 * t + 0], F[3 * t + 1] = V[8 * t + 1], F[3 * t + 2] = V[8 * t + 2], Q[4 * t + 0] = (B[32 * t + 28 + 0] - 128) / 128, Q[4 * t + 1] = (B[32 * t + 28 + 1] - 128) / 128, Q[4 * t + 2] = (B[32 * t + 28 + 2] - 128) / 128, Q[4 * t + 3] = (B[32 * t + 28 + 3] - 128) / 128, Z[3 * t + 0] = V[8 * t + 3 + 0], Z[3 * t + 1] = V[8 * t + 3 + 1], Z[3 * t + 2] = V[8 * t + 3 + 2], d[4 * t + 0] = B[32 * t + 24 + 0], d[4 * t + 1] = B[32 * t + 24 + 1], d[4 * t + 2] = B[32 * t + 24 + 2], d[4 * t + 3] = B[32 * t + 24 + 3];\n    return new _(l, F, Q, Z, d);\n  }\n  get vertexCount() {\n    return this._vertexCount;\n  }\n  get positions() {\n    return this._positions;\n  }\n  get rotations() {\n    return this._rotations;\n  }\n  get scales() {\n    return this._scales;\n  }\n  get colors() {\n    return this._colors;\n  }\n  get selection() {\n    return this._selection;\n  }\n}\n_.RowLength = 32;\nclass cU {\n  static SplatToPLY(U, l) {\n    let F = `ply\nformat binary_little_endian 1.0\n`;\n    F += `element vertex ${l}\n`;\n    const Q = [\"x\", \"y\", \"z\", \"nx\", \"ny\", \"nz\", \"f_dc_0\", \"f_dc_1\", \"f_dc_2\"];\n    for (let c = 0; c < 45; c++)\n      Q.push(`f_rest_${c}`);\n    Q.push(\"opacity\"), Q.push(\"scale_0\"), Q.push(\"scale_1\"), Q.push(\"scale_2\"), Q.push(\"rot_0\"), Q.push(\"rot_1\"), Q.push(\"rot_2\"), Q.push(\"rot_3\");\n    for (const c of Q)\n      F += `property float ${c}\n`;\n    F += `end_header\n`;\n    const Z = new TextEncoder().encode(F), d = 248, V = l * d, B = new DataView(new ArrayBuffer(Z.length + V));\n    new Uint8Array(B.buffer).set(Z, 0);\n    const t = new Float32Array(U), R = new Uint8Array(U), i = Z.length, s = 220, J = 232;\n    for (let c = 0; c < l; c++) {\n      const N = t[8 * c + 0], o = t[8 * c + 1], X = t[8 * c + 2], G = (R[32 * c + 24 + 0] / 255 - 0.5) / this.SH_C0, E = (R[32 * c + 24 + 1] / 255 - 0.5) / this.SH_C0, Y = (R[32 * c + 24 + 2] / 255 - 0.5) / this.SH_C0, x = R[32 * c + 24 + 3] / 255, v = Math.log(x / (1 - x)), D = Math.log(t[8 * c + 3 + 0]), p = Math.log(t[8 * c + 3 + 1]), I = Math.log(t[8 * c + 3 + 2]);\n      let u = new K((R[32 * c + 28 + 1] - 128) / 128, (R[32 * c + 28 + 2] - 128) / 128, (R[32 * c + 28 + 3] - 128) / 128, (R[32 * c + 28 + 0] - 128) / 128);\n      u = u.normalize();\n      const q = u.w, ZU = u.x, RU = u.y, nU = u.z;\n      B.setFloat32(i + d * c + 0, N, !0), B.setFloat32(i + d * c + 4, o, !0), B.setFloat32(i + d * c + 8, X, !0), B.setFloat32(i + d * c + 24 + 0, G, !0), B.setFloat32(i + d * c + 24 + 4, E, !0), B.setFloat32(i + d * c + 24 + 8, Y, !0), B.setFloat32(i + d * c + 216, v, !0), B.setFloat32(i + d * c + s + 0, D, !0), B.setFloat32(i + d * c + s + 4, p, !0), B.setFloat32(i + d * c + s + 8, I, !0), B.setFloat32(i + d * c + J + 0, q, !0), B.setFloat32(i + d * c + J + 4, ZU, !0), B.setFloat32(i + d * c + J + 8, RU, !0), B.setFloat32(i + d * c + J + 12, nU, !0);\n    }\n    return B.buffer;\n  }\n}\ncU.SH_C0 = 0.28209479177387814;\nclass tU extends rU {\n  constructor(U = void 0) {\n    super(), this.selectedChanged = !1, this._selected = !1, this._data = U || new _(), this.applyPosition = () => {\n      this.data.translate(this.position), this.position = new S();\n    }, this.applyRotation = () => {\n      this.data.rotate(this.rotation), this.rotation = new K();\n    }, this.applyScale = () => {\n      this.data.scale(this.scale), this.scale = new S(1, 1, 1);\n    };\n  }\n  saveToFile(U = null, l = null) {\n    if (!document)\n      return;\n    if (l) {\n      if (l !== \"splat\" && l !== \"ply\")\n        throw new Error(\"Invalid format. Must be 'splat' or 'ply'\");\n    } else\n      l = \"splat\";\n    if (!U) {\n      const d = /* @__PURE__ */ new Date();\n      U = `splat-${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}.${l}`;\n    }\n    this.applyRotation(), this.applyScale(), this.applyPosition();\n    const F = this.data.serialize();\n    let Q;\n    if (l === \"ply\") {\n      const d = cU.SplatToPLY(F.buffer, this.data.vertexCount);\n      Q = new Blob([d], { type: \"application/octet-stream\" });\n    } else\n      Q = new Blob([F.buffer], { type: \"application/octet-stream\" });\n    const Z = document.createElement(\"a\");\n    Z.download = U, Z.href = URL.createObjectURL(Q), Z.click();\n  }\n  get data() {\n    return this._data;\n  }\n  get selected() {\n    return this._selected;\n  }\n  set selected(U) {\n    this._selected !== U && (this._selected = U, this.selectedChanged = !0, this.dispatchEvent(this._changeEvent));\n  }\n}\nclass PU {\n  constructor() {\n    this._fx = 1132, this._fy = 1132, this._near = 0.1, this._far = 100, this._width = 512, this._height = 512, this._projectionMatrix = new BU(), this._viewMatrix = new BU(), this._viewProj = new BU(), this._updateProjectionMatrix = () => {\n      this._projectionMatrix = new BU(2 * this.fx / this.width, 0, 0, 0, 0, -2 * this.fy / this.height, 0, 0, 0, 0, this.far / (this.far - this.near), 1, 0, 0, -this.far * this.near / (this.far - this.near), 0), this._viewProj = this.projectionMatrix.multiply(this.viewMatrix);\n    }, this.update = (U, l) => {\n      const F = dU.RotationFromQuaternion(l).buffer, Q = U.flat();\n      this._viewMatrix = new BU(F[0], F[1], F[2], 0, F[3], F[4], F[5], 0, F[6], F[7], F[8], 0, -Q[0] * F[0] - Q[1] * F[3] - Q[2] * F[6], -Q[0] * F[1] - Q[1] * F[4] - Q[2] * F[7], -Q[0] * F[2] - Q[1] * F[5] - Q[2] * F[8], 1), this._viewProj = this.projectionMatrix.multiply(this.viewMatrix);\n    }, this.setSize = (U, l) => {\n      this._width = U, this._height = l, this._updateProjectionMatrix();\n    };\n  }\n  get fx() {\n    return this._fx;\n  }\n  set fx(U) {\n    this._fx !== U && (this._fx = U, this._updateProjectionMatrix());\n  }\n  get fy() {\n    return this._fy;\n  }\n  set fy(U) {\n    this._fy !== U && (this._fy = U, this._updateProjectionMatrix());\n  }\n  get near() {\n    return this._near;\n  }\n  set near(U) {\n    this._near !== U && (this._near = U, this._updateProjectionMatrix());\n  }\n  get far() {\n    return this._far;\n  }\n  set far(U) {\n    this._far !== U && (this._far = U, this._updateProjectionMatrix());\n  }\n  get width() {\n    return this._width;\n  }\n  get height() {\n    return this._height;\n  }\n  get projectionMatrix() {\n    return this._projectionMatrix;\n  }\n  get viewMatrix() {\n    return this._viewMatrix;\n  }\n  get viewProj() {\n    return this._viewProj;\n  }\n}\nclass QU {\n  constructor(U = 0, l = 0, F = 0, Q = 0) {\n    this.x = U, this.y = l, this.z = F, this.w = Q;\n  }\n  equals(U) {\n    return this.x === U.x && this.y === U.y && this.z === U.z && this.w === U.w;\n  }\n  add(U) {\n    return typeof U == \"number\" ? new QU(this.x + U, this.y + U, this.z + U, this.w + U) : new QU(this.x + U.x, this.y + U.y, this.z + U.z, this.w + U.w);\n  }\n  subtract(U) {\n    return typeof U == \"number\" ? new QU(this.x - U, this.y - U, this.z - U, this.w - U) : new QU(this.x - U.x, this.y - U.y, this.z - U.z, this.w - U.w);\n  }\n  multiply(U) {\n    return typeof U == \"number\" ? new QU(this.x * U, this.y * U, this.z * U, this.w * U) : U instanceof QU ? new QU(this.x * U.x, this.y * U.y, this.z * U.z, this.w * U.w) : new QU(this.x * U.buffer[0] + this.y * U.buffer[4] + this.z * U.buffer[8] + this.w * U.buffer[12], this.x * U.buffer[1] + this.y * U.buffer[5] + this.z * U.buffer[9] + this.w * U.buffer[13], this.x * U.buffer[2] + this.y * U.buffer[6] + this.z * U.buffer[10] + this.w * U.buffer[14], this.x * U.buffer[3] + this.y * U.buffer[7] + this.z * U.buffer[11] + this.w * U.buffer[15]);\n  }\n  dot(U) {\n    return this.x * U.x + this.y * U.y + this.z * U.z + this.w * U.w;\n  }\n  lerp(U, l) {\n    return new QU(this.x + (U.x - this.x) * l, this.y + (U.y - this.y) * l, this.z + (U.z - this.z) * l, this.w + (U.w - this.w) * l);\n  }\n  magnitude() {\n    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n  }\n  distanceTo(U) {\n    return Math.sqrt((this.x - U.x) ** 2 + (this.y - U.y) ** 2 + (this.z - U.z) ** 2 + (this.w - U.w) ** 2);\n  }\n  normalize() {\n    const U = this.magnitude();\n    return new QU(this.x / U, this.y / U, this.z / U, this.w / U);\n  }\n  flat() {\n    return [this.x, this.y, this.z, this.w];\n  }\n  clone() {\n    return new QU(this.x, this.y, this.z, this.w);\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n}\nclass _U extends rU {\n  constructor(U = void 0) {\n    super(), this._data = U || new PU(), this._position = new S(0, 0, -5), this.update = () => {\n      this.data.update(this.position, this.rotation);\n    }, this.screenPointToRay = (l, F) => {\n      const Q = new QU(l, F, -1, 1), Z = this._data.projectionMatrix.invert(), d = Q.multiply(Z), V = this._data.viewMatrix.invert(), B = d.multiply(V);\n      return new S(B.x / B.w, B.y / B.w, B.z / B.w).subtract(this.position).normalize();\n    };\n  }\n  get data() {\n    return this._data;\n  }\n}\nclass qU extends gU {\n  constructor() {\n    super(), this._objects = [], this.addObject = (U) => {\n      this.objects.push(U), this.dispatchEvent(new jU(U));\n    }, this.removeObject = (U) => {\n      const l = this.objects.indexOf(U);\n      if (l < 0)\n        throw new Error(\"Object not found in scene\");\n      this.objects.splice(l, 1), this.dispatchEvent(new OU(U));\n    }, this.findObject = (U) => {\n      for (const l of this.objects)\n        if (U(l))\n          return l;\n    }, this.findObjectOfType = (U) => {\n      for (const l of this.objects)\n        if (l instanceof U)\n          return l;\n    }, this.reset = () => {\n      const U = this.objects.slice();\n      for (const l of U)\n        this.removeObject(l);\n    }, this.reset();\n  }\n  saveToFile(U = null, l = null) {\n    if (!document)\n      return;\n    if (l) {\n      if (l !== \"splat\" && l !== \"ply\")\n        throw new Error(\"Invalid format. Must be 'splat' or 'ply'\");\n    } else\n      l = \"splat\";\n    if (!U) {\n      const t = /* @__PURE__ */ new Date();\n      U = `scene-${t.getFullYear()}-${t.getMonth() + 1}-${t.getDate()}.${l}`;\n    }\n    const F = [];\n    let Q = 0;\n    for (const t of this.objects)\n      if (t.applyRotation(), t.applyScale(), t.applyPosition(), t instanceof tU) {\n        const R = t.data.serialize();\n        F.push(R), Q += t.data.vertexCount;\n      }\n    const Z = new Uint8Array(Q * _.RowLength);\n    let d, V = 0;\n    for (const t of F)\n      Z.set(t, V), V += t.length;\n    if (l === \"ply\") {\n      const t = cU.SplatToPLY(Z.buffer, Q);\n      d = new Blob([t], { type: \"application/octet-stream\" });\n    } else\n      d = new Blob([Z.buffer], { type: \"application/octet-stream\" });\n    const B = document.createElement(\"a\");\n    B.download = U, B.href = URL.createObjectURL(d), B.click();\n  }\n  get objects() {\n    return this._objects;\n  }\n}\nasync function NU(r, U) {\n  const l = await fetch(r, { mode: \"cors\", credentials: \"omit\", cache: U ? \"force-cache\" : \"default\" });\n  if (l.status != 200)\n    throw new Error(l.status + \" Unable to load \" + l.url);\n  return l;\n}\nasync function GU(r, U) {\n  return r.headers.has(\"content-length\") ? async function(l, F) {\n    const Q = l.body.getReader(), Z = parseInt(l.headers.get(\"content-length\")), d = new Uint8Array(Z);\n    let V = 0;\n    for (; ; ) {\n      const { done: B, value: t } = await Q.read();\n      if (B)\n        break;\n      d.set(t, V), V += t.length, F == null || F(V / Z);\n    }\n    return d;\n  }(r, U) : async function(l, F) {\n    const Q = l.body.getReader(), Z = [];\n    let d = 0;\n    for (; ; ) {\n      const { done: t, value: R } = await Q.read();\n      if (t)\n        break;\n      Z.push(R), d += R.length;\n    }\n    const V = new Uint8Array(d);\n    let B = 0;\n    for (const t of Z)\n      V.set(t, B), B += t.length, F == null || F(B / d);\n    return V;\n  }(r, U);\n}\nclass $U {\n  static async LoadAsync(U, l, F, Q = !1) {\n    const Z = await NU(U, Q), d = await GU(Z, F), V = _.Deserialize(d), B = new tU(V);\n    return l.addObject(B), B;\n  }\n  static async LoadFromFileAsync(U, l, F) {\n    const Q = new FileReader();\n    let Z = new tU();\n    return Q.onload = (d) => {\n      const V = new Uint8Array(d.target.result), B = _.Deserialize(V);\n      Z = new tU(B), l.addObject(Z);\n    }, Q.onprogress = (d) => {\n      F == null || F(d.loaded / d.total);\n    }, Q.readAsArrayBuffer(U), await new Promise((d) => {\n      Q.onloadend = () => {\n        d();\n      };\n    }), Z;\n  }\n}\nclass UF {\n  static async LoadAsync(U, l, F, Q = \"\", Z = !1) {\n    const d = await NU(U, Z), V = await GU(d, F);\n    if (V[0] !== 112 || V[1] !== 108 || V[2] !== 121 || V[3] !== 10)\n      throw new Error(\"Invalid PLY file\");\n    const B = new Uint8Array(this._ParsePLYBuffer(V.buffer, Q)), t = _.Deserialize(B), R = new tU(t);\n    return l.addObject(R), R;\n  }\n  static async LoadFromFileAsync(U, l, F, Q = \"\") {\n    const Z = new FileReader();\n    let d = new tU();\n    return Z.onload = (V) => {\n      const B = new Uint8Array(this._ParsePLYBuffer(V.target.result, Q)), t = _.Deserialize(B);\n      d = new tU(t), l.addObject(d);\n    }, Z.onprogress = (V) => {\n      F == null || F(V.loaded / V.total);\n    }, Z.readAsArrayBuffer(U), await new Promise((V) => {\n      Z.onloadend = () => {\n        V();\n      };\n    }), d;\n  }\n  static _ParsePLYBuffer(U, l) {\n    const F = new Uint8Array(U), Q = new TextDecoder().decode(F.slice(0, 10240)), Z = `end_header\n`, d = Q.indexOf(Z);\n    if (d < 0)\n      throw new Error(\"Unable to read .ply file header\");\n    const V = parseInt(/element vertex (\\d+)\\n/.exec(Q)[1]);\n    let B = 0;\n    const t = { double: 8, int: 4, uint: 4, float: 4, short: 2, ushort: 2, uchar: 1 }, R = [];\n    for (const c of Q.slice(0, d).split(`\n`).filter((N) => N.startsWith(\"property \"))) {\n      const [N, o, X] = c.split(\" \");\n      if (R.push({ name: X, type: o, offset: B }), !t[o])\n        throw new Error(`Unsupported property type: ${o}`);\n      B += t[o];\n    }\n    const i = new DataView(U, d + 11), s = new ArrayBuffer(_.RowLength * V), J = K.FromEuler(new S(Math.PI / 2, 0, 0));\n    for (let c = 0; c < V; c++) {\n      const N = new Float32Array(s, c * _.RowLength, 3), o = new Float32Array(s, c * _.RowLength + 12, 3), X = new Uint8ClampedArray(s, c * _.RowLength + 24, 4), G = new Uint8ClampedArray(s, c * _.RowLength + 28, 4);\n      let E = 255, Y = 0, x = 0, v = 0;\n      R.forEach((p) => {\n        let I;\n        switch (p.type) {\n          case \"float\":\n            I = i.getFloat32(p.offset + c * B, !0);\n            break;\n          case \"int\":\n            I = i.getInt32(p.offset + c * B, !0);\n            break;\n          default:\n            throw new Error(`Unsupported property type: ${p.type}`);\n        }\n        switch (p.name) {\n          case \"x\":\n            N[0] = I;\n            break;\n          case \"y\":\n            N[1] = I;\n            break;\n          case \"z\":\n            N[2] = I;\n            break;\n          case \"scale_0\":\n            o[0] = Math.exp(I);\n            break;\n          case \"scale_1\":\n            o[1] = Math.exp(I);\n            break;\n          case \"scale_2\":\n            o[2] = Math.exp(I);\n            break;\n          case \"red\":\n            X[0] = I;\n            break;\n          case \"green\":\n            X[1] = I;\n            break;\n          case \"blue\":\n            X[2] = I;\n            break;\n          case \"f_dc_0\":\n            X[0] = 255 * (0.5 + cU.SH_C0 * I);\n            break;\n          case \"f_dc_1\":\n            X[1] = 255 * (0.5 + cU.SH_C0 * I);\n            break;\n          case \"f_dc_2\":\n            X[2] = 255 * (0.5 + cU.SH_C0 * I);\n            break;\n          case \"f_dc_3\":\n            X[3] = 255 * (0.5 + cU.SH_C0 * I);\n            break;\n          case \"opacity\":\n            X[3] = 1 / (1 + Math.exp(-I)) * 255;\n            break;\n          case \"rot_0\":\n            E = I;\n            break;\n          case \"rot_1\":\n            Y = I;\n            break;\n          case \"rot_2\":\n            x = I;\n            break;\n          case \"rot_3\":\n            v = I;\n        }\n      });\n      let D = new K(Y, x, v, E);\n      switch (l) {\n        case \"polycam\": {\n          const p = N[1];\n          N[1] = -N[2], N[2] = p, D = J.multiply(D);\n          break;\n        }\n        case \"\":\n          break;\n        default:\n          throw new Error(`Unsupported format: ${l}`);\n      }\n      D = D.normalize(), G[0] = 128 * D.w + 128, G[1] = 128 * D.x + 128, G[2] = 128 * D.y + 128, G[3] = 128 * D.z + 128;\n    }\n    return s;\n  }\n}\nfunction FF(r, U, l) {\n  var F = U === void 0 ? null : U, Q = function(B, t) {\n    var R = atob(B);\n    if (t) {\n      for (var i = new Uint8Array(R.length), s = 0, J = R.length; s < J; ++s)\n        i[s] = R.charCodeAt(s);\n      return String.fromCharCode.apply(null, new Uint16Array(i.buffer));\n    }\n    return R;\n  }(r, l !== void 0 && l), Z = Q.indexOf(`\n`, 10) + 1, d = Q.substring(Z) + (F ? \"//# sourceMappingURL=\" + F : \"\"), V = new Blob([d], { type: \"application/javascript\" });\n  return URL.createObjectURL(V);\n}\nfunction EU(r, U, l) {\n  var F;\n  return function(Q) {\n    return F = F || FF(r, U, l), new Worker(F, Q);\n  };\n}\nvar lF = EU(\"Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgdmFyIGxvYWRXYXNtID0gKCgpID0+IHsKICAgIAogICAgcmV0dXJuICgKICBmdW5jdGlvbihtb2R1bGVBcmcgPSB7fSkgewoKICB2YXIgTW9kdWxlPW1vZHVsZUFyZzt2YXIgcmVhZHlQcm9taXNlUmVzb2x2ZSxyZWFkeVByb21pc2VSZWplY3Q7TW9kdWxlWyJyZWFkeSJdPW5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PntyZWFkeVByb21pc2VSZXNvbHZlPXJlc29sdmU7cmVhZHlQcm9taXNlUmVqZWN0PXJlamVjdDt9KTt2YXIgbW9kdWxlT3ZlcnJpZGVzPU9iamVjdC5hc3NpZ24oe30sTW9kdWxlKTt2YXIgc2NyaXB0RGlyZWN0b3J5PSIiO2Z1bmN0aW9uIGxvY2F0ZUZpbGUocGF0aCl7aWYoTW9kdWxlWyJsb2NhdGVGaWxlIl0pe3JldHVybiBNb2R1bGVbImxvY2F0ZUZpbGUiXShwYXRoLHNjcmlwdERpcmVjdG9yeSl9cmV0dXJuIHNjcmlwdERpcmVjdG9yeStwYXRofXZhciByZWFkQmluYXJ5O3t7c2NyaXB0RGlyZWN0b3J5PXNlbGYubG9jYXRpb24uaHJlZjt9aWYoc2NyaXB0RGlyZWN0b3J5LnN0YXJ0c1dpdGgoImJsb2I6Iikpe3NjcmlwdERpcmVjdG9yeT0iIjt9ZWxzZSB7c2NyaXB0RGlyZWN0b3J5PXNjcmlwdERpcmVjdG9yeS5zdWJzdHIoMCxzY3JpcHREaXJlY3RvcnkucmVwbGFjZSgvWz8jXS4qLywiIikubGFzdEluZGV4T2YoIi8iKSsxKTt9e3tyZWFkQmluYXJ5PXVybD0+e3ZhciB4aHI9bmV3IFhNTEh0dHBSZXF1ZXN0O3hoci5vcGVuKCJHRVQiLHVybCxmYWxzZSk7eGhyLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiO3hoci5zZW5kKG51bGwpO3JldHVybiBuZXcgVWludDhBcnJheSh4aHIucmVzcG9uc2UpfTt9fX1Nb2R1bGVbInByaW50Il18fGNvbnNvbGUubG9nLmJpbmQoY29uc29sZSk7dmFyIGVycj1Nb2R1bGVbInByaW50RXJyIl18fGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTtPYmplY3QuYXNzaWduKE1vZHVsZSxtb2R1bGVPdmVycmlkZXMpO21vZHVsZU92ZXJyaWRlcz1udWxsO2lmKE1vZHVsZVsiYXJndW1lbnRzIl0pTW9kdWxlWyJhcmd1bWVudHMiXTtpZihNb2R1bGVbInRoaXNQcm9ncmFtIl0pTW9kdWxlWyJ0aGlzUHJvZ3JhbSJdO2lmKE1vZHVsZVsicXVpdCJdKU1vZHVsZVsicXVpdCJdO3ZhciB3YXNtQmluYXJ5O2lmKE1vZHVsZVsid2FzbUJpbmFyeSJdKXdhc21CaW5hcnk9TW9kdWxlWyJ3YXNtQmluYXJ5Il07aWYodHlwZW9mIFdlYkFzc2VtYmx5IT0ib2JqZWN0Iil7YWJvcnQoIm5vIG5hdGl2ZSB3YXNtIHN1cHBvcnQgZGV0ZWN0ZWQiKTt9ZnVuY3Rpb24gaW50QXJyYXlGcm9tQmFzZTY0KHMpe3ZhciBkZWNvZGVkPWF0b2Iocyk7dmFyIGJ5dGVzPW5ldyBVaW50OEFycmF5KGRlY29kZWQubGVuZ3RoKTtmb3IodmFyIGk9MDtpPGRlY29kZWQubGVuZ3RoOysraSl7Ynl0ZXNbaV09ZGVjb2RlZC5jaGFyQ29kZUF0KGkpO31yZXR1cm4gYnl0ZXN9ZnVuY3Rpb24gdHJ5UGFyc2VBc0RhdGFVUkkoZmlsZW5hbWUpe2lmKCFpc0RhdGFVUkkoZmlsZW5hbWUpKXtyZXR1cm59cmV0dXJuIGludEFycmF5RnJvbUJhc2U2NChmaWxlbmFtZS5zbGljZShkYXRhVVJJUHJlZml4Lmxlbmd0aCkpfXZhciB3YXNtTWVtb3J5O3ZhciBBQk9SVD1mYWxzZTt2YXIgSEVBUDgsSEVBUFU4LEhFQVAxNixIRUFQVTE2LEhFQVAzMixIRUFQVTMyLEhFQVBGMzIsSEVBUEY2NDtmdW5jdGlvbiB1cGRhdGVNZW1vcnlWaWV3cygpe3ZhciBiPXdhc21NZW1vcnkuYnVmZmVyO01vZHVsZVsiSEVBUDgiXT1IRUFQOD1uZXcgSW50OEFycmF5KGIpO01vZHVsZVsiSEVBUDE2Il09SEVBUDE2PW5ldyBJbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUFU4Il09SEVBUFU4PW5ldyBVaW50OEFycmF5KGIpO01vZHVsZVsiSEVBUFUxNiJdPUhFQVBVMTY9bmV3IFVpbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUDMyIl09SEVBUDMyPW5ldyBJbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUFUzMiJdPUhFQVBVMzI9bmV3IFVpbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUEYzMiJdPUhFQVBGMzI9bmV3IEZsb2F0MzJBcnJheShiKTtNb2R1bGVbIkhFQVBGNjQiXT1IRUFQRjY0PW5ldyBGbG9hdDY0QXJyYXkoYik7fXZhciBfX0FUUFJFUlVOX189W107dmFyIF9fQVRJTklUX189W107dmFyIF9fQVRQT1NUUlVOX189W107ZnVuY3Rpb24gcHJlUnVuKCl7aWYoTW9kdWxlWyJwcmVSdW4iXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlUnVuIl09PSJmdW5jdGlvbiIpTW9kdWxlWyJwcmVSdW4iXT1bTW9kdWxlWyJwcmVSdW4iXV07d2hpbGUoTW9kdWxlWyJwcmVSdW4iXS5sZW5ndGgpe2FkZE9uUHJlUnVuKE1vZHVsZVsicHJlUnVuIl0uc2hpZnQoKSk7fX1jYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUUFJFUlVOX18pO31mdW5jdGlvbiBpbml0UnVudGltZSgpe2NhbGxSdW50aW1lQ2FsbGJhY2tzKF9fQVRJTklUX18pO31mdW5jdGlvbiBwb3N0UnVuKCl7aWYoTW9kdWxlWyJwb3N0UnVuIl0pe2lmKHR5cGVvZiBNb2R1bGVbInBvc3RSdW4iXT09ImZ1bmN0aW9uIilNb2R1bGVbInBvc3RSdW4iXT1bTW9kdWxlWyJwb3N0UnVuIl1dO3doaWxlKE1vZHVsZVsicG9zdFJ1biJdLmxlbmd0aCl7YWRkT25Qb3N0UnVuKE1vZHVsZVsicG9zdFJ1biJdLnNoaWZ0KCkpO319Y2FsbFJ1bnRpbWVDYWxsYmFja3MoX19BVFBPU1RSVU5fXyk7fWZ1bmN0aW9uIGFkZE9uUHJlUnVuKGNiKXtfX0FUUFJFUlVOX18udW5zaGlmdChjYik7fWZ1bmN0aW9uIGFkZE9uSW5pdChjYil7X19BVElOSVRfXy51bnNoaWZ0KGNiKTt9ZnVuY3Rpb24gYWRkT25Qb3N0UnVuKGNiKXtfX0FUUE9TVFJVTl9fLnVuc2hpZnQoY2IpO312YXIgcnVuRGVwZW5kZW5jaWVzPTA7dmFyIGRlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2Z1bmN0aW9uIGFkZFJ1bkRlcGVuZGVuY3koaWQpe3J1bkRlcGVuZGVuY2llcysrO01vZHVsZVsibW9uaXRvclJ1bkRlcGVuZGVuY2llcyJdPy4ocnVuRGVwZW5kZW5jaWVzKTt9ZnVuY3Rpb24gcmVtb3ZlUnVuRGVwZW5kZW5jeShpZCl7cnVuRGVwZW5kZW5jaWVzLS07TW9kdWxlWyJtb25pdG9yUnVuRGVwZW5kZW5jaWVzIl0/LihydW5EZXBlbmRlbmNpZXMpO2lmKHJ1bkRlcGVuZGVuY2llcz09MCl7aWYoZGVwZW5kZW5jaWVzRnVsZmlsbGVkKXt2YXIgY2FsbGJhY2s9ZGVwZW5kZW5jaWVzRnVsZmlsbGVkO2RlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2NhbGxiYWNrKCk7fX19ZnVuY3Rpb24gYWJvcnQod2hhdCl7TW9kdWxlWyJvbkFib3J0Il0/Lih3aGF0KTt3aGF0PSJBYm9ydGVkKCIrd2hhdCsiKSI7ZXJyKHdoYXQpO0FCT1JUPXRydWU7d2hhdCs9Ii4gQnVpbGQgd2l0aCAtc0FTU0VSVElPTlMgZm9yIG1vcmUgaW5mby4iO3ZhciBlPW5ldyBXZWJBc3NlbWJseS5SdW50aW1lRXJyb3Iod2hhdCk7cmVhZHlQcm9taXNlUmVqZWN0KGUpO3Rocm93IGV9dmFyIGRhdGFVUklQcmVmaXg9ImRhdGE6YXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtO2Jhc2U2NCwiO3ZhciBpc0RhdGFVUkk9ZmlsZW5hbWU9PmZpbGVuYW1lLnN0YXJ0c1dpdGgoZGF0YVVSSVByZWZpeCk7dmFyIHdhc21CaW5hcnlGaWxlO3dhc21CaW5hcnlGaWxlPSJkYXRhOmFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTtiYXNlNjQsQUdGemJRRUFBQUFCV3cxZ0JIOS9mMzhBWUFOL2YzOEFZQVYvZjM5L2Z3QmdCbjkvZjM5L2Z3QmdBWDhCZjJBQmZ3QmdBMzkvZndGL1lBSi9md0JnQUFCZ0FuOS9BWDlnQjM5L2YzOS9mMzhBWUFSL2YzNStBR0FLZjM5L2YzOS9mMzkvZndBQ1BRb0JZUUZoQUFFQllRRmlBQUlCWVFGakFBRUJZUUZrQUFjQllRRmxBQUVCWVFGbUFBb0JZUUZuQUFRQllRRm9BQVVCWVFGcEFBQUJZUUZxQUFjREdSZ0dCQVVJQlFVSkN3Z0JBQUVFQkFNREFnSUFBQWtHQmd3RUJRRndBUkFRQlFjQkFZQUNnSUFDQmdnQmZ3RkJzSjRFQ3djWkJnRnJBZ0FCYkFBTkFXMEFJUUZ1QVFBQmJ3QVhBWEFBRHdrVkFRQkJBUXNQRWhZTURnNGdEQjhZR2gwTUdSc2NDc0pPR0hFQkFYOGdBa1VFUUNBQUtBSUVJQUVvQWdSR0R3c2dBQ0FCUmdSQVFRRVBDd0pBSUFBb0FnUWlBaTBBQUNJQVJTQUFJQUVvQWdRaUFTMEFBQ0lEUjNJTkFBTkFJQUV0QUFFaEF5QUNMUUFCSWdCRkRRRWdBVUVCYWlFQklBSkJBV29oQWlBQUlBTkdEUUFMQ3lBQUlBTkdDMDhCQW45QnFCb29BZ0FpQVNBQVFRZHFRWGh4SWdKcUlRQUNRQ0FDUVFBZ0FDQUJUUnRGQkVBZ0FEOEFRUkIwVFEwQklBQVFCZzBCQzBHNEdrRXdOZ0lBUVg4UEMwR29HaUFBTmdJQUlBRUxCZ0FnQUJBUEN5a0FRYkFhUVFFMkFnQkJ0QnBCQURZQ0FCQVNRYlFhUWF3YUtBSUFOZ0lBUWF3YVFiQWFOZ0lBQ3dJQUM5a0xBUWQvQWtBZ0FFVU5BQ0FBUVFocklnTWdBRUVFYXlnQ0FDSUJRWGh4SWdCcUlRVUNRQ0FCUVFGeERRQWdBVUVDY1VVTkFTQURJQU1vQWdBaUFXc2lBMEhNR2lnQ0FFa05BU0FBSUFGcUlRQUNRQUpBUWRBYUtBSUFJQU5IQkVBZ0F5Z0NEQ0VDSUFGQi93Rk5CRUFnQVVFRGRpRUJJQU1vQWdnaUJDQUNSZ1JBUWJ3YVFid2FLQUlBUVg0Z0FYZHhOZ0lBREFVTElBUWdBallDRENBQ0lBUTJBZ2dNQkFzZ0F5Z0NHQ0VHSUFJZ0EwY0VRQ0FES0FJSUlnRWdBallDRENBQ0lBRTJBZ2dNQXdzZ0F5Z0NGQ0lCQkg4Z0EwRVVhZ1VnQXlnQ0VDSUJSUTBDSUFOQkVHb0xJUVFEUUNBRUlRY2dBU0lDUVJScUlRUWdBaWdDRkNJQkRRQWdBa0VRYWlFRUlBSW9BaEFpQVEwQUN5QUhRUUEyQWdBTUFnc2dCU2dDQkNJQlFRTnhRUU5IRFFKQnhCb2dBRFlDQUNBRklBRkJmbkUyQWdRZ0F5QUFRUUZ5TmdJRUlBVWdBRFlDQUE4TFFRQWhBZ3NnQmtVTkFBSkFJQU1vQWh3aUFVRUNkRUhzSEdvaUJDZ0NBQ0FEUmdSQUlBUWdBallDQUNBQ0RRRkJ3QnBCd0Jvb0FnQkJmaUFCZDNFMkFnQU1BZ3NnQmtFUVFSUWdCaWdDRUNBRFJodHFJQUkyQWdBZ0FrVU5BUXNnQWlBR05nSVlJQU1vQWhBaUFRUkFJQUlnQVRZQ0VDQUJJQUkyQWhnTElBTW9BaFFpQVVVTkFDQUNJQUUyQWhRZ0FTQUNOZ0lZQ3lBRElBVlBEUUFnQlNnQ0JDSUJRUUZ4UlEwQUFrQUNRQUpBQWtBZ0FVRUNjVVVFUUVIVUdpZ0NBQ0FGUmdSQVFkUWFJQU0yQWdCQnlCcEJ5Qm9vQWdBZ0FHb2lBRFlDQUNBRElBQkJBWEkyQWdRZ0EwSFFHaWdDQUVjTkJrSEVHa0VBTmdJQVFkQWFRUUEyQWdBUEMwSFFHaWdDQUNBRlJnUkFRZEFhSUFNMkFnQkJ4QnBCeEJvb0FnQWdBR29pQURZQ0FDQURJQUJCQVhJMkFnUWdBQ0FEYWlBQU5nSUFEd3NnQVVGNGNTQUFhaUVBSUFVb0Fnd2hBaUFCUWY4QlRRUkFJQUZCQTNZaEFTQUZLQUlJSWdRZ0FrWUVRRUc4R2tHOEdpZ0NBRUYrSUFGM2NUWUNBQXdGQ3lBRUlBSTJBZ3dnQWlBRU5nSUlEQVFMSUFVb0FoZ2hCaUFDSUFWSEJFQkJ6Qm9vQWdBYUlBVW9BZ2dpQVNBQ05nSU1JQUlnQVRZQ0NBd0RDeUFGS0FJVUlnRUVmeUFGUVJScUJTQUZLQUlRSWdGRkRRSWdCVUVRYWdzaEJBTkFJQVFoQnlBQklnSkJGR29oQkNBQ0tBSVVJZ0VOQUNBQ1FSQnFJUVFnQWlnQ0VDSUJEUUFMSUFkQkFEWUNBQXdDQ3lBRklBRkJmbkUyQWdRZ0F5QUFRUUZ5TmdJRUlBQWdBMm9nQURZQ0FBd0RDMEVBSVFJTElBWkZEUUFDUUNBRktBSWNJZ0ZCQW5SQjdCeHFJZ1FvQWdBZ0JVWUVRQ0FFSUFJMkFnQWdBZzBCUWNBYVFjQWFLQUlBUVg0Z0FYZHhOZ0lBREFJTElBWkJFRUVVSUFZb0FoQWdCVVliYWlBQ05nSUFJQUpGRFFFTElBSWdCallDR0NBRktBSVFJZ0VFUUNBQ0lBRTJBaEFnQVNBQ05nSVlDeUFGS0FJVUlnRkZEUUFnQWlBQk5nSVVJQUVnQWpZQ0dBc2dBeUFBUVFGeU5nSUVJQUFnQTJvZ0FEWUNBQ0FEUWRBYUtBSUFSdzBBUWNRYUlBQTJBZ0FQQ3lBQVFmOEJUUVJBSUFCQmVIRkI1QnBxSVFFQ2YwRzhHaWdDQUNJRVFRRWdBRUVEZG5RaUFIRkZCRUJCdkJvZ0FDQUVjallDQUNBQkRBRUxJQUVvQWdnTElRQWdBU0FETmdJSUlBQWdBellDRENBRElBRTJBZ3dnQXlBQU5nSUlEd3RCSHlFQ0lBQkIvLy8vQjAwRVFDQUFRU1lnQUVFSWRtY2lBV3QyUVFGeElBRkJBWFJyUVQ1cUlRSUxJQU1nQWpZQ0hDQURRZ0EzQWhBZ0FrRUNkRUhzSEdvaEJ3Si9Ba0FDZjBIQUdpZ0NBQ0lCUVFFZ0FuUWlCSEZGQkVCQndCb2dBU0FFY2pZQ0FFRVlJUUlnQnlFRVFRZ01BUXNnQUVFWklBSkJBWFpyUVFBZ0FrRWZSeHQwSVFJZ0J5Z0NBQ0VFQTBBZ0JDSUJLQUlFUVhoeElBQkdEUUlnQWtFZGRpRUVJQUpCQVhRaEFpQUJJQVJCQkhGcVFSQnFJZ2NvQWdBaUJBMEFDMEVZSVFJZ0FTRUVRUWdMSVFBZ0F5SUJEQUVMSUFFb0FnZ2lCQ0FETmdJTVFRZ2hBaUFCUVFocUlRZEJHQ0VBUVFBTElRVWdCeUFETmdJQUlBSWdBMm9nQkRZQ0FDQURJQUUyQWd3Z0FDQURhaUFGTmdJQVFkd2FRZHdhS0FJQVFRRnJJZ0JCZnlBQUd6WUNBQXNMS1FFQmZ5QUJCRUFnQUNFQ0EwQWdBa0VBT2dBQUlBSkJBV29oQWlBQlFRRnJJZ0VOQUFzTElBQUxIQUFnQUNBQlFRZ2dBcWNnQWtJZ2lLY2dBNmNnQTBJZ2lLY1FCUXZlQXdCQjNCZEJpZ2tRQ1VIb0YwRzVDRUVCUVFBUUNFSDBGMEcwQ0VFQlFZQi9RZjhBRUFGQmpCaEJyUWhCQVVHQWYwSC9BQkFCUVlBWVFhc0lRUUZCQUVIL0FSQUJRWmdZUVlrSVFRSkJnSUIrUWYvL0FSQUJRYVFZUVlBSVFRSkJBRUgvL3dNUUFVR3dHRUdZQ0VFRVFZQ0FnSUI0UWYvLy8vOEhFQUZCdkJoQmp3aEJCRUVBUVg4UUFVSElHRUhIQ0VFRVFZQ0FnSUI0UWYvLy8vOEhFQUZCMUJoQnZnaEJCRUVBUVg4UUFVSGdHRUdqQ0VLQWdJQ0FnSUNBZ0lCL1F2Ly8vLy8vLy8vLy93QVFFVUhzR0VHaUNFSUFRbjhRRVVINEdFR2NDRUVFRUFSQmhCbEJnd2xCQ0JBRVFmUU9RZGtJRUFOQnZBOUJodzBRQTBHRUVFRUVRY3dJRUFKQjBCQkJBa0hsQ0JBQ1Fad1JRUVJCOUFnUUFrRzRFUkFIUWVBUlFRQkJ3Z3dRQUVHSUVrRUFRYWdORUFCQnNCSkJBVUhnREJBQVFkZ1NRUUpCandrUUFFR0FFMEVEUWE0SkVBQkJxQk5CQkVIV0NSQUFRZEFUUVFWQjh3a1FBRUg0RTBFRVFjME5FQUJCb0JSQkJVSHJEUkFBUVlnU1FRQkIyUW9RQUVHd0VrRUJRYmdLRUFCQjJCSkJBa0diQ3hBQVFZQVRRUU5CK1FvUUFFR29FMEVFUWFFTUVBQkIwQk5CQlVIL0N4QUFRY2dVUVFoQjNnc1FBRUh3RkVFSlFid0xFQUJCbUJWQkJrR1pDaEFBUWNBVlFRZEJrZzRRQUFzZ0FBSkFJQUFvQWdRZ0FVY05BQ0FBS0FJY1FRRkdEUUFnQUNBQ05nSWNDd3VhQVFBZ0FFRUJPZ0ExQWtBZ0FDZ0NCQ0FDUncwQUlBQkJBVG9BTkFKQUlBQW9BaEFpQWtVRVFDQUFRUUUyQWlRZ0FDQUROZ0lZSUFBZ0FUWUNFQ0FEUVFGSERRSWdBQ2dDTUVFQlJnMEJEQUlMSUFFZ0FrWUVRQ0FBS0FJWUlnSkJBa1lFUUNBQUlBTTJBaGdnQXlFQ0N5QUFLQUl3UVFGSERRSWdBa0VCUmcwQkRBSUxJQUFnQUNnQ0pFRUJhallDSkFzZ0FFRUJPZ0EyQ3d0ZEFRRi9JQUFvQWhBaUEwVUVRQ0FBUVFFMkFpUWdBQ0FDTmdJWUlBQWdBVFlDRUE4TEFrQWdBU0FEUmdSQUlBQW9BaGhCQWtjTkFTQUFJQUkyQWhnUEN5QUFRUUU2QURZZ0FFRUNOZ0lZSUFBZ0FDZ0NKRUVCYWpZQ0pBc0xCQUFnQUF2WEp3RU1meU1BUVJCcklnb2tBQUpBQWtBQ1FBSkFBa0FDUUFKQUFrQUNRQUpBSUFCQjlBRk5CRUJCdkJvb0FnQWlCRUVRSUFCQkMycEIrQU54SUFCQkMwa2JJZ1pCQTNZaUFIWWlBVUVEY1FSQUFrQWdBVUYvYzBFQmNTQUFhaUlDUVFOMElnRkI1QnBxSWdBZ0FVSHNHbW9vQWdBaUFTZ0NDQ0lGUmdSQVFid2FJQVJCZmlBQ2QzRTJBZ0FNQVFzZ0JTQUFOZ0lNSUFBZ0JUWUNDQXNnQVVFSWFpRUFJQUVnQWtFRGRDSUNRUU55TmdJRUlBRWdBbW9pQVNBQktBSUVRUUZ5TmdJRURBc0xJQVpCeEJvb0FnQWlDRTBOQVNBQkJFQUNRRUVDSUFCMElnSkJBQ0FDYTNJZ0FTQUFkSEZvSWdGQkEzUWlBRUhrR21vaUFpQUFRZXdhYWlnQ0FDSUFLQUlJSWdWR0JFQkJ2Qm9nQkVGK0lBRjNjU0lFTmdJQURBRUxJQVVnQWpZQ0RDQUNJQVUyQWdnTElBQWdCa0VEY2pZQ0JDQUFJQVpxSWdjZ0FVRURkQ0lCSUFacklnVkJBWEkyQWdRZ0FDQUJhaUFGTmdJQUlBZ0VRQ0FJUVhoeFFlUWFhaUVCUWRBYUtBSUFJUUlDZnlBRVFRRWdDRUVEZG5RaUEzRkZCRUJCdkJvZ0F5QUVjallDQUNBQkRBRUxJQUVvQWdnTElRTWdBU0FDTmdJSUlBTWdBallDRENBQ0lBRTJBZ3dnQWlBRE5nSUlDeUFBUVFocUlRQkIwQm9nQnpZQ0FFSEVHaUFGTmdJQURBc0xRY0FhS0FJQUlndEZEUUVnQzJoQkFuUkI3QnhxS0FJQUlnSW9BZ1JCZUhFZ0Jtc2hBeUFDSVFFRFFBSkFJQUVvQWhBaUFFVUVRQ0FCS0FJVUlnQkZEUUVMSUFBb0FnUkJlSEVnQm1zaUFTQURJQUVnQTBraUFSc2hBeUFBSUFJZ0FSc2hBaUFBSVFFTUFRc0xJQUlvQWhnaENTQUNJQUlvQWd3aUFFY0VRRUhNR2lnQ0FCb2dBaWdDQ0NJQklBQTJBZ3dnQUNBQk5nSUlEQW9MSUFJb0FoUWlBUVIvSUFKQkZHb0ZJQUlvQWhBaUFVVU5BeUFDUVJCcUN5RUZBMEFnQlNFSElBRWlBRUVVYWlFRklBQW9BaFFpQVEwQUlBQkJFR29oQlNBQUtBSVFJZ0VOQUFzZ0IwRUFOZ0lBREFrTFFYOGhCaUFBUWI5L1N3MEFJQUJCQzJvaUFFRjRjU0VHUWNBYUtBSUFJZ2RGRFFCQkFDQUdheUVEQWtBQ1FBSkFBbjlCQUNBR1FZQUNTUTBBR2tFZklBWkIvLy8vQjBzTkFCb2dCa0VtSUFCQkNIWm5JZ0JyZGtFQmNTQUFRUUYwYTBFK2Fnc2lDRUVDZEVIc0hHb29BZ0FpQVVVRVFFRUFJUUFNQVF0QkFDRUFJQVpCR1NBSVFRRjJhMEVBSUFoQkgwY2JkQ0VDQTBBQ1FDQUJLQUlFUVhoeElBWnJJZ1FnQTA4TkFDQUJJUVVnQkNJRERRQkJBQ0VESUFFaEFBd0RDeUFBSUFFb0FoUWlCQ0FFSUFFZ0FrRWRka0VFY1dvb0FoQWlBVVliSUFBZ0JCc2hBQ0FDUVFGMElRSWdBUTBBQ3dzZ0FDQUZja1VFUUVFQUlRVkJBaUFJZENJQVFRQWdBR3R5SUFkeElnQkZEUU1nQUdoQkFuUkI3QnhxS0FJQUlRQUxJQUJGRFFFTEEwQWdBQ2dDQkVGNGNTQUdheUlDSUFOSklRRWdBaUFESUFFYklRTWdBQ0FGSUFFYklRVWdBQ2dDRUNJQkJIOGdBUVVnQUNnQ0ZBc2lBQTBBQ3dzZ0JVVU5BQ0FEUWNRYUtBSUFJQVpyVHcwQUlBVW9BaGdoQ0NBRklBVW9BZ3dpQUVjRVFFSE1HaWdDQUJvZ0JTZ0NDQ0lCSUFBMkFnd2dBQ0FCTmdJSURBZ0xJQVVvQWhRaUFRUi9JQVZCRkdvRklBVW9BaEFpQVVVTkF5QUZRUkJxQ3lFQ0EwQWdBaUVFSUFFaUFFRVVhaUVDSUFBb0FoUWlBUTBBSUFCQkVHb2hBaUFBS0FJUUlnRU5BQXNnQkVFQU5nSUFEQWNMSUFaQnhCb29BZ0FpQlUwRVFFSFFHaWdDQUNFQUFrQWdCU0FHYXlJQlFSQlBCRUFnQUNBR2FpSUNJQUZCQVhJMkFnUWdBQ0FGYWlBQk5nSUFJQUFnQmtFRGNqWUNCQXdCQ3lBQUlBVkJBM0kyQWdRZ0FDQUZhaUlCSUFFb0FnUkJBWEkyQWdSQkFDRUNRUUFoQVF0QnhCb2dBVFlDQUVIUUdpQUNOZ0lBSUFCQkNHb2hBQXdKQ3lBR1FjZ2FLQUlBSWdKSkJFQkJ5Qm9nQWlBR2F5SUJOZ0lBUWRRYVFkUWFLQUlBSWdBZ0Jtb2lBallDQUNBQ0lBRkJBWEkyQWdRZ0FDQUdRUU55TmdJRUlBQkJDR29oQUF3SkMwRUFJUUFnQmtFdmFpSURBbjlCbEI0b0FnQUVRRUdjSGlnQ0FBd0JDMEdnSGtKL053SUFRWmdlUW9DZ2dJQ0FnQVEzQWdCQmxCNGdDa0VNYWtGd2NVSFlxdFdxQlhNMkFnQkJxQjVCQURZQ0FFSDRIVUVBTmdJQVFZQWdDeUlCYWlJRVFRQWdBV3NpQjNFaUFTQUdUUTBJUWZRZEtBSUFJZ1VFUUVIc0hTZ0NBQ0lJSUFGcUlna2dDRTBnQlNBSlNYSU5DUXNDUUVINEhTMEFBRUVFY1VVRVFBSkFBa0FDUUFKQVFkUWFLQUlBSWdVRVFFSDhIU0VBQTBBZ0JTQUFLQUlBSWdoUEJFQWdDQ0FBS0FJRWFpQUZTdzBEQ3lBQUtBSUlJZ0FOQUFzTFFRQVFDeUlDUVg5R0RRTWdBU0VFUVpnZUtBSUFJZ0JCQVdzaUJTQUNjUVJBSUFFZ0Ftc2dBaUFGYWtFQUlBQnJjV29oQkFzZ0JDQUdUUTBEUWZRZEtBSUFJZ0FFUUVIc0hTZ0NBQ0lGSUFScUlnY2dCVTBnQUNBSFNYSU5CQXNnQkJBTElnQWdBa2NOQVF3RkN5QUVJQUpySUFkeElnUVFDeUlDSUFBb0FnQWdBQ2dDQkdwR0RRRWdBaUVBQ3lBQVFYOUdEUUVnQmtFd2FpQUVUUVJBSUFBaEFnd0VDMEdjSGlnQ0FDSUNJQU1nQkd0cVFRQWdBbXR4SWdJUUMwRi9SZzBCSUFJZ0JHb2hCQ0FBSVFJTUF3c2dBa0YvUncwQ0MwSDRIVUg0SFNnQ0FFRUVjallDQUFzZ0FSQUxJZ0pCZjBaQkFCQUxJZ0JCZjBaeUlBQWdBazF5RFFVZ0FDQUNheUlFSUFaQktHcE5EUVVMUWV3ZFFld2RLQUlBSUFScUlnQTJBZ0JCOEIwb0FnQWdBRWtFUUVId0hTQUFOZ0lBQ3dKQVFkUWFLQUlBSWdNRVFFSDhIU0VBQTBBZ0FpQUFLQUlBSWdFZ0FDZ0NCQ0lGYWtZTkFpQUFLQUlJSWdBTkFBc01CQXRCekJvb0FnQWlBRUVBSUFBZ0FrMGJSUVJBUWN3YUlBSTJBZ0FMUVFBaEFFR0FIaUFFTmdJQVFmd2RJQUkyQWdCQjNCcEJmellDQUVIZ0drR1VIaWdDQURZQ0FFR0lIa0VBTmdJQUEwQWdBRUVEZENJQlFld2FhaUFCUWVRYWFpSUZOZ0lBSUFGQjhCcHFJQVUyQWdBZ0FFRUJhaUlBUVNCSERRQUxRY2dhSUFSQktHc2lBRUY0SUFKclFRZHhJZ0ZySWdVMkFnQkIxQm9nQVNBQ2FpSUJOZ0lBSUFFZ0JVRUJjallDQkNBQUlBSnFRU2cyQWdSQjJCcEJwQjRvQWdBMkFnQU1CQXNnQWlBRFRTQUJJQU5MY2cwQ0lBQW9BZ3hCQ0hFTkFpQUFJQVFnQldvMkFnUkIxQm9nQTBGNElBTnJRUWR4SWdCcUlnRTJBZ0JCeUJwQnlCb29BZ0FnQkdvaUFpQUFheUlBTmdJQUlBRWdBRUVCY2pZQ0JDQUNJQU5xUVNnMkFnUkIyQnBCcEI0b0FnQTJBZ0FNQXd0QkFDRUFEQVlMUVFBaEFBd0VDMEhNR2lnQ0FDQUNTd1JBUWN3YUlBSTJBZ0FMSUFJZ0JHb2hBVUg4SFNFQUFrQURRQ0FCSUFBb0FnQkhCRUFnQUNnQ0NDSUFEUUVNQWdzTElBQXRBQXhCQ0hGRkRRTUxRZndkSVFBRFFBSkFJQU1nQUNnQ0FDSUJUd1JBSUFFZ0FDZ0NCR29pQlNBRFN3MEJDeUFBS0FJSUlRQU1BUXNMUWNnYUlBUkJLR3NpQUVGNElBSnJRUWR4SWdGcklnYzJBZ0JCMUJvZ0FTQUNhaUlCTmdJQUlBRWdCMEVCY2pZQ0JDQUFJQUpxUVNnMkFnUkIyQnBCcEI0b0FnQTJBZ0FnQXlBRlFTY2dCV3RCQjNGcVFTOXJJZ0FnQUNBRFFSQnFTUnNpQVVFYk5nSUVJQUZCaEI0cEFnQTNBaEFnQVVIOEhTa0NBRGNDQ0VHRUhpQUJRUWhxTmdJQVFZQWVJQVEyQWdCQi9CMGdBallDQUVHSUhrRUFOZ0lBSUFGQkdHb2hBQU5BSUFCQkJ6WUNCQ0FBUVFocUlRd2dBRUVFYWlFQUlBd2dCVWtOQUFzZ0FTQURSZzBBSUFFZ0FTZ0NCRUYrY1RZQ0JDQURJQUVnQTJzaUFrRUJjallDQkNBQklBSTJBZ0FDZnlBQ1FmOEJUUVJBSUFKQmVIRkI1QnBxSVFBQ2YwRzhHaWdDQUNJQlFRRWdBa0VEZG5RaUFuRkZCRUJCdkJvZ0FTQUNjallDQUNBQURBRUxJQUFvQWdnTElRRWdBQ0FETmdJSUlBRWdBellDREVFTUlRSkJDQXdCQzBFZklRQWdBa0gvLy84SFRRUkFJQUpCSmlBQ1FRaDJaeUlBYTNaQkFYRWdBRUVCZEd0QlBtb2hBQXNnQXlBQU5nSWNJQU5DQURjQ0VDQUFRUUowUWV3Y2FpRUJBa0FDUUVIQUdpZ0NBQ0lGUVFFZ0FIUWlCSEZGQkVCQndCb2dCQ0FGY2pZQ0FDQUJJQU0yQWdBTUFRc2dBa0VaSUFCQkFYWnJRUUFnQUVFZlJ4dDBJUUFnQVNnQ0FDRUZBMEFnQlNJQktBSUVRWGh4SUFKR0RRSWdBRUVkZGlFRklBQkJBWFFoQUNBQklBVkJCSEZxSWdRb0FoQWlCUTBBQ3lBRUlBTTJBaEFMSUFNZ0FUWUNHRUVJSVFJZ0F5SUJJUUJCREF3QkN5QUJLQUlJSWdBZ0F6WUNEQ0FCSUFNMkFnZ2dBeUFBTmdJSVFRQWhBRUVZSVFKQkRBc2dBMm9nQVRZQ0FDQUNJQU5xSUFBMkFnQUxRY2dhS0FJQUlnQWdCazBOQUVISUdpQUFJQVpySWdFMkFnQkIxQnBCMUJvb0FnQWlBQ0FHYWlJQ05nSUFJQUlnQVVFQmNqWUNCQ0FBSUFaQkEzSTJBZ1FnQUVFSWFpRUFEQVFMUWJnYVFUQTJBZ0JCQUNFQURBTUxJQUFnQWpZQ0FDQUFJQUFvQWdRZ0JHbzJBZ1FnQWtGNElBSnJRUWR4YWlJSUlBWkJBM0kyQWdRZ0FVRjRJQUZyUVFkeGFpSUVJQVlnQ0dvaUEyc2hCd0pBUWRRYUtBSUFJQVJHQkVCQjFCb2dBellDQUVISUdrSElHaWdDQUNBSGFpSUFOZ0lBSUFNZ0FFRUJjallDQkF3QkMwSFFHaWdDQUNBRVJnUkFRZEFhSUFNMkFnQkJ4QnBCeEJvb0FnQWdCMm9pQURZQ0FDQURJQUJCQVhJMkFnUWdBQ0FEYWlBQU5nSUFEQUVMSUFRb0FnUWlBRUVEY1VFQlJnUkFJQUJCZUhFaENTQUVLQUlNSVFJQ1FDQUFRZjhCVFFSQUlBUW9BZ2dpQVNBQ1JnUkFRYndhUWJ3YUtBSUFRWDRnQUVFRGRuZHhOZ0lBREFJTElBRWdBallDRENBQ0lBRTJBZ2dNQVFzZ0JDZ0NHQ0VHQWtBZ0FpQUVSd1JBUWN3YUtBSUFHaUFFS0FJSUlnQWdBallDRENBQ0lBQTJBZ2dNQVFzQ1FDQUVLQUlVSWdBRWZ5QUVRUlJxQlNBRUtBSVFJZ0JGRFFFZ0JFRVFhZ3NoQVFOQUlBRWhCU0FBSWdKQkZHb2hBU0FBS0FJVUlnQU5BQ0FDUVJCcUlRRWdBaWdDRUNJQURRQUxJQVZCQURZQ0FBd0JDMEVBSVFJTElBWkZEUUFDUUNBRUtBSWNJZ0JCQW5SQjdCeHFJZ0VvQWdBZ0JFWUVRQ0FCSUFJMkFnQWdBZzBCUWNBYVFjQWFLQUlBUVg0Z0FIZHhOZ0lBREFJTElBWkJFRUVVSUFZb0FoQWdCRVliYWlBQ05nSUFJQUpGRFFFTElBSWdCallDR0NBRUtBSVFJZ0FFUUNBQ0lBQTJBaEFnQUNBQ05nSVlDeUFFS0FJVUlnQkZEUUFnQWlBQU5nSVVJQUFnQWpZQ0dBc2dCeUFKYWlFSElBUWdDV29pQkNnQ0JDRUFDeUFFSUFCQmZuRTJBZ1FnQXlBSFFRRnlOZ0lFSUFNZ0Iyb2dCellDQUNBSFFmOEJUUVJBSUFkQmVIRkI1QnBxSVFBQ2YwRzhHaWdDQUNJQlFRRWdCMEVEZG5RaUFuRkZCRUJCdkJvZ0FTQUNjallDQUNBQURBRUxJQUFvQWdnTElRRWdBQ0FETmdJSUlBRWdBellDRENBRElBQTJBZ3dnQXlBQk5nSUlEQUVMUVI4aEFpQUhRZi8vL3dkTkJFQWdCMEVtSUFkQkNIWm5JZ0JyZGtFQmNTQUFRUUYwYTBFK2FpRUNDeUFESUFJMkFod2dBMElBTndJUUlBSkJBblJCN0J4cUlRQUNRQUpBUWNBYUtBSUFJZ0ZCQVNBQ2RDSUZjVVVFUUVIQUdpQUJJQVZ5TmdJQUlBQWdBellDQUF3QkN5QUhRUmtnQWtFQmRtdEJBQ0FDUVI5SEczUWhBaUFBS0FJQUlRRURRQ0FCSWdBb0FnUkJlSEVnQjBZTkFpQUNRUjEySVFFZ0FrRUJkQ0VDSUFBZ0FVRUVjV29pQlNnQ0VDSUJEUUFMSUFVZ0F6WUNFQXNnQXlBQU5nSVlJQU1nQXpZQ0RDQURJQU0yQWdnTUFRc2dBQ2dDQ0NJQklBTTJBZ3dnQUNBRE5nSUlJQU5CQURZQ0dDQURJQUEyQWd3Z0F5QUJOZ0lJQ3lBSVFRaHFJUUFNQWdzQ1FDQUlSUTBBQWtBZ0JTZ0NIQ0lCUVFKMFFld2NhaUlDS0FJQUlBVkdCRUFnQWlBQU5nSUFJQUFOQVVIQUdpQUhRWDRnQVhkeElnYzJBZ0FNQWdzZ0NFRVFRUlFnQ0NnQ0VDQUZSaHRxSUFBMkFnQWdBRVVOQVFzZ0FDQUlOZ0lZSUFVb0FoQWlBUVJBSUFBZ0FUWUNFQ0FCSUFBMkFoZ0xJQVVvQWhRaUFVVU5BQ0FBSUFFMkFoUWdBU0FBTmdJWUN3SkFJQU5CRDAwRVFDQUZJQU1nQm1vaUFFRURjallDQkNBQUlBVnFJZ0FnQUNnQ0JFRUJjallDQkF3QkN5QUZJQVpCQTNJMkFnUWdCU0FHYWlJRUlBTkJBWEkyQWdRZ0F5QUVhaUFETmdJQUlBTkIvd0ZOQkVBZ0EwRjRjVUhrR21vaEFBSi9RYndhS0FJQUlnRkJBU0FEUVFOMmRDSUNjVVVFUUVHOEdpQUJJQUp5TmdJQUlBQU1BUXNnQUNnQ0NBc2hBU0FBSUFRMkFnZ2dBU0FFTmdJTUlBUWdBRFlDRENBRUlBRTJBZ2dNQVF0Qkh5RUFJQU5CLy8vL0IwMEVRQ0FEUVNZZ0EwRUlkbWNpQUd0MlFRRnhJQUJCQVhSclFUNXFJUUFMSUFRZ0FEWUNIQ0FFUWdBM0FoQWdBRUVDZEVIc0hHb2hBUUpBQWtBZ0IwRUJJQUIwSWdKeFJRUkFRY0FhSUFJZ0IzSTJBZ0FnQVNBRU5nSUFJQVFnQVRZQ0dBd0JDeUFEUVJrZ0FFRUJkbXRCQUNBQVFSOUhHM1FoQUNBQktBSUFJUUVEUUNBQklnSW9BZ1JCZUhFZ0EwWU5BaUFBUVIxMklRRWdBRUVCZENFQUlBSWdBVUVFY1dvaUJ5Z0NFQ0lCRFFBTElBY2dCRFlDRUNBRUlBSTJBaGdMSUFRZ0JEWUNEQ0FFSUFRMkFnZ01BUXNnQWlnQ0NDSUFJQVEyQWd3Z0FpQUVOZ0lJSUFSQkFEWUNHQ0FFSUFJMkFnd2dCQ0FBTmdJSUN5QUZRUWhxSVFBTUFRc0NRQ0FKUlEwQUFrQWdBaWdDSENJQlFRSjBRZXdjYWlJRktBSUFJQUpHQkVBZ0JTQUFOZ0lBSUFBTkFVSEFHaUFMUVg0Z0FYZHhOZ0lBREFJTElBbEJFRUVVSUFrb0FoQWdBa1liYWlBQU5nSUFJQUJGRFFFTElBQWdDVFlDR0NBQ0tBSVFJZ0VFUUNBQUlBRTJBaEFnQVNBQU5nSVlDeUFDS0FJVUlnRkZEUUFnQUNBQk5nSVVJQUVnQURZQ0dBc0NRQ0FEUVE5TkJFQWdBaUFESUFacUlnQkJBM0kyQWdRZ0FDQUNhaUlBSUFBb0FnUkJBWEkyQWdRTUFRc2dBaUFHUVFOeU5nSUVJQUlnQm1vaUJTQURRUUZ5TmdJRUlBTWdCV29nQXpZQ0FDQUlCRUFnQ0VGNGNVSGtHbW9oQUVIUUdpZ0NBQ0VCQW45QkFTQUlRUU4yZENJSElBUnhSUVJBUWJ3YUlBUWdCM0kyQWdBZ0FBd0JDeUFBS0FJSUN5RUVJQUFnQVRZQ0NDQUVJQUUyQWd3Z0FTQUFOZ0lNSUFFZ0JEWUNDQXRCMEJvZ0JUWUNBRUhFR2lBRE5nSUFDeUFDUVFocUlRQUxJQXBCRUdva0FDQUFDeG9BSUFBZ0FTZ0NDQ0FGRUFvRVFDQUJJQUlnQXlBRUVCUUxDemNBSUFBZ0FTZ0NDQ0FGRUFvRVFDQUJJQUlnQXlBRUVCUVBDeUFBS0FJSUlnQWdBU0FDSUFNZ0JDQUZJQUFvQWdBb0FoUVJBd0FMa1FFQUlBQWdBU2dDQ0NBRUVBb0VRQ0FCSUFJZ0F4QVREd3NDUUNBQUlBRW9BZ0FnQkJBS1JRMEFBa0FnQWlBQktBSVFSd1JBSUFFb0FoUWdBa2NOQVFzZ0EwRUJSdzBCSUFGQkFUWUNJQThMSUFFZ0FqWUNGQ0FCSUFNMkFpQWdBU0FCS0FJb1FRRnFOZ0lvQWtBZ0FTZ0NKRUVCUncwQUlBRW9BaGhCQWtjTkFDQUJRUUU2QURZTElBRkJCRFlDTEFzTDhnRUFJQUFnQVNnQ0NDQUVFQW9FUUNBQklBSWdBeEFURHdzQ1FDQUFJQUVvQWdBZ0JCQUtCRUFDUUNBQ0lBRW9BaEJIQkVBZ0FTZ0NGQ0FDUncwQkN5QURRUUZIRFFJZ0FVRUJOZ0lnRHdzZ0FTQUROZ0lnQWtBZ0FTZ0NMRUVFUmcwQUlBRkJBRHNCTkNBQUtBSUlJZ0FnQVNBQ0lBSkJBU0FFSUFBb0FnQW9BaFFSQXdBZ0FTMEFOUVJBSUFGQkF6WUNMQ0FCTFFBMFJRMEJEQU1MSUFGQkJEWUNMQXNnQVNBQ05nSVVJQUVnQVNnQ0tFRUJhallDS0NBQktBSWtRUUZIRFFFZ0FTZ0NHRUVDUncwQklBRkJBVG9BTmc4TElBQW9BZ2dpQUNBQklBSWdBeUFFSUFBb0FnQW9BaGdSQWdBTEN6RUFJQUFnQVNnQ0NFRUFFQW9FUUNBQklBSWdBeEFWRHdzZ0FDZ0NDQ0lBSUFFZ0FpQURJQUFvQWdBb0Fod1JBQUFMR0FBZ0FDQUJLQUlJUVFBUUNnUkFJQUVnQWlBREVCVUxDNEFEQVFSL0l3QkI4QUJySWdJa0FDQUFLQUlBSWdOQkJHc29BZ0FoQkNBRFFRaHJLQUlBSVFVZ0FrSUFOd0pRSUFKQ0FEY0NXQ0FDUWdBM0FtQWdBa0lBTndCbklBSkNBRGNDU0NBQ1FRQTJBa1FnQWtIc0ZUWUNRQ0FDSUFBMkFqd2dBaUFCTmdJNElBQWdCV29oQXdKQUlBUWdBVUVBRUFvRVFFRUFJQU1nQlJzaEFBd0JDeUFBSUFOT0JFQWdBa0lBTndBdklBSkNBRGNDR0NBQ1FnQTNBaUFnQWtJQU53SW9JQUpDQURjQ0VDQUNRUUEyQWd3Z0FpQUJOZ0lJSUFJZ0FEWUNCQ0FDSUFRMkFnQWdBa0VCTmdJd0lBUWdBaUFESUFOQkFVRUFJQVFvQWdBb0FoUVJBd0FnQWlnQ0dBMEJDMEVBSVFBZ0JDQUNRVGhxSUFOQkFVRUFJQVFvQWdBb0FoZ1JBZ0FDUUFKQUlBSW9BbHdPQWdBQkFnc2dBaWdDVEVFQUlBSW9BbGhCQVVZYlFRQWdBaWdDVkVFQlJodEJBQ0FDS0FKZ1FRRkdHeUVBREFFTElBSW9BbEJCQVVjRVFDQUNLQUpnRFFFZ0FpZ0NWRUVCUncwQklBSW9BbGhCQVVjTkFRc2dBaWdDU0NFQUN5QUNRZkFBYWlRQUlBQUxtZ0VCQW44akFFRkFhaUlESkFBQ2YwRUJJQUFnQVVFQUVBb05BQnBCQUNBQlJRMEFHa0VBSUFGQm5CWVFIaUlCUlEwQUdpQURRUXhxUVRRUUVCb2dBMEVCTmdJNElBTkJmellDRkNBRElBQTJBaEFnQXlBQk5nSUlJQUVnQTBFSWFpQUNLQUlBUVFFZ0FTZ0NBQ2dDSEJFQUFDQURLQUlnSWdCQkFVWUVRQ0FDSUFNb0FoZzJBZ0FMSUFCQkFVWUxJUVFnQTBGQWF5UUFJQVFMQ2dBZ0FDQUJRUUFRQ2d1QUNnSUlmeUo5UWYvLy8vOEhJUTVCZ0lDQWdIZ2hEMEYvSVFvRFFDQURJQXhHQkVCQkFDRUFJQWxCZ0lBUUVCQWhBVU1BLzM5SElBOGdEbXV5bFNFZEEwQWdBQ0FEUmdSQVFRQWhBQ0FJUVFBMkFnQWdBVUVFYXlFQlFRQWhERUVCSVFzRFFDQUxRWUNBQkVaRkJFQWdDQ0FMUVFKMElnSnFJQUVnQW1vb0FnQWdER29pRERZQ0FDQUxRUUZxSVFzTUFRc0xBMEFnQUNBRFJrVUVRQ0FJSUFZZ0FFRUNkR29vQWdCQkFuUnFJZ0VnQVNnQ0FDSUJRUUZxTmdJQUlBY2dBVUVDZEdvZ0FEWUNBQ0FBUVFGcUlRQU1BUXNMQlFKL0lCMGdCaUFBUVFKMGFpSUNLQUlBSUE1cnM1UWlFa01BQUlCUFhTQVNRd0FBQUFCZ2NRUkFJQktwREFFTFFRQUxJUXNnQWlBTE5nSUFJQUVnQzBFQ2RHb2lBaUFDS0FJQVFRRnFOZ0lBSUFCQkFXb2hBQXdCQ3dzRklBUWdERUVNYkdvaUN5b0NBQ0VTSUFzcUFnZ2hIU0FMS2dJRUlTRWdDaUFDSUF4QkFuUWlEV29vQWdBaUMwY0VRQ0FCSUF0QjBBQnNhaUlLS2dJOEloUWdBQ29DUENJVmxDQUtLZ0k0SWhZZ0FDb0NMQ0lZbENBS0tnSXdJaGtnQUNvQ0RDSWFsQ0FBS2dJY0loNGdDaW9DTkNJVGxKS1NraUVwSUJRZ0FDb0NPQ0lmbENBV0lBQXFBaWdpSUpRZ0dTQUFLZ0lJSWlLVUlBQXFBaGdpSXlBVGxKS1NraUVxSUJRZ0FDb0NOQ0lrbENBV0lBQXFBaVFpSlpRZ0dTQUFLZ0lFSWlhVUlBQXFBaFFpSnlBVGxKS1NraUVySUJRZ0FDb0NNQ0lVbENBV0lBQXFBaUFpRnBRZ0dTQUFLZ0lBSWhtVUlBQXFBaEFpS0NBVGxKS1NraUVzSUFvcUFpd2lFeUFWbENBS0tnSW9JaGNnR0pRZ0Npb0NJQ0liSUJxVUlCNGdDaW9DSkNJY2xKS1NraUV0SUJNZ0g1UWdGeUFnbENBYklDS1VJQ01nSEpTU2twSWhMaUFUSUNTVUlCY2dKWlFnR3lBbWxDQW5JQnlVa3BLU0lTOGdFeUFVbENBWElCYVVJQnNnR1pRZ0tDQWNsSktTa2lFd0lBb3FBaHdpRXlBVmxDQUtLZ0lZSWhjZ0dKUWdDaW9DRUNJYklCcVVJQjRnQ2lvQ0ZDSWNsSktTa2lFeElCTWdINVFnRnlBZ2xDQWJJQ0tVSUNNZ0hKU1NrcEloTWlBVElDU1VJQmNnSlpRZ0d5QW1sQ0FuSUJ5VWtwS1NJVE1nRXlBVWxDQVhJQmFVSUJzZ0daUWdLQ0FjbEpLU2tpRVhJQW9xQWd3aUV5QVZsQ0FLS2dJSUloVWdHSlFnQ2lvQ0FDSVlJQnFVSUFvcUFnUWlHaUFlbEpLU2tpRWVJQk1nSDVRZ0ZTQWdsQ0FZSUNLVUlCb2dJNVNTa3BJaEh5QVRJQ1NVSUJVZ0paUWdHQ0FtbENBYUlDZVVrcEtTSVNBZ0V5QVVsQ0FWSUJhVUlCZ2dHWlFnR2lBb2xKS1NraUVXSUFzaENnc2dCaUFOYWdKL0lDNGdIWlFnSHlBU2xDQWhJREtVa3BJZ0twSkRBQUNBUlpRaUZJdERBQUFBVDEwRVFDQVVxQXdCQzBHQWdJQ0FlQXNpQ3pZQ0FDQUxJQTVLSVJBZ0N5QVBTQ0VSUWY4QklRMENRQ0F0SUIyVUlCNGdFcFFnSVNBeGxKS1NJQ21TSWhSREFBQUFBRnNOQUNBd0lCMlVJQllnRXBRZ0lTQVhsSktTSUN5U0lCU1ZRd0FBZ0QrU1F3QUFBRCtVSWhWREFBQUFBR0JGSUJWREFBQ0FQMTFGY2cwQUlDOGdIWlFnSUNBU2xDQWhJRE9Va3BJZ0s1SWdGSlZEQUFDQVA1SkRBQUFBUDVRaUVrTUFBQUFBWUVVZ0VrTUFBSUEvWFVWeURRQUNmeUFTUXdBQWNFR1VJaEpEQUFDQVQxMGdFa01BQUFBQVlIRUVRQ0FTcVF3QkMwRUFDMEVQYkNFTkFuOGdGVU1BQUhCQmxDSVNRd0FBZ0U5ZElCSkRBQUFBQUdCeEJFQWdFcWtNQVF0QkFBc2dEV29oRFFzZ0RpQUxJQkFiSVE0Z0R5QUxJQkViSVE4Z0JTQU1haUFOT2dBQUlBeEJBV29oREF3QkN3c0xDN2NTQWdCQmdBZ0xwaEoxYm5OcFoyNWxaQ0J6YUc5eWRBQjFibk5wWjI1bFpDQnBiblFBWm14dllYUUFkV2x1ZERZMFgzUUFkVzV6YVdkdVpXUWdZMmhoY2dCaWIyOXNBSFZ1YzJsbmJtVmtJR3h2Ym1jQWMzUmtPanAzYzNSeWFXNW5BSE4wWkRvNmMzUnlhVzVuQUhOMFpEbzZkVEUyYzNSeWFXNW5BSE4wWkRvNmRUTXljM1J5YVc1bkFHUnZkV0pzWlFCMmIybGtBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BITm9iM0owUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYm5OcFoyNWxaQ0J6YUc5eWRENEFaVzF6WTNKcGNIUmxiam82YldWdGIzSjVYM1pwWlhjOGFXNTBQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eDFibk5wWjI1bFpDQnBiblErQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQR1pzYjJGMFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4MWFXNTBPRjkwUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkenhwYm5RNFgzUStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BIVnBiblF4Tmw5MFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4cGJuUXhObDkwUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYVc1ME5qUmZkRDRBWlcxelkzSnBjSFJsYmpvNmJXVnRiM0o1WDNacFpYYzhhVzUwTmpSZmRENEFaVzF6WTNKcGNIUmxiam82YldWdGIzSjVYM1pwWlhjOGRXbHVkRE15WDNRK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEdsdWRETXlYM1ErQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQR05vWVhJK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEhWdWMybG5ibVZrSUdOb1lYSStBSE4wWkRvNlltRnphV05mYzNSeWFXNW5QSFZ1YzJsbmJtVmtJR05vWVhJK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEhOcFoyNWxaQ0JqYUdGeVBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4c2IyNW5QZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eDFibk5wWjI1bFpDQnNiMjVuUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkenhrYjNWaWJHVStBRTVUZEROZlh6SXhNbUpoYzJsalgzTjBjbWx1WjBsalRsTmZNVEZqYUdGeVgzUnlZV2wwYzBsalJVVk9VMTg1WVd4c2IyTmhkRzl5U1dORlJVVkZBQUFBQUpRTUFBQXlCd0FBVGxOME0xOWZNakV5WW1GemFXTmZjM1J5YVc1blNXaE9VMTh4TVdOb1lYSmZkSEpoYVhSelNXaEZSVTVUWHpsaGJHeHZZMkYwYjNKSmFFVkZSVVVBQUpRTUFBQjhCd0FBVGxOME0xOWZNakV5WW1GemFXTmZjM1J5YVc1blNYZE9VMTh4TVdOb1lYSmZkSEpoYVhSelNYZEZSVTVUWHpsaGJHeHZZMkYwYjNKSmQwVkZSVVVBQUpRTUFBREVCd0FBVGxOME0xOWZNakV5WW1GemFXTmZjM1J5YVc1blNVUnpUbE5mTVRGamFHRnlYM1J5WVdsMGMwbEVjMFZGVGxOZk9XRnNiRzlqWVhSdmNrbEVjMFZGUlVVQUFBQ1VEQUFBREFnQUFFNVRkRE5mWHpJeE1tSmhjMmxqWDNOMGNtbHVaMGxFYVU1VFh6RXhZMmhoY2w5MGNtRnBkSE5KUkdsRlJVNVRYemxoYkd4dlkyRjBiM0pKUkdsRlJVVkZBQUFBbEF3QUFGZ0lBQUJPTVRCbGJYTmpjbWx3ZEdWdU0zWmhiRVVBQUpRTUFBQ2tDQUFBVGpFd1pXMXpZM0pwY0hSbGJqRXhiV1Z0YjNKNVgzWnBaWGRKWTBWRkFBQ1VEQUFBd0FnQUFFNHhNR1Z0YzJOeWFYQjBaVzR4TVcxbGJXOXllVjkyYVdWM1NXRkZSUUFBbEF3QUFPZ0lBQUJPTVRCbGJYTmpjbWx3ZEdWdU1URnRaVzF2Y25sZmRtbGxkMGxvUlVVQUFKUU1BQUFRQ1FBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSmMwVkZBQUNVREFBQU9Ba0FBRTR4TUdWdGMyTnlhWEIwWlc0eE1XMWxiVzl5ZVY5MmFXVjNTWFJGUlFBQWxBd0FBR0FKQUFCT01UQmxiWE5qY21sd2RHVnVNVEZ0WlcxdmNubGZkbWxsZDBscFJVVUFBSlFNQUFDSUNRQUFUakV3WlcxelkzSnBjSFJsYmpFeGJXVnRiM0o1WDNacFpYZEpha1ZGQUFDVURBQUFzQWtBQUU0eE1HVnRjMk55YVhCMFpXNHhNVzFsYlc5eWVWOTJhV1YzU1d4RlJRQUFsQXdBQU5nSkFBQk9NVEJsYlhOamNtbHdkR1Z1TVRGdFpXMXZjbmxmZG1sbGQwbHRSVVVBQUpRTUFBQUFDZ0FBVGpFd1pXMXpZM0pwY0hSbGJqRXhiV1Z0YjNKNVgzWnBaWGRKZUVWRkFBQ1VEQUFBS0FvQUFFNHhNR1Z0YzJOeWFYQjBaVzR4TVcxbGJXOXllVjkyYVdWM1NYbEZSUUFBbEF3QUFGQUtBQUJPTVRCbGJYTmpjbWx3ZEdWdU1URnRaVzF2Y25sZmRtbGxkMGxtUlVVQUFKUU1BQUI0Q2dBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSlpFVkZBQUNVREFBQW9Bb0FBRTR4TUY5ZlkzaDRZV0pwZGpFeE5sOWZjMmhwYlY5MGVYQmxYMmx1Wm05RkFBQUFBTHdNQUFESUNnQUFJQTBBQUU0eE1GOWZZM2g0WVdKcGRqRXhOMTlmWTJ4aGMzTmZkSGx3WlY5cGJtWnZSUUFBQUx3TUFBRDRDZ0FBN0FvQUFFNHhNRjlmWTNoNFlXSnBkakV4TjE5ZmNHSmhjMlZmZEhsd1pWOXBibVp2UlFBQUFMd01BQUFvQ3dBQTdBb0FBRTR4TUY5ZlkzaDRZV0pwZGpFeE9WOWZjRzlwYm5SbGNsOTBlWEJsWDJsdVptOUZBTHdNQUFCWUN3QUFUQXNBQUFBQUFBRE1Dd0FBQWdBQUFBTUFBQUFFQUFBQUJRQUFBQVlBQUFCT01UQmZYMk40ZUdGaWFYWXhNak5mWDJaMWJtUmhiV1Z1ZEdGc1gzUjVjR1ZmYVc1bWIwVUF2QXdBQUtRTEFBRHNDZ0FBZGdBQUFKQUxBQURZQ3dBQVlnQUFBSkFMQUFEa0N3QUFZd0FBQUpBTEFBRHdDd0FBYUFBQUFKQUxBQUQ4Q3dBQVlRQUFBSkFMQUFBSURBQUFjd0FBQUpBTEFBQVVEQUFBZEFBQUFKQUxBQUFnREFBQWFRQUFBSkFMQUFBc0RBQUFhZ0FBQUpBTEFBQTREQUFBYkFBQUFKQUxBQUJFREFBQWJRQUFBSkFMQUFCUURBQUFlQUFBQUpBTEFBQmNEQUFBZVFBQUFKQUxBQUJvREFBQVpnQUFBSkFMQUFCMERBQUFaQUFBQUpBTEFBQ0FEQUFBQUFBQUFCd0xBQUFDQUFBQUJ3QUFBQVFBQUFBRkFBQUFDQUFBQUFrQUFBQUtBQUFBQ3dBQUFBQUFBQUFFRFFBQUFnQUFBQXdBQUFBRUFBQUFCUUFBQUFnQUFBQU5BQUFBRGdBQUFBOEFBQUJPTVRCZlgyTjRlR0ZpYVhZeE1qQmZYM05wWDJOc1lYTnpYM1I1Y0dWZmFXNW1iMFVBQUFBQXZBd0FBTndNQUFBY0N3QUFVM1E1ZEhsd1pWOXBibVp2QUFBQUFKUU1BQUFRRFFCQnFCb0xBekFQQVE9PSI7aWYoIWlzRGF0YVVSSSh3YXNtQmluYXJ5RmlsZSkpe3dhc21CaW5hcnlGaWxlPWxvY2F0ZUZpbGUod2FzbUJpbmFyeUZpbGUpO31mdW5jdGlvbiBnZXRCaW5hcnlTeW5jKGZpbGUpe2lmKGZpbGU9PXdhc21CaW5hcnlGaWxlJiZ3YXNtQmluYXJ5KXtyZXR1cm4gbmV3IFVpbnQ4QXJyYXkod2FzbUJpbmFyeSl9dmFyIGJpbmFyeT10cnlQYXJzZUFzRGF0YVVSSShmaWxlKTtpZihiaW5hcnkpe3JldHVybiBiaW5hcnl9aWYocmVhZEJpbmFyeSl7cmV0dXJuIHJlYWRCaW5hcnkoZmlsZSl9dGhyb3cgImJvdGggYXN5bmMgYW5kIHN5bmMgZmV0Y2hpbmcgb2YgdGhlIHdhc20gZmFpbGVkIn1mdW5jdGlvbiBnZXRCaW5hcnlQcm9taXNlKGJpbmFyeUZpbGUpe3JldHVybiBQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5nZXRCaW5hcnlTeW5jKGJpbmFyeUZpbGUpKX1mdW5jdGlvbiBpbnN0YW50aWF0ZUFycmF5QnVmZmVyKGJpbmFyeUZpbGUsaW1wb3J0cyxyZWNlaXZlcil7cmV0dXJuIGdldEJpbmFyeVByb21pc2UoYmluYXJ5RmlsZSkudGhlbihiaW5hcnk9PldlYkFzc2VtYmx5Lmluc3RhbnRpYXRlKGJpbmFyeSxpbXBvcnRzKSkudGhlbihyZWNlaXZlcixyZWFzb249PntlcnIoYGZhaWxlZCB0byBhc3luY2hyb25vdXNseSBwcmVwYXJlIHdhc206ICR7cmVhc29ufWApO2Fib3J0KHJlYXNvbik7fSl9ZnVuY3Rpb24gaW5zdGFudGlhdGVBc3luYyhiaW5hcnksYmluYXJ5RmlsZSxpbXBvcnRzLGNhbGxiYWNrKXtyZXR1cm4gaW5zdGFudGlhdGVBcnJheUJ1ZmZlcihiaW5hcnlGaWxlLGltcG9ydHMsY2FsbGJhY2spfWZ1bmN0aW9uIGNyZWF0ZVdhc20oKXt2YXIgaW5mbz17ImEiOndhc21JbXBvcnRzfTtmdW5jdGlvbiByZWNlaXZlSW5zdGFuY2UoaW5zdGFuY2UsbW9kdWxlKXt3YXNtRXhwb3J0cz1pbnN0YW5jZS5leHBvcnRzO3dhc21NZW1vcnk9d2FzbUV4cG9ydHNbImsiXTt1cGRhdGVNZW1vcnlWaWV3cygpO2FkZE9uSW5pdCh3YXNtRXhwb3J0c1sibCJdKTtyZW1vdmVSdW5EZXBlbmRlbmN5KCk7cmV0dXJuIHdhc21FeHBvcnRzfWFkZFJ1bkRlcGVuZGVuY3koKTtmdW5jdGlvbiByZWNlaXZlSW5zdGFudGlhdGlvblJlc3VsdChyZXN1bHQpe3JlY2VpdmVJbnN0YW5jZShyZXN1bHRbImluc3RhbmNlIl0pO31pZihNb2R1bGVbImluc3RhbnRpYXRlV2FzbSJdKXt0cnl7cmV0dXJuIE1vZHVsZVsiaW5zdGFudGlhdGVXYXNtIl0oaW5mbyxyZWNlaXZlSW5zdGFuY2UpfWNhdGNoKGUpe2VycihgTW9kdWxlLmluc3RhbnRpYXRlV2FzbSBjYWxsYmFjayBmYWlsZWQgd2l0aCBlcnJvcjogJHtlfWApO3JlYWR5UHJvbWlzZVJlamVjdChlKTt9fWluc3RhbnRpYXRlQXN5bmMod2FzbUJpbmFyeSx3YXNtQmluYXJ5RmlsZSxpbmZvLHJlY2VpdmVJbnN0YW50aWF0aW9uUmVzdWx0KS5jYXRjaChyZWFkeVByb21pc2VSZWplY3QpO3JldHVybiB7fX12YXIgY2FsbFJ1bnRpbWVDYWxsYmFja3M9Y2FsbGJhY2tzPT57d2hpbGUoY2FsbGJhY2tzLmxlbmd0aD4wKXtjYWxsYmFja3Muc2hpZnQoKShNb2R1bGUpO319O01vZHVsZVsibm9FeGl0UnVudGltZSJdfHx0cnVlO3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9iaWdpbnQ9KHByaW1pdGl2ZVR5cGUsbmFtZSxzaXplLG1pblJhbmdlLG1heFJhbmdlKT0+e307dmFyIGVtYmluZF9pbml0X2NoYXJDb2Rlcz0oKT0+e3ZhciBjb2Rlcz1uZXcgQXJyYXkoMjU2KTtmb3IodmFyIGk9MDtpPDI1NjsrK2kpe2NvZGVzW2ldPVN0cmluZy5mcm9tQ2hhckNvZGUoaSk7fWVtYmluZF9jaGFyQ29kZXM9Y29kZXM7fTt2YXIgZW1iaW5kX2NoYXJDb2Rlczt2YXIgcmVhZExhdGluMVN0cmluZz1wdHI9Pnt2YXIgcmV0PSIiO3ZhciBjPXB0cjt3aGlsZShIRUFQVThbY10pe3JldCs9ZW1iaW5kX2NoYXJDb2Rlc1tIRUFQVThbYysrXV07fXJldHVybiByZXR9O3ZhciBhd2FpdGluZ0RlcGVuZGVuY2llcz17fTt2YXIgcmVnaXN0ZXJlZFR5cGVzPXt9O3ZhciBCaW5kaW5nRXJyb3I7dmFyIHRocm93QmluZGluZ0Vycm9yPW1lc3NhZ2U9Pnt0aHJvdyBuZXcgQmluZGluZ0Vycm9yKG1lc3NhZ2UpfTtmdW5jdGlvbiBzaGFyZWRSZWdpc3RlclR5cGUocmF3VHlwZSxyZWdpc3RlcmVkSW5zdGFuY2Usb3B0aW9ucz17fSl7dmFyIG5hbWU9cmVnaXN0ZXJlZEluc3RhbmNlLm5hbWU7aWYoIXJhd1R5cGUpe3Rocm93QmluZGluZ0Vycm9yKGB0eXBlICIke25hbWV9IiBtdXN0IGhhdmUgYSBwb3NpdGl2ZSBpbnRlZ2VyIHR5cGVpZCBwb2ludGVyYCk7fWlmKHJlZ2lzdGVyZWRUeXBlcy5oYXNPd25Qcm9wZXJ0eShyYXdUeXBlKSl7aWYob3B0aW9ucy5pZ25vcmVEdXBsaWNhdGVSZWdpc3RyYXRpb25zKXtyZXR1cm59ZWxzZSB7dGhyb3dCaW5kaW5nRXJyb3IoYENhbm5vdCByZWdpc3RlciB0eXBlICcke25hbWV9JyB0d2ljZWApO319cmVnaXN0ZXJlZFR5cGVzW3Jhd1R5cGVdPXJlZ2lzdGVyZWRJbnN0YW5jZTtpZihhd2FpdGluZ0RlcGVuZGVuY2llcy5oYXNPd25Qcm9wZXJ0eShyYXdUeXBlKSl7dmFyIGNhbGxiYWNrcz1hd2FpdGluZ0RlcGVuZGVuY2llc1tyYXdUeXBlXTtkZWxldGUgYXdhaXRpbmdEZXBlbmRlbmNpZXNbcmF3VHlwZV07Y2FsbGJhY2tzLmZvckVhY2goY2I9PmNiKCkpO319ZnVuY3Rpb24gcmVnaXN0ZXJUeXBlKHJhd1R5cGUscmVnaXN0ZXJlZEluc3RhbmNlLG9wdGlvbnM9e30pe2lmKCEoImFyZ1BhY2tBZHZhbmNlImluIHJlZ2lzdGVyZWRJbnN0YW5jZSkpe3Rocm93IG5ldyBUeXBlRXJyb3IoInJlZ2lzdGVyVHlwZSByZWdpc3RlcmVkSW5zdGFuY2UgcmVxdWlyZXMgYXJnUGFja0FkdmFuY2UiKX1yZXR1cm4gc2hhcmVkUmVnaXN0ZXJUeXBlKHJhd1R5cGUscmVnaXN0ZXJlZEluc3RhbmNlLG9wdGlvbnMpfXZhciBHZW5lcmljV2lyZVR5cGVTaXplPTg7dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2Jvb2w9KHJhd1R5cGUsbmFtZSx0cnVlVmFsdWUsZmFsc2VWYWx1ZSk9PntuYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjpmdW5jdGlvbih3dCl7cmV0dXJuICEhd3R9LCJ0b1dpcmVUeXBlIjpmdW5jdGlvbihkZXN0cnVjdG9ycyxvKXtyZXR1cm4gbz90cnVlVmFsdWU6ZmFsc2VWYWx1ZX0sImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6ZnVuY3Rpb24ocG9pbnRlcil7cmV0dXJuIHRoaXNbImZyb21XaXJlVHlwZSJdKEhFQVBVOFtwb2ludGVyXSl9LGRlc3RydWN0b3JGdW5jdGlvbjpudWxsfSk7fTt2YXIgZW12YWxfZnJlZWxpc3Q9W107dmFyIGVtdmFsX2hhbmRsZXM9W107dmFyIF9fZW12YWxfZGVjcmVmPWhhbmRsZT0+e2lmKGhhbmRsZT45JiYwPT09LS1lbXZhbF9oYW5kbGVzW2hhbmRsZSsxXSl7ZW12YWxfaGFuZGxlc1toYW5kbGVdPXVuZGVmaW5lZDtlbXZhbF9mcmVlbGlzdC5wdXNoKGhhbmRsZSk7fX07dmFyIGNvdW50X2VtdmFsX2hhbmRsZXM9KCk9PmVtdmFsX2hhbmRsZXMubGVuZ3RoLzItNS1lbXZhbF9mcmVlbGlzdC5sZW5ndGg7dmFyIGluaXRfZW12YWw9KCk9PntlbXZhbF9oYW5kbGVzLnB1c2goMCwxLHVuZGVmaW5lZCwxLG51bGwsMSx0cnVlLDEsZmFsc2UsMSk7TW9kdWxlWyJjb3VudF9lbXZhbF9oYW5kbGVzIl09Y291bnRfZW12YWxfaGFuZGxlczt9O3ZhciBFbXZhbD17dG9WYWx1ZTpoYW5kbGU9PntpZighaGFuZGxlKXt0aHJvd0JpbmRpbmdFcnJvcigiQ2Fubm90IHVzZSBkZWxldGVkIHZhbC4gaGFuZGxlID0gIitoYW5kbGUpO31yZXR1cm4gZW12YWxfaGFuZGxlc1toYW5kbGVdfSx0b0hhbmRsZTp2YWx1ZT0+e3N3aXRjaCh2YWx1ZSl7Y2FzZSB1bmRlZmluZWQ6cmV0dXJuIDI7Y2FzZSBudWxsOnJldHVybiA0O2Nhc2UgdHJ1ZTpyZXR1cm4gNjtjYXNlIGZhbHNlOnJldHVybiA4O2RlZmF1bHQ6e2NvbnN0IGhhbmRsZT1lbXZhbF9mcmVlbGlzdC5wb3AoKXx8ZW12YWxfaGFuZGxlcy5sZW5ndGg7ZW12YWxfaGFuZGxlc1toYW5kbGVdPXZhbHVlO2VtdmFsX2hhbmRsZXNbaGFuZGxlKzFdPTE7cmV0dXJuIGhhbmRsZX19fX07ZnVuY3Rpb24gcmVhZFBvaW50ZXIocG9pbnRlcil7cmV0dXJuIHRoaXNbImZyb21XaXJlVHlwZSJdKEhFQVBVMzJbcG9pbnRlcj4+Ml0pfXZhciBFbVZhbFR5cGU9e25hbWU6ImVtc2NyaXB0ZW46OnZhbCIsImZyb21XaXJlVHlwZSI6aGFuZGxlPT57dmFyIHJ2PUVtdmFsLnRvVmFsdWUoaGFuZGxlKTtfX2VtdmFsX2RlY3JlZihoYW5kbGUpO3JldHVybiBydn0sInRvV2lyZVR5cGUiOihkZXN0cnVjdG9ycyx2YWx1ZSk9PkVtdmFsLnRvSGFuZGxlKHZhbHVlKSwiYXJnUGFja0FkdmFuY2UiOkdlbmVyaWNXaXJlVHlwZVNpemUsInJlYWRWYWx1ZUZyb21Qb2ludGVyIjpyZWFkUG9pbnRlcixkZXN0cnVjdG9yRnVuY3Rpb246bnVsbH07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2VtdmFsPXJhd1R5cGU9PnJlZ2lzdGVyVHlwZShyYXdUeXBlLEVtVmFsVHlwZSk7dmFyIGZsb2F0UmVhZFZhbHVlRnJvbVBvaW50ZXI9KG5hbWUsd2lkdGgpPT57c3dpdGNoKHdpZHRoKXtjYXNlIDQ6cmV0dXJuIGZ1bmN0aW9uKHBvaW50ZXIpe3JldHVybiB0aGlzWyJmcm9tV2lyZVR5cGUiXShIRUFQRjMyW3BvaW50ZXI+PjJdKX07Y2FzZSA4OnJldHVybiBmdW5jdGlvbihwb2ludGVyKXtyZXR1cm4gdGhpc1siZnJvbVdpcmVUeXBlIl0oSEVBUEY2NFtwb2ludGVyPj4zXSl9O2RlZmF1bHQ6dGhyb3cgbmV3IFR5cGVFcnJvcihgaW52YWxpZCBmbG9hdCB3aWR0aCAoJHt3aWR0aH0pOiAke25hbWV9YCl9fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfZmxvYXQ9KHJhd1R5cGUsbmFtZSxzaXplKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTtyZWdpc3RlclR5cGUocmF3VHlwZSx7bmFtZTpuYW1lLCJmcm9tV2lyZVR5cGUiOnZhbHVlPT52YWx1ZSwidG9XaXJlVHlwZSI6KGRlc3RydWN0b3JzLHZhbHVlKT0+dmFsdWUsImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6ZmxvYXRSZWFkVmFsdWVGcm9tUG9pbnRlcihuYW1lLHNpemUpLGRlc3RydWN0b3JGdW5jdGlvbjpudWxsfSk7fTt2YXIgaW50ZWdlclJlYWRWYWx1ZUZyb21Qb2ludGVyPShuYW1lLHdpZHRoLHNpZ25lZCk9Pntzd2l0Y2god2lkdGgpe2Nhc2UgMTpyZXR1cm4gc2lnbmVkP3BvaW50ZXI9PkhFQVA4W3BvaW50ZXJdOnBvaW50ZXI9PkhFQVBVOFtwb2ludGVyXTtjYXNlIDI6cmV0dXJuIHNpZ25lZD9wb2ludGVyPT5IRUFQMTZbcG9pbnRlcj4+MV06cG9pbnRlcj0+SEVBUFUxNltwb2ludGVyPj4xXTtjYXNlIDQ6cmV0dXJuIHNpZ25lZD9wb2ludGVyPT5IRUFQMzJbcG9pbnRlcj4+Ml06cG9pbnRlcj0+SEVBUFUzMltwb2ludGVyPj4yXTtkZWZhdWx0OnRocm93IG5ldyBUeXBlRXJyb3IoYGludmFsaWQgaW50ZWdlciB3aWR0aCAoJHt3aWR0aH0pOiAke25hbWV9YCl9fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfaW50ZWdlcj0ocHJpbWl0aXZlVHlwZSxuYW1lLHNpemUsbWluUmFuZ2UsbWF4UmFuZ2UpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3ZhciBmcm9tV2lyZVR5cGU9dmFsdWU9PnZhbHVlO2lmKG1pblJhbmdlPT09MCl7dmFyIGJpdHNoaWZ0PTMyLTgqc2l6ZTtmcm9tV2lyZVR5cGU9dmFsdWU9PnZhbHVlPDxiaXRzaGlmdD4+PmJpdHNoaWZ0O312YXIgaXNVbnNpZ25lZFR5cGU9bmFtZS5pbmNsdWRlcygidW5zaWduZWQiKTt2YXIgY2hlY2tBc3NlcnRpb25zPSh2YWx1ZSx0b1R5cGVOYW1lKT0+e307dmFyIHRvV2lyZVR5cGU7aWYoaXNVbnNpZ25lZFR5cGUpe3RvV2lyZVR5cGU9ZnVuY3Rpb24oZGVzdHJ1Y3RvcnMsdmFsdWUpe2NoZWNrQXNzZXJ0aW9ucyh2YWx1ZSx0aGlzLm5hbWUpO3JldHVybiB2YWx1ZT4+PjB9O31lbHNlIHt0b1dpcmVUeXBlPWZ1bmN0aW9uKGRlc3RydWN0b3JzLHZhbHVlKXtjaGVja0Fzc2VydGlvbnModmFsdWUsdGhpcy5uYW1lKTtyZXR1cm4gdmFsdWV9O31yZWdpc3RlclR5cGUocHJpbWl0aXZlVHlwZSx7bmFtZTpuYW1lLCJmcm9tV2lyZVR5cGUiOmZyb21XaXJlVHlwZSwidG9XaXJlVHlwZSI6dG9XaXJlVHlwZSwiYXJnUGFja0FkdmFuY2UiOkdlbmVyaWNXaXJlVHlwZVNpemUsInJlYWRWYWx1ZUZyb21Qb2ludGVyIjppbnRlZ2VyUmVhZFZhbHVlRnJvbVBvaW50ZXIobmFtZSxzaXplLG1pblJhbmdlIT09MCksZGVzdHJ1Y3RvckZ1bmN0aW9uOm51bGx9KTt9O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9tZW1vcnlfdmlldz0ocmF3VHlwZSxkYXRhVHlwZUluZGV4LG5hbWUpPT57dmFyIHR5cGVNYXBwaW5nPVtJbnQ4QXJyYXksVWludDhBcnJheSxJbnQxNkFycmF5LFVpbnQxNkFycmF5LEludDMyQXJyYXksVWludDMyQXJyYXksRmxvYXQzMkFycmF5LEZsb2F0NjRBcnJheV07dmFyIFRBPXR5cGVNYXBwaW5nW2RhdGFUeXBlSW5kZXhdO2Z1bmN0aW9uIGRlY29kZU1lbW9yeVZpZXcoaGFuZGxlKXt2YXIgc2l6ZT1IRUFQVTMyW2hhbmRsZT4+Ml07dmFyIGRhdGE9SEVBUFUzMltoYW5kbGUrND4+Ml07cmV0dXJuIG5ldyBUQShIRUFQOC5idWZmZXIsZGF0YSxzaXplKX1uYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjpkZWNvZGVNZW1vcnlWaWV3LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOmRlY29kZU1lbW9yeVZpZXd9LHtpZ25vcmVEdXBsaWNhdGVSZWdpc3RyYXRpb25zOnRydWV9KTt9O3ZhciBzdHJpbmdUb1VURjhBcnJheT0oc3RyLGhlYXAsb3V0SWR4LG1heEJ5dGVzVG9Xcml0ZSk9PntpZighKG1heEJ5dGVzVG9Xcml0ZT4wKSlyZXR1cm4gMDt2YXIgc3RhcnRJZHg9b3V0SWR4O3ZhciBlbmRJZHg9b3V0SWR4K21heEJ5dGVzVG9Xcml0ZS0xO2Zvcih2YXIgaT0wO2k8c3RyLmxlbmd0aDsrK2kpe3ZhciB1PXN0ci5jaGFyQ29kZUF0KGkpO2lmKHU+PTU1Mjk2JiZ1PD01NzM0Myl7dmFyIHUxPXN0ci5jaGFyQ29kZUF0KCsraSk7dT02NTUzNisoKHUmMTAyMyk8PDEwKXx1MSYxMDIzO31pZih1PD0xMjcpe2lmKG91dElkeD49ZW5kSWR4KWJyZWFrO2hlYXBbb3V0SWR4KytdPXU7fWVsc2UgaWYodTw9MjA0Nyl7aWYob3V0SWR4KzE+PWVuZElkeClicmVhaztoZWFwW291dElkeCsrXT0xOTJ8dT4+NjtoZWFwW291dElkeCsrXT0xMjh8dSY2Mzt9ZWxzZSBpZih1PD02NTUzNSl7aWYob3V0SWR4KzI+PWVuZElkeClicmVhaztoZWFwW291dElkeCsrXT0yMjR8dT4+MTI7aGVhcFtvdXRJZHgrK109MTI4fHU+PjYmNjM7aGVhcFtvdXRJZHgrK109MTI4fHUmNjM7fWVsc2Uge2lmKG91dElkeCszPj1lbmRJZHgpYnJlYWs7aGVhcFtvdXRJZHgrK109MjQwfHU+PjE4O2hlYXBbb3V0SWR4KytdPTEyOHx1Pj4xMiY2MztoZWFwW291dElkeCsrXT0xMjh8dT4+NiY2MztoZWFwW291dElkeCsrXT0xMjh8dSY2Mzt9fWhlYXBbb3V0SWR4XT0wO3JldHVybiBvdXRJZHgtc3RhcnRJZHh9O3ZhciBzdHJpbmdUb1VURjg9KHN0cixvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKT0+c3RyaW5nVG9VVEY4QXJyYXkoc3RyLEhFQVBVOCxvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKTt2YXIgbGVuZ3RoQnl0ZXNVVEY4PXN0cj0+e3ZhciBsZW49MDtmb3IodmFyIGk9MDtpPHN0ci5sZW5ndGg7KytpKXt2YXIgYz1zdHIuY2hhckNvZGVBdChpKTtpZihjPD0xMjcpe2xlbisrO31lbHNlIGlmKGM8PTIwNDcpe2xlbis9Mjt9ZWxzZSBpZihjPj01NTI5NiYmYzw9NTczNDMpe2xlbis9NDsrK2k7fWVsc2Uge2xlbis9Mzt9fXJldHVybiBsZW59O3ZhciBVVEY4RGVjb2Rlcj10eXBlb2YgVGV4dERlY29kZXIhPSJ1bmRlZmluZWQiP25ldyBUZXh0RGVjb2RlcigidXRmOCIpOnVuZGVmaW5lZDt2YXIgVVRGOEFycmF5VG9TdHJpbmc9KGhlYXBPckFycmF5LGlkeCxtYXhCeXRlc1RvUmVhZCk9Pnt2YXIgZW5kSWR4PWlkeCttYXhCeXRlc1RvUmVhZDt2YXIgZW5kUHRyPWlkeDt3aGlsZShoZWFwT3JBcnJheVtlbmRQdHJdJiYhKGVuZFB0cj49ZW5kSWR4KSkrK2VuZFB0cjtpZihlbmRQdHItaWR4PjE2JiZoZWFwT3JBcnJheS5idWZmZXImJlVURjhEZWNvZGVyKXtyZXR1cm4gVVRGOERlY29kZXIuZGVjb2RlKGhlYXBPckFycmF5LnN1YmFycmF5KGlkeCxlbmRQdHIpKX12YXIgc3RyPSIiO3doaWxlKGlkeDxlbmRQdHIpe3ZhciB1MD1oZWFwT3JBcnJheVtpZHgrK107aWYoISh1MCYxMjgpKXtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUodTApO2NvbnRpbnVlfXZhciB1MT1oZWFwT3JBcnJheVtpZHgrK10mNjM7aWYoKHUwJjIyNCk9PTE5Mil7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKCh1MCYzMSk8PDZ8dTEpO2NvbnRpbnVlfXZhciB1Mj1oZWFwT3JBcnJheVtpZHgrK10mNjM7aWYoKHUwJjI0MCk9PTIyNCl7dTA9KHUwJjE1KTw8MTJ8dTE8PDZ8dTI7fWVsc2Uge3UwPSh1MCY3KTw8MTh8dTE8PDEyfHUyPDw2fGhlYXBPckFycmF5W2lkeCsrXSY2Mzt9aWYodTA8NjU1MzYpe3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSh1MCk7fWVsc2Uge3ZhciBjaD11MC02NTUzNjtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoNTUyOTZ8Y2g+PjEwLDU2MzIwfGNoJjEwMjMpO319cmV0dXJuIHN0cn07dmFyIFVURjhUb1N0cmluZz0ocHRyLG1heEJ5dGVzVG9SZWFkKT0+cHRyP1VURjhBcnJheVRvU3RyaW5nKEhFQVBVOCxwdHIsbWF4Qnl0ZXNUb1JlYWQpOiIiO3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9zdGRfc3RyaW5nPShyYXdUeXBlLG5hbWUpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3ZhciBzdGRTdHJpbmdJc1VURjg9bmFtZT09PSJzdGQ6OnN0cmluZyI7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIih2YWx1ZSl7dmFyIGxlbmd0aD1IRUFQVTMyW3ZhbHVlPj4yXTt2YXIgcGF5bG9hZD12YWx1ZSs0O3ZhciBzdHI7aWYoc3RkU3RyaW5nSXNVVEY4KXt2YXIgZGVjb2RlU3RhcnRQdHI9cGF5bG9hZDtmb3IodmFyIGk9MDtpPD1sZW5ndGg7KytpKXt2YXIgY3VycmVudEJ5dGVQdHI9cGF5bG9hZCtpO2lmKGk9PWxlbmd0aHx8SEVBUFU4W2N1cnJlbnRCeXRlUHRyXT09MCl7dmFyIG1heFJlYWQ9Y3VycmVudEJ5dGVQdHItZGVjb2RlU3RhcnRQdHI7dmFyIHN0cmluZ1NlZ21lbnQ9VVRGOFRvU3RyaW5nKGRlY29kZVN0YXJ0UHRyLG1heFJlYWQpO2lmKHN0cj09PXVuZGVmaW5lZCl7c3RyPXN0cmluZ1NlZ21lbnQ7fWVsc2Uge3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSgwKTtzdHIrPXN0cmluZ1NlZ21lbnQ7fWRlY29kZVN0YXJ0UHRyPWN1cnJlbnRCeXRlUHRyKzE7fX19ZWxzZSB7dmFyIGE9bmV3IEFycmF5KGxlbmd0aCk7Zm9yKHZhciBpPTA7aTxsZW5ndGg7KytpKXthW2ldPVN0cmluZy5mcm9tQ2hhckNvZGUoSEVBUFU4W3BheWxvYWQraV0pO31zdHI9YS5qb2luKCIiKTt9X2ZyZWUodmFsdWUpO3JldHVybiBzdHJ9LCJ0b1dpcmVUeXBlIihkZXN0cnVjdG9ycyx2YWx1ZSl7aWYodmFsdWUgaW5zdGFuY2VvZiBBcnJheUJ1ZmZlcil7dmFsdWU9bmV3IFVpbnQ4QXJyYXkodmFsdWUpO312YXIgbGVuZ3RoO3ZhciB2YWx1ZUlzT2ZUeXBlU3RyaW5nPXR5cGVvZiB2YWx1ZT09InN0cmluZyI7aWYoISh2YWx1ZUlzT2ZUeXBlU3RyaW5nfHx2YWx1ZSBpbnN0YW5jZW9mIFVpbnQ4QXJyYXl8fHZhbHVlIGluc3RhbmNlb2YgVWludDhDbGFtcGVkQXJyYXl8fHZhbHVlIGluc3RhbmNlb2YgSW50OEFycmF5KSl7dGhyb3dCaW5kaW5nRXJyb3IoIkNhbm5vdCBwYXNzIG5vbi1zdHJpbmcgdG8gc3RkOjpzdHJpbmciKTt9aWYoc3RkU3RyaW5nSXNVVEY4JiZ2YWx1ZUlzT2ZUeXBlU3RyaW5nKXtsZW5ndGg9bGVuZ3RoQnl0ZXNVVEY4KHZhbHVlKTt9ZWxzZSB7bGVuZ3RoPXZhbHVlLmxlbmd0aDt9dmFyIGJhc2U9X21hbGxvYyg0K2xlbmd0aCsxKTt2YXIgcHRyPWJhc2UrNDtIRUFQVTMyW2Jhc2U+PjJdPWxlbmd0aDtpZihzdGRTdHJpbmdJc1VURjgmJnZhbHVlSXNPZlR5cGVTdHJpbmcpe3N0cmluZ1RvVVRGOCh2YWx1ZSxwdHIsbGVuZ3RoKzEpO31lbHNlIHtpZih2YWx1ZUlzT2ZUeXBlU3RyaW5nKXtmb3IodmFyIGk9MDtpPGxlbmd0aDsrK2kpe3ZhciBjaGFyQ29kZT12YWx1ZS5jaGFyQ29kZUF0KGkpO2lmKGNoYXJDb2RlPjI1NSl7X2ZyZWUocHRyKTt0aHJvd0JpbmRpbmdFcnJvcigiU3RyaW5nIGhhcyBVVEYtMTYgY29kZSB1bml0cyB0aGF0IGRvIG5vdCBmaXQgaW4gOCBiaXRzIik7fUhFQVBVOFtwdHIraV09Y2hhckNvZGU7fX1lbHNlIHtmb3IodmFyIGk9MDtpPGxlbmd0aDsrK2kpe0hFQVBVOFtwdHIraV09dmFsdWVbaV07fX19aWYoZGVzdHJ1Y3RvcnMhPT1udWxsKXtkZXN0cnVjdG9ycy5wdXNoKF9mcmVlLGJhc2UpO31yZXR1cm4gYmFzZX0sImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6cmVhZFBvaW50ZXIsZGVzdHJ1Y3RvckZ1bmN0aW9uKHB0cil7X2ZyZWUocHRyKTt9fSk7fTt2YXIgVVRGMTZEZWNvZGVyPXR5cGVvZiBUZXh0RGVjb2RlciE9InVuZGVmaW5lZCI/bmV3IFRleHREZWNvZGVyKCJ1dGYtMTZsZSIpOnVuZGVmaW5lZDt2YXIgVVRGMTZUb1N0cmluZz0ocHRyLG1heEJ5dGVzVG9SZWFkKT0+e3ZhciBlbmRQdHI9cHRyO3ZhciBpZHg9ZW5kUHRyPj4xO3ZhciBtYXhJZHg9aWR4K21heEJ5dGVzVG9SZWFkLzI7d2hpbGUoIShpZHg+PW1heElkeCkmJkhFQVBVMTZbaWR4XSkrK2lkeDtlbmRQdHI9aWR4PDwxO2lmKGVuZFB0ci1wdHI+MzImJlVURjE2RGVjb2RlcilyZXR1cm4gVVRGMTZEZWNvZGVyLmRlY29kZShIRUFQVTguc3ViYXJyYXkocHRyLGVuZFB0cikpO3ZhciBzdHI9IiI7Zm9yKHZhciBpPTA7IShpPj1tYXhCeXRlc1RvUmVhZC8yKTsrK2kpe3ZhciBjb2RlVW5pdD1IRUFQMTZbcHRyK2kqMj4+MV07aWYoY29kZVVuaXQ9PTApYnJlYWs7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKGNvZGVVbml0KTt9cmV0dXJuIHN0cn07dmFyIHN0cmluZ1RvVVRGMTY9KHN0cixvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKT0+e21heEJ5dGVzVG9Xcml0ZT8/PTIxNDc0ODM2NDc7aWYobWF4Qnl0ZXNUb1dyaXRlPDIpcmV0dXJuIDA7bWF4Qnl0ZXNUb1dyaXRlLT0yO3ZhciBzdGFydFB0cj1vdXRQdHI7dmFyIG51bUNoYXJzVG9Xcml0ZT1tYXhCeXRlc1RvV3JpdGU8c3RyLmxlbmd0aCoyP21heEJ5dGVzVG9Xcml0ZS8yOnN0ci5sZW5ndGg7Zm9yKHZhciBpPTA7aTxudW1DaGFyc1RvV3JpdGU7KytpKXt2YXIgY29kZVVuaXQ9c3RyLmNoYXJDb2RlQXQoaSk7SEVBUDE2W291dFB0cj4+MV09Y29kZVVuaXQ7b3V0UHRyKz0yO31IRUFQMTZbb3V0UHRyPj4xXT0wO3JldHVybiBvdXRQdHItc3RhcnRQdHJ9O3ZhciBsZW5ndGhCeXRlc1VURjE2PXN0cj0+c3RyLmxlbmd0aCoyO3ZhciBVVEYzMlRvU3RyaW5nPShwdHIsbWF4Qnl0ZXNUb1JlYWQpPT57dmFyIGk9MDt2YXIgc3RyPSIiO3doaWxlKCEoaT49bWF4Qnl0ZXNUb1JlYWQvNCkpe3ZhciB1dGYzMj1IRUFQMzJbcHRyK2kqND4+Ml07aWYodXRmMzI9PTApYnJlYWs7KytpO2lmKHV0ZjMyPj02NTUzNil7dmFyIGNoPXV0ZjMyLTY1NTM2O3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSg1NTI5NnxjaD4+MTAsNTYzMjB8Y2gmMTAyMyk7fWVsc2Uge3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSh1dGYzMik7fX1yZXR1cm4gc3RyfTt2YXIgc3RyaW5nVG9VVEYzMj0oc3RyLG91dFB0cixtYXhCeXRlc1RvV3JpdGUpPT57bWF4Qnl0ZXNUb1dyaXRlPz89MjE0NzQ4MzY0NztpZihtYXhCeXRlc1RvV3JpdGU8NClyZXR1cm4gMDt2YXIgc3RhcnRQdHI9b3V0UHRyO3ZhciBlbmRQdHI9c3RhcnRQdHIrbWF4Qnl0ZXNUb1dyaXRlLTQ7Zm9yKHZhciBpPTA7aTxzdHIubGVuZ3RoOysraSl7dmFyIGNvZGVVbml0PXN0ci5jaGFyQ29kZUF0KGkpO2lmKGNvZGVVbml0Pj01NTI5NiYmY29kZVVuaXQ8PTU3MzQzKXt2YXIgdHJhaWxTdXJyb2dhdGU9c3RyLmNoYXJDb2RlQXQoKytpKTtjb2RlVW5pdD02NTUzNisoKGNvZGVVbml0JjEwMjMpPDwxMCl8dHJhaWxTdXJyb2dhdGUmMTAyMzt9SEVBUDMyW291dFB0cj4+Ml09Y29kZVVuaXQ7b3V0UHRyKz00O2lmKG91dFB0cis0PmVuZFB0cilicmVha31IRUFQMzJbb3V0UHRyPj4yXT0wO3JldHVybiBvdXRQdHItc3RhcnRQdHJ9O3ZhciBsZW5ndGhCeXRlc1VURjMyPXN0cj0+e3ZhciBsZW49MDtmb3IodmFyIGk9MDtpPHN0ci5sZW5ndGg7KytpKXt2YXIgY29kZVVuaXQ9c3RyLmNoYXJDb2RlQXQoaSk7aWYoY29kZVVuaXQ+PTU1Mjk2JiZjb2RlVW5pdDw9NTczNDMpKytpO2xlbis9NDt9cmV0dXJuIGxlbn07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX3N0ZF93c3RyaW5nPShyYXdUeXBlLGNoYXJTaXplLG5hbWUpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3ZhciBkZWNvZGVTdHJpbmcsZW5jb2RlU3RyaW5nLHJlYWRDaGFyQXQsbGVuZ3RoQnl0ZXNVVEY7aWYoY2hhclNpemU9PT0yKXtkZWNvZGVTdHJpbmc9VVRGMTZUb1N0cmluZztlbmNvZGVTdHJpbmc9c3RyaW5nVG9VVEYxNjtsZW5ndGhCeXRlc1VURj1sZW5ndGhCeXRlc1VURjE2O3JlYWRDaGFyQXQ9cG9pbnRlcj0+SEVBUFUxNltwb2ludGVyPj4xXTt9ZWxzZSBpZihjaGFyU2l6ZT09PTQpe2RlY29kZVN0cmluZz1VVEYzMlRvU3RyaW5nO2VuY29kZVN0cmluZz1zdHJpbmdUb1VURjMyO2xlbmd0aEJ5dGVzVVRGPWxlbmd0aEJ5dGVzVVRGMzI7cmVhZENoYXJBdD1wb2ludGVyPT5IRUFQVTMyW3BvaW50ZXI+PjJdO31yZWdpc3RlclR5cGUocmF3VHlwZSx7bmFtZTpuYW1lLCJmcm9tV2lyZVR5cGUiOnZhbHVlPT57dmFyIGxlbmd0aD1IRUFQVTMyW3ZhbHVlPj4yXTt2YXIgc3RyO3ZhciBkZWNvZGVTdGFydFB0cj12YWx1ZSs0O2Zvcih2YXIgaT0wO2k8PWxlbmd0aDsrK2kpe3ZhciBjdXJyZW50Qnl0ZVB0cj12YWx1ZSs0K2kqY2hhclNpemU7aWYoaT09bGVuZ3RofHxyZWFkQ2hhckF0KGN1cnJlbnRCeXRlUHRyKT09MCl7dmFyIG1heFJlYWRCeXRlcz1jdXJyZW50Qnl0ZVB0ci1kZWNvZGVTdGFydFB0cjt2YXIgc3RyaW5nU2VnbWVudD1kZWNvZGVTdHJpbmcoZGVjb2RlU3RhcnRQdHIsbWF4UmVhZEJ5dGVzKTtpZihzdHI9PT11bmRlZmluZWQpe3N0cj1zdHJpbmdTZWdtZW50O31lbHNlIHtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoMCk7c3RyKz1zdHJpbmdTZWdtZW50O31kZWNvZGVTdGFydFB0cj1jdXJyZW50Qnl0ZVB0citjaGFyU2l6ZTt9fV9mcmVlKHZhbHVlKTtyZXR1cm4gc3RyfSwidG9XaXJlVHlwZSI6KGRlc3RydWN0b3JzLHZhbHVlKT0+e2lmKCEodHlwZW9mIHZhbHVlPT0ic3RyaW5nIikpe3Rocm93QmluZGluZ0Vycm9yKGBDYW5ub3QgcGFzcyBub24tc3RyaW5nIHRvIEMrKyBzdHJpbmcgdHlwZSAke25hbWV9YCk7fXZhciBsZW5ndGg9bGVuZ3RoQnl0ZXNVVEYodmFsdWUpO3ZhciBwdHI9X21hbGxvYyg0K2xlbmd0aCtjaGFyU2l6ZSk7SEVBUFUzMltwdHI+PjJdPWxlbmd0aC9jaGFyU2l6ZTtlbmNvZGVTdHJpbmcodmFsdWUscHRyKzQsbGVuZ3RoK2NoYXJTaXplKTtpZihkZXN0cnVjdG9ycyE9PW51bGwpe2Rlc3RydWN0b3JzLnB1c2goX2ZyZWUscHRyKTt9cmV0dXJuIHB0cn0sImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6cmVhZFBvaW50ZXIsZGVzdHJ1Y3RvckZ1bmN0aW9uKHB0cil7X2ZyZWUocHRyKTt9fSk7fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfdm9pZD0ocmF3VHlwZSxuYW1lKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTtyZWdpc3RlclR5cGUocmF3VHlwZSx7aXNWb2lkOnRydWUsbmFtZTpuYW1lLCJhcmdQYWNrQWR2YW5jZSI6MCwiZnJvbVdpcmVUeXBlIjooKT0+dW5kZWZpbmVkLCJ0b1dpcmVUeXBlIjooZGVzdHJ1Y3RvcnMsbyk9PnVuZGVmaW5lZH0pO307dmFyIGdldEhlYXBNYXg9KCk9PjIxNDc0ODM2NDg7dmFyIGdyb3dNZW1vcnk9c2l6ZT0+e3ZhciBiPXdhc21NZW1vcnkuYnVmZmVyO3ZhciBwYWdlcz0oc2l6ZS1iLmJ5dGVMZW5ndGgrNjU1MzUpLzY1NTM2O3RyeXt3YXNtTWVtb3J5Lmdyb3cocGFnZXMpO3VwZGF0ZU1lbW9yeVZpZXdzKCk7cmV0dXJuIDF9Y2F0Y2goZSl7fX07dmFyIF9lbXNjcmlwdGVuX3Jlc2l6ZV9oZWFwPXJlcXVlc3RlZFNpemU9Pnt2YXIgb2xkU2l6ZT1IRUFQVTgubGVuZ3RoO3JlcXVlc3RlZFNpemU+Pj49MDt2YXIgbWF4SGVhcFNpemU9Z2V0SGVhcE1heCgpO2lmKHJlcXVlc3RlZFNpemU+bWF4SGVhcFNpemUpe3JldHVybiBmYWxzZX12YXIgYWxpZ25VcD0oeCxtdWx0aXBsZSk9PngrKG11bHRpcGxlLXglbXVsdGlwbGUpJW11bHRpcGxlO2Zvcih2YXIgY3V0RG93bj0xO2N1dERvd248PTQ7Y3V0RG93bio9Mil7dmFyIG92ZXJHcm93bkhlYXBTaXplPW9sZFNpemUqKDErLjIvY3V0RG93bik7b3Zlckdyb3duSGVhcFNpemU9TWF0aC5taW4ob3Zlckdyb3duSGVhcFNpemUscmVxdWVzdGVkU2l6ZSsxMDA2NjMyOTYpO3ZhciBuZXdTaXplPU1hdGgubWluKG1heEhlYXBTaXplLGFsaWduVXAoTWF0aC5tYXgocmVxdWVzdGVkU2l6ZSxvdmVyR3Jvd25IZWFwU2l6ZSksNjU1MzYpKTt2YXIgcmVwbGFjZW1lbnQ9Z3Jvd01lbW9yeShuZXdTaXplKTtpZihyZXBsYWNlbWVudCl7cmV0dXJuIHRydWV9fXJldHVybiBmYWxzZX07ZW1iaW5kX2luaXRfY2hhckNvZGVzKCk7QmluZGluZ0Vycm9yPU1vZHVsZVsiQmluZGluZ0Vycm9yIl09Y2xhc3MgQmluZGluZ0Vycm9yIGV4dGVuZHMgRXJyb3J7Y29uc3RydWN0b3IobWVzc2FnZSl7c3VwZXIobWVzc2FnZSk7dGhpcy5uYW1lPSJCaW5kaW5nRXJyb3IiO319O01vZHVsZVsiSW50ZXJuYWxFcnJvciJdPWNsYXNzIEludGVybmFsRXJyb3IgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihtZXNzYWdlKXtzdXBlcihtZXNzYWdlKTt0aGlzLm5hbWU9IkludGVybmFsRXJyb3IiO319O2luaXRfZW12YWwoKTt2YXIgd2FzbUltcG9ydHM9e2Y6X19lbWJpbmRfcmVnaXN0ZXJfYmlnaW50LGk6X19lbWJpbmRfcmVnaXN0ZXJfYm9vbCxoOl9fZW1iaW5kX3JlZ2lzdGVyX2VtdmFsLGU6X19lbWJpbmRfcmVnaXN0ZXJfZmxvYXQsYjpfX2VtYmluZF9yZWdpc3Rlcl9pbnRlZ2VyLGE6X19lbWJpbmRfcmVnaXN0ZXJfbWVtb3J5X3ZpZXcsZDpfX2VtYmluZF9yZWdpc3Rlcl9zdGRfc3RyaW5nLGM6X19lbWJpbmRfcmVnaXN0ZXJfc3RkX3dzdHJpbmcsajpfX2VtYmluZF9yZWdpc3Rlcl92b2lkLGc6X2Vtc2NyaXB0ZW5fcmVzaXplX2hlYXB9O3ZhciB3YXNtRXhwb3J0cz1jcmVhdGVXYXNtKCk7TW9kdWxlWyJfc29ydCJdPShhMCxhMSxhMixhMyxhNCxhNSxhNixhNyxhOCxhOSk9PihNb2R1bGVbIl9zb3J0Il09d2FzbUV4cG9ydHNbIm0iXSkoYTAsYTEsYTIsYTMsYTQsYTUsYTYsYTcsYTgsYTkpO3ZhciBfbWFsbG9jPU1vZHVsZVsiX21hbGxvYyJdPWEwPT4oX21hbGxvYz1Nb2R1bGVbIl9tYWxsb2MiXT13YXNtRXhwb3J0c1sibyJdKShhMCk7dmFyIF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT1hMD0+KF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT13YXNtRXhwb3J0c1sicCJdKShhMCk7dmFyIGNhbGxlZFJ1bjtkZXBlbmRlbmNpZXNGdWxmaWxsZWQ9ZnVuY3Rpb24gcnVuQ2FsbGVyKCl7aWYoIWNhbGxlZFJ1bilydW4oKTtpZighY2FsbGVkUnVuKWRlcGVuZGVuY2llc0Z1bGZpbGxlZD1ydW5DYWxsZXI7fTtmdW5jdGlvbiBydW4oKXtpZihydW5EZXBlbmRlbmNpZXM+MCl7cmV0dXJufXByZVJ1bigpO2lmKHJ1bkRlcGVuZGVuY2llcz4wKXtyZXR1cm59ZnVuY3Rpb24gZG9SdW4oKXtpZihjYWxsZWRSdW4pcmV0dXJuO2NhbGxlZFJ1bj10cnVlO01vZHVsZVsiY2FsbGVkUnVuIl09dHJ1ZTtpZihBQk9SVClyZXR1cm47aW5pdFJ1bnRpbWUoKTtyZWFkeVByb21pc2VSZXNvbHZlKE1vZHVsZSk7aWYoTW9kdWxlWyJvblJ1bnRpbWVJbml0aWFsaXplZCJdKU1vZHVsZVsib25SdW50aW1lSW5pdGlhbGl6ZWQiXSgpO3Bvc3RSdW4oKTt9aWYoTW9kdWxlWyJzZXRTdGF0dXMiXSl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiUnVubmluZy4uLiIpO3NldFRpbWVvdXQoZnVuY3Rpb24oKXtzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiIik7fSwxKTtkb1J1bigpO30sMSk7fWVsc2Uge2RvUnVuKCk7fX1pZihNb2R1bGVbInByZUluaXQiXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlSW5pdCJdPT0iZnVuY3Rpb24iKU1vZHVsZVsicHJlSW5pdCJdPVtNb2R1bGVbInByZUluaXQiXV07d2hpbGUoTW9kdWxlWyJwcmVJbml0Il0ubGVuZ3RoPjApe01vZHVsZVsicHJlSW5pdCJdLnBvcCgpKCk7fX1ydW4oKTsKCgogICAgcmV0dXJuIG1vZHVsZUFyZy5yZWFkeQogIH0KICApOwogIH0pKCk7CgogIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55CiAgbGV0IHdhc21Nb2R1bGU7CiAgYXN5bmMgZnVuY3Rpb24gaW5pdFdhc20oKSB7CiAgICAgIHdhc21Nb2R1bGUgPSBhd2FpdCBsb2FkV2FzbSgpOwogIH0KICBsZXQgc29ydERhdGE7CiAgbGV0IHZpZXdQcm9qUHRyOwogIGxldCB0cmFuc2Zvcm1zUHRyOwogIGxldCB0cmFuc2Zvcm1JbmRpY2VzUHRyOwogIGxldCBwb3NpdGlvbnNQdHI7CiAgbGV0IGNodW5rc1B0cjsKICBsZXQgZGVwdGhCdWZmZXJQdHI7CiAgbGV0IGRlcHRoSW5kZXhQdHI7CiAgbGV0IHN0YXJ0c1B0cjsKICBsZXQgY291bnRzUHRyOwogIGxldCBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCA9IDA7CiAgbGV0IGFsbG9jYXRlZFRyYW5zZm9ybUNvdW50ID0gMDsKICBsZXQgdmlld1Byb2ogPSBuZXcgRmxvYXQzMkFycmF5KDE2KTsKICBsZXQgbG9jayA9IGZhbHNlOwogIGxldCBhbGxvY2F0aW9uUGVuZGluZyA9IGZhbHNlOwogIGxldCBzb3J0aW5nID0gZmFsc2U7CiAgY29uc3QgYWxsb2NhdGVCdWZmZXJzID0gYXN5bmMgKCkgPT4gewogICAgICBpZiAobG9jaykgewogICAgICAgICAgYWxsb2NhdGlvblBlbmRpbmcgPSB0cnVlOwogICAgICAgICAgcmV0dXJuOwogICAgICB9CiAgICAgIGxvY2sgPSB0cnVlOwogICAgICBhbGxvY2F0aW9uUGVuZGluZyA9IGZhbHNlOwogICAgICBpZiAoIXdhc21Nb2R1bGUpCiAgICAgICAgICBhd2FpdCBpbml0V2FzbSgpOwogICAgICBjb25zdCB0YXJnZXRBbGxvY2F0ZWRWZXJ0ZXhDb3VudCA9IE1hdGgucG93KDIsIE1hdGguY2VpbChNYXRoLmxvZzIoc29ydERhdGEudmVydGV4Q291bnQpKSk7CiAgICAgIGlmIChhbGxvY2F0ZWRWZXJ0ZXhDb3VudCA8IHRhcmdldEFsbG9jYXRlZFZlcnRleENvdW50KSB7CiAgICAgICAgICBpZiAoYWxsb2NhdGVkVmVydGV4Q291bnQgPiAwKSB7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZSh2aWV3UHJvalB0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZSh0cmFuc2Zvcm1JbmRpY2VzUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHBvc2l0aW9uc1B0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShjaHVua3NQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoZGVwdGhCdWZmZXJQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoZGVwdGhJbmRleFB0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShzdGFydHNQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoY291bnRzUHRyKTsKICAgICAgICAgIH0KICAgICAgICAgIGFsbG9jYXRlZFZlcnRleENvdW50ID0gdGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQ7CiAgICAgICAgICB2aWV3UHJvalB0ciA9IHdhc21Nb2R1bGUuX21hbGxvYygxNiAqIDQpOwogICAgICAgICAgdHJhbnNmb3JtSW5kaWNlc1B0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyhhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICAgICAgcG9zaXRpb25zUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKDMgKiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICAgICAgY2h1bmtzUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFZlcnRleENvdW50KTsKICAgICAgICAgIGRlcHRoQnVmZmVyUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBkZXB0aEluZGV4UHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBzdGFydHNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoYWxsb2NhdGVkVmVydGV4Q291bnQgKiA0KTsKICAgICAgICAgIGNvdW50c1B0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyhhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICB9CiAgICAgIGlmIChhbGxvY2F0ZWRUcmFuc2Zvcm1Db3VudCA8IHNvcnREYXRhLnRyYW5zZm9ybXMubGVuZ3RoKSB7CiAgICAgICAgICBpZiAoYWxsb2NhdGVkVHJhbnNmb3JtQ291bnQgPiAwKSB7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZSh0cmFuc2Zvcm1zUHRyKTsKICAgICAgICAgIH0KICAgICAgICAgIGFsbG9jYXRlZFRyYW5zZm9ybUNvdW50ID0gc29ydERhdGEudHJhbnNmb3Jtcy5sZW5ndGg7CiAgICAgICAgICB0cmFuc2Zvcm1zUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKGFsbG9jYXRlZFRyYW5zZm9ybUNvdW50ICogNCk7CiAgICAgIH0KICAgICAgbG9jayA9IGZhbHNlOwogICAgICBpZiAoYWxsb2NhdGlvblBlbmRpbmcpIHsKICAgICAgICAgIGFsbG9jYXRpb25QZW5kaW5nID0gZmFsc2U7CiAgICAgICAgICBhd2FpdCBhbGxvY2F0ZUJ1ZmZlcnMoKTsKICAgICAgfQogIH07CiAgY29uc3QgcnVuU29ydCA9ICgpID0+IHsKICAgICAgaWYgKGxvY2sgfHwgYWxsb2NhdGlvblBlbmRpbmcgfHwgIXdhc21Nb2R1bGUpCiAgICAgICAgICByZXR1cm47CiAgICAgIGxvY2sgPSB0cnVlOwogICAgICB3YXNtTW9kdWxlLkhFQVBGMzIuc2V0KHNvcnREYXRhLnBvc2l0aW9ucywgcG9zaXRpb25zUHRyIC8gNCk7CiAgICAgIHdhc21Nb2R1bGUuSEVBUEYzMi5zZXQoc29ydERhdGEudHJhbnNmb3JtcywgdHJhbnNmb3Jtc1B0ciAvIDQpOwogICAgICB3YXNtTW9kdWxlLkhFQVBVMzIuc2V0KHNvcnREYXRhLnRyYW5zZm9ybUluZGljZXMsIHRyYW5zZm9ybUluZGljZXNQdHIgLyA0KTsKICAgICAgd2FzbU1vZHVsZS5IRUFQRjMyLnNldCh2aWV3UHJvaiwgdmlld1Byb2pQdHIgLyA0KTsKICAgICAgd2FzbU1vZHVsZS5fc29ydCh2aWV3UHJvalB0ciwgdHJhbnNmb3Jtc1B0ciwgdHJhbnNmb3JtSW5kaWNlc1B0ciwgc29ydERhdGEudmVydGV4Q291bnQsIHBvc2l0aW9uc1B0ciwgY2h1bmtzUHRyLCBkZXB0aEJ1ZmZlclB0ciwgZGVwdGhJbmRleFB0ciwgc3RhcnRzUHRyLCBjb3VudHNQdHIpOwogICAgICBjb25zdCBkZXB0aEluZGV4ID0gbmV3IFVpbnQzMkFycmF5KHdhc21Nb2R1bGUuSEVBUFUzMi5idWZmZXIsIGRlcHRoSW5kZXhQdHIsIHNvcnREYXRhLnZlcnRleENvdW50KTsKICAgICAgY29uc3QgZGV0YWNoZWREZXB0aEluZGV4ID0gbmV3IFVpbnQzMkFycmF5KGRlcHRoSW5kZXguc2xpY2UoKS5idWZmZXIpOwogICAgICBjb25zdCBjaHVua3MgPSBuZXcgVWludDhBcnJheSh3YXNtTW9kdWxlLkhFQVBVOC5idWZmZXIsIGNodW5rc1B0ciwgc29ydERhdGEudmVydGV4Q291bnQpOwogICAgICBjb25zdCBkZXRhY2hlZENodW5rcyA9IG5ldyBVaW50OEFycmF5KGNodW5rcy5zbGljZSgpLmJ1ZmZlcik7CiAgICAgIHNlbGYucG9zdE1lc3NhZ2UoeyBkZXB0aEluZGV4OiBkZXRhY2hlZERlcHRoSW5kZXgsIGNodW5rczogZGV0YWNoZWRDaHVua3MgfSwgWwogICAgICAgICAgZGV0YWNoZWREZXB0aEluZGV4LmJ1ZmZlciwKICAgICAgICAgIGRldGFjaGVkQ2h1bmtzLmJ1ZmZlciwKICAgICAgXSk7CiAgICAgIGxvY2sgPSBmYWxzZTsKICB9OwogIGNvbnN0IHRocm90dGxlZFNvcnQgPSAoKSA9PiB7CiAgICAgIGlmICghc29ydGluZykgewogICAgICAgICAgc29ydGluZyA9IHRydWU7CiAgICAgICAgICBydW5Tb3J0KCk7CiAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHsKICAgICAgICAgICAgICBzb3J0aW5nID0gZmFsc2U7CiAgICAgICAgICAgICAgdGhyb3R0bGVkU29ydCgpOwogICAgICAgICAgfSk7CiAgICAgIH0KICB9OwogIHNlbGYub25tZXNzYWdlID0gKGUpID0+IHsKICAgICAgaWYgKGUuZGF0YS5zb3J0RGF0YSkgewogICAgICAgICAgc29ydERhdGEgPSB7CiAgICAgICAgICAgICAgcG9zaXRpb25zOiBGbG9hdDMyQXJyYXkuZnJvbShlLmRhdGEuc29ydERhdGEucG9zaXRpb25zKSwKICAgICAgICAgICAgICB0cmFuc2Zvcm1zOiBGbG9hdDMyQXJyYXkuZnJvbShlLmRhdGEuc29ydERhdGEudHJhbnNmb3JtcyksCiAgICAgICAgICAgICAgdHJhbnNmb3JtSW5kaWNlczogVWludDMyQXJyYXkuZnJvbShlLmRhdGEuc29ydERhdGEudHJhbnNmb3JtSW5kaWNlcyksCiAgICAgICAgICAgICAgdmVydGV4Q291bnQ6IGUuZGF0YS5zb3J0RGF0YS52ZXJ0ZXhDb3VudCwKICAgICAgICAgIH07CiAgICAgICAgICBhbGxvY2F0ZUJ1ZmZlcnMoKTsKICAgICAgfQogICAgICBpZiAoZS5kYXRhLnZpZXdQcm9qKSB7CiAgICAgICAgICB2aWV3UHJvaiA9IEZsb2F0MzJBcnJheS5mcm9tKGUuZGF0YS52aWV3UHJvaik7CiAgICAgICAgICB0aHJvdHRsZWRTb3J0KCk7CiAgICAgIH0KICB9OwoKfSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9U29ydFdvcmtlci5qcy5tYXAKCg==\", null, !1);\nclass QF {\n  constructor(U, l) {\n    this._scene = null, this._camera = null, this._started = !1, this._initialized = !1, this._renderer = U;\n    const F = U.gl;\n    this._program = F.createProgram(), this._passes = l || [];\n    const Q = F.createShader(F.VERTEX_SHADER);\n    F.shaderSource(Q, this._getVertexSource()), F.compileShader(Q), F.getShaderParameter(Q, F.COMPILE_STATUS) || console.error(F.getShaderInfoLog(Q));\n    const Z = F.createShader(F.FRAGMENT_SHADER);\n    F.shaderSource(Z, this._getFragmentSource()), F.compileShader(Z), F.getShaderParameter(Z, F.COMPILE_STATUS) || console.error(F.getShaderInfoLog(Z)), F.attachShader(this.program, Q), F.attachShader(this.program, Z), F.linkProgram(this.program), F.getProgramParameter(this.program, F.LINK_STATUS) || console.error(F.getProgramInfoLog(this.program)), this.resize = () => {\n      F.useProgram(this._program), this._resize();\n    }, this.initialize = () => {\n      console.assert(!this._initialized, \"ShaderProgram already initialized\"), F.useProgram(this._program), this._initialize();\n      for (const d of this.passes)\n        d.initialize(this);\n      this._initialized = !0, this._started = !0;\n    }, this.render = (d, V) => {\n      F.useProgram(this._program), this._scene === d && this._camera === V || (this.dispose(), this._scene = d, this._camera = V, this.initialize());\n      for (const B of this.passes)\n        B.render();\n      this._render();\n    }, this.dispose = () => {\n      if (this._initialized) {\n        F.useProgram(this._program);\n        for (const d of this.passes)\n          d.dispose();\n        this._dispose(), this._scene = null, this._camera = null, this._initialized = !1;\n      }\n    };\n  }\n  get renderer() {\n    return this._renderer;\n  }\n  get scene() {\n    return this._scene;\n  }\n  get camera() {\n    return this._camera;\n  }\n  get program() {\n    return this._program;\n  }\n  get passes() {\n    return this._passes;\n  }\n  get started() {\n    return this._started;\n  }\n}\nvar tF = EU(\"Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICd1c2Ugc3RyaWN0JzsKCiAgdmFyIGxvYWRXYXNtID0gKCgpID0+IHsKICAgIAogICAgcmV0dXJuICgKICBmdW5jdGlvbihtb2R1bGVBcmcgPSB7fSkgewoKICB2YXIgTW9kdWxlPW1vZHVsZUFyZzt2YXIgcmVhZHlQcm9taXNlUmVzb2x2ZSxyZWFkeVByb21pc2VSZWplY3Q7TW9kdWxlWyJyZWFkeSJdPW5ldyBQcm9taXNlKChyZXNvbHZlLHJlamVjdCk9PntyZWFkeVByb21pc2VSZXNvbHZlPXJlc29sdmU7cmVhZHlQcm9taXNlUmVqZWN0PXJlamVjdDt9KTt2YXIgbW9kdWxlT3ZlcnJpZGVzPU9iamVjdC5hc3NpZ24oe30sTW9kdWxlKTt2YXIgc2NyaXB0RGlyZWN0b3J5PSIiO2Z1bmN0aW9uIGxvY2F0ZUZpbGUocGF0aCl7aWYoTW9kdWxlWyJsb2NhdGVGaWxlIl0pe3JldHVybiBNb2R1bGVbImxvY2F0ZUZpbGUiXShwYXRoLHNjcmlwdERpcmVjdG9yeSl9cmV0dXJuIHNjcmlwdERpcmVjdG9yeStwYXRofXZhciByZWFkQmluYXJ5O3t7c2NyaXB0RGlyZWN0b3J5PXNlbGYubG9jYXRpb24uaHJlZjt9aWYoc2NyaXB0RGlyZWN0b3J5LnN0YXJ0c1dpdGgoImJsb2I6Iikpe3NjcmlwdERpcmVjdG9yeT0iIjt9ZWxzZSB7c2NyaXB0RGlyZWN0b3J5PXNjcmlwdERpcmVjdG9yeS5zdWJzdHIoMCxzY3JpcHREaXJlY3RvcnkucmVwbGFjZSgvWz8jXS4qLywiIikubGFzdEluZGV4T2YoIi8iKSsxKTt9e3tyZWFkQmluYXJ5PXVybD0+e3ZhciB4aHI9bmV3IFhNTEh0dHBSZXF1ZXN0O3hoci5vcGVuKCJHRVQiLHVybCxmYWxzZSk7eGhyLnJlc3BvbnNlVHlwZT0iYXJyYXlidWZmZXIiO3hoci5zZW5kKG51bGwpO3JldHVybiBuZXcgVWludDhBcnJheSh4aHIucmVzcG9uc2UpfTt9fX1Nb2R1bGVbInByaW50Il18fGNvbnNvbGUubG9nLmJpbmQoY29uc29sZSk7dmFyIGVycj1Nb2R1bGVbInByaW50RXJyIl18fGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTtPYmplY3QuYXNzaWduKE1vZHVsZSxtb2R1bGVPdmVycmlkZXMpO21vZHVsZU92ZXJyaWRlcz1udWxsO2lmKE1vZHVsZVsiYXJndW1lbnRzIl0pTW9kdWxlWyJhcmd1bWVudHMiXTtpZihNb2R1bGVbInRoaXNQcm9ncmFtIl0pTW9kdWxlWyJ0aGlzUHJvZ3JhbSJdO2lmKE1vZHVsZVsicXVpdCJdKU1vZHVsZVsicXVpdCJdO3ZhciB3YXNtQmluYXJ5O2lmKE1vZHVsZVsid2FzbUJpbmFyeSJdKXdhc21CaW5hcnk9TW9kdWxlWyJ3YXNtQmluYXJ5Il07aWYodHlwZW9mIFdlYkFzc2VtYmx5IT0ib2JqZWN0Iil7YWJvcnQoIm5vIG5hdGl2ZSB3YXNtIHN1cHBvcnQgZGV0ZWN0ZWQiKTt9ZnVuY3Rpb24gaW50QXJyYXlGcm9tQmFzZTY0KHMpe3ZhciBkZWNvZGVkPWF0b2Iocyk7dmFyIGJ5dGVzPW5ldyBVaW50OEFycmF5KGRlY29kZWQubGVuZ3RoKTtmb3IodmFyIGk9MDtpPGRlY29kZWQubGVuZ3RoOysraSl7Ynl0ZXNbaV09ZGVjb2RlZC5jaGFyQ29kZUF0KGkpO31yZXR1cm4gYnl0ZXN9ZnVuY3Rpb24gdHJ5UGFyc2VBc0RhdGFVUkkoZmlsZW5hbWUpe2lmKCFpc0RhdGFVUkkoZmlsZW5hbWUpKXtyZXR1cm59cmV0dXJuIGludEFycmF5RnJvbUJhc2U2NChmaWxlbmFtZS5zbGljZShkYXRhVVJJUHJlZml4Lmxlbmd0aCkpfXZhciB3YXNtTWVtb3J5O3ZhciBBQk9SVD1mYWxzZTt2YXIgSEVBUDgsSEVBUFU4LEhFQVAxNixIRUFQVTE2LEhFQVAzMixIRUFQVTMyLEhFQVBGMzIsSEVBUEY2NDtmdW5jdGlvbiB1cGRhdGVNZW1vcnlWaWV3cygpe3ZhciBiPXdhc21NZW1vcnkuYnVmZmVyO01vZHVsZVsiSEVBUDgiXT1IRUFQOD1uZXcgSW50OEFycmF5KGIpO01vZHVsZVsiSEVBUDE2Il09SEVBUDE2PW5ldyBJbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUFU4Il09SEVBUFU4PW5ldyBVaW50OEFycmF5KGIpO01vZHVsZVsiSEVBUFUxNiJdPUhFQVBVMTY9bmV3IFVpbnQxNkFycmF5KGIpO01vZHVsZVsiSEVBUDMyIl09SEVBUDMyPW5ldyBJbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUFUzMiJdPUhFQVBVMzI9bmV3IFVpbnQzMkFycmF5KGIpO01vZHVsZVsiSEVBUEYzMiJdPUhFQVBGMzI9bmV3IEZsb2F0MzJBcnJheShiKTtNb2R1bGVbIkhFQVBGNjQiXT1IRUFQRjY0PW5ldyBGbG9hdDY0QXJyYXkoYik7fXZhciBfX0FUUFJFUlVOX189W107dmFyIF9fQVRJTklUX189W107dmFyIF9fQVRQT1NUUlVOX189W107ZnVuY3Rpb24gcHJlUnVuKCl7aWYoTW9kdWxlWyJwcmVSdW4iXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlUnVuIl09PSJmdW5jdGlvbiIpTW9kdWxlWyJwcmVSdW4iXT1bTW9kdWxlWyJwcmVSdW4iXV07d2hpbGUoTW9kdWxlWyJwcmVSdW4iXS5sZW5ndGgpe2FkZE9uUHJlUnVuKE1vZHVsZVsicHJlUnVuIl0uc2hpZnQoKSk7fX1jYWxsUnVudGltZUNhbGxiYWNrcyhfX0FUUFJFUlVOX18pO31mdW5jdGlvbiBpbml0UnVudGltZSgpe2NhbGxSdW50aW1lQ2FsbGJhY2tzKF9fQVRJTklUX18pO31mdW5jdGlvbiBwb3N0UnVuKCl7aWYoTW9kdWxlWyJwb3N0UnVuIl0pe2lmKHR5cGVvZiBNb2R1bGVbInBvc3RSdW4iXT09ImZ1bmN0aW9uIilNb2R1bGVbInBvc3RSdW4iXT1bTW9kdWxlWyJwb3N0UnVuIl1dO3doaWxlKE1vZHVsZVsicG9zdFJ1biJdLmxlbmd0aCl7YWRkT25Qb3N0UnVuKE1vZHVsZVsicG9zdFJ1biJdLnNoaWZ0KCkpO319Y2FsbFJ1bnRpbWVDYWxsYmFja3MoX19BVFBPU1RSVU5fXyk7fWZ1bmN0aW9uIGFkZE9uUHJlUnVuKGNiKXtfX0FUUFJFUlVOX18udW5zaGlmdChjYik7fWZ1bmN0aW9uIGFkZE9uSW5pdChjYil7X19BVElOSVRfXy51bnNoaWZ0KGNiKTt9ZnVuY3Rpb24gYWRkT25Qb3N0UnVuKGNiKXtfX0FUUE9TVFJVTl9fLnVuc2hpZnQoY2IpO312YXIgcnVuRGVwZW5kZW5jaWVzPTA7dmFyIGRlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2Z1bmN0aW9uIGFkZFJ1bkRlcGVuZGVuY3koaWQpe3J1bkRlcGVuZGVuY2llcysrO01vZHVsZVsibW9uaXRvclJ1bkRlcGVuZGVuY2llcyJdPy4ocnVuRGVwZW5kZW5jaWVzKTt9ZnVuY3Rpb24gcmVtb3ZlUnVuRGVwZW5kZW5jeShpZCl7cnVuRGVwZW5kZW5jaWVzLS07TW9kdWxlWyJtb25pdG9yUnVuRGVwZW5kZW5jaWVzIl0/LihydW5EZXBlbmRlbmNpZXMpO2lmKHJ1bkRlcGVuZGVuY2llcz09MCl7aWYoZGVwZW5kZW5jaWVzRnVsZmlsbGVkKXt2YXIgY2FsbGJhY2s9ZGVwZW5kZW5jaWVzRnVsZmlsbGVkO2RlcGVuZGVuY2llc0Z1bGZpbGxlZD1udWxsO2NhbGxiYWNrKCk7fX19ZnVuY3Rpb24gYWJvcnQod2hhdCl7TW9kdWxlWyJvbkFib3J0Il0/Lih3aGF0KTt3aGF0PSJBYm9ydGVkKCIrd2hhdCsiKSI7ZXJyKHdoYXQpO0FCT1JUPXRydWU7d2hhdCs9Ii4gQnVpbGQgd2l0aCAtc0FTU0VSVElPTlMgZm9yIG1vcmUgaW5mby4iO3ZhciBlPW5ldyBXZWJBc3NlbWJseS5SdW50aW1lRXJyb3Iod2hhdCk7cmVhZHlQcm9taXNlUmVqZWN0KGUpO3Rocm93IGV9dmFyIGRhdGFVUklQcmVmaXg9ImRhdGE6YXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtO2Jhc2U2NCwiO3ZhciBpc0RhdGFVUkk9ZmlsZW5hbWU9PmZpbGVuYW1lLnN0YXJ0c1dpdGgoZGF0YVVSSVByZWZpeCk7dmFyIHdhc21CaW5hcnlGaWxlO3dhc21CaW5hcnlGaWxlPSJkYXRhOmFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbTtiYXNlNjQsQUdGemJRRUFBQUFCWnc5Z0JIOS9mMzhBWUFOL2YzOEFZQVYvZjM5L2Z3QmdCbjkvZjM5L2Z3QmdBWDhCZjJBQmZ3QmdBbjkvQUdBRGYzOS9BWDlnQUFCZ0IzOS9mMzkvZjM4QVlBSjlmUUYvWUFSL2YzNStBR0FCZlFGL1lBdC9mMzkvZjM5L2YzOS9md0JnQW45L0FYOENQUW9CWVFGaEFBRUJZUUZpQUFJQllRRmpBQUVCWVFGa0FBWUJZUUZsQUFFQllRRm1BQWtCWVFGbkFBUUJZUUZvQUFVQllRRnBBQUFCWVFGcUFBWURHeG9IQkFvRkNBVUdDQXNCQUFFRkRBUUVEUU1EQWdJQUFBNEhCd1FGQVhBQkVCQUZCd0VCZ0FLQWdBSUdDQUYvQVVHd25nUUxCeGtHQVdzQ0FBRnNBQTRCYlFBYUFXNEJBQUZ2QUJrQmNBQVBDUlVCQUVFQkN3OFJHQTBXRmlNTkloc2RJQTBjSGg4SzZWQWFjUUVCZnlBQ1JRUkFJQUFvQWdRZ0FTZ0NCRVlQQ3lBQUlBRkdCRUJCQVE4TEFrQWdBQ2dDQkNJQ0xRQUFJZ0JGSUFBZ0FTZ0NCQ0lCTFFBQUlnTkhjZzBBQTBBZ0FTMEFBU0VESUFJdEFBRWlBRVVOQVNBQlFRRnFJUUVnQWtFQmFpRUNJQUFnQTBZTkFBc0xJQUFnQTBZTFR3RUNmMEdvR2lnQ0FDSUJJQUJCQjJwQmVIRWlBbW9oQUFKQUlBSkJBQ0FBSUFGTkcwVUVRQ0FBUHdCQkVIUk5EUUVnQUJBR0RRRUxRYmdhUVRBMkFnQkJmdzhMUWFnYUlBQTJBZ0FnQVFzT0FDQUFFQmNnQVJBWFFSQjBjZ3NHQUNBQUVBOExLUUJCc0JwQkFUWUNBRUcwR2tFQU5nSUFFQkZCdEJwQnJCb29BZ0EyQWdCQnJCcEJzQm8yQWdBTDJRc0JCMzhDUUNBQVJRMEFJQUJCQ0dzaUF5QUFRUVJyS0FJQUlnRkJlSEVpQUdvaEJRSkFJQUZCQVhFTkFDQUJRUUp4UlEwQklBTWdBeWdDQUNJQmF5SURRY3dhS0FJQVNRMEJJQUFnQVdvaEFBSkFBa0JCMEJvb0FnQWdBMGNFUUNBREtBSU1JUUlnQVVIL0FVMEVRQ0FCUVFOMklRRWdBeWdDQ0NJRUlBSkdCRUJCdkJwQnZCb29BZ0JCZmlBQmQzRTJBZ0FNQlFzZ0JDQUNOZ0lNSUFJZ0JEWUNDQXdFQ3lBREtBSVlJUVlnQWlBRFJ3UkFJQU1vQWdnaUFTQUNOZ0lNSUFJZ0FUWUNDQXdEQ3lBREtBSVVJZ0VFZnlBRFFSUnFCU0FES0FJUUlnRkZEUUlnQTBFUWFnc2hCQU5BSUFRaEJ5QUJJZ0pCRkdvaEJDQUNLQUlVSWdFTkFDQUNRUkJxSVFRZ0FpZ0NFQ0lCRFFBTElBZEJBRFlDQUF3Q0N5QUZLQUlFSWdGQkEzRkJBMGNOQWtIRUdpQUFOZ0lBSUFVZ0FVRitjVFlDQkNBRElBQkJBWEkyQWdRZ0JTQUFOZ0lBRHd0QkFDRUNDeUFHUlEwQUFrQWdBeWdDSENJQlFRSjBRZXdjYWlJRUtBSUFJQU5HQkVBZ0JDQUNOZ0lBSUFJTkFVSEFHa0hBR2lnQ0FFRitJQUYzY1RZQ0FBd0NDeUFHUVJCQkZDQUdLQUlRSUFOR0cyb2dBallDQUNBQ1JRMEJDeUFDSUFZMkFoZ2dBeWdDRUNJQkJFQWdBaUFCTmdJUUlBRWdBallDR0FzZ0F5Z0NGQ0lCUlEwQUlBSWdBVFlDRkNBQklBSTJBaGdMSUFNZ0JVOE5BQ0FGS0FJRUlnRkJBWEZGRFFBQ1FBSkFBa0FDUUNBQlFRSnhSUVJBUWRRYUtBSUFJQVZHQkVCQjFCb2dBellDQUVISUdrSElHaWdDQUNBQWFpSUFOZ0lBSUFNZ0FFRUJjallDQkNBRFFkQWFLQUlBUncwR1FjUWFRUUEyQWdCQjBCcEJBRFlDQUE4TFFkQWFLQUlBSUFWR0JFQkIwQm9nQXpZQ0FFSEVHa0hFR2lnQ0FDQUFhaUlBTmdJQUlBTWdBRUVCY2pZQ0JDQUFJQU5xSUFBMkFnQVBDeUFCUVhoeElBQnFJUUFnQlNnQ0RDRUNJQUZCL3dGTkJFQWdBVUVEZGlFQklBVW9BZ2dpQkNBQ1JnUkFRYndhUWJ3YUtBSUFRWDRnQVhkeE5nSUFEQVVMSUFRZ0FqWUNEQ0FDSUFRMkFnZ01CQXNnQlNnQ0dDRUdJQUlnQlVjRVFFSE1HaWdDQUJvZ0JTZ0NDQ0lCSUFJMkFnd2dBaUFCTmdJSURBTUxJQVVvQWhRaUFRUi9JQVZCRkdvRklBVW9BaEFpQVVVTkFpQUZRUkJxQ3lFRUEwQWdCQ0VISUFFaUFrRVVhaUVFSUFJb0FoUWlBUTBBSUFKQkVHb2hCQ0FDS0FJUUlnRU5BQXNnQjBFQU5nSUFEQUlMSUFVZ0FVRitjVFlDQkNBRElBQkJBWEkyQWdRZ0FDQURhaUFBTmdJQURBTUxRUUFoQWdzZ0JrVU5BQUpBSUFVb0Fod2lBVUVDZEVIc0hHb2lCQ2dDQUNBRlJnUkFJQVFnQWpZQ0FDQUNEUUZCd0JwQndCb29BZ0JCZmlBQmQzRTJBZ0FNQWdzZ0JrRVFRUlFnQmlnQ0VDQUZSaHRxSUFJMkFnQWdBa1VOQVFzZ0FpQUdOZ0lZSUFVb0FoQWlBUVJBSUFJZ0FUWUNFQ0FCSUFJMkFoZ0xJQVVvQWhRaUFVVU5BQ0FDSUFFMkFoUWdBU0FDTmdJWUN5QURJQUJCQVhJMkFnUWdBQ0FEYWlBQU5nSUFJQU5CMEJvb0FnQkhEUUJCeEJvZ0FEWUNBQThMSUFCQi93Rk5CRUFnQUVGNGNVSGtHbW9oQVFKL1Fid2FLQUlBSWdSQkFTQUFRUU4yZENJQWNVVUVRRUc4R2lBQUlBUnlOZ0lBSUFFTUFRc2dBU2dDQ0FzaEFDQUJJQU0yQWdnZ0FDQUROZ0lNSUFNZ0FUWUNEQ0FESUFBMkFnZ1BDMEVmSVFJZ0FFSC8vLzhIVFFSQUlBQkJKaUFBUVFoMlp5SUJhM1pCQVhFZ0FVRUJkR3RCUG1vaEFnc2dBeUFDTmdJY0lBTkNBRGNDRUNBQ1FRSjBRZXdjYWlFSEFuOENRQUovUWNBYUtBSUFJZ0ZCQVNBQ2RDSUVjVVVFUUVIQUdpQUJJQVJ5TmdJQVFSZ2hBaUFISVFSQkNBd0JDeUFBUVJrZ0FrRUJkbXRCQUNBQ1FSOUhHM1FoQWlBSEtBSUFJUVFEUUNBRUlnRW9BZ1JCZUhFZ0FFWU5BaUFDUVIxMklRUWdBa0VCZENFQ0lBRWdCRUVFY1dwQkVHb2lCeWdDQUNJRURRQUxRUmdoQWlBQklRUkJDQXNoQUNBRElnRU1BUXNnQVNnQ0NDSUVJQU0yQWd4QkNDRUNJQUZCQ0dvaEIwRVlJUUJCQUFzaEJTQUhJQU0yQWdBZ0FpQURhaUFFTmdJQUlBTWdBVFlDRENBQUlBTnFJQVUyQWdCQjNCcEIzQm9vQWdCQkFXc2lBRUYvSUFBYk5nSUFDd3NoQUNBQkJFQURRQ0FBUVFBNkFBQWdBRUVCYWlFQUlBRkJBV3NpQVEwQUN3c0wzZ01BUWR3WFFZb0pFQWxCNkJkQnVRaEJBVUVBRUFoQjlCZEJ0QWhCQVVHQWYwSC9BQkFCUVl3WVFhMElRUUZCZ0g5Qi93QVFBVUdBR0VHckNFRUJRUUJCL3dFUUFVR1lHRUdKQ0VFQ1FZQ0Fma0gvL3dFUUFVR2tHRUdBQ0VFQ1FRQkIvLzhERUFGQnNCaEJtQWhCQkVHQWdJQ0FlRUgvLy8vL0J4QUJRYndZUVk4SVFRUkJBRUYvRUFGQnlCaEJ4d2hCQkVHQWdJQ0FlRUgvLy8vL0J4QUJRZFFZUWI0SVFRUkJBRUYvRUFGQjRCaEJvd2hDZ0lDQWdJQ0FnSUNBZjBMLy8vLy8vLy8vLy84QUVCSkI3QmhCb2doQ0FFSi9FQkpCK0JoQm5BaEJCQkFFUVlRWlFZTUpRUWdRQkVIMERrSFpDQkFEUWJ3UFFZY05FQU5CaEJCQkJFSE1DQkFDUWRBUVFRSkI1UWdRQWtHY0VVRUVRZlFJRUFKQnVCRVFCMEhnRVVFQVFjSU1FQUJCaUJKQkFFR29EUkFBUWJBU1FRRkI0QXdRQUVIWUVrRUNRWThKRUFCQmdCTkJBMEd1Q1JBQVFhZ1RRUVJCMWdrUUFFSFFFMEVGUWZNSkVBQkIrQk5CQkVITkRSQUFRYUFVUVFWQjZ3MFFBRUdJRWtFQVFka0tFQUJCc0JKQkFVRzRDaEFBUWRnU1FRSkJtd3NRQUVHQUUwRURRZmtLRUFCQnFCTkJCRUdoREJBQVFkQVRRUVZCL3dzUUFFSElGRUVJUWQ0TEVBQkI4QlJCQ1VHOEN4QUFRWmdWUVFaQm1Rb1FBRUhBRlVFSFFaSU9FQUFMSEFBZ0FDQUJRUWdnQXFjZ0FrSWdpS2NnQTZjZ0EwSWdpS2NRQlFzZ0FBSkFJQUFvQWdRZ0FVY05BQ0FBS0FJY1FRRkdEUUFnQUNBQ05nSWNDd3VhQVFBZ0FFRUJPZ0ExQWtBZ0FDZ0NCQ0FDUncwQUlBQkJBVG9BTkFKQUlBQW9BaEFpQWtVRVFDQUFRUUUyQWlRZ0FDQUROZ0lZSUFBZ0FUWUNFQ0FEUVFGSERRSWdBQ2dDTUVFQlJnMEJEQUlMSUFFZ0FrWUVRQ0FBS0FJWUlnSkJBa1lFUUNBQUlBTTJBaGdnQXlFQ0N5QUFLQUl3UVFGSERRSWdBa0VCUmcwQkRBSUxJQUFnQUNnQ0pFRUJhallDSkFzZ0FFRUJPZ0EyQ3d0ZEFRRi9JQUFvQWhBaUEwVUVRQ0FBUVFFMkFpUWdBQ0FDTmdJWUlBQWdBVFlDRUE4TEFrQWdBU0FEUmdSQUlBQW9BaGhCQWtjTkFTQUFJQUkyQWhnUEN5QUFRUUU2QURZZ0FFRUNOZ0lZSUFBZ0FDZ0NKRUVCYWpZQ0pBc0xBZ0FMZHdFRWZ5QUF2Q0lFUWYvLy93TnhJUUVDUUNBRVFSZDJRZjhCY1NJQ1JRMEFJQUpCOEFCTkJFQWdBVUdBZ0lBRWNrSHhBQ0FDYTNZaEFRd0JDeUFDUVkwQlN3UkFRWUQ0QVNFRFFRQWhBUXdCQ3lBQ1FRcDBRWUNBQjJzaEF3c2dBeUFFUVJCMlFZQ0FBbkZ5SUFGQkRYWnlRZi8vQTNFTEJBQWdBQXZYSndFTWZ5TUFRUkJySWdva0FBSkFBa0FDUUFKQUFrQUNRQUpBQWtBQ1FBSkFJQUJCOUFGTkJFQkJ2Qm9vQWdBaUJFRVFJQUJCQzJwQitBTnhJQUJCQzBrYklnWkJBM1lpQUhZaUFVRURjUVJBQWtBZ0FVRi9jMEVCY1NBQWFpSUNRUU4wSWdGQjVCcHFJZ0FnQVVIc0dtb29BZ0FpQVNnQ0NDSUZSZ1JBUWJ3YUlBUkJmaUFDZDNFMkFnQU1BUXNnQlNBQU5nSU1JQUFnQlRZQ0NBc2dBVUVJYWlFQUlBRWdBa0VEZENJQ1FRTnlOZ0lFSUFFZ0Ftb2lBU0FCS0FJRVFRRnlOZ0lFREFzTElBWkJ4Qm9vQWdBaUNFME5BU0FCQkVBQ1FFRUNJQUIwSWdKQkFDQUNhM0lnQVNBQWRIRm9JZ0ZCQTNRaUFFSGtHbW9pQWlBQVFld2FhaWdDQUNJQUtBSUlJZ1ZHQkVCQnZCb2dCRUYrSUFGM2NTSUVOZ0lBREFFTElBVWdBallDRENBQ0lBVTJBZ2dMSUFBZ0JrRURjallDQkNBQUlBWnFJZ2NnQVVFRGRDSUJJQVpySWdWQkFYSTJBZ1FnQUNBQmFpQUZOZ0lBSUFnRVFDQUlRWGh4UWVRYWFpRUJRZEFhS0FJQUlRSUNmeUFFUVFFZ0NFRURkblFpQTNGRkJFQkJ2Qm9nQXlBRWNqWUNBQ0FCREFFTElBRW9BZ2dMSVFNZ0FTQUNOZ0lJSUFNZ0FqWUNEQ0FDSUFFMkFnd2dBaUFETmdJSUN5QUFRUWhxSVFCQjBCb2dCellDQUVIRUdpQUZOZ0lBREFzTFFjQWFLQUlBSWd0RkRRRWdDMmhCQW5SQjdCeHFLQUlBSWdJb0FnUkJlSEVnQm1zaEF5QUNJUUVEUUFKQUlBRW9BaEFpQUVVRVFDQUJLQUlVSWdCRkRRRUxJQUFvQWdSQmVIRWdCbXNpQVNBRElBRWdBMGtpQVJzaEF5QUFJQUlnQVJzaEFpQUFJUUVNQVFzTElBSW9BaGdoQ1NBQ0lBSW9BZ3dpQUVjRVFFSE1HaWdDQUJvZ0FpZ0NDQ0lCSUFBMkFnd2dBQ0FCTmdJSURBb0xJQUlvQWhRaUFRUi9JQUpCRkdvRklBSW9BaEFpQVVVTkF5QUNRUkJxQ3lFRkEwQWdCU0VISUFFaUFFRVVhaUVGSUFBb0FoUWlBUTBBSUFCQkVHb2hCU0FBS0FJUUlnRU5BQXNnQjBFQU5nSUFEQWtMUVg4aEJpQUFRYjkvU3cwQUlBQkJDMm9pQUVGNGNTRUdRY0FhS0FJQUlnZEZEUUJCQUNBR2F5RURBa0FDUUFKQUFuOUJBQ0FHUVlBQ1NRMEFHa0VmSUFaQi8vLy9CMHNOQUJvZ0JrRW1JQUJCQ0habklnQnJka0VCY1NBQVFRRjBhMEUrYWdzaUNFRUNkRUhzSEdvb0FnQWlBVVVFUUVFQUlRQU1BUXRCQUNFQUlBWkJHU0FJUVFGMmEwRUFJQWhCSDBjYmRDRUNBMEFDUUNBQktBSUVRWGh4SUFacklnUWdBMDhOQUNBQklRVWdCQ0lERFFCQkFDRURJQUVoQUF3REN5QUFJQUVvQWhRaUJDQUVJQUVnQWtFZGRrRUVjV29vQWhBaUFVWWJJQUFnQkJzaEFDQUNRUUYwSVFJZ0FRMEFDd3NnQUNBRmNrVUVRRUVBSVFWQkFpQUlkQ0lBUVFBZ0FHdHlJQWR4SWdCRkRRTWdBR2hCQW5SQjdCeHFLQUlBSVFBTElBQkZEUUVMQTBBZ0FDZ0NCRUY0Y1NBR2F5SUNJQU5KSVFFZ0FpQURJQUViSVFNZ0FDQUZJQUViSVFVZ0FDZ0NFQ0lCQkg4Z0FRVWdBQ2dDRkFzaUFBMEFDd3NnQlVVTkFDQURRY1FhS0FJQUlBWnJUdzBBSUFVb0FoZ2hDQ0FGSUFVb0Fnd2lBRWNFUUVITUdpZ0NBQm9nQlNnQ0NDSUJJQUEyQWd3Z0FDQUJOZ0lJREFnTElBVW9BaFFpQVFSL0lBVkJGR29GSUFVb0FoQWlBVVVOQXlBRlFSQnFDeUVDQTBBZ0FpRUVJQUVpQUVFVWFpRUNJQUFvQWhRaUFRMEFJQUJCRUdvaEFpQUFLQUlRSWdFTkFBc2dCRUVBTmdJQURBY0xJQVpCeEJvb0FnQWlCVTBFUUVIUUdpZ0NBQ0VBQWtBZ0JTQUdheUlCUVJCUEJFQWdBQ0FHYWlJQ0lBRkJBWEkyQWdRZ0FDQUZhaUFCTmdJQUlBQWdCa0VEY2pZQ0JBd0JDeUFBSUFWQkEzSTJBZ1FnQUNBRmFpSUJJQUVvQWdSQkFYSTJBZ1JCQUNFQ1FRQWhBUXRCeEJvZ0FUWUNBRUhRR2lBQ05nSUFJQUJCQ0dvaEFBd0pDeUFHUWNnYUtBSUFJZ0pKQkVCQnlCb2dBaUFHYXlJQk5nSUFRZFFhUWRRYUtBSUFJZ0FnQm1vaUFqWUNBQ0FDSUFGQkFYSTJBZ1FnQUNBR1FRTnlOZ0lFSUFCQkNHb2hBQXdKQzBFQUlRQWdCa0V2YWlJREFuOUJsQjRvQWdBRVFFR2NIaWdDQUF3QkMwR2dIa0ovTndJQVFaZ2VRb0NnZ0lDQWdBUTNBZ0JCbEI0Z0NrRU1ha0Z3Y1VIWXF0V3FCWE0yQWdCQnFCNUJBRFlDQUVINEhVRUFOZ0lBUVlBZ0N5SUJhaUlFUVFBZ0FXc2lCM0VpQVNBR1RRMElRZlFkS0FJQUlnVUVRRUhzSFNnQ0FDSUlJQUZxSWdrZ0NFMGdCU0FKU1hJTkNRc0NRRUg0SFMwQUFFRUVjVVVFUUFKQUFrQUNRQUpBUWRRYUtBSUFJZ1VFUUVIOEhTRUFBMEFnQlNBQUtBSUFJZ2hQQkVBZ0NDQUFLQUlFYWlBRlN3MERDeUFBS0FJSUlnQU5BQXNMUVFBUUN5SUNRWDlHRFFNZ0FTRUVRWmdlS0FJQUlnQkJBV3NpQlNBQ2NRUkFJQUVnQW1zZ0FpQUZha0VBSUFCcmNXb2hCQXNnQkNBR1RRMERRZlFkS0FJQUlnQUVRRUhzSFNnQ0FDSUZJQVJxSWdjZ0JVMGdBQ0FIU1hJTkJBc2dCQkFMSWdBZ0FrY05BUXdGQ3lBRUlBSnJJQWR4SWdRUUN5SUNJQUFvQWdBZ0FDZ0NCR3BHRFFFZ0FpRUFDeUFBUVg5R0RRRWdCa0V3YWlBRVRRUkFJQUFoQWd3RUMwR2NIaWdDQUNJQ0lBTWdCR3RxUVFBZ0FtdHhJZ0lRQzBGL1JnMEJJQUlnQkdvaEJDQUFJUUlNQXdzZ0FrRi9SdzBDQzBINEhVSDRIU2dDQUVFRWNqWUNBQXNnQVJBTElnSkJmMFpCQUJBTElnQkJmMFp5SUFBZ0FrMXlEUVVnQUNBQ2F5SUVJQVpCS0dwTkRRVUxRZXdkUWV3ZEtBSUFJQVJxSWdBMkFnQkI4QjBvQWdBZ0FFa0VRRUh3SFNBQU5nSUFDd0pBUWRRYUtBSUFJZ01FUUVIOEhTRUFBMEFnQWlBQUtBSUFJZ0VnQUNnQ0JDSUZha1lOQWlBQUtBSUlJZ0FOQUFzTUJBdEJ6Qm9vQWdBaUFFRUFJQUFnQWswYlJRUkFRY3dhSUFJMkFnQUxRUUFoQUVHQUhpQUVOZ0lBUWZ3ZElBSTJBZ0JCM0JwQmZ6WUNBRUhnR2tHVUhpZ0NBRFlDQUVHSUhrRUFOZ0lBQTBBZ0FFRURkQ0lCUWV3YWFpQUJRZVFhYWlJRk5nSUFJQUZCOEJwcUlBVTJBZ0FnQUVFQmFpSUFRU0JIRFFBTFFjZ2FJQVJCS0dzaUFFRjRJQUpyUVFkeElnRnJJZ1UyQWdCQjFCb2dBU0FDYWlJQk5nSUFJQUVnQlVFQmNqWUNCQ0FBSUFKcVFTZzJBZ1JCMkJwQnBCNG9BZ0EyQWdBTUJBc2dBaUFEVFNBQklBTkxjZzBDSUFBb0FneEJDSEVOQWlBQUlBUWdCV28yQWdSQjFCb2dBMEY0SUFOclFRZHhJZ0JxSWdFMkFnQkJ5QnBCeUJvb0FnQWdCR29pQWlBQWF5SUFOZ0lBSUFFZ0FFRUJjallDQkNBQ0lBTnFRU2cyQWdSQjJCcEJwQjRvQWdBMkFnQU1Bd3RCQUNFQURBWUxRUUFoQUF3RUMwSE1HaWdDQUNBQ1N3UkFRY3dhSUFJMkFnQUxJQUlnQkdvaEFVSDhIU0VBQWtBRFFDQUJJQUFvQWdCSEJFQWdBQ2dDQ0NJQURRRU1BZ3NMSUFBdEFBeEJDSEZGRFFNTFFmd2RJUUFEUUFKQUlBTWdBQ2dDQUNJQlR3UkFJQUVnQUNnQ0JHb2lCU0FEU3cwQkN5QUFLQUlJSVFBTUFRc0xRY2dhSUFSQktHc2lBRUY0SUFKclFRZHhJZ0ZySWdjMkFnQkIxQm9nQVNBQ2FpSUJOZ0lBSUFFZ0IwRUJjallDQkNBQUlBSnFRU2cyQWdSQjJCcEJwQjRvQWdBMkFnQWdBeUFGUVNjZ0JXdEJCM0ZxUVM5cklnQWdBQ0FEUVJCcVNSc2lBVUViTmdJRUlBRkJoQjRwQWdBM0FoQWdBVUg4SFNrQ0FEY0NDRUdFSGlBQlFRaHFOZ0lBUVlBZUlBUTJBZ0JCL0IwZ0FqWUNBRUdJSGtFQU5nSUFJQUZCR0dvaEFBTkFJQUJCQnpZQ0JDQUFRUWhxSVF3Z0FFRUVhaUVBSUF3Z0JVa05BQXNnQVNBRFJnMEFJQUVnQVNnQ0JFRitjVFlDQkNBRElBRWdBMnNpQWtFQmNqWUNCQ0FCSUFJMkFnQUNmeUFDUWY4QlRRUkFJQUpCZUhGQjVCcHFJUUFDZjBHOEdpZ0NBQ0lCUVFFZ0FrRURkblFpQW5GRkJFQkJ2Qm9nQVNBQ2NqWUNBQ0FBREFFTElBQW9BZ2dMSVFFZ0FDQUROZ0lJSUFFZ0F6WUNERUVNSVFKQkNBd0JDMEVmSVFBZ0FrSC8vLzhIVFFSQUlBSkJKaUFDUVFoMlp5SUFhM1pCQVhFZ0FFRUJkR3RCUG1vaEFBc2dBeUFBTmdJY0lBTkNBRGNDRUNBQVFRSjBRZXdjYWlFQkFrQUNRRUhBR2lnQ0FDSUZRUUVnQUhRaUJIRkZCRUJCd0JvZ0JDQUZjallDQUNBQklBTTJBZ0FNQVFzZ0FrRVpJQUJCQVhaclFRQWdBRUVmUnh0MElRQWdBU2dDQUNFRkEwQWdCU0lCS0FJRVFYaHhJQUpHRFFJZ0FFRWRkaUVGSUFCQkFYUWhBQ0FCSUFWQkJIRnFJZ1FvQWhBaUJRMEFDeUFFSUFNMkFoQUxJQU1nQVRZQ0dFRUlJUUlnQXlJQklRQkJEQXdCQ3lBQktBSUlJZ0FnQXpZQ0RDQUJJQU0yQWdnZ0F5QUFOZ0lJUVFBaEFFRVlJUUpCREFzZ0Eyb2dBVFlDQUNBQ0lBTnFJQUEyQWdBTFFjZ2FLQUlBSWdBZ0JrME5BRUhJR2lBQUlBWnJJZ0UyQWdCQjFCcEIxQm9vQWdBaUFDQUdhaUlDTmdJQUlBSWdBVUVCY2pZQ0JDQUFJQVpCQTNJMkFnUWdBRUVJYWlFQURBUUxRYmdhUVRBMkFnQkJBQ0VBREFNTElBQWdBallDQUNBQUlBQW9BZ1FnQkdvMkFnUWdBa0Y0SUFKclFRZHhhaUlJSUFaQkEzSTJBZ1FnQVVGNElBRnJRUWR4YWlJRUlBWWdDR29pQTJzaEJ3SkFRZFFhS0FJQUlBUkdCRUJCMUJvZ0F6WUNBRUhJR2tISUdpZ0NBQ0FIYWlJQU5nSUFJQU1nQUVFQmNqWUNCQXdCQzBIUUdpZ0NBQ0FFUmdSQVFkQWFJQU0yQWdCQnhCcEJ4Qm9vQWdBZ0Iyb2lBRFlDQUNBRElBQkJBWEkyQWdRZ0FDQURhaUFBTmdJQURBRUxJQVFvQWdRaUFFRURjVUVCUmdSQUlBQkJlSEVoQ1NBRUtBSU1JUUlDUUNBQVFmOEJUUVJBSUFRb0FnZ2lBU0FDUmdSQVFid2FRYndhS0FJQVFYNGdBRUVEZG5keE5nSUFEQUlMSUFFZ0FqWUNEQ0FDSUFFMkFnZ01BUXNnQkNnQ0dDRUdBa0FnQWlBRVJ3UkFRY3dhS0FJQUdpQUVLQUlJSWdBZ0FqWUNEQ0FDSUFBMkFnZ01BUXNDUUNBRUtBSVVJZ0FFZnlBRVFSUnFCU0FFS0FJUUlnQkZEUUVnQkVFUWFnc2hBUU5BSUFFaEJTQUFJZ0pCRkdvaEFTQUFLQUlVSWdBTkFDQUNRUkJxSVFFZ0FpZ0NFQ0lBRFFBTElBVkJBRFlDQUF3QkMwRUFJUUlMSUFaRkRRQUNRQ0FFS0FJY0lnQkJBblJCN0J4cUlnRW9BZ0FnQkVZRVFDQUJJQUkyQWdBZ0FnMEJRY0FhUWNBYUtBSUFRWDRnQUhkeE5nSUFEQUlMSUFaQkVFRVVJQVlvQWhBZ0JFWWJhaUFDTmdJQUlBSkZEUUVMSUFJZ0JqWUNHQ0FFS0FJUUlnQUVRQ0FDSUFBMkFoQWdBQ0FDTmdJWUN5QUVLQUlVSWdCRkRRQWdBaUFBTmdJVUlBQWdBallDR0FzZ0J5QUphaUVISUFRZ0NXb2lCQ2dDQkNFQUN5QUVJQUJCZm5FMkFnUWdBeUFIUVFGeU5nSUVJQU1nQjJvZ0J6WUNBQ0FIUWY4QlRRUkFJQWRCZUhGQjVCcHFJUUFDZjBHOEdpZ0NBQ0lCUVFFZ0IwRURkblFpQW5GRkJFQkJ2Qm9nQVNBQ2NqWUNBQ0FBREFFTElBQW9BZ2dMSVFFZ0FDQUROZ0lJSUFFZ0F6WUNEQ0FESUFBMkFnd2dBeUFCTmdJSURBRUxRUjhoQWlBSFFmLy8vd2ROQkVBZ0IwRW1JQWRCQ0habklnQnJka0VCY1NBQVFRRjBhMEUrYWlFQ0N5QURJQUkyQWh3Z0EwSUFOd0lRSUFKQkFuUkI3QnhxSVFBQ1FBSkFRY0FhS0FJQUlnRkJBU0FDZENJRmNVVUVRRUhBR2lBQklBVnlOZ0lBSUFBZ0F6WUNBQXdCQ3lBSFFSa2dBa0VCZG10QkFDQUNRUjlIRzNRaEFpQUFLQUlBSVFFRFFDQUJJZ0FvQWdSQmVIRWdCMFlOQWlBQ1FSMTJJUUVnQWtFQmRDRUNJQUFnQVVFRWNXb2lCU2dDRUNJQkRRQUxJQVVnQXpZQ0VBc2dBeUFBTmdJWUlBTWdBellDRENBRElBTTJBZ2dNQVFzZ0FDZ0NDQ0lCSUFNMkFnd2dBQ0FETmdJSUlBTkJBRFlDR0NBRElBQTJBZ3dnQXlBQk5nSUlDeUFJUVFocUlRQU1BZ3NDUUNBSVJRMEFBa0FnQlNnQ0hDSUJRUUowUWV3Y2FpSUNLQUlBSUFWR0JFQWdBaUFBTmdJQUlBQU5BVUhBR2lBSFFYNGdBWGR4SWdjMkFnQU1BZ3NnQ0VFUVFSUWdDQ2dDRUNBRlJodHFJQUEyQWdBZ0FFVU5BUXNnQUNBSU5nSVlJQVVvQWhBaUFRUkFJQUFnQVRZQ0VDQUJJQUEyQWhnTElBVW9BaFFpQVVVTkFDQUFJQUUyQWhRZ0FTQUFOZ0lZQ3dKQUlBTkJEMDBFUUNBRklBTWdCbW9pQUVFRGNqWUNCQ0FBSUFWcUlnQWdBQ2dDQkVFQmNqWUNCQXdCQ3lBRklBWkJBM0kyQWdRZ0JTQUdhaUlFSUFOQkFYSTJBZ1FnQXlBRWFpQUROZ0lBSUFOQi93Rk5CRUFnQTBGNGNVSGtHbW9oQUFKL1Fid2FLQUlBSWdGQkFTQURRUU4yZENJQ2NVVUVRRUc4R2lBQklBSnlOZ0lBSUFBTUFRc2dBQ2dDQ0FzaEFTQUFJQVEyQWdnZ0FTQUVOZ0lNSUFRZ0FEWUNEQ0FFSUFFMkFnZ01BUXRCSHlFQUlBTkIvLy8vQjAwRVFDQURRU1lnQTBFSWRtY2lBR3QyUVFGeElBQkJBWFJyUVQ1cUlRQUxJQVFnQURZQ0hDQUVRZ0EzQWhBZ0FFRUNkRUhzSEdvaEFRSkFBa0FnQjBFQklBQjBJZ0p4UlFSQVFjQWFJQUlnQjNJMkFnQWdBU0FFTmdJQUlBUWdBVFlDR0F3QkN5QURRUmtnQUVFQmRtdEJBQ0FBUVI5SEczUWhBQ0FCS0FJQUlRRURRQ0FCSWdJb0FnUkJlSEVnQTBZTkFpQUFRUjEySVFFZ0FFRUJkQ0VBSUFJZ0FVRUVjV29pQnlnQ0VDSUJEUUFMSUFjZ0JEWUNFQ0FFSUFJMkFoZ0xJQVFnQkRZQ0RDQUVJQVEyQWdnTUFRc2dBaWdDQ0NJQUlBUTJBZ3dnQWlBRU5nSUlJQVJCQURZQ0dDQUVJQUkyQWd3Z0JDQUFOZ0lJQ3lBRlFRaHFJUUFNQVFzQ1FDQUpSUTBBQWtBZ0FpZ0NIQ0lCUVFKMFFld2NhaUlGS0FJQUlBSkdCRUFnQlNBQU5nSUFJQUFOQVVIQUdpQUxRWDRnQVhkeE5nSUFEQUlMSUFsQkVFRVVJQWtvQWhBZ0FrWWJhaUFBTmdJQUlBQkZEUUVMSUFBZ0NUWUNHQ0FDS0FJUUlnRUVRQ0FBSUFFMkFoQWdBU0FBTmdJWUN5QUNLQUlVSWdGRkRRQWdBQ0FCTmdJVUlBRWdBRFlDR0FzQ1FDQURRUTlOQkVBZ0FpQURJQVpxSWdCQkEzSTJBZ1FnQUNBQ2FpSUFJQUFvQWdSQkFYSTJBZ1FNQVFzZ0FpQUdRUU55TmdJRUlBSWdCbW9pQlNBRFFRRnlOZ0lFSUFNZ0JXb2dBellDQUNBSUJFQWdDRUY0Y1VIa0dtb2hBRUhRR2lnQ0FDRUJBbjlCQVNBSVFRTjJkQ0lISUFSeFJRUkFRYndhSUFRZ0IzSTJBZ0FnQUF3QkN5QUFLQUlJQ3lFRUlBQWdBVFlDQ0NBRUlBRTJBZ3dnQVNBQU5nSU1JQUVnQkRZQ0NBdEIwQm9nQlRZQ0FFSEVHaUFETmdJQUN5QUNRUWhxSVFBTElBcEJFR29rQUNBQUM2a0xBZ3QvQ1gwakFFR2dBV3NpQ3lRQUlBdEJNR3BCSkJBUUEwQWdBU0FOUndSQUlBSWdEVUVEYkNJTVFRSnFRUUowSWc1cUtnSUFJUmNnQWlBTVFRRnFRUUowSWc5cUtnSUFJUmdnQ0NBTVFRSjBJaEJxSUFJZ0VHb3FBZ0FpR1RnQ0FDQUlJQTlxSUJnNEFnQWdDQ0FPYWlBWE9BSUFJQWNnRFVFRmRHb2lEQ0FZT0FJRUlBd2dHVGdDQUNBTUlCYzRBZ2dnREVFQU5nSU1Ba0FnQUVVRVFDQUdJQTFxTFFBQVJRMEJDeUFNUVlDQWdBZzJBZ3dMSUFjZ0RVRUZkR29pRVNBRklBMUJBblFpREVFQmNpSVNhaTBBQUVFSWRDQUZJQXhxTFFBQWNpQUZJQXhCQW5JaUUyb3RBQUJCRUhSeUlBVWdERUVEY2lJTWFpMEFBRUVZZEhJMkFod2dDeUFESUJKQkFuUWlFbW9xQWdBaUZ6Z0NrQUVnQ3lBRElCTkJBblFpRTJvcUFnQWlHRGdDbEFFZ0N5QURJQXhCQW5RaUZHb3FBZ0FpR1RnQ21BRWdDeUFESUExQkJIUWlGV29xQWdDTUlobzRBcHdCSUF0QjRBQnFJZ3dnQ3lvQ21BRWlGa01BQUFEQWxDQVdsQ0FMS2dLVUFTSVdRd0FBQU1DVUlCYVVRd0FBZ0QrU2tqZ0NBQ0FNSUFzcUFwQUJJaFlnRnBJZ0N5b0NsQUdVSUFzcUFwZ0JRd0FBQU1DVUlBc3FBcHdCbEpJNEFnUWdEQ0FMS2dLUUFTSVdJQmFTSUFzcUFwZ0JsQ0FMS2dLVUFTSVdJQmFTSUFzcUFwd0JsSkk0QWdnZ0RDQUxLZ0tRQVNJV0lCYVNJQXNxQXBRQmxDQUxLZ0tZQVNJV0lCYVNJQXNxQXB3QmxKSTRBZ3dnRENBTEtnS1lBU0lXUXdBQUFNQ1VJQmFVSUFzcUFwQUJJaFpEQUFBQXdKUWdGcFJEQUFDQVA1S1NPQUlRSUF3Z0N5b0NsQUVpRmlBV2tpQUxLZ0tZQVpRZ0N5b0NrQUZEQUFBQXdKUWdDeW9DbkFHVWtqZ0NGQ0FNSUFzcUFwQUJJaFlnRnBJZ0N5b0NtQUdVSUFzcUFwUUJRd0FBQU1DVUlBc3FBcHdCbEpJNEFoZ2dEQ0FMS2dLVUFTSVdJQmFTSUFzcUFwZ0JsQ0FMS2dLUUFTSVdJQmFTSUFzcUFwd0JsSkk0QWh3Z0RDQUxLZ0tVQVNJV1F3QUFBTUNVSUJhVUlBc3FBcEFCSWhaREFBQUF3SlFnRnBSREFBQ0FQNUtTT0FJZ0lBa2dGV29nRnpnQ0FDQUpJQkpxSUJnNEFnQWdDU0FUYWlBWk9BSUFJQWtnRkdvZ0dqZ0NBQ0FMSUFRZ0VHb3FBZ0FpRnpnQ01DQUxJQVFnRDJvcUFnQWlHRGdDUUNBTElBUWdEbW9xQWdBaUdUZ0NVQ0FLSUJCcUlCYzRBZ0FnQ2lBUGFpQVlPQUlBSUFvZ0Rtb2dHVGdDQUNBTElBd3FBaGdnQ3lvQ09KUWdEQ29DQUNBTEtnSXdsQ0FNS2dJTUlBc3FBalNVa3BJNEFnQWdDeUFNS2dJY0lBc3FBamlVSUF3cUFnUWdDeW9DTUpRZ0RDb0NFQ0FMS2dJMGxKS1NPQUlFSUFzZ0RDb0NJQ0FMS2dJNGxDQU1LZ0lJSUFzcUFqQ1VJQXdxQWhRZ0N5b0NOSlNTa2pnQ0NDQUxJQXdxQWhnZ0N5b0NSSlFnRENvQ0FDQUxLZ0k4bENBTUtnSU1JQXNxQWtDVWtwSTRBZ3dnQ3lBTUtnSWNJQXNxQWtTVUlBd3FBZ1FnQ3lvQ1BKUWdEQ29DRUNBTEtnSkFsSktTT0FJUUlBc2dEQ29DSUNBTEtnSkVsQ0FNS2dJSUlBc3FBanlVSUF3cUFoUWdDeW9DUUpTU2tqZ0NGQ0FMSUF3cUFoZ2dDeW9DVUpRZ0RDb0NBQ0FMS2dKSWxDQU1LZ0lNSUFzcUFreVVrcEk0QWhnZ0N5QU1LZ0ljSUFzcUFsQ1VJQXdxQWdRZ0N5b0NTSlFnRENvQ0VDQUxLZ0pNbEpLU09BSWNJQXNnRENvQ0lDQUxLZ0pRbENBTUtnSUlJQXNxQWtpVUlBd3FBaFFnQ3lvQ1RKU1NramdDSUNBTEtnSWdJUmNnQ3lvQ0NDRVlJQXNxQWhRaEdTQVJJQXNxQWhnaUdpQWFsQ0FMS2dJQUloWWdGcFFnQ3lvQ0RDSWJJQnVVa3BKREFBQ0FRSlFnR2lBTEtnSWNJaHlVSUJZZ0N5b0NCQ0lkbENBYklBc3FBaEFpSHBTU2trTUFBSUJBbEJBTU5nSVFJQkVnR2lBWGxDQVdJQmlVSUJzZ0daU1Nra01BQUlCQWxDQWNJQnlVSUIwZ0haUWdIaUFlbEpLU1F3QUFnRUNVRUF3MkFoUWdFU0FjSUJlVUlCMGdHSlFnSGlBWmxKS1NRd0FBZ0VDVUlCY2dGNVFnR0NBWWxDQVpJQm1Va3BKREFBQ0FRSlFRRERZQ0dDQU5RUUZxSVEwTUFRc0xJQXRCb0FGcUpBQUxHZ0FnQUNBQktBSUlJQVVRQ2dSQUlBRWdBaUFESUFRUUZBc0xOd0FnQUNBQktBSUlJQVVRQ2dSQUlBRWdBaUFESUFRUUZBOExJQUFvQWdnaUFDQUJJQUlnQXlBRUlBVWdBQ2dDQUNnQ0ZCRURBQXVSQVFBZ0FDQUJLQUlJSUFRUUNnUkFJQUVnQWlBREVCTVBDd0pBSUFBZ0FTZ0NBQ0FFRUFwRkRRQUNRQ0FDSUFFb0FoQkhCRUFnQVNnQ0ZDQUNSdzBCQ3lBRFFRRkhEUUVnQVVFQk5nSWdEd3NnQVNBQ05nSVVJQUVnQXpZQ0lDQUJJQUVvQWloQkFXbzJBaWdDUUNBQktBSWtRUUZIRFFBZ0FTZ0NHRUVDUncwQUlBRkJBVG9BTmdzZ0FVRUVOZ0lzQ3d2eUFRQWdBQ0FCS0FJSUlBUVFDZ1JBSUFFZ0FpQURFQk1QQ3dKQUlBQWdBU2dDQUNBRUVBb0VRQUpBSUFJZ0FTZ0NFRWNFUUNBQktBSVVJQUpIRFFFTElBTkJBVWNOQWlBQlFRRTJBaUFQQ3lBQklBTTJBaUFDUUNBQktBSXNRUVJHRFFBZ0FVRUFPd0UwSUFBb0FnZ2lBQ0FCSUFJZ0FrRUJJQVFnQUNnQ0FDZ0NGQkVEQUNBQkxRQTFCRUFnQVVFRE5nSXNJQUV0QURSRkRRRU1Bd3NnQVVFRU5nSXNDeUFCSUFJMkFoUWdBU0FCS0FJb1FRRnFOZ0lvSUFFb0FpUkJBVWNOQVNBQktBSVlRUUpIRFFFZ0FVRUJPZ0EyRHdzZ0FDZ0NDQ0lBSUFFZ0FpQURJQVFnQUNnQ0FDZ0NHQkVDQUFzTE1RQWdBQ0FCS0FJSVFRQVFDZ1JBSUFFZ0FpQURFQlVQQ3lBQUtBSUlJZ0FnQVNBQ0lBTWdBQ2dDQUNnQ0hCRUFBQXNZQUNBQUlBRW9BZ2hCQUJBS0JFQWdBU0FDSUFNUUZRc0xnQU1CQkg4akFFSHdBR3NpQWlRQUlBQW9BZ0FpQTBFRWF5Z0NBQ0VFSUFOQkNHc29BZ0FoQlNBQ1FnQTNBbEFnQWtJQU53SllJQUpDQURjQ1lDQUNRZ0EzQUdjZ0FrSUFOd0pJSUFKQkFEWUNSQ0FDUWV3Vk5nSkFJQUlnQURZQ1BDQUNJQUUyQWpnZ0FDQUZhaUVEQWtBZ0JDQUJRUUFRQ2dSQVFRQWdBeUFGR3lFQURBRUxJQUFnQTA0RVFDQUNRZ0EzQUM4Z0FrSUFOd0lZSUFKQ0FEY0NJQ0FDUWdBM0FpZ2dBa0lBTndJUUlBSkJBRFlDRENBQ0lBRTJBZ2dnQWlBQU5nSUVJQUlnQkRZQ0FDQUNRUUUyQWpBZ0JDQUNJQU1nQTBFQlFRQWdCQ2dDQUNnQ0ZCRURBQ0FDS0FJWURRRUxRUUFoQUNBRUlBSkJPR29nQTBFQlFRQWdCQ2dDQUNnQ0dCRUNBQUpBQWtBZ0FpZ0NYQTRDQUFFQ0N5QUNLQUpNUVFBZ0FpZ0NXRUVCUmh0QkFDQUNLQUpVUVFGR0cwRUFJQUlvQW1CQkFVWWJJUUFNQVFzZ0FpZ0NVRUVCUndSQUlBSW9BbUFOQVNBQ0tBSlVRUUZIRFFFZ0FpZ0NXRUVCUncwQkN5QUNLQUpJSVFBTElBSkI4QUJxSkFBZ0FBdVpBUUVDZnlNQVFVQnFJZ01rQUFKL1FRRWdBQ0FCUVFBUUNnMEFHa0VBSUFGRkRRQWFRUUFnQVVHY0ZoQWhJZ0ZGRFFBYUlBTkJER3BCTkJBUUlBTkJBVFlDT0NBRFFYODJBaFFnQXlBQU5nSVFJQU1nQVRZQ0NDQUJJQU5CQ0dvZ0FpZ0NBRUVCSUFFb0FnQW9BaHdSQUFBZ0F5Z0NJQ0lBUVFGR0JFQWdBaUFES0FJWU5nSUFDeUFBUVFGR0N5RUVJQU5CUUdza0FDQUVDd29BSUFBZ0FVRUFFQW9MQzdjU0FnQkJnQWdMcGhKMWJuTnBaMjVsWkNCemFHOXlkQUIxYm5OcFoyNWxaQ0JwYm5RQVpteHZZWFFBZFdsdWREWTBYM1FBZFc1emFXZHVaV1FnWTJoaGNnQmliMjlzQUhWdWMybG5ibVZrSUd4dmJtY0FjM1JrT2pwM2MzUnlhVzVuQUhOMFpEbzZjM1J5YVc1bkFITjBaRG82ZFRFMmMzUnlhVzVuQUhOMFpEbzZkVE15YzNSeWFXNW5BR1J2ZFdKc1pRQjJiMmxrQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQSE5vYjNKMFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4MWJuTnBaMjVsWkNCemFHOXlkRDRBWlcxelkzSnBjSFJsYmpvNmJXVnRiM0o1WDNacFpYYzhhVzUwUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYm5OcFoyNWxaQ0JwYm5RK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEdac2IyRjBQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eDFhVzUwT0Y5MFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4cGJuUTRYM1ErQUdWdGMyTnlhWEIwWlc0Nk9tMWxiVzl5ZVY5MmFXVjNQSFZwYm5ReE5sOTBQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eHBiblF4Tmw5MFBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4MWFXNTBOalJmZEQ0QVpXMXpZM0pwY0hSbGJqbzZiV1Z0YjNKNVgzWnBaWGM4YVc1ME5qUmZkRDRBWlcxelkzSnBjSFJsYmpvNmJXVnRiM0o1WDNacFpYYzhkV2x1ZERNeVgzUStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BHbHVkRE15WDNRK0FHVnRjMk55YVhCMFpXNDZPbTFsYlc5eWVWOTJhV1YzUEdOb1lYSStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BIVnVjMmxuYm1Wa0lHTm9ZWEkrQUhOMFpEbzZZbUZ6YVdOZmMzUnlhVzVuUEhWdWMybG5ibVZrSUdOb1lYSStBR1Z0YzJOeWFYQjBaVzQ2T20xbGJXOXllVjkyYVdWM1BITnBaMjVsWkNCamFHRnlQZ0JsYlhOamNtbHdkR1Z1T2pwdFpXMXZjbmxmZG1sbGR6eHNiMjVuUGdCbGJYTmpjbWx3ZEdWdU9qcHRaVzF2Y25sZmRtbGxkengxYm5OcFoyNWxaQ0JzYjI1blBnQmxiWE5qY21sd2RHVnVPanB0WlcxdmNubGZkbWxsZHp4a2IzVmliR1UrQUU1VGRETmZYekl4TW1KaGMybGpYM04wY21sdVowbGpUbE5mTVRGamFHRnlYM1J5WVdsMGMwbGpSVVZPVTE4NVlXeHNiMk5oZEc5eVNXTkZSVVZGQUFBQUFKUU1BQUF5QndBQVRsTjBNMTlmTWpFeVltRnphV05mYzNSeWFXNW5TV2hPVTE4eE1XTm9ZWEpmZEhKaGFYUnpTV2hGUlU1VFh6bGhiR3h2WTJGMGIzSkphRVZGUlVVQUFKUU1BQUI4QndBQVRsTjBNMTlmTWpFeVltRnphV05mYzNSeWFXNW5TWGRPVTE4eE1XTm9ZWEpmZEhKaGFYUnpTWGRGUlU1VFh6bGhiR3h2WTJGMGIzSkpkMFZGUlVVQUFKUU1BQURFQndBQVRsTjBNMTlmTWpFeVltRnphV05mYzNSeWFXNW5TVVJ6VGxOZk1URmphR0Z5WDNSeVlXbDBjMGxFYzBWRlRsTmZPV0ZzYkc5allYUnZja2xFYzBWRlJVVUFBQUNVREFBQURBZ0FBRTVUZEROZlh6SXhNbUpoYzJsalgzTjBjbWx1WjBsRWFVNVRYekV4WTJoaGNsOTBjbUZwZEhOSlJHbEZSVTVUWHpsaGJHeHZZMkYwYjNKSlJHbEZSVVZGQUFBQWxBd0FBRmdJQUFCT01UQmxiWE5qY21sd2RHVnVNM1poYkVVQUFKUU1BQUNrQ0FBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSlkwVkZBQUNVREFBQXdBZ0FBRTR4TUdWdGMyTnlhWEIwWlc0eE1XMWxiVzl5ZVY5MmFXVjNTV0ZGUlFBQWxBd0FBT2dJQUFCT01UQmxiWE5qY21sd2RHVnVNVEZ0WlcxdmNubGZkbWxsZDBsb1JVVUFBSlFNQUFBUUNRQUFUakV3WlcxelkzSnBjSFJsYmpFeGJXVnRiM0o1WDNacFpYZEpjMFZGQUFDVURBQUFPQWtBQUU0eE1HVnRjMk55YVhCMFpXNHhNVzFsYlc5eWVWOTJhV1YzU1hSRlJRQUFsQXdBQUdBSkFBQk9NVEJsYlhOamNtbHdkR1Z1TVRGdFpXMXZjbmxmZG1sbGQwbHBSVVVBQUpRTUFBQ0lDUUFBVGpFd1pXMXpZM0pwY0hSbGJqRXhiV1Z0YjNKNVgzWnBaWGRKYWtWRkFBQ1VEQUFBc0FrQUFFNHhNR1Z0YzJOeWFYQjBaVzR4TVcxbGJXOXllVjkyYVdWM1NXeEZSUUFBbEF3QUFOZ0pBQUJPTVRCbGJYTmpjbWx3ZEdWdU1URnRaVzF2Y25sZmRtbGxkMGx0UlVVQUFKUU1BQUFBQ2dBQVRqRXdaVzF6WTNKcGNIUmxiakV4YldWdGIzSjVYM1pwWlhkSmVFVkZBQUNVREFBQUtBb0FBRTR4TUdWdGMyTnlhWEIwWlc0eE1XMWxiVzl5ZVY5MmFXVjNTWGxGUlFBQWxBd0FBRkFLQUFCT01UQmxiWE5qY21sd2RHVnVNVEZ0WlcxdmNubGZkbWxsZDBsbVJVVUFBSlFNQUFCNENnQUFUakV3WlcxelkzSnBjSFJsYmpFeGJXVnRiM0o1WDNacFpYZEpaRVZGQUFDVURBQUFvQW9BQUU0eE1GOWZZM2g0WVdKcGRqRXhObDlmYzJocGJWOTBlWEJsWDJsdVptOUZBQUFBQUx3TUFBRElDZ0FBSUEwQUFFNHhNRjlmWTNoNFlXSnBkakV4TjE5ZlkyeGhjM05mZEhsd1pWOXBibVp2UlFBQUFMd01BQUQ0Q2dBQTdBb0FBRTR4TUY5ZlkzaDRZV0pwZGpFeE4xOWZjR0poYzJWZmRIbHdaVjlwYm1adlJRQUFBTHdNQUFBb0N3QUE3QW9BQUU0eE1GOWZZM2g0WVdKcGRqRXhPVjlmY0c5cGJuUmxjbDkwZVhCbFgybHVabTlGQUx3TUFBQllDd0FBVEFzQUFBQUFBQURNQ3dBQUFnQUFBQU1BQUFBRUFBQUFCUUFBQUFZQUFBQk9NVEJmWDJONGVHRmlhWFl4TWpOZlgyWjFibVJoYldWdWRHRnNYM1I1Y0dWZmFXNW1iMFVBdkF3QUFLUUxBQURzQ2dBQWRnQUFBSkFMQUFEWUN3QUFZZ0FBQUpBTEFBRGtDd0FBWXdBQUFKQUxBQUR3Q3dBQWFBQUFBSkFMQUFEOEN3QUFZUUFBQUpBTEFBQUlEQUFBY3dBQUFKQUxBQUFVREFBQWRBQUFBSkFMQUFBZ0RBQUFhUUFBQUpBTEFBQXNEQUFBYWdBQUFKQUxBQUE0REFBQWJBQUFBSkFMQUFCRURBQUFiUUFBQUpBTEFBQlFEQUFBZUFBQUFKQUxBQUJjREFBQWVRQUFBSkFMQUFCb0RBQUFaZ0FBQUpBTEFBQjBEQUFBWkFBQUFKQUxBQUNBREFBQUFBQUFBQndMQUFBQ0FBQUFCd0FBQUFRQUFBQUZBQUFBQ0FBQUFBa0FBQUFLQUFBQUN3QUFBQUFBQUFBRURRQUFBZ0FBQUF3QUFBQUVBQUFBQlFBQUFBZ0FBQUFOQUFBQURnQUFBQThBQUFCT01UQmZYMk40ZUdGaWFYWXhNakJmWDNOcFgyTnNZWE56WDNSNWNHVmZhVzVtYjBVQUFBQUF2QXdBQU53TUFBQWNDd0FBVTNRNWRIbHdaVjlwYm1adkFBQUFBSlFNQUFBUURRQkJxQm9MQXpBUEFRPT0iO2lmKCFpc0RhdGFVUkkod2FzbUJpbmFyeUZpbGUpKXt3YXNtQmluYXJ5RmlsZT1sb2NhdGVGaWxlKHdhc21CaW5hcnlGaWxlKTt9ZnVuY3Rpb24gZ2V0QmluYXJ5U3luYyhmaWxlKXtpZihmaWxlPT13YXNtQmluYXJ5RmlsZSYmd2FzbUJpbmFyeSl7cmV0dXJuIG5ldyBVaW50OEFycmF5KHdhc21CaW5hcnkpfXZhciBiaW5hcnk9dHJ5UGFyc2VBc0RhdGFVUkkoZmlsZSk7aWYoYmluYXJ5KXtyZXR1cm4gYmluYXJ5fWlmKHJlYWRCaW5hcnkpe3JldHVybiByZWFkQmluYXJ5KGZpbGUpfXRocm93ICJib3RoIGFzeW5jIGFuZCBzeW5jIGZldGNoaW5nIG9mIHRoZSB3YXNtIGZhaWxlZCJ9ZnVuY3Rpb24gZ2V0QmluYXJ5UHJvbWlzZShiaW5hcnlGaWxlKXtyZXR1cm4gUHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+Z2V0QmluYXJ5U3luYyhiaW5hcnlGaWxlKSl9ZnVuY3Rpb24gaW5zdGFudGlhdGVBcnJheUJ1ZmZlcihiaW5hcnlGaWxlLGltcG9ydHMscmVjZWl2ZXIpe3JldHVybiBnZXRCaW5hcnlQcm9taXNlKGJpbmFyeUZpbGUpLnRoZW4oYmluYXJ5PT5XZWJBc3NlbWJseS5pbnN0YW50aWF0ZShiaW5hcnksaW1wb3J0cykpLnRoZW4ocmVjZWl2ZXIscmVhc29uPT57ZXJyKGBmYWlsZWQgdG8gYXN5bmNocm9ub3VzbHkgcHJlcGFyZSB3YXNtOiAke3JlYXNvbn1gKTthYm9ydChyZWFzb24pO30pfWZ1bmN0aW9uIGluc3RhbnRpYXRlQXN5bmMoYmluYXJ5LGJpbmFyeUZpbGUsaW1wb3J0cyxjYWxsYmFjayl7cmV0dXJuIGluc3RhbnRpYXRlQXJyYXlCdWZmZXIoYmluYXJ5RmlsZSxpbXBvcnRzLGNhbGxiYWNrKX1mdW5jdGlvbiBjcmVhdGVXYXNtKCl7dmFyIGluZm89eyJhIjp3YXNtSW1wb3J0c307ZnVuY3Rpb24gcmVjZWl2ZUluc3RhbmNlKGluc3RhbmNlLG1vZHVsZSl7d2FzbUV4cG9ydHM9aW5zdGFuY2UuZXhwb3J0czt3YXNtTWVtb3J5PXdhc21FeHBvcnRzWyJrIl07dXBkYXRlTWVtb3J5Vmlld3MoKTthZGRPbkluaXQod2FzbUV4cG9ydHNbImwiXSk7cmVtb3ZlUnVuRGVwZW5kZW5jeSgpO3JldHVybiB3YXNtRXhwb3J0c31hZGRSdW5EZXBlbmRlbmN5KCk7ZnVuY3Rpb24gcmVjZWl2ZUluc3RhbnRpYXRpb25SZXN1bHQocmVzdWx0KXtyZWNlaXZlSW5zdGFuY2UocmVzdWx0WyJpbnN0YW5jZSJdKTt9aWYoTW9kdWxlWyJpbnN0YW50aWF0ZVdhc20iXSl7dHJ5e3JldHVybiBNb2R1bGVbImluc3RhbnRpYXRlV2FzbSJdKGluZm8scmVjZWl2ZUluc3RhbmNlKX1jYXRjaChlKXtlcnIoYE1vZHVsZS5pbnN0YW50aWF0ZVdhc20gY2FsbGJhY2sgZmFpbGVkIHdpdGggZXJyb3I6ICR7ZX1gKTtyZWFkeVByb21pc2VSZWplY3QoZSk7fX1pbnN0YW50aWF0ZUFzeW5jKHdhc21CaW5hcnksd2FzbUJpbmFyeUZpbGUsaW5mbyxyZWNlaXZlSW5zdGFudGlhdGlvblJlc3VsdCkuY2F0Y2gocmVhZHlQcm9taXNlUmVqZWN0KTtyZXR1cm4ge319dmFyIGNhbGxSdW50aW1lQ2FsbGJhY2tzPWNhbGxiYWNrcz0+e3doaWxlKGNhbGxiYWNrcy5sZW5ndGg+MCl7Y2FsbGJhY2tzLnNoaWZ0KCkoTW9kdWxlKTt9fTtNb2R1bGVbIm5vRXhpdFJ1bnRpbWUiXXx8dHJ1ZTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfYmlnaW50PShwcmltaXRpdmVUeXBlLG5hbWUsc2l6ZSxtaW5SYW5nZSxtYXhSYW5nZSk9Pnt9O3ZhciBlbWJpbmRfaW5pdF9jaGFyQ29kZXM9KCk9Pnt2YXIgY29kZXM9bmV3IEFycmF5KDI1Nik7Zm9yKHZhciBpPTA7aTwyNTY7KytpKXtjb2Rlc1tpXT1TdHJpbmcuZnJvbUNoYXJDb2RlKGkpO31lbWJpbmRfY2hhckNvZGVzPWNvZGVzO307dmFyIGVtYmluZF9jaGFyQ29kZXM7dmFyIHJlYWRMYXRpbjFTdHJpbmc9cHRyPT57dmFyIHJldD0iIjt2YXIgYz1wdHI7d2hpbGUoSEVBUFU4W2NdKXtyZXQrPWVtYmluZF9jaGFyQ29kZXNbSEVBUFU4W2MrK11dO31yZXR1cm4gcmV0fTt2YXIgYXdhaXRpbmdEZXBlbmRlbmNpZXM9e307dmFyIHJlZ2lzdGVyZWRUeXBlcz17fTt2YXIgQmluZGluZ0Vycm9yO3ZhciB0aHJvd0JpbmRpbmdFcnJvcj1tZXNzYWdlPT57dGhyb3cgbmV3IEJpbmRpbmdFcnJvcihtZXNzYWdlKX07ZnVuY3Rpb24gc2hhcmVkUmVnaXN0ZXJUeXBlKHJhd1R5cGUscmVnaXN0ZXJlZEluc3RhbmNlLG9wdGlvbnM9e30pe3ZhciBuYW1lPXJlZ2lzdGVyZWRJbnN0YW5jZS5uYW1lO2lmKCFyYXdUeXBlKXt0aHJvd0JpbmRpbmdFcnJvcihgdHlwZSAiJHtuYW1lfSIgbXVzdCBoYXZlIGEgcG9zaXRpdmUgaW50ZWdlciB0eXBlaWQgcG9pbnRlcmApO31pZihyZWdpc3RlcmVkVHlwZXMuaGFzT3duUHJvcGVydHkocmF3VHlwZSkpe2lmKG9wdGlvbnMuaWdub3JlRHVwbGljYXRlUmVnaXN0cmF0aW9ucyl7cmV0dXJufWVsc2Uge3Rocm93QmluZGluZ0Vycm9yKGBDYW5ub3QgcmVnaXN0ZXIgdHlwZSAnJHtuYW1lfScgdHdpY2VgKTt9fXJlZ2lzdGVyZWRUeXBlc1tyYXdUeXBlXT1yZWdpc3RlcmVkSW5zdGFuY2U7aWYoYXdhaXRpbmdEZXBlbmRlbmNpZXMuaGFzT3duUHJvcGVydHkocmF3VHlwZSkpe3ZhciBjYWxsYmFja3M9YXdhaXRpbmdEZXBlbmRlbmNpZXNbcmF3VHlwZV07ZGVsZXRlIGF3YWl0aW5nRGVwZW5kZW5jaWVzW3Jhd1R5cGVdO2NhbGxiYWNrcy5mb3JFYWNoKGNiPT5jYigpKTt9fWZ1bmN0aW9uIHJlZ2lzdGVyVHlwZShyYXdUeXBlLHJlZ2lzdGVyZWRJbnN0YW5jZSxvcHRpb25zPXt9KXtpZighKCJhcmdQYWNrQWR2YW5jZSJpbiByZWdpc3RlcmVkSW5zdGFuY2UpKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJyZWdpc3RlclR5cGUgcmVnaXN0ZXJlZEluc3RhbmNlIHJlcXVpcmVzIGFyZ1BhY2tBZHZhbmNlIil9cmV0dXJuIHNoYXJlZFJlZ2lzdGVyVHlwZShyYXdUeXBlLHJlZ2lzdGVyZWRJbnN0YW5jZSxvcHRpb25zKX12YXIgR2VuZXJpY1dpcmVUeXBlU2l6ZT04O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9ib29sPShyYXdUeXBlLG5hbWUsdHJ1ZVZhbHVlLGZhbHNlVmFsdWUpPT57bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3JlZ2lzdGVyVHlwZShyYXdUeXBlLHtuYW1lOm5hbWUsImZyb21XaXJlVHlwZSI6ZnVuY3Rpb24od3Qpe3JldHVybiAhIXd0fSwidG9XaXJlVHlwZSI6ZnVuY3Rpb24oZGVzdHJ1Y3RvcnMsbyl7cmV0dXJuIG8/dHJ1ZVZhbHVlOmZhbHNlVmFsdWV9LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOmZ1bmN0aW9uKHBvaW50ZXIpe3JldHVybiB0aGlzWyJmcm9tV2lyZVR5cGUiXShIRUFQVThbcG9pbnRlcl0pfSxkZXN0cnVjdG9yRnVuY3Rpb246bnVsbH0pO307dmFyIGVtdmFsX2ZyZWVsaXN0PVtdO3ZhciBlbXZhbF9oYW5kbGVzPVtdO3ZhciBfX2VtdmFsX2RlY3JlZj1oYW5kbGU9PntpZihoYW5kbGU+OSYmMD09PS0tZW12YWxfaGFuZGxlc1toYW5kbGUrMV0pe2VtdmFsX2hhbmRsZXNbaGFuZGxlXT11bmRlZmluZWQ7ZW12YWxfZnJlZWxpc3QucHVzaChoYW5kbGUpO319O3ZhciBjb3VudF9lbXZhbF9oYW5kbGVzPSgpPT5lbXZhbF9oYW5kbGVzLmxlbmd0aC8yLTUtZW12YWxfZnJlZWxpc3QubGVuZ3RoO3ZhciBpbml0X2VtdmFsPSgpPT57ZW12YWxfaGFuZGxlcy5wdXNoKDAsMSx1bmRlZmluZWQsMSxudWxsLDEsdHJ1ZSwxLGZhbHNlLDEpO01vZHVsZVsiY291bnRfZW12YWxfaGFuZGxlcyJdPWNvdW50X2VtdmFsX2hhbmRsZXM7fTt2YXIgRW12YWw9e3RvVmFsdWU6aGFuZGxlPT57aWYoIWhhbmRsZSl7dGhyb3dCaW5kaW5nRXJyb3IoIkNhbm5vdCB1c2UgZGVsZXRlZCB2YWwuIGhhbmRsZSA9ICIraGFuZGxlKTt9cmV0dXJuIGVtdmFsX2hhbmRsZXNbaGFuZGxlXX0sdG9IYW5kbGU6dmFsdWU9Pntzd2l0Y2godmFsdWUpe2Nhc2UgdW5kZWZpbmVkOnJldHVybiAyO2Nhc2UgbnVsbDpyZXR1cm4gNDtjYXNlIHRydWU6cmV0dXJuIDY7Y2FzZSBmYWxzZTpyZXR1cm4gODtkZWZhdWx0Ontjb25zdCBoYW5kbGU9ZW12YWxfZnJlZWxpc3QucG9wKCl8fGVtdmFsX2hhbmRsZXMubGVuZ3RoO2VtdmFsX2hhbmRsZXNbaGFuZGxlXT12YWx1ZTtlbXZhbF9oYW5kbGVzW2hhbmRsZSsxXT0xO3JldHVybiBoYW5kbGV9fX19O2Z1bmN0aW9uIHJlYWRQb2ludGVyKHBvaW50ZXIpe3JldHVybiB0aGlzWyJmcm9tV2lyZVR5cGUiXShIRUFQVTMyW3BvaW50ZXI+PjJdKX12YXIgRW1WYWxUeXBlPXtuYW1lOiJlbXNjcmlwdGVuOjp2YWwiLCJmcm9tV2lyZVR5cGUiOmhhbmRsZT0+e3ZhciBydj1FbXZhbC50b1ZhbHVlKGhhbmRsZSk7X19lbXZhbF9kZWNyZWYoaGFuZGxlKTtyZXR1cm4gcnZ9LCJ0b1dpcmVUeXBlIjooZGVzdHJ1Y3RvcnMsdmFsdWUpPT5FbXZhbC50b0hhbmRsZSh2YWx1ZSksImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6cmVhZFBvaW50ZXIsZGVzdHJ1Y3RvckZ1bmN0aW9uOm51bGx9O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9lbXZhbD1yYXdUeXBlPT5yZWdpc3RlclR5cGUocmF3VHlwZSxFbVZhbFR5cGUpO3ZhciBmbG9hdFJlYWRWYWx1ZUZyb21Qb2ludGVyPShuYW1lLHdpZHRoKT0+e3N3aXRjaCh3aWR0aCl7Y2FzZSA0OnJldHVybiBmdW5jdGlvbihwb2ludGVyKXtyZXR1cm4gdGhpc1siZnJvbVdpcmVUeXBlIl0oSEVBUEYzMltwb2ludGVyPj4yXSl9O2Nhc2UgODpyZXR1cm4gZnVuY3Rpb24ocG9pbnRlcil7cmV0dXJuIHRoaXNbImZyb21XaXJlVHlwZSJdKEhFQVBGNjRbcG9pbnRlcj4+M10pfTtkZWZhdWx0OnRocm93IG5ldyBUeXBlRXJyb3IoYGludmFsaWQgZmxvYXQgd2lkdGggKCR7d2lkdGh9KTogJHtuYW1lfWApfX07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2Zsb2F0PShyYXdUeXBlLG5hbWUsc2l6ZSk9PntuYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjp2YWx1ZT0+dmFsdWUsInRvV2lyZVR5cGUiOihkZXN0cnVjdG9ycyx2YWx1ZSk9PnZhbHVlLCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOmZsb2F0UmVhZFZhbHVlRnJvbVBvaW50ZXIobmFtZSxzaXplKSxkZXN0cnVjdG9yRnVuY3Rpb246bnVsbH0pO307dmFyIGludGVnZXJSZWFkVmFsdWVGcm9tUG9pbnRlcj0obmFtZSx3aWR0aCxzaWduZWQpPT57c3dpdGNoKHdpZHRoKXtjYXNlIDE6cmV0dXJuIHNpZ25lZD9wb2ludGVyPT5IRUFQOFtwb2ludGVyXTpwb2ludGVyPT5IRUFQVThbcG9pbnRlcl07Y2FzZSAyOnJldHVybiBzaWduZWQ/cG9pbnRlcj0+SEVBUDE2W3BvaW50ZXI+PjFdOnBvaW50ZXI9PkhFQVBVMTZbcG9pbnRlcj4+MV07Y2FzZSA0OnJldHVybiBzaWduZWQ/cG9pbnRlcj0+SEVBUDMyW3BvaW50ZXI+PjJdOnBvaW50ZXI9PkhFQVBVMzJbcG9pbnRlcj4+Ml07ZGVmYXVsdDp0aHJvdyBuZXcgVHlwZUVycm9yKGBpbnZhbGlkIGludGVnZXIgd2lkdGggKCR7d2lkdGh9KTogJHtuYW1lfWApfX07dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX2ludGVnZXI9KHByaW1pdGl2ZVR5cGUsbmFtZSxzaXplLG1pblJhbmdlLG1heFJhbmdlKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTt2YXIgZnJvbVdpcmVUeXBlPXZhbHVlPT52YWx1ZTtpZihtaW5SYW5nZT09PTApe3ZhciBiaXRzaGlmdD0zMi04KnNpemU7ZnJvbVdpcmVUeXBlPXZhbHVlPT52YWx1ZTw8Yml0c2hpZnQ+Pj5iaXRzaGlmdDt9dmFyIGlzVW5zaWduZWRUeXBlPW5hbWUuaW5jbHVkZXMoInVuc2lnbmVkIik7dmFyIGNoZWNrQXNzZXJ0aW9ucz0odmFsdWUsdG9UeXBlTmFtZSk9Pnt9O3ZhciB0b1dpcmVUeXBlO2lmKGlzVW5zaWduZWRUeXBlKXt0b1dpcmVUeXBlPWZ1bmN0aW9uKGRlc3RydWN0b3JzLHZhbHVlKXtjaGVja0Fzc2VydGlvbnModmFsdWUsdGhpcy5uYW1lKTtyZXR1cm4gdmFsdWU+Pj4wfTt9ZWxzZSB7dG9XaXJlVHlwZT1mdW5jdGlvbihkZXN0cnVjdG9ycyx2YWx1ZSl7Y2hlY2tBc3NlcnRpb25zKHZhbHVlLHRoaXMubmFtZSk7cmV0dXJuIHZhbHVlfTt9cmVnaXN0ZXJUeXBlKHByaW1pdGl2ZVR5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjpmcm9tV2lyZVR5cGUsInRvV2lyZVR5cGUiOnRvV2lyZVR5cGUsImFyZ1BhY2tBZHZhbmNlIjpHZW5lcmljV2lyZVR5cGVTaXplLCJyZWFkVmFsdWVGcm9tUG9pbnRlciI6aW50ZWdlclJlYWRWYWx1ZUZyb21Qb2ludGVyKG5hbWUsc2l6ZSxtaW5SYW5nZSE9PTApLGRlc3RydWN0b3JGdW5jdGlvbjpudWxsfSk7fTt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfbWVtb3J5X3ZpZXc9KHJhd1R5cGUsZGF0YVR5cGVJbmRleCxuYW1lKT0+e3ZhciB0eXBlTWFwcGluZz1bSW50OEFycmF5LFVpbnQ4QXJyYXksSW50MTZBcnJheSxVaW50MTZBcnJheSxJbnQzMkFycmF5LFVpbnQzMkFycmF5LEZsb2F0MzJBcnJheSxGbG9hdDY0QXJyYXldO3ZhciBUQT10eXBlTWFwcGluZ1tkYXRhVHlwZUluZGV4XTtmdW5jdGlvbiBkZWNvZGVNZW1vcnlWaWV3KGhhbmRsZSl7dmFyIHNpemU9SEVBUFUzMltoYW5kbGU+PjJdO3ZhciBkYXRhPUhFQVBVMzJbaGFuZGxlKzQ+PjJdO3JldHVybiBuZXcgVEEoSEVBUDguYnVmZmVyLGRhdGEsc2l6ZSl9bmFtZT1yZWFkTGF0aW4xU3RyaW5nKG5hbWUpO3JlZ2lzdGVyVHlwZShyYXdUeXBlLHtuYW1lOm5hbWUsImZyb21XaXJlVHlwZSI6ZGVjb2RlTWVtb3J5VmlldywiYXJnUGFja0FkdmFuY2UiOkdlbmVyaWNXaXJlVHlwZVNpemUsInJlYWRWYWx1ZUZyb21Qb2ludGVyIjpkZWNvZGVNZW1vcnlWaWV3fSx7aWdub3JlRHVwbGljYXRlUmVnaXN0cmF0aW9uczp0cnVlfSk7fTt2YXIgc3RyaW5nVG9VVEY4QXJyYXk9KHN0cixoZWFwLG91dElkeCxtYXhCeXRlc1RvV3JpdGUpPT57aWYoIShtYXhCeXRlc1RvV3JpdGU+MCkpcmV0dXJuIDA7dmFyIHN0YXJ0SWR4PW91dElkeDt2YXIgZW5kSWR4PW91dElkeCttYXhCeXRlc1RvV3JpdGUtMTtmb3IodmFyIGk9MDtpPHN0ci5sZW5ndGg7KytpKXt2YXIgdT1zdHIuY2hhckNvZGVBdChpKTtpZih1Pj01NTI5NiYmdTw9NTczNDMpe3ZhciB1MT1zdHIuY2hhckNvZGVBdCgrK2kpO3U9NjU1MzYrKCh1JjEwMjMpPDwxMCl8dTEmMTAyMzt9aWYodTw9MTI3KXtpZihvdXRJZHg+PWVuZElkeClicmVhaztoZWFwW291dElkeCsrXT11O31lbHNlIGlmKHU8PTIwNDcpe2lmKG91dElkeCsxPj1lbmRJZHgpYnJlYWs7aGVhcFtvdXRJZHgrK109MTkyfHU+PjY7aGVhcFtvdXRJZHgrK109MTI4fHUmNjM7fWVsc2UgaWYodTw9NjU1MzUpe2lmKG91dElkeCsyPj1lbmRJZHgpYnJlYWs7aGVhcFtvdXRJZHgrK109MjI0fHU+PjEyO2hlYXBbb3V0SWR4KytdPTEyOHx1Pj42JjYzO2hlYXBbb3V0SWR4KytdPTEyOHx1JjYzO31lbHNlIHtpZihvdXRJZHgrMz49ZW5kSWR4KWJyZWFrO2hlYXBbb3V0SWR4KytdPTI0MHx1Pj4xODtoZWFwW291dElkeCsrXT0xMjh8dT4+MTImNjM7aGVhcFtvdXRJZHgrK109MTI4fHU+PjYmNjM7aGVhcFtvdXRJZHgrK109MTI4fHUmNjM7fX1oZWFwW291dElkeF09MDtyZXR1cm4gb3V0SWR4LXN0YXJ0SWR4fTt2YXIgc3RyaW5nVG9VVEY4PShzdHIsb3V0UHRyLG1heEJ5dGVzVG9Xcml0ZSk9PnN0cmluZ1RvVVRGOEFycmF5KHN0cixIRUFQVTgsb3V0UHRyLG1heEJ5dGVzVG9Xcml0ZSk7dmFyIGxlbmd0aEJ5dGVzVVRGOD1zdHI9Pnt2YXIgbGVuPTA7Zm9yKHZhciBpPTA7aTxzdHIubGVuZ3RoOysraSl7dmFyIGM9c3RyLmNoYXJDb2RlQXQoaSk7aWYoYzw9MTI3KXtsZW4rKzt9ZWxzZSBpZihjPD0yMDQ3KXtsZW4rPTI7fWVsc2UgaWYoYz49NTUyOTYmJmM8PTU3MzQzKXtsZW4rPTQ7KytpO31lbHNlIHtsZW4rPTM7fX1yZXR1cm4gbGVufTt2YXIgVVRGOERlY29kZXI9dHlwZW9mIFRleHREZWNvZGVyIT0idW5kZWZpbmVkIj9uZXcgVGV4dERlY29kZXIoInV0ZjgiKTp1bmRlZmluZWQ7dmFyIFVURjhBcnJheVRvU3RyaW5nPShoZWFwT3JBcnJheSxpZHgsbWF4Qnl0ZXNUb1JlYWQpPT57dmFyIGVuZElkeD1pZHgrbWF4Qnl0ZXNUb1JlYWQ7dmFyIGVuZFB0cj1pZHg7d2hpbGUoaGVhcE9yQXJyYXlbZW5kUHRyXSYmIShlbmRQdHI+PWVuZElkeCkpKytlbmRQdHI7aWYoZW5kUHRyLWlkeD4xNiYmaGVhcE9yQXJyYXkuYnVmZmVyJiZVVEY4RGVjb2Rlcil7cmV0dXJuIFVURjhEZWNvZGVyLmRlY29kZShoZWFwT3JBcnJheS5zdWJhcnJheShpZHgsZW5kUHRyKSl9dmFyIHN0cj0iIjt3aGlsZShpZHg8ZW5kUHRyKXt2YXIgdTA9aGVhcE9yQXJyYXlbaWR4KytdO2lmKCEodTAmMTI4KSl7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKHUwKTtjb250aW51ZX12YXIgdTE9aGVhcE9yQXJyYXlbaWR4KytdJjYzO2lmKCh1MCYyMjQpPT0xOTIpe3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZSgodTAmMzEpPDw2fHUxKTtjb250aW51ZX12YXIgdTI9aGVhcE9yQXJyYXlbaWR4KytdJjYzO2lmKCh1MCYyNDApPT0yMjQpe3UwPSh1MCYxNSk8PDEyfHUxPDw2fHUyO31lbHNlIHt1MD0odTAmNyk8PDE4fHUxPDwxMnx1Mjw8NnxoZWFwT3JBcnJheVtpZHgrK10mNjM7fWlmKHUwPDY1NTM2KXtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUodTApO31lbHNlIHt2YXIgY2g9dTAtNjU1MzY7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKDU1Mjk2fGNoPj4xMCw1NjMyMHxjaCYxMDIzKTt9fXJldHVybiBzdHJ9O3ZhciBVVEY4VG9TdHJpbmc9KHB0cixtYXhCeXRlc1RvUmVhZCk9PnB0cj9VVEY4QXJyYXlUb1N0cmluZyhIRUFQVTgscHRyLG1heEJ5dGVzVG9SZWFkKToiIjt2YXIgX19lbWJpbmRfcmVnaXN0ZXJfc3RkX3N0cmluZz0ocmF3VHlwZSxuYW1lKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTt2YXIgc3RkU3RyaW5nSXNVVEY4PW5hbWU9PT0ic3RkOjpzdHJpbmciO3JlZ2lzdGVyVHlwZShyYXdUeXBlLHtuYW1lOm5hbWUsImZyb21XaXJlVHlwZSIodmFsdWUpe3ZhciBsZW5ndGg9SEVBUFUzMlt2YWx1ZT4+Ml07dmFyIHBheWxvYWQ9dmFsdWUrNDt2YXIgc3RyO2lmKHN0ZFN0cmluZ0lzVVRGOCl7dmFyIGRlY29kZVN0YXJ0UHRyPXBheWxvYWQ7Zm9yKHZhciBpPTA7aTw9bGVuZ3RoOysraSl7dmFyIGN1cnJlbnRCeXRlUHRyPXBheWxvYWQraTtpZihpPT1sZW5ndGh8fEhFQVBVOFtjdXJyZW50Qnl0ZVB0cl09PTApe3ZhciBtYXhSZWFkPWN1cnJlbnRCeXRlUHRyLWRlY29kZVN0YXJ0UHRyO3ZhciBzdHJpbmdTZWdtZW50PVVURjhUb1N0cmluZyhkZWNvZGVTdGFydFB0cixtYXhSZWFkKTtpZihzdHI9PT11bmRlZmluZWQpe3N0cj1zdHJpbmdTZWdtZW50O31lbHNlIHtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoMCk7c3RyKz1zdHJpbmdTZWdtZW50O31kZWNvZGVTdGFydFB0cj1jdXJyZW50Qnl0ZVB0cisxO319fWVsc2Uge3ZhciBhPW5ldyBBcnJheShsZW5ndGgpO2Zvcih2YXIgaT0wO2k8bGVuZ3RoOysraSl7YVtpXT1TdHJpbmcuZnJvbUNoYXJDb2RlKEhFQVBVOFtwYXlsb2FkK2ldKTt9c3RyPWEuam9pbigiIik7fV9mcmVlKHZhbHVlKTtyZXR1cm4gc3RyfSwidG9XaXJlVHlwZSIoZGVzdHJ1Y3RvcnMsdmFsdWUpe2lmKHZhbHVlIGluc3RhbmNlb2YgQXJyYXlCdWZmZXIpe3ZhbHVlPW5ldyBVaW50OEFycmF5KHZhbHVlKTt9dmFyIGxlbmd0aDt2YXIgdmFsdWVJc09mVHlwZVN0cmluZz10eXBlb2YgdmFsdWU9PSJzdHJpbmciO2lmKCEodmFsdWVJc09mVHlwZVN0cmluZ3x8dmFsdWUgaW5zdGFuY2VvZiBVaW50OEFycmF5fHx2YWx1ZSBpbnN0YW5jZW9mIFVpbnQ4Q2xhbXBlZEFycmF5fHx2YWx1ZSBpbnN0YW5jZW9mIEludDhBcnJheSkpe3Rocm93QmluZGluZ0Vycm9yKCJDYW5ub3QgcGFzcyBub24tc3RyaW5nIHRvIHN0ZDo6c3RyaW5nIik7fWlmKHN0ZFN0cmluZ0lzVVRGOCYmdmFsdWVJc09mVHlwZVN0cmluZyl7bGVuZ3RoPWxlbmd0aEJ5dGVzVVRGOCh2YWx1ZSk7fWVsc2Uge2xlbmd0aD12YWx1ZS5sZW5ndGg7fXZhciBiYXNlPV9tYWxsb2MoNCtsZW5ndGgrMSk7dmFyIHB0cj1iYXNlKzQ7SEVBUFUzMltiYXNlPj4yXT1sZW5ndGg7aWYoc3RkU3RyaW5nSXNVVEY4JiZ2YWx1ZUlzT2ZUeXBlU3RyaW5nKXtzdHJpbmdUb1VURjgodmFsdWUscHRyLGxlbmd0aCsxKTt9ZWxzZSB7aWYodmFsdWVJc09mVHlwZVN0cmluZyl7Zm9yKHZhciBpPTA7aTxsZW5ndGg7KytpKXt2YXIgY2hhckNvZGU9dmFsdWUuY2hhckNvZGVBdChpKTtpZihjaGFyQ29kZT4yNTUpe19mcmVlKHB0cik7dGhyb3dCaW5kaW5nRXJyb3IoIlN0cmluZyBoYXMgVVRGLTE2IGNvZGUgdW5pdHMgdGhhdCBkbyBub3QgZml0IGluIDggYml0cyIpO31IRUFQVThbcHRyK2ldPWNoYXJDb2RlO319ZWxzZSB7Zm9yKHZhciBpPTA7aTxsZW5ndGg7KytpKXtIRUFQVThbcHRyK2ldPXZhbHVlW2ldO319fWlmKGRlc3RydWN0b3JzIT09bnVsbCl7ZGVzdHJ1Y3RvcnMucHVzaChfZnJlZSxiYXNlKTt9cmV0dXJuIGJhc2V9LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOnJlYWRQb2ludGVyLGRlc3RydWN0b3JGdW5jdGlvbihwdHIpe19mcmVlKHB0cik7fX0pO307dmFyIFVURjE2RGVjb2Rlcj10eXBlb2YgVGV4dERlY29kZXIhPSJ1bmRlZmluZWQiP25ldyBUZXh0RGVjb2RlcigidXRmLTE2bGUiKTp1bmRlZmluZWQ7dmFyIFVURjE2VG9TdHJpbmc9KHB0cixtYXhCeXRlc1RvUmVhZCk9Pnt2YXIgZW5kUHRyPXB0cjt2YXIgaWR4PWVuZFB0cj4+MTt2YXIgbWF4SWR4PWlkeCttYXhCeXRlc1RvUmVhZC8yO3doaWxlKCEoaWR4Pj1tYXhJZHgpJiZIRUFQVTE2W2lkeF0pKytpZHg7ZW5kUHRyPWlkeDw8MTtpZihlbmRQdHItcHRyPjMyJiZVVEYxNkRlY29kZXIpcmV0dXJuIFVURjE2RGVjb2Rlci5kZWNvZGUoSEVBUFU4LnN1YmFycmF5KHB0cixlbmRQdHIpKTt2YXIgc3RyPSIiO2Zvcih2YXIgaT0wOyEoaT49bWF4Qnl0ZXNUb1JlYWQvMik7KytpKXt2YXIgY29kZVVuaXQ9SEVBUDE2W3B0citpKjI+PjFdO2lmKGNvZGVVbml0PT0wKWJyZWFrO3N0cis9U3RyaW5nLmZyb21DaGFyQ29kZShjb2RlVW5pdCk7fXJldHVybiBzdHJ9O3ZhciBzdHJpbmdUb1VURjE2PShzdHIsb3V0UHRyLG1heEJ5dGVzVG9Xcml0ZSk9PnttYXhCeXRlc1RvV3JpdGU/Pz0yMTQ3NDgzNjQ3O2lmKG1heEJ5dGVzVG9Xcml0ZTwyKXJldHVybiAwO21heEJ5dGVzVG9Xcml0ZS09Mjt2YXIgc3RhcnRQdHI9b3V0UHRyO3ZhciBudW1DaGFyc1RvV3JpdGU9bWF4Qnl0ZXNUb1dyaXRlPHN0ci5sZW5ndGgqMj9tYXhCeXRlc1RvV3JpdGUvMjpzdHIubGVuZ3RoO2Zvcih2YXIgaT0wO2k8bnVtQ2hhcnNUb1dyaXRlOysraSl7dmFyIGNvZGVVbml0PXN0ci5jaGFyQ29kZUF0KGkpO0hFQVAxNltvdXRQdHI+PjFdPWNvZGVVbml0O291dFB0cis9Mjt9SEVBUDE2W291dFB0cj4+MV09MDtyZXR1cm4gb3V0UHRyLXN0YXJ0UHRyfTt2YXIgbGVuZ3RoQnl0ZXNVVEYxNj1zdHI9PnN0ci5sZW5ndGgqMjt2YXIgVVRGMzJUb1N0cmluZz0ocHRyLG1heEJ5dGVzVG9SZWFkKT0+e3ZhciBpPTA7dmFyIHN0cj0iIjt3aGlsZSghKGk+PW1heEJ5dGVzVG9SZWFkLzQpKXt2YXIgdXRmMzI9SEVBUDMyW3B0citpKjQ+PjJdO2lmKHV0ZjMyPT0wKWJyZWFrOysraTtpZih1dGYzMj49NjU1MzYpe3ZhciBjaD11dGYzMi02NTUzNjtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUoNTUyOTZ8Y2g+PjEwLDU2MzIwfGNoJjEwMjMpO31lbHNlIHtzdHIrPVN0cmluZy5mcm9tQ2hhckNvZGUodXRmMzIpO319cmV0dXJuIHN0cn07dmFyIHN0cmluZ1RvVVRGMzI9KHN0cixvdXRQdHIsbWF4Qnl0ZXNUb1dyaXRlKT0+e21heEJ5dGVzVG9Xcml0ZT8/PTIxNDc0ODM2NDc7aWYobWF4Qnl0ZXNUb1dyaXRlPDQpcmV0dXJuIDA7dmFyIHN0YXJ0UHRyPW91dFB0cjt2YXIgZW5kUHRyPXN0YXJ0UHRyK21heEJ5dGVzVG9Xcml0ZS00O2Zvcih2YXIgaT0wO2k8c3RyLmxlbmd0aDsrK2kpe3ZhciBjb2RlVW5pdD1zdHIuY2hhckNvZGVBdChpKTtpZihjb2RlVW5pdD49NTUyOTYmJmNvZGVVbml0PD01NzM0Myl7dmFyIHRyYWlsU3Vycm9nYXRlPXN0ci5jaGFyQ29kZUF0KCsraSk7Y29kZVVuaXQ9NjU1MzYrKChjb2RlVW5pdCYxMDIzKTw8MTApfHRyYWlsU3Vycm9nYXRlJjEwMjM7fUhFQVAzMltvdXRQdHI+PjJdPWNvZGVVbml0O291dFB0cis9NDtpZihvdXRQdHIrND5lbmRQdHIpYnJlYWt9SEVBUDMyW291dFB0cj4+Ml09MDtyZXR1cm4gb3V0UHRyLXN0YXJ0UHRyfTt2YXIgbGVuZ3RoQnl0ZXNVVEYzMj1zdHI9Pnt2YXIgbGVuPTA7Zm9yKHZhciBpPTA7aTxzdHIubGVuZ3RoOysraSl7dmFyIGNvZGVVbml0PXN0ci5jaGFyQ29kZUF0KGkpO2lmKGNvZGVVbml0Pj01NTI5NiYmY29kZVVuaXQ8PTU3MzQzKSsraTtsZW4rPTQ7fXJldHVybiBsZW59O3ZhciBfX2VtYmluZF9yZWdpc3Rlcl9zdGRfd3N0cmluZz0ocmF3VHlwZSxjaGFyU2l6ZSxuYW1lKT0+e25hbWU9cmVhZExhdGluMVN0cmluZyhuYW1lKTt2YXIgZGVjb2RlU3RyaW5nLGVuY29kZVN0cmluZyxyZWFkQ2hhckF0LGxlbmd0aEJ5dGVzVVRGO2lmKGNoYXJTaXplPT09Mil7ZGVjb2RlU3RyaW5nPVVURjE2VG9TdHJpbmc7ZW5jb2RlU3RyaW5nPXN0cmluZ1RvVVRGMTY7bGVuZ3RoQnl0ZXNVVEY9bGVuZ3RoQnl0ZXNVVEYxNjtyZWFkQ2hhckF0PXBvaW50ZXI9PkhFQVBVMTZbcG9pbnRlcj4+MV07fWVsc2UgaWYoY2hhclNpemU9PT00KXtkZWNvZGVTdHJpbmc9VVRGMzJUb1N0cmluZztlbmNvZGVTdHJpbmc9c3RyaW5nVG9VVEYzMjtsZW5ndGhCeXRlc1VURj1sZW5ndGhCeXRlc1VURjMyO3JlYWRDaGFyQXQ9cG9pbnRlcj0+SEVBUFUzMltwb2ludGVyPj4yXTt9cmVnaXN0ZXJUeXBlKHJhd1R5cGUse25hbWU6bmFtZSwiZnJvbVdpcmVUeXBlIjp2YWx1ZT0+e3ZhciBsZW5ndGg9SEVBUFUzMlt2YWx1ZT4+Ml07dmFyIHN0cjt2YXIgZGVjb2RlU3RhcnRQdHI9dmFsdWUrNDtmb3IodmFyIGk9MDtpPD1sZW5ndGg7KytpKXt2YXIgY3VycmVudEJ5dGVQdHI9dmFsdWUrNCtpKmNoYXJTaXplO2lmKGk9PWxlbmd0aHx8cmVhZENoYXJBdChjdXJyZW50Qnl0ZVB0cik9PTApe3ZhciBtYXhSZWFkQnl0ZXM9Y3VycmVudEJ5dGVQdHItZGVjb2RlU3RhcnRQdHI7dmFyIHN0cmluZ1NlZ21lbnQ9ZGVjb2RlU3RyaW5nKGRlY29kZVN0YXJ0UHRyLG1heFJlYWRCeXRlcyk7aWYoc3RyPT09dW5kZWZpbmVkKXtzdHI9c3RyaW5nU2VnbWVudDt9ZWxzZSB7c3RyKz1TdHJpbmcuZnJvbUNoYXJDb2RlKDApO3N0cis9c3RyaW5nU2VnbWVudDt9ZGVjb2RlU3RhcnRQdHI9Y3VycmVudEJ5dGVQdHIrY2hhclNpemU7fX1fZnJlZSh2YWx1ZSk7cmV0dXJuIHN0cn0sInRvV2lyZVR5cGUiOihkZXN0cnVjdG9ycyx2YWx1ZSk9PntpZighKHR5cGVvZiB2YWx1ZT09InN0cmluZyIpKXt0aHJvd0JpbmRpbmdFcnJvcihgQ2Fubm90IHBhc3Mgbm9uLXN0cmluZyB0byBDKysgc3RyaW5nIHR5cGUgJHtuYW1lfWApO312YXIgbGVuZ3RoPWxlbmd0aEJ5dGVzVVRGKHZhbHVlKTt2YXIgcHRyPV9tYWxsb2MoNCtsZW5ndGgrY2hhclNpemUpO0hFQVBVMzJbcHRyPj4yXT1sZW5ndGgvY2hhclNpemU7ZW5jb2RlU3RyaW5nKHZhbHVlLHB0cis0LGxlbmd0aCtjaGFyU2l6ZSk7aWYoZGVzdHJ1Y3RvcnMhPT1udWxsKXtkZXN0cnVjdG9ycy5wdXNoKF9mcmVlLHB0cik7fXJldHVybiBwdHJ9LCJhcmdQYWNrQWR2YW5jZSI6R2VuZXJpY1dpcmVUeXBlU2l6ZSwicmVhZFZhbHVlRnJvbVBvaW50ZXIiOnJlYWRQb2ludGVyLGRlc3RydWN0b3JGdW5jdGlvbihwdHIpe19mcmVlKHB0cik7fX0pO307dmFyIF9fZW1iaW5kX3JlZ2lzdGVyX3ZvaWQ9KHJhd1R5cGUsbmFtZSk9PntuYW1lPXJlYWRMYXRpbjFTdHJpbmcobmFtZSk7cmVnaXN0ZXJUeXBlKHJhd1R5cGUse2lzVm9pZDp0cnVlLG5hbWU6bmFtZSwiYXJnUGFja0FkdmFuY2UiOjAsImZyb21XaXJlVHlwZSI6KCk9PnVuZGVmaW5lZCwidG9XaXJlVHlwZSI6KGRlc3RydWN0b3JzLG8pPT51bmRlZmluZWR9KTt9O3ZhciBnZXRIZWFwTWF4PSgpPT4yMTQ3NDgzNjQ4O3ZhciBncm93TWVtb3J5PXNpemU9Pnt2YXIgYj13YXNtTWVtb3J5LmJ1ZmZlcjt2YXIgcGFnZXM9KHNpemUtYi5ieXRlTGVuZ3RoKzY1NTM1KS82NTUzNjt0cnl7d2FzbU1lbW9yeS5ncm93KHBhZ2VzKTt1cGRhdGVNZW1vcnlWaWV3cygpO3JldHVybiAxfWNhdGNoKGUpe319O3ZhciBfZW1zY3JpcHRlbl9yZXNpemVfaGVhcD1yZXF1ZXN0ZWRTaXplPT57dmFyIG9sZFNpemU9SEVBUFU4Lmxlbmd0aDtyZXF1ZXN0ZWRTaXplPj4+PTA7dmFyIG1heEhlYXBTaXplPWdldEhlYXBNYXgoKTtpZihyZXF1ZXN0ZWRTaXplPm1heEhlYXBTaXplKXtyZXR1cm4gZmFsc2V9dmFyIGFsaWduVXA9KHgsbXVsdGlwbGUpPT54KyhtdWx0aXBsZS14JW11bHRpcGxlKSVtdWx0aXBsZTtmb3IodmFyIGN1dERvd249MTtjdXREb3duPD00O2N1dERvd24qPTIpe3ZhciBvdmVyR3Jvd25IZWFwU2l6ZT1vbGRTaXplKigxKy4yL2N1dERvd24pO292ZXJHcm93bkhlYXBTaXplPU1hdGgubWluKG92ZXJHcm93bkhlYXBTaXplLHJlcXVlc3RlZFNpemUrMTAwNjYzMjk2KTt2YXIgbmV3U2l6ZT1NYXRoLm1pbihtYXhIZWFwU2l6ZSxhbGlnblVwKE1hdGgubWF4KHJlcXVlc3RlZFNpemUsb3Zlckdyb3duSGVhcFNpemUpLDY1NTM2KSk7dmFyIHJlcGxhY2VtZW50PWdyb3dNZW1vcnkobmV3U2l6ZSk7aWYocmVwbGFjZW1lbnQpe3JldHVybiB0cnVlfX1yZXR1cm4gZmFsc2V9O2VtYmluZF9pbml0X2NoYXJDb2RlcygpO0JpbmRpbmdFcnJvcj1Nb2R1bGVbIkJpbmRpbmdFcnJvciJdPWNsYXNzIEJpbmRpbmdFcnJvciBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKG1lc3NhZ2Upe3N1cGVyKG1lc3NhZ2UpO3RoaXMubmFtZT0iQmluZGluZ0Vycm9yIjt9fTtNb2R1bGVbIkludGVybmFsRXJyb3IiXT1jbGFzcyBJbnRlcm5hbEVycm9yIGV4dGVuZHMgRXJyb3J7Y29uc3RydWN0b3IobWVzc2FnZSl7c3VwZXIobWVzc2FnZSk7dGhpcy5uYW1lPSJJbnRlcm5hbEVycm9yIjt9fTtpbml0X2VtdmFsKCk7dmFyIHdhc21JbXBvcnRzPXtmOl9fZW1iaW5kX3JlZ2lzdGVyX2JpZ2ludCxpOl9fZW1iaW5kX3JlZ2lzdGVyX2Jvb2wsaDpfX2VtYmluZF9yZWdpc3Rlcl9lbXZhbCxlOl9fZW1iaW5kX3JlZ2lzdGVyX2Zsb2F0LGI6X19lbWJpbmRfcmVnaXN0ZXJfaW50ZWdlcixhOl9fZW1iaW5kX3JlZ2lzdGVyX21lbW9yeV92aWV3LGQ6X19lbWJpbmRfcmVnaXN0ZXJfc3RkX3N0cmluZyxjOl9fZW1iaW5kX3JlZ2lzdGVyX3N0ZF93c3RyaW5nLGo6X19lbWJpbmRfcmVnaXN0ZXJfdm9pZCxnOl9lbXNjcmlwdGVuX3Jlc2l6ZV9oZWFwfTt2YXIgd2FzbUV4cG9ydHM9Y3JlYXRlV2FzbSgpO01vZHVsZVsiX3BhY2siXT0oYTAsYTEsYTIsYTMsYTQsYTUsYTYsYTcsYTgsYTksYTEwKT0+KE1vZHVsZVsiX3BhY2siXT13YXNtRXhwb3J0c1sibSJdKShhMCxhMSxhMixhMyxhNCxhNSxhNixhNyxhOCxhOSxhMTApO3ZhciBfbWFsbG9jPU1vZHVsZVsiX21hbGxvYyJdPWEwPT4oX21hbGxvYz1Nb2R1bGVbIl9tYWxsb2MiXT13YXNtRXhwb3J0c1sibyJdKShhMCk7dmFyIF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT1hMD0+KF9mcmVlPU1vZHVsZVsiX2ZyZWUiXT13YXNtRXhwb3J0c1sicCJdKShhMCk7dmFyIGNhbGxlZFJ1bjtkZXBlbmRlbmNpZXNGdWxmaWxsZWQ9ZnVuY3Rpb24gcnVuQ2FsbGVyKCl7aWYoIWNhbGxlZFJ1bilydW4oKTtpZighY2FsbGVkUnVuKWRlcGVuZGVuY2llc0Z1bGZpbGxlZD1ydW5DYWxsZXI7fTtmdW5jdGlvbiBydW4oKXtpZihydW5EZXBlbmRlbmNpZXM+MCl7cmV0dXJufXByZVJ1bigpO2lmKHJ1bkRlcGVuZGVuY2llcz4wKXtyZXR1cm59ZnVuY3Rpb24gZG9SdW4oKXtpZihjYWxsZWRSdW4pcmV0dXJuO2NhbGxlZFJ1bj10cnVlO01vZHVsZVsiY2FsbGVkUnVuIl09dHJ1ZTtpZihBQk9SVClyZXR1cm47aW5pdFJ1bnRpbWUoKTtyZWFkeVByb21pc2VSZXNvbHZlKE1vZHVsZSk7aWYoTW9kdWxlWyJvblJ1bnRpbWVJbml0aWFsaXplZCJdKU1vZHVsZVsib25SdW50aW1lSW5pdGlhbGl6ZWQiXSgpO3Bvc3RSdW4oKTt9aWYoTW9kdWxlWyJzZXRTdGF0dXMiXSl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiUnVubmluZy4uLiIpO3NldFRpbWVvdXQoZnVuY3Rpb24oKXtzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7TW9kdWxlWyJzZXRTdGF0dXMiXSgiIik7fSwxKTtkb1J1bigpO30sMSk7fWVsc2Uge2RvUnVuKCk7fX1pZihNb2R1bGVbInByZUluaXQiXSl7aWYodHlwZW9mIE1vZHVsZVsicHJlSW5pdCJdPT0iZnVuY3Rpb24iKU1vZHVsZVsicHJlSW5pdCJdPVtNb2R1bGVbInByZUluaXQiXV07d2hpbGUoTW9kdWxlWyJwcmVJbml0Il0ubGVuZ3RoPjApe01vZHVsZVsicHJlSW5pdCJdLnBvcCgpKCk7fX1ydW4oKTsKCgogICAgcmV0dXJuIG1vZHVsZUFyZy5yZWFkeQogIH0KICApOwogIH0pKCk7CgogIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55CiAgbGV0IHdhc21Nb2R1bGU7CiAgYXN5bmMgZnVuY3Rpb24gaW5pdFdhc20oKSB7CiAgICAgIHdhc21Nb2R1bGUgPSBhd2FpdCBsb2FkV2FzbSgpOwogIH0KICBsZXQgYWxsb2NhdGVkVmVydGV4Q291bnQgPSAwOwogIGNvbnN0IHVwZGF0ZVF1ZXVlID0gbmV3IEFycmF5KCk7CiAgbGV0IHJ1bm5pbmcgPSBmYWxzZTsKICBsZXQgbG9hZGluZyA9IGZhbHNlOwogIGxldCBwb3NpdGlvbnNQdHI7CiAgbGV0IHJvdGF0aW9uc1B0cjsKICBsZXQgc2NhbGVzUHRyOwogIGxldCBjb2xvcnNQdHI7CiAgbGV0IHNlbGVjdGlvblB0cjsKICBsZXQgZGF0YVB0cjsKICBsZXQgd29ybGRQb3NpdGlvbnNQdHI7CiAgbGV0IHdvcmxkUm90YXRpb25zUHRyOwogIGxldCB3b3JsZFNjYWxlc1B0cjsKICBjb25zdCBwYWNrID0gYXN5bmMgKHNwbGF0KSA9PiB7CiAgICAgIHdoaWxlIChsb2FkaW5nKSB7CiAgICAgICAgICBhd2FpdCBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gc2V0VGltZW91dChyZXNvbHZlLCAwKSk7CiAgICAgIH0KICAgICAgaWYgKCF3YXNtTW9kdWxlKSB7CiAgICAgICAgICBsb2FkaW5nID0gdHJ1ZTsKICAgICAgICAgIGF3YWl0IGluaXRXYXNtKCk7CiAgICAgICAgICBsb2FkaW5nID0gZmFsc2U7CiAgICAgIH0KICAgICAgY29uc3QgdGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQgPSBNYXRoLnBvdygyLCBNYXRoLmNlaWwoTWF0aC5sb2cyKHNwbGF0LnZlcnRleENvdW50KSkpOwogICAgICBpZiAodGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQgPiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCkgewogICAgICAgICAgaWYgKGFsbG9jYXRlZFZlcnRleENvdW50ID4gMCkgewogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUocG9zaXRpb25zUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHJvdGF0aW9uc1B0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShzY2FsZXNQdHIpOwogICAgICAgICAgICAgIHdhc21Nb2R1bGUuX2ZyZWUoY29sb3JzUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHNlbGVjdGlvblB0cik7CiAgICAgICAgICAgICAgd2FzbU1vZHVsZS5fZnJlZShkYXRhUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHdvcmxkUG9zaXRpb25zUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHdvcmxkUm90YXRpb25zUHRyKTsKICAgICAgICAgICAgICB3YXNtTW9kdWxlLl9mcmVlKHdvcmxkU2NhbGVzUHRyKTsKICAgICAgICAgIH0KICAgICAgICAgIGFsbG9jYXRlZFZlcnRleENvdW50ID0gdGFyZ2V0QWxsb2NhdGVkVmVydGV4Q291bnQ7CiAgICAgICAgICBwb3NpdGlvbnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoMyAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICByb3RhdGlvbnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoNCAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBzY2FsZXNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoMyAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICBjb2xvcnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoNCAqIGFsbG9jYXRlZFZlcnRleENvdW50KTsKICAgICAgICAgIHNlbGVjdGlvblB0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyhhbGxvY2F0ZWRWZXJ0ZXhDb3VudCk7CiAgICAgICAgICBkYXRhUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKDggKiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICAgICAgd29ybGRQb3NpdGlvbnNQdHIgPSB3YXNtTW9kdWxlLl9tYWxsb2MoMyAqIGFsbG9jYXRlZFZlcnRleENvdW50ICogNCk7CiAgICAgICAgICB3b3JsZFJvdGF0aW9uc1B0ciA9IHdhc21Nb2R1bGUuX21hbGxvYyg0ICogYWxsb2NhdGVkVmVydGV4Q291bnQgKiA0KTsKICAgICAgICAgIHdvcmxkU2NhbGVzUHRyID0gd2FzbU1vZHVsZS5fbWFsbG9jKDMgKiBhbGxvY2F0ZWRWZXJ0ZXhDb3VudCAqIDQpOwogICAgICB9CiAgICAgIHdhc21Nb2R1bGUuSEVBUEYzMi5zZXQoc3BsYXQucG9zaXRpb25zLCBwb3NpdGlvbnNQdHIgLyA0KTsKICAgICAgd2FzbU1vZHVsZS5IRUFQRjMyLnNldChzcGxhdC5yb3RhdGlvbnMsIHJvdGF0aW9uc1B0ciAvIDQpOwogICAgICB3YXNtTW9kdWxlLkhFQVBGMzIuc2V0KHNwbGF0LnNjYWxlcywgc2NhbGVzUHRyIC8gNCk7CiAgICAgIHdhc21Nb2R1bGUuSEVBUFU4LnNldChzcGxhdC5jb2xvcnMsIGNvbG9yc1B0cik7CiAgICAgIHdhc21Nb2R1bGUuSEVBUFU4LnNldChzcGxhdC5zZWxlY3Rpb24sIHNlbGVjdGlvblB0cik7CiAgICAgIHdhc21Nb2R1bGUuX3BhY2soc3BsYXQuc2VsZWN0ZWQsIHNwbGF0LnZlcnRleENvdW50LCBwb3NpdGlvbnNQdHIsIHJvdGF0aW9uc1B0ciwgc2NhbGVzUHRyLCBjb2xvcnNQdHIsIHNlbGVjdGlvblB0ciwgZGF0YVB0ciwgd29ybGRQb3NpdGlvbnNQdHIsIHdvcmxkUm90YXRpb25zUHRyLCB3b3JsZFNjYWxlc1B0cik7CiAgICAgIGNvbnN0IG91dERhdGEgPSBuZXcgVWludDMyQXJyYXkod2FzbU1vZHVsZS5IRUFQVTMyLmJ1ZmZlciwgZGF0YVB0ciwgc3BsYXQudmVydGV4Q291bnQgKiA4KTsKICAgICAgY29uc3QgZGV0YWNoZWREYXRhID0gbmV3IFVpbnQzMkFycmF5KG91dERhdGEuc2xpY2UoKS5idWZmZXIpOwogICAgICBjb25zdCB3b3JsZFBvc2l0aW9ucyA9IG5ldyBGbG9hdDMyQXJyYXkod2FzbU1vZHVsZS5IRUFQRjMyLmJ1ZmZlciwgd29ybGRQb3NpdGlvbnNQdHIsIHNwbGF0LnZlcnRleENvdW50ICogMyk7CiAgICAgIGNvbnN0IGRldGFjaGVkV29ybGRQb3NpdGlvbnMgPSBuZXcgRmxvYXQzMkFycmF5KHdvcmxkUG9zaXRpb25zLnNsaWNlKCkuYnVmZmVyKTsKICAgICAgY29uc3Qgd29ybGRSb3RhdGlvbnMgPSBuZXcgRmxvYXQzMkFycmF5KHdhc21Nb2R1bGUuSEVBUEYzMi5idWZmZXIsIHdvcmxkUm90YXRpb25zUHRyLCBzcGxhdC52ZXJ0ZXhDb3VudCAqIDQpOwogICAgICBjb25zdCBkZXRhY2hlZFdvcmxkUm90YXRpb25zID0gbmV3IEZsb2F0MzJBcnJheSh3b3JsZFJvdGF0aW9ucy5zbGljZSgpLmJ1ZmZlcik7CiAgICAgIGNvbnN0IHdvcmxkU2NhbGVzID0gbmV3IEZsb2F0MzJBcnJheSh3YXNtTW9kdWxlLkhFQVBGMzIuYnVmZmVyLCB3b3JsZFNjYWxlc1B0ciwgc3BsYXQudmVydGV4Q291bnQgKiAzKTsKICAgICAgY29uc3QgZGV0YWNoZWRXb3JsZFNjYWxlcyA9IG5ldyBGbG9hdDMyQXJyYXkod29ybGRTY2FsZXMuc2xpY2UoKS5idWZmZXIpOwogICAgICBjb25zdCByZXNwb25zZSA9IHsKICAgICAgICAgIGRhdGE6IGRldGFjaGVkRGF0YSwKICAgICAgICAgIHdvcmxkUG9zaXRpb25zOiBkZXRhY2hlZFdvcmxkUG9zaXRpb25zLAogICAgICAgICAgd29ybGRSb3RhdGlvbnM6IGRldGFjaGVkV29ybGRSb3RhdGlvbnMsCiAgICAgICAgICB3b3JsZFNjYWxlczogZGV0YWNoZWRXb3JsZFNjYWxlcywKICAgICAgICAgIG9mZnNldDogc3BsYXQub2Zmc2V0LAogICAgICAgICAgdmVydGV4Q291bnQ6IHNwbGF0LnZlcnRleENvdW50LAogICAgICAgICAgcG9zaXRpb25zOiBzcGxhdC5wb3NpdGlvbnMuYnVmZmVyLAogICAgICAgICAgcm90YXRpb25zOiBzcGxhdC5yb3RhdGlvbnMuYnVmZmVyLAogICAgICAgICAgc2NhbGVzOiBzcGxhdC5zY2FsZXMuYnVmZmVyLAogICAgICAgICAgY29sb3JzOiBzcGxhdC5jb2xvcnMuYnVmZmVyLAogICAgICAgICAgc2VsZWN0aW9uOiBzcGxhdC5zZWxlY3Rpb24uYnVmZmVyLAogICAgICB9OwogICAgICBzZWxmLnBvc3RNZXNzYWdlKHsgcmVzcG9uc2U6IHJlc3BvbnNlIH0sIFsKICAgICAgICAgIHJlc3BvbnNlLmRhdGEuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2Uud29ybGRQb3NpdGlvbnMuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2Uud29ybGRSb3RhdGlvbnMuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2Uud29ybGRTY2FsZXMuYnVmZmVyLAogICAgICAgICAgcmVzcG9uc2UucG9zaXRpb25zLAogICAgICAgICAgcmVzcG9uc2Uucm90YXRpb25zLAogICAgICAgICAgcmVzcG9uc2Uuc2NhbGVzLAogICAgICAgICAgcmVzcG9uc2UuY29sb3JzLAogICAgICAgICAgcmVzcG9uc2Uuc2VsZWN0aW9uLAogICAgICBdKTsKICAgICAgcnVubmluZyA9IGZhbHNlOwogIH07CiAgY29uc3QgcGFja1Rocm90dGxlZCA9ICgpID0+IHsKICAgICAgaWYgKHVwZGF0ZVF1ZXVlLmxlbmd0aCA9PT0gMCkKICAgICAgICAgIHJldHVybjsKICAgICAgaWYgKCFydW5uaW5nKSB7CiAgICAgICAgICBydW5uaW5nID0gdHJ1ZTsKICAgICAgICAgIGNvbnN0IHNwbGF0ID0gdXBkYXRlUXVldWUuc2hpZnQoKTsKICAgICAgICAgIHBhY2soc3BsYXQpOwogICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlOwogICAgICAgICAgICAgIHBhY2tUaHJvdHRsZWQoKTsKICAgICAgICAgIH0sIDApOwogICAgICB9CiAgfTsKICBzZWxmLm9ubWVzc2FnZSA9IChlKSA9PiB7CiAgICAgIGlmIChlLmRhdGEuc3BsYXQpIHsKICAgICAgICAgIGNvbnN0IHNwbGF0ID0gZS5kYXRhLnNwbGF0OwogICAgICAgICAgZm9yIChjb25zdCBbaW5kZXgsIGV4aXN0aW5nXSBvZiB1cGRhdGVRdWV1ZS5lbnRyaWVzKCkpIHsKICAgICAgICAgICAgICBpZiAoZXhpc3Rpbmcub2Zmc2V0ID09PSBzcGxhdC5vZmZzZXQpIHsKICAgICAgICAgICAgICAgICAgdXBkYXRlUXVldWVbaW5kZXhdID0gc3BsYXQ7CiAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICB1cGRhdGVRdWV1ZS5wdXNoKHNwbGF0KTsKICAgICAgICAgIHBhY2tUaHJvdHRsZWQoKTsKICAgICAgfQogIH07Cgp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1EYXRhV29ya2VyLmpzLm1hcAoK\", null, !1), dF = function(r = {}) {\n  var U, l, F = r;\n  F.ready = new Promise((n, A) => {\n    U = n, l = A;\n  });\n  var Q, Z = Object.assign({}, F), d = \"\";\n  d = (d = self.location.href).startsWith(\"blob:\") ? \"\" : d.substr(0, d.replace(/[?#].*/, \"\").lastIndexOf(\"/\") + 1), Q = (n) => {\n    var A = new XMLHttpRequest();\n    return A.open(\"GET\", n, !1), A.responseType = \"arraybuffer\", A.send(null), new Uint8Array(A.response);\n  }, F.print || console.log.bind(console);\n  var V, B, t = F.printErr || console.error.bind(console);\n  function R(n) {\n    if (nU(n))\n      return function(A) {\n        for (var e = atob(A), W = new Uint8Array(e.length), h = 0; h < e.length; ++h)\n          W[h] = e.charCodeAt(h);\n        return W;\n      }(n.slice(RU.length));\n  }\n  Object.assign(F, Z), Z = null, F.arguments && F.arguments, F.thisProgram && F.thisProgram, F.quit && F.quit, F.wasmBinary && (V = F.wasmBinary), typeof WebAssembly != \"object\" && u(\"no native wasm support detected\");\n  var i, s, J, c, N, o, X, G, E = !1;\n  function Y() {\n    var n = B.buffer;\n    F.HEAP8 = i = new Int8Array(n), F.HEAP16 = J = new Int16Array(n), F.HEAPU8 = s = new Uint8Array(n), F.HEAPU16 = c = new Uint16Array(n), F.HEAP32 = N = new Int32Array(n), F.HEAPU32 = o = new Uint32Array(n), F.HEAPF32 = X = new Float32Array(n), F.HEAPF64 = G = new Float64Array(n);\n  }\n  var x = [], v = [], D = [], p = 0, I = null;\n  function u(n) {\n    var e;\n    (e = F.onAbort) == null || e.call(F, n), t(n = \"Aborted(\" + n + \")\"), E = !0, n += \". Build with -sASSERTIONS for more info.\";\n    var A = new WebAssembly.RuntimeError(n);\n    throw l(A), A;\n  }\n  var q, ZU, RU = \"data:application/octet-stream;base64,\", nU = (n) => n.startsWith(RU);\n  function j(n) {\n    return Promise.resolve().then(() => function(A) {\n      if (A == q && V)\n        return new Uint8Array(V);\n      var e = R(A);\n      if (e)\n        return e;\n      if (Q)\n        return Q(A);\n      throw \"both async and sync fetching of the wasm failed\";\n    }(n));\n  }\n  function a(n, A, e, W) {\n    return function(h, b, C) {\n      return j(h).then((m) => WebAssembly.instantiate(m, b)).then(C, (m) => {\n        t(`failed to asynchronously prepare wasm: ${m}`), u(m);\n      });\n    }(A, e, W);\n  }\n  nU(q = \"data:application/octet-stream;base64,AGFzbQEAAAABZw9gBH9/f38AYAN/f38AYAV/f39/fwBgBn9/f39/fwBgAX8Bf2ABfwBgAn9/AGADf39/AX9gAABgB39/f39/f38AYAJ9fQF/YAR/f35+AGABfQF/YAt/f39/f39/f39/fwBgAn9/AX8CPQoBYQFhAAEBYQFiAAIBYQFjAAEBYQFkAAYBYQFlAAEBYQFmAAkBYQFnAAQBYQFoAAUBYQFpAAABYQFqAAYDGxoHBAoFCAUGCAsBAAEFDAQEDQMDAgIAAA4HBwQFAXABEBAFBwEBgAKAgAIGCAF/AUGwngQLBxkGAWsCAAFsAA4BbQAaAW4BAAFvABkBcAAPCRUBAEEBCw8RGA0WFiMNIhsdIA0cHh8K6VAacQEBfyACRQRAIAAoAgQgASgCBEYPCyAAIAFGBEBBAQ8LAkAgACgCBCICLQAAIgBFIAAgASgCBCIBLQAAIgNHcg0AA0AgAS0AASEDIAItAAEiAEUNASABQQFqIQEgAkEBaiECIAAgA0YNAAsLIAAgA0YLTwECf0GoGigCACIBIABBB2pBeHEiAmohAAJAIAJBACAAIAFNG0UEQCAAPwBBEHRNDQEgABAGDQELQbgaQTA2AgBBfw8LQagaIAA2AgAgAQsOACAAEBcgARAXQRB0cgsGACAAEA8LKQBBsBpBATYCAEG0GkEANgIAEBFBtBpBrBooAgA2AgBBrBpBsBo2AgAL2QsBB38CQCAARQ0AIABBCGsiAyAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQJxRQ0BIAMgAygCACIBayIDQcwaKAIASQ0BIAAgAWohAAJAAkBB0BooAgAgA0cEQCADKAIMIQIgAUH/AU0EQCABQQN2IQEgAygCCCIEIAJGBEBBvBpBvBooAgBBfiABd3E2AgAMBQsgBCACNgIMIAIgBDYCCAwECyADKAIYIQYgAiADRwRAIAMoAggiASACNgIMIAIgATYCCAwDCyADKAIUIgEEfyADQRRqBSADKAIQIgFFDQIgA0EQagshBANAIAQhByABIgJBFGohBCACKAIUIgENACACQRBqIQQgAigCECIBDQALIAdBADYCAAwCCyAFKAIEIgFBA3FBA0cNAkHEGiAANgIAIAUgAUF+cTYCBCADIABBAXI2AgQgBSAANgIADwtBACECCyAGRQ0AAkAgAygCHCIBQQJ0QewcaiIEKAIAIANGBEAgBCACNgIAIAINAUHAGkHAGigCAEF+IAF3cTYCAAwCCyAGQRBBFCAGKAIQIANGG2ogAjYCACACRQ0BCyACIAY2AhggAygCECIBBEAgAiABNgIQIAEgAjYCGAsgAygCFCIBRQ0AIAIgATYCFCABIAI2AhgLIAMgBU8NACAFKAIEIgFBAXFFDQACQAJAAkACQCABQQJxRQRAQdQaKAIAIAVGBEBB1BogAzYCAEHIGkHIGigCACAAaiIANgIAIAMgAEEBcjYCBCADQdAaKAIARw0GQcQaQQA2AgBB0BpBADYCAA8LQdAaKAIAIAVGBEBB0BogAzYCAEHEGkHEGigCACAAaiIANgIAIAMgAEEBcjYCBCAAIANqIAA2AgAPCyABQXhxIABqIQAgBSgCDCECIAFB/wFNBEAgAUEDdiEBIAUoAggiBCACRgRAQbwaQbwaKAIAQX4gAXdxNgIADAULIAQgAjYCDCACIAQ2AggMBAsgBSgCGCEGIAIgBUcEQEHMGigCABogBSgCCCIBIAI2AgwgAiABNgIIDAMLIAUoAhQiAQR/IAVBFGoFIAUoAhAiAUUNAiAFQRBqCyEEA0AgBCEHIAEiAkEUaiEEIAIoAhQiAQ0AIAJBEGohBCACKAIQIgENAAsgB0EANgIADAILIAUgAUF+cTYCBCADIABBAXI2AgQgACADaiAANgIADAMLQQAhAgsgBkUNAAJAIAUoAhwiAUECdEHsHGoiBCgCACAFRgRAIAQgAjYCACACDQFBwBpBwBooAgBBfiABd3E2AgAMAgsgBkEQQRQgBigCECAFRhtqIAI2AgAgAkUNAQsgAiAGNgIYIAUoAhAiAQRAIAIgATYCECABIAI2AhgLIAUoAhQiAUUNACACIAE2AhQgASACNgIYCyADIABBAXI2AgQgACADaiAANgIAIANB0BooAgBHDQBBxBogADYCAA8LIABB/wFNBEAgAEF4cUHkGmohAQJ/QbwaKAIAIgRBASAAQQN2dCIAcUUEQEG8GiAAIARyNgIAIAEMAQsgASgCCAshACABIAM2AgggACADNgIMIAMgATYCDCADIAA2AggPC0EfIQIgAEH///8HTQRAIABBJiAAQQh2ZyIBa3ZBAXEgAUEBdGtBPmohAgsgAyACNgIcIANCADcCECACQQJ0QewcaiEHAn8CQAJ/QcAaKAIAIgFBASACdCIEcUUEQEHAGiABIARyNgIAQRghAiAHIQRBCAwBCyAAQRkgAkEBdmtBACACQR9HG3QhAiAHKAIAIQQDQCAEIgEoAgRBeHEgAEYNAiACQR12IQQgAkEBdCECIAEgBEEEcWpBEGoiBygCACIEDQALQRghAiABIQRBCAshACADIgEMAQsgASgCCCIEIAM2AgxBCCECIAFBCGohB0EYIQBBAAshBSAHIAM2AgAgAiADaiAENgIAIAMgATYCDCAAIANqIAU2AgBB3BpB3BooAgBBAWsiAEF/IAAbNgIACwshACABBEADQCAAQQA6AAAgAEEBaiEAIAFBAWsiAQ0ACwsL3gMAQdwXQYoJEAlB6BdBuQhBAUEAEAhB9BdBtAhBAUGAf0H/ABABQYwYQa0IQQFBgH9B/wAQAUGAGEGrCEEBQQBB/wEQAUGYGEGJCEECQYCAfkH//wEQAUGkGEGACEECQQBB//8DEAFBsBhBmAhBBEGAgICAeEH/////BxABQbwYQY8IQQRBAEF/EAFByBhBxwhBBEGAgICAeEH/////BxABQdQYQb4IQQRBAEF/EAFB4BhBowhCgICAgICAgICAf0L///////////8AEBJB7BhBoghCAEJ/EBJB+BhBnAhBBBAEQYQZQYMJQQgQBEH0DkHZCBADQbwPQYcNEANBhBBBBEHMCBACQdAQQQJB5QgQAkGcEUEEQfQIEAJBuBEQB0HgEUEAQcIMEABBiBJBAEGoDRAAQbASQQFB4AwQAEHYEkECQY8JEABBgBNBA0GuCRAAQagTQQRB1gkQAEHQE0EFQfMJEABB+BNBBEHNDRAAQaAUQQVB6w0QAEGIEkEAQdkKEABBsBJBAUG4ChAAQdgSQQJBmwsQAEGAE0EDQfkKEABBqBNBBEGhDBAAQdATQQVB/wsQAEHIFEEIQd4LEABB8BRBCUG8CxAAQZgVQQZBmQoQAEHAFUEHQZIOEAALHAAgACABQQggAqcgAkIgiKcgA6cgA0IgiKcQBQsgAAJAIAAoAgQgAUcNACAAKAIcQQFGDQAgACACNgIcCwuaAQAgAEEBOgA1AkAgACgCBCACRw0AIABBAToANAJAIAAoAhAiAkUEQCAAQQE2AiQgACADNgIYIAAgATYCECADQQFHDQIgACgCMEEBRg0BDAILIAEgAkYEQCAAKAIYIgJBAkYEQCAAIAM2AhggAyECCyAAKAIwQQFHDQIgAkEBRg0BDAILIAAgACgCJEEBajYCJAsgAEEBOgA2CwtdAQF/IAAoAhAiA0UEQCAAQQE2AiQgACACNgIYIAAgATYCEA8LAkAgASADRgRAIAAoAhhBAkcNASAAIAI2AhgPCyAAQQE6ADYgAEECNgIYIAAgACgCJEEBajYCJAsLAgALdwEEfyAAvCIEQf///wNxIQECQCAEQRd2Qf8BcSICRQ0AIAJB8ABNBEAgAUGAgIAEckHxACACa3YhAQwBCyACQY0BSwRAQYD4ASEDQQAhAQwBCyACQQp0QYCAB2shAwsgAyAEQRB2QYCAAnFyIAFBDXZyQf//A3ELBAAgAAvXJwEMfyMAQRBrIgokAAJAAkACQAJAAkACQAJAAkACQAJAIABB9AFNBEBBvBooAgAiBEEQIABBC2pB+ANxIABBC0kbIgZBA3YiAHYiAUEDcQRAAkAgAUF/c0EBcSAAaiICQQN0IgFB5BpqIgAgAUHsGmooAgAiASgCCCIFRgRAQbwaIARBfiACd3E2AgAMAQsgBSAANgIMIAAgBTYCCAsgAUEIaiEAIAEgAkEDdCICQQNyNgIEIAEgAmoiASABKAIEQQFyNgIEDAsLIAZBxBooAgAiCE0NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgFBA3QiAEHkGmoiAiAAQewaaigCACIAKAIIIgVGBEBBvBogBEF+IAF3cSIENgIADAELIAUgAjYCDCACIAU2AggLIAAgBkEDcjYCBCAAIAZqIgcgAUEDdCIBIAZrIgVBAXI2AgQgACABaiAFNgIAIAgEQCAIQXhxQeQaaiEBQdAaKAIAIQICfyAEQQEgCEEDdnQiA3FFBEBBvBogAyAEcjYCACABDAELIAEoAggLIQMgASACNgIIIAMgAjYCDCACIAE2AgwgAiADNgIICyAAQQhqIQBB0BogBzYCAEHEGiAFNgIADAsLQcAaKAIAIgtFDQEgC2hBAnRB7BxqKAIAIgIoAgRBeHEgBmshAyACIQEDQAJAIAEoAhAiAEUEQCABKAIUIgBFDQELIAAoAgRBeHEgBmsiASADIAEgA0kiARshAyAAIAIgARshAiAAIQEMAQsLIAIoAhghCSACIAIoAgwiAEcEQEHMGigCABogAigCCCIBIAA2AgwgACABNgIIDAoLIAIoAhQiAQR/IAJBFGoFIAIoAhAiAUUNAyACQRBqCyEFA0AgBSEHIAEiAEEUaiEFIAAoAhQiAQ0AIABBEGohBSAAKAIQIgENAAsgB0EANgIADAkLQX8hBiAAQb9/Sw0AIABBC2oiAEF4cSEGQcAaKAIAIgdFDQBBACAGayEDAkACQAJAAn9BACAGQYACSQ0AGkEfIAZB////B0sNABogBkEmIABBCHZnIgBrdkEBcSAAQQF0a0E+agsiCEECdEHsHGooAgAiAUUEQEEAIQAMAQtBACEAIAZBGSAIQQF2a0EAIAhBH0cbdCECA0ACQCABKAIEQXhxIAZrIgQgA08NACABIQUgBCIDDQBBACEDIAEhAAwDCyAAIAEoAhQiBCAEIAEgAkEddkEEcWooAhAiAUYbIAAgBBshACACQQF0IQIgAQ0ACwsgACAFckUEQEEAIQVBAiAIdCIAQQAgAGtyIAdxIgBFDQMgAGhBAnRB7BxqKAIAIQALIABFDQELA0AgACgCBEF4cSAGayICIANJIQEgAiADIAEbIQMgACAFIAEbIQUgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBUUNACADQcQaKAIAIAZrTw0AIAUoAhghCCAFIAUoAgwiAEcEQEHMGigCABogBSgCCCIBIAA2AgwgACABNgIIDAgLIAUoAhQiAQR/IAVBFGoFIAUoAhAiAUUNAyAFQRBqCyECA0AgAiEEIAEiAEEUaiECIAAoAhQiAQ0AIABBEGohAiAAKAIQIgENAAsgBEEANgIADAcLIAZBxBooAgAiBU0EQEHQGigCACEAAkAgBSAGayIBQRBPBEAgACAGaiICIAFBAXI2AgQgACAFaiABNgIAIAAgBkEDcjYCBAwBCyAAIAVBA3I2AgQgACAFaiIBIAEoAgRBAXI2AgRBACECQQAhAQtBxBogATYCAEHQGiACNgIAIABBCGohAAwJCyAGQcgaKAIAIgJJBEBByBogAiAGayIBNgIAQdQaQdQaKAIAIgAgBmoiAjYCACACIAFBAXI2AgQgACAGQQNyNgIEIABBCGohAAwJC0EAIQAgBkEvaiIDAn9BlB4oAgAEQEGcHigCAAwBC0GgHkJ/NwIAQZgeQoCggICAgAQ3AgBBlB4gCkEMakFwcUHYqtWqBXM2AgBBqB5BADYCAEH4HUEANgIAQYAgCyIBaiIEQQAgAWsiB3EiASAGTQ0IQfQdKAIAIgUEQEHsHSgCACIIIAFqIgkgCE0gBSAJSXINCQsCQEH4HS0AAEEEcUUEQAJAAkACQAJAQdQaKAIAIgUEQEH8HSEAA0AgBSAAKAIAIghPBEAgCCAAKAIEaiAFSw0DCyAAKAIIIgANAAsLQQAQCyICQX9GDQMgASEEQZgeKAIAIgBBAWsiBSACcQRAIAEgAmsgAiAFakEAIABrcWohBAsgBCAGTQ0DQfQdKAIAIgAEQEHsHSgCACIFIARqIgcgBU0gACAHSXINBAsgBBALIgAgAkcNAQwFCyAEIAJrIAdxIgQQCyICIAAoAgAgACgCBGpGDQEgAiEACyAAQX9GDQEgBkEwaiAETQRAIAAhAgwEC0GcHigCACICIAMgBGtqQQAgAmtxIgIQC0F/Rg0BIAIgBGohBCAAIQIMAwsgAkF/Rw0CC0H4HUH4HSgCAEEEcjYCAAsgARALIgJBf0ZBABALIgBBf0ZyIAAgAk1yDQUgACACayIEIAZBKGpNDQULQewdQewdKAIAIARqIgA2AgBB8B0oAgAgAEkEQEHwHSAANgIACwJAQdQaKAIAIgMEQEH8HSEAA0AgAiAAKAIAIgEgACgCBCIFakYNAiAAKAIIIgANAAsMBAtBzBooAgAiAEEAIAAgAk0bRQRAQcwaIAI2AgALQQAhAEGAHiAENgIAQfwdIAI2AgBB3BpBfzYCAEHgGkGUHigCADYCAEGIHkEANgIAA0AgAEEDdCIBQewaaiABQeQaaiIFNgIAIAFB8BpqIAU2AgAgAEEBaiIAQSBHDQALQcgaIARBKGsiAEF4IAJrQQdxIgFrIgU2AgBB1BogASACaiIBNgIAIAEgBUEBcjYCBCAAIAJqQSg2AgRB2BpBpB4oAgA2AgAMBAsgAiADTSABIANLcg0CIAAoAgxBCHENAiAAIAQgBWo2AgRB1BogA0F4IANrQQdxIgBqIgE2AgBByBpByBooAgAgBGoiAiAAayIANgIAIAEgAEEBcjYCBCACIANqQSg2AgRB2BpBpB4oAgA2AgAMAwtBACEADAYLQQAhAAwEC0HMGigCACACSwRAQcwaIAI2AgALIAIgBGohAUH8HSEAAkADQCABIAAoAgBHBEAgACgCCCIADQEMAgsLIAAtAAxBCHFFDQMLQfwdIQADQAJAIAMgACgCACIBTwRAIAEgACgCBGoiBSADSw0BCyAAKAIIIQAMAQsLQcgaIARBKGsiAEF4IAJrQQdxIgFrIgc2AgBB1BogASACaiIBNgIAIAEgB0EBcjYCBCAAIAJqQSg2AgRB2BpBpB4oAgA2AgAgAyAFQScgBWtBB3FqQS9rIgAgACADQRBqSRsiAUEbNgIEIAFBhB4pAgA3AhAgAUH8HSkCADcCCEGEHiABQQhqNgIAQYAeIAQ2AgBB/B0gAjYCAEGIHkEANgIAIAFBGGohAANAIABBBzYCBCAAQQhqIQwgAEEEaiEAIAwgBUkNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siAkEBcjYCBCABIAI2AgACfyACQf8BTQRAIAJBeHFB5BpqIQACf0G8GigCACIBQQEgAkEDdnQiAnFFBEBBvBogASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDEEMIQJBCAwBC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgAyAANgIcIANCADcCECAAQQJ0QewcaiEBAkACQEHAGigCACIFQQEgAHQiBHFFBEBBwBogBCAFcjYCACABIAM2AgAMAQsgAkEZIABBAXZrQQAgAEEfRxt0IQAgASgCACEFA0AgBSIBKAIEQXhxIAJGDQIgAEEddiEFIABBAXQhACABIAVBBHFqIgQoAhAiBQ0ACyAEIAM2AhALIAMgATYCGEEIIQIgAyIBIQBBDAwBCyABKAIIIgAgAzYCDCABIAM2AgggAyAANgIIQQAhAEEYIQJBDAsgA2ogATYCACACIANqIAA2AgALQcgaKAIAIgAgBk0NAEHIGiAAIAZrIgE2AgBB1BpB1BooAgAiACAGaiICNgIAIAIgAUEBcjYCBCAAIAZBA3I2AgQgAEEIaiEADAQLQbgaQTA2AgBBACEADAMLIAAgAjYCACAAIAAoAgQgBGo2AgQgAkF4IAJrQQdxaiIIIAZBA3I2AgQgAUF4IAFrQQdxaiIEIAYgCGoiA2shBwJAQdQaKAIAIARGBEBB1BogAzYCAEHIGkHIGigCACAHaiIANgIAIAMgAEEBcjYCBAwBC0HQGigCACAERgRAQdAaIAM2AgBBxBpBxBooAgAgB2oiADYCACADIABBAXI2AgQgACADaiAANgIADAELIAQoAgQiAEEDcUEBRgRAIABBeHEhCSAEKAIMIQICQCAAQf8BTQRAIAQoAggiASACRgRAQbwaQbwaKAIAQX4gAEEDdndxNgIADAILIAEgAjYCDCACIAE2AggMAQsgBCgCGCEGAkAgAiAERwRAQcwaKAIAGiAEKAIIIgAgAjYCDCACIAA2AggMAQsCQCAEKAIUIgAEfyAEQRRqBSAEKAIQIgBFDQEgBEEQagshAQNAIAEhBSAAIgJBFGohASAAKAIUIgANACACQRBqIQEgAigCECIADQALIAVBADYCAAwBC0EAIQILIAZFDQACQCAEKAIcIgBBAnRB7BxqIgEoAgAgBEYEQCABIAI2AgAgAg0BQcAaQcAaKAIAQX4gAHdxNgIADAILIAZBEEEUIAYoAhAgBEYbaiACNgIAIAJFDQELIAIgBjYCGCAEKAIQIgAEQCACIAA2AhAgACACNgIYCyAEKAIUIgBFDQAgAiAANgIUIAAgAjYCGAsgByAJaiEHIAQgCWoiBCgCBCEACyAEIABBfnE2AgQgAyAHQQFyNgIEIAMgB2ogBzYCACAHQf8BTQRAIAdBeHFB5BpqIQACf0G8GigCACIBQQEgB0EDdnQiAnFFBEBBvBogASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDCADIAA2AgwgAyABNgIIDAELQR8hAiAHQf///wdNBEAgB0EmIAdBCHZnIgBrdkEBcSAAQQF0a0E+aiECCyADIAI2AhwgA0IANwIQIAJBAnRB7BxqIQACQAJAQcAaKAIAIgFBASACdCIFcUUEQEHAGiABIAVyNgIAIAAgAzYCAAwBCyAHQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQEDQCABIgAoAgRBeHEgB0YNAiACQR12IQEgAkEBdCECIAAgAUEEcWoiBSgCECIBDQALIAUgAzYCEAsgAyAANgIYIAMgAzYCDCADIAM2AggMAQsgACgCCCIBIAM2AgwgACADNgIIIANBADYCGCADIAA2AgwgAyABNgIICyAIQQhqIQAMAgsCQCAIRQ0AAkAgBSgCHCIBQQJ0QewcaiICKAIAIAVGBEAgAiAANgIAIAANAUHAGiAHQX4gAXdxIgc2AgAMAgsgCEEQQRQgCCgCECAFRhtqIAA2AgAgAEUNAQsgACAINgIYIAUoAhAiAQRAIAAgATYCECABIAA2AhgLIAUoAhQiAUUNACAAIAE2AhQgASAANgIYCwJAIANBD00EQCAFIAMgBmoiAEEDcjYCBCAAIAVqIgAgACgCBEEBcjYCBAwBCyAFIAZBA3I2AgQgBSAGaiIEIANBAXI2AgQgAyAEaiADNgIAIANB/wFNBEAgA0F4cUHkGmohAAJ/QbwaKAIAIgFBASADQQN2dCICcUUEQEG8GiABIAJyNgIAIAAMAQsgACgCCAshASAAIAQ2AgggASAENgIMIAQgADYCDCAEIAE2AggMAQtBHyEAIANB////B00EQCADQSYgA0EIdmciAGt2QQFxIABBAXRrQT5qIQALIAQgADYCHCAEQgA3AhAgAEECdEHsHGohAQJAAkAgB0EBIAB0IgJxRQRAQcAaIAIgB3I2AgAgASAENgIAIAQgATYCGAwBCyADQRkgAEEBdmtBACAAQR9HG3QhACABKAIAIQEDQCABIgIoAgRBeHEgA0YNAiAAQR12IQEgAEEBdCEAIAIgAUEEcWoiBygCECIBDQALIAcgBDYCECAEIAI2AhgLIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAFQQhqIQAMAQsCQCAJRQ0AAkAgAigCHCIBQQJ0QewcaiIFKAIAIAJGBEAgBSAANgIAIAANAUHAGiALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAkYbaiAANgIAIABFDQELIAAgCTYCGCACKAIQIgEEQCAAIAE2AhAgASAANgIYCyACKAIUIgFFDQAgACABNgIUIAEgADYCGAsCQCADQQ9NBEAgAiADIAZqIgBBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMAQsgAiAGQQNyNgIEIAIgBmoiBSADQQFyNgIEIAMgBWogAzYCACAIBEAgCEF4cUHkGmohAEHQGigCACEBAn9BASAIQQN2dCIHIARxRQRAQbwaIAQgB3I2AgAgAAwBCyAAKAIICyEEIAAgATYCCCAEIAE2AgwgASAANgIMIAEgBDYCCAtB0BogBTYCAEHEGiADNgIACyACQQhqIQALIApBEGokACAAC6kLAgt/CX0jAEGgAWsiCyQAIAtBMGpBJBAQA0AgASANRwRAIAIgDUEDbCIMQQJqQQJ0Ig5qKgIAIRcgAiAMQQFqQQJ0Ig9qKgIAIRggCCAMQQJ0IhBqIAIgEGoqAgAiGTgCACAIIA9qIBg4AgAgCCAOaiAXOAIAIAcgDUEFdGoiDCAYOAIEIAwgGTgCACAMIBc4AgggDEEANgIMAkAgAEUEQCAGIA1qLQAARQ0BCyAMQYCAgAg2AgwLIAcgDUEFdGoiESAFIA1BAnQiDEEBciISai0AAEEIdCAFIAxqLQAAciAFIAxBAnIiE2otAABBEHRyIAUgDEEDciIMai0AAEEYdHI2AhwgCyADIBJBAnQiEmoqAgAiFzgCkAEgCyADIBNBAnQiE2oqAgAiGDgClAEgCyADIAxBAnQiFGoqAgAiGTgCmAEgCyADIA1BBHQiFWoqAgCMIho4ApwBIAtB4ABqIgwgCyoCmAEiFkMAAADAlCAWlCALKgKUASIWQwAAAMCUIBaUQwAAgD+SkjgCACAMIAsqApABIhYgFpIgCyoClAGUIAsqApgBQwAAAMCUIAsqApwBlJI4AgQgDCALKgKQASIWIBaSIAsqApgBlCALKgKUASIWIBaSIAsqApwBlJI4AgggDCALKgKQASIWIBaSIAsqApQBlCALKgKYASIWIBaSIAsqApwBlJI4AgwgDCALKgKYASIWQwAAAMCUIBaUIAsqApABIhZDAAAAwJQgFpRDAACAP5KSOAIQIAwgCyoClAEiFiAWkiALKgKYAZQgCyoCkAFDAAAAwJQgCyoCnAGUkjgCFCAMIAsqApABIhYgFpIgCyoCmAGUIAsqApQBQwAAAMCUIAsqApwBlJI4AhggDCALKgKUASIWIBaSIAsqApgBlCALKgKQASIWIBaSIAsqApwBlJI4AhwgDCALKgKUASIWQwAAAMCUIBaUIAsqApABIhZDAAAAwJQgFpRDAACAP5KSOAIgIAkgFWogFzgCACAJIBJqIBg4AgAgCSATaiAZOAIAIAkgFGogGjgCACALIAQgEGoqAgAiFzgCMCALIAQgD2oqAgAiGDgCQCALIAQgDmoqAgAiGTgCUCAKIBBqIBc4AgAgCiAPaiAYOAIAIAogDmogGTgCACALIAwqAhggCyoCOJQgDCoCACALKgIwlCAMKgIMIAsqAjSUkpI4AgAgCyAMKgIcIAsqAjiUIAwqAgQgCyoCMJQgDCoCECALKgI0lJKSOAIEIAsgDCoCICALKgI4lCAMKgIIIAsqAjCUIAwqAhQgCyoCNJSSkjgCCCALIAwqAhggCyoCRJQgDCoCACALKgI8lCAMKgIMIAsqAkCUkpI4AgwgCyAMKgIcIAsqAkSUIAwqAgQgCyoCPJQgDCoCECALKgJAlJKSOAIQIAsgDCoCICALKgJElCAMKgIIIAsqAjyUIAwqAhQgCyoCQJSSkjgCFCALIAwqAhggCyoCUJQgDCoCACALKgJIlCAMKgIMIAsqAkyUkpI4AhggCyAMKgIcIAsqAlCUIAwqAgQgCyoCSJQgDCoCECALKgJMlJKSOAIcIAsgDCoCICALKgJQlCAMKgIIIAsqAkiUIAwqAhQgCyoCTJSSkjgCICALKgIgIRcgCyoCCCEYIAsqAhQhGSARIAsqAhgiGiAalCALKgIAIhYgFpQgCyoCDCIbIBuUkpJDAACAQJQgGiALKgIcIhyUIBYgCyoCBCIdlCAbIAsqAhAiHpSSkkMAAIBAlBAMNgIQIBEgGiAXlCAWIBiUIBsgGZSSkkMAAIBAlCAcIByUIB0gHZQgHiAelJKSQwAAgECUEAw2AhQgESAcIBeUIB0gGJQgHiAZlJKSQwAAgECUIBcgF5QgGCAYlCAZIBmUkpJDAACAQJQQDDYCGCANQQFqIQ0MAQsLIAtBoAFqJAALGgAgACABKAIIIAUQCgRAIAEgAiADIAQQFAsLNwAgACABKAIIIAUQCgRAIAEgAiADIAQQFA8LIAAoAggiACABIAIgAyAEIAUgACgCACgCFBEDAAuRAQAgACABKAIIIAQQCgRAIAEgAiADEBMPCwJAIAAgASgCACAEEApFDQACQCACIAEoAhBHBEAgASgCFCACRw0BCyADQQFHDQEgAUEBNgIgDwsgASACNgIUIAEgAzYCICABIAEoAihBAWo2AigCQCABKAIkQQFHDQAgASgCGEECRw0AIAFBAToANgsgAUEENgIsCwvyAQAgACABKAIIIAQQCgRAIAEgAiADEBMPCwJAIAAgASgCACAEEAoEQAJAIAIgASgCEEcEQCABKAIUIAJHDQELIANBAUcNAiABQQE2AiAPCyABIAM2AiACQCABKAIsQQRGDQAgAUEAOwE0IAAoAggiACABIAIgAkEBIAQgACgCACgCFBEDACABLQA1BEAgAUEDNgIsIAEtADRFDQEMAwsgAUEENgIsCyABIAI2AhQgASABKAIoQQFqNgIoIAEoAiRBAUcNASABKAIYQQJHDQEgAUEBOgA2DwsgACgCCCIAIAEgAiADIAQgACgCACgCGBECAAsLMQAgACABKAIIQQAQCgRAIAEgAiADEBUPCyAAKAIIIgAgASACIAMgACgCACgCHBEAAAsYACAAIAEoAghBABAKBEAgASACIAMQFQsLgAMBBH8jAEHwAGsiAiQAIAAoAgAiA0EEaygCACEEIANBCGsoAgAhBSACQgA3AlAgAkIANwJYIAJCADcCYCACQgA3AGcgAkIANwJIIAJBADYCRCACQewVNgJAIAIgADYCPCACIAE2AjggACAFaiEDAkAgBCABQQAQCgRAQQAgAyAFGyEADAELIAAgA04EQCACQgA3AC8gAkIANwIYIAJCADcCICACQgA3AiggAkIANwIQIAJBADYCDCACIAE2AgggAiAANgIEIAIgBDYCACACQQE2AjAgBCACIAMgA0EBQQAgBCgCACgCFBEDACACKAIYDQELQQAhACAEIAJBOGogA0EBQQAgBCgCACgCGBECAAJAAkAgAigCXA4CAAECCyACKAJMQQAgAigCWEEBRhtBACACKAJUQQFGG0EAIAIoAmBBAUYbIQAMAQsgAigCUEEBRwRAIAIoAmANASACKAJUQQFHDQEgAigCWEEBRw0BCyACKAJIIQALIAJB8ABqJAAgAAuZAQECfyMAQUBqIgMkAAJ/QQEgACABQQAQCg0AGkEAIAFFDQAaQQAgAUGcFhAhIgFFDQAaIANBDGpBNBAQIANBATYCOCADQX82AhQgAyAANgIQIAMgATYCCCABIANBCGogAigCAEEBIAEoAgAoAhwRAAAgAygCICIAQQFGBEAgAiADKAIYNgIACyAAQQFGCyEEIANBQGskACAECwoAIAAgAUEAEAoLC7cSAgBBgAgLphJ1bnNpZ25lZCBzaG9ydAB1bnNpZ25lZCBpbnQAZmxvYXQAdWludDY0X3QAdW5zaWduZWQgY2hhcgBib29sAHVuc2lnbmVkIGxvbmcAc3RkOjp3c3RyaW5nAHN0ZDo6c3RyaW5nAHN0ZDo6dTE2c3RyaW5nAHN0ZDo6dTMyc3RyaW5nAGRvdWJsZQB2b2lkAGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGNoYXI+AHN0ZDo6YmFzaWNfc3RyaW5nPHVuc2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNpZ25lZCBjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+AE5TdDNfXzIxMmJhc2ljX3N0cmluZ0ljTlNfMTFjaGFyX3RyYWl0c0ljRUVOU185YWxsb2NhdG9ySWNFRUVFAAAAAJQMAAAyBwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSWhOU18xMWNoYXJfdHJhaXRzSWhFRU5TXzlhbGxvY2F0b3JJaEVFRUUAAJQMAAB8BwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSXdOU18xMWNoYXJfdHJhaXRzSXdFRU5TXzlhbGxvY2F0b3JJd0VFRUUAAJQMAADEBwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSURzTlNfMTFjaGFyX3RyYWl0c0lEc0VFTlNfOWFsbG9jYXRvcklEc0VFRUUAAACUDAAADAgAAE5TdDNfXzIxMmJhc2ljX3N0cmluZ0lEaU5TXzExY2hhcl90cmFpdHNJRGlFRU5TXzlhbGxvY2F0b3JJRGlFRUVFAAAAlAwAAFgIAABOMTBlbXNjcmlwdGVuM3ZhbEUAAJQMAACkCAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJY0VFAACUDAAAwAgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWFFRQAAlAwAAOgIAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0loRUUAAJQMAAAQCQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJc0VFAACUDAAAOAkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXRFRQAAlAwAAGAJAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lpRUUAAJQMAACICQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJakVFAACUDAAAsAkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWxFRQAAlAwAANgJAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0ltRUUAAJQMAAAACgAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJeEVFAACUDAAAKAoAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXlFRQAAlAwAAFAKAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lmRUUAAJQMAAB4CgAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJZEVFAACUDAAAoAoAAE4xMF9fY3h4YWJpdjExNl9fc2hpbV90eXBlX2luZm9FAAAAALwMAADICgAAIA0AAE4xMF9fY3h4YWJpdjExN19fY2xhc3NfdHlwZV9pbmZvRQAAALwMAAD4CgAA7AoAAE4xMF9fY3h4YWJpdjExN19fcGJhc2VfdHlwZV9pbmZvRQAAALwMAAAoCwAA7AoAAE4xMF9fY3h4YWJpdjExOV9fcG9pbnRlcl90eXBlX2luZm9FALwMAABYCwAATAsAAAAAAADMCwAAAgAAAAMAAAAEAAAABQAAAAYAAABOMTBfX2N4eGFiaXYxMjNfX2Z1bmRhbWVudGFsX3R5cGVfaW5mb0UAvAwAAKQLAADsCgAAdgAAAJALAADYCwAAYgAAAJALAADkCwAAYwAAAJALAADwCwAAaAAAAJALAAD8CwAAYQAAAJALAAAIDAAAcwAAAJALAAAUDAAAdAAAAJALAAAgDAAAaQAAAJALAAAsDAAAagAAAJALAAA4DAAAbAAAAJALAABEDAAAbQAAAJALAABQDAAAeAAAAJALAABcDAAAeQAAAJALAABoDAAAZgAAAJALAAB0DAAAZAAAAJALAACADAAAAAAAABwLAAACAAAABwAAAAQAAAAFAAAACAAAAAkAAAAKAAAACwAAAAAAAAAEDQAAAgAAAAwAAAAEAAAABQAAAAgAAAANAAAADgAAAA8AAABOMTBfX2N4eGFiaXYxMjBfX3NpX2NsYXNzX3R5cGVfaW5mb0UAAAAAvAwAANwMAAAcCwAAU3Q5dHlwZV9pbmZvAAAAAJQMAAAQDQBBqBoLAzAPAQ==\") || (ZU = q, q = F.locateFile ? F.locateFile(ZU, d) : d + ZU);\n  var k = (n) => {\n    for (; n.length > 0; )\n      n.shift()(F);\n  };\n  F.noExitRuntime;\n  var T, M, UU = (n) => {\n    for (var A = \"\", e = n; s[e]; )\n      A += T[s[e++]];\n    return A;\n  }, VU = {}, O = {}, $ = (n) => {\n    throw new M(n);\n  };\n  function f(n, A, e = {}) {\n    if (!(\"argPackAdvance\" in A))\n      throw new TypeError(\"registerType registeredInstance requires argPackAdvance\");\n    return function(W, h, b = {}) {\n      var C = h.name;\n      if (W || $(`type \"${C}\" must have a positive integer typeid pointer`), O.hasOwnProperty(W)) {\n        if (b.ignoreDuplicateRegistrations)\n          return;\n        $(`Cannot register type '${C}' twice`);\n      }\n      if (O[W] = h, VU.hasOwnProperty(W)) {\n        var m = VU[W];\n        delete VU[W], m.forEach((g) => g());\n      }\n    }(n, A, e);\n  }\n  var FU = [], lU = [], sU = () => lU.length / 2 - 5 - FU.length, pU = (n) => (n || $(\"Cannot use deleted val. handle = \" + n), lU[n]), yU = (n) => {\n    switch (n) {\n      case void 0:\n        return 2;\n      case null:\n        return 4;\n      case !0:\n        return 6;\n      case !1:\n        return 8;\n      default: {\n        const A = FU.pop() || lU.length;\n        return lU[A] = n, lU[A + 1] = 1, A;\n      }\n    }\n  };\n  function IU(n) {\n    return this.fromWireType(o[n >> 2]);\n  }\n  var YU = { name: \"emscripten::val\", fromWireType: (n) => {\n    var A = pU(n);\n    return ((e) => {\n      e > 9 && --lU[e + 1] == 0 && (lU[e] = void 0, FU.push(e));\n    })(n), A;\n  }, toWireType: (n, A) => yU(A), argPackAdvance: 8, readValueFromPointer: IU, destructorFunction: null }, kU = (n, A) => {\n    switch (A) {\n      case 4:\n        return function(e) {\n          return this.fromWireType(X[e >> 2]);\n        };\n      case 8:\n        return function(e) {\n          return this.fromWireType(G[e >> 3]);\n        };\n      default:\n        throw new TypeError(`invalid float width (${A}): ${n}`);\n    }\n  }, uU = (n, A, e) => {\n    switch (A) {\n      case 1:\n        return e ? (W) => i[W] : (W) => s[W];\n      case 2:\n        return e ? (W) => J[W >> 1] : (W) => c[W >> 1];\n      case 4:\n        return e ? (W) => N[W >> 2] : (W) => o[W >> 2];\n      default:\n        throw new TypeError(`invalid integer width (${A}): ${n}`);\n    }\n  }, oU = typeof TextDecoder < \"u\" ? new TextDecoder(\"utf8\") : void 0, TU = (n, A) => n ? ((e, W, h) => {\n    for (var b = W + h, C = W; e[C] && !(C >= b); )\n      ++C;\n    if (C - W > 16 && e.buffer && oU)\n      return oU.decode(e.subarray(W, C));\n    for (var m = \"\"; W < C; ) {\n      var g = e[W++];\n      if (128 & g) {\n        var y = 63 & e[W++];\n        if ((224 & g) != 192) {\n          var z = 63 & e[W++];\n          if ((g = (240 & g) == 224 ? (15 & g) << 12 | y << 6 | z : (7 & g) << 18 | y << 12 | z << 6 | 63 & e[W++]) < 65536)\n            m += String.fromCharCode(g);\n          else {\n            var L = g - 65536;\n            m += String.fromCharCode(55296 | L >> 10, 56320 | 1023 & L);\n          }\n        } else\n          m += String.fromCharCode((31 & g) << 6 | y);\n      } else\n        m += String.fromCharCode(g);\n    }\n    return m;\n  })(s, n, A) : \"\", CU = typeof TextDecoder < \"u\" ? new TextDecoder(\"utf-16le\") : void 0, HU = (n, A) => {\n    for (var e = n, W = e >> 1, h = W + A / 2; !(W >= h) && c[W]; )\n      ++W;\n    if ((e = W << 1) - n > 32 && CU)\n      return CU.decode(s.subarray(n, e));\n    for (var b = \"\", C = 0; !(C >= A / 2); ++C) {\n      var m = J[n + 2 * C >> 1];\n      if (m == 0)\n        break;\n      b += String.fromCharCode(m);\n    }\n    return b;\n  }, xU = (n, A, e) => {\n    if (e ?? (e = 2147483647), e < 2)\n      return 0;\n    for (var W = A, h = (e -= 2) < 2 * n.length ? e / 2 : n.length, b = 0; b < h; ++b) {\n      var C = n.charCodeAt(b);\n      J[A >> 1] = C, A += 2;\n    }\n    return J[A >> 1] = 0, A - W;\n  }, DU = (n) => 2 * n.length, wU = (n, A) => {\n    for (var e = 0, W = \"\"; !(e >= A / 4); ) {\n      var h = N[n + 4 * e >> 2];\n      if (h == 0)\n        break;\n      if (++e, h >= 65536) {\n        var b = h - 65536;\n        W += String.fromCharCode(55296 | b >> 10, 56320 | 1023 & b);\n      } else\n        W += String.fromCharCode(h);\n    }\n    return W;\n  }, MU = (n, A, e) => {\n    if (e ?? (e = 2147483647), e < 4)\n      return 0;\n    for (var W = A, h = W + e - 4, b = 0; b < n.length; ++b) {\n      var C = n.charCodeAt(b);\n      if (C >= 55296 && C <= 57343 && (C = 65536 + ((1023 & C) << 10) | 1023 & n.charCodeAt(++b)), N[A >> 2] = C, (A += 4) + 4 > h)\n        break;\n    }\n    return N[A >> 2] = 0, A - W;\n  }, vU = (n) => {\n    for (var A = 0, e = 0; e < n.length; ++e) {\n      var W = n.charCodeAt(e);\n      W >= 55296 && W <= 57343 && ++e, A += 4;\n    }\n    return A;\n  }, fU = (n) => {\n    var A = (n - B.buffer.byteLength + 65535) / 65536;\n    try {\n      return B.grow(A), Y(), 1;\n    } catch {\n    }\n  };\n  (() => {\n    for (var n = new Array(256), A = 0; A < 256; ++A)\n      n[A] = String.fromCharCode(A);\n    T = n;\n  })(), M = F.BindingError = class extends Error {\n    constructor(n) {\n      super(n), this.name = \"BindingError\";\n    }\n  }, F.InternalError = class extends Error {\n    constructor(n) {\n      super(n), this.name = \"InternalError\";\n    }\n  }, lU.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), F.count_emval_handles = sU;\n  var zU = { f: (n, A, e, W, h) => {\n  }, i: (n, A, e, W) => {\n    f(n, { name: A = UU(A), fromWireType: function(h) {\n      return !!h;\n    }, toWireType: function(h, b) {\n      return b ? e : W;\n    }, argPackAdvance: 8, readValueFromPointer: function(h) {\n      return this.fromWireType(s[h]);\n    }, destructorFunction: null });\n  }, h: (n) => f(n, YU), e: (n, A, e) => {\n    f(n, { name: A = UU(A), fromWireType: (W) => W, toWireType: (W, h) => h, argPackAdvance: 8, readValueFromPointer: kU(A, e), destructorFunction: null });\n  }, b: (n, A, e, W, h) => {\n    A = UU(A);\n    var b = (g) => g;\n    if (W === 0) {\n      var C = 32 - 8 * e;\n      b = (g) => g << C >>> C;\n    }\n    var m = A.includes(\"unsigned\");\n    f(n, { name: A, fromWireType: b, toWireType: m ? function(g, y) {\n      return this.name, y >>> 0;\n    } : function(g, y) {\n      return this.name, y;\n    }, argPackAdvance: 8, readValueFromPointer: uU(A, e, W !== 0), destructorFunction: null });\n  }, a: (n, A, e) => {\n    var W = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][A];\n    function h(b) {\n      var C = o[b >> 2], m = o[b + 4 >> 2];\n      return new W(i.buffer, m, C);\n    }\n    f(n, { name: e = UU(e), fromWireType: h, argPackAdvance: 8, readValueFromPointer: h }, { ignoreDuplicateRegistrations: !0 });\n  }, d: (n, A) => {\n    var e = (A = UU(A)) === \"std::string\";\n    f(n, { name: A, fromWireType(W) {\n      var h, b = o[W >> 2], C = W + 4;\n      if (e)\n        for (var m = C, g = 0; g <= b; ++g) {\n          var y = C + g;\n          if (g == b || s[y] == 0) {\n            var z = TU(m, y - m);\n            h === void 0 ? h = z : (h += String.fromCharCode(0), h += z), m = y + 1;\n          }\n        }\n      else {\n        var L = new Array(b);\n        for (g = 0; g < b; ++g)\n          L[g] = String.fromCharCode(s[C + g]);\n        h = L.join(\"\");\n      }\n      return AU(W), h;\n    }, toWireType(W, h) {\n      var b;\n      h instanceof ArrayBuffer && (h = new Uint8Array(h));\n      var C = typeof h == \"string\";\n      C || h instanceof Uint8Array || h instanceof Uint8ClampedArray || h instanceof Int8Array || $(\"Cannot pass non-string to std::string\"), b = e && C ? ((L) => {\n        for (var w = 0, H = 0; H < L.length; ++H) {\n          var WU = L.charCodeAt(H);\n          WU <= 127 ? w++ : WU <= 2047 ? w += 2 : WU >= 55296 && WU <= 57343 ? (w += 4, ++H) : w += 3;\n        }\n        return w;\n      })(h) : h.length;\n      var m = JU(4 + b + 1), g = m + 4;\n      if (o[m >> 2] = b, e && C)\n        ((L, w, H, WU) => {\n          if (!(WU > 0))\n            return 0;\n          for (var iU = H + WU - 1, hU = 0; hU < L.length; ++hU) {\n            var P = L.charCodeAt(hU);\n            if (P >= 55296 && P <= 57343 && (P = 65536 + ((1023 & P) << 10) | 1023 & L.charCodeAt(++hU)), P <= 127) {\n              if (H >= iU)\n                break;\n              w[H++] = P;\n            } else if (P <= 2047) {\n              if (H + 1 >= iU)\n                break;\n              w[H++] = 192 | P >> 6, w[H++] = 128 | 63 & P;\n            } else if (P <= 65535) {\n              if (H + 2 >= iU)\n                break;\n              w[H++] = 224 | P >> 12, w[H++] = 128 | P >> 6 & 63, w[H++] = 128 | 63 & P;\n            } else {\n              if (H + 3 >= iU)\n                break;\n              w[H++] = 240 | P >> 18, w[H++] = 128 | P >> 12 & 63, w[H++] = 128 | P >> 6 & 63, w[H++] = 128 | 63 & P;\n            }\n          }\n          w[H] = 0;\n        })(h, s, g, b + 1);\n      else if (C)\n        for (var y = 0; y < b; ++y) {\n          var z = h.charCodeAt(y);\n          z > 255 && (AU(g), $(\"String has UTF-16 code units that do not fit in 8 bits\")), s[g + y] = z;\n        }\n      else\n        for (y = 0; y < b; ++y)\n          s[g + y] = h[y];\n      return W !== null && W.push(AU, m), m;\n    }, argPackAdvance: 8, readValueFromPointer: IU, destructorFunction(W) {\n      AU(W);\n    } });\n  }, c: (n, A, e) => {\n    var W, h, b, C;\n    e = UU(e), A === 2 ? (W = HU, h = xU, C = DU, b = (m) => c[m >> 1]) : A === 4 && (W = wU, h = MU, C = vU, b = (m) => o[m >> 2]), f(n, { name: e, fromWireType: (m) => {\n      for (var g, y = o[m >> 2], z = m + 4, L = 0; L <= y; ++L) {\n        var w = m + 4 + L * A;\n        if (L == y || b(w) == 0) {\n          var H = W(z, w - z);\n          g === void 0 ? g = H : (g += String.fromCharCode(0), g += H), z = w + A;\n        }\n      }\n      return AU(m), g;\n    }, toWireType: (m, g) => {\n      typeof g != \"string\" && $(`Cannot pass non-string to C++ string type ${e}`);\n      var y = C(g), z = JU(4 + y + A);\n      return o[z >> 2] = y / A, h(g, z + 4, y + A), m !== null && m.push(AU, z), z;\n    }, argPackAdvance: 8, readValueFromPointer: IU, destructorFunction(m) {\n      AU(m);\n    } });\n  }, j: (n, A) => {\n    f(n, { isVoid: !0, name: A = UU(A), argPackAdvance: 0, fromWireType: () => {\n    }, toWireType: (e, W) => {\n    } });\n  }, g: (n) => {\n    var A = s.length, e = 2147483648;\n    if ((n >>>= 0) > e)\n      return !1;\n    for (var W, h, b = 1; b <= 4; b *= 2) {\n      var C = A * (1 + 0.2 / b);\n      C = Math.min(C, n + 100663296);\n      var m = Math.min(e, (W = Math.max(n, C)) + ((h = 65536) - W % h) % h);\n      if (fU(m))\n        return !0;\n    }\n    return !1;\n  } }, eU = function() {\n    var e;\n    var n = { a: zU };\n    function A(W, h) {\n      var b;\n      return eU = W.exports, B = eU.k, Y(), b = eU.l, v.unshift(b), function(C) {\n        var g;\n        if (p--, (g = F.monitorRunDependencies) == null || g.call(F, p), p == 0 && I) {\n          var m = I;\n          I = null, m();\n        }\n      }(), eU;\n    }\n    if (p++, (e = F.monitorRunDependencies) == null || e.call(F, p), F.instantiateWasm)\n      try {\n        return F.instantiateWasm(n, A);\n      } catch (W) {\n        t(`Module.instantiateWasm callback failed with error: ${W}`), l(W);\n      }\n    return a(0, q, n, function(W) {\n      A(W.instance);\n    }).catch(l), {};\n  }();\n  F._pack = (n, A, e, W, h, b, C, m, g, y, z) => (F._pack = eU.m)(n, A, e, W, h, b, C, m, g, y, z);\n  var aU, JU = F._malloc = (n) => (JU = F._malloc = eU.o)(n), AU = F._free = (n) => (AU = F._free = eU.p)(n);\n  function mU() {\n    function n() {\n      aU || (aU = !0, F.calledRun = !0, E || (k(v), U(F), F.onRuntimeInitialized && F.onRuntimeInitialized(), function() {\n        if (F.postRun)\n          for (typeof F.postRun == \"function\" && (F.postRun = [F.postRun]); F.postRun.length; )\n            A = F.postRun.shift(), D.unshift(A);\n        var A;\n        k(D);\n      }()));\n    }\n    p > 0 || (function() {\n      if (F.preRun)\n        for (typeof F.preRun == \"function\" && (F.preRun = [F.preRun]); F.preRun.length; )\n          A = F.preRun.shift(), x.unshift(A);\n      var A;\n      k(x);\n    }(), p > 0 || (F.setStatus ? (F.setStatus(\"Running...\"), setTimeout(function() {\n      setTimeout(function() {\n        F.setStatus(\"\");\n      }, 1), n();\n    }, 1)) : n()));\n  }\n  if (I = function n() {\n    aU || mU(), aU || (I = n);\n  }, F.preInit)\n    for (typeof F.preInit == \"function\" && (F.preInit = [F.preInit]); F.preInit.length > 0; )\n      F.preInit.pop()();\n  return mU(), r.ready;\n};\nclass BF {\n  constructor(U) {\n    this.dataChanged = !1, this.transformsChanged = !1, this._updating = /* @__PURE__ */ new Set(), this._dirty = /* @__PURE__ */ new Set();\n    let l = 0, F = 0;\n    this._splatIndices = /* @__PURE__ */ new Map(), this._offsets = /* @__PURE__ */ new Map();\n    const Q = /* @__PURE__ */ new Map();\n    for (const t of U.objects)\n      t instanceof tU && (this._splatIndices.set(t, F), this._offsets.set(t, l), Q.set(l, t), l += t.data.vertexCount, F++);\n    this._vertexCount = l, this._width = 2048, this._height = Math.ceil(2 * this.vertexCount / this.width), this._data = new Uint32Array(this.width * this.height * 4), this._transformsWidth = 5, this._transformsHeight = Q.size, this._transforms = new Float32Array(this._transformsWidth * this._transformsHeight * 4), this._transformIndicesWidth = 1024, this._transformIndicesHeight = Math.ceil(this.vertexCount / this._transformIndicesWidth), this._transformIndices = new Uint32Array(this._transformIndicesWidth * this._transformIndicesHeight), this._positions = new Float32Array(3 * this.vertexCount), this._rotations = new Float32Array(4 * this.vertexCount), this._scales = new Float32Array(3 * this.vertexCount), this._worker = new tF();\n    const Z = (t) => {\n      const R = this._splatIndices.get(t);\n      this._transforms.set(t.transform.buffer, 20 * R), this._transforms[20 * R + 16] = t.selected ? 1 : 0, t.positionChanged = !1, t.rotationChanged = !1, t.scaleChanged = !1, t.selectedChanged = !1, this.transformsChanged = !0;\n    };\n    let d;\n    this._worker.onmessage = (t) => {\n      if (t.data.response) {\n        const R = t.data.response, i = Q.get(R.offset);\n        Z(i);\n        const s = this._splatIndices.get(i);\n        for (let J = 0; J < i.data.vertexCount; J++)\n          this._transformIndices[R.offset + J] = s;\n        this._data.set(R.data, 8 * R.offset), i.data.reattach(R.positions, R.rotations, R.scales, R.colors, R.selection), this._positions.set(R.worldPositions, 3 * R.offset), this._rotations.set(R.worldRotations, 4 * R.offset), this._scales.set(R.worldScales, 3 * R.offset), this._updating.delete(i), i.selectedChanged = !1, this.dataChanged = !0;\n      }\n    }, async function() {\n      d = await dF();\n    }();\n    const V = (t) => {\n      if (!d)\n        return void async function() {\n          for (; !d; )\n            await new Promise((I) => setTimeout(I, 0));\n        }().then(() => {\n          V(t);\n        });\n      Z(t);\n      const R = d._malloc(3 * t.data.vertexCount * 4), i = d._malloc(4 * t.data.vertexCount * 4), s = d._malloc(3 * t.data.vertexCount * 4), J = d._malloc(4 * t.data.vertexCount), c = d._malloc(t.data.vertexCount), N = d._malloc(8 * t.data.vertexCount * 4), o = d._malloc(3 * t.data.vertexCount * 4), X = d._malloc(4 * t.data.vertexCount * 4), G = d._malloc(3 * t.data.vertexCount * 4);\n      d.HEAPF32.set(t.data.positions, R / 4), d.HEAPF32.set(t.data.rotations, i / 4), d.HEAPF32.set(t.data.scales, s / 4), d.HEAPU8.set(t.data.colors, J), d.HEAPU8.set(t.data.selection, c), d._pack(t.selected, t.data.vertexCount, R, i, s, J, c, N, o, X, G);\n      const E = new Uint32Array(d.HEAPU32.buffer, N, 8 * t.data.vertexCount), Y = new Float32Array(d.HEAPF32.buffer, o, 3 * t.data.vertexCount), x = new Float32Array(d.HEAPF32.buffer, X, 4 * t.data.vertexCount), v = new Float32Array(d.HEAPF32.buffer, G, 3 * t.data.vertexCount), D = this._splatIndices.get(t), p = this._offsets.get(t);\n      for (let I = 0; I < t.data.vertexCount; I++)\n        this._transformIndices[p + I] = D;\n      this._data.set(E, 8 * p), this._positions.set(Y, 3 * p), this._rotations.set(x, 4 * p), this._scales.set(v, 3 * p), d._free(R), d._free(i), d._free(s), d._free(J), d._free(c), d._free(N), d._free(o), d._free(X), d._free(G), this.dataChanged = !0;\n    }, B = (t) => {\n      if ((t.positionChanged || t.rotationChanged || t.scaleChanged || t.selectedChanged) && Z(t), !t.data.changed || t.data.detached)\n        return;\n      const R = { position: new Float32Array(t.position.flat()), rotation: new Float32Array(t.rotation.flat()), scale: new Float32Array(t.scale.flat()), selected: t.selected, vertexCount: t.data.vertexCount, positions: t.data.positions, rotations: t.data.rotations, scales: t.data.scales, colors: t.data.colors, selection: t.data.selection, offset: this._offsets.get(t) };\n      this._worker.postMessage({ splat: R }, [R.position.buffer, R.rotation.buffer, R.scale.buffer, R.positions.buffer, R.rotations.buffer, R.scales.buffer, R.colors.buffer, R.selection.buffer]), this._updating.add(t), t.data.detached = !0;\n    };\n    this.getSplat = (t) => {\n      let R = null;\n      for (const [i, s] of this._offsets) {\n        if (!(t >= s))\n          break;\n        R = i;\n      }\n      return R;\n    }, this.getLocalIndex = (t, R) => R - this._offsets.get(t), this.markDirty = (t) => {\n      this._dirty.add(t);\n    }, this.rebuild = () => {\n      for (const t of this._dirty)\n        B(t);\n      this._dirty.clear();\n    }, this.dispose = () => {\n      this._worker.terminate();\n    };\n    for (const t of this._splatIndices.keys())\n      V(t);\n  }\n  get offsets() {\n    return this._offsets;\n  }\n  get data() {\n    return this._data;\n  }\n  get width() {\n    return this._width;\n  }\n  get height() {\n    return this._height;\n  }\n  get transforms() {\n    return this._transforms;\n  }\n  get transformsWidth() {\n    return this._transformsWidth;\n  }\n  get transformsHeight() {\n    return this._transformsHeight;\n  }\n  get transformIndices() {\n    return this._transformIndices;\n  }\n  get transformIndicesWidth() {\n    return this._transformIndicesWidth;\n  }\n  get transformIndicesHeight() {\n    return this._transformIndicesHeight;\n  }\n  get positions() {\n    return this._positions;\n  }\n  get rotations() {\n    return this._rotations;\n  }\n  get scales() {\n    return this._scales;\n  }\n  get vertexCount() {\n    return this._vertexCount;\n  }\n  get needsRebuild() {\n    return this._dirty.size > 0;\n  }\n  get updating() {\n    return this._updating.size > 0;\n  }\n}\nclass XU {\n  constructor(U = 0, l = 0, F = 0, Q = 255) {\n    this.r = U, this.g = l, this.b = F, this.a = Q;\n  }\n  flat() {\n    return [this.r, this.g, this.b, this.a];\n  }\n  flatNorm() {\n    return [this.r / 255, this.g / 255, this.b / 255, this.a / 255];\n  }\n  toHexString() {\n    return \"#\" + this.flat().map((U) => U.toString(16).padStart(2, \"0\")).join(\"\");\n  }\n  toString() {\n    return `[${this.flat().join(\", \")}]`;\n  }\n}\nclass SU extends QF {\n  constructor(U, l) {\n    super(U, l), this._outlineThickness = 10, this._outlineColor = new XU(255, 165, 0, 255), this._renderData = null, this._depthIndex = new Uint32Array(), this._chunks = null, this._splatTexture = null;\n    const F = U.canvas, Q = U.gl;\n    let Z, d, V, B, t, R, i, s, J, c, N, o, X, G, E, Y;\n    this._resize = () => {\n      this._camera && (this._camera.data.setSize(F.width, F.height), this._camera.update(), d = Q.getUniformLocation(this.program, \"projection\"), Q.uniformMatrix4fv(d, !1, this._camera.data.projectionMatrix.buffer), V = Q.getUniformLocation(this.program, \"viewport\"), Q.uniform2fv(V, new Float32Array([F.width, F.height])));\n    };\n    const x = () => {\n      Z = new lF(), Z.onmessage = (I) => {\n        if (I.data.depthIndex) {\n          const { depthIndex: u, chunks: q } = I.data;\n          this._depthIndex = u, this._chunks = q, Q.bindBuffer(Q.ARRAY_BUFFER, Y), Q.bufferData(Q.ARRAY_BUFFER, u, Q.STATIC_DRAW);\n        }\n      };\n    };\n    this._initialize = () => {\n      if (this._scene && this._camera) {\n        this._resize(), this._scene.addEventListener(\"objectAdded\", v), this._scene.addEventListener(\"objectRemoved\", D);\n        for (const I of this._scene.objects)\n          I instanceof tU && I.addEventListener(\"objectChanged\", p);\n        this._renderData = new BF(this._scene), B = Q.getUniformLocation(this.program, \"focal\"), Q.uniform2fv(B, new Float32Array([this._camera.data.fx, this._camera.data.fy])), t = Q.getUniformLocation(this.program, \"view\"), Q.uniformMatrix4fv(t, !1, this._camera.data.viewMatrix.buffer), J = Q.getUniformLocation(this.program, \"outlineThickness\"), Q.uniform1f(J, this.outlineThickness), c = Q.getUniformLocation(this.program, \"outlineColor\"), Q.uniform4fv(c, new Float32Array(this.outlineColor.flatNorm())), this._splatTexture = Q.createTexture(), R = Q.getUniformLocation(this.program, \"u_texture\"), Q.uniform1i(R, 0), X = Q.createTexture(), i = Q.getUniformLocation(this.program, \"u_transforms\"), Q.uniform1i(i, 1), G = Q.createTexture(), s = Q.getUniformLocation(this.program, \"u_transformIndices\"), Q.uniform1i(s, 2), E = Q.createBuffer(), Q.bindBuffer(Q.ARRAY_BUFFER, E), Q.bufferData(Q.ARRAY_BUFFER, new Float32Array([-2, -2, 2, -2, 2, 2, -2, 2]), Q.STATIC_DRAW), N = Q.getAttribLocation(this.program, \"position\"), Q.enableVertexAttribArray(N), Q.vertexAttribPointer(N, 2, Q.FLOAT, !1, 0, 0), Y = Q.createBuffer(), o = Q.getAttribLocation(this.program, \"index\"), Q.enableVertexAttribArray(o), Q.bindBuffer(Q.ARRAY_BUFFER, Y), x();\n      } else\n        console.error(\"Cannot render without scene and camera\");\n    };\n    const v = (I) => {\n      const u = I;\n      u.object instanceof tU && u.object.addEventListener(\"objectChanged\", p), this.dispose();\n    }, D = (I) => {\n      const u = I;\n      u.object instanceof tU && u.object.removeEventListener(\"objectChanged\", p), this.dispose();\n    }, p = (I) => {\n      const u = I;\n      u.object instanceof tU && this._renderData && this._renderData.markDirty(u.object);\n    };\n    this._render = () => {\n      if (this._scene && this._camera && this.renderData) {\n        if (this.renderData.needsRebuild && this.renderData.rebuild(), this.renderData.dataChanged || this.renderData.transformsChanged) {\n          this.renderData.dataChanged && (Q.activeTexture(Q.TEXTURE0), Q.bindTexture(Q.TEXTURE_2D, this.splatTexture), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_WRAP_S, Q.CLAMP_TO_EDGE), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_WRAP_T, Q.CLAMP_TO_EDGE), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_MIN_FILTER, Q.NEAREST), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_MAG_FILTER, Q.NEAREST), Q.texImage2D(Q.TEXTURE_2D, 0, Q.RGBA32UI, this.renderData.width, this.renderData.height, 0, Q.RGBA_INTEGER, Q.UNSIGNED_INT, this.renderData.data)), this.renderData.transformsChanged && (Q.activeTexture(Q.TEXTURE1), Q.bindTexture(Q.TEXTURE_2D, X), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_WRAP_S, Q.CLAMP_TO_EDGE), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_WRAP_T, Q.CLAMP_TO_EDGE), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_MIN_FILTER, Q.NEAREST), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_MAG_FILTER, Q.NEAREST), Q.texImage2D(Q.TEXTURE_2D, 0, Q.RGBA32F, this.renderData.transformsWidth, this.renderData.transformsHeight, 0, Q.RGBA, Q.FLOAT, this.renderData.transforms), Q.activeTexture(Q.TEXTURE2), Q.bindTexture(Q.TEXTURE_2D, G), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_WRAP_S, Q.CLAMP_TO_EDGE), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_WRAP_T, Q.CLAMP_TO_EDGE), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_MIN_FILTER, Q.NEAREST), Q.texParameteri(Q.TEXTURE_2D, Q.TEXTURE_MAG_FILTER, Q.NEAREST), Q.texImage2D(Q.TEXTURE_2D, 0, Q.R32UI, this.renderData.transformIndicesWidth, this.renderData.transformIndicesHeight, 0, Q.RED_INTEGER, Q.UNSIGNED_INT, this.renderData.transformIndices));\n          const I = new Float32Array(this.renderData.positions.slice().buffer), u = new Float32Array(this.renderData.transforms.slice().buffer), q = new Uint32Array(this.renderData.transformIndices.slice().buffer);\n          Z.postMessage({ sortData: { positions: I, transforms: u, transformIndices: q, vertexCount: this.renderData.vertexCount } }, [I.buffer, u.buffer, q.buffer]), this.renderData.dataChanged = !1, this.renderData.transformsChanged = !1;\n        }\n        this._camera.update(), Z.postMessage({ viewProj: this._camera.data.viewProj.buffer }), Q.viewport(0, 0, F.width, F.height), Q.clearColor(0, 0, 0, 0), Q.clear(Q.COLOR_BUFFER_BIT), Q.disable(Q.DEPTH_TEST), Q.enable(Q.BLEND), Q.blendFuncSeparate(Q.ONE_MINUS_DST_ALPHA, Q.ONE, Q.ONE_MINUS_DST_ALPHA, Q.ONE), Q.blendEquationSeparate(Q.FUNC_ADD, Q.FUNC_ADD), Q.uniformMatrix4fv(d, !1, this._camera.data.projectionMatrix.buffer), Q.uniformMatrix4fv(t, !1, this._camera.data.viewMatrix.buffer), Q.bindBuffer(Q.ARRAY_BUFFER, E), Q.vertexAttribPointer(N, 2, Q.FLOAT, !1, 0, 0), Q.bindBuffer(Q.ARRAY_BUFFER, Y), Q.bufferData(Q.ARRAY_BUFFER, this.depthIndex, Q.STATIC_DRAW), Q.vertexAttribIPointer(o, 1, Q.INT, 0, 0), Q.vertexAttribDivisor(o, 1), Q.drawArraysInstanced(Q.TRIANGLE_FAN, 0, 4, this.renderData.vertexCount);\n      } else\n        console.error(\"Cannot render without scene and camera\");\n    }, this._dispose = () => {\n      if (this._scene && this._camera && this.renderData) {\n        this._scene.removeEventListener(\"objectAdded\", v), this._scene.removeEventListener(\"objectRemoved\", D);\n        for (const I of this._scene.objects)\n          I instanceof tU && I.removeEventListener(\"objectChanged\", p);\n        Z.terminate(), this.renderData.dispose(), Q.deleteTexture(this.splatTexture), Q.deleteTexture(X), Q.deleteTexture(G), Q.deleteBuffer(Y), Q.deleteBuffer(E);\n      } else\n        console.error(\"Cannot dispose without scene and camera\");\n    }, this._setOutlineThickness = (I) => {\n      this._outlineThickness = I, this._initialized && Q.uniform1f(J, I);\n    }, this._setOutlineColor = (I) => {\n      this._outlineColor = I, this._initialized && Q.uniform4fv(c, new Float32Array(I.flatNorm()));\n    };\n  }\n  get renderData() {\n    return this._renderData;\n  }\n  get depthIndex() {\n    return this._depthIndex;\n  }\n  get chunks() {\n    return this._chunks;\n  }\n  get splatTexture() {\n    return this._splatTexture;\n  }\n  get outlineThickness() {\n    return this._outlineThickness;\n  }\n  set outlineThickness(U) {\n    this._setOutlineThickness(U);\n  }\n  get outlineColor() {\n    return this._outlineColor;\n  }\n  set outlineColor(U) {\n    this._setOutlineColor(U);\n  }\n  _getVertexSource() {\n    return `#version 300 es\nprecision highp float;\nprecision highp int;\n\nuniform highp usampler2D u_texture;\nuniform highp sampler2D u_transforms;\nuniform highp usampler2D u_transformIndices;\nuniform mat4 projection, view;\nuniform vec2 focal;\nuniform vec2 viewport;\n\nuniform bool useDepthFade;\nuniform float depthFade;\n\nin vec2 position;\nin int index;\n\nout vec4 vColor;\nout vec2 vPosition;\nout float vSize;\nout float vSelected;\n\nvoid main () {\n    uvec4 cen = texelFetch(u_texture, ivec2((uint(index) & 0x3ffu) << 1, uint(index) >> 10), 0);\n    float selected = float((cen.w >> 24) & 0xffu);\n\n    uint transformIndex = texelFetch(u_transformIndices, ivec2(uint(index) & 0x3ffu, uint(index) >> 10), 0).x;\n    mat4 transform = mat4(\n        texelFetch(u_transforms, ivec2(0, transformIndex), 0),\n        texelFetch(u_transforms, ivec2(1, transformIndex), 0),\n        texelFetch(u_transforms, ivec2(2, transformIndex), 0),\n        texelFetch(u_transforms, ivec2(3, transformIndex), 0)\n    );\n\n    if (selected < 0.5) {\n        selected = texelFetch(u_transforms, ivec2(4, transformIndex), 0).x;\n    }\n\n    mat4 viewTransform = view * transform;\n\n    vec4 cam = viewTransform * vec4(uintBitsToFloat(cen.xyz), 1);\n    vec4 pos2d = projection * cam;\n\n    float clip = 1.2 * pos2d.w;\n    if (pos2d.z < -pos2d.w || pos2d.z > pos2d.w || pos2d.x < -clip || pos2d.x > clip || pos2d.y < -clip || pos2d.y > clip) {\n        gl_Position = vec4(0.0, 0.0, 2.0, 1.0);\n        return;\n    }\n\n    uvec4 cov = texelFetch(u_texture, ivec2(((uint(index) & 0x3ffu) << 1) | 1u, uint(index) >> 10), 0);\n    vec2 u1 = unpackHalf2x16(cov.x), u2 = unpackHalf2x16(cov.y), u3 = unpackHalf2x16(cov.z);\n    mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);\n\n    mat3 J = mat3(\n        focal.x / cam.z, 0., -(focal.x * cam.x) / (cam.z * cam.z), \n        0., -focal.y / cam.z, (focal.y * cam.y) / (cam.z * cam.z), \n        0., 0., 0.\n    );\n\n    mat3 T = transpose(mat3(viewTransform)) * J;\n    mat3 cov2d = transpose(T) * Vrk * T;\n\n    float mid = (cov2d[0][0] + cov2d[1][1]) / 2.0;\n    float radius = length(vec2((cov2d[0][0] - cov2d[1][1]) / 2.0, cov2d[0][1]));\n    float lambda1 = mid + radius, lambda2 = mid - radius;\n\n    if (lambda2 < 0.0) return;\n    vec2 diagonalVector = normalize(vec2(cov2d[0][1], lambda1 - cov2d[0][0]));\n    vec2 majorAxis = min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector;\n    vec2 minorAxis = min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x);\n\n    vColor = vec4((cov.w) & 0xffu, (cov.w >> 8) & 0xffu, (cov.w >> 16) & 0xffu, (cov.w >> 24) & 0xffu) / 255.0;\n    vPosition = position;\n    vSize = length(majorAxis);\n    vSelected = selected;\n\n    float scalingFactor = 1.0;\n\n    if (useDepthFade) {\n        float depthNorm = (pos2d.z / pos2d.w + 1.0) / 2.0;\n        float near = 0.1; float far = 100.0;\n        float normalizedDepth = (2.0 * near) / (far + near - depthNorm * (far - near));\n        float start = max(normalizedDepth - 0.1, 0.0);\n        float end = min(normalizedDepth + 0.1, 1.0);\n        scalingFactor = clamp((depthFade - start) / (end - start), 0.0, 1.0);\n    }\n\n    vec2 vCenter = vec2(pos2d) / pos2d.w;\n    gl_Position = vec4(\n        vCenter \n        + position.x * majorAxis * scalingFactor / viewport\n        + position.y * minorAxis * scalingFactor / viewport, 0.0, 1.0);\n}\n`;\n  }\n  _getFragmentSource() {\n    return `#version 300 es\nprecision highp float;\n\nuniform float outlineThickness;\nuniform vec4 outlineColor;\n\nin vec4 vColor;\nin vec2 vPosition;\nin float vSize;\nin float vSelected;\n\nout vec4 fragColor;\n\nvoid main () {\n    float A = -dot(vPosition, vPosition);\n\n    if (A < -4.0) discard;\n\n    if (vSelected < 0.5) {\n        float B = exp(A) * vColor.a;\n        fragColor = vec4(B * vColor.rgb, B);\n        return;\n    }\n\n    float outlineThreshold = -4.0 + (outlineThickness / vSize);\n\n    if (A < outlineThreshold) {\n        fragColor = outlineColor;\n    } \n    else {\n        float B = exp(A) * vColor.a;\n        fragColor = vec4(B * vColor.rgb, B);\n    }\n}\n`;\n  }\n}\nclass VF {\n  constructor(U = 1) {\n    let l, F, Q, Z, d = 0, V = !1;\n    this.initialize = (B) => {\n      if (!(B instanceof SU))\n        throw new Error(\"FadeInPass requires a RenderProgram\");\n      d = B.started ? 1 : 0, V = !0, l = B, F = B.renderer.gl, Q = F.getUniformLocation(l.program, \"useDepthFade\"), F.uniform1i(Q, 1), Z = F.getUniformLocation(l.program, \"depthFade\"), F.uniform1f(Z, d);\n    }, this.render = () => {\n      var B;\n      V && !(!((B = l.renderData) === null || B === void 0) && B.updating) && (F.useProgram(l.program), d = Math.min(d + 0.01 * U, 1), d >= 1 && (V = !1, F.uniform1i(Q, 0)), F.uniform1f(Z, d));\n    };\n  }\n  dispose() {\n  }\n}\nclass ZF {\n  constructor(U = null, l = null) {\n    this._backgroundColor = new XU();\n    const F = U || document.createElement(\"canvas\");\n    U || (F.style.display = \"block\", F.style.boxSizing = \"border-box\", F.style.width = \"100%\", F.style.height = \"100%\", F.style.margin = \"0\", F.style.padding = \"0\", document.body.appendChild(F)), F.style.background = this._backgroundColor.toHexString(), this._canvas = F, this._gl = F.getContext(\"webgl2\", { antialias: !1 });\n    const Q = l || [];\n    l || Q.push(new VF()), this._renderProgram = new SU(this, Q);\n    const Z = [this._renderProgram];\n    this.resize = () => {\n      const d = F.clientWidth, V = F.clientHeight;\n      F.width === d && F.height === V || this.setSize(d, V);\n    }, this.setSize = (d, V) => {\n      F.width = d, F.height = V, this._gl.viewport(0, 0, F.width, F.height);\n      for (const B of Z)\n        B.resize();\n    }, this.render = (d, V) => {\n      for (const B of Z)\n        B.render(d, V);\n    }, this.dispose = () => {\n      for (const d of Z)\n        d.dispose();\n    }, this.addProgram = (d) => {\n      Z.push(d);\n    }, this.removeProgram = (d) => {\n      const V = Z.indexOf(d);\n      if (V < 0)\n        throw new Error(\"Program not found\");\n      Z.splice(V, 1);\n    }, this.resize();\n  }\n  get canvas() {\n    return this._canvas;\n  }\n  get gl() {\n    return this._gl;\n  }\n  get renderProgram() {\n    return this._renderProgram;\n  }\n  get backgroundColor() {\n    return this._backgroundColor;\n  }\n  set backgroundColor(U) {\n    this._backgroundColor = U, this._canvas.style.background = U.toHexString();\n  }\n}\nclass nF {\n  constructor(U, l, F = 0.5, Q = 0.5, Z = 5, d = !0, V = new S()) {\n    this.minAngle = -90, this.maxAngle = 90, this.minZoom = 0.1, this.maxZoom = 30, this.orbitSpeed = 1, this.panSpeed = 1, this.zoomSpeed = 1, this.dampening = 0.12, this.setCameraTarget = () => {\n    };\n    let B = V.clone(), t = B.clone(), R = F, i = Q, s = Z, J = !1, c = !1, N = 0, o = 0, X = 0;\n    const G = {};\n    let E = !1;\n    U.addEventListener(\"objectChanged\", () => {\n      if (E)\n        return;\n      const a = U.rotation.toEuler();\n      R = -a.y, i = -a.x;\n      const k = U.position.x - s * Math.sin(R) * Math.cos(i), T = U.position.y + s * Math.sin(i), M = U.position.z + s * Math.cos(R) * Math.cos(i);\n      t = new S(k, T, M);\n    }), this.setCameraTarget = (a) => {\n      const k = a.x - U.position.x, T = a.y - U.position.y, M = a.z - U.position.z;\n      s = Math.sqrt(k * k + T * T + M * M), i = Math.atan2(T, Math.sqrt(k * k + M * M)), R = -Math.atan2(k, M), t = new S(a.x, a.y, a.z);\n    };\n    const Y = () => 0.1 + 0.9 * (s - this.minZoom) / (this.maxZoom - this.minZoom), x = (a) => {\n      G[a.code] = !0, a.code === \"ArrowUp\" && (G.KeyW = !0), a.code === \"ArrowDown\" && (G.KeyS = !0), a.code === \"ArrowLeft\" && (G.KeyA = !0), a.code === \"ArrowRight\" && (G.KeyD = !0);\n    }, v = (a) => {\n      G[a.code] = !1, a.code === \"ArrowUp\" && (G.KeyW = !1), a.code === \"ArrowDown\" && (G.KeyS = !1), a.code === \"ArrowLeft\" && (G.KeyA = !1), a.code === \"ArrowRight\" && (G.KeyD = !1);\n    }, D = (a) => {\n      j(a), J = !0, c = a.button === 2, o = a.clientX, X = a.clientY, window.addEventListener(\"mouseup\", p);\n    }, p = (a) => {\n      j(a), J = !1, c = !1, window.removeEventListener(\"mouseup\", p);\n    }, I = (a) => {\n      if (j(a), !J || !U)\n        return;\n      const k = a.clientX - o, T = a.clientY - X;\n      if (c) {\n        const M = Y(), UU = -k * this.panSpeed * 0.01 * M, VU = -T * this.panSpeed * 0.01 * M, O = dU.RotationFromQuaternion(U.rotation).buffer, $ = new S(O[0], O[3], O[6]), f = new S(O[1], O[4], O[7]);\n        t = t.add($.multiply(UU)), t = t.add(f.multiply(VU));\n      } else\n        R -= k * this.orbitSpeed * 3e-3, i += T * this.orbitSpeed * 3e-3, i = Math.min(Math.max(i, this.minAngle * Math.PI / 180), this.maxAngle * Math.PI / 180);\n      o = a.clientX, X = a.clientY;\n    }, u = (a) => {\n      j(a);\n      const k = Y();\n      s += a.deltaY * this.zoomSpeed * 0.025 * k, s = Math.min(Math.max(s, this.minZoom), this.maxZoom);\n    }, q = (a) => {\n      if (j(a), a.touches.length === 1)\n        J = !0, c = !1, o = a.touches[0].clientX, X = a.touches[0].clientY, N = 0;\n      else if (a.touches.length === 2) {\n        J = !0, c = !0, o = (a.touches[0].clientX + a.touches[1].clientX) / 2, X = (a.touches[0].clientY + a.touches[1].clientY) / 2;\n        const k = a.touches[0].clientX - a.touches[1].clientX, T = a.touches[0].clientY - a.touches[1].clientY;\n        N = Math.sqrt(k * k + T * T);\n      }\n    }, ZU = (a) => {\n      j(a), J = !1, c = !1;\n    }, RU = (a) => {\n      if (j(a), J && U)\n        if (c) {\n          const k = Y(), T = a.touches[0].clientX - a.touches[1].clientX, M = a.touches[0].clientY - a.touches[1].clientY, UU = Math.sqrt(T * T + M * M);\n          s += (N - UU) * this.zoomSpeed * 0.1 * k, s = Math.min(Math.max(s, this.minZoom), this.maxZoom), N = UU;\n          const VU = (a.touches[0].clientX + a.touches[1].clientX) / 2, O = (a.touches[0].clientY + a.touches[1].clientY) / 2, $ = VU - o, f = O - X, FU = dU.RotationFromQuaternion(U.rotation).buffer, lU = new S(FU[0], FU[3], FU[6]), sU = new S(FU[1], FU[4], FU[7]);\n          t = t.add(lU.multiply(-$ * this.panSpeed * 0.025 * k)), t = t.add(sU.multiply(-f * this.panSpeed * 0.025 * k)), o = VU, X = O;\n        } else {\n          const k = a.touches[0].clientX - o, T = a.touches[0].clientY - X;\n          R -= k * this.orbitSpeed * 3e-3, i += T * this.orbitSpeed * 3e-3, i = Math.min(Math.max(i, this.minAngle * Math.PI / 180), this.maxAngle * Math.PI / 180), o = a.touches[0].clientX, X = a.touches[0].clientY;\n        }\n    }, nU = (a, k, T) => (1 - T) * a + T * k;\n    this.update = () => {\n      E = !0, F = nU(F, R, this.dampening), Q = nU(Q, i, this.dampening), Z = nU(Z, s, this.dampening), B = B.lerp(t, this.dampening);\n      const a = B.x + Z * Math.sin(F) * Math.cos(Q), k = B.y - Z * Math.sin(Q), T = B.z - Z * Math.cos(F) * Math.cos(Q);\n      U.position = new S(a, k, T);\n      const M = B.subtract(U.position).normalize(), UU = Math.asin(-M.y), VU = Math.atan2(M.x, M.z);\n      U.rotation = K.FromEuler(new S(UU, VU, 0));\n      const O = 0.025, $ = 0.01, f = dU.RotationFromQuaternion(U.rotation).buffer, FU = new S(-f[2], -f[5], -f[8]), lU = new S(f[0], f[3], f[6]);\n      G.KeyS && (t = t.add(FU.multiply(O))), G.KeyW && (t = t.subtract(FU.multiply(O))), G.KeyA && (t = t.subtract(lU.multiply(O))), G.KeyD && (t = t.add(lU.multiply(O))), G.KeyE && (R += $), G.KeyQ && (R -= $), G.KeyR && (i += $), G.KeyF && (i -= $), E = !1;\n    };\n    const j = (a) => {\n      a.preventDefault(), a.stopPropagation();\n    };\n    this.dispose = () => {\n      l.removeEventListener(\"dragenter\", j), l.removeEventListener(\"dragover\", j), l.removeEventListener(\"dragleave\", j), l.removeEventListener(\"contextmenu\", j), l.removeEventListener(\"mousedown\", D), l.removeEventListener(\"mousemove\", I), l.removeEventListener(\"wheel\", u), l.removeEventListener(\"touchstart\", q), l.removeEventListener(\"touchend\", ZU), l.removeEventListener(\"touchmove\", RU), d && (window.removeEventListener(\"keydown\", x), window.removeEventListener(\"keyup\", v));\n    }, d && (window.addEventListener(\"keydown\", x), window.addEventListener(\"keyup\", v)), l.addEventListener(\"dragenter\", j), l.addEventListener(\"dragover\", j), l.addEventListener(\"dragleave\", j), l.addEventListener(\"contextmenu\", j), l.addEventListener(\"mousedown\", D), l.addEventListener(\"mousemove\", I), l.addEventListener(\"wheel\", u), l.addEventListener(\"touchstart\", q), l.addEventListener(\"touchend\", ZU), l.addEventListener(\"touchmove\", RU), this.update();\n  }\n}\nconst {\n  SvelteComponent: AF,\n  binding_callbacks: RF,\n  detach: eF,\n  element: WF,\n  init: cF,\n  insert: aF,\n  noop: bU,\n  safe_not_equal: iF\n} = window.__gradio__svelte__internal, { onMount: hF } = window.__gradio__svelte__internal;\nfunction sF(r) {\n  let U;\n  return {\n    c() {\n      U = WF(\"canvas\");\n    },\n    m(l, F) {\n      aF(l, U, F), r[9](U);\n    },\n    p: bU,\n    i: bU,\n    o: bU,\n    d(l) {\n      l && eF(U), r[9](null);\n    }\n  };\n}\nfunction IF(r, U) {\n  return r ?? U();\n}\nfunction JF(r, U, l) {\n  let F, Q, { value: Z } = U, { zoom_speed: d } = U, { pan_speed: V } = U, { resolved_url: B = void 0 } = U, t, R, i, s, J = null, c, N = !1, o = null;\n  function X() {\n    if (o !== null && (cancelAnimationFrame(o), o = null), J !== null && (J.dispose(), J = null), i = new qU(), s = new _U(), J = new ZF(R), c = new nF(s, R), c.zoomSpeed = d, c.panSpeed = V, !Z)\n      return;\n    let E = !1;\n    const Y = async () => {\n      if (E) {\n        console.error(\"Already loading\");\n        return;\n      }\n      if (!B)\n        throw new Error(\"No resolved URL\");\n      if (E = !0, B.endsWith(\".ply\"))\n        await UF.LoadAsync(B, i, void 0);\n      else if (B.endsWith(\".splat\"))\n        await $U.LoadAsync(B, i, void 0);\n      else\n        throw new Error(\"Unsupported file type\");\n      E = !1;\n    }, x = () => {\n      if (J) {\n        if (E) {\n          o = requestAnimationFrame(x);\n          return;\n        }\n        c.update(), J.render(i, s), o = requestAnimationFrame(x);\n      }\n    };\n    Y(), o = requestAnimationFrame(x);\n  }\n  hF(() => (Z != null && X(), l(6, N = !0), () => {\n    J && J.dispose();\n  }));\n  function G(E) {\n    RF[E ? \"unshift\" : \"push\"](() => {\n      R = E, l(0, R);\n    });\n  }\n  return r.$$set = (E) => {\n    \"value\" in E && l(2, Z = E.value), \"zoom_speed\" in E && l(3, d = E.zoom_speed), \"pan_speed\" in E && l(4, V = E.pan_speed), \"resolved_url\" in E && l(1, B = E.resolved_url);\n  }, r.$$.update = () => {\n    if (r.$$.dirty & /*value*/\n    4 && l(8, F = Z.url), r.$$.dirty & /*url, latest_url*/\n    288 && (l(1, B = F), F)) {\n      l(5, t = F);\n      const E = F;\n      KU(F).then((Y) => {\n        t === E ? l(1, B = IF(Y, () => {\n        })) : Y && URL.revokeObjectURL(Y);\n      });\n    }\n    r.$$.dirty & /*value*/\n    4 && l(7, { path: Q } = Z || { path: void 0 }, Q), r.$$.dirty & /*canvas, mounted, path*/\n    193 && R && N && Q && X();\n  }, [\n    R,\n    B,\n    Z,\n    d,\n    V,\n    t,\n    N,\n    Q,\n    F,\n    G\n  ];\n}\nclass oF extends AF {\n  constructor(U) {\n    super(), cF(this, U, JF, sF, iF, {\n      value: 2,\n      zoom_speed: 3,\n      pan_speed: 4,\n      resolved_url: 1\n    });\n  }\n}\nexport {\n  oF as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/Index-0bb1de05.js",
    "content": "const {\n  SvelteComponent: Ml,\n  assign: Dl,\n  create_slot: Rl,\n  detach: Ul,\n  element: Fl,\n  get_all_dirty_from_scope: Gl,\n  get_slot_changes: ql,\n  get_spread_update: jl,\n  init: zl,\n  insert: Vl,\n  safe_not_equal: Xl,\n  set_dynamic_element_data: Kr,\n  set_style: ue,\n  toggle_class: qe,\n  transition_in: po,\n  transition_out: go,\n  update_slot_base: xl\n} = window.__gradio__svelte__internal;\nfunction Wl(e) {\n  let t, n, r;\n  const i = (\n    /*#slots*/\n    e[18].default\n  ), o = Rl(\n    i,\n    e,\n    /*$$scope*/\n    e[17],\n    null\n  );\n  let l = [\n    { \"data-testid\": (\n      /*test_id*/\n      e[7]\n    ) },\n    { id: (\n      /*elem_id*/\n      e[2]\n    ) },\n    {\n      class: n = \"block \" + /*elem_classes*/\n      e[3].join(\" \") + \" svelte-1t38q2d\"\n    }\n  ], a = {};\n  for (let s = 0; s < l.length; s += 1)\n    a = Dl(a, l[s]);\n  return {\n    c() {\n      t = Fl(\n        /*tag*/\n        e[14]\n      ), o && o.c(), Kr(\n        /*tag*/\n        e[14]\n      )(t, a), qe(\n        t,\n        \"hidden\",\n        /*visible*/\n        e[10] === !1\n      ), qe(\n        t,\n        \"padded\",\n        /*padding*/\n        e[6]\n      ), qe(\n        t,\n        \"border_focus\",\n        /*border_mode*/\n        e[5] === \"focus\"\n      ), qe(t, \"hide-container\", !/*explicit_call*/\n      e[8] && !/*container*/\n      e[9]), ue(\n        t,\n        \"height\",\n        /*get_dimension*/\n        e[15](\n          /*height*/\n          e[0]\n        )\n      ), ue(t, \"width\", typeof /*width*/\n      e[1] == \"number\" ? `calc(min(${/*width*/\n      e[1]}px, 100%))` : (\n        /*get_dimension*/\n        e[15](\n          /*width*/\n          e[1]\n        )\n      )), ue(\n        t,\n        \"border-style\",\n        /*variant*/\n        e[4]\n      ), ue(\n        t,\n        \"overflow\",\n        /*allow_overflow*/\n        e[11] ? \"visible\" : \"hidden\"\n      ), ue(\n        t,\n        \"flex-grow\",\n        /*scale*/\n        e[12]\n      ), ue(t, \"min-width\", `calc(min(${/*min_width*/\n      e[13]}px, 100%))`), ue(t, \"border-width\", \"var(--block-border-width)\");\n    },\n    m(s, u) {\n      Vl(s, t, u), o && o.m(t, null), r = !0;\n    },\n    p(s, u) {\n      o && o.p && (!r || u & /*$$scope*/\n      131072) && xl(\n        o,\n        i,\n        s,\n        /*$$scope*/\n        s[17],\n        r ? ql(\n          i,\n          /*$$scope*/\n          s[17],\n          u,\n          null\n        ) : Gl(\n          /*$$scope*/\n          s[17]\n        ),\n        null\n      ), Kr(\n        /*tag*/\n        s[14]\n      )(t, a = jl(l, [\n        (!r || u & /*test_id*/\n        128) && { \"data-testid\": (\n          /*test_id*/\n          s[7]\n        ) },\n        (!r || u & /*elem_id*/\n        4) && { id: (\n          /*elem_id*/\n          s[2]\n        ) },\n        (!r || u & /*elem_classes*/\n        8 && n !== (n = \"block \" + /*elem_classes*/\n        s[3].join(\" \") + \" svelte-1t38q2d\")) && { class: n }\n      ])), qe(\n        t,\n        \"hidden\",\n        /*visible*/\n        s[10] === !1\n      ), qe(\n        t,\n        \"padded\",\n        /*padding*/\n        s[6]\n      ), qe(\n        t,\n        \"border_focus\",\n        /*border_mode*/\n        s[5] === \"focus\"\n      ), qe(t, \"hide-container\", !/*explicit_call*/\n      s[8] && !/*container*/\n      s[9]), u & /*height*/\n      1 && ue(\n        t,\n        \"height\",\n        /*get_dimension*/\n        s[15](\n          /*height*/\n          s[0]\n        )\n      ), u & /*width*/\n      2 && ue(t, \"width\", typeof /*width*/\n      s[1] == \"number\" ? `calc(min(${/*width*/\n      s[1]}px, 100%))` : (\n        /*get_dimension*/\n        s[15](\n          /*width*/\n          s[1]\n        )\n      )), u & /*variant*/\n      16 && ue(\n        t,\n        \"border-style\",\n        /*variant*/\n        s[4]\n      ), u & /*allow_overflow*/\n      2048 && ue(\n        t,\n        \"overflow\",\n        /*allow_overflow*/\n        s[11] ? \"visible\" : \"hidden\"\n      ), u & /*scale*/\n      4096 && ue(\n        t,\n        \"flex-grow\",\n        /*scale*/\n        s[12]\n      ), u & /*min_width*/\n      8192 && ue(t, \"min-width\", `calc(min(${/*min_width*/\n      s[13]}px, 100%))`);\n    },\n    i(s) {\n      r || (po(o, s), r = !0);\n    },\n    o(s) {\n      go(o, s), r = !1;\n    },\n    d(s) {\n      s && Ul(t), o && o.d(s);\n    }\n  };\n}\nfunction Zl(e) {\n  let t, n = (\n    /*tag*/\n    e[14] && Wl(e)\n  );\n  return {\n    c() {\n      n && n.c();\n    },\n    m(r, i) {\n      n && n.m(r, i), t = !0;\n    },\n    p(r, [i]) {\n      /*tag*/\n      r[14] && n.p(r, i);\n    },\n    i(r) {\n      t || (po(n, r), t = !0);\n    },\n    o(r) {\n      go(n, r), t = !1;\n    },\n    d(r) {\n      n && n.d(r);\n    }\n  };\n}\nfunction Jl(e, t, n) {\n  let { $$slots: r = {}, $$scope: i } = t, { height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: a = \"\" } = t, { elem_classes: s = [] } = t, { variant: u = \"solid\" } = t, { border_mode: f = \"base\" } = t, { padding: c = !0 } = t, { type: _ = \"normal\" } = t, { test_id: h = void 0 } = t, { explicit_call: d = !1 } = t, { container: m = !0 } = t, { visible: v = !0 } = t, { allow_overflow: y = !0 } = t, { scale: k = null } = t, { min_width: b = 0 } = t, p = _ === \"fieldset\" ? \"fieldset\" : \"div\";\n  const P = (S) => {\n    if (S !== void 0) {\n      if (typeof S == \"number\")\n        return S + \"px\";\n      if (typeof S == \"string\")\n        return S;\n    }\n  };\n  return e.$$set = (S) => {\n    \"height\" in S && n(0, o = S.height), \"width\" in S && n(1, l = S.width), \"elem_id\" in S && n(2, a = S.elem_id), \"elem_classes\" in S && n(3, s = S.elem_classes), \"variant\" in S && n(4, u = S.variant), \"border_mode\" in S && n(5, f = S.border_mode), \"padding\" in S && n(6, c = S.padding), \"type\" in S && n(16, _ = S.type), \"test_id\" in S && n(7, h = S.test_id), \"explicit_call\" in S && n(8, d = S.explicit_call), \"container\" in S && n(9, m = S.container), \"visible\" in S && n(10, v = S.visible), \"allow_overflow\" in S && n(11, y = S.allow_overflow), \"scale\" in S && n(12, k = S.scale), \"min_width\" in S && n(13, b = S.min_width), \"$$scope\" in S && n(17, i = S.$$scope);\n  }, [\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c,\n    h,\n    d,\n    m,\n    v,\n    y,\n    k,\n    b,\n    p,\n    P,\n    _,\n    i,\n    r\n  ];\n}\nclass bo extends Ml {\n  constructor(t) {\n    super(), zl(this, t, Jl, Zl, Xl, {\n      height: 0,\n      width: 1,\n      elem_id: 2,\n      elem_classes: 3,\n      variant: 4,\n      border_mode: 5,\n      padding: 6,\n      type: 16,\n      test_id: 7,\n      explicit_call: 8,\n      container: 9,\n      visible: 10,\n      allow_overflow: 11,\n      scale: 12,\n      min_width: 13\n    });\n  }\n}\nconst {\n  SvelteComponent: Ql,\n  append: jn,\n  attr: tn,\n  create_component: Yl,\n  destroy_component: Kl,\n  detach: $l,\n  element: $r,\n  init: es,\n  insert: ts,\n  mount_component: ns,\n  safe_not_equal: rs,\n  set_data: is,\n  space: os,\n  text: ls,\n  toggle_class: je,\n  transition_in: ss,\n  transition_out: as\n} = window.__gradio__svelte__internal;\nfunction us(e) {\n  let t, n, r, i, o, l;\n  return r = new /*Icon*/\n  e[1]({}), {\n    c() {\n      t = $r(\"label\"), n = $r(\"span\"), Yl(r.$$.fragment), i = os(), o = ls(\n        /*label*/\n        e[0]\n      ), tn(n, \"class\", \"svelte-9gxdi0\"), tn(t, \"for\", \"\"), tn(t, \"data-testid\", \"block-label\"), tn(t, \"class\", \"svelte-9gxdi0\"), je(t, \"hide\", !/*show_label*/\n      e[2]), je(t, \"sr-only\", !/*show_label*/\n      e[2]), je(\n        t,\n        \"float\",\n        /*float*/\n        e[4]\n      ), je(\n        t,\n        \"hide-label\",\n        /*disable*/\n        e[3]\n      );\n    },\n    m(a, s) {\n      ts(a, t, s), jn(t, n), ns(r, n, null), jn(t, i), jn(t, o), l = !0;\n    },\n    p(a, [s]) {\n      (!l || s & /*label*/\n      1) && is(\n        o,\n        /*label*/\n        a[0]\n      ), (!l || s & /*show_label*/\n      4) && je(t, \"hide\", !/*show_label*/\n      a[2]), (!l || s & /*show_label*/\n      4) && je(t, \"sr-only\", !/*show_label*/\n      a[2]), (!l || s & /*float*/\n      16) && je(\n        t,\n        \"float\",\n        /*float*/\n        a[4]\n      ), (!l || s & /*disable*/\n      8) && je(\n        t,\n        \"hide-label\",\n        /*disable*/\n        a[3]\n      );\n    },\n    i(a) {\n      l || (ss(r.$$.fragment, a), l = !0);\n    },\n    o(a) {\n      as(r.$$.fragment, a), l = !1;\n    },\n    d(a) {\n      a && $l(t), Kl(r);\n    }\n  };\n}\nfunction fs(e, t, n) {\n  let { label: r = null } = t, { Icon: i } = t, { show_label: o = !0 } = t, { disable: l = !1 } = t, { float: a = !0 } = t;\n  return e.$$set = (s) => {\n    \"label\" in s && n(0, r = s.label), \"Icon\" in s && n(1, i = s.Icon), \"show_label\" in s && n(2, o = s.show_label), \"disable\" in s && n(3, l = s.disable), \"float\" in s && n(4, a = s.float);\n  }, [r, i, o, l, a];\n}\nclass Fr extends Ql {\n  constructor(t) {\n    super(), es(this, t, fs, us, rs, {\n      label: 0,\n      Icon: 1,\n      show_label: 2,\n      disable: 3,\n      float: 4\n    });\n  }\n}\nconst {\n  SvelteComponent: cs,\n  append: gr,\n  attr: Ue,\n  bubble: _s,\n  create_component: hs,\n  destroy_component: ds,\n  detach: vo,\n  element: br,\n  init: ms,\n  insert: wo,\n  listen: ps,\n  mount_component: gs,\n  safe_not_equal: bs,\n  set_data: vs,\n  set_style: nn,\n  space: ws,\n  text: ys,\n  toggle_class: he,\n  transition_in: Es,\n  transition_out: Ss\n} = window.__gradio__svelte__internal;\nfunction ei(e) {\n  let t, n;\n  return {\n    c() {\n      t = br(\"span\"), n = ys(\n        /*label*/\n        e[1]\n      ), Ue(t, \"class\", \"svelte-lpi64a\");\n    },\n    m(r, i) {\n      wo(r, t, i), gr(t, n);\n    },\n    p(r, i) {\n      i & /*label*/\n      2 && vs(\n        n,\n        /*label*/\n        r[1]\n      );\n    },\n    d(r) {\n      r && vo(t);\n    }\n  };\n}\nfunction ks(e) {\n  let t, n, r, i, o, l, a, s = (\n    /*show_label*/\n    e[2] && ei(e)\n  );\n  return i = new /*Icon*/\n  e[0]({}), {\n    c() {\n      t = br(\"button\"), s && s.c(), n = ws(), r = br(\"div\"), hs(i.$$.fragment), Ue(r, \"class\", \"svelte-lpi64a\"), he(\n        r,\n        \"small\",\n        /*size*/\n        e[4] === \"small\"\n      ), he(\n        r,\n        \"large\",\n        /*size*/\n        e[4] === \"large\"\n      ), t.disabled = /*disabled*/\n      e[7], Ue(\n        t,\n        \"aria-label\",\n        /*label*/\n        e[1]\n      ), Ue(\n        t,\n        \"aria-haspopup\",\n        /*hasPopup*/\n        e[8]\n      ), Ue(\n        t,\n        \"title\",\n        /*label*/\n        e[1]\n      ), Ue(t, \"class\", \"svelte-lpi64a\"), he(\n        t,\n        \"pending\",\n        /*pending*/\n        e[3]\n      ), he(\n        t,\n        \"padded\",\n        /*padded*/\n        e[5]\n      ), he(\n        t,\n        \"highlight\",\n        /*highlight*/\n        e[6]\n      ), he(\n        t,\n        \"transparent\",\n        /*transparent*/\n        e[9]\n      ), nn(t, \"color\", !/*disabled*/\n      e[7] && /*_color*/\n      e[11] ? (\n        /*_color*/\n        e[11]\n      ) : \"var(--block-label-text-color)\"), nn(t, \"--bg-color\", /*disabled*/\n      e[7] ? \"auto\" : (\n        /*background*/\n        e[10]\n      ));\n    },\n    m(u, f) {\n      wo(u, t, f), s && s.m(t, null), gr(t, n), gr(t, r), gs(i, r, null), o = !0, l || (a = ps(\n        t,\n        \"click\",\n        /*click_handler*/\n        e[13]\n      ), l = !0);\n    },\n    p(u, [f]) {\n      /*show_label*/\n      u[2] ? s ? s.p(u, f) : (s = ei(u), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!o || f & /*size*/\n      16) && he(\n        r,\n        \"small\",\n        /*size*/\n        u[4] === \"small\"\n      ), (!o || f & /*size*/\n      16) && he(\n        r,\n        \"large\",\n        /*size*/\n        u[4] === \"large\"\n      ), (!o || f & /*disabled*/\n      128) && (t.disabled = /*disabled*/\n      u[7]), (!o || f & /*label*/\n      2) && Ue(\n        t,\n        \"aria-label\",\n        /*label*/\n        u[1]\n      ), (!o || f & /*hasPopup*/\n      256) && Ue(\n        t,\n        \"aria-haspopup\",\n        /*hasPopup*/\n        u[8]\n      ), (!o || f & /*label*/\n      2) && Ue(\n        t,\n        \"title\",\n        /*label*/\n        u[1]\n      ), (!o || f & /*pending*/\n      8) && he(\n        t,\n        \"pending\",\n        /*pending*/\n        u[3]\n      ), (!o || f & /*padded*/\n      32) && he(\n        t,\n        \"padded\",\n        /*padded*/\n        u[5]\n      ), (!o || f & /*highlight*/\n      64) && he(\n        t,\n        \"highlight\",\n        /*highlight*/\n        u[6]\n      ), (!o || f & /*transparent*/\n      512) && he(\n        t,\n        \"transparent\",\n        /*transparent*/\n        u[9]\n      ), f & /*disabled, _color*/\n      2176 && nn(t, \"color\", !/*disabled*/\n      u[7] && /*_color*/\n      u[11] ? (\n        /*_color*/\n        u[11]\n      ) : \"var(--block-label-text-color)\"), f & /*disabled, background*/\n      1152 && nn(t, \"--bg-color\", /*disabled*/\n      u[7] ? \"auto\" : (\n        /*background*/\n        u[10]\n      ));\n    },\n    i(u) {\n      o || (Es(i.$$.fragment, u), o = !0);\n    },\n    o(u) {\n      Ss(i.$$.fragment, u), o = !1;\n    },\n    d(u) {\n      u && vo(t), s && s.d(), ds(i), l = !1, a();\n    }\n  };\n}\nfunction Ts(e, t, n) {\n  let r, { Icon: i } = t, { label: o = \"\" } = t, { show_label: l = !1 } = t, { pending: a = !1 } = t, { size: s = \"small\" } = t, { padded: u = !0 } = t, { highlight: f = !1 } = t, { disabled: c = !1 } = t, { hasPopup: _ = !1 } = t, { color: h = \"var(--block-label-text-color)\" } = t, { transparent: d = !1 } = t, { background: m = \"var(--background-fill-primary)\" } = t;\n  function v(y) {\n    _s.call(this, e, y);\n  }\n  return e.$$set = (y) => {\n    \"Icon\" in y && n(0, i = y.Icon), \"label\" in y && n(1, o = y.label), \"show_label\" in y && n(2, l = y.show_label), \"pending\" in y && n(3, a = y.pending), \"size\" in y && n(4, s = y.size), \"padded\" in y && n(5, u = y.padded), \"highlight\" in y && n(6, f = y.highlight), \"disabled\" in y && n(7, c = y.disabled), \"hasPopup\" in y && n(8, _ = y.hasPopup), \"color\" in y && n(12, h = y.color), \"transparent\" in y && n(9, d = y.transparent), \"background\" in y && n(10, m = y.background);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*highlight, color*/\n    4160 && n(11, r = f ? \"var(--color-accent)\" : h);\n  }, [\n    i,\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c,\n    _,\n    d,\n    m,\n    r,\n    h,\n    v\n  ];\n}\nclass Tt extends cs {\n  constructor(t) {\n    super(), ms(this, t, Ts, ks, bs, {\n      Icon: 0,\n      label: 1,\n      show_label: 2,\n      pending: 3,\n      size: 4,\n      padded: 5,\n      highlight: 6,\n      disabled: 7,\n      hasPopup: 8,\n      color: 12,\n      transparent: 9,\n      background: 10\n    });\n  }\n}\nconst {\n  SvelteComponent: As,\n  append: Bs,\n  attr: zn,\n  binding_callbacks: Cs,\n  create_slot: Hs,\n  detach: Ns,\n  element: ti,\n  get_all_dirty_from_scope: Ps,\n  get_slot_changes: Is,\n  init: Ls,\n  insert: Os,\n  safe_not_equal: Ms,\n  toggle_class: ze,\n  transition_in: Ds,\n  transition_out: Rs,\n  update_slot_base: Us\n} = window.__gradio__svelte__internal;\nfunction Fs(e) {\n  let t, n, r;\n  const i = (\n    /*#slots*/\n    e[5].default\n  ), o = Hs(\n    i,\n    e,\n    /*$$scope*/\n    e[4],\n    null\n  );\n  return {\n    c() {\n      t = ti(\"div\"), n = ti(\"div\"), o && o.c(), zn(n, \"class\", \"icon svelte-3w3rth\"), zn(t, \"class\", \"empty svelte-3w3rth\"), zn(t, \"aria-label\", \"Empty value\"), ze(\n        t,\n        \"small\",\n        /*size*/\n        e[0] === \"small\"\n      ), ze(\n        t,\n        \"large\",\n        /*size*/\n        e[0] === \"large\"\n      ), ze(\n        t,\n        \"unpadded_box\",\n        /*unpadded_box*/\n        e[1]\n      ), ze(\n        t,\n        \"small_parent\",\n        /*parent_height*/\n        e[3]\n      );\n    },\n    m(l, a) {\n      Os(l, t, a), Bs(t, n), o && o.m(n, null), e[6](t), r = !0;\n    },\n    p(l, [a]) {\n      o && o.p && (!r || a & /*$$scope*/\n      16) && Us(\n        o,\n        i,\n        l,\n        /*$$scope*/\n        l[4],\n        r ? Is(\n          i,\n          /*$$scope*/\n          l[4],\n          a,\n          null\n        ) : Ps(\n          /*$$scope*/\n          l[4]\n        ),\n        null\n      ), (!r || a & /*size*/\n      1) && ze(\n        t,\n        \"small\",\n        /*size*/\n        l[0] === \"small\"\n      ), (!r || a & /*size*/\n      1) && ze(\n        t,\n        \"large\",\n        /*size*/\n        l[0] === \"large\"\n      ), (!r || a & /*unpadded_box*/\n      2) && ze(\n        t,\n        \"unpadded_box\",\n        /*unpadded_box*/\n        l[1]\n      ), (!r || a & /*parent_height*/\n      8) && ze(\n        t,\n        \"small_parent\",\n        /*parent_height*/\n        l[3]\n      );\n    },\n    i(l) {\n      r || (Ds(o, l), r = !0);\n    },\n    o(l) {\n      Rs(o, l), r = !1;\n    },\n    d(l) {\n      l && Ns(t), o && o.d(l), e[6](null);\n    }\n  };\n}\nfunction Gs(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nfunction qs(e, t, n) {\n  let r, { $$slots: i = {}, $$scope: o } = t, { size: l = \"small\" } = t, { unpadded_box: a = !1 } = t, s;\n  function u(c) {\n    if (!c)\n      return !1;\n    const { height: _ } = c.getBoundingClientRect(), { height: h } = Gs([\n      c,\n      \"access\",\n      (d) => d.parentElement,\n      \"optionalAccess\",\n      (d) => d.getBoundingClientRect,\n      \"call\",\n      (d) => d()\n    ]) || { height: _ };\n    return _ > h + 2;\n  }\n  function f(c) {\n    Cs[c ? \"unshift\" : \"push\"](() => {\n      s = c, n(2, s);\n    });\n  }\n  return e.$$set = (c) => {\n    \"size\" in c && n(0, l = c.size), \"unpadded_box\" in c && n(1, a = c.unpadded_box), \"$$scope\" in c && n(4, o = c.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*el*/\n    4 && n(3, r = u(s));\n  }, [l, a, s, r, o, i, f];\n}\nclass js extends As {\n  constructor(t) {\n    super(), Ls(this, t, qs, Fs, Ms, { size: 0, unpadded_box: 1 });\n  }\n}\nconst {\n  SvelteComponent: zs,\n  append: Vn,\n  attr: ke,\n  detach: Vs,\n  init: Xs,\n  insert: xs,\n  noop: Xn,\n  safe_not_equal: Ws,\n  set_style: Pe,\n  svg_element: rn\n} = window.__gradio__svelte__internal;\nfunction Zs(e) {\n  let t, n, r, i;\n  return {\n    c() {\n      t = rn(\"svg\"), n = rn(\"g\"), r = rn(\"path\"), i = rn(\"path\"), ke(r, \"d\", \"M18,6L6.087,17.913\"), Pe(r, \"fill\", \"none\"), Pe(r, \"fill-rule\", \"nonzero\"), Pe(r, \"stroke-width\", \"2px\"), ke(n, \"transform\", \"matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)\"), ke(i, \"d\", \"M4.364,4.364L19.636,19.636\"), Pe(i, \"fill\", \"none\"), Pe(i, \"fill-rule\", \"nonzero\"), Pe(i, \"stroke-width\", \"2px\"), ke(t, \"width\", \"100%\"), ke(t, \"height\", \"100%\"), ke(t, \"viewBox\", \"0 0 24 24\"), ke(t, \"version\", \"1.1\"), ke(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), ke(t, \"xmlns:xlink\", \"http://www.w3.org/1999/xlink\"), ke(t, \"xml:space\", \"preserve\"), ke(t, \"stroke\", \"currentColor\"), Pe(t, \"fill-rule\", \"evenodd\"), Pe(t, \"clip-rule\", \"evenodd\"), Pe(t, \"stroke-linecap\", \"round\"), Pe(t, \"stroke-linejoin\", \"round\");\n    },\n    m(o, l) {\n      xs(o, t, l), Vn(t, n), Vn(n, r), Vn(t, i);\n    },\n    p: Xn,\n    i: Xn,\n    o: Xn,\n    d(o) {\n      o && Vs(t);\n    }\n  };\n}\nclass Js extends zs {\n  constructor(t) {\n    super(), Xs(this, t, null, Zs, Ws, {});\n  }\n}\nconst {\n  SvelteComponent: Qs,\n  append: Ys,\n  attr: bt,\n  detach: Ks,\n  init: $s,\n  insert: ea,\n  noop: xn,\n  safe_not_equal: ta,\n  svg_element: ni\n} = window.__gradio__svelte__internal;\nfunction na(e) {\n  let t, n;\n  return {\n    c() {\n      t = ni(\"svg\"), n = ni(\"path\"), bt(n, \"fill\", \"currentColor\"), bt(n, \"d\", \"M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z\"), bt(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), bt(t, \"width\", \"100%\"), bt(t, \"height\", \"100%\"), bt(t, \"viewBox\", \"0 0 32 32\");\n    },\n    m(r, i) {\n      ea(r, t, i), Ys(t, n);\n    },\n    p: xn,\n    i: xn,\n    o: xn,\n    d(r) {\n      r && Ks(t);\n    }\n  };\n}\nclass yo extends Qs {\n  constructor(t) {\n    super(), $s(this, t, null, na, ta, {});\n  }\n}\nconst {\n  SvelteComponent: ra,\n  append: ia,\n  attr: Te,\n  detach: oa,\n  init: la,\n  insert: sa,\n  noop: Wn,\n  safe_not_equal: aa,\n  svg_element: ri\n} = window.__gradio__svelte__internal;\nfunction ua(e) {\n  let t, n;\n  return {\n    c() {\n      t = ri(\"svg\"), n = ri(\"path\"), Te(n, \"d\", \"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z\"), Te(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), Te(t, \"width\", \"100%\"), Te(t, \"height\", \"100%\"), Te(t, \"viewBox\", \"0 0 24 24\"), Te(t, \"fill\", \"none\"), Te(t, \"stroke\", \"currentColor\"), Te(t, \"stroke-width\", \"1.5\"), Te(t, \"stroke-linecap\", \"round\"), Te(t, \"stroke-linejoin\", \"round\"), Te(t, \"class\", \"feather feather-edit-2\");\n    },\n    m(r, i) {\n      sa(r, t, i), ia(t, n);\n    },\n    p: Wn,\n    i: Wn,\n    o: Wn,\n    d(r) {\n      r && oa(t);\n    }\n  };\n}\nclass fa extends ra {\n  constructor(t) {\n    super(), la(this, t, null, ua, aa, {});\n  }\n}\nconst {\n  SvelteComponent: ca,\n  append: ii,\n  attr: de,\n  detach: _a,\n  init: ha,\n  insert: da,\n  noop: Zn,\n  safe_not_equal: ma,\n  svg_element: Jn\n} = window.__gradio__svelte__internal;\nfunction pa(e) {\n  let t, n, r;\n  return {\n    c() {\n      t = Jn(\"svg\"), n = Jn(\"path\"), r = Jn(\"polyline\"), de(n, \"d\", \"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z\"), de(r, \"points\", \"13 2 13 9 20 9\"), de(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), de(t, \"width\", \"100%\"), de(t, \"height\", \"100%\"), de(t, \"viewBox\", \"0 0 24 24\"), de(t, \"fill\", \"none\"), de(t, \"stroke\", \"currentColor\"), de(t, \"stroke-width\", \"1.5\"), de(t, \"stroke-linecap\", \"round\"), de(t, \"stroke-linejoin\", \"round\"), de(t, \"class\", \"feather feather-file\");\n    },\n    m(i, o) {\n      da(i, t, o), ii(t, n), ii(t, r);\n    },\n    p: Zn,\n    i: Zn,\n    o: Zn,\n    d(i) {\n      i && _a(t);\n    }\n  };\n}\nlet An = class extends ca {\n  constructor(t) {\n    super(), ha(this, t, null, pa, ma, {});\n  }\n};\nconst {\n  SvelteComponent: ga,\n  append: ba,\n  attr: vt,\n  detach: va,\n  init: wa,\n  insert: ya,\n  noop: Qn,\n  safe_not_equal: Ea,\n  svg_element: oi\n} = window.__gradio__svelte__internal;\nfunction Sa(e) {\n  let t, n;\n  return {\n    c() {\n      t = oi(\"svg\"), n = oi(\"path\"), vt(n, \"fill\", \"currentColor\"), vt(n, \"d\", \"M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a3.99 3.99 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2h3.5Zm2.245 2.096L16 4.25c0-.052-.002-.103-.005-.154ZM13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5ZM15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3h-5Zm0 11a2.985 2.985 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A2.985 2.985 0 0 1 20 23h-5Zm5-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2Z\"), vt(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), vt(t, \"width\", \"100%\"), vt(t, \"height\", \"100%\"), vt(t, \"viewBox\", \"0 0 24 24\");\n    },\n    m(r, i) {\n      ya(r, t, i), ba(t, n);\n    },\n    p: Qn,\n    i: Qn,\n    o: Qn,\n    d(r) {\n      r && va(t);\n    }\n  };\n}\nclass ka extends ga {\n  constructor(t) {\n    super(), wa(this, t, null, Sa, Ea, {});\n  }\n}\nconst {\n  SvelteComponent: Ta,\n  append: li,\n  attr: me,\n  detach: Aa,\n  init: Ba,\n  insert: Ca,\n  noop: Yn,\n  safe_not_equal: Ha,\n  svg_element: Kn\n} = window.__gradio__svelte__internal;\nfunction Na(e) {\n  let t, n, r;\n  return {\n    c() {\n      t = Kn(\"svg\"), n = Kn(\"polyline\"), r = Kn(\"path\"), me(n, \"points\", \"1 4 1 10 7 10\"), me(r, \"d\", \"M3.51 15a9 9 0 1 0 2.13-9.36L1 10\"), me(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), me(t, \"width\", \"100%\"), me(t, \"height\", \"100%\"), me(t, \"viewBox\", \"0 0 24 24\"), me(t, \"fill\", \"none\"), me(t, \"stroke\", \"currentColor\"), me(t, \"stroke-width\", \"2\"), me(t, \"stroke-linecap\", \"round\"), me(t, \"stroke-linejoin\", \"round\"), me(t, \"class\", \"feather feather-rotate-ccw\");\n    },\n    m(i, o) {\n      Ca(i, t, o), li(t, n), li(t, r);\n    },\n    p: Yn,\n    i: Yn,\n    o: Yn,\n    d(i) {\n      i && Aa(t);\n    }\n  };\n}\nclass Eo extends Ta {\n  constructor(t) {\n    super(), Ba(this, t, null, Na, Ha, {});\n  }\n}\nconst {\n  SvelteComponent: Pa,\n  append: $n,\n  attr: K,\n  detach: Ia,\n  init: La,\n  insert: Oa,\n  noop: er,\n  safe_not_equal: Ma,\n  svg_element: on\n} = window.__gradio__svelte__internal;\nfunction Da(e) {\n  let t, n, r, i;\n  return {\n    c() {\n      t = on(\"svg\"), n = on(\"path\"), r = on(\"polyline\"), i = on(\"line\"), K(n, \"d\", \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"), K(r, \"points\", \"17 8 12 3 7 8\"), K(i, \"x1\", \"12\"), K(i, \"y1\", \"3\"), K(i, \"x2\", \"12\"), K(i, \"y2\", \"15\"), K(t, \"xmlns\", \"http://www.w3.org/2000/svg\"), K(t, \"width\", \"90%\"), K(t, \"height\", \"90%\"), K(t, \"viewBox\", \"0 0 24 24\"), K(t, \"fill\", \"none\"), K(t, \"stroke\", \"currentColor\"), K(t, \"stroke-width\", \"2\"), K(t, \"stroke-linecap\", \"round\"), K(t, \"stroke-linejoin\", \"round\"), K(t, \"class\", \"feather feather-upload\");\n    },\n    m(o, l) {\n      Oa(o, t, l), $n(t, n), $n(t, r), $n(t, i);\n    },\n    p: er,\n    i: er,\n    o: er,\n    d(o) {\n      o && Ia(t);\n    }\n  };\n}\nlet Ra = class extends Pa {\n  constructor(t) {\n    super(), La(this, t, null, Da, Ma, {});\n  }\n};\nconst Ua = [\n  { color: \"red\", primary: 600, secondary: 100 },\n  { color: \"green\", primary: 600, secondary: 100 },\n  { color: \"blue\", primary: 600, secondary: 100 },\n  { color: \"yellow\", primary: 500, secondary: 100 },\n  { color: \"purple\", primary: 600, secondary: 100 },\n  { color: \"teal\", primary: 600, secondary: 100 },\n  { color: \"orange\", primary: 600, secondary: 100 },\n  { color: \"cyan\", primary: 600, secondary: 100 },\n  { color: \"lime\", primary: 500, secondary: 100 },\n  { color: \"pink\", primary: 600, secondary: 100 }\n], si = {\n  inherit: \"inherit\",\n  current: \"currentColor\",\n  transparent: \"transparent\",\n  black: \"#000\",\n  white: \"#fff\",\n  slate: {\n    50: \"#f8fafc\",\n    100: \"#f1f5f9\",\n    200: \"#e2e8f0\",\n    300: \"#cbd5e1\",\n    400: \"#94a3b8\",\n    500: \"#64748b\",\n    600: \"#475569\",\n    700: \"#334155\",\n    800: \"#1e293b\",\n    900: \"#0f172a\",\n    950: \"#020617\"\n  },\n  gray: {\n    50: \"#f9fafb\",\n    100: \"#f3f4f6\",\n    200: \"#e5e7eb\",\n    300: \"#d1d5db\",\n    400: \"#9ca3af\",\n    500: \"#6b7280\",\n    600: \"#4b5563\",\n    700: \"#374151\",\n    800: \"#1f2937\",\n    900: \"#111827\",\n    950: \"#030712\"\n  },\n  zinc: {\n    50: \"#fafafa\",\n    100: \"#f4f4f5\",\n    200: \"#e4e4e7\",\n    300: \"#d4d4d8\",\n    400: \"#a1a1aa\",\n    500: \"#71717a\",\n    600: \"#52525b\",\n    700: \"#3f3f46\",\n    800: \"#27272a\",\n    900: \"#18181b\",\n    950: \"#09090b\"\n  },\n  neutral: {\n    50: \"#fafafa\",\n    100: \"#f5f5f5\",\n    200: \"#e5e5e5\",\n    300: \"#d4d4d4\",\n    400: \"#a3a3a3\",\n    500: \"#737373\",\n    600: \"#525252\",\n    700: \"#404040\",\n    800: \"#262626\",\n    900: \"#171717\",\n    950: \"#0a0a0a\"\n  },\n  stone: {\n    50: \"#fafaf9\",\n    100: \"#f5f5f4\",\n    200: \"#e7e5e4\",\n    300: \"#d6d3d1\",\n    400: \"#a8a29e\",\n    500: \"#78716c\",\n    600: \"#57534e\",\n    700: \"#44403c\",\n    800: \"#292524\",\n    900: \"#1c1917\",\n    950: \"#0c0a09\"\n  },\n  red: {\n    50: \"#fef2f2\",\n    100: \"#fee2e2\",\n    200: \"#fecaca\",\n    300: \"#fca5a5\",\n    400: \"#f87171\",\n    500: \"#ef4444\",\n    600: \"#dc2626\",\n    700: \"#b91c1c\",\n    800: \"#991b1b\",\n    900: \"#7f1d1d\",\n    950: \"#450a0a\"\n  },\n  orange: {\n    50: \"#fff7ed\",\n    100: \"#ffedd5\",\n    200: \"#fed7aa\",\n    300: \"#fdba74\",\n    400: \"#fb923c\",\n    500: \"#f97316\",\n    600: \"#ea580c\",\n    700: \"#c2410c\",\n    800: \"#9a3412\",\n    900: \"#7c2d12\",\n    950: \"#431407\"\n  },\n  amber: {\n    50: \"#fffbeb\",\n    100: \"#fef3c7\",\n    200: \"#fde68a\",\n    300: \"#fcd34d\",\n    400: \"#fbbf24\",\n    500: \"#f59e0b\",\n    600: \"#d97706\",\n    700: \"#b45309\",\n    800: \"#92400e\",\n    900: \"#78350f\",\n    950: \"#451a03\"\n  },\n  yellow: {\n    50: \"#fefce8\",\n    100: \"#fef9c3\",\n    200: \"#fef08a\",\n    300: \"#fde047\",\n    400: \"#facc15\",\n    500: \"#eab308\",\n    600: \"#ca8a04\",\n    700: \"#a16207\",\n    800: \"#854d0e\",\n    900: \"#713f12\",\n    950: \"#422006\"\n  },\n  lime: {\n    50: \"#f7fee7\",\n    100: \"#ecfccb\",\n    200: \"#d9f99d\",\n    300: \"#bef264\",\n    400: \"#a3e635\",\n    500: \"#84cc16\",\n    600: \"#65a30d\",\n    700: \"#4d7c0f\",\n    800: \"#3f6212\",\n    900: \"#365314\",\n    950: \"#1a2e05\"\n  },\n  green: {\n    50: \"#f0fdf4\",\n    100: \"#dcfce7\",\n    200: \"#bbf7d0\",\n    300: \"#86efac\",\n    400: \"#4ade80\",\n    500: \"#22c55e\",\n    600: \"#16a34a\",\n    700: \"#15803d\",\n    800: \"#166534\",\n    900: \"#14532d\",\n    950: \"#052e16\"\n  },\n  emerald: {\n    50: \"#ecfdf5\",\n    100: \"#d1fae5\",\n    200: \"#a7f3d0\",\n    300: \"#6ee7b7\",\n    400: \"#34d399\",\n    500: \"#10b981\",\n    600: \"#059669\",\n    700: \"#047857\",\n    800: \"#065f46\",\n    900: \"#064e3b\",\n    950: \"#022c22\"\n  },\n  teal: {\n    50: \"#f0fdfa\",\n    100: \"#ccfbf1\",\n    200: \"#99f6e4\",\n    300: \"#5eead4\",\n    400: \"#2dd4bf\",\n    500: \"#14b8a6\",\n    600: \"#0d9488\",\n    700: \"#0f766e\",\n    800: \"#115e59\",\n    900: \"#134e4a\",\n    950: \"#042f2e\"\n  },\n  cyan: {\n    50: \"#ecfeff\",\n    100: \"#cffafe\",\n    200: \"#a5f3fc\",\n    300: \"#67e8f9\",\n    400: \"#22d3ee\",\n    500: \"#06b6d4\",\n    600: \"#0891b2\",\n    700: \"#0e7490\",\n    800: \"#155e75\",\n    900: \"#164e63\",\n    950: \"#083344\"\n  },\n  sky: {\n    50: \"#f0f9ff\",\n    100: \"#e0f2fe\",\n    200: \"#bae6fd\",\n    300: \"#7dd3fc\",\n    400: \"#38bdf8\",\n    500: \"#0ea5e9\",\n    600: \"#0284c7\",\n    700: \"#0369a1\",\n    800: \"#075985\",\n    900: \"#0c4a6e\",\n    950: \"#082f49\"\n  },\n  blue: {\n    50: \"#eff6ff\",\n    100: \"#dbeafe\",\n    200: \"#bfdbfe\",\n    300: \"#93c5fd\",\n    400: \"#60a5fa\",\n    500: \"#3b82f6\",\n    600: \"#2563eb\",\n    700: \"#1d4ed8\",\n    800: \"#1e40af\",\n    900: \"#1e3a8a\",\n    950: \"#172554\"\n  },\n  indigo: {\n    50: \"#eef2ff\",\n    100: \"#e0e7ff\",\n    200: \"#c7d2fe\",\n    300: \"#a5b4fc\",\n    400: \"#818cf8\",\n    500: \"#6366f1\",\n    600: \"#4f46e5\",\n    700: \"#4338ca\",\n    800: \"#3730a3\",\n    900: \"#312e81\",\n    950: \"#1e1b4b\"\n  },\n  violet: {\n    50: \"#f5f3ff\",\n    100: \"#ede9fe\",\n    200: \"#ddd6fe\",\n    300: \"#c4b5fd\",\n    400: \"#a78bfa\",\n    500: \"#8b5cf6\",\n    600: \"#7c3aed\",\n    700: \"#6d28d9\",\n    800: \"#5b21b6\",\n    900: \"#4c1d95\",\n    950: \"#2e1065\"\n  },\n  purple: {\n    50: \"#faf5ff\",\n    100: \"#f3e8ff\",\n    200: \"#e9d5ff\",\n    300: \"#d8b4fe\",\n    400: \"#c084fc\",\n    500: \"#a855f7\",\n    600: \"#9333ea\",\n    700: \"#7e22ce\",\n    800: \"#6b21a8\",\n    900: \"#581c87\",\n    950: \"#3b0764\"\n  },\n  fuchsia: {\n    50: \"#fdf4ff\",\n    100: \"#fae8ff\",\n    200: \"#f5d0fe\",\n    300: \"#f0abfc\",\n    400: \"#e879f9\",\n    500: \"#d946ef\",\n    600: \"#c026d3\",\n    700: \"#a21caf\",\n    800: \"#86198f\",\n    900: \"#701a75\",\n    950: \"#4a044e\"\n  },\n  pink: {\n    50: \"#fdf2f8\",\n    100: \"#fce7f3\",\n    200: \"#fbcfe8\",\n    300: \"#f9a8d4\",\n    400: \"#f472b6\",\n    500: \"#ec4899\",\n    600: \"#db2777\",\n    700: \"#be185d\",\n    800: \"#9d174d\",\n    900: \"#831843\",\n    950: \"#500724\"\n  },\n  rose: {\n    50: \"#fff1f2\",\n    100: \"#ffe4e6\",\n    200: \"#fecdd3\",\n    300: \"#fda4af\",\n    400: \"#fb7185\",\n    500: \"#f43f5e\",\n    600: \"#e11d48\",\n    700: \"#be123c\",\n    800: \"#9f1239\",\n    900: \"#881337\",\n    950: \"#4c0519\"\n  }\n};\nUa.reduce(\n  (e, { color: t, primary: n, secondary: r }) => ({\n    ...e,\n    [t]: {\n      primary: si[t][n],\n      secondary: si[t][r]\n    }\n  }),\n  {}\n);\nconst {\n  SvelteComponent: Fa,\n  append: rt,\n  attr: vr,\n  check_outros: Ga,\n  create_component: So,\n  destroy_component: ko,\n  detach: fn,\n  element: wr,\n  group_outros: qa,\n  init: ja,\n  insert: cn,\n  mount_component: To,\n  safe_not_equal: za,\n  set_data: yr,\n  space: Er,\n  text: Rt,\n  toggle_class: ai,\n  transition_in: dn,\n  transition_out: mn\n} = window.__gradio__svelte__internal;\nfunction Va(e) {\n  let t, n;\n  return t = new Ra({}), {\n    c() {\n      So(t.$$.fragment);\n    },\n    m(r, i) {\n      To(t, r, i), n = !0;\n    },\n    i(r) {\n      n || (dn(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      mn(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      ko(t, r);\n    }\n  };\n}\nfunction Xa(e) {\n  let t, n;\n  return t = new ka({}), {\n    c() {\n      So(t.$$.fragment);\n    },\n    m(r, i) {\n      To(t, r, i), n = !0;\n    },\n    i(r) {\n      n || (dn(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      mn(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      ko(t, r);\n    }\n  };\n}\nfunction ui(e) {\n  let t, n, r = (\n    /*i18n*/\n    e[1](\"common.or\") + \"\"\n  ), i, o, l, a = (\n    /*message*/\n    (e[2] || /*i18n*/\n    e[1](\"upload_text.click_to_upload\")) + \"\"\n  ), s;\n  return {\n    c() {\n      t = wr(\"span\"), n = Rt(\"- \"), i = Rt(r), o = Rt(\" -\"), l = Er(), s = Rt(a), vr(t, \"class\", \"or svelte-kzcjhc\");\n    },\n    m(u, f) {\n      cn(u, t, f), rt(t, n), rt(t, i), rt(t, o), cn(u, l, f), cn(u, s, f);\n    },\n    p(u, f) {\n      f & /*i18n*/\n      2 && r !== (r = /*i18n*/\n      u[1](\"common.or\") + \"\") && yr(i, r), f & /*message, i18n*/\n      6 && a !== (a = /*message*/\n      (u[2] || /*i18n*/\n      u[1](\"upload_text.click_to_upload\")) + \"\") && yr(s, a);\n    },\n    d(u) {\n      u && (fn(t), fn(l), fn(s));\n    }\n  };\n}\nfunction xa(e) {\n  let t, n, r, i, o, l = (\n    /*i18n*/\n    e[1](\n      /*defs*/\n      e[5][\n        /*type*/\n        e[0]\n      ] || /*defs*/\n      e[5].file\n    ) + \"\"\n  ), a, s, u;\n  const f = [Xa, Va], c = [];\n  function _(d, m) {\n    return (\n      /*type*/\n      d[0] === \"clipboard\" ? 0 : 1\n    );\n  }\n  r = _(e), i = c[r] = f[r](e);\n  let h = (\n    /*mode*/\n    e[3] !== \"short\" && ui(e)\n  );\n  return {\n    c() {\n      t = wr(\"div\"), n = wr(\"span\"), i.c(), o = Er(), a = Rt(l), s = Er(), h && h.c(), vr(n, \"class\", \"icon-wrap svelte-kzcjhc\"), ai(\n        n,\n        \"hovered\",\n        /*hovered*/\n        e[4]\n      ), vr(t, \"class\", \"wrap svelte-kzcjhc\");\n    },\n    m(d, m) {\n      cn(d, t, m), rt(t, n), c[r].m(n, null), rt(t, o), rt(t, a), rt(t, s), h && h.m(t, null), u = !0;\n    },\n    p(d, [m]) {\n      let v = r;\n      r = _(d), r !== v && (qa(), mn(c[v], 1, 1, () => {\n        c[v] = null;\n      }), Ga(), i = c[r], i || (i = c[r] = f[r](d), i.c()), dn(i, 1), i.m(n, null)), (!u || m & /*hovered*/\n      16) && ai(\n        n,\n        \"hovered\",\n        /*hovered*/\n        d[4]\n      ), (!u || m & /*i18n, type*/\n      3) && l !== (l = /*i18n*/\n      d[1](\n        /*defs*/\n        d[5][\n          /*type*/\n          d[0]\n        ] || /*defs*/\n        d[5].file\n      ) + \"\") && yr(a, l), /*mode*/\n      d[3] !== \"short\" ? h ? h.p(d, m) : (h = ui(d), h.c(), h.m(t, null)) : h && (h.d(1), h = null);\n    },\n    i(d) {\n      u || (dn(i), u = !0);\n    },\n    o(d) {\n      mn(i), u = !1;\n    },\n    d(d) {\n      d && fn(t), c[r].d(), h && h.d();\n    }\n  };\n}\nfunction Wa(e, t, n) {\n  let { type: r = \"file\" } = t, { i18n: i } = t, { message: o = void 0 } = t, { mode: l = \"full\" } = t, { hovered: a = !1 } = t;\n  const s = {\n    image: \"upload_text.drop_image\",\n    video: \"upload_text.drop_video\",\n    audio: \"upload_text.drop_audio\",\n    file: \"upload_text.drop_file\",\n    csv: \"upload_text.drop_csv\",\n    gallery: \"upload_text.drop_gallery\",\n    clipboard: \"upload_text.paste_clipboard\"\n  };\n  return e.$$set = (u) => {\n    \"type\" in u && n(0, r = u.type), \"i18n\" in u && n(1, i = u.i18n), \"message\" in u && n(2, o = u.message), \"mode\" in u && n(3, l = u.mode), \"hovered\" in u && n(4, a = u.hovered);\n  }, [r, i, o, l, a, s];\n}\nclass Za extends Fa {\n  constructor(t) {\n    super(), ja(this, t, Wa, xa, za, {\n      type: 0,\n      i18n: 1,\n      message: 2,\n      mode: 3,\n      hovered: 4\n    });\n  }\n}\nvar fi = Object.prototype.hasOwnProperty;\nfunction ci(e, t, n) {\n  for (n of e.keys())\n    if (Ft(n, t))\n      return n;\n}\nfunction Ft(e, t) {\n  var n, r, i;\n  if (e === t)\n    return !0;\n  if (e && t && (n = e.constructor) === t.constructor) {\n    if (n === Date)\n      return e.getTime() === t.getTime();\n    if (n === RegExp)\n      return e.toString() === t.toString();\n    if (n === Array) {\n      if ((r = e.length) === t.length)\n        for (; r-- && Ft(e[r], t[r]); )\n          ;\n      return r === -1;\n    }\n    if (n === Set) {\n      if (e.size !== t.size)\n        return !1;\n      for (r of e)\n        if (i = r, i && typeof i == \"object\" && (i = ci(t, i), !i) || !t.has(i))\n          return !1;\n      return !0;\n    }\n    if (n === Map) {\n      if (e.size !== t.size)\n        return !1;\n      for (r of e)\n        if (i = r[0], i && typeof i == \"object\" && (i = ci(t, i), !i) || !Ft(r[1], t.get(i)))\n          return !1;\n      return !0;\n    }\n    if (n === ArrayBuffer)\n      e = new Uint8Array(e), t = new Uint8Array(t);\n    else if (n === DataView) {\n      if ((r = e.byteLength) === t.byteLength)\n        for (; r-- && e.getInt8(r) === t.getInt8(r); )\n          ;\n      return r === -1;\n    }\n    if (ArrayBuffer.isView(e)) {\n      if ((r = e.byteLength) === t.byteLength)\n        for (; r-- && e[r] === t[r]; )\n          ;\n      return r === -1;\n    }\n    if (!n || typeof e == \"object\") {\n      r = 0;\n      for (n in e)\n        if (fi.call(e, n) && ++r && !fi.call(t, n) || !(n in t) || !Ft(e[n], t[n]))\n          return !1;\n      return Object.keys(t).length === r;\n    }\n  }\n  return e !== e && t !== t;\n}\nconst {\n  SvelteComponent: Ja,\n  add_flush_callback: Ao,\n  append: ln,\n  attr: Qe,\n  bind: pn,\n  binding_callbacks: gn,\n  check_outros: Bn,\n  construct_svelte_component: bn,\n  create_component: lt,\n  destroy_component: st,\n  detach: Gt,\n  element: tr,\n  empty: Gr,\n  group_outros: Cn,\n  init: Qa,\n  insert: qt,\n  mount_component: at,\n  safe_not_equal: Ya,\n  space: Sr,\n  transition_in: ge,\n  transition_out: He\n} = window.__gradio__svelte__internal;\nfunction _i(e) {\n  let t, n, r, i, o, l, a, s, u, f, c;\n  r = new Tt({ props: { Icon: Eo, label: \"Undo\" } }), r.$on(\n    \"click\",\n    /*click_handler*/\n    e[14]\n  ), l = new Tt({\n    props: {\n      Icon: yo,\n      label: (\n        /*i18n*/\n        e[4](\"common.download\")\n      )\n    }\n  });\n  const _ = [$a, Ka], h = [];\n  function d(m, v) {\n    return (\n      /*use_3dgs*/\n      m[9] ? 0 : 1\n    );\n  }\n  return u = d(e), f = h[u] = _[u](e), {\n    c() {\n      t = tr(\"div\"), n = tr(\"div\"), lt(r.$$.fragment), i = Sr(), o = tr(\"a\"), lt(l.$$.fragment), s = Sr(), f.c(), Qe(\n        o,\n        \"href\",\n        /*resolved_url*/\n        e[11]\n      ), Qe(o, \"target\", window.__is_colab__ ? \"_blank\" : null), Qe(o, \"download\", a = window.__is_colab__ ? null : (\n        /*value*/\n        e[0].orig_name || /*value*/\n        e[0].path\n      )), Qe(n, \"class\", \"buttons svelte-14rtuon\"), Qe(t, \"class\", \"model3D svelte-14rtuon\");\n    },\n    m(m, v) {\n      qt(m, t, v), ln(t, n), at(r, n, null), ln(n, i), ln(n, o), at(l, o, null), ln(t, s), h[u].m(t, null), c = !0;\n    },\n    p(m, v) {\n      const y = {};\n      v & /*i18n*/\n      16 && (y.label = /*i18n*/\n      m[4](\"common.download\")), l.$set(y), (!c || v & /*resolved_url*/\n      2048) && Qe(\n        o,\n        \"href\",\n        /*resolved_url*/\n        m[11]\n      ), (!c || v & /*value*/\n      1 && a !== (a = window.__is_colab__ ? null : (\n        /*value*/\n        m[0].orig_name || /*value*/\n        m[0].path\n      ))) && Qe(o, \"download\", a);\n      let k = u;\n      u = d(m), u === k ? h[u].p(m, v) : (Cn(), He(h[k], 1, 1, () => {\n        h[k] = null;\n      }), Bn(), f = h[u], f ? f.p(m, v) : (f = h[u] = _[u](m), f.c()), ge(f, 1), f.m(t, null));\n    },\n    i(m) {\n      c || (ge(r.$$.fragment, m), ge(l.$$.fragment, m), ge(f), c = !0);\n    },\n    o(m) {\n      He(r.$$.fragment, m), He(l.$$.fragment, m), He(f), c = !1;\n    },\n    d(m) {\n      m && Gt(t), st(r), st(l), h[u].d();\n    }\n  };\n}\nfunction Ka(e) {\n  let t, n, r, i;\n  function o(s) {\n    e[16](s);\n  }\n  var l = (\n    /*canvas3d*/\n    e[8]\n  );\n  function a(s, u) {\n    let f = {\n      value: (\n        /*value*/\n        s[0]\n      ),\n      clear_color: (\n        /*clear_color*/\n        s[1]\n      ),\n      camera_position: (\n        /*camera_position*/\n        s[7]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        s[5]\n      ),\n      pan_speed: (\n        /*pan_speed*/\n        s[6]\n      )\n    };\n    return (\n      /*resolved_url*/\n      s[11] !== void 0 && (f.resolved_url = /*resolved_url*/\n      s[11]), { props: f }\n    );\n  }\n  return l && (t = bn(l, a(e)), gn.push(() => pn(t, \"resolved_url\", o))), {\n    c() {\n      t && lt(t.$$.fragment), r = Gr();\n    },\n    m(s, u) {\n      t && at(t, s, u), qt(s, r, u), i = !0;\n    },\n    p(s, u) {\n      if (u & /*canvas3d*/\n      256 && l !== (l = /*canvas3d*/\n      s[8])) {\n        if (t) {\n          Cn();\n          const f = t;\n          He(f.$$.fragment, 1, 0, () => {\n            st(f, 1);\n          }), Bn();\n        }\n        l ? (t = bn(l, a(s)), gn.push(() => pn(t, \"resolved_url\", o)), lt(t.$$.fragment), ge(t.$$.fragment, 1), at(t, r.parentNode, r)) : t = null;\n      } else if (l) {\n        const f = {};\n        u & /*value*/\n        1 && (f.value = /*value*/\n        s[0]), u & /*clear_color*/\n        2 && (f.clear_color = /*clear_color*/\n        s[1]), u & /*camera_position*/\n        128 && (f.camera_position = /*camera_position*/\n        s[7]), u & /*zoom_speed*/\n        32 && (f.zoom_speed = /*zoom_speed*/\n        s[5]), u & /*pan_speed*/\n        64 && (f.pan_speed = /*pan_speed*/\n        s[6]), !n && u & /*resolved_url*/\n        2048 && (n = !0, f.resolved_url = /*resolved_url*/\n        s[11], Ao(() => n = !1)), t.$set(f);\n      }\n    },\n    i(s) {\n      i || (t && ge(t.$$.fragment, s), i = !0);\n    },\n    o(s) {\n      t && He(t.$$.fragment, s), i = !1;\n    },\n    d(s) {\n      s && Gt(r), t && st(t, s);\n    }\n  };\n}\nfunction $a(e) {\n  let t, n, r, i;\n  function o(s) {\n    e[15](s);\n  }\n  var l = (\n    /*canvas3dgs*/\n    e[10]\n  );\n  function a(s, u) {\n    let f = {\n      value: (\n        /*value*/\n        s[0]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        s[5]\n      ),\n      pan_speed: (\n        /*pan_speed*/\n        s[6]\n      )\n    };\n    return (\n      /*resolved_url*/\n      s[11] !== void 0 && (f.resolved_url = /*resolved_url*/\n      s[11]), { props: f }\n    );\n  }\n  return l && (t = bn(l, a(e)), gn.push(() => pn(t, \"resolved_url\", o))), {\n    c() {\n      t && lt(t.$$.fragment), r = Gr();\n    },\n    m(s, u) {\n      t && at(t, s, u), qt(s, r, u), i = !0;\n    },\n    p(s, u) {\n      if (u & /*canvas3dgs*/\n      1024 && l !== (l = /*canvas3dgs*/\n      s[10])) {\n        if (t) {\n          Cn();\n          const f = t;\n          He(f.$$.fragment, 1, 0, () => {\n            st(f, 1);\n          }), Bn();\n        }\n        l ? (t = bn(l, a(s)), gn.push(() => pn(t, \"resolved_url\", o)), lt(t.$$.fragment), ge(t.$$.fragment, 1), at(t, r.parentNode, r)) : t = null;\n      } else if (l) {\n        const f = {};\n        u & /*value*/\n        1 && (f.value = /*value*/\n        s[0]), u & /*zoom_speed*/\n        32 && (f.zoom_speed = /*zoom_speed*/\n        s[5]), u & /*pan_speed*/\n        64 && (f.pan_speed = /*pan_speed*/\n        s[6]), !n && u & /*resolved_url*/\n        2048 && (n = !0, f.resolved_url = /*resolved_url*/\n        s[11], Ao(() => n = !1)), t.$set(f);\n      }\n    },\n    i(s) {\n      i || (t && ge(t.$$.fragment, s), i = !0);\n    },\n    o(s) {\n      t && He(t.$$.fragment, s), i = !1;\n    },\n    d(s) {\n      s && Gt(r), t && st(t, s);\n    }\n  };\n}\nfunction eu(e) {\n  let t, n, r, i;\n  t = new Fr({\n    props: {\n      show_label: (\n        /*show_label*/\n        e[3]\n      ),\n      Icon: An,\n      label: (\n        /*label*/\n        e[2] || /*i18n*/\n        e[4](\"3D_model.3d_model\")\n      )\n    }\n  });\n  let o = (\n    /*value*/\n    e[0] && _i(e)\n  );\n  return {\n    c() {\n      lt(t.$$.fragment), n = Sr(), o && o.c(), r = Gr();\n    },\n    m(l, a) {\n      at(t, l, a), qt(l, n, a), o && o.m(l, a), qt(l, r, a), i = !0;\n    },\n    p(l, [a]) {\n      const s = {};\n      a & /*show_label*/\n      8 && (s.show_label = /*show_label*/\n      l[3]), a & /*label, i18n*/\n      20 && (s.label = /*label*/\n      l[2] || /*i18n*/\n      l[4](\"3D_model.3d_model\")), t.$set(s), /*value*/\n      l[0] ? o ? (o.p(l, a), a & /*value*/\n      1 && ge(o, 1)) : (o = _i(l), o.c(), ge(o, 1), o.m(r.parentNode, r)) : o && (Cn(), He(o, 1, 1, () => {\n        o = null;\n      }), Bn());\n    },\n    i(l) {\n      i || (ge(t.$$.fragment, l), ge(o), i = !0);\n    },\n    o(l) {\n      He(t.$$.fragment, l), He(o), i = !1;\n    },\n    d(l) {\n      l && (Gt(n), Gt(r)), st(t, l), o && o.d(l);\n    }\n  };\n}\nfunction hi(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nasync function tu() {\n  return (await import(\"./Canvas3D-e42d3d6b.js\")).default;\n}\nasync function nu() {\n  return (await import(\"./Canvas3DGS-f5539f54.js\")).default;\n}\nfunction ru(e, t, n) {\n  let { value: r } = t, { clear_color: i = [0, 0, 0, 0] } = t, { label: o = \"\" } = t, { show_label: l } = t, { i18n: a } = t, { zoom_speed: s = 1 } = t, { pan_speed: u = 1 } = t, { camera_position: f = [null, null, null] } = t, c = { camera_position: f, zoom_speed: s, pan_speed: u }, _, h, d = !1, m;\n  function v() {\n    h.reset_camera_position(f, s, u);\n  }\n  const y = () => v();\n  function k(p) {\n    m = p, n(11, m);\n  }\n  function b(p) {\n    m = p, n(11, m);\n  }\n  return e.$$set = (p) => {\n    \"value\" in p && n(0, r = p.value), \"clear_color\" in p && n(1, i = p.clear_color), \"label\" in p && n(2, o = p.label), \"show_label\" in p && n(3, l = p.show_label), \"i18n\" in p && n(4, a = p.i18n), \"zoom_speed\" in p && n(5, s = p.zoom_speed), \"pan_speed\" in p && n(6, u = p.pan_speed), \"camera_position\" in p && n(7, f = p.camera_position);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*value, use_3dgs*/\n    513 && r && (n(9, d = hi([\n      r,\n      \"optionalAccess\",\n      (p) => p.path,\n      \"access\",\n      (p) => p.endsWith,\n      \"call\",\n      (p) => p(\".splat\")\n    ]) || hi([\n      r,\n      \"optionalAccess\",\n      (p) => p.path,\n      \"access\",\n      (p) => p.endsWith,\n      \"call\",\n      (p) => p(\".ply\")\n    ])), d ? nu().then((p) => {\n      n(10, _ = p);\n    }) : tu().then((p) => {\n      n(8, h = p);\n    })), e.$$.dirty & /*current_settings, camera_position, zoom_speed, pan_speed, canvas3d*/\n    8672 && (!Ft(c.camera_position, f) || c.zoom_speed !== s || c.pan_speed !== u) && (h.reset_camera_position(f, s, u), n(13, c = { camera_position: f, zoom_speed: s, pan_speed: u }));\n  }, [\n    r,\n    i,\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    h,\n    d,\n    _,\n    m,\n    v,\n    c,\n    y,\n    k,\n    b\n  ];\n}\nclass iu extends Ja {\n  constructor(t) {\n    super(), Qa(this, t, ru, eu, Ya, {\n      value: 0,\n      clear_color: 1,\n      label: 2,\n      show_label: 3,\n      i18n: 4,\n      zoom_speed: 5,\n      pan_speed: 6,\n      camera_position: 7\n    });\n  }\n}\nvar nr = new Intl.Collator(0, { numeric: 1 }).compare;\nfunction di(e, t, n) {\n  return e = e.split(\".\"), t = t.split(\".\"), nr(e[0], t[0]) || nr(e[1], t[1]) || (t[2] = t.slice(2).join(\".\"), n = /[.-]/.test(e[2] = e.slice(2).join(\".\")), n == /[.-]/.test(t[2]) ? nr(e[2], t[2]) : n ? -1 : 1);\n}\nfunction Bo(e, t, n) {\n  return t.startsWith(\"http://\") || t.startsWith(\"https://\") ? n ? e : t : e + t;\n}\nfunction rr(e) {\n  if (e.startsWith(\"http\")) {\n    const { protocol: t, host: n } = new URL(e);\n    return n.endsWith(\"hf.space\") ? {\n      ws_protocol: \"wss\",\n      host: n,\n      http_protocol: t\n    } : {\n      ws_protocol: t === \"https:\" ? \"wss\" : \"ws\",\n      http_protocol: t,\n      host: n\n    };\n  } else if (e.startsWith(\"file:\"))\n    return {\n      ws_protocol: \"ws\",\n      http_protocol: \"http:\",\n      host: \"lite.local\"\n      // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.\n    };\n  return {\n    ws_protocol: \"wss\",\n    http_protocol: \"https:\",\n    host: e\n  };\n}\nconst Co = /^[^\\/]*\\/[^\\/]*$/, ou = /.*hf\\.space\\/{0,1}$/;\nasync function lu(e, t) {\n  const n = {};\n  t && (n.Authorization = `Bearer ${t}`);\n  const r = e.trim();\n  if (Co.test(r))\n    try {\n      const i = await fetch(\n        `https://huggingface.co/api/spaces/${r}/host`,\n        { headers: n }\n      );\n      if (i.status !== 200)\n        throw new Error(\"Space metadata could not be loaded.\");\n      const o = (await i.json()).host;\n      return {\n        space_id: e,\n        ...rr(o)\n      };\n    } catch (i) {\n      throw new Error(\"Space metadata could not be loaded.\" + i.message);\n    }\n  if (ou.test(r)) {\n    const { ws_protocol: i, http_protocol: o, host: l } = rr(r);\n    return {\n      space_id: l.replace(\".hf.space\", \"\"),\n      ws_protocol: i,\n      http_protocol: o,\n      host: l\n    };\n  }\n  return {\n    space_id: !1,\n    ...rr(r)\n  };\n}\nfunction su(e) {\n  let t = {};\n  return e.forEach(({ api_name: n }, r) => {\n    n && (t[n] = r);\n  }), t;\n}\nconst au = /^(?=[^]*\\b[dD]iscussions{0,1}\\b)(?=[^]*\\b[dD]isabled\\b)[^]*$/;\nasync function mi(e) {\n  try {\n    const n = (await fetch(\n      `https://huggingface.co/api/spaces/${e}/discussions`,\n      {\n        method: \"HEAD\"\n      }\n    )).headers.get(\"x-error-message\");\n    return !(n && au.test(n));\n  } catch {\n    return !1;\n  }\n}\nfunction uu(e, t, n, r) {\n  if (t.length === 0) {\n    if (n === \"replace\")\n      return r;\n    if (n === \"append\")\n      return e + r;\n    throw new Error(`Unsupported action: ${n}`);\n  }\n  let i = e;\n  for (let l = 0; l < t.length - 1; l++)\n    i = i[t[l]];\n  const o = t[t.length - 1];\n  switch (n) {\n    case \"replace\":\n      i[o] = r;\n      break;\n    case \"append\":\n      i[o] += r;\n      break;\n    case \"add\":\n      Array.isArray(i) ? i.splice(Number(o), 0, r) : i[o] = r;\n      break;\n    case \"delete\":\n      Array.isArray(i) ? i.splice(Number(o), 1) : delete i[o];\n      break;\n    default:\n      throw new Error(`Unknown action: ${n}`);\n  }\n  return e;\n}\nfunction fu(e, t) {\n  return t.forEach(([n, r, i]) => {\n    e = uu(e, r, n, i);\n  }), e;\n}\nasync function cu(e, t, n, r = du) {\n  let i = (Array.isArray(e) ? e : [e]).map(\n    (o) => o.blob\n  );\n  return await Promise.all(\n    await r(t, i, void 0, n).then(\n      async (o) => {\n        if (o.error)\n          throw new Error(o.error);\n        return o.files ? o.files.map((l, a) => new qr({\n          ...e[a],\n          path: l,\n          url: t + \"/file=\" + l\n        })) : [];\n      }\n    )\n  );\n}\nasync function _u(e, t) {\n  return e.map(\n    (n, r) => new qr({\n      path: n.name,\n      orig_name: n.name,\n      blob: n,\n      size: n.size,\n      mime_type: n.type,\n      is_stream: t\n    })\n  );\n}\nclass qr {\n  constructor({\n    path: t,\n    url: n,\n    orig_name: r,\n    size: i,\n    blob: o,\n    is_stream: l,\n    mime_type: a,\n    alt_text: s\n  }) {\n    this.path = t, this.url = n, this.orig_name = r, this.size = i, this.blob = n ? void 0 : o, this.is_stream = l, this.mime_type = a, this.alt_text = s;\n  }\n}\nconst Ho = \"This application is too busy. Keep trying!\", Ye = \"Connection errored out.\";\nlet No;\nfunction hu(e, t) {\n  return { post_data: n, upload_files: r, client: i, handle_blob: o };\n  async function n(l, a, s) {\n    const u = { \"Content-Type\": \"application/json\" };\n    s && (u.Authorization = `Bearer ${s}`);\n    try {\n      var f = await e(l, {\n        method: \"POST\",\n        body: JSON.stringify(a),\n        headers: u\n      });\n    } catch {\n      return [{ error: Ye }, 500];\n    }\n    let c, _;\n    try {\n      c = await f.json(), _ = f.status;\n    } catch (h) {\n      c = { error: `Could not parse server response: ${h}` }, _ = 500;\n    }\n    return [c, _];\n  }\n  async function r(l, a, s, u) {\n    const f = {};\n    s && (f.Authorization = `Bearer ${s}`);\n    const c = 1e3, _ = [];\n    for (let d = 0; d < a.length; d += c) {\n      const m = a.slice(d, d + c), v = new FormData();\n      m.forEach((k) => {\n        v.append(\"files\", k);\n      });\n      try {\n        const k = u ? `${l}/upload?upload_id=${u}` : `${l}/upload`;\n        var h = await e(k, {\n          method: \"POST\",\n          body: v,\n          headers: f\n        });\n      } catch {\n        return { error: Ye };\n      }\n      const y = await h.json();\n      _.push(...y);\n    }\n    return { files: _ };\n  }\n  async function i(l, a = {}) {\n    return new Promise(async (s) => {\n      const { status_callback: u, hf_token: f } = a, c = {\n        predict: Re,\n        submit: se,\n        view_api: Ze,\n        component_server: gt\n      };\n      if ((typeof window > \"u\" || !(\"WebSocket\" in window)) && !global.Websocket) {\n        const B = await import(\"./wrapper-6f348d45-f837cf34.js\");\n        No = (await import(\"./__vite-browser-external-2447137e.js\")).Blob, global.WebSocket = B.WebSocket;\n      }\n      const { ws_protocol: _, http_protocol: h, host: d, space_id: m } = await lu(l, f), v = Math.random().toString(36).substring(2), y = {};\n      let k = !1, b = {}, p = {}, P = null;\n      const S = {}, A = /* @__PURE__ */ new Set();\n      let I, Q = {}, T = !1;\n      f && m && (T = await pu(m, f));\n      async function ye(B) {\n        if (I = B, window.location.protocol === \"https:\" && (I.root = I.root.replace(\"http://\", \"https://\")), Q = su((B == null ? void 0 : B.dependencies) || []), I.auth_required)\n          return {\n            config: I,\n            ...c\n          };\n        try {\n          Ne = await Ze(I);\n        } catch (w) {\n          console.error(`Could not get api details: ${w.message}`);\n        }\n        return {\n          config: I,\n          ...c\n        };\n      }\n      let Ne;\n      async function Ee(B) {\n        if (u && u(B), B.status === \"running\")\n          try {\n            I = await vi(\n              e,\n              `${h}//${d}`,\n              f\n            );\n            const w = await ye(I);\n            s(w);\n          } catch (w) {\n            console.error(w), u && u({\n              status: \"error\",\n              message: \"Could not load this space.\",\n              load_status: \"error\",\n              detail: \"NOT_FOUND\"\n            });\n          }\n      }\n      try {\n        I = await vi(\n          e,\n          `${h}//${d}`,\n          f\n        );\n        const B = await ye(I);\n        s(B);\n      } catch (B) {\n        console.error(B), m ? Tr(\n          m,\n          Co.test(m) ? \"space_name\" : \"subdomain\",\n          Ee\n        ) : u && u({\n          status: \"error\",\n          message: \"Could not load this space.\",\n          load_status: \"error\",\n          detail: \"NOT_FOUND\"\n        });\n      }\n      function Re(B, w, M) {\n        let g = !1, E = !1, Z;\n        if (typeof B == \"number\")\n          Z = I.dependencies[B];\n        else {\n          const x = B.replace(/^\\//, \"\");\n          Z = I.dependencies[Q[x]];\n        }\n        if (Z.types.continuous)\n          throw new Error(\n            \"Cannot call predict on this function as it may run forever. Use submit instead\"\n          );\n        return new Promise((x, ce) => {\n          const Se = se(B, w, M);\n          let N;\n          Se.on(\"data\", (_e) => {\n            E && (Se.destroy(), x(_e)), g = !0, N = _e;\n          }).on(\"status\", (_e) => {\n            _e.stage === \"error\" && ce(_e), _e.stage === \"complete\" && (E = !0, g && (Se.destroy(), x(N)));\n          });\n        });\n      }\n      function se(B, w, M, g = null) {\n        let E, Z;\n        if (typeof B == \"number\")\n          E = B, Z = Ne.unnamed_endpoints[E];\n        else {\n          const j = B.replace(/^\\//, \"\");\n          E = Q[j], Z = Ne.named_endpoints[B.trim()];\n        }\n        if (typeof E != \"number\")\n          throw new Error(\n            \"There is no endpoint matching that name of fn_index matching that number.\"\n          );\n        let x, ce, Se = I.protocol ?? \"ws\";\n        const N = typeof B == \"number\" ? \"/predict\" : B;\n        let _e, ne = null, ae = !1;\n        const Mt = {};\n        let Ge = \"\";\n        typeof window < \"u\" && (Ge = new URLSearchParams(window.location.search).toString()), o(`${I.root}`, w, Z, f).then(\n          (j) => {\n            if (_e = {\n              data: j || [],\n              event_data: M,\n              fn_index: E,\n              trigger_id: g\n            }, gu(E, I))\n              R({\n                type: \"status\",\n                endpoint: N,\n                stage: \"pending\",\n                queue: !1,\n                fn_index: E,\n                time: /* @__PURE__ */ new Date()\n              }), n(\n                `${I.root}/run${N.startsWith(\"/\") ? N : `/${N}`}${Ge ? \"?\" + Ge : \"\"}`,\n                {\n                  ..._e,\n                  session_hash: v\n                },\n                f\n              ).then(([V, q]) => {\n                const J = V.data;\n                q == 200 ? (R({\n                  type: \"data\",\n                  endpoint: N,\n                  fn_index: E,\n                  data: J,\n                  time: /* @__PURE__ */ new Date()\n                }), R({\n                  type: \"status\",\n                  endpoint: N,\n                  fn_index: E,\n                  stage: \"complete\",\n                  eta: V.average_duration,\n                  queue: !1,\n                  time: /* @__PURE__ */ new Date()\n                })) : R({\n                  type: \"status\",\n                  stage: \"error\",\n                  endpoint: N,\n                  fn_index: E,\n                  message: V.error,\n                  queue: !1,\n                  time: /* @__PURE__ */ new Date()\n                });\n              }).catch((V) => {\n                R({\n                  type: \"status\",\n                  stage: \"error\",\n                  message: V.message,\n                  endpoint: N,\n                  fn_index: E,\n                  queue: !1,\n                  time: /* @__PURE__ */ new Date()\n                });\n              });\n            else if (Se == \"ws\") {\n              R({\n                type: \"status\",\n                stage: \"pending\",\n                queue: !0,\n                endpoint: N,\n                fn_index: E,\n                time: /* @__PURE__ */ new Date()\n              });\n              let V = new URL(`${_}://${Bo(\n                d,\n                I.path,\n                !0\n              )}\n\t\t\t\t\t\t\t/queue/join${Ge ? \"?\" + Ge : \"\"}`);\n              T && V.searchParams.set(\"__sign\", T), x = new WebSocket(V), x.onclose = (q) => {\n                q.wasClean || R({\n                  type: \"status\",\n                  stage: \"error\",\n                  broken: !0,\n                  message: Ye,\n                  queue: !0,\n                  endpoint: N,\n                  fn_index: E,\n                  time: /* @__PURE__ */ new Date()\n                });\n              }, x.onmessage = function(q) {\n                const J = JSON.parse(q.data), { type: W, status: F, data: G } = ir(\n                  J,\n                  y[E]\n                );\n                if (W === \"update\" && F && !ae)\n                  R({\n                    type: \"status\",\n                    endpoint: N,\n                    fn_index: E,\n                    time: /* @__PURE__ */ new Date(),\n                    ...F\n                  }), F.stage === \"error\" && x.close();\n                else if (W === \"hash\") {\n                  x.send(JSON.stringify({ fn_index: E, session_hash: v }));\n                  return;\n                } else\n                  W === \"data\" ? x.send(JSON.stringify({ ..._e, session_hash: v })) : W === \"complete\" ? ae = F : W === \"log\" ? R({\n                    type: \"log\",\n                    log: G.log,\n                    level: G.level,\n                    endpoint: N,\n                    fn_index: E\n                  }) : W === \"generating\" && R({\n                    type: \"status\",\n                    time: /* @__PURE__ */ new Date(),\n                    ...F,\n                    stage: F == null ? void 0 : F.stage,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: E\n                  });\n                G && (R({\n                  type: \"data\",\n                  time: /* @__PURE__ */ new Date(),\n                  data: G.data,\n                  endpoint: N,\n                  fn_index: E\n                }), ae && (R({\n                  type: \"status\",\n                  time: /* @__PURE__ */ new Date(),\n                  ...ae,\n                  stage: F == null ? void 0 : F.stage,\n                  queue: !0,\n                  endpoint: N,\n                  fn_index: E\n                }), x.close()));\n              }, di(I.version || \"2.0.0\", \"3.6\") < 0 && addEventListener(\n                \"open\",\n                () => x.send(JSON.stringify({ hash: v }))\n              );\n            } else if (Se == \"sse\") {\n              R({\n                type: \"status\",\n                stage: \"pending\",\n                queue: !0,\n                endpoint: N,\n                fn_index: E,\n                time: /* @__PURE__ */ new Date()\n              });\n              var Y = new URLSearchParams({\n                fn_index: E.toString(),\n                session_hash: v\n              }).toString();\n              let V = new URL(\n                `${I.root}/queue/join?${Ge ? Ge + \"&\" : \"\"}${Y}`\n              );\n              ce = t(V), ce.onmessage = async function(q) {\n                const J = JSON.parse(q.data), { type: W, status: F, data: G } = ir(\n                  J,\n                  y[E]\n                );\n                if (W === \"update\" && F && !ae)\n                  R({\n                    type: \"status\",\n                    endpoint: N,\n                    fn_index: E,\n                    time: /* @__PURE__ */ new Date(),\n                    ...F\n                  }), F.stage === \"error\" && ce.close();\n                else if (W === \"data\") {\n                  ne = J.event_id;\n                  let [Je, Ol] = await n(\n                    `${I.root}/queue/data`,\n                    {\n                      ..._e,\n                      session_hash: v,\n                      event_id: ne\n                    },\n                    f\n                  );\n                  Ol !== 200 && (R({\n                    type: \"status\",\n                    stage: \"error\",\n                    message: Ye,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: E,\n                    time: /* @__PURE__ */ new Date()\n                  }), ce.close());\n                } else\n                  W === \"complete\" ? ae = F : W === \"log\" ? R({\n                    type: \"log\",\n                    log: G.log,\n                    level: G.level,\n                    endpoint: N,\n                    fn_index: E\n                  }) : W === \"generating\" && R({\n                    type: \"status\",\n                    time: /* @__PURE__ */ new Date(),\n                    ...F,\n                    stage: F == null ? void 0 : F.stage,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: E\n                  });\n                G && (R({\n                  type: \"data\",\n                  time: /* @__PURE__ */ new Date(),\n                  data: G.data,\n                  endpoint: N,\n                  fn_index: E\n                }), ae && (R({\n                  type: \"status\",\n                  time: /* @__PURE__ */ new Date(),\n                  ...ae,\n                  stage: F == null ? void 0 : F.stage,\n                  queue: !0,\n                  endpoint: N,\n                  fn_index: E\n                }), ce.close()));\n              };\n            } else\n              (Se == \"sse_v1\" || Se == \"sse_v2\") && (R({\n                type: \"status\",\n                stage: \"pending\",\n                queue: !0,\n                endpoint: N,\n                fn_index: E,\n                time: /* @__PURE__ */ new Date()\n              }), n(\n                `${I.root}/queue/join?${Ge}`,\n                {\n                  ..._e,\n                  session_hash: v\n                },\n                f\n              ).then(([V, q]) => {\n                if (q === 503)\n                  R({\n                    type: \"status\",\n                    stage: \"error\",\n                    message: Ho,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: E,\n                    time: /* @__PURE__ */ new Date()\n                  });\n                else if (q !== 200)\n                  R({\n                    type: \"status\",\n                    stage: \"error\",\n                    message: Ye,\n                    queue: !0,\n                    endpoint: N,\n                    fn_index: E,\n                    time: /* @__PURE__ */ new Date()\n                  });\n                else {\n                  ne = V.event_id;\n                  let J = async function(W) {\n                    try {\n                      const { type: F, status: G, data: Je } = ir(\n                        W,\n                        y[E]\n                      );\n                      if (F == \"heartbeat\")\n                        return;\n                      if (F === \"update\" && G && !ae)\n                        R({\n                          type: \"status\",\n                          endpoint: N,\n                          fn_index: E,\n                          time: /* @__PURE__ */ new Date(),\n                          ...G\n                        });\n                      else if (F === \"complete\")\n                        ae = G;\n                      else if (F == \"unexpected_error\")\n                        console.error(\"Unexpected error\", G == null ? void 0 : G.message), R({\n                          type: \"status\",\n                          stage: \"error\",\n                          message: (G == null ? void 0 : G.message) || \"An Unexpected Error Occurred!\",\n                          queue: !0,\n                          endpoint: N,\n                          fn_index: E,\n                          time: /* @__PURE__ */ new Date()\n                        });\n                      else if (F === \"log\") {\n                        R({\n                          type: \"log\",\n                          log: Je.log,\n                          level: Je.level,\n                          endpoint: N,\n                          fn_index: E\n                        });\n                        return;\n                      } else\n                        F === \"generating\" && (R({\n                          type: \"status\",\n                          time: /* @__PURE__ */ new Date(),\n                          ...G,\n                          stage: G == null ? void 0 : G.stage,\n                          queue: !0,\n                          endpoint: N,\n                          fn_index: E\n                        }), Je && Se === \"sse_v2\" && Ll(ne, Je));\n                      Je && (R({\n                        type: \"data\",\n                        time: /* @__PURE__ */ new Date(),\n                        data: Je.data,\n                        endpoint: N,\n                        fn_index: E\n                      }), ae && R({\n                        type: \"status\",\n                        time: /* @__PURE__ */ new Date(),\n                        ...ae,\n                        stage: G == null ? void 0 : G.stage,\n                        queue: !0,\n                        endpoint: N,\n                        fn_index: E\n                      })), ((G == null ? void 0 : G.stage) === \"complete\" || (G == null ? void 0 : G.stage) === \"error\") && (S[ne] && delete S[ne], ne in p && delete p[ne]);\n                    } catch (F) {\n                      console.error(\"Unexpected client exception\", F), R({\n                        type: \"status\",\n                        stage: \"error\",\n                        message: \"An Unexpected Error Occurred!\",\n                        queue: !0,\n                        endpoint: N,\n                        fn_index: E,\n                        time: /* @__PURE__ */ new Date()\n                      }), We();\n                    }\n                  };\n                  ne in b && (b[ne].forEach(\n                    (W) => J(W)\n                  ), delete b[ne]), S[ne] = J, A.add(ne), k || pt();\n                }\n              }));\n          }\n        );\n        function Ll(j, Y) {\n          !p[j] ? (p[j] = [], Y.data.forEach((q, J) => {\n            p[j][J] = q;\n          })) : Y.data.forEach((q, J) => {\n            let W = fu(\n              p[j][J],\n              q\n            );\n            p[j][J] = W, Y.data[J] = W;\n          });\n        }\n        function R(j) {\n          const V = Mt[j.type] || [];\n          V == null || V.forEach((q) => q(j));\n        }\n        function Fn(j, Y) {\n          const V = Mt, q = V[j] || [];\n          return V[j] = q, q == null || q.push(Y), { on: Fn, off: en, cancel: Gn, destroy: qn };\n        }\n        function en(j, Y) {\n          const V = Mt;\n          let q = V[j] || [];\n          return q = q == null ? void 0 : q.filter((J) => J !== Y), V[j] = q, { on: Fn, off: en, cancel: Gn, destroy: qn };\n        }\n        async function Gn() {\n          const j = {\n            stage: \"complete\",\n            queue: !1,\n            time: /* @__PURE__ */ new Date()\n          };\n          ae = j, R({\n            ...j,\n            type: \"status\",\n            endpoint: N,\n            fn_index: E\n          });\n          let Y = {};\n          Se === \"ws\" ? (x && x.readyState === 0 ? x.addEventListener(\"open\", () => {\n            x.close();\n          }) : x.close(), Y = { fn_index: E, session_hash: v }) : (ce.close(), Y = { event_id: ne });\n          try {\n            await e(`${I.root}/reset`, {\n              headers: { \"Content-Type\": \"application/json\" },\n              method: \"POST\",\n              body: JSON.stringify(Y)\n            });\n          } catch {\n            console.warn(\n              \"The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable.\"\n            );\n          }\n        }\n        function qn() {\n          for (const j in Mt)\n            Mt[j].forEach((Y) => {\n              en(j, Y);\n            });\n        }\n        return {\n          on: Fn,\n          off: en,\n          cancel: Gn,\n          destroy: qn\n        };\n      }\n      function pt() {\n        k = !0;\n        let B = new URLSearchParams({\n          session_hash: v\n        }).toString(), w = new URL(`${I.root}/queue/data?${B}`);\n        P = t(w), P.onmessage = async function(M) {\n          let g = JSON.parse(M.data);\n          const E = g.event_id;\n          if (!E)\n            await Promise.all(\n              Object.keys(S).map(\n                (Z) => S[Z](g)\n              )\n            );\n          else if (S[E]) {\n            g.msg === \"process_completed\" && (A.delete(E), A.size === 0 && We());\n            let Z = S[E];\n            window.setTimeout(Z, 0, g);\n          } else\n            b[E] || (b[E] = []), b[E].push(g);\n        }, P.onerror = async function(M) {\n          await Promise.all(\n            Object.keys(S).map(\n              (g) => S[g]({\n                msg: \"unexpected_error\",\n                message: Ye\n              })\n            )\n          ), We();\n        };\n      }\n      function We() {\n        k = !1, P == null || P.close();\n      }\n      async function gt(B, w, M) {\n        var g;\n        const E = { \"Content-Type\": \"application/json\" };\n        f && (E.Authorization = `Bearer ${f}`);\n        let Z, x = I.components.find(\n          (N) => N.id === B\n        );\n        (g = x == null ? void 0 : x.props) != null && g.root_url ? Z = x.props.root_url : Z = I.root;\n        const ce = await e(\n          `${Z}/component_server/`,\n          {\n            method: \"POST\",\n            body: JSON.stringify({\n              data: M,\n              component_id: B,\n              fn_name: w,\n              session_hash: v\n            }),\n            headers: E\n          }\n        );\n        if (!ce.ok)\n          throw new Error(\n            \"Could not connect to component server: \" + ce.statusText\n          );\n        return await ce.json();\n      }\n      async function Ze(B) {\n        if (Ne)\n          return Ne;\n        const w = { \"Content-Type\": \"application/json\" };\n        f && (w.Authorization = `Bearer ${f}`);\n        let M;\n        if (di(B.version || \"2.0.0\", \"3.30\") < 0 ? M = await e(\n          \"https://gradio-space-api-fetcher-v2.hf.space/api\",\n          {\n            method: \"POST\",\n            body: JSON.stringify({\n              serialize: !1,\n              config: JSON.stringify(B)\n            }),\n            headers: w\n          }\n        ) : M = await e(`${B.root}/info`, {\n          headers: w\n        }), !M.ok)\n          throw new Error(Ye);\n        let g = await M.json();\n        return \"api\" in g && (g = g.api), g.named_endpoints[\"/predict\"] && !g.unnamed_endpoints[0] && (g.unnamed_endpoints[0] = g.named_endpoints[\"/predict\"]), mu(g, B, Q);\n      }\n    });\n  }\n  async function o(l, a, s, u) {\n    const f = await kr(\n      a,\n      void 0,\n      [],\n      !0,\n      s\n    );\n    return Promise.all(\n      f.map(async ({ path: c, blob: _, type: h }) => {\n        if (_) {\n          const d = (await r(l, [_], u)).files[0];\n          return { path: c, file_url: d, type: h, name: _ == null ? void 0 : _.name };\n        }\n        return { path: c, type: h };\n      })\n    ).then((c) => (c.forEach(({ path: _, file_url: h, type: d, name: m }) => {\n      if (d === \"Gallery\")\n        bi(a, h, _);\n      else if (h) {\n        const v = new qr({ path: h, orig_name: m });\n        bi(a, v, _);\n      }\n    }), a));\n  }\n}\nconst { post_data: W_, upload_files: du, client: Z_, handle_blob: J_ } = hu(\n  fetch,\n  (...e) => new EventSource(...e)\n);\nfunction pi(e, t, n, r) {\n  switch (e.type) {\n    case \"string\":\n      return \"string\";\n    case \"boolean\":\n      return \"boolean\";\n    case \"number\":\n      return \"number\";\n  }\n  if (n === \"JSONSerializable\" || n === \"StringSerializable\")\n    return \"any\";\n  if (n === \"ListStringSerializable\")\n    return \"string[]\";\n  if (t === \"Image\")\n    return r === \"parameter\" ? \"Blob | File | Buffer\" : \"string\";\n  if (n === \"FileSerializable\")\n    return (e == null ? void 0 : e.type) === \"array\" ? r === \"parameter\" ? \"(Blob | File | Buffer)[]\" : \"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]\" : r === \"parameter\" ? \"Blob | File | Buffer\" : \"{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}\";\n  if (n === \"GallerySerializable\")\n    return r === \"parameter\" ? \"[(Blob | File | Buffer), (string | null)][]\" : \"[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]\";\n}\nfunction gi(e, t) {\n  return t === \"GallerySerializable\" ? \"array of [file, label] tuples\" : t === \"ListStringSerializable\" ? \"array of strings\" : t === \"FileSerializable\" ? \"array of files or single file\" : e.description;\n}\nfunction mu(e, t, n) {\n  const r = {\n    named_endpoints: {},\n    unnamed_endpoints: {}\n  };\n  for (const i in e) {\n    const o = e[i];\n    for (const l in o) {\n      const a = t.dependencies[l] ? l : n[l.replace(\"/\", \"\")], s = o[l];\n      r[i][l] = {}, r[i][l].parameters = {}, r[i][l].returns = {}, r[i][l].type = t.dependencies[a].types, r[i][l].parameters = s.parameters.map(\n        ({ label: u, component: f, type: c, serializer: _ }) => ({\n          label: u,\n          component: f,\n          type: pi(c, f, _, \"parameter\"),\n          description: gi(c, _)\n        })\n      ), r[i][l].returns = s.returns.map(\n        ({ label: u, component: f, type: c, serializer: _ }) => ({\n          label: u,\n          component: f,\n          type: pi(c, f, _, \"return\"),\n          description: gi(c, _)\n        })\n      );\n    }\n  }\n  return r;\n}\nasync function pu(e, t) {\n  try {\n    return (await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`, {\n      headers: {\n        Authorization: `Bearer ${t}`\n      }\n    })).json()).token || !1;\n  } catch (n) {\n    return console.error(n), !1;\n  }\n}\nfunction bi(e, t, n) {\n  for (; n.length > 1; )\n    e = e[n.shift()];\n  e[n.shift()] = t;\n}\nasync function kr(e, t = void 0, n = [], r = !1, i = void 0) {\n  if (Array.isArray(e)) {\n    let o = [];\n    return await Promise.all(\n      e.map(async (l, a) => {\n        var s;\n        let u = n.slice();\n        u.push(a);\n        const f = await kr(\n          e[a],\n          r ? ((s = i == null ? void 0 : i.parameters[a]) == null ? void 0 : s.component) || void 0 : t,\n          u,\n          !1,\n          i\n        );\n        o = o.concat(f);\n      })\n    ), o;\n  } else {\n    if (globalThis.Buffer && e instanceof globalThis.Buffer)\n      return [\n        {\n          path: n,\n          blob: t === \"Image\" ? !1 : new No([e]),\n          type: t\n        }\n      ];\n    if (typeof e == \"object\") {\n      let o = [];\n      for (let l in e)\n        if (e.hasOwnProperty(l)) {\n          let a = n.slice();\n          a.push(l), o = o.concat(\n            await kr(\n              e[l],\n              void 0,\n              a,\n              !1,\n              i\n            )\n          );\n        }\n      return o;\n    }\n  }\n  return [];\n}\nfunction gu(e, t) {\n  var n, r, i, o;\n  return !(((r = (n = t == null ? void 0 : t.dependencies) == null ? void 0 : n[e]) == null ? void 0 : r.queue) === null ? t.enable_queue : (o = (i = t == null ? void 0 : t.dependencies) == null ? void 0 : i[e]) != null && o.queue) || !1;\n}\nasync function vi(e, t, n) {\n  const r = {};\n  if (n && (r.Authorization = `Bearer ${n}`), typeof window < \"u\" && window.gradio_config && location.origin !== \"http://localhost:9876\" && !window.gradio_config.dev_mode) {\n    const i = window.gradio_config.root, o = window.gradio_config;\n    return o.root = Bo(t, o.root, !1), { ...o, path: i };\n  } else if (t) {\n    let i = await e(`${t}/config`, {\n      headers: r\n    });\n    if (i.status === 200) {\n      const o = await i.json();\n      return o.path = o.path ?? \"\", o.root = t, o;\n    }\n    throw new Error(\"Could not get config.\");\n  }\n  throw new Error(\"No config or app endpoint found\");\n}\nasync function Tr(e, t, n) {\n  let r = t === \"subdomain\" ? `https://huggingface.co/api/spaces/by-subdomain/${e}` : `https://huggingface.co/api/spaces/${e}`, i, o;\n  try {\n    if (i = await fetch(r), o = i.status, o !== 200)\n      throw new Error();\n    i = await i.json();\n  } catch {\n    n({\n      status: \"error\",\n      load_status: \"error\",\n      message: \"Could not get space status\",\n      detail: \"NOT_FOUND\"\n    });\n    return;\n  }\n  if (!i || o !== 200)\n    return;\n  const {\n    runtime: { stage: l },\n    id: a\n  } = i;\n  switch (l) {\n    case \"STOPPED\":\n    case \"SLEEPING\":\n      n({\n        status: \"sleeping\",\n        load_status: \"pending\",\n        message: \"Space is asleep. Waking it up...\",\n        detail: l\n      }), setTimeout(() => {\n        Tr(e, t, n);\n      }, 1e3);\n      break;\n    case \"PAUSED\":\n      n({\n        status: \"paused\",\n        load_status: \"error\",\n        message: \"This space has been paused by the author. If you would like to try this demo, consider duplicating the space.\",\n        detail: l,\n        discussions_enabled: await mi(a)\n      });\n      break;\n    case \"RUNNING\":\n    case \"RUNNING_BUILDING\":\n      n({\n        status: \"running\",\n        load_status: \"complete\",\n        message: \"\",\n        detail: l\n      });\n      break;\n    case \"BUILDING\":\n      n({\n        status: \"building\",\n        load_status: \"pending\",\n        message: \"Space is building...\",\n        detail: l\n      }), setTimeout(() => {\n        Tr(e, t, n);\n      }, 1e3);\n      break;\n    default:\n      n({\n        status: \"space_error\",\n        load_status: \"error\",\n        message: \"This space is experiencing an issue.\",\n        detail: l,\n        discussions_enabled: await mi(a)\n      });\n      break;\n  }\n}\nfunction ir(e, t) {\n  switch (e.msg) {\n    case \"send_data\":\n      return { type: \"data\" };\n    case \"send_hash\":\n      return { type: \"hash\" };\n    case \"queue_full\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          message: Ho,\n          stage: \"error\",\n          code: e.code,\n          success: e.success\n        }\n      };\n    case \"heartbeat\":\n      return {\n        type: \"heartbeat\"\n      };\n    case \"unexpected_error\":\n      return {\n        type: \"unexpected_error\",\n        status: {\n          queue: !0,\n          message: e.message,\n          stage: \"error\",\n          success: !1\n        }\n      };\n    case \"estimation\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          stage: t || \"pending\",\n          code: e.code,\n          size: e.queue_size,\n          position: e.rank,\n          eta: e.rank_eta,\n          success: e.success\n        }\n      };\n    case \"progress\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          stage: \"pending\",\n          code: e.code,\n          progress_data: e.progress_data,\n          success: e.success\n        }\n      };\n    case \"log\":\n      return { type: \"log\", data: e };\n    case \"process_generating\":\n      return {\n        type: \"generating\",\n        status: {\n          queue: !0,\n          message: e.success ? null : e.output.error,\n          stage: e.success ? \"generating\" : \"error\",\n          code: e.code,\n          progress_data: e.progress_data,\n          eta: e.average_duration\n        },\n        data: e.success ? e.output : null\n      };\n    case \"process_completed\":\n      return \"error\" in e.output ? {\n        type: \"update\",\n        status: {\n          queue: !0,\n          message: e.output.error,\n          stage: \"error\",\n          code: e.code,\n          success: e.success\n        }\n      } : {\n        type: \"complete\",\n        status: {\n          queue: !0,\n          message: e.success ? void 0 : e.output.error,\n          stage: e.success ? \"complete\" : \"error\",\n          code: e.code,\n          progress_data: e.progress_data\n        },\n        data: e.success ? e.output : null\n      };\n    case \"process_starts\":\n      return {\n        type: \"update\",\n        status: {\n          queue: !0,\n          stage: \"pending\",\n          code: e.code,\n          size: e.rank,\n          position: 0,\n          success: e.success,\n          eta: e.eta\n        }\n      };\n  }\n  return { type: \"none\", status: { stage: \"error\", queue: !0 } };\n}\nfunction ot() {\n}\nfunction bu(e) {\n  return e();\n}\nfunction vu(e) {\n  e.forEach(bu);\n}\nfunction wu(e) {\n  return typeof e == \"function\";\n}\nfunction yu(e, t) {\n  return e != e ? t == t : e !== t || e && typeof e == \"object\" || typeof e == \"function\";\n}\nfunction Eu(e, ...t) {\n  if (e == null) {\n    for (const r of t)\n      r(void 0);\n    return ot;\n  }\n  const n = e.subscribe(...t);\n  return n.unsubscribe ? () => n.unsubscribe() : n;\n}\nconst Po = typeof window < \"u\";\nlet wi = Po ? () => window.performance.now() : () => Date.now(), Io = Po ? (e) => requestAnimationFrame(e) : ot;\nconst kt = /* @__PURE__ */ new Set();\nfunction Lo(e) {\n  kt.forEach((t) => {\n    t.c(e) || (kt.delete(t), t.f());\n  }), kt.size !== 0 && Io(Lo);\n}\nfunction Su(e) {\n  let t;\n  return kt.size === 0 && Io(Lo), {\n    promise: new Promise((n) => {\n      kt.add(t = { c: e, f: n });\n    }),\n    abort() {\n      kt.delete(t);\n    }\n  };\n}\nconst wt = [];\nfunction ku(e, t) {\n  return {\n    subscribe: Zt(e, t).subscribe\n  };\n}\nfunction Zt(e, t = ot) {\n  let n;\n  const r = /* @__PURE__ */ new Set();\n  function i(a) {\n    if (yu(e, a) && (e = a, n)) {\n      const s = !wt.length;\n      for (const u of r)\n        u[1](), wt.push(u, e);\n      if (s) {\n        for (let u = 0; u < wt.length; u += 2)\n          wt[u][0](wt[u + 1]);\n        wt.length = 0;\n      }\n    }\n  }\n  function o(a) {\n    i(a(e));\n  }\n  function l(a, s = ot) {\n    const u = [a, s];\n    return r.add(u), r.size === 1 && (n = t(i, o) || ot), a(e), () => {\n      r.delete(u), r.size === 0 && n && (n(), n = null);\n    };\n  }\n  return { set: i, update: o, subscribe: l };\n}\nfunction It(e, t, n) {\n  const r = !Array.isArray(e), i = r ? [e] : e;\n  if (!i.every(Boolean))\n    throw new Error(\"derived() expects stores as input, got a falsy value\");\n  const o = t.length < 2;\n  return ku(n, (l, a) => {\n    let s = !1;\n    const u = [];\n    let f = 0, c = ot;\n    const _ = () => {\n      if (f)\n        return;\n      c();\n      const d = t(r ? u[0] : u, l, a);\n      o ? l(d) : c = wu(d) ? d : ot;\n    }, h = i.map(\n      (d, m) => Eu(\n        d,\n        (v) => {\n          u[m] = v, f &= ~(1 << m), s && _();\n        },\n        () => {\n          f |= 1 << m;\n        }\n      )\n    );\n    return s = !0, _(), function() {\n      vu(h), c(), s = !1;\n    };\n  });\n}\nfunction yi(e) {\n  return Object.prototype.toString.call(e) === \"[object Date]\";\n}\nfunction Ar(e, t, n, r) {\n  if (typeof n == \"number\" || yi(n)) {\n    const i = r - n, o = (n - t) / (e.dt || 1 / 60), l = e.opts.stiffness * i, a = e.opts.damping * o, s = (l - a) * e.inv_mass, u = (o + s) * e.dt;\n    return Math.abs(u) < e.opts.precision && Math.abs(i) < e.opts.precision ? r : (e.settled = !1, yi(n) ? new Date(n.getTime() + u) : n + u);\n  } else {\n    if (Array.isArray(n))\n      return n.map(\n        (i, o) => Ar(e, t[o], n[o], r[o])\n      );\n    if (typeof n == \"object\") {\n      const i = {};\n      for (const o in n)\n        i[o] = Ar(e, t[o], n[o], r[o]);\n      return i;\n    } else\n      throw new Error(`Cannot spring ${typeof n} values`);\n  }\n}\nfunction Ei(e, t = {}) {\n  const n = Zt(e), { stiffness: r = 0.15, damping: i = 0.8, precision: o = 0.01 } = t;\n  let l, a, s, u = e, f = e, c = 1, _ = 0, h = !1;\n  function d(v, y = {}) {\n    f = v;\n    const k = s = {};\n    return e == null || y.hard || m.stiffness >= 1 && m.damping >= 1 ? (h = !0, l = wi(), u = v, n.set(e = f), Promise.resolve()) : (y.soft && (_ = 1 / ((y.soft === !0 ? 0.5 : +y.soft) * 60), c = 0), a || (l = wi(), h = !1, a = Su((b) => {\n      if (h)\n        return h = !1, a = null, !1;\n      c = Math.min(c + _, 1);\n      const p = {\n        inv_mass: c,\n        opts: m,\n        settled: !0,\n        dt: (b - l) * 60 / 1e3\n      }, P = Ar(p, u, e, f);\n      return l = b, u = e, n.set(e = P), p.settled && (a = null), !p.settled;\n    })), new Promise((b) => {\n      a.promise.then(() => {\n        k === s && b();\n      });\n    }));\n  }\n  const m = {\n    set: d,\n    update: (v, y) => d(v(f, e), y),\n    subscribe: n.subscribe,\n    stiffness: r,\n    damping: i,\n    precision: o\n  };\n  return m;\n}\nvar Q_ = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {};\nfunction Tu(e) {\n  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, \"default\") ? e.default : e;\n}\nvar Au = function(t) {\n  return Bu(t) && !Cu(t);\n};\nfunction Bu(e) {\n  return !!e && typeof e == \"object\";\n}\nfunction Cu(e) {\n  var t = Object.prototype.toString.call(e);\n  return t === \"[object RegExp]\" || t === \"[object Date]\" || Pu(e);\n}\nvar Hu = typeof Symbol == \"function\" && Symbol.for, Nu = Hu ? Symbol.for(\"react.element\") : 60103;\nfunction Pu(e) {\n  return e.$$typeof === Nu;\n}\nfunction Iu(e) {\n  return Array.isArray(e) ? [] : {};\n}\nfunction jt(e, t) {\n  return t.clone !== !1 && t.isMergeableObject(e) ? At(Iu(e), e, t) : e;\n}\nfunction Lu(e, t, n) {\n  return e.concat(t).map(function(r) {\n    return jt(r, n);\n  });\n}\nfunction Ou(e, t) {\n  if (!t.customMerge)\n    return At;\n  var n = t.customMerge(e);\n  return typeof n == \"function\" ? n : At;\n}\nfunction Mu(e) {\n  return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {\n    return Object.propertyIsEnumerable.call(e, t);\n  }) : [];\n}\nfunction Si(e) {\n  return Object.keys(e).concat(Mu(e));\n}\nfunction Oo(e, t) {\n  try {\n    return t in e;\n  } catch {\n    return !1;\n  }\n}\nfunction Du(e, t) {\n  return Oo(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));\n}\nfunction Ru(e, t, n) {\n  var r = {};\n  return n.isMergeableObject(e) && Si(e).forEach(function(i) {\n    r[i] = jt(e[i], n);\n  }), Si(t).forEach(function(i) {\n    Du(e, i) || (Oo(e, i) && n.isMergeableObject(t[i]) ? r[i] = Ou(i, n)(e[i], t[i], n) : r[i] = jt(t[i], n));\n  }), r;\n}\nfunction At(e, t, n) {\n  n = n || {}, n.arrayMerge = n.arrayMerge || Lu, n.isMergeableObject = n.isMergeableObject || Au, n.cloneUnlessOtherwiseSpecified = jt;\n  var r = Array.isArray(t), i = Array.isArray(e), o = r === i;\n  return o ? r ? n.arrayMerge(e, t, n) : Ru(e, t, n) : jt(t, n);\n}\nAt.all = function(t, n) {\n  if (!Array.isArray(t))\n    throw new Error(\"first argument should be an array\");\n  return t.reduce(function(r, i) {\n    return At(r, i, n);\n  }, {});\n};\nvar Uu = At, Fu = Uu;\nconst Gu = /* @__PURE__ */ Tu(Fu);\nvar Br = function(e, t) {\n  return Br = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {\n    n.__proto__ = r;\n  } || function(n, r) {\n    for (var i in r)\n      Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);\n  }, Br(e, t);\n};\nfunction Hn(e, t) {\n  if (typeof t != \"function\" && t !== null)\n    throw new TypeError(\"Class extends value \" + String(t) + \" is not a constructor or null\");\n  Br(e, t);\n  function n() {\n    this.constructor = e;\n  }\n  e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());\n}\nvar U = function() {\n  return U = Object.assign || function(t) {\n    for (var n, r = 1, i = arguments.length; r < i; r++) {\n      n = arguments[r];\n      for (var o in n)\n        Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);\n    }\n    return t;\n  }, U.apply(this, arguments);\n};\nfunction or(e, t, n) {\n  if (n || arguments.length === 2)\n    for (var r = 0, i = t.length, o; r < i; r++)\n      (o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);\n  return e.concat(o || Array.prototype.slice.call(t));\n}\nvar L;\n(function(e) {\n  e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\", e[e.EMPTY_ARGUMENT = 2] = \"EMPTY_ARGUMENT\", e[e.MALFORMED_ARGUMENT = 3] = \"MALFORMED_ARGUMENT\", e[e.EXPECT_ARGUMENT_TYPE = 4] = \"EXPECT_ARGUMENT_TYPE\", e[e.INVALID_ARGUMENT_TYPE = 5] = \"INVALID_ARGUMENT_TYPE\", e[e.EXPECT_ARGUMENT_STYLE = 6] = \"EXPECT_ARGUMENT_STYLE\", e[e.INVALID_NUMBER_SKELETON = 7] = \"INVALID_NUMBER_SKELETON\", e[e.INVALID_DATE_TIME_SKELETON = 8] = \"INVALID_DATE_TIME_SKELETON\", e[e.EXPECT_NUMBER_SKELETON = 9] = \"EXPECT_NUMBER_SKELETON\", e[e.EXPECT_DATE_TIME_SKELETON = 10] = \"EXPECT_DATE_TIME_SKELETON\", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\", e[e.MISSING_OTHER_CLAUSE = 22] = \"MISSING_OTHER_CLAUSE\", e[e.INVALID_TAG = 23] = \"INVALID_TAG\", e[e.INVALID_TAG_NAME = 25] = \"INVALID_TAG_NAME\", e[e.UNMATCHED_CLOSING_TAG = 26] = \"UNMATCHED_CLOSING_TAG\", e[e.UNCLOSED_TAG = 27] = \"UNCLOSED_TAG\";\n})(L || (L = {}));\nvar z;\n(function(e) {\n  e[e.literal = 0] = \"literal\", e[e.argument = 1] = \"argument\", e[e.number = 2] = \"number\", e[e.date = 3] = \"date\", e[e.time = 4] = \"time\", e[e.select = 5] = \"select\", e[e.plural = 6] = \"plural\", e[e.pound = 7] = \"pound\", e[e.tag = 8] = \"tag\";\n})(z || (z = {}));\nvar Bt;\n(function(e) {\n  e[e.number = 0] = \"number\", e[e.dateTime = 1] = \"dateTime\";\n})(Bt || (Bt = {}));\nfunction ki(e) {\n  return e.type === z.literal;\n}\nfunction qu(e) {\n  return e.type === z.argument;\n}\nfunction Mo(e) {\n  return e.type === z.number;\n}\nfunction Do(e) {\n  return e.type === z.date;\n}\nfunction Ro(e) {\n  return e.type === z.time;\n}\nfunction Uo(e) {\n  return e.type === z.select;\n}\nfunction Fo(e) {\n  return e.type === z.plural;\n}\nfunction ju(e) {\n  return e.type === z.pound;\n}\nfunction Go(e) {\n  return e.type === z.tag;\n}\nfunction qo(e) {\n  return !!(e && typeof e == \"object\" && e.type === Bt.number);\n}\nfunction Cr(e) {\n  return !!(e && typeof e == \"object\" && e.type === Bt.dateTime);\n}\nvar jo = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/, zu = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\nfunction Vu(e) {\n  var t = {};\n  return e.replace(zu, function(n) {\n    var r = n.length;\n    switch (n[0]) {\n      case \"G\":\n        t.era = r === 4 ? \"long\" : r === 5 ? \"narrow\" : \"short\";\n        break;\n      case \"y\":\n        t.year = r === 2 ? \"2-digit\" : \"numeric\";\n        break;\n      case \"Y\":\n      case \"u\":\n      case \"U\":\n      case \"r\":\n        throw new RangeError(\"`Y/u/U/r` (year) patterns are not supported, use `y` instead\");\n      case \"q\":\n      case \"Q\":\n        throw new RangeError(\"`q/Q` (quarter) patterns are not supported\");\n      case \"M\":\n      case \"L\":\n        t.month = [\"numeric\", \"2-digit\", \"short\", \"long\", \"narrow\"][r - 1];\n        break;\n      case \"w\":\n      case \"W\":\n        throw new RangeError(\"`w/W` (week) patterns are not supported\");\n      case \"d\":\n        t.day = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"D\":\n      case \"F\":\n      case \"g\":\n        throw new RangeError(\"`D/F/g` (day) patterns are not supported, use `d` instead\");\n      case \"E\":\n        t.weekday = r === 4 ? \"short\" : r === 5 ? \"narrow\" : \"short\";\n        break;\n      case \"e\":\n        if (r < 4)\n          throw new RangeError(\"`e..eee` (weekday) patterns are not supported\");\n        t.weekday = [\"short\", \"long\", \"narrow\", \"short\"][r - 4];\n        break;\n      case \"c\":\n        if (r < 4)\n          throw new RangeError(\"`c..ccc` (weekday) patterns are not supported\");\n        t.weekday = [\"short\", \"long\", \"narrow\", \"short\"][r - 4];\n        break;\n      case \"a\":\n        t.hour12 = !0;\n        break;\n      case \"b\":\n      case \"B\":\n        throw new RangeError(\"`b/B` (period) patterns are not supported, use `a` instead\");\n      case \"h\":\n        t.hourCycle = \"h12\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"H\":\n        t.hourCycle = \"h23\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"K\":\n        t.hourCycle = \"h11\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"k\":\n        t.hourCycle = \"h24\", t.hour = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"j\":\n      case \"J\":\n      case \"C\":\n        throw new RangeError(\"`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead\");\n      case \"m\":\n        t.minute = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"s\":\n        t.second = [\"numeric\", \"2-digit\"][r - 1];\n        break;\n      case \"S\":\n      case \"A\":\n        throw new RangeError(\"`S/A` (second) patterns are not supported, use `s` instead\");\n      case \"z\":\n        t.timeZoneName = r < 4 ? \"short\" : \"long\";\n        break;\n      case \"Z\":\n      case \"O\":\n      case \"v\":\n      case \"V\":\n      case \"X\":\n      case \"x\":\n        throw new RangeError(\"`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead\");\n    }\n    return \"\";\n  }), t;\n}\nvar Xu = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\nfunction xu(e) {\n  if (e.length === 0)\n    throw new Error(\"Number skeleton cannot be empty\");\n  for (var t = e.split(Xu).filter(function(_) {\n    return _.length > 0;\n  }), n = [], r = 0, i = t; r < i.length; r++) {\n    var o = i[r], l = o.split(\"/\");\n    if (l.length === 0)\n      throw new Error(\"Invalid number skeleton\");\n    for (var a = l[0], s = l.slice(1), u = 0, f = s; u < f.length; u++) {\n      var c = f[u];\n      if (c.length === 0)\n        throw new Error(\"Invalid number skeleton\");\n    }\n    n.push({ stem: a, options: s });\n  }\n  return n;\n}\nfunction Wu(e) {\n  return e.replace(/^(.*?)-/, \"\");\n}\nvar Ti = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g, zo = /^(@+)?(\\+|#+)?[rs]?$/g, Zu = /(\\*)(0+)|(#+)(0+)|(0+)/g, Vo = /^(0+)$/;\nfunction Ai(e) {\n  var t = {};\n  return e[e.length - 1] === \"r\" ? t.roundingPriority = \"morePrecision\" : e[e.length - 1] === \"s\" && (t.roundingPriority = \"lessPrecision\"), e.replace(zo, function(n, r, i) {\n    return typeof i != \"string\" ? (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length) : i === \"+\" ? t.minimumSignificantDigits = r.length : r[0] === \"#\" ? t.maximumSignificantDigits = r.length : (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length + (typeof i == \"string\" ? i.length : 0)), \"\";\n  }), t;\n}\nfunction Xo(e) {\n  switch (e) {\n    case \"sign-auto\":\n      return {\n        signDisplay: \"auto\"\n      };\n    case \"sign-accounting\":\n    case \"()\":\n      return {\n        currencySign: \"accounting\"\n      };\n    case \"sign-always\":\n    case \"+!\":\n      return {\n        signDisplay: \"always\"\n      };\n    case \"sign-accounting-always\":\n    case \"()!\":\n      return {\n        signDisplay: \"always\",\n        currencySign: \"accounting\"\n      };\n    case \"sign-except-zero\":\n    case \"+?\":\n      return {\n        signDisplay: \"exceptZero\"\n      };\n    case \"sign-accounting-except-zero\":\n    case \"()?\":\n      return {\n        signDisplay: \"exceptZero\",\n        currencySign: \"accounting\"\n      };\n    case \"sign-never\":\n    case \"+_\":\n      return {\n        signDisplay: \"never\"\n      };\n  }\n}\nfunction Ju(e) {\n  var t;\n  if (e[0] === \"E\" && e[1] === \"E\" ? (t = {\n    notation: \"engineering\"\n  }, e = e.slice(2)) : e[0] === \"E\" && (t = {\n    notation: \"scientific\"\n  }, e = e.slice(1)), t) {\n    var n = e.slice(0, 2);\n    if (n === \"+!\" ? (t.signDisplay = \"always\", e = e.slice(2)) : n === \"+?\" && (t.signDisplay = \"exceptZero\", e = e.slice(2)), !Vo.test(e))\n      throw new Error(\"Malformed concise eng/scientific notation\");\n    t.minimumIntegerDigits = e.length;\n  }\n  return t;\n}\nfunction Bi(e) {\n  var t = {}, n = Xo(e);\n  return n || t;\n}\nfunction Qu(e) {\n  for (var t = {}, n = 0, r = e; n < r.length; n++) {\n    var i = r[n];\n    switch (i.stem) {\n      case \"percent\":\n      case \"%\":\n        t.style = \"percent\";\n        continue;\n      case \"%x100\":\n        t.style = \"percent\", t.scale = 100;\n        continue;\n      case \"currency\":\n        t.style = \"currency\", t.currency = i.options[0];\n        continue;\n      case \"group-off\":\n      case \",_\":\n        t.useGrouping = !1;\n        continue;\n      case \"precision-integer\":\n      case \".\":\n        t.maximumFractionDigits = 0;\n        continue;\n      case \"measure-unit\":\n      case \"unit\":\n        t.style = \"unit\", t.unit = Wu(i.options[0]);\n        continue;\n      case \"compact-short\":\n      case \"K\":\n        t.notation = \"compact\", t.compactDisplay = \"short\";\n        continue;\n      case \"compact-long\":\n      case \"KK\":\n        t.notation = \"compact\", t.compactDisplay = \"long\";\n        continue;\n      case \"scientific\":\n        t = U(U(U({}, t), { notation: \"scientific\" }), i.options.reduce(function(s, u) {\n          return U(U({}, s), Bi(u));\n        }, {}));\n        continue;\n      case \"engineering\":\n        t = U(U(U({}, t), { notation: \"engineering\" }), i.options.reduce(function(s, u) {\n          return U(U({}, s), Bi(u));\n        }, {}));\n        continue;\n      case \"notation-simple\":\n        t.notation = \"standard\";\n        continue;\n      case \"unit-width-narrow\":\n        t.currencyDisplay = \"narrowSymbol\", t.unitDisplay = \"narrow\";\n        continue;\n      case \"unit-width-short\":\n        t.currencyDisplay = \"code\", t.unitDisplay = \"short\";\n        continue;\n      case \"unit-width-full-name\":\n        t.currencyDisplay = \"name\", t.unitDisplay = \"long\";\n        continue;\n      case \"unit-width-iso-code\":\n        t.currencyDisplay = \"symbol\";\n        continue;\n      case \"scale\":\n        t.scale = parseFloat(i.options[0]);\n        continue;\n      case \"integer-width\":\n        if (i.options.length > 1)\n          throw new RangeError(\"integer-width stems only accept a single optional option\");\n        i.options[0].replace(Zu, function(s, u, f, c, _, h) {\n          if (u)\n            t.minimumIntegerDigits = f.length;\n          else {\n            if (c && _)\n              throw new Error(\"We currently do not support maximum integer digits\");\n            if (h)\n              throw new Error(\"We currently do not support exact integer digits\");\n          }\n          return \"\";\n        });\n        continue;\n    }\n    if (Vo.test(i.stem)) {\n      t.minimumIntegerDigits = i.stem.length;\n      continue;\n    }\n    if (Ti.test(i.stem)) {\n      if (i.options.length > 1)\n        throw new RangeError(\"Fraction-precision stems only accept a single optional option\");\n      i.stem.replace(Ti, function(s, u, f, c, _, h) {\n        return f === \"*\" ? t.minimumFractionDigits = u.length : c && c[0] === \"#\" ? t.maximumFractionDigits = c.length : _ && h ? (t.minimumFractionDigits = _.length, t.maximumFractionDigits = _.length + h.length) : (t.minimumFractionDigits = u.length, t.maximumFractionDigits = u.length), \"\";\n      });\n      var o = i.options[0];\n      o === \"w\" ? t = U(U({}, t), { trailingZeroDisplay: \"stripIfInteger\" }) : o && (t = U(U({}, t), Ai(o)));\n      continue;\n    }\n    if (zo.test(i.stem)) {\n      t = U(U({}, t), Ai(i.stem));\n      continue;\n    }\n    var l = Xo(i.stem);\n    l && (t = U(U({}, t), l));\n    var a = Ju(i.stem);\n    a && (t = U(U({}, t), a));\n  }\n  return t;\n}\nvar sn = {\n  AX: [\n    \"H\"\n  ],\n  BQ: [\n    \"H\"\n  ],\n  CP: [\n    \"H\"\n  ],\n  CZ: [\n    \"H\"\n  ],\n  DK: [\n    \"H\"\n  ],\n  FI: [\n    \"H\"\n  ],\n  ID: [\n    \"H\"\n  ],\n  IS: [\n    \"H\"\n  ],\n  ML: [\n    \"H\"\n  ],\n  NE: [\n    \"H\"\n  ],\n  RU: [\n    \"H\"\n  ],\n  SE: [\n    \"H\"\n  ],\n  SJ: [\n    \"H\"\n  ],\n  SK: [\n    \"H\"\n  ],\n  AS: [\n    \"h\",\n    \"H\"\n  ],\n  BT: [\n    \"h\",\n    \"H\"\n  ],\n  DJ: [\n    \"h\",\n    \"H\"\n  ],\n  ER: [\n    \"h\",\n    \"H\"\n  ],\n  GH: [\n    \"h\",\n    \"H\"\n  ],\n  IN: [\n    \"h\",\n    \"H\"\n  ],\n  LS: [\n    \"h\",\n    \"H\"\n  ],\n  PG: [\n    \"h\",\n    \"H\"\n  ],\n  PW: [\n    \"h\",\n    \"H\"\n  ],\n  SO: [\n    \"h\",\n    \"H\"\n  ],\n  TO: [\n    \"h\",\n    \"H\"\n  ],\n  VU: [\n    \"h\",\n    \"H\"\n  ],\n  WS: [\n    \"h\",\n    \"H\"\n  ],\n  \"001\": [\n    \"H\",\n    \"h\"\n  ],\n  AL: [\n    \"h\",\n    \"H\",\n    \"hB\"\n  ],\n  TD: [\n    \"h\",\n    \"H\",\n    \"hB\"\n  ],\n  \"ca-ES\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  CF: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  CM: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"fr-CA\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"gl-ES\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"it-CH\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  \"it-IT\": [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  LU: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  NP: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  PF: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  SC: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  SM: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  SN: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  TF: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  VA: [\n    \"H\",\n    \"h\",\n    \"hB\"\n  ],\n  CY: [\n    \"h\",\n    \"H\",\n    \"hb\",\n    \"hB\"\n  ],\n  GR: [\n    \"h\",\n    \"H\",\n    \"hb\",\n    \"hB\"\n  ],\n  CO: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  DO: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  KP: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  KR: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  NA: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  PA: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  PR: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  VE: [\n    \"h\",\n    \"H\",\n    \"hB\",\n    \"hb\"\n  ],\n  AC: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  AI: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  BW: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  BZ: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  CC: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  CK: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  CX: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  DG: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  FK: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  GB: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  GG: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  GI: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  IE: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  IM: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  IO: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  JE: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  LT: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  MK: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  MN: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  MS: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NF: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NG: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NR: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  NU: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  PN: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  SH: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  SX: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  TA: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  ZA: [\n    \"H\",\n    \"h\",\n    \"hb\",\n    \"hB\"\n  ],\n  \"af-ZA\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  AR: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  CL: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  CR: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  CU: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  EA: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-BO\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-BR\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-EC\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-ES\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-GQ\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  \"es-PE\": [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  GT: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  HN: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  IC: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  KG: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  KM: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  LK: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  MA: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  MX: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  NI: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  PY: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  SV: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  UY: [\n    \"H\",\n    \"h\",\n    \"hB\",\n    \"hb\"\n  ],\n  JP: [\n    \"H\",\n    \"h\",\n    \"K\"\n  ],\n  AD: [\n    \"H\",\n    \"hB\"\n  ],\n  AM: [\n    \"H\",\n    \"hB\"\n  ],\n  AO: [\n    \"H\",\n    \"hB\"\n  ],\n  AT: [\n    \"H\",\n    \"hB\"\n  ],\n  AW: [\n    \"H\",\n    \"hB\"\n  ],\n  BE: [\n    \"H\",\n    \"hB\"\n  ],\n  BF: [\n    \"H\",\n    \"hB\"\n  ],\n  BJ: [\n    \"H\",\n    \"hB\"\n  ],\n  BL: [\n    \"H\",\n    \"hB\"\n  ],\n  BR: [\n    \"H\",\n    \"hB\"\n  ],\n  CG: [\n    \"H\",\n    \"hB\"\n  ],\n  CI: [\n    \"H\",\n    \"hB\"\n  ],\n  CV: [\n    \"H\",\n    \"hB\"\n  ],\n  DE: [\n    \"H\",\n    \"hB\"\n  ],\n  EE: [\n    \"H\",\n    \"hB\"\n  ],\n  FR: [\n    \"H\",\n    \"hB\"\n  ],\n  GA: [\n    \"H\",\n    \"hB\"\n  ],\n  GF: [\n    \"H\",\n    \"hB\"\n  ],\n  GN: [\n    \"H\",\n    \"hB\"\n  ],\n  GP: [\n    \"H\",\n    \"hB\"\n  ],\n  GW: [\n    \"H\",\n    \"hB\"\n  ],\n  HR: [\n    \"H\",\n    \"hB\"\n  ],\n  IL: [\n    \"H\",\n    \"hB\"\n  ],\n  IT: [\n    \"H\",\n    \"hB\"\n  ],\n  KZ: [\n    \"H\",\n    \"hB\"\n  ],\n  MC: [\n    \"H\",\n    \"hB\"\n  ],\n  MD: [\n    \"H\",\n    \"hB\"\n  ],\n  MF: [\n    \"H\",\n    \"hB\"\n  ],\n  MQ: [\n    \"H\",\n    \"hB\"\n  ],\n  MZ: [\n    \"H\",\n    \"hB\"\n  ],\n  NC: [\n    \"H\",\n    \"hB\"\n  ],\n  NL: [\n    \"H\",\n    \"hB\"\n  ],\n  PM: [\n    \"H\",\n    \"hB\"\n  ],\n  PT: [\n    \"H\",\n    \"hB\"\n  ],\n  RE: [\n    \"H\",\n    \"hB\"\n  ],\n  RO: [\n    \"H\",\n    \"hB\"\n  ],\n  SI: [\n    \"H\",\n    \"hB\"\n  ],\n  SR: [\n    \"H\",\n    \"hB\"\n  ],\n  ST: [\n    \"H\",\n    \"hB\"\n  ],\n  TG: [\n    \"H\",\n    \"hB\"\n  ],\n  TR: [\n    \"H\",\n    \"hB\"\n  ],\n  WF: [\n    \"H\",\n    \"hB\"\n  ],\n  YT: [\n    \"H\",\n    \"hB\"\n  ],\n  BD: [\n    \"h\",\n    \"hB\",\n    \"H\"\n  ],\n  PK: [\n    \"h\",\n    \"hB\",\n    \"H\"\n  ],\n  AZ: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  BA: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  BG: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  CH: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  GE: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  LI: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  ME: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  RS: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  UA: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  UZ: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  XK: [\n    \"H\",\n    \"hB\",\n    \"h\"\n  ],\n  AG: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  AU: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BB: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BS: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  CA: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  DM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  \"en-001\": [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  FJ: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  FM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GD: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GU: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  GY: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  JM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  KI: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  KN: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  KY: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  LC: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  LR: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  MH: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  MP: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  MW: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  NZ: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SB: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SG: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SL: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SS: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  SZ: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  TC: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  TT: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  UM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  US: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  VC: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  VG: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  VI: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  ZM: [\n    \"h\",\n    \"hb\",\n    \"H\",\n    \"hB\"\n  ],\n  BO: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  EC: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  ES: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  GQ: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  PE: [\n    \"H\",\n    \"hB\",\n    \"h\",\n    \"hb\"\n  ],\n  AE: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  \"ar-001\": [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  BH: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  DZ: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  EG: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  EH: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  HK: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  IQ: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  JO: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  KW: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  LB: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  LY: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  MO: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  MR: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  OM: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  PH: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  PS: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  QA: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  SA: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  SD: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  SY: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  TN: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  YE: [\n    \"h\",\n    \"hB\",\n    \"hb\",\n    \"H\"\n  ],\n  AF: [\n    \"H\",\n    \"hb\",\n    \"hB\",\n    \"h\"\n  ],\n  LA: [\n    \"H\",\n    \"hb\",\n    \"hB\",\n    \"h\"\n  ],\n  CN: [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  LV: [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  TL: [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  \"zu-ZA\": [\n    \"H\",\n    \"hB\",\n    \"hb\",\n    \"h\"\n  ],\n  CD: [\n    \"hB\",\n    \"H\"\n  ],\n  IR: [\n    \"hB\",\n    \"H\"\n  ],\n  \"hi-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  \"kn-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  \"ml-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  \"te-IN\": [\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  KH: [\n    \"hB\",\n    \"h\",\n    \"H\",\n    \"hb\"\n  ],\n  \"ta-IN\": [\n    \"hB\",\n    \"h\",\n    \"hb\",\n    \"H\"\n  ],\n  BN: [\n    \"hb\",\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  MY: [\n    \"hb\",\n    \"hB\",\n    \"h\",\n    \"H\"\n  ],\n  ET: [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  \"gu-IN\": [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  \"mr-IN\": [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  \"pa-IN\": [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  TW: [\n    \"hB\",\n    \"hb\",\n    \"h\",\n    \"H\"\n  ],\n  KE: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ],\n  MM: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ],\n  TZ: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ],\n  UG: [\n    \"hB\",\n    \"hb\",\n    \"H\",\n    \"h\"\n  ]\n};\nfunction Yu(e, t) {\n  for (var n = \"\", r = 0; r < e.length; r++) {\n    var i = e.charAt(r);\n    if (i === \"j\") {\n      for (var o = 0; r + 1 < e.length && e.charAt(r + 1) === i; )\n        o++, r++;\n      var l = 1 + (o & 1), a = o < 2 ? 1 : 3 + (o >> 1), s = \"a\", u = Ku(t);\n      for ((u == \"H\" || u == \"k\") && (a = 0); a-- > 0; )\n        n += s;\n      for (; l-- > 0; )\n        n = u + n;\n    } else\n      i === \"J\" ? n += \"H\" : n += i;\n  }\n  return n;\n}\nfunction Ku(e) {\n  var t = e.hourCycle;\n  if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet\n  e.hourCycles && // @ts-ignore\n  e.hourCycles.length && (t = e.hourCycles[0]), t)\n    switch (t) {\n      case \"h24\":\n        return \"k\";\n      case \"h23\":\n        return \"H\";\n      case \"h12\":\n        return \"h\";\n      case \"h11\":\n        return \"K\";\n      default:\n        throw new Error(\"Invalid hourCycle\");\n    }\n  var n = e.language, r;\n  n !== \"root\" && (r = e.maximize().region);\n  var i = sn[r || \"\"] || sn[n || \"\"] || sn[\"\".concat(n, \"-001\")] || sn[\"001\"];\n  return i[0];\n}\nvar lr, $u = new RegExp(\"^\".concat(jo.source, \"*\")), ef = new RegExp(\"\".concat(jo.source, \"*$\"));\nfunction O(e, t) {\n  return { start: e, end: t };\n}\nvar tf = !!String.prototype.startsWith, nf = !!String.fromCodePoint, rf = !!Object.fromEntries, of = !!String.prototype.codePointAt, lf = !!String.prototype.trimStart, sf = !!String.prototype.trimEnd, af = !!Number.isSafeInteger, uf = af ? Number.isSafeInteger : function(e) {\n  return typeof e == \"number\" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;\n}, Hr = !0;\ntry {\n  var ff = Wo(\"([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)\", \"yu\");\n  Hr = ((lr = ff.exec(\"a\")) === null || lr === void 0 ? void 0 : lr[0]) === \"a\";\n} catch {\n  Hr = !1;\n}\nvar Ci = tf ? (\n  // Native\n  function(t, n, r) {\n    return t.startsWith(n, r);\n  }\n) : (\n  // For IE11\n  function(t, n, r) {\n    return t.slice(r, r + n.length) === n;\n  }\n), Nr = nf ? String.fromCodePoint : (\n  // IE11\n  function() {\n    for (var t = [], n = 0; n < arguments.length; n++)\n      t[n] = arguments[n];\n    for (var r = \"\", i = t.length, o = 0, l; i > o; ) {\n      if (l = t[o++], l > 1114111)\n        throw RangeError(l + \" is not a valid code point\");\n      r += l < 65536 ? String.fromCharCode(l) : String.fromCharCode(((l -= 65536) >> 10) + 55296, l % 1024 + 56320);\n    }\n    return r;\n  }\n), Hi = (\n  // native\n  rf ? Object.fromEntries : (\n    // Ponyfill\n    function(t) {\n      for (var n = {}, r = 0, i = t; r < i.length; r++) {\n        var o = i[r], l = o[0], a = o[1];\n        n[l] = a;\n      }\n      return n;\n    }\n  )\n), xo = of ? (\n  // Native\n  function(t, n) {\n    return t.codePointAt(n);\n  }\n) : (\n  // IE 11\n  function(t, n) {\n    var r = t.length;\n    if (!(n < 0 || n >= r)) {\n      var i = t.charCodeAt(n), o;\n      return i < 55296 || i > 56319 || n + 1 === r || (o = t.charCodeAt(n + 1)) < 56320 || o > 57343 ? i : (i - 55296 << 10) + (o - 56320) + 65536;\n    }\n  }\n), cf = lf ? (\n  // Native\n  function(t) {\n    return t.trimStart();\n  }\n) : (\n  // Ponyfill\n  function(t) {\n    return t.replace($u, \"\");\n  }\n), _f = sf ? (\n  // Native\n  function(t) {\n    return t.trimEnd();\n  }\n) : (\n  // Ponyfill\n  function(t) {\n    return t.replace(ef, \"\");\n  }\n);\nfunction Wo(e, t) {\n  return new RegExp(e, t);\n}\nvar Pr;\nif (Hr) {\n  var Ni = Wo(\"([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)\", \"yu\");\n  Pr = function(t, n) {\n    var r;\n    Ni.lastIndex = n;\n    var i = Ni.exec(t);\n    return (r = i[1]) !== null && r !== void 0 ? r : \"\";\n  };\n} else\n  Pr = function(t, n) {\n    for (var r = []; ; ) {\n      var i = xo(t, n);\n      if (i === void 0 || Zo(i) || pf(i))\n        break;\n      r.push(i), n += i >= 65536 ? 2 : 1;\n    }\n    return Nr.apply(void 0, r);\n  };\nvar hf = (\n  /** @class */\n  function() {\n    function e(t, n) {\n      n === void 0 && (n = {}), this.message = t, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!n.ignoreTag, this.locale = n.locale, this.requiresOtherClause = !!n.requiresOtherClause, this.shouldParseSkeletons = !!n.shouldParseSkeletons;\n    }\n    return e.prototype.parse = function() {\n      if (this.offset() !== 0)\n        throw Error(\"parser can only be used once\");\n      return this.parseMessage(0, \"\", !1);\n    }, e.prototype.parseMessage = function(t, n, r) {\n      for (var i = []; !this.isEOF(); ) {\n        var o = this.char();\n        if (o === 123) {\n          var l = this.parseArgument(t, r);\n          if (l.err)\n            return l;\n          i.push(l.val);\n        } else {\n          if (o === 125 && t > 0)\n            break;\n          if (o === 35 && (n === \"plural\" || n === \"selectordinal\")) {\n            var a = this.clonePosition();\n            this.bump(), i.push({\n              type: z.pound,\n              location: O(a, this.clonePosition())\n            });\n          } else if (o === 60 && !this.ignoreTag && this.peek() === 47) {\n            if (r)\n              break;\n            return this.error(L.UNMATCHED_CLOSING_TAG, O(this.clonePosition(), this.clonePosition()));\n          } else if (o === 60 && !this.ignoreTag && Ir(this.peek() || 0)) {\n            var l = this.parseTag(t, n);\n            if (l.err)\n              return l;\n            i.push(l.val);\n          } else {\n            var l = this.parseLiteral(t, n);\n            if (l.err)\n              return l;\n            i.push(l.val);\n          }\n        }\n      }\n      return { val: i, err: null };\n    }, e.prototype.parseTag = function(t, n) {\n      var r = this.clonePosition();\n      this.bump();\n      var i = this.parseTagName();\n      if (this.bumpSpace(), this.bumpIf(\"/>\"))\n        return {\n          val: {\n            type: z.literal,\n            value: \"<\".concat(i, \"/>\"),\n            location: O(r, this.clonePosition())\n          },\n          err: null\n        };\n      if (this.bumpIf(\">\")) {\n        var o = this.parseMessage(t + 1, n, !0);\n        if (o.err)\n          return o;\n        var l = o.val, a = this.clonePosition();\n        if (this.bumpIf(\"</\")) {\n          if (this.isEOF() || !Ir(this.char()))\n            return this.error(L.INVALID_TAG, O(a, this.clonePosition()));\n          var s = this.clonePosition(), u = this.parseTagName();\n          return i !== u ? this.error(L.UNMATCHED_CLOSING_TAG, O(s, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(\">\") ? {\n            val: {\n              type: z.tag,\n              value: i,\n              children: l,\n              location: O(r, this.clonePosition())\n            },\n            err: null\n          } : this.error(L.INVALID_TAG, O(a, this.clonePosition())));\n        } else\n          return this.error(L.UNCLOSED_TAG, O(r, this.clonePosition()));\n      } else\n        return this.error(L.INVALID_TAG, O(r, this.clonePosition()));\n    }, e.prototype.parseTagName = function() {\n      var t = this.offset();\n      for (this.bump(); !this.isEOF() && mf(this.char()); )\n        this.bump();\n      return this.message.slice(t, this.offset());\n    }, e.prototype.parseLiteral = function(t, n) {\n      for (var r = this.clonePosition(), i = \"\"; ; ) {\n        var o = this.tryParseQuote(n);\n        if (o) {\n          i += o;\n          continue;\n        }\n        var l = this.tryParseUnquoted(t, n);\n        if (l) {\n          i += l;\n          continue;\n        }\n        var a = this.tryParseLeftAngleBracket();\n        if (a) {\n          i += a;\n          continue;\n        }\n        break;\n      }\n      var s = O(r, this.clonePosition());\n      return {\n        val: { type: z.literal, value: i, location: s },\n        err: null\n      };\n    }, e.prototype.tryParseLeftAngleBracket = function() {\n      return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.\n      !df(this.peek() || 0)) ? (this.bump(), \"<\") : null;\n    }, e.prototype.tryParseQuote = function(t) {\n      if (this.isEOF() || this.char() !== 39)\n        return null;\n      switch (this.peek()) {\n        case 39:\n          return this.bump(), this.bump(), \"'\";\n        case 123:\n        case 60:\n        case 62:\n        case 125:\n          break;\n        case 35:\n          if (t === \"plural\" || t === \"selectordinal\")\n            break;\n          return null;\n        default:\n          return null;\n      }\n      this.bump();\n      var n = [this.char()];\n      for (this.bump(); !this.isEOF(); ) {\n        var r = this.char();\n        if (r === 39)\n          if (this.peek() === 39)\n            n.push(39), this.bump();\n          else {\n            this.bump();\n            break;\n          }\n        else\n          n.push(r);\n        this.bump();\n      }\n      return Nr.apply(void 0, n);\n    }, e.prototype.tryParseUnquoted = function(t, n) {\n      if (this.isEOF())\n        return null;\n      var r = this.char();\n      return r === 60 || r === 123 || r === 35 && (n === \"plural\" || n === \"selectordinal\") || r === 125 && t > 0 ? null : (this.bump(), Nr(r));\n    }, e.prototype.parseArgument = function(t, n) {\n      var r = this.clonePosition();\n      if (this.bump(), this.bumpSpace(), this.isEOF())\n        return this.error(L.EXPECT_ARGUMENT_CLOSING_BRACE, O(r, this.clonePosition()));\n      if (this.char() === 125)\n        return this.bump(), this.error(L.EMPTY_ARGUMENT, O(r, this.clonePosition()));\n      var i = this.parseIdentifierIfPossible().value;\n      if (!i)\n        return this.error(L.MALFORMED_ARGUMENT, O(r, this.clonePosition()));\n      if (this.bumpSpace(), this.isEOF())\n        return this.error(L.EXPECT_ARGUMENT_CLOSING_BRACE, O(r, this.clonePosition()));\n      switch (this.char()) {\n        case 125:\n          return this.bump(), {\n            val: {\n              type: z.argument,\n              // value does not include the opening and closing braces.\n              value: i,\n              location: O(r, this.clonePosition())\n            },\n            err: null\n          };\n        case 44:\n          return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(L.EXPECT_ARGUMENT_CLOSING_BRACE, O(r, this.clonePosition())) : this.parseArgumentOptions(t, n, i, r);\n        default:\n          return this.error(L.MALFORMED_ARGUMENT, O(r, this.clonePosition()));\n      }\n    }, e.prototype.parseIdentifierIfPossible = function() {\n      var t = this.clonePosition(), n = this.offset(), r = Pr(this.message, n), i = n + r.length;\n      this.bumpTo(i);\n      var o = this.clonePosition(), l = O(t, o);\n      return { value: r, location: l };\n    }, e.prototype.parseArgumentOptions = function(t, n, r, i) {\n      var o, l = this.clonePosition(), a = this.parseIdentifierIfPossible().value, s = this.clonePosition();\n      switch (a) {\n        case \"\":\n          return this.error(L.EXPECT_ARGUMENT_TYPE, O(l, s));\n        case \"number\":\n        case \"date\":\n        case \"time\": {\n          this.bumpSpace();\n          var u = null;\n          if (this.bumpIf(\",\")) {\n            this.bumpSpace();\n            var f = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible();\n            if (c.err)\n              return c;\n            var _ = _f(c.val);\n            if (_.length === 0)\n              return this.error(L.EXPECT_ARGUMENT_STYLE, O(this.clonePosition(), this.clonePosition()));\n            var h = O(f, this.clonePosition());\n            u = { style: _, styleLocation: h };\n          }\n          var d = this.tryParseArgumentClose(i);\n          if (d.err)\n            return d;\n          var m = O(i, this.clonePosition());\n          if (u && Ci(u == null ? void 0 : u.style, \"::\", 0)) {\n            var v = cf(u.style.slice(2));\n            if (a === \"number\") {\n              var c = this.parseNumberSkeletonFromString(v, u.styleLocation);\n              return c.err ? c : {\n                val: { type: z.number, value: r, location: m, style: c.val },\n                err: null\n              };\n            } else {\n              if (v.length === 0)\n                return this.error(L.EXPECT_DATE_TIME_SKELETON, m);\n              var y = v;\n              this.locale && (y = Yu(v, this.locale));\n              var _ = {\n                type: Bt.dateTime,\n                pattern: y,\n                location: u.styleLocation,\n                parsedOptions: this.shouldParseSkeletons ? Vu(y) : {}\n              }, k = a === \"date\" ? z.date : z.time;\n              return {\n                val: { type: k, value: r, location: m, style: _ },\n                err: null\n              };\n            }\n          }\n          return {\n            val: {\n              type: a === \"number\" ? z.number : a === \"date\" ? z.date : z.time,\n              value: r,\n              location: m,\n              style: (o = u == null ? void 0 : u.style) !== null && o !== void 0 ? o : null\n            },\n            err: null\n          };\n        }\n        case \"plural\":\n        case \"selectordinal\":\n        case \"select\": {\n          var b = this.clonePosition();\n          if (this.bumpSpace(), !this.bumpIf(\",\"))\n            return this.error(L.EXPECT_SELECT_ARGUMENT_OPTIONS, O(b, U({}, b)));\n          this.bumpSpace();\n          var p = this.parseIdentifierIfPossible(), P = 0;\n          if (a !== \"select\" && p.value === \"offset\") {\n            if (!this.bumpIf(\":\"))\n              return this.error(L.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, O(this.clonePosition(), this.clonePosition()));\n            this.bumpSpace();\n            var c = this.tryParseDecimalInteger(L.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, L.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n            if (c.err)\n              return c;\n            this.bumpSpace(), p = this.parseIdentifierIfPossible(), P = c.val;\n          }\n          var S = this.tryParsePluralOrSelectOptions(t, a, n, p);\n          if (S.err)\n            return S;\n          var d = this.tryParseArgumentClose(i);\n          if (d.err)\n            return d;\n          var A = O(i, this.clonePosition());\n          return a === \"select\" ? {\n            val: {\n              type: z.select,\n              value: r,\n              options: Hi(S.val),\n              location: A\n            },\n            err: null\n          } : {\n            val: {\n              type: z.plural,\n              value: r,\n              options: Hi(S.val),\n              offset: P,\n              pluralType: a === \"plural\" ? \"cardinal\" : \"ordinal\",\n              location: A\n            },\n            err: null\n          };\n        }\n        default:\n          return this.error(L.INVALID_ARGUMENT_TYPE, O(l, s));\n      }\n    }, e.prototype.tryParseArgumentClose = function(t) {\n      return this.isEOF() || this.char() !== 125 ? this.error(L.EXPECT_ARGUMENT_CLOSING_BRACE, O(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });\n    }, e.prototype.parseSimpleArgStyleIfPossible = function() {\n      for (var t = 0, n = this.clonePosition(); !this.isEOF(); ) {\n        var r = this.char();\n        switch (r) {\n          case 39: {\n            this.bump();\n            var i = this.clonePosition();\n            if (!this.bumpUntil(\"'\"))\n              return this.error(L.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, O(i, this.clonePosition()));\n            this.bump();\n            break;\n          }\n          case 123: {\n            t += 1, this.bump();\n            break;\n          }\n          case 125: {\n            if (t > 0)\n              t -= 1;\n            else\n              return {\n                val: this.message.slice(n.offset, this.offset()),\n                err: null\n              };\n            break;\n          }\n          default:\n            this.bump();\n            break;\n        }\n      }\n      return {\n        val: this.message.slice(n.offset, this.offset()),\n        err: null\n      };\n    }, e.prototype.parseNumberSkeletonFromString = function(t, n) {\n      var r = [];\n      try {\n        r = xu(t);\n      } catch {\n        return this.error(L.INVALID_NUMBER_SKELETON, n);\n      }\n      return {\n        val: {\n          type: Bt.number,\n          tokens: r,\n          location: n,\n          parsedOptions: this.shouldParseSkeletons ? Qu(r) : {}\n        },\n        err: null\n      };\n    }, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r, i) {\n      for (var o, l = !1, a = [], s = /* @__PURE__ */ new Set(), u = i.value, f = i.location; ; ) {\n        if (u.length === 0) {\n          var c = this.clonePosition();\n          if (n !== \"select\" && this.bumpIf(\"=\")) {\n            var _ = this.tryParseDecimalInteger(L.EXPECT_PLURAL_ARGUMENT_SELECTOR, L.INVALID_PLURAL_ARGUMENT_SELECTOR);\n            if (_.err)\n              return _;\n            f = O(c, this.clonePosition()), u = this.message.slice(c.offset, this.offset());\n          } else\n            break;\n        }\n        if (s.has(u))\n          return this.error(n === \"select\" ? L.DUPLICATE_SELECT_ARGUMENT_SELECTOR : L.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f);\n        u === \"other\" && (l = !0), this.bumpSpace();\n        var h = this.clonePosition();\n        if (!this.bumpIf(\"{\"))\n          return this.error(n === \"select\" ? L.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : L.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, O(this.clonePosition(), this.clonePosition()));\n        var d = this.parseMessage(t + 1, n, r);\n        if (d.err)\n          return d;\n        var m = this.tryParseArgumentClose(h);\n        if (m.err)\n          return m;\n        a.push([\n          u,\n          {\n            value: d.val,\n            location: O(h, this.clonePosition())\n          }\n        ]), s.add(u), this.bumpSpace(), o = this.parseIdentifierIfPossible(), u = o.value, f = o.location;\n      }\n      return a.length === 0 ? this.error(n === \"select\" ? L.EXPECT_SELECT_ARGUMENT_SELECTOR : L.EXPECT_PLURAL_ARGUMENT_SELECTOR, O(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !l ? this.error(L.MISSING_OTHER_CLAUSE, O(this.clonePosition(), this.clonePosition())) : { val: a, err: null };\n    }, e.prototype.tryParseDecimalInteger = function(t, n) {\n      var r = 1, i = this.clonePosition();\n      this.bumpIf(\"+\") || this.bumpIf(\"-\") && (r = -1);\n      for (var o = !1, l = 0; !this.isEOF(); ) {\n        var a = this.char();\n        if (a >= 48 && a <= 57)\n          o = !0, l = l * 10 + (a - 48), this.bump();\n        else\n          break;\n      }\n      var s = O(i, this.clonePosition());\n      return o ? (l *= r, uf(l) ? { val: l, err: null } : this.error(n, s)) : this.error(t, s);\n    }, e.prototype.offset = function() {\n      return this.position.offset;\n    }, e.prototype.isEOF = function() {\n      return this.offset() === this.message.length;\n    }, e.prototype.clonePosition = function() {\n      return {\n        offset: this.position.offset,\n        line: this.position.line,\n        column: this.position.column\n      };\n    }, e.prototype.char = function() {\n      var t = this.position.offset;\n      if (t >= this.message.length)\n        throw Error(\"out of bound\");\n      var n = xo(this.message, t);\n      if (n === void 0)\n        throw Error(\"Offset \".concat(t, \" is at invalid UTF-16 code unit boundary\"));\n      return n;\n    }, e.prototype.error = function(t, n) {\n      return {\n        val: null,\n        err: {\n          kind: t,\n          message: this.message,\n          location: n\n        }\n      };\n    }, e.prototype.bump = function() {\n      if (!this.isEOF()) {\n        var t = this.char();\n        t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);\n      }\n    }, e.prototype.bumpIf = function(t) {\n      if (Ci(this.message, t, this.offset())) {\n        for (var n = 0; n < t.length; n++)\n          this.bump();\n        return !0;\n      }\n      return !1;\n    }, e.prototype.bumpUntil = function(t) {\n      var n = this.offset(), r = this.message.indexOf(t, n);\n      return r >= 0 ? (this.bumpTo(r), !0) : (this.bumpTo(this.message.length), !1);\n    }, e.prototype.bumpTo = function(t) {\n      if (this.offset() > t)\n        throw Error(\"targetOffset \".concat(t, \" must be greater than or equal to the current offset \").concat(this.offset()));\n      for (t = Math.min(t, this.message.length); ; ) {\n        var n = this.offset();\n        if (n === t)\n          break;\n        if (n > t)\n          throw Error(\"targetOffset \".concat(t, \" is at invalid UTF-16 code unit boundary\"));\n        if (this.bump(), this.isEOF())\n          break;\n      }\n    }, e.prototype.bumpSpace = function() {\n      for (; !this.isEOF() && Zo(this.char()); )\n        this.bump();\n    }, e.prototype.peek = function() {\n      if (this.isEOF())\n        return null;\n      var t = this.char(), n = this.offset(), r = this.message.charCodeAt(n + (t >= 65536 ? 2 : 1));\n      return r ?? null;\n    }, e;\n  }()\n);\nfunction Ir(e) {\n  return e >= 97 && e <= 122 || e >= 65 && e <= 90;\n}\nfunction df(e) {\n  return Ir(e) || e === 47;\n}\nfunction mf(e) {\n  return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;\n}\nfunction Zo(e) {\n  return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;\n}\nfunction pf(e) {\n  return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;\n}\nfunction Lr(e) {\n  e.forEach(function(t) {\n    if (delete t.location, Uo(t) || Fo(t))\n      for (var n in t.options)\n        delete t.options[n].location, Lr(t.options[n].value);\n    else\n      Mo(t) && qo(t.style) || (Do(t) || Ro(t)) && Cr(t.style) ? delete t.style.location : Go(t) && Lr(t.children);\n  });\n}\nfunction gf(e, t) {\n  t === void 0 && (t = {}), t = U({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);\n  var n = new hf(e, t).parse();\n  if (n.err) {\n    var r = SyntaxError(L[n.err.kind]);\n    throw r.location = n.err.location, r.originalMessage = n.err.message, r;\n  }\n  return t != null && t.captureLocation || Lr(n.val), n.val;\n}\nfunction sr(e, t) {\n  var n = t && t.cache ? t.cache : Sf, r = t && t.serializer ? t.serializer : Ef, i = t && t.strategy ? t.strategy : vf;\n  return i(e, {\n    cache: n,\n    serializer: r\n  });\n}\nfunction bf(e) {\n  return e == null || typeof e == \"number\" || typeof e == \"boolean\";\n}\nfunction Jo(e, t, n, r) {\n  var i = bf(r) ? r : n(r), o = t.get(i);\n  return typeof o > \"u\" && (o = e.call(this, r), t.set(i, o)), o;\n}\nfunction Qo(e, t, n) {\n  var r = Array.prototype.slice.call(arguments, 3), i = n(r), o = t.get(i);\n  return typeof o > \"u\" && (o = e.apply(this, r), t.set(i, o)), o;\n}\nfunction jr(e, t, n, r, i) {\n  return n.bind(t, e, r, i);\n}\nfunction vf(e, t) {\n  var n = e.length === 1 ? Jo : Qo;\n  return jr(e, this, n, t.cache.create(), t.serializer);\n}\nfunction wf(e, t) {\n  return jr(e, this, Qo, t.cache.create(), t.serializer);\n}\nfunction yf(e, t) {\n  return jr(e, this, Jo, t.cache.create(), t.serializer);\n}\nvar Ef = function() {\n  return JSON.stringify(arguments);\n};\nfunction zr() {\n  this.cache = /* @__PURE__ */ Object.create(null);\n}\nzr.prototype.get = function(e) {\n  return this.cache[e];\n};\nzr.prototype.set = function(e, t) {\n  this.cache[e] = t;\n};\nvar Sf = {\n  create: function() {\n    return new zr();\n  }\n}, ar = {\n  variadic: wf,\n  monadic: yf\n}, Ct;\n(function(e) {\n  e.MISSING_VALUE = \"MISSING_VALUE\", e.INVALID_VALUE = \"INVALID_VALUE\", e.MISSING_INTL_API = \"MISSING_INTL_API\";\n})(Ct || (Ct = {}));\nvar Nn = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r, i) {\n      var o = e.call(this, n) || this;\n      return o.code = r, o.originalMessage = i, o;\n    }\n    return t.prototype.toString = function() {\n      return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n    }, t;\n  }(Error)\n), Pi = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r, i, o) {\n      return e.call(this, 'Invalid values for \"'.concat(n, '\": \"').concat(r, '\". Options are \"').concat(Object.keys(i).join('\", \"'), '\"'), Ct.INVALID_VALUE, o) || this;\n    }\n    return t;\n  }(Nn)\n), kf = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r, i) {\n      return e.call(this, 'Value for \"'.concat(n, '\" must be of type ').concat(r), Ct.INVALID_VALUE, i) || this;\n    }\n    return t;\n  }(Nn)\n), Tf = (\n  /** @class */\n  function(e) {\n    Hn(t, e);\n    function t(n, r) {\n      return e.call(this, 'The intl string context variable \"'.concat(n, '\" was not provided to the string \"').concat(r, '\"'), Ct.MISSING_VALUE, r) || this;\n    }\n    return t;\n  }(Nn)\n), te;\n(function(e) {\n  e[e.literal = 0] = \"literal\", e[e.object = 1] = \"object\";\n})(te || (te = {}));\nfunction Af(e) {\n  return e.length < 2 ? e : e.reduce(function(t, n) {\n    var r = t[t.length - 1];\n    return !r || r.type !== te.literal || n.type !== te.literal ? t.push(n) : r.value += n.value, t;\n  }, []);\n}\nfunction Bf(e) {\n  return typeof e == \"function\";\n}\nfunction _n(e, t, n, r, i, o, l) {\n  if (e.length === 1 && ki(e[0]))\n    return [\n      {\n        type: te.literal,\n        value: e[0].value\n      }\n    ];\n  for (var a = [], s = 0, u = e; s < u.length; s++) {\n    var f = u[s];\n    if (ki(f)) {\n      a.push({\n        type: te.literal,\n        value: f.value\n      });\n      continue;\n    }\n    if (ju(f)) {\n      typeof o == \"number\" && a.push({\n        type: te.literal,\n        value: n.getNumberFormat(t).format(o)\n      });\n      continue;\n    }\n    var c = f.value;\n    if (!(i && c in i))\n      throw new Tf(c, l);\n    var _ = i[c];\n    if (qu(f)) {\n      (!_ || typeof _ == \"string\" || typeof _ == \"number\") && (_ = typeof _ == \"string\" || typeof _ == \"number\" ? String(_) : \"\"), a.push({\n        type: typeof _ == \"string\" ? te.literal : te.object,\n        value: _\n      });\n      continue;\n    }\n    if (Do(f)) {\n      var h = typeof f.style == \"string\" ? r.date[f.style] : Cr(f.style) ? f.style.parsedOptions : void 0;\n      a.push({\n        type: te.literal,\n        value: n.getDateTimeFormat(t, h).format(_)\n      });\n      continue;\n    }\n    if (Ro(f)) {\n      var h = typeof f.style == \"string\" ? r.time[f.style] : Cr(f.style) ? f.style.parsedOptions : r.time.medium;\n      a.push({\n        type: te.literal,\n        value: n.getDateTimeFormat(t, h).format(_)\n      });\n      continue;\n    }\n    if (Mo(f)) {\n      var h = typeof f.style == \"string\" ? r.number[f.style] : qo(f.style) ? f.style.parsedOptions : void 0;\n      h && h.scale && (_ = _ * (h.scale || 1)), a.push({\n        type: te.literal,\n        value: n.getNumberFormat(t, h).format(_)\n      });\n      continue;\n    }\n    if (Go(f)) {\n      var d = f.children, m = f.value, v = i[m];\n      if (!Bf(v))\n        throw new kf(m, \"function\", l);\n      var y = _n(d, t, n, r, i, o), k = v(y.map(function(P) {\n        return P.value;\n      }));\n      Array.isArray(k) || (k = [k]), a.push.apply(a, k.map(function(P) {\n        return {\n          type: typeof P == \"string\" ? te.literal : te.object,\n          value: P\n        };\n      }));\n    }\n    if (Uo(f)) {\n      var b = f.options[_] || f.options.other;\n      if (!b)\n        throw new Pi(f.value, _, Object.keys(f.options), l);\n      a.push.apply(a, _n(b.value, t, n, r, i));\n      continue;\n    }\n    if (Fo(f)) {\n      var b = f.options[\"=\".concat(_)];\n      if (!b) {\n        if (!Intl.PluralRules)\n          throw new Nn(`Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n`, Ct.MISSING_INTL_API, l);\n        var p = n.getPluralRules(t, { type: f.pluralType }).select(_ - (f.offset || 0));\n        b = f.options[p] || f.options.other;\n      }\n      if (!b)\n        throw new Pi(f.value, _, Object.keys(f.options), l);\n      a.push.apply(a, _n(b.value, t, n, r, i, _ - (f.offset || 0)));\n      continue;\n    }\n  }\n  return Af(a);\n}\nfunction Cf(e, t) {\n  return t ? U(U(U({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) {\n    return n[r] = U(U({}, e[r]), t[r] || {}), n;\n  }, {})) : e;\n}\nfunction Hf(e, t) {\n  return t ? Object.keys(e).reduce(function(n, r) {\n    return n[r] = Cf(e[r], t[r]), n;\n  }, U({}, e)) : e;\n}\nfunction ur(e) {\n  return {\n    create: function() {\n      return {\n        get: function(t) {\n          return e[t];\n        },\n        set: function(t, n) {\n          e[t] = n;\n        }\n      };\n    }\n  };\n}\nfunction Nf(e) {\n  return e === void 0 && (e = {\n    number: {},\n    dateTime: {},\n    pluralRules: {}\n  }), {\n    getNumberFormat: sr(function() {\n      for (var t, n = [], r = 0; r < arguments.length; r++)\n        n[r] = arguments[r];\n      return new ((t = Intl.NumberFormat).bind.apply(t, or([void 0], n, !1)))();\n    }, {\n      cache: ur(e.number),\n      strategy: ar.variadic\n    }),\n    getDateTimeFormat: sr(function() {\n      for (var t, n = [], r = 0; r < arguments.length; r++)\n        n[r] = arguments[r];\n      return new ((t = Intl.DateTimeFormat).bind.apply(t, or([void 0], n, !1)))();\n    }, {\n      cache: ur(e.dateTime),\n      strategy: ar.variadic\n    }),\n    getPluralRules: sr(function() {\n      for (var t, n = [], r = 0; r < arguments.length; r++)\n        n[r] = arguments[r];\n      return new ((t = Intl.PluralRules).bind.apply(t, or([void 0], n, !1)))();\n    }, {\n      cache: ur(e.pluralRules),\n      strategy: ar.variadic\n    })\n  };\n}\nvar Pf = (\n  /** @class */\n  function() {\n    function e(t, n, r, i) {\n      var o = this;\n      if (n === void 0 && (n = e.defaultLocale), this.formatterCache = {\n        number: {},\n        dateTime: {},\n        pluralRules: {}\n      }, this.format = function(l) {\n        var a = o.formatToParts(l);\n        if (a.length === 1)\n          return a[0].value;\n        var s = a.reduce(function(u, f) {\n          return !u.length || f.type !== te.literal || typeof u[u.length - 1] != \"string\" ? u.push(f.value) : u[u.length - 1] += f.value, u;\n        }, []);\n        return s.length <= 1 ? s[0] || \"\" : s;\n      }, this.formatToParts = function(l) {\n        return _n(o.ast, o.locales, o.formatters, o.formats, l, void 0, o.message);\n      }, this.resolvedOptions = function() {\n        return {\n          locale: o.resolvedLocale.toString()\n        };\n      }, this.getAst = function() {\n        return o.ast;\n      }, this.locales = n, this.resolvedLocale = e.resolveLocale(n), typeof t == \"string\") {\n        if (this.message = t, !e.__parse)\n          throw new TypeError(\"IntlMessageFormat.__parse must be set to process `message` of type `string`\");\n        this.ast = e.__parse(t, {\n          ignoreTag: i == null ? void 0 : i.ignoreTag,\n          locale: this.resolvedLocale\n        });\n      } else\n        this.ast = t;\n      if (!Array.isArray(this.ast))\n        throw new TypeError(\"A message must be provided as a String or AST.\");\n      this.formats = Hf(e.formats, r), this.formatters = i && i.formatters || Nf(this.formatterCache);\n    }\n    return Object.defineProperty(e, \"defaultLocale\", {\n      get: function() {\n        return e.memoizedDefaultLocale || (e.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), e.memoizedDefaultLocale;\n      },\n      enumerable: !1,\n      configurable: !0\n    }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) {\n      var n = Intl.NumberFormat.supportedLocalesOf(t);\n      return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == \"string\" ? t : t[0]);\n    }, e.__parse = gf, e.formats = {\n      number: {\n        integer: {\n          maximumFractionDigits: 0\n        },\n        currency: {\n          style: \"currency\"\n        },\n        percent: {\n          style: \"percent\"\n        }\n      },\n      date: {\n        short: {\n          month: \"numeric\",\n          day: \"numeric\",\n          year: \"2-digit\"\n        },\n        medium: {\n          month: \"short\",\n          day: \"numeric\",\n          year: \"numeric\"\n        },\n        long: {\n          month: \"long\",\n          day: \"numeric\",\n          year: \"numeric\"\n        },\n        full: {\n          weekday: \"long\",\n          month: \"long\",\n          day: \"numeric\",\n          year: \"numeric\"\n        }\n      },\n      time: {\n        short: {\n          hour: \"numeric\",\n          minute: \"numeric\"\n        },\n        medium: {\n          hour: \"numeric\",\n          minute: \"numeric\",\n          second: \"numeric\"\n        },\n        long: {\n          hour: \"numeric\",\n          minute: \"numeric\",\n          second: \"numeric\",\n          timeZoneName: \"short\"\n        },\n        full: {\n          hour: \"numeric\",\n          minute: \"numeric\",\n          second: \"numeric\",\n          timeZoneName: \"short\"\n        }\n      }\n    }, e;\n  }()\n);\nfunction If(e, t) {\n  if (t == null)\n    return;\n  if (t in e)\n    return e[t];\n  const n = t.split(\".\");\n  let r = e;\n  for (let i = 0; i < n.length; i++)\n    if (typeof r == \"object\") {\n      if (i > 0) {\n        const o = n.slice(i, n.length).join(\".\");\n        if (o in r) {\n          r = r[o];\n          break;\n        }\n      }\n      r = r[n[i]];\n    } else\n      r = void 0;\n  return r;\n}\nconst Ve = {}, Lf = (e, t, n) => n && (t in Ve || (Ve[t] = {}), e in Ve[t] || (Ve[t][e] = n), n), Yo = (e, t) => {\n  if (t == null)\n    return;\n  if (t in Ve && e in Ve[t])\n    return Ve[t][e];\n  const n = Pn(t);\n  for (let r = 0; r < n.length; r++) {\n    const i = n[r], o = Mf(i, e);\n    if (o)\n      return Lf(e, t, o);\n  }\n};\nlet Vr;\nconst Jt = Zt({});\nfunction Of(e) {\n  return Vr[e] || null;\n}\nfunction Ko(e) {\n  return e in Vr;\n}\nfunction Mf(e, t) {\n  if (!Ko(e))\n    return null;\n  const n = Of(e);\n  return If(n, t);\n}\nfunction Df(e) {\n  if (e == null)\n    return;\n  const t = Pn(e);\n  for (let n = 0; n < t.length; n++) {\n    const r = t[n];\n    if (Ko(r))\n      return r;\n  }\n}\nfunction Rf(e, ...t) {\n  delete Ve[e], Jt.update((n) => (n[e] = Gu.all([n[e] || {}, ...t]), n));\n}\nIt(\n  [Jt],\n  ([e]) => Object.keys(e)\n);\nJt.subscribe((e) => Vr = e);\nconst hn = {};\nfunction Uf(e, t) {\n  hn[e].delete(t), hn[e].size === 0 && delete hn[e];\n}\nfunction $o(e) {\n  return hn[e];\n}\nfunction Ff(e) {\n  return Pn(e).map((t) => {\n    const n = $o(t);\n    return [t, n ? [...n] : []];\n  }).filter(([, t]) => t.length > 0);\n}\nfunction Or(e) {\n  return e == null ? !1 : Pn(e).some(\n    (t) => {\n      var n;\n      return (n = $o(t)) == null ? void 0 : n.size;\n    }\n  );\n}\nfunction Gf(e, t) {\n  return Promise.all(\n    t.map((r) => (Uf(e, r), r().then((i) => i.default || i)))\n  ).then((r) => Rf(e, ...r));\n}\nconst Dt = {};\nfunction el(e) {\n  if (!Or(e))\n    return e in Dt ? Dt[e] : Promise.resolve();\n  const t = Ff(e);\n  return Dt[e] = Promise.all(\n    t.map(\n      ([n, r]) => Gf(n, r)\n    )\n  ).then(() => {\n    if (Or(e))\n      return el(e);\n    delete Dt[e];\n  }), Dt[e];\n}\nconst qf = {\n  number: {\n    scientific: { notation: \"scientific\" },\n    engineering: { notation: \"engineering\" },\n    compactLong: { notation: \"compact\", compactDisplay: \"long\" },\n    compactShort: { notation: \"compact\", compactDisplay: \"short\" }\n  },\n  date: {\n    short: { month: \"numeric\", day: \"numeric\", year: \"2-digit\" },\n    medium: { month: \"short\", day: \"numeric\", year: \"numeric\" },\n    long: { month: \"long\", day: \"numeric\", year: \"numeric\" },\n    full: { weekday: \"long\", month: \"long\", day: \"numeric\", year: \"numeric\" }\n  },\n  time: {\n    short: { hour: \"numeric\", minute: \"numeric\" },\n    medium: { hour: \"numeric\", minute: \"numeric\", second: \"numeric\" },\n    long: {\n      hour: \"numeric\",\n      minute: \"numeric\",\n      second: \"numeric\",\n      timeZoneName: \"short\"\n    },\n    full: {\n      hour: \"numeric\",\n      minute: \"numeric\",\n      second: \"numeric\",\n      timeZoneName: \"short\"\n    }\n  }\n}, jf = {\n  fallbackLocale: null,\n  loadingDelay: 200,\n  formats: qf,\n  warnOnMissingMessages: !0,\n  handleMissingMessage: void 0,\n  ignoreTag: !0\n}, zf = jf;\nfunction Ht() {\n  return zf;\n}\nconst fr = Zt(!1);\nvar Vf = Object.defineProperty, Xf = Object.defineProperties, xf = Object.getOwnPropertyDescriptors, Ii = Object.getOwnPropertySymbols, Wf = Object.prototype.hasOwnProperty, Zf = Object.prototype.propertyIsEnumerable, Li = (e, t, n) => t in e ? Vf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Jf = (e, t) => {\n  for (var n in t || (t = {}))\n    Wf.call(t, n) && Li(e, n, t[n]);\n  if (Ii)\n    for (var n of Ii(t))\n      Zf.call(t, n) && Li(e, n, t[n]);\n  return e;\n}, Qf = (e, t) => Xf(e, xf(t));\nlet Mr;\nconst vn = Zt(null);\nfunction Oi(e) {\n  return e.split(\"-\").map((t, n, r) => r.slice(0, n + 1).join(\"-\")).reverse();\n}\nfunction Pn(e, t = Ht().fallbackLocale) {\n  const n = Oi(e);\n  return t ? [.../* @__PURE__ */ new Set([...n, ...Oi(t)])] : n;\n}\nfunction mt() {\n  return Mr ?? void 0;\n}\nvn.subscribe((e) => {\n  Mr = e ?? void 0, typeof window < \"u\" && e != null && document.documentElement.setAttribute(\"lang\", e);\n});\nconst Yf = (e) => {\n  if (e && Df(e) && Or(e)) {\n    const { loadingDelay: t } = Ht();\n    let n;\n    return typeof window < \"u\" && mt() != null && t ? n = window.setTimeout(\n      () => fr.set(!0),\n      t\n    ) : fr.set(!0), el(e).then(() => {\n      vn.set(e);\n    }).finally(() => {\n      clearTimeout(n), fr.set(!1);\n    });\n  }\n  return vn.set(e);\n}, Qt = Qf(Jf({}, vn), {\n  set: Yf\n}), In = (e) => {\n  const t = /* @__PURE__ */ Object.create(null);\n  return (r) => {\n    const i = JSON.stringify(r);\n    return i in t ? t[i] : t[i] = e(r);\n  };\n};\nvar Kf = Object.defineProperty, wn = Object.getOwnPropertySymbols, tl = Object.prototype.hasOwnProperty, nl = Object.prototype.propertyIsEnumerable, Mi = (e, t, n) => t in e ? Kf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Xr = (e, t) => {\n  for (var n in t || (t = {}))\n    tl.call(t, n) && Mi(e, n, t[n]);\n  if (wn)\n    for (var n of wn(t))\n      nl.call(t, n) && Mi(e, n, t[n]);\n  return e;\n}, Lt = (e, t) => {\n  var n = {};\n  for (var r in e)\n    tl.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);\n  if (e != null && wn)\n    for (var r of wn(e))\n      t.indexOf(r) < 0 && nl.call(e, r) && (n[r] = e[r]);\n  return n;\n};\nconst zt = (e, t) => {\n  const { formats: n } = Ht();\n  if (e in n && t in n[e])\n    return n[e][t];\n  throw new Error(`[svelte-i18n] Unknown \"${t}\" ${e} format.`);\n}, $f = In(\n  (e) => {\n    var t = e, { locale: n, format: r } = t, i = Lt(t, [\"locale\", \"format\"]);\n    if (n == null)\n      throw new Error('[svelte-i18n] A \"locale\" must be set to format numbers');\n    return r && (i = zt(\"number\", r)), new Intl.NumberFormat(n, i);\n  }\n), ec = In(\n  (e) => {\n    var t = e, { locale: n, format: r } = t, i = Lt(t, [\"locale\", \"format\"]);\n    if (n == null)\n      throw new Error('[svelte-i18n] A \"locale\" must be set to format dates');\n    return r ? i = zt(\"date\", r) : Object.keys(i).length === 0 && (i = zt(\"date\", \"short\")), new Intl.DateTimeFormat(n, i);\n  }\n), tc = In(\n  (e) => {\n    var t = e, { locale: n, format: r } = t, i = Lt(t, [\"locale\", \"format\"]);\n    if (n == null)\n      throw new Error(\n        '[svelte-i18n] A \"locale\" must be set to format time values'\n      );\n    return r ? i = zt(\"time\", r) : Object.keys(i).length === 0 && (i = zt(\"time\", \"short\")), new Intl.DateTimeFormat(n, i);\n  }\n), nc = (e = {}) => {\n  var t = e, {\n    locale: n = mt()\n  } = t, r = Lt(t, [\n    \"locale\"\n  ]);\n  return $f(Xr({ locale: n }, r));\n}, rc = (e = {}) => {\n  var t = e, {\n    locale: n = mt()\n  } = t, r = Lt(t, [\n    \"locale\"\n  ]);\n  return ec(Xr({ locale: n }, r));\n}, ic = (e = {}) => {\n  var t = e, {\n    locale: n = mt()\n  } = t, r = Lt(t, [\n    \"locale\"\n  ]);\n  return tc(Xr({ locale: n }, r));\n}, oc = In(\n  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n  (e, t = mt()) => new Pf(e, t, Ht().formats, {\n    ignoreTag: Ht().ignoreTag\n  })\n), lc = (e, t = {}) => {\n  var n, r, i, o;\n  let l = t;\n  typeof e == \"object\" && (l = e, e = l.id);\n  const {\n    values: a,\n    locale: s = mt(),\n    default: u\n  } = l;\n  if (s == null)\n    throw new Error(\n      \"[svelte-i18n] Cannot format a message without first setting the initial locale.\"\n    );\n  let f = Yo(e, s);\n  if (!f)\n    f = (o = (i = (r = (n = Ht()).handleMissingMessage) == null ? void 0 : r.call(n, { locale: s, id: e, defaultValue: u })) != null ? i : u) != null ? o : e;\n  else if (typeof f != \"string\")\n    return console.warn(\n      `[svelte-i18n] Message with id \"${e}\" must be of type \"string\", found: \"${typeof f}\". Gettin its value through the \"$format\" method is deprecated; use the \"json\" method instead.`\n    ), f;\n  if (!a)\n    return f;\n  let c = f;\n  try {\n    c = oc(f, s).format(a);\n  } catch (_) {\n    _ instanceof Error && console.warn(\n      `[svelte-i18n] Message \"${e}\" has syntax error:`,\n      _.message\n    );\n  }\n  return c;\n}, sc = (e, t) => ic(t).format(e), ac = (e, t) => rc(t).format(e), uc = (e, t) => nc(t).format(e), fc = (e, t = mt()) => Yo(e, t);\nIt([Qt, Jt], () => lc);\nIt([Qt], () => sc);\nIt([Qt], () => ac);\nIt([Qt], () => uc);\nIt([Qt, Jt], () => fc);\nconst {\n  SvelteComponent: cc,\n  append: ie,\n  attr: tt,\n  detach: rl,\n  element: nt,\n  init: _c,\n  insert: il,\n  noop: Di,\n  safe_not_equal: hc,\n  set_data: yn,\n  set_style: cr,\n  space: Dr,\n  text: Et,\n  toggle_class: Ri\n} = window.__gradio__svelte__internal, { onMount: dc, createEventDispatcher: mc, getContext: pc } = window.__gradio__svelte__internal;\nfunction Ui(e) {\n  let t, n, r, i, o = Ut(\n    /*file_to_display*/\n    e[2]\n  ) + \"\", l, a, s, u, f = (\n    /*file_to_display*/\n    e[2].orig_name + \"\"\n  ), c;\n  return {\n    c() {\n      t = nt(\"div\"), n = nt(\"span\"), r = nt(\"div\"), i = nt(\"progress\"), l = Et(o), s = Dr(), u = nt(\"span\"), c = Et(f), cr(i, \"visibility\", \"hidden\"), cr(i, \"height\", \"0\"), cr(i, \"width\", \"0\"), i.value = a = Ut(\n        /*file_to_display*/\n        e[2]\n      ), tt(i, \"max\", \"100\"), tt(i, \"class\", \"svelte-cr2edf\"), tt(r, \"class\", \"progress-bar svelte-cr2edf\"), tt(u, \"class\", \"file-name svelte-cr2edf\"), tt(t, \"class\", \"file svelte-cr2edf\");\n    },\n    m(_, h) {\n      il(_, t, h), ie(t, n), ie(n, r), ie(r, i), ie(i, l), ie(t, s), ie(t, u), ie(u, c);\n    },\n    p(_, h) {\n      h & /*file_to_display*/\n      4 && o !== (o = Ut(\n        /*file_to_display*/\n        _[2]\n      ) + \"\") && yn(l, o), h & /*file_to_display*/\n      4 && a !== (a = Ut(\n        /*file_to_display*/\n        _[2]\n      )) && (i.value = a), h & /*file_to_display*/\n      4 && f !== (f = /*file_to_display*/\n      _[2].orig_name + \"\") && yn(c, f);\n    },\n    d(_) {\n      _ && rl(t);\n    }\n  };\n}\nfunction gc(e) {\n  let t, n, r, i = (\n    /*files_with_progress*/\n    e[0].length + \"\"\n  ), o, l, a = (\n    /*files_with_progress*/\n    e[0].length > 1 ? \"files\" : \"file\"\n  ), s, u, f, c = (\n    /*file_to_display*/\n    e[2] && Ui(e)\n  );\n  return {\n    c() {\n      t = nt(\"div\"), n = nt(\"span\"), r = Et(\"Uploading \"), o = Et(i), l = Dr(), s = Et(a), u = Et(\"...\"), f = Dr(), c && c.c(), tt(n, \"class\", \"uploading svelte-cr2edf\"), tt(t, \"class\", \"wrap svelte-cr2edf\"), Ri(\n        t,\n        \"progress\",\n        /*progress*/\n        e[1]\n      );\n    },\n    m(_, h) {\n      il(_, t, h), ie(t, n), ie(n, r), ie(n, o), ie(n, l), ie(n, s), ie(n, u), ie(t, f), c && c.m(t, null);\n    },\n    p(_, [h]) {\n      h & /*files_with_progress*/\n      1 && i !== (i = /*files_with_progress*/\n      _[0].length + \"\") && yn(o, i), h & /*files_with_progress*/\n      1 && a !== (a = /*files_with_progress*/\n      _[0].length > 1 ? \"files\" : \"file\") && yn(s, a), /*file_to_display*/\n      _[2] ? c ? c.p(_, h) : (c = Ui(_), c.c(), c.m(t, null)) : c && (c.d(1), c = null), h & /*progress*/\n      2 && Ri(\n        t,\n        \"progress\",\n        /*progress*/\n        _[1]\n      );\n    },\n    i: Di,\n    o: Di,\n    d(_) {\n      _ && rl(t), c && c.d();\n    }\n  };\n}\nfunction Ut(e) {\n  return e.progress * 100 / (e.size || 0) || 0;\n}\nfunction bc(e) {\n  let t = 0;\n  return e.forEach((n) => {\n    t += Ut(n);\n  }), document.documentElement.style.setProperty(\"--upload-progress-width\", (t / e.length).toFixed(2) + \"%\"), t / e.length;\n}\nfunction vc(e, t, n) {\n  let { upload_id: r } = t, { root: i } = t, { files: o } = t, l, a = !1, s, u, f = o.map((d) => ({ ...d, progress: 0 }));\n  const c = mc();\n  function _(d, m) {\n    n(0, f = f.map((v) => (v.orig_name === d && (v.progress += m), v)));\n  }\n  const h = pc(\"EventSource_factory\");\n  return dc(() => {\n    l = h(new URL(`${i}/upload_progress?upload_id=${r}`)), l.onmessage = async function(d) {\n      const m = JSON.parse(d.data);\n      a || n(1, a = !0), m.msg === \"done\" ? (l.close(), c(\"done\")) : (n(6, s = m), _(m.orig_name, m.chunk_size));\n    };\n  }), e.$$set = (d) => {\n    \"upload_id\" in d && n(3, r = d.upload_id), \"root\" in d && n(4, i = d.root), \"files\" in d && n(5, o = d.files);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*files_with_progress*/\n    1 && bc(f), e.$$.dirty & /*current_file_upload, files_with_progress*/\n    65 && n(2, u = s || f[0]);\n  }, [\n    f,\n    a,\n    u,\n    r,\n    i,\n    o,\n    s\n  ];\n}\nclass wc extends cc {\n  constructor(t) {\n    super(), _c(this, t, vc, gc, hc, { upload_id: 3, root: 4, files: 5 });\n  }\n}\nconst {\n  SvelteComponent: yc,\n  append: Fi,\n  attr: $,\n  binding_callbacks: Ec,\n  bubble: Ke,\n  check_outros: ol,\n  create_component: Sc,\n  create_slot: ll,\n  destroy_component: kc,\n  detach: Ln,\n  element: Rr,\n  empty: sl,\n  get_all_dirty_from_scope: al,\n  get_slot_changes: ul,\n  group_outros: fl,\n  init: Tc,\n  insert: On,\n  listen: fe,\n  mount_component: Ac,\n  prevent_default: $e,\n  run_all: Bc,\n  safe_not_equal: Cc,\n  set_style: cl,\n  space: Hc,\n  stop_propagation: et,\n  toggle_class: ee,\n  transition_in: xe,\n  transition_out: ut,\n  update_slot_base: _l\n} = window.__gradio__svelte__internal, { createEventDispatcher: Nc, tick: Pc, getContext: Ic } = window.__gradio__svelte__internal;\nfunction Lc(e) {\n  let t, n, r, i, o, l, a, s, u, f;\n  const c = (\n    /*#slots*/\n    e[22].default\n  ), _ = ll(\n    c,\n    e,\n    /*$$scope*/\n    e[21],\n    null\n  );\n  return {\n    c() {\n      t = Rr(\"button\"), _ && _.c(), n = Hc(), r = Rr(\"input\"), $(r, \"aria-label\", \"file upload\"), $(r, \"data-testid\", \"file-upload\"), $(r, \"type\", \"file\"), $(\n        r,\n        \"accept\",\n        /*accept_file_types*/\n        e[12]\n      ), r.multiple = i = /*file_count*/\n      e[5] === \"multiple\" || void 0, $(r, \"webkitdirectory\", o = /*file_count*/\n      e[5] === \"directory\" || void 0), $(r, \"mozdirectory\", l = /*file_count*/\n      e[5] === \"directory\" || void 0), $(r, \"class\", \"svelte-1aq8tno\"), $(t, \"tabindex\", a = /*hidden*/\n      e[7] ? -1 : 0), $(t, \"class\", \"svelte-1aq8tno\"), ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        e[7]\n      ), ee(\n        t,\n        \"center\",\n        /*center*/\n        e[3]\n      ), ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        e[2]\n      ), ee(\n        t,\n        \"flex\",\n        /*flex*/\n        e[4]\n      ), cl(t, \"height\", \"100%\");\n    },\n    m(h, d) {\n      On(h, t, d), _ && _.m(t, null), Fi(t, n), Fi(t, r), e[30](r), s = !0, u || (f = [\n        fe(\n          r,\n          \"change\",\n          /*load_files_from_upload*/\n          e[15]\n        ),\n        fe(t, \"drag\", et($e(\n          /*drag_handler*/\n          e[23]\n        ))),\n        fe(t, \"dragstart\", et($e(\n          /*dragstart_handler*/\n          e[24]\n        ))),\n        fe(t, \"dragend\", et($e(\n          /*dragend_handler*/\n          e[25]\n        ))),\n        fe(t, \"dragover\", et($e(\n          /*dragover_handler*/\n          e[26]\n        ))),\n        fe(t, \"dragenter\", et($e(\n          /*dragenter_handler*/\n          e[27]\n        ))),\n        fe(t, \"dragleave\", et($e(\n          /*dragleave_handler*/\n          e[28]\n        ))),\n        fe(t, \"drop\", et($e(\n          /*drop_handler*/\n          e[29]\n        ))),\n        fe(\n          t,\n          \"click\",\n          /*open_file_upload*/\n          e[9]\n        ),\n        fe(\n          t,\n          \"drop\",\n          /*loadFilesFromDrop*/\n          e[16]\n        ),\n        fe(\n          t,\n          \"dragenter\",\n          /*updateDragging*/\n          e[14]\n        ),\n        fe(\n          t,\n          \"dragleave\",\n          /*updateDragging*/\n          e[14]\n        )\n      ], u = !0);\n    },\n    p(h, d) {\n      _ && _.p && (!s || d[0] & /*$$scope*/\n      2097152) && _l(\n        _,\n        c,\n        h,\n        /*$$scope*/\n        h[21],\n        s ? ul(\n          c,\n          /*$$scope*/\n          h[21],\n          d,\n          null\n        ) : al(\n          /*$$scope*/\n          h[21]\n        ),\n        null\n      ), (!s || d[0] & /*accept_file_types*/\n      4096) && $(\n        r,\n        \"accept\",\n        /*accept_file_types*/\n        h[12]\n      ), (!s || d[0] & /*file_count*/\n      32 && i !== (i = /*file_count*/\n      h[5] === \"multiple\" || void 0)) && (r.multiple = i), (!s || d[0] & /*file_count*/\n      32 && o !== (o = /*file_count*/\n      h[5] === \"directory\" || void 0)) && $(r, \"webkitdirectory\", o), (!s || d[0] & /*file_count*/\n      32 && l !== (l = /*file_count*/\n      h[5] === \"directory\" || void 0)) && $(r, \"mozdirectory\", l), (!s || d[0] & /*hidden*/\n      128 && a !== (a = /*hidden*/\n      h[7] ? -1 : 0)) && $(t, \"tabindex\", a), (!s || d[0] & /*hidden*/\n      128) && ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        h[7]\n      ), (!s || d[0] & /*center*/\n      8) && ee(\n        t,\n        \"center\",\n        /*center*/\n        h[3]\n      ), (!s || d[0] & /*boundedheight*/\n      4) && ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        h[2]\n      ), (!s || d[0] & /*flex*/\n      16) && ee(\n        t,\n        \"flex\",\n        /*flex*/\n        h[4]\n      );\n    },\n    i(h) {\n      s || (xe(_, h), s = !0);\n    },\n    o(h) {\n      ut(_, h), s = !1;\n    },\n    d(h) {\n      h && Ln(t), _ && _.d(h), e[30](null), u = !1, Bc(f);\n    }\n  };\n}\nfunction Oc(e) {\n  let t, n, r = !/*hidden*/\n  e[7] && Gi(e);\n  return {\n    c() {\n      r && r.c(), t = sl();\n    },\n    m(i, o) {\n      r && r.m(i, o), On(i, t, o), n = !0;\n    },\n    p(i, o) {\n      /*hidden*/\n      i[7] ? r && (fl(), ut(r, 1, 1, () => {\n        r = null;\n      }), ol()) : r ? (r.p(i, o), o[0] & /*hidden*/\n      128 && xe(r, 1)) : (r = Gi(i), r.c(), xe(r, 1), r.m(t.parentNode, t));\n    },\n    i(i) {\n      n || (xe(r), n = !0);\n    },\n    o(i) {\n      ut(r), n = !1;\n    },\n    d(i) {\n      i && Ln(t), r && r.d(i);\n    }\n  };\n}\nfunction Mc(e) {\n  let t, n, r, i, o;\n  const l = (\n    /*#slots*/\n    e[22].default\n  ), a = ll(\n    l,\n    e,\n    /*$$scope*/\n    e[21],\n    null\n  );\n  return {\n    c() {\n      t = Rr(\"button\"), a && a.c(), $(t, \"tabindex\", n = /*hidden*/\n      e[7] ? -1 : 0), $(t, \"class\", \"svelte-1aq8tno\"), ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        e[7]\n      ), ee(\n        t,\n        \"center\",\n        /*center*/\n        e[3]\n      ), ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        e[2]\n      ), ee(\n        t,\n        \"flex\",\n        /*flex*/\n        e[4]\n      ), cl(t, \"height\", \"100%\");\n    },\n    m(s, u) {\n      On(s, t, u), a && a.m(t, null), r = !0, i || (o = fe(\n        t,\n        \"click\",\n        /*paste_clipboard*/\n        e[8]\n      ), i = !0);\n    },\n    p(s, u) {\n      a && a.p && (!r || u[0] & /*$$scope*/\n      2097152) && _l(\n        a,\n        l,\n        s,\n        /*$$scope*/\n        s[21],\n        r ? ul(\n          l,\n          /*$$scope*/\n          s[21],\n          u,\n          null\n        ) : al(\n          /*$$scope*/\n          s[21]\n        ),\n        null\n      ), (!r || u[0] & /*hidden*/\n      128 && n !== (n = /*hidden*/\n      s[7] ? -1 : 0)) && $(t, \"tabindex\", n), (!r || u[0] & /*hidden*/\n      128) && ee(\n        t,\n        \"hidden\",\n        /*hidden*/\n        s[7]\n      ), (!r || u[0] & /*center*/\n      8) && ee(\n        t,\n        \"center\",\n        /*center*/\n        s[3]\n      ), (!r || u[0] & /*boundedheight*/\n      4) && ee(\n        t,\n        \"boundedheight\",\n        /*boundedheight*/\n        s[2]\n      ), (!r || u[0] & /*flex*/\n      16) && ee(\n        t,\n        \"flex\",\n        /*flex*/\n        s[4]\n      );\n    },\n    i(s) {\n      r || (xe(a, s), r = !0);\n    },\n    o(s) {\n      ut(a, s), r = !1;\n    },\n    d(s) {\n      s && Ln(t), a && a.d(s), i = !1, o();\n    }\n  };\n}\nfunction Gi(e) {\n  let t, n;\n  return t = new wc({\n    props: {\n      root: (\n        /*root*/\n        e[6]\n      ),\n      upload_id: (\n        /*upload_id*/\n        e[10]\n      ),\n      files: (\n        /*file_data*/\n        e[11]\n      )\n    }\n  }), {\n    c() {\n      Sc(t.$$.fragment);\n    },\n    m(r, i) {\n      Ac(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i[0] & /*root*/\n      64 && (o.root = /*root*/\n      r[6]), i[0] & /*upload_id*/\n      1024 && (o.upload_id = /*upload_id*/\n      r[10]), i[0] & /*file_data*/\n      2048 && (o.files = /*file_data*/\n      r[11]), t.$set(o);\n    },\n    i(r) {\n      n || (xe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      ut(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      kc(t, r);\n    }\n  };\n}\nfunction Dc(e) {\n  let t, n, r, i;\n  const o = [Mc, Oc, Lc], l = [];\n  function a(s, u) {\n    return (\n      /*filetype*/\n      s[0] === \"clipboard\" ? 0 : (\n        /*uploading*/\n        s[1] ? 1 : 2\n      )\n    );\n  }\n  return t = a(e), n = l[t] = o[t](e), {\n    c() {\n      n.c(), r = sl();\n    },\n    m(s, u) {\n      l[t].m(s, u), On(s, r, u), i = !0;\n    },\n    p(s, u) {\n      let f = t;\n      t = a(s), t === f ? l[t].p(s, u) : (fl(), ut(l[f], 1, 1, () => {\n        l[f] = null;\n      }), ol(), n = l[t], n ? n.p(s, u) : (n = l[t] = o[t](s), n.c()), xe(n, 1), n.m(r.parentNode, r));\n    },\n    i(s) {\n      i || (xe(n), i = !0);\n    },\n    o(s) {\n      ut(n), i = !1;\n    },\n    d(s) {\n      s && Ln(r), l[t].d(s);\n    }\n  };\n}\nfunction qi(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nfunction Rc(e, t, n) {\n  if (!e || e === \"*\" || e === \"file/*\")\n    return !0;\n  let r;\n  if (typeof e == \"string\")\n    r = e.split(\",\").map((i) => i.trim());\n  else if (Array.isArray(e))\n    r = e;\n  else\n    return !1;\n  return r.includes(t) || r.some((i) => {\n    const [o] = i.split(\"/\").map((l) => l.trim());\n    return i.endsWith(\"/*\") && n.startsWith(o + \"/\");\n  });\n}\nfunction Uc(e, t, n) {\n  let { $$slots: r = {}, $$scope: i } = t, { filetype: o = null } = t, { dragging: l = !1 } = t, { boundedheight: a = !0 } = t, { center: s = !0 } = t, { flex: u = !0 } = t, { file_count: f = \"single\" } = t, { disable_click: c = !1 } = t, { root: _ } = t, { hidden: h = !1 } = t, { format: d = \"file\" } = t, { uploading: m = !1 } = t, v, y, k;\n  const b = Ic(\"upload_files\");\n  let p;\n  const P = Nc();\n  function S() {\n    n(17, l = !l);\n  }\n  function A() {\n    navigator.clipboard.read().then(async (w) => {\n      for (let M = 0; M < w.length; M++) {\n        const g = w[M].types.find((E) => E.startsWith(\"image/\"));\n        if (g) {\n          w[M].getType(g).then(async (E) => {\n            const Z = new File([E], `clipboard.${g.replace(\"image/\", \"\")}`);\n            await T([Z]);\n          });\n          break;\n        }\n      }\n    });\n  }\n  function I() {\n    c || (n(13, p.value = \"\", p), p.click());\n  }\n  async function Q(w) {\n    await Pc(), n(10, v = Math.random().toString(36).substring(2, 15)), n(1, m = !0);\n    const M = await cu(w, _, v, b);\n    return P(\"load\", f === \"single\" ? qi([M, \"optionalAccess\", (g) => g[0]]) : M), n(1, m = !1), M || [];\n  }\n  async function T(w) {\n    if (!w.length)\n      return;\n    let M = w.map((g) => new File([g], g.name));\n    return n(11, y = await _u(M)), await Q(y);\n  }\n  async function ye(w) {\n    const M = w.target;\n    if (M.files)\n      if (d != \"blob\")\n        await T(Array.from(M.files));\n      else {\n        if (f === \"single\") {\n          P(\"load\", M.files[0]);\n          return;\n        }\n        P(\"load\", M.files);\n      }\n  }\n  async function Ne(w) {\n    if (n(17, l = !1), !qi([w, \"access\", (g) => g.dataTransfer, \"optionalAccess\", (g) => g.files]))\n      return;\n    const M = Array.from(w.dataTransfer.files).filter((g) => {\n      const E = \".\" + g.name.split(\".\").pop();\n      return E && Rc(o, E, g.type) || (E && Array.isArray(o) ? o.includes(E) : E === o) ? !0 : (P(\"error\", `Invalid file type only ${o} allowed.`), !1);\n    });\n    await T(M);\n  }\n  function Ee(w) {\n    Ke.call(this, e, w);\n  }\n  function Re(w) {\n    Ke.call(this, e, w);\n  }\n  function se(w) {\n    Ke.call(this, e, w);\n  }\n  function pt(w) {\n    Ke.call(this, e, w);\n  }\n  function We(w) {\n    Ke.call(this, e, w);\n  }\n  function gt(w) {\n    Ke.call(this, e, w);\n  }\n  function Ze(w) {\n    Ke.call(this, e, w);\n  }\n  function B(w) {\n    Ec[w ? \"unshift\" : \"push\"](() => {\n      p = w, n(13, p);\n    });\n  }\n  return e.$$set = (w) => {\n    \"filetype\" in w && n(0, o = w.filetype), \"dragging\" in w && n(17, l = w.dragging), \"boundedheight\" in w && n(2, a = w.boundedheight), \"center\" in w && n(3, s = w.center), \"flex\" in w && n(4, u = w.flex), \"file_count\" in w && n(5, f = w.file_count), \"disable_click\" in w && n(18, c = w.disable_click), \"root\" in w && n(6, _ = w.root), \"hidden\" in w && n(7, h = w.hidden), \"format\" in w && n(19, d = w.format), \"uploading\" in w && n(1, m = w.uploading), \"$$scope\" in w && n(21, i = w.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty[0] & /*filetype*/\n    1 && (o == null || typeof o == \"string\" ? n(12, k = o) : (n(0, o = o.map((w) => w.startsWith(\".\") ? w : w + \"/*\")), n(12, k = o.join(\", \"))));\n  }, [\n    o,\n    m,\n    a,\n    s,\n    u,\n    f,\n    _,\n    h,\n    A,\n    I,\n    v,\n    y,\n    k,\n    p,\n    S,\n    ye,\n    Ne,\n    l,\n    c,\n    d,\n    T,\n    i,\n    r,\n    Ee,\n    Re,\n    se,\n    pt,\n    We,\n    gt,\n    Ze,\n    B\n  ];\n}\nclass Fc extends yc {\n  constructor(t) {\n    super(), Tc(\n      this,\n      t,\n      Uc,\n      Dc,\n      Cc,\n      {\n        filetype: 0,\n        dragging: 17,\n        boundedheight: 2,\n        center: 3,\n        flex: 4,\n        file_count: 5,\n        disable_click: 18,\n        root: 6,\n        hidden: 7,\n        format: 19,\n        uploading: 1,\n        paste_clipboard: 8,\n        open_file_upload: 9,\n        load_files: 20\n      },\n      null,\n      [-1, -1]\n    );\n  }\n  get paste_clipboard() {\n    return this.$$.ctx[8];\n  }\n  get open_file_upload() {\n    return this.$$.ctx[9];\n  }\n  get load_files() {\n    return this.$$.ctx[20];\n  }\n}\nconst { setContext: Y_, getContext: Gc } = window.__gradio__svelte__internal, qc = \"WORKER_PROXY_CONTEXT_KEY\";\nfunction hl() {\n  return Gc(qc);\n}\nfunction jc(e) {\n  return e.host === window.location.host || e.host === \"localhost:7860\" || e.host === \"127.0.0.1:7860\" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194\n  e.host === \"lite.local\";\n}\nfunction dl(e, t) {\n  const n = t.toLowerCase();\n  for (const [r, i] of Object.entries(e))\n    if (r.toLowerCase() === n)\n      return i;\n}\nfunction ml(e) {\n  if (e == null)\n    return !1;\n  const t = new URL(e);\n  return !(!jc(t) || t.protocol !== \"http:\" && t.protocol !== \"https:\");\n}\nasync function K_(e) {\n  if (e == null || !ml(e))\n    return e;\n  const t = hl();\n  if (t == null)\n    return e;\n  const r = new URL(e).pathname;\n  return t.httpRequest({\n    method: \"GET\",\n    path: r,\n    headers: {},\n    query_string: \"\"\n  }).then((i) => {\n    if (i.status !== 200)\n      throw new Error(`Failed to get file ${r} from the Wasm worker.`);\n    const o = new Blob([i.body], {\n      type: dl(i.headers, \"content-type\")\n    });\n    return URL.createObjectURL(o);\n  });\n}\nconst {\n  SvelteComponent: zc,\n  assign: En,\n  check_outros: pl,\n  compute_rest_props: ji,\n  create_slot: xr,\n  detach: Mn,\n  element: gl,\n  empty: bl,\n  exclude_internal_props: Vc,\n  get_all_dirty_from_scope: Wr,\n  get_slot_changes: Zr,\n  get_spread_update: vl,\n  group_outros: wl,\n  init: Xc,\n  insert: Dn,\n  listen: yl,\n  prevent_default: xc,\n  safe_not_equal: Wc,\n  set_attributes: Sn,\n  transition_in: ft,\n  transition_out: ct,\n  update_slot_base: Jr\n} = window.__gradio__svelte__internal, { createEventDispatcher: Zc } = window.__gradio__svelte__internal;\nfunction Jc(e) {\n  let t, n, r, i, o;\n  const l = (\n    /*#slots*/\n    e[8].default\n  ), a = xr(\n    l,\n    e,\n    /*$$scope*/\n    e[7],\n    null\n  );\n  let s = [\n    { href: (\n      /*href*/\n      e[0]\n    ) },\n    {\n      target: n = typeof window < \"u\" && window.__is_colab__ ? \"_blank\" : null\n    },\n    { rel: \"noopener noreferrer\" },\n    { download: (\n      /*download*/\n      e[1]\n    ) },\n    /*$$restProps*/\n    e[6]\n  ], u = {};\n  for (let f = 0; f < s.length; f += 1)\n    u = En(u, s[f]);\n  return {\n    c() {\n      t = gl(\"a\"), a && a.c(), Sn(t, u);\n    },\n    m(f, c) {\n      Dn(f, t, c), a && a.m(t, null), r = !0, i || (o = yl(\n        t,\n        \"click\",\n        /*dispatch*/\n        e[3].bind(null, \"click\")\n      ), i = !0);\n    },\n    p(f, c) {\n      a && a.p && (!r || c & /*$$scope*/\n      128) && Jr(\n        a,\n        l,\n        f,\n        /*$$scope*/\n        f[7],\n        r ? Zr(\n          l,\n          /*$$scope*/\n          f[7],\n          c,\n          null\n        ) : Wr(\n          /*$$scope*/\n          f[7]\n        ),\n        null\n      ), Sn(t, u = vl(s, [\n        (!r || c & /*href*/\n        1) && { href: (\n          /*href*/\n          f[0]\n        ) },\n        { target: n },\n        { rel: \"noopener noreferrer\" },\n        (!r || c & /*download*/\n        2) && { download: (\n          /*download*/\n          f[1]\n        ) },\n        c & /*$$restProps*/\n        64 && /*$$restProps*/\n        f[6]\n      ]));\n    },\n    i(f) {\n      r || (ft(a, f), r = !0);\n    },\n    o(f) {\n      ct(a, f), r = !1;\n    },\n    d(f) {\n      f && Mn(t), a && a.d(f), i = !1, o();\n    }\n  };\n}\nfunction Qc(e) {\n  let t, n, r, i;\n  const o = [Kc, Yc], l = [];\n  function a(s, u) {\n    return (\n      /*is_downloading*/\n      s[2] ? 0 : 1\n    );\n  }\n  return t = a(e), n = l[t] = o[t](e), {\n    c() {\n      n.c(), r = bl();\n    },\n    m(s, u) {\n      l[t].m(s, u), Dn(s, r, u), i = !0;\n    },\n    p(s, u) {\n      let f = t;\n      t = a(s), t === f ? l[t].p(s, u) : (wl(), ct(l[f], 1, 1, () => {\n        l[f] = null;\n      }), pl(), n = l[t], n ? n.p(s, u) : (n = l[t] = o[t](s), n.c()), ft(n, 1), n.m(r.parentNode, r));\n    },\n    i(s) {\n      i || (ft(n), i = !0);\n    },\n    o(s) {\n      ct(n), i = !1;\n    },\n    d(s) {\n      s && Mn(r), l[t].d(s);\n    }\n  };\n}\nfunction Yc(e) {\n  let t, n, r, i;\n  const o = (\n    /*#slots*/\n    e[8].default\n  ), l = xr(\n    o,\n    e,\n    /*$$scope*/\n    e[7],\n    null\n  );\n  let a = [\n    /*$$restProps*/\n    e[6],\n    { href: (\n      /*href*/\n      e[0]\n    ) }\n  ], s = {};\n  for (let u = 0; u < a.length; u += 1)\n    s = En(s, a[u]);\n  return {\n    c() {\n      t = gl(\"a\"), l && l.c(), Sn(t, s);\n    },\n    m(u, f) {\n      Dn(u, t, f), l && l.m(t, null), n = !0, r || (i = yl(t, \"click\", xc(\n        /*wasm_click_handler*/\n        e[5]\n      )), r = !0);\n    },\n    p(u, f) {\n      l && l.p && (!n || f & /*$$scope*/\n      128) && Jr(\n        l,\n        o,\n        u,\n        /*$$scope*/\n        u[7],\n        n ? Zr(\n          o,\n          /*$$scope*/\n          u[7],\n          f,\n          null\n        ) : Wr(\n          /*$$scope*/\n          u[7]\n        ),\n        null\n      ), Sn(t, s = vl(a, [\n        f & /*$$restProps*/\n        64 && /*$$restProps*/\n        u[6],\n        (!n || f & /*href*/\n        1) && { href: (\n          /*href*/\n          u[0]\n        ) }\n      ]));\n    },\n    i(u) {\n      n || (ft(l, u), n = !0);\n    },\n    o(u) {\n      ct(l, u), n = !1;\n    },\n    d(u) {\n      u && Mn(t), l && l.d(u), r = !1, i();\n    }\n  };\n}\nfunction Kc(e) {\n  let t;\n  const n = (\n    /*#slots*/\n    e[8].default\n  ), r = xr(\n    n,\n    e,\n    /*$$scope*/\n    e[7],\n    null\n  );\n  return {\n    c() {\n      r && r.c();\n    },\n    m(i, o) {\n      r && r.m(i, o), t = !0;\n    },\n    p(i, o) {\n      r && r.p && (!t || o & /*$$scope*/\n      128) && Jr(\n        r,\n        n,\n        i,\n        /*$$scope*/\n        i[7],\n        t ? Zr(\n          n,\n          /*$$scope*/\n          i[7],\n          o,\n          null\n        ) : Wr(\n          /*$$scope*/\n          i[7]\n        ),\n        null\n      );\n    },\n    i(i) {\n      t || (ft(r, i), t = !0);\n    },\n    o(i) {\n      ct(r, i), t = !1;\n    },\n    d(i) {\n      r && r.d(i);\n    }\n  };\n}\nfunction $c(e) {\n  let t, n, r, i, o;\n  const l = [Qc, Jc], a = [];\n  function s(u, f) {\n    return f & /*href*/\n    1 && (t = null), t == null && (t = !!/*worker_proxy*/\n    (u[4] && ml(\n      /*href*/\n      u[0]\n    ))), t ? 0 : 1;\n  }\n  return n = s(e, -1), r = a[n] = l[n](e), {\n    c() {\n      r.c(), i = bl();\n    },\n    m(u, f) {\n      a[n].m(u, f), Dn(u, i, f), o = !0;\n    },\n    p(u, [f]) {\n      let c = n;\n      n = s(u, f), n === c ? a[n].p(u, f) : (wl(), ct(a[c], 1, 1, () => {\n        a[c] = null;\n      }), pl(), r = a[n], r ? r.p(u, f) : (r = a[n] = l[n](u), r.c()), ft(r, 1), r.m(i.parentNode, i));\n    },\n    i(u) {\n      o || (ft(r), o = !0);\n    },\n    o(u) {\n      ct(r), o = !1;\n    },\n    d(u) {\n      u && Mn(i), a[n].d(u);\n    }\n  };\n}\nfunction e0(e, t, n) {\n  const r = [\"href\", \"download\"];\n  let i = ji(t, r), { $$slots: o = {}, $$scope: l } = t, { href: a = void 0 } = t, { download: s } = t;\n  const u = Zc();\n  let f = !1;\n  const c = hl();\n  async function _() {\n    if (f)\n      return;\n    if (u(\"click\"), a == null)\n      throw new Error(\"href is not defined.\");\n    if (c == null)\n      throw new Error(\"Wasm worker proxy is not available.\");\n    const d = new URL(a).pathname;\n    n(2, f = !0), c.httpRequest({\n      method: \"GET\",\n      path: d,\n      headers: {},\n      query_string: \"\"\n    }).then((m) => {\n      if (m.status !== 200)\n        throw new Error(`Failed to get file ${d} from the Wasm worker.`);\n      const v = new Blob(\n        [m.body],\n        {\n          type: dl(m.headers, \"content-type\")\n        }\n      ), y = URL.createObjectURL(v), k = document.createElement(\"a\");\n      k.href = y, k.download = s, k.click(), URL.revokeObjectURL(y);\n    }).finally(() => {\n      n(2, f = !1);\n    });\n  }\n  return e.$$set = (h) => {\n    t = En(En({}, t), Vc(h)), n(6, i = ji(t, r)), \"href\" in h && n(0, a = h.href), \"download\" in h && n(1, s = h.download), \"$$scope\" in h && n(7, l = h.$$scope);\n  }, [\n    a,\n    s,\n    f,\n    u,\n    c,\n    _,\n    i,\n    l,\n    o\n  ];\n}\nclass t0 extends zc {\n  constructor(t) {\n    super(), Xc(this, t, e0, $c, Wc, { href: 0, download: 1 });\n  }\n}\nconst {\n  SvelteComponent: n0,\n  append: _r,\n  attr: r0,\n  check_outros: hr,\n  create_component: Yt,\n  destroy_component: Kt,\n  detach: i0,\n  element: o0,\n  group_outros: dr,\n  init: l0,\n  insert: s0,\n  mount_component: $t,\n  safe_not_equal: a0,\n  set_style: zi,\n  space: mr,\n  toggle_class: Vi,\n  transition_in: re,\n  transition_out: Ce\n} = window.__gradio__svelte__internal, { createEventDispatcher: u0 } = window.__gradio__svelte__internal;\nfunction Xi(e) {\n  let t, n;\n  return t = new Tt({\n    props: {\n      Icon: fa,\n      label: (\n        /*i18n*/\n        e[4](\"common.edit\")\n      )\n    }\n  }), t.$on(\n    \"click\",\n    /*click_handler*/\n    e[6]\n  ), {\n    c() {\n      Yt(t.$$.fragment);\n    },\n    m(r, i) {\n      $t(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*i18n*/\n      16 && (o.label = /*i18n*/\n      r[4](\"common.edit\")), t.$set(o);\n    },\n    i(r) {\n      n || (re(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ce(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Kt(t, r);\n    }\n  };\n}\nfunction xi(e) {\n  let t, n;\n  return t = new Tt({\n    props: {\n      Icon: Eo,\n      label: (\n        /*i18n*/\n        e[4](\"common.undo\")\n      )\n    }\n  }), t.$on(\n    \"click\",\n    /*click_handler_1*/\n    e[7]\n  ), {\n    c() {\n      Yt(t.$$.fragment);\n    },\n    m(r, i) {\n      $t(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*i18n*/\n      16 && (o.label = /*i18n*/\n      r[4](\"common.undo\")), t.$set(o);\n    },\n    i(r) {\n      n || (re(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ce(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Kt(t, r);\n    }\n  };\n}\nfunction Wi(e) {\n  let t, n;\n  return t = new t0({\n    props: {\n      href: (\n        /*download*/\n        e[2]\n      ),\n      download: !0,\n      $$slots: { default: [f0] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Yt(t.$$.fragment);\n    },\n    m(r, i) {\n      $t(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*download*/\n      4 && (o.href = /*download*/\n      r[2]), i & /*$$scope, i18n*/\n      528 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o);\n    },\n    i(r) {\n      n || (re(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ce(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Kt(t, r);\n    }\n  };\n}\nfunction f0(e) {\n  let t, n;\n  return t = new Tt({\n    props: {\n      Icon: yo,\n      label: (\n        /*i18n*/\n        e[4](\"common.download\")\n      )\n    }\n  }), {\n    c() {\n      Yt(t.$$.fragment);\n    },\n    m(r, i) {\n      $t(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*i18n*/\n      16 && (o.label = /*i18n*/\n      r[4](\"common.download\")), t.$set(o);\n    },\n    i(r) {\n      n || (re(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Ce(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Kt(t, r);\n    }\n  };\n}\nfunction c0(e) {\n  let t, n, r, i, o, l, a = (\n    /*editable*/\n    e[0] && Xi(e)\n  ), s = (\n    /*undoable*/\n    e[1] && xi(e)\n  ), u = (\n    /*download*/\n    e[2] && Wi(e)\n  );\n  return o = new Tt({\n    props: {\n      Icon: Js,\n      label: (\n        /*i18n*/\n        e[4](\"common.clear\")\n      )\n    }\n  }), o.$on(\n    \"click\",\n    /*click_handler_2*/\n    e[8]\n  ), {\n    c() {\n      t = o0(\"div\"), a && a.c(), n = mr(), s && s.c(), r = mr(), u && u.c(), i = mr(), Yt(o.$$.fragment), r0(t, \"class\", \"svelte-1wj0ocy\"), Vi(t, \"not-absolute\", !/*absolute*/\n      e[3]), zi(\n        t,\n        \"position\",\n        /*absolute*/\n        e[3] ? \"absolute\" : \"static\"\n      );\n    },\n    m(f, c) {\n      s0(f, t, c), a && a.m(t, null), _r(t, n), s && s.m(t, null), _r(t, r), u && u.m(t, null), _r(t, i), $t(o, t, null), l = !0;\n    },\n    p(f, [c]) {\n      /*editable*/\n      f[0] ? a ? (a.p(f, c), c & /*editable*/\n      1 && re(a, 1)) : (a = Xi(f), a.c(), re(a, 1), a.m(t, n)) : a && (dr(), Ce(a, 1, 1, () => {\n        a = null;\n      }), hr()), /*undoable*/\n      f[1] ? s ? (s.p(f, c), c & /*undoable*/\n      2 && re(s, 1)) : (s = xi(f), s.c(), re(s, 1), s.m(t, r)) : s && (dr(), Ce(s, 1, 1, () => {\n        s = null;\n      }), hr()), /*download*/\n      f[2] ? u ? (u.p(f, c), c & /*download*/\n      4 && re(u, 1)) : (u = Wi(f), u.c(), re(u, 1), u.m(t, i)) : u && (dr(), Ce(u, 1, 1, () => {\n        u = null;\n      }), hr());\n      const _ = {};\n      c & /*i18n*/\n      16 && (_.label = /*i18n*/\n      f[4](\"common.clear\")), o.$set(_), (!l || c & /*absolute*/\n      8) && Vi(t, \"not-absolute\", !/*absolute*/\n      f[3]), c & /*absolute*/\n      8 && zi(\n        t,\n        \"position\",\n        /*absolute*/\n        f[3] ? \"absolute\" : \"static\"\n      );\n    },\n    i(f) {\n      l || (re(a), re(s), re(u), re(o.$$.fragment, f), l = !0);\n    },\n    o(f) {\n      Ce(a), Ce(s), Ce(u), Ce(o.$$.fragment, f), l = !1;\n    },\n    d(f) {\n      f && i0(t), a && a.d(), s && s.d(), u && u.d(), Kt(o);\n    }\n  };\n}\nfunction _0(e, t, n) {\n  let { editable: r = !1 } = t, { undoable: i = !1 } = t, { download: o = null } = t, { absolute: l = !0 } = t, { i18n: a } = t;\n  const s = u0(), u = () => s(\"edit\"), f = () => s(\"undo\"), c = (_) => {\n    s(\"clear\"), _.stopPropagation();\n  };\n  return e.$$set = (_) => {\n    \"editable\" in _ && n(0, r = _.editable), \"undoable\" in _ && n(1, i = _.undoable), \"download\" in _ && n(2, o = _.download), \"absolute\" in _ && n(3, l = _.absolute), \"i18n\" in _ && n(4, a = _.i18n);\n  }, [\n    r,\n    i,\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c\n  ];\n}\nclass h0 extends n0 {\n  constructor(t) {\n    super(), l0(this, t, _0, c0, a0, {\n      editable: 0,\n      undoable: 1,\n      download: 2,\n      absolute: 3,\n      i18n: 4\n    });\n  }\n}\nconst {\n  SvelteComponent: d0,\n  add_flush_callback: m0,\n  append: p0,\n  attr: g0,\n  bind: b0,\n  binding_callbacks: v0,\n  check_outros: Rn,\n  construct_svelte_component: kn,\n  create_component: _t,\n  create_slot: w0,\n  destroy_component: ht,\n  detach: Vt,\n  element: y0,\n  empty: Qr,\n  get_all_dirty_from_scope: E0,\n  get_slot_changes: S0,\n  group_outros: Un,\n  init: k0,\n  insert: Xt,\n  mount_component: dt,\n  safe_not_equal: T0,\n  space: El,\n  transition_in: be,\n  transition_out: ve,\n  update_slot_base: A0\n} = window.__gradio__svelte__internal, { createEventDispatcher: B0, tick: Zi } = window.__gradio__svelte__internal;\nfunction C0(e) {\n  let t, n, r, i, o, l;\n  n = new h0({\n    props: {\n      undoable: !0,\n      i18n: (\n        /*i18n*/\n        e[5]\n      ),\n      absolute: !0\n    }\n  }), n.$on(\n    \"clear\",\n    /*handle_clear*/\n    e[14]\n  ), n.$on(\n    \"undo\",\n    /*handle_undo*/\n    e[15]\n  );\n  const a = [P0, N0], s = [];\n  function u(f, c) {\n    return (\n      /*use_3dgs*/\n      f[9] ? 0 : 1\n    );\n  }\n  return i = u(e), o = s[i] = a[i](e), {\n    c() {\n      t = y0(\"div\"), _t(n.$$.fragment), r = El(), o.c(), g0(t, \"class\", \"input-model svelte-1oz8ks8\");\n    },\n    m(f, c) {\n      Xt(f, t, c), dt(n, t, null), p0(t, r), s[i].m(t, null), l = !0;\n    },\n    p(f, c) {\n      const _ = {};\n      c & /*i18n*/\n      32 && (_.i18n = /*i18n*/\n      f[5]), n.$set(_);\n      let h = i;\n      i = u(f), i === h ? s[i].p(f, c) : (Un(), ve(s[h], 1, 1, () => {\n        s[h] = null;\n      }), Rn(), o = s[i], o ? o.p(f, c) : (o = s[i] = a[i](f), o.c()), be(o, 1), o.m(t, null));\n    },\n    i(f) {\n      l || (be(n.$$.fragment, f), be(o), l = !0);\n    },\n    o(f) {\n      ve(n.$$.fragment, f), ve(o), l = !1;\n    },\n    d(f) {\n      f && Vt(t), ht(n), s[i].d();\n    }\n  };\n}\nfunction H0(e) {\n  let t, n, r;\n  function i(l) {\n    e[17](l);\n  }\n  let o = {\n    root: (\n      /*root*/\n      e[4]\n    ),\n    filetype: [\".glb\"],\n    $$slots: { default: [I0] },\n    $$scope: { ctx: e }\n  };\n  return (\n    /*dragging*/\n    e[10] !== void 0 && (o.dragging = /*dragging*/\n    e[10]), t = new Fc({ props: o }), v0.push(() => b0(t, \"dragging\", i)), t.$on(\n      \"load\",\n      /*handle_upload*/\n      e[13]\n    ), {\n      c() {\n        _t(t.$$.fragment);\n      },\n      m(l, a) {\n        dt(t, l, a), r = !0;\n      },\n      p(l, a) {\n        const s = {};\n        a & /*root*/\n        16 && (s.root = /*root*/\n        l[4]), a & /*$$scope*/\n        262144 && (s.$$scope = { dirty: a, ctx: l }), !n && a & /*dragging*/\n        1024 && (n = !0, s.dragging = /*dragging*/\n        l[10], m0(() => n = !1)), t.$set(s);\n      },\n      i(l) {\n        r || (be(t.$$.fragment, l), r = !0);\n      },\n      o(l) {\n        ve(t.$$.fragment, l), r = !1;\n      },\n      d(l) {\n        ht(t, l);\n      }\n    }\n  );\n}\nfunction N0(e) {\n  let t, n, r;\n  var i = (\n    /*canvas3d*/\n    e[11]\n  );\n  function o(l, a) {\n    return {\n      props: {\n        value: (\n          /*value*/\n          l[0]\n        ),\n        clear_color: (\n          /*clear_color*/\n          l[1]\n        ),\n        camera_position: (\n          /*camera_position*/\n          l[8]\n        ),\n        zoom_speed: (\n          /*zoom_speed*/\n          l[6]\n        ),\n        pan_speed: (\n          /*pan_speed*/\n          l[7]\n        )\n      }\n    };\n  }\n  return i && (t = kn(i, o(e))), {\n    c() {\n      t && _t(t.$$.fragment), n = Qr();\n    },\n    m(l, a) {\n      t && dt(t, l, a), Xt(l, n, a), r = !0;\n    },\n    p(l, a) {\n      if (a & /*canvas3d*/\n      2048 && i !== (i = /*canvas3d*/\n      l[11])) {\n        if (t) {\n          Un();\n          const s = t;\n          ve(s.$$.fragment, 1, 0, () => {\n            ht(s, 1);\n          }), Rn();\n        }\n        i ? (t = kn(i, o(l)), _t(t.$$.fragment), be(t.$$.fragment, 1), dt(t, n.parentNode, n)) : t = null;\n      } else if (i) {\n        const s = {};\n        a & /*value*/\n        1 && (s.value = /*value*/\n        l[0]), a & /*clear_color*/\n        2 && (s.clear_color = /*clear_color*/\n        l[1]), a & /*camera_position*/\n        256 && (s.camera_position = /*camera_position*/\n        l[8]), a & /*zoom_speed*/\n        64 && (s.zoom_speed = /*zoom_speed*/\n        l[6]), a & /*pan_speed*/\n        128 && (s.pan_speed = /*pan_speed*/\n        l[7]), t.$set(s);\n      }\n    },\n    i(l) {\n      r || (t && be(t.$$.fragment, l), r = !0);\n    },\n    o(l) {\n      t && ve(t.$$.fragment, l), r = !1;\n    },\n    d(l) {\n      l && Vt(n), t && ht(t, l);\n    }\n  };\n}\nfunction P0(e) {\n  let t, n, r;\n  var i = (\n    /*canvas3dgs*/\n    e[12]\n  );\n  function o(l, a) {\n    return {\n      props: {\n        value: (\n          /*value*/\n          l[0]\n        ),\n        zoom_speed: (\n          /*zoom_speed*/\n          l[6]\n        ),\n        pan_speed: (\n          /*pan_speed*/\n          l[7]\n        )\n      }\n    };\n  }\n  return i && (t = kn(i, o(e))), {\n    c() {\n      t && _t(t.$$.fragment), n = Qr();\n    },\n    m(l, a) {\n      t && dt(t, l, a), Xt(l, n, a), r = !0;\n    },\n    p(l, a) {\n      if (a & /*canvas3dgs*/\n      4096 && i !== (i = /*canvas3dgs*/\n      l[12])) {\n        if (t) {\n          Un();\n          const s = t;\n          ve(s.$$.fragment, 1, 0, () => {\n            ht(s, 1);\n          }), Rn();\n        }\n        i ? (t = kn(i, o(l)), _t(t.$$.fragment), be(t.$$.fragment, 1), dt(t, n.parentNode, n)) : t = null;\n      } else if (i) {\n        const s = {};\n        a & /*value*/\n        1 && (s.value = /*value*/\n        l[0]), a & /*zoom_speed*/\n        64 && (s.zoom_speed = /*zoom_speed*/\n        l[6]), a & /*pan_speed*/\n        128 && (s.pan_speed = /*pan_speed*/\n        l[7]), t.$set(s);\n      }\n    },\n    i(l) {\n      r || (t && be(t.$$.fragment, l), r = !0);\n    },\n    o(l) {\n      t && ve(t.$$.fragment, l), r = !1;\n    },\n    d(l) {\n      l && Vt(n), t && ht(t, l);\n    }\n  };\n}\nfunction I0(e) {\n  let t;\n  const n = (\n    /*#slots*/\n    e[16].default\n  ), r = w0(\n    n,\n    e,\n    /*$$scope*/\n    e[18],\n    null\n  );\n  return {\n    c() {\n      r && r.c();\n    },\n    m(i, o) {\n      r && r.m(i, o), t = !0;\n    },\n    p(i, o) {\n      r && r.p && (!t || o & /*$$scope*/\n      262144) && A0(\n        r,\n        n,\n        i,\n        /*$$scope*/\n        i[18],\n        t ? S0(\n          n,\n          /*$$scope*/\n          i[18],\n          o,\n          null\n        ) : E0(\n          /*$$scope*/\n          i[18]\n        ),\n        null\n      );\n    },\n    i(i) {\n      t || (be(r, i), t = !0);\n    },\n    o(i) {\n      ve(r, i), t = !1;\n    },\n    d(i) {\n      r && r.d(i);\n    }\n  };\n}\nfunction L0(e) {\n  let t, n, r, i, o, l;\n  t = new Fr({\n    props: {\n      show_label: (\n        /*show_label*/\n        e[3]\n      ),\n      Icon: An,\n      label: (\n        /*label*/\n        e[2] || \"3D Model\"\n      )\n    }\n  });\n  const a = [H0, C0], s = [];\n  function u(f, c) {\n    return (\n      /*value*/\n      f[0] === null ? 0 : 1\n    );\n  }\n  return r = u(e), i = s[r] = a[r](e), {\n    c() {\n      _t(t.$$.fragment), n = El(), i.c(), o = Qr();\n    },\n    m(f, c) {\n      dt(t, f, c), Xt(f, n, c), s[r].m(f, c), Xt(f, o, c), l = !0;\n    },\n    p(f, [c]) {\n      const _ = {};\n      c & /*show_label*/\n      8 && (_.show_label = /*show_label*/\n      f[3]), c & /*label*/\n      4 && (_.label = /*label*/\n      f[2] || \"3D Model\"), t.$set(_);\n      let h = r;\n      r = u(f), r === h ? s[r].p(f, c) : (Un(), ve(s[h], 1, 1, () => {\n        s[h] = null;\n      }), Rn(), i = s[r], i ? i.p(f, c) : (i = s[r] = a[r](f), i.c()), be(i, 1), i.m(o.parentNode, o));\n    },\n    i(f) {\n      l || (be(t.$$.fragment, f), be(i), l = !0);\n    },\n    o(f) {\n      ve(t.$$.fragment, f), ve(i), l = !1;\n    },\n    d(f) {\n      f && (Vt(n), Vt(o)), ht(t, f), s[r].d(f);\n    }\n  };\n}\nfunction Ji(e) {\n  let t, n = e[0], r = 1;\n  for (; r < e.length; ) {\n    const i = e[r], o = e[r + 1];\n    if (r += 2, (i === \"optionalAccess\" || i === \"optionalCall\") && n == null)\n      return;\n    i === \"access\" || i === \"optionalAccess\" ? (t = n, n = o(n)) : (i === \"call\" || i === \"optionalCall\") && (n = o((...l) => n.call(t, ...l)), t = void 0);\n  }\n  return n;\n}\nasync function O0() {\n  return (await import(\"./Canvas3D-e42d3d6b.js\")).default;\n}\nasync function M0() {\n  return (await import(\"./Canvas3DGS-f5539f54.js\")).default;\n}\nfunction D0(e, t, n) {\n  let { $$slots: r = {}, $$scope: i } = t, { value: o } = t, { clear_color: l = [0, 0, 0, 0] } = t, { label: a = \"\" } = t, { show_label: s } = t, { root: u } = t, { i18n: f } = t, { zoom_speed: c = 1 } = t, { pan_speed: _ = 1 } = t, { camera_position: h = [null, null, null] } = t;\n  async function d({ detail: A }) {\n    n(0, o = A), await Zi(), p(\"change\", o), p(\"load\", o);\n  }\n  async function m() {\n    n(0, o = null), await Zi(), p(\"clear\"), p(\"change\");\n  }\n  let v, y, k = !1;\n  async function b() {\n    v.reset_camera_position(h, c, _);\n  }\n  const p = B0();\n  let P = !1;\n  function S(A) {\n    P = A, n(10, P);\n  }\n  return e.$$set = (A) => {\n    \"value\" in A && n(0, o = A.value), \"clear_color\" in A && n(1, l = A.clear_color), \"label\" in A && n(2, a = A.label), \"show_label\" in A && n(3, s = A.show_label), \"root\" in A && n(4, u = A.root), \"i18n\" in A && n(5, f = A.i18n), \"zoom_speed\" in A && n(6, c = A.zoom_speed), \"pan_speed\" in A && n(7, _ = A.pan_speed), \"camera_position\" in A && n(8, h = A.camera_position), \"$$scope\" in A && n(18, i = A.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty & /*dragging*/\n    1024 && p(\"drag\", P), e.$$.dirty & /*value, use_3dgs*/\n    513 && o && (n(9, k = Ji([\n      o,\n      \"optionalAccess\",\n      (A) => A.path,\n      \"access\",\n      (A) => A.endsWith,\n      \"call\",\n      (A) => A(\".splat\")\n    ]) || Ji([\n      o,\n      \"optionalAccess\",\n      (A) => A.path,\n      \"access\",\n      (A) => A.endsWith,\n      \"call\",\n      (A) => A(\".ply\")\n    ])), k ? M0().then((A) => {\n      n(12, y = A);\n    }) : O0().then((A) => {\n      n(11, v = A);\n    }));\n  }, [\n    o,\n    l,\n    a,\n    s,\n    u,\n    f,\n    c,\n    _,\n    h,\n    k,\n    P,\n    v,\n    y,\n    d,\n    m,\n    b,\n    r,\n    S,\n    i\n  ];\n}\nclass R0 extends d0 {\n  constructor(t) {\n    super(), k0(this, t, D0, L0, T0, {\n      value: 0,\n      clear_color: 1,\n      label: 2,\n      show_label: 3,\n      root: 4,\n      i18n: 5,\n      zoom_speed: 6,\n      pan_speed: 7,\n      camera_position: 8\n    });\n  }\n}\nfunction St(e) {\n  let t = [\"\", \"k\", \"M\", \"G\", \"T\", \"P\", \"E\", \"Z\"], n = 0;\n  for (; e > 1e3 && n < t.length - 1; )\n    e /= 1e3, n++;\n  let r = t[n];\n  return (Number.isInteger(e) ? e : e.toFixed(1)) + r;\n}\nconst {\n  SvelteComponent: U0,\n  append: Ae,\n  attr: D,\n  component_subscribe: Qi,\n  detach: F0,\n  element: G0,\n  init: q0,\n  insert: j0,\n  noop: Yi,\n  safe_not_equal: z0,\n  set_style: an,\n  svg_element: Be,\n  toggle_class: Ki\n} = window.__gradio__svelte__internal, { onMount: V0 } = window.__gradio__svelte__internal;\nfunction X0(e) {\n  let t, n, r, i, o, l, a, s, u, f, c, _;\n  return {\n    c() {\n      t = G0(\"div\"), n = Be(\"svg\"), r = Be(\"g\"), i = Be(\"path\"), o = Be(\"path\"), l = Be(\"path\"), a = Be(\"path\"), s = Be(\"g\"), u = Be(\"path\"), f = Be(\"path\"), c = Be(\"path\"), _ = Be(\"path\"), D(i, \"d\", \"M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z\"), D(i, \"fill\", \"#FF7C00\"), D(i, \"fill-opacity\", \"0.4\"), D(i, \"class\", \"svelte-43sxxs\"), D(o, \"d\", \"M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z\"), D(o, \"fill\", \"#FF7C00\"), D(o, \"class\", \"svelte-43sxxs\"), D(l, \"d\", \"M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z\"), D(l, \"fill\", \"#FF7C00\"), D(l, \"fill-opacity\", \"0.4\"), D(l, \"class\", \"svelte-43sxxs\"), D(a, \"d\", \"M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z\"), D(a, \"fill\", \"#FF7C00\"), D(a, \"class\", \"svelte-43sxxs\"), an(r, \"transform\", \"translate(\" + /*$top*/\n      e[1][0] + \"px, \" + /*$top*/\n      e[1][1] + \"px)\"), D(u, \"d\", \"M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z\"), D(u, \"fill\", \"#FF7C00\"), D(u, \"fill-opacity\", \"0.4\"), D(u, \"class\", \"svelte-43sxxs\"), D(f, \"d\", \"M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z\"), D(f, \"fill\", \"#FF7C00\"), D(f, \"class\", \"svelte-43sxxs\"), D(c, \"d\", \"M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z\"), D(c, \"fill\", \"#FF7C00\"), D(c, \"fill-opacity\", \"0.4\"), D(c, \"class\", \"svelte-43sxxs\"), D(_, \"d\", \"M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z\"), D(_, \"fill\", \"#FF7C00\"), D(_, \"class\", \"svelte-43sxxs\"), an(s, \"transform\", \"translate(\" + /*$bottom*/\n      e[2][0] + \"px, \" + /*$bottom*/\n      e[2][1] + \"px)\"), D(n, \"viewBox\", \"-1200 -1200 3000 3000\"), D(n, \"fill\", \"none\"), D(n, \"xmlns\", \"http://www.w3.org/2000/svg\"), D(n, \"class\", \"svelte-43sxxs\"), D(t, \"class\", \"svelte-43sxxs\"), Ki(\n        t,\n        \"margin\",\n        /*margin*/\n        e[0]\n      );\n    },\n    m(h, d) {\n      j0(h, t, d), Ae(t, n), Ae(n, r), Ae(r, i), Ae(r, o), Ae(r, l), Ae(r, a), Ae(n, s), Ae(s, u), Ae(s, f), Ae(s, c), Ae(s, _);\n    },\n    p(h, [d]) {\n      d & /*$top*/\n      2 && an(r, \"transform\", \"translate(\" + /*$top*/\n      h[1][0] + \"px, \" + /*$top*/\n      h[1][1] + \"px)\"), d & /*$bottom*/\n      4 && an(s, \"transform\", \"translate(\" + /*$bottom*/\n      h[2][0] + \"px, \" + /*$bottom*/\n      h[2][1] + \"px)\"), d & /*margin*/\n      1 && Ki(\n        t,\n        \"margin\",\n        /*margin*/\n        h[0]\n      );\n    },\n    i: Yi,\n    o: Yi,\n    d(h) {\n      h && F0(t);\n    }\n  };\n}\nfunction x0(e, t, n) {\n  let r, i, { margin: o = !0 } = t;\n  const l = Ei([0, 0]);\n  Qi(e, l, (_) => n(1, r = _));\n  const a = Ei([0, 0]);\n  Qi(e, a, (_) => n(2, i = _));\n  let s;\n  async function u() {\n    await Promise.all([l.set([125, 140]), a.set([-125, -140])]), await Promise.all([l.set([-125, 140]), a.set([125, -140])]), await Promise.all([l.set([-125, 0]), a.set([125, -0])]), await Promise.all([l.set([125, 0]), a.set([-125, 0])]);\n  }\n  async function f() {\n    await u(), s || f();\n  }\n  async function c() {\n    await Promise.all([l.set([125, 0]), a.set([-125, 0])]), f();\n  }\n  return V0(() => (c(), () => s = !0)), e.$$set = (_) => {\n    \"margin\" in _ && n(0, o = _.margin);\n  }, [o, r, i, l, a];\n}\nclass W0 extends U0 {\n  constructor(t) {\n    super(), q0(this, t, x0, X0, z0, { margin: 0 });\n  }\n}\nconst {\n  SvelteComponent: Z0,\n  append: it,\n  attr: Ie,\n  binding_callbacks: $i,\n  check_outros: Sl,\n  create_component: J0,\n  create_slot: Q0,\n  destroy_component: Y0,\n  destroy_each: kl,\n  detach: C,\n  element: Fe,\n  empty: Ot,\n  ensure_array_like: Tn,\n  get_all_dirty_from_scope: K0,\n  get_slot_changes: $0,\n  group_outros: Tl,\n  init: e_,\n  insert: H,\n  mount_component: t_,\n  noop: Ur,\n  safe_not_equal: n_,\n  set_data: we,\n  set_style: Xe,\n  space: Le,\n  text: X,\n  toggle_class: pe,\n  transition_in: Nt,\n  transition_out: Pt,\n  update_slot_base: r_\n} = window.__gradio__svelte__internal, { tick: i_ } = window.__gradio__svelte__internal, { onDestroy: o_ } = window.__gradio__svelte__internal, l_ = (e) => ({}), eo = (e) => ({});\nfunction to(e, t, n) {\n  const r = e.slice();\n  return r[38] = t[n], r[40] = n, r;\n}\nfunction no(e, t, n) {\n  const r = e.slice();\n  return r[38] = t[n], r;\n}\nfunction s_(e) {\n  let t, n = (\n    /*i18n*/\n    e[1](\"common.error\") + \"\"\n  ), r, i, o;\n  const l = (\n    /*#slots*/\n    e[29].error\n  ), a = Q0(\n    l,\n    e,\n    /*$$scope*/\n    e[28],\n    eo\n  );\n  return {\n    c() {\n      t = Fe(\"span\"), r = X(n), i = Le(), a && a.c(), Ie(t, \"class\", \"error svelte-1txqlrd\");\n    },\n    m(s, u) {\n      H(s, t, u), it(t, r), H(s, i, u), a && a.m(s, u), o = !0;\n    },\n    p(s, u) {\n      (!o || u[0] & /*i18n*/\n      2) && n !== (n = /*i18n*/\n      s[1](\"common.error\") + \"\") && we(r, n), a && a.p && (!o || u[0] & /*$$scope*/\n      268435456) && r_(\n        a,\n        l,\n        s,\n        /*$$scope*/\n        s[28],\n        o ? $0(\n          l,\n          /*$$scope*/\n          s[28],\n          u,\n          l_\n        ) : K0(\n          /*$$scope*/\n          s[28]\n        ),\n        eo\n      );\n    },\n    i(s) {\n      o || (Nt(a, s), o = !0);\n    },\n    o(s) {\n      Pt(a, s), o = !1;\n    },\n    d(s) {\n      s && (C(t), C(i)), a && a.d(s);\n    }\n  };\n}\nfunction a_(e) {\n  let t, n, r, i, o, l, a, s, u, f = (\n    /*variant*/\n    e[8] === \"default\" && /*show_eta_bar*/\n    e[18] && /*show_progress*/\n    e[6] === \"full\" && ro(e)\n  );\n  function c(b, p) {\n    if (\n      /*progress*/\n      b[7]\n    )\n      return c_;\n    if (\n      /*queue_position*/\n      b[2] !== null && /*queue_size*/\n      b[3] !== void 0 && /*queue_position*/\n      b[2] >= 0\n    )\n      return f_;\n    if (\n      /*queue_position*/\n      b[2] === 0\n    )\n      return u_;\n  }\n  let _ = c(e), h = _ && _(e), d = (\n    /*timer*/\n    e[5] && lo(e)\n  );\n  const m = [m_, d_], v = [];\n  function y(b, p) {\n    return (\n      /*last_progress_level*/\n      b[15] != null ? 0 : (\n        /*show_progress*/\n        b[6] === \"full\" ? 1 : -1\n      )\n    );\n  }\n  ~(o = y(e)) && (l = v[o] = m[o](e));\n  let k = !/*timer*/\n  e[5] && ho(e);\n  return {\n    c() {\n      f && f.c(), t = Le(), n = Fe(\"div\"), h && h.c(), r = Le(), d && d.c(), i = Le(), l && l.c(), a = Le(), k && k.c(), s = Ot(), Ie(n, \"class\", \"progress-text svelte-1txqlrd\"), pe(\n        n,\n        \"meta-text-center\",\n        /*variant*/\n        e[8] === \"center\"\n      ), pe(\n        n,\n        \"meta-text\",\n        /*variant*/\n        e[8] === \"default\"\n      );\n    },\n    m(b, p) {\n      f && f.m(b, p), H(b, t, p), H(b, n, p), h && h.m(n, null), it(n, r), d && d.m(n, null), H(b, i, p), ~o && v[o].m(b, p), H(b, a, p), k && k.m(b, p), H(b, s, p), u = !0;\n    },\n    p(b, p) {\n      /*variant*/\n      b[8] === \"default\" && /*show_eta_bar*/\n      b[18] && /*show_progress*/\n      b[6] === \"full\" ? f ? f.p(b, p) : (f = ro(b), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), _ === (_ = c(b)) && h ? h.p(b, p) : (h && h.d(1), h = _ && _(b), h && (h.c(), h.m(n, r))), /*timer*/\n      b[5] ? d ? d.p(b, p) : (d = lo(b), d.c(), d.m(n, null)) : d && (d.d(1), d = null), (!u || p[0] & /*variant*/\n      256) && pe(\n        n,\n        \"meta-text-center\",\n        /*variant*/\n        b[8] === \"center\"\n      ), (!u || p[0] & /*variant*/\n      256) && pe(\n        n,\n        \"meta-text\",\n        /*variant*/\n        b[8] === \"default\"\n      );\n      let P = o;\n      o = y(b), o === P ? ~o && v[o].p(b, p) : (l && (Tl(), Pt(v[P], 1, 1, () => {\n        v[P] = null;\n      }), Sl()), ~o ? (l = v[o], l ? l.p(b, p) : (l = v[o] = m[o](b), l.c()), Nt(l, 1), l.m(a.parentNode, a)) : l = null), /*timer*/\n      b[5] ? k && (k.d(1), k = null) : k ? k.p(b, p) : (k = ho(b), k.c(), k.m(s.parentNode, s));\n    },\n    i(b) {\n      u || (Nt(l), u = !0);\n    },\n    o(b) {\n      Pt(l), u = !1;\n    },\n    d(b) {\n      b && (C(t), C(n), C(i), C(a), C(s)), f && f.d(b), h && h.d(), d && d.d(), ~o && v[o].d(b), k && k.d(b);\n    }\n  };\n}\nfunction ro(e) {\n  let t, n = `translateX(${/*eta_level*/\n  (e[17] || 0) * 100 - 100}%)`;\n  return {\n    c() {\n      t = Fe(\"div\"), Ie(t, \"class\", \"eta-bar svelte-1txqlrd\"), Xe(t, \"transform\", n);\n    },\n    m(r, i) {\n      H(r, t, i);\n    },\n    p(r, i) {\n      i[0] & /*eta_level*/\n      131072 && n !== (n = `translateX(${/*eta_level*/\n      (r[17] || 0) * 100 - 100}%)`) && Xe(t, \"transform\", n);\n    },\n    d(r) {\n      r && C(t);\n    }\n  };\n}\nfunction u_(e) {\n  let t;\n  return {\n    c() {\n      t = X(\"processing |\");\n    },\n    m(n, r) {\n      H(n, t, r);\n    },\n    p: Ur,\n    d(n) {\n      n && C(t);\n    }\n  };\n}\nfunction f_(e) {\n  let t, n = (\n    /*queue_position*/\n    e[2] + 1 + \"\"\n  ), r, i, o, l;\n  return {\n    c() {\n      t = X(\"queue: \"), r = X(n), i = X(\"/\"), o = X(\n        /*queue_size*/\n        e[3]\n      ), l = X(\" |\");\n    },\n    m(a, s) {\n      H(a, t, s), H(a, r, s), H(a, i, s), H(a, o, s), H(a, l, s);\n    },\n    p(a, s) {\n      s[0] & /*queue_position*/\n      4 && n !== (n = /*queue_position*/\n      a[2] + 1 + \"\") && we(r, n), s[0] & /*queue_size*/\n      8 && we(\n        o,\n        /*queue_size*/\n        a[3]\n      );\n    },\n    d(a) {\n      a && (C(t), C(r), C(i), C(o), C(l));\n    }\n  };\n}\nfunction c_(e) {\n  let t, n = Tn(\n    /*progress*/\n    e[7]\n  ), r = [];\n  for (let i = 0; i < n.length; i += 1)\n    r[i] = oo(no(e, n, i));\n  return {\n    c() {\n      for (let i = 0; i < r.length; i += 1)\n        r[i].c();\n      t = Ot();\n    },\n    m(i, o) {\n      for (let l = 0; l < r.length; l += 1)\n        r[l] && r[l].m(i, o);\n      H(i, t, o);\n    },\n    p(i, o) {\n      if (o[0] & /*progress*/\n      128) {\n        n = Tn(\n          /*progress*/\n          i[7]\n        );\n        let l;\n        for (l = 0; l < n.length; l += 1) {\n          const a = no(i, n, l);\n          r[l] ? r[l].p(a, o) : (r[l] = oo(a), r[l].c(), r[l].m(t.parentNode, t));\n        }\n        for (; l < r.length; l += 1)\n          r[l].d(1);\n        r.length = n.length;\n      }\n    },\n    d(i) {\n      i && C(t), kl(r, i);\n    }\n  };\n}\nfunction io(e) {\n  let t, n = (\n    /*p*/\n    e[38].unit + \"\"\n  ), r, i, o = \" \", l;\n  function a(f, c) {\n    return (\n      /*p*/\n      f[38].length != null ? h_ : __\n    );\n  }\n  let s = a(e), u = s(e);\n  return {\n    c() {\n      u.c(), t = Le(), r = X(n), i = X(\" | \"), l = X(o);\n    },\n    m(f, c) {\n      u.m(f, c), H(f, t, c), H(f, r, c), H(f, i, c), H(f, l, c);\n    },\n    p(f, c) {\n      s === (s = a(f)) && u ? u.p(f, c) : (u.d(1), u = s(f), u && (u.c(), u.m(t.parentNode, t))), c[0] & /*progress*/\n      128 && n !== (n = /*p*/\n      f[38].unit + \"\") && we(r, n);\n    },\n    d(f) {\n      f && (C(t), C(r), C(i), C(l)), u.d(f);\n    }\n  };\n}\nfunction __(e) {\n  let t = St(\n    /*p*/\n    e[38].index || 0\n  ) + \"\", n;\n  return {\n    c() {\n      n = X(t);\n    },\n    m(r, i) {\n      H(r, n, i);\n    },\n    p(r, i) {\n      i[0] & /*progress*/\n      128 && t !== (t = St(\n        /*p*/\n        r[38].index || 0\n      ) + \"\") && we(n, t);\n    },\n    d(r) {\n      r && C(n);\n    }\n  };\n}\nfunction h_(e) {\n  let t = St(\n    /*p*/\n    e[38].index || 0\n  ) + \"\", n, r, i = St(\n    /*p*/\n    e[38].length\n  ) + \"\", o;\n  return {\n    c() {\n      n = X(t), r = X(\"/\"), o = X(i);\n    },\n    m(l, a) {\n      H(l, n, a), H(l, r, a), H(l, o, a);\n    },\n    p(l, a) {\n      a[0] & /*progress*/\n      128 && t !== (t = St(\n        /*p*/\n        l[38].index || 0\n      ) + \"\") && we(n, t), a[0] & /*progress*/\n      128 && i !== (i = St(\n        /*p*/\n        l[38].length\n      ) + \"\") && we(o, i);\n    },\n    d(l) {\n      l && (C(n), C(r), C(o));\n    }\n  };\n}\nfunction oo(e) {\n  let t, n = (\n    /*p*/\n    e[38].index != null && io(e)\n  );\n  return {\n    c() {\n      n && n.c(), t = Ot();\n    },\n    m(r, i) {\n      n && n.m(r, i), H(r, t, i);\n    },\n    p(r, i) {\n      /*p*/\n      r[38].index != null ? n ? n.p(r, i) : (n = io(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);\n    },\n    d(r) {\n      r && C(t), n && n.d(r);\n    }\n  };\n}\nfunction lo(e) {\n  let t, n = (\n    /*eta*/\n    e[0] ? `/${/*formatted_eta*/\n    e[19]}` : \"\"\n  ), r, i;\n  return {\n    c() {\n      t = X(\n        /*formatted_timer*/\n        e[20]\n      ), r = X(n), i = X(\"s\");\n    },\n    m(o, l) {\n      H(o, t, l), H(o, r, l), H(o, i, l);\n    },\n    p(o, l) {\n      l[0] & /*formatted_timer*/\n      1048576 && we(\n        t,\n        /*formatted_timer*/\n        o[20]\n      ), l[0] & /*eta, formatted_eta*/\n      524289 && n !== (n = /*eta*/\n      o[0] ? `/${/*formatted_eta*/\n      o[19]}` : \"\") && we(r, n);\n    },\n    d(o) {\n      o && (C(t), C(r), C(i));\n    }\n  };\n}\nfunction d_(e) {\n  let t, n;\n  return t = new W0({\n    props: { margin: (\n      /*variant*/\n      e[8] === \"default\"\n    ) }\n  }), {\n    c() {\n      J0(t.$$.fragment);\n    },\n    m(r, i) {\n      t_(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i[0] & /*variant*/\n      256 && (o.margin = /*variant*/\n      r[8] === \"default\"), t.$set(o);\n    },\n    i(r) {\n      n || (Nt(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      Pt(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Y0(t, r);\n    }\n  };\n}\nfunction m_(e) {\n  let t, n, r, i, o, l = `${/*last_progress_level*/\n  e[15] * 100}%`, a = (\n    /*progress*/\n    e[7] != null && so(e)\n  );\n  return {\n    c() {\n      t = Fe(\"div\"), n = Fe(\"div\"), a && a.c(), r = Le(), i = Fe(\"div\"), o = Fe(\"div\"), Ie(n, \"class\", \"progress-level-inner svelte-1txqlrd\"), Ie(o, \"class\", \"progress-bar svelte-1txqlrd\"), Xe(o, \"width\", l), Ie(i, \"class\", \"progress-bar-wrap svelte-1txqlrd\"), Ie(t, \"class\", \"progress-level svelte-1txqlrd\");\n    },\n    m(s, u) {\n      H(s, t, u), it(t, n), a && a.m(n, null), it(t, r), it(t, i), it(i, o), e[30](o);\n    },\n    p(s, u) {\n      /*progress*/\n      s[7] != null ? a ? a.p(s, u) : (a = so(s), a.c(), a.m(n, null)) : a && (a.d(1), a = null), u[0] & /*last_progress_level*/\n      32768 && l !== (l = `${/*last_progress_level*/\n      s[15] * 100}%`) && Xe(o, \"width\", l);\n    },\n    i: Ur,\n    o: Ur,\n    d(s) {\n      s && C(t), a && a.d(), e[30](null);\n    }\n  };\n}\nfunction so(e) {\n  let t, n = Tn(\n    /*progress*/\n    e[7]\n  ), r = [];\n  for (let i = 0; i < n.length; i += 1)\n    r[i] = _o(to(e, n, i));\n  return {\n    c() {\n      for (let i = 0; i < r.length; i += 1)\n        r[i].c();\n      t = Ot();\n    },\n    m(i, o) {\n      for (let l = 0; l < r.length; l += 1)\n        r[l] && r[l].m(i, o);\n      H(i, t, o);\n    },\n    p(i, o) {\n      if (o[0] & /*progress_level, progress*/\n      16512) {\n        n = Tn(\n          /*progress*/\n          i[7]\n        );\n        let l;\n        for (l = 0; l < n.length; l += 1) {\n          const a = to(i, n, l);\n          r[l] ? r[l].p(a, o) : (r[l] = _o(a), r[l].c(), r[l].m(t.parentNode, t));\n        }\n        for (; l < r.length; l += 1)\n          r[l].d(1);\n        r.length = n.length;\n      }\n    },\n    d(i) {\n      i && C(t), kl(r, i);\n    }\n  };\n}\nfunction ao(e) {\n  let t, n, r, i, o = (\n    /*i*/\n    e[40] !== 0 && p_()\n  ), l = (\n    /*p*/\n    e[38].desc != null && uo(e)\n  ), a = (\n    /*p*/\n    e[38].desc != null && /*progress_level*/\n    e[14] && /*progress_level*/\n    e[14][\n      /*i*/\n      e[40]\n    ] != null && fo()\n  ), s = (\n    /*progress_level*/\n    e[14] != null && co(e)\n  );\n  return {\n    c() {\n      o && o.c(), t = Le(), l && l.c(), n = Le(), a && a.c(), r = Le(), s && s.c(), i = Ot();\n    },\n    m(u, f) {\n      o && o.m(u, f), H(u, t, f), l && l.m(u, f), H(u, n, f), a && a.m(u, f), H(u, r, f), s && s.m(u, f), H(u, i, f);\n    },\n    p(u, f) {\n      /*p*/\n      u[38].desc != null ? l ? l.p(u, f) : (l = uo(u), l.c(), l.m(n.parentNode, n)) : l && (l.d(1), l = null), /*p*/\n      u[38].desc != null && /*progress_level*/\n      u[14] && /*progress_level*/\n      u[14][\n        /*i*/\n        u[40]\n      ] != null ? a || (a = fo(), a.c(), a.m(r.parentNode, r)) : a && (a.d(1), a = null), /*progress_level*/\n      u[14] != null ? s ? s.p(u, f) : (s = co(u), s.c(), s.m(i.parentNode, i)) : s && (s.d(1), s = null);\n    },\n    d(u) {\n      u && (C(t), C(n), C(r), C(i)), o && o.d(u), l && l.d(u), a && a.d(u), s && s.d(u);\n    }\n  };\n}\nfunction p_(e) {\n  let t;\n  return {\n    c() {\n      t = X(\" /\");\n    },\n    m(n, r) {\n      H(n, t, r);\n    },\n    d(n) {\n      n && C(t);\n    }\n  };\n}\nfunction uo(e) {\n  let t = (\n    /*p*/\n    e[38].desc + \"\"\n  ), n;\n  return {\n    c() {\n      n = X(t);\n    },\n    m(r, i) {\n      H(r, n, i);\n    },\n    p(r, i) {\n      i[0] & /*progress*/\n      128 && t !== (t = /*p*/\n      r[38].desc + \"\") && we(n, t);\n    },\n    d(r) {\n      r && C(n);\n    }\n  };\n}\nfunction fo(e) {\n  let t;\n  return {\n    c() {\n      t = X(\"-\");\n    },\n    m(n, r) {\n      H(n, t, r);\n    },\n    d(n) {\n      n && C(t);\n    }\n  };\n}\nfunction co(e) {\n  let t = (100 * /*progress_level*/\n  (e[14][\n    /*i*/\n    e[40]\n  ] || 0)).toFixed(1) + \"\", n, r;\n  return {\n    c() {\n      n = X(t), r = X(\"%\");\n    },\n    m(i, o) {\n      H(i, n, o), H(i, r, o);\n    },\n    p(i, o) {\n      o[0] & /*progress_level*/\n      16384 && t !== (t = (100 * /*progress_level*/\n      (i[14][\n        /*i*/\n        i[40]\n      ] || 0)).toFixed(1) + \"\") && we(n, t);\n    },\n    d(i) {\n      i && (C(n), C(r));\n    }\n  };\n}\nfunction _o(e) {\n  let t, n = (\n    /*p*/\n    (e[38].desc != null || /*progress_level*/\n    e[14] && /*progress_level*/\n    e[14][\n      /*i*/\n      e[40]\n    ] != null) && ao(e)\n  );\n  return {\n    c() {\n      n && n.c(), t = Ot();\n    },\n    m(r, i) {\n      n && n.m(r, i), H(r, t, i);\n    },\n    p(r, i) {\n      /*p*/\n      r[38].desc != null || /*progress_level*/\n      r[14] && /*progress_level*/\n      r[14][\n        /*i*/\n        r[40]\n      ] != null ? n ? n.p(r, i) : (n = ao(r), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);\n    },\n    d(r) {\n      r && C(t), n && n.d(r);\n    }\n  };\n}\nfunction ho(e) {\n  let t, n;\n  return {\n    c() {\n      t = Fe(\"p\"), n = X(\n        /*loading_text*/\n        e[9]\n      ), Ie(t, \"class\", \"loading svelte-1txqlrd\");\n    },\n    m(r, i) {\n      H(r, t, i), it(t, n);\n    },\n    p(r, i) {\n      i[0] & /*loading_text*/\n      512 && we(\n        n,\n        /*loading_text*/\n        r[9]\n      );\n    },\n    d(r) {\n      r && C(t);\n    }\n  };\n}\nfunction g_(e) {\n  let t, n, r, i, o;\n  const l = [a_, s_], a = [];\n  function s(u, f) {\n    return (\n      /*status*/\n      u[4] === \"pending\" ? 0 : (\n        /*status*/\n        u[4] === \"error\" ? 1 : -1\n      )\n    );\n  }\n  return ~(n = s(e)) && (r = a[n] = l[n](e)), {\n    c() {\n      t = Fe(\"div\"), r && r.c(), Ie(t, \"class\", i = \"wrap \" + /*variant*/\n      e[8] + \" \" + /*show_progress*/\n      e[6] + \" svelte-1txqlrd\"), pe(t, \"hide\", !/*status*/\n      e[4] || /*status*/\n      e[4] === \"complete\" || /*show_progress*/\n      e[6] === \"hidden\"), pe(\n        t,\n        \"translucent\",\n        /*variant*/\n        e[8] === \"center\" && /*status*/\n        (e[4] === \"pending\" || /*status*/\n        e[4] === \"error\") || /*translucent*/\n        e[11] || /*show_progress*/\n        e[6] === \"minimal\"\n      ), pe(\n        t,\n        \"generating\",\n        /*status*/\n        e[4] === \"generating\"\n      ), pe(\n        t,\n        \"border\",\n        /*border*/\n        e[12]\n      ), Xe(\n        t,\n        \"position\",\n        /*absolute*/\n        e[10] ? \"absolute\" : \"static\"\n      ), Xe(\n        t,\n        \"padding\",\n        /*absolute*/\n        e[10] ? \"0\" : \"var(--size-8) 0\"\n      );\n    },\n    m(u, f) {\n      H(u, t, f), ~n && a[n].m(t, null), e[31](t), o = !0;\n    },\n    p(u, f) {\n      let c = n;\n      n = s(u), n === c ? ~n && a[n].p(u, f) : (r && (Tl(), Pt(a[c], 1, 1, () => {\n        a[c] = null;\n      }), Sl()), ~n ? (r = a[n], r ? r.p(u, f) : (r = a[n] = l[n](u), r.c()), Nt(r, 1), r.m(t, null)) : r = null), (!o || f[0] & /*variant, show_progress*/\n      320 && i !== (i = \"wrap \" + /*variant*/\n      u[8] + \" \" + /*show_progress*/\n      u[6] + \" svelte-1txqlrd\")) && Ie(t, \"class\", i), (!o || f[0] & /*variant, show_progress, status, show_progress*/\n      336) && pe(t, \"hide\", !/*status*/\n      u[4] || /*status*/\n      u[4] === \"complete\" || /*show_progress*/\n      u[6] === \"hidden\"), (!o || f[0] & /*variant, show_progress, variant, status, translucent, show_progress*/\n      2384) && pe(\n        t,\n        \"translucent\",\n        /*variant*/\n        u[8] === \"center\" && /*status*/\n        (u[4] === \"pending\" || /*status*/\n        u[4] === \"error\") || /*translucent*/\n        u[11] || /*show_progress*/\n        u[6] === \"minimal\"\n      ), (!o || f[0] & /*variant, show_progress, status*/\n      336) && pe(\n        t,\n        \"generating\",\n        /*status*/\n        u[4] === \"generating\"\n      ), (!o || f[0] & /*variant, show_progress, border*/\n      4416) && pe(\n        t,\n        \"border\",\n        /*border*/\n        u[12]\n      ), f[0] & /*absolute*/\n      1024 && Xe(\n        t,\n        \"position\",\n        /*absolute*/\n        u[10] ? \"absolute\" : \"static\"\n      ), f[0] & /*absolute*/\n      1024 && Xe(\n        t,\n        \"padding\",\n        /*absolute*/\n        u[10] ? \"0\" : \"var(--size-8) 0\"\n      );\n    },\n    i(u) {\n      o || (Nt(r), o = !0);\n    },\n    o(u) {\n      Pt(r), o = !1;\n    },\n    d(u) {\n      u && C(t), ~n && a[n].d(), e[31](null);\n    }\n  };\n}\nlet un = [], pr = !1;\nasync function b_(e, t = !0) {\n  if (!(window.__gradio_mode__ === \"website\" || window.__gradio_mode__ !== \"app\" && t !== !0)) {\n    if (un.push(e), !pr)\n      pr = !0;\n    else\n      return;\n    await i_(), requestAnimationFrame(() => {\n      let n = [0, 0];\n      for (let r = 0; r < un.length; r++) {\n        const o = un[r].getBoundingClientRect();\n        (r === 0 || o.top + window.scrollY <= n[0]) && (n[0] = o.top + window.scrollY, n[1] = r);\n      }\n      window.scrollTo({ top: n[0] - 20, behavior: \"smooth\" }), pr = !1, un = [];\n    });\n  }\n}\nfunction v_(e, t, n) {\n  let r, { $$slots: i = {}, $$scope: o } = t, { i18n: l } = t, { eta: a = null } = t, { queue_position: s } = t, { queue_size: u } = t, { status: f } = t, { scroll_to_output: c = !1 } = t, { timer: _ = !0 } = t, { show_progress: h = \"full\" } = t, { message: d = null } = t, { progress: m = null } = t, { variant: v = \"default\" } = t, { loading_text: y = \"Loading...\" } = t, { absolute: k = !0 } = t, { translucent: b = !1 } = t, { border: p = !1 } = t, { autoscroll: P } = t, S, A = !1, I = 0, Q = 0, T = null, ye = null, Ne = 0, Ee = null, Re, se = null, pt = !0;\n  const We = () => {\n    n(0, a = n(26, T = n(19, B = null))), n(24, I = performance.now()), n(25, Q = 0), A = !0, gt();\n  };\n  function gt() {\n    requestAnimationFrame(() => {\n      n(25, Q = (performance.now() - I) / 1e3), A && gt();\n    });\n  }\n  function Ze() {\n    n(25, Q = 0), n(0, a = n(26, T = n(19, B = null))), A && (A = !1);\n  }\n  o_(() => {\n    A && Ze();\n  });\n  let B = null;\n  function w(g) {\n    $i[g ? \"unshift\" : \"push\"](() => {\n      se = g, n(16, se), n(7, m), n(14, Ee), n(15, Re);\n    });\n  }\n  function M(g) {\n    $i[g ? \"unshift\" : \"push\"](() => {\n      S = g, n(13, S);\n    });\n  }\n  return e.$$set = (g) => {\n    \"i18n\" in g && n(1, l = g.i18n), \"eta\" in g && n(0, a = g.eta), \"queue_position\" in g && n(2, s = g.queue_position), \"queue_size\" in g && n(3, u = g.queue_size), \"status\" in g && n(4, f = g.status), \"scroll_to_output\" in g && n(21, c = g.scroll_to_output), \"timer\" in g && n(5, _ = g.timer), \"show_progress\" in g && n(6, h = g.show_progress), \"message\" in g && n(22, d = g.message), \"progress\" in g && n(7, m = g.progress), \"variant\" in g && n(8, v = g.variant), \"loading_text\" in g && n(9, y = g.loading_text), \"absolute\" in g && n(10, k = g.absolute), \"translucent\" in g && n(11, b = g.translucent), \"border\" in g && n(12, p = g.border), \"autoscroll\" in g && n(23, P = g.autoscroll), \"$$scope\" in g && n(28, o = g.$$scope);\n  }, e.$$.update = () => {\n    e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/\n    218103809 && (a === null && n(0, a = T), a != null && T !== a && (n(27, ye = (performance.now() - I) / 1e3 + a), n(19, B = ye.toFixed(1)), n(26, T = a))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/\n    167772160 && n(17, Ne = ye === null || ye <= 0 || !Q ? null : Math.min(Q / ye, 1)), e.$$.dirty[0] & /*progress*/\n    128 && m != null && n(18, pt = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/\n    114816 && (m != null ? n(14, Ee = m.map((g) => {\n      if (g.index != null && g.length != null)\n        return g.index / g.length;\n      if (g.progress != null)\n        return g.progress;\n    })) : n(14, Ee = null), Ee ? (n(15, Re = Ee[Ee.length - 1]), se && (Re === 0 ? n(16, se.style.transition = \"0\", se) : n(16, se.style.transition = \"150ms\", se))) : n(15, Re = void 0)), e.$$.dirty[0] & /*status*/\n    16 && (f === \"pending\" ? We() : Ze()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/\n    10493968 && S && c && (f === \"pending\" || f === \"complete\") && b_(S, P), e.$$.dirty[0] & /*status, message*/\n    4194320, e.$$.dirty[0] & /*timer_diff*/\n    33554432 && n(20, r = Q.toFixed(1));\n  }, [\n    a,\n    l,\n    s,\n    u,\n    f,\n    _,\n    h,\n    m,\n    v,\n    y,\n    k,\n    b,\n    p,\n    S,\n    Ee,\n    Re,\n    se,\n    Ne,\n    pt,\n    B,\n    r,\n    c,\n    d,\n    P,\n    I,\n    Q,\n    T,\n    ye,\n    o,\n    i,\n    w,\n    M\n  ];\n}\nclass Al extends Z0 {\n  constructor(t) {\n    super(), e_(\n      this,\n      t,\n      v_,\n      g_,\n      n_,\n      {\n        i18n: 1,\n        eta: 0,\n        queue_position: 2,\n        queue_size: 3,\n        status: 4,\n        scroll_to_output: 21,\n        timer: 5,\n        show_progress: 6,\n        message: 22,\n        progress: 7,\n        variant: 8,\n        loading_text: 9,\n        absolute: 10,\n        translucent: 11,\n        border: 12,\n        autoscroll: 23\n      },\n      null,\n      [-1, -1]\n    );\n  }\n}\nconst {\n  SvelteComponent: w_,\n  append: y_,\n  attr: E_,\n  detach: S_,\n  element: k_,\n  init: T_,\n  insert: A_,\n  noop: mo,\n  safe_not_equal: B_,\n  set_data: C_,\n  text: H_,\n  toggle_class: yt\n} = window.__gradio__svelte__internal;\nfunction N_(e) {\n  let t, n = (\n    /*value*/\n    (e[0] ? (\n      /*value*/\n      e[0]\n    ) : \"\") + \"\"\n  ), r;\n  return {\n    c() {\n      t = k_(\"div\"), r = H_(n), E_(t, \"class\", \"svelte-1gecy8w\"), yt(\n        t,\n        \"table\",\n        /*type*/\n        e[1] === \"table\"\n      ), yt(\n        t,\n        \"gallery\",\n        /*type*/\n        e[1] === \"gallery\"\n      ), yt(\n        t,\n        \"selected\",\n        /*selected*/\n        e[2]\n      );\n    },\n    m(i, o) {\n      A_(i, t, o), y_(t, r);\n    },\n    p(i, [o]) {\n      o & /*value*/\n      1 && n !== (n = /*value*/\n      (i[0] ? (\n        /*value*/\n        i[0]\n      ) : \"\") + \"\") && C_(r, n), o & /*type*/\n      2 && yt(\n        t,\n        \"table\",\n        /*type*/\n        i[1] === \"table\"\n      ), o & /*type*/\n      2 && yt(\n        t,\n        \"gallery\",\n        /*type*/\n        i[1] === \"gallery\"\n      ), o & /*selected*/\n      4 && yt(\n        t,\n        \"selected\",\n        /*selected*/\n        i[2]\n      );\n    },\n    i: mo,\n    o: mo,\n    d(i) {\n      i && S_(t);\n    }\n  };\n}\nfunction P_(e, t, n) {\n  let { value: r } = t, { type: i } = t, { selected: o = !1 } = t;\n  return e.$$set = (l) => {\n    \"value\" in l && n(0, r = l.value), \"type\" in l && n(1, i = l.type), \"selected\" in l && n(2, o = l.selected);\n  }, [r, i, o];\n}\nclass $_ extends w_ {\n  constructor(t) {\n    super(), T_(this, t, P_, N_, B_, { value: 0, type: 1, selected: 2 });\n  }\n}\nconst {\n  SvelteComponent: I_,\n  assign: Bl,\n  check_outros: Cl,\n  create_component: Oe,\n  destroy_component: Me,\n  detach: xt,\n  empty: Hl,\n  get_spread_object: Nl,\n  get_spread_update: Pl,\n  group_outros: Il,\n  init: L_,\n  insert: Wt,\n  mount_component: De,\n  safe_not_equal: O_,\n  space: Yr,\n  transition_in: oe,\n  transition_out: le\n} = window.__gradio__svelte__internal;\nfunction M_(e) {\n  let t, n;\n  return t = new bo({\n    props: {\n      visible: (\n        /*visible*/\n        e[3]\n      ),\n      variant: (\n        /*value*/\n        e[0] === null ? \"dashed\" : \"solid\"\n      ),\n      border_mode: (\n        /*dragging*/\n        e[17] ? \"focus\" : \"base\"\n      ),\n      padding: !1,\n      elem_id: (\n        /*elem_id*/\n        e[1]\n      ),\n      elem_classes: (\n        /*elem_classes*/\n        e[2]\n      ),\n      container: (\n        /*container*/\n        e[9]\n      ),\n      scale: (\n        /*scale*/\n        e[10]\n      ),\n      min_width: (\n        /*min_width*/\n        e[11]\n      ),\n      height: (\n        /*height*/\n        e[13]\n      ),\n      $$slots: { default: [U_] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      De(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*visible*/\n      8 && (o.visible = /*visible*/\n      r[3]), i & /*value*/\n      1 && (o.variant = /*value*/\n      r[0] === null ? \"dashed\" : \"solid\"), i & /*dragging*/\n      131072 && (o.border_mode = /*dragging*/\n      r[17] ? \"focus\" : \"base\"), i & /*elem_id*/\n      2 && (o.elem_id = /*elem_id*/\n      r[1]), i & /*elem_classes*/\n      4 && (o.elem_classes = /*elem_classes*/\n      r[2]), i & /*container*/\n      512 && (o.container = /*container*/\n      r[9]), i & /*scale*/\n      1024 && (o.scale = /*scale*/\n      r[10]), i & /*min_width*/\n      2048 && (o.min_width = /*min_width*/\n      r[11]), i & /*height*/\n      8192 && (o.height = /*height*/\n      r[13]), i & /*$$scope, label, show_label, root, clear_color, value, camera_position, zoom_speed, gradio, dragging, loading_status*/\n      8573425 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      le(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Me(t, r);\n    }\n  };\n}\nfunction D_(e) {\n  let t, n;\n  return t = new bo({\n    props: {\n      visible: (\n        /*visible*/\n        e[3]\n      ),\n      variant: (\n        /*value*/\n        e[0] === null ? \"dashed\" : \"solid\"\n      ),\n      border_mode: (\n        /*dragging*/\n        e[17] ? \"focus\" : \"base\"\n      ),\n      padding: !1,\n      elem_id: (\n        /*elem_id*/\n        e[1]\n      ),\n      elem_classes: (\n        /*elem_classes*/\n        e[2]\n      ),\n      container: (\n        /*container*/\n        e[9]\n      ),\n      scale: (\n        /*scale*/\n        e[10]\n      ),\n      min_width: (\n        /*min_width*/\n        e[11]\n      ),\n      height: (\n        /*height*/\n        e[13]\n      ),\n      $$slots: { default: [j_] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      De(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*visible*/\n      8 && (o.visible = /*visible*/\n      r[3]), i & /*value*/\n      1 && (o.variant = /*value*/\n      r[0] === null ? \"dashed\" : \"solid\"), i & /*dragging*/\n      131072 && (o.border_mode = /*dragging*/\n      r[17] ? \"focus\" : \"base\"), i & /*elem_id*/\n      2 && (o.elem_id = /*elem_id*/\n      r[1]), i & /*elem_classes*/\n      4 && (o.elem_classes = /*elem_classes*/\n      r[2]), i & /*container*/\n      512 && (o.container = /*container*/\n      r[9]), i & /*scale*/\n      1024 && (o.scale = /*scale*/\n      r[10]), i & /*min_width*/\n      2048 && (o.min_width = /*min_width*/\n      r[11]), i & /*height*/\n      8192 && (o.height = /*height*/\n      r[13]), i & /*$$scope, value, gradio, clear_color, label, show_label, camera_position, zoom_speed, loading_status*/\n      8442337 && (o.$$scope = { dirty: i, ctx: r }), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      le(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Me(t, r);\n    }\n  };\n}\nfunction R_(e) {\n  let t, n;\n  return t = new Za({\n    props: {\n      i18n: (\n        /*gradio*/\n        e[12].i18n\n      ),\n      type: \"file\"\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      De(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*gradio*/\n      4096 && (o.i18n = /*gradio*/\n      r[12].i18n), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      le(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Me(t, r);\n    }\n  };\n}\nfunction U_(e) {\n  let t, n, r, i;\n  const o = [\n    {\n      autoscroll: (\n        /*gradio*/\n        e[12].autoscroll\n      )\n    },\n    { i18n: (\n      /*gradio*/\n      e[12].i18n\n    ) },\n    /*loading_status*/\n    e[6]\n  ];\n  let l = {};\n  for (let a = 0; a < o.length; a += 1)\n    l = Bl(l, o[a]);\n  return t = new Al({ props: l }), r = new R0({\n    props: {\n      label: (\n        /*label*/\n        e[7]\n      ),\n      show_label: (\n        /*show_label*/\n        e[8]\n      ),\n      root: (\n        /*root*/\n        e[4]\n      ),\n      clear_color: (\n        /*clear_color*/\n        e[5]\n      ),\n      value: (\n        /*value*/\n        e[0]\n      ),\n      camera_position: (\n        /*camera_position*/\n        e[15]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        e[14]\n      ),\n      i18n: (\n        /*gradio*/\n        e[12].i18n\n      ),\n      $$slots: { default: [R_] },\n      $$scope: { ctx: e }\n    }\n  }), r.$on(\n    \"change\",\n    /*change_handler*/\n    e[18]\n  ), r.$on(\n    \"drag\",\n    /*drag_handler*/\n    e[19]\n  ), r.$on(\n    \"change\",\n    /*change_handler_1*/\n    e[20]\n  ), r.$on(\n    \"clear\",\n    /*clear_handler*/\n    e[21]\n  ), r.$on(\n    \"load\",\n    /*load_handler*/\n    e[22]\n  ), {\n    c() {\n      Oe(t.$$.fragment), n = Yr(), Oe(r.$$.fragment);\n    },\n    m(a, s) {\n      De(t, a, s), Wt(a, n, s), De(r, a, s), i = !0;\n    },\n    p(a, s) {\n      const u = s & /*gradio, loading_status*/\n      4160 ? Pl(o, [\n        s & /*gradio*/\n        4096 && {\n          autoscroll: (\n            /*gradio*/\n            a[12].autoscroll\n          )\n        },\n        s & /*gradio*/\n        4096 && { i18n: (\n          /*gradio*/\n          a[12].i18n\n        ) },\n        s & /*loading_status*/\n        64 && Nl(\n          /*loading_status*/\n          a[6]\n        )\n      ]) : {};\n      t.$set(u);\n      const f = {};\n      s & /*label*/\n      128 && (f.label = /*label*/\n      a[7]), s & /*show_label*/\n      256 && (f.show_label = /*show_label*/\n      a[8]), s & /*root*/\n      16 && (f.root = /*root*/\n      a[4]), s & /*clear_color*/\n      32 && (f.clear_color = /*clear_color*/\n      a[5]), s & /*value*/\n      1 && (f.value = /*value*/\n      a[0]), s & /*camera_position*/\n      32768 && (f.camera_position = /*camera_position*/\n      a[15]), s & /*zoom_speed*/\n      16384 && (f.zoom_speed = /*zoom_speed*/\n      a[14]), s & /*gradio*/\n      4096 && (f.i18n = /*gradio*/\n      a[12].i18n), s & /*$$scope, gradio*/\n      8392704 && (f.$$scope = { dirty: s, ctx: a }), r.$set(f);\n    },\n    i(a) {\n      i || (oe(t.$$.fragment, a), oe(r.$$.fragment, a), i = !0);\n    },\n    o(a) {\n      le(t.$$.fragment, a), le(r.$$.fragment, a), i = !1;\n    },\n    d(a) {\n      a && xt(n), Me(t, a), Me(r, a);\n    }\n  };\n}\nfunction F_(e) {\n  let t, n, r, i;\n  return t = new Fr({\n    props: {\n      show_label: (\n        /*show_label*/\n        e[8]\n      ),\n      Icon: An,\n      label: (\n        /*label*/\n        e[7] || \"3D Model\"\n      )\n    }\n  }), r = new js({\n    props: {\n      unpadded_box: !0,\n      size: \"large\",\n      $$slots: { default: [q_] },\n      $$scope: { ctx: e }\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment), n = Yr(), Oe(r.$$.fragment);\n    },\n    m(o, l) {\n      De(t, o, l), Wt(o, n, l), De(r, o, l), i = !0;\n    },\n    p(o, l) {\n      const a = {};\n      l & /*show_label*/\n      256 && (a.show_label = /*show_label*/\n      o[8]), l & /*label*/\n      128 && (a.label = /*label*/\n      o[7] || \"3D Model\"), t.$set(a);\n      const s = {};\n      l & /*$$scope*/\n      8388608 && (s.$$scope = { dirty: l, ctx: o }), r.$set(s);\n    },\n    i(o) {\n      i || (oe(t.$$.fragment, o), oe(r.$$.fragment, o), i = !0);\n    },\n    o(o) {\n      le(t.$$.fragment, o), le(r.$$.fragment, o), i = !1;\n    },\n    d(o) {\n      o && xt(n), Me(t, o), Me(r, o);\n    }\n  };\n}\nfunction G_(e) {\n  let t, n;\n  return t = new iu({\n    props: {\n      value: (\n        /*value*/\n        e[0]\n      ),\n      i18n: (\n        /*gradio*/\n        e[12].i18n\n      ),\n      clear_color: (\n        /*clear_color*/\n        e[5]\n      ),\n      label: (\n        /*label*/\n        e[7]\n      ),\n      show_label: (\n        /*show_label*/\n        e[8]\n      ),\n      camera_position: (\n        /*camera_position*/\n        e[15]\n      ),\n      zoom_speed: (\n        /*zoom_speed*/\n        e[14]\n      )\n    }\n  }), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      De(t, r, i), n = !0;\n    },\n    p(r, i) {\n      const o = {};\n      i & /*value*/\n      1 && (o.value = /*value*/\n      r[0]), i & /*gradio*/\n      4096 && (o.i18n = /*gradio*/\n      r[12].i18n), i & /*clear_color*/\n      32 && (o.clear_color = /*clear_color*/\n      r[5]), i & /*label*/\n      128 && (o.label = /*label*/\n      r[7]), i & /*show_label*/\n      256 && (o.show_label = /*show_label*/\n      r[8]), i & /*camera_position*/\n      32768 && (o.camera_position = /*camera_position*/\n      r[15]), i & /*zoom_speed*/\n      16384 && (o.zoom_speed = /*zoom_speed*/\n      r[14]), t.$set(o);\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      le(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Me(t, r);\n    }\n  };\n}\nfunction q_(e) {\n  let t, n;\n  return t = new An({}), {\n    c() {\n      Oe(t.$$.fragment);\n    },\n    m(r, i) {\n      De(t, r, i), n = !0;\n    },\n    i(r) {\n      n || (oe(t.$$.fragment, r), n = !0);\n    },\n    o(r) {\n      le(t.$$.fragment, r), n = !1;\n    },\n    d(r) {\n      Me(t, r);\n    }\n  };\n}\nfunction j_(e) {\n  let t, n, r, i, o, l;\n  const a = [\n    {\n      autoscroll: (\n        /*gradio*/\n        e[12].autoscroll\n      )\n    },\n    { i18n: (\n      /*gradio*/\n      e[12].i18n\n    ) },\n    /*loading_status*/\n    e[6]\n  ];\n  let s = {};\n  for (let _ = 0; _ < a.length; _ += 1)\n    s = Bl(s, a[_]);\n  t = new Al({ props: s });\n  const u = [G_, F_], f = [];\n  function c(_, h) {\n    return (\n      /*value*/\n      _[0] ? 0 : 1\n    );\n  }\n  return r = c(e), i = f[r] = u[r](e), {\n    c() {\n      Oe(t.$$.fragment), n = Yr(), i.c(), o = Hl();\n    },\n    m(_, h) {\n      De(t, _, h), Wt(_, n, h), f[r].m(_, h), Wt(_, o, h), l = !0;\n    },\n    p(_, h) {\n      const d = h & /*gradio, loading_status*/\n      4160 ? Pl(a, [\n        h & /*gradio*/\n        4096 && {\n          autoscroll: (\n            /*gradio*/\n            _[12].autoscroll\n          )\n        },\n        h & /*gradio*/\n        4096 && { i18n: (\n          /*gradio*/\n          _[12].i18n\n        ) },\n        h & /*loading_status*/\n        64 && Nl(\n          /*loading_status*/\n          _[6]\n        )\n      ]) : {};\n      t.$set(d);\n      let m = r;\n      r = c(_), r === m ? f[r].p(_, h) : (Il(), le(f[m], 1, 1, () => {\n        f[m] = null;\n      }), Cl(), i = f[r], i ? i.p(_, h) : (i = f[r] = u[r](_), i.c()), oe(i, 1), i.m(o.parentNode, o));\n    },\n    i(_) {\n      l || (oe(t.$$.fragment, _), oe(i), l = !0);\n    },\n    o(_) {\n      le(t.$$.fragment, _), le(i), l = !1;\n    },\n    d(_) {\n      _ && (xt(n), xt(o)), Me(t, _), f[r].d(_);\n    }\n  };\n}\nfunction z_(e) {\n  let t, n, r, i;\n  const o = [D_, M_], l = [];\n  function a(s, u) {\n    return (\n      /*interactive*/\n      s[16] ? 1 : 0\n    );\n  }\n  return t = a(e), n = l[t] = o[t](e), {\n    c() {\n      n.c(), r = Hl();\n    },\n    m(s, u) {\n      l[t].m(s, u), Wt(s, r, u), i = !0;\n    },\n    p(s, [u]) {\n      let f = t;\n      t = a(s), t === f ? l[t].p(s, u) : (Il(), le(l[f], 1, 1, () => {\n        l[f] = null;\n      }), Cl(), n = l[t], n ? n.p(s, u) : (n = l[t] = o[t](s), n.c()), oe(n, 1), n.m(r.parentNode, r));\n    },\n    i(s) {\n      i || (oe(n), i = !0);\n    },\n    o(s) {\n      le(n), i = !1;\n    },\n    d(s) {\n      s && xt(r), l[t].d(s);\n    }\n  };\n}\nfunction V_(e, t, n) {\n  let { elem_id: r = \"\" } = t, { elem_classes: i = [] } = t, { visible: o = !0 } = t, { value: l = null } = t, { root: a } = t, { clear_color: s } = t, { loading_status: u } = t, { label: f } = t, { show_label: c } = t, { container: _ = !0 } = t, { scale: h = null } = t, { min_width: d = void 0 } = t, { gradio: m } = t, { height: v = void 0 } = t, { zoom_speed: y = 1 } = t, { camera_position: k = [null, null, null] } = t, { interactive: b } = t, p = !1;\n  const P = ({ detail: T }) => n(0, l = T), S = ({ detail: T }) => n(17, p = T), A = ({ detail: T }) => m.dispatch(\"change\", T), I = () => {\n    n(0, l = null), m.dispatch(\"clear\");\n  }, Q = ({ detail: T }) => {\n    n(0, l = T), m.dispatch(\"upload\");\n  };\n  return e.$$set = (T) => {\n    \"elem_id\" in T && n(1, r = T.elem_id), \"elem_classes\" in T && n(2, i = T.elem_classes), \"visible\" in T && n(3, o = T.visible), \"value\" in T && n(0, l = T.value), \"root\" in T && n(4, a = T.root), \"clear_color\" in T && n(5, s = T.clear_color), \"loading_status\" in T && n(6, u = T.loading_status), \"label\" in T && n(7, f = T.label), \"show_label\" in T && n(8, c = T.show_label), \"container\" in T && n(9, _ = T.container), \"scale\" in T && n(10, h = T.scale), \"min_width\" in T && n(11, d = T.min_width), \"gradio\" in T && n(12, m = T.gradio), \"height\" in T && n(13, v = T.height), \"zoom_speed\" in T && n(14, y = T.zoom_speed), \"camera_position\" in T && n(15, k = T.camera_position), \"interactive\" in T && n(16, b = T.interactive);\n  }, [\n    l,\n    r,\n    i,\n    o,\n    a,\n    s,\n    u,\n    f,\n    c,\n    _,\n    h,\n    d,\n    m,\n    v,\n    y,\n    k,\n    b,\n    p,\n    P,\n    S,\n    A,\n    I,\n    Q\n  ];\n}\nclass eh extends I_ {\n  constructor(t) {\n    super(), L_(this, t, V_, z_, O_, {\n      elem_id: 1,\n      elem_classes: 2,\n      visible: 3,\n      value: 0,\n      root: 4,\n      clear_color: 5,\n      loading_status: 6,\n      label: 7,\n      show_label: 8,\n      container: 9,\n      scale: 10,\n      min_width: 11,\n      gradio: 12,\n      height: 13,\n      zoom_speed: 14,\n      camera_position: 15,\n      interactive: 16\n    });\n  }\n}\nexport {\n  $_ as E,\n  eh as I,\n  R0 as M,\n  iu as a,\n  Q_ as c,\n  Tu as g,\n  K_ as r\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/__vite-browser-external-2447137e.js",
    "content": "const e = {};\nexport {\n  e as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/index.js",
    "content": "import { E as s, a as l, M as o, I as d } from \"./Index-0bb1de05.js\";\nexport {\n  s as BaseExample,\n  l as BaseModel3D,\n  o as BaseModel3DUpload,\n  d as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/style.css",
    "content": ".block.svelte-1t38q2d{position:relative;margin:0;box-shadow:var(--block-shadow);border-width:var(--block-border-width);border-color:var(--block-border-color);border-radius:var(--block-radius);background:var(--block-background-fill);width:100%;line-height:var(--line-sm)}.block.border_focus.svelte-1t38q2d{border-color:var(--color-accent)}.padded.svelte-1t38q2d{padding:var(--block-padding)}.hidden.svelte-1t38q2d{display:none}.hide-container.svelte-1t38q2d{margin:0;box-shadow:none;--block-border-width:0;background:transparent;padding:0;overflow:visible}div.svelte-1hnfib2{margin-bottom:var(--spacing-lg);color:var(--block-info-text-color);font-weight:var(--block-info-text-weight);font-size:var(--block-info-text-size);line-height:var(--line-sm)}span.has-info.svelte-22c38v{margin-bottom:var(--spacing-xs)}span.svelte-22c38v:not(.has-info){margin-bottom:var(--spacing-lg)}span.svelte-22c38v{display:inline-block;position:relative;z-index:var(--layer-4);border:solid var(--block-title-border-width) var(--block-title-border-color);border-radius:var(--block-title-radius);background:var(--block-title-background-fill);padding:var(--block-title-padding);color:var(--block-title-text-color);font-weight:var(--block-title-text-weight);font-size:var(--block-title-text-size);line-height:var(--line-sm)}.hide.svelte-22c38v{margin:0;height:0}label.svelte-9gxdi0{display:inline-flex;align-items:center;z-index:var(--layer-2);box-shadow:var(--block-label-shadow);border:var(--block-label-border-width) solid var(--border-color-primary);border-top:none;border-left:none;border-radius:var(--block-label-radius);background:var(--block-label-background-fill);padding:var(--block-label-padding);pointer-events:none;color:var(--block-label-text-color);font-weight:var(--block-label-text-weight);font-size:var(--block-label-text-size);line-height:var(--line-sm)}.gr-group label.svelte-9gxdi0{border-top-left-radius:0}label.float.svelte-9gxdi0{position:absolute;top:var(--block-label-margin);left:var(--block-label-margin)}label.svelte-9gxdi0:not(.float){position:static;margin-top:var(--block-label-margin);margin-left:var(--block-label-margin)}.hide.svelte-9gxdi0{height:0}span.svelte-9gxdi0{opacity:.8;margin-right:var(--size-2);width:calc(var(--block-label-text-size) - 1px);height:calc(var(--block-label-text-size) - 1px)}.hide-label.svelte-9gxdi0{box-shadow:none;border-width:0;background:transparent;overflow:visible}button.svelte-lpi64a{display:flex;justify-content:center;align-items:center;gap:1px;z-index:var(--layer-2);border-radius:var(--radius-sm);color:var(--block-label-text-color);border:1px solid transparent}button[disabled].svelte-lpi64a{opacity:.5;box-shadow:none}button[disabled].svelte-lpi64a:hover{cursor:not-allowed}.padded.svelte-lpi64a{padding:2px;background:var(--bg-color);box-shadow:var(--shadow-drop);border:1px solid var(--button-secondary-border-color)}button.svelte-lpi64a:hover,button.highlight.svelte-lpi64a{cursor:pointer;color:var(--color-accent)}.padded.svelte-lpi64a:hover{border:2px solid var(--button-secondary-border-color-hover);padding:1px;color:var(--block-label-text-color)}span.svelte-lpi64a{padding:0 1px;font-size:10px}div.svelte-lpi64a{padding:2px;display:flex;align-items:flex-end}.small.svelte-lpi64a{width:14px;height:14px}.large.svelte-lpi64a{width:22px;height:22px}.pending.svelte-lpi64a{animation:svelte-lpi64a-flash .5s infinite}@keyframes svelte-lpi64a-flash{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.transparent.svelte-lpi64a{background:transparent;border:none;box-shadow:none}.empty.svelte-3w3rth{display:flex;justify-content:center;align-items:center;margin-top:calc(0px - var(--size-6));height:var(--size-full)}.icon.svelte-3w3rth{opacity:.5;height:var(--size-5);color:var(--body-text-color)}.small.svelte-3w3rth{min-height:calc(var(--size-32) - 20px)}.large.svelte-3w3rth{min-height:calc(var(--size-64) - 20px)}.unpadded_box.svelte-3w3rth{margin-top:0}.small_parent.svelte-3w3rth{min-height:100%!important}.dropdown-arrow.svelte-145leq6{fill:currentColor}.wrap.svelte-kzcjhc{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:var(--size-60);color:var(--block-label-text-color);line-height:var(--line-md);height:100%;padding-top:var(--size-3)}.or.svelte-kzcjhc{color:var(--body-text-color-subdued);display:flex}.icon-wrap.svelte-kzcjhc{width:30px;margin-bottom:var(--spacing-lg)}@media (--screen-md){.wrap.svelte-kzcjhc{font-size:var(--text-lg)}}.hovered.svelte-kzcjhc{color:var(--color-accent)}div.svelte-ipfyu7{border-top:1px solid transparent;display:flex;max-height:100%;justify-content:center;gap:var(--spacing-sm);height:auto;align-items:flex-end;padding-bottom:var(--spacing-xl);color:var(--block-label-text-color);flex-shrink:0;width:95%}.show_border.svelte-ipfyu7{border-top:1px solid var(--block-border-color);margin-top:var(--spacing-xxl);box-shadow:var(--shadow-drop)}.source-selection.svelte-1jp3vgd{display:flex;align-items:center;justify-content:center;border-top:1px solid var(--border-color-primary);width:95%;bottom:0;left:0;right:0;margin-left:auto;margin-right:auto}.icon.svelte-1jp3vgd{width:22px;height:22px;margin:var(--spacing-lg) var(--spacing-xs);padding:var(--spacing-xs);color:var(--neutral-400);border-radius:var(--radius-md)}.selected.svelte-1jp3vgd{color:var(--color-accent)}.icon.svelte-1jp3vgd:hover,.icon.svelte-1jp3vgd:focus{color:var(--color-accent)}.model3D.svelte-14rtuon{display:flex;position:relative;width:var(--size-full);height:var(--size-full)}.model3D.svelte-14rtuon canvas{width:var(--size-full);height:var(--size-full);object-fit:contain;overflow:hidden}.buttons.svelte-14rtuon{display:flex;position:absolute;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-5)}.wrap.svelte-cr2edf.svelte-cr2edf{overflow-y:auto;transition:opacity .5s ease-in-out;background:var(--block-background-fill);position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:var(--size-40);width:var(--size-full)}.wrap.svelte-cr2edf.svelte-cr2edf:after{content:\"\";position:absolute;top:0;left:0;width:var(--upload-progress-width);height:100%;transition:all .5s ease-in-out;z-index:1}.uploading.svelte-cr2edf.svelte-cr2edf{font-size:var(--text-lg);font-family:var(--font);z-index:2}.file-name.svelte-cr2edf.svelte-cr2edf{margin:var(--spacing-md);font-size:var(--text-lg);color:var(--body-text-color-subdued)}.file.svelte-cr2edf.svelte-cr2edf{font-size:var(--text-md);z-index:2;display:flex;align-items:center}.file.svelte-cr2edf progress.svelte-cr2edf{display:inline;height:var(--size-1);width:100%;transition:all .5s ease-in-out;color:var(--color-accent);border:none}.file.svelte-cr2edf progress[value].svelte-cr2edf::-webkit-progress-value{background-color:var(--color-accent);border-radius:20px}.file.svelte-cr2edf progress[value].svelte-cr2edf::-webkit-progress-bar{background-color:var(--border-color-accent);border-radius:20px}.progress-bar.svelte-cr2edf.svelte-cr2edf{width:14px;height:14px;border-radius:50%;background:radial-gradient(closest-side,var(--block-background-fill) 64%,transparent 53% 100%),conic-gradient(var(--color-accent) var(--upload-progress-width),var(--border-color-accent) 0);transition:all .5s ease-in-out}button.svelte-1aq8tno{cursor:pointer;width:var(--size-full)}.hidden.svelte-1aq8tno{display:none;height:0!important;position:absolute;width:0;flex-grow:0}.center.svelte-1aq8tno{display:flex;justify-content:center}.flex.svelte-1aq8tno{display:flex;justify-content:center;align-items:center}input.svelte-1aq8tno{display:none}div.svelte-1wj0ocy{display:flex;top:var(--size-2);right:var(--size-2);justify-content:flex-end;gap:var(--spacing-sm);z-index:var(--layer-1)}.not-absolute.svelte-1wj0ocy{margin:var(--size-1)}.input-model.svelte-1oz8ks8{display:flex;position:relative;justify-content:center;align-items:center;width:var(--size-full);height:var(--size-full)}.input-model.svelte-1oz8ks8 canvas{width:var(--size-full);height:var(--size-full);object-fit:contain;overflow:hidden}svg.svelte-43sxxs.svelte-43sxxs{width:var(--size-20);height:var(--size-20)}svg.svelte-43sxxs path.svelte-43sxxs{fill:var(--loader-color)}div.svelte-43sxxs.svelte-43sxxs{z-index:var(--layer-2)}.margin.svelte-43sxxs.svelte-43sxxs{margin:var(--size-4)}.wrap.svelte-1txqlrd.svelte-1txqlrd{display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:var(--layer-top);transition:opacity .1s ease-in-out;border-radius:var(--block-radius);background:var(--block-background-fill);padding:0 var(--size-6);max-height:var(--size-screen-h);overflow:hidden;pointer-events:none}.wrap.center.svelte-1txqlrd.svelte-1txqlrd{top:0;right:0;left:0}.wrap.default.svelte-1txqlrd.svelte-1txqlrd{top:0;right:0;bottom:0;left:0}.hide.svelte-1txqlrd.svelte-1txqlrd{opacity:0;pointer-events:none}.generating.svelte-1txqlrd.svelte-1txqlrd{animation:svelte-1txqlrd-pulse 2s cubic-bezier(.4,0,.6,1) infinite;border:2px solid var(--color-accent);background:transparent}.translucent.svelte-1txqlrd.svelte-1txqlrd{background:none}@keyframes svelte-1txqlrd-pulse{0%,to{opacity:1}50%{opacity:.5}}.loading.svelte-1txqlrd.svelte-1txqlrd{z-index:var(--layer-2);color:var(--body-text-color)}.eta-bar.svelte-1txqlrd.svelte-1txqlrd{position:absolute;top:0;right:0;bottom:0;left:0;transform-origin:left;opacity:.8;z-index:var(--layer-1);transition:10ms;background:var(--background-fill-secondary)}.progress-bar-wrap.svelte-1txqlrd.svelte-1txqlrd{border:1px solid var(--border-color-primary);background:var(--background-fill-primary);width:55.5%;height:var(--size-4)}.progress-bar.svelte-1txqlrd.svelte-1txqlrd{transform-origin:left;background-color:var(--loader-color);width:var(--size-full);height:var(--size-full)}.progress-level.svelte-1txqlrd.svelte-1txqlrd{display:flex;flex-direction:column;align-items:center;gap:1;z-index:var(--layer-2);width:var(--size-full)}.progress-level-inner.svelte-1txqlrd.svelte-1txqlrd{margin:var(--size-2) auto;color:var(--body-text-color);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text.svelte-1txqlrd.svelte-1txqlrd{position:absolute;top:0;right:0;z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono)}.meta-text-center.svelte-1txqlrd.svelte-1txqlrd{display:flex;position:absolute;top:0;right:0;justify-content:center;align-items:center;transform:translateY(var(--size-6));z-index:var(--layer-2);padding:var(--size-1) var(--size-2);font-size:var(--text-sm);font-family:var(--font-mono);text-align:center}.error.svelte-1txqlrd.svelte-1txqlrd{box-shadow:var(--shadow-drop);border:solid 1px var(--error-border-color);border-radius:var(--radius-full);background:var(--error-background-fill);padding-right:var(--size-4);padding-left:var(--size-4);color:var(--error-text-color);font-weight:var(--weight-semibold);font-size:var(--text-lg);line-height:var(--line-lg);font-family:var(--font)}.minimal.svelte-1txqlrd .progress-text.svelte-1txqlrd{background:var(--block-background-fill)}.border.svelte-1txqlrd.svelte-1txqlrd{border:1px solid var(--border-color-primary)}.toast-body.svelte-solcu7{display:flex;position:relative;right:0;left:0;align-items:center;margin:var(--size-6) var(--size-4);margin:auto;border-radius:var(--container-radius);overflow:hidden;pointer-events:auto}.toast-body.error.svelte-solcu7{border:1px solid var(--color-red-700);background:var(--color-red-50)}.dark .toast-body.error.svelte-solcu7{border:1px solid var(--color-red-500);background-color:var(--color-grey-950)}.toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-700);background:var(--color-yellow-50)}.dark .toast-body.warning.svelte-solcu7{border:1px solid var(--color-yellow-500);background-color:var(--color-grey-950)}.toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-700);background:var(--color-grey-50)}.dark .toast-body.info.svelte-solcu7{border:1px solid var(--color-grey-500);background-color:var(--color-grey-950)}.toast-title.svelte-solcu7{display:flex;align-items:center;font-weight:var(--weight-bold);font-size:var(--text-lg);line-height:var(--line-sm);text-transform:capitalize}.toast-title.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-title.error.svelte-solcu7{color:var(--color-red-50)}.toast-title.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-title.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-title.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-title.info.svelte-solcu7{color:var(--color-grey-50)}.toast-close.svelte-solcu7{margin:0 var(--size-3);border-radius:var(--size-3);padding:0px var(--size-1-5);font-size:var(--size-5);line-height:var(--size-5)}.toast-close.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-close.error.svelte-solcu7{color:var(--color-red-500)}.toast-close.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-close.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-close.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-close.info.svelte-solcu7{color:var(--color-grey-500)}.toast-text.svelte-solcu7{font-size:var(--text-lg)}.toast-text.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-text.error.svelte-solcu7{color:var(--color-red-50)}.toast-text.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-text.warning.svelte-solcu7{color:var(--color-yellow-50)}.toast-text.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-text.info.svelte-solcu7{color:var(--color-grey-50)}.toast-details.svelte-solcu7{margin:var(--size-3) var(--size-3) var(--size-3) 0;width:100%}.toast-icon.svelte-solcu7{display:flex;position:absolute;position:relative;flex-shrink:0;justify-content:center;align-items:center;margin:var(--size-2);border-radius:var(--radius-full);padding:var(--size-1);padding-left:calc(var(--size-1) - 1px);width:35px;height:35px}.toast-icon.error.svelte-solcu7{color:var(--color-red-700)}.dark .toast-icon.error.svelte-solcu7{color:var(--color-red-500)}.toast-icon.warning.svelte-solcu7{color:var(--color-yellow-700)}.dark .toast-icon.warning.svelte-solcu7{color:var(--color-yellow-500)}.toast-icon.info.svelte-solcu7{color:var(--color-grey-700)}.dark .toast-icon.info.svelte-solcu7{color:var(--color-grey-500)}@keyframes svelte-solcu7-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.timer.svelte-solcu7{position:absolute;bottom:0;left:0;transform-origin:0 0;animation:svelte-solcu7-countdown 10s linear forwards;width:100%;height:var(--size-1)}.timer.error.svelte-solcu7{background:var(--color-red-700)}.dark .timer.error.svelte-solcu7{background:var(--color-red-500)}.timer.warning.svelte-solcu7{background:var(--color-yellow-700)}.dark .timer.warning.svelte-solcu7{background:var(--color-yellow-500)}.timer.info.svelte-solcu7{background:var(--color-grey-700)}.dark .timer.info.svelte-solcu7{background:var(--color-grey-500)}.toast-wrap.svelte-gatr8h{display:flex;position:fixed;top:var(--size-4);right:var(--size-4);flex-direction:column;align-items:end;gap:var(--size-2);z-index:var(--layer-top);width:calc(100% - var(--size-8))}@media (--screen-sm){.toast-wrap.svelte-gatr8h{width:calc(var(--size-96) + var(--size-10))}}.gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/component/wrapper-6f348d45-f837cf34.js",
    "content": "import S from \"./__vite-browser-external-2447137e.js\";\nfunction z(s) {\n  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, \"default\") ? s.default : s;\n}\nfunction gt(s) {\n  if (s.__esModule)\n    return s;\n  var e = s.default;\n  if (typeof e == \"function\") {\n    var t = function r() {\n      if (this instanceof r) {\n        var i = [null];\n        i.push.apply(i, arguments);\n        var n = Function.bind.apply(e, i);\n        return new n();\n      }\n      return e.apply(this, arguments);\n    };\n    t.prototype = e.prototype;\n  } else\n    t = {};\n  return Object.defineProperty(t, \"__esModule\", { value: !0 }), Object.keys(s).forEach(function(r) {\n    var i = Object.getOwnPropertyDescriptor(s, r);\n    Object.defineProperty(t, r, i.get ? i : {\n      enumerable: !0,\n      get: function() {\n        return s[r];\n      }\n    });\n  }), t;\n}\nconst { Duplex: yt } = S;\nfunction Oe(s) {\n  s.emit(\"close\");\n}\nfunction vt() {\n  !this.destroyed && this._writableState.finished && this.destroy();\n}\nfunction Qe(s) {\n  this.removeListener(\"error\", Qe), this.destroy(), this.listenerCount(\"error\") === 0 && this.emit(\"error\", s);\n}\nfunction St(s, e) {\n  let t = !0;\n  const r = new yt({\n    ...e,\n    autoDestroy: !1,\n    emitClose: !1,\n    objectMode: !1,\n    writableObjectMode: !1\n  });\n  return s.on(\"message\", function(n, o) {\n    const l = !o && r._readableState.objectMode ? n.toString() : n;\n    r.push(l) || s.pause();\n  }), s.once(\"error\", function(n) {\n    r.destroyed || (t = !1, r.destroy(n));\n  }), s.once(\"close\", function() {\n    r.destroyed || r.push(null);\n  }), r._destroy = function(i, n) {\n    if (s.readyState === s.CLOSED) {\n      n(i), process.nextTick(Oe, r);\n      return;\n    }\n    let o = !1;\n    s.once(\"error\", function(f) {\n      o = !0, n(f);\n    }), s.once(\"close\", function() {\n      o || n(i), process.nextTick(Oe, r);\n    }), t && s.terminate();\n  }, r._final = function(i) {\n    if (s.readyState === s.CONNECTING) {\n      s.once(\"open\", function() {\n        r._final(i);\n      });\n      return;\n    }\n    s._socket !== null && (s._socket._writableState.finished ? (i(), r._readableState.endEmitted && r.destroy()) : (s._socket.once(\"finish\", function() {\n      i();\n    }), s.close()));\n  }, r._read = function() {\n    s.isPaused && s.resume();\n  }, r._write = function(i, n, o) {\n    if (s.readyState === s.CONNECTING) {\n      s.once(\"open\", function() {\n        r._write(i, n, o);\n      });\n      return;\n    }\n    s.send(i, o);\n  }, r.on(\"end\", vt), r.on(\"error\", Qe), r;\n}\nvar Et = St;\nconst Vs = /* @__PURE__ */ z(Et);\nvar te = { exports: {} }, U = {\n  BINARY_TYPES: [\"nodebuffer\", \"arraybuffer\", \"fragments\"],\n  EMPTY_BUFFER: Buffer.alloc(0),\n  GUID: \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\",\n  kForOnEventAttribute: Symbol(\"kIsForOnEventAttribute\"),\n  kListener: Symbol(\"kListener\"),\n  kStatusCode: Symbol(\"status-code\"),\n  kWebSocket: Symbol(\"websocket\"),\n  NOOP: () => {\n  }\n}, bt, xt;\nconst { EMPTY_BUFFER: kt } = U, Se = Buffer[Symbol.species];\nfunction wt(s, e) {\n  if (s.length === 0)\n    return kt;\n  if (s.length === 1)\n    return s[0];\n  const t = Buffer.allocUnsafe(e);\n  let r = 0;\n  for (let i = 0; i < s.length; i++) {\n    const n = s[i];\n    t.set(n, r), r += n.length;\n  }\n  return r < e ? new Se(t.buffer, t.byteOffset, r) : t;\n}\nfunction Je(s, e, t, r, i) {\n  for (let n = 0; n < i; n++)\n    t[r + n] = s[n] ^ e[n & 3];\n}\nfunction et(s, e) {\n  for (let t = 0; t < s.length; t++)\n    s[t] ^= e[t & 3];\n}\nfunction Ot(s) {\n  return s.length === s.buffer.byteLength ? s.buffer : s.buffer.slice(s.byteOffset, s.byteOffset + s.length);\n}\nfunction Ee(s) {\n  if (Ee.readOnly = !0, Buffer.isBuffer(s))\n    return s;\n  let e;\n  return s instanceof ArrayBuffer ? e = new Se(s) : ArrayBuffer.isView(s) ? e = new Se(s.buffer, s.byteOffset, s.byteLength) : (e = Buffer.from(s), Ee.readOnly = !1), e;\n}\nte.exports = {\n  concat: wt,\n  mask: Je,\n  toArrayBuffer: Ot,\n  toBuffer: Ee,\n  unmask: et\n};\nif (!process.env.WS_NO_BUFFER_UTIL)\n  try {\n    const s = require(\"bufferutil\");\n    xt = te.exports.mask = function(e, t, r, i, n) {\n      n < 48 ? Je(e, t, r, i, n) : s.mask(e, t, r, i, n);\n    }, bt = te.exports.unmask = function(e, t) {\n      e.length < 32 ? et(e, t) : s.unmask(e, t);\n    };\n  } catch {\n  }\nvar ne = te.exports;\nconst Ce = Symbol(\"kDone\"), ue = Symbol(\"kRun\");\nlet Ct = class {\n  /**\n   * Creates a new `Limiter`.\n   *\n   * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n   *     to run concurrently\n   */\n  constructor(e) {\n    this[Ce] = () => {\n      this.pending--, this[ue]();\n    }, this.concurrency = e || 1 / 0, this.jobs = [], this.pending = 0;\n  }\n  /**\n   * Adds a job to the queue.\n   *\n   * @param {Function} job The job to run\n   * @public\n   */\n  add(e) {\n    this.jobs.push(e), this[ue]();\n  }\n  /**\n   * Removes a job from the queue and runs it if possible.\n   *\n   * @private\n   */\n  [ue]() {\n    if (this.pending !== this.concurrency && this.jobs.length) {\n      const e = this.jobs.shift();\n      this.pending++, e(this[Ce]);\n    }\n  }\n};\nvar Tt = Ct;\nconst W = S, Te = ne, Lt = Tt, { kStatusCode: tt } = U, Nt = Buffer[Symbol.species], Pt = Buffer.from([0, 0, 255, 255]), se = Symbol(\"permessage-deflate\"), w = Symbol(\"total-length\"), V = Symbol(\"callback\"), C = Symbol(\"buffers\"), J = Symbol(\"error\");\nlet K, Rt = class {\n  /**\n   * Creates a PerMessageDeflate instance.\n   *\n   * @param {Object} [options] Configuration options\n   * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n   *     for, or request, a custom client window size\n   * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n   *     acknowledge disabling of client context takeover\n   * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n   *     calls to zlib\n   * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n   *     use of a custom server window size\n   * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n   *     disabling of server context takeover\n   * @param {Number} [options.threshold=1024] Size (in bytes) below which\n   *     messages should not be compressed if context takeover is disabled\n   * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n   *     deflate\n   * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n   *     inflate\n   * @param {Boolean} [isServer=false] Create the instance in either server or\n   *     client mode\n   * @param {Number} [maxPayload=0] The maximum allowed message length\n   */\n  constructor(e, t, r) {\n    if (this._maxPayload = r | 0, this._options = e || {}, this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024, this._isServer = !!t, this._deflate = null, this._inflate = null, this.params = null, !K) {\n      const i = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10;\n      K = new Lt(i);\n    }\n  }\n  /**\n   * @type {String}\n   */\n  static get extensionName() {\n    return \"permessage-deflate\";\n  }\n  /**\n   * Create an extension negotiation offer.\n   *\n   * @return {Object} Extension parameters\n   * @public\n   */\n  offer() {\n    const e = {};\n    return this._options.serverNoContextTakeover && (e.server_no_context_takeover = !0), this._options.clientNoContextTakeover && (e.client_no_context_takeover = !0), this._options.serverMaxWindowBits && (e.server_max_window_bits = this._options.serverMaxWindowBits), this._options.clientMaxWindowBits ? e.client_max_window_bits = this._options.clientMaxWindowBits : this._options.clientMaxWindowBits == null && (e.client_max_window_bits = !0), e;\n  }\n  /**\n   * Accept an extension negotiation offer/response.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Object} Accepted configuration\n   * @public\n   */\n  accept(e) {\n    return e = this.normalizeParams(e), this.params = this._isServer ? this.acceptAsServer(e) : this.acceptAsClient(e), this.params;\n  }\n  /**\n   * Releases all resources used by the extension.\n   *\n   * @public\n   */\n  cleanup() {\n    if (this._inflate && (this._inflate.close(), this._inflate = null), this._deflate) {\n      const e = this._deflate[V];\n      this._deflate.close(), this._deflate = null, e && e(\n        new Error(\n          \"The deflate stream was closed while data was being processed\"\n        )\n      );\n    }\n  }\n  /**\n   *  Accept an extension negotiation offer.\n   *\n   * @param {Array} offers The extension negotiation offers\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsServer(e) {\n    const t = this._options, r = e.find((i) => !(t.serverNoContextTakeover === !1 && i.server_no_context_takeover || i.server_max_window_bits && (t.serverMaxWindowBits === !1 || typeof t.serverMaxWindowBits == \"number\" && t.serverMaxWindowBits > i.server_max_window_bits) || typeof t.clientMaxWindowBits == \"number\" && !i.client_max_window_bits));\n    if (!r)\n      throw new Error(\"None of the extension offers can be accepted\");\n    return t.serverNoContextTakeover && (r.server_no_context_takeover = !0), t.clientNoContextTakeover && (r.client_no_context_takeover = !0), typeof t.serverMaxWindowBits == \"number\" && (r.server_max_window_bits = t.serverMaxWindowBits), typeof t.clientMaxWindowBits == \"number\" ? r.client_max_window_bits = t.clientMaxWindowBits : (r.client_max_window_bits === !0 || t.clientMaxWindowBits === !1) && delete r.client_max_window_bits, r;\n  }\n  /**\n   * Accept the extension negotiation response.\n   *\n   * @param {Array} response The extension negotiation response\n   * @return {Object} Accepted configuration\n   * @private\n   */\n  acceptAsClient(e) {\n    const t = e[0];\n    if (this._options.clientNoContextTakeover === !1 && t.client_no_context_takeover)\n      throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n    if (!t.client_max_window_bits)\n      typeof this._options.clientMaxWindowBits == \"number\" && (t.client_max_window_bits = this._options.clientMaxWindowBits);\n    else if (this._options.clientMaxWindowBits === !1 || typeof this._options.clientMaxWindowBits == \"number\" && t.client_max_window_bits > this._options.clientMaxWindowBits)\n      throw new Error(\n        'Unexpected or invalid parameter \"client_max_window_bits\"'\n      );\n    return t;\n  }\n  /**\n   * Normalize parameters.\n   *\n   * @param {Array} configurations The extension negotiation offers/reponse\n   * @return {Array} The offers/response with normalized parameters\n   * @private\n   */\n  normalizeParams(e) {\n    return e.forEach((t) => {\n      Object.keys(t).forEach((r) => {\n        let i = t[r];\n        if (i.length > 1)\n          throw new Error(`Parameter \"${r}\" must have only a single value`);\n        if (i = i[0], r === \"client_max_window_bits\") {\n          if (i !== !0) {\n            const n = +i;\n            if (!Number.isInteger(n) || n < 8 || n > 15)\n              throw new TypeError(\n                `Invalid value for parameter \"${r}\": ${i}`\n              );\n            i = n;\n          } else if (!this._isServer)\n            throw new TypeError(\n              `Invalid value for parameter \"${r}\": ${i}`\n            );\n        } else if (r === \"server_max_window_bits\") {\n          const n = +i;\n          if (!Number.isInteger(n) || n < 8 || n > 15)\n            throw new TypeError(\n              `Invalid value for parameter \"${r}\": ${i}`\n            );\n          i = n;\n        } else if (r === \"client_no_context_takeover\" || r === \"server_no_context_takeover\") {\n          if (i !== !0)\n            throw new TypeError(\n              `Invalid value for parameter \"${r}\": ${i}`\n            );\n        } else\n          throw new Error(`Unknown parameter \"${r}\"`);\n        t[r] = i;\n      });\n    }), e;\n  }\n  /**\n   * Decompress data. Concurrency limited.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  decompress(e, t, r) {\n    K.add((i) => {\n      this._decompress(e, t, (n, o) => {\n        i(), r(n, o);\n      });\n    });\n  }\n  /**\n   * Compress data. Concurrency limited.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @public\n   */\n  compress(e, t, r) {\n    K.add((i) => {\n      this._compress(e, t, (n, o) => {\n        i(), r(n, o);\n      });\n    });\n  }\n  /**\n   * Decompress data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _decompress(e, t, r) {\n    const i = this._isServer ? \"client\" : \"server\";\n    if (!this._inflate) {\n      const n = `${i}_max_window_bits`, o = typeof this.params[n] != \"number\" ? W.Z_DEFAULT_WINDOWBITS : this.params[n];\n      this._inflate = W.createInflateRaw({\n        ...this._options.zlibInflateOptions,\n        windowBits: o\n      }), this._inflate[se] = this, this._inflate[w] = 0, this._inflate[C] = [], this._inflate.on(\"error\", Bt), this._inflate.on(\"data\", st);\n    }\n    this._inflate[V] = r, this._inflate.write(e), t && this._inflate.write(Pt), this._inflate.flush(() => {\n      const n = this._inflate[J];\n      if (n) {\n        this._inflate.close(), this._inflate = null, r(n);\n        return;\n      }\n      const o = Te.concat(\n        this._inflate[C],\n        this._inflate[w]\n      );\n      this._inflate._readableState.endEmitted ? (this._inflate.close(), this._inflate = null) : (this._inflate[w] = 0, this._inflate[C] = [], t && this.params[`${i}_no_context_takeover`] && this._inflate.reset()), r(null, o);\n    });\n  }\n  /**\n   * Compress data.\n   *\n   * @param {(Buffer|String)} data Data to compress\n   * @param {Boolean} fin Specifies whether or not this is the last fragment\n   * @param {Function} callback Callback\n   * @private\n   */\n  _compress(e, t, r) {\n    const i = this._isServer ? \"server\" : \"client\";\n    if (!this._deflate) {\n      const n = `${i}_max_window_bits`, o = typeof this.params[n] != \"number\" ? W.Z_DEFAULT_WINDOWBITS : this.params[n];\n      this._deflate = W.createDeflateRaw({\n        ...this._options.zlibDeflateOptions,\n        windowBits: o\n      }), this._deflate[w] = 0, this._deflate[C] = [], this._deflate.on(\"data\", Ut);\n    }\n    this._deflate[V] = r, this._deflate.write(e), this._deflate.flush(W.Z_SYNC_FLUSH, () => {\n      if (!this._deflate)\n        return;\n      let n = Te.concat(\n        this._deflate[C],\n        this._deflate[w]\n      );\n      t && (n = new Nt(n.buffer, n.byteOffset, n.length - 4)), this._deflate[V] = null, this._deflate[w] = 0, this._deflate[C] = [], t && this.params[`${i}_no_context_takeover`] && this._deflate.reset(), r(null, n);\n    });\n  }\n};\nvar oe = Rt;\nfunction Ut(s) {\n  this[C].push(s), this[w] += s.length;\n}\nfunction st(s) {\n  if (this[w] += s.length, this[se]._maxPayload < 1 || this[w] <= this[se]._maxPayload) {\n    this[C].push(s);\n    return;\n  }\n  this[J] = new RangeError(\"Max payload size exceeded\"), this[J].code = \"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH\", this[J][tt] = 1009, this.removeListener(\"data\", st), this.reset();\n}\nfunction Bt(s) {\n  this[se]._inflate = null, s[tt] = 1007, this[V](s);\n}\nvar re = { exports: {} };\nconst $t = {}, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n  __proto__: null,\n  default: $t\n}, Symbol.toStringTag, { value: \"Module\" })), It = /* @__PURE__ */ gt(Mt);\nvar Le;\nconst { isUtf8: Ne } = S, Dt = [\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  // 0 - 15\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  // 16 - 31\n  0,\n  1,\n  0,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  0,\n  1,\n  1,\n  0,\n  1,\n  1,\n  0,\n  // 32 - 47\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  0,\n  0,\n  0,\n  0,\n  0,\n  // 48 - 63\n  0,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  // 64 - 79\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  0,\n  0,\n  1,\n  1,\n  // 80 - 95\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  // 96 - 111\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  1,\n  0,\n  1,\n  0,\n  1,\n  0\n  // 112 - 127\n];\nfunction Wt(s) {\n  return s >= 1e3 && s <= 1014 && s !== 1004 && s !== 1005 && s !== 1006 || s >= 3e3 && s <= 4999;\n}\nfunction be(s) {\n  const e = s.length;\n  let t = 0;\n  for (; t < e; )\n    if (!(s[t] & 128))\n      t++;\n    else if ((s[t] & 224) === 192) {\n      if (t + 1 === e || (s[t + 1] & 192) !== 128 || (s[t] & 254) === 192)\n        return !1;\n      t += 2;\n    } else if ((s[t] & 240) === 224) {\n      if (t + 2 >= e || (s[t + 1] & 192) !== 128 || (s[t + 2] & 192) !== 128 || s[t] === 224 && (s[t + 1] & 224) === 128 || // Overlong\n      s[t] === 237 && (s[t + 1] & 224) === 160)\n        return !1;\n      t += 3;\n    } else if ((s[t] & 248) === 240) {\n      if (t + 3 >= e || (s[t + 1] & 192) !== 128 || (s[t + 2] & 192) !== 128 || (s[t + 3] & 192) !== 128 || s[t] === 240 && (s[t + 1] & 240) === 128 || // Overlong\n      s[t] === 244 && s[t + 1] > 143 || s[t] > 244)\n        return !1;\n      t += 4;\n    } else\n      return !1;\n  return !0;\n}\nre.exports = {\n  isValidStatusCode: Wt,\n  isValidUTF8: be,\n  tokenChars: Dt\n};\nif (Ne)\n  Le = re.exports.isValidUTF8 = function(s) {\n    return s.length < 24 ? be(s) : Ne(s);\n  };\nelse if (!process.env.WS_NO_UTF_8_VALIDATE)\n  try {\n    const s = It;\n    Le = re.exports.isValidUTF8 = function(e) {\n      return e.length < 32 ? be(e) : s(e);\n    };\n  } catch {\n  }\nvar ae = re.exports;\nconst { Writable: At } = S, Pe = oe, {\n  BINARY_TYPES: Ft,\n  EMPTY_BUFFER: Re,\n  kStatusCode: jt,\n  kWebSocket: Gt\n} = U, { concat: de, toArrayBuffer: Vt, unmask: Ht } = ne, { isValidStatusCode: zt, isValidUTF8: Ue } = ae, X = Buffer[Symbol.species], A = 0, Be = 1, $e = 2, Me = 3, _e = 4, Yt = 5;\nlet qt = class extends At {\n  /**\n   * Creates a Receiver instance.\n   *\n   * @param {Object} [options] Options object\n   * @param {String} [options.binaryType=nodebuffer] The type for binary data\n   * @param {Object} [options.extensions] An object containing the negotiated\n   *     extensions\n   * @param {Boolean} [options.isServer=false] Specifies whether to operate in\n   *     client or server mode\n   * @param {Number} [options.maxPayload=0] The maximum allowed message length\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   */\n  constructor(e = {}) {\n    super(), this._binaryType = e.binaryType || Ft[0], this._extensions = e.extensions || {}, this._isServer = !!e.isServer, this._maxPayload = e.maxPayload | 0, this._skipUTF8Validation = !!e.skipUTF8Validation, this[Gt] = void 0, this._bufferedBytes = 0, this._buffers = [], this._compressed = !1, this._payloadLength = 0, this._mask = void 0, this._fragmented = 0, this._masked = !1, this._fin = !1, this._opcode = 0, this._totalPayloadLength = 0, this._messageLength = 0, this._fragments = [], this._state = A, this._loop = !1;\n  }\n  /**\n   * Implements `Writable.prototype._write()`.\n   *\n   * @param {Buffer} chunk The chunk of data to write\n   * @param {String} encoding The character encoding of `chunk`\n   * @param {Function} cb Callback\n   * @private\n   */\n  _write(e, t, r) {\n    if (this._opcode === 8 && this._state == A)\n      return r();\n    this._bufferedBytes += e.length, this._buffers.push(e), this.startLoop(r);\n  }\n  /**\n   * Consumes `n` bytes from the buffered data.\n   *\n   * @param {Number} n The number of bytes to consume\n   * @return {Buffer} The consumed bytes\n   * @private\n   */\n  consume(e) {\n    if (this._bufferedBytes -= e, e === this._buffers[0].length)\n      return this._buffers.shift();\n    if (e < this._buffers[0].length) {\n      const r = this._buffers[0];\n      return this._buffers[0] = new X(\n        r.buffer,\n        r.byteOffset + e,\n        r.length - e\n      ), new X(r.buffer, r.byteOffset, e);\n    }\n    const t = Buffer.allocUnsafe(e);\n    do {\n      const r = this._buffers[0], i = t.length - e;\n      e >= r.length ? t.set(this._buffers.shift(), i) : (t.set(new Uint8Array(r.buffer, r.byteOffset, e), i), this._buffers[0] = new X(\n        r.buffer,\n        r.byteOffset + e,\n        r.length - e\n      )), e -= r.length;\n    } while (e > 0);\n    return t;\n  }\n  /**\n   * Starts the parsing loop.\n   *\n   * @param {Function} cb Callback\n   * @private\n   */\n  startLoop(e) {\n    let t;\n    this._loop = !0;\n    do\n      switch (this._state) {\n        case A:\n          t = this.getInfo();\n          break;\n        case Be:\n          t = this.getPayloadLength16();\n          break;\n        case $e:\n          t = this.getPayloadLength64();\n          break;\n        case Me:\n          this.getMask();\n          break;\n        case _e:\n          t = this.getData(e);\n          break;\n        default:\n          this._loop = !1;\n          return;\n      }\n    while (this._loop);\n    e(t);\n  }\n  /**\n   * Reads the first two bytes of a frame.\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  getInfo() {\n    if (this._bufferedBytes < 2) {\n      this._loop = !1;\n      return;\n    }\n    const e = this.consume(2);\n    if (e[0] & 48)\n      return this._loop = !1, g(\n        RangeError,\n        \"RSV2 and RSV3 must be clear\",\n        !0,\n        1002,\n        \"WS_ERR_UNEXPECTED_RSV_2_3\"\n      );\n    const t = (e[0] & 64) === 64;\n    if (t && !this._extensions[Pe.extensionName])\n      return this._loop = !1, g(\n        RangeError,\n        \"RSV1 must be clear\",\n        !0,\n        1002,\n        \"WS_ERR_UNEXPECTED_RSV_1\"\n      );\n    if (this._fin = (e[0] & 128) === 128, this._opcode = e[0] & 15, this._payloadLength = e[1] & 127, this._opcode === 0) {\n      if (t)\n        return this._loop = !1, g(\n          RangeError,\n          \"RSV1 must be clear\",\n          !0,\n          1002,\n          \"WS_ERR_UNEXPECTED_RSV_1\"\n        );\n      if (!this._fragmented)\n        return this._loop = !1, g(\n          RangeError,\n          \"invalid opcode 0\",\n          !0,\n          1002,\n          \"WS_ERR_INVALID_OPCODE\"\n        );\n      this._opcode = this._fragmented;\n    } else if (this._opcode === 1 || this._opcode === 2) {\n      if (this._fragmented)\n        return this._loop = !1, g(\n          RangeError,\n          `invalid opcode ${this._opcode}`,\n          !0,\n          1002,\n          \"WS_ERR_INVALID_OPCODE\"\n        );\n      this._compressed = t;\n    } else if (this._opcode > 7 && this._opcode < 11) {\n      if (!this._fin)\n        return this._loop = !1, g(\n          RangeError,\n          \"FIN must be set\",\n          !0,\n          1002,\n          \"WS_ERR_EXPECTED_FIN\"\n        );\n      if (t)\n        return this._loop = !1, g(\n          RangeError,\n          \"RSV1 must be clear\",\n          !0,\n          1002,\n          \"WS_ERR_UNEXPECTED_RSV_1\"\n        );\n      if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1)\n        return this._loop = !1, g(\n          RangeError,\n          `invalid payload length ${this._payloadLength}`,\n          !0,\n          1002,\n          \"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH\"\n        );\n    } else\n      return this._loop = !1, g(\n        RangeError,\n        `invalid opcode ${this._opcode}`,\n        !0,\n        1002,\n        \"WS_ERR_INVALID_OPCODE\"\n      );\n    if (!this._fin && !this._fragmented && (this._fragmented = this._opcode), this._masked = (e[1] & 128) === 128, this._isServer) {\n      if (!this._masked)\n        return this._loop = !1, g(\n          RangeError,\n          \"MASK must be set\",\n          !0,\n          1002,\n          \"WS_ERR_EXPECTED_MASK\"\n        );\n    } else if (this._masked)\n      return this._loop = !1, g(\n        RangeError,\n        \"MASK must be clear\",\n        !0,\n        1002,\n        \"WS_ERR_UNEXPECTED_MASK\"\n      );\n    if (this._payloadLength === 126)\n      this._state = Be;\n    else if (this._payloadLength === 127)\n      this._state = $e;\n    else\n      return this.haveLength();\n  }\n  /**\n   * Gets extended payload length (7+16).\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  getPayloadLength16() {\n    if (this._bufferedBytes < 2) {\n      this._loop = !1;\n      return;\n    }\n    return this._payloadLength = this.consume(2).readUInt16BE(0), this.haveLength();\n  }\n  /**\n   * Gets extended payload length (7+64).\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  getPayloadLength64() {\n    if (this._bufferedBytes < 8) {\n      this._loop = !1;\n      return;\n    }\n    const e = this.consume(8), t = e.readUInt32BE(0);\n    return t > Math.pow(2, 53 - 32) - 1 ? (this._loop = !1, g(\n      RangeError,\n      \"Unsupported WebSocket frame: payload length > 2^53 - 1\",\n      !1,\n      1009,\n      \"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH\"\n    )) : (this._payloadLength = t * Math.pow(2, 32) + e.readUInt32BE(4), this.haveLength());\n  }\n  /**\n   * Payload length has been read.\n   *\n   * @return {(RangeError|undefined)} A possible error\n   * @private\n   */\n  haveLength() {\n    if (this._payloadLength && this._opcode < 8 && (this._totalPayloadLength += this._payloadLength, this._totalPayloadLength > this._maxPayload && this._maxPayload > 0))\n      return this._loop = !1, g(\n        RangeError,\n        \"Max payload size exceeded\",\n        !1,\n        1009,\n        \"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH\"\n      );\n    this._masked ? this._state = Me : this._state = _e;\n  }\n  /**\n   * Reads mask bytes.\n   *\n   * @private\n   */\n  getMask() {\n    if (this._bufferedBytes < 4) {\n      this._loop = !1;\n      return;\n    }\n    this._mask = this.consume(4), this._state = _e;\n  }\n  /**\n   * Reads data bytes.\n   *\n   * @param {Function} cb Callback\n   * @return {(Error|RangeError|undefined)} A possible error\n   * @private\n   */\n  getData(e) {\n    let t = Re;\n    if (this._payloadLength) {\n      if (this._bufferedBytes < this._payloadLength) {\n        this._loop = !1;\n        return;\n      }\n      t = this.consume(this._payloadLength), this._masked && this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3] && Ht(t, this._mask);\n    }\n    if (this._opcode > 7)\n      return this.controlMessage(t);\n    if (this._compressed) {\n      this._state = Yt, this.decompress(t, e);\n      return;\n    }\n    return t.length && (this._messageLength = this._totalPayloadLength, this._fragments.push(t)), this.dataMessage();\n  }\n  /**\n   * Decompresses data.\n   *\n   * @param {Buffer} data Compressed data\n   * @param {Function} cb Callback\n   * @private\n   */\n  decompress(e, t) {\n    this._extensions[Pe.extensionName].decompress(e, this._fin, (i, n) => {\n      if (i)\n        return t(i);\n      if (n.length) {\n        if (this._messageLength += n.length, this._messageLength > this._maxPayload && this._maxPayload > 0)\n          return t(\n            g(\n              RangeError,\n              \"Max payload size exceeded\",\n              !1,\n              1009,\n              \"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH\"\n            )\n          );\n        this._fragments.push(n);\n      }\n      const o = this.dataMessage();\n      if (o)\n        return t(o);\n      this.startLoop(t);\n    });\n  }\n  /**\n   * Handles a data message.\n   *\n   * @return {(Error|undefined)} A possible error\n   * @private\n   */\n  dataMessage() {\n    if (this._fin) {\n      const e = this._messageLength, t = this._fragments;\n      if (this._totalPayloadLength = 0, this._messageLength = 0, this._fragmented = 0, this._fragments = [], this._opcode === 2) {\n        let r;\n        this._binaryType === \"nodebuffer\" ? r = de(t, e) : this._binaryType === \"arraybuffer\" ? r = Vt(de(t, e)) : r = t, this.emit(\"message\", r, !0);\n      } else {\n        const r = de(t, e);\n        if (!this._skipUTF8Validation && !Ue(r))\n          return this._loop = !1, g(\n            Error,\n            \"invalid UTF-8 sequence\",\n            !0,\n            1007,\n            \"WS_ERR_INVALID_UTF8\"\n          );\n        this.emit(\"message\", r, !1);\n      }\n    }\n    this._state = A;\n  }\n  /**\n   * Handles a control message.\n   *\n   * @param {Buffer} data Data to handle\n   * @return {(Error|RangeError|undefined)} A possible error\n   * @private\n   */\n  controlMessage(e) {\n    if (this._opcode === 8)\n      if (this._loop = !1, e.length === 0)\n        this.emit(\"conclude\", 1005, Re), this.end();\n      else {\n        const t = e.readUInt16BE(0);\n        if (!zt(t))\n          return g(\n            RangeError,\n            `invalid status code ${t}`,\n            !0,\n            1002,\n            \"WS_ERR_INVALID_CLOSE_CODE\"\n          );\n        const r = new X(\n          e.buffer,\n          e.byteOffset + 2,\n          e.length - 2\n        );\n        if (!this._skipUTF8Validation && !Ue(r))\n          return g(\n            Error,\n            \"invalid UTF-8 sequence\",\n            !0,\n            1007,\n            \"WS_ERR_INVALID_UTF8\"\n          );\n        this.emit(\"conclude\", t, r), this.end();\n      }\n    else\n      this._opcode === 9 ? this.emit(\"ping\", e) : this.emit(\"pong\", e);\n    this._state = A;\n  }\n};\nvar rt = qt;\nfunction g(s, e, t, r, i) {\n  const n = new s(\n    t ? `Invalid WebSocket frame: ${e}` : e\n  );\n  return Error.captureStackTrace(n, g), n.code = i, n[jt] = r, n;\n}\nconst qs = /* @__PURE__ */ z(rt), { randomFillSync: Kt } = S, Ie = oe, { EMPTY_BUFFER: Xt } = U, { isValidStatusCode: Zt } = ae, { mask: De, toBuffer: M } = ne, x = Symbol(\"kByteLength\"), Qt = Buffer.alloc(4);\nlet Jt = class P {\n  /**\n   * Creates a Sender instance.\n   *\n   * @param {(net.Socket|tls.Socket)} socket The connection socket\n   * @param {Object} [extensions] An object containing the negotiated extensions\n   * @param {Function} [generateMask] The function used to generate the masking\n   *     key\n   */\n  constructor(e, t, r) {\n    this._extensions = t || {}, r && (this._generateMask = r, this._maskBuffer = Buffer.alloc(4)), this._socket = e, this._firstFragment = !0, this._compress = !1, this._bufferedBytes = 0, this._deflating = !1, this._queue = [];\n  }\n  /**\n   * Frames a piece of data according to the HyBi WebSocket protocol.\n   *\n   * @param {(Buffer|String)} data The data to frame\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @return {(Buffer|String)[]} The framed data\n   * @public\n   */\n  static frame(e, t) {\n    let r, i = !1, n = 2, o = !1;\n    t.mask && (r = t.maskBuffer || Qt, t.generateMask ? t.generateMask(r) : Kt(r, 0, 4), o = (r[0] | r[1] | r[2] | r[3]) === 0, n = 6);\n    let l;\n    typeof e == \"string\" ? (!t.mask || o) && t[x] !== void 0 ? l = t[x] : (e = Buffer.from(e), l = e.length) : (l = e.length, i = t.mask && t.readOnly && !o);\n    let f = l;\n    l >= 65536 ? (n += 8, f = 127) : l > 125 && (n += 2, f = 126);\n    const a = Buffer.allocUnsafe(i ? l + n : n);\n    return a[0] = t.fin ? t.opcode | 128 : t.opcode, t.rsv1 && (a[0] |= 64), a[1] = f, f === 126 ? a.writeUInt16BE(l, 2) : f === 127 && (a[2] = a[3] = 0, a.writeUIntBE(l, 4, 6)), t.mask ? (a[1] |= 128, a[n - 4] = r[0], a[n - 3] = r[1], a[n - 2] = r[2], a[n - 1] = r[3], o ? [a, e] : i ? (De(e, r, a, n, l), [a]) : (De(e, r, e, 0, l), [a, e])) : [a, e];\n  }\n  /**\n   * Sends a close message to the other peer.\n   *\n   * @param {Number} [code] The status code component of the body\n   * @param {(String|Buffer)} [data] The message component of the body\n   * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  close(e, t, r, i) {\n    let n;\n    if (e === void 0)\n      n = Xt;\n    else {\n      if (typeof e != \"number\" || !Zt(e))\n        throw new TypeError(\"First argument must be a valid error code number\");\n      if (t === void 0 || !t.length)\n        n = Buffer.allocUnsafe(2), n.writeUInt16BE(e, 0);\n      else {\n        const l = Buffer.byteLength(t);\n        if (l > 123)\n          throw new RangeError(\"The message must not be greater than 123 bytes\");\n        n = Buffer.allocUnsafe(2 + l), n.writeUInt16BE(e, 0), typeof t == \"string\" ? n.write(t, 2) : n.set(t, 2);\n      }\n    }\n    const o = {\n      [x]: n.length,\n      fin: !0,\n      generateMask: this._generateMask,\n      mask: r,\n      maskBuffer: this._maskBuffer,\n      opcode: 8,\n      readOnly: !1,\n      rsv1: !1\n    };\n    this._deflating ? this.enqueue([this.dispatch, n, !1, o, i]) : this.sendFrame(P.frame(n, o), i);\n  }\n  /**\n   * Sends a ping message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  ping(e, t, r) {\n    let i, n;\n    if (typeof e == \"string\" ? (i = Buffer.byteLength(e), n = !1) : (e = M(e), i = e.length, n = M.readOnly), i > 125)\n      throw new RangeError(\"The data size must not be greater than 125 bytes\");\n    const o = {\n      [x]: i,\n      fin: !0,\n      generateMask: this._generateMask,\n      mask: t,\n      maskBuffer: this._maskBuffer,\n      opcode: 9,\n      readOnly: n,\n      rsv1: !1\n    };\n    this._deflating ? this.enqueue([this.dispatch, e, !1, o, r]) : this.sendFrame(P.frame(e, o), r);\n  }\n  /**\n   * Sends a pong message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  pong(e, t, r) {\n    let i, n;\n    if (typeof e == \"string\" ? (i = Buffer.byteLength(e), n = !1) : (e = M(e), i = e.length, n = M.readOnly), i > 125)\n      throw new RangeError(\"The data size must not be greater than 125 bytes\");\n    const o = {\n      [x]: i,\n      fin: !0,\n      generateMask: this._generateMask,\n      mask: t,\n      maskBuffer: this._maskBuffer,\n      opcode: 10,\n      readOnly: n,\n      rsv1: !1\n    };\n    this._deflating ? this.enqueue([this.dispatch, e, !1, o, r]) : this.sendFrame(P.frame(e, o), r);\n  }\n  /**\n   * Sends a data message to the other peer.\n   *\n   * @param {*} data The message to send\n   * @param {Object} options Options object\n   * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n   *     or text\n   * @param {Boolean} [options.compress=false] Specifies whether or not to\n   *     compress `data`\n   * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Function} [cb] Callback\n   * @public\n   */\n  send(e, t, r) {\n    const i = this._extensions[Ie.extensionName];\n    let n = t.binary ? 2 : 1, o = t.compress, l, f;\n    if (typeof e == \"string\" ? (l = Buffer.byteLength(e), f = !1) : (e = M(e), l = e.length, f = M.readOnly), this._firstFragment ? (this._firstFragment = !1, o && i && i.params[i._isServer ? \"server_no_context_takeover\" : \"client_no_context_takeover\"] && (o = l >= i._threshold), this._compress = o) : (o = !1, n = 0), t.fin && (this._firstFragment = !0), i) {\n      const a = {\n        [x]: l,\n        fin: t.fin,\n        generateMask: this._generateMask,\n        mask: t.mask,\n        maskBuffer: this._maskBuffer,\n        opcode: n,\n        readOnly: f,\n        rsv1: o\n      };\n      this._deflating ? this.enqueue([this.dispatch, e, this._compress, a, r]) : this.dispatch(e, this._compress, a, r);\n    } else\n      this.sendFrame(\n        P.frame(e, {\n          [x]: l,\n          fin: t.fin,\n          generateMask: this._generateMask,\n          mask: t.mask,\n          maskBuffer: this._maskBuffer,\n          opcode: n,\n          readOnly: f,\n          rsv1: !1\n        }),\n        r\n      );\n  }\n  /**\n   * Dispatches a message.\n   *\n   * @param {(Buffer|String)} data The message to send\n   * @param {Boolean} [compress=false] Specifies whether or not to compress\n   *     `data`\n   * @param {Object} options Options object\n   * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n   *     FIN bit\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n   *     `data`\n   * @param {Buffer} [options.maskBuffer] The buffer used to store the masking\n   *     key\n   * @param {Number} options.opcode The opcode\n   * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n   *     modified\n   * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n   *     RSV1 bit\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  dispatch(e, t, r, i) {\n    if (!t) {\n      this.sendFrame(P.frame(e, r), i);\n      return;\n    }\n    const n = this._extensions[Ie.extensionName];\n    this._bufferedBytes += r[x], this._deflating = !0, n.compress(e, r.fin, (o, l) => {\n      if (this._socket.destroyed) {\n        const f = new Error(\n          \"The socket was closed while data was being compressed\"\n        );\n        typeof i == \"function\" && i(f);\n        for (let a = 0; a < this._queue.length; a++) {\n          const c = this._queue[a], h = c[c.length - 1];\n          typeof h == \"function\" && h(f);\n        }\n        return;\n      }\n      this._bufferedBytes -= r[x], this._deflating = !1, r.readOnly = !1, this.sendFrame(P.frame(l, r), i), this.dequeue();\n    });\n  }\n  /**\n   * Executes queued send operations.\n   *\n   * @private\n   */\n  dequeue() {\n    for (; !this._deflating && this._queue.length; ) {\n      const e = this._queue.shift();\n      this._bufferedBytes -= e[3][x], Reflect.apply(e[0], this, e.slice(1));\n    }\n  }\n  /**\n   * Enqueues a send operation.\n   *\n   * @param {Array} params Send operation parameters.\n   * @private\n   */\n  enqueue(e) {\n    this._bufferedBytes += e[3][x], this._queue.push(e);\n  }\n  /**\n   * Sends a frame.\n   *\n   * @param {Buffer[]} list The frame to send\n   * @param {Function} [cb] Callback\n   * @private\n   */\n  sendFrame(e, t) {\n    e.length === 2 ? (this._socket.cork(), this._socket.write(e[0]), this._socket.write(e[1], t), this._socket.uncork()) : this._socket.write(e[0], t);\n  }\n};\nvar it = Jt;\nconst Ks = /* @__PURE__ */ z(it), { kForOnEventAttribute: F, kListener: pe } = U, We = Symbol(\"kCode\"), Ae = Symbol(\"kData\"), Fe = Symbol(\"kError\"), je = Symbol(\"kMessage\"), Ge = Symbol(\"kReason\"), I = Symbol(\"kTarget\"), Ve = Symbol(\"kType\"), He = Symbol(\"kWasClean\");\nclass B {\n  /**\n   * Create a new `Event`.\n   *\n   * @param {String} type The name of the event\n   * @throws {TypeError} If the `type` argument is not specified\n   */\n  constructor(e) {\n    this[I] = null, this[Ve] = e;\n  }\n  /**\n   * @type {*}\n   */\n  get target() {\n    return this[I];\n  }\n  /**\n   * @type {String}\n   */\n  get type() {\n    return this[Ve];\n  }\n}\nObject.defineProperty(B.prototype, \"target\", { enumerable: !0 });\nObject.defineProperty(B.prototype, \"type\", { enumerable: !0 });\nclass Y extends B {\n  /**\n   * Create a new `CloseEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {Number} [options.code=0] The status code explaining why the\n   *     connection was closed\n   * @param {String} [options.reason=''] A human-readable string explaining why\n   *     the connection was closed\n   * @param {Boolean} [options.wasClean=false] Indicates whether or not the\n   *     connection was cleanly closed\n   */\n  constructor(e, t = {}) {\n    super(e), this[We] = t.code === void 0 ? 0 : t.code, this[Ge] = t.reason === void 0 ? \"\" : t.reason, this[He] = t.wasClean === void 0 ? !1 : t.wasClean;\n  }\n  /**\n   * @type {Number}\n   */\n  get code() {\n    return this[We];\n  }\n  /**\n   * @type {String}\n   */\n  get reason() {\n    return this[Ge];\n  }\n  /**\n   * @type {Boolean}\n   */\n  get wasClean() {\n    return this[He];\n  }\n}\nObject.defineProperty(Y.prototype, \"code\", { enumerable: !0 });\nObject.defineProperty(Y.prototype, \"reason\", { enumerable: !0 });\nObject.defineProperty(Y.prototype, \"wasClean\", { enumerable: !0 });\nclass le extends B {\n  /**\n   * Create a new `ErrorEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.error=null] The error that generated this event\n   * @param {String} [options.message=''] The error message\n   */\n  constructor(e, t = {}) {\n    super(e), this[Fe] = t.error === void 0 ? null : t.error, this[je] = t.message === void 0 ? \"\" : t.message;\n  }\n  /**\n   * @type {*}\n   */\n  get error() {\n    return this[Fe];\n  }\n  /**\n   * @type {String}\n   */\n  get message() {\n    return this[je];\n  }\n}\nObject.defineProperty(le.prototype, \"error\", { enumerable: !0 });\nObject.defineProperty(le.prototype, \"message\", { enumerable: !0 });\nclass xe extends B {\n  /**\n   * Create a new `MessageEvent`.\n   *\n   * @param {String} type The name of the event\n   * @param {Object} [options] A dictionary object that allows for setting\n   *     attributes via object members of the same name\n   * @param {*} [options.data=null] The message content\n   */\n  constructor(e, t = {}) {\n    super(e), this[Ae] = t.data === void 0 ? null : t.data;\n  }\n  /**\n   * @type {*}\n   */\n  get data() {\n    return this[Ae];\n  }\n}\nObject.defineProperty(xe.prototype, \"data\", { enumerable: !0 });\nconst es = {\n  /**\n   * Register an event listener.\n   *\n   * @param {String} type A string representing the event type to listen for\n   * @param {(Function|Object)} handler The listener to add\n   * @param {Object} [options] An options object specifies characteristics about\n   *     the event listener\n   * @param {Boolean} [options.once=false] A `Boolean` indicating that the\n   *     listener should be invoked at most once after being added. If `true`,\n   *     the listener would be automatically removed when invoked.\n   * @public\n   */\n  addEventListener(s, e, t = {}) {\n    for (const i of this.listeners(s))\n      if (!t[F] && i[pe] === e && !i[F])\n        return;\n    let r;\n    if (s === \"message\")\n      r = function(n, o) {\n        const l = new xe(\"message\", {\n          data: o ? n : n.toString()\n        });\n        l[I] = this, Z(e, this, l);\n      };\n    else if (s === \"close\")\n      r = function(n, o) {\n        const l = new Y(\"close\", {\n          code: n,\n          reason: o.toString(),\n          wasClean: this._closeFrameReceived && this._closeFrameSent\n        });\n        l[I] = this, Z(e, this, l);\n      };\n    else if (s === \"error\")\n      r = function(n) {\n        const o = new le(\"error\", {\n          error: n,\n          message: n.message\n        });\n        o[I] = this, Z(e, this, o);\n      };\n    else if (s === \"open\")\n      r = function() {\n        const n = new B(\"open\");\n        n[I] = this, Z(e, this, n);\n      };\n    else\n      return;\n    r[F] = !!t[F], r[pe] = e, t.once ? this.once(s, r) : this.on(s, r);\n  },\n  /**\n   * Remove an event listener.\n   *\n   * @param {String} type A string representing the event type to remove\n   * @param {(Function|Object)} handler The listener to remove\n   * @public\n   */\n  removeEventListener(s, e) {\n    for (const t of this.listeners(s))\n      if (t[pe] === e && !t[F]) {\n        this.removeListener(s, t);\n        break;\n      }\n  }\n};\nvar ts = {\n  CloseEvent: Y,\n  ErrorEvent: le,\n  Event: B,\n  EventTarget: es,\n  MessageEvent: xe\n};\nfunction Z(s, e, t) {\n  typeof s == \"object\" && s.handleEvent ? s.handleEvent.call(s, t) : s.call(e, t);\n}\nconst { tokenChars: j } = ae;\nfunction k(s, e, t) {\n  s[e] === void 0 ? s[e] = [t] : s[e].push(t);\n}\nfunction ss(s) {\n  const e = /* @__PURE__ */ Object.create(null);\n  let t = /* @__PURE__ */ Object.create(null), r = !1, i = !1, n = !1, o, l, f = -1, a = -1, c = -1, h = 0;\n  for (; h < s.length; h++)\n    if (a = s.charCodeAt(h), o === void 0)\n      if (c === -1 && j[a] === 1)\n        f === -1 && (f = h);\n      else if (h !== 0 && (a === 32 || a === 9))\n        c === -1 && f !== -1 && (c = h);\n      else if (a === 59 || a === 44) {\n        if (f === -1)\n          throw new SyntaxError(`Unexpected character at index ${h}`);\n        c === -1 && (c = h);\n        const v = s.slice(f, c);\n        a === 44 ? (k(e, v, t), t = /* @__PURE__ */ Object.create(null)) : o = v, f = c = -1;\n      } else\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n    else if (l === void 0)\n      if (c === -1 && j[a] === 1)\n        f === -1 && (f = h);\n      else if (a === 32 || a === 9)\n        c === -1 && f !== -1 && (c = h);\n      else if (a === 59 || a === 44) {\n        if (f === -1)\n          throw new SyntaxError(`Unexpected character at index ${h}`);\n        c === -1 && (c = h), k(t, s.slice(f, c), !0), a === 44 && (k(e, o, t), t = /* @__PURE__ */ Object.create(null), o = void 0), f = c = -1;\n      } else if (a === 61 && f !== -1 && c === -1)\n        l = s.slice(f, h), f = c = -1;\n      else\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n    else if (i) {\n      if (j[a] !== 1)\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n      f === -1 ? f = h : r || (r = !0), i = !1;\n    } else if (n)\n      if (j[a] === 1)\n        f === -1 && (f = h);\n      else if (a === 34 && f !== -1)\n        n = !1, c = h;\n      else if (a === 92)\n        i = !0;\n      else\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n    else if (a === 34 && s.charCodeAt(h - 1) === 61)\n      n = !0;\n    else if (c === -1 && j[a] === 1)\n      f === -1 && (f = h);\n    else if (f !== -1 && (a === 32 || a === 9))\n      c === -1 && (c = h);\n    else if (a === 59 || a === 44) {\n      if (f === -1)\n        throw new SyntaxError(`Unexpected character at index ${h}`);\n      c === -1 && (c = h);\n      let v = s.slice(f, c);\n      r && (v = v.replace(/\\\\/g, \"\"), r = !1), k(t, l, v), a === 44 && (k(e, o, t), t = /* @__PURE__ */ Object.create(null), o = void 0), l = void 0, f = c = -1;\n    } else\n      throw new SyntaxError(`Unexpected character at index ${h}`);\n  if (f === -1 || n || a === 32 || a === 9)\n    throw new SyntaxError(\"Unexpected end of input\");\n  c === -1 && (c = h);\n  const p = s.slice(f, c);\n  return o === void 0 ? k(e, p, t) : (l === void 0 ? k(t, p, !0) : r ? k(t, l, p.replace(/\\\\/g, \"\")) : k(t, l, p), k(e, o, t)), e;\n}\nfunction rs(s) {\n  return Object.keys(s).map((e) => {\n    let t = s[e];\n    return Array.isArray(t) || (t = [t]), t.map((r) => [e].concat(\n      Object.keys(r).map((i) => {\n        let n = r[i];\n        return Array.isArray(n) || (n = [n]), n.map((o) => o === !0 ? i : `${i}=${o}`).join(\"; \");\n      })\n    ).join(\"; \")).join(\", \");\n  }).join(\", \");\n}\nvar nt = { format: rs, parse: ss };\nconst is = S, ns = S, os = S, ot = S, as = S, { randomBytes: ls, createHash: fs } = S, { URL: me } = S, T = oe, hs = rt, cs = it, {\n  BINARY_TYPES: ze,\n  EMPTY_BUFFER: Q,\n  GUID: us,\n  kForOnEventAttribute: ge,\n  kListener: ds,\n  kStatusCode: _s,\n  kWebSocket: y,\n  NOOP: at\n} = U, {\n  EventTarget: { addEventListener: ps, removeEventListener: ms }\n} = ts, { format: gs, parse: ys } = nt, { toBuffer: vs } = ne, Ss = 30 * 1e3, lt = Symbol(\"kAborted\"), ye = [8, 13], O = [\"CONNECTING\", \"OPEN\", \"CLOSING\", \"CLOSED\"], Es = /^[!#$%&'*+\\-.0-9A-Z^_`|a-z~]+$/;\nlet m = class d extends is {\n  /**\n   * Create a new `WebSocket`.\n   *\n   * @param {(String|URL)} address The URL to which to connect\n   * @param {(String|String[])} [protocols] The subprotocols\n   * @param {Object} [options] Connection options\n   */\n  constructor(e, t, r) {\n    super(), this._binaryType = ze[0], this._closeCode = 1006, this._closeFrameReceived = !1, this._closeFrameSent = !1, this._closeMessage = Q, this._closeTimer = null, this._extensions = {}, this._paused = !1, this._protocol = \"\", this._readyState = d.CONNECTING, this._receiver = null, this._sender = null, this._socket = null, e !== null ? (this._bufferedAmount = 0, this._isServer = !1, this._redirects = 0, t === void 0 ? t = [] : Array.isArray(t) || (typeof t == \"object\" && t !== null ? (r = t, t = []) : t = [t]), ht(this, e, t, r)) : this._isServer = !0;\n  }\n  /**\n   * This deviates from the WHATWG interface since ws doesn't support the\n   * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n   * type).\n   *\n   * @type {String}\n   */\n  get binaryType() {\n    return this._binaryType;\n  }\n  set binaryType(e) {\n    ze.includes(e) && (this._binaryType = e, this._receiver && (this._receiver._binaryType = e));\n  }\n  /**\n   * @type {Number}\n   */\n  get bufferedAmount() {\n    return this._socket ? this._socket._writableState.length + this._sender._bufferedBytes : this._bufferedAmount;\n  }\n  /**\n   * @type {String}\n   */\n  get extensions() {\n    return Object.keys(this._extensions).join();\n  }\n  /**\n   * @type {Boolean}\n   */\n  get isPaused() {\n    return this._paused;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onclose() {\n    return null;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onerror() {\n    return null;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onopen() {\n    return null;\n  }\n  /**\n   * @type {Function}\n   */\n  /* istanbul ignore next */\n  get onmessage() {\n    return null;\n  }\n  /**\n   * @type {String}\n   */\n  get protocol() {\n    return this._protocol;\n  }\n  /**\n   * @type {Number}\n   */\n  get readyState() {\n    return this._readyState;\n  }\n  /**\n   * @type {String}\n   */\n  get url() {\n    return this._url;\n  }\n  /**\n   * Set up the socket and the internal resources.\n   *\n   * @param {(net.Socket|tls.Socket)} socket The network socket between the\n   *     server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Object} options Options object\n   * @param {Function} [options.generateMask] The function used to generate the\n   *     masking key\n   * @param {Number} [options.maxPayload=0] The maximum allowed message size\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @private\n   */\n  setSocket(e, t, r) {\n    const i = new hs({\n      binaryType: this.binaryType,\n      extensions: this._extensions,\n      isServer: this._isServer,\n      maxPayload: r.maxPayload,\n      skipUTF8Validation: r.skipUTF8Validation\n    });\n    this._sender = new cs(e, this._extensions, r.generateMask), this._receiver = i, this._socket = e, i[y] = this, e[y] = this, i.on(\"conclude\", ks), i.on(\"drain\", ws), i.on(\"error\", Os), i.on(\"message\", Cs), i.on(\"ping\", Ts), i.on(\"pong\", Ls), e.setTimeout(0), e.setNoDelay(), t.length > 0 && e.unshift(t), e.on(\"close\", ut), e.on(\"data\", fe), e.on(\"end\", dt), e.on(\"error\", _t), this._readyState = d.OPEN, this.emit(\"open\");\n  }\n  /**\n   * Emit the `'close'` event.\n   *\n   * @private\n   */\n  emitClose() {\n    if (!this._socket) {\n      this._readyState = d.CLOSED, this.emit(\"close\", this._closeCode, this._closeMessage);\n      return;\n    }\n    this._extensions[T.extensionName] && this._extensions[T.extensionName].cleanup(), this._receiver.removeAllListeners(), this._readyState = d.CLOSED, this.emit(\"close\", this._closeCode, this._closeMessage);\n  }\n  /**\n   * Start a closing handshake.\n   *\n   *          +----------+   +-----------+   +----------+\n   *     - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n   *    |     +----------+   +-----------+   +----------+     |\n   *          +----------+   +-----------+         |\n   * CLOSING  |ws.close()|<--|close frame|<--+-----+       CLOSING\n   *          +----------+   +-----------+   |\n   *    |           |                        |   +---+        |\n   *                +------------------------+-->|fin| - - - -\n   *    |         +---+                      |   +---+\n   *     - - - - -|fin|<---------------------+\n   *              +---+\n   *\n   * @param {Number} [code] Status code explaining why the connection is closing\n   * @param {(String|Buffer)} [data] The reason why the connection is\n   *     closing\n   * @public\n   */\n  close(e, t) {\n    if (this.readyState !== d.CLOSED) {\n      if (this.readyState === d.CONNECTING) {\n        const r = \"WebSocket was closed before the connection was established\";\n        b(this, this._req, r);\n        return;\n      }\n      if (this.readyState === d.CLOSING) {\n        this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end();\n        return;\n      }\n      this._readyState = d.CLOSING, this._sender.close(e, t, !this._isServer, (r) => {\n        r || (this._closeFrameSent = !0, (this._closeFrameReceived || this._receiver._writableState.errorEmitted) && this._socket.end());\n      }), this._closeTimer = setTimeout(\n        this._socket.destroy.bind(this._socket),\n        Ss\n      );\n    }\n  }\n  /**\n   * Pause the socket.\n   *\n   * @public\n   */\n  pause() {\n    this.readyState === d.CONNECTING || this.readyState === d.CLOSED || (this._paused = !0, this._socket.pause());\n  }\n  /**\n   * Send a ping.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the ping is sent\n   * @public\n   */\n  ping(e, t, r) {\n    if (this.readyState === d.CONNECTING)\n      throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");\n    if (typeof e == \"function\" ? (r = e, e = t = void 0) : typeof t == \"function\" && (r = t, t = void 0), typeof e == \"number\" && (e = e.toString()), this.readyState !== d.OPEN) {\n      ve(this, e, r);\n      return;\n    }\n    t === void 0 && (t = !this._isServer), this._sender.ping(e || Q, t, r);\n  }\n  /**\n   * Send a pong.\n   *\n   * @param {*} [data] The data to send\n   * @param {Boolean} [mask] Indicates whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when the pong is sent\n   * @public\n   */\n  pong(e, t, r) {\n    if (this.readyState === d.CONNECTING)\n      throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");\n    if (typeof e == \"function\" ? (r = e, e = t = void 0) : typeof t == \"function\" && (r = t, t = void 0), typeof e == \"number\" && (e = e.toString()), this.readyState !== d.OPEN) {\n      ve(this, e, r);\n      return;\n    }\n    t === void 0 && (t = !this._isServer), this._sender.pong(e || Q, t, r);\n  }\n  /**\n   * Resume the socket.\n   *\n   * @public\n   */\n  resume() {\n    this.readyState === d.CONNECTING || this.readyState === d.CLOSED || (this._paused = !1, this._receiver._writableState.needDrain || this._socket.resume());\n  }\n  /**\n   * Send a data message.\n   *\n   * @param {*} data The message to send\n   * @param {Object} [options] Options object\n   * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n   *     text\n   * @param {Boolean} [options.compress] Specifies whether or not to compress\n   *     `data`\n   * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n   *     last one\n   * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n   * @param {Function} [cb] Callback which is executed when data is written out\n   * @public\n   */\n  send(e, t, r) {\n    if (this.readyState === d.CONNECTING)\n      throw new Error(\"WebSocket is not open: readyState 0 (CONNECTING)\");\n    if (typeof t == \"function\" && (r = t, t = {}), typeof e == \"number\" && (e = e.toString()), this.readyState !== d.OPEN) {\n      ve(this, e, r);\n      return;\n    }\n    const i = {\n      binary: typeof e != \"string\",\n      mask: !this._isServer,\n      compress: !0,\n      fin: !0,\n      ...t\n    };\n    this._extensions[T.extensionName] || (i.compress = !1), this._sender.send(e || Q, i, r);\n  }\n  /**\n   * Forcibly close the connection.\n   *\n   * @public\n   */\n  terminate() {\n    if (this.readyState !== d.CLOSED) {\n      if (this.readyState === d.CONNECTING) {\n        const e = \"WebSocket was closed before the connection was established\";\n        b(this, this._req, e);\n        return;\n      }\n      this._socket && (this._readyState = d.CLOSING, this._socket.destroy());\n    }\n  }\n};\nObject.defineProperty(m, \"CONNECTING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(m.prototype, \"CONNECTING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CONNECTING\")\n});\nObject.defineProperty(m, \"OPEN\", {\n  enumerable: !0,\n  value: O.indexOf(\"OPEN\")\n});\nObject.defineProperty(m.prototype, \"OPEN\", {\n  enumerable: !0,\n  value: O.indexOf(\"OPEN\")\n});\nObject.defineProperty(m, \"CLOSING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSING\")\n});\nObject.defineProperty(m.prototype, \"CLOSING\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSING\")\n});\nObject.defineProperty(m, \"CLOSED\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSED\")\n});\nObject.defineProperty(m.prototype, \"CLOSED\", {\n  enumerable: !0,\n  value: O.indexOf(\"CLOSED\")\n});\n[\n  \"binaryType\",\n  \"bufferedAmount\",\n  \"extensions\",\n  \"isPaused\",\n  \"protocol\",\n  \"readyState\",\n  \"url\"\n].forEach((s) => {\n  Object.defineProperty(m.prototype, s, { enumerable: !0 });\n});\n[\"open\", \"error\", \"close\", \"message\"].forEach((s) => {\n  Object.defineProperty(m.prototype, `on${s}`, {\n    enumerable: !0,\n    get() {\n      for (const e of this.listeners(s))\n        if (e[ge])\n          return e[ds];\n      return null;\n    },\n    set(e) {\n      for (const t of this.listeners(s))\n        if (t[ge]) {\n          this.removeListener(s, t);\n          break;\n        }\n      typeof e == \"function\" && this.addEventListener(s, e, {\n        [ge]: !0\n      });\n    }\n  });\n});\nm.prototype.addEventListener = ps;\nm.prototype.removeEventListener = ms;\nvar ft = m;\nfunction ht(s, e, t, r) {\n  const i = {\n    protocolVersion: ye[1],\n    maxPayload: 104857600,\n    skipUTF8Validation: !1,\n    perMessageDeflate: !0,\n    followRedirects: !1,\n    maxRedirects: 10,\n    ...r,\n    createConnection: void 0,\n    socketPath: void 0,\n    hostname: void 0,\n    protocol: void 0,\n    timeout: void 0,\n    method: \"GET\",\n    host: void 0,\n    path: void 0,\n    port: void 0\n  };\n  if (!ye.includes(i.protocolVersion))\n    throw new RangeError(\n      `Unsupported protocol version: ${i.protocolVersion} (supported versions: ${ye.join(\", \")})`\n    );\n  let n;\n  if (e instanceof me)\n    n = e, s._url = e.href;\n  else {\n    try {\n      n = new me(e);\n    } catch {\n      throw new SyntaxError(`Invalid URL: ${e}`);\n    }\n    s._url = e;\n  }\n  const o = n.protocol === \"wss:\", l = n.protocol === \"ws+unix:\";\n  let f;\n  if (n.protocol !== \"ws:\" && !o && !l ? f = `The URL's protocol must be one of \"ws:\", \"wss:\", or \"ws+unix:\"` : l && !n.pathname ? f = \"The URL's pathname is empty\" : n.hash && (f = \"The URL contains a fragment identifier\"), f) {\n    const u = new SyntaxError(f);\n    if (s._redirects === 0)\n      throw u;\n    ee(s, u);\n    return;\n  }\n  const a = o ? 443 : 80, c = ls(16).toString(\"base64\"), h = o ? ns.request : os.request, p = /* @__PURE__ */ new Set();\n  let v;\n  if (i.createConnection = o ? xs : bs, i.defaultPort = i.defaultPort || a, i.port = n.port || a, i.host = n.hostname.startsWith(\"[\") ? n.hostname.slice(1, -1) : n.hostname, i.headers = {\n    ...i.headers,\n    \"Sec-WebSocket-Version\": i.protocolVersion,\n    \"Sec-WebSocket-Key\": c,\n    Connection: \"Upgrade\",\n    Upgrade: \"websocket\"\n  }, i.path = n.pathname + n.search, i.timeout = i.handshakeTimeout, i.perMessageDeflate && (v = new T(\n    i.perMessageDeflate !== !0 ? i.perMessageDeflate : {},\n    !1,\n    i.maxPayload\n  ), i.headers[\"Sec-WebSocket-Extensions\"] = gs({\n    [T.extensionName]: v.offer()\n  })), t.length) {\n    for (const u of t) {\n      if (typeof u != \"string\" || !Es.test(u) || p.has(u))\n        throw new SyntaxError(\n          \"An invalid or duplicated subprotocol was specified\"\n        );\n      p.add(u);\n    }\n    i.headers[\"Sec-WebSocket-Protocol\"] = t.join(\",\");\n  }\n  if (i.origin && (i.protocolVersion < 13 ? i.headers[\"Sec-WebSocket-Origin\"] = i.origin : i.headers.Origin = i.origin), (n.username || n.password) && (i.auth = `${n.username}:${n.password}`), l) {\n    const u = i.path.split(\":\");\n    i.socketPath = u[0], i.path = u[1];\n  }\n  let _;\n  if (i.followRedirects) {\n    if (s._redirects === 0) {\n      s._originalIpc = l, s._originalSecure = o, s._originalHostOrSocketPath = l ? i.socketPath : n.host;\n      const u = r && r.headers;\n      if (r = { ...r, headers: {} }, u)\n        for (const [E, $] of Object.entries(u))\n          r.headers[E.toLowerCase()] = $;\n    } else if (s.listenerCount(\"redirect\") === 0) {\n      const u = l ? s._originalIpc ? i.socketPath === s._originalHostOrSocketPath : !1 : s._originalIpc ? !1 : n.host === s._originalHostOrSocketPath;\n      (!u || s._originalSecure && !o) && (delete i.headers.authorization, delete i.headers.cookie, u || delete i.headers.host, i.auth = void 0);\n    }\n    i.auth && !r.headers.authorization && (r.headers.authorization = \"Basic \" + Buffer.from(i.auth).toString(\"base64\")), _ = s._req = h(i), s._redirects && s.emit(\"redirect\", s.url, _);\n  } else\n    _ = s._req = h(i);\n  i.timeout && _.on(\"timeout\", () => {\n    b(s, _, \"Opening handshake has timed out\");\n  }), _.on(\"error\", (u) => {\n    _ === null || _[lt] || (_ = s._req = null, ee(s, u));\n  }), _.on(\"response\", (u) => {\n    const E = u.headers.location, $ = u.statusCode;\n    if (E && i.followRedirects && $ >= 300 && $ < 400) {\n      if (++s._redirects > i.maxRedirects) {\n        b(s, _, \"Maximum redirects exceeded\");\n        return;\n      }\n      _.abort();\n      let q;\n      try {\n        q = new me(E, e);\n      } catch {\n        const L = new SyntaxError(`Invalid URL: ${E}`);\n        ee(s, L);\n        return;\n      }\n      ht(s, q, t, r);\n    } else\n      s.emit(\"unexpected-response\", _, u) || b(\n        s,\n        _,\n        `Unexpected server response: ${u.statusCode}`\n      );\n  }), _.on(\"upgrade\", (u, E, $) => {\n    if (s.emit(\"upgrade\", u), s.readyState !== m.CONNECTING)\n      return;\n    if (_ = s._req = null, u.headers.upgrade.toLowerCase() !== \"websocket\") {\n      b(s, E, \"Invalid Upgrade header\");\n      return;\n    }\n    const q = fs(\"sha1\").update(c + us).digest(\"base64\");\n    if (u.headers[\"sec-websocket-accept\"] !== q) {\n      b(s, E, \"Invalid Sec-WebSocket-Accept header\");\n      return;\n    }\n    const D = u.headers[\"sec-websocket-protocol\"];\n    let L;\n    if (D !== void 0 ? p.size ? p.has(D) || (L = \"Server sent an invalid subprotocol\") : L = \"Server sent a subprotocol but none was requested\" : p.size && (L = \"Server sent no subprotocol\"), L) {\n      b(s, E, L);\n      return;\n    }\n    D && (s._protocol = D);\n    const ke = u.headers[\"sec-websocket-extensions\"];\n    if (ke !== void 0) {\n      if (!v) {\n        b(s, E, \"Server sent a Sec-WebSocket-Extensions header but no extension was requested\");\n        return;\n      }\n      let he;\n      try {\n        he = ys(ke);\n      } catch {\n        b(s, E, \"Invalid Sec-WebSocket-Extensions header\");\n        return;\n      }\n      const we = Object.keys(he);\n      if (we.length !== 1 || we[0] !== T.extensionName) {\n        b(s, E, \"Server indicated an extension that was not requested\");\n        return;\n      }\n      try {\n        v.accept(he[T.extensionName]);\n      } catch {\n        b(s, E, \"Invalid Sec-WebSocket-Extensions header\");\n        return;\n      }\n      s._extensions[T.extensionName] = v;\n    }\n    s.setSocket(E, $, {\n      generateMask: i.generateMask,\n      maxPayload: i.maxPayload,\n      skipUTF8Validation: i.skipUTF8Validation\n    });\n  }), i.finishRequest ? i.finishRequest(_, s) : _.end();\n}\nfunction ee(s, e) {\n  s._readyState = m.CLOSING, s.emit(\"error\", e), s.emitClose();\n}\nfunction bs(s) {\n  return s.path = s.socketPath, ot.connect(s);\n}\nfunction xs(s) {\n  return s.path = void 0, !s.servername && s.servername !== \"\" && (s.servername = ot.isIP(s.host) ? \"\" : s.host), as.connect(s);\n}\nfunction b(s, e, t) {\n  s._readyState = m.CLOSING;\n  const r = new Error(t);\n  Error.captureStackTrace(r, b), e.setHeader ? (e[lt] = !0, e.abort(), e.socket && !e.socket.destroyed && e.socket.destroy(), process.nextTick(ee, s, r)) : (e.destroy(r), e.once(\"error\", s.emit.bind(s, \"error\")), e.once(\"close\", s.emitClose.bind(s)));\n}\nfunction ve(s, e, t) {\n  if (e) {\n    const r = vs(e).length;\n    s._socket ? s._sender._bufferedBytes += r : s._bufferedAmount += r;\n  }\n  if (t) {\n    const r = new Error(\n      `WebSocket is not open: readyState ${s.readyState} (${O[s.readyState]})`\n    );\n    process.nextTick(t, r);\n  }\n}\nfunction ks(s, e) {\n  const t = this[y];\n  t._closeFrameReceived = !0, t._closeMessage = e, t._closeCode = s, t._socket[y] !== void 0 && (t._socket.removeListener(\"data\", fe), process.nextTick(ct, t._socket), s === 1005 ? t.close() : t.close(s, e));\n}\nfunction ws() {\n  const s = this[y];\n  s.isPaused || s._socket.resume();\n}\nfunction Os(s) {\n  const e = this[y];\n  e._socket[y] !== void 0 && (e._socket.removeListener(\"data\", fe), process.nextTick(ct, e._socket), e.close(s[_s])), e.emit(\"error\", s);\n}\nfunction Ye() {\n  this[y].emitClose();\n}\nfunction Cs(s, e) {\n  this[y].emit(\"message\", s, e);\n}\nfunction Ts(s) {\n  const e = this[y];\n  e.pong(s, !e._isServer, at), e.emit(\"ping\", s);\n}\nfunction Ls(s) {\n  this[y].emit(\"pong\", s);\n}\nfunction ct(s) {\n  s.resume();\n}\nfunction ut() {\n  const s = this[y];\n  this.removeListener(\"close\", ut), this.removeListener(\"data\", fe), this.removeListener(\"end\", dt), s._readyState = m.CLOSING;\n  let e;\n  !this._readableState.endEmitted && !s._closeFrameReceived && !s._receiver._writableState.errorEmitted && (e = s._socket.read()) !== null && s._receiver.write(e), s._receiver.end(), this[y] = void 0, clearTimeout(s._closeTimer), s._receiver._writableState.finished || s._receiver._writableState.errorEmitted ? s.emitClose() : (s._receiver.on(\"error\", Ye), s._receiver.on(\"finish\", Ye));\n}\nfunction fe(s) {\n  this[y]._receiver.write(s) || this.pause();\n}\nfunction dt() {\n  const s = this[y];\n  s._readyState = m.CLOSING, s._receiver.end(), this.end();\n}\nfunction _t() {\n  const s = this[y];\n  this.removeListener(\"error\", _t), this.on(\"error\", at), s && (s._readyState = m.CLOSING, this.destroy());\n}\nconst Xs = /* @__PURE__ */ z(ft), { tokenChars: Ns } = ae;\nfunction Ps(s) {\n  const e = /* @__PURE__ */ new Set();\n  let t = -1, r = -1, i = 0;\n  for (i; i < s.length; i++) {\n    const o = s.charCodeAt(i);\n    if (r === -1 && Ns[o] === 1)\n      t === -1 && (t = i);\n    else if (i !== 0 && (o === 32 || o === 9))\n      r === -1 && t !== -1 && (r = i);\n    else if (o === 44) {\n      if (t === -1)\n        throw new SyntaxError(`Unexpected character at index ${i}`);\n      r === -1 && (r = i);\n      const l = s.slice(t, r);\n      if (e.has(l))\n        throw new SyntaxError(`The \"${l}\" subprotocol is duplicated`);\n      e.add(l), t = r = -1;\n    } else\n      throw new SyntaxError(`Unexpected character at index ${i}`);\n  }\n  if (t === -1 || r !== -1)\n    throw new SyntaxError(\"Unexpected end of input\");\n  const n = s.slice(t, i);\n  if (e.has(n))\n    throw new SyntaxError(`The \"${n}\" subprotocol is duplicated`);\n  return e.add(n), e;\n}\nvar Rs = { parse: Ps };\nconst Us = S, ie = S, { createHash: Bs } = S, qe = nt, N = oe, $s = Rs, Ms = ft, { GUID: Is, kWebSocket: Ds } = U, Ws = /^[+/0-9A-Za-z]{22}==$/, Ke = 0, Xe = 1, pt = 2;\nclass As extends Us {\n  /**\n   * Create a `WebSocketServer` instance.\n   *\n   * @param {Object} options Configuration options\n   * @param {Number} [options.backlog=511] The maximum length of the queue of\n   *     pending connections\n   * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n   *     track clients\n   * @param {Function} [options.handleProtocols] A hook to handle protocols\n   * @param {String} [options.host] The hostname where to bind the server\n   * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n   *     size\n   * @param {Boolean} [options.noServer=false] Enable no server mode\n   * @param {String} [options.path] Accept only connections matching this path\n   * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n   *     permessage-deflate\n   * @param {Number} [options.port] The port where to bind the server\n   * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n   *     server to use\n   * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or\n   *     not to skip UTF-8 validation for text and close messages\n   * @param {Function} [options.verifyClient] A hook to reject connections\n   * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket`\n   *     class to use. It must be the `WebSocket` class or class that extends it\n   * @param {Function} [callback] A listener for the `listening` event\n   */\n  constructor(e, t) {\n    if (super(), e = {\n      maxPayload: 100 * 1024 * 1024,\n      skipUTF8Validation: !1,\n      perMessageDeflate: !1,\n      handleProtocols: null,\n      clientTracking: !0,\n      verifyClient: null,\n      noServer: !1,\n      backlog: null,\n      // use default (511 as implemented in net.js)\n      server: null,\n      host: null,\n      path: null,\n      port: null,\n      WebSocket: Ms,\n      ...e\n    }, e.port == null && !e.server && !e.noServer || e.port != null && (e.server || e.noServer) || e.server && e.noServer)\n      throw new TypeError(\n        'One and only one of the \"port\", \"server\", or \"noServer\" options must be specified'\n      );\n    if (e.port != null ? (this._server = ie.createServer((r, i) => {\n      const n = ie.STATUS_CODES[426];\n      i.writeHead(426, {\n        \"Content-Length\": n.length,\n        \"Content-Type\": \"text/plain\"\n      }), i.end(n);\n    }), this._server.listen(\n      e.port,\n      e.host,\n      e.backlog,\n      t\n    )) : e.server && (this._server = e.server), this._server) {\n      const r = this.emit.bind(this, \"connection\");\n      this._removeListeners = js(this._server, {\n        listening: this.emit.bind(this, \"listening\"),\n        error: this.emit.bind(this, \"error\"),\n        upgrade: (i, n, o) => {\n          this.handleUpgrade(i, n, o, r);\n        }\n      });\n    }\n    e.perMessageDeflate === !0 && (e.perMessageDeflate = {}), e.clientTracking && (this.clients = /* @__PURE__ */ new Set(), this._shouldEmitClose = !1), this.options = e, this._state = Ke;\n  }\n  /**\n   * Returns the bound address, the address family name, and port of the server\n   * as reported by the operating system if listening on an IP socket.\n   * If the server is listening on a pipe or UNIX domain socket, the name is\n   * returned as a string.\n   *\n   * @return {(Object|String|null)} The address of the server\n   * @public\n   */\n  address() {\n    if (this.options.noServer)\n      throw new Error('The server is operating in \"noServer\" mode');\n    return this._server ? this._server.address() : null;\n  }\n  /**\n   * Stop the server from accepting new connections and emit the `'close'` event\n   * when all existing connections are closed.\n   *\n   * @param {Function} [cb] A one-time listener for the `'close'` event\n   * @public\n   */\n  close(e) {\n    if (this._state === pt) {\n      e && this.once(\"close\", () => {\n        e(new Error(\"The server is not running\"));\n      }), process.nextTick(G, this);\n      return;\n    }\n    if (e && this.once(\"close\", e), this._state !== Xe)\n      if (this._state = Xe, this.options.noServer || this.options.server)\n        this._server && (this._removeListeners(), this._removeListeners = this._server = null), this.clients ? this.clients.size ? this._shouldEmitClose = !0 : process.nextTick(G, this) : process.nextTick(G, this);\n      else {\n        const t = this._server;\n        this._removeListeners(), this._removeListeners = this._server = null, t.close(() => {\n          G(this);\n        });\n      }\n  }\n  /**\n   * See if a given request should be handled by this server instance.\n   *\n   * @param {http.IncomingMessage} req Request object to inspect\n   * @return {Boolean} `true` if the request is valid, else `false`\n   * @public\n   */\n  shouldHandle(e) {\n    if (this.options.path) {\n      const t = e.url.indexOf(\"?\");\n      if ((t !== -1 ? e.url.slice(0, t) : e.url) !== this.options.path)\n        return !1;\n    }\n    return !0;\n  }\n  /**\n   * Handle a HTTP Upgrade request.\n   *\n   * @param {http.IncomingMessage} req The request object\n   * @param {(net.Socket|tls.Socket)} socket The network socket between the\n   *     server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @public\n   */\n  handleUpgrade(e, t, r, i) {\n    t.on(\"error\", Ze);\n    const n = e.headers[\"sec-websocket-key\"], o = +e.headers[\"sec-websocket-version\"];\n    if (e.method !== \"GET\") {\n      R(this, e, t, 405, \"Invalid HTTP method\");\n      return;\n    }\n    if (e.headers.upgrade.toLowerCase() !== \"websocket\") {\n      R(this, e, t, 400, \"Invalid Upgrade header\");\n      return;\n    }\n    if (!n || !Ws.test(n)) {\n      R(this, e, t, 400, \"Missing or invalid Sec-WebSocket-Key header\");\n      return;\n    }\n    if (o !== 8 && o !== 13) {\n      R(this, e, t, 400, \"Missing or invalid Sec-WebSocket-Version header\");\n      return;\n    }\n    if (!this.shouldHandle(e)) {\n      H(t, 400);\n      return;\n    }\n    const l = e.headers[\"sec-websocket-protocol\"];\n    let f = /* @__PURE__ */ new Set();\n    if (l !== void 0)\n      try {\n        f = $s.parse(l);\n      } catch {\n        R(this, e, t, 400, \"Invalid Sec-WebSocket-Protocol header\");\n        return;\n      }\n    const a = e.headers[\"sec-websocket-extensions\"], c = {};\n    if (this.options.perMessageDeflate && a !== void 0) {\n      const h = new N(\n        this.options.perMessageDeflate,\n        !0,\n        this.options.maxPayload\n      );\n      try {\n        const p = qe.parse(a);\n        p[N.extensionName] && (h.accept(p[N.extensionName]), c[N.extensionName] = h);\n      } catch {\n        R(this, e, t, 400, \"Invalid or unacceptable Sec-WebSocket-Extensions header\");\n        return;\n      }\n    }\n    if (this.options.verifyClient) {\n      const h = {\n        origin: e.headers[`${o === 8 ? \"sec-websocket-origin\" : \"origin\"}`],\n        secure: !!(e.socket.authorized || e.socket.encrypted),\n        req: e\n      };\n      if (this.options.verifyClient.length === 2) {\n        this.options.verifyClient(h, (p, v, _, u) => {\n          if (!p)\n            return H(t, v || 401, _, u);\n          this.completeUpgrade(\n            c,\n            n,\n            f,\n            e,\n            t,\n            r,\n            i\n          );\n        });\n        return;\n      }\n      if (!this.options.verifyClient(h))\n        return H(t, 401);\n    }\n    this.completeUpgrade(c, n, f, e, t, r, i);\n  }\n  /**\n   * Upgrade the connection to WebSocket.\n   *\n   * @param {Object} extensions The accepted extensions\n   * @param {String} key The value of the `Sec-WebSocket-Key` header\n   * @param {Set} protocols The subprotocols\n   * @param {http.IncomingMessage} req The request object\n   * @param {(net.Socket|tls.Socket)} socket The network socket between the\n   *     server and client\n   * @param {Buffer} head The first packet of the upgraded stream\n   * @param {Function} cb Callback\n   * @throws {Error} If called more than once with the same socket\n   * @private\n   */\n  completeUpgrade(e, t, r, i, n, o, l) {\n    if (!n.readable || !n.writable)\n      return n.destroy();\n    if (n[Ds])\n      throw new Error(\n        \"server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration\"\n      );\n    if (this._state > Ke)\n      return H(n, 503);\n    const a = [\n      \"HTTP/1.1 101 Switching Protocols\",\n      \"Upgrade: websocket\",\n      \"Connection: Upgrade\",\n      `Sec-WebSocket-Accept: ${Bs(\"sha1\").update(t + Is).digest(\"base64\")}`\n    ], c = new this.options.WebSocket(null);\n    if (r.size) {\n      const h = this.options.handleProtocols ? this.options.handleProtocols(r, i) : r.values().next().value;\n      h && (a.push(`Sec-WebSocket-Protocol: ${h}`), c._protocol = h);\n    }\n    if (e[N.extensionName]) {\n      const h = e[N.extensionName].params, p = qe.format({\n        [N.extensionName]: [h]\n      });\n      a.push(`Sec-WebSocket-Extensions: ${p}`), c._extensions = e;\n    }\n    this.emit(\"headers\", a, i), n.write(a.concat(`\\r\n`).join(`\\r\n`)), n.removeListener(\"error\", Ze), c.setSocket(n, o, {\n      maxPayload: this.options.maxPayload,\n      skipUTF8Validation: this.options.skipUTF8Validation\n    }), this.clients && (this.clients.add(c), c.on(\"close\", () => {\n      this.clients.delete(c), this._shouldEmitClose && !this.clients.size && process.nextTick(G, this);\n    })), l(c, i);\n  }\n}\nvar Fs = As;\nfunction js(s, e) {\n  for (const t of Object.keys(e))\n    s.on(t, e[t]);\n  return function() {\n    for (const r of Object.keys(e))\n      s.removeListener(r, e[r]);\n  };\n}\nfunction G(s) {\n  s._state = pt, s.emit(\"close\");\n}\nfunction Ze() {\n  this.destroy();\n}\nfunction H(s, e, t, r) {\n  t = t || ie.STATUS_CODES[e], r = {\n    Connection: \"close\",\n    \"Content-Type\": \"text/html\",\n    \"Content-Length\": Buffer.byteLength(t),\n    ...r\n  }, s.once(\"finish\", s.destroy), s.end(\n    `HTTP/1.1 ${e} ${ie.STATUS_CODES[e]}\\r\n` + Object.keys(r).map((i) => `${i}: ${r[i]}`).join(`\\r\n`) + `\\r\n\\r\n` + t\n  );\n}\nfunction R(s, e, t, r, i) {\n  if (s.listenerCount(\"wsClientError\")) {\n    const n = new Error(i);\n    Error.captureStackTrace(n, R), s.emit(\"wsClientError\", n, t, e);\n  } else\n    H(t, r, i);\n}\nconst Zs = /* @__PURE__ */ z(Fs);\nexport {\n  qs as Receiver,\n  Ks as Sender,\n  Xs as WebSocket,\n  Zs as WebSocketServer,\n  Vs as createWebSocketStream,\n  Xs as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/example/index.js",
    "content": "const {\n  SvelteComponent: u,\n  append: c,\n  attr: d,\n  detach: g,\n  element: v,\n  init: o,\n  insert: r,\n  noop: f,\n  safe_not_equal: y,\n  set_data: m,\n  text: b,\n  toggle_class: _\n} = window.__gradio__svelte__internal;\nfunction w(a) {\n  let e, n = (\n    /*value*/\n    (a[0] ? (\n      /*value*/\n      a[0]\n    ) : \"\") + \"\"\n  ), s;\n  return {\n    c() {\n      e = v(\"div\"), s = b(n), d(e, \"class\", \"svelte-1gecy8w\"), _(\n        e,\n        \"table\",\n        /*type*/\n        a[1] === \"table\"\n      ), _(\n        e,\n        \"gallery\",\n        /*type*/\n        a[1] === \"gallery\"\n      ), _(\n        e,\n        \"selected\",\n        /*selected*/\n        a[2]\n      );\n    },\n    m(t, l) {\n      r(t, e, l), c(e, s);\n    },\n    p(t, [l]) {\n      l & /*value*/\n      1 && n !== (n = /*value*/\n      (t[0] ? (\n        /*value*/\n        t[0]\n      ) : \"\") + \"\") && m(s, n), l & /*type*/\n      2 && _(\n        e,\n        \"table\",\n        /*type*/\n        t[1] === \"table\"\n      ), l & /*type*/\n      2 && _(\n        e,\n        \"gallery\",\n        /*type*/\n        t[1] === \"gallery\"\n      ), l & /*selected*/\n      4 && _(\n        e,\n        \"selected\",\n        /*selected*/\n        t[2]\n      );\n    },\n    i: f,\n    o: f,\n    d(t) {\n      t && g(e);\n    }\n  };\n}\nfunction h(a, e, n) {\n  let { value: s } = e, { type: t } = e, { selected: l = !1 } = e;\n  return a.$$set = (i) => {\n    \"value\" in i && n(0, s = i.value), \"type\" in i && n(1, t = i.type), \"selected\" in i && n(2, l = i.selected);\n  }, [s, t, l];\n}\nclass E extends u {\n  constructor(e) {\n    super(), o(this, e, h, w, y, { value: 0, type: 1, selected: 2 });\n  }\n}\nexport {\n  E as default\n};\n"
  },
  {
    "path": "freesplatter/webui/gradio_custommodel3d/templates/example/style.css",
    "content": ".gallery.svelte-1gecy8w{padding:var(--size-1) var(--size-2)}\n"
  },
  {
    "path": "freesplatter/webui/parameters.py",
    "content": "from collections import OrderedDict\n\n\nnerf_mesh_defaults = OrderedDict([\n    ('prompt', None),\n    ('negative_prompt', None),\n    ('scheduler', None),\n    ('steps', None),\n    ('denoising_strength', None),\n    ('random_init', None),\n    ('cfg_scale', 7),\n    ('checkpoint', 'runwayml/stable-diffusion-v1-5'),\n    ('aux_prompt', 'best quality, sharp focus, photorealistic, extremely detailed'),\n    ('aux_negative_prompt', 'worst quality, low quality, depth of field, blurry, out of focus, low-res, '\n                            'illustration, painting, drawing'),\n    ('diff_bs', None),\n    ('patch_size', 128),\n    ('patch_bs_nerf', 1),\n    ('render_bs', 8),\n    ('patch_bs', 8),\n    ('alpha_soften', 0.02),\n    ('normal_reg_weight', 4.0),\n    ('start_entropy_weight', 0.0),\n    ('end_entropy_weight', 4.0),\n    ('entropy_d', 0.015),\n    ('mesh_smoothness', 5.0),\n    ('n_inverse_steps', None),\n    ('init_inverse_steps', None),\n    ('tet_init_inverse_steps', 120),\n    ('start_lr', 0.01),\n    ('end_lr', 0.005),\n    ('tet_resolution', None)])\n\nsuperres_defaults = OrderedDict([\n    ('do_superres', None),\n    ('scheduler', None),\n    ('steps', None),\n    ('denoising_strength', None),\n    ('random_init', None),\n    ('cfg_scale', 7),\n    ('checkpoint', 'runwayml/stable-diffusion-v1-5'),\n    ('aux_prompt', 'best quality, sharp focus, photorealistic, extremely detailed'),\n    ('aux_negative_prompt', 'worst quality, low quality, depth of field, blurry, out of focus, low-res, '\n                            'illustration, painting, drawing'),\n    ('patch_size', 512),\n    ('patch_bs', 1),\n    ('n_inverse_steps', None),\n    ('start_lr', 0.01),\n    ('end_lr', 0.01)])\n\nimage_defaults = OrderedDict([\n    ('width', 512),\n    ('height', 512),\n    ('prompt', None),\n    ('negative_prompt', None),\n    ('scheduler', None),\n    ('steps', None),\n    ('cfg_scale', 7),\n    ('checkpoint', 'Lykon/dreamshaper-8'),\n    ('aux_prompt', 'best quality, sharp focus, photorealistic, extremely detailed'),\n    ('aux_negative_prompt', 'worst quality, low quality, depth of field, blurry, out of focus, low-res, '\n                            'illustration, painting, drawing')])\n\nretex_defaults = OrderedDict([\n    ('prompt', None),\n    ('negative_prompt', None),\n    ('scheduler', None),\n    ('steps', None),\n    ('denoising_strength', None),\n    ('random_init', None),\n    ('cfg_scale', 7),\n    ('force_auto_uv', False),\n    ('checkpoint', 'Lykon/dreamshaper-8'),\n    ('aux_prompt', 'best quality'),\n    ('aux_negative_prompt', 'worst quality, low quality'),\n    ('diff_bs', None),\n    ('patch_size', 512),\n    ('render_bs', 8),\n    ('patch_bs', 1),\n    ('n_inverse_steps', None),\n    ('init_inverse_steps', None),\n    ('start_lr', 0.01),\n    ('end_lr', 0.01)]\n)\n\nstablessdnerf_signatures = OrderedDict([\n    ('prompt', None),\n    ('negative_prompt', None),\n    ('scheduler', None),\n    ('steps', None),\n    ('cfg_scale', 7),\n    ('render_bs', 4)]\n)\n\ntext_3d_to_3d_params = dict(\n    normal_reg_weight=0.6,\n    start_entropy_weight=0.25,\n    end_entropy_weight=3.0,\n    mesh_smoothness=0.5,\n    start_lr=0.0075,\n    alpha_soften=0.0,\n)\n\ntext_3d_to_3d_superres_params = dict(\n    checkpoint='Lykon/dreamshaper-8'\n)\n\ninstruct_3d_to_3d_params = dict(\n    normal_reg_weight=2.0,\n    start_entropy_weight=0.0,\n    end_entropy_weight=4.0,\n    mesh_smoothness=0.5,\n    entropy_d=0.02,\n    start_lr=0.0075,\n    aux_prompt='',\n    aux_negative_prompt='blur the texture',\n)\n\ninstruct_retex_params = dict(\n    aux_prompt='',\n    aux_negative_prompt='blur the texture',\n)\n\nstablessdnerf_to_mesh_params = dict(\n    normal_reg_weight=0.1,\n    start_entropy_weight=0.25,\n    end_entropy_weight=3.0,\n    mesh_smoothness=0.5,\n    start_lr=0.01,\n    alpha_soften=0.0,\n)\n\n\ndef parse_3d_args(args, kwargs):\n    nerf_mesh_kwargs = {\n        k: kwargs[k] if k in kwargs else args.pop(0) for k in nerf_mesh_defaults.keys()}\n    superres_kwargs = {\n        k: kwargs['superres_' + k] if 'superres_' + k in kwargs else args.pop(0) for k in superres_defaults.keys()}\n    init_images = args\n    return nerf_mesh_kwargs, superres_kwargs, init_images\n\n\ndef parse_2d_args(args, kwargs):\n    image_kwargs = {\n        k: kwargs[k] if k in kwargs else args.pop(0) for k in image_defaults.keys()}\n    return image_kwargs\n\n\ndef parse_retex_args(args, kwargs):\n    retex_kwargs = {\n        k: kwargs[k] if k in kwargs else args.pop(0) for k in retex_defaults.keys()}\n    superres_kwargs = {\n        k: kwargs['superres_' + k] if 'superres_' + k in kwargs else args.pop(0) for k in superres_defaults.keys()}\n    if len(args) == 0:\n        in_image = None\n    elif len(args) == 1:\n        in_image = args[0]\n    else:\n        raise ValueError\n    return retex_kwargs, superres_kwargs, in_image\n\n\ndef parse_stablessdnerf_args(args, kwargs):\n    stablessdnerf_kwargs = {\n        k: kwargs[k] if k in kwargs else args.pop(0) for k in stablessdnerf_signatures.keys()}\n    return stablessdnerf_kwargs\n"
  },
  {
    "path": "freesplatter/webui/runner.py",
    "content": "import os\nimport json\nimport uuid\nimport time\nimport rembg\nimport numpy as np\nimport trimesh\nimport torch\nimport fpsample\nimport fast_simplification\nimport matplotlib.pyplot as plt\ncmap = plt.get_cmap(\"hsv\")\nfrom torchvision.transforms import v2\nfrom pytorch_lightning import seed_everything\nfrom PIL import Image\nfrom omegaconf import OmegaConf\nfrom einops import rearrange\nfrom scipy.spatial.transform import Rotation\nfrom safetensors import safe_open\nfrom huggingface_hub import hf_hub_download\n\nfrom transformers import AutoModelForImageSegmentation\nfrom diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler\n\nfrom freesplatter.hunyuan.hunyuan3d_mvd_std_pipeline import HunYuan3D_MVD_Std_Pipeline\nfrom freesplatter.utils.mesh_optim import optimize_mesh\nfrom freesplatter.utils.camera_util import *\nfrom freesplatter.utils.recon_util import *\nfrom freesplatter.utils.infer_util import *\nfrom freesplatter.webui.camera_viewer.visualizer import CameraVisualizer\n\n\ndef inv_sigmoid(x: torch.Tensor) -> torch.Tensor:\n    return torch.log(x / (1.0 - x))\n\n\ndef save_gaussian(latent, gs_vis_path, model, opacity_threshold=None, pad_2dgs_scale=True):\n    if latent.ndim == 3:\n        latent = latent[0]\n\n    sh_dim = model.sh_dim\n    scale_dim = 2 if model.use_2dgs else 3\n    xyz, features, opacity, scaling, rotation = latent.split([3, sh_dim, 1, scale_dim, 4], dim=-1)\n    features = features.reshape(features.shape[0], sh_dim//3, 3)\n\n    if opacity_threshold is not None:\n        index = torch.nonzero(opacity.sigmoid() > opacity_threshold)[:, 0]\n        xyz = xyz[index]\n        features = features[index]\n        opacity = opacity[index]\n        scaling = scaling[index]\n        rotation = rotation[index]\n    \n    # transform gaussians from reference view to world view\n    cam2world = create_camera_to_world(torch.tensor([0, -2, 0]), camera_system='opencv').to(latent)\n    R, T = cam2world[:3, :3], cam2world[:3, 3].reshape(1, 3)\n    xyz = xyz @ R.T + T\n    rotation = rotation.detach().cpu().numpy()\n    rotation = Rotation.from_quat(rotation[:, [1, 2, 3, 0]]).as_matrix()\n    rotation = R.detach().cpu().numpy() @ rotation\n    rotation = Rotation.from_matrix(rotation).as_quat()[:, [3, 0, 1, 2]]\n    rotation = torch.from_numpy(rotation).to(latent)\n    \n    # pad 2DGS with an additional z-scale for visualization\n    if scaling.shape[-1] == 2 and pad_2dgs_scale:\n        z_scaling = inv_sigmoid(torch.ones_like(scaling[:, :1]) * 0.001)\n        scaling = torch.cat([scaling, z_scaling], dim=-1)\n    pc_vis = model.gs_renderer.gaussian_model.set_data(\n        xyz.float(), features.float(), scaling.float(), rotation.float(), opacity.float())\n    pc_vis.save_ply_vis(gs_vis_path)\n\n\nclass FreeSplatterRunner:\n    def __init__(self, device):\n        self.device = device\n\n        # background remover\n        self.rembg = AutoModelForImageSegmentation.from_pretrained(\n            \"briaai/RMBG-2.0\",\n            trust_remote_code=True,\n            cache_dir='ckpts/',\n        ).to(device)\n        self.rembg.eval()\n\n        # diffusion models\n        pipeline = DiffusionPipeline.from_pretrained(\n            \"sudo-ai/zero123plus-v1.1\", \n            custom_pipeline=\"sudo-ai/zero123plus-pipeline\",\n            torch_dtype=torch.float16,\n            cache_dir=\"ckpts/\",\n        )\n        pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(\n            pipeline.scheduler.config, timestep_spacing='trailing'\n        )\n        self.zero123plus_v11 = pipeline.to(device)\n\n        pipeline = DiffusionPipeline.from_pretrained(\n            \"sudo-ai/zero123plus-v1.2\", \n            custom_pipeline=\"sudo-ai/zero123plus-pipeline\",\n            torch_dtype=torch.float16,\n            cache_dir=\"ckpts/\",\n        )\n        pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(\n            pipeline.scheduler.config, timestep_spacing='trailing'\n        )\n        self.zero123plus_v12 = pipeline.to(device)\n\n        pipeline = HunYuan3D_MVD_Std_Pipeline.from_pretrained(\n            './ckpts/Hunyuan3D-1/mvd_std',\n            torch_dtype=torch.float16,\n            use_safetensors=True,\n        )\n        self.hunyuan3d_mvd_std = pipeline.to(device)\n\n        # freesplatter\n        config_file = 'configs/freesplatter-object.yaml'\n        ckpt_path = hf_hub_download('TencentARC/FreeSplatter', repo_type='model', filename='freesplatter-object.safetensors', local_dir='./ckpts/FreeSplatter')\n        model = instantiate_from_config(OmegaConf.load(config_file).model)\n        state_dict = {}\n        with safe_open(ckpt_path, framework=\"pt\", device=\"cpu\") as f:\n            for key in f.keys():\n                state_dict[key] = f.get_tensor(key)\n        model.load_state_dict(state_dict, strict=True)\n        self.freesplatter = model.eval().to(device)\n\n        config_file = 'configs/freesplatter-object-2dgs.yaml'\n        ckpt_path = hf_hub_download('TencentARC/FreeSplatter', repo_type='model', filename='freesplatter-object-2dgs.safetensors', local_dir='./ckpts/FreeSplatter')\n        model = instantiate_from_config(OmegaConf.load(config_file).model)\n        state_dict = {}\n        with safe_open(ckpt_path, framework=\"pt\", device=\"cpu\") as f:\n            for key in f.keys():\n                state_dict[key] = f.get_tensor(key)\n        model.load_state_dict(state_dict, strict=True)\n        self.freesplatter_2dgs = model.eval().to(device)\n\n        config_file = 'configs/freesplatter-scene.yaml'\n        ckpt_path = hf_hub_download('TencentARC/FreeSplatter', repo_type='model', filename='freesplatter-scene.safetensors', local_dir='./ckpts/FreeSplatter')\n        model = instantiate_from_config(OmegaConf.load(config_file).model)\n        state_dict = {}\n        with safe_open(ckpt_path, framework=\"pt\", device=\"cpu\") as f:\n            for key in f.keys():\n                state_dict[key] = f.get_tensor(key)\n        model.load_state_dict(state_dict, strict=True)\n        self.freesplatter_scene = model.eval().to(device)\n\n    @torch.inference_mode()\n    def run_segmentation(\n        self, \n        image, \n        do_rembg=True,\n    ):\n        torch.cuda.empty_cache()\n\n        if do_rembg:\n            image = remove_background(image, self.rembg)\n\n        return image\n\n    def run_img_to_3d(\n        self, \n        image_rgba, \n        model='Zero123++ v1.2', \n        diffusion_steps=30, \n        guidance_scale=4.0,\n        seed=42, \n        view_indices=[],\n        gs_type='2DGS',\n        mesh_reduction=0.5,\n        cache_dir=None,\n    ):\n        torch.cuda.empty_cache()\n\n        self.output_dir = os.path.join(cache_dir, f'output_{uuid.uuid4()}')\n        os.makedirs(self.output_dir, exist_ok=True)\n\n        # image-to-multiview\n        input_image = resize_foreground(image_rgba, 0.9)\n        seed_everything(seed)\n        if model == 'Zero123++ v1.1':\n            output_image = self.zero123plus_v11(\n                input_image, \n                num_inference_steps=diffusion_steps, \n                guidance_scale=guidance_scale,\n            ).images[0]\n        elif model == 'Zero123++ v1.2':\n            output_image = self.zero123plus_v12(\n                input_image, \n                num_inference_steps=diffusion_steps, \n                guidance_scale=guidance_scale,\n            ).images[0]\n        elif model == 'Hunyuan3D Std':\n            output_image = self.hunyuan3d_mvd_std(\n                input_image, \n                num_inference_steps=diffusion_steps, \n                guidance_scale=guidance_scale, \n                guidance_curve=lambda t:2.0,\n            ).images[0]\n        else:\n            raise ValueError(f'Unknown model: {model}')\n        \n        # preprocess images\n        image, alpha = rgba_to_white_background(input_image)\n        image = v2.functional.resize(image, 512, interpolation=3, antialias=True).clamp(0, 1)\n        alpha = v2.functional.resize(alpha, 512, interpolation=0, antialias=True).clamp(0, 1)\n\n        output_image_rgba = remove_background(output_image, self.rembg)\n        if 'Zero123++' in model:\n            images, alphas = rgba_to_white_background(output_image_rgba)\n        else:\n            _, alphas = rgba_to_white_background(output_image_rgba)\n            images = torch.from_numpy(np.asarray(output_image) / 255.0).float()\n            images = rearrange(images, 'h w c -> c h w')\n\n        images = rearrange(images, 'c (n h) (m w) -> (n m) c h w', n=3, m=2)\n        alphas = rearrange(alphas, 'c (n h) (m w) -> (n m) c h w', n=3, m=2)\n        if model == 'Hunyuan3D Std':\n            images = images[[0, 2, 4, 5, 3, 1]]\n            alphas = alphas[[0, 2, 4, 5, 3, 1]]\n        images_vis = v2.functional.to_pil_image(rearrange(images, 'nm c h w -> c h (nm w)'))\n        images = v2.functional.resize(images, 512, interpolation=3, antialias=True).clamp(0, 1)\n        alphas = v2.functional.resize(alphas, 512, interpolation=0, antialias=True).clamp(0, 1)\n\n        images = torch.cat([image.unsqueeze(0), images], dim=0)     # 7 x 3 x 512 x 512\n        alphas = torch.cat([alpha.unsqueeze(0), alphas], dim=0)     # 7 x 1 x 512 x 512\n\n        # run reconstruction\n        view_indices = [1, 2, 3, 4, 5, 6] if len(view_indices) == 0 else view_indices\n        images, alphas = images[view_indices], alphas[view_indices]\n        legends = [f'V{i}' if i != 0 else 'Input' for i in view_indices]\n\n        gs_vis_path, video_path, mesh_fine_path, fig = self.run_freesplatter_object(\n            images, alphas, legends=legends, gs_type=gs_type, mesh_reduction=mesh_reduction)\n\n        return images_vis, gs_vis_path, video_path, mesh_fine_path, fig\n    \n    def run_views_to_3d(\n        self, \n        image_files, \n        do_rembg=False,\n        gs_type='2DGS',\n        mesh_reduction=0.5,\n        cache_dir=None,\n    ):\n        torch.cuda.empty_cache()\n\n        self.output_dir = os.path.join(cache_dir, f'output_{uuid.uuid4()}')\n        os.makedirs(self.output_dir, exist_ok=True)\n\n        # preprocesss images\n        images, alphas = [], []\n        for image_file in image_files:\n            if isinstance(image_file, tuple):\n                image_file = image_file[0]\n            image = Image.open(image_file)\n            w, h = image.size\n\n            image_rgba = self.run_segmentation(image)\n            if image.mode == 'RGBA':\n                image, alpha = rgba_to_white_background(image_rgba)\n                image = v2.functional.center_crop(image, min(h, w))\n                alpha = v2.functional.center_crop(alpha, min(h, w))\n            else:\n                image_rgba = resize_foreground(image_rgba, 0.9)\n                image_rgba.save('test.png')\n                image, alpha = rgba_to_white_background(image_rgba)\n            \n            image = v2.functional.resize(image, 512, interpolation=3, antialias=True).clamp(0, 1)\n            alpha = v2.functional.resize(alpha, 512, interpolation=0, antialias=True).clamp(0, 1)\n\n            images.append(image)\n            alphas.append(alpha)\n\n        images = torch.stack(images, dim=0)\n        alphas = torch.stack(alphas, dim=0)\n        images_vis = v2.functional.to_pil_image(rearrange(images, 'n c h w -> c h (n w)'))\n\n        # run reconstruction\n        legends = [f'V{i}' for i in range(1, 1+len(images))]\n\n        gs_vis_path, video_path, mesh_fine_path, fig = self.run_freesplatter_object(\n            images, alphas, legends=legends, gs_type=gs_type, mesh_reduction=mesh_reduction)\n\n        return images_vis, gs_vis_path, video_path, mesh_fine_path, fig\n    \n    def run_freesplatter_object(\n        self, \n        images, \n        alphas, \n        legends=None, \n        gs_type='2DGS', \n        mesh_reduction=0.5,\n    ):\n        torch.cuda.empty_cache()\n        device = self.device\n\n        freesplatter = self.freesplatter_2dgs if gs_type == '2DGS' else self.freesplatter\n\n        images, alphas = images.to(device), alphas.to(device)\n        \n        t0 = time.time()\n        with torch.inference_mode():\n            gaussians = freesplatter.forward_gaussians(images.unsqueeze(0))\n        t1 = time.time()\n\n        # estimate camera parameters and visualize\n        c2ws_pred, focals_pred = freesplatter.estimate_poses(images, gaussians, masks=alphas, use_first_focal=True, pnp_iter=10)\n        fig = self.visualize_cameras_object(images, c2ws_pred, focals_pred, legends=legends)\n        t2 = time.time()\n        \n        # save gaussians\n        gs_vis_path = os.path.join(self.output_dir, 'gs_vis.ply')\n        save_gaussian(gaussians, gs_vis_path, freesplatter, opacity_threshold=5e-3, pad_2dgs_scale=True)\n        print(f'Save gaussian at {gs_vis_path}')\n\n        # render video\n        with torch.inference_mode():\n            c2ws_video = get_circular_cameras(N=120, elevation=0, radius=2.0, normalize=True).to(device)\n            fx = fy = focals_pred.mean() / 512.0\n            cx = cy = torch.ones_like(fx) * 0.5\n            fxfycxcy_video = torch.tensor([fx, fy, cx, cy]).unsqueeze(0).repeat(c2ws_video.shape[0], 1).to(device)\n\n            video_frames = freesplatter.forward_renderer(\n                gaussians,\n                c2ws_video.unsqueeze(0),\n                fxfycxcy_video.unsqueeze(0),\n            )['image'][0].clamp(0, 1)\n\n        video_path = os.path.join(self.output_dir, 'gs.mp4')\n        save_video(video_frames, video_path, fps=30)\n        print(f'Save video at {video_path}')\n        t3 = time.time()\n\n        # extract mesh\n        with torch.inference_mode():\n            c2ws_fusion = get_fibonacci_cameras(N=120, radius=2.0)\n            c2ws_fusion, _ = normalize_cameras(c2ws_fusion, camera_position=torch.tensor([0., -2., 0.]), camera_system='opencv')\n            c2ws_fusion = c2ws_fusion.to(device)\n            c2ws_fusion_reference = torch.linalg.inv(c2ws_fusion[0:1]) @ c2ws_fusion\n            fx = fy = focals_pred.mean() / 512.0\n            cx = cy = torch.ones_like(fx) * 0.5\n            fov = np.rad2deg(np.arctan(0.5 / fx.item())) * 2\n            fxfycxcy_fusion = torch.tensor([fx, fy, cx, cy]).unsqueeze(0).repeat(c2ws_fusion.shape[0], 1).to(device)\n\n            fusion_render_results = freesplatter.forward_renderer(\n                gaussians,\n                c2ws_fusion_reference.unsqueeze(0),\n                fxfycxcy_fusion.unsqueeze(0),\n            )\n            images_fusion = fusion_render_results['image'][0].clamp(0, 1).permute(0, 2, 3, 1)\n            alphas_fusion = fusion_render_results['alpha'][0].permute(0, 2, 3, 1)\n            depths_fusion = fusion_render_results['depth'][0].permute(0, 2, 3, 1)\n\n            fusion_images = (images_fusion.detach().cpu().numpy()*255).clip(0, 255).astype(np.uint8)\n            fusion_depths = depths_fusion.detach().cpu().numpy()\n            fusion_alphas = alphas_fusion.detach().cpu().numpy()\n            fusion_masks = (fusion_alphas > 1e-2).astype(np.uint8)\n            fusion_depths = fusion_depths * fusion_masks - np.ones_like(fusion_depths) * (1 - fusion_masks)\n\n            fusion_c2ws = c2ws_fusion.detach().cpu().numpy()\n\n            mesh_path = os.path.join(self.output_dir, 'mesh.obj')\n            rgbd_to_mesh(\n                fusion_images, fusion_depths, fusion_c2ws, fov, mesh_path, cam_elev_thr=-90)    # use all angles for tsdf fusion\n            print(f'Save mesh at {mesh_path}')\n            t4 = time.time()\n\n        # optimize texture\n        cam_pos = c2ws_fusion[:, :3, 3].cpu().numpy()\n        cam_inds = torch.from_numpy(fpsample.fps_sampling(cam_pos, 16).astype(int)).to(device=device)\n\n        alphas_bake = alphas_fusion[cam_inds]\n        images_bake = (images_fusion[cam_inds] - (1 - alphas_bake)) / alphas_bake.clamp(min=1e-6)\n\n        fxfycxcy = fxfycxcy_fusion[cam_inds].clone()\n        intrinsics = torch.eye(3).unsqueeze(0).repeat(len(cam_inds), 1, 1).to(fxfycxcy)\n        intrinsics[:, 0, 0] = fxfycxcy[:, 0]\n        intrinsics[:, 0, 2] = fxfycxcy[:, 2]\n        intrinsics[:, 1, 1] = fxfycxcy[:, 1]\n        intrinsics[:, 1, 2] = fxfycxcy[:, 3]\n\n        # out_mesh = Mesh.load(str(mesh_path), auto_uv=False, device='cpu')\n        out_mesh = trimesh.load(str(mesh_path), process=False)\n        out_mesh = optimize_mesh(\n            out_mesh, \n            images_bake, \n            alphas_bake.squeeze(-1), \n            c2ws_fusion[cam_inds].inverse(), \n            intrinsics,\n            simplify=mesh_reduction,\n            verbose=False\n        )\n        mesh_fine_path = os.path.join(self.output_dir, 'mesh.glb')\n\n        out_mesh.export(mesh_fine_path)\n        print(f\"Save optimized mesh at {mesh_fine_path}\")\n        t5 = time.time()\n\n        print(f'Generate Gaussians: {t1-t0:.2f} seconds.')\n        print(f'Estimate poses: {t2-t1:.2f} seconds.')\n        print(f'Generate video: {t3-t2:.2f} seconds.')\n        print(f'Generate mesh: {t4-t3:.2f} seconds.')\n        print(f'Optimize mesh: {t5-t4:.2f} seconds.')\n\n        return gs_vis_path, video_path, mesh_fine_path, fig\n\n    def visualize_cameras_object(\n        self, \n        images, \n        c2ws, \n        focal_length, \n        legends=None,\n    ):\n        images = v2.functional.resize(images, 128, interpolation=3, antialias=True).clamp(0, 1)\n        images = (images.permute(0, 2, 3, 1).detach().cpu().numpy() * 255).astype(np.uint8)\n\n        cam2world = create_camera_to_world(torch.tensor([0, -2, 0]), camera_system='opencv').to(c2ws)\n        transform = cam2world @ torch.linalg.inv(c2ws[0:1])\n        c2ws = transform @ c2ws\n        c2ws = c2ws.detach().cpu().numpy()\n        c2ws[:, :, 1:3] *= -1   # opencv to opengl\n\n        focal_length = focal_length.mean().detach().cpu().numpy()\n        fov = np.rad2deg(np.arctan(256.0 / focal_length)) * 2\n\n        colors = [cmap(i / len(images))[:3] for i in range(len(images))]\n\n        legends = [None] * len(images) if legends is None else legends\n\n        viz = CameraVisualizer(c2ws, legends, colors, images=images)\n        fig = viz.update_figure(\n            3, \n            height=320,\n            line_width=5,\n            base_radius=1, \n            zoom_scale=1, \n            fov_deg=fov, \n            show_grid=True, \n            show_ticklabels=True, \n            show_background=True, \n            y_up=False,\n        )\n        return fig\n    \n    # FreeSplatter-S\n    def run_views_to_scene(\n        self, \n        image1,\n        image2,\n        cache_dir=None,\n    ):\n        torch.cuda.empty_cache()\n\n        self.output_dir = os.path.join(cache_dir, f'output_{uuid.uuid4()}')\n        os.makedirs(self.output_dir, exist_ok=True)\n\n        # preprocesss images\n        images = []\n        for image in [image1, image2]:\n            w, h = image.size\n            image = torch.from_numpy(np.asarray(image) / 255.0).float()\n            image = rearrange(image, 'h w c -> c h w')\n            image = v2.functional.center_crop(image, min(h, w))\n            image = v2.functional.resize(image, 512, interpolation=3, antialias=True).clamp(0, 1)\n            images.append(image)\n\n        images = torch.stack(images, dim=0)\n        images_vis = v2.functional.to_pil_image(rearrange(images, 'n c h w -> c h (n w)'))\n\n        # run reconstruction\n        legends = [f'V{i}' for i in range(1, 1+len(images))]\n\n        gs_vis_path, video_path, fig = self.run_freesplatter_scene(images, legends=legends)\n\n        return images_vis, gs_vis_path, video_path, fig\n    \n    def run_freesplatter_scene(\n        self, \n        images, \n        legends=None, \n    ):\n        torch.cuda.empty_cache()\n\n        freesplatter = self.freesplatter_scene\n\n        device = self.device\n        images = images.to(device)\n        \n        t0 = time.time()\n        with torch.inference_mode():\n            gaussians = freesplatter.forward_gaussians(images.unsqueeze(0))\n        t1 = time.time()\n\n        # estimate camera parameters\n        c2ws_pred, focals_pred = freesplatter.estimate_poses(images, gaussians, use_first_focal=True, pnp_iter=10)\n        # rescale cameras to make the baseline equal to 1.0\n        baseline_pred = (c2ws_pred[:, :3, 3] - c2ws_pred[:1, :3, 3]).norm() + 1e-2\n        scale_factor = 1.0 / baseline_pred\n        c2ws_pred = c2ws_pred.clone()\n        c2ws_pred[:, :3, 3] *= scale_factor\n        # visualize cameras\n        fig = self.visualize_cameras_scene(images, c2ws_pred, focals_pred, legends=legends)\n        t2 = time.time()\n        \n        # save gaussians\n        gs_vis_path = os.path.join(self.output_dir, 'gs_vis.ply')\n        save_gaussian(gaussians, gs_vis_path, freesplatter, opacity_threshold=5e-3)\n        print(f'Save gaussian at {gs_vis_path}')\n\n        # render video\n        with torch.inference_mode():\n            c2ws_video = generate_interpolated_path(c2ws_pred.detach().cpu().numpy()[:, :3, :], n_interp=120)\n            c2ws_video = torch.cat([\n                torch.from_numpy(c2ws_video), \n                torch.tensor([0, 0, 0, 1]).reshape(1, 1, 4).repeat(c2ws_video.shape[0], 1, 1)\n            ], dim=1).to(gaussians)\n            fx = fy = focals_pred.mean() / 512.0\n            cx = cy = torch.ones_like(fx) * 0.5\n            fxfycxcy_video = torch.tensor([fx, fy, cx, cy]).unsqueeze(0).repeat(c2ws_video.shape[0], 1).to(device)\n\n            video_frames = freesplatter.forward_renderer(\n                gaussians,\n                c2ws_video.unsqueeze(0),\n                fxfycxcy_video.unsqueeze(0),\n                rescale=scale_factor.reshape(1).to(gaussians)\n            )['image'][0].clamp(0, 1)\n\n        video_path = os.path.join(self.output_dir, 'gs.mp4')\n        save_video(video_frames, video_path, fps=30)\n        print(f'Save video at {video_path}')\n        t3 = time.time()\n\n        print(f'Generate Gaussians: {t1-t0:.2f} seconds.')\n        print(f'Estimate poses: {t2-t1:.2f} seconds.')\n        print(f'Generate video: {t3-t2:.2f} seconds.')\n\n        return gs_vis_path, video_path, fig\n\n    def visualize_cameras_scene(\n        self, \n        images, \n        c2ws, \n        focal_length, \n        legends=None,\n    ):\n        images = v2.functional.resize(images, 128, interpolation=3, antialias=True).clamp(0, 1)\n        images = (images.permute(0, 2, 3, 1).detach().cpu().numpy() * 255).astype(np.uint8)\n\n        c2ws = c2ws.detach().cpu().numpy()\n        c2ws[:, :, 1:3] *= -1\n\n        focal_length = focal_length.mean().detach().cpu().numpy()\n        fov = np.rad2deg(np.arctan(256.0 / focal_length)) * 2\n\n        colors = [cmap(i / len(images))[:3] for i in range(len(images))]\n\n        legends = [None] * len(images) if legends is None else legends\n\n        viz = CameraVisualizer(c2ws, legends, colors, images=images)\n        fig = viz.update_figure(\n            2, \n            height=320,\n            line_width=5,\n            base_radius=1, \n            zoom_scale=1, \n            fov_deg=fov, \n            show_grid=True, \n            show_ticklabels=True, \n            show_background=True, \n            y_up=False,\n        )\n        return fig"
  },
  {
    "path": "freesplatter/webui/shared_opts.py",
    "content": "import random\nimport gradio as gr\nfrom functools import partial\nfrom .gradio_custommodel3d import CustomModel3D\n\n\ndef create_prompt_opts(var_dict):\n    var_dict['prompt'] = gr.Textbox(\n        label='Prompt', show_label=False, lines=1, placeholder='Prompt', container=False, interactive=True)\n    var_dict['negative_prompt'] = gr.Textbox(\n        label='Negative prompt', show_label=False, lines=1,\n        placeholder='Negative prompt', container=False, interactive=True)\n\n\ndef create_generate_bar(var_dict, text='Generate', variant='primary', seed=-1):\n    with gr.Row(equal_height=False):\n        var_dict['run_btn'] = gr.Button(text, variant=variant, scale=2)\n        var_dict['seed'] = gr.Number(\n            label='Seed', value=seed, min_width=100, precision=0, minimum=-1, maximum=2 ** 31,\n            elem_classes=['force-hide-container'])\n        var_dict['random_seed'] = gr.Button('\\U0001f3b2\\ufe0f', elem_classes=['tool'])\n        var_dict['reuse_seed'] = gr.Button('\\u267b\\ufe0f', elem_classes=['tool'])\n        with gr.Column(visible=False):\n            var_dict['last_seed'] = gr.Number(value=seed, label='Last seed')\n    var_dict['reuse_seed'].click(\n        fn=lambda x: x,\n        inputs=var_dict['last_seed'],\n        outputs=var_dict['seed'],\n        show_progress=False,\n        api_name=False)\n    var_dict['random_seed'].click(\n        fn=lambda: -1,\n        outputs=var_dict['seed'],\n        show_progress=False,\n        api_name=False)\n\n\ndef create_base_opts(var_dict,\n                     scheduler='DPMSolverMultistep',\n                     scheduler_dropdown=['DPMSolverMultistep', 'DPMSolverMultistepKarras',\n                                         'EulerAncestralDiscrete', 'DDIM'],\n                     steps=24,\n                     denoising_strength=0.5,\n                     random_init=False,\n                     cfg_scale=7,\n                     render=True):\n    with gr.Column(variant='compact', elem_classes=['custom-spacing'], render=render) as base_opts:\n        with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n            var_dict['scheduler'] = gr.Dropdown(\n                scheduler_dropdown, value=scheduler, label='Sampling method',\n                elem_classes=['force-hide-container'])\n            var_dict['steps'] = gr.Slider(\n                1, 64, value=steps, step=1, label='Sampling steps', elem_classes=['force-hide-container'])\n        if denoising_strength is not None:\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['denoising_strength'] = gr.Slider(\n                    minimum=0.0, maximum=1.0, step=0.01, label='Denoising strength', value=denoising_strength, scale=3,\n                    elem_classes=['force-hide-container'])\n                var_dict['random_init'] = gr.Checkbox(\n                    label='Random initialization', value=random_init, container=False)\n        var_dict['cfg_scale'] = gr.Slider(\n            0.0, 30.0, value=cfg_scale, step=0.5, label='CFG scale', elem_classes=['force-hide-container'])\n    return base_opts\n\n\ndef create_auxiliary_prompt_opts(var_dict, aux_prompt='', aux_negative_prompt=''):\n    with gr.Accordion('Auxiliary text prompts', open=False, elem_classes=['custom-spacing']):\n        with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['aux_prompt'] = gr.Textbox(\n                    label='Prompt', value=aux_prompt, lines=1, elem_classes=['force-hide-container'])\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['aux_negative_prompt'] = gr.Textbox(\n                    label='Negative prompt', value=aux_negative_prompt, lines=1, elem_classes=['force-hide-container'])\n\n\ndef create_batch_size_opts(var_dict,\n                           diff_bs=10,\n                           patch_size=128,\n                           patch_bs_nerf=1,\n                           render_bs=8,\n                           patch_bs=8):\n    if diff_bs is not None:\n        with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n            var_dict['diff_bs'] = gr.Slider(\n                1, 32, value=diff_bs, step=1, label='Diffusion batch size (# of views)',\n                elem_classes=['force-hide-container'])\n    with gr.Accordion('Optimization batch size', open=False, elem_classes=['custom-spacing']):\n        with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['patch_size'] = gr.Dropdown(\n                    [128, 256, 512], value=patch_size, label='Patch size', elem_classes=['force-hide-container'])\n            if patch_bs_nerf is not None:\n                with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                    var_dict['patch_bs_nerf'] = gr.Slider(\n                        1, 16, value=1, step=1, label='NeRF rendering batch size (# of patches)',\n                        elem_classes=['force-hide-container'])\n            if render_bs is not None:\n                with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                    var_dict['render_bs'] = gr.Slider(\n                        1, 32, value=render_bs, step=1, label='Mesh rendering batch size (# of views)',\n                        elem_classes=['force-hide-container'])\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['patch_bs'] = gr.Slider(\n                    1, 32, value=patch_bs, step=1, label='LPIPS batch size (# of patches)',\n                    elem_classes=['force-hide-container'])\n\n\ndef create_loss_sliders(var_dict,\n                        alpha_soften=0.02,\n                        normal_reg_weight=4.0,\n                        start_entropy_weight=0.0,\n                        end_entropy_weight=3.0,\n                        entropy_d=0.015,\n                        mesh_smoothness=5.0):\n    with gr.Accordion('Optimization loss functions', open=False):\n        with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n            var_dict['alpha_soften'] = gr.Slider(\n                0.0, 0.1, value=alpha_soften, step=0.001,\n                label='Alpha softening', elem_classes=['force-hide-container'])\n            var_dict['normal_reg_weight'] = gr.Slider(\n                0.0, 20.0, value=normal_reg_weight, step=0.1,\n                label='Normal regularization weight', elem_classes=['force-hide-container'])\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['start_entropy_weight'] = gr.Slider(\n                    0.0, 20.0, value=start_entropy_weight, step=0.1,\n                    label='Start entropy weight', elem_classes=['force-hide-container'])\n                var_dict['end_entropy_weight'] = gr.Slider(\n                    0.0, 20.0, value=end_entropy_weight, step=0.1,\n                    label='End entropy weight', elem_classes=['force-hide-container'])\n            var_dict['entropy_d'] = gr.Slider(\n                0.0, 0.1, value=entropy_d, step=0.001,\n                label='Entropy loss d (background correction)', elem_classes=['force-hide-container'])\n            var_dict['mesh_smoothness'] = gr.Slider(\n                0.0, 20.0, value=mesh_smoothness, step=0.1,\n                label='Mesh smoothness', elem_classes=['force-hide-container'])\n\n\ndef create_optimization_opts(var_dict,\n                             main_label='NeRF/mesh optimization steps',\n                             n_inverse_steps=80,\n                             init_inverse_steps=512,\n                             tet_init_inverse_steps=120,\n                             start_lr=0.01,\n                             end_lr=0.005,\n                             tet_resolution=128):\n    if init_inverse_steps is not None or tet_init_inverse_steps is not None:\n        with gr.Accordion('Optimization steps', open=False):\n            with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n                with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                    var_dict['n_inverse_steps'] = gr.Slider(\n                        0, 1024, value=n_inverse_steps, step=1,\n                        label=main_label, elem_classes=['force-hide-container'])\n                with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                    var_dict['init_inverse_steps'] = gr.Slider(\n                        0, 1024, value=init_inverse_steps, step=1,\n                        label='Initial NeRF optimization steps', elem_classes=['force-hide-container'])\n                if tet_init_inverse_steps is not None:\n                    with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                        var_dict['tet_init_inverse_steps'] = gr.Slider(\n                            0, 1024, value=tet_init_inverse_steps, step=1,\n                            label='DMTet conversion optimization steps', elem_classes=['force-hide-container'])\n    with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n        if init_inverse_steps is None and tet_init_inverse_steps is None:\n            with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                var_dict['n_inverse_steps'] = gr.Slider(\n                    0, 1024, value=n_inverse_steps, step=1,\n                    label=main_label, elem_classes=['force-hide-container'])\n        with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n            var_dict['start_lr'] = gr.Slider(0.0, 0.1, value=start_lr, step=0.001,\n                                             label='Start learning rate', elem_classes=['force-hide-container'])\n            var_dict['end_lr'] = gr.Slider(\n                0.0, 0.1, value=end_lr, step=0.001, label='End learning rate', elem_classes=['force-hide-container'])\n        if tet_resolution is not None:\n            var_dict['tet_resolution'] = gr.Dropdown(\n                [128, 256], value=tet_resolution, label='DMTet resolution', elem_classes=['force-hide-container'])\n\n\ndef create_stablessdnerf_opts(\n        var_dict,\n        stablessdnerf_signatures,\n        scheduler='EulerAncestralDiscrete',\n        scheduler_dropdown=[\n            'DDIM',\n            'DDPM',\n            'DEISMultistep',\n            'DPMSolverMultistep',\n            'DPMSolverSDE',\n            'DPMSolverSinglestep',\n            'EulerAncestralDiscrete',\n            'EulerDiscrete',\n            'HeunDiscrete',\n            'KDPM2AncestralDiscrete',\n            'KDPM2Discrete',\n            'LMSDiscrete',\n            'PNDM',\n            'UniPCMultistep'],\n        steps=32):\n    with gr.Accordion('StableSSDNeRF options', open=False):\n        create_base_opts(\n            var_dict, scheduler=scheduler, scheduler_dropdown=scheduler_dropdown,\n            steps=steps, denoising_strength=None,\n            cfg_scale=stablessdnerf_signatures['cfg_scale'])\n\n\ndef create_superres_opts(\n        var_dict,\n        superres_signatures,\n        do_superres=True, scheduler='DPMSolverSDEKarras',\n        scheduler_dropdown=[\n            'DPMSolverSDE', 'DPMSolverMultistep', 'DPMSolverSDEKarras', 'DPMSolverMultistepKarras',\n            'EulerAncestralDiscrete', 'DDIM'],\n        steps=24, denoising_strength=0.4, random_init=False,\n        n_inverse_steps=48,\n        show_advanced=True):\n    var_dict['do_superres'] = gr.Checkbox(label='Texture super-resolution', value=do_superres, container=False)\n    with gr.Accordion('Texture super-resolution options', open=False):\n        create_base_opts(\n            var_dict, scheduler=scheduler, scheduler_dropdown=scheduler_dropdown,\n            steps=steps, denoising_strength=denoising_strength,\n            random_init=random_init, cfg_scale=superres_signatures['cfg_scale'])\n        if show_advanced:\n            gr.Markdown('### Advanced settings')\n            var_dict['checkpoint'] = gr.Textbox(\n                label='Stable Diffusion v1.5 checkpoint', lines=1, value=superres_signatures['checkpoint'],\n                elem_classes=['force-hide-container'])\n            create_auxiliary_prompt_opts(\n                var_dict, aux_prompt=superres_signatures['aux_prompt'],\n                aux_negative_prompt=superres_signatures['aux_negative_prompt'])\n            create_batch_size_opts(\n                var_dict, diff_bs=None, patch_size=superres_signatures['patch_size'],\n                patch_bs_nerf=None, render_bs=None, patch_bs=superres_signatures['patch_bs'])\n            create_optimization_opts(\n                var_dict, main_label='Texture optimization steps', n_inverse_steps=n_inverse_steps,\n                init_inverse_steps=None, tet_init_inverse_steps=None,\n                start_lr=superres_signatures['start_lr'], end_lr=superres_signatures['end_lr'], tet_resolution=None)\n\n\ndef on_select(evt: gr.SelectData):\n    print('Selected: ', evt.index)\n    return evt.index\n\n\ndef create_mesh_input(var_dict, cache_dir, preproc_api, render_bs=8, api_name=None):\n    var_dict['in_mesh'] = CustomModel3D(\n        height=400, label='Input 3D model (.glb)', interactive=True)\n    with gr.Column(visible=False):\n        var_dict['proc_mesh'] = gr.Textbox(interactive=False, label='Processed mesh')\n        var_dict['front_view_id'] = gr.Number(interactive=False, label='Front view ID')\n    var_dict['in_mv'] = gr.Gallery(\n        columns=6, rows=2, interactive=False, label='Select the front view (optional)',\n        height=244, type='pil', allow_preview=False)\n    var_dict['preproc_kwargs'] = dict(\n        fn=partial(preproc_api, cache_dir=cache_dir, render_bs=render_bs),\n        inputs=var_dict['in_mesh'],\n        outputs=[var_dict['in_mv'], var_dict['proc_mesh'], var_dict['front_view_id']],\n        concurrency_id='default_group')\n    var_dict['in_mesh'].change(\n        **var_dict['preproc_kwargs'],\n        api_name=api_name)\n    var_dict['in_mv'].select(\n        fn=on_select,\n        inputs=None,\n        outputs=var_dict['front_view_id'],\n        api_name=False)\n\n\ndef create_send_buttons(var_dict):\n    with gr.Row():\n        var_dict['to_text_3d_to_3d'] = gr.Button('To Text-Guided 3D-to-3D')\n        var_dict['to_instruct_3d_to_3d'] = gr.Button('To Instruct 3D-to-3D')\n    with gr.Row():\n        var_dict['to_text_retex'] = gr.Button('To Txt/Img-Guided Re-Texturing')\n        var_dict['to_instruct_retex'] = gr.Button('To Instruct Re-Texturing')\n    with gr.Row():\n        var_dict['export_video'] = gr.Button('Export Video')\n\n\ndef set_seed(seed):\n    seed = random.randint(0, 2**31) if seed == -1 else seed\n    return seed\n\n\ndef send_to_click(*inputs, target_tab_ids=None):\n    assert isinstance(target_tab_ids, list)\n    out_tabs = [gr.Tabs(selected=target_tab_id) for target_tab_id in target_tab_ids]\n    return *inputs, *out_tabs\n"
  },
  {
    "path": "freesplatter/webui/style.css",
    "content": ".force-hide-container {\n    margin: 0;\n    box-shadow: none;\n    --block-border-width: 0;\n    background: transparent;\n    padding: 0;\n    overflow: visible;\n}\n\n.svelte-sfqy0y {\n    display: flex;\n    flex-direction: inherit;\n    flex-wrap: wrap;\n    gap: 0;\n    box-shadow: none;\n    border: 0;\n    border-radius: 0;\n    background: transparent;\n    overflow-y: hidden;\n}\n\n.custom-spacing {\n    padding: 10px;\n    gap: 20px;\n    flex-grow: 0 !important;\n}\n\n.unequal-height {\n    align-items: flex-end;\n}\n\n.tool{\n    max-width: 40px;\n    min-width: 40px !important;\n}\n"
  },
  {
    "path": "freesplatter/webui/tab_img_to_3d.py",
    "content": "import random\nimport gradio as gr\nfrom functools import partial\nfrom .gradio_custommodel3d import CustomModel3D\nfrom .gradio_customgs import CustomGS\n\n\ndef create_interface_img_to_3d(segmentation_api, freesplatter_api, model='Zero123++ v1.2'):\n    default_views = {\n        'Zero123++ v1.1': ['Input', 'V2', 'V3', 'V5'],\n        'Zero123++ v1.2': ['V1', 'V2', 'V3', 'V5', 'V6'],\n        'Hunyuan3D Std': ['V1', 'V2', 'V4', 'V6']\n    }\n    views_info = {\n        'Zero123++ v1.1': 'View poses (azimuth, elevation): V1(30, 30), V2(90, -20), V3(150, 30), V4(-150, -20), V5(-90, 30), V6(-30, -20)',\n        'Zero123++ v1.2': 'View poses (azimuth, elevation): V1(30, 20), V2(90, -10), V3(150, 20), V4(-150, -10), V5(-90, 20), V6(-30, -10)',\n        'Hunyuan3D Std': 'View poses (azimuth, elevation): V1(0, 0), V2(60, 0), V3(120, 0), V4(180, 0), V5(-120, 0), V6(-60, 0)',\n    }\n\n    var_dict = dict()\n    with gr.Blocks(analytics_enabled=False) as interface:\n        with gr.Row():\n            with gr.Column(scale=1):\n                with gr.Row():\n                    var_dict['in_image'] = gr.Image(\n                        label='Input image',\n                        type='pil', \n                        image_mode='RGBA', \n                    )\n                    var_dict['fg_image'] = gr.Image(\n                        label='Segmented foreground', \n                        type='pil', \n                        interactive=False, \n                        image_mode='RGBA',\n                    )\n                \n                with gr.Accordion(\"Diffusion settings\", open=True):\n                    with gr.Row():\n                        var_dict['do_rembg'] = gr.Checkbox(\n                            label='Remove background', \n                            value=True, \n                            container=False,\n                        )\n                    with gr.Row():\n                        with gr.Column():\n                            var_dict['seed'] = gr.Number(\n                                label='Random seed', \n                                value=42, \n                                min_width=100, \n                                precision=0, \n                                minimum=0, \n                                maximum=2 ** 31,\n                                elem_classes=['force-hide-container'],\n                            )\n                            var_dict['random_seed'] = gr.Button(\n                                '\\U0001f3b2\\ufe0f Try your luck!', \n                                elem_classes=['tool'],\n                            )\n                        with gr.Column():\n                            var_dict['diffusion_steps'] = gr.Slider(\n                                label=\"Sampling steps\",\n                                minimum=15,\n                                maximum=75,\n                                value=30,\n                                step=5,\n                            )\n                            var_dict['guidance_scale'] = gr.Slider(\n                                label=\"Guidance scale\",\n                                minimum=1,\n                                maximum=10,\n                                value=4,\n                                step=1,\n                            )\n\n                with gr.Accordion(\"Reconstruction settings\", open=True):\n                    with gr.Row():\n                        var_dict['view_indices'] = gr.CheckboxGroup(\n                            choices=['Input', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6'],\n                            value=default_views[model],\n                            type='index',\n                            label='Views used for reconstruction',\n                            info='Using input image is only recommended for Zero123++ v1.1',\n                        )\n                    with gr.Row():\n                        var_dict['gs_type'] = gr.Radio(\n                            choices=['2DGS', '3DGS'],\n                            value='2DGS', \n                            type='value',\n                            label='Gaussian splatting type', \n                            info='2DGS often leads to better mesh geometry'\n                        )\n                        var_dict['mesh_reduction'] = gr.Slider(\n                            label=\"Mesh simplification ratio\",\n                            info='Larger ratio leads to less faces',\n                            minimum=0.8,\n                            maximum=0.95,\n                            value=0.95,\n                            step=0.05,\n                        )\n                with gr.Row(equal_height=False):\n                    var_dict['run_btn'] = gr.Button('Generate', variant='primary', scale=2)\n                with gr.Row(visible=False):\n                    var_dict['model'] = gr.Textbox(value=model, label='Model')\n\n                gr.Examples(\n                    examples='examples/img_to_3d',\n                    inputs=var_dict['in_image'],\n                    cache_examples=False,\n                    label='Examples (click one of the images below to start)',\n                    examples_per_page=21,\n                )\n\n            with gr.Column(scale=1):\n                var_dict['out_multiview'] = gr.Image(\n                    label='Generated views', \n                    interactive=False, \n                    image_mode='RGBA',\n                )\n                var_dict['out_pose'] = gr.Plot(\n                    label='Estimated poses', \n                )\n                var_dict['out_gs_vis'] = CustomGS(\n                    label='Output GS', \n                    interactive=False, \n                    height=320,\n                )\n                var_dict['out_video'] = gr.Video(\n                    label='Output video', \n                    interactive=False, \n                    autoplay=True, \n                    height=320,\n                )\n                var_dict['out_mesh'] = CustomModel3D(\n                    label='Output mesh', \n                    interactive=False, \n                    height=400,\n                )\n\n        var_dict['run_btn'].click(\n            fn=segmentation_api, \n            inputs=var_dict['in_image'],\n            outputs=var_dict['fg_image'], \n            concurrency_id='default_group',\n            api_name='run_segmentation',\n        ).success(\n            fn=partial(freesplatter_api, cache_dir=interface.GRADIO_CACHE),\n            inputs=[var_dict['fg_image'], \n                    var_dict['model'], \n                    var_dict['diffusion_steps'], \n                    var_dict['guidance_scale'], \n                    var_dict['seed'], \n                    var_dict['view_indices'],\n                    var_dict['gs_type'], \n                    var_dict['mesh_reduction']],\n            outputs=[var_dict['out_multiview'], var_dict['out_gs_vis'], var_dict['out_video'], var_dict['out_mesh'], var_dict['out_pose']], \n            concurrency_id='default_group',\n            api_name='run_image_to_3d',\n        )\n\n        var_dict['random_seed'].click(\n            fn=lambda: random.randint(0, 2 ** 31),\n            outputs=var_dict['seed'],\n            show_progress=False,\n            api_name=False,\n        )\n\n    return interface, var_dict\n"
  },
  {
    "path": "freesplatter/webui/tab_instant3d.py",
    "content": "import gradio as gr\nfrom functools import partial\nfrom .gradio_custommodel3d import CustomModel3D\nfrom .shared_opts import create_generate_bar, set_seed\nfrom .gradio_customgs import CustomGS\n\n\ndef create_interface_instant3d(\n        grm_api, examples=None):\n    var_dict = dict()\n    with gr.Blocks(analytics_enabled=False) as interface:\n        with gr.Row():\n            with gr.Column():\n                var_dict['prompt'] = gr.Textbox(\n                    label='Prompt', show_label=False, lines=1, placeholder='Prompt', container=False, interactive=True)\n                if examples is not None:\n                    gr.Examples(\n                        examples=examples,\n                        inputs=var_dict['prompt'],\n                        label='Examples (click one of the items below to start)',\n                        api_name=False)\n                var_dict['fuse_mesh'] = gr.Checkbox(\n                    label='Fuse mesh to get 3D model', value=False, container=False)\n                create_generate_bar(var_dict, text='Generate', seed=-1)\n\n            with gr.Column():\n                var_dict['out_gs_vis'] = CustomGS(\n                    label='Output GS', interactive=False, height=400)\n                var_dict['out_gs'] = gr.File(\n                    label='Output GS (download)', interactive=False)\n                var_dict['out_video'] = gr.Video(\n                    label='Output video', interactive=False, autoplay=True, height=320)\n                var_dict['out_mesh'] = CustomModel3D(\n                    label='Output mesh', interactive=False, height=400)\n\n        var_dict['run_btn'].click(\n            fn=set_seed,\n            inputs=var_dict['seed'],\n            outputs=var_dict['last_seed'], api_name=False\n        ).success(\n            fn=partial(grm_api, cache_dir=interface.GRADIO_CACHE),\n            inputs=[var_dict['last_seed'], var_dict['prompt'], var_dict['fuse_mesh']],\n            outputs=[var_dict[k] for k in ['out_gs_vis', 'out_gs', 'out_video', 'out_mesh']], concurrency_id='default_group',\n            api_name='run_instant3d'\n        )\n\n    return interface, var_dict\n"
  },
  {
    "path": "freesplatter/webui/tab_text_to_img_to_3d.py",
    "content": "import gradio as gr\nfrom functools import partial\nfrom .shared_opts import create_base_opts, create_generate_bar, create_auxiliary_prompt_opts, \\\n    set_seed, create_prompt_opts\nfrom .parameters import image_defaults\n\n\ndef create_interface_text_to_img_to_3d(sd_api, examples=None, advanced=True):\n    var_dict = dict()\n    with gr.Blocks(analytics_enabled=False) as interface:\n        md_txt = ('Generic text-to-3D can be achieved by chaining text-to-image and image-to-3D. '\n                  'This tab provides a simple text-to-image interface based on Stable Diffusion (`'\n                  + image_defaults['checkpoint'] + '` by default).<br>'\n                  'After generating the image, you can send the results **to Image-to-3D**.')\n        gr.Markdown(md_txt)\n        with gr.Row():\n            with gr.Column():\n                with gr.Column(variant='compact', elem_classes=['custom-spacing']):\n                    with gr.Row(variant='compact', elem_classes=['force-hide-container']):\n                        var_dict['width'] = gr.Slider(\n                            label='Width', minimum=64, maximum=2048, step=8, value=image_defaults['width'],\n                            elem_classes=['force-hide-container'])\n                        var_dict['switch_hw'] = gr.Button('\\U000021C6', elem_classes=['tool'])\n                        var_dict['height'] = gr.Slider(\n                            label='Height', minimum=64, maximum=2048, step=8, value=image_defaults['height'],\n                            elem_classes=['force-hide-container'])\n                        var_dict['switch_hw'].click(\n                            fn=lambda w, h: (h, w),\n                            inputs=[var_dict['width'], var_dict['height']],\n                            outputs=[var_dict['width'], var_dict['height']],\n                            show_progress=False,\n                            api_name=False)\n                create_prompt_opts(var_dict)\n                if examples is not None:\n                    gr.Examples(\n                        examples=examples,\n                        inputs=[var_dict[k] for k in ['width', 'height', 'prompt', 'negative_prompt']],\n                        label='Examples (click one of the rows below to start)',\n                        api_name=False)\n                create_generate_bar(var_dict, text='Generate', seed=-1)\n                create_base_opts(\n                    var_dict, scheduler='DPMSolverMultistep',\n                    scheduler_dropdown=[\n                        'DPMSolverSDE', 'DPMSolverMultistep', 'DPMSolverSDEKarras', 'DPMSolverMultistepKarras',\n                        'EulerAncestralDiscrete', 'DDIM'],\n                    steps=32, denoising_strength=None, cfg_scale=image_defaults['cfg_scale'])\n                if advanced:\n                    gr.Markdown('### Advanced settings')\n                    create_auxiliary_prompt_opts(\n                        var_dict, **{key: image_defaults[key] for key in ['aux_prompt', 'aux_negative_prompt']})\n\n            with gr.Column():\n                var_dict['output_image'] = gr.Image(\n                    type='pil', image_mode='RGB', label='Output image', interactive=False)\n                var_dict['to_img_to_3d'] = gr.Button('To Image-to-3D')\n\n        default_var_dict = {\n            k: v for k, v in image_defaults.items()\n            if k not in var_dict}\n        text_to_img_fun = partial(sd_api, **default_var_dict)\n        img_to_3d_inputs = [var_dict[k] for k in image_defaults.keys()\n                            if k not in default_var_dict]\n\n        var_dict['run_btn'].click(\n            fn=set_seed,\n            inputs=var_dict['seed'],\n            outputs=var_dict['last_seed'], api_name=False\n        ).success(\n            fn=text_to_img_fun,\n            inputs=[var_dict['last_seed']] + img_to_3d_inputs,\n            outputs=var_dict['output_image'],\n            concurrency_id='default_group', api_name='text_to_img'\n        )\n\n    return interface, var_dict\n"
  },
  {
    "path": "freesplatter/webui/tab_views_to_3d.py",
    "content": "import os\nimport glob\nimport gradio as gr\nfrom functools import partial\nfrom PIL import Image\nfrom .gradio_custommodel3d import CustomModel3D\nfrom .gradio_customgs import CustomGS\n\n\ndef create_interface_views_to_3d(freesplatter_api):\n    example_root = 'examples/views_to_3d'\n    examples = []\n    for dir in os.listdir(example_root):\n        sample_dir = os.path.join(example_root, dir)\n        input_files = sorted(glob.glob(f'{sample_dir}/*.png')+glob.glob(f'{sample_dir}/*.jpg'))\n        examples.append(input_files)\n\n    var_dict = dict()\n    with gr.Blocks(analytics_enabled=False) as interface:\n        with gr.Row():\n            with gr.Column(scale=1):\n                with gr.Row():\n                    var_dict['image_files'] = gr.Gallery(\n                        label='Input images',\n                        type=\"filepath\",\n                        file_types=['image'],\n                        show_label=False,\n                        columns=[5],\n                        rows=[2],\n                        object_fit='contain',\n                        height=\"auto\",\n                    )\n                \n                with gr.Accordion(\"Reconstruction settings\", open=True):\n                    with gr.Row():\n                        var_dict['do_rembg'] = gr.Checkbox(\n                            label='Remove background', \n                            value=False, \n                            container=False,\n                        )\n                    with gr.Row():\n                        var_dict['gs_type'] = gr.Radio(\n                            choices=['2DGS', '3DGS'],\n                            value='2DGS', \n                            type='value',\n                            label='Gaussian splatting type', \n                            info='2DGS often leads to better mesh geometry',\n                        )\n                        var_dict['mesh_reduction'] = gr.Slider(\n                            label=\"Mesh simplification ratio\",\n                            info='Larger ratio leads to less faces',\n                            minimum=0.8,\n                            maximum=0.95,\n                            value=0.95,\n                            step=0.05,\n                        )\n                with gr.Row(equal_height=False):\n                    var_dict['run_btn'] = gr.Button('Reconstruct', variant='primary', scale=2)\n                \n                with gr.Row():\n                    var_dict['out_multiview'] = gr.Image(\n                        label='Input views', \n                        interactive=False,\n                        visible=False,\n                    )\n\n                snapshot_1 = gr.Image(None, visible=False, image_mode='RGBA')\n                snapshot_2 = gr.Image(None, visible=False, image_mode='RGBA')\n                snapshot_3 = gr.Image(None, visible=False, image_mode='RGBA')\n                snapshot_4 = gr.Image(None, visible=False, image_mode='RGBA')\n                def set_gallery_images(*images):\n                    return list(images)\n\n                gr.Examples(\n                    examples=examples,\n                    fn=set_gallery_images,\n                    inputs=[snapshot_1, snapshot_2, snapshot_3, snapshot_4],\n                    outputs=[var_dict['image_files']],\n                    run_on_click=True,\n                    cache_examples=False,\n                    label='Examples (click one of the rows below to start)',\n                    examples_per_page=5,\n                )\n\n            with gr.Column(scale=1):\n                var_dict['out_pose'] = gr.Plot(\n                    label='Estimated poses', \n                )\n                var_dict['out_gs_vis'] = CustomGS(\n                    label='Output GS', \n                    interactive=False, \n                    height=320,\n                )\n                var_dict['out_video'] = gr.Video(\n                    label='Output video', \n                    interactive=False, \n                    autoplay=True, \n                    height=320,\n                )\n                var_dict['out_mesh'] = CustomModel3D(\n                    label='Output mesh', \n                    interactive=False, \n                    height=400,\n                )\n\n        var_dict['run_btn'].click(\n            fn=partial(freesplatter_api, cache_dir=interface.GRADIO_CACHE),\n            inputs=[var_dict['image_files'], \n                    var_dict['do_rembg'], \n                    var_dict['gs_type'], \n                    var_dict['mesh_reduction']],\n            outputs=[var_dict['out_multiview'], var_dict['out_gs_vis'], var_dict['out_video'], var_dict['out_mesh'], var_dict['out_pose']], \n            concurrency_id='default_group',\n            api_name='run_views_to_3d',\n        )\n\n    return interface, var_dict\n"
  },
  {
    "path": "freesplatter/webui/tab_views_to_scene.py",
    "content": "import os\nimport glob\nimport gradio as gr\nfrom functools import partial\nfrom PIL import Image\nfrom .gradio_custommodel3d import CustomModel3D\nfrom .gradio_customgs import CustomGS\n\n\ndef create_interface_views_to_scene(freesplatter_api):\n    example_root = 'examples/views_to_scene'\n    examples = []\n    for dir in os.listdir(example_root):\n        sample_dir = os.path.join(example_root, dir)\n        input_files = sorted(glob.glob(f'{sample_dir}/*.png')+glob.glob(f'{sample_dir}/*.jpg'))\n        examples.append(input_files)\n\n    var_dict = dict()\n    with gr.Blocks(analytics_enabled=False) as interface:\n        with gr.Row():\n            with gr.Column(scale=1):\n                with gr.Row():\n                    var_dict['in_image_1'] = gr.Image(\n                        label='Input image 1',\n                        type='pil', \n                        image_mode='RGB', \n                    )\n                    var_dict['in_image_2'] = gr.Image(\n                        label='Input image 2',\n                        type='pil', \n                        image_mode='RGB', \n                    )\n                \n                with gr.Row(equal_height=False):\n                    var_dict['run_btn'] = gr.Button('Reconstruct', variant='primary', scale=2)\n                \n                with gr.Row():\n                    var_dict['out_multiview'] = gr.Image(\n                        label='Input views', \n                        interactive=False,\n                        visible=False,\n                    )\n\n                gr.Examples(\n                    examples=examples,\n                    inputs=[var_dict['in_image_1'], var_dict['in_image_2']],\n                    cache_examples=False,\n                    label='Examples (click one of the rows below to start)',\n                    examples_per_page=5,\n                )\n\n            with gr.Column(scale=1):\n                var_dict['out_pose'] = gr.Plot(\n                    label='Estimated poses', \n                )\n                var_dict['out_gs_vis'] = CustomGS(\n                    label='Output GS', \n                    interactive=False, \n                    height=320,\n                )\n                var_dict['out_video'] = gr.Video(\n                    label='Output video', \n                    interactive=False, \n                    autoplay=True, \n                    height=320,\n                )\n\n        var_dict['run_btn'].click(\n            fn=partial(freesplatter_api, cache_dir=interface.GRADIO_CACHE),\n            inputs=[var_dict['in_image_1'], \n                    var_dict['in_image_2']],\n            outputs=[var_dict['out_multiview'], var_dict['out_gs_vis'], var_dict['out_video'], var_dict['out_pose']], \n            concurrency_id='default_group',\n            api_name='run_views_to_3d',\n        )\n\n    return interface, var_dict\n"
  },
  {
    "path": "requirements.txt",
    "content": "pytorch-lightning==2.4.0\neinops\nplotly\nomegaconf\ntrimesh\nrembg\ngradio==5.5.0\nhuggingface_hub[cli]==0.26.2\ntransformers==4.46.1\ntokenizers==0.20.1\ndiffusers==0.31.0\naccelerate==1.0.1\nxformers==0.0.22.post7\ngrpcio-status==1.33.2 \nprotobuf==3.20.2\nsafetensors\nimageio[ffmpeg]\nkornia \ntimm\nplyfile\nopen3d==0.18.0\nxatlas\nfpsample\nfast-simplification\nnumpy==1.26.1\ngit+https://github.com/ashawkey/diff-gaussian-rasterization.git\ngit+https://github.com/hbb1/diff-surfel-rasterization.git\ngit+https://github.com/NVlabs/nvdiffrast.git\ngit+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8"
  }
]